@shipengine/react-api 0.1.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/index.js +16 -0
- package/index.mjs +4844 -0
- package/package.json +18 -0
- package/shipengine-api-react/src/hooks/index.d.ts +32 -0
- package/shipengine-api-react/src/hooks/use-add-funds.d.ts +10 -0
- package/shipengine-api-react/src/hooks/use-calculate-rates.d.ts +16 -0
- package/shipengine-api-react/src/hooks/use-connect-carrier.d.ts +7 -0
- package/shipengine-api-react/src/hooks/use-create-label.d.ts +11 -0
- package/shipengine-api-react/src/hooks/use-create-sales-order-shipment.d.ts +10 -0
- package/shipengine-api-react/src/hooks/use-create-warehouse.d.ts +8 -0
- package/shipengine-api-react/src/hooks/use-delete-warehouse.d.ts +9 -0
- package/shipengine-api-react/src/hooks/use-get-account-settings.d.ts +6 -0
- package/shipengine-api-react/src/hooks/use-get-auto-funding-configuration.d.ts +4 -0
- package/shipengine-api-react/src/hooks/use-get-carrier-by-id.d.ts +7 -0
- package/shipengine-api-react/src/hooks/use-get-insurance-account.d.ts +8 -0
- package/shipengine-api-react/src/hooks/use-get-label.d.ts +6 -0
- package/shipengine-api-react/src/hooks/use-get-sales-order-shipment.d.ts +6 -0
- package/shipengine-api-react/src/hooks/use-get-sales-order.d.ts +6 -0
- package/shipengine-api-react/src/hooks/use-get-shipment.d.ts +6 -0
- package/shipengine-api-react/src/hooks/use-get-wallet-transaction-history.d.ts +5 -0
- package/shipengine-api-react/src/hooks/use-list-carriers.d.ts +7 -0
- package/shipengine-api-react/src/hooks/use-list-custom-package-types.d.ts +7 -0
- package/shipengine-api-react/src/hooks/use-list-labels.d.ts +8 -0
- package/shipengine-api-react/src/hooks/use-list-order-sources.d.ts +6 -0
- package/shipengine-api-react/src/hooks/use-list-sales-order-shipments.d.ts +5 -0
- package/shipengine-api-react/src/hooks/use-list-sales-orders.d.ts +7 -0
- package/shipengine-api-react/src/hooks/use-list-warehouses.d.ts +7 -0
- package/shipengine-api-react/src/hooks/use-notify-sales-order.d.ts +10 -0
- package/shipengine-api-react/src/hooks/use-parse-address.d.ts +12 -0
- package/shipengine-api-react/src/hooks/use-refresh-order-source.d.ts +11 -0
- package/shipengine-api-react/src/hooks/use-shipengine.d.ts +1 -0
- package/shipengine-api-react/src/hooks/use-update-auto-funding.d.ts +5 -0
- package/shipengine-api-react/src/hooks/use-update-billing.d.ts +8 -0
- package/shipengine-api-react/src/hooks/use-update-sales-order-shipment.d.ts +8 -0
- package/shipengine-api-react/src/hooks/use-update-warehouse.d.ts +10 -0
- package/shipengine-api-react/src/hooks/use-validate-addresses.d.ts +8 -0
- package/shipengine-api-react/src/hooks/use-void-label.d.ts +7 -0
- package/shipengine-api-react/src/index.d.ts +3 -0
- package/shipengine-api-react/src/providers/index.d.ts +1 -0
- package/shipengine-api-react/src/providers/shipengine.d.ts +12 -0
- package/shipengine-api-react/src/utilities/delay.d.ts +4 -0
- package/shipengine-api-react/src/utilities/error.d.ts +2 -0
- package/shipengine-api-react/src/utilities/index.d.ts +4 -0
- package/shipengine-api-react/src/utilities/logger.d.ts +1 -0
- package/shipengine-api-react/src/utilities/retry.d.ts +4 -0
package/index.mjs
ADDED
|
@@ -0,0 +1,4844 @@
|
|
|
1
|
+
import di from "react-dom";
|
|
2
|
+
import M, { createContext as pi, useState as yi, useContext as vi } from "react";
|
|
3
|
+
import { jsx as ut } from "react/jsx-runtime";
|
|
4
|
+
function Ut(t, e) {
|
|
5
|
+
return Ut = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, i) {
|
|
6
|
+
return n.__proto__ = i, n;
|
|
7
|
+
}, Ut(t, e);
|
|
8
|
+
}
|
|
9
|
+
function Ee(t, e) {
|
|
10
|
+
t.prototype = Object.create(e.prototype), t.prototype.constructor = t, Ut(t, e);
|
|
11
|
+
}
|
|
12
|
+
var Re = /* @__PURE__ */ function() {
|
|
13
|
+
function t() {
|
|
14
|
+
this.listeners = [];
|
|
15
|
+
}
|
|
16
|
+
var e = t.prototype;
|
|
17
|
+
return e.subscribe = function(n) {
|
|
18
|
+
var i = this, a = n || function() {
|
|
19
|
+
};
|
|
20
|
+
return this.listeners.push(a), this.onSubscribe(), function() {
|
|
21
|
+
i.listeners = i.listeners.filter(function(s) {
|
|
22
|
+
return s !== a;
|
|
23
|
+
}), i.onUnsubscribe();
|
|
24
|
+
};
|
|
25
|
+
}, e.hasListeners = function() {
|
|
26
|
+
return this.listeners.length > 0;
|
|
27
|
+
}, e.onSubscribe = function() {
|
|
28
|
+
}, e.onUnsubscribe = function() {
|
|
29
|
+
}, t;
|
|
30
|
+
}();
|
|
31
|
+
function w() {
|
|
32
|
+
return w = Object.assign ? Object.assign.bind() : function(t) {
|
|
33
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
34
|
+
var r = arguments[e];
|
|
35
|
+
for (var n in r)
|
|
36
|
+
Object.prototype.hasOwnProperty.call(r, n) && (t[n] = r[n]);
|
|
37
|
+
}
|
|
38
|
+
return t;
|
|
39
|
+
}, w.apply(this, arguments);
|
|
40
|
+
}
|
|
41
|
+
var Ke = typeof window > "u";
|
|
42
|
+
function U() {
|
|
43
|
+
}
|
|
44
|
+
function mi(t, e) {
|
|
45
|
+
return typeof t == "function" ? t(e) : t;
|
|
46
|
+
}
|
|
47
|
+
function Nt(t) {
|
|
48
|
+
return typeof t == "number" && t >= 0 && t !== 1 / 0;
|
|
49
|
+
}
|
|
50
|
+
function We(t) {
|
|
51
|
+
return Array.isArray(t) ? t : [t];
|
|
52
|
+
}
|
|
53
|
+
function wn(t, e) {
|
|
54
|
+
return Math.max(t + (e || 0) - Date.now(), 0);
|
|
55
|
+
}
|
|
56
|
+
function Qe(t, e, r) {
|
|
57
|
+
return $e(t) ? typeof e == "function" ? w({}, r, {
|
|
58
|
+
queryKey: t,
|
|
59
|
+
queryFn: e
|
|
60
|
+
}) : w({}, e, {
|
|
61
|
+
queryKey: t
|
|
62
|
+
}) : t;
|
|
63
|
+
}
|
|
64
|
+
function gi(t, e, r) {
|
|
65
|
+
return $e(t) ? typeof e == "function" ? w({}, r, {
|
|
66
|
+
mutationKey: t,
|
|
67
|
+
mutationFn: e
|
|
68
|
+
}) : w({}, e, {
|
|
69
|
+
mutationKey: t
|
|
70
|
+
}) : typeof t == "function" ? w({}, e, {
|
|
71
|
+
mutationFn: t
|
|
72
|
+
}) : w({}, t);
|
|
73
|
+
}
|
|
74
|
+
function re(t, e, r) {
|
|
75
|
+
return $e(t) ? [w({}, e, {
|
|
76
|
+
queryKey: t
|
|
77
|
+
}), r] : [t || {}, e];
|
|
78
|
+
}
|
|
79
|
+
function bi(t, e) {
|
|
80
|
+
if (t === !0 && e === !0 || t == null && e == null)
|
|
81
|
+
return "all";
|
|
82
|
+
if (t === !1 && e === !1)
|
|
83
|
+
return "none";
|
|
84
|
+
var r = t ?? !e;
|
|
85
|
+
return r ? "active" : "inactive";
|
|
86
|
+
}
|
|
87
|
+
function Or(t, e) {
|
|
88
|
+
var r = t.active, n = t.exact, i = t.fetching, a = t.inactive, s = t.predicate, o = t.queryKey, l = t.stale;
|
|
89
|
+
if ($e(o)) {
|
|
90
|
+
if (n) {
|
|
91
|
+
if (e.queryHash !== ar(o, e.options))
|
|
92
|
+
return !1;
|
|
93
|
+
} else if (!Ge(e.queryKey, o))
|
|
94
|
+
return !1;
|
|
95
|
+
}
|
|
96
|
+
var f = bi(r, a);
|
|
97
|
+
if (f === "none")
|
|
98
|
+
return !1;
|
|
99
|
+
if (f !== "all") {
|
|
100
|
+
var c = e.isActive();
|
|
101
|
+
if (f === "active" && !c || f === "inactive" && c)
|
|
102
|
+
return !1;
|
|
103
|
+
}
|
|
104
|
+
return !(typeof l == "boolean" && e.isStale() !== l || typeof i == "boolean" && e.isFetching() !== i || s && !s(e));
|
|
105
|
+
}
|
|
106
|
+
function Pr(t, e) {
|
|
107
|
+
var r = t.exact, n = t.fetching, i = t.predicate, a = t.mutationKey;
|
|
108
|
+
if ($e(a)) {
|
|
109
|
+
if (!e.options.mutationKey)
|
|
110
|
+
return !1;
|
|
111
|
+
if (r) {
|
|
112
|
+
if (he(e.options.mutationKey) !== he(a))
|
|
113
|
+
return !1;
|
|
114
|
+
} else if (!Ge(e.options.mutationKey, a))
|
|
115
|
+
return !1;
|
|
116
|
+
}
|
|
117
|
+
return !(typeof n == "boolean" && e.state.status === "loading" !== n || i && !i(e));
|
|
118
|
+
}
|
|
119
|
+
function ar(t, e) {
|
|
120
|
+
var r = e?.queryKeyHashFn || he;
|
|
121
|
+
return r(t);
|
|
122
|
+
}
|
|
123
|
+
function he(t) {
|
|
124
|
+
var e = We(t);
|
|
125
|
+
return Si(e);
|
|
126
|
+
}
|
|
127
|
+
function Si(t) {
|
|
128
|
+
return JSON.stringify(t, function(e, r) {
|
|
129
|
+
return Lt(r) ? Object.keys(r).sort().reduce(function(n, i) {
|
|
130
|
+
return n[i] = r[i], n;
|
|
131
|
+
}, {}) : r;
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
function Ge(t, e) {
|
|
135
|
+
return On(We(t), We(e));
|
|
136
|
+
}
|
|
137
|
+
function On(t, e) {
|
|
138
|
+
return t === e ? !0 : typeof t != typeof e ? !1 : t && e && typeof t == "object" && typeof e == "object" ? !Object.keys(e).some(function(r) {
|
|
139
|
+
return !On(t[r], e[r]);
|
|
140
|
+
}) : !1;
|
|
141
|
+
}
|
|
142
|
+
function He(t, e) {
|
|
143
|
+
if (t === e)
|
|
144
|
+
return t;
|
|
145
|
+
var r = Array.isArray(t) && Array.isArray(e);
|
|
146
|
+
if (r || Lt(t) && Lt(e)) {
|
|
147
|
+
for (var n = r ? t.length : Object.keys(t).length, i = r ? e : Object.keys(e), a = i.length, s = r ? [] : {}, o = 0, l = 0; l < a; l++) {
|
|
148
|
+
var f = r ? l : i[l];
|
|
149
|
+
s[f] = He(t[f], e[f]), s[f] === t[f] && o++;
|
|
150
|
+
}
|
|
151
|
+
return n === a && o === n ? t : s;
|
|
152
|
+
}
|
|
153
|
+
return e;
|
|
154
|
+
}
|
|
155
|
+
function wi(t, e) {
|
|
156
|
+
if (t && !e || e && !t)
|
|
157
|
+
return !1;
|
|
158
|
+
for (var r in t)
|
|
159
|
+
if (t[r] !== e[r])
|
|
160
|
+
return !1;
|
|
161
|
+
return !0;
|
|
162
|
+
}
|
|
163
|
+
function Lt(t) {
|
|
164
|
+
if (!Er(t))
|
|
165
|
+
return !1;
|
|
166
|
+
var e = t.constructor;
|
|
167
|
+
if (typeof e > "u")
|
|
168
|
+
return !0;
|
|
169
|
+
var r = e.prototype;
|
|
170
|
+
return !(!Er(r) || !r.hasOwnProperty("isPrototypeOf"));
|
|
171
|
+
}
|
|
172
|
+
function Er(t) {
|
|
173
|
+
return Object.prototype.toString.call(t) === "[object Object]";
|
|
174
|
+
}
|
|
175
|
+
function $e(t) {
|
|
176
|
+
return typeof t == "string" || Array.isArray(t);
|
|
177
|
+
}
|
|
178
|
+
function Oi(t) {
|
|
179
|
+
return new Promise(function(e) {
|
|
180
|
+
setTimeout(e, t);
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
function Rr(t) {
|
|
184
|
+
Promise.resolve().then(t).catch(function(e) {
|
|
185
|
+
return setTimeout(function() {
|
|
186
|
+
throw e;
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
function Pn() {
|
|
191
|
+
if (typeof AbortController == "function")
|
|
192
|
+
return new AbortController();
|
|
193
|
+
}
|
|
194
|
+
var Pi = /* @__PURE__ */ function(t) {
|
|
195
|
+
Ee(e, t);
|
|
196
|
+
function e() {
|
|
197
|
+
var n;
|
|
198
|
+
return n = t.call(this) || this, n.setup = function(i) {
|
|
199
|
+
var a;
|
|
200
|
+
if (!Ke && ((a = window) != null && a.addEventListener)) {
|
|
201
|
+
var s = function() {
|
|
202
|
+
return i();
|
|
203
|
+
};
|
|
204
|
+
return window.addEventListener("visibilitychange", s, !1), window.addEventListener("focus", s, !1), function() {
|
|
205
|
+
window.removeEventListener("visibilitychange", s), window.removeEventListener("focus", s);
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
}, n;
|
|
209
|
+
}
|
|
210
|
+
var r = e.prototype;
|
|
211
|
+
return r.onSubscribe = function() {
|
|
212
|
+
this.cleanup || this.setEventListener(this.setup);
|
|
213
|
+
}, r.onUnsubscribe = function() {
|
|
214
|
+
if (!this.hasListeners()) {
|
|
215
|
+
var i;
|
|
216
|
+
(i = this.cleanup) == null || i.call(this), this.cleanup = void 0;
|
|
217
|
+
}
|
|
218
|
+
}, r.setEventListener = function(i) {
|
|
219
|
+
var a, s = this;
|
|
220
|
+
this.setup = i, (a = this.cleanup) == null || a.call(this), this.cleanup = i(function(o) {
|
|
221
|
+
typeof o == "boolean" ? s.setFocused(o) : s.onFocus();
|
|
222
|
+
});
|
|
223
|
+
}, r.setFocused = function(i) {
|
|
224
|
+
this.focused = i, i && this.onFocus();
|
|
225
|
+
}, r.onFocus = function() {
|
|
226
|
+
this.listeners.forEach(function(i) {
|
|
227
|
+
i();
|
|
228
|
+
});
|
|
229
|
+
}, r.isFocused = function() {
|
|
230
|
+
return typeof this.focused == "boolean" ? this.focused : typeof document > "u" ? !0 : [void 0, "visible", "prerender"].includes(document.visibilityState);
|
|
231
|
+
}, e;
|
|
232
|
+
}(Re), Fe = new Pi(), Ei = /* @__PURE__ */ function(t) {
|
|
233
|
+
Ee(e, t);
|
|
234
|
+
function e() {
|
|
235
|
+
var n;
|
|
236
|
+
return n = t.call(this) || this, n.setup = function(i) {
|
|
237
|
+
var a;
|
|
238
|
+
if (!Ke && ((a = window) != null && a.addEventListener)) {
|
|
239
|
+
var s = function() {
|
|
240
|
+
return i();
|
|
241
|
+
};
|
|
242
|
+
return window.addEventListener("online", s, !1), window.addEventListener("offline", s, !1), function() {
|
|
243
|
+
window.removeEventListener("online", s), window.removeEventListener("offline", s);
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
}, n;
|
|
247
|
+
}
|
|
248
|
+
var r = e.prototype;
|
|
249
|
+
return r.onSubscribe = function() {
|
|
250
|
+
this.cleanup || this.setEventListener(this.setup);
|
|
251
|
+
}, r.onUnsubscribe = function() {
|
|
252
|
+
if (!this.hasListeners()) {
|
|
253
|
+
var i;
|
|
254
|
+
(i = this.cleanup) == null || i.call(this), this.cleanup = void 0;
|
|
255
|
+
}
|
|
256
|
+
}, r.setEventListener = function(i) {
|
|
257
|
+
var a, s = this;
|
|
258
|
+
this.setup = i, (a = this.cleanup) == null || a.call(this), this.cleanup = i(function(o) {
|
|
259
|
+
typeof o == "boolean" ? s.setOnline(o) : s.onOnline();
|
|
260
|
+
});
|
|
261
|
+
}, r.setOnline = function(i) {
|
|
262
|
+
this.online = i, i && this.onOnline();
|
|
263
|
+
}, r.onOnline = function() {
|
|
264
|
+
this.listeners.forEach(function(i) {
|
|
265
|
+
i();
|
|
266
|
+
});
|
|
267
|
+
}, r.isOnline = function() {
|
|
268
|
+
return typeof this.online == "boolean" ? this.online : typeof navigator > "u" || typeof navigator.onLine > "u" ? !0 : navigator.onLine;
|
|
269
|
+
}, e;
|
|
270
|
+
}(Re), ke = new Ei();
|
|
271
|
+
function Ri(t) {
|
|
272
|
+
return Math.min(1e3 * Math.pow(2, t), 3e4);
|
|
273
|
+
}
|
|
274
|
+
function Ve(t) {
|
|
275
|
+
return typeof t?.cancel == "function";
|
|
276
|
+
}
|
|
277
|
+
var En = function(e) {
|
|
278
|
+
this.revert = e?.revert, this.silent = e?.silent;
|
|
279
|
+
};
|
|
280
|
+
function Be(t) {
|
|
281
|
+
return t instanceof En;
|
|
282
|
+
}
|
|
283
|
+
var Rn = function(e) {
|
|
284
|
+
var r = this, n = !1, i, a, s, o;
|
|
285
|
+
this.abort = e.abort, this.cancel = function(h) {
|
|
286
|
+
return i?.(h);
|
|
287
|
+
}, this.cancelRetry = function() {
|
|
288
|
+
n = !0;
|
|
289
|
+
}, this.continueRetry = function() {
|
|
290
|
+
n = !1;
|
|
291
|
+
}, this.continue = function() {
|
|
292
|
+
return a?.();
|
|
293
|
+
}, this.failureCount = 0, this.isPaused = !1, this.isResolved = !1, this.isTransportCancelable = !1, this.promise = new Promise(function(h, d) {
|
|
294
|
+
s = h, o = d;
|
|
295
|
+
});
|
|
296
|
+
var l = function(d) {
|
|
297
|
+
r.isResolved || (r.isResolved = !0, e.onSuccess == null || e.onSuccess(d), a?.(), s(d));
|
|
298
|
+
}, f = function(d) {
|
|
299
|
+
r.isResolved || (r.isResolved = !0, e.onError == null || e.onError(d), a?.(), o(d));
|
|
300
|
+
}, c = function() {
|
|
301
|
+
return new Promise(function(d) {
|
|
302
|
+
a = d, r.isPaused = !0, e.onPause == null || e.onPause();
|
|
303
|
+
}).then(function() {
|
|
304
|
+
a = void 0, r.isPaused = !1, e.onContinue == null || e.onContinue();
|
|
305
|
+
});
|
|
306
|
+
}, u = function h() {
|
|
307
|
+
if (!r.isResolved) {
|
|
308
|
+
var d;
|
|
309
|
+
try {
|
|
310
|
+
d = e.fn();
|
|
311
|
+
} catch (p) {
|
|
312
|
+
d = Promise.reject(p);
|
|
313
|
+
}
|
|
314
|
+
i = function(v) {
|
|
315
|
+
if (!r.isResolved && (f(new En(v)), r.abort == null || r.abort(), Ve(d)))
|
|
316
|
+
try {
|
|
317
|
+
d.cancel();
|
|
318
|
+
} catch {
|
|
319
|
+
}
|
|
320
|
+
}, r.isTransportCancelable = Ve(d), Promise.resolve(d).then(l).catch(function(p) {
|
|
321
|
+
var v, m;
|
|
322
|
+
if (!r.isResolved) {
|
|
323
|
+
var y = (v = e.retry) != null ? v : 3, g = (m = e.retryDelay) != null ? m : Ri, S = typeof g == "function" ? g(r.failureCount, p) : g, b = y === !0 || typeof y == "number" && r.failureCount < y || typeof y == "function" && y(r.failureCount, p);
|
|
324
|
+
if (n || !b) {
|
|
325
|
+
f(p);
|
|
326
|
+
return;
|
|
327
|
+
}
|
|
328
|
+
r.failureCount++, e.onFail == null || e.onFail(r.failureCount, p), Oi(S).then(function() {
|
|
329
|
+
if (!Fe.isFocused() || !ke.isOnline())
|
|
330
|
+
return c();
|
|
331
|
+
}).then(function() {
|
|
332
|
+
n ? f(p) : h();
|
|
333
|
+
});
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
u();
|
|
339
|
+
}, Ai = /* @__PURE__ */ function() {
|
|
340
|
+
function t() {
|
|
341
|
+
this.queue = [], this.transactions = 0, this.notifyFn = function(r) {
|
|
342
|
+
r();
|
|
343
|
+
}, this.batchNotifyFn = function(r) {
|
|
344
|
+
r();
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
var e = t.prototype;
|
|
348
|
+
return e.batch = function(n) {
|
|
349
|
+
var i;
|
|
350
|
+
this.transactions++;
|
|
351
|
+
try {
|
|
352
|
+
i = n();
|
|
353
|
+
} finally {
|
|
354
|
+
this.transactions--, this.transactions || this.flush();
|
|
355
|
+
}
|
|
356
|
+
return i;
|
|
357
|
+
}, e.schedule = function(n) {
|
|
358
|
+
var i = this;
|
|
359
|
+
this.transactions ? this.queue.push(n) : Rr(function() {
|
|
360
|
+
i.notifyFn(n);
|
|
361
|
+
});
|
|
362
|
+
}, e.batchCalls = function(n) {
|
|
363
|
+
var i = this;
|
|
364
|
+
return function() {
|
|
365
|
+
for (var a = arguments.length, s = new Array(a), o = 0; o < a; o++)
|
|
366
|
+
s[o] = arguments[o];
|
|
367
|
+
i.schedule(function() {
|
|
368
|
+
n.apply(void 0, s);
|
|
369
|
+
});
|
|
370
|
+
};
|
|
371
|
+
}, e.flush = function() {
|
|
372
|
+
var n = this, i = this.queue;
|
|
373
|
+
this.queue = [], i.length && Rr(function() {
|
|
374
|
+
n.batchNotifyFn(function() {
|
|
375
|
+
i.forEach(function(a) {
|
|
376
|
+
n.notifyFn(a);
|
|
377
|
+
});
|
|
378
|
+
});
|
|
379
|
+
});
|
|
380
|
+
}, e.setNotifyFunction = function(n) {
|
|
381
|
+
this.notifyFn = n;
|
|
382
|
+
}, e.setBatchNotifyFunction = function(n) {
|
|
383
|
+
this.batchNotifyFn = n;
|
|
384
|
+
}, t;
|
|
385
|
+
}(), F = new Ai(), An = console;
|
|
386
|
+
function Je() {
|
|
387
|
+
return An;
|
|
388
|
+
}
|
|
389
|
+
function Ci(t) {
|
|
390
|
+
An = t;
|
|
391
|
+
}
|
|
392
|
+
var Fi = /* @__PURE__ */ function() {
|
|
393
|
+
function t(r) {
|
|
394
|
+
this.abortSignalConsumed = !1, this.hadObservers = !1, this.defaultOptions = r.defaultOptions, this.setOptions(r.options), this.observers = [], this.cache = r.cache, this.queryKey = r.queryKey, this.queryHash = r.queryHash, this.initialState = r.state || this.getDefaultState(this.options), this.state = this.initialState, this.meta = r.meta, this.scheduleGc();
|
|
395
|
+
}
|
|
396
|
+
var e = t.prototype;
|
|
397
|
+
return e.setOptions = function(n) {
|
|
398
|
+
var i;
|
|
399
|
+
this.options = w({}, this.defaultOptions, n), this.meta = n?.meta, this.cacheTime = Math.max(this.cacheTime || 0, (i = this.options.cacheTime) != null ? i : 5 * 60 * 1e3);
|
|
400
|
+
}, e.setDefaultOptions = function(n) {
|
|
401
|
+
this.defaultOptions = n;
|
|
402
|
+
}, e.scheduleGc = function() {
|
|
403
|
+
var n = this;
|
|
404
|
+
this.clearGcTimeout(), Nt(this.cacheTime) && (this.gcTimeout = setTimeout(function() {
|
|
405
|
+
n.optionalRemove();
|
|
406
|
+
}, this.cacheTime));
|
|
407
|
+
}, e.clearGcTimeout = function() {
|
|
408
|
+
this.gcTimeout && (clearTimeout(this.gcTimeout), this.gcTimeout = void 0);
|
|
409
|
+
}, e.optionalRemove = function() {
|
|
410
|
+
this.observers.length || (this.state.isFetching ? this.hadObservers && this.scheduleGc() : this.cache.remove(this));
|
|
411
|
+
}, e.setData = function(n, i) {
|
|
412
|
+
var a, s, o = this.state.data, l = mi(n, o);
|
|
413
|
+
return (a = (s = this.options).isDataEqual) != null && a.call(s, o, l) ? l = o : this.options.structuralSharing !== !1 && (l = He(o, l)), this.dispatch({
|
|
414
|
+
data: l,
|
|
415
|
+
type: "success",
|
|
416
|
+
dataUpdatedAt: i?.updatedAt
|
|
417
|
+
}), l;
|
|
418
|
+
}, e.setState = function(n, i) {
|
|
419
|
+
this.dispatch({
|
|
420
|
+
type: "setState",
|
|
421
|
+
state: n,
|
|
422
|
+
setStateOptions: i
|
|
423
|
+
});
|
|
424
|
+
}, e.cancel = function(n) {
|
|
425
|
+
var i, a = this.promise;
|
|
426
|
+
return (i = this.retryer) == null || i.cancel(n), a ? a.then(U).catch(U) : Promise.resolve();
|
|
427
|
+
}, e.destroy = function() {
|
|
428
|
+
this.clearGcTimeout(), this.cancel({
|
|
429
|
+
silent: !0
|
|
430
|
+
});
|
|
431
|
+
}, e.reset = function() {
|
|
432
|
+
this.destroy(), this.setState(this.initialState);
|
|
433
|
+
}, e.isActive = function() {
|
|
434
|
+
return this.observers.some(function(n) {
|
|
435
|
+
return n.options.enabled !== !1;
|
|
436
|
+
});
|
|
437
|
+
}, e.isFetching = function() {
|
|
438
|
+
return this.state.isFetching;
|
|
439
|
+
}, e.isStale = function() {
|
|
440
|
+
return this.state.isInvalidated || !this.state.dataUpdatedAt || this.observers.some(function(n) {
|
|
441
|
+
return n.getCurrentResult().isStale;
|
|
442
|
+
});
|
|
443
|
+
}, e.isStaleByTime = function(n) {
|
|
444
|
+
return n === void 0 && (n = 0), this.state.isInvalidated || !this.state.dataUpdatedAt || !wn(this.state.dataUpdatedAt, n);
|
|
445
|
+
}, e.onFocus = function() {
|
|
446
|
+
var n, i = this.observers.find(function(a) {
|
|
447
|
+
return a.shouldFetchOnWindowFocus();
|
|
448
|
+
});
|
|
449
|
+
i && i.refetch(), (n = this.retryer) == null || n.continue();
|
|
450
|
+
}, e.onOnline = function() {
|
|
451
|
+
var n, i = this.observers.find(function(a) {
|
|
452
|
+
return a.shouldFetchOnReconnect();
|
|
453
|
+
});
|
|
454
|
+
i && i.refetch(), (n = this.retryer) == null || n.continue();
|
|
455
|
+
}, e.addObserver = function(n) {
|
|
456
|
+
this.observers.indexOf(n) === -1 && (this.observers.push(n), this.hadObservers = !0, this.clearGcTimeout(), this.cache.notify({
|
|
457
|
+
type: "observerAdded",
|
|
458
|
+
query: this,
|
|
459
|
+
observer: n
|
|
460
|
+
}));
|
|
461
|
+
}, e.removeObserver = function(n) {
|
|
462
|
+
this.observers.indexOf(n) !== -1 && (this.observers = this.observers.filter(function(i) {
|
|
463
|
+
return i !== n;
|
|
464
|
+
}), this.observers.length || (this.retryer && (this.retryer.isTransportCancelable || this.abortSignalConsumed ? this.retryer.cancel({
|
|
465
|
+
revert: !0
|
|
466
|
+
}) : this.retryer.cancelRetry()), this.cacheTime ? this.scheduleGc() : this.cache.remove(this)), this.cache.notify({
|
|
467
|
+
type: "observerRemoved",
|
|
468
|
+
query: this,
|
|
469
|
+
observer: n
|
|
470
|
+
}));
|
|
471
|
+
}, e.getObserversCount = function() {
|
|
472
|
+
return this.observers.length;
|
|
473
|
+
}, e.invalidate = function() {
|
|
474
|
+
this.state.isInvalidated || this.dispatch({
|
|
475
|
+
type: "invalidate"
|
|
476
|
+
});
|
|
477
|
+
}, e.fetch = function(n, i) {
|
|
478
|
+
var a = this, s, o, l;
|
|
479
|
+
if (this.state.isFetching) {
|
|
480
|
+
if (this.state.dataUpdatedAt && i?.cancelRefetch)
|
|
481
|
+
this.cancel({
|
|
482
|
+
silent: !0
|
|
483
|
+
});
|
|
484
|
+
else if (this.promise) {
|
|
485
|
+
var f;
|
|
486
|
+
return (f = this.retryer) == null || f.continueRetry(), this.promise;
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
if (n && this.setOptions(n), !this.options.queryFn) {
|
|
490
|
+
var c = this.observers.find(function(g) {
|
|
491
|
+
return g.options.queryFn;
|
|
492
|
+
});
|
|
493
|
+
c && this.setOptions(c.options);
|
|
494
|
+
}
|
|
495
|
+
var u = We(this.queryKey), h = Pn(), d = {
|
|
496
|
+
queryKey: u,
|
|
497
|
+
pageParam: void 0,
|
|
498
|
+
meta: this.meta
|
|
499
|
+
};
|
|
500
|
+
Object.defineProperty(d, "signal", {
|
|
501
|
+
enumerable: !0,
|
|
502
|
+
get: function() {
|
|
503
|
+
if (h)
|
|
504
|
+
return a.abortSignalConsumed = !0, h.signal;
|
|
505
|
+
}
|
|
506
|
+
});
|
|
507
|
+
var p = function() {
|
|
508
|
+
return a.options.queryFn ? (a.abortSignalConsumed = !1, a.options.queryFn(d)) : Promise.reject("Missing queryFn");
|
|
509
|
+
}, v = {
|
|
510
|
+
fetchOptions: i,
|
|
511
|
+
options: this.options,
|
|
512
|
+
queryKey: u,
|
|
513
|
+
state: this.state,
|
|
514
|
+
fetchFn: p,
|
|
515
|
+
meta: this.meta
|
|
516
|
+
};
|
|
517
|
+
if ((s = this.options.behavior) != null && s.onFetch) {
|
|
518
|
+
var m;
|
|
519
|
+
(m = this.options.behavior) == null || m.onFetch(v);
|
|
520
|
+
}
|
|
521
|
+
if (this.revertState = this.state, !this.state.isFetching || this.state.fetchMeta !== ((o = v.fetchOptions) == null ? void 0 : o.meta)) {
|
|
522
|
+
var y;
|
|
523
|
+
this.dispatch({
|
|
524
|
+
type: "fetch",
|
|
525
|
+
meta: (y = v.fetchOptions) == null ? void 0 : y.meta
|
|
526
|
+
});
|
|
527
|
+
}
|
|
528
|
+
return this.retryer = new Rn({
|
|
529
|
+
fn: v.fetchFn,
|
|
530
|
+
abort: h == null || (l = h.abort) == null ? void 0 : l.bind(h),
|
|
531
|
+
onSuccess: function(S) {
|
|
532
|
+
a.setData(S), a.cache.config.onSuccess == null || a.cache.config.onSuccess(S, a), a.cacheTime === 0 && a.optionalRemove();
|
|
533
|
+
},
|
|
534
|
+
onError: function(S) {
|
|
535
|
+
Be(S) && S.silent || a.dispatch({
|
|
536
|
+
type: "error",
|
|
537
|
+
error: S
|
|
538
|
+
}), Be(S) || (a.cache.config.onError == null || a.cache.config.onError(S, a), Je().error(S)), a.cacheTime === 0 && a.optionalRemove();
|
|
539
|
+
},
|
|
540
|
+
onFail: function() {
|
|
541
|
+
a.dispatch({
|
|
542
|
+
type: "failed"
|
|
543
|
+
});
|
|
544
|
+
},
|
|
545
|
+
onPause: function() {
|
|
546
|
+
a.dispatch({
|
|
547
|
+
type: "pause"
|
|
548
|
+
});
|
|
549
|
+
},
|
|
550
|
+
onContinue: function() {
|
|
551
|
+
a.dispatch({
|
|
552
|
+
type: "continue"
|
|
553
|
+
});
|
|
554
|
+
},
|
|
555
|
+
retry: v.options.retry,
|
|
556
|
+
retryDelay: v.options.retryDelay
|
|
557
|
+
}), this.promise = this.retryer.promise, this.promise;
|
|
558
|
+
}, e.dispatch = function(n) {
|
|
559
|
+
var i = this;
|
|
560
|
+
this.state = this.reducer(this.state, n), F.batch(function() {
|
|
561
|
+
i.observers.forEach(function(a) {
|
|
562
|
+
a.onQueryUpdate(n);
|
|
563
|
+
}), i.cache.notify({
|
|
564
|
+
query: i,
|
|
565
|
+
type: "queryUpdated",
|
|
566
|
+
action: n
|
|
567
|
+
});
|
|
568
|
+
});
|
|
569
|
+
}, e.getDefaultState = function(n) {
|
|
570
|
+
var i = typeof n.initialData == "function" ? n.initialData() : n.initialData, a = typeof n.initialData < "u", s = a ? typeof n.initialDataUpdatedAt == "function" ? n.initialDataUpdatedAt() : n.initialDataUpdatedAt : 0, o = typeof i < "u";
|
|
571
|
+
return {
|
|
572
|
+
data: i,
|
|
573
|
+
dataUpdateCount: 0,
|
|
574
|
+
dataUpdatedAt: o ? s ?? Date.now() : 0,
|
|
575
|
+
error: null,
|
|
576
|
+
errorUpdateCount: 0,
|
|
577
|
+
errorUpdatedAt: 0,
|
|
578
|
+
fetchFailureCount: 0,
|
|
579
|
+
fetchMeta: null,
|
|
580
|
+
isFetching: !1,
|
|
581
|
+
isInvalidated: !1,
|
|
582
|
+
isPaused: !1,
|
|
583
|
+
status: o ? "success" : "idle"
|
|
584
|
+
};
|
|
585
|
+
}, e.reducer = function(n, i) {
|
|
586
|
+
var a, s;
|
|
587
|
+
switch (i.type) {
|
|
588
|
+
case "failed":
|
|
589
|
+
return w({}, n, {
|
|
590
|
+
fetchFailureCount: n.fetchFailureCount + 1
|
|
591
|
+
});
|
|
592
|
+
case "pause":
|
|
593
|
+
return w({}, n, {
|
|
594
|
+
isPaused: !0
|
|
595
|
+
});
|
|
596
|
+
case "continue":
|
|
597
|
+
return w({}, n, {
|
|
598
|
+
isPaused: !1
|
|
599
|
+
});
|
|
600
|
+
case "fetch":
|
|
601
|
+
return w({}, n, {
|
|
602
|
+
fetchFailureCount: 0,
|
|
603
|
+
fetchMeta: (a = i.meta) != null ? a : null,
|
|
604
|
+
isFetching: !0,
|
|
605
|
+
isPaused: !1
|
|
606
|
+
}, !n.dataUpdatedAt && {
|
|
607
|
+
error: null,
|
|
608
|
+
status: "loading"
|
|
609
|
+
});
|
|
610
|
+
case "success":
|
|
611
|
+
return w({}, n, {
|
|
612
|
+
data: i.data,
|
|
613
|
+
dataUpdateCount: n.dataUpdateCount + 1,
|
|
614
|
+
dataUpdatedAt: (s = i.dataUpdatedAt) != null ? s : Date.now(),
|
|
615
|
+
error: null,
|
|
616
|
+
fetchFailureCount: 0,
|
|
617
|
+
isFetching: !1,
|
|
618
|
+
isInvalidated: !1,
|
|
619
|
+
isPaused: !1,
|
|
620
|
+
status: "success"
|
|
621
|
+
});
|
|
622
|
+
case "error":
|
|
623
|
+
var o = i.error;
|
|
624
|
+
return Be(o) && o.revert && this.revertState ? w({}, this.revertState) : w({}, n, {
|
|
625
|
+
error: o,
|
|
626
|
+
errorUpdateCount: n.errorUpdateCount + 1,
|
|
627
|
+
errorUpdatedAt: Date.now(),
|
|
628
|
+
fetchFailureCount: n.fetchFailureCount + 1,
|
|
629
|
+
isFetching: !1,
|
|
630
|
+
isPaused: !1,
|
|
631
|
+
status: "error"
|
|
632
|
+
});
|
|
633
|
+
case "invalidate":
|
|
634
|
+
return w({}, n, {
|
|
635
|
+
isInvalidated: !0
|
|
636
|
+
});
|
|
637
|
+
case "setState":
|
|
638
|
+
return w({}, n, i.state);
|
|
639
|
+
default:
|
|
640
|
+
return n;
|
|
641
|
+
}
|
|
642
|
+
}, t;
|
|
643
|
+
}(), xi = /* @__PURE__ */ function(t) {
|
|
644
|
+
Ee(e, t);
|
|
645
|
+
function e(n) {
|
|
646
|
+
var i;
|
|
647
|
+
return i = t.call(this) || this, i.config = n || {}, i.queries = [], i.queriesMap = {}, i;
|
|
648
|
+
}
|
|
649
|
+
var r = e.prototype;
|
|
650
|
+
return r.build = function(i, a, s) {
|
|
651
|
+
var o, l = a.queryKey, f = (o = a.queryHash) != null ? o : ar(l, a), c = this.get(f);
|
|
652
|
+
return c || (c = new Fi({
|
|
653
|
+
cache: this,
|
|
654
|
+
queryKey: l,
|
|
655
|
+
queryHash: f,
|
|
656
|
+
options: i.defaultQueryOptions(a),
|
|
657
|
+
state: s,
|
|
658
|
+
defaultOptions: i.getQueryDefaults(l),
|
|
659
|
+
meta: a.meta
|
|
660
|
+
}), this.add(c)), c;
|
|
661
|
+
}, r.add = function(i) {
|
|
662
|
+
this.queriesMap[i.queryHash] || (this.queriesMap[i.queryHash] = i, this.queries.push(i), this.notify({
|
|
663
|
+
type: "queryAdded",
|
|
664
|
+
query: i
|
|
665
|
+
}));
|
|
666
|
+
}, r.remove = function(i) {
|
|
667
|
+
var a = this.queriesMap[i.queryHash];
|
|
668
|
+
a && (i.destroy(), this.queries = this.queries.filter(function(s) {
|
|
669
|
+
return s !== i;
|
|
670
|
+
}), a === i && delete this.queriesMap[i.queryHash], this.notify({
|
|
671
|
+
type: "queryRemoved",
|
|
672
|
+
query: i
|
|
673
|
+
}));
|
|
674
|
+
}, r.clear = function() {
|
|
675
|
+
var i = this;
|
|
676
|
+
F.batch(function() {
|
|
677
|
+
i.queries.forEach(function(a) {
|
|
678
|
+
i.remove(a);
|
|
679
|
+
});
|
|
680
|
+
});
|
|
681
|
+
}, r.get = function(i) {
|
|
682
|
+
return this.queriesMap[i];
|
|
683
|
+
}, r.getAll = function() {
|
|
684
|
+
return this.queries;
|
|
685
|
+
}, r.find = function(i, a) {
|
|
686
|
+
var s = re(i, a), o = s[0];
|
|
687
|
+
return typeof o.exact > "u" && (o.exact = !0), this.queries.find(function(l) {
|
|
688
|
+
return Or(o, l);
|
|
689
|
+
});
|
|
690
|
+
}, r.findAll = function(i, a) {
|
|
691
|
+
var s = re(i, a), o = s[0];
|
|
692
|
+
return Object.keys(o).length > 0 ? this.queries.filter(function(l) {
|
|
693
|
+
return Or(o, l);
|
|
694
|
+
}) : this.queries;
|
|
695
|
+
}, r.notify = function(i) {
|
|
696
|
+
var a = this;
|
|
697
|
+
F.batch(function() {
|
|
698
|
+
a.listeners.forEach(function(s) {
|
|
699
|
+
s(i);
|
|
700
|
+
});
|
|
701
|
+
});
|
|
702
|
+
}, r.onFocus = function() {
|
|
703
|
+
var i = this;
|
|
704
|
+
F.batch(function() {
|
|
705
|
+
i.queries.forEach(function(a) {
|
|
706
|
+
a.onFocus();
|
|
707
|
+
});
|
|
708
|
+
});
|
|
709
|
+
}, r.onOnline = function() {
|
|
710
|
+
var i = this;
|
|
711
|
+
F.batch(function() {
|
|
712
|
+
i.queries.forEach(function(a) {
|
|
713
|
+
a.onOnline();
|
|
714
|
+
});
|
|
715
|
+
});
|
|
716
|
+
}, e;
|
|
717
|
+
}(Re), Ii = /* @__PURE__ */ function() {
|
|
718
|
+
function t(r) {
|
|
719
|
+
this.options = w({}, r.defaultOptions, r.options), this.mutationId = r.mutationId, this.mutationCache = r.mutationCache, this.observers = [], this.state = r.state || Cn(), this.meta = r.meta;
|
|
720
|
+
}
|
|
721
|
+
var e = t.prototype;
|
|
722
|
+
return e.setState = function(n) {
|
|
723
|
+
this.dispatch({
|
|
724
|
+
type: "setState",
|
|
725
|
+
state: n
|
|
726
|
+
});
|
|
727
|
+
}, e.addObserver = function(n) {
|
|
728
|
+
this.observers.indexOf(n) === -1 && this.observers.push(n);
|
|
729
|
+
}, e.removeObserver = function(n) {
|
|
730
|
+
this.observers = this.observers.filter(function(i) {
|
|
731
|
+
return i !== n;
|
|
732
|
+
});
|
|
733
|
+
}, e.cancel = function() {
|
|
734
|
+
return this.retryer ? (this.retryer.cancel(), this.retryer.promise.then(U).catch(U)) : Promise.resolve();
|
|
735
|
+
}, e.continue = function() {
|
|
736
|
+
return this.retryer ? (this.retryer.continue(), this.retryer.promise) : this.execute();
|
|
737
|
+
}, e.execute = function() {
|
|
738
|
+
var n = this, i, a = this.state.status === "loading", s = Promise.resolve();
|
|
739
|
+
return a || (this.dispatch({
|
|
740
|
+
type: "loading",
|
|
741
|
+
variables: this.options.variables
|
|
742
|
+
}), s = s.then(function() {
|
|
743
|
+
n.mutationCache.config.onMutate == null || n.mutationCache.config.onMutate(n.state.variables, n);
|
|
744
|
+
}).then(function() {
|
|
745
|
+
return n.options.onMutate == null ? void 0 : n.options.onMutate(n.state.variables);
|
|
746
|
+
}).then(function(o) {
|
|
747
|
+
o !== n.state.context && n.dispatch({
|
|
748
|
+
type: "loading",
|
|
749
|
+
context: o,
|
|
750
|
+
variables: n.state.variables
|
|
751
|
+
});
|
|
752
|
+
})), s.then(function() {
|
|
753
|
+
return n.executeMutation();
|
|
754
|
+
}).then(function(o) {
|
|
755
|
+
i = o, n.mutationCache.config.onSuccess == null || n.mutationCache.config.onSuccess(i, n.state.variables, n.state.context, n);
|
|
756
|
+
}).then(function() {
|
|
757
|
+
return n.options.onSuccess == null ? void 0 : n.options.onSuccess(i, n.state.variables, n.state.context);
|
|
758
|
+
}).then(function() {
|
|
759
|
+
return n.options.onSettled == null ? void 0 : n.options.onSettled(i, null, n.state.variables, n.state.context);
|
|
760
|
+
}).then(function() {
|
|
761
|
+
return n.dispatch({
|
|
762
|
+
type: "success",
|
|
763
|
+
data: i
|
|
764
|
+
}), i;
|
|
765
|
+
}).catch(function(o) {
|
|
766
|
+
return n.mutationCache.config.onError == null || n.mutationCache.config.onError(o, n.state.variables, n.state.context, n), Je().error(o), Promise.resolve().then(function() {
|
|
767
|
+
return n.options.onError == null ? void 0 : n.options.onError(o, n.state.variables, n.state.context);
|
|
768
|
+
}).then(function() {
|
|
769
|
+
return n.options.onSettled == null ? void 0 : n.options.onSettled(void 0, o, n.state.variables, n.state.context);
|
|
770
|
+
}).then(function() {
|
|
771
|
+
throw n.dispatch({
|
|
772
|
+
type: "error",
|
|
773
|
+
error: o
|
|
774
|
+
}), o;
|
|
775
|
+
});
|
|
776
|
+
});
|
|
777
|
+
}, e.executeMutation = function() {
|
|
778
|
+
var n = this, i;
|
|
779
|
+
return this.retryer = new Rn({
|
|
780
|
+
fn: function() {
|
|
781
|
+
return n.options.mutationFn ? n.options.mutationFn(n.state.variables) : Promise.reject("No mutationFn found");
|
|
782
|
+
},
|
|
783
|
+
onFail: function() {
|
|
784
|
+
n.dispatch({
|
|
785
|
+
type: "failed"
|
|
786
|
+
});
|
|
787
|
+
},
|
|
788
|
+
onPause: function() {
|
|
789
|
+
n.dispatch({
|
|
790
|
+
type: "pause"
|
|
791
|
+
});
|
|
792
|
+
},
|
|
793
|
+
onContinue: function() {
|
|
794
|
+
n.dispatch({
|
|
795
|
+
type: "continue"
|
|
796
|
+
});
|
|
797
|
+
},
|
|
798
|
+
retry: (i = this.options.retry) != null ? i : 0,
|
|
799
|
+
retryDelay: this.options.retryDelay
|
|
800
|
+
}), this.retryer.promise;
|
|
801
|
+
}, e.dispatch = function(n) {
|
|
802
|
+
var i = this;
|
|
803
|
+
this.state = _i(this.state, n), F.batch(function() {
|
|
804
|
+
i.observers.forEach(function(a) {
|
|
805
|
+
a.onMutationUpdate(n);
|
|
806
|
+
}), i.mutationCache.notify(i);
|
|
807
|
+
});
|
|
808
|
+
}, t;
|
|
809
|
+
}();
|
|
810
|
+
function Cn() {
|
|
811
|
+
return {
|
|
812
|
+
context: void 0,
|
|
813
|
+
data: void 0,
|
|
814
|
+
error: null,
|
|
815
|
+
failureCount: 0,
|
|
816
|
+
isPaused: !1,
|
|
817
|
+
status: "idle",
|
|
818
|
+
variables: void 0
|
|
819
|
+
};
|
|
820
|
+
}
|
|
821
|
+
function _i(t, e) {
|
|
822
|
+
switch (e.type) {
|
|
823
|
+
case "failed":
|
|
824
|
+
return w({}, t, {
|
|
825
|
+
failureCount: t.failureCount + 1
|
|
826
|
+
});
|
|
827
|
+
case "pause":
|
|
828
|
+
return w({}, t, {
|
|
829
|
+
isPaused: !0
|
|
830
|
+
});
|
|
831
|
+
case "continue":
|
|
832
|
+
return w({}, t, {
|
|
833
|
+
isPaused: !1
|
|
834
|
+
});
|
|
835
|
+
case "loading":
|
|
836
|
+
return w({}, t, {
|
|
837
|
+
context: e.context,
|
|
838
|
+
data: void 0,
|
|
839
|
+
error: null,
|
|
840
|
+
isPaused: !1,
|
|
841
|
+
status: "loading",
|
|
842
|
+
variables: e.variables
|
|
843
|
+
});
|
|
844
|
+
case "success":
|
|
845
|
+
return w({}, t, {
|
|
846
|
+
data: e.data,
|
|
847
|
+
error: null,
|
|
848
|
+
status: "success",
|
|
849
|
+
isPaused: !1
|
|
850
|
+
});
|
|
851
|
+
case "error":
|
|
852
|
+
return w({}, t, {
|
|
853
|
+
data: void 0,
|
|
854
|
+
error: e.error,
|
|
855
|
+
failureCount: t.failureCount + 1,
|
|
856
|
+
isPaused: !1,
|
|
857
|
+
status: "error"
|
|
858
|
+
});
|
|
859
|
+
case "setState":
|
|
860
|
+
return w({}, t, e.state);
|
|
861
|
+
default:
|
|
862
|
+
return t;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
var qi = /* @__PURE__ */ function(t) {
|
|
866
|
+
Ee(e, t);
|
|
867
|
+
function e(n) {
|
|
868
|
+
var i;
|
|
869
|
+
return i = t.call(this) || this, i.config = n || {}, i.mutations = [], i.mutationId = 0, i;
|
|
870
|
+
}
|
|
871
|
+
var r = e.prototype;
|
|
872
|
+
return r.build = function(i, a, s) {
|
|
873
|
+
var o = new Ii({
|
|
874
|
+
mutationCache: this,
|
|
875
|
+
mutationId: ++this.mutationId,
|
|
876
|
+
options: i.defaultMutationOptions(a),
|
|
877
|
+
state: s,
|
|
878
|
+
defaultOptions: a.mutationKey ? i.getMutationDefaults(a.mutationKey) : void 0,
|
|
879
|
+
meta: a.meta
|
|
880
|
+
});
|
|
881
|
+
return this.add(o), o;
|
|
882
|
+
}, r.add = function(i) {
|
|
883
|
+
this.mutations.push(i), this.notify(i);
|
|
884
|
+
}, r.remove = function(i) {
|
|
885
|
+
this.mutations = this.mutations.filter(function(a) {
|
|
886
|
+
return a !== i;
|
|
887
|
+
}), i.cancel(), this.notify(i);
|
|
888
|
+
}, r.clear = function() {
|
|
889
|
+
var i = this;
|
|
890
|
+
F.batch(function() {
|
|
891
|
+
i.mutations.forEach(function(a) {
|
|
892
|
+
i.remove(a);
|
|
893
|
+
});
|
|
894
|
+
});
|
|
895
|
+
}, r.getAll = function() {
|
|
896
|
+
return this.mutations;
|
|
897
|
+
}, r.find = function(i) {
|
|
898
|
+
return typeof i.exact > "u" && (i.exact = !0), this.mutations.find(function(a) {
|
|
899
|
+
return Pr(i, a);
|
|
900
|
+
});
|
|
901
|
+
}, r.findAll = function(i) {
|
|
902
|
+
return this.mutations.filter(function(a) {
|
|
903
|
+
return Pr(i, a);
|
|
904
|
+
});
|
|
905
|
+
}, r.notify = function(i) {
|
|
906
|
+
var a = this;
|
|
907
|
+
F.batch(function() {
|
|
908
|
+
a.listeners.forEach(function(s) {
|
|
909
|
+
s(i);
|
|
910
|
+
});
|
|
911
|
+
});
|
|
912
|
+
}, r.onFocus = function() {
|
|
913
|
+
this.resumePausedMutations();
|
|
914
|
+
}, r.onOnline = function() {
|
|
915
|
+
this.resumePausedMutations();
|
|
916
|
+
}, r.resumePausedMutations = function() {
|
|
917
|
+
var i = this.mutations.filter(function(a) {
|
|
918
|
+
return a.state.isPaused;
|
|
919
|
+
});
|
|
920
|
+
return F.batch(function() {
|
|
921
|
+
return i.reduce(function(a, s) {
|
|
922
|
+
return a.then(function() {
|
|
923
|
+
return s.continue().catch(U);
|
|
924
|
+
});
|
|
925
|
+
}, Promise.resolve());
|
|
926
|
+
});
|
|
927
|
+
}, e;
|
|
928
|
+
}(Re);
|
|
929
|
+
function $i() {
|
|
930
|
+
return {
|
|
931
|
+
onFetch: function(e) {
|
|
932
|
+
e.fetchFn = function() {
|
|
933
|
+
var r, n, i, a, s, o, l = (r = e.fetchOptions) == null || (n = r.meta) == null ? void 0 : n.refetchPage, f = (i = e.fetchOptions) == null || (a = i.meta) == null ? void 0 : a.fetchMore, c = f?.pageParam, u = f?.direction === "forward", h = f?.direction === "backward", d = ((s = e.state.data) == null ? void 0 : s.pages) || [], p = ((o = e.state.data) == null ? void 0 : o.pageParams) || [], v = Pn(), m = v?.signal, y = p, g = !1, S = e.options.queryFn || function() {
|
|
934
|
+
return Promise.reject("Missing queryFn");
|
|
935
|
+
}, b = function(I, k, B, oe) {
|
|
936
|
+
return y = oe ? [k].concat(y) : [].concat(y, [k]), oe ? [B].concat(I) : [].concat(I, [B]);
|
|
937
|
+
}, C = function(I, k, B, oe) {
|
|
938
|
+
if (g)
|
|
939
|
+
return Promise.reject("Cancelled");
|
|
940
|
+
if (typeof B > "u" && !k && I.length)
|
|
941
|
+
return Promise.resolve(I);
|
|
942
|
+
var H = {
|
|
943
|
+
queryKey: e.queryKey,
|
|
944
|
+
signal: m,
|
|
945
|
+
pageParam: B,
|
|
946
|
+
meta: e.meta
|
|
947
|
+
}, V = S(H), Te = Promise.resolve(V).then(function(hi) {
|
|
948
|
+
return b(I, B, hi, oe);
|
|
949
|
+
});
|
|
950
|
+
if (Ve(V)) {
|
|
951
|
+
var ot = Te;
|
|
952
|
+
ot.cancel = V.cancel;
|
|
953
|
+
}
|
|
954
|
+
return Te;
|
|
955
|
+
}, P;
|
|
956
|
+
if (!d.length)
|
|
957
|
+
P = C([]);
|
|
958
|
+
else if (u) {
|
|
959
|
+
var _ = typeof c < "u", G = _ ? c : Ar(e.options, d);
|
|
960
|
+
P = C(d, _, G);
|
|
961
|
+
} else if (h) {
|
|
962
|
+
var Q = typeof c < "u", A = Q ? c : Mi(e.options, d);
|
|
963
|
+
P = C(d, Q, A, !0);
|
|
964
|
+
} else
|
|
965
|
+
(function() {
|
|
966
|
+
y = [];
|
|
967
|
+
var q = typeof e.options.getNextPageParam > "u", I = l && d[0] ? l(d[0], 0, d) : !0;
|
|
968
|
+
P = I ? C([], q, p[0]) : Promise.resolve(b([], p[0], d[0]));
|
|
969
|
+
for (var k = function(H) {
|
|
970
|
+
P = P.then(function(V) {
|
|
971
|
+
var Te = l && d[H] ? l(d[H], H, d) : !0;
|
|
972
|
+
if (Te) {
|
|
973
|
+
var ot = q ? p[H] : Ar(e.options, V);
|
|
974
|
+
return C(V, q, ot);
|
|
975
|
+
}
|
|
976
|
+
return Promise.resolve(b(V, p[H], d[H]));
|
|
977
|
+
});
|
|
978
|
+
}, B = 1; B < d.length; B++)
|
|
979
|
+
k(B);
|
|
980
|
+
})();
|
|
981
|
+
var $ = P.then(function(q) {
|
|
982
|
+
return {
|
|
983
|
+
pages: q,
|
|
984
|
+
pageParams: y
|
|
985
|
+
};
|
|
986
|
+
}), x = $;
|
|
987
|
+
return x.cancel = function() {
|
|
988
|
+
g = !0, v?.abort(), Ve(P) && P.cancel();
|
|
989
|
+
}, $;
|
|
990
|
+
};
|
|
991
|
+
}
|
|
992
|
+
};
|
|
993
|
+
}
|
|
994
|
+
function Ar(t, e) {
|
|
995
|
+
return t.getNextPageParam == null ? void 0 : t.getNextPageParam(e[e.length - 1], e);
|
|
996
|
+
}
|
|
997
|
+
function Mi(t, e) {
|
|
998
|
+
return t.getPreviousPageParam == null ? void 0 : t.getPreviousPageParam(e[0], e);
|
|
999
|
+
}
|
|
1000
|
+
var Di = /* @__PURE__ */ function() {
|
|
1001
|
+
function t(r) {
|
|
1002
|
+
r === void 0 && (r = {}), this.queryCache = r.queryCache || new xi(), this.mutationCache = r.mutationCache || new qi(), this.defaultOptions = r.defaultOptions || {}, this.queryDefaults = [], this.mutationDefaults = [];
|
|
1003
|
+
}
|
|
1004
|
+
var e = t.prototype;
|
|
1005
|
+
return e.mount = function() {
|
|
1006
|
+
var n = this;
|
|
1007
|
+
this.unsubscribeFocus = Fe.subscribe(function() {
|
|
1008
|
+
Fe.isFocused() && ke.isOnline() && (n.mutationCache.onFocus(), n.queryCache.onFocus());
|
|
1009
|
+
}), this.unsubscribeOnline = ke.subscribe(function() {
|
|
1010
|
+
Fe.isFocused() && ke.isOnline() && (n.mutationCache.onOnline(), n.queryCache.onOnline());
|
|
1011
|
+
});
|
|
1012
|
+
}, e.unmount = function() {
|
|
1013
|
+
var n, i;
|
|
1014
|
+
(n = this.unsubscribeFocus) == null || n.call(this), (i = this.unsubscribeOnline) == null || i.call(this);
|
|
1015
|
+
}, e.isFetching = function(n, i) {
|
|
1016
|
+
var a = re(n, i), s = a[0];
|
|
1017
|
+
return s.fetching = !0, this.queryCache.findAll(s).length;
|
|
1018
|
+
}, e.isMutating = function(n) {
|
|
1019
|
+
return this.mutationCache.findAll(w({}, n, {
|
|
1020
|
+
fetching: !0
|
|
1021
|
+
})).length;
|
|
1022
|
+
}, e.getQueryData = function(n, i) {
|
|
1023
|
+
var a;
|
|
1024
|
+
return (a = this.queryCache.find(n, i)) == null ? void 0 : a.state.data;
|
|
1025
|
+
}, e.getQueriesData = function(n) {
|
|
1026
|
+
return this.getQueryCache().findAll(n).map(function(i) {
|
|
1027
|
+
var a = i.queryKey, s = i.state, o = s.data;
|
|
1028
|
+
return [a, o];
|
|
1029
|
+
});
|
|
1030
|
+
}, e.setQueryData = function(n, i, a) {
|
|
1031
|
+
var s = Qe(n), o = this.defaultQueryOptions(s);
|
|
1032
|
+
return this.queryCache.build(this, o).setData(i, a);
|
|
1033
|
+
}, e.setQueriesData = function(n, i, a) {
|
|
1034
|
+
var s = this;
|
|
1035
|
+
return F.batch(function() {
|
|
1036
|
+
return s.getQueryCache().findAll(n).map(function(o) {
|
|
1037
|
+
var l = o.queryKey;
|
|
1038
|
+
return [l, s.setQueryData(l, i, a)];
|
|
1039
|
+
});
|
|
1040
|
+
});
|
|
1041
|
+
}, e.getQueryState = function(n, i) {
|
|
1042
|
+
var a;
|
|
1043
|
+
return (a = this.queryCache.find(n, i)) == null ? void 0 : a.state;
|
|
1044
|
+
}, e.removeQueries = function(n, i) {
|
|
1045
|
+
var a = re(n, i), s = a[0], o = this.queryCache;
|
|
1046
|
+
F.batch(function() {
|
|
1047
|
+
o.findAll(s).forEach(function(l) {
|
|
1048
|
+
o.remove(l);
|
|
1049
|
+
});
|
|
1050
|
+
});
|
|
1051
|
+
}, e.resetQueries = function(n, i, a) {
|
|
1052
|
+
var s = this, o = re(n, i, a), l = o[0], f = o[1], c = this.queryCache, u = w({}, l, {
|
|
1053
|
+
active: !0
|
|
1054
|
+
});
|
|
1055
|
+
return F.batch(function() {
|
|
1056
|
+
return c.findAll(l).forEach(function(h) {
|
|
1057
|
+
h.reset();
|
|
1058
|
+
}), s.refetchQueries(u, f);
|
|
1059
|
+
});
|
|
1060
|
+
}, e.cancelQueries = function(n, i, a) {
|
|
1061
|
+
var s = this, o = re(n, i, a), l = o[0], f = o[1], c = f === void 0 ? {} : f;
|
|
1062
|
+
typeof c.revert > "u" && (c.revert = !0);
|
|
1063
|
+
var u = F.batch(function() {
|
|
1064
|
+
return s.queryCache.findAll(l).map(function(h) {
|
|
1065
|
+
return h.cancel(c);
|
|
1066
|
+
});
|
|
1067
|
+
});
|
|
1068
|
+
return Promise.all(u).then(U).catch(U);
|
|
1069
|
+
}, e.invalidateQueries = function(n, i, a) {
|
|
1070
|
+
var s, o, l, f = this, c = re(n, i, a), u = c[0], h = c[1], d = w({}, u, {
|
|
1071
|
+
// if filters.refetchActive is not provided and filters.active is explicitly false,
|
|
1072
|
+
// e.g. invalidateQueries({ active: false }), we don't want to refetch active queries
|
|
1073
|
+
active: (s = (o = u.refetchActive) != null ? o : u.active) != null ? s : !0,
|
|
1074
|
+
inactive: (l = u.refetchInactive) != null ? l : !1
|
|
1075
|
+
});
|
|
1076
|
+
return F.batch(function() {
|
|
1077
|
+
return f.queryCache.findAll(u).forEach(function(p) {
|
|
1078
|
+
p.invalidate();
|
|
1079
|
+
}), f.refetchQueries(d, h);
|
|
1080
|
+
});
|
|
1081
|
+
}, e.refetchQueries = function(n, i, a) {
|
|
1082
|
+
var s = this, o = re(n, i, a), l = o[0], f = o[1], c = F.batch(function() {
|
|
1083
|
+
return s.queryCache.findAll(l).map(function(h) {
|
|
1084
|
+
return h.fetch(void 0, w({}, f, {
|
|
1085
|
+
meta: {
|
|
1086
|
+
refetchPage: l?.refetchPage
|
|
1087
|
+
}
|
|
1088
|
+
}));
|
|
1089
|
+
});
|
|
1090
|
+
}), u = Promise.all(c).then(U);
|
|
1091
|
+
return f?.throwOnError || (u = u.catch(U)), u;
|
|
1092
|
+
}, e.fetchQuery = function(n, i, a) {
|
|
1093
|
+
var s = Qe(n, i, a), o = this.defaultQueryOptions(s);
|
|
1094
|
+
typeof o.retry > "u" && (o.retry = !1);
|
|
1095
|
+
var l = this.queryCache.build(this, o);
|
|
1096
|
+
return l.isStaleByTime(o.staleTime) ? l.fetch(o) : Promise.resolve(l.state.data);
|
|
1097
|
+
}, e.prefetchQuery = function(n, i, a) {
|
|
1098
|
+
return this.fetchQuery(n, i, a).then(U).catch(U);
|
|
1099
|
+
}, e.fetchInfiniteQuery = function(n, i, a) {
|
|
1100
|
+
var s = Qe(n, i, a);
|
|
1101
|
+
return s.behavior = $i(), this.fetchQuery(s);
|
|
1102
|
+
}, e.prefetchInfiniteQuery = function(n, i, a) {
|
|
1103
|
+
return this.fetchInfiniteQuery(n, i, a).then(U).catch(U);
|
|
1104
|
+
}, e.cancelMutations = function() {
|
|
1105
|
+
var n = this, i = F.batch(function() {
|
|
1106
|
+
return n.mutationCache.getAll().map(function(a) {
|
|
1107
|
+
return a.cancel();
|
|
1108
|
+
});
|
|
1109
|
+
});
|
|
1110
|
+
return Promise.all(i).then(U).catch(U);
|
|
1111
|
+
}, e.resumePausedMutations = function() {
|
|
1112
|
+
return this.getMutationCache().resumePausedMutations();
|
|
1113
|
+
}, e.executeMutation = function(n) {
|
|
1114
|
+
return this.mutationCache.build(this, n).execute();
|
|
1115
|
+
}, e.getQueryCache = function() {
|
|
1116
|
+
return this.queryCache;
|
|
1117
|
+
}, e.getMutationCache = function() {
|
|
1118
|
+
return this.mutationCache;
|
|
1119
|
+
}, e.getDefaultOptions = function() {
|
|
1120
|
+
return this.defaultOptions;
|
|
1121
|
+
}, e.setDefaultOptions = function(n) {
|
|
1122
|
+
this.defaultOptions = n;
|
|
1123
|
+
}, e.setQueryDefaults = function(n, i) {
|
|
1124
|
+
var a = this.queryDefaults.find(function(s) {
|
|
1125
|
+
return he(n) === he(s.queryKey);
|
|
1126
|
+
});
|
|
1127
|
+
a ? a.defaultOptions = i : this.queryDefaults.push({
|
|
1128
|
+
queryKey: n,
|
|
1129
|
+
defaultOptions: i
|
|
1130
|
+
});
|
|
1131
|
+
}, e.getQueryDefaults = function(n) {
|
|
1132
|
+
var i;
|
|
1133
|
+
return n ? (i = this.queryDefaults.find(function(a) {
|
|
1134
|
+
return Ge(n, a.queryKey);
|
|
1135
|
+
})) == null ? void 0 : i.defaultOptions : void 0;
|
|
1136
|
+
}, e.setMutationDefaults = function(n, i) {
|
|
1137
|
+
var a = this.mutationDefaults.find(function(s) {
|
|
1138
|
+
return he(n) === he(s.mutationKey);
|
|
1139
|
+
});
|
|
1140
|
+
a ? a.defaultOptions = i : this.mutationDefaults.push({
|
|
1141
|
+
mutationKey: n,
|
|
1142
|
+
defaultOptions: i
|
|
1143
|
+
});
|
|
1144
|
+
}, e.getMutationDefaults = function(n) {
|
|
1145
|
+
var i;
|
|
1146
|
+
return n ? (i = this.mutationDefaults.find(function(a) {
|
|
1147
|
+
return Ge(n, a.mutationKey);
|
|
1148
|
+
})) == null ? void 0 : i.defaultOptions : void 0;
|
|
1149
|
+
}, e.defaultQueryOptions = function(n) {
|
|
1150
|
+
if (n?._defaulted)
|
|
1151
|
+
return n;
|
|
1152
|
+
var i = w({}, this.defaultOptions.queries, this.getQueryDefaults(n?.queryKey), n, {
|
|
1153
|
+
_defaulted: !0
|
|
1154
|
+
});
|
|
1155
|
+
return !i.queryHash && i.queryKey && (i.queryHash = ar(i.queryKey, i)), i;
|
|
1156
|
+
}, e.defaultQueryObserverOptions = function(n) {
|
|
1157
|
+
return this.defaultQueryOptions(n);
|
|
1158
|
+
}, e.defaultMutationOptions = function(n) {
|
|
1159
|
+
return n?._defaulted ? n : w({}, this.defaultOptions.mutations, this.getMutationDefaults(n?.mutationKey), n, {
|
|
1160
|
+
_defaulted: !0
|
|
1161
|
+
});
|
|
1162
|
+
}, e.clear = function() {
|
|
1163
|
+
this.queryCache.clear(), this.mutationCache.clear();
|
|
1164
|
+
}, t;
|
|
1165
|
+
}(), Ti = /* @__PURE__ */ function(t) {
|
|
1166
|
+
Ee(e, t);
|
|
1167
|
+
function e(n, i) {
|
|
1168
|
+
var a;
|
|
1169
|
+
return a = t.call(this) || this, a.client = n, a.options = i, a.trackedProps = [], a.selectError = null, a.bindMethods(), a.setOptions(i), a;
|
|
1170
|
+
}
|
|
1171
|
+
var r = e.prototype;
|
|
1172
|
+
return r.bindMethods = function() {
|
|
1173
|
+
this.remove = this.remove.bind(this), this.refetch = this.refetch.bind(this);
|
|
1174
|
+
}, r.onSubscribe = function() {
|
|
1175
|
+
this.listeners.length === 1 && (this.currentQuery.addObserver(this), Cr(this.currentQuery, this.options) && this.executeFetch(), this.updateTimers());
|
|
1176
|
+
}, r.onUnsubscribe = function() {
|
|
1177
|
+
this.listeners.length || this.destroy();
|
|
1178
|
+
}, r.shouldFetchOnReconnect = function() {
|
|
1179
|
+
return Qt(this.currentQuery, this.options, this.options.refetchOnReconnect);
|
|
1180
|
+
}, r.shouldFetchOnWindowFocus = function() {
|
|
1181
|
+
return Qt(this.currentQuery, this.options, this.options.refetchOnWindowFocus);
|
|
1182
|
+
}, r.destroy = function() {
|
|
1183
|
+
this.listeners = [], this.clearTimers(), this.currentQuery.removeObserver(this);
|
|
1184
|
+
}, r.setOptions = function(i, a) {
|
|
1185
|
+
var s = this.options, o = this.currentQuery;
|
|
1186
|
+
if (this.options = this.client.defaultQueryObserverOptions(i), typeof this.options.enabled < "u" && typeof this.options.enabled != "boolean")
|
|
1187
|
+
throw new Error("Expected enabled to be a boolean");
|
|
1188
|
+
this.options.queryKey || (this.options.queryKey = s.queryKey), this.updateQuery();
|
|
1189
|
+
var l = this.hasListeners();
|
|
1190
|
+
l && Fr(this.currentQuery, o, this.options, s) && this.executeFetch(), this.updateResult(a), l && (this.currentQuery !== o || this.options.enabled !== s.enabled || this.options.staleTime !== s.staleTime) && this.updateStaleTimeout();
|
|
1191
|
+
var f = this.computeRefetchInterval();
|
|
1192
|
+
l && (this.currentQuery !== o || this.options.enabled !== s.enabled || f !== this.currentRefetchInterval) && this.updateRefetchInterval(f);
|
|
1193
|
+
}, r.getOptimisticResult = function(i) {
|
|
1194
|
+
var a = this.client.defaultQueryObserverOptions(i), s = this.client.getQueryCache().build(this.client, a);
|
|
1195
|
+
return this.createResult(s, a);
|
|
1196
|
+
}, r.getCurrentResult = function() {
|
|
1197
|
+
return this.currentResult;
|
|
1198
|
+
}, r.trackResult = function(i, a) {
|
|
1199
|
+
var s = this, o = {}, l = function(c) {
|
|
1200
|
+
s.trackedProps.includes(c) || s.trackedProps.push(c);
|
|
1201
|
+
};
|
|
1202
|
+
return Object.keys(i).forEach(function(f) {
|
|
1203
|
+
Object.defineProperty(o, f, {
|
|
1204
|
+
configurable: !1,
|
|
1205
|
+
enumerable: !0,
|
|
1206
|
+
get: function() {
|
|
1207
|
+
return l(f), i[f];
|
|
1208
|
+
}
|
|
1209
|
+
});
|
|
1210
|
+
}), (a.useErrorBoundary || a.suspense) && l("error"), o;
|
|
1211
|
+
}, r.getNextResult = function(i) {
|
|
1212
|
+
var a = this;
|
|
1213
|
+
return new Promise(function(s, o) {
|
|
1214
|
+
var l = a.subscribe(function(f) {
|
|
1215
|
+
f.isFetching || (l(), f.isError && i?.throwOnError ? o(f.error) : s(f));
|
|
1216
|
+
});
|
|
1217
|
+
});
|
|
1218
|
+
}, r.getCurrentQuery = function() {
|
|
1219
|
+
return this.currentQuery;
|
|
1220
|
+
}, r.remove = function() {
|
|
1221
|
+
this.client.getQueryCache().remove(this.currentQuery);
|
|
1222
|
+
}, r.refetch = function(i) {
|
|
1223
|
+
return this.fetch(w({}, i, {
|
|
1224
|
+
meta: {
|
|
1225
|
+
refetchPage: i?.refetchPage
|
|
1226
|
+
}
|
|
1227
|
+
}));
|
|
1228
|
+
}, r.fetchOptimistic = function(i) {
|
|
1229
|
+
var a = this, s = this.client.defaultQueryObserverOptions(i), o = this.client.getQueryCache().build(this.client, s);
|
|
1230
|
+
return o.fetch().then(function() {
|
|
1231
|
+
return a.createResult(o, s);
|
|
1232
|
+
});
|
|
1233
|
+
}, r.fetch = function(i) {
|
|
1234
|
+
var a = this;
|
|
1235
|
+
return this.executeFetch(i).then(function() {
|
|
1236
|
+
return a.updateResult(), a.currentResult;
|
|
1237
|
+
});
|
|
1238
|
+
}, r.executeFetch = function(i) {
|
|
1239
|
+
this.updateQuery();
|
|
1240
|
+
var a = this.currentQuery.fetch(this.options, i);
|
|
1241
|
+
return i?.throwOnError || (a = a.catch(U)), a;
|
|
1242
|
+
}, r.updateStaleTimeout = function() {
|
|
1243
|
+
var i = this;
|
|
1244
|
+
if (this.clearStaleTimeout(), !(Ke || this.currentResult.isStale || !Nt(this.options.staleTime))) {
|
|
1245
|
+
var a = wn(this.currentResult.dataUpdatedAt, this.options.staleTime), s = a + 1;
|
|
1246
|
+
this.staleTimeoutId = setTimeout(function() {
|
|
1247
|
+
i.currentResult.isStale || i.updateResult();
|
|
1248
|
+
}, s);
|
|
1249
|
+
}
|
|
1250
|
+
}, r.computeRefetchInterval = function() {
|
|
1251
|
+
var i;
|
|
1252
|
+
return typeof this.options.refetchInterval == "function" ? this.options.refetchInterval(this.currentResult.data, this.currentQuery) : (i = this.options.refetchInterval) != null ? i : !1;
|
|
1253
|
+
}, r.updateRefetchInterval = function(i) {
|
|
1254
|
+
var a = this;
|
|
1255
|
+
this.clearRefetchInterval(), this.currentRefetchInterval = i, !(Ke || this.options.enabled === !1 || !Nt(this.currentRefetchInterval) || this.currentRefetchInterval === 0) && (this.refetchIntervalId = setInterval(function() {
|
|
1256
|
+
(a.options.refetchIntervalInBackground || Fe.isFocused()) && a.executeFetch();
|
|
1257
|
+
}, this.currentRefetchInterval));
|
|
1258
|
+
}, r.updateTimers = function() {
|
|
1259
|
+
this.updateStaleTimeout(), this.updateRefetchInterval(this.computeRefetchInterval());
|
|
1260
|
+
}, r.clearTimers = function() {
|
|
1261
|
+
this.clearStaleTimeout(), this.clearRefetchInterval();
|
|
1262
|
+
}, r.clearStaleTimeout = function() {
|
|
1263
|
+
this.staleTimeoutId && (clearTimeout(this.staleTimeoutId), this.staleTimeoutId = void 0);
|
|
1264
|
+
}, r.clearRefetchInterval = function() {
|
|
1265
|
+
this.refetchIntervalId && (clearInterval(this.refetchIntervalId), this.refetchIntervalId = void 0);
|
|
1266
|
+
}, r.createResult = function(i, a) {
|
|
1267
|
+
var s = this.currentQuery, o = this.options, l = this.currentResult, f = this.currentResultState, c = this.currentResultOptions, u = i !== s, h = u ? i.state : this.currentQueryInitialState, d = u ? this.currentResult : this.previousQueryResult, p = i.state, v = p.dataUpdatedAt, m = p.error, y = p.errorUpdatedAt, g = p.isFetching, S = p.status, b = !1, C = !1, P;
|
|
1268
|
+
if (a.optimisticResults) {
|
|
1269
|
+
var _ = this.hasListeners(), G = !_ && Cr(i, a), Q = _ && Fr(i, s, a, o);
|
|
1270
|
+
(G || Q) && (g = !0, v || (S = "loading"));
|
|
1271
|
+
}
|
|
1272
|
+
if (a.keepPreviousData && !p.dataUpdateCount && d?.isSuccess && S !== "error")
|
|
1273
|
+
P = d.data, v = d.dataUpdatedAt, S = d.status, b = !0;
|
|
1274
|
+
else if (a.select && typeof p.data < "u")
|
|
1275
|
+
if (l && p.data === f?.data && a.select === this.selectFn)
|
|
1276
|
+
P = this.selectResult;
|
|
1277
|
+
else
|
|
1278
|
+
try {
|
|
1279
|
+
this.selectFn = a.select, P = a.select(p.data), a.structuralSharing !== !1 && (P = He(l?.data, P)), this.selectResult = P, this.selectError = null;
|
|
1280
|
+
} catch (x) {
|
|
1281
|
+
Je().error(x), this.selectError = x;
|
|
1282
|
+
}
|
|
1283
|
+
else
|
|
1284
|
+
P = p.data;
|
|
1285
|
+
if (typeof a.placeholderData < "u" && typeof P > "u" && (S === "loading" || S === "idle")) {
|
|
1286
|
+
var A;
|
|
1287
|
+
if (l?.isPlaceholderData && a.placeholderData === c?.placeholderData)
|
|
1288
|
+
A = l.data;
|
|
1289
|
+
else if (A = typeof a.placeholderData == "function" ? a.placeholderData() : a.placeholderData, a.select && typeof A < "u")
|
|
1290
|
+
try {
|
|
1291
|
+
A = a.select(A), a.structuralSharing !== !1 && (A = He(l?.data, A)), this.selectError = null;
|
|
1292
|
+
} catch (x) {
|
|
1293
|
+
Je().error(x), this.selectError = x;
|
|
1294
|
+
}
|
|
1295
|
+
typeof A < "u" && (S = "success", P = A, C = !0);
|
|
1296
|
+
}
|
|
1297
|
+
this.selectError && (m = this.selectError, P = this.selectResult, y = Date.now(), S = "error");
|
|
1298
|
+
var $ = {
|
|
1299
|
+
status: S,
|
|
1300
|
+
isLoading: S === "loading",
|
|
1301
|
+
isSuccess: S === "success",
|
|
1302
|
+
isError: S === "error",
|
|
1303
|
+
isIdle: S === "idle",
|
|
1304
|
+
data: P,
|
|
1305
|
+
dataUpdatedAt: v,
|
|
1306
|
+
error: m,
|
|
1307
|
+
errorUpdatedAt: y,
|
|
1308
|
+
failureCount: p.fetchFailureCount,
|
|
1309
|
+
errorUpdateCount: p.errorUpdateCount,
|
|
1310
|
+
isFetched: p.dataUpdateCount > 0 || p.errorUpdateCount > 0,
|
|
1311
|
+
isFetchedAfterMount: p.dataUpdateCount > h.dataUpdateCount || p.errorUpdateCount > h.errorUpdateCount,
|
|
1312
|
+
isFetching: g,
|
|
1313
|
+
isRefetching: g && S !== "loading",
|
|
1314
|
+
isLoadingError: S === "error" && p.dataUpdatedAt === 0,
|
|
1315
|
+
isPlaceholderData: C,
|
|
1316
|
+
isPreviousData: b,
|
|
1317
|
+
isRefetchError: S === "error" && p.dataUpdatedAt !== 0,
|
|
1318
|
+
isStale: sr(i, a),
|
|
1319
|
+
refetch: this.refetch,
|
|
1320
|
+
remove: this.remove
|
|
1321
|
+
};
|
|
1322
|
+
return $;
|
|
1323
|
+
}, r.shouldNotifyListeners = function(i, a) {
|
|
1324
|
+
if (!a)
|
|
1325
|
+
return !0;
|
|
1326
|
+
var s = this.options, o = s.notifyOnChangeProps, l = s.notifyOnChangePropsExclusions;
|
|
1327
|
+
if (!o && !l || o === "tracked" && !this.trackedProps.length)
|
|
1328
|
+
return !0;
|
|
1329
|
+
var f = o === "tracked" ? this.trackedProps : o;
|
|
1330
|
+
return Object.keys(i).some(function(c) {
|
|
1331
|
+
var u = c, h = i[u] !== a[u], d = f?.some(function(v) {
|
|
1332
|
+
return v === c;
|
|
1333
|
+
}), p = l?.some(function(v) {
|
|
1334
|
+
return v === c;
|
|
1335
|
+
});
|
|
1336
|
+
return h && !p && (!f || d);
|
|
1337
|
+
});
|
|
1338
|
+
}, r.updateResult = function(i) {
|
|
1339
|
+
var a = this.currentResult;
|
|
1340
|
+
if (this.currentResult = this.createResult(this.currentQuery, this.options), this.currentResultState = this.currentQuery.state, this.currentResultOptions = this.options, !wi(this.currentResult, a)) {
|
|
1341
|
+
var s = {
|
|
1342
|
+
cache: !0
|
|
1343
|
+
};
|
|
1344
|
+
i?.listeners !== !1 && this.shouldNotifyListeners(this.currentResult, a) && (s.listeners = !0), this.notify(w({}, s, i));
|
|
1345
|
+
}
|
|
1346
|
+
}, r.updateQuery = function() {
|
|
1347
|
+
var i = this.client.getQueryCache().build(this.client, this.options);
|
|
1348
|
+
if (i !== this.currentQuery) {
|
|
1349
|
+
var a = this.currentQuery;
|
|
1350
|
+
this.currentQuery = i, this.currentQueryInitialState = i.state, this.previousQueryResult = this.currentResult, this.hasListeners() && (a?.removeObserver(this), i.addObserver(this));
|
|
1351
|
+
}
|
|
1352
|
+
}, r.onQueryUpdate = function(i) {
|
|
1353
|
+
var a = {};
|
|
1354
|
+
i.type === "success" ? a.onSuccess = !0 : i.type === "error" && !Be(i.error) && (a.onError = !0), this.updateResult(a), this.hasListeners() && this.updateTimers();
|
|
1355
|
+
}, r.notify = function(i) {
|
|
1356
|
+
var a = this;
|
|
1357
|
+
F.batch(function() {
|
|
1358
|
+
i.onSuccess ? (a.options.onSuccess == null || a.options.onSuccess(a.currentResult.data), a.options.onSettled == null || a.options.onSettled(a.currentResult.data, null)) : i.onError && (a.options.onError == null || a.options.onError(a.currentResult.error), a.options.onSettled == null || a.options.onSettled(void 0, a.currentResult.error)), i.listeners && a.listeners.forEach(function(s) {
|
|
1359
|
+
s(a.currentResult);
|
|
1360
|
+
}), i.cache && a.client.getQueryCache().notify({
|
|
1361
|
+
query: a.currentQuery,
|
|
1362
|
+
type: "observerResultsUpdated"
|
|
1363
|
+
});
|
|
1364
|
+
});
|
|
1365
|
+
}, e;
|
|
1366
|
+
}(Re);
|
|
1367
|
+
function Ui(t, e) {
|
|
1368
|
+
return e.enabled !== !1 && !t.state.dataUpdatedAt && !(t.state.status === "error" && e.retryOnMount === !1);
|
|
1369
|
+
}
|
|
1370
|
+
function Cr(t, e) {
|
|
1371
|
+
return Ui(t, e) || t.state.dataUpdatedAt > 0 && Qt(t, e, e.refetchOnMount);
|
|
1372
|
+
}
|
|
1373
|
+
function Qt(t, e, r) {
|
|
1374
|
+
if (e.enabled !== !1) {
|
|
1375
|
+
var n = typeof r == "function" ? r(t) : r;
|
|
1376
|
+
return n === "always" || n !== !1 && sr(t, e);
|
|
1377
|
+
}
|
|
1378
|
+
return !1;
|
|
1379
|
+
}
|
|
1380
|
+
function Fr(t, e, r, n) {
|
|
1381
|
+
return r.enabled !== !1 && (t !== e || n.enabled === !1) && (!r.suspense || t.state.status !== "error") && sr(t, r);
|
|
1382
|
+
}
|
|
1383
|
+
function sr(t, e) {
|
|
1384
|
+
return t.isStaleByTime(e.staleTime);
|
|
1385
|
+
}
|
|
1386
|
+
var Ni = /* @__PURE__ */ function(t) {
|
|
1387
|
+
Ee(e, t);
|
|
1388
|
+
function e(n, i) {
|
|
1389
|
+
var a;
|
|
1390
|
+
return a = t.call(this) || this, a.client = n, a.setOptions(i), a.bindMethods(), a.updateResult(), a;
|
|
1391
|
+
}
|
|
1392
|
+
var r = e.prototype;
|
|
1393
|
+
return r.bindMethods = function() {
|
|
1394
|
+
this.mutate = this.mutate.bind(this), this.reset = this.reset.bind(this);
|
|
1395
|
+
}, r.setOptions = function(i) {
|
|
1396
|
+
this.options = this.client.defaultMutationOptions(i);
|
|
1397
|
+
}, r.onUnsubscribe = function() {
|
|
1398
|
+
if (!this.listeners.length) {
|
|
1399
|
+
var i;
|
|
1400
|
+
(i = this.currentMutation) == null || i.removeObserver(this);
|
|
1401
|
+
}
|
|
1402
|
+
}, r.onMutationUpdate = function(i) {
|
|
1403
|
+
this.updateResult();
|
|
1404
|
+
var a = {
|
|
1405
|
+
listeners: !0
|
|
1406
|
+
};
|
|
1407
|
+
i.type === "success" ? a.onSuccess = !0 : i.type === "error" && (a.onError = !0), this.notify(a);
|
|
1408
|
+
}, r.getCurrentResult = function() {
|
|
1409
|
+
return this.currentResult;
|
|
1410
|
+
}, r.reset = function() {
|
|
1411
|
+
this.currentMutation = void 0, this.updateResult(), this.notify({
|
|
1412
|
+
listeners: !0
|
|
1413
|
+
});
|
|
1414
|
+
}, r.mutate = function(i, a) {
|
|
1415
|
+
return this.mutateOptions = a, this.currentMutation && this.currentMutation.removeObserver(this), this.currentMutation = this.client.getMutationCache().build(this.client, w({}, this.options, {
|
|
1416
|
+
variables: typeof i < "u" ? i : this.options.variables
|
|
1417
|
+
})), this.currentMutation.addObserver(this), this.currentMutation.execute();
|
|
1418
|
+
}, r.updateResult = function() {
|
|
1419
|
+
var i = this.currentMutation ? this.currentMutation.state : Cn(), a = w({}, i, {
|
|
1420
|
+
isLoading: i.status === "loading",
|
|
1421
|
+
isSuccess: i.status === "success",
|
|
1422
|
+
isError: i.status === "error",
|
|
1423
|
+
isIdle: i.status === "idle",
|
|
1424
|
+
mutate: this.mutate,
|
|
1425
|
+
reset: this.reset
|
|
1426
|
+
});
|
|
1427
|
+
this.currentResult = a;
|
|
1428
|
+
}, r.notify = function(i) {
|
|
1429
|
+
var a = this;
|
|
1430
|
+
F.batch(function() {
|
|
1431
|
+
a.mutateOptions && (i.onSuccess ? (a.mutateOptions.onSuccess == null || a.mutateOptions.onSuccess(a.currentResult.data, a.currentResult.variables, a.currentResult.context), a.mutateOptions.onSettled == null || a.mutateOptions.onSettled(a.currentResult.data, null, a.currentResult.variables, a.currentResult.context)) : i.onError && (a.mutateOptions.onError == null || a.mutateOptions.onError(a.currentResult.error, a.currentResult.variables, a.currentResult.context), a.mutateOptions.onSettled == null || a.mutateOptions.onSettled(void 0, a.currentResult.error, a.currentResult.variables, a.currentResult.context))), i.listeners && a.listeners.forEach(function(s) {
|
|
1432
|
+
s(a.currentResult);
|
|
1433
|
+
});
|
|
1434
|
+
});
|
|
1435
|
+
}, e;
|
|
1436
|
+
}(Re), Li = di.unstable_batchedUpdates;
|
|
1437
|
+
F.setBatchNotifyFunction(Li);
|
|
1438
|
+
var Qi = console;
|
|
1439
|
+
Ci(Qi);
|
|
1440
|
+
var xr = /* @__PURE__ */ M.createContext(void 0), Fn = /* @__PURE__ */ M.createContext(!1);
|
|
1441
|
+
function xn(t) {
|
|
1442
|
+
return t && typeof window < "u" ? (window.ReactQueryClientContext || (window.ReactQueryClientContext = xr), window.ReactQueryClientContext) : xr;
|
|
1443
|
+
}
|
|
1444
|
+
var or = function() {
|
|
1445
|
+
var e = M.useContext(xn(M.useContext(Fn)));
|
|
1446
|
+
if (!e)
|
|
1447
|
+
throw new Error("No QueryClient set, use QueryClientProvider to set one");
|
|
1448
|
+
return e;
|
|
1449
|
+
}, ki = function(e) {
|
|
1450
|
+
var r = e.client, n = e.contextSharing, i = n === void 0 ? !1 : n, a = e.children;
|
|
1451
|
+
M.useEffect(function() {
|
|
1452
|
+
return r.mount(), function() {
|
|
1453
|
+
r.unmount();
|
|
1454
|
+
};
|
|
1455
|
+
}, [r]);
|
|
1456
|
+
var s = xn(i);
|
|
1457
|
+
return /* @__PURE__ */ M.createElement(Fn.Provider, {
|
|
1458
|
+
value: i
|
|
1459
|
+
}, /* @__PURE__ */ M.createElement(s.Provider, {
|
|
1460
|
+
value: r
|
|
1461
|
+
}, a));
|
|
1462
|
+
};
|
|
1463
|
+
function Bi() {
|
|
1464
|
+
var t = !1;
|
|
1465
|
+
return {
|
|
1466
|
+
clearReset: function() {
|
|
1467
|
+
t = !1;
|
|
1468
|
+
},
|
|
1469
|
+
reset: function() {
|
|
1470
|
+
t = !0;
|
|
1471
|
+
},
|
|
1472
|
+
isReset: function() {
|
|
1473
|
+
return t;
|
|
1474
|
+
}
|
|
1475
|
+
};
|
|
1476
|
+
}
|
|
1477
|
+
var ji = /* @__PURE__ */ M.createContext(Bi()), zi = function() {
|
|
1478
|
+
return M.useContext(ji);
|
|
1479
|
+
};
|
|
1480
|
+
function In(t, e, r) {
|
|
1481
|
+
return typeof e == "function" ? e.apply(void 0, r) : typeof e == "boolean" ? e : !!t;
|
|
1482
|
+
}
|
|
1483
|
+
function L(t, e, r) {
|
|
1484
|
+
var n = M.useRef(!1), i = M.useState(0), a = i[1], s = gi(t, e, r), o = or(), l = M.useRef();
|
|
1485
|
+
l.current ? l.current.setOptions(s) : l.current = new Ni(o, s);
|
|
1486
|
+
var f = l.current.getCurrentResult();
|
|
1487
|
+
M.useEffect(function() {
|
|
1488
|
+
n.current = !0;
|
|
1489
|
+
var u = l.current.subscribe(F.batchCalls(function() {
|
|
1490
|
+
n.current && a(function(h) {
|
|
1491
|
+
return h + 1;
|
|
1492
|
+
});
|
|
1493
|
+
}));
|
|
1494
|
+
return function() {
|
|
1495
|
+
n.current = !1, u();
|
|
1496
|
+
};
|
|
1497
|
+
}, []);
|
|
1498
|
+
var c = M.useCallback(function(u, h) {
|
|
1499
|
+
l.current.mutate(u, h).catch(U);
|
|
1500
|
+
}, []);
|
|
1501
|
+
if (f.error && In(void 0, l.current.options.useErrorBoundary, [f.error]))
|
|
1502
|
+
throw f.error;
|
|
1503
|
+
return w({}, f, {
|
|
1504
|
+
mutate: c,
|
|
1505
|
+
mutateAsync: f.mutate
|
|
1506
|
+
});
|
|
1507
|
+
}
|
|
1508
|
+
function Ki(t, e) {
|
|
1509
|
+
var r = M.useRef(!1), n = M.useState(0), i = n[1], a = or(), s = zi(), o = a.defaultQueryObserverOptions(t);
|
|
1510
|
+
o.optimisticResults = !0, o.onError && (o.onError = F.batchCalls(o.onError)), o.onSuccess && (o.onSuccess = F.batchCalls(o.onSuccess)), o.onSettled && (o.onSettled = F.batchCalls(o.onSettled)), o.suspense && (typeof o.staleTime != "number" && (o.staleTime = 1e3), o.cacheTime === 0 && (o.cacheTime = 1)), (o.suspense || o.useErrorBoundary) && (s.isReset() || (o.retryOnMount = !1));
|
|
1511
|
+
var l = M.useState(function() {
|
|
1512
|
+
return new e(a, o);
|
|
1513
|
+
}), f = l[0], c = f.getOptimisticResult(o);
|
|
1514
|
+
if (M.useEffect(function() {
|
|
1515
|
+
r.current = !0, s.clearReset();
|
|
1516
|
+
var u = f.subscribe(F.batchCalls(function() {
|
|
1517
|
+
r.current && i(function(h) {
|
|
1518
|
+
return h + 1;
|
|
1519
|
+
});
|
|
1520
|
+
}));
|
|
1521
|
+
return f.updateResult(), function() {
|
|
1522
|
+
r.current = !1, u();
|
|
1523
|
+
};
|
|
1524
|
+
}, [s, f]), M.useEffect(function() {
|
|
1525
|
+
f.setOptions(o, {
|
|
1526
|
+
listeners: !1
|
|
1527
|
+
});
|
|
1528
|
+
}, [o, f]), o.suspense && c.isLoading)
|
|
1529
|
+
throw f.fetchOptimistic(o).then(function(u) {
|
|
1530
|
+
var h = u.data;
|
|
1531
|
+
o.onSuccess == null || o.onSuccess(h), o.onSettled == null || o.onSettled(h, null);
|
|
1532
|
+
}).catch(function(u) {
|
|
1533
|
+
s.clearReset(), o.onError == null || o.onError(u), o.onSettled == null || o.onSettled(void 0, u);
|
|
1534
|
+
});
|
|
1535
|
+
if (c.isError && !s.isReset() && !c.isFetching && In(o.suspense, o.useErrorBoundary, [c.error, f.getCurrentQuery()]))
|
|
1536
|
+
throw c.error;
|
|
1537
|
+
return o.notifyOnChangeProps === "tracked" && (c = f.trackResult(c, o)), c;
|
|
1538
|
+
}
|
|
1539
|
+
function z(t, e, r) {
|
|
1540
|
+
var n = Qe(t, e, r);
|
|
1541
|
+
return Ki(n, Ti);
|
|
1542
|
+
}
|
|
1543
|
+
const Wi = (t) => new Promise((e) => {
|
|
1544
|
+
setTimeout(() => e(!0), t);
|
|
1545
|
+
}), E = (t) => t.forEach(console.log);
|
|
1546
|
+
var kt = { trace: 10, debug: 20, info: 30, warn: 40, error: 50, fatal: 60 }, ur = {};
|
|
1547
|
+
function ct(t) {
|
|
1548
|
+
return typeof t == "string" ? kt[t.toLowerCase()] : t;
|
|
1549
|
+
}
|
|
1550
|
+
function Bt(t, e) {
|
|
1551
|
+
return Bt = Object.setPrototypeOf || function(r, n) {
|
|
1552
|
+
return r.__proto__ = n, r;
|
|
1553
|
+
}, Bt(t, e);
|
|
1554
|
+
}
|
|
1555
|
+
function Gi() {
|
|
1556
|
+
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham)
|
|
1557
|
+
return !1;
|
|
1558
|
+
if (typeof Proxy == "function")
|
|
1559
|
+
return !0;
|
|
1560
|
+
try {
|
|
1561
|
+
return Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
1562
|
+
})), !0;
|
|
1563
|
+
} catch {
|
|
1564
|
+
return !1;
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
function jt(t, e, r) {
|
|
1568
|
+
return jt = Gi() ? Reflect.construct : function(n, i, a) {
|
|
1569
|
+
var s = [null];
|
|
1570
|
+
s.push.apply(s, i);
|
|
1571
|
+
var o = new (Function.bind.apply(n, s))();
|
|
1572
|
+
return a && Bt(o, a.prototype), o;
|
|
1573
|
+
}, jt.apply(null, arguments);
|
|
1574
|
+
}
|
|
1575
|
+
function le(t) {
|
|
1576
|
+
if (t == null)
|
|
1577
|
+
return t;
|
|
1578
|
+
if (Array.isArray(t))
|
|
1579
|
+
return t.slice();
|
|
1580
|
+
if (typeof t == "object") {
|
|
1581
|
+
var e = {};
|
|
1582
|
+
return Object.keys(t).forEach(function(r) {
|
|
1583
|
+
e[r] = t[r];
|
|
1584
|
+
}), e;
|
|
1585
|
+
}
|
|
1586
|
+
return t;
|
|
1587
|
+
}
|
|
1588
|
+
function zt(t) {
|
|
1589
|
+
return t === void 0 ? "undefined" : t === null ? "null" : Array.isArray(t) ? "[ " + t.map(function(e) {
|
|
1590
|
+
return zt(e);
|
|
1591
|
+
}).join(", ") + " ]" : typeof t == "object" ? JSON.stringify(t) : typeof t == "function" ? "[Function: " + t.name + "]" : typeof t == "boolean" || typeof t == "number" ? t : "'" + t.toString() + "'";
|
|
1592
|
+
}
|
|
1593
|
+
function ue(t) {
|
|
1594
|
+
if (typeof t != "string") {
|
|
1595
|
+
for (var e = new Array(arguments.length), r = 0; r < arguments.length; r++)
|
|
1596
|
+
e[r] = zt(arguments[r]);
|
|
1597
|
+
return e.join(" ");
|
|
1598
|
+
}
|
|
1599
|
+
for (var n = /%[sdj%]/g, i = 1, a = arguments, s = a.length, o = String(t).replace(n, function(f) {
|
|
1600
|
+
if (f === "%%")
|
|
1601
|
+
return "%";
|
|
1602
|
+
if (i >= s)
|
|
1603
|
+
return f;
|
|
1604
|
+
switch (f) {
|
|
1605
|
+
case "%s":
|
|
1606
|
+
return String(a[i++]);
|
|
1607
|
+
case "%d":
|
|
1608
|
+
return Number(a[i++]);
|
|
1609
|
+
case "%j":
|
|
1610
|
+
try {
|
|
1611
|
+
return JSON.stringify(a[i++]);
|
|
1612
|
+
} catch {
|
|
1613
|
+
return "[Circular]";
|
|
1614
|
+
}
|
|
1615
|
+
default:
|
|
1616
|
+
return f;
|
|
1617
|
+
}
|
|
1618
|
+
}), l = a[i]; i < s; l = a[++i])
|
|
1619
|
+
o += l === null || typeof l != "object" ? " " + l : " " + zt(l);
|
|
1620
|
+
return o;
|
|
1621
|
+
}
|
|
1622
|
+
function Hi(t, e) {
|
|
1623
|
+
var r = t.split(`
|
|
1624
|
+
`);
|
|
1625
|
+
r[0] && r[0].indexOf("call-stack-error") >= 0 && r.shift();
|
|
1626
|
+
var n = r[e], i = null;
|
|
1627
|
+
if (n) {
|
|
1628
|
+
var a = /^\s*(at|.*@)\s*(.+)?$/.exec(n);
|
|
1629
|
+
i = Array.isArray(a) && a[2] ? a[2] : n;
|
|
1630
|
+
}
|
|
1631
|
+
return i;
|
|
1632
|
+
}
|
|
1633
|
+
Object.keys(kt).forEach(function(t) {
|
|
1634
|
+
ur[kt[t]] = t;
|
|
1635
|
+
});
|
|
1636
|
+
var Kt = {};
|
|
1637
|
+
function Wt(t, e) {
|
|
1638
|
+
if (e) {
|
|
1639
|
+
if (Kt[e])
|
|
1640
|
+
return;
|
|
1641
|
+
Kt[e] = !0;
|
|
1642
|
+
}
|
|
1643
|
+
console.error(t + `
|
|
1644
|
+
`);
|
|
1645
|
+
}
|
|
1646
|
+
function Vi(t) {
|
|
1647
|
+
return Kt[t];
|
|
1648
|
+
}
|
|
1649
|
+
function Ji() {
|
|
1650
|
+
var t = [];
|
|
1651
|
+
return function(e, r) {
|
|
1652
|
+
return r && typeof r == "object" ? t.indexOf(r) !== -1 ? "[Circular]" : (t.push(r), r) : r;
|
|
1653
|
+
};
|
|
1654
|
+
}
|
|
1655
|
+
var Xi = /* @__PURE__ */ function() {
|
|
1656
|
+
function t() {
|
|
1657
|
+
}
|
|
1658
|
+
return t.prototype.write = function(e) {
|
|
1659
|
+
e.level < 30 ? console.log(e) : e.level < 40 ? console.info(e) : e.level < 50 ? console.warn(e) : console.error(e), e.err && e.err.stack && console.error(e.err.stack), e.obj && console.log(e.obj);
|
|
1660
|
+
}, t;
|
|
1661
|
+
}(), ce = /* @__PURE__ */ function() {
|
|
1662
|
+
function t(r, n, i) {
|
|
1663
|
+
var a, s, o, l, f = this;
|
|
1664
|
+
if (!(this instanceof t))
|
|
1665
|
+
return new t(r, n);
|
|
1666
|
+
if (n !== void 0 && (a = r, r = n, !(a instanceof t)))
|
|
1667
|
+
throw new TypeError("invalid Logger creation: do not pass a second arg");
|
|
1668
|
+
if (!r)
|
|
1669
|
+
throw new TypeError("options (object) is required");
|
|
1670
|
+
if (a) {
|
|
1671
|
+
if (r.name)
|
|
1672
|
+
throw new TypeError("invalid options.name: child cannot set logger name");
|
|
1673
|
+
} else if (!r.name)
|
|
1674
|
+
throw new TypeError("options.name (string) is required");
|
|
1675
|
+
if (r.stream && r.streams)
|
|
1676
|
+
throw new TypeError('cannot mix "streams" and "stream" options');
|
|
1677
|
+
if (r.streams && !Array.isArray(r.streams))
|
|
1678
|
+
throw new TypeError("invalid options.streams: must be an array");
|
|
1679
|
+
if (r.serializers && (typeof r.serializers != "object" || Array.isArray(r.serializers)))
|
|
1680
|
+
throw new TypeError("invalid options.serializers: must be an object");
|
|
1681
|
+
if (a && i) {
|
|
1682
|
+
this._level = a._level, this.streams = a.streams, this.serializers = a.serializers, this.src = a.src, s = this.fields = {};
|
|
1683
|
+
var c = Object.keys(a.fields);
|
|
1684
|
+
for (l = 0; l < c.length; l++)
|
|
1685
|
+
s[o = c[l]] = a.fields[o];
|
|
1686
|
+
var u = Object.keys(r);
|
|
1687
|
+
for (l = 0; l < u.length; l++)
|
|
1688
|
+
s[o = u[l]] = r[o];
|
|
1689
|
+
} else {
|
|
1690
|
+
if (a) {
|
|
1691
|
+
for (this._level = a._level, this.streams = [], l = 0; l < a.streams.length; l++) {
|
|
1692
|
+
var h = le(a.streams[l]);
|
|
1693
|
+
this.streams.push(h);
|
|
1694
|
+
}
|
|
1695
|
+
this.serializers = le(a.serializers), this.src = a.src, this.fields = le(a.fields), r.level && this.level(r.level);
|
|
1696
|
+
} else
|
|
1697
|
+
this._level = Number.POSITIVE_INFINITY, this.streams = [], this.serializers = null, this.src = !1, this.fields = {};
|
|
1698
|
+
r.stream ? this.addStream({ type: "stream", stream: r.stream, level: r.level }) : r.streams ? r.streams.forEach(function(d) {
|
|
1699
|
+
f.addStream(d, r.level);
|
|
1700
|
+
}) : a && r.level ? this.level(r.level) : a || this.addStream({ type: "raw", stream: new Xi(), level: r.level }), r.serializers && this.addSerializers(r.serializers), r.src && (this.src = !0), delete (s = le(r)).stream, delete s.level, delete s.streams, delete s.serializers, delete s.src, this.serializers && this._applySerializers(s), Object.keys(s).forEach(function(d) {
|
|
1701
|
+
f.fields[d] = s[d];
|
|
1702
|
+
});
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
var e = t.prototype;
|
|
1706
|
+
return e.addStream = function(r, n) {
|
|
1707
|
+
n === void 0 && (n = 30), (r = le(r)).type = "raw", r.level = ct(r.level || n), r.level < this._level && (this._level = r.level), this.streams.push(r), delete this.haveNonRawStreams;
|
|
1708
|
+
}, e.addSerializers = function(r) {
|
|
1709
|
+
var n = this;
|
|
1710
|
+
this.serializers || (this.serializers = {}), Object.keys(r).forEach(function(i) {
|
|
1711
|
+
var a = r[i];
|
|
1712
|
+
if (typeof a != "function")
|
|
1713
|
+
throw new TypeError(ue('invalid serializer for "%s" field: must be a function', i));
|
|
1714
|
+
n.serializers[i] = a;
|
|
1715
|
+
});
|
|
1716
|
+
}, e.child = function(r, n) {
|
|
1717
|
+
return new this.constructor(this, r || {}, n);
|
|
1718
|
+
}, e.level = function(r) {
|
|
1719
|
+
if (r === void 0)
|
|
1720
|
+
return this._level;
|
|
1721
|
+
for (var n = ct(r), i = this.streams.length, a = 0; a < i; a++)
|
|
1722
|
+
this.streams[a].level = n;
|
|
1723
|
+
this._level = n;
|
|
1724
|
+
}, e.levels = function(r, n) {
|
|
1725
|
+
if (r === void 0)
|
|
1726
|
+
return this.streams.map(function(f) {
|
|
1727
|
+
return f.level;
|
|
1728
|
+
});
|
|
1729
|
+
var i;
|
|
1730
|
+
if (typeof r == "number") {
|
|
1731
|
+
if ((i = this.streams[r]) === void 0)
|
|
1732
|
+
throw new Error("invalid stream index: " + r);
|
|
1733
|
+
} else {
|
|
1734
|
+
for (var a = this.streams.length, s = 0; s < a; s++) {
|
|
1735
|
+
var o = this.streams[s];
|
|
1736
|
+
if (o.name === r) {
|
|
1737
|
+
i = o;
|
|
1738
|
+
break;
|
|
1739
|
+
}
|
|
1740
|
+
}
|
|
1741
|
+
if (!i)
|
|
1742
|
+
throw new Error(ue('no stream with name "%s"', r));
|
|
1743
|
+
}
|
|
1744
|
+
if (n === void 0)
|
|
1745
|
+
return i.level;
|
|
1746
|
+
var l = ct(n);
|
|
1747
|
+
i.level = l, l < this._level && (this._level = l);
|
|
1748
|
+
}, e._applySerializers = function(r, n) {
|
|
1749
|
+
var i = this;
|
|
1750
|
+
Object.keys(this.serializers).forEach(function(a) {
|
|
1751
|
+
if (!(r[a] === void 0 || n && n[a]))
|
|
1752
|
+
try {
|
|
1753
|
+
r[a] = i.serializers[a](r[a]);
|
|
1754
|
+
} catch (s) {
|
|
1755
|
+
Wt(ue(`bunyan: ERROR: Exception thrown from the "%s" Bunyan serializer. This should never happen. This is a bugin that serializer function.
|
|
1756
|
+
%s`, a, s.stack || s)), r[a] = ue('(Error in Bunyan log "%s" serializer broke field. See stderr for details.)', a);
|
|
1757
|
+
}
|
|
1758
|
+
});
|
|
1759
|
+
}, e._emit = function(r, n) {
|
|
1760
|
+
var i, a;
|
|
1761
|
+
if (this.haveNonRawStreams === void 0) {
|
|
1762
|
+
for (this.haveNonRawStreams = !1, i = 0; i < this.streams.length; i++)
|
|
1763
|
+
if (!this.streams[i].raw) {
|
|
1764
|
+
this.haveNonRawStreams = !0;
|
|
1765
|
+
break;
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
if (n || this.haveNonRawStreams)
|
|
1769
|
+
try {
|
|
1770
|
+
a = JSON.stringify(r, Ji()) + `
|
|
1771
|
+
`;
|
|
1772
|
+
} catch (f) {
|
|
1773
|
+
var s = f.stack.split(/\n/g, 2).join(`
|
|
1774
|
+
`);
|
|
1775
|
+
Wt('bunyan: ERROR: Exception in `JSON.stringify(rec)`. You can install the "safe-json-stringify" module to have Bunyan fallback to safer stringification. Record:\n' + function(c, u) {
|
|
1776
|
+
return u || (u = " "), u + c.split(/\r?\n/g).join(`
|
|
1777
|
+
` + u);
|
|
1778
|
+
}(ue(`%s
|
|
1779
|
+
%s`, r, f.stack)), s), a = ue(`(Exception in JSON.stringify(rec): %j. See stderr for details.)
|
|
1780
|
+
`, f.message);
|
|
1781
|
+
}
|
|
1782
|
+
if (n)
|
|
1783
|
+
return a;
|
|
1784
|
+
var o = r.level;
|
|
1785
|
+
for (i = 0; i < this.streams.length; i++) {
|
|
1786
|
+
var l = this.streams[i];
|
|
1787
|
+
l.level <= o && l.stream.write(r);
|
|
1788
|
+
}
|
|
1789
|
+
return a;
|
|
1790
|
+
}, t;
|
|
1791
|
+
}();
|
|
1792
|
+
function ye(t) {
|
|
1793
|
+
return function() {
|
|
1794
|
+
var e = this;
|
|
1795
|
+
function r(s) {
|
|
1796
|
+
var o;
|
|
1797
|
+
s[0] instanceof Error ? (n = { err: e.serializers && e.serializers.err ? e.serializers.err(s[0]) : cr.err(s[0]) }, o = { err: !0 }, i = s.length === 1 ? [n.err.message] : Array.prototype.slice.call(s, 1)) : typeof s[0] != "object" && s[0] !== null || Array.isArray(s[0]) ? (n = null, i = Array.prototype.slice.call(s)) : (n = s[0], i = s.length === 1 && n.err && n.err instanceof Error ? [n.err.message] : Array.prototype.slice.call(s, 1));
|
|
1798
|
+
var l = le(e.fields);
|
|
1799
|
+
l.level = t;
|
|
1800
|
+
var f = n ? le(n) : null;
|
|
1801
|
+
if (f && (e.serializers && e._applySerializers(f, o), Object.keys(f).forEach(function(u) {
|
|
1802
|
+
l[u] = f[u];
|
|
1803
|
+
})), l.levelName = ur[t], l.msg = i.length ? ue.apply(e, i) : "", l.time || (l.time = new Date()), e.src && !l.src)
|
|
1804
|
+
try {
|
|
1805
|
+
throw new Error("call-stack-error");
|
|
1806
|
+
} catch (u) {
|
|
1807
|
+
var c = u.stack ? Hi(u.stack, 2) : "";
|
|
1808
|
+
c || Vi("src") || Wt("Unable to determine src line info", "src"), l.src = c || "";
|
|
1809
|
+
}
|
|
1810
|
+
return l.v = 1, l;
|
|
1811
|
+
}
|
|
1812
|
+
var n = null, i = arguments, a = null;
|
|
1813
|
+
if (arguments.length === 0)
|
|
1814
|
+
return this._level <= t;
|
|
1815
|
+
this._level > t || (a = r(i), this._emit(a));
|
|
1816
|
+
};
|
|
1817
|
+
}
|
|
1818
|
+
function _n(t) {
|
|
1819
|
+
var e = t.stack || t.toString();
|
|
1820
|
+
if (t.cause && typeof t.cause == "function") {
|
|
1821
|
+
var r = t.cause();
|
|
1822
|
+
r && (e += `
|
|
1823
|
+
Caused by: ` + _n(r));
|
|
1824
|
+
}
|
|
1825
|
+
return e;
|
|
1826
|
+
}
|
|
1827
|
+
ce.prototype.trace = ye(10), ce.prototype.debug = ye(20), ce.prototype.info = ye(30), ce.prototype.warn = ye(40), ce.prototype.error = ye(50), ce.prototype.fatal = ye(60);
|
|
1828
|
+
var cr = { err: function(t) {
|
|
1829
|
+
return t && t.stack ? { message: t.message, name: t.name, stack: _n(t), code: t.code, signal: t.signal } : t;
|
|
1830
|
+
} };
|
|
1831
|
+
function qn() {
|
|
1832
|
+
return jt(ce, [].slice.call(arguments));
|
|
1833
|
+
}
|
|
1834
|
+
var Ir = { levels: { trace: "color: DeepPink", debug: "color: GoldenRod", info: "color: DarkTurquoise", warn: "color: Purple", error: "color: Crimson", fatal: "color: Black" }, def: "color: DimGray", msg: "color: SteelBlue", src: "color: DimGray; font-style: italic; font-size: 0.9em" }, $n = /* @__PURE__ */ function() {
|
|
1835
|
+
function t(e) {
|
|
1836
|
+
var r = e === void 0 ? {} : e, n = r.logByLevel, i = r.css, a = i === void 0 ? Ir : i;
|
|
1837
|
+
this.logByLevel = n !== void 0 && n, this.css = a;
|
|
1838
|
+
}
|
|
1839
|
+
return t.prototype.write = function(e) {
|
|
1840
|
+
var r, n, i = this.css.def, a = this.css.msg, s = this.css.src, o = e.childName ? e.name + "/" + e.childName : e.name, l = ur[e.level], f = (Array(6 - l.length).join(" ") + l).toUpperCase();
|
|
1841
|
+
this.logByLevel ? (e.level === 10 ? l = "debug" : e.level === 60 && (l = "error"), n = typeof console[l] == "function" ? console[l] : console.log) : n = console.log, r = e.level < 20 ? this.css.levels.trace : e.level < 30 ? this.css.levels.debug : e.level < 40 ? this.css.levels.info : e.level < 50 ? this.css.levels.warn : e.level < 60 ? this.css.levels.error : this.css.levels.fatal;
|
|
1842
|
+
var c = function(h, d) {
|
|
1843
|
+
return Array(d + 1 - (h + "").length).join("0") + h;
|
|
1844
|
+
}, u = [];
|
|
1845
|
+
u.push("[%s:%s:%s:%s] %c%s%c: %s: %c%s " + (e.src ? "%c%s" : "")), u.push(c(e.time.getHours(), 2)), u.push(c(e.time.getMinutes(), 2)), u.push(c(e.time.getSeconds(), 2)), u.push(c(e.time.getMilliseconds(), 4)), u.push(r), u.push(f), u.push(i), u.push(o), u.push(a), u.push(e.msg), e.src && (u.push(s), u.push(e.src)), e.obj && (u.push(`
|
|
1846
|
+
`), u.push(e.obj)), e.err && e.err.stack && (u.push(`
|
|
1847
|
+
`), u.push(e.err.stack)), n.apply(console, u);
|
|
1848
|
+
}, t.getDefaultCss = function() {
|
|
1849
|
+
return Ir;
|
|
1850
|
+
}, t;
|
|
1851
|
+
}();
|
|
1852
|
+
const fu = qn({
|
|
1853
|
+
name: "shipengine",
|
|
1854
|
+
serializers: {
|
|
1855
|
+
...cr,
|
|
1856
|
+
req: (t) => ({
|
|
1857
|
+
headers: t.headers,
|
|
1858
|
+
method: t.method,
|
|
1859
|
+
url: t.url
|
|
1860
|
+
}),
|
|
1861
|
+
res: (t) => ({
|
|
1862
|
+
data: t.data,
|
|
1863
|
+
headers: t.config.headers,
|
|
1864
|
+
method: t.config.method,
|
|
1865
|
+
statusCode: t.status,
|
|
1866
|
+
url: t.config.url
|
|
1867
|
+
})
|
|
1868
|
+
},
|
|
1869
|
+
streams: [
|
|
1870
|
+
{
|
|
1871
|
+
stream: new $n()
|
|
1872
|
+
}
|
|
1873
|
+
]
|
|
1874
|
+
}), Yi = (t, e = 10, r = 1e3) => Promise.resolve().then(t).catch(function n(i) {
|
|
1875
|
+
if (e -= 1, e > 0)
|
|
1876
|
+
return Wi(r).then(t).catch(n);
|
|
1877
|
+
throw i;
|
|
1878
|
+
});
|
|
1879
|
+
class te {
|
|
1880
|
+
constructor(e, r) {
|
|
1881
|
+
this.errorCode = r?.errorCode ?? "unknown", this.errorSource = r?.errorSource ?? "client", this.errorType = r?.errorType ?? "unknown", this.message = e;
|
|
1882
|
+
}
|
|
1883
|
+
static fromObject({ message: e, ...r }) {
|
|
1884
|
+
return new te(e, r);
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
class Zi {
|
|
1888
|
+
constructor(e) {
|
|
1889
|
+
this.client = e, this.getAccountSettings = () => this.client.get("/v1/account/settings"), this.client = e;
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
class ea {
|
|
1893
|
+
constructor(e) {
|
|
1894
|
+
this.client = e, this.validate = (r) => this.client.post("/v1/addresses/validate", r), this.parse = (r, n) => this.client.put("/v1/addresses/recognize", {
|
|
1895
|
+
address: n,
|
|
1896
|
+
text: r
|
|
1897
|
+
}), this.client = e;
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
var Mn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
1901
|
+
function ta(t) {
|
|
1902
|
+
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
1903
|
+
}
|
|
1904
|
+
function ra(t) {
|
|
1905
|
+
if (t.__esModule)
|
|
1906
|
+
return t;
|
|
1907
|
+
var e = t.default;
|
|
1908
|
+
if (typeof e == "function") {
|
|
1909
|
+
var r = function n() {
|
|
1910
|
+
if (this instanceof n) {
|
|
1911
|
+
var i = [null];
|
|
1912
|
+
i.push.apply(i, arguments);
|
|
1913
|
+
var a = Function.bind.apply(e, i);
|
|
1914
|
+
return new a();
|
|
1915
|
+
}
|
|
1916
|
+
return e.apply(this, arguments);
|
|
1917
|
+
};
|
|
1918
|
+
r.prototype = e.prototype;
|
|
1919
|
+
} else
|
|
1920
|
+
r = {};
|
|
1921
|
+
return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(t).forEach(function(n) {
|
|
1922
|
+
var i = Object.getOwnPropertyDescriptor(t, n);
|
|
1923
|
+
Object.defineProperty(r, n, i.get ? i : {
|
|
1924
|
+
enumerable: !0,
|
|
1925
|
+
get: function() {
|
|
1926
|
+
return t[n];
|
|
1927
|
+
}
|
|
1928
|
+
});
|
|
1929
|
+
}), r;
|
|
1930
|
+
}
|
|
1931
|
+
var Gt = {}, na = {
|
|
1932
|
+
get exports() {
|
|
1933
|
+
return Gt;
|
|
1934
|
+
},
|
|
1935
|
+
set exports(t) {
|
|
1936
|
+
Gt = t;
|
|
1937
|
+
}
|
|
1938
|
+
}, Xe = {}, ia = {
|
|
1939
|
+
get exports() {
|
|
1940
|
+
return Xe;
|
|
1941
|
+
},
|
|
1942
|
+
set exports(t) {
|
|
1943
|
+
Xe = t;
|
|
1944
|
+
}
|
|
1945
|
+
}, Dn = function(e, r) {
|
|
1946
|
+
return function() {
|
|
1947
|
+
for (var i = new Array(arguments.length), a = 0; a < i.length; a++)
|
|
1948
|
+
i[a] = arguments[a];
|
|
1949
|
+
return e.apply(r, i);
|
|
1950
|
+
};
|
|
1951
|
+
}, aa = Dn, ae = Object.prototype.toString;
|
|
1952
|
+
function lr(t) {
|
|
1953
|
+
return Array.isArray(t);
|
|
1954
|
+
}
|
|
1955
|
+
function Ht(t) {
|
|
1956
|
+
return typeof t > "u";
|
|
1957
|
+
}
|
|
1958
|
+
function sa(t) {
|
|
1959
|
+
return t !== null && !Ht(t) && t.constructor !== null && !Ht(t.constructor) && typeof t.constructor.isBuffer == "function" && t.constructor.isBuffer(t);
|
|
1960
|
+
}
|
|
1961
|
+
function Tn(t) {
|
|
1962
|
+
return ae.call(t) === "[object ArrayBuffer]";
|
|
1963
|
+
}
|
|
1964
|
+
function oa(t) {
|
|
1965
|
+
return ae.call(t) === "[object FormData]";
|
|
1966
|
+
}
|
|
1967
|
+
function ua(t) {
|
|
1968
|
+
var e;
|
|
1969
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && Tn(t.buffer), e;
|
|
1970
|
+
}
|
|
1971
|
+
function ca(t) {
|
|
1972
|
+
return typeof t == "string";
|
|
1973
|
+
}
|
|
1974
|
+
function la(t) {
|
|
1975
|
+
return typeof t == "number";
|
|
1976
|
+
}
|
|
1977
|
+
function Un(t) {
|
|
1978
|
+
return t !== null && typeof t == "object";
|
|
1979
|
+
}
|
|
1980
|
+
function je(t) {
|
|
1981
|
+
if (ae.call(t) !== "[object Object]")
|
|
1982
|
+
return !1;
|
|
1983
|
+
var e = Object.getPrototypeOf(t);
|
|
1984
|
+
return e === null || e === Object.prototype;
|
|
1985
|
+
}
|
|
1986
|
+
function fa(t) {
|
|
1987
|
+
return ae.call(t) === "[object Date]";
|
|
1988
|
+
}
|
|
1989
|
+
function ha(t) {
|
|
1990
|
+
return ae.call(t) === "[object File]";
|
|
1991
|
+
}
|
|
1992
|
+
function da(t) {
|
|
1993
|
+
return ae.call(t) === "[object Blob]";
|
|
1994
|
+
}
|
|
1995
|
+
function Nn(t) {
|
|
1996
|
+
return ae.call(t) === "[object Function]";
|
|
1997
|
+
}
|
|
1998
|
+
function pa(t) {
|
|
1999
|
+
return Un(t) && Nn(t.pipe);
|
|
2000
|
+
}
|
|
2001
|
+
function ya(t) {
|
|
2002
|
+
return ae.call(t) === "[object URLSearchParams]";
|
|
2003
|
+
}
|
|
2004
|
+
function va(t) {
|
|
2005
|
+
return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "");
|
|
2006
|
+
}
|
|
2007
|
+
function ma() {
|
|
2008
|
+
return typeof navigator < "u" && (navigator.product === "ReactNative" || navigator.product === "NativeScript" || navigator.product === "NS") ? !1 : typeof window < "u" && typeof document < "u";
|
|
2009
|
+
}
|
|
2010
|
+
function fr(t, e) {
|
|
2011
|
+
if (!(t === null || typeof t > "u"))
|
|
2012
|
+
if (typeof t != "object" && (t = [t]), lr(t))
|
|
2013
|
+
for (var r = 0, n = t.length; r < n; r++)
|
|
2014
|
+
e.call(null, t[r], r, t);
|
|
2015
|
+
else
|
|
2016
|
+
for (var i in t)
|
|
2017
|
+
Object.prototype.hasOwnProperty.call(t, i) && e.call(null, t[i], i, t);
|
|
2018
|
+
}
|
|
2019
|
+
function Vt() {
|
|
2020
|
+
var t = {};
|
|
2021
|
+
function e(i, a) {
|
|
2022
|
+
je(t[a]) && je(i) ? t[a] = Vt(t[a], i) : je(i) ? t[a] = Vt({}, i) : lr(i) ? t[a] = i.slice() : t[a] = i;
|
|
2023
|
+
}
|
|
2024
|
+
for (var r = 0, n = arguments.length; r < n; r++)
|
|
2025
|
+
fr(arguments[r], e);
|
|
2026
|
+
return t;
|
|
2027
|
+
}
|
|
2028
|
+
function ga(t, e, r) {
|
|
2029
|
+
return fr(e, function(i, a) {
|
|
2030
|
+
r && typeof i == "function" ? t[a] = aa(i, r) : t[a] = i;
|
|
2031
|
+
}), t;
|
|
2032
|
+
}
|
|
2033
|
+
function ba(t) {
|
|
2034
|
+
return t.charCodeAt(0) === 65279 && (t = t.slice(1)), t;
|
|
2035
|
+
}
|
|
2036
|
+
var K = {
|
|
2037
|
+
isArray: lr,
|
|
2038
|
+
isArrayBuffer: Tn,
|
|
2039
|
+
isBuffer: sa,
|
|
2040
|
+
isFormData: oa,
|
|
2041
|
+
isArrayBufferView: ua,
|
|
2042
|
+
isString: ca,
|
|
2043
|
+
isNumber: la,
|
|
2044
|
+
isObject: Un,
|
|
2045
|
+
isPlainObject: je,
|
|
2046
|
+
isUndefined: Ht,
|
|
2047
|
+
isDate: fa,
|
|
2048
|
+
isFile: ha,
|
|
2049
|
+
isBlob: da,
|
|
2050
|
+
isFunction: Nn,
|
|
2051
|
+
isStream: pa,
|
|
2052
|
+
isURLSearchParams: ya,
|
|
2053
|
+
isStandardBrowserEnv: ma,
|
|
2054
|
+
forEach: fr,
|
|
2055
|
+
merge: Vt,
|
|
2056
|
+
extend: ga,
|
|
2057
|
+
trim: va,
|
|
2058
|
+
stripBOM: ba
|
|
2059
|
+
}, ve = K;
|
|
2060
|
+
function _r(t) {
|
|
2061
|
+
return encodeURIComponent(t).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
2062
|
+
}
|
|
2063
|
+
var Ln = function(e, r, n) {
|
|
2064
|
+
if (!r)
|
|
2065
|
+
return e;
|
|
2066
|
+
var i;
|
|
2067
|
+
if (n)
|
|
2068
|
+
i = n(r);
|
|
2069
|
+
else if (ve.isURLSearchParams(r))
|
|
2070
|
+
i = r.toString();
|
|
2071
|
+
else {
|
|
2072
|
+
var a = [];
|
|
2073
|
+
ve.forEach(r, function(l, f) {
|
|
2074
|
+
l === null || typeof l > "u" || (ve.isArray(l) ? f = f + "[]" : l = [l], ve.forEach(l, function(u) {
|
|
2075
|
+
ve.isDate(u) ? u = u.toISOString() : ve.isObject(u) && (u = JSON.stringify(u)), a.push(_r(f) + "=" + _r(u));
|
|
2076
|
+
}));
|
|
2077
|
+
}), i = a.join("&");
|
|
2078
|
+
}
|
|
2079
|
+
if (i) {
|
|
2080
|
+
var s = e.indexOf("#");
|
|
2081
|
+
s !== -1 && (e = e.slice(0, s)), e += (e.indexOf("?") === -1 ? "?" : "&") + i;
|
|
2082
|
+
}
|
|
2083
|
+
return e;
|
|
2084
|
+
}, Sa = K;
|
|
2085
|
+
function nt() {
|
|
2086
|
+
this.handlers = [];
|
|
2087
|
+
}
|
|
2088
|
+
nt.prototype.use = function(e, r, n) {
|
|
2089
|
+
return this.handlers.push({
|
|
2090
|
+
fulfilled: e,
|
|
2091
|
+
rejected: r,
|
|
2092
|
+
synchronous: n ? n.synchronous : !1,
|
|
2093
|
+
runWhen: n ? n.runWhen : null
|
|
2094
|
+
}), this.handlers.length - 1;
|
|
2095
|
+
};
|
|
2096
|
+
nt.prototype.eject = function(e) {
|
|
2097
|
+
this.handlers[e] && (this.handlers[e] = null);
|
|
2098
|
+
};
|
|
2099
|
+
nt.prototype.forEach = function(e) {
|
|
2100
|
+
Sa.forEach(this.handlers, function(n) {
|
|
2101
|
+
n !== null && e(n);
|
|
2102
|
+
});
|
|
2103
|
+
};
|
|
2104
|
+
var wa = nt, Oa = K, Pa = function(e, r) {
|
|
2105
|
+
Oa.forEach(e, function(i, a) {
|
|
2106
|
+
a !== r && a.toUpperCase() === r.toUpperCase() && (e[r] = i, delete e[a]);
|
|
2107
|
+
});
|
|
2108
|
+
}, Qn = function(e, r, n, i, a) {
|
|
2109
|
+
return e.config = r, n && (e.code = n), e.request = i, e.response = a, e.isAxiosError = !0, e.toJSON = function() {
|
|
2110
|
+
return {
|
|
2111
|
+
// Standard
|
|
2112
|
+
message: this.message,
|
|
2113
|
+
name: this.name,
|
|
2114
|
+
// Microsoft
|
|
2115
|
+
description: this.description,
|
|
2116
|
+
number: this.number,
|
|
2117
|
+
// Mozilla
|
|
2118
|
+
fileName: this.fileName,
|
|
2119
|
+
lineNumber: this.lineNumber,
|
|
2120
|
+
columnNumber: this.columnNumber,
|
|
2121
|
+
stack: this.stack,
|
|
2122
|
+
// Axios
|
|
2123
|
+
config: this.config,
|
|
2124
|
+
code: this.code,
|
|
2125
|
+
status: this.response && this.response.status ? this.response.status : null
|
|
2126
|
+
};
|
|
2127
|
+
}, e;
|
|
2128
|
+
}, kn = {
|
|
2129
|
+
silentJSONParsing: !0,
|
|
2130
|
+
forcedJSONParsing: !0,
|
|
2131
|
+
clarifyTimeoutError: !1
|
|
2132
|
+
}, lt, qr;
|
|
2133
|
+
function Bn() {
|
|
2134
|
+
if (qr)
|
|
2135
|
+
return lt;
|
|
2136
|
+
qr = 1;
|
|
2137
|
+
var t = Qn;
|
|
2138
|
+
return lt = function(r, n, i, a, s) {
|
|
2139
|
+
var o = new Error(r);
|
|
2140
|
+
return t(o, n, i, a, s);
|
|
2141
|
+
}, lt;
|
|
2142
|
+
}
|
|
2143
|
+
var ft, $r;
|
|
2144
|
+
function Ea() {
|
|
2145
|
+
if ($r)
|
|
2146
|
+
return ft;
|
|
2147
|
+
$r = 1;
|
|
2148
|
+
var t = Bn();
|
|
2149
|
+
return ft = function(r, n, i) {
|
|
2150
|
+
var a = i.config.validateStatus;
|
|
2151
|
+
!i.status || !a || a(i.status) ? r(i) : n(t(
|
|
2152
|
+
"Request failed with status code " + i.status,
|
|
2153
|
+
i.config,
|
|
2154
|
+
null,
|
|
2155
|
+
i.request,
|
|
2156
|
+
i
|
|
2157
|
+
));
|
|
2158
|
+
}, ft;
|
|
2159
|
+
}
|
|
2160
|
+
var ht, Mr;
|
|
2161
|
+
function Ra() {
|
|
2162
|
+
if (Mr)
|
|
2163
|
+
return ht;
|
|
2164
|
+
Mr = 1;
|
|
2165
|
+
var t = K;
|
|
2166
|
+
return ht = t.isStandardBrowserEnv() ? (
|
|
2167
|
+
// Standard browser envs support document.cookie
|
|
2168
|
+
function() {
|
|
2169
|
+
return {
|
|
2170
|
+
write: function(n, i, a, s, o, l) {
|
|
2171
|
+
var f = [];
|
|
2172
|
+
f.push(n + "=" + encodeURIComponent(i)), t.isNumber(a) && f.push("expires=" + new Date(a).toGMTString()), t.isString(s) && f.push("path=" + s), t.isString(o) && f.push("domain=" + o), l === !0 && f.push("secure"), document.cookie = f.join("; ");
|
|
2173
|
+
},
|
|
2174
|
+
read: function(n) {
|
|
2175
|
+
var i = document.cookie.match(new RegExp("(^|;\\s*)(" + n + ")=([^;]*)"));
|
|
2176
|
+
return i ? decodeURIComponent(i[3]) : null;
|
|
2177
|
+
},
|
|
2178
|
+
remove: function(n) {
|
|
2179
|
+
this.write(n, "", Date.now() - 864e5);
|
|
2180
|
+
}
|
|
2181
|
+
};
|
|
2182
|
+
}()
|
|
2183
|
+
) : (
|
|
2184
|
+
// Non standard browser env (web workers, react-native) lack needed support.
|
|
2185
|
+
function() {
|
|
2186
|
+
return {
|
|
2187
|
+
write: function() {
|
|
2188
|
+
},
|
|
2189
|
+
read: function() {
|
|
2190
|
+
return null;
|
|
2191
|
+
},
|
|
2192
|
+
remove: function() {
|
|
2193
|
+
}
|
|
2194
|
+
};
|
|
2195
|
+
}()
|
|
2196
|
+
), ht;
|
|
2197
|
+
}
|
|
2198
|
+
var dt, Dr;
|
|
2199
|
+
function Aa() {
|
|
2200
|
+
return Dr || (Dr = 1, dt = function(e) {
|
|
2201
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);
|
|
2202
|
+
}), dt;
|
|
2203
|
+
}
|
|
2204
|
+
var pt, Tr;
|
|
2205
|
+
function Ca() {
|
|
2206
|
+
return Tr || (Tr = 1, pt = function(e, r) {
|
|
2207
|
+
return r ? e.replace(/\/+$/, "") + "/" + r.replace(/^\/+/, "") : e;
|
|
2208
|
+
}), pt;
|
|
2209
|
+
}
|
|
2210
|
+
var yt, Ur;
|
|
2211
|
+
function Fa() {
|
|
2212
|
+
if (Ur)
|
|
2213
|
+
return yt;
|
|
2214
|
+
Ur = 1;
|
|
2215
|
+
var t = Aa(), e = Ca();
|
|
2216
|
+
return yt = function(n, i) {
|
|
2217
|
+
return n && !t(i) ? e(n, i) : i;
|
|
2218
|
+
}, yt;
|
|
2219
|
+
}
|
|
2220
|
+
var vt, Nr;
|
|
2221
|
+
function xa() {
|
|
2222
|
+
if (Nr)
|
|
2223
|
+
return vt;
|
|
2224
|
+
Nr = 1;
|
|
2225
|
+
var t = K, e = [
|
|
2226
|
+
"age",
|
|
2227
|
+
"authorization",
|
|
2228
|
+
"content-length",
|
|
2229
|
+
"content-type",
|
|
2230
|
+
"etag",
|
|
2231
|
+
"expires",
|
|
2232
|
+
"from",
|
|
2233
|
+
"host",
|
|
2234
|
+
"if-modified-since",
|
|
2235
|
+
"if-unmodified-since",
|
|
2236
|
+
"last-modified",
|
|
2237
|
+
"location",
|
|
2238
|
+
"max-forwards",
|
|
2239
|
+
"proxy-authorization",
|
|
2240
|
+
"referer",
|
|
2241
|
+
"retry-after",
|
|
2242
|
+
"user-agent"
|
|
2243
|
+
];
|
|
2244
|
+
return vt = function(n) {
|
|
2245
|
+
var i = {}, a, s, o;
|
|
2246
|
+
return n && t.forEach(n.split(`
|
|
2247
|
+
`), function(f) {
|
|
2248
|
+
if (o = f.indexOf(":"), a = t.trim(f.substr(0, o)).toLowerCase(), s = t.trim(f.substr(o + 1)), a) {
|
|
2249
|
+
if (i[a] && e.indexOf(a) >= 0)
|
|
2250
|
+
return;
|
|
2251
|
+
a === "set-cookie" ? i[a] = (i[a] ? i[a] : []).concat([s]) : i[a] = i[a] ? i[a] + ", " + s : s;
|
|
2252
|
+
}
|
|
2253
|
+
}), i;
|
|
2254
|
+
}, vt;
|
|
2255
|
+
}
|
|
2256
|
+
var mt, Lr;
|
|
2257
|
+
function Ia() {
|
|
2258
|
+
if (Lr)
|
|
2259
|
+
return mt;
|
|
2260
|
+
Lr = 1;
|
|
2261
|
+
var t = K;
|
|
2262
|
+
return mt = t.isStandardBrowserEnv() ? (
|
|
2263
|
+
// Standard browser envs have full support of the APIs needed to test
|
|
2264
|
+
// whether the request URL is of the same origin as current location.
|
|
2265
|
+
function() {
|
|
2266
|
+
var r = /(msie|trident)/i.test(navigator.userAgent), n = document.createElement("a"), i;
|
|
2267
|
+
function a(s) {
|
|
2268
|
+
var o = s;
|
|
2269
|
+
return r && (n.setAttribute("href", o), o = n.href), n.setAttribute("href", o), {
|
|
2270
|
+
href: n.href,
|
|
2271
|
+
protocol: n.protocol ? n.protocol.replace(/:$/, "") : "",
|
|
2272
|
+
host: n.host,
|
|
2273
|
+
search: n.search ? n.search.replace(/^\?/, "") : "",
|
|
2274
|
+
hash: n.hash ? n.hash.replace(/^#/, "") : "",
|
|
2275
|
+
hostname: n.hostname,
|
|
2276
|
+
port: n.port,
|
|
2277
|
+
pathname: n.pathname.charAt(0) === "/" ? n.pathname : "/" + n.pathname
|
|
2278
|
+
};
|
|
2279
|
+
}
|
|
2280
|
+
return i = a(window.location.href), function(o) {
|
|
2281
|
+
var l = t.isString(o) ? a(o) : o;
|
|
2282
|
+
return l.protocol === i.protocol && l.host === i.host;
|
|
2283
|
+
};
|
|
2284
|
+
}()
|
|
2285
|
+
) : (
|
|
2286
|
+
// Non standard browser envs (web workers, react-native) lack needed support.
|
|
2287
|
+
function() {
|
|
2288
|
+
return function() {
|
|
2289
|
+
return !0;
|
|
2290
|
+
};
|
|
2291
|
+
}()
|
|
2292
|
+
), mt;
|
|
2293
|
+
}
|
|
2294
|
+
var gt, Qr;
|
|
2295
|
+
function it() {
|
|
2296
|
+
if (Qr)
|
|
2297
|
+
return gt;
|
|
2298
|
+
Qr = 1;
|
|
2299
|
+
function t(e) {
|
|
2300
|
+
this.message = e;
|
|
2301
|
+
}
|
|
2302
|
+
return t.prototype.toString = function() {
|
|
2303
|
+
return "Cancel" + (this.message ? ": " + this.message : "");
|
|
2304
|
+
}, t.prototype.__CANCEL__ = !0, gt = t, gt;
|
|
2305
|
+
}
|
|
2306
|
+
var bt, kr;
|
|
2307
|
+
function Br() {
|
|
2308
|
+
if (kr)
|
|
2309
|
+
return bt;
|
|
2310
|
+
kr = 1;
|
|
2311
|
+
var t = K, e = Ea(), r = Ra(), n = Ln, i = Fa(), a = xa(), s = Ia(), o = Bn(), l = kn, f = it();
|
|
2312
|
+
return bt = function(u) {
|
|
2313
|
+
return new Promise(function(d, p) {
|
|
2314
|
+
var v = u.data, m = u.headers, y = u.responseType, g;
|
|
2315
|
+
function S() {
|
|
2316
|
+
u.cancelToken && u.cancelToken.unsubscribe(g), u.signal && u.signal.removeEventListener("abort", g);
|
|
2317
|
+
}
|
|
2318
|
+
t.isFormData(v) && delete m["Content-Type"];
|
|
2319
|
+
var b = new XMLHttpRequest();
|
|
2320
|
+
if (u.auth) {
|
|
2321
|
+
var C = u.auth.username || "", P = u.auth.password ? unescape(encodeURIComponent(u.auth.password)) : "";
|
|
2322
|
+
m.Authorization = "Basic " + btoa(C + ":" + P);
|
|
2323
|
+
}
|
|
2324
|
+
var _ = i(u.baseURL, u.url);
|
|
2325
|
+
b.open(u.method.toUpperCase(), n(_, u.params, u.paramsSerializer), !0), b.timeout = u.timeout;
|
|
2326
|
+
function G() {
|
|
2327
|
+
if (b) {
|
|
2328
|
+
var A = "getAllResponseHeaders" in b ? a(b.getAllResponseHeaders()) : null, $ = !y || y === "text" || y === "json" ? b.responseText : b.response, x = {
|
|
2329
|
+
data: $,
|
|
2330
|
+
status: b.status,
|
|
2331
|
+
statusText: b.statusText,
|
|
2332
|
+
headers: A,
|
|
2333
|
+
config: u,
|
|
2334
|
+
request: b
|
|
2335
|
+
};
|
|
2336
|
+
e(function(I) {
|
|
2337
|
+
d(I), S();
|
|
2338
|
+
}, function(I) {
|
|
2339
|
+
p(I), S();
|
|
2340
|
+
}, x), b = null;
|
|
2341
|
+
}
|
|
2342
|
+
}
|
|
2343
|
+
if ("onloadend" in b ? b.onloadend = G : b.onreadystatechange = function() {
|
|
2344
|
+
!b || b.readyState !== 4 || b.status === 0 && !(b.responseURL && b.responseURL.indexOf("file:") === 0) || setTimeout(G);
|
|
2345
|
+
}, b.onabort = function() {
|
|
2346
|
+
b && (p(o("Request aborted", u, "ECONNABORTED", b)), b = null);
|
|
2347
|
+
}, b.onerror = function() {
|
|
2348
|
+
p(o("Network Error", u, null, b)), b = null;
|
|
2349
|
+
}, b.ontimeout = function() {
|
|
2350
|
+
var $ = u.timeout ? "timeout of " + u.timeout + "ms exceeded" : "timeout exceeded", x = u.transitional || l;
|
|
2351
|
+
u.timeoutErrorMessage && ($ = u.timeoutErrorMessage), p(o(
|
|
2352
|
+
$,
|
|
2353
|
+
u,
|
|
2354
|
+
x.clarifyTimeoutError ? "ETIMEDOUT" : "ECONNABORTED",
|
|
2355
|
+
b
|
|
2356
|
+
)), b = null;
|
|
2357
|
+
}, t.isStandardBrowserEnv()) {
|
|
2358
|
+
var Q = (u.withCredentials || s(_)) && u.xsrfCookieName ? r.read(u.xsrfCookieName) : void 0;
|
|
2359
|
+
Q && (m[u.xsrfHeaderName] = Q);
|
|
2360
|
+
}
|
|
2361
|
+
"setRequestHeader" in b && t.forEach(m, function($, x) {
|
|
2362
|
+
typeof v > "u" && x.toLowerCase() === "content-type" ? delete m[x] : b.setRequestHeader(x, $);
|
|
2363
|
+
}), t.isUndefined(u.withCredentials) || (b.withCredentials = !!u.withCredentials), y && y !== "json" && (b.responseType = u.responseType), typeof u.onDownloadProgress == "function" && b.addEventListener("progress", u.onDownloadProgress), typeof u.onUploadProgress == "function" && b.upload && b.upload.addEventListener("progress", u.onUploadProgress), (u.cancelToken || u.signal) && (g = function(A) {
|
|
2364
|
+
b && (p(!A || A && A.type ? new f("canceled") : A), b.abort(), b = null);
|
|
2365
|
+
}, u.cancelToken && u.cancelToken.subscribe(g), u.signal && (u.signal.aborted ? g() : u.signal.addEventListener("abort", g))), v || (v = null), b.send(v);
|
|
2366
|
+
});
|
|
2367
|
+
}, bt;
|
|
2368
|
+
}
|
|
2369
|
+
var N = K, jr = Pa, _a = Qn, qa = kn, $a = {
|
|
2370
|
+
"Content-Type": "application/x-www-form-urlencoded"
|
|
2371
|
+
};
|
|
2372
|
+
function zr(t, e) {
|
|
2373
|
+
!N.isUndefined(t) && N.isUndefined(t["Content-Type"]) && (t["Content-Type"] = e);
|
|
2374
|
+
}
|
|
2375
|
+
function Ma() {
|
|
2376
|
+
var t;
|
|
2377
|
+
return (typeof XMLHttpRequest < "u" || typeof process < "u" && Object.prototype.toString.call(process) === "[object process]") && (t = Br()), t;
|
|
2378
|
+
}
|
|
2379
|
+
function Da(t, e, r) {
|
|
2380
|
+
if (N.isString(t))
|
|
2381
|
+
try {
|
|
2382
|
+
return (e || JSON.parse)(t), N.trim(t);
|
|
2383
|
+
} catch (n) {
|
|
2384
|
+
if (n.name !== "SyntaxError")
|
|
2385
|
+
throw n;
|
|
2386
|
+
}
|
|
2387
|
+
return (r || JSON.stringify)(t);
|
|
2388
|
+
}
|
|
2389
|
+
var at = {
|
|
2390
|
+
transitional: qa,
|
|
2391
|
+
adapter: Ma(),
|
|
2392
|
+
transformRequest: [function(e, r) {
|
|
2393
|
+
return jr(r, "Accept"), jr(r, "Content-Type"), N.isFormData(e) || N.isArrayBuffer(e) || N.isBuffer(e) || N.isStream(e) || N.isFile(e) || N.isBlob(e) ? e : N.isArrayBufferView(e) ? e.buffer : N.isURLSearchParams(e) ? (zr(r, "application/x-www-form-urlencoded;charset=utf-8"), e.toString()) : N.isObject(e) || r && r["Content-Type"] === "application/json" ? (zr(r, "application/json"), Da(e)) : e;
|
|
2394
|
+
}],
|
|
2395
|
+
transformResponse: [function(e) {
|
|
2396
|
+
var r = this.transitional || at.transitional, n = r && r.silentJSONParsing, i = r && r.forcedJSONParsing, a = !n && this.responseType === "json";
|
|
2397
|
+
if (a || i && N.isString(e) && e.length)
|
|
2398
|
+
try {
|
|
2399
|
+
return JSON.parse(e);
|
|
2400
|
+
} catch (s) {
|
|
2401
|
+
if (a)
|
|
2402
|
+
throw s.name === "SyntaxError" ? _a(s, this, "E_JSON_PARSE") : s;
|
|
2403
|
+
}
|
|
2404
|
+
return e;
|
|
2405
|
+
}],
|
|
2406
|
+
/**
|
|
2407
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
2408
|
+
* timeout is not created.
|
|
2409
|
+
*/
|
|
2410
|
+
timeout: 0,
|
|
2411
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
2412
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
2413
|
+
maxContentLength: -1,
|
|
2414
|
+
maxBodyLength: -1,
|
|
2415
|
+
validateStatus: function(e) {
|
|
2416
|
+
return e >= 200 && e < 300;
|
|
2417
|
+
},
|
|
2418
|
+
headers: {
|
|
2419
|
+
common: {
|
|
2420
|
+
Accept: "application/json, text/plain, */*"
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
};
|
|
2424
|
+
N.forEach(["delete", "get", "head"], function(e) {
|
|
2425
|
+
at.headers[e] = {};
|
|
2426
|
+
});
|
|
2427
|
+
N.forEach(["post", "put", "patch"], function(e) {
|
|
2428
|
+
at.headers[e] = N.merge($a);
|
|
2429
|
+
});
|
|
2430
|
+
var hr = at, Ta = K, Ua = hr, Na = function(e, r, n) {
|
|
2431
|
+
var i = this || Ua;
|
|
2432
|
+
return Ta.forEach(n, function(s) {
|
|
2433
|
+
e = s.call(i, e, r);
|
|
2434
|
+
}), e;
|
|
2435
|
+
}, St, Kr;
|
|
2436
|
+
function jn() {
|
|
2437
|
+
return Kr || (Kr = 1, St = function(e) {
|
|
2438
|
+
return !!(e && e.__CANCEL__);
|
|
2439
|
+
}), St;
|
|
2440
|
+
}
|
|
2441
|
+
var Wr = K, wt = Na, La = jn(), Qa = hr, ka = it();
|
|
2442
|
+
function Ot(t) {
|
|
2443
|
+
if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
|
|
2444
|
+
throw new ka("canceled");
|
|
2445
|
+
}
|
|
2446
|
+
var Ba = function(e) {
|
|
2447
|
+
Ot(e), e.headers = e.headers || {}, e.data = wt.call(
|
|
2448
|
+
e,
|
|
2449
|
+
e.data,
|
|
2450
|
+
e.headers,
|
|
2451
|
+
e.transformRequest
|
|
2452
|
+
), e.headers = Wr.merge(
|
|
2453
|
+
e.headers.common || {},
|
|
2454
|
+
e.headers[e.method] || {},
|
|
2455
|
+
e.headers
|
|
2456
|
+
), Wr.forEach(
|
|
2457
|
+
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
2458
|
+
function(i) {
|
|
2459
|
+
delete e.headers[i];
|
|
2460
|
+
}
|
|
2461
|
+
);
|
|
2462
|
+
var r = e.adapter || Qa.adapter;
|
|
2463
|
+
return r(e).then(function(i) {
|
|
2464
|
+
return Ot(e), i.data = wt.call(
|
|
2465
|
+
e,
|
|
2466
|
+
i.data,
|
|
2467
|
+
i.headers,
|
|
2468
|
+
e.transformResponse
|
|
2469
|
+
), i;
|
|
2470
|
+
}, function(i) {
|
|
2471
|
+
return La(i) || (Ot(e), i && i.response && (i.response.data = wt.call(
|
|
2472
|
+
e,
|
|
2473
|
+
i.response.data,
|
|
2474
|
+
i.response.headers,
|
|
2475
|
+
e.transformResponse
|
|
2476
|
+
))), Promise.reject(i);
|
|
2477
|
+
});
|
|
2478
|
+
}, W = K, zn = function(e, r) {
|
|
2479
|
+
r = r || {};
|
|
2480
|
+
var n = {};
|
|
2481
|
+
function i(c, u) {
|
|
2482
|
+
return W.isPlainObject(c) && W.isPlainObject(u) ? W.merge(c, u) : W.isPlainObject(u) ? W.merge({}, u) : W.isArray(u) ? u.slice() : u;
|
|
2483
|
+
}
|
|
2484
|
+
function a(c) {
|
|
2485
|
+
if (W.isUndefined(r[c])) {
|
|
2486
|
+
if (!W.isUndefined(e[c]))
|
|
2487
|
+
return i(void 0, e[c]);
|
|
2488
|
+
} else
|
|
2489
|
+
return i(e[c], r[c]);
|
|
2490
|
+
}
|
|
2491
|
+
function s(c) {
|
|
2492
|
+
if (!W.isUndefined(r[c]))
|
|
2493
|
+
return i(void 0, r[c]);
|
|
2494
|
+
}
|
|
2495
|
+
function o(c) {
|
|
2496
|
+
if (W.isUndefined(r[c])) {
|
|
2497
|
+
if (!W.isUndefined(e[c]))
|
|
2498
|
+
return i(void 0, e[c]);
|
|
2499
|
+
} else
|
|
2500
|
+
return i(void 0, r[c]);
|
|
2501
|
+
}
|
|
2502
|
+
function l(c) {
|
|
2503
|
+
if (c in r)
|
|
2504
|
+
return i(e[c], r[c]);
|
|
2505
|
+
if (c in e)
|
|
2506
|
+
return i(void 0, e[c]);
|
|
2507
|
+
}
|
|
2508
|
+
var f = {
|
|
2509
|
+
url: s,
|
|
2510
|
+
method: s,
|
|
2511
|
+
data: s,
|
|
2512
|
+
baseURL: o,
|
|
2513
|
+
transformRequest: o,
|
|
2514
|
+
transformResponse: o,
|
|
2515
|
+
paramsSerializer: o,
|
|
2516
|
+
timeout: o,
|
|
2517
|
+
timeoutMessage: o,
|
|
2518
|
+
withCredentials: o,
|
|
2519
|
+
adapter: o,
|
|
2520
|
+
responseType: o,
|
|
2521
|
+
xsrfCookieName: o,
|
|
2522
|
+
xsrfHeaderName: o,
|
|
2523
|
+
onUploadProgress: o,
|
|
2524
|
+
onDownloadProgress: o,
|
|
2525
|
+
decompress: o,
|
|
2526
|
+
maxContentLength: o,
|
|
2527
|
+
maxBodyLength: o,
|
|
2528
|
+
transport: o,
|
|
2529
|
+
httpAgent: o,
|
|
2530
|
+
httpsAgent: o,
|
|
2531
|
+
cancelToken: o,
|
|
2532
|
+
socketPath: o,
|
|
2533
|
+
responseEncoding: o,
|
|
2534
|
+
validateStatus: l
|
|
2535
|
+
};
|
|
2536
|
+
return W.forEach(Object.keys(e).concat(Object.keys(r)), function(u) {
|
|
2537
|
+
var h = f[u] || a, d = h(u);
|
|
2538
|
+
W.isUndefined(d) && h !== l || (n[u] = d);
|
|
2539
|
+
}), n;
|
|
2540
|
+
}, Pt, Gr;
|
|
2541
|
+
function Kn() {
|
|
2542
|
+
return Gr || (Gr = 1, Pt = {
|
|
2543
|
+
version: "0.26.1"
|
|
2544
|
+
}), Pt;
|
|
2545
|
+
}
|
|
2546
|
+
var ja = Kn().version, dr = {};
|
|
2547
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach(function(t, e) {
|
|
2548
|
+
dr[t] = function(n) {
|
|
2549
|
+
return typeof n === t || "a" + (e < 1 ? "n " : " ") + t;
|
|
2550
|
+
};
|
|
2551
|
+
});
|
|
2552
|
+
var Hr = {};
|
|
2553
|
+
dr.transitional = function(e, r, n) {
|
|
2554
|
+
function i(a, s) {
|
|
2555
|
+
return "[Axios v" + ja + "] Transitional option '" + a + "'" + s + (n ? ". " + n : "");
|
|
2556
|
+
}
|
|
2557
|
+
return function(a, s, o) {
|
|
2558
|
+
if (e === !1)
|
|
2559
|
+
throw new Error(i(s, " has been removed" + (r ? " in " + r : "")));
|
|
2560
|
+
return r && !Hr[s] && (Hr[s] = !0, console.warn(
|
|
2561
|
+
i(
|
|
2562
|
+
s,
|
|
2563
|
+
" has been deprecated since v" + r + " and will be removed in the near future"
|
|
2564
|
+
)
|
|
2565
|
+
)), e ? e(a, s, o) : !0;
|
|
2566
|
+
};
|
|
2567
|
+
};
|
|
2568
|
+
function za(t, e, r) {
|
|
2569
|
+
if (typeof t != "object")
|
|
2570
|
+
throw new TypeError("options must be an object");
|
|
2571
|
+
for (var n = Object.keys(t), i = n.length; i-- > 0; ) {
|
|
2572
|
+
var a = n[i], s = e[a];
|
|
2573
|
+
if (s) {
|
|
2574
|
+
var o = t[a], l = o === void 0 || s(o, a, t);
|
|
2575
|
+
if (l !== !0)
|
|
2576
|
+
throw new TypeError("option " + a + " must be " + l);
|
|
2577
|
+
continue;
|
|
2578
|
+
}
|
|
2579
|
+
if (r !== !0)
|
|
2580
|
+
throw Error("Unknown option " + a);
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2583
|
+
var Ka = {
|
|
2584
|
+
assertOptions: za,
|
|
2585
|
+
validators: dr
|
|
2586
|
+
}, Wn = K, Wa = Ln, Vr = wa, Jr = Ba, st = zn, Gn = Ka, me = Gn.validators;
|
|
2587
|
+
function Me(t) {
|
|
2588
|
+
this.defaults = t, this.interceptors = {
|
|
2589
|
+
request: new Vr(),
|
|
2590
|
+
response: new Vr()
|
|
2591
|
+
};
|
|
2592
|
+
}
|
|
2593
|
+
Me.prototype.request = function(e, r) {
|
|
2594
|
+
typeof e == "string" ? (r = r || {}, r.url = e) : r = e || {}, r = st(this.defaults, r), r.method ? r.method = r.method.toLowerCase() : this.defaults.method ? r.method = this.defaults.method.toLowerCase() : r.method = "get";
|
|
2595
|
+
var n = r.transitional;
|
|
2596
|
+
n !== void 0 && Gn.assertOptions(n, {
|
|
2597
|
+
silentJSONParsing: me.transitional(me.boolean),
|
|
2598
|
+
forcedJSONParsing: me.transitional(me.boolean),
|
|
2599
|
+
clarifyTimeoutError: me.transitional(me.boolean)
|
|
2600
|
+
}, !1);
|
|
2601
|
+
var i = [], a = !0;
|
|
2602
|
+
this.interceptors.request.forEach(function(d) {
|
|
2603
|
+
typeof d.runWhen == "function" && d.runWhen(r) === !1 || (a = a && d.synchronous, i.unshift(d.fulfilled, d.rejected));
|
|
2604
|
+
});
|
|
2605
|
+
var s = [];
|
|
2606
|
+
this.interceptors.response.forEach(function(d) {
|
|
2607
|
+
s.push(d.fulfilled, d.rejected);
|
|
2608
|
+
});
|
|
2609
|
+
var o;
|
|
2610
|
+
if (!a) {
|
|
2611
|
+
var l = [Jr, void 0];
|
|
2612
|
+
for (Array.prototype.unshift.apply(l, i), l = l.concat(s), o = Promise.resolve(r); l.length; )
|
|
2613
|
+
o = o.then(l.shift(), l.shift());
|
|
2614
|
+
return o;
|
|
2615
|
+
}
|
|
2616
|
+
for (var f = r; i.length; ) {
|
|
2617
|
+
var c = i.shift(), u = i.shift();
|
|
2618
|
+
try {
|
|
2619
|
+
f = c(f);
|
|
2620
|
+
} catch (h) {
|
|
2621
|
+
u(h);
|
|
2622
|
+
break;
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
try {
|
|
2626
|
+
o = Jr(f);
|
|
2627
|
+
} catch (h) {
|
|
2628
|
+
return Promise.reject(h);
|
|
2629
|
+
}
|
|
2630
|
+
for (; s.length; )
|
|
2631
|
+
o = o.then(s.shift(), s.shift());
|
|
2632
|
+
return o;
|
|
2633
|
+
};
|
|
2634
|
+
Me.prototype.getUri = function(e) {
|
|
2635
|
+
return e = st(this.defaults, e), Wa(e.url, e.params, e.paramsSerializer).replace(/^\?/, "");
|
|
2636
|
+
};
|
|
2637
|
+
Wn.forEach(["delete", "get", "head", "options"], function(e) {
|
|
2638
|
+
Me.prototype[e] = function(r, n) {
|
|
2639
|
+
return this.request(st(n || {}, {
|
|
2640
|
+
method: e,
|
|
2641
|
+
url: r,
|
|
2642
|
+
data: (n || {}).data
|
|
2643
|
+
}));
|
|
2644
|
+
};
|
|
2645
|
+
});
|
|
2646
|
+
Wn.forEach(["post", "put", "patch"], function(e) {
|
|
2647
|
+
Me.prototype[e] = function(r, n, i) {
|
|
2648
|
+
return this.request(st(i || {}, {
|
|
2649
|
+
method: e,
|
|
2650
|
+
url: r,
|
|
2651
|
+
data: n
|
|
2652
|
+
}));
|
|
2653
|
+
};
|
|
2654
|
+
});
|
|
2655
|
+
var Ga = Me, Et, Xr;
|
|
2656
|
+
function Ha() {
|
|
2657
|
+
if (Xr)
|
|
2658
|
+
return Et;
|
|
2659
|
+
Xr = 1;
|
|
2660
|
+
var t = it();
|
|
2661
|
+
function e(r) {
|
|
2662
|
+
if (typeof r != "function")
|
|
2663
|
+
throw new TypeError("executor must be a function.");
|
|
2664
|
+
var n;
|
|
2665
|
+
this.promise = new Promise(function(s) {
|
|
2666
|
+
n = s;
|
|
2667
|
+
});
|
|
2668
|
+
var i = this;
|
|
2669
|
+
this.promise.then(function(a) {
|
|
2670
|
+
if (i._listeners) {
|
|
2671
|
+
var s, o = i._listeners.length;
|
|
2672
|
+
for (s = 0; s < o; s++)
|
|
2673
|
+
i._listeners[s](a);
|
|
2674
|
+
i._listeners = null;
|
|
2675
|
+
}
|
|
2676
|
+
}), this.promise.then = function(a) {
|
|
2677
|
+
var s, o = new Promise(function(l) {
|
|
2678
|
+
i.subscribe(l), s = l;
|
|
2679
|
+
}).then(a);
|
|
2680
|
+
return o.cancel = function() {
|
|
2681
|
+
i.unsubscribe(s);
|
|
2682
|
+
}, o;
|
|
2683
|
+
}, r(function(s) {
|
|
2684
|
+
i.reason || (i.reason = new t(s), n(i.reason));
|
|
2685
|
+
});
|
|
2686
|
+
}
|
|
2687
|
+
return e.prototype.throwIfRequested = function() {
|
|
2688
|
+
if (this.reason)
|
|
2689
|
+
throw this.reason;
|
|
2690
|
+
}, e.prototype.subscribe = function(n) {
|
|
2691
|
+
if (this.reason) {
|
|
2692
|
+
n(this.reason);
|
|
2693
|
+
return;
|
|
2694
|
+
}
|
|
2695
|
+
this._listeners ? this._listeners.push(n) : this._listeners = [n];
|
|
2696
|
+
}, e.prototype.unsubscribe = function(n) {
|
|
2697
|
+
if (this._listeners) {
|
|
2698
|
+
var i = this._listeners.indexOf(n);
|
|
2699
|
+
i !== -1 && this._listeners.splice(i, 1);
|
|
2700
|
+
}
|
|
2701
|
+
}, e.source = function() {
|
|
2702
|
+
var n, i = new e(function(s) {
|
|
2703
|
+
n = s;
|
|
2704
|
+
});
|
|
2705
|
+
return {
|
|
2706
|
+
token: i,
|
|
2707
|
+
cancel: n
|
|
2708
|
+
};
|
|
2709
|
+
}, Et = e, Et;
|
|
2710
|
+
}
|
|
2711
|
+
var Rt, Yr;
|
|
2712
|
+
function Va() {
|
|
2713
|
+
return Yr || (Yr = 1, Rt = function(e) {
|
|
2714
|
+
return function(n) {
|
|
2715
|
+
return e.apply(null, n);
|
|
2716
|
+
};
|
|
2717
|
+
}), Rt;
|
|
2718
|
+
}
|
|
2719
|
+
var At, Zr;
|
|
2720
|
+
function Ja() {
|
|
2721
|
+
if (Zr)
|
|
2722
|
+
return At;
|
|
2723
|
+
Zr = 1;
|
|
2724
|
+
var t = K;
|
|
2725
|
+
return At = function(r) {
|
|
2726
|
+
return t.isObject(r) && r.isAxiosError === !0;
|
|
2727
|
+
}, At;
|
|
2728
|
+
}
|
|
2729
|
+
var en = K, Xa = Dn, ze = Ga, Ya = zn, Za = hr;
|
|
2730
|
+
function Hn(t) {
|
|
2731
|
+
var e = new ze(t), r = Xa(ze.prototype.request, e);
|
|
2732
|
+
return en.extend(r, ze.prototype, e), en.extend(r, e), r.create = function(i) {
|
|
2733
|
+
return Hn(Ya(t, i));
|
|
2734
|
+
}, r;
|
|
2735
|
+
}
|
|
2736
|
+
var Z = Hn(Za);
|
|
2737
|
+
Z.Axios = ze;
|
|
2738
|
+
Z.Cancel = it();
|
|
2739
|
+
Z.CancelToken = Ha();
|
|
2740
|
+
Z.isCancel = jn();
|
|
2741
|
+
Z.VERSION = Kn().version;
|
|
2742
|
+
Z.all = function(e) {
|
|
2743
|
+
return Promise.all(e);
|
|
2744
|
+
};
|
|
2745
|
+
Z.spread = Va();
|
|
2746
|
+
Z.isAxiosError = Ja();
|
|
2747
|
+
ia.exports = Z;
|
|
2748
|
+
Xe.default = Z;
|
|
2749
|
+
(function(t) {
|
|
2750
|
+
t.exports = Xe;
|
|
2751
|
+
})(na);
|
|
2752
|
+
const Jt = /* @__PURE__ */ ta(Gt);
|
|
2753
|
+
var Ye = {}, es = {
|
|
2754
|
+
get exports() {
|
|
2755
|
+
return Ye;
|
|
2756
|
+
},
|
|
2757
|
+
set exports(t) {
|
|
2758
|
+
Ye = t;
|
|
2759
|
+
}
|
|
2760
|
+
};
|
|
2761
|
+
(function(t) {
|
|
2762
|
+
(function() {
|
|
2763
|
+
var e, r, n, i, a, s, o, l, f;
|
|
2764
|
+
r = {}, l = this, t !== null && t.exports ? t.exports = r : l.ipaddr = r, o = function(c, u, h, d) {
|
|
2765
|
+
var p, v;
|
|
2766
|
+
if (c.length !== u.length)
|
|
2767
|
+
throw new Error("ipaddr: cannot match CIDR for objects with different lengths");
|
|
2768
|
+
for (p = 0; d > 0; ) {
|
|
2769
|
+
if (v = h - d, v < 0 && (v = 0), c[p] >> v !== u[p] >> v)
|
|
2770
|
+
return !1;
|
|
2771
|
+
d -= h, p += 1;
|
|
2772
|
+
}
|
|
2773
|
+
return !0;
|
|
2774
|
+
}, r.subnetMatch = function(c, u, h) {
|
|
2775
|
+
var d, p, v, m, y;
|
|
2776
|
+
h == null && (h = "unicast");
|
|
2777
|
+
for (v in u)
|
|
2778
|
+
for (m = u[v], m[0] && !(m[0] instanceof Array) && (m = [m]), d = 0, p = m.length; d < p; d++)
|
|
2779
|
+
if (y = m[d], c.kind() === y[0].kind() && c.match.apply(c, y))
|
|
2780
|
+
return v;
|
|
2781
|
+
return h;
|
|
2782
|
+
}, r.IPv4 = function() {
|
|
2783
|
+
function c(u) {
|
|
2784
|
+
var h, d, p;
|
|
2785
|
+
if (u.length !== 4)
|
|
2786
|
+
throw new Error("ipaddr: ipv4 octet count should be 4");
|
|
2787
|
+
for (h = 0, d = u.length; h < d; h++)
|
|
2788
|
+
if (p = u[h], !(0 <= p && p <= 255))
|
|
2789
|
+
throw new Error("ipaddr: ipv4 octet should fit in 8 bits");
|
|
2790
|
+
this.octets = u;
|
|
2791
|
+
}
|
|
2792
|
+
return c.prototype.kind = function() {
|
|
2793
|
+
return "ipv4";
|
|
2794
|
+
}, c.prototype.toString = function() {
|
|
2795
|
+
return this.octets.join(".");
|
|
2796
|
+
}, c.prototype.toNormalizedString = function() {
|
|
2797
|
+
return this.toString();
|
|
2798
|
+
}, c.prototype.toByteArray = function() {
|
|
2799
|
+
return this.octets.slice(0);
|
|
2800
|
+
}, c.prototype.match = function(u, h) {
|
|
2801
|
+
var d;
|
|
2802
|
+
if (h === void 0 && (d = u, u = d[0], h = d[1]), u.kind() !== "ipv4")
|
|
2803
|
+
throw new Error("ipaddr: cannot match ipv4 address with non-ipv4 one");
|
|
2804
|
+
return o(this.octets, u.octets, 8, h);
|
|
2805
|
+
}, c.prototype.SpecialRanges = {
|
|
2806
|
+
unspecified: [[new c([0, 0, 0, 0]), 8]],
|
|
2807
|
+
broadcast: [[new c([255, 255, 255, 255]), 32]],
|
|
2808
|
+
multicast: [[new c([224, 0, 0, 0]), 4]],
|
|
2809
|
+
linkLocal: [[new c([169, 254, 0, 0]), 16]],
|
|
2810
|
+
loopback: [[new c([127, 0, 0, 0]), 8]],
|
|
2811
|
+
carrierGradeNat: [[new c([100, 64, 0, 0]), 10]],
|
|
2812
|
+
private: [[new c([10, 0, 0, 0]), 8], [new c([172, 16, 0, 0]), 12], [new c([192, 168, 0, 0]), 16]],
|
|
2813
|
+
reserved: [[new c([192, 0, 0, 0]), 24], [new c([192, 0, 2, 0]), 24], [new c([192, 88, 99, 0]), 24], [new c([198, 51, 100, 0]), 24], [new c([203, 0, 113, 0]), 24], [new c([240, 0, 0, 0]), 4]]
|
|
2814
|
+
}, c.prototype.range = function() {
|
|
2815
|
+
return r.subnetMatch(this, this.SpecialRanges);
|
|
2816
|
+
}, c.prototype.toIPv4MappedAddress = function() {
|
|
2817
|
+
return r.IPv6.parse("::ffff:" + this.toString());
|
|
2818
|
+
}, c.prototype.prefixLengthFromSubnetMask = function() {
|
|
2819
|
+
var u, h, d, p, v, m, y;
|
|
2820
|
+
for (y = {
|
|
2821
|
+
0: 8,
|
|
2822
|
+
128: 7,
|
|
2823
|
+
192: 6,
|
|
2824
|
+
224: 5,
|
|
2825
|
+
240: 4,
|
|
2826
|
+
248: 3,
|
|
2827
|
+
252: 2,
|
|
2828
|
+
254: 1,
|
|
2829
|
+
255: 0
|
|
2830
|
+
}, u = 0, v = !1, h = d = 3; d >= 0; h = d += -1)
|
|
2831
|
+
if (p = this.octets[h], p in y) {
|
|
2832
|
+
if (m = y[p], v && m !== 0)
|
|
2833
|
+
return null;
|
|
2834
|
+
m !== 8 && (v = !0), u += m;
|
|
2835
|
+
} else
|
|
2836
|
+
return null;
|
|
2837
|
+
return 32 - u;
|
|
2838
|
+
}, c;
|
|
2839
|
+
}(), n = "(0?\\d+|0x[a-f0-9]+)", i = {
|
|
2840
|
+
fourOctet: new RegExp("^" + n + "\\." + n + "\\." + n + "\\." + n + "$", "i"),
|
|
2841
|
+
longValue: new RegExp("^" + n + "$", "i")
|
|
2842
|
+
}, r.IPv4.parser = function(c) {
|
|
2843
|
+
var u, h, d, p, v;
|
|
2844
|
+
if (h = function(m) {
|
|
2845
|
+
return m[0] === "0" && m[1] !== "x" ? parseInt(m, 8) : parseInt(m);
|
|
2846
|
+
}, u = c.match(i.fourOctet))
|
|
2847
|
+
return function() {
|
|
2848
|
+
var m, y, g, S;
|
|
2849
|
+
for (g = u.slice(1, 6), S = [], m = 0, y = g.length; m < y; m++)
|
|
2850
|
+
d = g[m], S.push(h(d));
|
|
2851
|
+
return S;
|
|
2852
|
+
}();
|
|
2853
|
+
if (u = c.match(i.longValue)) {
|
|
2854
|
+
if (v = h(u[1]), v > 4294967295 || v < 0)
|
|
2855
|
+
throw new Error("ipaddr: address outside defined range");
|
|
2856
|
+
return function() {
|
|
2857
|
+
var m, y;
|
|
2858
|
+
for (y = [], p = m = 0; m <= 24; p = m += 8)
|
|
2859
|
+
y.push(v >> p & 255);
|
|
2860
|
+
return y;
|
|
2861
|
+
}().reverse();
|
|
2862
|
+
} else
|
|
2863
|
+
return null;
|
|
2864
|
+
}, r.IPv6 = function() {
|
|
2865
|
+
function c(u, h) {
|
|
2866
|
+
var d, p, v, m, y, g;
|
|
2867
|
+
if (u.length === 16)
|
|
2868
|
+
for (this.parts = [], d = p = 0; p <= 14; d = p += 2)
|
|
2869
|
+
this.parts.push(u[d] << 8 | u[d + 1]);
|
|
2870
|
+
else if (u.length === 8)
|
|
2871
|
+
this.parts = u;
|
|
2872
|
+
else
|
|
2873
|
+
throw new Error("ipaddr: ipv6 part count should be 8 or 16");
|
|
2874
|
+
for (g = this.parts, v = 0, m = g.length; v < m; v++)
|
|
2875
|
+
if (y = g[v], !(0 <= y && y <= 65535))
|
|
2876
|
+
throw new Error("ipaddr: ipv6 part should fit in 16 bits");
|
|
2877
|
+
h && (this.zoneId = h);
|
|
2878
|
+
}
|
|
2879
|
+
return c.prototype.kind = function() {
|
|
2880
|
+
return "ipv6";
|
|
2881
|
+
}, c.prototype.toString = function() {
|
|
2882
|
+
return this.toNormalizedString().replace(/((^|:)(0(:|$))+)/, "::");
|
|
2883
|
+
}, c.prototype.toRFC5952String = function() {
|
|
2884
|
+
var u, h, d, p, v;
|
|
2885
|
+
for (p = /((^|:)(0(:|$)){2,})/g, v = this.toNormalizedString(), u = 0, h = -1; d = p.exec(v); )
|
|
2886
|
+
d[0].length > h && (u = d.index, h = d[0].length);
|
|
2887
|
+
return h < 0 ? v : v.substring(0, u) + "::" + v.substring(u + h);
|
|
2888
|
+
}, c.prototype.toByteArray = function() {
|
|
2889
|
+
var u, h, d, p, v;
|
|
2890
|
+
for (u = [], v = this.parts, h = 0, d = v.length; h < d; h++)
|
|
2891
|
+
p = v[h], u.push(p >> 8), u.push(p & 255);
|
|
2892
|
+
return u;
|
|
2893
|
+
}, c.prototype.toNormalizedString = function() {
|
|
2894
|
+
var u, h, d;
|
|
2895
|
+
return u = function() {
|
|
2896
|
+
var p, v, m, y;
|
|
2897
|
+
for (m = this.parts, y = [], p = 0, v = m.length; p < v; p++)
|
|
2898
|
+
h = m[p], y.push(h.toString(16));
|
|
2899
|
+
return y;
|
|
2900
|
+
}.call(this).join(":"), d = "", this.zoneId && (d = "%" + this.zoneId), u + d;
|
|
2901
|
+
}, c.prototype.toFixedLengthString = function() {
|
|
2902
|
+
var u, h, d;
|
|
2903
|
+
return u = function() {
|
|
2904
|
+
var p, v, m, y;
|
|
2905
|
+
for (m = this.parts, y = [], p = 0, v = m.length; p < v; p++)
|
|
2906
|
+
h = m[p], y.push(h.toString(16).padStart(4, "0"));
|
|
2907
|
+
return y;
|
|
2908
|
+
}.call(this).join(":"), d = "", this.zoneId && (d = "%" + this.zoneId), u + d;
|
|
2909
|
+
}, c.prototype.match = function(u, h) {
|
|
2910
|
+
var d;
|
|
2911
|
+
if (h === void 0 && (d = u, u = d[0], h = d[1]), u.kind() !== "ipv6")
|
|
2912
|
+
throw new Error("ipaddr: cannot match ipv6 address with non-ipv6 one");
|
|
2913
|
+
return o(this.parts, u.parts, 16, h);
|
|
2914
|
+
}, c.prototype.SpecialRanges = {
|
|
2915
|
+
unspecified: [new c([0, 0, 0, 0, 0, 0, 0, 0]), 128],
|
|
2916
|
+
linkLocal: [new c([65152, 0, 0, 0, 0, 0, 0, 0]), 10],
|
|
2917
|
+
multicast: [new c([65280, 0, 0, 0, 0, 0, 0, 0]), 8],
|
|
2918
|
+
loopback: [new c([0, 0, 0, 0, 0, 0, 0, 1]), 128],
|
|
2919
|
+
uniqueLocal: [new c([64512, 0, 0, 0, 0, 0, 0, 0]), 7],
|
|
2920
|
+
ipv4Mapped: [new c([0, 0, 0, 0, 0, 65535, 0, 0]), 96],
|
|
2921
|
+
rfc6145: [new c([0, 0, 0, 0, 65535, 0, 0, 0]), 96],
|
|
2922
|
+
rfc6052: [new c([100, 65435, 0, 0, 0, 0, 0, 0]), 96],
|
|
2923
|
+
"6to4": [new c([8194, 0, 0, 0, 0, 0, 0, 0]), 16],
|
|
2924
|
+
teredo: [new c([8193, 0, 0, 0, 0, 0, 0, 0]), 32],
|
|
2925
|
+
reserved: [[new c([8193, 3512, 0, 0, 0, 0, 0, 0]), 32]]
|
|
2926
|
+
}, c.prototype.range = function() {
|
|
2927
|
+
return r.subnetMatch(this, this.SpecialRanges);
|
|
2928
|
+
}, c.prototype.isIPv4MappedAddress = function() {
|
|
2929
|
+
return this.range() === "ipv4Mapped";
|
|
2930
|
+
}, c.prototype.toIPv4Address = function() {
|
|
2931
|
+
var u, h, d;
|
|
2932
|
+
if (!this.isIPv4MappedAddress())
|
|
2933
|
+
throw new Error("ipaddr: trying to convert a generic ipv6 address to ipv4");
|
|
2934
|
+
return d = this.parts.slice(-2), u = d[0], h = d[1], new r.IPv4([u >> 8, u & 255, h >> 8, h & 255]);
|
|
2935
|
+
}, c.prototype.prefixLengthFromSubnetMask = function() {
|
|
2936
|
+
var u, h, d, p, v, m, y;
|
|
2937
|
+
for (y = {
|
|
2938
|
+
0: 16,
|
|
2939
|
+
32768: 15,
|
|
2940
|
+
49152: 14,
|
|
2941
|
+
57344: 13,
|
|
2942
|
+
61440: 12,
|
|
2943
|
+
63488: 11,
|
|
2944
|
+
64512: 10,
|
|
2945
|
+
65024: 9,
|
|
2946
|
+
65280: 8,
|
|
2947
|
+
65408: 7,
|
|
2948
|
+
65472: 6,
|
|
2949
|
+
65504: 5,
|
|
2950
|
+
65520: 4,
|
|
2951
|
+
65528: 3,
|
|
2952
|
+
65532: 2,
|
|
2953
|
+
65534: 1,
|
|
2954
|
+
65535: 0
|
|
2955
|
+
}, u = 0, v = !1, h = d = 7; d >= 0; h = d += -1)
|
|
2956
|
+
if (p = this.parts[h], p in y) {
|
|
2957
|
+
if (m = y[p], v && m !== 0)
|
|
2958
|
+
return null;
|
|
2959
|
+
m !== 16 && (v = !0), u += m;
|
|
2960
|
+
} else
|
|
2961
|
+
return null;
|
|
2962
|
+
return 128 - u;
|
|
2963
|
+
}, c;
|
|
2964
|
+
}(), a = "(?:[0-9a-f]+::?)+", f = "%[0-9a-z]{1,}", s = {
|
|
2965
|
+
zoneIndex: new RegExp(f, "i"),
|
|
2966
|
+
native: new RegExp("^(::)?(" + a + ")?([0-9a-f]+)?(::)?(" + f + ")?$", "i"),
|
|
2967
|
+
transitional: new RegExp("^((?:" + a + ")|(?:::)(?:" + a + ")?)" + (n + "\\." + n + "\\." + n + "\\." + n) + ("(" + f + ")?$"), "i")
|
|
2968
|
+
}, e = function(c, u) {
|
|
2969
|
+
var h, d, p, v, m, y;
|
|
2970
|
+
if (c.indexOf("::") !== c.lastIndexOf("::"))
|
|
2971
|
+
return null;
|
|
2972
|
+
for (y = (c.match(s.zoneIndex) || [])[0], y && (y = y.substring(1), c = c.replace(/%.+$/, "")), h = 0, d = -1; (d = c.indexOf(":", d + 1)) >= 0; )
|
|
2973
|
+
h++;
|
|
2974
|
+
if (c.substr(0, 2) === "::" && h--, c.substr(-2, 2) === "::" && h--, h > u)
|
|
2975
|
+
return null;
|
|
2976
|
+
for (m = u - h, v = ":"; m--; )
|
|
2977
|
+
v += "0:";
|
|
2978
|
+
return c = c.replace("::", v), c[0] === ":" && (c = c.slice(1)), c[c.length - 1] === ":" && (c = c.slice(0, -1)), u = function() {
|
|
2979
|
+
var g, S, b, C;
|
|
2980
|
+
for (b = c.split(":"), C = [], g = 0, S = b.length; g < S; g++)
|
|
2981
|
+
p = b[g], C.push(parseInt(p, 16));
|
|
2982
|
+
return C;
|
|
2983
|
+
}(), {
|
|
2984
|
+
parts: u,
|
|
2985
|
+
zoneId: y
|
|
2986
|
+
};
|
|
2987
|
+
}, r.IPv6.parser = function(c) {
|
|
2988
|
+
var u, h, d, p, v, m, y;
|
|
2989
|
+
if (s.native.test(c))
|
|
2990
|
+
return e(c, 8);
|
|
2991
|
+
if ((p = c.match(s.transitional)) && (y = p[6] || "", u = e(p[1].slice(0, -1) + y, 6), u.parts)) {
|
|
2992
|
+
for (m = [parseInt(p[2]), parseInt(p[3]), parseInt(p[4]), parseInt(p[5])], h = 0, d = m.length; h < d; h++)
|
|
2993
|
+
if (v = m[h], !(0 <= v && v <= 255))
|
|
2994
|
+
return null;
|
|
2995
|
+
return u.parts.push(m[0] << 8 | m[1]), u.parts.push(m[2] << 8 | m[3]), {
|
|
2996
|
+
parts: u.parts,
|
|
2997
|
+
zoneId: u.zoneId
|
|
2998
|
+
};
|
|
2999
|
+
}
|
|
3000
|
+
return null;
|
|
3001
|
+
}, r.IPv4.isIPv4 = r.IPv6.isIPv6 = function(c) {
|
|
3002
|
+
return this.parser(c) !== null;
|
|
3003
|
+
}, r.IPv4.isValid = function(c) {
|
|
3004
|
+
try {
|
|
3005
|
+
return new this(this.parser(c)), !0;
|
|
3006
|
+
} catch {
|
|
3007
|
+
return !1;
|
|
3008
|
+
}
|
|
3009
|
+
}, r.IPv4.isValidFourPartDecimal = function(c) {
|
|
3010
|
+
return !!(r.IPv4.isValid(c) && c.match(/^(0|[1-9]\d*)(\.(0|[1-9]\d*)){3}$/));
|
|
3011
|
+
}, r.IPv6.isValid = function(c) {
|
|
3012
|
+
var u;
|
|
3013
|
+
if (typeof c == "string" && c.indexOf(":") === -1)
|
|
3014
|
+
return !1;
|
|
3015
|
+
try {
|
|
3016
|
+
return u = this.parser(c), new this(u.parts, u.zoneId), !0;
|
|
3017
|
+
} catch {
|
|
3018
|
+
return !1;
|
|
3019
|
+
}
|
|
3020
|
+
}, r.IPv4.parse = function(c) {
|
|
3021
|
+
var u;
|
|
3022
|
+
if (u = this.parser(c), u === null)
|
|
3023
|
+
throw new Error("ipaddr: string is not formatted like ip address");
|
|
3024
|
+
return new this(u);
|
|
3025
|
+
}, r.IPv6.parse = function(c) {
|
|
3026
|
+
var u;
|
|
3027
|
+
if (u = this.parser(c), u.parts === null)
|
|
3028
|
+
throw new Error("ipaddr: string is not formatted like ip address");
|
|
3029
|
+
return new this(u.parts, u.zoneId);
|
|
3030
|
+
}, r.IPv4.parseCIDR = function(c) {
|
|
3031
|
+
var u, h, d;
|
|
3032
|
+
if ((h = c.match(/^(.+)\/(\d+)$/)) && (u = parseInt(h[2]), u >= 0 && u <= 32))
|
|
3033
|
+
return d = [this.parse(h[1]), u], Object.defineProperty(d, "toString", {
|
|
3034
|
+
value: function() {
|
|
3035
|
+
return this.join("/");
|
|
3036
|
+
}
|
|
3037
|
+
}), d;
|
|
3038
|
+
throw new Error("ipaddr: string is not formatted like an IPv4 CIDR range");
|
|
3039
|
+
}, r.IPv4.subnetMaskFromPrefixLength = function(c) {
|
|
3040
|
+
var u, h, d;
|
|
3041
|
+
if (c = parseInt(c), c < 0 || c > 32)
|
|
3042
|
+
throw new Error("ipaddr: invalid IPv4 prefix length");
|
|
3043
|
+
for (d = [0, 0, 0, 0], h = 0, u = Math.floor(c / 8); h < u; )
|
|
3044
|
+
d[h] = 255, h++;
|
|
3045
|
+
return u < 4 && (d[u] = Math.pow(2, c % 8) - 1 << 8 - c % 8), new this(d);
|
|
3046
|
+
}, r.IPv4.broadcastAddressFromCIDR = function(c) {
|
|
3047
|
+
var u, h, d, p, v;
|
|
3048
|
+
try {
|
|
3049
|
+
for (u = this.parseCIDR(c), d = u[0].toByteArray(), v = this.subnetMaskFromPrefixLength(u[1]).toByteArray(), p = [], h = 0; h < 4; )
|
|
3050
|
+
p.push(parseInt(d[h], 10) | parseInt(v[h], 10) ^ 255), h++;
|
|
3051
|
+
return new this(p);
|
|
3052
|
+
} catch {
|
|
3053
|
+
throw new Error("ipaddr: the address does not have IPv4 CIDR format");
|
|
3054
|
+
}
|
|
3055
|
+
}, r.IPv4.networkAddressFromCIDR = function(c) {
|
|
3056
|
+
var u, h, d, p, v;
|
|
3057
|
+
try {
|
|
3058
|
+
for (u = this.parseCIDR(c), d = u[0].toByteArray(), v = this.subnetMaskFromPrefixLength(u[1]).toByteArray(), p = [], h = 0; h < 4; )
|
|
3059
|
+
p.push(parseInt(d[h], 10) & parseInt(v[h], 10)), h++;
|
|
3060
|
+
return new this(p);
|
|
3061
|
+
} catch {
|
|
3062
|
+
throw new Error("ipaddr: the address does not have IPv4 CIDR format");
|
|
3063
|
+
}
|
|
3064
|
+
}, r.IPv6.parseCIDR = function(c) {
|
|
3065
|
+
var u, h, d;
|
|
3066
|
+
if ((h = c.match(/^(.+)\/(\d+)$/)) && (u = parseInt(h[2]), u >= 0 && u <= 128))
|
|
3067
|
+
return d = [this.parse(h[1]), u], Object.defineProperty(d, "toString", {
|
|
3068
|
+
value: function() {
|
|
3069
|
+
return this.join("/");
|
|
3070
|
+
}
|
|
3071
|
+
}), d;
|
|
3072
|
+
throw new Error("ipaddr: string is not formatted like an IPv6 CIDR range");
|
|
3073
|
+
}, r.isValid = function(c) {
|
|
3074
|
+
return r.IPv6.isValid(c) || r.IPv4.isValid(c);
|
|
3075
|
+
}, r.parse = function(c) {
|
|
3076
|
+
if (r.IPv6.isValid(c))
|
|
3077
|
+
return r.IPv6.parse(c);
|
|
3078
|
+
if (r.IPv4.isValid(c))
|
|
3079
|
+
return r.IPv4.parse(c);
|
|
3080
|
+
throw new Error("ipaddr: the address has neither IPv6 nor IPv4 format");
|
|
3081
|
+
}, r.parseCIDR = function(c) {
|
|
3082
|
+
try {
|
|
3083
|
+
return r.IPv6.parseCIDR(c);
|
|
3084
|
+
} catch {
|
|
3085
|
+
try {
|
|
3086
|
+
return r.IPv4.parseCIDR(c);
|
|
3087
|
+
} catch {
|
|
3088
|
+
throw new Error("ipaddr: the address has neither IPv6 nor IPv4 CIDR format");
|
|
3089
|
+
}
|
|
3090
|
+
}
|
|
3091
|
+
}, r.fromByteArray = function(c) {
|
|
3092
|
+
var u;
|
|
3093
|
+
if (u = c.length, u === 4)
|
|
3094
|
+
return new r.IPv4(c);
|
|
3095
|
+
if (u === 16)
|
|
3096
|
+
return new r.IPv6(c);
|
|
3097
|
+
throw new Error("ipaddr: the binary input is neither an IPv6 nor IPv4 address");
|
|
3098
|
+
}, r.process = function(c) {
|
|
3099
|
+
var u;
|
|
3100
|
+
return u = this.parse(c), u.kind() === "ipv6" && u.isIPv4MappedAddress() ? u.toIPv4Address() : u;
|
|
3101
|
+
};
|
|
3102
|
+
}).call(Mn);
|
|
3103
|
+
})(es);
|
|
3104
|
+
const Vn = (t) => Array.isArray(t) && t.every((e) => Jn(e)), Jn = (t) => !!t.errorCode, ts = async () => {
|
|
3105
|
+
try {
|
|
3106
|
+
const t = await Jt.get("https://api.ipify.org/?format=json");
|
|
3107
|
+
return t.data.ip && Ye.isValid(t.data.ip) ? Ye.parse(t.data.ip).toString() : void 0;
|
|
3108
|
+
} catch {
|
|
3109
|
+
return;
|
|
3110
|
+
}
|
|
3111
|
+
};
|
|
3112
|
+
class rs {
|
|
3113
|
+
constructor(e) {
|
|
3114
|
+
this.client = e, this.list = () => this.client.get("/v1/carriers"), this.get = (r) => this.client.get(`/v1/carriers/${r}`), this.connect = async ({ carrierCode: r, ...n }) => {
|
|
3115
|
+
const i = await ts();
|
|
3116
|
+
return i ? await this.client.post(`/v1/registration/${r}`, {
|
|
3117
|
+
...n,
|
|
3118
|
+
endUserIpAddress: i
|
|
3119
|
+
}) : Promise.reject([new te("Unable to get IP address")]);
|
|
3120
|
+
}, this.addFunds = (r, n) => this.client.put(`/v1/carriers/${r}/add_funds`, n), this.updateAutoFunding = (r, n) => this.client.post(
|
|
3121
|
+
`/v1/carriers/${r}/auto_funding`,
|
|
3122
|
+
n
|
|
3123
|
+
), this.getAutoFunding = (r) => this.client.get(
|
|
3124
|
+
`/v1/carriers/${r}/auto_funding`
|
|
3125
|
+
), this.client = e;
|
|
3126
|
+
}
|
|
3127
|
+
}
|
|
3128
|
+
var xe = {}, ns = {
|
|
3129
|
+
get exports() {
|
|
3130
|
+
return xe;
|
|
3131
|
+
},
|
|
3132
|
+
set exports(t) {
|
|
3133
|
+
xe = t;
|
|
3134
|
+
}
|
|
3135
|
+
};
|
|
3136
|
+
(function(t) {
|
|
3137
|
+
(function(e) {
|
|
3138
|
+
var r = function(y, g, S) {
|
|
3139
|
+
if (!f(g) || u(g) || h(g) || d(g) || l(g))
|
|
3140
|
+
return g;
|
|
3141
|
+
var b, C = 0, P = 0;
|
|
3142
|
+
if (c(g))
|
|
3143
|
+
for (b = [], P = g.length; C < P; C++)
|
|
3144
|
+
b.push(r(y, g[C], S));
|
|
3145
|
+
else {
|
|
3146
|
+
b = {};
|
|
3147
|
+
for (var _ in g)
|
|
3148
|
+
Object.prototype.hasOwnProperty.call(g, _) && (b[y(_, S)] = r(y, g[_], S));
|
|
3149
|
+
}
|
|
3150
|
+
return b;
|
|
3151
|
+
}, n = function(y, g) {
|
|
3152
|
+
g = g || {};
|
|
3153
|
+
var S = g.separator || "_", b = g.split || /(?=[A-Z])/;
|
|
3154
|
+
return y.split(b).join(S);
|
|
3155
|
+
}, i = function(y) {
|
|
3156
|
+
return p(y) ? y : (y = y.replace(/[\-_\s]+(.)?/g, function(g, S) {
|
|
3157
|
+
return S ? S.toUpperCase() : "";
|
|
3158
|
+
}), y.substr(0, 1).toLowerCase() + y.substr(1));
|
|
3159
|
+
}, a = function(y) {
|
|
3160
|
+
var g = i(y);
|
|
3161
|
+
return g.substr(0, 1).toUpperCase() + g.substr(1);
|
|
3162
|
+
}, s = function(y, g) {
|
|
3163
|
+
return n(y, g).toLowerCase();
|
|
3164
|
+
}, o = Object.prototype.toString, l = function(y) {
|
|
3165
|
+
return typeof y == "function";
|
|
3166
|
+
}, f = function(y) {
|
|
3167
|
+
return y === Object(y);
|
|
3168
|
+
}, c = function(y) {
|
|
3169
|
+
return o.call(y) == "[object Array]";
|
|
3170
|
+
}, u = function(y) {
|
|
3171
|
+
return o.call(y) == "[object Date]";
|
|
3172
|
+
}, h = function(y) {
|
|
3173
|
+
return o.call(y) == "[object RegExp]";
|
|
3174
|
+
}, d = function(y) {
|
|
3175
|
+
return o.call(y) == "[object Boolean]";
|
|
3176
|
+
}, p = function(y) {
|
|
3177
|
+
return y = y - 0, y === y;
|
|
3178
|
+
}, v = function(y, g) {
|
|
3179
|
+
var S = g && "process" in g ? g.process : g;
|
|
3180
|
+
return typeof S != "function" ? y : function(b, C) {
|
|
3181
|
+
return S(b, y, C);
|
|
3182
|
+
};
|
|
3183
|
+
}, m = {
|
|
3184
|
+
camelize: i,
|
|
3185
|
+
decamelize: s,
|
|
3186
|
+
pascalize: a,
|
|
3187
|
+
depascalize: s,
|
|
3188
|
+
camelizeKeys: function(y, g) {
|
|
3189
|
+
return r(v(i, g), y);
|
|
3190
|
+
},
|
|
3191
|
+
decamelizeKeys: function(y, g) {
|
|
3192
|
+
return r(v(s, g), y, g);
|
|
3193
|
+
},
|
|
3194
|
+
pascalizeKeys: function(y, g) {
|
|
3195
|
+
return r(v(a, g), y);
|
|
3196
|
+
},
|
|
3197
|
+
depascalizeKeys: function() {
|
|
3198
|
+
return this.decamelizeKeys.apply(this, arguments);
|
|
3199
|
+
}
|
|
3200
|
+
};
|
|
3201
|
+
t.exports ? t.exports = m : e.humps = m;
|
|
3202
|
+
})(Mn);
|
|
3203
|
+
})(ns);
|
|
3204
|
+
var is = function() {
|
|
3205
|
+
if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
|
|
3206
|
+
return !1;
|
|
3207
|
+
if (typeof Symbol.iterator == "symbol")
|
|
3208
|
+
return !0;
|
|
3209
|
+
var e = {}, r = Symbol("test"), n = Object(r);
|
|
3210
|
+
if (typeof r == "string" || Object.prototype.toString.call(r) !== "[object Symbol]" || Object.prototype.toString.call(n) !== "[object Symbol]")
|
|
3211
|
+
return !1;
|
|
3212
|
+
var i = 42;
|
|
3213
|
+
e[r] = i;
|
|
3214
|
+
for (r in e)
|
|
3215
|
+
return !1;
|
|
3216
|
+
if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0)
|
|
3217
|
+
return !1;
|
|
3218
|
+
var a = Object.getOwnPropertySymbols(e);
|
|
3219
|
+
if (a.length !== 1 || a[0] !== r || !Object.prototype.propertyIsEnumerable.call(e, r))
|
|
3220
|
+
return !1;
|
|
3221
|
+
if (typeof Object.getOwnPropertyDescriptor == "function") {
|
|
3222
|
+
var s = Object.getOwnPropertyDescriptor(e, r);
|
|
3223
|
+
if (s.value !== i || s.enumerable !== !0)
|
|
3224
|
+
return !1;
|
|
3225
|
+
}
|
|
3226
|
+
return !0;
|
|
3227
|
+
}, tn = typeof Symbol < "u" && Symbol, as = is, ss = function() {
|
|
3228
|
+
return typeof tn != "function" || typeof Symbol != "function" || typeof tn("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : as();
|
|
3229
|
+
}, os = "Function.prototype.bind called on incompatible ", Ct = Array.prototype.slice, us = Object.prototype.toString, cs = "[object Function]", ls = function(e) {
|
|
3230
|
+
var r = this;
|
|
3231
|
+
if (typeof r != "function" || us.call(r) !== cs)
|
|
3232
|
+
throw new TypeError(os + r);
|
|
3233
|
+
for (var n = Ct.call(arguments, 1), i, a = function() {
|
|
3234
|
+
if (this instanceof i) {
|
|
3235
|
+
var c = r.apply(
|
|
3236
|
+
this,
|
|
3237
|
+
n.concat(Ct.call(arguments))
|
|
3238
|
+
);
|
|
3239
|
+
return Object(c) === c ? c : this;
|
|
3240
|
+
} else
|
|
3241
|
+
return r.apply(
|
|
3242
|
+
e,
|
|
3243
|
+
n.concat(Ct.call(arguments))
|
|
3244
|
+
);
|
|
3245
|
+
}, s = Math.max(0, r.length - n.length), o = [], l = 0; l < s; l++)
|
|
3246
|
+
o.push("$" + l);
|
|
3247
|
+
if (i = Function("binder", "return function (" + o.join(",") + "){ return binder.apply(this,arguments); }")(a), r.prototype) {
|
|
3248
|
+
var f = function() {
|
|
3249
|
+
};
|
|
3250
|
+
f.prototype = r.prototype, i.prototype = new f(), f.prototype = null;
|
|
3251
|
+
}
|
|
3252
|
+
return i;
|
|
3253
|
+
}, fs = ls, pr = Function.prototype.bind || fs, hs = pr, ds = hs.call(Function.call, Object.prototype.hasOwnProperty), O, we = SyntaxError, Xn = Function, Se = TypeError, Ft = function(t) {
|
|
3254
|
+
try {
|
|
3255
|
+
return Xn('"use strict"; return (' + t + ").constructor;")();
|
|
3256
|
+
} catch {
|
|
3257
|
+
}
|
|
3258
|
+
}, de = Object.getOwnPropertyDescriptor;
|
|
3259
|
+
if (de)
|
|
3260
|
+
try {
|
|
3261
|
+
de({}, "");
|
|
3262
|
+
} catch {
|
|
3263
|
+
de = null;
|
|
3264
|
+
}
|
|
3265
|
+
var xt = function() {
|
|
3266
|
+
throw new Se();
|
|
3267
|
+
}, ps = de ? function() {
|
|
3268
|
+
try {
|
|
3269
|
+
return arguments.callee, xt;
|
|
3270
|
+
} catch {
|
|
3271
|
+
try {
|
|
3272
|
+
return de(arguments, "callee").get;
|
|
3273
|
+
} catch {
|
|
3274
|
+
return xt;
|
|
3275
|
+
}
|
|
3276
|
+
}
|
|
3277
|
+
}() : xt, ge = ss(), X = Object.getPrototypeOf || function(t) {
|
|
3278
|
+
return t.__proto__;
|
|
3279
|
+
}, be = {}, ys = typeof Uint8Array > "u" ? O : X(Uint8Array), pe = {
|
|
3280
|
+
"%AggregateError%": typeof AggregateError > "u" ? O : AggregateError,
|
|
3281
|
+
"%Array%": Array,
|
|
3282
|
+
"%ArrayBuffer%": typeof ArrayBuffer > "u" ? O : ArrayBuffer,
|
|
3283
|
+
"%ArrayIteratorPrototype%": ge ? X([][Symbol.iterator]()) : O,
|
|
3284
|
+
"%AsyncFromSyncIteratorPrototype%": O,
|
|
3285
|
+
"%AsyncFunction%": be,
|
|
3286
|
+
"%AsyncGenerator%": be,
|
|
3287
|
+
"%AsyncGeneratorFunction%": be,
|
|
3288
|
+
"%AsyncIteratorPrototype%": be,
|
|
3289
|
+
"%Atomics%": typeof Atomics > "u" ? O : Atomics,
|
|
3290
|
+
"%BigInt%": typeof BigInt > "u" ? O : BigInt,
|
|
3291
|
+
"%BigInt64Array%": typeof BigInt64Array > "u" ? O : BigInt64Array,
|
|
3292
|
+
"%BigUint64Array%": typeof BigUint64Array > "u" ? O : BigUint64Array,
|
|
3293
|
+
"%Boolean%": Boolean,
|
|
3294
|
+
"%DataView%": typeof DataView > "u" ? O : DataView,
|
|
3295
|
+
"%Date%": Date,
|
|
3296
|
+
"%decodeURI%": decodeURI,
|
|
3297
|
+
"%decodeURIComponent%": decodeURIComponent,
|
|
3298
|
+
"%encodeURI%": encodeURI,
|
|
3299
|
+
"%encodeURIComponent%": encodeURIComponent,
|
|
3300
|
+
"%Error%": Error,
|
|
3301
|
+
"%eval%": eval,
|
|
3302
|
+
// eslint-disable-line no-eval
|
|
3303
|
+
"%EvalError%": EvalError,
|
|
3304
|
+
"%Float32Array%": typeof Float32Array > "u" ? O : Float32Array,
|
|
3305
|
+
"%Float64Array%": typeof Float64Array > "u" ? O : Float64Array,
|
|
3306
|
+
"%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? O : FinalizationRegistry,
|
|
3307
|
+
"%Function%": Xn,
|
|
3308
|
+
"%GeneratorFunction%": be,
|
|
3309
|
+
"%Int8Array%": typeof Int8Array > "u" ? O : Int8Array,
|
|
3310
|
+
"%Int16Array%": typeof Int16Array > "u" ? O : Int16Array,
|
|
3311
|
+
"%Int32Array%": typeof Int32Array > "u" ? O : Int32Array,
|
|
3312
|
+
"%isFinite%": isFinite,
|
|
3313
|
+
"%isNaN%": isNaN,
|
|
3314
|
+
"%IteratorPrototype%": ge ? X(X([][Symbol.iterator]())) : O,
|
|
3315
|
+
"%JSON%": typeof JSON == "object" ? JSON : O,
|
|
3316
|
+
"%Map%": typeof Map > "u" ? O : Map,
|
|
3317
|
+
"%MapIteratorPrototype%": typeof Map > "u" || !ge ? O : X((/* @__PURE__ */ new Map())[Symbol.iterator]()),
|
|
3318
|
+
"%Math%": Math,
|
|
3319
|
+
"%Number%": Number,
|
|
3320
|
+
"%Object%": Object,
|
|
3321
|
+
"%parseFloat%": parseFloat,
|
|
3322
|
+
"%parseInt%": parseInt,
|
|
3323
|
+
"%Promise%": typeof Promise > "u" ? O : Promise,
|
|
3324
|
+
"%Proxy%": typeof Proxy > "u" ? O : Proxy,
|
|
3325
|
+
"%RangeError%": RangeError,
|
|
3326
|
+
"%ReferenceError%": ReferenceError,
|
|
3327
|
+
"%Reflect%": typeof Reflect > "u" ? O : Reflect,
|
|
3328
|
+
"%RegExp%": RegExp,
|
|
3329
|
+
"%Set%": typeof Set > "u" ? O : Set,
|
|
3330
|
+
"%SetIteratorPrototype%": typeof Set > "u" || !ge ? O : X((/* @__PURE__ */ new Set())[Symbol.iterator]()),
|
|
3331
|
+
"%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? O : SharedArrayBuffer,
|
|
3332
|
+
"%String%": String,
|
|
3333
|
+
"%StringIteratorPrototype%": ge ? X(""[Symbol.iterator]()) : O,
|
|
3334
|
+
"%Symbol%": ge ? Symbol : O,
|
|
3335
|
+
"%SyntaxError%": we,
|
|
3336
|
+
"%ThrowTypeError%": ps,
|
|
3337
|
+
"%TypedArray%": ys,
|
|
3338
|
+
"%TypeError%": Se,
|
|
3339
|
+
"%Uint8Array%": typeof Uint8Array > "u" ? O : Uint8Array,
|
|
3340
|
+
"%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? O : Uint8ClampedArray,
|
|
3341
|
+
"%Uint16Array%": typeof Uint16Array > "u" ? O : Uint16Array,
|
|
3342
|
+
"%Uint32Array%": typeof Uint32Array > "u" ? O : Uint32Array,
|
|
3343
|
+
"%URIError%": URIError,
|
|
3344
|
+
"%WeakMap%": typeof WeakMap > "u" ? O : WeakMap,
|
|
3345
|
+
"%WeakRef%": typeof WeakRef > "u" ? O : WeakRef,
|
|
3346
|
+
"%WeakSet%": typeof WeakSet > "u" ? O : WeakSet
|
|
3347
|
+
};
|
|
3348
|
+
try {
|
|
3349
|
+
null.error;
|
|
3350
|
+
} catch (t) {
|
|
3351
|
+
var vs = X(X(t));
|
|
3352
|
+
pe["%Error.prototype%"] = vs;
|
|
3353
|
+
}
|
|
3354
|
+
var ms = function t(e) {
|
|
3355
|
+
var r;
|
|
3356
|
+
if (e === "%AsyncFunction%")
|
|
3357
|
+
r = Ft("async function () {}");
|
|
3358
|
+
else if (e === "%GeneratorFunction%")
|
|
3359
|
+
r = Ft("function* () {}");
|
|
3360
|
+
else if (e === "%AsyncGeneratorFunction%")
|
|
3361
|
+
r = Ft("async function* () {}");
|
|
3362
|
+
else if (e === "%AsyncGenerator%") {
|
|
3363
|
+
var n = t("%AsyncGeneratorFunction%");
|
|
3364
|
+
n && (r = n.prototype);
|
|
3365
|
+
} else if (e === "%AsyncIteratorPrototype%") {
|
|
3366
|
+
var i = t("%AsyncGenerator%");
|
|
3367
|
+
i && (r = X(i.prototype));
|
|
3368
|
+
}
|
|
3369
|
+
return pe[e] = r, r;
|
|
3370
|
+
}, rn = {
|
|
3371
|
+
"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
|
|
3372
|
+
"%ArrayPrototype%": ["Array", "prototype"],
|
|
3373
|
+
"%ArrayProto_entries%": ["Array", "prototype", "entries"],
|
|
3374
|
+
"%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
|
|
3375
|
+
"%ArrayProto_keys%": ["Array", "prototype", "keys"],
|
|
3376
|
+
"%ArrayProto_values%": ["Array", "prototype", "values"],
|
|
3377
|
+
"%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
|
|
3378
|
+
"%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
|
|
3379
|
+
"%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
|
|
3380
|
+
"%BooleanPrototype%": ["Boolean", "prototype"],
|
|
3381
|
+
"%DataViewPrototype%": ["DataView", "prototype"],
|
|
3382
|
+
"%DatePrototype%": ["Date", "prototype"],
|
|
3383
|
+
"%ErrorPrototype%": ["Error", "prototype"],
|
|
3384
|
+
"%EvalErrorPrototype%": ["EvalError", "prototype"],
|
|
3385
|
+
"%Float32ArrayPrototype%": ["Float32Array", "prototype"],
|
|
3386
|
+
"%Float64ArrayPrototype%": ["Float64Array", "prototype"],
|
|
3387
|
+
"%FunctionPrototype%": ["Function", "prototype"],
|
|
3388
|
+
"%Generator%": ["GeneratorFunction", "prototype"],
|
|
3389
|
+
"%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
|
|
3390
|
+
"%Int8ArrayPrototype%": ["Int8Array", "prototype"],
|
|
3391
|
+
"%Int16ArrayPrototype%": ["Int16Array", "prototype"],
|
|
3392
|
+
"%Int32ArrayPrototype%": ["Int32Array", "prototype"],
|
|
3393
|
+
"%JSONParse%": ["JSON", "parse"],
|
|
3394
|
+
"%JSONStringify%": ["JSON", "stringify"],
|
|
3395
|
+
"%MapPrototype%": ["Map", "prototype"],
|
|
3396
|
+
"%NumberPrototype%": ["Number", "prototype"],
|
|
3397
|
+
"%ObjectPrototype%": ["Object", "prototype"],
|
|
3398
|
+
"%ObjProto_toString%": ["Object", "prototype", "toString"],
|
|
3399
|
+
"%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
|
|
3400
|
+
"%PromisePrototype%": ["Promise", "prototype"],
|
|
3401
|
+
"%PromiseProto_then%": ["Promise", "prototype", "then"],
|
|
3402
|
+
"%Promise_all%": ["Promise", "all"],
|
|
3403
|
+
"%Promise_reject%": ["Promise", "reject"],
|
|
3404
|
+
"%Promise_resolve%": ["Promise", "resolve"],
|
|
3405
|
+
"%RangeErrorPrototype%": ["RangeError", "prototype"],
|
|
3406
|
+
"%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
|
|
3407
|
+
"%RegExpPrototype%": ["RegExp", "prototype"],
|
|
3408
|
+
"%SetPrototype%": ["Set", "prototype"],
|
|
3409
|
+
"%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
|
|
3410
|
+
"%StringPrototype%": ["String", "prototype"],
|
|
3411
|
+
"%SymbolPrototype%": ["Symbol", "prototype"],
|
|
3412
|
+
"%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
|
|
3413
|
+
"%TypedArrayPrototype%": ["TypedArray", "prototype"],
|
|
3414
|
+
"%TypeErrorPrototype%": ["TypeError", "prototype"],
|
|
3415
|
+
"%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
|
|
3416
|
+
"%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
|
|
3417
|
+
"%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
|
|
3418
|
+
"%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
|
|
3419
|
+
"%URIErrorPrototype%": ["URIError", "prototype"],
|
|
3420
|
+
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
3421
|
+
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
3422
|
+
}, De = pr, Ze = ds, gs = De.call(Function.call, Array.prototype.concat), bs = De.call(Function.apply, Array.prototype.splice), nn = De.call(Function.call, String.prototype.replace), et = De.call(Function.call, String.prototype.slice), Ss = De.call(Function.call, RegExp.prototype.exec), ws = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, Os = /\\(\\)?/g, Ps = function(e) {
|
|
3423
|
+
var r = et(e, 0, 1), n = et(e, -1);
|
|
3424
|
+
if (r === "%" && n !== "%")
|
|
3425
|
+
throw new we("invalid intrinsic syntax, expected closing `%`");
|
|
3426
|
+
if (n === "%" && r !== "%")
|
|
3427
|
+
throw new we("invalid intrinsic syntax, expected opening `%`");
|
|
3428
|
+
var i = [];
|
|
3429
|
+
return nn(e, ws, function(a, s, o, l) {
|
|
3430
|
+
i[i.length] = o ? nn(l, Os, "$1") : s || a;
|
|
3431
|
+
}), i;
|
|
3432
|
+
}, Es = function(e, r) {
|
|
3433
|
+
var n = e, i;
|
|
3434
|
+
if (Ze(rn, n) && (i = rn[n], n = "%" + i[0] + "%"), Ze(pe, n)) {
|
|
3435
|
+
var a = pe[n];
|
|
3436
|
+
if (a === be && (a = ms(n)), typeof a > "u" && !r)
|
|
3437
|
+
throw new Se("intrinsic " + e + " exists, but is not available. Please file an issue!");
|
|
3438
|
+
return {
|
|
3439
|
+
alias: i,
|
|
3440
|
+
name: n,
|
|
3441
|
+
value: a
|
|
3442
|
+
};
|
|
3443
|
+
}
|
|
3444
|
+
throw new we("intrinsic " + e + " does not exist!");
|
|
3445
|
+
}, yr = function(e, r) {
|
|
3446
|
+
if (typeof e != "string" || e.length === 0)
|
|
3447
|
+
throw new Se("intrinsic name must be a non-empty string");
|
|
3448
|
+
if (arguments.length > 1 && typeof r != "boolean")
|
|
3449
|
+
throw new Se('"allowMissing" argument must be a boolean');
|
|
3450
|
+
if (Ss(/^%?[^%]*%?$/, e) === null)
|
|
3451
|
+
throw new we("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
3452
|
+
var n = Ps(e), i = n.length > 0 ? n[0] : "", a = Es("%" + i + "%", r), s = a.name, o = a.value, l = !1, f = a.alias;
|
|
3453
|
+
f && (i = f[0], bs(n, gs([0, 1], f)));
|
|
3454
|
+
for (var c = 1, u = !0; c < n.length; c += 1) {
|
|
3455
|
+
var h = n[c], d = et(h, 0, 1), p = et(h, -1);
|
|
3456
|
+
if ((d === '"' || d === "'" || d === "`" || p === '"' || p === "'" || p === "`") && d !== p)
|
|
3457
|
+
throw new we("property names with quotes must have matching quotes");
|
|
3458
|
+
if ((h === "constructor" || !u) && (l = !0), i += "." + h, s = "%" + i + "%", Ze(pe, s))
|
|
3459
|
+
o = pe[s];
|
|
3460
|
+
else if (o != null) {
|
|
3461
|
+
if (!(h in o)) {
|
|
3462
|
+
if (!r)
|
|
3463
|
+
throw new Se("base intrinsic for " + e + " exists, but the property is not available.");
|
|
3464
|
+
return;
|
|
3465
|
+
}
|
|
3466
|
+
if (de && c + 1 >= n.length) {
|
|
3467
|
+
var v = de(o, h);
|
|
3468
|
+
u = !!v, u && "get" in v && !("originalValue" in v.get) ? o = v.get : o = o[h];
|
|
3469
|
+
} else
|
|
3470
|
+
u = Ze(o, h), o = o[h];
|
|
3471
|
+
u && !l && (pe[s] = o);
|
|
3472
|
+
}
|
|
3473
|
+
}
|
|
3474
|
+
return o;
|
|
3475
|
+
}, Xt = {}, Rs = {
|
|
3476
|
+
get exports() {
|
|
3477
|
+
return Xt;
|
|
3478
|
+
},
|
|
3479
|
+
set exports(t) {
|
|
3480
|
+
Xt = t;
|
|
3481
|
+
}
|
|
3482
|
+
};
|
|
3483
|
+
(function(t) {
|
|
3484
|
+
var e = pr, r = yr, n = r("%Function.prototype.apply%"), i = r("%Function.prototype.call%"), a = r("%Reflect.apply%", !0) || e.call(i, n), s = r("%Object.getOwnPropertyDescriptor%", !0), o = r("%Object.defineProperty%", !0), l = r("%Math.max%");
|
|
3485
|
+
if (o)
|
|
3486
|
+
try {
|
|
3487
|
+
o({}, "a", { value: 1 });
|
|
3488
|
+
} catch {
|
|
3489
|
+
o = null;
|
|
3490
|
+
}
|
|
3491
|
+
t.exports = function(u) {
|
|
3492
|
+
var h = a(e, i, arguments);
|
|
3493
|
+
if (s && o) {
|
|
3494
|
+
var d = s(h, "length");
|
|
3495
|
+
d.configurable && o(
|
|
3496
|
+
h,
|
|
3497
|
+
"length",
|
|
3498
|
+
{ value: 1 + l(0, u.length - (arguments.length - 1)) }
|
|
3499
|
+
);
|
|
3500
|
+
}
|
|
3501
|
+
return h;
|
|
3502
|
+
};
|
|
3503
|
+
var f = function() {
|
|
3504
|
+
return a(e, n, arguments);
|
|
3505
|
+
};
|
|
3506
|
+
o ? o(t.exports, "apply", { value: f }) : t.exports.apply = f;
|
|
3507
|
+
})(Rs);
|
|
3508
|
+
var Yn = yr, Zn = Xt, As = Zn(Yn("String.prototype.indexOf")), Cs = function(e, r) {
|
|
3509
|
+
var n = Yn(e, !!r);
|
|
3510
|
+
return typeof n == "function" && As(e, ".prototype.") > -1 ? Zn(n) : n;
|
|
3511
|
+
};
|
|
3512
|
+
const Fs = {}, xs = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
3513
|
+
__proto__: null,
|
|
3514
|
+
default: Fs
|
|
3515
|
+
}, Symbol.toStringTag, { value: "Module" })), Is = /* @__PURE__ */ ra(xs);
|
|
3516
|
+
var vr = typeof Map == "function" && Map.prototype, It = Object.getOwnPropertyDescriptor && vr ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, tt = vr && It && typeof It.get == "function" ? It.get : null, an = vr && Map.prototype.forEach, mr = typeof Set == "function" && Set.prototype, _t = Object.getOwnPropertyDescriptor && mr ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, rt = mr && _t && typeof _t.get == "function" ? _t.get : null, sn = mr && Set.prototype.forEach, _s = typeof WeakMap == "function" && WeakMap.prototype, Ie = _s ? WeakMap.prototype.has : null, qs = typeof WeakSet == "function" && WeakSet.prototype, _e = qs ? WeakSet.prototype.has : null, $s = typeof WeakRef == "function" && WeakRef.prototype, on = $s ? WeakRef.prototype.deref : null, Ms = Boolean.prototype.valueOf, Ds = Object.prototype.toString, Ts = Function.prototype.toString, Us = String.prototype.match, gr = String.prototype.slice, ie = String.prototype.replace, Ns = String.prototype.toUpperCase, un = String.prototype.toLowerCase, ei = RegExp.prototype.test, cn = Array.prototype.concat, Y = Array.prototype.join, Ls = Array.prototype.slice, ln = Math.floor, Yt = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, qt = Object.getOwnPropertySymbols, Zt = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, Oe = typeof Symbol == "function" && typeof Symbol.iterator == "object", j = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === Oe || "symbol") ? Symbol.toStringTag : null, ti = Object.prototype.propertyIsEnumerable, fn = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(t) {
|
|
3517
|
+
return t.__proto__;
|
|
3518
|
+
} : null);
|
|
3519
|
+
function hn(t, e) {
|
|
3520
|
+
if (t === 1 / 0 || t === -1 / 0 || t !== t || t && t > -1e3 && t < 1e3 || ei.call(/e/, e))
|
|
3521
|
+
return e;
|
|
3522
|
+
var r = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
|
|
3523
|
+
if (typeof t == "number") {
|
|
3524
|
+
var n = t < 0 ? -ln(-t) : ln(t);
|
|
3525
|
+
if (n !== t) {
|
|
3526
|
+
var i = String(n), a = gr.call(e, i.length + 1);
|
|
3527
|
+
return ie.call(i, r, "$&_") + "." + ie.call(ie.call(a, /([0-9]{3})/g, "$&_"), /_$/, "");
|
|
3528
|
+
}
|
|
3529
|
+
}
|
|
3530
|
+
return ie.call(e, r, "$&_");
|
|
3531
|
+
}
|
|
3532
|
+
var er = Is, dn = er.custom, pn = ni(dn) ? dn : null, Qs = function t(e, r, n, i) {
|
|
3533
|
+
var a = r || {};
|
|
3534
|
+
if (ne(a, "quoteStyle") && a.quoteStyle !== "single" && a.quoteStyle !== "double")
|
|
3535
|
+
throw new TypeError('option "quoteStyle" must be "single" or "double"');
|
|
3536
|
+
if (ne(a, "maxStringLength") && (typeof a.maxStringLength == "number" ? a.maxStringLength < 0 && a.maxStringLength !== 1 / 0 : a.maxStringLength !== null))
|
|
3537
|
+
throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
|
|
3538
|
+
var s = ne(a, "customInspect") ? a.customInspect : !0;
|
|
3539
|
+
if (typeof s != "boolean" && s !== "symbol")
|
|
3540
|
+
throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
|
|
3541
|
+
if (ne(a, "indent") && a.indent !== null && a.indent !== " " && !(parseInt(a.indent, 10) === a.indent && a.indent > 0))
|
|
3542
|
+
throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
|
|
3543
|
+
if (ne(a, "numericSeparator") && typeof a.numericSeparator != "boolean")
|
|
3544
|
+
throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
|
|
3545
|
+
var o = a.numericSeparator;
|
|
3546
|
+
if (typeof e > "u")
|
|
3547
|
+
return "undefined";
|
|
3548
|
+
if (e === null)
|
|
3549
|
+
return "null";
|
|
3550
|
+
if (typeof e == "boolean")
|
|
3551
|
+
return e ? "true" : "false";
|
|
3552
|
+
if (typeof e == "string")
|
|
3553
|
+
return ai(e, a);
|
|
3554
|
+
if (typeof e == "number") {
|
|
3555
|
+
if (e === 0)
|
|
3556
|
+
return 1 / 0 / e > 0 ? "0" : "-0";
|
|
3557
|
+
var l = String(e);
|
|
3558
|
+
return o ? hn(e, l) : l;
|
|
3559
|
+
}
|
|
3560
|
+
if (typeof e == "bigint") {
|
|
3561
|
+
var f = String(e) + "n";
|
|
3562
|
+
return o ? hn(e, f) : f;
|
|
3563
|
+
}
|
|
3564
|
+
var c = typeof a.depth > "u" ? 5 : a.depth;
|
|
3565
|
+
if (typeof n > "u" && (n = 0), n >= c && c > 0 && typeof e == "object")
|
|
3566
|
+
return tr(e) ? "[Array]" : "[Object]";
|
|
3567
|
+
var u = io(a, n);
|
|
3568
|
+
if (typeof i > "u")
|
|
3569
|
+
i = [];
|
|
3570
|
+
else if (ii(i, e) >= 0)
|
|
3571
|
+
return "[Circular]";
|
|
3572
|
+
function h(q, I, k) {
|
|
3573
|
+
if (I && (i = Ls.call(i), i.push(I)), k) {
|
|
3574
|
+
var B = {
|
|
3575
|
+
depth: a.depth
|
|
3576
|
+
};
|
|
3577
|
+
return ne(a, "quoteStyle") && (B.quoteStyle = a.quoteStyle), t(q, B, n + 1, i);
|
|
3578
|
+
}
|
|
3579
|
+
return t(q, a, n + 1, i);
|
|
3580
|
+
}
|
|
3581
|
+
if (typeof e == "function" && !yn(e)) {
|
|
3582
|
+
var d = Vs(e), p = Ue(e, h);
|
|
3583
|
+
return "[Function" + (d ? ": " + d : " (anonymous)") + "]" + (p.length > 0 ? " { " + Y.call(p, ", ") + " }" : "");
|
|
3584
|
+
}
|
|
3585
|
+
if (ni(e)) {
|
|
3586
|
+
var v = Oe ? ie.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : Zt.call(e);
|
|
3587
|
+
return typeof e == "object" && !Oe ? Ce(v) : v;
|
|
3588
|
+
}
|
|
3589
|
+
if (to(e)) {
|
|
3590
|
+
for (var m = "<" + un.call(String(e.nodeName)), y = e.attributes || [], g = 0; g < y.length; g++)
|
|
3591
|
+
m += " " + y[g].name + "=" + ri(ks(y[g].value), "double", a);
|
|
3592
|
+
return m += ">", e.childNodes && e.childNodes.length && (m += "..."), m += "</" + un.call(String(e.nodeName)) + ">", m;
|
|
3593
|
+
}
|
|
3594
|
+
if (tr(e)) {
|
|
3595
|
+
if (e.length === 0)
|
|
3596
|
+
return "[]";
|
|
3597
|
+
var S = Ue(e, h);
|
|
3598
|
+
return u && !no(S) ? "[" + rr(S, u) + "]" : "[ " + Y.call(S, ", ") + " ]";
|
|
3599
|
+
}
|
|
3600
|
+
if (js(e)) {
|
|
3601
|
+
var b = Ue(e, h);
|
|
3602
|
+
return !("cause" in Error.prototype) && "cause" in e && !ti.call(e, "cause") ? "{ [" + String(e) + "] " + Y.call(cn.call("[cause]: " + h(e.cause), b), ", ") + " }" : b.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + Y.call(b, ", ") + " }";
|
|
3603
|
+
}
|
|
3604
|
+
if (typeof e == "object" && s) {
|
|
3605
|
+
if (pn && typeof e[pn] == "function" && er)
|
|
3606
|
+
return er(e, { depth: c - n });
|
|
3607
|
+
if (s !== "symbol" && typeof e.inspect == "function")
|
|
3608
|
+
return e.inspect();
|
|
3609
|
+
}
|
|
3610
|
+
if (Js(e)) {
|
|
3611
|
+
var C = [];
|
|
3612
|
+
return an && an.call(e, function(q, I) {
|
|
3613
|
+
C.push(h(I, e, !0) + " => " + h(q, e));
|
|
3614
|
+
}), vn("Map", tt.call(e), C, u);
|
|
3615
|
+
}
|
|
3616
|
+
if (Zs(e)) {
|
|
3617
|
+
var P = [];
|
|
3618
|
+
return sn && sn.call(e, function(q) {
|
|
3619
|
+
P.push(h(q, e));
|
|
3620
|
+
}), vn("Set", rt.call(e), P, u);
|
|
3621
|
+
}
|
|
3622
|
+
if (Xs(e))
|
|
3623
|
+
return $t("WeakMap");
|
|
3624
|
+
if (eo(e))
|
|
3625
|
+
return $t("WeakSet");
|
|
3626
|
+
if (Ys(e))
|
|
3627
|
+
return $t("WeakRef");
|
|
3628
|
+
if (Ks(e))
|
|
3629
|
+
return Ce(h(Number(e)));
|
|
3630
|
+
if (Gs(e))
|
|
3631
|
+
return Ce(h(Yt.call(e)));
|
|
3632
|
+
if (Ws(e))
|
|
3633
|
+
return Ce(Ms.call(e));
|
|
3634
|
+
if (zs(e))
|
|
3635
|
+
return Ce(h(String(e)));
|
|
3636
|
+
if (!Bs(e) && !yn(e)) {
|
|
3637
|
+
var _ = Ue(e, h), G = fn ? fn(e) === Object.prototype : e instanceof Object || e.constructor === Object, Q = e instanceof Object ? "" : "null prototype", A = !G && j && Object(e) === e && j in e ? gr.call(se(e), 8, -1) : Q ? "Object" : "", $ = G || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", x = $ + (A || Q ? "[" + Y.call(cn.call([], A || [], Q || []), ": ") + "] " : "");
|
|
3638
|
+
return _.length === 0 ? x + "{}" : u ? x + "{" + rr(_, u) + "}" : x + "{ " + Y.call(_, ", ") + " }";
|
|
3639
|
+
}
|
|
3640
|
+
return String(e);
|
|
3641
|
+
};
|
|
3642
|
+
function ri(t, e, r) {
|
|
3643
|
+
var n = (r.quoteStyle || e) === "double" ? '"' : "'";
|
|
3644
|
+
return n + t + n;
|
|
3645
|
+
}
|
|
3646
|
+
function ks(t) {
|
|
3647
|
+
return ie.call(String(t), /"/g, """);
|
|
3648
|
+
}
|
|
3649
|
+
function tr(t) {
|
|
3650
|
+
return se(t) === "[object Array]" && (!j || !(typeof t == "object" && j in t));
|
|
3651
|
+
}
|
|
3652
|
+
function Bs(t) {
|
|
3653
|
+
return se(t) === "[object Date]" && (!j || !(typeof t == "object" && j in t));
|
|
3654
|
+
}
|
|
3655
|
+
function yn(t) {
|
|
3656
|
+
return se(t) === "[object RegExp]" && (!j || !(typeof t == "object" && j in t));
|
|
3657
|
+
}
|
|
3658
|
+
function js(t) {
|
|
3659
|
+
return se(t) === "[object Error]" && (!j || !(typeof t == "object" && j in t));
|
|
3660
|
+
}
|
|
3661
|
+
function zs(t) {
|
|
3662
|
+
return se(t) === "[object String]" && (!j || !(typeof t == "object" && j in t));
|
|
3663
|
+
}
|
|
3664
|
+
function Ks(t) {
|
|
3665
|
+
return se(t) === "[object Number]" && (!j || !(typeof t == "object" && j in t));
|
|
3666
|
+
}
|
|
3667
|
+
function Ws(t) {
|
|
3668
|
+
return se(t) === "[object Boolean]" && (!j || !(typeof t == "object" && j in t));
|
|
3669
|
+
}
|
|
3670
|
+
function ni(t) {
|
|
3671
|
+
if (Oe)
|
|
3672
|
+
return t && typeof t == "object" && t instanceof Symbol;
|
|
3673
|
+
if (typeof t == "symbol")
|
|
3674
|
+
return !0;
|
|
3675
|
+
if (!t || typeof t != "object" || !Zt)
|
|
3676
|
+
return !1;
|
|
3677
|
+
try {
|
|
3678
|
+
return Zt.call(t), !0;
|
|
3679
|
+
} catch {
|
|
3680
|
+
}
|
|
3681
|
+
return !1;
|
|
3682
|
+
}
|
|
3683
|
+
function Gs(t) {
|
|
3684
|
+
if (!t || typeof t != "object" || !Yt)
|
|
3685
|
+
return !1;
|
|
3686
|
+
try {
|
|
3687
|
+
return Yt.call(t), !0;
|
|
3688
|
+
} catch {
|
|
3689
|
+
}
|
|
3690
|
+
return !1;
|
|
3691
|
+
}
|
|
3692
|
+
var Hs = Object.prototype.hasOwnProperty || function(t) {
|
|
3693
|
+
return t in this;
|
|
3694
|
+
};
|
|
3695
|
+
function ne(t, e) {
|
|
3696
|
+
return Hs.call(t, e);
|
|
3697
|
+
}
|
|
3698
|
+
function se(t) {
|
|
3699
|
+
return Ds.call(t);
|
|
3700
|
+
}
|
|
3701
|
+
function Vs(t) {
|
|
3702
|
+
if (t.name)
|
|
3703
|
+
return t.name;
|
|
3704
|
+
var e = Us.call(Ts.call(t), /^function\s*([\w$]+)/);
|
|
3705
|
+
return e ? e[1] : null;
|
|
3706
|
+
}
|
|
3707
|
+
function ii(t, e) {
|
|
3708
|
+
if (t.indexOf)
|
|
3709
|
+
return t.indexOf(e);
|
|
3710
|
+
for (var r = 0, n = t.length; r < n; r++)
|
|
3711
|
+
if (t[r] === e)
|
|
3712
|
+
return r;
|
|
3713
|
+
return -1;
|
|
3714
|
+
}
|
|
3715
|
+
function Js(t) {
|
|
3716
|
+
if (!tt || !t || typeof t != "object")
|
|
3717
|
+
return !1;
|
|
3718
|
+
try {
|
|
3719
|
+
tt.call(t);
|
|
3720
|
+
try {
|
|
3721
|
+
rt.call(t);
|
|
3722
|
+
} catch {
|
|
3723
|
+
return !0;
|
|
3724
|
+
}
|
|
3725
|
+
return t instanceof Map;
|
|
3726
|
+
} catch {
|
|
3727
|
+
}
|
|
3728
|
+
return !1;
|
|
3729
|
+
}
|
|
3730
|
+
function Xs(t) {
|
|
3731
|
+
if (!Ie || !t || typeof t != "object")
|
|
3732
|
+
return !1;
|
|
3733
|
+
try {
|
|
3734
|
+
Ie.call(t, Ie);
|
|
3735
|
+
try {
|
|
3736
|
+
_e.call(t, _e);
|
|
3737
|
+
} catch {
|
|
3738
|
+
return !0;
|
|
3739
|
+
}
|
|
3740
|
+
return t instanceof WeakMap;
|
|
3741
|
+
} catch {
|
|
3742
|
+
}
|
|
3743
|
+
return !1;
|
|
3744
|
+
}
|
|
3745
|
+
function Ys(t) {
|
|
3746
|
+
if (!on || !t || typeof t != "object")
|
|
3747
|
+
return !1;
|
|
3748
|
+
try {
|
|
3749
|
+
return on.call(t), !0;
|
|
3750
|
+
} catch {
|
|
3751
|
+
}
|
|
3752
|
+
return !1;
|
|
3753
|
+
}
|
|
3754
|
+
function Zs(t) {
|
|
3755
|
+
if (!rt || !t || typeof t != "object")
|
|
3756
|
+
return !1;
|
|
3757
|
+
try {
|
|
3758
|
+
rt.call(t);
|
|
3759
|
+
try {
|
|
3760
|
+
tt.call(t);
|
|
3761
|
+
} catch {
|
|
3762
|
+
return !0;
|
|
3763
|
+
}
|
|
3764
|
+
return t instanceof Set;
|
|
3765
|
+
} catch {
|
|
3766
|
+
}
|
|
3767
|
+
return !1;
|
|
3768
|
+
}
|
|
3769
|
+
function eo(t) {
|
|
3770
|
+
if (!_e || !t || typeof t != "object")
|
|
3771
|
+
return !1;
|
|
3772
|
+
try {
|
|
3773
|
+
_e.call(t, _e);
|
|
3774
|
+
try {
|
|
3775
|
+
Ie.call(t, Ie);
|
|
3776
|
+
} catch {
|
|
3777
|
+
return !0;
|
|
3778
|
+
}
|
|
3779
|
+
return t instanceof WeakSet;
|
|
3780
|
+
} catch {
|
|
3781
|
+
}
|
|
3782
|
+
return !1;
|
|
3783
|
+
}
|
|
3784
|
+
function to(t) {
|
|
3785
|
+
return !t || typeof t != "object" ? !1 : typeof HTMLElement < "u" && t instanceof HTMLElement ? !0 : typeof t.nodeName == "string" && typeof t.getAttribute == "function";
|
|
3786
|
+
}
|
|
3787
|
+
function ai(t, e) {
|
|
3788
|
+
if (t.length > e.maxStringLength) {
|
|
3789
|
+
var r = t.length - e.maxStringLength, n = "... " + r + " more character" + (r > 1 ? "s" : "");
|
|
3790
|
+
return ai(gr.call(t, 0, e.maxStringLength), e) + n;
|
|
3791
|
+
}
|
|
3792
|
+
var i = ie.call(ie.call(t, /(['\\])/g, "\\$1"), /[\x00-\x1f]/g, ro);
|
|
3793
|
+
return ri(i, "single", e);
|
|
3794
|
+
}
|
|
3795
|
+
function ro(t) {
|
|
3796
|
+
var e = t.charCodeAt(0), r = {
|
|
3797
|
+
8: "b",
|
|
3798
|
+
9: "t",
|
|
3799
|
+
10: "n",
|
|
3800
|
+
12: "f",
|
|
3801
|
+
13: "r"
|
|
3802
|
+
}[e];
|
|
3803
|
+
return r ? "\\" + r : "\\x" + (e < 16 ? "0" : "") + Ns.call(e.toString(16));
|
|
3804
|
+
}
|
|
3805
|
+
function Ce(t) {
|
|
3806
|
+
return "Object(" + t + ")";
|
|
3807
|
+
}
|
|
3808
|
+
function $t(t) {
|
|
3809
|
+
return t + " { ? }";
|
|
3810
|
+
}
|
|
3811
|
+
function vn(t, e, r, n) {
|
|
3812
|
+
var i = n ? rr(r, n) : Y.call(r, ", ");
|
|
3813
|
+
return t + " (" + e + ") {" + i + "}";
|
|
3814
|
+
}
|
|
3815
|
+
function no(t) {
|
|
3816
|
+
for (var e = 0; e < t.length; e++)
|
|
3817
|
+
if (ii(t[e], `
|
|
3818
|
+
`) >= 0)
|
|
3819
|
+
return !1;
|
|
3820
|
+
return !0;
|
|
3821
|
+
}
|
|
3822
|
+
function io(t, e) {
|
|
3823
|
+
var r;
|
|
3824
|
+
if (t.indent === " ")
|
|
3825
|
+
r = " ";
|
|
3826
|
+
else if (typeof t.indent == "number" && t.indent > 0)
|
|
3827
|
+
r = Y.call(Array(t.indent + 1), " ");
|
|
3828
|
+
else
|
|
3829
|
+
return null;
|
|
3830
|
+
return {
|
|
3831
|
+
base: r,
|
|
3832
|
+
prev: Y.call(Array(e + 1), r)
|
|
3833
|
+
};
|
|
3834
|
+
}
|
|
3835
|
+
function rr(t, e) {
|
|
3836
|
+
if (t.length === 0)
|
|
3837
|
+
return "";
|
|
3838
|
+
var r = `
|
|
3839
|
+
` + e.prev + e.base;
|
|
3840
|
+
return r + Y.call(t, "," + r) + `
|
|
3841
|
+
` + e.prev;
|
|
3842
|
+
}
|
|
3843
|
+
function Ue(t, e) {
|
|
3844
|
+
var r = tr(t), n = [];
|
|
3845
|
+
if (r) {
|
|
3846
|
+
n.length = t.length;
|
|
3847
|
+
for (var i = 0; i < t.length; i++)
|
|
3848
|
+
n[i] = ne(t, i) ? e(t[i], t) : "";
|
|
3849
|
+
}
|
|
3850
|
+
var a = typeof qt == "function" ? qt(t) : [], s;
|
|
3851
|
+
if (Oe) {
|
|
3852
|
+
s = {};
|
|
3853
|
+
for (var o = 0; o < a.length; o++)
|
|
3854
|
+
s["$" + a[o]] = a[o];
|
|
3855
|
+
}
|
|
3856
|
+
for (var l in t)
|
|
3857
|
+
ne(t, l) && (r && String(Number(l)) === l && l < t.length || Oe && s["$" + l] instanceof Symbol || (ei.call(/[^\w$]/, l) ? n.push(e(l, t) + ": " + e(t[l], t)) : n.push(l + ": " + e(t[l], t))));
|
|
3858
|
+
if (typeof qt == "function")
|
|
3859
|
+
for (var f = 0; f < a.length; f++)
|
|
3860
|
+
ti.call(t, a[f]) && n.push("[" + e(a[f]) + "]: " + e(t[a[f]], t));
|
|
3861
|
+
return n;
|
|
3862
|
+
}
|
|
3863
|
+
var br = yr, Ae = Cs, ao = Qs, so = br("%TypeError%"), Ne = br("%WeakMap%", !0), Le = br("%Map%", !0), oo = Ae("WeakMap.prototype.get", !0), uo = Ae("WeakMap.prototype.set", !0), co = Ae("WeakMap.prototype.has", !0), lo = Ae("Map.prototype.get", !0), fo = Ae("Map.prototype.set", !0), ho = Ae("Map.prototype.has", !0), Sr = function(t, e) {
|
|
3864
|
+
for (var r = t, n; (n = r.next) !== null; r = n)
|
|
3865
|
+
if (n.key === e)
|
|
3866
|
+
return r.next = n.next, n.next = t.next, t.next = n, n;
|
|
3867
|
+
}, po = function(t, e) {
|
|
3868
|
+
var r = Sr(t, e);
|
|
3869
|
+
return r && r.value;
|
|
3870
|
+
}, yo = function(t, e, r) {
|
|
3871
|
+
var n = Sr(t, e);
|
|
3872
|
+
n ? n.value = r : t.next = {
|
|
3873
|
+
// eslint-disable-line no-param-reassign
|
|
3874
|
+
key: e,
|
|
3875
|
+
next: t.next,
|
|
3876
|
+
value: r
|
|
3877
|
+
};
|
|
3878
|
+
}, vo = function(t, e) {
|
|
3879
|
+
return !!Sr(t, e);
|
|
3880
|
+
}, mo = function() {
|
|
3881
|
+
var e, r, n, i = {
|
|
3882
|
+
assert: function(a) {
|
|
3883
|
+
if (!i.has(a))
|
|
3884
|
+
throw new so("Side channel does not contain " + ao(a));
|
|
3885
|
+
},
|
|
3886
|
+
get: function(a) {
|
|
3887
|
+
if (Ne && a && (typeof a == "object" || typeof a == "function")) {
|
|
3888
|
+
if (e)
|
|
3889
|
+
return oo(e, a);
|
|
3890
|
+
} else if (Le) {
|
|
3891
|
+
if (r)
|
|
3892
|
+
return lo(r, a);
|
|
3893
|
+
} else if (n)
|
|
3894
|
+
return po(n, a);
|
|
3895
|
+
},
|
|
3896
|
+
has: function(a) {
|
|
3897
|
+
if (Ne && a && (typeof a == "object" || typeof a == "function")) {
|
|
3898
|
+
if (e)
|
|
3899
|
+
return co(e, a);
|
|
3900
|
+
} else if (Le) {
|
|
3901
|
+
if (r)
|
|
3902
|
+
return ho(r, a);
|
|
3903
|
+
} else if (n)
|
|
3904
|
+
return vo(n, a);
|
|
3905
|
+
return !1;
|
|
3906
|
+
},
|
|
3907
|
+
set: function(a, s) {
|
|
3908
|
+
Ne && a && (typeof a == "object" || typeof a == "function") ? (e || (e = new Ne()), uo(e, a, s)) : Le ? (r || (r = new Le()), fo(r, a, s)) : (n || (n = { key: {}, next: null }), yo(n, a, s));
|
|
3909
|
+
}
|
|
3910
|
+
};
|
|
3911
|
+
return i;
|
|
3912
|
+
}, go = String.prototype.replace, bo = /%20/g, Mt = {
|
|
3913
|
+
RFC1738: "RFC1738",
|
|
3914
|
+
RFC3986: "RFC3986"
|
|
3915
|
+
}, wr = {
|
|
3916
|
+
default: Mt.RFC3986,
|
|
3917
|
+
formatters: {
|
|
3918
|
+
RFC1738: function(t) {
|
|
3919
|
+
return go.call(t, bo, "+");
|
|
3920
|
+
},
|
|
3921
|
+
RFC3986: function(t) {
|
|
3922
|
+
return String(t);
|
|
3923
|
+
}
|
|
3924
|
+
},
|
|
3925
|
+
RFC1738: Mt.RFC1738,
|
|
3926
|
+
RFC3986: Mt.RFC3986
|
|
3927
|
+
}, So = wr, Dt = Object.prototype.hasOwnProperty, fe = Array.isArray, J = function() {
|
|
3928
|
+
for (var t = [], e = 0; e < 256; ++e)
|
|
3929
|
+
t.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase());
|
|
3930
|
+
return t;
|
|
3931
|
+
}(), wo = function(e) {
|
|
3932
|
+
for (; e.length > 1; ) {
|
|
3933
|
+
var r = e.pop(), n = r.obj[r.prop];
|
|
3934
|
+
if (fe(n)) {
|
|
3935
|
+
for (var i = [], a = 0; a < n.length; ++a)
|
|
3936
|
+
typeof n[a] < "u" && i.push(n[a]);
|
|
3937
|
+
r.obj[r.prop] = i;
|
|
3938
|
+
}
|
|
3939
|
+
}
|
|
3940
|
+
}, si = function(e, r) {
|
|
3941
|
+
for (var n = r && r.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, i = 0; i < e.length; ++i)
|
|
3942
|
+
typeof e[i] < "u" && (n[i] = e[i]);
|
|
3943
|
+
return n;
|
|
3944
|
+
}, Oo = function t(e, r, n) {
|
|
3945
|
+
if (!r)
|
|
3946
|
+
return e;
|
|
3947
|
+
if (typeof r != "object") {
|
|
3948
|
+
if (fe(e))
|
|
3949
|
+
e.push(r);
|
|
3950
|
+
else if (e && typeof e == "object")
|
|
3951
|
+
(n && (n.plainObjects || n.allowPrototypes) || !Dt.call(Object.prototype, r)) && (e[r] = !0);
|
|
3952
|
+
else
|
|
3953
|
+
return [e, r];
|
|
3954
|
+
return e;
|
|
3955
|
+
}
|
|
3956
|
+
if (!e || typeof e != "object")
|
|
3957
|
+
return [e].concat(r);
|
|
3958
|
+
var i = e;
|
|
3959
|
+
return fe(e) && !fe(r) && (i = si(e, n)), fe(e) && fe(r) ? (r.forEach(function(a, s) {
|
|
3960
|
+
if (Dt.call(e, s)) {
|
|
3961
|
+
var o = e[s];
|
|
3962
|
+
o && typeof o == "object" && a && typeof a == "object" ? e[s] = t(o, a, n) : e.push(a);
|
|
3963
|
+
} else
|
|
3964
|
+
e[s] = a;
|
|
3965
|
+
}), e) : Object.keys(r).reduce(function(a, s) {
|
|
3966
|
+
var o = r[s];
|
|
3967
|
+
return Dt.call(a, s) ? a[s] = t(a[s], o, n) : a[s] = o, a;
|
|
3968
|
+
}, i);
|
|
3969
|
+
}, Po = function(e, r) {
|
|
3970
|
+
return Object.keys(r).reduce(function(n, i) {
|
|
3971
|
+
return n[i] = r[i], n;
|
|
3972
|
+
}, e);
|
|
3973
|
+
}, Eo = function(t, e, r) {
|
|
3974
|
+
var n = t.replace(/\+/g, " ");
|
|
3975
|
+
if (r === "iso-8859-1")
|
|
3976
|
+
return n.replace(/%[0-9a-f]{2}/gi, unescape);
|
|
3977
|
+
try {
|
|
3978
|
+
return decodeURIComponent(n);
|
|
3979
|
+
} catch {
|
|
3980
|
+
return n;
|
|
3981
|
+
}
|
|
3982
|
+
}, Ro = function(e, r, n, i, a) {
|
|
3983
|
+
if (e.length === 0)
|
|
3984
|
+
return e;
|
|
3985
|
+
var s = e;
|
|
3986
|
+
if (typeof e == "symbol" ? s = Symbol.prototype.toString.call(e) : typeof e != "string" && (s = String(e)), n === "iso-8859-1")
|
|
3987
|
+
return escape(s).replace(/%u[0-9a-f]{4}/gi, function(c) {
|
|
3988
|
+
return "%26%23" + parseInt(c.slice(2), 16) + "%3B";
|
|
3989
|
+
});
|
|
3990
|
+
for (var o = "", l = 0; l < s.length; ++l) {
|
|
3991
|
+
var f = s.charCodeAt(l);
|
|
3992
|
+
if (f === 45 || f === 46 || f === 95 || f === 126 || f >= 48 && f <= 57 || f >= 65 && f <= 90 || f >= 97 && f <= 122 || a === So.RFC1738 && (f === 40 || f === 41)) {
|
|
3993
|
+
o += s.charAt(l);
|
|
3994
|
+
continue;
|
|
3995
|
+
}
|
|
3996
|
+
if (f < 128) {
|
|
3997
|
+
o = o + J[f];
|
|
3998
|
+
continue;
|
|
3999
|
+
}
|
|
4000
|
+
if (f < 2048) {
|
|
4001
|
+
o = o + (J[192 | f >> 6] + J[128 | f & 63]);
|
|
4002
|
+
continue;
|
|
4003
|
+
}
|
|
4004
|
+
if (f < 55296 || f >= 57344) {
|
|
4005
|
+
o = o + (J[224 | f >> 12] + J[128 | f >> 6 & 63] + J[128 | f & 63]);
|
|
4006
|
+
continue;
|
|
4007
|
+
}
|
|
4008
|
+
l += 1, f = 65536 + ((f & 1023) << 10 | s.charCodeAt(l) & 1023), o += J[240 | f >> 18] + J[128 | f >> 12 & 63] + J[128 | f >> 6 & 63] + J[128 | f & 63];
|
|
4009
|
+
}
|
|
4010
|
+
return o;
|
|
4011
|
+
}, Ao = function(e) {
|
|
4012
|
+
for (var r = [{ obj: { o: e }, prop: "o" }], n = [], i = 0; i < r.length; ++i)
|
|
4013
|
+
for (var a = r[i], s = a.obj[a.prop], o = Object.keys(s), l = 0; l < o.length; ++l) {
|
|
4014
|
+
var f = o[l], c = s[f];
|
|
4015
|
+
typeof c == "object" && c !== null && n.indexOf(c) === -1 && (r.push({ obj: s, prop: f }), n.push(c));
|
|
4016
|
+
}
|
|
4017
|
+
return wo(r), e;
|
|
4018
|
+
}, Co = function(e) {
|
|
4019
|
+
return Object.prototype.toString.call(e) === "[object RegExp]";
|
|
4020
|
+
}, Fo = function(e) {
|
|
4021
|
+
return !e || typeof e != "object" ? !1 : !!(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e));
|
|
4022
|
+
}, xo = function(e, r) {
|
|
4023
|
+
return [].concat(e, r);
|
|
4024
|
+
}, Io = function(e, r) {
|
|
4025
|
+
if (fe(e)) {
|
|
4026
|
+
for (var n = [], i = 0; i < e.length; i += 1)
|
|
4027
|
+
n.push(r(e[i]));
|
|
4028
|
+
return n;
|
|
4029
|
+
}
|
|
4030
|
+
return r(e);
|
|
4031
|
+
}, oi = {
|
|
4032
|
+
arrayToObject: si,
|
|
4033
|
+
assign: Po,
|
|
4034
|
+
combine: xo,
|
|
4035
|
+
compact: Ao,
|
|
4036
|
+
decode: Eo,
|
|
4037
|
+
encode: Ro,
|
|
4038
|
+
isBuffer: Fo,
|
|
4039
|
+
isRegExp: Co,
|
|
4040
|
+
maybeMap: Io,
|
|
4041
|
+
merge: Oo
|
|
4042
|
+
}, ui = mo, nr = oi, qe = wr, _o = Object.prototype.hasOwnProperty, mn = {
|
|
4043
|
+
brackets: function(e) {
|
|
4044
|
+
return e + "[]";
|
|
4045
|
+
},
|
|
4046
|
+
comma: "comma",
|
|
4047
|
+
indices: function(e, r) {
|
|
4048
|
+
return e + "[" + r + "]";
|
|
4049
|
+
},
|
|
4050
|
+
repeat: function(e) {
|
|
4051
|
+
return e;
|
|
4052
|
+
}
|
|
4053
|
+
}, ee = Array.isArray, qo = String.prototype.split, $o = Array.prototype.push, ci = function(t, e) {
|
|
4054
|
+
$o.apply(t, ee(e) ? e : [e]);
|
|
4055
|
+
}, Mo = Date.prototype.toISOString, gn = qe.default, T = {
|
|
4056
|
+
addQueryPrefix: !1,
|
|
4057
|
+
allowDots: !1,
|
|
4058
|
+
charset: "utf-8",
|
|
4059
|
+
charsetSentinel: !1,
|
|
4060
|
+
delimiter: "&",
|
|
4061
|
+
encode: !0,
|
|
4062
|
+
encoder: nr.encode,
|
|
4063
|
+
encodeValuesOnly: !1,
|
|
4064
|
+
format: gn,
|
|
4065
|
+
formatter: qe.formatters[gn],
|
|
4066
|
+
// deprecated
|
|
4067
|
+
indices: !1,
|
|
4068
|
+
serializeDate: function(e) {
|
|
4069
|
+
return Mo.call(e);
|
|
4070
|
+
},
|
|
4071
|
+
skipNulls: !1,
|
|
4072
|
+
strictNullHandling: !1
|
|
4073
|
+
}, Do = function(e) {
|
|
4074
|
+
return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint";
|
|
4075
|
+
}, Tt = {}, To = function t(e, r, n, i, a, s, o, l, f, c, u, h, d, p, v, m) {
|
|
4076
|
+
for (var y = e, g = m, S = 0, b = !1; (g = g.get(Tt)) !== void 0 && !b; ) {
|
|
4077
|
+
var C = g.get(e);
|
|
4078
|
+
if (S += 1, typeof C < "u") {
|
|
4079
|
+
if (C === S)
|
|
4080
|
+
throw new RangeError("Cyclic object value");
|
|
4081
|
+
b = !0;
|
|
4082
|
+
}
|
|
4083
|
+
typeof g.get(Tt) > "u" && (S = 0);
|
|
4084
|
+
}
|
|
4085
|
+
if (typeof l == "function" ? y = l(r, y) : y instanceof Date ? y = u(y) : n === "comma" && ee(y) && (y = nr.maybeMap(y, function(V) {
|
|
4086
|
+
return V instanceof Date ? u(V) : V;
|
|
4087
|
+
})), y === null) {
|
|
4088
|
+
if (a)
|
|
4089
|
+
return o && !p ? o(r, T.encoder, v, "key", h) : r;
|
|
4090
|
+
y = "";
|
|
4091
|
+
}
|
|
4092
|
+
if (Do(y) || nr.isBuffer(y)) {
|
|
4093
|
+
if (o) {
|
|
4094
|
+
var P = p ? r : o(r, T.encoder, v, "key", h);
|
|
4095
|
+
if (n === "comma" && p) {
|
|
4096
|
+
for (var _ = qo.call(String(y), ","), G = "", Q = 0; Q < _.length; ++Q)
|
|
4097
|
+
G += (Q === 0 ? "" : ",") + d(o(_[Q], T.encoder, v, "value", h));
|
|
4098
|
+
return [d(P) + (i && ee(y) && _.length === 1 ? "[]" : "") + "=" + G];
|
|
4099
|
+
}
|
|
4100
|
+
return [d(P) + "=" + d(o(y, T.encoder, v, "value", h))];
|
|
4101
|
+
}
|
|
4102
|
+
return [d(r) + "=" + d(String(y))];
|
|
4103
|
+
}
|
|
4104
|
+
var A = [];
|
|
4105
|
+
if (typeof y > "u")
|
|
4106
|
+
return A;
|
|
4107
|
+
var $;
|
|
4108
|
+
if (n === "comma" && ee(y))
|
|
4109
|
+
$ = [{ value: y.length > 0 ? y.join(",") || null : void 0 }];
|
|
4110
|
+
else if (ee(l))
|
|
4111
|
+
$ = l;
|
|
4112
|
+
else {
|
|
4113
|
+
var x = Object.keys(y);
|
|
4114
|
+
$ = f ? x.sort(f) : x;
|
|
4115
|
+
}
|
|
4116
|
+
for (var q = i && ee(y) && y.length === 1 ? r + "[]" : r, I = 0; I < $.length; ++I) {
|
|
4117
|
+
var k = $[I], B = typeof k == "object" && typeof k.value < "u" ? k.value : y[k];
|
|
4118
|
+
if (!(s && B === null)) {
|
|
4119
|
+
var oe = ee(y) ? typeof n == "function" ? n(q, k) : q : q + (c ? "." + k : "[" + k + "]");
|
|
4120
|
+
m.set(e, S);
|
|
4121
|
+
var H = ui();
|
|
4122
|
+
H.set(Tt, m), ci(A, t(
|
|
4123
|
+
B,
|
|
4124
|
+
oe,
|
|
4125
|
+
n,
|
|
4126
|
+
i,
|
|
4127
|
+
a,
|
|
4128
|
+
s,
|
|
4129
|
+
o,
|
|
4130
|
+
l,
|
|
4131
|
+
f,
|
|
4132
|
+
c,
|
|
4133
|
+
u,
|
|
4134
|
+
h,
|
|
4135
|
+
d,
|
|
4136
|
+
p,
|
|
4137
|
+
v,
|
|
4138
|
+
H
|
|
4139
|
+
));
|
|
4140
|
+
}
|
|
4141
|
+
}
|
|
4142
|
+
return A;
|
|
4143
|
+
}, Uo = function(e) {
|
|
4144
|
+
if (!e)
|
|
4145
|
+
return T;
|
|
4146
|
+
if (e.encoder !== null && typeof e.encoder < "u" && typeof e.encoder != "function")
|
|
4147
|
+
throw new TypeError("Encoder has to be a function.");
|
|
4148
|
+
var r = e.charset || T.charset;
|
|
4149
|
+
if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
|
|
4150
|
+
throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
|
|
4151
|
+
var n = qe.default;
|
|
4152
|
+
if (typeof e.format < "u") {
|
|
4153
|
+
if (!_o.call(qe.formatters, e.format))
|
|
4154
|
+
throw new TypeError("Unknown format option provided.");
|
|
4155
|
+
n = e.format;
|
|
4156
|
+
}
|
|
4157
|
+
var i = qe.formatters[n], a = T.filter;
|
|
4158
|
+
return (typeof e.filter == "function" || ee(e.filter)) && (a = e.filter), {
|
|
4159
|
+
addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix : T.addQueryPrefix,
|
|
4160
|
+
allowDots: typeof e.allowDots > "u" ? T.allowDots : !!e.allowDots,
|
|
4161
|
+
charset: r,
|
|
4162
|
+
charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : T.charsetSentinel,
|
|
4163
|
+
delimiter: typeof e.delimiter > "u" ? T.delimiter : e.delimiter,
|
|
4164
|
+
encode: typeof e.encode == "boolean" ? e.encode : T.encode,
|
|
4165
|
+
encoder: typeof e.encoder == "function" ? e.encoder : T.encoder,
|
|
4166
|
+
encodeValuesOnly: typeof e.encodeValuesOnly == "boolean" ? e.encodeValuesOnly : T.encodeValuesOnly,
|
|
4167
|
+
filter: a,
|
|
4168
|
+
format: n,
|
|
4169
|
+
formatter: i,
|
|
4170
|
+
serializeDate: typeof e.serializeDate == "function" ? e.serializeDate : T.serializeDate,
|
|
4171
|
+
skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls : T.skipNulls,
|
|
4172
|
+
sort: typeof e.sort == "function" ? e.sort : null,
|
|
4173
|
+
strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : T.strictNullHandling
|
|
4174
|
+
};
|
|
4175
|
+
}, No = function(t, e) {
|
|
4176
|
+
var r = t, n = Uo(e), i, a;
|
|
4177
|
+
typeof n.filter == "function" ? (a = n.filter, r = a("", r)) : ee(n.filter) && (a = n.filter, i = a);
|
|
4178
|
+
var s = [];
|
|
4179
|
+
if (typeof r != "object" || r === null)
|
|
4180
|
+
return "";
|
|
4181
|
+
var o;
|
|
4182
|
+
e && e.arrayFormat in mn ? o = e.arrayFormat : e && "indices" in e ? o = e.indices ? "indices" : "repeat" : o = "indices";
|
|
4183
|
+
var l = mn[o];
|
|
4184
|
+
if (e && "commaRoundTrip" in e && typeof e.commaRoundTrip != "boolean")
|
|
4185
|
+
throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
|
|
4186
|
+
var f = l === "comma" && e && e.commaRoundTrip;
|
|
4187
|
+
i || (i = Object.keys(r)), n.sort && i.sort(n.sort);
|
|
4188
|
+
for (var c = ui(), u = 0; u < i.length; ++u) {
|
|
4189
|
+
var h = i[u];
|
|
4190
|
+
n.skipNulls && r[h] === null || ci(s, To(
|
|
4191
|
+
r[h],
|
|
4192
|
+
h,
|
|
4193
|
+
l,
|
|
4194
|
+
f,
|
|
4195
|
+
n.strictNullHandling,
|
|
4196
|
+
n.skipNulls,
|
|
4197
|
+
n.encode ? n.encoder : null,
|
|
4198
|
+
n.filter,
|
|
4199
|
+
n.sort,
|
|
4200
|
+
n.allowDots,
|
|
4201
|
+
n.serializeDate,
|
|
4202
|
+
n.format,
|
|
4203
|
+
n.formatter,
|
|
4204
|
+
n.encodeValuesOnly,
|
|
4205
|
+
n.charset,
|
|
4206
|
+
c
|
|
4207
|
+
));
|
|
4208
|
+
}
|
|
4209
|
+
var d = s.join(n.delimiter), p = n.addQueryPrefix === !0 ? "?" : "";
|
|
4210
|
+
return n.charsetSentinel && (n.charset === "iso-8859-1" ? p += "utf8=%26%2310003%3B&" : p += "utf8=%E2%9C%93&"), d.length > 0 ? p + d : "";
|
|
4211
|
+
}, Pe = oi, ir = Object.prototype.hasOwnProperty, Lo = Array.isArray, D = {
|
|
4212
|
+
allowDots: !1,
|
|
4213
|
+
allowPrototypes: !1,
|
|
4214
|
+
allowSparse: !1,
|
|
4215
|
+
arrayLimit: 20,
|
|
4216
|
+
charset: "utf-8",
|
|
4217
|
+
charsetSentinel: !1,
|
|
4218
|
+
comma: !1,
|
|
4219
|
+
decoder: Pe.decode,
|
|
4220
|
+
delimiter: "&",
|
|
4221
|
+
depth: 5,
|
|
4222
|
+
ignoreQueryPrefix: !1,
|
|
4223
|
+
interpretNumericEntities: !1,
|
|
4224
|
+
parameterLimit: 1e3,
|
|
4225
|
+
parseArrays: !0,
|
|
4226
|
+
plainObjects: !1,
|
|
4227
|
+
strictNullHandling: !1
|
|
4228
|
+
}, Qo = function(t) {
|
|
4229
|
+
return t.replace(/&#(\d+);/g, function(e, r) {
|
|
4230
|
+
return String.fromCharCode(parseInt(r, 10));
|
|
4231
|
+
});
|
|
4232
|
+
}, li = function(t, e) {
|
|
4233
|
+
return t && typeof t == "string" && e.comma && t.indexOf(",") > -1 ? t.split(",") : t;
|
|
4234
|
+
}, ko = "utf8=%26%2310003%3B", Bo = "utf8=%E2%9C%93", jo = function(e, r) {
|
|
4235
|
+
var n = {}, i = r.ignoreQueryPrefix ? e.replace(/^\?/, "") : e, a = r.parameterLimit === 1 / 0 ? void 0 : r.parameterLimit, s = i.split(r.delimiter, a), o = -1, l, f = r.charset;
|
|
4236
|
+
if (r.charsetSentinel)
|
|
4237
|
+
for (l = 0; l < s.length; ++l)
|
|
4238
|
+
s[l].indexOf("utf8=") === 0 && (s[l] === Bo ? f = "utf-8" : s[l] === ko && (f = "iso-8859-1"), o = l, l = s.length);
|
|
4239
|
+
for (l = 0; l < s.length; ++l)
|
|
4240
|
+
if (l !== o) {
|
|
4241
|
+
var c = s[l], u = c.indexOf("]="), h = u === -1 ? c.indexOf("=") : u + 1, d, p;
|
|
4242
|
+
h === -1 ? (d = r.decoder(c, D.decoder, f, "key"), p = r.strictNullHandling ? null : "") : (d = r.decoder(c.slice(0, h), D.decoder, f, "key"), p = Pe.maybeMap(
|
|
4243
|
+
li(c.slice(h + 1), r),
|
|
4244
|
+
function(v) {
|
|
4245
|
+
return r.decoder(v, D.decoder, f, "value");
|
|
4246
|
+
}
|
|
4247
|
+
)), p && r.interpretNumericEntities && f === "iso-8859-1" && (p = Qo(p)), c.indexOf("[]=") > -1 && (p = Lo(p) ? [p] : p), ir.call(n, d) ? n[d] = Pe.combine(n[d], p) : n[d] = p;
|
|
4248
|
+
}
|
|
4249
|
+
return n;
|
|
4250
|
+
}, zo = function(t, e, r, n) {
|
|
4251
|
+
for (var i = n ? e : li(e, r), a = t.length - 1; a >= 0; --a) {
|
|
4252
|
+
var s, o = t[a];
|
|
4253
|
+
if (o === "[]" && r.parseArrays)
|
|
4254
|
+
s = [].concat(i);
|
|
4255
|
+
else {
|
|
4256
|
+
s = r.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
4257
|
+
var l = o.charAt(0) === "[" && o.charAt(o.length - 1) === "]" ? o.slice(1, -1) : o, f = parseInt(l, 10);
|
|
4258
|
+
!r.parseArrays && l === "" ? s = { 0: i } : !isNaN(f) && o !== l && String(f) === l && f >= 0 && r.parseArrays && f <= r.arrayLimit ? (s = [], s[f] = i) : l !== "__proto__" && (s[l] = i);
|
|
4259
|
+
}
|
|
4260
|
+
i = s;
|
|
4261
|
+
}
|
|
4262
|
+
return i;
|
|
4263
|
+
}, Ko = function(e, r, n, i) {
|
|
4264
|
+
if (e) {
|
|
4265
|
+
var a = n.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e, s = /(\[[^[\]]*])/, o = /(\[[^[\]]*])/g, l = n.depth > 0 && s.exec(a), f = l ? a.slice(0, l.index) : a, c = [];
|
|
4266
|
+
if (f) {
|
|
4267
|
+
if (!n.plainObjects && ir.call(Object.prototype, f) && !n.allowPrototypes)
|
|
4268
|
+
return;
|
|
4269
|
+
c.push(f);
|
|
4270
|
+
}
|
|
4271
|
+
for (var u = 0; n.depth > 0 && (l = o.exec(a)) !== null && u < n.depth; ) {
|
|
4272
|
+
if (u += 1, !n.plainObjects && ir.call(Object.prototype, l[1].slice(1, -1)) && !n.allowPrototypes)
|
|
4273
|
+
return;
|
|
4274
|
+
c.push(l[1]);
|
|
4275
|
+
}
|
|
4276
|
+
return l && c.push("[" + a.slice(l.index) + "]"), zo(c, r, n, i);
|
|
4277
|
+
}
|
|
4278
|
+
}, Wo = function(e) {
|
|
4279
|
+
if (!e)
|
|
4280
|
+
return D;
|
|
4281
|
+
if (e.decoder !== null && e.decoder !== void 0 && typeof e.decoder != "function")
|
|
4282
|
+
throw new TypeError("Decoder has to be a function.");
|
|
4283
|
+
if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
|
|
4284
|
+
throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
|
|
4285
|
+
var r = typeof e.charset > "u" ? D.charset : e.charset;
|
|
4286
|
+
return {
|
|
4287
|
+
allowDots: typeof e.allowDots > "u" ? D.allowDots : !!e.allowDots,
|
|
4288
|
+
allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes : D.allowPrototypes,
|
|
4289
|
+
allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse : D.allowSparse,
|
|
4290
|
+
arrayLimit: typeof e.arrayLimit == "number" ? e.arrayLimit : D.arrayLimit,
|
|
4291
|
+
charset: r,
|
|
4292
|
+
charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : D.charsetSentinel,
|
|
4293
|
+
comma: typeof e.comma == "boolean" ? e.comma : D.comma,
|
|
4294
|
+
decoder: typeof e.decoder == "function" ? e.decoder : D.decoder,
|
|
4295
|
+
delimiter: typeof e.delimiter == "string" || Pe.isRegExp(e.delimiter) ? e.delimiter : D.delimiter,
|
|
4296
|
+
// eslint-disable-next-line no-implicit-coercion, no-extra-parens
|
|
4297
|
+
depth: typeof e.depth == "number" || e.depth === !1 ? +e.depth : D.depth,
|
|
4298
|
+
ignoreQueryPrefix: e.ignoreQueryPrefix === !0,
|
|
4299
|
+
interpretNumericEntities: typeof e.interpretNumericEntities == "boolean" ? e.interpretNumericEntities : D.interpretNumericEntities,
|
|
4300
|
+
parameterLimit: typeof e.parameterLimit == "number" ? e.parameterLimit : D.parameterLimit,
|
|
4301
|
+
parseArrays: e.parseArrays !== !1,
|
|
4302
|
+
plainObjects: typeof e.plainObjects == "boolean" ? e.plainObjects : D.plainObjects,
|
|
4303
|
+
strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : D.strictNullHandling
|
|
4304
|
+
};
|
|
4305
|
+
}, Go = function(t, e) {
|
|
4306
|
+
var r = Wo(e);
|
|
4307
|
+
if (t === "" || t === null || typeof t > "u")
|
|
4308
|
+
return r.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
4309
|
+
for (var n = typeof t == "string" ? jo(t, r) : t, i = r.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, a = Object.keys(n), s = 0; s < a.length; ++s) {
|
|
4310
|
+
var o = a[s], l = Ko(o, n[o], r, typeof t == "string");
|
|
4311
|
+
i = Pe.merge(i, l, r);
|
|
4312
|
+
}
|
|
4313
|
+
return r.allowSparse === !0 ? i : Pe.compact(i);
|
|
4314
|
+
}, Ho = No, Vo = Go, Jo = wr, Xo = {
|
|
4315
|
+
formats: Jo,
|
|
4316
|
+
parse: Vo,
|
|
4317
|
+
stringify: Ho
|
|
4318
|
+
};
|
|
4319
|
+
class Yo {
|
|
4320
|
+
constructor(e) {
|
|
4321
|
+
this.client = e, this.list = () => this.client.get("/v1/packages"), this.client = e;
|
|
4322
|
+
}
|
|
4323
|
+
}
|
|
4324
|
+
class Zo {
|
|
4325
|
+
constructor(e) {
|
|
4326
|
+
this.client = e, this.get = (r) => this.client.get(`/v1/insurance/${r}/balance`), this.client = e;
|
|
4327
|
+
}
|
|
4328
|
+
}
|
|
4329
|
+
class eu {
|
|
4330
|
+
constructor(e) {
|
|
4331
|
+
this.client = e, this.get = (r) => this.client.get(`/v1/labels/${r}`), this.list = (r = {}) => this.client.get("/v1/labels", { params: r }), this.createByRateId = (r, n) => this.client.post(`/v1/labels/rates/${r}`, n), this.void = (r) => this.client.put(`/v1/labels/${r}/void`), this.client = e;
|
|
4332
|
+
}
|
|
4333
|
+
}
|
|
4334
|
+
class tu {
|
|
4335
|
+
constructor(e) {
|
|
4336
|
+
this.client = e, this.list = () => this.client.get("/v-beta/order_sources"), this.get = (r) => this.client.get(`/v-beta/order_sources/${r}`), this.refresh = (r) => this.client.put(`/v-beta/order_sources/${r}/refresh`), this.client = e;
|
|
4337
|
+
}
|
|
4338
|
+
}
|
|
4339
|
+
class ru {
|
|
4340
|
+
constructor(e) {
|
|
4341
|
+
this.client = e, this.calculateByShipmentId = (r, n) => this.client.post("/v1/rates", {
|
|
4342
|
+
rateOptions: n,
|
|
4343
|
+
shipmentId: r
|
|
4344
|
+
}), this.client = e;
|
|
4345
|
+
}
|
|
4346
|
+
}
|
|
4347
|
+
class nu {
|
|
4348
|
+
constructor(e) {
|
|
4349
|
+
this.client = e, this.list = (r = {}) => this.client.post("/v-beta/shipments/list", r), this.get = (r) => this.client.get(`/v-beta/shipments/${r}`), this.create = (r, n) => this.client.post(
|
|
4350
|
+
`/v-beta/shipments/sales_order/${r}`,
|
|
4351
|
+
n
|
|
4352
|
+
), this.update = (r, n) => this.client.put(`/v-beta/shipments/${r}`, n), this.client = e;
|
|
4353
|
+
}
|
|
4354
|
+
}
|
|
4355
|
+
class iu {
|
|
4356
|
+
constructor(e) {
|
|
4357
|
+
this.client = e, this.list = (r = {}) => this.client.get("/v-beta/sales_orders", { params: r }), this.get = (r) => this.client.get(`/v-beta/sales_orders/${r}`), this.notifyShipped = (r, n) => this.client.post(`/v-beta/sales_orders/${r}/notify`, n), this.client = e;
|
|
4358
|
+
}
|
|
4359
|
+
}
|
|
4360
|
+
class au {
|
|
4361
|
+
constructor(e) {
|
|
4362
|
+
this.client = e, this.list = () => this.client.get("/v1/warehouses"), this.create = (r) => this.client.post("/v1/warehouses", r), this.update = (r, n) => this.client.put(`/v1/warehouses/${r}`, n), this.delete = (r) => this.client.delete(`/v1/warehouses/${r}`), this.client = e;
|
|
4363
|
+
}
|
|
4364
|
+
}
|
|
4365
|
+
const bn = qn({
|
|
4366
|
+
name: "shipengine-api",
|
|
4367
|
+
serializers: {
|
|
4368
|
+
...cr,
|
|
4369
|
+
req: (t) => ({
|
|
4370
|
+
headers: t.headers,
|
|
4371
|
+
method: t.method,
|
|
4372
|
+
url: t.url
|
|
4373
|
+
}),
|
|
4374
|
+
res: (t) => ({
|
|
4375
|
+
data: t.data,
|
|
4376
|
+
headers: t.config.headers,
|
|
4377
|
+
method: t.config.method,
|
|
4378
|
+
statusCode: t.status,
|
|
4379
|
+
url: t.config.url
|
|
4380
|
+
})
|
|
4381
|
+
},
|
|
4382
|
+
streams: [
|
|
4383
|
+
{
|
|
4384
|
+
stream: new $n()
|
|
4385
|
+
}
|
|
4386
|
+
]
|
|
4387
|
+
}), su = (t) => !!t.errors && Vn(t.errors);
|
|
4388
|
+
class Sn {
|
|
4389
|
+
constructor(e, { baseURL: r, headers: n, getToken: i }) {
|
|
4390
|
+
const a = Jt.create({
|
|
4391
|
+
baseURL: r,
|
|
4392
|
+
headers: {
|
|
4393
|
+
...n,
|
|
4394
|
+
Authorization: `Bearer ${e}`,
|
|
4395
|
+
"Content-Type": "application/json"
|
|
4396
|
+
},
|
|
4397
|
+
paramsSerializer: (s) => Xo.stringify(xe.decamelizeKeys(s), { arrayFormat: "brackets" }),
|
|
4398
|
+
transformRequest: [(s) => xe.decamelizeKeys(s), (s) => JSON.stringify(s)],
|
|
4399
|
+
transformResponse: [
|
|
4400
|
+
(s) => {
|
|
4401
|
+
if (s)
|
|
4402
|
+
return JSON.parse(s);
|
|
4403
|
+
},
|
|
4404
|
+
(s) => xe.camelizeKeys(s)
|
|
4405
|
+
]
|
|
4406
|
+
});
|
|
4407
|
+
a.interceptors.response.use(
|
|
4408
|
+
(s) => (bn.info(
|
|
4409
|
+
{ req: s.config, res: s },
|
|
4410
|
+
"%s %s: %s %s",
|
|
4411
|
+
s.config.method?.toUpperCase(),
|
|
4412
|
+
s.config.url,
|
|
4413
|
+
s.status,
|
|
4414
|
+
s.statusText
|
|
4415
|
+
), s),
|
|
4416
|
+
async (s) => {
|
|
4417
|
+
if (bn.error(
|
|
4418
|
+
{ err: s, req: s.config, res: s.response },
|
|
4419
|
+
"%s %s: %s %s - %s",
|
|
4420
|
+
s.config?.method?.toUpperCase(),
|
|
4421
|
+
s.config?.url,
|
|
4422
|
+
s.response?.status,
|
|
4423
|
+
s.response?.statusText,
|
|
4424
|
+
s.message
|
|
4425
|
+
), s.response?.status === 401) {
|
|
4426
|
+
const o = await i(), l = s.config;
|
|
4427
|
+
return l && (l.headers ||= {}, l.headers.Authorization = `Bearer ${o}`), Jt(l);
|
|
4428
|
+
}
|
|
4429
|
+
return s.response?.data ? su(s.response.data) ? Promise.reject(
|
|
4430
|
+
s.response.data.errors.map((o) => te.fromObject(o))
|
|
4431
|
+
) : Vn(s.response.data) ? Promise.reject(s.response.data.map((o) => te.fromObject(o))) : Jn(s.response.data) ? Promise.reject([te.fromObject(s.response.data)]) : Promise.reject([new te(s.response.data)]) : Promise.reject([new te(s.message)]);
|
|
4432
|
+
}
|
|
4433
|
+
), this.client = a;
|
|
4434
|
+
}
|
|
4435
|
+
set token(e) {
|
|
4436
|
+
this.client.defaults.headers.common.Authorization = `Bearer ${e}`;
|
|
4437
|
+
}
|
|
4438
|
+
get addresses() {
|
|
4439
|
+
return new ea(this.client);
|
|
4440
|
+
}
|
|
4441
|
+
get accountSettings() {
|
|
4442
|
+
return new Zi(this.client);
|
|
4443
|
+
}
|
|
4444
|
+
get carriers() {
|
|
4445
|
+
return new rs(this.client);
|
|
4446
|
+
}
|
|
4447
|
+
get customPackages() {
|
|
4448
|
+
return new Yo(this.client);
|
|
4449
|
+
}
|
|
4450
|
+
get insurance() {
|
|
4451
|
+
return new Zo(this.client);
|
|
4452
|
+
}
|
|
4453
|
+
get labels() {
|
|
4454
|
+
return new eu(this.client);
|
|
4455
|
+
}
|
|
4456
|
+
get orderSources() {
|
|
4457
|
+
return new tu(this.client);
|
|
4458
|
+
}
|
|
4459
|
+
get rates() {
|
|
4460
|
+
return new ru(this.client);
|
|
4461
|
+
}
|
|
4462
|
+
get salesOrderShipments() {
|
|
4463
|
+
return new nu(this.client);
|
|
4464
|
+
}
|
|
4465
|
+
get salesOrders() {
|
|
4466
|
+
return new iu(this.client);
|
|
4467
|
+
}
|
|
4468
|
+
get warehouses() {
|
|
4469
|
+
return new au(this.client);
|
|
4470
|
+
}
|
|
4471
|
+
}
|
|
4472
|
+
const fi = pi(void 0), hu = ({
|
|
4473
|
+
baseURL: t,
|
|
4474
|
+
children: e,
|
|
4475
|
+
headers: r,
|
|
4476
|
+
getToken: n
|
|
4477
|
+
}) => {
|
|
4478
|
+
const [i, a] = yi(() => {
|
|
4479
|
+
const o = n();
|
|
4480
|
+
if (typeof o == "string")
|
|
4481
|
+
return new Sn(o, {
|
|
4482
|
+
baseURL: t,
|
|
4483
|
+
getToken: n,
|
|
4484
|
+
headers: r ?? {}
|
|
4485
|
+
});
|
|
4486
|
+
o.then(
|
|
4487
|
+
(l) => a(
|
|
4488
|
+
new Sn(l, {
|
|
4489
|
+
baseURL: t,
|
|
4490
|
+
getToken: n,
|
|
4491
|
+
headers: r ?? {}
|
|
4492
|
+
})
|
|
4493
|
+
)
|
|
4494
|
+
);
|
|
4495
|
+
}), s = new Di();
|
|
4496
|
+
return i ? /* @__PURE__ */ ut(fi.Provider, { value: { client: i }, children: /* @__PURE__ */ ut(ki, { client: s, children: e }) }) : /* @__PURE__ */ ut(
|
|
4497
|
+
"div",
|
|
4498
|
+
{
|
|
4499
|
+
style: {
|
|
4500
|
+
alignItems: "center",
|
|
4501
|
+
display: "flex",
|
|
4502
|
+
height: "100%",
|
|
4503
|
+
justifyContent: "center",
|
|
4504
|
+
width: "100%"
|
|
4505
|
+
},
|
|
4506
|
+
children: "Loading..."
|
|
4507
|
+
}
|
|
4508
|
+
);
|
|
4509
|
+
}, R = () => {
|
|
4510
|
+
const t = vi(fi);
|
|
4511
|
+
if (!t)
|
|
4512
|
+
throw new Error("useShipEngine must be called within a ShipEngineProvider");
|
|
4513
|
+
return t;
|
|
4514
|
+
}, du = (t) => {
|
|
4515
|
+
const { client: e } = R();
|
|
4516
|
+
return L({
|
|
4517
|
+
mutationFn: async (r) => (await e.carriers.addFunds(t, r)).data,
|
|
4518
|
+
mutationKey: ["useAddFunds"],
|
|
4519
|
+
onError: E
|
|
4520
|
+
});
|
|
4521
|
+
}, pu = () => {
|
|
4522
|
+
const { client: t } = R();
|
|
4523
|
+
return L({
|
|
4524
|
+
mutationFn: async ({ rateOptions: e, shipmentId: r }) => (await t.rates.calculateByShipmentId(r, e)).data,
|
|
4525
|
+
mutationKey: ["useCalculateRates"],
|
|
4526
|
+
onError: E
|
|
4527
|
+
});
|
|
4528
|
+
}, yu = (t) => {
|
|
4529
|
+
const { client: e } = R(), r = or();
|
|
4530
|
+
return L({
|
|
4531
|
+
mutationFn: async (n) => (await e.carriers.updateAutoFunding(t, n)).data,
|
|
4532
|
+
mutationKey: ["useUpdateAutoFunding"],
|
|
4533
|
+
onError: E,
|
|
4534
|
+
onSuccess: (n) => {
|
|
4535
|
+
r.invalidateQueries(["useGetAutoFunding", t], { exact: !0 });
|
|
4536
|
+
}
|
|
4537
|
+
});
|
|
4538
|
+
}, vu = () => {
|
|
4539
|
+
const { client: t } = R();
|
|
4540
|
+
return L({
|
|
4541
|
+
mutationFn: async (e) => (await t.carriers.connect(e)).data,
|
|
4542
|
+
mutationKey: ["useConnectCarrier"],
|
|
4543
|
+
onError: E
|
|
4544
|
+
});
|
|
4545
|
+
}, mu = () => {
|
|
4546
|
+
const { client: t } = R();
|
|
4547
|
+
return L({
|
|
4548
|
+
mutationFn: async ({ rateId: e, ...r }) => (await t.labels.createByRateId(e, r)).data,
|
|
4549
|
+
mutationKey: ["useCreateLabel"],
|
|
4550
|
+
onError: E
|
|
4551
|
+
});
|
|
4552
|
+
}, gu = () => {
|
|
4553
|
+
const { client: t } = R();
|
|
4554
|
+
return L({
|
|
4555
|
+
mutationFn: async ({ salesOrderId: e, ...r }) => (await t.salesOrderShipments.create(e, r)).data,
|
|
4556
|
+
mutationKey: ["useCreateSalesOrderShipment"],
|
|
4557
|
+
onError: E
|
|
4558
|
+
});
|
|
4559
|
+
}, bu = () => {
|
|
4560
|
+
const { client: t } = R();
|
|
4561
|
+
return L({
|
|
4562
|
+
mutationFn: async (e) => (await t.warehouses.create(e)).data,
|
|
4563
|
+
mutationKey: ["useCreateWarehouse"],
|
|
4564
|
+
onError: E
|
|
4565
|
+
});
|
|
4566
|
+
}, Su = () => {
|
|
4567
|
+
const { client: t } = R();
|
|
4568
|
+
return L({
|
|
4569
|
+
mutationFn: async ({ warehouseId: e }) => (await t.warehouses.delete(e)).data,
|
|
4570
|
+
mutationKey: ["useDeleteWarehouse"],
|
|
4571
|
+
onError: E
|
|
4572
|
+
});
|
|
4573
|
+
}, wu = (t) => {
|
|
4574
|
+
const { client: e } = R();
|
|
4575
|
+
return z({
|
|
4576
|
+
enabled: t !== void 0,
|
|
4577
|
+
onError: E,
|
|
4578
|
+
queryFn: () => t ? e.carriers.getAutoFunding(t) : Promise.reject(new Error("carrierId is required.")),
|
|
4579
|
+
queryKey: ["useGetAutoFundingConfiguration", t],
|
|
4580
|
+
select: (r) => r.data
|
|
4581
|
+
});
|
|
4582
|
+
}, Ou = (t) => {
|
|
4583
|
+
const { client: e } = R();
|
|
4584
|
+
return z({
|
|
4585
|
+
enabled: !!t,
|
|
4586
|
+
onError: E,
|
|
4587
|
+
queryFn: () => t ? e.carriers.get(t) : Promise.reject(new Error("carrierId is require")),
|
|
4588
|
+
queryKey: ["useGetCarrierById", t],
|
|
4589
|
+
select: (r) => r.data,
|
|
4590
|
+
// Fresh for 5 minutes
|
|
4591
|
+
staleTime: 5 * 60 * 1e3
|
|
4592
|
+
});
|
|
4593
|
+
}, Pu = (t) => {
|
|
4594
|
+
const { client: e } = R();
|
|
4595
|
+
return z({
|
|
4596
|
+
enabled: t !== void 0,
|
|
4597
|
+
onError: E,
|
|
4598
|
+
queryFn: () => t ? e.insurance.get(t) : Promise.reject(new Error("insuranceProvider is required")),
|
|
4599
|
+
queryKey: ["useGetInsuranceAccount", t],
|
|
4600
|
+
select: (r) => r.data
|
|
4601
|
+
});
|
|
4602
|
+
}, Eu = (t) => {
|
|
4603
|
+
const { client: e } = R();
|
|
4604
|
+
return z({
|
|
4605
|
+
enabled: t !== void 0,
|
|
4606
|
+
onError: E,
|
|
4607
|
+
queryFn: () => t ? e.labels.get(t) : Promise.reject(new Error("labelId is require")),
|
|
4608
|
+
queryKey: ["useGetLabel", t],
|
|
4609
|
+
select: (r) => r.data
|
|
4610
|
+
});
|
|
4611
|
+
}, Ru = () => {
|
|
4612
|
+
const { client: t } = R();
|
|
4613
|
+
return z({
|
|
4614
|
+
onError: E,
|
|
4615
|
+
queryFn: () => t.accountSettings.getAccountSettings(),
|
|
4616
|
+
queryKey: ["getAccountSettings"],
|
|
4617
|
+
select: (e) => e.data
|
|
4618
|
+
});
|
|
4619
|
+
}, Au = () => ({
|
|
4620
|
+
links: {
|
|
4621
|
+
transactionHistoryReport: "http://link.to.entire.dataset.as.csv"
|
|
4622
|
+
},
|
|
4623
|
+
page: 1,
|
|
4624
|
+
pages: 4,
|
|
4625
|
+
total: 275,
|
|
4626
|
+
transactions: [
|
|
4627
|
+
{
|
|
4628
|
+
amount: 50.65,
|
|
4629
|
+
balance: 10,
|
|
4630
|
+
carrierId: "string",
|
|
4631
|
+
carrierProvider: "string carrier name",
|
|
4632
|
+
labelId: "string",
|
|
4633
|
+
transactionDate: "",
|
|
4634
|
+
transactionId: "string",
|
|
4635
|
+
transactionType: "fund"
|
|
4636
|
+
},
|
|
4637
|
+
{
|
|
4638
|
+
amount: 50.65,
|
|
4639
|
+
balance: 10,
|
|
4640
|
+
carrierId: "string",
|
|
4641
|
+
carrierProvider: "string carrier name",
|
|
4642
|
+
labelId: "string",
|
|
4643
|
+
transactionDate: "",
|
|
4644
|
+
transactionId: "string",
|
|
4645
|
+
transactionType: "purchase"
|
|
4646
|
+
}
|
|
4647
|
+
]
|
|
4648
|
+
}), Cu = (t) => {
|
|
4649
|
+
const { client: e } = R();
|
|
4650
|
+
return z({
|
|
4651
|
+
enabled: t !== void 0,
|
|
4652
|
+
onError: E,
|
|
4653
|
+
queryFn: () => t ? e.salesOrders.get(t) : Promise.reject(new Error("salesOrderId is required")),
|
|
4654
|
+
queryKey: ["useGetSalesOrder", t],
|
|
4655
|
+
select: (r) => r.data
|
|
4656
|
+
});
|
|
4657
|
+
}, Fu = (t) => {
|
|
4658
|
+
const { client: e } = R();
|
|
4659
|
+
return z({
|
|
4660
|
+
enabled: t !== void 0,
|
|
4661
|
+
onError: E,
|
|
4662
|
+
queryFn: () => t ? e.salesOrderShipments.get(t) : Promise.reject(new Error("shipmentId is required")),
|
|
4663
|
+
queryKey: ["useGetSalesOrderShipment", t],
|
|
4664
|
+
select: (r) => r.data
|
|
4665
|
+
});
|
|
4666
|
+
}, xu = () => {
|
|
4667
|
+
const { client: t } = R();
|
|
4668
|
+
return z({
|
|
4669
|
+
onError: E,
|
|
4670
|
+
queryFn: () => t.carriers.list(),
|
|
4671
|
+
queryKey: ["useListCarriers"],
|
|
4672
|
+
select: (e) => e.data.carriers
|
|
4673
|
+
});
|
|
4674
|
+
}, Iu = (t) => {
|
|
4675
|
+
const { client: e } = R();
|
|
4676
|
+
return z({
|
|
4677
|
+
enabled: t && Object.values(t).some((r) => r !== void 0),
|
|
4678
|
+
onError: E,
|
|
4679
|
+
queryFn: () => e.labels.list(t),
|
|
4680
|
+
queryKey: ["useListLabels", t],
|
|
4681
|
+
select: (r) => r.data.labels
|
|
4682
|
+
});
|
|
4683
|
+
}, _u = () => {
|
|
4684
|
+
const { client: t } = R();
|
|
4685
|
+
return z({
|
|
4686
|
+
onError: E,
|
|
4687
|
+
queryFn: () => t.orderSources.list(),
|
|
4688
|
+
queryKey: ["useListOrderSources"],
|
|
4689
|
+
select: (e) => e.data.orderSources
|
|
4690
|
+
});
|
|
4691
|
+
}, qu = () => {
|
|
4692
|
+
const { client: t } = R();
|
|
4693
|
+
return z({
|
|
4694
|
+
onError: E,
|
|
4695
|
+
queryFn: () => t.customPackages.list(),
|
|
4696
|
+
queryKey: ["useListCustomPackageTypes"],
|
|
4697
|
+
select: (e) => e.data.packages
|
|
4698
|
+
});
|
|
4699
|
+
}, $u = (t = {}) => {
|
|
4700
|
+
const { client: e } = R();
|
|
4701
|
+
return z({
|
|
4702
|
+
enabled: t && Object.values(t).some((r) => r !== void 0),
|
|
4703
|
+
onError: E,
|
|
4704
|
+
queryFn: () => e.salesOrders.list(t),
|
|
4705
|
+
queryKey: ["useListSalesOrders", t],
|
|
4706
|
+
select: (r) => r.data.salesOrders
|
|
4707
|
+
});
|
|
4708
|
+
}, Mu = (t) => {
|
|
4709
|
+
const { client: e } = R();
|
|
4710
|
+
return z({
|
|
4711
|
+
enabled: t && Object.values(t).some((r) => r !== void 0),
|
|
4712
|
+
onError: E,
|
|
4713
|
+
queryFn: () => e.salesOrderShipments.list(t),
|
|
4714
|
+
queryKey: ["useListSalesOrderShipments", t],
|
|
4715
|
+
select: (r) => r.data.shipments
|
|
4716
|
+
});
|
|
4717
|
+
}, Du = () => {
|
|
4718
|
+
const { client: t } = R();
|
|
4719
|
+
return z({
|
|
4720
|
+
onError: E,
|
|
4721
|
+
queryFn: () => t.warehouses.list(),
|
|
4722
|
+
queryKey: ["useListWarehouses"],
|
|
4723
|
+
select: (e) => e.data.warehouses
|
|
4724
|
+
});
|
|
4725
|
+
}, Tu = () => {
|
|
4726
|
+
const { client: t } = R();
|
|
4727
|
+
return L({
|
|
4728
|
+
mutationFn: async ({ salesOrderId: e, ...r }) => (await t.salesOrders.notifyShipped(e, r)).data,
|
|
4729
|
+
mutationKey: ["useNotifySalesOrder"],
|
|
4730
|
+
onError: E
|
|
4731
|
+
});
|
|
4732
|
+
}, Uu = () => {
|
|
4733
|
+
const { client: t } = R();
|
|
4734
|
+
return L({
|
|
4735
|
+
mutationFn: async ({ address: e, text: r }) => (await t.addresses.parse(r, e)).data,
|
|
4736
|
+
mutationKey: ["useParseAddress"],
|
|
4737
|
+
onError: E
|
|
4738
|
+
});
|
|
4739
|
+
}, ou = () => {
|
|
4740
|
+
const { client: t } = R();
|
|
4741
|
+
return L({
|
|
4742
|
+
mutationFn: async (e) => (await t.orderSources.refresh(e)).data,
|
|
4743
|
+
mutationKey: ["useRefreshOrderSourceAsync"]
|
|
4744
|
+
});
|
|
4745
|
+
}, Nu = () => {
|
|
4746
|
+
const { client: t } = R(), { mutateAsync: e } = ou();
|
|
4747
|
+
return L({
|
|
4748
|
+
mutationFn: async (r) => (await e(r), await Yi(async () => {
|
|
4749
|
+
const { data: i } = await t.orderSources.get(r);
|
|
4750
|
+
if (["preparing_update", "updating"].includes(i.refreshInfo.status))
|
|
4751
|
+
throw new te("Order source is still refreshing");
|
|
4752
|
+
return i;
|
|
4753
|
+
}, 20)),
|
|
4754
|
+
mutationKey: ["useRefreshOrderSource"],
|
|
4755
|
+
onError: E
|
|
4756
|
+
});
|
|
4757
|
+
}, Lu = () => L({
|
|
4758
|
+
mutationFn: async (t) => (await Promise.resolve({
|
|
4759
|
+
data: {},
|
|
4760
|
+
errors: [],
|
|
4761
|
+
isLoading: !1,
|
|
4762
|
+
isValidating: !1
|
|
4763
|
+
})).data,
|
|
4764
|
+
mutationKey: ["useUpdateBilling"],
|
|
4765
|
+
onError: E
|
|
4766
|
+
}), Qu = () => {
|
|
4767
|
+
const { client: t } = R();
|
|
4768
|
+
return L({
|
|
4769
|
+
mutationFn: async ({ shipmentId: e, ...r }) => (await t.salesOrderShipments.update(e, r)).data,
|
|
4770
|
+
mutationKey: ["useUpdateSalesOrderShipment"],
|
|
4771
|
+
onError: E
|
|
4772
|
+
});
|
|
4773
|
+
}, ku = () => {
|
|
4774
|
+
const { client: t } = R();
|
|
4775
|
+
return L({
|
|
4776
|
+
mutationFn: async ({ warehouseId: e, ...r }) => (await t.warehouses.update(e, r)).data,
|
|
4777
|
+
mutationKey: ["useUpdateWarehouse"],
|
|
4778
|
+
onError: E
|
|
4779
|
+
});
|
|
4780
|
+
}, Bu = () => {
|
|
4781
|
+
const { client: t } = R();
|
|
4782
|
+
return L({
|
|
4783
|
+
mutationFn: async (e) => (await t.addresses.validate(e)).data,
|
|
4784
|
+
mutationKey: ["useValidateAddresses"],
|
|
4785
|
+
onError: E
|
|
4786
|
+
});
|
|
4787
|
+
}, ju = () => {
|
|
4788
|
+
const { client: t } = R();
|
|
4789
|
+
return L({
|
|
4790
|
+
mutationFn: async (e) => (await t.labels.void(e)).data,
|
|
4791
|
+
mutationKey: ["useVoidLabel"],
|
|
4792
|
+
onError: E
|
|
4793
|
+
});
|
|
4794
|
+
}, zu = (t) => {
|
|
4795
|
+
const { client: e } = R();
|
|
4796
|
+
return z({
|
|
4797
|
+
enabled: t !== void 0,
|
|
4798
|
+
onError: E,
|
|
4799
|
+
queryFn: () => t ? e.salesOrderShipments.get(t) : Promise.reject(new Error("shipmentId is required")),
|
|
4800
|
+
queryKey: ["useGetShipment", t],
|
|
4801
|
+
select: (r) => r.data
|
|
4802
|
+
});
|
|
4803
|
+
};
|
|
4804
|
+
export {
|
|
4805
|
+
fi as ShipEngineContext,
|
|
4806
|
+
hu as ShipEngineProvider,
|
|
4807
|
+
Wi as delay,
|
|
4808
|
+
fu as logger,
|
|
4809
|
+
E as onError,
|
|
4810
|
+
Yi as retryUntil,
|
|
4811
|
+
du as useAddFunds,
|
|
4812
|
+
pu as useCalculateRates,
|
|
4813
|
+
vu as useConnectCarrier,
|
|
4814
|
+
mu as useCreateLabel,
|
|
4815
|
+
gu as useCreateSalesOrderShipment,
|
|
4816
|
+
bu as useCreateWarehouse,
|
|
4817
|
+
Su as useDeleteWarehouse,
|
|
4818
|
+
Ru as useGetAccountSettings,
|
|
4819
|
+
wu as useGetAutoFundingConfiguration,
|
|
4820
|
+
Ou as useGetCarrierById,
|
|
4821
|
+
Pu as useGetInsuranceAccount,
|
|
4822
|
+
Eu as useGetLabel,
|
|
4823
|
+
Cu as useGetSalesOrder,
|
|
4824
|
+
Fu as useGetSalesOrderShipment,
|
|
4825
|
+
zu as useGetShipment,
|
|
4826
|
+
Au as useGetWalletTransactionHistory,
|
|
4827
|
+
xu as useListCarriers,
|
|
4828
|
+
qu as useListCustomPackageTypes,
|
|
4829
|
+
Iu as useListLabels,
|
|
4830
|
+
_u as useListOrderSources,
|
|
4831
|
+
Mu as useListSalesOrderShipments,
|
|
4832
|
+
$u as useListSalesOrders,
|
|
4833
|
+
Du as useListWarehouses,
|
|
4834
|
+
Tu as useNotifySalesOrderShipped,
|
|
4835
|
+
Uu as useParseAddress,
|
|
4836
|
+
Nu as useRefreshOrderSource,
|
|
4837
|
+
ou as useRefreshOrderSourceAsync,
|
|
4838
|
+
yu as useUpdateAutoFunding,
|
|
4839
|
+
Lu as useUpdateBilling,
|
|
4840
|
+
Qu as useUpdateSalesOrderShipment,
|
|
4841
|
+
ku as useUpdateWarehouse,
|
|
4842
|
+
Bu as useValidateAddresses,
|
|
4843
|
+
ju as useVoidLabel
|
|
4844
|
+
};
|