create-nextly-app 0.0.2-alpha.34 → 0.0.2-alpha.37

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.
@@ -7,21 +7,21 @@ import { AsyncLocalStorage } from 'async_hooks';
7
7
  import crypto, { createHash, randomBytes } from 'crypto';
8
8
  import { promisify, styleText, debuglog, callbackify, aborted, inspect, stripVTControlCharacters, isDeepStrictEqual } from 'util';
9
9
  import process4, { hrtime, execPath, execArgv, platform, stdin, stdout } from 'process';
10
- import Mi from 'assert';
10
+ import zi from 'assert';
11
11
  import os, { constants, arch, platform as platform$1 } from 'os';
12
12
  import tty, { ReadStream } from 'tty';
13
13
  import { fileURLToPath } from 'url';
14
14
  import { execFile, spawn, spawnSync, ChildProcess } from 'child_process';
15
15
  import { StringDecoder } from 'string_decoder';
16
16
  import { scheduler, setTimeout as setTimeout$1, setImmediate } from 'timers/promises';
17
- import Kr, { on, EventEmitter, setMaxListeners, once, addAbortListener } from 'events';
17
+ import Qr, { on, EventEmitter, setMaxListeners, once, addAbortListener } from 'events';
18
18
  import { serialize } from 'v8';
19
19
  import { finished, pipeline } from 'stream/promises';
20
- import Ns, { getDefaultHighWaterMark, Duplex, Writable, Readable, PassThrough, Transform } from 'stream';
20
+ import Cs, { getDefaultHighWaterMark, Duplex, Writable, Readable, PassThrough, Transform } from 'stream';
21
21
  import { Buffer as Buffer$1 } from 'buffer';
22
- import * as ks from 'zlib';
23
- import ks__default from 'zlib';
24
- import jn from 'fs/promises';
22
+ import * as Ps from 'zlib';
23
+ import Ps__default from 'zlib';
24
+ import ro from 'fs/promises';
25
25
 
26
26
  const require$1 = createRequire(import.meta.url);
27
27
  var __create = Object.create;
