wrangler 3.79.0 → 3.80.0

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.
@@ -4788,7 +4788,7 @@ var require_formdata = __commonJS({
4788
4788
  var { webidl } = require_webidl();
4789
4789
  var { Blob: Blob6, File: NativeFile } = require("buffer");
4790
4790
  var File7 = NativeFile ?? UndiciFile;
4791
- var FormData11 = class {
4791
+ var FormData12 = class {
4792
4792
  constructor(form) {
4793
4793
  if (form !== void 0) {
4794
4794
  throw webidl.errors.conversionFailed({
@@ -4800,7 +4800,7 @@ var require_formdata = __commonJS({
4800
4800
  this[kState] = [];
4801
4801
  }
4802
4802
  append(name2, value, filename = void 0) {
4803
- webidl.brandCheck(this, FormData11);
4803
+ webidl.brandCheck(this, FormData12);
4804
4804
  webidl.argumentLengthCheck(arguments, 2, { header: "FormData.append" });
4805
4805
  if (arguments.length === 3 && !isBlobLike(value)) {
4806
4806
  throw new TypeError(
@@ -4814,13 +4814,13 @@ var require_formdata = __commonJS({
4814
4814
  this[kState].push(entry);
4815
4815
  }
4816
4816
  delete(name2) {
4817
- webidl.brandCheck(this, FormData11);
4817
+ webidl.brandCheck(this, FormData12);
4818
4818
  webidl.argumentLengthCheck(arguments, 1, { header: "FormData.delete" });
4819
4819
  name2 = webidl.converters.USVString(name2);
4820
4820
  this[kState] = this[kState].filter((entry) => entry.name !== name2);
4821
4821
  }
4822
4822
  get(name2) {
4823
- webidl.brandCheck(this, FormData11);
4823
+ webidl.brandCheck(this, FormData12);
4824
4824
  webidl.argumentLengthCheck(arguments, 1, { header: "FormData.get" });
4825
4825
  name2 = webidl.converters.USVString(name2);
4826
4826
  const idx = this[kState].findIndex((entry) => entry.name === name2);
@@ -4830,19 +4830,19 @@ var require_formdata = __commonJS({
4830
4830
  return this[kState][idx].value;
4831
4831
  }
4832
4832
  getAll(name2) {
4833
- webidl.brandCheck(this, FormData11);
4833
+ webidl.brandCheck(this, FormData12);
4834
4834
  webidl.argumentLengthCheck(arguments, 1, { header: "FormData.getAll" });
4835
4835
  name2 = webidl.converters.USVString(name2);
4836
4836
  return this[kState].filter((entry) => entry.name === name2).map((entry) => entry.value);
4837
4837
  }
4838
4838
  has(name2) {
4839
- webidl.brandCheck(this, FormData11);
4839
+ webidl.brandCheck(this, FormData12);
4840
4840
  webidl.argumentLengthCheck(arguments, 1, { header: "FormData.has" });
4841
4841
  name2 = webidl.converters.USVString(name2);
4842
4842
  return this[kState].findIndex((entry) => entry.name === name2) !== -1;
4843
4843
  }
4844
4844
  set(name2, value, filename = void 0) {
4845
- webidl.brandCheck(this, FormData11);
4845
+ webidl.brandCheck(this, FormData12);
4846
4846
  webidl.argumentLengthCheck(arguments, 2, { header: "FormData.set" });
4847
4847
  if (arguments.length === 3 && !isBlobLike(value)) {
4848
4848
  throw new TypeError(
@@ -4865,7 +4865,7 @@ var require_formdata = __commonJS({
4865
4865
  }
4866
4866
  }
4867
4867
  entries() {
4868
- webidl.brandCheck(this, FormData11);
4868
+ webidl.brandCheck(this, FormData12);
4869
4869
  return makeIterator(
4870
4870
  () => this[kState].map((pair) => [pair.name, pair.value]),
4871
4871
  "FormData",
@@ -4873,7 +4873,7 @@ var require_formdata = __commonJS({
4873
4873
  );
4874
4874
  }
4875
4875
  keys() {
4876
- webidl.brandCheck(this, FormData11);
4876
+ webidl.brandCheck(this, FormData12);
4877
4877
  return makeIterator(
4878
4878
  () => this[kState].map((pair) => [pair.name, pair.value]),
4879
4879
  "FormData",
@@ -4881,7 +4881,7 @@ var require_formdata = __commonJS({
4881
4881
  );
4882
4882
  }
4883
4883
  values() {
4884
- webidl.brandCheck(this, FormData11);
4884
+ webidl.brandCheck(this, FormData12);
4885
4885
  return makeIterator(
4886
4886
  () => this[kState].map((pair) => [pair.name, pair.value]),
4887
4887
  "FormData",
@@ -4893,7 +4893,7 @@ var require_formdata = __commonJS({
4893
4893
  * @param {unknown} thisArg
4894
4894
  */
4895
4895
  forEach(callbackFn, thisArg = globalThis) {
4896
- webidl.brandCheck(this, FormData11);
4896
+ webidl.brandCheck(this, FormData12);
4897
4897
  webidl.argumentLengthCheck(arguments, 1, { header: "FormData.forEach" });
4898
4898
  if (typeof callbackFn !== "function") {
4899
4899
  throw new TypeError(
@@ -4905,9 +4905,9 @@ var require_formdata = __commonJS({
4905
4905
  }
4906
4906
  }
4907
4907
  };
4908
- __name(FormData11, "FormData");
4909
- FormData11.prototype[Symbol.iterator] = FormData11.prototype.entries;
4910
- Object.defineProperties(FormData11.prototype, {
4908
+ __name(FormData12, "FormData");
4909
+ FormData12.prototype[Symbol.iterator] = FormData12.prototype.entries;
4910
+ Object.defineProperties(FormData12.prototype, {
4911
4911
  [Symbol.toStringTag]: {
4912
4912
  value: "FormData",
4913
4913
  configurable: true
@@ -4932,7 +4932,7 @@ var require_formdata = __commonJS({
4932
4932
  return { name: name2, value };
4933
4933
  }
4934
4934
  __name(makeEntry, "makeEntry");
4935
- module3.exports = { FormData: FormData11 };
4935
+ module3.exports = { FormData: FormData12 };
4936
4936
  }
4937
4937
  });
4938
4938
 
@@ -4942,7 +4942,7 @@ var require_body = __commonJS({
4942
4942
  "use strict";
4943
4943
  init_import_meta_url();
4944
4944
  var Busboy = require_main();
4945
- var util6 = require_util();
4945
+ var util7 = require_util();
4946
4946
  var {
4947
4947
  ReadableStreamFrom,
4948
4948
  isBlobLike,
@@ -4951,7 +4951,7 @@ var require_body = __commonJS({
4951
4951
  createDeferredPromise,
4952
4952
  fullyReadBody
4953
4953
  } = require_util2();
4954
- var { FormData: FormData11 } = require_formdata();
4954
+ var { FormData: FormData12 } = require_formdata();
4955
4955
  var { kState } = require_symbols2();
4956
4956
  var { webidl } = require_webidl();
4957
4957
  var { DOMException: DOMException2, structuredClone } = require_constants2();
@@ -5003,7 +5003,7 @@ var require_body = __commonJS({
5003
5003
  source = new Uint8Array(object.slice());
5004
5004
  } else if (ArrayBuffer.isView(object)) {
5005
5005
  source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength));
5006
- } else if (util6.isFormDataLike(object)) {
5006
+ } else if (util7.isFormDataLike(object)) {
5007
5007
  const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, "0")}`;
5008
5008
  const prefix = `--${boundary}\r
5009
5009
  Content-Disposition: form-data`;
@@ -5061,14 +5061,14 @@ Content-Type: ${value.type || "application/octet-stream"}\r
5061
5061
  if (keepalive) {
5062
5062
  throw new TypeError("keepalive");
5063
5063
  }
5064
- if (util6.isDisturbed(object) || object.locked) {
5064
+ if (util7.isDisturbed(object) || object.locked) {
5065
5065
  throw new TypeError(
5066
5066
  "Response body object should not be disturbed or locked"
5067
5067
  );
5068
5068
  }
5069
5069
  stream2 = object instanceof ReadableStream2 ? object : ReadableStreamFrom(object);
5070
5070
  }
5071
- if (typeof source === "string" || util6.isBuffer(source)) {
5071
+ if (typeof source === "string" || util7.isBuffer(source)) {
5072
5072
  length = Buffer.byteLength(source);
5073
5073
  }
5074
5074
  if (action != null) {
@@ -5105,7 +5105,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
5105
5105
  ReadableStream2 = require("stream/web").ReadableStream;
5106
5106
  }
5107
5107
  if (object instanceof ReadableStream2) {
5108
- assert34(!util6.isDisturbed(object), "The body has already been consumed.");
5108
+ assert34(!util7.isDisturbed(object), "The body has already been consumed.");
5109
5109
  assert34(!object.locked, "The stream is locked.");
5110
5110
  }
5111
5111
  return extractBody(object, keepalive);
@@ -5129,7 +5129,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
5129
5129
  yield body;
5130
5130
  } else {
5131
5131
  const stream2 = body.stream;
5132
- if (util6.isDisturbed(stream2)) {
5132
+ if (util7.isDisturbed(stream2)) {
5133
5133
  throw new TypeError("The body has already been consumed.");
5134
5134
  }
5135
5135
  if (stream2.locked) {
@@ -5179,7 +5179,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
5179
5179
  const headers = {};
5180
5180
  for (const [key, value] of this.headers)
5181
5181
  headers[key.toLowerCase()] = value;
5182
- const responseFormData = new FormData11();
5182
+ const responseFormData = new FormData12();
5183
5183
  let busboy;
5184
5184
  try {
5185
5185
  busboy = new Busboy({
@@ -5241,7 +5241,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
5241
5241
  } catch (err) {
5242
5242
  throw Object.assign(new TypeError(), { cause: err });
5243
5243
  }
5244
- const formData = new FormData11();
5244
+ const formData = new FormData12();
5245
5245
  for (const [name2, value] of entries) {
5246
5246
  formData.append(name2, value);
5247
5247
  }
@@ -5287,7 +5287,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
5287
5287
  }
5288
5288
  __name(specConsumeBody, "specConsumeBody");
5289
5289
  function bodyUnusable(body) {
5290
- return body != null && (body.stream.locked || util6.isDisturbed(body.stream));
5290
+ return body != null && (body.stream.locked || util7.isDisturbed(body.stream));
5291
5291
  }
5292
5292
  __name(bodyUnusable, "bodyUnusable");
5293
5293
  function utf8DecodeBytes(buffer) {
@@ -5334,7 +5334,7 @@ var require_request = __commonJS({
5334
5334
  } = require_errors();
5335
5335
  var assert34 = require("assert");
5336
5336
  var { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = require_symbols();
5337
- var util6 = require_util();
5337
+ var util7 = require_util();
5338
5338
  var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;
5339
5339
  var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
5340
5340
  var invalidPathRegex = /[^\u0021-\u00ff]/;
@@ -5405,12 +5405,12 @@ var require_request = __commonJS({
5405
5405
  this.abort = null;
5406
5406
  if (body == null) {
5407
5407
  this.body = null;
5408
- } else if (util6.isStream(body)) {
5408
+ } else if (util7.isStream(body)) {
5409
5409
  this.body = body;
5410
5410
  const rState = this.body._readableState;
5411
5411
  if (!rState || !rState.autoDestroy) {
5412
5412
  this.endHandler = /* @__PURE__ */ __name(function autoDestroy() {
5413
- util6.destroy(this);
5413
+ util7.destroy(this);
5414
5414
  }, "autoDestroy");
5415
5415
  this.body.on("end", this.endHandler);
5416
5416
  }
@@ -5422,7 +5422,7 @@ var require_request = __commonJS({
5422
5422
  }
5423
5423
  };
5424
5424
  this.body.on("error", this.errorHandler);
5425
- } else if (util6.isBuffer(body)) {
5425
+ } else if (util7.isBuffer(body)) {
5426
5426
  this.body = body.byteLength ? body : null;
5427
5427
  } else if (ArrayBuffer.isView(body)) {
5428
5428
  this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null;
@@ -5430,7 +5430,7 @@ var require_request = __commonJS({
5430
5430
  this.body = body.byteLength ? Buffer.from(body) : null;
5431
5431
  } else if (typeof body === "string") {
5432
5432
  this.body = body.length ? Buffer.from(body) : null;
5433
- } else if (util6.isFormDataLike(body) || util6.isIterable(body) || util6.isBlobLike(body)) {
5433
+ } else if (util7.isFormDataLike(body) || util7.isIterable(body) || util7.isBlobLike(body)) {
5434
5434
  this.body = body;
5435
5435
  } else {
5436
5436
  throw new InvalidArgumentError("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");
@@ -5438,7 +5438,7 @@ var require_request = __commonJS({
5438
5438
  this.completed = false;
5439
5439
  this.aborted = false;
5440
5440
  this.upgrade = upgrade || null;
5441
- this.path = query ? util6.buildURL(path74, query) : path74;
5441
+ this.path = query ? util7.buildURL(path74, query) : path74;
5442
5442
  this.origin = origin;
5443
5443
  this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
5444
5444
  this.blocking = blocking == null ? false : blocking;
@@ -5464,8 +5464,8 @@ var require_request = __commonJS({
5464
5464
  } else if (headers != null) {
5465
5465
  throw new InvalidArgumentError("headers must be an object or an array");
5466
5466
  }
5467
- if (util6.isFormDataLike(this.body)) {
5468
- if (util6.nodeMajor < 16 || util6.nodeMajor === 16 && util6.nodeMinor < 8) {
5467
+ if (util7.isFormDataLike(this.body)) {
5468
+ if (util7.nodeMajor < 16 || util7.nodeMajor === 16 && util7.nodeMinor < 8) {
5469
5469
  throw new InvalidArgumentError("Form-Data bodies are only supported in node v16.8 and newer.");
5470
5470
  }
5471
5471
  if (!extractBody) {
@@ -5479,13 +5479,13 @@ var require_request = __commonJS({
5479
5479
  }
5480
5480
  this.body = bodyStream.stream;
5481
5481
  this.contentLength = bodyStream.length;
5482
- } else if (util6.isBlobLike(body) && this.contentType == null && body.type) {
5482
+ } else if (util7.isBlobLike(body) && this.contentType == null && body.type) {
5483
5483
  this.contentType = body.type;
5484
5484
  this.headers += `content-type: ${body.type}\r
5485
5485
  `;
5486
5486
  }
5487
- util6.validateHandler(handler30, method, upgrade);
5488
- this.servername = util6.getServerName(this.host);
5487
+ util7.validateHandler(handler30, method, upgrade);
5488
+ this.servername = util7.getServerName(this.host);
5489
5489
  this[kHandler] = handler30;
5490
5490
  if (channels.create.hasSubscribers) {
5491
5491
  channels.create.publish({ request: this });
@@ -5900,7 +5900,7 @@ var require_connect = __commonJS({
5900
5900
  init_import_meta_url();
5901
5901
  var net3 = require("net");
5902
5902
  var assert34 = require("assert");
5903
- var util6 = require_util();
5903
+ var util7 = require_util();
5904
5904
  var { InvalidArgumentError, ConnectTimeoutError } = require_errors();
5905
5905
  var tls;
5906
5906
  var SessionCache;
@@ -5966,7 +5966,7 @@ var require_connect = __commonJS({
5966
5966
  if (!tls) {
5967
5967
  tls = require("tls");
5968
5968
  }
5969
- servername = servername || options29.servername || util6.getServerName(host) || null;
5969
+ servername = servername || options29.servername || util7.getServerName(host) || null;
5970
5970
  const sessionKey = servername || hostname2;
5971
5971
  const session = sessionCache.get(sessionKey) || null;
5972
5972
  assert34(sessionKey);
@@ -6046,7 +6046,7 @@ var require_connect = __commonJS({
6046
6046
  }
6047
6047
  __name(setupTimeout2, "setupTimeout");
6048
6048
  function onConnectTimeout(socket) {
6049
- util6.destroy(socket, new ConnectTimeoutError());
6049
+ util7.destroy(socket, new ConnectTimeoutError());
6050
6050
  }
6051
6051
  __name(onConnectTimeout, "onConnectTimeout");
6052
6052
  module3.exports = buildConnector;
@@ -6402,7 +6402,7 @@ var require_RedirectHandler = __commonJS({
6402
6402
  "../../node_modules/.pnpm/undici@5.28.4/node_modules/undici/lib/handler/RedirectHandler.js"(exports2, module3) {
6403
6403
  "use strict";
6404
6404
  init_import_meta_url();
6405
- var util6 = require_util();
6405
+ var util7 = require_util();
6406
6406
  var { kBodyUsed } = require_symbols();
6407
6407
  var assert34 = require("assert");
6408
6408
  var { InvalidArgumentError } = require_errors();
@@ -6426,7 +6426,7 @@ var require_RedirectHandler = __commonJS({
6426
6426
  if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
6427
6427
  throw new InvalidArgumentError("maxRedirections must be a positive number");
6428
6428
  }
6429
- util6.validateHandler(handler30, opts.method, opts.upgrade);
6429
+ util7.validateHandler(handler30, opts.method, opts.upgrade);
6430
6430
  this.dispatch = dispatch;
6431
6431
  this.location = null;
6432
6432
  this.abort = null;
@@ -6434,8 +6434,8 @@ var require_RedirectHandler = __commonJS({
6434
6434
  this.maxRedirections = maxRedirections;
6435
6435
  this.handler = handler30;
6436
6436
  this.history = [];
6437
- if (util6.isStream(this.opts.body)) {
6438
- if (util6.bodyLength(this.opts.body) === 0) {
6437
+ if (util7.isStream(this.opts.body)) {
6438
+ if (util7.bodyLength(this.opts.body) === 0) {
6439
6439
  this.opts.body.on("data", function() {
6440
6440
  assert34(false);
6441
6441
  });
@@ -6448,7 +6448,7 @@ var require_RedirectHandler = __commonJS({
6448
6448
  }
6449
6449
  } else if (this.opts.body && typeof this.opts.body.pipeTo === "function") {
6450
6450
  this.opts.body = new BodyAsyncIterable(this.opts.body);
6451
- } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util6.isIterable(this.opts.body)) {
6451
+ } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util7.isIterable(this.opts.body)) {
6452
6452
  this.opts.body = new BodyAsyncIterable(this.opts.body);
6453
6453
  }
6454
6454
  }
@@ -6463,14 +6463,14 @@ var require_RedirectHandler = __commonJS({
6463
6463
  this.handler.onError(error2);
6464
6464
  }
6465
6465
  onHeaders(statusCode, headers, resume, statusText) {
6466
- this.location = this.history.length >= this.maxRedirections || util6.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers);
6466
+ this.location = this.history.length >= this.maxRedirections || util7.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers);
6467
6467
  if (this.opts.origin) {
6468
6468
  this.history.push(new URL(this.opts.path, this.opts.origin));
6469
6469
  }
6470
6470
  if (!this.location) {
6471
6471
  return this.handler.onHeaders(statusCode, headers, resume, statusText);
6472
6472
  }
6473
- const { origin, pathname, search } = util6.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
6473
+ const { origin, pathname, search } = util7.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
6474
6474
  const path74 = search ? `${pathname}${search}` : pathname;
6475
6475
  this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
6476
6476
  this.opts.path = path74;
@@ -6517,13 +6517,13 @@ var require_RedirectHandler = __commonJS({
6517
6517
  __name(parseLocation, "parseLocation");
6518
6518
  function shouldRemoveHeader(header, removeContent, unknownOrigin) {
6519
6519
  if (header.length === 4) {
6520
- return util6.headerNameToString(header) === "host";
6520
+ return util7.headerNameToString(header) === "host";
6521
6521
  }
6522
- if (removeContent && util6.headerNameToString(header).startsWith("content-")) {
6522
+ if (removeContent && util7.headerNameToString(header).startsWith("content-")) {
6523
6523
  return true;
6524
6524
  }
6525
6525
  if (unknownOrigin && (header.length === 13 || header.length === 6 || header.length === 19)) {
6526
- const name2 = util6.headerNameToString(header);
6526
+ const name2 = util7.headerNameToString(header);
6527
6527
  return name2 === "authorization" || name2 === "cookie" || name2 === "proxy-authorization";
6528
6528
  }
6529
6529
  return false;
@@ -6602,7 +6602,7 @@ var require_client = __commonJS({
6602
6602
  var net3 = require("net");
6603
6603
  var http4 = require("http");
6604
6604
  var { pipeline } = require("stream");
6605
- var util6 = require_util();
6605
+ var util7 = require_util();
6606
6606
  var timers = require_timers();
6607
6607
  var Request3 = require_request();
6608
6608
  var DispatcherBase = require_dispatcher_base();
@@ -6813,12 +6813,12 @@ var require_client = __commonJS({
6813
6813
  allowH2,
6814
6814
  socketPath,
6815
6815
  timeout: connectTimeout,
6816
- ...util6.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
6816
+ ...util7.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
6817
6817
  ...connect3
6818
6818
  });
6819
6819
  }
6820
6820
  this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client) ? interceptors.Client : [createRedirectInterceptor({ maxRedirections })];
6821
- this[kUrl] = util6.parseOrigin(url4);
6821
+ this[kUrl] = util7.parseOrigin(url4);
6822
6822
  this[kConnector] = connect3;
6823
6823
  this[kSocket] = null;
6824
6824
  this[kPipelining] = pipelining != null ? pipelining : 1;
@@ -6887,7 +6887,7 @@ var require_client = __commonJS({
6887
6887
  const request3 = this[kHTTPConnVersion] === "h2" ? Request3[kHTTP2BuildRequest](origin, opts, handler30) : Request3[kHTTP1BuildRequest](origin, opts, handler30);
6888
6888
  this[kQueue].push(request3);
6889
6889
  if (this[kResuming]) {
6890
- } else if (util6.bodyLength(request3.body) == null && util6.isIterable(request3.body)) {
6890
+ } else if (util7.bodyLength(request3.body) == null && util7.isIterable(request3.body)) {
6891
6891
  this[kResuming] = 1;
6892
6892
  process.nextTick(resume, this);
6893
6893
  } else {
@@ -6922,14 +6922,14 @@ var require_client = __commonJS({
6922
6922
  resolve22();
6923
6923
  }, "callback");
6924
6924
  if (this[kHTTP2Session] != null) {
6925
- util6.destroy(this[kHTTP2Session], err);
6925
+ util7.destroy(this[kHTTP2Session], err);
6926
6926
  this[kHTTP2Session] = null;
6927
6927
  this[kHTTP2SessionState] = null;
6928
6928
  }
6929
6929
  if (!this[kSocket]) {
6930
6930
  queueMicrotask(callback);
6931
6931
  } else {
6932
- util6.destroy(this[kSocket].on("close", callback), err);
6932
+ util7.destroy(this[kSocket].on("close", callback), err);
6933
6933
  }
6934
6934
  resume(this);
6935
6935
  });
@@ -6951,8 +6951,8 @@ var require_client = __commonJS({
6951
6951
  }
6952
6952
  __name(onHttp2FrameError, "onHttp2FrameError");
6953
6953
  function onHttp2SessionEnd() {
6954
- util6.destroy(this, new SocketError("other side closed"));
6955
- util6.destroy(this[kSocket], new SocketError("other side closed"));
6954
+ util7.destroy(this, new SocketError("other side closed"));
6955
+ util7.destroy(this[kSocket], new SocketError("other side closed"));
6956
6956
  }
6957
6957
  __name(onHttp2SessionEnd, "onHttp2SessionEnd");
6958
6958
  function onHTTP2GoAway(code) {
@@ -7158,7 +7158,7 @@ var require_client = __commonJS({
7158
7158
  throw new HTTPParserError(message, constants3.ERROR[ret], data.slice(offset));
7159
7159
  }
7160
7160
  } catch (err) {
7161
- util6.destroy(socket, err);
7161
+ util7.destroy(socket, err);
7162
7162
  }
7163
7163
  }
7164
7164
  destroy() {
@@ -7215,7 +7215,7 @@ var require_client = __commonJS({
7215
7215
  trackHeader(len) {
7216
7216
  this.headersSize += len;
7217
7217
  if (this.headersSize >= this.headersMaxSize) {
7218
- util6.destroy(this.socket, new HeadersOverflowError());
7218
+ util7.destroy(this.socket, new HeadersOverflowError());
7219
7219
  }
7220
7220
  }
7221
7221
  onUpgrade(head) {
@@ -7245,7 +7245,7 @@ var require_client = __commonJS({
7245
7245
  try {
7246
7246
  request3.onUpgrade(statusCode, headers, socket);
7247
7247
  } catch (err) {
7248
- util6.destroy(socket, err);
7248
+ util7.destroy(socket, err);
7249
7249
  }
7250
7250
  resume(client);
7251
7251
  }
@@ -7261,11 +7261,11 @@ var require_client = __commonJS({
7261
7261
  assert34(!this.upgrade);
7262
7262
  assert34(this.statusCode < 200);
7263
7263
  if (statusCode === 100) {
7264
- util6.destroy(socket, new SocketError("bad response", util6.getSocketInfo(socket)));
7264
+ util7.destroy(socket, new SocketError("bad response", util7.getSocketInfo(socket)));
7265
7265
  return -1;
7266
7266
  }
7267
7267
  if (upgrade && !request3.upgrade) {
7268
- util6.destroy(socket, new SocketError("bad upgrade", util6.getSocketInfo(socket)));
7268
+ util7.destroy(socket, new SocketError("bad upgrade", util7.getSocketInfo(socket)));
7269
7269
  return -1;
7270
7270
  }
7271
7271
  assert34.strictEqual(this.timeoutType, TIMEOUT_HEADERS);
@@ -7294,7 +7294,7 @@ var require_client = __commonJS({
7294
7294
  this.headers = [];
7295
7295
  this.headersSize = 0;
7296
7296
  if (this.shouldKeepAlive && client[kPipelining]) {
7297
- const keepAliveTimeout = this.keepAlive ? util6.parseKeepAliveTimeout(this.keepAlive) : null;
7297
+ const keepAliveTimeout = this.keepAlive ? util7.parseKeepAliveTimeout(this.keepAlive) : null;
7298
7298
  if (keepAliveTimeout != null) {
7299
7299
  const timeout2 = Math.min(
7300
7300
  keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
@@ -7342,7 +7342,7 @@ var require_client = __commonJS({
7342
7342
  }
7343
7343
  assert34(statusCode >= 200);
7344
7344
  if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
7345
- util6.destroy(socket, new ResponseExceededMaxSizeError());
7345
+ util7.destroy(socket, new ResponseExceededMaxSizeError());
7346
7346
  return -1;
7347
7347
  }
7348
7348
  this.bytesRead += buf.length;
@@ -7374,20 +7374,20 @@ var require_client = __commonJS({
7374
7374
  return;
7375
7375
  }
7376
7376
  if (request3.method !== "HEAD" && contentLength && bytesRead !== parseInt(contentLength, 10)) {
7377
- util6.destroy(socket, new ResponseContentLengthMismatchError());
7377
+ util7.destroy(socket, new ResponseContentLengthMismatchError());
7378
7378
  return -1;
7379
7379
  }
7380
7380
  request3.onComplete(headers);
7381
7381
  client[kQueue][client[kRunningIdx]++] = null;
7382
7382
  if (socket[kWriting]) {
7383
7383
  assert34.strictEqual(client[kRunning], 0);
7384
- util6.destroy(socket, new InformationalError("reset"));
7384
+ util7.destroy(socket, new InformationalError("reset"));
7385
7385
  return constants3.ERROR.PAUSED;
7386
7386
  } else if (!shouldKeepAlive) {
7387
- util6.destroy(socket, new InformationalError("reset"));
7387
+ util7.destroy(socket, new InformationalError("reset"));
7388
7388
  return constants3.ERROR.PAUSED;
7389
7389
  } else if (socket[kReset2] && client[kRunning] === 0) {
7390
- util6.destroy(socket, new InformationalError("reset"));
7390
+ util7.destroy(socket, new InformationalError("reset"));
7391
7391
  return constants3.ERROR.PAUSED;
7392
7392
  } else if (client[kPipelining] === 1) {
7393
7393
  setImmediate(resume, client);
@@ -7402,15 +7402,15 @@ var require_client = __commonJS({
7402
7402
  if (timeoutType === TIMEOUT_HEADERS) {
7403
7403
  if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
7404
7404
  assert34(!parser2.paused, "cannot be paused while waiting for headers");
7405
- util6.destroy(socket, new HeadersTimeoutError());
7405
+ util7.destroy(socket, new HeadersTimeoutError());
7406
7406
  }
7407
7407
  } else if (timeoutType === TIMEOUT_BODY) {
7408
7408
  if (!parser2.paused) {
7409
- util6.destroy(socket, new BodyTimeoutError());
7409
+ util7.destroy(socket, new BodyTimeoutError());
7410
7410
  }
7411
7411
  } else if (timeoutType === TIMEOUT_IDLE) {
7412
7412
  assert34(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]);
7413
- util6.destroy(socket, new InformationalError("socket idle timeout"));
7413
+ util7.destroy(socket, new InformationalError("socket idle timeout"));
7414
7414
  }
7415
7415
  }
7416
7416
  __name(onParserTimeout, "onParserTimeout");
@@ -7454,7 +7454,7 @@ var require_client = __commonJS({
7454
7454
  return;
7455
7455
  }
7456
7456
  }
7457
- util6.destroy(this, new SocketError("other side closed", util6.getSocketInfo(this)));
7457
+ util7.destroy(this, new SocketError("other side closed", util7.getSocketInfo(this)));
7458
7458
  }
7459
7459
  __name(onSocketEnd, "onSocketEnd");
7460
7460
  function onSocketClose() {
@@ -7466,7 +7466,7 @@ var require_client = __commonJS({
7466
7466
  this[kParser].destroy();
7467
7467
  this[kParser] = null;
7468
7468
  }
7469
- const err = this[kError] || new SocketError("closed", util6.getSocketInfo(this));
7469
+ const err = this[kError] || new SocketError("closed", util7.getSocketInfo(this));
7470
7470
  client[kSocket] = null;
7471
7471
  if (client.destroyed) {
7472
7472
  assert34(client[kPending] === 0);
@@ -7529,7 +7529,7 @@ var require_client = __commonJS({
7529
7529
  });
7530
7530
  });
7531
7531
  if (client.destroyed) {
7532
- util6.destroy(socket.on("error", () => {
7532
+ util7.destroy(socket.on("error", () => {
7533
7533
  }), new ClientDestroyedError());
7534
7534
  return;
7535
7535
  }
@@ -7700,7 +7700,7 @@ var require_client = __commonJS({
7700
7700
  }
7701
7701
  client[kServerName] = request3.servername;
7702
7702
  if (socket && socket.servername !== request3.servername) {
7703
- util6.destroy(socket, new InformationalError("servername changed"));
7703
+ util7.destroy(socket, new InformationalError("servername changed"));
7704
7704
  return;
7705
7705
  }
7706
7706
  }
@@ -7720,7 +7720,7 @@ var require_client = __commonJS({
7720
7720
  if (client[kRunning] > 0 && (request3.upgrade || request3.method === "CONNECT")) {
7721
7721
  return;
7722
7722
  }
7723
- if (client[kRunning] > 0 && util6.bodyLength(request3.body) !== 0 && (util6.isStream(request3.body) || util6.isAsyncIterable(request3.body))) {
7723
+ if (client[kRunning] > 0 && util7.bodyLength(request3.body) !== 0 && (util7.isStream(request3.body) || util7.isAsyncIterable(request3.body))) {
7724
7724
  return;
7725
7725
  }
7726
7726
  if (!request3.aborted && write(client, request3)) {
@@ -7745,7 +7745,7 @@ var require_client = __commonJS({
7745
7745
  if (body && typeof body.read === "function") {
7746
7746
  body.read(0);
7747
7747
  }
7748
- const bodyLength = util6.bodyLength(body);
7748
+ const bodyLength = util7.bodyLength(body);
7749
7749
  let contentLength = bodyLength;
7750
7750
  if (contentLength === null) {
7751
7751
  contentLength = request3.contentLength;
@@ -7767,7 +7767,7 @@ var require_client = __commonJS({
7767
7767
  return;
7768
7768
  }
7769
7769
  errorRequest(client, request3, err || new RequestAbortedError());
7770
- util6.destroy(socket, new InformationalError("aborted"));
7770
+ util7.destroy(socket, new InformationalError("aborted"));
7771
7771
  });
7772
7772
  } catch (err) {
7773
7773
  errorRequest(client, request3, err);
@@ -7824,7 +7824,7 @@ upgrade: ${upgrade}\r
7824
7824
  `, "latin1");
7825
7825
  }
7826
7826
  request3.onRequestSent();
7827
- } else if (util6.isBuffer(body)) {
7827
+ } else if (util7.isBuffer(body)) {
7828
7828
  assert34(contentLength === body.byteLength, "buffer body must have content length");
7829
7829
  socket.cork();
7830
7830
  socket.write(`${header}content-length: ${contentLength}\r
@@ -7837,15 +7837,15 @@ upgrade: ${upgrade}\r
7837
7837
  if (!expectsPayload) {
7838
7838
  socket[kReset2] = true;
7839
7839
  }
7840
- } else if (util6.isBlobLike(body)) {
7840
+ } else if (util7.isBlobLike(body)) {
7841
7841
  if (typeof body.stream === "function") {
7842
7842
  writeIterable({ body: body.stream(), client, request: request3, socket, contentLength, header, expectsPayload });
7843
7843
  } else {
7844
7844
  writeBlob({ body, client, request: request3, socket, contentLength, header, expectsPayload });
7845
7845
  }
7846
- } else if (util6.isStream(body)) {
7846
+ } else if (util7.isStream(body)) {
7847
7847
  writeStream({ body, client, request: request3, socket, contentLength, header, expectsPayload });
7848
- } else if (util6.isIterable(body)) {
7848
+ } else if (util7.isIterable(body)) {
7849
7849
  writeIterable({ body, client, request: request3, socket, contentLength, header, expectsPayload });
7850
7850
  } else {
7851
7851
  assert34(false);
@@ -7906,7 +7906,7 @@ upgrade: ${upgrade}\r
7906
7906
  if (body && typeof body.read === "function") {
7907
7907
  body.read(0);
7908
7908
  }
7909
- let contentLength = util6.bodyLength(body);
7909
+ let contentLength = util7.bodyLength(body);
7910
7910
  if (contentLength == null) {
7911
7911
  contentLength = request3.contentLength;
7912
7912
  }
@@ -7961,7 +7961,7 @@ upgrade: ${upgrade}\r
7961
7961
  stream2.once("error", function(err) {
7962
7962
  if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
7963
7963
  h2State.streams -= 1;
7964
- util6.destroy(stream2, err);
7964
+ util7.destroy(stream2, err);
7965
7965
  }
7966
7966
  });
7967
7967
  stream2.once("frameError", (type, code) => {
@@ -7969,14 +7969,14 @@ upgrade: ${upgrade}\r
7969
7969
  errorRequest(client, request3, err);
7970
7970
  if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
7971
7971
  h2State.streams -= 1;
7972
- util6.destroy(stream2, err);
7972
+ util7.destroy(stream2, err);
7973
7973
  }
7974
7974
  });
7975
7975
  return true;
7976
7976
  function writeBodyH2() {
7977
7977
  if (!body) {
7978
7978
  request3.onRequestSent();
7979
- } else if (util6.isBuffer(body)) {
7979
+ } else if (util7.isBuffer(body)) {
7980
7980
  assert34(contentLength === body.byteLength, "buffer body must have content length");
7981
7981
  stream2.cork();
7982
7982
  stream2.write(body);
@@ -7984,7 +7984,7 @@ upgrade: ${upgrade}\r
7984
7984
  stream2.end();
7985
7985
  request3.onBodySent(body);
7986
7986
  request3.onRequestSent();
7987
- } else if (util6.isBlobLike(body)) {
7987
+ } else if (util7.isBlobLike(body)) {
7988
7988
  if (typeof body.stream === "function") {
7989
7989
  writeIterable({
7990
7990
  client,
@@ -8008,7 +8008,7 @@ upgrade: ${upgrade}\r
8008
8008
  socket: client[kSocket]
8009
8009
  });
8010
8010
  }
8011
- } else if (util6.isStream(body)) {
8011
+ } else if (util7.isStream(body)) {
8012
8012
  writeStream({
8013
8013
  body,
8014
8014
  client,
@@ -8019,7 +8019,7 @@ upgrade: ${upgrade}\r
8019
8019
  h2stream: stream2,
8020
8020
  header: ""
8021
8021
  });
8022
- } else if (util6.isIterable(body)) {
8022
+ } else if (util7.isIterable(body)) {
8023
8023
  writeIterable({
8024
8024
  body,
8025
8025
  client,
@@ -8049,8 +8049,8 @@ upgrade: ${upgrade}\r
8049
8049
  h2stream,
8050
8050
  (err) => {
8051
8051
  if (err) {
8052
- util6.destroy(body, err);
8053
- util6.destroy(h2stream, err);
8052
+ util7.destroy(body, err);
8053
+ util7.destroy(h2stream, err);
8054
8054
  } else {
8055
8055
  request3.onRequestSent();
8056
8056
  }
@@ -8059,7 +8059,7 @@ upgrade: ${upgrade}\r
8059
8059
  pipe.on("data", onPipeData);
8060
8060
  pipe.once("end", () => {
8061
8061
  pipe.removeListener("data", onPipeData);
8062
- util6.destroy(pipe);
8062
+ util7.destroy(pipe);
8063
8063
  });
8064
8064
  return;
8065
8065
  }
@@ -8074,7 +8074,7 @@ upgrade: ${upgrade}\r
8074
8074
  this.pause();
8075
8075
  }
8076
8076
  } catch (err) {
8077
- util6.destroy(this, err);
8077
+ util7.destroy(this, err);
8078
8078
  }
8079
8079
  }, "onData");
8080
8080
  const onDrain = /* @__PURE__ */ __name(function() {
@@ -8109,9 +8109,9 @@ upgrade: ${upgrade}\r
8109
8109
  }
8110
8110
  writer.destroy(err);
8111
8111
  if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) {
8112
- util6.destroy(body, err);
8112
+ util7.destroy(body, err);
8113
8113
  } else {
8114
- util6.destroy(body);
8114
+ util7.destroy(body);
8115
8115
  }
8116
8116
  }, "onFinished");
8117
8117
  body.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onAbort);
@@ -8148,7 +8148,7 @@ upgrade: ${upgrade}\r
8148
8148
  }
8149
8149
  resume(client);
8150
8150
  } catch (err) {
8151
- util6.destroy(isH2 ? h2stream : socket, err);
8151
+ util7.destroy(isH2 ? h2stream : socket, err);
8152
8152
  }
8153
8153
  }
8154
8154
  __name(writeBlob, "writeBlob");
@@ -8314,7 +8314,7 @@ ${len.toString(16)}\r
8314
8314
  socket[kWriting] = false;
8315
8315
  if (err) {
8316
8316
  assert34(client[kRunning] <= 1, "pipeline should only contain this request");
8317
- util6.destroy(socket, err);
8317
+ util7.destroy(socket, err);
8318
8318
  }
8319
8319
  }
8320
8320
  };
@@ -8598,7 +8598,7 @@ var require_pool = __commonJS({
8598
8598
  var {
8599
8599
  InvalidArgumentError
8600
8600
  } = require_errors();
8601
- var util6 = require_util();
8601
+ var util7 = require_util();
8602
8602
  var { kUrl, kInterceptors } = require_symbols();
8603
8603
  var buildConnector = require_connect();
8604
8604
  var kOptions = Symbol("options");
@@ -8639,14 +8639,14 @@ var require_pool = __commonJS({
8639
8639
  allowH2,
8640
8640
  socketPath,
8641
8641
  timeout: connectTimeout,
8642
- ...util6.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
8642
+ ...util7.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
8643
8643
  ...connect2
8644
8644
  });
8645
8645
  }
8646
8646
  this[kInterceptors] = options29.interceptors && options29.interceptors.Pool && Array.isArray(options29.interceptors.Pool) ? options29.interceptors.Pool : [];
8647
8647
  this[kConnections] = connections || null;
8648
- this[kUrl] = util6.parseOrigin(origin);
8649
- this[kOptions] = { ...util6.deepClone(options29), connect: connect2, allowH2 };
8648
+ this[kUrl] = util7.parseOrigin(origin);
8649
+ this[kOptions] = { ...util7.deepClone(options29), connect: connect2, allowH2 };
8650
8650
  this[kOptions].interceptors = options29.interceptors ? { ...options29.interceptors } : void 0;
8651
8651
  this[kFactory] = factory;
8652
8652
  }
@@ -8862,7 +8862,7 @@ var require_agent = __commonJS({
8862
8862
  var DispatcherBase = require_dispatcher_base();
8863
8863
  var Pool = require_pool();
8864
8864
  var Client = require_client();
8865
- var util6 = require_util();
8865
+ var util7 = require_util();
8866
8866
  var createRedirectInterceptor = require_redirectInterceptor();
8867
8867
  var { WeakRef: WeakRef2, FinalizationRegistry: FinalizationRegistry2 } = require_dispatcher_weakref()();
8868
8868
  var kOnConnect = Symbol("onConnect");
@@ -8893,7 +8893,7 @@ var require_agent = __commonJS({
8893
8893
  connect2 = { ...connect2 };
8894
8894
  }
8895
8895
  this[kInterceptors] = options29.interceptors && options29.interceptors.Agent && Array.isArray(options29.interceptors.Agent) ? options29.interceptors.Agent : [createRedirectInterceptor({ maxRedirections })];
8896
- this[kOptions] = { ...util6.deepClone(options29), connect: connect2 };
8896
+ this[kOptions] = { ...util7.deepClone(options29), connect: connect2 };
8897
8897
  this[kOptions].interceptors = options29.interceptors ? { ...options29.interceptors } : void 0;
8898
8898
  this[kMaxRedirections] = maxRedirections;
8899
8899
  this[kFactory] = factory;
@@ -8981,7 +8981,7 @@ var require_readable = __commonJS({
8981
8981
  var assert34 = require("assert");
8982
8982
  var { Readable: Readable2 } = require("stream");
8983
8983
  var { RequestAbortedError, NotSupportedError, InvalidArgumentError } = require_errors();
8984
- var util6 = require_util();
8984
+ var util7 = require_util();
8985
8985
  var { ReadableStreamFrom, toUSVString } = require_util();
8986
8986
  var Blob6;
8987
8987
  var kConsume = Symbol("kConsume");
@@ -9079,7 +9079,7 @@ var require_readable = __commonJS({
9079
9079
  }
9080
9080
  // https://fetch.spec.whatwg.org/#dom-body-bodyused
9081
9081
  get bodyUsed() {
9082
- return util6.isDisturbed(this);
9082
+ return util7.isDisturbed(this);
9083
9083
  }
9084
9084
  // https://fetch.spec.whatwg.org/#dom-body-body
9085
9085
  get body() {
@@ -9100,7 +9100,7 @@ var require_readable = __commonJS({
9100
9100
  if (typeof signal !== "object" || !("aborted" in signal)) {
9101
9101
  throw new InvalidArgumentError("signal must be an AbortSignal");
9102
9102
  }
9103
- util6.throwIfAborted(signal);
9103
+ util7.throwIfAborted(signal);
9104
9104
  } catch (err) {
9105
9105
  return Promise.reject(err);
9106
9106
  }
@@ -9109,7 +9109,7 @@ var require_readable = __commonJS({
9109
9109
  return Promise.resolve(null);
9110
9110
  }
9111
9111
  return new Promise((resolve22, reject) => {
9112
- const signalListenerCleanup = signal ? util6.addAbortListener(signal, () => {
9112
+ const signalListenerCleanup = signal ? util7.addAbortListener(signal, () => {
9113
9113
  this.destroy();
9114
9114
  }) : noop;
9115
9115
  this.on("close", function() {
@@ -9133,7 +9133,7 @@ var require_readable = __commonJS({
9133
9133
  }
9134
9134
  __name(isLocked, "isLocked");
9135
9135
  function isUnusable(self2) {
9136
- return util6.isDisturbed(self2) || isLocked(self2);
9136
+ return util7.isDisturbed(self2) || isLocked(self2);
9137
9137
  }
9138
9138
  __name(isUnusable, "isUnusable");
9139
9139
  async function consume(stream2, type) {
@@ -9341,7 +9341,7 @@ var require_api_request = __commonJS({
9341
9341
  InvalidArgumentError,
9342
9342
  RequestAbortedError
9343
9343
  } = require_errors();
9344
- var util6 = require_util();
9344
+ var util7 = require_util();
9345
9345
  var { getResolveErrorBodyCallback } = require_util3();
9346
9346
  var { AsyncResource } = require("async_hooks");
9347
9347
  var { addSignal, removeSignal } = require_abort_signal();
@@ -9369,8 +9369,8 @@ var require_api_request = __commonJS({
9369
9369
  }
9370
9370
  super("UNDICI_REQUEST");
9371
9371
  } catch (err) {
9372
- if (util6.isStream(body)) {
9373
- util6.destroy(body.on("error", util6.nop), err);
9372
+ if (util7.isStream(body)) {
9373
+ util7.destroy(body.on("error", util7.nop), err);
9374
9374
  }
9375
9375
  throw err;
9376
9376
  }
@@ -9385,7 +9385,7 @@ var require_api_request = __commonJS({
9385
9385
  this.onInfo = onInfo || null;
9386
9386
  this.throwOnError = throwOnError;
9387
9387
  this.highWaterMark = highWaterMark;
9388
- if (util6.isStream(body)) {
9388
+ if (util7.isStream(body)) {
9389
9389
  body.on("error", (err) => {
9390
9390
  this.onError(err);
9391
9391
  });
@@ -9401,14 +9401,14 @@ var require_api_request = __commonJS({
9401
9401
  }
9402
9402
  onHeaders(statusCode, rawHeaders, resume, statusMessage) {
9403
9403
  const { callback, opaque, abort, context: context2, responseHeaders, highWaterMark } = this;
9404
- const headers = responseHeaders === "raw" ? util6.parseRawHeaders(rawHeaders) : util6.parseHeaders(rawHeaders);
9404
+ const headers = responseHeaders === "raw" ? util7.parseRawHeaders(rawHeaders) : util7.parseHeaders(rawHeaders);
9405
9405
  if (statusCode < 200) {
9406
9406
  if (this.onInfo) {
9407
9407
  this.onInfo({ statusCode, headers });
9408
9408
  }
9409
9409
  return;
9410
9410
  }
9411
- const parsedHeaders = responseHeaders === "raw" ? util6.parseHeaders(rawHeaders) : headers;
9411
+ const parsedHeaders = responseHeaders === "raw" ? util7.parseHeaders(rawHeaders) : headers;
9412
9412
  const contentType = parsedHeaders["content-type"];
9413
9413
  const body = new Readable2({ resume, abort, contentType, highWaterMark });
9414
9414
  this.callback = null;
@@ -9439,7 +9439,7 @@ var require_api_request = __commonJS({
9439
9439
  onComplete(trailers) {
9440
9440
  const { res } = this;
9441
9441
  removeSignal(this);
9442
- util6.parseHeaders(trailers, this.trailers);
9442
+ util7.parseHeaders(trailers, this.trailers);
9443
9443
  res.push(null);
9444
9444
  }
9445
9445
  onError(err) {
@@ -9454,12 +9454,12 @@ var require_api_request = __commonJS({
9454
9454
  if (res) {
9455
9455
  this.res = null;
9456
9456
  queueMicrotask(() => {
9457
- util6.destroy(res, err);
9457
+ util7.destroy(res, err);
9458
9458
  });
9459
9459
  }
9460
9460
  if (body) {
9461
9461
  this.body = null;
9462
- util6.destroy(body, err);
9462
+ util7.destroy(body, err);
9463
9463
  }
9464
9464
  }
9465
9465
  };
@@ -9499,7 +9499,7 @@ var require_api_stream = __commonJS({
9499
9499
  InvalidReturnValueError,
9500
9500
  RequestAbortedError
9501
9501
  } = require_errors();
9502
- var util6 = require_util();
9502
+ var util7 = require_util();
9503
9503
  var { getResolveErrorBodyCallback } = require_util3();
9504
9504
  var { AsyncResource } = require("async_hooks");
9505
9505
  var { addSignal, removeSignal } = require_abort_signal();
@@ -9527,8 +9527,8 @@ var require_api_stream = __commonJS({
9527
9527
  }
9528
9528
  super("UNDICI_STREAM");
9529
9529
  } catch (err) {
9530
- if (util6.isStream(body)) {
9531
- util6.destroy(body.on("error", util6.nop), err);
9530
+ if (util7.isStream(body)) {
9531
+ util7.destroy(body.on("error", util7.nop), err);
9532
9532
  }
9533
9533
  throw err;
9534
9534
  }
@@ -9543,7 +9543,7 @@ var require_api_stream = __commonJS({
9543
9543
  this.body = body;
9544
9544
  this.onInfo = onInfo || null;
9545
9545
  this.throwOnError = throwOnError || false;
9546
- if (util6.isStream(body)) {
9546
+ if (util7.isStream(body)) {
9547
9547
  body.on("error", (err) => {
9548
9548
  this.onError(err);
9549
9549
  });
@@ -9559,7 +9559,7 @@ var require_api_stream = __commonJS({
9559
9559
  }
9560
9560
  onHeaders(statusCode, rawHeaders, resume, statusMessage) {
9561
9561
  const { factory, opaque, context: context2, callback, responseHeaders } = this;
9562
- const headers = responseHeaders === "raw" ? util6.parseRawHeaders(rawHeaders) : util6.parseHeaders(rawHeaders);
9562
+ const headers = responseHeaders === "raw" ? util7.parseRawHeaders(rawHeaders) : util7.parseHeaders(rawHeaders);
9563
9563
  if (statusCode < 200) {
9564
9564
  if (this.onInfo) {
9565
9565
  this.onInfo({ statusCode, headers });
@@ -9569,7 +9569,7 @@ var require_api_stream = __commonJS({
9569
9569
  this.factory = null;
9570
9570
  let res;
9571
9571
  if (this.throwOnError && statusCode >= 400) {
9572
- const parsedHeaders = responseHeaders === "raw" ? util6.parseHeaders(rawHeaders) : headers;
9572
+ const parsedHeaders = responseHeaders === "raw" ? util7.parseHeaders(rawHeaders) : headers;
9573
9573
  const contentType = parsedHeaders["content-type"];
9574
9574
  res = new PassThrough2();
9575
9575
  this.callback = null;
@@ -9595,7 +9595,7 @@ var require_api_stream = __commonJS({
9595
9595
  const { callback: callback2, res: res2, opaque: opaque2, trailers, abort } = this;
9596
9596
  this.res = null;
9597
9597
  if (err || !res2.readable) {
9598
- util6.destroy(res2, err);
9598
+ util7.destroy(res2, err);
9599
9599
  }
9600
9600
  this.callback = null;
9601
9601
  this.runInAsyncScope(callback2, null, err || null, { opaque: opaque2, trailers });
@@ -9619,7 +9619,7 @@ var require_api_stream = __commonJS({
9619
9619
  if (!res) {
9620
9620
  return;
9621
9621
  }
9622
- this.trailers = util6.parseHeaders(trailers);
9622
+ this.trailers = util7.parseHeaders(trailers);
9623
9623
  res.end();
9624
9624
  }
9625
9625
  onError(err) {
@@ -9628,7 +9628,7 @@ var require_api_stream = __commonJS({
9628
9628
  this.factory = null;
9629
9629
  if (res) {
9630
9630
  this.res = null;
9631
- util6.destroy(res, err);
9631
+ util7.destroy(res, err);
9632
9632
  } else if (callback) {
9633
9633
  this.callback = null;
9634
9634
  queueMicrotask(() => {
@@ -9637,7 +9637,7 @@ var require_api_stream = __commonJS({
9637
9637
  }
9638
9638
  if (body) {
9639
9639
  this.body = null;
9640
- util6.destroy(body, err);
9640
+ util7.destroy(body, err);
9641
9641
  }
9642
9642
  }
9643
9643
  };
@@ -9680,7 +9680,7 @@ var require_api_pipeline = __commonJS({
9680
9680
  InvalidReturnValueError,
9681
9681
  RequestAbortedError
9682
9682
  } = require_errors();
9683
- var util6 = require_util();
9683
+ var util7 = require_util();
9684
9684
  var { AsyncResource } = require("async_hooks");
9685
9685
  var { addSignal, removeSignal } = require_abort_signal();
9686
9686
  var assert34 = require("assert");
@@ -9744,7 +9744,7 @@ var require_api_pipeline = __commonJS({
9744
9744
  this.abort = null;
9745
9745
  this.context = null;
9746
9746
  this.onInfo = onInfo || null;
9747
- this.req = new PipelineRequest().on("error", util6.nop);
9747
+ this.req = new PipelineRequest().on("error", util7.nop);
9748
9748
  this.ret = new Duplex({
9749
9749
  readableObjectMode: opts.objectMode,
9750
9750
  autoDestroy: true,
@@ -9770,9 +9770,9 @@ var require_api_pipeline = __commonJS({
9770
9770
  if (abort && err) {
9771
9771
  abort();
9772
9772
  }
9773
- util6.destroy(body, err);
9774
- util6.destroy(req, err);
9775
- util6.destroy(res, err);
9773
+ util7.destroy(body, err);
9774
+ util7.destroy(req, err);
9775
+ util7.destroy(res, err);
9776
9776
  removeSignal(this);
9777
9777
  callback(err);
9778
9778
  }
@@ -9796,7 +9796,7 @@ var require_api_pipeline = __commonJS({
9796
9796
  const { opaque, handler: handler30, context: context2 } = this;
9797
9797
  if (statusCode < 200) {
9798
9798
  if (this.onInfo) {
9799
- const headers = this.responseHeaders === "raw" ? util6.parseRawHeaders(rawHeaders) : util6.parseHeaders(rawHeaders);
9799
+ const headers = this.responseHeaders === "raw" ? util7.parseRawHeaders(rawHeaders) : util7.parseHeaders(rawHeaders);
9800
9800
  this.onInfo({ statusCode, headers });
9801
9801
  }
9802
9802
  return;
@@ -9805,7 +9805,7 @@ var require_api_pipeline = __commonJS({
9805
9805
  let body;
9806
9806
  try {
9807
9807
  this.handler = null;
9808
- const headers = this.responseHeaders === "raw" ? util6.parseRawHeaders(rawHeaders) : util6.parseHeaders(rawHeaders);
9808
+ const headers = this.responseHeaders === "raw" ? util7.parseRawHeaders(rawHeaders) : util7.parseHeaders(rawHeaders);
9809
9809
  body = this.runInAsyncScope(handler30, null, {
9810
9810
  statusCode,
9811
9811
  headers,
@@ -9814,7 +9814,7 @@ var require_api_pipeline = __commonJS({
9814
9814
  context: context2
9815
9815
  });
9816
9816
  } catch (err) {
9817
- this.res.on("error", util6.nop);
9817
+ this.res.on("error", util7.nop);
9818
9818
  throw err;
9819
9819
  }
9820
9820
  if (!body || typeof body.on !== "function") {
@@ -9827,14 +9827,14 @@ var require_api_pipeline = __commonJS({
9827
9827
  }
9828
9828
  }).on("error", (err) => {
9829
9829
  const { ret } = this;
9830
- util6.destroy(ret, err);
9830
+ util7.destroy(ret, err);
9831
9831
  }).on("end", () => {
9832
9832
  const { ret } = this;
9833
9833
  ret.push(null);
9834
9834
  }).on("close", () => {
9835
9835
  const { ret } = this;
9836
9836
  if (!ret._readableState.ended) {
9837
- util6.destroy(ret, new RequestAbortedError());
9837
+ util7.destroy(ret, new RequestAbortedError());
9838
9838
  }
9839
9839
  });
9840
9840
  this.body = body;
@@ -9850,7 +9850,7 @@ var require_api_pipeline = __commonJS({
9850
9850
  onError(err) {
9851
9851
  const { ret } = this;
9852
9852
  this.handler = null;
9853
- util6.destroy(ret, err);
9853
+ util7.destroy(ret, err);
9854
9854
  }
9855
9855
  };
9856
9856
  __name(PipelineHandler, "PipelineHandler");
@@ -9875,7 +9875,7 @@ var require_api_upgrade = __commonJS({
9875
9875
  init_import_meta_url();
9876
9876
  var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors();
9877
9877
  var { AsyncResource } = require("async_hooks");
9878
- var util6 = require_util();
9878
+ var util7 = require_util();
9879
9879
  var { addSignal, removeSignal } = require_abort_signal();
9880
9880
  var assert34 = require("assert");
9881
9881
  var UpgradeHandler = class extends AsyncResource {
@@ -9913,7 +9913,7 @@ var require_api_upgrade = __commonJS({
9913
9913
  assert34.strictEqual(statusCode, 101);
9914
9914
  removeSignal(this);
9915
9915
  this.callback = null;
9916
- const headers = this.responseHeaders === "raw" ? util6.parseRawHeaders(rawHeaders) : util6.parseHeaders(rawHeaders);
9916
+ const headers = this.responseHeaders === "raw" ? util7.parseRawHeaders(rawHeaders) : util7.parseHeaders(rawHeaders);
9917
9917
  this.runInAsyncScope(callback, null, null, {
9918
9918
  headers,
9919
9919
  socket,
@@ -9968,7 +9968,7 @@ var require_api_connect = __commonJS({
9968
9968
  init_import_meta_url();
9969
9969
  var { AsyncResource } = require("async_hooks");
9970
9970
  var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors();
9971
- var util6 = require_util();
9971
+ var util7 = require_util();
9972
9972
  var { addSignal, removeSignal } = require_abort_signal();
9973
9973
  var ConnectHandler = class extends AsyncResource {
9974
9974
  constructor(opts, callback) {
@@ -10005,7 +10005,7 @@ var require_api_connect = __commonJS({
10005
10005
  this.callback = null;
10006
10006
  let headers = rawHeaders;
10007
10007
  if (headers != null) {
10008
- headers = this.responseHeaders === "raw" ? util6.parseRawHeaders(rawHeaders) : util6.parseHeaders(rawHeaders);
10008
+ headers = this.responseHeaders === "raw" ? util7.parseRawHeaders(rawHeaders) : util7.parseHeaders(rawHeaders);
10009
10009
  }
10010
10010
  this.runInAsyncScope(callback, null, null, {
10011
10011
  statusCode,
@@ -11806,8 +11806,8 @@ var require_response = __commonJS({
11806
11806
  init_import_meta_url();
11807
11807
  var { Headers: Headers5, HeadersList, fill: fill2 } = require_headers();
11808
11808
  var { extractBody, cloneBody, mixinBody } = require_body();
11809
- var util6 = require_util();
11810
- var { kEnumerableProperty } = util6;
11809
+ var util7 = require_util();
11810
+ var { kEnumerableProperty } = util7;
11811
11811
  var {
11812
11812
  isValidReasonPhrase,
11813
11813
  isCancelled,
@@ -11824,7 +11824,7 @@ var require_response = __commonJS({
11824
11824
  } = require_constants2();
11825
11825
  var { kState, kHeaders, kGuard, kRealm } = require_symbols2();
11826
11826
  var { webidl } = require_webidl();
11827
- var { FormData: FormData11 } = require_formdata();
11827
+ var { FormData: FormData12 } = require_formdata();
11828
11828
  var { getGlobalOrigin } = require_global();
11829
11829
  var { URLSerializer } = require_dataURL();
11830
11830
  var { kHeadersList, kConstruct } = require_symbols();
@@ -11953,7 +11953,7 @@ var require_response = __commonJS({
11953
11953
  }
11954
11954
  get bodyUsed() {
11955
11955
  webidl.brandCheck(this, Response9);
11956
- return !!this[kState].body && util6.isDisturbed(this[kState].body.stream);
11956
+ return !!this[kState].body && util7.isDisturbed(this[kState].body.stream);
11957
11957
  }
11958
11958
  // Returns a clone of response.
11959
11959
  clone() {
@@ -12128,7 +12128,7 @@ var require_response = __commonJS({
12128
12128
  ReadableStream2
12129
12129
  );
12130
12130
  webidl.converters.FormData = webidl.interfaceConverter(
12131
- FormData11
12131
+ FormData12
12132
12132
  );
12133
12133
  webidl.converters.URLSearchParams = webidl.interfaceConverter(
12134
12134
  URLSearchParams
@@ -12143,7 +12143,7 @@ var require_response = __commonJS({
12143
12143
  if (types.isArrayBuffer(V2) || types.isTypedArray(V2) || types.isDataView(V2)) {
12144
12144
  return webidl.converters.BufferSource(V2);
12145
12145
  }
12146
- if (util6.isFormDataLike(V2)) {
12146
+ if (util7.isFormDataLike(V2)) {
12147
12147
  return webidl.converters.FormData(V2, { strict: false });
12148
12148
  }
12149
12149
  if (V2 instanceof URLSearchParams) {
@@ -12195,7 +12195,7 @@ var require_request2 = __commonJS({
12195
12195
  var { extractBody, mixinBody, cloneBody } = require_body();
12196
12196
  var { Headers: Headers5, fill: fillHeaders, HeadersList } = require_headers();
12197
12197
  var { FinalizationRegistry: FinalizationRegistry2 } = require_dispatcher_weakref()();
12198
- var util6 = require_util();
12198
+ var util7 = require_util();
12199
12199
  var {
12200
12200
  isValidHTTPToken,
12201
12201
  sameOrigin,
@@ -12213,7 +12213,7 @@ var require_request2 = __commonJS({
12213
12213
  requestCache,
12214
12214
  requestDuplex
12215
12215
  } = require_constants2();
12216
- var { kEnumerableProperty } = util6;
12216
+ var { kEnumerableProperty } = util7;
12217
12217
  var { kHeaders, kSignal, kState, kGuard, kRealm } = require_symbols2();
12218
12218
  var { webidl } = require_webidl();
12219
12219
  var { getGlobalOrigin } = require_global();
@@ -12433,7 +12433,7 @@ var require_request2 = __commonJS({
12433
12433
  }
12434
12434
  } catch {
12435
12435
  }
12436
- util6.addAbortListener(signal, abort);
12436
+ util7.addAbortListener(signal, abort);
12437
12437
  requestFinalizer.register(ac, { signal, abort });
12438
12438
  }
12439
12439
  }
@@ -12491,7 +12491,7 @@ var require_request2 = __commonJS({
12491
12491
  }
12492
12492
  let finalBody = inputOrInitBody;
12493
12493
  if (initBody == null && inputBody != null) {
12494
- if (util6.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
12494
+ if (util7.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
12495
12495
  throw new TypeError(
12496
12496
  "Cannot construct a Request with a Request object that has already been used."
12497
12497
  );
@@ -12620,7 +12620,7 @@ var require_request2 = __commonJS({
12620
12620
  }
12621
12621
  get bodyUsed() {
12622
12622
  webidl.brandCheck(this, Request3);
12623
- return !!this[kState].body && util6.isDisturbed(this[kState].body.stream);
12623
+ return !!this[kState].body && util7.isDisturbed(this[kState].body.stream);
12624
12624
  }
12625
12625
  get duplex() {
12626
12626
  webidl.brandCheck(this, Request3);
@@ -12644,7 +12644,7 @@ var require_request2 = __commonJS({
12644
12644
  if (this.signal.aborted) {
12645
12645
  ac.abort(this.signal.reason);
12646
12646
  } else {
12647
- util6.addAbortListener(
12647
+ util7.addAbortListener(
12648
12648
  this.signal,
12649
12649
  () => {
12650
12650
  ac.abort(this.signal.reason);
@@ -17138,7 +17138,7 @@ var require_undici = __commonJS({
17138
17138
  var Pool = require_pool();
17139
17139
  var BalancedPool = require_balanced_pool();
17140
17140
  var Agent = require_agent();
17141
- var util6 = require_util();
17141
+ var util7 = require_util();
17142
17142
  var { InvalidArgumentError } = errors;
17143
17143
  var api = require_api();
17144
17144
  var buildConnector = require_connect();
@@ -17192,12 +17192,12 @@ var require_undici = __commonJS({
17192
17192
  if (!opts.path.startsWith("/")) {
17193
17193
  path74 = `/${path74}`;
17194
17194
  }
17195
- url4 = new URL(util6.parseOrigin(url4).origin + path74);
17195
+ url4 = new URL(util7.parseOrigin(url4).origin + path74);
17196
17196
  } else {
17197
17197
  if (!opts) {
17198
17198
  opts = typeof url4 === "object" ? url4 : {};
17199
17199
  }
17200
- url4 = util6.parseURL(url4);
17200
+ url4 = util7.parseURL(url4);
17201
17201
  }
17202
17202
  const { agent, dispatcher = getGlobalDispatcher2() } = opts;
17203
17203
  if (agent) {
@@ -17214,7 +17214,7 @@ var require_undici = __commonJS({
17214
17214
  __name(makeDispatcher, "makeDispatcher");
17215
17215
  module3.exports.setGlobalDispatcher = setGlobalDispatcher2;
17216
17216
  module3.exports.getGlobalDispatcher = getGlobalDispatcher2;
17217
- if (util6.nodeMajor > 16 || util6.nodeMajor === 16 && util6.nodeMinor >= 8) {
17217
+ if (util7.nodeMajor > 16 || util7.nodeMajor === 16 && util7.nodeMinor >= 8) {
17218
17218
  let fetchImpl = null;
17219
17219
  module3.exports.fetch = /* @__PURE__ */ __name(async function fetch16(resource) {
17220
17220
  if (!fetchImpl) {
@@ -17242,7 +17242,7 @@ var require_undici = __commonJS({
17242
17242
  const { kConstruct } = require_symbols4();
17243
17243
  module3.exports.caches = new CacheStorage2(kConstruct);
17244
17244
  }
17245
- if (util6.nodeMajor >= 16) {
17245
+ if (util7.nodeMajor >= 16) {
17246
17246
  const { deleteCookie, getCookies, getSetCookies, setCookie } = require_cookies();
17247
17247
  module3.exports.deleteCookie = deleteCookie;
17248
17248
  module3.exports.getCookies = getCookies;
@@ -17252,7 +17252,7 @@ var require_undici = __commonJS({
17252
17252
  module3.exports.parseMIMEType = parseMIMEType;
17253
17253
  module3.exports.serializeAMimeType = serializeAMimeType;
17254
17254
  }
17255
- if (util6.nodeMajor >= 18 && hasCrypto) {
17255
+ if (util7.nodeMajor >= 18 && hasCrypto) {
17256
17256
  const { WebSocket: WebSocket2 } = require_websocket();
17257
17257
  module3.exports.WebSocket = WebSocket2;
17258
17258
  }
@@ -55604,7 +55604,7 @@ var require_colors = __commonJS({
55604
55604
  var colors = {};
55605
55605
  module3["exports"] = colors;
55606
55606
  colors.themes = {};
55607
- var util6 = require("util");
55607
+ var util7 = require("util");
55608
55608
  var ansiStyles3 = colors.styles = require_styles2();
55609
55609
  var defineProps = Object.defineProperties;
55610
55610
  var newLineRegex = new RegExp(/[\r\n]+/g);
@@ -55668,7 +55668,7 @@ var require_colors = __commonJS({
55668
55668
  if (arg != null && arg.constructor === String) {
55669
55669
  return arg;
55670
55670
  } else {
55671
- return util6.inspect(arg);
55671
+ return util7.inspect(arg);
55672
55672
  }
55673
55673
  }).join(" ");
55674
55674
  if (!colors.enabled || !str) {
@@ -73061,14 +73061,14 @@ var require_inherits = __commonJS({
73061
73061
  "../../node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits.js"(exports2, module3) {
73062
73062
  init_import_meta_url();
73063
73063
  try {
73064
- util6 = require("util");
73065
- if (typeof util6.inherits !== "function")
73064
+ util7 = require("util");
73065
+ if (typeof util7.inherits !== "function")
73066
73066
  throw "";
73067
- module3.exports = util6.inherits;
73067
+ module3.exports = util7.inherits;
73068
73068
  } catch (e3) {
73069
73069
  module3.exports = require_inherits_browser();
73070
73070
  }
73071
- var util6;
73071
+ var util7;
73072
73072
  }
73073
73073
  });
73074
73074
 
@@ -73588,7 +73588,7 @@ var require_node4 = __commonJS({
73588
73588
  "../../node_modules/.pnpm/debug@2.6.9_supports-color@9.2.2/node_modules/debug/src/node.js"(exports2, module3) {
73589
73589
  init_import_meta_url();
73590
73590
  var tty3 = require("tty");
73591
- var util6 = require("util");
73591
+ var util7 = require("util");
73592
73592
  exports2 = module3.exports = require_debug2();
73593
73593
  exports2.init = init3;
73594
73594
  exports2.log = log2;
@@ -73617,7 +73617,7 @@ var require_node4 = __commonJS({
73617
73617
  }, {});
73618
73618
  var fd = parseInt(process.env.DEBUG_FD, 10) || 2;
73619
73619
  if (1 !== fd && 2 !== fd) {
73620
- util6.deprecate(function() {
73620
+ util7.deprecate(function() {
73621
73621
  }, "except for stderr(2) and stdout(1), any other usage of DEBUG_FD is deprecated. Override debug.log if you want to use a different log function (https://git.io/debug_fd)")();
73622
73622
  }
73623
73623
  var stream2 = 1 === fd ? process.stdout : 2 === fd ? process.stderr : createWritableStdioStream(fd);
@@ -73627,13 +73627,13 @@ var require_node4 = __commonJS({
73627
73627
  __name(useColors, "useColors");
73628
73628
  exports2.formatters.o = function(v2) {
73629
73629
  this.inspectOpts.colors = this.useColors;
73630
- return util6.inspect(v2, this.inspectOpts).split("\n").map(function(str) {
73630
+ return util7.inspect(v2, this.inspectOpts).split("\n").map(function(str) {
73631
73631
  return str.trim();
73632
73632
  }).join(" ");
73633
73633
  };
73634
73634
  exports2.formatters.O = function(v2) {
73635
73635
  this.inspectOpts.colors = this.useColors;
73636
- return util6.inspect(v2, this.inspectOpts);
73636
+ return util7.inspect(v2, this.inspectOpts);
73637
73637
  };
73638
73638
  function formatArgs(args) {
73639
73639
  var name2 = this.namespace;
@@ -73649,7 +73649,7 @@ var require_node4 = __commonJS({
73649
73649
  }
73650
73650
  __name(formatArgs, "formatArgs");
73651
73651
  function log2() {
73652
- return stream2.write(util6.format.apply(util6, arguments) + "\n");
73652
+ return stream2.write(util7.format.apply(util7, arguments) + "\n");
73653
73653
  }
73654
73654
  __name(log2, "log");
73655
73655
  function save(namespaces) {
@@ -90950,7 +90950,7 @@ var require_send = __commonJS({
90950
90950
  var path74 = require("path");
90951
90951
  var statuses = require_statuses();
90952
90952
  var Stream = require("stream");
90953
- var util6 = require("util");
90953
+ var util7 = require("util");
90954
90954
  var extname5 = path74.extname;
90955
90955
  var join18 = path74.join;
90956
90956
  var normalize4 = path74.normalize;
@@ -90998,7 +90998,7 @@ var require_send = __commonJS({
90998
90998
  }
90999
90999
  }
91000
91000
  __name(SendStream, "SendStream");
91001
- util6.inherits(SendStream, Stream);
91001
+ util7.inherits(SendStream, Stream);
91002
91002
  SendStream.prototype.etag = deprecate.function(/* @__PURE__ */ __name(function etag2(val) {
91003
91003
  this._etag = Boolean(val);
91004
91004
  debug("etag %s", this._etag);
@@ -96152,10 +96152,10 @@ var require_schema_obj = __commonJS({
96152
96152
  "../../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/schema_obj.js"(exports2, module3) {
96153
96153
  "use strict";
96154
96154
  init_import_meta_url();
96155
- var util6 = require_util11();
96155
+ var util7 = require_util11();
96156
96156
  module3.exports = SchemaObject;
96157
96157
  function SchemaObject(obj) {
96158
- util6.copy(obj, this);
96158
+ util7.copy(obj, this);
96159
96159
  }
96160
96160
  __name(SchemaObject, "SchemaObject");
96161
96161
  }
@@ -96255,7 +96255,7 @@ var require_resolve2 = __commonJS({
96255
96255
  init_import_meta_url();
96256
96256
  var URI = require_uri_all();
96257
96257
  var equal = require_fast_deep_equal();
96258
- var util6 = require_util11();
96258
+ var util7 = require_util11();
96259
96259
  var SchemaObject = require_schema_obj();
96260
96260
  var traverse = require_json_schema_traverse();
96261
96261
  module3.exports = resolve22;
@@ -96335,7 +96335,7 @@ var require_resolve2 = __commonJS({
96335
96335
  }
96336
96336
  }
96337
96337
  __name(resolveRecursive, "resolveRecursive");
96338
- var PREVENT_SCOPE_CHANGE = util6.toHash(["properties", "patternProperties", "enum", "dependencies", "definitions"]);
96338
+ var PREVENT_SCOPE_CHANGE = util7.toHash(["properties", "patternProperties", "enum", "dependencies", "definitions"]);
96339
96339
  function getJsonPointer(parsedRef, baseId, schema, root) {
96340
96340
  parsedRef.fragment = parsedRef.fragment || "";
96341
96341
  if (parsedRef.fragment.slice(0, 1) != "/")
@@ -96344,7 +96344,7 @@ var require_resolve2 = __commonJS({
96344
96344
  for (var i = 1; i < parts.length; i++) {
96345
96345
  var part = parts[i];
96346
96346
  if (part) {
96347
- part = util6.unescapeFragment(part);
96347
+ part = util7.unescapeFragment(part);
96348
96348
  schema = schema[part];
96349
96349
  if (schema === void 0)
96350
96350
  break;
@@ -96369,7 +96369,7 @@ var require_resolve2 = __commonJS({
96369
96369
  return { schema, root, baseId };
96370
96370
  }
96371
96371
  __name(getJsonPointer, "getJsonPointer");
96372
- var SIMPLE_INLINED = util6.toHash([
96372
+ var SIMPLE_INLINED = util7.toHash([
96373
96373
  "type",
96374
96374
  "format",
96375
96375
  "pattern",
@@ -96477,7 +96477,7 @@ var require_resolve2 = __commonJS({
96477
96477
  var baseId = baseIds[parentJsonPtr];
96478
96478
  var fullPath = fullPaths[parentJsonPtr] + "/" + parentKeyword;
96479
96479
  if (keyIndex !== void 0)
96480
- fullPath += "/" + (typeof keyIndex == "number" ? keyIndex : util6.escapeFragment(keyIndex));
96480
+ fullPath += "/" + (typeof keyIndex == "number" ? keyIndex : util7.escapeFragment(keyIndex));
96481
96481
  if (typeof id == "string") {
96482
96482
  id = baseId = normalizeId(baseId ? URI.resolve(baseId, id) : id);
96483
96483
  var refVal = self2._refs[id];
@@ -97087,11 +97087,11 @@ var require_compile = __commonJS({
97087
97087
  "use strict";
97088
97088
  init_import_meta_url();
97089
97089
  var resolve22 = require_resolve2();
97090
- var util6 = require_util11();
97090
+ var util7 = require_util11();
97091
97091
  var errorClasses = require_error_classes();
97092
97092
  var stableStringify = require_fast_json_stable_stringify();
97093
97093
  var validateGenerator = require_validate();
97094
- var ucs2length = util6.ucs2length;
97094
+ var ucs2length = util7.ucs2length;
97095
97095
  var equal = require_fast_deep_equal();
97096
97096
  var ValidationError = errorClasses.Validation;
97097
97097
  module3.exports = compile;
@@ -97146,7 +97146,7 @@ var require_compile = __commonJS({
97146
97146
  MissingRefError: errorClasses.MissingRef,
97147
97147
  RULES,
97148
97148
  validate: validateGenerator,
97149
- util: util6,
97149
+ util: util7,
97150
97150
  resolve: resolve22,
97151
97151
  resolveRef,
97152
97152
  usePattern,
@@ -97277,7 +97277,7 @@ var require_compile = __commonJS({
97277
97277
  case "number":
97278
97278
  return "" + value;
97279
97279
  case "string":
97280
- return util6.toQuotedString(value);
97280
+ return util7.toQuotedString(value);
97281
97281
  case "object":
97282
97282
  if (value === null)
97283
97283
  return "null";
@@ -97366,7 +97366,7 @@ var require_compile = __commonJS({
97366
97366
  }
97367
97367
  __name(compIndex, "compIndex");
97368
97368
  function patternCode(i, patterns) {
97369
- return "var pattern" + i + " = new RegExp(" + util6.toQuotedString(patterns[i]) + ");";
97369
+ return "var pattern" + i + " = new RegExp(" + util7.toQuotedString(patterns[i]) + ");";
97370
97370
  }
97371
97371
  __name(patternCode, "patternCode");
97372
97372
  function defaultCode(i) {
@@ -97421,7 +97421,7 @@ var require_formats2 = __commonJS({
97421
97421
  "../../node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/formats.js"(exports2, module3) {
97422
97422
  "use strict";
97423
97423
  init_import_meta_url();
97424
- var util6 = require_util11();
97424
+ var util7 = require_util11();
97425
97425
  var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
97426
97426
  var DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
97427
97427
  var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;
@@ -97437,7 +97437,7 @@ var require_formats2 = __commonJS({
97437
97437
  module3.exports = formats;
97438
97438
  function formats(mode) {
97439
97439
  mode = mode == "full" ? "full" : "fast";
97440
- return util6.copy(formats[mode]);
97440
+ return util7.copy(formats[mode]);
97441
97441
  }
97442
97442
  __name(formats, "formats");
97443
97443
  formats.fast = {
@@ -100942,7 +100942,7 @@ var require_ajv = __commonJS({
100942
100942
  var formats = require_formats2();
100943
100943
  var rules = require_rules();
100944
100944
  var $dataMetaSchema = require_data();
100945
- var util6 = require_util11();
100945
+ var util7 = require_util11();
100946
100946
  module3.exports = Ajv;
100947
100947
  Ajv.prototype.validate = validate2;
100948
100948
  Ajv.prototype.compile = compile;
@@ -100971,7 +100971,7 @@ var require_ajv = __commonJS({
100971
100971
  function Ajv(opts) {
100972
100972
  if (!(this instanceof Ajv))
100973
100973
  return new Ajv(opts);
100974
- opts = this._opts = util6.copy(opts) || {};
100974
+ opts = this._opts = util7.copy(opts) || {};
100975
100975
  setLogger(this);
100976
100976
  this._schemas = {};
100977
100977
  this._refs = {};
@@ -101316,7 +101316,7 @@ var require_ajv = __commonJS({
101316
101316
  }
101317
101317
  __name(checkUnique, "checkUnique");
101318
101318
  function getMetaSchemaOptions(self2) {
101319
- var metaOpts = util6.copy(self2._opts);
101319
+ var metaOpts = util7.copy(self2._opts);
101320
101320
  for (var i = 0; i < META_IGNORE_OPTIONS.length; i++)
101321
101321
  delete metaOpts[META_IGNORE_OPTIONS[i]];
101322
101322
  return metaOpts;
@@ -115933,7 +115933,7 @@ var require_formdata2 = __commonJS({
115933
115933
  var { webidl } = require_webidl2();
115934
115934
  var { Blob: Blob6, File: NativeFile } = require("buffer");
115935
115935
  var File7 = NativeFile ?? UndiciFile;
115936
- var FormData11 = class {
115936
+ var FormData12 = class {
115937
115937
  constructor(form) {
115938
115938
  if (form !== void 0) {
115939
115939
  throw webidl.errors.conversionFailed({
@@ -115945,7 +115945,7 @@ var require_formdata2 = __commonJS({
115945
115945
  this[kState] = [];
115946
115946
  }
115947
115947
  append(name2, value, filename = void 0) {
115948
- webidl.brandCheck(this, FormData11);
115948
+ webidl.brandCheck(this, FormData12);
115949
115949
  webidl.argumentLengthCheck(arguments, 2, { header: "FormData.append" });
115950
115950
  if (arguments.length === 3 && !isBlobLike(value)) {
115951
115951
  throw new TypeError(
@@ -115959,13 +115959,13 @@ var require_formdata2 = __commonJS({
115959
115959
  this[kState].push(entry);
115960
115960
  }
115961
115961
  delete(name2) {
115962
- webidl.brandCheck(this, FormData11);
115962
+ webidl.brandCheck(this, FormData12);
115963
115963
  webidl.argumentLengthCheck(arguments, 1, { header: "FormData.delete" });
115964
115964
  name2 = webidl.converters.USVString(name2);
115965
115965
  this[kState] = this[kState].filter((entry) => entry.name !== name2);
115966
115966
  }
115967
115967
  get(name2) {
115968
- webidl.brandCheck(this, FormData11);
115968
+ webidl.brandCheck(this, FormData12);
115969
115969
  webidl.argumentLengthCheck(arguments, 1, { header: "FormData.get" });
115970
115970
  name2 = webidl.converters.USVString(name2);
115971
115971
  const idx = this[kState].findIndex((entry) => entry.name === name2);
@@ -115975,19 +115975,19 @@ var require_formdata2 = __commonJS({
115975
115975
  return this[kState][idx].value;
115976
115976
  }
115977
115977
  getAll(name2) {
115978
- webidl.brandCheck(this, FormData11);
115978
+ webidl.brandCheck(this, FormData12);
115979
115979
  webidl.argumentLengthCheck(arguments, 1, { header: "FormData.getAll" });
115980
115980
  name2 = webidl.converters.USVString(name2);
115981
115981
  return this[kState].filter((entry) => entry.name === name2).map((entry) => entry.value);
115982
115982
  }
115983
115983
  has(name2) {
115984
- webidl.brandCheck(this, FormData11);
115984
+ webidl.brandCheck(this, FormData12);
115985
115985
  webidl.argumentLengthCheck(arguments, 1, { header: "FormData.has" });
115986
115986
  name2 = webidl.converters.USVString(name2);
115987
115987
  return this[kState].findIndex((entry) => entry.name === name2) !== -1;
115988
115988
  }
115989
115989
  set(name2, value, filename = void 0) {
115990
- webidl.brandCheck(this, FormData11);
115990
+ webidl.brandCheck(this, FormData12);
115991
115991
  webidl.argumentLengthCheck(arguments, 2, { header: "FormData.set" });
115992
115992
  if (arguments.length === 3 && !isBlobLike(value)) {
115993
115993
  throw new TypeError(
@@ -116010,7 +116010,7 @@ var require_formdata2 = __commonJS({
116010
116010
  }
116011
116011
  }
116012
116012
  entries() {
116013
- webidl.brandCheck(this, FormData11);
116013
+ webidl.brandCheck(this, FormData12);
116014
116014
  return makeIterator(
116015
116015
  () => this[kState].map((pair) => [pair.name, pair.value]),
116016
116016
  "FormData",
@@ -116018,7 +116018,7 @@ var require_formdata2 = __commonJS({
116018
116018
  );
116019
116019
  }
116020
116020
  keys() {
116021
- webidl.brandCheck(this, FormData11);
116021
+ webidl.brandCheck(this, FormData12);
116022
116022
  return makeIterator(
116023
116023
  () => this[kState].map((pair) => [pair.name, pair.value]),
116024
116024
  "FormData",
@@ -116026,7 +116026,7 @@ var require_formdata2 = __commonJS({
116026
116026
  );
116027
116027
  }
116028
116028
  values() {
116029
- webidl.brandCheck(this, FormData11);
116029
+ webidl.brandCheck(this, FormData12);
116030
116030
  return makeIterator(
116031
116031
  () => this[kState].map((pair) => [pair.name, pair.value]),
116032
116032
  "FormData",
@@ -116038,7 +116038,7 @@ var require_formdata2 = __commonJS({
116038
116038
  * @param {unknown} thisArg
116039
116039
  */
116040
116040
  forEach(callbackFn, thisArg = globalThis) {
116041
- webidl.brandCheck(this, FormData11);
116041
+ webidl.brandCheck(this, FormData12);
116042
116042
  webidl.argumentLengthCheck(arguments, 1, { header: "FormData.forEach" });
116043
116043
  if (typeof callbackFn !== "function") {
116044
116044
  throw new TypeError(
@@ -116050,9 +116050,9 @@ var require_formdata2 = __commonJS({
116050
116050
  }
116051
116051
  }
116052
116052
  };
116053
- __name(FormData11, "FormData");
116054
- FormData11.prototype[Symbol.iterator] = FormData11.prototype.entries;
116055
- Object.defineProperties(FormData11.prototype, {
116053
+ __name(FormData12, "FormData");
116054
+ FormData12.prototype[Symbol.iterator] = FormData12.prototype.entries;
116055
+ Object.defineProperties(FormData12.prototype, {
116056
116056
  [Symbol.toStringTag]: {
116057
116057
  value: "FormData",
116058
116058
  configurable: true
@@ -116077,7 +116077,7 @@ var require_formdata2 = __commonJS({
116077
116077
  return { name: name2, value };
116078
116078
  }
116079
116079
  __name(makeEntry, "makeEntry");
116080
- module3.exports = { FormData: FormData11 };
116080
+ module3.exports = { FormData: FormData12 };
116081
116081
  }
116082
116082
  });
116083
116083
 
@@ -116087,7 +116087,7 @@ var require_body2 = __commonJS({
116087
116087
  "use strict";
116088
116088
  init_import_meta_url();
116089
116089
  var Busboy = require_main();
116090
- var util6 = require_util12();
116090
+ var util7 = require_util12();
116091
116091
  var {
116092
116092
  ReadableStreamFrom,
116093
116093
  isBlobLike,
@@ -116096,7 +116096,7 @@ var require_body2 = __commonJS({
116096
116096
  createDeferredPromise,
116097
116097
  fullyReadBody
116098
116098
  } = require_util13();
116099
- var { FormData: FormData11 } = require_formdata2();
116099
+ var { FormData: FormData12 } = require_formdata2();
116100
116100
  var { kState } = require_symbols7();
116101
116101
  var { webidl } = require_webidl2();
116102
116102
  var { DOMException: DOMException2, structuredClone } = require_constants10();
@@ -116148,7 +116148,7 @@ var require_body2 = __commonJS({
116148
116148
  source = new Uint8Array(object.slice());
116149
116149
  } else if (ArrayBuffer.isView(object)) {
116150
116150
  source = new Uint8Array(object.buffer.slice(object.byteOffset, object.byteOffset + object.byteLength));
116151
- } else if (util6.isFormDataLike(object)) {
116151
+ } else if (util7.isFormDataLike(object)) {
116152
116152
  const boundary = `----formdata-undici-0${`${Math.floor(Math.random() * 1e11)}`.padStart(11, "0")}`;
116153
116153
  const prefix = `--${boundary}\r
116154
116154
  Content-Disposition: form-data`;
@@ -116206,14 +116206,14 @@ Content-Type: ${value.type || "application/octet-stream"}\r
116206
116206
  if (keepalive) {
116207
116207
  throw new TypeError("keepalive");
116208
116208
  }
116209
- if (util6.isDisturbed(object) || object.locked) {
116209
+ if (util7.isDisturbed(object) || object.locked) {
116210
116210
  throw new TypeError(
116211
116211
  "Response body object should not be disturbed or locked"
116212
116212
  );
116213
116213
  }
116214
116214
  stream2 = object instanceof ReadableStream2 ? object : ReadableStreamFrom(object);
116215
116215
  }
116216
- if (typeof source === "string" || util6.isBuffer(source)) {
116216
+ if (typeof source === "string" || util7.isBuffer(source)) {
116217
116217
  length = Buffer.byteLength(source);
116218
116218
  }
116219
116219
  if (action != null) {
@@ -116250,7 +116250,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
116250
116250
  ReadableStream2 = require("stream/web").ReadableStream;
116251
116251
  }
116252
116252
  if (object instanceof ReadableStream2) {
116253
- assert34(!util6.isDisturbed(object), "The body has already been consumed.");
116253
+ assert34(!util7.isDisturbed(object), "The body has already been consumed.");
116254
116254
  assert34(!object.locked, "The stream is locked.");
116255
116255
  }
116256
116256
  return extractBody(object, keepalive);
@@ -116274,7 +116274,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
116274
116274
  yield body;
116275
116275
  } else {
116276
116276
  const stream2 = body.stream;
116277
- if (util6.isDisturbed(stream2)) {
116277
+ if (util7.isDisturbed(stream2)) {
116278
116278
  throw new TypeError("The body has already been consumed.");
116279
116279
  }
116280
116280
  if (stream2.locked) {
@@ -116324,7 +116324,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
116324
116324
  const headers = {};
116325
116325
  for (const [key, value] of this.headers)
116326
116326
  headers[key.toLowerCase()] = value;
116327
- const responseFormData = new FormData11();
116327
+ const responseFormData = new FormData12();
116328
116328
  let busboy;
116329
116329
  try {
116330
116330
  busboy = new Busboy({
@@ -116386,7 +116386,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
116386
116386
  } catch (err) {
116387
116387
  throw Object.assign(new TypeError(), { cause: err });
116388
116388
  }
116389
- const formData = new FormData11();
116389
+ const formData = new FormData12();
116390
116390
  for (const [name2, value] of entries) {
116391
116391
  formData.append(name2, value);
116392
116392
  }
@@ -116432,7 +116432,7 @@ Content-Type: ${value.type || "application/octet-stream"}\r
116432
116432
  }
116433
116433
  __name(specConsumeBody, "specConsumeBody");
116434
116434
  function bodyUnusable(body) {
116435
- return body != null && (body.stream.locked || util6.isDisturbed(body.stream));
116435
+ return body != null && (body.stream.locked || util7.isDisturbed(body.stream));
116436
116436
  }
116437
116437
  __name(bodyUnusable, "bodyUnusable");
116438
116438
  function utf8DecodeBytes(buffer) {
@@ -116479,7 +116479,7 @@ var require_request4 = __commonJS({
116479
116479
  } = require_errors2();
116480
116480
  var assert34 = require("assert");
116481
116481
  var { kHTTP2BuildRequest, kHTTP2CopyHeaders, kHTTP1BuildRequest } = require_symbols6();
116482
- var util6 = require_util12();
116482
+ var util7 = require_util12();
116483
116483
  var tokenRegExp = /^[\^_`a-zA-Z\-0-9!#$%&'*+.|~]+$/;
116484
116484
  var headerCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
116485
116485
  var invalidPathRegex = /[^\u0021-\u00ff]/;
@@ -116550,12 +116550,12 @@ var require_request4 = __commonJS({
116550
116550
  this.abort = null;
116551
116551
  if (body == null) {
116552
116552
  this.body = null;
116553
- } else if (util6.isStream(body)) {
116553
+ } else if (util7.isStream(body)) {
116554
116554
  this.body = body;
116555
116555
  const rState = this.body._readableState;
116556
116556
  if (!rState || !rState.autoDestroy) {
116557
116557
  this.endHandler = /* @__PURE__ */ __name(function autoDestroy() {
116558
- util6.destroy(this);
116558
+ util7.destroy(this);
116559
116559
  }, "autoDestroy");
116560
116560
  this.body.on("end", this.endHandler);
116561
116561
  }
@@ -116567,7 +116567,7 @@ var require_request4 = __commonJS({
116567
116567
  }
116568
116568
  };
116569
116569
  this.body.on("error", this.errorHandler);
116570
- } else if (util6.isBuffer(body)) {
116570
+ } else if (util7.isBuffer(body)) {
116571
116571
  this.body = body.byteLength ? body : null;
116572
116572
  } else if (ArrayBuffer.isView(body)) {
116573
116573
  this.body = body.buffer.byteLength ? Buffer.from(body.buffer, body.byteOffset, body.byteLength) : null;
@@ -116575,7 +116575,7 @@ var require_request4 = __commonJS({
116575
116575
  this.body = body.byteLength ? Buffer.from(body) : null;
116576
116576
  } else if (typeof body === "string") {
116577
116577
  this.body = body.length ? Buffer.from(body) : null;
116578
- } else if (util6.isFormDataLike(body) || util6.isIterable(body) || util6.isBlobLike(body)) {
116578
+ } else if (util7.isFormDataLike(body) || util7.isIterable(body) || util7.isBlobLike(body)) {
116579
116579
  this.body = body;
116580
116580
  } else {
116581
116581
  throw new InvalidArgumentError("body must be a string, a Buffer, a Readable stream, an iterable, or an async iterable");
@@ -116583,7 +116583,7 @@ var require_request4 = __commonJS({
116583
116583
  this.completed = false;
116584
116584
  this.aborted = false;
116585
116585
  this.upgrade = upgrade || null;
116586
- this.path = query ? util6.buildURL(path74, query) : path74;
116586
+ this.path = query ? util7.buildURL(path74, query) : path74;
116587
116587
  this.origin = origin;
116588
116588
  this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
116589
116589
  this.blocking = blocking == null ? false : blocking;
@@ -116609,8 +116609,8 @@ var require_request4 = __commonJS({
116609
116609
  } else if (headers != null) {
116610
116610
  throw new InvalidArgumentError("headers must be an object or an array");
116611
116611
  }
116612
- if (util6.isFormDataLike(this.body)) {
116613
- if (util6.nodeMajor < 16 || util6.nodeMajor === 16 && util6.nodeMinor < 8) {
116612
+ if (util7.isFormDataLike(this.body)) {
116613
+ if (util7.nodeMajor < 16 || util7.nodeMajor === 16 && util7.nodeMinor < 8) {
116614
116614
  throw new InvalidArgumentError("Form-Data bodies are only supported in node v16.8 and newer.");
116615
116615
  }
116616
116616
  if (!extractBody) {
@@ -116624,13 +116624,13 @@ var require_request4 = __commonJS({
116624
116624
  }
116625
116625
  this.body = bodyStream.stream;
116626
116626
  this.contentLength = bodyStream.length;
116627
- } else if (util6.isBlobLike(body) && this.contentType == null && body.type) {
116627
+ } else if (util7.isBlobLike(body) && this.contentType == null && body.type) {
116628
116628
  this.contentType = body.type;
116629
116629
  this.headers += `content-type: ${body.type}\r
116630
116630
  `;
116631
116631
  }
116632
- util6.validateHandler(handler30, method, upgrade);
116633
- this.servername = util6.getServerName(this.host);
116632
+ util7.validateHandler(handler30, method, upgrade);
116633
+ this.servername = util7.getServerName(this.host);
116634
116634
  this[kHandler] = handler30;
116635
116635
  if (channels.create.hasSubscribers) {
116636
116636
  channels.create.publish({ request: this });
@@ -117045,7 +117045,7 @@ var require_connect2 = __commonJS({
117045
117045
  init_import_meta_url();
117046
117046
  var net3 = require("net");
117047
117047
  var assert34 = require("assert");
117048
- var util6 = require_util12();
117048
+ var util7 = require_util12();
117049
117049
  var { InvalidArgumentError, ConnectTimeoutError } = require_errors2();
117050
117050
  var tls;
117051
117051
  var SessionCache;
@@ -117111,7 +117111,7 @@ var require_connect2 = __commonJS({
117111
117111
  if (!tls) {
117112
117112
  tls = require("tls");
117113
117113
  }
117114
- servername = servername || options29.servername || util6.getServerName(host) || null;
117114
+ servername = servername || options29.servername || util7.getServerName(host) || null;
117115
117115
  const sessionKey = servername || hostname2;
117116
117116
  const session = sessionCache.get(sessionKey) || null;
117117
117117
  assert34(sessionKey);
@@ -117191,7 +117191,7 @@ var require_connect2 = __commonJS({
117191
117191
  }
117192
117192
  __name(setupTimeout2, "setupTimeout");
117193
117193
  function onConnectTimeout(socket) {
117194
- util6.destroy(socket, new ConnectTimeoutError());
117194
+ util7.destroy(socket, new ConnectTimeoutError());
117195
117195
  }
117196
117196
  __name(onConnectTimeout, "onConnectTimeout");
117197
117197
  module3.exports = buildConnector;
@@ -117547,7 +117547,7 @@ var require_RedirectHandler2 = __commonJS({
117547
117547
  "../../node_modules/.pnpm/undici@5.28.2/node_modules/undici/lib/handler/RedirectHandler.js"(exports2, module3) {
117548
117548
  "use strict";
117549
117549
  init_import_meta_url();
117550
- var util6 = require_util12();
117550
+ var util7 = require_util12();
117551
117551
  var { kBodyUsed } = require_symbols6();
117552
117552
  var assert34 = require("assert");
117553
117553
  var { InvalidArgumentError } = require_errors2();
@@ -117571,7 +117571,7 @@ var require_RedirectHandler2 = __commonJS({
117571
117571
  if (maxRedirections != null && (!Number.isInteger(maxRedirections) || maxRedirections < 0)) {
117572
117572
  throw new InvalidArgumentError("maxRedirections must be a positive number");
117573
117573
  }
117574
- util6.validateHandler(handler30, opts.method, opts.upgrade);
117574
+ util7.validateHandler(handler30, opts.method, opts.upgrade);
117575
117575
  this.dispatch = dispatch;
117576
117576
  this.location = null;
117577
117577
  this.abort = null;
@@ -117579,8 +117579,8 @@ var require_RedirectHandler2 = __commonJS({
117579
117579
  this.maxRedirections = maxRedirections;
117580
117580
  this.handler = handler30;
117581
117581
  this.history = [];
117582
- if (util6.isStream(this.opts.body)) {
117583
- if (util6.bodyLength(this.opts.body) === 0) {
117582
+ if (util7.isStream(this.opts.body)) {
117583
+ if (util7.bodyLength(this.opts.body) === 0) {
117584
117584
  this.opts.body.on("data", function() {
117585
117585
  assert34(false);
117586
117586
  });
@@ -117593,7 +117593,7 @@ var require_RedirectHandler2 = __commonJS({
117593
117593
  }
117594
117594
  } else if (this.opts.body && typeof this.opts.body.pipeTo === "function") {
117595
117595
  this.opts.body = new BodyAsyncIterable(this.opts.body);
117596
- } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util6.isIterable(this.opts.body)) {
117596
+ } else if (this.opts.body && typeof this.opts.body !== "string" && !ArrayBuffer.isView(this.opts.body) && util7.isIterable(this.opts.body)) {
117597
117597
  this.opts.body = new BodyAsyncIterable(this.opts.body);
117598
117598
  }
117599
117599
  }
@@ -117608,14 +117608,14 @@ var require_RedirectHandler2 = __commonJS({
117608
117608
  this.handler.onError(error2);
117609
117609
  }
117610
117610
  onHeaders(statusCode, headers, resume, statusText) {
117611
- this.location = this.history.length >= this.maxRedirections || util6.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers);
117611
+ this.location = this.history.length >= this.maxRedirections || util7.isDisturbed(this.opts.body) ? null : parseLocation(statusCode, headers);
117612
117612
  if (this.opts.origin) {
117613
117613
  this.history.push(new URL(this.opts.path, this.opts.origin));
117614
117614
  }
117615
117615
  if (!this.location) {
117616
117616
  return this.handler.onHeaders(statusCode, headers, resume, statusText);
117617
117617
  }
117618
- const { origin, pathname, search } = util6.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
117618
+ const { origin, pathname, search } = util7.parseURL(new URL(this.location, this.opts.origin && new URL(this.opts.path, this.opts.origin)));
117619
117619
  const path74 = search ? `${pathname}${search}` : pathname;
117620
117620
  this.opts.headers = cleanRequestHeaders(this.opts.headers, statusCode === 303, this.opts.origin !== origin);
117621
117621
  this.opts.path = path74;
@@ -117737,7 +117737,7 @@ var require_client2 = __commonJS({
117737
117737
  var net3 = require("net");
117738
117738
  var http4 = require("http");
117739
117739
  var { pipeline } = require("stream");
117740
- var util6 = require_util12();
117740
+ var util7 = require_util12();
117741
117741
  var timers = require_timers2();
117742
117742
  var Request3 = require_request4();
117743
117743
  var DispatcherBase = require_dispatcher_base2();
@@ -117948,12 +117948,12 @@ var require_client2 = __commonJS({
117948
117948
  allowH2,
117949
117949
  socketPath,
117950
117950
  timeout: connectTimeout,
117951
- ...util6.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
117951
+ ...util7.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
117952
117952
  ...connect3
117953
117953
  });
117954
117954
  }
117955
117955
  this[kInterceptors] = interceptors && interceptors.Client && Array.isArray(interceptors.Client) ? interceptors.Client : [createRedirectInterceptor({ maxRedirections })];
117956
- this[kUrl] = util6.parseOrigin(url4);
117956
+ this[kUrl] = util7.parseOrigin(url4);
117957
117957
  this[kConnector] = connect3;
117958
117958
  this[kSocket] = null;
117959
117959
  this[kPipelining] = pipelining != null ? pipelining : 1;
@@ -118022,7 +118022,7 @@ var require_client2 = __commonJS({
118022
118022
  const request3 = this[kHTTPConnVersion] === "h2" ? Request3[kHTTP2BuildRequest](origin, opts, handler30) : Request3[kHTTP1BuildRequest](origin, opts, handler30);
118023
118023
  this[kQueue].push(request3);
118024
118024
  if (this[kResuming]) {
118025
- } else if (util6.bodyLength(request3.body) == null && util6.isIterable(request3.body)) {
118025
+ } else if (util7.bodyLength(request3.body) == null && util7.isIterable(request3.body)) {
118026
118026
  this[kResuming] = 1;
118027
118027
  process.nextTick(resume, this);
118028
118028
  } else {
@@ -118057,14 +118057,14 @@ var require_client2 = __commonJS({
118057
118057
  resolve22();
118058
118058
  }, "callback");
118059
118059
  if (this[kHTTP2Session] != null) {
118060
- util6.destroy(this[kHTTP2Session], err);
118060
+ util7.destroy(this[kHTTP2Session], err);
118061
118061
  this[kHTTP2Session] = null;
118062
118062
  this[kHTTP2SessionState] = null;
118063
118063
  }
118064
118064
  if (!this[kSocket]) {
118065
118065
  queueMicrotask(callback);
118066
118066
  } else {
118067
- util6.destroy(this[kSocket].on("close", callback), err);
118067
+ util7.destroy(this[kSocket].on("close", callback), err);
118068
118068
  }
118069
118069
  resume(this);
118070
118070
  });
@@ -118086,8 +118086,8 @@ var require_client2 = __commonJS({
118086
118086
  }
118087
118087
  __name(onHttp2FrameError, "onHttp2FrameError");
118088
118088
  function onHttp2SessionEnd() {
118089
- util6.destroy(this, new SocketError("other side closed"));
118090
- util6.destroy(this[kSocket], new SocketError("other side closed"));
118089
+ util7.destroy(this, new SocketError("other side closed"));
118090
+ util7.destroy(this[kSocket], new SocketError("other side closed"));
118091
118091
  }
118092
118092
  __name(onHttp2SessionEnd, "onHttp2SessionEnd");
118093
118093
  function onHTTP2GoAway(code) {
@@ -118293,7 +118293,7 @@ var require_client2 = __commonJS({
118293
118293
  throw new HTTPParserError(message, constants3.ERROR[ret], data.slice(offset));
118294
118294
  }
118295
118295
  } catch (err) {
118296
- util6.destroy(socket, err);
118296
+ util7.destroy(socket, err);
118297
118297
  }
118298
118298
  }
118299
118299
  destroy() {
@@ -118350,7 +118350,7 @@ var require_client2 = __commonJS({
118350
118350
  trackHeader(len) {
118351
118351
  this.headersSize += len;
118352
118352
  if (this.headersSize >= this.headersMaxSize) {
118353
- util6.destroy(this.socket, new HeadersOverflowError());
118353
+ util7.destroy(this.socket, new HeadersOverflowError());
118354
118354
  }
118355
118355
  }
118356
118356
  onUpgrade(head) {
@@ -118380,7 +118380,7 @@ var require_client2 = __commonJS({
118380
118380
  try {
118381
118381
  request3.onUpgrade(statusCode, headers, socket);
118382
118382
  } catch (err) {
118383
- util6.destroy(socket, err);
118383
+ util7.destroy(socket, err);
118384
118384
  }
118385
118385
  resume(client);
118386
118386
  }
@@ -118396,11 +118396,11 @@ var require_client2 = __commonJS({
118396
118396
  assert34(!this.upgrade);
118397
118397
  assert34(this.statusCode < 200);
118398
118398
  if (statusCode === 100) {
118399
- util6.destroy(socket, new SocketError("bad response", util6.getSocketInfo(socket)));
118399
+ util7.destroy(socket, new SocketError("bad response", util7.getSocketInfo(socket)));
118400
118400
  return -1;
118401
118401
  }
118402
118402
  if (upgrade && !request3.upgrade) {
118403
- util6.destroy(socket, new SocketError("bad upgrade", util6.getSocketInfo(socket)));
118403
+ util7.destroy(socket, new SocketError("bad upgrade", util7.getSocketInfo(socket)));
118404
118404
  return -1;
118405
118405
  }
118406
118406
  assert34.strictEqual(this.timeoutType, TIMEOUT_HEADERS);
@@ -118429,7 +118429,7 @@ var require_client2 = __commonJS({
118429
118429
  this.headers = [];
118430
118430
  this.headersSize = 0;
118431
118431
  if (this.shouldKeepAlive && client[kPipelining]) {
118432
- const keepAliveTimeout = this.keepAlive ? util6.parseKeepAliveTimeout(this.keepAlive) : null;
118432
+ const keepAliveTimeout = this.keepAlive ? util7.parseKeepAliveTimeout(this.keepAlive) : null;
118433
118433
  if (keepAliveTimeout != null) {
118434
118434
  const timeout2 = Math.min(
118435
118435
  keepAliveTimeout - client[kKeepAliveTimeoutThreshold],
@@ -118477,7 +118477,7 @@ var require_client2 = __commonJS({
118477
118477
  }
118478
118478
  assert34(statusCode >= 200);
118479
118479
  if (maxResponseSize > -1 && this.bytesRead + buf.length > maxResponseSize) {
118480
- util6.destroy(socket, new ResponseExceededMaxSizeError());
118480
+ util7.destroy(socket, new ResponseExceededMaxSizeError());
118481
118481
  return -1;
118482
118482
  }
118483
118483
  this.bytesRead += buf.length;
@@ -118509,20 +118509,20 @@ var require_client2 = __commonJS({
118509
118509
  return;
118510
118510
  }
118511
118511
  if (request3.method !== "HEAD" && contentLength && bytesRead !== parseInt(contentLength, 10)) {
118512
- util6.destroy(socket, new ResponseContentLengthMismatchError());
118512
+ util7.destroy(socket, new ResponseContentLengthMismatchError());
118513
118513
  return -1;
118514
118514
  }
118515
118515
  request3.onComplete(headers);
118516
118516
  client[kQueue][client[kRunningIdx]++] = null;
118517
118517
  if (socket[kWriting]) {
118518
118518
  assert34.strictEqual(client[kRunning], 0);
118519
- util6.destroy(socket, new InformationalError("reset"));
118519
+ util7.destroy(socket, new InformationalError("reset"));
118520
118520
  return constants3.ERROR.PAUSED;
118521
118521
  } else if (!shouldKeepAlive) {
118522
- util6.destroy(socket, new InformationalError("reset"));
118522
+ util7.destroy(socket, new InformationalError("reset"));
118523
118523
  return constants3.ERROR.PAUSED;
118524
118524
  } else if (socket[kReset2] && client[kRunning] === 0) {
118525
- util6.destroy(socket, new InformationalError("reset"));
118525
+ util7.destroy(socket, new InformationalError("reset"));
118526
118526
  return constants3.ERROR.PAUSED;
118527
118527
  } else if (client[kPipelining] === 1) {
118528
118528
  setImmediate(resume, client);
@@ -118537,15 +118537,15 @@ var require_client2 = __commonJS({
118537
118537
  if (timeoutType === TIMEOUT_HEADERS) {
118538
118538
  if (!socket[kWriting] || socket.writableNeedDrain || client[kRunning] > 1) {
118539
118539
  assert34(!parser2.paused, "cannot be paused while waiting for headers");
118540
- util6.destroy(socket, new HeadersTimeoutError());
118540
+ util7.destroy(socket, new HeadersTimeoutError());
118541
118541
  }
118542
118542
  } else if (timeoutType === TIMEOUT_BODY) {
118543
118543
  if (!parser2.paused) {
118544
- util6.destroy(socket, new BodyTimeoutError());
118544
+ util7.destroy(socket, new BodyTimeoutError());
118545
118545
  }
118546
118546
  } else if (timeoutType === TIMEOUT_IDLE) {
118547
118547
  assert34(client[kRunning] === 0 && client[kKeepAliveTimeoutValue]);
118548
- util6.destroy(socket, new InformationalError("socket idle timeout"));
118548
+ util7.destroy(socket, new InformationalError("socket idle timeout"));
118549
118549
  }
118550
118550
  }
118551
118551
  __name(onParserTimeout, "onParserTimeout");
@@ -118589,7 +118589,7 @@ var require_client2 = __commonJS({
118589
118589
  return;
118590
118590
  }
118591
118591
  }
118592
- util6.destroy(this, new SocketError("other side closed", util6.getSocketInfo(this)));
118592
+ util7.destroy(this, new SocketError("other side closed", util7.getSocketInfo(this)));
118593
118593
  }
118594
118594
  __name(onSocketEnd, "onSocketEnd");
118595
118595
  function onSocketClose() {
@@ -118601,7 +118601,7 @@ var require_client2 = __commonJS({
118601
118601
  this[kParser].destroy();
118602
118602
  this[kParser] = null;
118603
118603
  }
118604
- const err = this[kError] || new SocketError("closed", util6.getSocketInfo(this));
118604
+ const err = this[kError] || new SocketError("closed", util7.getSocketInfo(this));
118605
118605
  client[kSocket] = null;
118606
118606
  if (client.destroyed) {
118607
118607
  assert34(client[kPending] === 0);
@@ -118664,7 +118664,7 @@ var require_client2 = __commonJS({
118664
118664
  });
118665
118665
  });
118666
118666
  if (client.destroyed) {
118667
- util6.destroy(socket.on("error", () => {
118667
+ util7.destroy(socket.on("error", () => {
118668
118668
  }), new ClientDestroyedError());
118669
118669
  return;
118670
118670
  }
@@ -118835,7 +118835,7 @@ var require_client2 = __commonJS({
118835
118835
  }
118836
118836
  client[kServerName] = request3.servername;
118837
118837
  if (socket && socket.servername !== request3.servername) {
118838
- util6.destroy(socket, new InformationalError("servername changed"));
118838
+ util7.destroy(socket, new InformationalError("servername changed"));
118839
118839
  return;
118840
118840
  }
118841
118841
  }
@@ -118855,7 +118855,7 @@ var require_client2 = __commonJS({
118855
118855
  if (client[kRunning] > 0 && (request3.upgrade || request3.method === "CONNECT")) {
118856
118856
  return;
118857
118857
  }
118858
- if (client[kRunning] > 0 && util6.bodyLength(request3.body) !== 0 && (util6.isStream(request3.body) || util6.isAsyncIterable(request3.body))) {
118858
+ if (client[kRunning] > 0 && util7.bodyLength(request3.body) !== 0 && (util7.isStream(request3.body) || util7.isAsyncIterable(request3.body))) {
118859
118859
  return;
118860
118860
  }
118861
118861
  if (!request3.aborted && write(client, request3)) {
@@ -118880,7 +118880,7 @@ var require_client2 = __commonJS({
118880
118880
  if (body && typeof body.read === "function") {
118881
118881
  body.read(0);
118882
118882
  }
118883
- const bodyLength = util6.bodyLength(body);
118883
+ const bodyLength = util7.bodyLength(body);
118884
118884
  let contentLength = bodyLength;
118885
118885
  if (contentLength === null) {
118886
118886
  contentLength = request3.contentLength;
@@ -118902,7 +118902,7 @@ var require_client2 = __commonJS({
118902
118902
  return;
118903
118903
  }
118904
118904
  errorRequest(client, request3, err || new RequestAbortedError());
118905
- util6.destroy(socket, new InformationalError("aborted"));
118905
+ util7.destroy(socket, new InformationalError("aborted"));
118906
118906
  });
118907
118907
  } catch (err) {
118908
118908
  errorRequest(client, request3, err);
@@ -118959,7 +118959,7 @@ upgrade: ${upgrade}\r
118959
118959
  `, "latin1");
118960
118960
  }
118961
118961
  request3.onRequestSent();
118962
- } else if (util6.isBuffer(body)) {
118962
+ } else if (util7.isBuffer(body)) {
118963
118963
  assert34(contentLength === body.byteLength, "buffer body must have content length");
118964
118964
  socket.cork();
118965
118965
  socket.write(`${header}content-length: ${contentLength}\r
@@ -118972,15 +118972,15 @@ upgrade: ${upgrade}\r
118972
118972
  if (!expectsPayload) {
118973
118973
  socket[kReset2] = true;
118974
118974
  }
118975
- } else if (util6.isBlobLike(body)) {
118975
+ } else if (util7.isBlobLike(body)) {
118976
118976
  if (typeof body.stream === "function") {
118977
118977
  writeIterable({ body: body.stream(), client, request: request3, socket, contentLength, header, expectsPayload });
118978
118978
  } else {
118979
118979
  writeBlob({ body, client, request: request3, socket, contentLength, header, expectsPayload });
118980
118980
  }
118981
- } else if (util6.isStream(body)) {
118981
+ } else if (util7.isStream(body)) {
118982
118982
  writeStream({ body, client, request: request3, socket, contentLength, header, expectsPayload });
118983
- } else if (util6.isIterable(body)) {
118983
+ } else if (util7.isIterable(body)) {
118984
118984
  writeIterable({ body, client, request: request3, socket, contentLength, header, expectsPayload });
118985
118985
  } else {
118986
118986
  assert34(false);
@@ -119041,7 +119041,7 @@ upgrade: ${upgrade}\r
119041
119041
  if (body && typeof body.read === "function") {
119042
119042
  body.read(0);
119043
119043
  }
119044
- let contentLength = util6.bodyLength(body);
119044
+ let contentLength = util7.bodyLength(body);
119045
119045
  if (contentLength == null) {
119046
119046
  contentLength = request3.contentLength;
119047
119047
  }
@@ -119096,7 +119096,7 @@ upgrade: ${upgrade}\r
119096
119096
  stream2.once("error", function(err) {
119097
119097
  if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
119098
119098
  h2State.streams -= 1;
119099
- util6.destroy(stream2, err);
119099
+ util7.destroy(stream2, err);
119100
119100
  }
119101
119101
  });
119102
119102
  stream2.once("frameError", (type, code) => {
@@ -119104,14 +119104,14 @@ upgrade: ${upgrade}\r
119104
119104
  errorRequest(client, request3, err);
119105
119105
  if (client[kHTTP2Session] && !client[kHTTP2Session].destroyed && !this.closed && !this.destroyed) {
119106
119106
  h2State.streams -= 1;
119107
- util6.destroy(stream2, err);
119107
+ util7.destroy(stream2, err);
119108
119108
  }
119109
119109
  });
119110
119110
  return true;
119111
119111
  function writeBodyH2() {
119112
119112
  if (!body) {
119113
119113
  request3.onRequestSent();
119114
- } else if (util6.isBuffer(body)) {
119114
+ } else if (util7.isBuffer(body)) {
119115
119115
  assert34(contentLength === body.byteLength, "buffer body must have content length");
119116
119116
  stream2.cork();
119117
119117
  stream2.write(body);
@@ -119119,7 +119119,7 @@ upgrade: ${upgrade}\r
119119
119119
  stream2.end();
119120
119120
  request3.onBodySent(body);
119121
119121
  request3.onRequestSent();
119122
- } else if (util6.isBlobLike(body)) {
119122
+ } else if (util7.isBlobLike(body)) {
119123
119123
  if (typeof body.stream === "function") {
119124
119124
  writeIterable({
119125
119125
  client,
@@ -119143,7 +119143,7 @@ upgrade: ${upgrade}\r
119143
119143
  socket: client[kSocket]
119144
119144
  });
119145
119145
  }
119146
- } else if (util6.isStream(body)) {
119146
+ } else if (util7.isStream(body)) {
119147
119147
  writeStream({
119148
119148
  body,
119149
119149
  client,
@@ -119154,7 +119154,7 @@ upgrade: ${upgrade}\r
119154
119154
  h2stream: stream2,
119155
119155
  header: ""
119156
119156
  });
119157
- } else if (util6.isIterable(body)) {
119157
+ } else if (util7.isIterable(body)) {
119158
119158
  writeIterable({
119159
119159
  body,
119160
119160
  client,
@@ -119184,8 +119184,8 @@ upgrade: ${upgrade}\r
119184
119184
  h2stream,
119185
119185
  (err) => {
119186
119186
  if (err) {
119187
- util6.destroy(body, err);
119188
- util6.destroy(h2stream, err);
119187
+ util7.destroy(body, err);
119188
+ util7.destroy(h2stream, err);
119189
119189
  } else {
119190
119190
  request3.onRequestSent();
119191
119191
  }
@@ -119194,7 +119194,7 @@ upgrade: ${upgrade}\r
119194
119194
  pipe.on("data", onPipeData);
119195
119195
  pipe.once("end", () => {
119196
119196
  pipe.removeListener("data", onPipeData);
119197
- util6.destroy(pipe);
119197
+ util7.destroy(pipe);
119198
119198
  });
119199
119199
  return;
119200
119200
  }
@@ -119209,7 +119209,7 @@ upgrade: ${upgrade}\r
119209
119209
  this.pause();
119210
119210
  }
119211
119211
  } catch (err) {
119212
- util6.destroy(this, err);
119212
+ util7.destroy(this, err);
119213
119213
  }
119214
119214
  }, "onData");
119215
119215
  const onDrain = /* @__PURE__ */ __name(function() {
@@ -119244,9 +119244,9 @@ upgrade: ${upgrade}\r
119244
119244
  }
119245
119245
  writer.destroy(err);
119246
119246
  if (err && (err.code !== "UND_ERR_INFO" || err.message !== "reset")) {
119247
- util6.destroy(body, err);
119247
+ util7.destroy(body, err);
119248
119248
  } else {
119249
- util6.destroy(body);
119249
+ util7.destroy(body);
119250
119250
  }
119251
119251
  }, "onFinished");
119252
119252
  body.on("data", onData).on("end", onFinished).on("error", onFinished).on("close", onAbort);
@@ -119283,7 +119283,7 @@ upgrade: ${upgrade}\r
119283
119283
  }
119284
119284
  resume(client);
119285
119285
  } catch (err) {
119286
- util6.destroy(isH2 ? h2stream : socket, err);
119286
+ util7.destroy(isH2 ? h2stream : socket, err);
119287
119287
  }
119288
119288
  }
119289
119289
  __name(writeBlob, "writeBlob");
@@ -119449,7 +119449,7 @@ ${len.toString(16)}\r
119449
119449
  socket[kWriting] = false;
119450
119450
  if (err) {
119451
119451
  assert34(client[kRunning] <= 1, "pipeline should only contain this request");
119452
- util6.destroy(socket, err);
119452
+ util7.destroy(socket, err);
119453
119453
  }
119454
119454
  }
119455
119455
  };
@@ -119733,7 +119733,7 @@ var require_pool2 = __commonJS({
119733
119733
  var {
119734
119734
  InvalidArgumentError
119735
119735
  } = require_errors2();
119736
- var util6 = require_util12();
119736
+ var util7 = require_util12();
119737
119737
  var { kUrl, kInterceptors } = require_symbols6();
119738
119738
  var buildConnector = require_connect2();
119739
119739
  var kOptions = Symbol("options");
@@ -119774,14 +119774,14 @@ var require_pool2 = __commonJS({
119774
119774
  allowH2,
119775
119775
  socketPath,
119776
119776
  timeout: connectTimeout,
119777
- ...util6.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
119777
+ ...util7.nodeHasAutoSelectFamily && autoSelectFamily ? { autoSelectFamily, autoSelectFamilyAttemptTimeout } : void 0,
119778
119778
  ...connect2
119779
119779
  });
119780
119780
  }
119781
119781
  this[kInterceptors] = options29.interceptors && options29.interceptors.Pool && Array.isArray(options29.interceptors.Pool) ? options29.interceptors.Pool : [];
119782
119782
  this[kConnections] = connections || null;
119783
- this[kUrl] = util6.parseOrigin(origin);
119784
- this[kOptions] = { ...util6.deepClone(options29), connect: connect2, allowH2 };
119783
+ this[kUrl] = util7.parseOrigin(origin);
119784
+ this[kOptions] = { ...util7.deepClone(options29), connect: connect2, allowH2 };
119785
119785
  this[kOptions].interceptors = options29.interceptors ? { ...options29.interceptors } : void 0;
119786
119786
  this[kFactory] = factory;
119787
119787
  }
@@ -119997,7 +119997,7 @@ var require_agent2 = __commonJS({
119997
119997
  var DispatcherBase = require_dispatcher_base2();
119998
119998
  var Pool = require_pool2();
119999
119999
  var Client = require_client2();
120000
- var util6 = require_util12();
120000
+ var util7 = require_util12();
120001
120001
  var createRedirectInterceptor = require_redirectInterceptor2();
120002
120002
  var { WeakRef: WeakRef2, FinalizationRegistry: FinalizationRegistry2 } = require_dispatcher_weakref2()();
120003
120003
  var kOnConnect = Symbol("onConnect");
@@ -120028,7 +120028,7 @@ var require_agent2 = __commonJS({
120028
120028
  connect2 = { ...connect2 };
120029
120029
  }
120030
120030
  this[kInterceptors] = options29.interceptors && options29.interceptors.Agent && Array.isArray(options29.interceptors.Agent) ? options29.interceptors.Agent : [createRedirectInterceptor({ maxRedirections })];
120031
- this[kOptions] = { ...util6.deepClone(options29), connect: connect2 };
120031
+ this[kOptions] = { ...util7.deepClone(options29), connect: connect2 };
120032
120032
  this[kOptions].interceptors = options29.interceptors ? { ...options29.interceptors } : void 0;
120033
120033
  this[kMaxRedirections] = maxRedirections;
120034
120034
  this[kFactory] = factory;
@@ -120116,7 +120116,7 @@ var require_readable2 = __commonJS({
120116
120116
  var assert34 = require("assert");
120117
120117
  var { Readable: Readable2 } = require("stream");
120118
120118
  var { RequestAbortedError, NotSupportedError, InvalidArgumentError } = require_errors2();
120119
- var util6 = require_util12();
120119
+ var util7 = require_util12();
120120
120120
  var { ReadableStreamFrom, toUSVString } = require_util12();
120121
120121
  var Blob6;
120122
120122
  var kConsume = Symbol("kConsume");
@@ -120214,7 +120214,7 @@ var require_readable2 = __commonJS({
120214
120214
  }
120215
120215
  // https://fetch.spec.whatwg.org/#dom-body-bodyused
120216
120216
  get bodyUsed() {
120217
- return util6.isDisturbed(this);
120217
+ return util7.isDisturbed(this);
120218
120218
  }
120219
120219
  // https://fetch.spec.whatwg.org/#dom-body-body
120220
120220
  get body() {
@@ -120235,7 +120235,7 @@ var require_readable2 = __commonJS({
120235
120235
  if (typeof signal !== "object" || !("aborted" in signal)) {
120236
120236
  throw new InvalidArgumentError("signal must be an AbortSignal");
120237
120237
  }
120238
- util6.throwIfAborted(signal);
120238
+ util7.throwIfAborted(signal);
120239
120239
  } catch (err) {
120240
120240
  return Promise.reject(err);
120241
120241
  }
@@ -120244,7 +120244,7 @@ var require_readable2 = __commonJS({
120244
120244
  return Promise.resolve(null);
120245
120245
  }
120246
120246
  return new Promise((resolve22, reject) => {
120247
- const signalListenerCleanup = signal ? util6.addAbortListener(signal, () => {
120247
+ const signalListenerCleanup = signal ? util7.addAbortListener(signal, () => {
120248
120248
  this.destroy();
120249
120249
  }) : noop;
120250
120250
  this.on("close", function() {
@@ -120268,7 +120268,7 @@ var require_readable2 = __commonJS({
120268
120268
  }
120269
120269
  __name(isLocked, "isLocked");
120270
120270
  function isUnusable(self2) {
120271
- return util6.isDisturbed(self2) || isLocked(self2);
120271
+ return util7.isDisturbed(self2) || isLocked(self2);
120272
120272
  }
120273
120273
  __name(isUnusable, "isUnusable");
120274
120274
  async function consume(stream2, type) {
@@ -120476,7 +120476,7 @@ var require_api_request2 = __commonJS({
120476
120476
  InvalidArgumentError,
120477
120477
  RequestAbortedError
120478
120478
  } = require_errors2();
120479
- var util6 = require_util12();
120479
+ var util7 = require_util12();
120480
120480
  var { getResolveErrorBodyCallback } = require_util14();
120481
120481
  var { AsyncResource } = require("async_hooks");
120482
120482
  var { addSignal, removeSignal } = require_abort_signal2();
@@ -120504,8 +120504,8 @@ var require_api_request2 = __commonJS({
120504
120504
  }
120505
120505
  super("UNDICI_REQUEST");
120506
120506
  } catch (err) {
120507
- if (util6.isStream(body)) {
120508
- util6.destroy(body.on("error", util6.nop), err);
120507
+ if (util7.isStream(body)) {
120508
+ util7.destroy(body.on("error", util7.nop), err);
120509
120509
  }
120510
120510
  throw err;
120511
120511
  }
@@ -120520,7 +120520,7 @@ var require_api_request2 = __commonJS({
120520
120520
  this.onInfo = onInfo || null;
120521
120521
  this.throwOnError = throwOnError;
120522
120522
  this.highWaterMark = highWaterMark;
120523
- if (util6.isStream(body)) {
120523
+ if (util7.isStream(body)) {
120524
120524
  body.on("error", (err) => {
120525
120525
  this.onError(err);
120526
120526
  });
@@ -120536,14 +120536,14 @@ var require_api_request2 = __commonJS({
120536
120536
  }
120537
120537
  onHeaders(statusCode, rawHeaders, resume, statusMessage) {
120538
120538
  const { callback, opaque, abort, context: context2, responseHeaders, highWaterMark } = this;
120539
- const headers = responseHeaders === "raw" ? util6.parseRawHeaders(rawHeaders) : util6.parseHeaders(rawHeaders);
120539
+ const headers = responseHeaders === "raw" ? util7.parseRawHeaders(rawHeaders) : util7.parseHeaders(rawHeaders);
120540
120540
  if (statusCode < 200) {
120541
120541
  if (this.onInfo) {
120542
120542
  this.onInfo({ statusCode, headers });
120543
120543
  }
120544
120544
  return;
120545
120545
  }
120546
- const parsedHeaders = responseHeaders === "raw" ? util6.parseHeaders(rawHeaders) : headers;
120546
+ const parsedHeaders = responseHeaders === "raw" ? util7.parseHeaders(rawHeaders) : headers;
120547
120547
  const contentType = parsedHeaders["content-type"];
120548
120548
  const body = new Readable2({ resume, abort, contentType, highWaterMark });
120549
120549
  this.callback = null;
@@ -120574,7 +120574,7 @@ var require_api_request2 = __commonJS({
120574
120574
  onComplete(trailers) {
120575
120575
  const { res } = this;
120576
120576
  removeSignal(this);
120577
- util6.parseHeaders(trailers, this.trailers);
120577
+ util7.parseHeaders(trailers, this.trailers);
120578
120578
  res.push(null);
120579
120579
  }
120580
120580
  onError(err) {
@@ -120589,12 +120589,12 @@ var require_api_request2 = __commonJS({
120589
120589
  if (res) {
120590
120590
  this.res = null;
120591
120591
  queueMicrotask(() => {
120592
- util6.destroy(res, err);
120592
+ util7.destroy(res, err);
120593
120593
  });
120594
120594
  }
120595
120595
  if (body) {
120596
120596
  this.body = null;
120597
- util6.destroy(body, err);
120597
+ util7.destroy(body, err);
120598
120598
  }
120599
120599
  }
120600
120600
  };
@@ -120634,7 +120634,7 @@ var require_api_stream2 = __commonJS({
120634
120634
  InvalidReturnValueError,
120635
120635
  RequestAbortedError
120636
120636
  } = require_errors2();
120637
- var util6 = require_util12();
120637
+ var util7 = require_util12();
120638
120638
  var { getResolveErrorBodyCallback } = require_util14();
120639
120639
  var { AsyncResource } = require("async_hooks");
120640
120640
  var { addSignal, removeSignal } = require_abort_signal2();
@@ -120662,8 +120662,8 @@ var require_api_stream2 = __commonJS({
120662
120662
  }
120663
120663
  super("UNDICI_STREAM");
120664
120664
  } catch (err) {
120665
- if (util6.isStream(body)) {
120666
- util6.destroy(body.on("error", util6.nop), err);
120665
+ if (util7.isStream(body)) {
120666
+ util7.destroy(body.on("error", util7.nop), err);
120667
120667
  }
120668
120668
  throw err;
120669
120669
  }
@@ -120678,7 +120678,7 @@ var require_api_stream2 = __commonJS({
120678
120678
  this.body = body;
120679
120679
  this.onInfo = onInfo || null;
120680
120680
  this.throwOnError = throwOnError || false;
120681
- if (util6.isStream(body)) {
120681
+ if (util7.isStream(body)) {
120682
120682
  body.on("error", (err) => {
120683
120683
  this.onError(err);
120684
120684
  });
@@ -120694,7 +120694,7 @@ var require_api_stream2 = __commonJS({
120694
120694
  }
120695
120695
  onHeaders(statusCode, rawHeaders, resume, statusMessage) {
120696
120696
  const { factory, opaque, context: context2, callback, responseHeaders } = this;
120697
- const headers = responseHeaders === "raw" ? util6.parseRawHeaders(rawHeaders) : util6.parseHeaders(rawHeaders);
120697
+ const headers = responseHeaders === "raw" ? util7.parseRawHeaders(rawHeaders) : util7.parseHeaders(rawHeaders);
120698
120698
  if (statusCode < 200) {
120699
120699
  if (this.onInfo) {
120700
120700
  this.onInfo({ statusCode, headers });
@@ -120704,7 +120704,7 @@ var require_api_stream2 = __commonJS({
120704
120704
  this.factory = null;
120705
120705
  let res;
120706
120706
  if (this.throwOnError && statusCode >= 400) {
120707
- const parsedHeaders = responseHeaders === "raw" ? util6.parseHeaders(rawHeaders) : headers;
120707
+ const parsedHeaders = responseHeaders === "raw" ? util7.parseHeaders(rawHeaders) : headers;
120708
120708
  const contentType = parsedHeaders["content-type"];
120709
120709
  res = new PassThrough2();
120710
120710
  this.callback = null;
@@ -120730,7 +120730,7 @@ var require_api_stream2 = __commonJS({
120730
120730
  const { callback: callback2, res: res2, opaque: opaque2, trailers, abort } = this;
120731
120731
  this.res = null;
120732
120732
  if (err || !res2.readable) {
120733
- util6.destroy(res2, err);
120733
+ util7.destroy(res2, err);
120734
120734
  }
120735
120735
  this.callback = null;
120736
120736
  this.runInAsyncScope(callback2, null, err || null, { opaque: opaque2, trailers });
@@ -120754,7 +120754,7 @@ var require_api_stream2 = __commonJS({
120754
120754
  if (!res) {
120755
120755
  return;
120756
120756
  }
120757
- this.trailers = util6.parseHeaders(trailers);
120757
+ this.trailers = util7.parseHeaders(trailers);
120758
120758
  res.end();
120759
120759
  }
120760
120760
  onError(err) {
@@ -120763,7 +120763,7 @@ var require_api_stream2 = __commonJS({
120763
120763
  this.factory = null;
120764
120764
  if (res) {
120765
120765
  this.res = null;
120766
- util6.destroy(res, err);
120766
+ util7.destroy(res, err);
120767
120767
  } else if (callback) {
120768
120768
  this.callback = null;
120769
120769
  queueMicrotask(() => {
@@ -120772,7 +120772,7 @@ var require_api_stream2 = __commonJS({
120772
120772
  }
120773
120773
  if (body) {
120774
120774
  this.body = null;
120775
- util6.destroy(body, err);
120775
+ util7.destroy(body, err);
120776
120776
  }
120777
120777
  }
120778
120778
  };
@@ -120815,7 +120815,7 @@ var require_api_pipeline2 = __commonJS({
120815
120815
  InvalidReturnValueError,
120816
120816
  RequestAbortedError
120817
120817
  } = require_errors2();
120818
- var util6 = require_util12();
120818
+ var util7 = require_util12();
120819
120819
  var { AsyncResource } = require("async_hooks");
120820
120820
  var { addSignal, removeSignal } = require_abort_signal2();
120821
120821
  var assert34 = require("assert");
@@ -120879,7 +120879,7 @@ var require_api_pipeline2 = __commonJS({
120879
120879
  this.abort = null;
120880
120880
  this.context = null;
120881
120881
  this.onInfo = onInfo || null;
120882
- this.req = new PipelineRequest().on("error", util6.nop);
120882
+ this.req = new PipelineRequest().on("error", util7.nop);
120883
120883
  this.ret = new Duplex({
120884
120884
  readableObjectMode: opts.objectMode,
120885
120885
  autoDestroy: true,
@@ -120905,9 +120905,9 @@ var require_api_pipeline2 = __commonJS({
120905
120905
  if (abort && err) {
120906
120906
  abort();
120907
120907
  }
120908
- util6.destroy(body, err);
120909
- util6.destroy(req, err);
120910
- util6.destroy(res, err);
120908
+ util7.destroy(body, err);
120909
+ util7.destroy(req, err);
120910
+ util7.destroy(res, err);
120911
120911
  removeSignal(this);
120912
120912
  callback(err);
120913
120913
  }
@@ -120931,7 +120931,7 @@ var require_api_pipeline2 = __commonJS({
120931
120931
  const { opaque, handler: handler30, context: context2 } = this;
120932
120932
  if (statusCode < 200) {
120933
120933
  if (this.onInfo) {
120934
- const headers = this.responseHeaders === "raw" ? util6.parseRawHeaders(rawHeaders) : util6.parseHeaders(rawHeaders);
120934
+ const headers = this.responseHeaders === "raw" ? util7.parseRawHeaders(rawHeaders) : util7.parseHeaders(rawHeaders);
120935
120935
  this.onInfo({ statusCode, headers });
120936
120936
  }
120937
120937
  return;
@@ -120940,7 +120940,7 @@ var require_api_pipeline2 = __commonJS({
120940
120940
  let body;
120941
120941
  try {
120942
120942
  this.handler = null;
120943
- const headers = this.responseHeaders === "raw" ? util6.parseRawHeaders(rawHeaders) : util6.parseHeaders(rawHeaders);
120943
+ const headers = this.responseHeaders === "raw" ? util7.parseRawHeaders(rawHeaders) : util7.parseHeaders(rawHeaders);
120944
120944
  body = this.runInAsyncScope(handler30, null, {
120945
120945
  statusCode,
120946
120946
  headers,
@@ -120949,7 +120949,7 @@ var require_api_pipeline2 = __commonJS({
120949
120949
  context: context2
120950
120950
  });
120951
120951
  } catch (err) {
120952
- this.res.on("error", util6.nop);
120952
+ this.res.on("error", util7.nop);
120953
120953
  throw err;
120954
120954
  }
120955
120955
  if (!body || typeof body.on !== "function") {
@@ -120962,14 +120962,14 @@ var require_api_pipeline2 = __commonJS({
120962
120962
  }
120963
120963
  }).on("error", (err) => {
120964
120964
  const { ret } = this;
120965
- util6.destroy(ret, err);
120965
+ util7.destroy(ret, err);
120966
120966
  }).on("end", () => {
120967
120967
  const { ret } = this;
120968
120968
  ret.push(null);
120969
120969
  }).on("close", () => {
120970
120970
  const { ret } = this;
120971
120971
  if (!ret._readableState.ended) {
120972
- util6.destroy(ret, new RequestAbortedError());
120972
+ util7.destroy(ret, new RequestAbortedError());
120973
120973
  }
120974
120974
  });
120975
120975
  this.body = body;
@@ -120985,7 +120985,7 @@ var require_api_pipeline2 = __commonJS({
120985
120985
  onError(err) {
120986
120986
  const { ret } = this;
120987
120987
  this.handler = null;
120988
- util6.destroy(ret, err);
120988
+ util7.destroy(ret, err);
120989
120989
  }
120990
120990
  };
120991
120991
  __name(PipelineHandler, "PipelineHandler");
@@ -121010,7 +121010,7 @@ var require_api_upgrade2 = __commonJS({
121010
121010
  init_import_meta_url();
121011
121011
  var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors2();
121012
121012
  var { AsyncResource } = require("async_hooks");
121013
- var util6 = require_util12();
121013
+ var util7 = require_util12();
121014
121014
  var { addSignal, removeSignal } = require_abort_signal2();
121015
121015
  var assert34 = require("assert");
121016
121016
  var UpgradeHandler = class extends AsyncResource {
@@ -121048,7 +121048,7 @@ var require_api_upgrade2 = __commonJS({
121048
121048
  assert34.strictEqual(statusCode, 101);
121049
121049
  removeSignal(this);
121050
121050
  this.callback = null;
121051
- const headers = this.responseHeaders === "raw" ? util6.parseRawHeaders(rawHeaders) : util6.parseHeaders(rawHeaders);
121051
+ const headers = this.responseHeaders === "raw" ? util7.parseRawHeaders(rawHeaders) : util7.parseHeaders(rawHeaders);
121052
121052
  this.runInAsyncScope(callback, null, null, {
121053
121053
  headers,
121054
121054
  socket,
@@ -121103,7 +121103,7 @@ var require_api_connect2 = __commonJS({
121103
121103
  init_import_meta_url();
121104
121104
  var { AsyncResource } = require("async_hooks");
121105
121105
  var { InvalidArgumentError, RequestAbortedError, SocketError } = require_errors2();
121106
- var util6 = require_util12();
121106
+ var util7 = require_util12();
121107
121107
  var { addSignal, removeSignal } = require_abort_signal2();
121108
121108
  var ConnectHandler = class extends AsyncResource {
121109
121109
  constructor(opts, callback) {
@@ -121140,7 +121140,7 @@ var require_api_connect2 = __commonJS({
121140
121140
  this.callback = null;
121141
121141
  let headers = rawHeaders;
121142
121142
  if (headers != null) {
121143
- headers = this.responseHeaders === "raw" ? util6.parseRawHeaders(rawHeaders) : util6.parseHeaders(rawHeaders);
121143
+ headers = this.responseHeaders === "raw" ? util7.parseRawHeaders(rawHeaders) : util7.parseHeaders(rawHeaders);
121144
121144
  }
121145
121145
  this.runInAsyncScope(callback, null, null, {
121146
121146
  statusCode,
@@ -122941,8 +122941,8 @@ var require_response3 = __commonJS({
122941
122941
  init_import_meta_url();
122942
122942
  var { Headers: Headers5, HeadersList, fill: fill2 } = require_headers2();
122943
122943
  var { extractBody, cloneBody, mixinBody } = require_body2();
122944
- var util6 = require_util12();
122945
- var { kEnumerableProperty } = util6;
122944
+ var util7 = require_util12();
122945
+ var { kEnumerableProperty } = util7;
122946
122946
  var {
122947
122947
  isValidReasonPhrase,
122948
122948
  isCancelled,
@@ -122959,7 +122959,7 @@ var require_response3 = __commonJS({
122959
122959
  } = require_constants10();
122960
122960
  var { kState, kHeaders, kGuard, kRealm } = require_symbols7();
122961
122961
  var { webidl } = require_webidl2();
122962
- var { FormData: FormData11 } = require_formdata2();
122962
+ var { FormData: FormData12 } = require_formdata2();
122963
122963
  var { getGlobalOrigin } = require_global3();
122964
122964
  var { URLSerializer } = require_dataURL2();
122965
122965
  var { kHeadersList, kConstruct } = require_symbols6();
@@ -123088,7 +123088,7 @@ var require_response3 = __commonJS({
123088
123088
  }
123089
123089
  get bodyUsed() {
123090
123090
  webidl.brandCheck(this, Response9);
123091
- return !!this[kState].body && util6.isDisturbed(this[kState].body.stream);
123091
+ return !!this[kState].body && util7.isDisturbed(this[kState].body.stream);
123092
123092
  }
123093
123093
  // Returns a clone of response.
123094
123094
  clone() {
@@ -123263,7 +123263,7 @@ var require_response3 = __commonJS({
123263
123263
  ReadableStream2
123264
123264
  );
123265
123265
  webidl.converters.FormData = webidl.interfaceConverter(
123266
- FormData11
123266
+ FormData12
123267
123267
  );
123268
123268
  webidl.converters.URLSearchParams = webidl.interfaceConverter(
123269
123269
  URLSearchParams
@@ -123278,7 +123278,7 @@ var require_response3 = __commonJS({
123278
123278
  if (types.isArrayBuffer(V2) || types.isTypedArray(V2) || types.isDataView(V2)) {
123279
123279
  return webidl.converters.BufferSource(V2);
123280
123280
  }
123281
- if (util6.isFormDataLike(V2)) {
123281
+ if (util7.isFormDataLike(V2)) {
123282
123282
  return webidl.converters.FormData(V2, { strict: false });
123283
123283
  }
123284
123284
  if (V2 instanceof URLSearchParams) {
@@ -123330,7 +123330,7 @@ var require_request5 = __commonJS({
123330
123330
  var { extractBody, mixinBody, cloneBody } = require_body2();
123331
123331
  var { Headers: Headers5, fill: fillHeaders, HeadersList } = require_headers2();
123332
123332
  var { FinalizationRegistry: FinalizationRegistry2 } = require_dispatcher_weakref2()();
123333
- var util6 = require_util12();
123333
+ var util7 = require_util12();
123334
123334
  var {
123335
123335
  isValidHTTPToken,
123336
123336
  sameOrigin,
@@ -123348,7 +123348,7 @@ var require_request5 = __commonJS({
123348
123348
  requestCache,
123349
123349
  requestDuplex
123350
123350
  } = require_constants10();
123351
- var { kEnumerableProperty } = util6;
123351
+ var { kEnumerableProperty } = util7;
123352
123352
  var { kHeaders, kSignal, kState, kGuard, kRealm } = require_symbols7();
123353
123353
  var { webidl } = require_webidl2();
123354
123354
  var { getGlobalOrigin } = require_global3();
@@ -123568,7 +123568,7 @@ var require_request5 = __commonJS({
123568
123568
  }
123569
123569
  } catch {
123570
123570
  }
123571
- util6.addAbortListener(signal, abort);
123571
+ util7.addAbortListener(signal, abort);
123572
123572
  requestFinalizer.register(ac, { signal, abort });
123573
123573
  }
123574
123574
  }
@@ -123626,7 +123626,7 @@ var require_request5 = __commonJS({
123626
123626
  }
123627
123627
  let finalBody = inputOrInitBody;
123628
123628
  if (initBody == null && inputBody != null) {
123629
- if (util6.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
123629
+ if (util7.isDisturbed(inputBody.stream) || inputBody.stream.locked) {
123630
123630
  throw new TypeError(
123631
123631
  "Cannot construct a Request with a Request object that has already been used."
123632
123632
  );
@@ -123755,7 +123755,7 @@ var require_request5 = __commonJS({
123755
123755
  }
123756
123756
  get bodyUsed() {
123757
123757
  webidl.brandCheck(this, Request3);
123758
- return !!this[kState].body && util6.isDisturbed(this[kState].body.stream);
123758
+ return !!this[kState].body && util7.isDisturbed(this[kState].body.stream);
123759
123759
  }
123760
123760
  get duplex() {
123761
123761
  webidl.brandCheck(this, Request3);
@@ -123779,7 +123779,7 @@ var require_request5 = __commonJS({
123779
123779
  if (this.signal.aborted) {
123780
123780
  ac.abort(this.signal.reason);
123781
123781
  } else {
123782
- util6.addAbortListener(
123782
+ util7.addAbortListener(
123783
123783
  this.signal,
123784
123784
  () => {
123785
123785
  ac.abort(this.signal.reason);
@@ -128272,7 +128272,7 @@ var require_undici2 = __commonJS({
128272
128272
  var Pool = require_pool2();
128273
128273
  var BalancedPool = require_balanced_pool2();
128274
128274
  var Agent = require_agent2();
128275
- var util6 = require_util12();
128275
+ var util7 = require_util12();
128276
128276
  var { InvalidArgumentError } = errors;
128277
128277
  var api = require_api2();
128278
128278
  var buildConnector = require_connect2();
@@ -128326,12 +128326,12 @@ var require_undici2 = __commonJS({
128326
128326
  if (!opts.path.startsWith("/")) {
128327
128327
  path74 = `/${path74}`;
128328
128328
  }
128329
- url4 = new URL(util6.parseOrigin(url4).origin + path74);
128329
+ url4 = new URL(util7.parseOrigin(url4).origin + path74);
128330
128330
  } else {
128331
128331
  if (!opts) {
128332
128332
  opts = typeof url4 === "object" ? url4 : {};
128333
128333
  }
128334
- url4 = util6.parseURL(url4);
128334
+ url4 = util7.parseURL(url4);
128335
128335
  }
128336
128336
  const { agent, dispatcher = getGlobalDispatcher2() } = opts;
128337
128337
  if (agent) {
@@ -128348,7 +128348,7 @@ var require_undici2 = __commonJS({
128348
128348
  __name(makeDispatcher, "makeDispatcher");
128349
128349
  module3.exports.setGlobalDispatcher = setGlobalDispatcher2;
128350
128350
  module3.exports.getGlobalDispatcher = getGlobalDispatcher2;
128351
- if (util6.nodeMajor > 16 || util6.nodeMajor === 16 && util6.nodeMinor >= 8) {
128351
+ if (util7.nodeMajor > 16 || util7.nodeMajor === 16 && util7.nodeMinor >= 8) {
128352
128352
  let fetchImpl = null;
128353
128353
  module3.exports.fetch = /* @__PURE__ */ __name(async function fetch16(resource) {
128354
128354
  if (!fetchImpl) {
@@ -128376,7 +128376,7 @@ var require_undici2 = __commonJS({
128376
128376
  const { kConstruct } = require_symbols9();
128377
128377
  module3.exports.caches = new CacheStorage2(kConstruct);
128378
128378
  }
128379
- if (util6.nodeMajor >= 16) {
128379
+ if (util7.nodeMajor >= 16) {
128380
128380
  const { deleteCookie, getCookies, getSetCookies, setCookie } = require_cookies2();
128381
128381
  module3.exports.deleteCookie = deleteCookie;
128382
128382
  module3.exports.getCookies = getCookies;
@@ -128386,7 +128386,7 @@ var require_undici2 = __commonJS({
128386
128386
  module3.exports.parseMIMEType = parseMIMEType;
128387
128387
  module3.exports.serializeAMimeType = serializeAMimeType;
128388
128388
  }
128389
- if (util6.nodeMajor >= 18 && hasCrypto) {
128389
+ if (util7.nodeMajor >= 18 && hasCrypto) {
128390
128390
  const { WebSocket: WebSocket2 } = require_websocket3();
128391
128391
  module3.exports.WebSocket = WebSocket2;
128392
128392
  }
@@ -144114,14 +144114,14 @@ var require_node5 = __commonJS({
144114
144114
  "../../node_modules/.pnpm/debug@4.3.4_supports-color@9.2.2/node_modules/debug/src/node.js"(exports2, module3) {
144115
144115
  init_import_meta_url();
144116
144116
  var tty3 = require("tty");
144117
- var util6 = require("util");
144117
+ var util7 = require("util");
144118
144118
  exports2.init = init3;
144119
144119
  exports2.log = log2;
144120
144120
  exports2.formatArgs = formatArgs;
144121
144121
  exports2.save = save;
144122
144122
  exports2.load = load;
144123
144123
  exports2.useColors = useColors;
144124
- exports2.destroy = util6.deprecate(
144124
+ exports2.destroy = util7.deprecate(
144125
144125
  () => {
144126
144126
  },
144127
144127
  "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
@@ -144255,7 +144255,7 @@ var require_node5 = __commonJS({
144255
144255
  }
144256
144256
  __name(getDate2, "getDate");
144257
144257
  function log2(...args) {
144258
- return process.stderr.write(util6.format(...args) + "\n");
144258
+ return process.stderr.write(util7.format(...args) + "\n");
144259
144259
  }
144260
144260
  __name(log2, "log");
144261
144261
  function save(namespaces) {
@@ -144282,11 +144282,11 @@ var require_node5 = __commonJS({
144282
144282
  var { formatters: formatters2 } = module3.exports;
144283
144283
  formatters2.o = function(v2) {
144284
144284
  this.inspectOpts.colors = this.useColors;
144285
- return util6.inspect(v2, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
144285
+ return util7.inspect(v2, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
144286
144286
  };
144287
144287
  formatters2.O = function(v2) {
144288
144288
  this.inspectOpts.colors = this.useColors;
144289
- return util6.inspect(v2, this.inspectOpts);
144289
+ return util7.inspect(v2, this.inspectOpts);
144290
144290
  };
144291
144291
  }
144292
144292
  });
@@ -148760,14 +148760,14 @@ var require_node6 = __commonJS({
148760
148760
  "../../node_modules/.pnpm/debug@4.3.6_supports-color@9.2.2/node_modules/debug/src/node.js"(exports2, module3) {
148761
148761
  init_import_meta_url();
148762
148762
  var tty3 = require("tty");
148763
- var util6 = require("util");
148763
+ var util7 = require("util");
148764
148764
  exports2.init = init3;
148765
148765
  exports2.log = log2;
148766
148766
  exports2.formatArgs = formatArgs;
148767
148767
  exports2.save = save;
148768
148768
  exports2.load = load;
148769
148769
  exports2.useColors = useColors;
148770
- exports2.destroy = util6.deprecate(
148770
+ exports2.destroy = util7.deprecate(
148771
148771
  () => {
148772
148772
  },
148773
148773
  "Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."
@@ -148901,7 +148901,7 @@ var require_node6 = __commonJS({
148901
148901
  }
148902
148902
  __name(getDate2, "getDate");
148903
148903
  function log2(...args) {
148904
- return process.stderr.write(util6.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
148904
+ return process.stderr.write(util7.formatWithOptions(exports2.inspectOpts, ...args) + "\n");
148905
148905
  }
148906
148906
  __name(log2, "log");
148907
148907
  function save(namespaces) {
@@ -148928,11 +148928,11 @@ var require_node6 = __commonJS({
148928
148928
  var { formatters: formatters2 } = module3.exports;
148929
148929
  formatters2.o = function(v2) {
148930
148930
  this.inspectOpts.colors = this.useColors;
148931
- return util6.inspect(v2, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
148931
+ return util7.inspect(v2, this.inspectOpts).split("\n").map((str) => str.trim()).join(" ");
148932
148932
  };
148933
148933
  formatters2.O = function(v2) {
148934
148934
  this.inspectOpts.colors = this.useColors;
148935
- return util6.inspect(v2, this.inspectOpts);
148935
+ return util7.inspect(v2, this.inspectOpts);
148936
148936
  };
148937
148937
  }
148938
148938
  });
@@ -151537,38 +151537,38 @@ init_import_meta_url();
151537
151537
  // ../../node_modules/.pnpm/zod@3.22.3/node_modules/zod/lib/index.mjs
151538
151538
  init_import_meta_url();
151539
151539
  var util;
151540
- (function(util6) {
151541
- util6.assertEqual = (val) => val;
151540
+ (function(util7) {
151541
+ util7.assertEqual = (val) => val;
151542
151542
  function assertIs(_arg) {
151543
151543
  }
151544
151544
  __name(assertIs, "assertIs");
151545
- util6.assertIs = assertIs;
151545
+ util7.assertIs = assertIs;
151546
151546
  function assertNever2(_x) {
151547
151547
  throw new Error();
151548
151548
  }
151549
151549
  __name(assertNever2, "assertNever");
151550
- util6.assertNever = assertNever2;
151551
- util6.arrayToEnum = (items) => {
151550
+ util7.assertNever = assertNever2;
151551
+ util7.arrayToEnum = (items) => {
151552
151552
  const obj = {};
151553
151553
  for (const item of items) {
151554
151554
  obj[item] = item;
151555
151555
  }
151556
151556
  return obj;
151557
151557
  };
151558
- util6.getValidEnumValues = (obj) => {
151559
- const validKeys = util6.objectKeys(obj).filter((k2) => typeof obj[obj[k2]] !== "number");
151558
+ util7.getValidEnumValues = (obj) => {
151559
+ const validKeys = util7.objectKeys(obj).filter((k2) => typeof obj[obj[k2]] !== "number");
151560
151560
  const filtered = {};
151561
151561
  for (const k2 of validKeys) {
151562
151562
  filtered[k2] = obj[k2];
151563
151563
  }
151564
- return util6.objectValues(filtered);
151564
+ return util7.objectValues(filtered);
151565
151565
  };
151566
- util6.objectValues = (obj) => {
151567
- return util6.objectKeys(obj).map(function(e3) {
151566
+ util7.objectValues = (obj) => {
151567
+ return util7.objectKeys(obj).map(function(e3) {
151568
151568
  return obj[e3];
151569
151569
  });
151570
151570
  };
151571
- util6.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
151571
+ util7.objectKeys = typeof Object.keys === "function" ? (obj) => Object.keys(obj) : (object) => {
151572
151572
  const keys = [];
151573
151573
  for (const key in object) {
151574
151574
  if (Object.prototype.hasOwnProperty.call(object, key)) {
@@ -151577,20 +151577,20 @@ var util;
151577
151577
  }
151578
151578
  return keys;
151579
151579
  };
151580
- util6.find = (arr, checker) => {
151580
+ util7.find = (arr, checker) => {
151581
151581
  for (const item of arr) {
151582
151582
  if (checker(item))
151583
151583
  return item;
151584
151584
  }
151585
151585
  return void 0;
151586
151586
  };
151587
- util6.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
151587
+ util7.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
151588
151588
  function joinValues(array, separator = " | ") {
151589
151589
  return array.map((val) => typeof val === "string" ? `'${val}'` : val).join(separator);
151590
151590
  }
151591
151591
  __name(joinValues, "joinValues");
151592
- util6.joinValues = joinValues;
151593
- util6.jsonStringifyReplacer = (_3, value) => {
151592
+ util7.joinValues = joinValues;
151593
+ util7.jsonStringifyReplacer = (_3, value) => {
151594
151594
  if (typeof value === "bigint") {
151595
151595
  return value.toString();
151596
151596
  }
@@ -156637,6 +156637,15 @@ var LOGGER_LEVEL_FORMAT_TYPE_MAP = {
156637
156637
  var getLogLevelFromEnv = getEnvironmentVariableFactory({
156638
156638
  variableName: "WRANGLER_LOG"
156639
156639
  });
156640
+ var warnOnce = (() => {
156641
+ let logged = false;
156642
+ return (...args) => {
156643
+ if (!logged) {
156644
+ console.warn(...args);
156645
+ logged = true;
156646
+ }
156647
+ };
156648
+ })();
156640
156649
  function getLoggerLevel() {
156641
156650
  const fromEnv = getLogLevelFromEnv()?.toLowerCase();
156642
156651
  if (fromEnv !== void 0) {
@@ -156644,7 +156653,7 @@ function getLoggerLevel() {
156644
156653
  return fromEnv;
156645
156654
  }
156646
156655
  const expected = Object.keys(LOGGER_LEVELS).map((level) => `"${level}"`).join(" | ");
156647
- console.warn(
156656
+ warnOnce(
156648
156657
  `Unrecognised WRANGLER_LOG value ${JSON.stringify(
156649
156658
  fromEnv
156650
156659
  )}, expected ${expected}, defaulting to "log"...`
@@ -156657,7 +156666,13 @@ var _beforeLogHook, _afterLogHook;
156657
156666
  var _Logger = class {
156658
156667
  constructor() {
156659
156668
  }
156660
- loggerLevel = getLoggerLevel();
156669
+ overrideLoggerLevel;
156670
+ get loggerLevel() {
156671
+ return this.overrideLoggerLevel ?? getLoggerLevel();
156672
+ }
156673
+ set loggerLevel(val) {
156674
+ this.overrideLoggerLevel = val;
156675
+ }
156661
156676
  columns = process.stdout.columns;
156662
156677
  debug = (...args) => this.doLog("debug", args);
156663
156678
  debugWithSanitization = (label, ...args) => {
@@ -157944,7 +157959,7 @@ var import_undici3 = __toESM(require_undici());
157944
157959
 
157945
157960
  // package.json
157946
157961
  var name = "wrangler";
157947
- var version = "3.79.0";
157962
+ var version = "3.80.0";
157948
157963
 
157949
157964
  // src/user/index.ts
157950
157965
  init_import_meta_url();
@@ -159392,6 +159407,14 @@ async function performApiFetch(resource, init3 = {}, queryParams, abortSignal) {
159392
159407
  delete logHeaders["Authorization"];
159393
159408
  logger.debugWithSanitization("HEADERS:", JSON.stringify(logHeaders, null, 2));
159394
159409
  logger.debugWithSanitization("INIT:", JSON.stringify({ ...init3 }, null, 2));
159410
+ if (init3.body instanceof import_undici3.FormData) {
159411
+ logger.debugWithSanitization(
159412
+ "BODY:",
159413
+ await new import_undici3.Response(init3.body).text(),
159414
+ null,
159415
+ 2
159416
+ );
159417
+ }
159395
159418
  logger.debug("-- END CF API REQUEST");
159396
159419
  return await (0, import_undici3.fetch)(`${getCloudflareApiBaseUrl()}${resource}${queryString}`, {
159397
159420
  method,
@@ -164088,9 +164111,27 @@ init_import_meta_url();
164088
164111
  var cloudflareInternalPlugin = {
164089
164112
  name: "Cloudflare internal imports plugin",
164090
164113
  setup(pluginBuild) {
164091
- pluginBuild.onResolve({ filter: /^cloudflare:.*/ }, () => {
164114
+ const paths = /* @__PURE__ */ new Set();
164115
+ pluginBuild.onStart(() => paths.clear());
164116
+ pluginBuild.onResolve({ filter: /^cloudflare:.*/ }, (args) => {
164117
+ paths.add(args.path);
164092
164118
  return { external: true };
164093
164119
  });
164120
+ pluginBuild.onEnd(() => {
164121
+ if (pluginBuild.initialOptions.format === "iife" && paths.size > 0) {
164122
+ const pathList = new Intl.ListFormat("en-US").format(
164123
+ Array.from(paths.keys()).map((p2) => `"${p2}"`).sort()
164124
+ );
164125
+ throw new Error(
164126
+ dedent2`
164127
+ Unexpected external import of ${pathList}. Imports are not valid in a Service Worker format Worker.
164128
+ Did you mean to create a Module Worker?
164129
+ If so, try adding \`export default { ... }\` in your entry-point.
164130
+ See https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/.
164131
+ `
164132
+ );
164133
+ }
164134
+ });
164094
164135
  }
164095
164136
  };
164096
164137
 
@@ -164133,16 +164174,39 @@ var nodejsHybridPlugin = /* @__PURE__ */ __name(() => {
164133
164174
  return {
164134
164175
  name: "unenv-cloudflare",
164135
164176
  setup(build5) {
164177
+ errorOnServiceWorkerFormat(build5);
164136
164178
  handleRequireCallsToNodeJSBuiltins(build5);
164137
164179
  handleAliasedNodeJSPackages(build5, alias, external);
164138
164180
  handleNodeJSGlobals(build5, inject);
164139
164181
  }
164140
164182
  };
164141
164183
  }, "nodejsHybridPlugin");
164184
+ var NODEJS_MODULES_RE = new RegExp(`^(node:)?(${import_node_module2.builtinModules.join("|")})$`);
164185
+ function errorOnServiceWorkerFormat(build5) {
164186
+ const paths = /* @__PURE__ */ new Set();
164187
+ build5.onStart(() => paths.clear());
164188
+ build5.onResolve({ filter: NODEJS_MODULES_RE }, (args) => {
164189
+ paths.add(args.path);
164190
+ return null;
164191
+ });
164192
+ build5.onEnd(() => {
164193
+ if (build5.initialOptions.format === "iife" && paths.size > 0) {
164194
+ const pathList = new Intl.ListFormat("en-US").format(
164195
+ Array.from(paths.keys()).map((p2) => `"${p2}"`).sort()
164196
+ );
164197
+ throw new Error(
164198
+ esm_default2`
164199
+ Unexpected external import of ${pathList}. Imports are not valid in a Service Worker format Worker.
164200
+ Did you mean to create a Module Worker?
164201
+ If so, try adding \`export default { ... }\` in your entry-point.
164202
+ See https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/.
164203
+ `
164204
+ );
164205
+ }
164206
+ });
164207
+ }
164208
+ __name(errorOnServiceWorkerFormat, "errorOnServiceWorkerFormat");
164142
164209
  function handleRequireCallsToNodeJSBuiltins(build5) {
164143
- const NODEJS_MODULES_RE = new RegExp(
164144
- `^(node:)?(${import_node_module2.builtinModules.join("|")})$`
164145
- );
164146
164210
  build5.onResolve({ filter: NODEJS_MODULES_RE }, (args) => {
164147
164211
  if (args.kind === "require-call") {
164148
164212
  return {
@@ -164284,23 +164348,43 @@ var nodejsCompatPlugin = /* @__PURE__ */ __name((silenceWarnings) => ({
164284
164348
  return result;
164285
164349
  }
164286
164350
  );
164351
+ pluginBuild.onEnd(() => {
164352
+ if (pluginBuild.initialOptions.format === "iife" && warnedPackaged.size > 0) {
164353
+ const paths = new Intl.ListFormat("en-US").format(
164354
+ Array.from(warnedPackaged.keys()).map((p2) => `"${p2}"`).sort()
164355
+ );
164356
+ throw new Error(`
164357
+ Unexpected external import of ${paths}. Imports are not valid in a Service Worker format Worker.
164358
+ Did you mean to create a Module Worker?
164359
+ If so, try adding \`export default { ... }\` in your entry-point.
164360
+ See https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/.
164361
+ `);
164362
+ const errors = Array.from(warnedPackaged.entries()).map(
164363
+ ([path74, importers]) => `Unexpected import "${path74}" which is not valid in a Service Worker format Worker. Are you missing \`export default { ... }\` from your Worker?
164364
+ Imported from:
164365
+ ` + toList(importers, pluginBuild.initialOptions.absWorkingDir) + "\n"
164366
+ );
164367
+ throw new Error(errors.join(""));
164368
+ }
164369
+ });
164287
164370
  pluginBuild.onEnd(() => {
164288
164371
  if (!silenceWarnings) {
164289
164372
  warnedPackaged.forEach((importers, path74) => {
164290
164373
  logger.warn(
164291
- `The package "${path74}" wasn't found on the file system but is built into node.
164292
- Your Worker may throw errors at runtime unless you enable the "nodejs_compat" compatibility flag. Refer to https://developers.cloudflare.com/workers/runtime-apis/nodejs/ for more details. Imported from:
164293
- ${importers.map(
164294
- (i) => ` - ${source_default.blue(
164295
- (0, import_path6.relative)(pluginBuild.initialOptions.absWorkingDir ?? "/", i)
164296
- )}`
164297
- ).join("\n")}`
164374
+ dedent2`
164375
+ The package "${path74}" wasn't found on the file system but is built into node.
164376
+ Your Worker may throw errors at runtime unless you enable the "nodejs_compat" compatibility flag. Refer to https://developers.cloudflare.com/workers/runtime-apis/nodejs/ for more details. Imported from:
164377
+ ${toList(importers, pluginBuild.initialOptions.absWorkingDir)}`
164298
164378
  );
164299
164379
  });
164300
164380
  }
164301
164381
  });
164302
164382
  }
164303
164383
  }), "nodejsCompatPlugin");
164384
+ function toList(items, absWorkingDir) {
164385
+ return items.map((i) => ` - ${source_default.blue((0, import_path6.relative)(absWorkingDir ?? "/", i))}`).join("\n");
164386
+ }
164387
+ __name(toList, "toList");
164304
164388
 
164305
164389
  // src/deployment-bundle/esbuild-plugins/standard-url.ts
164306
164390
  init_import_meta_url();
@@ -172387,7 +172471,7 @@ var syncAssets = /* @__PURE__ */ __name(async (accountId, scriptName, assetDirec
172387
172471
  }
172388
172472
  const numberFilesToUpload = initializeAssetsResponse.buckets.flat().length;
172389
172473
  logger.info(
172390
- `\u{1F300} Found ${numberFilesToUpload} new or modified file${numberFilesToUpload > 1 ? "s" : ""} to upload. Proceeding with upload...`
172474
+ `\u{1F300} Found ${numberFilesToUpload} new or modified static asset${numberFilesToUpload > 1 ? "s" : ""} to upload. Proceeding with upload...`
172391
172475
  );
172392
172476
  const manifestLookup = Object.entries(manifest);
172393
172477
  let assetLogCount = 0;
@@ -172602,22 +172686,26 @@ ${resolvedAssetsPath}`
172602
172686
  }
172603
172687
  __name(processAssetsArg, "processAssetsArg");
172604
172688
  function validateAssetsArgsAndConfig(args, config) {
172605
- if ((args.assets || config.assets) && (args.legacyAssets || config.legacy_assets)) {
172689
+ if ("legacy" in args ? args.assets && args.legacy.legacyAssets : (args.assets || config?.assets) && (args?.legacyAssets || config?.legacy_assets)) {
172606
172690
  throw new UserError(
172607
172691
  "Cannot use assets and legacy assets in the same Worker.\nPlease remove either the `legacy_assets` or `assets` field from your configuration file."
172608
172692
  );
172609
172693
  }
172610
- if ((args.assets || config.assets) && (args.site || config.site)) {
172694
+ if ("legacy" in args ? args.assets && args.legacy.site : (args.assets || config?.assets) && (args.site || config?.site)) {
172611
172695
  throw new UserError(
172612
172696
  "Cannot use assets and Workers Sites in the same Worker.\nPlease remove either the `site` or `assets` field from your configuration file."
172613
172697
  );
172614
172698
  }
172615
- if ((args.assets || config.assets) && config.tail_consumers?.length) {
172699
+ if ((args.assets || config?.assets) && config?.tail_consumers?.length) {
172616
172700
  throw new UserError(
172617
172701
  "Cannot use assets and tail consumers in the same Worker. Tail Workers are not yet supported for Workers with assets."
172618
172702
  );
172619
172703
  }
172620
- if (!(args.script || config.main) && config.assets?.binding) {
172704
+ const noOpEntrypoint = path22.resolve(
172705
+ getBasePath(),
172706
+ "templates/no-op-worker.js"
172707
+ );
172708
+ if ("legacy" in args ? args.entrypoint === noOpEntrypoint && args.assets?.binding : !(args.script || config?.main) && config?.assets?.binding) {
172621
172709
  throw new UserError(
172622
172710
  "Cannot use assets with a binding in an assets-only Worker.\nPlease remove the asset binding from your configuration file, or provide a Worker script in your configuration file (`main`)."
172623
172711
  );
@@ -172906,6 +172994,7 @@ var import_promises11 = require("node:fs/promises");
172906
172994
  var import_node_http2 = require("node:http");
172907
172995
  var import_node_net = __toESM(require("node:net"));
172908
172996
  var import_node_path29 = __toESM(require("node:path"));
172997
+ var util2 = __toESM(require("node:util"));
172909
172998
  var import_body_parser = __toESM(require_body_parser());
172910
172999
  var import_chokidar = require("chokidar");
172911
173000
  var import_express = __toESM(require_express2());
@@ -173140,12 +173229,66 @@ async function getBoundRegisteredWorkers({
173140
173229
  return filteredWorkers;
173141
173230
  }
173142
173231
  __name(getBoundRegisteredWorkers, "getBoundRegisteredWorkers");
173232
+ async function devRegistry(cb) {
173233
+ let previousRegistry;
173234
+ let interval;
173235
+ let hasFailedToFetch = false;
173236
+ if (getFlag("FILE_BASED_REGISTRY")) {
173237
+ await startWorkerRegistry(async (registry) => {
173238
+ if (!util2.isDeepStrictEqual(registry, previousRegistry)) {
173239
+ previousRegistry = registry;
173240
+ cb(registry);
173241
+ }
173242
+ });
173243
+ } else {
173244
+ try {
173245
+ await startWorkerRegistry();
173246
+ } catch (err) {
173247
+ logger.error("failed to start worker registry", err);
173248
+ }
173249
+ interval = setInterval(async () => {
173250
+ try {
173251
+ const registry = await getRegisteredWorkers();
173252
+ if (!util2.isDeepStrictEqual(registry, previousRegistry)) {
173253
+ previousRegistry = registry;
173254
+ cb(registry);
173255
+ }
173256
+ } catch (err) {
173257
+ if (!hasFailedToFetch) {
173258
+ hasFailedToFetch = true;
173259
+ logger.warn("Failed to get worker definitions", err);
173260
+ }
173261
+ }
173262
+ }, 300);
173263
+ }
173264
+ return async (name2) => {
173265
+ interval && clearInterval(interval);
173266
+ try {
173267
+ const [unregisterResult, stopRegistryResult] = await Promise.allSettled([
173268
+ name2 ? unregisterWorker(name2) : Promise.resolve(),
173269
+ stopWorkerRegistry()
173270
+ ]);
173271
+ if (unregisterResult.status === "rejected") {
173272
+ logger.error("Failed to unregister worker", unregisterResult.reason);
173273
+ }
173274
+ if (stopRegistryResult.status === "rejected") {
173275
+ logger.error(
173276
+ "Failed to stop worker registry",
173277
+ stopRegistryResult.reason
173278
+ );
173279
+ }
173280
+ } catch (err) {
173281
+ logger.error("Failed to cleanup dev registry", err);
173282
+ }
173283
+ };
173284
+ }
173285
+ __name(devRegistry, "devRegistry");
173143
173286
 
173144
173287
  // src/dev/dev.tsx
173145
173288
  init_import_meta_url();
173146
173289
  var import_node_child_process3 = require("node:child_process");
173147
173290
  var path37 = __toESM(require("node:path"));
173148
- var util2 = __toESM(require("node:util"));
173291
+ var util3 = __toESM(require("node:util"));
173149
173292
  var import_chokidar4 = require("chokidar");
173150
173293
 
173151
173294
  // ../../node_modules/.pnpm/clipboardy@3.0.0/node_modules/clipboardy/index.js
@@ -174016,7 +174159,7 @@ async function createPreviewToken(account, worker, ctx, session, abortSignal) {
174016
174159
  const scriptId = worker.name || (ctx.zone ? session.id : host.split(".")[0]);
174017
174160
  const url4 = ctx.env && !ctx.legacyEnv ? `/accounts/${accountId}/workers/services/${scriptId}/environments/${ctx.env}/edge-preview` : `/accounts/${accountId}/workers/scripts/${scriptId}/edge-preview`;
174018
174161
  const mode = ctx.zone ? {
174019
- routes: ctx.routes ? (
174162
+ routes: ctx.routes && ctx.routes.length > 0 ? (
174020
174163
  // extract all the route patterns
174021
174164
  ctx.routes.map((route2) => {
174022
174165
  if (typeof route2 === "string") {
@@ -175404,7 +175547,7 @@ function useDevRegistry(name2, services, durableObjects, mode) {
175404
175547
  }).then(
175405
175548
  (boundRegisteredWorkers) => {
175406
175549
  setWorkers((prevWorkers) => {
175407
- if (!util2.isDeepStrictEqual(boundRegisteredWorkers, prevWorkers)) {
175550
+ if (!util3.isDeepStrictEqual(boundRegisteredWorkers, prevWorkers)) {
175408
175551
  return boundRegisteredWorkers || {};
175409
175552
  }
175410
175553
  return prevWorkers;
@@ -175448,60 +175591,6 @@ function useDevRegistry(name2, services, durableObjects, mode) {
175448
175591
  return workers;
175449
175592
  }
175450
175593
  __name(useDevRegistry, "useDevRegistry");
175451
- async function devRegistry(cb) {
175452
- let previousRegistry;
175453
- let interval;
175454
- let hasFailedToFetch = false;
175455
- if (getFlag("FILE_BASED_REGISTRY")) {
175456
- await startWorkerRegistry(async (registry) => {
175457
- if (!util2.isDeepStrictEqual(registry, previousRegistry)) {
175458
- previousRegistry = registry;
175459
- cb(registry);
175460
- }
175461
- });
175462
- } else {
175463
- try {
175464
- await startWorkerRegistry();
175465
- } catch (err) {
175466
- logger.error("failed to start worker registry", err);
175467
- }
175468
- interval = setInterval(async () => {
175469
- try {
175470
- const registry = await getRegisteredWorkers();
175471
- if (!util2.isDeepStrictEqual(registry, previousRegistry)) {
175472
- previousRegistry = registry;
175473
- cb(registry);
175474
- }
175475
- } catch (err) {
175476
- if (!hasFailedToFetch) {
175477
- hasFailedToFetch = true;
175478
- logger.warn("Failed to get worker definitions", err);
175479
- }
175480
- }
175481
- }, 300);
175482
- }
175483
- return async (name2) => {
175484
- interval && clearInterval(interval);
175485
- try {
175486
- const [unregisterResult, stopRegistryResult] = await Promise.allSettled([
175487
- name2 ? unregisterWorker(name2) : Promise.resolve(),
175488
- stopWorkerRegistry()
175489
- ]);
175490
- if (unregisterResult.status === "rejected") {
175491
- logger.error("Failed to unregister worker", unregisterResult.reason);
175492
- }
175493
- if (stopRegistryResult.status === "rejected") {
175494
- logger.error(
175495
- "Failed to stop worker registry",
175496
- stopRegistryResult.reason
175497
- );
175498
- }
175499
- } catch (err) {
175500
- logger.error("Failed to cleanup dev registry", err);
175501
- }
175502
- };
175503
- }
175504
- __name(devRegistry, "devRegistry");
175505
175594
  function DevImplementation(props) {
175506
175595
  validateDevProps(props);
175507
175596
  const { isRawModeSupported } = (0, import_ink4.useStdin)();
@@ -175678,8 +175767,7 @@ function DevSession(props) {
175678
175767
  unsafe: {
175679
175768
  capnp: props.bindings.unsafe?.capnp,
175680
175769
  metadata: props.bindings.unsafe?.metadata
175681
- },
175682
- assets: props.assets
175770
+ }
175683
175771
  };
175684
175772
  }, [
175685
175773
  props.routes,
@@ -175695,7 +175783,6 @@ function DevSession(props) {
175695
175783
  props.isWorkersSite,
175696
175784
  props.local,
175697
175785
  props.legacyAssetsConfig,
175698
- props.assets,
175699
175786
  props.processEntrypoint,
175700
175787
  props.additionalModules,
175701
175788
  props.env,
@@ -176291,7 +176378,7 @@ init_import_meta_url();
176291
176378
  var import_node_events2 = require("node:events");
176292
176379
  var import_promises12 = require("node:fs/promises");
176293
176380
  var path39 = __toESM(require("node:path"));
176294
- var util3 = __toESM(require("node:util"));
176381
+ var util4 = __toESM(require("node:util"));
176295
176382
  var import_signal_exit7 = __toESM(require_signal_exit());
176296
176383
  async function startDevServer(props) {
176297
176384
  let workerDefinitions = {};
@@ -176318,7 +176405,7 @@ async function startDevServer(props) {
176318
176405
  services: props.bindings.services,
176319
176406
  durableObjects: props.bindings.durable_objects
176320
176407
  });
176321
- if (!util3.isDeepStrictEqual(boundRegisteredWorkers, workerDefinitions)) {
176408
+ if (!util4.isDeepStrictEqual(boundRegisteredWorkers, workerDefinitions)) {
176322
176409
  workerDefinitions = boundRegisteredWorkers || {};
176323
176410
  }
176324
176411
  }
@@ -191206,8 +191293,8 @@ __name(runSearch, "runSearch");
191206
191293
 
191207
191294
  // src/docs/index.ts
191208
191295
  function docsOptions(yargs) {
191209
- return yargs.positional("command", {
191210
- describe: "Enter the wrangler command you want to know more about",
191296
+ return yargs.positional("search", {
191297
+ describe: "Enter search terms (e.g. the wrangler command) you want to know more about",
191211
191298
  type: "string",
191212
191299
  array: true
191213
191300
  }).option("yes", {
@@ -191218,9 +191305,9 @@ function docsOptions(yargs) {
191218
191305
  }
191219
191306
  __name(docsOptions, "docsOptions");
191220
191307
  async function docsHandler(args) {
191221
- let urlToOpen = args.yes || !args.command || args.command.length === 0 ? "https://developers.cloudflare.com/workers/wrangler/commands/" : "";
191222
- if (args.command && args.command.length > 0) {
191223
- const searchTerm = args.command.join(" ");
191308
+ let urlToOpen = args.yes || !args.search || args.search.length === 0 ? "https://developers.cloudflare.com/workers/wrangler/commands/" : "";
191309
+ if (args.search && args.search.length > 0) {
191310
+ const searchTerm = args.search.join(" ");
191224
191311
  const searchResult = await runSearch(searchTerm);
191225
191312
  urlToOpen = searchResult ?? urlToOpen;
191226
191313
  }
@@ -207463,7 +207550,7 @@ __name(setNodeAsyncContextStrategy, "setNodeAsyncContextStrategy");
207463
207550
 
207464
207551
  // ../../node_modules/.pnpm/@sentry+node@7.87.0_supports-color@9.2.2/node_modules/@sentry/node/esm/integrations/console.js
207465
207552
  init_import_meta_url();
207466
- var util4 = __toESM(require("util"));
207553
+ var util5 = __toESM(require("util"));
207467
207554
  var Console = class {
207468
207555
  constructor() {
207469
207556
  Console.prototype.__init.call(this);
@@ -207493,7 +207580,7 @@ var Console = class {
207493
207580
  {
207494
207581
  category: "console",
207495
207582
  level: severityLevelFromString(level),
207496
- message: util4.format.apply(void 0, args)
207583
+ message: util5.format.apply(void 0, args)
207497
207584
  },
207498
207585
  {
207499
207586
  input: [...args],
@@ -209956,6 +210043,16 @@ function constructTypeKey(key) {
209956
210043
  return `"${key}"`;
209957
210044
  }
209958
210045
  __name(constructTypeKey, "constructTypeKey");
210046
+ function constructTSModuleGlob(glob) {
210047
+ if (!glob.includes("*")) {
210048
+ return glob;
210049
+ } else if (glob.includes(".")) {
210050
+ return `*.${glob.split(".").at(-1)}`;
210051
+ } else {
210052
+ return glob.replace("**/*", "*").replace("**/", "*/").replace("/**", "/*");
210053
+ }
210054
+ }
210055
+ __name(constructTSModuleGlob, "constructTSModuleGlob");
209959
210056
  function generateImportSpecifier(from, to) {
209960
210057
  const relativePath = (0, import_node_path60.relative)((0, import_node_path60.dirname)(from), (0, import_node_path60.dirname)(to)).replace(/\\/g, "/");
209961
210058
  const filename = (0, import_node_path60.basename)(to, (0, import_node_path60.extname)(to));
@@ -210141,7 +210238,7 @@ async function generateTypes(configToDTS, config, envInterface, outputPath) {
210141
210238
  const typeScriptType = moduleTypeMap[ruleObject.type];
210142
210239
  if (typeScriptType !== void 0) {
210143
210240
  ruleObject.globs.forEach((glob) => {
210144
- modulesTypeStructure.push(`declare module "*.${glob.split(".").at(-1)}" {
210241
+ modulesTypeStructure.push(`declare module "${constructTSModuleGlob(glob)}" {
210145
210242
  const value: ${typeScriptType};
210146
210243
  export default value;
210147
210244
  }`);
@@ -213349,7 +213446,7 @@ function createCLIParser(argv) {
213349
213446
  }
213350
213447
  );
213351
213448
  wrangler.command(
213352
- "docs [command]",
213449
+ "docs [search..]",
213353
213450
  "\u{1F4DA} Open Wrangler's command documentation in your browser\n",
213354
213451
  docsOptions,
213355
213452
  docsHandler
@@ -213776,8 +213873,17 @@ ${tryRunningItIn}${oneOfThese}`
213776
213873
  logBuildFailure(e3.errors, e3.warnings);
213777
213874
  logger.error(e3.message);
213778
213875
  } else {
213779
- logger.error(e3 instanceof Error ? e3.message : e3);
213780
- if (!(e3 instanceof UserError)) {
213876
+ let loggableException = e3;
213877
+ if (
213878
+ // Is this a StartDevEnv error event? If so, unwrap the cause, which is usually the user-recognisable error
213879
+ e3 && typeof e3 === "object" && "type" in e3 && e3.type === "error" && "cause" in e3 && e3.cause instanceof Error
213880
+ ) {
213881
+ loggableException = e3.cause;
213882
+ }
213883
+ logger.error(
213884
+ loggableException instanceof Error ? loggableException.message : loggableException
213885
+ );
213886
+ if (!(loggableException instanceof UserError)) {
213781
213887
  await logPossibleBugMessage();
213782
213888
  }
213783
213889
  }
@@ -214044,7 +214150,7 @@ function devOptions(yargs) {
214044
214150
  alias: ["x-dev-env"],
214045
214151
  type: "boolean",
214046
214152
  describe: "Use the experimental DevEnv instantiation (unified across wrangler dev and unstable_dev)",
214047
- default: false
214153
+ default: true
214048
214154
  }).option("experimental-registry", {
214049
214155
  alias: ["x-registry"],
214050
214156
  type: "boolean",
@@ -214163,8 +214269,6 @@ async function startDev(args) {
214163
214269
  let assetsWatcher;
214164
214270
  let rerender;
214165
214271
  try {
214166
- const configPath = args.config || args.script && findWranglerToml(import_node_path64.default.dirname(args.script));
214167
- let config = readConfig(configPath, args);
214168
214272
  if (args.logLevel) {
214169
214273
  logger.loggerLevel = args.logLevel;
214170
214274
  }
@@ -214195,26 +214299,11 @@ Move any existing data to .wrangler/state and use --persist, or
214195
214299
  use --persist-to=./wrangler-local-state to keep using the old path.`
214196
214300
  );
214197
214301
  }
214198
- if ((args.legacyAssets || config.legacy_assets) && (args.site || config.site)) {
214199
- throw new UserError(
214200
- "Cannot use legacy assets and Workers Sites in the same Worker."
214201
- );
214202
- }
214203
- if ((args.assets || config.assets) && args.remote) {
214204
- throw new UserError(
214205
- "Cannot use assets in remote mode. Workers with assets are only supported in local mode. Please use `wrangler dev`."
214206
- );
214207
- }
214208
- validateAssetsArgsAndConfig(args, config);
214209
- let assetsOptions = processAssetsArg(args, config);
214210
- if (assetsOptions) {
214211
- args.forceLocal = true;
214212
- }
214213
- const projectRoot = configPath && import_node_path64.default.dirname(configPath);
214302
+ const configPath = args.config || args.script && findWranglerToml(import_node_path64.default.dirname(args.script));
214214
214303
  const devEnv = new DevEnv();
214215
214304
  if (args.experimentalDevEnv) {
214216
214305
  void devEnv.proxy.ready.promise.then(({ url: url4 }) => {
214217
- if (process.send) {
214306
+ if (process.send && typeof vitest === "undefined") {
214218
214307
  process.send(
214219
214308
  JSON.stringify({
214220
214309
  event: "DEV_SERVER_READY",
@@ -214253,126 +214342,127 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
214253
214342
  if (isInteractive() && args.showInteractiveDevSession !== false) {
214254
214343
  unregisterHotKeys = registerDevHotKeys(devEnv, args);
214255
214344
  }
214256
- await devEnv.config.set({
214257
- name: args.name,
214258
- config: configPath,
214259
- entrypoint: args.script,
214260
- compatibilityDate: args.compatibilityDate,
214261
- compatibilityFlags: args.compatibilityFlags,
214262
- triggers: args.routes?.map(
214263
- (r3) => ({
214264
- type: "route",
214265
- pattern: r3
214266
- })
214267
- ),
214268
- build: {
214269
- bundle: args.bundle !== void 0 ? args.bundle : void 0,
214270
- define: collectKeyValues(args.define),
214271
- jsxFactory: args.jsxFactory,
214272
- jsxFragment: args.jsxFragment,
214273
- tsconfig: args.tsconfig,
214274
- minify: args.minify,
214275
- processEntrypoint: args.processEntrypoint,
214276
- additionalModules: args.additionalModules,
214277
- moduleRoot: args.moduleRoot,
214278
- moduleRules: args.rules,
214279
- nodejsCompatMode: (parsedConfig) => validateNodeCompatMode(
214280
- args.compatibilityDate ?? parsedConfig.compatibility_date,
214281
- args.compatibilityFlags ?? parsedConfig.compatibility_flags ?? [],
214282
- {
214283
- nodeCompat: args.nodeCompat ?? parsedConfig.node_compat,
214284
- noBundle: args.noBundle ?? parsedConfig.no_bundle
214285
- }
214286
- )
214287
- },
214288
- bindings: {
214289
- ...await getPagesAssetsFetcher(
214290
- args.enablePagesAssetsServiceBinding
214345
+ await devEnv.config.set(
214346
+ {
214347
+ name: args.name,
214348
+ config: configPath,
214349
+ entrypoint: args.script,
214350
+ compatibilityDate: args.compatibilityDate,
214351
+ compatibilityFlags: args.compatibilityFlags,
214352
+ triggers: args.routes?.map(
214353
+ (r3) => ({
214354
+ type: "route",
214355
+ pattern: r3
214356
+ })
214291
214357
  ),
214292
- ...collectPlainTextVars(args.var),
214293
- ...convertCfWorkerInitBindingstoBindings({
214294
- kv_namespaces: args.kv,
214295
- vars: args.vars,
214296
- send_email: void 0,
214297
- wasm_modules: void 0,
214298
- text_blobs: void 0,
214299
- browser: void 0,
214300
- ai: args.ai,
214301
- version_metadata: args.version_metadata,
214302
- data_blobs: void 0,
214303
- durable_objects: { bindings: args.durableObjects ?? [] },
214304
- queues: void 0,
214305
- r2_buckets: args.r2,
214306
- d1_databases: args.d1Databases,
214307
- vectorize: void 0,
214308
- hyperdrive: void 0,
214309
- services: args.services,
214310
- analytics_engine_datasets: void 0,
214311
- dispatch_namespaces: void 0,
214312
- mtls_certificates: void 0,
214313
- pipelines: void 0,
214314
- logfwdr: void 0,
214315
- unsafe: void 0,
214316
- assets: void 0
214317
- })
214318
- },
214319
- dev: {
214320
- auth: async () => {
214321
- let accountId = args.accountId;
214322
- if (!accountId) {
214323
- unregisterHotKeys?.();
214324
- accountId = await requireAuth({});
214325
- unregisterHotKeys = registerDevHotKeys(devEnv, args);
214326
- }
214327
- return {
214328
- accountId,
214329
- apiToken: requireApiToken()
214330
- };
214331
- },
214332
- remote: !args.forceLocal && args.remote,
214333
- server: {
214334
- hostname: args.ip,
214335
- port: args.port,
214336
- secure: args.localProtocol === void 0 ? void 0 : args.localProtocol === "https",
214337
- httpsCertPath: args.httpsCertPath,
214338
- httpsKeyPath: args.httpsKeyPath
214358
+ env: args.env,
214359
+ build: {
214360
+ bundle: args.bundle !== void 0 ? args.bundle : void 0,
214361
+ define: collectKeyValues(args.define),
214362
+ jsxFactory: args.jsxFactory,
214363
+ jsxFragment: args.jsxFragment,
214364
+ tsconfig: args.tsconfig,
214365
+ minify: args.minify,
214366
+ processEntrypoint: args.processEntrypoint,
214367
+ additionalModules: args.additionalModules,
214368
+ moduleRoot: args.moduleRoot,
214369
+ moduleRules: args.rules,
214370
+ nodejsCompatMode: (parsedConfig) => validateNodeCompatMode(
214371
+ args.compatibilityDate ?? parsedConfig.compatibility_date,
214372
+ args.compatibilityFlags ?? parsedConfig.compatibility_flags ?? [],
214373
+ {
214374
+ nodeCompat: args.nodeCompat ?? parsedConfig.node_compat,
214375
+ noBundle: args.noBundle ?? parsedConfig.no_bundle
214376
+ }
214377
+ )
214339
214378
  },
214340
- inspector: {
214341
- port: args.inspectorPort
214379
+ bindings: {
214380
+ ...await getPagesAssetsFetcher(
214381
+ args.enablePagesAssetsServiceBinding
214382
+ ),
214383
+ ...collectPlainTextVars(args.var),
214384
+ ...convertCfWorkerInitBindingstoBindings({
214385
+ kv_namespaces: args.kv,
214386
+ vars: args.vars,
214387
+ send_email: void 0,
214388
+ wasm_modules: void 0,
214389
+ text_blobs: void 0,
214390
+ browser: void 0,
214391
+ ai: args.ai,
214392
+ version_metadata: args.version_metadata,
214393
+ data_blobs: void 0,
214394
+ durable_objects: { bindings: args.durableObjects ?? [] },
214395
+ queues: void 0,
214396
+ r2_buckets: args.r2,
214397
+ d1_databases: args.d1Databases,
214398
+ vectorize: void 0,
214399
+ hyperdrive: void 0,
214400
+ services: args.services,
214401
+ analytics_engine_datasets: void 0,
214402
+ dispatch_namespaces: void 0,
214403
+ mtls_certificates: void 0,
214404
+ pipelines: void 0,
214405
+ logfwdr: void 0,
214406
+ unsafe: void 0,
214407
+ assets: void 0
214408
+ })
214342
214409
  },
214343
- origin: {
214344
- hostname: args.host ?? args.localUpstream,
214345
- secure: args.upstreamProtocol === void 0 ? void 0 : args.upstreamProtocol === "https"
214410
+ dev: {
214411
+ auth: async () => {
214412
+ let accountId = args.accountId;
214413
+ if (!accountId) {
214414
+ unregisterHotKeys?.();
214415
+ accountId = await requireAuth({});
214416
+ unregisterHotKeys = registerDevHotKeys(devEnv, args);
214417
+ }
214418
+ return {
214419
+ accountId,
214420
+ apiToken: requireApiToken()
214421
+ };
214422
+ },
214423
+ remote: !args.forceLocal && args.remote,
214424
+ server: {
214425
+ hostname: args.ip,
214426
+ port: args.port,
214427
+ secure: args.localProtocol === void 0 ? void 0 : args.localProtocol === "https",
214428
+ httpsCertPath: args.httpsCertPath,
214429
+ httpsKeyPath: args.httpsKeyPath
214430
+ },
214431
+ inspector: {
214432
+ port: args.inspectorPort
214433
+ },
214434
+ origin: {
214435
+ hostname: args.host ?? args.localUpstream,
214436
+ secure: args.upstreamProtocol === void 0 ? void 0 : args.upstreamProtocol === "https"
214437
+ },
214438
+ persist: args.persistTo,
214439
+ liveReload: args.liveReload,
214440
+ testScheduled: args.testScheduled,
214441
+ logLevel: args.logLevel,
214442
+ registry: devEnv.config.latestConfig?.dev.registry
214346
214443
  },
214347
- persist: args.persistTo,
214348
- liveReload: args.liveReload,
214349
- testScheduled: args.testScheduled,
214350
- logLevel: args.logLevel,
214351
- registry: devEnv.config.latestConfig?.dev.registry
214352
- },
214353
- legacy: {
214354
- site: (configParam) => {
214355
- const legacyAssetPaths = getResolvedLegacyAssetPaths(
214356
- args,
214357
- configParam
214358
- );
214359
- return Boolean(args.site || configParam.site) && legacyAssetPaths ? {
214360
- bucket: import_node_path64.default.join(
214361
- legacyAssetPaths.baseDirectory,
214362
- legacyAssetPaths?.assetDirectory
214363
- ),
214364
- include: legacyAssetPaths.includePatterns,
214365
- exclude: legacyAssetPaths.excludePatterns
214366
- } : void 0;
214444
+ legacy: {
214445
+ site: (configParam) => {
214446
+ const legacyAssetPaths = getResolvedLegacyAssetPaths(
214447
+ args,
214448
+ configParam
214449
+ );
214450
+ return Boolean(args.site || configParam.site) && legacyAssetPaths ? {
214451
+ bucket: import_node_path64.default.join(
214452
+ legacyAssetPaths.baseDirectory,
214453
+ legacyAssetPaths?.assetDirectory
214454
+ ),
214455
+ include: legacyAssetPaths.includePatterns,
214456
+ exclude: legacyAssetPaths.excludePatterns
214457
+ } : void 0;
214458
+ },
214459
+ legacyAssets: (configParam) => args.legacyAssets ?? configParam.legacy_assets,
214460
+ enableServiceEnvironments: !(args.legacyEnv ?? true)
214367
214461
  },
214368
- legacyAssets: (configParam) => configParam.legacy_assets,
214369
- enableServiceEnvironments: !(args.legacyEnv ?? true)
214462
+ assets: args.assets
214370
214463
  },
214371
- // only pass `assetsOptions` if it came from args not from config
214372
- // otherwise config at startup ends up overriding future config changes in the
214373
- // ConfigController
214374
- assets: args.assets ? assetsOptions : void 0
214375
- });
214464
+ true
214465
+ );
214376
214466
  void sendMetricsEvent(
214377
214467
  "run dev",
214378
214468
  {
@@ -214387,179 +214477,200 @@ use --persist-to=./wrangler-local-state to keep using the old path.`
214387
214477
  }
214388
214478
  );
214389
214479
  return devEnv;
214390
- }
214391
- if (config.configPath && !args.experimentalDevEnv) {
214392
- configFileWatcher = (0, import_chokidar6.watch)(config.configPath, {
214393
- persistent: true
214394
- }).on("change", async (_event) => {
214395
- try {
214396
- config = readConfig(configPath, args);
214397
- if (!config.configPath) {
214398
- return;
214399
- }
214400
- logger.log(`${import_node_path64.default.basename(config.configPath)} changed...`);
214401
- entry = await getEntry(
214402
- {
214403
- legacyAssets: args.legacyAssets,
214404
- script: args.script,
214405
- moduleRoot: args.moduleRoot,
214406
- assets: args.assets
214407
- },
214408
- config,
214409
- "dev"
214410
- );
214411
- await getHostAndRoutes(args, config);
214412
- assetsOptions = processAssetsArg(args, config);
214413
- if (assetsOptions && !args.assets) {
214414
- await assetsWatcher?.close();
214415
- if (assetsOptions) {
214416
- const debouncedRerender = debounce(async () => {
214417
- rerender(await getDevReactElement(config));
214418
- }, 100);
214419
- assetsWatcher = (0, import_chokidar6.watch)(assetsOptions.directory, {
214420
- persistent: true,
214421
- ignoreInitial: true
214422
- }).on("all", async (eventName, changedPath) => {
214423
- const message = getAssetChangeMessage(eventName, changedPath);
214424
- logger.log(`\u{1F300} ${message}...`);
214425
- debouncedRerender();
214426
- });
214480
+ } else {
214481
+ const projectRoot = configPath && import_node_path64.default.dirname(configPath);
214482
+ let config = readConfig(configPath, args);
214483
+ if ((args.legacyAssets || config.legacy_assets) && (args.site || config.site)) {
214484
+ throw new UserError(
214485
+ "Cannot use legacy assets and Workers Sites in the same Worker."
214486
+ );
214487
+ }
214488
+ if ((args.assets || config.assets) && args.remote) {
214489
+ throw new UserError(
214490
+ "Cannot use assets in remote mode. Workers with assets are only supported in local mode. Please use `wrangler dev`."
214491
+ );
214492
+ }
214493
+ validateAssetsArgsAndConfig(args, config);
214494
+ let assetsOptions = processAssetsArg(args, config);
214495
+ if (assetsOptions) {
214496
+ args.forceLocal = true;
214497
+ }
214498
+ if (config.configPath && !args.experimentalDevEnv) {
214499
+ configFileWatcher = (0, import_chokidar6.watch)(config.configPath, {
214500
+ persistent: true
214501
+ }).on("change", async (_event) => {
214502
+ try {
214503
+ config = readConfig(configPath, args);
214504
+ if (!config.configPath) {
214505
+ return;
214506
+ }
214507
+ logger.log(`${import_node_path64.default.basename(config.configPath)} changed...`);
214508
+ entry = await getEntry(
214509
+ {
214510
+ legacyAssets: args.legacyAssets,
214511
+ script: args.script,
214512
+ moduleRoot: args.moduleRoot,
214513
+ assets: args.assets
214514
+ },
214515
+ config,
214516
+ "dev"
214517
+ );
214518
+ await getHostAndRoutes(args, config);
214519
+ assetsOptions = processAssetsArg(args, config);
214520
+ if (assetsOptions && !args.assets) {
214521
+ await assetsWatcher?.close();
214522
+ if (assetsOptions) {
214523
+ const debouncedRerender = debounce(async () => {
214524
+ rerender(await getDevReactElement(config));
214525
+ }, 100);
214526
+ assetsWatcher = (0, import_chokidar6.watch)(assetsOptions.directory, {
214527
+ persistent: true,
214528
+ ignoreInitial: true
214529
+ }).on("all", async (eventName, changedPath) => {
214530
+ const message = getAssetChangeMessage(eventName, changedPath);
214531
+ logger.debug(`\u{1F300} ${message}...`);
214532
+ debouncedRerender();
214533
+ });
214534
+ }
214427
214535
  }
214536
+ rerender(await getDevReactElement(config));
214537
+ } catch (err) {
214538
+ logger.error(err);
214428
214539
  }
214429
- rerender(await getDevReactElement(config));
214430
- } catch (err) {
214431
- logger.error(err);
214432
- }
214433
- });
214434
- }
214435
- const devServerSettings = await validateDevServerSettings(args, config);
214436
- let { entry } = devServerSettings;
214437
- const {
214438
- upstreamProtocol,
214439
- host,
214440
- routes,
214441
- getLocalPort: getLocalPort2,
214442
- getInspectorPort: getInspectorPort2,
214443
- getRuntimeInspectorPort,
214444
- cliDefines,
214445
- cliAlias,
214446
- localPersistencePath,
214447
- processEntrypoint,
214448
- additionalModules
214449
- } = devServerSettings;
214450
- const nodejsCompatMode = validateNodeCompatMode(
214451
- args.compatibilityDate ?? config.compatibility_date,
214452
- args.compatibilityFlags ?? config.compatibility_flags ?? [],
214453
- {
214454
- nodeCompat: args.nodeCompat ?? config.node_compat,
214455
- noBundle: args.noBundle ?? config.no_bundle
214540
+ });
214456
214541
  }
214457
- );
214458
- void sendMetricsEvent(
214459
- "run dev",
214460
- {
214461
- local: !args.remote,
214462
- usesTypeScript: /\.tsx?$/.test(entry.file)
214463
- },
214464
- { sendMetrics: config.send_metrics, offline: !args.remote }
214465
- );
214466
- async function getDevReactElement(configParam) {
214467
- const { legacyAssetPaths, bindings } = getBindingsAndLegacyAssetPaths(
214468
- args,
214469
- configParam
214470
- );
214471
- return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
214472
- dev_default,
214542
+ const devServerSettings = await validateDevServerSettings(args, config);
214543
+ let { entry } = devServerSettings;
214544
+ const {
214545
+ upstreamProtocol,
214546
+ host,
214547
+ routes,
214548
+ getLocalPort: getLocalPort2,
214549
+ getInspectorPort: getInspectorPort2,
214550
+ getRuntimeInspectorPort,
214551
+ cliDefines,
214552
+ cliAlias,
214553
+ localPersistencePath,
214554
+ processEntrypoint,
214555
+ additionalModules
214556
+ } = devServerSettings;
214557
+ const nodejsCompatMode = validateNodeCompatMode(
214558
+ args.compatibilityDate ?? config.compatibility_date,
214559
+ args.compatibilityFlags ?? config.compatibility_flags ?? [],
214473
214560
  {
214474
- name: getScriptName({ name: args.name, env: args.env }, configParam),
214475
- noBundle: !(args.bundle ?? !configParam.no_bundle),
214476
- findAdditionalModules: configParam.find_additional_modules,
214477
- entry,
214478
- env: args.env,
214479
- host,
214480
- routes,
214481
- processEntrypoint,
214482
- additionalModules,
214483
- rules: args.rules ?? getRules(configParam),
214484
- legacyEnv: isLegacyEnv(configParam),
214485
- minify: args.minify ?? configParam.minify,
214486
- nodejsCompatMode,
214487
- build: configParam.build || {},
214488
- define: { ...configParam.define, ...cliDefines },
214489
- alias: { ...configParam.alias, ...cliAlias },
214490
- initialMode: args.remote ? "remote" : "local",
214491
- jsxFactory: args.jsxFactory || configParam.jsx_factory,
214492
- jsxFragment: args.jsxFragment || configParam.jsx_fragment,
214493
- tsconfig: args.tsconfig ?? configParam.tsconfig,
214494
- upstreamProtocol,
214495
- localProtocol: args.localProtocol || configParam.dev.local_protocol,
214496
- httpsKeyPath: args.httpsKeyPath,
214497
- httpsCertPath: args.httpsCertPath,
214498
- localUpstream: args.localUpstream ?? host ?? getInferredHost(routes),
214499
- localPersistencePath,
214500
- liveReload: args.liveReload || false,
214501
- accountId: args.accountId ?? configParam.account_id ?? getAccountFromCache()?.id,
214502
- legacyAssetPaths,
214503
- legacyAssetsConfig: configParam.legacy_assets,
214504
- assets: assetsOptions,
214505
- initialPort: args.port ?? configParam.dev.port ?? await getLocalPort2(),
214506
- initialIp: args.ip || configParam.dev.ip,
214507
- inspectorPort: args.inspectorPort ?? configParam.dev.inspector_port ?? await getInspectorPort2(),
214508
- runtimeInspectorPort: await getRuntimeInspectorPort(),
214509
- isWorkersSite: Boolean(args.site || configParam.site),
214510
- compatibilityDate: getDevCompatibilityDate(
214511
- configParam,
214512
- args.compatibilityDate
214513
- ),
214514
- compatibilityFlags: args.compatibilityFlags || configParam.compatibility_flags,
214515
- usageModel: configParam.usage_model,
214516
- bindings,
214517
- migrations: configParam.migrations,
214518
- crons: configParam.triggers.crons,
214519
- queueConsumers: configParam.queues.consumers,
214520
- onReady: args.onReady,
214521
- inspect: args.inspect ?? true,
214522
- showInteractiveDevSession: args.showInteractiveDevSession,
214523
- forceLocal: args.forceLocal,
214524
- enablePagesAssetsServiceBinding: args.enablePagesAssetsServiceBinding,
214525
- firstPartyWorker: configParam.first_party_worker,
214526
- sendMetrics: configParam.send_metrics,
214527
- testScheduled: args.testScheduled,
214528
- projectRoot,
214529
- rawArgs: args,
214530
- rawConfig: configParam,
214531
- devEnv
214561
+ nodeCompat: args.nodeCompat ?? config.node_compat,
214562
+ noBundle: args.noBundle ?? config.no_bundle
214532
214563
  }
214533
214564
  );
214534
- }
214535
- __name(getDevReactElement, "getDevReactElement");
214536
- const devReactElement = (0, import_ink13.render)(await getDevReactElement(config));
214537
- rerender = devReactElement.rerender;
214538
- if (assetsOptions && !args.experimentalDevEnv) {
214539
- const debouncedRerender = debounce(async () => {
214540
- rerender(await getDevReactElement(config));
214541
- }, 100);
214542
- assetsWatcher = (0, import_chokidar6.watch)(assetsOptions.directory, {
214543
- persistent: true,
214544
- ignoreInitial: true
214545
- }).on("all", async (eventName, filePath) => {
214546
- const message = getAssetChangeMessage(eventName, filePath);
214547
- logger.log(`\u{1F300} ${message}...`);
214548
- debouncedRerender();
214549
- });
214550
- }
214551
- return {
214552
- devReactElement,
214553
- configFileWatcher,
214554
- assetsWatcher,
214555
- stop: async () => {
214556
- devReactElement.unmount();
214557
- await Promise.allSettled([
214558
- configFileWatcher?.close(),
214559
- assetsWatcher?.close()
214560
- ]);
214565
+ void sendMetricsEvent(
214566
+ "run dev",
214567
+ {
214568
+ local: !args.remote,
214569
+ usesTypeScript: /\.tsx?$/.test(entry.file)
214570
+ },
214571
+ { sendMetrics: config.send_metrics, offline: !args.remote }
214572
+ );
214573
+ async function getDevReactElement(configParam) {
214574
+ const { legacyAssetPaths, bindings } = getBindingsAndLegacyAssetPaths(
214575
+ args,
214576
+ configParam
214577
+ );
214578
+ return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
214579
+ dev_default,
214580
+ {
214581
+ name: getScriptName(
214582
+ { name: args.name, env: args.env },
214583
+ configParam
214584
+ ),
214585
+ noBundle: !(args.bundle ?? !configParam.no_bundle),
214586
+ findAdditionalModules: configParam.find_additional_modules,
214587
+ entry,
214588
+ env: args.env,
214589
+ host,
214590
+ routes,
214591
+ processEntrypoint,
214592
+ additionalModules,
214593
+ rules: args.rules ?? getRules(configParam),
214594
+ legacyEnv: isLegacyEnv(configParam),
214595
+ minify: args.minify ?? configParam.minify,
214596
+ nodejsCompatMode,
214597
+ build: configParam.build || {},
214598
+ define: { ...configParam.define, ...cliDefines },
214599
+ alias: { ...configParam.alias, ...cliAlias },
214600
+ initialMode: args.remote ? "remote" : "local",
214601
+ jsxFactory: args.jsxFactory || configParam.jsx_factory,
214602
+ jsxFragment: args.jsxFragment || configParam.jsx_fragment,
214603
+ tsconfig: args.tsconfig ?? configParam.tsconfig,
214604
+ upstreamProtocol,
214605
+ localProtocol: args.localProtocol || configParam.dev.local_protocol,
214606
+ httpsKeyPath: args.httpsKeyPath,
214607
+ httpsCertPath: args.httpsCertPath,
214608
+ localUpstream: args.localUpstream ?? host ?? getInferredHost(routes),
214609
+ localPersistencePath,
214610
+ liveReload: args.liveReload || false,
214611
+ accountId: args.accountId ?? configParam.account_id ?? getAccountFromCache()?.id,
214612
+ legacyAssetPaths,
214613
+ legacyAssetsConfig: configParam.legacy_assets,
214614
+ assets: assetsOptions,
214615
+ initialPort: args.port ?? configParam.dev.port ?? await getLocalPort2(),
214616
+ initialIp: args.ip || configParam.dev.ip,
214617
+ inspectorPort: args.inspectorPort ?? configParam.dev.inspector_port ?? await getInspectorPort2(),
214618
+ runtimeInspectorPort: await getRuntimeInspectorPort(),
214619
+ isWorkersSite: Boolean(args.site || configParam.site),
214620
+ compatibilityDate: getDevCompatibilityDate(
214621
+ configParam,
214622
+ args.compatibilityDate
214623
+ ),
214624
+ compatibilityFlags: args.compatibilityFlags || configParam.compatibility_flags,
214625
+ usageModel: configParam.usage_model,
214626
+ bindings,
214627
+ migrations: configParam.migrations,
214628
+ crons: configParam.triggers.crons,
214629
+ queueConsumers: configParam.queues.consumers,
214630
+ onReady: args.onReady,
214631
+ inspect: args.inspect ?? true,
214632
+ showInteractiveDevSession: args.showInteractiveDevSession,
214633
+ forceLocal: args.forceLocal,
214634
+ enablePagesAssetsServiceBinding: args.enablePagesAssetsServiceBinding,
214635
+ firstPartyWorker: configParam.first_party_worker,
214636
+ sendMetrics: configParam.send_metrics,
214637
+ testScheduled: args.testScheduled,
214638
+ projectRoot,
214639
+ rawArgs: args,
214640
+ rawConfig: configParam,
214641
+ devEnv
214642
+ }
214643
+ );
214561
214644
  }
214562
- };
214645
+ __name(getDevReactElement, "getDevReactElement");
214646
+ const devReactElement = (0, import_ink13.render)(await getDevReactElement(config));
214647
+ rerender = devReactElement.rerender;
214648
+ if (assetsOptions && !args.experimentalDevEnv) {
214649
+ const debouncedRerender = debounce(async () => {
214650
+ rerender(await getDevReactElement(config));
214651
+ }, 100);
214652
+ assetsWatcher = (0, import_chokidar6.watch)(assetsOptions.directory, {
214653
+ persistent: true,
214654
+ ignoreInitial: true
214655
+ }).on("all", async (eventName, filePath) => {
214656
+ const message = getAssetChangeMessage(eventName, filePath);
214657
+ logger.debug(`\u{1F300} ${message}...`);
214658
+ debouncedRerender();
214659
+ });
214660
+ }
214661
+ return {
214662
+ devReactElement,
214663
+ configFileWatcher,
214664
+ assetsWatcher,
214665
+ stop: async () => {
214666
+ devReactElement.unmount();
214667
+ await Promise.allSettled([
214668
+ configFileWatcher?.close(),
214669
+ assetsWatcher?.close()
214670
+ ]);
214671
+ }
214672
+ };
214673
+ }
214563
214674
  } catch (e3) {
214564
214675
  await Promise.allSettled([
214565
214676
  configFileWatcher?.close(),
@@ -215451,6 +215562,22 @@ var BundlerController = class extends Controller {
215451
215562
  })
215452
215563
  );
215453
215564
  }
215565
+ #assetsWatcher;
215566
+ async #ensureWatchingAssets(config) {
215567
+ await this.#assetsWatcher?.close();
215568
+ if (config.assets?.directory) {
215569
+ this.#assetsWatcher = (0, import_chokidar7.watch)(config.assets.directory, {
215570
+ persistent: true,
215571
+ ignoreInitial: true
215572
+ }).on("all", async (eventName, filePath) => {
215573
+ const message = getAssetChangeMessage(eventName, filePath);
215574
+ logger.debug(`\u{1F300} ${message}...`);
215575
+ if (this.#currentBundle) {
215576
+ this.emitBundleCompleteEvent(config, this.#currentBundle);
215577
+ }
215578
+ });
215579
+ }
215580
+ }
215454
215581
  #tmpDir;
215455
215582
  onConfigUpdate(event) {
215456
215583
  this.#tmpDir?.remove();
@@ -215470,6 +215597,7 @@ var BundlerController = class extends Controller {
215470
215597
  }
215471
215598
  void this.#startCustomBuild(event.config);
215472
215599
  void this.#startBundle(event.config);
215600
+ void this.#ensureWatchingAssets(event.config);
215473
215601
  }
215474
215602
  async teardown() {
215475
215603
  logger.debug("BundlerController teardown beginning...");
@@ -215477,7 +215605,8 @@ var BundlerController = class extends Controller {
215477
215605
  this.#tmpDir?.remove();
215478
215606
  await Promise.all([
215479
215607
  this.#bundlerCleanup?.(),
215480
- this.#customBuildWatcher?.close()
215608
+ this.#customBuildWatcher?.close(),
215609
+ this.#assetsWatcher?.close()
215481
215610
  ]);
215482
215611
  logger.debug("BundlerController teardown complete");
215483
215612
  }
@@ -215498,6 +215627,12 @@ var import_chokidar8 = require("chokidar");
215498
215627
  var getInspectorPort = memoizeGetPort(DEFAULT_INSPECTOR_PORT, "127.0.0.1");
215499
215628
  var getLocalPort = memoizeGetPort(DEFAULT_LOCAL_PORT, "localhost");
215500
215629
  async function resolveDevConfig(config, input) {
215630
+ const auth = input.dev?.auth ?? (async () => {
215631
+ return {
215632
+ accountId: await getAccountId(),
215633
+ apiToken: requireApiToken()
215634
+ };
215635
+ });
215501
215636
  const localPersistencePath = getLocalPersistencePath(
215502
215637
  input.dev?.persist,
215503
215638
  config.configPath
@@ -215508,24 +215643,24 @@ async function resolveDevConfig(config, input) {
215508
215643
  routes: input.triggers?.filter(
215509
215644
  (t3) => t3.type === "route"
215510
215645
  ),
215511
- assets: input?.assets?.directory
215646
+ assets: input?.assets
215512
215647
  },
215513
215648
  config
215514
215649
  );
215650
+ if (input.dev?.remote) {
215651
+ const { accountId } = await unwrapHook(auth);
215652
+ (0, import_node_assert25.default)(accountId, "Account ID must be provided for remote dev");
215653
+ await getZoneIdForPreview({ host, routes, accountId });
215654
+ }
215515
215655
  const initialIp = input.dev?.server?.hostname ?? config.dev.ip;
215516
215656
  const initialIpListenCheck = initialIp === "*" ? "0.0.0.0" : initialIp;
215517
215657
  return {
215518
- auth: input.dev?.auth ?? (async () => {
215519
- return {
215520
- accountId: await getAccountId(),
215521
- apiToken: requireApiToken()
215522
- };
215523
- }),
215658
+ auth,
215524
215659
  remote: input.dev?.remote,
215525
215660
  server: {
215526
215661
  hostname: input.dev?.server?.hostname || config.dev.ip,
215527
215662
  port: input.dev?.server?.port ?? config.dev.port ?? await getLocalPort(initialIpListenCheck),
215528
- secure: input.dev?.server?.secure || config.dev.local_protocol === "https",
215663
+ secure: input.dev?.server?.secure ?? config.dev.local_protocol === "https",
215529
215664
  httpsKeyPath: input.dev?.server?.httpsKeyPath,
215530
215665
  httpsCertPath: input.dev?.server?.httpsCertPath
215531
215666
  },
@@ -215533,7 +215668,7 @@ async function resolveDevConfig(config, input) {
215533
215668
  port: input.dev?.inspector?.port ?? config.dev.inspector_port ?? await getInspectorPort()
215534
215669
  },
215535
215670
  origin: {
215536
- secure: input.dev?.origin?.secure || config.dev.upstream_protocol === "https",
215671
+ secure: input.dev?.origin?.secure ?? config.dev.upstream_protocol === "https",
215537
215672
  hostname: host ?? getInferredHost(routes)
215538
215673
  },
215539
215674
  liveReload: input.dev?.liveReload || false,
@@ -215587,7 +215722,7 @@ async function resolveTriggers(config, input) {
215587
215722
  routes: input.triggers?.filter(
215588
215723
  (t3) => t3.type === "route"
215589
215724
  ),
215590
- assets: input?.assets?.directory
215725
+ assets: input?.assets
215591
215726
  },
215592
215727
  config
215593
215728
  );
@@ -215621,7 +215756,7 @@ async function resolveConfig(config, input) {
215621
215756
  // getEntry only needs to know if assets was specified.
215622
215757
  // The actualy value is not relevant here, which is why not passing
215623
215758
  // the entire Assets object is fine.
215624
- assets: input?.assets?.directory
215759
+ assets: input?.assets
215625
215760
  },
215626
215761
  config,
215627
215762
  "dev"
@@ -215630,7 +215765,7 @@ async function resolveConfig(config, input) {
215630
215765
  const { bindings, unsafe } = await resolveBindings(config, input);
215631
215766
  const assetsOptions = processAssetsArg(
215632
215767
  {
215633
- assets: input?.assets?.directory,
215768
+ assets: input?.assets,
215634
215769
  script: input.entrypoint
215635
215770
  },
215636
215771
  config
@@ -215680,9 +215815,15 @@ async function resolveConfig(config, input) {
215680
215815
  };
215681
215816
  if (resolved.legacy.legacyAssets && resolved.legacy.site) {
215682
215817
  throw new UserError(
215683
- "Cannot use Assets and Workers Sites in the same Worker."
215818
+ "Cannot use legacy assets and Workers Sites in the same Worker."
215819
+ );
215820
+ }
215821
+ if (resolved.assets && resolved.dev.remote) {
215822
+ throw new UserError(
215823
+ "Cannot use assets in remote mode. Workers with assets are only supported in local mode. Please use `wrangler dev`."
215684
215824
  );
215685
215825
  }
215826
+ validateAssetsArgsAndConfig(resolved);
215686
215827
  const services = extractBindingsOfType("service", resolved.bindings);
215687
215828
  if (services && services.length > 0) {
215688
215829
  logger.warn(
@@ -215713,7 +215854,6 @@ var ConfigController = class extends Controller {
215713
215854
  latestInput;
215714
215855
  latestConfig;
215715
215856
  #configWatcher;
215716
- #assetsWatcher;
215717
215857
  #abortController;
215718
215858
  async #ensureWatchingConfig(configPath) {
215719
215859
  await this.#configWatcher?.close();
@@ -215731,25 +215871,8 @@ var ConfigController = class extends Controller {
215731
215871
  });
215732
215872
  }
215733
215873
  }
215734
- async #ensureWatchingAssets(assetsPath) {
215735
- await this.#assetsWatcher?.close();
215736
- if (assetsPath) {
215737
- this.#assetsWatcher = (0, import_chokidar8.watch)(assetsPath, {
215738
- persistent: true,
215739
- ignoreInitial: true
215740
- }).on("all", async (eventName, filePath) => {
215741
- const message = getAssetChangeMessage(eventName, filePath);
215742
- logger.log(`\u{1F300} ${message}...`);
215743
- (0, import_node_assert25.default)(
215744
- this.latestInput,
215745
- "Cannot be watching config without having first set an input"
215746
- );
215747
- void this.#updateConfig(this.latestInput);
215748
- });
215749
- }
215750
- }
215751
- set(input) {
215752
- return this.#updateConfig(input);
215874
+ set(input, throwErrors = false) {
215875
+ return this.#updateConfig(input, throwErrors);
215753
215876
  }
215754
215877
  patch(input) {
215755
215878
  (0, import_node_assert25.default)(
@@ -215762,7 +215885,7 @@ var ConfigController = class extends Controller {
215762
215885
  };
215763
215886
  return this.#updateConfig(config);
215764
215887
  }
215765
- async #updateConfig(input) {
215888
+ async #updateConfig(input, throwErrors = false) {
215766
215889
  this.#abortController?.abort();
215767
215890
  this.#abortController = new AbortController();
215768
215891
  const signal = this.#abortController.signal;
@@ -215776,13 +215899,8 @@ var ConfigController = class extends Controller {
215776
215899
  upstreamProtocol: input.dev?.origin?.secure === void 0 ? void 0 : input.dev?.origin?.secure ? "https" : "http",
215777
215900
  localProtocol: input.dev?.server?.secure === void 0 ? void 0 : input.dev?.server?.secure ? "https" : "http"
215778
215901
  });
215779
- void this.#ensureWatchingConfig(fileConfig.configPath);
215780
- const assets = processAssetsArg(
215781
- { assets: input?.assets?.directory },
215782
- fileConfig
215783
- );
215784
- if (assets) {
215785
- void this.#ensureWatchingAssets(assets.directory);
215902
+ if (typeof vitest === "undefined") {
215903
+ void this.#ensureWatchingConfig(fileConfig.configPath);
215786
215904
  }
215787
215905
  const resolvedConfig = await resolveConfig(fileConfig, input);
215788
215906
  if (signal.aborted) {
@@ -215792,7 +215910,17 @@ var ConfigController = class extends Controller {
215792
215910
  this.emitConfigUpdateEvent(resolvedConfig);
215793
215911
  return this.latestConfig;
215794
215912
  } catch (err) {
215795
- logger.error(err);
215913
+ if (throwErrors) {
215914
+ throw err;
215915
+ } else {
215916
+ this.emitErrorEvent({
215917
+ type: "error",
215918
+ reason: "Error resolving config",
215919
+ cause: castErrorCause(err),
215920
+ source: "ConfigController",
215921
+ data: void 0
215922
+ });
215923
+ }
215796
215924
  }
215797
215925
  }
215798
215926
  // ******************
@@ -215800,10 +215928,7 @@ var ConfigController = class extends Controller {
215800
215928
  // ******************
215801
215929
  async teardown() {
215802
215930
  logger.debug("ConfigController teardown beginning...");
215803
- await Promise.allSettled([
215804
- this.#configWatcher?.close(),
215805
- this.#assetsWatcher?.close()
215806
- ]);
215931
+ await this.#configWatcher?.close();
215807
215932
  logger.debug("ConfigController teardown complete");
215808
215933
  }
215809
215934
  // *********************
@@ -216538,7 +216663,8 @@ var RemoteRuntimeController = class extends RuntimeController {
216538
216663
  env: props.env,
216539
216664
  legacyEnv: props.legacyEnv,
216540
216665
  host: props.host,
216541
- routes: props.routes
216666
+ routes: props.routes,
216667
+ sendMetrics: props.sendMetrics
216542
216668
  }
216543
216669
  );
216544
216670
  if (!this.#session) {
@@ -216593,7 +216719,8 @@ var RemoteRuntimeController = class extends RuntimeController {
216593
216719
  legacyEnv: !config.legacy?.enableServiceEnvironments,
216594
216720
  // wrangler environment -- just pass it through for now
216595
216721
  host: config.dev.origin?.hostname,
216596
- routes
216722
+ routes,
216723
+ sendMetrics: config.sendMetrics
216597
216724
  });
216598
216725
  const bindings = (await convertBindingsToCfWorkerInitBindings(config.bindings)).bindings;
216599
216726
  const token = await this.#previewToken({
@@ -216615,7 +216742,9 @@ var RemoteRuntimeController = class extends RuntimeController {
216615
216742
  bindings,
216616
216743
  compatibilityDate: config.compatibilityDate,
216617
216744
  compatibilityFlags: config.compatibilityFlags,
216618
- routes
216745
+ routes,
216746
+ host: config.dev.origin?.hostname,
216747
+ sendMetrics: config.sendMetrics
216619
216748
  });
216620
216749
  if (id !== this.#currentBundleId || !token) {
216621
216750
  return;
@@ -216734,7 +216863,7 @@ var DevEnv = class extends import_node_events6.EventEmitter {
216734
216863
  controller.on("error", (event) => this.emitErrorEvent(event));
216735
216864
  });
216736
216865
  this.on("error", (event) => {
216737
- logger.error(`Error in ${event.source}: ${event.reason}
216866
+ logger.debug(`Error in ${event.source}: ${event.reason}
216738
216867
  `, event.cause);
216739
216868
  logger.debug("=> Error contextual data:", event.data);
216740
216869
  });
@@ -216808,6 +216937,8 @@ var DevEnv = class extends import_node_events6.EventEmitter {
216808
216937
  logger.debug(`Error in ${ev.source}: ${ev.reason}
216809
216938
  `, ev.cause);
216810
216939
  logger.debug("=> Error contextual data:", ev.data);
216940
+ } else if (ev.source === "ConfigController" && ev.cause instanceof ParseError) {
216941
+ logger.log(formatMessage(ev.cause));
216811
216942
  } else {
216812
216943
  this.emit("error", ev);
216813
216944
  }