@ryuzaki13/react-foundation-lib 2.19.0 → 2.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/error-report/diagnostics.d.ts.map +1 -1
- package/dist/error-report/drafts.d.ts.map +1 -1
- package/dist/error-report/errorReportStorage.d.ts +18 -0
- package/dist/error-report/errorReportStorage.d.ts.map +1 -0
- package/dist/error-report/index.d.ts +1 -0
- package/dist/error-report/index.d.ts.map +1 -1
- package/dist/error-report/index.js +552 -535
- package/dist/error-report/index.js.map +1 -1
- package/package.json +1 -1
- package/src/error-report/README.mdx +44 -5
|
@@ -8,33 +8,33 @@ import { g as s } from "../chunks/query-client-Gk7lxFz7.js";
|
|
|
8
8
|
import { getSessionStorageId as ee } from "../session-storage/index.js";
|
|
9
9
|
import { z as c } from "zod";
|
|
10
10
|
//#region src/error-report/captureOptions.ts
|
|
11
|
-
var te = 16384,
|
|
11
|
+
var te = 16384, ne = {
|
|
12
12
|
valuePolicy: "redacted",
|
|
13
13
|
dataPreviewBytes: {
|
|
14
14
|
query: 0,
|
|
15
15
|
persistedQuery: 0,
|
|
16
16
|
mutation: 0
|
|
17
17
|
}
|
|
18
|
-
},
|
|
19
|
-
function
|
|
18
|
+
}, re = ne;
|
|
19
|
+
function l(e) {
|
|
20
20
|
return e === void 0 || !Number.isFinite(e) ? 0 : Math.max(0, Math.min(te, Math.trunc(e)));
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
valuePolicy: e.valuePolicy ??
|
|
22
|
+
function ie(e) {
|
|
23
|
+
re = e ? {
|
|
24
|
+
valuePolicy: e.valuePolicy ?? ne.valuePolicy,
|
|
25
25
|
dataPreviewBytes: {
|
|
26
|
-
query:
|
|
27
|
-
persistedQuery:
|
|
28
|
-
mutation:
|
|
26
|
+
query: l(e.dataPreviewBytes?.query),
|
|
27
|
+
persistedQuery: l(e.dataPreviewBytes?.persistedQuery),
|
|
28
|
+
mutation: l(e.dataPreviewBytes?.mutation)
|
|
29
29
|
}
|
|
30
|
-
} :
|
|
30
|
+
} : ne;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
33
|
-
return
|
|
32
|
+
function u() {
|
|
33
|
+
return re;
|
|
34
34
|
}
|
|
35
35
|
//#endregion
|
|
36
36
|
//#region src/error-report/safeValue.ts
|
|
37
|
-
var
|
|
37
|
+
var ae = 4, oe = 20, d = 40, se = 4096, ce = 8192, le = "[REDACTED]", ue = [
|
|
38
38
|
"apikey",
|
|
39
39
|
"authorization",
|
|
40
40
|
"cookie",
|
|
@@ -45,21 +45,21 @@ var ie = 4, ae = 20, f = 40, p = 4096, oe = 8192, se = "[REDACTED]", ce = [
|
|
|
45
45
|
"secret",
|
|
46
46
|
"sessiontoken",
|
|
47
47
|
"token"
|
|
48
|
-
],
|
|
49
|
-
function
|
|
48
|
+
], de = "url", f;
|
|
49
|
+
function fe(e) {
|
|
50
50
|
return e.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
51
51
|
}
|
|
52
|
-
function
|
|
53
|
-
let t =
|
|
54
|
-
return
|
|
52
|
+
function pe(e) {
|
|
53
|
+
let t = fe(e);
|
|
54
|
+
return ue.some((e) => t.includes(e));
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
return
|
|
56
|
+
function me(e) {
|
|
57
|
+
return fe(e).endsWith(de);
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function he(e) {
|
|
60
60
|
return /^(?:https?:\/\/|\/)[^\s]*[?#]/i.test(e);
|
|
61
61
|
}
|
|
62
|
-
function
|
|
62
|
+
function ge(e) {
|
|
63
63
|
try {
|
|
64
64
|
let t = new URL(e, "https://error-report.invalid"), n = t.pathname;
|
|
65
65
|
return t.origin === "https://error-report.invalid" ? n : `${t.origin}${n}`;
|
|
@@ -67,8 +67,8 @@ function me(e) {
|
|
|
67
67
|
return e.split(/[?#]/, 1)[0] ?? e;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
function
|
|
71
|
-
if (
|
|
70
|
+
function p(e, t = se) {
|
|
71
|
+
if (u().valuePolicy === "verbatim") {
|
|
72
72
|
if (e.length <= t) return e;
|
|
73
73
|
let n = `… [TRUNCATED: ${e.length} characters total]`;
|
|
74
74
|
if (n.length > t) return "[TRUNCATED]".slice(0, Math.max(0, t));
|
|
@@ -78,40 +78,40 @@ function h(e, t = p) {
|
|
|
78
78
|
let n = e.slice(0, t);
|
|
79
79
|
return /\bbearer\s/i.test(n) && (n = n.replace(/\bBearer\s+[A-Za-z0-9._~+/=-]{8,}/gi, "Bearer [REDACTED]")), n.includes("@") && (n = n.replace(/[A-Z0-9._%+-]{1,254}@[A-Z0-9.-]{1,253}\.[A-Z]{2,63}/gi, "[REDACTED_EMAIL]")), n;
|
|
80
80
|
}
|
|
81
|
-
function
|
|
81
|
+
function m(e) {
|
|
82
82
|
return new TextEncoder().encode(e).byteLength;
|
|
83
83
|
}
|
|
84
|
-
function
|
|
85
|
-
if (
|
|
86
|
-
let n =
|
|
84
|
+
function h(e, t) {
|
|
85
|
+
if (u().valuePolicy === "verbatim") {
|
|
86
|
+
let n = m(e);
|
|
87
87
|
if (n <= t) return e;
|
|
88
88
|
let r = `… [TRUNCATED: ${n} UTF-8 bytes total]`;
|
|
89
|
-
if (
|
|
90
|
-
let i = Math.max(0, t -
|
|
89
|
+
if (m(r) > t) return "[TRUNCATED]".slice(0, Math.max(0, t));
|
|
90
|
+
let i = Math.max(0, t - m(r)), a = 0, o = e.length;
|
|
91
91
|
for (; a < o;) {
|
|
92
92
|
let t = Math.ceil((a + o) / 2);
|
|
93
|
-
|
|
93
|
+
m(e.slice(0, t)) <= i ? a = t : o = t - 1;
|
|
94
94
|
}
|
|
95
95
|
let s = e.charCodeAt(a - 1), ee = s >= 55296 && s <= 56319 ? a - 1 : a;
|
|
96
96
|
return `${e.slice(0, ee)}${r}`;
|
|
97
97
|
}
|
|
98
|
-
let n =
|
|
99
|
-
if (
|
|
98
|
+
let n = p(e, t);
|
|
99
|
+
if (m(n) <= t) return n;
|
|
100
100
|
let r = 0, i = n.length;
|
|
101
101
|
for (; r < i;) {
|
|
102
102
|
let e = Math.ceil((r + i) / 2);
|
|
103
|
-
|
|
103
|
+
m(n.slice(0, e)) <= t ? r = e : i = e - 1;
|
|
104
104
|
}
|
|
105
105
|
let a = n.charCodeAt(r - 1), o = a >= 55296 && a <= 56319 ? r - 1 : r;
|
|
106
106
|
return n.slice(0, o);
|
|
107
107
|
}
|
|
108
|
-
function
|
|
109
|
-
let i =
|
|
110
|
-
if (!i && r &&
|
|
111
|
-
if (t >=
|
|
108
|
+
function g(e, t, n, r) {
|
|
109
|
+
let i = u().valuePolicy === "verbatim";
|
|
110
|
+
if (!i && r && pe(r)) return le;
|
|
111
|
+
if (t >= ae) return { type: "truncated" };
|
|
112
112
|
if (e === null || typeof e == "boolean") return e;
|
|
113
113
|
if (typeof e == "number") return Number.isFinite(e) ? e : { type: "non-finite-number" };
|
|
114
|
-
if (typeof e == "string") return
|
|
114
|
+
if (typeof e == "string") return p(!i && (r && me(r) || he(e)) ? ge(e) : e, n.maxStringLength);
|
|
115
115
|
if (e === void 0) return { type: "undefined" };
|
|
116
116
|
if (e instanceof Date) return Number.isNaN(e.getTime()) ? { type: "invalid-date" } : e.toISOString();
|
|
117
117
|
if (typeof e == "object") {
|
|
@@ -119,14 +119,14 @@ function v(e, t, n, r) {
|
|
|
119
119
|
n.seen.add(e);
|
|
120
120
|
}
|
|
121
121
|
if (Array.isArray(e)) {
|
|
122
|
-
let r = i && e.length >
|
|
122
|
+
let r = i && e.length > oe ? 19 : oe, a = e.slice(0, r).map((e) => g(e, t + 1, n));
|
|
123
123
|
return i && e.length > r && a.push({
|
|
124
124
|
type: "truncated",
|
|
125
125
|
omittedItems: e.length - r
|
|
126
126
|
}), a;
|
|
127
127
|
}
|
|
128
128
|
if (typeof e == "object") try {
|
|
129
|
-
let r = Object.entries(e).sort(([e], [t]) => e.localeCompare(t)), a = i && r.length >
|
|
129
|
+
let r = Object.entries(e).sort(([e], [t]) => e.localeCompare(t)), a = i && r.length > d ? 39 : d, o = Object.fromEntries(r.slice(0, a).map(([e, r]) => [e, g(r, t + 1, n, e)]));
|
|
130
130
|
if (i && r.length > a) {
|
|
131
131
|
let t = "$truncated";
|
|
132
132
|
for (; Object.hasOwn(e, t);) t += "_";
|
|
@@ -141,164 +141,164 @@ function v(e, t, n, r) {
|
|
|
141
141
|
}
|
|
142
142
|
return typeof e == "function" ? { type: "function" } : typeof e == "symbol" ? { type: "symbol" } : typeof e == "bigint" ? e.toString() : { type: "unknown" };
|
|
143
143
|
}
|
|
144
|
-
function
|
|
145
|
-
return
|
|
144
|
+
function _e(e, t = 0) {
|
|
145
|
+
return g(e, t, {
|
|
146
146
|
seen: /* @__PURE__ */ new WeakSet(),
|
|
147
|
-
maxStringLength:
|
|
147
|
+
maxStringLength: se
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
|
-
function
|
|
151
|
-
if (t >=
|
|
150
|
+
function _(e, t = 0) {
|
|
151
|
+
if (t >= ae) return { type: "truncated" };
|
|
152
152
|
if (e === null) return { type: "null" };
|
|
153
153
|
if (e === void 0) return { type: "undefined" };
|
|
154
154
|
if (Array.isArray(e)) return {
|
|
155
155
|
type: "array",
|
|
156
156
|
length: e.length,
|
|
157
|
-
firstItemsShape: e.slice(0, 3).map((e) =>
|
|
157
|
+
firstItemsShape: e.slice(0, 3).map((e) => _(e, t + 1))
|
|
158
158
|
};
|
|
159
159
|
if (typeof e == "object") {
|
|
160
|
-
let n = Object.entries(e).slice(0,
|
|
160
|
+
let n = Object.entries(e).slice(0, d);
|
|
161
161
|
return {
|
|
162
162
|
type: "object",
|
|
163
163
|
keys: n.map(([e]) => e),
|
|
164
|
-
shape: Object.fromEntries(n.map(([e, n]) => [e,
|
|
164
|
+
shape: Object.fromEntries(n.map(([e, n]) => [e, _(n, t + 1)]))
|
|
165
165
|
};
|
|
166
166
|
}
|
|
167
167
|
return { type: typeof e };
|
|
168
168
|
}
|
|
169
|
-
function
|
|
170
|
-
|
|
169
|
+
function ve(e) {
|
|
170
|
+
f = e;
|
|
171
171
|
}
|
|
172
|
-
function
|
|
173
|
-
let r = t.scope === "query-key" || t.scope === "mutation-key" || t.scope === "persisted-query-key", i =
|
|
172
|
+
function v(e, t, n = se) {
|
|
173
|
+
let r = t.scope === "query-key" || t.scope === "mutation-key" || t.scope === "persisted-query-key", i = u().valuePolicy === "verbatim" && r ? Math.max(n, ce) : n, a = (e) => g(e, 0, {
|
|
174
174
|
seen: /* @__PURE__ */ new WeakSet(),
|
|
175
175
|
maxStringLength: i
|
|
176
176
|
}), o = a(e);
|
|
177
|
-
if (!
|
|
177
|
+
if (!f) return o;
|
|
178
178
|
try {
|
|
179
|
-
let e =
|
|
179
|
+
let e = f(o, t);
|
|
180
180
|
return e === void 0 ? void 0 : a(e);
|
|
181
181
|
} catch {
|
|
182
182
|
return;
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
function
|
|
185
|
+
function y(e, t = { scope: "context" }) {
|
|
186
186
|
if (!e) return;
|
|
187
|
-
let n =
|
|
187
|
+
let n = v(e, t);
|
|
188
188
|
if (!(!n || Array.isArray(n) || typeof n != "object")) return Object.keys(n).length ? n : void 0;
|
|
189
189
|
}
|
|
190
190
|
//#endregion
|
|
191
191
|
//#region src/error-report/breadcrumbs.ts
|
|
192
|
-
var
|
|
192
|
+
var ye = 20, be = 120, xe = [
|
|
193
193
|
"button",
|
|
194
194
|
"a",
|
|
195
195
|
"input",
|
|
196
196
|
"select",
|
|
197
197
|
"textarea",
|
|
198
198
|
"[role]"
|
|
199
|
-
].join(","),
|
|
200
|
-
function
|
|
199
|
+
].join(","), Se = /^[a-z0-9][a-z0-9._:/-]*$/i, b = [];
|
|
200
|
+
function Ce() {
|
|
201
201
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
202
202
|
}
|
|
203
|
-
function
|
|
204
|
-
|
|
203
|
+
function x(e) {
|
|
204
|
+
b = [...b, {
|
|
205
205
|
...e,
|
|
206
|
-
utc:
|
|
207
|
-
routeId: e.routeId ?
|
|
208
|
-
appId: e.appId ?
|
|
209
|
-
viewId: e.viewId ?
|
|
210
|
-
target: e.target ?
|
|
211
|
-
detail:
|
|
206
|
+
utc: p(e.utc ?? Ce(), 64),
|
|
207
|
+
routeId: e.routeId ? p(u().valuePolicy === "verbatim" ? e.routeId : e.routeId.split(/[?#]/, 1)[0] ?? e.routeId, 512) : void 0,
|
|
208
|
+
appId: e.appId ? p(e.appId, 128) : void 0,
|
|
209
|
+
viewId: e.viewId ? p(e.viewId, 128) : void 0,
|
|
210
|
+
target: e.target ? p(e.target, 2048) : void 0,
|
|
211
|
+
detail: y(e.detail, {
|
|
212
212
|
scope: "breadcrumb-detail",
|
|
213
213
|
source: e.type
|
|
214
214
|
})
|
|
215
215
|
}].slice(-80);
|
|
216
216
|
}
|
|
217
|
-
function
|
|
218
|
-
return
|
|
217
|
+
function we() {
|
|
218
|
+
return b.slice();
|
|
219
219
|
}
|
|
220
|
-
function
|
|
221
|
-
|
|
220
|
+
function Te() {
|
|
221
|
+
b = [];
|
|
222
222
|
}
|
|
223
|
-
function
|
|
224
|
-
return e(t,
|
|
223
|
+
function Ee(t) {
|
|
224
|
+
return e(t, be);
|
|
225
225
|
}
|
|
226
|
-
function
|
|
227
|
-
let t =
|
|
228
|
-
return t &&
|
|
226
|
+
function De(e) {
|
|
227
|
+
let t = Ee(e.getAttribute("data-error-report-target"));
|
|
228
|
+
return t && Se.test(t) ? t : void 0;
|
|
229
229
|
}
|
|
230
|
-
function
|
|
231
|
-
let n =
|
|
232
|
-
return n &&
|
|
230
|
+
function S(e, t) {
|
|
231
|
+
let n = Ee(e.getAttribute(t));
|
|
232
|
+
return n && Se.test(n) ? n : void 0;
|
|
233
233
|
}
|
|
234
|
-
function
|
|
235
|
-
let t =
|
|
234
|
+
function Oe(e) {
|
|
235
|
+
let t = De(e);
|
|
236
236
|
return {
|
|
237
|
-
role:
|
|
238
|
-
type:
|
|
237
|
+
role: S(e, "role"),
|
|
238
|
+
type: S(e, "type"),
|
|
239
239
|
errorReportTarget: t,
|
|
240
|
-
dataUi: t ? void 0 :
|
|
241
|
-
dataAction: t ? void 0 :
|
|
240
|
+
dataUi: t ? void 0 : S(e, "data-ui"),
|
|
241
|
+
dataAction: t ? void 0 : S(e, "data-action")
|
|
242
242
|
};
|
|
243
243
|
}
|
|
244
|
-
function
|
|
244
|
+
function ke(e) {
|
|
245
245
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/["\\#.[\]>~+:]/g, "\\$&");
|
|
246
246
|
}
|
|
247
|
-
function
|
|
248
|
-
let t =
|
|
249
|
-
return t.role && n.push(`[role="${t.role}"]`), t.type && n.push(`[type="${t.type}"]`), t.errorReportTarget ? n.push(`[data-error-report-target="${
|
|
247
|
+
function Ae(e) {
|
|
248
|
+
let t = Oe(e), n = [e.tagName.toLowerCase()];
|
|
249
|
+
return t.role && n.push(`[role="${t.role}"]`), t.type && n.push(`[type="${t.type}"]`), t.errorReportTarget ? n.push(`[data-error-report-target="${ke(t.errorReportTarget)}"]`) : (t.dataUi && n.push(`[data-ui="${ke(t.dataUi)}"]`), t.dataAction && n.push(`[data-action="${ke(t.dataAction)}"]`)), n.join("");
|
|
250
250
|
}
|
|
251
|
-
function
|
|
252
|
-
let t =
|
|
251
|
+
function je(e) {
|
|
252
|
+
let t = Oe(e);
|
|
253
253
|
return {
|
|
254
254
|
tag: e.tagName.toLowerCase(),
|
|
255
|
-
selector:
|
|
255
|
+
selector: Ae(e),
|
|
256
256
|
...t
|
|
257
257
|
};
|
|
258
258
|
}
|
|
259
|
-
function
|
|
259
|
+
function Me(e) {
|
|
260
260
|
return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0 && (!Array.isArray(e) || e.length > 0)));
|
|
261
261
|
}
|
|
262
|
-
function
|
|
262
|
+
function Ne(e) {
|
|
263
263
|
let t = [], n = e;
|
|
264
|
-
for (; n && n !== document.documentElement && t.length <
|
|
264
|
+
for (; n && n !== document.documentElement && t.length < ye && (t.push(n), n !== document.body);) n = n.parentElement;
|
|
265
265
|
return t;
|
|
266
266
|
}
|
|
267
|
-
function
|
|
268
|
-
let t =
|
|
269
|
-
return t.find((e) =>
|
|
267
|
+
function Pe(e) {
|
|
268
|
+
let t = Ne(e);
|
|
269
|
+
return t.find((e) => De(e)) || (t.find((e) => e.matches(xe) || S(e, "data-action") !== void 0 || S(e, "data-ui") !== void 0) ?? e);
|
|
270
270
|
}
|
|
271
|
-
function
|
|
272
|
-
if (e instanceof Element) return
|
|
271
|
+
function Fe(e) {
|
|
272
|
+
if (e instanceof Element) return Ne(Pe(e)).map((e) => Ae(e)).join(" > ");
|
|
273
273
|
}
|
|
274
|
-
function
|
|
275
|
-
let t = e.target instanceof Element ? e.target : void 0, n = t ?
|
|
276
|
-
return
|
|
274
|
+
function Ie(e) {
|
|
275
|
+
let t = e.target instanceof Element ? e.target : void 0, n = t ? Pe(t) : void 0, r = n ? Ne(n).map((e) => Me(je(e))) : [];
|
|
276
|
+
return y({
|
|
277
277
|
button: e.button,
|
|
278
278
|
ctrlKey: e.ctrlKey,
|
|
279
279
|
shiftKey: e.shiftKey,
|
|
280
280
|
altKey: e.altKey,
|
|
281
281
|
clientX: e.clientX,
|
|
282
282
|
clientY: e.clientY,
|
|
283
|
-
target: n ?
|
|
283
|
+
target: n ? Me(je(n)) : void 0,
|
|
284
284
|
chain: r
|
|
285
285
|
}, {
|
|
286
286
|
scope: "breadcrumb-detail",
|
|
287
287
|
source: "click"
|
|
288
288
|
});
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function Le() {
|
|
291
291
|
if (typeof window > "u") return () => void 0;
|
|
292
292
|
let e = (e) => {
|
|
293
|
-
|
|
293
|
+
x({
|
|
294
294
|
type: "click",
|
|
295
|
-
target:
|
|
296
|
-
detail:
|
|
295
|
+
target: Fe(e.target),
|
|
296
|
+
detail: Ie(e)
|
|
297
297
|
});
|
|
298
298
|
}, t = () => {
|
|
299
|
-
|
|
299
|
+
x({
|
|
300
300
|
type: "visibility",
|
|
301
|
-
detail:
|
|
301
|
+
detail: y({ visibilityState: document.visibilityState }, {
|
|
302
302
|
scope: "breadcrumb-detail",
|
|
303
303
|
source: "visibility"
|
|
304
304
|
})
|
|
@@ -310,14 +310,14 @@ function Pe() {
|
|
|
310
310
|
}
|
|
311
311
|
//#endregion
|
|
312
312
|
//#region src/error-report/dataPreview.ts
|
|
313
|
-
var
|
|
314
|
-
function
|
|
315
|
-
if (t >=
|
|
313
|
+
var Re = 6, ze = 12, Be = 24, Ve = 1024, He = 128;
|
|
314
|
+
function C(e, t, n) {
|
|
315
|
+
if (t >= Re || n.nodesLeft-- <= 0) return n.truncated = !0, { type: "truncated" };
|
|
316
316
|
if (e === null || typeof e == "boolean") return e;
|
|
317
317
|
if (typeof e == "number") return Number.isFinite(e) ? e : { type: "non-finite-number" };
|
|
318
318
|
if (typeof e == "string") {
|
|
319
|
-
e.length >
|
|
320
|
-
let t = e.slice(0,
|
|
319
|
+
e.length > Ve && (n.truncated = !0);
|
|
320
|
+
let t = e.slice(0, Ve), r = t.charCodeAt(t.length - 1);
|
|
321
321
|
return r >= 55296 && r <= 56319 ? t.slice(0, -1) : t;
|
|
322
322
|
}
|
|
323
323
|
if (typeof e == "bigint") return e.toString();
|
|
@@ -327,21 +327,21 @@ function Be(e, t, n) {
|
|
|
327
327
|
if (e instanceof Date) return Number.isNaN(e.getTime()) ? { type: "invalid-date" } : e.toISOString();
|
|
328
328
|
if (typeof e != "object") return { type: "unknown" };
|
|
329
329
|
if (n.seen.has(e)) return { type: "circular" };
|
|
330
|
-
if (n.seen.add(e), Array.isArray(e)) return e.length >
|
|
330
|
+
if (n.seen.add(e), Array.isArray(e)) return e.length > ze && (n.truncated = !0), e.slice(0, ze).map((e) => C(e, t + 1, n));
|
|
331
331
|
try {
|
|
332
332
|
let r = Object.entries(e);
|
|
333
|
-
return r.length >
|
|
333
|
+
return r.length > Be && (n.truncated = !0), Object.fromEntries(r.slice(0, Be).map(([e, r]) => [e, C(r, t + 1, n)]));
|
|
334
334
|
} catch {
|
|
335
335
|
return { type: "unreadable" };
|
|
336
336
|
}
|
|
337
337
|
}
|
|
338
|
-
function
|
|
338
|
+
function Ue(e) {
|
|
339
339
|
let t = Array.from(e);
|
|
340
340
|
return t.slice(0, Math.floor(t.length / 2)).join("");
|
|
341
341
|
}
|
|
342
|
-
function
|
|
342
|
+
function We(e) {
|
|
343
343
|
if (typeof e == "string") return e ? {
|
|
344
|
-
value:
|
|
344
|
+
value: Ue(e),
|
|
345
345
|
changed: !0
|
|
346
346
|
} : {
|
|
347
347
|
value: e,
|
|
@@ -353,7 +353,7 @@ function He(e) {
|
|
|
353
353
|
changed: !0
|
|
354
354
|
};
|
|
355
355
|
if (e.length === 1) {
|
|
356
|
-
let t =
|
|
356
|
+
let t = We(e[0]);
|
|
357
357
|
return t.changed ? (e[0] = t.value, {
|
|
358
358
|
value: e,
|
|
359
359
|
changed: !0
|
|
@@ -374,7 +374,7 @@ function He(e) {
|
|
|
374
374
|
changed: !1
|
|
375
375
|
};
|
|
376
376
|
if (t.length === 1) {
|
|
377
|
-
let t =
|
|
377
|
+
let t = We(e[n]);
|
|
378
378
|
if (t.changed) return e[n] = t.value, {
|
|
379
379
|
value: e,
|
|
380
380
|
changed: !0
|
|
@@ -390,15 +390,15 @@ function He(e) {
|
|
|
390
390
|
changed: !1
|
|
391
391
|
};
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function w(e, t) {
|
|
394
394
|
let n = {
|
|
395
395
|
seen: /* @__PURE__ */ new WeakSet(),
|
|
396
|
-
nodesLeft:
|
|
396
|
+
nodesLeft: He,
|
|
397
397
|
truncated: !1
|
|
398
|
-
}, r =
|
|
399
|
-
for (;
|
|
398
|
+
}, r = C(e, 0, n), i = JSON.stringify(r), a = Math.max(4, t);
|
|
399
|
+
for (; m(i) > a;) {
|
|
400
400
|
n.truncated = !0;
|
|
401
|
-
let e =
|
|
401
|
+
let e = We(r);
|
|
402
402
|
r = e.changed ? e.value : null, i = JSON.stringify(r);
|
|
403
403
|
}
|
|
404
404
|
return {
|
|
@@ -408,155 +408,155 @@ function E(e, t) {
|
|
|
408
408
|
}
|
|
409
409
|
//#endregion
|
|
410
410
|
//#region src/error-report/payload.ts
|
|
411
|
-
var
|
|
412
|
-
function
|
|
411
|
+
var Ge = 1, T = 262144, Ke = 131072, E = 65536, qe = 32768, Je = 256, Ye = 128, D = 2048;
|
|
412
|
+
function Xe(e) {
|
|
413
413
|
return new TextEncoder().encode(JSON.stringify(e)).byteLength;
|
|
414
414
|
}
|
|
415
|
-
function
|
|
416
|
-
return
|
|
415
|
+
function Ze(e) {
|
|
416
|
+
return p(u().valuePolicy === "verbatim" ? e : e.split(/[?#]/, 1)[0] ?? e, D);
|
|
417
417
|
}
|
|
418
|
-
function
|
|
419
|
-
if (!(!e || t <= 0 ||
|
|
418
|
+
function Qe(e, t) {
|
|
419
|
+
if (!(!e || t <= 0 || u().valuePolicy !== "verbatim")) try {
|
|
420
420
|
let n = JSON.parse(e.json);
|
|
421
|
-
return
|
|
422
|
-
...
|
|
421
|
+
return m(e.json) <= t ? e : {
|
|
422
|
+
...w(n, t),
|
|
423
423
|
truncated: !0
|
|
424
424
|
};
|
|
425
425
|
} catch {
|
|
426
426
|
return;
|
|
427
427
|
}
|
|
428
428
|
}
|
|
429
|
-
function
|
|
430
|
-
let i =
|
|
431
|
-
if (typeof i == "string") return r === "bytes" ?
|
|
429
|
+
function $e(e, t, n, r = "characters") {
|
|
430
|
+
let i = v(r === "bytes" ? h(e, n) : p(e, n), t, n);
|
|
431
|
+
if (typeof i == "string") return r === "bytes" ? h(i, n) : p(i, n);
|
|
432
432
|
}
|
|
433
|
-
function
|
|
434
|
-
let n =
|
|
433
|
+
function O(e, t) {
|
|
434
|
+
let n = u().valuePolicy === "verbatim";
|
|
435
435
|
return {
|
|
436
|
-
name:
|
|
437
|
-
message:
|
|
436
|
+
name: p(e.name, 256),
|
|
437
|
+
message: $e(e.message, {
|
|
438
438
|
scope: "error-message",
|
|
439
439
|
source: t
|
|
440
|
-
}, n ? 131072 : 4096, n ? "bytes" : "characters") ?? (n ?
|
|
441
|
-
code: e.code ?
|
|
442
|
-
stackTrace: e.stackTrace ?
|
|
440
|
+
}, n ? 131072 : 4096, n ? "bytes" : "characters") ?? (n ? h(e.message, 131072) : "[REDACTED]"),
|
|
441
|
+
code: e.code ? p(e.code, 128) : void 0,
|
|
442
|
+
stackTrace: e.stackTrace ? $e(e.stackTrace, {
|
|
443
443
|
scope: "stack-trace",
|
|
444
444
|
source: t
|
|
445
|
-
},
|
|
445
|
+
}, E, "bytes") : void 0,
|
|
446
446
|
httpStatus: e.httpStatus
|
|
447
447
|
};
|
|
448
448
|
}
|
|
449
|
-
function
|
|
450
|
-
let t =
|
|
449
|
+
function et(e) {
|
|
450
|
+
let t = u();
|
|
451
451
|
return {
|
|
452
452
|
...e,
|
|
453
|
-
queryHash:
|
|
454
|
-
queryKey:
|
|
453
|
+
queryHash: p(e.queryHash, 512),
|
|
454
|
+
queryKey: v(e.queryKey, {
|
|
455
455
|
scope: "query-key",
|
|
456
456
|
source: e.queryHash
|
|
457
457
|
}) ?? { type: "redacted" },
|
|
458
|
-
meta:
|
|
458
|
+
meta: y(e.meta, {
|
|
459
459
|
scope: "query-meta",
|
|
460
460
|
source: e.queryHash
|
|
461
461
|
}),
|
|
462
|
-
dataShape: e.dataShape ?
|
|
462
|
+
dataShape: e.dataShape ? v(e.dataShape, {
|
|
463
463
|
scope: "query-data-shape",
|
|
464
464
|
source: e.queryHash
|
|
465
465
|
}) : void 0,
|
|
466
|
-
dataPreview:
|
|
467
|
-
error: e.error ?
|
|
466
|
+
dataPreview: Qe(e.dataPreview, t.dataPreviewBytes.query),
|
|
467
|
+
error: e.error ? O(e.error, e.queryHash) : void 0
|
|
468
468
|
};
|
|
469
469
|
}
|
|
470
|
-
function
|
|
471
|
-
let t =
|
|
470
|
+
function tt(e) {
|
|
471
|
+
let t = u();
|
|
472
472
|
return {
|
|
473
473
|
...e,
|
|
474
|
-
mutationKey: e.mutationKey ?
|
|
475
|
-
meta:
|
|
476
|
-
variablesPreview:
|
|
477
|
-
error: e.error ?
|
|
474
|
+
mutationKey: e.mutationKey ? v(e.mutationKey, { scope: "mutation-key" }) : void 0,
|
|
475
|
+
meta: y(e.meta, { scope: "mutation-meta" }),
|
|
476
|
+
variablesPreview: Qe(e.variablesPreview, t.dataPreviewBytes.mutation),
|
|
477
|
+
error: e.error ? O(e.error, "mutation") : void 0
|
|
478
478
|
};
|
|
479
479
|
}
|
|
480
|
-
function
|
|
481
|
-
let t =
|
|
480
|
+
function nt(e) {
|
|
481
|
+
let t = u();
|
|
482
482
|
return {
|
|
483
483
|
...e,
|
|
484
|
-
buster: e.buster ?
|
|
485
|
-
queryHash: e.queryHash ?
|
|
486
|
-
queryKey: e.queryKey ?
|
|
484
|
+
buster: e.buster ? p(e.buster, 512) : void 0,
|
|
485
|
+
queryHash: e.queryHash ? p(e.queryHash, 512) : void 0,
|
|
486
|
+
queryKey: e.queryKey ? v(e.queryKey, {
|
|
487
487
|
scope: "persisted-query-key",
|
|
488
488
|
source: e.queryHash
|
|
489
489
|
}) : void 0,
|
|
490
|
-
dataPreview:
|
|
491
|
-
error: e.error ?
|
|
490
|
+
dataPreview: Qe(e.dataPreview, t.dataPreviewBytes.persistedQuery),
|
|
491
|
+
error: e.error ? O(e.error, e.queryHash) : void 0
|
|
492
492
|
};
|
|
493
493
|
}
|
|
494
|
-
function
|
|
495
|
-
return
|
|
494
|
+
function k(e) {
|
|
495
|
+
return Xe(e);
|
|
496
496
|
}
|
|
497
|
-
function
|
|
498
|
-
let t =
|
|
497
|
+
function rt(e) {
|
|
498
|
+
let t = u().valuePolicy === "verbatim";
|
|
499
499
|
return {
|
|
500
500
|
...e,
|
|
501
|
-
reportId:
|
|
502
|
-
sessionId:
|
|
503
|
-
createdUtc:
|
|
504
|
-
application:
|
|
505
|
-
source:
|
|
506
|
-
error:
|
|
501
|
+
reportId: p(e.reportId, 128),
|
|
502
|
+
sessionId: p(e.sessionId, 128),
|
|
503
|
+
createdUtc: p(e.createdUtc, 64),
|
|
504
|
+
application: p(e.application, Ye),
|
|
505
|
+
source: p(e.source, Je),
|
|
506
|
+
error: O(e.error, e.source),
|
|
507
507
|
environment: {
|
|
508
508
|
...e.environment,
|
|
509
|
-
buildId: e.environment.buildId ?
|
|
509
|
+
buildId: e.environment.buildId ? p(e.environment.buildId, 128) : void 0
|
|
510
510
|
},
|
|
511
511
|
client: e.client ? {
|
|
512
|
-
userAgent: e.client.userAgent ?
|
|
513
|
-
language: e.client.language ?
|
|
514
|
-
timeZone: e.client.timeZone ?
|
|
512
|
+
userAgent: e.client.userAgent ? p(e.client.userAgent) : void 0,
|
|
513
|
+
language: e.client.language ? p(e.client.language, 128) : void 0,
|
|
514
|
+
timeZone: e.client.timeZone ? p(e.client.timeZone, 128) : void 0
|
|
515
515
|
} : void 0,
|
|
516
516
|
location: e.location ? {
|
|
517
|
-
pathname:
|
|
518
|
-
origin: e.location.origin ?
|
|
519
|
-
search:
|
|
520
|
-
hash:
|
|
517
|
+
pathname: Ze(e.location.pathname),
|
|
518
|
+
origin: e.location.origin ? p(e.location.origin.split(/[?#]/, 1)[0] ?? e.location.origin, D) : void 0,
|
|
519
|
+
search: u().valuePolicy === "verbatim" && e.location.search ? p(e.location.search, D) : void 0,
|
|
520
|
+
hash: u().valuePolicy === "verbatim" && e.location.hash ? p(e.location.hash, D) : void 0
|
|
521
521
|
} : void 0,
|
|
522
|
-
react: e.react?.componentStack ? { componentStack:
|
|
522
|
+
react: e.react?.componentStack ? { componentStack: $e(e.react.componentStack, {
|
|
523
523
|
scope: "stack-trace",
|
|
524
524
|
source: "react-component-stack"
|
|
525
|
-
},
|
|
526
|
-
query: e.query ?
|
|
527
|
-
mutation: e.mutation ?
|
|
525
|
+
}, qe, "bytes") } : void 0,
|
|
526
|
+
query: e.query ? et(e.query) : void 0,
|
|
527
|
+
mutation: e.mutation ? tt(e.mutation) : void 0,
|
|
528
528
|
queryClient: e.queryClient ? {
|
|
529
|
-
queries: e.queryClient.queries.slice(-40).map(
|
|
530
|
-
mutations: e.queryClient.mutations.slice(-40).map(
|
|
529
|
+
queries: e.queryClient.queries.slice(-40).map(et),
|
|
530
|
+
mutations: e.queryClient.mutations.slice(-40).map(tt),
|
|
531
531
|
...t ? {
|
|
532
532
|
omittedQueries: (e.queryClient.omittedQueries ?? 0) + Math.max(0, e.queryClient.queries.length - 40) || void 0,
|
|
533
533
|
omittedMutations: (e.queryClient.omittedMutations ?? 0) + Math.max(0, e.queryClient.mutations.length - 40) || void 0
|
|
534
534
|
} : {}
|
|
535
535
|
} : void 0,
|
|
536
|
-
persistedQueries: e.persistedQueries?.slice(-40).map(
|
|
536
|
+
persistedQueries: e.persistedQueries?.slice(-40).map(nt),
|
|
537
537
|
breadcrumbs: e.breadcrumbs.slice(-80).map((e) => ({
|
|
538
538
|
...e,
|
|
539
|
-
utc:
|
|
540
|
-
routeId: e.routeId ?
|
|
541
|
-
appId: e.appId ?
|
|
542
|
-
viewId: e.viewId ?
|
|
543
|
-
target: e.target ?
|
|
544
|
-
detail:
|
|
539
|
+
utc: p(e.utc, 64),
|
|
540
|
+
routeId: e.routeId ? p(e.routeId, 512) : void 0,
|
|
541
|
+
appId: e.appId ? p(e.appId, 128) : void 0,
|
|
542
|
+
viewId: e.viewId ? p(e.viewId, 128) : void 0,
|
|
543
|
+
target: e.target ? p(e.target, 2048) : void 0,
|
|
544
|
+
detail: y(e.detail, {
|
|
545
545
|
scope: "breadcrumb-detail",
|
|
546
546
|
source: e.type
|
|
547
547
|
})
|
|
548
548
|
})),
|
|
549
|
-
context:
|
|
549
|
+
context: y(e.context, {
|
|
550
550
|
scope: "context",
|
|
551
551
|
source: e.source
|
|
552
552
|
})
|
|
553
553
|
};
|
|
554
554
|
}
|
|
555
|
-
function
|
|
556
|
-
if (!e ||
|
|
555
|
+
function A(e, t) {
|
|
556
|
+
if (!e || m(e.json) <= t) return e;
|
|
557
557
|
try {
|
|
558
558
|
return {
|
|
559
|
-
...
|
|
559
|
+
...w(JSON.parse(e.json), t),
|
|
560
560
|
truncated: !0
|
|
561
561
|
};
|
|
562
562
|
} catch {
|
|
@@ -566,60 +566,60 @@ function P(e, t) {
|
|
|
566
566
|
};
|
|
567
567
|
}
|
|
568
568
|
}
|
|
569
|
-
function
|
|
569
|
+
function it(e, t, n) {
|
|
570
570
|
return n ? {
|
|
571
571
|
...e,
|
|
572
572
|
queryClient: e.queryClient ? {
|
|
573
573
|
...e.queryClient,
|
|
574
574
|
queries: e.queryClient.queries.map((e) => ({
|
|
575
575
|
...e,
|
|
576
|
-
dataPreview:
|
|
576
|
+
dataPreview: A(e.dataPreview, t)
|
|
577
577
|
})),
|
|
578
578
|
mutations: e.queryClient.mutations.map((e) => ({
|
|
579
579
|
...e,
|
|
580
|
-
variablesPreview:
|
|
580
|
+
variablesPreview: A(e.variablesPreview, t)
|
|
581
581
|
}))
|
|
582
582
|
} : void 0,
|
|
583
583
|
persistedQueries: e.persistedQueries?.map((e) => ({
|
|
584
584
|
...e,
|
|
585
|
-
dataPreview:
|
|
585
|
+
dataPreview: A(e.dataPreview, t)
|
|
586
586
|
}))
|
|
587
587
|
} : {
|
|
588
588
|
...e,
|
|
589
589
|
query: e.query ? {
|
|
590
590
|
...e.query,
|
|
591
|
-
dataPreview:
|
|
591
|
+
dataPreview: A(e.query.dataPreview, t)
|
|
592
592
|
} : void 0,
|
|
593
593
|
mutation: e.mutation ? {
|
|
594
594
|
...e.mutation,
|
|
595
|
-
variablesPreview:
|
|
595
|
+
variablesPreview: A(e.mutation.variablesPreview, t)
|
|
596
596
|
} : void 0
|
|
597
597
|
};
|
|
598
598
|
}
|
|
599
|
-
function
|
|
600
|
-
let t =
|
|
599
|
+
function at(e) {
|
|
600
|
+
let t = rt(e), n = k(t);
|
|
601
601
|
if (n <= 262144) return t;
|
|
602
602
|
let r = [], i = {
|
|
603
603
|
...t,
|
|
604
604
|
truncation: {
|
|
605
605
|
reason: "payload-size",
|
|
606
|
-
limitBytes:
|
|
606
|
+
limitBytes: T,
|
|
607
607
|
originalBytes: n,
|
|
608
608
|
droppedSections: r
|
|
609
609
|
}
|
|
610
610
|
};
|
|
611
|
-
if (
|
|
611
|
+
if (u().valuePolicy === "verbatim") for (let e of [
|
|
612
612
|
512,
|
|
613
613
|
128,
|
|
614
614
|
4
|
|
615
615
|
]) {
|
|
616
|
-
if (
|
|
617
|
-
i =
|
|
616
|
+
if (k(i) <= 262144 || (i = it(i, e, !0), k(i) <= 262144)) break;
|
|
617
|
+
i = it(i, e, !1);
|
|
618
618
|
}
|
|
619
619
|
let a = (e, t, n) => {
|
|
620
|
-
!t(i) ||
|
|
620
|
+
!t(i) || k(i) <= 262144 || (r.push(e), i = n(i));
|
|
621
621
|
};
|
|
622
|
-
return
|
|
622
|
+
return u().valuePolicy === "verbatim" && (a("queryClient.queries:oldest", (e) => (e.queryClient?.queries.length ?? 0) > 10, (e) => ({
|
|
623
623
|
...e,
|
|
624
624
|
queryClient: e.queryClient ? {
|
|
625
625
|
...e.queryClient,
|
|
@@ -688,156 +688,108 @@ function tt(e) {
|
|
|
688
688
|
}
|
|
689
689
|
//#endregion
|
|
690
690
|
//#region src/error-report/errorInfo.ts
|
|
691
|
-
var
|
|
692
|
-
function
|
|
693
|
-
return t(e) ?
|
|
691
|
+
var ot = "Неизвестная ошибка";
|
|
692
|
+
function j(e) {
|
|
693
|
+
return t(e) ? u().valuePolicy === "verbatim" ? h(e, Ke) : p(e) : ot;
|
|
694
694
|
}
|
|
695
|
-
function
|
|
695
|
+
function st(e) {
|
|
696
696
|
let t = e.status ?? e.statusCode ?? e.httpStatus;
|
|
697
697
|
return typeof t == "number" && Number.isFinite(t) ? t : void 0;
|
|
698
698
|
}
|
|
699
|
-
function
|
|
699
|
+
function ct(e) {
|
|
700
700
|
if (!e || typeof e != "object") return null;
|
|
701
701
|
let n = e.appError;
|
|
702
702
|
if (!n || typeof n != "object") return null;
|
|
703
703
|
let r = n, i = t(r.message);
|
|
704
704
|
return i ? {
|
|
705
705
|
name: "AppError",
|
|
706
|
-
message:
|
|
707
|
-
code: t(r.code) ?
|
|
708
|
-
httpStatus:
|
|
706
|
+
message: j(i),
|
|
707
|
+
code: t(r.code) ? p(String(r.code), 128) : void 0,
|
|
708
|
+
httpStatus: st(r)
|
|
709
709
|
} : null;
|
|
710
710
|
}
|
|
711
|
-
function
|
|
712
|
-
let t =
|
|
711
|
+
function M(e) {
|
|
712
|
+
let t = ct(e);
|
|
713
713
|
if (t) return t;
|
|
714
714
|
if (e instanceof Error) return {
|
|
715
|
-
name:
|
|
716
|
-
message:
|
|
717
|
-
stackTrace: e.stack ?
|
|
715
|
+
name: p(e.name || "Error", 256),
|
|
716
|
+
message: j(e.message),
|
|
717
|
+
stackTrace: e.stack ? h(e.stack, E) : void 0
|
|
718
718
|
};
|
|
719
719
|
if (e && typeof e == "object") {
|
|
720
720
|
let t = e;
|
|
721
721
|
return {
|
|
722
|
-
name:
|
|
723
|
-
message:
|
|
724
|
-
stackTrace: typeof t.stack == "string" ?
|
|
725
|
-
httpStatus:
|
|
722
|
+
name: p(typeof t.name == "string" ? t.name : "Error", 256),
|
|
723
|
+
message: j(typeof t.message == "string" ? t.message : String(e)),
|
|
724
|
+
stackTrace: typeof t.stack == "string" ? h(t.stack, E) : void 0,
|
|
725
|
+
httpStatus: st(t)
|
|
726
726
|
};
|
|
727
727
|
}
|
|
728
728
|
return {
|
|
729
729
|
name: "Error",
|
|
730
|
-
message:
|
|
730
|
+
message: j(typeof e == "string" ? e : String(e ?? ot))
|
|
731
731
|
};
|
|
732
732
|
}
|
|
733
733
|
//#endregion
|
|
734
|
-
//#region src/error-report/
|
|
735
|
-
var
|
|
736
|
-
function
|
|
737
|
-
return
|
|
738
|
-
scope: t,
|
|
739
|
-
source: n
|
|
740
|
-
});
|
|
741
|
-
}
|
|
742
|
-
function L(e) {
|
|
743
|
-
let t = d(), i = b(e.queryKey, { scope: "query-key" }) ?? { type: "redacted" }, a = t.valuePolicy === "verbatim" ? r(e.queryHash) : r(n(i));
|
|
744
|
-
return {
|
|
745
|
-
queryHash: a,
|
|
746
|
-
queryKey: i,
|
|
747
|
-
status: e.state.status,
|
|
748
|
-
fetchStatus: e.state.fetchStatus,
|
|
749
|
-
dataUpdatedAt: e.state.dataUpdatedAt,
|
|
750
|
-
errorUpdatedAt: e.state.errorUpdatedAt,
|
|
751
|
-
failureCount: e.state.fetchFailureCount,
|
|
752
|
-
isInvalidated: e.state.isInvalidated,
|
|
753
|
-
observersCount: e.getObserversCount(),
|
|
754
|
-
meta: st(e.meta, "query-meta", a),
|
|
755
|
-
dataShape: b(y(e.state.data), {
|
|
756
|
-
scope: "query-data-shape",
|
|
757
|
-
source: a
|
|
758
|
-
}),
|
|
759
|
-
dataPreview: t.valuePolicy === "verbatim" && t.dataPreviewBytes.query > 0 && e.state.data !== void 0 ? E(e.state.data, t.dataPreviewBytes.query) : void 0,
|
|
760
|
-
error: e.state.error ? I(e.state.error) : void 0
|
|
761
|
-
};
|
|
734
|
+
//#region src/error-report/runtimeDeduplication.ts
|
|
735
|
+
var lt = 6e4, ut = 100, N = /* @__PURE__ */ new Map();
|
|
736
|
+
function dt(e) {
|
|
737
|
+
if (e) return e.split("\n").map((e) => e.trim()).filter(Boolean);
|
|
762
738
|
}
|
|
763
|
-
function
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
};
|
|
739
|
+
function ft(e) {
|
|
740
|
+
return r(n({
|
|
741
|
+
category: e.category,
|
|
742
|
+
source: e.source,
|
|
743
|
+
error: {
|
|
744
|
+
...e.error,
|
|
745
|
+
stackTrace: dt(e.error.stackTrace)
|
|
746
|
+
},
|
|
747
|
+
pathname: e.pathname,
|
|
748
|
+
scope: e.scope
|
|
749
|
+
}));
|
|
774
750
|
}
|
|
775
|
-
function
|
|
776
|
-
let
|
|
777
|
-
|
|
778
|
-
queries: t.slice(-40).map(L),
|
|
779
|
-
mutations: n.slice(-40).map(R),
|
|
780
|
-
...d().valuePolicy === "verbatim" ? {
|
|
781
|
-
omittedQueries: Math.max(0, t.length - at) || void 0,
|
|
782
|
-
omittedMutations: Math.max(0, n.length - ot) || void 0
|
|
783
|
-
} : {}
|
|
784
|
-
};
|
|
751
|
+
function P(e, t) {
|
|
752
|
+
let n = N.get(e);
|
|
753
|
+
!n || t && n.capture !== t || (clearTimeout(n.expirationTimer), N.delete(e));
|
|
785
754
|
}
|
|
786
|
-
function
|
|
787
|
-
let t
|
|
788
|
-
return {
|
|
789
|
-
buster: e.buster ? h(e.buster, 512) : void 0,
|
|
790
|
-
queryHash: o,
|
|
791
|
-
queryKey: a,
|
|
792
|
-
status: i.status,
|
|
793
|
-
fetchStatus: i.fetchStatus,
|
|
794
|
-
dataUpdatedAt: i.dataUpdatedAt,
|
|
795
|
-
errorUpdatedAt: i.errorUpdatedAt,
|
|
796
|
-
failureCount: i.fetchFailureCount,
|
|
797
|
-
dataPreview: t.valuePolicy === "verbatim" && t.dataPreviewBytes.persistedQuery > 0 && i.data !== void 0 ? E(i.data, t.dataPreviewBytes.persistedQuery) : void 0,
|
|
798
|
-
error: i.error ? I(i.error) : void 0
|
|
799
|
-
};
|
|
755
|
+
function pt(e) {
|
|
756
|
+
for (let [t, n] of N) e - n.capturedAt >= 6e4 && P(t, n.capture);
|
|
800
757
|
}
|
|
801
|
-
|
|
802
|
-
let e =
|
|
803
|
-
|
|
804
|
-
try {
|
|
805
|
-
return (await e.entries()).slice(-40).map(([, e]) => ct(e));
|
|
806
|
-
} catch {
|
|
807
|
-
return [];
|
|
808
|
-
}
|
|
758
|
+
function mt() {
|
|
759
|
+
let e = N.keys().next().value;
|
|
760
|
+
e && P(e);
|
|
809
761
|
}
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
762
|
+
function ht(e, t) {
|
|
763
|
+
let n = Date.now(), r = ft(e), i = N.get(r);
|
|
764
|
+
if (i && n - i.capturedAt < 6e4) return i.capture;
|
|
765
|
+
for (pt(n); N.size >= ut;) mt();
|
|
766
|
+
let a = t(), o = setTimeout(() => {
|
|
767
|
+
P(r, a);
|
|
768
|
+
}, lt);
|
|
769
|
+
return N.set(r, {
|
|
770
|
+
capturedAt: n,
|
|
771
|
+
capture: a,
|
|
772
|
+
expirationTimer: o
|
|
773
|
+
}), a.catch(() => {
|
|
774
|
+
P(r, a);
|
|
775
|
+
}), a;
|
|
815
776
|
}
|
|
816
|
-
function
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
buildId: typeof __APP_BUILD_ID__ == "string" ? __APP_BUILD_ID__ : void 0
|
|
820
|
-
};
|
|
821
|
-
}
|
|
822
|
-
function dt() {
|
|
823
|
-
if (!(typeof window > "u")) return {
|
|
824
|
-
userAgent: window.navigator.userAgent,
|
|
825
|
-
language: window.navigator.language,
|
|
826
|
-
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
827
|
-
};
|
|
777
|
+
function gt() {
|
|
778
|
+
for (let e of N.values()) clearTimeout(e.expirationTimer);
|
|
779
|
+
N.clear();
|
|
828
780
|
}
|
|
829
781
|
//#endregion
|
|
830
782
|
//#region src/error-report/schema.ts
|
|
831
|
-
var
|
|
783
|
+
var F = c.lazy(() => c.union([
|
|
832
784
|
c.string().max(8192),
|
|
833
785
|
c.number().finite(),
|
|
834
786
|
c.boolean(),
|
|
835
787
|
c.null(),
|
|
836
|
-
c.array(
|
|
837
|
-
c.record(c.string(),
|
|
838
|
-
])),
|
|
788
|
+
c.array(F).max(20),
|
|
789
|
+
c.record(c.string(), F).refine((e) => Object.keys(e).length <= 40)
|
|
790
|
+
])), I = c.record(c.string(), F).refine((e) => Object.keys(e).length <= 40), _t = c.object({
|
|
839
791
|
json: c.string().refine((e) => {
|
|
840
|
-
if (
|
|
792
|
+
if (m(e) > 16384) return !1;
|
|
841
793
|
try {
|
|
842
794
|
return JSON.parse(e), !0;
|
|
843
795
|
} catch {
|
|
@@ -845,13 +797,13 @@ var V = c.lazy(() => c.union([
|
|
|
845
797
|
}
|
|
846
798
|
}),
|
|
847
799
|
truncated: c.boolean()
|
|
848
|
-
}).strict(),
|
|
800
|
+
}).strict(), L = c.object({
|
|
849
801
|
name: c.string().min(1).max(256),
|
|
850
|
-
message: c.string().min(1).max(131072).refine((e) =>
|
|
802
|
+
message: c.string().min(1).max(131072).refine((e) => m(e) <= 131072),
|
|
851
803
|
code: c.string().max(128).optional(),
|
|
852
|
-
stackTrace: c.string().refine((e) =>
|
|
804
|
+
stackTrace: c.string().refine((e) => m(e) <= 65536).optional(),
|
|
853
805
|
httpStatus: c.number().finite().optional()
|
|
854
|
-
}).strict(),
|
|
806
|
+
}).strict(), vt = c.object({
|
|
855
807
|
utc: c.string().min(1).max(64),
|
|
856
808
|
type: c.enum([
|
|
857
809
|
"route",
|
|
@@ -865,10 +817,10 @@ var V = c.lazy(() => c.union([
|
|
|
865
817
|
appId: c.string().max(128).optional(),
|
|
866
818
|
viewId: c.string().max(128).optional(),
|
|
867
819
|
target: c.string().max(2048).optional(),
|
|
868
|
-
detail:
|
|
869
|
-
}).strict(),
|
|
820
|
+
detail: I.optional()
|
|
821
|
+
}).strict(), yt = c.object({
|
|
870
822
|
queryHash: c.string().max(512),
|
|
871
|
-
queryKey:
|
|
823
|
+
queryKey: F,
|
|
872
824
|
status: c.string().max(64).optional(),
|
|
873
825
|
fetchStatus: c.string().max(64).optional(),
|
|
874
826
|
dataUpdatedAt: c.number().finite().optional(),
|
|
@@ -876,30 +828,30 @@ var V = c.lazy(() => c.union([
|
|
|
876
828
|
failureCount: c.number().finite().optional(),
|
|
877
829
|
isInvalidated: c.boolean().optional(),
|
|
878
830
|
observersCount: c.number().finite().optional(),
|
|
879
|
-
meta:
|
|
880
|
-
dataShape:
|
|
881
|
-
dataPreview:
|
|
882
|
-
error:
|
|
883
|
-
}).strict(),
|
|
884
|
-
mutationKey:
|
|
831
|
+
meta: I.optional(),
|
|
832
|
+
dataShape: F.optional(),
|
|
833
|
+
dataPreview: _t.optional(),
|
|
834
|
+
error: L.optional()
|
|
835
|
+
}).strict(), bt = c.object({
|
|
836
|
+
mutationKey: F.optional(),
|
|
885
837
|
status: c.string().max(64).optional(),
|
|
886
838
|
failureCount: c.number().finite().optional(),
|
|
887
839
|
submittedAt: c.number().finite().optional(),
|
|
888
|
-
meta:
|
|
889
|
-
variablesPreview:
|
|
890
|
-
error:
|
|
891
|
-
}).strict(),
|
|
840
|
+
meta: I.optional(),
|
|
841
|
+
variablesPreview: _t.optional(),
|
|
842
|
+
error: L.optional()
|
|
843
|
+
}).strict(), xt = c.object({
|
|
892
844
|
buster: c.string().max(512).optional(),
|
|
893
845
|
queryHash: c.string().max(512).optional(),
|
|
894
|
-
queryKey:
|
|
846
|
+
queryKey: F.optional(),
|
|
895
847
|
status: c.string().max(64).optional(),
|
|
896
848
|
fetchStatus: c.string().max(64).optional(),
|
|
897
849
|
dataUpdatedAt: c.number().finite().optional(),
|
|
898
850
|
errorUpdatedAt: c.number().finite().optional(),
|
|
899
851
|
failureCount: c.number().finite().optional(),
|
|
900
|
-
dataPreview:
|
|
901
|
-
error:
|
|
902
|
-
}).strict(),
|
|
852
|
+
dataPreview: _t.optional(),
|
|
853
|
+
error: L.optional()
|
|
854
|
+
}).strict(), St = c.object({
|
|
903
855
|
payloadVersion: c.literal(1),
|
|
904
856
|
application: c.string().min(1).max(128),
|
|
905
857
|
reportId: c.string().uuid(),
|
|
@@ -912,7 +864,7 @@ var V = c.lazy(() => c.union([
|
|
|
912
864
|
"react"
|
|
913
865
|
]),
|
|
914
866
|
source: c.string().min(1).max(256),
|
|
915
|
-
error:
|
|
867
|
+
error: L,
|
|
916
868
|
environment: c.object({
|
|
917
869
|
mode: c.enum(["development", "production"]),
|
|
918
870
|
buildId: c.string().max(128).optional()
|
|
@@ -933,25 +885,25 @@ var V = c.lazy(() => c.union([
|
|
|
933
885
|
height: c.number().finite(),
|
|
934
886
|
devicePixelRatio: c.number().finite().optional()
|
|
935
887
|
}).strict().optional(),
|
|
936
|
-
react: c.object({ componentStack: c.string().refine((e) =>
|
|
937
|
-
query:
|
|
938
|
-
mutation:
|
|
888
|
+
react: c.object({ componentStack: c.string().refine((e) => m(e) <= 32768).optional() }).strict().optional(),
|
|
889
|
+
query: yt.optional(),
|
|
890
|
+
mutation: bt.optional(),
|
|
939
891
|
queryClient: c.object({
|
|
940
|
-
queries: c.array(
|
|
941
|
-
mutations: c.array(
|
|
892
|
+
queries: c.array(yt).max(40),
|
|
893
|
+
mutations: c.array(bt).max(40),
|
|
942
894
|
omittedQueries: c.number().int().nonnegative().optional(),
|
|
943
895
|
omittedMutations: c.number().int().nonnegative().optional()
|
|
944
896
|
}).strict().optional(),
|
|
945
|
-
persistedQueries: c.array(
|
|
946
|
-
breadcrumbs: c.array(
|
|
947
|
-
context:
|
|
897
|
+
persistedQueries: c.array(xt).max(40).optional(),
|
|
898
|
+
breadcrumbs: c.array(vt).max(80),
|
|
899
|
+
context: I.optional(),
|
|
948
900
|
truncation: c.object({
|
|
949
901
|
reason: c.literal("payload-size"),
|
|
950
|
-
limitBytes: c.literal(
|
|
902
|
+
limitBytes: c.literal(T),
|
|
951
903
|
originalBytes: c.number().int().positive(),
|
|
952
904
|
droppedSections: c.array(c.string().max(128)).max(32)
|
|
953
905
|
}).strict().optional()
|
|
954
|
-
}).strict().refine((e) =>
|
|
906
|
+
}).strict().refine((e) => k(e) <= T), Ct = c.object({
|
|
955
907
|
reportId: c.string().uuid(),
|
|
956
908
|
sessionId: c.string().uuid(),
|
|
957
909
|
createdUtc: c.string().min(1).max(64),
|
|
@@ -969,65 +921,178 @@ var V = c.lazy(() => c.union([
|
|
|
969
921
|
]),
|
|
970
922
|
sentUtc: c.string().min(1).max(64).optional(),
|
|
971
923
|
failedReason: c.string().max(4096).optional(),
|
|
972
|
-
payload:
|
|
924
|
+
payload: St
|
|
973
925
|
}).strict().superRefine((e, t) => {
|
|
974
926
|
(e.reportId !== e.payload.reportId || e.sessionId !== e.payload.sessionId || e.createdUtc !== e.payload.createdUtc || e.category !== e.payload.category) && t.addIssue({
|
|
975
927
|
code: "custom",
|
|
976
928
|
message: "Draft identity должна совпадать с payload identity."
|
|
977
929
|
});
|
|
978
930
|
});
|
|
979
|
-
function
|
|
931
|
+
function wt(e, t) {
|
|
980
932
|
try {
|
|
981
933
|
return new TextEncoder().encode(JSON.stringify(e)).byteLength <= t;
|
|
982
934
|
} catch {
|
|
983
935
|
return !1;
|
|
984
936
|
}
|
|
985
937
|
}
|
|
986
|
-
function
|
|
987
|
-
if (
|
|
988
|
-
let t =
|
|
938
|
+
function R(e) {
|
|
939
|
+
if (wt(e, 262144)) try {
|
|
940
|
+
let t = St.safeParse(e);
|
|
989
941
|
return t.success ? t.data : void 0;
|
|
990
942
|
} catch {
|
|
991
943
|
return;
|
|
992
944
|
}
|
|
993
945
|
}
|
|
994
|
-
function
|
|
995
|
-
if (
|
|
996
|
-
let t =
|
|
946
|
+
function z(e) {
|
|
947
|
+
if (wt(e, 278528)) try {
|
|
948
|
+
let t = Ct.safeParse(e);
|
|
997
949
|
return t.success ? t.data : void 0;
|
|
998
950
|
} catch {
|
|
999
951
|
return;
|
|
1000
952
|
}
|
|
1001
953
|
}
|
|
1002
|
-
function
|
|
954
|
+
function Tt(e) {
|
|
1003
955
|
return Array.isArray(e) ? e.flatMap((e) => {
|
|
1004
|
-
let t =
|
|
956
|
+
let t = z(e);
|
|
1005
957
|
return t ? [t] : [];
|
|
1006
958
|
}) : [];
|
|
1007
959
|
}
|
|
1008
960
|
//#endregion
|
|
1009
|
-
//#region src/error-report/
|
|
1010
|
-
var
|
|
1011
|
-
function
|
|
1012
|
-
|
|
961
|
+
//#region src/error-report/errorReportStorage.ts
|
|
962
|
+
var Et = `${__APP_ID__}.errorReport.drafts.v2`, Dt = `${__APP_ID__}.errorReport.sessionId.v1`, B = !1, V, Ot = [], kt;
|
|
963
|
+
function At() {
|
|
964
|
+
typeof window > "u" || B || (B = !0, V = void 0, gt());
|
|
965
|
+
}
|
|
966
|
+
function H() {
|
|
967
|
+
return !B;
|
|
968
|
+
}
|
|
969
|
+
function U() {
|
|
970
|
+
if (B) return Ot;
|
|
971
|
+
if (V === void 0 && (V = [], typeof sessionStorage < "u")) try {
|
|
972
|
+
let e = sessionStorage.getItem(Et);
|
|
973
|
+
V = Tt(e ? JSON.parse(e) : []);
|
|
974
|
+
} catch {}
|
|
975
|
+
return V;
|
|
976
|
+
}
|
|
977
|
+
function jt(e) {
|
|
978
|
+
let t = e.slice(-10);
|
|
979
|
+
if (B) {
|
|
980
|
+
Ot = t;
|
|
981
|
+
return;
|
|
982
|
+
}
|
|
983
|
+
if (V = t, !(typeof sessionStorage > "u")) try {
|
|
984
|
+
sessionStorage.setItem(Et, JSON.stringify(V));
|
|
985
|
+
} catch {}
|
|
986
|
+
}
|
|
987
|
+
function Mt() {
|
|
988
|
+
return B ? (kt ??= i(), kt) : ee(Dt);
|
|
989
|
+
}
|
|
990
|
+
//#endregion
|
|
991
|
+
//#region src/error-report/diagnostics.ts
|
|
992
|
+
var Nt = 40, Pt = 40;
|
|
993
|
+
function Ft(e, t, n) {
|
|
994
|
+
return y(e, {
|
|
995
|
+
scope: t,
|
|
996
|
+
source: n
|
|
997
|
+
});
|
|
998
|
+
}
|
|
999
|
+
function W(e) {
|
|
1000
|
+
let t = u(), i = v(e.queryKey, { scope: "query-key" }) ?? { type: "redacted" }, a = t.valuePolicy === "verbatim" ? r(e.queryHash) : r(n(i));
|
|
1001
|
+
return {
|
|
1002
|
+
queryHash: a,
|
|
1003
|
+
queryKey: i,
|
|
1004
|
+
status: e.state.status,
|
|
1005
|
+
fetchStatus: e.state.fetchStatus,
|
|
1006
|
+
dataUpdatedAt: e.state.dataUpdatedAt,
|
|
1007
|
+
errorUpdatedAt: e.state.errorUpdatedAt,
|
|
1008
|
+
failureCount: e.state.fetchFailureCount,
|
|
1009
|
+
isInvalidated: e.state.isInvalidated,
|
|
1010
|
+
observersCount: e.getObserversCount(),
|
|
1011
|
+
meta: Ft(e.meta, "query-meta", a),
|
|
1012
|
+
dataShape: v(_(e.state.data), {
|
|
1013
|
+
scope: "query-data-shape",
|
|
1014
|
+
source: a
|
|
1015
|
+
}),
|
|
1016
|
+
dataPreview: t.valuePolicy === "verbatim" && t.dataPreviewBytes.query > 0 && e.state.data !== void 0 ? w(e.state.data, t.dataPreviewBytes.query) : void 0,
|
|
1017
|
+
error: e.state.error ? M(e.state.error) : void 0
|
|
1018
|
+
};
|
|
1019
|
+
}
|
|
1020
|
+
function G(e) {
|
|
1021
|
+
let t = u();
|
|
1022
|
+
return {
|
|
1023
|
+
mutationKey: e.options.mutationKey ? v(e.options.mutationKey, { scope: "mutation-key" }) : void 0,
|
|
1024
|
+
status: e.state.status,
|
|
1025
|
+
failureCount: e.state.failureCount,
|
|
1026
|
+
submittedAt: e.state.submittedAt,
|
|
1027
|
+
meta: Ft(e.meta, "mutation-meta"),
|
|
1028
|
+
variablesPreview: t.valuePolicy === "verbatim" && t.dataPreviewBytes.mutation > 0 && e.state.variables !== void 0 ? w(e.state.variables, t.dataPreviewBytes.mutation) : void 0,
|
|
1029
|
+
error: e.state.error ? M(e.state.error) : void 0
|
|
1030
|
+
};
|
|
1031
|
+
}
|
|
1032
|
+
function K(e) {
|
|
1033
|
+
let t = e.getQueryCache().getAll(), n = e.getMutationCache().getAll();
|
|
1034
|
+
return {
|
|
1035
|
+
queries: t.slice(-40).map(W),
|
|
1036
|
+
mutations: n.slice(-40).map(G),
|
|
1037
|
+
...u().valuePolicy === "verbatim" ? {
|
|
1038
|
+
omittedQueries: Math.max(0, t.length - Nt) || void 0,
|
|
1039
|
+
omittedMutations: Math.max(0, n.length - Pt) || void 0
|
|
1040
|
+
} : {}
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
function It(e) {
|
|
1044
|
+
let t = u(), i = e.state, a = v(e.queryKey, { scope: "persisted-query-key" }), o = t.valuePolicy === "verbatim" ? r(e.queryHash) : a ? r(n(a)) : void 0;
|
|
1045
|
+
return {
|
|
1046
|
+
buster: e.buster ? p(e.buster, 512) : void 0,
|
|
1047
|
+
queryHash: o,
|
|
1048
|
+
queryKey: a,
|
|
1049
|
+
status: i.status,
|
|
1050
|
+
fetchStatus: i.fetchStatus,
|
|
1051
|
+
dataUpdatedAt: i.dataUpdatedAt,
|
|
1052
|
+
errorUpdatedAt: i.errorUpdatedAt,
|
|
1053
|
+
failureCount: i.fetchFailureCount,
|
|
1054
|
+
dataPreview: t.valuePolicy === "verbatim" && t.dataPreviewBytes.persistedQuery > 0 && i.data !== void 0 ? w(i.data, t.dataPreviewBytes.persistedQuery) : void 0,
|
|
1055
|
+
error: i.error ? M(i.error) : void 0
|
|
1056
|
+
};
|
|
1013
1057
|
}
|
|
1014
|
-
function
|
|
1015
|
-
if (
|
|
1058
|
+
async function q() {
|
|
1059
|
+
if (!H()) return [];
|
|
1060
|
+
let e = s();
|
|
1061
|
+
if (!e?.entries) return [];
|
|
1016
1062
|
try {
|
|
1017
|
-
let
|
|
1018
|
-
return
|
|
1063
|
+
let t = await e.entries();
|
|
1064
|
+
return H() ? t.slice(-40).map(([, e]) => It(e)) : [];
|
|
1019
1065
|
} catch {
|
|
1020
1066
|
return [];
|
|
1021
1067
|
}
|
|
1022
1068
|
}
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1069
|
+
//#endregion
|
|
1070
|
+
//#region src/error-report/environment.ts
|
|
1071
|
+
function Lt(e = {}) {
|
|
1072
|
+
let t = e.isDev ?? __DEV__;
|
|
1073
|
+
return typeof window < "u" && !t;
|
|
1074
|
+
}
|
|
1075
|
+
function Rt() {
|
|
1076
|
+
return {
|
|
1077
|
+
mode: __DEV__ ? "development" : "production",
|
|
1078
|
+
buildId: typeof __APP_BUILD_ID__ == "string" ? __APP_BUILD_ID__ : void 0
|
|
1079
|
+
};
|
|
1027
1080
|
}
|
|
1028
|
-
function
|
|
1081
|
+
function zt() {
|
|
1082
|
+
if (!(typeof window > "u")) return {
|
|
1083
|
+
userAgent: window.navigator.userAgent,
|
|
1084
|
+
language: window.navigator.language,
|
|
1085
|
+
timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
1086
|
+
};
|
|
1087
|
+
}
|
|
1088
|
+
//#endregion
|
|
1089
|
+
//#region src/error-report/drafts.ts
|
|
1090
|
+
function Bt() {
|
|
1091
|
+
return o(/* @__PURE__ */ new Date());
|
|
1092
|
+
}
|
|
1093
|
+
function Vt() {
|
|
1029
1094
|
if (typeof window > "u") return;
|
|
1030
|
-
let e =
|
|
1095
|
+
let e = u().valuePolicy === "verbatim";
|
|
1031
1096
|
return {
|
|
1032
1097
|
pathname: window.location.pathname,
|
|
1033
1098
|
origin: window.location.origin,
|
|
@@ -1035,64 +1100,64 @@ function Dt() {
|
|
|
1035
1100
|
hash: e ? window.location.hash : void 0
|
|
1036
1101
|
};
|
|
1037
1102
|
}
|
|
1038
|
-
function
|
|
1103
|
+
function Ht() {
|
|
1039
1104
|
if (!(typeof window > "u")) return {
|
|
1040
1105
|
width: window.innerWidth,
|
|
1041
1106
|
height: window.innerHeight,
|
|
1042
1107
|
devicePixelRatio: window.devicePixelRatio
|
|
1043
1108
|
};
|
|
1044
1109
|
}
|
|
1045
|
-
function
|
|
1110
|
+
function Ut(e) {
|
|
1046
1111
|
if (!e) return;
|
|
1047
|
-
let t =
|
|
1112
|
+
let t = v(e, {
|
|
1048
1113
|
scope: "draft-failed-reason",
|
|
1049
1114
|
source: "delivery"
|
|
1050
1115
|
});
|
|
1051
1116
|
return typeof t == "string" ? t : void 0;
|
|
1052
1117
|
}
|
|
1053
|
-
function
|
|
1054
|
-
return
|
|
1118
|
+
function Wt(e) {
|
|
1119
|
+
return U().find((t) => t.reportId === e);
|
|
1055
1120
|
}
|
|
1056
|
-
function
|
|
1057
|
-
let n =
|
|
1121
|
+
function Gt(e, t) {
|
|
1122
|
+
let n = Wt(e);
|
|
1058
1123
|
if (!n) return;
|
|
1059
|
-
let r =
|
|
1124
|
+
let r = z({
|
|
1060
1125
|
...n,
|
|
1061
1126
|
...t,
|
|
1062
|
-
sentUtc: "sentUtc" in t ? t.sentUtc ?
|
|
1063
|
-
failedReason: "failedReason" in t ?
|
|
1127
|
+
sentUtc: "sentUtc" in t ? t.sentUtc ? p(t.sentUtc, 64) : void 0 : n.sentUtc,
|
|
1128
|
+
failedReason: "failedReason" in t ? Ut(t.failedReason) : n.failedReason
|
|
1064
1129
|
});
|
|
1065
|
-
if (r) return
|
|
1130
|
+
if (r) return jt(U().map((t) => t.reportId === e ? r : t)), r;
|
|
1066
1131
|
}
|
|
1067
|
-
function
|
|
1068
|
-
return
|
|
1132
|
+
function Kt() {
|
|
1133
|
+
return U();
|
|
1069
1134
|
}
|
|
1070
|
-
function
|
|
1071
|
-
if (!
|
|
1072
|
-
let t = i(), n =
|
|
1135
|
+
function J(e) {
|
|
1136
|
+
if (!Lt()) return;
|
|
1137
|
+
let t = i(), n = Mt(), r = Bt(), a = at({
|
|
1073
1138
|
payloadVersion: 1,
|
|
1074
1139
|
application: __APP_ID__,
|
|
1075
1140
|
reportId: t,
|
|
1076
1141
|
sessionId: n,
|
|
1077
1142
|
createdUtc: r,
|
|
1078
1143
|
category: e.category,
|
|
1079
|
-
source:
|
|
1144
|
+
source: p(e.source, 256),
|
|
1080
1145
|
error: e.error,
|
|
1081
|
-
environment:
|
|
1082
|
-
client:
|
|
1083
|
-
location:
|
|
1084
|
-
viewport:
|
|
1146
|
+
environment: Rt(),
|
|
1147
|
+
client: zt(),
|
|
1148
|
+
location: Vt(),
|
|
1149
|
+
viewport: Ht(),
|
|
1085
1150
|
react: e.react,
|
|
1086
1151
|
query: e.query,
|
|
1087
1152
|
mutation: e.mutation,
|
|
1088
1153
|
queryClient: e.queryClient,
|
|
1089
|
-
persistedQueries: e.persistedQueries,
|
|
1090
|
-
breadcrumbs:
|
|
1091
|
-
context:
|
|
1154
|
+
persistedQueries: H() ? e.persistedQueries : void 0,
|
|
1155
|
+
breadcrumbs: we(),
|
|
1156
|
+
context: y(e.context, {
|
|
1092
1157
|
scope: "context",
|
|
1093
1158
|
source: e.source
|
|
1094
1159
|
})
|
|
1095
|
-
}), o =
|
|
1160
|
+
}), o = z({
|
|
1096
1161
|
reportId: t,
|
|
1097
1162
|
sessionId: n,
|
|
1098
1163
|
createdUtc: r,
|
|
@@ -1100,60 +1165,12 @@ function K(e) {
|
|
|
1100
1165
|
status: "pending",
|
|
1101
1166
|
payload: a
|
|
1102
1167
|
});
|
|
1103
|
-
if (o) return
|
|
1104
|
-
}
|
|
1105
|
-
//#endregion
|
|
1106
|
-
//#region src/error-report/runtimeDeduplication.ts
|
|
1107
|
-
var Nt = 6e4, Pt = 100, q = /* @__PURE__ */ new Map();
|
|
1108
|
-
function Ft(e) {
|
|
1109
|
-
if (e) return e.split("\n").map((e) => e.trim()).filter(Boolean);
|
|
1110
|
-
}
|
|
1111
|
-
function It(e) {
|
|
1112
|
-
return r(n({
|
|
1113
|
-
category: e.category,
|
|
1114
|
-
source: e.source,
|
|
1115
|
-
error: {
|
|
1116
|
-
...e.error,
|
|
1117
|
-
stackTrace: Ft(e.error.stackTrace)
|
|
1118
|
-
},
|
|
1119
|
-
pathname: e.pathname,
|
|
1120
|
-
scope: e.scope
|
|
1121
|
-
}));
|
|
1122
|
-
}
|
|
1123
|
-
function J(e, t) {
|
|
1124
|
-
let n = q.get(e);
|
|
1125
|
-
!n || t && n.capture !== t || (clearTimeout(n.expirationTimer), q.delete(e));
|
|
1126
|
-
}
|
|
1127
|
-
function Lt(e) {
|
|
1128
|
-
for (let [t, n] of q) e - n.capturedAt >= 6e4 && J(t, n.capture);
|
|
1129
|
-
}
|
|
1130
|
-
function Rt() {
|
|
1131
|
-
let e = q.keys().next().value;
|
|
1132
|
-
e && J(e);
|
|
1133
|
-
}
|
|
1134
|
-
function zt(e, t) {
|
|
1135
|
-
let n = Date.now(), r = It(e), i = q.get(r);
|
|
1136
|
-
if (i && n - i.capturedAt < 6e4) return i.capture;
|
|
1137
|
-
for (Lt(n); q.size >= Pt;) Rt();
|
|
1138
|
-
let a = t(), o = setTimeout(() => {
|
|
1139
|
-
J(r, a);
|
|
1140
|
-
}, Nt);
|
|
1141
|
-
return q.set(r, {
|
|
1142
|
-
capturedAt: n,
|
|
1143
|
-
capture: a,
|
|
1144
|
-
expirationTimer: o
|
|
1145
|
-
}), a.catch(() => {
|
|
1146
|
-
J(r, a);
|
|
1147
|
-
}), a;
|
|
1148
|
-
}
|
|
1149
|
-
function Bt() {
|
|
1150
|
-
for (let e of q.values()) clearTimeout(e.expirationTimer);
|
|
1151
|
-
q.clear();
|
|
1168
|
+
if (o) return jt([...U(), o]), o;
|
|
1152
1169
|
}
|
|
1153
1170
|
//#endregion
|
|
1154
1171
|
//#region src/error-report/transport.ts
|
|
1155
|
-
var
|
|
1156
|
-
function
|
|
1172
|
+
var qt = 6e4, Jt = 100, Yt = 250, Xt, Zt = /* @__PURE__ */ new WeakSet(), Qt = /* @__PURE__ */ new WeakSet(), Y = /* @__PURE__ */ new Map();
|
|
1173
|
+
function $t(e) {
|
|
1157
1174
|
return [
|
|
1158
1175
|
e.source,
|
|
1159
1176
|
e.method,
|
|
@@ -1162,37 +1179,37 @@ function qt(e) {
|
|
|
1162
1179
|
e.responseUrl
|
|
1163
1180
|
].filter(Boolean).join("|");
|
|
1164
1181
|
}
|
|
1165
|
-
function
|
|
1166
|
-
let t = Date.now(), n =
|
|
1167
|
-
for (let [e, n] of Y) (t - n >
|
|
1182
|
+
function en(e) {
|
|
1183
|
+
let t = Date.now(), n = $t(e);
|
|
1184
|
+
for (let [e, n] of Y) (t - n > qt || Y.size > Jt) && Y.delete(e);
|
|
1168
1185
|
let r = Y.get(n);
|
|
1169
|
-
return r && t - r <
|
|
1186
|
+
return r && t - r < qt ? !0 : (Y.set(n, t), !1);
|
|
1170
1187
|
}
|
|
1171
|
-
function
|
|
1172
|
-
|
|
1188
|
+
function tn(e) {
|
|
1189
|
+
Xt = e, Y.clear();
|
|
1173
1190
|
}
|
|
1174
|
-
function
|
|
1175
|
-
return e instanceof Error &&
|
|
1191
|
+
function nn(e) {
|
|
1192
|
+
return e instanceof Error && Zt.has(e);
|
|
1176
1193
|
}
|
|
1177
|
-
function
|
|
1178
|
-
e instanceof Error &&
|
|
1194
|
+
function rn(e) {
|
|
1195
|
+
e instanceof Error && Qt.add(e);
|
|
1179
1196
|
}
|
|
1180
|
-
function
|
|
1181
|
-
|
|
1182
|
-
if (!
|
|
1183
|
-
let n =
|
|
1197
|
+
function an(e, t) {
|
|
1198
|
+
Zt.add(e), setTimeout(() => {
|
|
1199
|
+
if (!Qt.has(e) && Xt && !en(t)) try {
|
|
1200
|
+
let n = Xt(e, t);
|
|
1184
1201
|
Promise.resolve(n).catch(() => void 0);
|
|
1185
1202
|
} catch {}
|
|
1186
|
-
},
|
|
1203
|
+
}, Yt);
|
|
1187
1204
|
}
|
|
1188
1205
|
//#endregion
|
|
1189
1206
|
//#region src/error-report/capture.ts
|
|
1190
|
-
async function
|
|
1191
|
-
|
|
1207
|
+
async function on(e, t, n, r) {
|
|
1208
|
+
rn(e);
|
|
1192
1209
|
let i = r?.source ?? "query";
|
|
1193
|
-
|
|
1210
|
+
x({
|
|
1194
1211
|
type: "query-error",
|
|
1195
|
-
detail:
|
|
1212
|
+
detail: y({
|
|
1196
1213
|
queryKey: r?.queryKey ?? t.queryKey,
|
|
1197
1214
|
...r?.detail
|
|
1198
1215
|
}, {
|
|
@@ -1200,26 +1217,26 @@ async function $t(e, t, n, r) {
|
|
|
1200
1217
|
source: i
|
|
1201
1218
|
})
|
|
1202
1219
|
});
|
|
1203
|
-
let [a, o] = await Promise.all([
|
|
1204
|
-
return
|
|
1220
|
+
let [a, o] = await Promise.all([q(), Promise.resolve(K(n))]);
|
|
1221
|
+
return J({
|
|
1205
1222
|
category: "query",
|
|
1206
1223
|
source: i,
|
|
1207
|
-
error: r?.errorInfo ??
|
|
1208
|
-
query:
|
|
1224
|
+
error: r?.errorInfo ?? M(e),
|
|
1225
|
+
query: W(t),
|
|
1209
1226
|
queryClient: o,
|
|
1210
1227
|
persistedQueries: a,
|
|
1211
|
-
context:
|
|
1228
|
+
context: y(r?.detail, {
|
|
1212
1229
|
scope: "context",
|
|
1213
1230
|
source: i
|
|
1214
1231
|
})
|
|
1215
1232
|
});
|
|
1216
1233
|
}
|
|
1217
|
-
async function
|
|
1218
|
-
|
|
1234
|
+
async function sn(e, t, n, r = {}) {
|
|
1235
|
+
rn(e);
|
|
1219
1236
|
let i = r.source ?? "mutation";
|
|
1220
|
-
|
|
1237
|
+
x({
|
|
1221
1238
|
type: "mutation-error",
|
|
1222
|
-
detail:
|
|
1239
|
+
detail: y({
|
|
1223
1240
|
mutationKey: t.options.mutationKey,
|
|
1224
1241
|
...r.detail
|
|
1225
1242
|
}, {
|
|
@@ -1227,28 +1244,28 @@ async function en(e, t, n, r = {}) {
|
|
|
1227
1244
|
source: i
|
|
1228
1245
|
})
|
|
1229
1246
|
});
|
|
1230
|
-
let [a, o] = await Promise.all([
|
|
1231
|
-
return
|
|
1247
|
+
let [a, o] = await Promise.all([q(), Promise.resolve(K(n))]);
|
|
1248
|
+
return J({
|
|
1232
1249
|
category: "mutation",
|
|
1233
1250
|
source: i,
|
|
1234
|
-
error: r.errorInfo ??
|
|
1235
|
-
mutation:
|
|
1251
|
+
error: r.errorInfo ?? M(e),
|
|
1252
|
+
mutation: G(t),
|
|
1236
1253
|
queryClient: o,
|
|
1237
1254
|
persistedQueries: a,
|
|
1238
|
-
context:
|
|
1255
|
+
context: y(r.detail, {
|
|
1239
1256
|
scope: "context",
|
|
1240
1257
|
source: i
|
|
1241
1258
|
})
|
|
1242
1259
|
});
|
|
1243
1260
|
}
|
|
1244
|
-
function
|
|
1245
|
-
let r = t.category ?? "runtime", i = t.source ?? t.category ?? "runtime", a = t.errorInfo ??
|
|
1261
|
+
function cn(e, t = {}, n) {
|
|
1262
|
+
let r = t.category ?? "runtime", i = t.source ?? t.category ?? "runtime", a = t.errorInfo ?? M(e), o = y(t.detail, {
|
|
1246
1263
|
scope: "context",
|
|
1247
1264
|
source: i
|
|
1248
1265
|
}), s = async () => {
|
|
1249
|
-
|
|
1266
|
+
x({
|
|
1250
1267
|
type: "runtime-error",
|
|
1251
|
-
detail:
|
|
1268
|
+
detail: y({
|
|
1252
1269
|
category: r,
|
|
1253
1270
|
source: i,
|
|
1254
1271
|
...t.detail
|
|
@@ -1257,8 +1274,8 @@ function tn(e, t = {}, n) {
|
|
|
1257
1274
|
source: i
|
|
1258
1275
|
})
|
|
1259
1276
|
});
|
|
1260
|
-
let [e, s] = n ? await Promise.all([
|
|
1261
|
-
return
|
|
1277
|
+
let [e, s] = n ? await Promise.all([q(), Promise.resolve(K(n))]) : [void 0, void 0];
|
|
1278
|
+
return J({
|
|
1262
1279
|
category: r,
|
|
1263
1280
|
source: i,
|
|
1264
1281
|
error: a,
|
|
@@ -1268,7 +1285,7 @@ function tn(e, t = {}, n) {
|
|
|
1268
1285
|
context: o
|
|
1269
1286
|
});
|
|
1270
1287
|
};
|
|
1271
|
-
return typeof window > "u" ? s() :
|
|
1288
|
+
return typeof window > "u" ? s() : ht({
|
|
1272
1289
|
category: r,
|
|
1273
1290
|
source: i,
|
|
1274
1291
|
error: a,
|
|
@@ -1281,41 +1298,41 @@ function tn(e, t = {}, n) {
|
|
|
1281
1298
|
}
|
|
1282
1299
|
//#endregion
|
|
1283
1300
|
//#region src/error-report/queueContract.ts
|
|
1284
|
-
var
|
|
1301
|
+
var ln = 1, un = 50, dn = 6048e5, fn = 3e4, pn = /* @__PURE__ */ new Set([
|
|
1285
1302
|
"http",
|
|
1286
1303
|
"network",
|
|
1287
1304
|
"timeout",
|
|
1288
1305
|
"unknown"
|
|
1289
1306
|
]);
|
|
1290
|
-
function
|
|
1307
|
+
function mn(e) {
|
|
1291
1308
|
return typeof e == "object" && !!e && !Array.isArray(e);
|
|
1292
1309
|
}
|
|
1293
1310
|
function X(e) {
|
|
1294
1311
|
return typeof e == "string" && e.length <= 64 && Number.isFinite(Date.parse(e));
|
|
1295
1312
|
}
|
|
1296
|
-
function
|
|
1313
|
+
function hn(e) {
|
|
1297
1314
|
return typeof e == "number" && Number.isSafeInteger(e) && e >= 0;
|
|
1298
1315
|
}
|
|
1299
|
-
function
|
|
1300
|
-
if (e !== void 0 && !(!
|
|
1316
|
+
function gn(e) {
|
|
1317
|
+
if (e !== void 0 && !(!mn(e) || !X(e.utc) || typeof e.kind != "string") && pn.has(e.kind) && !(e.httpStatus !== void 0 && (typeof e.httpStatus != "number" || !Number.isInteger(e.httpStatus) || e.httpStatus < 100 || e.httpStatus > 599))) return {
|
|
1301
1318
|
utc: e.utc,
|
|
1302
1319
|
kind: e.kind,
|
|
1303
1320
|
httpStatus: e.httpStatus
|
|
1304
1321
|
};
|
|
1305
1322
|
}
|
|
1306
|
-
function
|
|
1307
|
-
if (e !== void 0 && !(!
|
|
1323
|
+
function _n(e) {
|
|
1324
|
+
if (e !== void 0 && !(!mn(e) || typeof e.ownerId != "string" || e.ownerId.length === 0 || e.ownerId.length > 128) && X(e.expiresUtc)) return {
|
|
1308
1325
|
ownerId: e.ownerId,
|
|
1309
1326
|
expiresUtc: e.expiresUtc
|
|
1310
1327
|
};
|
|
1311
1328
|
}
|
|
1312
|
-
function
|
|
1313
|
-
if (!
|
|
1314
|
-
let t =
|
|
1329
|
+
function vn(e) {
|
|
1330
|
+
if (!mn(e) || e.queueVersion !== 1 || typeof e.reportId != "string" || !X(e.enqueuedUtc) || !X(e.expiresUtc) || !X(e.nextAttemptUtc) || !hn(e.attemptCount)) return;
|
|
1331
|
+
let t = R(e.payload);
|
|
1315
1332
|
if (!t || t.reportId !== e.reportId) return;
|
|
1316
|
-
let n =
|
|
1333
|
+
let n = _n(e.lease);
|
|
1317
1334
|
if (e.lease !== void 0 && !n) return;
|
|
1318
|
-
let r =
|
|
1335
|
+
let r = gn(e.lastFailure);
|
|
1319
1336
|
if (!(e.lastFailure !== void 0 && !r)) return {
|
|
1320
1337
|
queueVersion: 1,
|
|
1321
1338
|
reportId: e.reportId,
|
|
@@ -1332,14 +1349,14 @@ function Z(e, t) {
|
|
|
1332
1349
|
if (!Array.isArray(e)) return [];
|
|
1333
1350
|
let n = /* @__PURE__ */ new Set(), r = [];
|
|
1334
1351
|
for (let i of e) {
|
|
1335
|
-
let e =
|
|
1352
|
+
let e = vn(i);
|
|
1336
1353
|
if (!(!e || Date.parse(e.expiresUtc) <= t || n.has(e.reportId)) && (n.add(e.reportId), r.push(e), r.length === 50)) break;
|
|
1337
1354
|
}
|
|
1338
1355
|
return r;
|
|
1339
1356
|
}
|
|
1340
1357
|
//#endregion
|
|
1341
1358
|
//#region src/error-report/queue.ts
|
|
1342
|
-
var
|
|
1359
|
+
var yn = "queue.v1", bn = "records";
|
|
1343
1360
|
function Q(e) {
|
|
1344
1361
|
return new Date(e).toISOString();
|
|
1345
1362
|
}
|
|
@@ -1348,10 +1365,10 @@ function $(e) {
|
|
|
1348
1365
|
if (t.length === 0 || t.length > 128) throw Error("Error report lease owner должен содержать от 1 до 128 символов");
|
|
1349
1366
|
return t;
|
|
1350
1367
|
}
|
|
1351
|
-
function
|
|
1368
|
+
function xn(e, t) {
|
|
1352
1369
|
return Date.parse(e.nextAttemptUtc) - Date.parse(t.nextAttemptUtc) || Date.parse(e.enqueuedUtc) - Date.parse(t.enqueuedUtc);
|
|
1353
1370
|
}
|
|
1354
|
-
function
|
|
1371
|
+
function Sn(e, t, n) {
|
|
1355
1372
|
let r = e.findIndex((e) => e.reportId === t);
|
|
1356
1373
|
return r < 0 ? {
|
|
1357
1374
|
index: r,
|
|
@@ -1364,16 +1381,16 @@ function gn(e, t, n) {
|
|
|
1364
1381
|
result: "lease-mismatch"
|
|
1365
1382
|
};
|
|
1366
1383
|
}
|
|
1367
|
-
function
|
|
1384
|
+
function Cn(e = {}) {
|
|
1368
1385
|
let t = e.storage ?? s({
|
|
1369
1386
|
dbName: e.dbName ?? `${__APP_ID__}.error-report.queue.v1`,
|
|
1370
|
-
storeName:
|
|
1387
|
+
storeName: bn,
|
|
1371
1388
|
indexedDB: e.indexedDB
|
|
1372
1389
|
});
|
|
1373
1390
|
if (!t) return;
|
|
1374
1391
|
let n = t;
|
|
1375
1392
|
function r(e, t) {
|
|
1376
|
-
return n.updateItem(
|
|
1393
|
+
return n.updateItem(yn, (n) => {
|
|
1377
1394
|
let r = t(Z(n, e));
|
|
1378
1395
|
return {
|
|
1379
1396
|
action: "set",
|
|
@@ -1384,7 +1401,7 @@ function _n(e = {}) {
|
|
|
1384
1401
|
}
|
|
1385
1402
|
return {
|
|
1386
1403
|
enqueue: async (e, t = /* @__PURE__ */ new Date()) => {
|
|
1387
|
-
let n =
|
|
1404
|
+
let n = R(e);
|
|
1388
1405
|
if (!n) return { status: "invalid-payload" };
|
|
1389
1406
|
let i = t.getTime();
|
|
1390
1407
|
return Number.isFinite(i) ? r(i, (e) => {
|
|
@@ -1409,7 +1426,7 @@ function _n(e = {}) {
|
|
|
1409
1426
|
queueVersion: 1,
|
|
1410
1427
|
reportId: n.reportId,
|
|
1411
1428
|
enqueuedUtc: r,
|
|
1412
|
-
expiresUtc: Q(i +
|
|
1429
|
+
expiresUtc: Q(i + dn),
|
|
1413
1430
|
nextAttemptUtc: r,
|
|
1414
1431
|
attemptCount: 0,
|
|
1415
1432
|
payload: n
|
|
@@ -1422,11 +1439,11 @@ function _n(e = {}) {
|
|
|
1422
1439
|
};
|
|
1423
1440
|
}) : { status: "invalid-payload" };
|
|
1424
1441
|
},
|
|
1425
|
-
leaseNext: async ({ ownerId: e, now: t = /* @__PURE__ */ new Date(), leaseDurationMs: n =
|
|
1442
|
+
leaseNext: async ({ ownerId: e, now: t = /* @__PURE__ */ new Date(), leaseDurationMs: n = fn }) => {
|
|
1426
1443
|
let i = $(e), a = t.getTime();
|
|
1427
1444
|
if (!Number.isFinite(a) || !Number.isFinite(n) || n <= 0) throw Error("Error report lease требует валидное время и положительную длительность");
|
|
1428
1445
|
return r(a, (e) => {
|
|
1429
|
-
let t = e.filter((e) => Date.parse(e.nextAttemptUtc) <= a && (e.lease === void 0 || Date.parse(e.lease.expiresUtc) <= a)).sort(
|
|
1446
|
+
let t = e.filter((e) => Date.parse(e.nextAttemptUtc) <= a && (e.lease === void 0 || Date.parse(e.lease.expiresUtc) <= a)).sort(xn)[0];
|
|
1430
1447
|
if (!t) return {
|
|
1431
1448
|
records: e,
|
|
1432
1449
|
result: void 0
|
|
@@ -1448,7 +1465,7 @@ function _n(e = {}) {
|
|
|
1448
1465
|
acknowledge: async (e, t) => {
|
|
1449
1466
|
let n = $(t);
|
|
1450
1467
|
return r(Date.now(), (t) => {
|
|
1451
|
-
let r =
|
|
1468
|
+
let r = Sn(t, e, n);
|
|
1452
1469
|
return r.result === "updated" ? (t.splice(r.index, 1), {
|
|
1453
1470
|
records: t,
|
|
1454
1471
|
result: "updated"
|
|
@@ -1462,7 +1479,7 @@ function _n(e = {}) {
|
|
|
1462
1479
|
let i = $(t), a = Date.parse(n.nextAttemptUtc), o = Date.parse(n.failure.utc);
|
|
1463
1480
|
if (!Number.isFinite(a) || !Number.isFinite(o)) throw Error("Error report retry требует валидные UTC timestamps");
|
|
1464
1481
|
return r(o, (t) => {
|
|
1465
|
-
let r =
|
|
1482
|
+
let r = Sn(t, e, i);
|
|
1466
1483
|
if (r.result !== "updated") return {
|
|
1467
1484
|
records: t,
|
|
1468
1485
|
result: r.result
|
|
@@ -1485,7 +1502,7 @@ function _n(e = {}) {
|
|
|
1485
1502
|
discard: async (e, t) => {
|
|
1486
1503
|
let n = $(t);
|
|
1487
1504
|
return r(Date.now(), (t) => {
|
|
1488
|
-
let r =
|
|
1505
|
+
let r = Sn(t, e, n);
|
|
1489
1506
|
return r.result === "updated" ? (t.splice(r.index, 1), {
|
|
1490
1507
|
records: t,
|
|
1491
1508
|
result: "updated"
|
|
@@ -1497,12 +1514,12 @@ function _n(e = {}) {
|
|
|
1497
1514
|
},
|
|
1498
1515
|
getRecords: async (e = /* @__PURE__ */ new Date()) => {
|
|
1499
1516
|
let t = e.getTime();
|
|
1500
|
-
return Number.isFinite(t) ? Z(await n.getItem(
|
|
1517
|
+
return Number.isFinite(t) ? Z(await n.getItem(yn), t).sort(xn) : [];
|
|
1501
1518
|
},
|
|
1502
1519
|
getNextWakeUtc: async (e = /* @__PURE__ */ new Date()) => {
|
|
1503
1520
|
let t = e.getTime();
|
|
1504
1521
|
if (!Number.isFinite(t)) return;
|
|
1505
|
-
let r = Z(await n.getItem(
|
|
1522
|
+
let r = Z(await n.getItem(yn), t).reduce((e, t) => {
|
|
1506
1523
|
let n = Math.max(Date.parse(t.nextAttemptUtc), t.lease ? Date.parse(t.lease.expiresUtc) : 0);
|
|
1507
1524
|
return e === void 0 || n < e ? n : e;
|
|
1508
1525
|
}, void 0);
|
|
@@ -1512,16 +1529,16 @@ function _n(e = {}) {
|
|
|
1512
1529
|
}
|
|
1513
1530
|
//#endregion
|
|
1514
1531
|
//#region src/error-report/runtime.ts
|
|
1515
|
-
var
|
|
1516
|
-
function
|
|
1517
|
-
|
|
1532
|
+
var wn;
|
|
1533
|
+
function Tn(e) {
|
|
1534
|
+
wn = e, gt();
|
|
1518
1535
|
}
|
|
1519
|
-
async function
|
|
1520
|
-
if (
|
|
1521
|
-
await
|
|
1536
|
+
async function En(e, t = {}) {
|
|
1537
|
+
if (wn) try {
|
|
1538
|
+
await wn(e, t);
|
|
1522
1539
|
} catch {}
|
|
1523
1540
|
}
|
|
1524
1541
|
//#endregion
|
|
1525
|
-
export { a as ERROR_REPORT_BUILD_ID_PATTERN,
|
|
1542
|
+
export { a as ERROR_REPORT_BUILD_ID_PATTERN, T as ERROR_REPORT_PAYLOAD_MAX_BYTES, Ge as ERROR_REPORT_PAYLOAD_VERSION, fn as ERROR_REPORT_QUEUE_LEASE_MS, un as ERROR_REPORT_QUEUE_MAX_ITEMS, dn as ERROR_REPORT_QUEUE_TTL_MS, ln as ERROR_REPORT_QUEUE_VERSION, E as ERROR_REPORT_STACK_TRACE_MAX_BYTES, Ke as ERROR_REPORT_VERBATIM_MESSAGE_MAX_BYTES, x as addErrorReportBreadcrumb, J as captureErrorReportDraft, sn as captureMutationErrorReport, on as captureQueryErrorReport, cn as captureRuntimeErrorReport, Te as clearErrorReportBreadcrumbs, G as collectMutationDiagnostics, q as collectPersistedQueryDiagnostics, K as collectQueryClientDiagnostics, W as collectQueryDiagnostics, _ as createDataShape, _e as createDiagnosticValue, M as createErrorInfo, Cn as createErrorReportQueue, At as disableErrorReportBrowserStorage, we as getErrorReportBreadcrumbs, zt as getErrorReportClientEnvironment, Wt as getErrorReportDraft, Kt as getErrorReportDrafts, Rt as getErrorReportEnvironment, k as getErrorReportPayloadSize, m as getUtf8TextSize, Le as installErrorReportBrowserBreadcrumbs, Lt as isErrorReportingEnabled, nn as isTransportErrorReportScheduled, at as limitErrorReportPayload, Z as normalizeErrorReportQueueRecords, z as parseErrorReportDraft, Tt as parseErrorReportDrafts, R as parseErrorReportPayload, vn as parseErrorReportQueueRecord, En as reportRuntimeError, an as reportTransportError, y as sanitizeDetail, p as sanitizeDiagnosticText, h as sanitizeDiagnosticTextBytes, v as sanitizeErrorReportValue, ie as setErrorReportCaptureOptions, Tn as setErrorReportRuntimeErrorReporter, ve as setErrorReportSanitizer, tn as setErrorReportTransportErrorReporter, rn as suppressTransportErrorReport, Gt as updateErrorReportDraft };
|
|
1526
1543
|
|
|
1527
1544
|
//# sourceMappingURL=index.js.map
|