@cenk1cenk2/oclif-common 6.3.28 → 6.3.30

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.
@@ -0,0 +1,2435 @@
1
+ import { __commonJS, __require } from "./chunk-DzC9Nte8.js";
2
+
3
+ //#region ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js
4
+ var require_base64 = __commonJS({ "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64.js"(exports) {
5
+ var intToCharMap = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");
6
+ /**
7
+ * Encode an integer in the range of 0 to 63 to a single base 64 digit.
8
+ */
9
+ exports.encode = function(number) {
10
+ if (0 <= number && number < intToCharMap.length) return intToCharMap[number];
11
+ throw new TypeError("Must be between 0 and 63: " + number);
12
+ };
13
+ /**
14
+ * Decode a single base 64 character code digit to an integer. Returns -1 on
15
+ * failure.
16
+ */
17
+ exports.decode = function(charCode) {
18
+ var bigA = 65;
19
+ var bigZ = 90;
20
+ var littleA = 97;
21
+ var littleZ = 122;
22
+ var zero = 48;
23
+ var nine = 57;
24
+ var plus = 43;
25
+ var slash = 47;
26
+ var littleOffset = 26;
27
+ var numberOffset = 52;
28
+ if (bigA <= charCode && charCode <= bigZ) return charCode - bigA;
29
+ if (littleA <= charCode && charCode <= littleZ) return charCode - littleA + littleOffset;
30
+ if (zero <= charCode && charCode <= nine) return charCode - zero + numberOffset;
31
+ if (charCode == plus) return 62;
32
+ if (charCode == slash) return 63;
33
+ return -1;
34
+ };
35
+ } });
36
+
37
+ //#endregion
38
+ //#region ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js
39
+ var require_base64_vlq = __commonJS({ "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/base64-vlq.js"(exports) {
40
+ var base64 = require_base64();
41
+ var VLQ_BASE_SHIFT = 5;
42
+ var VLQ_BASE = 1 << VLQ_BASE_SHIFT;
43
+ var VLQ_BASE_MASK = VLQ_BASE - 1;
44
+ var VLQ_CONTINUATION_BIT = VLQ_BASE;
45
+ /**
46
+ * Converts from a two-complement value to a value where the sign bit is
47
+ * placed in the least significant bit. For example, as decimals:
48
+ * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
49
+ * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
50
+ */
51
+ function toVLQSigned(aValue) {
52
+ return aValue < 0 ? (-aValue << 1) + 1 : (aValue << 1) + 0;
53
+ }
54
+ /**
55
+ * Converts to a two-complement value from a value where the sign bit is
56
+ * placed in the least significant bit. For example, as decimals:
57
+ * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1
58
+ * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2
59
+ */
60
+ function fromVLQSigned(aValue) {
61
+ var isNegative = (aValue & 1) === 1;
62
+ var shifted = aValue >> 1;
63
+ return isNegative ? -shifted : shifted;
64
+ }
65
+ /**
66
+ * Returns the base 64 VLQ encoded value.
67
+ */
68
+ exports.encode = function base64VLQ_encode(aValue) {
69
+ var encoded = "";
70
+ var digit;
71
+ var vlq = toVLQSigned(aValue);
72
+ do {
73
+ digit = vlq & VLQ_BASE_MASK;
74
+ vlq >>>= VLQ_BASE_SHIFT;
75
+ if (vlq > 0) digit |= VLQ_CONTINUATION_BIT;
76
+ encoded += base64.encode(digit);
77
+ } while (vlq > 0);
78
+ return encoded;
79
+ };
80
+ /**
81
+ * Decodes the next base 64 VLQ value from the given string and returns the
82
+ * value and the rest of the string via the out parameter.
83
+ */
84
+ exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
85
+ var strLen = aStr.length;
86
+ var result = 0;
87
+ var shift = 0;
88
+ var continuation, digit;
89
+ do {
90
+ if (aIndex >= strLen) throw new Error("Expected more digits in base 64 VLQ value.");
91
+ digit = base64.decode(aStr.charCodeAt(aIndex++));
92
+ if (digit === -1) throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
93
+ continuation = !!(digit & VLQ_CONTINUATION_BIT);
94
+ digit &= VLQ_BASE_MASK;
95
+ result = result + (digit << shift);
96
+ shift += VLQ_BASE_SHIFT;
97
+ } while (continuation);
98
+ aOutParam.value = fromVLQSigned(result);
99
+ aOutParam.rest = aIndex;
100
+ };
101
+ } });
102
+
103
+ //#endregion
104
+ //#region ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js
105
+ var require_util = __commonJS({ "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/util.js"(exports) {
106
+ /**
107
+ * This is a helper function for getting values from parameter/options
108
+ * objects.
109
+ *
110
+ * @param args The object we are extracting values from
111
+ * @param name The name of the property we are getting.
112
+ * @param defaultValue An optional value to return if the property is missing
113
+ * from the object. If this is not specified and the property is missing, an
114
+ * error will be thrown.
115
+ */
116
+ function getArg(aArgs, aName, aDefaultValue) {
117
+ if (aName in aArgs) return aArgs[aName];
118
+ else if (arguments.length === 3) return aDefaultValue;
119
+ else throw new Error("\"" + aName + "\" is a required argument.");
120
+ }
121
+ exports.getArg = getArg;
122
+ var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
123
+ var dataUrlRegexp = /^data:.+\,.+$/;
124
+ function urlParse(aUrl) {
125
+ var match = aUrl.match(urlRegexp);
126
+ if (!match) return null;
127
+ return {
128
+ scheme: match[1],
129
+ auth: match[2],
130
+ host: match[3],
131
+ port: match[4],
132
+ path: match[5]
133
+ };
134
+ }
135
+ exports.urlParse = urlParse;
136
+ function urlGenerate(aParsedUrl) {
137
+ var url = "";
138
+ if (aParsedUrl.scheme) url += aParsedUrl.scheme + ":";
139
+ url += "//";
140
+ if (aParsedUrl.auth) url += aParsedUrl.auth + "@";
141
+ if (aParsedUrl.host) url += aParsedUrl.host;
142
+ if (aParsedUrl.port) url += ":" + aParsedUrl.port;
143
+ if (aParsedUrl.path) url += aParsedUrl.path;
144
+ return url;
145
+ }
146
+ exports.urlGenerate = urlGenerate;
147
+ /**
148
+ * Normalizes a path, or the path portion of a URL:
149
+ *
150
+ * - Replaces consecutive slashes with one slash.
151
+ * - Removes unnecessary '.' parts.
152
+ * - Removes unnecessary '<dir>/..' parts.
153
+ *
154
+ * Based on code in the Node.js 'path' core module.
155
+ *
156
+ * @param aPath The path or url to normalize.
157
+ */
158
+ function normalize(aPath) {
159
+ var path$1 = aPath;
160
+ var url = urlParse(aPath);
161
+ if (url) {
162
+ if (!url.path) return aPath;
163
+ path$1 = url.path;
164
+ }
165
+ var isAbsolute = exports.isAbsolute(path$1);
166
+ var parts = path$1.split(/\/+/);
167
+ for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
168
+ part = parts[i];
169
+ if (part === ".") parts.splice(i, 1);
170
+ else if (part === "..") up++;
171
+ else if (up > 0) if (part === "") {
172
+ parts.splice(i + 1, up);
173
+ up = 0;
174
+ } else {
175
+ parts.splice(i, 2);
176
+ up--;
177
+ }
178
+ }
179
+ path$1 = parts.join("/");
180
+ if (path$1 === "") path$1 = isAbsolute ? "/" : ".";
181
+ if (url) {
182
+ url.path = path$1;
183
+ return urlGenerate(url);
184
+ }
185
+ return path$1;
186
+ }
187
+ exports.normalize = normalize;
188
+ /**
189
+ * Joins two paths/URLs.
190
+ *
191
+ * @param aRoot The root path or URL.
192
+ * @param aPath The path or URL to be joined with the root.
193
+ *
194
+ * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
195
+ * scheme-relative URL: Then the scheme of aRoot, if any, is prepended
196
+ * first.
197
+ * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
198
+ * is updated with the result and aRoot is returned. Otherwise the result
199
+ * is returned.
200
+ * - If aPath is absolute, the result is aPath.
201
+ * - Otherwise the two paths are joined with a slash.
202
+ * - Joining for example 'http://' and 'www.example.com' is also supported.
203
+ */
204
+ function join(aRoot, aPath) {
205
+ if (aRoot === "") aRoot = ".";
206
+ if (aPath === "") aPath = ".";
207
+ var aPathUrl = urlParse(aPath);
208
+ var aRootUrl = urlParse(aRoot);
209
+ if (aRootUrl) aRoot = aRootUrl.path || "/";
210
+ if (aPathUrl && !aPathUrl.scheme) {
211
+ if (aRootUrl) aPathUrl.scheme = aRootUrl.scheme;
212
+ return urlGenerate(aPathUrl);
213
+ }
214
+ if (aPathUrl || aPath.match(dataUrlRegexp)) return aPath;
215
+ if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
216
+ aRootUrl.host = aPath;
217
+ return urlGenerate(aRootUrl);
218
+ }
219
+ var joined = aPath.charAt(0) === "/" ? aPath : normalize(aRoot.replace(/\/+$/, "") + "/" + aPath);
220
+ if (aRootUrl) {
221
+ aRootUrl.path = joined;
222
+ return urlGenerate(aRootUrl);
223
+ }
224
+ return joined;
225
+ }
226
+ exports.join = join;
227
+ exports.isAbsolute = function(aPath) {
228
+ return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
229
+ };
230
+ /**
231
+ * Make a path relative to a URL or another path.
232
+ *
233
+ * @param aRoot The root path or URL.
234
+ * @param aPath The path or URL to be made relative to aRoot.
235
+ */
236
+ function relative(aRoot, aPath) {
237
+ if (aRoot === "") aRoot = ".";
238
+ aRoot = aRoot.replace(/\/$/, "");
239
+ var level = 0;
240
+ while (aPath.indexOf(aRoot + "/") !== 0) {
241
+ var index = aRoot.lastIndexOf("/");
242
+ if (index < 0) return aPath;
243
+ aRoot = aRoot.slice(0, index);
244
+ if (aRoot.match(/^([^\/]+:\/)?\/*$/)) return aPath;
245
+ ++level;
246
+ }
247
+ return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
248
+ }
249
+ exports.relative = relative;
250
+ var supportsNullProto = function() {
251
+ var obj = Object.create(null);
252
+ return !("__proto__" in obj);
253
+ }();
254
+ function identity(s) {
255
+ return s;
256
+ }
257
+ /**
258
+ * Because behavior goes wacky when you set `__proto__` on objects, we
259
+ * have to prefix all the strings in our set with an arbitrary character.
260
+ *
261
+ * See https://github.com/mozilla/source-map/pull/31 and
262
+ * https://github.com/mozilla/source-map/issues/30
263
+ *
264
+ * @param String aStr
265
+ */
266
+ function toSetString(aStr) {
267
+ if (isProtoString(aStr)) return "$" + aStr;
268
+ return aStr;
269
+ }
270
+ exports.toSetString = supportsNullProto ? identity : toSetString;
271
+ function fromSetString(aStr) {
272
+ if (isProtoString(aStr)) return aStr.slice(1);
273
+ return aStr;
274
+ }
275
+ exports.fromSetString = supportsNullProto ? identity : fromSetString;
276
+ function isProtoString(s) {
277
+ if (!s) return false;
278
+ var length = s.length;
279
+ if (length < 9) return false;
280
+ if (s.charCodeAt(length - 1) !== 95 || s.charCodeAt(length - 2) !== 95 || s.charCodeAt(length - 3) !== 111 || s.charCodeAt(length - 4) !== 116 || s.charCodeAt(length - 5) !== 111 || s.charCodeAt(length - 6) !== 114 || s.charCodeAt(length - 7) !== 112 || s.charCodeAt(length - 8) !== 95 || s.charCodeAt(length - 9) !== 95) return false;
281
+ for (var i = length - 10; i >= 0; i--) if (s.charCodeAt(i) !== 36) return false;
282
+ return true;
283
+ }
284
+ /**
285
+ * Comparator between two mappings where the original positions are compared.
286
+ *
287
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
288
+ * mappings with the same original source/line/column, but different generated
289
+ * line and column the same. Useful when searching for a mapping with a
290
+ * stubbed out mapping.
291
+ */
292
+ function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
293
+ var cmp = strcmp(mappingA.source, mappingB.source);
294
+ if (cmp !== 0) return cmp;
295
+ cmp = mappingA.originalLine - mappingB.originalLine;
296
+ if (cmp !== 0) return cmp;
297
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
298
+ if (cmp !== 0 || onlyCompareOriginal) return cmp;
299
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
300
+ if (cmp !== 0) return cmp;
301
+ cmp = mappingA.generatedLine - mappingB.generatedLine;
302
+ if (cmp !== 0) return cmp;
303
+ return strcmp(mappingA.name, mappingB.name);
304
+ }
305
+ exports.compareByOriginalPositions = compareByOriginalPositions;
306
+ /**
307
+ * Comparator between two mappings with deflated source and name indices where
308
+ * the generated positions are compared.
309
+ *
310
+ * Optionally pass in `true` as `onlyCompareGenerated` to consider two
311
+ * mappings with the same generated line and column, but different
312
+ * source/name/original line and column the same. Useful when searching for a
313
+ * mapping with a stubbed out mapping.
314
+ */
315
+ function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
316
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
317
+ if (cmp !== 0) return cmp;
318
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
319
+ if (cmp !== 0 || onlyCompareGenerated) return cmp;
320
+ cmp = strcmp(mappingA.source, mappingB.source);
321
+ if (cmp !== 0) return cmp;
322
+ cmp = mappingA.originalLine - mappingB.originalLine;
323
+ if (cmp !== 0) return cmp;
324
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
325
+ if (cmp !== 0) return cmp;
326
+ return strcmp(mappingA.name, mappingB.name);
327
+ }
328
+ exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;
329
+ function strcmp(aStr1, aStr2) {
330
+ if (aStr1 === aStr2) return 0;
331
+ if (aStr1 === null) return 1;
332
+ if (aStr2 === null) return -1;
333
+ if (aStr1 > aStr2) return 1;
334
+ return -1;
335
+ }
336
+ /**
337
+ * Comparator between two mappings with inflated source and name strings where
338
+ * the generated positions are compared.
339
+ */
340
+ function compareByGeneratedPositionsInflated(mappingA, mappingB) {
341
+ var cmp = mappingA.generatedLine - mappingB.generatedLine;
342
+ if (cmp !== 0) return cmp;
343
+ cmp = mappingA.generatedColumn - mappingB.generatedColumn;
344
+ if (cmp !== 0) return cmp;
345
+ cmp = strcmp(mappingA.source, mappingB.source);
346
+ if (cmp !== 0) return cmp;
347
+ cmp = mappingA.originalLine - mappingB.originalLine;
348
+ if (cmp !== 0) return cmp;
349
+ cmp = mappingA.originalColumn - mappingB.originalColumn;
350
+ if (cmp !== 0) return cmp;
351
+ return strcmp(mappingA.name, mappingB.name);
352
+ }
353
+ exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;
354
+ /**
355
+ * Strip any JSON XSSI avoidance prefix from the string (as documented
356
+ * in the source maps specification), and then parse the string as
357
+ * JSON.
358
+ */
359
+ function parseSourceMapInput(str) {
360
+ return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ""));
361
+ }
362
+ exports.parseSourceMapInput = parseSourceMapInput;
363
+ /**
364
+ * Compute the URL of a source given the the source root, the source's
365
+ * URL, and the source map's URL.
366
+ */
367
+ function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
368
+ sourceURL = sourceURL || "";
369
+ if (sourceRoot) {
370
+ if (sourceRoot[sourceRoot.length - 1] !== "/" && sourceURL[0] !== "/") sourceRoot += "/";
371
+ sourceURL = sourceRoot + sourceURL;
372
+ }
373
+ if (sourceMapURL) {
374
+ var parsed = urlParse(sourceMapURL);
375
+ if (!parsed) throw new Error("sourceMapURL could not be parsed");
376
+ if (parsed.path) {
377
+ var index = parsed.path.lastIndexOf("/");
378
+ if (index >= 0) parsed.path = parsed.path.substring(0, index + 1);
379
+ }
380
+ sourceURL = join(urlGenerate(parsed), sourceURL);
381
+ }
382
+ return normalize(sourceURL);
383
+ }
384
+ exports.computeSourceURL = computeSourceURL;
385
+ } });
386
+
387
+ //#endregion
388
+ //#region ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/array-set.js
389
+ var require_array_set = __commonJS({ "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/array-set.js"(exports) {
390
+ var util$4 = require_util();
391
+ var has = Object.prototype.hasOwnProperty;
392
+ var hasNativeMap = typeof Map !== "undefined";
393
+ /**
394
+ * A data structure which is a combination of an array and a set. Adding a new
395
+ * member is O(1), testing for membership is O(1), and finding the index of an
396
+ * element is O(1). Removing elements from the set is not supported. Only
397
+ * strings are supported for membership.
398
+ */
399
+ function ArraySet$2() {
400
+ this._array = [];
401
+ this._set = hasNativeMap ? /* @__PURE__ */ new Map() : Object.create(null);
402
+ }
403
+ /**
404
+ * Static method for creating ArraySet instances from an existing array.
405
+ */
406
+ ArraySet$2.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
407
+ var set = new ArraySet$2();
408
+ for (var i = 0, len = aArray.length; i < len; i++) set.add(aArray[i], aAllowDuplicates);
409
+ return set;
410
+ };
411
+ /**
412
+ * Return how many unique items are in this ArraySet. If duplicates have been
413
+ * added, than those do not count towards the size.
414
+ *
415
+ * @returns Number
416
+ */
417
+ ArraySet$2.prototype.size = function ArraySet_size() {
418
+ return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
419
+ };
420
+ /**
421
+ * Add the given string to this set.
422
+ *
423
+ * @param String aStr
424
+ */
425
+ ArraySet$2.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
426
+ var sStr = hasNativeMap ? aStr : util$4.toSetString(aStr);
427
+ var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
428
+ var idx = this._array.length;
429
+ if (!isDuplicate || aAllowDuplicates) this._array.push(aStr);
430
+ if (!isDuplicate) if (hasNativeMap) this._set.set(aStr, idx);
431
+ else this._set[sStr] = idx;
432
+ };
433
+ /**
434
+ * Is the given string a member of this set?
435
+ *
436
+ * @param String aStr
437
+ */
438
+ ArraySet$2.prototype.has = function ArraySet_has(aStr) {
439
+ if (hasNativeMap) return this._set.has(aStr);
440
+ else {
441
+ var sStr = util$4.toSetString(aStr);
442
+ return has.call(this._set, sStr);
443
+ }
444
+ };
445
+ /**
446
+ * What is the index of the given string in the array?
447
+ *
448
+ * @param String aStr
449
+ */
450
+ ArraySet$2.prototype.indexOf = function ArraySet_indexOf(aStr) {
451
+ if (hasNativeMap) {
452
+ var idx = this._set.get(aStr);
453
+ if (idx >= 0) return idx;
454
+ } else {
455
+ var sStr = util$4.toSetString(aStr);
456
+ if (has.call(this._set, sStr)) return this._set[sStr];
457
+ }
458
+ throw new Error("\"" + aStr + "\" is not in the set.");
459
+ };
460
+ /**
461
+ * What is the element at the given index?
462
+ *
463
+ * @param Number aIdx
464
+ */
465
+ ArraySet$2.prototype.at = function ArraySet_at(aIdx) {
466
+ if (aIdx >= 0 && aIdx < this._array.length) return this._array[aIdx];
467
+ throw new Error("No element indexed by " + aIdx);
468
+ };
469
+ /**
470
+ * Returns the array representation of this set (which has the proper indices
471
+ * indicated by indexOf). Note that this is a copy of the internal array used
472
+ * for storing the members so that no one can mess with internal state.
473
+ */
474
+ ArraySet$2.prototype.toArray = function ArraySet_toArray() {
475
+ return this._array.slice();
476
+ };
477
+ exports.ArraySet = ArraySet$2;
478
+ } });
479
+
480
+ //#endregion
481
+ //#region ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/mapping-list.js
482
+ var require_mapping_list = __commonJS({ "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/mapping-list.js"(exports) {
483
+ var util$3 = require_util();
484
+ /**
485
+ * Determine whether mappingB is after mappingA with respect to generated
486
+ * position.
487
+ */
488
+ function generatedPositionAfter(mappingA, mappingB) {
489
+ var lineA = mappingA.generatedLine;
490
+ var lineB = mappingB.generatedLine;
491
+ var columnA = mappingA.generatedColumn;
492
+ var columnB = mappingB.generatedColumn;
493
+ return lineB > lineA || lineB == lineA && columnB >= columnA || util$3.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
494
+ }
495
+ /**
496
+ * A data structure to provide a sorted view of accumulated mappings in a
497
+ * performance conscious manner. It trades a neglibable overhead in general
498
+ * case for a large speedup in case of mappings being added in order.
499
+ */
500
+ function MappingList$1() {
501
+ this._array = [];
502
+ this._sorted = true;
503
+ this._last = {
504
+ generatedLine: -1,
505
+ generatedColumn: 0
506
+ };
507
+ }
508
+ /**
509
+ * Iterate through internal items. This method takes the same arguments that
510
+ * `Array.prototype.forEach` takes.
511
+ *
512
+ * NOTE: The order of the mappings is NOT guaranteed.
513
+ */
514
+ MappingList$1.prototype.unsortedForEach = function MappingList_forEach(aCallback, aThisArg) {
515
+ this._array.forEach(aCallback, aThisArg);
516
+ };
517
+ /**
518
+ * Add the given source mapping.
519
+ *
520
+ * @param Object aMapping
521
+ */
522
+ MappingList$1.prototype.add = function MappingList_add(aMapping) {
523
+ if (generatedPositionAfter(this._last, aMapping)) {
524
+ this._last = aMapping;
525
+ this._array.push(aMapping);
526
+ } else {
527
+ this._sorted = false;
528
+ this._array.push(aMapping);
529
+ }
530
+ };
531
+ /**
532
+ * Returns the flat, sorted array of mappings. The mappings are sorted by
533
+ * generated position.
534
+ *
535
+ * WARNING: This method returns internal data without copying, for
536
+ * performance. The return value must NOT be mutated, and should be treated as
537
+ * an immutable borrow. If you want to take ownership, you must make your own
538
+ * copy.
539
+ */
540
+ MappingList$1.prototype.toArray = function MappingList_toArray() {
541
+ if (!this._sorted) {
542
+ this._array.sort(util$3.compareByGeneratedPositionsInflated);
543
+ this._sorted = true;
544
+ }
545
+ return this._array;
546
+ };
547
+ exports.MappingList = MappingList$1;
548
+ } });
549
+
550
+ //#endregion
551
+ //#region ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-generator.js
552
+ var require_source_map_generator = __commonJS({ "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-generator.js"(exports) {
553
+ var base64VLQ$1 = require_base64_vlq();
554
+ var util$2 = require_util();
555
+ var ArraySet$1 = require_array_set().ArraySet;
556
+ var MappingList = require_mapping_list().MappingList;
557
+ /**
558
+ * An instance of the SourceMapGenerator represents a source map which is
559
+ * being built incrementally. You may pass an object with the following
560
+ * properties:
561
+ *
562
+ * - file: The filename of the generated source.
563
+ * - sourceRoot: A root for all relative URLs in this source map.
564
+ */
565
+ function SourceMapGenerator$1(aArgs) {
566
+ if (!aArgs) aArgs = {};
567
+ this._file = util$2.getArg(aArgs, "file", null);
568
+ this._sourceRoot = util$2.getArg(aArgs, "sourceRoot", null);
569
+ this._skipValidation = util$2.getArg(aArgs, "skipValidation", false);
570
+ this._sources = new ArraySet$1();
571
+ this._names = new ArraySet$1();
572
+ this._mappings = new MappingList();
573
+ this._sourcesContents = null;
574
+ }
575
+ SourceMapGenerator$1.prototype._version = 3;
576
+ /**
577
+ * Creates a new SourceMapGenerator based on a SourceMapConsumer
578
+ *
579
+ * @param aSourceMapConsumer The SourceMap.
580
+ */
581
+ SourceMapGenerator$1.fromSourceMap = function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) {
582
+ var sourceRoot = aSourceMapConsumer.sourceRoot;
583
+ var generator = new SourceMapGenerator$1({
584
+ file: aSourceMapConsumer.file,
585
+ sourceRoot
586
+ });
587
+ aSourceMapConsumer.eachMapping(function(mapping) {
588
+ var newMapping = { generated: {
589
+ line: mapping.generatedLine,
590
+ column: mapping.generatedColumn
591
+ } };
592
+ if (mapping.source != null) {
593
+ newMapping.source = mapping.source;
594
+ if (sourceRoot != null) newMapping.source = util$2.relative(sourceRoot, newMapping.source);
595
+ newMapping.original = {
596
+ line: mapping.originalLine,
597
+ column: mapping.originalColumn
598
+ };
599
+ if (mapping.name != null) newMapping.name = mapping.name;
600
+ }
601
+ generator.addMapping(newMapping);
602
+ });
603
+ aSourceMapConsumer.sources.forEach(function(sourceFile) {
604
+ var sourceRelative = sourceFile;
605
+ if (sourceRoot !== null) sourceRelative = util$2.relative(sourceRoot, sourceFile);
606
+ if (!generator._sources.has(sourceRelative)) generator._sources.add(sourceRelative);
607
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
608
+ if (content != null) generator.setSourceContent(sourceFile, content);
609
+ });
610
+ return generator;
611
+ };
612
+ /**
613
+ * Add a single mapping from original source line and column to the generated
614
+ * source's line and column for this source map being created. The mapping
615
+ * object should have the following properties:
616
+ *
617
+ * - generated: An object with the generated line and column positions.
618
+ * - original: An object with the original line and column positions.
619
+ * - source: The original source file (relative to the sourceRoot).
620
+ * - name: An optional original token name for this mapping.
621
+ */
622
+ SourceMapGenerator$1.prototype.addMapping = function SourceMapGenerator_addMapping(aArgs) {
623
+ var generated = util$2.getArg(aArgs, "generated");
624
+ var original = util$2.getArg(aArgs, "original", null);
625
+ var source = util$2.getArg(aArgs, "source", null);
626
+ var name = util$2.getArg(aArgs, "name", null);
627
+ if (!this._skipValidation) this._validateMapping(generated, original, source, name);
628
+ if (source != null) {
629
+ source = String(source);
630
+ if (!this._sources.has(source)) this._sources.add(source);
631
+ }
632
+ if (name != null) {
633
+ name = String(name);
634
+ if (!this._names.has(name)) this._names.add(name);
635
+ }
636
+ this._mappings.add({
637
+ generatedLine: generated.line,
638
+ generatedColumn: generated.column,
639
+ originalLine: original != null && original.line,
640
+ originalColumn: original != null && original.column,
641
+ source,
642
+ name
643
+ });
644
+ };
645
+ /**
646
+ * Set the source content for a source file.
647
+ */
648
+ SourceMapGenerator$1.prototype.setSourceContent = function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
649
+ var source = aSourceFile;
650
+ if (this._sourceRoot != null) source = util$2.relative(this._sourceRoot, source);
651
+ if (aSourceContent != null) {
652
+ if (!this._sourcesContents) this._sourcesContents = Object.create(null);
653
+ this._sourcesContents[util$2.toSetString(source)] = aSourceContent;
654
+ } else if (this._sourcesContents) {
655
+ delete this._sourcesContents[util$2.toSetString(source)];
656
+ if (Object.keys(this._sourcesContents).length === 0) this._sourcesContents = null;
657
+ }
658
+ };
659
+ /**
660
+ * Applies the mappings of a sub-source-map for a specific source file to the
661
+ * source map being generated. Each mapping to the supplied source file is
662
+ * rewritten using the supplied source map. Note: The resolution for the
663
+ * resulting mappings is the minimium of this map and the supplied map.
664
+ *
665
+ * @param aSourceMapConsumer The source map to be applied.
666
+ * @param aSourceFile Optional. The filename of the source file.
667
+ * If omitted, SourceMapConsumer's file property will be used.
668
+ * @param aSourceMapPath Optional. The dirname of the path to the source map
669
+ * to be applied. If relative, it is relative to the SourceMapConsumer.
670
+ * This parameter is needed when the two source maps aren't in the same
671
+ * directory, and the source map to be applied contains relative source
672
+ * paths. If so, those relative source paths need to be rewritten
673
+ * relative to the SourceMapGenerator.
674
+ */
675
+ SourceMapGenerator$1.prototype.applySourceMap = function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
676
+ var sourceFile = aSourceFile;
677
+ if (aSourceFile == null) {
678
+ if (aSourceMapConsumer.file == null) throw new Error("SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's \"file\" property. Both were omitted.");
679
+ sourceFile = aSourceMapConsumer.file;
680
+ }
681
+ var sourceRoot = this._sourceRoot;
682
+ if (sourceRoot != null) sourceFile = util$2.relative(sourceRoot, sourceFile);
683
+ var newSources = new ArraySet$1();
684
+ var newNames = new ArraySet$1();
685
+ this._mappings.unsortedForEach(function(mapping) {
686
+ if (mapping.source === sourceFile && mapping.originalLine != null) {
687
+ var original = aSourceMapConsumer.originalPositionFor({
688
+ line: mapping.originalLine,
689
+ column: mapping.originalColumn
690
+ });
691
+ if (original.source != null) {
692
+ mapping.source = original.source;
693
+ if (aSourceMapPath != null) mapping.source = util$2.join(aSourceMapPath, mapping.source);
694
+ if (sourceRoot != null) mapping.source = util$2.relative(sourceRoot, mapping.source);
695
+ mapping.originalLine = original.line;
696
+ mapping.originalColumn = original.column;
697
+ if (original.name != null) mapping.name = original.name;
698
+ }
699
+ }
700
+ var source = mapping.source;
701
+ if (source != null && !newSources.has(source)) newSources.add(source);
702
+ var name = mapping.name;
703
+ if (name != null && !newNames.has(name)) newNames.add(name);
704
+ }, this);
705
+ this._sources = newSources;
706
+ this._names = newNames;
707
+ aSourceMapConsumer.sources.forEach(function(sourceFile$1) {
708
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile$1);
709
+ if (content != null) {
710
+ if (aSourceMapPath != null) sourceFile$1 = util$2.join(aSourceMapPath, sourceFile$1);
711
+ if (sourceRoot != null) sourceFile$1 = util$2.relative(sourceRoot, sourceFile$1);
712
+ this.setSourceContent(sourceFile$1, content);
713
+ }
714
+ }, this);
715
+ };
716
+ /**
717
+ * A mapping can have one of the three levels of data:
718
+ *
719
+ * 1. Just the generated position.
720
+ * 2. The Generated position, original position, and original source.
721
+ * 3. Generated and original position, original source, as well as a name
722
+ * token.
723
+ *
724
+ * To maintain consistency, we validate that any new mapping being added falls
725
+ * in to one of these categories.
726
+ */
727
+ SourceMapGenerator$1.prototype._validateMapping = function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, aName) {
728
+ if (aOriginal && typeof aOriginal.line !== "number" && typeof aOriginal.column !== "number") throw new Error("original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.");
729
+ if (aGenerated && "line" in aGenerated && "column" in aGenerated && aGenerated.line > 0 && aGenerated.column >= 0 && !aOriginal && !aSource && !aName) return;
730
+ else if (aGenerated && "line" in aGenerated && "column" in aGenerated && aOriginal && "line" in aOriginal && "column" in aOriginal && aGenerated.line > 0 && aGenerated.column >= 0 && aOriginal.line > 0 && aOriginal.column >= 0 && aSource) return;
731
+ else throw new Error("Invalid mapping: " + JSON.stringify({
732
+ generated: aGenerated,
733
+ source: aSource,
734
+ original: aOriginal,
735
+ name: aName
736
+ }));
737
+ };
738
+ /**
739
+ * Serialize the accumulated mappings in to the stream of base 64 VLQs
740
+ * specified by the source map format.
741
+ */
742
+ SourceMapGenerator$1.prototype._serializeMappings = function SourceMapGenerator_serializeMappings() {
743
+ var previousGeneratedColumn = 0;
744
+ var previousGeneratedLine = 1;
745
+ var previousOriginalColumn = 0;
746
+ var previousOriginalLine = 0;
747
+ var previousName = 0;
748
+ var previousSource = 0;
749
+ var result = "";
750
+ var next;
751
+ var mapping;
752
+ var nameIdx;
753
+ var sourceIdx;
754
+ var mappings = this._mappings.toArray();
755
+ for (var i = 0, len = mappings.length; i < len; i++) {
756
+ mapping = mappings[i];
757
+ next = "";
758
+ if (mapping.generatedLine !== previousGeneratedLine) {
759
+ previousGeneratedColumn = 0;
760
+ while (mapping.generatedLine !== previousGeneratedLine) {
761
+ next += ";";
762
+ previousGeneratedLine++;
763
+ }
764
+ } else if (i > 0) {
765
+ if (!util$2.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) continue;
766
+ next += ",";
767
+ }
768
+ next += base64VLQ$1.encode(mapping.generatedColumn - previousGeneratedColumn);
769
+ previousGeneratedColumn = mapping.generatedColumn;
770
+ if (mapping.source != null) {
771
+ sourceIdx = this._sources.indexOf(mapping.source);
772
+ next += base64VLQ$1.encode(sourceIdx - previousSource);
773
+ previousSource = sourceIdx;
774
+ next += base64VLQ$1.encode(mapping.originalLine - 1 - previousOriginalLine);
775
+ previousOriginalLine = mapping.originalLine - 1;
776
+ next += base64VLQ$1.encode(mapping.originalColumn - previousOriginalColumn);
777
+ previousOriginalColumn = mapping.originalColumn;
778
+ if (mapping.name != null) {
779
+ nameIdx = this._names.indexOf(mapping.name);
780
+ next += base64VLQ$1.encode(nameIdx - previousName);
781
+ previousName = nameIdx;
782
+ }
783
+ }
784
+ result += next;
785
+ }
786
+ return result;
787
+ };
788
+ SourceMapGenerator$1.prototype._generateSourcesContent = function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
789
+ return aSources.map(function(source) {
790
+ if (!this._sourcesContents) return null;
791
+ if (aSourceRoot != null) source = util$2.relative(aSourceRoot, source);
792
+ var key = util$2.toSetString(source);
793
+ return Object.prototype.hasOwnProperty.call(this._sourcesContents, key) ? this._sourcesContents[key] : null;
794
+ }, this);
795
+ };
796
+ /**
797
+ * Externalize the source map.
798
+ */
799
+ SourceMapGenerator$1.prototype.toJSON = function SourceMapGenerator_toJSON() {
800
+ var map = {
801
+ version: this._version,
802
+ sources: this._sources.toArray(),
803
+ names: this._names.toArray(),
804
+ mappings: this._serializeMappings()
805
+ };
806
+ if (this._file != null) map.file = this._file;
807
+ if (this._sourceRoot != null) map.sourceRoot = this._sourceRoot;
808
+ if (this._sourcesContents) map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
809
+ return map;
810
+ };
811
+ /**
812
+ * Render the source map being generated to a string.
813
+ */
814
+ SourceMapGenerator$1.prototype.toString = function SourceMapGenerator_toString() {
815
+ return JSON.stringify(this.toJSON());
816
+ };
817
+ exports.SourceMapGenerator = SourceMapGenerator$1;
818
+ } });
819
+
820
+ //#endregion
821
+ //#region ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/binary-search.js
822
+ var require_binary_search = __commonJS({ "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/binary-search.js"(exports) {
823
+ exports.GREATEST_LOWER_BOUND = 1;
824
+ exports.LEAST_UPPER_BOUND = 2;
825
+ /**
826
+ * Recursive implementation of binary search.
827
+ *
828
+ * @param aLow Indices here and lower do not contain the needle.
829
+ * @param aHigh Indices here and higher do not contain the needle.
830
+ * @param aNeedle The element being searched for.
831
+ * @param aHaystack The non-empty array being searched.
832
+ * @param aCompare Function which takes two elements and returns -1, 0, or 1.
833
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
834
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
835
+ * closest element that is smaller than or greater than the one we are
836
+ * searching for, respectively, if the exact element cannot be found.
837
+ */
838
+ function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
839
+ var mid = Math.floor((aHigh - aLow) / 2) + aLow;
840
+ var cmp = aCompare(aNeedle, aHaystack[mid], true);
841
+ if (cmp === 0) return mid;
842
+ else if (cmp > 0) {
843
+ if (aHigh - mid > 1) return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
844
+ if (aBias == exports.LEAST_UPPER_BOUND) return aHigh < aHaystack.length ? aHigh : -1;
845
+ else return mid;
846
+ } else {
847
+ if (mid - aLow > 1) return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
848
+ if (aBias == exports.LEAST_UPPER_BOUND) return mid;
849
+ else return aLow < 0 ? -1 : aLow;
850
+ }
851
+ }
852
+ /**
853
+ * This is an implementation of binary search which will always try and return
854
+ * the index of the closest element if there is no exact hit. This is because
855
+ * mappings between original and generated line/col pairs are single points,
856
+ * and there is an implicit region between each of them, so a miss just means
857
+ * that you aren't on the very start of a region.
858
+ *
859
+ * @param aNeedle The element you are looking for.
860
+ * @param aHaystack The array that is being searched.
861
+ * @param aCompare A function which takes the needle and an element in the
862
+ * array and returns -1, 0, or 1 depending on whether the needle is less
863
+ * than, equal to, or greater than the element, respectively.
864
+ * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
865
+ * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
866
+ * closest element that is smaller than or greater than the one we are
867
+ * searching for, respectively, if the exact element cannot be found.
868
+ * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
869
+ */
870
+ exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
871
+ if (aHaystack.length === 0) return -1;
872
+ var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, aCompare, aBias || exports.GREATEST_LOWER_BOUND);
873
+ if (index < 0) return -1;
874
+ while (index - 1 >= 0) {
875
+ if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) break;
876
+ --index;
877
+ }
878
+ return index;
879
+ };
880
+ } });
881
+
882
+ //#endregion
883
+ //#region ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/quick-sort.js
884
+ var require_quick_sort = __commonJS({ "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/quick-sort.js"(exports) {
885
+ /**
886
+ * Swap the elements indexed by `x` and `y` in the array `ary`.
887
+ *
888
+ * @param {Array} ary
889
+ * The array.
890
+ * @param {Number} x
891
+ * The index of the first item.
892
+ * @param {Number} y
893
+ * The index of the second item.
894
+ */
895
+ function swap(ary, x, y) {
896
+ var temp = ary[x];
897
+ ary[x] = ary[y];
898
+ ary[y] = temp;
899
+ }
900
+ /**
901
+ * Returns a random integer within the range `low .. high` inclusive.
902
+ *
903
+ * @param {Number} low
904
+ * The lower bound on the range.
905
+ * @param {Number} high
906
+ * The upper bound on the range.
907
+ */
908
+ function randomIntInRange(low, high) {
909
+ return Math.round(low + Math.random() * (high - low));
910
+ }
911
+ /**
912
+ * The Quick Sort algorithm.
913
+ *
914
+ * @param {Array} ary
915
+ * An array to sort.
916
+ * @param {function} comparator
917
+ * Function to use to compare two items.
918
+ * @param {Number} p
919
+ * Start index of the array
920
+ * @param {Number} r
921
+ * End index of the array
922
+ */
923
+ function doQuickSort(ary, comparator, p, r) {
924
+ if (p < r) {
925
+ var pivotIndex = randomIntInRange(p, r);
926
+ var i = p - 1;
927
+ swap(ary, pivotIndex, r);
928
+ var pivot = ary[r];
929
+ for (var j = p; j < r; j++) if (comparator(ary[j], pivot) <= 0) {
930
+ i += 1;
931
+ swap(ary, i, j);
932
+ }
933
+ swap(ary, i + 1, j);
934
+ var q = i + 1;
935
+ doQuickSort(ary, comparator, p, q - 1);
936
+ doQuickSort(ary, comparator, q + 1, r);
937
+ }
938
+ }
939
+ /**
940
+ * Sort the given array in-place with the given comparator function.
941
+ *
942
+ * @param {Array} ary
943
+ * An array to sort.
944
+ * @param {function} comparator
945
+ * Function to use to compare two items.
946
+ */
947
+ exports.quickSort = function(ary, comparator) {
948
+ doQuickSort(ary, comparator, 0, ary.length - 1);
949
+ };
950
+ } });
951
+
952
+ //#endregion
953
+ //#region ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-consumer.js
954
+ var require_source_map_consumer = __commonJS({ "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-map-consumer.js"(exports) {
955
+ var util$1 = require_util();
956
+ var binarySearch = require_binary_search();
957
+ var ArraySet = require_array_set().ArraySet;
958
+ var base64VLQ = require_base64_vlq();
959
+ var quickSort = require_quick_sort().quickSort;
960
+ function SourceMapConsumer$1(aSourceMap, aSourceMapURL) {
961
+ var sourceMap = aSourceMap;
962
+ if (typeof aSourceMap === "string") sourceMap = util$1.parseSourceMapInput(aSourceMap);
963
+ return sourceMap.sections != null ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL) : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
964
+ }
965
+ SourceMapConsumer$1.fromSourceMap = function(aSourceMap, aSourceMapURL) {
966
+ return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
967
+ };
968
+ /**
969
+ * The version of the source mapping spec that we are consuming.
970
+ */
971
+ SourceMapConsumer$1.prototype._version = 3;
972
+ SourceMapConsumer$1.prototype.__generatedMappings = null;
973
+ Object.defineProperty(SourceMapConsumer$1.prototype, "_generatedMappings", {
974
+ configurable: true,
975
+ enumerable: true,
976
+ get: function() {
977
+ if (!this.__generatedMappings) this._parseMappings(this._mappings, this.sourceRoot);
978
+ return this.__generatedMappings;
979
+ }
980
+ });
981
+ SourceMapConsumer$1.prototype.__originalMappings = null;
982
+ Object.defineProperty(SourceMapConsumer$1.prototype, "_originalMappings", {
983
+ configurable: true,
984
+ enumerable: true,
985
+ get: function() {
986
+ if (!this.__originalMappings) this._parseMappings(this._mappings, this.sourceRoot);
987
+ return this.__originalMappings;
988
+ }
989
+ });
990
+ SourceMapConsumer$1.prototype._charIsMappingSeparator = function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
991
+ var c = aStr.charAt(index);
992
+ return c === ";" || c === ",";
993
+ };
994
+ /**
995
+ * Parse the mappings in a string in to a data structure which we can easily
996
+ * query (the ordered arrays in the `this.__generatedMappings` and
997
+ * `this.__originalMappings` properties).
998
+ */
999
+ SourceMapConsumer$1.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
1000
+ throw new Error("Subclasses must implement _parseMappings");
1001
+ };
1002
+ SourceMapConsumer$1.GENERATED_ORDER = 1;
1003
+ SourceMapConsumer$1.ORIGINAL_ORDER = 2;
1004
+ SourceMapConsumer$1.GREATEST_LOWER_BOUND = 1;
1005
+ SourceMapConsumer$1.LEAST_UPPER_BOUND = 2;
1006
+ /**
1007
+ * Iterate over each mapping between an original source/line/column and a
1008
+ * generated line/column in this source map.
1009
+ *
1010
+ * @param Function aCallback
1011
+ * The function that is called with each mapping.
1012
+ * @param Object aContext
1013
+ * Optional. If specified, this object will be the value of `this` every
1014
+ * time that `aCallback` is called.
1015
+ * @param aOrder
1016
+ * Either `SourceMapConsumer.GENERATED_ORDER` or
1017
+ * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
1018
+ * iterate over the mappings sorted by the generated file's line/column
1019
+ * order or the original's source/line/column order, respectively. Defaults to
1020
+ * `SourceMapConsumer.GENERATED_ORDER`.
1021
+ */
1022
+ SourceMapConsumer$1.prototype.eachMapping = function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
1023
+ var context = aContext || null;
1024
+ var order = aOrder || SourceMapConsumer$1.GENERATED_ORDER;
1025
+ var mappings;
1026
+ switch (order) {
1027
+ case SourceMapConsumer$1.GENERATED_ORDER:
1028
+ mappings = this._generatedMappings;
1029
+ break;
1030
+ case SourceMapConsumer$1.ORIGINAL_ORDER:
1031
+ mappings = this._originalMappings;
1032
+ break;
1033
+ default: throw new Error("Unknown order of iteration.");
1034
+ }
1035
+ var sourceRoot = this.sourceRoot;
1036
+ mappings.map(function(mapping) {
1037
+ var source = mapping.source === null ? null : this._sources.at(mapping.source);
1038
+ source = util$1.computeSourceURL(sourceRoot, source, this._sourceMapURL);
1039
+ return {
1040
+ source,
1041
+ generatedLine: mapping.generatedLine,
1042
+ generatedColumn: mapping.generatedColumn,
1043
+ originalLine: mapping.originalLine,
1044
+ originalColumn: mapping.originalColumn,
1045
+ name: mapping.name === null ? null : this._names.at(mapping.name)
1046
+ };
1047
+ }, this).forEach(aCallback, context);
1048
+ };
1049
+ /**
1050
+ * Returns all generated line and column information for the original source,
1051
+ * line, and column provided. If no column is provided, returns all mappings
1052
+ * corresponding to a either the line we are searching for or the next
1053
+ * closest line that has any mappings. Otherwise, returns all mappings
1054
+ * corresponding to the given line and either the column we are searching for
1055
+ * or the next closest column that has any offsets.
1056
+ *
1057
+ * The only argument is an object with the following properties:
1058
+ *
1059
+ * - source: The filename of the original source.
1060
+ * - line: The line number in the original source. The line number is 1-based.
1061
+ * - column: Optional. the column number in the original source.
1062
+ * The column number is 0-based.
1063
+ *
1064
+ * and an array of objects is returned, each with the following properties:
1065
+ *
1066
+ * - line: The line number in the generated source, or null. The
1067
+ * line number is 1-based.
1068
+ * - column: The column number in the generated source, or null.
1069
+ * The column number is 0-based.
1070
+ */
1071
+ SourceMapConsumer$1.prototype.allGeneratedPositionsFor = function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
1072
+ var line = util$1.getArg(aArgs, "line");
1073
+ var needle = {
1074
+ source: util$1.getArg(aArgs, "source"),
1075
+ originalLine: line,
1076
+ originalColumn: util$1.getArg(aArgs, "column", 0)
1077
+ };
1078
+ needle.source = this._findSourceIndex(needle.source);
1079
+ if (needle.source < 0) return [];
1080
+ var mappings = [];
1081
+ var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util$1.compareByOriginalPositions, binarySearch.LEAST_UPPER_BOUND);
1082
+ if (index >= 0) {
1083
+ var mapping = this._originalMappings[index];
1084
+ if (aArgs.column === void 0) {
1085
+ var originalLine = mapping.originalLine;
1086
+ while (mapping && mapping.originalLine === originalLine) {
1087
+ mappings.push({
1088
+ line: util$1.getArg(mapping, "generatedLine", null),
1089
+ column: util$1.getArg(mapping, "generatedColumn", null),
1090
+ lastColumn: util$1.getArg(mapping, "lastGeneratedColumn", null)
1091
+ });
1092
+ mapping = this._originalMappings[++index];
1093
+ }
1094
+ } else {
1095
+ var originalColumn = mapping.originalColumn;
1096
+ while (mapping && mapping.originalLine === line && mapping.originalColumn == originalColumn) {
1097
+ mappings.push({
1098
+ line: util$1.getArg(mapping, "generatedLine", null),
1099
+ column: util$1.getArg(mapping, "generatedColumn", null),
1100
+ lastColumn: util$1.getArg(mapping, "lastGeneratedColumn", null)
1101
+ });
1102
+ mapping = this._originalMappings[++index];
1103
+ }
1104
+ }
1105
+ }
1106
+ return mappings;
1107
+ };
1108
+ exports.SourceMapConsumer = SourceMapConsumer$1;
1109
+ /**
1110
+ * A BasicSourceMapConsumer instance represents a parsed source map which we can
1111
+ * query for information about the original file positions by giving it a file
1112
+ * position in the generated source.
1113
+ *
1114
+ * The first parameter is the raw source map (either as a JSON string, or
1115
+ * already parsed to an object). According to the spec, source maps have the
1116
+ * following attributes:
1117
+ *
1118
+ * - version: Which version of the source map spec this map is following.
1119
+ * - sources: An array of URLs to the original source files.
1120
+ * - names: An array of identifiers which can be referrenced by individual mappings.
1121
+ * - sourceRoot: Optional. The URL root from which all sources are relative.
1122
+ * - sourcesContent: Optional. An array of contents of the original source files.
1123
+ * - mappings: A string of base64 VLQs which contain the actual mappings.
1124
+ * - file: Optional. The generated file this source map is associated with.
1125
+ *
1126
+ * Here is an example source map, taken from the source map spec[0]:
1127
+ *
1128
+ * {
1129
+ * version : 3,
1130
+ * file: "out.js",
1131
+ * sourceRoot : "",
1132
+ * sources: ["foo.js", "bar.js"],
1133
+ * names: ["src", "maps", "are", "fun"],
1134
+ * mappings: "AA,AB;;ABCDE;"
1135
+ * }
1136
+ *
1137
+ * The second parameter, if given, is a string whose value is the URL
1138
+ * at which the source map was found. This URL is used to compute the
1139
+ * sources array.
1140
+ *
1141
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
1142
+ */
1143
+ function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
1144
+ var sourceMap = aSourceMap;
1145
+ if (typeof aSourceMap === "string") sourceMap = util$1.parseSourceMapInput(aSourceMap);
1146
+ var version = util$1.getArg(sourceMap, "version");
1147
+ var sources = util$1.getArg(sourceMap, "sources");
1148
+ var names = util$1.getArg(sourceMap, "names", []);
1149
+ var sourceRoot = util$1.getArg(sourceMap, "sourceRoot", null);
1150
+ var sourcesContent = util$1.getArg(sourceMap, "sourcesContent", null);
1151
+ var mappings = util$1.getArg(sourceMap, "mappings");
1152
+ var file = util$1.getArg(sourceMap, "file", null);
1153
+ if (version != this._version) throw new Error("Unsupported version: " + version);
1154
+ if (sourceRoot) sourceRoot = util$1.normalize(sourceRoot);
1155
+ sources = sources.map(String).map(util$1.normalize).map(function(source) {
1156
+ return sourceRoot && util$1.isAbsolute(sourceRoot) && util$1.isAbsolute(source) ? util$1.relative(sourceRoot, source) : source;
1157
+ });
1158
+ this._names = ArraySet.fromArray(names.map(String), true);
1159
+ this._sources = ArraySet.fromArray(sources, true);
1160
+ this._absoluteSources = this._sources.toArray().map(function(s) {
1161
+ return util$1.computeSourceURL(sourceRoot, s, aSourceMapURL);
1162
+ });
1163
+ this.sourceRoot = sourceRoot;
1164
+ this.sourcesContent = sourcesContent;
1165
+ this._mappings = mappings;
1166
+ this._sourceMapURL = aSourceMapURL;
1167
+ this.file = file;
1168
+ }
1169
+ BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer$1.prototype);
1170
+ BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer$1;
1171
+ /**
1172
+ * Utility function to find the index of a source. Returns -1 if not
1173
+ * found.
1174
+ */
1175
+ BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
1176
+ var relativeSource = aSource;
1177
+ if (this.sourceRoot != null) relativeSource = util$1.relative(this.sourceRoot, relativeSource);
1178
+ if (this._sources.has(relativeSource)) return this._sources.indexOf(relativeSource);
1179
+ var i;
1180
+ for (i = 0; i < this._absoluteSources.length; ++i) if (this._absoluteSources[i] == aSource) return i;
1181
+ return -1;
1182
+ };
1183
+ /**
1184
+ * Create a BasicSourceMapConsumer from a SourceMapGenerator.
1185
+ *
1186
+ * @param SourceMapGenerator aSourceMap
1187
+ * The source map that will be consumed.
1188
+ * @param String aSourceMapURL
1189
+ * The URL at which the source map can be found (optional)
1190
+ * @returns BasicSourceMapConsumer
1191
+ */
1192
+ BasicSourceMapConsumer.fromSourceMap = function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
1193
+ var smc = Object.create(BasicSourceMapConsumer.prototype);
1194
+ var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
1195
+ var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
1196
+ smc.sourceRoot = aSourceMap._sourceRoot;
1197
+ smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), smc.sourceRoot);
1198
+ smc.file = aSourceMap._file;
1199
+ smc._sourceMapURL = aSourceMapURL;
1200
+ smc._absoluteSources = smc._sources.toArray().map(function(s) {
1201
+ return util$1.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
1202
+ });
1203
+ var generatedMappings = aSourceMap._mappings.toArray().slice();
1204
+ var destGeneratedMappings = smc.__generatedMappings = [];
1205
+ var destOriginalMappings = smc.__originalMappings = [];
1206
+ for (var i = 0, length = generatedMappings.length; i < length; i++) {
1207
+ var srcMapping = generatedMappings[i];
1208
+ var destMapping = new Mapping();
1209
+ destMapping.generatedLine = srcMapping.generatedLine;
1210
+ destMapping.generatedColumn = srcMapping.generatedColumn;
1211
+ if (srcMapping.source) {
1212
+ destMapping.source = sources.indexOf(srcMapping.source);
1213
+ destMapping.originalLine = srcMapping.originalLine;
1214
+ destMapping.originalColumn = srcMapping.originalColumn;
1215
+ if (srcMapping.name) destMapping.name = names.indexOf(srcMapping.name);
1216
+ destOriginalMappings.push(destMapping);
1217
+ }
1218
+ destGeneratedMappings.push(destMapping);
1219
+ }
1220
+ quickSort(smc.__originalMappings, util$1.compareByOriginalPositions);
1221
+ return smc;
1222
+ };
1223
+ /**
1224
+ * The version of the source mapping spec that we are consuming.
1225
+ */
1226
+ BasicSourceMapConsumer.prototype._version = 3;
1227
+ /**
1228
+ * The list of original sources.
1229
+ */
1230
+ Object.defineProperty(BasicSourceMapConsumer.prototype, "sources", { get: function() {
1231
+ return this._absoluteSources.slice();
1232
+ } });
1233
+ /**
1234
+ * Provide the JIT with a nice shape / hidden class.
1235
+ */
1236
+ function Mapping() {
1237
+ this.generatedLine = 0;
1238
+ this.generatedColumn = 0;
1239
+ this.source = null;
1240
+ this.originalLine = null;
1241
+ this.originalColumn = null;
1242
+ this.name = null;
1243
+ }
1244
+ /**
1245
+ * Parse the mappings in a string in to a data structure which we can easily
1246
+ * query (the ordered arrays in the `this.__generatedMappings` and
1247
+ * `this.__originalMappings` properties).
1248
+ */
1249
+ BasicSourceMapConsumer.prototype._parseMappings = function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
1250
+ var generatedLine = 1;
1251
+ var previousGeneratedColumn = 0;
1252
+ var previousOriginalLine = 0;
1253
+ var previousOriginalColumn = 0;
1254
+ var previousSource = 0;
1255
+ var previousName = 0;
1256
+ var length = aStr.length;
1257
+ var index = 0;
1258
+ var cachedSegments = {};
1259
+ var temp = {};
1260
+ var originalMappings = [];
1261
+ var generatedMappings = [];
1262
+ var mapping, str, segment, end, value;
1263
+ while (index < length) if (aStr.charAt(index) === ";") {
1264
+ generatedLine++;
1265
+ index++;
1266
+ previousGeneratedColumn = 0;
1267
+ } else if (aStr.charAt(index) === ",") index++;
1268
+ else {
1269
+ mapping = new Mapping();
1270
+ mapping.generatedLine = generatedLine;
1271
+ for (end = index; end < length; end++) if (this._charIsMappingSeparator(aStr, end)) break;
1272
+ str = aStr.slice(index, end);
1273
+ segment = cachedSegments[str];
1274
+ if (segment) index += str.length;
1275
+ else {
1276
+ segment = [];
1277
+ while (index < end) {
1278
+ base64VLQ.decode(aStr, index, temp);
1279
+ value = temp.value;
1280
+ index = temp.rest;
1281
+ segment.push(value);
1282
+ }
1283
+ if (segment.length === 2) throw new Error("Found a source, but no line and column");
1284
+ if (segment.length === 3) throw new Error("Found a source and line, but no column");
1285
+ cachedSegments[str] = segment;
1286
+ }
1287
+ mapping.generatedColumn = previousGeneratedColumn + segment[0];
1288
+ previousGeneratedColumn = mapping.generatedColumn;
1289
+ if (segment.length > 1) {
1290
+ mapping.source = previousSource + segment[1];
1291
+ previousSource += segment[1];
1292
+ mapping.originalLine = previousOriginalLine + segment[2];
1293
+ previousOriginalLine = mapping.originalLine;
1294
+ mapping.originalLine += 1;
1295
+ mapping.originalColumn = previousOriginalColumn + segment[3];
1296
+ previousOriginalColumn = mapping.originalColumn;
1297
+ if (segment.length > 4) {
1298
+ mapping.name = previousName + segment[4];
1299
+ previousName += segment[4];
1300
+ }
1301
+ }
1302
+ generatedMappings.push(mapping);
1303
+ if (typeof mapping.originalLine === "number") originalMappings.push(mapping);
1304
+ }
1305
+ quickSort(generatedMappings, util$1.compareByGeneratedPositionsDeflated);
1306
+ this.__generatedMappings = generatedMappings;
1307
+ quickSort(originalMappings, util$1.compareByOriginalPositions);
1308
+ this.__originalMappings = originalMappings;
1309
+ };
1310
+ /**
1311
+ * Find the mapping that best matches the hypothetical "needle" mapping that
1312
+ * we are searching for in the given "haystack" of mappings.
1313
+ */
1314
+ BasicSourceMapConsumer.prototype._findMapping = function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, aColumnName, aComparator, aBias) {
1315
+ if (aNeedle[aLineName] <= 0) throw new TypeError("Line must be greater than or equal to 1, got " + aNeedle[aLineName]);
1316
+ if (aNeedle[aColumnName] < 0) throw new TypeError("Column must be greater than or equal to 0, got " + aNeedle[aColumnName]);
1317
+ return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
1318
+ };
1319
+ /**
1320
+ * Compute the last column for each generated mapping. The last column is
1321
+ * inclusive.
1322
+ */
1323
+ BasicSourceMapConsumer.prototype.computeColumnSpans = function SourceMapConsumer_computeColumnSpans() {
1324
+ for (var index = 0; index < this._generatedMappings.length; ++index) {
1325
+ var mapping = this._generatedMappings[index];
1326
+ if (index + 1 < this._generatedMappings.length) {
1327
+ var nextMapping = this._generatedMappings[index + 1];
1328
+ if (mapping.generatedLine === nextMapping.generatedLine) {
1329
+ mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
1330
+ continue;
1331
+ }
1332
+ }
1333
+ mapping.lastGeneratedColumn = Infinity;
1334
+ }
1335
+ };
1336
+ /**
1337
+ * Returns the original source, line, and column information for the generated
1338
+ * source's line and column positions provided. The only argument is an object
1339
+ * with the following properties:
1340
+ *
1341
+ * - line: The line number in the generated source. The line number
1342
+ * is 1-based.
1343
+ * - column: The column number in the generated source. The column
1344
+ * number is 0-based.
1345
+ * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
1346
+ * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
1347
+ * closest element that is smaller than or greater than the one we are
1348
+ * searching for, respectively, if the exact element cannot be found.
1349
+ * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
1350
+ *
1351
+ * and an object is returned with the following properties:
1352
+ *
1353
+ * - source: The original source file, or null.
1354
+ * - line: The line number in the original source, or null. The
1355
+ * line number is 1-based.
1356
+ * - column: The column number in the original source, or null. The
1357
+ * column number is 0-based.
1358
+ * - name: The original identifier, or null.
1359
+ */
1360
+ BasicSourceMapConsumer.prototype.originalPositionFor = function SourceMapConsumer_originalPositionFor(aArgs) {
1361
+ var needle = {
1362
+ generatedLine: util$1.getArg(aArgs, "line"),
1363
+ generatedColumn: util$1.getArg(aArgs, "column")
1364
+ };
1365
+ var index = this._findMapping(needle, this._generatedMappings, "generatedLine", "generatedColumn", util$1.compareByGeneratedPositionsDeflated, util$1.getArg(aArgs, "bias", SourceMapConsumer$1.GREATEST_LOWER_BOUND));
1366
+ if (index >= 0) {
1367
+ var mapping = this._generatedMappings[index];
1368
+ if (mapping.generatedLine === needle.generatedLine) {
1369
+ var source = util$1.getArg(mapping, "source", null);
1370
+ if (source !== null) {
1371
+ source = this._sources.at(source);
1372
+ source = util$1.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
1373
+ }
1374
+ var name = util$1.getArg(mapping, "name", null);
1375
+ if (name !== null) name = this._names.at(name);
1376
+ return {
1377
+ source,
1378
+ line: util$1.getArg(mapping, "originalLine", null),
1379
+ column: util$1.getArg(mapping, "originalColumn", null),
1380
+ name
1381
+ };
1382
+ }
1383
+ }
1384
+ return {
1385
+ source: null,
1386
+ line: null,
1387
+ column: null,
1388
+ name: null
1389
+ };
1390
+ };
1391
+ /**
1392
+ * Return true if we have the source content for every source in the source
1393
+ * map, false otherwise.
1394
+ */
1395
+ BasicSourceMapConsumer.prototype.hasContentsOfAllSources = function BasicSourceMapConsumer_hasContentsOfAllSources() {
1396
+ if (!this.sourcesContent) return false;
1397
+ return this.sourcesContent.length >= this._sources.size() && !this.sourcesContent.some(function(sc) {
1398
+ return sc == null;
1399
+ });
1400
+ };
1401
+ /**
1402
+ * Returns the original source content. The only argument is the url of the
1403
+ * original source file. Returns null if no original source content is
1404
+ * available.
1405
+ */
1406
+ BasicSourceMapConsumer.prototype.sourceContentFor = function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
1407
+ if (!this.sourcesContent) return null;
1408
+ var index = this._findSourceIndex(aSource);
1409
+ if (index >= 0) return this.sourcesContent[index];
1410
+ var relativeSource = aSource;
1411
+ if (this.sourceRoot != null) relativeSource = util$1.relative(this.sourceRoot, relativeSource);
1412
+ var url;
1413
+ if (this.sourceRoot != null && (url = util$1.urlParse(this.sourceRoot))) {
1414
+ var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
1415
+ if (url.scheme == "file" && this._sources.has(fileUriAbsPath)) return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)];
1416
+ if ((!url.path || url.path == "/") && this._sources.has("/" + relativeSource)) return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
1417
+ }
1418
+ if (nullOnMissing) return null;
1419
+ else throw new Error("\"" + relativeSource + "\" is not in the SourceMap.");
1420
+ };
1421
+ /**
1422
+ * Returns the generated line and column information for the original source,
1423
+ * line, and column positions provided. The only argument is an object with
1424
+ * the following properties:
1425
+ *
1426
+ * - source: The filename of the original source.
1427
+ * - line: The line number in the original source. The line number
1428
+ * is 1-based.
1429
+ * - column: The column number in the original source. The column
1430
+ * number is 0-based.
1431
+ * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
1432
+ * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
1433
+ * closest element that is smaller than or greater than the one we are
1434
+ * searching for, respectively, if the exact element cannot be found.
1435
+ * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
1436
+ *
1437
+ * and an object is returned with the following properties:
1438
+ *
1439
+ * - line: The line number in the generated source, or null. The
1440
+ * line number is 1-based.
1441
+ * - column: The column number in the generated source, or null.
1442
+ * The column number is 0-based.
1443
+ */
1444
+ BasicSourceMapConsumer.prototype.generatedPositionFor = function SourceMapConsumer_generatedPositionFor(aArgs) {
1445
+ var source = util$1.getArg(aArgs, "source");
1446
+ source = this._findSourceIndex(source);
1447
+ if (source < 0) return {
1448
+ line: null,
1449
+ column: null,
1450
+ lastColumn: null
1451
+ };
1452
+ var needle = {
1453
+ source,
1454
+ originalLine: util$1.getArg(aArgs, "line"),
1455
+ originalColumn: util$1.getArg(aArgs, "column")
1456
+ };
1457
+ var index = this._findMapping(needle, this._originalMappings, "originalLine", "originalColumn", util$1.compareByOriginalPositions, util$1.getArg(aArgs, "bias", SourceMapConsumer$1.GREATEST_LOWER_BOUND));
1458
+ if (index >= 0) {
1459
+ var mapping = this._originalMappings[index];
1460
+ if (mapping.source === needle.source) return {
1461
+ line: util$1.getArg(mapping, "generatedLine", null),
1462
+ column: util$1.getArg(mapping, "generatedColumn", null),
1463
+ lastColumn: util$1.getArg(mapping, "lastGeneratedColumn", null)
1464
+ };
1465
+ }
1466
+ return {
1467
+ line: null,
1468
+ column: null,
1469
+ lastColumn: null
1470
+ };
1471
+ };
1472
+ exports.BasicSourceMapConsumer = BasicSourceMapConsumer;
1473
+ /**
1474
+ * An IndexedSourceMapConsumer instance represents a parsed source map which
1475
+ * we can query for information. It differs from BasicSourceMapConsumer in
1476
+ * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
1477
+ * input.
1478
+ *
1479
+ * The first parameter is a raw source map (either as a JSON string, or already
1480
+ * parsed to an object). According to the spec for indexed source maps, they
1481
+ * have the following attributes:
1482
+ *
1483
+ * - version: Which version of the source map spec this map is following.
1484
+ * - file: Optional. The generated file this source map is associated with.
1485
+ * - sections: A list of section definitions.
1486
+ *
1487
+ * Each value under the "sections" field has two fields:
1488
+ * - offset: The offset into the original specified at which this section
1489
+ * begins to apply, defined as an object with a "line" and "column"
1490
+ * field.
1491
+ * - map: A source map definition. This source map could also be indexed,
1492
+ * but doesn't have to be.
1493
+ *
1494
+ * Instead of the "map" field, it's also possible to have a "url" field
1495
+ * specifying a URL to retrieve a source map from, but that's currently
1496
+ * unsupported.
1497
+ *
1498
+ * Here's an example source map, taken from the source map spec[0], but
1499
+ * modified to omit a section which uses the "url" field.
1500
+ *
1501
+ * {
1502
+ * version : 3,
1503
+ * file: "app.js",
1504
+ * sections: [{
1505
+ * offset: {line:100, column:10},
1506
+ * map: {
1507
+ * version : 3,
1508
+ * file: "section.js",
1509
+ * sources: ["foo.js", "bar.js"],
1510
+ * names: ["src", "maps", "are", "fun"],
1511
+ * mappings: "AAAA,E;;ABCDE;"
1512
+ * }
1513
+ * }],
1514
+ * }
1515
+ *
1516
+ * The second parameter, if given, is a string whose value is the URL
1517
+ * at which the source map was found. This URL is used to compute the
1518
+ * sources array.
1519
+ *
1520
+ * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
1521
+ */
1522
+ function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
1523
+ var sourceMap = aSourceMap;
1524
+ if (typeof aSourceMap === "string") sourceMap = util$1.parseSourceMapInput(aSourceMap);
1525
+ var version = util$1.getArg(sourceMap, "version");
1526
+ var sections = util$1.getArg(sourceMap, "sections");
1527
+ if (version != this._version) throw new Error("Unsupported version: " + version);
1528
+ this._sources = new ArraySet();
1529
+ this._names = new ArraySet();
1530
+ var lastOffset = {
1531
+ line: -1,
1532
+ column: 0
1533
+ };
1534
+ this._sections = sections.map(function(s) {
1535
+ if (s.url) throw new Error("Support for url field in sections not implemented.");
1536
+ var offset = util$1.getArg(s, "offset");
1537
+ var offsetLine = util$1.getArg(offset, "line");
1538
+ var offsetColumn = util$1.getArg(offset, "column");
1539
+ if (offsetLine < lastOffset.line || offsetLine === lastOffset.line && offsetColumn < lastOffset.column) throw new Error("Section offsets must be ordered and non-overlapping.");
1540
+ lastOffset = offset;
1541
+ return {
1542
+ generatedOffset: {
1543
+ generatedLine: offsetLine + 1,
1544
+ generatedColumn: offsetColumn + 1
1545
+ },
1546
+ consumer: new SourceMapConsumer$1(util$1.getArg(s, "map"), aSourceMapURL)
1547
+ };
1548
+ });
1549
+ }
1550
+ IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer$1.prototype);
1551
+ IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer$1;
1552
+ /**
1553
+ * The version of the source mapping spec that we are consuming.
1554
+ */
1555
+ IndexedSourceMapConsumer.prototype._version = 3;
1556
+ /**
1557
+ * The list of original sources.
1558
+ */
1559
+ Object.defineProperty(IndexedSourceMapConsumer.prototype, "sources", { get: function() {
1560
+ var sources = [];
1561
+ for (var i = 0; i < this._sections.length; i++) for (var j = 0; j < this._sections[i].consumer.sources.length; j++) sources.push(this._sections[i].consumer.sources[j]);
1562
+ return sources;
1563
+ } });
1564
+ /**
1565
+ * Returns the original source, line, and column information for the generated
1566
+ * source's line and column positions provided. The only argument is an object
1567
+ * with the following properties:
1568
+ *
1569
+ * - line: The line number in the generated source. The line number
1570
+ * is 1-based.
1571
+ * - column: The column number in the generated source. The column
1572
+ * number is 0-based.
1573
+ *
1574
+ * and an object is returned with the following properties:
1575
+ *
1576
+ * - source: The original source file, or null.
1577
+ * - line: The line number in the original source, or null. The
1578
+ * line number is 1-based.
1579
+ * - column: The column number in the original source, or null. The
1580
+ * column number is 0-based.
1581
+ * - name: The original identifier, or null.
1582
+ */
1583
+ IndexedSourceMapConsumer.prototype.originalPositionFor = function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
1584
+ var needle = {
1585
+ generatedLine: util$1.getArg(aArgs, "line"),
1586
+ generatedColumn: util$1.getArg(aArgs, "column")
1587
+ };
1588
+ var sectionIndex = binarySearch.search(needle, this._sections, function(needle$1, section$1) {
1589
+ var cmp = needle$1.generatedLine - section$1.generatedOffset.generatedLine;
1590
+ if (cmp) return cmp;
1591
+ return needle$1.generatedColumn - section$1.generatedOffset.generatedColumn;
1592
+ });
1593
+ var section = this._sections[sectionIndex];
1594
+ if (!section) return {
1595
+ source: null,
1596
+ line: null,
1597
+ column: null,
1598
+ name: null
1599
+ };
1600
+ return section.consumer.originalPositionFor({
1601
+ line: needle.generatedLine - (section.generatedOffset.generatedLine - 1),
1602
+ column: needle.generatedColumn - (section.generatedOffset.generatedLine === needle.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
1603
+ bias: aArgs.bias
1604
+ });
1605
+ };
1606
+ /**
1607
+ * Return true if we have the source content for every source in the source
1608
+ * map, false otherwise.
1609
+ */
1610
+ IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = function IndexedSourceMapConsumer_hasContentsOfAllSources() {
1611
+ return this._sections.every(function(s) {
1612
+ return s.consumer.hasContentsOfAllSources();
1613
+ });
1614
+ };
1615
+ /**
1616
+ * Returns the original source content. The only argument is the url of the
1617
+ * original source file. Returns null if no original source content is
1618
+ * available.
1619
+ */
1620
+ IndexedSourceMapConsumer.prototype.sourceContentFor = function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
1621
+ for (var i = 0; i < this._sections.length; i++) {
1622
+ var section = this._sections[i];
1623
+ var content = section.consumer.sourceContentFor(aSource, true);
1624
+ if (content) return content;
1625
+ }
1626
+ if (nullOnMissing) return null;
1627
+ else throw new Error("\"" + aSource + "\" is not in the SourceMap.");
1628
+ };
1629
+ /**
1630
+ * Returns the generated line and column information for the original source,
1631
+ * line, and column positions provided. The only argument is an object with
1632
+ * the following properties:
1633
+ *
1634
+ * - source: The filename of the original source.
1635
+ * - line: The line number in the original source. The line number
1636
+ * is 1-based.
1637
+ * - column: The column number in the original source. The column
1638
+ * number is 0-based.
1639
+ *
1640
+ * and an object is returned with the following properties:
1641
+ *
1642
+ * - line: The line number in the generated source, or null. The
1643
+ * line number is 1-based.
1644
+ * - column: The column number in the generated source, or null.
1645
+ * The column number is 0-based.
1646
+ */
1647
+ IndexedSourceMapConsumer.prototype.generatedPositionFor = function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
1648
+ for (var i = 0; i < this._sections.length; i++) {
1649
+ var section = this._sections[i];
1650
+ if (section.consumer._findSourceIndex(util$1.getArg(aArgs, "source")) === -1) continue;
1651
+ var generatedPosition = section.consumer.generatedPositionFor(aArgs);
1652
+ if (generatedPosition) {
1653
+ var ret = {
1654
+ line: generatedPosition.line + (section.generatedOffset.generatedLine - 1),
1655
+ column: generatedPosition.column + (section.generatedOffset.generatedLine === generatedPosition.line ? section.generatedOffset.generatedColumn - 1 : 0)
1656
+ };
1657
+ return ret;
1658
+ }
1659
+ }
1660
+ return {
1661
+ line: null,
1662
+ column: null
1663
+ };
1664
+ };
1665
+ /**
1666
+ * Parse the mappings in a string in to a data structure which we can easily
1667
+ * query (the ordered arrays in the `this.__generatedMappings` and
1668
+ * `this.__originalMappings` properties).
1669
+ */
1670
+ IndexedSourceMapConsumer.prototype._parseMappings = function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
1671
+ this.__generatedMappings = [];
1672
+ this.__originalMappings = [];
1673
+ for (var i = 0; i < this._sections.length; i++) {
1674
+ var section = this._sections[i];
1675
+ var sectionMappings = section.consumer._generatedMappings;
1676
+ for (var j = 0; j < sectionMappings.length; j++) {
1677
+ var mapping = sectionMappings[j];
1678
+ var source = section.consumer._sources.at(mapping.source);
1679
+ source = util$1.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
1680
+ this._sources.add(source);
1681
+ source = this._sources.indexOf(source);
1682
+ var name = null;
1683
+ if (mapping.name) {
1684
+ name = section.consumer._names.at(mapping.name);
1685
+ this._names.add(name);
1686
+ name = this._names.indexOf(name);
1687
+ }
1688
+ var adjustedMapping = {
1689
+ source,
1690
+ generatedLine: mapping.generatedLine + (section.generatedOffset.generatedLine - 1),
1691
+ generatedColumn: mapping.generatedColumn + (section.generatedOffset.generatedLine === mapping.generatedLine ? section.generatedOffset.generatedColumn - 1 : 0),
1692
+ originalLine: mapping.originalLine,
1693
+ originalColumn: mapping.originalColumn,
1694
+ name
1695
+ };
1696
+ this.__generatedMappings.push(adjustedMapping);
1697
+ if (typeof adjustedMapping.originalLine === "number") this.__originalMappings.push(adjustedMapping);
1698
+ }
1699
+ }
1700
+ quickSort(this.__generatedMappings, util$1.compareByGeneratedPositionsDeflated);
1701
+ quickSort(this.__originalMappings, util$1.compareByOriginalPositions);
1702
+ };
1703
+ exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
1704
+ } });
1705
+
1706
+ //#endregion
1707
+ //#region ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-node.js
1708
+ var require_source_node = __commonJS({ "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/lib/source-node.js"(exports) {
1709
+ var SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
1710
+ var util = require_util();
1711
+ var REGEX_NEWLINE = /(\r?\n)/;
1712
+ var NEWLINE_CODE = 10;
1713
+ var isSourceNode = "$$$isSourceNode$$$";
1714
+ /**
1715
+ * SourceNodes provide a way to abstract over interpolating/concatenating
1716
+ * snippets of generated JavaScript source code while maintaining the line and
1717
+ * column information associated with the original source code.
1718
+ *
1719
+ * @param aLine The original line number.
1720
+ * @param aColumn The original column number.
1721
+ * @param aSource The original source's filename.
1722
+ * @param aChunks Optional. An array of strings which are snippets of
1723
+ * generated JS, or other SourceNodes.
1724
+ * @param aName The original identifier.
1725
+ */
1726
+ function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
1727
+ this.children = [];
1728
+ this.sourceContents = {};
1729
+ this.line = aLine == null ? null : aLine;
1730
+ this.column = aColumn == null ? null : aColumn;
1731
+ this.source = aSource == null ? null : aSource;
1732
+ this.name = aName == null ? null : aName;
1733
+ this[isSourceNode] = true;
1734
+ if (aChunks != null) this.add(aChunks);
1735
+ }
1736
+ /**
1737
+ * Creates a SourceNode from generated code and a SourceMapConsumer.
1738
+ *
1739
+ * @param aGeneratedCode The generated code
1740
+ * @param aSourceMapConsumer The SourceMap for the generated code
1741
+ * @param aRelativePath Optional. The path that relative sources in the
1742
+ * SourceMapConsumer should be relative to.
1743
+ */
1744
+ SourceNode.fromStringWithSourceMap = function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
1745
+ var node = new SourceNode();
1746
+ var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
1747
+ var remainingLinesIndex = 0;
1748
+ var shiftNextLine = function() {
1749
+ var lineContents = getNextLine();
1750
+ var newLine = getNextLine() || "";
1751
+ return lineContents + newLine;
1752
+ function getNextLine() {
1753
+ return remainingLinesIndex < remainingLines.length ? remainingLines[remainingLinesIndex++] : void 0;
1754
+ }
1755
+ };
1756
+ var lastGeneratedLine = 1, lastGeneratedColumn = 0;
1757
+ var lastMapping = null;
1758
+ aSourceMapConsumer.eachMapping(function(mapping) {
1759
+ if (lastMapping !== null) if (lastGeneratedLine < mapping.generatedLine) {
1760
+ addMappingWithCode(lastMapping, shiftNextLine());
1761
+ lastGeneratedLine++;
1762
+ lastGeneratedColumn = 0;
1763
+ } else {
1764
+ var nextLine = remainingLines[remainingLinesIndex] || "";
1765
+ var code = nextLine.substr(0, mapping.generatedColumn - lastGeneratedColumn);
1766
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn - lastGeneratedColumn);
1767
+ lastGeneratedColumn = mapping.generatedColumn;
1768
+ addMappingWithCode(lastMapping, code);
1769
+ lastMapping = mapping;
1770
+ return;
1771
+ }
1772
+ while (lastGeneratedLine < mapping.generatedLine) {
1773
+ node.add(shiftNextLine());
1774
+ lastGeneratedLine++;
1775
+ }
1776
+ if (lastGeneratedColumn < mapping.generatedColumn) {
1777
+ var nextLine = remainingLines[remainingLinesIndex] || "";
1778
+ node.add(nextLine.substr(0, mapping.generatedColumn));
1779
+ remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
1780
+ lastGeneratedColumn = mapping.generatedColumn;
1781
+ }
1782
+ lastMapping = mapping;
1783
+ }, this);
1784
+ if (remainingLinesIndex < remainingLines.length) {
1785
+ if (lastMapping) addMappingWithCode(lastMapping, shiftNextLine());
1786
+ node.add(remainingLines.splice(remainingLinesIndex).join(""));
1787
+ }
1788
+ aSourceMapConsumer.sources.forEach(function(sourceFile) {
1789
+ var content = aSourceMapConsumer.sourceContentFor(sourceFile);
1790
+ if (content != null) {
1791
+ if (aRelativePath != null) sourceFile = util.join(aRelativePath, sourceFile);
1792
+ node.setSourceContent(sourceFile, content);
1793
+ }
1794
+ });
1795
+ return node;
1796
+ function addMappingWithCode(mapping, code) {
1797
+ if (mapping === null || mapping.source === void 0) node.add(code);
1798
+ else {
1799
+ var source = aRelativePath ? util.join(aRelativePath, mapping.source) : mapping.source;
1800
+ node.add(new SourceNode(mapping.originalLine, mapping.originalColumn, source, code, mapping.name));
1801
+ }
1802
+ }
1803
+ };
1804
+ /**
1805
+ * Add a chunk of generated JS to this source node.
1806
+ *
1807
+ * @param aChunk A string snippet of generated JS code, another instance of
1808
+ * SourceNode, or an array where each member is one of those things.
1809
+ */
1810
+ SourceNode.prototype.add = function SourceNode_add(aChunk) {
1811
+ if (Array.isArray(aChunk)) aChunk.forEach(function(chunk) {
1812
+ this.add(chunk);
1813
+ }, this);
1814
+ else if (aChunk[isSourceNode] || typeof aChunk === "string") {
1815
+ if (aChunk) this.children.push(aChunk);
1816
+ } else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
1817
+ return this;
1818
+ };
1819
+ /**
1820
+ * Add a chunk of generated JS to the beginning of this source node.
1821
+ *
1822
+ * @param aChunk A string snippet of generated JS code, another instance of
1823
+ * SourceNode, or an array where each member is one of those things.
1824
+ */
1825
+ SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
1826
+ if (Array.isArray(aChunk)) for (var i = aChunk.length - 1; i >= 0; i--) this.prepend(aChunk[i]);
1827
+ else if (aChunk[isSourceNode] || typeof aChunk === "string") this.children.unshift(aChunk);
1828
+ else throw new TypeError("Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk);
1829
+ return this;
1830
+ };
1831
+ /**
1832
+ * Walk over the tree of JS snippets in this node and its children. The
1833
+ * walking function is called once for each snippet of JS and is passed that
1834
+ * snippet and the its original associated source's line/column location.
1835
+ *
1836
+ * @param aFn The traversal function.
1837
+ */
1838
+ SourceNode.prototype.walk = function SourceNode_walk(aFn) {
1839
+ var chunk;
1840
+ for (var i = 0, len = this.children.length; i < len; i++) {
1841
+ chunk = this.children[i];
1842
+ if (chunk[isSourceNode]) chunk.walk(aFn);
1843
+ else if (chunk !== "") aFn(chunk, {
1844
+ source: this.source,
1845
+ line: this.line,
1846
+ column: this.column,
1847
+ name: this.name
1848
+ });
1849
+ }
1850
+ };
1851
+ /**
1852
+ * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
1853
+ * each of `this.children`.
1854
+ *
1855
+ * @param aSep The separator.
1856
+ */
1857
+ SourceNode.prototype.join = function SourceNode_join(aSep) {
1858
+ var newChildren;
1859
+ var i;
1860
+ var len = this.children.length;
1861
+ if (len > 0) {
1862
+ newChildren = [];
1863
+ for (i = 0; i < len - 1; i++) {
1864
+ newChildren.push(this.children[i]);
1865
+ newChildren.push(aSep);
1866
+ }
1867
+ newChildren.push(this.children[i]);
1868
+ this.children = newChildren;
1869
+ }
1870
+ return this;
1871
+ };
1872
+ /**
1873
+ * Call String.prototype.replace on the very right-most source snippet. Useful
1874
+ * for trimming whitespace from the end of a source node, etc.
1875
+ *
1876
+ * @param aPattern The pattern to replace.
1877
+ * @param aReplacement The thing to replace the pattern with.
1878
+ */
1879
+ SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
1880
+ var lastChild = this.children[this.children.length - 1];
1881
+ if (lastChild[isSourceNode]) lastChild.replaceRight(aPattern, aReplacement);
1882
+ else if (typeof lastChild === "string") this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
1883
+ else this.children.push("".replace(aPattern, aReplacement));
1884
+ return this;
1885
+ };
1886
+ /**
1887
+ * Set the source content for a source file. This will be added to the SourceMapGenerator
1888
+ * in the sourcesContent field.
1889
+ *
1890
+ * @param aSourceFile The filename of the source file
1891
+ * @param aSourceContent The content of the source file
1892
+ */
1893
+ SourceNode.prototype.setSourceContent = function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
1894
+ this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
1895
+ };
1896
+ /**
1897
+ * Walk over the tree of SourceNodes. The walking function is called for each
1898
+ * source file content and is passed the filename and source content.
1899
+ *
1900
+ * @param aFn The traversal function.
1901
+ */
1902
+ SourceNode.prototype.walkSourceContents = function SourceNode_walkSourceContents(aFn) {
1903
+ for (var i = 0, len = this.children.length; i < len; i++) if (this.children[i][isSourceNode]) this.children[i].walkSourceContents(aFn);
1904
+ var sources = Object.keys(this.sourceContents);
1905
+ for (var i = 0, len = sources.length; i < len; i++) aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
1906
+ };
1907
+ /**
1908
+ * Return the string representation of this source node. Walks over the tree
1909
+ * and concatenates all the various snippets together to one string.
1910
+ */
1911
+ SourceNode.prototype.toString = function SourceNode_toString() {
1912
+ var str = "";
1913
+ this.walk(function(chunk) {
1914
+ str += chunk;
1915
+ });
1916
+ return str;
1917
+ };
1918
+ /**
1919
+ * Returns the string representation of this source node along with a source
1920
+ * map.
1921
+ */
1922
+ SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
1923
+ var generated = {
1924
+ code: "",
1925
+ line: 1,
1926
+ column: 0
1927
+ };
1928
+ var map = new SourceMapGenerator(aArgs);
1929
+ var sourceMappingActive = false;
1930
+ var lastOriginalSource = null;
1931
+ var lastOriginalLine = null;
1932
+ var lastOriginalColumn = null;
1933
+ var lastOriginalName = null;
1934
+ this.walk(function(chunk, original) {
1935
+ generated.code += chunk;
1936
+ if (original.source !== null && original.line !== null && original.column !== null) {
1937
+ if (lastOriginalSource !== original.source || lastOriginalLine !== original.line || lastOriginalColumn !== original.column || lastOriginalName !== original.name) map.addMapping({
1938
+ source: original.source,
1939
+ original: {
1940
+ line: original.line,
1941
+ column: original.column
1942
+ },
1943
+ generated: {
1944
+ line: generated.line,
1945
+ column: generated.column
1946
+ },
1947
+ name: original.name
1948
+ });
1949
+ lastOriginalSource = original.source;
1950
+ lastOriginalLine = original.line;
1951
+ lastOriginalColumn = original.column;
1952
+ lastOriginalName = original.name;
1953
+ sourceMappingActive = true;
1954
+ } else if (sourceMappingActive) {
1955
+ map.addMapping({ generated: {
1956
+ line: generated.line,
1957
+ column: generated.column
1958
+ } });
1959
+ lastOriginalSource = null;
1960
+ sourceMappingActive = false;
1961
+ }
1962
+ for (var idx = 0, length = chunk.length; idx < length; idx++) if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
1963
+ generated.line++;
1964
+ generated.column = 0;
1965
+ if (idx + 1 === length) {
1966
+ lastOriginalSource = null;
1967
+ sourceMappingActive = false;
1968
+ } else if (sourceMappingActive) map.addMapping({
1969
+ source: original.source,
1970
+ original: {
1971
+ line: original.line,
1972
+ column: original.column
1973
+ },
1974
+ generated: {
1975
+ line: generated.line,
1976
+ column: generated.column
1977
+ },
1978
+ name: original.name
1979
+ });
1980
+ } else generated.column++;
1981
+ });
1982
+ this.walkSourceContents(function(sourceFile, sourceContent) {
1983
+ map.setSourceContent(sourceFile, sourceContent);
1984
+ });
1985
+ return {
1986
+ code: generated.code,
1987
+ map
1988
+ };
1989
+ };
1990
+ exports.SourceNode = SourceNode;
1991
+ } });
1992
+
1993
+ //#endregion
1994
+ //#region ../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/source-map.js
1995
+ var require_source_map = __commonJS({ "../../node_modules/.pnpm/source-map@0.6.1/node_modules/source-map/source-map.js"(exports) {
1996
+ exports.SourceMapGenerator = require_source_map_generator().SourceMapGenerator;
1997
+ exports.SourceMapConsumer = require_source_map_consumer().SourceMapConsumer;
1998
+ exports.SourceNode = require_source_node().SourceNode;
1999
+ } });
2000
+
2001
+ //#endregion
2002
+ //#region ../../node_modules/.pnpm/buffer-from@1.1.2/node_modules/buffer-from/index.js
2003
+ var require_buffer_from = __commonJS({ "../../node_modules/.pnpm/buffer-from@1.1.2/node_modules/buffer-from/index.js"(exports, module) {
2004
+ var toString = Object.prototype.toString;
2005
+ var isModern = typeof Buffer !== "undefined" && typeof Buffer.alloc === "function" && typeof Buffer.allocUnsafe === "function" && typeof Buffer.from === "function";
2006
+ function isArrayBuffer(input) {
2007
+ return toString.call(input).slice(8, -1) === "ArrayBuffer";
2008
+ }
2009
+ function fromArrayBuffer(obj, byteOffset, length) {
2010
+ byteOffset >>>= 0;
2011
+ var maxLength = obj.byteLength - byteOffset;
2012
+ if (maxLength < 0) throw new RangeError("'offset' is out of bounds");
2013
+ if (length === void 0) length = maxLength;
2014
+ else {
2015
+ length >>>= 0;
2016
+ if (length > maxLength) throw new RangeError("'length' is out of bounds");
2017
+ }
2018
+ return isModern ? Buffer.from(obj.slice(byteOffset, byteOffset + length)) : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)));
2019
+ }
2020
+ function fromString(string, encoding) {
2021
+ if (typeof encoding !== "string" || encoding === "") encoding = "utf8";
2022
+ if (!Buffer.isEncoding(encoding)) throw new TypeError("\"encoding\" must be a valid string encoding");
2023
+ return isModern ? Buffer.from(string, encoding) : new Buffer(string, encoding);
2024
+ }
2025
+ function bufferFrom$1(value, encodingOrOffset, length) {
2026
+ if (typeof value === "number") throw new TypeError("\"value\" argument must not be a number");
2027
+ if (isArrayBuffer(value)) return fromArrayBuffer(value, encodingOrOffset, length);
2028
+ if (typeof value === "string") return fromString(value, encodingOrOffset);
2029
+ return isModern ? Buffer.from(value) : new Buffer(value);
2030
+ }
2031
+ module.exports = bufferFrom$1;
2032
+ } });
2033
+
2034
+ //#endregion
2035
+ //#region ../../node_modules/.pnpm/source-map-support@0.5.21/node_modules/source-map-support/source-map-support.js
2036
+ var require_source_map_support = __commonJS({ "../../node_modules/.pnpm/source-map-support@0.5.21/node_modules/source-map-support/source-map-support.js"(exports, module) {
2037
+ var SourceMapConsumer = require_source_map().SourceMapConsumer;
2038
+ var path = __require("path");
2039
+ var fs;
2040
+ try {
2041
+ fs = __require("fs");
2042
+ if (!fs.existsSync || !fs.readFileSync) fs = null;
2043
+ } catch (err) {}
2044
+ var bufferFrom = require_buffer_from();
2045
+ /**
2046
+ * Requires a module which is protected against bundler minification.
2047
+ *
2048
+ * @param {NodeModule} mod
2049
+ * @param {string} request
2050
+ */
2051
+ function dynamicRequire(mod, request) {
2052
+ return mod.require(request);
2053
+ }
2054
+ var errorFormatterInstalled = false;
2055
+ var uncaughtShimInstalled = false;
2056
+ var emptyCacheBetweenOperations = false;
2057
+ var environment = "auto";
2058
+ var fileContentsCache = {};
2059
+ var sourceMapCache = {};
2060
+ var reSourceMap = /^data:application\/json[^,]+base64,/;
2061
+ var retrieveFileHandlers = [];
2062
+ var retrieveMapHandlers = [];
2063
+ function isInBrowser() {
2064
+ if (environment === "browser") return true;
2065
+ if (environment === "node") return false;
2066
+ return typeof window !== "undefined" && typeof XMLHttpRequest === "function" && !(window.require && window.module && window.process && window.process.type === "renderer");
2067
+ }
2068
+ function hasGlobalProcessEventEmitter() {
2069
+ return typeof process === "object" && process !== null && typeof process.on === "function";
2070
+ }
2071
+ function globalProcessVersion() {
2072
+ if (typeof process === "object" && process !== null) return process.version;
2073
+ else return "";
2074
+ }
2075
+ function globalProcessStderr() {
2076
+ if (typeof process === "object" && process !== null) return process.stderr;
2077
+ }
2078
+ function globalProcessExit(code) {
2079
+ if (typeof process === "object" && process !== null && typeof process.exit === "function") return process.exit(code);
2080
+ }
2081
+ function handlerExec(list) {
2082
+ return function(arg) {
2083
+ for (var i = 0; i < list.length; i++) {
2084
+ var ret = list[i](arg);
2085
+ if (ret) return ret;
2086
+ }
2087
+ return null;
2088
+ };
2089
+ }
2090
+ var retrieveFile = handlerExec(retrieveFileHandlers);
2091
+ retrieveFileHandlers.push(function(path$1) {
2092
+ path$1 = path$1.trim();
2093
+ if (/^file:/.test(path$1)) path$1 = path$1.replace(/file:\/\/\/(\w:)?/, function(protocol, drive) {
2094
+ return drive ? "" : "/";
2095
+ });
2096
+ if (path$1 in fileContentsCache) return fileContentsCache[path$1];
2097
+ var contents = "";
2098
+ try {
2099
+ if (!fs) {
2100
+ var xhr = new XMLHttpRequest();
2101
+ xhr.open(
2102
+ "GET",
2103
+ path$1,
2104
+ /** async */
2105
+ false
2106
+ );
2107
+ xhr.send(null);
2108
+ if (xhr.readyState === 4 && xhr.status === 200) contents = xhr.responseText;
2109
+ } else if (fs.existsSync(path$1)) contents = fs.readFileSync(path$1, "utf8");
2110
+ } catch (er) {}
2111
+ return fileContentsCache[path$1] = contents;
2112
+ });
2113
+ function supportRelativeURL(file, url) {
2114
+ if (!file) return url;
2115
+ var dir = path.dirname(file);
2116
+ var match = /^\w+:\/\/[^\/]*/.exec(dir);
2117
+ var protocol = match ? match[0] : "";
2118
+ var startPath = dir.slice(protocol.length);
2119
+ if (protocol && /^\/\w\:/.test(startPath)) {
2120
+ protocol += "/";
2121
+ return protocol + path.resolve(dir.slice(protocol.length), url).replace(/\\/g, "/");
2122
+ }
2123
+ return protocol + path.resolve(dir.slice(protocol.length), url);
2124
+ }
2125
+ function retrieveSourceMapURL(source) {
2126
+ var fileData;
2127
+ if (isInBrowser()) try {
2128
+ var xhr = new XMLHttpRequest();
2129
+ xhr.open("GET", source, false);
2130
+ xhr.send(null);
2131
+ fileData = xhr.readyState === 4 ? xhr.responseText : null;
2132
+ var sourceMapHeader = xhr.getResponseHeader("SourceMap") || xhr.getResponseHeader("X-SourceMap");
2133
+ if (sourceMapHeader) return sourceMapHeader;
2134
+ } catch (e) {}
2135
+ fileData = retrieveFile(source);
2136
+ var re = /(?:\/\/[@#][\s]*sourceMappingURL=([^\s'"]+)[\s]*$)|(?:\/\*[@#][\s]*sourceMappingURL=([^\s*'"]+)[\s]*(?:\*\/)[\s]*$)/gm;
2137
+ var lastMatch, match;
2138
+ while (match = re.exec(fileData)) lastMatch = match;
2139
+ if (!lastMatch) return null;
2140
+ return lastMatch[1];
2141
+ }
2142
+ var retrieveSourceMap = handlerExec(retrieveMapHandlers);
2143
+ retrieveMapHandlers.push(function(source) {
2144
+ var sourceMappingURL = retrieveSourceMapURL(source);
2145
+ if (!sourceMappingURL) return null;
2146
+ var sourceMapData;
2147
+ if (reSourceMap.test(sourceMappingURL)) {
2148
+ var rawData = sourceMappingURL.slice(sourceMappingURL.indexOf(",") + 1);
2149
+ sourceMapData = bufferFrom(rawData, "base64").toString();
2150
+ sourceMappingURL = source;
2151
+ } else {
2152
+ sourceMappingURL = supportRelativeURL(source, sourceMappingURL);
2153
+ sourceMapData = retrieveFile(sourceMappingURL);
2154
+ }
2155
+ if (!sourceMapData) return null;
2156
+ return {
2157
+ url: sourceMappingURL,
2158
+ map: sourceMapData
2159
+ };
2160
+ });
2161
+ function mapSourcePosition(position) {
2162
+ var sourceMap = sourceMapCache[position.source];
2163
+ if (!sourceMap) {
2164
+ var urlAndMap = retrieveSourceMap(position.source);
2165
+ if (urlAndMap) {
2166
+ sourceMap = sourceMapCache[position.source] = {
2167
+ url: urlAndMap.url,
2168
+ map: new SourceMapConsumer(urlAndMap.map)
2169
+ };
2170
+ if (sourceMap.map.sourcesContent) sourceMap.map.sources.forEach(function(source, i) {
2171
+ var contents = sourceMap.map.sourcesContent[i];
2172
+ if (contents) {
2173
+ var url = supportRelativeURL(sourceMap.url, source);
2174
+ fileContentsCache[url] = contents;
2175
+ }
2176
+ });
2177
+ } else sourceMap = sourceMapCache[position.source] = {
2178
+ url: null,
2179
+ map: null
2180
+ };
2181
+ }
2182
+ if (sourceMap && sourceMap.map && typeof sourceMap.map.originalPositionFor === "function") {
2183
+ var originalPosition = sourceMap.map.originalPositionFor(position);
2184
+ if (originalPosition.source !== null) {
2185
+ originalPosition.source = supportRelativeURL(sourceMap.url, originalPosition.source);
2186
+ return originalPosition;
2187
+ }
2188
+ }
2189
+ return position;
2190
+ }
2191
+ function mapEvalOrigin(origin) {
2192
+ var match = /^eval at ([^(]+) \((.+):(\d+):(\d+)\)$/.exec(origin);
2193
+ if (match) {
2194
+ var position = mapSourcePosition({
2195
+ source: match[2],
2196
+ line: +match[3],
2197
+ column: match[4] - 1
2198
+ });
2199
+ return "eval at " + match[1] + " (" + position.source + ":" + position.line + ":" + (position.column + 1) + ")";
2200
+ }
2201
+ match = /^eval at ([^(]+) \((.+)\)$/.exec(origin);
2202
+ if (match) return "eval at " + match[1] + " (" + mapEvalOrigin(match[2]) + ")";
2203
+ return origin;
2204
+ }
2205
+ function CallSiteToString() {
2206
+ var fileName;
2207
+ var fileLocation = "";
2208
+ if (this.isNative()) fileLocation = "native";
2209
+ else {
2210
+ fileName = this.getScriptNameOrSourceURL();
2211
+ if (!fileName && this.isEval()) {
2212
+ fileLocation = this.getEvalOrigin();
2213
+ fileLocation += ", ";
2214
+ }
2215
+ if (fileName) fileLocation += fileName;
2216
+ else fileLocation += "<anonymous>";
2217
+ var lineNumber = this.getLineNumber();
2218
+ if (lineNumber != null) {
2219
+ fileLocation += ":" + lineNumber;
2220
+ var columnNumber = this.getColumnNumber();
2221
+ if (columnNumber) fileLocation += ":" + columnNumber;
2222
+ }
2223
+ }
2224
+ var line = "";
2225
+ var functionName = this.getFunctionName();
2226
+ var addSuffix = true;
2227
+ var isConstructor = this.isConstructor();
2228
+ var isMethodCall = !(this.isToplevel() || isConstructor);
2229
+ if (isMethodCall) {
2230
+ var typeName = this.getTypeName();
2231
+ if (typeName === "[object Object]") typeName = "null";
2232
+ var methodName = this.getMethodName();
2233
+ if (functionName) {
2234
+ if (typeName && functionName.indexOf(typeName) != 0) line += typeName + ".";
2235
+ line += functionName;
2236
+ if (methodName && functionName.indexOf("." + methodName) != functionName.length - methodName.length - 1) line += " [as " + methodName + "]";
2237
+ } else line += typeName + "." + (methodName || "<anonymous>");
2238
+ } else if (isConstructor) line += "new " + (functionName || "<anonymous>");
2239
+ else if (functionName) line += functionName;
2240
+ else {
2241
+ line += fileLocation;
2242
+ addSuffix = false;
2243
+ }
2244
+ if (addSuffix) line += " (" + fileLocation + ")";
2245
+ return line;
2246
+ }
2247
+ function cloneCallSite(frame) {
2248
+ var object = {};
2249
+ Object.getOwnPropertyNames(Object.getPrototypeOf(frame)).forEach(function(name) {
2250
+ object[name] = /^(?:is|get)/.test(name) ? function() {
2251
+ return frame[name].call(frame);
2252
+ } : frame[name];
2253
+ });
2254
+ object.toString = CallSiteToString;
2255
+ return object;
2256
+ }
2257
+ function wrapCallSite(frame, state) {
2258
+ if (state === void 0) state = {
2259
+ nextPosition: null,
2260
+ curPosition: null
2261
+ };
2262
+ if (frame.isNative()) {
2263
+ state.curPosition = null;
2264
+ return frame;
2265
+ }
2266
+ var source = frame.getFileName() || frame.getScriptNameOrSourceURL();
2267
+ if (source) {
2268
+ var line = frame.getLineNumber();
2269
+ var column = frame.getColumnNumber() - 1;
2270
+ var noHeader = /^v(10\.1[6-9]|10\.[2-9][0-9]|10\.[0-9]{3,}|1[2-9]\d*|[2-9]\d|\d{3,}|11\.11)/;
2271
+ var headerLength = noHeader.test(globalProcessVersion()) ? 0 : 62;
2272
+ if (line === 1 && column > headerLength && !isInBrowser() && !frame.isEval()) column -= headerLength;
2273
+ var position = mapSourcePosition({
2274
+ source,
2275
+ line,
2276
+ column
2277
+ });
2278
+ state.curPosition = position;
2279
+ frame = cloneCallSite(frame);
2280
+ var originalFunctionName = frame.getFunctionName;
2281
+ frame.getFunctionName = function() {
2282
+ if (state.nextPosition == null) return originalFunctionName();
2283
+ return state.nextPosition.name || originalFunctionName();
2284
+ };
2285
+ frame.getFileName = function() {
2286
+ return position.source;
2287
+ };
2288
+ frame.getLineNumber = function() {
2289
+ return position.line;
2290
+ };
2291
+ frame.getColumnNumber = function() {
2292
+ return position.column + 1;
2293
+ };
2294
+ frame.getScriptNameOrSourceURL = function() {
2295
+ return position.source;
2296
+ };
2297
+ return frame;
2298
+ }
2299
+ var origin = frame.isEval() && frame.getEvalOrigin();
2300
+ if (origin) {
2301
+ origin = mapEvalOrigin(origin);
2302
+ frame = cloneCallSite(frame);
2303
+ frame.getEvalOrigin = function() {
2304
+ return origin;
2305
+ };
2306
+ return frame;
2307
+ }
2308
+ return frame;
2309
+ }
2310
+ function prepareStackTrace(error, stack) {
2311
+ if (emptyCacheBetweenOperations) {
2312
+ fileContentsCache = {};
2313
+ sourceMapCache = {};
2314
+ }
2315
+ var name = error.name || "Error";
2316
+ var message = error.message || "";
2317
+ var errorString = name + ": " + message;
2318
+ var state = {
2319
+ nextPosition: null,
2320
+ curPosition: null
2321
+ };
2322
+ var processedStack = [];
2323
+ for (var i = stack.length - 1; i >= 0; i--) {
2324
+ processedStack.push("\n at " + wrapCallSite(stack[i], state));
2325
+ state.nextPosition = state.curPosition;
2326
+ }
2327
+ state.curPosition = state.nextPosition = null;
2328
+ return errorString + processedStack.reverse().join("");
2329
+ }
2330
+ function getErrorSource(error) {
2331
+ var match = /\n at [^(]+ \((.*):(\d+):(\d+)\)/.exec(error.stack);
2332
+ if (match) {
2333
+ var source = match[1];
2334
+ var line = +match[2];
2335
+ var column = +match[3];
2336
+ var contents = fileContentsCache[source];
2337
+ if (!contents && fs && fs.existsSync(source)) try {
2338
+ contents = fs.readFileSync(source, "utf8");
2339
+ } catch (er) {
2340
+ contents = "";
2341
+ }
2342
+ if (contents) {
2343
+ var code = contents.split(/(?:\r\n|\r|\n)/)[line - 1];
2344
+ if (code) return source + ":" + line + "\n" + code + "\n" + new Array(column).join(" ") + "^";
2345
+ }
2346
+ }
2347
+ return null;
2348
+ }
2349
+ function printErrorAndExit(error) {
2350
+ var source = getErrorSource(error);
2351
+ var stderr = globalProcessStderr();
2352
+ if (stderr && stderr._handle && stderr._handle.setBlocking) stderr._handle.setBlocking(true);
2353
+ if (source) {
2354
+ console.error();
2355
+ console.error(source);
2356
+ }
2357
+ console.error(error.stack);
2358
+ globalProcessExit(1);
2359
+ }
2360
+ function shimEmitUncaughtException() {
2361
+ var origEmit = process.emit;
2362
+ process.emit = function(type) {
2363
+ if (type === "uncaughtException") {
2364
+ var hasStack = arguments[1] && arguments[1].stack;
2365
+ var hasListeners = this.listeners(type).length > 0;
2366
+ if (hasStack && !hasListeners) return printErrorAndExit(arguments[1]);
2367
+ }
2368
+ return origEmit.apply(this, arguments);
2369
+ };
2370
+ }
2371
+ var originalRetrieveFileHandlers = retrieveFileHandlers.slice(0);
2372
+ var originalRetrieveMapHandlers = retrieveMapHandlers.slice(0);
2373
+ exports.wrapCallSite = wrapCallSite;
2374
+ exports.getErrorSource = getErrorSource;
2375
+ exports.mapSourcePosition = mapSourcePosition;
2376
+ exports.retrieveSourceMap = retrieveSourceMap;
2377
+ exports.install = function(options) {
2378
+ options = options || {};
2379
+ if (options.environment) {
2380
+ environment = options.environment;
2381
+ if ([
2382
+ "node",
2383
+ "browser",
2384
+ "auto"
2385
+ ].indexOf(environment) === -1) throw new Error("environment " + environment + " was unknown. Available options are {auto, browser, node}");
2386
+ }
2387
+ if (options.retrieveFile) {
2388
+ if (options.overrideRetrieveFile) retrieveFileHandlers.length = 0;
2389
+ retrieveFileHandlers.unshift(options.retrieveFile);
2390
+ }
2391
+ if (options.retrieveSourceMap) {
2392
+ if (options.overrideRetrieveSourceMap) retrieveMapHandlers.length = 0;
2393
+ retrieveMapHandlers.unshift(options.retrieveSourceMap);
2394
+ }
2395
+ if (options.hookRequire && !isInBrowser()) {
2396
+ var Module = dynamicRequire(module, "module");
2397
+ var $compile = Module.prototype._compile;
2398
+ if (!$compile.__sourceMapSupport) {
2399
+ Module.prototype._compile = function(content, filename) {
2400
+ fileContentsCache[filename] = content;
2401
+ sourceMapCache[filename] = void 0;
2402
+ return $compile.call(this, content, filename);
2403
+ };
2404
+ Module.prototype._compile.__sourceMapSupport = true;
2405
+ }
2406
+ }
2407
+ if (!emptyCacheBetweenOperations) emptyCacheBetweenOperations = "emptyCacheBetweenOperations" in options ? options.emptyCacheBetweenOperations : false;
2408
+ if (!errorFormatterInstalled) {
2409
+ errorFormatterInstalled = true;
2410
+ Error.prepareStackTrace = prepareStackTrace;
2411
+ }
2412
+ if (!uncaughtShimInstalled) {
2413
+ var installHandler = "handleUncaughtExceptions" in options ? options.handleUncaughtExceptions : true;
2414
+ try {
2415
+ var worker_threads = dynamicRequire(module, "worker_threads");
2416
+ if (worker_threads.isMainThread === false) installHandler = false;
2417
+ } catch (e) {}
2418
+ if (installHandler && hasGlobalProcessEventEmitter()) {
2419
+ uncaughtShimInstalled = true;
2420
+ shimEmitUncaughtException();
2421
+ }
2422
+ }
2423
+ };
2424
+ exports.resetRetrieveHandlers = function() {
2425
+ retrieveFileHandlers.length = 0;
2426
+ retrieveMapHandlers.length = 0;
2427
+ retrieveFileHandlers = originalRetrieveFileHandlers.slice(0);
2428
+ retrieveMapHandlers = originalRetrieveMapHandlers.slice(0);
2429
+ retrieveSourceMap = handlerExec(retrieveMapHandlers);
2430
+ retrieveFile = handlerExec(retrieveFileHandlers);
2431
+ };
2432
+ } });
2433
+
2434
+ //#endregion
2435
+ export default require_source_map_support();