@ryuzaki13/react-foundation-lib 2.1.4 → 2.1.5
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/chunks/buildIdentity-uQE5d9pd.js +6 -0
- package/dist/chunks/buildIdentity-uQE5d9pd.js.map +1 -0
- package/dist/error-report/buildIdentity.d.ts +3 -0
- package/dist/error-report/buildIdentity.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 +188 -187
- package/dist/error-report/index.js.map +1 -1
- package/dist/error-report-source-maps/index.d.ts +1 -0
- package/dist/error-report-source-maps/index.d.ts.map +1 -1
- package/dist/error-report-source-maps/index.js +213 -212
- package/dist/error-report-source-maps/index.js.map +1 -1
- package/dist/error-report-source-maps/manifest.d.ts.map +1 -1
- package/dist/error-report-source-maps/types.d.ts +0 -2
- package/dist/error-report-source-maps/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -2,12 +2,13 @@ import { Jt as e } from "../chunks/formatters-DVE1YVNQ.js";
|
|
|
2
2
|
import { _ as t } from "../chunks/array-D-_yMMUK.js";
|
|
3
3
|
import { stableStringify as n } from "../utils/index.js";
|
|
4
4
|
import { hashString128 as r, uuidv4 as i } from "../crypto/index.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { t as a } from "../chunks/buildIdentity-uQE5d9pd.js";
|
|
6
|
+
import { an as o } from "../chunks/odata-service-CWkHASdw.js";
|
|
7
|
+
import { createIndexedDbQueryStorage as s } from "../query-client/index.js";
|
|
8
|
+
import { getSessionStorageId as ee } from "../session-storage/index.js";
|
|
8
9
|
import { z as c } from "zod";
|
|
9
10
|
//#region src/error-report/safeValue.ts
|
|
10
|
-
var
|
|
11
|
+
var te = 4, ne = 20, re = 40, l = 4096, ie = "[REDACTED]", ae = [
|
|
11
12
|
"apikey",
|
|
12
13
|
"authorization",
|
|
13
14
|
"cookie",
|
|
@@ -18,21 +19,21 @@ var ee = 4, te = 20, ne = 40, l = 4096, re = "[REDACTED]", ie = [
|
|
|
18
19
|
"secret",
|
|
19
20
|
"sessiontoken",
|
|
20
21
|
"token"
|
|
21
|
-
],
|
|
22
|
-
function oe(e) {
|
|
23
|
-
return e.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
24
|
-
}
|
|
22
|
+
], oe = "url", u;
|
|
25
23
|
function se(e) {
|
|
26
|
-
|
|
27
|
-
return ie.some((e) => t.includes(e));
|
|
24
|
+
return e.toLowerCase().replace(/[^a-z0-9]/g, "");
|
|
28
25
|
}
|
|
29
26
|
function ce(e) {
|
|
30
|
-
|
|
27
|
+
let t = se(e);
|
|
28
|
+
return ae.some((e) => t.includes(e));
|
|
31
29
|
}
|
|
32
30
|
function le(e) {
|
|
33
|
-
return
|
|
31
|
+
return se(e).endsWith(oe);
|
|
34
32
|
}
|
|
35
33
|
function ue(e) {
|
|
34
|
+
return /^(?:https?:\/\/|\/)[^\s]*[?#]/i.test(e);
|
|
35
|
+
}
|
|
36
|
+
function de(e) {
|
|
36
37
|
try {
|
|
37
38
|
let t = new URL(e, "https://error-report.invalid"), n = t.pathname;
|
|
38
39
|
return t.origin === "https://error-report.invalid" ? n : `${t.origin}${n}`;
|
|
@@ -59,34 +60,34 @@ function p(e, t) {
|
|
|
59
60
|
return n.slice(0, o);
|
|
60
61
|
}
|
|
61
62
|
function m(e, t, n, r) {
|
|
62
|
-
if (r &&
|
|
63
|
-
if (t >=
|
|
63
|
+
if (r && ce(r)) return ie;
|
|
64
|
+
if (t >= te) return { type: "truncated" };
|
|
64
65
|
if (e === null || typeof e == "boolean") return e;
|
|
65
66
|
if (typeof e == "number") return Number.isFinite(e) ? e : { type: "non-finite-number" };
|
|
66
|
-
if (typeof e == "string") return d(r &&
|
|
67
|
+
if (typeof e == "string") return d(r && le(r) || ue(e) ? de(e) : e, n.maxStringLength);
|
|
67
68
|
if (e === void 0) return { type: "undefined" };
|
|
68
69
|
if (e instanceof Date) return Number.isNaN(e.getTime()) ? { type: "invalid-date" } : e.toISOString();
|
|
69
70
|
if (typeof e == "object") {
|
|
70
71
|
if (n.seen.has(e)) return { type: "circular" };
|
|
71
72
|
n.seen.add(e);
|
|
72
73
|
}
|
|
73
|
-
if (Array.isArray(e)) return e.slice(0,
|
|
74
|
+
if (Array.isArray(e)) return e.slice(0, ne).map((e) => m(e, t + 1, n));
|
|
74
75
|
if (typeof e == "object") try {
|
|
75
|
-
let r = Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).slice(0,
|
|
76
|
+
let r = Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).slice(0, re);
|
|
76
77
|
return Object.fromEntries(r.map(([e, r]) => [e, m(r, t + 1, n, e)]));
|
|
77
78
|
} catch {
|
|
78
79
|
return { type: "unreadable" };
|
|
79
80
|
}
|
|
80
81
|
return typeof e == "function" ? { type: "function" } : typeof e == "symbol" ? { type: "symbol" } : typeof e == "bigint" ? e.toString() : { type: "unknown" };
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
+
function fe(e, t = 0) {
|
|
83
84
|
return m(e, t, {
|
|
84
85
|
seen: /* @__PURE__ */ new WeakSet(),
|
|
85
86
|
maxStringLength: l
|
|
86
87
|
});
|
|
87
88
|
}
|
|
88
89
|
function h(e, t = 0) {
|
|
89
|
-
if (t >=
|
|
90
|
+
if (t >= te) return { type: "truncated" };
|
|
90
91
|
if (e === null) return { type: "null" };
|
|
91
92
|
if (e === void 0) return { type: "undefined" };
|
|
92
93
|
if (Array.isArray(e)) return {
|
|
@@ -95,7 +96,7 @@ function h(e, t = 0) {
|
|
|
95
96
|
firstItemsShape: e.slice(0, 3).map((e) => h(e, t + 1))
|
|
96
97
|
};
|
|
97
98
|
if (typeof e == "object") {
|
|
98
|
-
let n = Object.entries(e).slice(0,
|
|
99
|
+
let n = Object.entries(e).slice(0, re);
|
|
99
100
|
return {
|
|
100
101
|
type: "object",
|
|
101
102
|
keys: n.map(([e]) => e),
|
|
@@ -104,7 +105,7 @@ function h(e, t = 0) {
|
|
|
104
105
|
}
|
|
105
106
|
return { type: typeof e };
|
|
106
107
|
}
|
|
107
|
-
function
|
|
108
|
+
function pe(e) {
|
|
108
109
|
u = e;
|
|
109
110
|
}
|
|
110
111
|
function g(e, t, n = l) {
|
|
@@ -127,21 +128,21 @@ function _(e, t = { scope: "context" }) {
|
|
|
127
128
|
}
|
|
128
129
|
//#endregion
|
|
129
130
|
//#region src/error-report/breadcrumbs.ts
|
|
130
|
-
var
|
|
131
|
+
var me = 20, he = 120, ge = [
|
|
131
132
|
"button",
|
|
132
133
|
"a",
|
|
133
134
|
"input",
|
|
134
135
|
"select",
|
|
135
136
|
"textarea",
|
|
136
137
|
"[role]"
|
|
137
|
-
].join(","),
|
|
138
|
-
function
|
|
138
|
+
].join(","), _e = /^[a-z0-9][a-z0-9._:/-]*$/i, v = [];
|
|
139
|
+
function ve() {
|
|
139
140
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
140
141
|
}
|
|
141
142
|
function y(e) {
|
|
142
143
|
v = [...v, {
|
|
143
144
|
...e,
|
|
144
|
-
utc: d(e.utc ??
|
|
145
|
+
utc: d(e.utc ?? ve(), 64),
|
|
145
146
|
routeId: e.routeId ? d(e.routeId.split(/[?#]/, 1)[0] ?? e.routeId, 512) : void 0,
|
|
146
147
|
appId: e.appId ? d(e.appId, 128) : void 0,
|
|
147
148
|
viewId: e.viewId ? d(e.viewId, 128) : void 0,
|
|
@@ -152,25 +153,25 @@ function y(e) {
|
|
|
152
153
|
})
|
|
153
154
|
}].slice(-80);
|
|
154
155
|
}
|
|
155
|
-
function
|
|
156
|
+
function ye() {
|
|
156
157
|
return v.slice();
|
|
157
158
|
}
|
|
158
|
-
function
|
|
159
|
+
function be() {
|
|
159
160
|
v = [];
|
|
160
161
|
}
|
|
161
|
-
function
|
|
162
|
-
return e(t,
|
|
162
|
+
function xe(t) {
|
|
163
|
+
return e(t, he);
|
|
163
164
|
}
|
|
164
|
-
function
|
|
165
|
-
let t =
|
|
166
|
-
return t &&
|
|
165
|
+
function Se(e) {
|
|
166
|
+
let t = xe(e.getAttribute("data-error-report-target"));
|
|
167
|
+
return t && _e.test(t) ? t : void 0;
|
|
167
168
|
}
|
|
168
169
|
function b(e, t) {
|
|
169
|
-
let n =
|
|
170
|
-
return n &&
|
|
170
|
+
let n = xe(e.getAttribute(t));
|
|
171
|
+
return n && _e.test(n) ? n : void 0;
|
|
171
172
|
}
|
|
172
|
-
function
|
|
173
|
-
let t =
|
|
173
|
+
function Ce(e) {
|
|
174
|
+
let t = Se(e);
|
|
174
175
|
return {
|
|
175
176
|
role: b(e, "role"),
|
|
176
177
|
type: b(e, "type"),
|
|
@@ -182,35 +183,35 @@ function Se(e) {
|
|
|
182
183
|
function x(e) {
|
|
183
184
|
return typeof CSS < "u" && typeof CSS.escape == "function" ? CSS.escape(e) : e.replace(/["\\#.[\]>~+:]/g, "\\$&");
|
|
184
185
|
}
|
|
185
|
-
function
|
|
186
|
-
let t =
|
|
186
|
+
function we(e) {
|
|
187
|
+
let t = Ce(e), n = [e.tagName.toLowerCase()];
|
|
187
188
|
return t.role && n.push(`[role="${t.role}"]`), t.type && n.push(`[type="${t.type}"]`), t.errorReportTarget ? n.push(`[data-error-report-target="${x(t.errorReportTarget)}"]`) : (t.dataUi && n.push(`[data-ui="${x(t.dataUi)}"]`), t.dataAction && n.push(`[data-action="${x(t.dataAction)}"]`)), n.join("");
|
|
188
189
|
}
|
|
189
|
-
function
|
|
190
|
-
let t =
|
|
190
|
+
function Te(e) {
|
|
191
|
+
let t = Ce(e);
|
|
191
192
|
return {
|
|
192
193
|
tag: e.tagName.toLowerCase(),
|
|
193
|
-
selector:
|
|
194
|
+
selector: we(e),
|
|
194
195
|
...t
|
|
195
196
|
};
|
|
196
197
|
}
|
|
197
|
-
function
|
|
198
|
+
function Ee(e) {
|
|
198
199
|
return Object.fromEntries(Object.entries(e).filter(([, e]) => e !== void 0 && (!Array.isArray(e) || e.length > 0)));
|
|
199
200
|
}
|
|
200
201
|
function S(e) {
|
|
201
202
|
let t = [], n = e;
|
|
202
|
-
for (; n && n !== document.documentElement && t.length <
|
|
203
|
+
for (; n && n !== document.documentElement && t.length < me && (t.push(n), n !== document.body);) n = n.parentElement;
|
|
203
204
|
return t;
|
|
204
205
|
}
|
|
205
|
-
function Ee(e) {
|
|
206
|
-
let t = S(e);
|
|
207
|
-
return t.find((e) => xe(e)) || (t.find((e) => e.matches(he) || b(e, "data-action") !== void 0 || b(e, "data-ui") !== void 0) ?? e);
|
|
208
|
-
}
|
|
209
206
|
function De(e) {
|
|
210
|
-
|
|
207
|
+
let t = S(e);
|
|
208
|
+
return t.find((e) => Se(e)) || (t.find((e) => e.matches(ge) || b(e, "data-action") !== void 0 || b(e, "data-ui") !== void 0) ?? e);
|
|
211
209
|
}
|
|
212
210
|
function Oe(e) {
|
|
213
|
-
|
|
211
|
+
if (e instanceof Element) return S(De(e)).map((e) => we(e)).join(" > ");
|
|
212
|
+
}
|
|
213
|
+
function ke(e) {
|
|
214
|
+
let t = e.target instanceof Element ? e.target : void 0, n = t ? De(t) : void 0, r = n ? S(n).map((e) => Ee(Te(e))) : [];
|
|
214
215
|
return _({
|
|
215
216
|
button: e.button,
|
|
216
217
|
ctrlKey: e.ctrlKey,
|
|
@@ -218,20 +219,20 @@ function Oe(e) {
|
|
|
218
219
|
altKey: e.altKey,
|
|
219
220
|
clientX: e.clientX,
|
|
220
221
|
clientY: e.clientY,
|
|
221
|
-
target: n ? Te(
|
|
222
|
+
target: n ? Ee(Te(n)) : void 0,
|
|
222
223
|
chain: r
|
|
223
224
|
}, {
|
|
224
225
|
scope: "breadcrumb-detail",
|
|
225
226
|
source: "click"
|
|
226
227
|
});
|
|
227
228
|
}
|
|
228
|
-
function
|
|
229
|
+
function Ae() {
|
|
229
230
|
if (typeof window > "u") return () => void 0;
|
|
230
231
|
let e = (e) => {
|
|
231
232
|
y({
|
|
232
233
|
type: "click",
|
|
233
|
-
target:
|
|
234
|
-
detail:
|
|
234
|
+
target: Oe(e.target),
|
|
235
|
+
detail: ke(e)
|
|
235
236
|
});
|
|
236
237
|
}, t = () => {
|
|
237
238
|
y({
|
|
@@ -248,12 +249,12 @@ function ke() {
|
|
|
248
249
|
}
|
|
249
250
|
//#endregion
|
|
250
251
|
//#region src/error-report/payload.ts
|
|
251
|
-
var
|
|
252
|
-
function
|
|
252
|
+
var je = 1, C = 262144, w = 65536, Me = 32768, Ne = 256, Pe = 128, Fe = 2048;
|
|
253
|
+
function Ie(e) {
|
|
253
254
|
return new TextEncoder().encode(JSON.stringify(e)).byteLength;
|
|
254
255
|
}
|
|
255
|
-
function
|
|
256
|
-
return d(e.split(/[?#]/, 1)[0] ?? e,
|
|
256
|
+
function Le(e) {
|
|
257
|
+
return d(e.split(/[?#]/, 1)[0] ?? e, Fe);
|
|
257
258
|
}
|
|
258
259
|
function T(e, t, n, r = "characters") {
|
|
259
260
|
let i = g(r === "bytes" ? p(e, n) : d(e, n), t, n);
|
|
@@ -274,7 +275,7 @@ function E(e, t) {
|
|
|
274
275
|
httpStatus: e.httpStatus
|
|
275
276
|
};
|
|
276
277
|
}
|
|
277
|
-
function
|
|
278
|
+
function Re(e) {
|
|
278
279
|
return {
|
|
279
280
|
...e,
|
|
280
281
|
queryHash: d(e.queryHash, 512),
|
|
@@ -293,7 +294,7 @@ function Le(e) {
|
|
|
293
294
|
error: e.error ? E(e.error, e.queryHash) : void 0
|
|
294
295
|
};
|
|
295
296
|
}
|
|
296
|
-
function
|
|
297
|
+
function ze(e) {
|
|
297
298
|
return {
|
|
298
299
|
...e,
|
|
299
300
|
mutationKey: e.mutationKey ? g(e.mutationKey, { scope: "mutation-key" }) : void 0,
|
|
@@ -301,7 +302,7 @@ function Re(e) {
|
|
|
301
302
|
error: e.error ? E(e.error, "mutation") : void 0
|
|
302
303
|
};
|
|
303
304
|
}
|
|
304
|
-
function
|
|
305
|
+
function Be(e) {
|
|
305
306
|
return {
|
|
306
307
|
...e,
|
|
307
308
|
buster: e.buster ? d(e.buster, 512) : void 0,
|
|
@@ -314,16 +315,16 @@ function ze(e) {
|
|
|
314
315
|
};
|
|
315
316
|
}
|
|
316
317
|
function D(e) {
|
|
317
|
-
return
|
|
318
|
+
return Ie(e);
|
|
318
319
|
}
|
|
319
|
-
function
|
|
320
|
+
function Ve(e) {
|
|
320
321
|
return {
|
|
321
322
|
...e,
|
|
322
323
|
reportId: d(e.reportId, 128),
|
|
323
324
|
sessionId: d(e.sessionId, 128),
|
|
324
325
|
createdUtc: d(e.createdUtc, 64),
|
|
325
|
-
application: d(e.application,
|
|
326
|
-
source: d(e.source,
|
|
326
|
+
application: d(e.application, Pe),
|
|
327
|
+
source: d(e.source, Ne),
|
|
327
328
|
error: E(e.error, e.source),
|
|
328
329
|
environment: {
|
|
329
330
|
...e.environment,
|
|
@@ -335,20 +336,20 @@ function Be(e) {
|
|
|
335
336
|
timeZone: e.client.timeZone ? d(e.client.timeZone, 128) : void 0
|
|
336
337
|
} : void 0,
|
|
337
338
|
location: e.location ? {
|
|
338
|
-
pathname:
|
|
339
|
-
origin: e.location.origin ? d(e.location.origin.split(/[?#]/, 1)[0] ?? e.location.origin,
|
|
339
|
+
pathname: Le(e.location.pathname),
|
|
340
|
+
origin: e.location.origin ? d(e.location.origin.split(/[?#]/, 1)[0] ?? e.location.origin, Fe) : void 0
|
|
340
341
|
} : void 0,
|
|
341
342
|
react: e.react?.componentStack ? { componentStack: T(e.react.componentStack, {
|
|
342
343
|
scope: "stack-trace",
|
|
343
344
|
source: "react-component-stack"
|
|
344
|
-
},
|
|
345
|
-
query: e.query ?
|
|
346
|
-
mutation: e.mutation ?
|
|
345
|
+
}, Me, "bytes") } : void 0,
|
|
346
|
+
query: e.query ? Re(e.query) : void 0,
|
|
347
|
+
mutation: e.mutation ? ze(e.mutation) : void 0,
|
|
347
348
|
queryClient: e.queryClient ? {
|
|
348
|
-
queries: e.queryClient.queries.slice(-40).map(
|
|
349
|
-
mutations: e.queryClient.mutations.slice(-40).map(
|
|
349
|
+
queries: e.queryClient.queries.slice(-40).map(Re),
|
|
350
|
+
mutations: e.queryClient.mutations.slice(-40).map(ze)
|
|
350
351
|
} : void 0,
|
|
351
|
-
persistedQueries: e.persistedQueries?.slice(-40).map(
|
|
352
|
+
persistedQueries: e.persistedQueries?.slice(-40).map(Be),
|
|
352
353
|
breadcrumbs: e.breadcrumbs.slice(-80).map((e) => ({
|
|
353
354
|
...e,
|
|
354
355
|
utc: d(e.utc, 64),
|
|
@@ -367,8 +368,8 @@ function Be(e) {
|
|
|
367
368
|
})
|
|
368
369
|
};
|
|
369
370
|
}
|
|
370
|
-
function
|
|
371
|
-
let t =
|
|
371
|
+
function He(e) {
|
|
372
|
+
let t = Ve(e), n = D(t);
|
|
372
373
|
if (n <= 262144) return t;
|
|
373
374
|
let r = [], i = {
|
|
374
375
|
...t,
|
|
@@ -433,15 +434,15 @@ function Ve(e) {
|
|
|
433
434
|
}
|
|
434
435
|
//#endregion
|
|
435
436
|
//#region src/error-report/errorInfo.ts
|
|
436
|
-
var
|
|
437
|
+
var Ue = "Неизвестная ошибка";
|
|
437
438
|
function O(e) {
|
|
438
|
-
return t(e) ? d(e) :
|
|
439
|
+
return t(e) ? d(e) : Ue;
|
|
439
440
|
}
|
|
440
|
-
function
|
|
441
|
+
function We(e) {
|
|
441
442
|
let t = e.status ?? e.statusCode ?? e.httpStatus;
|
|
442
443
|
return typeof t == "number" && Number.isFinite(t) ? t : void 0;
|
|
443
444
|
}
|
|
444
|
-
function
|
|
445
|
+
function Ge(e) {
|
|
445
446
|
if (!e || typeof e != "object") return null;
|
|
446
447
|
let n = e.appError;
|
|
447
448
|
if (!n || typeof n != "object") return null;
|
|
@@ -450,11 +451,11 @@ function We(e) {
|
|
|
450
451
|
name: "AppError",
|
|
451
452
|
message: d(i),
|
|
452
453
|
code: t(r.code) ? d(String(r.code), 128) : void 0,
|
|
453
|
-
httpStatus:
|
|
454
|
+
httpStatus: We(r)
|
|
454
455
|
} : null;
|
|
455
456
|
}
|
|
456
457
|
function k(e) {
|
|
457
|
-
let t =
|
|
458
|
+
let t = Ge(e);
|
|
458
459
|
if (t) return t;
|
|
459
460
|
if (e instanceof Error) return {
|
|
460
461
|
name: d(e.name || "Error", 256),
|
|
@@ -467,17 +468,17 @@ function k(e) {
|
|
|
467
468
|
name: d(typeof t.name == "string" ? t.name : "Error", 256),
|
|
468
469
|
message: O(typeof t.message == "string" ? t.message : String(e)),
|
|
469
470
|
stackTrace: typeof t.stack == "string" ? p(t.stack, w) : void 0,
|
|
470
|
-
httpStatus:
|
|
471
|
+
httpStatus: We(t)
|
|
471
472
|
};
|
|
472
473
|
}
|
|
473
474
|
return {
|
|
474
475
|
name: "Error",
|
|
475
|
-
message: O(typeof e == "string" ? e : String(e ??
|
|
476
|
+
message: O(typeof e == "string" ? e : String(e ?? Ue))
|
|
476
477
|
};
|
|
477
478
|
}
|
|
478
479
|
//#endregion
|
|
479
480
|
//#region src/error-report/diagnostics.ts
|
|
480
|
-
function
|
|
481
|
+
function Ke(e, t, n) {
|
|
481
482
|
return _(e, {
|
|
482
483
|
scope: t,
|
|
483
484
|
source: n
|
|
@@ -495,7 +496,7 @@ function A(e) {
|
|
|
495
496
|
failureCount: e.state.fetchFailureCount,
|
|
496
497
|
isInvalidated: e.state.isInvalidated,
|
|
497
498
|
observersCount: e.getObserversCount(),
|
|
498
|
-
meta:
|
|
499
|
+
meta: Ke(e.meta, "query-meta", i),
|
|
499
500
|
dataShape: g(h(e.state.data), {
|
|
500
501
|
scope: "query-data-shape",
|
|
501
502
|
source: i
|
|
@@ -509,7 +510,7 @@ function j(e) {
|
|
|
509
510
|
status: e.state.status,
|
|
510
511
|
failureCount: e.state.failureCount,
|
|
511
512
|
submittedAt: e.state.submittedAt,
|
|
512
|
-
meta:
|
|
513
|
+
meta: Ke(e.meta, "mutation-meta"),
|
|
513
514
|
error: e.state.error ? k(e.state.error) : void 0
|
|
514
515
|
};
|
|
515
516
|
}
|
|
@@ -519,7 +520,7 @@ function M(e) {
|
|
|
519
520
|
mutations: e.getMutationCache().getAll().slice(-40).map(j)
|
|
520
521
|
};
|
|
521
522
|
}
|
|
522
|
-
function
|
|
523
|
+
function qe(e) {
|
|
523
524
|
let t = e.state, i = g(e.queryKey, { scope: "persisted-query-key" }), a = i ? r(n(i)) : void 0;
|
|
524
525
|
return {
|
|
525
526
|
buster: e.buster ? d(e.buster, 512) : void 0,
|
|
@@ -534,27 +535,27 @@ function Ke(e) {
|
|
|
534
535
|
};
|
|
535
536
|
}
|
|
536
537
|
async function N() {
|
|
537
|
-
let e =
|
|
538
|
+
let e = s();
|
|
538
539
|
if (!e?.entries) return [];
|
|
539
540
|
try {
|
|
540
|
-
return (await e.entries()).slice(-40).map(([, e]) =>
|
|
541
|
+
return (await e.entries()).slice(-40).map(([, e]) => qe(e));
|
|
541
542
|
} catch {
|
|
542
543
|
return [];
|
|
543
544
|
}
|
|
544
545
|
}
|
|
545
546
|
//#endregion
|
|
546
547
|
//#region src/error-report/environment.ts
|
|
547
|
-
function
|
|
548
|
+
function Je(e = {}) {
|
|
548
549
|
let t = e.isDev ?? __DEV__;
|
|
549
550
|
return typeof window < "u" && !t;
|
|
550
551
|
}
|
|
551
|
-
function
|
|
552
|
+
function Ye() {
|
|
552
553
|
return {
|
|
553
554
|
mode: __DEV__ ? "development" : "production",
|
|
554
555
|
buildId: typeof __APP_BUILD_ID__ == "string" ? __APP_BUILD_ID__ : void 0
|
|
555
556
|
};
|
|
556
557
|
}
|
|
557
|
-
function
|
|
558
|
+
function Xe() {
|
|
558
559
|
if (!(typeof window > "u")) return {
|
|
559
560
|
userAgent: window.navigator.userAgent,
|
|
560
561
|
language: window.navigator.language,
|
|
@@ -576,7 +577,7 @@ var P = c.lazy(() => c.union([
|
|
|
576
577
|
code: c.string().max(128).optional(),
|
|
577
578
|
stackTrace: c.string().refine((e) => f(e) <= 65536).optional(),
|
|
578
579
|
httpStatus: c.number().finite().optional()
|
|
579
|
-
}).strict(),
|
|
580
|
+
}).strict(), Ze = c.object({
|
|
580
581
|
utc: c.string().min(1).max(64),
|
|
581
582
|
type: c.enum([
|
|
582
583
|
"route",
|
|
@@ -591,7 +592,7 @@ var P = c.lazy(() => c.union([
|
|
|
591
592
|
viewId: c.string().max(128).optional(),
|
|
592
593
|
target: c.string().max(2048).optional(),
|
|
593
594
|
detail: F.optional()
|
|
594
|
-
}).strict(),
|
|
595
|
+
}).strict(), Qe = c.object({
|
|
595
596
|
queryHash: c.string().max(512),
|
|
596
597
|
queryKey: P,
|
|
597
598
|
status: c.string().max(64).optional(),
|
|
@@ -604,14 +605,14 @@ var P = c.lazy(() => c.union([
|
|
|
604
605
|
meta: F.optional(),
|
|
605
606
|
dataShape: P.optional(),
|
|
606
607
|
error: I.optional()
|
|
607
|
-
}).strict(),
|
|
608
|
+
}).strict(), $e = c.object({
|
|
608
609
|
mutationKey: P.optional(),
|
|
609
610
|
status: c.string().max(64).optional(),
|
|
610
611
|
failureCount: c.number().finite().optional(),
|
|
611
612
|
submittedAt: c.number().finite().optional(),
|
|
612
613
|
meta: F.optional(),
|
|
613
614
|
error: I.optional()
|
|
614
|
-
}).strict(),
|
|
615
|
+
}).strict(), et = c.object({
|
|
615
616
|
buster: c.string().max(512).optional(),
|
|
616
617
|
queryHash: c.string().max(512).optional(),
|
|
617
618
|
queryKey: P.optional(),
|
|
@@ -621,7 +622,7 @@ var P = c.lazy(() => c.union([
|
|
|
621
622
|
errorUpdatedAt: c.number().finite().optional(),
|
|
622
623
|
failureCount: c.number().finite().optional(),
|
|
623
624
|
error: I.optional()
|
|
624
|
-
}).strict(),
|
|
625
|
+
}).strict(), tt = c.object({
|
|
625
626
|
payloadVersion: c.literal(1),
|
|
626
627
|
application: c.string().min(1).max(128),
|
|
627
628
|
reportId: c.string().uuid(),
|
|
@@ -654,14 +655,14 @@ var P = c.lazy(() => c.union([
|
|
|
654
655
|
devicePixelRatio: c.number().finite().optional()
|
|
655
656
|
}).strict().optional(),
|
|
656
657
|
react: c.object({ componentStack: c.string().refine((e) => f(e) <= 32768).optional() }).strict().optional(),
|
|
657
|
-
query:
|
|
658
|
-
mutation:
|
|
658
|
+
query: Qe.optional(),
|
|
659
|
+
mutation: $e.optional(),
|
|
659
660
|
queryClient: c.object({
|
|
660
|
-
queries: c.array(
|
|
661
|
-
mutations: c.array(
|
|
661
|
+
queries: c.array(Qe).max(40),
|
|
662
|
+
mutations: c.array($e).max(40)
|
|
662
663
|
}).strict().optional(),
|
|
663
|
-
persistedQueries: c.array(
|
|
664
|
-
breadcrumbs: c.array(
|
|
664
|
+
persistedQueries: c.array(et).max(40).optional(),
|
|
665
|
+
breadcrumbs: c.array(Ze).max(80),
|
|
665
666
|
context: F.optional(),
|
|
666
667
|
truncation: c.object({
|
|
667
668
|
reason: c.literal("payload-size"),
|
|
@@ -669,7 +670,7 @@ var P = c.lazy(() => c.union([
|
|
|
669
670
|
originalBytes: c.number().int().positive(),
|
|
670
671
|
droppedSections: c.array(c.string().max(128)).max(32)
|
|
671
672
|
}).strict().optional()
|
|
672
|
-
}).strict().refine((e) => D(e) <= C),
|
|
673
|
+
}).strict().refine((e) => D(e) <= C), nt = c.object({
|
|
673
674
|
reportId: c.string().uuid(),
|
|
674
675
|
sessionId: c.string().uuid(),
|
|
675
676
|
createdUtc: c.string().min(1).max(64),
|
|
@@ -687,14 +688,14 @@ var P = c.lazy(() => c.union([
|
|
|
687
688
|
]),
|
|
688
689
|
sentUtc: c.string().min(1).max(64).optional(),
|
|
689
690
|
failedReason: c.string().max(4096).optional(),
|
|
690
|
-
payload:
|
|
691
|
+
payload: tt
|
|
691
692
|
}).strict().superRefine((e, t) => {
|
|
692
693
|
(e.reportId !== e.payload.reportId || e.sessionId !== e.payload.sessionId || e.createdUtc !== e.payload.createdUtc || e.category !== e.payload.category) && t.addIssue({
|
|
693
694
|
code: "custom",
|
|
694
695
|
message: "Draft identity должна совпадать с payload identity."
|
|
695
696
|
});
|
|
696
697
|
});
|
|
697
|
-
function
|
|
698
|
+
function rt(e, t) {
|
|
698
699
|
try {
|
|
699
700
|
return new TextEncoder().encode(JSON.stringify(e)).byteLength <= t;
|
|
700
701
|
} catch {
|
|
@@ -702,22 +703,22 @@ function nt(e, t) {
|
|
|
702
703
|
}
|
|
703
704
|
}
|
|
704
705
|
function L(e) {
|
|
705
|
-
if (
|
|
706
|
-
let t =
|
|
706
|
+
if (rt(e, 262144)) try {
|
|
707
|
+
let t = tt.safeParse(e);
|
|
707
708
|
return t.success ? t.data : void 0;
|
|
708
709
|
} catch {
|
|
709
710
|
return;
|
|
710
711
|
}
|
|
711
712
|
}
|
|
712
713
|
function R(e) {
|
|
713
|
-
if (
|
|
714
|
-
let t =
|
|
714
|
+
if (rt(e, 278528)) try {
|
|
715
|
+
let t = nt.safeParse(e);
|
|
715
716
|
return t.success ? t.data : void 0;
|
|
716
717
|
} catch {
|
|
717
718
|
return;
|
|
718
719
|
}
|
|
719
720
|
}
|
|
720
|
-
function
|
|
721
|
+
function it(e) {
|
|
721
722
|
return Array.isArray(e) ? e.flatMap((e) => {
|
|
722
723
|
let t = R(e);
|
|
723
724
|
return t ? [t] : [];
|
|
@@ -725,38 +726,38 @@ function rt(e) {
|
|
|
725
726
|
}
|
|
726
727
|
//#endregion
|
|
727
728
|
//#region src/error-report/drafts.ts
|
|
728
|
-
var
|
|
729
|
-
function ot() {
|
|
730
|
-
return a(/* @__PURE__ */ new Date());
|
|
731
|
-
}
|
|
729
|
+
var at = `${__APP_ID__}.errorReport.drafts.v2`, ot = `${__APP_ID__}.errorReport.sessionId.v1`, z = ct();
|
|
732
730
|
function st() {
|
|
731
|
+
return o(/* @__PURE__ */ new Date());
|
|
732
|
+
}
|
|
733
|
+
function ct() {
|
|
733
734
|
if (typeof sessionStorage > "u") return [];
|
|
734
735
|
try {
|
|
735
|
-
let e = sessionStorage.getItem(
|
|
736
|
-
return
|
|
736
|
+
let e = sessionStorage.getItem(at);
|
|
737
|
+
return it(e ? JSON.parse(e) : []);
|
|
737
738
|
} catch {
|
|
738
739
|
return [];
|
|
739
740
|
}
|
|
740
741
|
}
|
|
741
|
-
function
|
|
742
|
+
function lt(e) {
|
|
742
743
|
if (z = e.slice(-10), !(typeof sessionStorage > "u")) try {
|
|
743
|
-
sessionStorage.setItem(
|
|
744
|
+
sessionStorage.setItem(at, JSON.stringify(z));
|
|
744
745
|
} catch {}
|
|
745
746
|
}
|
|
746
|
-
function
|
|
747
|
+
function ut() {
|
|
747
748
|
if (!(typeof window > "u")) return {
|
|
748
749
|
pathname: window.location.pathname,
|
|
749
750
|
origin: window.location.origin
|
|
750
751
|
};
|
|
751
752
|
}
|
|
752
|
-
function
|
|
753
|
+
function dt() {
|
|
753
754
|
if (!(typeof window > "u")) return {
|
|
754
755
|
width: window.innerWidth,
|
|
755
756
|
height: window.innerHeight,
|
|
756
757
|
devicePixelRatio: window.devicePixelRatio
|
|
757
758
|
};
|
|
758
759
|
}
|
|
759
|
-
function
|
|
760
|
+
function ft(e) {
|
|
760
761
|
if (!e) return;
|
|
761
762
|
let t = g(e, {
|
|
762
763
|
scope: "draft-failed-reason",
|
|
@@ -764,26 +765,26 @@ function dt(e) {
|
|
|
764
765
|
});
|
|
765
766
|
return typeof t == "string" ? t : void 0;
|
|
766
767
|
}
|
|
767
|
-
function
|
|
768
|
+
function pt(e) {
|
|
768
769
|
return z.find((t) => t.reportId === e);
|
|
769
770
|
}
|
|
770
|
-
function
|
|
771
|
-
let n =
|
|
771
|
+
function mt(e, t) {
|
|
772
|
+
let n = pt(e);
|
|
772
773
|
if (!n) return;
|
|
773
774
|
let r = R({
|
|
774
775
|
...n,
|
|
775
776
|
...t,
|
|
776
777
|
sentUtc: "sentUtc" in t ? t.sentUtc ? d(t.sentUtc, 64) : void 0 : n.sentUtc,
|
|
777
|
-
failedReason: "failedReason" in t ?
|
|
778
|
+
failedReason: "failedReason" in t ? ft(t.failedReason) : n.failedReason
|
|
778
779
|
});
|
|
779
|
-
if (r) return
|
|
780
|
+
if (r) return lt(z.map((t) => t.reportId === e ? r : t)), r;
|
|
780
781
|
}
|
|
781
|
-
function
|
|
782
|
+
function ht() {
|
|
782
783
|
return z;
|
|
783
784
|
}
|
|
784
785
|
function B(e) {
|
|
785
|
-
if (!
|
|
786
|
-
let t = i(), n =
|
|
786
|
+
if (!Je()) return;
|
|
787
|
+
let t = i(), n = ee(ot), r = st(), a = He({
|
|
787
788
|
payloadVersion: 1,
|
|
788
789
|
application: __APP_ID__,
|
|
789
790
|
reportId: t,
|
|
@@ -792,16 +793,16 @@ function B(e) {
|
|
|
792
793
|
category: e.category,
|
|
793
794
|
source: d(e.source, 256),
|
|
794
795
|
error: e.error,
|
|
795
|
-
environment:
|
|
796
|
-
client:
|
|
797
|
-
location:
|
|
798
|
-
viewport:
|
|
796
|
+
environment: Ye(),
|
|
797
|
+
client: Xe(),
|
|
798
|
+
location: ut(),
|
|
799
|
+
viewport: dt(),
|
|
799
800
|
react: e.react,
|
|
800
801
|
query: e.query,
|
|
801
802
|
mutation: e.mutation,
|
|
802
803
|
queryClient: e.queryClient,
|
|
803
804
|
persistedQueries: e.persistedQueries,
|
|
804
|
-
breadcrumbs:
|
|
805
|
+
breadcrumbs: ye(),
|
|
805
806
|
context: _(e.context, {
|
|
806
807
|
scope: "context",
|
|
807
808
|
source: e.source
|
|
@@ -814,21 +815,21 @@ function B(e) {
|
|
|
814
815
|
status: "pending",
|
|
815
816
|
payload: a
|
|
816
817
|
});
|
|
817
|
-
if (o) return
|
|
818
|
+
if (o) return lt([...z, o]), o;
|
|
818
819
|
}
|
|
819
820
|
//#endregion
|
|
820
821
|
//#region src/error-report/runtimeDeduplication.ts
|
|
821
|
-
var
|
|
822
|
-
function
|
|
822
|
+
var gt = 6e4, _t = 100, V = /* @__PURE__ */ new Map();
|
|
823
|
+
function vt(e) {
|
|
823
824
|
if (e) return e.split("\n").map((e) => e.trim()).filter(Boolean);
|
|
824
825
|
}
|
|
825
|
-
function
|
|
826
|
+
function yt(e) {
|
|
826
827
|
return r(n({
|
|
827
828
|
category: e.category,
|
|
828
829
|
source: e.source,
|
|
829
830
|
error: {
|
|
830
831
|
...e.error,
|
|
831
|
-
stackTrace:
|
|
832
|
+
stackTrace: vt(e.error.stackTrace)
|
|
832
833
|
},
|
|
833
834
|
pathname: e.pathname,
|
|
834
835
|
scope: e.scope
|
|
@@ -838,20 +839,20 @@ function H(e, t) {
|
|
|
838
839
|
let n = V.get(e);
|
|
839
840
|
!n || t && n.capture !== t || (clearTimeout(n.expirationTimer), V.delete(e));
|
|
840
841
|
}
|
|
841
|
-
function
|
|
842
|
+
function bt(e) {
|
|
842
843
|
for (let [t, n] of V) e - n.capturedAt >= 6e4 && H(t, n.capture);
|
|
843
844
|
}
|
|
844
|
-
function
|
|
845
|
+
function xt() {
|
|
845
846
|
let e = V.keys().next().value;
|
|
846
847
|
e && H(e);
|
|
847
848
|
}
|
|
848
|
-
function
|
|
849
|
-
let n = Date.now(), r =
|
|
849
|
+
function St(e, t) {
|
|
850
|
+
let n = Date.now(), r = yt(e), i = V.get(r);
|
|
850
851
|
if (i && n - i.capturedAt < 6e4) return i.capture;
|
|
851
|
-
for (
|
|
852
|
+
for (bt(n); V.size >= _t;) xt();
|
|
852
853
|
let a = t(), o = setTimeout(() => {
|
|
853
854
|
H(r, a);
|
|
854
|
-
},
|
|
855
|
+
}, gt);
|
|
855
856
|
return V.set(r, {
|
|
856
857
|
capturedAt: n,
|
|
857
858
|
capture: a,
|
|
@@ -860,14 +861,14 @@ function xt(e, t) {
|
|
|
860
861
|
H(r, a);
|
|
861
862
|
}), a;
|
|
862
863
|
}
|
|
863
|
-
function
|
|
864
|
+
function Ct() {
|
|
864
865
|
for (let e of V.values()) clearTimeout(e.expirationTimer);
|
|
865
866
|
V.clear();
|
|
866
867
|
}
|
|
867
868
|
//#endregion
|
|
868
869
|
//#region src/error-report/transport.ts
|
|
869
|
-
var
|
|
870
|
-
function
|
|
870
|
+
var wt = 6e4, Tt = 100, Et = 250, U, Dt = /* @__PURE__ */ new WeakSet(), Ot = /* @__PURE__ */ new WeakSet(), W = /* @__PURE__ */ new Map();
|
|
871
|
+
function kt(e) {
|
|
871
872
|
return [
|
|
872
873
|
e.source,
|
|
873
874
|
e.method,
|
|
@@ -876,32 +877,32 @@ function Ot(e) {
|
|
|
876
877
|
e.responseUrl
|
|
877
878
|
].filter(Boolean).join("|");
|
|
878
879
|
}
|
|
879
|
-
function
|
|
880
|
-
let t = Date.now(), n =
|
|
881
|
-
for (let [e, n] of W) (t - n >
|
|
880
|
+
function At(e) {
|
|
881
|
+
let t = Date.now(), n = kt(e);
|
|
882
|
+
for (let [e, n] of W) (t - n > wt || W.size > Tt) && W.delete(e);
|
|
882
883
|
let r = W.get(n);
|
|
883
|
-
return r && t - r <
|
|
884
|
+
return r && t - r < wt ? !0 : (W.set(n, t), !1);
|
|
884
885
|
}
|
|
885
|
-
function
|
|
886
|
+
function jt(e) {
|
|
886
887
|
U = e, W.clear();
|
|
887
888
|
}
|
|
888
|
-
function
|
|
889
|
-
return e instanceof Error &&
|
|
889
|
+
function Mt(e) {
|
|
890
|
+
return e instanceof Error && Dt.has(e);
|
|
890
891
|
}
|
|
891
892
|
function G(e) {
|
|
892
|
-
e instanceof Error &&
|
|
893
|
+
e instanceof Error && Ot.add(e);
|
|
893
894
|
}
|
|
894
|
-
function
|
|
895
|
-
|
|
896
|
-
if (!
|
|
895
|
+
function Nt(e, t) {
|
|
896
|
+
Dt.add(e), setTimeout(() => {
|
|
897
|
+
if (!Ot.has(e) && U && !At(t)) try {
|
|
897
898
|
let n = U(e, t);
|
|
898
899
|
Promise.resolve(n).catch(() => void 0);
|
|
899
900
|
} catch {}
|
|
900
|
-
},
|
|
901
|
+
}, Et);
|
|
901
902
|
}
|
|
902
903
|
//#endregion
|
|
903
904
|
//#region src/error-report/capture.ts
|
|
904
|
-
async function
|
|
905
|
+
async function Pt(e, t, n, r) {
|
|
905
906
|
G(e);
|
|
906
907
|
let i = r?.source ?? "query";
|
|
907
908
|
y({
|
|
@@ -928,7 +929,7 @@ async function Nt(e, t, n, r) {
|
|
|
928
929
|
})
|
|
929
930
|
});
|
|
930
931
|
}
|
|
931
|
-
async function
|
|
932
|
+
async function Ft(e, t, n, r = {}) {
|
|
932
933
|
G(e);
|
|
933
934
|
let i = r.source ?? "mutation";
|
|
934
935
|
y({
|
|
@@ -955,7 +956,7 @@ async function Pt(e, t, n, r = {}) {
|
|
|
955
956
|
})
|
|
956
957
|
});
|
|
957
958
|
}
|
|
958
|
-
function
|
|
959
|
+
function It(e, t = {}, n) {
|
|
959
960
|
let r = t.category ?? "runtime", i = t.source ?? t.category ?? "runtime", a = t.errorInfo ?? k(e), o = _(t.detail, {
|
|
960
961
|
scope: "context",
|
|
961
962
|
source: i
|
|
@@ -982,7 +983,7 @@ function Ft(e, t = {}, n) {
|
|
|
982
983
|
context: o
|
|
983
984
|
});
|
|
984
985
|
};
|
|
985
|
-
return typeof window > "u" ? s() :
|
|
986
|
+
return typeof window > "u" ? s() : St({
|
|
986
987
|
category: r,
|
|
987
988
|
source: i,
|
|
988
989
|
error: a,
|
|
@@ -995,7 +996,7 @@ function Ft(e, t = {}, n) {
|
|
|
995
996
|
}
|
|
996
997
|
//#endregion
|
|
997
998
|
//#region src/error-report/queueContract.ts
|
|
998
|
-
var
|
|
999
|
+
var Lt = 1, Rt = 50, zt = 6048e5, Bt = 3e4, Vt = /* @__PURE__ */ new Set([
|
|
999
1000
|
"http",
|
|
1000
1001
|
"network",
|
|
1001
1002
|
"timeout",
|
|
@@ -1007,29 +1008,29 @@ function K(e) {
|
|
|
1007
1008
|
function q(e) {
|
|
1008
1009
|
return typeof e == "string" && e.length <= 64 && Number.isFinite(Date.parse(e));
|
|
1009
1010
|
}
|
|
1010
|
-
function
|
|
1011
|
+
function Ht(e) {
|
|
1011
1012
|
return typeof e == "number" && Number.isSafeInteger(e) && e >= 0;
|
|
1012
1013
|
}
|
|
1013
|
-
function
|
|
1014
|
-
if (e !== void 0 && !(!K(e) || !q(e.utc) || typeof e.kind != "string") &&
|
|
1014
|
+
function Ut(e) {
|
|
1015
|
+
if (e !== void 0 && !(!K(e) || !q(e.utc) || typeof e.kind != "string") && Vt.has(e.kind) && !(e.httpStatus !== void 0 && (typeof e.httpStatus != "number" || !Number.isInteger(e.httpStatus) || e.httpStatus < 100 || e.httpStatus > 599))) return {
|
|
1015
1016
|
utc: e.utc,
|
|
1016
1017
|
kind: e.kind,
|
|
1017
1018
|
httpStatus: e.httpStatus
|
|
1018
1019
|
};
|
|
1019
1020
|
}
|
|
1020
|
-
function
|
|
1021
|
+
function Wt(e) {
|
|
1021
1022
|
if (e !== void 0 && !(!K(e) || typeof e.ownerId != "string" || e.ownerId.length === 0 || e.ownerId.length > 128) && q(e.expiresUtc)) return {
|
|
1022
1023
|
ownerId: e.ownerId,
|
|
1023
1024
|
expiresUtc: e.expiresUtc
|
|
1024
1025
|
};
|
|
1025
1026
|
}
|
|
1026
|
-
function
|
|
1027
|
-
if (!K(e) || e.queueVersion !== 1 || typeof e.reportId != "string" || !q(e.enqueuedUtc) || !q(e.expiresUtc) || !q(e.nextAttemptUtc) || !
|
|
1027
|
+
function Gt(e) {
|
|
1028
|
+
if (!K(e) || e.queueVersion !== 1 || typeof e.reportId != "string" || !q(e.enqueuedUtc) || !q(e.expiresUtc) || !q(e.nextAttemptUtc) || !Ht(e.attemptCount)) return;
|
|
1028
1029
|
let t = L(e.payload);
|
|
1029
1030
|
if (!t || t.reportId !== e.reportId) return;
|
|
1030
|
-
let n =
|
|
1031
|
+
let n = Wt(e.lease);
|
|
1031
1032
|
if (e.lease !== void 0 && !n) return;
|
|
1032
|
-
let r =
|
|
1033
|
+
let r = Ut(e.lastFailure);
|
|
1033
1034
|
if (!(e.lastFailure !== void 0 && !r)) return {
|
|
1034
1035
|
queueVersion: 1,
|
|
1035
1036
|
reportId: e.reportId,
|
|
@@ -1046,14 +1047,14 @@ function J(e, t) {
|
|
|
1046
1047
|
if (!Array.isArray(e)) return [];
|
|
1047
1048
|
let n = /* @__PURE__ */ new Set(), r = [];
|
|
1048
1049
|
for (let i of e) {
|
|
1049
|
-
let e =
|
|
1050
|
+
let e = Gt(i);
|
|
1050
1051
|
if (!(!e || Date.parse(e.expiresUtc) <= t || n.has(e.reportId)) && (n.add(e.reportId), r.push(e), r.length === 50)) break;
|
|
1051
1052
|
}
|
|
1052
1053
|
return r;
|
|
1053
1054
|
}
|
|
1054
1055
|
//#endregion
|
|
1055
1056
|
//#region src/error-report/queue.ts
|
|
1056
|
-
var Y = "queue.v1",
|
|
1057
|
+
var Y = "queue.v1", Kt = "records";
|
|
1057
1058
|
function X(e) {
|
|
1058
1059
|
return new Date(e).toISOString();
|
|
1059
1060
|
}
|
|
@@ -1062,7 +1063,7 @@ function Z(e) {
|
|
|
1062
1063
|
if (t.length === 0 || t.length > 128) throw Error("Error report lease owner должен содержать от 1 до 128 символов");
|
|
1063
1064
|
return t;
|
|
1064
1065
|
}
|
|
1065
|
-
function
|
|
1066
|
+
function qt(e, t) {
|
|
1066
1067
|
return Date.parse(e.nextAttemptUtc) - Date.parse(t.nextAttemptUtc) || Date.parse(e.enqueuedUtc) - Date.parse(t.enqueuedUtc);
|
|
1067
1068
|
}
|
|
1068
1069
|
function Q(e, t, n) {
|
|
@@ -1078,10 +1079,10 @@ function Q(e, t, n) {
|
|
|
1078
1079
|
result: "lease-mismatch"
|
|
1079
1080
|
};
|
|
1080
1081
|
}
|
|
1081
|
-
function
|
|
1082
|
-
let t = e.storage ??
|
|
1082
|
+
function Jt(e = {}) {
|
|
1083
|
+
let t = e.storage ?? s({
|
|
1083
1084
|
dbName: e.dbName ?? `${__APP_ID__}.error-report.queue.v1`,
|
|
1084
|
-
storeName:
|
|
1085
|
+
storeName: Kt,
|
|
1085
1086
|
indexedDB: e.indexedDB
|
|
1086
1087
|
});
|
|
1087
1088
|
if (!t) return;
|
|
@@ -1123,7 +1124,7 @@ function qt(e = {}) {
|
|
|
1123
1124
|
queueVersion: 1,
|
|
1124
1125
|
reportId: n.reportId,
|
|
1125
1126
|
enqueuedUtc: r,
|
|
1126
|
-
expiresUtc: X(i +
|
|
1127
|
+
expiresUtc: X(i + zt),
|
|
1127
1128
|
nextAttemptUtc: r,
|
|
1128
1129
|
attemptCount: 0,
|
|
1129
1130
|
payload: n
|
|
@@ -1136,11 +1137,11 @@ function qt(e = {}) {
|
|
|
1136
1137
|
};
|
|
1137
1138
|
}) : { status: "invalid-payload" };
|
|
1138
1139
|
},
|
|
1139
|
-
leaseNext: async ({ ownerId: e, now: t = /* @__PURE__ */ new Date(), leaseDurationMs: n =
|
|
1140
|
+
leaseNext: async ({ ownerId: e, now: t = /* @__PURE__ */ new Date(), leaseDurationMs: n = Bt }) => {
|
|
1140
1141
|
let i = Z(e), a = t.getTime();
|
|
1141
1142
|
if (!Number.isFinite(a) || !Number.isFinite(n) || n <= 0) throw Error("Error report lease требует валидное время и положительную длительность");
|
|
1142
1143
|
return r(a, (e) => {
|
|
1143
|
-
let t = e.filter((e) => Date.parse(e.nextAttemptUtc) <= a && (e.lease === void 0 || Date.parse(e.lease.expiresUtc) <= a)).sort(
|
|
1144
|
+
let t = e.filter((e) => Date.parse(e.nextAttemptUtc) <= a && (e.lease === void 0 || Date.parse(e.lease.expiresUtc) <= a)).sort(qt)[0];
|
|
1144
1145
|
if (!t) return {
|
|
1145
1146
|
records: e,
|
|
1146
1147
|
result: void 0
|
|
@@ -1211,7 +1212,7 @@ function qt(e = {}) {
|
|
|
1211
1212
|
},
|
|
1212
1213
|
getRecords: async (e = /* @__PURE__ */ new Date()) => {
|
|
1213
1214
|
let t = e.getTime();
|
|
1214
|
-
return Number.isFinite(t) ? J(await n.getItem(Y), t).sort(
|
|
1215
|
+
return Number.isFinite(t) ? J(await n.getItem(Y), t).sort(qt) : [];
|
|
1215
1216
|
},
|
|
1216
1217
|
getNextWakeUtc: async (e = /* @__PURE__ */ new Date()) => {
|
|
1217
1218
|
let t = e.getTime();
|
|
@@ -1227,15 +1228,15 @@ function qt(e = {}) {
|
|
|
1227
1228
|
//#endregion
|
|
1228
1229
|
//#region src/error-report/runtime.ts
|
|
1229
1230
|
var $;
|
|
1230
|
-
function
|
|
1231
|
-
$ = e,
|
|
1231
|
+
function Yt(e) {
|
|
1232
|
+
$ = e, Ct();
|
|
1232
1233
|
}
|
|
1233
|
-
async function
|
|
1234
|
+
async function Xt(e, t = {}) {
|
|
1234
1235
|
if ($) try {
|
|
1235
1236
|
await $(e, t);
|
|
1236
1237
|
} catch {}
|
|
1237
1238
|
}
|
|
1238
1239
|
//#endregion
|
|
1239
|
-
export { C as ERROR_REPORT_PAYLOAD_MAX_BYTES,
|
|
1240
|
+
export { a as ERROR_REPORT_BUILD_ID_PATTERN, C as ERROR_REPORT_PAYLOAD_MAX_BYTES, je as ERROR_REPORT_PAYLOAD_VERSION, Bt as ERROR_REPORT_QUEUE_LEASE_MS, Rt as ERROR_REPORT_QUEUE_MAX_ITEMS, zt as ERROR_REPORT_QUEUE_TTL_MS, Lt as ERROR_REPORT_QUEUE_VERSION, w as ERROR_REPORT_STACK_TRACE_MAX_BYTES, y as addErrorReportBreadcrumb, B as captureErrorReportDraft, Ft as captureMutationErrorReport, Pt as captureQueryErrorReport, It as captureRuntimeErrorReport, be as clearErrorReportBreadcrumbs, j as collectMutationDiagnostics, N as collectPersistedQueryDiagnostics, M as collectQueryClientDiagnostics, A as collectQueryDiagnostics, h as createDataShape, fe as createDiagnosticValue, k as createErrorInfo, Jt as createErrorReportQueue, ye as getErrorReportBreadcrumbs, Xe as getErrorReportClientEnvironment, pt as getErrorReportDraft, ht as getErrorReportDrafts, Ye as getErrorReportEnvironment, D as getErrorReportPayloadSize, f as getUtf8TextSize, Ae as installErrorReportBrowserBreadcrumbs, Je as isErrorReportingEnabled, Mt as isTransportErrorReportScheduled, He as limitErrorReportPayload, J as normalizeErrorReportQueueRecords, R as parseErrorReportDraft, it as parseErrorReportDrafts, L as parseErrorReportPayload, Gt as parseErrorReportQueueRecord, Xt as reportRuntimeError, Nt as reportTransportError, _ as sanitizeDetail, d as sanitizeDiagnosticText, p as sanitizeDiagnosticTextBytes, g as sanitizeErrorReportValue, Yt as setErrorReportRuntimeErrorReporter, pe as setErrorReportSanitizer, jt as setErrorReportTransportErrorReporter, G as suppressTransportErrorReport, mt as updateErrorReportDraft };
|
|
1240
1241
|
|
|
1241
1242
|
//# sourceMappingURL=index.js.map
|