@openc3/js-common 6.3.0 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/services.cjs +11 -11
- package/dist/services.cjs.map +1 -1
- package/dist/services.js +1192 -1181
- package/dist/services.js.map +1 -1
- package/package.json +8 -8
package/dist/services.js
CHANGED
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
function
|
|
1
|
+
var Gt = Object.defineProperty;
|
|
2
|
+
var Zt = (n, e, t) => e in n ? Gt(n, e, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[e] = t;
|
|
3
|
+
var L = (n, e, t) => Zt(n, typeof e != "symbol" ? e + "" : e, t);
|
|
4
|
+
function mt(n, e) {
|
|
5
5
|
return function() {
|
|
6
|
-
return
|
|
6
|
+
return n.apply(e, arguments);
|
|
7
7
|
};
|
|
8
8
|
}
|
|
9
|
-
const { toString:
|
|
10
|
-
const t =
|
|
11
|
-
return
|
|
12
|
-
})(/* @__PURE__ */ Object.create(null)),
|
|
13
|
-
function
|
|
14
|
-
return
|
|
9
|
+
const { toString: Qt } = Object.prototype, { getPrototypeOf: $e } = Object, { iterator: de, toStringTag: gt } = Symbol, fe = /* @__PURE__ */ ((n) => (e) => {
|
|
10
|
+
const t = Qt.call(e);
|
|
11
|
+
return n[t] || (n[t] = t.slice(8, -1).toLowerCase());
|
|
12
|
+
})(/* @__PURE__ */ Object.create(null)), $ = (n) => (n = n.toLowerCase(), (e) => fe(e) === n), pe = (n) => (e) => typeof e === n, { isArray: K } = Array, Y = pe("undefined");
|
|
13
|
+
function Yt(n) {
|
|
14
|
+
return n !== null && !Y(n) && n.constructor !== null && !Y(n.constructor) && T(n.constructor.isBuffer) && n.constructor.isBuffer(n);
|
|
15
15
|
}
|
|
16
|
-
const
|
|
17
|
-
function
|
|
16
|
+
const bt = $("ArrayBuffer");
|
|
17
|
+
function en(n) {
|
|
18
18
|
let e;
|
|
19
|
-
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(
|
|
19
|
+
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(n) : e = n && n.buffer && bt(n.buffer), e;
|
|
20
20
|
}
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
21
|
+
const tn = pe("string"), T = pe("function"), wt = pe("number"), me = (n) => n !== null && typeof n == "object", nn = (n) => n === !0 || n === !1, ce = (n) => {
|
|
22
|
+
if (fe(n) !== "object")
|
|
23
23
|
return !1;
|
|
24
|
-
const e = $e(
|
|
25
|
-
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(
|
|
26
|
-
},
|
|
24
|
+
const e = $e(n);
|
|
25
|
+
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(gt in n) && !(de in n);
|
|
26
|
+
}, sn = $("Date"), rn = $("File"), on = $("Blob"), cn = $("FileList"), an = (n) => me(n) && T(n.pipe), ln = (n) => {
|
|
27
27
|
let e;
|
|
28
|
-
return
|
|
29
|
-
e === "object" &&
|
|
30
|
-
},
|
|
31
|
-
function ee(
|
|
32
|
-
if (
|
|
28
|
+
return n && (typeof FormData == "function" && n instanceof FormData || T(n.append) && ((e = fe(n)) === "formdata" || // detect form-data instance
|
|
29
|
+
e === "object" && T(n.toString) && n.toString() === "[object FormData]"));
|
|
30
|
+
}, un = $("URLSearchParams"), [hn, dn, fn, pn] = ["ReadableStream", "Request", "Response", "Headers"].map($), mn = (n) => n.trim ? n.trim() : n.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
31
|
+
function ee(n, e, { allOwnKeys: t = !1 } = {}) {
|
|
32
|
+
if (n === null || typeof n > "u")
|
|
33
33
|
return;
|
|
34
|
-
let
|
|
35
|
-
if (typeof
|
|
36
|
-
for (
|
|
37
|
-
e.call(null, s
|
|
34
|
+
let s, r;
|
|
35
|
+
if (typeof n != "object" && (n = [n]), K(n))
|
|
36
|
+
for (s = 0, r = n.length; s < r; s++)
|
|
37
|
+
e.call(null, n[s], s, n);
|
|
38
38
|
else {
|
|
39
|
-
const i = t ? Object.getOwnPropertyNames(
|
|
39
|
+
const i = t ? Object.getOwnPropertyNames(n) : Object.keys(n), o = i.length;
|
|
40
40
|
let c;
|
|
41
|
-
for (
|
|
42
|
-
c = i[
|
|
41
|
+
for (s = 0; s < o; s++)
|
|
42
|
+
c = i[s], e.call(null, n[c], c, n);
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function yt(n, e) {
|
|
46
46
|
e = e.toLowerCase();
|
|
47
|
-
const t = Object.keys(
|
|
48
|
-
let
|
|
49
|
-
for (;
|
|
50
|
-
if (r = t[
|
|
47
|
+
const t = Object.keys(n);
|
|
48
|
+
let s = t.length, r;
|
|
49
|
+
for (; s-- > 0; )
|
|
50
|
+
if (r = t[s], e === r.toLowerCase())
|
|
51
51
|
return r;
|
|
52
52
|
return null;
|
|
53
53
|
}
|
|
54
|
-
const H = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global,
|
|
55
|
-
function
|
|
56
|
-
const { caseless:
|
|
57
|
-
const i =
|
|
58
|
-
ce(e[i]) && ce(
|
|
54
|
+
const H = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, _t = (n) => !Y(n) && n !== H;
|
|
55
|
+
function Ce() {
|
|
56
|
+
const { caseless: n } = _t(this) && this || {}, e = {}, t = (s, r) => {
|
|
57
|
+
const i = n && yt(e, r) || r;
|
|
58
|
+
ce(e[i]) && ce(s) ? e[i] = Ce(e[i], s) : ce(s) ? e[i] = Ce({}, s) : K(s) ? e[i] = s.slice() : e[i] = s;
|
|
59
59
|
};
|
|
60
|
-
for (let
|
|
61
|
-
arguments[
|
|
60
|
+
for (let s = 0, r = arguments.length; s < r; s++)
|
|
61
|
+
arguments[s] && ee(arguments[s], t);
|
|
62
62
|
return e;
|
|
63
63
|
}
|
|
64
|
-
const
|
|
65
|
-
t &&
|
|
66
|
-
}, { allOwnKeys:
|
|
67
|
-
|
|
64
|
+
const gn = (n, e, t, { allOwnKeys: s } = {}) => (ee(e, (r, i) => {
|
|
65
|
+
t && T(r) ? n[i] = mt(r, t) : n[i] = r;
|
|
66
|
+
}, { allOwnKeys: s }), n), bn = (n) => (n.charCodeAt(0) === 65279 && (n = n.slice(1)), n), wn = (n, e, t, s) => {
|
|
67
|
+
n.prototype = Object.create(e.prototype, s), n.prototype.constructor = n, Object.defineProperty(n, "super", {
|
|
68
68
|
value: e.prototype
|
|
69
|
-
}), t && Object.assign(
|
|
70
|
-
},
|
|
69
|
+
}), t && Object.assign(n.prototype, t);
|
|
70
|
+
}, yn = (n, e, t, s) => {
|
|
71
71
|
let r, i, o;
|
|
72
72
|
const c = {};
|
|
73
|
-
if (e = e || {},
|
|
73
|
+
if (e = e || {}, n == null) return e;
|
|
74
74
|
do {
|
|
75
|
-
for (r = Object.getOwnPropertyNames(
|
|
76
|
-
o = r[i], (!
|
|
77
|
-
|
|
78
|
-
} while (
|
|
75
|
+
for (r = Object.getOwnPropertyNames(n), i = r.length; i-- > 0; )
|
|
76
|
+
o = r[i], (!s || s(o, n, e)) && !c[o] && (e[o] = n[o], c[o] = !0);
|
|
77
|
+
n = t !== !1 && $e(n);
|
|
78
|
+
} while (n && (!t || t(n, e)) && n !== Object.prototype);
|
|
79
79
|
return e;
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
const
|
|
83
|
-
return
|
|
84
|
-
},
|
|
85
|
-
if (!
|
|
86
|
-
if (K(
|
|
87
|
-
let e =
|
|
88
|
-
if (!
|
|
80
|
+
}, _n = (n, e, t) => {
|
|
81
|
+
n = String(n), (t === void 0 || t > n.length) && (t = n.length), t -= e.length;
|
|
82
|
+
const s = n.indexOf(e, t);
|
|
83
|
+
return s !== -1 && s === t;
|
|
84
|
+
}, En = (n) => {
|
|
85
|
+
if (!n) return null;
|
|
86
|
+
if (K(n)) return n;
|
|
87
|
+
let e = n.length;
|
|
88
|
+
if (!wt(e)) return null;
|
|
89
89
|
const t = new Array(e);
|
|
90
90
|
for (; e-- > 0; )
|
|
91
|
-
t[e] =
|
|
91
|
+
t[e] = n[e];
|
|
92
92
|
return t;
|
|
93
|
-
},
|
|
94
|
-
const
|
|
93
|
+
}, Sn = /* @__PURE__ */ ((n) => (e) => n && e instanceof n)(typeof Uint8Array < "u" && $e(Uint8Array)), xn = (n, e) => {
|
|
94
|
+
const s = (n && n[de]).call(n);
|
|
95
95
|
let r;
|
|
96
|
-
for (; (r =
|
|
96
|
+
for (; (r = s.next()) && !r.done; ) {
|
|
97
97
|
const i = r.value;
|
|
98
|
-
e.call(
|
|
98
|
+
e.call(n, i[0], i[1]);
|
|
99
99
|
}
|
|
100
|
-
},
|
|
100
|
+
}, Rn = (n, e) => {
|
|
101
101
|
let t;
|
|
102
|
-
const
|
|
103
|
-
for (; (t =
|
|
104
|
-
|
|
105
|
-
return
|
|
106
|
-
},
|
|
102
|
+
const s = [];
|
|
103
|
+
for (; (t = n.exec(e)) !== null; )
|
|
104
|
+
s.push(t);
|
|
105
|
+
return s;
|
|
106
|
+
}, An = $("HTMLFormElement"), On = (n) => n.toLowerCase().replace(
|
|
107
107
|
/[-_\s]([a-z\d])(\w*)/g,
|
|
108
|
-
function(t,
|
|
109
|
-
return
|
|
108
|
+
function(t, s, r) {
|
|
109
|
+
return s.toUpperCase() + r;
|
|
110
110
|
}
|
|
111
|
-
),
|
|
112
|
-
const t = Object.getOwnPropertyDescriptors(
|
|
111
|
+
), Je = (({ hasOwnProperty: n }) => (e, t) => n.call(e, t))(Object.prototype), Cn = $("RegExp"), Et = (n, e) => {
|
|
112
|
+
const t = Object.getOwnPropertyDescriptors(n), s = {};
|
|
113
113
|
ee(t, (r, i) => {
|
|
114
114
|
let o;
|
|
115
|
-
(o = e(r, i,
|
|
116
|
-
}), Object.defineProperties(
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
if (
|
|
115
|
+
(o = e(r, i, n)) !== !1 && (s[i] = o || r);
|
|
116
|
+
}), Object.defineProperties(n, s);
|
|
117
|
+
}, Tn = (n) => {
|
|
118
|
+
Et(n, (e, t) => {
|
|
119
|
+
if (T(n) && ["arguments", "caller", "callee"].indexOf(t) !== -1)
|
|
120
120
|
return !1;
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
121
|
+
const s = n[t];
|
|
122
|
+
if (T(s)) {
|
|
123
123
|
if (e.enumerable = !1, "writable" in e) {
|
|
124
124
|
e.writable = !1;
|
|
125
125
|
return;
|
|
@@ -129,102 +129,103 @@ const pn = (s, e, t, { allOwnKeys: n } = {}) => (ee(e, (r, i) => {
|
|
|
129
129
|
});
|
|
130
130
|
}
|
|
131
131
|
});
|
|
132
|
-
},
|
|
133
|
-
const t = {},
|
|
132
|
+
}, kn = (n, e) => {
|
|
133
|
+
const t = {}, s = (r) => {
|
|
134
134
|
r.forEach((i) => {
|
|
135
135
|
t[i] = !0;
|
|
136
136
|
});
|
|
137
137
|
};
|
|
138
|
-
return K(
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
function
|
|
142
|
-
return !!(
|
|
138
|
+
return K(n) ? s(n) : s(String(n).split(e)), t;
|
|
139
|
+
}, Nn = () => {
|
|
140
|
+
}, Pn = (n, e) => n != null && Number.isFinite(n = +n) ? n : e;
|
|
141
|
+
function In(n) {
|
|
142
|
+
return !!(n && T(n.append) && n[gt] === "FormData" && n[de]);
|
|
143
143
|
}
|
|
144
|
-
const
|
|
145
|
-
const e = new Array(10), t = (
|
|
146
|
-
if (
|
|
147
|
-
if (e.indexOf(
|
|
144
|
+
const vn = (n) => {
|
|
145
|
+
const e = new Array(10), t = (s, r) => {
|
|
146
|
+
if (me(s)) {
|
|
147
|
+
if (e.indexOf(s) >= 0)
|
|
148
148
|
return;
|
|
149
|
-
if (!("toJSON" in
|
|
150
|
-
e[r] =
|
|
151
|
-
const i = K(
|
|
152
|
-
return ee(
|
|
149
|
+
if (!("toJSON" in s)) {
|
|
150
|
+
e[r] = s;
|
|
151
|
+
const i = K(s) ? [] : {};
|
|
152
|
+
return ee(s, (o, c) => {
|
|
153
153
|
const h = t(o, r + 1);
|
|
154
154
|
!Y(h) && (i[c] = h);
|
|
155
155
|
}), e[r] = void 0, i;
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
|
-
return
|
|
158
|
+
return s;
|
|
159
159
|
};
|
|
160
|
-
return t(
|
|
161
|
-
},
|
|
162
|
-
r === H && i === t &&
|
|
160
|
+
return t(n, 0);
|
|
161
|
+
}, Ln = $("AsyncFunction"), jn = (n) => n && (me(n) || T(n)) && T(n.then) && T(n.catch), St = ((n, e) => n ? setImmediate : e ? ((t, s) => (H.addEventListener("message", ({ source: r, data: i }) => {
|
|
162
|
+
r === H && i === t && s.length && s.shift()();
|
|
163
163
|
}, !1), (r) => {
|
|
164
|
-
|
|
164
|
+
s.push(r), H.postMessage(t, "*");
|
|
165
165
|
}))(`axios@${Math.random()}`, []) : (t) => setTimeout(t))(
|
|
166
166
|
typeof setImmediate == "function",
|
|
167
|
-
|
|
168
|
-
),
|
|
167
|
+
T(H.postMessage)
|
|
168
|
+
), $n = typeof queueMicrotask < "u" ? queueMicrotask.bind(H) : typeof process < "u" && process.nextTick || St, Fn = (n) => n != null && T(n[de]), l = {
|
|
169
169
|
isArray: K,
|
|
170
|
-
isArrayBuffer:
|
|
171
|
-
isBuffer:
|
|
172
|
-
isFormData:
|
|
173
|
-
isArrayBufferView:
|
|
174
|
-
isString:
|
|
175
|
-
isNumber:
|
|
176
|
-
isBoolean:
|
|
177
|
-
isObject:
|
|
170
|
+
isArrayBuffer: bt,
|
|
171
|
+
isBuffer: Yt,
|
|
172
|
+
isFormData: ln,
|
|
173
|
+
isArrayBufferView: en,
|
|
174
|
+
isString: tn,
|
|
175
|
+
isNumber: wt,
|
|
176
|
+
isBoolean: nn,
|
|
177
|
+
isObject: me,
|
|
178
178
|
isPlainObject: ce,
|
|
179
|
-
isReadableStream:
|
|
180
|
-
isRequest:
|
|
181
|
-
isResponse:
|
|
182
|
-
isHeaders:
|
|
179
|
+
isReadableStream: hn,
|
|
180
|
+
isRequest: dn,
|
|
181
|
+
isResponse: fn,
|
|
182
|
+
isHeaders: pn,
|
|
183
183
|
isUndefined: Y,
|
|
184
|
-
isDate:
|
|
185
|
-
isFile:
|
|
186
|
-
isBlob:
|
|
187
|
-
isRegExp:
|
|
188
|
-
isFunction:
|
|
189
|
-
isStream:
|
|
190
|
-
isURLSearchParams:
|
|
191
|
-
isTypedArray:
|
|
192
|
-
isFileList:
|
|
184
|
+
isDate: sn,
|
|
185
|
+
isFile: rn,
|
|
186
|
+
isBlob: on,
|
|
187
|
+
isRegExp: Cn,
|
|
188
|
+
isFunction: T,
|
|
189
|
+
isStream: an,
|
|
190
|
+
isURLSearchParams: un,
|
|
191
|
+
isTypedArray: Sn,
|
|
192
|
+
isFileList: cn,
|
|
193
193
|
forEach: ee,
|
|
194
|
-
merge:
|
|
195
|
-
extend:
|
|
196
|
-
trim:
|
|
197
|
-
stripBOM:
|
|
198
|
-
inherits:
|
|
199
|
-
toFlatObject:
|
|
200
|
-
kindOf:
|
|
201
|
-
kindOfTest:
|
|
202
|
-
endsWith:
|
|
203
|
-
toArray:
|
|
204
|
-
forEachEntry:
|
|
205
|
-
matchAll:
|
|
206
|
-
isHTMLForm:
|
|
207
|
-
hasOwnProperty:
|
|
208
|
-
hasOwnProp:
|
|
194
|
+
merge: Ce,
|
|
195
|
+
extend: gn,
|
|
196
|
+
trim: mn,
|
|
197
|
+
stripBOM: bn,
|
|
198
|
+
inherits: wn,
|
|
199
|
+
toFlatObject: yn,
|
|
200
|
+
kindOf: fe,
|
|
201
|
+
kindOfTest: $,
|
|
202
|
+
endsWith: _n,
|
|
203
|
+
toArray: En,
|
|
204
|
+
forEachEntry: xn,
|
|
205
|
+
matchAll: Rn,
|
|
206
|
+
isHTMLForm: An,
|
|
207
|
+
hasOwnProperty: Je,
|
|
208
|
+
hasOwnProp: Je,
|
|
209
209
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
210
|
-
reduceDescriptors:
|
|
211
|
-
freezeMethods:
|
|
212
|
-
toObjectSet:
|
|
213
|
-
toCamelCase:
|
|
214
|
-
noop:
|
|
215
|
-
toFiniteNumber:
|
|
216
|
-
findKey:
|
|
210
|
+
reduceDescriptors: Et,
|
|
211
|
+
freezeMethods: Tn,
|
|
212
|
+
toObjectSet: kn,
|
|
213
|
+
toCamelCase: On,
|
|
214
|
+
noop: Nn,
|
|
215
|
+
toFiniteNumber: Pn,
|
|
216
|
+
findKey: yt,
|
|
217
217
|
global: H,
|
|
218
|
-
isContextDefined:
|
|
219
|
-
isSpecCompliantForm:
|
|
220
|
-
toJSONObject:
|
|
221
|
-
isAsyncFn:
|
|
222
|
-
isThenable:
|
|
223
|
-
setImmediate:
|
|
224
|
-
asap:
|
|
218
|
+
isContextDefined: _t,
|
|
219
|
+
isSpecCompliantForm: In,
|
|
220
|
+
toJSONObject: vn,
|
|
221
|
+
isAsyncFn: Ln,
|
|
222
|
+
isThenable: jn,
|
|
223
|
+
setImmediate: St,
|
|
224
|
+
asap: $n,
|
|
225
|
+
isIterable: Fn
|
|
225
226
|
};
|
|
226
|
-
function w(
|
|
227
|
-
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message =
|
|
227
|
+
function w(n, e, t, s, r) {
|
|
228
|
+
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = n, this.name = "AxiosError", e && (this.code = e), t && (this.config = t), s && (this.request = s), r && (this.response = r, this.status = r.status ? r.status : null);
|
|
228
229
|
}
|
|
229
230
|
l.inherits(w, Error, {
|
|
230
231
|
toJSON: function() {
|
|
@@ -247,7 +248,7 @@ l.inherits(w, Error, {
|
|
|
247
248
|
};
|
|
248
249
|
}
|
|
249
250
|
});
|
|
250
|
-
const
|
|
251
|
+
const xt = w.prototype, Rt = {};
|
|
251
252
|
[
|
|
252
253
|
"ERR_BAD_OPTION_VALUE",
|
|
253
254
|
"ERR_BAD_OPTION",
|
|
@@ -262,37 +263,37 @@ const Et = w.prototype, St = {};
|
|
|
262
263
|
"ERR_NOT_SUPPORT",
|
|
263
264
|
"ERR_INVALID_URL"
|
|
264
265
|
// eslint-disable-next-line func-names
|
|
265
|
-
].forEach((
|
|
266
|
-
|
|
266
|
+
].forEach((n) => {
|
|
267
|
+
Rt[n] = { value: n };
|
|
267
268
|
});
|
|
268
|
-
Object.defineProperties(w,
|
|
269
|
-
Object.defineProperty(
|
|
270
|
-
w.from = (
|
|
271
|
-
const o = Object.create(
|
|
272
|
-
return l.toFlatObject(
|
|
269
|
+
Object.defineProperties(w, Rt);
|
|
270
|
+
Object.defineProperty(xt, "isAxiosError", { value: !0 });
|
|
271
|
+
w.from = (n, e, t, s, r, i) => {
|
|
272
|
+
const o = Object.create(xt);
|
|
273
|
+
return l.toFlatObject(n, o, function(h) {
|
|
273
274
|
return h !== Error.prototype;
|
|
274
|
-
}, (c) => c !== "isAxiosError"), w.call(o,
|
|
275
|
+
}, (c) => c !== "isAxiosError"), w.call(o, n.message, e, t, s, r), o.cause = n, o.name = n.name, i && Object.assign(o, i), o;
|
|
275
276
|
};
|
|
276
|
-
const
|
|
277
|
-
function
|
|
278
|
-
return l.isPlainObject(
|
|
277
|
+
const Un = null;
|
|
278
|
+
function Te(n) {
|
|
279
|
+
return l.isPlainObject(n) || l.isArray(n);
|
|
279
280
|
}
|
|
280
|
-
function
|
|
281
|
-
return l.endsWith(
|
|
281
|
+
function At(n) {
|
|
282
|
+
return l.endsWith(n, "[]") ? n.slice(0, -2) : n;
|
|
282
283
|
}
|
|
283
|
-
function
|
|
284
|
-
return
|
|
285
|
-
return r =
|
|
284
|
+
function We(n, e, t) {
|
|
285
|
+
return n ? n.concat(e).map(function(r, i) {
|
|
286
|
+
return r = At(r), !t && i ? "[" + r + "]" : r;
|
|
286
287
|
}).join(t ? "." : "") : e;
|
|
287
288
|
}
|
|
288
|
-
function
|
|
289
|
-
return l.isArray(
|
|
289
|
+
function Dn(n) {
|
|
290
|
+
return l.isArray(n) && !n.some(Te);
|
|
290
291
|
}
|
|
291
|
-
const
|
|
292
|
+
const qn = l.toFlatObject(l, {}, null, function(e) {
|
|
292
293
|
return /^is[A-Z]/.test(e);
|
|
293
294
|
});
|
|
294
|
-
function
|
|
295
|
-
if (!l.isObject(
|
|
295
|
+
function ge(n, e, t) {
|
|
296
|
+
if (!l.isObject(n))
|
|
296
297
|
throw new TypeError("target must be an object");
|
|
297
298
|
e = e || new FormData(), t = l.toFlatObject(t, {
|
|
298
299
|
metaTokens: !0,
|
|
@@ -301,7 +302,7 @@ function me(s, e, t) {
|
|
|
301
302
|
}, !1, function(m, p) {
|
|
302
303
|
return !l.isUndefined(p[m]);
|
|
303
304
|
});
|
|
304
|
-
const
|
|
305
|
+
const s = t.metaTokens, r = t.visitor || a, i = t.dots, o = t.indexes, h = (t.Blob || typeof Blob < "u" && Blob) && l.isSpecCompliantForm(e);
|
|
305
306
|
if (!l.isFunction(r))
|
|
306
307
|
throw new TypeError("visitor must be a function");
|
|
307
308
|
function u(f) {
|
|
@@ -316,22 +317,22 @@ function me(s, e, t) {
|
|
|
316
317
|
let _ = f;
|
|
317
318
|
if (f && !p && typeof f == "object") {
|
|
318
319
|
if (l.endsWith(m, "{}"))
|
|
319
|
-
m =
|
|
320
|
-
else if (l.isArray(f) &&
|
|
321
|
-
return m =
|
|
320
|
+
m = s ? m : m.slice(0, -2), f = JSON.stringify(f);
|
|
321
|
+
else if (l.isArray(f) && Dn(f) || (l.isFileList(f) || l.endsWith(m, "[]")) && (_ = l.toArray(f)))
|
|
322
|
+
return m = At(m), _.forEach(function(S, N) {
|
|
322
323
|
!(l.isUndefined(S) || S === null) && e.append(
|
|
323
324
|
// eslint-disable-next-line no-nested-ternary
|
|
324
|
-
o === !0 ?
|
|
325
|
+
o === !0 ? We([m], N, i) : o === null ? m : m + "[]",
|
|
325
326
|
u(S)
|
|
326
327
|
);
|
|
327
328
|
}), !1;
|
|
328
329
|
}
|
|
329
|
-
return
|
|
330
|
+
return Te(f) ? !0 : (e.append(We(p, m, i), u(f)), !1);
|
|
330
331
|
}
|
|
331
|
-
const d = [], g = Object.assign(
|
|
332
|
+
const d = [], g = Object.assign(qn, {
|
|
332
333
|
defaultVisitor: a,
|
|
333
334
|
convertValue: u,
|
|
334
|
-
isVisitable:
|
|
335
|
+
isVisitable: Te
|
|
335
336
|
});
|
|
336
337
|
function b(f, m) {
|
|
337
338
|
if (!l.isUndefined(f)) {
|
|
@@ -348,11 +349,11 @@ function me(s, e, t) {
|
|
|
348
349
|
}), d.pop();
|
|
349
350
|
}
|
|
350
351
|
}
|
|
351
|
-
if (!l.isObject(
|
|
352
|
+
if (!l.isObject(n))
|
|
352
353
|
throw new TypeError("data must be an object");
|
|
353
|
-
return b(
|
|
354
|
+
return b(n), e;
|
|
354
355
|
}
|
|
355
|
-
function
|
|
356
|
+
function Ke(n) {
|
|
356
357
|
const e = {
|
|
357
358
|
"!": "%21",
|
|
358
359
|
"'": "%27",
|
|
@@ -362,44 +363,44 @@ function We(s) {
|
|
|
362
363
|
"%20": "+",
|
|
363
364
|
"%00": "\0"
|
|
364
365
|
};
|
|
365
|
-
return encodeURIComponent(
|
|
366
|
-
return e[
|
|
366
|
+
return encodeURIComponent(n).replace(/[!'()~]|%20|%00/g, function(s) {
|
|
367
|
+
return e[s];
|
|
367
368
|
});
|
|
368
369
|
}
|
|
369
|
-
function
|
|
370
|
-
this._pairs = [],
|
|
370
|
+
function Fe(n, e) {
|
|
371
|
+
this._pairs = [], n && ge(n, this, e);
|
|
371
372
|
}
|
|
372
|
-
const
|
|
373
|
-
|
|
373
|
+
const Ot = Fe.prototype;
|
|
374
|
+
Ot.append = function(e, t) {
|
|
374
375
|
this._pairs.push([e, t]);
|
|
375
376
|
};
|
|
376
|
-
|
|
377
|
-
const t = e ? function(
|
|
378
|
-
return e.call(this,
|
|
379
|
-
} :
|
|
377
|
+
Ot.toString = function(e) {
|
|
378
|
+
const t = e ? function(s) {
|
|
379
|
+
return e.call(this, s, Ke);
|
|
380
|
+
} : Ke;
|
|
380
381
|
return this._pairs.map(function(r) {
|
|
381
382
|
return t(r[0]) + "=" + t(r[1]);
|
|
382
383
|
}, "").join("&");
|
|
383
384
|
};
|
|
384
|
-
function
|
|
385
|
-
return encodeURIComponent(
|
|
385
|
+
function Bn(n) {
|
|
386
|
+
return encodeURIComponent(n).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
386
387
|
}
|
|
387
|
-
function
|
|
388
|
+
function Ct(n, e, t) {
|
|
388
389
|
if (!e)
|
|
389
|
-
return
|
|
390
|
-
const
|
|
390
|
+
return n;
|
|
391
|
+
const s = t && t.encode || Bn;
|
|
391
392
|
l.isFunction(t) && (t = {
|
|
392
393
|
serialize: t
|
|
393
394
|
});
|
|
394
395
|
const r = t && t.serialize;
|
|
395
396
|
let i;
|
|
396
|
-
if (r ? i = r(e, t) : i = l.isURLSearchParams(e) ? e.toString() : new
|
|
397
|
-
const o =
|
|
398
|
-
o !== -1 && (
|
|
397
|
+
if (r ? i = r(e, t) : i = l.isURLSearchParams(e) ? e.toString() : new Fe(e, t).toString(s), i) {
|
|
398
|
+
const o = n.indexOf("#");
|
|
399
|
+
o !== -1 && (n = n.slice(0, o)), n += (n.indexOf("?") === -1 ? "?" : "&") + i;
|
|
399
400
|
}
|
|
400
|
-
return
|
|
401
|
+
return n;
|
|
401
402
|
}
|
|
402
|
-
class
|
|
403
|
+
class Xe {
|
|
403
404
|
constructor() {
|
|
404
405
|
this.handlers = [];
|
|
405
406
|
}
|
|
@@ -411,12 +412,12 @@ class Ke {
|
|
|
411
412
|
*
|
|
412
413
|
* @return {Number} An ID used to remove interceptor later
|
|
413
414
|
*/
|
|
414
|
-
use(e, t,
|
|
415
|
+
use(e, t, s) {
|
|
415
416
|
return this.handlers.push({
|
|
416
417
|
fulfilled: e,
|
|
417
418
|
rejected: t,
|
|
418
|
-
synchronous:
|
|
419
|
-
runWhen:
|
|
419
|
+
synchronous: s ? s.synchronous : !1,
|
|
420
|
+
runWhen: s ? s.runWhen : null
|
|
420
421
|
}), this.handlers.length - 1;
|
|
421
422
|
}
|
|
422
423
|
/**
|
|
@@ -448,86 +449,86 @@ class Ke {
|
|
|
448
449
|
* @returns {void}
|
|
449
450
|
*/
|
|
450
451
|
forEach(e) {
|
|
451
|
-
l.forEach(this.handlers, function(
|
|
452
|
-
|
|
452
|
+
l.forEach(this.handlers, function(s) {
|
|
453
|
+
s !== null && e(s);
|
|
453
454
|
});
|
|
454
455
|
}
|
|
455
456
|
}
|
|
456
|
-
const
|
|
457
|
+
const Tt = {
|
|
457
458
|
silentJSONParsing: !0,
|
|
458
459
|
forcedJSONParsing: !0,
|
|
459
460
|
clarifyTimeoutError: !1
|
|
460
|
-
},
|
|
461
|
+
}, Mn = typeof URLSearchParams < "u" ? URLSearchParams : Fe, Hn = typeof FormData < "u" ? FormData : null, zn = typeof Blob < "u" ? Blob : null, Vn = {
|
|
461
462
|
isBrowser: !0,
|
|
462
463
|
classes: {
|
|
463
|
-
URLSearchParams:
|
|
464
|
-
FormData:
|
|
465
|
-
Blob:
|
|
464
|
+
URLSearchParams: Mn,
|
|
465
|
+
FormData: Hn,
|
|
466
|
+
Blob: zn
|
|
466
467
|
},
|
|
467
468
|
protocols: ["http", "https", "file", "blob", "url", "data"]
|
|
468
|
-
},
|
|
469
|
-
self instanceof WorkerGlobalScope && typeof self.importScripts == "function",
|
|
469
|
+
}, Ue = typeof window < "u" && typeof document < "u", ke = typeof navigator == "object" && navigator || void 0, Jn = Ue && (!ke || ["ReactNative", "NativeScript", "NS"].indexOf(ke.product) < 0), Wn = typeof WorkerGlobalScope < "u" && // eslint-disable-next-line no-undef
|
|
470
|
+
self instanceof WorkerGlobalScope && typeof self.importScripts == "function", Kn = Ue && window.location.href || "http://localhost", Xn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
470
471
|
__proto__: null,
|
|
471
|
-
hasBrowserEnv:
|
|
472
|
-
hasStandardBrowserEnv:
|
|
473
|
-
hasStandardBrowserWebWorkerEnv:
|
|
474
|
-
navigator:
|
|
475
|
-
origin:
|
|
472
|
+
hasBrowserEnv: Ue,
|
|
473
|
+
hasStandardBrowserEnv: Jn,
|
|
474
|
+
hasStandardBrowserWebWorkerEnv: Wn,
|
|
475
|
+
navigator: ke,
|
|
476
|
+
origin: Kn
|
|
476
477
|
}, Symbol.toStringTag, { value: "Module" })), O = {
|
|
477
|
-
...
|
|
478
|
-
...
|
|
478
|
+
...Xn,
|
|
479
|
+
...Vn
|
|
479
480
|
};
|
|
480
|
-
function
|
|
481
|
-
return
|
|
482
|
-
visitor: function(t,
|
|
483
|
-
return O.isNode && l.isBuffer(t) ? (this.append(
|
|
481
|
+
function Gn(n, e) {
|
|
482
|
+
return ge(n, new O.classes.URLSearchParams(), Object.assign({
|
|
483
|
+
visitor: function(t, s, r, i) {
|
|
484
|
+
return O.isNode && l.isBuffer(t) ? (this.append(s, t.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
484
485
|
}
|
|
485
486
|
}, e));
|
|
486
487
|
}
|
|
487
|
-
function
|
|
488
|
-
return l.matchAll(/\w+|\[(\w*)]/g,
|
|
488
|
+
function Zn(n) {
|
|
489
|
+
return l.matchAll(/\w+|\[(\w*)]/g, n).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
|
|
489
490
|
}
|
|
490
|
-
function
|
|
491
|
-
const e = {}, t = Object.keys(
|
|
492
|
-
let
|
|
491
|
+
function Qn(n) {
|
|
492
|
+
const e = {}, t = Object.keys(n);
|
|
493
|
+
let s;
|
|
493
494
|
const r = t.length;
|
|
494
495
|
let i;
|
|
495
|
-
for (
|
|
496
|
-
i = t[
|
|
496
|
+
for (s = 0; s < r; s++)
|
|
497
|
+
i = t[s], e[i] = n[i];
|
|
497
498
|
return e;
|
|
498
499
|
}
|
|
499
|
-
function
|
|
500
|
-
function e(t,
|
|
500
|
+
function kt(n) {
|
|
501
|
+
function e(t, s, r, i) {
|
|
501
502
|
let o = t[i++];
|
|
502
503
|
if (o === "__proto__") return !0;
|
|
503
504
|
const c = Number.isFinite(+o), h = i >= t.length;
|
|
504
|
-
return o = !o && l.isArray(r) ? r.length : o, h ? (l.hasOwnProp(r, o) ? r[o] = [r[o],
|
|
505
|
+
return o = !o && l.isArray(r) ? r.length : o, h ? (l.hasOwnProp(r, o) ? r[o] = [r[o], s] : r[o] = s, !c) : ((!r[o] || !l.isObject(r[o])) && (r[o] = []), e(t, s, r[o], i) && l.isArray(r[o]) && (r[o] = Qn(r[o])), !c);
|
|
505
506
|
}
|
|
506
|
-
if (l.isFormData(
|
|
507
|
+
if (l.isFormData(n) && l.isFunction(n.entries)) {
|
|
507
508
|
const t = {};
|
|
508
|
-
return l.forEachEntry(
|
|
509
|
-
e(
|
|
509
|
+
return l.forEachEntry(n, (s, r) => {
|
|
510
|
+
e(Zn(s), r, t, 0);
|
|
510
511
|
}), t;
|
|
511
512
|
}
|
|
512
513
|
return null;
|
|
513
514
|
}
|
|
514
|
-
function
|
|
515
|
-
if (l.isString(
|
|
515
|
+
function Yn(n, e, t) {
|
|
516
|
+
if (l.isString(n))
|
|
516
517
|
try {
|
|
517
|
-
return (e || JSON.parse)(
|
|
518
|
-
} catch (
|
|
519
|
-
if (
|
|
520
|
-
throw
|
|
518
|
+
return (e || JSON.parse)(n), l.trim(n);
|
|
519
|
+
} catch (s) {
|
|
520
|
+
if (s.name !== "SyntaxError")
|
|
521
|
+
throw s;
|
|
521
522
|
}
|
|
522
|
-
return (t || JSON.stringify)(
|
|
523
|
+
return (t || JSON.stringify)(n);
|
|
523
524
|
}
|
|
524
525
|
const te = {
|
|
525
|
-
transitional:
|
|
526
|
+
transitional: Tt,
|
|
526
527
|
adapter: ["xhr", "http", "fetch"],
|
|
527
528
|
transformRequest: [function(e, t) {
|
|
528
|
-
const
|
|
529
|
+
const s = t.getContentType() || "", r = s.indexOf("application/json") > -1, i = l.isObject(e);
|
|
529
530
|
if (i && l.isHTMLForm(e) && (e = new FormData(e)), l.isFormData(e))
|
|
530
|
-
return r ? JSON.stringify(
|
|
531
|
+
return r ? JSON.stringify(kt(e)) : e;
|
|
531
532
|
if (l.isArrayBuffer(e) || l.isBuffer(e) || l.isStream(e) || l.isFile(e) || l.isBlob(e) || l.isReadableStream(e))
|
|
532
533
|
return e;
|
|
533
534
|
if (l.isArrayBufferView(e))
|
|
@@ -536,24 +537,24 @@ const te = {
|
|
|
536
537
|
return t.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
|
|
537
538
|
let c;
|
|
538
539
|
if (i) {
|
|
539
|
-
if (
|
|
540
|
-
return
|
|
541
|
-
if ((c = l.isFileList(e)) ||
|
|
540
|
+
if (s.indexOf("application/x-www-form-urlencoded") > -1)
|
|
541
|
+
return Gn(e, this.formSerializer).toString();
|
|
542
|
+
if ((c = l.isFileList(e)) || s.indexOf("multipart/form-data") > -1) {
|
|
542
543
|
const h = this.env && this.env.FormData;
|
|
543
|
-
return
|
|
544
|
+
return ge(
|
|
544
545
|
c ? { "files[]": e } : e,
|
|
545
546
|
h && new h(),
|
|
546
547
|
this.formSerializer
|
|
547
548
|
);
|
|
548
549
|
}
|
|
549
550
|
}
|
|
550
|
-
return i || r ? (t.setContentType("application/json", !1),
|
|
551
|
+
return i || r ? (t.setContentType("application/json", !1), Yn(e)) : e;
|
|
551
552
|
}],
|
|
552
553
|
transformResponse: [function(e) {
|
|
553
|
-
const t = this.transitional || te.transitional,
|
|
554
|
+
const t = this.transitional || te.transitional, s = t && t.forcedJSONParsing, r = this.responseType === "json";
|
|
554
555
|
if (l.isResponse(e) || l.isReadableStream(e))
|
|
555
556
|
return e;
|
|
556
|
-
if (e && l.isString(e) && (
|
|
557
|
+
if (e && l.isString(e) && (s && !this.responseType || r)) {
|
|
557
558
|
const o = !(t && t.silentJSONParsing) && r;
|
|
558
559
|
try {
|
|
559
560
|
return JSON.parse(e);
|
|
@@ -587,10 +588,10 @@ const te = {
|
|
|
587
588
|
}
|
|
588
589
|
}
|
|
589
590
|
};
|
|
590
|
-
l.forEach(["delete", "get", "head", "post", "put", "patch"], (
|
|
591
|
-
te.headers[
|
|
591
|
+
l.forEach(["delete", "get", "head", "post", "put", "patch"], (n) => {
|
|
592
|
+
te.headers[n] = {};
|
|
592
593
|
});
|
|
593
|
-
const
|
|
594
|
+
const es = l.toObjectSet([
|
|
594
595
|
"age",
|
|
595
596
|
"authorization",
|
|
596
597
|
"content-length",
|
|
@@ -608,57 +609,57 @@ const Zn = l.toObjectSet([
|
|
|
608
609
|
"referer",
|
|
609
610
|
"retry-after",
|
|
610
611
|
"user-agent"
|
|
611
|
-
]),
|
|
612
|
+
]), ts = (n) => {
|
|
612
613
|
const e = {};
|
|
613
|
-
let t,
|
|
614
|
-
return
|
|
614
|
+
let t, s, r;
|
|
615
|
+
return n && n.split(`
|
|
615
616
|
`).forEach(function(o) {
|
|
616
|
-
r = o.indexOf(":"), t = o.substring(0, r).trim().toLowerCase(),
|
|
617
|
+
r = o.indexOf(":"), t = o.substring(0, r).trim().toLowerCase(), s = o.substring(r + 1).trim(), !(!t || e[t] && es[t]) && (t === "set-cookie" ? e[t] ? e[t].push(s) : e[t] = [s] : e[t] = e[t] ? e[t] + ", " + s : s);
|
|
617
618
|
}), e;
|
|
618
|
-
},
|
|
619
|
-
function Z(
|
|
620
|
-
return
|
|
619
|
+
}, Ge = Symbol("internals");
|
|
620
|
+
function Z(n) {
|
|
621
|
+
return n && String(n).trim().toLowerCase();
|
|
621
622
|
}
|
|
622
|
-
function ae(
|
|
623
|
-
return
|
|
623
|
+
function ae(n) {
|
|
624
|
+
return n === !1 || n == null ? n : l.isArray(n) ? n.map(ae) : String(n);
|
|
624
625
|
}
|
|
625
|
-
function
|
|
626
|
+
function ns(n) {
|
|
626
627
|
const e = /* @__PURE__ */ Object.create(null), t = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
627
|
-
let
|
|
628
|
-
for (;
|
|
629
|
-
e[
|
|
628
|
+
let s;
|
|
629
|
+
for (; s = t.exec(n); )
|
|
630
|
+
e[s[1]] = s[2];
|
|
630
631
|
return e;
|
|
631
632
|
}
|
|
632
|
-
const
|
|
633
|
-
function
|
|
634
|
-
if (l.isFunction(
|
|
635
|
-
return
|
|
633
|
+
const ss = (n) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(n.trim());
|
|
634
|
+
function xe(n, e, t, s, r) {
|
|
635
|
+
if (l.isFunction(s))
|
|
636
|
+
return s.call(this, e, t);
|
|
636
637
|
if (r && (e = t), !!l.isString(e)) {
|
|
637
|
-
if (l.isString(
|
|
638
|
-
return e.indexOf(
|
|
639
|
-
if (l.isRegExp(
|
|
640
|
-
return
|
|
638
|
+
if (l.isString(s))
|
|
639
|
+
return e.indexOf(s) !== -1;
|
|
640
|
+
if (l.isRegExp(s))
|
|
641
|
+
return s.test(e);
|
|
641
642
|
}
|
|
642
643
|
}
|
|
643
|
-
function
|
|
644
|
-
return
|
|
644
|
+
function rs(n) {
|
|
645
|
+
return n.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, t, s) => t.toUpperCase() + s);
|
|
645
646
|
}
|
|
646
|
-
function
|
|
647
|
+
function is(n, e) {
|
|
647
648
|
const t = l.toCamelCase(" " + e);
|
|
648
|
-
["get", "set", "has"].forEach((
|
|
649
|
-
Object.defineProperty(
|
|
649
|
+
["get", "set", "has"].forEach((s) => {
|
|
650
|
+
Object.defineProperty(n, s + t, {
|
|
650
651
|
value: function(r, i, o) {
|
|
651
|
-
return this[
|
|
652
|
+
return this[s].call(this, e, r, i, o);
|
|
652
653
|
},
|
|
653
654
|
configurable: !0
|
|
654
655
|
});
|
|
655
656
|
});
|
|
656
657
|
}
|
|
657
|
-
let
|
|
658
|
+
let k = class {
|
|
658
659
|
constructor(e) {
|
|
659
660
|
e && this.set(e);
|
|
660
661
|
}
|
|
661
|
-
set(e, t,
|
|
662
|
+
set(e, t, s) {
|
|
662
663
|
const r = this;
|
|
663
664
|
function i(c, h, u) {
|
|
664
665
|
const a = Z(h);
|
|
@@ -670,26 +671,31 @@ let T = class {
|
|
|
670
671
|
const o = (c, h) => l.forEach(c, (u, a) => i(u, a, h));
|
|
671
672
|
if (l.isPlainObject(e) || e instanceof this.constructor)
|
|
672
673
|
o(e, t);
|
|
673
|
-
else if (l.isString(e) && (e = e.trim()) && !
|
|
674
|
-
o(
|
|
675
|
-
else if (l.
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
674
|
+
else if (l.isString(e) && (e = e.trim()) && !ss(e))
|
|
675
|
+
o(ts(e), t);
|
|
676
|
+
else if (l.isObject(e) && l.isIterable(e)) {
|
|
677
|
+
let c = {}, h, u;
|
|
678
|
+
for (const a of e) {
|
|
679
|
+
if (!l.isArray(a))
|
|
680
|
+
throw TypeError("Object iterator must return a key-value pair");
|
|
681
|
+
c[u = a[0]] = (h = c[u]) ? l.isArray(h) ? [...h, a[1]] : [h, a[1]] : a[1];
|
|
682
|
+
}
|
|
683
|
+
o(c, t);
|
|
684
|
+
} else
|
|
685
|
+
e != null && i(t, e, s);
|
|
680
686
|
return this;
|
|
681
687
|
}
|
|
682
688
|
get(e, t) {
|
|
683
689
|
if (e = Z(e), e) {
|
|
684
|
-
const
|
|
685
|
-
if (
|
|
686
|
-
const r = this[
|
|
690
|
+
const s = l.findKey(this, e);
|
|
691
|
+
if (s) {
|
|
692
|
+
const r = this[s];
|
|
687
693
|
if (!t)
|
|
688
694
|
return r;
|
|
689
695
|
if (t === !0)
|
|
690
|
-
return
|
|
696
|
+
return ns(r);
|
|
691
697
|
if (l.isFunction(t))
|
|
692
|
-
return t.call(this, r,
|
|
698
|
+
return t.call(this, r, s);
|
|
693
699
|
if (l.isRegExp(t))
|
|
694
700
|
return t.exec(r);
|
|
695
701
|
throw new TypeError("parser must be boolean|regexp|function");
|
|
@@ -698,41 +704,41 @@ let T = class {
|
|
|
698
704
|
}
|
|
699
705
|
has(e, t) {
|
|
700
706
|
if (e = Z(e), e) {
|
|
701
|
-
const
|
|
702
|
-
return !!(
|
|
707
|
+
const s = l.findKey(this, e);
|
|
708
|
+
return !!(s && this[s] !== void 0 && (!t || xe(this, this[s], s, t)));
|
|
703
709
|
}
|
|
704
710
|
return !1;
|
|
705
711
|
}
|
|
706
712
|
delete(e, t) {
|
|
707
|
-
const
|
|
713
|
+
const s = this;
|
|
708
714
|
let r = !1;
|
|
709
715
|
function i(o) {
|
|
710
716
|
if (o = Z(o), o) {
|
|
711
|
-
const c = l.findKey(
|
|
712
|
-
c && (!t ||
|
|
717
|
+
const c = l.findKey(s, o);
|
|
718
|
+
c && (!t || xe(s, s[c], c, t)) && (delete s[c], r = !0);
|
|
713
719
|
}
|
|
714
720
|
}
|
|
715
721
|
return l.isArray(e) ? e.forEach(i) : i(e), r;
|
|
716
722
|
}
|
|
717
723
|
clear(e) {
|
|
718
724
|
const t = Object.keys(this);
|
|
719
|
-
let
|
|
720
|
-
for (;
|
|
721
|
-
const i = t[
|
|
722
|
-
(!e ||
|
|
725
|
+
let s = t.length, r = !1;
|
|
726
|
+
for (; s--; ) {
|
|
727
|
+
const i = t[s];
|
|
728
|
+
(!e || xe(this, this[i], i, e, !0)) && (delete this[i], r = !0);
|
|
723
729
|
}
|
|
724
730
|
return r;
|
|
725
731
|
}
|
|
726
732
|
normalize(e) {
|
|
727
|
-
const t = this,
|
|
733
|
+
const t = this, s = {};
|
|
728
734
|
return l.forEach(this, (r, i) => {
|
|
729
|
-
const o = l.findKey(
|
|
735
|
+
const o = l.findKey(s, i);
|
|
730
736
|
if (o) {
|
|
731
737
|
t[o] = ae(r), delete t[i];
|
|
732
738
|
return;
|
|
733
739
|
}
|
|
734
|
-
const c = e ?
|
|
735
|
-
c !== i && delete t[i], t[c] = ae(r),
|
|
740
|
+
const c = e ? rs(i) : String(i).trim();
|
|
741
|
+
c !== i && delete t[i], t[c] = ae(r), s[c] = !0;
|
|
736
742
|
}), this;
|
|
737
743
|
}
|
|
738
744
|
concat(...e) {
|
|
@@ -740,8 +746,8 @@ let T = class {
|
|
|
740
746
|
}
|
|
741
747
|
toJSON(e) {
|
|
742
748
|
const t = /* @__PURE__ */ Object.create(null);
|
|
743
|
-
return l.forEach(this, (
|
|
744
|
-
|
|
749
|
+
return l.forEach(this, (s, r) => {
|
|
750
|
+
s != null && s !== !1 && (t[r] = e && l.isArray(s) ? s.join(", ") : s);
|
|
745
751
|
}), t;
|
|
746
752
|
}
|
|
747
753
|
[Symbol.iterator]() {
|
|
@@ -751,6 +757,9 @@ let T = class {
|
|
|
751
757
|
return Object.entries(this.toJSON()).map(([e, t]) => e + ": " + t).join(`
|
|
752
758
|
`);
|
|
753
759
|
}
|
|
760
|
+
getSetCookie() {
|
|
761
|
+
return this.get("set-cookie") || [];
|
|
762
|
+
}
|
|
754
763
|
get [Symbol.toStringTag]() {
|
|
755
764
|
return "AxiosHeaders";
|
|
756
765
|
}
|
|
@@ -758,50 +767,50 @@ let T = class {
|
|
|
758
767
|
return e instanceof this ? e : new this(e);
|
|
759
768
|
}
|
|
760
769
|
static concat(e, ...t) {
|
|
761
|
-
const
|
|
762
|
-
return t.forEach((r) =>
|
|
770
|
+
const s = new this(e);
|
|
771
|
+
return t.forEach((r) => s.set(r)), s;
|
|
763
772
|
}
|
|
764
773
|
static accessor(e) {
|
|
765
|
-
const
|
|
774
|
+
const s = (this[Ge] = this[Ge] = {
|
|
766
775
|
accessors: {}
|
|
767
776
|
}).accessors, r = this.prototype;
|
|
768
777
|
function i(o) {
|
|
769
778
|
const c = Z(o);
|
|
770
|
-
|
|
779
|
+
s[c] || (is(r, o), s[c] = !0);
|
|
771
780
|
}
|
|
772
781
|
return l.isArray(e) ? e.forEach(i) : i(e), this;
|
|
773
782
|
}
|
|
774
783
|
};
|
|
775
|
-
|
|
776
|
-
l.reduceDescriptors(
|
|
784
|
+
k.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
785
|
+
l.reduceDescriptors(k.prototype, ({ value: n }, e) => {
|
|
777
786
|
let t = e[0].toUpperCase() + e.slice(1);
|
|
778
787
|
return {
|
|
779
|
-
get: () =>
|
|
780
|
-
set(
|
|
781
|
-
this[t] =
|
|
788
|
+
get: () => n,
|
|
789
|
+
set(s) {
|
|
790
|
+
this[t] = s;
|
|
782
791
|
}
|
|
783
792
|
};
|
|
784
793
|
});
|
|
785
|
-
l.freezeMethods(
|
|
786
|
-
function
|
|
787
|
-
const t = this || te,
|
|
788
|
-
let i =
|
|
789
|
-
return l.forEach(
|
|
794
|
+
l.freezeMethods(k);
|
|
795
|
+
function Re(n, e) {
|
|
796
|
+
const t = this || te, s = e || t, r = k.from(s.headers);
|
|
797
|
+
let i = s.data;
|
|
798
|
+
return l.forEach(n, function(c) {
|
|
790
799
|
i = c.call(t, i, r.normalize(), e ? e.status : void 0);
|
|
791
800
|
}), r.normalize(), i;
|
|
792
801
|
}
|
|
793
|
-
function
|
|
794
|
-
return !!(
|
|
802
|
+
function Nt(n) {
|
|
803
|
+
return !!(n && n.__CANCEL__);
|
|
795
804
|
}
|
|
796
|
-
function X(
|
|
797
|
-
w.call(this,
|
|
805
|
+
function X(n, e, t) {
|
|
806
|
+
w.call(this, n ?? "canceled", w.ERR_CANCELED, e, t), this.name = "CanceledError";
|
|
798
807
|
}
|
|
799
808
|
l.inherits(X, w, {
|
|
800
809
|
__CANCEL__: !0
|
|
801
810
|
});
|
|
802
|
-
function
|
|
803
|
-
const
|
|
804
|
-
!t.status || !
|
|
811
|
+
function Pt(n, e, t) {
|
|
812
|
+
const s = t.config.validateStatus;
|
|
813
|
+
!t.status || !s || s(t.status) ? n(t) : e(new w(
|
|
805
814
|
"Request failed with status code " + t.status,
|
|
806
815
|
[w.ERR_BAD_REQUEST, w.ERR_BAD_RESPONSE][Math.floor(t.status / 100) - 4],
|
|
807
816
|
t.config,
|
|
@@ -809,44 +818,44 @@ function kt(s, e, t) {
|
|
|
809
818
|
t
|
|
810
819
|
));
|
|
811
820
|
}
|
|
812
|
-
function
|
|
813
|
-
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(
|
|
821
|
+
function os(n) {
|
|
822
|
+
const e = /^([-+\w]{1,25})(:?\/\/|:)/.exec(n);
|
|
814
823
|
return e && e[1] || "";
|
|
815
824
|
}
|
|
816
|
-
function
|
|
817
|
-
|
|
818
|
-
const t = new Array(
|
|
825
|
+
function cs(n, e) {
|
|
826
|
+
n = n || 10;
|
|
827
|
+
const t = new Array(n), s = new Array(n);
|
|
819
828
|
let r = 0, i = 0, o;
|
|
820
829
|
return e = e !== void 0 ? e : 1e3, function(h) {
|
|
821
|
-
const u = Date.now(), a =
|
|
822
|
-
o || (o = u), t[r] = h,
|
|
830
|
+
const u = Date.now(), a = s[i];
|
|
831
|
+
o || (o = u), t[r] = h, s[r] = u;
|
|
823
832
|
let d = i, g = 0;
|
|
824
833
|
for (; d !== r; )
|
|
825
|
-
g += t[d++], d = d %
|
|
826
|
-
if (r = (r + 1) %
|
|
834
|
+
g += t[d++], d = d % n;
|
|
835
|
+
if (r = (r + 1) % n, r === i && (i = (i + 1) % n), u - o < e)
|
|
827
836
|
return;
|
|
828
837
|
const b = a && u - a;
|
|
829
838
|
return b ? Math.round(g * 1e3 / b) : void 0;
|
|
830
839
|
};
|
|
831
840
|
}
|
|
832
|
-
function
|
|
833
|
-
let t = 0,
|
|
841
|
+
function as(n, e) {
|
|
842
|
+
let t = 0, s = 1e3 / e, r, i;
|
|
834
843
|
const o = (u, a = Date.now()) => {
|
|
835
|
-
t = a, r = null, i && (clearTimeout(i), i = null),
|
|
844
|
+
t = a, r = null, i && (clearTimeout(i), i = null), n.apply(null, u);
|
|
836
845
|
};
|
|
837
846
|
return [(...u) => {
|
|
838
847
|
const a = Date.now(), d = a - t;
|
|
839
|
-
d >=
|
|
848
|
+
d >= s ? o(u, a) : (r = u, i || (i = setTimeout(() => {
|
|
840
849
|
i = null, o(r);
|
|
841
|
-
},
|
|
850
|
+
}, s - d)));
|
|
842
851
|
}, () => r && o(r)];
|
|
843
852
|
}
|
|
844
|
-
const ue = (
|
|
845
|
-
let
|
|
846
|
-
const r =
|
|
847
|
-
return
|
|
848
|
-
const o = i.loaded, c = i.lengthComputable ? i.total : void 0, h = o -
|
|
849
|
-
|
|
853
|
+
const ue = (n, e, t = 3) => {
|
|
854
|
+
let s = 0;
|
|
855
|
+
const r = cs(50, 250);
|
|
856
|
+
return as((i) => {
|
|
857
|
+
const o = i.loaded, c = i.lengthComputable ? i.total : void 0, h = o - s, u = r(h), a = o <= c;
|
|
858
|
+
s = o;
|
|
850
859
|
const d = {
|
|
851
860
|
loaded: o,
|
|
852
861
|
total: c,
|
|
@@ -858,31 +867,31 @@ const ue = (s, e, t = 3) => {
|
|
|
858
867
|
lengthComputable: c != null,
|
|
859
868
|
[e ? "download" : "upload"]: !0
|
|
860
869
|
};
|
|
861
|
-
|
|
870
|
+
n(d);
|
|
862
871
|
}, t);
|
|
863
|
-
},
|
|
864
|
-
const t =
|
|
865
|
-
return [(
|
|
872
|
+
}, Ze = (n, e) => {
|
|
873
|
+
const t = n != null;
|
|
874
|
+
return [(s) => e[0]({
|
|
866
875
|
lengthComputable: t,
|
|
867
|
-
total:
|
|
868
|
-
loaded:
|
|
876
|
+
total: n,
|
|
877
|
+
loaded: s
|
|
869
878
|
}), e[1]];
|
|
870
|
-
},
|
|
879
|
+
}, Qe = (n) => (...e) => l.asap(() => n(...e)), ls = O.hasStandardBrowserEnv ? /* @__PURE__ */ ((n, e) => (t) => (t = new URL(t, O.origin), n.protocol === t.protocol && n.host === t.host && (e || n.port === t.port)))(
|
|
871
880
|
new URL(O.origin),
|
|
872
881
|
O.navigator && /(msie|trident)/i.test(O.navigator.userAgent)
|
|
873
|
-
) : () => !0,
|
|
882
|
+
) : () => !0, us = O.hasStandardBrowserEnv ? (
|
|
874
883
|
// Standard browser envs support document.cookie
|
|
875
884
|
{
|
|
876
|
-
write(
|
|
877
|
-
const o = [
|
|
878
|
-
l.isNumber(t) && o.push("expires=" + new Date(t).toGMTString()), l.isString(
|
|
885
|
+
write(n, e, t, s, r, i) {
|
|
886
|
+
const o = [n + "=" + encodeURIComponent(e)];
|
|
887
|
+
l.isNumber(t) && o.push("expires=" + new Date(t).toGMTString()), l.isString(s) && o.push("path=" + s), l.isString(r) && o.push("domain=" + r), i === !0 && o.push("secure"), document.cookie = o.join("; ");
|
|
879
888
|
},
|
|
880
|
-
read(
|
|
881
|
-
const e = document.cookie.match(new RegExp("(^|;\\s*)(" +
|
|
889
|
+
read(n) {
|
|
890
|
+
const e = document.cookie.match(new RegExp("(^|;\\s*)(" + n + ")=([^;]*)"));
|
|
882
891
|
return e ? decodeURIComponent(e[3]) : null;
|
|
883
892
|
},
|
|
884
|
-
remove(
|
|
885
|
-
this.write(
|
|
893
|
+
remove(n) {
|
|
894
|
+
this.write(n, "", Date.now() - 864e5);
|
|
886
895
|
}
|
|
887
896
|
}
|
|
888
897
|
) : (
|
|
@@ -897,44 +906,44 @@ const ue = (s, e, t = 3) => {
|
|
|
897
906
|
}
|
|
898
907
|
}
|
|
899
908
|
);
|
|
900
|
-
function
|
|
901
|
-
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(
|
|
909
|
+
function hs(n) {
|
|
910
|
+
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(n);
|
|
902
911
|
}
|
|
903
|
-
function
|
|
904
|
-
return e ?
|
|
912
|
+
function ds(n, e) {
|
|
913
|
+
return e ? n.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : n;
|
|
905
914
|
}
|
|
906
|
-
function
|
|
907
|
-
let
|
|
908
|
-
return
|
|
915
|
+
function It(n, e, t) {
|
|
916
|
+
let s = !hs(e);
|
|
917
|
+
return n && (s || t == !1) ? ds(n, e) : e;
|
|
909
918
|
}
|
|
910
|
-
const
|
|
911
|
-
function V(
|
|
919
|
+
const Ye = (n) => n instanceof k ? { ...n } : n;
|
|
920
|
+
function V(n, e) {
|
|
912
921
|
e = e || {};
|
|
913
922
|
const t = {};
|
|
914
|
-
function
|
|
923
|
+
function s(u, a, d, g) {
|
|
915
924
|
return l.isPlainObject(u) && l.isPlainObject(a) ? l.merge.call({ caseless: g }, u, a) : l.isPlainObject(a) ? l.merge({}, a) : l.isArray(a) ? a.slice() : a;
|
|
916
925
|
}
|
|
917
926
|
function r(u, a, d, g) {
|
|
918
927
|
if (l.isUndefined(a)) {
|
|
919
928
|
if (!l.isUndefined(u))
|
|
920
|
-
return
|
|
921
|
-
} else return
|
|
929
|
+
return s(void 0, u, d, g);
|
|
930
|
+
} else return s(u, a, d, g);
|
|
922
931
|
}
|
|
923
932
|
function i(u, a) {
|
|
924
933
|
if (!l.isUndefined(a))
|
|
925
|
-
return
|
|
934
|
+
return s(void 0, a);
|
|
926
935
|
}
|
|
927
936
|
function o(u, a) {
|
|
928
937
|
if (l.isUndefined(a)) {
|
|
929
938
|
if (!l.isUndefined(u))
|
|
930
|
-
return
|
|
931
|
-
} else return
|
|
939
|
+
return s(void 0, u);
|
|
940
|
+
} else return s(void 0, a);
|
|
932
941
|
}
|
|
933
942
|
function c(u, a, d) {
|
|
934
943
|
if (d in e)
|
|
935
|
-
return
|
|
936
|
-
if (d in
|
|
937
|
-
return
|
|
944
|
+
return s(u, a);
|
|
945
|
+
if (d in n)
|
|
946
|
+
return s(void 0, u);
|
|
938
947
|
}
|
|
939
948
|
const h = {
|
|
940
949
|
url: i,
|
|
@@ -965,17 +974,17 @@ function V(s, e) {
|
|
|
965
974
|
socketPath: o,
|
|
966
975
|
responseEncoding: o,
|
|
967
976
|
validateStatus: c,
|
|
968
|
-
headers: (u, a, d) => r(
|
|
977
|
+
headers: (u, a, d) => r(Ye(u), Ye(a), d, !0)
|
|
969
978
|
};
|
|
970
|
-
return l.forEach(Object.keys(Object.assign({},
|
|
971
|
-
const d = h[a] || r, g = d(
|
|
979
|
+
return l.forEach(Object.keys(Object.assign({}, n, e)), function(a) {
|
|
980
|
+
const d = h[a] || r, g = d(n[a], e[a], a);
|
|
972
981
|
l.isUndefined(g) && d !== c || (t[a] = g);
|
|
973
982
|
}), t;
|
|
974
983
|
}
|
|
975
|
-
const
|
|
976
|
-
const e = V({},
|
|
977
|
-
let { data: t, withXSRFToken:
|
|
978
|
-
e.headers = o =
|
|
984
|
+
const vt = (n) => {
|
|
985
|
+
const e = V({}, n);
|
|
986
|
+
let { data: t, withXSRFToken: s, xsrfHeaderName: r, xsrfCookieName: i, headers: o, auth: c } = e;
|
|
987
|
+
e.headers = o = k.from(o), e.url = Ct(It(e.baseURL, e.url, e.allowAbsoluteUrls), n.params, n.paramsSerializer), c && o.set(
|
|
979
988
|
"Authorization",
|
|
980
989
|
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
|
|
981
990
|
);
|
|
@@ -988,16 +997,16 @@ const Pt = (s) => {
|
|
|
988
997
|
o.setContentType([u || "multipart/form-data", ...a].join("; "));
|
|
989
998
|
}
|
|
990
999
|
}
|
|
991
|
-
if (O.hasStandardBrowserEnv && (
|
|
992
|
-
const u = r && i &&
|
|
1000
|
+
if (O.hasStandardBrowserEnv && (s && l.isFunction(s) && (s = s(e)), s || s !== !1 && ls(e.url))) {
|
|
1001
|
+
const u = r && i && us.read(i);
|
|
993
1002
|
u && o.set(r, u);
|
|
994
1003
|
}
|
|
995
1004
|
return e;
|
|
996
|
-
},
|
|
997
|
-
return new Promise(function(t,
|
|
998
|
-
const r =
|
|
1005
|
+
}, fs = typeof XMLHttpRequest < "u", ps = fs && function(n) {
|
|
1006
|
+
return new Promise(function(t, s) {
|
|
1007
|
+
const r = vt(n);
|
|
999
1008
|
let i = r.data;
|
|
1000
|
-
const o =
|
|
1009
|
+
const o = k.from(r.headers).normalize();
|
|
1001
1010
|
let { responseType: c, onUploadProgress: h, onDownloadProgress: u } = r, a, d, g, b, f;
|
|
1002
1011
|
function m() {
|
|
1003
1012
|
b && b(), f && f(), r.cancelToken && r.cancelToken.unsubscribe(a), r.signal && r.signal.removeEventListener("abort", a);
|
|
@@ -1007,104 +1016,104 @@ const Pt = (s) => {
|
|
|
1007
1016
|
function _() {
|
|
1008
1017
|
if (!p)
|
|
1009
1018
|
return;
|
|
1010
|
-
const S =
|
|
1019
|
+
const S = k.from(
|
|
1011
1020
|
"getAllResponseHeaders" in p && p.getAllResponseHeaders()
|
|
1012
1021
|
), x = {
|
|
1013
1022
|
data: !c || c === "text" || c === "json" ? p.responseText : p.response,
|
|
1014
1023
|
status: p.status,
|
|
1015
1024
|
statusText: p.statusText,
|
|
1016
1025
|
headers: S,
|
|
1017
|
-
config:
|
|
1026
|
+
config: n,
|
|
1018
1027
|
request: p
|
|
1019
1028
|
};
|
|
1020
|
-
|
|
1029
|
+
Pt(function(I) {
|
|
1021
1030
|
t(I), m();
|
|
1022
1031
|
}, function(I) {
|
|
1023
|
-
|
|
1032
|
+
s(I), m();
|
|
1024
1033
|
}, x), p = null;
|
|
1025
1034
|
}
|
|
1026
1035
|
"onloadend" in p ? p.onloadend = _ : p.onreadystatechange = function() {
|
|
1027
1036
|
!p || p.readyState !== 4 || p.status === 0 && !(p.responseURL && p.responseURL.indexOf("file:") === 0) || setTimeout(_);
|
|
1028
1037
|
}, p.onabort = function() {
|
|
1029
|
-
p && (
|
|
1038
|
+
p && (s(new w("Request aborted", w.ECONNABORTED, n, p)), p = null);
|
|
1030
1039
|
}, p.onerror = function() {
|
|
1031
|
-
|
|
1040
|
+
s(new w("Network Error", w.ERR_NETWORK, n, p)), p = null;
|
|
1032
1041
|
}, p.ontimeout = function() {
|
|
1033
|
-
let
|
|
1034
|
-
const x = r.transitional ||
|
|
1035
|
-
r.timeoutErrorMessage && (
|
|
1036
|
-
|
|
1042
|
+
let N = r.timeout ? "timeout of " + r.timeout + "ms exceeded" : "timeout exceeded";
|
|
1043
|
+
const x = r.transitional || Tt;
|
|
1044
|
+
r.timeoutErrorMessage && (N = r.timeoutErrorMessage), s(new w(
|
|
1045
|
+
N,
|
|
1037
1046
|
x.clarifyTimeoutError ? w.ETIMEDOUT : w.ECONNABORTED,
|
|
1038
|
-
|
|
1047
|
+
n,
|
|
1039
1048
|
p
|
|
1040
1049
|
)), p = null;
|
|
1041
|
-
}, i === void 0 && o.setContentType(null), "setRequestHeader" in p && l.forEach(o.toJSON(), function(
|
|
1042
|
-
p.setRequestHeader(x,
|
|
1050
|
+
}, i === void 0 && o.setContentType(null), "setRequestHeader" in p && l.forEach(o.toJSON(), function(N, x) {
|
|
1051
|
+
p.setRequestHeader(x, N);
|
|
1043
1052
|
}), l.isUndefined(r.withCredentials) || (p.withCredentials = !!r.withCredentials), c && c !== "json" && (p.responseType = r.responseType), u && ([g, f] = ue(u, !0), p.addEventListener("progress", g)), h && p.upload && ([d, b] = ue(h), p.upload.addEventListener("progress", d), p.upload.addEventListener("loadend", b)), (r.cancelToken || r.signal) && (a = (S) => {
|
|
1044
|
-
p && (
|
|
1053
|
+
p && (s(!S || S.type ? new X(null, n, p) : S), p.abort(), p = null);
|
|
1045
1054
|
}, r.cancelToken && r.cancelToken.subscribe(a), r.signal && (r.signal.aborted ? a() : r.signal.addEventListener("abort", a)));
|
|
1046
|
-
const E =
|
|
1055
|
+
const E = os(r.url);
|
|
1047
1056
|
if (E && O.protocols.indexOf(E) === -1) {
|
|
1048
|
-
|
|
1057
|
+
s(new w("Unsupported protocol " + E + ":", w.ERR_BAD_REQUEST, n));
|
|
1049
1058
|
return;
|
|
1050
1059
|
}
|
|
1051
1060
|
p.send(i || null);
|
|
1052
1061
|
});
|
|
1053
|
-
},
|
|
1054
|
-
const { length: t } =
|
|
1062
|
+
}, ms = (n, e) => {
|
|
1063
|
+
const { length: t } = n = n ? n.filter(Boolean) : [];
|
|
1055
1064
|
if (e || t) {
|
|
1056
|
-
let
|
|
1065
|
+
let s = new AbortController(), r;
|
|
1057
1066
|
const i = function(u) {
|
|
1058
1067
|
if (!r) {
|
|
1059
1068
|
r = !0, c();
|
|
1060
1069
|
const a = u instanceof Error ? u : this.reason;
|
|
1061
|
-
|
|
1070
|
+
s.abort(a instanceof w ? a : new X(a instanceof Error ? a.message : a));
|
|
1062
1071
|
}
|
|
1063
1072
|
};
|
|
1064
1073
|
let o = e && setTimeout(() => {
|
|
1065
1074
|
o = null, i(new w(`timeout ${e} of ms exceeded`, w.ETIMEDOUT));
|
|
1066
1075
|
}, e);
|
|
1067
1076
|
const c = () => {
|
|
1068
|
-
|
|
1077
|
+
n && (o && clearTimeout(o), o = null, n.forEach((u) => {
|
|
1069
1078
|
u.unsubscribe ? u.unsubscribe(i) : u.removeEventListener("abort", i);
|
|
1070
|
-
}),
|
|
1079
|
+
}), n = null);
|
|
1071
1080
|
};
|
|
1072
|
-
|
|
1073
|
-
const { signal: h } =
|
|
1081
|
+
n.forEach((u) => u.addEventListener("abort", i));
|
|
1082
|
+
const { signal: h } = s;
|
|
1074
1083
|
return h.unsubscribe = () => l.asap(c), h;
|
|
1075
1084
|
}
|
|
1076
|
-
},
|
|
1077
|
-
let t =
|
|
1085
|
+
}, gs = function* (n, e) {
|
|
1086
|
+
let t = n.byteLength;
|
|
1078
1087
|
if (t < e) {
|
|
1079
|
-
yield
|
|
1088
|
+
yield n;
|
|
1080
1089
|
return;
|
|
1081
1090
|
}
|
|
1082
|
-
let
|
|
1083
|
-
for (;
|
|
1084
|
-
r =
|
|
1085
|
-
},
|
|
1086
|
-
for await (const t of
|
|
1087
|
-
yield*
|
|
1088
|
-
},
|
|
1089
|
-
if (
|
|
1090
|
-
yield*
|
|
1091
|
+
let s = 0, r;
|
|
1092
|
+
for (; s < t; )
|
|
1093
|
+
r = s + e, yield n.slice(s, r), s = r;
|
|
1094
|
+
}, bs = async function* (n, e) {
|
|
1095
|
+
for await (const t of ws(n))
|
|
1096
|
+
yield* gs(t, e);
|
|
1097
|
+
}, ws = async function* (n) {
|
|
1098
|
+
if (n[Symbol.asyncIterator]) {
|
|
1099
|
+
yield* n;
|
|
1091
1100
|
return;
|
|
1092
1101
|
}
|
|
1093
|
-
const e =
|
|
1102
|
+
const e = n.getReader();
|
|
1094
1103
|
try {
|
|
1095
1104
|
for (; ; ) {
|
|
1096
|
-
const { done: t, value:
|
|
1105
|
+
const { done: t, value: s } = await e.read();
|
|
1097
1106
|
if (t)
|
|
1098
1107
|
break;
|
|
1099
|
-
yield
|
|
1108
|
+
yield s;
|
|
1100
1109
|
}
|
|
1101
1110
|
} finally {
|
|
1102
1111
|
await e.cancel();
|
|
1103
1112
|
}
|
|
1104
|
-
},
|
|
1105
|
-
const r =
|
|
1113
|
+
}, et = (n, e, t, s) => {
|
|
1114
|
+
const r = bs(n, e);
|
|
1106
1115
|
let i = 0, o, c = (h) => {
|
|
1107
|
-
o || (o = !0,
|
|
1116
|
+
o || (o = !0, s && s(h));
|
|
1108
1117
|
};
|
|
1109
1118
|
return new ReadableStream({
|
|
1110
1119
|
async pull(h) {
|
|
@@ -1130,54 +1139,54 @@ const Pt = (s) => {
|
|
|
1130
1139
|
}, {
|
|
1131
1140
|
highWaterMark: 2
|
|
1132
1141
|
});
|
|
1133
|
-
},
|
|
1142
|
+
}, be = typeof fetch == "function" && typeof Request == "function" && typeof Response == "function", Lt = be && typeof ReadableStream == "function", ys = be && (typeof TextEncoder == "function" ? /* @__PURE__ */ ((n) => (e) => n.encode(e))(new TextEncoder()) : async (n) => new Uint8Array(await new Response(n).arrayBuffer())), jt = (n, ...e) => {
|
|
1134
1143
|
try {
|
|
1135
|
-
return !!
|
|
1144
|
+
return !!n(...e);
|
|
1136
1145
|
} catch {
|
|
1137
1146
|
return !1;
|
|
1138
1147
|
}
|
|
1139
|
-
},
|
|
1140
|
-
let
|
|
1148
|
+
}, _s = Lt && jt(() => {
|
|
1149
|
+
let n = !1;
|
|
1141
1150
|
const e = new Request(O.origin, {
|
|
1142
1151
|
body: new ReadableStream(),
|
|
1143
1152
|
method: "POST",
|
|
1144
1153
|
get duplex() {
|
|
1145
|
-
return
|
|
1154
|
+
return n = !0, "half";
|
|
1146
1155
|
}
|
|
1147
1156
|
}).headers.has("Content-Type");
|
|
1148
|
-
return
|
|
1149
|
-
}),
|
|
1150
|
-
stream:
|
|
1157
|
+
return n && !e;
|
|
1158
|
+
}), tt = 64 * 1024, Ne = Lt && jt(() => l.isReadableStream(new Response("").body)), he = {
|
|
1159
|
+
stream: Ne && ((n) => n.body)
|
|
1151
1160
|
};
|
|
1152
|
-
|
|
1161
|
+
be && ((n) => {
|
|
1153
1162
|
["text", "arrayBuffer", "blob", "formData", "stream"].forEach((e) => {
|
|
1154
|
-
!he[e] && (he[e] = l.isFunction(
|
|
1155
|
-
throw new w(`Response type '${e}' is not supported`, w.ERR_NOT_SUPPORT,
|
|
1163
|
+
!he[e] && (he[e] = l.isFunction(n[e]) ? (t) => t[e]() : (t, s) => {
|
|
1164
|
+
throw new w(`Response type '${e}' is not supported`, w.ERR_NOT_SUPPORT, s);
|
|
1156
1165
|
});
|
|
1157
1166
|
});
|
|
1158
1167
|
})(new Response());
|
|
1159
|
-
const
|
|
1160
|
-
if (
|
|
1168
|
+
const Es = async (n) => {
|
|
1169
|
+
if (n == null)
|
|
1161
1170
|
return 0;
|
|
1162
|
-
if (l.isBlob(
|
|
1163
|
-
return
|
|
1164
|
-
if (l.isSpecCompliantForm(
|
|
1171
|
+
if (l.isBlob(n))
|
|
1172
|
+
return n.size;
|
|
1173
|
+
if (l.isSpecCompliantForm(n))
|
|
1165
1174
|
return (await new Request(O.origin, {
|
|
1166
1175
|
method: "POST",
|
|
1167
|
-
body:
|
|
1176
|
+
body: n
|
|
1168
1177
|
}).arrayBuffer()).byteLength;
|
|
1169
|
-
if (l.isArrayBufferView(
|
|
1170
|
-
return
|
|
1171
|
-
if (l.isURLSearchParams(
|
|
1172
|
-
return (await
|
|
1173
|
-
},
|
|
1174
|
-
const t = l.toFiniteNumber(
|
|
1175
|
-
return t ??
|
|
1176
|
-
},
|
|
1178
|
+
if (l.isArrayBufferView(n) || l.isArrayBuffer(n))
|
|
1179
|
+
return n.byteLength;
|
|
1180
|
+
if (l.isURLSearchParams(n) && (n = n + ""), l.isString(n))
|
|
1181
|
+
return (await ys(n)).byteLength;
|
|
1182
|
+
}, Ss = async (n, e) => {
|
|
1183
|
+
const t = l.toFiniteNumber(n.getContentLength());
|
|
1184
|
+
return t ?? Es(e);
|
|
1185
|
+
}, xs = be && (async (n) => {
|
|
1177
1186
|
let {
|
|
1178
1187
|
url: e,
|
|
1179
1188
|
method: t,
|
|
1180
|
-
data:
|
|
1189
|
+
data: s,
|
|
1181
1190
|
signal: r,
|
|
1182
1191
|
cancelToken: i,
|
|
1183
1192
|
timeout: o,
|
|
@@ -1187,26 +1196,26 @@ const ws = async (s) => {
|
|
|
1187
1196
|
headers: a,
|
|
1188
1197
|
withCredentials: d = "same-origin",
|
|
1189
1198
|
fetchOptions: g
|
|
1190
|
-
} =
|
|
1199
|
+
} = vt(n);
|
|
1191
1200
|
u = u ? (u + "").toLowerCase() : "text";
|
|
1192
|
-
let b =
|
|
1201
|
+
let b = ms([r, i && i.toAbortSignal()], o), f;
|
|
1193
1202
|
const m = b && b.unsubscribe && (() => {
|
|
1194
1203
|
b.unsubscribe();
|
|
1195
1204
|
});
|
|
1196
1205
|
let p;
|
|
1197
1206
|
try {
|
|
1198
|
-
if (h &&
|
|
1207
|
+
if (h && _s && t !== "get" && t !== "head" && (p = await Ss(a, s)) !== 0) {
|
|
1199
1208
|
let x = new Request(e, {
|
|
1200
1209
|
method: "POST",
|
|
1201
|
-
body:
|
|
1210
|
+
body: s,
|
|
1202
1211
|
duplex: "half"
|
|
1203
1212
|
}), P;
|
|
1204
|
-
if (l.isFormData(
|
|
1205
|
-
const [I, D] =
|
|
1213
|
+
if (l.isFormData(s) && (P = x.headers.get("content-type")) && a.setContentType(P), x.body) {
|
|
1214
|
+
const [I, D] = Ze(
|
|
1206
1215
|
p,
|
|
1207
|
-
ue(
|
|
1216
|
+
ue(Qe(h))
|
|
1208
1217
|
);
|
|
1209
|
-
|
|
1218
|
+
s = et(x.body, tt, I, D);
|
|
1210
1219
|
}
|
|
1211
1220
|
}
|
|
1212
1221
|
l.isString(d) || (d = d ? "include" : "omit");
|
|
@@ -1216,125 +1225,125 @@ const ws = async (s) => {
|
|
|
1216
1225
|
signal: b,
|
|
1217
1226
|
method: t.toUpperCase(),
|
|
1218
1227
|
headers: a.normalize().toJSON(),
|
|
1219
|
-
body:
|
|
1228
|
+
body: s,
|
|
1220
1229
|
duplex: "half",
|
|
1221
1230
|
credentials: _ ? d : void 0
|
|
1222
1231
|
});
|
|
1223
1232
|
let E = await fetch(f);
|
|
1224
|
-
const S =
|
|
1225
|
-
if (
|
|
1233
|
+
const S = Ne && (u === "stream" || u === "response");
|
|
1234
|
+
if (Ne && (c || S && m)) {
|
|
1226
1235
|
const x = {};
|
|
1227
1236
|
["status", "statusText", "headers"].forEach((U) => {
|
|
1228
1237
|
x[U] = E[U];
|
|
1229
1238
|
});
|
|
1230
|
-
const P = l.toFiniteNumber(E.headers.get("content-length")), [I, D] = c &&
|
|
1239
|
+
const P = l.toFiniteNumber(E.headers.get("content-length")), [I, D] = c && Ze(
|
|
1231
1240
|
P,
|
|
1232
|
-
ue(
|
|
1241
|
+
ue(Qe(c), !0)
|
|
1233
1242
|
) || [];
|
|
1234
1243
|
E = new Response(
|
|
1235
|
-
|
|
1244
|
+
et(E.body, tt, I, () => {
|
|
1236
1245
|
D && D(), m && m();
|
|
1237
1246
|
}),
|
|
1238
1247
|
x
|
|
1239
1248
|
);
|
|
1240
1249
|
}
|
|
1241
1250
|
u = u || "text";
|
|
1242
|
-
let
|
|
1251
|
+
let N = await he[l.findKey(he, u) || "text"](E, n);
|
|
1243
1252
|
return !S && m && m(), await new Promise((x, P) => {
|
|
1244
|
-
|
|
1245
|
-
data:
|
|
1246
|
-
headers:
|
|
1253
|
+
Pt(x, P, {
|
|
1254
|
+
data: N,
|
|
1255
|
+
headers: k.from(E.headers),
|
|
1247
1256
|
status: E.status,
|
|
1248
1257
|
statusText: E.statusText,
|
|
1249
|
-
config:
|
|
1258
|
+
config: n,
|
|
1250
1259
|
request: f
|
|
1251
1260
|
});
|
|
1252
1261
|
});
|
|
1253
1262
|
} catch (_) {
|
|
1254
|
-
throw m && m(), _ && _.name === "TypeError" && /fetch/i.test(_.message) ? Object.assign(
|
|
1255
|
-
new w("Network Error", w.ERR_NETWORK,
|
|
1263
|
+
throw m && m(), _ && _.name === "TypeError" && /Load failed|fetch/i.test(_.message) ? Object.assign(
|
|
1264
|
+
new w("Network Error", w.ERR_NETWORK, n, f),
|
|
1256
1265
|
{
|
|
1257
1266
|
cause: _.cause || _
|
|
1258
1267
|
}
|
|
1259
|
-
) : w.from(_, _ && _.code,
|
|
1268
|
+
) : w.from(_, _ && _.code, n, f);
|
|
1260
1269
|
}
|
|
1261
|
-
}),
|
|
1262
|
-
http:
|
|
1263
|
-
xhr:
|
|
1264
|
-
fetch:
|
|
1270
|
+
}), Pe = {
|
|
1271
|
+
http: Un,
|
|
1272
|
+
xhr: ps,
|
|
1273
|
+
fetch: xs
|
|
1265
1274
|
};
|
|
1266
|
-
l.forEach(
|
|
1267
|
-
if (
|
|
1275
|
+
l.forEach(Pe, (n, e) => {
|
|
1276
|
+
if (n) {
|
|
1268
1277
|
try {
|
|
1269
|
-
Object.defineProperty(
|
|
1278
|
+
Object.defineProperty(n, "name", { value: e });
|
|
1270
1279
|
} catch {
|
|
1271
1280
|
}
|
|
1272
|
-
Object.defineProperty(
|
|
1281
|
+
Object.defineProperty(n, "adapterName", { value: e });
|
|
1273
1282
|
}
|
|
1274
1283
|
});
|
|
1275
|
-
const
|
|
1276
|
-
getAdapter: (
|
|
1277
|
-
|
|
1278
|
-
const { length: e } =
|
|
1279
|
-
let t,
|
|
1284
|
+
const nt = (n) => `- ${n}`, Rs = (n) => l.isFunction(n) || n === null || n === !1, $t = {
|
|
1285
|
+
getAdapter: (n) => {
|
|
1286
|
+
n = l.isArray(n) ? n : [n];
|
|
1287
|
+
const { length: e } = n;
|
|
1288
|
+
let t, s;
|
|
1280
1289
|
const r = {};
|
|
1281
1290
|
for (let i = 0; i < e; i++) {
|
|
1282
|
-
t =
|
|
1291
|
+
t = n[i];
|
|
1283
1292
|
let o;
|
|
1284
|
-
if (
|
|
1293
|
+
if (s = t, !Rs(t) && (s = Pe[(o = String(t)).toLowerCase()], s === void 0))
|
|
1285
1294
|
throw new w(`Unknown adapter '${o}'`);
|
|
1286
|
-
if (
|
|
1295
|
+
if (s)
|
|
1287
1296
|
break;
|
|
1288
|
-
r[o || "#" + i] =
|
|
1297
|
+
r[o || "#" + i] = s;
|
|
1289
1298
|
}
|
|
1290
|
-
if (!
|
|
1299
|
+
if (!s) {
|
|
1291
1300
|
const i = Object.entries(r).map(
|
|
1292
1301
|
([c, h]) => `adapter ${c} ` + (h === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1293
1302
|
);
|
|
1294
1303
|
let o = e ? i.length > 1 ? `since :
|
|
1295
|
-
` + i.map(
|
|
1296
|
-
`) : " " +
|
|
1304
|
+
` + i.map(nt).join(`
|
|
1305
|
+
`) : " " + nt(i[0]) : "as no adapter specified";
|
|
1297
1306
|
throw new w(
|
|
1298
1307
|
"There is no suitable adapter to dispatch the request " + o,
|
|
1299
1308
|
"ERR_NOT_SUPPORT"
|
|
1300
1309
|
);
|
|
1301
1310
|
}
|
|
1302
|
-
return
|
|
1311
|
+
return s;
|
|
1303
1312
|
},
|
|
1304
|
-
adapters:
|
|
1313
|
+
adapters: Pe
|
|
1305
1314
|
};
|
|
1306
|
-
function
|
|
1307
|
-
if (
|
|
1308
|
-
throw new X(null,
|
|
1315
|
+
function Ae(n) {
|
|
1316
|
+
if (n.cancelToken && n.cancelToken.throwIfRequested(), n.signal && n.signal.aborted)
|
|
1317
|
+
throw new X(null, n);
|
|
1309
1318
|
}
|
|
1310
|
-
function
|
|
1311
|
-
return
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
), ["post", "put", "patch"].indexOf(
|
|
1315
|
-
return
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
),
|
|
1320
|
-
}, function(
|
|
1321
|
-
return
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
),
|
|
1319
|
+
function st(n) {
|
|
1320
|
+
return Ae(n), n.headers = k.from(n.headers), n.data = Re.call(
|
|
1321
|
+
n,
|
|
1322
|
+
n.transformRequest
|
|
1323
|
+
), ["post", "put", "patch"].indexOf(n.method) !== -1 && n.headers.setContentType("application/x-www-form-urlencoded", !1), $t.getAdapter(n.adapter || te.adapter)(n).then(function(s) {
|
|
1324
|
+
return Ae(n), s.data = Re.call(
|
|
1325
|
+
n,
|
|
1326
|
+
n.transformResponse,
|
|
1327
|
+
s
|
|
1328
|
+
), s.headers = k.from(s.headers), s;
|
|
1329
|
+
}, function(s) {
|
|
1330
|
+
return Nt(s) || (Ae(n), s && s.response && (s.response.data = Re.call(
|
|
1331
|
+
n,
|
|
1332
|
+
n.transformResponse,
|
|
1333
|
+
s.response
|
|
1334
|
+
), s.response.headers = k.from(s.response.headers))), Promise.reject(s);
|
|
1326
1335
|
});
|
|
1327
1336
|
}
|
|
1328
|
-
const
|
|
1329
|
-
["object", "boolean", "number", "function", "string", "symbol"].forEach((
|
|
1330
|
-
|
|
1331
|
-
return typeof
|
|
1337
|
+
const Ft = "1.9.0", we = {};
|
|
1338
|
+
["object", "boolean", "number", "function", "string", "symbol"].forEach((n, e) => {
|
|
1339
|
+
we[n] = function(s) {
|
|
1340
|
+
return typeof s === n || "a" + (e < 1 ? "n " : " ") + n;
|
|
1332
1341
|
};
|
|
1333
1342
|
});
|
|
1334
|
-
const
|
|
1335
|
-
|
|
1343
|
+
const rt = {};
|
|
1344
|
+
we.transitional = function(e, t, s) {
|
|
1336
1345
|
function r(i, o) {
|
|
1337
|
-
return "[Axios v" +
|
|
1346
|
+
return "[Axios v" + Ft + "] Transitional option '" + i + "'" + o + (s ? ". " + s : "");
|
|
1338
1347
|
}
|
|
1339
1348
|
return (i, o, c) => {
|
|
1340
1349
|
if (e === !1)
|
|
@@ -1342,7 +1351,7 @@ be.transitional = function(e, t, n) {
|
|
|
1342
1351
|
r(o, " has been removed" + (t ? " in " + t : "")),
|
|
1343
1352
|
w.ERR_DEPRECATED
|
|
1344
1353
|
);
|
|
1345
|
-
return t && !
|
|
1354
|
+
return t && !rt[o] && (rt[o] = !0, console.warn(
|
|
1346
1355
|
r(
|
|
1347
1356
|
o,
|
|
1348
1357
|
" has been deprecated since v" + t + " and will be removed in the near future"
|
|
@@ -1350,18 +1359,18 @@ be.transitional = function(e, t, n) {
|
|
|
1350
1359
|
)), e ? e(i, o, c) : !0;
|
|
1351
1360
|
};
|
|
1352
1361
|
};
|
|
1353
|
-
|
|
1354
|
-
return (t,
|
|
1362
|
+
we.spelling = function(e) {
|
|
1363
|
+
return (t, s) => (console.warn(`${s} is likely a misspelling of ${e}`), !0);
|
|
1355
1364
|
};
|
|
1356
|
-
function
|
|
1357
|
-
if (typeof
|
|
1365
|
+
function As(n, e, t) {
|
|
1366
|
+
if (typeof n != "object")
|
|
1358
1367
|
throw new w("options must be an object", w.ERR_BAD_OPTION_VALUE);
|
|
1359
|
-
const
|
|
1360
|
-
let r =
|
|
1368
|
+
const s = Object.keys(n);
|
|
1369
|
+
let r = s.length;
|
|
1361
1370
|
for (; r-- > 0; ) {
|
|
1362
|
-
const i =
|
|
1371
|
+
const i = s[r], o = e[i];
|
|
1363
1372
|
if (o) {
|
|
1364
|
-
const c =
|
|
1373
|
+
const c = n[i], h = c === void 0 || o(c, i, n);
|
|
1365
1374
|
if (h !== !0)
|
|
1366
1375
|
throw new w("option " + i + " must be " + h, w.ERR_BAD_OPTION_VALUE);
|
|
1367
1376
|
continue;
|
|
@@ -1371,14 +1380,14 @@ function Ss(s, e, t) {
|
|
|
1371
1380
|
}
|
|
1372
1381
|
}
|
|
1373
1382
|
const le = {
|
|
1374
|
-
assertOptions:
|
|
1375
|
-
validators:
|
|
1383
|
+
assertOptions: As,
|
|
1384
|
+
validators: we
|
|
1376
1385
|
}, F = le.validators;
|
|
1377
1386
|
let z = class {
|
|
1378
1387
|
constructor(e) {
|
|
1379
|
-
this.defaults = e, this.interceptors = {
|
|
1380
|
-
request: new
|
|
1381
|
-
response: new
|
|
1388
|
+
this.defaults = e || {}, this.interceptors = {
|
|
1389
|
+
request: new Xe(),
|
|
1390
|
+
response: new Xe()
|
|
1382
1391
|
};
|
|
1383
1392
|
}
|
|
1384
1393
|
/**
|
|
@@ -1392,24 +1401,24 @@ let z = class {
|
|
|
1392
1401
|
async request(e, t) {
|
|
1393
1402
|
try {
|
|
1394
1403
|
return await this._request(e, t);
|
|
1395
|
-
} catch (
|
|
1396
|
-
if (
|
|
1404
|
+
} catch (s) {
|
|
1405
|
+
if (s instanceof Error) {
|
|
1397
1406
|
let r = {};
|
|
1398
1407
|
Error.captureStackTrace ? Error.captureStackTrace(r) : r = new Error();
|
|
1399
1408
|
const i = r.stack ? r.stack.replace(/^.+\n/, "") : "";
|
|
1400
1409
|
try {
|
|
1401
|
-
|
|
1402
|
-
` + i) :
|
|
1410
|
+
s.stack ? i && !String(s.stack).endsWith(i.replace(/^.+\n.+\n/, "")) && (s.stack += `
|
|
1411
|
+
` + i) : s.stack = i;
|
|
1403
1412
|
} catch {
|
|
1404
1413
|
}
|
|
1405
1414
|
}
|
|
1406
|
-
throw
|
|
1415
|
+
throw s;
|
|
1407
1416
|
}
|
|
1408
1417
|
}
|
|
1409
1418
|
_request(e, t) {
|
|
1410
1419
|
typeof e == "string" ? (t = t || {}, t.url = e) : t = e || {}, t = V(this.defaults, t);
|
|
1411
|
-
const { transitional:
|
|
1412
|
-
|
|
1420
|
+
const { transitional: s, paramsSerializer: r, headers: i } = t;
|
|
1421
|
+
s !== void 0 && le.assertOptions(s, {
|
|
1413
1422
|
silentJSONParsing: F.transitional(F.boolean),
|
|
1414
1423
|
forcedJSONParsing: F.transitional(F.boolean),
|
|
1415
1424
|
clarifyTimeoutError: F.transitional(F.boolean)
|
|
@@ -1431,7 +1440,7 @@ let z = class {
|
|
|
1431
1440
|
(f) => {
|
|
1432
1441
|
delete i[f];
|
|
1433
1442
|
}
|
|
1434
|
-
), t.headers =
|
|
1443
|
+
), t.headers = k.concat(o, i);
|
|
1435
1444
|
const c = [];
|
|
1436
1445
|
let h = !0;
|
|
1437
1446
|
this.interceptors.request.forEach(function(m) {
|
|
@@ -1443,7 +1452,7 @@ let z = class {
|
|
|
1443
1452
|
});
|
|
1444
1453
|
let a, d = 0, g;
|
|
1445
1454
|
if (!h) {
|
|
1446
|
-
const f = [
|
|
1455
|
+
const f = [st.bind(this), void 0];
|
|
1447
1456
|
for (f.unshift.apply(f, c), f.push.apply(f, u), g = f.length, a = Promise.resolve(t); d < g; )
|
|
1448
1457
|
a = a.then(f[d++], f[d++]);
|
|
1449
1458
|
return a;
|
|
@@ -1460,7 +1469,7 @@ let z = class {
|
|
|
1460
1469
|
}
|
|
1461
1470
|
}
|
|
1462
1471
|
try {
|
|
1463
|
-
a =
|
|
1472
|
+
a = st.call(this, b);
|
|
1464
1473
|
} catch (f) {
|
|
1465
1474
|
return Promise.reject(f);
|
|
1466
1475
|
}
|
|
@@ -1470,25 +1479,25 @@ let z = class {
|
|
|
1470
1479
|
}
|
|
1471
1480
|
getUri(e) {
|
|
1472
1481
|
e = V(this.defaults, e);
|
|
1473
|
-
const t =
|
|
1474
|
-
return
|
|
1482
|
+
const t = It(e.baseURL, e.url, e.allowAbsoluteUrls);
|
|
1483
|
+
return Ct(t, e.params, e.paramsSerializer);
|
|
1475
1484
|
}
|
|
1476
1485
|
};
|
|
1477
1486
|
l.forEach(["delete", "get", "head", "options"], function(e) {
|
|
1478
|
-
z.prototype[e] = function(t,
|
|
1479
|
-
return this.request(V(
|
|
1487
|
+
z.prototype[e] = function(t, s) {
|
|
1488
|
+
return this.request(V(s || {}, {
|
|
1480
1489
|
method: e,
|
|
1481
1490
|
url: t,
|
|
1482
|
-
data: (
|
|
1491
|
+
data: (s || {}).data
|
|
1483
1492
|
}));
|
|
1484
1493
|
};
|
|
1485
1494
|
});
|
|
1486
1495
|
l.forEach(["post", "put", "patch"], function(e) {
|
|
1487
|
-
function t(
|
|
1496
|
+
function t(s) {
|
|
1488
1497
|
return function(i, o, c) {
|
|
1489
1498
|
return this.request(V(c || {}, {
|
|
1490
1499
|
method: e,
|
|
1491
|
-
headers:
|
|
1500
|
+
headers: s ? {
|
|
1492
1501
|
"Content-Type": "multipart/form-data"
|
|
1493
1502
|
} : {},
|
|
1494
1503
|
url: i,
|
|
@@ -1498,7 +1507,7 @@ l.forEach(["post", "put", "patch"], function(e) {
|
|
|
1498
1507
|
}
|
|
1499
1508
|
z.prototype[e] = t(), z.prototype[e + "Form"] = t(!0);
|
|
1500
1509
|
});
|
|
1501
|
-
let
|
|
1510
|
+
let Os = class Ut {
|
|
1502
1511
|
constructor(e) {
|
|
1503
1512
|
if (typeof e != "function")
|
|
1504
1513
|
throw new TypeError("executor must be a function.");
|
|
@@ -1506,23 +1515,23 @@ let xs = class jt {
|
|
|
1506
1515
|
this.promise = new Promise(function(i) {
|
|
1507
1516
|
t = i;
|
|
1508
1517
|
});
|
|
1509
|
-
const
|
|
1518
|
+
const s = this;
|
|
1510
1519
|
this.promise.then((r) => {
|
|
1511
|
-
if (!
|
|
1512
|
-
let i =
|
|
1520
|
+
if (!s._listeners) return;
|
|
1521
|
+
let i = s._listeners.length;
|
|
1513
1522
|
for (; i-- > 0; )
|
|
1514
|
-
|
|
1515
|
-
|
|
1523
|
+
s._listeners[i](r);
|
|
1524
|
+
s._listeners = null;
|
|
1516
1525
|
}), this.promise.then = (r) => {
|
|
1517
1526
|
let i;
|
|
1518
1527
|
const o = new Promise((c) => {
|
|
1519
|
-
|
|
1528
|
+
s.subscribe(c), i = c;
|
|
1520
1529
|
}).then(r);
|
|
1521
1530
|
return o.cancel = function() {
|
|
1522
|
-
|
|
1531
|
+
s.unsubscribe(i);
|
|
1523
1532
|
}, o;
|
|
1524
1533
|
}, e(function(i, o, c) {
|
|
1525
|
-
|
|
1534
|
+
s.reason || (s.reason = new X(i, o, c), t(s.reason));
|
|
1526
1535
|
});
|
|
1527
1536
|
}
|
|
1528
1537
|
/**
|
|
@@ -1552,8 +1561,8 @@ let xs = class jt {
|
|
|
1552
1561
|
t !== -1 && this._listeners.splice(t, 1);
|
|
1553
1562
|
}
|
|
1554
1563
|
toAbortSignal() {
|
|
1555
|
-
const e = new AbortController(), t = (
|
|
1556
|
-
e.abort(
|
|
1564
|
+
const e = new AbortController(), t = (s) => {
|
|
1565
|
+
e.abort(s);
|
|
1557
1566
|
};
|
|
1558
1567
|
return this.subscribe(t), e.signal.unsubscribe = () => this.unsubscribe(t), e.signal;
|
|
1559
1568
|
}
|
|
@@ -1564,22 +1573,22 @@ let xs = class jt {
|
|
|
1564
1573
|
static source() {
|
|
1565
1574
|
let e;
|
|
1566
1575
|
return {
|
|
1567
|
-
token: new
|
|
1576
|
+
token: new Ut(function(r) {
|
|
1568
1577
|
e = r;
|
|
1569
1578
|
}),
|
|
1570
1579
|
cancel: e
|
|
1571
1580
|
};
|
|
1572
1581
|
}
|
|
1573
1582
|
};
|
|
1574
|
-
function
|
|
1583
|
+
function Cs(n) {
|
|
1575
1584
|
return function(t) {
|
|
1576
|
-
return
|
|
1585
|
+
return n.apply(null, t);
|
|
1577
1586
|
};
|
|
1578
1587
|
}
|
|
1579
|
-
function
|
|
1580
|
-
return l.isObject(
|
|
1588
|
+
function Ts(n) {
|
|
1589
|
+
return l.isObject(n) && n.isAxiosError === !0;
|
|
1581
1590
|
}
|
|
1582
|
-
const
|
|
1591
|
+
const Ie = {
|
|
1583
1592
|
Continue: 100,
|
|
1584
1593
|
SwitchingProtocols: 101,
|
|
1585
1594
|
Processing: 102,
|
|
@@ -1644,84 +1653,84 @@ const Pe = {
|
|
|
1644
1653
|
NotExtended: 510,
|
|
1645
1654
|
NetworkAuthenticationRequired: 511
|
|
1646
1655
|
};
|
|
1647
|
-
Object.entries(
|
|
1648
|
-
|
|
1656
|
+
Object.entries(Ie).forEach(([n, e]) => {
|
|
1657
|
+
Ie[e] = n;
|
|
1649
1658
|
});
|
|
1650
|
-
function
|
|
1651
|
-
const e = new z(
|
|
1659
|
+
function Dt(n) {
|
|
1660
|
+
const e = new z(n), t = mt(z.prototype.request, e);
|
|
1652
1661
|
return l.extend(t, z.prototype, e, { allOwnKeys: !0 }), l.extend(t, e, null, { allOwnKeys: !0 }), t.create = function(r) {
|
|
1653
|
-
return
|
|
1662
|
+
return Dt(V(n, r));
|
|
1654
1663
|
}, t;
|
|
1655
1664
|
}
|
|
1656
|
-
const R =
|
|
1665
|
+
const R = Dt(te);
|
|
1657
1666
|
R.Axios = z;
|
|
1658
1667
|
R.CanceledError = X;
|
|
1659
|
-
R.CancelToken =
|
|
1660
|
-
R.isCancel =
|
|
1661
|
-
R.VERSION =
|
|
1662
|
-
R.toFormData =
|
|
1668
|
+
R.CancelToken = Os;
|
|
1669
|
+
R.isCancel = Nt;
|
|
1670
|
+
R.VERSION = Ft;
|
|
1671
|
+
R.toFormData = ge;
|
|
1663
1672
|
R.AxiosError = w;
|
|
1664
1673
|
R.Cancel = R.CanceledError;
|
|
1665
1674
|
R.all = function(e) {
|
|
1666
1675
|
return Promise.all(e);
|
|
1667
1676
|
};
|
|
1668
|
-
R.spread =
|
|
1669
|
-
R.isAxiosError =
|
|
1677
|
+
R.spread = Cs;
|
|
1678
|
+
R.isAxiosError = Ts;
|
|
1670
1679
|
R.mergeConfig = V;
|
|
1671
|
-
R.AxiosHeaders =
|
|
1672
|
-
R.formToJSON = (
|
|
1673
|
-
R.getAdapter =
|
|
1674
|
-
R.HttpStatusCode =
|
|
1680
|
+
R.AxiosHeaders = k;
|
|
1681
|
+
R.formToJSON = (n) => kt(l.isHTMLForm(n) ? new FormData(n) : n);
|
|
1682
|
+
R.getAdapter = $t.getAdapter;
|
|
1683
|
+
R.HttpStatusCode = Ie;
|
|
1675
1684
|
R.default = R;
|
|
1676
1685
|
const {
|
|
1677
|
-
Axios:
|
|
1678
|
-
AxiosError:
|
|
1679
|
-
CanceledError:
|
|
1680
|
-
isCancel:
|
|
1681
|
-
CancelToken:
|
|
1682
|
-
VERSION:
|
|
1683
|
-
all:
|
|
1684
|
-
Cancel:
|
|
1685
|
-
isAxiosError:
|
|
1686
|
-
spread:
|
|
1687
|
-
toFormData:
|
|
1688
|
-
AxiosHeaders:
|
|
1689
|
-
HttpStatusCode:
|
|
1690
|
-
formToJSON:
|
|
1691
|
-
getAdapter:
|
|
1692
|
-
mergeConfig:
|
|
1693
|
-
} = R,
|
|
1686
|
+
Axios: Wr,
|
|
1687
|
+
AxiosError: Kr,
|
|
1688
|
+
CanceledError: Xr,
|
|
1689
|
+
isCancel: Gr,
|
|
1690
|
+
CancelToken: Zr,
|
|
1691
|
+
VERSION: Qr,
|
|
1692
|
+
all: Yr,
|
|
1693
|
+
Cancel: ei,
|
|
1694
|
+
isAxiosError: ti,
|
|
1695
|
+
spread: ni,
|
|
1696
|
+
toFormData: si,
|
|
1697
|
+
AxiosHeaders: ri,
|
|
1698
|
+
HttpStatusCode: ii,
|
|
1699
|
+
formToJSON: oi,
|
|
1700
|
+
getAdapter: ci,
|
|
1701
|
+
mergeConfig: ai
|
|
1702
|
+
} = R, De = R.create({
|
|
1694
1703
|
baseURL: location.origin,
|
|
1695
1704
|
timeout: 6e4,
|
|
1696
1705
|
params: {}
|
|
1697
1706
|
});
|
|
1698
|
-
|
|
1699
|
-
(
|
|
1700
|
-
(
|
|
1701
|
-
var e, t,
|
|
1702
|
-
if (
|
|
1703
|
-
if (
|
|
1707
|
+
De.interceptors.response.use(
|
|
1708
|
+
(n) => n,
|
|
1709
|
+
(n) => {
|
|
1710
|
+
var e, t, s, r, i, o, c, h, u, a, d;
|
|
1711
|
+
if (n.response) {
|
|
1712
|
+
if (n.response.status === 401 && OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity, !0).then(
|
|
1704
1713
|
function(f) {
|
|
1705
1714
|
f && OpenC3Auth.setTokens();
|
|
1706
1715
|
}
|
|
1707
|
-
),
|
|
1708
|
-
|
|
1716
|
+
), n.response.config.headers["Ignore-Errors"] && n.response.config.headers["Ignore-Errors"].includes(
|
|
1717
|
+
n.response.status.toString()
|
|
1709
1718
|
))
|
|
1710
|
-
return Promise.reject(
|
|
1711
|
-
let g = `HTTP ${
|
|
1712
|
-
(e =
|
|
1719
|
+
return Promise.reject(n);
|
|
1720
|
+
let g = `HTTP ${n.response.status} - `;
|
|
1721
|
+
(e = n.response) != null && e.statusText && (g += `${n.response.statusText} `), (s = (t = n.response) == null ? void 0 : t.config) != null && s.data && (g += `${n.response.config.data} `), (i = (r = n.response) == null ? void 0 : r.data) != null && i.message ? g += `${n.response.data.message}` : (c = (o = n.response) == null ? void 0 : o.data) != null && c.exception ? g += `${n.response.data.exception}` : (a = (u = (h = n.response) == null ? void 0 : h.data) == null ? void 0 : u.error) != null && a.message ? (n.response.data.error.class && (g += `${n.response.data.error.class} `), g += `${n.response.data.error.message}`) : g += `${(d = n.response) == null ? void 0 : d.data}`;
|
|
1713
1722
|
const { $cosmosNotify: b } = window;
|
|
1714
1723
|
throw b && b.serious({
|
|
1715
1724
|
title: "Network error",
|
|
1716
1725
|
body: g
|
|
1717
|
-
}),
|
|
1726
|
+
}), n;
|
|
1718
1727
|
} else
|
|
1719
|
-
throw
|
|
1728
|
+
throw n;
|
|
1720
1729
|
}
|
|
1721
1730
|
);
|
|
1722
|
-
const re = async function(
|
|
1731
|
+
const re = async function(n, e, {
|
|
1723
1732
|
data: t,
|
|
1724
|
-
params:
|
|
1733
|
+
params: s = {},
|
|
1725
1734
|
headers: r,
|
|
1726
1735
|
noAuth: i = !1,
|
|
1727
1736
|
noScope: o = !1,
|
|
@@ -1737,96 +1746,96 @@ const re = async function(s, e, {
|
|
|
1737
1746
|
}
|
|
1738
1747
|
r.Authorization = localStorage.openc3Token;
|
|
1739
1748
|
}
|
|
1740
|
-
return r.manual = !0, !o && !
|
|
1741
|
-
method:
|
|
1749
|
+
return r.manual = !0, !o && !s.scope && (s.scope = window.openc3Scope), De({
|
|
1750
|
+
method: n,
|
|
1742
1751
|
url: e,
|
|
1743
1752
|
data: t,
|
|
1744
|
-
params:
|
|
1753
|
+
params: s,
|
|
1745
1754
|
headers: r,
|
|
1746
1755
|
onUploadProgress: c
|
|
1747
1756
|
});
|
|
1748
|
-
},
|
|
1757
|
+
}, ve = {
|
|
1749
1758
|
Accept: "application/json"
|
|
1750
|
-
},
|
|
1751
|
-
...
|
|
1759
|
+
}, it = {
|
|
1760
|
+
...ve,
|
|
1752
1761
|
"Content-Type": "application/json"
|
|
1753
|
-
},
|
|
1754
|
-
get: function(
|
|
1762
|
+
}, li = {
|
|
1763
|
+
get: function(n, {
|
|
1755
1764
|
params: e,
|
|
1756
|
-
headers: t =
|
|
1757
|
-
noScope:
|
|
1765
|
+
headers: t = ve,
|
|
1766
|
+
noScope: s,
|
|
1758
1767
|
noAuth: r,
|
|
1759
1768
|
onUploadProgress: i
|
|
1760
1769
|
} = {}) {
|
|
1761
|
-
return re("get",
|
|
1770
|
+
return re("get", n, {
|
|
1762
1771
|
params: e,
|
|
1763
1772
|
headers: t,
|
|
1764
|
-
noScope:
|
|
1773
|
+
noScope: s,
|
|
1765
1774
|
noAuth: r,
|
|
1766
1775
|
onUploadProgress: i
|
|
1767
1776
|
});
|
|
1768
1777
|
},
|
|
1769
|
-
put: function(
|
|
1778
|
+
put: function(n, {
|
|
1770
1779
|
data: e,
|
|
1771
1780
|
params: t,
|
|
1772
|
-
headers:
|
|
1781
|
+
headers: s = it,
|
|
1773
1782
|
noScope: r,
|
|
1774
1783
|
noAuth: i,
|
|
1775
1784
|
onUploadProgress: o
|
|
1776
1785
|
} = {}) {
|
|
1777
|
-
return re("put",
|
|
1786
|
+
return re("put", n, {
|
|
1778
1787
|
data: e,
|
|
1779
1788
|
params: t,
|
|
1780
|
-
headers:
|
|
1789
|
+
headers: s,
|
|
1781
1790
|
noScope: r,
|
|
1782
1791
|
noAuth: i,
|
|
1783
1792
|
onUploadProgress: o
|
|
1784
1793
|
});
|
|
1785
1794
|
},
|
|
1786
|
-
post: function(
|
|
1795
|
+
post: function(n, {
|
|
1787
1796
|
data: e,
|
|
1788
1797
|
params: t,
|
|
1789
|
-
headers:
|
|
1798
|
+
headers: s = it,
|
|
1790
1799
|
noScope: r,
|
|
1791
1800
|
noAuth: i,
|
|
1792
1801
|
onUploadProgress: o
|
|
1793
1802
|
} = {}) {
|
|
1794
|
-
return re("post",
|
|
1803
|
+
return re("post", n, {
|
|
1795
1804
|
data: e,
|
|
1796
1805
|
params: t,
|
|
1797
|
-
headers:
|
|
1806
|
+
headers: s,
|
|
1798
1807
|
noScope: r,
|
|
1799
1808
|
noAuth: i,
|
|
1800
1809
|
onUploadProgress: o
|
|
1801
1810
|
});
|
|
1802
1811
|
},
|
|
1803
|
-
delete: function(
|
|
1812
|
+
delete: function(n, {
|
|
1804
1813
|
params: e,
|
|
1805
|
-
headers: t =
|
|
1806
|
-
noScope:
|
|
1814
|
+
headers: t = ve,
|
|
1815
|
+
noScope: s,
|
|
1807
1816
|
noAuth: r,
|
|
1808
1817
|
onUploadProgress: i
|
|
1809
1818
|
} = {}) {
|
|
1810
|
-
return re("delete",
|
|
1819
|
+
return re("delete", n, {
|
|
1811
1820
|
params: e,
|
|
1812
1821
|
headers: t,
|
|
1813
|
-
noScope:
|
|
1822
|
+
noScope: s,
|
|
1814
1823
|
noAuth: r,
|
|
1815
1824
|
onUploadProgress: i
|
|
1816
1825
|
});
|
|
1817
1826
|
}
|
|
1818
1827
|
};
|
|
1819
|
-
let
|
|
1820
|
-
emit(
|
|
1821
|
-
for (let t = this.events[
|
|
1822
|
-
t[
|
|
1828
|
+
let ye = () => ({
|
|
1829
|
+
emit(n, ...e) {
|
|
1830
|
+
for (let t = this.events[n] || [], s = 0, r = t.length; s < r; s++)
|
|
1831
|
+
t[s](...e);
|
|
1823
1832
|
},
|
|
1824
1833
|
events: {},
|
|
1825
|
-
on(
|
|
1834
|
+
on(n, e) {
|
|
1826
1835
|
var t;
|
|
1827
|
-
return ((t = this.events)[
|
|
1828
|
-
var
|
|
1829
|
-
this.events[
|
|
1836
|
+
return ((t = this.events)[n] || (t[n] = [])).push(e), () => {
|
|
1837
|
+
var s;
|
|
1838
|
+
this.events[n] = (s = this.events[n]) == null ? void 0 : s.filter((r) => e !== r);
|
|
1830
1839
|
};
|
|
1831
1840
|
}
|
|
1832
1841
|
});
|
|
@@ -1835,33 +1844,33 @@ class ne extends Error {
|
|
|
1835
1844
|
e instanceof Error ? (super(e.message), this.cause = e) : super(e), this.reason = t, this.name = "ReasonError";
|
|
1836
1845
|
}
|
|
1837
1846
|
}
|
|
1838
|
-
class
|
|
1847
|
+
class qe extends ne {
|
|
1839
1848
|
constructor(e) {
|
|
1840
1849
|
super("Rejected", e), this.name = "SubscriptionRejectedError";
|
|
1841
1850
|
}
|
|
1842
1851
|
}
|
|
1843
|
-
class
|
|
1852
|
+
class ks extends ne {
|
|
1844
1853
|
constructor(e) {
|
|
1845
1854
|
super(e || "Timed out to receive subscription ack"), this.name = "SubscriptionTimeoutError";
|
|
1846
1855
|
}
|
|
1847
1856
|
}
|
|
1848
|
-
class
|
|
1857
|
+
class j extends ne {
|
|
1849
1858
|
constructor(e, t) {
|
|
1850
1859
|
t ? super(e, t) : super("Disconnected", e), this.name = "DisconnectedError";
|
|
1851
1860
|
}
|
|
1852
1861
|
}
|
|
1853
|
-
class
|
|
1862
|
+
class Ns extends j {
|
|
1854
1863
|
constructor(e) {
|
|
1855
1864
|
super(e, "stale_connection"), this.name = "StaleConnectionError";
|
|
1856
1865
|
}
|
|
1857
1866
|
}
|
|
1858
|
-
function
|
|
1859
|
-
return
|
|
1860
|
-
let
|
|
1861
|
-
return `${JSON.stringify(t)}:${
|
|
1867
|
+
function qt(n) {
|
|
1868
|
+
return n ? `{${Object.keys(n).sort().filter((t) => n[t] !== void 0).map((t) => {
|
|
1869
|
+
let s = JSON.stringify(n[t]);
|
|
1870
|
+
return `${JSON.stringify(t)}:${s}`;
|
|
1862
1871
|
}).join(",")}}` : "";
|
|
1863
1872
|
}
|
|
1864
|
-
class
|
|
1873
|
+
class Ps {
|
|
1865
1874
|
constructor(e) {
|
|
1866
1875
|
this.channel = e, this.listeners = [];
|
|
1867
1876
|
}
|
|
@@ -1906,18 +1915,18 @@ class Ts {
|
|
|
1906
1915
|
}
|
|
1907
1916
|
}
|
|
1908
1917
|
stateFromInfo(e) {
|
|
1909
|
-
return e.records.reduce((t, { id:
|
|
1918
|
+
return e.records.reduce((t, { id: s, info: r }) => (t[s] = r, t), {});
|
|
1910
1919
|
}
|
|
1911
1920
|
}
|
|
1912
1921
|
const B = Symbol("state");
|
|
1913
|
-
class
|
|
1922
|
+
class Bt {
|
|
1914
1923
|
// Unique channel identifier
|
|
1915
1924
|
// static identifier = ''
|
|
1916
1925
|
constructor(e = {}) {
|
|
1917
|
-
this.emitter =
|
|
1926
|
+
this.emitter = ye(), this.params = Object.freeze(e), this.presence = new Ps(this), this.initialConnect = !0, this[B] = "idle";
|
|
1918
1927
|
}
|
|
1919
1928
|
get identifier() {
|
|
1920
|
-
return this._identifier ? this._identifier : (this._identifier =
|
|
1929
|
+
return this._identifier ? this._identifier : (this._identifier = qt({
|
|
1921
1930
|
channel: this.channelId,
|
|
1922
1931
|
...this.params
|
|
1923
1932
|
}), this._identifier);
|
|
@@ -1972,8 +1981,8 @@ class Dt {
|
|
|
1972
1981
|
try {
|
|
1973
1982
|
await this.perform("$whisper", e);
|
|
1974
1983
|
} catch (t) {
|
|
1975
|
-
let
|
|
1976
|
-
|
|
1984
|
+
let s = this.receiver ? this.receiver.logger : null;
|
|
1985
|
+
s && s.warn("whisper failed: ", t);
|
|
1977
1986
|
}
|
|
1978
1987
|
}
|
|
1979
1988
|
receive(e, t) {
|
|
@@ -1983,10 +1992,10 @@ class Dt {
|
|
|
1983
1992
|
return this.emitter.on(e, t);
|
|
1984
1993
|
}
|
|
1985
1994
|
once(e, t) {
|
|
1986
|
-
let
|
|
1987
|
-
|
|
1995
|
+
let s = this.emitter.on(e, (...r) => {
|
|
1996
|
+
s(), t(...r);
|
|
1988
1997
|
});
|
|
1989
|
-
return
|
|
1998
|
+
return s;
|
|
1990
1999
|
}
|
|
1991
2000
|
emit(e, ...t) {
|
|
1992
2001
|
return this.emitter.emit(e, ...t);
|
|
@@ -1999,14 +2008,14 @@ class Dt {
|
|
|
1999
2008
|
// It ignores disconnect events.
|
|
2000
2009
|
pendingSubscribe() {
|
|
2001
2010
|
return this._pendingSubscribe ? this._pendingSubscribe : (this._pendingSubscribe = new Promise((e, t) => {
|
|
2002
|
-
let
|
|
2003
|
-
|
|
2011
|
+
let s = [() => delete this._pendingSubscribe];
|
|
2012
|
+
s.push(
|
|
2004
2013
|
this.on("connect", () => {
|
|
2005
|
-
|
|
2014
|
+
s.forEach((r) => r()), e();
|
|
2006
2015
|
})
|
|
2007
|
-
),
|
|
2016
|
+
), s.push(
|
|
2008
2017
|
this.on("close", (r) => {
|
|
2009
|
-
|
|
2018
|
+
s.forEach((i) => i()), t(
|
|
2010
2019
|
r || new ne(
|
|
2011
2020
|
"Channel was disconnected before subscribing",
|
|
2012
2021
|
"canceled"
|
|
@@ -2017,7 +2026,7 @@ class Dt {
|
|
|
2017
2026
|
}), this._pendingSubscribe);
|
|
2018
2027
|
}
|
|
2019
2028
|
}
|
|
2020
|
-
class
|
|
2029
|
+
class Is {
|
|
2021
2030
|
constructor(e) {
|
|
2022
2031
|
this.id = e, this.intent = "unsubscribed", this.state = "idle", this.channels = [], this.disposed = !1, this._pendings = [];
|
|
2023
2032
|
}
|
|
@@ -2029,7 +2038,7 @@ class ks {
|
|
|
2029
2038
|
t > -1 && this.channels.splice(t, 1);
|
|
2030
2039
|
}
|
|
2031
2040
|
notify(e, ...t) {
|
|
2032
|
-
this.state = e === "restored" ? "connected" : e, t.length === 1 ? this.channels.forEach((
|
|
2041
|
+
this.state = e === "restored" ? "connected" : e, t.length === 1 ? this.channels.forEach((s) => s[e](t[0])) : this.channels.forEach((s) => s[e]());
|
|
2033
2042
|
}
|
|
2034
2043
|
pending(e) {
|
|
2035
2044
|
this._checkIntent(e);
|
|
@@ -2077,7 +2086,7 @@ class ks {
|
|
|
2077
2086
|
return !t || t.acquired || t.intent !== e ? !1 : (this._pendings.pop(), t.canceled = !0, !0);
|
|
2078
2087
|
}
|
|
2079
2088
|
}
|
|
2080
|
-
class
|
|
2089
|
+
class vs {
|
|
2081
2090
|
constructor() {
|
|
2082
2091
|
this.queue = [];
|
|
2083
2092
|
}
|
|
@@ -2089,9 +2098,9 @@ class Ns {
|
|
|
2089
2098
|
), this.queue.length > 1 && await this.queue[this.queue.length - 2]);
|
|
2090
2099
|
}
|
|
2091
2100
|
}
|
|
2092
|
-
class
|
|
2101
|
+
class Ls {
|
|
2093
2102
|
constructor(e) {
|
|
2094
|
-
e.concurrentSubscribes === !1 && (this.glv = new
|
|
2103
|
+
e.concurrentSubscribes === !1 && (this.glv = new vs()), this._subscriptions = {}, this._localToRemote = {};
|
|
2095
2104
|
}
|
|
2096
2105
|
all() {
|
|
2097
2106
|
return Object.values(this._subscriptions);
|
|
@@ -2099,22 +2108,22 @@ class Ps {
|
|
|
2099
2108
|
get(e) {
|
|
2100
2109
|
return this._subscriptions[e];
|
|
2101
2110
|
}
|
|
2102
|
-
create(e, { subscribe: t, unsubscribe:
|
|
2103
|
-
let r = this._subscriptions[e] = new
|
|
2104
|
-
return r.remoteId = this._localToRemote[e], r.subscriber = t, r.unsubscriber =
|
|
2111
|
+
create(e, { subscribe: t, unsubscribe: s }) {
|
|
2112
|
+
let r = this._subscriptions[e] = new Is(e);
|
|
2113
|
+
return r.remoteId = this._localToRemote[e], r.subscriber = t, r.unsubscriber = s, r.gvl = this.glv, r;
|
|
2105
2114
|
}
|
|
2106
2115
|
remove(e) {
|
|
2107
2116
|
delete this._subscriptions[e], delete this._localToRemote[e];
|
|
2108
2117
|
}
|
|
2109
2118
|
storeRemoteId(e, t) {
|
|
2110
2119
|
this._localToRemote[e] = t;
|
|
2111
|
-
let
|
|
2112
|
-
|
|
2120
|
+
let s = this.get(e);
|
|
2121
|
+
s && (s.remoteId = t);
|
|
2113
2122
|
}
|
|
2114
2123
|
}
|
|
2115
|
-
class
|
|
2124
|
+
class js {
|
|
2116
2125
|
constructor(e = {}) {
|
|
2117
|
-
this.subscriptions = new
|
|
2126
|
+
this.subscriptions = new Ls(e), this._pendingMessages = [], this._remoteToLocal = {};
|
|
2118
2127
|
}
|
|
2119
2128
|
subscribe(e, t) {
|
|
2120
2129
|
this._remoteToLocal[t] = e, this.subscriptions.storeRemoteId(e, t), this.flush(t);
|
|
@@ -2122,26 +2131,26 @@ class Is {
|
|
|
2122
2131
|
unsubscribe(e) {
|
|
2123
2132
|
let t = this.subscriptions.get(e);
|
|
2124
2133
|
if (!t) return;
|
|
2125
|
-
let
|
|
2126
|
-
|
|
2134
|
+
let s = t.remoteId;
|
|
2135
|
+
s && delete this._remoteToLocal[s], this.subscriptions.remove(e);
|
|
2127
2136
|
}
|
|
2128
|
-
transmit(e, t,
|
|
2137
|
+
transmit(e, t, s) {
|
|
2129
2138
|
let r = this._remoteToLocal[e];
|
|
2130
2139
|
if (!r) {
|
|
2131
|
-
this._pendingMessages.push([e, t,
|
|
2140
|
+
this._pendingMessages.push([e, t, s]);
|
|
2132
2141
|
return;
|
|
2133
2142
|
}
|
|
2134
2143
|
let i = this.subscriptions.get(r);
|
|
2135
2144
|
i && i.channels.forEach((o) => {
|
|
2136
|
-
o.receive(t,
|
|
2145
|
+
o.receive(t, s);
|
|
2137
2146
|
});
|
|
2138
2147
|
}
|
|
2139
|
-
notify(e, t,
|
|
2148
|
+
notify(e, t, s) {
|
|
2140
2149
|
let r = this._remoteToLocal[e];
|
|
2141
2150
|
if (!r)
|
|
2142
2151
|
return;
|
|
2143
2152
|
let i = this.subscriptions.get(r);
|
|
2144
|
-
i && i.channels.forEach((o) => o.emit(t,
|
|
2153
|
+
i && i.channels.forEach((o) => o.emit(t, s));
|
|
2145
2154
|
}
|
|
2146
2155
|
close() {
|
|
2147
2156
|
this._pendingMessages.length = 0;
|
|
@@ -2154,23 +2163,23 @@ class Is {
|
|
|
2154
2163
|
}
|
|
2155
2164
|
flush(e) {
|
|
2156
2165
|
let t = [];
|
|
2157
|
-
for (let
|
|
2158
|
-
|
|
2166
|
+
for (let s of this._pendingMessages)
|
|
2167
|
+
s[0] === e ? this.transmit(s[0], s[1], s[2]) : t.push(s);
|
|
2159
2168
|
this._pendingMessages = t;
|
|
2160
2169
|
}
|
|
2161
2170
|
}
|
|
2162
|
-
const
|
|
2171
|
+
const ot = {
|
|
2163
2172
|
debug: 0,
|
|
2164
2173
|
info: 1,
|
|
2165
2174
|
warn: 2,
|
|
2166
2175
|
error: 3
|
|
2167
2176
|
};
|
|
2168
|
-
class
|
|
2177
|
+
class Mt {
|
|
2169
2178
|
constructor(e) {
|
|
2170
2179
|
this.level = e || "warn";
|
|
2171
2180
|
}
|
|
2172
|
-
log(e, t,
|
|
2173
|
-
|
|
2181
|
+
log(e, t, s) {
|
|
2182
|
+
ot[e] < ot[this.level] || this.writeLogEntry(e, t, s);
|
|
2174
2183
|
}
|
|
2175
2184
|
writeLogEntry() {
|
|
2176
2185
|
throw Error("Not implemented");
|
|
@@ -2188,11 +2197,11 @@ class qt {
|
|
|
2188
2197
|
this.log("error", e, t);
|
|
2189
2198
|
}
|
|
2190
2199
|
}
|
|
2191
|
-
class se extends
|
|
2200
|
+
class se extends Mt {
|
|
2192
2201
|
writeLogEntry() {
|
|
2193
2202
|
}
|
|
2194
2203
|
}
|
|
2195
|
-
class
|
|
2204
|
+
class $s {
|
|
2196
2205
|
encode(e) {
|
|
2197
2206
|
return JSON.stringify(e);
|
|
2198
2207
|
}
|
|
@@ -2203,8 +2212,8 @@ class Ls {
|
|
|
2203
2212
|
}
|
|
2204
2213
|
}
|
|
2205
2214
|
}
|
|
2206
|
-
let
|
|
2207
|
-
class
|
|
2215
|
+
let Fs = 0;
|
|
2216
|
+
class Ht {
|
|
2208
2217
|
constructor(e = {}) {
|
|
2209
2218
|
let { logger: t } = e;
|
|
2210
2219
|
this.logger = t || new se(), this.pendingSubscriptions = {}, this.pendingUnsubscriptions = {}, this.subscribeCooldownInterval = e.subscribeCooldownInterval || 250, this.subscribeRetryInterval = e.subscribeRetryInterval || 5e3;
|
|
@@ -2213,9 +2222,9 @@ class Bt {
|
|
|
2213
2222
|
this.cable = e;
|
|
2214
2223
|
}
|
|
2215
2224
|
subscribe(e, t) {
|
|
2216
|
-
let
|
|
2217
|
-
t && Object.assign(
|
|
2218
|
-
let r =
|
|
2225
|
+
let s = { channel: e };
|
|
2226
|
+
t && Object.assign(s, t);
|
|
2227
|
+
let r = qt(s);
|
|
2219
2228
|
if (this.pendingUnsubscriptions[r]) {
|
|
2220
2229
|
let o = this.subscribeCooldownInterval * 1.5;
|
|
2221
2230
|
return this.logger.debug(
|
|
@@ -2231,7 +2240,7 @@ class Bt {
|
|
|
2231
2240
|
return this.logger.warn("subscription is already pending, skipping", r), Promise.reject(Error("Already subscribing"));
|
|
2232
2241
|
let i = this.subscribeRetryInterval;
|
|
2233
2242
|
return new Promise((o, c) => {
|
|
2234
|
-
let h = ++
|
|
2243
|
+
let h = ++Fs;
|
|
2235
2244
|
this.pendingSubscriptions[r] = {
|
|
2236
2245
|
resolve: o,
|
|
2237
2246
|
reject: c,
|
|
@@ -2245,24 +2254,24 @@ class Bt {
|
|
|
2245
2254
|
identifier: e
|
|
2246
2255
|
};
|
|
2247
2256
|
}
|
|
2248
|
-
maybeRetrySubscribe(e, t,
|
|
2257
|
+
maybeRetrySubscribe(e, t, s) {
|
|
2249
2258
|
setTimeout(() => {
|
|
2250
2259
|
let r = this.pendingSubscriptions[t];
|
|
2251
2260
|
r && r.id === e && (this.logger.warn(
|
|
2252
|
-
`no subscription ack received in ${
|
|
2261
|
+
`no subscription ack received in ${s}ms, retrying subscribe`,
|
|
2253
2262
|
t
|
|
2254
|
-
), this.cable.send(this.buildSubscribeRequest(t)), this.maybeExpireSubscribe(e, t,
|
|
2255
|
-
},
|
|
2263
|
+
), this.cable.send(this.buildSubscribeRequest(t)), this.maybeExpireSubscribe(e, t, s));
|
|
2264
|
+
}, s);
|
|
2256
2265
|
}
|
|
2257
|
-
maybeExpireSubscribe(e, t,
|
|
2266
|
+
maybeExpireSubscribe(e, t, s) {
|
|
2258
2267
|
setTimeout(() => {
|
|
2259
2268
|
let r = this.pendingSubscriptions[t];
|
|
2260
2269
|
r && r.id === e && (delete this.pendingSubscriptions[t], r.reject(
|
|
2261
|
-
new
|
|
2262
|
-
`Haven't received subscription ack in ${
|
|
2270
|
+
new ks(
|
|
2271
|
+
`Haven't received subscription ack in ${s * 2}ms for ${t}`
|
|
2263
2272
|
)
|
|
2264
2273
|
));
|
|
2265
|
-
},
|
|
2274
|
+
}, s);
|
|
2266
2275
|
}
|
|
2267
2276
|
unsubscribe(e) {
|
|
2268
2277
|
return this.cable.send({
|
|
@@ -2272,11 +2281,11 @@ class Bt {
|
|
|
2272
2281
|
delete this.pendingUnsubscriptions[e];
|
|
2273
2282
|
}, this.subscribeCooldownInterval), Promise.resolve();
|
|
2274
2283
|
}
|
|
2275
|
-
perform(e, t,
|
|
2276
|
-
return t === "$whisper" ? this.whisper(e,
|
|
2284
|
+
perform(e, t, s) {
|
|
2285
|
+
return t === "$whisper" ? this.whisper(e, s) : (s || (s = {}), s.action = t, this.cable.send({
|
|
2277
2286
|
command: "message",
|
|
2278
2287
|
identifier: e,
|
|
2279
|
-
data: JSON.stringify(
|
|
2288
|
+
data: JSON.stringify(s)
|
|
2280
2289
|
}), Promise.resolve());
|
|
2281
2290
|
}
|
|
2282
2291
|
whisper(e, t) {
|
|
@@ -2291,7 +2300,7 @@ class Bt {
|
|
|
2291
2300
|
this.logger.error("unsupported message format", { message: e });
|
|
2292
2301
|
return;
|
|
2293
2302
|
}
|
|
2294
|
-
let { type: t, identifier:
|
|
2303
|
+
let { type: t, identifier: s, message: r, reason: i, reconnect: o } = e;
|
|
2295
2304
|
if (t === "ping")
|
|
2296
2305
|
return this.cable.keepalive(e.message);
|
|
2297
2306
|
if (this.cable.keepalive(), t === "welcome") {
|
|
@@ -2299,27 +2308,27 @@ class Bt {
|
|
|
2299
2308
|
return c && this.cable.setSessionId(c), this.cable.connected();
|
|
2300
2309
|
}
|
|
2301
2310
|
if (t === "disconnect") {
|
|
2302
|
-
let c = new
|
|
2311
|
+
let c = new j(i);
|
|
2303
2312
|
this.reset(c), o === !1 ? this.cable.closed(c) : this.cable.disconnected(c);
|
|
2304
2313
|
return;
|
|
2305
2314
|
}
|
|
2306
2315
|
if (t === "confirm_subscription") {
|
|
2307
|
-
let c = this.pendingSubscriptions[
|
|
2316
|
+
let c = this.pendingSubscriptions[s];
|
|
2308
2317
|
if (!c) {
|
|
2309
2318
|
this.logger.error("subscription not found, unsubscribing", {
|
|
2310
2319
|
type: t,
|
|
2311
|
-
identifier:
|
|
2312
|
-
}), this.unsubscribe(
|
|
2320
|
+
identifier: s
|
|
2321
|
+
}), this.unsubscribe(s);
|
|
2313
2322
|
return;
|
|
2314
2323
|
}
|
|
2315
|
-
return delete this.pendingSubscriptions[
|
|
2324
|
+
return delete this.pendingSubscriptions[s], c.resolve(s);
|
|
2316
2325
|
}
|
|
2317
2326
|
if (t === "reject_subscription") {
|
|
2318
|
-
let c = this.pendingSubscriptions[
|
|
2319
|
-
return c ? (delete this.pendingSubscriptions[
|
|
2327
|
+
let c = this.pendingSubscriptions[s];
|
|
2328
|
+
return c ? (delete this.pendingSubscriptions[s], c.reject(new qe())) : this.logger.error("subscription not found", { type: t, identifier: s });
|
|
2320
2329
|
}
|
|
2321
2330
|
if (r)
|
|
2322
|
-
return { identifier:
|
|
2331
|
+
return { identifier: s, message: r };
|
|
2323
2332
|
this.logger.warn(`unknown message type: ${t}`, { message: e });
|
|
2324
2333
|
}
|
|
2325
2334
|
reset(e) {
|
|
@@ -2331,10 +2340,10 @@ class Bt {
|
|
|
2331
2340
|
return !1;
|
|
2332
2341
|
}
|
|
2333
2342
|
}
|
|
2334
|
-
const
|
|
2335
|
-
class
|
|
2343
|
+
const ct = () => Date.now() / 1e3 | 0;
|
|
2344
|
+
class Us extends Ht {
|
|
2336
2345
|
constructor(e = {}) {
|
|
2337
|
-
super(e), this.streamsPositions = {}, this.subscriptionStreams = {}, this.pendingHistory = {}, this.pendingPresence = {}, this.presenceInfo = {}, this.restoreSince = e.historyTimestamp, this.restoreSince === void 0 && (this.restoreSince =
|
|
2346
|
+
super(e), this.streamsPositions = {}, this.subscriptionStreams = {}, this.pendingHistory = {}, this.pendingPresence = {}, this.presenceInfo = {}, this.restoreSince = e.historyTimestamp, this.disableSessionRecovery = e.disableSessionRecovery, this.restoreSince === void 0 && (this.restoreSince = ct()), this.sessionId = void 0, this.sendPongs = e.pongs;
|
|
2338
2347
|
}
|
|
2339
2348
|
reset(e) {
|
|
2340
2349
|
for (let t in this.pendingPresence)
|
|
@@ -2346,23 +2355,25 @@ class $s extends Bt {
|
|
|
2346
2355
|
this.logger.error("unsupported message format", { message: e });
|
|
2347
2356
|
return;
|
|
2348
2357
|
}
|
|
2349
|
-
let { type: t, identifier:
|
|
2350
|
-
if (t === "disconnect"
|
|
2358
|
+
let { type: t, identifier: s, message: r } = e;
|
|
2359
|
+
if (t === "disconnect")
|
|
2360
|
+
return delete this.sessionId, this.cable.setSessionId(""), super.receive(e);
|
|
2361
|
+
if (t === "reject_subscription")
|
|
2351
2362
|
return super.receive(e);
|
|
2352
2363
|
if (t === "confirm_subscription")
|
|
2353
|
-
return this.subscriptionStreams[
|
|
2364
|
+
return this.subscriptionStreams[s] || (this.subscriptionStreams[s] = /* @__PURE__ */ new Set()), super.receive(e);
|
|
2354
2365
|
if (t === "ping")
|
|
2355
|
-
return this.restoreSince && (this.restoreSince =
|
|
2366
|
+
return this.restoreSince && (this.restoreSince = ct()), this.sendPongs && this.sendPong(), this.cable.keepalive(e.message);
|
|
2356
2367
|
if (this.cable.keepalive(), t === "confirm_history") {
|
|
2357
|
-
this.logger.debug("history result received", e), this.cable.notify("history_received",
|
|
2368
|
+
this.logger.debug("history result received", e), this.cable.notify("history_received", s);
|
|
2358
2369
|
return;
|
|
2359
2370
|
}
|
|
2360
2371
|
if (t === "reject_history") {
|
|
2361
|
-
this.logger.warn("failed to retrieve history", e), this.cable.notify("history_not_found",
|
|
2372
|
+
this.logger.warn("failed to retrieve history", e), this.cable.notify("history_not_found", s);
|
|
2362
2373
|
return;
|
|
2363
2374
|
}
|
|
2364
2375
|
if (t === "welcome") {
|
|
2365
|
-
if (this.sessionId = e.sid, this.sessionId && this.cable.setSessionId(this.sessionId), e.restored) {
|
|
2376
|
+
if (this.disableSessionRecovery || (this.sessionId = e.sid, this.sessionId && this.cable.setSessionId(this.sessionId)), e.restored) {
|
|
2366
2377
|
let i = e.restored_ids || Object.keys(this.subscriptionStreams);
|
|
2367
2378
|
for (let o of i)
|
|
2368
2379
|
this.cable.send({
|
|
@@ -2381,46 +2392,46 @@ class $s extends Bt {
|
|
|
2381
2392
|
if (t === "presence") {
|
|
2382
2393
|
let i = r.type;
|
|
2383
2394
|
if (i === "info") {
|
|
2384
|
-
let o = this.pendingPresence[
|
|
2385
|
-
o && (delete this.pendingPresence[
|
|
2395
|
+
let o = this.pendingPresence[s];
|
|
2396
|
+
o && (delete this.pendingPresence[s], o.resolve(r));
|
|
2386
2397
|
} else if (i === "error") {
|
|
2387
|
-
let o = this.pendingPresence[
|
|
2388
|
-
o && (delete this.pendingPresence[
|
|
2398
|
+
let o = this.pendingPresence[s];
|
|
2399
|
+
o && (delete this.pendingPresence[s], o.reject(new Error("failed to retrieve presence")));
|
|
2389
2400
|
}
|
|
2390
2401
|
return {
|
|
2391
2402
|
type: t,
|
|
2392
|
-
identifier:
|
|
2403
|
+
identifier: s,
|
|
2393
2404
|
message: r
|
|
2394
2405
|
};
|
|
2395
2406
|
}
|
|
2396
2407
|
if (r) {
|
|
2397
2408
|
let i = this.trackStreamPosition(
|
|
2398
|
-
|
|
2409
|
+
s,
|
|
2399
2410
|
e.stream_id,
|
|
2400
2411
|
e.epoch,
|
|
2401
2412
|
e.offset
|
|
2402
2413
|
);
|
|
2403
|
-
return { identifier:
|
|
2414
|
+
return { identifier: s, message: r, meta: i };
|
|
2404
2415
|
}
|
|
2405
2416
|
this.logger.warn(`unknown message type: ${t}`, { message: e });
|
|
2406
2417
|
}
|
|
2407
|
-
perform(e, t,
|
|
2418
|
+
perform(e, t, s) {
|
|
2408
2419
|
switch (t) {
|
|
2409
2420
|
case "$presence:join":
|
|
2410
|
-
return this.join(e,
|
|
2421
|
+
return this.join(e, s);
|
|
2411
2422
|
case "$presence:leave":
|
|
2412
|
-
return this.leave(e,
|
|
2423
|
+
return this.leave(e, s);
|
|
2413
2424
|
case "$presence:info":
|
|
2414
|
-
return this.presence(e,
|
|
2425
|
+
return this.presence(e, s);
|
|
2415
2426
|
}
|
|
2416
|
-
return super.perform(e, t,
|
|
2427
|
+
return super.perform(e, t, s);
|
|
2417
2428
|
}
|
|
2418
2429
|
unsubscribe(e) {
|
|
2419
2430
|
return delete this.presenceInfo[e], super.unsubscribe(e);
|
|
2420
2431
|
}
|
|
2421
2432
|
buildSubscribeRequest(e) {
|
|
2422
|
-
let t = super.buildSubscribeRequest(e),
|
|
2423
|
-
|
|
2433
|
+
let t = super.buildSubscribeRequest(e), s = this.historyRequestFor(e);
|
|
2434
|
+
s && (t.history = s, this.pendingHistory[e] = !0);
|
|
2424
2435
|
let r = this.presenceInfo[e];
|
|
2425
2436
|
return r && (t.presence = r), t;
|
|
2426
2437
|
}
|
|
@@ -2429,18 +2440,18 @@ class $s extends Bt {
|
|
|
2429
2440
|
return !!this.sessionId;
|
|
2430
2441
|
}
|
|
2431
2442
|
historyRequestFor(e) {
|
|
2432
|
-
let t = {},
|
|
2443
|
+
let t = {}, s = !1;
|
|
2433
2444
|
if (this.subscriptionStreams[e])
|
|
2434
2445
|
for (let r of this.subscriptionStreams[e]) {
|
|
2435
2446
|
let i = this.streamsPositions[r];
|
|
2436
|
-
i && (
|
|
2447
|
+
i && (s = !0, t[r] = i);
|
|
2437
2448
|
}
|
|
2438
|
-
if (!(!
|
|
2449
|
+
if (!(!s && !this.restoreSince))
|
|
2439
2450
|
return { since: this.restoreSince, streams: t };
|
|
2440
2451
|
}
|
|
2441
|
-
trackStreamPosition(e, t,
|
|
2442
|
-
if (!(!t || !
|
|
2443
|
-
return this.subscriptionStreams[e] || (this.subscriptionStreams[e] = /* @__PURE__ */ new Set()), this.subscriptionStreams[e].add(t), this.streamsPositions[t] = { epoch:
|
|
2452
|
+
trackStreamPosition(e, t, s, r) {
|
|
2453
|
+
if (!(!t || !s))
|
|
2454
|
+
return this.subscriptionStreams[e] || (this.subscriptionStreams[e] = /* @__PURE__ */ new Set()), this.subscriptionStreams[e].add(t), this.streamsPositions[t] = { epoch: s, offset: r }, { stream: t, epoch: s, offset: r };
|
|
2444
2455
|
}
|
|
2445
2456
|
// Send pongs asynchrounously—no need to block the main thread
|
|
2446
2457
|
async sendPong() {
|
|
@@ -2461,9 +2472,9 @@ class $s extends Bt {
|
|
|
2461
2472
|
}), Promise.resolve();
|
|
2462
2473
|
}
|
|
2463
2474
|
presence(e, t) {
|
|
2464
|
-
return this.pendingPresence[e] ? (this.logger.warn("presence is already pending, skipping", e), Promise.reject(Error("presence request is already pending"))) : new Promise((
|
|
2475
|
+
return this.pendingPresence[e] ? (this.logger.warn("presence is already pending, skipping", e), Promise.reject(Error("presence request is already pending"))) : new Promise((s, r) => {
|
|
2465
2476
|
this.pendingPresence[e] = {
|
|
2466
|
-
resolve:
|
|
2477
|
+
resolve: s,
|
|
2467
2478
|
reject: r
|
|
2468
2479
|
}, this.cable.send({
|
|
2469
2480
|
command: "presence",
|
|
@@ -2473,12 +2484,12 @@ class $s extends Bt {
|
|
|
2473
2484
|
});
|
|
2474
2485
|
}
|
|
2475
2486
|
}
|
|
2476
|
-
class
|
|
2487
|
+
class Ds extends ne {
|
|
2477
2488
|
constructor() {
|
|
2478
2489
|
super("No connection", "closed"), this.name = "NoConnectionError";
|
|
2479
2490
|
}
|
|
2480
2491
|
}
|
|
2481
|
-
class
|
|
2492
|
+
class Be extends Bt {
|
|
2482
2493
|
constructor(e, t) {
|
|
2483
2494
|
super(t), this.channelId = e;
|
|
2484
2495
|
}
|
|
@@ -2489,29 +2500,29 @@ class qe extends Dt {
|
|
|
2489
2500
|
return this._channelId;
|
|
2490
2501
|
}
|
|
2491
2502
|
}
|
|
2492
|
-
|
|
2493
|
-
const
|
|
2494
|
-
class Le extends
|
|
2503
|
+
L(Be, "identifier", "__ghost__");
|
|
2504
|
+
const qs = "$pubsub";
|
|
2505
|
+
class Le extends Bt {
|
|
2495
2506
|
async perform(e, t) {
|
|
2496
2507
|
if (e.startsWith("$"))
|
|
2497
2508
|
return super.perform(e, t);
|
|
2498
2509
|
throw Error("not implemented");
|
|
2499
2510
|
}
|
|
2500
2511
|
}
|
|
2501
|
-
|
|
2512
|
+
L(Le, "identifier", qs);
|
|
2502
2513
|
const M = Symbol("state");
|
|
2503
|
-
let
|
|
2514
|
+
let Bs = class {
|
|
2504
2515
|
constructor({
|
|
2505
2516
|
transport: e,
|
|
2506
2517
|
protocol: t,
|
|
2507
|
-
encoder:
|
|
2518
|
+
encoder: s,
|
|
2508
2519
|
logger: r,
|
|
2509
2520
|
lazy: i,
|
|
2510
2521
|
hubOptions: o,
|
|
2511
2522
|
performFailures: c,
|
|
2512
2523
|
transportConfigurator: h
|
|
2513
2524
|
}) {
|
|
2514
|
-
this.emitter =
|
|
2525
|
+
this.emitter = ye(), this.transport = e, this.encoder = s, this.logger = r || new se(), this.protocol = t, this.performFailures = c || "throw", this.protocol.attached(this), this.hub = new js(o || {}), this[M] = "idle", this.handleClose = this.handleClose.bind(this), this.handleIncoming = this.handleIncoming.bind(this), this.transportConfigurator = h, this.transport.on("close", this.handleClose), this.transport.on("data", this.handleIncoming), this.initialConnect = !0, this.recovering = !1, i === !1 && this.connect().catch(() => {
|
|
2515
2526
|
});
|
|
2516
2527
|
}
|
|
2517
2528
|
get state() {
|
|
@@ -2529,8 +2540,8 @@ let Us = class {
|
|
|
2529
2540
|
this.transportConfigurator && await this.transportConfigurator(this.transport, {
|
|
2530
2541
|
initial: e
|
|
2531
2542
|
}), await this.transport.open();
|
|
2532
|
-
} catch (
|
|
2533
|
-
this.handleClose(
|
|
2543
|
+
} catch (s) {
|
|
2544
|
+
this.handleClose(s);
|
|
2534
2545
|
}
|
|
2535
2546
|
return t;
|
|
2536
2547
|
}
|
|
@@ -2542,7 +2553,7 @@ let Us = class {
|
|
|
2542
2553
|
this.logger.info("connected"), this[M] = "connected", this.recovering && this.hub.subscriptions.all().forEach(
|
|
2543
2554
|
(t) => t.notify(
|
|
2544
2555
|
"disconnected",
|
|
2545
|
-
new
|
|
2556
|
+
new j("recovery_failed")
|
|
2546
2557
|
)
|
|
2547
2558
|
), this.hub.subscriptions.all().forEach((t) => this._resubscribe(t));
|
|
2548
2559
|
let e = !1;
|
|
@@ -2552,17 +2563,17 @@ let Us = class {
|
|
|
2552
2563
|
this.logger.info("connection recovered", { remoteIds: e }), this[M] = "connected", this.hub.subscriptions.all().forEach((r) => {
|
|
2553
2564
|
e && r.remoteId && e.includes(r.remoteId) ? r.notify("restored") : (r.notify(
|
|
2554
2565
|
"disconnected",
|
|
2555
|
-
new
|
|
2566
|
+
new j("recovery_failed")
|
|
2556
2567
|
), this._resubscribe(r));
|
|
2557
2568
|
});
|
|
2558
|
-
let t = !this.initialConnect,
|
|
2559
|
-
this.recovering = !1, this.initialConnect = !1, this.emit("connect", { reconnect: t, restored:
|
|
2569
|
+
let t = !this.initialConnect, s = !0;
|
|
2570
|
+
this.recovering = !1, this.initialConnect = !1, this.emit("connect", { reconnect: t, restored: s });
|
|
2560
2571
|
}
|
|
2561
|
-
notify(e, t,
|
|
2562
|
-
t && typeof t != "string" && (
|
|
2572
|
+
notify(e, t, s) {
|
|
2573
|
+
t && typeof t != "string" && (s = t, t = void 0), t ? this.hub.notify(t, "info", { type: e, data: s }) : this.emit("info", { type: e, data: s });
|
|
2563
2574
|
}
|
|
2564
2575
|
handleClose(e) {
|
|
2565
|
-
this.logger.debug("transport closed", { error: e }), this.disconnected(new
|
|
2576
|
+
this.logger.debug("transport closed", { error: e }), this.disconnected(new j(e, "transport_closed"));
|
|
2566
2577
|
}
|
|
2567
2578
|
disconnected(e) {
|
|
2568
2579
|
(this.state === "connected" || this.state === "connecting") && (this.logger.info("disconnected", { reason: e }), this[M] = "disconnected", this.recovering = this.protocol.recoverableClosure(e), this.recovering ? this.hub.subscriptions.all().forEach((t) => t.notify("connecting")) : this.hub.subscriptions.all().forEach((t) => {
|
|
@@ -2572,9 +2583,9 @@ let Us = class {
|
|
|
2572
2583
|
closed(e) {
|
|
2573
2584
|
if (this.state === "closed" || this.state === "idle") return;
|
|
2574
2585
|
let t;
|
|
2575
|
-
e && (t = e instanceof
|
|
2576
|
-
let
|
|
2577
|
-
this.hub.subscriptions.all().forEach((r) => r.notify("disconnected",
|
|
2586
|
+
e && (t = e instanceof j ? e : new j(e, void 0)), this.logger.info("closed", { reason: e || "user" }), this[M] = "closed";
|
|
2587
|
+
let s = t || new j("cable_closed");
|
|
2588
|
+
this.hub.subscriptions.all().forEach((r) => r.notify("disconnected", s)), this.hub.close(), this.protocol.reset(), this.transport.close(), this.initialConnect = !0, this.emit("close", t);
|
|
2578
2589
|
}
|
|
2579
2590
|
disconnect() {
|
|
2580
2591
|
this.closed();
|
|
@@ -2588,10 +2599,10 @@ let Us = class {
|
|
|
2588
2599
|
return;
|
|
2589
2600
|
}
|
|
2590
2601
|
this.logger.debug("incoming data", t);
|
|
2591
|
-
let
|
|
2592
|
-
if (
|
|
2593
|
-
this.logger.debug("processed incoming message",
|
|
2594
|
-
let { type: r, identifier: i, message: o, meta: c } =
|
|
2602
|
+
let s = this.protocol.receive(t);
|
|
2603
|
+
if (s) {
|
|
2604
|
+
this.logger.debug("processed incoming message", s);
|
|
2605
|
+
let { type: r, identifier: i, message: o, meta: c } = s;
|
|
2595
2606
|
r ? this.hub.notify(i, r, o) : this.hub.transmit(i, o, c);
|
|
2596
2607
|
}
|
|
2597
2608
|
}
|
|
@@ -2617,23 +2628,23 @@ let Us = class {
|
|
|
2617
2628
|
return this.subscribe(t);
|
|
2618
2629
|
}
|
|
2619
2630
|
subscribeTo(e, t) {
|
|
2620
|
-
let
|
|
2621
|
-
return typeof e == "string" && (r = e, e =
|
|
2631
|
+
let s, r;
|
|
2632
|
+
return typeof e == "string" && (r = e, e = Be), s = r ? new e(r, t) : new e(t), this.subscribe(s);
|
|
2622
2633
|
}
|
|
2623
2634
|
subscribe(e) {
|
|
2624
2635
|
if (!e.attached(this)) return e;
|
|
2625
2636
|
let t = e.identifier;
|
|
2626
2637
|
e.connecting();
|
|
2627
|
-
let
|
|
2638
|
+
let s = this.hub.subscriptions.get(t) || this.hub.subscriptions.create(t, {
|
|
2628
2639
|
subscribe: (r) => this._subscribe(r, e.channelId, e.params),
|
|
2629
2640
|
unsubscribe: (r) => this._unsubscribe(r)
|
|
2630
2641
|
});
|
|
2631
|
-
return
|
|
2642
|
+
return s.add(e), s.intent === "subscribed" && s.state === "connected" && e.connected(), s.ensureSubscribed(), e;
|
|
2632
2643
|
}
|
|
2633
2644
|
async _resubscribe(e) {
|
|
2634
2645
|
e.intent !== "subscribed" || !e.channels[0] || (e.notify("connecting"), e.ensureResubscribed());
|
|
2635
2646
|
}
|
|
2636
|
-
async _subscribe(e, t,
|
|
2647
|
+
async _subscribe(e, t, s) {
|
|
2637
2648
|
let r = e.id;
|
|
2638
2649
|
if (this.state === "idle" && this.connect().catch(() => {
|
|
2639
2650
|
}), this.state !== "connected") {
|
|
@@ -2662,15 +2673,15 @@ let Us = class {
|
|
|
2662
2673
|
}
|
|
2663
2674
|
let o = {
|
|
2664
2675
|
identifier: t,
|
|
2665
|
-
params:
|
|
2676
|
+
params: s
|
|
2666
2677
|
};
|
|
2667
2678
|
this.logger.debug("subscribing", o);
|
|
2668
2679
|
try {
|
|
2669
|
-
let c = await this.protocol.subscribe(t,
|
|
2680
|
+
let c = await this.protocol.subscribe(t, s);
|
|
2670
2681
|
this.hub.subscribe(r, c), this.logger.debug("subscribed", { ...o, remoteId: c }), e.notify("connected");
|
|
2671
2682
|
} catch (c) {
|
|
2672
2683
|
if (c) {
|
|
2673
|
-
if (c instanceof
|
|
2684
|
+
if (c instanceof qe && this.logger.warn("rejected", o), c instanceof j) {
|
|
2674
2685
|
this.logger.debug(
|
|
2675
2686
|
"disconnected during subscription; will retry on connect",
|
|
2676
2687
|
o
|
|
@@ -2687,44 +2698,44 @@ let Us = class {
|
|
|
2687
2698
|
i.release();
|
|
2688
2699
|
}
|
|
2689
2700
|
unsubscribe(e) {
|
|
2690
|
-
let t = e.identifier,
|
|
2691
|
-
if (!
|
|
2701
|
+
let t = e.identifier, s = this.hub.subscriptions.get(t);
|
|
2702
|
+
if (!s)
|
|
2692
2703
|
throw Error(`Subscription not found: ${t}`);
|
|
2693
|
-
|
|
2704
|
+
s.remove(e), e.closed(), s.maybeUnsubscribe();
|
|
2694
2705
|
}
|
|
2695
2706
|
async _unsubscribe(e) {
|
|
2696
2707
|
let t = e.id;
|
|
2697
2708
|
this.logger.debug("acquiring unsubscribe lock", { identifier: t });
|
|
2698
|
-
let
|
|
2699
|
-
if (
|
|
2700
|
-
this.logger.debug("unsubscribe lock has been canceled", { identifier: t }),
|
|
2709
|
+
let s = await e.acquire("unsubscribed");
|
|
2710
|
+
if (s.canceled) {
|
|
2711
|
+
this.logger.debug("unsubscribe lock has been canceled", { identifier: t }), s.release();
|
|
2701
2712
|
return;
|
|
2702
2713
|
}
|
|
2703
2714
|
if (this.logger.debug("unsubscribe lock has been acquired", { identifier: t }), e.intent !== "unsubscribed") {
|
|
2704
2715
|
this.logger.debug("cancel unsubscribe, no longer needed", {
|
|
2705
2716
|
identifier: t,
|
|
2706
2717
|
intent: e.intent
|
|
2707
|
-
}),
|
|
2718
|
+
}), s.release();
|
|
2708
2719
|
return;
|
|
2709
2720
|
}
|
|
2710
2721
|
if (e.state === "disconnected" || e.state === "closed") {
|
|
2711
2722
|
this.logger.debug(
|
|
2712
2723
|
`already ${e.state} connected, skip unsubscribe command`,
|
|
2713
2724
|
{ identifier: t }
|
|
2714
|
-
),
|
|
2725
|
+
), s.release();
|
|
2715
2726
|
return;
|
|
2716
2727
|
}
|
|
2717
2728
|
let r = e.remoteId;
|
|
2718
2729
|
if (this.logger.debug("unsubscribing...", { remoteId: r }), this.state !== "connected") {
|
|
2719
2730
|
this.logger.debug("unsubscribe skipped (cable is not connected)", {
|
|
2720
2731
|
id: t
|
|
2721
|
-
}), e.close(), this.hub.unsubscribe(t),
|
|
2732
|
+
}), e.close(), this.hub.unsubscribe(t), s.release();
|
|
2722
2733
|
return;
|
|
2723
2734
|
}
|
|
2724
2735
|
try {
|
|
2725
2736
|
await this.protocol.unsubscribe(r), this.logger.debug("unsubscribed remotely", { id: t });
|
|
2726
2737
|
} catch (i) {
|
|
2727
|
-
i && (i instanceof
|
|
2738
|
+
i && (i instanceof j ? this.logger.debug(
|
|
2728
2739
|
"cable disconnected during the unsubscribe command execution",
|
|
2729
2740
|
{ id: t, error: i }
|
|
2730
2741
|
) : this.logger.error("unsubscribe failed", {
|
|
@@ -2732,21 +2743,21 @@ let Us = class {
|
|
|
2732
2743
|
error: i
|
|
2733
2744
|
}));
|
|
2734
2745
|
}
|
|
2735
|
-
e.intent === "unsubscribed" ? (e.close(), this.hub.unsubscribe(t)) : e.state = "closed",
|
|
2746
|
+
e.intent === "unsubscribed" ? (e.close(), this.hub.unsubscribe(t)) : e.state = "closed", s.release();
|
|
2736
2747
|
}
|
|
2737
|
-
async perform(e, t,
|
|
2748
|
+
async perform(e, t, s) {
|
|
2738
2749
|
if (this.performFailures === "throw")
|
|
2739
|
-
return this._perform(e, t,
|
|
2750
|
+
return this._perform(e, t, s);
|
|
2740
2751
|
try {
|
|
2741
|
-
return await this._perform(e, t,
|
|
2752
|
+
return await this._perform(e, t, s);
|
|
2742
2753
|
} catch (r) {
|
|
2743
2754
|
this.performFailures === "warn" && this.logger.warn("perform failed", { error: r });
|
|
2744
2755
|
return;
|
|
2745
2756
|
}
|
|
2746
2757
|
}
|
|
2747
|
-
async _perform(e, t,
|
|
2758
|
+
async _perform(e, t, s) {
|
|
2748
2759
|
if (this.state === "connecting" && await this.pendingConnect(), this.state === "closed" || this.state === "disconnected")
|
|
2749
|
-
throw new
|
|
2760
|
+
throw new Ds();
|
|
2750
2761
|
let r = this.hub.subscriptions.get(e);
|
|
2751
2762
|
if (!r)
|
|
2752
2763
|
throw Error(`Subscription not found: ${e}`);
|
|
@@ -2755,11 +2766,11 @@ let Us = class {
|
|
|
2755
2766
|
let i = r.remoteId, o = {
|
|
2756
2767
|
id: i,
|
|
2757
2768
|
action: t,
|
|
2758
|
-
payload:
|
|
2769
|
+
payload: s
|
|
2759
2770
|
};
|
|
2760
2771
|
this.logger.debug("perform", o);
|
|
2761
2772
|
try {
|
|
2762
|
-
let c = await this.protocol.perform(i, t,
|
|
2773
|
+
let c = await this.protocol.perform(i, t, s);
|
|
2763
2774
|
return c && this.logger.debug("perform result", {
|
|
2764
2775
|
message: c,
|
|
2765
2776
|
request: o
|
|
@@ -2775,49 +2786,49 @@ let Us = class {
|
|
|
2775
2786
|
return this.emitter.on(e, t);
|
|
2776
2787
|
}
|
|
2777
2788
|
once(e, t) {
|
|
2778
|
-
let
|
|
2779
|
-
|
|
2789
|
+
let s = this.emitter.on(e, (...r) => {
|
|
2790
|
+
s(), t(...r);
|
|
2780
2791
|
});
|
|
2781
|
-
return
|
|
2792
|
+
return s;
|
|
2782
2793
|
}
|
|
2783
2794
|
emit(e, ...t) {
|
|
2784
2795
|
return this.emitter.emit(e, ...t);
|
|
2785
2796
|
}
|
|
2786
2797
|
pendingConnect() {
|
|
2787
2798
|
return this._pendingConnect ? this._pendingConnect : (this._pendingConnect = new Promise((e, t) => {
|
|
2788
|
-
let
|
|
2789
|
-
|
|
2799
|
+
let s = [() => delete this._pendingConnect];
|
|
2800
|
+
s.push(
|
|
2790
2801
|
this.on("connect", () => {
|
|
2791
|
-
|
|
2802
|
+
s.forEach((r) => r()), e();
|
|
2792
2803
|
})
|
|
2793
|
-
),
|
|
2804
|
+
), s.push(
|
|
2794
2805
|
this.on("close", (r) => {
|
|
2795
|
-
|
|
2806
|
+
s.forEach((i) => i()), t(r);
|
|
2796
2807
|
})
|
|
2797
|
-
),
|
|
2808
|
+
), s.push(
|
|
2798
2809
|
this.on("disconnect", (r) => {
|
|
2799
|
-
|
|
2810
|
+
s.forEach((i) => i()), t(r);
|
|
2800
2811
|
})
|
|
2801
2812
|
);
|
|
2802
2813
|
}), this._pendingConnect);
|
|
2803
2814
|
}
|
|
2804
2815
|
};
|
|
2805
|
-
const
|
|
2816
|
+
const Ms = {
|
|
2806
2817
|
maxMissingPings: 2,
|
|
2807
2818
|
maxReconnectAttempts: 1 / 0
|
|
2808
|
-
}, W = () => Date.now(),
|
|
2819
|
+
}, W = () => Date.now(), zt = (n, e) => {
|
|
2809
2820
|
e = e || {};
|
|
2810
|
-
let { backoffRate: t, jitterRatio:
|
|
2811
|
-
return t = t || 2,
|
|
2812
|
-
let o =
|
|
2821
|
+
let { backoffRate: t, jitterRatio: s, maxInterval: r } = e;
|
|
2822
|
+
return t = t || 2, s === void 0 && (s = 0.5), (i) => {
|
|
2823
|
+
let o = n * t ** i, c = o * t, h = o + (c - o) * Math.random(), u = 2 * (Math.random() - 0.5) * s;
|
|
2813
2824
|
return h = h * (1 + u), r && r < h && (h = r), h;
|
|
2814
2825
|
};
|
|
2815
2826
|
};
|
|
2816
|
-
let
|
|
2827
|
+
let Vt = class {
|
|
2817
2828
|
constructor({ pingInterval: e, ...t }) {
|
|
2818
2829
|
if (this.pingInterval = e, !this.pingInterval)
|
|
2819
2830
|
throw Error(`Incorrect pingInterval is provided: ${e}`);
|
|
2820
|
-
if (t = Object.assign({},
|
|
2831
|
+
if (t = Object.assign({}, Ms, t), this.strategy = t.reconnectStrategy, !this.strategy)
|
|
2821
2832
|
throw Error("Reconnect strategy must be provided");
|
|
2822
2833
|
this.maxMissingPings = t.maxMissingPings, this.maxReconnectAttempts = t.maxReconnectAttempts, this.logger = t.logger || new se(), this.state = "pending_connect", this.attempts = 0, this.disconnectedAt = W();
|
|
2823
2834
|
}
|
|
@@ -2865,7 +2876,7 @@ let Ht = class {
|
|
|
2865
2876
|
}
|
|
2866
2877
|
checkStale() {
|
|
2867
2878
|
let e = W() - this.pingedAt;
|
|
2868
|
-
e > this.maxMissingPings * this.pingInterval && (this.logger.warn(`Stale connection: ${e}ms without pings`), this.state = "pending_disconnect", this.target.disconnected(new
|
|
2879
|
+
e > this.maxMissingPings * this.pingInterval && (this.logger.warn(`Stale connection: ${e}ms without pings`), this.state = "pending_disconnect", this.target.disconnected(new Ns()));
|
|
2869
2880
|
}
|
|
2870
2881
|
scheduleReconnect() {
|
|
2871
2882
|
if (this.attempts >= this.maxReconnectAttempts) {
|
|
@@ -2879,9 +2890,9 @@ let Ht = class {
|
|
|
2879
2890
|
this.reconnnectId && (clearTimeout(this.reconnnectId), delete this.reconnnectId);
|
|
2880
2891
|
}
|
|
2881
2892
|
};
|
|
2882
|
-
class
|
|
2893
|
+
class Hs {
|
|
2883
2894
|
constructor(e, t = {}) {
|
|
2884
|
-
this.transports = e, this.transport = null, this.emitter =
|
|
2895
|
+
this.transports = e, this.transport = null, this.emitter = ye(), this.unbind = [], this.logger = t.logger || new se();
|
|
2885
2896
|
}
|
|
2886
2897
|
displayName() {
|
|
2887
2898
|
return "fallbacked transport";
|
|
@@ -2892,9 +2903,9 @@ class qs {
|
|
|
2892
2903
|
try {
|
|
2893
2904
|
this.transport = t, this.resetListeners(), this.logger.debug(`Trying to connect via ${t.displayName()}`), await t.open(), this.logger.debug(`Connected via ${t.displayName()}`);
|
|
2894
2905
|
return;
|
|
2895
|
-
} catch (
|
|
2906
|
+
} catch (s) {
|
|
2896
2907
|
this.logger.debug(
|
|
2897
|
-
`Failed to connect via ${t.displayName()}: ${
|
|
2908
|
+
`Failed to connect via ${t.displayName()}: ${s.message}`
|
|
2898
2909
|
);
|
|
2899
2910
|
}
|
|
2900
2911
|
}
|
|
@@ -2914,23 +2925,23 @@ class qs {
|
|
|
2914
2925
|
throw new Error("Not implemented. Set URL for each transport separately");
|
|
2915
2926
|
}
|
|
2916
2927
|
setParam(e, t) {
|
|
2917
|
-
this.transports.forEach((
|
|
2918
|
-
|
|
2928
|
+
this.transports.forEach((s) => {
|
|
2929
|
+
s.setParam(e, t);
|
|
2919
2930
|
});
|
|
2920
2931
|
}
|
|
2921
2932
|
setToken(e, t) {
|
|
2922
|
-
this.transports.forEach((
|
|
2923
|
-
|
|
2933
|
+
this.transports.forEach((s) => {
|
|
2934
|
+
s.setToken(e, t);
|
|
2924
2935
|
});
|
|
2925
2936
|
}
|
|
2926
2937
|
on(e, t) {
|
|
2927
2938
|
return this.emitter.on(e, t);
|
|
2928
2939
|
}
|
|
2929
2940
|
once(e, t) {
|
|
2930
|
-
let
|
|
2931
|
-
|
|
2941
|
+
let s = this.emitter.on(e, (...r) => {
|
|
2942
|
+
s(), t(...r);
|
|
2932
2943
|
});
|
|
2933
|
-
return
|
|
2944
|
+
return s;
|
|
2934
2945
|
}
|
|
2935
2946
|
get url() {
|
|
2936
2947
|
return this.transport ? this.transport.url : "";
|
|
@@ -2952,17 +2963,17 @@ class qs {
|
|
|
2952
2963
|
);
|
|
2953
2964
|
}
|
|
2954
2965
|
}
|
|
2955
|
-
class
|
|
2966
|
+
class zs {
|
|
2956
2967
|
constructor(e, t = {}) {
|
|
2957
2968
|
this.url = e;
|
|
2958
|
-
let
|
|
2959
|
-
if (
|
|
2960
|
-
this.Impl =
|
|
2969
|
+
let s = t.websocketImplementation;
|
|
2970
|
+
if (s)
|
|
2971
|
+
this.Impl = s;
|
|
2961
2972
|
else if (typeof WebSocket < "u")
|
|
2962
2973
|
this.Impl = WebSocket;
|
|
2963
2974
|
else
|
|
2964
2975
|
throw new Error("No WebSocket support");
|
|
2965
|
-
this.connected = !1, this.emitter =
|
|
2976
|
+
this.connected = !1, this.emitter = ye();
|
|
2966
2977
|
let { format: r, subprotocol: i, authStrategy: o } = t;
|
|
2967
2978
|
this.format = r || "text", this.connectionOptions = t.websocketOptions, this.authStrategy = o || "param", this.authProtocol = "", this.subprotocol = i;
|
|
2968
2979
|
}
|
|
@@ -2971,7 +2982,7 @@ class Bs {
|
|
|
2971
2982
|
}
|
|
2972
2983
|
open() {
|
|
2973
2984
|
let e = this.subprotocol;
|
|
2974
|
-
return this.authStrategy === "sub-protocol" && (e = [this.subprotocol, this.authProtocol]), this.connectionOptions ? this.ws = new this.Impl(this.url, e, this.connectionOptions) : this.ws = new this.Impl(this.url, e), this.ws.binaryType = "arraybuffer", this.initListeners(), new Promise((t,
|
|
2985
|
+
return this.authStrategy === "sub-protocol" && (e = [this.subprotocol, this.authProtocol]), this.connectionOptions ? this.ws = new this.Impl(this.url, e, this.connectionOptions) : this.ws = new this.Impl(this.url, e), this.ws.binaryType = "arraybuffer", this.initListeners(), new Promise((t, s) => {
|
|
2975
2986
|
let r = [];
|
|
2976
2987
|
r.push(
|
|
2977
2988
|
this.once("open", () => {
|
|
@@ -2979,7 +2990,7 @@ class Bs {
|
|
|
2979
2990
|
})
|
|
2980
2991
|
), r.push(
|
|
2981
2992
|
this.once("close", () => {
|
|
2982
|
-
r.forEach((i) => i()),
|
|
2993
|
+
r.forEach((i) => i()), s(Error("WS connection closed"));
|
|
2983
2994
|
})
|
|
2984
2995
|
);
|
|
2985
2996
|
});
|
|
@@ -2988,9 +2999,9 @@ class Bs {
|
|
|
2988
2999
|
this.url = e;
|
|
2989
3000
|
}
|
|
2990
3001
|
setParam(e, t) {
|
|
2991
|
-
let
|
|
2992
|
-
|
|
2993
|
-
let r = `${
|
|
3002
|
+
let s = new URL(this.url);
|
|
3003
|
+
s.searchParams.set(e, t);
|
|
3004
|
+
let r = `${s.protocol}//${s.host}${s.pathname}?${s.searchParams}`;
|
|
2994
3005
|
this.setURL(r);
|
|
2995
3006
|
}
|
|
2996
3007
|
setToken(e, t = "jid") {
|
|
@@ -2998,10 +3009,10 @@ class Bs {
|
|
|
2998
3009
|
this.setParam(t, e);
|
|
2999
3010
|
else if (this.authStrategy === "header") {
|
|
3000
3011
|
this.connectionOptions = this.connectionOptions || {}, this.connectionOptions.headers = this.connectionOptions.headers || {};
|
|
3001
|
-
let
|
|
3002
|
-
|
|
3003
|
-
(i) => i.toLowerCase() ===
|
|
3004
|
-
) ||
|
|
3012
|
+
let s = `x-${t}`.toLowerCase();
|
|
3013
|
+
s = Object.keys(this.connectionOptions.headers).find(
|
|
3014
|
+
(i) => i.toLowerCase() === s
|
|
3015
|
+
) || s, this.connectionOptions.headers[s] = e;
|
|
3005
3016
|
} else if (this.authStrategy === "sub-protocol")
|
|
3006
3017
|
this.authProtocol = `anycable-token.${e}`;
|
|
3007
3018
|
else
|
|
@@ -3019,10 +3030,10 @@ class Bs {
|
|
|
3019
3030
|
return this.emitter.on(e, t);
|
|
3020
3031
|
}
|
|
3021
3032
|
once(e, t) {
|
|
3022
|
-
let
|
|
3023
|
-
|
|
3033
|
+
let s = this.emitter.on(e, (...r) => {
|
|
3034
|
+
s(), t(...r);
|
|
3024
3035
|
});
|
|
3025
|
-
return
|
|
3036
|
+
return s;
|
|
3026
3037
|
}
|
|
3027
3038
|
initListeners() {
|
|
3028
3039
|
this.ws.onerror = (e) => {
|
|
@@ -3040,7 +3051,7 @@ class Bs {
|
|
|
3040
3051
|
this.ws.onclose = void 0, this.ws.onmessage = void 0, this.ws.onopen = void 0, this.ws.close(), delete this.ws, this.connected = !1, this.emitter.emit("close");
|
|
3041
3052
|
}
|
|
3042
3053
|
}
|
|
3043
|
-
const
|
|
3054
|
+
const Jt = {
|
|
3044
3055
|
protocol: "actioncable-v1-json",
|
|
3045
3056
|
pingInterval: 3e3,
|
|
3046
3057
|
maxReconnectAttempts: 1 / 0,
|
|
@@ -3048,12 +3059,12 @@ const zt = {
|
|
|
3048
3059
|
logLevel: "warn",
|
|
3049
3060
|
lazy: !0
|
|
3050
3061
|
};
|
|
3051
|
-
function
|
|
3052
|
-
if (typeof
|
|
3053
|
-
e = Object.assign({},
|
|
3062
|
+
function Vs(n, e) {
|
|
3063
|
+
if (typeof n == "object" && typeof e > "u" && (e = n, n = void 0), e = e || {}, !n && !e.transport) throw Error("URL or transport must be specified");
|
|
3064
|
+
e = Object.assign({}, Jt, e);
|
|
3054
3065
|
let {
|
|
3055
3066
|
protocol: t,
|
|
3056
|
-
websocketImplementation:
|
|
3067
|
+
websocketImplementation: s,
|
|
3057
3068
|
websocketFormat: r,
|
|
3058
3069
|
websocketOptions: i,
|
|
3059
3070
|
websocketAuthStrategy: o,
|
|
@@ -3070,7 +3081,7 @@ function Ms(s, e) {
|
|
|
3070
3081
|
maxReconnectAttempts: _,
|
|
3071
3082
|
subprotocol: E,
|
|
3072
3083
|
tokenRefresher: S,
|
|
3073
|
-
historyTimestamp:
|
|
3084
|
+
historyTimestamp: N,
|
|
3074
3085
|
protocolOptions: x,
|
|
3075
3086
|
concurrentSubscribes: P,
|
|
3076
3087
|
performFailures: I,
|
|
@@ -3081,17 +3092,17 @@ function Ms(s, e) {
|
|
|
3081
3092
|
E = E || t;
|
|
3082
3093
|
let J = t.substring(0, t.lastIndexOf("-")), C = t.substring(t.lastIndexOf("-") + 1);
|
|
3083
3094
|
if (x = x || {}, J === "actioncable-v1")
|
|
3084
|
-
t = new
|
|
3095
|
+
t = new Ht({ logger: u, ...x });
|
|
3085
3096
|
else if (J === "actioncable-v1-ext")
|
|
3086
|
-
t = new
|
|
3097
|
+
t = new Us({
|
|
3087
3098
|
logger: u,
|
|
3088
|
-
historyTimestamp:
|
|
3099
|
+
historyTimestamp: N,
|
|
3089
3100
|
...x
|
|
3090
3101
|
});
|
|
3091
3102
|
else
|
|
3092
3103
|
throw Error(`Protocol is not supported yet: ${t}`);
|
|
3093
3104
|
if (C === "json")
|
|
3094
|
-
d = d || new
|
|
3105
|
+
d = d || new $s(), r = r || "text";
|
|
3095
3106
|
else if (C === "msgpack") {
|
|
3096
3107
|
if (r = "binary", !d)
|
|
3097
3108
|
throw Error(
|
|
@@ -3106,52 +3117,52 @@ function Ms(s, e) {
|
|
|
3106
3117
|
throw Error(`Protocol is not supported yet: ${t}`);
|
|
3107
3118
|
}
|
|
3108
3119
|
if (!t) throw Error("Protocol must be specified");
|
|
3109
|
-
a = a || new
|
|
3110
|
-
websocketImplementation:
|
|
3120
|
+
a = a || new zs(n, {
|
|
3121
|
+
websocketImplementation: s,
|
|
3111
3122
|
websocketOptions: i,
|
|
3112
3123
|
subprotocol: E,
|
|
3113
3124
|
authStrategy: o,
|
|
3114
3125
|
format: r
|
|
3115
|
-
}), c && (a = new
|
|
3126
|
+
}), c && (a = new Hs([a, ...c], { logger: u })), U && U.token && a.setToken(U.token, U.param || "jid"), m = m || zt(f), b !== !1 && (b = b || new Vt({
|
|
3116
3127
|
pingInterval: f,
|
|
3117
3128
|
reconnectStrategy: m,
|
|
3118
3129
|
maxMissingPings: p,
|
|
3119
3130
|
maxReconnectAttempts: _,
|
|
3120
3131
|
logger: u
|
|
3121
3132
|
}));
|
|
3122
|
-
let
|
|
3133
|
+
let Ee = { concurrentSubscribes: P }, v = new Bs({
|
|
3123
3134
|
protocol: t,
|
|
3124
3135
|
transport: a,
|
|
3125
3136
|
encoder: d,
|
|
3126
3137
|
logger: u,
|
|
3127
3138
|
lazy: g,
|
|
3128
|
-
hubOptions:
|
|
3139
|
+
hubOptions: Ee,
|
|
3129
3140
|
performFailures: I,
|
|
3130
3141
|
transportConfigurator: D
|
|
3131
3142
|
});
|
|
3132
|
-
return b && (b.watch(
|
|
3143
|
+
return b && (b.watch(v), v.monitor = b), S && Js(v, async () => {
|
|
3133
3144
|
try {
|
|
3134
3145
|
await S(a);
|
|
3135
3146
|
} catch (J) {
|
|
3136
3147
|
return u.error("Failed to refresh authentication token: " + J), !1;
|
|
3137
3148
|
}
|
|
3138
|
-
return
|
|
3149
|
+
return v.connect().catch(() => {
|
|
3139
3150
|
}), !0;
|
|
3140
|
-
}),
|
|
3151
|
+
}), v;
|
|
3141
3152
|
}
|
|
3142
|
-
function
|
|
3153
|
+
function Js(n, e) {
|
|
3143
3154
|
let t = !1;
|
|
3144
|
-
|
|
3145
|
-
if (
|
|
3155
|
+
n.on("connect", () => t = !1), n.on("close", async (s) => {
|
|
3156
|
+
if (s) {
|
|
3146
3157
|
if (t) {
|
|
3147
|
-
|
|
3158
|
+
n.logger.warn("Token auto-refresh is disabled", s);
|
|
3148
3159
|
return;
|
|
3149
3160
|
}
|
|
3150
|
-
|
|
3161
|
+
s.reason === "token_expired" && (t = !0, await e());
|
|
3151
3162
|
}
|
|
3152
3163
|
});
|
|
3153
3164
|
}
|
|
3154
|
-
class
|
|
3165
|
+
class Ws {
|
|
3155
3166
|
constructor(e) {
|
|
3156
3167
|
this.channel = e;
|
|
3157
3168
|
}
|
|
@@ -3171,44 +3182,44 @@ class zs {
|
|
|
3171
3182
|
return this.channel.disconnect();
|
|
3172
3183
|
}
|
|
3173
3184
|
}
|
|
3174
|
-
class
|
|
3175
|
-
constructor(e, t,
|
|
3176
|
-
super(e, t), this.subscription = new
|
|
3185
|
+
class Ks extends Be {
|
|
3186
|
+
constructor(e, t, s) {
|
|
3187
|
+
super(e, t), this.subscription = new Ws(this), Object.assign(this.subscription, s), this.on(
|
|
3177
3188
|
"connect",
|
|
3178
3189
|
({ reconnect: r }) => this.subscription.notify("connected", { reconnected: r })
|
|
3179
3190
|
), this.on(
|
|
3180
3191
|
"disconnect",
|
|
3181
3192
|
() => this.subscription.notify("disconnected", { allowReconnect: !0 })
|
|
3182
3193
|
), this.on("message", (r) => this.subscription.notify("received", r)), this.on("close", (r) => {
|
|
3183
|
-
r && r instanceof
|
|
3194
|
+
r && r instanceof qe ? this.subscription.notify("rejected") : this.subscription.notify("disconnected", { allowReconnect: !1 });
|
|
3184
3195
|
});
|
|
3185
3196
|
}
|
|
3186
3197
|
}
|
|
3187
|
-
class
|
|
3198
|
+
class Xs {
|
|
3188
3199
|
constructor(e) {
|
|
3189
3200
|
this.cable = e;
|
|
3190
3201
|
}
|
|
3191
3202
|
create(e, t) {
|
|
3192
|
-
let
|
|
3193
|
-
typeof e == "object" ? (
|
|
3194
|
-
let i = new
|
|
3203
|
+
let s, r;
|
|
3204
|
+
typeof e == "object" ? (s = e.channel, delete e.channel, r = e) : (s = e, r = {});
|
|
3205
|
+
let i = new Ks(s, r, t);
|
|
3195
3206
|
return i.subscription.notify("initialized"), this.cable.subscribe(i), i.subscription;
|
|
3196
3207
|
}
|
|
3197
3208
|
findAll(e) {
|
|
3198
3209
|
return this.cable.hub.channels.filter((t) => t.identifier === e).map((t) => t.subscription);
|
|
3199
3210
|
}
|
|
3200
3211
|
}
|
|
3201
|
-
class
|
|
3212
|
+
class Gs {
|
|
3202
3213
|
constructor(e) {
|
|
3203
|
-
this.cable = e, this.subscriptions = new
|
|
3214
|
+
this.cable = e, this.subscriptions = new Xs(e);
|
|
3204
3215
|
}
|
|
3205
3216
|
}
|
|
3206
|
-
class
|
|
3207
|
-
writeLogEntry(e, t,
|
|
3208
|
-
|
|
3217
|
+
class Zs extends Mt {
|
|
3218
|
+
writeLogEntry(e, t, s) {
|
|
3219
|
+
s ? console[e](t, s) : console[e](t);
|
|
3209
3220
|
}
|
|
3210
3221
|
}
|
|
3211
|
-
class
|
|
3222
|
+
class Qs extends Vt {
|
|
3212
3223
|
watch(e) {
|
|
3213
3224
|
super.watch(e), this.initActivityListeners();
|
|
3214
3225
|
}
|
|
@@ -3218,9 +3229,9 @@ class Xs extends Ht {
|
|
|
3218
3229
|
document.hidden || this.reconnectNow() && this.logger.debug("Trigger reconnect due to visibility change");
|
|
3219
3230
|
}, t = (r) => {
|
|
3220
3231
|
this.reconnectNow() && this.logger.debug("Trigger reconnect", { event: r });
|
|
3221
|
-
},
|
|
3222
|
-
document.addEventListener("visibilitychange", e, !1), window.addEventListener("focus", t, !1), window.addEventListener("online", t, !1), window.addEventListener("resume", t, !1), window.addEventListener("freeze",
|
|
3223
|
-
document.removeEventListener("visibilitychange", e, !1), window.removeEventListener("focus", t, !1), window.removeEventListener("online", t, !1), window.removeEventListener("resume", t, !1), window.removeEventListener("freeze",
|
|
3232
|
+
}, s = () => this.disconnect(new j("page_frozen"));
|
|
3233
|
+
document.addEventListener("visibilitychange", e, !1), window.addEventListener("focus", t, !1), window.addEventListener("online", t, !1), window.addEventListener("resume", t, !1), window.addEventListener("freeze", s, !1), this.unbind.push(() => {
|
|
3234
|
+
document.removeEventListener("visibilitychange", e, !1), window.removeEventListener("focus", t, !1), window.removeEventListener("online", t, !1), window.removeEventListener("resume", t, !1), window.removeEventListener("freeze", s, !1);
|
|
3224
3235
|
});
|
|
3225
3236
|
}
|
|
3226
3237
|
}
|
|
@@ -3228,80 +3239,80 @@ class Xs extends Ht {
|
|
|
3228
3239
|
this.state === "disconnected" || this.state === "closed" || (this.logger.info("Disconnecting", { reason: e.message }), this.cancelReconnect(), this.stopPolling(), this.state = "pending_disconnect", this.target.disconnected(e));
|
|
3229
3240
|
}
|
|
3230
3241
|
}
|
|
3231
|
-
const
|
|
3232
|
-
for (let t of
|
|
3233
|
-
let
|
|
3234
|
-
if (
|
|
3235
|
-
return
|
|
3242
|
+
const Ys = ["cable", "action-cable"], er = "/cable", _e = (n, e) => {
|
|
3243
|
+
for (let t of Ys) {
|
|
3244
|
+
let s = n.head.querySelector(`meta[name='${t}-${e}']`);
|
|
3245
|
+
if (s)
|
|
3246
|
+
return s.getAttribute("content");
|
|
3236
3247
|
}
|
|
3237
|
-
},
|
|
3248
|
+
}, at = (n) => n.match(/wss?:\/\//) ? n : typeof window < "u" ? `${window.location.protocol.replace("http", "ws")}//${window.location.host}${n}` : n, tr = () => {
|
|
3238
3249
|
if (typeof document < "u" && document.head) {
|
|
3239
|
-
let
|
|
3240
|
-
if (
|
|
3241
|
-
return
|
|
3250
|
+
let n = _e(document, "url");
|
|
3251
|
+
if (n)
|
|
3252
|
+
return at(n);
|
|
3242
3253
|
}
|
|
3243
|
-
return
|
|
3244
|
-
},
|
|
3254
|
+
return at(er);
|
|
3255
|
+
}, nr = () => {
|
|
3245
3256
|
if (typeof document < "u" && document.head) {
|
|
3246
|
-
let
|
|
3247
|
-
if (
|
|
3248
|
-
return
|
|
3257
|
+
let n = _e(document, "history-timestamp");
|
|
3258
|
+
if (n)
|
|
3259
|
+
return n | 0;
|
|
3249
3260
|
}
|
|
3250
|
-
},
|
|
3261
|
+
}, sr = () => {
|
|
3251
3262
|
if (typeof document < "u" && document.head)
|
|
3252
|
-
return
|
|
3253
|
-
},
|
|
3263
|
+
return _e(document, "token");
|
|
3264
|
+
}, rr = () => {
|
|
3254
3265
|
if (typeof document < "u" && document.head)
|
|
3255
|
-
return
|
|
3266
|
+
return _e(document, "token-param");
|
|
3256
3267
|
};
|
|
3257
|
-
function
|
|
3258
|
-
typeof
|
|
3259
|
-
let t =
|
|
3268
|
+
function ir(n, e) {
|
|
3269
|
+
typeof n == "object" && typeof e > "u" && (e = n, n = void 0), n = n || tr(), e = e || {}, e.historyTimestamp || (e.historyTimestamp = nr());
|
|
3270
|
+
let t = sr();
|
|
3260
3271
|
if (t) {
|
|
3261
|
-
let u =
|
|
3272
|
+
let u = rr();
|
|
3262
3273
|
e.auth = Object.assign({ token: t, param: u }, e.auth || {});
|
|
3263
3274
|
}
|
|
3264
|
-
e = Object.assign({},
|
|
3275
|
+
e = Object.assign({}, Jt, e);
|
|
3265
3276
|
let {
|
|
3266
|
-
logLevel:
|
|
3277
|
+
logLevel: s,
|
|
3267
3278
|
logger: r,
|
|
3268
3279
|
pingInterval: i,
|
|
3269
3280
|
reconnectStrategy: o,
|
|
3270
3281
|
maxMissingPings: c,
|
|
3271
3282
|
maxReconnectAttempts: h
|
|
3272
3283
|
} = e;
|
|
3273
|
-
return r = e.logger = e.logger || new
|
|
3284
|
+
return r = e.logger = e.logger || new Zs(s), o = e.reconnectStrategy = e.reconnectStrategy || zt(i), e.monitor !== !1 && (e.monitor = e.monitor || new Qs({
|
|
3274
3285
|
pingInterval: i,
|
|
3275
3286
|
reconnectStrategy: o,
|
|
3276
3287
|
maxMissingPings: c,
|
|
3277
3288
|
maxReconnectAttempts: h,
|
|
3278
3289
|
logger: r
|
|
3279
|
-
})),
|
|
3290
|
+
})), Vs(n, e);
|
|
3280
3291
|
}
|
|
3281
|
-
function
|
|
3282
|
-
let t =
|
|
3283
|
-
return new
|
|
3292
|
+
function or(n, e) {
|
|
3293
|
+
let t = ir(n, e);
|
|
3294
|
+
return new Gs(t);
|
|
3284
3295
|
}
|
|
3285
|
-
class
|
|
3296
|
+
class di {
|
|
3286
3297
|
constructor(e = "/openc3-api/cable") {
|
|
3287
3298
|
this._cable = null, this._url = e;
|
|
3288
3299
|
}
|
|
3289
3300
|
disconnect() {
|
|
3290
3301
|
this._cable && (this._cable.cable.disconnect(), this._cable = null);
|
|
3291
3302
|
}
|
|
3292
|
-
createSubscription(e, t,
|
|
3303
|
+
createSubscription(e, t, s = {}, r = {}) {
|
|
3293
3304
|
return OpenC3Auth.updateToken(OpenC3Auth.defaultMinValidity).then(
|
|
3294
3305
|
(i) => {
|
|
3295
3306
|
if (i && OpenC3Auth.setTokens(), this._cable == null) {
|
|
3296
3307
|
let o = this._url + "?scope=" + encodeURIComponent(window.openc3Scope) + "&authorization=" + encodeURIComponent(localStorage.openc3Token);
|
|
3297
|
-
o = new URL(o, document.baseURI).href, this._cable =
|
|
3308
|
+
o = new URL(o, document.baseURI).href, this._cable = or(o);
|
|
3298
3309
|
}
|
|
3299
3310
|
return this._cable.subscriptions.create(
|
|
3300
3311
|
{
|
|
3301
3312
|
channel: e,
|
|
3302
3313
|
...r
|
|
3303
3314
|
},
|
|
3304
|
-
|
|
3315
|
+
s
|
|
3305
3316
|
);
|
|
3306
3317
|
}
|
|
3307
3318
|
);
|
|
@@ -3309,34 +3320,34 @@ class li {
|
|
|
3309
3320
|
recordPing() {
|
|
3310
3321
|
}
|
|
3311
3322
|
}
|
|
3312
|
-
class
|
|
3313
|
-
constructor(e, t,
|
|
3314
|
-
this.keyword = e.keyword, this.parameters = e.parameters, this.filename = e.filename, this.line = e.line, this.lineNumber = e.lineNumber, this.message = t, this.usage =
|
|
3323
|
+
class lt {
|
|
3324
|
+
constructor(e, t, s = "", r = "") {
|
|
3325
|
+
this.keyword = e.keyword, this.parameters = e.parameters, this.filename = e.filename, this.line = e.line, this.lineNumber = e.lineNumber, this.message = t, this.usage = s, this.url = r;
|
|
3315
3326
|
}
|
|
3316
3327
|
}
|
|
3317
|
-
class
|
|
3328
|
+
class fi {
|
|
3318
3329
|
constructor() {
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
}
|
|
3326
|
-
verify_num_parameters(e, t,
|
|
3330
|
+
L(this, "keyword", null);
|
|
3331
|
+
L(this, "parameters", []);
|
|
3332
|
+
L(this, "filename", "");
|
|
3333
|
+
L(this, "line", "");
|
|
3334
|
+
L(this, "lineNumber", 0);
|
|
3335
|
+
L(this, "url", "https://docs.openc3.com/docs/configuration");
|
|
3336
|
+
}
|
|
3337
|
+
verify_num_parameters(e, t, s = "") {
|
|
3327
3338
|
for (let r = 1; r <= e; r++)
|
|
3328
3339
|
if (this.parameters[r - 1] === void 0)
|
|
3329
|
-
throw new
|
|
3340
|
+
throw new lt(
|
|
3330
3341
|
this,
|
|
3331
3342
|
`Not enough parameters for ${this.keyword}.`,
|
|
3332
|
-
|
|
3343
|
+
s,
|
|
3333
3344
|
this.url
|
|
3334
3345
|
);
|
|
3335
3346
|
if (t && this.parameters[t] !== void 0)
|
|
3336
|
-
throw new
|
|
3347
|
+
throw new lt(
|
|
3337
3348
|
this,
|
|
3338
3349
|
`Too many parameters for ${this.keyword}.`,
|
|
3339
|
-
|
|
3350
|
+
s,
|
|
3340
3351
|
this.url
|
|
3341
3352
|
);
|
|
3342
3353
|
}
|
|
@@ -3346,17 +3357,17 @@ class ui {
|
|
|
3346
3357
|
let t = e.charAt(0);
|
|
3347
3358
|
if (t !== '"' && t !== "'")
|
|
3348
3359
|
return e;
|
|
3349
|
-
let
|
|
3350
|
-
return t !==
|
|
3360
|
+
let s = e.charAt(e.length - 1);
|
|
3361
|
+
return t !== s ? e : e.substring(1, e.length - 1);
|
|
3351
3362
|
}
|
|
3352
3363
|
scan_string(e, t) {
|
|
3353
3364
|
if (!t.global) throw "rx must have 'global' flag set";
|
|
3354
|
-
let
|
|
3365
|
+
let s = [];
|
|
3355
3366
|
return e.replace(t, function(r) {
|
|
3356
|
-
return
|
|
3357
|
-
}),
|
|
3367
|
+
return s.push(r), r;
|
|
3368
|
+
}), s;
|
|
3358
3369
|
}
|
|
3359
|
-
parse_string(e, t,
|
|
3370
|
+
parse_string(e, t, s, r, i) {
|
|
3360
3371
|
let o = !1;
|
|
3361
3372
|
this.line = "", this.keyword = null, this.parameters = [], this.filename = t;
|
|
3362
3373
|
let c = e.split(`
|
|
@@ -3365,7 +3376,7 @@ class ui {
|
|
|
3365
3376
|
this.lineNumber = u + 1;
|
|
3366
3377
|
let a = c[u].trim();
|
|
3367
3378
|
if (a.length === 0) {
|
|
3368
|
-
|
|
3379
|
+
s && i(null, [], this.line, this.lineNumber);
|
|
3369
3380
|
continue;
|
|
3370
3381
|
}
|
|
3371
3382
|
if (o === !0) {
|
|
@@ -3392,7 +3403,7 @@ class ui {
|
|
|
3392
3403
|
o = !1;
|
|
3393
3404
|
let b = /("([^\\"]|\\.)*")|('([^\\']|\\.)*')|\S+/g, f = this.scan_string(this.line, b), m = "";
|
|
3394
3405
|
if (f.length > 0 && (m = m + f[0]), m.length === 0 || m.charAt(0) === "#" ? this.keyword = null : this.keyword = m.toUpperCase(), this.parameters = [], this.keyword === null) {
|
|
3395
|
-
|
|
3406
|
+
s && i(this.keyword, this.parameters, this.line, this.lineNumber), this.line = "";
|
|
3396
3407
|
continue;
|
|
3397
3408
|
}
|
|
3398
3409
|
let p = f.length;
|
|
@@ -3408,41 +3419,41 @@ class ui {
|
|
|
3408
3419
|
}
|
|
3409
3420
|
// parse_string
|
|
3410
3421
|
}
|
|
3411
|
-
function
|
|
3412
|
-
return
|
|
3422
|
+
function Me(n) {
|
|
3423
|
+
return cr.test(n);
|
|
3413
3424
|
}
|
|
3414
|
-
const
|
|
3415
|
-
function
|
|
3416
|
-
return
|
|
3425
|
+
const cr = /^-?[0-9]+$/;
|
|
3426
|
+
function Wt(n) {
|
|
3427
|
+
return ar.test(n);
|
|
3417
3428
|
}
|
|
3418
|
-
const
|
|
3419
|
-
function
|
|
3420
|
-
const t = Number.parseFloat(
|
|
3421
|
-
return !!(r === i || (e == null ? void 0 : e.approx) === !0 && !
|
|
3429
|
+
const ar = /^-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?$/;
|
|
3430
|
+
function Kt(n, e) {
|
|
3431
|
+
const t = Number.parseFloat(n), s = String(t), r = ut(n), i = ut(s);
|
|
3432
|
+
return !!(r === i || (e == null ? void 0 : e.approx) === !0 && !Me(n) && i.length >= 14 && r.startsWith(i.substring(0, 14)));
|
|
3422
3433
|
}
|
|
3423
|
-
let Q = /* @__PURE__ */ function(
|
|
3424
|
-
return
|
|
3434
|
+
let Q = /* @__PURE__ */ function(n) {
|
|
3435
|
+
return n.underflow = "underflow", n.overflow = "overflow", n.truncate_integer = "truncate_integer", n.truncate_float = "truncate_float", n;
|
|
3425
3436
|
}({});
|
|
3426
|
-
function
|
|
3427
|
-
if (
|
|
3437
|
+
function lr(n) {
|
|
3438
|
+
if (Kt(n, {
|
|
3428
3439
|
approx: !1
|
|
3429
3440
|
}))
|
|
3430
3441
|
return;
|
|
3431
|
-
if (
|
|
3442
|
+
if (Me(n))
|
|
3432
3443
|
return Q.truncate_integer;
|
|
3433
|
-
const e = Number.parseFloat(
|
|
3444
|
+
const e = Number.parseFloat(n);
|
|
3434
3445
|
return Number.isFinite(e) ? e === 0 ? Q.underflow : Q.truncate_float : Q.overflow;
|
|
3435
3446
|
}
|
|
3436
|
-
function
|
|
3437
|
-
return
|
|
3447
|
+
function ut(n) {
|
|
3448
|
+
return n.replace(ur, "").replace(dr, "").replace(fr, "").replace(hr, "");
|
|
3438
3449
|
}
|
|
3439
|
-
const
|
|
3440
|
-
class
|
|
3450
|
+
const ur = /[eE][+-]?\d+$/, hr = /^-?(0*)?/, dr = /\./, fr = /0+$/;
|
|
3451
|
+
class pr {
|
|
3441
3452
|
constructor(e) {
|
|
3442
3453
|
// numeric value as string
|
|
3443
3454
|
// type information
|
|
3444
|
-
|
|
3445
|
-
if (!
|
|
3455
|
+
L(this, "isLosslessNumber", !0);
|
|
3456
|
+
if (!Wt(e))
|
|
3446
3457
|
throw new Error(`Invalid number (value: "${e}")`);
|
|
3447
3458
|
this.value = e;
|
|
3448
3459
|
}
|
|
@@ -3458,10 +3469,10 @@ class hr {
|
|
|
3458
3469
|
* and toSafeNumberOrThrow to convert it to a numeric value.
|
|
3459
3470
|
*/
|
|
3460
3471
|
valueOf() {
|
|
3461
|
-
const e =
|
|
3472
|
+
const e = lr(this.value);
|
|
3462
3473
|
if (e === void 0 || e === Q.truncate_float)
|
|
3463
3474
|
return Number.parseFloat(this.value);
|
|
3464
|
-
if (
|
|
3475
|
+
if (Me(this.value))
|
|
3465
3476
|
return BigInt(this.value);
|
|
3466
3477
|
throw new Error(`Cannot safely convert to number: the value '${this.value}' would ${e} and become ${Number.parseFloat(this.value)}`);
|
|
3467
3478
|
}
|
|
@@ -3475,70 +3486,70 @@ class hr {
|
|
|
3475
3486
|
// or use that, it cannot safely turn the numeric value in the string into
|
|
3476
3487
|
// stringified JSON since it has to be parsed into a number first.
|
|
3477
3488
|
}
|
|
3478
|
-
function
|
|
3479
|
-
return
|
|
3489
|
+
function mr(n) {
|
|
3490
|
+
return n && typeof n == "object" && n.isLosslessNumber === !0 || !1;
|
|
3480
3491
|
}
|
|
3481
|
-
function
|
|
3482
|
-
return new
|
|
3492
|
+
function gr(n) {
|
|
3493
|
+
return new pr(n);
|
|
3483
3494
|
}
|
|
3484
|
-
function
|
|
3485
|
-
return
|
|
3486
|
-
"":
|
|
3487
|
-
}, "",
|
|
3495
|
+
function br(n, e) {
|
|
3496
|
+
return He({
|
|
3497
|
+
"": n
|
|
3498
|
+
}, "", n, e);
|
|
3488
3499
|
}
|
|
3489
|
-
function
|
|
3490
|
-
return Array.isArray(t) ?
|
|
3500
|
+
function He(n, e, t, s) {
|
|
3501
|
+
return Array.isArray(t) ? s.call(n, e, yr(t, s)) : t && typeof t == "object" && !mr(t) ? s.call(n, e, wr(t, s)) : s.call(n, e, t);
|
|
3491
3502
|
}
|
|
3492
|
-
function
|
|
3493
|
-
for (const t of Object.keys(
|
|
3494
|
-
const
|
|
3495
|
-
|
|
3503
|
+
function wr(n, e) {
|
|
3504
|
+
for (const t of Object.keys(n)) {
|
|
3505
|
+
const s = He(n, t, n[t], e);
|
|
3506
|
+
s !== void 0 ? n[t] = s : delete n[t];
|
|
3496
3507
|
}
|
|
3497
|
-
return
|
|
3508
|
+
return n;
|
|
3498
3509
|
}
|
|
3499
|
-
function
|
|
3500
|
-
for (let t = 0; t <
|
|
3501
|
-
|
|
3502
|
-
return
|
|
3510
|
+
function yr(n, e) {
|
|
3511
|
+
for (let t = 0; t < n.length; t++)
|
|
3512
|
+
n[t] = He(n, String(t), n[t], e);
|
|
3513
|
+
return n;
|
|
3503
3514
|
}
|
|
3504
|
-
function
|
|
3505
|
-
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] :
|
|
3515
|
+
function _r(n, e) {
|
|
3516
|
+
let t = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : gr, s = 0;
|
|
3506
3517
|
const r = c();
|
|
3507
|
-
return f(r), p(), e ?
|
|
3518
|
+
return f(r), p(), e ? br(r, e) : r;
|
|
3508
3519
|
function i() {
|
|
3509
|
-
if (
|
|
3510
|
-
|
|
3520
|
+
if (n.charCodeAt(s) === Or) {
|
|
3521
|
+
s++, u();
|
|
3511
3522
|
const y = {};
|
|
3512
3523
|
let A = !0;
|
|
3513
|
-
for (;
|
|
3524
|
+
for (; s < n.length && n.charCodeAt(s) !== dt; ) {
|
|
3514
3525
|
A ? A = !1 : (g(), u());
|
|
3515
|
-
const q =
|
|
3526
|
+
const q = s, G = a();
|
|
3516
3527
|
if (G === void 0) {
|
|
3517
3528
|
S();
|
|
3518
3529
|
return;
|
|
3519
3530
|
}
|
|
3520
3531
|
u(), b();
|
|
3521
|
-
const
|
|
3522
|
-
if (
|
|
3532
|
+
const Se = c();
|
|
3533
|
+
if (Se === void 0) {
|
|
3523
3534
|
U();
|
|
3524
3535
|
return;
|
|
3525
3536
|
}
|
|
3526
|
-
Object.prototype.hasOwnProperty.call(y, G) && !
|
|
3537
|
+
Object.prototype.hasOwnProperty.call(y, G) && !je(Se, y[G]) && N(G, q + 1), y[G] = Se;
|
|
3527
3538
|
}
|
|
3528
|
-
return
|
|
3539
|
+
return n.charCodeAt(s) !== dt && x(), s++, y;
|
|
3529
3540
|
}
|
|
3530
3541
|
}
|
|
3531
3542
|
function o() {
|
|
3532
|
-
if (
|
|
3533
|
-
|
|
3543
|
+
if (n.charCodeAt(s) === Cr) {
|
|
3544
|
+
s++, u();
|
|
3534
3545
|
const y = [];
|
|
3535
3546
|
let A = !0;
|
|
3536
|
-
for (;
|
|
3547
|
+
for (; s < n.length && n.charCodeAt(s) !== ft; ) {
|
|
3537
3548
|
A ? A = !1 : g();
|
|
3538
3549
|
const q = c();
|
|
3539
3550
|
m(q), y.push(q);
|
|
3540
3551
|
}
|
|
3541
|
-
return
|
|
3552
|
+
return n.charCodeAt(s) !== ft && P(), s++, y;
|
|
3542
3553
|
}
|
|
3543
3554
|
}
|
|
3544
3555
|
function c() {
|
|
@@ -3547,53 +3558,53 @@ function br(s, e) {
|
|
|
3547
3558
|
return u(), y;
|
|
3548
3559
|
}
|
|
3549
3560
|
function h(y, A) {
|
|
3550
|
-
if (
|
|
3551
|
-
return
|
|
3561
|
+
if (n.slice(s, s + y.length) === y)
|
|
3562
|
+
return s += y.length, A;
|
|
3552
3563
|
}
|
|
3553
3564
|
function u() {
|
|
3554
|
-
for (;
|
|
3555
|
-
|
|
3565
|
+
for (; Er(n.charCodeAt(s)); )
|
|
3566
|
+
s++;
|
|
3556
3567
|
}
|
|
3557
3568
|
function a() {
|
|
3558
|
-
if (
|
|
3559
|
-
|
|
3569
|
+
if (n.charCodeAt(s) === Oe) {
|
|
3570
|
+
s++;
|
|
3560
3571
|
let y = "";
|
|
3561
|
-
for (;
|
|
3562
|
-
if (
|
|
3563
|
-
const A = s
|
|
3564
|
-
q !== void 0 ? (y += q,
|
|
3572
|
+
for (; s < n.length && n.charCodeAt(s) !== Oe; ) {
|
|
3573
|
+
if (n.charCodeAt(s) === Ar) {
|
|
3574
|
+
const A = n[s + 1], q = Rr[A];
|
|
3575
|
+
q !== void 0 ? (y += q, s++) : A === "u" ? ie(n.charCodeAt(s + 2)) && ie(n.charCodeAt(s + 3)) && ie(n.charCodeAt(s + 4)) && ie(n.charCodeAt(s + 5)) ? (y += String.fromCharCode(Number.parseInt(n.slice(s + 2, s + 6), 16)), s += 5) : Ee(s) : D(s);
|
|
3565
3576
|
} else
|
|
3566
|
-
|
|
3567
|
-
|
|
3577
|
+
xr(n.charCodeAt(s)) ? y += n[s] : I(n[s]);
|
|
3578
|
+
s++;
|
|
3568
3579
|
}
|
|
3569
|
-
return E(),
|
|
3580
|
+
return E(), s++, y;
|
|
3570
3581
|
}
|
|
3571
3582
|
}
|
|
3572
3583
|
function d() {
|
|
3573
|
-
const y =
|
|
3574
|
-
if (
|
|
3575
|
-
|
|
3576
|
-
else if (
|
|
3577
|
-
for (
|
|
3578
|
-
|
|
3579
|
-
if (
|
|
3580
|
-
for (
|
|
3581
|
-
|
|
3582
|
-
if (
|
|
3583
|
-
for (
|
|
3584
|
-
|
|
3585
|
-
if (
|
|
3586
|
-
return t(
|
|
3584
|
+
const y = s;
|
|
3585
|
+
if (n.charCodeAt(s) === pt && (s++, _(y)), n.charCodeAt(s) === ze)
|
|
3586
|
+
s++;
|
|
3587
|
+
else if (Sr(n.charCodeAt(s)))
|
|
3588
|
+
for (s++; oe(n.charCodeAt(s)); )
|
|
3589
|
+
s++;
|
|
3590
|
+
if (n.charCodeAt(s) === jr)
|
|
3591
|
+
for (s++, _(y); oe(n.charCodeAt(s)); )
|
|
3592
|
+
s++;
|
|
3593
|
+
if (n.charCodeAt(s) === qr || n.charCodeAt(s) === Dr)
|
|
3594
|
+
for (s++, (n.charCodeAt(s) === pt || n.charCodeAt(s) === Ir) && s++, _(y); oe(n.charCodeAt(s)); )
|
|
3595
|
+
s++;
|
|
3596
|
+
if (s > y)
|
|
3597
|
+
return t(n.slice(y, s));
|
|
3587
3598
|
}
|
|
3588
3599
|
function g() {
|
|
3589
|
-
if (
|
|
3600
|
+
if (n.charCodeAt(s) !== Lr)
|
|
3590
3601
|
throw new SyntaxError(`Comma ',' expected after value ${C()}`);
|
|
3591
|
-
|
|
3602
|
+
s++;
|
|
3592
3603
|
}
|
|
3593
3604
|
function b() {
|
|
3594
|
-
if (
|
|
3605
|
+
if (n.charCodeAt(s) !== $r)
|
|
3595
3606
|
throw new SyntaxError(`Colon ':' expected after property name ${C()}`);
|
|
3596
|
-
|
|
3607
|
+
s++;
|
|
3597
3608
|
}
|
|
3598
3609
|
function f(y) {
|
|
3599
3610
|
if (y === void 0)
|
|
@@ -3604,23 +3615,23 @@ function br(s, e) {
|
|
|
3604
3615
|
throw new SyntaxError(`Array item expected ${C()}`);
|
|
3605
3616
|
}
|
|
3606
3617
|
function p() {
|
|
3607
|
-
if (
|
|
3618
|
+
if (s < n.length)
|
|
3608
3619
|
throw new SyntaxError(`Expected end of input ${C()}`);
|
|
3609
3620
|
}
|
|
3610
3621
|
function _(y) {
|
|
3611
|
-
if (!oe(
|
|
3612
|
-
const A =
|
|
3622
|
+
if (!oe(n.charCodeAt(s))) {
|
|
3623
|
+
const A = n.slice(y, s);
|
|
3613
3624
|
throw new SyntaxError(`Invalid number '${A}', expecting a digit ${C()}`);
|
|
3614
3625
|
}
|
|
3615
3626
|
}
|
|
3616
3627
|
function E() {
|
|
3617
|
-
if (
|
|
3628
|
+
if (n.charCodeAt(s) !== Oe)
|
|
3618
3629
|
throw new SyntaxError(`End of string '"' expected ${C()}`);
|
|
3619
3630
|
}
|
|
3620
3631
|
function S() {
|
|
3621
3632
|
throw new SyntaxError(`Quoted object key expected ${C()}`);
|
|
3622
3633
|
}
|
|
3623
|
-
function
|
|
3634
|
+
function N(y, A) {
|
|
3624
3635
|
throw new SyntaxError(`Duplicate key '${y}' encountered at position ${A}`);
|
|
3625
3636
|
}
|
|
3626
3637
|
function x() {
|
|
@@ -3630,51 +3641,51 @@ function br(s, e) {
|
|
|
3630
3641
|
throw new SyntaxError(`Array item or end of array ']' expected ${C()}`);
|
|
3631
3642
|
}
|
|
3632
3643
|
function I(y) {
|
|
3633
|
-
throw new SyntaxError(`Invalid character '${y}' ${
|
|
3644
|
+
throw new SyntaxError(`Invalid character '${y}' ${v()}`);
|
|
3634
3645
|
}
|
|
3635
3646
|
function D(y) {
|
|
3636
|
-
const A =
|
|
3637
|
-
throw new SyntaxError(`Invalid escape character '${A}' ${
|
|
3647
|
+
const A = n.slice(y, y + 2);
|
|
3648
|
+
throw new SyntaxError(`Invalid escape character '${A}' ${v()}`);
|
|
3638
3649
|
}
|
|
3639
3650
|
function U() {
|
|
3640
|
-
throw new SyntaxError(`Object value expected after ':' ${
|
|
3651
|
+
throw new SyntaxError(`Object value expected after ':' ${v()}`);
|
|
3641
3652
|
}
|
|
3642
|
-
function
|
|
3643
|
-
const A =
|
|
3644
|
-
throw new SyntaxError(`Invalid unicode character '${A}' ${
|
|
3653
|
+
function Ee(y) {
|
|
3654
|
+
const A = n.slice(y, y + 6);
|
|
3655
|
+
throw new SyntaxError(`Invalid unicode character '${A}' ${v()}`);
|
|
3645
3656
|
}
|
|
3646
|
-
function
|
|
3647
|
-
return `at position ${
|
|
3657
|
+
function v() {
|
|
3658
|
+
return `at position ${s}`;
|
|
3648
3659
|
}
|
|
3649
3660
|
function J() {
|
|
3650
|
-
return
|
|
3661
|
+
return s < n.length ? `but got '${n[s]}'` : "but reached end of input";
|
|
3651
3662
|
}
|
|
3652
3663
|
function C() {
|
|
3653
|
-
return `${J()} ${
|
|
3664
|
+
return `${J()} ${v()}`;
|
|
3654
3665
|
}
|
|
3655
3666
|
}
|
|
3656
|
-
function
|
|
3657
|
-
return
|
|
3667
|
+
function Er(n) {
|
|
3668
|
+
return n === Tr || n === kr || n === Nr || n === Pr;
|
|
3658
3669
|
}
|
|
3659
|
-
function ie(
|
|
3660
|
-
return
|
|
3670
|
+
function ie(n) {
|
|
3671
|
+
return n >= ze && n <= Ve || n >= Fr && n <= Br || n >= Ur && n <= Mr;
|
|
3661
3672
|
}
|
|
3662
|
-
function oe(
|
|
3663
|
-
return
|
|
3673
|
+
function oe(n) {
|
|
3674
|
+
return n >= ze && n <= Ve;
|
|
3664
3675
|
}
|
|
3665
|
-
function
|
|
3666
|
-
return
|
|
3676
|
+
function Sr(n) {
|
|
3677
|
+
return n >= vr && n <= Ve;
|
|
3667
3678
|
}
|
|
3668
|
-
function
|
|
3669
|
-
return
|
|
3679
|
+
function xr(n) {
|
|
3680
|
+
return n >= 32 && n <= 1114111;
|
|
3670
3681
|
}
|
|
3671
|
-
function
|
|
3672
|
-
return
|
|
3682
|
+
function je(n, e) {
|
|
3683
|
+
return n === e ? !0 : Array.isArray(n) && Array.isArray(e) ? n.length === e.length && n.every((t, s) => je(t, e[s])) : ht(n) && ht(e) ? [.../* @__PURE__ */ new Set([...Object.keys(n), ...Object.keys(e)])].every((s) => je(n[s], e[s])) : !1;
|
|
3673
3684
|
}
|
|
3674
|
-
function
|
|
3675
|
-
return typeof
|
|
3685
|
+
function ht(n) {
|
|
3686
|
+
return typeof n == "object" && n !== null;
|
|
3676
3687
|
}
|
|
3677
|
-
const
|
|
3688
|
+
const Rr = {
|
|
3678
3689
|
'"': '"',
|
|
3679
3690
|
"\\": "\\",
|
|
3680
3691
|
"/": "/",
|
|
@@ -3685,16 +3696,16 @@ const Er = {
|
|
|
3685
3696
|
r: "\r",
|
|
3686
3697
|
t: " "
|
|
3687
3698
|
// note that \u is handled separately in parseString()
|
|
3688
|
-
},
|
|
3689
|
-
function
|
|
3699
|
+
}, Ar = 92, Or = 123, dt = 125, Cr = 91, ft = 93, Tr = 32, kr = 10, Nr = 9, Pr = 13, Oe = 34, Ir = 43, pt = 45, ze = 48, vr = 49, Ve = 57, Lr = 44, jr = 46, $r = 58, Fr = 65, Ur = 97, Dr = 69, qr = 101, Br = 70, Mr = 102;
|
|
3700
|
+
function Xt(n, e, t, s) {
|
|
3690
3701
|
const r = void 0;
|
|
3691
|
-
return o(
|
|
3702
|
+
return o(n, "");
|
|
3692
3703
|
function o(a, d) {
|
|
3693
|
-
if (Array.isArray(
|
|
3694
|
-
const g =
|
|
3704
|
+
if (Array.isArray(s)) {
|
|
3705
|
+
const g = s.find((b) => b.test(a));
|
|
3695
3706
|
if (g) {
|
|
3696
3707
|
const b = g.stringify(a);
|
|
3697
|
-
if (typeof b != "string" || !
|
|
3708
|
+
if (typeof b != "string" || !Wt(b))
|
|
3698
3709
|
throw new Error(`Invalid JSON number: output of a number stringifier must be a string containing a JSON number (output: ${b})`);
|
|
3699
3710
|
return b;
|
|
3700
3711
|
}
|
|
@@ -3724,7 +3735,7 @@ ${d}]` : "]", b;
|
|
|
3724
3735
|
}
|
|
3725
3736
|
function h(a, d) {
|
|
3726
3737
|
if (typeof a.toJSON == "function")
|
|
3727
|
-
return
|
|
3738
|
+
return Xt(a.toJSON(), e, t, void 0);
|
|
3728
3739
|
const g = Array.isArray(e) ? e.map(String) : Object.keys(a);
|
|
3729
3740
|
if (g.length === 0)
|
|
3730
3741
|
return "{}";
|
|
@@ -3747,14 +3758,14 @@ ${d}}` : "}", m;
|
|
|
3747
3758
|
return typeof d < "u" && typeof d != "function" && typeof d != "symbol";
|
|
3748
3759
|
}
|
|
3749
3760
|
}
|
|
3750
|
-
function
|
|
3751
|
-
return
|
|
3761
|
+
function Hr(n) {
|
|
3762
|
+
return Kt(n) ? parseFloat(n) : BigInt(n);
|
|
3752
3763
|
}
|
|
3753
|
-
class
|
|
3764
|
+
class pi {
|
|
3754
3765
|
constructor() {
|
|
3755
|
-
|
|
3766
|
+
L(this, "id", 1);
|
|
3756
3767
|
}
|
|
3757
|
-
async exec(e, t,
|
|
3768
|
+
async exec(e, t, s = {}, r = {}, i = 6e4) {
|
|
3758
3769
|
try {
|
|
3759
3770
|
await OpenC3Auth.updateToken(
|
|
3760
3771
|
OpenC3Auth.defaultMinValidity
|
|
@@ -3764,14 +3775,14 @@ class hi {
|
|
|
3764
3775
|
}
|
|
3765
3776
|
this.id = this.id + 1;
|
|
3766
3777
|
try {
|
|
3767
|
-
return
|
|
3778
|
+
return s.scope = window.openc3Scope, r.manual = !0, (await De.post(
|
|
3768
3779
|
"/openc3-api/api",
|
|
3769
3780
|
{
|
|
3770
3781
|
jsonrpc: "2.0",
|
|
3771
3782
|
method: e,
|
|
3772
3783
|
params: t,
|
|
3773
3784
|
id: this.id,
|
|
3774
|
-
keyword_params:
|
|
3785
|
+
keyword_params: s
|
|
3775
3786
|
},
|
|
3776
3787
|
{
|
|
3777
3788
|
headers: {
|
|
@@ -3781,10 +3792,10 @@ class hi {
|
|
|
3781
3792
|
},
|
|
3782
3793
|
timeout: i,
|
|
3783
3794
|
transformRequest: [
|
|
3784
|
-
(c, h) =>
|
|
3795
|
+
(c, h) => Xt(c)
|
|
3785
3796
|
],
|
|
3786
3797
|
transformResponse: [
|
|
3787
|
-
(c) =>
|
|
3798
|
+
(c) => _r(c, void 0, Hr)
|
|
3788
3799
|
]
|
|
3789
3800
|
}
|
|
3790
3801
|
)).data.result;
|
|
@@ -3838,11 +3849,11 @@ class hi {
|
|
|
3838
3849
|
disconnect_interface(e) {
|
|
3839
3850
|
return this.exec("disconnect_interface", [e]);
|
|
3840
3851
|
}
|
|
3841
|
-
interface_cmd(e, t, ...
|
|
3852
|
+
interface_cmd(e, t, ...s) {
|
|
3842
3853
|
return this.exec("interface_cmd", [
|
|
3843
3854
|
e,
|
|
3844
3855
|
t,
|
|
3845
|
-
...
|
|
3856
|
+
...s
|
|
3846
3857
|
]);
|
|
3847
3858
|
}
|
|
3848
3859
|
get_all_router_info() {
|
|
@@ -3860,15 +3871,15 @@ class hi {
|
|
|
3860
3871
|
get_tlm_cnts(e) {
|
|
3861
3872
|
return this.exec("get_tlm_cnts", [e]);
|
|
3862
3873
|
}
|
|
3863
|
-
get_item(e, t,
|
|
3864
|
-
return this.exec("get_item", [e, t,
|
|
3874
|
+
get_item(e, t, s) {
|
|
3875
|
+
return this.exec("get_item", [e, t, s]);
|
|
3865
3876
|
}
|
|
3866
|
-
get_param(e, t,
|
|
3867
|
-
return this.exec("get_param", [e, t,
|
|
3877
|
+
get_param(e, t, s) {
|
|
3878
|
+
return this.exec("get_param", [e, t, s]);
|
|
3868
3879
|
}
|
|
3869
3880
|
// DEPRECATED for get_param
|
|
3870
|
-
get_parameter(e, t,
|
|
3871
|
-
return this.exec("get_param", [e, t,
|
|
3881
|
+
get_parameter(e, t, s) {
|
|
3882
|
+
return this.exec("get_param", [e, t, s]);
|
|
3872
3883
|
}
|
|
3873
3884
|
get_limits_sets() {
|
|
3874
3885
|
return this.exec("get_limits_sets", []);
|
|
@@ -3916,9 +3927,9 @@ class hi {
|
|
|
3916
3927
|
get_all_tlm_item_names(e) {
|
|
3917
3928
|
return this.exec("get_all_tlm_item_names", [e]);
|
|
3918
3929
|
}
|
|
3919
|
-
async get_tlm_packet(e, t,
|
|
3930
|
+
async get_tlm_packet(e, t, s, r = 30) {
|
|
3920
3931
|
const i = await this.exec("get_tlm_packet", [e, t], {
|
|
3921
|
-
type:
|
|
3932
|
+
type: s,
|
|
3922
3933
|
stale_time: r
|
|
3923
3934
|
});
|
|
3924
3935
|
if (i != null) {
|
|
@@ -3934,11 +3945,11 @@ class hi {
|
|
|
3934
3945
|
get_tlm_buffer(e, t) {
|
|
3935
3946
|
return this.exec("get_tlm_buffer", [e, t]);
|
|
3936
3947
|
}
|
|
3937
|
-
async get_tlm_values(e, t = 30,
|
|
3948
|
+
async get_tlm_values(e, t = 30, s = null) {
|
|
3938
3949
|
let r = {
|
|
3939
3950
|
stale_time: t
|
|
3940
3951
|
};
|
|
3941
|
-
|
|
3952
|
+
s !== null && (r.cache_timeout = s);
|
|
3942
3953
|
const i = await this.exec(
|
|
3943
3954
|
"get_tlm_values",
|
|
3944
3955
|
[e],
|
|
@@ -3952,14 +3963,14 @@ class hi {
|
|
|
3952
3963
|
c = this.decode_openc3_type(i[0][h]), c !== null && (i[0][h] = c);
|
|
3953
3964
|
return i;
|
|
3954
3965
|
}
|
|
3955
|
-
get_limits(e, t,
|
|
3956
|
-
return this.exec("get_limits", [e, t,
|
|
3966
|
+
get_limits(e, t, s) {
|
|
3967
|
+
return this.exec("get_limits", [e, t, s]);
|
|
3957
3968
|
}
|
|
3958
|
-
async tlm(e, t,
|
|
3969
|
+
async tlm(e, t, s, r = "CONVERTED") {
|
|
3959
3970
|
let i = null;
|
|
3960
3971
|
if (t === void 0)
|
|
3961
3972
|
i = await this.exec("tlm", [e]);
|
|
3962
|
-
else if (
|
|
3973
|
+
else if (s === void 0)
|
|
3963
3974
|
if (["RAW", "CONVERTED", "FORMATTED", "WITH_UNITS"].includes(t))
|
|
3964
3975
|
i = await this.exec("tlm", [e], { type: t });
|
|
3965
3976
|
else {
|
|
@@ -3967,32 +3978,32 @@ class hi {
|
|
|
3967
3978
|
throw c.name = "TypeError", c.message = `Invalid data type ${t}. Valid options are RAW, CONVERTED, FORMATTED, and WITH_UNITS.`, c;
|
|
3968
3979
|
}
|
|
3969
3980
|
else
|
|
3970
|
-
i = await this.exec("tlm", [e, t,
|
|
3981
|
+
i = await this.exec("tlm", [e, t, s], {
|
|
3971
3982
|
type: r
|
|
3972
3983
|
});
|
|
3973
3984
|
let o = this.decode_openc3_type(i);
|
|
3974
3985
|
return o !== null && (i = o), i;
|
|
3975
3986
|
}
|
|
3976
|
-
async inject_tlm(e, t,
|
|
3977
|
-
await this.exec("inject_tlm", [e, t,
|
|
3987
|
+
async inject_tlm(e, t, s = null, r = "CONVERTED") {
|
|
3988
|
+
await this.exec("inject_tlm", [e, t, s], {
|
|
3978
3989
|
type: r
|
|
3979
3990
|
});
|
|
3980
3991
|
}
|
|
3981
|
-
set_tlm(e, t,
|
|
3982
|
-
return this.exec("set_tlm", [e, t,
|
|
3992
|
+
set_tlm(e, t, s, r) {
|
|
3993
|
+
return this.exec("set_tlm", [e, t, s], {
|
|
3983
3994
|
type: r
|
|
3984
3995
|
});
|
|
3985
3996
|
}
|
|
3986
|
-
override_tlm(e, t,
|
|
3987
|
-
return this.exec("override_tlm", [e, t,
|
|
3997
|
+
override_tlm(e, t, s, r) {
|
|
3998
|
+
return this.exec("override_tlm", [e, t, s], {
|
|
3988
3999
|
type: r
|
|
3989
4000
|
});
|
|
3990
4001
|
}
|
|
3991
4002
|
get_overrides() {
|
|
3992
4003
|
return this.exec("get_overrides");
|
|
3993
4004
|
}
|
|
3994
|
-
normalize_tlm(e, t,
|
|
3995
|
-
return this.exec("normalize_tlm", [e, t,
|
|
4005
|
+
normalize_tlm(e, t, s, r) {
|
|
4006
|
+
return this.exec("normalize_tlm", [e, t, s], {
|
|
3996
4007
|
type: r
|
|
3997
4008
|
});
|
|
3998
4009
|
}
|
|
@@ -4020,11 +4031,11 @@ class hi {
|
|
|
4020
4031
|
get_cmd_cnts(e) {
|
|
4021
4032
|
return this.exec("get_cmd_cnts", [e]);
|
|
4022
4033
|
}
|
|
4023
|
-
get_cmd_value(e, t,
|
|
4034
|
+
get_cmd_value(e, t, s, r = "CONVERTED") {
|
|
4024
4035
|
return this.exec("get_cmd_value", [
|
|
4025
4036
|
e,
|
|
4026
4037
|
t,
|
|
4027
|
-
|
|
4038
|
+
s,
|
|
4028
4039
|
r
|
|
4029
4040
|
]);
|
|
4030
4041
|
}
|
|
@@ -4032,81 +4043,81 @@ class hi {
|
|
|
4032
4043
|
return this.exec("get_cmd_buffer", [e, t]);
|
|
4033
4044
|
}
|
|
4034
4045
|
// Implementation of functionality shared by cmd methods with param_lists.
|
|
4035
|
-
_cmd(e, t,
|
|
4046
|
+
_cmd(e, t, s, r, i) {
|
|
4036
4047
|
let o = null;
|
|
4037
4048
|
for (let c in r)
|
|
4038
4049
|
Object.prototype.hasOwnProperty.call(r, c) && (o = this.encode_openc3_type(r[c]), o !== null && (r[c] = o));
|
|
4039
4050
|
return this.exec(
|
|
4040
4051
|
e,
|
|
4041
|
-
[t,
|
|
4052
|
+
[t, s, r],
|
|
4042
4053
|
{},
|
|
4043
4054
|
i
|
|
4044
4055
|
);
|
|
4045
4056
|
}
|
|
4046
|
-
get_cmd_hazardous(e, t,
|
|
4057
|
+
get_cmd_hazardous(e, t, s, r = {}) {
|
|
4047
4058
|
return t === void 0 ? this.exec("get_cmd_hazardous", e, {}, r) : this._cmd(
|
|
4048
4059
|
"get_cmd_hazardous",
|
|
4049
4060
|
e,
|
|
4050
4061
|
t,
|
|
4051
|
-
|
|
4062
|
+
s,
|
|
4052
4063
|
r
|
|
4053
4064
|
);
|
|
4054
4065
|
}
|
|
4055
|
-
cmd(e, t,
|
|
4066
|
+
cmd(e, t, s, r = {}) {
|
|
4056
4067
|
return t === void 0 ? this.exec("cmd", e, {}, r) : this._cmd(
|
|
4057
4068
|
"cmd",
|
|
4058
4069
|
e,
|
|
4059
4070
|
t,
|
|
4060
|
-
|
|
4071
|
+
s,
|
|
4061
4072
|
r
|
|
4062
4073
|
);
|
|
4063
4074
|
}
|
|
4064
|
-
cmd_no_range_check(e, t,
|
|
4075
|
+
cmd_no_range_check(e, t, s, r = {}) {
|
|
4065
4076
|
return t === void 0 ? this.exec("cmd_no_range_check", e, {}, r) : this._cmd(
|
|
4066
4077
|
"cmd_no_range_check",
|
|
4067
4078
|
e,
|
|
4068
4079
|
t,
|
|
4069
|
-
|
|
4080
|
+
s,
|
|
4070
4081
|
r
|
|
4071
4082
|
);
|
|
4072
4083
|
}
|
|
4073
|
-
cmd_raw(e, t,
|
|
4084
|
+
cmd_raw(e, t, s, r = {}) {
|
|
4074
4085
|
return t === void 0 ? this.exec("cmd_raw", e, {}, r) : this._cmd(
|
|
4075
4086
|
"cmd_raw",
|
|
4076
4087
|
e,
|
|
4077
4088
|
t,
|
|
4078
|
-
|
|
4089
|
+
s,
|
|
4079
4090
|
r
|
|
4080
4091
|
);
|
|
4081
4092
|
}
|
|
4082
|
-
cmd_raw_no_range_check(e, t,
|
|
4093
|
+
cmd_raw_no_range_check(e, t, s, r = {}) {
|
|
4083
4094
|
return t === void 0 ? this.exec("cmd_raw_no_range_check", e, {}, r) : this._cmd(
|
|
4084
4095
|
"cmd_raw_no_range_check",
|
|
4085
4096
|
e,
|
|
4086
4097
|
t,
|
|
4087
|
-
|
|
4098
|
+
s,
|
|
4088
4099
|
r
|
|
4089
4100
|
);
|
|
4090
4101
|
}
|
|
4091
|
-
cmd_no_hazardous_check(e, t,
|
|
4102
|
+
cmd_no_hazardous_check(e, t, s, r = {}) {
|
|
4092
4103
|
return t === void 0 ? this.exec("cmd_no_hazardous_check", e, {}, r) : this._cmd(
|
|
4093
4104
|
"cmd_no_hazardous_check",
|
|
4094
4105
|
e,
|
|
4095
4106
|
t,
|
|
4096
|
-
|
|
4107
|
+
s,
|
|
4097
4108
|
r
|
|
4098
4109
|
);
|
|
4099
4110
|
}
|
|
4100
|
-
cmd_no_checks(e, t,
|
|
4111
|
+
cmd_no_checks(e, t, s, r = {}) {
|
|
4101
4112
|
return t === void 0 ? this.exec("cmd_no_checks", e, {}, r) : this._cmd(
|
|
4102
4113
|
"cmd_no_checks",
|
|
4103
4114
|
e,
|
|
4104
4115
|
t,
|
|
4105
|
-
|
|
4116
|
+
s,
|
|
4106
4117
|
r
|
|
4107
4118
|
);
|
|
4108
4119
|
}
|
|
4109
|
-
cmd_raw_no_hazardous_check(e, t,
|
|
4120
|
+
cmd_raw_no_hazardous_check(e, t, s, r = {}) {
|
|
4110
4121
|
return t === void 0 ? this.exec(
|
|
4111
4122
|
"cmd_raw_no_hazardous_check",
|
|
4112
4123
|
e,
|
|
@@ -4116,25 +4127,25 @@ class hi {
|
|
|
4116
4127
|
"cmd_raw_no_hazardous_check",
|
|
4117
4128
|
e,
|
|
4118
4129
|
t,
|
|
4119
|
-
|
|
4130
|
+
s,
|
|
4120
4131
|
r
|
|
4121
4132
|
);
|
|
4122
4133
|
}
|
|
4123
|
-
cmd_raw_no_checks(e, t,
|
|
4134
|
+
cmd_raw_no_checks(e, t, s, r = {}) {
|
|
4124
4135
|
return t === void 0 ? this.exec("cmd_raw_no_checks", e, {}, r) : this._cmd(
|
|
4125
4136
|
"cmd_raw_no_checks",
|
|
4126
4137
|
e,
|
|
4127
4138
|
t,
|
|
4128
|
-
|
|
4139
|
+
s,
|
|
4129
4140
|
r
|
|
4130
4141
|
);
|
|
4131
4142
|
}
|
|
4132
|
-
build_cmd(e, t,
|
|
4133
|
-
return t === void 0 ? this.exec("build_cmd", e) : this._cmd("build_cmd", e, t,
|
|
4143
|
+
build_cmd(e, t, s) {
|
|
4144
|
+
return t === void 0 ? this.exec("build_cmd", e) : this._cmd("build_cmd", e, t, s);
|
|
4134
4145
|
}
|
|
4135
4146
|
// DEPRECATED for build_cmd
|
|
4136
|
-
build_command(e, t,
|
|
4137
|
-
return t === void 0 ? this.exec("build_cmd", e) : this._cmd("build_cmd", e, t,
|
|
4147
|
+
build_command(e, t, s) {
|
|
4148
|
+
return t === void 0 ? this.exec("build_cmd", e) : this._cmd("build_cmd", e, t, s);
|
|
4138
4149
|
}
|
|
4139
4150
|
get_interface_names() {
|
|
4140
4151
|
return this.exec("get_interface_names", []);
|
|
@@ -4148,17 +4159,17 @@ class hi {
|
|
|
4148
4159
|
load_config(e, t) {
|
|
4149
4160
|
return this.exec("load_config", [e, t]);
|
|
4150
4161
|
}
|
|
4151
|
-
save_config(e, t,
|
|
4152
|
-
return this.exec("save_config", [e, t,
|
|
4162
|
+
save_config(e, t, s) {
|
|
4163
|
+
return this.exec("save_config", [e, t, s]);
|
|
4153
4164
|
}
|
|
4154
4165
|
delete_config(e, t) {
|
|
4155
4166
|
return this.exec("delete_config", [e, t]);
|
|
4156
4167
|
}
|
|
4157
|
-
enable_limits(e, t,
|
|
4158
|
-
return this.exec("enable_limits", [e, t,
|
|
4168
|
+
enable_limits(e, t, s) {
|
|
4169
|
+
return this.exec("enable_limits", [e, t, s]);
|
|
4159
4170
|
}
|
|
4160
|
-
disable_limits(e, t,
|
|
4161
|
-
return this.exec("disable_limits", [e, t,
|
|
4171
|
+
disable_limits(e, t, s) {
|
|
4172
|
+
return this.exec("disable_limits", [e, t, s]);
|
|
4162
4173
|
}
|
|
4163
4174
|
get_out_of_limits() {
|
|
4164
4175
|
return this.exec("get_out_of_limits", []);
|
|
@@ -4194,20 +4205,20 @@ class hi {
|
|
|
4194
4205
|
// TODO: Currently unused but seemed like a useful function
|
|
4195
4206
|
async hashString(e) {
|
|
4196
4207
|
if (window.isSecureContext) {
|
|
4197
|
-
const t = new TextEncoder().encode(e),
|
|
4208
|
+
const t = new TextEncoder().encode(e), s = await crypto.subtle.digest(
|
|
4198
4209
|
"SHA-256",
|
|
4199
4210
|
t
|
|
4200
|
-
), r = new Uint8Array(
|
|
4211
|
+
), r = new Uint8Array(s);
|
|
4201
4212
|
return Array.from(r).map((i) => i.toString(16).padStart(2, "0")).join("");
|
|
4202
4213
|
}
|
|
4203
4214
|
}
|
|
4204
4215
|
}
|
|
4205
4216
|
export {
|
|
4206
|
-
|
|
4207
|
-
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4217
|
+
li as Api,
|
|
4218
|
+
di as Cable,
|
|
4219
|
+
lt as ConfigParserError,
|
|
4220
|
+
fi as ConfigParserService,
|
|
4221
|
+
pi as OpenC3Api,
|
|
4222
|
+
De as axios
|
|
4212
4223
|
};
|
|
4213
4224
|
//# sourceMappingURL=services.js.map
|