@@ -63,16 +63,16 @@ var require_src = __commonJS({
63
63
  var CSI = `${ESC}[`;
64
64
  var beep = "\x07";
65
65
  var cursor = {
66
- to(x3, y3) {
67
- if (!y3) return `${CSI}${x3 + 1}G`;
68
- return `${CSI}${y3 + 1};${x3 + 1}H`;
66
+ to(x3, y2) {
67
+ if (!y2) return `${CSI}${x3 + 1}G`;
68
+ return `${CSI}${y2 + 1};${x3 + 1}H`;
69
69
  },
70
- move(x3, y3) {
70
+ move(x3, y2) {
71
71
  let ret = "";
72
72
  if (x3 < 0) ret += `${CSI}${-x3}D`;
73
73
  else if (x3 > 0) ret += `${CSI}${x3}C`;
74
- if (y3 < 0) ret += `${CSI}${-y3}A`;
75
- else if (y3 > 0) ret += `${CSI}${y3}B`;
74
+ if (y2 < 0) ret += `${CSI}${-y2}A`;
75
+ else if (y2 > 0) ret += `${CSI}${y2}B`;
76
76
  return ret;
77
77
  },
78
78
  up: (count2 = 1) => `${CSI}${count2}A`,
@@ -114,26 +114,26 @@ var require_src = __commonJS({
114
114
  // ../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js
115
115
  var require_universalify = __commonJS({
116
116
  "../../node_modules/.pnpm/universalify@2.0.1/node_modules/universalify/index.js"(exports$1) {
117
- exports$1.fromCallback = function(fn2) {
117
+ exports$1.fromCallback = function(fn) {
118
118
  return Object.defineProperty(function(...args) {
119
- if (typeof args[args.length - 1] === "function") fn2.apply(this, args);
119
+ if (typeof args[args.length - 1] === "function") fn.apply(this, args);
120
120
  else {
121
121
  return new Promise((resolve, reject) => {
122
122
  args.push((err, res) => err != null ? reject(err) : resolve(res));
123
- fn2.apply(this, args);
123
+ fn.apply(this, args);
124
124
  });
125
125
  }
126
- }, "name", { value: fn2.name });
126
+ }, "name", { value: fn.name });
127
127
  };
128
- exports$1.fromPromise = function(fn2) {
128
+ exports$1.fromPromise = function(fn) {
129
129
  return Object.defineProperty(function(...args) {
130
130
  const cb = args[args.length - 1];
131
- if (typeof cb !== "function") return fn2.apply(this, args);
131
+ if (typeof cb !== "function") return fn.apply(this, args);
132
132
  else {
133
133
  args.pop();
134
- fn2.apply(this, args).then((r) => cb(null, r), cb);
134
+ fn.apply(this, args).then((r) => cb(null, r), cb);
135
135
  }
136
- }, "name", { value: fn2.name });
136
+ }, "name", { value: fn.name });
137
137
  };
138
138
  }
139
139
  });
@@ -883,16 +883,16 @@ var require_graceful_fs = __commonJS({
883
883
  if (fs16[gracefulQueue].length === 0)
884
884
  return;
885
885
  var elem = fs16[gracefulQueue].shift();
886
- var fn2 = elem[0];
886
+ var fn = elem[0];
887
887
  var args = elem[1];
888
888
  var err = elem[2];
889
889
  var startTime = elem[3];
890
890
  var lastTime = elem[4];
891
891
  if (startTime === void 0) {
892
- debug("RETRY", fn2.name, args);
893
- fn2.apply(null, args);
892
+ debug("RETRY", fn.name, args);
893
+ fn.apply(null, args);
894
894
  } else if (Date.now() - startTime >= 6e4) {
895
- debug("TIMEOUT", fn2.name, args);
895
+ debug("TIMEOUT", fn.name, args);
896
896
  var cb = args.pop();
897
897
  if (typeof cb === "function")
898
898
  cb.call(null, err);
@@ -901,8 +901,8 @@ var require_graceful_fs = __commonJS({
901
901
  var sinceStart = Math.max(lastTime - startTime, 1);
902
902
  var desiredDelay = Math.min(sinceStart * 1.2, 100);
903
903
  if (sinceAttempt >= desiredDelay) {
904
- debug("RETRY", fn2.name, args);
905
- fn2.apply(null, args.concat([startTime]));
904
+ debug("RETRY", fn.name, args);
905
+ fn.apply(null, args.concat([startTime]));
906
906
  } else {
907
907
  fs16[gracefulQueue].push(elem);
908
908
  }
@@ -1273,11 +1273,11 @@ var require_stat = __commonJS({
1273
1273
  // ../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/util/async.js
1274
1274
  var require_async = __commonJS({
1275
1275
  "../../node_modules/.pnpm/fs-extra@11.3.2/node_modules/fs-extra/lib/util/async.js"(exports$1, module) {
1276
- async function asyncIteratorConcurrentProcess(iterator, fn2) {
1276
+ async function asyncIteratorConcurrentProcess(iterator, fn) {
1277
1277
  const promises = [];
1278
1278
  for await (const item of iterator) {
1279
1279
  promises.push(
1280
- fn2(item).then(
1280
+ fn(item).then(
1281
1281
  () => null,
1282
1282
  (err) => err ?? new Error("unknown error")
1283
1283
  )
@@ -3895,7 +3895,7 @@ var require_codegen = __commonJS2({
3895
3895
  }
3896
3896
  exports$1.or = or2;
3897
3897
  function mappend(op) {
3898
- return (x3, y3) => x3 === code_1.nil ? y3 : y3 === code_1.nil ? x3 : (0, code_1._)`${par(x3)} ${op} ${par(y3)}`;
3898
+ return (x3, y2) => x3 === code_1.nil ? y2 : y2 === code_1.nil ? x3 : (0, code_1._)`${par(x3)} ${op} ${par(y2)}`;
3899
3899
  }
3900
3900
  function par(x3) {
3901
3901
  return x3 instanceof code_1.Name ? x3 : (0, code_1._)`(${x3})`;
@@ -5897,9 +5897,12 @@ var require_data = __commonJS2({
5897
5897
  }
5898
5898
  });
5899
5899
  var require_utils = __commonJS2({
5900
- "../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/utils.js"(exports$1, module) {
5900
+ "../../node_modules/.pnpm/fast-uri@3.1.3/node_modules/fast-uri/lib/utils.js"(exports$1, module) {
5901
5901
  var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
5902
5902
  var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
5903
+ var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
5904
+ var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
5905
+ var isPathCharacter = RegExp.prototype.test.bind(/^[\da-z\-._~!$&'()*+,;=:@/]$/iu);
5903
5906
  function stringArrayToHexStripped(input) {
5904
5907
  let acc = "";
5905
5908
  let code = 0;
@@ -6092,27 +6095,77 @@ var require_utils = __commonJS2({
6092
6095
  }
6093
6096
  return output.join("");
6094
6097
  }
6095
- function normalizeComponentEncoding(component, esc) {
6096
- const func = esc !== true ? escape : unescape;
6097
- if (component.scheme !== void 0) {
6098
- component.scheme = func(component.scheme);
6099
- }
6100
- if (component.userinfo !== void 0) {
6101
- component.userinfo = func(component.userinfo);
6102
- }
6103
- if (component.host !== void 0) {
6104
- component.host = func(component.host);
6098
+ var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
6099
+ var HOST_DELIM_RE = /[@/?#:]/g;
6100
+ var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
6101
+ function reescapeHostDelimiters(host, isIP) {
6102
+ const re3 = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
6103
+ re3.lastIndex = 0;
6104
+ return host.replace(re3, (ch) => HOST_DELIMS[ch]);
6105
+ }
6106
+ function normalizePercentEncoding(input, decodeUnreserved = false) {
6107
+ if (input.indexOf("%") === -1) {
6108
+ return input;
6105
6109
  }
6106
- if (component.path !== void 0) {
6107
- component.path = func(component.path);
6110
+ let output = "";
6111
+ for (let i2 = 0; i2 < input.length; i2++) {
6112
+ if (input[i2] === "%" && i2 + 2 < input.length) {
6113
+ const hex = input.slice(i2 + 1, i2 + 3);
6114
+ if (isHexPair(hex)) {
6115
+ const normalizedHex = hex.toUpperCase();
6116
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
6117
+ if (decodeUnreserved && isUnreserved(decoded)) {
6118
+ output += decoded;
6119
+ } else {
6120
+ output += "%" + normalizedHex;
6121
+ }
6122
+ i2 += 2;
6123
+ continue;
6124
+ }
6125
+ }
6126
+ output += input[i2];
6108
6127
  }
6109
- if (component.query !== void 0) {
6110
- component.query = func(component.query);
6128
+ return output;
6129
+ }
6130
+ function normalizePathEncoding(input) {
6131
+ let output = "";
6132
+ for (let i2 = 0; i2 < input.length; i2++) {
6133
+ if (input[i2] === "%" && i2 + 2 < input.length) {
6134
+ const hex = input.slice(i2 + 1, i2 + 3);
6135
+ if (isHexPair(hex)) {
6136
+ const normalizedHex = hex.toUpperCase();
6137
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
6138
+ if (decoded !== "." && isUnreserved(decoded)) {
6139
+ output += decoded;
6140
+ } else {
6141
+ output += "%" + normalizedHex;
6142
+ }
6143
+ i2 += 2;
6144
+ continue;
6145
+ }
6146
+ }
6147
+ if (isPathCharacter(input[i2])) {
6148
+ output += input[i2];
6149
+ } else {
6150
+ output += escape(input[i2]);
6151
+ }
6111
6152
  }
6112
- if (component.fragment !== void 0) {
6113
- component.fragment = func(component.fragment);
6153
+ return output;
6154
+ }
6155
+ function escapePreservingEscapes(input) {
6156
+ let output = "";
6157
+ for (let i2 = 0; i2 < input.length; i2++) {
6158
+ if (input[i2] === "%" && i2 + 2 < input.length) {
6159
+ const hex = input.slice(i2 + 1, i2 + 3);
6160
+ if (isHexPair(hex)) {
6161
+ output += "%" + hex.toUpperCase();
6162
+ i2 += 2;
6163
+ continue;
6164
+ }
6165
+ }
6166
+ output += escape(input[i2]);
6114
6167
  }
6115
- return component;
6168
+ return output;
6116
6169
  }
6117
6170
  function recomposeAuthority(component) {
6118
6171
  const uriTokens = [];
@@ -6127,7 +6180,7 @@ var require_utils = __commonJS2({
6127
6180
  if (ipV6res.isIPV6 === true) {
6128
6181
  host = `[${ipV6res.escapedHost}]`;
6129
6182
  } else {
6130
- host = component.host;
6183
+ host = reescapeHostDelimiters(host, false);
6131
6184
  }
6132
6185
  }
6133
6186
  uriTokens.push(host);
@@ -6141,7 +6194,10 @@ var require_utils = __commonJS2({
6141
6194
  module.exports = {
6142
6195
  nonSimpleDomain,
6143
6196
  recomposeAuthority,
6144
- normalizeComponentEncoding,
6197
+ reescapeHostDelimiters,
6198
+ normalizePercentEncoding,
6199
+ normalizePathEncoding,
6200
+ escapePreservingEscapes,
6145
6201
  removeDotSegments,
6146
6202
  isIPv4,
6147
6203
  isUUID,
@@ -6151,7 +6207,7 @@ var require_utils = __commonJS2({
6151
6207
  }
6152
6208
  });
6153
6209
  var require_schemes = __commonJS2({
6154
- "../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/lib/schemes.js"(exports$1, module) {
6210
+ "../../node_modules/.pnpm/fast-uri@3.1.3/node_modules/fast-uri/lib/schemes.js"(exports$1, module) {
6155
6211
  var { isUUID } = require_utils();
6156
6212
  var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
6157
6213
  var supportedSchemeNames = (
@@ -6358,13 +6414,13 @@ var require_schemes = __commonJS2({
6358
6414
  }
6359
6415
  });
6360
6416
  var require_fast_uri = __commonJS2({
6361
- "../../node_modules/.pnpm/fast-uri@3.1.0/node_modules/fast-uri/index.js"(exports$1, module) {
6362
- var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizeComponentEncoding, isIPv4, nonSimpleDomain } = require_utils();
6417
+ "../../node_modules/.pnpm/fast-uri@3.1.3/node_modules/fast-uri/index.js"(exports$1, module) {
6418
+ var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, escapePreservingEscapes, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils();
6363
6419
  var { SCHEMES, getSchemeHandler } = require_schemes();
6364
6420
  function normalize(uri, options) {
6365
6421
  if (typeof uri === "string") {
6366
6422
  uri = /** @type {T} */
6367
- serialize2(parse(uri, options), options);
6423
+ normalizeString(uri, options);
6368
6424
  } else if (typeof uri === "object") {
6369
6425
  uri = /** @type {T} */
6370
6426
  parse(serialize2(uri, options), options);
@@ -6431,19 +6487,9 @@ var require_fast_uri = __commonJS2({
6431
6487
  return target;
6432
6488
  }
6433
6489
  function equal(uriA, uriB, options) {
6434
- if (typeof uriA === "string") {
6435
- uriA = unescape(uriA);
6436
- uriA = serialize2(normalizeComponentEncoding(parse(uriA, options), true), { ...options, skipEscape: true });
6437
- } else if (typeof uriA === "object") {
6438
- uriA = serialize2(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
6439
- }
6440
- if (typeof uriB === "string") {
6441
- uriB = unescape(uriB);
6442
- uriB = serialize2(normalizeComponentEncoding(parse(uriB, options), true), { ...options, skipEscape: true });
6443
- } else if (typeof uriB === "object") {
6444
- uriB = serialize2(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
6445
- }
6446
- return uriA.toLowerCase() === uriB.toLowerCase();
6490
+ const normalizedA = normalizeComparableURI(uriA, options);
6491
+ const normalizedB = normalizeComparableURI(uriB, options);
6492
+ return normalizedA !== void 0 && normalizedB !== void 0 && normalizedA.toLowerCase() === normalizedB.toLowerCase();
6447
6493
  }
6448
6494
  function serialize2(cmpts, opts) {
6449
6495
  const component = {
@@ -6468,12 +6514,12 @@ var require_fast_uri = __commonJS2({
6468
6514
  if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
6469
6515
  if (component.path !== void 0) {
6470
6516
  if (!options.skipEscape) {
6471
- component.path = escape(component.path);
6517
+ component.path = escapePreservingEscapes(component.path);
6472
6518
  if (component.scheme !== void 0) {
6473
6519
  component.path = component.path.split("%3A").join(":");
6474
6520
  }
6475
6521
  } else {
6476
- component.path = unescape(component.path);
6522
+ component.path = normalizePercentEncoding(component.path);
6477
6523
  }
6478
6524
  }
6479
6525
  if (options.reference !== "suffix" && component.scheme) {
@@ -6508,7 +6554,16 @@ var require_fast_uri = __commonJS2({
6508
6554
  return uriTokens.join("");
6509
6555
  }
6510
6556
  var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
6511
- function parse(uri, opts) {
6557
+ function getParseError(parsed, matches) {
6558
+ if (matches[2] !== void 0 && parsed.path && parsed.path[0] !== "/") {
6559
+ return 'URI path must start with "/" when authority is present.';
6560
+ }
6561
+ if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) {
6562
+ return "URI port is malformed.";
6563
+ }
6564
+ return void 0;
6565
+ }
6566
+ function parseWithStatus(uri, opts) {
6512
6567
  const options = Object.assign({}, opts);
6513
6568
  const parsed = {
6514
6569
  scheme: void 0,
@@ -6519,6 +6574,7 @@ var require_fast_uri = __commonJS2({
6519
6574
  query: void 0,
6520
6575
  fragment: void 0
6521
6576
  };
6577
+ let malformedAuthorityOrPort = false;
6522
6578
  let isIP = false;
6523
6579
  if (options.reference === "suffix") {
6524
6580
  if (options.scheme) {
@@ -6539,6 +6595,11 @@ var require_fast_uri = __commonJS2({
6539
6595
  if (isNaN(parsed.port)) {
6540
6596
  parsed.port = matches[5];
6541
6597
  }
6598
+ const parseError = getParseError(parsed, matches);
6599
+ if (parseError !== void 0) {
6600
+ parsed.error = parsed.error || parseError;
6601
+ malformedAuthorityOrPort = true;
6602
+ }
6542
6603
  if (parsed.host) {
6543
6604
  const ipv4result = isIPv4(parsed.host);
6544
6605
  if (ipv4result === false) {
@@ -6565,7 +6626,7 @@ var require_fast_uri = __commonJS2({
6565
6626
  if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
6566
6627
  if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
6567
6628
  try {
6568
- parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
6629
+ parsed.host = new URL("http://" + parsed.host).hostname;
6569
6630
  } catch (e) {
6570
6631
  parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
6571
6632
  }
@@ -6577,14 +6638,18 @@ var require_fast_uri = __commonJS2({
6577
6638
  parsed.scheme = unescape(parsed.scheme);
6578
6639
  }
6579
6640
  if (parsed.host !== void 0) {
6580
- parsed.host = unescape(parsed.host);
6641
+ parsed.host = reescapeHostDelimiters(unescape(parsed.host), isIP);
6581
6642
  }
6582
6643
  }
6583
6644
  if (parsed.path) {
6584
- parsed.path = escape(unescape(parsed.path));
6645
+ parsed.path = normalizePathEncoding(parsed.path);
6585
6646
  }
6586
6647
  if (parsed.fragment) {
6587
- parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
6648
+ try {
6649
+ parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
6650
+ } catch {
6651
+ parsed.error = parsed.error || "URI malformed";
6652
+ }
6588
6653
  }
6589
6654
  }
6590
6655
  if (schemeHandler && schemeHandler.parse) {
@@ -6593,7 +6658,29 @@ var require_fast_uri = __commonJS2({
6593
6658
  } else {
6594
6659
  parsed.error = parsed.error || "URI can not be parsed.";
6595
6660
  }
6596
- return parsed;
6661
+ return { parsed, malformedAuthorityOrPort };
6662
+ }
6663
+ function parse(uri, opts) {
6664
+ return parseWithStatus(uri, opts).parsed;
6665
+ }
6666
+ function normalizeString(uri, opts) {
6667
+ return normalizeStringWithStatus(uri, opts).normalized;
6668
+ }
6669
+ function normalizeStringWithStatus(uri, opts) {
6670
+ const { parsed, malformedAuthorityOrPort } = parseWithStatus(uri, opts);
6671
+ return {
6672
+ normalized: malformedAuthorityOrPort ? uri : serialize2(parsed, opts),
6673
+ malformedAuthorityOrPort
6674
+ };
6675
+ }
6676
+ function normalizeComparableURI(uri, opts) {
6677
+ if (typeof uri === "string") {
6678
+ const { normalized, malformedAuthorityOrPort } = normalizeStringWithStatus(uri, opts);
6679
+ return malformedAuthorityOrPort ? void 0 : normalized;
6680
+ }
6681
+ if (typeof uri === "object") {
6682
+ return serialize2(uri, opts);
6683
+ }
6597
6684
  }
6598
6685
  var fastUri = {
6599
6686
  SCHEMES,
@@ -6696,7 +6783,7 @@ var require_core = __commonJS2({
6696
6783
  };
6697
6784
  var MAX_EXPRESSION = 200;
6698
6785
  function requiredOptions(o2) {
6699
- var _a, _b, _c, _d, _e3, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r2, _s2, _t3, _u, _v, _w, _x, _y, _z, _0;
6786
+ var _a, _b, _c, _d, _e3, _f, _g, _h, _j, _k, _l, _m, _o2, _p, _q, _r2, _s2, _t3, _u, _v, _w, _x, _y, _z, _0;
6700
6787
  const s3 = o2.strict;
6701
6788
  const _optz = (_a = o2.code) === null || _a === void 0 ? void 0 : _a.optimize;
6702
6789
  const optimize = _optz === true || _optz === void 0 ? 1 : _optz || 0;
@@ -6707,7 +6794,7 @@ var require_core = __commonJS2({
6707
6794
  strictNumbers: (_h = (_g = o2.strictNumbers) !== null && _g !== void 0 ? _g : s3) !== null && _h !== void 0 ? _h : true,
6708
6795
  strictTypes: (_k = (_j = o2.strictTypes) !== null && _j !== void 0 ? _j : s3) !== null && _k !== void 0 ? _k : "log",
6709
6796
  strictTuples: (_m = (_l = o2.strictTuples) !== null && _l !== void 0 ? _l : s3) !== null && _m !== void 0 ? _m : "log",
6710
- strictRequired: (_p = (_o = o2.strictRequired) !== null && _o !== void 0 ? _o : s3) !== null && _p !== void 0 ? _p : false,
6797
+ strictRequired: (_p = (_o2 = o2.strictRequired) !== null && _o2 !== void 0 ? _o2 : s3) !== null && _p !== void 0 ? _p : false,
6711
6798
  code: o2.code ? { ...o2.code, optimize, regExp } : { optimize, regExp },
6712
6799
  loopRequired: (_q = o2.loopRequired) !== null && _q !== void 0 ? _q : MAX_EXPRESSION,
6713
6800
  loopEnum: (_r2 = o2.loopEnum) !== null && _r2 !== void 0 ? _r2 : MAX_EXPRESSION,
@@ -12608,7 +12695,7 @@ var _createLogger = (prefix, maybeCall, consoleLike) => {
12608
12695
  };
12609
12696
  return logger;
12610
12697
  };
12611
- var passThrough = (fn2) => fn2();
12698
+ var passThrough = (fn) => fn();
12612
12699
  function createLogger(prefix, maybeCall = passThrough) {
12613
12700
  return _createLogger(prefix, maybeCall, createConsole());
12614
12701
  }
@@ -12623,12 +12710,12 @@ function isEmpty(truthyValue) {
12623
12710
  function removeTrailingSlash(url) {
12624
12711
  return url?.replace(/\/+$/, "");
12625
12712
  }
12626
- async function retriable(fn2, props) {
12713
+ async function retriable(fn, props) {
12627
12714
  let lastError = null;
12628
12715
  for (let i2 = 0; i2 < props.retryCount + 1; i2++) {
12629
12716
  if (i2 > 0) await new Promise((r) => setTimeout(r, props.retryDelay));
12630
12717
  try {
12631
- const res = await fn2();
12718
+ const res = await fn();
12632
12719
  return res;
12633
12720
  } catch (e) {
12634
12721
  lastError = e;
@@ -12640,8 +12727,8 @@ async function retriable(fn2, props) {
12640
12727
  function currentISOTime() {
12641
12728
  return (/* @__PURE__ */ new Date()).toISOString();
12642
12729
  }
12643
- function safeSetTimeout(fn2, timeout) {
12644
- const t2 = setTimeout(fn2, timeout);
12730
+ function safeSetTimeout(fn, timeout) {
12731
+ const t2 = setTimeout(fn, timeout);
12645
12732
  t2?.unref && t2?.unref();
12646
12733
  return t2;
12647
12734
  }
@@ -12745,13 +12832,13 @@ var PostHogCoreStateless = class {
12745
12832
  if (options?.evaluationEnvironments && !options?.evaluationContexts) this._logger.warn("evaluationEnvironments is deprecated. Use evaluationContexts instead. This property will be removed in a future version.");
12746
12833
  this.disableCompression = !isGzipSupported() || (options?.disableCompression ?? false);
12747
12834
  }
12748
- logMsgIfDebug(fn2) {
12749
- if (this.isDebug) fn2();
12835
+ logMsgIfDebug(fn) {
12836
+ if (this.isDebug) fn();
12750
12837
  }
12751
- wrap(fn2) {
12838
+ wrap(fn) {
12752
12839
  if (this.disabled) return void this._logger.warn("The client is disabled");
12753
- if (this._isInitialized) return fn2();
12754
- this._initPromise.then(() => fn2());
12840
+ if (this._isInitialized) return fn();
12841
+ this._initPromise.then(() => fn());
12755
12842
  }
12756
12843
  getCommonEventProperties() {
12757
12844
  return {
@@ -14289,8 +14376,8 @@ var FeatureFlagsPoller = class {
14289
14376
  debug(enabled = true) {
14290
14377
  this.debugMode = enabled;
14291
14378
  }
14292
- logMsgIfDebug(fn2) {
14293
- if (this.debugMode) fn2();
14379
+ logMsgIfDebug(fn) {
14380
+ if (this.debugMode) fn();
14294
14381
  }
14295
14382
  createEvaluationContext(distinctId, groups = {}, personProperties = {}, groupProperties = {}, evaluationCache = {}) {
14296
14383
  return {
@@ -15493,9 +15580,9 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
15493
15580
  }
15494
15581
  return false;
15495
15582
  }
15496
- withContext(data, fn2, options) {
15497
- if (!this.context) return fn2();
15498
- return this.context.run(data, fn2, options);
15583
+ withContext(data, fn, options) {
15584
+ if (!this.context) return fn();
15585
+ return this.context.run(data, fn, options);
15499
15586
  }
15500
15587
  getContext() {
15501
15588
  return this.context?.get();
@@ -15703,8 +15790,8 @@ var PostHogBackendClient = class extends PostHogCoreStateless {
15703
15790
  beforeSend
15704
15791
  ];
15705
15792
  let result = eventMessage;
15706
- for (const fn2 of fns) {
15707
- result = fn2(result);
15793
+ for (const fn of fns) {
15794
+ result = fn(result);
15708
15795
  if (!result) {
15709
15796
  this._logger.info(`Event '${eventMessage.event}' was rejected in beforeSend function`);
15710
15797
  return null;
@@ -15724,8 +15811,8 @@ var PostHogContext = class {
15724
15811
  get() {
15725
15812
  return this.storage.getStore();
15726
15813
  }
15727
- run(context, fn2, options) {
15728
- return this.storage.run(this.resolve(context, options), fn2);
15814
+ run(context, fn, options) {
15815
+ return this.storage.run(this.resolve(context, options), fn);
15729
15816
  }
15730
15817
  enter(context, options) {
15731
15818
  this.storage.enterWith(this.resolve(context, options));
@@ -16056,18 +16143,18 @@ function envPaths(name, { suffix = "nodejs" } = {}) {
16056
16143
  }
16057
16144
  return linux(name);
16058
16145
  }
16059
- var attemptifyAsync = (fn2, options) => {
16146
+ var attemptifyAsync = (fn, options) => {
16060
16147
  const { onError } = options;
16061
16148
  return function attemptified(...args) {
16062
- return fn2.apply(void 0, args).catch(onError);
16149
+ return fn.apply(void 0, args).catch(onError);
16063
16150
  };
16064
16151
  };
16065
16152
  var attemptify_async_default = attemptifyAsync;
16066
- var attemptifySync = (fn2, options) => {
16153
+ var attemptifySync = (fn, options) => {
16067
16154
  const { onError } = options;
16068
16155
  return function attemptified(...args) {
16069
16156
  try {
16070
- return fn2.apply(void 0, args);
16157
+ return fn.apply(void 0, args);
16071
16158
  } catch (error) {
16072
16159
  return onError(error);
16073
16160
  }
@@ -16075,14 +16162,14 @@ var attemptifySync = (fn2, options) => {
16075
16162
  };
16076
16163
  var attemptify_sync_default = attemptifySync;
16077
16164
  var RETRY_INTERVAL = 250;
16078
- var retryifyAsync = (fn2, options) => {
16165
+ var retryifyAsync = (fn, options) => {
16079
16166
  const { isRetriable } = options;
16080
16167
  return function retryified(options2) {
16081
16168
  const { timeout } = options2;
16082
16169
  const interval = options2.interval ?? RETRY_INTERVAL;
16083
16170
  const timestamp = Date.now() + timeout;
16084
16171
  return function attempt(...args) {
16085
- return fn2.apply(void 0, args).catch((error) => {
16172
+ return fn.apply(void 0, args).catch((error) => {
16086
16173
  if (!isRetriable(error))
16087
16174
  throw error;
16088
16175
  if (Date.now() >= timestamp)
@@ -16099,7 +16186,7 @@ var retryifyAsync = (fn2, options) => {
16099
16186
  };
16100
16187
  };
16101
16188
  var retryify_async_default = retryifyAsync;
16102
- var retryifySync = (fn2, options) => {
16189
+ var retryifySync = (fn, options) => {
16103
16190
  const { isRetriable } = options;
16104
16191
  return function retryified(options2) {
16105
16192
  const { timeout } = options2;
@@ -16107,7 +16194,7 @@ var retryifySync = (fn2, options) => {
16107
16194
  return function attempt(...args) {
16108
16195
  while (true) {
16109
16196
  try {
16110
- return fn2.apply(void 0, args);
16197
+ return fn.apply(void 0, args);
16111
16198
  } catch (error) {
16112
16199
  if (!isRetriable(error))
16113
16200
  throw error;
@@ -16669,7 +16756,7 @@ var Conf = class {
16669
16756
  }
16670
16757
  this._validate(store);
16671
16758
  try {
16672
- Mi.deepEqual(fileStore, store);
16759
+ zi.deepEqual(fileStore, store);
16673
16760
  } catch {
16674
16761
  this.store = store;
16675
16762
  }
@@ -17674,57 +17761,57 @@ var Ft2 = new RegExp("\\p{M}+", "gu");
17674
17761
  var yt2 = { limit: 1 / 0, ellipsis: "" };
17675
17762
  var Le = (e, r = {}, s3 = {}) => {
17676
17763
  const i2 = r.limit ?? 1 / 0, a2 = r.ellipsis ?? "", o2 = r?.ellipsisWidth ?? (a2 ? Le(a2, yt2, s3).width : 0), u3 = s3.ansiWidth ?? 0, l = s3.controlWidth ?? 0, n2 = s3.tabWidth ?? 8, c3 = s3.ambiguousWidth ?? 1, p2 = s3.emojiWidth ?? 2, f2 = s3.fullWidthWidth ?? 2, g2 = s3.regularWidth ?? 1, E = s3.wideWidth ?? 2;
17677
- let $3 = 0, m2 = 0, d = e.length, F2 = 0, y3 = false, v2 = d, C2 = Math.max(0, i2 - o2), A2 = 0, b2 = 0, w2 = 0, S2 = 0;
17764
+ let $3 = 0, m2 = 0, d = e.length, F2 = 0, y2 = false, v2 = d, C2 = Math.max(0, i2 - o2), A2 = 0, b2 = 0, w2 = 0, S3 = 0;
17678
17765
  e: for (; ; ) {
17679
17766
  if (b2 > A2 || m2 >= d && m2 > $3) {
17680
17767
  const T2 = e.slice(A2, b2) || e.slice($3, m2);
17681
17768
  F2 = 0;
17682
17769
  for (const M3 of T2.replaceAll(Ft2, "")) {
17683
17770
  const O3 = M3.codePointAt(0) || 0;
17684
- if (gt2(O3) ? S2 = f2 : ft2(O3) ? S2 = E : c3 !== g2 && mt2(O3) ? S2 = c3 : S2 = g2, w2 + S2 > C2 && (v2 = Math.min(v2, Math.max(A2, $3) + F2)), w2 + S2 > i2) {
17685
- y3 = true;
17771
+ if (gt2(O3) ? S3 = f2 : ft2(O3) ? S3 = E : c3 !== g2 && mt2(O3) ? S3 = c3 : S3 = g2, w2 + S3 > C2 && (v2 = Math.min(v2, Math.max(A2, $3) + F2)), w2 + S3 > i2) {
17772
+ y2 = true;
17686
17773
  break e;
17687
17774
  }
17688
- F2 += M3.length, w2 += S2;
17775
+ F2 += M3.length, w2 += S3;
17689
17776
  }
17690
17777
  A2 = b2 = 0;
17691
17778
  }
17692
17779
  if (m2 >= d) break;
17693
17780
  if (ne.lastIndex = m2, ne.test(e)) {
17694
- if (F2 = ne.lastIndex - m2, S2 = F2 * g2, w2 + S2 > C2 && (v2 = Math.min(v2, m2 + Math.floor((C2 - w2) / g2))), w2 + S2 > i2) {
17695
- y3 = true;
17781
+ if (F2 = ne.lastIndex - m2, S3 = F2 * g2, w2 + S3 > C2 && (v2 = Math.min(v2, m2 + Math.floor((C2 - w2) / g2))), w2 + S3 > i2) {
17782
+ y2 = true;
17696
17783
  break;
17697
17784
  }
17698
- w2 += S2, A2 = $3, b2 = m2, m2 = $3 = ne.lastIndex;
17785
+ w2 += S3, A2 = $3, b2 = m2, m2 = $3 = ne.lastIndex;
17699
17786
  continue;
17700
17787
  }
17701
17788
  if (we.lastIndex = m2, we.test(e)) {
17702
17789
  if (w2 + u3 > C2 && (v2 = Math.min(v2, m2)), w2 + u3 > i2) {
17703
- y3 = true;
17790
+ y2 = true;
17704
17791
  break;
17705
17792
  }
17706
17793
  w2 += u3, A2 = $3, b2 = m2, m2 = $3 = we.lastIndex;
17707
17794
  continue;
17708
17795
  }
17709
17796
  if (re.lastIndex = m2, re.test(e)) {
17710
- if (F2 = re.lastIndex - m2, S2 = F2 * l, w2 + S2 > C2 && (v2 = Math.min(v2, m2 + Math.floor((C2 - w2) / l))), w2 + S2 > i2) {
17711
- y3 = true;
17797
+ if (F2 = re.lastIndex - m2, S3 = F2 * l, w2 + S3 > C2 && (v2 = Math.min(v2, m2 + Math.floor((C2 - w2) / l))), w2 + S3 > i2) {
17798
+ y2 = true;
17712
17799
  break;
17713
17800
  }
17714
- w2 += S2, A2 = $3, b2 = m2, m2 = $3 = re.lastIndex;
17801
+ w2 += S3, A2 = $3, b2 = m2, m2 = $3 = re.lastIndex;
17715
17802
  continue;
17716
17803
  }
17717
17804
  if (ie.lastIndex = m2, ie.test(e)) {
17718
- if (F2 = ie.lastIndex - m2, S2 = F2 * n2, w2 + S2 > C2 && (v2 = Math.min(v2, m2 + Math.floor((C2 - w2) / n2))), w2 + S2 > i2) {
17719
- y3 = true;
17805
+ if (F2 = ie.lastIndex - m2, S3 = F2 * n2, w2 + S3 > C2 && (v2 = Math.min(v2, m2 + Math.floor((C2 - w2) / n2))), w2 + S3 > i2) {
17806
+ y2 = true;
17720
17807
  break;
17721
17808
  }
17722
- w2 += S2, A2 = $3, b2 = m2, m2 = $3 = ie.lastIndex;
17809
+ w2 += S3, A2 = $3, b2 = m2, m2 = $3 = ie.lastIndex;
17723
17810
  continue;
17724
17811
  }
17725
17812
  if (Ae.lastIndex = m2, Ae.test(e)) {
17726
17813
  if (w2 + p2 > C2 && (v2 = Math.min(v2, m2)), w2 + p2 > i2) {
17727
- y3 = true;
17814
+ y2 = true;
17728
17815
  break;
17729
17816
  }
17730
17817
  w2 += p2, A2 = $3, b2 = m2, m2 = $3 = Ae.lastIndex;
@@ -17732,7 +17819,7 @@ var Le = (e, r = {}, s3 = {}) => {
17732
17819
  }
17733
17820
  m2 += 1;
17734
17821
  }
17735
- return { width: y3 ? C2 : w2, index: y3 ? v2 : d, truncated: y3, ellipsed: y3 && i2 >= o2 };
17822
+ return { width: y2 ? C2 : w2, index: y2 ? v2 : d, truncated: y2, ellipsed: y2 && i2 >= o2 };
17736
17823
  };
17737
17824
  var Et2 = { limit: 1 / 0, ellipsis: "", ellipsisWidth: 0 };
17738
17825
  var D2 = (e, r = {}) => Le(e, Et2, r).width;
@@ -17783,8 +17870,8 @@ var It2 = (e, r, s3 = {}) => {
17783
17870
  s3.trim !== false && (n2[n2.length - 1] = (n2.at(-1) ?? "").trimStart());
17784
17871
  let d = D2(n2.at(-1) ?? "");
17785
17872
  if ($3 !== 0 && (d >= r && (s3.wordWrap === false || s3.trim === false) && (n2.push(""), d = 0), (d > 0 || s3.trim === false) && (n2[n2.length - 1] += " ", d++)), s3.hard && l[$3] > r) {
17786
- const F2 = r - d, y3 = 1 + Math.floor((l[$3] - F2 - 1) / r);
17787
- Math.floor((l[$3] - 1) / r) < y3 && n2.push(""), Ie(n2, m2, r);
17873
+ const F2 = r - d, y2 = 1 + Math.floor((l[$3] - F2 - 1) / r);
17874
+ Math.floor((l[$3] - 1) / r) < y2 && n2.push(""), Ie(n2, m2, r);
17788
17875
  continue;
17789
17876
  }
17790
17877
  if (d + l[$3] > r && d > 0 && l[$3] > 0) {
@@ -17808,11 +17895,11 @@ var It2 = (e, r, s3 = {}) => {
17808
17895
  const $3 = f2.value, m2 = g2.value;
17809
17896
  if (i2 += $3, $3 === ae || $3 === je) {
17810
17897
  He.lastIndex = E + 1;
17811
- const y3 = He.exec(c3)?.groups;
17812
- if (y3?.code !== void 0) {
17813
- const v2 = Number.parseFloat(y3.code);
17898
+ const y2 = He.exec(c3)?.groups;
17899
+ if (y2?.code !== void 0) {
17900
+ const v2 = Number.parseFloat(y2.code);
17814
17901
  a2 = v2 === vt2 ? void 0 : v2;
17815
- } else y3?.uri !== void 0 && (o2 = y3.uri.length === 0 ? void 0 : y3.uri);
17902
+ } else y2?.uri !== void 0 && (o2 = y2.uri.length === 0 ? void 0 : y2.uri);
17816
17903
  }
17817
17904
  const d = a2 ? At2(a2) : void 0;
17818
17905
  m2 === `
@@ -17844,16 +17931,16 @@ var X2 = ({ cursor: e, options: r, style: s3, output: i2 = process.stdout, maxIt
17844
17931
  const m2 = Math.min(g2 + f2, r.length), d = [];
17845
17932
  let F2 = 0;
17846
17933
  E && F2++, $3 && F2++;
17847
- const y3 = g2 + (E ? 1 : 0), v2 = m2 - ($3 ? 1 : 0);
17848
- for (let A2 = y3; A2 < v2; A2++) {
17934
+ const y2 = g2 + (E ? 1 : 0), v2 = m2 - ($3 ? 1 : 0);
17935
+ for (let A2 = y2; A2 < v2; A2++) {
17849
17936
  const b2 = J2(s3(r[A2], A2 === e), l, { hard: true, trim: false }).split(`
17850
17937
  `);
17851
17938
  d.push(b2), F2 += b2.length;
17852
17939
  }
17853
17940
  if (F2 > p2) {
17854
17941
  let A2 = 0, b2 = 0, w2 = F2;
17855
- const S2 = e - y3, T2 = (M3, O3) => bt2(d, w2, M3, O3, p2);
17856
- E ? ({ lineCount: w2, removals: A2 } = T2(0, S2), w2 > p2 && ({ lineCount: w2, removals: b2 } = T2(S2 + 1, d.length))) : ({ lineCount: w2, removals: b2 } = T2(S2 + 1, d.length), w2 > p2 && ({ lineCount: w2, removals: A2 } = T2(0, S2))), A2 > 0 && (E = true, d.splice(0, A2)), b2 > 0 && ($3 = true, d.splice(d.length - b2, b2));
17942
+ const S3 = e - y2, T2 = (M3, O3) => bt2(d, w2, M3, O3, p2);
17943
+ E ? ({ lineCount: w2, removals: A2 } = T2(0, S3), w2 > p2 && ({ lineCount: w2, removals: b2 } = T2(S3 + 1, d.length))) : ({ lineCount: w2, removals: b2 } = T2(S3 + 1, d.length), w2 > p2 && ({ lineCount: w2, removals: A2 } = T2(0, S3))), A2 > 0 && (E = true, d.splice(0, A2)), b2 > 0 && ($3 = true, d.splice(d.length - b2, b2));
17857
17944
  }
17858
17945
  const C2 = [];
17859
17946
  E && C2.push(c3);
@@ -17954,14 +18041,14 @@ var Kt = (e) => styleText("magenta", e);
17954
18041
  var be = ({ indicator: e = "dots", onCancel: r, output: s3 = process.stdout, cancelMessage: i2, errorMessage: a2, frames: o2 = ee ? ["\u25D2", "\u25D0", "\u25D3", "\u25D1"] : ["\u2022", "o", "O", "0"], delay: u3 = ee ? 80 : 120, signal: l, ...n2 } = {}) => {
17955
18042
  const c3 = ce();
17956
18043
  let p2, f2, g2 = false, E = false, $3 = "", m2, d = performance.now();
17957
- const F2 = rt(s3), y3 = n2?.styleFrame ?? Kt, v2 = (B3) => {
18044
+ const F2 = rt(s3), y2 = n2?.styleFrame ?? Kt, v2 = (B3) => {
17958
18045
  const P3 = B3 > 1 ? a2 ?? _.messages.error : i2 ?? _.messages.cancel;
17959
18046
  E = B3 === 1, g2 && (k3(P3, B3), E && typeof r == "function" && r());
17960
18047
  }, C2 = () => v2(2), A2 = () => v2(1), b2 = () => {
17961
18048
  process.on("uncaughtExceptionMonitor", C2), process.on("unhandledRejection", C2), process.on("SIGINT", A2), process.on("SIGTERM", A2), process.on("exit", v2), l && l.addEventListener("abort", A2);
17962
18049
  }, w2 = () => {
17963
18050
  process.removeListener("uncaughtExceptionMonitor", C2), process.removeListener("unhandledRejection", C2), process.removeListener("SIGINT", A2), process.removeListener("SIGTERM", A2), process.removeListener("exit", v2), l && l.removeEventListener("abort", A2);
17964
- }, S2 = () => {
18051
+ }, S3 = () => {
17965
18052
  if (m2 === void 0) return;
17966
18053
  c3 && s3.write(`
17967
18054
  `);
@@ -17977,8 +18064,8 @@ var be = ({ indicator: e = "dots", onCancel: r, output: s3 = process.stdout, can
17977
18064
  let P3 = 0, G3 = 0;
17978
18065
  b2(), f2 = setInterval(() => {
17979
18066
  if (c3 && $3 === m2) return;
17980
- S2(), m2 = $3;
17981
- const L3 = y3(o2[P3]);
18067
+ S3(), m2 = $3;
18068
+ const L3 = y2(o2[P3]);
17982
18069
  let Z3;
17983
18070
  if (c3) Z3 = `${L3} ${$3}...`;
17984
18071
  else if (e === "timer") Z3 = `${L3} ${$3} ${M3(d)}`;
@@ -17991,7 +18078,7 @@ var be = ({ indicator: e = "dots", onCancel: r, output: s3 = process.stdout, can
17991
18078
  }, u3);
17992
18079
  }, k3 = (B3 = "", P3 = 0, G3 = false) => {
17993
18080
  if (!g2) return;
17994
- g2 = false, clearInterval(f2), S2();
18081
+ g2 = false, clearInterval(f2), S3();
17995
18082
  const L3 = P3 === 0 ? styleText("green", V) : P3 === 1 ? styleText("red", $e) : styleText("red", de);
17996
18083
  $3 = B3 ?? $3, G3 || (e === "timer" ? s3.write(`${L3} ${$3} ${M3(d)}
17997
18084
  `) : s3.write(`${L3} ${$3}
@@ -23479,12 +23566,12 @@ var Emitter = class {
23479
23566
  configurable: false
23480
23567
  });
23481
23568
  }
23482
- on(ev, fn2) {
23483
- this.listeners[ev].push(fn2);
23569
+ on(ev, fn) {
23570
+ this.listeners[ev].push(fn);
23484
23571
  }
23485
- removeListener(ev, fn2) {
23572
+ removeListener(ev, fn) {
23486
23573
  const list = this.listeners[ev];
23487
- const i2 = list.indexOf(fn2);
23574
+ const i2 = list.indexOf(fn);
23488
23575
  if (i2 === -1) {
23489
23576
  return;
23490
23577
  }
@@ -23500,8 +23587,8 @@ var Emitter = class {
23500
23587
  }
23501
23588
  this.emitted[ev] = true;
23502
23589
  let ret = false;
23503
- for (const fn2 of this.listeners[ev]) {
23504
- ret = fn2(code, signal) === true || ret;
23590
+ for (const fn of this.listeners[ev]) {
23591
+ ret = fn(code, signal) === true || ret;
23505
23592
  }
23506
23593
  if (ev === "exit") {
23507
23594
  ret = this.emit("afterExit", code, signal) || ret;
@@ -23595,9 +23682,9 @@ var SignalExit = class extends SignalExitBase {
23595
23682
  this.#emitter.count += 1;
23596
23683
  for (const sig of signals) {
23597
23684
  try {
23598
- const fn2 = this.#sigListeners[sig];
23599
- if (fn2)
23600
- this.#process.on(sig, fn2);
23685
+ const fn = this.#sigListeners[sig];
23686
+ if (fn)
23687
+ this.#process.on(sig, fn);
23601
23688
  } catch (_3) {
23602
23689
  }
23603
23690
  }
@@ -25126,6 +25213,7 @@ async function generatePackageJson(projectName, database, useYalc = false, proje
25126
25213
  dependencies["@nextlyhq/plugin-form-builder"] = versions["@nextlyhq/plugin-form-builder"] || "latest";
25127
25214
  }
25128
25215
  }
25216
+ dependencies["drizzle-orm"] = "1.0.0-rc.4";
25129
25217
  const devDependencies = {
25130
25218
  typescript: PINNED_VERSIONS.typescript,
25131
25219
  "@types/node": PINNED_VERSIONS["@types/node"],
@@ -25145,11 +25233,11 @@ async function generatePackageJson(projectName, database, useYalc = false, proje
25145
25233
  version: "0.1.0",
25146
25234
  private: true,
25147
25235
  scripts: {
25148
- // F1 PR 4: dev now boots Nextly in single-process mode via `next dev`.
25149
- // The lazy drizzle-kit/api import (PR 1) plus the in-process HMR
25150
- // listener (PR 2) replaced the wrapper that previously owned the
25151
- // terminal, schema prompts, and child supervision. `nextly dev` is
25152
- // gone; the only supported dev command is the standard `next dev`.
25236
+ // Dev boots Nextly in single-process mode via `next dev`. The lazy
25237
+ // per-dialect drizzle-kit import plus the in-process HMR listener
25238
+ // replaced the wrapper that previously owned the terminal, schema
25239
+ // prompts, and child supervision. `nextly dev` is gone; the only
25240
+ // supported dev command is the standard `next dev`.
25153
25241
  dev: "next dev --turbopack",
25154
25242
  // Build: migrate DB + compile Next.js + (if present) generate
25155
25243
  // the Pagefind search index. Templates without the search
@@ -25207,7 +25295,7 @@ async function generatePluginPackageJson(projectName, useYalc) {
25207
25295
  "@types/react-dom": PINNED_VERSIONS["@types/react-dom"],
25208
25296
  typescript: PINNED_VERSIONS.typescript,
25209
25297
  tsup: "^8.5.0",
25210
- vitest: "^4.0.8",
25298
+ vitest: "^4.1.0",
25211
25299
  eslint: PINNED_VERSIONS.eslint,
25212
25300
  "@eslint/js": PINNED_VERSIONS.eslint,
25213
25301
  "typescript-eslint": "^8.0.0"
@@ -25509,51 +25597,51 @@ async function installDependencies(cwd, projectInfo, database, useYalc = false,
25509
25597
 
25510
25598
  // src/lib/download-template.ts
25511
25599
  var import_fs_extra9 = __toESM(require_lib(), 1);
25512
- var kr = Object.defineProperty;
25513
- var vr = (s3, t2) => {
25514
- for (var e in t2) kr(s3, e, { get: t2[e], enumerable: true });
25515
- };
25516
- var Os = typeof process == "object" && process ? process : { stdout: null, stderr: null };
25517
- var Br = (s3) => !!s3 && typeof s3 == "object" && (s3 instanceof D3 || s3 instanceof Ns || Pr(s3) || zr(s3));
25518
- var Pr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof EventEmitter && typeof s3.pipe == "function" && s3.pipe !== Ns.Writable.prototype.pipe;
25519
- var zr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof EventEmitter && typeof s3.write == "function" && typeof s3.end == "function";
25520
- var q3 = Symbol("EOF");
25521
- var j2 = Symbol("maybeEmitEnd");
25522
- var rt2 = Symbol("emittedEnd");
25523
- var Le2 = Symbol("emittingEnd");
25524
- var jt2 = Symbol("emittedError");
25600
+ var zr = Object.defineProperty;
25601
+ var Ur = (s3, t2) => {
25602
+ for (var e in t2) zr(s3, e, { get: t2[e], enumerable: true });
25603
+ };
25604
+ var Ds = typeof process == "object" && process ? process : { stdout: null, stderr: null };
25605
+ var Wr = (s3) => !!s3 && typeof s3 == "object" && (s3 instanceof A || s3 instanceof Cs || Gr(s3) || Zr(s3));
25606
+ var Gr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof EventEmitter && typeof s3.pipe == "function" && s3.pipe !== Cs.Writable.prototype.pipe;
25607
+ var Zr = (s3) => !!s3 && typeof s3 == "object" && s3 instanceof EventEmitter && typeof s3.write == "function" && typeof s3.end == "function";
25608
+ var Q2 = Symbol("EOF");
25609
+ var J3 = Symbol("maybeEmitEnd");
25610
+ var nt2 = Symbol("emittedEnd");
25611
+ var De2 = Symbol("emittingEnd");
25612
+ var qt = Symbol("emittedError");
25525
25613
  var Ne2 = Symbol("closed");
25526
- var Ts = Symbol("read");
25614
+ var Ns = Symbol("read");
25527
25615
  var Ae2 = Symbol("flush");
25528
- var xs = Symbol("flushChunk");
25616
+ var As = Symbol("flushChunk");
25529
25617
  var z3 = Symbol("encoding");
25530
25618
  var Mt2 = Symbol("decoder");
25531
- var b = Symbol("flowing");
25619
+ var g = Symbol("flowing");
25532
25620
  var Qt = Symbol("paused");
25533
25621
  var Bt2 = Symbol("resume");
25534
- var _2 = Symbol("buffer");
25535
- var A = Symbol("pipes");
25536
- var g = Symbol("bufferLength");
25537
- var yi = Symbol("bufferPush");
25538
- var De2 = Symbol("bufferShift");
25622
+ var b = Symbol("buffer");
25623
+ var N3 = Symbol("pipes");
25624
+ var _2 = Symbol("bufferLength");
25625
+ var bi = Symbol("bufferPush");
25626
+ var Ie2 = Symbol("bufferShift");
25539
25627
  var L2 = Symbol("objectMode");
25540
- var w = Symbol("destroyed");
25541
- var Ri = Symbol("error");
25542
- var bi = Symbol("emitData");
25543
- var Ls = Symbol("emitEnd");
25544
- var _i = Symbol("emitEnd2");
25628
+ var S2 = Symbol("destroyed");
25629
+ var _i = Symbol("error");
25630
+ var Oi = Symbol("emitData");
25631
+ var Is = Symbol("emitEnd");
25632
+ var Ti = Symbol("emitEnd2");
25545
25633
  var Z2 = Symbol("async");
25546
- var gi = Symbol("abort");
25547
- var Ie2 = Symbol("aborted");
25634
+ var xi = Symbol("abort");
25635
+ var Ce2 = Symbol("aborted");
25548
25636
  var Jt2 = Symbol("signal");
25549
- var yt3 = Symbol("dataListeners");
25637
+ var Rt2 = Symbol("dataListeners");
25550
25638
  var C = Symbol("discarded");
25551
- var te2 = (s3) => Promise.resolve().then(s3);
25552
- var Ur = (s3) => s3();
25553
- var Hr = (s3) => s3 === "end" || s3 === "finish" || s3 === "prefinish";
25554
- var Wr = (s3) => s3 instanceof ArrayBuffer || !!s3 && typeof s3 == "object" && s3.constructor && s3.constructor.name === "ArrayBuffer" && s3.byteLength >= 0;
25555
- var Gr = (s3) => !Buffer.isBuffer(s3) && ArrayBuffer.isView(s3);
25556
- var Ce2 = class {
25639
+ var jt2 = (s3) => Promise.resolve().then(s3);
25640
+ var Yr = (s3) => s3();
25641
+ var Kr = (s3) => s3 === "end" || s3 === "finish" || s3 === "prefinish";
25642
+ var Vr = (s3) => s3 instanceof ArrayBuffer || !!s3 && typeof s3 == "object" && s3.constructor && s3.constructor.name === "ArrayBuffer" && s3.byteLength >= 0;
25643
+ var $r = (s3) => !Buffer.isBuffer(s3) && ArrayBuffer.isView(s3);
25644
+ var Fe2 = class {
25557
25645
  src;
25558
25646
  dest;
25559
25647
  opts;
@@ -25570,7 +25658,7 @@ var Ce2 = class {
25570
25658
  this.unpipe(), this.opts.end && this.dest.end();
25571
25659
  }
25572
25660
  };
25573
- var Oi = class extends Ce2 {
25661
+ var Li = class extends Fe2 {
25574
25662
  unpipe() {
25575
25663
  this.src.removeListener("error", this.proxyErrors), super.unpipe();
25576
25664
  }
@@ -25578,39 +25666,39 @@ var Oi = class extends Ce2 {
25578
25666
  super(t2, e, i2), this.proxyErrors = (r) => this.dest.emit("error", r), t2.on("error", this.proxyErrors);
25579
25667
  }
25580
25668
  };
25581
- var Zr = (s3) => !!s3.objectMode;
25582
- var Yr = (s3) => !s3.objectMode && !!s3.encoding && s3.encoding !== "buffer";
25583
- var D3 = class extends EventEmitter {
25584
- [b] = false;
25669
+ var Xr = (s3) => !!s3.objectMode;
25670
+ var qr = (s3) => !s3.objectMode && !!s3.encoding && s3.encoding !== "buffer";
25671
+ var A = class extends EventEmitter {
25672
+ [g] = false;
25585
25673
  [Qt] = false;
25586
- [A] = [];
25587
- [_2] = [];
25674
+ [N3] = [];
25675
+ [b] = [];
25588
25676
  [L2];
25589
25677
  [z3];
25590
25678
  [Z2];
25591
25679
  [Mt2];
25592
- [q3] = false;
25593
- [rt2] = false;
25594
- [Le2] = false;
25680
+ [Q2] = false;
25681
+ [nt2] = false;
25682
+ [De2] = false;
25595
25683
  [Ne2] = false;
25596
- [jt2] = null;
25597
- [g] = 0;
25598
- [w] = false;
25684
+ [qt] = null;
25685
+ [_2] = 0;
25686
+ [S2] = false;
25599
25687
  [Jt2];
25600
- [Ie2] = false;
25601
- [yt3] = 0;
25688
+ [Ce2] = false;
25689
+ [Rt2] = 0;
25602
25690
  [C] = false;
25603
25691
  writable = true;
25604
25692
  readable = true;
25605
25693
  constructor(...t2) {
25606
25694
  let e = t2[0] || {};
25607
25695
  if (super(), e.objectMode && typeof e.encoding == "string") throw new TypeError("Encoding and objectMode may not be used together");
25608
- Zr(e) ? (this[L2] = true, this[z3] = null) : Yr(e) ? (this[z3] = e.encoding, this[L2] = false) : (this[L2] = false, this[z3] = null), this[Z2] = !!e.async, this[Mt2] = this[z3] ? new StringDecoder(this[z3]) : null, e && e.debugExposeBuffer === true && Object.defineProperty(this, "buffer", { get: () => this[_2] }), e && e.debugExposePipes === true && Object.defineProperty(this, "pipes", { get: () => this[A] });
25696
+ Xr(e) ? (this[L2] = true, this[z3] = null) : qr(e) ? (this[z3] = e.encoding, this[L2] = false) : (this[L2] = false, this[z3] = null), this[Z2] = !!e.async, this[Mt2] = this[z3] ? new StringDecoder(this[z3]) : null, e && e.debugExposeBuffer === true && Object.defineProperty(this, "buffer", { get: () => this[b] }), e && e.debugExposePipes === true && Object.defineProperty(this, "pipes", { get: () => this[N3] });
25609
25697
  let { signal: i2 } = e;
25610
- i2 && (this[Jt2] = i2, i2.aborted ? this[gi]() : i2.addEventListener("abort", () => this[gi]()));
25698
+ i2 && (this[Jt2] = i2, i2.aborted ? this[xi]() : i2.addEventListener("abort", () => this[xi]()));
25611
25699
  }
25612
25700
  get bufferLength() {
25613
- return this[g];
25701
+ return this[_2];
25614
25702
  }
25615
25703
  get encoding() {
25616
25704
  return this[z3];
@@ -25633,99 +25721,99 @@ var D3 = class extends EventEmitter {
25633
25721
  set async(t2) {
25634
25722
  this[Z2] = this[Z2] || !!t2;
25635
25723
  }
25636
- [gi]() {
25637
- this[Ie2] = true, this.emit("abort", this[Jt2]?.reason), this.destroy(this[Jt2]?.reason);
25724
+ [xi]() {
25725
+ this[Ce2] = true, this.emit("abort", this[Jt2]?.reason), this.destroy(this[Jt2]?.reason);
25638
25726
  }
25639
25727
  get aborted() {
25640
- return this[Ie2];
25728
+ return this[Ce2];
25641
25729
  }
25642
25730
  set aborted(t2) {
25643
25731
  }
25644
25732
  write(t2, e, i2) {
25645
- if (this[Ie2]) return false;
25646
- if (this[q3]) throw new Error("write after end");
25647
- if (this[w]) return this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })), true;
25733
+ if (this[Ce2]) return false;
25734
+ if (this[Q2]) throw new Error("write after end");
25735
+ if (this[S2]) return this.emit("error", Object.assign(new Error("Cannot call write after a stream was destroyed"), { code: "ERR_STREAM_DESTROYED" })), true;
25648
25736
  typeof e == "function" && (i2 = e, e = "utf8"), e || (e = "utf8");
25649
- let r = this[Z2] ? te2 : Ur;
25737
+ let r = this[Z2] ? jt2 : Yr;
25650
25738
  if (!this[L2] && !Buffer.isBuffer(t2)) {
25651
- if (Gr(t2)) t2 = Buffer.from(t2.buffer, t2.byteOffset, t2.byteLength);
25652
- else if (Wr(t2)) t2 = Buffer.from(t2);
25739
+ if ($r(t2)) t2 = Buffer.from(t2.buffer, t2.byteOffset, t2.byteLength);
25740
+ else if (Vr(t2)) t2 = Buffer.from(t2);
25653
25741
  else if (typeof t2 != "string") throw new Error("Non-contiguous data written to non-objectMode stream");
25654
25742
  }
25655
- return this[L2] ? (this[b] && this[g] !== 0 && this[Ae2](true), this[b] ? this.emit("data", t2) : this[yi](t2), this[g] !== 0 && this.emit("readable"), i2 && r(i2), this[b]) : t2.length ? (typeof t2 == "string" && !(e === this[z3] && !this[Mt2]?.lastNeed) && (t2 = Buffer.from(t2, e)), Buffer.isBuffer(t2) && this[z3] && (t2 = this[Mt2].write(t2)), this[b] && this[g] !== 0 && this[Ae2](true), this[b] ? this.emit("data", t2) : this[yi](t2), this[g] !== 0 && this.emit("readable"), i2 && r(i2), this[b]) : (this[g] !== 0 && this.emit("readable"), i2 && r(i2), this[b]);
25743
+ return this[L2] ? (this[g] && this[_2] !== 0 && this[Ae2](true), this[g] ? this.emit("data", t2) : this[bi](t2), this[_2] !== 0 && this.emit("readable"), i2 && r(i2), this[g]) : t2.length ? (typeof t2 == "string" && !(e === this[z3] && !this[Mt2]?.lastNeed) && (t2 = Buffer.from(t2, e)), Buffer.isBuffer(t2) && this[z3] && (t2 = this[Mt2].write(t2)), this[g] && this[_2] !== 0 && this[Ae2](true), this[g] ? this.emit("data", t2) : this[bi](t2), this[_2] !== 0 && this.emit("readable"), i2 && r(i2), this[g]) : (this[_2] !== 0 && this.emit("readable"), i2 && r(i2), this[g]);
25656
25744
  }
25657
25745
  read(t2) {
25658
- if (this[w]) return null;
25659
- if (this[C] = false, this[g] === 0 || t2 === 0 || t2 && t2 > this[g]) return this[j2](), null;
25660
- this[L2] && (t2 = null), this[_2].length > 1 && !this[L2] && (this[_2] = [this[z3] ? this[_2].join("") : Buffer.concat(this[_2], this[g])]);
25661
- let e = this[Ts](t2 || null, this[_2][0]);
25662
- return this[j2](), e;
25663
- }
25664
- [Ts](t2, e) {
25665
- if (this[L2]) this[De2]();
25746
+ if (this[S2]) return null;
25747
+ if (this[C] = false, this[_2] === 0 || t2 === 0 || t2 && t2 > this[_2]) return this[J3](), null;
25748
+ this[L2] && (t2 = null), this[b].length > 1 && !this[L2] && (this[b] = [this[z3] ? this[b].join("") : Buffer.concat(this[b], this[_2])]);
25749
+ let e = this[Ns](t2 || null, this[b][0]);
25750
+ return this[J3](), e;
25751
+ }
25752
+ [Ns](t2, e) {
25753
+ if (this[L2]) this[Ie2]();
25666
25754
  else {
25667
25755
  let i2 = e;
25668
- t2 === i2.length || t2 === null ? this[De2]() : typeof i2 == "string" ? (this[_2][0] = i2.slice(t2), e = i2.slice(0, t2), this[g] -= t2) : (this[_2][0] = i2.subarray(t2), e = i2.subarray(0, t2), this[g] -= t2);
25756
+ t2 === i2.length || t2 === null ? this[Ie2]() : typeof i2 == "string" ? (this[b][0] = i2.slice(t2), e = i2.slice(0, t2), this[_2] -= t2) : (this[b][0] = i2.subarray(t2), e = i2.subarray(0, t2), this[_2] -= t2);
25669
25757
  }
25670
- return this.emit("data", e), !this[_2].length && !this[q3] && this.emit("drain"), e;
25758
+ return this.emit("data", e), !this[b].length && !this[Q2] && this.emit("drain"), e;
25671
25759
  }
25672
25760
  end(t2, e, i2) {
25673
- return typeof t2 == "function" && (i2 = t2, t2 = void 0), typeof e == "function" && (i2 = e, e = "utf8"), t2 !== void 0 && this.write(t2, e), i2 && this.once("end", i2), this[q3] = true, this.writable = false, (this[b] || !this[Qt]) && this[j2](), this;
25761
+ return typeof t2 == "function" && (i2 = t2, t2 = void 0), typeof e == "function" && (i2 = e, e = "utf8"), t2 !== void 0 && this.write(t2, e), i2 && this.once("end", i2), this[Q2] = true, this.writable = false, (this[g] || !this[Qt]) && this[J3](), this;
25674
25762
  }
25675
25763
  [Bt2]() {
25676
- this[w] || (!this[yt3] && !this[A].length && (this[C] = true), this[Qt] = false, this[b] = true, this.emit("resume"), this[_2].length ? this[Ae2]() : this[q3] ? this[j2]() : this.emit("drain"));
25764
+ this[S2] || (!this[Rt2] && !this[N3].length && (this[C] = true), this[Qt] = false, this[g] = true, this.emit("resume"), this[b].length ? this[Ae2]() : this[Q2] ? this[J3]() : this.emit("drain"));
25677
25765
  }
25678
25766
  resume() {
25679
25767
  return this[Bt2]();
25680
25768
  }
25681
25769
  pause() {
25682
- this[b] = false, this[Qt] = true, this[C] = false;
25770
+ this[g] = false, this[Qt] = true, this[C] = false;
25683
25771
  }
25684
25772
  get destroyed() {
25685
- return this[w];
25773
+ return this[S2];
25686
25774
  }
25687
25775
  get flowing() {
25688
- return this[b];
25776
+ return this[g];
25689
25777
  }
25690
25778
  get paused() {
25691
25779
  return this[Qt];
25692
25780
  }
25693
- [yi](t2) {
25694
- this[L2] ? this[g] += 1 : this[g] += t2.length, this[_2].push(t2);
25781
+ [bi](t2) {
25782
+ this[L2] ? this[_2] += 1 : this[_2] += t2.length, this[b].push(t2);
25695
25783
  }
25696
- [De2]() {
25697
- return this[L2] ? this[g] -= 1 : this[g] -= this[_2][0].length, this[_2].shift();
25784
+ [Ie2]() {
25785
+ return this[L2] ? this[_2] -= 1 : this[_2] -= this[b][0].length, this[b].shift();
25698
25786
  }
25699
25787
  [Ae2](t2 = false) {
25700
25788
  do
25701
25789
  ;
25702
- while (this[xs](this[De2]()) && this[_2].length);
25703
- !t2 && !this[_2].length && !this[q3] && this.emit("drain");
25790
+ while (this[As](this[Ie2]()) && this[b].length);
25791
+ !t2 && !this[b].length && !this[Q2] && this.emit("drain");
25704
25792
  }
25705
- [xs](t2) {
25706
- return this.emit("data", t2), this[b];
25793
+ [As](t2) {
25794
+ return this.emit("data", t2), this[g];
25707
25795
  }
25708
25796
  pipe(t2, e) {
25709
- if (this[w]) return t2;
25797
+ if (this[S2]) return t2;
25710
25798
  this[C] = false;
25711
- let i2 = this[rt2];
25712
- return e = e || {}, t2 === Os.stdout || t2 === Os.stderr ? e.end = false : e.end = e.end !== false, e.proxyErrors = !!e.proxyErrors, i2 ? e.end && t2.end() : (this[A].push(e.proxyErrors ? new Oi(this, t2, e) : new Ce2(this, t2, e)), this[Z2] ? te2(() => this[Bt2]()) : this[Bt2]()), t2;
25799
+ let i2 = this[nt2];
25800
+ return e = e || {}, t2 === Ds.stdout || t2 === Ds.stderr ? e.end = false : e.end = e.end !== false, e.proxyErrors = !!e.proxyErrors, i2 ? e.end && t2.end() : (this[N3].push(e.proxyErrors ? new Li(this, t2, e) : new Fe2(this, t2, e)), this[Z2] ? jt2(() => this[Bt2]()) : this[Bt2]()), t2;
25713
25801
  }
25714
25802
  unpipe(t2) {
25715
- let e = this[A].find((i2) => i2.dest === t2);
25716
- e && (this[A].length === 1 ? (this[b] && this[yt3] === 0 && (this[b] = false), this[A] = []) : this[A].splice(this[A].indexOf(e), 1), e.unpipe());
25803
+ let e = this[N3].find((i2) => i2.dest === t2);
25804
+ e && (this[N3].length === 1 ? (this[g] && this[Rt2] === 0 && (this[g] = false), this[N3] = []) : this[N3].splice(this[N3].indexOf(e), 1), e.unpipe());
25717
25805
  }
25718
25806
  addListener(t2, e) {
25719
25807
  return this.on(t2, e);
25720
25808
  }
25721
25809
  on(t2, e) {
25722
25810
  let i2 = super.on(t2, e);
25723
- if (t2 === "data") this[C] = false, this[yt3]++, !this[A].length && !this[b] && this[Bt2]();
25724
- else if (t2 === "readable" && this[g] !== 0) super.emit("readable");
25725
- else if (Hr(t2) && this[rt2]) super.emit(t2), this.removeAllListeners(t2);
25726
- else if (t2 === "error" && this[jt2]) {
25811
+ if (t2 === "data") this[C] = false, this[Rt2]++, !this[N3].length && !this[g] && this[Bt2]();
25812
+ else if (t2 === "readable" && this[_2] !== 0) super.emit("readable");
25813
+ else if (Kr(t2) && this[nt2]) super.emit(t2), this.removeAllListeners(t2);
25814
+ else if (t2 === "error" && this[qt]) {
25727
25815
  let r = e;
25728
- this[Z2] ? te2(() => r.call(this, this[jt2])) : r.call(this, this[jt2]);
25816
+ this[Z2] ? jt2(() => r.call(this, this[qt])) : r.call(this, this[qt]);
25729
25817
  }
25730
25818
  return i2;
25731
25819
  }
@@ -25734,58 +25822,58 @@ var D3 = class extends EventEmitter {
25734
25822
  }
25735
25823
  off(t2, e) {
25736
25824
  let i2 = super.off(t2, e);
25737
- return t2 === "data" && (this[yt3] = this.listeners("data").length, this[yt3] === 0 && !this[C] && !this[A].length && (this[b] = false)), i2;
25825
+ return t2 === "data" && (this[Rt2] = this.listeners("data").length, this[Rt2] === 0 && !this[C] && !this[N3].length && (this[g] = false)), i2;
25738
25826
  }
25739
25827
  removeAllListeners(t2) {
25740
25828
  let e = super.removeAllListeners(t2);
25741
- return (t2 === "data" || t2 === void 0) && (this[yt3] = 0, !this[C] && !this[A].length && (this[b] = false)), e;
25829
+ return (t2 === "data" || t2 === void 0) && (this[Rt2] = 0, !this[C] && !this[N3].length && (this[g] = false)), e;
25742
25830
  }
25743
25831
  get emittedEnd() {
25744
- return this[rt2];
25832
+ return this[nt2];
25745
25833
  }
25746
- [j2]() {
25747
- !this[Le2] && !this[rt2] && !this[w] && this[_2].length === 0 && this[q3] && (this[Le2] = true, this.emit("end"), this.emit("prefinish"), this.emit("finish"), this[Ne2] && this.emit("close"), this[Le2] = false);
25834
+ [J3]() {
25835
+ !this[De2] && !this[nt2] && !this[S2] && this[b].length === 0 && this[Q2] && (this[De2] = true, this.emit("end"), this.emit("prefinish"), this.emit("finish"), this[Ne2] && this.emit("close"), this[De2] = false);
25748
25836
  }
25749
25837
  emit(t2, ...e) {
25750
25838
  let i2 = e[0];
25751
- if (t2 !== "error" && t2 !== "close" && t2 !== w && this[w]) return false;
25752
- if (t2 === "data") return !this[L2] && !i2 ? false : this[Z2] ? (te2(() => this[bi](i2)), true) : this[bi](i2);
25753
- if (t2 === "end") return this[Ls]();
25839
+ if (t2 !== "error" && t2 !== "close" && t2 !== S2 && this[S2]) return false;
25840
+ if (t2 === "data") return !this[L2] && !i2 ? false : this[Z2] ? (jt2(() => this[Oi](i2)), true) : this[Oi](i2);
25841
+ if (t2 === "end") return this[Is]();
25754
25842
  if (t2 === "close") {
25755
- if (this[Ne2] = true, !this[rt2] && !this[w]) return false;
25843
+ if (this[Ne2] = true, !this[nt2] && !this[S2]) return false;
25756
25844
  let n2 = super.emit("close");
25757
25845
  return this.removeAllListeners("close"), n2;
25758
25846
  } else if (t2 === "error") {
25759
- this[jt2] = i2, super.emit(Ri, i2);
25847
+ this[qt] = i2, super.emit(_i, i2);
25760
25848
  let n2 = !this[Jt2] || this.listeners("error").length ? super.emit("error", i2) : false;
25761
- return this[j2](), n2;
25849
+ return this[J3](), n2;
25762
25850
  } else if (t2 === "resume") {
25763
25851
  let n2 = super.emit("resume");
25764
- return this[j2](), n2;
25852
+ return this[J3](), n2;
25765
25853
  } else if (t2 === "finish" || t2 === "prefinish") {
25766
25854
  let n2 = super.emit(t2);
25767
25855
  return this.removeAllListeners(t2), n2;
25768
25856
  }
25769
25857
  let r = super.emit(t2, ...e);
25770
- return this[j2](), r;
25858
+ return this[J3](), r;
25771
25859
  }
25772
- [bi](t2) {
25773
- for (let i2 of this[A]) i2.dest.write(t2) === false && this.pause();
25860
+ [Oi](t2) {
25861
+ for (let i2 of this[N3]) i2.dest.write(t2) === false && this.pause();
25774
25862
  let e = this[C] ? false : super.emit("data", t2);
25775
- return this[j2](), e;
25863
+ return this[J3](), e;
25776
25864
  }
25777
- [Ls]() {
25778
- return this[rt2] ? false : (this[rt2] = true, this.readable = false, this[Z2] ? (te2(() => this[_i]()), true) : this[_i]());
25865
+ [Is]() {
25866
+ return this[nt2] ? false : (this[nt2] = true, this.readable = false, this[Z2] ? (jt2(() => this[Ti]()), true) : this[Ti]());
25779
25867
  }
25780
- [_i]() {
25868
+ [Ti]() {
25781
25869
  if (this[Mt2]) {
25782
25870
  let e = this[Mt2].end();
25783
25871
  if (e) {
25784
- for (let i2 of this[A]) i2.dest.write(e);
25872
+ for (let i2 of this[N3]) i2.dest.write(e);
25785
25873
  this[C] || super.emit("data", e);
25786
25874
  }
25787
25875
  }
25788
- for (let e of this[A]) e.end();
25876
+ for (let e of this[N3]) e.end();
25789
25877
  let t2 = super.emit("end");
25790
25878
  return this.removeAllListeners("end"), t2;
25791
25879
  }
@@ -25804,7 +25892,7 @@ var D3 = class extends EventEmitter {
25804
25892
  }
25805
25893
  async promise() {
25806
25894
  return new Promise((t2, e) => {
25807
- this.on(w, () => e(new Error("stream destroyed"))), this.on("error", (i2) => e(i2)), this.on("end", () => t2());
25895
+ this.on(S2, () => e(new Error("stream destroyed"))), this.on("error", (i2) => e(i2)), this.on("end", () => t2());
25808
25896
  });
25809
25897
  }
25810
25898
  [Symbol.asyncIterator]() {
@@ -25814,16 +25902,16 @@ var D3 = class extends EventEmitter {
25814
25902
  if (t2) return e();
25815
25903
  let r = this.read();
25816
25904
  if (r !== null) return Promise.resolve({ done: false, value: r });
25817
- if (this[q3]) return e();
25905
+ if (this[Q2]) return e();
25818
25906
  let n2, o2, h3 = (d) => {
25819
- this.off("data", a2), this.off("end", l), this.off(w, c3), e(), o2(d);
25907
+ this.off("data", a2), this.off("end", l), this.off(S2, c3), e(), o2(d);
25820
25908
  }, a2 = (d) => {
25821
- this.off("error", h3), this.off("end", l), this.off(w, c3), this.pause(), n2({ value: d, done: !!this[q3] });
25909
+ this.off("error", h3), this.off("end", l), this.off(S2, c3), this.pause(), n2({ value: d, done: !!this[Q2] });
25822
25910
  }, l = () => {
25823
- this.off("error", h3), this.off("data", a2), this.off(w, c3), e(), n2({ done: true, value: void 0 });
25911
+ this.off("error", h3), this.off("data", a2), this.off(S2, c3), e(), n2({ done: true, value: void 0 });
25824
25912
  }, c3 = () => h3(new Error("stream destroyed"));
25825
- return new Promise((d, S2) => {
25826
- o2 = S2, n2 = d, this.once(w, c3), this.once("error", h3), this.once("end", l), this.once("data", a2);
25913
+ return new Promise((d, y2) => {
25914
+ o2 = y2, n2 = d, this.once(S2, c3), this.once("error", h3), this.once("end", l), this.once("data", a2);
25827
25915
  });
25828
25916
  }, throw: e, return: e, [Symbol.asyncIterator]() {
25829
25917
  return this;
@@ -25832,70 +25920,70 @@ var D3 = class extends EventEmitter {
25832
25920
  }
25833
25921
  [Symbol.iterator]() {
25834
25922
  this[C] = false;
25835
- let t2 = false, e = () => (this.pause(), this.off(Ri, e), this.off(w, e), this.off("end", e), t2 = true, { done: true, value: void 0 }), i2 = () => {
25923
+ let t2 = false, e = () => (this.pause(), this.off(_i, e), this.off(S2, e), this.off("end", e), t2 = true, { done: true, value: void 0 }), i2 = () => {
25836
25924
  if (t2) return e();
25837
25925
  let r = this.read();
25838
25926
  return r === null ? e() : { done: false, value: r };
25839
25927
  };
25840
- return this.once("end", e), this.once(Ri, e), this.once(w, e), { next: i2, throw: e, return: e, [Symbol.iterator]() {
25928
+ return this.once("end", e), this.once(_i, e), this.once(S2, e), { next: i2, throw: e, return: e, [Symbol.iterator]() {
25841
25929
  return this;
25842
25930
  }, [Symbol.dispose]: () => {
25843
25931
  } };
25844
25932
  }
25845
25933
  destroy(t2) {
25846
- if (this[w]) return t2 ? this.emit("error", t2) : this.emit(w), this;
25847
- this[w] = true, this[C] = true, this[_2].length = 0, this[g] = 0;
25934
+ if (this[S2]) return t2 ? this.emit("error", t2) : this.emit(S2), this;
25935
+ this[S2] = true, this[C] = true, this[b].length = 0, this[_2] = 0;
25848
25936
  let e = this;
25849
- return typeof e.close == "function" && !this[Ne2] && e.close(), t2 ? this.emit("error", t2) : this.emit(w), this;
25937
+ return typeof e.close == "function" && !this[Ne2] && e.close(), t2 ? this.emit("error", t2) : this.emit(S2), this;
25850
25938
  }
25851
25939
  static get isStream() {
25852
- return Br;
25940
+ return Wr;
25853
25941
  }
25854
25942
  };
25855
- var Vr = fs.writev;
25856
- var ot2 = Symbol("_autoClose");
25943
+ var Jr = fs.writev;
25944
+ var ht3 = Symbol("_autoClose");
25857
25945
  var H3 = Symbol("_close");
25858
- var ee2 = Symbol("_ended");
25859
- var m = Symbol("_fd");
25860
- var xi = Symbol("_finished");
25861
- var J3 = Symbol("_flags");
25862
- var Li = Symbol("_flush");
25863
- var Ii = Symbol("_handleChunk");
25864
- var Ci = Symbol("_makeBuf");
25865
- var se2 = Symbol("_mode");
25866
- var Fe2 = Symbol("_needDrain");
25946
+ var te2 = Symbol("_ended");
25947
+ var u2 = Symbol("_fd");
25948
+ var Ni = Symbol("_finished");
25949
+ var tt2 = Symbol("_flags");
25950
+ var Ai = Symbol("_flush");
25951
+ var ki = Symbol("_handleChunk");
25952
+ var vi = Symbol("_makeBuf");
25953
+ var ie2 = Symbol("_mode");
25954
+ var ke2 = Symbol("_needDrain");
25867
25955
  var Ut = Symbol("_onerror");
25868
25956
  var Ht = Symbol("_onopen");
25869
- var Ni = Symbol("_onread");
25957
+ var Ii = Symbol("_onread");
25870
25958
  var Pt = Symbol("_onwrite");
25871
- var ht3 = Symbol("_open");
25959
+ var at2 = Symbol("_open");
25872
25960
  var U3 = Symbol("_path");
25873
- var nt2 = Symbol("_pos");
25961
+ var ot2 = Symbol("_pos");
25874
25962
  var Y = Symbol("_queue");
25875
25963
  var zt = Symbol("_read");
25876
- var Ai = Symbol("_readSize");
25877
- var Q2 = Symbol("_reading");
25878
- var ie2 = Symbol("_remain");
25879
- var Di = Symbol("_size");
25880
- var ke2 = Symbol("_write");
25881
- var Rt2 = Symbol("_writing");
25882
- var ve2 = Symbol("_defaultFlag");
25964
+ var Ci = Symbol("_readSize");
25965
+ var j2 = Symbol("_reading");
25966
+ var ee2 = Symbol("_remain");
25967
+ var Fi = Symbol("_size");
25968
+ var ve2 = Symbol("_write");
25969
+ var gt3 = Symbol("_writing");
25970
+ var Me = Symbol("_defaultFlag");
25883
25971
  var bt3 = Symbol("_errored");
25884
- var _t2 = class extends D3 {
25972
+ var _t2 = class extends A {
25885
25973
  [bt3] = false;
25886
- [m];
25974
+ [u2];
25887
25975
  [U3];
25888
- [Ai];
25889
- [Q2] = false;
25890
- [Di];
25891
- [ie2];
25892
- [ot2];
25976
+ [Ci];
25977
+ [j2] = false;
25978
+ [Fi];
25979
+ [ee2];
25980
+ [ht3];
25893
25981
  constructor(t2, e) {
25894
25982
  if (e = e || {}, super(e), this.readable = true, this.writable = false, typeof t2 != "string") throw new TypeError("path must be a string");
25895
- this[bt3] = false, this[m] = typeof e.fd == "number" ? e.fd : void 0, this[U3] = t2, this[Ai] = e.readSize || 16 * 1024 * 1024, this[Q2] = false, this[Di] = typeof e.size == "number" ? e.size : 1 / 0, this[ie2] = this[Di], this[ot2] = typeof e.autoClose == "boolean" ? e.autoClose : true, typeof this[m] == "number" ? this[zt]() : this[ht3]();
25983
+ this[bt3] = false, this[u2] = typeof e.fd == "number" ? e.fd : void 0, this[U3] = t2, this[Ci] = e.readSize || 16 * 1024 * 1024, this[j2] = false, this[Fi] = typeof e.size == "number" ? e.size : 1 / 0, this[ee2] = this[Fi], this[ht3] = typeof e.autoClose == "boolean" ? e.autoClose : true, typeof this[u2] == "number" ? this[zt]() : this[at2]();
25896
25984
  }
25897
25985
  get fd() {
25898
- return this[m];
25986
+ return this[u2];
25899
25987
  }
25900
25988
  get path() {
25901
25989
  return this[U3];
@@ -25906,38 +25994,38 @@ var _t2 = class extends D3 {
25906
25994
  end() {
25907
25995
  throw new TypeError("this is a readable stream");
25908
25996
  }
25909
- [ht3]() {
25997
+ [at2]() {
25910
25998
  fs.open(this[U3], "r", (t2, e) => this[Ht](t2, e));
25911
25999
  }
25912
26000
  [Ht](t2, e) {
25913
- t2 ? this[Ut](t2) : (this[m] = e, this.emit("open", e), this[zt]());
26001
+ t2 ? this[Ut](t2) : (this[u2] = e, this.emit("open", e), this[zt]());
25914
26002
  }
25915
- [Ci]() {
25916
- return Buffer.allocUnsafe(Math.min(this[Ai], this[ie2]));
26003
+ [vi]() {
26004
+ return Buffer.allocUnsafe(Math.min(this[Ci], this[ee2]));
25917
26005
  }
25918
26006
  [zt]() {
25919
- if (!this[Q2]) {
25920
- this[Q2] = true;
25921
- let t2 = this[Ci]();
25922
- if (t2.length === 0) return process.nextTick(() => this[Ni](null, 0, t2));
25923
- fs.read(this[m], t2, 0, t2.length, null, (e, i2, r) => this[Ni](e, i2, r));
26007
+ if (!this[j2]) {
26008
+ this[j2] = true;
26009
+ let t2 = this[vi]();
26010
+ if (t2.length === 0) return process.nextTick(() => this[Ii](null, 0, t2));
26011
+ fs.read(this[u2], t2, 0, t2.length, null, (e, i2, r) => this[Ii](e, i2, r));
25924
26012
  }
25925
26013
  }
25926
- [Ni](t2, e, i2) {
25927
- this[Q2] = false, t2 ? this[Ut](t2) : this[Ii](e, i2) && this[zt]();
26014
+ [Ii](t2, e, i2) {
26015
+ this[j2] = false, t2 ? this[Ut](t2) : this[ki](e, i2) && this[zt]();
25928
26016
  }
25929
26017
  [H3]() {
25930
- if (this[ot2] && typeof this[m] == "number") {
25931
- let t2 = this[m];
25932
- this[m] = void 0, fs.close(t2, (e) => e ? this.emit("error", e) : this.emit("close"));
26018
+ if (this[ht3] && typeof this[u2] == "number") {
26019
+ let t2 = this[u2];
26020
+ this[u2] = void 0, fs.close(t2, (e) => e ? this.emit("error", e) : this.emit("close"));
25933
26021
  }
25934
26022
  }
25935
26023
  [Ut](t2) {
25936
- this[Q2] = true, this[H3](), this.emit("error", t2);
26024
+ this[j2] = true, this[H3](), this.emit("error", t2);
25937
26025
  }
25938
- [Ii](t2, e) {
26026
+ [ki](t2, e) {
25939
26027
  let i2 = false;
25940
- return this[ie2] -= t2, t2 > 0 && (i2 = super.write(t2 < e.length ? e.subarray(0, t2) : e)), (t2 === 0 || this[ie2] <= 0) && (i2 = false, this[H3](), super.end()), i2;
26028
+ return this[ee2] -= t2, t2 > 0 && (i2 = super.write(t2 < e.length ? e.subarray(0, t2) : e)), (t2 === 0 || this[ee2] <= 0) && (i2 = false, this[H3](), super.end()), i2;
25941
26029
  }
25942
26030
  emit(t2, ...e) {
25943
26031
  switch (t2) {
@@ -25945,7 +26033,7 @@ var _t2 = class extends D3 {
25945
26033
  case "finish":
25946
26034
  return false;
25947
26035
  case "drain":
25948
- return typeof this[m] == "number" && this[zt](), false;
26036
+ return typeof this[u2] == "number" && this[zt](), false;
25949
26037
  case "error":
25950
26038
  return this[bt3] ? false : (this[bt3] = true, super.emit(t2, ...e));
25951
26039
  default:
@@ -25953,8 +26041,8 @@ var _t2 = class extends D3 {
25953
26041
  }
25954
26042
  }
25955
26043
  };
25956
- var Me = class extends _t2 {
25957
- [ht3]() {
26044
+ var Be = class extends _t2 {
26045
+ [at2]() {
25958
26046
  let t2 = true;
25959
26047
  try {
25960
26048
  this[Ht](null, fs.openSync(this[U3], "r")), t2 = false;
@@ -25965,13 +26053,13 @@ var Me = class extends _t2 {
25965
26053
  [zt]() {
25966
26054
  let t2 = true;
25967
26055
  try {
25968
- if (!this[Q2]) {
25969
- this[Q2] = true;
26056
+ if (!this[j2]) {
26057
+ this[j2] = true;
25970
26058
  do {
25971
- let e = this[Ci](), i2 = e.length === 0 ? 0 : fs.readSync(this[m], e, 0, e.length, null);
25972
- if (!this[Ii](i2, e)) break;
26059
+ let e = this[vi](), i2 = e.length === 0 ? 0 : fs.readSync(this[u2], e, 0, e.length, null);
26060
+ if (!this[ki](i2, e)) break;
25973
26061
  } while (true);
25974
- this[Q2] = false;
26062
+ this[j2] = false;
25975
26063
  }
25976
26064
  t2 = false;
25977
26065
  } finally {
@@ -25979,32 +26067,32 @@ var Me = class extends _t2 {
25979
26067
  }
25980
26068
  }
25981
26069
  [H3]() {
25982
- if (this[ot2] && typeof this[m] == "number") {
25983
- let t2 = this[m];
25984
- this[m] = void 0, fs.closeSync(t2), this.emit("close");
26070
+ if (this[ht3] && typeof this[u2] == "number") {
26071
+ let t2 = this[u2];
26072
+ this[u2] = void 0, fs.closeSync(t2), this.emit("close");
25985
26073
  }
25986
26074
  }
25987
26075
  };
25988
- var tt2 = class extends Kr {
26076
+ var et2 = class extends Qr {
25989
26077
  readable = false;
25990
26078
  writable = true;
25991
26079
  [bt3] = false;
25992
- [Rt2] = false;
25993
- [ee2] = false;
26080
+ [gt3] = false;
26081
+ [te2] = false;
25994
26082
  [Y] = [];
25995
- [Fe2] = false;
26083
+ [ke2] = false;
25996
26084
  [U3];
25997
- [se2];
26085
+ [ie2];
26086
+ [ht3];
26087
+ [u2];
26088
+ [Me];
26089
+ [tt2];
26090
+ [Ni] = false;
25998
26091
  [ot2];
25999
- [m];
26000
- [ve2];
26001
- [J3];
26002
- [xi] = false;
26003
- [nt2];
26004
26092
  constructor(t2, e) {
26005
- e = e || {}, super(e), this[U3] = t2, this[m] = typeof e.fd == "number" ? e.fd : void 0, this[se2] = e.mode === void 0 ? 438 : e.mode, this[nt2] = typeof e.start == "number" ? e.start : void 0, this[ot2] = typeof e.autoClose == "boolean" ? e.autoClose : true;
26006
- let i2 = this[nt2] !== void 0 ? "r+" : "w";
26007
- this[ve2] = e.flags === void 0, this[J3] = e.flags === void 0 ? i2 : e.flags, this[m] === void 0 && this[ht3]();
26093
+ e = e || {}, super(e), this[U3] = t2, this[u2] = typeof e.fd == "number" ? e.fd : void 0, this[ie2] = e.mode === void 0 ? 438 : e.mode, this[ot2] = typeof e.start == "number" ? e.start : void 0, this[ht3] = typeof e.autoClose == "boolean" ? e.autoClose : true;
26094
+ let i2 = this[ot2] !== void 0 ? "r+" : "w";
26095
+ this[Me] = e.flags === void 0, this[tt2] = e.flags === void 0 ? i2 : e.flags, this[u2] === void 0 && this[at2]();
26008
26096
  }
26009
26097
  emit(t2, ...e) {
26010
26098
  if (t2 === "error") {
@@ -26014,69 +26102,69 @@ var tt2 = class extends Kr {
26014
26102
  return super.emit(t2, ...e);
26015
26103
  }
26016
26104
  get fd() {
26017
- return this[m];
26105
+ return this[u2];
26018
26106
  }
26019
26107
  get path() {
26020
26108
  return this[U3];
26021
26109
  }
26022
26110
  [Ut](t2) {
26023
- this[H3](), this[Rt2] = true, this.emit("error", t2);
26111
+ this[H3](), this[gt3] = true, this.emit("error", t2);
26024
26112
  }
26025
- [ht3]() {
26026
- fs.open(this[U3], this[J3], this[se2], (t2, e) => this[Ht](t2, e));
26113
+ [at2]() {
26114
+ fs.open(this[U3], this[tt2], this[ie2], (t2, e) => this[Ht](t2, e));
26027
26115
  }
26028
26116
  [Ht](t2, e) {
26029
- this[ve2] && this[J3] === "r+" && t2 && t2.code === "ENOENT" ? (this[J3] = "w", this[ht3]()) : t2 ? this[Ut](t2) : (this[m] = e, this.emit("open", e), this[Rt2] || this[Li]());
26117
+ this[Me] && this[tt2] === "r+" && t2 && t2.code === "ENOENT" ? (this[tt2] = "w", this[at2]()) : t2 ? this[Ut](t2) : (this[u2] = e, this.emit("open", e), this[gt3] || this[Ai]());
26030
26118
  }
26031
26119
  end(t2, e) {
26032
- return t2 && this.write(t2, e), this[ee2] = true, !this[Rt2] && !this[Y].length && typeof this[m] == "number" && this[Pt](null, 0), this;
26120
+ return t2 && this.write(t2, e), this[te2] = true, !this[gt3] && !this[Y].length && typeof this[u2] == "number" && this[Pt](null, 0), this;
26033
26121
  }
26034
26122
  write(t2, e) {
26035
- return typeof t2 == "string" && (t2 = Buffer.from(t2, e)), this[ee2] ? (this.emit("error", new Error("write() after end()")), false) : this[m] === void 0 || this[Rt2] || this[Y].length ? (this[Y].push(t2), this[Fe2] = true, false) : (this[Rt2] = true, this[ke2](t2), true);
26123
+ return typeof t2 == "string" && (t2 = Buffer.from(t2, e)), this[te2] ? (this.emit("error", new Error("write() after end()")), false) : this[u2] === void 0 || this[gt3] || this[Y].length ? (this[Y].push(t2), this[ke2] = true, false) : (this[gt3] = true, this[ve2](t2), true);
26036
26124
  }
26037
- [ke2](t2) {
26038
- fs.write(this[m], t2, 0, t2.length, this[nt2], (e, i2) => this[Pt](e, i2));
26125
+ [ve2](t2) {
26126
+ fs.write(this[u2], t2, 0, t2.length, this[ot2], (e, i2) => this[Pt](e, i2));
26039
26127
  }
26040
26128
  [Pt](t2, e) {
26041
- t2 ? this[Ut](t2) : (this[nt2] !== void 0 && typeof e == "number" && (this[nt2] += e), this[Y].length ? this[Li]() : (this[Rt2] = false, this[ee2] && !this[xi] ? (this[xi] = true, this[H3](), this.emit("finish")) : this[Fe2] && (this[Fe2] = false, this.emit("drain"))));
26129
+ t2 ? this[Ut](t2) : (this[ot2] !== void 0 && typeof e == "number" && (this[ot2] += e), this[Y].length ? this[Ai]() : (this[gt3] = false, this[te2] && !this[Ni] ? (this[Ni] = true, this[H3](), this.emit("finish")) : this[ke2] && (this[ke2] = false, this.emit("drain"))));
26042
26130
  }
26043
- [Li]() {
26044
- if (this[Y].length === 0) this[ee2] && this[Pt](null, 0);
26045
- else if (this[Y].length === 1) this[ke2](this[Y].pop());
26131
+ [Ai]() {
26132
+ if (this[Y].length === 0) this[te2] && this[Pt](null, 0);
26133
+ else if (this[Y].length === 1) this[ve2](this[Y].pop());
26046
26134
  else {
26047
26135
  let t2 = this[Y];
26048
- this[Y] = [], Vr(this[m], t2, this[nt2], (e, i2) => this[Pt](e, i2));
26136
+ this[Y] = [], Jr(this[u2], t2, this[ot2], (e, i2) => this[Pt](e, i2));
26049
26137
  }
26050
26138
  }
26051
26139
  [H3]() {
26052
- if (this[ot2] && typeof this[m] == "number") {
26053
- let t2 = this[m];
26054
- this[m] = void 0, fs.close(t2, (e) => e ? this.emit("error", e) : this.emit("close"));
26140
+ if (this[ht3] && typeof this[u2] == "number") {
26141
+ let t2 = this[u2];
26142
+ this[u2] = void 0, fs.close(t2, (e) => e ? this.emit("error", e) : this.emit("close"));
26055
26143
  }
26056
26144
  }
26057
26145
  };
26058
- var Wt3 = class extends tt2 {
26059
- [ht3]() {
26146
+ var Wt3 = class extends et2 {
26147
+ [at2]() {
26060
26148
  let t2;
26061
- if (this[ve2] && this[J3] === "r+") try {
26062
- t2 = fs.openSync(this[U3], this[J3], this[se2]);
26149
+ if (this[Me] && this[tt2] === "r+") try {
26150
+ t2 = fs.openSync(this[U3], this[tt2], this[ie2]);
26063
26151
  } catch (e) {
26064
- if (e?.code === "ENOENT") return this[J3] = "w", this[ht3]();
26152
+ if (e?.code === "ENOENT") return this[tt2] = "w", this[at2]();
26065
26153
  throw e;
26066
26154
  }
26067
- else t2 = fs.openSync(this[U3], this[J3], this[se2]);
26155
+ else t2 = fs.openSync(this[U3], this[tt2], this[ie2]);
26068
26156
  this[Ht](null, t2);
26069
26157
  }
26070
26158
  [H3]() {
26071
- if (this[ot2] && typeof this[m] == "number") {
26072
- let t2 = this[m];
26073
- this[m] = void 0, fs.closeSync(t2), this.emit("close");
26159
+ if (this[ht3] && typeof this[u2] == "number") {
26160
+ let t2 = this[u2];
26161
+ this[u2] = void 0, fs.closeSync(t2), this.emit("close");
26074
26162
  }
26075
26163
  }
26076
- [ke2](t2) {
26164
+ [ve2](t2) {
26077
26165
  let e = true;
26078
26166
  try {
26079
- this[Pt](null, fs.writeSync(this[m], t2, 0, t2.length, this[nt2])), e = false;
26167
+ this[Pt](null, fs.writeSync(this[u2], t2, 0, t2.length, this[ot2])), e = false;
26080
26168
  } finally {
26081
26169
  if (e) try {
26082
26170
  this[H3]();
@@ -26085,53 +26173,53 @@ var Wt3 = class extends tt2 {
26085
26173
  }
26086
26174
  }
26087
26175
  };
26088
- var $r = /* @__PURE__ */ new Map([["C", "cwd"], ["f", "file"], ["z", "gzip"], ["P", "preservePaths"], ["U", "unlink"], ["strip-components", "strip"], ["stripComponents", "strip"], ["keep-newer", "newer"], ["keepNewer", "newer"], ["keep-newer-files", "newer"], ["keepNewerFiles", "newer"], ["k", "keep"], ["keep-existing", "keep"], ["keepExisting", "keep"], ["m", "noMtime"], ["no-mtime", "noMtime"], ["p", "preserveOwner"], ["L", "follow"], ["h", "follow"], ["onentry", "onReadEntry"]]);
26089
- var As = (s3) => !!s3.sync && !!s3.file;
26090
- var Ds = (s3) => !s3.sync && !!s3.file;
26091
- var Is = (s3) => !!s3.sync && !s3.file;
26092
- var Cs = (s3) => !s3.sync && !s3.file;
26093
- var Fs = (s3) => !!s3.file;
26094
- var Xr = (s3) => {
26095
- let t2 = $r.get(s3);
26176
+ var jr = /* @__PURE__ */ new Map([["C", "cwd"], ["f", "file"], ["z", "gzip"], ["P", "preservePaths"], ["U", "unlink"], ["strip-components", "strip"], ["stripComponents", "strip"], ["keep-newer", "newer"], ["keepNewer", "newer"], ["keep-newer-files", "newer"], ["keepNewerFiles", "newer"], ["k", "keep"], ["keep-existing", "keep"], ["keepExisting", "keep"], ["m", "noMtime"], ["no-mtime", "noMtime"], ["p", "preserveOwner"], ["L", "follow"], ["h", "follow"], ["onentry", "onReadEntry"]]);
26177
+ var Fs = (s3) => !!s3.sync && !!s3.file;
26178
+ var ks = (s3) => !s3.sync && !!s3.file;
26179
+ var vs = (s3) => !!s3.sync && !s3.file;
26180
+ var Ms = (s3) => !s3.sync && !s3.file;
26181
+ var Bs = (s3) => !!s3.file;
26182
+ var tn = (s3) => {
26183
+ let t2 = jr.get(s3);
26096
26184
  return t2 || s3;
26097
26185
  };
26098
- var re2 = (s3 = {}) => {
26186
+ var se2 = (s3 = {}) => {
26099
26187
  if (!s3) return {};
26100
26188
  let t2 = {};
26101
26189
  for (let [e, i2] of Object.entries(s3)) {
26102
- let r = Xr(e);
26190
+ let r = tn(e);
26103
26191
  t2[r] = i2;
26104
26192
  }
26105
26193
  return t2.chmod === void 0 && t2.noChmod === false && (t2.chmod = true), delete t2.noChmod, t2;
26106
26194
  };
26107
26195
  var K2 = (s3, t2, e, i2, r) => Object.assign((n2 = [], o2, h3) => {
26108
26196
  Array.isArray(n2) && (o2 = n2, n2 = {}), typeof o2 == "function" && (h3 = o2, o2 = void 0), o2 = o2 ? Array.from(o2) : [];
26109
- let a2 = re2(n2);
26110
- if (r?.(a2, o2), As(a2)) {
26197
+ let a2 = se2(n2);
26198
+ if (r?.(a2, o2), Fs(a2)) {
26111
26199
  if (typeof h3 == "function") throw new TypeError("callback not supported for sync tar functions");
26112
26200
  return s3(a2, o2);
26113
- } else if (Ds(a2)) {
26201
+ } else if (ks(a2)) {
26114
26202
  let l = t2(a2, o2);
26115
26203
  return h3 ? l.then(() => h3(), h3) : l;
26116
- } else if (Is(a2)) {
26204
+ } else if (vs(a2)) {
26117
26205
  if (typeof h3 == "function") throw new TypeError("callback not supported for sync tar functions");
26118
26206
  return e(a2, o2);
26119
- } else if (Cs(a2)) {
26207
+ } else if (Ms(a2)) {
26120
26208
  if (typeof h3 == "function") throw new TypeError("callback only supported with file option");
26121
26209
  return i2(a2, o2);
26122
26210
  }
26123
26211
  throw new Error("impossible options??");
26124
26212
  }, { syncFile: s3, asyncFile: t2, syncNoFile: e, asyncNoFile: i2, validate: r });
26125
- var jr = ks__default.constants || { ZLIB_VERNUM: 4736 };
26126
- var M2 = Object.freeze(Object.assign(/* @__PURE__ */ Object.create(null), { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_MEM_ERROR: -4, Z_BUF_ERROR: -5, Z_VERSION_ERROR: -6, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, DEFLATE: 1, INFLATE: 2, GZIP: 3, GUNZIP: 4, DEFLATERAW: 5, INFLATERAW: 6, UNZIP: 7, BROTLI_DECODE: 8, BROTLI_ENCODE: 9, Z_MIN_WINDOWBITS: 8, Z_MAX_WINDOWBITS: 15, Z_DEFAULT_WINDOWBITS: 15, Z_MIN_CHUNK: 64, Z_MAX_CHUNK: 1 / 0, Z_DEFAULT_CHUNK: 16384, Z_MIN_MEMLEVEL: 1, Z_MAX_MEMLEVEL: 9, Z_DEFAULT_MEMLEVEL: 8, Z_MIN_LEVEL: -1, Z_MAX_LEVEL: 9, Z_DEFAULT_LEVEL: -1, BROTLI_OPERATION_PROCESS: 0, BROTLI_OPERATION_FLUSH: 1, BROTLI_OPERATION_FINISH: 2, BROTLI_OPERATION_EMIT_METADATA: 3, BROTLI_MODE_GENERIC: 0, BROTLI_MODE_TEXT: 1, BROTLI_MODE_FONT: 2, BROTLI_DEFAULT_MODE: 0, BROTLI_MIN_QUALITY: 0, BROTLI_MAX_QUALITY: 11, BROTLI_DEFAULT_QUALITY: 11, BROTLI_MIN_WINDOW_BITS: 10, BROTLI_MAX_WINDOW_BITS: 24, BROTLI_LARGE_MAX_WINDOW_BITS: 30, BROTLI_DEFAULT_WINDOW: 22, BROTLI_MIN_INPUT_BLOCK_BITS: 16, BROTLI_MAX_INPUT_BLOCK_BITS: 24, BROTLI_PARAM_MODE: 0, BROTLI_PARAM_QUALITY: 1, BROTLI_PARAM_LGWIN: 2, BROTLI_PARAM_LGBLOCK: 3, BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4, BROTLI_PARAM_SIZE_HINT: 5, BROTLI_PARAM_LARGE_WINDOW: 6, BROTLI_PARAM_NPOSTFIX: 7, BROTLI_PARAM_NDIRECT: 8, BROTLI_DECODER_RESULT_ERROR: 0, BROTLI_DECODER_RESULT_SUCCESS: 1, BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2, BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3, BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0, BROTLI_DECODER_PARAM_LARGE_WINDOW: 1, BROTLI_DECODER_NO_ERROR: 0, BROTLI_DECODER_SUCCESS: 1, BROTLI_DECODER_NEEDS_MORE_INPUT: 2, BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1, BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5, BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6, BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7, BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8, BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9, BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10, BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11, BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12, BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13, BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14, BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15, BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16, BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19, BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20, BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21, BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22, BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25, BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26, BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27, BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30, BROTLI_DECODER_ERROR_UNREACHABLE: -31 }, jr));
26127
- var Qr = Buffer$1.concat;
26128
- var vs = Object.getOwnPropertyDescriptor(Buffer$1, "concat");
26129
- var Jr = (s3) => s3;
26130
- var ki = vs?.writable === true || vs?.set !== void 0 ? (s3) => {
26131
- Buffer$1.concat = s3 ? Jr : Qr;
26213
+ var sn = Ps__default.constants || { ZLIB_VERNUM: 4736 };
26214
+ var M2 = Object.freeze(Object.assign(/* @__PURE__ */ Object.create(null), { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_MEM_ERROR: -4, Z_BUF_ERROR: -5, Z_VERSION_ERROR: -6, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, DEFLATE: 1, INFLATE: 2, GZIP: 3, GUNZIP: 4, DEFLATERAW: 5, INFLATERAW: 6, UNZIP: 7, BROTLI_DECODE: 8, BROTLI_ENCODE: 9, Z_MIN_WINDOWBITS: 8, Z_MAX_WINDOWBITS: 15, Z_DEFAULT_WINDOWBITS: 15, Z_MIN_CHUNK: 64, Z_MAX_CHUNK: 1 / 0, Z_DEFAULT_CHUNK: 16384, Z_MIN_MEMLEVEL: 1, Z_MAX_MEMLEVEL: 9, Z_DEFAULT_MEMLEVEL: 8, Z_MIN_LEVEL: -1, Z_MAX_LEVEL: 9, Z_DEFAULT_LEVEL: -1, BROTLI_OPERATION_PROCESS: 0, BROTLI_OPERATION_FLUSH: 1, BROTLI_OPERATION_FINISH: 2, BROTLI_OPERATION_EMIT_METADATA: 3, BROTLI_MODE_GENERIC: 0, BROTLI_MODE_TEXT: 1, BROTLI_MODE_FONT: 2, BROTLI_DEFAULT_MODE: 0, BROTLI_MIN_QUALITY: 0, BROTLI_MAX_QUALITY: 11, BROTLI_DEFAULT_QUALITY: 11, BROTLI_MIN_WINDOW_BITS: 10, BROTLI_MAX_WINDOW_BITS: 24, BROTLI_LARGE_MAX_WINDOW_BITS: 30, BROTLI_DEFAULT_WINDOW: 22, BROTLI_MIN_INPUT_BLOCK_BITS: 16, BROTLI_MAX_INPUT_BLOCK_BITS: 24, BROTLI_PARAM_MODE: 0, BROTLI_PARAM_QUALITY: 1, BROTLI_PARAM_LGWIN: 2, BROTLI_PARAM_LGBLOCK: 3, BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING: 4, BROTLI_PARAM_SIZE_HINT: 5, BROTLI_PARAM_LARGE_WINDOW: 6, BROTLI_PARAM_NPOSTFIX: 7, BROTLI_PARAM_NDIRECT: 8, BROTLI_DECODER_RESULT_ERROR: 0, BROTLI_DECODER_RESULT_SUCCESS: 1, BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT: 2, BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT: 3, BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION: 0, BROTLI_DECODER_PARAM_LARGE_WINDOW: 1, BROTLI_DECODER_NO_ERROR: 0, BROTLI_DECODER_SUCCESS: 1, BROTLI_DECODER_NEEDS_MORE_INPUT: 2, BROTLI_DECODER_NEEDS_MORE_OUTPUT: 3, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE: -1, BROTLI_DECODER_ERROR_FORMAT_RESERVED: -2, BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE: -3, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET: -4, BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME: -5, BROTLI_DECODER_ERROR_FORMAT_CL_SPACE: -6, BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE: -7, BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT: -8, BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1: -9, BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2: -10, BROTLI_DECODER_ERROR_FORMAT_TRANSFORM: -11, BROTLI_DECODER_ERROR_FORMAT_DICTIONARY: -12, BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS: -13, BROTLI_DECODER_ERROR_FORMAT_PADDING_1: -14, BROTLI_DECODER_ERROR_FORMAT_PADDING_2: -15, BROTLI_DECODER_ERROR_FORMAT_DISTANCE: -16, BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET: -19, BROTLI_DECODER_ERROR_INVALID_ARGUMENTS: -20, BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES: -21, BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS: -22, BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP: -25, BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1: -26, BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2: -27, BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES: -30, BROTLI_DECODER_ERROR_UNREACHABLE: -31 }, sn));
26215
+ var rn = Buffer$1.concat;
26216
+ var zs = Object.getOwnPropertyDescriptor(Buffer$1, "concat");
26217
+ var nn = (s3) => s3;
26218
+ var Bi = zs?.writable === true || zs?.set !== void 0 ? (s3) => {
26219
+ Buffer$1.concat = s3 ? nn : rn;
26132
26220
  } : (s3) => {
26133
26221
  };
26134
- var Ot = Symbol("_superWrite");
26222
+ var Tt2 = Symbol("_superWrite");
26135
26223
  var Gt2 = class extends Error {
26136
26224
  code;
26137
26225
  errno;
@@ -26142,8 +26230,8 @@ var Gt2 = class extends Error {
26142
26230
  return "ZlibError";
26143
26231
  }
26144
26232
  };
26145
- var vi = Symbol("flushFlag");
26146
- var ne2 = class extends D3 {
26233
+ var Pi = Symbol("flushFlag");
26234
+ var re2 = class extends A {
26147
26235
  #t = false;
26148
26236
  #i = false;
26149
26237
  #s;
@@ -26162,9 +26250,9 @@ var ne2 = class extends D3 {
26162
26250
  }
26163
26251
  constructor(t2, e) {
26164
26252
  if (!t2 || typeof t2 != "object") throw new TypeError("invalid options for ZlibBase constructor");
26165
- if (super(t2), this.#s = t2.flush ?? 0, this.#n = t2.finishFlush ?? 0, this.#r = t2.fullFlushFlag ?? 0, typeof ks[e] != "function") throw new TypeError("Compression method not supported: " + e);
26253
+ if (super(t2), this.#s = t2.flush ?? 0, this.#n = t2.finishFlush ?? 0, this.#r = t2.fullFlushFlag ?? 0, typeof Ps[e] != "function") throw new TypeError("Compression method not supported: " + e);
26166
26254
  try {
26167
- this.#e = new ks[e](t2);
26255
+ this.#e = new Ps[e](t2);
26168
26256
  } catch (i2) {
26169
26257
  throw new Gt2(i2, this.constructor);
26170
26258
  }
@@ -26176,10 +26264,10 @@ var ne2 = class extends D3 {
26176
26264
  this.#e && (this.#e.close(), this.#e = void 0, this.emit("close"));
26177
26265
  }
26178
26266
  reset() {
26179
- if (!this.#t) return Mi(this.#e, "zlib binding closed"), this.#e.reset?.();
26267
+ if (!this.#t) return zi(this.#e, "zlib binding closed"), this.#e.reset?.();
26180
26268
  }
26181
26269
  flush(t2) {
26182
- this.ended || (typeof t2 != "number" && (t2 = this.#r), this.write(Object.assign(Buffer$1.alloc(0), { [vi]: t2 })));
26270
+ this.ended || (typeof t2 != "number" && (t2 = this.#r), this.write(Object.assign(Buffer$1.alloc(0), { [Pi]: t2 })));
26183
26271
  }
26184
26272
  end(t2, e, i2) {
26185
26273
  return typeof t2 == "function" && (i2 = t2, e = void 0, t2 = void 0), typeof e == "function" && (i2 = e, e = void 0), t2 && (e ? this.write(t2, e) : this.write(t2)), this.flush(this.#n), this.#i = true, super.end(i2);
@@ -26187,24 +26275,24 @@ var ne2 = class extends D3 {
26187
26275
  get ended() {
26188
26276
  return this.#i;
26189
26277
  }
26190
- [Ot](t2) {
26278
+ [Tt2](t2) {
26191
26279
  return super.write(t2);
26192
26280
  }
26193
26281
  write(t2, e, i2) {
26194
26282
  if (typeof e == "function" && (i2 = e, e = "utf8"), typeof t2 == "string" && (t2 = Buffer$1.from(t2, e)), this.#t) return;
26195
- Mi(this.#e, "zlib binding closed");
26283
+ zi(this.#e, "zlib binding closed");
26196
26284
  let r = this.#e._handle, n2 = r.close;
26197
26285
  r.close = () => {
26198
26286
  };
26199
26287
  let o2 = this.#e.close;
26200
26288
  this.#e.close = () => {
26201
- }, ki(true);
26289
+ }, Bi(true);
26202
26290
  let h3;
26203
26291
  try {
26204
- let l = typeof t2[vi] == "number" ? t2[vi] : this.#s;
26205
- h3 = this.#e._processChunk(t2, l), ki(false);
26292
+ let l = typeof t2[Pi] == "number" ? t2[Pi] : this.#s;
26293
+ h3 = this.#e._processChunk(t2, l), Bi(false);
26206
26294
  } catch (l) {
26207
- ki(false), this.#o(new Gt2(l, this.write));
26295
+ Bi(false), this.#o(new Gt2(l, this.write));
26208
26296
  } finally {
26209
26297
  this.#e && (this.#e._handle = r, r.close = n2, this.#e.close = o2, this.#e.removeAllListeners("error"));
26210
26298
  }
@@ -26212,13 +26300,13 @@ var ne2 = class extends D3 {
26212
26300
  let a2;
26213
26301
  if (h3) if (Array.isArray(h3) && h3.length > 0) {
26214
26302
  let l = h3[0];
26215
- a2 = this[Ot](Buffer$1.from(l));
26216
- for (let c3 = 1; c3 < h3.length; c3++) a2 = this[Ot](h3[c3]);
26217
- } else a2 = this[Ot](Buffer$1.from(h3));
26303
+ a2 = this[Tt2](Buffer$1.from(l));
26304
+ for (let c3 = 1; c3 < h3.length; c3++) a2 = this[Tt2](h3[c3]);
26305
+ } else a2 = this[Tt2](Buffer$1.from(h3));
26218
26306
  return i2 && i2(), a2;
26219
26307
  }
26220
26308
  };
26221
- var Be = class extends ne2 {
26309
+ var Pe2 = class extends re2 {
26222
26310
  #t;
26223
26311
  #i;
26224
26312
  constructor(t2, e) {
@@ -26229,7 +26317,7 @@ var Be = class extends ne2 {
26229
26317
  if (!this.handle) throw new Error("cannot switch params when binding is closed");
26230
26318
  if (!this.handle.params) throw new Error("not supported in this implementation");
26231
26319
  if (this.#t !== t2 || this.#i !== e) {
26232
- this.flush(M2.Z_SYNC_FLUSH), Mi(this.handle, "zlib binding closed");
26320
+ this.flush(M2.Z_SYNC_FLUSH), zi(this.handle, "zlib binding closed");
26233
26321
  let i2 = this.handle.flush;
26234
26322
  this.handle.flush = (r, n2) => {
26235
26323
  typeof r == "function" && (n2 = r, r = this.flushFlag), this.flush(r), n2?.();
@@ -26244,96 +26332,98 @@ var Be = class extends ne2 {
26244
26332
  }
26245
26333
  }
26246
26334
  };
26247
- var Pe2 = class extends Be {
26335
+ var ze2 = class extends Pe2 {
26248
26336
  #t;
26249
26337
  constructor(t2) {
26250
26338
  super(t2, "Gzip"), this.#t = t2 && !!t2.portable;
26251
26339
  }
26252
- [Ot](t2) {
26253
- return this.#t ? (this.#t = false, t2[9] = 255, super[Ot](t2)) : super[Ot](t2);
26340
+ [Tt2](t2) {
26341
+ return this.#t ? (this.#t = false, t2[9] = 255, super[Tt2](t2)) : super[Tt2](t2);
26254
26342
  }
26255
26343
  };
26256
- var ze2 = class extends Be {
26344
+ var Ue2 = class extends Pe2 {
26257
26345
  constructor(t2) {
26258
26346
  super(t2, "Unzip");
26259
26347
  }
26260
26348
  };
26261
- var Ue2 = class extends ne2 {
26349
+ var He2 = class extends re2 {
26262
26350
  constructor(t2, e) {
26263
26351
  t2 = t2 || {}, t2.flush = t2.flush || M2.BROTLI_OPERATION_PROCESS, t2.finishFlush = t2.finishFlush || M2.BROTLI_OPERATION_FINISH, t2.fullFlushFlag = M2.BROTLI_OPERATION_FLUSH, super(t2, e);
26264
26352
  }
26265
26353
  };
26266
- var He2 = class extends Ue2 {
26354
+ var We2 = class extends He2 {
26267
26355
  constructor(t2) {
26268
26356
  super(t2, "BrotliCompress");
26269
26357
  }
26270
26358
  };
26271
- var We2 = class extends Ue2 {
26359
+ var Ge2 = class extends He2 {
26272
26360
  constructor(t2) {
26273
26361
  super(t2, "BrotliDecompress");
26274
26362
  }
26275
26363
  };
26276
- var Ge2 = class extends ne2 {
26364
+ var Ze = class extends re2 {
26277
26365
  constructor(t2, e) {
26278
26366
  t2 = t2 || {}, t2.flush = t2.flush || M2.ZSTD_e_continue, t2.finishFlush = t2.finishFlush || M2.ZSTD_e_end, t2.fullFlushFlag = M2.ZSTD_e_flush, super(t2, e);
26279
26367
  }
26280
26368
  };
26281
- var Ze = class extends Ge2 {
26369
+ var Ye = class extends Ze {
26282
26370
  constructor(t2) {
26283
26371
  super(t2, "ZstdCompress");
26284
26372
  }
26285
26373
  };
26286
- var Ye = class extends Ge2 {
26374
+ var Ke2 = class extends Ze {
26287
26375
  constructor(t2) {
26288
26376
  super(t2, "ZstdDecompress");
26289
26377
  }
26290
26378
  };
26291
- var Ms = (s3, t2) => {
26292
- if (Number.isSafeInteger(s3)) s3 < 0 ? sn(s3, t2) : en(s3, t2);
26379
+ var Us = (s3, t2) => {
26380
+ if (Number.isSafeInteger(s3)) s3 < 0 ? an(s3, t2) : hn(s3, t2);
26293
26381
  else throw Error("cannot encode number outside of javascript safe integer range");
26294
26382
  return t2;
26295
26383
  };
26296
- var en = (s3, t2) => {
26384
+ var hn = (s3, t2) => {
26297
26385
  t2[0] = 128;
26298
26386
  for (var e = t2.length; e > 1; e--) t2[e - 1] = s3 & 255, s3 = Math.floor(s3 / 256);
26299
26387
  };
26300
- var sn = (s3, t2) => {
26388
+ var an = (s3, t2) => {
26301
26389
  t2[0] = 255;
26302
26390
  var e = false;
26303
26391
  s3 = s3 * -1;
26304
26392
  for (var i2 = t2.length; i2 > 1; i2--) {
26305
26393
  var r = s3 & 255;
26306
- s3 = Math.floor(s3 / 256), e ? t2[i2 - 1] = Ps(r) : r === 0 ? t2[i2 - 1] = 0 : (e = true, t2[i2 - 1] = zs(r));
26394
+ s3 = Math.floor(s3 / 256), e ? t2[i2 - 1] = Ws(r) : r === 0 ? t2[i2 - 1] = 0 : (e = true, t2[i2 - 1] = Gs(r));
26307
26395
  }
26308
26396
  };
26309
- var Bs = (s3) => {
26310
- let t2 = s3[0], e = t2 === 128 ? nn(s3.subarray(1, s3.length)) : t2 === 255 ? rn(s3) : null;
26397
+ var Hs = (s3) => {
26398
+ let t2 = s3[0], e = t2 === 128 ? cn(s3.subarray(1, s3.length)) : t2 === 255 ? ln(s3) : null;
26311
26399
  if (e === null) throw Error("invalid base256 encoding");
26312
26400
  if (!Number.isSafeInteger(e)) throw Error("parsed number outside of javascript safe integer range");
26313
26401
  return e;
26314
26402
  };
26315
- var rn = (s3) => {
26403
+ var ln = (s3) => {
26316
26404
  for (var t2 = s3.length, e = 0, i2 = false, r = t2 - 1; r > -1; r--) {
26317
26405
  var n2 = Number(s3[r]), o2;
26318
- i2 ? o2 = Ps(n2) : n2 === 0 ? o2 = n2 : (i2 = true, o2 = zs(n2)), o2 !== 0 && (e -= o2 * Math.pow(256, t2 - r - 1));
26406
+ i2 ? o2 = Ws(n2) : n2 === 0 ? o2 = n2 : (i2 = true, o2 = Gs(n2)), o2 !== 0 && (e -= o2 * Math.pow(256, t2 - r - 1));
26319
26407
  }
26320
26408
  return e;
26321
26409
  };
26322
- var nn = (s3) => {
26410
+ var cn = (s3) => {
26323
26411
  for (var t2 = s3.length, e = 0, i2 = t2 - 1; i2 > -1; i2--) {
26324
26412
  var r = Number(s3[i2]);
26325
26413
  r !== 0 && (e += r * Math.pow(256, t2 - i2 - 1));
26326
26414
  }
26327
26415
  return e;
26328
26416
  };
26329
- var Ps = (s3) => (255 ^ s3) & 255;
26330
- var zs = (s3) => (255 ^ s3) + 1 & 255;
26331
- var Bi = {};
26332
- vr(Bi, { code: () => Ke2, isCode: () => oe2, isName: () => hn, name: () => he2 });
26333
- var oe2 = (s3) => he2.has(s3);
26334
- var hn = (s3) => Ke2.has(s3);
26335
- var he2 = /* @__PURE__ */ new Map([["0", "File"], ["", "OldFile"], ["1", "Link"], ["2", "SymbolicLink"], ["3", "CharacterDevice"], ["4", "BlockDevice"], ["5", "Directory"], ["6", "FIFO"], ["7", "ContiguousFile"], ["g", "GlobalExtendedHeader"], ["x", "ExtendedHeader"], ["A", "SolarisACL"], ["D", "GNUDumpDir"], ["I", "Inode"], ["K", "NextFileHasLongLinkpath"], ["L", "NextFileHasLongPath"], ["M", "ContinuationFile"], ["N", "OldGnuLongPath"], ["S", "SparseFile"], ["V", "TapeVolumeHeader"], ["X", "OldExtendedHeader"]]);
26336
- var Ke2 = new Map(Array.from(he2).map((s3) => [s3[1], s3[0]]));
26417
+ var Ws = (s3) => (255 ^ s3) & 255;
26418
+ var Gs = (s3) => (255 ^ s3) + 1 & 255;
26419
+ var Hi = {};
26420
+ Ur(Hi, { code: () => Ve2, isCode: () => ne2, isName: () => dn, name: () => oe2, normalFsTypes: () => Ui });
26421
+ var ne2 = (s3) => oe2.has(s3);
26422
+ var dn = (s3) => Ve2.has(s3);
26423
+ var Ui = /* @__PURE__ */ new Set(["0", "", "1", "2", "3", "4", "5", "6", "7", "D"]);
26424
+ var oe2 = /* @__PURE__ */ new Map([["0", "File"], ["", "OldFile"], ["1", "Link"], ["2", "SymbolicLink"], ["3", "CharacterDevice"], ["4", "BlockDevice"], ["5", "Directory"], ["6", "FIFO"], ["7", "ContiguousFile"], ["g", "GlobalExtendedHeader"], ["x", "ExtendedHeader"], ["A", "SolarisACL"], ["D", "GNUDumpDir"], ["I", "Inode"], ["K", "NextFileHasLongLinkpath"], ["L", "NextFileHasLongPath"], ["M", "ContinuationFile"], ["N", "OldGnuLongPath"], ["S", "SparseFile"], ["V", "TapeVolumeHeader"], ["X", "OldExtendedHeader"]]);
26425
+ var Ve2 = new Map(Array.from(oe2).map((s3) => [s3[1], s3[0]]));
26426
+ var mn = (s3) => s3 === void 0 || s3 < 0 ? void 0 : s3;
26337
26427
  var F = class {
26338
26428
  cksumValid = false;
26339
26429
  needPax = false;
@@ -26361,46 +26451,45 @@ var F = class {
26361
26451
  }
26362
26452
  decode(t2, e, i2, r) {
26363
26453
  if (e || (e = 0), !t2 || !(t2.length >= e + 512)) throw new Error("need 512 bytes for header");
26364
- this.path = i2?.path ?? Tt2(t2, e, 100), this.mode = i2?.mode ?? r?.mode ?? at2(t2, e + 100, 8), this.uid = i2?.uid ?? r?.uid ?? at2(t2, e + 108, 8), this.gid = i2?.gid ?? r?.gid ?? at2(t2, e + 116, 8), this.size = i2?.size ?? r?.size ?? at2(t2, e + 124, 12), this.mtime = i2?.mtime ?? r?.mtime ?? Pi(t2, e + 136, 12), this.cksum = at2(t2, e + 148, 12), r && this.#i(r, true), i2 && this.#i(i2);
26365
- let n2 = Tt2(t2, e + 156, 1);
26366
- if (oe2(n2) && (this.#t = n2 || "0"), this.#t === "0" && this.path.slice(-1) === "/" && (this.#t = "5"), this.#t === "5" && (this.size = 0), this.linkpath = Tt2(t2, e + 157, 100), t2.subarray(e + 257, e + 265).toString() === "ustar\x0000") if (this.uname = i2?.uname ?? r?.uname ?? Tt2(t2, e + 265, 32), this.gname = i2?.gname ?? r?.gname ?? Tt2(t2, e + 297, 32), this.devmaj = i2?.devmaj ?? r?.devmaj ?? at2(t2, e + 329, 8) ?? 0, this.devmin = i2?.devmin ?? r?.devmin ?? at2(t2, e + 337, 8) ?? 0, t2[e + 475] !== 0) {
26367
- let h3 = Tt2(t2, e + 345, 155);
26368
- this.path = h3 + "/" + this.path;
26454
+ let n2 = xt2(t2, e + 156, 1), o2 = Ui.has(n2), h3 = o2 ? i2 : void 0, a2 = o2 ? r : void 0;
26455
+ if (this.path = h3?.path ?? xt2(t2, e, 100), this.mode = h3?.mode ?? a2?.mode ?? lt2(t2, e + 100, 8), this.uid = h3?.uid ?? a2?.uid ?? lt2(t2, e + 108, 8), this.gid = h3?.gid ?? a2?.gid ?? lt2(t2, e + 116, 8), this.size = mn(h3?.size ?? a2?.size ?? lt2(t2, e + 124, 12)), this.mtime = h3?.mtime ?? a2?.mtime ?? Wi(t2, e + 136, 12), this.cksum = lt2(t2, e + 148, 12), a2 && this.#i(a2, true), h3 && this.#i(h3), ne2(n2) && (this.#t = n2 || "0"), this.#t === "0" && this.path.slice(-1) === "/" && (this.#t = "5"), this.#t === "5" && (this.size = 0), this.linkpath = xt2(t2, e + 157, 100), t2.subarray(e + 257, e + 265).toString() === "ustar\x0000") if (this.uname = h3?.uname ?? a2?.uname ?? xt2(t2, e + 265, 32), this.gname = h3?.gname ?? a2?.gname ?? xt2(t2, e + 297, 32), this.devmaj = h3?.devmaj ?? a2?.devmaj ?? lt2(t2, e + 329, 8) ?? 0, this.devmin = h3?.devmin ?? a2?.devmin ?? lt2(t2, e + 337, 8) ?? 0, t2[e + 475] !== 0) {
26456
+ let c3 = xt2(t2, e + 345, 155);
26457
+ this.path = c3 + "/" + this.path;
26369
26458
  } else {
26370
- let h3 = Tt2(t2, e + 345, 130);
26371
- h3 && (this.path = h3 + "/" + this.path), this.atime = i2?.atime ?? r?.atime ?? Pi(t2, e + 476, 12), this.ctime = i2?.ctime ?? r?.ctime ?? Pi(t2, e + 488, 12);
26459
+ let c3 = xt2(t2, e + 345, 130);
26460
+ c3 && (this.path = c3 + "/" + this.path), this.atime = i2?.atime ?? r?.atime ?? Wi(t2, e + 476, 12), this.ctime = i2?.ctime ?? r?.ctime ?? Wi(t2, e + 488, 12);
26372
26461
  }
26373
- let o2 = 256;
26374
- for (let h3 = e; h3 < e + 148; h3++) o2 += t2[h3];
26375
- for (let h3 = e + 156; h3 < e + 512; h3++) o2 += t2[h3];
26376
- this.cksumValid = o2 === this.cksum, this.cksum === void 0 && o2 === 256 && (this.nullBlock = true);
26462
+ let l = 256;
26463
+ for (let c3 = e; c3 < e + 148; c3++) l += t2[c3];
26464
+ for (let c3 = e + 156; c3 < e + 512; c3++) l += t2[c3];
26465
+ this.cksumValid = l === this.cksum, this.cksum === void 0 && l === 256 && (this.nullBlock = true);
26377
26466
  }
26378
26467
  #i(t2, e = false) {
26379
- Object.assign(this, Object.fromEntries(Object.entries(t2).filter(([i2, r]) => !(r == null || i2 === "path" && e || i2 === "linkpath" && e || i2 === "global"))));
26468
+ Object.assign(this, Object.fromEntries(Object.entries(t2).filter(([i2, r]) => !(r == null || i2 === "size" && Number(r) < 0 || i2 === "path" && e || i2 === "linkpath" && e || i2 === "global"))));
26380
26469
  }
26381
26470
  encode(t2, e = 0) {
26382
26471
  if (t2 || (t2 = this.block = Buffer.alloc(512)), this.#t === "Unsupported" && (this.#t = "0"), !(t2.length >= e + 512)) throw new Error("need 512 bytes for header");
26383
- let i2 = this.ctime || this.atime ? 130 : 155, r = an(this.path || "", i2), n2 = r[0], o2 = r[1];
26384
- this.needPax = !!r[2], this.needPax = xt2(t2, e, 100, n2) || this.needPax, this.needPax = lt2(t2, e + 100, 8, this.mode) || this.needPax, this.needPax = lt2(t2, e + 108, 8, this.uid) || this.needPax, this.needPax = lt2(t2, e + 116, 8, this.gid) || this.needPax, this.needPax = lt2(t2, e + 124, 12, this.size) || this.needPax, this.needPax = zi(t2, e + 136, 12, this.mtime) || this.needPax, t2[e + 156] = Number(this.#t.codePointAt(0)), this.needPax = xt2(t2, e + 157, 100, this.linkpath) || this.needPax, t2.write("ustar\x0000", e + 257, 8), this.needPax = xt2(t2, e + 265, 32, this.uname) || this.needPax, this.needPax = xt2(t2, e + 297, 32, this.gname) || this.needPax, this.needPax = lt2(t2, e + 329, 8, this.devmaj) || this.needPax, this.needPax = lt2(t2, e + 337, 8, this.devmin) || this.needPax, this.needPax = xt2(t2, e + 345, i2, o2) || this.needPax, t2[e + 475] !== 0 ? this.needPax = xt2(t2, e + 345, 155, o2) || this.needPax : (this.needPax = xt2(t2, e + 345, 130, o2) || this.needPax, this.needPax = zi(t2, e + 476, 12, this.atime) || this.needPax, this.needPax = zi(t2, e + 488, 12, this.ctime) || this.needPax);
26472
+ let i2 = this.ctime || this.atime ? 130 : 155, r = un(this.path || "", i2), n2 = r[0], o2 = r[1];
26473
+ this.needPax = !!r[2], this.needPax = Lt2(t2, e, 100, n2) || this.needPax, this.needPax = ct2(t2, e + 100, 8, this.mode) || this.needPax, this.needPax = ct2(t2, e + 108, 8, this.uid) || this.needPax, this.needPax = ct2(t2, e + 116, 8, this.gid) || this.needPax, this.needPax = ct2(t2, e + 124, 12, this.size) || this.needPax, this.needPax = Gi(t2, e + 136, 12, this.mtime) || this.needPax, t2[e + 156] = Number(this.#t.codePointAt(0)), this.needPax = Lt2(t2, e + 157, 100, this.linkpath) || this.needPax, t2.write("ustar\x0000", e + 257, 8), this.needPax = Lt2(t2, e + 265, 32, this.uname) || this.needPax, this.needPax = Lt2(t2, e + 297, 32, this.gname) || this.needPax, this.needPax = ct2(t2, e + 329, 8, this.devmaj) || this.needPax, this.needPax = ct2(t2, e + 337, 8, this.devmin) || this.needPax, this.needPax = Lt2(t2, e + 345, i2, o2) || this.needPax, t2[e + 475] !== 0 ? this.needPax = Lt2(t2, e + 345, 155, o2) || this.needPax : (this.needPax = Lt2(t2, e + 345, 130, o2) || this.needPax, this.needPax = Gi(t2, e + 476, 12, this.atime) || this.needPax, this.needPax = Gi(t2, e + 488, 12, this.ctime) || this.needPax);
26385
26474
  let h3 = 256;
26386
26475
  for (let a2 = e; a2 < e + 148; a2++) h3 += t2[a2];
26387
26476
  for (let a2 = e + 156; a2 < e + 512; a2++) h3 += t2[a2];
26388
- return this.cksum = h3, lt2(t2, e + 148, 8, this.cksum), this.cksumValid = true, this.needPax;
26477
+ return this.cksum = h3, ct2(t2, e + 148, 8, this.cksum), this.cksumValid = true, this.needPax;
26389
26478
  }
26390
26479
  get type() {
26391
- return this.#t === "Unsupported" ? this.#t : he2.get(this.#t);
26480
+ return this.#t === "Unsupported" ? this.#t : oe2.get(this.#t);
26392
26481
  }
26393
26482
  get typeKey() {
26394
26483
  return this.#t;
26395
26484
  }
26396
26485
  set type(t2) {
26397
- let e = String(Ke2.get(t2));
26398
- if (oe2(e) || e === "Unsupported") this.#t = e;
26399
- else if (oe2(t2)) this.#t = t2;
26486
+ let e = String(Ve2.get(t2));
26487
+ if (ne2(e) || e === "Unsupported") this.#t = e;
26488
+ else if (ne2(t2)) this.#t = t2;
26400
26489
  else throw new TypeError("invalid entry type: " + t2);
26401
26490
  }
26402
26491
  };
26403
- var an = (s3, t2) => {
26492
+ var un = (s3, t2) => {
26404
26493
  let i2 = s3, r = "", n2, o2 = posix.parse(s3).root || ".";
26405
26494
  if (Buffer.byteLength(i2) < 100) n2 = [i2, r, false];
26406
26495
  else {
@@ -26412,21 +26501,21 @@ var an = (s3, t2) => {
26412
26501
  }
26413
26502
  return n2;
26414
26503
  };
26415
- var Tt2 = (s3, t2, e) => s3.subarray(t2, t2 + e).toString("utf8").replace(/\0.*/, "");
26416
- var Pi = (s3, t2, e) => ln(at2(s3, t2, e));
26417
- var ln = (s3) => s3 === void 0 ? void 0 : new Date(s3 * 1e3);
26418
- var at2 = (s3, t2, e) => Number(s3[t2]) & 128 ? Bs(s3.subarray(t2, t2 + e)) : fn(s3, t2, e);
26419
- var cn = (s3) => isNaN(s3) ? void 0 : s3;
26420
- var fn = (s3, t2, e) => cn(parseInt(s3.subarray(t2, t2 + e).toString("utf8").replace(/\0.*$/, "").trim(), 8));
26421
- var dn = { 12: 8589934591, 8: 2097151 };
26422
- var lt2 = (s3, t2, e, i2) => i2 === void 0 ? false : i2 > dn[e] || i2 < 0 ? (Ms(i2, s3.subarray(t2, t2 + e)), true) : (un(s3, t2, e, i2), false);
26423
- var un = (s3, t2, e, i2) => s3.write(mn(i2, e), t2, e, "ascii");
26424
- var mn = (s3, t2) => pn(Math.floor(s3).toString(8), t2);
26425
- var pn = (s3, t2) => (s3.length === t2 - 1 ? s3 : new Array(t2 - s3.length - 1).join("0") + s3 + " ") + "\0";
26426
- var zi = (s3, t2, e, i2) => i2 === void 0 ? false : lt2(s3, t2, e, i2.getTime() / 1e3);
26427
- var En = new Array(156).join("\0");
26428
- var xt2 = (s3, t2, e, i2) => i2 === void 0 ? false : (s3.write(i2 + En, t2, e, "utf8"), i2.length !== Buffer.byteLength(i2) || i2.length > e);
26429
- var ct2 = class s {
26504
+ var xt2 = (s3, t2, e) => s3.subarray(t2, t2 + e).toString("utf8").replace(/\0.*/, "");
26505
+ var Wi = (s3, t2, e) => pn(lt2(s3, t2, e));
26506
+ var pn = (s3) => s3 === void 0 ? void 0 : new Date(s3 * 1e3);
26507
+ var lt2 = (s3, t2, e) => Number(s3[t2]) & 128 ? Hs(s3.subarray(t2, t2 + e)) : wn(s3, t2, e);
26508
+ var En = (s3) => isNaN(s3) ? void 0 : s3;
26509
+ var wn = (s3, t2, e) => En(parseInt(s3.subarray(t2, t2 + e).toString("utf8").replace(/\0.*$/, "").trim(), 8));
26510
+ var Sn = { 12: 8589934591, 8: 2097151 };
26511
+ var ct2 = (s3, t2, e, i2) => i2 === void 0 ? false : i2 > Sn[e] || i2 < 0 ? (Us(i2, s3.subarray(t2, t2 + e)), true) : (yn(s3, t2, e, i2), false);
26512
+ var yn = (s3, t2, e, i2) => s3.write(Rn(i2, e), t2, e, "ascii");
26513
+ var Rn = (s3, t2) => gn(Math.floor(s3).toString(8), t2);
26514
+ var gn = (s3, t2) => (s3.length === t2 - 1 ? s3 : new Array(t2 - s3.length - 1).join("0") + s3 + " ") + "\0";
26515
+ var Gi = (s3, t2, e, i2) => i2 === void 0 ? false : ct2(s3, t2, e, i2.getTime() / 1e3);
26516
+ var bn = new Array(156).join("\0");
26517
+ var Lt2 = (s3, t2, e, i2) => i2 === void 0 ? false : (s3.write(i2 + bn, t2, e, "utf8"), i2.length !== Buffer.byteLength(i2) || i2.length > e);
26518
+ var ft3 = class s {
26430
26519
  atime;
26431
26520
  mtime;
26432
26521
  ctime;
@@ -26466,24 +26555,52 @@ var ct2 = class s {
26466
26555
  return n2 + o2 >= Math.pow(10, o2) && (o2 += 1), o2 + n2 + r;
26467
26556
  }
26468
26557
  static parse(t2, e, i2 = false) {
26469
- return new s(Sn(yn(t2), e), i2);
26558
+ return new s(On(Tn(t2), e), i2);
26470
26559
  }
26471
26560
  };
26472
- var Sn = (s3, t2) => t2 ? Object.assign({}, t2, s3) : s3;
26473
- var yn = (s3) => s3.replace(/\n$/, "").split(`
26474
- `).reduce(Rn, /* @__PURE__ */ Object.create(null));
26475
- var Rn = (s3, t2) => {
26561
+ var On = (s3, t2) => t2 ? Object.assign({}, t2, s3) : s3;
26562
+ var Tn = (s3) => s3.replace(/\n$/, "").split(`
26563
+ `).reduce(xn, /* @__PURE__ */ Object.create(null));
26564
+ var xn = (s3, t2) => {
26476
26565
  let e = parseInt(t2, 10);
26477
26566
  if (e !== Buffer.byteLength(t2) + 1) return s3;
26478
26567
  t2 = t2.slice((e + " ").length);
26479
26568
  let i2 = t2.split("="), r = i2.shift();
26480
26569
  if (!r) return s3;
26481
- let n2 = r.replace(/^SCHILY\.(dev|ino|nlink)/, "$1"), o2 = i2.join("=");
26482
- return s3[n2] = /^([A-Z]+\.)?([mac]|birth|creation)time$/.test(n2) ? new Date(Number(o2) * 1e3) : /^[0-9]+$/.test(o2) ? +o2 : o2, s3;
26570
+ let n2 = r.replace(/^SCHILY\.(dev|ino|nlink)/, "$1"), o2 = i2.join("=").replace(/\0.*/, "");
26571
+ switch (n2) {
26572
+ case "path":
26573
+ case "linkpath":
26574
+ case "type":
26575
+ case "charset":
26576
+ case "comment":
26577
+ case "gname":
26578
+ case "uname":
26579
+ s3[n2] = o2;
26580
+ break;
26581
+ case "ctime":
26582
+ case "atime":
26583
+ case "mtime":
26584
+ s3[n2] = new Date(Number(o2) * 1e3);
26585
+ break;
26586
+ case "size":
26587
+ let h3 = +o2;
26588
+ h3 >= 0 && (s3[n2] = h3);
26589
+ break;
26590
+ case "gid":
26591
+ case "uid":
26592
+ case "dev":
26593
+ case "ino":
26594
+ case "nlink":
26595
+ case "mode":
26596
+ s3[n2] = +o2;
26597
+ break;
26598
+ }
26599
+ return s3;
26483
26600
  };
26484
- var bn = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
26485
- var f = bn !== "win32" ? (s3) => s3 : (s3) => s3 && s3.replaceAll(/\\/g, "/");
26486
- var Yt = class extends D3 {
26601
+ var Ln = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
26602
+ var f = Ln !== "win32" ? (s3) => String(s3) : (s3) => String(s3).replaceAll(/\\/g, "/");
26603
+ var $e2 = class extends A {
26487
26604
  extended;
26488
26605
  globalExtended;
26489
26606
  header;
@@ -26547,93 +26664,100 @@ var Yt = class extends D3 {
26547
26664
  t2.path && (t2.path = f(t2.path)), t2.linkpath && (t2.linkpath = f(t2.linkpath)), Object.assign(this, Object.fromEntries(Object.entries(t2).filter(([i2, r]) => !(r == null || i2 === "path" && e))));
26548
26665
  }
26549
26666
  };
26550
- var Lt2 = (s3, t2, e, i2 = {}) => {
26667
+ var Dt = (s3, t2, e, i2 = {}) => {
26551
26668
  s3.file && (i2.file = s3.file), s3.cwd && (i2.cwd = s3.cwd), i2.code = e instanceof Error && e.code || t2, i2.tarCode = t2, !s3.strict && i2.recoverable !== false ? (e instanceof Error && (i2 = Object.assign(e, i2), e = e.message), s3.emit("warn", t2, e, i2)) : e instanceof Error ? s3.emit("error", Object.assign(e, i2)) : s3.emit("error", Object.assign(new Error(`${t2}: ${e}`), i2));
26552
26669
  };
26553
- var gn = 1024 * 1024;
26554
- var Zi = Buffer.from([31, 139]);
26555
- var Yi = Buffer.from([40, 181, 47, 253]);
26556
- var On = Math.max(Zi.length, Yi.length);
26670
+ var Nn = 1024 * 1024;
26671
+ var Xi = Buffer.from([31, 139]);
26672
+ var qi = Buffer.from([40, 181, 47, 253]);
26673
+ var An = Math.max(Xi.length, qi.length);
26557
26674
  var B2 = Symbol("state");
26558
26675
  var Nt2 = Symbol("writeEntry");
26559
- var et2 = Symbol("readEntry");
26560
- var Ui = Symbol("nextEntry");
26561
- var Us = Symbol("processEntry");
26676
+ var it2 = Symbol("readEntry");
26677
+ var Zi = Symbol("nextEntry");
26678
+ var Zs = Symbol("processEntry");
26562
26679
  var V2 = Symbol("extendedHeader");
26563
- var ae2 = Symbol("globalExtendedHeader");
26564
- var ft3 = Symbol("meta");
26565
- var Hs = Symbol("emitMeta");
26680
+ var he2 = Symbol("globalExtendedHeader");
26681
+ var dt3 = Symbol("meta");
26682
+ var Ys = Symbol("emitMeta");
26566
26683
  var p = Symbol("buffer");
26567
- var it2 = Symbol("queue");
26568
- var dt3 = Symbol("ended");
26569
- var Hi = Symbol("emittedEnd");
26684
+ var st2 = Symbol("queue");
26685
+ var mt3 = Symbol("ended");
26686
+ var Yi = Symbol("emittedEnd");
26570
26687
  var At3 = Symbol("emit");
26571
- var y2 = Symbol("unzip");
26572
- var Ve2 = Symbol("consumeChunk");
26573
- var $e2 = Symbol("consumeChunkSub");
26574
- var Wi = Symbol("consumeBody");
26575
- var Ws = Symbol("consumeMeta");
26576
- var Gs = Symbol("consumeHeader");
26577
- var le = Symbol("consuming");
26578
- var Gi = Symbol("bufferConcat");
26579
- var Xe = Symbol("maybeEnd");
26580
- var Kt2 = Symbol("writing");
26581
- var ut = Symbol("aborted");
26582
- var qe = Symbol("onDone");
26583
- var Dt = Symbol("sawValidEntry");
26688
+ var w = Symbol("unzip");
26689
+ var Xe = Symbol("consumeChunk");
26690
+ var qe = Symbol("consumeChunkSub");
26691
+ var Ki = Symbol("consumeBody");
26692
+ var Ks = Symbol("consumeMeta");
26693
+ var Vs = Symbol("consumeHeader");
26694
+ var ae2 = Symbol("consuming");
26695
+ var Vi = Symbol("bufferConcat");
26696
+ var Qe2 = Symbol("maybeEnd");
26697
+ var Yt = Symbol("writing");
26698
+ var $2 = Symbol("aborted");
26699
+ var Je = Symbol("onDone");
26700
+ var It3 = Symbol("sawValidEntry");
26584
26701
  var je2 = Symbol("sawNullBlock");
26585
- var Qe2 = Symbol("sawEOF");
26586
- var Zs = Symbol("closeStream");
26587
- var Tn = () => true;
26588
- var st2 = class extends EventEmitter {
26702
+ var ti = Symbol("sawEOF");
26703
+ var $s = Symbol("closeStream");
26704
+ var In = 1e3;
26705
+ var le = Symbol("compressedBytesRead");
26706
+ var $i = Symbol("decompressedBytesRead");
26707
+ var Xs = Symbol("checkDecompressionRatio");
26708
+ var Cn = () => true;
26709
+ var rt2 = class extends EventEmitter {
26589
26710
  file;
26590
26711
  strict;
26591
26712
  maxMetaEntrySize;
26592
26713
  filter;
26593
26714
  brotli;
26594
26715
  zstd;
26716
+ maxDecompressionRatio;
26595
26717
  writable = true;
26596
26718
  readable = false;
26597
- [it2] = [];
26719
+ [st2] = [];
26598
26720
  [p];
26599
- [et2];
26721
+ [it2];
26600
26722
  [Nt2];
26601
26723
  [B2] = "begin";
26602
- [ft3] = "";
26724
+ [dt3] = "";
26603
26725
  [V2];
26604
- [ae2];
26605
- [dt3] = false;
26606
- [y2];
26607
- [ut] = false;
26608
- [Dt];
26726
+ [he2];
26727
+ [mt3] = false;
26728
+ [w];
26729
+ [$2] = false;
26730
+ [It3];
26609
26731
  [je2] = false;
26610
- [Qe2] = false;
26611
- [Kt2] = false;
26612
- [le] = false;
26613
- [Hi] = false;
26732
+ [ti] = false;
26733
+ [Yt] = false;
26734
+ [ae2] = false;
26735
+ [Yi] = false;
26736
+ [le] = 0;
26737
+ [$i] = 0;
26614
26738
  constructor(t2 = {}) {
26615
- super(), this.file = t2.file || "", this.on(qe, () => {
26616
- (this[B2] === "begin" || this[Dt] === false) && this.warn("TAR_BAD_ARCHIVE", "Unrecognized archive format");
26617
- }), t2.ondone ? this.on(qe, t2.ondone) : this.on(qe, () => {
26739
+ super(), this.file = t2.file || "", this.on(Je, () => {
26740
+ (this[B2] === "begin" || this[It3] === false) && this.warn("TAR_BAD_ARCHIVE", "Unrecognized archive format");
26741
+ }), t2.ondone ? this.on(Je, t2.ondone) : this.on(Je, () => {
26618
26742
  this.emit("prefinish"), this.emit("finish"), this.emit("end");
26619
- }), this.strict = !!t2.strict, this.maxMetaEntrySize = t2.maxMetaEntrySize || gn, this.filter = typeof t2.filter == "function" ? t2.filter : Tn;
26743
+ }), this.strict = !!t2.strict, this.maxDecompressionRatio = typeof t2.maxDecompressionRatio == "number" ? t2.maxDecompressionRatio : In, this.maxMetaEntrySize = t2.maxMetaEntrySize || Nn, this.filter = typeof t2.filter == "function" ? t2.filter : Cn;
26620
26744
  let e = t2.file && (t2.file.endsWith(".tar.br") || t2.file.endsWith(".tbr"));
26621
26745
  this.brotli = !(t2.gzip || t2.zstd) && t2.brotli !== void 0 ? t2.brotli : e ? void 0 : false;
26622
26746
  let i2 = t2.file && (t2.file.endsWith(".tar.zst") || t2.file.endsWith(".tzst"));
26623
- this.zstd = !(t2.gzip || t2.brotli) && t2.zstd !== void 0 ? t2.zstd : i2 ? true : void 0, this.on("end", () => this[Zs]()), typeof t2.onwarn == "function" && this.on("warn", t2.onwarn), typeof t2.onReadEntry == "function" && this.on("entry", t2.onReadEntry);
26747
+ this.zstd = !(t2.gzip || t2.brotli) && t2.zstd !== void 0 ? t2.zstd : i2 ? true : void 0, this.on("end", () => this[$s]()), typeof t2.onwarn == "function" && this.on("warn", t2.onwarn), typeof t2.onReadEntry == "function" && this.on("entry", t2.onReadEntry);
26624
26748
  }
26625
26749
  warn(t2, e, i2 = {}) {
26626
- Lt2(this, t2, e, i2);
26750
+ Dt(this, t2, e, i2);
26627
26751
  }
26628
- [Gs](t2, e) {
26629
- this[Dt] === void 0 && (this[Dt] = false);
26752
+ [Vs](t2, e) {
26753
+ this[It3] === void 0 && (this[It3] = false);
26630
26754
  let i2;
26631
26755
  try {
26632
- i2 = new F(t2, e, this[V2], this[ae2]);
26756
+ i2 = new F(t2, e, this[V2], this[he2]);
26633
26757
  } catch (r) {
26634
26758
  return this.warn("TAR_ENTRY_INVALID", r);
26635
26759
  }
26636
- if (i2.nullBlock) this[je2] ? (this[Qe2] = true, this[B2] === "begin" && (this[B2] = "header"), this[At3]("eof")) : (this[je2] = true, this[At3]("nullBlock"));
26760
+ if (i2.nullBlock) this[je2] ? (this[ti] = true, this[B2] === "begin" && (this[B2] = "header"), this[At3]("eof")) : (this[je2] = true, this[At3]("nullBlock"));
26637
26761
  else if (this[je2] = false, !i2.cksumValid) this.warn("TAR_ENTRY_INVALID", "checksum failure", { header: i2 });
26638
26762
  else if (!i2.path) this.warn("TAR_ENTRY_INVALID", "path is required", { header: i2 });
26639
26763
  else {
@@ -26641,69 +26765,69 @@ var st2 = class extends EventEmitter {
26641
26765
  if (/^(Symbolic)?Link$/.test(r) && !i2.linkpath) this.warn("TAR_ENTRY_INVALID", "linkpath required", { header: i2 });
26642
26766
  else if (!/^(Symbolic)?Link$/.test(r) && !/^(Global)?ExtendedHeader$/.test(r) && i2.linkpath) this.warn("TAR_ENTRY_INVALID", "linkpath forbidden", { header: i2 });
26643
26767
  else {
26644
- let n2 = this[Nt2] = new Yt(i2, this[V2], this[ae2]);
26645
- if (!this[Dt]) if (n2.remain) {
26768
+ let n2 = this[Nt2] = new $e2(i2, this[V2], this[he2]);
26769
+ if (!this[It3]) if (n2.remain) {
26646
26770
  let o2 = () => {
26647
- n2.invalid || (this[Dt] = true);
26771
+ n2.invalid || (this[It3] = true);
26648
26772
  };
26649
26773
  n2.on("end", o2);
26650
- } else this[Dt] = true;
26651
- n2.meta ? n2.size > this.maxMetaEntrySize ? (n2.ignore = true, this[At3]("ignoredEntry", n2), this[B2] = "ignore", n2.resume()) : n2.size > 0 && (this[ft3] = "", n2.on("data", (o2) => this[ft3] += o2), this[B2] = "meta") : (this[V2] = void 0, n2.ignore = n2.ignore || !this.filter(n2.path, n2), n2.ignore ? (this[At3]("ignoredEntry", n2), this[B2] = n2.remain ? "ignore" : "header", n2.resume()) : (n2.remain ? this[B2] = "body" : (this[B2] = "header", n2.end()), this[et2] ? this[it2].push(n2) : (this[it2].push(n2), this[Ui]())));
26774
+ } else this[It3] = true;
26775
+ n2.meta ? n2.size > this.maxMetaEntrySize ? (n2.ignore = true, this[At3]("ignoredEntry", n2), this[B2] = "ignore", n2.resume()) : n2.size > 0 && (this[dt3] = "", n2.on("data", (o2) => this[dt3] += o2), this[B2] = "meta") : (this[V2] = void 0, n2.ignore = n2.ignore || !this.filter(n2.path, n2), n2.ignore ? (this[At3]("ignoredEntry", n2), this[B2] = n2.remain ? "ignore" : "header", n2.resume()) : (n2.remain ? this[B2] = "body" : (this[B2] = "header", n2.end()), this[it2] ? this[st2].push(n2) : (this[st2].push(n2), this[Zi]())));
26652
26776
  }
26653
26777
  }
26654
26778
  }
26655
- [Zs]() {
26779
+ [$s]() {
26656
26780
  queueMicrotask(() => this.emit("close"));
26657
26781
  }
26658
- [Us](t2) {
26782
+ [Zs](t2) {
26659
26783
  let e = true;
26660
- if (!t2) this[et2] = void 0, e = false;
26784
+ if (!t2) this[it2] = void 0, e = false;
26661
26785
  else if (Array.isArray(t2)) {
26662
26786
  let [i2, ...r] = t2;
26663
26787
  this.emit(i2, ...r);
26664
- } else this[et2] = t2, this.emit("entry", t2), t2.emittedEnd || (t2.on("end", () => this[Ui]()), e = false);
26788
+ } else this[it2] = t2, this.emit("entry", t2), t2.emittedEnd || (t2.on("end", () => this[Zi]()), e = false);
26665
26789
  return e;
26666
26790
  }
26667
- [Ui]() {
26791
+ [Zi]() {
26668
26792
  do
26669
26793
  ;
26670
- while (this[Us](this[it2].shift()));
26671
- if (this[it2].length === 0) {
26672
- let t2 = this[et2];
26673
- !t2 || t2.flowing || t2.size === t2.remain ? this[Kt2] || this.emit("drain") : t2.once("drain", () => this.emit("drain"));
26794
+ while (this[Zs](this[st2].shift()));
26795
+ if (this[st2].length === 0) {
26796
+ let t2 = this[it2];
26797
+ !t2 || t2.flowing || t2.size === t2.remain ? this[Yt] || this.emit("drain") : t2.once("drain", () => this.emit("drain"));
26674
26798
  }
26675
26799
  }
26676
- [Wi](t2, e) {
26800
+ [Ki](t2, e) {
26677
26801
  let i2 = this[Nt2];
26678
26802
  if (!i2) throw new Error("attempt to consume body without entry??");
26679
26803
  let r = i2.blockRemain ?? 0, n2 = r >= t2.length && e === 0 ? t2 : t2.subarray(e, e + r);
26680
26804
  return i2.write(n2), i2.blockRemain || (this[B2] = "header", this[Nt2] = void 0, i2.end()), n2.length;
26681
26805
  }
26682
- [Ws](t2, e) {
26683
- let i2 = this[Nt2], r = this[Wi](t2, e);
26684
- return !this[Nt2] && i2 && this[Hs](i2), r;
26806
+ [Ks](t2, e) {
26807
+ let i2 = this[Nt2], r = this[Ki](t2, e);
26808
+ return !this[Nt2] && i2 && this[Ys](i2), r;
26685
26809
  }
26686
26810
  [At3](t2, e, i2) {
26687
- this[it2].length === 0 && !this[et2] ? this.emit(t2, e, i2) : this[it2].push([t2, e, i2]);
26811
+ this[st2].length === 0 && !this[it2] ? this.emit(t2, e, i2) : this[st2].push([t2, e, i2]);
26688
26812
  }
26689
- [Hs](t2) {
26690
- switch (this[At3]("meta", this[ft3]), t2.type) {
26813
+ [Ys](t2) {
26814
+ switch (this[At3]("meta", this[dt3]), t2.type) {
26691
26815
  case "ExtendedHeader":
26692
26816
  case "OldExtendedHeader":
26693
- this[V2] = ct2.parse(this[ft3], this[V2], false);
26817
+ this[V2] = ft3.parse(this[dt3], this[V2], false);
26694
26818
  break;
26695
26819
  case "GlobalExtendedHeader":
26696
- this[ae2] = ct2.parse(this[ft3], this[ae2], true);
26820
+ this[he2] = ft3.parse(this[dt3], this[he2], true);
26697
26821
  break;
26698
26822
  case "NextFileHasLongPath":
26699
26823
  case "OldGnuLongPath": {
26700
26824
  let e = this[V2] ?? /* @__PURE__ */ Object.create(null);
26701
- this[V2] = e, e.path = this[ft3].replace(/\0.*/, "");
26825
+ this[V2] = e, e.path = this[dt3].replace(/\0.*/, "");
26702
26826
  break;
26703
26827
  }
26704
26828
  case "NextFileHasLongLinkpath": {
26705
26829
  let e = this[V2] || /* @__PURE__ */ Object.create(null);
26706
- this[V2] = e, e.linkpath = this[ft3].replace(/\0.*/, "");
26830
+ this[V2] = e, e.linkpath = this[dt3].replace(/\0.*/, "");
26707
26831
  break;
26708
26832
  }
26709
26833
  default:
@@ -26711,86 +26835,101 @@ var st2 = class extends EventEmitter {
26711
26835
  }
26712
26836
  }
26713
26837
  abort(t2) {
26714
- this[ut] = true, this.emit("abort", t2), this.warn("TAR_ABORT", t2, { recoverable: false });
26838
+ if (!this[$2]) {
26839
+ if (this[w]) {
26840
+ let e = this[w];
26841
+ e.write = () => true, e.end = () => e, e.emit = () => false, e.destroy?.();
26842
+ }
26843
+ this[$2] = true, this.emit("abort", t2), this.warn("TAR_ABORT", t2, { recoverable: false });
26844
+ }
26845
+ }
26846
+ [Xs](t2) {
26847
+ this[$i] += t2.length;
26848
+ let e = this[$i] / this[le];
26849
+ return e > this.maxDecompressionRatio ? (this.abort(new Error(`max decompression ratio exceeded: ${e.toFixed(2)} > ${this.maxDecompressionRatio}`)), false) : true;
26715
26850
  }
26716
26851
  write(t2, e, i2) {
26717
- if (typeof e == "function" && (i2 = e, e = void 0), typeof t2 == "string" && (t2 = Buffer.from(t2, typeof e == "string" ? e : "utf8")), this[ut]) return i2?.(), false;
26718
- if ((this[y2] === void 0 || this.brotli === void 0 && this[y2] === false) && t2) {
26719
- if (this[p] && (t2 = Buffer.concat([this[p], t2]), this[p] = void 0), t2.length < On) return this[p] = t2, i2?.(), true;
26720
- for (let a2 = 0; this[y2] === void 0 && a2 < Zi.length; a2++) t2[a2] !== Zi[a2] && (this[y2] = false);
26852
+ if (typeof e == "function" && (i2 = e, e = void 0), typeof t2 == "string" && (t2 = Buffer.from(t2, typeof e == "string" ? e : "utf8")), this[$2]) return i2?.(), false;
26853
+ if ((this[w] === void 0 || this.brotli === void 0 && this[w] === false) && t2) {
26854
+ if (this[p] && (t2 = Buffer.concat([this[p], t2]), this[p] = void 0), t2.length < An) return this[p] = t2, i2?.(), true;
26855
+ for (let a2 = 0; this[w] === void 0 && a2 < Xi.length; a2++) t2[a2] !== Xi[a2] && (this[w] = false);
26721
26856
  let o2 = false;
26722
- if (this[y2] === false && this.zstd !== false) {
26857
+ if (this[w] === false && this.zstd !== false) {
26723
26858
  o2 = true;
26724
- for (let a2 = 0; a2 < Yi.length; a2++) if (t2[a2] !== Yi[a2]) {
26859
+ for (let a2 = 0; a2 < qi.length; a2++) if (t2[a2] !== qi[a2]) {
26725
26860
  o2 = false;
26726
26861
  break;
26727
26862
  }
26728
26863
  }
26729
26864
  let h3 = this.brotli === void 0 && !o2;
26730
- if (this[y2] === false && h3) if (t2.length < 512) if (this[dt3]) this.brotli = true;
26865
+ if (this[w] === false && h3) if (t2.length < 512) if (this[mt3]) this.brotli = true;
26731
26866
  else return this[p] = t2, i2?.(), true;
26732
26867
  else try {
26733
26868
  new F(t2.subarray(0, 512)), this.brotli = false;
26734
26869
  } catch {
26735
26870
  this.brotli = true;
26736
26871
  }
26737
- if (this[y2] === void 0 || this[y2] === false && (this.brotli || o2)) {
26738
- let a2 = this[dt3];
26739
- this[dt3] = false, this[y2] = this[y2] === void 0 ? new ze2({}) : o2 ? new Ye({}) : new We2({}), this[y2].on("data", (c3) => this[Ve2](c3)), this[y2].on("error", (c3) => this.abort(c3)), this[y2].on("end", () => {
26740
- this[dt3] = true, this[Ve2]();
26741
- }), this[Kt2] = true;
26742
- let l = !!this[y2][a2 ? "end" : "write"](t2);
26743
- return this[Kt2] = false, i2?.(), l;
26744
- }
26745
- }
26746
- this[Kt2] = true, this[y2] ? this[y2].write(t2) : this[Ve2](t2), this[Kt2] = false;
26747
- let n2 = this[it2].length > 0 ? false : this[et2] ? this[et2].flowing : true;
26748
- return !n2 && this[it2].length === 0 && this[et2]?.once("drain", () => this.emit("drain")), i2?.(), n2;
26749
- }
26750
- [Gi](t2) {
26751
- t2 && !this[ut] && (this[p] = this[p] ? Buffer.concat([this[p], t2]) : t2);
26752
- }
26753
- [Xe]() {
26754
- if (this[dt3] && !this[Hi] && !this[ut] && !this[le]) {
26755
- this[Hi] = true;
26872
+ if (this[w] === void 0 || this[w] === false && (this.brotli || o2)) {
26873
+ let a2 = this[mt3];
26874
+ this[mt3] = false, this[w] = this[w] === void 0 ? new Ue2({}) : o2 ? new Ke2({}) : new Ge2({}), this[w].on("data", (c3) => {
26875
+ this[Xs](c3) && this[Xe](c3);
26876
+ }), this[w].on("error", (c3) => {
26877
+ this[$2] || this.abort(c3);
26878
+ }), this[w].on("end", () => {
26879
+ this[mt3] = true, this[Xe]();
26880
+ }), this[Yt] = true, this[le] += t2.length;
26881
+ let l = !!this[w][a2 ? "end" : "write"](t2);
26882
+ return this[Yt] = false, i2?.(), l;
26883
+ }
26884
+ }
26885
+ this[Yt] = true, this[w] ? (this[le] += t2.length, this[w].write(t2)) : this[Xe](t2), this[Yt] = false;
26886
+ let n2 = this[st2].length > 0 ? false : this[it2] ? this[it2].flowing : true;
26887
+ return !n2 && this[st2].length === 0 && this[it2]?.once("drain", () => this.emit("drain")), i2?.(), n2;
26888
+ }
26889
+ [Vi](t2) {
26890
+ t2 && !this[$2] && (this[p] = this[p] ? Buffer.concat([this[p], t2]) : t2);
26891
+ }
26892
+ [Qe2]() {
26893
+ if (this[mt3] && !this[Yi] && !this[$2] && !this[ae2]) {
26894
+ this[Yi] = true;
26756
26895
  let t2 = this[Nt2];
26757
- if (t2 && t2.blockRemain) {
26896
+ if (t2?.blockRemain) {
26758
26897
  let e = this[p] ? this[p].length : 0;
26759
26898
  this.warn("TAR_BAD_ARCHIVE", `Truncated input (needed ${t2.blockRemain} more bytes, only ${e} available)`, { entry: t2 }), this[p] && t2.write(this[p]), t2.end();
26760
26899
  }
26761
- this[At3](qe);
26900
+ this[At3](Je);
26762
26901
  }
26763
26902
  }
26764
- [Ve2](t2) {
26765
- if (this[le] && t2) this[Gi](t2);
26766
- else if (!t2 && !this[p]) this[Xe]();
26903
+ [Xe](t2) {
26904
+ if (this[ae2] && t2) this[Vi](t2);
26905
+ else if (!t2 && !this[p]) this[Qe2]();
26767
26906
  else if (t2) {
26768
- if (this[le] = true, this[p]) {
26769
- this[Gi](t2);
26907
+ if (this[ae2] = true, this[p]) {
26908
+ this[Vi](t2);
26770
26909
  let e = this[p];
26771
- this[p] = void 0, this[$e2](e);
26772
- } else this[$e2](t2);
26773
- for (; this[p] && this[p]?.length >= 512 && !this[ut] && !this[Qe2]; ) {
26910
+ this[p] = void 0, this[qe](e);
26911
+ } else this[qe](t2);
26912
+ for (; this[p] && this[p]?.length >= 512 && !this[$2] && !this[ti]; ) {
26774
26913
  let e = this[p];
26775
- this[p] = void 0, this[$e2](e);
26914
+ this[p] = void 0, this[qe](e);
26776
26915
  }
26777
- this[le] = false;
26916
+ this[ae2] = false;
26778
26917
  }
26779
- (!this[p] || this[dt3]) && this[Xe]();
26918
+ (!this[p] || this[mt3]) && this[Qe2]();
26780
26919
  }
26781
- [$e2](t2) {
26920
+ [qe](t2) {
26782
26921
  let e = 0, i2 = t2.length;
26783
- for (; e + 512 <= i2 && !this[ut] && !this[Qe2]; ) switch (this[B2]) {
26922
+ for (; e + 512 <= i2 && !this[$2] && !this[ti]; ) switch (this[B2]) {
26784
26923
  case "begin":
26785
26924
  case "header":
26786
- this[Gs](t2, e), e += 512;
26925
+ this[Vs](t2, e), e += 512;
26787
26926
  break;
26788
26927
  case "ignore":
26789
26928
  case "body":
26790
- e += this[Wi](t2, e);
26929
+ e += this[Ki](t2, e);
26791
26930
  break;
26792
26931
  case "meta":
26793
- e += this[Ws](t2, e);
26932
+ e += this[Ks](t2, e);
26794
26933
  break;
26795
26934
  default:
26796
26935
  throw new Error("invalid state: " + this[B2]);
@@ -26798,22 +26937,22 @@ var st2 = class extends EventEmitter {
26798
26937
  e < i2 && (this[p] = this[p] ? Buffer.concat([t2.subarray(e), this[p]]) : t2.subarray(e));
26799
26938
  }
26800
26939
  end(t2, e, i2) {
26801
- return typeof t2 == "function" && (i2 = t2, e = void 0, t2 = void 0), typeof e == "function" && (i2 = e, e = void 0), typeof t2 == "string" && (t2 = Buffer.from(t2, e)), i2 && this.once("finish", i2), this[ut] || (this[y2] ? (t2 && this[y2].write(t2), this[y2].end()) : (this[dt3] = true, (this.brotli === void 0 || this.zstd === void 0) && (t2 = t2 || Buffer.alloc(0)), t2 && this.write(t2), this[Xe]())), this;
26940
+ return typeof t2 == "function" && (i2 = t2, e = void 0, t2 = void 0), typeof e == "function" && (i2 = e, e = void 0), typeof t2 == "string" && (t2 = Buffer.from(t2, e)), i2 && this.once("finish", i2), this[$2] || (this[w] ? (t2 && (this[le] += t2.length, this[w].write(t2)), this[w].end()) : (this[mt3] = true, (this.brotli === void 0 || this.zstd === void 0) && (t2 = t2 || Buffer.alloc(0)), t2 && this.write(t2), this[Qe2]())), this;
26802
26941
  }
26803
26942
  };
26804
- var mt3 = (s3) => {
26943
+ var ut = (s3) => {
26805
26944
  let t2 = s3.length - 1, e = -1;
26806
26945
  for (; t2 > -1 && s3.charAt(t2) === "/"; ) e = t2, t2--;
26807
26946
  return e === -1 ? s3 : s3.slice(0, e);
26808
26947
  };
26809
- var Nn = (s3) => {
26948
+ var vn = (s3) => {
26810
26949
  let t2 = s3.onReadEntry;
26811
26950
  s3.onReadEntry = t2 ? (e) => {
26812
26951
  t2(e), e.resume();
26813
26952
  } : (e) => e.resume();
26814
26953
  };
26815
- var Ki = (s3, t2) => {
26816
- let e = new Map(t2.map((n2) => [mt3(n2), true])), i2 = s3.filter, r = (n2, o2 = "") => {
26954
+ var Qi = (s3, t2) => {
26955
+ let e = new Map(t2.map((n2) => [ut(n2), true])), i2 = s3.filter, r = (n2, o2 = "") => {
26817
26956
  let h3 = o2 || parse(n2).root || ".", a2;
26818
26957
  if (n2 === h3) a2 = false;
26819
26958
  else {
@@ -26822,10 +26961,10 @@ var Ki = (s3, t2) => {
26822
26961
  }
26823
26962
  return e.set(n2, a2), a2;
26824
26963
  };
26825
- s3.filter = i2 ? (n2, o2) => i2(n2, o2) && r(mt3(n2)) : (n2) => r(mt3(n2));
26964
+ s3.filter = i2 ? (n2, o2) => i2(n2, o2) && r(ut(n2)) : (n2) => r(ut(n2));
26826
26965
  };
26827
- var An = (s3) => {
26828
- let t2 = new st2(s3), e = s3.file, i2;
26966
+ var Mn = (s3) => {
26967
+ let t2 = new rt2(s3), e = s3.file, i2;
26829
26968
  try {
26830
26969
  i2 = fs.openSync(e, "r");
26831
26970
  let r = fs.fstatSync(i2), n2 = s3.maxReadSize || 16 * 1024 * 1024;
@@ -26848,8 +26987,8 @@ var An = (s3) => {
26848
26987
  }
26849
26988
  }
26850
26989
  };
26851
- var Dn = (s3, t2) => {
26852
- let e = new st2(s3), i2 = s3.maxReadSize || 16 * 1024 * 1024, r = s3.file;
26990
+ var Bn = (s3, t2) => {
26991
+ let e = new rt2(s3), i2 = s3.maxReadSize || 16 * 1024 * 1024, r = s3.file;
26853
26992
  return new Promise((o2, h3) => {
26854
26993
  e.on("error", h3), e.on("end", o2), fs.stat(r, (a2, l) => {
26855
26994
  if (a2) h3(a2);
@@ -26860,46 +26999,46 @@ var Dn = (s3, t2) => {
26860
26999
  });
26861
27000
  });
26862
27001
  };
26863
- var It3 = K2(An, Dn, (s3) => new st2(s3), (s3) => new st2(s3), (s3, t2) => {
26864
- t2?.length && Ki(s3, t2), s3.noResume || Nn(s3);
27002
+ var Ct3 = K2(Mn, Bn, (s3) => new rt2(s3), (s3) => new rt2(s3), (s3, t2) => {
27003
+ t2?.length && Qi(s3, t2), s3.noResume || vn(s3);
26865
27004
  });
26866
- var Vi = (s3, t2, e) => (s3 &= 4095, e && (s3 = (s3 | 384) & -19), t2 && (s3 & 256 && (s3 |= 64), s3 & 32 && (s3 |= 8), s3 & 4 && (s3 |= 1)), s3);
26867
- var { isAbsolute: Cn, parse: Ys } = win32;
27005
+ var Ji = (s3, t2, e) => (s3 &= 4095, e && (s3 = (s3 | 384) & -19), t2 && (s3 & 256 && (s3 |= 64), s3 & 32 && (s3 |= 8), s3 & 4 && (s3 |= 1)), s3);
27006
+ var { isAbsolute: zn, parse: qs } = win32;
26868
27007
  var ce2 = (s3) => {
26869
- let t2 = "", e = Ys(s3);
26870
- for (; Cn(s3) || e.root; ) {
27008
+ let t2 = "", e = qs(s3);
27009
+ for (; zn(s3) || e.root; ) {
26871
27010
  let i2 = s3.charAt(0) === "/" && s3.slice(0, 4) !== "//?/" ? "/" : e.root;
26872
- s3 = s3.slice(i2.length), t2 += i2, e = Ys(s3);
27011
+ s3 = s3.slice(i2.length), t2 += i2, e = qs(s3);
26873
27012
  }
26874
27013
  return [t2, s3];
26875
27014
  };
26876
- var Je = ["|", "<", ">", "?", ":"];
26877
- var $i = Je.map((s3) => String.fromCodePoint(61440 + Number(s3.codePointAt(0))));
26878
- var Fn = new Map(Je.map((s3, t2) => [s3, $i[t2]]));
26879
- var kn = new Map($i.map((s3, t2) => [s3, Je[t2]]));
26880
- var Xi = (s3) => Je.reduce((t2, e) => t2.split(e).join(Fn.get(e)), s3);
26881
- var Ks = (s3) => $i.reduce((t2, e) => t2.split(e).join(kn.get(e)), s3);
26882
- var Js = (s3, t2) => t2 ? (s3 = f(s3).replace(/^\.(\/|$)/, ""), mt3(t2) + "/" + s3) : f(s3);
26883
- var vn = 16 * 1024 * 1024;
26884
- var Xs = Symbol("process");
26885
- var qs = Symbol("file");
26886
- var js = Symbol("directory");
26887
- var ji = Symbol("symlink");
26888
- var Qs = Symbol("hardlink");
27015
+ var ei = ["|", "<", ">", "?", ":"];
27016
+ var ji = ei.map((s3) => String.fromCodePoint(61440 + Number(s3.codePointAt(0))));
27017
+ var Un = new Map(ei.map((s3, t2) => [s3, ji[t2]]));
27018
+ var Hn = new Map(ji.map((s3, t2) => [s3, ei[t2]]));
27019
+ var ts = (s3) => ei.reduce((t2, e) => t2.split(e).join(Un.get(e)), s3);
27020
+ var Qs = (s3) => ji.reduce((t2, e) => t2.split(e).join(Hn.get(e)), s3);
27021
+ var rr = (s3, t2) => t2 ? (s3 = f(s3).replace(/^\.(\/|$)/, ""), ut(t2) + "/" + s3) : f(s3);
27022
+ var Wn = 16 * 1024 * 1024;
27023
+ var tr = Symbol("process");
27024
+ var er = Symbol("file");
27025
+ var ir = Symbol("directory");
27026
+ var is = Symbol("symlink");
27027
+ var sr = Symbol("hardlink");
26889
27028
  var fe2 = Symbol("header");
26890
- var ti = Symbol("read");
26891
- var Qi = Symbol("lstat");
26892
- var ei = Symbol("onlstat");
26893
- var Ji = Symbol("onread");
26894
- var ts = Symbol("onreadlink");
26895
- var es = Symbol("openfile");
26896
- var is = Symbol("onopenfile");
27029
+ var ii = Symbol("read");
27030
+ var ss = Symbol("lstat");
27031
+ var si = Symbol("onlstat");
27032
+ var rs = Symbol("onread");
27033
+ var ns = Symbol("onreadlink");
27034
+ var os2 = Symbol("openfile");
27035
+ var hs = Symbol("onopenfile");
26897
27036
  var pt3 = Symbol("close");
26898
- var ii = Symbol("mode");
26899
- var ss = Symbol("awaitDrain");
26900
- var qi = Symbol("ondrain");
26901
- var X3 = Symbol("prefix");
26902
- var de2 = class extends D3 {
27037
+ var ri = Symbol("mode");
27038
+ var as = Symbol("awaitDrain");
27039
+ var es = Symbol("ondrain");
27040
+ var q3 = Symbol("prefix");
27041
+ var de2 = class extends A {
26903
27042
  path;
26904
27043
  portable;
26905
27044
  myuid = process.getuid && process.getuid() || 0;
@@ -26931,110 +27070,110 @@ var de2 = class extends D3 {
26931
27070
  onWriteEntry;
26932
27071
  #t = false;
26933
27072
  constructor(t2, e = {}) {
26934
- let i2 = re2(e);
26935
- super(), this.path = f(t2), this.portable = !!i2.portable, this.maxReadSize = i2.maxReadSize || vn, this.linkCache = i2.linkCache || /* @__PURE__ */ new Map(), this.statCache = i2.statCache || /* @__PURE__ */ new Map(), this.preservePaths = !!i2.preservePaths, this.cwd = f(i2.cwd || process.cwd()), this.strict = !!i2.strict, this.noPax = !!i2.noPax, this.noMtime = !!i2.noMtime, this.mtime = i2.mtime, this.prefix = i2.prefix ? f(i2.prefix) : void 0, this.onWriteEntry = i2.onWriteEntry, typeof i2.onwarn == "function" && this.on("warn", i2.onwarn);
27073
+ let i2 = se2(e);
27074
+ super(), this.path = f(t2), this.portable = !!i2.portable, this.maxReadSize = i2.maxReadSize || Wn, this.linkCache = i2.linkCache || /* @__PURE__ */ new Map(), this.statCache = i2.statCache || /* @__PURE__ */ new Map(), this.preservePaths = !!i2.preservePaths, this.cwd = f(i2.cwd || process.cwd()), this.strict = !!i2.strict, this.noPax = !!i2.noPax, this.noMtime = !!i2.noMtime, this.mtime = i2.mtime, this.prefix = i2.prefix ? f(i2.prefix) : void 0, this.onWriteEntry = i2.onWriteEntry, typeof i2.onwarn == "function" && this.on("warn", i2.onwarn);
26936
27075
  let r = false;
26937
27076
  if (!this.preservePaths) {
26938
27077
  let [o2, h3] = ce2(this.path);
26939
27078
  o2 && typeof h3 == "string" && (this.path = h3, r = o2);
26940
27079
  }
26941
- this.win32 = !!i2.win32 || process.platform === "win32", this.win32 && (this.path = Ks(this.path.replaceAll(/\\/g, "/")), t2 = t2.replaceAll(/\\/g, "/")), this.absolute = f(i2.absolute || path15.resolve(this.cwd, t2)), this.path === "" && (this.path = "./"), r && this.warn("TAR_ENTRY_INFO", `stripping ${r} from absolute path`, { entry: this, path: r + this.path });
27080
+ this.win32 = !!i2.win32 || process.platform === "win32", this.win32 && (this.path = Qs(this.path.replaceAll(/\\/g, "/")), t2 = t2.replaceAll(/\\/g, "/")), this.absolute = f(i2.absolute || path15.resolve(this.cwd, t2)), this.path === "" && (this.path = "./"), r && this.warn("TAR_ENTRY_INFO", `stripping ${r} from absolute path`, { entry: this, path: r + this.path });
26942
27081
  let n2 = this.statCache.get(this.absolute);
26943
- n2 ? this[ei](n2) : this[Qi]();
27082
+ n2 ? this[si](n2) : this[ss]();
26944
27083
  }
26945
27084
  warn(t2, e, i2 = {}) {
26946
- return Lt2(this, t2, e, i2);
27085
+ return Dt(this, t2, e, i2);
26947
27086
  }
26948
27087
  emit(t2, ...e) {
26949
27088
  return t2 === "error" && (this.#t = true), super.emit(t2, ...e);
26950
27089
  }
26951
- [Qi]() {
27090
+ [ss]() {
26952
27091
  fs.lstat(this.absolute, (t2, e) => {
26953
27092
  if (t2) return this.emit("error", t2);
26954
- this[ei](e);
27093
+ this[si](e);
26955
27094
  });
26956
27095
  }
26957
- [ei](t2) {
26958
- this.statCache.set(this.absolute, t2), this.stat = t2, t2.isFile() || (t2.size = 0), this.type = Mn(t2), this.emit("stat", t2), this[Xs]();
27096
+ [si](t2) {
27097
+ this.statCache.set(this.absolute, t2), this.stat = t2, t2.isFile() || (t2.size = 0), this.type = Gn(t2), this.emit("stat", t2), this[tr]();
26959
27098
  }
26960
- [Xs]() {
27099
+ [tr]() {
26961
27100
  switch (this.type) {
26962
27101
  case "File":
26963
- return this[qs]();
27102
+ return this[er]();
26964
27103
  case "Directory":
26965
- return this[js]();
27104
+ return this[ir]();
26966
27105
  case "SymbolicLink":
26967
- return this[ji]();
27106
+ return this[is]();
26968
27107
  default:
26969
27108
  return this.end();
26970
27109
  }
26971
27110
  }
26972
- [ii](t2) {
26973
- return Vi(t2, this.type === "Directory", this.portable);
27111
+ [ri](t2) {
27112
+ return Ji(t2, this.type === "Directory", this.portable);
26974
27113
  }
26975
- [X3](t2) {
26976
- return Js(t2, this.prefix);
27114
+ [q3](t2) {
27115
+ return rr(t2, this.prefix);
26977
27116
  }
26978
27117
  [fe2]() {
26979
27118
  if (!this.stat) throw new Error("cannot write header before stat");
26980
- this.type === "Directory" && this.portable && (this.noMtime = true), this.onWriteEntry?.(this), this.header = new F({ path: this[X3](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[X3](this.linkpath) : this.linkpath, mode: this[ii](this.stat.mode), uid: this.portable ? void 0 : this.stat.uid, gid: this.portable ? void 0 : this.stat.gid, size: this.stat.size, mtime: this.noMtime ? void 0 : this.mtime || this.stat.mtime, type: this.type === "Unsupported" ? void 0 : this.type, uname: this.portable ? void 0 : this.stat.uid === this.myuid ? this.myuser : "", atime: this.portable ? void 0 : this.stat.atime, ctime: this.portable ? void 0 : this.stat.ctime }), this.header.encode() && !this.noPax && super.write(new ct2({ atime: this.portable ? void 0 : this.header.atime, ctime: this.portable ? void 0 : this.header.ctime, gid: this.portable ? void 0 : this.header.gid, mtime: this.noMtime ? void 0 : this.mtime || this.header.mtime, path: this[X3](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[X3](this.linkpath) : this.linkpath, size: this.header.size, uid: this.portable ? void 0 : this.header.uid, uname: this.portable ? void 0 : this.header.uname, dev: this.portable ? void 0 : this.stat.dev, ino: this.portable ? void 0 : this.stat.ino, nlink: this.portable ? void 0 : this.stat.nlink }).encode());
27119
+ this.type === "Directory" && this.portable && (this.noMtime = true), this.onWriteEntry?.(this), this.header = new F({ path: this[q3](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[q3](this.linkpath) : this.linkpath, mode: this[ri](this.stat.mode), uid: this.portable ? void 0 : this.stat.uid, gid: this.portable ? void 0 : this.stat.gid, size: this.stat.size, mtime: this.noMtime ? void 0 : this.mtime || this.stat.mtime, type: this.type === "Unsupported" ? void 0 : this.type, uname: this.portable ? void 0 : this.stat.uid === this.myuid ? this.myuser : "", atime: this.portable ? void 0 : this.stat.atime, ctime: this.portable ? void 0 : this.stat.ctime }), this.header.encode() && !this.noPax && super.write(new ft3({ atime: this.portable ? void 0 : this.header.atime, ctime: this.portable ? void 0 : this.header.ctime, gid: this.portable ? void 0 : this.header.gid, mtime: this.noMtime ? void 0 : this.mtime || this.header.mtime, path: this[q3](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[q3](this.linkpath) : this.linkpath, size: this.header.size, uid: this.portable ? void 0 : this.header.uid, uname: this.portable ? void 0 : this.header.uname, dev: this.portable ? void 0 : this.stat.dev, ino: this.portable ? void 0 : this.stat.ino, nlink: this.portable ? void 0 : this.stat.nlink }).encode());
26981
27120
  let t2 = this.header?.block;
26982
27121
  if (!t2) throw new Error("failed to encode header");
26983
27122
  super.write(t2);
26984
27123
  }
26985
- [js]() {
27124
+ [ir]() {
26986
27125
  if (!this.stat) throw new Error("cannot create directory entry without stat");
26987
27126
  this.path.slice(-1) !== "/" && (this.path += "/"), this.stat.size = 0, this[fe2](), this.end();
26988
27127
  }
26989
- [ji]() {
27128
+ [is]() {
26990
27129
  fs.readlink(this.absolute, (t2, e) => {
26991
27130
  if (t2) return this.emit("error", t2);
26992
- this[ts](e);
27131
+ this[ns](e);
26993
27132
  });
26994
27133
  }
26995
- [ts](t2) {
27134
+ [ns](t2) {
26996
27135
  this.linkpath = f(t2), this[fe2](), this.end();
26997
27136
  }
26998
- [Qs](t2) {
27137
+ [sr](t2) {
26999
27138
  if (!this.stat) throw new Error("cannot create link entry without stat");
27000
27139
  this.type = "Link", this.linkpath = f(path15.relative(this.cwd, t2)), this.stat.size = 0, this[fe2](), this.end();
27001
27140
  }
27002
- [qs]() {
27141
+ [er]() {
27003
27142
  if (!this.stat) throw new Error("cannot create file entry without stat");
27004
27143
  if (this.stat.nlink > 1) {
27005
27144
  let t2 = `${this.stat.dev}:${this.stat.ino}`, e = this.linkCache.get(t2);
27006
- if (e?.indexOf(this.cwd) === 0) return this[Qs](e);
27145
+ if (e?.indexOf(this.cwd) === 0) return this[sr](e);
27007
27146
  this.linkCache.set(t2, this.absolute);
27008
27147
  }
27009
27148
  if (this[fe2](), this.stat.size === 0) return this.end();
27010
- this[es]();
27149
+ this[os2]();
27011
27150
  }
27012
- [es]() {
27151
+ [os2]() {
27013
27152
  fs.open(this.absolute, "r", (t2, e) => {
27014
27153
  if (t2) return this.emit("error", t2);
27015
- this[is](e);
27154
+ this[hs](e);
27016
27155
  });
27017
27156
  }
27018
- [is](t2) {
27157
+ [hs](t2) {
27019
27158
  if (this.fd = t2, this.#t) return this[pt3]();
27020
27159
  if (!this.stat) throw new Error("should stat before calling onopenfile");
27021
27160
  this.blockLen = 512 * Math.ceil(this.stat.size / 512), this.blockRemain = this.blockLen;
27022
27161
  let e = Math.min(this.blockLen, this.maxReadSize);
27023
- this.buf = Buffer.allocUnsafe(e), this.offset = 0, this.pos = 0, this.remain = this.stat.size, this.length = this.buf.length, this[ti]();
27162
+ this.buf = Buffer.allocUnsafe(e), this.offset = 0, this.pos = 0, this.remain = this.stat.size, this.length = this.buf.length, this[ii]();
27024
27163
  }
27025
- [ti]() {
27164
+ [ii]() {
27026
27165
  let { fd: t2, buf: e, offset: i2, length: r, pos: n2 } = this;
27027
27166
  if (t2 === void 0 || e === void 0) throw new Error("cannot read file without first opening");
27028
27167
  fs.read(t2, e, i2, r, n2, (o2, h3) => {
27029
27168
  if (o2) return this[pt3](() => this.emit("error", o2));
27030
- this[Ji](h3);
27169
+ this[rs](h3);
27031
27170
  });
27032
27171
  }
27033
27172
  [pt3](t2 = () => {
27034
27173
  }) {
27035
27174
  this.fd !== void 0 && fs.close(this.fd, t2);
27036
27175
  }
27037
- [Ji](t2) {
27176
+ [rs](t2) {
27038
27177
  if (t2 <= 0 && this.remain > 0) {
27039
27178
  let r = Object.assign(new Error("encountered unexpected EOF"), { path: this.absolute, syscall: "read", code: "EOF" });
27040
27179
  return this[pt3](() => this.emit("error", r));
@@ -27046,9 +27185,9 @@ var de2 = class extends D3 {
27046
27185
  if (!this.buf) throw new Error("should have created buffer prior to reading");
27047
27186
  if (t2 === this.remain) for (let r = t2; r < this.length && t2 < this.blockRemain; r++) this.buf[r + this.offset] = 0, t2++, this.remain++;
27048
27187
  let e = this.offset === 0 && t2 === this.buf.length ? this.buf : this.buf.subarray(this.offset, this.offset + t2);
27049
- this.write(e) ? this[qi]() : this[ss](() => this[qi]());
27188
+ this.write(e) ? this[es]() : this[as](() => this[es]());
27050
27189
  }
27051
- [ss](t2) {
27190
+ [as](t2) {
27052
27191
  this.once("drain", t2);
27053
27192
  }
27054
27193
  write(t2, e, i2) {
@@ -27058,30 +27197,30 @@ var de2 = class extends D3 {
27058
27197
  }
27059
27198
  return this.remain -= t2.length, this.blockRemain -= t2.length, this.pos += t2.length, this.offset += t2.length, super.write(t2, null, i2);
27060
27199
  }
27061
- [qi]() {
27200
+ [es]() {
27062
27201
  if (!this.remain) return this.blockRemain && super.write(Buffer.alloc(this.blockRemain)), this[pt3]((t2) => t2 ? this.emit("error", t2) : this.end());
27063
27202
  if (!this.buf) throw new Error("buffer lost somehow in ONDRAIN");
27064
- this.offset >= this.length && (this.buf = Buffer.allocUnsafe(Math.min(this.blockRemain, this.buf.length)), this.offset = 0), this.length = this.buf.length - this.offset, this[ti]();
27203
+ this.offset >= this.length && (this.buf = Buffer.allocUnsafe(Math.min(this.blockRemain, this.buf.length)), this.offset = 0), this.length = this.buf.length - this.offset, this[ii]();
27065
27204
  }
27066
27205
  };
27067
- var si = class extends de2 {
27206
+ var ni = class extends de2 {
27068
27207
  sync = true;
27069
- [Qi]() {
27070
- this[ei](fs.lstatSync(this.absolute));
27208
+ [ss]() {
27209
+ this[si](fs.lstatSync(this.absolute));
27071
27210
  }
27072
- [ji]() {
27073
- this[ts](fs.readlinkSync(this.absolute));
27211
+ [is]() {
27212
+ this[ns](fs.readlinkSync(this.absolute));
27074
27213
  }
27075
- [es]() {
27076
- this[is](fs.openSync(this.absolute, "r"));
27214
+ [os2]() {
27215
+ this[hs](fs.openSync(this.absolute, "r"));
27077
27216
  }
27078
- [ti]() {
27217
+ [ii]() {
27079
27218
  let t2 = true;
27080
27219
  try {
27081
27220
  let { fd: e, buf: i2, offset: r, length: n2, pos: o2 } = this;
27082
27221
  if (e === void 0 || i2 === void 0) throw new Error("fd and buf must be set in READ method");
27083
27222
  let h3 = fs.readSync(e, i2, r, n2, o2);
27084
- this[Ji](h3), t2 = false;
27223
+ this[rs](h3), t2 = false;
27085
27224
  } finally {
27086
27225
  if (t2) try {
27087
27226
  this[pt3](() => {
@@ -27090,7 +27229,7 @@ var si = class extends de2 {
27090
27229
  }
27091
27230
  }
27092
27231
  }
27093
- [ss](t2) {
27232
+ [as](t2) {
27094
27233
  t2();
27095
27234
  }
27096
27235
  [pt3](t2 = () => {
@@ -27098,7 +27237,7 @@ var si = class extends de2 {
27098
27237
  this.fd !== void 0 && fs.closeSync(this.fd), t2();
27099
27238
  }
27100
27239
  };
27101
- var ri = class extends D3 {
27240
+ var oi = class extends A {
27102
27241
  blockLen = 0;
27103
27242
  blockRemain = 0;
27104
27243
  buf = 0;
@@ -27127,29 +27266,29 @@ var ri = class extends D3 {
27127
27266
  size;
27128
27267
  onWriteEntry;
27129
27268
  warn(t2, e, i2 = {}) {
27130
- return Lt2(this, t2, e, i2);
27269
+ return Dt(this, t2, e, i2);
27131
27270
  }
27132
27271
  constructor(t2, e = {}) {
27133
- let i2 = re2(e);
27272
+ let i2 = se2(e);
27134
27273
  super(), this.preservePaths = !!i2.preservePaths, this.portable = !!i2.portable, this.strict = !!i2.strict, this.noPax = !!i2.noPax, this.noMtime = !!i2.noMtime, this.onWriteEntry = i2.onWriteEntry, this.readEntry = t2;
27135
27274
  let { type: r } = t2;
27136
27275
  if (r === "Unsupported") throw new Error("writing entry that should be ignored");
27137
- this.type = r, this.type === "Directory" && this.portable && (this.noMtime = true), this.prefix = i2.prefix, this.path = f(t2.path), this.mode = t2.mode !== void 0 ? this[ii](t2.mode) : void 0, this.uid = this.portable ? void 0 : t2.uid, this.gid = this.portable ? void 0 : t2.gid, this.uname = this.portable ? void 0 : t2.uname, this.gname = this.portable ? void 0 : t2.gname, this.size = t2.size, this.mtime = this.noMtime ? void 0 : i2.mtime || t2.mtime, this.atime = this.portable ? void 0 : t2.atime, this.ctime = this.portable ? void 0 : t2.ctime, this.linkpath = t2.linkpath !== void 0 ? f(t2.linkpath) : void 0, typeof i2.onwarn == "function" && this.on("warn", i2.onwarn);
27276
+ this.type = r, this.type === "Directory" && this.portable && (this.noMtime = true), this.prefix = i2.prefix, this.path = f(t2.path), this.mode = t2.mode !== void 0 ? this[ri](t2.mode) : void 0, this.uid = this.portable ? void 0 : t2.uid, this.gid = this.portable ? void 0 : t2.gid, this.uname = this.portable ? void 0 : t2.uname, this.gname = this.portable ? void 0 : t2.gname, this.size = t2.size, this.mtime = this.noMtime ? void 0 : i2.mtime || t2.mtime, this.atime = this.portable ? void 0 : t2.atime, this.ctime = this.portable ? void 0 : t2.ctime, this.linkpath = t2.linkpath !== void 0 ? f(t2.linkpath) : void 0, typeof i2.onwarn == "function" && this.on("warn", i2.onwarn);
27138
27277
  let n2 = false;
27139
27278
  if (!this.preservePaths) {
27140
27279
  let [h3, a2] = ce2(this.path);
27141
27280
  h3 && typeof a2 == "string" && (this.path = a2, n2 = h3);
27142
27281
  }
27143
- this.remain = t2.size, this.blockRemain = t2.startBlockSize, this.onWriteEntry?.(this), this.header = new F({ path: this[X3](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[X3](this.linkpath) : this.linkpath, mode: this.mode, uid: this.portable ? void 0 : this.uid, gid: this.portable ? void 0 : this.gid, size: this.size, mtime: this.noMtime ? void 0 : this.mtime, type: this.type, uname: this.portable ? void 0 : this.uname, atime: this.portable ? void 0 : this.atime, ctime: this.portable ? void 0 : this.ctime }), n2 && this.warn("TAR_ENTRY_INFO", `stripping ${n2} from absolute path`, { entry: this, path: n2 + this.path }), this.header.encode() && !this.noPax && super.write(new ct2({ atime: this.portable ? void 0 : this.atime, ctime: this.portable ? void 0 : this.ctime, gid: this.portable ? void 0 : this.gid, mtime: this.noMtime ? void 0 : this.mtime, path: this[X3](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[X3](this.linkpath) : this.linkpath, size: this.size, uid: this.portable ? void 0 : this.uid, uname: this.portable ? void 0 : this.uname, dev: this.portable ? void 0 : this.readEntry.dev, ino: this.portable ? void 0 : this.readEntry.ino, nlink: this.portable ? void 0 : this.readEntry.nlink }).encode());
27282
+ this.remain = t2.size, this.blockRemain = t2.startBlockSize, this.onWriteEntry?.(this), this.header = new F({ path: this[q3](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[q3](this.linkpath) : this.linkpath, mode: this.mode, uid: this.portable ? void 0 : this.uid, gid: this.portable ? void 0 : this.gid, size: this.size, mtime: this.noMtime ? void 0 : this.mtime, type: this.type, uname: this.portable ? void 0 : this.uname, atime: this.portable ? void 0 : this.atime, ctime: this.portable ? void 0 : this.ctime }), n2 && this.warn("TAR_ENTRY_INFO", `stripping ${n2} from absolute path`, { entry: this, path: n2 + this.path }), this.header.encode() && !this.noPax && super.write(new ft3({ atime: this.portable ? void 0 : this.atime, ctime: this.portable ? void 0 : this.ctime, gid: this.portable ? void 0 : this.gid, mtime: this.noMtime ? void 0 : this.mtime, path: this[q3](this.path), linkpath: this.type === "Link" && this.linkpath !== void 0 ? this[q3](this.linkpath) : this.linkpath, size: this.size, uid: this.portable ? void 0 : this.uid, uname: this.portable ? void 0 : this.uname, dev: this.portable ? void 0 : this.readEntry.dev, ino: this.portable ? void 0 : this.readEntry.ino, nlink: this.portable ? void 0 : this.readEntry.nlink }).encode());
27144
27283
  let o2 = this.header?.block;
27145
27284
  if (!o2) throw new Error("failed to encode header");
27146
27285
  super.write(o2), t2.pipe(this);
27147
27286
  }
27148
- [X3](t2) {
27149
- return Js(t2, this.prefix);
27287
+ [q3](t2) {
27288
+ return rr(t2, this.prefix);
27150
27289
  }
27151
- [ii](t2) {
27152
- return Vi(t2, this.type === "Directory", this.portable);
27290
+ [ri](t2) {
27291
+ return Ji(t2, this.type === "Directory", this.portable);
27153
27292
  }
27154
27293
  write(t2, e, i2) {
27155
27294
  typeof e == "function" && (i2 = e, e = void 0), typeof t2 == "string" && (t2 = Buffer.from(t2, typeof e == "string" ? e : "utf8"));
@@ -27161,8 +27300,8 @@ var ri = class extends D3 {
27161
27300
  return this.blockRemain && super.write(Buffer.alloc(this.blockRemain)), typeof t2 == "function" && (i2 = t2, e = void 0, t2 = void 0), typeof e == "function" && (i2 = e, e = void 0), typeof t2 == "string" && (t2 = Buffer.from(t2, e ?? "utf8")), i2 && this.once("finish", i2), t2 ? super.end(t2, i2) : super.end(i2), this;
27162
27301
  }
27163
27302
  };
27164
- var Mn = (s3) => s3.isFile() ? "File" : s3.isDirectory() ? "Directory" : s3.isSymbolicLink() ? "SymbolicLink" : "Unsupported";
27165
- var ni = class s2 {
27303
+ var Gn = (s3) => s3.isFile() ? "File" : s3.isDirectory() ? "Directory" : s3.isSymbolicLink() ? "SymbolicLink" : "Unsupported";
27304
+ var hi = class s2 {
27166
27305
  tail;
27167
27306
  head;
27168
27307
  length = 0;
@@ -27193,11 +27332,11 @@ var ni = class s2 {
27193
27332
  t2.list = this, t2.prev = e, e && (e.next = t2), this.tail = t2, this.head || (this.head = t2), this.length++;
27194
27333
  }
27195
27334
  push(...t2) {
27196
- for (let e = 0, i2 = t2.length; e < i2; e++) Pn(this, t2[e]);
27335
+ for (let e = 0, i2 = t2.length; e < i2; e++) Yn(this, t2[e]);
27197
27336
  return this.length;
27198
27337
  }
27199
27338
  unshift(...t2) {
27200
- for (var e = 0, i2 = t2.length; e < i2; e++) zn(this, t2[e]);
27339
+ for (var e = 0, i2 = t2.length; e < i2; e++) Kn(this, t2[e]);
27201
27340
  return this.length;
27202
27341
  }
27203
27342
  pop() {
@@ -27293,7 +27432,7 @@ var ni = class s2 {
27293
27432
  let n2 = [];
27294
27433
  for (let o2 = 0; r && o2 < e; o2++) n2.push(r.value), r = this.removeNode(r);
27295
27434
  r ? r !== this.tail && (r = r.prev) : r = this.tail;
27296
- for (let o2 of i2) r = Bn(this, r, o2);
27435
+ for (let o2 of i2) r = Zn(this, r, o2);
27297
27436
  return n2;
27298
27437
  }
27299
27438
  reverse() {
@@ -27305,17 +27444,17 @@ var ni = class s2 {
27305
27444
  return this.head = e, this.tail = t2, this;
27306
27445
  }
27307
27446
  };
27308
- function Bn(s3, t2, e) {
27309
- let i2 = t2, r = t2 ? t2.next : s3.head, n2 = new ue2(e, i2, r, s3);
27447
+ function Zn(s3, t2, e) {
27448
+ let i2 = t2, r = t2 ? t2.next : s3.head, n2 = new me2(e, i2, r, s3);
27310
27449
  return n2.next === void 0 && (s3.tail = n2), n2.prev === void 0 && (s3.head = n2), s3.length++, n2;
27311
27450
  }
27312
- function Pn(s3, t2) {
27313
- s3.tail = new ue2(t2, s3.tail, void 0, s3), s3.head || (s3.head = s3.tail), s3.length++;
27451
+ function Yn(s3, t2) {
27452
+ s3.tail = new me2(t2, s3.tail, void 0, s3), s3.head || (s3.head = s3.tail), s3.length++;
27314
27453
  }
27315
- function zn(s3, t2) {
27316
- s3.head = new ue2(t2, void 0, s3.head, s3), s3.tail || (s3.tail = s3.head), s3.length++;
27454
+ function Kn(s3, t2) {
27455
+ s3.head = new me2(t2, void 0, s3.head, s3), s3.tail || (s3.tail = s3.head), s3.length++;
27317
27456
  }
27318
- var ue2 = class {
27457
+ var me2 = class {
27319
27458
  list;
27320
27459
  next;
27321
27460
  prev;
@@ -27324,41 +27463,43 @@ var ue2 = class {
27324
27463
  this.list = r, this.value = t2, e ? (e.next = this, this.prev = e) : this.prev = void 0, i2 ? (i2.prev = this, this.next = i2) : this.next = void 0;
27325
27464
  }
27326
27465
  };
27327
- var di = class {
27466
+ var pi = class {
27328
27467
  path;
27329
27468
  absolute;
27330
27469
  entry;
27331
27470
  stat;
27332
27471
  readdir;
27333
27472
  pending = false;
27473
+ pendingLink = false;
27334
27474
  ignore = false;
27335
27475
  piped = false;
27336
27476
  constructor(t2, e) {
27337
27477
  this.path = t2 || "./", this.absolute = e;
27338
27478
  }
27339
27479
  };
27340
- var tr = Buffer.alloc(1024);
27341
- var oi = Symbol("onStat");
27342
- var me2 = Symbol("ended");
27480
+ var nr = Buffer.alloc(1024);
27481
+ var li = Symbol("onStat");
27482
+ var ue2 = Symbol("ended");
27343
27483
  var W3 = Symbol("queue");
27344
- var Ct3 = Symbol("current");
27484
+ var pe2 = Symbol("pendingLinks");
27485
+ var Et3 = Symbol("current");
27345
27486
  var Ft3 = Symbol("process");
27346
- var pe2 = Symbol("processing");
27347
- var rs = Symbol("processJob");
27487
+ var Ee2 = Symbol("processing");
27488
+ var ai = Symbol("processJob");
27348
27489
  var G2 = Symbol("jobs");
27349
- var ns = Symbol("jobDone");
27350
- var hi = Symbol("addFSEntry");
27351
- var er = Symbol("addTarEntry");
27352
- var as = Symbol("stat");
27353
- var ls = Symbol("readdir");
27354
- var ai = Symbol("onreaddir");
27355
- var li = Symbol("pipe");
27356
- var ir = Symbol("entry");
27357
- var os2 = Symbol("entryOpt");
27358
- var ci = Symbol("writeEntryClass");
27359
- var rr = Symbol("write");
27360
- var hs = Symbol("ondrain");
27361
- var Et3 = class extends D3 {
27490
+ var ls = Symbol("jobDone");
27491
+ var ci = Symbol("addFSEntry");
27492
+ var or = Symbol("addTarEntry");
27493
+ var ds = Symbol("stat");
27494
+ var ms = Symbol("readdir");
27495
+ var fi = Symbol("onreaddir");
27496
+ var di = Symbol("pipe");
27497
+ var hr = Symbol("entry");
27498
+ var cs = Symbol("entryOpt");
27499
+ var mi = Symbol("writeEntryClass");
27500
+ var lr = Symbol("write");
27501
+ var fs10 = Symbol("ondrain");
27502
+ var wt2 = class extends A {
27362
27503
  sync = false;
27363
27504
  opt;
27364
27505
  cwd;
@@ -27379,123 +27520,139 @@ var Et3 = class extends D3 {
27379
27520
  mtime;
27380
27521
  filter;
27381
27522
  jobs;
27382
- [ci];
27523
+ [mi];
27383
27524
  onWriteEntry;
27384
27525
  [W3];
27526
+ [pe2] = /* @__PURE__ */ new Map();
27385
27527
  [G2] = 0;
27386
- [pe2] = false;
27387
- [me2] = false;
27528
+ [Ee2] = false;
27529
+ [ue2] = false;
27388
27530
  constructor(t2 = {}) {
27389
- if (super(), this.opt = t2, this.file = t2.file || "", this.cwd = t2.cwd || process.cwd(), this.maxReadSize = t2.maxReadSize, this.preservePaths = !!t2.preservePaths, this.strict = !!t2.strict, this.noPax = !!t2.noPax, this.prefix = f(t2.prefix || ""), this.linkCache = t2.linkCache || /* @__PURE__ */ new Map(), this.statCache = t2.statCache || /* @__PURE__ */ new Map(), this.readdirCache = t2.readdirCache || /* @__PURE__ */ new Map(), this.onWriteEntry = t2.onWriteEntry, this[ci] = de2, typeof t2.onwarn == "function" && this.on("warn", t2.onwarn), this.portable = !!t2.portable, t2.gzip || t2.brotli || t2.zstd) {
27531
+ if (super(), this.opt = t2, this.file = t2.file || "", this.cwd = t2.cwd || process.cwd(), this.maxReadSize = t2.maxReadSize, this.preservePaths = !!t2.preservePaths, this.strict = !!t2.strict, this.noPax = !!t2.noPax, this.prefix = f(t2.prefix || ""), this.linkCache = t2.linkCache || /* @__PURE__ */ new Map(), this.statCache = t2.statCache || /* @__PURE__ */ new Map(), this.readdirCache = t2.readdirCache || /* @__PURE__ */ new Map(), this.onWriteEntry = t2.onWriteEntry, this[mi] = de2, typeof t2.onwarn == "function" && this.on("warn", t2.onwarn), this.portable = !!t2.portable, t2.gzip || t2.brotli || t2.zstd) {
27390
27532
  if ((t2.gzip ? 1 : 0) + (t2.brotli ? 1 : 0) + (t2.zstd ? 1 : 0) > 1) throw new TypeError("gzip, brotli, zstd are mutually exclusive");
27391
- if (t2.gzip && (typeof t2.gzip != "object" && (t2.gzip = {}), this.portable && (t2.gzip.portable = true), this.zip = new Pe2(t2.gzip)), t2.brotli && (typeof t2.brotli != "object" && (t2.brotli = {}), this.zip = new He2(t2.brotli)), t2.zstd && (typeof t2.zstd != "object" && (t2.zstd = {}), this.zip = new Ze(t2.zstd)), !this.zip) throw new Error("impossible");
27533
+ if (t2.gzip && (typeof t2.gzip != "object" && (t2.gzip = {}), this.portable && (t2.gzip.portable = true), this.zip = new ze2(t2.gzip)), t2.brotli && (typeof t2.brotli != "object" && (t2.brotli = {}), this.zip = new We2(t2.brotli)), t2.zstd && (typeof t2.zstd != "object" && (t2.zstd = {}), this.zip = new Ye(t2.zstd)), !this.zip) throw new Error("impossible");
27392
27534
  let e = this.zip;
27393
- e.on("data", (i2) => super.write(i2)), e.on("end", () => super.end()), e.on("drain", () => this[hs]()), this.on("resume", () => e.resume());
27394
- } else this.on("drain", this[hs]);
27395
- this.noDirRecurse = !!t2.noDirRecurse, this.follow = !!t2.follow, this.noMtime = !!t2.noMtime, t2.mtime && (this.mtime = t2.mtime), this.filter = typeof t2.filter == "function" ? t2.filter : () => true, this[W3] = new ni(), this[G2] = 0, this.jobs = Number(t2.jobs) || 4, this[pe2] = false, this[me2] = false;
27535
+ e.on("data", (i2) => super.write(i2)), e.on("end", () => super.end()), e.on("drain", () => this[fs10]()), this.on("resume", () => e.resume());
27536
+ } else this.on("drain", this[fs10]);
27537
+ this.noDirRecurse = !!t2.noDirRecurse, this.follow = !!t2.follow, this.noMtime = !!t2.noMtime, t2.mtime && (this.mtime = t2.mtime), this.filter = typeof t2.filter == "function" ? t2.filter : () => true, this[W3] = new hi(), this[G2] = 0, this.jobs = Number(t2.jobs) || 4, this[Ee2] = false, this[ue2] = false;
27396
27538
  }
27397
- [rr](t2) {
27539
+ [lr](t2) {
27398
27540
  return super.write(t2);
27399
27541
  }
27400
27542
  add(t2) {
27401
27543
  return this.write(t2), this;
27402
27544
  }
27403
27545
  end(t2, e, i2) {
27404
- return typeof t2 == "function" && (i2 = t2, t2 = void 0), typeof e == "function" && (i2 = e, e = void 0), t2 && this.add(t2), this[me2] = true, this[Ft3](), i2 && i2(), this;
27546
+ return typeof t2 == "function" && (i2 = t2, t2 = void 0), typeof e == "function" && (i2 = e, e = void 0), t2 && this.add(t2), this[ue2] = true, this[Ft3](), i2 && i2(), this;
27405
27547
  }
27406
27548
  write(t2) {
27407
- if (this[me2]) throw new Error("write after end");
27408
- return t2 instanceof Yt ? this[er](t2) : this[hi](t2), this.flowing;
27549
+ if (this[ue2]) throw new Error("write after end");
27550
+ return typeof t2 == "string" ? this[ci](t2) : this[or](t2), this.flowing;
27409
27551
  }
27410
- [er](t2) {
27552
+ [or](t2) {
27411
27553
  let e = f(path15.resolve(this.cwd, t2.path));
27412
27554
  if (!this.filter(t2.path, t2)) t2.resume();
27413
27555
  else {
27414
- let i2 = new di(t2.path, e);
27415
- i2.entry = new ri(t2, this[os2](i2)), i2.entry.on("end", () => this[ns](i2)), this[G2] += 1, this[W3].push(i2);
27556
+ let i2 = new pi(t2.path, e);
27557
+ i2.entry = new oi(t2, this[cs](i2)), i2.entry.on("end", () => this[ls](i2)), this[G2] += 1, this[W3].push(i2);
27416
27558
  }
27417
27559
  this[Ft3]();
27418
27560
  }
27419
- [hi](t2) {
27561
+ [ci](t2) {
27420
27562
  let e = f(path15.resolve(this.cwd, t2));
27421
- this[W3].push(new di(t2, e)), this[Ft3]();
27563
+ this[W3].push(new pi(t2, e)), this[Ft3]();
27422
27564
  }
27423
- [as](t2) {
27565
+ [ds](t2) {
27424
27566
  t2.pending = true, this[G2] += 1;
27425
27567
  let e = this.follow ? "stat" : "lstat";
27426
27568
  fs[e](t2.absolute, (i2, r) => {
27427
- t2.pending = false, this[G2] -= 1, i2 ? this.emit("error", i2) : this[oi](t2, r);
27569
+ t2.pending = false, this[G2] -= 1, i2 ? this.emit("error", i2) : this[li](t2, r);
27428
27570
  });
27429
27571
  }
27430
- [oi](t2, e) {
27431
- this.statCache.set(t2.absolute, e), t2.stat = e, this.filter(t2.path, e) ? e.isFile() && e.nlink > 1 && t2 === this[Ct3] && !this.linkCache.get(`${e.dev}:${e.ino}`) && !this.sync && this[rs](t2) : t2.ignore = true, this[Ft3]();
27572
+ [li](t2, e) {
27573
+ if (this.statCache.set(t2.absolute, e), t2.stat = e, !this.filter(t2.path, e)) t2.ignore = true;
27574
+ else if (e.isFile() && e.nlink > 1 && !this.linkCache.get(`${e.dev}:${e.ino}`) && !this.sync) if (t2 === this[Et3]) this[ai](t2);
27575
+ else {
27576
+ let i2 = `${e.dev}:${e.ino}`, r = this[pe2].get(i2);
27577
+ r ? r.push(t2) : this[pe2].set(i2, [t2]), t2.pendingLink = true, t2.pending = true;
27578
+ }
27579
+ this[Ft3]();
27432
27580
  }
27433
- [ls](t2) {
27581
+ [ms](t2) {
27434
27582
  t2.pending = true, this[G2] += 1, fs.readdir(t2.absolute, (e, i2) => {
27435
27583
  if (t2.pending = false, this[G2] -= 1, e) return this.emit("error", e);
27436
- this[ai](t2, i2);
27584
+ this[fi](t2, i2);
27437
27585
  });
27438
27586
  }
27439
- [ai](t2, e) {
27587
+ [fi](t2, e) {
27440
27588
  this.readdirCache.set(t2.absolute, e), t2.readdir = e, this[Ft3]();
27441
27589
  }
27442
27590
  [Ft3]() {
27443
- if (!this[pe2]) {
27444
- this[pe2] = true;
27445
- for (let t2 = this[W3].head; t2 && this[G2] < this.jobs; t2 = t2.next) if (this[rs](t2.value), t2.value.ignore) {
27591
+ if (!this[Ee2]) {
27592
+ this[Ee2] = true;
27593
+ for (let t2 = this[W3].head; t2 && this[G2] < this.jobs; t2 = t2.next) if (this[ai](t2.value), t2.value.ignore) {
27446
27594
  let e = t2.next;
27447
27595
  this[W3].removeNode(t2), t2.next = e;
27448
27596
  }
27449
- this[pe2] = false, this[me2] && this[W3].length === 0 && this[G2] === 0 && (this.zip ? this.zip.end(tr) : (super.write(tr), super.end()));
27597
+ this[Ee2] = false, this[ue2] && this[W3].length === 0 && this[G2] === 0 && (this.zip ? this.zip.end(nr) : (super.write(nr), super.end()));
27450
27598
  }
27451
27599
  }
27452
- get [Ct3]() {
27600
+ get [Et3]() {
27453
27601
  return this[W3] && this[W3].head && this[W3].head.value;
27454
27602
  }
27455
- [ns](t2) {
27456
- this[W3].shift(), this[G2] -= 1, this[Ft3]();
27603
+ [ls](t2) {
27604
+ this[W3].shift(), this[G2] -= 1;
27605
+ let { stat: e } = t2;
27606
+ if (e && e.isFile() && e.nlink > 1) {
27607
+ let i2 = `${e.dev}:${e.ino}`, r = this[pe2].get(i2);
27608
+ if (r) {
27609
+ this[pe2].delete(i2);
27610
+ for (let n2 of r) n2.pending = false, this[ai](n2);
27611
+ }
27612
+ }
27613
+ this[Ft3]();
27457
27614
  }
27458
- [rs](t2) {
27459
- if (!t2.pending) {
27615
+ [ai](t2) {
27616
+ if (t2.pending && t2.pendingLink && t2 === this[Et3] && (t2.pending = false, t2.pendingLink = false), !t2.pending) {
27460
27617
  if (t2.entry) {
27461
- t2 === this[Ct3] && !t2.piped && this[li](t2);
27618
+ t2 === this[Et3] && !t2.piped && this[di](t2);
27462
27619
  return;
27463
27620
  }
27464
27621
  if (!t2.stat) {
27465
27622
  let e = this.statCache.get(t2.absolute);
27466
- e ? this[oi](t2, e) : this[as](t2);
27623
+ e ? this[li](t2, e) : this[ds](t2);
27467
27624
  }
27468
27625
  if (t2.stat && !t2.ignore) {
27469
27626
  if (!this.noDirRecurse && t2.stat.isDirectory() && !t2.readdir) {
27470
27627
  let e = this.readdirCache.get(t2.absolute);
27471
- if (e ? this[ai](t2, e) : this[ls](t2), !t2.readdir) return;
27628
+ if (e ? this[fi](t2, e) : this[ms](t2), !t2.readdir) return;
27472
27629
  }
27473
- if (t2.entry = this[ir](t2), !t2.entry) {
27630
+ if (t2.entry = this[hr](t2), !t2.entry) {
27474
27631
  t2.ignore = true;
27475
27632
  return;
27476
27633
  }
27477
- t2 === this[Ct3] && !t2.piped && this[li](t2);
27634
+ t2 === this[Et3] && !t2.piped && this[di](t2);
27478
27635
  }
27479
27636
  }
27480
27637
  }
27481
- [os2](t2) {
27638
+ [cs](t2) {
27482
27639
  return { onwarn: (e, i2, r) => this.warn(e, i2, r), noPax: this.noPax, cwd: this.cwd, absolute: t2.absolute, preservePaths: this.preservePaths, maxReadSize: this.maxReadSize, strict: this.strict, portable: this.portable, linkCache: this.linkCache, statCache: this.statCache, noMtime: this.noMtime, mtime: this.mtime, prefix: this.prefix, onWriteEntry: this.onWriteEntry };
27483
27640
  }
27484
- [ir](t2) {
27641
+ [hr](t2) {
27485
27642
  this[G2] += 1;
27486
27643
  try {
27487
- return new this[ci](t2.path, this[os2](t2)).on("end", () => this[ns](t2)).on("error", (i2) => this.emit("error", i2));
27644
+ return new this[mi](t2.path, this[cs](t2)).on("end", () => this[ls](t2)).on("error", (i2) => this.emit("error", i2));
27488
27645
  } catch (e) {
27489
27646
  this.emit("error", e);
27490
27647
  }
27491
27648
  }
27492
- [hs]() {
27493
- this[Ct3] && this[Ct3].entry && this[Ct3].entry.resume();
27649
+ [fs10]() {
27650
+ this[Et3] && this[Et3].entry && this[Et3].entry.resume();
27494
27651
  }
27495
- [li](t2) {
27652
+ [di](t2) {
27496
27653
  t2.piped = true, t2.readdir && t2.readdir.forEach((r) => {
27497
27654
  let n2 = t2.path, o2 = n2 === "./" ? "" : n2.replace(/\/*$/, "/");
27498
- this[hi](o2 + r);
27655
+ this[ci](o2 + r);
27499
27656
  });
27500
27657
  let e = t2.entry, i2 = this.zip;
27501
27658
  if (!e) throw new Error("cannot pipe without source");
@@ -27509,137 +27666,137 @@ var Et3 = class extends D3 {
27509
27666
  return this.zip && this.zip.pause(), super.pause();
27510
27667
  }
27511
27668
  warn(t2, e, i2 = {}) {
27512
- Lt2(this, t2, e, i2);
27669
+ Dt(this, t2, e, i2);
27513
27670
  }
27514
27671
  };
27515
- var kt3 = class extends Et3 {
27672
+ var kt3 = class extends wt2 {
27516
27673
  sync = true;
27517
27674
  constructor(t2) {
27518
- super(t2), this[ci] = si;
27675
+ super(t2), this[mi] = ni;
27519
27676
  }
27520
27677
  pause() {
27521
27678
  }
27522
27679
  resume() {
27523
27680
  }
27524
- [as](t2) {
27681
+ [ds](t2) {
27525
27682
  let e = this.follow ? "statSync" : "lstatSync";
27526
- this[oi](t2, fs[e](t2.absolute));
27683
+ this[li](t2, fs[e](t2.absolute));
27527
27684
  }
27528
- [ls](t2) {
27529
- this[ai](t2, fs.readdirSync(t2.absolute));
27685
+ [ms](t2) {
27686
+ this[fi](t2, fs.readdirSync(t2.absolute));
27530
27687
  }
27531
- [li](t2) {
27688
+ [di](t2) {
27532
27689
  let e = t2.entry, i2 = this.zip;
27533
27690
  if (t2.readdir && t2.readdir.forEach((r) => {
27534
27691
  let n2 = t2.path, o2 = n2 === "./" ? "" : n2.replace(/\/*$/, "/");
27535
- this[hi](o2 + r);
27692
+ this[ci](o2 + r);
27536
27693
  }), !e) throw new Error("Cannot pipe without source");
27537
27694
  i2 ? e.on("data", (r) => {
27538
27695
  i2.write(r);
27539
27696
  }) : e.on("data", (r) => {
27540
- super[rr](r);
27697
+ super[lr](r);
27541
27698
  });
27542
27699
  }
27543
27700
  };
27544
- var Un = (s3, t2) => {
27701
+ var Vn = (s3, t2) => {
27545
27702
  let e = new kt3(s3), i2 = new Wt3(s3.file, { mode: s3.mode || 438 });
27546
- e.pipe(i2), or(e, t2);
27703
+ e.pipe(i2), fr(e, t2);
27547
27704
  };
27548
- var Hn = (s3, t2) => {
27549
- let e = new Et3(s3), i2 = new tt2(s3.file, { mode: s3.mode || 438 });
27705
+ var $n = (s3, t2) => {
27706
+ let e = new wt2(s3), i2 = new et2(s3.file, { mode: s3.mode || 438 });
27550
27707
  e.pipe(i2);
27551
27708
  let r = new Promise((n2, o2) => {
27552
27709
  i2.on("error", o2), i2.on("close", n2), e.on("error", o2);
27553
27710
  });
27554
- return hr(e, t2).catch((n2) => e.emit("error", n2)), r;
27711
+ return dr(e, t2).catch((n2) => e.emit("error", n2)), r;
27555
27712
  };
27556
- var or = (s3, t2) => {
27713
+ var fr = (s3, t2) => {
27557
27714
  t2.forEach((e) => {
27558
- e.charAt(0) === "@" ? It3({ file: path15.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
27715
+ e.charAt(0) === "@" ? Ct3({ file: path15.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
27559
27716
  }), s3.end();
27560
27717
  };
27561
- var hr = async (s3, t2) => {
27562
- for (let e of t2) e.charAt(0) === "@" ? await It3({ file: path15.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i2) => {
27718
+ var dr = async (s3, t2) => {
27719
+ for (let e of t2) e.charAt(0) === "@" ? await Ct3({ file: path15.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i2) => {
27563
27720
  s3.add(i2);
27564
27721
  } }) : s3.add(e);
27565
27722
  s3.end();
27566
27723
  };
27567
- var Wn = (s3, t2) => {
27724
+ var Xn = (s3, t2) => {
27568
27725
  let e = new kt3(s3);
27569
- return or(e, t2), e;
27726
+ return fr(e, t2), e;
27570
27727
  };
27571
- var Gn = (s3, t2) => {
27572
- let e = new Et3(s3);
27573
- return hr(e, t2).catch((i2) => e.emit("error", i2)), e;
27728
+ var qn = (s3, t2) => {
27729
+ let e = new wt2(s3);
27730
+ return dr(e, t2).catch((i2) => e.emit("error", i2)), e;
27574
27731
  };
27575
- K2(Un, Hn, Wn, Gn, (s3, t2) => {
27732
+ K2(Vn, $n, Xn, qn, (s3, t2) => {
27576
27733
  if (!t2?.length) throw new TypeError("no paths specified to add to archive");
27577
27734
  });
27578
- var Yn = process.env.__FAKE_PLATFORM__ || process.platform;
27579
- var fr = Yn === "win32";
27580
- var { O_CREAT: dr, O_NOFOLLOW: ar, O_TRUNC: ur, O_WRONLY: mr } = fs.constants;
27581
- var pr = Number(process.env.__FAKE_FS_O_FILENAME__) || fs.constants.UV_FS_O_FILEMAP || 0;
27582
- var Kn = fr && !!pr;
27583
- var Vn = 512 * 1024;
27584
- var $n = pr | ur | dr | mr;
27585
- var lr = !fr && typeof ar == "number" ? ar | ur | dr | mr : null;
27586
- var cs = lr !== null ? () => lr : Kn ? (s3) => s3 < Vn ? $n : "w" : () => "w";
27587
- var fs10 = (s3, t2, e) => {
27735
+ var Jn = process.env.__FAKE_PLATFORM__ || process.platform;
27736
+ var Er = Jn === "win32";
27737
+ var { O_CREAT: wr, O_NOFOLLOW: mr, O_TRUNC: Sr, O_WRONLY: yr } = fs.constants;
27738
+ var Rr = Number(process.env.__FAKE_FS_O_FILENAME__) || fs.constants.UV_FS_O_FILEMAP || 0;
27739
+ var jn = Er && !!Rr;
27740
+ var to = 512 * 1024;
27741
+ var eo = Rr | Sr | wr | yr;
27742
+ var ur = !Er && typeof mr == "number" ? mr | Sr | wr | yr : null;
27743
+ var us = ur !== null ? () => ur : jn ? (s3) => s3 < to ? eo : "w" : () => "w";
27744
+ var ps = (s3, t2, e) => {
27588
27745
  try {
27589
27746
  return fs.lchownSync(s3, t2, e);
27590
27747
  } catch (i2) {
27591
27748
  if (i2?.code !== "ENOENT") throw i2;
27592
27749
  }
27593
27750
  };
27594
- var ui = (s3, t2, e, i2) => {
27751
+ var Ei = (s3, t2, e, i2) => {
27595
27752
  fs.lchown(s3, t2, e, (r) => {
27596
27753
  i2(r && r?.code !== "ENOENT" ? r : null);
27597
27754
  });
27598
27755
  };
27599
- var Xn = (s3, t2, e, i2, r) => {
27600
- if (t2.isDirectory()) ds(path15.resolve(s3, t2.name), e, i2, (n2) => {
27756
+ var io = (s3, t2, e, i2, r) => {
27757
+ if (t2.isDirectory()) Es(path15.resolve(s3, t2.name), e, i2, (n2) => {
27601
27758
  if (n2) return r(n2);
27602
27759
  let o2 = path15.resolve(s3, t2.name);
27603
- ui(o2, e, i2, r);
27760
+ Ei(o2, e, i2, r);
27604
27761
  });
27605
27762
  else {
27606
27763
  let n2 = path15.resolve(s3, t2.name);
27607
- ui(n2, e, i2, r);
27764
+ Ei(n2, e, i2, r);
27608
27765
  }
27609
27766
  };
27610
- var ds = (s3, t2, e, i2) => {
27767
+ var Es = (s3, t2, e, i2) => {
27611
27768
  fs.readdir(s3, { withFileTypes: true }, (r, n2) => {
27612
27769
  if (r) {
27613
27770
  if (r.code === "ENOENT") return i2();
27614
27771
  if (r.code !== "ENOTDIR" && r.code !== "ENOTSUP") return i2(r);
27615
27772
  }
27616
- if (r || !n2.length) return ui(s3, t2, e, i2);
27773
+ if (r || !n2.length) return Ei(s3, t2, e, i2);
27617
27774
  let o2 = n2.length, h3 = null, a2 = (l) => {
27618
27775
  if (!h3) {
27619
27776
  if (l) return i2(h3 = l);
27620
- if (--o2 === 0) return ui(s3, t2, e, i2);
27777
+ if (--o2 === 0) return Ei(s3, t2, e, i2);
27621
27778
  }
27622
27779
  };
27623
- for (let l of n2) Xn(s3, l, t2, e, a2);
27780
+ for (let l of n2) io(s3, l, t2, e, a2);
27624
27781
  });
27625
27782
  };
27626
- var qn = (s3, t2, e, i2) => {
27627
- t2.isDirectory() && us(path15.resolve(s3, t2.name), e, i2), fs10(path15.resolve(s3, t2.name), e, i2);
27783
+ var so = (s3, t2, e, i2) => {
27784
+ t2.isDirectory() && ws(path15.resolve(s3, t2.name), e, i2), ps(path15.resolve(s3, t2.name), e, i2);
27628
27785
  };
27629
- var us = (s3, t2, e) => {
27786
+ var ws = (s3, t2, e) => {
27630
27787
  let i2;
27631
27788
  try {
27632
27789
  i2 = fs.readdirSync(s3, { withFileTypes: true });
27633
27790
  } catch (r) {
27634
27791
  let n2 = r;
27635
27792
  if (n2?.code === "ENOENT") return;
27636
- if (n2?.code === "ENOTDIR" || n2?.code === "ENOTSUP") return fs10(s3, t2, e);
27793
+ if (n2?.code === "ENOTDIR" || n2?.code === "ENOTSUP") return ps(s3, t2, e);
27637
27794
  throw n2;
27638
27795
  }
27639
- for (let r of i2) qn(s3, r, t2, e);
27640
- return fs10(s3, t2, e);
27796
+ for (let r of i2) so(s3, r, t2, e);
27797
+ return ps(s3, t2, e);
27641
27798
  };
27642
- var we2 = class extends Error {
27799
+ var Se2 = class extends Error {
27643
27800
  path;
27644
27801
  code;
27645
27802
  syscall = "chdir";
@@ -27650,7 +27807,7 @@ var we2 = class extends Error {
27650
27807
  return "CwdError";
27651
27808
  }
27652
27809
  };
27653
- var wt2 = class extends Error {
27810
+ var St2 = class extends Error {
27654
27811
  path;
27655
27812
  symlink;
27656
27813
  syscall = "symlink";
@@ -27662,97 +27819,97 @@ var wt2 = class extends Error {
27662
27819
  return "SymlinkError";
27663
27820
  }
27664
27821
  };
27665
- var Qn = (s3, t2) => {
27822
+ var no = (s3, t2) => {
27666
27823
  fs.stat(s3, (e, i2) => {
27667
- (e || !i2.isDirectory()) && (e = new we2(s3, e?.code || "ENOTDIR")), t2(e);
27824
+ (e || !i2.isDirectory()) && (e = new Se2(s3, e?.code || "ENOTDIR")), t2(e);
27668
27825
  });
27669
27826
  };
27670
- var Er = (s3, t2, e) => {
27827
+ var gr = (s3, t2, e) => {
27671
27828
  s3 = f(s3);
27672
- let i2 = t2.umask ?? 18, r = t2.mode | 448, n2 = (r & i2) !== 0, o2 = t2.uid, h3 = t2.gid, a2 = typeof o2 == "number" && typeof h3 == "number" && (o2 !== t2.processUid || h3 !== t2.processGid), l = t2.preserve, c3 = t2.unlink, d = f(t2.cwd), S2 = (E, x3) => {
27673
- E ? e(E) : x3 && a2 ? ds(x3, o2, h3, (xe2) => S2(xe2)) : n2 ? fs.chmod(s3, r, e) : e();
27829
+ let i2 = t2.umask ?? 18, r = t2.mode | 448, n2 = (r & i2) !== 0, o2 = t2.uid, h3 = t2.gid, a2 = typeof o2 == "number" && typeof h3 == "number" && (o2 !== t2.processUid || h3 !== t2.processGid), l = t2.preserve, c3 = t2.unlink, d = f(t2.cwd), y2 = (E, x3) => {
27830
+ E ? e(E) : x3 && a2 ? Es(x3, o2, h3, (Le2) => y2(Le2)) : n2 ? fs.chmod(s3, r, e) : e();
27674
27831
  };
27675
- if (s3 === d) return Qn(s3, S2);
27676
- if (l) return jn.mkdir(s3, { mode: r, recursive: true }).then((E) => S2(null, E ?? void 0), S2);
27677
- let N3 = f(path15.relative(d, s3)).split("/");
27678
- ms(d, N3, r, c3, d, void 0, S2);
27832
+ if (s3 === d) return no(s3, y2);
27833
+ if (l) return ro.mkdir(s3, { mode: r, recursive: true }).then((E) => y2(null, E ?? void 0), y2);
27834
+ let D3 = f(path15.relative(d, s3)).split("/");
27835
+ Ss(d, D3, r, c3, d, void 0, y2);
27679
27836
  };
27680
- var ms = (s3, t2, e, i2, r, n2, o2) => {
27837
+ var Ss = (s3, t2, e, i2, r, n2, o2) => {
27681
27838
  if (t2.length === 0) return o2(null, n2);
27682
27839
  let h3 = t2.shift(), a2 = f(path15.resolve(s3 + "/" + h3));
27683
- fs.mkdir(a2, e, wr(a2, t2, e, i2, r, n2, o2));
27840
+ fs.mkdir(a2, e, br(a2, t2, e, i2, r, n2, o2));
27684
27841
  };
27685
- var wr = (s3, t2, e, i2, r, n2, o2) => (h3) => {
27842
+ var br = (s3, t2, e, i2, r, n2, o2) => (h3) => {
27686
27843
  h3 ? fs.lstat(s3, (a2, l) => {
27687
27844
  if (a2) a2.path = a2.path && f(a2.path), o2(a2);
27688
- else if (l.isDirectory()) ms(s3, t2, e, i2, r, n2, o2);
27845
+ else if (l.isDirectory()) Ss(s3, t2, e, i2, r, n2, o2);
27689
27846
  else if (i2) fs.unlink(s3, (c3) => {
27690
27847
  if (c3) return o2(c3);
27691
- fs.mkdir(s3, e, wr(s3, t2, e, i2, r, n2, o2));
27848
+ fs.mkdir(s3, e, br(s3, t2, e, i2, r, n2, o2));
27692
27849
  });
27693
27850
  else {
27694
- if (l.isSymbolicLink()) return o2(new wt2(s3, s3 + "/" + t2.join("/")));
27851
+ if (l.isSymbolicLink()) return o2(new St2(s3, s3 + "/" + t2.join("/")));
27695
27852
  o2(h3);
27696
27853
  }
27697
- }) : (n2 = n2 || s3, ms(s3, t2, e, i2, r, n2, o2));
27854
+ }) : (n2 = n2 || s3, Ss(s3, t2, e, i2, r, n2, o2));
27698
27855
  };
27699
- var Jn = (s3) => {
27856
+ var oo = (s3) => {
27700
27857
  let t2 = false, e;
27701
27858
  try {
27702
27859
  t2 = fs.statSync(s3).isDirectory();
27703
27860
  } catch (i2) {
27704
27861
  e = i2?.code;
27705
27862
  } finally {
27706
- if (!t2) throw new we2(s3, e ?? "ENOTDIR");
27863
+ if (!t2) throw new Se2(s3, e ?? "ENOTDIR");
27707
27864
  }
27708
27865
  };
27709
- var Sr = (s3, t2) => {
27866
+ var _r = (s3, t2) => {
27710
27867
  s3 = f(s3);
27711
27868
  let e = t2.umask ?? 18, i2 = t2.mode | 448, r = (i2 & e) !== 0, n2 = t2.uid, o2 = t2.gid, h3 = typeof n2 == "number" && typeof o2 == "number" && (n2 !== t2.processUid || o2 !== t2.processGid), a2 = t2.preserve, l = t2.unlink, c3 = f(t2.cwd), d = (E) => {
27712
- E && h3 && us(E, n2, o2), r && fs.chmodSync(s3, i2);
27869
+ E && h3 && ws(E, n2, o2), r && fs.chmodSync(s3, i2);
27713
27870
  };
27714
- if (s3 === c3) return Jn(c3), d();
27871
+ if (s3 === c3) return oo(c3), d();
27715
27872
  if (a2) return d(fs.mkdirSync(s3, { mode: i2, recursive: true }) ?? void 0);
27716
- let T2 = f(path15.relative(c3, s3)).split("/"), N3;
27873
+ let T2 = f(path15.relative(c3, s3)).split("/"), D3;
27717
27874
  for (let E = T2.shift(), x3 = c3; E && (x3 += "/" + E); E = T2.shift()) {
27718
27875
  x3 = f(path15.resolve(x3));
27719
27876
  try {
27720
- fs.mkdirSync(x3, i2), N3 = N3 || x3;
27877
+ fs.mkdirSync(x3, i2), D3 = D3 || x3;
27721
27878
  } catch {
27722
- let xe2 = fs.lstatSync(x3);
27723
- if (xe2.isDirectory()) continue;
27879
+ let Le2 = fs.lstatSync(x3);
27880
+ if (Le2.isDirectory()) continue;
27724
27881
  if (l) {
27725
- fs.unlinkSync(x3), fs.mkdirSync(x3, i2), N3 = N3 || x3;
27882
+ fs.unlinkSync(x3), fs.mkdirSync(x3, i2), D3 = D3 || x3;
27726
27883
  continue;
27727
- } else if (xe2.isSymbolicLink()) return new wt2(x3, x3 + "/" + T2.join("/"));
27884
+ } else if (Le2.isSymbolicLink()) return new St2(x3, x3 + "/" + T2.join("/"));
27728
27885
  }
27729
27886
  }
27730
- return d(N3);
27887
+ return d(D3);
27731
27888
  };
27732
- var ps = /* @__PURE__ */ Object.create(null);
27733
- var yr = 1e4;
27734
- var $t3 = /* @__PURE__ */ new Set();
27735
- var Rr = (s3) => {
27736
- $t3.has(s3) ? $t3.delete(s3) : ps[s3] = s3.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"), $t3.add(s3);
27737
- let t2 = ps[s3], e = $t3.size - yr;
27738
- if (e > yr / 10) {
27739
- for (let i2 of $t3) if ($t3.delete(i2), delete ps[i2], --e <= 0) break;
27889
+ var ys = /* @__PURE__ */ Object.create(null);
27890
+ var Or = 1e4;
27891
+ var Vt3 = /* @__PURE__ */ new Set();
27892
+ var Tr = (s3) => {
27893
+ Vt3.has(s3) ? Vt3.delete(s3) : ys[s3] = s3.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"), Vt3.add(s3);
27894
+ let t2 = ys[s3], e = Vt3.size - Or;
27895
+ if (e > Or / 10) {
27896
+ for (let i2 of Vt3) if (Vt3.delete(i2), delete ys[i2], --e <= 0) break;
27740
27897
  }
27741
27898
  return t2;
27742
27899
  };
27743
- var to = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
27744
- var eo = to === "win32";
27745
- var io = (s3) => s3.split("/").slice(0, -1).reduce((e, i2) => {
27900
+ var ho = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
27901
+ var ao = ho === "win32";
27902
+ var lo = (s3) => s3.split("/").slice(0, -1).reduce((e, i2) => {
27746
27903
  let r = e.at(-1);
27747
27904
  return r !== void 0 && (i2 = join(r, i2)), e.push(i2 || "/"), e;
27748
27905
  }, []);
27749
- var Ei = class {
27906
+ var yi = class {
27750
27907
  #t = /* @__PURE__ */ new Map();
27751
27908
  #i = /* @__PURE__ */ new Map();
27752
27909
  #s = /* @__PURE__ */ new Set();
27753
27910
  reserve(t2, e) {
27754
- t2 = eo ? ["win32 parallelization disabled"] : t2.map((r) => mt3(join(Rr(r))));
27755
- let i2 = new Set(t2.map((r) => io(r)).reduce((r, n2) => r.concat(n2)));
27911
+ t2 = ao ? ["win32 parallelization disabled"] : t2.map((r) => ut(join(Tr(r))));
27912
+ let i2 = new Set(t2.map((r) => lo(r)).reduce((r, n2) => r.concat(n2)));
27756
27913
  this.#i.set(e, { dirs: i2, paths: t2 });
27757
27914
  for (let r of t2) {
27758
27915
  let n2 = this.#t.get(r);
@@ -27810,55 +27967,55 @@ var Ei = class {
27810
27967
  return this.#s.delete(t2), n2.forEach((o2) => this.#r(o2)), true;
27811
27968
  }
27812
27969
  };
27813
- var _r = () => process.umask();
27814
- var gr = Symbol("onEntry");
27815
- var ys = Symbol("checkFs");
27816
- var Or = Symbol("checkFs2");
27817
- var Rs = Symbol("isReusable");
27970
+ var Lr = () => process.umask();
27971
+ var Dr = Symbol("onEntry");
27972
+ var _s = Symbol("checkFs");
27973
+ var Nr = Symbol("checkFs2");
27974
+ var Os = Symbol("isReusable");
27818
27975
  var P2 = Symbol("makeFs");
27819
- var bs = Symbol("file");
27820
- var _s = Symbol("directory");
27821
- var Si = Symbol("link");
27822
- var Tr = Symbol("symlink");
27823
- var xr = Symbol("hardlink");
27824
- var ye2 = Symbol("ensureNoSymlink");
27825
- var Lr = Symbol("unsupported");
27826
- var Nr = Symbol("checkPath");
27827
- var Es = Symbol("stripAbsolutePath");
27828
- var St2 = Symbol("mkdir");
27976
+ var Ts = Symbol("file");
27977
+ var xs = Symbol("directory");
27978
+ var gi = Symbol("link");
27979
+ var Ar = Symbol("symlink");
27980
+ var Ir = Symbol("hardlink");
27981
+ var Re2 = Symbol("ensureNoSymlink");
27982
+ var Cr = Symbol("unsupported");
27983
+ var Fr = Symbol("checkPath");
27984
+ var Rs = Symbol("stripAbsolutePath");
27985
+ var yt3 = Symbol("mkdir");
27829
27986
  var O2 = Symbol("onError");
27830
- var wi = Symbol("pending");
27831
- var Ar = Symbol("pend");
27832
- var Xt = Symbol("unpend");
27833
- var ws = Symbol("ended");
27834
- var Ss = Symbol("maybeClose");
27835
- var gs = Symbol("skip");
27836
- var Re2 = Symbol("doChown");
27987
+ var Ri = Symbol("pending");
27988
+ var kr = Symbol("pend");
27989
+ var $t3 = Symbol("unpend");
27990
+ var gs = Symbol("ended");
27991
+ var bs = Symbol("maybeClose");
27992
+ var Ls = Symbol("skip");
27993
+ var ge2 = Symbol("doChown");
27837
27994
  var be2 = Symbol("uid");
27838
27995
  var _e2 = Symbol("gid");
27839
- var ge2 = Symbol("checkedCwd");
27840
- var ro = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
27841
- var Oe2 = ro === "win32";
27842
- var no = 1024;
27843
- var oo = (s3, t2) => {
27844
- if (!Oe2) return fs.unlink(s3, t2);
27996
+ var Oe2 = Symbol("checkedCwd");
27997
+ var fo = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
27998
+ var Te2 = fo === "win32";
27999
+ var mo = 1024;
28000
+ var uo = (s3, t2) => {
28001
+ if (!Te2) return fs.unlink(s3, t2);
27845
28002
  let e = s3 + ".DELETE." + randomBytes(16).toString("hex");
27846
28003
  fs.rename(s3, e, (i2) => {
27847
28004
  if (i2) return t2(i2);
27848
28005
  fs.unlink(e, t2);
27849
28006
  });
27850
28007
  };
27851
- var ho = (s3) => {
27852
- if (!Oe2) return fs.unlinkSync(s3);
28008
+ var po = (s3) => {
28009
+ if (!Te2) return fs.unlinkSync(s3);
27853
28010
  let t2 = s3 + ".DELETE." + randomBytes(16).toString("hex");
27854
28011
  fs.renameSync(s3, t2), fs.unlinkSync(t2);
27855
28012
  };
27856
- var Dr = (s3, t2, e) => s3 !== void 0 && s3 === s3 >>> 0 ? s3 : t2 !== void 0 && t2 === t2 >>> 0 ? t2 : e;
27857
- var qt = class extends st2 {
27858
- [ws] = false;
27859
- [ge2] = false;
27860
- [wi] = 0;
27861
- reservations = new Ei();
28013
+ var vr = (s3, t2, e) => s3 !== void 0 && s3 === s3 >>> 0 ? s3 : t2 !== void 0 && t2 === t2 >>> 0 ? t2 : e;
28014
+ var Xt = class extends rt2 {
28015
+ [gs] = false;
28016
+ [Oe2] = false;
28017
+ [Ri] = 0;
28018
+ reservations = new yi();
27862
28019
  transform;
27863
28020
  writable = true;
27864
28021
  readable = false;
@@ -27885,32 +28042,32 @@ var qt = class extends st2 {
27885
28042
  chmod;
27886
28043
  constructor(t2 = {}) {
27887
28044
  if (t2.ondone = () => {
27888
- this[ws] = true, this[Ss]();
28045
+ this[gs] = true, this[bs]();
27889
28046
  }, super(t2), this.transform = t2.transform, this.chmod = !!t2.chmod, typeof t2.uid == "number" || typeof t2.gid == "number") {
27890
28047
  if (typeof t2.uid != "number" || typeof t2.gid != "number") throw new TypeError("cannot set owner without number uid and gid");
27891
28048
  if (t2.preserveOwner) throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
27892
28049
  this.uid = t2.uid, this.gid = t2.gid, this.setOwner = true;
27893
28050
  } else this.uid = void 0, this.gid = void 0, this.setOwner = false;
27894
- this.preserveOwner = t2.preserveOwner === void 0 && typeof t2.uid != "number" ? !!(process.getuid && process.getuid() === 0) : !!t2.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : void 0, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : void 0, this.maxDepth = typeof t2.maxDepth == "number" ? t2.maxDepth : no, this.forceChown = t2.forceChown === true, this.win32 = !!t2.win32 || Oe2, this.newer = !!t2.newer, this.keep = !!t2.keep, this.noMtime = !!t2.noMtime, this.preservePaths = !!t2.preservePaths, this.unlink = !!t2.unlink, this.cwd = f(path15.resolve(t2.cwd || process.cwd())), this.strip = Number(t2.strip) || 0, this.processUmask = this.chmod ? typeof t2.processUmask == "number" ? t2.processUmask : _r() : 0, this.umask = typeof t2.umask == "number" ? t2.umask : this.processUmask, this.dmode = t2.dmode || 511 & ~this.umask, this.fmode = t2.fmode || 438 & ~this.umask, this.on("entry", (e) => this[gr](e));
28051
+ this.preserveOwner = t2.preserveOwner === void 0 && typeof t2.uid != "number" ? process.getuid?.() === 0 : !!t2.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : void 0, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : void 0, this.maxDepth = typeof t2.maxDepth == "number" ? t2.maxDepth : mo, this.forceChown = t2.forceChown === true, this.win32 = !!t2.win32 || Te2, this.newer = !!t2.newer, this.keep = !!t2.keep, this.noMtime = !!t2.noMtime, this.preservePaths = !!t2.preservePaths, this.unlink = !!t2.unlink, this.cwd = f(path15.resolve(t2.cwd || process.cwd())), this.strip = Number(t2.strip) || 0, this.processUmask = this.chmod ? typeof t2.processUmask == "number" ? t2.processUmask : Lr() : 0, this.umask = typeof t2.umask == "number" ? t2.umask : this.processUmask, this.dmode = t2.dmode || 511 & ~this.umask, this.fmode = t2.fmode || 438 & ~this.umask, this.on("entry", (e) => this[Dr](e));
27895
28052
  }
27896
28053
  warn(t2, e, i2 = {}) {
27897
28054
  return (t2 === "TAR_BAD_ARCHIVE" || t2 === "TAR_ABORT") && (i2.recoverable = false), super.warn(t2, e, i2);
27898
28055
  }
27899
- [Ss]() {
27900
- this[ws] && this[wi] === 0 && (this.emit("prefinish"), this.emit("finish"), this.emit("end"));
28056
+ [bs]() {
28057
+ this[gs] && this[Ri] === 0 && (this.emit("prefinish"), this.emit("finish"), this.emit("end"));
27901
28058
  }
27902
- [Es](t2, e) {
28059
+ [Rs](t2, e) {
27903
28060
  let i2 = t2[e], { type: r } = t2;
27904
28061
  if (!i2 || this.preservePaths) return true;
27905
28062
  let [n2, o2] = ce2(i2), h3 = o2.replaceAll(/\\/g, "/").split("/");
27906
- if (h3.includes("..") || Oe2 && /^[a-z]:\.\.$/i.test(h3[0] ?? "")) {
28063
+ if (h3.includes("..") || Te2 && /^[a-z]:\.\.$/i.test(h3[0] ?? "")) {
27907
28064
  if (e === "path" || r === "Link") return this.warn("TAR_ENTRY_ERROR", `${e} contains '..'`, { entry: t2, [e]: i2 }), false;
27908
28065
  let a2 = path15.posix.dirname(t2.path), l = path15.posix.normalize(path15.posix.join(a2, h3.join("/")));
27909
28066
  if (l.startsWith("../") || l === "..") return this.warn("TAR_ENTRY_ERROR", `${e} escapes extraction directory`, { entry: t2, [e]: i2 }), false;
27910
28067
  }
27911
28068
  return n2 && (t2[e] = String(o2), this.warn("TAR_ENTRY_INFO", `stripping ${n2} from absolute ${e}`, { entry: t2, [e]: i2 })), true;
27912
28069
  }
27913
- [Nr](t2) {
28070
+ [Fr](t2) {
27914
28071
  let e = f(t2.path), i2 = e.split("/");
27915
28072
  if (this.strip) {
27916
28073
  if (i2.length < this.strip) return false;
@@ -27922,20 +28079,20 @@ var qt = class extends st2 {
27922
28079
  i2.splice(0, this.strip), t2.path = i2.join("/");
27923
28080
  }
27924
28081
  if (isFinite(this.maxDepth) && i2.length > this.maxDepth) return this.warn("TAR_ENTRY_ERROR", "path excessively deep", { entry: t2, path: e, depth: i2.length, maxDepth: this.maxDepth }), false;
27925
- if (!this[Es](t2, "path") || !this[Es](t2, "linkpath")) return false;
28082
+ if (!this[Rs](t2, "path") || !this[Rs](t2, "linkpath")) return false;
27926
28083
  if (t2.absolute = path15.isAbsolute(t2.path) ? f(path15.resolve(t2.path)) : f(path15.resolve(this.cwd, t2.path)), !this.preservePaths && typeof t2.absolute == "string" && t2.absolute.indexOf(this.cwd + "/") !== 0 && t2.absolute !== this.cwd) return this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", { entry: t2, path: f(t2.path), resolvedPath: t2.absolute, cwd: this.cwd }), false;
27927
28084
  if (t2.absolute === this.cwd && t2.type !== "Directory" && t2.type !== "GNUDumpDir") return false;
27928
28085
  if (this.win32) {
27929
28086
  let { root: r } = path15.win32.parse(String(t2.absolute));
27930
- t2.absolute = r + Xi(String(t2.absolute).slice(r.length));
28087
+ t2.absolute = r + ts(String(t2.absolute).slice(r.length));
27931
28088
  let { root: n2 } = path15.win32.parse(t2.path);
27932
- t2.path = n2 + Xi(t2.path.slice(n2.length));
28089
+ t2.path = n2 + ts(t2.path.slice(n2.length));
27933
28090
  }
27934
28091
  return true;
27935
28092
  }
27936
- [gr](t2) {
27937
- if (!this[Nr](t2)) return t2.resume();
27938
- switch (Mi.equal(typeof t2.absolute, "string"), t2.type) {
28093
+ [Dr](t2) {
28094
+ if (!this[Fr](t2)) return t2.resume();
28095
+ switch (zi.equal(typeof t2.absolute, "string"), t2.type) {
27939
28096
  case "Directory":
27940
28097
  case "GNUDumpDir":
27941
28098
  t2.mode && (t2.mode = t2.mode | 448);
@@ -27944,28 +28101,28 @@ var qt = class extends st2 {
27944
28101
  case "ContiguousFile":
27945
28102
  case "Link":
27946
28103
  case "SymbolicLink":
27947
- return this[ys](t2);
28104
+ return this[_s](t2);
27948
28105
  default:
27949
- return this[Lr](t2);
28106
+ return this[Cr](t2);
27950
28107
  }
27951
28108
  }
27952
28109
  [O2](t2, e) {
27953
- t2.name === "CwdError" ? this.emit("error", t2) : (this.warn("TAR_ENTRY_ERROR", t2, { entry: e }), this[Xt](), e.resume());
28110
+ t2.name === "CwdError" ? this.emit("error", t2) : (this.warn("TAR_ENTRY_ERROR", t2, { entry: e }), this[$t3](), e.resume());
27954
28111
  }
27955
- [St2](t2, e, i2) {
27956
- Er(f(t2), { uid: this.uid, gid: this.gid, processUid: this.processUid, processGid: this.processGid, umask: this.processUmask, preserve: this.preservePaths, unlink: this.unlink, cwd: this.cwd, mode: e }, i2);
28112
+ [yt3](t2, e, i2) {
28113
+ gr(f(t2), { uid: this.uid, gid: this.gid, processUid: this.processUid, processGid: this.processGid, umask: this.processUmask, preserve: this.preservePaths, unlink: this.unlink, cwd: this.cwd, mode: e }, i2);
27957
28114
  }
27958
- [Re2](t2) {
28115
+ [ge2](t2) {
27959
28116
  return this.forceChown || this.preserveOwner && (typeof t2.uid == "number" && t2.uid !== this.processUid || typeof t2.gid == "number" && t2.gid !== this.processGid) || typeof this.uid == "number" && this.uid !== this.processUid || typeof this.gid == "number" && this.gid !== this.processGid;
27960
28117
  }
27961
28118
  [be2](t2) {
27962
- return Dr(this.uid, t2.uid, this.processUid);
28119
+ return vr(this.uid, t2.uid, this.processUid);
27963
28120
  }
27964
28121
  [_e2](t2) {
27965
- return Dr(this.gid, t2.gid, this.processGid);
28122
+ return vr(this.gid, t2.gid, this.processGid);
27966
28123
  }
27967
- [bs](t2, e) {
27968
- let i2 = typeof t2.mode == "number" ? t2.mode & 4095 : this.fmode, r = new tt2(String(t2.absolute), { flags: cs(t2.size), mode: i2, autoClose: false });
28124
+ [Ts](t2, e) {
28125
+ let i2 = typeof t2.mode == "number" ? t2.mode & 4095 : this.fmode, r = new et2(String(t2.absolute), { flags: us(t2.size), mode: i2, autoClose: false });
27969
28126
  r.on("error", (a2) => {
27970
28127
  r.fd && fs.close(r.fd, () => {
27971
28128
  }), r.write = () => true, this[O2](a2, t2), e();
@@ -27977,7 +28134,7 @@ var qt = class extends st2 {
27977
28134
  return;
27978
28135
  }
27979
28136
  --n2 === 0 && r.fd !== void 0 && fs.close(r.fd, (l) => {
27980
- l ? this[O2](l, t2) : this[Xt](), e();
28137
+ l ? this[O2](l, t2) : this[$t3](), e();
27981
28138
  });
27982
28139
  };
27983
28140
  r.on("finish", () => {
@@ -27985,12 +28142,12 @@ var qt = class extends st2 {
27985
28142
  if (typeof l == "number" && t2.mtime && !this.noMtime) {
27986
28143
  n2++;
27987
28144
  let c3 = t2.atime || /* @__PURE__ */ new Date(), d = t2.mtime;
27988
- fs.futimes(l, c3, d, (S2) => S2 ? fs.utimes(a2, c3, d, (T2) => o2(T2 && S2)) : o2());
28145
+ fs.futimes(l, c3, d, (y2) => y2 ? fs.utimes(a2, c3, d, (T2) => o2(T2 && y2)) : o2());
27989
28146
  }
27990
- if (typeof l == "number" && this[Re2](t2)) {
28147
+ if (typeof l == "number" && this[ge2](t2)) {
27991
28148
  n2++;
27992
28149
  let c3 = this[be2](t2), d = this[_e2](t2);
27993
- typeof c3 == "number" && typeof d == "number" && fs.fchown(l, c3, d, (S2) => S2 ? fs.chown(a2, c3, d, (T2) => o2(T2 && S2)) : o2());
28150
+ typeof c3 == "number" && typeof d == "number" && fs.fchown(l, c3, d, (y2) => y2 ? fs.chown(a2, c3, d, (T2) => o2(T2 && y2)) : o2());
27994
28151
  }
27995
28152
  o2();
27996
28153
  });
@@ -27999,76 +28156,76 @@ var qt = class extends st2 {
27999
28156
  this[O2](a2, t2), e();
28000
28157
  }), t2.pipe(h3)), h3.pipe(r);
28001
28158
  }
28002
- [_s](t2, e) {
28159
+ [xs](t2, e) {
28003
28160
  let i2 = typeof t2.mode == "number" ? t2.mode & 4095 : this.dmode;
28004
- this[St2](String(t2.absolute), i2, (r) => {
28161
+ this[yt3](String(t2.absolute), i2, (r) => {
28005
28162
  if (r) {
28006
28163
  this[O2](r, t2), e();
28007
28164
  return;
28008
28165
  }
28009
28166
  let n2 = 1, o2 = () => {
28010
- --n2 === 0 && (e(), this[Xt](), t2.resume());
28167
+ --n2 === 0 && (e(), this[$t3](), t2.resume());
28011
28168
  };
28012
- t2.mtime && !this.noMtime && (n2++, fs.utimes(String(t2.absolute), t2.atime || /* @__PURE__ */ new Date(), t2.mtime, o2)), this[Re2](t2) && (n2++, fs.chown(String(t2.absolute), Number(this[be2](t2)), Number(this[_e2](t2)), o2)), o2();
28169
+ t2.mtime && !this.noMtime && (n2++, fs.utimes(String(t2.absolute), t2.atime || /* @__PURE__ */ new Date(), t2.mtime, o2)), this[ge2](t2) && (n2++, fs.chown(String(t2.absolute), Number(this[be2](t2)), Number(this[_e2](t2)), o2)), o2();
28013
28170
  });
28014
28171
  }
28015
- [Lr](t2) {
28172
+ [Cr](t2) {
28016
28173
  t2.unsupported = true, this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${t2.type}`, { entry: t2 }), t2.resume();
28017
28174
  }
28018
- [Tr](t2, e) {
28175
+ [Ar](t2, e) {
28019
28176
  let i2 = f(path15.relative(this.cwd, path15.resolve(path15.dirname(String(t2.absolute)), String(t2.linkpath)))).split("/");
28020
- this[ye2](t2, this.cwd, i2, () => this[Si](t2, String(t2.linkpath), "symlink", e), (r) => {
28177
+ this[Re2](t2, this.cwd, i2, () => this[gi](t2, String(t2.linkpath), "symlink", e), (r) => {
28021
28178
  this[O2](r, t2), e();
28022
28179
  });
28023
28180
  }
28024
- [xr](t2, e) {
28181
+ [Ir](t2, e) {
28025
28182
  let i2 = f(path15.resolve(this.cwd, String(t2.linkpath))), r = f(String(t2.linkpath)).split("/");
28026
- this[ye2](t2, this.cwd, r, () => this[Si](t2, i2, "link", e), (n2) => {
28183
+ this[Re2](t2, this.cwd, r, () => this[gi](t2, i2, "link", e), (n2) => {
28027
28184
  this[O2](n2, t2), e();
28028
28185
  });
28029
28186
  }
28030
- [ye2](t2, e, i2, r, n2) {
28187
+ [Re2](t2, e, i2, r, n2) {
28031
28188
  let o2 = i2.shift();
28032
28189
  if (this.preservePaths || o2 === void 0) return r();
28033
28190
  let h3 = path15.resolve(e, o2);
28034
28191
  fs.lstat(h3, (a2, l) => {
28035
28192
  if (a2) return r();
28036
- if (l?.isSymbolicLink()) return n2(new wt2(h3, path15.resolve(h3, i2.join("/"))));
28037
- this[ye2](t2, h3, i2, r, n2);
28193
+ if (l?.isSymbolicLink()) return n2(new St2(h3, path15.resolve(h3, i2.join("/"))));
28194
+ this[Re2](t2, h3, i2, r, n2);
28038
28195
  });
28039
28196
  }
28040
- [Ar]() {
28041
- this[wi]++;
28197
+ [kr]() {
28198
+ this[Ri]++;
28042
28199
  }
28043
- [Xt]() {
28044
- this[wi]--, this[Ss]();
28200
+ [$t3]() {
28201
+ this[Ri]--, this[bs]();
28045
28202
  }
28046
- [gs](t2) {
28047
- this[Xt](), t2.resume();
28203
+ [Ls](t2) {
28204
+ this[$t3](), t2.resume();
28048
28205
  }
28049
- [Rs](t2, e) {
28050
- return t2.type === "File" && !this.unlink && e.isFile() && e.nlink <= 1 && !Oe2;
28206
+ [Os](t2, e) {
28207
+ return t2.type === "File" && !this.unlink && e.isFile() && e.nlink <= 1 && !Te2;
28051
28208
  }
28052
- [ys](t2) {
28053
- this[Ar]();
28209
+ [_s](t2) {
28210
+ this[kr]();
28054
28211
  let e = [t2.path];
28055
- t2.linkpath && e.push(t2.linkpath), this.reservations.reserve(e, (i2) => this[Or](t2, i2));
28212
+ t2.linkpath && e.push(t2.linkpath), this.reservations.reserve(e, (i2) => this[Nr](t2, i2));
28056
28213
  }
28057
- [Or](t2, e) {
28214
+ [Nr](t2, e) {
28058
28215
  let i2 = (h3) => {
28059
28216
  e(h3);
28060
28217
  }, r = () => {
28061
- this[St2](this.cwd, this.dmode, (h3) => {
28218
+ this[yt3](this.cwd, this.dmode, (h3) => {
28062
28219
  if (h3) {
28063
28220
  this[O2](h3, t2), i2();
28064
28221
  return;
28065
28222
  }
28066
- this[ge2] = true, n2();
28223
+ this[Oe2] = true, n2();
28067
28224
  });
28068
28225
  }, n2 = () => {
28069
28226
  if (t2.absolute !== this.cwd) {
28070
28227
  let h3 = f(path15.dirname(String(t2.absolute)));
28071
- if (h3 !== this.cwd) return this[St2](h3, this.dmode, (a2) => {
28228
+ if (h3 !== this.cwd) return this[yt3](h3, this.dmode, (a2) => {
28072
28229
  if (a2) {
28073
28230
  this[O2](a2, t2), i2();
28074
28231
  return;
@@ -28080,10 +28237,10 @@ var qt = class extends st2 {
28080
28237
  }, o2 = () => {
28081
28238
  fs.lstat(String(t2.absolute), (h3, a2) => {
28082
28239
  if (a2 && (this.keep || this.newer && a2.mtime > (t2.mtime ?? a2.mtime))) {
28083
- this[gs](t2), i2();
28240
+ this[Ls](t2), i2();
28084
28241
  return;
28085
28242
  }
28086
- if (h3 || this[Rs](t2, a2)) return this[P2](null, t2, i2);
28243
+ if (h3 || this[Os](t2, a2)) return this[P2](null, t2, i2);
28087
28244
  if (a2.isDirectory()) {
28088
28245
  if (t2.type === "Directory") {
28089
28246
  let l = this.chmod && t2.mode && (a2.mode & 4095) !== t2.mode, c3 = (d) => this[P2](d ?? null, t2, i2);
@@ -28092,10 +28249,10 @@ var qt = class extends st2 {
28092
28249
  if (t2.absolute !== this.cwd) return fs.rmdir(String(t2.absolute), (l) => this[P2](l ?? null, t2, i2));
28093
28250
  }
28094
28251
  if (t2.absolute === this.cwd) return this[P2](null, t2, i2);
28095
- oo(String(t2.absolute), (l) => this[P2](l ?? null, t2, i2));
28252
+ uo(String(t2.absolute), (l) => this[P2](l ?? null, t2, i2));
28096
28253
  });
28097
28254
  };
28098
- this[ge2] ? n2() : r();
28255
+ this[Oe2] ? n2() : r();
28099
28256
  }
28100
28257
  [P2](t2, e, i2) {
28101
28258
  if (t2) {
@@ -28106,65 +28263,65 @@ var qt = class extends st2 {
28106
28263
  case "File":
28107
28264
  case "OldFile":
28108
28265
  case "ContiguousFile":
28109
- return this[bs](e, i2);
28266
+ return this[Ts](e, i2);
28110
28267
  case "Link":
28111
- return this[xr](e, i2);
28268
+ return this[Ir](e, i2);
28112
28269
  case "SymbolicLink":
28113
- return this[Tr](e, i2);
28270
+ return this[Ar](e, i2);
28114
28271
  case "Directory":
28115
28272
  case "GNUDumpDir":
28116
- return this[_s](e, i2);
28273
+ return this[xs](e, i2);
28117
28274
  }
28118
28275
  }
28119
- [Si](t2, e, i2, r) {
28276
+ [gi](t2, e, i2, r) {
28120
28277
  fs[i2](e, String(t2.absolute), (n2) => {
28121
- n2 ? this[O2](n2, t2) : (this[Xt](), t2.resume()), r();
28278
+ n2 ? this[O2](n2, t2) : (this[$t3](), t2.resume()), r();
28122
28279
  });
28123
28280
  }
28124
28281
  };
28125
- var Se2 = (s3) => {
28282
+ var ye2 = (s3) => {
28126
28283
  try {
28127
28284
  return [null, s3()];
28128
28285
  } catch (t2) {
28129
28286
  return [t2, null];
28130
28287
  }
28131
28288
  };
28132
- var Te2 = class extends qt {
28289
+ var xe2 = class extends Xt {
28133
28290
  sync = true;
28134
28291
  [P2](t2, e) {
28135
28292
  return super[P2](t2, e, () => {
28136
28293
  });
28137
28294
  }
28138
- [ys](t2) {
28139
- if (!this[ge2]) {
28140
- let n2 = this[St2](this.cwd, this.dmode);
28295
+ [_s](t2) {
28296
+ if (!this[Oe2]) {
28297
+ let n2 = this[yt3](this.cwd, this.dmode);
28141
28298
  if (n2) return this[O2](n2, t2);
28142
- this[ge2] = true;
28299
+ this[Oe2] = true;
28143
28300
  }
28144
28301
  if (t2.absolute !== this.cwd) {
28145
28302
  let n2 = f(path15.dirname(String(t2.absolute)));
28146
28303
  if (n2 !== this.cwd) {
28147
- let o2 = this[St2](n2, this.dmode);
28304
+ let o2 = this[yt3](n2, this.dmode);
28148
28305
  if (o2) return this[O2](o2, t2);
28149
28306
  }
28150
28307
  }
28151
- let [e, i2] = Se2(() => fs.lstatSync(String(t2.absolute)));
28152
- if (i2 && (this.keep || this.newer && i2.mtime > (t2.mtime ?? i2.mtime))) return this[gs](t2);
28153
- if (e || this[Rs](t2, i2)) return this[P2](null, t2);
28308
+ let [e, i2] = ye2(() => fs.lstatSync(String(t2.absolute)));
28309
+ if (i2 && (this.keep || this.newer && i2.mtime > (t2.mtime ?? i2.mtime))) return this[Ls](t2);
28310
+ if (e || this[Os](t2, i2)) return this[P2](null, t2);
28154
28311
  if (i2.isDirectory()) {
28155
28312
  if (t2.type === "Directory") {
28156
- let o2 = this.chmod && t2.mode && (i2.mode & 4095) !== t2.mode, [h3] = o2 ? Se2(() => {
28313
+ let o2 = this.chmod && t2.mode && (i2.mode & 4095) !== t2.mode, [h3] = o2 ? ye2(() => {
28157
28314
  fs.chmodSync(String(t2.absolute), Number(t2.mode));
28158
28315
  }) : [];
28159
28316
  return this[P2](h3, t2);
28160
28317
  }
28161
- let [n2] = Se2(() => fs.rmdirSync(String(t2.absolute)));
28318
+ let [n2] = ye2(() => fs.rmdirSync(String(t2.absolute)));
28162
28319
  this[P2](n2, t2);
28163
28320
  }
28164
- let [r] = t2.absolute === this.cwd ? [] : Se2(() => ho(String(t2.absolute)));
28321
+ let [r] = t2.absolute === this.cwd ? [] : ye2(() => po(String(t2.absolute)));
28165
28322
  this[P2](r, t2);
28166
28323
  }
28167
- [bs](t2, e) {
28324
+ [Ts](t2, e) {
28168
28325
  let i2 = typeof t2.mode == "number" ? t2.mode & 4095 : this.fmode, r = (h3) => {
28169
28326
  let a2;
28170
28327
  try {
@@ -28175,7 +28332,7 @@ var Te2 = class extends qt {
28175
28332
  (h3 || a2) && this[O2](h3 || a2, t2), e();
28176
28333
  }, n2;
28177
28334
  try {
28178
- n2 = fs.openSync(String(t2.absolute), cs(t2.size), i2);
28335
+ n2 = fs.openSync(String(t2.absolute), us(t2.size), i2);
28179
28336
  } catch (h3) {
28180
28337
  return r(h3);
28181
28338
  }
@@ -28200,7 +28357,7 @@ var Te2 = class extends qt {
28200
28357
  }
28201
28358
  }
28202
28359
  }
28203
- if (this[Re2](t2)) {
28360
+ if (this[ge2](t2)) {
28204
28361
  let a2 = this[be2](t2), l = this[_e2](t2);
28205
28362
  try {
28206
28363
  fs.fchownSync(n2, Number(a2), Number(l));
@@ -28215,8 +28372,8 @@ var Te2 = class extends qt {
28215
28372
  r(h3);
28216
28373
  });
28217
28374
  }
28218
- [_s](t2, e) {
28219
- let i2 = typeof t2.mode == "number" ? t2.mode & 4095 : this.dmode, r = this[St2](String(t2.absolute), i2);
28375
+ [xs](t2, e) {
28376
+ let i2 = typeof t2.mode == "number" ? t2.mode & 4095 : this.dmode, r = this[yt3](String(t2.absolute), i2);
28220
28377
  if (r) {
28221
28378
  this[O2](r, t2), e();
28222
28379
  return;
@@ -28225,31 +28382,31 @@ var Te2 = class extends qt {
28225
28382
  fs.utimesSync(String(t2.absolute), t2.atime || /* @__PURE__ */ new Date(), t2.mtime);
28226
28383
  } catch {
28227
28384
  }
28228
- if (this[Re2](t2)) try {
28385
+ if (this[ge2](t2)) try {
28229
28386
  fs.chownSync(String(t2.absolute), Number(this[be2](t2)), Number(this[_e2](t2)));
28230
28387
  } catch {
28231
28388
  }
28232
28389
  e(), t2.resume();
28233
28390
  }
28234
- [St2](t2, e) {
28391
+ [yt3](t2, e) {
28235
28392
  try {
28236
- return Sr(f(t2), { uid: this.uid, gid: this.gid, processUid: this.processUid, processGid: this.processGid, umask: this.processUmask, preserve: this.preservePaths, unlink: this.unlink, cwd: this.cwd, mode: e });
28393
+ return _r(f(t2), { uid: this.uid, gid: this.gid, processUid: this.processUid, processGid: this.processGid, umask: this.processUmask, preserve: this.preservePaths, unlink: this.unlink, cwd: this.cwd, mode: e });
28237
28394
  } catch (i2) {
28238
28395
  return i2;
28239
28396
  }
28240
28397
  }
28241
- [ye2](t2, e, i2, r, n2) {
28398
+ [Re2](t2, e, i2, r, n2) {
28242
28399
  if (this.preservePaths || i2.length === 0) return r();
28243
28400
  let o2 = e;
28244
28401
  for (let h3 of i2) {
28245
28402
  o2 = path15.resolve(o2, h3);
28246
- let [a2, l] = Se2(() => fs.lstatSync(o2));
28403
+ let [a2, l] = ye2(() => fs.lstatSync(o2));
28247
28404
  if (a2) return r();
28248
- if (l.isSymbolicLink()) return n2(new wt2(o2, path15.resolve(e, i2.join("/"))));
28405
+ if (l.isSymbolicLink()) return n2(new St2(o2, path15.resolve(e, i2.join("/"))));
28249
28406
  }
28250
28407
  r();
28251
28408
  }
28252
- [Si](t2, e, i2, r) {
28409
+ [gi](t2, e, i2, r) {
28253
28410
  let n2 = `${i2}Sync`;
28254
28411
  try {
28255
28412
  fs[n2](e, String(t2.absolute)), r(), t2.resume();
@@ -28258,12 +28415,12 @@ var Te2 = class extends qt {
28258
28415
  }
28259
28416
  }
28260
28417
  };
28261
- var ao = (s3) => {
28262
- let t2 = new Te2(s3), e = s3.file, i2 = fs.statSync(e), r = s3.maxReadSize || 16 * 1024 * 1024;
28263
- new Me(e, { readSize: r, size: i2.size }).pipe(t2);
28418
+ var Eo = (s3) => {
28419
+ let t2 = new xe2(s3), e = s3.file, i2 = fs.statSync(e), r = s3.maxReadSize || 16 * 1024 * 1024;
28420
+ new Be(e, { readSize: r, size: i2.size }).pipe(t2);
28264
28421
  };
28265
- var lo = (s3, t2) => {
28266
- let e = new qt(s3), i2 = s3.maxReadSize || 16 * 1024 * 1024, r = s3.file;
28422
+ var wo = (s3, t2) => {
28423
+ let e = new Xt(s3), i2 = s3.maxReadSize || 16 * 1024 * 1024, r = s3.file;
28267
28424
  return new Promise((o2, h3) => {
28268
28425
  e.on("error", h3), e.on("close", o2), fs.stat(r, (a2, l) => {
28269
28426
  if (a2) h3(a2);
@@ -28274,10 +28431,10 @@ var lo = (s3, t2) => {
28274
28431
  });
28275
28432
  });
28276
28433
  };
28277
- var co = K2(ao, lo, (s3) => new Te2(s3), (s3) => new qt(s3), (s3, t2) => {
28278
- t2?.length && Ki(s3, t2);
28434
+ var So = K2(Eo, wo, (s3) => new xe2(s3), (s3) => new Xt(s3), (s3, t2) => {
28435
+ t2?.length && Qi(s3, t2);
28279
28436
  });
28280
- var fo = (s3, t2) => {
28437
+ var yo = (s3, t2) => {
28281
28438
  let e = new kt3(s3), i2 = true, r, n2;
28282
28439
  try {
28283
28440
  try {
@@ -28298,7 +28455,7 @@ var fo = (s3, t2) => {
28298
28455
  if (n2 + l + 512 > o2.size) break;
28299
28456
  n2 += l, s3.mtimeCache && a2.mtime && s3.mtimeCache.set(String(a2.path), a2.mtime);
28300
28457
  }
28301
- i2 = false, uo(s3, e, n2, r, t2);
28458
+ i2 = false, Ro(s3, e, n2, r, t2);
28302
28459
  } finally {
28303
28460
  if (i2) try {
28304
28461
  fs.closeSync(r);
@@ -28306,69 +28463,69 @@ var fo = (s3, t2) => {
28306
28463
  }
28307
28464
  }
28308
28465
  };
28309
- var uo = (s3, t2, e, i2, r) => {
28466
+ var Ro = (s3, t2, e, i2, r) => {
28310
28467
  let n2 = new Wt3(s3.file, { fd: i2, start: e });
28311
- t2.pipe(n2), po(t2, r);
28468
+ t2.pipe(n2), bo(t2, r);
28312
28469
  };
28313
- var mo = (s3, t2) => {
28470
+ var go = (s3, t2) => {
28314
28471
  t2 = Array.from(t2);
28315
- let e = new Et3(s3), i2 = (n2, o2, h3) => {
28316
- let a2 = (T2, N3) => {
28317
- T2 ? fs.close(n2, (E) => h3(T2)) : h3(null, N3);
28472
+ let e = new wt2(s3), i2 = (n2, o2, h3) => {
28473
+ let a2 = (T2, D3) => {
28474
+ T2 ? fs.close(n2, (E) => h3(T2)) : h3(null, D3);
28318
28475
  }, l = 0;
28319
28476
  if (o2 === 0) return a2(null, 0);
28320
- let c3 = 0, d = Buffer.alloc(512), S2 = (T2, N3) => {
28321
- if (T2 || N3 === void 0) return a2(T2);
28322
- if (c3 += N3, c3 < 512 && N3) return fs.read(n2, d, c3, d.length - c3, l + c3, S2);
28477
+ let c3 = 0, d = Buffer.alloc(512), y2 = (T2, D3) => {
28478
+ if (T2 || D3 === void 0) return a2(T2);
28479
+ if (c3 += D3, c3 < 512 && D3) return fs.read(n2, d, c3, d.length - c3, l + c3, y2);
28323
28480
  if (l === 0 && d[0] === 31 && d[1] === 139) return a2(new Error("cannot append to compressed archives"));
28324
28481
  if (c3 < 512) return a2(null, l);
28325
28482
  let E = new F(d);
28326
28483
  if (!E.cksumValid) return a2(null, l);
28327
28484
  let x3 = 512 * Math.ceil((E.size ?? 0) / 512);
28328
28485
  if (l + x3 + 512 > o2 || (l += x3 + 512, l >= o2)) return a2(null, l);
28329
- s3.mtimeCache && E.mtime && s3.mtimeCache.set(String(E.path), E.mtime), c3 = 0, fs.read(n2, d, 0, 512, l, S2);
28486
+ s3.mtimeCache && E.mtime && s3.mtimeCache.set(String(E.path), E.mtime), c3 = 0, fs.read(n2, d, 0, 512, l, y2);
28330
28487
  };
28331
- fs.read(n2, d, 0, 512, l, S2);
28488
+ fs.read(n2, d, 0, 512, l, y2);
28332
28489
  };
28333
28490
  return new Promise((n2, o2) => {
28334
28491
  e.on("error", o2);
28335
28492
  let h3 = "r+", a2 = (l, c3) => {
28336
28493
  if (l && l.code === "ENOENT" && h3 === "r+") return h3 = "w+", fs.open(s3.file, h3, a2);
28337
28494
  if (l || !c3) return o2(l);
28338
- fs.fstat(c3, (d, S2) => {
28495
+ fs.fstat(c3, (d, y2) => {
28339
28496
  if (d) return fs.close(c3, () => o2(d));
28340
- i2(c3, S2.size, (T2, N3) => {
28497
+ i2(c3, y2.size, (T2, D3) => {
28341
28498
  if (T2) return o2(T2);
28342
- let E = new tt2(s3.file, { fd: c3, start: N3 });
28343
- e.pipe(E), E.on("error", o2), E.on("close", n2), Eo(e, t2);
28499
+ let E = new et2(s3.file, { fd: c3, start: D3 });
28500
+ e.pipe(E), E.on("error", o2), E.on("close", n2), _o(e, t2);
28344
28501
  });
28345
28502
  });
28346
28503
  };
28347
28504
  fs.open(s3.file, h3, a2);
28348
28505
  });
28349
28506
  };
28350
- var po = (s3, t2) => {
28507
+ var bo = (s3, t2) => {
28351
28508
  t2.forEach((e) => {
28352
- e.charAt(0) === "@" ? It3({ file: path15.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
28509
+ e.charAt(0) === "@" ? Ct3({ file: path15.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
28353
28510
  }), s3.end();
28354
28511
  };
28355
- var Eo = async (s3, t2) => {
28356
- for (let e of t2) e.charAt(0) === "@" ? await It3({ file: path15.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
28512
+ var _o = async (s3, t2) => {
28513
+ for (let e of t2) e.charAt(0) === "@" ? await Ct3({ file: path15.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i2) => s3.add(i2) }) : s3.add(e);
28357
28514
  s3.end();
28358
28515
  };
28359
- var vt3 = K2(fo, mo, () => {
28516
+ var vt3 = K2(yo, go, () => {
28360
28517
  throw new TypeError("file is required");
28361
28518
  }, () => {
28362
28519
  throw new TypeError("file is required");
28363
28520
  }, (s3, t2) => {
28364
- if (!Fs(s3)) throw new TypeError("file is required");
28521
+ if (!Bs(s3)) throw new TypeError("file is required");
28365
28522
  if (s3.gzip || s3.brotli || s3.zstd || s3.file.endsWith(".br") || s3.file.endsWith(".tbr")) throw new TypeError("cannot append to compressed archives");
28366
28523
  if (!t2?.length) throw new TypeError("no paths specified to add/replace");
28367
28524
  });
28368
28525
  K2(vt3.syncFile, vt3.asyncFile, vt3.syncNoFile, vt3.asyncNoFile, (s3, t2 = []) => {
28369
- vt3.validate?.(s3, t2), So(s3);
28526
+ vt3.validate?.(s3, t2), To(s3);
28370
28527
  });
28371
- var So = (s3) => {
28528
+ var To = (s3) => {
28372
28529
  let t2 = s3.filter;
28373
28530
  s3.mtimeCache || (s3.mtimeCache = /* @__PURE__ */ new Map()), s3.filter = t2 ? (e, i2) => t2(e, i2) && !((s3.mtimeCache?.get(e) ?? i2.mtime ?? 0) > (i2.mtime ?? 0)) : (e, i2) => !((s3.mtimeCache?.get(e) ?? i2.mtime ?? 0) > (i2.mtime ?? 0));
28374
28531
  };
@@ -28403,7 +28560,7 @@ async function downloadTemplate(templateName, branch = "main") {
28403
28560
  }
28404
28561
  await pipeline(
28405
28562
  Readable.from(response.body),
28406
- co({
28563
+ So({
28407
28564
  cwd: tmpDir,
28408
28565
  filter: (p2) => p2.startsWith(baseFilter) || p2.startsWith(templateFilter),
28409
28566
  // Strip the "{repo}-{branch}/" prefix so templates/ is at the root
@@ -29124,5 +29281,5 @@ async function createNextly(options = {}) {
29124
29281
  */
29125
29282
 
29126
29283
  export { __commonJS, __require, __toESM, capture, createNextly, init, resolveProjectArg, shutdown, validateProjectName };
29127
- //# sourceMappingURL=chunk-C5CWOU22.mjs.map
29128
- //# sourceMappingURL=chunk-C5CWOU22.mjs.map
29284
+ //# sourceMappingURL=chunk-XV4JJVHS.mjs.map
29285
+ //# sourceMappingURL=chunk-XV4JJVHS.mjs.map