@qwen-code/qwen-code 0.16.2 → 0.17.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.
Files changed (73) hide show
  1. package/bundled/qc-helper/docs/configuration/settings.md +5 -1
  2. package/bundled/qc-helper/docs/features/channels/_meta.ts +1 -0
  3. package/bundled/qc-helper/docs/features/channels/feishu.md +170 -0
  4. package/chunks/{agent-RY5EB3XR.js → agent-KVXFGIOU.js} +17 -12
  5. package/chunks/{anthropicContentGenerator-LYI3OHBB.js → anthropicContentGenerator-L4HWAOIV.js} +5 -5
  6. package/chunks/{askUserQuestion-R3MKD2JT.js → askUserQuestion-DC6OWQIL.js} +5 -3
  7. package/chunks/chunk-24YKA2DA.js +233 -0
  8. package/chunks/{chunk-UFC57OYT.js → chunk-33RDTIU6.js} +5 -3
  9. package/chunks/{chunk-C6WMLUNB.js → chunk-3BJBCG2K.js} +1 -1
  10. package/chunks/chunk-3HX5LZ6R.js +1798 -0
  11. package/chunks/{chunk-GQXXO5HJ.js → chunk-4O2TWJK4.js} +25 -5
  12. package/chunks/{chunk-RDYWTWEM.js → chunk-5IFG2VC4.js} +299 -232
  13. package/chunks/chunk-6RQTH7UQ.js +115 -0
  14. package/chunks/{chunk-7HM6OB7M.js → chunk-7EHPK6TK.js} +1336 -5164
  15. package/chunks/{chunk-PJLEMR7N.js → chunk-7NNBQRV7.js} +6 -6
  16. package/chunks/{chunk-K5PGHDBN.js → chunk-AKBFRR6J.js} +112 -132
  17. package/chunks/{chunk-C27V5A2J.js → chunk-EMVEDSVZ.js} +1 -1
  18. package/chunks/{chunk-TXQI3VZ7.js → chunk-GJHMAWS7.js} +1 -1
  19. package/chunks/{chunk-K72FHBFO.js → chunk-HAQCNXSG.js} +1 -0
  20. package/chunks/{chunk-T4VD6OJ4.js → chunk-HCSJIOLR.js} +1 -1
  21. package/chunks/chunk-J37FGIOA.js +1623 -0
  22. package/chunks/chunk-J5VCSWPA.js +1467 -0
  23. package/chunks/{chunk-UE5LPQF7.js → chunk-JI7FDD65.js} +7 -7
  24. package/chunks/{chunk-4YNZFYJY.js → chunk-MEN6IEKX.js} +2533 -3943
  25. package/chunks/{chunk-USE2VQ5P.js → chunk-NP3ICQCN.js} +1 -1
  26. package/chunks/{chunk-66CJCYYZ.js → chunk-QEXSIXLX.js} +1 -1
  27. package/chunks/{chunk-YMDXEEOW.js → chunk-R2B65CAN.js} +1 -82
  28. package/chunks/chunk-SZOEIL6S.js +35 -0
  29. package/chunks/chunk-TI4GXJKO.js +4277 -0
  30. package/chunks/{chunk-E7E2MFYM.js → chunk-U2K6HDUJ.js} +434 -13
  31. package/chunks/{chunk-FO7BIVSR.js → chunk-UQRYJQBE.js} +5 -3
  32. package/chunks/{chunk-VMOWXTRC.js → chunk-V7LMZR76.js} +1 -1
  33. package/chunks/chunk-W57YDFU5.js +41 -0
  34. package/chunks/computer-use-2J5ZXEER.js +768 -0
  35. package/chunks/{contextCommand-DDGVLQSF.js → contextCommand-52NTEMCT.js} +19 -14
  36. package/chunks/{cron-create-BTEOGHPH.js → cron-create-FXRORK2U.js} +5 -3
  37. package/chunks/{cron-delete-56CEWELN.js → cron-delete-D24IN6CA.js} +5 -3
  38. package/chunks/{cron-list-SV6QRZW2.js → cron-list-SMOX26SL.js} +5 -3
  39. package/chunks/{devtools-WN62SQPV.js → devtools-IXE4UP72.js} +31 -3748
  40. package/chunks/{dist-MN2PDDPR.js → dist-6RUZ2JD6.js} +13 -1612
  41. package/chunks/{dist-R2SXPG74.js → dist-AHZNZWRI.js} +5 -4
  42. package/chunks/dist-GRQVFL3G.js +94147 -0
  43. package/chunks/{dist-BXDUQ2QY.js → dist-XTTPOFAH.js} +4 -3
  44. package/chunks/{edit-4LLGNYVZ.js → edit-RLFUTT5F.js} +20 -14
  45. package/chunks/{enter-worktree-E2R5XAFT.js → enter-worktree-CYRAPQKJ.js} +20 -14
  46. package/chunks/{exit-worktree-YVBYYYDD.js → exit-worktree-WQZM72QD.js} +20 -14
  47. package/chunks/{exitPlanMode-WD5IH7NS.js → exitPlanMode-STFEBQZE.js} +20 -14
  48. package/chunks/{geminiContentGenerator-LM65ADWM.js → geminiContentGenerator-DIV32SKO.js} +4 -3
  49. package/chunks/{glob-6X6OCEWE.js → glob-N3XO4RVI.js} +20 -14
  50. package/chunks/{grep-2UUPSSIQ.js → grep-AK5MP7P3.js} +20 -14
  51. package/chunks/{ls-MYXAM7LJ.js → ls-7FYQHPWF.js} +5 -3
  52. package/chunks/{lsp-PFGI35JL.js → lsp-DKG34USR.js} +5 -3
  53. package/chunks/{monitor-VUHPEGUW.js → monitor-IVBWJZEZ.js} +20 -14
  54. package/chunks/{notebook-edit-P4QVLW6I.js → notebook-edit-PM46AXFS.js} +21 -15
  55. package/chunks/{openaiContentGenerator-JH4YNZ3H.js → openaiContentGenerator-4QXCH7L2.js} +13 -10
  56. package/chunks/{qwenContentGenerator-5FE4UYUT.js → qwenContentGenerator-BLXQIIMX.js} +21 -16
  57. package/chunks/{read-file-J7DH4OKV.js → read-file-IEQAS3EZ.js} +10 -6
  58. package/chunks/{ripGrep-33DECY4F.js → ripGrep-HQO7IE4C.js} +17 -12
  59. package/chunks/{send-message-JUFP62VD.js → send-message-ZL7CDM7K.js} +5 -3
  60. package/chunks/{serve-7FX7MREA.js → serve-CYRAK4UM.js} +63 -1837
  61. package/chunks/{shell-ZNTQIRK6.js → shell-UZBGNO2Q.js} +17 -12
  62. package/chunks/{skill-CFCUIY23.js → skill-JVC34QYN.js} +24 -13
  63. package/chunks/{src-AHV2CWEQ.js → src-FOODLH7B.js} +49 -41
  64. package/chunks/{syntheticOutput-AKTXC6FR.js → syntheticOutput-U3YJ3GOO.js} +3 -2
  65. package/chunks/{task-stop-2NYFR2ES.js → task-stop-NPUI3YBA.js} +5 -3
  66. package/chunks/{todoWrite-WHZ2O2XP.js → todoWrite-Y6F7YEIM.js} +6 -4
  67. package/chunks/{tool-search-C2EMLFBJ.js → tool-search-P7PRPOW3.js} +13 -8
  68. package/chunks/{web-fetch-S6MZXPZ5.js → web-fetch-XWEK4TFX.js} +6 -4
  69. package/chunks/{write-file-EEPVRS4Q.js → write-file-SIIEUON5.js} +21 -15
  70. package/cli.js +412 -329
  71. package/package.json +2 -2
  72. package/chunks/chunk-JVD46YJV.js +0 -434
  73. package/chunks/undici-4ARNOH74.js +0 -8
