weapp-vite 5.2.1 → 5.2.3

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.
@@ -2863,7 +2863,7 @@ var ReaddirpStream = class extends _stream.Readable {
2863
2863
  this._directoryFilter = normalizeFilter(opts.directoryFilter);
2864
2864
  const statMethod = opts.lstat ? _promises.lstat : _promises.stat;
2865
2865
  if (wantBigintFsStats) {
2866
- this._stat = (path23) => statMethod(path23, { bigint: true });
2866
+ this._stat = (path25) => statMethod(path25, { bigint: true });
2867
2867
  } else {
2868
2868
  this._stat = statMethod;
2869
2869
  }
@@ -2888,8 +2888,8 @@ var ReaddirpStream = class extends _stream.Readable {
2888
2888
  const par = this.parent;
2889
2889
  const fil = par && par.files;
2890
2890
  if (fil && fil.length > 0) {
2891
- const { path: path23, depth } = par;
2892
- const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path23));
2891
+ const { path: path25, depth } = par;
2892
+ const slice = fil.splice(0, batch).map((dirent) => this._formatEntry(dirent, path25));
2893
2893
  const awaited = await Promise.all(slice);
2894
2894
  for (const entry of awaited) {
2895
2895
  if (!entry)
@@ -2929,20 +2929,20 @@ var ReaddirpStream = class extends _stream.Readable {
2929
2929
  this.reading = false;
2930
2930
  }
2931
2931
  }
2932
- async _exploreDir(path23, depth) {
2932
+ async _exploreDir(path25, depth) {
2933
2933
  let files;
2934
2934
  try {
2935
- files = await _promises.readdir.call(void 0, path23, this._rdOptions);
2935
+ files = await _promises.readdir.call(void 0, path25, this._rdOptions);
2936
2936
  } catch (error) {
2937
2937
  this._onError(error);
2938
2938
  }
2939
- return { files, depth, path: path23 };
2939
+ return { files, depth, path: path25 };
2940
2940
  }
2941
- async _formatEntry(dirent, path23) {
2941
+ async _formatEntry(dirent, path25) {
2942
2942
  let entry;
2943
2943
  const basename4 = this._isDirent ? dirent.name : dirent;
2944
2944
  try {
2945
- const fullPath = _path.resolve.call(void 0, _path.join.call(void 0, path23, basename4));
2945
+ const fullPath = _path.resolve.call(void 0, _path.join.call(void 0, path25, basename4));
2946
2946
  entry = { path: _path.relative.call(void 0, this._root, fullPath), fullPath, basename: basename4 };
2947
2947
  entry[this._statsProp] = this._isDirent ? dirent : await this._stat(fullPath);
2948
2948
  } catch (err) {
@@ -3343,16 +3343,16 @@ var delFromSet = (main, prop, item) => {
3343
3343
  };
3344
3344
  var isEmptySet = (val) => val instanceof Set ? val.size === 0 : !val;
3345
3345
  var FsWatchInstances = /* @__PURE__ */ new Map();
3346
- function createFsWatchInstance(path23, options, listener, errHandler, emitRaw) {
3346
+ function createFsWatchInstance(path25, options, listener, errHandler, emitRaw) {
3347
3347
  const handleEvent = (rawEvent, evPath) => {
3348
- listener(path23);
3349
- emitRaw(rawEvent, evPath, { watchedPath: path23 });
3350
- if (evPath && path23 !== evPath) {
3351
- fsWatchBroadcast(sysPath.resolve(path23, evPath), KEY_LISTENERS, sysPath.join(path23, evPath));
3348
+ listener(path25);
3349
+ emitRaw(rawEvent, evPath, { watchedPath: path25 });
3350
+ if (evPath && path25 !== evPath) {
3351
+ fsWatchBroadcast(sysPath.resolve(path25, evPath), KEY_LISTENERS, sysPath.join(path25, evPath));
3352
3352
  }
3353
3353
  };
3354
3354
  try {
3355
- return _fs.watch.call(void 0, path23, {
3355
+ return _fs.watch.call(void 0, path25, {
3356
3356
  persistent: options.persistent
3357
3357
  }, handleEvent);
3358
3358
  } catch (error) {
@@ -3368,12 +3368,12 @@ var fsWatchBroadcast = (fullPath, listenerType, val1, val2, val3) => {
3368
3368
  listener(val1, val2, val3);
3369
3369
  });
3370
3370
  };
3371
- var setFsWatchListener = (path23, fullPath, options, handlers) => {
3371
+ var setFsWatchListener = (path25, fullPath, options, handlers) => {
3372
3372
  const { listener, errHandler, rawEmitter } = handlers;
3373
3373
  let cont = FsWatchInstances.get(fullPath);
3374
3374
  let watcher;
3375
3375
  if (!options.persistent) {
3376
- watcher = createFsWatchInstance(path23, options, listener, errHandler, rawEmitter);
3376
+ watcher = createFsWatchInstance(path25, options, listener, errHandler, rawEmitter);
3377
3377
  if (!watcher)
3378
3378
  return;
3379
3379
  return watcher.close.bind(watcher);
@@ -3384,7 +3384,7 @@ var setFsWatchListener = (path23, fullPath, options, handlers) => {
3384
3384
  addAndConvert(cont, KEY_RAW, rawEmitter);
3385
3385
  } else {
3386
3386
  watcher = createFsWatchInstance(
3387
- path23,
3387
+ path25,
3388
3388
  options,
3389
3389
  fsWatchBroadcast.bind(null, fullPath, KEY_LISTENERS),
3390
3390
  errHandler,
@@ -3399,7 +3399,7 @@ var setFsWatchListener = (path23, fullPath, options, handlers) => {
3399
3399
  cont.watcherUnusable = true;
3400
3400
  if (isWindows && error.code === "EPERM") {
3401
3401
  try {
3402
- const fd = await _promises.open.call(void 0, path23, "r");
3402
+ const fd = await _promises.open.call(void 0, path25, "r");
3403
3403
  await fd.close();
3404
3404
  broadcastErr(error);
3405
3405
  } catch (err) {
@@ -3430,7 +3430,7 @@ var setFsWatchListener = (path23, fullPath, options, handlers) => {
3430
3430
  };
3431
3431
  };
3432
3432
  var FsWatchFileInstances = /* @__PURE__ */ new Map();
3433
- var setFsWatchFileListener = (path23, fullPath, options, handlers) => {
3433
+ var setFsWatchFileListener = (path25, fullPath, options, handlers) => {
3434
3434
  const { listener, rawEmitter } = handlers;
3435
3435
  let cont = FsWatchFileInstances.get(fullPath);
3436
3436
  const copts = cont && cont.options;
@@ -3452,7 +3452,7 @@ var setFsWatchFileListener = (path23, fullPath, options, handlers) => {
3452
3452
  });
3453
3453
  const currmtime = curr.mtimeMs;
3454
3454
  if (curr.size !== prev.size || currmtime > prev.mtimeMs || currmtime === 0) {
3455
- foreach(cont.listeners, (listener2) => listener2(path23, curr));
3455
+ foreach(cont.listeners, (listener2) => listener2(path25, curr));
3456
3456
  }
3457
3457
  })
3458
3458
  };
@@ -3480,13 +3480,13 @@ var NodeFsHandler = class {
3480
3480
  * @param listener on fs change
3481
3481
  * @returns closer for the watcher instance
3482
3482
  */
3483
- _watchWithNodeFs(path23, listener) {
3483
+ _watchWithNodeFs(path25, listener) {
3484
3484
  const opts = this.fsw.options;
3485
- const directory = sysPath.dirname(path23);
3486
- const basename4 = sysPath.basename(path23);
3485
+ const directory = sysPath.dirname(path25);
3486
+ const basename4 = sysPath.basename(path25);
3487
3487
  const parent = this.fsw._getWatchedDir(directory);
3488
3488
  parent.add(basename4);
3489
- const absolutePath = sysPath.resolve(path23);
3489
+ const absolutePath = sysPath.resolve(path25);
3490
3490
  const options = {
3491
3491
  persistent: opts.persistent
3492
3492
  };
@@ -3496,12 +3496,12 @@ var NodeFsHandler = class {
3496
3496
  if (opts.usePolling) {
3497
3497
  const enableBin = opts.interval !== opts.binaryInterval;
3498
3498
  options.interval = enableBin && isBinaryPath(basename4) ? opts.binaryInterval : opts.interval;
3499
- closer = setFsWatchFileListener(path23, absolutePath, options, {
3499
+ closer = setFsWatchFileListener(path25, absolutePath, options, {
3500
3500
  listener,
3501
3501
  rawEmitter: this.fsw._emitRaw
3502
3502
  });
3503
3503
  } else {
3504
- closer = setFsWatchListener(path23, absolutePath, options, {
3504
+ closer = setFsWatchListener(path25, absolutePath, options, {
3505
3505
  listener,
3506
3506
  errHandler: this._boundHandleError,
3507
3507
  rawEmitter: this.fsw._emitRaw
@@ -3523,7 +3523,7 @@ var NodeFsHandler = class {
3523
3523
  let prevStats = stats;
3524
3524
  if (parent.has(basename4))
3525
3525
  return;
3526
- const listener = async (path23, newStats) => {
3526
+ const listener = async (path25, newStats) => {
3527
3527
  if (!this.fsw._throttle(THROTTLE_MODE_WATCH, file, 5))
3528
3528
  return;
3529
3529
  if (!newStats || newStats.mtimeMs === 0) {
@@ -3537,11 +3537,11 @@ var NodeFsHandler = class {
3537
3537
  this.fsw._emit(EV.CHANGE, file, newStats2);
3538
3538
  }
3539
3539
  if ((isMacos || isLinux || isFreeBSD) && prevStats.ino !== newStats2.ino) {
3540
- this.fsw._closeFile(path23);
3540
+ this.fsw._closeFile(path25);
3541
3541
  prevStats = newStats2;
3542
3542
  const closer2 = this._watchWithNodeFs(file, listener);
3543
3543
  if (closer2)
3544
- this.fsw._addPathCloser(path23, closer2);
3544
+ this.fsw._addPathCloser(path25, closer2);
3545
3545
  } else {
3546
3546
  prevStats = newStats2;
3547
3547
  }
@@ -3573,7 +3573,7 @@ var NodeFsHandler = class {
3573
3573
  * @param item basename of this item
3574
3574
  * @returns true if no more processing is needed for this entry.
3575
3575
  */
3576
- async _handleSymlink(entry, directory, path23, item) {
3576
+ async _handleSymlink(entry, directory, path25, item) {
3577
3577
  if (this.fsw.closed) {
3578
3578
  return;
3579
3579
  }
@@ -3583,7 +3583,7 @@ var NodeFsHandler = class {
3583
3583
  this.fsw._incrReadyCount();
3584
3584
  let linkPath;
3585
3585
  try {
3586
- linkPath = await _promises.realpath.call(void 0, path23);
3586
+ linkPath = await _promises.realpath.call(void 0, path25);
3587
3587
  } catch (e) {
3588
3588
  this.fsw._emitReady();
3589
3589
  return true;
@@ -3593,12 +3593,12 @@ var NodeFsHandler = class {
3593
3593
  if (dir.has(item)) {
3594
3594
  if (this.fsw._symlinkPaths.get(full) !== linkPath) {
3595
3595
  this.fsw._symlinkPaths.set(full, linkPath);
3596
- this.fsw._emit(EV.CHANGE, path23, entry.stats);
3596
+ this.fsw._emit(EV.CHANGE, path25, entry.stats);
3597
3597
  }
3598
3598
  } else {
3599
3599
  dir.add(item);
3600
3600
  this.fsw._symlinkPaths.set(full, linkPath);
3601
- this.fsw._emit(EV.ADD, path23, entry.stats);
3601
+ this.fsw._emit(EV.ADD, path25, entry.stats);
3602
3602
  }
3603
3603
  this.fsw._emitReady();
3604
3604
  return true;
@@ -3627,9 +3627,9 @@ var NodeFsHandler = class {
3627
3627
  return;
3628
3628
  }
3629
3629
  const item = entry.path;
3630
- let path23 = sysPath.join(directory, item);
3630
+ let path25 = sysPath.join(directory, item);
3631
3631
  current2.add(item);
3632
- if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path23, item)) {
3632
+ if (entry.stats.isSymbolicLink() && await this._handleSymlink(entry, directory, path25, item)) {
3633
3633
  return;
3634
3634
  }
3635
3635
  if (this.fsw.closed) {
@@ -3638,8 +3638,8 @@ var NodeFsHandler = class {
3638
3638
  }
3639
3639
  if (item === target || !target && !previous.has(item)) {
3640
3640
  this.fsw._incrReadyCount();
3641
- path23 = sysPath.join(dir, sysPath.relative(dir, path23));
3642
- this._addToNodeFs(path23, initialAdd, wh, depth + 1);
3641
+ path25 = sysPath.join(dir, sysPath.relative(dir, path25));
3642
+ this._addToNodeFs(path25, initialAdd, wh, depth + 1);
3643
3643
  }
3644
3644
  }).on(EV.ERROR, this._boundHandleError);
3645
3645
  return new Promise((resolve8, reject) => {
@@ -3708,13 +3708,13 @@ var NodeFsHandler = class {
3708
3708
  * @param depth Child path actually targeted for watch
3709
3709
  * @param target Child path actually targeted for watch
3710
3710
  */
3711
- async _addToNodeFs(path23, initialAdd, priorWh, depth, target) {
3711
+ async _addToNodeFs(path25, initialAdd, priorWh, depth, target) {
3712
3712
  const ready = this.fsw._emitReady;
3713
- if (this.fsw._isIgnored(path23) || this.fsw.closed) {
3713
+ if (this.fsw._isIgnored(path25) || this.fsw.closed) {
3714
3714
  ready();
3715
3715
  return false;
3716
3716
  }
3717
- const wh = this.fsw._getWatchHelpers(path23);
3717
+ const wh = this.fsw._getWatchHelpers(path25);
3718
3718
  if (priorWh) {
3719
3719
  wh.filterPath = (entry) => priorWh.filterPath(entry);
3720
3720
  wh.filterDir = (entry) => priorWh.filterDir(entry);
@@ -3730,8 +3730,8 @@ var NodeFsHandler = class {
3730
3730
  const follow = this.fsw.options.followSymlinks;
3731
3731
  let closer;
3732
3732
  if (stats.isDirectory()) {
3733
- const absPath = sysPath.resolve(path23);
3734
- const targetPath = follow ? await _promises.realpath.call(void 0, path23) : path23;
3733
+ const absPath = sysPath.resolve(path25);
3734
+ const targetPath = follow ? await _promises.realpath.call(void 0, path25) : path25;
3735
3735
  if (this.fsw.closed)
3736
3736
  return;
3737
3737
  closer = await this._handleDir(wh.watchPath, stats, initialAdd, depth, target, wh, targetPath);
@@ -3741,29 +3741,29 @@ var NodeFsHandler = class {
3741
3741
  this.fsw._symlinkPaths.set(absPath, targetPath);
3742
3742
  }
3743
3743
  } else if (stats.isSymbolicLink()) {
3744
- const targetPath = follow ? await _promises.realpath.call(void 0, path23) : path23;
3744
+ const targetPath = follow ? await _promises.realpath.call(void 0, path25) : path25;
3745
3745
  if (this.fsw.closed)
3746
3746
  return;
3747
3747
  const parent = sysPath.dirname(wh.watchPath);
3748
3748
  this.fsw._getWatchedDir(parent).add(wh.watchPath);
3749
3749
  this.fsw._emit(EV.ADD, wh.watchPath, stats);
3750
- closer = await this._handleDir(parent, stats, initialAdd, depth, path23, wh, targetPath);
3750
+ closer = await this._handleDir(parent, stats, initialAdd, depth, path25, wh, targetPath);
3751
3751
  if (this.fsw.closed)
3752
3752
  return;
3753
3753
  if (targetPath !== void 0) {
3754
- this.fsw._symlinkPaths.set(sysPath.resolve(path23), targetPath);
3754
+ this.fsw._symlinkPaths.set(sysPath.resolve(path25), targetPath);
3755
3755
  }
3756
3756
  } else {
3757
3757
  closer = this._handleFile(wh.watchPath, stats, initialAdd);
3758
3758
  }
3759
3759
  ready();
3760
3760
  if (closer)
3761
- this.fsw._addPathCloser(path23, closer);
3761
+ this.fsw._addPathCloser(path25, closer);
3762
3762
  return false;
3763
3763
  } catch (error) {
3764
3764
  if (this.fsw._handleError(error)) {
3765
3765
  ready();
3766
- return path23;
3766
+ return path25;
3767
3767
  }
3768
3768
  }
3769
3769
  }
@@ -3806,26 +3806,26 @@ function createPattern(matcher) {
3806
3806
  }
3807
3807
  return () => false;
3808
3808
  }
3809
- function normalizePath(path23) {
3810
- if (typeof path23 !== "string")
3809
+ function normalizePath(path25) {
3810
+ if (typeof path25 !== "string")
3811
3811
  throw new Error("string expected");
3812
- path23 = sysPath2.normalize(path23);
3813
- path23 = path23.replace(/\\/g, "/");
3812
+ path25 = sysPath2.normalize(path25);
3813
+ path25 = path25.replace(/\\/g, "/");
3814
3814
  let prepend = false;
3815
- if (path23.startsWith("//"))
3815
+ if (path25.startsWith("//"))
3816
3816
  prepend = true;
3817
3817
  const DOUBLE_SLASH_RE2 = /\/\//;
3818
- while (path23.match(DOUBLE_SLASH_RE2))
3819
- path23 = path23.replace(DOUBLE_SLASH_RE2, "/");
3818
+ while (path25.match(DOUBLE_SLASH_RE2))
3819
+ path25 = path25.replace(DOUBLE_SLASH_RE2, "/");
3820
3820
  if (prepend)
3821
- path23 = "/" + path23;
3822
- return path23;
3821
+ path25 = "/" + path25;
3822
+ return path25;
3823
3823
  }
3824
3824
  function matchPatterns(patterns, testString, stats) {
3825
- const path23 = normalizePath(testString);
3825
+ const path25 = normalizePath(testString);
3826
3826
  for (let index = 0; index < patterns.length; index++) {
3827
3827
  const pattern = patterns[index];
3828
- if (pattern(path23, stats)) {
3828
+ if (pattern(path25, stats)) {
3829
3829
  return true;
3830
3830
  }
3831
3831
  }
@@ -3865,19 +3865,19 @@ var toUnix = (string) => {
3865
3865
  }
3866
3866
  return str;
3867
3867
  };
3868
- var normalizePathToUnix = (path23) => toUnix(sysPath2.normalize(toUnix(path23)));
3869
- var normalizeIgnored = (cwd = "") => (path23) => {
3870
- if (typeof path23 === "string") {
3871
- return normalizePathToUnix(sysPath2.isAbsolute(path23) ? path23 : sysPath2.join(cwd, path23));
3868
+ var normalizePathToUnix = (path25) => toUnix(sysPath2.normalize(toUnix(path25)));
3869
+ var normalizeIgnored = (cwd = "") => (path25) => {
3870
+ if (typeof path25 === "string") {
3871
+ return normalizePathToUnix(sysPath2.isAbsolute(path25) ? path25 : sysPath2.join(cwd, path25));
3872
3872
  } else {
3873
- return path23;
3873
+ return path25;
3874
3874
  }
3875
3875
  };
3876
- var getAbsolutePath = (path23, cwd) => {
3877
- if (sysPath2.isAbsolute(path23)) {
3878
- return path23;
3876
+ var getAbsolutePath = (path25, cwd) => {
3877
+ if (sysPath2.isAbsolute(path25)) {
3878
+ return path25;
3879
3879
  }
3880
- return sysPath2.join(cwd, path23);
3880
+ return sysPath2.join(cwd, path25);
3881
3881
  };
3882
3882
  var EMPTY_SET = Object.freeze(/* @__PURE__ */ new Set());
3883
3883
  var DirEntry = class {
@@ -3932,10 +3932,10 @@ var DirEntry = class {
3932
3932
  var STAT_METHOD_F = "stat";
3933
3933
  var STAT_METHOD_L = "lstat";
3934
3934
  var WatchHelper = class {
3935
- constructor(path23, follow, fsw) {
3935
+ constructor(path25, follow, fsw) {
3936
3936
  this.fsw = fsw;
3937
- const watchPath = path23;
3938
- this.path = path23 = path23.replace(REPLACER_RE, "");
3937
+ const watchPath = path25;
3938
+ this.path = path25 = path25.replace(REPLACER_RE, "");
3939
3939
  this.watchPath = watchPath;
3940
3940
  this.fullWatchPath = sysPath2.resolve(watchPath);
3941
3941
  this.dirParts = [];
@@ -4057,20 +4057,20 @@ var FSWatcher = class extends _events2.EventEmitter {
4057
4057
  this._closePromise = void 0;
4058
4058
  let paths = unifyPaths(paths_);
4059
4059
  if (cwd) {
4060
- paths = paths.map((path23) => {
4061
- const absPath = getAbsolutePath(path23, cwd);
4060
+ paths = paths.map((path25) => {
4061
+ const absPath = getAbsolutePath(path25, cwd);
4062
4062
  return absPath;
4063
4063
  });
4064
4064
  }
4065
- paths.forEach((path23) => {
4066
- this._removeIgnoredPath(path23);
4065
+ paths.forEach((path25) => {
4066
+ this._removeIgnoredPath(path25);
4067
4067
  });
4068
4068
  this._userIgnored = void 0;
4069
4069
  if (!this._readyCount)
4070
4070
  this._readyCount = 0;
4071
4071
  this._readyCount += paths.length;
4072
- Promise.all(paths.map(async (path23) => {
4073
- const res = await this._nodeFsHandler._addToNodeFs(path23, !_internal, void 0, 0, _origAdd);
4072
+ Promise.all(paths.map(async (path25) => {
4073
+ const res = await this._nodeFsHandler._addToNodeFs(path25, !_internal, void 0, 0, _origAdd);
4074
4074
  if (res)
4075
4075
  this._emitReady();
4076
4076
  return res;
@@ -4092,17 +4092,17 @@ var FSWatcher = class extends _events2.EventEmitter {
4092
4092
  return this;
4093
4093
  const paths = unifyPaths(paths_);
4094
4094
  const { cwd } = this.options;
4095
- paths.forEach((path23) => {
4096
- if (!sysPath2.isAbsolute(path23) && !this._closers.has(path23)) {
4095
+ paths.forEach((path25) => {
4096
+ if (!sysPath2.isAbsolute(path25) && !this._closers.has(path25)) {
4097
4097
  if (cwd)
4098
- path23 = sysPath2.join(cwd, path23);
4099
- path23 = sysPath2.resolve(path23);
4098
+ path25 = sysPath2.join(cwd, path25);
4099
+ path25 = sysPath2.resolve(path25);
4100
4100
  }
4101
- this._closePath(path23);
4102
- this._addIgnoredPath(path23);
4103
- if (this._watched.has(path23)) {
4101
+ this._closePath(path25);
4102
+ this._addIgnoredPath(path25);
4103
+ if (this._watched.has(path25)) {
4104
4104
  this._addIgnoredPath({
4105
- path: path23,
4105
+ path: path25,
4106
4106
  recursive: true
4107
4107
  });
4108
4108
  }
@@ -4166,38 +4166,38 @@ var FSWatcher = class extends _events2.EventEmitter {
4166
4166
  * @param stats arguments to be passed with event
4167
4167
  * @returns the error if defined, otherwise the value of the FSWatcher instance's `closed` flag
4168
4168
  */
4169
- async _emit(event, path23, stats) {
4169
+ async _emit(event, path25, stats) {
4170
4170
  if (this.closed)
4171
4171
  return;
4172
4172
  const opts = this.options;
4173
4173
  if (isWindows)
4174
- path23 = sysPath2.normalize(path23);
4174
+ path25 = sysPath2.normalize(path25);
4175
4175
  if (opts.cwd)
4176
- path23 = sysPath2.relative(opts.cwd, path23);
4177
- const args = [path23];
4176
+ path25 = sysPath2.relative(opts.cwd, path25);
4177
+ const args = [path25];
4178
4178
  if (stats != null)
4179
4179
  args.push(stats);
4180
4180
  const awf = opts.awaitWriteFinish;
4181
4181
  let pw;
4182
- if (awf && (pw = this._pendingWrites.get(path23))) {
4182
+ if (awf && (pw = this._pendingWrites.get(path25))) {
4183
4183
  pw.lastChange = /* @__PURE__ */ new Date();
4184
4184
  return this;
4185
4185
  }
4186
4186
  if (opts.atomic) {
4187
4187
  if (event === EVENTS.UNLINK) {
4188
- this._pendingUnlinks.set(path23, [event, ...args]);
4188
+ this._pendingUnlinks.set(path25, [event, ...args]);
4189
4189
  setTimeout(() => {
4190
- this._pendingUnlinks.forEach((entry, path24) => {
4190
+ this._pendingUnlinks.forEach((entry, path26) => {
4191
4191
  this.emit(...entry);
4192
4192
  this.emit(EVENTS.ALL, ...entry);
4193
- this._pendingUnlinks.delete(path24);
4193
+ this._pendingUnlinks.delete(path26);
4194
4194
  });
4195
4195
  }, typeof opts.atomic === "number" ? opts.atomic : 100);
4196
4196
  return this;
4197
4197
  }
4198
- if (event === EVENTS.ADD && this._pendingUnlinks.has(path23)) {
4198
+ if (event === EVENTS.ADD && this._pendingUnlinks.has(path25)) {
4199
4199
  event = EVENTS.CHANGE;
4200
- this._pendingUnlinks.delete(path23);
4200
+ this._pendingUnlinks.delete(path25);
4201
4201
  }
4202
4202
  }
4203
4203
  if (awf && (event === EVENTS.ADD || event === EVENTS.CHANGE) && this._readyEmitted) {
@@ -4215,16 +4215,16 @@ var FSWatcher = class extends _events2.EventEmitter {
4215
4215
  this.emitWithAll(event, args);
4216
4216
  }
4217
4217
  };
4218
- this._awaitWriteFinish(path23, awf.stabilityThreshold, event, awfEmit);
4218
+ this._awaitWriteFinish(path25, awf.stabilityThreshold, event, awfEmit);
4219
4219
  return this;
4220
4220
  }
4221
4221
  if (event === EVENTS.CHANGE) {
4222
- const isThrottled = !this._throttle(EVENTS.CHANGE, path23, 50);
4222
+ const isThrottled = !this._throttle(EVENTS.CHANGE, path25, 50);
4223
4223
  if (isThrottled)
4224
4224
  return this;
4225
4225
  }
4226
4226
  if (opts.alwaysStat && stats === void 0 && (event === EVENTS.ADD || event === EVENTS.ADD_DIR || event === EVENTS.CHANGE)) {
4227
- const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path23) : path23;
4227
+ const fullPath = opts.cwd ? sysPath2.join(opts.cwd, path25) : path25;
4228
4228
  let stats2;
4229
4229
  try {
4230
4230
  stats2 = await _promises.stat.call(void 0, fullPath);
@@ -4255,23 +4255,23 @@ var FSWatcher = class extends _events2.EventEmitter {
4255
4255
  * @param timeout duration of time to suppress duplicate actions
4256
4256
  * @returns tracking object or false if action should be suppressed
4257
4257
  */
4258
- _throttle(actionType, path23, timeout) {
4258
+ _throttle(actionType, path25, timeout) {
4259
4259
  if (!this._throttled.has(actionType)) {
4260
4260
  this._throttled.set(actionType, /* @__PURE__ */ new Map());
4261
4261
  }
4262
4262
  const action = this._throttled.get(actionType);
4263
4263
  if (!action)
4264
4264
  throw new Error("invalid throttle");
4265
- const actionPath = action.get(path23);
4265
+ const actionPath = action.get(path25);
4266
4266
  if (actionPath) {
4267
4267
  actionPath.count++;
4268
4268
  return false;
4269
4269
  }
4270
4270
  let timeoutObject;
4271
4271
  const clear = () => {
4272
- const item = action.get(path23);
4272
+ const item = action.get(path25);
4273
4273
  const count = item ? item.count : 0;
4274
- action.delete(path23);
4274
+ action.delete(path25);
4275
4275
  clearTimeout(timeoutObject);
4276
4276
  if (item)
4277
4277
  clearTimeout(item.timeoutObject);
@@ -4279,7 +4279,7 @@ var FSWatcher = class extends _events2.EventEmitter {
4279
4279
  };
4280
4280
  timeoutObject = setTimeout(clear, timeout);
4281
4281
  const thr = { timeoutObject, clear, count: 0 };
4282
- action.set(path23, thr);
4282
+ action.set(path25, thr);
4283
4283
  return thr;
4284
4284
  }
4285
4285
  _incrReadyCount() {
@@ -4293,44 +4293,44 @@ var FSWatcher = class extends _events2.EventEmitter {
4293
4293
  * @param event
4294
4294
  * @param awfEmit Callback to be called when ready for event to be emitted.
4295
4295
  */
4296
- _awaitWriteFinish(path23, threshold, event, awfEmit) {
4296
+ _awaitWriteFinish(path25, threshold, event, awfEmit) {
4297
4297
  const awf = this.options.awaitWriteFinish;
4298
4298
  if (typeof awf !== "object")
4299
4299
  return;
4300
4300
  const pollInterval = awf.pollInterval;
4301
4301
  let timeoutHandler;
4302
- let fullPath = path23;
4303
- if (this.options.cwd && !sysPath2.isAbsolute(path23)) {
4304
- fullPath = sysPath2.join(this.options.cwd, path23);
4302
+ let fullPath = path25;
4303
+ if (this.options.cwd && !sysPath2.isAbsolute(path25)) {
4304
+ fullPath = sysPath2.join(this.options.cwd, path25);
4305
4305
  }
4306
4306
  const now = /* @__PURE__ */ new Date();
4307
4307
  const writes = this._pendingWrites;
4308
4308
  function awaitWriteFinishFn(prevStat) {
4309
4309
  _fs.stat.call(void 0, fullPath, (err, curStat) => {
4310
- if (err || !writes.has(path23)) {
4310
+ if (err || !writes.has(path25)) {
4311
4311
  if (err && err.code !== "ENOENT")
4312
4312
  awfEmit(err);
4313
4313
  return;
4314
4314
  }
4315
4315
  const now2 = Number(/* @__PURE__ */ new Date());
4316
4316
  if (prevStat && curStat.size !== prevStat.size) {
4317
- writes.get(path23).lastChange = now2;
4317
+ writes.get(path25).lastChange = now2;
4318
4318
  }
4319
- const pw = writes.get(path23);
4319
+ const pw = writes.get(path25);
4320
4320
  const df = now2 - pw.lastChange;
4321
4321
  if (df >= threshold) {
4322
- writes.delete(path23);
4322
+ writes.delete(path25);
4323
4323
  awfEmit(void 0, curStat);
4324
4324
  } else {
4325
4325
  timeoutHandler = setTimeout(awaitWriteFinishFn, pollInterval, curStat);
4326
4326
  }
4327
4327
  });
4328
4328
  }
4329
- if (!writes.has(path23)) {
4330
- writes.set(path23, {
4329
+ if (!writes.has(path25)) {
4330
+ writes.set(path25, {
4331
4331
  lastChange: now,
4332
4332
  cancelWait: () => {
4333
- writes.delete(path23);
4333
+ writes.delete(path25);
4334
4334
  clearTimeout(timeoutHandler);
4335
4335
  return event;
4336
4336
  }
@@ -4341,8 +4341,8 @@ var FSWatcher = class extends _events2.EventEmitter {
4341
4341
  /**
4342
4342
  * Determines whether user has asked to ignore this path.
4343
4343
  */
4344
- _isIgnored(path23, stats) {
4345
- if (this.options.atomic && DOT_RE.test(path23))
4344
+ _isIgnored(path25, stats) {
4345
+ if (this.options.atomic && DOT_RE.test(path25))
4346
4346
  return true;
4347
4347
  if (!this._userIgnored) {
4348
4348
  const { cwd } = this.options;
@@ -4352,17 +4352,17 @@ var FSWatcher = class extends _events2.EventEmitter {
4352
4352
  const list = [...ignoredPaths.map(normalizeIgnored(cwd)), ...ignored];
4353
4353
  this._userIgnored = anymatch(list, void 0);
4354
4354
  }
4355
- return this._userIgnored(path23, stats);
4355
+ return this._userIgnored(path25, stats);
4356
4356
  }
4357
- _isntIgnored(path23, stat6) {
4358
- return !this._isIgnored(path23, stat6);
4357
+ _isntIgnored(path25, stat6) {
4358
+ return !this._isIgnored(path25, stat6);
4359
4359
  }
4360
4360
  /**
4361
4361
  * Provides a set of common helpers and properties relating to symlink handling.
4362
4362
  * @param path file or directory pattern being watched
4363
4363
  */
4364
- _getWatchHelpers(path23) {
4365
- return new WatchHelper(path23, this.options.followSymlinks, this);
4364
+ _getWatchHelpers(path25) {
4365
+ return new WatchHelper(path25, this.options.followSymlinks, this);
4366
4366
  }
4367
4367
  // Directory helpers
4368
4368
  // -----------------
@@ -4394,63 +4394,63 @@ var FSWatcher = class extends _events2.EventEmitter {
4394
4394
  * @param item base path of item/directory
4395
4395
  */
4396
4396
  _remove(directory, item, isDirectory) {
4397
- const path23 = sysPath2.join(directory, item);
4398
- const fullPath = sysPath2.resolve(path23);
4399
- isDirectory = isDirectory != null ? isDirectory : this._watched.has(path23) || this._watched.has(fullPath);
4400
- if (!this._throttle("remove", path23, 100))
4397
+ const path25 = sysPath2.join(directory, item);
4398
+ const fullPath = sysPath2.resolve(path25);
4399
+ isDirectory = isDirectory != null ? isDirectory : this._watched.has(path25) || this._watched.has(fullPath);
4400
+ if (!this._throttle("remove", path25, 100))
4401
4401
  return;
4402
4402
  if (!isDirectory && this._watched.size === 1) {
4403
4403
  this.add(directory, item, true);
4404
4404
  }
4405
- const wp = this._getWatchedDir(path23);
4405
+ const wp = this._getWatchedDir(path25);
4406
4406
  const nestedDirectoryChildren = wp.getChildren();
4407
- nestedDirectoryChildren.forEach((nested) => this._remove(path23, nested));
4407
+ nestedDirectoryChildren.forEach((nested) => this._remove(path25, nested));
4408
4408
  const parent = this._getWatchedDir(directory);
4409
4409
  const wasTracked = parent.has(item);
4410
4410
  parent.remove(item);
4411
4411
  if (this._symlinkPaths.has(fullPath)) {
4412
4412
  this._symlinkPaths.delete(fullPath);
4413
4413
  }
4414
- let relPath = path23;
4414
+ let relPath = path25;
4415
4415
  if (this.options.cwd)
4416
- relPath = sysPath2.relative(this.options.cwd, path23);
4416
+ relPath = sysPath2.relative(this.options.cwd, path25);
4417
4417
  if (this.options.awaitWriteFinish && this._pendingWrites.has(relPath)) {
4418
4418
  const event = this._pendingWrites.get(relPath).cancelWait();
4419
4419
  if (event === EVENTS.ADD)
4420
4420
  return;
4421
4421
  }
4422
- this._watched.delete(path23);
4422
+ this._watched.delete(path25);
4423
4423
  this._watched.delete(fullPath);
4424
4424
  const eventName = isDirectory ? EVENTS.UNLINK_DIR : EVENTS.UNLINK;
4425
- if (wasTracked && !this._isIgnored(path23))
4426
- this._emit(eventName, path23);
4427
- this._closePath(path23);
4425
+ if (wasTracked && !this._isIgnored(path25))
4426
+ this._emit(eventName, path25);
4427
+ this._closePath(path25);
4428
4428
  }
4429
4429
  /**
4430
4430
  * Closes all watchers for a path
4431
4431
  */
4432
- _closePath(path23) {
4433
- this._closeFile(path23);
4434
- const dir = sysPath2.dirname(path23);
4435
- this._getWatchedDir(dir).remove(sysPath2.basename(path23));
4432
+ _closePath(path25) {
4433
+ this._closeFile(path25);
4434
+ const dir = sysPath2.dirname(path25);
4435
+ this._getWatchedDir(dir).remove(sysPath2.basename(path25));
4436
4436
  }
4437
4437
  /**
4438
4438
  * Closes only file-specific watchers
4439
4439
  */
4440
- _closeFile(path23) {
4441
- const closers = this._closers.get(path23);
4440
+ _closeFile(path25) {
4441
+ const closers = this._closers.get(path25);
4442
4442
  if (!closers)
4443
4443
  return;
4444
4444
  closers.forEach((closer) => closer());
4445
- this._closers.delete(path23);
4445
+ this._closers.delete(path25);
4446
4446
  }
4447
- _addPathCloser(path23, closer) {
4447
+ _addPathCloser(path25, closer) {
4448
4448
  if (!closer)
4449
4449
  return;
4450
- let list = this._closers.get(path23);
4450
+ let list = this._closers.get(path25);
4451
4451
  if (!list) {
4452
4452
  list = [];
4453
- this._closers.set(path23, list);
4453
+ this._closers.set(path25, list);
4454
4454
  }
4455
4455
  list.push(closer);
4456
4456
  }
@@ -6982,12 +6982,12 @@ var PathBase = (_class6 = class {
6982
6982
  /**
6983
6983
  * Get the Path object referenced by the string path, resolved from this Path
6984
6984
  */
6985
- resolve(path23) {
6986
- if (!path23) {
6985
+ resolve(path25) {
6986
+ if (!path25) {
6987
6987
  return this;
6988
6988
  }
6989
- const rootPath = this.getRootString(path23);
6990
- const dir = path23.substring(rootPath.length);
6989
+ const rootPath = this.getRootString(path25);
6990
+ const dir = path25.substring(rootPath.length);
6991
6991
  const dirParts = dir.split(this.splitSep);
6992
6992
  const result = rootPath ? this.getRoot(rootPath).#resolveParts(dirParts) : this.#resolveParts(dirParts);
6993
6993
  return result;
@@ -7739,8 +7739,8 @@ var PathWin32 = (_class7 = class _PathWin32 extends PathBase {
7739
7739
  /**
7740
7740
  * @internal
7741
7741
  */
7742
- getRootString(path23) {
7743
- return _path.win32.parse(path23).root;
7742
+ getRootString(path25) {
7743
+ return _path.win32.parse(path25).root;
7744
7744
  }
7745
7745
  /**
7746
7746
  * @internal
@@ -7786,8 +7786,8 @@ var PathPosix = (_class8 = class _PathPosix extends PathBase {
7786
7786
  /**
7787
7787
  * @internal
7788
7788
  */
7789
- getRootString(path23) {
7790
- return path23.startsWith("/") ? "/" : "";
7789
+ getRootString(path25) {
7790
+ return path25.startsWith("/") ? "/" : "";
7791
7791
  }
7792
7792
  /**
7793
7793
  * @internal
@@ -7836,8 +7836,8 @@ var PathScurryBase = class {
7836
7836
  *
7837
7837
  * @internal
7838
7838
  */
7839
- constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs18 = defaultFS } = {}) {
7840
- this.#fs = fsFromOption(fs18);
7839
+ constructor(cwd = process.cwd(), pathImpl, sep2, { nocase, childrenCacheSize = 16 * 1024, fs: fs19 = defaultFS } = {}) {
7840
+ this.#fs = fsFromOption(fs19);
7841
7841
  if (cwd instanceof URL || cwd.startsWith("file://")) {
7842
7842
  cwd = _url.fileURLToPath.call(void 0, cwd);
7843
7843
  }
@@ -7876,11 +7876,11 @@ var PathScurryBase = class {
7876
7876
  /**
7877
7877
  * Get the depth of a provided path, string, or the cwd
7878
7878
  */
7879
- depth(path23 = this.cwd) {
7880
- if (typeof path23 === "string") {
7881
- path23 = this.cwd.resolve(path23);
7879
+ depth(path25 = this.cwd) {
7880
+ if (typeof path25 === "string") {
7881
+ path25 = this.cwd.resolve(path25);
7882
7882
  }
7883
- return path23.depth();
7883
+ return path25.depth();
7884
7884
  }
7885
7885
  /**
7886
7886
  * Return the cache of child entries. Exposed so subclasses can create
@@ -8367,9 +8367,9 @@ var PathScurryBase = class {
8367
8367
  process9();
8368
8368
  return results;
8369
8369
  }
8370
- chdir(path23 = this.cwd) {
8370
+ chdir(path25 = this.cwd) {
8371
8371
  const oldCwd = this.cwd;
8372
- this.cwd = typeof path23 === "string" ? this.cwd.resolve(path23) : path23;
8372
+ this.cwd = typeof path25 === "string" ? this.cwd.resolve(path25) : path25;
8373
8373
  this.cwd[setAsCwd](oldCwd);
8374
8374
  }
8375
8375
  };
@@ -8395,8 +8395,8 @@ var PathScurryWin32 = (_class9 = class extends PathScurryBase {
8395
8395
  /**
8396
8396
  * @internal
8397
8397
  */
8398
- newRoot(fs18) {
8399
- return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs18 });
8398
+ newRoot(fs19) {
8399
+ return new PathWin32(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs19 });
8400
8400
  }
8401
8401
  /**
8402
8402
  * Return true if the provided path string is an absolute path
@@ -8424,8 +8424,8 @@ var PathScurryPosix = (_class10 = class extends PathScurryBase {
8424
8424
  /**
8425
8425
  * @internal
8426
8426
  */
8427
- newRoot(fs18) {
8428
- return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs18 });
8427
+ newRoot(fs19) {
8428
+ return new PathPosix(this.rootPath, IFDIR, void 0, this.roots, this.nocase, this.childrenCache(), { fs: fs19 });
8429
8429
  }
8430
8430
  /**
8431
8431
  * Return true if the provided path string is an absolute path
@@ -8731,8 +8731,8 @@ var MatchRecord = (_class11 = class {constructor() { _class11.prototype.__init28
8731
8731
  }
8732
8732
  // match, absolute, ifdir
8733
8733
  entries() {
8734
- return [...this.store.entries()].map(([path23, n2]) => [
8735
- path23,
8734
+ return [...this.store.entries()].map(([path25, n2]) => [
8735
+ path25,
8736
8736
  !!(n2 & 2),
8737
8737
  !!(n2 & 1)
8738
8738
  ]);
@@ -8937,9 +8937,9 @@ var GlobUtil = (_class14 = class {
8937
8937
 
8938
8938
 
8939
8939
 
8940
- constructor(patterns, path23, opts) {;_class14.prototype.__init32.call(this);_class14.prototype.__init33.call(this);_class14.prototype.__init34.call(this);
8940
+ constructor(patterns, path25, opts) {;_class14.prototype.__init32.call(this);_class14.prototype.__init33.call(this);_class14.prototype.__init34.call(this);
8941
8941
  this.patterns = patterns;
8942
- this.path = path23;
8942
+ this.path = path25;
8943
8943
  this.opts = opts;
8944
8944
  this.#sep = !opts.posix && opts.platform === "win32" ? "\\" : "/";
8945
8945
  this.includeChildMatches = opts.includeChildMatches !== false;
@@ -8958,11 +8958,11 @@ var GlobUtil = (_class14 = class {
8958
8958
  });
8959
8959
  }
8960
8960
  }
8961
- #ignored(path23) {
8962
- return this.seen.has(path23) || !!_optionalChain([this, 'access', _125 => _125.#ignore, 'optionalAccess', _126 => _126.ignored, 'optionalCall', _127 => _127(path23)]);
8961
+ #ignored(path25) {
8962
+ return this.seen.has(path25) || !!_optionalChain([this, 'access', _125 => _125.#ignore, 'optionalAccess', _126 => _126.ignored, 'optionalCall', _127 => _127(path25)]);
8963
8963
  }
8964
- #childrenIgnored(path23) {
8965
- return !!_optionalChain([this, 'access', _128 => _128.#ignore, 'optionalAccess', _129 => _129.childrenIgnored, 'optionalCall', _130 => _130(path23)]);
8964
+ #childrenIgnored(path25) {
8965
+ return !!_optionalChain([this, 'access', _128 => _128.#ignore, 'optionalAccess', _129 => _129.childrenIgnored, 'optionalCall', _130 => _130(path25)]);
8966
8966
  }
8967
8967
  // backpressure mechanism
8968
8968
  pause() {
@@ -9177,8 +9177,8 @@ var GlobUtil = (_class14 = class {
9177
9177
  }, _class14);
9178
9178
  var GlobWalker = (_class15 = class extends GlobUtil {
9179
9179
  __init35() {this.matches = /* @__PURE__ */ new Set()}
9180
- constructor(patterns, path23, opts) {
9181
- super(patterns, path23, opts);_class15.prototype.__init35.call(this);;
9180
+ constructor(patterns, path25, opts) {
9181
+ super(patterns, path25, opts);_class15.prototype.__init35.call(this);;
9182
9182
  }
9183
9183
  matchEmit(e) {
9184
9184
  this.matches.add(e);
@@ -9215,8 +9215,8 @@ var GlobWalker = (_class15 = class extends GlobUtil {
9215
9215
  }, _class15);
9216
9216
  var GlobStream = class extends GlobUtil {
9217
9217
 
9218
- constructor(patterns, path23, opts) {
9219
- super(patterns, path23, opts);
9218
+ constructor(patterns, path25, opts) {
9219
+ super(patterns, path25, opts);
9220
9220
  this.results = new Minipass({
9221
9221
  signal: this.signal,
9222
9222
  objectMode: true
@@ -9553,44 +9553,44 @@ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
9553
9553
  var platform_default = process.env.__TESTING_RIMRAF_PLATFORM__ || process.platform;
9554
9554
 
9555
9555
  // ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/path-arg.js
9556
- var pathArg = (path23, opt = {}) => {
9557
- const type = typeof path23;
9556
+ var pathArg = (path25, opt = {}) => {
9557
+ const type = typeof path25;
9558
9558
  if (type !== "string") {
9559
- const ctor = path23 && type === "object" && path23.constructor;
9560
- const received = ctor && ctor.name ? `an instance of ${ctor.name}` : type === "object" ? _util.inspect.call(void 0, path23) : `type ${type} ${path23}`;
9559
+ const ctor = path25 && type === "object" && path25.constructor;
9560
+ const received = ctor && ctor.name ? `an instance of ${ctor.name}` : type === "object" ? _util.inspect.call(void 0, path25) : `type ${type} ${path25}`;
9561
9561
  const msg = `The "path" argument must be of type string. Received ${received}`;
9562
9562
  throw Object.assign(new TypeError(msg), {
9563
- path: path23,
9563
+ path: path25,
9564
9564
  code: "ERR_INVALID_ARG_TYPE"
9565
9565
  });
9566
9566
  }
9567
- if (/\0/.test(path23)) {
9567
+ if (/\0/.test(path25)) {
9568
9568
  const msg = "path must be a string without null bytes";
9569
9569
  throw Object.assign(new TypeError(msg), {
9570
- path: path23,
9570
+ path: path25,
9571
9571
  code: "ERR_INVALID_ARG_VALUE"
9572
9572
  });
9573
9573
  }
9574
- path23 = _path.resolve.call(void 0, path23);
9575
- const { root } = _path.parse.call(void 0, path23);
9576
- if (path23 === root && opt.preserveRoot !== false) {
9574
+ path25 = _path.resolve.call(void 0, path25);
9575
+ const { root } = _path.parse.call(void 0, path25);
9576
+ if (path25 === root && opt.preserveRoot !== false) {
9577
9577
  const msg = "refusing to remove root directory without preserveRoot:false";
9578
9578
  throw Object.assign(new Error(msg), {
9579
- path: path23,
9579
+ path: path25,
9580
9580
  code: "ERR_PRESERVE_ROOT"
9581
9581
  });
9582
9582
  }
9583
9583
  if (platform_default === "win32") {
9584
9584
  const badWinChars = /[*|"<>?:]/;
9585
- const { root: root2 } = _path.parse.call(void 0, path23);
9586
- if (badWinChars.test(path23.substring(root2.length))) {
9585
+ const { root: root2 } = _path.parse.call(void 0, path25);
9586
+ if (badWinChars.test(path25.substring(root2.length))) {
9587
9587
  throw Object.assign(new Error("Illegal characters in path."), {
9588
- path: path23,
9588
+ path: path25,
9589
9589
  code: "EINVAL"
9590
9590
  });
9591
9591
  }
9592
9592
  }
9593
- return path23;
9593
+ return path25;
9594
9594
  };
9595
9595
  var path_arg_default = pathArg;
9596
9596
 
@@ -9605,16 +9605,16 @@ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
9605
9605
 
9606
9606
 
9607
9607
 
9608
- var readdirSync2 = (path23) => _fs.readdirSync.call(void 0, path23, { withFileTypes: true });
9609
- var chmod = (path23, mode) => new Promise((res, rej) => actualFS.default.chmod(path23, mode, (er, ...d) => er ? rej(er) : res(...d)));
9610
- var mkdir = (path23, options) => new Promise((res, rej) => actualFS.default.mkdir(path23, options, (er, made) => er ? rej(er) : res(made)));
9611
- var readdir4 = (path23) => new Promise((res, rej) => actualFS.default.readdir(path23, { withFileTypes: true }, (er, data2) => er ? rej(er) : res(data2)));
9608
+ var readdirSync2 = (path25) => _fs.readdirSync.call(void 0, path25, { withFileTypes: true });
9609
+ var chmod = (path25, mode) => new Promise((res, rej) => actualFS.default.chmod(path25, mode, (er, ...d) => er ? rej(er) : res(...d)));
9610
+ var mkdir = (path25, options) => new Promise((res, rej) => actualFS.default.mkdir(path25, options, (er, made) => er ? rej(er) : res(made)));
9611
+ var readdir4 = (path25) => new Promise((res, rej) => actualFS.default.readdir(path25, { withFileTypes: true }, (er, data2) => er ? rej(er) : res(data2)));
9612
9612
  var rename = (oldPath, newPath) => new Promise((res, rej) => actualFS.default.rename(oldPath, newPath, (er, ...d) => er ? rej(er) : res(...d)));
9613
- var rm = (path23, options) => new Promise((res, rej) => actualFS.default.rm(path23, options, (er, ...d) => er ? rej(er) : res(...d)));
9614
- var rmdir = (path23) => new Promise((res, rej) => actualFS.default.rmdir(path23, (er, ...d) => er ? rej(er) : res(...d)));
9615
- var stat4 = (path23) => new Promise((res, rej) => actualFS.default.stat(path23, (er, data2) => er ? rej(er) : res(data2)));
9616
- var lstat4 = (path23) => new Promise((res, rej) => actualFS.default.lstat(path23, (er, data2) => er ? rej(er) : res(data2)));
9617
- var unlink = (path23) => new Promise((res, rej) => actualFS.default.unlink(path23, (er, ...d) => er ? rej(er) : res(...d)));
9613
+ var rm = (path25, options) => new Promise((res, rej) => actualFS.default.rm(path25, options, (er, ...d) => er ? rej(er) : res(...d)));
9614
+ var rmdir = (path25) => new Promise((res, rej) => actualFS.default.rmdir(path25, (er, ...d) => er ? rej(er) : res(...d)));
9615
+ var stat4 = (path25) => new Promise((res, rej) => actualFS.default.stat(path25, (er, data2) => er ? rej(er) : res(data2)));
9616
+ var lstat4 = (path25) => new Promise((res, rej) => actualFS.default.lstat(path25, (er, data2) => er ? rej(er) : res(data2)));
9617
+ var unlink = (path25) => new Promise((res, rej) => actualFS.default.unlink(path25, (er, ...d) => er ? rej(er) : res(...d)));
9618
9618
  var promises = {
9619
9619
  chmod,
9620
9620
  mkdir,
@@ -9633,10 +9633,10 @@ var promises = {
9633
9633
  // ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/readdir-or-error.js
9634
9634
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
9635
9635
  var { readdir: readdir5 } = promises;
9636
- var readdirOrError = (path23) => readdir5(path23).catch((er) => er);
9637
- var readdirOrErrorSync = (path23) => {
9636
+ var readdirOrError = (path25) => readdir5(path25).catch((er) => er);
9637
+ var readdirOrErrorSync = (path25) => {
9638
9638
  try {
9639
- return readdirSync2(path23);
9639
+ return readdirSync2(path25);
9640
9640
  } catch (er) {
9641
9641
  return er;
9642
9642
  }
@@ -9661,35 +9661,35 @@ var ignoreENOENTSync = (fn) => {
9661
9661
 
9662
9662
  // ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/rimraf-posix.js
9663
9663
  var { lstat: lstat5, rmdir: rmdir2, unlink: unlink2 } = promises;
9664
- var rimrafPosix = async (path23, opt) => {
9664
+ var rimrafPosix = async (path25, opt) => {
9665
9665
  if (_optionalChain([opt, 'optionalAccess', _164 => _164.signal, 'optionalAccess', _165 => _165.aborted])) {
9666
9666
  throw opt.signal.reason;
9667
9667
  }
9668
9668
  try {
9669
- return await rimrafPosixDir(path23, opt, await lstat5(path23));
9669
+ return await rimrafPosixDir(path25, opt, await lstat5(path25));
9670
9670
  } catch (er) {
9671
9671
  if (_optionalChain([er, 'optionalAccess', _166 => _166.code]) === "ENOENT")
9672
9672
  return true;
9673
9673
  throw er;
9674
9674
  }
9675
9675
  };
9676
- var rimrafPosixSync = (path23, opt) => {
9676
+ var rimrafPosixSync = (path25, opt) => {
9677
9677
  if (_optionalChain([opt, 'optionalAccess', _167 => _167.signal, 'optionalAccess', _168 => _168.aborted])) {
9678
9678
  throw opt.signal.reason;
9679
9679
  }
9680
9680
  try {
9681
- return rimrafPosixDirSync(path23, opt, _fs.lstatSync.call(void 0, path23));
9681
+ return rimrafPosixDirSync(path25, opt, _fs.lstatSync.call(void 0, path25));
9682
9682
  } catch (er) {
9683
9683
  if (_optionalChain([er, 'optionalAccess', _169 => _169.code]) === "ENOENT")
9684
9684
  return true;
9685
9685
  throw er;
9686
9686
  }
9687
9687
  };
9688
- var rimrafPosixDir = async (path23, opt, ent) => {
9688
+ var rimrafPosixDir = async (path25, opt, ent) => {
9689
9689
  if (_optionalChain([opt, 'optionalAccess', _170 => _170.signal, 'optionalAccess', _171 => _171.aborted])) {
9690
9690
  throw opt.signal.reason;
9691
9691
  }
9692
- const entries = ent.isDirectory() ? await readdirOrError(path23) : null;
9692
+ const entries = ent.isDirectory() ? await readdirOrError(path25) : null;
9693
9693
  if (!Array.isArray(entries)) {
9694
9694
  if (entries) {
9695
9695
  if (entries.code === "ENOENT") {
@@ -9699,30 +9699,30 @@ var rimrafPosixDir = async (path23, opt, ent) => {
9699
9699
  throw entries;
9700
9700
  }
9701
9701
  }
9702
- if (opt.filter && !await opt.filter(path23, ent)) {
9702
+ if (opt.filter && !await opt.filter(path25, ent)) {
9703
9703
  return false;
9704
9704
  }
9705
- await ignoreENOENT(unlink2(path23));
9705
+ await ignoreENOENT(unlink2(path25));
9706
9706
  return true;
9707
9707
  }
9708
- const removedAll = (await Promise.all(entries.map((ent2) => rimrafPosixDir(_path.resolve.call(void 0, path23, ent2.name), opt, ent2)))).reduce((a, b) => a && b, true);
9708
+ const removedAll = (await Promise.all(entries.map((ent2) => rimrafPosixDir(_path.resolve.call(void 0, path25, ent2.name), opt, ent2)))).reduce((a, b) => a && b, true);
9709
9709
  if (!removedAll) {
9710
9710
  return false;
9711
9711
  }
9712
- if (opt.preserveRoot === false && path23 === _path.parse.call(void 0, path23).root) {
9712
+ if (opt.preserveRoot === false && path25 === _path.parse.call(void 0, path25).root) {
9713
9713
  return false;
9714
9714
  }
9715
- if (opt.filter && !await opt.filter(path23, ent)) {
9715
+ if (opt.filter && !await opt.filter(path25, ent)) {
9716
9716
  return false;
9717
9717
  }
9718
- await ignoreENOENT(rmdir2(path23));
9718
+ await ignoreENOENT(rmdir2(path25));
9719
9719
  return true;
9720
9720
  };
9721
- var rimrafPosixDirSync = (path23, opt, ent) => {
9721
+ var rimrafPosixDirSync = (path25, opt, ent) => {
9722
9722
  if (_optionalChain([opt, 'optionalAccess', _172 => _172.signal, 'optionalAccess', _173 => _173.aborted])) {
9723
9723
  throw opt.signal.reason;
9724
9724
  }
9725
- const entries = ent.isDirectory() ? readdirOrErrorSync(path23) : null;
9725
+ const entries = ent.isDirectory() ? readdirOrErrorSync(path25) : null;
9726
9726
  if (!Array.isArray(entries)) {
9727
9727
  if (entries) {
9728
9728
  if (entries.code === "ENOENT") {
@@ -9732,27 +9732,27 @@ var rimrafPosixDirSync = (path23, opt, ent) => {
9732
9732
  throw entries;
9733
9733
  }
9734
9734
  }
9735
- if (opt.filter && !opt.filter(path23, ent)) {
9735
+ if (opt.filter && !opt.filter(path25, ent)) {
9736
9736
  return false;
9737
9737
  }
9738
- ignoreENOENTSync(() => _fs.unlinkSync.call(void 0, path23));
9738
+ ignoreENOENTSync(() => _fs.unlinkSync.call(void 0, path25));
9739
9739
  return true;
9740
9740
  }
9741
9741
  let removedAll = true;
9742
9742
  for (const ent2 of entries) {
9743
- const p = _path.resolve.call(void 0, path23, ent2.name);
9743
+ const p = _path.resolve.call(void 0, path25, ent2.name);
9744
9744
  removedAll = rimrafPosixDirSync(p, opt, ent2) && removedAll;
9745
9745
  }
9746
- if (opt.preserveRoot === false && path23 === _path.parse.call(void 0, path23).root) {
9746
+ if (opt.preserveRoot === false && path25 === _path.parse.call(void 0, path25).root) {
9747
9747
  return false;
9748
9748
  }
9749
9749
  if (!removedAll) {
9750
9750
  return false;
9751
9751
  }
9752
- if (opt.filter && !opt.filter(path23, ent)) {
9752
+ if (opt.filter && !opt.filter(path25, ent)) {
9753
9753
  return false;
9754
9754
  }
9755
- ignoreENOENTSync(() => _fs.rmdirSync.call(void 0, path23));
9755
+ ignoreENOENTSync(() => _fs.rmdirSync.call(void 0, path25));
9756
9756
  return true;
9757
9757
  };
9758
9758
 
@@ -9763,9 +9763,9 @@ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
9763
9763
  // ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/fix-eperm.js
9764
9764
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
9765
9765
  var { chmod: chmod2 } = promises;
9766
- var fixEPERM = (fn) => async (path23) => {
9766
+ var fixEPERM = (fn) => async (path25) => {
9767
9767
  try {
9768
- return await fn(path23);
9768
+ return await fn(path25);
9769
9769
  } catch (er) {
9770
9770
  const fer = er;
9771
9771
  if (_optionalChain([fer, 'optionalAccess', _174 => _174.code]) === "ENOENT") {
@@ -9773,7 +9773,7 @@ var fixEPERM = (fn) => async (path23) => {
9773
9773
  }
9774
9774
  if (_optionalChain([fer, 'optionalAccess', _175 => _175.code]) === "EPERM") {
9775
9775
  try {
9776
- await chmod2(path23, 438);
9776
+ await chmod2(path25, 438);
9777
9777
  } catch (er2) {
9778
9778
  const fer2 = er2;
9779
9779
  if (_optionalChain([fer2, 'optionalAccess', _176 => _176.code]) === "ENOENT") {
@@ -9781,14 +9781,14 @@ var fixEPERM = (fn) => async (path23) => {
9781
9781
  }
9782
9782
  throw er;
9783
9783
  }
9784
- return await fn(path23);
9784
+ return await fn(path25);
9785
9785
  }
9786
9786
  throw er;
9787
9787
  }
9788
9788
  };
9789
- var fixEPERMSync = (fn) => (path23) => {
9789
+ var fixEPERMSync = (fn) => (path25) => {
9790
9790
  try {
9791
- return fn(path23);
9791
+ return fn(path25);
9792
9792
  } catch (er) {
9793
9793
  const fer = er;
9794
9794
  if (_optionalChain([fer, 'optionalAccess', _177 => _177.code]) === "ENOENT") {
@@ -9796,7 +9796,7 @@ var fixEPERMSync = (fn) => (path23) => {
9796
9796
  }
9797
9797
  if (_optionalChain([fer, 'optionalAccess', _178 => _178.code]) === "EPERM") {
9798
9798
  try {
9799
- _fs.chmodSync.call(void 0, path23, 438);
9799
+ _fs.chmodSync.call(void 0, path25, 438);
9800
9800
  } catch (er2) {
9801
9801
  const fer2 = er2;
9802
9802
  if (_optionalChain([fer2, 'optionalAccess', _179 => _179.code]) === "ENOENT") {
@@ -9804,7 +9804,7 @@ var fixEPERMSync = (fn) => (path23) => {
9804
9804
  }
9805
9805
  throw er;
9806
9806
  }
9807
- return fn(path23);
9807
+ return fn(path25);
9808
9808
  }
9809
9809
  throw er;
9810
9810
  }
@@ -9817,23 +9817,23 @@ var RATE = 1.2;
9817
9817
  var MAXRETRIES = 10;
9818
9818
  var codes = /* @__PURE__ */ new Set(["EMFILE", "ENFILE", "EBUSY"]);
9819
9819
  var retryBusy = (fn) => {
9820
- const method = async (path23, opt, backoff = 1, total = 0) => {
9820
+ const method = async (path25, opt, backoff = 1, total = 0) => {
9821
9821
  const mbo = opt.maxBackoff || MAXBACKOFF;
9822
9822
  const rate = opt.backoff || RATE;
9823
9823
  const max = opt.maxRetries || MAXRETRIES;
9824
9824
  let retries = 0;
9825
9825
  while (true) {
9826
9826
  try {
9827
- return await fn(path23);
9827
+ return await fn(path25);
9828
9828
  } catch (er) {
9829
9829
  const fer = er;
9830
- if (_optionalChain([fer, 'optionalAccess', _180 => _180.path]) === path23 && _optionalChain([fer, 'optionalAccess', _181 => _181.code]) && codes.has(fer.code)) {
9830
+ if (_optionalChain([fer, 'optionalAccess', _180 => _180.path]) === path25 && _optionalChain([fer, 'optionalAccess', _181 => _181.code]) && codes.has(fer.code)) {
9831
9831
  backoff = Math.ceil(backoff * rate);
9832
9832
  total = backoff + total;
9833
9833
  if (total < mbo) {
9834
9834
  return new Promise((res, rej) => {
9835
9835
  setTimeout(() => {
9836
- method(path23, opt, backoff, total).then(res, rej);
9836
+ method(path25, opt, backoff, total).then(res, rej);
9837
9837
  }, backoff);
9838
9838
  });
9839
9839
  }
@@ -9849,15 +9849,15 @@ var retryBusy = (fn) => {
9849
9849
  return method;
9850
9850
  };
9851
9851
  var retryBusySync = (fn) => {
9852
- const method = (path23, opt) => {
9852
+ const method = (path25, opt) => {
9853
9853
  const max = opt.maxRetries || MAXRETRIES;
9854
9854
  let retries = 0;
9855
9855
  while (true) {
9856
9856
  try {
9857
- return fn(path23);
9857
+ return fn(path25);
9858
9858
  } catch (er) {
9859
9859
  const fer = er;
9860
- if (_optionalChain([fer, 'optionalAccess', _182 => _182.path]) === path23 && _optionalChain([fer, 'optionalAccess', _183 => _183.code]) && codes.has(fer.code) && retries < max) {
9860
+ if (_optionalChain([fer, 'optionalAccess', _182 => _182.path]) === path25 && _optionalChain([fer, 'optionalAccess', _183 => _183.code]) && codes.has(fer.code) && retries < max) {
9861
9861
  retries++;
9862
9862
  continue;
9863
9863
  }
@@ -9877,16 +9877,16 @@ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
9877
9877
 
9878
9878
 
9879
9879
  var { stat: stat5 } = promises;
9880
- var isDirSync = (path23) => {
9880
+ var isDirSync = (path25) => {
9881
9881
  try {
9882
- return _fs.statSync.call(void 0, path23).isDirectory();
9882
+ return _fs.statSync.call(void 0, path25).isDirectory();
9883
9883
  } catch (er) {
9884
9884
  return false;
9885
9885
  }
9886
9886
  };
9887
- var isDir = (path23) => stat5(path23).then((st) => st.isDirectory(), () => false);
9888
- var win32DefaultTmp = async (path23) => {
9889
- const { root } = _path.parse.call(void 0, path23);
9887
+ var isDir = (path25) => stat5(path25).then((st) => st.isDirectory(), () => false);
9888
+ var win32DefaultTmp = async (path25) => {
9889
+ const { root } = _path.parse.call(void 0, path25);
9890
9890
  const tmp = _os.tmpdir.call(void 0, );
9891
9891
  const { root: tmpRoot } = _path.parse.call(void 0, tmp);
9892
9892
  if (root.toLowerCase() === tmpRoot.toLowerCase()) {
@@ -9898,8 +9898,8 @@ var win32DefaultTmp = async (path23) => {
9898
9898
  }
9899
9899
  return root;
9900
9900
  };
9901
- var win32DefaultTmpSync = (path23) => {
9902
- const { root } = _path.parse.call(void 0, path23);
9901
+ var win32DefaultTmpSync = (path25) => {
9902
+ const { root } = _path.parse.call(void 0, path25);
9903
9903
  const tmp = _os.tmpdir.call(void 0, );
9904
9904
  const { root: tmpRoot } = _path.parse.call(void 0, tmp);
9905
9905
  if (root.toLowerCase() === tmpRoot.toLowerCase()) {
@@ -9918,10 +9918,10 @@ var defaultTmpSync = platform_default === "win32" ? win32DefaultTmpSync : posixD
9918
9918
 
9919
9919
  // ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/rimraf-move-remove.js
9920
9920
  var { lstat: lstat6, rename: rename2, unlink: unlink3, rmdir: rmdir3, chmod: chmod3 } = promises;
9921
- var uniqueFilename = (path23) => `.${_path.basename.call(void 0, path23)}.${Math.random()}`;
9922
- var unlinkFixEPERM = async (path23) => unlink3(path23).catch((er) => {
9921
+ var uniqueFilename = (path25) => `.${_path.basename.call(void 0, path25)}.${Math.random()}`;
9922
+ var unlinkFixEPERM = async (path25) => unlink3(path25).catch((er) => {
9923
9923
  if (er.code === "EPERM") {
9924
- return chmod3(path23, 438).then(() => unlink3(path23), (er2) => {
9924
+ return chmod3(path25, 438).then(() => unlink3(path25), (er2) => {
9925
9925
  if (er2.code === "ENOENT") {
9926
9926
  return;
9927
9927
  }
@@ -9932,13 +9932,13 @@ var unlinkFixEPERM = async (path23) => unlink3(path23).catch((er) => {
9932
9932
  }
9933
9933
  throw er;
9934
9934
  });
9935
- var unlinkFixEPERMSync = (path23) => {
9935
+ var unlinkFixEPERMSync = (path25) => {
9936
9936
  try {
9937
- _fs.unlinkSync.call(void 0, path23);
9937
+ _fs.unlinkSync.call(void 0, path25);
9938
9938
  } catch (er) {
9939
9939
  if (_optionalChain([er, 'optionalAccess', _184 => _184.code]) === "EPERM") {
9940
9940
  try {
9941
- return _fs.chmodSync.call(void 0, path23, 438);
9941
+ return _fs.chmodSync.call(void 0, path25, 438);
9942
9942
  } catch (er2) {
9943
9943
  if (_optionalChain([er2, 'optionalAccess', _185 => _185.code]) === "ENOENT") {
9944
9944
  return;
@@ -9951,29 +9951,29 @@ var unlinkFixEPERMSync = (path23) => {
9951
9951
  throw er;
9952
9952
  }
9953
9953
  };
9954
- var rimrafMoveRemove = async (path23, opt) => {
9954
+ var rimrafMoveRemove = async (path25, opt) => {
9955
9955
  if (_optionalChain([opt, 'optionalAccess', _187 => _187.signal, 'optionalAccess', _188 => _188.aborted])) {
9956
9956
  throw opt.signal.reason;
9957
9957
  }
9958
9958
  try {
9959
- return await rimrafMoveRemoveDir(path23, opt, await lstat6(path23));
9959
+ return await rimrafMoveRemoveDir(path25, opt, await lstat6(path25));
9960
9960
  } catch (er) {
9961
9961
  if (_optionalChain([er, 'optionalAccess', _189 => _189.code]) === "ENOENT")
9962
9962
  return true;
9963
9963
  throw er;
9964
9964
  }
9965
9965
  };
9966
- var rimrafMoveRemoveDir = async (path23, opt, ent) => {
9966
+ var rimrafMoveRemoveDir = async (path25, opt, ent) => {
9967
9967
  if (_optionalChain([opt, 'optionalAccess', _190 => _190.signal, 'optionalAccess', _191 => _191.aborted])) {
9968
9968
  throw opt.signal.reason;
9969
9969
  }
9970
9970
  if (!opt.tmp) {
9971
- return rimrafMoveRemoveDir(path23, { ...opt, tmp: await defaultTmp(path23) }, ent);
9971
+ return rimrafMoveRemoveDir(path25, { ...opt, tmp: await defaultTmp(path25) }, ent);
9972
9972
  }
9973
- if (path23 === opt.tmp && _path.parse.call(void 0, path23).root !== path23) {
9973
+ if (path25 === opt.tmp && _path.parse.call(void 0, path25).root !== path25) {
9974
9974
  throw new Error("cannot delete temp directory used for deletion");
9975
9975
  }
9976
- const entries = ent.isDirectory() ? await readdirOrError(path23) : null;
9976
+ const entries = ent.isDirectory() ? await readdirOrError(path25) : null;
9977
9977
  if (!Array.isArray(entries)) {
9978
9978
  if (entries) {
9979
9979
  if (entries.code === "ENOENT") {
@@ -9983,54 +9983,54 @@ var rimrafMoveRemoveDir = async (path23, opt, ent) => {
9983
9983
  throw entries;
9984
9984
  }
9985
9985
  }
9986
- if (opt.filter && !await opt.filter(path23, ent)) {
9986
+ if (opt.filter && !await opt.filter(path25, ent)) {
9987
9987
  return false;
9988
9988
  }
9989
- await ignoreENOENT(tmpUnlink(path23, opt.tmp, unlinkFixEPERM));
9989
+ await ignoreENOENT(tmpUnlink(path25, opt.tmp, unlinkFixEPERM));
9990
9990
  return true;
9991
9991
  }
9992
- const removedAll = (await Promise.all(entries.map((ent2) => rimrafMoveRemoveDir(_path.resolve.call(void 0, path23, ent2.name), opt, ent2)))).reduce((a, b) => a && b, true);
9992
+ const removedAll = (await Promise.all(entries.map((ent2) => rimrafMoveRemoveDir(_path.resolve.call(void 0, path25, ent2.name), opt, ent2)))).reduce((a, b) => a && b, true);
9993
9993
  if (!removedAll) {
9994
9994
  return false;
9995
9995
  }
9996
- if (opt.preserveRoot === false && path23 === _path.parse.call(void 0, path23).root) {
9996
+ if (opt.preserveRoot === false && path25 === _path.parse.call(void 0, path25).root) {
9997
9997
  return false;
9998
9998
  }
9999
- if (opt.filter && !await opt.filter(path23, ent)) {
9999
+ if (opt.filter && !await opt.filter(path25, ent)) {
10000
10000
  return false;
10001
10001
  }
10002
- await ignoreENOENT(tmpUnlink(path23, opt.tmp, rmdir3));
10002
+ await ignoreENOENT(tmpUnlink(path25, opt.tmp, rmdir3));
10003
10003
  return true;
10004
10004
  };
10005
- var tmpUnlink = async (path23, tmp, rm3) => {
10006
- const tmpFile = _path.resolve.call(void 0, tmp, uniqueFilename(path23));
10007
- await rename2(path23, tmpFile);
10005
+ var tmpUnlink = async (path25, tmp, rm3) => {
10006
+ const tmpFile = _path.resolve.call(void 0, tmp, uniqueFilename(path25));
10007
+ await rename2(path25, tmpFile);
10008
10008
  return await rm3(tmpFile);
10009
10009
  };
10010
- var rimrafMoveRemoveSync = (path23, opt) => {
10010
+ var rimrafMoveRemoveSync = (path25, opt) => {
10011
10011
  if (_optionalChain([opt, 'optionalAccess', _192 => _192.signal, 'optionalAccess', _193 => _193.aborted])) {
10012
10012
  throw opt.signal.reason;
10013
10013
  }
10014
10014
  try {
10015
- return rimrafMoveRemoveDirSync(path23, opt, _fs.lstatSync.call(void 0, path23));
10015
+ return rimrafMoveRemoveDirSync(path25, opt, _fs.lstatSync.call(void 0, path25));
10016
10016
  } catch (er) {
10017
10017
  if (_optionalChain([er, 'optionalAccess', _194 => _194.code]) === "ENOENT")
10018
10018
  return true;
10019
10019
  throw er;
10020
10020
  }
10021
10021
  };
10022
- var rimrafMoveRemoveDirSync = (path23, opt, ent) => {
10022
+ var rimrafMoveRemoveDirSync = (path25, opt, ent) => {
10023
10023
  if (_optionalChain([opt, 'optionalAccess', _195 => _195.signal, 'optionalAccess', _196 => _196.aborted])) {
10024
10024
  throw opt.signal.reason;
10025
10025
  }
10026
10026
  if (!opt.tmp) {
10027
- return rimrafMoveRemoveDirSync(path23, { ...opt, tmp: defaultTmpSync(path23) }, ent);
10027
+ return rimrafMoveRemoveDirSync(path25, { ...opt, tmp: defaultTmpSync(path25) }, ent);
10028
10028
  }
10029
10029
  const tmp = opt.tmp;
10030
- if (path23 === opt.tmp && _path.parse.call(void 0, path23).root !== path23) {
10030
+ if (path25 === opt.tmp && _path.parse.call(void 0, path25).root !== path25) {
10031
10031
  throw new Error("cannot delete temp directory used for deletion");
10032
10032
  }
10033
- const entries = ent.isDirectory() ? readdirOrErrorSync(path23) : null;
10033
+ const entries = ent.isDirectory() ? readdirOrErrorSync(path25) : null;
10034
10034
  if (!Array.isArray(entries)) {
10035
10035
  if (entries) {
10036
10036
  if (entries.code === "ENOENT") {
@@ -10040,32 +10040,32 @@ var rimrafMoveRemoveDirSync = (path23, opt, ent) => {
10040
10040
  throw entries;
10041
10041
  }
10042
10042
  }
10043
- if (opt.filter && !opt.filter(path23, ent)) {
10043
+ if (opt.filter && !opt.filter(path25, ent)) {
10044
10044
  return false;
10045
10045
  }
10046
- ignoreENOENTSync(() => tmpUnlinkSync(path23, tmp, unlinkFixEPERMSync));
10046
+ ignoreENOENTSync(() => tmpUnlinkSync(path25, tmp, unlinkFixEPERMSync));
10047
10047
  return true;
10048
10048
  }
10049
10049
  let removedAll = true;
10050
10050
  for (const ent2 of entries) {
10051
- const p = _path.resolve.call(void 0, path23, ent2.name);
10051
+ const p = _path.resolve.call(void 0, path25, ent2.name);
10052
10052
  removedAll = rimrafMoveRemoveDirSync(p, opt, ent2) && removedAll;
10053
10053
  }
10054
10054
  if (!removedAll) {
10055
10055
  return false;
10056
10056
  }
10057
- if (opt.preserveRoot === false && path23 === _path.parse.call(void 0, path23).root) {
10057
+ if (opt.preserveRoot === false && path25 === _path.parse.call(void 0, path25).root) {
10058
10058
  return false;
10059
10059
  }
10060
- if (opt.filter && !opt.filter(path23, ent)) {
10060
+ if (opt.filter && !opt.filter(path25, ent)) {
10061
10061
  return false;
10062
10062
  }
10063
- ignoreENOENTSync(() => tmpUnlinkSync(path23, tmp, _fs.rmdirSync));
10063
+ ignoreENOENTSync(() => tmpUnlinkSync(path25, tmp, _fs.rmdirSync));
10064
10064
  return true;
10065
10065
  };
10066
- var tmpUnlinkSync = (path23, tmp, rmSync2) => {
10067
- const tmpFile = _path.resolve.call(void 0, tmp, uniqueFilename(path23));
10068
- _fs.renameSync.call(void 0, path23, tmpFile);
10066
+ var tmpUnlinkSync = (path25, tmp, rmSync2) => {
10067
+ const tmpFile = _path.resolve.call(void 0, tmp, uniqueFilename(path25));
10068
+ _fs.renameSync.call(void 0, path25, tmpFile);
10069
10069
  return rmSync2(tmpFile);
10070
10070
  };
10071
10071
 
@@ -10075,31 +10075,31 @@ var rimrafWindowsFile = retryBusy(fixEPERM(unlink4));
10075
10075
  var rimrafWindowsFileSync = retryBusySync(fixEPERMSync(_fs.unlinkSync));
10076
10076
  var rimrafWindowsDirRetry = retryBusy(fixEPERM(rmdir4));
10077
10077
  var rimrafWindowsDirRetrySync = retryBusySync(fixEPERMSync(_fs.rmdirSync));
10078
- var rimrafWindowsDirMoveRemoveFallback = async (path23, opt) => {
10078
+ var rimrafWindowsDirMoveRemoveFallback = async (path25, opt) => {
10079
10079
  if (_optionalChain([opt, 'optionalAccess', _197 => _197.signal, 'optionalAccess', _198 => _198.aborted])) {
10080
10080
  throw opt.signal.reason;
10081
10081
  }
10082
10082
  const { filter: filter3, ...options } = opt;
10083
10083
  try {
10084
- return await rimrafWindowsDirRetry(path23, options);
10084
+ return await rimrafWindowsDirRetry(path25, options);
10085
10085
  } catch (er) {
10086
10086
  if (_optionalChain([er, 'optionalAccess', _199 => _199.code]) === "ENOTEMPTY") {
10087
- return await rimrafMoveRemove(path23, options);
10087
+ return await rimrafMoveRemove(path25, options);
10088
10088
  }
10089
10089
  throw er;
10090
10090
  }
10091
10091
  };
10092
- var rimrafWindowsDirMoveRemoveFallbackSync = (path23, opt) => {
10092
+ var rimrafWindowsDirMoveRemoveFallbackSync = (path25, opt) => {
10093
10093
  if (_optionalChain([opt, 'optionalAccess', _200 => _200.signal, 'optionalAccess', _201 => _201.aborted])) {
10094
10094
  throw opt.signal.reason;
10095
10095
  }
10096
10096
  const { filter: filter3, ...options } = opt;
10097
10097
  try {
10098
- return rimrafWindowsDirRetrySync(path23, options);
10098
+ return rimrafWindowsDirRetrySync(path25, options);
10099
10099
  } catch (er) {
10100
10100
  const fer = er;
10101
10101
  if (_optionalChain([fer, 'optionalAccess', _202 => _202.code]) === "ENOTEMPTY") {
10102
- return rimrafMoveRemoveSync(path23, options);
10102
+ return rimrafMoveRemoveSync(path25, options);
10103
10103
  }
10104
10104
  throw er;
10105
10105
  }
@@ -10107,35 +10107,35 @@ var rimrafWindowsDirMoveRemoveFallbackSync = (path23, opt) => {
10107
10107
  var START = Symbol("start");
10108
10108
  var CHILD = Symbol("child");
10109
10109
  var FINISH = Symbol("finish");
10110
- var rimrafWindows = async (path23, opt) => {
10110
+ var rimrafWindows = async (path25, opt) => {
10111
10111
  if (_optionalChain([opt, 'optionalAccess', _203 => _203.signal, 'optionalAccess', _204 => _204.aborted])) {
10112
10112
  throw opt.signal.reason;
10113
10113
  }
10114
10114
  try {
10115
- return await rimrafWindowsDir(path23, opt, await lstat7(path23), START);
10115
+ return await rimrafWindowsDir(path25, opt, await lstat7(path25), START);
10116
10116
  } catch (er) {
10117
10117
  if (_optionalChain([er, 'optionalAccess', _205 => _205.code]) === "ENOENT")
10118
10118
  return true;
10119
10119
  throw er;
10120
10120
  }
10121
10121
  };
10122
- var rimrafWindowsSync = (path23, opt) => {
10122
+ var rimrafWindowsSync = (path25, opt) => {
10123
10123
  if (_optionalChain([opt, 'optionalAccess', _206 => _206.signal, 'optionalAccess', _207 => _207.aborted])) {
10124
10124
  throw opt.signal.reason;
10125
10125
  }
10126
10126
  try {
10127
- return rimrafWindowsDirSync(path23, opt, _fs.lstatSync.call(void 0, path23), START);
10127
+ return rimrafWindowsDirSync(path25, opt, _fs.lstatSync.call(void 0, path25), START);
10128
10128
  } catch (er) {
10129
10129
  if (_optionalChain([er, 'optionalAccess', _208 => _208.code]) === "ENOENT")
10130
10130
  return true;
10131
10131
  throw er;
10132
10132
  }
10133
10133
  };
10134
- var rimrafWindowsDir = async (path23, opt, ent, state = START) => {
10134
+ var rimrafWindowsDir = async (path25, opt, ent, state = START) => {
10135
10135
  if (_optionalChain([opt, 'optionalAccess', _209 => _209.signal, 'optionalAccess', _210 => _210.aborted])) {
10136
10136
  throw opt.signal.reason;
10137
10137
  }
10138
- const entries = ent.isDirectory() ? await readdirOrError(path23) : null;
10138
+ const entries = ent.isDirectory() ? await readdirOrError(path25) : null;
10139
10139
  if (!Array.isArray(entries)) {
10140
10140
  if (entries) {
10141
10141
  if (entries.code === "ENOENT") {
@@ -10145,32 +10145,32 @@ var rimrafWindowsDir = async (path23, opt, ent, state = START) => {
10145
10145
  throw entries;
10146
10146
  }
10147
10147
  }
10148
- if (opt.filter && !await opt.filter(path23, ent)) {
10148
+ if (opt.filter && !await opt.filter(path25, ent)) {
10149
10149
  return false;
10150
10150
  }
10151
- await ignoreENOENT(rimrafWindowsFile(path23, opt));
10151
+ await ignoreENOENT(rimrafWindowsFile(path25, opt));
10152
10152
  return true;
10153
10153
  }
10154
10154
  const s = state === START ? CHILD : state;
10155
- const removedAll = (await Promise.all(entries.map((ent2) => rimrafWindowsDir(_path.resolve.call(void 0, path23, ent2.name), opt, ent2, s)))).reduce((a, b) => a && b, true);
10155
+ const removedAll = (await Promise.all(entries.map((ent2) => rimrafWindowsDir(_path.resolve.call(void 0, path25, ent2.name), opt, ent2, s)))).reduce((a, b) => a && b, true);
10156
10156
  if (state === START) {
10157
- return rimrafWindowsDir(path23, opt, ent, FINISH);
10157
+ return rimrafWindowsDir(path25, opt, ent, FINISH);
10158
10158
  } else if (state === FINISH) {
10159
- if (opt.preserveRoot === false && path23 === _path.parse.call(void 0, path23).root) {
10159
+ if (opt.preserveRoot === false && path25 === _path.parse.call(void 0, path25).root) {
10160
10160
  return false;
10161
10161
  }
10162
10162
  if (!removedAll) {
10163
10163
  return false;
10164
10164
  }
10165
- if (opt.filter && !await opt.filter(path23, ent)) {
10165
+ if (opt.filter && !await opt.filter(path25, ent)) {
10166
10166
  return false;
10167
10167
  }
10168
- await ignoreENOENT(rimrafWindowsDirMoveRemoveFallback(path23, opt));
10168
+ await ignoreENOENT(rimrafWindowsDirMoveRemoveFallback(path25, opt));
10169
10169
  }
10170
10170
  return true;
10171
10171
  };
10172
- var rimrafWindowsDirSync = (path23, opt, ent, state = START) => {
10173
- const entries = ent.isDirectory() ? readdirOrErrorSync(path23) : null;
10172
+ var rimrafWindowsDirSync = (path25, opt, ent, state = START) => {
10173
+ const entries = ent.isDirectory() ? readdirOrErrorSync(path25) : null;
10174
10174
  if (!Array.isArray(entries)) {
10175
10175
  if (entries) {
10176
10176
  if (entries.code === "ENOENT") {
@@ -10180,32 +10180,32 @@ var rimrafWindowsDirSync = (path23, opt, ent, state = START) => {
10180
10180
  throw entries;
10181
10181
  }
10182
10182
  }
10183
- if (opt.filter && !opt.filter(path23, ent)) {
10183
+ if (opt.filter && !opt.filter(path25, ent)) {
10184
10184
  return false;
10185
10185
  }
10186
- ignoreENOENTSync(() => rimrafWindowsFileSync(path23, opt));
10186
+ ignoreENOENTSync(() => rimrafWindowsFileSync(path25, opt));
10187
10187
  return true;
10188
10188
  }
10189
10189
  let removedAll = true;
10190
10190
  for (const ent2 of entries) {
10191
10191
  const s = state === START ? CHILD : state;
10192
- const p = _path.resolve.call(void 0, path23, ent2.name);
10192
+ const p = _path.resolve.call(void 0, path25, ent2.name);
10193
10193
  removedAll = rimrafWindowsDirSync(p, opt, ent2, s) && removedAll;
10194
10194
  }
10195
10195
  if (state === START) {
10196
- return rimrafWindowsDirSync(path23, opt, ent, FINISH);
10196
+ return rimrafWindowsDirSync(path25, opt, ent, FINISH);
10197
10197
  } else if (state === FINISH) {
10198
- if (opt.preserveRoot === false && path23 === _path.parse.call(void 0, path23).root) {
10198
+ if (opt.preserveRoot === false && path25 === _path.parse.call(void 0, path25).root) {
10199
10199
  return false;
10200
10200
  }
10201
10201
  if (!removedAll) {
10202
10202
  return false;
10203
10203
  }
10204
- if (opt.filter && !opt.filter(path23, ent)) {
10204
+ if (opt.filter && !opt.filter(path25, ent)) {
10205
10205
  return false;
10206
10206
  }
10207
10207
  ignoreENOENTSync(() => {
10208
- rimrafWindowsDirMoveRemoveFallbackSync(path23, opt);
10208
+ rimrafWindowsDirMoveRemoveFallbackSync(path25, opt);
10209
10209
  });
10210
10210
  }
10211
10211
  return true;
@@ -10218,16 +10218,16 @@ var rimrafManualSync = platform_default === "win32" ? rimrafWindowsSync : rimraf
10218
10218
  // ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/rimraf-native.js
10219
10219
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
10220
10220
  var { rm: rm2 } = promises;
10221
- var rimrafNative = async (path23, opt) => {
10222
- await rm2(path23, {
10221
+ var rimrafNative = async (path25, opt) => {
10222
+ await rm2(path25, {
10223
10223
  ...opt,
10224
10224
  force: true,
10225
10225
  recursive: true
10226
10226
  });
10227
10227
  return true;
10228
10228
  };
10229
- var rimrafNativeSync = (path23, opt) => {
10230
- _fs.rmSync.call(void 0, path23, {
10229
+ var rimrafNativeSync = (path25, opt) => {
10230
+ _fs.rmSync.call(void 0, path25, {
10231
10231
  ...opt,
10232
10232
  force: true,
10233
10233
  recursive: true
@@ -10245,26 +10245,26 @@ var useNative = !hasNative || platform_default === "win32" ? () => false : (opt)
10245
10245
  var useNativeSync = !hasNative || platform_default === "win32" ? () => false : (opt) => !_optionalChain([opt, 'optionalAccess', _213 => _213.signal]) && !_optionalChain([opt, 'optionalAccess', _214 => _214.filter]);
10246
10246
 
10247
10247
  // ../../node_modules/.pnpm/rimraf@6.0.1/node_modules/rimraf/dist/esm/index.js
10248
- var wrap = (fn) => async (path23, opt) => {
10248
+ var wrap = (fn) => async (path25, opt) => {
10249
10249
  const options = optArg(opt);
10250
10250
  if (options.glob) {
10251
- path23 = await glob(path23, options.glob);
10251
+ path25 = await glob(path25, options.glob);
10252
10252
  }
10253
- if (Array.isArray(path23)) {
10254
- return !!(await Promise.all(path23.map((p) => fn(path_arg_default(p, options), options)))).reduce((a, b) => a && b, true);
10253
+ if (Array.isArray(path25)) {
10254
+ return !!(await Promise.all(path25.map((p) => fn(path_arg_default(p, options), options)))).reduce((a, b) => a && b, true);
10255
10255
  } else {
10256
- return !!await fn(path_arg_default(path23, options), options);
10256
+ return !!await fn(path_arg_default(path25, options), options);
10257
10257
  }
10258
10258
  };
10259
- var wrapSync = (fn) => (path23, opt) => {
10259
+ var wrapSync = (fn) => (path25, opt) => {
10260
10260
  const options = optArgSync(opt);
10261
10261
  if (options.glob) {
10262
- path23 = globSync(path23, options.glob);
10262
+ path25 = globSync(path25, options.glob);
10263
10263
  }
10264
- if (Array.isArray(path23)) {
10265
- return !!path23.map((p) => fn(path_arg_default(p, options), options)).reduce((a, b) => a && b, true);
10264
+ if (Array.isArray(path25)) {
10265
+ return !!path25.map((p) => fn(path_arg_default(p, options), options)).reduce((a, b) => a && b, true);
10266
10266
  } else {
10267
- return !!fn(path_arg_default(path23, options), options);
10267
+ return !!fn(path_arg_default(path25, options), options);
10268
10268
  }
10269
10269
  };
10270
10270
  var nativeSync = wrapSync(rimrafNativeSync);
@@ -10279,8 +10279,8 @@ var moveRemoveSync = wrapSync(rimrafMoveRemoveSync);
10279
10279
  var moveRemove = Object.assign(wrap(rimrafMoveRemove), {
10280
10280
  sync: moveRemoveSync
10281
10281
  });
10282
- var rimrafSync = wrapSync((path23, opt) => useNativeSync(opt) ? rimrafNativeSync(path23, opt) : rimrafManualSync(path23, opt));
10283
- var rimraf_ = wrap((path23, opt) => useNative(opt) ? rimrafNative(path23, opt) : rimrafManual(path23, opt));
10282
+ var rimrafSync = wrapSync((path25, opt) => useNativeSync(opt) ? rimrafNativeSync(path25, opt) : rimrafManualSync(path25, opt));
10283
+ var rimraf_ = wrap((path25, opt) => useNative(opt) ? rimrafNative(path25, opt) : rimrafManual(path25, opt));
10284
10284
  var rimraf = Object.assign(rimraf_, {
10285
10285
  rimraf: rimraf_,
10286
10286
  sync: rimrafSync,
@@ -16154,17 +16154,17 @@ function withTrailingSlash(input = "", respectQueryAndFragment) {
16154
16154
  if (hasTrailingSlash(input, true)) {
16155
16155
  return input || "/";
16156
16156
  }
16157
- let path23 = input;
16157
+ let path25 = input;
16158
16158
  let fragment = "";
16159
16159
  const fragmentIndex = input.indexOf("#");
16160
16160
  if (fragmentIndex !== -1) {
16161
- path23 = input.slice(0, fragmentIndex);
16161
+ path25 = input.slice(0, fragmentIndex);
16162
16162
  fragment = input.slice(fragmentIndex);
16163
- if (!path23) {
16163
+ if (!path25) {
16164
16164
  return fragment;
16165
16165
  }
16166
16166
  }
16167
- const [s0, ...s] = path23.split("?");
16167
+ const [s0, ...s] = path25.split("?");
16168
16168
  return s0 + "/" + (s.length > 0 ? `?${s.join("?")}` : "") + fragment;
16169
16169
  }
16170
16170
  function isNonEmptyURL(url) {
@@ -16193,8 +16193,8 @@ var _assert = require('assert'); var _assert2 = _interopRequireDefault(_assert);
16193
16193
  var _v8 = require('v8'); var _v82 = _interopRequireDefault(_v8);
16194
16194
 
16195
16195
  var BUILTIN_MODULES = new Set(_module.builtinModules);
16196
- function normalizeSlash(path23) {
16197
- return path23.replace(/\\/g, "/");
16196
+ function normalizeSlash(path25) {
16197
+ return path25.replace(/\\/g, "/");
16198
16198
  }
16199
16199
  var own$1 = {}.hasOwnProperty;
16200
16200
  var classRegExp = /^([A-Z][a-z\d]*)+$/;
@@ -16307,8 +16307,8 @@ codes2.ERR_INVALID_PACKAGE_CONFIG = createError(
16307
16307
  * @param {string} [base]
16308
16308
  * @param {string} [message]
16309
16309
  */
16310
- (path23, base, message) => {
16311
- return `Invalid package config ${path23}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
16310
+ (path25, base, message) => {
16311
+ return `Invalid package config ${path25}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
16312
16312
  },
16313
16313
  Error
16314
16314
  );
@@ -16340,8 +16340,8 @@ codes2.ERR_MODULE_NOT_FOUND = createError(
16340
16340
  * @param {string} base
16341
16341
  * @param {boolean} [exactUrl]
16342
16342
  */
16343
- (path23, base, exactUrl = false) => {
16344
- return `Cannot find ${exactUrl ? "module" : "package"} '${path23}' imported from ${base}`;
16343
+ (path25, base, exactUrl = false) => {
16344
+ return `Cannot find ${exactUrl ? "module" : "package"} '${path25}' imported from ${base}`;
16345
16345
  },
16346
16346
  Error
16347
16347
  );
@@ -16392,8 +16392,8 @@ codes2.ERR_UNKNOWN_FILE_EXTENSION = createError(
16392
16392
  * @param {string} extension
16393
16393
  * @param {string} path
16394
16394
  */
16395
- (extension, path23) => {
16396
- return `Unknown file extension "${extension}" for ${path23}`;
16395
+ (extension, path25) => {
16396
+ return `Unknown file extension "${extension}" for ${path25}`;
16397
16397
  },
16398
16398
  TypeError
16399
16399
  );
@@ -16764,9 +16764,9 @@ Default "index" lookups for the main are deprecated for ES modules.`,
16764
16764
  );
16765
16765
  }
16766
16766
  }
16767
- function tryStatSync(path23) {
16767
+ function tryStatSync(path25) {
16768
16768
  try {
16769
- return _fs.statSync.call(void 0, path23);
16769
+ return _fs.statSync.call(void 0, path25);
16770
16770
  } catch (e6) {
16771
16771
  }
16772
16772
  }
@@ -17685,7 +17685,7 @@ function findUpSync(name, {
17685
17685
  directory = sysPath2.default.dirname(directory);
17686
17686
  }
17687
17687
  }
17688
- function _resolve2(path23, options = {}) {
17688
+ function _resolve2(path25, options = {}) {
17689
17689
  if (options.platform === "auto" || !options.platform)
17690
17690
  options.platform = _process2.default.platform === "win32" ? "win32" : "posix";
17691
17691
  if (_process2.default.versions.pnp) {
@@ -17694,11 +17694,11 @@ function _resolve2(path23, options = {}) {
17694
17694
  paths.push(_process2.default.cwd());
17695
17695
  const targetRequire = _module.createRequire.call(void 0, _chunkOS76JPG2cjs.importMetaUrl);
17696
17696
  try {
17697
- return targetRequire.resolve(path23, { paths });
17697
+ return targetRequire.resolve(path25, { paths });
17698
17698
  } catch (e10) {
17699
17699
  }
17700
17700
  }
17701
- const modulePath = resolvePathSync(path23, {
17701
+ const modulePath = resolvePathSync(path25, {
17702
17702
  url: options.paths
17703
17703
  });
17704
17704
  if (options.platform === "win32")
@@ -17769,10 +17769,10 @@ var findUp = quansync2({
17769
17769
  async: findUp$1
17770
17770
  });
17771
17771
  var loadPackageJSON = quansync2(function* (cwd = _process2.default.cwd()) {
17772
- const path23 = yield findUp("package.json", { cwd });
17773
- if (!path23 || !actualFS.default.existsSync(path23))
17772
+ const path25 = yield findUp("package.json", { cwd });
17773
+ if (!path25 || !actualFS.default.existsSync(path25))
17774
17774
  return null;
17775
- return JSON.parse(yield readFile(path23));
17775
+ return JSON.parse(yield readFile(path25));
17776
17776
  });
17777
17777
  var loadPackageJSONSync = loadPackageJSON.sync;
17778
17778
  var isPackageListed = quansync2(function* (name, cwd) {
@@ -17825,9 +17825,9 @@ var INSTALL_METADATA = {
17825
17825
  };
17826
17826
 
17827
17827
  // ../../node_modules/.pnpm/package-manager-detector@1.4.0/node_modules/package-manager-detector/dist/detect.mjs
17828
- async function pathExists(path23, type) {
17828
+ async function pathExists(path25, type) {
17829
17829
  try {
17830
- const stat6 = await _promises2.default.stat(path23);
17830
+ const stat6 = await _promises2.default.stat(path25);
17831
17831
  return type === "file" ? stat6.isFile() : stat6.isDirectory();
17832
17832
  } catch (e13) {
17833
17833
  return false;
@@ -19444,11 +19444,51 @@ function transformWxsCode(code, options) {
19444
19444
  }
19445
19445
 
19446
19446
  // src/wxml/handle.ts
19447
+ var handleCache = /* @__PURE__ */ new WeakMap();
19448
+ var inlineWxsTransformCache = /* @__PURE__ */ new Map();
19449
+ var INLINE_WXS_CACHE_LIMIT = 256;
19450
+ function createCacheKey(options) {
19451
+ return `${options.removeComment ? 1 : 0}|${options.transformEvent ? 1 : 0}`;
19452
+ }
19453
+ function getCachedResult(data2, cacheKey) {
19454
+ return _optionalChain([handleCache, 'access', _259 => _259.get, 'call', _260 => _260(data2), 'optionalAccess', _261 => _261.get, 'call', _262 => _262(cacheKey)]);
19455
+ }
19456
+ function setCachedResult(data2, cacheKey, result) {
19457
+ let cacheForToken = handleCache.get(data2);
19458
+ if (!cacheForToken) {
19459
+ cacheForToken = /* @__PURE__ */ new Map();
19460
+ handleCache.set(data2, cacheForToken);
19461
+ }
19462
+ cacheForToken.set(cacheKey, result);
19463
+ return result;
19464
+ }
19465
+ function getCachedInlineWxsTransform(code) {
19466
+ const cached = inlineWxsTransformCache.get(code);
19467
+ if (cached) {
19468
+ inlineWxsTransformCache.delete(code);
19469
+ inlineWxsTransformCache.set(code, cached);
19470
+ return cached;
19471
+ }
19472
+ const transformed = transformWxsCode(code);
19473
+ inlineWxsTransformCache.set(code, transformed);
19474
+ if (inlineWxsTransformCache.size > INLINE_WXS_CACHE_LIMIT) {
19475
+ const firstKey = inlineWxsTransformCache.keys().next().value;
19476
+ if (firstKey) {
19477
+ inlineWxsTransformCache.delete(firstKey);
19478
+ }
19479
+ }
19480
+ return transformed;
19481
+ }
19447
19482
  function handleWxml(data2, options) {
19448
19483
  const opts = _shared.defu.call(void 0, options, {
19449
19484
  removeComment: true,
19450
19485
  transformEvent: true
19451
19486
  });
19487
+ const cacheKey = createCacheKey(opts);
19488
+ const cached = getCachedResult(data2, cacheKey);
19489
+ if (cached) {
19490
+ return cached;
19491
+ }
19452
19492
  const {
19453
19493
  code,
19454
19494
  removalRanges,
@@ -19467,11 +19507,11 @@ function handleWxml(data2, options) {
19467
19507
  const shouldRemoveConditionals = removalRanges.length > 0;
19468
19508
  const shouldRemoveComments = opts.removeComment && commentTokens.length > 0;
19469
19509
  if (!shouldNormalizeImports && !shouldRemoveLang && !shouldTransformInlineWxs && !shouldTransformEvents && !shouldRemoveConditionals && !shouldRemoveComments) {
19470
- return {
19510
+ return setCachedResult(data2, cacheKey, {
19471
19511
  code,
19472
19512
  components: components2,
19473
19513
  deps
19474
- };
19514
+ });
19475
19515
  }
19476
19516
  const ms = new MagicString(code);
19477
19517
  if (shouldNormalizeImports) {
@@ -19486,8 +19526,8 @@ function handleWxml(data2, options) {
19486
19526
  }
19487
19527
  if (shouldTransformInlineWxs) {
19488
19528
  for (const { end, start, value } of inlineWxsTokens) {
19489
- const { result } = transformWxsCode(value);
19490
- if (_optionalChain([result, 'optionalAccess', _259 => _259.code])) {
19529
+ const { result } = getCachedInlineWxsTransform(value);
19530
+ if (_optionalChain([result, 'optionalAccess', _263 => _263.code])) {
19491
19531
  ms.update(start, end, `
19492
19532
  ${result.code}`);
19493
19533
  }
@@ -19499,7 +19539,7 @@ ${result.code}`);
19499
19539
  }
19500
19540
  }
19501
19541
  if (shouldRemoveConditionals) {
19502
- for (const { start, end } of [...removalRanges].sort((a, b) => b.start - a.start)) {
19542
+ for (const { start, end } of removalRanges) {
19503
19543
  if (end > start) {
19504
19544
  ms.remove(start, end);
19505
19545
  }
@@ -19510,11 +19550,11 @@ ${result.code}`);
19510
19550
  ms.remove(start, end);
19511
19551
  }
19512
19552
  }
19513
- return {
19553
+ return setCachedResult(data2, cacheKey, {
19514
19554
  code: ms.toString(),
19515
19555
  components: components2,
19516
19556
  deps
19517
- };
19557
+ });
19518
19558
  }
19519
19559
 
19520
19560
  // src/plugins/hooks/useLoadEntry/index.ts
@@ -19567,7 +19607,7 @@ function createChunkEmitter(configService, loadedEntrySet, debug4) {
19567
19607
  // @ts-ignore
19568
19608
  preserveSignature: "exports-only"
19569
19609
  });
19570
- _optionalChain([debug4, 'optionalCall', _260 => _260(`load ${fileName} \u8017\u65F6 ${(_perf_hooks.performance.now() - start).toFixed(2)}ms`)]);
19610
+ _optionalChain([debug4, 'optionalCall', _264 => _264(`load ${fileName} \u8017\u65F6 ${(_perf_hooks.performance.now() - start).toFixed(2)}ms`)]);
19571
19611
  });
19572
19612
  };
19573
19613
  }
@@ -19660,6 +19700,86 @@ function analyzeCommonJson(json) {
19660
19700
  }
19661
19701
 
19662
19702
  // src/plugins/hooks/useLoadEntry/loadEntry.ts
19703
+ function createStopwatch() {
19704
+ const start = _perf_hooks.performance.now();
19705
+ return () => `${(_perf_hooks.performance.now() - start).toFixed(2)}ms`;
19706
+ }
19707
+ async function addWatchTarget(pluginCtx, target, existsCache) {
19708
+ if (!target || typeof pluginCtx.addWatchFile !== "function") {
19709
+ return false;
19710
+ }
19711
+ if (existsCache.has(target)) {
19712
+ const cached = existsCache.get(target);
19713
+ if (cached) {
19714
+ pluginCtx.addWatchFile(target);
19715
+ }
19716
+ return cached;
19717
+ }
19718
+ const exists = await _fsextra2.default.exists(target);
19719
+ if (exists) {
19720
+ pluginCtx.addWatchFile(target);
19721
+ }
19722
+ existsCache.set(target, exists);
19723
+ return exists;
19724
+ }
19725
+ async function collectStyleImports(pluginCtx, id, existsCache) {
19726
+ const styleImports = [];
19727
+ for (const ext2 of supportedCssLangs) {
19728
+ const mayBeCssPath = changeFileExtension(id, ext2);
19729
+ const exists = await addWatchTarget(pluginCtx, mayBeCssPath, existsCache);
19730
+ if (exists) {
19731
+ styleImports.push(mayBeCssPath);
19732
+ }
19733
+ }
19734
+ return styleImports;
19735
+ }
19736
+ async function collectAppSideFiles(pluginCtx, id, json, jsonService, registerJsonAsset, existsCache) {
19737
+ const { sitemapLocation = "sitemap.json", themeLocation = "theme.json" } = json;
19738
+ const processSideJson = async (location) => {
19739
+ if (!location) {
19740
+ return;
19741
+ }
19742
+ const { path: jsonPath, predictions } = await findJsonEntry(
19743
+ _pathe2.default.resolve(_pathe2.default.dirname(id), location)
19744
+ );
19745
+ for (const prediction of predictions) {
19746
+ await addWatchTarget(pluginCtx, prediction, existsCache);
19747
+ }
19748
+ if (!jsonPath) {
19749
+ return;
19750
+ }
19751
+ const content = await jsonService.read(jsonPath);
19752
+ registerJsonAsset({
19753
+ json: content,
19754
+ jsonPath,
19755
+ type: "app"
19756
+ });
19757
+ };
19758
+ await processSideJson(sitemapLocation);
19759
+ await processSideJson(themeLocation);
19760
+ }
19761
+ async function ensureTemplateScanned(pluginCtx, id, scanTemplateEntry, existsCache) {
19762
+ const { path: templateEntry, predictions } = await findTemplateEntry(id);
19763
+ for (const prediction of predictions) {
19764
+ await addWatchTarget(pluginCtx, prediction, existsCache);
19765
+ }
19766
+ if (!templateEntry) {
19767
+ return "";
19768
+ }
19769
+ await scanTemplateEntry(templateEntry);
19770
+ return templateEntry;
19771
+ }
19772
+ async function resolveEntries(entries, absoluteSrcRoot) {
19773
+ return Promise.all(
19774
+ entries.filter((entry) => !entry.includes(":")).map(async (entry) => {
19775
+ const absPath = _pathe2.default.resolve(absoluteSrcRoot, entry);
19776
+ return {
19777
+ entry,
19778
+ resolvedId: await this.resolve(absPath)
19779
+ };
19780
+ })
19781
+ );
19782
+ }
19663
19783
  function createEntryLoader(options) {
19664
19784
  const {
19665
19785
  ctx,
@@ -19673,16 +19793,18 @@ function createEntryLoader(options) {
19673
19793
  debug: debug4
19674
19794
  } = options;
19675
19795
  const { jsonService, configService } = ctx;
19796
+ const existsCache = /* @__PURE__ */ new Map();
19676
19797
  return async function loadEntry(id, type) {
19677
- const start = _perf_hooks.performance.now();
19678
- const getTime = () => `${(_perf_hooks.performance.now() - start).toFixed(2)}ms`;
19798
+ existsCache.clear();
19799
+ const stopwatch = debug4 ? createStopwatch() : void 0;
19800
+ const getTime = () => stopwatch ? stopwatch() : "0.00ms";
19679
19801
  const relativeCwdId = configService.relativeCwd(id);
19680
19802
  this.addWatchFile(id);
19681
19803
  const baseName = _shared.removeExtensionDeep.call(void 0, id);
19682
19804
  const jsonEntry = await findJsonEntry(id);
19683
19805
  let jsonPath = jsonEntry.path;
19684
19806
  for (const prediction of jsonEntry.predictions) {
19685
- await addWatchTarget(this, prediction);
19807
+ await addWatchTarget(this, prediction, existsCache);
19686
19808
  }
19687
19809
  let json = {};
19688
19810
  if (jsonPath) {
@@ -19699,10 +19821,11 @@ function createEntryLoader(options) {
19699
19821
  id,
19700
19822
  json,
19701
19823
  jsonService,
19702
- registerJsonAsset
19824
+ registerJsonAsset,
19825
+ existsCache
19703
19826
  );
19704
19827
  } else {
19705
- templatePath = await ensureTemplateScanned(this, id, scanTemplateEntry);
19828
+ templatePath = await ensureTemplateScanned(this, id, scanTemplateEntry, existsCache);
19706
19829
  applyAutoImports(baseName, json);
19707
19830
  entries.push(...analyzeCommonJson(json));
19708
19831
  }
@@ -19721,104 +19844,45 @@ function createEntryLoader(options) {
19721
19844
  normalizedEntries,
19722
19845
  configService.absoluteSrcRoot
19723
19846
  );
19724
- _optionalChain([debug4, 'optionalCall', _261 => _261(`resolvedIds ${relativeCwdId} \u8017\u65F6 ${getTime()}`)]);
19725
- await Promise.all(
19726
- emitEntriesChunks.call(
19727
- this,
19728
- resolvedIds.filter(({ entry, resolvedId }) => {
19729
- if (!resolvedId) {
19730
- logger_default.warn(`\u6CA1\u6709\u627E\u5230 \`${entry}\` \u7684\u5165\u53E3\u6587\u4EF6\uFF0C\u8BF7\u68C0\u67E5\u8DEF\u5F84\u662F\u5426\u6B63\u786E!`);
19731
- return false;
19732
- }
19733
- if (loadedEntrySet.has(resolvedId.id)) {
19734
- return false;
19735
- }
19736
- return true;
19737
- }).map((item) => item.resolvedId)
19738
- )
19739
- );
19740
- _optionalChain([debug4, 'optionalCall', _262 => _262(`emitEntriesChunks ${relativeCwdId} \u8017\u65F6 ${getTime()}`)]);
19847
+ _optionalChain([debug4, 'optionalCall', _265 => _265(`resolvedIds ${relativeCwdId} \u8017\u65F6 ${getTime()}`)]);
19848
+ const pendingResolvedIds = [];
19849
+ for (const { entry, resolvedId } of resolvedIds) {
19850
+ if (!resolvedId) {
19851
+ logger_default.warn(`\u6CA1\u6709\u627E\u5230 \`${entry}\` \u7684\u5165\u53E3\u6587\u4EF6\uFF0C\u8BF7\u68C0\u67E5\u8DEF\u5F84\u662F\u5426\u6B63\u786E!`);
19852
+ continue;
19853
+ }
19854
+ if (loadedEntrySet.has(resolvedId.id)) {
19855
+ continue;
19856
+ }
19857
+ pendingResolvedIds.push(resolvedId);
19858
+ }
19859
+ if (pendingResolvedIds.length) {
19860
+ await Promise.all(emitEntriesChunks.call(this, pendingResolvedIds));
19861
+ }
19862
+ _optionalChain([debug4, 'optionalCall', _266 => _266(`emitEntriesChunks ${relativeCwdId} \u8017\u65F6 ${getTime()}`)]);
19741
19863
  registerJsonAsset({
19742
19864
  jsonPath,
19743
19865
  json,
19744
19866
  type
19745
19867
  });
19746
19868
  const code = await _fsextra2.default.readFile(id, "utf8");
19869
+ const styleImports = await collectStyleImports(this, id, existsCache);
19870
+ _optionalChain([debug4, 'optionalCall', _267 => _267(`loadEntry ${relativeCwdId} \u8017\u65F6 ${getTime()}`)]);
19871
+ if (styleImports.length === 0) {
19872
+ return {
19873
+ code
19874
+ };
19875
+ }
19747
19876
  const ms = new MagicString(code);
19748
- await prependStyleImports.call(this, id, ms);
19749
- _optionalChain([debug4, 'optionalCall', _263 => _263(`loadEntry ${relativeCwdId} \u8017\u65F6 ${getTime()}`)]);
19877
+ for (const styleImport of styleImports) {
19878
+ ms.prepend(`import '${styleImport}';
19879
+ `);
19880
+ }
19750
19881
  return {
19751
19882
  code: ms.toString()
19752
19883
  };
19753
19884
  };
19754
19885
  }
19755
- async function collectAppSideFiles(pluginCtx, id, json, jsonService, registerJsonAsset) {
19756
- const { sitemapLocation = "sitemap.json", themeLocation = "theme.json" } = json;
19757
- const processSideJson = async (location) => {
19758
- if (!location) {
19759
- return;
19760
- }
19761
- const { path: jsonPath, predictions } = await findJsonEntry(
19762
- _pathe2.default.resolve(_pathe2.default.dirname(id), location)
19763
- );
19764
- for (const prediction of predictions) {
19765
- await addWatchTarget(pluginCtx, prediction);
19766
- }
19767
- if (!jsonPath) {
19768
- return;
19769
- }
19770
- const content = await jsonService.read(jsonPath);
19771
- registerJsonAsset({
19772
- json: content,
19773
- jsonPath,
19774
- type: "app"
19775
- });
19776
- };
19777
- await processSideJson(sitemapLocation);
19778
- await processSideJson(themeLocation);
19779
- }
19780
- async function ensureTemplateScanned(pluginCtx, id, scanTemplateEntry) {
19781
- const { path: templateEntry, predictions } = await findTemplateEntry(id);
19782
- for (const prediction of predictions) {
19783
- await addWatchTarget(pluginCtx, prediction);
19784
- }
19785
- if (!templateEntry) {
19786
- return "";
19787
- }
19788
- await scanTemplateEntry(templateEntry);
19789
- return templateEntry;
19790
- }
19791
- async function resolveEntries(entries, absoluteSrcRoot) {
19792
- return Promise.all(
19793
- entries.filter((entry) => !entry.includes(":")).map(async (entry) => {
19794
- const absPath = _pathe2.default.resolve(absoluteSrcRoot, entry);
19795
- return {
19796
- entry,
19797
- resolvedId: await this.resolve(absPath)
19798
- };
19799
- })
19800
- );
19801
- }
19802
- async function prependStyleImports(id, ms) {
19803
- for (const ext2 of supportedCssLangs) {
19804
- const mayBeCssPath = changeFileExtension(id, ext2);
19805
- const exists = await addWatchTarget(this, mayBeCssPath);
19806
- if (exists) {
19807
- ms.prepend(`import '${mayBeCssPath}';
19808
- `);
19809
- }
19810
- }
19811
- }
19812
- async function addWatchTarget(pluginCtx, target) {
19813
- if (!target || typeof pluginCtx.addWatchFile !== "function") {
19814
- return false;
19815
- }
19816
- const exists = await _fsextra2.default.exists(target);
19817
- if (exists) {
19818
- pluginCtx.addWatchFile(target);
19819
- }
19820
- return exists;
19821
- }
19822
19886
 
19823
19887
  // src/plugins/hooks/useLoadEntry/normalizer.ts
19824
19888
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
@@ -19874,7 +19938,7 @@ function createTemplateScanner(wxmlService, debug4) {
19874
19938
  const { components: components2 } = wxmlToken;
19875
19939
  wxmlService.setWxmlComponentsMap(templateEntry, components2);
19876
19940
  }
19877
- _optionalChain([debug4, 'optionalCall', _264 => _264(`scanTemplateEntry ${templateEntry} \u8017\u65F6 ${(_perf_hooks.performance.now() - start).toFixed(2)}ms`)]);
19941
+ _optionalChain([debug4, 'optionalCall', _268 => _268(`scanTemplateEntry ${templateEntry} \u8017\u65F6 ${(_perf_hooks.performance.now() - start).toFixed(2)}ms`)]);
19878
19942
  };
19879
19943
  }
19880
19944
 
@@ -20157,7 +20221,7 @@ function createCoreLifecyclePlugin(state) {
20157
20221
  options.input = scannedInput;
20158
20222
  },
20159
20223
  async load(id) {
20160
- _optionalChain([configService, 'access', _265 => _265.weappViteConfig, 'optionalAccess', _266 => _266.debug, 'optionalAccess', _267 => _267.load, 'optionalCall', _268 => _268(id, subPackageMeta)]);
20224
+ _optionalChain([configService, 'access', _269 => _269.weappViteConfig, 'optionalAccess', _270 => _270.debug, 'optionalAccess', _271 => _271.load, 'optionalCall', _272 => _272(id, subPackageMeta)]);
20161
20225
  const relativeBasename = _shared.removeExtensionDeep.call(void 0, configService.relativeAbsoluteSrcRoot(id));
20162
20226
  if (isCSSRequest(id)) {
20163
20227
  const parsed = parseRequest(id);
@@ -20171,7 +20235,7 @@ function createCoreLifecyclePlugin(state) {
20171
20235
  }
20172
20236
  return null;
20173
20237
  }
20174
- if (loadedEntrySet.has(id) || _optionalChain([subPackageMeta, 'optionalAccess', _269 => _269.entries, 'access', _270 => _270.includes, 'call', _271 => _271(relativeBasename)])) {
20238
+ if (loadedEntrySet.has(id) || _optionalChain([subPackageMeta, 'optionalAccess', _273 => _273.entries, 'access', _274 => _274.includes, 'call', _275 => _275(relativeBasename)])) {
20175
20239
  return await loadEntry.call(this, id, "component");
20176
20240
  }
20177
20241
  if (relativeBasename === "app") {
@@ -20184,10 +20248,10 @@ function createCoreLifecyclePlugin(state) {
20184
20248
  },
20185
20249
  async generateBundle() {
20186
20250
  await flushIndependentBuilds.call(this, state, watcherService);
20187
- if (_optionalChain([configService, 'access', _272 => _272.weappViteConfig, 'optionalAccess', _273 => _273.debug, 'optionalAccess', _274 => _274.watchFiles])) {
20251
+ if (_optionalChain([configService, 'access', _276 => _276.weappViteConfig, 'optionalAccess', _277 => _277.debug, 'optionalAccess', _278 => _278.watchFiles])) {
20188
20252
  const watcherService2 = ctx.watcherService;
20189
- const watcherRoot = _nullishCoalesce(_optionalChain([subPackageMeta, 'optionalAccess', _275 => _275.subPackage, 'access', _276 => _276.root]), () => ( "/"));
20190
- const watcher = _optionalChain([watcherService2, 'optionalAccess', _277 => _277.getRollupWatcher, 'call', _278 => _278(watcherRoot)]);
20253
+ const watcherRoot = _nullishCoalesce(_optionalChain([subPackageMeta, 'optionalAccess', _279 => _279.subPackage, 'access', _280 => _280.root]), () => ( "/"));
20254
+ const watcher = _optionalChain([watcherService2, 'optionalAccess', _281 => _281.getRollupWatcher, 'call', _282 => _282(watcherRoot)]);
20191
20255
  let watchFiles;
20192
20256
  if (watcher && typeof watcher.getWatchFiles === "function") {
20193
20257
  watchFiles = await watcher.getWatchFiles();
@@ -20201,7 +20265,7 @@ function createCoreLifecyclePlugin(state) {
20201
20265
  }
20202
20266
  },
20203
20267
  buildEnd() {
20204
- _optionalChain([debug2, 'optionalCall', _279 => _279(`${subPackageMeta ? `\u72EC\u7ACB\u5206\u5305 ${subPackageMeta.subPackage.root}` : "\u4E3B\u5305"} ${Array.from(this.getModuleIds()).length} \u4E2A\u6A21\u5757\u88AB\u7F16\u8BD1`)]);
20268
+ _optionalChain([debug2, 'optionalCall', _283 => _283(`${subPackageMeta ? `\u72EC\u7ACB\u5206\u5305 ${subPackageMeta.subPackage.root}` : "\u4E3B\u5305"} ${Array.from(this.getModuleIds()).length} \u4E2A\u6A21\u5757\u88AB\u7F16\u8BD1`)]);
20205
20269
  }
20206
20270
  };
20207
20271
  }
@@ -20557,14 +20621,14 @@ function createPluginPruner() {
20557
20621
  name: "weapp-vite:preflight",
20558
20622
  enforce: "pre",
20559
20623
  configResolved(config) {
20560
- if (!_optionalChain([config, 'access', _280 => _280.plugins, 'optionalAccess', _281 => _281.length])) {
20624
+ if (!_optionalChain([config, 'access', _284 => _284.plugins, 'optionalAccess', _285 => _285.length])) {
20561
20625
  return;
20562
20626
  }
20563
20627
  for (const removePlugin of removePlugins) {
20564
20628
  const idx = config.plugins.findIndex((plugin) => plugin.name === removePlugin);
20565
20629
  if (idx > -1) {
20566
20630
  const [plugin] = config.plugins.splice(idx, 1);
20567
- plugin && _optionalChain([debug3, 'optionalCall', _282 => _282("remove plugin", plugin.name)]);
20631
+ plugin && _optionalChain([debug3, 'optionalCall', _286 => _286("remove plugin", plugin.name)]);
20568
20632
  }
20569
20633
  }
20570
20634
  }
@@ -20603,8 +20667,8 @@ function createWorkerBuildPlugin(ctx) {
20603
20667
  name: "weapp-vite:workers",
20604
20668
  enforce: "pre",
20605
20669
  async options(options) {
20606
- const workerConfig = _optionalChain([configService, 'access', _283 => _283.weappViteConfig, 'optionalAccess', _284 => _284.worker]);
20607
- const entries = Array.isArray(_optionalChain([workerConfig, 'optionalAccess', _285 => _285.entry])) ? workerConfig.entry : [_optionalChain([workerConfig, 'optionalAccess', _286 => _286.entry])];
20670
+ const workerConfig = _optionalChain([configService, 'access', _287 => _287.weappViteConfig, 'optionalAccess', _288 => _288.worker]);
20671
+ const entries = Array.isArray(_optionalChain([workerConfig, 'optionalAccess', _289 => _289.entry])) ? workerConfig.entry : [_optionalChain([workerConfig, 'optionalAccess', _290 => _290.entry])];
20608
20672
  const normalized = (await Promise.all(entries.filter(Boolean).map((entry) => resolveWorkerEntry(ctx, entry)))).filter((result) => Boolean(result.value)).reduce((acc, cur) => {
20609
20673
  acc[cur.key] = cur.value;
20610
20674
  return acc;
@@ -20721,7 +20785,7 @@ async function transformWxsFile(state, wxsPath) {
20721
20785
  const { result, importees } = transformWxsCode(rawCode, {
20722
20786
  filename: wxsPath
20723
20787
  });
20724
- if (typeof _optionalChain([result, 'optionalAccess', _287 => _287.code]) === "string") {
20788
+ if (typeof _optionalChain([result, 'optionalAccess', _291 => _291.code]) === "string") {
20725
20789
  code = result.code;
20726
20790
  }
20727
20791
  const dirname5 = _pathe2.default.dirname(wxsPath);
@@ -20771,13 +20835,13 @@ function vitePluginWeappWorkers(ctx) {
20771
20835
  }
20772
20836
  function attachRuntimePlugins(ctx, plugins) {
20773
20837
  const runtimePlugins = ctx[RUNTIME_PLUGINS_SYMBOL];
20774
- if (!_optionalChain([runtimePlugins, 'optionalAccess', _288 => _288.length])) {
20838
+ if (!_optionalChain([runtimePlugins, 'optionalAccess', _292 => _292.length])) {
20775
20839
  return plugins;
20776
20840
  }
20777
20841
  return [...runtimePlugins, ...plugins];
20778
20842
  }
20779
20843
  function applyInspect(ctx, plugins) {
20780
- const inspectOptions = _optionalChain([ctx, 'access', _289 => _289.configService, 'access', _290 => _290.weappViteConfig, 'optionalAccess', _291 => _291.debug, 'optionalAccess', _292 => _292.inspect]);
20844
+ const inspectOptions = _optionalChain([ctx, 'access', _293 => _293.configService, 'access', _294 => _294.weappViteConfig, 'optionalAccess', _295 => _295.debug, 'optionalAccess', _296 => _296.inspect]);
20781
20845
  if (!inspectOptions) {
20782
20846
  return plugins;
20783
20847
  }
@@ -20790,20 +20854,15 @@ function flatten(groups) {
20790
20854
  }, []);
20791
20855
  }
20792
20856
 
20793
- // src/runtime/configPlugin.ts
20794
- function createConfigService(ctx) {
20795
- const configState = ctx.runtimeState.config;
20796
- configState.packageInfo = getPackageInfoSync("weapp-vite");
20797
- const defineEnv = configState.defineEnv;
20798
- let packageManager = configState.packageManager;
20799
- let options = configState.options;
20800
- const oxcRuntimeInfo = getPackageInfoSync("@oxc-project/runtime");
20801
- const oxcRuntimeHelpersRoot = oxcRuntimeInfo ? _pathe2.default.resolve(oxcRuntimeInfo.rootPath, "src/helpers/esm") : void 0;
20802
- const NULL_BYTE = "\0";
20803
- const OXC_RUNTIME_HELPER_ALIAS = new RegExp(`^(?:${NULL_BYTE})?@oxc-project(?:/|\\+)runtime(?:@[^/]+)?/helpers/(.+)\\.js$`);
20804
- const FALLBACK_HELPER_PREFIX = `${NULL_BYTE}weapp-vite:oxc-helper:`;
20805
- const fallbackHelpers = {
20806
- objectWithoutProperties: `export default function _objectWithoutProperties(source, excluded) {
20857
+ // src/runtime/oxcRuntime.ts
20858
+ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
20859
+
20860
+
20861
+ var NULL_BYTE = "\0";
20862
+ var OXC_RUNTIME_HELPER_ALIAS = new RegExp(`^(?:${NULL_BYTE})?@oxc-project(?:/|\\+)runtime(?:@[^/]+)?/helpers/(.+)\\.js$`);
20863
+ var FALLBACK_HELPER_PREFIX = `${NULL_BYTE}weapp-vite:oxc-helper:`;
20864
+ var fallbackHelpers = {
20865
+ objectWithoutProperties: `export default function _objectWithoutProperties(source, excluded) {
20807
20866
  if (source == null) return {};
20808
20867
  var target = {};
20809
20868
  var sourceKeys = Object.keys(source);
@@ -20825,7 +20884,7 @@ function createConfigService(ctx) {
20825
20884
  }
20826
20885
  return target;
20827
20886
  }`,
20828
- objectSpread2: `function ownKeys(object, enumerableOnly) {
20887
+ objectSpread2: `function ownKeys(object, enumerableOnly) {
20829
20888
  var keys = Object.keys(object);
20830
20889
  if (Object.getOwnPropertySymbols) {
20831
20890
  var symbols = Object.getOwnPropertySymbols(object);
@@ -20858,13 +20917,25 @@ function _objectSpread2(target) {
20858
20917
  return target;
20859
20918
  }
20860
20919
  export default _objectSpread2;`
20920
+ };
20921
+ function getOxcHelperName(id) {
20922
+ OXC_RUNTIME_HELPER_ALIAS.lastIndex = 0;
20923
+ const match2 = OXC_RUNTIME_HELPER_ALIAS.exec(id);
20924
+ return _optionalChain([match2, 'optionalAccess', _297 => _297[1]]);
20925
+ }
20926
+ function createOxcRuntimeSupport() {
20927
+ const oxcRuntimeInfo = getPackageInfoSync("@oxc-project/runtime");
20928
+ const oxcRuntimeHelpersRoot = oxcRuntimeInfo ? _pathe2.default.resolve(oxcRuntimeInfo.rootPath, "src/helpers/esm") : void 0;
20929
+ const alias = {
20930
+ find: OXC_RUNTIME_HELPER_ALIAS,
20931
+ replacement: "@oxc-project/runtime/src/helpers/esm/$1.js"
20861
20932
  };
20862
- function getOxcHelperName(id) {
20863
- OXC_RUNTIME_HELPER_ALIAS.lastIndex = 0;
20864
- const match2 = OXC_RUNTIME_HELPER_ALIAS.exec(id);
20865
- return _optionalChain([match2, 'optionalAccess', _293 => _293[1]]);
20933
+ if (!oxcRuntimeHelpersRoot) {
20934
+ return {
20935
+ alias
20936
+ };
20866
20937
  }
20867
- const rolldownOxcRuntimePlugin = oxcRuntimeHelpersRoot ? {
20938
+ const rolldownPlugin = {
20868
20939
  name: "weapp-vite:rolldown-oxc-runtime",
20869
20940
  resolveId(source) {
20870
20941
  if (source.startsWith(NULL_BYTE)) {
@@ -20874,13 +20945,14 @@ export default _objectSpread2;`
20874
20945
  if (!helperName) {
20875
20946
  return null;
20876
20947
  }
20877
- if (!oxcRuntimeHelpersRoot) {
20948
+ const helpersRoot = oxcRuntimeHelpersRoot;
20949
+ if (!helpersRoot) {
20878
20950
  if (helperName in fallbackHelpers) {
20879
20951
  return `${FALLBACK_HELPER_PREFIX}${helperName}`;
20880
20952
  }
20881
20953
  return null;
20882
20954
  }
20883
- return _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`);
20955
+ return _pathe2.default.resolve(helpersRoot, `${helperName}.js`);
20884
20956
  },
20885
20957
  async load(id) {
20886
20958
  if (id.startsWith(FALLBACK_HELPER_PREFIX)) {
@@ -20893,12 +20965,10 @@ export default _objectSpread2;`
20893
20965
  }
20894
20966
  const helperName = getOxcHelperName(id);
20895
20967
  if (helperName) {
20896
- if (oxcRuntimeHelpersRoot) {
20897
- const helperPath = id.startsWith(NULL_BYTE) ? _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`) : id;
20898
- if (await _fsextra2.default.pathExists(helperPath)) {
20899
- console.warn("[weapp-vite] resolving oxc helper via Rolldown plugin:", helperName);
20900
- return _fsextra2.default.readFile(helperPath, "utf8");
20901
- }
20968
+ const helperPath = id.startsWith(NULL_BYTE) ? _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`) : id;
20969
+ if (await _fsextra2.default.pathExists(helperPath)) {
20970
+ console.warn("[weapp-vite] resolving oxc helper via Rolldown plugin:", helperName);
20971
+ return _fsextra2.default.readFile(helperPath, "utf8");
20902
20972
  }
20903
20973
  const fallback = fallbackHelpers[helperName];
20904
20974
  if (fallback) {
@@ -20907,7 +20977,81 @@ export default _objectSpread2;`
20907
20977
  }
20908
20978
  return null;
20909
20979
  }
20910
- } : void 0;
20980
+ };
20981
+ const vitePlugin = {
20982
+ name: "weapp-vite:oxc-runtime-helpers",
20983
+ enforce: "pre",
20984
+ resolveId(source) {
20985
+ if (source.startsWith(NULL_BYTE)) {
20986
+ return null;
20987
+ }
20988
+ if (source.includes("@oxc-project/runtime/helpers")) {
20989
+ console.warn("[weapp-vite] resolveId intercepted:", source);
20990
+ }
20991
+ const helperName = getOxcHelperName(source);
20992
+ if (helperName) {
20993
+ return _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`);
20994
+ }
20995
+ return null;
20996
+ },
20997
+ async load(id) {
20998
+ if (!id.startsWith(NULL_BYTE)) {
20999
+ return null;
21000
+ }
21001
+ const helperName = getOxcHelperName(id);
21002
+ if (!helperName) {
21003
+ return null;
21004
+ }
21005
+ const helperPath = _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`);
21006
+ console.warn("[weapp-vite] resolving oxc helper via Vite plugin:", helperName);
21007
+ return _fsextra2.default.readFile(helperPath, "utf8");
21008
+ }
21009
+ };
21010
+ return {
21011
+ alias,
21012
+ rolldownPlugin,
21013
+ vitePlugin
21014
+ };
21015
+ }
21016
+
21017
+ // src/runtime/packageAliases.ts
21018
+ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
21019
+
21020
+
21021
+ var SPECIAL_PACKAGE_ALIASES = [
21022
+ {
21023
+ packageName: "class-variance-authority",
21024
+ distEntry: "dist/index.js"
21025
+ }
21026
+ ];
21027
+ function resolveBuiltinPackageAliases() {
21028
+ const aliases = [];
21029
+ for (const { packageName, distEntry } of SPECIAL_PACKAGE_ALIASES) {
21030
+ const info = getPackageInfoSync(packageName);
21031
+ if (!info) {
21032
+ continue;
21033
+ }
21034
+ const resolvedEntry = _pathe2.default.resolve(info.rootPath, distEntry);
21035
+ if (!_fs.existsSync.call(void 0, resolvedEntry)) {
21036
+ continue;
21037
+ }
21038
+ aliases.push({
21039
+ find: packageName,
21040
+ replacement: resolvedEntry
21041
+ });
21042
+ }
21043
+ return aliases;
21044
+ }
21045
+
21046
+ // src/runtime/configPlugin.ts
21047
+ function createConfigService(ctx) {
21048
+ const configState = ctx.runtimeState.config;
21049
+ configState.packageInfo = getPackageInfoSync("weapp-vite");
21050
+ const defineEnv = configState.defineEnv;
21051
+ let packageManager = configState.packageManager;
21052
+ let options = configState.options;
21053
+ const builtinPackageAliases = resolveBuiltinPackageAliases();
21054
+ const oxcRuntimeSupport = createOxcRuntimeSupport();
20911
21055
  function normalizeAliasOptions(alias) {
20912
21056
  if (!alias) {
20913
21057
  return [];
@@ -20921,16 +21065,9 @@ export default _objectSpread2;`
20921
21065
  return { find, replacement };
20922
21066
  });
20923
21067
  }
20924
- function injectOxcRuntimeAlias(config) {
21068
+ function injectBuiltinAliases(config) {
20925
21069
  const resolve8 = _nullishCoalesce(config.resolve, () => ( (config.resolve = {})));
20926
- const aliasEntry = {
20927
- find: OXC_RUNTIME_HELPER_ALIAS,
20928
- replacement: "@oxc-project/runtime/src/helpers/esm/$1.js"
20929
- };
20930
- const cvaAliasEntry = {
20931
- find: "class-variance-authority",
20932
- replacement: "class-variance-authority/dist/index.js"
20933
- };
21070
+ const aliasEntry = oxcRuntimeSupport.alias;
20934
21071
  const aliasArray = normalizeAliasOptions(resolve8.alias);
20935
21072
  const hasAlias = aliasArray.some((entry) => {
20936
21073
  return entry.find instanceof RegExp && entry.find.source === aliasEntry.find.source;
@@ -20938,9 +21075,11 @@ export default _objectSpread2;`
20938
21075
  if (!hasAlias) {
20939
21076
  aliasArray.unshift(aliasEntry);
20940
21077
  }
20941
- const hasCvaAlias = aliasArray.some((entry) => typeof entry.find === "string" && entry.find === cvaAliasEntry.find);
20942
- if (!hasCvaAlias) {
20943
- aliasArray.unshift(cvaAliasEntry);
21078
+ for (const builtinAlias of builtinPackageAliases) {
21079
+ const hasAliasEntry = aliasArray.some((entry) => typeof entry.find === "string" && entry.find === builtinAlias.find);
21080
+ if (!hasAliasEntry) {
21081
+ aliasArray.unshift(builtinAlias);
21082
+ }
20944
21083
  }
20945
21084
  resolve8.alias = aliasArray;
20946
21085
  }
@@ -20982,8 +21121,8 @@ export default _objectSpread2;`
20982
21121
  command: isDev ? "serve" : "build",
20983
21122
  mode
20984
21123
  }, resolvedConfigFile, cwd);
20985
- const loadedConfig = _optionalChain([loaded, 'optionalAccess', _294 => _294.config]);
20986
- const srcRoot = _nullishCoalesce(_optionalChain([loadedConfig, 'optionalAccess', _295 => _295.weapp, 'optionalAccess', _296 => _296.srcRoot]), () => ( ""));
21124
+ const loadedConfig = _optionalChain([loaded, 'optionalAccess', _298 => _298.config]);
21125
+ const srcRoot = _nullishCoalesce(_optionalChain([loadedConfig, 'optionalAccess', _299 => _299.weapp, 'optionalAccess', _300 => _300.srcRoot]), () => ( ""));
20987
21126
  function relativeSrcRoot(p) {
20988
21127
  if (srcRoot) {
20989
21128
  return _pathe2.default.relative(srcRoot, p);
@@ -21014,61 +21153,29 @@ export default _objectSpread2;`
21014
21153
  weapp: getWeappViteConfig()
21015
21154
  }
21016
21155
  );
21017
- if (rolldownOxcRuntimePlugin) {
21156
+ const rolldownPlugin = oxcRuntimeSupport.rolldownPlugin;
21157
+ if (rolldownPlugin) {
21018
21158
  const build3 = _nullishCoalesce(config.build, () => ( (config.build = {})));
21019
21159
  const rdOptions = _nullishCoalesce(build3.rolldownOptions, () => ( (build3.rolldownOptions = {})));
21020
21160
  const rawPlugins = rdOptions.plugins;
21021
21161
  const pluginArray = rawPlugins == null ? [] : Array.isArray(rawPlugins) ? [...rawPlugins] : [rawPlugins];
21022
- const hasPlugin = pluginArray.some((plugin) => {
21023
- if (!plugin || typeof plugin !== "object") {
21024
- return false;
21025
- }
21026
- return "name" in plugin && plugin.name === rolldownOxcRuntimePlugin.name;
21027
- });
21162
+ const hasPlugin = pluginArray.includes(rolldownPlugin);
21028
21163
  if (!hasPlugin) {
21029
- rdOptions.plugins = [rolldownOxcRuntimePlugin, ...pluginArray];
21164
+ rdOptions.plugins = [rolldownPlugin, ...pluginArray];
21030
21165
  } else if (!Array.isArray(rawPlugins)) {
21031
21166
  rdOptions.plugins = pluginArray;
21032
21167
  }
21033
21168
  }
21034
- injectOxcRuntimeAlias(config);
21035
- if (oxcRuntimeHelpersRoot) {
21169
+ injectBuiltinAliases(config);
21170
+ if (oxcRuntimeSupport.vitePlugin) {
21036
21171
  config.plugins ??= [];
21037
- config.plugins.unshift({
21038
- name: "weapp-vite:oxc-runtime-helpers",
21039
- enforce: "pre",
21040
- resolveId(source) {
21041
- if (source.startsWith(NULL_BYTE)) {
21042
- return null;
21043
- }
21044
- if (source.includes("@oxc-project/runtime/helpers")) {
21045
- console.warn("[weapp-vite] resolveId intercepted:", source);
21046
- }
21047
- const helperName = getOxcHelperName(source);
21048
- if (helperName) {
21049
- return _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`);
21050
- }
21051
- return null;
21052
- },
21053
- async load(id) {
21054
- if (!id.startsWith(NULL_BYTE)) {
21055
- return null;
21056
- }
21057
- const helperName = getOxcHelperName(id);
21058
- if (!helperName) {
21059
- return null;
21060
- }
21061
- const helperPath = _pathe2.default.resolve(oxcRuntimeHelpersRoot, `${helperName}.js`);
21062
- console.warn("[weapp-vite] resolving oxc helper via Vite plugin:", helperName);
21063
- return _fsextra2.default.readFile(helperPath, "utf8");
21064
- }
21065
- });
21172
+ config.plugins.unshift(oxcRuntimeSupport.vitePlugin);
21066
21173
  }
21067
- const platform = _nullishCoalesce(_optionalChain([config, 'access', _297 => _297.weapp, 'optionalAccess', _298 => _298.platform]), () => ( "weapp"));
21174
+ const platform = _nullishCoalesce(_optionalChain([config, 'access', _301 => _301.weapp, 'optionalAccess', _302 => _302.platform]), () => ( "weapp"));
21068
21175
  const resolvedOutputExtensions = getOutputExtensions(platform);
21069
21176
  config.plugins ??= [];
21070
- _optionalChain([config, 'access', _299 => _299.plugins, 'optionalAccess', _300 => _300.push, 'call', _301 => _301(_vitetsconfigpaths2.default.call(void 0, _optionalChain([config, 'access', _302 => _302.weapp, 'optionalAccess', _303 => _303.tsconfigPaths])))]);
21071
- const aliasEntries = getAliasEntries(_optionalChain([config, 'access', _304 => _304.weapp, 'optionalAccess', _305 => _305.jsonAlias]));
21177
+ _optionalChain([config, 'access', _303 => _303.plugins, 'optionalAccess', _304 => _304.push, 'call', _305 => _305(_vitetsconfigpaths2.default.call(void 0, _optionalChain([config, 'access', _306 => _306.weapp, 'optionalAccess', _307 => _307.tsconfigPaths])))]);
21178
+ const aliasEntries = getAliasEntries(_optionalChain([config, 'access', _308 => _308.weapp, 'optionalAccess', _309 => _309.jsonAlias]));
21072
21179
  return {
21073
21180
  config,
21074
21181
  aliasEntries,
@@ -21135,7 +21242,7 @@ export default _objectSpread2;`
21135
21242
  }
21136
21243
  }
21137
21244
  );
21138
- injectOxcRuntimeAlias(inline);
21245
+ injectBuiltinAliases(inline);
21139
21246
  return inline;
21140
21247
  }
21141
21248
  const inlineConfig = _shared.defu.call(void 0,
@@ -21152,7 +21259,7 @@ export default _objectSpread2;`
21152
21259
  }
21153
21260
  );
21154
21261
  inlineConfig.logLevel = "info";
21155
- injectOxcRuntimeAlias(inlineConfig);
21262
+ injectBuiltinAliases(inlineConfig);
21156
21263
  return inlineConfig;
21157
21264
  }
21158
21265
  function merge(subPackageMeta, ...configs) {
@@ -21166,9 +21273,10 @@ export default _objectSpread2;`
21166
21273
  return new RegExp(`^${pkg.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&")}(\\/|$)`);
21167
21274
  }));
21168
21275
  }
21276
+ const rolldownPlugin = oxcRuntimeSupport.rolldownPlugin;
21169
21277
  const rolldownOptions = {
21170
21278
  external,
21171
- plugins: rolldownOxcRuntimePlugin ? [rolldownOxcRuntimePlugin] : void 0
21279
+ plugins: rolldownPlugin ? [rolldownPlugin] : void 0
21172
21280
  };
21173
21281
  if (options.isDev) {
21174
21282
  const inline = _shared.defu.call(void 0,
@@ -21196,7 +21304,7 @@ export default _objectSpread2;`
21196
21304
  }
21197
21305
  }
21198
21306
  );
21199
- injectOxcRuntimeAlias(inline);
21307
+ injectBuiltinAliases(inline);
21200
21308
  return inline;
21201
21309
  }
21202
21310
  const inlineConfig = _shared.defu.call(void 0,
@@ -21221,8 +21329,8 @@ export default _objectSpread2;`
21221
21329
  }
21222
21330
  );
21223
21331
  inlineConfig.logLevel = "info";
21224
- injectOxcRuntimeAlias(inlineConfig);
21225
- const currentRoot = _optionalChain([subPackageMeta, 'optionalAccess', _306 => _306.subPackage, 'access', _307 => _307.root]);
21332
+ injectBuiltinAliases(inlineConfig);
21333
+ const currentRoot = _optionalChain([subPackageMeta, 'optionalAccess', _310 => _310.subPackage, 'access', _311 => _311.root]);
21226
21334
  options = {
21227
21335
  ...options,
21228
21336
  currentSubPackageRoot: currentRoot
@@ -21293,10 +21401,10 @@ export default _objectSpread2;`
21293
21401
  return options.srcRoot;
21294
21402
  },
21295
21403
  get pluginRoot() {
21296
- return _optionalChain([options, 'access', _308 => _308.config, 'access', _309 => _309.weapp, 'optionalAccess', _310 => _310.pluginRoot]);
21404
+ return _optionalChain([options, 'access', _312 => _312.config, 'access', _313 => _313.weapp, 'optionalAccess', _314 => _314.pluginRoot]);
21297
21405
  },
21298
21406
  get absolutePluginRoot() {
21299
- if (_optionalChain([options, 'access', _311 => _311.config, 'access', _312 => _312.weapp, 'optionalAccess', _313 => _313.pluginRoot])) {
21407
+ if (_optionalChain([options, 'access', _315 => _315.config, 'access', _316 => _316.weapp, 'optionalAccess', _317 => _317.pluginRoot])) {
21300
21408
  return _pathe2.default.resolve(options.cwd, options.config.weapp.pluginRoot);
21301
21409
  }
21302
21410
  },
@@ -21372,7 +21480,7 @@ function createJsonService(ctx) {
21372
21480
  return resultJson;
21373
21481
  } catch (error) {
21374
21482
  logger_default.error(`\u6B8B\u7834\u7684JSON\u6587\u4EF6: ${filepath}`);
21375
- _optionalChain([debug, 'optionalCall', _314 => _314(error)]);
21483
+ _optionalChain([debug, 'optionalCall', _318 => _318(error)]);
21376
21484
  }
21377
21485
  }
21378
21486
  function resolve8(entry) {
@@ -21424,7 +21532,7 @@ function createNpmService(ctx) {
21424
21532
  if (!ctx.configService) {
21425
21533
  throw new Error("configService must be initialized before writing npm cache");
21426
21534
  }
21427
- if (_optionalChain([ctx, 'access', _315 => _315.configService, 'access', _316 => _316.weappViteConfig, 'optionalAccess', _317 => _317.npm, 'optionalAccess', _318 => _318.cache])) {
21535
+ if (_optionalChain([ctx, 'access', _319 => _319.configService, 'access', _320 => _320.weappViteConfig, 'optionalAccess', _321 => _321.npm, 'optionalAccess', _322 => _322.cache])) {
21428
21536
  await _fsextra2.default.outputJSON(getDependenciesCacheFilePath(root), {
21429
21537
  hash: dependenciesCacheHash()
21430
21538
  });
@@ -21437,7 +21545,7 @@ function createNpmService(ctx) {
21437
21545
  }
21438
21546
  }
21439
21547
  async function checkDependenciesCacheOutdate(root) {
21440
- if (_optionalChain([ctx, 'access', _319 => _319.configService, 'optionalAccess', _320 => _320.weappViteConfig, 'optionalAccess', _321 => _321.npm, 'optionalAccess', _322 => _322.cache])) {
21548
+ if (_optionalChain([ctx, 'access', _323 => _323.configService, 'optionalAccess', _324 => _324.weappViteConfig, 'optionalAccess', _325 => _325.npm, 'optionalAccess', _326 => _326.cache])) {
21441
21549
  const json = await readDependenciesCache(root);
21442
21550
  if (_shared.isObject.call(void 0, json)) {
21443
21551
  return dependenciesCacheHash() !== json.hash;
@@ -21471,7 +21579,7 @@ function createNpmService(ctx) {
21471
21579
  target: "es6",
21472
21580
  external: []
21473
21581
  });
21474
- const resolvedOptions = _optionalChain([ctx, 'access', _323 => _323.configService, 'optionalAccess', _324 => _324.weappViteConfig, 'optionalAccess', _325 => _325.npm, 'optionalAccess', _326 => _326.buildOptions, 'optionalCall', _327 => _327(
21582
+ const resolvedOptions = _optionalChain([ctx, 'access', _327 => _327.configService, 'optionalAccess', _328 => _328.weappViteConfig, 'optionalAccess', _329 => _329.npm, 'optionalAccess', _330 => _330.buildOptions, 'optionalCall', _331 => _331(
21475
21583
  mergedOptions,
21476
21584
  { name, entry }
21477
21585
  )]);
@@ -21559,7 +21667,7 @@ function createNpmService(ctx) {
21559
21667
  throw new Error("configService must be initialized before resolving npm relation list");
21560
21668
  }
21561
21669
  let packNpmRelationList = [];
21562
- if (_optionalChain([ctx, 'access', _328 => _328.configService, 'access', _329 => _329.projectConfig, 'access', _330 => _330.setting, 'optionalAccess', _331 => _331.packNpmManually]) && Array.isArray(ctx.configService.projectConfig.setting.packNpmRelationList)) {
21670
+ if (_optionalChain([ctx, 'access', _332 => _332.configService, 'access', _333 => _333.projectConfig, 'access', _334 => _334.setting, 'optionalAccess', _335 => _335.packNpmManually]) && Array.isArray(ctx.configService.projectConfig.setting.packNpmRelationList)) {
21563
21671
  packNpmRelationList = ctx.configService.projectConfig.setting.packNpmRelationList;
21564
21672
  } else {
21565
21673
  packNpmRelationList = [
@@ -21572,10 +21680,10 @@ function createNpmService(ctx) {
21572
21680
  return packNpmRelationList;
21573
21681
  }
21574
21682
  async function build3(options) {
21575
- if (!_optionalChain([ctx, 'access', _332 => _332.configService, 'optionalAccess', _333 => _333.weappViteConfig, 'optionalAccess', _334 => _334.npm, 'optionalAccess', _335 => _335.enable])) {
21683
+ if (!_optionalChain([ctx, 'access', _336 => _336.configService, 'optionalAccess', _337 => _337.weappViteConfig, 'optionalAccess', _338 => _338.npm, 'optionalAccess', _339 => _339.enable])) {
21576
21684
  return;
21577
21685
  }
21578
- _optionalChain([debug, 'optionalCall', _336 => _336("buildNpm start")]);
21686
+ _optionalChain([debug, 'optionalCall', _340 => _340("buildNpm start")]);
21579
21687
  const packNpmRelationList = getPackNpmRelationList();
21580
21688
  const [mainRelation, ...subRelations] = packNpmRelationList;
21581
21689
  const packageJsonPath = _pathe2.default.resolve(ctx.configService.cwd, mainRelation.packageJsonPath);
@@ -21650,7 +21758,7 @@ function createNpmService(ctx) {
21650
21758
  }
21651
21759
  }
21652
21760
  }
21653
- _optionalChain([debug, 'optionalCall', _337 => _337("buildNpm end")]);
21761
+ _optionalChain([debug, 'optionalCall', _341 => _341("buildNpm end")]);
21654
21762
  }
21655
21763
  return {
21656
21764
  getDependenciesCacheFilePath,
@@ -21694,7 +21802,7 @@ var TimeoutError = (_class16 = class _TimeoutError extends Error {
21694
21802
  __init36() {this.name = "TimeoutError"}
21695
21803
  constructor(message, options) {
21696
21804
  super(message, options);_class16.prototype.__init36.call(this);;
21697
- _optionalChain([Error, 'access', _338 => _338.captureStackTrace, 'optionalCall', _339 => _339(this, _TimeoutError)]);
21805
+ _optionalChain([Error, 'access', _342 => _342.captureStackTrace, 'optionalCall', _343 => _343(this, _TimeoutError)]);
21698
21806
  }
21699
21807
  }, _class16);
21700
21808
  var getAbortedReason = (signal) => _nullishCoalesce(signal.reason, () => ( new DOMException("This operation was aborted.", "AbortError")));
@@ -21712,7 +21820,7 @@ function pTimeout(promise, options) {
21712
21820
  if (typeof milliseconds !== "number" || Math.sign(milliseconds) !== 1) {
21713
21821
  throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${milliseconds}\``);
21714
21822
  }
21715
- if (_optionalChain([signal, 'optionalAccess', _340 => _340.aborted])) {
21823
+ if (_optionalChain([signal, 'optionalAccess', _344 => _344.aborted])) {
21716
21824
  reject(getAbortedReason(signal));
21717
21825
  return;
21718
21826
  }
@@ -21810,7 +21918,7 @@ var PriorityQueue = class {
21810
21918
  }
21811
21919
  dequeue() {
21812
21920
  const item = this.#queue.shift();
21813
- return _optionalChain([item, 'optionalAccess', _341 => _341.run]);
21921
+ return _optionalChain([item, 'optionalAccess', _345 => _345.run]);
21814
21922
  }
21815
21923
  filter(options) {
21816
21924
  return this.#queue.filter((element) => element.priority === options.priority).map((element) => element.run);
@@ -21871,10 +21979,10 @@ var PQueue = class extends import_index2.default {
21871
21979
  ...options
21872
21980
  };
21873
21981
  if (!(typeof options.intervalCap === "number" && options.intervalCap >= 1)) {
21874
- throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${_nullishCoalesce(_optionalChain([options, 'access', _342 => _342.intervalCap, 'optionalAccess', _343 => _343.toString, 'call', _344 => _344()]), () => ( ""))}\` (${typeof options.intervalCap})`);
21982
+ throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${_nullishCoalesce(_optionalChain([options, 'access', _346 => _346.intervalCap, 'optionalAccess', _347 => _347.toString, 'call', _348 => _348()]), () => ( ""))}\` (${typeof options.intervalCap})`);
21875
21983
  }
21876
21984
  if (options.interval === void 0 || !(Number.isFinite(options.interval) && options.interval >= 0)) {
21877
- throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${_nullishCoalesce(_optionalChain([options, 'access', _345 => _345.interval, 'optionalAccess', _346 => _346.toString, 'call', _347 => _347()]), () => ( ""))}\` (${typeof options.interval})`);
21985
+ throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${_nullishCoalesce(_optionalChain([options, 'access', _349 => _349.interval, 'optionalAccess', _350 => _350.toString, 'call', _351 => _351()]), () => ( ""))}\` (${typeof options.interval})`);
21878
21986
  }
21879
21987
  this.#carryoverIntervalCount = _nullishCoalesce(_nullishCoalesce(options.carryoverIntervalCount, () => ( options.carryoverConcurrencyCount)), () => ( false));
21880
21988
  this.#isIntervalIgnored = options.intervalCap === Number.POSITIVE_INFINITY || options.interval === 0;
@@ -22081,7 +22189,7 @@ var PQueue = class extends import_index2.default {
22081
22189
  });
22082
22190
  try {
22083
22191
  try {
22084
- _optionalChain([options, 'access', _348 => _348.signal, 'optionalAccess', _349 => _349.throwIfAborted, 'call', _350 => _350()]);
22192
+ _optionalChain([options, 'access', _352 => _352.signal, 'optionalAccess', _353 => _353.throwIfAborted, 'call', _354 => _354()]);
22085
22193
  } catch (error) {
22086
22194
  if (!this.#isIntervalIgnored) {
22087
22195
  this.#intervalCount--;
@@ -22390,9 +22498,30 @@ _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
22390
22498
  // src/cache/file.ts
22391
22499
  _chunkOS76JPG2cjs.init_cjs_shims.call(void 0, );
22392
22500
 
22393
-
22501
+ var FNV_OFFSET_BASIS = 0xCBF29CE484222325n;
22502
+ var FNV_PRIME = 0x100000001B3n;
22503
+ var FNV_MASK = 0xFFFFFFFFFFFFFFFFn;
22504
+ function fnv1aStep(hash, byte) {
22505
+ hash ^= BigInt(byte & 255);
22506
+ return hash * FNV_PRIME & FNV_MASK;
22507
+ }
22394
22508
  function createSignature(content) {
22395
- return _crypto.createHash.call(void 0, "sha1").update(content).digest("hex");
22509
+ let hash = FNV_OFFSET_BASIS;
22510
+ if (typeof content === "string") {
22511
+ for (let i = 0; i < content.length; i++) {
22512
+ const code = content.charCodeAt(i);
22513
+ hash = fnv1aStep(hash, code & 255);
22514
+ const high = code >>> 8;
22515
+ if (high > 0) {
22516
+ hash = fnv1aStep(hash, high);
22517
+ }
22518
+ }
22519
+ } else {
22520
+ for (const byte of content) {
22521
+ hash = fnv1aStep(hash, byte);
22522
+ }
22523
+ }
22524
+ return hash.toString(36);
22396
22525
  }
22397
22526
  var FileCache = class {
22398
22527
 
@@ -22433,7 +22562,7 @@ var FileCache = class {
22433
22562
  return true;
22434
22563
  }
22435
22564
  const cachedMtime = this.mtimeMap.get(id);
22436
- const nextSignature = _optionalChain([options, 'optionalAccess', _351 => _351.content]) !== void 0 ? createSignature(options.content) : void 0;
22565
+ const nextSignature = _optionalChain([options, 'optionalAccess', _355 => _355.content]) !== void 0 ? createSignature(options.content) : void 0;
22437
22566
  const updateSignature = () => {
22438
22567
  if (nextSignature !== void 0) {
22439
22568
  this.signatureMap.set(id, nextSignature);
@@ -22609,7 +22738,7 @@ function createScanService(ctx) {
22609
22738
  if (!ctx.configService) {
22610
22739
  throw new Error("configService must be initialized before scanning subpackages");
22611
22740
  }
22612
- const json = _optionalChain([scanState, 'access', _352 => _352.appEntry, 'optionalAccess', _353 => _353.json]);
22741
+ const json = _optionalChain([scanState, 'access', _356 => _356.appEntry, 'optionalAccess', _357 => _357.json]);
22613
22742
  if (scanState.isDirty || subPackageMap.size === 0) {
22614
22743
  subPackageMap.clear();
22615
22744
  independentSubPackageMap.clear();
@@ -22627,9 +22756,9 @@ function createScanService(ctx) {
22627
22756
  subPackage,
22628
22757
  entries: resolveSubPackageEntries(subPackage)
22629
22758
  };
22630
- const subPackageConfig = _optionalChain([ctx, 'access', _354 => _354.configService, 'access', _355 => _355.weappViteConfig, 'optionalAccess', _356 => _356.subPackages, 'optionalAccess', _357 => _357[subPackage.root]]);
22631
- meta.subPackage.dependencies = _optionalChain([subPackageConfig, 'optionalAccess', _358 => _358.dependencies]);
22632
- meta.subPackage.inlineConfig = _optionalChain([subPackageConfig, 'optionalAccess', _359 => _359.inlineConfig]);
22759
+ const subPackageConfig = _optionalChain([ctx, 'access', _358 => _358.configService, 'access', _359 => _359.weappViteConfig, 'optionalAccess', _360 => _360.subPackages, 'optionalAccess', _361 => _361[subPackage.root]]);
22760
+ meta.subPackage.dependencies = _optionalChain([subPackageConfig, 'optionalAccess', _362 => _362.dependencies]);
22761
+ meta.subPackage.inlineConfig = _optionalChain([subPackageConfig, 'optionalAccess', _363 => _363.inlineConfig]);
22633
22762
  metas.push(meta);
22634
22763
  if (subPackage.root) {
22635
22764
  subPackageMap.set(subPackage.root, meta);
@@ -22679,11 +22808,11 @@ function createScanService(ctx) {
22679
22808
  loadSubPackages,
22680
22809
  isMainPackageFileName,
22681
22810
  get workersOptions() {
22682
- return _optionalChain([scanState, 'access', _360 => _360.appEntry, 'optionalAccess', _361 => _361.json, 'optionalAccess', _362 => _362.workers]);
22811
+ return _optionalChain([scanState, 'access', _364 => _364.appEntry, 'optionalAccess', _365 => _365.json, 'optionalAccess', _366 => _366.workers]);
22683
22812
  },
22684
22813
  get workersDir() {
22685
- const workersOptions = _optionalChain([scanState, 'access', _363 => _363.appEntry, 'optionalAccess', _364 => _364.json, 'optionalAccess', _365 => _365.workers]);
22686
- return typeof workersOptions === "object" ? _optionalChain([workersOptions, 'optionalAccess', _366 => _366.path]) : workersOptions;
22814
+ const workersOptions = _optionalChain([scanState, 'access', _367 => _367.appEntry, 'optionalAccess', _368 => _368.json, 'optionalAccess', _369 => _369.workers]);
22815
+ return typeof workersOptions === "object" ? _optionalChain([workersOptions, 'optionalAccess', _370 => _370.path]) : workersOptions;
22687
22816
  },
22688
22817
  markDirty() {
22689
22818
  scanState.isDirty = true;
@@ -22729,7 +22858,7 @@ function createWatcherService(ctx) {
22729
22858
  },
22730
22859
  setRollupWatcher(watcher, root = "/") {
22731
22860
  const oldWatcher = rollupWatcherMap.get(root);
22732
- _optionalChain([oldWatcher, 'optionalAccess', _367 => _367.close, 'call', _368 => _368()]);
22861
+ _optionalChain([oldWatcher, 'optionalAccess', _371 => _371.close, 'call', _372 => _372()]);
22733
22862
  rollupWatcherMap.set(root, watcher);
22734
22863
  },
22735
22864
  closeAll() {
@@ -22765,7 +22894,7 @@ function createWatcherServicePlugin(ctx) {
22765
22894
  name: "weapp-runtime:watcher-service",
22766
22895
  closeBundle() {
22767
22896
  const configService = ctx.configService;
22768
- const isWatchMode = _optionalChain([configService, 'optionalAccess', _369 => _369.isDev]) || Boolean(_optionalChain([configService, 'optionalAccess', _370 => _370.inlineConfig, 'optionalAccess', _371 => _371.build, 'optionalAccess', _372 => _372.watch]));
22897
+ const isWatchMode = _optionalChain([configService, 'optionalAccess', _373 => _373.isDev]) || Boolean(_optionalChain([configService, 'optionalAccess', _374 => _374.inlineConfig, 'optionalAccess', _375 => _375.build, 'optionalAccess', _376 => _376.watch]));
22769
22898
  if (!isWatchMode) {
22770
22899
  service.closeAll();
22771
22900
  }
@@ -25159,7 +25288,7 @@ function fnv1aHash(input) {
25159
25288
  }
25160
25289
  return (hash >>> 0).toString(36);
25161
25290
  }
25162
- function createCacheKey(source, platform) {
25291
+ function createCacheKey2(source, platform) {
25163
25292
  return `${platform}:${source.length.toString(36)}:${fnv1aHash(source)}`;
25164
25293
  }
25165
25294
  function resolveEventDirective(raw) {
@@ -25222,7 +25351,7 @@ function scanWxml(wxml, options) {
25222
25351
  platform: "weapp"
25223
25352
  });
25224
25353
  const canUseCache = opts.excludeComponent === defaultExcludeComponent;
25225
- const cacheKey = canUseCache ? createCacheKey(source, opts.platform) : void 0;
25354
+ const cacheKey = canUseCache ? createCacheKey2(source, opts.platform) : void 0;
25226
25355
  if (cacheKey) {
25227
25356
  const cached = scanWxmlCache.get(cacheKey);
25228
25357
  if (cached) {
@@ -25364,6 +25493,9 @@ function scanWxml(wxml, options) {
25364
25493
  source
25365
25494
  );
25366
25495
  parser.end();
25496
+ if (removalRanges.length > 1) {
25497
+ removalRanges.sort((a, b) => b.start - a.start);
25498
+ }
25367
25499
  const token = {
25368
25500
  components: components2,
25369
25501
  deps,
@@ -25412,7 +25544,7 @@ function createWxmlService(ctx) {
25412
25544
  return set3;
25413
25545
  }
25414
25546
  function clearAll() {
25415
- const currentRoot = _optionalChain([ctx, 'access', _373 => _373.configService, 'optionalAccess', _374 => _374.currentSubPackageRoot]);
25547
+ const currentRoot = _optionalChain([ctx, 'access', _377 => _377.configService, 'optionalAccess', _378 => _378.currentSubPackageRoot]);
25416
25548
  if (!currentRoot) {
25417
25549
  depsMap.clear();
25418
25550
  tokenMap.clear();
@@ -25467,7 +25599,7 @@ function createWxmlService(ctx) {
25467
25599
  }
25468
25600
  return scanWxml(wxml, {
25469
25601
  platform: ctx.configService.platform,
25470
- ..._optionalChain([ctx, 'access', _375 => _375.configService, 'access', _376 => _376.weappViteConfig, 'optionalAccess', _377 => _377.enhance, 'optionalAccess', _378 => _378.wxml]) === true ? {} : _optionalChain([ctx, 'access', _379 => _379.configService, 'access', _380 => _380.weappViteConfig, 'optionalAccess', _381 => _381.enhance, 'optionalAccess', _382 => _382.wxml])
25602
+ ..._optionalChain([ctx, 'access', _379 => _379.configService, 'access', _380 => _380.weappViteConfig, 'optionalAccess', _381 => _381.enhance, 'optionalAccess', _382 => _382.wxml]) === true ? {} : _optionalChain([ctx, 'access', _383 => _383.configService, 'access', _384 => _384.weappViteConfig, 'optionalAccess', _385 => _385.enhance, 'optionalAccess', _386 => _386.wxml])
25471
25603
  });
25472
25604
  }
25473
25605
  async function scan(filepath) {
@@ -25576,8 +25708,8 @@ function resetCompilerContext(key) {
25576
25708
 
25577
25709
  // src/createContext.ts
25578
25710
  async function createCompilerContext(options) {
25579
- const key = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _383 => _383.key]), () => ( "default"));
25580
- if (!_optionalChain([options, 'optionalAccess', _384 => _384.key])) {
25711
+ const key = _nullishCoalesce(_optionalChain([options, 'optionalAccess', _387 => _387.key]), () => ( "default"));
25712
+ if (!_optionalChain([options, 'optionalAccess', _388 => _388.key])) {
25581
25713
  resetCompilerContext(key);
25582
25714
  }
25583
25715
  const ctx = getCompilerContext(key);