wcz-test 7.0.2 → 7.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DialogsContext-8xfQ3X-k.js +285 -0
- package/dist/DialogsContext-8xfQ3X-k.js.map +1 -0
- package/dist/{DialogsHooks-BZUdpDVJ.js → DialogsHooks-BXfwbYWP.js} +14 -14
- package/dist/{DialogsHooks-BZUdpDVJ.js.map → DialogsHooks-BXfwbYWP.js.map} +1 -1
- package/dist/FileMeta-CDQ1BQUH.js +21 -0
- package/dist/FileMeta-CDQ1BQUH.js.map +1 -0
- package/dist/RouterListItemButton-DrW6M53Y.js +17 -0
- package/dist/{RouterListItemButton-C_jUvB6C.js.map → RouterListItemButton-DrW6M53Y.js.map} +1 -1
- package/dist/components.js +1158 -1132
- package/dist/components.js.map +1 -1
- package/dist/hooks.d.ts +3 -0
- package/dist/hooks.js +466 -421
- package/dist/hooks.js.map +1 -1
- package/dist/index-DchOf6FV.js +2756 -0
- package/dist/index-DchOf6FV.js.map +1 -0
- package/dist/{index-Y_pgyGkL.js → index-De6Lo0ff.js} +531 -603
- package/dist/index-De6Lo0ff.js.map +1 -0
- package/dist/index.js +830 -665
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +0 -3
- package/dist/models.js +2 -2
- package/dist/query.d.ts +8 -0
- package/dist/query.js +6 -0
- package/dist/query.js.map +1 -0
- package/dist/utils-Dttzp8un.js +10879 -0
- package/dist/utils-Dttzp8un.js.map +1 -0
- package/dist/utils.d.ts +3 -0
- package/dist/utils.js +271 -8
- package/dist/utils.js.map +1 -1
- package/dist/vite.js +53 -26
- package/dist/vite.js.map +1 -1
- package/package.json +6 -10
- package/dist/ApprovalStatus-lESbUD_x.js +0 -7
- package/dist/ApprovalStatus-lESbUD_x.js.map +0 -1
- package/dist/DialogsContext-CGAKEKKW.js +0 -546
- package/dist/DialogsContext-CGAKEKKW.js.map +0 -1
- package/dist/FileHooks-CstZ4QII.js +0 -2699
- package/dist/FileHooks-CstZ4QII.js.map +0 -1
- package/dist/FileMeta-Bzeo3ie9.js +0 -18
- package/dist/FileMeta-Bzeo3ie9.js.map +0 -1
- package/dist/GraphQueries-Bx0CzlWR.js +0 -28020
- package/dist/GraphQueries-Bx0CzlWR.js.map +0 -1
- package/dist/RouterListItemButton-C_jUvB6C.js +0 -18
- package/dist/auth.d.ts +0 -8
- package/dist/auth.js +0 -6
- package/dist/auth.js.map +0 -1
- package/dist/bun-sqlite-dialect-CZjbVcY_.js +0 -143
- package/dist/bun-sqlite-dialect-CZjbVcY_.js.map +0 -1
- package/dist/compiler-runtime-BNHg76kC.js +0 -37
- package/dist/compiler-runtime-BNHg76kC.js.map +0 -1
- package/dist/index-BT7qlAad.js +0 -159
- package/dist/index-BT7qlAad.js.map +0 -1
- package/dist/index-Biz5inV2.js +0 -268
- package/dist/index-Biz5inV2.js.map +0 -1
- package/dist/index-Phhmhd_m.js +0 -227
- package/dist/index-Phhmhd_m.js.map +0 -1
- package/dist/index-Y_pgyGkL.js.map +0 -1
- package/dist/node-sqlite-dialect-CSXFdUmA.js +0 -143
- package/dist/node-sqlite-dialect-CSXFdUmA.js.map +0 -1
- package/dist/queries.d.ts +0 -95
- package/dist/queries.js +0 -567
- package/dist/queries.js.map +0 -1
- package/dist/utils-araYIHAE.js +0 -81
- package/dist/utils-araYIHAE.js.map +0 -1
|
@@ -0,0 +1,2756 @@
|
|
|
1
|
+
import { QueryClient as Nt, mutationOptions as Q, queryOptions as $ } from "@tanstack/react-query";
|
|
2
|
+
import { a as De } from "./index-De6Lo0ff.js";
|
|
3
|
+
import V from "zod";
|
|
4
|
+
import { t as mt, i as vt, g as Ne } from "./utils-Dttzp8un.js";
|
|
5
|
+
import { A as Bt, a as Ht, F as gt } from "./FileMeta-CDQ1BQUH.js";
|
|
6
|
+
import "react";
|
|
7
|
+
var se = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
8
|
+
function bt(e) {
|
|
9
|
+
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
10
|
+
}
|
|
11
|
+
const ee = new Nt(), G = "approval", _t = mt(vt.VITE_APP_TITLE), J = De.create({
|
|
12
|
+
baseURL: "https://graph.microsoft.com/v1.0"
|
|
13
|
+
});
|
|
14
|
+
J.interceptors.request.use(async (e) => {
|
|
15
|
+
const t = await Ne("graph");
|
|
16
|
+
return e.headers.set("Authorization", `Bearer ${t}`), e;
|
|
17
|
+
});
|
|
18
|
+
V.object({
|
|
19
|
+
appName: V.string().min(1).max(255).default(_t).optional(),
|
|
20
|
+
status: Ht.optional(),
|
|
21
|
+
approverEmployeeId: V.string().min(1).max(20).optional(),
|
|
22
|
+
stepResult: Bt.optional()
|
|
23
|
+
});
|
|
24
|
+
const zt = {
|
|
25
|
+
approvals: (e) => {
|
|
26
|
+
const t = new URLSearchParams();
|
|
27
|
+
return t.append("applicationName", e?.appName ?? _t), e?.status && t.append("status", e.status.toString()), e?.approverEmployeeId && t.append("approverEmployeeId", e.approverEmployeeId), e?.stepResult && t.append("stepResult", e.stepResult.toString()), $({
|
|
28
|
+
queryKey: [G, e],
|
|
29
|
+
queryFn: ({
|
|
30
|
+
signal: r
|
|
31
|
+
}) => J.request({
|
|
32
|
+
url: `/${G}/Requests/Requests?${t.toString()}`,
|
|
33
|
+
method: "GET",
|
|
34
|
+
signal: r
|
|
35
|
+
}).then((n) => n.data)
|
|
36
|
+
});
|
|
37
|
+
},
|
|
38
|
+
approval: (e) => $({
|
|
39
|
+
queryKey: [G, e],
|
|
40
|
+
queryFn: ({
|
|
41
|
+
signal: t
|
|
42
|
+
}) => J.request({
|
|
43
|
+
url: `/${G}/Requests/${e}`,
|
|
44
|
+
method: "GET",
|
|
45
|
+
signal: t
|
|
46
|
+
}).then((r) => r.data)
|
|
47
|
+
}),
|
|
48
|
+
create: () => Q({
|
|
49
|
+
mutationFn: (e) => J.request({
|
|
50
|
+
url: `/${G}/Requests`,
|
|
51
|
+
method: "POST",
|
|
52
|
+
data: e
|
|
53
|
+
}).then((t) => t.data),
|
|
54
|
+
onSettled: () => ee.invalidateQueries({
|
|
55
|
+
queryKey: [G],
|
|
56
|
+
exact: !1
|
|
57
|
+
})
|
|
58
|
+
}),
|
|
59
|
+
approve: () => Q({
|
|
60
|
+
mutationFn: (e) => J.request({
|
|
61
|
+
url: `/${G}/Requests/${e.id}/single-approval`,
|
|
62
|
+
method: "POST",
|
|
63
|
+
data: e
|
|
64
|
+
}).then((t) => t.data),
|
|
65
|
+
onSettled: () => ee.invalidateQueries({
|
|
66
|
+
queryKey: [G],
|
|
67
|
+
exact: !1
|
|
68
|
+
})
|
|
69
|
+
}),
|
|
70
|
+
resubmit: () => Q({
|
|
71
|
+
mutationFn: (e) => J.request({
|
|
72
|
+
url: `/${G}/Requests/${e.id}/resubmit`,
|
|
73
|
+
method: "POST",
|
|
74
|
+
data: e
|
|
75
|
+
}).then((t) => t.data),
|
|
76
|
+
onSettled: () => ee.invalidateQueries({
|
|
77
|
+
queryKey: [G],
|
|
78
|
+
exact: !1
|
|
79
|
+
})
|
|
80
|
+
}),
|
|
81
|
+
withdraw: () => Q({
|
|
82
|
+
mutationFn: (e) => J.request({
|
|
83
|
+
url: `/${G}/Requests/${e.id}/withdraw`,
|
|
84
|
+
method: "POST",
|
|
85
|
+
data: e
|
|
86
|
+
}).then((t) => t.data),
|
|
87
|
+
onSettled: () => ee.invalidateQueries({
|
|
88
|
+
queryKey: [G],
|
|
89
|
+
exact: !1
|
|
90
|
+
})
|
|
91
|
+
}),
|
|
92
|
+
cancel: () => Q({
|
|
93
|
+
mutationFn: (e) => J.request({
|
|
94
|
+
url: `/${G}/Requests/${e.id}/cancel`,
|
|
95
|
+
method: "POST",
|
|
96
|
+
data: e
|
|
97
|
+
}).then((t) => t.data),
|
|
98
|
+
onSettled: () => ee.invalidateQueries({
|
|
99
|
+
queryKey: [G],
|
|
100
|
+
exact: !1
|
|
101
|
+
})
|
|
102
|
+
})
|
|
103
|
+
};
|
|
104
|
+
var Ee = { exports: {} }, Gt = Ee.exports, Me;
|
|
105
|
+
function Kt() {
|
|
106
|
+
return Me || (Me = 1, (function(e, t) {
|
|
107
|
+
(function(r, n) {
|
|
108
|
+
n();
|
|
109
|
+
})(Gt, function() {
|
|
110
|
+
function r(f, _) {
|
|
111
|
+
return typeof _ > "u" ? _ = { autoBom: !1 } : typeof _ != "object" && (console.warn("Deprecated: Expected third argument to be a object"), _ = { autoBom: !_ }), _.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(f.type) ? new Blob(["\uFEFF", f], { type: f.type }) : f;
|
|
112
|
+
}
|
|
113
|
+
function n(f, _, O) {
|
|
114
|
+
var U = new XMLHttpRequest();
|
|
115
|
+
U.open("GET", f), U.responseType = "blob", U.onload = function() {
|
|
116
|
+
p(U.response, _, O);
|
|
117
|
+
}, U.onerror = function() {
|
|
118
|
+
console.error("could not download file");
|
|
119
|
+
}, U.send();
|
|
120
|
+
}
|
|
121
|
+
function i(f) {
|
|
122
|
+
var _ = new XMLHttpRequest();
|
|
123
|
+
_.open("HEAD", f, !1);
|
|
124
|
+
try {
|
|
125
|
+
_.send();
|
|
126
|
+
} catch {
|
|
127
|
+
}
|
|
128
|
+
return 200 <= _.status && 299 >= _.status;
|
|
129
|
+
}
|
|
130
|
+
function s(f) {
|
|
131
|
+
try {
|
|
132
|
+
f.dispatchEvent(new MouseEvent("click"));
|
|
133
|
+
} catch {
|
|
134
|
+
var _ = document.createEvent("MouseEvents");
|
|
135
|
+
_.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), f.dispatchEvent(_);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
var l = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof se == "object" && se.global === se ? se : void 0, b = l.navigator && /Macintosh/.test(navigator.userAgent) && /AppleWebKit/.test(navigator.userAgent) && !/Safari/.test(navigator.userAgent), p = l.saveAs || (typeof window != "object" || window !== l ? function() {
|
|
139
|
+
} : "download" in HTMLAnchorElement.prototype && !b ? function(f, _, O) {
|
|
140
|
+
var U = l.URL || l.webkitURL, A = document.createElement("a");
|
|
141
|
+
_ = _ || f.name || "download", A.download = _, A.rel = "noopener", typeof f == "string" ? (A.href = f, A.origin === location.origin ? s(A) : i(A.href) ? n(f, _, O) : s(A, A.target = "_blank")) : (A.href = U.createObjectURL(f), setTimeout(function() {
|
|
142
|
+
U.revokeObjectURL(A.href);
|
|
143
|
+
}, 4e4), setTimeout(function() {
|
|
144
|
+
s(A);
|
|
145
|
+
}, 0));
|
|
146
|
+
} : "msSaveOrOpenBlob" in navigator ? function(f, _, O) {
|
|
147
|
+
if (_ = _ || f.name || "download", typeof f != "string") navigator.msSaveOrOpenBlob(r(f, O), _);
|
|
148
|
+
else if (i(f)) n(f, _, O);
|
|
149
|
+
else {
|
|
150
|
+
var U = document.createElement("a");
|
|
151
|
+
U.href = f, U.target = "_blank", setTimeout(function() {
|
|
152
|
+
s(U);
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
} : function(f, _, O, U) {
|
|
156
|
+
if (U = U || open("", "_blank"), U && (U.document.title = U.document.body.innerText = "downloading..."), typeof f == "string") return n(f, _, O);
|
|
157
|
+
var A = f.type === "application/octet-stream", W = /constructor/i.test(l.HTMLElement) || l.safari, L = /CriOS\/[\d]+/.test(navigator.userAgent);
|
|
158
|
+
if ((L || A && W || b) && typeof FileReader < "u") {
|
|
159
|
+
var q = new FileReader();
|
|
160
|
+
q.onloadend = function() {
|
|
161
|
+
var d = q.result;
|
|
162
|
+
d = L ? d : d.replace(/^data:[^;]*;/, "data:attachment/file;"), U ? U.location.href = d : location = d, U = null;
|
|
163
|
+
}, q.readAsDataURL(f);
|
|
164
|
+
} else {
|
|
165
|
+
var H = l.URL || l.webkitURL, m = H.createObjectURL(f);
|
|
166
|
+
U ? U.location = m : location.href = m, U = null, setTimeout(function() {
|
|
167
|
+
H.revokeObjectURL(m);
|
|
168
|
+
}, 4e4);
|
|
169
|
+
}
|
|
170
|
+
});
|
|
171
|
+
l.saveAs = p.saveAs = p, e.exports = p;
|
|
172
|
+
});
|
|
173
|
+
})(Ee)), Ee.exports;
|
|
174
|
+
}
|
|
175
|
+
var Mt = Kt();
|
|
176
|
+
const Wt = /* @__PURE__ */ bt(Mt);
|
|
177
|
+
function ke(e) {
|
|
178
|
+
"@babel/helpers - typeof";
|
|
179
|
+
return ke = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
180
|
+
return typeof t;
|
|
181
|
+
} : function(t) {
|
|
182
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
183
|
+
}, ke(e);
|
|
184
|
+
}
|
|
185
|
+
function Yt(e, t, r) {
|
|
186
|
+
return Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
187
|
+
}
|
|
188
|
+
function Qt(e, t) {
|
|
189
|
+
if (!(e instanceof t))
|
|
190
|
+
throw new TypeError("Cannot call a class as a function");
|
|
191
|
+
}
|
|
192
|
+
function Vt(e, t, r) {
|
|
193
|
+
return t = de(t), Xt(e, Be() ? Reflect.construct(t, r || [], de(e).constructor) : t.apply(e, r));
|
|
194
|
+
}
|
|
195
|
+
function Xt(e, t) {
|
|
196
|
+
if (t && (ke(t) === "object" || typeof t == "function"))
|
|
197
|
+
return t;
|
|
198
|
+
if (t !== void 0)
|
|
199
|
+
throw new TypeError("Derived constructors may only return object or undefined");
|
|
200
|
+
return Zt(e);
|
|
201
|
+
}
|
|
202
|
+
function Zt(e) {
|
|
203
|
+
if (e === void 0)
|
|
204
|
+
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
205
|
+
return e;
|
|
206
|
+
}
|
|
207
|
+
function Jt(e, t) {
|
|
208
|
+
if (typeof t != "function" && t !== null)
|
|
209
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
210
|
+
e.prototype = Object.create(t && t.prototype, { constructor: { value: e, writable: !0, configurable: !0 } }), Object.defineProperty(e, "prototype", { writable: !1 }), t && he(e, t);
|
|
211
|
+
}
|
|
212
|
+
function je(e) {
|
|
213
|
+
var t = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
|
|
214
|
+
return je = function(n) {
|
|
215
|
+
if (n === null || !tr(n)) return n;
|
|
216
|
+
if (typeof n != "function")
|
|
217
|
+
throw new TypeError("Super expression must either be null or a function");
|
|
218
|
+
if (typeof t < "u") {
|
|
219
|
+
if (t.has(n)) return t.get(n);
|
|
220
|
+
t.set(n, i);
|
|
221
|
+
}
|
|
222
|
+
function i() {
|
|
223
|
+
return er(n, arguments, de(this).constructor);
|
|
224
|
+
}
|
|
225
|
+
return i.prototype = Object.create(n.prototype, { constructor: { value: i, enumerable: !1, writable: !0, configurable: !0 } }), he(i, n);
|
|
226
|
+
}, je(e);
|
|
227
|
+
}
|
|
228
|
+
function er(e, t, r) {
|
|
229
|
+
if (Be()) return Reflect.construct.apply(null, arguments);
|
|
230
|
+
var n = [null];
|
|
231
|
+
n.push.apply(n, t);
|
|
232
|
+
var i = new (e.bind.apply(e, n))();
|
|
233
|
+
return r && he(i, r.prototype), i;
|
|
234
|
+
}
|
|
235
|
+
function Be() {
|
|
236
|
+
try {
|
|
237
|
+
var e = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {
|
|
238
|
+
}));
|
|
239
|
+
} catch {
|
|
240
|
+
}
|
|
241
|
+
return (Be = function() {
|
|
242
|
+
return !!e;
|
|
243
|
+
})();
|
|
244
|
+
}
|
|
245
|
+
function tr(e) {
|
|
246
|
+
try {
|
|
247
|
+
return Function.toString.call(e).indexOf("[native code]") !== -1;
|
|
248
|
+
} catch {
|
|
249
|
+
return typeof e == "function";
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
function he(e, t) {
|
|
253
|
+
return he = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(n, i) {
|
|
254
|
+
return n.__proto__ = i, n;
|
|
255
|
+
}, he(e, t);
|
|
256
|
+
}
|
|
257
|
+
function de(e) {
|
|
258
|
+
return de = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(r) {
|
|
259
|
+
return r.__proto__ || Object.getPrototypeOf(r);
|
|
260
|
+
}, de(e);
|
|
261
|
+
}
|
|
262
|
+
var we = /* @__PURE__ */ (function(e) {
|
|
263
|
+
function t(r) {
|
|
264
|
+
var n, i = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null, s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null, l = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : null;
|
|
265
|
+
if (Qt(this, t), n = Vt(this, t, [r]), n.originalRequest = s, n.originalResponse = l, n.causingError = i, i != null && (r += ", caused by ".concat(i.toString())), s != null) {
|
|
266
|
+
var b = s.getHeader("X-Request-ID") || "n/a", p = s.getMethod(), f = s.getURL(), _ = l ? l.getStatus() : "n/a", O = l ? l.getBody() || "" : "n/a";
|
|
267
|
+
r += ", originated from request (method: ".concat(p, ", url: ").concat(f, ", response code: ").concat(_, ", response text: ").concat(O, ", request id: ").concat(b, ")");
|
|
268
|
+
}
|
|
269
|
+
return n.message = r, n;
|
|
270
|
+
}
|
|
271
|
+
return Jt(t, e), Yt(t);
|
|
272
|
+
})(/* @__PURE__ */ je(Error));
|
|
273
|
+
function ye(e) {
|
|
274
|
+
"@babel/helpers - typeof";
|
|
275
|
+
return ye = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
276
|
+
return typeof t;
|
|
277
|
+
} : function(t) {
|
|
278
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
279
|
+
}, ye(e);
|
|
280
|
+
}
|
|
281
|
+
function rr(e, t) {
|
|
282
|
+
if (!(e instanceof t))
|
|
283
|
+
throw new TypeError("Cannot call a class as a function");
|
|
284
|
+
}
|
|
285
|
+
function nr(e, t) {
|
|
286
|
+
for (var r = 0; r < t.length; r++) {
|
|
287
|
+
var n = t[r];
|
|
288
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, ar(n.key), n);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
function or(e, t, r) {
|
|
292
|
+
return t && nr(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
293
|
+
}
|
|
294
|
+
function ar(e) {
|
|
295
|
+
var t = ir(e, "string");
|
|
296
|
+
return ye(t) == "symbol" ? t : t + "";
|
|
297
|
+
}
|
|
298
|
+
function ir(e, t) {
|
|
299
|
+
if (ye(e) != "object" || !e) return e;
|
|
300
|
+
var r = e[Symbol.toPrimitive];
|
|
301
|
+
if (r !== void 0) {
|
|
302
|
+
var n = r.call(e, t);
|
|
303
|
+
if (ye(n) != "object") return n;
|
|
304
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
305
|
+
}
|
|
306
|
+
return String(e);
|
|
307
|
+
}
|
|
308
|
+
var ur = /* @__PURE__ */ (function() {
|
|
309
|
+
function e() {
|
|
310
|
+
rr(this, e);
|
|
311
|
+
}
|
|
312
|
+
return or(e, [{
|
|
313
|
+
key: "listAllUploads",
|
|
314
|
+
value: function() {
|
|
315
|
+
return Promise.resolve([]);
|
|
316
|
+
}
|
|
317
|
+
}, {
|
|
318
|
+
key: "findUploadsByFingerprint",
|
|
319
|
+
value: function(r) {
|
|
320
|
+
return Promise.resolve([]);
|
|
321
|
+
}
|
|
322
|
+
}, {
|
|
323
|
+
key: "removeUpload",
|
|
324
|
+
value: function(r) {
|
|
325
|
+
return Promise.resolve();
|
|
326
|
+
}
|
|
327
|
+
}, {
|
|
328
|
+
key: "addUpload",
|
|
329
|
+
value: function(r, n) {
|
|
330
|
+
return Promise.resolve(null);
|
|
331
|
+
}
|
|
332
|
+
}]);
|
|
333
|
+
})();
|
|
334
|
+
const wt = "3.7.8", sr = wt, fe = typeof Buffer == "function", We = typeof TextDecoder == "function" ? new TextDecoder() : void 0, Ye = typeof TextEncoder == "function" ? new TextEncoder() : void 0, lr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", ce = Array.prototype.slice.call(lr), Se = ((e) => {
|
|
335
|
+
let t = {};
|
|
336
|
+
return e.forEach((r, n) => t[r] = n), t;
|
|
337
|
+
})(ce), fr = /^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/, I = String.fromCharCode.bind(String), Qe = typeof Uint8Array.from == "function" ? Uint8Array.from.bind(Uint8Array) : (e) => new Uint8Array(Array.prototype.slice.call(e, 0)), St = (e) => e.replace(/=/g, "").replace(/[+\/]/g, (t) => t == "+" ? "-" : "_"), Ut = (e) => e.replace(/[^A-Za-z0-9\+\/]/g, ""), Et = (e) => {
|
|
338
|
+
let t, r, n, i, s = "";
|
|
339
|
+
const l = e.length % 3;
|
|
340
|
+
for (let b = 0; b < e.length; ) {
|
|
341
|
+
if ((r = e.charCodeAt(b++)) > 255 || (n = e.charCodeAt(b++)) > 255 || (i = e.charCodeAt(b++)) > 255)
|
|
342
|
+
throw new TypeError("invalid character found");
|
|
343
|
+
t = r << 16 | n << 8 | i, s += ce[t >> 18 & 63] + ce[t >> 12 & 63] + ce[t >> 6 & 63] + ce[t & 63];
|
|
344
|
+
}
|
|
345
|
+
return l ? s.slice(0, l - 3) + "===".substring(l) : s;
|
|
346
|
+
}, He = typeof btoa == "function" ? (e) => btoa(e) : fe ? (e) => Buffer.from(e, "binary").toString("base64") : Et, Fe = fe ? (e) => Buffer.from(e).toString("base64") : (e) => {
|
|
347
|
+
let r = [];
|
|
348
|
+
for (let n = 0, i = e.length; n < i; n += 4096)
|
|
349
|
+
r.push(I.apply(null, e.subarray(n, n + 4096)));
|
|
350
|
+
return He(r.join(""));
|
|
351
|
+
}, xe = (e, t = !1) => t ? St(Fe(e)) : Fe(e), cr = (e) => {
|
|
352
|
+
if (e.length < 2) {
|
|
353
|
+
var t = e.charCodeAt(0);
|
|
354
|
+
return t < 128 ? e : t < 2048 ? I(192 | t >>> 6) + I(128 | t & 63) : I(224 | t >>> 12 & 15) + I(128 | t >>> 6 & 63) + I(128 | t & 63);
|
|
355
|
+
} else {
|
|
356
|
+
var t = 65536 + (e.charCodeAt(0) - 55296) * 1024 + (e.charCodeAt(1) - 56320);
|
|
357
|
+
return I(240 | t >>> 18 & 7) + I(128 | t >>> 12 & 63) + I(128 | t >>> 6 & 63) + I(128 | t & 63);
|
|
358
|
+
}
|
|
359
|
+
}, pr = /[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g, xt = (e) => e.replace(pr, cr), Ve = fe ? (e) => Buffer.from(e, "utf8").toString("base64") : Ye ? (e) => Fe(Ye.encode(e)) : (e) => He(xt(e)), le = (e, t = !1) => t ? St(Ve(e)) : Ve(e), Xe = (e) => le(e, !0), hr = /[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g, dr = (e) => {
|
|
360
|
+
switch (e.length) {
|
|
361
|
+
case 4:
|
|
362
|
+
var t = (7 & e.charCodeAt(0)) << 18 | (63 & e.charCodeAt(1)) << 12 | (63 & e.charCodeAt(2)) << 6 | 63 & e.charCodeAt(3), r = t - 65536;
|
|
363
|
+
return I((r >>> 10) + 55296) + I((r & 1023) + 56320);
|
|
364
|
+
case 3:
|
|
365
|
+
return I((15 & e.charCodeAt(0)) << 12 | (63 & e.charCodeAt(1)) << 6 | 63 & e.charCodeAt(2));
|
|
366
|
+
default:
|
|
367
|
+
return I((31 & e.charCodeAt(0)) << 6 | 63 & e.charCodeAt(1));
|
|
368
|
+
}
|
|
369
|
+
}, Pt = (e) => e.replace(hr, dr), Ot = (e) => {
|
|
370
|
+
if (e = e.replace(/\s+/g, ""), !fr.test(e))
|
|
371
|
+
throw new TypeError("malformed base64.");
|
|
372
|
+
e += "==".slice(2 - (e.length & 3));
|
|
373
|
+
let t, r, n, i = [];
|
|
374
|
+
for (let s = 0; s < e.length; )
|
|
375
|
+
t = Se[e.charAt(s++)] << 18 | Se[e.charAt(s++)] << 12 | (r = Se[e.charAt(s++)]) << 6 | (n = Se[e.charAt(s++)]), r === 64 ? i.push(I(t >> 16 & 255)) : n === 64 ? i.push(I(t >> 16 & 255, t >> 8 & 255)) : i.push(I(t >> 16 & 255, t >> 8 & 255, t & 255));
|
|
376
|
+
return i.join("");
|
|
377
|
+
}, ze = typeof atob == "function" ? (e) => atob(Ut(e)) : fe ? (e) => Buffer.from(e, "base64").toString("binary") : Ot, Rt = fe ? (e) => Qe(Buffer.from(e, "base64")) : (e) => Qe(ze(e).split("").map((t) => t.charCodeAt(0))), Tt = (e) => Rt(qt(e)), yr = fe ? (e) => Buffer.from(e, "base64").toString("utf8") : We ? (e) => We.decode(Rt(e)) : (e) => Pt(ze(e)), qt = (e) => Ut(e.replace(/[-_]/g, (t) => t == "-" ? "+" : "/")), Le = (e) => yr(qt(e)), mr = (e) => {
|
|
378
|
+
if (typeof e != "string")
|
|
379
|
+
return !1;
|
|
380
|
+
const t = e.replace(/\s+/g, "").replace(/={0,2}$/, "");
|
|
381
|
+
return !/[^\s0-9a-zA-Z\+/]/.test(t) || !/[^\s0-9a-zA-Z\-_]/.test(t);
|
|
382
|
+
}, kt = (e) => ({
|
|
383
|
+
value: e,
|
|
384
|
+
enumerable: !1,
|
|
385
|
+
writable: !0,
|
|
386
|
+
configurable: !0
|
|
387
|
+
}), jt = function() {
|
|
388
|
+
const e = (t, r) => Object.defineProperty(String.prototype, t, kt(r));
|
|
389
|
+
e("fromBase64", function() {
|
|
390
|
+
return Le(this);
|
|
391
|
+
}), e("toBase64", function(t) {
|
|
392
|
+
return le(this, t);
|
|
393
|
+
}), e("toBase64URI", function() {
|
|
394
|
+
return le(this, !0);
|
|
395
|
+
}), e("toBase64URL", function() {
|
|
396
|
+
return le(this, !0);
|
|
397
|
+
}), e("toUint8Array", function() {
|
|
398
|
+
return Tt(this);
|
|
399
|
+
});
|
|
400
|
+
}, Ft = function() {
|
|
401
|
+
const e = (t, r) => Object.defineProperty(Uint8Array.prototype, t, kt(r));
|
|
402
|
+
e("toBase64", function(t) {
|
|
403
|
+
return xe(this, t);
|
|
404
|
+
}), e("toBase64URI", function() {
|
|
405
|
+
return xe(this, !0);
|
|
406
|
+
}), e("toBase64URL", function() {
|
|
407
|
+
return xe(this, !0);
|
|
408
|
+
});
|
|
409
|
+
}, vr = () => {
|
|
410
|
+
jt(), Ft();
|
|
411
|
+
}, gr = {
|
|
412
|
+
version: wt,
|
|
413
|
+
VERSION: sr,
|
|
414
|
+
atob: ze,
|
|
415
|
+
atobPolyfill: Ot,
|
|
416
|
+
btoa: He,
|
|
417
|
+
btoaPolyfill: Et,
|
|
418
|
+
fromBase64: Le,
|
|
419
|
+
toBase64: le,
|
|
420
|
+
encode: le,
|
|
421
|
+
encodeURI: Xe,
|
|
422
|
+
encodeURL: Xe,
|
|
423
|
+
utob: xt,
|
|
424
|
+
btou: Pt,
|
|
425
|
+
decode: Le,
|
|
426
|
+
isValid: mr,
|
|
427
|
+
fromUint8Array: xe,
|
|
428
|
+
toUint8Array: Tt,
|
|
429
|
+
extendString: jt,
|
|
430
|
+
extendUint8Array: Ft,
|
|
431
|
+
extendBuiltins: vr
|
|
432
|
+
};
|
|
433
|
+
var Re, Ze;
|
|
434
|
+
function br() {
|
|
435
|
+
return Ze || (Ze = 1, Re = function(t, r) {
|
|
436
|
+
if (r = r.split(":")[0], t = +t, !t) return !1;
|
|
437
|
+
switch (r) {
|
|
438
|
+
case "http":
|
|
439
|
+
case "ws":
|
|
440
|
+
return t !== 80;
|
|
441
|
+
case "https":
|
|
442
|
+
case "wss":
|
|
443
|
+
return t !== 443;
|
|
444
|
+
case "ftp":
|
|
445
|
+
return t !== 21;
|
|
446
|
+
case "gopher":
|
|
447
|
+
return t !== 70;
|
|
448
|
+
case "file":
|
|
449
|
+
return !1;
|
|
450
|
+
}
|
|
451
|
+
return t !== 0;
|
|
452
|
+
}), Re;
|
|
453
|
+
}
|
|
454
|
+
var Ue = {}, Je;
|
|
455
|
+
function _r() {
|
|
456
|
+
if (Je) return Ue;
|
|
457
|
+
Je = 1;
|
|
458
|
+
var e = Object.prototype.hasOwnProperty, t;
|
|
459
|
+
function r(l) {
|
|
460
|
+
try {
|
|
461
|
+
return decodeURIComponent(l.replace(/\+/g, " "));
|
|
462
|
+
} catch {
|
|
463
|
+
return null;
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
function n(l) {
|
|
467
|
+
try {
|
|
468
|
+
return encodeURIComponent(l);
|
|
469
|
+
} catch {
|
|
470
|
+
return null;
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
function i(l) {
|
|
474
|
+
for (var b = /([^=?#&]+)=?([^&]*)/g, p = {}, f; f = b.exec(l); ) {
|
|
475
|
+
var _ = r(f[1]), O = r(f[2]);
|
|
476
|
+
_ === null || O === null || _ in p || (p[_] = O);
|
|
477
|
+
}
|
|
478
|
+
return p;
|
|
479
|
+
}
|
|
480
|
+
function s(l, b) {
|
|
481
|
+
b = b || "";
|
|
482
|
+
var p = [], f, _;
|
|
483
|
+
typeof b != "string" && (b = "?");
|
|
484
|
+
for (_ in l)
|
|
485
|
+
if (e.call(l, _)) {
|
|
486
|
+
if (f = l[_], !f && (f === null || f === t || isNaN(f)) && (f = ""), _ = n(_), f = n(f), _ === null || f === null) continue;
|
|
487
|
+
p.push(_ + "=" + f);
|
|
488
|
+
}
|
|
489
|
+
return p.length ? b + p.join("&") : "";
|
|
490
|
+
}
|
|
491
|
+
return Ue.stringify = s, Ue.parse = i, Ue;
|
|
492
|
+
}
|
|
493
|
+
var Te, et;
|
|
494
|
+
function wr() {
|
|
495
|
+
if (et) return Te;
|
|
496
|
+
et = 1;
|
|
497
|
+
var e = br(), t = _r(), r = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/, n = /[\n\r\t]/g, i = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//, s = /:\d+$/, l = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i, b = /^[a-zA-Z]:/;
|
|
498
|
+
function p(m) {
|
|
499
|
+
return (m || "").toString().replace(r, "");
|
|
500
|
+
}
|
|
501
|
+
var f = [
|
|
502
|
+
["#", "hash"],
|
|
503
|
+
// Extract from the back.
|
|
504
|
+
["?", "query"],
|
|
505
|
+
// Extract from the back.
|
|
506
|
+
function(d, g) {
|
|
507
|
+
return U(g.protocol) ? d.replace(/\\/g, "/") : d;
|
|
508
|
+
},
|
|
509
|
+
["/", "pathname"],
|
|
510
|
+
// Extract from the back.
|
|
511
|
+
["@", "auth", 1],
|
|
512
|
+
// Extract from the front.
|
|
513
|
+
[NaN, "host", void 0, 1, 1],
|
|
514
|
+
// Set left over value.
|
|
515
|
+
[/:(\d*)$/, "port", void 0, 1],
|
|
516
|
+
// RegExp the back.
|
|
517
|
+
[NaN, "hostname", void 0, 1, 1]
|
|
518
|
+
// Set left over.
|
|
519
|
+
], _ = { hash: 1, query: 1 };
|
|
520
|
+
function O(m) {
|
|
521
|
+
var d;
|
|
522
|
+
typeof window < "u" ? d = window : typeof se < "u" ? d = se : typeof self < "u" ? d = self : d = {};
|
|
523
|
+
var g = d.location || {};
|
|
524
|
+
m = m || g;
|
|
525
|
+
var y = {}, x = typeof m, S;
|
|
526
|
+
if (m.protocol === "blob:")
|
|
527
|
+
y = new L(unescape(m.pathname), {});
|
|
528
|
+
else if (x === "string") {
|
|
529
|
+
y = new L(m, {});
|
|
530
|
+
for (S in _) delete y[S];
|
|
531
|
+
} else if (x === "object") {
|
|
532
|
+
for (S in m)
|
|
533
|
+
S in _ || (y[S] = m[S]);
|
|
534
|
+
y.slashes === void 0 && (y.slashes = i.test(m.href));
|
|
535
|
+
}
|
|
536
|
+
return y;
|
|
537
|
+
}
|
|
538
|
+
function U(m) {
|
|
539
|
+
return m === "file:" || m === "ftp:" || m === "http:" || m === "https:" || m === "ws:" || m === "wss:";
|
|
540
|
+
}
|
|
541
|
+
function A(m, d) {
|
|
542
|
+
m = p(m), m = m.replace(n, ""), d = d || {};
|
|
543
|
+
var g = l.exec(m), y = g[1] ? g[1].toLowerCase() : "", x = !!g[2], S = !!g[3], T = 0, P;
|
|
544
|
+
return x ? S ? (P = g[2] + g[3] + g[4], T = g[2].length + g[3].length) : (P = g[2] + g[4], T = g[2].length) : S ? (P = g[3] + g[4], T = g[3].length) : P = g[4], y === "file:" ? T >= 2 && (P = P.slice(2)) : U(y) ? P = g[4] : y ? x && (P = P.slice(2)) : T >= 2 && U(d.protocol) && (P = g[4]), {
|
|
545
|
+
protocol: y,
|
|
546
|
+
slashes: x || U(y),
|
|
547
|
+
slashesCount: T,
|
|
548
|
+
rest: P
|
|
549
|
+
};
|
|
550
|
+
}
|
|
551
|
+
function W(m, d) {
|
|
552
|
+
if (m === "") return d;
|
|
553
|
+
for (var g = (d || "/").split("/").slice(0, -1).concat(m.split("/")), y = g.length, x = g[y - 1], S = !1, T = 0; y--; )
|
|
554
|
+
g[y] === "." ? g.splice(y, 1) : g[y] === ".." ? (g.splice(y, 1), T++) : T && (y === 0 && (S = !0), g.splice(y, 1), T--);
|
|
555
|
+
return S && g.unshift(""), (x === "." || x === "..") && g.push(""), g.join("/");
|
|
556
|
+
}
|
|
557
|
+
function L(m, d, g) {
|
|
558
|
+
if (m = p(m), m = m.replace(n, ""), !(this instanceof L))
|
|
559
|
+
return new L(m, d, g);
|
|
560
|
+
var y, x, S, T, P, z, X = f.slice(), oe = typeof d, w = this, Y = 0;
|
|
561
|
+
for (oe !== "object" && oe !== "string" && (g = d, d = null), g && typeof g != "function" && (g = t.parse), d = O(d), x = A(m || "", d), y = !x.protocol && !x.slashes, w.slashes = x.slashes || y && d.slashes, w.protocol = x.protocol || d.protocol || "", m = x.rest, (x.protocol === "file:" && (x.slashesCount !== 2 || b.test(m)) || !x.slashes && (x.protocol || x.slashesCount < 2 || !U(w.protocol))) && (X[3] = [/(.*)/, "pathname"]); Y < X.length; Y++) {
|
|
562
|
+
if (T = X[Y], typeof T == "function") {
|
|
563
|
+
m = T(m, w);
|
|
564
|
+
continue;
|
|
565
|
+
}
|
|
566
|
+
S = T[0], z = T[1], S !== S ? w[z] = m : typeof S == "string" ? (P = S === "@" ? m.lastIndexOf(S) : m.indexOf(S), ~P && (typeof T[2] == "number" ? (w[z] = m.slice(0, P), m = m.slice(P + T[2])) : (w[z] = m.slice(P), m = m.slice(0, P)))) : (P = S.exec(m)) && (w[z] = P[1], m = m.slice(0, P.index)), w[z] = w[z] || y && T[3] && d[z] || "", T[4] && (w[z] = w[z].toLowerCase());
|
|
567
|
+
}
|
|
568
|
+
g && (w.query = g(w.query)), y && d.slashes && w.pathname.charAt(0) !== "/" && (w.pathname !== "" || d.pathname !== "") && (w.pathname = W(w.pathname, d.pathname)), w.pathname.charAt(0) !== "/" && U(w.protocol) && (w.pathname = "/" + w.pathname), e(w.port, w.protocol) || (w.host = w.hostname, w.port = ""), w.username = w.password = "", w.auth && (P = w.auth.indexOf(":"), ~P ? (w.username = w.auth.slice(0, P), w.username = encodeURIComponent(decodeURIComponent(w.username)), w.password = w.auth.slice(P + 1), w.password = encodeURIComponent(decodeURIComponent(w.password))) : w.username = encodeURIComponent(decodeURIComponent(w.auth)), w.auth = w.password ? w.username + ":" + w.password : w.username), w.origin = w.protocol !== "file:" && U(w.protocol) && w.host ? w.protocol + "//" + w.host : "null", w.href = w.toString();
|
|
569
|
+
}
|
|
570
|
+
function q(m, d, g) {
|
|
571
|
+
var y = this;
|
|
572
|
+
switch (m) {
|
|
573
|
+
case "query":
|
|
574
|
+
typeof d == "string" && d.length && (d = (g || t.parse)(d)), y[m] = d;
|
|
575
|
+
break;
|
|
576
|
+
case "port":
|
|
577
|
+
y[m] = d, e(d, y.protocol) ? d && (y.host = y.hostname + ":" + d) : (y.host = y.hostname, y[m] = "");
|
|
578
|
+
break;
|
|
579
|
+
case "hostname":
|
|
580
|
+
y[m] = d, y.port && (d += ":" + y.port), y.host = d;
|
|
581
|
+
break;
|
|
582
|
+
case "host":
|
|
583
|
+
y[m] = d, s.test(d) ? (d = d.split(":"), y.port = d.pop(), y.hostname = d.join(":")) : (y.hostname = d, y.port = "");
|
|
584
|
+
break;
|
|
585
|
+
case "protocol":
|
|
586
|
+
y.protocol = d.toLowerCase(), y.slashes = !g;
|
|
587
|
+
break;
|
|
588
|
+
case "pathname":
|
|
589
|
+
case "hash":
|
|
590
|
+
if (d) {
|
|
591
|
+
var x = m === "pathname" ? "/" : "#";
|
|
592
|
+
y[m] = d.charAt(0) !== x ? x + d : d;
|
|
593
|
+
} else
|
|
594
|
+
y[m] = d;
|
|
595
|
+
break;
|
|
596
|
+
case "username":
|
|
597
|
+
case "password":
|
|
598
|
+
y[m] = encodeURIComponent(d);
|
|
599
|
+
break;
|
|
600
|
+
case "auth":
|
|
601
|
+
var S = d.indexOf(":");
|
|
602
|
+
~S ? (y.username = d.slice(0, S), y.username = encodeURIComponent(decodeURIComponent(y.username)), y.password = d.slice(S + 1), y.password = encodeURIComponent(decodeURIComponent(y.password))) : y.username = encodeURIComponent(decodeURIComponent(d));
|
|
603
|
+
}
|
|
604
|
+
for (var T = 0; T < f.length; T++) {
|
|
605
|
+
var P = f[T];
|
|
606
|
+
P[4] && (y[P[1]] = y[P[1]].toLowerCase());
|
|
607
|
+
}
|
|
608
|
+
return y.auth = y.password ? y.username + ":" + y.password : y.username, y.origin = y.protocol !== "file:" && U(y.protocol) && y.host ? y.protocol + "//" + y.host : "null", y.href = y.toString(), y;
|
|
609
|
+
}
|
|
610
|
+
function H(m) {
|
|
611
|
+
(!m || typeof m != "function") && (m = t.stringify);
|
|
612
|
+
var d, g = this, y = g.host, x = g.protocol;
|
|
613
|
+
x && x.charAt(x.length - 1) !== ":" && (x += ":");
|
|
614
|
+
var S = x + (g.protocol && g.slashes || U(g.protocol) ? "//" : "");
|
|
615
|
+
return g.username ? (S += g.username, g.password && (S += ":" + g.password), S += "@") : g.password ? (S += ":" + g.password, S += "@") : g.protocol !== "file:" && U(g.protocol) && !y && g.pathname !== "/" && (S += "@"), (y[y.length - 1] === ":" || s.test(g.hostname) && !g.port) && (y += ":"), S += y + g.pathname, d = typeof g.query == "object" ? m(g.query) : g.query, d && (S += d.charAt(0) !== "?" ? "?" + d : d), g.hash && (S += g.hash), S;
|
|
616
|
+
}
|
|
617
|
+
return L.prototype = { set: q, toString: H }, L.extractProtocol = A, L.location = O, L.trimLeft = p, L.qs = t, Te = L, Te;
|
|
618
|
+
}
|
|
619
|
+
var Sr = wr();
|
|
620
|
+
const Ur = /* @__PURE__ */ bt(Sr);
|
|
621
|
+
function Er() {
|
|
622
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) {
|
|
623
|
+
var t = Math.random() * 16 | 0, r = e === "x" ? t : t & 3 | 8;
|
|
624
|
+
return r.toString(16);
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
function Ae() {
|
|
628
|
+
Ae = function() {
|
|
629
|
+
return t;
|
|
630
|
+
};
|
|
631
|
+
var e, t = {}, r = Object.prototype, n = r.hasOwnProperty, i = Object.defineProperty || function(u, o, a) {
|
|
632
|
+
u[o] = a.value;
|
|
633
|
+
}, s = typeof Symbol == "function" ? Symbol : {}, l = s.iterator || "@@iterator", b = s.asyncIterator || "@@asyncIterator", p = s.toStringTag || "@@toStringTag";
|
|
634
|
+
function f(u, o, a) {
|
|
635
|
+
return Object.defineProperty(u, o, { value: a, enumerable: !0, configurable: !0, writable: !0 }), u[o];
|
|
636
|
+
}
|
|
637
|
+
try {
|
|
638
|
+
f({}, "");
|
|
639
|
+
} catch {
|
|
640
|
+
f = function(a, c, v) {
|
|
641
|
+
return a[c] = v;
|
|
642
|
+
};
|
|
643
|
+
}
|
|
644
|
+
function _(u, o, a, c) {
|
|
645
|
+
var v = o && o.prototype instanceof H ? o : H, h = Object.create(v.prototype), E = new Y(c || []);
|
|
646
|
+
return i(h, "_invoke", { value: z(u, a, E) }), h;
|
|
647
|
+
}
|
|
648
|
+
function O(u, o, a) {
|
|
649
|
+
try {
|
|
650
|
+
return { type: "normal", arg: u.call(o, a) };
|
|
651
|
+
} catch (c) {
|
|
652
|
+
return { type: "throw", arg: c };
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
t.wrap = _;
|
|
656
|
+
var U = "suspendedStart", A = "suspendedYield", W = "executing", L = "completed", q = {};
|
|
657
|
+
function H() {
|
|
658
|
+
}
|
|
659
|
+
function m() {
|
|
660
|
+
}
|
|
661
|
+
function d() {
|
|
662
|
+
}
|
|
663
|
+
var g = {};
|
|
664
|
+
f(g, l, function() {
|
|
665
|
+
return this;
|
|
666
|
+
});
|
|
667
|
+
var y = Object.getPrototypeOf, x = y && y(y(te([])));
|
|
668
|
+
x && x !== r && n.call(x, l) && (g = x);
|
|
669
|
+
var S = d.prototype = H.prototype = Object.create(g);
|
|
670
|
+
function T(u) {
|
|
671
|
+
["next", "throw", "return"].forEach(function(o) {
|
|
672
|
+
f(u, o, function(a) {
|
|
673
|
+
return this._invoke(o, a);
|
|
674
|
+
});
|
|
675
|
+
});
|
|
676
|
+
}
|
|
677
|
+
function P(u, o) {
|
|
678
|
+
function a(v, h, E, R) {
|
|
679
|
+
var k = O(u[v], u, h);
|
|
680
|
+
if (k.type !== "throw") {
|
|
681
|
+
var D = k.arg, C = D.value;
|
|
682
|
+
return C && re(C) == "object" && n.call(C, "__await") ? o.resolve(C.__await).then(function(N) {
|
|
683
|
+
a("next", N, E, R);
|
|
684
|
+
}, function(N) {
|
|
685
|
+
a("throw", N, E, R);
|
|
686
|
+
}) : o.resolve(C).then(function(N) {
|
|
687
|
+
D.value = N, E(D);
|
|
688
|
+
}, function(N) {
|
|
689
|
+
return a("throw", N, E, R);
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
R(k.arg);
|
|
693
|
+
}
|
|
694
|
+
var c;
|
|
695
|
+
i(this, "_invoke", { value: function(h, E) {
|
|
696
|
+
function R() {
|
|
697
|
+
return new o(function(k, D) {
|
|
698
|
+
a(h, E, k, D);
|
|
699
|
+
});
|
|
700
|
+
}
|
|
701
|
+
return c = c ? c.then(R, R) : R();
|
|
702
|
+
} });
|
|
703
|
+
}
|
|
704
|
+
function z(u, o, a) {
|
|
705
|
+
var c = U;
|
|
706
|
+
return function(v, h) {
|
|
707
|
+
if (c === W) throw Error("Generator is already running");
|
|
708
|
+
if (c === L) {
|
|
709
|
+
if (v === "throw") throw h;
|
|
710
|
+
return { value: e, done: !0 };
|
|
711
|
+
}
|
|
712
|
+
for (a.method = v, a.arg = h; ; ) {
|
|
713
|
+
var E = a.delegate;
|
|
714
|
+
if (E) {
|
|
715
|
+
var R = X(E, a);
|
|
716
|
+
if (R) {
|
|
717
|
+
if (R === q) continue;
|
|
718
|
+
return R;
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
if (a.method === "next") a.sent = a._sent = a.arg;
|
|
722
|
+
else if (a.method === "throw") {
|
|
723
|
+
if (c === U) throw c = L, a.arg;
|
|
724
|
+
a.dispatchException(a.arg);
|
|
725
|
+
} else a.method === "return" && a.abrupt("return", a.arg);
|
|
726
|
+
c = W;
|
|
727
|
+
var k = O(u, o, a);
|
|
728
|
+
if (k.type === "normal") {
|
|
729
|
+
if (c = a.done ? L : A, k.arg === q) continue;
|
|
730
|
+
return { value: k.arg, done: a.done };
|
|
731
|
+
}
|
|
732
|
+
k.type === "throw" && (c = L, a.method = "throw", a.arg = k.arg);
|
|
733
|
+
}
|
|
734
|
+
};
|
|
735
|
+
}
|
|
736
|
+
function X(u, o) {
|
|
737
|
+
var a = o.method, c = u.iterator[a];
|
|
738
|
+
if (c === e) return o.delegate = null, a === "throw" && u.iterator.return && (o.method = "return", o.arg = e, X(u, o), o.method === "throw") || a !== "return" && (o.method = "throw", o.arg = new TypeError("The iterator does not provide a '" + a + "' method")), q;
|
|
739
|
+
var v = O(c, u.iterator, o.arg);
|
|
740
|
+
if (v.type === "throw") return o.method = "throw", o.arg = v.arg, o.delegate = null, q;
|
|
741
|
+
var h = v.arg;
|
|
742
|
+
return h ? h.done ? (o[u.resultName] = h.value, o.next = u.nextLoc, o.method !== "return" && (o.method = "next", o.arg = e), o.delegate = null, q) : h : (o.method = "throw", o.arg = new TypeError("iterator result is not an object"), o.delegate = null, q);
|
|
743
|
+
}
|
|
744
|
+
function oe(u) {
|
|
745
|
+
var o = { tryLoc: u[0] };
|
|
746
|
+
1 in u && (o.catchLoc = u[1]), 2 in u && (o.finallyLoc = u[2], o.afterLoc = u[3]), this.tryEntries.push(o);
|
|
747
|
+
}
|
|
748
|
+
function w(u) {
|
|
749
|
+
var o = u.completion || {};
|
|
750
|
+
o.type = "normal", delete o.arg, u.completion = o;
|
|
751
|
+
}
|
|
752
|
+
function Y(u) {
|
|
753
|
+
this.tryEntries = [{ tryLoc: "root" }], u.forEach(oe, this), this.reset(!0);
|
|
754
|
+
}
|
|
755
|
+
function te(u) {
|
|
756
|
+
if (u || u === "") {
|
|
757
|
+
var o = u[l];
|
|
758
|
+
if (o) return o.call(u);
|
|
759
|
+
if (typeof u.next == "function") return u;
|
|
760
|
+
if (!isNaN(u.length)) {
|
|
761
|
+
var a = -1, c = function v() {
|
|
762
|
+
for (; ++a < u.length; ) if (n.call(u, a)) return v.value = u[a], v.done = !1, v;
|
|
763
|
+
return v.value = e, v.done = !0, v;
|
|
764
|
+
};
|
|
765
|
+
return c.next = c;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
throw new TypeError(re(u) + " is not iterable");
|
|
769
|
+
}
|
|
770
|
+
return m.prototype = d, i(S, "constructor", { value: d, configurable: !0 }), i(d, "constructor", { value: m, configurable: !0 }), m.displayName = f(d, p, "GeneratorFunction"), t.isGeneratorFunction = function(u) {
|
|
771
|
+
var o = typeof u == "function" && u.constructor;
|
|
772
|
+
return !!o && (o === m || (o.displayName || o.name) === "GeneratorFunction");
|
|
773
|
+
}, t.mark = function(u) {
|
|
774
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(u, d) : (u.__proto__ = d, f(u, p, "GeneratorFunction")), u.prototype = Object.create(S), u;
|
|
775
|
+
}, t.awrap = function(u) {
|
|
776
|
+
return { __await: u };
|
|
777
|
+
}, T(P.prototype), f(P.prototype, b, function() {
|
|
778
|
+
return this;
|
|
779
|
+
}), t.AsyncIterator = P, t.async = function(u, o, a, c, v) {
|
|
780
|
+
v === void 0 && (v = Promise);
|
|
781
|
+
var h = new P(_(u, o, a, c), v);
|
|
782
|
+
return t.isGeneratorFunction(o) ? h : h.next().then(function(E) {
|
|
783
|
+
return E.done ? E.value : h.next();
|
|
784
|
+
});
|
|
785
|
+
}, T(S), f(S, p, "Generator"), f(S, l, function() {
|
|
786
|
+
return this;
|
|
787
|
+
}), f(S, "toString", function() {
|
|
788
|
+
return "[object Generator]";
|
|
789
|
+
}), t.keys = function(u) {
|
|
790
|
+
var o = Object(u), a = [];
|
|
791
|
+
for (var c in o) a.push(c);
|
|
792
|
+
return a.reverse(), function v() {
|
|
793
|
+
for (; a.length; ) {
|
|
794
|
+
var h = a.pop();
|
|
795
|
+
if (h in o) return v.value = h, v.done = !1, v;
|
|
796
|
+
}
|
|
797
|
+
return v.done = !0, v;
|
|
798
|
+
};
|
|
799
|
+
}, t.values = te, Y.prototype = { constructor: Y, reset: function(o) {
|
|
800
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = e, this.done = !1, this.delegate = null, this.method = "next", this.arg = e, this.tryEntries.forEach(w), !o) for (var a in this) a.charAt(0) === "t" && n.call(this, a) && !isNaN(+a.slice(1)) && (this[a] = e);
|
|
801
|
+
}, stop: function() {
|
|
802
|
+
this.done = !0;
|
|
803
|
+
var o = this.tryEntries[0].completion;
|
|
804
|
+
if (o.type === "throw") throw o.arg;
|
|
805
|
+
return this.rval;
|
|
806
|
+
}, dispatchException: function(o) {
|
|
807
|
+
if (this.done) throw o;
|
|
808
|
+
var a = this;
|
|
809
|
+
function c(D, C) {
|
|
810
|
+
return E.type = "throw", E.arg = o, a.next = D, C && (a.method = "next", a.arg = e), !!C;
|
|
811
|
+
}
|
|
812
|
+
for (var v = this.tryEntries.length - 1; v >= 0; --v) {
|
|
813
|
+
var h = this.tryEntries[v], E = h.completion;
|
|
814
|
+
if (h.tryLoc === "root") return c("end");
|
|
815
|
+
if (h.tryLoc <= this.prev) {
|
|
816
|
+
var R = n.call(h, "catchLoc"), k = n.call(h, "finallyLoc");
|
|
817
|
+
if (R && k) {
|
|
818
|
+
if (this.prev < h.catchLoc) return c(h.catchLoc, !0);
|
|
819
|
+
if (this.prev < h.finallyLoc) return c(h.finallyLoc);
|
|
820
|
+
} else if (R) {
|
|
821
|
+
if (this.prev < h.catchLoc) return c(h.catchLoc, !0);
|
|
822
|
+
} else {
|
|
823
|
+
if (!k) throw Error("try statement without catch or finally");
|
|
824
|
+
if (this.prev < h.finallyLoc) return c(h.finallyLoc);
|
|
825
|
+
}
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
}, abrupt: function(o, a) {
|
|
829
|
+
for (var c = this.tryEntries.length - 1; c >= 0; --c) {
|
|
830
|
+
var v = this.tryEntries[c];
|
|
831
|
+
if (v.tryLoc <= this.prev && n.call(v, "finallyLoc") && this.prev < v.finallyLoc) {
|
|
832
|
+
var h = v;
|
|
833
|
+
break;
|
|
834
|
+
}
|
|
835
|
+
}
|
|
836
|
+
h && (o === "break" || o === "continue") && h.tryLoc <= a && a <= h.finallyLoc && (h = null);
|
|
837
|
+
var E = h ? h.completion : {};
|
|
838
|
+
return E.type = o, E.arg = a, h ? (this.method = "next", this.next = h.finallyLoc, q) : this.complete(E);
|
|
839
|
+
}, complete: function(o, a) {
|
|
840
|
+
if (o.type === "throw") throw o.arg;
|
|
841
|
+
return o.type === "break" || o.type === "continue" ? this.next = o.arg : o.type === "return" ? (this.rval = this.arg = o.arg, this.method = "return", this.next = "end") : o.type === "normal" && a && (this.next = a), q;
|
|
842
|
+
}, finish: function(o) {
|
|
843
|
+
for (var a = this.tryEntries.length - 1; a >= 0; --a) {
|
|
844
|
+
var c = this.tryEntries[a];
|
|
845
|
+
if (c.finallyLoc === o) return this.complete(c.completion, c.afterLoc), w(c), q;
|
|
846
|
+
}
|
|
847
|
+
}, catch: function(o) {
|
|
848
|
+
for (var a = this.tryEntries.length - 1; a >= 0; --a) {
|
|
849
|
+
var c = this.tryEntries[a];
|
|
850
|
+
if (c.tryLoc === o) {
|
|
851
|
+
var v = c.completion;
|
|
852
|
+
if (v.type === "throw") {
|
|
853
|
+
var h = v.arg;
|
|
854
|
+
w(c);
|
|
855
|
+
}
|
|
856
|
+
return h;
|
|
857
|
+
}
|
|
858
|
+
}
|
|
859
|
+
throw Error("illegal catch attempt");
|
|
860
|
+
}, delegateYield: function(o, a, c) {
|
|
861
|
+
return this.delegate = { iterator: te(o), resultName: a, nextLoc: c }, this.method === "next" && (this.arg = e), q;
|
|
862
|
+
} }, t;
|
|
863
|
+
}
|
|
864
|
+
function tt(e, t, r, n, i, s, l) {
|
|
865
|
+
try {
|
|
866
|
+
var b = e[s](l), p = b.value;
|
|
867
|
+
} catch (f) {
|
|
868
|
+
r(f);
|
|
869
|
+
return;
|
|
870
|
+
}
|
|
871
|
+
b.done ? t(p) : Promise.resolve(p).then(n, i);
|
|
872
|
+
}
|
|
873
|
+
function xr(e) {
|
|
874
|
+
return function() {
|
|
875
|
+
var t = this, r = arguments;
|
|
876
|
+
return new Promise(function(n, i) {
|
|
877
|
+
var s = e.apply(t, r);
|
|
878
|
+
function l(p) {
|
|
879
|
+
tt(s, n, i, l, b, "next", p);
|
|
880
|
+
}
|
|
881
|
+
function b(p) {
|
|
882
|
+
tt(s, n, i, l, b, "throw", p);
|
|
883
|
+
}
|
|
884
|
+
l(void 0);
|
|
885
|
+
});
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
function Lt(e, t) {
|
|
889
|
+
return Rr(e) || Or(e, t) || At(e, t) || Pr();
|
|
890
|
+
}
|
|
891
|
+
function Pr() {
|
|
892
|
+
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
893
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
894
|
+
}
|
|
895
|
+
function Or(e, t) {
|
|
896
|
+
var r = e == null ? null : typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
897
|
+
if (r != null) {
|
|
898
|
+
var n, i, s, l, b = [], p = !0, f = !1;
|
|
899
|
+
try {
|
|
900
|
+
if (s = (r = r.call(e)).next, t !== 0) for (; !(p = (n = s.call(r)).done) && (b.push(n.value), b.length !== t); p = !0) ;
|
|
901
|
+
} catch (_) {
|
|
902
|
+
f = !0, i = _;
|
|
903
|
+
} finally {
|
|
904
|
+
try {
|
|
905
|
+
if (!p && r.return != null && (l = r.return(), Object(l) !== l)) return;
|
|
906
|
+
} finally {
|
|
907
|
+
if (f) throw i;
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
return b;
|
|
911
|
+
}
|
|
912
|
+
}
|
|
913
|
+
function Rr(e) {
|
|
914
|
+
if (Array.isArray(e)) return e;
|
|
915
|
+
}
|
|
916
|
+
function re(e) {
|
|
917
|
+
"@babel/helpers - typeof";
|
|
918
|
+
return re = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
919
|
+
return typeof t;
|
|
920
|
+
} : function(t) {
|
|
921
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
922
|
+
}, re(e);
|
|
923
|
+
}
|
|
924
|
+
function Tr(e, t) {
|
|
925
|
+
var r = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
|
|
926
|
+
if (!r) {
|
|
927
|
+
if (Array.isArray(e) || (r = At(e)) || t) {
|
|
928
|
+
r && (e = r);
|
|
929
|
+
var n = 0, i = function() {
|
|
930
|
+
};
|
|
931
|
+
return { s: i, n: function() {
|
|
932
|
+
return n >= e.length ? { done: !0 } : { done: !1, value: e[n++] };
|
|
933
|
+
}, e: function(f) {
|
|
934
|
+
throw f;
|
|
935
|
+
}, f: i };
|
|
936
|
+
}
|
|
937
|
+
throw new TypeError(`Invalid attempt to iterate non-iterable instance.
|
|
938
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
|
|
939
|
+
}
|
|
940
|
+
var s = !0, l = !1, b;
|
|
941
|
+
return { s: function() {
|
|
942
|
+
r = r.call(e);
|
|
943
|
+
}, n: function() {
|
|
944
|
+
var f = r.next();
|
|
945
|
+
return s = f.done, f;
|
|
946
|
+
}, e: function(f) {
|
|
947
|
+
l = !0, b = f;
|
|
948
|
+
}, f: function() {
|
|
949
|
+
try {
|
|
950
|
+
!s && r.return != null && r.return();
|
|
951
|
+
} finally {
|
|
952
|
+
if (l) throw b;
|
|
953
|
+
}
|
|
954
|
+
} };
|
|
955
|
+
}
|
|
956
|
+
function At(e, t) {
|
|
957
|
+
if (e) {
|
|
958
|
+
if (typeof e == "string") return rt(e, t);
|
|
959
|
+
var r = Object.prototype.toString.call(e).slice(8, -1);
|
|
960
|
+
if (r === "Object" && e.constructor && (r = e.constructor.name), r === "Map" || r === "Set") return Array.from(e);
|
|
961
|
+
if (r === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)) return rt(e, t);
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
function rt(e, t) {
|
|
965
|
+
(t == null || t > e.length) && (t = e.length);
|
|
966
|
+
for (var r = 0, n = new Array(t); r < t; r++) n[r] = e[r];
|
|
967
|
+
return n;
|
|
968
|
+
}
|
|
969
|
+
function nt(e, t) {
|
|
970
|
+
var r = Object.keys(e);
|
|
971
|
+
if (Object.getOwnPropertySymbols) {
|
|
972
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
973
|
+
t && (n = n.filter(function(i) {
|
|
974
|
+
return Object.getOwnPropertyDescriptor(e, i).enumerable;
|
|
975
|
+
})), r.push.apply(r, n);
|
|
976
|
+
}
|
|
977
|
+
return r;
|
|
978
|
+
}
|
|
979
|
+
function ae(e) {
|
|
980
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
981
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
982
|
+
t % 2 ? nt(Object(r), !0).forEach(function(n) {
|
|
983
|
+
qr(e, n, r[n]);
|
|
984
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : nt(Object(r)).forEach(function(n) {
|
|
985
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
986
|
+
});
|
|
987
|
+
}
|
|
988
|
+
return e;
|
|
989
|
+
}
|
|
990
|
+
function qr(e, t, r) {
|
|
991
|
+
return t = $t(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
992
|
+
}
|
|
993
|
+
function kr(e, t) {
|
|
994
|
+
if (!(e instanceof t))
|
|
995
|
+
throw new TypeError("Cannot call a class as a function");
|
|
996
|
+
}
|
|
997
|
+
function ot(e, t) {
|
|
998
|
+
for (var r = 0; r < t.length; r++) {
|
|
999
|
+
var n = t[r];
|
|
1000
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, $t(n.key), n);
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
function jr(e, t, r) {
|
|
1004
|
+
return t && ot(e.prototype, t), r && ot(e, r), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
1005
|
+
}
|
|
1006
|
+
function $t(e) {
|
|
1007
|
+
var t = Fr(e, "string");
|
|
1008
|
+
return re(t) == "symbol" ? t : t + "";
|
|
1009
|
+
}
|
|
1010
|
+
function Fr(e, t) {
|
|
1011
|
+
if (re(e) != "object" || !e) return e;
|
|
1012
|
+
var r = e[Symbol.toPrimitive];
|
|
1013
|
+
if (r !== void 0) {
|
|
1014
|
+
var n = r.call(e, t);
|
|
1015
|
+
if (re(n) != "object") return n;
|
|
1016
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1017
|
+
}
|
|
1018
|
+
return String(e);
|
|
1019
|
+
}
|
|
1020
|
+
var Pe = "tus-v1", Oe = "ietf-draft-03", pe = "ietf-draft-05", Lr = {
|
|
1021
|
+
endpoint: null,
|
|
1022
|
+
uploadUrl: null,
|
|
1023
|
+
metadata: {},
|
|
1024
|
+
metadataForPartialUploads: {},
|
|
1025
|
+
fingerprint: null,
|
|
1026
|
+
uploadSize: null,
|
|
1027
|
+
onProgress: null,
|
|
1028
|
+
onChunkComplete: null,
|
|
1029
|
+
onSuccess: null,
|
|
1030
|
+
onError: null,
|
|
1031
|
+
onUploadUrlAvailable: null,
|
|
1032
|
+
overridePatchMethod: !1,
|
|
1033
|
+
headers: {},
|
|
1034
|
+
addRequestId: !1,
|
|
1035
|
+
onBeforeRequest: null,
|
|
1036
|
+
onAfterResponse: null,
|
|
1037
|
+
onShouldRetry: It,
|
|
1038
|
+
chunkSize: Number.POSITIVE_INFINITY,
|
|
1039
|
+
retryDelays: [0, 1e3, 3e3, 5e3],
|
|
1040
|
+
parallelUploads: 1,
|
|
1041
|
+
parallelUploadBoundaries: null,
|
|
1042
|
+
storeFingerprintForResuming: !0,
|
|
1043
|
+
removeFingerprintOnSuccess: !1,
|
|
1044
|
+
uploadLengthDeferred: !1,
|
|
1045
|
+
uploadDataDuringCreation: !1,
|
|
1046
|
+
urlStorage: null,
|
|
1047
|
+
fileReader: null,
|
|
1048
|
+
httpStack: null,
|
|
1049
|
+
protocol: Pe
|
|
1050
|
+
}, Ct = /* @__PURE__ */ (function() {
|
|
1051
|
+
function e(t, r) {
|
|
1052
|
+
kr(this, e), "resume" in r && console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."), this.options = r, this.options.chunkSize = Number(this.options.chunkSize), this._urlStorage = this.options.urlStorage, this.file = t, this.url = null, this._req = null, this._fingerprint = null, this._urlStorageKey = null, this._offset = null, this._aborted = !1, this._size = null, this._source = null, this._retryAttempt = 0, this._retryTimeout = null, this._offsetBeforeRetry = 0, this._parallelUploads = null, this._parallelUploadUrls = null;
|
|
1053
|
+
}
|
|
1054
|
+
return jr(e, [{
|
|
1055
|
+
key: "findPreviousUploads",
|
|
1056
|
+
value: function() {
|
|
1057
|
+
var r = this;
|
|
1058
|
+
return this.options.fingerprint(this.file, this.options).then(function(n) {
|
|
1059
|
+
return r._urlStorage.findUploadsByFingerprint(n);
|
|
1060
|
+
});
|
|
1061
|
+
}
|
|
1062
|
+
}, {
|
|
1063
|
+
key: "resumeFromPreviousUpload",
|
|
1064
|
+
value: function(r) {
|
|
1065
|
+
this.url = r.uploadUrl || null, this._parallelUploadUrls = r.parallelUploadUrls || null, this._urlStorageKey = r.urlStorageKey;
|
|
1066
|
+
}
|
|
1067
|
+
}, {
|
|
1068
|
+
key: "start",
|
|
1069
|
+
value: function() {
|
|
1070
|
+
var r = this, n = this.file;
|
|
1071
|
+
if (!n) {
|
|
1072
|
+
this._emitError(new Error("tus: no file or stream to upload provided"));
|
|
1073
|
+
return;
|
|
1074
|
+
}
|
|
1075
|
+
if (![Pe, Oe, pe].includes(this.options.protocol)) {
|
|
1076
|
+
this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));
|
|
1077
|
+
return;
|
|
1078
|
+
}
|
|
1079
|
+
if (!this.options.endpoint && !this.options.uploadUrl && !this.url) {
|
|
1080
|
+
this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));
|
|
1081
|
+
return;
|
|
1082
|
+
}
|
|
1083
|
+
var i = this.options.retryDelays;
|
|
1084
|
+
if (i != null && Object.prototype.toString.call(i) !== "[object Array]") {
|
|
1085
|
+
this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));
|
|
1086
|
+
return;
|
|
1087
|
+
}
|
|
1088
|
+
if (this.options.parallelUploads > 1)
|
|
1089
|
+
for (var s = 0, l = ["uploadUrl", "uploadSize", "uploadLengthDeferred"]; s < l.length; s++) {
|
|
1090
|
+
var b = l[s];
|
|
1091
|
+
if (this.options[b]) {
|
|
1092
|
+
this._emitError(new Error("tus: cannot use the ".concat(b, " option when parallelUploads is enabled")));
|
|
1093
|
+
return;
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
if (this.options.parallelUploadBoundaries) {
|
|
1097
|
+
if (this.options.parallelUploads <= 1) {
|
|
1098
|
+
this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));
|
|
1099
|
+
return;
|
|
1100
|
+
}
|
|
1101
|
+
if (this.options.parallelUploads !== this.options.parallelUploadBoundaries.length) {
|
|
1102
|
+
this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));
|
|
1103
|
+
return;
|
|
1104
|
+
}
|
|
1105
|
+
}
|
|
1106
|
+
this.options.fingerprint(n, this.options).then(function(p) {
|
|
1107
|
+
return r._fingerprint = p, r._source ? r._source : r.options.fileReader.openFile(n, r.options.chunkSize);
|
|
1108
|
+
}).then(function(p) {
|
|
1109
|
+
if (r._source = p, r.options.uploadLengthDeferred)
|
|
1110
|
+
r._size = null;
|
|
1111
|
+
else if (r.options.uploadSize != null) {
|
|
1112
|
+
if (r._size = Number(r.options.uploadSize), Number.isNaN(r._size)) {
|
|
1113
|
+
r._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));
|
|
1114
|
+
return;
|
|
1115
|
+
}
|
|
1116
|
+
} else if (r._size = r._source.size, r._size == null) {
|
|
1117
|
+
r._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));
|
|
1118
|
+
return;
|
|
1119
|
+
}
|
|
1120
|
+
r.options.parallelUploads > 1 || r._parallelUploadUrls != null ? r._startParallelUpload() : r._startSingleUpload();
|
|
1121
|
+
}).catch(function(p) {
|
|
1122
|
+
r._emitError(p);
|
|
1123
|
+
});
|
|
1124
|
+
}
|
|
1125
|
+
/**
|
|
1126
|
+
* Initiate the uploading procedure for a parallelized upload, where one file is split into
|
|
1127
|
+
* multiple request which are run in parallel.
|
|
1128
|
+
*
|
|
1129
|
+
* @api private
|
|
1130
|
+
*/
|
|
1131
|
+
}, {
|
|
1132
|
+
key: "_startParallelUpload",
|
|
1133
|
+
value: function() {
|
|
1134
|
+
var r, n = this, i = this._size, s = 0;
|
|
1135
|
+
this._parallelUploads = [];
|
|
1136
|
+
var l = this._parallelUploadUrls != null ? this._parallelUploadUrls.length : this.options.parallelUploads, b = (r = this.options.parallelUploadBoundaries) !== null && r !== void 0 ? r : $r(this._source.size, l);
|
|
1137
|
+
this._parallelUploadUrls && b.forEach(function(_, O) {
|
|
1138
|
+
_.uploadUrl = n._parallelUploadUrls[O] || null;
|
|
1139
|
+
}), this._parallelUploadUrls = new Array(b.length);
|
|
1140
|
+
var p = b.map(function(_, O) {
|
|
1141
|
+
var U = 0;
|
|
1142
|
+
return n._source.slice(_.start, _.end).then(function(A) {
|
|
1143
|
+
var W = A.value;
|
|
1144
|
+
return new Promise(function(L, q) {
|
|
1145
|
+
var H = ae(ae({}, n.options), {}, {
|
|
1146
|
+
// If available, the partial upload should be resumed from a previous URL.
|
|
1147
|
+
uploadUrl: _.uploadUrl || null,
|
|
1148
|
+
// We take manually care of resuming for partial uploads, so they should
|
|
1149
|
+
// not be stored in the URL storage.
|
|
1150
|
+
storeFingerprintForResuming: !1,
|
|
1151
|
+
removeFingerprintOnSuccess: !1,
|
|
1152
|
+
// Reset the parallelUploads option to not cause recursion.
|
|
1153
|
+
parallelUploads: 1,
|
|
1154
|
+
// Reset this option as we are not doing a parallel upload.
|
|
1155
|
+
parallelUploadBoundaries: null,
|
|
1156
|
+
metadata: n.options.metadataForPartialUploads,
|
|
1157
|
+
// Add the header to indicate the this is a partial upload.
|
|
1158
|
+
headers: ae(ae({}, n.options.headers), {}, {
|
|
1159
|
+
"Upload-Concat": "partial"
|
|
1160
|
+
}),
|
|
1161
|
+
// Reject or resolve the promise if the upload errors or completes.
|
|
1162
|
+
onSuccess: L,
|
|
1163
|
+
onError: q,
|
|
1164
|
+
// Based in the progress for this partial upload, calculate the progress
|
|
1165
|
+
// for the entire final upload.
|
|
1166
|
+
onProgress: function(g) {
|
|
1167
|
+
s = s - U + g, U = g, n._emitProgress(s, i);
|
|
1168
|
+
},
|
|
1169
|
+
// Wait until every partial upload has an upload URL, so we can add
|
|
1170
|
+
// them to the URL storage.
|
|
1171
|
+
onUploadUrlAvailable: function() {
|
|
1172
|
+
n._parallelUploadUrls[O] = m.url, n._parallelUploadUrls.filter(function(g) {
|
|
1173
|
+
return !!g;
|
|
1174
|
+
}).length === b.length && n._saveUploadInUrlStorage();
|
|
1175
|
+
}
|
|
1176
|
+
}), m = new e(W, H);
|
|
1177
|
+
m.start(), n._parallelUploads.push(m);
|
|
1178
|
+
});
|
|
1179
|
+
});
|
|
1180
|
+
}), f;
|
|
1181
|
+
Promise.all(p).then(function() {
|
|
1182
|
+
f = n._openRequest("POST", n.options.endpoint), f.setHeader("Upload-Concat", "final;".concat(n._parallelUploadUrls.join(" ")));
|
|
1183
|
+
var _ = at(n.options.metadata);
|
|
1184
|
+
return _ !== "" && f.setHeader("Upload-Metadata", _), n._sendRequest(f, null);
|
|
1185
|
+
}).then(function(_) {
|
|
1186
|
+
if (!ue(_.getStatus(), 200)) {
|
|
1187
|
+
n._emitHttpError(f, _, "tus: unexpected response while creating upload");
|
|
1188
|
+
return;
|
|
1189
|
+
}
|
|
1190
|
+
var O = _.getHeader("Location");
|
|
1191
|
+
if (O == null) {
|
|
1192
|
+
n._emitHttpError(f, _, "tus: invalid or missing Location header");
|
|
1193
|
+
return;
|
|
1194
|
+
}
|
|
1195
|
+
n.url = lt(n.options.endpoint, O), "Created upload at ".concat(n.url), n._emitSuccess(_);
|
|
1196
|
+
}).catch(function(_) {
|
|
1197
|
+
n._emitError(_);
|
|
1198
|
+
});
|
|
1199
|
+
}
|
|
1200
|
+
/**
|
|
1201
|
+
* Initiate the uploading procedure for a non-parallel upload. Here the entire file is
|
|
1202
|
+
* uploaded in a sequential matter.
|
|
1203
|
+
*
|
|
1204
|
+
* @api private
|
|
1205
|
+
*/
|
|
1206
|
+
}, {
|
|
1207
|
+
key: "_startSingleUpload",
|
|
1208
|
+
value: function() {
|
|
1209
|
+
if (this._aborted = !1, this.url != null) {
|
|
1210
|
+
"Resuming upload from previous URL: ".concat(this.url), this._resumeUpload();
|
|
1211
|
+
return;
|
|
1212
|
+
}
|
|
1213
|
+
if (this.options.uploadUrl != null) {
|
|
1214
|
+
"Resuming upload from provided URL: ".concat(this.options.uploadUrl), this.url = this.options.uploadUrl, this._resumeUpload();
|
|
1215
|
+
return;
|
|
1216
|
+
}
|
|
1217
|
+
this._createUpload();
|
|
1218
|
+
}
|
|
1219
|
+
/**
|
|
1220
|
+
* Abort any running request and stop the current upload. After abort is called, no event
|
|
1221
|
+
* handler will be invoked anymore. You can use the `start` method to resume the upload
|
|
1222
|
+
* again.
|
|
1223
|
+
* If `shouldTerminate` is true, the `terminate` function will be called to remove the
|
|
1224
|
+
* current upload from the server.
|
|
1225
|
+
*
|
|
1226
|
+
* @param {boolean} shouldTerminate True if the upload should be deleted from the server.
|
|
1227
|
+
* @return {Promise} The Promise will be resolved/rejected when the requests finish.
|
|
1228
|
+
*/
|
|
1229
|
+
}, {
|
|
1230
|
+
key: "abort",
|
|
1231
|
+
value: function(r) {
|
|
1232
|
+
var n = this;
|
|
1233
|
+
if (this._parallelUploads != null) {
|
|
1234
|
+
var i = Tr(this._parallelUploads), s;
|
|
1235
|
+
try {
|
|
1236
|
+
for (i.s(); !(s = i.n()).done; ) {
|
|
1237
|
+
var l = s.value;
|
|
1238
|
+
l.abort(r);
|
|
1239
|
+
}
|
|
1240
|
+
} catch (b) {
|
|
1241
|
+
i.e(b);
|
|
1242
|
+
} finally {
|
|
1243
|
+
i.f();
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
return this._req !== null && this._req.abort(), this._aborted = !0, this._retryTimeout != null && (clearTimeout(this._retryTimeout), this._retryTimeout = null), !r || this.url == null ? Promise.resolve() : e.terminate(this.url, this.options).then(function() {
|
|
1247
|
+
return n._removeFromUrlStorage();
|
|
1248
|
+
});
|
|
1249
|
+
}
|
|
1250
|
+
}, {
|
|
1251
|
+
key: "_emitHttpError",
|
|
1252
|
+
value: function(r, n, i, s) {
|
|
1253
|
+
this._emitError(new we(i, s, r, n));
|
|
1254
|
+
}
|
|
1255
|
+
}, {
|
|
1256
|
+
key: "_emitError",
|
|
1257
|
+
value: function(r) {
|
|
1258
|
+
var n = this;
|
|
1259
|
+
if (!this._aborted) {
|
|
1260
|
+
if (this.options.retryDelays != null) {
|
|
1261
|
+
var i = this._offset != null && this._offset > this._offsetBeforeRetry;
|
|
1262
|
+
if (i && (this._retryAttempt = 0), st(r, this._retryAttempt, this.options)) {
|
|
1263
|
+
var s = this.options.retryDelays[this._retryAttempt++];
|
|
1264
|
+
this._offsetBeforeRetry = this._offset, this._retryTimeout = setTimeout(function() {
|
|
1265
|
+
n.start();
|
|
1266
|
+
}, s);
|
|
1267
|
+
return;
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
if (typeof this.options.onError == "function")
|
|
1271
|
+
this.options.onError(r);
|
|
1272
|
+
else
|
|
1273
|
+
throw r;
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* Publishes notification if the upload has been successfully completed.
|
|
1278
|
+
*
|
|
1279
|
+
* @param {object} lastResponse Last HTTP response.
|
|
1280
|
+
* @api private
|
|
1281
|
+
*/
|
|
1282
|
+
}, {
|
|
1283
|
+
key: "_emitSuccess",
|
|
1284
|
+
value: function(r) {
|
|
1285
|
+
this.options.removeFingerprintOnSuccess && this._removeFromUrlStorage(), typeof this.options.onSuccess == "function" && this.options.onSuccess({
|
|
1286
|
+
lastResponse: r
|
|
1287
|
+
});
|
|
1288
|
+
}
|
|
1289
|
+
/**
|
|
1290
|
+
* Publishes notification when data has been sent to the server. This
|
|
1291
|
+
* data may not have been accepted by the server yet.
|
|
1292
|
+
*
|
|
1293
|
+
* @param {number} bytesSent Number of bytes sent to the server.
|
|
1294
|
+
* @param {number} bytesTotal Total number of bytes to be sent to the server.
|
|
1295
|
+
* @api private
|
|
1296
|
+
*/
|
|
1297
|
+
}, {
|
|
1298
|
+
key: "_emitProgress",
|
|
1299
|
+
value: function(r, n) {
|
|
1300
|
+
typeof this.options.onProgress == "function" && this.options.onProgress(r, n);
|
|
1301
|
+
}
|
|
1302
|
+
/**
|
|
1303
|
+
* Publishes notification when a chunk of data has been sent to the server
|
|
1304
|
+
* and accepted by the server.
|
|
1305
|
+
* @param {number} chunkSize Size of the chunk that was accepted by the server.
|
|
1306
|
+
* @param {number} bytesAccepted Total number of bytes that have been
|
|
1307
|
+
* accepted by the server.
|
|
1308
|
+
* @param {number} bytesTotal Total number of bytes to be sent to the server.
|
|
1309
|
+
* @api private
|
|
1310
|
+
*/
|
|
1311
|
+
}, {
|
|
1312
|
+
key: "_emitChunkComplete",
|
|
1313
|
+
value: function(r, n, i) {
|
|
1314
|
+
typeof this.options.onChunkComplete == "function" && this.options.onChunkComplete(r, n, i);
|
|
1315
|
+
}
|
|
1316
|
+
/**
|
|
1317
|
+
* Create a new upload using the creation extension by sending a POST
|
|
1318
|
+
* request to the endpoint. After successful creation the file will be
|
|
1319
|
+
* uploaded
|
|
1320
|
+
*
|
|
1321
|
+
* @api private
|
|
1322
|
+
*/
|
|
1323
|
+
}, {
|
|
1324
|
+
key: "_createUpload",
|
|
1325
|
+
value: function() {
|
|
1326
|
+
var r = this;
|
|
1327
|
+
if (!this.options.endpoint) {
|
|
1328
|
+
this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));
|
|
1329
|
+
return;
|
|
1330
|
+
}
|
|
1331
|
+
var n = this._openRequest("POST", this.options.endpoint);
|
|
1332
|
+
this.options.uploadLengthDeferred ? n.setHeader("Upload-Defer-Length", "1") : n.setHeader("Upload-Length", "".concat(this._size));
|
|
1333
|
+
var i = at(this.options.metadata);
|
|
1334
|
+
i !== "" && n.setHeader("Upload-Metadata", i);
|
|
1335
|
+
var s;
|
|
1336
|
+
this.options.uploadDataDuringCreation && !this.options.uploadLengthDeferred ? (this._offset = 0, s = this._addChunkToRequest(n)) : ((this.options.protocol === Oe || this.options.protocol === pe) && n.setHeader("Upload-Complete", "?0"), s = this._sendRequest(n, null)), s.then(function(l) {
|
|
1337
|
+
if (!ue(l.getStatus(), 200)) {
|
|
1338
|
+
r._emitHttpError(n, l, "tus: unexpected response while creating upload");
|
|
1339
|
+
return;
|
|
1340
|
+
}
|
|
1341
|
+
var b = l.getHeader("Location");
|
|
1342
|
+
if (b == null) {
|
|
1343
|
+
r._emitHttpError(n, l, "tus: invalid or missing Location header");
|
|
1344
|
+
return;
|
|
1345
|
+
}
|
|
1346
|
+
if (r.url = lt(r.options.endpoint, b), "Created upload at ".concat(r.url), typeof r.options.onUploadUrlAvailable == "function" && r.options.onUploadUrlAvailable(), r._size === 0) {
|
|
1347
|
+
r._emitSuccess(l), r._source.close();
|
|
1348
|
+
return;
|
|
1349
|
+
}
|
|
1350
|
+
r._saveUploadInUrlStorage().then(function() {
|
|
1351
|
+
r.options.uploadDataDuringCreation ? r._handleUploadResponse(n, l) : (r._offset = 0, r._performUpload());
|
|
1352
|
+
});
|
|
1353
|
+
}).catch(function(l) {
|
|
1354
|
+
r._emitHttpError(n, null, "tus: failed to create upload", l);
|
|
1355
|
+
});
|
|
1356
|
+
}
|
|
1357
|
+
/*
|
|
1358
|
+
* Try to resume an existing upload. First a HEAD request will be sent
|
|
1359
|
+
* to retrieve the offset. If the request fails a new upload will be
|
|
1360
|
+
* created. In the case of a successful response the file will be uploaded.
|
|
1361
|
+
*
|
|
1362
|
+
* @api private
|
|
1363
|
+
*/
|
|
1364
|
+
}, {
|
|
1365
|
+
key: "_resumeUpload",
|
|
1366
|
+
value: function() {
|
|
1367
|
+
var r = this, n = this._openRequest("HEAD", this.url), i = this._sendRequest(n, null);
|
|
1368
|
+
i.then(function(s) {
|
|
1369
|
+
var l = s.getStatus();
|
|
1370
|
+
if (!ue(l, 200)) {
|
|
1371
|
+
if (l === 423) {
|
|
1372
|
+
r._emitHttpError(n, s, "tus: upload is currently locked; retry later");
|
|
1373
|
+
return;
|
|
1374
|
+
}
|
|
1375
|
+
if (ue(l, 400) && r._removeFromUrlStorage(), !r.options.endpoint) {
|
|
1376
|
+
r._emitHttpError(n, s, "tus: unable to resume upload (new upload cannot be created without an endpoint)");
|
|
1377
|
+
return;
|
|
1378
|
+
}
|
|
1379
|
+
r.url = null, r._createUpload();
|
|
1380
|
+
return;
|
|
1381
|
+
}
|
|
1382
|
+
var b = Number.parseInt(s.getHeader("Upload-Offset"), 10);
|
|
1383
|
+
if (Number.isNaN(b)) {
|
|
1384
|
+
r._emitHttpError(n, s, "tus: invalid or missing offset value");
|
|
1385
|
+
return;
|
|
1386
|
+
}
|
|
1387
|
+
var p = Number.parseInt(s.getHeader("Upload-Length"), 10);
|
|
1388
|
+
if (Number.isNaN(p) && !r.options.uploadLengthDeferred && r.options.protocol === Pe) {
|
|
1389
|
+
r._emitHttpError(n, s, "tus: invalid or missing length value");
|
|
1390
|
+
return;
|
|
1391
|
+
}
|
|
1392
|
+
typeof r.options.onUploadUrlAvailable == "function" && r.options.onUploadUrlAvailable(), r._saveUploadInUrlStorage().then(function() {
|
|
1393
|
+
if (b === p) {
|
|
1394
|
+
r._emitProgress(p, p), r._emitSuccess(s);
|
|
1395
|
+
return;
|
|
1396
|
+
}
|
|
1397
|
+
r._offset = b, r._performUpload();
|
|
1398
|
+
});
|
|
1399
|
+
}).catch(function(s) {
|
|
1400
|
+
r._emitHttpError(n, null, "tus: failed to resume upload", s);
|
|
1401
|
+
});
|
|
1402
|
+
}
|
|
1403
|
+
/**
|
|
1404
|
+
* Start uploading the file using PATCH requests. The file will be divided
|
|
1405
|
+
* into chunks as specified in the chunkSize option. During the upload
|
|
1406
|
+
* the onProgress event handler may be invoked multiple times.
|
|
1407
|
+
*
|
|
1408
|
+
* @api private
|
|
1409
|
+
*/
|
|
1410
|
+
}, {
|
|
1411
|
+
key: "_performUpload",
|
|
1412
|
+
value: function() {
|
|
1413
|
+
var r = this;
|
|
1414
|
+
if (!this._aborted) {
|
|
1415
|
+
var n;
|
|
1416
|
+
this.options.overridePatchMethod ? (n = this._openRequest("POST", this.url), n.setHeader("X-HTTP-Method-Override", "PATCH")) : n = this._openRequest("PATCH", this.url), n.setHeader("Upload-Offset", "".concat(this._offset));
|
|
1417
|
+
var i = this._addChunkToRequest(n);
|
|
1418
|
+
i.then(function(s) {
|
|
1419
|
+
if (!ue(s.getStatus(), 200)) {
|
|
1420
|
+
r._emitHttpError(n, s, "tus: unexpected response while uploading chunk");
|
|
1421
|
+
return;
|
|
1422
|
+
}
|
|
1423
|
+
r._handleUploadResponse(n, s);
|
|
1424
|
+
}).catch(function(s) {
|
|
1425
|
+
r._aborted || r._emitHttpError(n, null, "tus: failed to upload chunk at offset ".concat(r._offset), s);
|
|
1426
|
+
});
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
/**
|
|
1430
|
+
* _addChunktoRequest reads a chunk from the source and sends it using the
|
|
1431
|
+
* supplied request object. It will not handle the response.
|
|
1432
|
+
*
|
|
1433
|
+
* @api private
|
|
1434
|
+
*/
|
|
1435
|
+
}, {
|
|
1436
|
+
key: "_addChunkToRequest",
|
|
1437
|
+
value: function(r) {
|
|
1438
|
+
var n = this, i = this._offset, s = this._offset + this.options.chunkSize;
|
|
1439
|
+
return r.setProgressHandler(function(l) {
|
|
1440
|
+
n._emitProgress(i + l, n._size);
|
|
1441
|
+
}), this.options.protocol === Pe ? r.setHeader("Content-Type", "application/offset+octet-stream") : this.options.protocol === pe && r.setHeader("Content-Type", "application/partial-upload"), (s === Number.POSITIVE_INFINITY || s > this._size) && !this.options.uploadLengthDeferred && (s = this._size), this._source.slice(i, s).then(function(l) {
|
|
1442
|
+
var b = l.value, p = l.done, f = b != null && b.size ? b.size : 0;
|
|
1443
|
+
n.options.uploadLengthDeferred && p && (n._size = n._offset + f, r.setHeader("Upload-Length", "".concat(n._size)));
|
|
1444
|
+
var _ = n._offset + f;
|
|
1445
|
+
return !n.options.uploadLengthDeferred && p && _ !== n._size ? Promise.reject(new Error("upload was configured with a size of ".concat(n._size, " bytes, but the source is done after ").concat(_, " bytes"))) : b === null ? n._sendRequest(r) : ((n.options.protocol === Oe || n.options.protocol === pe) && r.setHeader("Upload-Complete", p ? "?1" : "?0"), n._emitProgress(n._offset, n._size), n._sendRequest(r, b));
|
|
1446
|
+
});
|
|
1447
|
+
}
|
|
1448
|
+
/**
|
|
1449
|
+
* _handleUploadResponse is used by requests that haven been sent using _addChunkToRequest
|
|
1450
|
+
* and already have received a response.
|
|
1451
|
+
*
|
|
1452
|
+
* @api private
|
|
1453
|
+
*/
|
|
1454
|
+
}, {
|
|
1455
|
+
key: "_handleUploadResponse",
|
|
1456
|
+
value: function(r, n) {
|
|
1457
|
+
var i = Number.parseInt(n.getHeader("Upload-Offset"), 10);
|
|
1458
|
+
if (Number.isNaN(i)) {
|
|
1459
|
+
this._emitHttpError(r, n, "tus: invalid or missing offset value");
|
|
1460
|
+
return;
|
|
1461
|
+
}
|
|
1462
|
+
if (this._emitProgress(i, this._size), this._emitChunkComplete(i - this._offset, i, this._size), this._offset = i, i === this._size) {
|
|
1463
|
+
this._emitSuccess(n), this._source.close();
|
|
1464
|
+
return;
|
|
1465
|
+
}
|
|
1466
|
+
this._performUpload();
|
|
1467
|
+
}
|
|
1468
|
+
/**
|
|
1469
|
+
* Create a new HTTP request object with the given method and URL.
|
|
1470
|
+
*
|
|
1471
|
+
* @api private
|
|
1472
|
+
*/
|
|
1473
|
+
}, {
|
|
1474
|
+
key: "_openRequest",
|
|
1475
|
+
value: function(r, n) {
|
|
1476
|
+
var i = it(r, n, this.options);
|
|
1477
|
+
return this._req = i, i;
|
|
1478
|
+
}
|
|
1479
|
+
/**
|
|
1480
|
+
* Remove the entry in the URL storage, if it has been saved before.
|
|
1481
|
+
*
|
|
1482
|
+
* @api private
|
|
1483
|
+
*/
|
|
1484
|
+
}, {
|
|
1485
|
+
key: "_removeFromUrlStorage",
|
|
1486
|
+
value: function() {
|
|
1487
|
+
var r = this;
|
|
1488
|
+
this._urlStorageKey && (this._urlStorage.removeUpload(this._urlStorageKey).catch(function(n) {
|
|
1489
|
+
r._emitError(n);
|
|
1490
|
+
}), this._urlStorageKey = null);
|
|
1491
|
+
}
|
|
1492
|
+
/**
|
|
1493
|
+
* Add the upload URL to the URL storage, if possible.
|
|
1494
|
+
*
|
|
1495
|
+
* @api private
|
|
1496
|
+
*/
|
|
1497
|
+
}, {
|
|
1498
|
+
key: "_saveUploadInUrlStorage",
|
|
1499
|
+
value: function() {
|
|
1500
|
+
var r = this;
|
|
1501
|
+
if (!this.options.storeFingerprintForResuming || !this._fingerprint || this._urlStorageKey !== null)
|
|
1502
|
+
return Promise.resolve();
|
|
1503
|
+
var n = {
|
|
1504
|
+
size: this._size,
|
|
1505
|
+
metadata: this.options.metadata,
|
|
1506
|
+
creationTime: (/* @__PURE__ */ new Date()).toString()
|
|
1507
|
+
};
|
|
1508
|
+
return this._parallelUploads ? n.parallelUploadUrls = this._parallelUploadUrls : n.uploadUrl = this.url, this._urlStorage.addUpload(this._fingerprint, n).then(function(i) {
|
|
1509
|
+
r._urlStorageKey = i;
|
|
1510
|
+
});
|
|
1511
|
+
}
|
|
1512
|
+
/**
|
|
1513
|
+
* Send a request with the provided body.
|
|
1514
|
+
*
|
|
1515
|
+
* @api private
|
|
1516
|
+
*/
|
|
1517
|
+
}, {
|
|
1518
|
+
key: "_sendRequest",
|
|
1519
|
+
value: function(r) {
|
|
1520
|
+
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null;
|
|
1521
|
+
return ut(r, n, this.options);
|
|
1522
|
+
}
|
|
1523
|
+
}], [{
|
|
1524
|
+
key: "terminate",
|
|
1525
|
+
value: function(r) {
|
|
1526
|
+
var n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, i = it("DELETE", r, n);
|
|
1527
|
+
return ut(i, null, n).then(function(s) {
|
|
1528
|
+
if (s.getStatus() !== 204)
|
|
1529
|
+
throw new we("tus: unexpected response while terminating upload", null, i, s);
|
|
1530
|
+
}).catch(function(s) {
|
|
1531
|
+
if (s instanceof we || (s = new we("tus: failed to terminate upload", s, i, null)), !st(s, 0, n))
|
|
1532
|
+
throw s;
|
|
1533
|
+
var l = n.retryDelays[0], b = n.retryDelays.slice(1), p = ae(ae({}, n), {}, {
|
|
1534
|
+
retryDelays: b
|
|
1535
|
+
});
|
|
1536
|
+
return new Promise(function(f) {
|
|
1537
|
+
return setTimeout(f, l);
|
|
1538
|
+
}).then(function() {
|
|
1539
|
+
return e.terminate(r, p);
|
|
1540
|
+
});
|
|
1541
|
+
});
|
|
1542
|
+
}
|
|
1543
|
+
}]);
|
|
1544
|
+
})();
|
|
1545
|
+
function at(e) {
|
|
1546
|
+
return Object.entries(e).map(function(t) {
|
|
1547
|
+
var r = Lt(t, 2), n = r[0], i = r[1];
|
|
1548
|
+
return "".concat(n, " ").concat(gr.encode(String(i)));
|
|
1549
|
+
}).join(",");
|
|
1550
|
+
}
|
|
1551
|
+
function ue(e, t) {
|
|
1552
|
+
return e >= t && e < t + 100;
|
|
1553
|
+
}
|
|
1554
|
+
function it(e, t, r) {
|
|
1555
|
+
var n = r.httpStack.createRequest(e, t);
|
|
1556
|
+
r.protocol === Oe ? n.setHeader("Upload-Draft-Interop-Version", "5") : r.protocol === pe ? n.setHeader("Upload-Draft-Interop-Version", "6") : n.setHeader("Tus-Resumable", "1.0.0");
|
|
1557
|
+
for (var i = r.headers || {}, s = 0, l = Object.entries(i); s < l.length; s++) {
|
|
1558
|
+
var b = Lt(l[s], 2), p = b[0], f = b[1];
|
|
1559
|
+
n.setHeader(p, f);
|
|
1560
|
+
}
|
|
1561
|
+
if (r.addRequestId) {
|
|
1562
|
+
var _ = Er();
|
|
1563
|
+
n.setHeader("X-Request-ID", _);
|
|
1564
|
+
}
|
|
1565
|
+
return n;
|
|
1566
|
+
}
|
|
1567
|
+
function ut(e, t, r) {
|
|
1568
|
+
return $e.apply(this, arguments);
|
|
1569
|
+
}
|
|
1570
|
+
function $e() {
|
|
1571
|
+
return $e = xr(/* @__PURE__ */ Ae().mark(function e(t, r, n) {
|
|
1572
|
+
var i;
|
|
1573
|
+
return Ae().wrap(function(l) {
|
|
1574
|
+
for (; ; ) switch (l.prev = l.next) {
|
|
1575
|
+
case 0:
|
|
1576
|
+
if (typeof n.onBeforeRequest != "function") {
|
|
1577
|
+
l.next = 3;
|
|
1578
|
+
break;
|
|
1579
|
+
}
|
|
1580
|
+
return l.next = 3, n.onBeforeRequest(t);
|
|
1581
|
+
case 3:
|
|
1582
|
+
return l.next = 5, t.send(r);
|
|
1583
|
+
case 5:
|
|
1584
|
+
if (i = l.sent, typeof n.onAfterResponse != "function") {
|
|
1585
|
+
l.next = 9;
|
|
1586
|
+
break;
|
|
1587
|
+
}
|
|
1588
|
+
return l.next = 9, n.onAfterResponse(t, i);
|
|
1589
|
+
case 9:
|
|
1590
|
+
return l.abrupt("return", i);
|
|
1591
|
+
case 10:
|
|
1592
|
+
case "end":
|
|
1593
|
+
return l.stop();
|
|
1594
|
+
}
|
|
1595
|
+
}, e);
|
|
1596
|
+
})), $e.apply(this, arguments);
|
|
1597
|
+
}
|
|
1598
|
+
function Ar() {
|
|
1599
|
+
var e = !0;
|
|
1600
|
+
return typeof navigator < "u" && navigator.onLine === !1 && (e = !1), e;
|
|
1601
|
+
}
|
|
1602
|
+
function st(e, t, r) {
|
|
1603
|
+
return r.retryDelays == null || t >= r.retryDelays.length || e.originalRequest == null ? !1 : r && typeof r.onShouldRetry == "function" ? r.onShouldRetry(e, t, r) : It(e);
|
|
1604
|
+
}
|
|
1605
|
+
function It(e) {
|
|
1606
|
+
var t = e.originalResponse ? e.originalResponse.getStatus() : 0;
|
|
1607
|
+
return (!ue(t, 400) || t === 409 || t === 423) && Ar();
|
|
1608
|
+
}
|
|
1609
|
+
function lt(e, t) {
|
|
1610
|
+
return new Ur(t, e).toString();
|
|
1611
|
+
}
|
|
1612
|
+
function $r(e, t) {
|
|
1613
|
+
for (var r = Math.floor(e / t), n = [], i = 0; i < t; i++)
|
|
1614
|
+
n.push({
|
|
1615
|
+
start: r * i,
|
|
1616
|
+
end: r * (i + 1)
|
|
1617
|
+
});
|
|
1618
|
+
return n[t - 1].end = e, n;
|
|
1619
|
+
}
|
|
1620
|
+
Ct.defaultOptions = Lr;
|
|
1621
|
+
var Dt = function() {
|
|
1622
|
+
return typeof navigator < "u" && typeof navigator.product == "string" && navigator.product.toLowerCase() === "reactnative";
|
|
1623
|
+
};
|
|
1624
|
+
function Cr(e) {
|
|
1625
|
+
return new Promise(function(t, r) {
|
|
1626
|
+
var n = new XMLHttpRequest();
|
|
1627
|
+
n.responseType = "blob", n.onload = function() {
|
|
1628
|
+
var i = n.response;
|
|
1629
|
+
t(i);
|
|
1630
|
+
}, n.onerror = function(i) {
|
|
1631
|
+
r(i);
|
|
1632
|
+
}, n.open("GET", e), n.send();
|
|
1633
|
+
});
|
|
1634
|
+
}
|
|
1635
|
+
var Ir = function() {
|
|
1636
|
+
return typeof window < "u" && (typeof window.PhoneGap < "u" || typeof window.Cordova < "u" || typeof window.cordova < "u");
|
|
1637
|
+
};
|
|
1638
|
+
function Dr(e) {
|
|
1639
|
+
return new Promise(function(t, r) {
|
|
1640
|
+
var n = new FileReader();
|
|
1641
|
+
n.onload = function() {
|
|
1642
|
+
var i = new Uint8Array(n.result);
|
|
1643
|
+
t({
|
|
1644
|
+
value: i
|
|
1645
|
+
});
|
|
1646
|
+
}, n.onerror = function(i) {
|
|
1647
|
+
r(i);
|
|
1648
|
+
}, n.readAsArrayBuffer(e);
|
|
1649
|
+
});
|
|
1650
|
+
}
|
|
1651
|
+
function me(e) {
|
|
1652
|
+
"@babel/helpers - typeof";
|
|
1653
|
+
return me = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
1654
|
+
return typeof t;
|
|
1655
|
+
} : function(t) {
|
|
1656
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1657
|
+
}, me(e);
|
|
1658
|
+
}
|
|
1659
|
+
function Nr(e, t) {
|
|
1660
|
+
if (!(e instanceof t))
|
|
1661
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1662
|
+
}
|
|
1663
|
+
function Br(e, t) {
|
|
1664
|
+
for (var r = 0; r < t.length; r++) {
|
|
1665
|
+
var n = t[r];
|
|
1666
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, zr(n.key), n);
|
|
1667
|
+
}
|
|
1668
|
+
}
|
|
1669
|
+
function Hr(e, t, r) {
|
|
1670
|
+
return t && Br(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
1671
|
+
}
|
|
1672
|
+
function zr(e) {
|
|
1673
|
+
var t = Gr(e, "string");
|
|
1674
|
+
return me(t) == "symbol" ? t : t + "";
|
|
1675
|
+
}
|
|
1676
|
+
function Gr(e, t) {
|
|
1677
|
+
if (me(e) != "object" || !e) return e;
|
|
1678
|
+
var r = e[Symbol.toPrimitive];
|
|
1679
|
+
if (r !== void 0) {
|
|
1680
|
+
var n = r.call(e, t);
|
|
1681
|
+
if (me(n) != "object") return n;
|
|
1682
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1683
|
+
}
|
|
1684
|
+
return String(e);
|
|
1685
|
+
}
|
|
1686
|
+
var ft = /* @__PURE__ */ (function() {
|
|
1687
|
+
function e(t) {
|
|
1688
|
+
Nr(this, e), this._file = t, this.size = t.size;
|
|
1689
|
+
}
|
|
1690
|
+
return Hr(e, [{
|
|
1691
|
+
key: "slice",
|
|
1692
|
+
value: function(r, n) {
|
|
1693
|
+
if (Ir())
|
|
1694
|
+
return Dr(this._file.slice(r, n));
|
|
1695
|
+
var i = this._file.slice(r, n), s = n >= this.size;
|
|
1696
|
+
return Promise.resolve({
|
|
1697
|
+
value: i,
|
|
1698
|
+
done: s
|
|
1699
|
+
});
|
|
1700
|
+
}
|
|
1701
|
+
}, {
|
|
1702
|
+
key: "close",
|
|
1703
|
+
value: function() {
|
|
1704
|
+
}
|
|
1705
|
+
}]);
|
|
1706
|
+
})();
|
|
1707
|
+
function ve(e) {
|
|
1708
|
+
"@babel/helpers - typeof";
|
|
1709
|
+
return ve = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
1710
|
+
return typeof t;
|
|
1711
|
+
} : function(t) {
|
|
1712
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1713
|
+
}, ve(e);
|
|
1714
|
+
}
|
|
1715
|
+
function Kr(e, t) {
|
|
1716
|
+
if (!(e instanceof t))
|
|
1717
|
+
throw new TypeError("Cannot call a class as a function");
|
|
1718
|
+
}
|
|
1719
|
+
function Mr(e, t) {
|
|
1720
|
+
for (var r = 0; r < t.length; r++) {
|
|
1721
|
+
var n = t[r];
|
|
1722
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, Yr(n.key), n);
|
|
1723
|
+
}
|
|
1724
|
+
}
|
|
1725
|
+
function Wr(e, t, r) {
|
|
1726
|
+
return t && Mr(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
1727
|
+
}
|
|
1728
|
+
function Yr(e) {
|
|
1729
|
+
var t = Qr(e, "string");
|
|
1730
|
+
return ve(t) == "symbol" ? t : t + "";
|
|
1731
|
+
}
|
|
1732
|
+
function Qr(e, t) {
|
|
1733
|
+
if (ve(e) != "object" || !e) return e;
|
|
1734
|
+
var r = e[Symbol.toPrimitive];
|
|
1735
|
+
if (r !== void 0) {
|
|
1736
|
+
var n = r.call(e, t);
|
|
1737
|
+
if (ve(n) != "object") return n;
|
|
1738
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
1739
|
+
}
|
|
1740
|
+
return String(e);
|
|
1741
|
+
}
|
|
1742
|
+
function ct(e) {
|
|
1743
|
+
return e === void 0 ? 0 : e.size !== void 0 ? e.size : e.length;
|
|
1744
|
+
}
|
|
1745
|
+
function Vr(e, t) {
|
|
1746
|
+
if (e.concat)
|
|
1747
|
+
return e.concat(t);
|
|
1748
|
+
if (e instanceof Blob)
|
|
1749
|
+
return new Blob([e, t], {
|
|
1750
|
+
type: e.type
|
|
1751
|
+
});
|
|
1752
|
+
if (e.set) {
|
|
1753
|
+
var r = new e.constructor(e.length + t.length);
|
|
1754
|
+
return r.set(e), r.set(t, e.length), r;
|
|
1755
|
+
}
|
|
1756
|
+
throw new Error("Unknown data type");
|
|
1757
|
+
}
|
|
1758
|
+
var Xr = /* @__PURE__ */ (function() {
|
|
1759
|
+
function e(t) {
|
|
1760
|
+
Kr(this, e), this._buffer = void 0, this._bufferOffset = 0, this._reader = t, this._done = !1;
|
|
1761
|
+
}
|
|
1762
|
+
return Wr(e, [{
|
|
1763
|
+
key: "slice",
|
|
1764
|
+
value: function(r, n) {
|
|
1765
|
+
return r < this._bufferOffset ? Promise.reject(new Error("Requested data is before the reader's current offset")) : this._readUntilEnoughDataOrDone(r, n);
|
|
1766
|
+
}
|
|
1767
|
+
}, {
|
|
1768
|
+
key: "_readUntilEnoughDataOrDone",
|
|
1769
|
+
value: function(r, n) {
|
|
1770
|
+
var i = this, s = n <= this._bufferOffset + ct(this._buffer);
|
|
1771
|
+
if (this._done || s) {
|
|
1772
|
+
var l = this._getDataFromBuffer(r, n), b = l == null ? this._done : !1;
|
|
1773
|
+
return Promise.resolve({
|
|
1774
|
+
value: l,
|
|
1775
|
+
done: b
|
|
1776
|
+
});
|
|
1777
|
+
}
|
|
1778
|
+
return this._reader.read().then(function(p) {
|
|
1779
|
+
var f = p.value, _ = p.done;
|
|
1780
|
+
return _ ? i._done = !0 : i._buffer === void 0 ? i._buffer = f : i._buffer = Vr(i._buffer, f), i._readUntilEnoughDataOrDone(r, n);
|
|
1781
|
+
});
|
|
1782
|
+
}
|
|
1783
|
+
}, {
|
|
1784
|
+
key: "_getDataFromBuffer",
|
|
1785
|
+
value: function(r, n) {
|
|
1786
|
+
r > this._bufferOffset && (this._buffer = this._buffer.slice(r - this._bufferOffset), this._bufferOffset = r);
|
|
1787
|
+
var i = ct(this._buffer) === 0;
|
|
1788
|
+
return this._done && i ? null : this._buffer.slice(0, n - r);
|
|
1789
|
+
}
|
|
1790
|
+
}, {
|
|
1791
|
+
key: "close",
|
|
1792
|
+
value: function() {
|
|
1793
|
+
this._reader.cancel && this._reader.cancel();
|
|
1794
|
+
}
|
|
1795
|
+
}]);
|
|
1796
|
+
})();
|
|
1797
|
+
function ne(e) {
|
|
1798
|
+
"@babel/helpers - typeof";
|
|
1799
|
+
return ne = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
1800
|
+
return typeof t;
|
|
1801
|
+
} : function(t) {
|
|
1802
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
1803
|
+
}, ne(e);
|
|
1804
|
+
}
|
|
1805
|
+
function Ce() {
|
|
1806
|
+
Ce = function() {
|
|
1807
|
+
return t;
|
|
1808
|
+
};
|
|
1809
|
+
var e, t = {}, r = Object.prototype, n = r.hasOwnProperty, i = Object.defineProperty || function(u, o, a) {
|
|
1810
|
+
u[o] = a.value;
|
|
1811
|
+
}, s = typeof Symbol == "function" ? Symbol : {}, l = s.iterator || "@@iterator", b = s.asyncIterator || "@@asyncIterator", p = s.toStringTag || "@@toStringTag";
|
|
1812
|
+
function f(u, o, a) {
|
|
1813
|
+
return Object.defineProperty(u, o, { value: a, enumerable: !0, configurable: !0, writable: !0 }), u[o];
|
|
1814
|
+
}
|
|
1815
|
+
try {
|
|
1816
|
+
f({}, "");
|
|
1817
|
+
} catch {
|
|
1818
|
+
f = function(a, c, v) {
|
|
1819
|
+
return a[c] = v;
|
|
1820
|
+
};
|
|
1821
|
+
}
|
|
1822
|
+
function _(u, o, a, c) {
|
|
1823
|
+
var v = o && o.prototype instanceof H ? o : H, h = Object.create(v.prototype), E = new Y(c || []);
|
|
1824
|
+
return i(h, "_invoke", { value: z(u, a, E) }), h;
|
|
1825
|
+
}
|
|
1826
|
+
function O(u, o, a) {
|
|
1827
|
+
try {
|
|
1828
|
+
return { type: "normal", arg: u.call(o, a) };
|
|
1829
|
+
} catch (c) {
|
|
1830
|
+
return { type: "throw", arg: c };
|
|
1831
|
+
}
|
|
1832
|
+
}
|
|
1833
|
+
t.wrap = _;
|
|
1834
|
+
var U = "suspendedStart", A = "suspendedYield", W = "executing", L = "completed", q = {};
|
|
1835
|
+
function H() {
|
|
1836
|
+
}
|
|
1837
|
+
function m() {
|
|
1838
|
+
}
|
|
1839
|
+
function d() {
|
|
1840
|
+
}
|
|
1841
|
+
var g = {};
|
|
1842
|
+
f(g, l, function() {
|
|
1843
|
+
return this;
|
|
1844
|
+
});
|
|
1845
|
+
var y = Object.getPrototypeOf, x = y && y(y(te([])));
|
|
1846
|
+
x && x !== r && n.call(x, l) && (g = x);
|
|
1847
|
+
var S = d.prototype = H.prototype = Object.create(g);
|
|
1848
|
+
function T(u) {
|
|
1849
|
+
["next", "throw", "return"].forEach(function(o) {
|
|
1850
|
+
f(u, o, function(a) {
|
|
1851
|
+
return this._invoke(o, a);
|
|
1852
|
+
});
|
|
1853
|
+
});
|
|
1854
|
+
}
|
|
1855
|
+
function P(u, o) {
|
|
1856
|
+
function a(v, h, E, R) {
|
|
1857
|
+
var k = O(u[v], u, h);
|
|
1858
|
+
if (k.type !== "throw") {
|
|
1859
|
+
var D = k.arg, C = D.value;
|
|
1860
|
+
return C && ne(C) == "object" && n.call(C, "__await") ? o.resolve(C.__await).then(function(N) {
|
|
1861
|
+
a("next", N, E, R);
|
|
1862
|
+
}, function(N) {
|
|
1863
|
+
a("throw", N, E, R);
|
|
1864
|
+
}) : o.resolve(C).then(function(N) {
|
|
1865
|
+
D.value = N, E(D);
|
|
1866
|
+
}, function(N) {
|
|
1867
|
+
return a("throw", N, E, R);
|
|
1868
|
+
});
|
|
1869
|
+
}
|
|
1870
|
+
R(k.arg);
|
|
1871
|
+
}
|
|
1872
|
+
var c;
|
|
1873
|
+
i(this, "_invoke", { value: function(h, E) {
|
|
1874
|
+
function R() {
|
|
1875
|
+
return new o(function(k, D) {
|
|
1876
|
+
a(h, E, k, D);
|
|
1877
|
+
});
|
|
1878
|
+
}
|
|
1879
|
+
return c = c ? c.then(R, R) : R();
|
|
1880
|
+
} });
|
|
1881
|
+
}
|
|
1882
|
+
function z(u, o, a) {
|
|
1883
|
+
var c = U;
|
|
1884
|
+
return function(v, h) {
|
|
1885
|
+
if (c === W) throw Error("Generator is already running");
|
|
1886
|
+
if (c === L) {
|
|
1887
|
+
if (v === "throw") throw h;
|
|
1888
|
+
return { value: e, done: !0 };
|
|
1889
|
+
}
|
|
1890
|
+
for (a.method = v, a.arg = h; ; ) {
|
|
1891
|
+
var E = a.delegate;
|
|
1892
|
+
if (E) {
|
|
1893
|
+
var R = X(E, a);
|
|
1894
|
+
if (R) {
|
|
1895
|
+
if (R === q) continue;
|
|
1896
|
+
return R;
|
|
1897
|
+
}
|
|
1898
|
+
}
|
|
1899
|
+
if (a.method === "next") a.sent = a._sent = a.arg;
|
|
1900
|
+
else if (a.method === "throw") {
|
|
1901
|
+
if (c === U) throw c = L, a.arg;
|
|
1902
|
+
a.dispatchException(a.arg);
|
|
1903
|
+
} else a.method === "return" && a.abrupt("return", a.arg);
|
|
1904
|
+
c = W;
|
|
1905
|
+
var k = O(u, o, a);
|
|
1906
|
+
if (k.type === "normal") {
|
|
1907
|
+
if (c = a.done ? L : A, k.arg === q) continue;
|
|
1908
|
+
return { value: k.arg, done: a.done };
|
|
1909
|
+
}
|
|
1910
|
+
k.type === "throw" && (c = L, a.method = "throw", a.arg = k.arg);
|
|
1911
|
+
}
|
|
1912
|
+
};
|
|
1913
|
+
}
|
|
1914
|
+
function X(u, o) {
|
|
1915
|
+
var a = o.method, c = u.iterator[a];
|
|
1916
|
+
if (c === e) return o.delegate = null, a === "throw" && u.iterator.return && (o.method = "return", o.arg = e, X(u, o), o.method === "throw") || a !== "return" && (o.method = "throw", o.arg = new TypeError("The iterator does not provide a '" + a + "' method")), q;
|
|
1917
|
+
var v = O(c, u.iterator, o.arg);
|
|
1918
|
+
if (v.type === "throw") return o.method = "throw", o.arg = v.arg, o.delegate = null, q;
|
|
1919
|
+
var h = v.arg;
|
|
1920
|
+
return h ? h.done ? (o[u.resultName] = h.value, o.next = u.nextLoc, o.method !== "return" && (o.method = "next", o.arg = e), o.delegate = null, q) : h : (o.method = "throw", o.arg = new TypeError("iterator result is not an object"), o.delegate = null, q);
|
|
1921
|
+
}
|
|
1922
|
+
function oe(u) {
|
|
1923
|
+
var o = { tryLoc: u[0] };
|
|
1924
|
+
1 in u && (o.catchLoc = u[1]), 2 in u && (o.finallyLoc = u[2], o.afterLoc = u[3]), this.tryEntries.push(o);
|
|
1925
|
+
}
|
|
1926
|
+
function w(u) {
|
|
1927
|
+
var o = u.completion || {};
|
|
1928
|
+
o.type = "normal", delete o.arg, u.completion = o;
|
|
1929
|
+
}
|
|
1930
|
+
function Y(u) {
|
|
1931
|
+
this.tryEntries = [{ tryLoc: "root" }], u.forEach(oe, this), this.reset(!0);
|
|
1932
|
+
}
|
|
1933
|
+
function te(u) {
|
|
1934
|
+
if (u || u === "") {
|
|
1935
|
+
var o = u[l];
|
|
1936
|
+
if (o) return o.call(u);
|
|
1937
|
+
if (typeof u.next == "function") return u;
|
|
1938
|
+
if (!isNaN(u.length)) {
|
|
1939
|
+
var a = -1, c = function v() {
|
|
1940
|
+
for (; ++a < u.length; ) if (n.call(u, a)) return v.value = u[a], v.done = !1, v;
|
|
1941
|
+
return v.value = e, v.done = !0, v;
|
|
1942
|
+
};
|
|
1943
|
+
return c.next = c;
|
|
1944
|
+
}
|
|
1945
|
+
}
|
|
1946
|
+
throw new TypeError(ne(u) + " is not iterable");
|
|
1947
|
+
}
|
|
1948
|
+
return m.prototype = d, i(S, "constructor", { value: d, configurable: !0 }), i(d, "constructor", { value: m, configurable: !0 }), m.displayName = f(d, p, "GeneratorFunction"), t.isGeneratorFunction = function(u) {
|
|
1949
|
+
var o = typeof u == "function" && u.constructor;
|
|
1950
|
+
return !!o && (o === m || (o.displayName || o.name) === "GeneratorFunction");
|
|
1951
|
+
}, t.mark = function(u) {
|
|
1952
|
+
return Object.setPrototypeOf ? Object.setPrototypeOf(u, d) : (u.__proto__ = d, f(u, p, "GeneratorFunction")), u.prototype = Object.create(S), u;
|
|
1953
|
+
}, t.awrap = function(u) {
|
|
1954
|
+
return { __await: u };
|
|
1955
|
+
}, T(P.prototype), f(P.prototype, b, function() {
|
|
1956
|
+
return this;
|
|
1957
|
+
}), t.AsyncIterator = P, t.async = function(u, o, a, c, v) {
|
|
1958
|
+
v === void 0 && (v = Promise);
|
|
1959
|
+
var h = new P(_(u, o, a, c), v);
|
|
1960
|
+
return t.isGeneratorFunction(o) ? h : h.next().then(function(E) {
|
|
1961
|
+
return E.done ? E.value : h.next();
|
|
1962
|
+
});
|
|
1963
|
+
}, T(S), f(S, p, "Generator"), f(S, l, function() {
|
|
1964
|
+
return this;
|
|
1965
|
+
}), f(S, "toString", function() {
|
|
1966
|
+
return "[object Generator]";
|
|
1967
|
+
}), t.keys = function(u) {
|
|
1968
|
+
var o = Object(u), a = [];
|
|
1969
|
+
for (var c in o) a.push(c);
|
|
1970
|
+
return a.reverse(), function v() {
|
|
1971
|
+
for (; a.length; ) {
|
|
1972
|
+
var h = a.pop();
|
|
1973
|
+
if (h in o) return v.value = h, v.done = !1, v;
|
|
1974
|
+
}
|
|
1975
|
+
return v.done = !0, v;
|
|
1976
|
+
};
|
|
1977
|
+
}, t.values = te, Y.prototype = { constructor: Y, reset: function(o) {
|
|
1978
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = e, this.done = !1, this.delegate = null, this.method = "next", this.arg = e, this.tryEntries.forEach(w), !o) for (var a in this) a.charAt(0) === "t" && n.call(this, a) && !isNaN(+a.slice(1)) && (this[a] = e);
|
|
1979
|
+
}, stop: function() {
|
|
1980
|
+
this.done = !0;
|
|
1981
|
+
var o = this.tryEntries[0].completion;
|
|
1982
|
+
if (o.type === "throw") throw o.arg;
|
|
1983
|
+
return this.rval;
|
|
1984
|
+
}, dispatchException: function(o) {
|
|
1985
|
+
if (this.done) throw o;
|
|
1986
|
+
var a = this;
|
|
1987
|
+
function c(D, C) {
|
|
1988
|
+
return E.type = "throw", E.arg = o, a.next = D, C && (a.method = "next", a.arg = e), !!C;
|
|
1989
|
+
}
|
|
1990
|
+
for (var v = this.tryEntries.length - 1; v >= 0; --v) {
|
|
1991
|
+
var h = this.tryEntries[v], E = h.completion;
|
|
1992
|
+
if (h.tryLoc === "root") return c("end");
|
|
1993
|
+
if (h.tryLoc <= this.prev) {
|
|
1994
|
+
var R = n.call(h, "catchLoc"), k = n.call(h, "finallyLoc");
|
|
1995
|
+
if (R && k) {
|
|
1996
|
+
if (this.prev < h.catchLoc) return c(h.catchLoc, !0);
|
|
1997
|
+
if (this.prev < h.finallyLoc) return c(h.finallyLoc);
|
|
1998
|
+
} else if (R) {
|
|
1999
|
+
if (this.prev < h.catchLoc) return c(h.catchLoc, !0);
|
|
2000
|
+
} else {
|
|
2001
|
+
if (!k) throw Error("try statement without catch or finally");
|
|
2002
|
+
if (this.prev < h.finallyLoc) return c(h.finallyLoc);
|
|
2003
|
+
}
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
}, abrupt: function(o, a) {
|
|
2007
|
+
for (var c = this.tryEntries.length - 1; c >= 0; --c) {
|
|
2008
|
+
var v = this.tryEntries[c];
|
|
2009
|
+
if (v.tryLoc <= this.prev && n.call(v, "finallyLoc") && this.prev < v.finallyLoc) {
|
|
2010
|
+
var h = v;
|
|
2011
|
+
break;
|
|
2012
|
+
}
|
|
2013
|
+
}
|
|
2014
|
+
h && (o === "break" || o === "continue") && h.tryLoc <= a && a <= h.finallyLoc && (h = null);
|
|
2015
|
+
var E = h ? h.completion : {};
|
|
2016
|
+
return E.type = o, E.arg = a, h ? (this.method = "next", this.next = h.finallyLoc, q) : this.complete(E);
|
|
2017
|
+
}, complete: function(o, a) {
|
|
2018
|
+
if (o.type === "throw") throw o.arg;
|
|
2019
|
+
return o.type === "break" || o.type === "continue" ? this.next = o.arg : o.type === "return" ? (this.rval = this.arg = o.arg, this.method = "return", this.next = "end") : o.type === "normal" && a && (this.next = a), q;
|
|
2020
|
+
}, finish: function(o) {
|
|
2021
|
+
for (var a = this.tryEntries.length - 1; a >= 0; --a) {
|
|
2022
|
+
var c = this.tryEntries[a];
|
|
2023
|
+
if (c.finallyLoc === o) return this.complete(c.completion, c.afterLoc), w(c), q;
|
|
2024
|
+
}
|
|
2025
|
+
}, catch: function(o) {
|
|
2026
|
+
for (var a = this.tryEntries.length - 1; a >= 0; --a) {
|
|
2027
|
+
var c = this.tryEntries[a];
|
|
2028
|
+
if (c.tryLoc === o) {
|
|
2029
|
+
var v = c.completion;
|
|
2030
|
+
if (v.type === "throw") {
|
|
2031
|
+
var h = v.arg;
|
|
2032
|
+
w(c);
|
|
2033
|
+
}
|
|
2034
|
+
return h;
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
throw Error("illegal catch attempt");
|
|
2038
|
+
}, delegateYield: function(o, a, c) {
|
|
2039
|
+
return this.delegate = { iterator: te(o), resultName: a, nextLoc: c }, this.method === "next" && (this.arg = e), q;
|
|
2040
|
+
} }, t;
|
|
2041
|
+
}
|
|
2042
|
+
function pt(e, t, r, n, i, s, l) {
|
|
2043
|
+
try {
|
|
2044
|
+
var b = e[s](l), p = b.value;
|
|
2045
|
+
} catch (f) {
|
|
2046
|
+
r(f);
|
|
2047
|
+
return;
|
|
2048
|
+
}
|
|
2049
|
+
b.done ? t(p) : Promise.resolve(p).then(n, i);
|
|
2050
|
+
}
|
|
2051
|
+
function Zr(e) {
|
|
2052
|
+
return function() {
|
|
2053
|
+
var t = this, r = arguments;
|
|
2054
|
+
return new Promise(function(n, i) {
|
|
2055
|
+
var s = e.apply(t, r);
|
|
2056
|
+
function l(p) {
|
|
2057
|
+
pt(s, n, i, l, b, "next", p);
|
|
2058
|
+
}
|
|
2059
|
+
function b(p) {
|
|
2060
|
+
pt(s, n, i, l, b, "throw", p);
|
|
2061
|
+
}
|
|
2062
|
+
l(void 0);
|
|
2063
|
+
});
|
|
2064
|
+
};
|
|
2065
|
+
}
|
|
2066
|
+
function Jr(e, t) {
|
|
2067
|
+
if (!(e instanceof t))
|
|
2068
|
+
throw new TypeError("Cannot call a class as a function");
|
|
2069
|
+
}
|
|
2070
|
+
function en(e, t) {
|
|
2071
|
+
for (var r = 0; r < t.length; r++) {
|
|
2072
|
+
var n = t[r];
|
|
2073
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, rn(n.key), n);
|
|
2074
|
+
}
|
|
2075
|
+
}
|
|
2076
|
+
function tn(e, t, r) {
|
|
2077
|
+
return t && en(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
2078
|
+
}
|
|
2079
|
+
function rn(e) {
|
|
2080
|
+
var t = nn(e, "string");
|
|
2081
|
+
return ne(t) == "symbol" ? t : t + "";
|
|
2082
|
+
}
|
|
2083
|
+
function nn(e, t) {
|
|
2084
|
+
if (ne(e) != "object" || !e) return e;
|
|
2085
|
+
var r = e[Symbol.toPrimitive];
|
|
2086
|
+
if (r !== void 0) {
|
|
2087
|
+
var n = r.call(e, t);
|
|
2088
|
+
if (ne(n) != "object") return n;
|
|
2089
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2090
|
+
}
|
|
2091
|
+
return String(e);
|
|
2092
|
+
}
|
|
2093
|
+
var on = /* @__PURE__ */ (function() {
|
|
2094
|
+
function e() {
|
|
2095
|
+
Jr(this, e);
|
|
2096
|
+
}
|
|
2097
|
+
return tn(e, [{
|
|
2098
|
+
key: "openFile",
|
|
2099
|
+
value: (function() {
|
|
2100
|
+
var t = Zr(/* @__PURE__ */ Ce().mark(function n(i, s) {
|
|
2101
|
+
var l;
|
|
2102
|
+
return Ce().wrap(function(p) {
|
|
2103
|
+
for (; ; ) switch (p.prev = p.next) {
|
|
2104
|
+
case 0:
|
|
2105
|
+
if (!(Dt() && i && typeof i.uri < "u")) {
|
|
2106
|
+
p.next = 11;
|
|
2107
|
+
break;
|
|
2108
|
+
}
|
|
2109
|
+
return p.prev = 1, p.next = 4, Cr(i.uri);
|
|
2110
|
+
case 4:
|
|
2111
|
+
return l = p.sent, p.abrupt("return", new ft(l));
|
|
2112
|
+
case 8:
|
|
2113
|
+
throw p.prev = 8, p.t0 = p.catch(1), new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(p.t0));
|
|
2114
|
+
case 11:
|
|
2115
|
+
if (!(typeof i.slice == "function" && typeof i.size < "u")) {
|
|
2116
|
+
p.next = 13;
|
|
2117
|
+
break;
|
|
2118
|
+
}
|
|
2119
|
+
return p.abrupt("return", Promise.resolve(new ft(i)));
|
|
2120
|
+
case 13:
|
|
2121
|
+
if (typeof i.read != "function") {
|
|
2122
|
+
p.next = 18;
|
|
2123
|
+
break;
|
|
2124
|
+
}
|
|
2125
|
+
if (s = Number(s), Number.isFinite(s)) {
|
|
2126
|
+
p.next = 17;
|
|
2127
|
+
break;
|
|
2128
|
+
}
|
|
2129
|
+
return p.abrupt("return", Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));
|
|
2130
|
+
case 17:
|
|
2131
|
+
return p.abrupt("return", Promise.resolve(new Xr(i, s)));
|
|
2132
|
+
case 18:
|
|
2133
|
+
return p.abrupt("return", Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment")));
|
|
2134
|
+
case 19:
|
|
2135
|
+
case "end":
|
|
2136
|
+
return p.stop();
|
|
2137
|
+
}
|
|
2138
|
+
}, n, null, [[1, 8]]);
|
|
2139
|
+
}));
|
|
2140
|
+
function r(n, i) {
|
|
2141
|
+
return t.apply(this, arguments);
|
|
2142
|
+
}
|
|
2143
|
+
return r;
|
|
2144
|
+
})()
|
|
2145
|
+
}]);
|
|
2146
|
+
})();
|
|
2147
|
+
function an(e, t) {
|
|
2148
|
+
return Dt() ? Promise.resolve(un(e, t)) : Promise.resolve(["tus-br", e.name, e.type, e.size, e.lastModified, t.endpoint].join("-"));
|
|
2149
|
+
}
|
|
2150
|
+
function un(e, t) {
|
|
2151
|
+
var r = e.exif ? sn(JSON.stringify(e.exif)) : "noexif";
|
|
2152
|
+
return ["tus-rn", e.name || "noname", e.size || "nosize", r, t.endpoint].join("/");
|
|
2153
|
+
}
|
|
2154
|
+
function sn(e) {
|
|
2155
|
+
var t = 0;
|
|
2156
|
+
if (e.length === 0)
|
|
2157
|
+
return t;
|
|
2158
|
+
for (var r = 0; r < e.length; r++) {
|
|
2159
|
+
var n = e.charCodeAt(r);
|
|
2160
|
+
t = (t << 5) - t + n, t &= t;
|
|
2161
|
+
}
|
|
2162
|
+
return t;
|
|
2163
|
+
}
|
|
2164
|
+
function ge(e) {
|
|
2165
|
+
"@babel/helpers - typeof";
|
|
2166
|
+
return ge = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
2167
|
+
return typeof t;
|
|
2168
|
+
} : function(t) {
|
|
2169
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
2170
|
+
}, ge(e);
|
|
2171
|
+
}
|
|
2172
|
+
function Ge(e, t) {
|
|
2173
|
+
if (!(e instanceof t))
|
|
2174
|
+
throw new TypeError("Cannot call a class as a function");
|
|
2175
|
+
}
|
|
2176
|
+
function ln(e, t) {
|
|
2177
|
+
for (var r = 0; r < t.length; r++) {
|
|
2178
|
+
var n = t[r];
|
|
2179
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, fn(n.key), n);
|
|
2180
|
+
}
|
|
2181
|
+
}
|
|
2182
|
+
function Ke(e, t, r) {
|
|
2183
|
+
return t && ln(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
2184
|
+
}
|
|
2185
|
+
function fn(e) {
|
|
2186
|
+
var t = cn(e, "string");
|
|
2187
|
+
return ge(t) == "symbol" ? t : t + "";
|
|
2188
|
+
}
|
|
2189
|
+
function cn(e, t) {
|
|
2190
|
+
if (ge(e) != "object" || !e) return e;
|
|
2191
|
+
var r = e[Symbol.toPrimitive];
|
|
2192
|
+
if (r !== void 0) {
|
|
2193
|
+
var n = r.call(e, t);
|
|
2194
|
+
if (ge(n) != "object") return n;
|
|
2195
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2196
|
+
}
|
|
2197
|
+
return String(e);
|
|
2198
|
+
}
|
|
2199
|
+
var pn = /* @__PURE__ */ (function() {
|
|
2200
|
+
function e() {
|
|
2201
|
+
Ge(this, e);
|
|
2202
|
+
}
|
|
2203
|
+
return Ke(e, [{
|
|
2204
|
+
key: "createRequest",
|
|
2205
|
+
value: function(r, n) {
|
|
2206
|
+
return new hn(r, n);
|
|
2207
|
+
}
|
|
2208
|
+
}, {
|
|
2209
|
+
key: "getName",
|
|
2210
|
+
value: function() {
|
|
2211
|
+
return "XHRHttpStack";
|
|
2212
|
+
}
|
|
2213
|
+
}]);
|
|
2214
|
+
})(), hn = /* @__PURE__ */ (function() {
|
|
2215
|
+
function e(t, r) {
|
|
2216
|
+
Ge(this, e), this._xhr = new XMLHttpRequest(), this._xhr.open(t, r, !0), this._method = t, this._url = r, this._headers = {};
|
|
2217
|
+
}
|
|
2218
|
+
return Ke(e, [{
|
|
2219
|
+
key: "getMethod",
|
|
2220
|
+
value: function() {
|
|
2221
|
+
return this._method;
|
|
2222
|
+
}
|
|
2223
|
+
}, {
|
|
2224
|
+
key: "getURL",
|
|
2225
|
+
value: function() {
|
|
2226
|
+
return this._url;
|
|
2227
|
+
}
|
|
2228
|
+
}, {
|
|
2229
|
+
key: "setHeader",
|
|
2230
|
+
value: function(r, n) {
|
|
2231
|
+
this._xhr.setRequestHeader(r, n), this._headers[r] = n;
|
|
2232
|
+
}
|
|
2233
|
+
}, {
|
|
2234
|
+
key: "getHeader",
|
|
2235
|
+
value: function(r) {
|
|
2236
|
+
return this._headers[r];
|
|
2237
|
+
}
|
|
2238
|
+
}, {
|
|
2239
|
+
key: "setProgressHandler",
|
|
2240
|
+
value: function(r) {
|
|
2241
|
+
"upload" in this._xhr && (this._xhr.upload.onprogress = function(n) {
|
|
2242
|
+
n.lengthComputable && r(n.loaded);
|
|
2243
|
+
});
|
|
2244
|
+
}
|
|
2245
|
+
}, {
|
|
2246
|
+
key: "send",
|
|
2247
|
+
value: function() {
|
|
2248
|
+
var r = this, n = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
|
|
2249
|
+
return new Promise(function(i, s) {
|
|
2250
|
+
r._xhr.onload = function() {
|
|
2251
|
+
i(new dn(r._xhr));
|
|
2252
|
+
}, r._xhr.onerror = function(l) {
|
|
2253
|
+
s(l);
|
|
2254
|
+
}, r._xhr.send(n);
|
|
2255
|
+
});
|
|
2256
|
+
}
|
|
2257
|
+
}, {
|
|
2258
|
+
key: "abort",
|
|
2259
|
+
value: function() {
|
|
2260
|
+
return this._xhr.abort(), Promise.resolve();
|
|
2261
|
+
}
|
|
2262
|
+
}, {
|
|
2263
|
+
key: "getUnderlyingObject",
|
|
2264
|
+
value: function() {
|
|
2265
|
+
return this._xhr;
|
|
2266
|
+
}
|
|
2267
|
+
}]);
|
|
2268
|
+
})(), dn = /* @__PURE__ */ (function() {
|
|
2269
|
+
function e(t) {
|
|
2270
|
+
Ge(this, e), this._xhr = t;
|
|
2271
|
+
}
|
|
2272
|
+
return Ke(e, [{
|
|
2273
|
+
key: "getStatus",
|
|
2274
|
+
value: function() {
|
|
2275
|
+
return this._xhr.status;
|
|
2276
|
+
}
|
|
2277
|
+
}, {
|
|
2278
|
+
key: "getHeader",
|
|
2279
|
+
value: function(r) {
|
|
2280
|
+
return this._xhr.getResponseHeader(r);
|
|
2281
|
+
}
|
|
2282
|
+
}, {
|
|
2283
|
+
key: "getBody",
|
|
2284
|
+
value: function() {
|
|
2285
|
+
return this._xhr.responseText;
|
|
2286
|
+
}
|
|
2287
|
+
}, {
|
|
2288
|
+
key: "getUnderlyingObject",
|
|
2289
|
+
value: function() {
|
|
2290
|
+
return this._xhr;
|
|
2291
|
+
}
|
|
2292
|
+
}]);
|
|
2293
|
+
})();
|
|
2294
|
+
function be(e) {
|
|
2295
|
+
"@babel/helpers - typeof";
|
|
2296
|
+
return be = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
2297
|
+
return typeof t;
|
|
2298
|
+
} : function(t) {
|
|
2299
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
2300
|
+
}, be(e);
|
|
2301
|
+
}
|
|
2302
|
+
function yn(e, t) {
|
|
2303
|
+
if (!(e instanceof t))
|
|
2304
|
+
throw new TypeError("Cannot call a class as a function");
|
|
2305
|
+
}
|
|
2306
|
+
function mn(e, t) {
|
|
2307
|
+
for (var r = 0; r < t.length; r++) {
|
|
2308
|
+
var n = t[r];
|
|
2309
|
+
n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, gn(n.key), n);
|
|
2310
|
+
}
|
|
2311
|
+
}
|
|
2312
|
+
function vn(e, t, r) {
|
|
2313
|
+
return t && mn(e.prototype, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
|
|
2314
|
+
}
|
|
2315
|
+
function gn(e) {
|
|
2316
|
+
var t = bn(e, "string");
|
|
2317
|
+
return be(t) == "symbol" ? t : t + "";
|
|
2318
|
+
}
|
|
2319
|
+
function bn(e, t) {
|
|
2320
|
+
if (be(e) != "object" || !e) return e;
|
|
2321
|
+
var r = e[Symbol.toPrimitive];
|
|
2322
|
+
if (r !== void 0) {
|
|
2323
|
+
var n = r.call(e, t);
|
|
2324
|
+
if (be(n) != "object") return n;
|
|
2325
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2326
|
+
}
|
|
2327
|
+
return String(e);
|
|
2328
|
+
}
|
|
2329
|
+
var Ie = !1;
|
|
2330
|
+
try {
|
|
2331
|
+
Ie = "localStorage" in window;
|
|
2332
|
+
var qe = "tusSupport", ht = localStorage.getItem(qe);
|
|
2333
|
+
localStorage.setItem(qe, ht), ht === null && localStorage.removeItem(qe);
|
|
2334
|
+
} catch (e) {
|
|
2335
|
+
if (e.code === e.SECURITY_ERR || e.code === e.QUOTA_EXCEEDED_ERR)
|
|
2336
|
+
Ie = !1;
|
|
2337
|
+
else
|
|
2338
|
+
throw e;
|
|
2339
|
+
}
|
|
2340
|
+
var _n = Ie, wn = /* @__PURE__ */ (function() {
|
|
2341
|
+
function e() {
|
|
2342
|
+
yn(this, e);
|
|
2343
|
+
}
|
|
2344
|
+
return vn(e, [{
|
|
2345
|
+
key: "findAllUploads",
|
|
2346
|
+
value: function() {
|
|
2347
|
+
var r = this._findEntries("tus::");
|
|
2348
|
+
return Promise.resolve(r);
|
|
2349
|
+
}
|
|
2350
|
+
}, {
|
|
2351
|
+
key: "findUploadsByFingerprint",
|
|
2352
|
+
value: function(r) {
|
|
2353
|
+
var n = this._findEntries("tus::".concat(r, "::"));
|
|
2354
|
+
return Promise.resolve(n);
|
|
2355
|
+
}
|
|
2356
|
+
}, {
|
|
2357
|
+
key: "removeUpload",
|
|
2358
|
+
value: function(r) {
|
|
2359
|
+
return localStorage.removeItem(r), Promise.resolve();
|
|
2360
|
+
}
|
|
2361
|
+
}, {
|
|
2362
|
+
key: "addUpload",
|
|
2363
|
+
value: function(r, n) {
|
|
2364
|
+
var i = Math.round(Math.random() * 1e12), s = "tus::".concat(r, "::").concat(i);
|
|
2365
|
+
return localStorage.setItem(s, JSON.stringify(n)), Promise.resolve(s);
|
|
2366
|
+
}
|
|
2367
|
+
}, {
|
|
2368
|
+
key: "_findEntries",
|
|
2369
|
+
value: function(r) {
|
|
2370
|
+
for (var n = [], i = 0; i < localStorage.length; i++) {
|
|
2371
|
+
var s = localStorage.key(i);
|
|
2372
|
+
if (s.indexOf(r) === 0)
|
|
2373
|
+
try {
|
|
2374
|
+
var l = JSON.parse(localStorage.getItem(s));
|
|
2375
|
+
l.urlStorageKey = s, n.push(l);
|
|
2376
|
+
} catch {
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
return n;
|
|
2380
|
+
}
|
|
2381
|
+
}]);
|
|
2382
|
+
})();
|
|
2383
|
+
function _e(e) {
|
|
2384
|
+
"@babel/helpers - typeof";
|
|
2385
|
+
return _e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
|
|
2386
|
+
return typeof t;
|
|
2387
|
+
} : function(t) {
|
|
2388
|
+
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
|
|
2389
|
+
}, _e(e);
|
|
2390
|
+
}
|
|
2391
|
+
function dt(e, t) {
|
|
2392
|
+
var r = Object.keys(e);
|
|
2393
|
+
if (Object.getOwnPropertySymbols) {
|
|
2394
|
+
var n = Object.getOwnPropertySymbols(e);
|
|
2395
|
+
t && (n = n.filter(function(i) {
|
|
2396
|
+
return Object.getOwnPropertyDescriptor(e, i).enumerable;
|
|
2397
|
+
})), r.push.apply(r, n);
|
|
2398
|
+
}
|
|
2399
|
+
return r;
|
|
2400
|
+
}
|
|
2401
|
+
function yt(e) {
|
|
2402
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
2403
|
+
var r = arguments[t] != null ? arguments[t] : {};
|
|
2404
|
+
t % 2 ? dt(Object(r), !0).forEach(function(n) {
|
|
2405
|
+
Sn(e, n, r[n]);
|
|
2406
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : dt(Object(r)).forEach(function(n) {
|
|
2407
|
+
Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n));
|
|
2408
|
+
});
|
|
2409
|
+
}
|
|
2410
|
+
return e;
|
|
2411
|
+
}
|
|
2412
|
+
function Sn(e, t, r) {
|
|
2413
|
+
return t = Un(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e;
|
|
2414
|
+
}
|
|
2415
|
+
function Un(e) {
|
|
2416
|
+
var t = En(e, "string");
|
|
2417
|
+
return _e(t) == "symbol" ? t : t + "";
|
|
2418
|
+
}
|
|
2419
|
+
function En(e, t) {
|
|
2420
|
+
if (_e(e) != "object" || !e) return e;
|
|
2421
|
+
var r = e[Symbol.toPrimitive];
|
|
2422
|
+
if (r !== void 0) {
|
|
2423
|
+
var n = r.call(e, t);
|
|
2424
|
+
if (_e(n) != "object") return n;
|
|
2425
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2426
|
+
}
|
|
2427
|
+
return (t === "string" ? String : Number)(e);
|
|
2428
|
+
}
|
|
2429
|
+
yt(yt({}, Ct.defaultOptions), {}, {
|
|
2430
|
+
httpStack: new pn(),
|
|
2431
|
+
fileReader: new on(),
|
|
2432
|
+
urlStorage: _n ? new wn() : new ur(),
|
|
2433
|
+
fingerprint: an
|
|
2434
|
+
});
|
|
2435
|
+
const K = "file", ie = 1e3 * 60 * 60, M = mt(vt.VITE_APP_TITLE), Z = De.create({
|
|
2436
|
+
baseURL: "https://graph.microsoft.com/v1.0"
|
|
2437
|
+
});
|
|
2438
|
+
Z.interceptors.request.use(async (e) => {
|
|
2439
|
+
const t = await Ne("graph");
|
|
2440
|
+
return e.headers.set("Authorization", `Bearer ${t}`), e;
|
|
2441
|
+
});
|
|
2442
|
+
V.object({
|
|
2443
|
+
appName: V.string().min(1).max(255).default(M).optional(),
|
|
2444
|
+
subId: V.uuid()
|
|
2445
|
+
});
|
|
2446
|
+
V.object({
|
|
2447
|
+
appName: V.string().min(1).max(255).default(M).optional(),
|
|
2448
|
+
meta: gt.nullish()
|
|
2449
|
+
});
|
|
2450
|
+
V.object({
|
|
2451
|
+
appName: V.string().min(1).max(255).default(M).optional(),
|
|
2452
|
+
meta: gt.nullish()
|
|
2453
|
+
});
|
|
2454
|
+
const xn = {
|
|
2455
|
+
metas: (e) => {
|
|
2456
|
+
const t = new URLSearchParams();
|
|
2457
|
+
return t.append("appName", e.appName ?? M), t.append("subId", e.subId), $({
|
|
2458
|
+
queryKey: [K, "meta", e.appName ?? M, e.subId],
|
|
2459
|
+
queryFn: ({
|
|
2460
|
+
signal: r
|
|
2461
|
+
}) => Z.request({
|
|
2462
|
+
url: `/${K}/v1/meta?${t.toString()}`,
|
|
2463
|
+
method: "GET",
|
|
2464
|
+
signal: r
|
|
2465
|
+
}).then((n) => n.data),
|
|
2466
|
+
staleTime: ie,
|
|
2467
|
+
gcTime: ie,
|
|
2468
|
+
refetchOnWindowFocus: !1
|
|
2469
|
+
});
|
|
2470
|
+
},
|
|
2471
|
+
thumbnail: (e) => {
|
|
2472
|
+
const t = new URLSearchParams();
|
|
2473
|
+
return t.append("appName", e.appName ?? M), t.append("id", e.meta?.id ?? ""), $({
|
|
2474
|
+
queryKey: [K, "thumbnail", e.appName ?? M, e.meta?.id],
|
|
2475
|
+
queryFn: ({
|
|
2476
|
+
signal: r
|
|
2477
|
+
}) => Z.request({
|
|
2478
|
+
url: `/${K}/v1/thumbnail?${t.toString()}`,
|
|
2479
|
+
method: "GET",
|
|
2480
|
+
signal: r,
|
|
2481
|
+
responseType: "blob"
|
|
2482
|
+
}).then((n) => n.data),
|
|
2483
|
+
select: (r) => URL.createObjectURL(r),
|
|
2484
|
+
staleTime: ie,
|
|
2485
|
+
gcTime: ie,
|
|
2486
|
+
refetchOnWindowFocus: !1
|
|
2487
|
+
});
|
|
2488
|
+
},
|
|
2489
|
+
getOne: (e) => {
|
|
2490
|
+
const t = new URLSearchParams();
|
|
2491
|
+
return t.append("appName", e.appName ?? M), t.append("id", e.meta?.id ?? ""), $({
|
|
2492
|
+
queryKey: [K, e.appName ?? M, e.meta?.id],
|
|
2493
|
+
queryFn: ({
|
|
2494
|
+
signal: r
|
|
2495
|
+
}) => Z.request({
|
|
2496
|
+
url: `/${K}/v1?${t.toString()}`,
|
|
2497
|
+
method: "GET",
|
|
2498
|
+
signal: r,
|
|
2499
|
+
responseType: "blob"
|
|
2500
|
+
}).then((n) => n.data),
|
|
2501
|
+
select: (r) => URL.createObjectURL(r),
|
|
2502
|
+
staleTime: ie,
|
|
2503
|
+
gcTime: ie,
|
|
2504
|
+
refetchOnWindowFocus: !1
|
|
2505
|
+
});
|
|
2506
|
+
},
|
|
2507
|
+
download: () => Q({
|
|
2508
|
+
mutationFn: (e) => Z.request({
|
|
2509
|
+
url: `/${K}/v1/download?appName=${M}&id=${e.id}`,
|
|
2510
|
+
method: "GET",
|
|
2511
|
+
responseType: "blob"
|
|
2512
|
+
}).then((t) => t.data),
|
|
2513
|
+
onSuccess: (e, t) => Wt(e, `${t.fileName}.${t.fileExtension}`)
|
|
2514
|
+
}),
|
|
2515
|
+
open: () => Q({
|
|
2516
|
+
mutationFn: (e) => Z.request({
|
|
2517
|
+
url: `/${K}/v1?appName=${M}&id=${e.id}`,
|
|
2518
|
+
method: "GET",
|
|
2519
|
+
responseType: "blob"
|
|
2520
|
+
}).then((t) => t.data),
|
|
2521
|
+
onSuccess: (e) => {
|
|
2522
|
+
window.open(URL.createObjectURL(e));
|
|
2523
|
+
}
|
|
2524
|
+
}),
|
|
2525
|
+
updateMeta: () => Q({
|
|
2526
|
+
mutationFn: (e) => Z.request({
|
|
2527
|
+
url: `/${K}/v1/meta?appName=${M}&id=${e.id}`,
|
|
2528
|
+
method: "PUT",
|
|
2529
|
+
data: e
|
|
2530
|
+
}).then((t) => t.data),
|
|
2531
|
+
onSettled: () => ee.invalidateQueries({
|
|
2532
|
+
queryKey: [K, "meta"],
|
|
2533
|
+
exact: !1
|
|
2534
|
+
})
|
|
2535
|
+
}),
|
|
2536
|
+
delete: () => Q({
|
|
2537
|
+
mutationFn: (e) => Z.request({
|
|
2538
|
+
url: `/${K}/v1?appName=${M}&id=${e.id}`,
|
|
2539
|
+
method: "DELETE"
|
|
2540
|
+
}).then((t) => t.data),
|
|
2541
|
+
onSettled: () => ee.invalidateQueries({
|
|
2542
|
+
queryKey: [K, "meta"],
|
|
2543
|
+
exact: !1
|
|
2544
|
+
})
|
|
2545
|
+
}),
|
|
2546
|
+
batchDelete: () => Q({
|
|
2547
|
+
mutationFn: (e) => Z.request({
|
|
2548
|
+
url: `/${K}/v1?appName=${M}&subId=${e}`,
|
|
2549
|
+
method: "DELETE"
|
|
2550
|
+
}).then((t) => t.data),
|
|
2551
|
+
onSettled: () => ee.invalidateQueries({
|
|
2552
|
+
queryKey: [K, "meta"],
|
|
2553
|
+
exact: !1
|
|
2554
|
+
})
|
|
2555
|
+
})
|
|
2556
|
+
}, j = "ps", F = 1e3 * 60 * 60 * 24, B = De.create({
|
|
2557
|
+
baseURL: "https://graph.microsoft.com/v1.0"
|
|
2558
|
+
});
|
|
2559
|
+
B.interceptors.request.use(async (e) => {
|
|
2560
|
+
const t = await Ne("graph");
|
|
2561
|
+
return e.headers.set("Authorization", `Bearer ${t}`), e;
|
|
2562
|
+
});
|
|
2563
|
+
const Pn = {
|
|
2564
|
+
employeesSearch: (e) => $({
|
|
2565
|
+
queryKey: [j, "employee", "search", e],
|
|
2566
|
+
queryFn: ({
|
|
2567
|
+
signal: t
|
|
2568
|
+
}) => B.request({
|
|
2569
|
+
url: `/${j}/v1/employee?search=${e}`,
|
|
2570
|
+
method: "GET",
|
|
2571
|
+
signal: t
|
|
2572
|
+
}).then((r) => r.data),
|
|
2573
|
+
staleTime: F,
|
|
2574
|
+
gcTime: F,
|
|
2575
|
+
refetchOnWindowFocus: !1
|
|
2576
|
+
}),
|
|
2577
|
+
employees: () => $({
|
|
2578
|
+
queryKey: [j, "employee"],
|
|
2579
|
+
queryFn: ({
|
|
2580
|
+
signal: e
|
|
2581
|
+
}) => B.request({
|
|
2582
|
+
url: `/${j}/v1/employee/all`,
|
|
2583
|
+
method: "GET",
|
|
2584
|
+
signal: e
|
|
2585
|
+
}).then((t) => t.data),
|
|
2586
|
+
staleTime: F,
|
|
2587
|
+
gcTime: F,
|
|
2588
|
+
refetchOnWindowFocus: !1
|
|
2589
|
+
}),
|
|
2590
|
+
activeEmployees: () => $({
|
|
2591
|
+
queryKey: [j, "employee", "active"],
|
|
2592
|
+
queryFn: ({
|
|
2593
|
+
signal: e
|
|
2594
|
+
}) => B.request({
|
|
2595
|
+
url: `/${j}/v1/employee/active`,
|
|
2596
|
+
method: "GET",
|
|
2597
|
+
signal: e
|
|
2598
|
+
}).then((t) => t.data),
|
|
2599
|
+
staleTime: F,
|
|
2600
|
+
gcTime: F,
|
|
2601
|
+
refetchOnWindowFocus: !1
|
|
2602
|
+
}),
|
|
2603
|
+
employeeById: (e) => $({
|
|
2604
|
+
queryKey: [j, "employee", e],
|
|
2605
|
+
queryFn: ({
|
|
2606
|
+
signal: t
|
|
2607
|
+
}) => B.request({
|
|
2608
|
+
url: `/${j}/v1/employee/${e}`,
|
|
2609
|
+
method: "GET",
|
|
2610
|
+
signal: t
|
|
2611
|
+
}).then((r) => r.data),
|
|
2612
|
+
staleTime: F,
|
|
2613
|
+
gcTime: F,
|
|
2614
|
+
refetchOnWindowFocus: !1
|
|
2615
|
+
}),
|
|
2616
|
+
previousEmployeeIds: () => $({
|
|
2617
|
+
queryKey: [j, "employee", "previousIds"],
|
|
2618
|
+
queryFn: ({
|
|
2619
|
+
signal: e
|
|
2620
|
+
}) => B.request({
|
|
2621
|
+
url: `/${j}/v1/employee/previousIds`,
|
|
2622
|
+
method: "GET",
|
|
2623
|
+
signal: e
|
|
2624
|
+
}).then((t) => t.data),
|
|
2625
|
+
staleTime: F,
|
|
2626
|
+
gcTime: F,
|
|
2627
|
+
refetchOnWindowFocus: !1
|
|
2628
|
+
}),
|
|
2629
|
+
employeeSupervisor: (e) => $({
|
|
2630
|
+
queryKey: [j, "employee", e, "supervisor"],
|
|
2631
|
+
queryFn: ({
|
|
2632
|
+
signal: t
|
|
2633
|
+
}) => B.request({
|
|
2634
|
+
url: `/${j}/v1/employee/${e}/supervisor`,
|
|
2635
|
+
method: "GET",
|
|
2636
|
+
signal: t
|
|
2637
|
+
}).then((r) => r.data),
|
|
2638
|
+
staleTime: F,
|
|
2639
|
+
gcTime: F,
|
|
2640
|
+
refetchOnWindowFocus: !1
|
|
2641
|
+
}),
|
|
2642
|
+
employeeSubordinates: (e) => $({
|
|
2643
|
+
queryKey: [j, "employee", e, "subordinates"],
|
|
2644
|
+
queryFn: ({
|
|
2645
|
+
signal: t
|
|
2646
|
+
}) => B.request({
|
|
2647
|
+
url: `/${j}/v1/employee/${e}/subordinates`,
|
|
2648
|
+
method: "GET",
|
|
2649
|
+
signal: t
|
|
2650
|
+
}).then((r) => r.data),
|
|
2651
|
+
staleTime: F,
|
|
2652
|
+
gcTime: F,
|
|
2653
|
+
refetchOnWindowFocus: !1
|
|
2654
|
+
}),
|
|
2655
|
+
employeeManager: (e) => $({
|
|
2656
|
+
queryKey: [j, "employee", e, "manager"],
|
|
2657
|
+
queryFn: ({
|
|
2658
|
+
signal: t
|
|
2659
|
+
}) => B.request({
|
|
2660
|
+
url: `/${j}/v1/employee/${e}/manager`,
|
|
2661
|
+
method: "GET",
|
|
2662
|
+
signal: t
|
|
2663
|
+
}).then((r) => r.data),
|
|
2664
|
+
staleTime: F,
|
|
2665
|
+
gcTime: F,
|
|
2666
|
+
refetchOnWindowFocus: !1
|
|
2667
|
+
}),
|
|
2668
|
+
employeeGeneralManager: (e) => $({
|
|
2669
|
+
queryKey: [j, "employee", e, "generalManager"],
|
|
2670
|
+
queryFn: ({
|
|
2671
|
+
signal: t
|
|
2672
|
+
}) => B.request({
|
|
2673
|
+
url: `/${j}/v1/employee/${e}/generalManager`,
|
|
2674
|
+
method: "GET",
|
|
2675
|
+
signal: t
|
|
2676
|
+
}).then((r) => r.data),
|
|
2677
|
+
staleTime: F,
|
|
2678
|
+
gcTime: F,
|
|
2679
|
+
refetchOnWindowFocus: !1
|
|
2680
|
+
}),
|
|
2681
|
+
departments: () => $({
|
|
2682
|
+
queryKey: [j, "department"],
|
|
2683
|
+
queryFn: ({
|
|
2684
|
+
signal: e
|
|
2685
|
+
}) => B.request({
|
|
2686
|
+
url: `/${j}/v1/department/all`,
|
|
2687
|
+
method: "GET",
|
|
2688
|
+
signal: e
|
|
2689
|
+
}).then((t) => t.data),
|
|
2690
|
+
staleTime: F,
|
|
2691
|
+
gcTime: F,
|
|
2692
|
+
refetchOnWindowFocus: !1
|
|
2693
|
+
}),
|
|
2694
|
+
departmentById: (e) => $({
|
|
2695
|
+
queryKey: [j, "department", e],
|
|
2696
|
+
queryFn: ({
|
|
2697
|
+
signal: t
|
|
2698
|
+
}) => B.request({
|
|
2699
|
+
url: `/${j}/v1/department/${e}`,
|
|
2700
|
+
method: "GET",
|
|
2701
|
+
signal: t
|
|
2702
|
+
}).then((r) => r.data),
|
|
2703
|
+
staleTime: F,
|
|
2704
|
+
gcTime: F,
|
|
2705
|
+
refetchOnWindowFocus: !1
|
|
2706
|
+
}),
|
|
2707
|
+
departmentManager: (e) => $({
|
|
2708
|
+
queryKey: [j, "department", e, "manager"],
|
|
2709
|
+
queryFn: ({
|
|
2710
|
+
signal: t
|
|
2711
|
+
}) => B.request({
|
|
2712
|
+
url: `/${j}/v1/department/${e}/manager`,
|
|
2713
|
+
method: "GET",
|
|
2714
|
+
signal: t
|
|
2715
|
+
}).then((r) => r.data),
|
|
2716
|
+
staleTime: F,
|
|
2717
|
+
gcTime: F,
|
|
2718
|
+
refetchOnWindowFocus: !1
|
|
2719
|
+
}),
|
|
2720
|
+
departmentEmployees: (e) => $({
|
|
2721
|
+
queryKey: [j, "department", e, "employees"],
|
|
2722
|
+
queryFn: ({
|
|
2723
|
+
signal: t
|
|
2724
|
+
}) => B.request({
|
|
2725
|
+
url: `/${j}/v1/department/${e}/employees`,
|
|
2726
|
+
method: "GET",
|
|
2727
|
+
signal: t
|
|
2728
|
+
}).then((r) => r.data),
|
|
2729
|
+
staleTime: F,
|
|
2730
|
+
gcTime: F,
|
|
2731
|
+
refetchOnWindowFocus: !1
|
|
2732
|
+
}),
|
|
2733
|
+
companyGeneralManager: (e) => $({
|
|
2734
|
+
queryKey: [j, "company", e, "generalManager"],
|
|
2735
|
+
queryFn: ({
|
|
2736
|
+
signal: t
|
|
2737
|
+
}) => B.request({
|
|
2738
|
+
url: `/${j}/v1/company/${e}/generalManager`,
|
|
2739
|
+
method: "GET",
|
|
2740
|
+
signal: t
|
|
2741
|
+
}).then((r) => r.data),
|
|
2742
|
+
staleTime: F,
|
|
2743
|
+
gcTime: F,
|
|
2744
|
+
refetchOnWindowFocus: !1
|
|
2745
|
+
})
|
|
2746
|
+
}, Fn = {
|
|
2747
|
+
peopleSoft: Pn,
|
|
2748
|
+
approval: zt,
|
|
2749
|
+
file: xn
|
|
2750
|
+
};
|
|
2751
|
+
export {
|
|
2752
|
+
Fn as a,
|
|
2753
|
+
bt as g,
|
|
2754
|
+
ee as q
|
|
2755
|
+
};
|
|
2756
|
+
//# sourceMappingURL=index-DchOf6FV.js.map
|