plslog 1.1.0 → 1.1.1

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.
package/dist/index.js CHANGED
@@ -1,12 +1,1365 @@
1
1
  'use strict';
2
2
 
3
- var prettyFormat = require('pretty-format');
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __commonJS = (cb, mod) => function __require() {
10
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ __defProp(target, "default", { value: mod, enumerable: true }) ,
26
+ mod
27
+ ));
28
+
29
+ // ../../node_modules/.pnpm/react-is@18.3.1/node_modules/react-is/cjs/react-is.production.min.js
30
+ var require_react_is_production_min = __commonJS({
31
+ "../../node_modules/.pnpm/react-is@18.3.1/node_modules/react-is/cjs/react-is.production.min.js"(exports$1) {
32
+ var b = /* @__PURE__ */ Symbol.for("react.element");
33
+ var c = /* @__PURE__ */ Symbol.for("react.portal");
34
+ var d = /* @__PURE__ */ Symbol.for("react.fragment");
35
+ var e = /* @__PURE__ */ Symbol.for("react.strict_mode");
36
+ var f = /* @__PURE__ */ Symbol.for("react.profiler");
37
+ var g = /* @__PURE__ */ Symbol.for("react.provider");
38
+ var h = /* @__PURE__ */ Symbol.for("react.context");
39
+ var k = /* @__PURE__ */ Symbol.for("react.server_context");
40
+ var l = /* @__PURE__ */ Symbol.for("react.forward_ref");
41
+ var m = /* @__PURE__ */ Symbol.for("react.suspense");
42
+ var n = /* @__PURE__ */ Symbol.for("react.suspense_list");
43
+ var p = /* @__PURE__ */ Symbol.for("react.memo");
44
+ var q = /* @__PURE__ */ Symbol.for("react.lazy");
45
+ var t = /* @__PURE__ */ Symbol.for("react.offscreen");
46
+ var u;
47
+ u = /* @__PURE__ */ Symbol.for("react.module.reference");
48
+ function v(a) {
49
+ if ("object" === typeof a && null !== a) {
50
+ var r = a.$$typeof;
51
+ switch (r) {
52
+ case b:
53
+ switch (a = a.type, a) {
54
+ case d:
55
+ case f:
56
+ case e:
57
+ case m:
58
+ case n:
59
+ return a;
60
+ default:
61
+ switch (a = a && a.$$typeof, a) {
62
+ case k:
63
+ case h:
64
+ case l:
65
+ case q:
66
+ case p:
67
+ case g:
68
+ return a;
69
+ default:
70
+ return r;
71
+ }
72
+ }
73
+ case c:
74
+ return r;
75
+ }
76
+ }
77
+ }
78
+ exports$1.ContextConsumer = h;
79
+ exports$1.ContextProvider = g;
80
+ exports$1.Element = b;
81
+ exports$1.ForwardRef = l;
82
+ exports$1.Fragment = d;
83
+ exports$1.Lazy = q;
84
+ exports$1.Memo = p;
85
+ exports$1.Portal = c;
86
+ exports$1.Profiler = f;
87
+ exports$1.StrictMode = e;
88
+ exports$1.Suspense = m;
89
+ exports$1.SuspenseList = n;
90
+ exports$1.isAsyncMode = function() {
91
+ return false;
92
+ };
93
+ exports$1.isConcurrentMode = function() {
94
+ return false;
95
+ };
96
+ exports$1.isContextConsumer = function(a) {
97
+ return v(a) === h;
98
+ };
99
+ exports$1.isContextProvider = function(a) {
100
+ return v(a) === g;
101
+ };
102
+ exports$1.isElement = function(a) {
103
+ return "object" === typeof a && null !== a && a.$$typeof === b;
104
+ };
105
+ exports$1.isForwardRef = function(a) {
106
+ return v(a) === l;
107
+ };
108
+ exports$1.isFragment = function(a) {
109
+ return v(a) === d;
110
+ };
111
+ exports$1.isLazy = function(a) {
112
+ return v(a) === q;
113
+ };
114
+ exports$1.isMemo = function(a) {
115
+ return v(a) === p;
116
+ };
117
+ exports$1.isPortal = function(a) {
118
+ return v(a) === c;
119
+ };
120
+ exports$1.isProfiler = function(a) {
121
+ return v(a) === f;
122
+ };
123
+ exports$1.isStrictMode = function(a) {
124
+ return v(a) === e;
125
+ };
126
+ exports$1.isSuspense = function(a) {
127
+ return v(a) === m;
128
+ };
129
+ exports$1.isSuspenseList = function(a) {
130
+ return v(a) === n;
131
+ };
132
+ exports$1.isValidElementType = function(a) {
133
+ return "string" === typeof a || "function" === typeof a || a === d || a === f || a === e || a === m || a === n || a === t || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === u || void 0 !== a.getModuleId) ? true : false;
134
+ };
135
+ exports$1.typeOf = v;
136
+ }
137
+ });
138
+
139
+ // ../../node_modules/.pnpm/react-is@18.3.1/node_modules/react-is/cjs/react-is.development.js
140
+ var require_react_is_development = __commonJS({
141
+ "../../node_modules/.pnpm/react-is@18.3.1/node_modules/react-is/cjs/react-is.development.js"(exports$1) {
142
+ if (process.env.NODE_ENV !== "production") {
143
+ (function() {
144
+ var REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element");
145
+ var REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal");
146
+ var REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment");
147
+ var REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode");
148
+ var REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler");
149
+ var REACT_PROVIDER_TYPE = /* @__PURE__ */ Symbol.for("react.provider");
150
+ var REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context");
151
+ var REACT_SERVER_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.server_context");
152
+ var REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref");
153
+ var REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense");
154
+ var REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list");
155
+ var REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo");
156
+ var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
157
+ var REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for("react.offscreen");
158
+ var enableScopeAPI = false;
159
+ var enableCacheElement = false;
160
+ var enableTransitionTracing = false;
161
+ var enableLegacyHidden = false;
162
+ var enableDebugTracing = false;
163
+ var REACT_MODULE_REFERENCE;
164
+ {
165
+ REACT_MODULE_REFERENCE = /* @__PURE__ */ Symbol.for("react.module.reference");
166
+ }
167
+ function isValidElementType(type) {
168
+ if (typeof type === "string" || typeof type === "function") {
169
+ return true;
170
+ }
171
+ if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing) {
172
+ return true;
173
+ }
174
+ if (typeof type === "object" && type !== null) {
175
+ if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
176
+ // types supported by any Flight configuration anywhere since
177
+ // we don't know which Flight build this will end up being used
178
+ // with.
179
+ type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
180
+ return true;
181
+ }
182
+ }
183
+ return false;
184
+ }
185
+ function typeOf(object) {
186
+ if (typeof object === "object" && object !== null) {
187
+ var $$typeof = object.$$typeof;
188
+ switch ($$typeof) {
189
+ case REACT_ELEMENT_TYPE:
190
+ var type = object.type;
191
+ switch (type) {
192
+ case REACT_FRAGMENT_TYPE:
193
+ case REACT_PROFILER_TYPE:
194
+ case REACT_STRICT_MODE_TYPE:
195
+ case REACT_SUSPENSE_TYPE:
196
+ case REACT_SUSPENSE_LIST_TYPE:
197
+ return type;
198
+ default:
199
+ var $$typeofType = type && type.$$typeof;
200
+ switch ($$typeofType) {
201
+ case REACT_SERVER_CONTEXT_TYPE:
202
+ case REACT_CONTEXT_TYPE:
203
+ case REACT_FORWARD_REF_TYPE:
204
+ case REACT_LAZY_TYPE:
205
+ case REACT_MEMO_TYPE:
206
+ case REACT_PROVIDER_TYPE:
207
+ return $$typeofType;
208
+ default:
209
+ return $$typeof;
210
+ }
211
+ }
212
+ case REACT_PORTAL_TYPE:
213
+ return $$typeof;
214
+ }
215
+ }
216
+ return void 0;
217
+ }
218
+ var ContextConsumer = REACT_CONTEXT_TYPE;
219
+ var ContextProvider = REACT_PROVIDER_TYPE;
220
+ var Element = REACT_ELEMENT_TYPE;
221
+ var ForwardRef = REACT_FORWARD_REF_TYPE;
222
+ var Fragment = REACT_FRAGMENT_TYPE;
223
+ var Lazy = REACT_LAZY_TYPE;
224
+ var Memo = REACT_MEMO_TYPE;
225
+ var Portal = REACT_PORTAL_TYPE;
226
+ var Profiler = REACT_PROFILER_TYPE;
227
+ var StrictMode = REACT_STRICT_MODE_TYPE;
228
+ var Suspense = REACT_SUSPENSE_TYPE;
229
+ var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
230
+ var hasWarnedAboutDeprecatedIsAsyncMode = false;
231
+ var hasWarnedAboutDeprecatedIsConcurrentMode = false;
232
+ function isAsyncMode(object) {
233
+ {
234
+ if (!hasWarnedAboutDeprecatedIsAsyncMode) {
235
+ hasWarnedAboutDeprecatedIsAsyncMode = true;
236
+ console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.");
237
+ }
238
+ }
239
+ return false;
240
+ }
241
+ function isConcurrentMode(object) {
242
+ {
243
+ if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
244
+ hasWarnedAboutDeprecatedIsConcurrentMode = true;
245
+ console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.");
246
+ }
247
+ }
248
+ return false;
249
+ }
250
+ function isContextConsumer(object) {
251
+ return typeOf(object) === REACT_CONTEXT_TYPE;
252
+ }
253
+ function isContextProvider(object) {
254
+ return typeOf(object) === REACT_PROVIDER_TYPE;
255
+ }
256
+ function isElement(object) {
257
+ return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
258
+ }
259
+ function isForwardRef(object) {
260
+ return typeOf(object) === REACT_FORWARD_REF_TYPE;
261
+ }
262
+ function isFragment(object) {
263
+ return typeOf(object) === REACT_FRAGMENT_TYPE;
264
+ }
265
+ function isLazy(object) {
266
+ return typeOf(object) === REACT_LAZY_TYPE;
267
+ }
268
+ function isMemo(object) {
269
+ return typeOf(object) === REACT_MEMO_TYPE;
270
+ }
271
+ function isPortal(object) {
272
+ return typeOf(object) === REACT_PORTAL_TYPE;
273
+ }
274
+ function isProfiler(object) {
275
+ return typeOf(object) === REACT_PROFILER_TYPE;
276
+ }
277
+ function isStrictMode(object) {
278
+ return typeOf(object) === REACT_STRICT_MODE_TYPE;
279
+ }
280
+ function isSuspense(object) {
281
+ return typeOf(object) === REACT_SUSPENSE_TYPE;
282
+ }
283
+ function isSuspenseList(object) {
284
+ return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
285
+ }
286
+ exports$1.ContextConsumer = ContextConsumer;
287
+ exports$1.ContextProvider = ContextProvider;
288
+ exports$1.Element = Element;
289
+ exports$1.ForwardRef = ForwardRef;
290
+ exports$1.Fragment = Fragment;
291
+ exports$1.Lazy = Lazy;
292
+ exports$1.Memo = Memo;
293
+ exports$1.Portal = Portal;
294
+ exports$1.Profiler = Profiler;
295
+ exports$1.StrictMode = StrictMode;
296
+ exports$1.Suspense = Suspense;
297
+ exports$1.SuspenseList = SuspenseList;
298
+ exports$1.isAsyncMode = isAsyncMode;
299
+ exports$1.isConcurrentMode = isConcurrentMode;
300
+ exports$1.isContextConsumer = isContextConsumer;
301
+ exports$1.isContextProvider = isContextProvider;
302
+ exports$1.isElement = isElement;
303
+ exports$1.isForwardRef = isForwardRef;
304
+ exports$1.isFragment = isFragment;
305
+ exports$1.isLazy = isLazy;
306
+ exports$1.isMemo = isMemo;
307
+ exports$1.isPortal = isPortal;
308
+ exports$1.isProfiler = isProfiler;
309
+ exports$1.isStrictMode = isStrictMode;
310
+ exports$1.isSuspense = isSuspense;
311
+ exports$1.isSuspenseList = isSuspenseList;
312
+ exports$1.isValidElementType = isValidElementType;
313
+ exports$1.typeOf = typeOf;
314
+ })();
315
+ }
316
+ }
317
+ });
318
+
319
+ // ../../node_modules/.pnpm/react-is@18.3.1/node_modules/react-is/index.js
320
+ var require_react_is = __commonJS({
321
+ "../../node_modules/.pnpm/react-is@18.3.1/node_modules/react-is/index.js"(exports$1, module) {
322
+ if (process.env.NODE_ENV === "production") {
323
+ module.exports = require_react_is_production_min();
324
+ } else {
325
+ module.exports = require_react_is_development();
326
+ }
327
+ }
328
+ });
329
+
330
+ // ../../node_modules/.pnpm/ansi-styles@5.2.0/node_modules/ansi-styles/index.js
331
+ var require_ansi_styles = __commonJS({
332
+ "../../node_modules/.pnpm/ansi-styles@5.2.0/node_modules/ansi-styles/index.js"(exports$1, module) {
333
+ var ANSI_BACKGROUND_OFFSET = 10;
334
+ var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
335
+ var wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
336
+ function assembleStyles() {
337
+ const codes = /* @__PURE__ */ new Map();
338
+ const styles = {
339
+ modifier: {
340
+ reset: [0, 0],
341
+ // 21 isn't widely supported and 22 does the same thing
342
+ bold: [1, 22],
343
+ dim: [2, 22],
344
+ italic: [3, 23],
345
+ underline: [4, 24],
346
+ overline: [53, 55],
347
+ inverse: [7, 27],
348
+ hidden: [8, 28],
349
+ strikethrough: [9, 29]
350
+ },
351
+ color: {
352
+ black: [30, 39],
353
+ red: [31, 39],
354
+ green: [32, 39],
355
+ yellow: [33, 39],
356
+ blue: [34, 39],
357
+ magenta: [35, 39],
358
+ cyan: [36, 39],
359
+ white: [37, 39],
360
+ // Bright color
361
+ blackBright: [90, 39],
362
+ redBright: [91, 39],
363
+ greenBright: [92, 39],
364
+ yellowBright: [93, 39],
365
+ blueBright: [94, 39],
366
+ magentaBright: [95, 39],
367
+ cyanBright: [96, 39],
368
+ whiteBright: [97, 39]
369
+ },
370
+ bgColor: {
371
+ bgBlack: [40, 49],
372
+ bgRed: [41, 49],
373
+ bgGreen: [42, 49],
374
+ bgYellow: [43, 49],
375
+ bgBlue: [44, 49],
376
+ bgMagenta: [45, 49],
377
+ bgCyan: [46, 49],
378
+ bgWhite: [47, 49],
379
+ // Bright color
380
+ bgBlackBright: [100, 49],
381
+ bgRedBright: [101, 49],
382
+ bgGreenBright: [102, 49],
383
+ bgYellowBright: [103, 49],
384
+ bgBlueBright: [104, 49],
385
+ bgMagentaBright: [105, 49],
386
+ bgCyanBright: [106, 49],
387
+ bgWhiteBright: [107, 49]
388
+ }
389
+ };
390
+ styles.color.gray = styles.color.blackBright;
391
+ styles.bgColor.bgGray = styles.bgColor.bgBlackBright;
392
+ styles.color.grey = styles.color.blackBright;
393
+ styles.bgColor.bgGrey = styles.bgColor.bgBlackBright;
394
+ for (const [groupName, group] of Object.entries(styles)) {
395
+ for (const [styleName, style] of Object.entries(group)) {
396
+ styles[styleName] = {
397
+ open: `\x1B[${style[0]}m`,
398
+ close: `\x1B[${style[1]}m`
399
+ };
400
+ group[styleName] = styles[styleName];
401
+ codes.set(style[0], style[1]);
402
+ }
403
+ Object.defineProperty(styles, groupName, {
404
+ value: group,
405
+ enumerable: false
406
+ });
407
+ }
408
+ Object.defineProperty(styles, "codes", {
409
+ value: codes,
410
+ enumerable: false
411
+ });
412
+ styles.color.close = "\x1B[39m";
413
+ styles.bgColor.close = "\x1B[49m";
414
+ styles.color.ansi256 = wrapAnsi256();
415
+ styles.color.ansi16m = wrapAnsi16m();
416
+ styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
417
+ styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
418
+ Object.defineProperties(styles, {
419
+ rgbToAnsi256: {
420
+ value: (red, green, blue) => {
421
+ if (red === green && green === blue) {
422
+ if (red < 8) {
423
+ return 16;
424
+ }
425
+ if (red > 248) {
426
+ return 231;
427
+ }
428
+ return Math.round((red - 8) / 247 * 24) + 232;
429
+ }
430
+ return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
431
+ },
432
+ enumerable: false
433
+ },
434
+ hexToRgb: {
435
+ value: (hex) => {
436
+ const matches = /(?<colorString>[a-f\d]{6}|[a-f\d]{3})/i.exec(hex.toString(16));
437
+ if (!matches) {
438
+ return [0, 0, 0];
439
+ }
440
+ let { colorString } = matches.groups;
441
+ if (colorString.length === 3) {
442
+ colorString = colorString.split("").map((character) => character + character).join("");
443
+ }
444
+ const integer = Number.parseInt(colorString, 16);
445
+ return [
446
+ integer >> 16 & 255,
447
+ integer >> 8 & 255,
448
+ integer & 255
449
+ ];
450
+ },
451
+ enumerable: false
452
+ },
453
+ hexToAnsi256: {
454
+ value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
455
+ enumerable: false
456
+ }
457
+ });
458
+ return styles;
459
+ }
460
+ Object.defineProperty(module, "exports", {
461
+ enumerable: true,
462
+ get: assembleStyles
463
+ });
464
+ }
465
+ });
466
+
467
+ // ../../node_modules/.pnpm/pretty-format@30.2.0/node_modules/pretty-format/build/index.js
468
+ var require_build = __commonJS({
469
+ "../../node_modules/.pnpm/pretty-format@30.2.0/node_modules/pretty-format/build/index.js"(exports$1, module) {
470
+ (() => {
471
+ var __webpack_modules__ = {
472
+ /***/
473
+ "./src/collections.ts": (
474
+ /***/
475
+ ((__unused_webpack_module, exports2) => {
476
+ Object.defineProperty(exports2, "__esModule", {
477
+ value: true
478
+ });
479
+ exports2.printIteratorEntries = printIteratorEntries;
480
+ exports2.printIteratorValues = printIteratorValues;
481
+ exports2.printListItems = printListItems;
482
+ exports2.printObjectProperties = printObjectProperties;
483
+ const getKeysOfEnumerableProperties = (object, compareKeys) => {
484
+ const rawKeys = Object.keys(object);
485
+ const keys = compareKeys === null ? rawKeys : rawKeys.sort(compareKeys);
486
+ if (Object.getOwnPropertySymbols) {
487
+ for (const symbol of Object.getOwnPropertySymbols(object)) {
488
+ if (Object.getOwnPropertyDescriptor(object, symbol).enumerable) {
489
+ keys.push(symbol);
490
+ }
491
+ }
492
+ }
493
+ return keys;
494
+ };
495
+ function printIteratorEntries(iterator, config, indentation, depth, refs, printer, separator = ": ") {
496
+ let result = "";
497
+ let width = 0;
498
+ let current = iterator.next();
499
+ if (!current.done) {
500
+ result += config.spacingOuter;
501
+ const indentationNext = indentation + config.indent;
502
+ while (!current.done) {
503
+ result += indentationNext;
504
+ if (width++ === config.maxWidth) {
505
+ result += "\u2026";
506
+ break;
507
+ }
508
+ const name = printer(current.value[0], config, indentationNext, depth, refs);
509
+ const value = printer(current.value[1], config, indentationNext, depth, refs);
510
+ result += name + separator + value;
511
+ current = iterator.next();
512
+ if (!current.done) {
513
+ result += `,${config.spacingInner}`;
514
+ } else if (!config.min) {
515
+ result += ",";
516
+ }
517
+ }
518
+ result += config.spacingOuter + indentation;
519
+ }
520
+ return result;
521
+ }
522
+ function printIteratorValues(iterator, config, indentation, depth, refs, printer) {
523
+ let result = "";
524
+ let width = 0;
525
+ let current = iterator.next();
526
+ if (!current.done) {
527
+ result += config.spacingOuter;
528
+ const indentationNext = indentation + config.indent;
529
+ while (!current.done) {
530
+ result += indentationNext;
531
+ if (width++ === config.maxWidth) {
532
+ result += "\u2026";
533
+ break;
534
+ }
535
+ result += printer(current.value, config, indentationNext, depth, refs);
536
+ current = iterator.next();
537
+ if (!current.done) {
538
+ result += `,${config.spacingInner}`;
539
+ } else if (!config.min) {
540
+ result += ",";
541
+ }
542
+ }
543
+ result += config.spacingOuter + indentation;
544
+ }
545
+ return result;
546
+ }
547
+ function printListItems(list, config, indentation, depth, refs, printer) {
548
+ let result = "";
549
+ list = list instanceof ArrayBuffer ? new DataView(list) : list;
550
+ const isDataView = (l) => l instanceof DataView;
551
+ const length = isDataView(list) ? list.byteLength : list.length;
552
+ if (length > 0) {
553
+ result += config.spacingOuter;
554
+ const indentationNext = indentation + config.indent;
555
+ for (let i = 0; i < length; i++) {
556
+ result += indentationNext;
557
+ if (i === config.maxWidth) {
558
+ result += "\u2026";
559
+ break;
560
+ }
561
+ if (isDataView(list) || i in list) {
562
+ result += printer(isDataView(list) ? list.getInt8(i) : list[i], config, indentationNext, depth, refs);
563
+ }
564
+ if (i < length - 1) {
565
+ result += `,${config.spacingInner}`;
566
+ } else if (!config.min) {
567
+ result += ",";
568
+ }
569
+ }
570
+ result += config.spacingOuter + indentation;
571
+ }
572
+ return result;
573
+ }
574
+ function printObjectProperties(val, config, indentation, depth, refs, printer) {
575
+ let result = "";
576
+ const keys = getKeysOfEnumerableProperties(val, config.compareKeys);
577
+ if (keys.length > 0) {
578
+ result += config.spacingOuter;
579
+ const indentationNext = indentation + config.indent;
580
+ for (let i = 0; i < keys.length; i++) {
581
+ const key = keys[i];
582
+ const name = printer(key, config, indentationNext, depth, refs);
583
+ const value = printer(val[key], config, indentationNext, depth, refs);
584
+ result += `${indentationNext + name}: ${value}`;
585
+ if (i < keys.length - 1) {
586
+ result += `,${config.spacingInner}`;
587
+ } else if (!config.min) {
588
+ result += ",";
589
+ }
590
+ }
591
+ result += config.spacingOuter + indentation;
592
+ }
593
+ return result;
594
+ }
595
+ })
596
+ ),
597
+ /***/
598
+ "./src/plugins/AsymmetricMatcher.ts": (
599
+ /***/
600
+ ((__unused_webpack_module, exports2, __webpack_require__2) => {
601
+ Object.defineProperty(exports2, "__esModule", {
602
+ value: true
603
+ });
604
+ exports2.test = exports2.serialize = exports2["default"] = void 0;
605
+ var _collections = __webpack_require__2("./src/collections.ts");
606
+ var Symbol2 = globalThis["jest-symbol-do-not-touch"] || globalThis.Symbol;
607
+ const asymmetricMatcher = typeof Symbol2 === "function" && Symbol2.for ? Symbol2.for("jest.asymmetricMatcher") : 1267621;
608
+ const SPACE = " ";
609
+ const serialize = (val, config, indentation, depth, refs, printer) => {
610
+ const stringedValue = val.toString();
611
+ if (stringedValue === "ArrayContaining" || stringedValue === "ArrayNotContaining") {
612
+ if (++depth > config.maxDepth) {
613
+ return `[${stringedValue}]`;
614
+ }
615
+ return `${stringedValue + SPACE}[${(0, _collections.printListItems)(val.sample, config, indentation, depth, refs, printer)}]`;
616
+ }
617
+ if (stringedValue === "ObjectContaining" || stringedValue === "ObjectNotContaining") {
618
+ if (++depth > config.maxDepth) {
619
+ return `[${stringedValue}]`;
620
+ }
621
+ return `${stringedValue + SPACE}{${(0, _collections.printObjectProperties)(val.sample, config, indentation, depth, refs, printer)}}`;
622
+ }
623
+ if (stringedValue === "StringMatching" || stringedValue === "StringNotMatching") {
624
+ return stringedValue + SPACE + printer(val.sample, config, indentation, depth, refs);
625
+ }
626
+ if (stringedValue === "StringContaining" || stringedValue === "StringNotContaining") {
627
+ return stringedValue + SPACE + printer(val.sample, config, indentation, depth, refs);
628
+ }
629
+ if (stringedValue === "ArrayOf" || stringedValue === "NotArrayOf") {
630
+ if (++depth > config.maxDepth) {
631
+ return `[${stringedValue}]`;
632
+ }
633
+ return `${stringedValue + SPACE}${printer(val.sample, config, indentation, depth, refs)}`;
634
+ }
635
+ if (typeof val.toAsymmetricMatcher !== "function") {
636
+ throw new TypeError(`Asymmetric matcher ${val.constructor.name} does not implement toAsymmetricMatcher()`);
637
+ }
638
+ return val.toAsymmetricMatcher();
639
+ };
640
+ exports2.serialize = serialize;
641
+ const test = (val) => val && val.$$typeof === asymmetricMatcher;
642
+ exports2.test = test;
643
+ const plugin = {
644
+ serialize,
645
+ test
646
+ };
647
+ exports2["default"] = plugin;
648
+ })
649
+ ),
650
+ /***/
651
+ "./src/plugins/DOMCollection.ts": (
652
+ /***/
653
+ ((__unused_webpack_module, exports2, __webpack_require__2) => {
654
+ Object.defineProperty(exports2, "__esModule", {
655
+ value: true
656
+ });
657
+ exports2.test = exports2.serialize = exports2["default"] = void 0;
658
+ var _collections = __webpack_require__2("./src/collections.ts");
659
+ const SPACE = " ";
660
+ const OBJECT_NAMES = /* @__PURE__ */ new Set(["DOMStringMap", "NamedNodeMap"]);
661
+ const ARRAY_REGEXP = /^(HTML\w*Collection|NodeList)$/;
662
+ const testName = (name) => OBJECT_NAMES.has(name) || ARRAY_REGEXP.test(name);
663
+ const test = (val) => val && val.constructor && !!val.constructor.name && testName(val.constructor.name);
664
+ exports2.test = test;
665
+ const isNamedNodeMap = (collection) => collection.constructor.name === "NamedNodeMap";
666
+ const serialize = (collection, config, indentation, depth, refs, printer) => {
667
+ const name = collection.constructor.name;
668
+ if (++depth > config.maxDepth) {
669
+ return `[${name}]`;
670
+ }
671
+ return (config.min ? "" : name + SPACE) + (OBJECT_NAMES.has(name) ? `{${(0, _collections.printObjectProperties)(isNamedNodeMap(collection) ? [...collection].reduce((props, attribute) => {
672
+ props[attribute.name] = attribute.value;
673
+ return props;
674
+ }, {}) : {
675
+ ...collection
676
+ }, config, indentation, depth, refs, printer)}}` : `[${(0, _collections.printListItems)([...collection], config, indentation, depth, refs, printer)}]`);
677
+ };
678
+ exports2.serialize = serialize;
679
+ const plugin = {
680
+ serialize,
681
+ test
682
+ };
683
+ exports2["default"] = plugin;
684
+ })
685
+ ),
686
+ /***/
687
+ "./src/plugins/DOMElement.ts": (
688
+ /***/
689
+ ((__unused_webpack_module, exports2, __webpack_require__2) => {
690
+ Object.defineProperty(exports2, "__esModule", {
691
+ value: true
692
+ });
693
+ exports2.test = exports2.serialize = exports2["default"] = void 0;
694
+ var _markup = __webpack_require__2("./src/plugins/lib/markup.ts");
695
+ const ELEMENT_NODE = 1;
696
+ const TEXT_NODE = 3;
697
+ const COMMENT_NODE = 8;
698
+ const FRAGMENT_NODE = 11;
699
+ const ELEMENT_REGEXP = /^((HTML|SVG)\w*)?Element$/;
700
+ const testHasAttribute = (val) => {
701
+ try {
702
+ return typeof val.hasAttribute === "function" && val.hasAttribute("is");
703
+ } catch {
704
+ return false;
705
+ }
706
+ };
707
+ const isCustomElement = (val) => {
708
+ const tagName = val?.tagName;
709
+ return typeof tagName === "string" && tagName.includes("-") || testHasAttribute(val);
710
+ };
711
+ const testNode = (val) => {
712
+ const constructorName = val.constructor.name;
713
+ const {
714
+ nodeType
715
+ } = val;
716
+ return nodeType === ELEMENT_NODE && (ELEMENT_REGEXP.test(constructorName) || isCustomElement(val)) || nodeType === TEXT_NODE && constructorName === "Text" || nodeType === COMMENT_NODE && constructorName === "Comment" || nodeType === FRAGMENT_NODE && constructorName === "DocumentFragment";
717
+ };
718
+ const test = (val) => (val?.constructor?.name || isCustomElement(val)) && testNode(val);
719
+ exports2.test = test;
720
+ function nodeIsText(node) {
721
+ return node.nodeType === TEXT_NODE;
722
+ }
723
+ function nodeIsComment(node) {
724
+ return node.nodeType === COMMENT_NODE;
725
+ }
726
+ function nodeIsFragment(node) {
727
+ return node.nodeType === FRAGMENT_NODE;
728
+ }
729
+ const serialize = (node, config, indentation, depth, refs, printer) => {
730
+ if (nodeIsText(node)) {
731
+ return (0, _markup.printText)(node.data, config);
732
+ }
733
+ if (nodeIsComment(node)) {
734
+ return (0, _markup.printComment)(node.data, config);
735
+ }
736
+ const type = nodeIsFragment(node) ? "DocumentFragment" : node.tagName.toLowerCase();
737
+ if (++depth > config.maxDepth) {
738
+ return (0, _markup.printElementAsLeaf)(type, config);
739
+ }
740
+ return (0, _markup.printElement)(type, (0, _markup.printProps)(nodeIsFragment(node) ? [] : Array.from(node.attributes, (attr) => attr.name).sort(), nodeIsFragment(node) ? {} : [...node.attributes].reduce((props, attribute) => {
741
+ props[attribute.name] = attribute.value;
742
+ return props;
743
+ }, {}), config, indentation + config.indent, depth, refs, printer), (0, _markup.printChildren)(Array.prototype.slice.call(node.childNodes || node.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
744
+ };
745
+ exports2.serialize = serialize;
746
+ const plugin = {
747
+ serialize,
748
+ test
749
+ };
750
+ exports2["default"] = plugin;
751
+ })
752
+ ),
753
+ /***/
754
+ "./src/plugins/Immutable.ts": (
755
+ /***/
756
+ ((__unused_webpack_module, exports2, __webpack_require__2) => {
757
+ Object.defineProperty(exports2, "__esModule", {
758
+ value: true
759
+ });
760
+ exports2.test = exports2.serialize = exports2["default"] = void 0;
761
+ var _collections = __webpack_require__2("./src/collections.ts");
762
+ const IS_ITERABLE_SENTINEL = "@@__IMMUTABLE_ITERABLE__@@";
763
+ const IS_LIST_SENTINEL = "@@__IMMUTABLE_LIST__@@";
764
+ const IS_KEYED_SENTINEL = "@@__IMMUTABLE_KEYED__@@";
765
+ const IS_MAP_SENTINEL = "@@__IMMUTABLE_MAP__@@";
766
+ const IS_ORDERED_SENTINEL = "@@__IMMUTABLE_ORDERED__@@";
767
+ const IS_RECORD_SENTINEL = "@@__IMMUTABLE_RECORD__@@";
768
+ const IS_SEQ_SENTINEL = "@@__IMMUTABLE_SEQ__@@";
769
+ const IS_SET_SENTINEL = "@@__IMMUTABLE_SET__@@";
770
+ const IS_STACK_SENTINEL = "@@__IMMUTABLE_STACK__@@";
771
+ const getImmutableName = (name) => `Immutable.${name}`;
772
+ const printAsLeaf = (name) => `[${name}]`;
773
+ const SPACE = " ";
774
+ const LAZY = "\u2026";
775
+ const printImmutableEntries = (val, config, indentation, depth, refs, printer, type) => ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : `${getImmutableName(type) + SPACE}{${(0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer)}}`;
776
+ function getRecordEntries(val) {
777
+ let i = 0;
778
+ return {
779
+ next() {
780
+ if (i < val._keys.length) {
781
+ const key = val._keys[i++];
782
+ return {
783
+ done: false,
784
+ value: [key, val.get(key)]
785
+ };
786
+ }
787
+ return {
788
+ done: true,
789
+ value: void 0
790
+ };
791
+ }
792
+ };
793
+ }
794
+ const printImmutableRecord = (val, config, indentation, depth, refs, printer) => {
795
+ const name = getImmutableName(val._name || "Record");
796
+ return ++depth > config.maxDepth ? printAsLeaf(name) : `${name + SPACE}{${(0, _collections.printIteratorEntries)(getRecordEntries(val), config, indentation, depth, refs, printer)}}`;
797
+ };
798
+ const printImmutableSeq = (val, config, indentation, depth, refs, printer) => {
799
+ const name = getImmutableName("Seq");
800
+ if (++depth > config.maxDepth) {
801
+ return printAsLeaf(name);
802
+ }
803
+ if (val[IS_KEYED_SENTINEL]) {
804
+ return `${name + SPACE}{${// from Immutable collection of entries or from ECMAScript object
805
+ val._iter || val._object ? (0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer) : LAZY}}`;
806
+ }
807
+ return `${name + SPACE}[${val._iter || // from Immutable collection of values
808
+ val._array || // from ECMAScript array
809
+ val._collection || // from ECMAScript collection in immutable v4
810
+ val._iterable ? (0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer) : LAZY}]`;
811
+ };
812
+ const printImmutableValues = (val, config, indentation, depth, refs, printer, type) => ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : `${getImmutableName(type) + SPACE}[${(0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer)}]`;
813
+ const serialize = (val, config, indentation, depth, refs, printer) => {
814
+ if (val[IS_MAP_SENTINEL]) {
815
+ return printImmutableEntries(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? "OrderedMap" : "Map");
816
+ }
817
+ if (val[IS_LIST_SENTINEL]) {
818
+ return printImmutableValues(val, config, indentation, depth, refs, printer, "List");
819
+ }
820
+ if (val[IS_SET_SENTINEL]) {
821
+ return printImmutableValues(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? "OrderedSet" : "Set");
822
+ }
823
+ if (val[IS_STACK_SENTINEL]) {
824
+ return printImmutableValues(val, config, indentation, depth, refs, printer, "Stack");
825
+ }
826
+ if (val[IS_SEQ_SENTINEL]) {
827
+ return printImmutableSeq(val, config, indentation, depth, refs, printer);
828
+ }
829
+ return printImmutableRecord(val, config, indentation, depth, refs, printer);
830
+ };
831
+ exports2.serialize = serialize;
832
+ const test = (val) => val && (val[IS_ITERABLE_SENTINEL] === true || val[IS_RECORD_SENTINEL] === true);
833
+ exports2.test = test;
834
+ const plugin = {
835
+ serialize,
836
+ test
837
+ };
838
+ exports2["default"] = plugin;
839
+ })
840
+ ),
841
+ /***/
842
+ "./src/plugins/ReactElement.ts": (
843
+ /***/
844
+ ((__unused_webpack_module, exports2, __webpack_require__2) => {
845
+ Object.defineProperty(exports2, "__esModule", {
846
+ value: true
847
+ });
848
+ exports2.test = exports2.serialize = exports2["default"] = void 0;
849
+ var ReactIs = _interopRequireWildcard(require_react_is());
850
+ var _markup = __webpack_require__2("./src/plugins/lib/markup.ts");
851
+ function _interopRequireWildcard(e, t) {
852
+ if ("function" == typeof WeakMap) var r = /* @__PURE__ */ new WeakMap(), n = /* @__PURE__ */ new WeakMap();
853
+ return (_interopRequireWildcard = function(e2, t2) {
854
+ if (!t2 && e2 && e2.__esModule) return e2;
855
+ var o, i, f = { __proto__: null, default: e2 };
856
+ if (null === e2 || "object" != typeof e2 && "function" != typeof e2) return f;
857
+ if (o = t2 ? n : r) {
858
+ if (o.has(e2)) return o.get(e2);
859
+ o.set(e2, f);
860
+ }
861
+ for (const t3 in e2) "default" !== t3 && {}.hasOwnProperty.call(e2, t3) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e2, t3)) && (i.get || i.set) ? o(f, t3, i) : f[t3] = e2[t3]);
862
+ return f;
863
+ })(e, t);
864
+ }
865
+ const getChildren = (arg, children = []) => {
866
+ if (Array.isArray(arg)) {
867
+ for (const item of arg) {
868
+ getChildren(item, children);
869
+ }
870
+ } else if (arg != null && arg !== false && arg !== "") {
871
+ children.push(arg);
872
+ }
873
+ return children;
874
+ };
875
+ const getType = (element) => {
876
+ const type = element.type;
877
+ if (typeof type === "string") {
878
+ return type;
879
+ }
880
+ if (typeof type === "function") {
881
+ return type.displayName || type.name || "Unknown";
882
+ }
883
+ if (ReactIs.isFragment(element)) {
884
+ return "React.Fragment";
885
+ }
886
+ if (ReactIs.isSuspense(element)) {
887
+ return "React.Suspense";
888
+ }
889
+ if (typeof type === "object" && type !== null) {
890
+ if (ReactIs.isContextProvider(element)) {
891
+ return "Context.Provider";
892
+ }
893
+ if (ReactIs.isContextConsumer(element)) {
894
+ return "Context.Consumer";
895
+ }
896
+ if (ReactIs.isForwardRef(element)) {
897
+ if (type.displayName) {
898
+ return type.displayName;
899
+ }
900
+ const functionName = type.render.displayName || type.render.name || "";
901
+ return functionName === "" ? "ForwardRef" : `ForwardRef(${functionName})`;
902
+ }
903
+ if (ReactIs.isMemo(element)) {
904
+ const functionName = type.displayName || type.type.displayName || type.type.name || "";
905
+ return functionName === "" ? "Memo" : `Memo(${functionName})`;
906
+ }
907
+ }
908
+ return "UNDEFINED";
909
+ };
910
+ const getPropKeys = (element) => {
911
+ const {
912
+ props
913
+ } = element;
914
+ return Object.keys(props).filter((key) => key !== "children" && props[key] !== void 0).sort();
915
+ };
916
+ const serialize = (element, config, indentation, depth, refs, printer) => ++depth > config.maxDepth ? (0, _markup.printElementAsLeaf)(getType(element), config) : (0, _markup.printElement)(getType(element), (0, _markup.printProps)(getPropKeys(element), element.props, config, indentation + config.indent, depth, refs, printer), (0, _markup.printChildren)(getChildren(element.props.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
917
+ exports2.serialize = serialize;
918
+ const test = (val) => val != null && ReactIs.isElement(val);
919
+ exports2.test = test;
920
+ const plugin = {
921
+ serialize,
922
+ test
923
+ };
924
+ exports2["default"] = plugin;
925
+ })
926
+ ),
927
+ /***/
928
+ "./src/plugins/ReactTestComponent.ts": (
929
+ /***/
930
+ ((__unused_webpack_module, exports2, __webpack_require__2) => {
931
+ Object.defineProperty(exports2, "__esModule", {
932
+ value: true
933
+ });
934
+ exports2.test = exports2.serialize = exports2["default"] = void 0;
935
+ var _markup = __webpack_require__2("./src/plugins/lib/markup.ts");
936
+ var Symbol2 = globalThis["jest-symbol-do-not-touch"] || globalThis.Symbol;
937
+ const testSymbol = typeof Symbol2 === "function" && Symbol2.for ? Symbol2.for("react.test.json") : 245830487;
938
+ const getPropKeys = (object) => {
939
+ const {
940
+ props
941
+ } = object;
942
+ return props ? Object.keys(props).filter((key) => props[key] !== void 0).sort() : [];
943
+ };
944
+ const serialize = (object, config, indentation, depth, refs, printer) => ++depth > config.maxDepth ? (0, _markup.printElementAsLeaf)(object.type, config) : (0, _markup.printElement)(object.type, object.props ? (0, _markup.printProps)(getPropKeys(object), object.props, config, indentation + config.indent, depth, refs, printer) : "", object.children ? (0, _markup.printChildren)(object.children, config, indentation + config.indent, depth, refs, printer) : "", config, indentation);
945
+ exports2.serialize = serialize;
946
+ const test = (val) => val && val.$$typeof === testSymbol;
947
+ exports2.test = test;
948
+ const plugin = {
949
+ serialize,
950
+ test
951
+ };
952
+ exports2["default"] = plugin;
953
+ })
954
+ ),
955
+ /***/
956
+ "./src/plugins/lib/escapeHTML.ts": (
957
+ /***/
958
+ ((__unused_webpack_module, exports2) => {
959
+ Object.defineProperty(exports2, "__esModule", {
960
+ value: true
961
+ });
962
+ exports2["default"] = escapeHTML;
963
+ function escapeHTML(str) {
964
+ return str.replaceAll("<", "&lt;").replaceAll(">", "&gt;");
965
+ }
966
+ })
967
+ ),
968
+ /***/
969
+ "./src/plugins/lib/markup.ts": (
970
+ /***/
971
+ ((__unused_webpack_module, exports2, __webpack_require__2) => {
972
+ Object.defineProperty(exports2, "__esModule", {
973
+ value: true
974
+ });
975
+ exports2.printText = exports2.printProps = exports2.printElementAsLeaf = exports2.printElement = exports2.printComment = exports2.printChildren = void 0;
976
+ var _escapeHTML = _interopRequireDefault(__webpack_require__2("./src/plugins/lib/escapeHTML.ts"));
977
+ function _interopRequireDefault(e) {
978
+ return e && e.__esModule ? e : { default: e };
979
+ }
980
+ const printProps = (keys, props, config, indentation, depth, refs, printer) => {
981
+ const indentationNext = indentation + config.indent;
982
+ const colors = config.colors;
983
+ return keys.map((key) => {
984
+ const value = props[key];
985
+ let printed = printer(value, config, indentationNext, depth, refs);
986
+ if (typeof value !== "string") {
987
+ if (printed.includes("\n")) {
988
+ printed = config.spacingOuter + indentationNext + printed + config.spacingOuter + indentation;
989
+ }
990
+ printed = `{${printed}}`;
991
+ }
992
+ return `${config.spacingInner + indentation + colors.prop.open + key + colors.prop.close}=${colors.value.open}${printed}${colors.value.close}`;
993
+ }).join("");
994
+ };
995
+ exports2.printProps = printProps;
996
+ const printChildren = (children, config, indentation, depth, refs, printer) => children.map((child) => config.spacingOuter + indentation + (typeof child === "string" ? printText(child, config) : printer(child, config, indentation, depth, refs))).join("");
997
+ exports2.printChildren = printChildren;
998
+ const printText = (text, config) => {
999
+ const contentColor = config.colors.content;
1000
+ return contentColor.open + (0, _escapeHTML.default)(text) + contentColor.close;
1001
+ };
1002
+ exports2.printText = printText;
1003
+ const printComment = (comment, config) => {
1004
+ const commentColor = config.colors.comment;
1005
+ return `${commentColor.open}<!--${(0, _escapeHTML.default)(comment)}-->${commentColor.close}`;
1006
+ };
1007
+ exports2.printComment = printComment;
1008
+ const printElement = (type, printedProps, printedChildren, config, indentation) => {
1009
+ const tagColor = config.colors.tag;
1010
+ return `${tagColor.open}<${type}${printedProps && tagColor.close + printedProps + config.spacingOuter + indentation + tagColor.open}${printedChildren ? `>${tagColor.close}${printedChildren}${config.spacingOuter}${indentation}${tagColor.open}</${type}` : `${printedProps && !config.min ? "" : " "}/`}>${tagColor.close}`;
1011
+ };
1012
+ exports2.printElement = printElement;
1013
+ const printElementAsLeaf = (type, config) => {
1014
+ const tagColor = config.colors.tag;
1015
+ return `${tagColor.open}<${type}${tagColor.close} \u2026${tagColor.open} />${tagColor.close}`;
1016
+ };
1017
+ exports2.printElementAsLeaf = printElementAsLeaf;
1018
+ })
1019
+ )
1020
+ /******/
1021
+ };
1022
+ var __webpack_module_cache__ = {};
1023
+ function __webpack_require__(moduleId) {
1024
+ var cachedModule = __webpack_module_cache__[moduleId];
1025
+ if (cachedModule !== void 0) {
1026
+ return cachedModule.exports;
1027
+ }
1028
+ var module2 = __webpack_module_cache__[moduleId] = {
1029
+ /******/
1030
+ // no module.id needed
1031
+ /******/
1032
+ // no module.loaded needed
1033
+ /******/
1034
+ exports: {}
1035
+ /******/
1036
+ };
1037
+ __webpack_modules__[moduleId](module2, module2.exports, __webpack_require__);
1038
+ return module2.exports;
1039
+ }
1040
+ var __webpack_exports__ = {};
1041
+ (() => {
1042
+ var exports2 = __webpack_exports__;
1043
+ Object.defineProperty(exports2, "__esModule", {
1044
+ value: true
1045
+ });
1046
+ exports2["default"] = exports2.DEFAULT_OPTIONS = void 0;
1047
+ exports2.format = format2;
1048
+ exports2.plugins = void 0;
1049
+ var _ansiStyles = _interopRequireDefault(require_ansi_styles());
1050
+ var _collections = __webpack_require__("./src/collections.ts");
1051
+ var _AsymmetricMatcher = _interopRequireDefault(__webpack_require__("./src/plugins/AsymmetricMatcher.ts"));
1052
+ var _DOMCollection = _interopRequireDefault(__webpack_require__("./src/plugins/DOMCollection.ts"));
1053
+ var _DOMElement = _interopRequireDefault(__webpack_require__("./src/plugins/DOMElement.ts"));
1054
+ var _Immutable = _interopRequireDefault(__webpack_require__("./src/plugins/Immutable.ts"));
1055
+ var _ReactElement = _interopRequireDefault(__webpack_require__("./src/plugins/ReactElement.ts"));
1056
+ var _ReactTestComponent = _interopRequireDefault(__webpack_require__("./src/plugins/ReactTestComponent.ts"));
1057
+ function _interopRequireDefault(e) {
1058
+ return e && e.__esModule ? e : { default: e };
1059
+ }
1060
+ const src_toString = Object.prototype.toString;
1061
+ const toISOString = Date.prototype.toISOString;
1062
+ const errorToString = Error.prototype.toString;
1063
+ const regExpToString = RegExp.prototype.toString;
1064
+ const getConstructorName = (val) => typeof val.constructor === "function" && val.constructor.name || "Object";
1065
+ const isWindow = (val) => (
1066
+ // eslint-disable-next-line unicorn/prefer-global-this
1067
+ typeof window !== "undefined" && val === window
1068
+ );
1069
+ const SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;
1070
+ const NEWLINE_REGEXP = /\n/gi;
1071
+ class PrettyFormatPluginError extends Error {
1072
+ constructor(message, stack) {
1073
+ super(message);
1074
+ this.stack = stack;
1075
+ this.name = this.constructor.name;
1076
+ }
1077
+ }
1078
+ function isToStringedArrayType(toStringed) {
1079
+ return toStringed === "[object Array]" || toStringed === "[object ArrayBuffer]" || toStringed === "[object DataView]" || toStringed === "[object Float32Array]" || toStringed === "[object Float64Array]" || toStringed === "[object Int8Array]" || toStringed === "[object Int16Array]" || toStringed === "[object Int32Array]" || toStringed === "[object Uint8Array]" || toStringed === "[object Uint8ClampedArray]" || toStringed === "[object Uint16Array]" || toStringed === "[object Uint32Array]";
1080
+ }
1081
+ function printNumber(val) {
1082
+ return Object.is(val, -0) ? "-0" : String(val);
1083
+ }
1084
+ function printBigInt(val) {
1085
+ return String(`${val}n`);
1086
+ }
1087
+ function printFunction(val, printFunctionName) {
1088
+ if (!printFunctionName) {
1089
+ return "[Function]";
1090
+ }
1091
+ return `[Function ${val.name || "anonymous"}]`;
1092
+ }
1093
+ function printSymbol(val) {
1094
+ return String(val).replace(SYMBOL_REGEXP, "Symbol($1)");
1095
+ }
1096
+ function printError(val) {
1097
+ return `[${errorToString.call(val)}]`;
1098
+ }
1099
+ function printBasicValue(val, printFunctionName, escapeRegex, escapeString) {
1100
+ if (val === true || val === false) {
1101
+ return `${val}`;
1102
+ }
1103
+ if (val === void 0) {
1104
+ return "undefined";
1105
+ }
1106
+ if (val === null) {
1107
+ return "null";
1108
+ }
1109
+ const typeOf = typeof val;
1110
+ if (typeOf === "number") {
1111
+ return printNumber(val);
1112
+ }
1113
+ if (typeOf === "bigint") {
1114
+ return printBigInt(val);
1115
+ }
1116
+ if (typeOf === "string") {
1117
+ if (escapeString) {
1118
+ return `"${val.replaceAll(/"|\\/g, "\\$&")}"`;
1119
+ }
1120
+ return `"${val}"`;
1121
+ }
1122
+ if (typeOf === "function") {
1123
+ return printFunction(val, printFunctionName);
1124
+ }
1125
+ if (typeOf === "symbol") {
1126
+ return printSymbol(val);
1127
+ }
1128
+ const toStringed = src_toString.call(val);
1129
+ if (toStringed === "[object Promise]") {
1130
+ return "Promise {}";
1131
+ }
1132
+ if (toStringed === "[object WeakMap]") {
1133
+ return "WeakMap {}";
1134
+ }
1135
+ if (toStringed === "[object WeakSet]") {
1136
+ return "WeakSet {}";
1137
+ }
1138
+ if (toStringed === "[object Function]" || toStringed === "[object GeneratorFunction]") {
1139
+ return printFunction(val, printFunctionName);
1140
+ }
1141
+ if (toStringed === "[object Symbol]") {
1142
+ return printSymbol(val);
1143
+ }
1144
+ if (toStringed === "[object Date]") {
1145
+ return Number.isNaN(+val) ? "Date { NaN }" : toISOString.call(val);
1146
+ }
1147
+ if (toStringed === "[object Error]") {
1148
+ return printError(val);
1149
+ }
1150
+ if (toStringed === "[object RegExp]") {
1151
+ if (escapeRegex) {
1152
+ return regExpToString.call(val).replaceAll(/[$()*+.?[\\\]^{|}]/g, "\\$&");
1153
+ }
1154
+ return regExpToString.call(val);
1155
+ }
1156
+ if (val instanceof Error) {
1157
+ return printError(val);
1158
+ }
1159
+ return null;
1160
+ }
1161
+ function printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON) {
1162
+ if (refs.includes(val)) {
1163
+ return "[Circular]";
1164
+ }
1165
+ refs = [...refs];
1166
+ refs.push(val);
1167
+ const hitMaxDepth = ++depth > config.maxDepth;
1168
+ const min = config.min;
1169
+ if (config.callToJSON && !hitMaxDepth && val.toJSON && typeof val.toJSON === "function" && !hasCalledToJSON) {
1170
+ return printer(val.toJSON(), config, indentation, depth, refs, true);
1171
+ }
1172
+ const toStringed = src_toString.call(val);
1173
+ if (toStringed === "[object Arguments]") {
1174
+ return hitMaxDepth ? "[Arguments]" : `${min ? "" : "Arguments "}[${(0, _collections.printListItems)(val, config, indentation, depth, refs, printer)}]`;
1175
+ }
1176
+ if (isToStringedArrayType(toStringed)) {
1177
+ return hitMaxDepth ? `[${val.constructor.name}]` : `${min ? "" : !config.printBasicPrototype && val.constructor.name === "Array" ? "" : `${val.constructor.name} `}[${(0, _collections.printListItems)(val, config, indentation, depth, refs, printer)}]`;
1178
+ }
1179
+ if (toStringed === "[object Map]") {
1180
+ return hitMaxDepth ? "[Map]" : `Map {${(0, _collections.printIteratorEntries)(val.entries(), config, indentation, depth, refs, printer, " => ")}}`;
1181
+ }
1182
+ if (toStringed === "[object Set]") {
1183
+ return hitMaxDepth ? "[Set]" : `Set {${(0, _collections.printIteratorValues)(val.values(), config, indentation, depth, refs, printer)}}`;
1184
+ }
1185
+ return hitMaxDepth || isWindow(val) ? `[${getConstructorName(val)}]` : `${min ? "" : !config.printBasicPrototype && getConstructorName(val) === "Object" ? "" : `${getConstructorName(val)} `}{${(0, _collections.printObjectProperties)(val, config, indentation, depth, refs, printer)}}`;
1186
+ }
1187
+ function isNewPlugin(plugin) {
1188
+ return plugin.serialize != null;
1189
+ }
1190
+ function printPlugin(plugin, val, config, indentation, depth, refs) {
1191
+ let printed;
1192
+ try {
1193
+ printed = isNewPlugin(plugin) ? plugin.serialize(val, config, indentation, depth, refs, printer) : plugin.print(val, (valChild) => printer(valChild, config, indentation, depth, refs), (str) => {
1194
+ const indentationNext = indentation + config.indent;
1195
+ return indentationNext + str.replaceAll(NEWLINE_REGEXP, `
1196
+ ${indentationNext}`);
1197
+ }, {
1198
+ edgeSpacing: config.spacingOuter,
1199
+ min: config.min,
1200
+ spacing: config.spacingInner
1201
+ }, config.colors);
1202
+ } catch (error) {
1203
+ throw new PrettyFormatPluginError(error.message, error.stack);
1204
+ }
1205
+ if (typeof printed !== "string") {
1206
+ throw new TypeError(`pretty-format: Plugin must return type "string" but instead returned "${typeof printed}".`);
1207
+ }
1208
+ return printed;
1209
+ }
1210
+ function findPlugin(plugins3, val) {
1211
+ for (const plugin of plugins3) {
1212
+ try {
1213
+ if (plugin.test(val)) {
1214
+ return plugin;
1215
+ }
1216
+ } catch (error) {
1217
+ throw new PrettyFormatPluginError(error.message, error.stack);
1218
+ }
1219
+ }
1220
+ return null;
1221
+ }
1222
+ function printer(val, config, indentation, depth, refs, hasCalledToJSON) {
1223
+ const plugin = findPlugin(config.plugins, val);
1224
+ if (plugin !== null) {
1225
+ return printPlugin(plugin, val, config, indentation, depth, refs);
1226
+ }
1227
+ const basicResult = printBasicValue(val, config.printFunctionName, config.escapeRegex, config.escapeString);
1228
+ if (basicResult !== null) {
1229
+ return basicResult;
1230
+ }
1231
+ return printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON);
1232
+ }
1233
+ const DEFAULT_THEME = {
1234
+ comment: "gray",
1235
+ content: "reset",
1236
+ prop: "yellow",
1237
+ tag: "cyan",
1238
+ value: "green"
1239
+ };
1240
+ const DEFAULT_THEME_KEYS = Object.keys(DEFAULT_THEME);
1241
+ const toOptionsSubtype = (options) => options;
1242
+ const DEFAULT_OPTIONS2 = exports2.DEFAULT_OPTIONS = toOptionsSubtype({
1243
+ callToJSON: true,
1244
+ compareKeys: void 0,
1245
+ escapeRegex: false,
1246
+ escapeString: true,
1247
+ highlight: false,
1248
+ indent: 2,
1249
+ maxDepth: Number.POSITIVE_INFINITY,
1250
+ maxWidth: Number.POSITIVE_INFINITY,
1251
+ min: false,
1252
+ plugins: [],
1253
+ printBasicPrototype: true,
1254
+ printFunctionName: true,
1255
+ theme: DEFAULT_THEME
1256
+ });
1257
+ function validateOptions(options) {
1258
+ for (const key of Object.keys(options)) {
1259
+ if (!Object.prototype.hasOwnProperty.call(DEFAULT_OPTIONS2, key)) {
1260
+ throw new Error(`pretty-format: Unknown option "${key}".`);
1261
+ }
1262
+ }
1263
+ if (options.min && options.indent !== void 0 && options.indent !== 0) {
1264
+ throw new Error('pretty-format: Options "min" and "indent" cannot be used together.');
1265
+ }
1266
+ if (options.theme !== void 0) {
1267
+ if (options.theme === null) {
1268
+ throw new Error('pretty-format: Option "theme" must not be null.');
1269
+ }
1270
+ if (typeof options.theme !== "object") {
1271
+ throw new TypeError(`pretty-format: Option "theme" must be of type "object" but instead received "${typeof options.theme}".`);
1272
+ }
1273
+ }
1274
+ }
1275
+ const getColorsHighlight = (options) => DEFAULT_THEME_KEYS.reduce((colors, key) => {
1276
+ const value = options.theme && options.theme[key] !== void 0 ? options.theme[key] : DEFAULT_THEME[key];
1277
+ const color = value && _ansiStyles.default[value];
1278
+ if (color && typeof color.close === "string" && typeof color.open === "string") {
1279
+ colors[key] = color;
1280
+ } else {
1281
+ throw new Error(`pretty-format: Option "theme" has a key "${key}" whose value "${value}" is undefined in ansi-styles.`);
1282
+ }
1283
+ return colors;
1284
+ }, /* @__PURE__ */ Object.create(null));
1285
+ const getColorsEmpty = () => DEFAULT_THEME_KEYS.reduce((colors, key) => {
1286
+ colors[key] = {
1287
+ close: "",
1288
+ open: ""
1289
+ };
1290
+ return colors;
1291
+ }, /* @__PURE__ */ Object.create(null));
1292
+ const getPrintFunctionName = (options) => options?.printFunctionName ?? DEFAULT_OPTIONS2.printFunctionName;
1293
+ const getEscapeRegex = (options) => options?.escapeRegex ?? DEFAULT_OPTIONS2.escapeRegex;
1294
+ const getEscapeString = (options) => options?.escapeString ?? DEFAULT_OPTIONS2.escapeString;
1295
+ const getConfig = (options) => ({
1296
+ callToJSON: options?.callToJSON ?? DEFAULT_OPTIONS2.callToJSON,
1297
+ colors: options?.highlight ? getColorsHighlight(options) : getColorsEmpty(),
1298
+ compareKeys: typeof options?.compareKeys === "function" || options?.compareKeys === null ? options.compareKeys : DEFAULT_OPTIONS2.compareKeys,
1299
+ escapeRegex: getEscapeRegex(options),
1300
+ escapeString: getEscapeString(options),
1301
+ indent: options?.min ? "" : createIndent(options?.indent ?? DEFAULT_OPTIONS2.indent),
1302
+ maxDepth: options?.maxDepth ?? DEFAULT_OPTIONS2.maxDepth,
1303
+ maxWidth: options?.maxWidth ?? DEFAULT_OPTIONS2.maxWidth,
1304
+ min: options?.min ?? DEFAULT_OPTIONS2.min,
1305
+ plugins: options?.plugins ?? DEFAULT_OPTIONS2.plugins,
1306
+ printBasicPrototype: options?.printBasicPrototype ?? true,
1307
+ printFunctionName: getPrintFunctionName(options),
1308
+ spacingInner: options?.min ? " " : "\n",
1309
+ spacingOuter: options?.min ? "" : "\n"
1310
+ });
1311
+ function createIndent(indent) {
1312
+ return Array.from({
1313
+ length: indent + 1
1314
+ }).join(" ");
1315
+ }
1316
+ function format2(val, options) {
1317
+ if (options) {
1318
+ validateOptions(options);
1319
+ if (options.plugins) {
1320
+ const plugin = findPlugin(options.plugins, val);
1321
+ if (plugin !== null) {
1322
+ return printPlugin(plugin, val, getConfig(options), "", 0, []);
1323
+ }
1324
+ }
1325
+ }
1326
+ const basicResult = printBasicValue(val, getPrintFunctionName(options), getEscapeRegex(options), getEscapeString(options));
1327
+ if (basicResult !== null) {
1328
+ return basicResult;
1329
+ }
1330
+ return printComplexValue(val, getConfig(options), "", 0, []);
1331
+ }
1332
+ exports2.plugins = {
1333
+ AsymmetricMatcher: _AsymmetricMatcher.default,
1334
+ DOMCollection: _DOMCollection.default,
1335
+ DOMElement: _DOMElement.default,
1336
+ Immutable: _Immutable.default,
1337
+ ReactElement: _ReactElement.default,
1338
+ ReactTestComponent: _ReactTestComponent.default
1339
+ };
1340
+ exports2["default"] = format2;
1341
+ })();
1342
+ module.exports = __webpack_exports__;
1343
+ })();
1344
+ }
1345
+ });
4
1346
 
5
1347
  // src/utils/validates.ts
6
1348
  function isBase64(link) {
7
1349
  if (!link || typeof link !== "string") return false;
1350
+ if (link.length < 18) return false;
8
1351
  return link.startsWith("data:image/") && link.includes(";base64");
9
1352
  }
1353
+
1354
+ // ../../node_modules/.pnpm/pretty-format@30.2.0/node_modules/pretty-format/build/index.mjs
1355
+ var import_index = __toESM(require_build());
1356
+ import_index.default.DEFAULT_OPTIONS;
1357
+ var format = import_index.default.format;
1358
+ import_index.default.plugins;
1359
+ import_index.default.default;
1360
+
1361
+ // src/formatter.ts
1362
+ var EXCLUDED_ERROR_PROPS = /* @__PURE__ */ new Set(["name", "message", "stack", "cause"]);
10
1363
  var Formatter = class {
11
1364
  /**
12
1365
  * Check if a field should be filtered based on configured rules
@@ -99,23 +1452,26 @@ var Formatter = class {
99
1452
  * Sanitize sensitive data from stack traces
100
1453
  */
101
1454
  static sanitizeStackTrace(stack, customPatterns) {
102
- const defaultPatterns = [
103
- /([?&])(token|key|secret|password|auth|api[_-]?key|access[_-]?token|client[_-]?secret)=[^&\s)#]*/gi,
104
- /\/\/[^/]*:[^@]*@/g,
105
- // Basic auth in URLs (user:pass@domain)
106
- /(bearer\s+)[a-zA-Z0-9\-._~+/]+=*/gi
107
- // Bearer tokens
108
- ];
109
- const allPatterns = [...defaultPatterns, ...customPatterns || []];
110
- let sanitized = stack;
111
- allPatterns.forEach((pattern) => {
112
- sanitized = sanitized.replace(pattern, (match, p1) => {
113
- if (p1) {
114
- return `${p1}***REDACTED***`;
115
- }
116
- return "***REDACTED***";
117
- });
1455
+ const combinedDefaultPattern = /([?&])(token|key|secret|password|auth|api[_-]?key|access[_-]?token|client[_-]?secret)=[^&\s)#]*|\/\/[^/]*:[^@]*@|(bearer\s+)[a-zA-Z0-9\-._~+/]+=*/gi;
1456
+ let sanitized = stack.replace(combinedDefaultPattern, (match, urlParam, _tokenKey, bearer) => {
1457
+ if (urlParam) {
1458
+ return `${urlParam}***REDACTED***`;
1459
+ }
1460
+ if (bearer) {
1461
+ return `${bearer}***REDACTED***`;
1462
+ }
1463
+ return "***REDACTED***";
118
1464
  });
1465
+ if (customPatterns && customPatterns.length > 0) {
1466
+ for (const pattern of customPatterns) {
1467
+ sanitized = sanitized.replace(pattern, (match, p1) => {
1468
+ if (p1) {
1469
+ return `${p1}***REDACTED***`;
1470
+ }
1471
+ return "***REDACTED***";
1472
+ });
1473
+ }
1474
+ }
119
1475
  return sanitized;
120
1476
  }
121
1477
  /**
@@ -156,14 +1512,14 @@ var Formatter = class {
156
1512
  if (includeCause && error.cause !== void 0) {
157
1513
  if (error.cause instanceof Error) {
158
1514
  const serializedCause = this.serializeError(error.cause, config, currentDepth + 1);
159
- serialized.cause = typeof serializedCause === "string" ? serializedCause : serializedCause;
1515
+ serialized.cause = typeof serializedCause === "string" ? { name: "Error", message: serializedCause } : serializedCause;
160
1516
  } else {
161
1517
  serialized.cause = error.cause;
162
1518
  }
163
1519
  }
164
1520
  for (const key in error) {
165
1521
  if (Object.prototype.hasOwnProperty.call(error, key)) {
166
- if (!["name", "message", "stack", "cause"].includes(key)) {
1522
+ if (!EXCLUDED_ERROR_PROPS.has(key)) {
167
1523
  const errorWithCustomProps = error;
168
1524
  serialized[key] = errorWithCustomProps[key];
169
1525
  }
@@ -216,12 +1572,6 @@ var Formatter = class {
216
1572
  if (typeof obj === "string" && isBase64(obj)) {
217
1573
  return this.formatBase64String(obj);
218
1574
  }
219
- if (obj instanceof Blob) {
220
- return {
221
- size: obj.size,
222
- type: obj.type
223
- };
224
- }
225
1575
  if (obj instanceof File) {
226
1576
  return {
227
1577
  name: obj.name,
@@ -230,6 +1580,12 @@ var Formatter = class {
230
1580
  lastModified: obj.lastModified
231
1581
  };
232
1582
  }
1583
+ if (obj instanceof Blob) {
1584
+ return {
1585
+ size: obj.size,
1586
+ type: obj.type
1587
+ };
1588
+ }
233
1589
  if (Array.isArray(obj)) {
234
1590
  return obj.map(
235
1591
  (item, index) => this.serializeSpecialObjects(
@@ -320,7 +1676,7 @@ var Formatter = class {
320
1676
  errorConfig: options?.errorConfig
321
1677
  }
322
1678
  );
323
- const formatted = prettyFormat.format(serialized, {
1679
+ const formatted = format(serialized, {
324
1680
  indent: 2,
325
1681
  maxDepth,
326
1682
  // Remove Object and Array labels
@@ -392,56 +1748,41 @@ var styler_default = Styler;
392
1748
  // src/namespace-matcher.ts
393
1749
  var NamespaceMatcher = class {
394
1750
  constructor() {
395
- this.cachedPatterns = null;
1751
+ this.cachedPositivePatterns = [];
1752
+ this.cachedNegativePatterns = [];
396
1753
  this.cachedConfig = void 0;
397
1754
  }
398
1755
  matches(namespace, namespaces) {
399
1756
  const ns = this.normalize(namespace);
400
1757
  if (this.cachedConfig !== namespaces) {
401
- this.cachedPatterns = this.parsePatterns(namespaces);
1758
+ this.parseAndCachePatterns(namespaces);
402
1759
  this.cachedConfig = namespaces;
403
1760
  }
404
- const enabledNamespaces = this.cachedPatterns || [];
405
- if (!enabledNamespaces.length) return true;
406
- const positivePatterns = [];
407
- const negativePatterns = [];
408
- for (const pattern of enabledNamespaces) {
409
- if (pattern.startsWith("-")) {
410
- negativePatterns.push(pattern.slice(1));
411
- } else {
412
- positivePatterns.push(pattern);
413
- }
414
- }
415
- const matches = positivePatterns.some((pattern) => {
416
- if (pattern === "*") return true;
417
- const normalizedPattern = this.normalize(pattern);
418
- if (pattern.includes("*")) {
419
- const regex = new RegExp("^" + normalizedPattern.replace(/\*/g, ".*") + "$");
420
- if (regex.test(ns)) return true;
421
- const basePattern = normalizedPattern.split(":")[0];
422
- if (ns === basePattern && normalizedPattern.startsWith(basePattern + ":")) {
1761
+ if (!this.cachedPositivePatterns.length) return true;
1762
+ const matches = this.cachedPositivePatterns.some((entry) => {
1763
+ if (entry.pattern === "*") return true;
1764
+ if (entry.regex) {
1765
+ if (entry.regex.test(ns)) return true;
1766
+ if (entry.basePattern && ns === entry.basePattern) {
423
1767
  return true;
424
1768
  }
425
1769
  return false;
426
1770
  }
427
- return ns === normalizedPattern;
1771
+ return ns === entry.pattern;
428
1772
  });
429
1773
  if (!matches) return false;
430
- for (const negPattern of negativePatterns) {
431
- const neg = this.normalize(negPattern);
432
- if (neg.includes("*")) {
433
- const regex = new RegExp("^" + neg.replace(/\*/g, ".*") + "$");
434
- if (regex.test(ns)) {
1774
+ for (const entry of this.cachedNegativePatterns) {
1775
+ if (entry.regex) {
1776
+ if (entry.regex.test(ns)) {
435
1777
  return false;
436
1778
  }
437
- const negPrefix = this.normalize(neg.replace(/\*.*$/, ""));
438
- if (negPrefix) {
439
- if (ns === negPrefix || ns.startsWith(negPrefix + ":")) {
1779
+ if (entry.prefix) {
1780
+ if (ns === entry.prefix || ns.startsWith(entry.prefix + ":")) {
440
1781
  return false;
441
1782
  }
442
1783
  }
443
1784
  } else {
444
- if (ns.startsWith(neg)) {
1785
+ if (ns.startsWith(entry.pattern)) {
445
1786
  return false;
446
1787
  }
447
1788
  }
@@ -452,9 +1793,47 @@ var NamespaceMatcher = class {
452
1793
  if (!value) return "";
453
1794
  return value.replace(/:+$/, "");
454
1795
  }
455
- parsePatterns(namespaces) {
456
- if (!namespaces) return [];
457
- return namespaces.split(",").map((s) => this.normalize(s.trim()));
1796
+ parseAndCachePatterns(namespaces) {
1797
+ this.cachedPositivePatterns = [];
1798
+ this.cachedNegativePatterns = [];
1799
+ if (!namespaces) return;
1800
+ const patterns = namespaces.split(",").map((s) => this.normalize(s.trim()));
1801
+ for (const pattern of patterns) {
1802
+ if (pattern.startsWith("-")) {
1803
+ const negPattern = pattern.slice(1);
1804
+ const normalized = this.normalize(negPattern);
1805
+ if (normalized.includes("*")) {
1806
+ const escaped = normalized.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*");
1807
+ const regex = new RegExp("^" + escaped + "$");
1808
+ const prefix = this.normalize(normalized.replace(/\*.*$/, ""));
1809
+ this.cachedNegativePatterns.push({
1810
+ pattern: normalized,
1811
+ regex,
1812
+ prefix: prefix || void 0
1813
+ });
1814
+ } else {
1815
+ this.cachedNegativePatterns.push({
1816
+ pattern: normalized
1817
+ });
1818
+ }
1819
+ } else {
1820
+ const normalized = this.normalize(pattern);
1821
+ if (normalized.includes("*")) {
1822
+ const escaped = normalized.replace(/[.+?^${}()|[\]\\]/g, "\\$&").replace(/\*/g, ".*");
1823
+ const regex = new RegExp("^" + escaped + "$");
1824
+ const basePattern = normalized.split(":")[0];
1825
+ this.cachedPositivePatterns.push({
1826
+ pattern: normalized,
1827
+ regex,
1828
+ basePattern: normalized.startsWith(basePattern + ":") ? basePattern : void 0
1829
+ });
1830
+ } else {
1831
+ this.cachedPositivePatterns.push({
1832
+ pattern: normalized
1833
+ });
1834
+ }
1835
+ }
1836
+ }
458
1837
  }
459
1838
  };
460
1839
  var namespaceMatcher = new NamespaceMatcher();
@@ -497,6 +1876,13 @@ var dedup_hasher_default = DedupHasher;
497
1876
 
498
1877
  // src/logger.ts
499
1878
  var globalConfig = {};
1879
+ var LEVEL_PRIORITIES = {
1880
+ debug: 0,
1881
+ info: 1,
1882
+ warn: 2,
1883
+ error: 3,
1884
+ none: 4
1885
+ };
500
1886
  function configure(options) {
501
1887
  globalConfig = { ...globalConfig, ...options };
502
1888
  }
@@ -554,6 +1940,9 @@ var Logger = class {
554
1940
  assert(condition, message, ...args) {
555
1941
  if (!condition) {
556
1942
  this.log("error", message, ...args);
1943
+ } else {
1944
+ this._tempConditions = [];
1945
+ this._tempFilterOptions = {};
557
1946
  }
558
1947
  return this;
559
1948
  }
@@ -665,14 +2054,7 @@ var Logger = class {
665
2054
  return this;
666
2055
  }
667
2056
  getLevelPriority(level) {
668
- const priorities = {
669
- debug: 0,
670
- info: 1,
671
- warn: 2,
672
- error: 3,
673
- none: 4
674
- };
675
- return priorities[level];
2057
+ return LEVEL_PRIORITIES[level];
676
2058
  }
677
2059
  log(level, message, ...args) {
678
2060
  if (this._tempConditions.length > 0) {
@@ -700,7 +2082,7 @@ var Logger = class {
700
2082
  } else if (this.getLevelPriority(this._level) > this.getLevelPriority(level)) {
701
2083
  return;
702
2084
  }
703
- const filterOptions = { ...this._tempFilterOptions };
2085
+ const filterOptions = this._tempFilterOptions;
704
2086
  this._tempFilterOptions = {};
705
2087
  if (this._dedupConfig.enabled) {
706
2088
  this.logWithDedup(level, message, filterOptions, ...args);
@@ -806,6 +2188,40 @@ var plslog = ((options = {}) => {
806
2188
  });
807
2189
  plslog.configure = configure;
808
2190
  var logger_default = plslog;
2191
+ /*! Bundled license information:
2192
+
2193
+ react-is/cjs/react-is.production.min.js:
2194
+ (**
2195
+ * @license React
2196
+ * react-is.production.min.js
2197
+ *
2198
+ * Copyright (c) Facebook, Inc. and its affiliates.
2199
+ *
2200
+ * This source code is licensed under the MIT license found in the
2201
+ * LICENSE file in the root directory of this source tree.
2202
+ *)
2203
+
2204
+ react-is/cjs/react-is.development.js:
2205
+ (**
2206
+ * @license React
2207
+ * react-is.development.js
2208
+ *
2209
+ * Copyright (c) Facebook, Inc. and its affiliates.
2210
+ *
2211
+ * This source code is licensed under the MIT license found in the
2212
+ * LICENSE file in the root directory of this source tree.
2213
+ *)
2214
+
2215
+ pretty-format/build/index.js:
2216
+ (*!
2217
+ * /**
2218
+ * * Copyright (c) Meta Platforms, Inc. and affiliates.
2219
+ * *
2220
+ * * This source code is licensed under the MIT license found in the
2221
+ * * LICENSE file in the root directory of this source tree.
2222
+ * * /
2223
+ *)
2224
+ */
809
2225
 
810
2226
  module.exports = logger_default;
811
2227
  //# sourceMappingURL=index.js.map