@antdv-next/x-sdk 0.0.1 → 0.0.3
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/LICENSE +21 -0
- package/dist/_util/resolveMaybeRef.d.ts +2 -0
- package/dist/_util/resolveMaybeRef.js +7 -0
- package/dist/_util/types.js +0 -0
- package/dist/chat-providers/AbstractChatProvider.d.ts +2 -2
- package/dist/chat-providers/AbstractChatProvider.js +42 -0
- package/dist/chat-providers/DeepSeekChatProvider.d.ts +2 -2
- package/dist/chat-providers/DeepSeekChatProvider.js +59 -0
- package/dist/chat-providers/DefaultChatProvider.d.ts +2 -2
- package/dist/chat-providers/DefaultChatProvider.js +26 -0
- package/dist/chat-providers/OpenAIChatProvider.d.ts +2 -2
- package/dist/chat-providers/OpenAIChatProvider.js +49 -0
- package/dist/chat-providers/index.js +4 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -3
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/expect/index.js +1467 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/pretty-format/index.js +884 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/runner/chunk-artifact.js +1513 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/snapshot/index.js +661 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/spy/index.js +384 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/utils/chunk-pathe.M-eThtNZ.js +80 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/utils/diff.js +1304 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/utils/display.js +556 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/utils/error.js +27 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/utils/helpers.js +179 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/utils/offset.js +25 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/utils/serialize.js +75 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/utils/source-map.js +371 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/utils/timers.js +35 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/chunks/_commonjsHelpers.D26ty3Ew.js +4 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/chunks/rpc.MzXet3jl.js +50 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/chunks/test.CBQUpOM3.js +2645 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/chunks/utils.BX5Fg8C4.js +42 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/vendor/chai.js +2872 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/vendor/magic-string.js +1009 -0
- package/dist/node_modules/.pnpm/@voidzero-dev_vite-plus-test@0.1.14_@types_node@24.12.0_@voidzero-dev_vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/vendor/tinyrainbow.js +84 -0
- package/dist/x-chat/__tests__/index.test.d.ts +1 -0
- package/dist/x-chat/__tests__/index.test.js +258 -0
- package/dist/x-chat/index.d.ts +14 -23
- package/dist/x-chat/index.js +85 -67
- package/dist/x-chat/store.d.ts +2 -0
- package/dist/{store-C1diHqNH.js → x-chat/store.js} +15 -9
- package/dist/x-conversations/__tests__/index.test.d.ts +1 -0
- package/dist/x-conversations/__tests__/index.test.js +36 -0
- package/dist/x-conversations/index.d.ts +4 -4
- package/dist/x-conversations/index.js +37 -1
- package/dist/{x-conversations-BrKWhj5r.js → x-conversations/store.js} +2 -31
- package/dist/x-request/__tests__/index.test.d.ts +1 -0
- package/dist/x-request/__tests__/index.test.js +90 -0
- package/dist/x-request/index.d.ts +36 -11
- package/dist/x-request/index.js +246 -1
- package/dist/x-request/x-fetch.js +18 -0
- package/dist/x-stream/__tests__/index.test.d.ts +1 -0
- package/dist/x-stream/__tests__/index.test.js +62 -0
- package/dist/x-stream/index.js +16 -5
- package/package.json +2 -1
- package/dist/chat-providers-5x9Va7p5.js +0 -167
- package/dist/x-request-BSFGaKND.js +0 -234
|
@@ -0,0 +1,884 @@
|
|
|
1
|
+
import C from "../../vendor/tinyrainbow.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@voidzero-dev+vite-plus-test@0.1.14_@types+node@24.12.0_@voidzero-dev+vite-plus-core@0._0c620f79340a656256b2ffe23b3e6dd1/node_modules/@voidzero-dev/vite-plus-test/dist/@vitest/pretty-format/index.js
|
|
3
|
+
function _mergeNamespaces(n, m) {
|
|
4
|
+
m.forEach(function(e) {
|
|
5
|
+
e && typeof e !== "string" && !Array.isArray(e) && Object.keys(e).forEach(function(k) {
|
|
6
|
+
if (k !== "default" && !(k in n)) {
|
|
7
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
8
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function() {
|
|
11
|
+
return e[k];
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
return Object.freeze(n);
|
|
18
|
+
}
|
|
19
|
+
function getKeysOfEnumerableProperties(object, compareKeys) {
|
|
20
|
+
const rawKeys = Object.keys(object);
|
|
21
|
+
const keys = compareKeys === null ? rawKeys : rawKeys.sort(compareKeys);
|
|
22
|
+
if (Object.getOwnPropertySymbols) {
|
|
23
|
+
for (const symbol of Object.getOwnPropertySymbols(object)) if (Object.getOwnPropertyDescriptor(object, symbol).enumerable) keys.push(symbol);
|
|
24
|
+
}
|
|
25
|
+
return keys;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Return entries (for example, of a map)
|
|
29
|
+
* with spacing, indentation, and comma
|
|
30
|
+
* without surrounding punctuation (for example, braces)
|
|
31
|
+
*/
|
|
32
|
+
function printIteratorEntries(iterator, config, indentation, depth, refs, printer, separator = ": ") {
|
|
33
|
+
let result = "";
|
|
34
|
+
let width = 0;
|
|
35
|
+
let current = iterator.next();
|
|
36
|
+
if (!current.done) {
|
|
37
|
+
result += config.spacingOuter;
|
|
38
|
+
const indentationNext = indentation + config.indent;
|
|
39
|
+
while (!current.done) {
|
|
40
|
+
result += indentationNext;
|
|
41
|
+
if (width++ === config.maxWidth) {
|
|
42
|
+
result += "…";
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
const name = printer(current.value[0], config, indentationNext, depth, refs);
|
|
46
|
+
const value = printer(current.value[1], config, indentationNext, depth, refs);
|
|
47
|
+
result += name + separator + value;
|
|
48
|
+
current = iterator.next();
|
|
49
|
+
if (!current.done) result += `,${config.spacingInner}`;
|
|
50
|
+
else if (!config.min) result += ",";
|
|
51
|
+
}
|
|
52
|
+
result += config.spacingOuter + indentation;
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Return values (for example, of a set)
|
|
58
|
+
* with spacing, indentation, and comma
|
|
59
|
+
* without surrounding punctuation (braces or brackets)
|
|
60
|
+
*/
|
|
61
|
+
function printIteratorValues(iterator, config, indentation, depth, refs, printer) {
|
|
62
|
+
let result = "";
|
|
63
|
+
let width = 0;
|
|
64
|
+
let current = iterator.next();
|
|
65
|
+
if (!current.done) {
|
|
66
|
+
result += config.spacingOuter;
|
|
67
|
+
const indentationNext = indentation + config.indent;
|
|
68
|
+
while (!current.done) {
|
|
69
|
+
result += indentationNext;
|
|
70
|
+
if (width++ === config.maxWidth) {
|
|
71
|
+
result += "…";
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
result += printer(current.value, config, indentationNext, depth, refs);
|
|
75
|
+
current = iterator.next();
|
|
76
|
+
if (!current.done) result += `,${config.spacingInner}`;
|
|
77
|
+
else if (!config.min) result += ",";
|
|
78
|
+
}
|
|
79
|
+
result += config.spacingOuter + indentation;
|
|
80
|
+
}
|
|
81
|
+
return result;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Return items (for example, of an array)
|
|
85
|
+
* with spacing, indentation, and comma
|
|
86
|
+
* without surrounding punctuation (for example, brackets)
|
|
87
|
+
*/
|
|
88
|
+
function printListItems(list, config, indentation, depth, refs, printer) {
|
|
89
|
+
let result = "";
|
|
90
|
+
list = list instanceof ArrayBuffer ? new DataView(list) : list;
|
|
91
|
+
const isDataView = (l) => l instanceof DataView;
|
|
92
|
+
const length = isDataView(list) ? list.byteLength : list.length;
|
|
93
|
+
if (length > 0) {
|
|
94
|
+
result += config.spacingOuter;
|
|
95
|
+
const indentationNext = indentation + config.indent;
|
|
96
|
+
for (let i = 0; i < length; i++) {
|
|
97
|
+
result += indentationNext;
|
|
98
|
+
if (i === config.maxWidth) {
|
|
99
|
+
result += "…";
|
|
100
|
+
break;
|
|
101
|
+
}
|
|
102
|
+
if (isDataView(list) || i in list) result += printer(isDataView(list) ? list.getInt8(i) : list[i], config, indentationNext, depth, refs);
|
|
103
|
+
if (i < length - 1) result += `,${config.spacingInner}`;
|
|
104
|
+
else if (!config.min) result += ",";
|
|
105
|
+
}
|
|
106
|
+
result += config.spacingOuter + indentation;
|
|
107
|
+
}
|
|
108
|
+
return result;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Return properties of an object
|
|
112
|
+
* with spacing, indentation, and comma
|
|
113
|
+
* without surrounding punctuation (for example, braces)
|
|
114
|
+
*/
|
|
115
|
+
function printObjectProperties(val, config, indentation, depth, refs, printer) {
|
|
116
|
+
let result = "";
|
|
117
|
+
const keys = getKeysOfEnumerableProperties(val, config.compareKeys);
|
|
118
|
+
if (keys.length > 0) {
|
|
119
|
+
result += config.spacingOuter;
|
|
120
|
+
const indentationNext = indentation + config.indent;
|
|
121
|
+
for (let i = 0; i < keys.length; i++) {
|
|
122
|
+
const key = keys[i];
|
|
123
|
+
const name = printer(key, config, indentationNext, depth, refs);
|
|
124
|
+
const value = printer(val[key], config, indentationNext, depth, refs);
|
|
125
|
+
result += `${indentationNext + name}: ${value}`;
|
|
126
|
+
if (i < keys.length - 1) result += `,${config.spacingInner}`;
|
|
127
|
+
else if (!config.min) result += ",";
|
|
128
|
+
}
|
|
129
|
+
result += config.spacingOuter + indentation;
|
|
130
|
+
}
|
|
131
|
+
return result;
|
|
132
|
+
}
|
|
133
|
+
var asymmetricMatcher = typeof Symbol === "function" && Symbol.for ? Symbol.for("jest.asymmetricMatcher") : 1267621;
|
|
134
|
+
var SPACE$2 = " ";
|
|
135
|
+
var serialize$5 = (val, config, indentation, depth, refs, printer) => {
|
|
136
|
+
const stringedValue = val.toString();
|
|
137
|
+
if (stringedValue === "ArrayContaining" || stringedValue === "ArrayNotContaining") {
|
|
138
|
+
if (++depth > config.maxDepth) return `[${stringedValue}]`;
|
|
139
|
+
return `${stringedValue + SPACE$2}[${printListItems(val.sample, config, indentation, depth, refs, printer)}]`;
|
|
140
|
+
}
|
|
141
|
+
if (stringedValue === "ObjectContaining" || stringedValue === "ObjectNotContaining") {
|
|
142
|
+
if (++depth > config.maxDepth) return `[${stringedValue}]`;
|
|
143
|
+
return `${stringedValue + SPACE$2}{${printObjectProperties(val.sample, config, indentation, depth, refs, printer)}}`;
|
|
144
|
+
}
|
|
145
|
+
if (stringedValue === "StringMatching" || stringedValue === "StringNotMatching") return stringedValue + SPACE$2 + printer(val.sample, config, indentation, depth, refs);
|
|
146
|
+
if (stringedValue === "StringContaining" || stringedValue === "StringNotContaining") return stringedValue + SPACE$2 + printer(val.sample, config, indentation, depth, refs);
|
|
147
|
+
if (typeof val.toAsymmetricMatcher !== "function") throw new TypeError(`Asymmetric matcher ${val.constructor.name} does not implement toAsymmetricMatcher()`);
|
|
148
|
+
return val.toAsymmetricMatcher();
|
|
149
|
+
};
|
|
150
|
+
var test$5 = (val) => val && val.$$typeof === asymmetricMatcher;
|
|
151
|
+
var plugin$5 = {
|
|
152
|
+
serialize: serialize$5,
|
|
153
|
+
test: test$5
|
|
154
|
+
};
|
|
155
|
+
var SPACE$1 = " ";
|
|
156
|
+
var OBJECT_NAMES = /* @__PURE__ */ new Set(["DOMStringMap", "NamedNodeMap"]);
|
|
157
|
+
var ARRAY_REGEXP = /^(?:HTML\w*Collection|NodeList)$/;
|
|
158
|
+
function testName(name) {
|
|
159
|
+
return OBJECT_NAMES.has(name) || ARRAY_REGEXP.test(name);
|
|
160
|
+
}
|
|
161
|
+
var test$4 = (val) => val && val.constructor && !!val.constructor.name && testName(val.constructor.name);
|
|
162
|
+
function isNamedNodeMap(collection) {
|
|
163
|
+
return collection.constructor.name === "NamedNodeMap";
|
|
164
|
+
}
|
|
165
|
+
var serialize$4 = (collection, config, indentation, depth, refs, printer) => {
|
|
166
|
+
const name = collection.constructor.name;
|
|
167
|
+
if (++depth > config.maxDepth) return `[${name}]`;
|
|
168
|
+
return (config.min ? "" : name + SPACE$1) + (OBJECT_NAMES.has(name) ? `{${printObjectProperties(isNamedNodeMap(collection) ? [...collection].reduce((props, attribute) => {
|
|
169
|
+
props[attribute.name] = attribute.value;
|
|
170
|
+
return props;
|
|
171
|
+
}, {}) : { ...collection }, config, indentation, depth, refs, printer)}}` : `[${printListItems([...collection], config, indentation, depth, refs, printer)}]`);
|
|
172
|
+
};
|
|
173
|
+
var plugin$4 = {
|
|
174
|
+
serialize: serialize$4,
|
|
175
|
+
test: test$4
|
|
176
|
+
};
|
|
177
|
+
/**
|
|
178
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the MIT license found in the
|
|
181
|
+
* LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/
|
|
183
|
+
function escapeHTML(str) {
|
|
184
|
+
return str.replaceAll("<", "<").replaceAll(">", ">");
|
|
185
|
+
}
|
|
186
|
+
function printProps(keys, props, config, indentation, depth, refs, printer) {
|
|
187
|
+
const indentationNext = indentation + config.indent;
|
|
188
|
+
const colors = config.colors;
|
|
189
|
+
return keys.map((key) => {
|
|
190
|
+
const value = props[key];
|
|
191
|
+
if (typeof value === "string" && value[0] === "_" && value.startsWith("__vitest_") && value.match(/__vitest_\d+__/)) return "";
|
|
192
|
+
let printed = printer(value, config, indentationNext, depth, refs);
|
|
193
|
+
if (typeof value !== "string") {
|
|
194
|
+
if (printed.includes("\n")) printed = config.spacingOuter + indentationNext + printed + config.spacingOuter + indentation;
|
|
195
|
+
printed = `{${printed}}`;
|
|
196
|
+
}
|
|
197
|
+
return `${config.spacingInner + indentation + colors.prop.open + key + colors.prop.close}=${colors.value.open}${printed}${colors.value.close}`;
|
|
198
|
+
}).join("");
|
|
199
|
+
}
|
|
200
|
+
function printChildren(children, config, indentation, depth, refs, printer) {
|
|
201
|
+
return children.map((child) => config.spacingOuter + indentation + (typeof child === "string" ? printText(child, config) : printer(child, config, indentation, depth, refs))).join("");
|
|
202
|
+
}
|
|
203
|
+
function printShadowRoot(children, config, indentation, depth, refs, printer) {
|
|
204
|
+
if (config.printShadowRoot === false) return "";
|
|
205
|
+
return [`${config.spacingOuter + indentation}#shadow-root`, printChildren(children, config, indentation + config.indent, depth, refs, printer)].join("");
|
|
206
|
+
}
|
|
207
|
+
function printText(text, config) {
|
|
208
|
+
const contentColor = config.colors.content;
|
|
209
|
+
return contentColor.open + escapeHTML(text) + contentColor.close;
|
|
210
|
+
}
|
|
211
|
+
function printComment(comment, config) {
|
|
212
|
+
const commentColor = config.colors.comment;
|
|
213
|
+
return `${commentColor.open}<!--${escapeHTML(comment)}-->${commentColor.close}`;
|
|
214
|
+
}
|
|
215
|
+
function printElement(type, printedProps, printedChildren, config, indentation) {
|
|
216
|
+
const tagColor = config.colors.tag;
|
|
217
|
+
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}`;
|
|
218
|
+
}
|
|
219
|
+
function printElementAsLeaf(type, config) {
|
|
220
|
+
const tagColor = config.colors.tag;
|
|
221
|
+
return `${tagColor.open}<${type}${tagColor.close} …${tagColor.open} />${tagColor.close}`;
|
|
222
|
+
}
|
|
223
|
+
var ELEMENT_NODE = 1;
|
|
224
|
+
var TEXT_NODE = 3;
|
|
225
|
+
var COMMENT_NODE = 8;
|
|
226
|
+
var FRAGMENT_NODE = 11;
|
|
227
|
+
var ELEMENT_REGEXP = /^(?:(?:HTML|SVG)\w*)?Element$/;
|
|
228
|
+
function testHasAttribute(val) {
|
|
229
|
+
try {
|
|
230
|
+
return typeof val.hasAttribute === "function" && val.hasAttribute("is");
|
|
231
|
+
} catch {
|
|
232
|
+
return false;
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
function testNode(val) {
|
|
236
|
+
const constructorName = val.constructor.name;
|
|
237
|
+
const { nodeType, tagName } = val;
|
|
238
|
+
const isCustomElement = typeof tagName === "string" && tagName.includes("-") || testHasAttribute(val);
|
|
239
|
+
return nodeType === ELEMENT_NODE && (ELEMENT_REGEXP.test(constructorName) || isCustomElement) || nodeType === TEXT_NODE && constructorName === "Text" || nodeType === COMMENT_NODE && constructorName === "Comment" || nodeType === FRAGMENT_NODE && constructorName === "DocumentFragment";
|
|
240
|
+
}
|
|
241
|
+
var test$3 = (val) => val?.constructor?.name && testNode(val);
|
|
242
|
+
function nodeIsText(node) {
|
|
243
|
+
return node.nodeType === TEXT_NODE;
|
|
244
|
+
}
|
|
245
|
+
function nodeIsComment(node) {
|
|
246
|
+
return node.nodeType === COMMENT_NODE;
|
|
247
|
+
}
|
|
248
|
+
function nodeIsFragment(node) {
|
|
249
|
+
return node.nodeType === FRAGMENT_NODE;
|
|
250
|
+
}
|
|
251
|
+
function filterChildren(children, filterNode) {
|
|
252
|
+
let filtered = children.filter((node) => {
|
|
253
|
+
if (node.nodeType === TEXT_NODE) return (node.data || "").trim().length > 0;
|
|
254
|
+
return true;
|
|
255
|
+
});
|
|
256
|
+
if (filterNode) filtered = filtered.filter(filterNode);
|
|
257
|
+
return filtered;
|
|
258
|
+
}
|
|
259
|
+
function serializeDOM(node, config, indentation, depth, refs, printer, filterNode) {
|
|
260
|
+
if (nodeIsText(node)) return printText(node.data, config);
|
|
261
|
+
if (nodeIsComment(node)) return printComment(node.data, config);
|
|
262
|
+
const type = nodeIsFragment(node) ? "DocumentFragment" : node.tagName.toLowerCase();
|
|
263
|
+
if (++depth > config.maxDepth) return printElementAsLeaf(type, config);
|
|
264
|
+
const children = Array.prototype.slice.call(node.childNodes || node.children);
|
|
265
|
+
const shadowChildren = nodeIsFragment(node) || !node.shadowRoot ? [] : Array.prototype.slice.call(node.shadowRoot.children);
|
|
266
|
+
const resolvedChildren = filterNode ? filterChildren(children, filterNode) : children;
|
|
267
|
+
const resolvedShadowChildren = filterNode ? filterChildren(shadowChildren, filterNode) : shadowChildren;
|
|
268
|
+
return printElement(type, printProps(nodeIsFragment(node) ? [] : Array.from(node.attributes, (attr) => attr.name).sort(), nodeIsFragment(node) ? {} : [...node.attributes].reduce((props, attribute) => {
|
|
269
|
+
props[attribute.name] = attribute.value;
|
|
270
|
+
return props;
|
|
271
|
+
}, {}), config, indentation + config.indent, depth, refs, printer), (resolvedShadowChildren.length > 0 ? printShadowRoot(resolvedShadowChildren, config, indentation + config.indent, depth, refs, printer) : "") + printChildren(resolvedChildren, config, indentation + config.indent, depth, refs, printer), config, indentation);
|
|
272
|
+
}
|
|
273
|
+
var serialize$3 = (node, config, indentation, depth, refs, printer) => serializeDOM(node, config, indentation, depth, refs, printer);
|
|
274
|
+
function createDOMElementFilter(filterNode) {
|
|
275
|
+
return {
|
|
276
|
+
test: test$3,
|
|
277
|
+
serialize: (node, config, indentation, depth, refs, printer) => serializeDOM(node, config, indentation, depth, refs, printer, filterNode)
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
var plugin$3 = {
|
|
281
|
+
serialize: serialize$3,
|
|
282
|
+
test: test$3
|
|
283
|
+
};
|
|
284
|
+
var IS_ITERABLE_SENTINEL = "@@__IMMUTABLE_ITERABLE__@@";
|
|
285
|
+
var IS_LIST_SENTINEL = "@@__IMMUTABLE_LIST__@@";
|
|
286
|
+
var IS_KEYED_SENTINEL = "@@__IMMUTABLE_KEYED__@@";
|
|
287
|
+
var IS_MAP_SENTINEL = "@@__IMMUTABLE_MAP__@@";
|
|
288
|
+
var IS_ORDERED_SENTINEL = "@@__IMMUTABLE_ORDERED__@@";
|
|
289
|
+
var IS_RECORD_SENTINEL = "@@__IMMUTABLE_RECORD__@@";
|
|
290
|
+
var IS_SEQ_SENTINEL = "@@__IMMUTABLE_SEQ__@@";
|
|
291
|
+
var IS_SET_SENTINEL = "@@__IMMUTABLE_SET__@@";
|
|
292
|
+
var IS_STACK_SENTINEL = "@@__IMMUTABLE_STACK__@@";
|
|
293
|
+
var getImmutableName = (name) => `Immutable.${name}`;
|
|
294
|
+
var printAsLeaf = (name) => `[${name}]`;
|
|
295
|
+
var SPACE = " ";
|
|
296
|
+
var LAZY = "…";
|
|
297
|
+
function printImmutableEntries(val, config, indentation, depth, refs, printer, type) {
|
|
298
|
+
return ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : `${getImmutableName(type) + SPACE}{${printIteratorEntries(val.entries(), config, indentation, depth, refs, printer)}}`;
|
|
299
|
+
}
|
|
300
|
+
function getRecordEntries(val) {
|
|
301
|
+
let i = 0;
|
|
302
|
+
return { next() {
|
|
303
|
+
if (i < val._keys.length) {
|
|
304
|
+
const key = val._keys[i++];
|
|
305
|
+
return {
|
|
306
|
+
done: false,
|
|
307
|
+
value: [key, val.get(key)]
|
|
308
|
+
};
|
|
309
|
+
}
|
|
310
|
+
return {
|
|
311
|
+
done: true,
|
|
312
|
+
value: void 0
|
|
313
|
+
};
|
|
314
|
+
} };
|
|
315
|
+
}
|
|
316
|
+
function printImmutableRecord(val, config, indentation, depth, refs, printer) {
|
|
317
|
+
const name = getImmutableName(val._name || "Record");
|
|
318
|
+
return ++depth > config.maxDepth ? printAsLeaf(name) : `${name + SPACE}{${printIteratorEntries(getRecordEntries(val), config, indentation, depth, refs, printer)}}`;
|
|
319
|
+
}
|
|
320
|
+
function printImmutableSeq(val, config, indentation, depth, refs, printer) {
|
|
321
|
+
const name = getImmutableName("Seq");
|
|
322
|
+
if (++depth > config.maxDepth) return printAsLeaf(name);
|
|
323
|
+
if (val[IS_KEYED_SENTINEL]) return `${name + SPACE}{${val._iter || val._object ? printIteratorEntries(val.entries(), config, indentation, depth, refs, printer) : LAZY}}`;
|
|
324
|
+
return `${name + SPACE}[${val._iter || val._array || val._collection || val._iterable ? printIteratorValues(val.values(), config, indentation, depth, refs, printer) : LAZY}]`;
|
|
325
|
+
}
|
|
326
|
+
function printImmutableValues(val, config, indentation, depth, refs, printer, type) {
|
|
327
|
+
return ++depth > config.maxDepth ? printAsLeaf(getImmutableName(type)) : `${getImmutableName(type) + SPACE}[${printIteratorValues(val.values(), config, indentation, depth, refs, printer)}]`;
|
|
328
|
+
}
|
|
329
|
+
var serialize$2 = (val, config, indentation, depth, refs, printer) => {
|
|
330
|
+
if (val[IS_MAP_SENTINEL]) return printImmutableEntries(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? "OrderedMap" : "Map");
|
|
331
|
+
if (val[IS_LIST_SENTINEL]) return printImmutableValues(val, config, indentation, depth, refs, printer, "List");
|
|
332
|
+
if (val[IS_SET_SENTINEL]) return printImmutableValues(val, config, indentation, depth, refs, printer, val[IS_ORDERED_SENTINEL] ? "OrderedSet" : "Set");
|
|
333
|
+
if (val[IS_STACK_SENTINEL]) return printImmutableValues(val, config, indentation, depth, refs, printer, "Stack");
|
|
334
|
+
if (val[IS_SEQ_SENTINEL]) return printImmutableSeq(val, config, indentation, depth, refs, printer);
|
|
335
|
+
return printImmutableRecord(val, config, indentation, depth, refs, printer);
|
|
336
|
+
};
|
|
337
|
+
var test$2 = (val) => val && (val[IS_ITERABLE_SENTINEL] === true || val[IS_RECORD_SENTINEL] === true);
|
|
338
|
+
var plugin$2 = {
|
|
339
|
+
serialize: serialize$2,
|
|
340
|
+
test: test$2
|
|
341
|
+
};
|
|
342
|
+
function getDefaultExportFromCjs(x) {
|
|
343
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
344
|
+
}
|
|
345
|
+
var reactIs$1 = { exports: {} };
|
|
346
|
+
var reactIs_production = {};
|
|
347
|
+
/**
|
|
348
|
+
* @license React
|
|
349
|
+
* react-is.production.js
|
|
350
|
+
*
|
|
351
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
352
|
+
*
|
|
353
|
+
* This source code is licensed under the MIT license found in the
|
|
354
|
+
* LICENSE file in the root directory of this source tree.
|
|
355
|
+
*/
|
|
356
|
+
var hasRequiredReactIs_production;
|
|
357
|
+
function requireReactIs_production() {
|
|
358
|
+
if (hasRequiredReactIs_production) return reactIs_production;
|
|
359
|
+
hasRequiredReactIs_production = 1;
|
|
360
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.transitional.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_CONSUMER_TYPE = Symbol.for("react.consumer"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_VIEW_TRANSITION_TYPE = Symbol.for("react.view_transition"), REACT_CLIENT_REFERENCE = Symbol.for("react.client.reference");
|
|
361
|
+
function typeOf(object) {
|
|
362
|
+
if ("object" === typeof object && null !== object) {
|
|
363
|
+
var $$typeof = object.$$typeof;
|
|
364
|
+
switch ($$typeof) {
|
|
365
|
+
case REACT_ELEMENT_TYPE: switch (object = object.type, object) {
|
|
366
|
+
case REACT_FRAGMENT_TYPE:
|
|
367
|
+
case REACT_PROFILER_TYPE:
|
|
368
|
+
case REACT_STRICT_MODE_TYPE:
|
|
369
|
+
case REACT_SUSPENSE_TYPE:
|
|
370
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
371
|
+
case REACT_VIEW_TRANSITION_TYPE: return object;
|
|
372
|
+
default: switch (object = object && object.$$typeof, object) {
|
|
373
|
+
case REACT_CONTEXT_TYPE:
|
|
374
|
+
case REACT_FORWARD_REF_TYPE:
|
|
375
|
+
case REACT_LAZY_TYPE:
|
|
376
|
+
case REACT_MEMO_TYPE: return object;
|
|
377
|
+
case REACT_CONSUMER_TYPE: return object;
|
|
378
|
+
default: return $$typeof;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
case REACT_PORTAL_TYPE: return $$typeof;
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
reactIs_production.ContextConsumer = REACT_CONSUMER_TYPE;
|
|
386
|
+
reactIs_production.ContextProvider = REACT_CONTEXT_TYPE;
|
|
387
|
+
reactIs_production.Element = REACT_ELEMENT_TYPE;
|
|
388
|
+
reactIs_production.ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
389
|
+
reactIs_production.Fragment = REACT_FRAGMENT_TYPE;
|
|
390
|
+
reactIs_production.Lazy = REACT_LAZY_TYPE;
|
|
391
|
+
reactIs_production.Memo = REACT_MEMO_TYPE;
|
|
392
|
+
reactIs_production.Portal = REACT_PORTAL_TYPE;
|
|
393
|
+
reactIs_production.Profiler = REACT_PROFILER_TYPE;
|
|
394
|
+
reactIs_production.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
395
|
+
reactIs_production.Suspense = REACT_SUSPENSE_TYPE;
|
|
396
|
+
reactIs_production.SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
397
|
+
reactIs_production.isContextConsumer = function(object) {
|
|
398
|
+
return typeOf(object) === REACT_CONSUMER_TYPE;
|
|
399
|
+
};
|
|
400
|
+
reactIs_production.isContextProvider = function(object) {
|
|
401
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
402
|
+
};
|
|
403
|
+
reactIs_production.isElement = function(object) {
|
|
404
|
+
return "object" === typeof object && null !== object && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
405
|
+
};
|
|
406
|
+
reactIs_production.isForwardRef = function(object) {
|
|
407
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
408
|
+
};
|
|
409
|
+
reactIs_production.isFragment = function(object) {
|
|
410
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
411
|
+
};
|
|
412
|
+
reactIs_production.isLazy = function(object) {
|
|
413
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
414
|
+
};
|
|
415
|
+
reactIs_production.isMemo = function(object) {
|
|
416
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
417
|
+
};
|
|
418
|
+
reactIs_production.isPortal = function(object) {
|
|
419
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
420
|
+
};
|
|
421
|
+
reactIs_production.isProfiler = function(object) {
|
|
422
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
423
|
+
};
|
|
424
|
+
reactIs_production.isStrictMode = function(object) {
|
|
425
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
426
|
+
};
|
|
427
|
+
reactIs_production.isSuspense = function(object) {
|
|
428
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
429
|
+
};
|
|
430
|
+
reactIs_production.isSuspenseList = function(object) {
|
|
431
|
+
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
432
|
+
};
|
|
433
|
+
reactIs_production.isValidElementType = function(type) {
|
|
434
|
+
return "string" === typeof type || "function" === typeof type || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || "object" === typeof type && null !== type && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE || void 0 !== type.getModuleId) ? true : false;
|
|
435
|
+
};
|
|
436
|
+
reactIs_production.typeOf = typeOf;
|
|
437
|
+
return reactIs_production;
|
|
438
|
+
}
|
|
439
|
+
var hasRequiredReactIs$1;
|
|
440
|
+
function requireReactIs$1() {
|
|
441
|
+
if (hasRequiredReactIs$1) return reactIs$1.exports;
|
|
442
|
+
hasRequiredReactIs$1 = 1;
|
|
443
|
+
reactIs$1.exports = requireReactIs_production();
|
|
444
|
+
return reactIs$1.exports;
|
|
445
|
+
}
|
|
446
|
+
var reactIsExports$1 = requireReactIs$1();
|
|
447
|
+
var ReactIs19 = /*#__PURE__*/ _mergeNamespaces({
|
|
448
|
+
__proto__: null,
|
|
449
|
+
default: /* @__PURE__ */ getDefaultExportFromCjs(reactIsExports$1)
|
|
450
|
+
}, [reactIsExports$1]);
|
|
451
|
+
var reactIs = { exports: {} };
|
|
452
|
+
var reactIs_production_min = {};
|
|
453
|
+
/**
|
|
454
|
+
* @license React
|
|
455
|
+
* react-is.production.min.js
|
|
456
|
+
*
|
|
457
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
458
|
+
*
|
|
459
|
+
* This source code is licensed under the MIT license found in the
|
|
460
|
+
* LICENSE file in the root directory of this source tree.
|
|
461
|
+
*/
|
|
462
|
+
var hasRequiredReactIs_production_min;
|
|
463
|
+
function requireReactIs_production_min() {
|
|
464
|
+
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
465
|
+
hasRequiredReactIs_production_min = 1;
|
|
466
|
+
var b = Symbol.for("react.element"), c = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), e = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), h = Symbol.for("react.context"), k = Symbol.for("react.server_context"), l = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), n = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), t = Symbol.for("react.offscreen"), u = Symbol.for("react.module.reference");
|
|
467
|
+
function v(a) {
|
|
468
|
+
if ("object" === typeof a && null !== a) {
|
|
469
|
+
var r = a.$$typeof;
|
|
470
|
+
switch (r) {
|
|
471
|
+
case b: switch (a = a.type, a) {
|
|
472
|
+
case d:
|
|
473
|
+
case f:
|
|
474
|
+
case e:
|
|
475
|
+
case m:
|
|
476
|
+
case n: return a;
|
|
477
|
+
default: switch (a = a && a.$$typeof, a) {
|
|
478
|
+
case k:
|
|
479
|
+
case h:
|
|
480
|
+
case l:
|
|
481
|
+
case q:
|
|
482
|
+
case p:
|
|
483
|
+
case g: return a;
|
|
484
|
+
default: return r;
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
case c: return r;
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
reactIs_production_min.ContextConsumer = h;
|
|
492
|
+
reactIs_production_min.ContextProvider = g;
|
|
493
|
+
reactIs_production_min.Element = b;
|
|
494
|
+
reactIs_production_min.ForwardRef = l;
|
|
495
|
+
reactIs_production_min.Fragment = d;
|
|
496
|
+
reactIs_production_min.Lazy = q;
|
|
497
|
+
reactIs_production_min.Memo = p;
|
|
498
|
+
reactIs_production_min.Portal = c;
|
|
499
|
+
reactIs_production_min.Profiler = f;
|
|
500
|
+
reactIs_production_min.StrictMode = e;
|
|
501
|
+
reactIs_production_min.Suspense = m;
|
|
502
|
+
reactIs_production_min.SuspenseList = n;
|
|
503
|
+
reactIs_production_min.isAsyncMode = function() {
|
|
504
|
+
return false;
|
|
505
|
+
};
|
|
506
|
+
reactIs_production_min.isConcurrentMode = function() {
|
|
507
|
+
return false;
|
|
508
|
+
};
|
|
509
|
+
reactIs_production_min.isContextConsumer = function(a) {
|
|
510
|
+
return v(a) === h;
|
|
511
|
+
};
|
|
512
|
+
reactIs_production_min.isContextProvider = function(a) {
|
|
513
|
+
return v(a) === g;
|
|
514
|
+
};
|
|
515
|
+
reactIs_production_min.isElement = function(a) {
|
|
516
|
+
return "object" === typeof a && null !== a && a.$$typeof === b;
|
|
517
|
+
};
|
|
518
|
+
reactIs_production_min.isForwardRef = function(a) {
|
|
519
|
+
return v(a) === l;
|
|
520
|
+
};
|
|
521
|
+
reactIs_production_min.isFragment = function(a) {
|
|
522
|
+
return v(a) === d;
|
|
523
|
+
};
|
|
524
|
+
reactIs_production_min.isLazy = function(a) {
|
|
525
|
+
return v(a) === q;
|
|
526
|
+
};
|
|
527
|
+
reactIs_production_min.isMemo = function(a) {
|
|
528
|
+
return v(a) === p;
|
|
529
|
+
};
|
|
530
|
+
reactIs_production_min.isPortal = function(a) {
|
|
531
|
+
return v(a) === c;
|
|
532
|
+
};
|
|
533
|
+
reactIs_production_min.isProfiler = function(a) {
|
|
534
|
+
return v(a) === f;
|
|
535
|
+
};
|
|
536
|
+
reactIs_production_min.isStrictMode = function(a) {
|
|
537
|
+
return v(a) === e;
|
|
538
|
+
};
|
|
539
|
+
reactIs_production_min.isSuspense = function(a) {
|
|
540
|
+
return v(a) === m;
|
|
541
|
+
};
|
|
542
|
+
reactIs_production_min.isSuspenseList = function(a) {
|
|
543
|
+
return v(a) === n;
|
|
544
|
+
};
|
|
545
|
+
reactIs_production_min.isValidElementType = function(a) {
|
|
546
|
+
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;
|
|
547
|
+
};
|
|
548
|
+
reactIs_production_min.typeOf = v;
|
|
549
|
+
return reactIs_production_min;
|
|
550
|
+
}
|
|
551
|
+
var hasRequiredReactIs;
|
|
552
|
+
function requireReactIs() {
|
|
553
|
+
if (hasRequiredReactIs) return reactIs.exports;
|
|
554
|
+
hasRequiredReactIs = 1;
|
|
555
|
+
reactIs.exports = requireReactIs_production_min();
|
|
556
|
+
return reactIs.exports;
|
|
557
|
+
}
|
|
558
|
+
var reactIsExports = requireReactIs();
|
|
559
|
+
var ReactIs18 = /*#__PURE__*/ _mergeNamespaces({
|
|
560
|
+
__proto__: null,
|
|
561
|
+
default: /* @__PURE__ */ getDefaultExportFromCjs(reactIsExports)
|
|
562
|
+
}, [reactIsExports]);
|
|
563
|
+
var ReactIs = Object.fromEntries([
|
|
564
|
+
"isAsyncMode",
|
|
565
|
+
"isConcurrentMode",
|
|
566
|
+
"isContextConsumer",
|
|
567
|
+
"isContextProvider",
|
|
568
|
+
"isElement",
|
|
569
|
+
"isForwardRef",
|
|
570
|
+
"isFragment",
|
|
571
|
+
"isLazy",
|
|
572
|
+
"isMemo",
|
|
573
|
+
"isPortal",
|
|
574
|
+
"isProfiler",
|
|
575
|
+
"isStrictMode",
|
|
576
|
+
"isSuspense",
|
|
577
|
+
"isSuspenseList",
|
|
578
|
+
"isValidElementType"
|
|
579
|
+
].map((m) => [m, (v) => ReactIs18[m](v) || ReactIs19[m](v)]));
|
|
580
|
+
function getChildren(arg, children = []) {
|
|
581
|
+
if (Array.isArray(arg)) for (const item of arg) getChildren(item, children);
|
|
582
|
+
else if (arg != null && arg !== false && arg !== "") children.push(arg);
|
|
583
|
+
return children;
|
|
584
|
+
}
|
|
585
|
+
function getType(element) {
|
|
586
|
+
const type = element.type;
|
|
587
|
+
if (typeof type === "string") return type;
|
|
588
|
+
if (typeof type === "function") return type.displayName || type.name || "Unknown";
|
|
589
|
+
if (ReactIs.isFragment(element)) return "React.Fragment";
|
|
590
|
+
if (ReactIs.isSuspense(element)) return "React.Suspense";
|
|
591
|
+
if (typeof type === "object" && type !== null) {
|
|
592
|
+
if (ReactIs.isContextProvider(element)) return "Context.Provider";
|
|
593
|
+
if (ReactIs.isContextConsumer(element)) return "Context.Consumer";
|
|
594
|
+
if (ReactIs.isForwardRef(element)) {
|
|
595
|
+
if (type.displayName) return type.displayName;
|
|
596
|
+
const functionName = type.render.displayName || type.render.name || "";
|
|
597
|
+
return functionName === "" ? "ForwardRef" : `ForwardRef(${functionName})`;
|
|
598
|
+
}
|
|
599
|
+
if (ReactIs.isMemo(element)) {
|
|
600
|
+
const functionName = type.displayName || type.type.displayName || type.type.name || "";
|
|
601
|
+
return functionName === "" ? "Memo" : `Memo(${functionName})`;
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
return "UNDEFINED";
|
|
605
|
+
}
|
|
606
|
+
function getPropKeys$1(element) {
|
|
607
|
+
const { props } = element;
|
|
608
|
+
return Object.keys(props).filter((key) => key !== "children" && props[key] !== void 0).sort();
|
|
609
|
+
}
|
|
610
|
+
var serialize$1 = (element, config, indentation, depth, refs, printer) => ++depth > config.maxDepth ? printElementAsLeaf(getType(element), config) : printElement(getType(element), printProps(getPropKeys$1(element), element.props, config, indentation + config.indent, depth, refs, printer), printChildren(getChildren(element.props.children), config, indentation + config.indent, depth, refs, printer), config, indentation);
|
|
611
|
+
var test$1 = (val) => val != null && ReactIs.isElement(val);
|
|
612
|
+
var plugin$1 = {
|
|
613
|
+
serialize: serialize$1,
|
|
614
|
+
test: test$1
|
|
615
|
+
};
|
|
616
|
+
var testSymbol = typeof Symbol === "function" && Symbol.for ? Symbol.for("react.test.json") : 245830487;
|
|
617
|
+
function getPropKeys(object) {
|
|
618
|
+
const { props } = object;
|
|
619
|
+
return props ? Object.keys(props).filter((key) => props[key] !== void 0).sort() : [];
|
|
620
|
+
}
|
|
621
|
+
var serialize = (object, config, indentation, depth, refs, printer) => ++depth > config.maxDepth ? printElementAsLeaf(object.type, config) : printElement(object.type, object.props ? printProps(getPropKeys(object), object.props, config, indentation + config.indent, depth, refs, printer) : "", object.children ? printChildren(object.children, config, indentation + config.indent, depth, refs, printer) : "", config, indentation);
|
|
622
|
+
var test = (val) => val && val.$$typeof === testSymbol;
|
|
623
|
+
var plugin = {
|
|
624
|
+
serialize,
|
|
625
|
+
test
|
|
626
|
+
};
|
|
627
|
+
var toString = Object.prototype.toString;
|
|
628
|
+
var toISOString = Date.prototype.toISOString;
|
|
629
|
+
var errorToString = Error.prototype.toString;
|
|
630
|
+
var regExpToString = RegExp.prototype.toString;
|
|
631
|
+
/**
|
|
632
|
+
* Explicitly comparing typeof constructor to function avoids undefined as name
|
|
633
|
+
* when mock identity-obj-proxy returns the key as the value for any key.
|
|
634
|
+
*/
|
|
635
|
+
function getConstructorName(val) {
|
|
636
|
+
return typeof val.constructor === "function" && val.constructor.name || "Object";
|
|
637
|
+
}
|
|
638
|
+
/** Is val is equal to global window object? Works even if it does not exist :) */
|
|
639
|
+
function isWindow(val) {
|
|
640
|
+
return typeof window !== "undefined" && val === window;
|
|
641
|
+
}
|
|
642
|
+
var SYMBOL_REGEXP = /^Symbol\((.*)\)(.*)$/;
|
|
643
|
+
var NEWLINE_REGEXP = /\n/g;
|
|
644
|
+
var PrettyFormatPluginError = class extends Error {
|
|
645
|
+
constructor(message, stack) {
|
|
646
|
+
super(message);
|
|
647
|
+
this.stack = stack;
|
|
648
|
+
this.name = this.constructor.name;
|
|
649
|
+
}
|
|
650
|
+
};
|
|
651
|
+
function isToStringedArrayType(toStringed) {
|
|
652
|
+
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]";
|
|
653
|
+
}
|
|
654
|
+
function printNumber(val) {
|
|
655
|
+
return Object.is(val, -0) ? "-0" : String(val);
|
|
656
|
+
}
|
|
657
|
+
function printBigInt(val) {
|
|
658
|
+
return String(`${val}n`);
|
|
659
|
+
}
|
|
660
|
+
function printFunction(val, printFunctionName) {
|
|
661
|
+
if (!printFunctionName) return "[Function]";
|
|
662
|
+
return `[Function ${val.name || "anonymous"}]`;
|
|
663
|
+
}
|
|
664
|
+
function printSymbol(val) {
|
|
665
|
+
return String(val).replace(SYMBOL_REGEXP, "Symbol($1)");
|
|
666
|
+
}
|
|
667
|
+
function printError(val) {
|
|
668
|
+
return `[${errorToString.call(val)}]`;
|
|
669
|
+
}
|
|
670
|
+
/**
|
|
671
|
+
* The first port of call for printing an object, handles most of the
|
|
672
|
+
* data-types in JS.
|
|
673
|
+
*/
|
|
674
|
+
function printBasicValue(val, printFunctionName, escapeRegex, escapeString) {
|
|
675
|
+
if (val === true || val === false) return `${val}`;
|
|
676
|
+
if (val === void 0) return "undefined";
|
|
677
|
+
if (val === null) return "null";
|
|
678
|
+
const typeOf = typeof val;
|
|
679
|
+
if (typeOf === "number") return printNumber(val);
|
|
680
|
+
if (typeOf === "bigint") return printBigInt(val);
|
|
681
|
+
if (typeOf === "string") {
|
|
682
|
+
if (escapeString) return `"${val.replaceAll(/"|\\/g, "\\$&")}"`;
|
|
683
|
+
return `"${val}"`;
|
|
684
|
+
}
|
|
685
|
+
if (typeOf === "function") return printFunction(val, printFunctionName);
|
|
686
|
+
if (typeOf === "symbol") return printSymbol(val);
|
|
687
|
+
const toStringed = toString.call(val);
|
|
688
|
+
if (toStringed === "[object WeakMap]") return "WeakMap {}";
|
|
689
|
+
if (toStringed === "[object WeakSet]") return "WeakSet {}";
|
|
690
|
+
if (toStringed === "[object Function]" || toStringed === "[object GeneratorFunction]") return printFunction(val, printFunctionName);
|
|
691
|
+
if (toStringed === "[object Symbol]") return printSymbol(val);
|
|
692
|
+
if (toStringed === "[object Date]") return Number.isNaN(+val) ? "Date { NaN }" : toISOString.call(val);
|
|
693
|
+
if (toStringed === "[object Error]") return printError(val);
|
|
694
|
+
if (toStringed === "[object RegExp]") {
|
|
695
|
+
if (escapeRegex) return regExpToString.call(val).replaceAll(/[$()*+.?[\\\]^{|}]/g, "\\$&");
|
|
696
|
+
return regExpToString.call(val);
|
|
697
|
+
}
|
|
698
|
+
if (val instanceof Error) return printError(val);
|
|
699
|
+
return null;
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Handles more complex objects ( such as objects with circular references.
|
|
703
|
+
* maps and sets etc )
|
|
704
|
+
*/
|
|
705
|
+
function printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON) {
|
|
706
|
+
if (refs.includes(val)) return "[Circular]";
|
|
707
|
+
refs = [...refs];
|
|
708
|
+
refs.push(val);
|
|
709
|
+
const hitMaxDepth = ++depth > config.maxDepth;
|
|
710
|
+
const min = config.min;
|
|
711
|
+
if (config.callToJSON && !hitMaxDepth && val.toJSON && typeof val.toJSON === "function" && !hasCalledToJSON) return printer(val.toJSON(), config, indentation, depth, refs, true);
|
|
712
|
+
const toStringed = toString.call(val);
|
|
713
|
+
if (toStringed === "[object Arguments]") return hitMaxDepth ? "[Arguments]" : `${min ? "" : "Arguments "}[${printListItems(val, config, indentation, depth, refs, printer)}]`;
|
|
714
|
+
if (isToStringedArrayType(toStringed)) return hitMaxDepth ? `[${val.constructor.name}]` : `${min ? "" : !config.printBasicPrototype && val.constructor.name === "Array" ? "" : `${val.constructor.name} `}[${printListItems(val, config, indentation, depth, refs, printer)}]`;
|
|
715
|
+
if (toStringed === "[object Map]") return hitMaxDepth ? "[Map]" : `Map {${printIteratorEntries(val.entries(), config, indentation, depth, refs, printer, " => ")}}`;
|
|
716
|
+
if (toStringed === "[object Set]") return hitMaxDepth ? "[Set]" : `Set {${printIteratorValues(val.values(), config, indentation, depth, refs, printer)}}`;
|
|
717
|
+
return hitMaxDepth || isWindow(val) ? `[${getConstructorName(val)}]` : `${min ? "" : !config.printBasicPrototype && getConstructorName(val) === "Object" ? "" : `${getConstructorName(val)} `}{${printObjectProperties(val, config, indentation, depth, refs, printer)}}`;
|
|
718
|
+
}
|
|
719
|
+
var ErrorPlugin = {
|
|
720
|
+
test: (val) => val && val instanceof Error,
|
|
721
|
+
serialize(val, config, indentation, depth, refs, printer) {
|
|
722
|
+
if (refs.includes(val)) return "[Circular]";
|
|
723
|
+
refs = [...refs, val];
|
|
724
|
+
const hitMaxDepth = ++depth > config.maxDepth;
|
|
725
|
+
const { message, cause, ...rest } = val;
|
|
726
|
+
const entries = {
|
|
727
|
+
message,
|
|
728
|
+
...typeof cause !== "undefined" ? { cause } : {},
|
|
729
|
+
...val instanceof AggregateError ? { errors: val.errors } : {},
|
|
730
|
+
...rest
|
|
731
|
+
};
|
|
732
|
+
const name = val.name !== "Error" ? val.name : getConstructorName(val);
|
|
733
|
+
return hitMaxDepth ? `[${name}]` : `${name} {${printIteratorEntries(Object.entries(entries).values(), config, indentation, depth, refs, printer)}}`;
|
|
734
|
+
}
|
|
735
|
+
};
|
|
736
|
+
function isNewPlugin(plugin) {
|
|
737
|
+
return plugin.serialize != null;
|
|
738
|
+
}
|
|
739
|
+
function printPlugin(plugin, val, config, indentation, depth, refs) {
|
|
740
|
+
let printed;
|
|
741
|
+
try {
|
|
742
|
+
printed = isNewPlugin(plugin) ? plugin.serialize(val, config, indentation, depth, refs, printer) : plugin.print(val, (valChild) => printer(valChild, config, indentation, depth, refs), (str) => {
|
|
743
|
+
const indentationNext = indentation + config.indent;
|
|
744
|
+
return indentationNext + str.replaceAll(NEWLINE_REGEXP, `\n${indentationNext}`);
|
|
745
|
+
}, {
|
|
746
|
+
edgeSpacing: config.spacingOuter,
|
|
747
|
+
min: config.min,
|
|
748
|
+
spacing: config.spacingInner
|
|
749
|
+
}, config.colors);
|
|
750
|
+
} catch (error) {
|
|
751
|
+
throw new PrettyFormatPluginError(error.message, error.stack);
|
|
752
|
+
}
|
|
753
|
+
if (typeof printed !== "string") throw new TypeError(`pretty-format: Plugin must return type "string" but instead returned "${typeof printed}".`);
|
|
754
|
+
return printed;
|
|
755
|
+
}
|
|
756
|
+
function findPlugin(plugins, val) {
|
|
757
|
+
for (const plugin of plugins) try {
|
|
758
|
+
if (plugin.test(val)) return plugin;
|
|
759
|
+
} catch (error) {
|
|
760
|
+
throw new PrettyFormatPluginError(error.message, error.stack);
|
|
761
|
+
}
|
|
762
|
+
return null;
|
|
763
|
+
}
|
|
764
|
+
function printer(val, config, indentation, depth, refs, hasCalledToJSON) {
|
|
765
|
+
let result;
|
|
766
|
+
const plugin = findPlugin(config.plugins, val);
|
|
767
|
+
if (plugin !== null) result = printPlugin(plugin, val, config, indentation, depth, refs);
|
|
768
|
+
else {
|
|
769
|
+
const basicResult = printBasicValue(val, config.printFunctionName, config.escapeRegex, config.escapeString);
|
|
770
|
+
if (basicResult !== null) result = basicResult;
|
|
771
|
+
else result = printComplexValue(val, config, indentation, depth, refs, hasCalledToJSON);
|
|
772
|
+
}
|
|
773
|
+
config.outputLength += result.length;
|
|
774
|
+
if (config.outputLength > config.maxOutputLength) config.maxDepth = 0;
|
|
775
|
+
return result;
|
|
776
|
+
}
|
|
777
|
+
var DEFAULT_THEME = {
|
|
778
|
+
comment: "gray",
|
|
779
|
+
content: "reset",
|
|
780
|
+
prop: "yellow",
|
|
781
|
+
tag: "cyan",
|
|
782
|
+
value: "green"
|
|
783
|
+
};
|
|
784
|
+
var DEFAULT_THEME_KEYS = Object.keys(DEFAULT_THEME);
|
|
785
|
+
var DEFAULT_OPTIONS = {
|
|
786
|
+
callToJSON: true,
|
|
787
|
+
compareKeys: void 0,
|
|
788
|
+
escapeRegex: false,
|
|
789
|
+
escapeString: true,
|
|
790
|
+
highlight: false,
|
|
791
|
+
indent: 2,
|
|
792
|
+
maxDepth: Number.POSITIVE_INFINITY,
|
|
793
|
+
maxOutputLength: 1e6,
|
|
794
|
+
maxWidth: Number.POSITIVE_INFINITY,
|
|
795
|
+
min: false,
|
|
796
|
+
plugins: [],
|
|
797
|
+
printBasicPrototype: true,
|
|
798
|
+
printFunctionName: true,
|
|
799
|
+
printShadowRoot: true,
|
|
800
|
+
theme: DEFAULT_THEME
|
|
801
|
+
};
|
|
802
|
+
function validateOptions(options) {
|
|
803
|
+
for (const key of Object.keys(options)) if (!Object.hasOwn(DEFAULT_OPTIONS, key)) throw new Error(`pretty-format: Unknown option "${key}".`);
|
|
804
|
+
if (options.min && options.indent !== void 0 && options.indent !== 0) throw new Error("pretty-format: Options \"min\" and \"indent\" cannot be used together.");
|
|
805
|
+
}
|
|
806
|
+
function getColorsHighlight() {
|
|
807
|
+
return DEFAULT_THEME_KEYS.reduce((colors, key) => {
|
|
808
|
+
const value = DEFAULT_THEME[key];
|
|
809
|
+
const color = value && C[value];
|
|
810
|
+
if (color && typeof color.close === "string" && typeof color.open === "string") colors[key] = color;
|
|
811
|
+
else throw new Error(`pretty-format: Option "theme" has a key "${key}" whose value "${value}" is undefined in ansi-styles.`);
|
|
812
|
+
return colors;
|
|
813
|
+
}, Object.create(null));
|
|
814
|
+
}
|
|
815
|
+
function getColorsEmpty() {
|
|
816
|
+
return DEFAULT_THEME_KEYS.reduce((colors, key) => {
|
|
817
|
+
colors[key] = {
|
|
818
|
+
close: "",
|
|
819
|
+
open: ""
|
|
820
|
+
};
|
|
821
|
+
return colors;
|
|
822
|
+
}, Object.create(null));
|
|
823
|
+
}
|
|
824
|
+
function getPrintFunctionName(options) {
|
|
825
|
+
return options?.printFunctionName ?? DEFAULT_OPTIONS.printFunctionName;
|
|
826
|
+
}
|
|
827
|
+
function getEscapeRegex(options) {
|
|
828
|
+
return options?.escapeRegex ?? DEFAULT_OPTIONS.escapeRegex;
|
|
829
|
+
}
|
|
830
|
+
function getEscapeString(options) {
|
|
831
|
+
return options?.escapeString ?? DEFAULT_OPTIONS.escapeString;
|
|
832
|
+
}
|
|
833
|
+
function getConfig(options) {
|
|
834
|
+
return {
|
|
835
|
+
callToJSON: options?.callToJSON ?? DEFAULT_OPTIONS.callToJSON,
|
|
836
|
+
colors: options?.highlight ? getColorsHighlight() : getColorsEmpty(),
|
|
837
|
+
compareKeys: typeof options?.compareKeys === "function" || options?.compareKeys === null ? options.compareKeys : DEFAULT_OPTIONS.compareKeys,
|
|
838
|
+
escapeRegex: getEscapeRegex(options),
|
|
839
|
+
escapeString: getEscapeString(options),
|
|
840
|
+
indent: options?.min ? "" : createIndent(options?.indent ?? DEFAULT_OPTIONS.indent),
|
|
841
|
+
maxDepth: options?.maxDepth ?? DEFAULT_OPTIONS.maxDepth,
|
|
842
|
+
maxWidth: options?.maxWidth ?? DEFAULT_OPTIONS.maxWidth,
|
|
843
|
+
min: options?.min ?? DEFAULT_OPTIONS.min,
|
|
844
|
+
plugins: options?.plugins ?? DEFAULT_OPTIONS.plugins,
|
|
845
|
+
printBasicPrototype: options?.printBasicPrototype ?? true,
|
|
846
|
+
printFunctionName: getPrintFunctionName(options),
|
|
847
|
+
printShadowRoot: options?.printShadowRoot ?? true,
|
|
848
|
+
spacingInner: options?.min ? " " : "\n",
|
|
849
|
+
spacingOuter: options?.min ? "" : "\n",
|
|
850
|
+
maxOutputLength: options?.maxOutputLength ?? DEFAULT_OPTIONS.maxOutputLength,
|
|
851
|
+
outputLength: 0
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
function createIndent(indent) {
|
|
855
|
+
return Array.from({ length: indent + 1 }).join(" ");
|
|
856
|
+
}
|
|
857
|
+
/**
|
|
858
|
+
* Returns a presentation string of your `val` object
|
|
859
|
+
* @param val any potential JavaScript object
|
|
860
|
+
* @param options Custom settings
|
|
861
|
+
*/
|
|
862
|
+
function format(val, options) {
|
|
863
|
+
if (options) {
|
|
864
|
+
validateOptions(options);
|
|
865
|
+
if (options.plugins) {
|
|
866
|
+
const plugin = findPlugin(options.plugins, val);
|
|
867
|
+
if (plugin !== null) return printPlugin(plugin, val, getConfig(options), "", 0, []);
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
const basicResult = printBasicValue(val, getPrintFunctionName(options), getEscapeRegex(options), getEscapeString(options));
|
|
871
|
+
if (basicResult !== null) return basicResult;
|
|
872
|
+
return printComplexValue(val, getConfig(options), "", 0, []);
|
|
873
|
+
}
|
|
874
|
+
var plugins = {
|
|
875
|
+
AsymmetricMatcher: plugin$5,
|
|
876
|
+
DOMCollection: plugin$4,
|
|
877
|
+
DOMElement: plugin$3,
|
|
878
|
+
Immutable: plugin$2,
|
|
879
|
+
ReactElement: plugin$1,
|
|
880
|
+
ReactTestComponent: plugin,
|
|
881
|
+
Error: ErrorPlugin
|
|
882
|
+
};
|
|
883
|
+
//#endregion
|
|
884
|
+
export { DEFAULT_OPTIONS, createDOMElementFilter, format, plugins };
|