@@ -0,0 +1,1623 @@
1
+ // Force strict mode and setup for ESM
2
+ "use strict";
3
+ import {
4
+ require_get_intrinsic,
5
+ require_mime_db,
6
+ require_shams,
7
+ require_type
8
+ } from "./chunk-7RYW5LQV.js";
9
+ import {
10
+ require_hasown
11
+ } from "./chunk-UWCTAVOD.js";
12
+ import {
13
+ require_src
14
+ } from "./chunk-QN5NZ3UQ.js";
15
+ import {
16
+ init_esbuild_shims
17
+ } from "./chunk-A4BMJM77.js";
18
+ import {
19
+ __commonJS,
20
+ __name,
21
+ __require
22
+ } from "./chunk-J2S4EL5Y.js";
23
+
24
+ // node_modules/delayed-stream/lib/delayed_stream.js
25
+ var require_delayed_stream = __commonJS({
26
+ "node_modules/delayed-stream/lib/delayed_stream.js"(exports, module) {
27
+ init_esbuild_shims();
28
+ var Stream = __require("stream").Stream;
29
+ var util = __require("util");
30
+ module.exports = DelayedStream;
31
+ function DelayedStream() {
32
+ this.source = null;
33
+ this.dataSize = 0;
34
+ this.maxDataSize = 1024 * 1024;
35
+ this.pauseStream = true;
36
+ this._maxDataSizeExceeded = false;
37
+ this._released = false;
38
+ this._bufferedEvents = [];
39
+ }
40
+ __name(DelayedStream, "DelayedStream");
41
+ util.inherits(DelayedStream, Stream);
42
+ DelayedStream.create = function(source, options) {
43
+ var delayedStream = new this();
44
+ options = options || {};
45
+ for (var option in options) {
46
+ delayedStream[option] = options[option];
47
+ }
48
+ delayedStream.source = source;
49
+ var realEmit = source.emit;
50
+ source.emit = function() {
51
+ delayedStream._handleEmit(arguments);
52
+ return realEmit.apply(source, arguments);
53
+ };
54
+ source.on("error", function() {
55
+ });
56
+ if (delayedStream.pauseStream) {
57
+ source.pause();
58
+ }
59
+ return delayedStream;
60
+ };
61
+ Object.defineProperty(DelayedStream.prototype, "readable", {
62
+ configurable: true,
63
+ enumerable: true,
64
+ get: /* @__PURE__ */ __name(function() {
65
+ return this.source.readable;
66
+ }, "get")
67
+ });
68
+ DelayedStream.prototype.setEncoding = function() {
69
+ return this.source.setEncoding.apply(this.source, arguments);
70
+ };
71
+ DelayedStream.prototype.resume = function() {
72
+ if (!this._released) {
73
+ this.release();
74
+ }
75
+ this.source.resume();
76
+ };
77
+ DelayedStream.prototype.pause = function() {
78
+ this.source.pause();
79
+ };
80
+ DelayedStream.prototype.release = function() {
81
+ this._released = true;
82
+ this._bufferedEvents.forEach(function(args) {
83
+ this.emit.apply(this, args);
84
+ }.bind(this));
85
+ this._bufferedEvents = [];
86
+ };
87
+ DelayedStream.prototype.pipe = function() {
88
+ var r = Stream.prototype.pipe.apply(this, arguments);
89
+ this.resume();
90
+ return r;
91
+ };
92
+ DelayedStream.prototype._handleEmit = function(args) {
93
+ if (this._released) {
94
+ this.emit.apply(this, args);
95
+ return;
96
+ }
97
+ if (args[0] === "data") {
98
+ this.dataSize += args[1].length;
99
+ this._checkIfMaxDataSizeExceeded();
100
+ }
101
+ this._bufferedEvents.push(args);
102
+ };
103
+ DelayedStream.prototype._checkIfMaxDataSizeExceeded = function() {
104
+ if (this._maxDataSizeExceeded) {
105
+ return;
106
+ }
107
+ if (this.dataSize <= this.maxDataSize) {
108
+ return;
109
+ }
110
+ this._maxDataSizeExceeded = true;
111
+ var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded.";
112
+ this.emit("error", new Error(message));
113
+ };
114
+ }
115
+ });
116
+
117
+ // node_modules/combined-stream/lib/combined_stream.js
118
+ var require_combined_stream = __commonJS({
119
+ "node_modules/combined-stream/lib/combined_stream.js"(exports, module) {
120
+ init_esbuild_shims();
121
+ var util = __require("util");
122
+ var Stream = __require("stream").Stream;
123
+ var DelayedStream = require_delayed_stream();
124
+ module.exports = CombinedStream;
125
+ function CombinedStream() {
126
+ this.writable = false;
127
+ this.readable = true;
128
+ this.dataSize = 0;
129
+ this.maxDataSize = 2 * 1024 * 1024;
130
+ this.pauseStreams = true;
131
+ this._released = false;
132
+ this._streams = [];
133
+ this._currentStream = null;
134
+ this._insideLoop = false;
135
+ this._pendingNext = false;
136
+ }
137
+ __name(CombinedStream, "CombinedStream");
138
+ util.inherits(CombinedStream, Stream);
139
+ CombinedStream.create = function(options) {
140
+ var combinedStream = new this();
141
+ options = options || {};
142
+ for (var option in options) {
143
+ combinedStream[option] = options[option];
144
+ }
145
+ return combinedStream;
146
+ };
147
+ CombinedStream.isStreamLike = function(stream) {
148
+ return typeof stream !== "function" && typeof stream !== "string" && typeof stream !== "boolean" && typeof stream !== "number" && !Buffer.isBuffer(stream);
149
+ };
150
+ CombinedStream.prototype.append = function(stream) {
151
+ var isStreamLike = CombinedStream.isStreamLike(stream);
152
+ if (isStreamLike) {
153
+ if (!(stream instanceof DelayedStream)) {
154
+ var newStream = DelayedStream.create(stream, {
155
+ maxDataSize: Infinity,
156
+ pauseStream: this.pauseStreams
157
+ });
158
+ stream.on("data", this._checkDataSize.bind(this));
159
+ stream = newStream;
160
+ }
161
+ this._handleErrors(stream);
162
+ if (this.pauseStreams) {
163
+ stream.pause();
164
+ }
165
+ }
166
+ this._streams.push(stream);
167
+ return this;
168
+ };
169
+ CombinedStream.prototype.pipe = function(dest, options) {
170
+ Stream.prototype.pipe.call(this, dest, options);
171
+ this.resume();
172
+ return dest;
173
+ };
174
+ CombinedStream.prototype._getNext = function() {
175
+ this._currentStream = null;
176
+ if (this._insideLoop) {
177
+ this._pendingNext = true;
178
+ return;
179
+ }
180
+ this._insideLoop = true;
181
+ try {
182
+ do {
183
+ this._pendingNext = false;
184
+ this._realGetNext();
185
+ } while (this._pendingNext);
186
+ } finally {
187
+ this._insideLoop = false;
188
+ }
189
+ };
190
+ CombinedStream.prototype._realGetNext = function() {
191
+ var stream = this._streams.shift();
192
+ if (typeof stream == "undefined") {
193
+ this.end();
194
+ return;
195
+ }
196
+ if (typeof stream !== "function") {
197
+ this._pipeNext(stream);
198
+ return;
199
+ }
200
+ var getStream = stream;
201
+ getStream(function(stream2) {
202
+ var isStreamLike = CombinedStream.isStreamLike(stream2);
203
+ if (isStreamLike) {
204
+ stream2.on("data", this._checkDataSize.bind(this));
205
+ this._handleErrors(stream2);
206
+ }
207
+ this._pipeNext(stream2);
208
+ }.bind(this));
209
+ };
210
+ CombinedStream.prototype._pipeNext = function(stream) {
211
+ this._currentStream = stream;
212
+ var isStreamLike = CombinedStream.isStreamLike(stream);
213
+ if (isStreamLike) {
214
+ stream.on("end", this._getNext.bind(this));
215
+ stream.pipe(this, { end: false });
216
+ return;
217
+ }
218
+ var value = stream;
219
+ this.write(value);
220
+ this._getNext();
221
+ };
222
+ CombinedStream.prototype._handleErrors = function(stream) {
223
+ var self = this;
224
+ stream.on("error", function(err) {
225
+ self._emitError(err);
226
+ });
227
+ };
228
+ CombinedStream.prototype.write = function(data) {
229
+ this.emit("data", data);
230
+ };
231
+ CombinedStream.prototype.pause = function() {
232
+ if (!this.pauseStreams) {
233
+ return;
234
+ }
235
+ if (this.pauseStreams && this._currentStream && typeof this._currentStream.pause == "function") this._currentStream.pause();
236
+ this.emit("pause");
237
+ };
238
+ CombinedStream.prototype.resume = function() {
239
+ if (!this._released) {
240
+ this._released = true;
241
+ this.writable = true;
242
+ this._getNext();
243
+ }
244
+ if (this.pauseStreams && this._currentStream && typeof this._currentStream.resume == "function") this._currentStream.resume();
245
+ this.emit("resume");
246
+ };
247
+ CombinedStream.prototype.end = function() {
248
+ this._reset();
249
+ this.emit("end");
250
+ };
251
+ CombinedStream.prototype.destroy = function() {
252
+ this._reset();
253
+ this.emit("close");
254
+ };
255
+ CombinedStream.prototype._reset = function() {
256
+ this.writable = false;
257
+ this._streams = [];
258
+ this._currentStream = null;
259
+ };
260
+ CombinedStream.prototype._checkDataSize = function() {
261
+ this._updateDataSize();
262
+ if (this.dataSize <= this.maxDataSize) {
263
+ return;
264
+ }
265
+ var message = "DelayedStream#maxDataSize of " + this.maxDataSize + " bytes exceeded.";
266
+ this._emitError(new Error(message));
267
+ };
268
+ CombinedStream.prototype._updateDataSize = function() {
269
+ this.dataSize = 0;
270
+ var self = this;
271
+ this._streams.forEach(function(stream) {
272
+ if (!stream.dataSize) {
273
+ return;
274
+ }
275
+ self.dataSize += stream.dataSize;
276
+ });
277
+ if (this._currentStream && this._currentStream.dataSize) {
278
+ this.dataSize += this._currentStream.dataSize;
279
+ }
280
+ };
281
+ CombinedStream.prototype._emitError = function(err) {
282
+ this._reset();
283
+ this.emit("error", err);
284
+ };
285
+ }
286
+ });
287
+
288
+ // node_modules/form-data/node_modules/mime-types/index.js
289
+ var require_mime_types = __commonJS({
290
+ "node_modules/form-data/node_modules/mime-types/index.js"(exports) {
291
+ "use strict";
292
+ init_esbuild_shims();
293
+ var db = require_mime_db();
294
+ var extname = __require("path").extname;
295
+ var EXTRACT_TYPE_REGEXP = /^\s*([^;\s]*)(?:;|\s|$)/;
296
+ var TEXT_TYPE_REGEXP = /^text\//i;
297
+ exports.charset = charset;
298
+ exports.charsets = { lookup: charset };
299
+ exports.contentType = contentType;
300
+ exports.extension = extension;
301
+ exports.extensions = /* @__PURE__ */ Object.create(null);
302
+ exports.lookup = lookup;
303
+ exports.types = /* @__PURE__ */ Object.create(null);
304
+ populateMaps(exports.extensions, exports.types);
305
+ function charset(type) {
306
+ if (!type || typeof type !== "string") {
307
+ return false;
308
+ }
309
+ var match = EXTRACT_TYPE_REGEXP.exec(type);
310
+ var mime = match && db[match[1].toLowerCase()];
311
+ if (mime && mime.charset) {
312
+ return mime.charset;
313
+ }
314
+ if (match && TEXT_TYPE_REGEXP.test(match[1])) {
315
+ return "UTF-8";
316
+ }
317
+ return false;
318
+ }
319
+ __name(charset, "charset");
320
+ function contentType(str) {
321
+ if (!str || typeof str !== "string") {
322
+ return false;
323
+ }
324
+ var mime = str.indexOf("/") === -1 ? exports.lookup(str) : str;
325
+ if (!mime) {
326
+ return false;
327
+ }
328
+ if (mime.indexOf("charset") === -1) {
329
+ var charset2 = exports.charset(mime);
330
+ if (charset2) mime += "; charset=" + charset2.toLowerCase();
331
+ }
332
+ return mime;
333
+ }
334
+ __name(contentType, "contentType");
335
+ function extension(type) {
336
+ if (!type || typeof type !== "string") {
337
+ return false;
338
+ }
339
+ var match = EXTRACT_TYPE_REGEXP.exec(type);
340
+ var exts = match && exports.extensions[match[1].toLowerCase()];
341
+ if (!exts || !exts.length) {
342
+ return false;
343
+ }
344
+ return exts[0];
345
+ }
346
+ __name(extension, "extension");
347
+ function lookup(path) {
348
+ if (!path || typeof path !== "string") {
349
+ return false;
350
+ }
351
+ var extension2 = extname("x." + path).toLowerCase().substr(1);
352
+ if (!extension2) {
353
+ return false;
354
+ }
355
+ return exports.types[extension2] || false;
356
+ }
357
+ __name(lookup, "lookup");
358
+ function populateMaps(extensions, types) {
359
+ var preference = ["nginx", "apache", void 0, "iana"];
360
+ Object.keys(db).forEach(/* @__PURE__ */ __name(function forEachMimeType(type) {
361
+ var mime = db[type];
362
+ var exts = mime.extensions;
363
+ if (!exts || !exts.length) {
364
+ return;
365
+ }
366
+ extensions[type] = exts;
367
+ for (var i = 0; i < exts.length; i++) {
368
+ var extension2 = exts[i];
369
+ if (types[extension2]) {
370
+ var from = preference.indexOf(db[types[extension2]].source);
371
+ var to = preference.indexOf(mime.source);
372
+ if (types[extension2] !== "application/octet-stream" && (from > to || from === to && types[extension2].substr(0, 12) === "application/")) {
373
+ continue;
374
+ }
375
+ }
376
+ types[extension2] = type;
377
+ }
378
+ }, "forEachMimeType"));
379
+ }
380
+ __name(populateMaps, "populateMaps");
381
+ }
382
+ });
383
+
384
+ // node_modules/asynckit/lib/defer.js
385
+ var require_defer = __commonJS({
386
+ "node_modules/asynckit/lib/defer.js"(exports, module) {
387
+ init_esbuild_shims();
388
+ module.exports = defer;
389
+ function defer(fn) {
390
+ var nextTick = typeof setImmediate == "function" ? setImmediate : typeof process == "object" && typeof process.nextTick == "function" ? process.nextTick : null;
391
+ if (nextTick) {
392
+ nextTick(fn);
393
+ } else {
394
+ setTimeout(fn, 0);
395
+ }
396
+ }
397
+ __name(defer, "defer");
398
+ }
399
+ });
400
+
401
+ // node_modules/asynckit/lib/async.js
402
+ var require_async = __commonJS({
403
+ "node_modules/asynckit/lib/async.js"(exports, module) {
404
+ init_esbuild_shims();
405
+ var defer = require_defer();
406
+ module.exports = async;
407
+ function async(callback) {
408
+ var isAsync = false;
409
+ defer(function() {
410
+ isAsync = true;
411
+ });
412
+ return /* @__PURE__ */ __name(function async_callback(err, result) {
413
+ if (isAsync) {
414
+ callback(err, result);
415
+ } else {
416
+ defer(/* @__PURE__ */ __name(function nextTick_callback() {
417
+ callback(err, result);
418
+ }, "nextTick_callback"));
419
+ }
420
+ }, "async_callback");
421
+ }
422
+ __name(async, "async");
423
+ }
424
+ });
425
+
426
+ // node_modules/asynckit/lib/abort.js
427
+ var require_abort = __commonJS({
428
+ "node_modules/asynckit/lib/abort.js"(exports, module) {
429
+ init_esbuild_shims();
430
+ module.exports = abort;
431
+ function abort(state) {
432
+ Object.keys(state.jobs).forEach(clean.bind(state));
433
+ state.jobs = {};
434
+ }
435
+ __name(abort, "abort");
436
+ function clean(key) {
437
+ if (typeof this.jobs[key] == "function") {
438
+ this.jobs[key]();
439
+ }
440
+ }
441
+ __name(clean, "clean");
442
+ }
443
+ });
444
+
445
+ // node_modules/asynckit/lib/iterate.js
446
+ var require_iterate = __commonJS({
447
+ "node_modules/asynckit/lib/iterate.js"(exports, module) {
448
+ init_esbuild_shims();
449
+ var async = require_async();
450
+ var abort = require_abort();
451
+ module.exports = iterate;
452
+ function iterate(list, iterator, state, callback) {
453
+ var key = state["keyedList"] ? state["keyedList"][state.index] : state.index;
454
+ state.jobs[key] = runJob(iterator, key, list[key], function(error, output) {
455
+ if (!(key in state.jobs)) {
456
+ return;
457
+ }
458
+ delete state.jobs[key];
459
+ if (error) {
460
+ abort(state);
461
+ } else {
462
+ state.results[key] = output;
463
+ }
464
+ callback(error, state.results);
465
+ });
466
+ }
467
+ __name(iterate, "iterate");
468
+ function runJob(iterator, key, item, callback) {
469
+ var aborter;
470
+ if (iterator.length == 2) {
471
+ aborter = iterator(item, async(callback));
472
+ } else {
473
+ aborter = iterator(item, key, async(callback));
474
+ }
475
+ return aborter;
476
+ }
477
+ __name(runJob, "runJob");
478
+ }
479
+ });
480
+
481
+ // node_modules/asynckit/lib/state.js
482
+ var require_state = __commonJS({
483
+ "node_modules/asynckit/lib/state.js"(exports, module) {
484
+ init_esbuild_shims();
485
+ module.exports = state;
486
+ function state(list, sortMethod) {
487
+ var isNamedList = !Array.isArray(list), initState = {
488
+ index: 0,
489
+ keyedList: isNamedList || sortMethod ? Object.keys(list) : null,
490
+ jobs: {},
491
+ results: isNamedList ? {} : [],
492
+ size: isNamedList ? Object.keys(list).length : list.length
493
+ };
494
+ if (sortMethod) {
495
+ initState.keyedList.sort(isNamedList ? sortMethod : function(a, b) {
496
+ return sortMethod(list[a], list[b]);
497
+ });
498
+ }
499
+ return initState;
500
+ }
501
+ __name(state, "state");
502
+ }
503
+ });
504
+
505
+ // node_modules/asynckit/lib/terminator.js
506
+ var require_terminator = __commonJS({
507
+ "node_modules/asynckit/lib/terminator.js"(exports, module) {
508
+ init_esbuild_shims();
509
+ var abort = require_abort();
510
+ var async = require_async();
511
+ module.exports = terminator;
512
+ function terminator(callback) {
513
+ if (!Object.keys(this.jobs).length) {
514
+ return;
515
+ }
516
+ this.index = this.size;
517
+ abort(this);
518
+ async(callback)(null, this.results);
519
+ }
520
+ __name(terminator, "terminator");
521
+ }
522
+ });
523
+
524
+ // node_modules/asynckit/parallel.js
525
+ var require_parallel = __commonJS({
526
+ "node_modules/asynckit/parallel.js"(exports, module) {
527
+ init_esbuild_shims();
528
+ var iterate = require_iterate();
529
+ var initState = require_state();
530
+ var terminator = require_terminator();
531
+ module.exports = parallel;
532
+ function parallel(list, iterator, callback) {
533
+ var state = initState(list);
534
+ while (state.index < (state["keyedList"] || list).length) {
535
+ iterate(list, iterator, state, function(error, result) {
536
+ if (error) {
537
+ callback(error, result);
538
+ return;
539
+ }
540
+ if (Object.keys(state.jobs).length === 0) {
541
+ callback(null, state.results);
542
+ return;
543
+ }
544
+ });
545
+ state.index++;
546
+ }
547
+ return terminator.bind(state, callback);
548
+ }
549
+ __name(parallel, "parallel");
550
+ }
551
+ });
552
+
553
+ // node_modules/asynckit/serialOrdered.js
554
+ var require_serialOrdered = __commonJS({
555
+ "node_modules/asynckit/serialOrdered.js"(exports, module) {
556
+ init_esbuild_shims();
557
+ var iterate = require_iterate();
558
+ var initState = require_state();
559
+ var terminator = require_terminator();
560
+ module.exports = serialOrdered;
561
+ module.exports.ascending = ascending;
562
+ module.exports.descending = descending;
563
+ function serialOrdered(list, iterator, sortMethod, callback) {
564
+ var state = initState(list, sortMethod);
565
+ iterate(list, iterator, state, /* @__PURE__ */ __name(function iteratorHandler(error, result) {
566
+ if (error) {
567
+ callback(error, result);
568
+ return;
569
+ }
570
+ state.index++;
571
+ if (state.index < (state["keyedList"] || list).length) {
572
+ iterate(list, iterator, state, iteratorHandler);
573
+ return;
574
+ }
575
+ callback(null, state.results);
576
+ }, "iteratorHandler"));
577
+ return terminator.bind(state, callback);
578
+ }
579
+ __name(serialOrdered, "serialOrdered");
580
+ function ascending(a, b) {
581
+ return a < b ? -1 : a > b ? 1 : 0;
582
+ }
583
+ __name(ascending, "ascending");
584
+ function descending(a, b) {
585
+ return -1 * ascending(a, b);
586
+ }
587
+ __name(descending, "descending");
588
+ }
589
+ });
590
+
591
+ // node_modules/asynckit/serial.js
592
+ var require_serial = __commonJS({
593
+ "node_modules/asynckit/serial.js"(exports, module) {
594
+ init_esbuild_shims();
595
+ var serialOrdered = require_serialOrdered();
596
+ module.exports = serial;
597
+ function serial(list, iterator, callback) {
598
+ return serialOrdered(list, iterator, null, callback);
599
+ }
600
+ __name(serial, "serial");
601
+ }
602
+ });
603
+
604
+ // node_modules/asynckit/index.js
605
+ var require_asynckit = __commonJS({
606
+ "node_modules/asynckit/index.js"(exports, module) {
607
+ init_esbuild_shims();
608
+ module.exports = {
609
+ parallel: require_parallel(),
610
+ serial: require_serial(),
611
+ serialOrdered: require_serialOrdered()
612
+ };
613
+ }
614
+ });
615
+
616
+ // node_modules/has-tostringtag/shams.js
617
+ var require_shams2 = __commonJS({
618
+ "node_modules/has-tostringtag/shams.js"(exports, module) {
619
+ "use strict";
620
+ init_esbuild_shims();
621
+ var hasSymbols = require_shams();
622
+ module.exports = /* @__PURE__ */ __name(function hasToStringTagShams() {
623
+ return hasSymbols() && !!Symbol.toStringTag;
624
+ }, "hasToStringTagShams");
625
+ }
626
+ });
627
+
628
+ // node_modules/es-set-tostringtag/index.js
629
+ var require_es_set_tostringtag = __commonJS({
630
+ "node_modules/es-set-tostringtag/index.js"(exports, module) {
631
+ "use strict";
632
+ init_esbuild_shims();
633
+ var GetIntrinsic = require_get_intrinsic();
634
+ var $defineProperty = GetIntrinsic("%Object.defineProperty%", true);
635
+ var hasToStringTag = require_shams2()();
636
+ var hasOwn = require_hasown();
637
+ var $TypeError = require_type();
638
+ var toStringTag = hasToStringTag ? Symbol.toStringTag : null;
639
+ module.exports = /* @__PURE__ */ __name(function setToStringTag(object, value) {
640
+ var overrideIfSet = arguments.length > 2 && !!arguments[2] && arguments[2].force;
641
+ var nonConfigurable = arguments.length > 2 && !!arguments[2] && arguments[2].nonConfigurable;
642
+ if (typeof overrideIfSet !== "undefined" && typeof overrideIfSet !== "boolean" || typeof nonConfigurable !== "undefined" && typeof nonConfigurable !== "boolean") {
643
+ throw new $TypeError("if provided, the `overrideIfSet` and `nonConfigurable` options must be booleans");
644
+ }
645
+ if (toStringTag && (overrideIfSet || !hasOwn(object, toStringTag))) {
646
+ if ($defineProperty) {
647
+ $defineProperty(object, toStringTag, {
648
+ configurable: !nonConfigurable,
649
+ enumerable: false,
650
+ value,
651
+ writable: false
652
+ });
653
+ } else {
654
+ object[toStringTag] = value;
655
+ }
656
+ }
657
+ }, "setToStringTag");
658
+ }
659
+ });
660
+
661
+ // node_modules/form-data/lib/populate.js
662
+ var require_populate = __commonJS({
663
+ "node_modules/form-data/lib/populate.js"(exports, module) {
664
+ "use strict";
665
+ init_esbuild_shims();
666
+ module.exports = function(dst, src) {
667
+ Object.keys(src).forEach(function(prop) {
668
+ dst[prop] = dst[prop] || src[prop];
669
+ });
670
+ return dst;
671
+ };
672
+ }
673
+ });
674
+
675
+ // node_modules/form-data/lib/form_data.js
676
+ var require_form_data = __commonJS({
677
+ "node_modules/form-data/lib/form_data.js"(exports, module) {
678
+ "use strict";
679
+ init_esbuild_shims();
680
+ var CombinedStream = require_combined_stream();
681
+ var util = __require("util");
682
+ var path = __require("path");
683
+ var http = __require("http");
684
+ var https = __require("https");
685
+ var parseUrl = __require("url").parse;
686
+ var fs = __require("fs");
687
+ var Stream = __require("stream").Stream;
688
+ var crypto = __require("crypto");
689
+ var mime = require_mime_types();
690
+ var asynckit = require_asynckit();
691
+ var setToStringTag = require_es_set_tostringtag();
692
+ var hasOwn = require_hasown();
693
+ var populate = require_populate();
694
+ function FormData(options) {
695
+ if (!(this instanceof FormData)) {
696
+ return new FormData(options);
697
+ }
698
+ this._overheadLength = 0;
699
+ this._valueLength = 0;
700
+ this._valuesToMeasure = [];
701
+ CombinedStream.call(this);
702
+ options = options || {};
703
+ for (var option in options) {
704
+ this[option] = options[option];
705
+ }
706
+ }
707
+ __name(FormData, "FormData");
708
+ util.inherits(FormData, CombinedStream);
709
+ FormData.LINE_BREAK = "\r\n";
710
+ FormData.DEFAULT_CONTENT_TYPE = "application/octet-stream";
711
+ FormData.prototype.append = function(field, value, options) {
712
+ options = options || {};
713
+ if (typeof options === "string") {
714
+ options = { filename: options };
715
+ }
716
+ var append = CombinedStream.prototype.append.bind(this);
717
+ if (typeof value === "number" || value == null) {
718
+ value = String(value);
719
+ }
720
+ if (Array.isArray(value)) {
721
+ this._error(new Error("Arrays are not supported."));
722
+ return;
723
+ }
724
+ var header = this._multiPartHeader(field, value, options);
725
+ var footer = this._multiPartFooter();
726
+ append(header);
727
+ append(value);
728
+ append(footer);
729
+ this._trackLength(header, value, options);
730
+ };
731
+ FormData.prototype._trackLength = function(header, value, options) {
732
+ var valueLength = 0;
733
+ if (options.knownLength != null) {
734
+ valueLength += Number(options.knownLength);
735
+ } else if (Buffer.isBuffer(value)) {
736
+ valueLength = value.length;
737
+ } else if (typeof value === "string") {
738
+ valueLength = Buffer.byteLength(value);
739
+ }
740
+ this._valueLength += valueLength;
741
+ this._overheadLength += Buffer.byteLength(header) + FormData.LINE_BREAK.length;
742
+ if (!value || !value.path && !(value.readable && hasOwn(value, "httpVersion")) && !(value instanceof Stream)) {
743
+ return;
744
+ }
745
+ if (!options.knownLength) {
746
+ this._valuesToMeasure.push(value);
747
+ }
748
+ };
749
+ FormData.prototype._lengthRetriever = function(value, callback) {
750
+ if (hasOwn(value, "fd")) {
751
+ if (value.end != void 0 && value.end != Infinity && value.start != void 0) {
752
+ callback(null, value.end + 1 - (value.start ? value.start : 0));
753
+ } else {
754
+ fs.stat(value.path, function(err, stat) {
755
+ if (err) {
756
+ callback(err);
757
+ return;
758
+ }
759
+ var fileSize = stat.size - (value.start ? value.start : 0);
760
+ callback(null, fileSize);
761
+ });
762
+ }
763
+ } else if (hasOwn(value, "httpVersion")) {
764
+ callback(null, Number(value.headers["content-length"]));
765
+ } else if (hasOwn(value, "httpModule")) {
766
+ value.on("response", function(response) {
767
+ value.pause();
768
+ callback(null, Number(response.headers["content-length"]));
769
+ });
770
+ value.resume();
771
+ } else {
772
+ callback("Unknown stream");
773
+ }
774
+ };
775
+ FormData.prototype._multiPartHeader = function(field, value, options) {
776
+ if (typeof options.header === "string") {
777
+ return options.header;
778
+ }
779
+ var contentDisposition = this._getContentDisposition(value, options);
780
+ var contentType = this._getContentType(value, options);
781
+ var contents = "";
782
+ var headers = {
783
+ // add custom disposition as third element or keep it two elements if not
784
+ "Content-Disposition": ["form-data", 'name="' + field + '"'].concat(contentDisposition || []),
785
+ // if no content type. allow it to be empty array
786
+ "Content-Type": [].concat(contentType || [])
787
+ };
788
+ if (typeof options.header === "object") {
789
+ populate(headers, options.header);
790
+ }
791
+ var header;
792
+ for (var prop in headers) {
793
+ if (hasOwn(headers, prop)) {
794
+ header = headers[prop];
795
+ if (header == null) {
796
+ continue;
797
+ }
798
+ if (!Array.isArray(header)) {
799
+ header = [header];
800
+ }
801
+ if (header.length) {
802
+ contents += prop + ": " + header.join("; ") + FormData.LINE_BREAK;
803
+ }
804
+ }
805
+ }
806
+ return "--" + this.getBoundary() + FormData.LINE_BREAK + contents + FormData.LINE_BREAK;
807
+ };
808
+ FormData.prototype._getContentDisposition = function(value, options) {
809
+ var filename;
810
+ if (typeof options.filepath === "string") {
811
+ filename = path.normalize(options.filepath).replace(/\\/g, "/");
812
+ } else if (options.filename || value && (value.name || value.path)) {
813
+ filename = path.basename(options.filename || value && (value.name || value.path));
814
+ } else if (value && value.readable && hasOwn(value, "httpVersion")) {
815
+ filename = path.basename(value.client._httpMessage.path || "");
816
+ }
817
+ if (filename) {
818
+ return 'filename="' + filename + '"';
819
+ }
820
+ };
821
+ FormData.prototype._getContentType = function(value, options) {
822
+ var contentType = options.contentType;
823
+ if (!contentType && value && value.name) {
824
+ contentType = mime.lookup(value.name);
825
+ }
826
+ if (!contentType && value && value.path) {
827
+ contentType = mime.lookup(value.path);
828
+ }
829
+ if (!contentType && value && value.readable && hasOwn(value, "httpVersion")) {
830
+ contentType = value.headers["content-type"];
831
+ }
832
+ if (!contentType && (options.filepath || options.filename)) {
833
+ contentType = mime.lookup(options.filepath || options.filename);
834
+ }
835
+ if (!contentType && value && typeof value === "object") {
836
+ contentType = FormData.DEFAULT_CONTENT_TYPE;
837
+ }
838
+ return contentType;
839
+ };
840
+ FormData.prototype._multiPartFooter = function() {
841
+ return function(next) {
842
+ var footer = FormData.LINE_BREAK;
843
+ var lastPart = this._streams.length === 0;
844
+ if (lastPart) {
845
+ footer += this._lastBoundary();
846
+ }
847
+ next(footer);
848
+ }.bind(this);
849
+ };
850
+ FormData.prototype._lastBoundary = function() {
851
+ return "--" + this.getBoundary() + "--" + FormData.LINE_BREAK;
852
+ };
853
+ FormData.prototype.getHeaders = function(userHeaders) {
854
+ var header;
855
+ var formHeaders = {
856
+ "content-type": "multipart/form-data; boundary=" + this.getBoundary()
857
+ };
858
+ for (header in userHeaders) {
859
+ if (hasOwn(userHeaders, header)) {
860
+ formHeaders[header.toLowerCase()] = userHeaders[header];
861
+ }
862
+ }
863
+ return formHeaders;
864
+ };
865
+ FormData.prototype.setBoundary = function(boundary) {
866
+ if (typeof boundary !== "string") {
867
+ throw new TypeError("FormData boundary must be a string");
868
+ }
869
+ this._boundary = boundary;
870
+ };
871
+ FormData.prototype.getBoundary = function() {
872
+ if (!this._boundary) {
873
+ this._generateBoundary();
874
+ }
875
+ return this._boundary;
876
+ };
877
+ FormData.prototype.getBuffer = function() {
878
+ var dataBuffer = new Buffer.alloc(0);
879
+ var boundary = this.getBoundary();
880
+ for (var i = 0, len = this._streams.length; i < len; i++) {
881
+ if (typeof this._streams[i] !== "function") {
882
+ if (Buffer.isBuffer(this._streams[i])) {
883
+ dataBuffer = Buffer.concat([dataBuffer, this._streams[i]]);
884
+ } else {
885
+ dataBuffer = Buffer.concat([dataBuffer, Buffer.from(this._streams[i])]);
886
+ }
887
+ if (typeof this._streams[i] !== "string" || this._streams[i].substring(2, boundary.length + 2) !== boundary) {
888
+ dataBuffer = Buffer.concat([dataBuffer, Buffer.from(FormData.LINE_BREAK)]);
889
+ }
890
+ }
891
+ }
892
+ return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
893
+ };
894
+ FormData.prototype._generateBoundary = function() {
895
+ this._boundary = "--------------------------" + crypto.randomBytes(12).toString("hex");
896
+ };
897
+ FormData.prototype.getLengthSync = function() {
898
+ var knownLength = this._overheadLength + this._valueLength;
899
+ if (this._streams.length) {
900
+ knownLength += this._lastBoundary().length;
901
+ }
902
+ if (!this.hasKnownLength()) {
903
+ this._error(new Error("Cannot calculate proper length in synchronous way."));
904
+ }
905
+ return knownLength;
906
+ };
907
+ FormData.prototype.hasKnownLength = function() {
908
+ var hasKnownLength = true;
909
+ if (this._valuesToMeasure.length) {
910
+ hasKnownLength = false;
911
+ }
912
+ return hasKnownLength;
913
+ };
914
+ FormData.prototype.getLength = function(cb) {
915
+ var knownLength = this._overheadLength + this._valueLength;
916
+ if (this._streams.length) {
917
+ knownLength += this._lastBoundary().length;
918
+ }
919
+ if (!this._valuesToMeasure.length) {
920
+ process.nextTick(cb.bind(this, null, knownLength));
921
+ return;
922
+ }
923
+ asynckit.parallel(this._valuesToMeasure, this._lengthRetriever, function(err, values) {
924
+ if (err) {
925
+ cb(err);
926
+ return;
927
+ }
928
+ values.forEach(function(length) {
929
+ knownLength += length;
930
+ });
931
+ cb(null, knownLength);
932
+ });
933
+ };
934
+ FormData.prototype.submit = function(params, cb) {
935
+ var request;
936
+ var options;
937
+ var defaults = { method: "post" };
938
+ if (typeof params === "string") {
939
+ params = parseUrl(params);
940
+ options = populate({
941
+ port: params.port,
942
+ path: params.pathname,
943
+ host: params.hostname,
944
+ protocol: params.protocol
945
+ }, defaults);
946
+ } else {
947
+ options = populate(params, defaults);
948
+ if (!options.port) {
949
+ options.port = options.protocol === "https:" ? 443 : 80;
950
+ }
951
+ }
952
+ options.headers = this.getHeaders(params.headers);
953
+ if (options.protocol === "https:") {
954
+ request = https.request(options);
955
+ } else {
956
+ request = http.request(options);
957
+ }
958
+ this.getLength(function(err, length) {
959
+ if (err && err !== "Unknown stream") {
960
+ this._error(err);
961
+ return;
962
+ }
963
+ if (length) {
964
+ request.setHeader("Content-Length", length);
965
+ }
966
+ this.pipe(request);
967
+ if (cb) {
968
+ var onResponse;
969
+ var callback = /* @__PURE__ */ __name(function(error, responce) {
970
+ request.removeListener("error", callback);
971
+ request.removeListener("response", onResponse);
972
+ return cb.call(this, error, responce);
973
+ }, "callback");
974
+ onResponse = callback.bind(this, null);
975
+ request.on("error", callback);
976
+ request.on("response", onResponse);
977
+ }
978
+ }.bind(this));
979
+ return request;
980
+ };
981
+ FormData.prototype._error = function(err) {
982
+ if (!this.error) {
983
+ this.error = err;
984
+ this.pause();
985
+ this.emit("error", err);
986
+ }
987
+ };
988
+ FormData.prototype.toString = function() {
989
+ return "[object FormData]";
990
+ };
991
+ setToStringTag(FormData.prototype, "FormData");
992
+ module.exports = FormData;
993
+ }
994
+ });
995
+
996
+ // node_modules/proxy-from-env/index.js
997
+ var require_proxy_from_env = __commonJS({
998
+ "node_modules/proxy-from-env/index.js"(exports) {
999
+ "use strict";
1000
+ init_esbuild_shims();
1001
+ var parseUrl = __require("url").parse;
1002
+ var DEFAULT_PORTS = {
1003
+ ftp: 21,
1004
+ gopher: 70,
1005
+ http: 80,
1006
+ https: 443,
1007
+ ws: 80,
1008
+ wss: 443
1009
+ };
1010
+ var stringEndsWith = String.prototype.endsWith || function(s) {
1011
+ return s.length <= this.length && this.indexOf(s, this.length - s.length) !== -1;
1012
+ };
1013
+ function getProxyForUrl(url) {
1014
+ var parsedUrl = typeof url === "string" ? parseUrl(url) : url || {};
1015
+ var proto = parsedUrl.protocol;
1016
+ var hostname = parsedUrl.host;
1017
+ var port = parsedUrl.port;
1018
+ if (typeof hostname !== "string" || !hostname || typeof proto !== "string") {
1019
+ return "";
1020
+ }
1021
+ proto = proto.split(":", 1)[0];
1022
+ hostname = hostname.replace(/:\d*$/, "");
1023
+ port = parseInt(port) || DEFAULT_PORTS[proto] || 0;
1024
+ if (!shouldProxy(hostname, port)) {
1025
+ return "";
1026
+ }
1027
+ var proxy = getEnv("npm_config_" + proto + "_proxy") || getEnv(proto + "_proxy") || getEnv("npm_config_proxy") || getEnv("all_proxy");
1028
+ if (proxy && proxy.indexOf("://") === -1) {
1029
+ proxy = proto + "://" + proxy;
1030
+ }
1031
+ return proxy;
1032
+ }
1033
+ __name(getProxyForUrl, "getProxyForUrl");
1034
+ function shouldProxy(hostname, port) {
1035
+ var NO_PROXY = (getEnv("npm_config_no_proxy") || getEnv("no_proxy")).toLowerCase();
1036
+ if (!NO_PROXY) {
1037
+ return true;
1038
+ }
1039
+ if (NO_PROXY === "*") {
1040
+ return false;
1041
+ }
1042
+ return NO_PROXY.split(/[,\s]/).every(function(proxy) {
1043
+ if (!proxy) {
1044
+ return true;
1045
+ }
1046
+ var parsedProxy = proxy.match(/^(.+):(\d+)$/);
1047
+ var parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy;
1048
+ var parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0;
1049
+ if (parsedProxyPort && parsedProxyPort !== port) {
1050
+ return true;
1051
+ }
1052
+ if (!/^[.*]/.test(parsedProxyHostname)) {
1053
+ return hostname !== parsedProxyHostname;
1054
+ }
1055
+ if (parsedProxyHostname.charAt(0) === "*") {
1056
+ parsedProxyHostname = parsedProxyHostname.slice(1);
1057
+ }
1058
+ return !stringEndsWith.call(hostname, parsedProxyHostname);
1059
+ });
1060
+ }
1061
+ __name(shouldProxy, "shouldProxy");
1062
+ function getEnv(key) {
1063
+ return process.env[key.toLowerCase()] || process.env[key.toUpperCase()] || "";
1064
+ }
1065
+ __name(getEnv, "getEnv");
1066
+ exports.getProxyForUrl = getProxyForUrl;
1067
+ }
1068
+ });
1069
+
1070
+ // node_modules/follow-redirects/debug.js
1071
+ var require_debug = __commonJS({
1072
+ "node_modules/follow-redirects/debug.js"(exports, module) {
1073
+ init_esbuild_shims();
1074
+ var debug;
1075
+ module.exports = function() {
1076
+ if (!debug) {
1077
+ try {
1078
+ debug = require_src()("follow-redirects");
1079
+ } catch (error) {
1080
+ }
1081
+ if (typeof debug !== "function") {
1082
+ debug = /* @__PURE__ */ __name(function() {
1083
+ }, "debug");
1084
+ }
1085
+ }
1086
+ debug.apply(null, arguments);
1087
+ };
1088
+ }
1089
+ });
1090
+
1091
+ // node_modules/follow-redirects/index.js
1092
+ var require_follow_redirects = __commonJS({
1093
+ "node_modules/follow-redirects/index.js"(exports, module) {
1094
+ init_esbuild_shims();
1095
+ var url = __require("url");
1096
+ var URL = url.URL;
1097
+ var http = __require("http");
1098
+ var https = __require("https");
1099
+ var Writable = __require("stream").Writable;
1100
+ var assert = __require("assert");
1101
+ var debug = require_debug();
1102
+ (/* @__PURE__ */ __name(function detectUnsupportedEnvironment() {
1103
+ var looksLikeNode = typeof process !== "undefined";
1104
+ var looksLikeBrowser = typeof window !== "undefined" && typeof document !== "undefined";
1105
+ var looksLikeV8 = isFunction(Error.captureStackTrace);
1106
+ if (!looksLikeNode && (looksLikeBrowser || !looksLikeV8)) {
1107
+ console.warn("The follow-redirects package should be excluded from browser builds.");
1108
+ }
1109
+ }, "detectUnsupportedEnvironment"))();
1110
+ var useNativeURL = false;
1111
+ try {
1112
+ assert(new URL(""));
1113
+ } catch (error) {
1114
+ useNativeURL = error.code === "ERR_INVALID_URL";
1115
+ }
1116
+ var preservedUrlFields = [
1117
+ "auth",
1118
+ "host",
1119
+ "hostname",
1120
+ "href",
1121
+ "path",
1122
+ "pathname",
1123
+ "port",
1124
+ "protocol",
1125
+ "query",
1126
+ "search",
1127
+ "hash"
1128
+ ];
1129
+ var events = ["abort", "aborted", "connect", "error", "socket", "timeout"];
1130
+ var eventHandlers = /* @__PURE__ */ Object.create(null);
1131
+ events.forEach(function(event) {
1132
+ eventHandlers[event] = function(arg1, arg2, arg3) {
1133
+ this._redirectable.emit(event, arg1, arg2, arg3);
1134
+ };
1135
+ });
1136
+ var InvalidUrlError = createErrorType(
1137
+ "ERR_INVALID_URL",
1138
+ "Invalid URL",
1139
+ TypeError
1140
+ );
1141
+ var RedirectionError = createErrorType(
1142
+ "ERR_FR_REDIRECTION_FAILURE",
1143
+ "Redirected request failed"
1144
+ );
1145
+ var TooManyRedirectsError = createErrorType(
1146
+ "ERR_FR_TOO_MANY_REDIRECTS",
1147
+ "Maximum number of redirects exceeded",
1148
+ RedirectionError
1149
+ );
1150
+ var MaxBodyLengthExceededError = createErrorType(
1151
+ "ERR_FR_MAX_BODY_LENGTH_EXCEEDED",
1152
+ "Request body larger than maxBodyLength limit"
1153
+ );
1154
+ var WriteAfterEndError = createErrorType(
1155
+ "ERR_STREAM_WRITE_AFTER_END",
1156
+ "write after end"
1157
+ );
1158
+ var destroy = Writable.prototype.destroy || noop;
1159
+ function RedirectableRequest(options, responseCallback) {
1160
+ Writable.call(this);
1161
+ this._sanitizeOptions(options);
1162
+ this._options = options;
1163
+ this._ended = false;
1164
+ this._ending = false;
1165
+ this._redirectCount = 0;
1166
+ this._redirects = [];
1167
+ this._requestBodyLength = 0;
1168
+ this._requestBodyBuffers = [];
1169
+ if (responseCallback) {
1170
+ this.on("response", responseCallback);
1171
+ }
1172
+ var self = this;
1173
+ this._onNativeResponse = function(response) {
1174
+ try {
1175
+ self._processResponse(response);
1176
+ } catch (cause) {
1177
+ self.emit("error", cause instanceof RedirectionError ? cause : new RedirectionError({ cause }));
1178
+ }
1179
+ };
1180
+ this._performRequest();
1181
+ }
1182
+ __name(RedirectableRequest, "RedirectableRequest");
1183
+ RedirectableRequest.prototype = Object.create(Writable.prototype);
1184
+ RedirectableRequest.prototype.abort = function() {
1185
+ destroyRequest(this._currentRequest);
1186
+ this._currentRequest.abort();
1187
+ this.emit("abort");
1188
+ };
1189
+ RedirectableRequest.prototype.destroy = function(error) {
1190
+ destroyRequest(this._currentRequest, error);
1191
+ destroy.call(this, error);
1192
+ return this;
1193
+ };
1194
+ RedirectableRequest.prototype.write = function(data, encoding, callback) {
1195
+ if (this._ending) {
1196
+ throw new WriteAfterEndError();
1197
+ }
1198
+ if (!isString(data) && !isBuffer(data)) {
1199
+ throw new TypeError("data should be a string, Buffer or Uint8Array");
1200
+ }
1201
+ if (isFunction(encoding)) {
1202
+ callback = encoding;
1203
+ encoding = null;
1204
+ }
1205
+ if (data.length === 0) {
1206
+ if (callback) {
1207
+ callback();
1208
+ }
1209
+ return;
1210
+ }
1211
+ if (this._requestBodyLength + data.length <= this._options.maxBodyLength) {
1212
+ this._requestBodyLength += data.length;
1213
+ this._requestBodyBuffers.push({ data, encoding });
1214
+ this._currentRequest.write(data, encoding, callback);
1215
+ } else {
1216
+ this.emit("error", new MaxBodyLengthExceededError());
1217
+ this.abort();
1218
+ }
1219
+ };
1220
+ RedirectableRequest.prototype.end = function(data, encoding, callback) {
1221
+ if (isFunction(data)) {
1222
+ callback = data;
1223
+ data = encoding = null;
1224
+ } else if (isFunction(encoding)) {
1225
+ callback = encoding;
1226
+ encoding = null;
1227
+ }
1228
+ if (!data) {
1229
+ this._ended = this._ending = true;
1230
+ this._currentRequest.end(null, null, callback);
1231
+ } else {
1232
+ var self = this;
1233
+ var currentRequest = this._currentRequest;
1234
+ this.write(data, encoding, function() {
1235
+ self._ended = true;
1236
+ currentRequest.end(null, null, callback);
1237
+ });
1238
+ this._ending = true;
1239
+ }
1240
+ };
1241
+ RedirectableRequest.prototype.setHeader = function(name, value) {
1242
+ this._options.headers[name] = value;
1243
+ this._currentRequest.setHeader(name, value);
1244
+ };
1245
+ RedirectableRequest.prototype.removeHeader = function(name) {
1246
+ delete this._options.headers[name];
1247
+ this._currentRequest.removeHeader(name);
1248
+ };
1249
+ RedirectableRequest.prototype.setTimeout = function(msecs, callback) {
1250
+ var self = this;
1251
+ function destroyOnTimeout(socket) {
1252
+ socket.setTimeout(msecs);
1253
+ socket.removeListener("timeout", socket.destroy);
1254
+ socket.addListener("timeout", socket.destroy);
1255
+ }
1256
+ __name(destroyOnTimeout, "destroyOnTimeout");
1257
+ function startTimer(socket) {
1258
+ if (self._timeout) {
1259
+ clearTimeout(self._timeout);
1260
+ }
1261
+ self._timeout = setTimeout(function() {
1262
+ self.emit("timeout");
1263
+ clearTimer();
1264
+ }, msecs);
1265
+ destroyOnTimeout(socket);
1266
+ }
1267
+ __name(startTimer, "startTimer");
1268
+ function clearTimer() {
1269
+ if (self._timeout) {
1270
+ clearTimeout(self._timeout);
1271
+ self._timeout = null;
1272
+ }
1273
+ self.removeListener("abort", clearTimer);
1274
+ self.removeListener("error", clearTimer);
1275
+ self.removeListener("response", clearTimer);
1276
+ self.removeListener("close", clearTimer);
1277
+ if (callback) {
1278
+ self.removeListener("timeout", callback);
1279
+ }
1280
+ if (!self.socket) {
1281
+ self._currentRequest.removeListener("socket", startTimer);
1282
+ }
1283
+ }
1284
+ __name(clearTimer, "clearTimer");
1285
+ if (callback) {
1286
+ this.on("timeout", callback);
1287
+ }
1288
+ if (this.socket) {
1289
+ startTimer(this.socket);
1290
+ } else {
1291
+ this._currentRequest.once("socket", startTimer);
1292
+ }
1293
+ this.on("socket", destroyOnTimeout);
1294
+ this.on("abort", clearTimer);
1295
+ this.on("error", clearTimer);
1296
+ this.on("response", clearTimer);
1297
+ this.on("close", clearTimer);
1298
+ return this;
1299
+ };
1300
+ [
1301
+ "flushHeaders",
1302
+ "getHeader",
1303
+ "setNoDelay",
1304
+ "setSocketKeepAlive"
1305
+ ].forEach(function(method) {
1306
+ RedirectableRequest.prototype[method] = function(a, b) {
1307
+ return this._currentRequest[method](a, b);
1308
+ };
1309
+ });
1310
+ ["aborted", "connection", "socket"].forEach(function(property) {
1311
+ Object.defineProperty(RedirectableRequest.prototype, property, {
1312
+ get: /* @__PURE__ */ __name(function() {
1313
+ return this._currentRequest[property];
1314
+ }, "get")
1315
+ });
1316
+ });
1317
+ RedirectableRequest.prototype._sanitizeOptions = function(options) {
1318
+ if (!options.headers) {
1319
+ options.headers = {};
1320
+ }
1321
+ if (options.host) {
1322
+ if (!options.hostname) {
1323
+ options.hostname = options.host;
1324
+ }
1325
+ delete options.host;
1326
+ }
1327
+ if (!options.pathname && options.path) {
1328
+ var searchPos = options.path.indexOf("?");
1329
+ if (searchPos < 0) {
1330
+ options.pathname = options.path;
1331
+ } else {
1332
+ options.pathname = options.path.substring(0, searchPos);
1333
+ options.search = options.path.substring(searchPos);
1334
+ }
1335
+ }
1336
+ };
1337
+ RedirectableRequest.prototype._performRequest = function() {
1338
+ var protocol = this._options.protocol;
1339
+ var nativeProtocol = this._options.nativeProtocols[protocol];
1340
+ if (!nativeProtocol) {
1341
+ throw new TypeError("Unsupported protocol " + protocol);
1342
+ }
1343
+ if (this._options.agents) {
1344
+ var scheme = protocol.slice(0, -1);
1345
+ this._options.agent = this._options.agents[scheme];
1346
+ }
1347
+ var request = this._currentRequest = nativeProtocol.request(this._options, this._onNativeResponse);
1348
+ request._redirectable = this;
1349
+ for (var event of events) {
1350
+ request.on(event, eventHandlers[event]);
1351
+ }
1352
+ this._currentUrl = /^\//.test(this._options.path) ? url.format(this._options) : (
1353
+ // When making a request to a proxy, […]
1354
+ // a client MUST send the target URI in absolute-form […].
1355
+ this._options.path
1356
+ );
1357
+ if (this._isRedirect) {
1358
+ var i = 0;
1359
+ var self = this;
1360
+ var buffers = this._requestBodyBuffers;
1361
+ (/* @__PURE__ */ __name(function writeNext(error) {
1362
+ if (request === self._currentRequest) {
1363
+ if (error) {
1364
+ self.emit("error", error);
1365
+ } else if (i < buffers.length) {
1366
+ var buffer = buffers[i++];
1367
+ if (!request.finished) {
1368
+ request.write(buffer.data, buffer.encoding, writeNext);
1369
+ }
1370
+ } else if (self._ended) {
1371
+ request.end();
1372
+ }
1373
+ }
1374
+ }, "writeNext"))();
1375
+ }
1376
+ };
1377
+ RedirectableRequest.prototype._processResponse = function(response) {
1378
+ var statusCode = response.statusCode;
1379
+ if (this._options.trackRedirects) {
1380
+ this._redirects.push({
1381
+ url: this._currentUrl,
1382
+ headers: response.headers,
1383
+ statusCode
1384
+ });
1385
+ }
1386
+ var location = response.headers.location;
1387
+ if (!location || this._options.followRedirects === false || statusCode < 300 || statusCode >= 400) {
1388
+ response.responseUrl = this._currentUrl;
1389
+ response.redirects = this._redirects;
1390
+ this.emit("response", response);
1391
+ this._requestBodyBuffers = [];
1392
+ return;
1393
+ }
1394
+ destroyRequest(this._currentRequest);
1395
+ response.destroy();
1396
+ if (++this._redirectCount > this._options.maxRedirects) {
1397
+ throw new TooManyRedirectsError();
1398
+ }
1399
+ var requestHeaders;
1400
+ var beforeRedirect = this._options.beforeRedirect;
1401
+ if (beforeRedirect) {
1402
+ requestHeaders = Object.assign({
1403
+ // The Host header was set by nativeProtocol.request
1404
+ Host: response.req.getHeader("host")
1405
+ }, this._options.headers);
1406
+ }
1407
+ var method = this._options.method;
1408
+ if ((statusCode === 301 || statusCode === 302) && this._options.method === "POST" || // RFC7231§6.4.4: The 303 (See Other) status code indicates that
1409
+ // the server is redirecting the user agent to a different resource […]
1410
+ // A user agent can perform a retrieval request targeting that URI
1411
+ // (a GET or HEAD request if using HTTP) […]
1412
+ statusCode === 303 && !/^(?:GET|HEAD)$/.test(this._options.method)) {
1413
+ this._options.method = "GET";
1414
+ this._requestBodyBuffers = [];
1415
+ removeMatchingHeaders(/^content-/i, this._options.headers);
1416
+ }
1417
+ var currentHostHeader = removeMatchingHeaders(/^host$/i, this._options.headers);
1418
+ var currentUrlParts = parseUrl(this._currentUrl);
1419
+ var currentHost = currentHostHeader || currentUrlParts.host;
1420
+ var currentUrl = /^\w+:/.test(location) ? this._currentUrl : url.format(Object.assign(currentUrlParts, { host: currentHost }));
1421
+ var redirectUrl = resolveUrl(location, currentUrl);
1422
+ debug("redirecting to", redirectUrl.href);
1423
+ this._isRedirect = true;
1424
+ spreadUrlObject(redirectUrl, this._options);
1425
+ if (redirectUrl.protocol !== currentUrlParts.protocol && redirectUrl.protocol !== "https:" || redirectUrl.host !== currentHost && !isSubdomain(redirectUrl.host, currentHost)) {
1426
+ removeMatchingHeaders(/^(?:(?:proxy-)?authorization|cookie)$/i, this._options.headers);
1427
+ }
1428
+ if (isFunction(beforeRedirect)) {
1429
+ var responseDetails = {
1430
+ headers: response.headers,
1431
+ statusCode
1432
+ };
1433
+ var requestDetails = {
1434
+ url: currentUrl,
1435
+ method,
1436
+ headers: requestHeaders
1437
+ };
1438
+ beforeRedirect(this._options, responseDetails, requestDetails);
1439
+ this._sanitizeOptions(this._options);
1440
+ }
1441
+ this._performRequest();
1442
+ };
1443
+ function wrap(protocols) {
1444
+ var exports2 = {
1445
+ maxRedirects: 21,
1446
+ maxBodyLength: 10 * 1024 * 1024
1447
+ };
1448
+ var nativeProtocols = {};
1449
+ Object.keys(protocols).forEach(function(scheme) {
1450
+ var protocol = scheme + ":";
1451
+ var nativeProtocol = nativeProtocols[protocol] = protocols[scheme];
1452
+ var wrappedProtocol = exports2[scheme] = Object.create(nativeProtocol);
1453
+ function request(input, options, callback) {
1454
+ if (isURL(input)) {
1455
+ input = spreadUrlObject(input);
1456
+ } else if (isString(input)) {
1457
+ input = spreadUrlObject(parseUrl(input));
1458
+ } else {
1459
+ callback = options;
1460
+ options = validateUrl(input);
1461
+ input = { protocol };
1462
+ }
1463
+ if (isFunction(options)) {
1464
+ callback = options;
1465
+ options = null;
1466
+ }
1467
+ options = Object.assign({
1468
+ maxRedirects: exports2.maxRedirects,
1469
+ maxBodyLength: exports2.maxBodyLength
1470
+ }, input, options);
1471
+ options.nativeProtocols = nativeProtocols;
1472
+ if (!isString(options.host) && !isString(options.hostname)) {
1473
+ options.hostname = "::1";
1474
+ }
1475
+ assert.equal(options.protocol, protocol, "protocol mismatch");
1476
+ debug("options", options);
1477
+ return new RedirectableRequest(options, callback);
1478
+ }
1479
+ __name(request, "request");
1480
+ function get(input, options, callback) {
1481
+ var wrappedRequest = wrappedProtocol.request(input, options, callback);
1482
+ wrappedRequest.end();
1483
+ return wrappedRequest;
1484
+ }
1485
+ __name(get, "get");
1486
+ Object.defineProperties(wrappedProtocol, {
1487
+ request: { value: request, configurable: true, enumerable: true, writable: true },
1488
+ get: { value: get, configurable: true, enumerable: true, writable: true }
1489
+ });
1490
+ });
1491
+ return exports2;
1492
+ }
1493
+ __name(wrap, "wrap");
1494
+ function noop() {
1495
+ }
1496
+ __name(noop, "noop");
1497
+ function parseUrl(input) {
1498
+ var parsed;
1499
+ if (useNativeURL) {
1500
+ parsed = new URL(input);
1501
+ } else {
1502
+ parsed = validateUrl(url.parse(input));
1503
+ if (!isString(parsed.protocol)) {
1504
+ throw new InvalidUrlError({ input });
1505
+ }
1506
+ }
1507
+ return parsed;
1508
+ }
1509
+ __name(parseUrl, "parseUrl");
1510
+ function resolveUrl(relative, base) {
1511
+ return useNativeURL ? new URL(relative, base) : parseUrl(url.resolve(base, relative));
1512
+ }
1513
+ __name(resolveUrl, "resolveUrl");
1514
+ function validateUrl(input) {
1515
+ if (/^\[/.test(input.hostname) && !/^\[[:0-9a-f]+\]$/i.test(input.hostname)) {
1516
+ throw new InvalidUrlError({ input: input.href || input });
1517
+ }
1518
+ if (/^\[/.test(input.host) && !/^\[[:0-9a-f]+\](:\d+)?$/i.test(input.host)) {
1519
+ throw new InvalidUrlError({ input: input.href || input });
1520
+ }
1521
+ return input;
1522
+ }
1523
+ __name(validateUrl, "validateUrl");
1524
+ function spreadUrlObject(urlObject, target) {
1525
+ var spread = target || {};
1526
+ for (var key of preservedUrlFields) {
1527
+ spread[key] = urlObject[key];
1528
+ }
1529
+ if (spread.hostname.startsWith("[")) {
1530
+ spread.hostname = spread.hostname.slice(1, -1);
1531
+ }
1532
+ if (spread.port !== "") {
1533
+ spread.port = Number(spread.port);
1534
+ }
1535
+ spread.path = spread.search ? spread.pathname + spread.search : spread.pathname;
1536
+ return spread;
1537
+ }
1538
+ __name(spreadUrlObject, "spreadUrlObject");
1539
+ function removeMatchingHeaders(regex, headers) {
1540
+ var lastValue;
1541
+ for (var header in headers) {
1542
+ if (regex.test(header)) {
1543
+ lastValue = headers[header];
1544
+ delete headers[header];
1545
+ }
1546
+ }
1547
+ return lastValue === null || typeof lastValue === "undefined" ? void 0 : String(lastValue).trim();
1548
+ }
1549
+ __name(removeMatchingHeaders, "removeMatchingHeaders");
1550
+ function createErrorType(code, message, baseClass) {
1551
+ function CustomError(properties) {
1552
+ if (isFunction(Error.captureStackTrace)) {
1553
+ Error.captureStackTrace(this, this.constructor);
1554
+ }
1555
+ Object.assign(this, properties || {});
1556
+ this.code = code;
1557
+ this.message = this.cause ? message + ": " + this.cause.message : message;
1558
+ }
1559
+ __name(CustomError, "CustomError");
1560
+ CustomError.prototype = new (baseClass || Error)();
1561
+ Object.defineProperties(CustomError.prototype, {
1562
+ constructor: {
1563
+ value: CustomError,
1564
+ enumerable: false
1565
+ },
1566
+ name: {
1567
+ value: "Error [" + code + "]",
1568
+ enumerable: false
1569
+ }
1570
+ });
1571
+ return CustomError;
1572
+ }
1573
+ __name(createErrorType, "createErrorType");
1574
+ function destroyRequest(request, error) {
1575
+ for (var event of events) {
1576
+ request.removeListener(event, eventHandlers[event]);
1577
+ }
1578
+ request.on("error", noop);
1579
+ request.destroy(error);
1580
+ }
1581
+ __name(destroyRequest, "destroyRequest");
1582
+ function isSubdomain(subdomain, domain) {
1583
+ assert(isString(subdomain) && isString(domain));
1584
+ var dot = subdomain.length - domain.length - 1;
1585
+ return dot > 0 && subdomain[dot] === "." && subdomain.endsWith(domain);
1586
+ }
1587
+ __name(isSubdomain, "isSubdomain");
1588
+ function isString(value) {
1589
+ return typeof value === "string" || value instanceof String;
1590
+ }
1591
+ __name(isString, "isString");
1592
+ function isFunction(value) {
1593
+ return typeof value === "function";
1594
+ }
1595
+ __name(isFunction, "isFunction");
1596
+ function isBuffer(value) {
1597
+ return typeof value === "object" && "length" in value;
1598
+ }
1599
+ __name(isBuffer, "isBuffer");
1600
+ function isURL(value) {
1601
+ return URL && value instanceof URL;
1602
+ }
1603
+ __name(isURL, "isURL");
1604
+ module.exports = wrap({ http, https });
1605
+ module.exports.wrap = wrap;
1606
+ }
1607
+ });
1608
+
1609
+ export {
1610
+ require_form_data,
1611
+ require_proxy_from_env,
1612
+ require_follow_redirects
1613
+ };
1614
+ /*! Bundled license information:
1615
+
1616
+ mime-types/index.js:
1617
+ (*!
1618
+ * mime-types
1619
+ * Copyright(c) 2014 Jonathan Ong
1620
+ * Copyright(c) 2015 Douglas Christopher Wilson
1621
+ * MIT Licensed
1622
+ *)
1623
+ */