@opencloud-eu/web-client 5.1.0 → 6.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.
Files changed (73) hide show
  1. package/dist/axios-Drchb9eh.js +1646 -0
  2. package/dist/dist-tjee3PVd.js +809 -0
  3. package/dist/generated-B6vcMOfs.js +3317 -0
  4. package/dist/graph-DcYhPBws.js +372 -0
  5. package/dist/helpers-B0hzJ78Q.js +1463 -0
  6. package/dist/ocs-2K0ogAXF.js +1658 -0
  7. package/dist/src/graph/activities/activities.d.ts +2 -2
  8. package/dist/src/graph/activities/types.d.ts +2 -2
  9. package/dist/src/graph/applications/applications.d.ts +2 -2
  10. package/dist/src/graph/applications/types.d.ts +2 -2
  11. package/dist/src/graph/driveItems/driveItems.d.ts +2 -2
  12. package/dist/src/graph/driveItems/types.d.ts +3 -1
  13. package/dist/src/graph/drives/drives.d.ts +2 -2
  14. package/dist/src/graph/drives/types.d.ts +4 -3
  15. package/dist/src/graph/generated/api.d.ts +394 -1720
  16. package/dist/src/graph/generated/base.d.ts +11 -24
  17. package/dist/src/graph/generated/common.d.ts +15 -35
  18. package/dist/src/graph/generated/configuration.d.ts +24 -17
  19. package/dist/src/graph/generated/index.d.ts +2 -2
  20. package/dist/src/graph/groups/groups.d.ts +2 -2
  21. package/dist/src/graph/groups/types.d.ts +2 -2
  22. package/dist/src/graph/index.d.ts +2 -2
  23. package/dist/src/graph/permissions/permissions.d.ts +2 -2
  24. package/dist/src/graph/permissions/types.d.ts +2 -2
  25. package/dist/src/graph/photos/photo.d.ts +2 -2
  26. package/dist/src/graph/photos/types.d.ts +1 -1
  27. package/dist/src/graph/tags/tags.d.ts +2 -2
  28. package/dist/src/graph/tags/types.d.ts +2 -2
  29. package/dist/src/graph/types.d.ts +2 -2
  30. package/dist/src/graph/users/types.d.ts +2 -2
  31. package/dist/src/graph/users/users.d.ts +2 -2
  32. package/dist/src/helpers/space/functions.d.ts +1 -1
  33. package/dist/src/webdav/clearTrashBin.d.ts +1 -1
  34. package/dist/src/webdav/copyFiles.d.ts +1 -1
  35. package/dist/src/webdav/deleteFile.d.ts +1 -1
  36. package/dist/src/webdav/listFileVersions.d.ts +1 -1
  37. package/dist/src/webdav/moveFiles.d.ts +1 -1
  38. package/dist/src/webdav/putFileContents.d.ts +1 -1
  39. package/dist/src/webdav/restoreFile.d.ts +1 -1
  40. package/dist/src/webdav/restoreFileVersion.d.ts +1 -1
  41. package/dist/src/webdav/setFavorite.d.ts +1 -1
  42. package/dist/src/webdav/types.d.ts +0 -2
  43. package/dist/toString-tGn_k7yU.js +287 -0
  44. package/dist/web-client/graph/generated.js +2 -5757
  45. package/dist/web-client/graph.js +2 -5
  46. package/dist/web-client/ocs.js +2 -5
  47. package/dist/web-client/sse.js +195 -201
  48. package/dist/web-client/webdav.js +3 -10
  49. package/dist/web-client.js +6 -82
  50. package/dist/webdav-CcBUJk4K.js +4423 -0
  51. package/package.json +8 -14
  52. package/dist/functions-JSgappH3.js +0 -1189
  53. package/dist/functions-K2XX5sqY.cjs +0 -1
  54. package/dist/index-Bjk4YP4o.js +0 -1447
  55. package/dist/index-Brk6gzFd.js +0 -688
  56. package/dist/index-CDNcS2Ra.cjs +0 -1
  57. package/dist/index-CRMq09Yn.js +0 -1933
  58. package/dist/index-D0bnLDAA.cjs +0 -1
  59. package/dist/index-Dn0XwAD_.cjs +0 -13
  60. package/dist/index-YuBBVVCr.js +0 -3860
  61. package/dist/index-_QOU-c0Z.cjs +0 -4
  62. package/dist/index-cttW6Cve.js +0 -1018
  63. package/dist/index-mNoGEl9R.cjs +0 -6
  64. package/dist/src/webdav/listFavoriteFiles.d.ts +0 -12
  65. package/dist/toString-CKeGA2IK.js +0 -255
  66. package/dist/toString-DsGM1XcL.cjs +0 -1
  67. package/dist/vite.config.d.ts +0 -2
  68. package/dist/web-client/graph/generated.cjs +0 -1
  69. package/dist/web-client/graph.cjs +0 -1
  70. package/dist/web-client/ocs.cjs +0 -1
  71. package/dist/web-client/sse.cjs +0 -2
  72. package/dist/web-client/webdav.cjs +0 -1
  73. package/dist/web-client.cjs +0 -1
@@ -1,3860 +0,0 @@
1
- import { p as it, a as br } from "./index-CRMq09Yn.js";
2
- import { y as ne, I as ft, J as Et, e as lt, d as vr, l as We, c as wr, K as Q } from "./functions-JSgappH3.js";
3
- import { u as I } from "./toString-CKeGA2IK.js";
4
- import { g as xr, o as Nr, X as Pr } from "./index-Bjk4YP4o.js";
5
- import { g as St } from "./index-cttW6Cve.js";
6
- const Ct = (r) => encodeURIComponent(r).split("%2F").join("/");
7
- class qe extends Error {
8
- response;
9
- statusCode;
10
- constructor(t, e, n = null) {
11
- super(t), this.response = e, this.statusCode = n;
12
- }
13
- }
14
- class Er extends qe {
15
- errorCode;
16
- constructor(t, e, n, s = null) {
17
- super(t, n, s), this.errorCode = e;
18
- }
19
- }
20
- const Ar = `
21
- `;
22
- function Tr(r, t) {
23
- let e = "";
24
- return t.format && t.indentBy.length > 0 && (e = Ar), Ge(r, t, "", e);
25
- }
26
- function Ge(r, t, e, n) {
27
- let s = "", o = !1;
28
- for (let i = 0; i < r.length; i++) {
29
- const a = r[i], l = Or(a);
30
- if (l === void 0) continue;
31
- let c = "";
32
- if (e.length === 0 ? c = l : c = `${e}.${l}`, l === t.textNodeName) {
33
- let g = a[l];
34
- Sr(c, t) || (g = t.tagValueProcessor(l, g), g = ze(g, t)), o && (s += n), s += g, o = !1;
35
- continue;
36
- } else if (l === t.cdataPropName) {
37
- o && (s += n), s += `<![CDATA[${a[l][0][t.textNodeName]}]]>`, o = !1;
38
- continue;
39
- } else if (l === t.commentPropName) {
40
- s += n + `<!--${a[l][0][t.textNodeName]}-->`, o = !0;
41
- continue;
42
- } else if (l[0] === "?") {
43
- const g = fe(a[":@"], t), p = l === "?xml" ? "" : n;
44
- let m = a[l][0][t.textNodeName];
45
- m = m.length !== 0 ? " " + m : "", s += p + `<${l}${m}${g}?>`, o = !0;
46
- continue;
47
- }
48
- let u = n;
49
- u !== "" && (u += t.indentBy);
50
- const f = fe(a[":@"], t), h = n + `<${l}${f}`, d = Ge(a[l], t, c, u);
51
- t.unpairedTags.indexOf(l) !== -1 ? t.suppressUnpairedNode ? s += h + ">" : s += h + "/>" : (!d || d.length === 0) && t.suppressEmptyNode ? s += h + "/>" : d && d.endsWith(">") ? s += h + `>${d}${n}</${l}>` : (s += h + ">", d && n !== "" && (d.includes("/>") || d.includes("</")) ? s += n + t.indentBy + d + n : s += d, s += `</${l}>`), o = !0;
52
- }
53
- return s;
54
- }
55
- function Or(r) {
56
- const t = Object.keys(r);
57
- for (let e = 0; e < t.length; e++) {
58
- const n = t[e];
59
- if (r.hasOwnProperty(n) && n !== ":@")
60
- return n;
61
- }
62
- }
63
- function fe(r, t) {
64
- let e = "";
65
- if (r && !t.ignoreAttributes)
66
- for (let n in r) {
67
- if (!r.hasOwnProperty(n)) continue;
68
- let s = t.attributeValueProcessor(n, r[n]);
69
- s = ze(s, t), s === !0 && t.suppressBooleanAttributes ? e += ` ${n.substr(t.attributeNamePrefix.length)}` : e += ` ${n.substr(t.attributeNamePrefix.length)}="${s}"`;
70
- }
71
- return e;
72
- }
73
- function Sr(r, t) {
74
- r = r.substr(0, r.length - t.textNodeName.length - 1);
75
- let e = r.substr(r.lastIndexOf(".") + 1);
76
- for (let n in t.stopNodes)
77
- if (t.stopNodes[n] === r || t.stopNodes[n] === "*." + e) return !0;
78
- return !1;
79
- }
80
- function ze(r, t) {
81
- if (r && r.length > 0 && t.processEntities)
82
- for (let e = 0; e < t.entities.length; e++) {
83
- const n = t.entities[e];
84
- r = r.replace(n.regex, n.val);
85
- }
86
- return r;
87
- }
88
- const Cr = {
89
- attributeNamePrefix: "@_",
90
- attributesGroupName: !1,
91
- textNodeName: "#text",
92
- ignoreAttributes: !0,
93
- cdataPropName: !1,
94
- format: !1,
95
- indentBy: " ",
96
- suppressEmptyNode: !1,
97
- suppressUnpairedNode: !0,
98
- suppressBooleanAttributes: !0,
99
- tagValueProcessor: function(r, t) {
100
- return t;
101
- },
102
- attributeValueProcessor: function(r, t) {
103
- return t;
104
- },
105
- preserveOrder: !1,
106
- commentPropName: !1,
107
- unpairedTags: [],
108
- entities: [
109
- { regex: new RegExp("&", "g"), val: "&amp;" },
110
- //it must be on top
111
- { regex: new RegExp(">", "g"), val: "&gt;" },
112
- { regex: new RegExp("<", "g"), val: "&lt;" },
113
- { regex: new RegExp("'", "g"), val: "&apos;" },
114
- { regex: new RegExp('"', "g"), val: "&quot;" }
115
- ],
116
- processEntities: !0,
117
- stopNodes: [],
118
- // transformTagName: false,
119
- // transformAttributeName: false,
120
- oneListGroup: !1
121
- };
122
- function J(r) {
123
- this.options = Object.assign({}, Cr, r), this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
124
- return !1;
125
- } : (this.ignoreAttributesFn = xr(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = Fr), this.processTextOrObjNode = Ir, this.options.format ? (this.indentate = $r, this.tagEndChar = `>
126
- `, this.newLine = `
127
- `) : (this.indentate = function() {
128
- return "";
129
- }, this.tagEndChar = ">", this.newLine = "");
130
- }
131
- J.prototype.build = function(r) {
132
- return this.options.preserveOrder ? Tr(r, this.options) : (Array.isArray(r) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (r = {
133
- [this.options.arrayNodeName]: r
134
- }), this.j2x(r, 0, []).val);
135
- };
136
- J.prototype.j2x = function(r, t, e) {
137
- let n = "", s = "";
138
- const o = e.join(".");
139
- for (let i in r)
140
- if (Object.prototype.hasOwnProperty.call(r, i))
141
- if (typeof r[i] > "u")
142
- this.isAttribute(i) && (s += "");
143
- else if (r[i] === null)
144
- this.isAttribute(i) || i === this.options.cdataPropName ? s += "" : i[0] === "?" ? s += this.indentate(t) + "<" + i + "?" + this.tagEndChar : s += this.indentate(t) + "<" + i + "/" + this.tagEndChar;
145
- else if (r[i] instanceof Date)
146
- s += this.buildTextValNode(r[i], i, "", t);
147
- else if (typeof r[i] != "object") {
148
- const a = this.isAttribute(i);
149
- if (a && !this.ignoreAttributesFn(a, o))
150
- n += this.buildAttrPairStr(a, "" + r[i]);
151
- else if (!a)
152
- if (i === this.options.textNodeName) {
153
- let l = this.options.tagValueProcessor(i, "" + r[i]);
154
- s += this.replaceEntitiesValue(l);
155
- } else
156
- s += this.buildTextValNode(r[i], i, "", t);
157
- } else if (Array.isArray(r[i])) {
158
- const a = r[i].length;
159
- let l = "", c = "";
160
- for (let u = 0; u < a; u++) {
161
- const f = r[i][u];
162
- if (!(typeof f > "u")) if (f === null)
163
- i[0] === "?" ? s += this.indentate(t) + "<" + i + "?" + this.tagEndChar : s += this.indentate(t) + "<" + i + "/" + this.tagEndChar;
164
- else if (typeof f == "object")
165
- if (this.options.oneListGroup) {
166
- const h = this.j2x(f, t + 1, e.concat(i));
167
- l += h.val, this.options.attributesGroupName && f.hasOwnProperty(this.options.attributesGroupName) && (c += h.attrStr);
168
- } else
169
- l += this.processTextOrObjNode(f, i, t, e);
170
- else if (this.options.oneListGroup) {
171
- let h = this.options.tagValueProcessor(i, f);
172
- h = this.replaceEntitiesValue(h), l += h;
173
- } else
174
- l += this.buildTextValNode(f, i, "", t);
175
- }
176
- this.options.oneListGroup && (l = this.buildObjectNode(l, i, c, t)), s += l;
177
- } else if (this.options.attributesGroupName && i === this.options.attributesGroupName) {
178
- const a = Object.keys(r[i]), l = a.length;
179
- for (let c = 0; c < l; c++)
180
- n += this.buildAttrPairStr(a[c], "" + r[i][a[c]]);
181
- } else
182
- s += this.processTextOrObjNode(r[i], i, t, e);
183
- return { attrStr: n, val: s };
184
- };
185
- J.prototype.buildAttrPairStr = function(r, t) {
186
- return t = this.options.attributeValueProcessor(r, "" + t), t = this.replaceEntitiesValue(t), this.options.suppressBooleanAttributes && t === "true" ? " " + r : " " + r + '="' + t + '"';
187
- };
188
- function Ir(r, t, e, n) {
189
- const s = this.j2x(r, e + 1, n.concat(t));
190
- return r[this.options.textNodeName] !== void 0 && Object.keys(r).length === 1 ? this.buildTextValNode(r[this.options.textNodeName], t, s.attrStr, e) : this.buildObjectNode(s.val, t, s.attrStr, e);
191
- }
192
- J.prototype.buildObjectNode = function(r, t, e, n) {
193
- if (r === "")
194
- return t[0] === "?" ? this.indentate(n) + "<" + t + e + "?" + this.tagEndChar : this.indentate(n) + "<" + t + e + this.closeTag(t) + this.tagEndChar;
195
- {
196
- let s = "</" + t + this.tagEndChar, o = "";
197
- return t[0] === "?" && (o = "?", s = ""), (e || e === "") && r.indexOf("<") === -1 ? this.indentate(n) + "<" + t + e + o + ">" + r + s : this.options.commentPropName !== !1 && t === this.options.commentPropName && o.length === 0 ? this.indentate(n) + `<!--${r}-->` + this.newLine : this.indentate(n) + "<" + t + e + o + this.tagEndChar + r + this.indentate(n) + s;
198
- }
199
- };
200
- J.prototype.closeTag = function(r) {
201
- let t = "";
202
- return this.options.unpairedTags.indexOf(r) !== -1 ? this.options.suppressUnpairedNode || (t = "/") : this.options.suppressEmptyNode ? t = "/" : t = `></${r}`, t;
203
- };
204
- J.prototype.buildTextValNode = function(r, t, e, n) {
205
- if (this.options.cdataPropName !== !1 && t === this.options.cdataPropName)
206
- return this.indentate(n) + `<![CDATA[${r}]]>` + this.newLine;
207
- if (this.options.commentPropName !== !1 && t === this.options.commentPropName)
208
- return this.indentate(n) + `<!--${r}-->` + this.newLine;
209
- if (t[0] === "?")
210
- return this.indentate(n) + "<" + t + e + "?" + this.tagEndChar;
211
- {
212
- let s = this.options.tagValueProcessor(t, r);
213
- return s = this.replaceEntitiesValue(s), s === "" ? this.indentate(n) + "<" + t + e + this.closeTag(t) + this.tagEndChar : this.indentate(n) + "<" + t + e + ">" + s + "</" + t + this.tagEndChar;
214
- }
215
- };
216
- J.prototype.replaceEntitiesValue = function(r) {
217
- if (r && r.length > 0 && this.options.processEntities)
218
- for (let t = 0; t < this.options.entities.length; t++) {
219
- const e = this.options.entities[t];
220
- r = r.replace(e.regex, e.val);
221
- }
222
- return r;
223
- };
224
- function $r(r) {
225
- return this.options.indentBy.repeat(r);
226
- }
227
- function Fr(r) {
228
- return r.startsWith(this.options.attributeNamePrefix) && r !== this.options.textNodeName ? r.substr(this.attrPrefixLen) : !1;
229
- }
230
- const Z = (r, { fileId: t, path: e, name: n }) => {
231
- if (e !== void 0)
232
- return I(r.webDavPath, e);
233
- if (t !== void 0) {
234
- if (ne(r))
235
- throw new Error("public spaces need a path provided");
236
- return I("spaces", t, n || "");
237
- }
238
- return r.webDavPath;
239
- }, jr = (r, t) => ({
240
- copyFiles(e, { path: n, fileId: s }, o, {
241
- path: i,
242
- parentFolderId: a,
243
- name: l
244
- }, { overwrite: c, ...u } = {}) {
245
- const f = Z(e, {
246
- fileId: s,
247
- path: n
248
- }), h = Z(o, {
249
- fileId: a,
250
- path: i,
251
- name: l
252
- });
253
- return r.copy(f, h, {
254
- overwrite: c || !1,
255
- ...u
256
- });
257
- }
258
- }), Rr = (r, t, e) => ({
259
- async createFolder(n, { path: s, parentFolderId: o, folderName: i, fetchFolder: a = !0, ...l }) {
260
- const c = Z(n, { fileId: o, path: s, name: i });
261
- if (await r.mkcol(c), a)
262
- return t.getFileInfo(n, { path: s }, l);
263
- }
264
- }), Lr = (r, { axiosClient: t }) => ({
265
- async getFileContents(e, { fileId: n, path: s }, {
266
- responseType: o = "text",
267
- noCache: i = !0,
268
- headers: a,
269
- ...l
270
- } = {}) {
271
- try {
272
- const c = Z(e, { fileId: n, path: s }), u = await t.get(r.getFileUrl(c), {
273
- responseType: o,
274
- headers: {
275
- ...i && { "Cache-Control": "no-cache" },
276
- ...a || {}
277
- },
278
- ...l
279
- });
280
- return {
281
- response: u,
282
- body: u.data,
283
- headers: {
284
- ETag: u.headers.etag,
285
- "OC-ETag": u.headers["oc-etag"],
286
- "OC-FileId": u.headers["oc-fileid"]
287
- }
288
- };
289
- } catch (c) {
290
- const { message: u, response: f } = c;
291
- throw new qe(u, f, f.status);
292
- }
293
- }
294
- }), Ur = (r, t) => ({
295
- async getFileInfo(e, n, s) {
296
- return (await r.listFiles(e, n, {
297
- depth: 0,
298
- ...s
299
- })).resource;
300
- }
301
- }), Dr = (r, t, e, { axiosClient: n, baseUrl: s }) => ({
302
- async getFileUrl(o, i, {
303
- disposition: a = "attachment",
304
- version: l = null,
305
- username: c = "",
306
- ...u
307
- }) {
308
- if (a === "inline") {
309
- const h = await t.getFileContents(o, i, {
310
- responseType: "blob",
311
- ...u
312
- });
313
- return URL.createObjectURL(h.body);
314
- }
315
- if (l) {
316
- if (!c)
317
- throw new Error("username is required for URL signing");
318
- const h = r.getFileUrl(I("meta", i.fileId, "v", l));
319
- return await Nr(s, n).signUrl(h, c);
320
- }
321
- if (i.downloadURL)
322
- return i.downloadURL;
323
- const { downloadURL: f } = await e.getFileInfo(o, i, {
324
- davProperties: [ft.DownloadURL]
325
- });
326
- return f;
327
- },
328
- revokeUrl: (o) => {
329
- o && o.startsWith("blob:") && URL.revokeObjectURL(o);
330
- }
331
- }), kr = (r, t) => ({
332
- getPublicFileUrl(e, n) {
333
- return r.getFileUrl(I("public-files", n));
334
- }
335
- }), Mr = (r, t, e) => ({
336
- async listFiles(n, { path: s, fileId: o } = {}, { depth: i = 1, davProperties: a, isTrash: l = !1, ...c } = {}) {
337
- let u;
338
- if (ne(n)) {
339
- u = await r.propfind(I(n.webDavPath, s), {
340
- depth: i,
341
- properties: a || Et.PublicLink,
342
- ...c
343
- }), u.forEach((g) => {
344
- g.filename = g.filename.split("/").slice(1).join("/");
345
- }), u.length === 1 && (u[0].filename = I(n.id, s, {
346
- leadingSlash: !0
347
- })), u.forEach((g) => {
348
- g.filename = g.filename.split("/").slice(2).join("/");
349
- });
350
- const h = n.driveAlias.startsWith("ocm/") ? "ocm" : "public-link";
351
- if ((!s || s === "/") && i > 0 && h === "ocm" && u[0].props[ft.PublicLinkItemType] === "file" && (u = [
352
- {
353
- basename: n.fileId,
354
- type: "directory",
355
- filename: "",
356
- props: {}
357
- },
358
- ...u
359
- ]), !s) {
360
- const [g, ...p] = u;
361
- return {
362
- resource: vr({
363
- ...g,
364
- id: n.id,
365
- driveAlias: n.driveAlias,
366
- webDavPath: n.webDavPath,
367
- publicLinkType: h
368
- }),
369
- children: p.map((m) => lt(m, r.extraProps))
370
- };
371
- }
372
- const d = u.map((g) => lt(g, r.extraProps));
373
- return { resource: d[0], children: d.slice(1) };
374
- }
375
- const f = async () => {
376
- const h = await t.getPathForFileId(o);
377
- return this.listFiles(n, { path: h }, { depth: i, davProperties: a });
378
- };
379
- try {
380
- let h = "";
381
- if (l ? h = We(n.id) : h = Z(n, { fileId: o, path: s }), u = await r.propfind(h, {
382
- depth: i,
383
- properties: a || Et.Default,
384
- ...c
385
- }), l)
386
- return {
387
- resource: lt(u[0], r.extraProps),
388
- children: u.slice(1).map(wr)
389
- };
390
- const d = u.map((p) => lt(p, r.extraProps)), g = o === n.id;
391
- return o && !g && d[0].fileId && o !== d[0].fileId ? f() : { resource: d[0], children: d.slice(1) };
392
- } catch (h) {
393
- if (h.statusCode === 404 && o)
394
- return f();
395
- throw h;
396
- }
397
- }
398
- }), _r = (r, t) => ({
399
- moveFiles(e, { path: n, fileId: s }, o, {
400
- path: i,
401
- parentFolderId: a,
402
- name: l
403
- }, { overwrite: c, ...u } = {}) {
404
- const f = Z(e, {
405
- fileId: s,
406
- path: n
407
- }), h = Z(o, {
408
- fileId: a,
409
- path: i,
410
- name: l
411
- });
412
- return r.move(f, h, {
413
- overwrite: c || !1,
414
- ...u
415
- });
416
- }
417
- }), Vr = (r, t, e) => ({
418
- async putFileContents(n, {
419
- fileName: s,
420
- path: o,
421
- parentFolderId: i,
422
- content: a = "",
423
- previousEntityTag: l = "",
424
- overwrite: c,
425
- onUploadProgress: u = null,
426
- ...f
427
- }) {
428
- const h = Z(n, { fileId: i, name: s, path: o }), { result: d } = await r.put(h, a, {
429
- previousEntityTag: l,
430
- overwrite: c,
431
- onUploadProgress: u,
432
- ...f
433
- });
434
- return t.getFileInfo(n, {
435
- fileId: d.headers.get("Oc-Fileid"),
436
- path: o
437
- });
438
- }
439
- }), Br = (r, t) => ({
440
- deleteFile(e, { path: n, ...s }) {
441
- return r.delete(I(e.webDavPath, n), s);
442
- }
443
- }), Wr = (r, t) => ({
444
- restoreFile(e, { id: n }, { path: s }, { overwrite: o, ...i } = {}) {
445
- if (ne(e))
446
- return;
447
- const a = I(e.webDavPath, s);
448
- return r.move(I(e.webDavTrashPath, n), a, {
449
- overwrite: o,
450
- ...i
451
- });
452
- }
453
- }), qr = (r, t) => ({
454
- restoreFileVersion(e, { parentFolderId: n, name: s, path: o }, i, a = {}) {
455
- const l = Z(e, { path: o, fileId: n, name: s }), c = I("meta", n, "v", i, { leadingSlash: !0 }), u = I("files", l, { leadingSlash: !0 });
456
- return r.copy(c, u, a);
457
- }
458
- }), Gr = (r, t) => ({
459
- clearTrashBin(e, { id: n, ...s } = {}) {
460
- let o = We(e.id);
461
- return n && (o = I(o, n)), r.delete(o, s);
462
- }
463
- }), zr = (r, t) => ({
464
- async search(e, { davProperties: n = Et.Default, searchLimit: s, ...o }) {
465
- const i = "/spaces/", { range: a, results: l } = await r.report(i, {
466
- pattern: e,
467
- limit: s,
468
- properties: n,
469
- ...o
470
- });
471
- return {
472
- resources: l.map((c) => ({
473
- ...lt(c, r.extraProps),
474
- highlights: c.props[ft.Highlights] || ""
475
- })),
476
- totalResults: a ? parseInt(a?.split("/")[1]) : null
477
- };
478
- }
479
- }), Hr = (r, t) => ({
480
- async getPathForFileId(e, n = {}) {
481
- return (await r.propfind(I("meta", e, { leadingSlash: !0 }), {
482
- properties: [ft.MetaPathForUser],
483
- ...n
484
- }))[0].props[ft.MetaPathForUser];
485
- }
486
- });
487
- var Xr = { 2: (r) => {
488
- function t(s, o, i) {
489
- s instanceof RegExp && (s = e(s, i)), o instanceof RegExp && (o = e(o, i));
490
- var a = n(s, o, i);
491
- return a && { start: a[0], end: a[1], pre: i.slice(0, a[0]), body: i.slice(a[0] + s.length, a[1]), post: i.slice(a[1] + o.length) };
492
- }
493
- function e(s, o) {
494
- var i = o.match(s);
495
- return i ? i[0] : null;
496
- }
497
- function n(s, o, i) {
498
- var a, l, c, u, f, h = i.indexOf(s), d = i.indexOf(o, h + 1), g = h;
499
- if (h >= 0 && d > 0) {
500
- for (a = [], c = i.length; g >= 0 && !f; ) g == h ? (a.push(g), h = i.indexOf(s, g + 1)) : a.length == 1 ? f = [a.pop(), d] : ((l = a.pop()) < c && (c = l, u = d), d = i.indexOf(o, g + 1)), g = h < d && h >= 0 ? h : d;
501
- a.length && (f = [c, u]);
502
- }
503
- return f;
504
- }
505
- r.exports = t, t.range = n;
506
- }, 47: (r, t, e) => {
507
- var n = e(410), s = function(c) {
508
- return typeof c == "string";
509
- };
510
- function o(c, u) {
511
- for (var f = [], h = 0; h < c.length; h++) {
512
- var d = c[h];
513
- d && d !== "." && (d === ".." ? f.length && f[f.length - 1] !== ".." ? f.pop() : u && f.push("..") : f.push(d));
514
- }
515
- return f;
516
- }
517
- var i = /^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/, a = {};
518
- function l(c) {
519
- return i.exec(c).slice(1);
520
- }
521
- a.resolve = function() {
522
- for (var c = "", u = !1, f = arguments.length - 1; f >= -1 && !u; f--) {
523
- var h = f >= 0 ? arguments[f] : it.cwd();
524
- if (!s(h)) throw new TypeError("Arguments to path.resolve must be strings");
525
- h && (c = h + "/" + c, u = h.charAt(0) === "/");
526
- }
527
- return (u ? "/" : "") + (c = o(c.split("/"), !u).join("/")) || ".";
528
- }, a.normalize = function(c) {
529
- var u = a.isAbsolute(c), f = c.substr(-1) === "/";
530
- return (c = o(c.split("/"), !u).join("/")) || u || (c = "."), c && f && (c += "/"), (u ? "/" : "") + c;
531
- }, a.isAbsolute = function(c) {
532
- return c.charAt(0) === "/";
533
- }, a.join = function() {
534
- for (var c = "", u = 0; u < arguments.length; u++) {
535
- var f = arguments[u];
536
- if (!s(f)) throw new TypeError("Arguments to path.join must be strings");
537
- f && (c += c ? "/" + f : f);
538
- }
539
- return a.normalize(c);
540
- }, a.relative = function(c, u) {
541
- function f(y) {
542
- for (var v = 0; v < y.length && y[v] === ""; v++) ;
543
- for (var w = y.length - 1; w >= 0 && y[w] === ""; w--) ;
544
- return v > w ? [] : y.slice(v, w + 1);
545
- }
546
- c = a.resolve(c).substr(1), u = a.resolve(u).substr(1);
547
- for (var h = f(c.split("/")), d = f(u.split("/")), g = Math.min(h.length, d.length), p = g, m = 0; m < g; m++) if (h[m] !== d[m]) {
548
- p = m;
549
- break;
550
- }
551
- var b = [];
552
- for (m = p; m < h.length; m++) b.push("..");
553
- return (b = b.concat(d.slice(p))).join("/");
554
- }, a._makeLong = function(c) {
555
- return c;
556
- }, a.dirname = function(c) {
557
- var u = l(c), f = u[0], h = u[1];
558
- return f || h ? (h && (h = h.substr(0, h.length - 1)), f + h) : ".";
559
- }, a.basename = function(c, u) {
560
- var f = l(c)[2];
561
- return u && f.substr(-1 * u.length) === u && (f = f.substr(0, f.length - u.length)), f;
562
- }, a.extname = function(c) {
563
- return l(c)[3];
564
- }, a.format = function(c) {
565
- if (!n.isObject(c)) throw new TypeError("Parameter 'pathObject' must be an object, not " + typeof c);
566
- var u = c.root || "";
567
- if (!s(u)) throw new TypeError("'pathObject.root' must be a string or undefined, not " + typeof c.root);
568
- return (c.dir ? c.dir + a.sep : "") + (c.base || "");
569
- }, a.parse = function(c) {
570
- if (!s(c)) throw new TypeError("Parameter 'pathString' must be a string, not " + typeof c);
571
- var u = l(c);
572
- if (!u || u.length !== 4) throw new TypeError("Invalid path '" + c + "'");
573
- return u[1] = u[1] || "", u[2] = u[2] || "", u[3] = u[3] || "", { root: u[0], dir: u[0] + u[1].slice(0, u[1].length - 1), base: u[2], ext: u[3], name: u[2].slice(0, u[2].length - u[3].length) };
574
- }, a.sep = "/", a.delimiter = ":", r.exports = a;
575
- }, 101: function(r, t, e) {
576
- var n;
577
- r = e.nmd(r), (function() {
578
- var s = (r && r.exports, typeof St == "object" && St);
579
- s.global !== s && s.window;
580
- var o = function(u) {
581
- this.message = u;
582
- };
583
- (o.prototype = new Error()).name = "InvalidCharacterError";
584
- var i = function(u) {
585
- throw new o(u);
586
- }, a = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", l = /[\t\n\f\r ]/g, c = { encode: function(u) {
587
- u = String(u), /[^\0-\xFF]/.test(u) && i("The string to be encoded contains characters outside of the Latin1 range.");
588
- for (var f, h, d, g, p = u.length % 3, m = "", b = -1, y = u.length - p; ++b < y; ) f = u.charCodeAt(b) << 16, h = u.charCodeAt(++b) << 8, d = u.charCodeAt(++b), m += a.charAt((g = f + h + d) >> 18 & 63) + a.charAt(g >> 12 & 63) + a.charAt(g >> 6 & 63) + a.charAt(63 & g);
589
- return p == 2 ? (f = u.charCodeAt(b) << 8, h = u.charCodeAt(++b), m += a.charAt((g = f + h) >> 10) + a.charAt(g >> 4 & 63) + a.charAt(g << 2 & 63) + "=") : p == 1 && (g = u.charCodeAt(b), m += a.charAt(g >> 2) + a.charAt(g << 4 & 63) + "=="), m;
590
- }, decode: function(u) {
591
- var f = (u = String(u).replace(l, "")).length;
592
- f % 4 == 0 && (f = (u = u.replace(/==?$/, "")).length), (f % 4 == 1 || /[^+a-zA-Z0-9/]/.test(u)) && i("Invalid character: the string to be decoded is not correctly encoded.");
593
- for (var h, d, g = 0, p = "", m = -1; ++m < f; ) d = a.indexOf(u.charAt(m)), h = g % 4 ? 64 * h + d : d, g++ % 4 && (p += String.fromCharCode(255 & h >> (-2 * g & 6)));
594
- return p;
595
- }, version: "1.0.0" };
596
- (n = (function() {
597
- return c;
598
- }).call(t, e, t, r)) === void 0 || (r.exports = n);
599
- })();
600
- }, 135: (r) => {
601
- function t(e) {
602
- return !!e.constructor && typeof e.constructor.isBuffer == "function" && e.constructor.isBuffer(e);
603
- }
604
- r.exports = function(e) {
605
- return e != null && (t(e) || (function(n) {
606
- return typeof n.readFloatLE == "function" && typeof n.slice == "function" && t(n.slice(0, 0));
607
- })(e) || !!e._isBuffer);
608
- };
609
- }, 172: (r, t) => {
610
- t.d = function(e) {
611
- if (!e) return 0;
612
- for (var n = (e = e.toString()).length, s = e.length; s--; ) {
613
- var o = e.charCodeAt(s);
614
- 56320 <= o && o <= 57343 && s--, 127 < o && o <= 2047 ? n++ : 2047 < o && o <= 65535 && (n += 2);
615
- }
616
- return n;
617
- };
618
- }, 285: (r, t, e) => {
619
- var n = e(2);
620
- r.exports = function(b) {
621
- return b ? (b.substr(0, 2) === "{}" && (b = "\\{\\}" + b.substr(2)), m((function(y) {
622
- return y.split("\\\\").join(s).split("\\{").join(o).split("\\}").join(i).split("\\,").join(a).split("\\.").join(l);
623
- })(b), !0).map(u)) : [];
624
- };
625
- var s = "\0SLASH" + Math.random() + "\0", o = "\0OPEN" + Math.random() + "\0", i = "\0CLOSE" + Math.random() + "\0", a = "\0COMMA" + Math.random() + "\0", l = "\0PERIOD" + Math.random() + "\0";
626
- function c(b) {
627
- return parseInt(b, 10) == b ? parseInt(b, 10) : b.charCodeAt(0);
628
- }
629
- function u(b) {
630
- return b.split(s).join("\\").split(o).join("{").split(i).join("}").split(a).join(",").split(l).join(".");
631
- }
632
- function f(b) {
633
- if (!b) return [""];
634
- var y = [], v = n("{", "}", b);
635
- if (!v) return b.split(",");
636
- var w = v.pre, x = v.body, P = v.post, E = w.split(",");
637
- E[E.length - 1] += "{" + x + "}";
638
- var T = f(P);
639
- return P.length && (E[E.length - 1] += T.shift(), E.push.apply(E, T)), y.push.apply(y, E), y;
640
- }
641
- function h(b) {
642
- return "{" + b + "}";
643
- }
644
- function d(b) {
645
- return /^-?0\d/.test(b);
646
- }
647
- function g(b, y) {
648
- return b <= y;
649
- }
650
- function p(b, y) {
651
- return b >= y;
652
- }
653
- function m(b, y) {
654
- var v = [], w = n("{", "}", b);
655
- if (!w) return [b];
656
- var x = w.pre, P = w.post.length ? m(w.post, !1) : [""];
657
- if (/\$$/.test(w.pre)) for (var E = 0; E < P.length; E++) {
658
- var T = x + "{" + w.body + "}" + P[E];
659
- v.push(T);
660
- }
661
- else {
662
- var A, F, rt = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(w.body), nt = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(w.body), N = rt || nt, gt = w.body.indexOf(",") >= 0;
663
- if (!N && !gt) return w.post.match(/,(?!,).*\}/) ? m(b = w.pre + "{" + w.body + i + w.post) : [b];
664
- if (N) A = w.body.split(/\.\./);
665
- else if ((A = f(w.body)).length === 1 && (A = m(A[0], !1).map(h)).length === 1) return P.map((function(yr) {
666
- return w.pre + A[0] + yr;
667
- }));
668
- if (N) {
669
- var dt = c(A[0]), mt = c(A[1]), q = Math.max(A[0].length, A[1].length), H = A.length == 3 ? Math.abs(c(A[2])) : 1, yt = g;
670
- mt < dt && (H *= -1, yt = p);
671
- var Ot = A.some(d);
672
- F = [];
673
- for (var X = dt; yt(X, mt); X += H) {
674
- var K;
675
- if (nt) (K = String.fromCharCode(X)) === "\\" && (K = "");
676
- else if (K = String(X), Ot) {
677
- var ce = q - K.length;
678
- if (ce > 0) {
679
- var he = new Array(ce + 1).join("0");
680
- K = X < 0 ? "-" + he + K.slice(1) : he + K;
681
- }
682
- }
683
- F.push(K);
684
- }
685
- } else {
686
- F = [];
687
- for (var st = 0; st < A.length; st++) F.push.apply(F, m(A[st], !1));
688
- }
689
- for (st = 0; st < F.length; st++) for (E = 0; E < P.length; E++) T = x + F[st] + P[E], (!y || N || T) && v.push(T);
690
- }
691
- return v;
692
- }
693
- }, 298: (r) => {
694
- var t, e;
695
- t = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", e = { rotl: function(n, s) {
696
- return n << s | n >>> 32 - s;
697
- }, rotr: function(n, s) {
698
- return n << 32 - s | n >>> s;
699
- }, endian: function(n) {
700
- if (n.constructor == Number) return 16711935 & e.rotl(n, 8) | 4278255360 & e.rotl(n, 24);
701
- for (var s = 0; s < n.length; s++) n[s] = e.endian(n[s]);
702
- return n;
703
- }, randomBytes: function(n) {
704
- for (var s = []; n > 0; n--) s.push(Math.floor(256 * Math.random()));
705
- return s;
706
- }, bytesToWords: function(n) {
707
- for (var s = [], o = 0, i = 0; o < n.length; o++, i += 8) s[i >>> 5] |= n[o] << 24 - i % 32;
708
- return s;
709
- }, wordsToBytes: function(n) {
710
- for (var s = [], o = 0; o < 32 * n.length; o += 8) s.push(n[o >>> 5] >>> 24 - o % 32 & 255);
711
- return s;
712
- }, bytesToHex: function(n) {
713
- for (var s = [], o = 0; o < n.length; o++) s.push((n[o] >>> 4).toString(16)), s.push((15 & n[o]).toString(16));
714
- return s.join("");
715
- }, hexToBytes: function(n) {
716
- for (var s = [], o = 0; o < n.length; o += 2) s.push(parseInt(n.substr(o, 2), 16));
717
- return s;
718
- }, bytesToBase64: function(n) {
719
- for (var s = [], o = 0; o < n.length; o += 3) for (var i = n[o] << 16 | n[o + 1] << 8 | n[o + 2], a = 0; a < 4; a++) 8 * o + 6 * a <= 8 * n.length ? s.push(t.charAt(i >>> 6 * (3 - a) & 63)) : s.push("=");
720
- return s.join("");
721
- }, base64ToBytes: function(n) {
722
- n = n.replace(/[^A-Z0-9+\/]/gi, "");
723
- for (var s = [], o = 0, i = 0; o < n.length; i = ++o % 4) i != 0 && s.push((t.indexOf(n.charAt(o - 1)) & Math.pow(2, -2 * i + 8) - 1) << 2 * i | t.indexOf(n.charAt(o)) >>> 6 - 2 * i);
724
- return s;
725
- } }, r.exports = e;
726
- }, 345: () => {
727
- }, 388: () => {
728
- }, 410: () => {
729
- }, 526: (r) => {
730
- var t = { utf8: { stringToBytes: function(e) {
731
- return t.bin.stringToBytes(unescape(encodeURIComponent(e)));
732
- }, bytesToString: function(e) {
733
- return decodeURIComponent(escape(t.bin.bytesToString(e)));
734
- } }, bin: { stringToBytes: function(e) {
735
- for (var n = [], s = 0; s < e.length; s++) n.push(255 & e.charCodeAt(s));
736
- return n;
737
- }, bytesToString: function(e) {
738
- for (var n = [], s = 0; s < e.length; s++) n.push(String.fromCharCode(e[s]));
739
- return n.join("");
740
- } } };
741
- r.exports = t;
742
- }, 542: (r, t, e) => {
743
- (function() {
744
- var n = e(298), s = e(526).utf8, o = e(135), i = e(526).bin, a = function(l, c) {
745
- l.constructor == String ? l = c && c.encoding === "binary" ? i.stringToBytes(l) : s.stringToBytes(l) : o(l) ? l = Array.prototype.slice.call(l, 0) : Array.isArray(l) || l.constructor === Uint8Array || (l = l.toString());
746
- for (var u = n.bytesToWords(l), f = 8 * l.length, h = 1732584193, d = -271733879, g = -1732584194, p = 271733878, m = 0; m < u.length; m++) u[m] = 16711935 & (u[m] << 8 | u[m] >>> 24) | 4278255360 & (u[m] << 24 | u[m] >>> 8);
747
- u[f >>> 5] |= 128 << f % 32, u[14 + (f + 64 >>> 9 << 4)] = f;
748
- var b = a._ff, y = a._gg, v = a._hh, w = a._ii;
749
- for (m = 0; m < u.length; m += 16) {
750
- var x = h, P = d, E = g, T = p;
751
- h = b(h, d, g, p, u[m + 0], 7, -680876936), p = b(p, h, d, g, u[m + 1], 12, -389564586), g = b(g, p, h, d, u[m + 2], 17, 606105819), d = b(d, g, p, h, u[m + 3], 22, -1044525330), h = b(h, d, g, p, u[m + 4], 7, -176418897), p = b(p, h, d, g, u[m + 5], 12, 1200080426), g = b(g, p, h, d, u[m + 6], 17, -1473231341), d = b(d, g, p, h, u[m + 7], 22, -45705983), h = b(h, d, g, p, u[m + 8], 7, 1770035416), p = b(p, h, d, g, u[m + 9], 12, -1958414417), g = b(g, p, h, d, u[m + 10], 17, -42063), d = b(d, g, p, h, u[m + 11], 22, -1990404162), h = b(h, d, g, p, u[m + 12], 7, 1804603682), p = b(p, h, d, g, u[m + 13], 12, -40341101), g = b(g, p, h, d, u[m + 14], 17, -1502002290), h = y(h, d = b(d, g, p, h, u[m + 15], 22, 1236535329), g, p, u[m + 1], 5, -165796510), p = y(p, h, d, g, u[m + 6], 9, -1069501632), g = y(g, p, h, d, u[m + 11], 14, 643717713), d = y(d, g, p, h, u[m + 0], 20, -373897302), h = y(h, d, g, p, u[m + 5], 5, -701558691), p = y(p, h, d, g, u[m + 10], 9, 38016083), g = y(g, p, h, d, u[m + 15], 14, -660478335), d = y(d, g, p, h, u[m + 4], 20, -405537848), h = y(h, d, g, p, u[m + 9], 5, 568446438), p = y(p, h, d, g, u[m + 14], 9, -1019803690), g = y(g, p, h, d, u[m + 3], 14, -187363961), d = y(d, g, p, h, u[m + 8], 20, 1163531501), h = y(h, d, g, p, u[m + 13], 5, -1444681467), p = y(p, h, d, g, u[m + 2], 9, -51403784), g = y(g, p, h, d, u[m + 7], 14, 1735328473), h = v(h, d = y(d, g, p, h, u[m + 12], 20, -1926607734), g, p, u[m + 5], 4, -378558), p = v(p, h, d, g, u[m + 8], 11, -2022574463), g = v(g, p, h, d, u[m + 11], 16, 1839030562), d = v(d, g, p, h, u[m + 14], 23, -35309556), h = v(h, d, g, p, u[m + 1], 4, -1530992060), p = v(p, h, d, g, u[m + 4], 11, 1272893353), g = v(g, p, h, d, u[m + 7], 16, -155497632), d = v(d, g, p, h, u[m + 10], 23, -1094730640), h = v(h, d, g, p, u[m + 13], 4, 681279174), p = v(p, h, d, g, u[m + 0], 11, -358537222), g = v(g, p, h, d, u[m + 3], 16, -722521979), d = v(d, g, p, h, u[m + 6], 23, 76029189), h = v(h, d, g, p, u[m + 9], 4, -640364487), p = v(p, h, d, g, u[m + 12], 11, -421815835), g = v(g, p, h, d, u[m + 15], 16, 530742520), h = w(h, d = v(d, g, p, h, u[m + 2], 23, -995338651), g, p, u[m + 0], 6, -198630844), p = w(p, h, d, g, u[m + 7], 10, 1126891415), g = w(g, p, h, d, u[m + 14], 15, -1416354905), d = w(d, g, p, h, u[m + 5], 21, -57434055), h = w(h, d, g, p, u[m + 12], 6, 1700485571), p = w(p, h, d, g, u[m + 3], 10, -1894986606), g = w(g, p, h, d, u[m + 10], 15, -1051523), d = w(d, g, p, h, u[m + 1], 21, -2054922799), h = w(h, d, g, p, u[m + 8], 6, 1873313359), p = w(p, h, d, g, u[m + 15], 10, -30611744), g = w(g, p, h, d, u[m + 6], 15, -1560198380), d = w(d, g, p, h, u[m + 13], 21, 1309151649), h = w(h, d, g, p, u[m + 4], 6, -145523070), p = w(p, h, d, g, u[m + 11], 10, -1120210379), g = w(g, p, h, d, u[m + 2], 15, 718787259), d = w(d, g, p, h, u[m + 9], 21, -343485551), h = h + x >>> 0, d = d + P >>> 0, g = g + E >>> 0, p = p + T >>> 0;
752
- }
753
- return n.endian([h, d, g, p]);
754
- };
755
- a._ff = function(l, c, u, f, h, d, g) {
756
- var p = l + (c & u | ~c & f) + (h >>> 0) + g;
757
- return (p << d | p >>> 32 - d) + c;
758
- }, a._gg = function(l, c, u, f, h, d, g) {
759
- var p = l + (c & f | u & ~f) + (h >>> 0) + g;
760
- return (p << d | p >>> 32 - d) + c;
761
- }, a._hh = function(l, c, u, f, h, d, g) {
762
- var p = l + (c ^ u ^ f) + (h >>> 0) + g;
763
- return (p << d | p >>> 32 - d) + c;
764
- }, a._ii = function(l, c, u, f, h, d, g) {
765
- var p = l + (u ^ (c | ~f)) + (h >>> 0) + g;
766
- return (p << d | p >>> 32 - d) + c;
767
- }, a._blocksize = 16, a._digestsize = 16, r.exports = function(l, c) {
768
- if (l == null) throw new Error("Illegal argument " + l);
769
- var u = n.wordsToBytes(a(l, c));
770
- return c && c.asBytes ? u : c && c.asString ? i.bytesToString(u) : n.bytesToHex(u);
771
- };
772
- })();
773
- }, 647: (r, t) => {
774
- var e = Object.prototype.hasOwnProperty;
775
- function n(o) {
776
- try {
777
- return decodeURIComponent(o.replace(/\+/g, " "));
778
- } catch {
779
- return null;
780
- }
781
- }
782
- function s(o) {
783
- try {
784
- return encodeURIComponent(o);
785
- } catch {
786
- return null;
787
- }
788
- }
789
- t.stringify = function(o, i) {
790
- i = i || "";
791
- var a, l, c = [];
792
- for (l in typeof i != "string" && (i = "?"), o) if (e.call(o, l)) {
793
- if ((a = o[l]) || a != null && !isNaN(a) || (a = ""), l = s(l), a = s(a), l === null || a === null) continue;
794
- c.push(l + "=" + a);
795
- }
796
- return c.length ? i + c.join("&") : "";
797
- }, t.parse = function(o) {
798
- for (var i, a = /([^=?#&]+)=?([^&]*)/g, l = {}; i = a.exec(o); ) {
799
- var c = n(i[1]), u = n(i[2]);
800
- c === null || u === null || c in l || (l[c] = u);
801
- }
802
- return l;
803
- };
804
- }, 670: (r) => {
805
- r.exports = function(t, e) {
806
- if (e = e.split(":")[0], !(t = +t)) return !1;
807
- switch (e) {
808
- case "http":
809
- case "ws":
810
- return t !== 80;
811
- case "https":
812
- case "wss":
813
- return t !== 443;
814
- case "ftp":
815
- return t !== 21;
816
- case "gopher":
817
- return t !== 70;
818
- case "file":
819
- return !1;
820
- }
821
- return t !== 0;
822
- };
823
- }, 737: (r, t, e) => {
824
- var n = e(670), s = e(647), o = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/, i = /[\n\r\t]/g, a = /^[A-Za-z][A-Za-z0-9+-.]*:\/\//, l = /:\d+$/, c = /^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i, u = /^[a-zA-Z]:/;
825
- function f(y) {
826
- return (y || "").toString().replace(o, "");
827
- }
828
- var h = [["#", "hash"], ["?", "query"], function(y, v) {
829
- return p(v.protocol) ? y.replace(/\\/g, "/") : y;
830
- }, ["/", "pathname"], ["@", "auth", 1], [NaN, "host", void 0, 1, 1], [/:(\d*)$/, "port", void 0, 1], [NaN, "hostname", void 0, 1, 1]], d = { hash: 1, query: 1 };
831
- function g(y) {
832
- var v, w = (typeof window < "u" ? window : typeof St < "u" ? St : typeof self < "u" ? self : {}).location || {}, x = {}, P = typeof (y = y || w);
833
- if (y.protocol === "blob:") x = new b(unescape(y.pathname), {});
834
- else if (P === "string") for (v in x = new b(y, {}), d) delete x[v];
835
- else if (P === "object") {
836
- for (v in y) v in d || (x[v] = y[v]);
837
- x.slashes === void 0 && (x.slashes = a.test(y.href));
838
- }
839
- return x;
840
- }
841
- function p(y) {
842
- return y === "file:" || y === "ftp:" || y === "http:" || y === "https:" || y === "ws:" || y === "wss:";
843
- }
844
- function m(y, v) {
845
- y = (y = f(y)).replace(i, ""), v = v || {};
846
- var w, x = c.exec(y), P = x[1] ? x[1].toLowerCase() : "", E = !!x[2], T = !!x[3], A = 0;
847
- return E ? T ? (w = x[2] + x[3] + x[4], A = x[2].length + x[3].length) : (w = x[2] + x[4], A = x[2].length) : T ? (w = x[3] + x[4], A = x[3].length) : w = x[4], P === "file:" ? A >= 2 && (w = w.slice(2)) : p(P) ? w = x[4] : P ? E && (w = w.slice(2)) : A >= 2 && p(v.protocol) && (w = x[4]), { protocol: P, slashes: E || p(P), slashesCount: A, rest: w };
848
- }
849
- function b(y, v, w) {
850
- if (y = (y = f(y)).replace(i, ""), !(this instanceof b)) return new b(y, v, w);
851
- var x, P, E, T, A, F, rt = h.slice(), nt = typeof v, N = this, gt = 0;
852
- for (nt !== "object" && nt !== "string" && (w = v, v = null), w && typeof w != "function" && (w = s.parse), x = !(P = m(y || "", v = g(v))).protocol && !P.slashes, N.slashes = P.slashes || x && v.slashes, N.protocol = P.protocol || v.protocol || "", y = P.rest, (P.protocol === "file:" && (P.slashesCount !== 2 || u.test(y)) || !P.slashes && (P.protocol || P.slashesCount < 2 || !p(N.protocol))) && (rt[3] = [/(.*)/, "pathname"]); gt < rt.length; gt++) typeof (T = rt[gt]) != "function" ? (E = T[0], F = T[1], E != E ? N[F] = y : typeof E == "string" ? ~(A = E === "@" ? y.lastIndexOf(E) : y.indexOf(E)) && (typeof T[2] == "number" ? (N[F] = y.slice(0, A), y = y.slice(A + T[2])) : (N[F] = y.slice(A), y = y.slice(0, A))) : (A = E.exec(y)) && (N[F] = A[1], y = y.slice(0, A.index)), N[F] = N[F] || x && T[3] && v[F] || "", T[4] && (N[F] = N[F].toLowerCase())) : y = T(y, N);
853
- w && (N.query = w(N.query)), x && v.slashes && N.pathname.charAt(0) !== "/" && (N.pathname !== "" || v.pathname !== "") && (N.pathname = (function(dt, mt) {
854
- if (dt === "") return mt;
855
- for (var q = (mt || "/").split("/").slice(0, -1).concat(dt.split("/")), H = q.length, yt = q[H - 1], Ot = !1, X = 0; H--; ) q[H] === "." ? q.splice(H, 1) : q[H] === ".." ? (q.splice(H, 1), X++) : X && (H === 0 && (Ot = !0), q.splice(H, 1), X--);
856
- return Ot && q.unshift(""), yt !== "." && yt !== ".." || q.push(""), q.join("/");
857
- })(N.pathname, v.pathname)), N.pathname.charAt(0) !== "/" && p(N.protocol) && (N.pathname = "/" + N.pathname), n(N.port, N.protocol) || (N.host = N.hostname, N.port = ""), N.username = N.password = "", N.auth && (~(A = N.auth.indexOf(":")) ? (N.username = N.auth.slice(0, A), N.username = encodeURIComponent(decodeURIComponent(N.username)), N.password = N.auth.slice(A + 1), N.password = encodeURIComponent(decodeURIComponent(N.password))) : N.username = encodeURIComponent(decodeURIComponent(N.auth)), N.auth = N.password ? N.username + ":" + N.password : N.username), N.origin = N.protocol !== "file:" && p(N.protocol) && N.host ? N.protocol + "//" + N.host : "null", N.href = N.toString();
858
- }
859
- b.prototype = { set: function(y, v, w) {
860
- var x = this;
861
- switch (y) {
862
- case "query":
863
- typeof v == "string" && v.length && (v = (w || s.parse)(v)), x[y] = v;
864
- break;
865
- case "port":
866
- x[y] = v, n(v, x.protocol) ? v && (x.host = x.hostname + ":" + v) : (x.host = x.hostname, x[y] = "");
867
- break;
868
- case "hostname":
869
- x[y] = v, x.port && (v += ":" + x.port), x.host = v;
870
- break;
871
- case "host":
872
- x[y] = v, l.test(v) ? (v = v.split(":"), x.port = v.pop(), x.hostname = v.join(":")) : (x.hostname = v, x.port = "");
873
- break;
874
- case "protocol":
875
- x.protocol = v.toLowerCase(), x.slashes = !w;
876
- break;
877
- case "pathname":
878
- case "hash":
879
- if (v) {
880
- var P = y === "pathname" ? "/" : "#";
881
- x[y] = v.charAt(0) !== P ? P + v : v;
882
- } else x[y] = v;
883
- break;
884
- case "username":
885
- case "password":
886
- x[y] = encodeURIComponent(v);
887
- break;
888
- case "auth":
889
- var E = v.indexOf(":");
890
- ~E ? (x.username = v.slice(0, E), x.username = encodeURIComponent(decodeURIComponent(x.username)), x.password = v.slice(E + 1), x.password = encodeURIComponent(decodeURIComponent(x.password))) : x.username = encodeURIComponent(decodeURIComponent(v));
891
- }
892
- for (var T = 0; T < h.length; T++) {
893
- var A = h[T];
894
- A[4] && (x[A[1]] = x[A[1]].toLowerCase());
895
- }
896
- return x.auth = x.password ? x.username + ":" + x.password : x.username, x.origin = x.protocol !== "file:" && p(x.protocol) && x.host ? x.protocol + "//" + x.host : "null", x.href = x.toString(), x;
897
- }, toString: function(y) {
898
- y && typeof y == "function" || (y = s.stringify);
899
- var v, w = this, x = w.host, P = w.protocol;
900
- P && P.charAt(P.length - 1) !== ":" && (P += ":");
901
- var E = P + (w.protocol && w.slashes || p(w.protocol) ? "//" : "");
902
- return w.username ? (E += w.username, w.password && (E += ":" + w.password), E += "@") : w.password ? (E += ":" + w.password, E += "@") : w.protocol !== "file:" && p(w.protocol) && !x && w.pathname !== "/" && (E += "@"), (x[x.length - 1] === ":" || l.test(w.hostname) && !w.port) && (x += ":"), E += x + w.pathname, (v = typeof w.query == "object" ? y(w.query) : w.query) && (E += v.charAt(0) !== "?" ? "?" + v : v), w.hash && (E += w.hash), E;
903
- } }, b.extractProtocol = m, b.location = g, b.trimLeft = f, b.qs = s, r.exports = b;
904
- }, 800: () => {
905
- }, 805: () => {
906
- }, 829: (r) => {
907
- function t(c) {
908
- return t = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(u) {
909
- return typeof u;
910
- } : function(u) {
911
- return u && typeof Symbol == "function" && u.constructor === Symbol && u !== Symbol.prototype ? "symbol" : typeof u;
912
- }, t(c);
913
- }
914
- function e(c) {
915
- var u = typeof Map == "function" ? /* @__PURE__ */ new Map() : void 0;
916
- return e = function(f) {
917
- if (f === null || (h = f, Function.toString.call(h).indexOf("[native code]") === -1)) return f;
918
- var h;
919
- if (typeof f != "function") throw new TypeError("Super expression must either be null or a function");
920
- if (u !== void 0) {
921
- if (u.has(f)) return u.get(f);
922
- u.set(f, d);
923
- }
924
- function d() {
925
- return n(f, arguments, o(this).constructor);
926
- }
927
- return d.prototype = Object.create(f.prototype, { constructor: { value: d, enumerable: !1, writable: !0, configurable: !0 } }), s(d, f);
928
- }, e(c);
929
- }
930
- function n(c, u, f) {
931
- return n = (function() {
932
- if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
933
- if (typeof Proxy == "function") return !0;
934
- try {
935
- return Date.prototype.toString.call(Reflect.construct(Date, [], (function() {
936
- }))), !0;
937
- } catch {
938
- return !1;
939
- }
940
- })() ? Reflect.construct : function(h, d, g) {
941
- var p = [null];
942
- p.push.apply(p, d);
943
- var m = new (Function.bind.apply(h, p))();
944
- return g && s(m, g.prototype), m;
945
- }, n.apply(null, arguments);
946
- }
947
- function s(c, u) {
948
- return s = Object.setPrototypeOf || function(f, h) {
949
- return f.__proto__ = h, f;
950
- }, s(c, u);
951
- }
952
- function o(c) {
953
- return o = Object.setPrototypeOf ? Object.getPrototypeOf : function(u) {
954
- return u.__proto__ || Object.getPrototypeOf(u);
955
- }, o(c);
956
- }
957
- var i = (function(c) {
958
- function u(f) {
959
- var h;
960
- return (function(d, g) {
961
- if (!(d instanceof g)) throw new TypeError("Cannot call a class as a function");
962
- })(this, u), (h = (function(d, g) {
963
- return !g || t(g) !== "object" && typeof g != "function" ? (function(p) {
964
- if (p === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
965
- return p;
966
- })(d) : g;
967
- })(this, o(u).call(this, f))).name = "ObjectPrototypeMutationError", h;
968
- }
969
- return (function(f, h) {
970
- if (typeof h != "function" && h !== null) throw new TypeError("Super expression must either be null or a function");
971
- f.prototype = Object.create(h && h.prototype, { constructor: { value: f, writable: !0, configurable: !0 } }), h && s(f, h);
972
- })(u, c), u;
973
- })(e(Error));
974
- function a(c, u) {
975
- for (var f = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : function() {
976
- }, h = u.split("."), d = h.length, g = function(b) {
977
- var y = h[b];
978
- if (!c) return { v: void 0 };
979
- if (y === "+") {
980
- if (Array.isArray(c)) return { v: c.map((function(w, x) {
981
- var P = h.slice(b + 1);
982
- return P.length > 0 ? a(w, P.join("."), f) : f(c, x, h, b);
983
- })) };
984
- var v = h.slice(0, b).join(".");
985
- throw new Error("Object at wildcard (".concat(v, ") is not an array"));
986
- }
987
- c = f(c, y, h, b);
988
- }, p = 0; p < d; p++) {
989
- var m = g(p);
990
- if (t(m) === "object") return m.v;
991
- }
992
- return c;
993
- }
994
- function l(c, u) {
995
- return c.length === u + 1;
996
- }
997
- r.exports = { set: function(c, u, f) {
998
- if (t(c) != "object" || c === null || u === void 0) return c;
999
- if (typeof u == "number") return c[u] = f, c[u];
1000
- try {
1001
- return a(c, u, (function(h, d, g, p) {
1002
- if (h === Reflect.getPrototypeOf({})) throw new i("Attempting to mutate Object.prototype");
1003
- if (!h[d]) {
1004
- var m = Number.isInteger(Number(g[p + 1])), b = g[p + 1] === "+";
1005
- h[d] = m || b ? [] : {};
1006
- }
1007
- return l(g, p) && (h[d] = f), h[d];
1008
- }));
1009
- } catch (h) {
1010
- if (h instanceof i) throw h;
1011
- return c;
1012
- }
1013
- }, get: function(c, u) {
1014
- if (t(c) != "object" || c === null || u === void 0) return c;
1015
- if (typeof u == "number") return c[u];
1016
- try {
1017
- return a(c, u, (function(f, h) {
1018
- return f[h];
1019
- }));
1020
- } catch {
1021
- return c;
1022
- }
1023
- }, has: function(c, u) {
1024
- var f = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1025
- if (t(c) != "object" || c === null || u === void 0) return !1;
1026
- if (typeof u == "number") return u in c;
1027
- try {
1028
- var h = !1;
1029
- return a(c, u, (function(d, g, p, m) {
1030
- if (!l(p, m)) return d && d[g];
1031
- h = f.own ? d.hasOwnProperty(g) : g in d;
1032
- })), h;
1033
- } catch {
1034
- return !1;
1035
- }
1036
- }, hasOwn: function(c, u, f) {
1037
- return this.has(c, u, f || { own: !0 });
1038
- }, isIn: function(c, u, f) {
1039
- var h = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
1040
- if (t(c) != "object" || c === null || u === void 0) return !1;
1041
- try {
1042
- var d = !1, g = !1;
1043
- return a(c, u, (function(p, m, b, y) {
1044
- return d = d || p === f || !!p && p[m] === f, g = l(b, y) && t(p) === "object" && m in p, p && p[m];
1045
- })), h.validPath ? d && g : d;
1046
- } catch {
1047
- return !1;
1048
- }
1049
- }, ObjectPrototypeMutationError: i };
1050
- } }, pe = {};
1051
- function O(r) {
1052
- var t = pe[r];
1053
- if (t !== void 0) return t.exports;
1054
- var e = pe[r] = { id: r, loaded: !1, exports: {} };
1055
- return Xr[r].call(e.exports, e, e.exports, O), e.loaded = !0, e.exports;
1056
- }
1057
- O.n = (r) => {
1058
- var t = r && r.__esModule ? () => r.default : () => r;
1059
- return O.d(t, { a: t }), t;
1060
- }, O.d = (r, t) => {
1061
- for (var e in t) O.o(t, e) && !O.o(r, e) && Object.defineProperty(r, e, { enumerable: !0, get: t[e] });
1062
- }, O.o = (r, t) => Object.prototype.hasOwnProperty.call(r, t), O.nmd = (r) => (r.paths = [], r.children || (r.children = []), r);
1063
- var Yr = O(737), Zr = O.n(Yr);
1064
- function Mt(r) {
1065
- if (!Yt(r)) throw new Error("Parameter was not an error");
1066
- }
1067
- function Yt(r) {
1068
- return !!r && typeof r == "object" && (t = r, Object.prototype.toString.call(t) === "[object Error]") || r instanceof Error;
1069
- var t;
1070
- }
1071
- class V extends Error {
1072
- constructor(t, e) {
1073
- const n = [...arguments], { options: s, shortMessage: o } = (function(a) {
1074
- let l, c = "";
1075
- if (a.length === 0) l = {};
1076
- else if (Yt(a[0])) l = { cause: a[0] }, c = a.slice(1).join(" ") || "";
1077
- else if (a[0] && typeof a[0] == "object") l = Object.assign({}, a[0]), c = a.slice(1).join(" ") || "";
1078
- else {
1079
- if (typeof a[0] != "string") throw new Error("Invalid arguments passed to Layerr");
1080
- l = {}, c = c = a.join(" ") || "";
1081
- }
1082
- return { options: l, shortMessage: c };
1083
- })(n);
1084
- let i = o;
1085
- if (s.cause && (i = `${i}: ${s.cause.message}`), super(i), this.message = i, s.name && typeof s.name == "string" ? this.name = s.name : this.name = "Layerr", s.cause && Object.defineProperty(this, "_cause", { value: s.cause }), Object.defineProperty(this, "_info", { value: {} }), s.info && typeof s.info == "object" && Object.assign(this._info, s.info), Error.captureStackTrace) {
1086
- const a = s.constructorOpt || this.constructor;
1087
- Error.captureStackTrace(this, a);
1088
- }
1089
- }
1090
- static cause(t) {
1091
- return Mt(t), t._cause && Yt(t._cause) ? t._cause : null;
1092
- }
1093
- static fullStack(t) {
1094
- Mt(t);
1095
- const e = V.cause(t);
1096
- return e ? `${t.stack}
1097
- caused by: ${V.fullStack(e)}` : t.stack ?? "";
1098
- }
1099
- static info(t) {
1100
- Mt(t);
1101
- const e = {}, n = V.cause(t);
1102
- return n && Object.assign(e, V.info(n)), t._info && Object.assign(e, t._info), e;
1103
- }
1104
- toString() {
1105
- let t = this.name || this.constructor.name || this.constructor.prototype.name;
1106
- return this.message && (t = `${t}: ${this.message}`), t;
1107
- }
1108
- }
1109
- var Jr = O(47), $t = O.n(Jr);
1110
- const ge = "__PATH_SEPARATOR_POSIX__", de = "__PATH_SEPARATOR_WINDOWS__";
1111
- function S(r) {
1112
- try {
1113
- const t = r.replace(/\//g, ge).replace(/\\\\/g, de);
1114
- return encodeURIComponent(t).split(de).join("\\\\").split(ge).join("/");
1115
- } catch (t) {
1116
- throw new V(t, "Failed encoding path");
1117
- }
1118
- }
1119
- function me(r) {
1120
- return r.startsWith("/") ? r : "/" + r;
1121
- }
1122
- function At(r) {
1123
- let t = r;
1124
- return t[0] !== "/" && (t = "/" + t), /^.+\/$/.test(t) && (t = t.substr(0, t.length - 1)), t;
1125
- }
1126
- function Kr(r) {
1127
- let t = new (Zr())(r).pathname;
1128
- return t.length <= 0 && (t = "/"), At(t);
1129
- }
1130
- function C() {
1131
- for (var r = arguments.length, t = new Array(r), e = 0; e < r; e++) t[e] = arguments[e];
1132
- return (function() {
1133
- return (function(n) {
1134
- var s = [];
1135
- if (n.length === 0) return "";
1136
- if (typeof n[0] != "string") throw new TypeError("Url must be a string. Received " + n[0]);
1137
- if (n[0].match(/^[^/:]+:\/*$/) && n.length > 1) {
1138
- var o = n.shift();
1139
- n[0] = o + n[0];
1140
- }
1141
- n[0].match(/^file:\/\/\//) ? n[0] = n[0].replace(/^([^/:]+):\/*/, "$1:///") : n[0] = n[0].replace(/^([^/:]+):\/*/, "$1://");
1142
- for (var i = 0; i < n.length; i++) {
1143
- var a = n[i];
1144
- if (typeof a != "string") throw new TypeError("Url must be a string. Received " + a);
1145
- a !== "" && (i > 0 && (a = a.replace(/^[\/]+/, "")), a = i < n.length - 1 ? a.replace(/[\/]+$/, "") : a.replace(/[\/]+$/, "/"), s.push(a));
1146
- }
1147
- var l = s.join("/"), c = (l = l.replace(/\/(\?|&|#[^!])/g, "$1")).split("?");
1148
- return c.shift() + (c.length > 0 ? "?" : "") + c.join("&");
1149
- })(typeof arguments[0] == "object" ? arguments[0] : [].slice.call(arguments));
1150
- })(t.reduce(((n, s, o) => ((o === 0 || s !== "/" || s === "/" && n[n.length - 1] !== "/") && n.push(s), n)), []));
1151
- }
1152
- var Qr = O(542), bt = O.n(Qr);
1153
- function ye(r, t) {
1154
- const e = r.url.replace("//", ""), n = e.indexOf("/") == -1 ? "/" : e.slice(e.indexOf("/")), s = r.method ? r.method.toUpperCase() : "GET", o = !!/(^|,)\s*auth\s*($|,)/.test(t.qop) && "auth", i = `00000000${t.nc}`.slice(-8), a = (function(h, d, g, p, m, b, y) {
1155
- const v = y || bt()(`${d}:${g}:${p}`);
1156
- return h && h.toLowerCase() === "md5-sess" ? bt()(`${v}:${m}:${b}`) : v;
1157
- })(t.algorithm, t.username, t.realm, t.password, t.nonce, t.cnonce, t.ha1), l = bt()(`${s}:${n}`), c = o ? bt()(`${a}:${t.nonce}:${i}:${t.cnonce}:${o}:${l}`) : bt()(`${a}:${t.nonce}:${l}`), u = { username: t.username, realm: t.realm, nonce: t.nonce, uri: n, qop: o, response: c, nc: i, cnonce: t.cnonce, algorithm: t.algorithm, opaque: t.opaque }, f = [];
1158
- for (const h in u) u[h] && (h === "qop" || h === "nc" || h === "algorithm" ? f.push(`${h}=${u[h]}`) : f.push(`${h}="${u[h]}"`));
1159
- return `Digest ${f.join(", ")}`;
1160
- }
1161
- function He(r) {
1162
- return (r.headers && r.headers.get("www-authenticate") || "").split(/\s/)[0].toLowerCase() === "digest";
1163
- }
1164
- var tn = O(101), Xe = O.n(tn);
1165
- function be(r) {
1166
- return Xe().decode(r);
1167
- }
1168
- function ve(r, t) {
1169
- var e;
1170
- return `Basic ${e = `${r}:${t}`, Xe().encode(e)}`;
1171
- }
1172
- const we = typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : typeof window < "u" ? window : globalThis, en = we.fetch.bind(we);
1173
- let W = (function(r) {
1174
- return r.Auto = "auto", r.Digest = "digest", r.None = "none", r.Password = "password", r.Token = "token", r;
1175
- })({}), et = (function(r) {
1176
- return r.DataTypeNoLength = "data-type-no-length", r.InvalidAuthType = "invalid-auth-type", r.InvalidOutputFormat = "invalid-output-format", r.LinkUnsupportedAuthType = "link-unsupported-auth", r.InvalidUpdateRange = "invalid-update-range", r.NotSupported = "not-supported", r;
1177
- })({});
1178
- function Ye(r, t, e, n, s) {
1179
- switch (r.authType) {
1180
- case W.Auto:
1181
- t && e && (r.headers.Authorization = ve(t, e));
1182
- break;
1183
- case W.Digest:
1184
- r.digest = /* @__PURE__ */ (function(i, a, l) {
1185
- return { username: i, password: a, ha1: l, nc: 0, algorithm: "md5", hasDigestAuth: !1 };
1186
- })(t, e, s);
1187
- break;
1188
- case W.None:
1189
- break;
1190
- case W.Password:
1191
- r.headers.Authorization = ve(t, e);
1192
- break;
1193
- case W.Token:
1194
- r.headers.Authorization = `${(o = n).token_type} ${o.access_token}`;
1195
- break;
1196
- default:
1197
- throw new V({ info: { code: et.InvalidAuthType } }, `Invalid auth type: ${r.authType}`);
1198
- }
1199
- var o;
1200
- }
1201
- O(345), O(800);
1202
- const xe = "@@HOTPATCHER", rn = () => {
1203
- };
1204
- function _t(r) {
1205
- return { original: r, methods: [r], final: !1 };
1206
- }
1207
- class nn {
1208
- constructor() {
1209
- this._configuration = { registry: {}, getEmptyAction: "null" }, this.__type__ = xe;
1210
- }
1211
- get configuration() {
1212
- return this._configuration;
1213
- }
1214
- get getEmptyAction() {
1215
- return this.configuration.getEmptyAction;
1216
- }
1217
- set getEmptyAction(t) {
1218
- this.configuration.getEmptyAction = t;
1219
- }
1220
- control(t) {
1221
- let e = arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
1222
- if (!t || t.__type__ !== xe) throw new Error("Failed taking control of target HotPatcher instance: Invalid type or object");
1223
- return Object.keys(t.configuration.registry).forEach(((n) => {
1224
- this.configuration.registry.hasOwnProperty(n) ? e && (this.configuration.registry[n] = Object.assign({}, t.configuration.registry[n])) : this.configuration.registry[n] = Object.assign({}, t.configuration.registry[n]);
1225
- })), t._configuration = this.configuration, this;
1226
- }
1227
- execute(t) {
1228
- const e = this.get(t) || rn;
1229
- for (var n = arguments.length, s = new Array(n > 1 ? n - 1 : 0), o = 1; o < n; o++) s[o - 1] = arguments[o];
1230
- return e(...s);
1231
- }
1232
- get(t) {
1233
- const e = this.configuration.registry[t];
1234
- if (!e) switch (this.getEmptyAction) {
1235
- case "null":
1236
- return null;
1237
- case "throw":
1238
- throw new Error(`Failed handling method request: No method provided for override: ${t}`);
1239
- default:
1240
- throw new Error(`Failed handling request which resulted in an empty method: Invalid empty-action specified: ${this.getEmptyAction}`);
1241
- }
1242
- return (function() {
1243
- for (var n = arguments.length, s = new Array(n), o = 0; o < n; o++) s[o] = arguments[o];
1244
- if (s.length === 0) throw new Error("Failed creating sequence: No functions provided");
1245
- return function() {
1246
- for (var i = arguments.length, a = new Array(i), l = 0; l < i; l++) a[l] = arguments[l];
1247
- let c = a;
1248
- const u = this;
1249
- for (; s.length > 0; ) c = [s.shift().apply(u, c)];
1250
- return c[0];
1251
- };
1252
- })(...e.methods);
1253
- }
1254
- isPatched(t) {
1255
- return !!this.configuration.registry[t];
1256
- }
1257
- patch(t, e) {
1258
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1259
- const { chain: s = !1 } = n;
1260
- if (this.configuration.registry[t] && this.configuration.registry[t].final) throw new Error(`Failed patching '${t}': Method marked as being final`);
1261
- if (typeof e != "function") throw new Error(`Failed patching '${t}': Provided method is not a function`);
1262
- if (s) this.configuration.registry[t] ? this.configuration.registry[t].methods.push(e) : this.configuration.registry[t] = _t(e);
1263
- else if (this.isPatched(t)) {
1264
- const { original: o } = this.configuration.registry[t];
1265
- this.configuration.registry[t] = Object.assign(_t(e), { original: o });
1266
- } else this.configuration.registry[t] = _t(e);
1267
- return this;
1268
- }
1269
- patchInline(t, e) {
1270
- this.isPatched(t) || this.patch(t, e);
1271
- for (var n = arguments.length, s = new Array(n > 2 ? n - 2 : 0), o = 2; o < n; o++) s[o - 2] = arguments[o];
1272
- return this.execute(t, ...s);
1273
- }
1274
- plugin(t) {
1275
- for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), s = 1; s < e; s++) n[s - 1] = arguments[s];
1276
- return n.forEach(((o) => {
1277
- this.patch(t, o, { chain: !0 });
1278
- })), this;
1279
- }
1280
- restore(t) {
1281
- if (!this.isPatched(t)) throw new Error(`Failed restoring method: No method present for key: ${t}`);
1282
- if (typeof this.configuration.registry[t].original != "function") throw new Error(`Failed restoring method: Original method not found or of invalid type for key: ${t}`);
1283
- return this.configuration.registry[t].methods = [this.configuration.registry[t].original], this;
1284
- }
1285
- setFinal(t) {
1286
- if (!this.configuration.registry.hasOwnProperty(t)) throw new Error(`Failed marking '${t}' as final: No method found for key`);
1287
- return this.configuration.registry[t].final = !0, this;
1288
- }
1289
- }
1290
- let Vt = null;
1291
- function sn() {
1292
- return Vt || (Vt = new nn()), Vt;
1293
- }
1294
- function Ft(r) {
1295
- return (function(t) {
1296
- if (typeof t != "object" || t === null || Object.prototype.toString.call(t) != "[object Object]") return !1;
1297
- if (Object.getPrototypeOf(t) === null) return !0;
1298
- let e = t;
1299
- for (; Object.getPrototypeOf(e) !== null; ) e = Object.getPrototypeOf(e);
1300
- return Object.getPrototypeOf(t) === e;
1301
- })(r) ? Object.assign({}, r) : Object.setPrototypeOf(Object.assign({}, r), Object.getPrototypeOf(r));
1302
- }
1303
- function Ne() {
1304
- for (var r = arguments.length, t = new Array(r), e = 0; e < r; e++) t[e] = arguments[e];
1305
- let n = null, s = [...t];
1306
- for (; s.length > 0; ) {
1307
- const o = s.shift();
1308
- n = n ? Ze(n, o) : Ft(o);
1309
- }
1310
- return n;
1311
- }
1312
- function Ze(r, t) {
1313
- const e = Ft(r);
1314
- return Object.keys(t).forEach(((n) => {
1315
- e.hasOwnProperty(n) ? Array.isArray(t[n]) ? e[n] = Array.isArray(e[n]) ? [...e[n], ...t[n]] : [...t[n]] : typeof t[n] == "object" && t[n] ? e[n] = typeof e[n] == "object" && e[n] ? Ze(e[n], t[n]) : Ft(t[n]) : e[n] = t[n] : e[n] = t[n];
1316
- })), e;
1317
- }
1318
- function on(r) {
1319
- const t = {};
1320
- for (const e of r.keys()) t[e] = r.get(e);
1321
- return t;
1322
- }
1323
- function Zt() {
1324
- for (var r = arguments.length, t = new Array(r), e = 0; e < r; e++) t[e] = arguments[e];
1325
- if (t.length === 0) return {};
1326
- const n = {};
1327
- return t.reduce(((s, o) => (Object.keys(o).forEach(((i) => {
1328
- const a = i.toLowerCase();
1329
- n.hasOwnProperty(a) ? s[n[a]] = o[i] : (n[a] = i, s[i] = o[i]);
1330
- })), s)), {});
1331
- }
1332
- O(805);
1333
- const an = typeof ArrayBuffer == "function", { toString: un } = Object.prototype;
1334
- function Je(r) {
1335
- return an && (r instanceof ArrayBuffer || un.call(r) === "[object ArrayBuffer]");
1336
- }
1337
- function Ke(r) {
1338
- return r != null && r.constructor != null && typeof r.constructor.isBuffer == "function" && r.constructor.isBuffer(r);
1339
- }
1340
- function se(r) {
1341
- return function() {
1342
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
1343
- try {
1344
- return Promise.resolve(r.apply(this, t));
1345
- } catch (n) {
1346
- return Promise.reject(n);
1347
- }
1348
- };
1349
- }
1350
- function Jt(r, t, e) {
1351
- return e ? t ? t(r) : r : (r && r.then || (r = Promise.resolve(r)), t ? r.then(t) : r);
1352
- }
1353
- const Qe = se((function(r) {
1354
- const t = r._digest;
1355
- return delete r._digest, t.hasDigestAuth && (r = Ne(r, { headers: { Authorization: ye(r, t) } })), Jt(jt(r), (function(e) {
1356
- let n = !1;
1357
- return s = function(i) {
1358
- return n ? i : e;
1359
- }, (o = (function() {
1360
- if (e.status == 401) return t.hasDigestAuth = (function(i, a) {
1361
- if (!He(i)) return !1;
1362
- const l = /([a-z0-9_-]+)=(?:"([^"]+)"|([a-z0-9_-]+))/gi;
1363
- for (; ; ) {
1364
- const c = i.headers && i.headers.get("www-authenticate") || "", u = l.exec(c);
1365
- if (!u) break;
1366
- a[u[1]] = u[2] || u[3];
1367
- }
1368
- return a.nc += 1, a.cnonce = (function() {
1369
- let c = "";
1370
- for (let u = 0; u < 32; ++u) c = `${c}${"abcdef0123456789"[Math.floor(16 * Math.random())]}`;
1371
- return c;
1372
- })(), !0;
1373
- })(e, t), (function() {
1374
- if (t.hasDigestAuth) return Jt(jt(r = Ne(r, { headers: { Authorization: ye(r, t) } })), (function(i) {
1375
- return i.status == 401 ? t.hasDigestAuth = !1 : t.nc++, n = !0, i;
1376
- }));
1377
- })();
1378
- t.nc++;
1379
- })()) && o.then ? o.then(s) : s(o);
1380
- var s, o;
1381
- }));
1382
- })), ln = se((function(r, t) {
1383
- return Jt(jt(r), (function(e) {
1384
- return e.ok ? (t.authType = W.Password, e) : e.status == 401 && He(e) ? (t.authType = W.Digest, Ye(t, t.username, t.password, void 0, void 0), r._digest = t.digest, Qe(r)) : e;
1385
- }));
1386
- })), j = se((function(r, t) {
1387
- return t.authType === W.Auto ? ln(r, t) : r._digest ? Qe(r) : jt(r);
1388
- }));
1389
- function R(r, t, e) {
1390
- const n = Ft(r);
1391
- return n.headers = Zt(t.headers, n.headers || {}, e.headers || {}), e.data !== void 0 && (n.data = e.data), e.signal && (n.signal = e.signal), t.httpAgent && (n.httpAgent = t.httpAgent), t.httpsAgent && (n.httpsAgent = t.httpsAgent), t.digest && (n._digest = t.digest), typeof t.withCredentials == "boolean" && (n.withCredentials = t.withCredentials), n;
1392
- }
1393
- function jt(r) {
1394
- const t = sn();
1395
- return t.patchInline("request", ((e) => t.patchInline("fetch", en, e.url, (function(n) {
1396
- let s = {};
1397
- const o = { method: n.method };
1398
- if (n.headers && (s = Zt(s, n.headers)), n.data !== void 0) {
1399
- const [i, a] = (function(l) {
1400
- if (typeof l == "string") return [l, {}];
1401
- if (Ke(l)) return [l, {}];
1402
- if (Je(l)) return [l, {}];
1403
- if (l && typeof l == "object") return [JSON.stringify(l), { "content-type": "application/json" }];
1404
- throw new Error("Unable to convert request body: Unexpected body type: " + typeof l);
1405
- })(n.data);
1406
- o.body = i, s = Zt(s, a);
1407
- }
1408
- return n.signal && (o.signal = n.signal), n.withCredentials && (o.credentials = "include"), o.headers = s, o;
1409
- })(e))), r);
1410
- }
1411
- var cn = O(285);
1412
- const Rt = (r) => {
1413
- if (typeof r != "string") throw new TypeError("invalid pattern");
1414
- if (r.length > 65536) throw new TypeError("pattern is too long");
1415
- }, hn = { "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", !0], "[:alpha:]": ["\\p{L}\\p{Nl}", !0], "[:ascii:]": ["\\x00-\\x7f", !1], "[:blank:]": ["\\p{Zs}\\t", !0], "[:cntrl:]": ["\\p{Cc}", !0], "[:digit:]": ["\\p{Nd}", !0], "[:graph:]": ["\\p{Z}\\p{C}", !0, !0], "[:lower:]": ["\\p{Ll}", !0], "[:print:]": ["\\p{C}", !0], "[:punct:]": ["\\p{P}", !0], "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", !0], "[:upper:]": ["\\p{Lu}", !0], "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", !0], "[:xdigit:]": ["A-Fa-f0-9", !1] }, vt = (r) => r.replace(/[[\]\\-]/g, "\\$&"), Pe = (r) => r.join(""), fn = (r, t) => {
1416
- const e = t;
1417
- if (r.charAt(e) !== "[") throw new Error("not in a brace expression");
1418
- const n = [], s = [];
1419
- let o = e + 1, i = !1, a = !1, l = !1, c = !1, u = e, f = "";
1420
- t: for (; o < r.length; ) {
1421
- const p = r.charAt(o);
1422
- if (p !== "!" && p !== "^" || o !== e + 1) {
1423
- if (p === "]" && i && !l) {
1424
- u = o + 1;
1425
- break;
1426
- }
1427
- if (i = !0, p !== "\\" || l) {
1428
- if (p === "[" && !l) {
1429
- for (const [m, [b, y, v]] of Object.entries(hn)) if (r.startsWith(m, o)) {
1430
- if (f) return ["$.", !1, r.length - e, !0];
1431
- o += m.length, v ? s.push(b) : n.push(b), a = a || y;
1432
- continue t;
1433
- }
1434
- }
1435
- l = !1, f ? (p > f ? n.push(vt(f) + "-" + vt(p)) : p === f && n.push(vt(p)), f = "", o++) : r.startsWith("-]", o + 1) ? (n.push(vt(p + "-")), o += 2) : r.startsWith("-", o + 1) ? (f = p, o += 2) : (n.push(vt(p)), o++);
1436
- } else l = !0, o++;
1437
- } else c = !0, o++;
1438
- }
1439
- if (u < o) return ["", !1, 0, !1];
1440
- if (!n.length && !s.length) return ["$.", !1, r.length - e, !0];
1441
- if (s.length === 0 && n.length === 1 && /^\\?.$/.test(n[0]) && !c)
1442
- return [(h = n[0].length === 2 ? n[0].slice(-1) : n[0], h.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&")), !1, u - e, !1];
1443
- var h;
1444
- const d = "[" + (c ? "^" : "") + Pe(n) + "]", g = "[" + (c ? "" : "^") + Pe(s) + "]";
1445
- return [n.length && s.length ? "(" + d + "|" + g + ")" : n.length ? d : g, a, u - e, !0];
1446
- }, Nt = function(r) {
1447
- let { windowsPathsNoEscape: t = !1 } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1448
- return t ? r.replace(/\[([^\/\\])\]/g, "$1") : r.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
1449
- }, pn = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]), Ee = (r) => pn.has(r), Bt = "(?!\\.)", gn = /* @__PURE__ */ new Set(["[", "."]), dn = /* @__PURE__ */ new Set(["..", "."]), mn = new Set("().*{}+?[]^$\\!"), oe = "[^/]", Ae = oe + "*?", Te = oe + "+?";
1450
- class M {
1451
- type;
1452
- #r;
1453
- #n;
1454
- #o = !1;
1455
- #t = [];
1456
- #e;
1457
- #i;
1458
- #u;
1459
- #a = !1;
1460
- #s;
1461
- #l;
1462
- #h = !1;
1463
- constructor(t, e) {
1464
- let n = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1465
- this.type = t, t && (this.#n = !0), this.#e = e, this.#r = this.#e ? this.#e.#r : this, this.#s = this.#r === this ? n : this.#r.#s, this.#u = this.#r === this ? [] : this.#r.#u, t !== "!" || this.#r.#a || this.#u.push(this), this.#i = this.#e ? this.#e.#t.length : 0;
1466
- }
1467
- get hasMagic() {
1468
- if (this.#n !== void 0) return this.#n;
1469
- for (const t of this.#t) if (typeof t != "string" && (t.type || t.hasMagic)) return this.#n = !0;
1470
- return this.#n;
1471
- }
1472
- toString() {
1473
- return this.#l !== void 0 ? this.#l : this.type ? this.#l = this.type + "(" + this.#t.map(((t) => String(t))).join("|") + ")" : this.#l = this.#t.map(((t) => String(t))).join("");
1474
- }
1475
- #p() {
1476
- if (this !== this.#r) throw new Error("should only call on root");
1477
- if (this.#a) return this;
1478
- let t;
1479
- for (this.toString(), this.#a = !0; t = this.#u.pop(); ) {
1480
- if (t.type !== "!") continue;
1481
- let e = t, n = e.#e;
1482
- for (; n; ) {
1483
- for (let s = e.#i + 1; !n.type && s < n.#t.length; s++) for (const o of t.#t) {
1484
- if (typeof o == "string") throw new Error("string part in extglob AST??");
1485
- o.copyIn(n.#t[s]);
1486
- }
1487
- e = n, n = e.#e;
1488
- }
1489
- }
1490
- return this;
1491
- }
1492
- push() {
1493
- for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++) e[n] = arguments[n];
1494
- for (const s of e) if (s !== "") {
1495
- if (typeof s != "string" && !(s instanceof M && s.#e === this)) throw new Error("invalid part: " + s);
1496
- this.#t.push(s);
1497
- }
1498
- }
1499
- toJSON() {
1500
- const t = this.type === null ? this.#t.slice().map(((e) => typeof e == "string" ? e : e.toJSON())) : [this.type, ...this.#t.map(((e) => e.toJSON()))];
1501
- return this.isStart() && !this.type && t.unshift([]), this.isEnd() && (this === this.#r || this.#r.#a && this.#e?.type === "!") && t.push({}), t;
1502
- }
1503
- isStart() {
1504
- if (this.#r === this) return !0;
1505
- if (!this.#e?.isStart()) return !1;
1506
- if (this.#i === 0) return !0;
1507
- const t = this.#e;
1508
- for (let e = 0; e < this.#i; e++) {
1509
- const n = t.#t[e];
1510
- if (!(n instanceof M && n.type === "!")) return !1;
1511
- }
1512
- return !0;
1513
- }
1514
- isEnd() {
1515
- if (this.#r === this || this.#e?.type === "!") return !0;
1516
- if (!this.#e?.isEnd()) return !1;
1517
- if (!this.type) return this.#e?.isEnd();
1518
- const t = this.#e ? this.#e.#t.length : 0;
1519
- return this.#i === t - 1;
1520
- }
1521
- copyIn(t) {
1522
- typeof t == "string" ? this.push(t) : this.push(t.clone(this));
1523
- }
1524
- clone(t) {
1525
- const e = new M(this.type, t);
1526
- for (const n of this.#t) e.copyIn(n);
1527
- return e;
1528
- }
1529
- static #c(t, e, n, s) {
1530
- let o = !1, i = !1, a = -1, l = !1;
1531
- if (e.type === null) {
1532
- let d = n, g = "";
1533
- for (; d < t.length; ) {
1534
- const p = t.charAt(d++);
1535
- if (o || p === "\\") o = !o, g += p;
1536
- else if (i) d === a + 1 ? p !== "^" && p !== "!" || (l = !0) : p !== "]" || d === a + 2 && l || (i = !1), g += p;
1537
- else if (p !== "[") if (s.noext || !Ee(p) || t.charAt(d) !== "(") g += p;
1538
- else {
1539
- e.push(g), g = "";
1540
- const m = new M(p, e);
1541
- d = M.#c(t, m, d, s), e.push(m);
1542
- }
1543
- else i = !0, a = d, l = !1, g += p;
1544
- }
1545
- return e.push(g), d;
1546
- }
1547
- let c = n + 1, u = new M(null, e);
1548
- const f = [];
1549
- let h = "";
1550
- for (; c < t.length; ) {
1551
- const d = t.charAt(c++);
1552
- if (o || d === "\\") o = !o, h += d;
1553
- else if (i) c === a + 1 ? d !== "^" && d !== "!" || (l = !0) : d !== "]" || c === a + 2 && l || (i = !1), h += d;
1554
- else if (d !== "[") if (Ee(d) && t.charAt(c) === "(") {
1555
- u.push(h), h = "";
1556
- const g = new M(d, u);
1557
- u.push(g), c = M.#c(t, g, c, s);
1558
- } else if (d !== "|") {
1559
- if (d === ")") return h === "" && e.#t.length === 0 && (e.#h = !0), u.push(h), h = "", e.push(...f, u), c;
1560
- h += d;
1561
- } else u.push(h), h = "", f.push(u), u = new M(null, e);
1562
- else i = !0, a = c, l = !1, h += d;
1563
- }
1564
- return e.type = null, e.#n = void 0, e.#t = [t.substring(n - 1)], c;
1565
- }
1566
- static fromGlob(t) {
1567
- let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1568
- const n = new M(null, void 0, e);
1569
- return M.#c(t, n, 0, e), n;
1570
- }
1571
- toMMPattern() {
1572
- if (this !== this.#r) return this.#r.toMMPattern();
1573
- const t = this.toString(), [e, n, s, o] = this.toRegExpSource();
1574
- if (!(s || this.#n || this.#s.nocase && !this.#s.nocaseMagicOnly && t.toUpperCase() !== t.toLowerCase())) return n;
1575
- const i = (this.#s.nocase ? "i" : "") + (o ? "u" : "");
1576
- return Object.assign(new RegExp(`^${e}$`, i), { _src: e, _glob: t });
1577
- }
1578
- get options() {
1579
- return this.#s;
1580
- }
1581
- toRegExpSource(t) {
1582
- const e = t ?? !!this.#s.dot;
1583
- if (this.#r === this && this.#p(), !this.type) {
1584
- const l = this.isStart() && this.isEnd(), c = this.#t.map(((h) => {
1585
- const [d, g, p, m] = typeof h == "string" ? M.#g(h, this.#n, l) : h.toRegExpSource(t);
1586
- return this.#n = this.#n || p, this.#o = this.#o || m, d;
1587
- })).join("");
1588
- let u = "";
1589
- if (this.isStart() && typeof this.#t[0] == "string" && (this.#t.length !== 1 || !dn.has(this.#t[0]))) {
1590
- const h = gn, d = e && h.has(c.charAt(0)) || c.startsWith("\\.") && h.has(c.charAt(2)) || c.startsWith("\\.\\.") && h.has(c.charAt(4)), g = !e && !t && h.has(c.charAt(0));
1591
- u = d ? "(?!(?:^|/)\\.\\.?(?:$|/))" : g ? Bt : "";
1592
- }
1593
- let f = "";
1594
- return this.isEnd() && this.#r.#a && this.#e?.type === "!" && (f = "(?:$|\\/)"), [u + c + f, Nt(c), this.#n = !!this.#n, this.#o];
1595
- }
1596
- const n = this.type === "*" || this.type === "+", s = this.type === "!" ? "(?:(?!(?:" : "(?:";
1597
- let o = this.#f(e);
1598
- if (this.isStart() && this.isEnd() && !o && this.type !== "!") {
1599
- const l = this.toString();
1600
- return this.#t = [l], this.type = null, this.#n = void 0, [l, Nt(this.toString()), !1, !1];
1601
- }
1602
- let i = !n || t || e ? "" : this.#f(!0);
1603
- i === o && (i = ""), i && (o = `(?:${o})(?:${i})*?`);
1604
- let a = "";
1605
- return a = this.type === "!" && this.#h ? (this.isStart() && !e ? Bt : "") + Te : s + o + (this.type === "!" ? "))" + (!this.isStart() || e || t ? "" : Bt) + Ae + ")" : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && i ? ")" : this.type === "*" && i ? ")?" : `)${this.type}`), [a, Nt(o), this.#n = !!this.#n, this.#o];
1606
- }
1607
- #f(t) {
1608
- return this.#t.map(((e) => {
1609
- if (typeof e == "string") throw new Error("string type in extglob ast??");
1610
- const [n, s, o, i] = e.toRegExpSource(t);
1611
- return this.#o = this.#o || i, n;
1612
- })).filter(((e) => !(this.isStart() && this.isEnd() && !e))).join("|");
1613
- }
1614
- static #g(t, e) {
1615
- let n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], s = !1, o = "", i = !1;
1616
- for (let a = 0; a < t.length; a++) {
1617
- const l = t.charAt(a);
1618
- if (s) s = !1, o += (mn.has(l) ? "\\" : "") + l;
1619
- else if (l !== "\\") {
1620
- if (l === "[") {
1621
- const [c, u, f, h] = fn(t, a);
1622
- if (f) {
1623
- o += c, i = i || u, a += f - 1, e = e || h;
1624
- continue;
1625
- }
1626
- }
1627
- l !== "*" ? l !== "?" ? o += l.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") : (o += oe, e = !0) : (o += n && t === "*" ? Te : Ae, e = !0);
1628
- } else a === t.length - 1 ? o += "\\\\" : s = !0;
1629
- }
1630
- return [o, Nt(t), !!e, i];
1631
- }
1632
- }
1633
- const D = function(r, t) {
1634
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1635
- return Rt(t), !(!e.nocomment && t.charAt(0) === "#") && new Lt(t, e).match(r);
1636
- }, yn = /^\*+([^+@!?\*\[\(]*)$/, bn = (r) => (t) => !t.startsWith(".") && t.endsWith(r), vn = (r) => (t) => t.endsWith(r), wn = (r) => (r = r.toLowerCase(), (t) => !t.startsWith(".") && t.toLowerCase().endsWith(r)), xn = (r) => (r = r.toLowerCase(), (t) => t.toLowerCase().endsWith(r)), Nn = /^\*+\.\*+$/, Pn = (r) => !r.startsWith(".") && r.includes("."), En = (r) => r !== "." && r !== ".." && r.includes("."), An = /^\.\*+$/, Tn = (r) => r !== "." && r !== ".." && r.startsWith("."), On = /^\*+$/, Sn = (r) => r.length !== 0 && !r.startsWith("."), Cn = (r) => r.length !== 0 && r !== "." && r !== "..", In = /^\?+([^+@!?\*\[\(]*)?$/, $n = (r) => {
1637
- let [t, e = ""] = r;
1638
- const n = tr([t]);
1639
- return e ? (e = e.toLowerCase(), (s) => n(s) && s.toLowerCase().endsWith(e)) : n;
1640
- }, Fn = (r) => {
1641
- let [t, e = ""] = r;
1642
- const n = er([t]);
1643
- return e ? (e = e.toLowerCase(), (s) => n(s) && s.toLowerCase().endsWith(e)) : n;
1644
- }, jn = (r) => {
1645
- let [t, e = ""] = r;
1646
- const n = er([t]);
1647
- return e ? (s) => n(s) && s.endsWith(e) : n;
1648
- }, Rn = (r) => {
1649
- let [t, e = ""] = r;
1650
- const n = tr([t]);
1651
- return e ? (s) => n(s) && s.endsWith(e) : n;
1652
- }, tr = (r) => {
1653
- let [t] = r;
1654
- const e = t.length;
1655
- return (n) => n.length === e && !n.startsWith(".");
1656
- }, er = (r) => {
1657
- let [t] = r;
1658
- const e = t.length;
1659
- return (n) => n.length === e && n !== "." && n !== "..";
1660
- }, rr = typeof it == "object" && it ? typeof it.env == "object" && it.env && it.env.__MINIMATCH_TESTING_PLATFORM__ || it.platform : "posix";
1661
- D.sep = rr === "win32" ? "\\" : "/";
1662
- const z = /* @__PURE__ */ Symbol("globstar **");
1663
- D.GLOBSTAR = z, D.filter = function(r) {
1664
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1665
- return (e) => D(e, r, t);
1666
- };
1667
- const G = function(r) {
1668
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1669
- return Object.assign({}, r, t);
1670
- };
1671
- D.defaults = (r) => {
1672
- if (!r || typeof r != "object" || !Object.keys(r).length) return D;
1673
- const t = D;
1674
- return Object.assign((function(e, n) {
1675
- return t(e, n, G(r, arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}));
1676
- }), { Minimatch: class extends t.Minimatch {
1677
- constructor(e) {
1678
- super(e, G(r, arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}));
1679
- }
1680
- static defaults(e) {
1681
- return t.defaults(G(r, e)).Minimatch;
1682
- }
1683
- }, AST: class extends t.AST {
1684
- constructor(e, n) {
1685
- super(e, n, G(r, arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}));
1686
- }
1687
- static fromGlob(e) {
1688
- let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1689
- return t.AST.fromGlob(e, G(r, n));
1690
- }
1691
- }, unescape: function(e) {
1692
- let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1693
- return t.unescape(e, G(r, n));
1694
- }, escape: function(e) {
1695
- let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1696
- return t.escape(e, G(r, n));
1697
- }, filter: function(e) {
1698
- let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1699
- return t.filter(e, G(r, n));
1700
- }, defaults: (e) => t.defaults(G(r, e)), makeRe: function(e) {
1701
- let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1702
- return t.makeRe(e, G(r, n));
1703
- }, braceExpand: function(e) {
1704
- let n = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1705
- return t.braceExpand(e, G(r, n));
1706
- }, match: function(e, n) {
1707
- let s = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
1708
- return t.match(e, n, G(r, s));
1709
- }, sep: t.sep, GLOBSTAR: z });
1710
- };
1711
- const nr = function(r) {
1712
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1713
- return Rt(r), t.nobrace || !/\{(?:(?!\{).)*\}/.test(r) ? [r] : cn(r);
1714
- };
1715
- D.braceExpand = nr, D.makeRe = function(r) {
1716
- return new Lt(r, arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}).makeRe();
1717
- }, D.match = function(r, t) {
1718
- const e = new Lt(t, arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {});
1719
- return r = r.filter(((n) => e.match(n))), e.options.nonull && !r.length && r.push(t), r;
1720
- };
1721
- const Oe = /[?*]|[+@!]\(.*?\)|\[|\]/;
1722
- class Lt {
1723
- options;
1724
- set;
1725
- pattern;
1726
- windowsPathsNoEscape;
1727
- nonegate;
1728
- negate;
1729
- comment;
1730
- empty;
1731
- preserveMultipleSlashes;
1732
- partial;
1733
- globSet;
1734
- globParts;
1735
- nocase;
1736
- isWindows;
1737
- platform;
1738
- windowsNoMagicRoot;
1739
- regexp;
1740
- constructor(t) {
1741
- let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
1742
- Rt(t), e = e || {}, this.options = e, this.pattern = t, this.platform = e.platform || rr, this.isWindows = this.platform === "win32", this.windowsPathsNoEscape = !!e.windowsPathsNoEscape || e.allowWindowsEscape === !1, this.windowsPathsNoEscape && (this.pattern = this.pattern.replace(/\\/g, "/")), this.preserveMultipleSlashes = !!e.preserveMultipleSlashes, this.regexp = null, this.negate = !1, this.nonegate = !!e.nonegate, this.comment = !1, this.empty = !1, this.partial = !!e.partial, this.nocase = !!this.options.nocase, this.windowsNoMagicRoot = e.windowsNoMagicRoot !== void 0 ? e.windowsNoMagicRoot : !(!this.isWindows || !this.nocase), this.globSet = [], this.globParts = [], this.set = [], this.make();
1743
- }
1744
- hasMagic() {
1745
- if (this.options.magicalBraces && this.set.length > 1) return !0;
1746
- for (const t of this.set) for (const e of t) if (typeof e != "string") return !0;
1747
- return !1;
1748
- }
1749
- debug() {
1750
- }
1751
- make() {
1752
- const t = this.pattern, e = this.options;
1753
- if (!e.nocomment && t.charAt(0) === "#") return void (this.comment = !0);
1754
- if (!t) return void (this.empty = !0);
1755
- this.parseNegate(), this.globSet = [...new Set(this.braceExpand())], e.debug && (this.debug = function() {
1756
- return console.error(...arguments);
1757
- }), this.debug(this.pattern, this.globSet);
1758
- const n = this.globSet.map(((o) => this.slashSplit(o)));
1759
- this.globParts = this.preprocess(n), this.debug(this.pattern, this.globParts);
1760
- let s = this.globParts.map(((o, i, a) => {
1761
- if (this.isWindows && this.windowsNoMagicRoot) {
1762
- const l = !(o[0] !== "" || o[1] !== "" || o[2] !== "?" && Oe.test(o[2]) || Oe.test(o[3])), c = /^[a-z]:/i.test(o[0]);
1763
- if (l) return [...o.slice(0, 4), ...o.slice(4).map(((u) => this.parse(u)))];
1764
- if (c) return [o[0], ...o.slice(1).map(((u) => this.parse(u)))];
1765
- }
1766
- return o.map(((l) => this.parse(l)));
1767
- }));
1768
- if (this.debug(this.pattern, s), this.set = s.filter(((o) => o.indexOf(!1) === -1)), this.isWindows) for (let o = 0; o < this.set.length; o++) {
1769
- const i = this.set[o];
1770
- i[0] === "" && i[1] === "" && this.globParts[o][2] === "?" && typeof i[3] == "string" && /^[a-z]:$/i.test(i[3]) && (i[2] = "?");
1771
- }
1772
- this.debug(this.pattern, this.set);
1773
- }
1774
- preprocess(t) {
1775
- if (this.options.noglobstar) for (let n = 0; n < t.length; n++) for (let s = 0; s < t[n].length; s++) t[n][s] === "**" && (t[n][s] = "*");
1776
- const { optimizationLevel: e = 1 } = this.options;
1777
- return e >= 2 ? (t = this.firstPhasePreProcess(t), t = this.secondPhasePreProcess(t)) : t = e >= 1 ? this.levelOneOptimize(t) : this.adjascentGlobstarOptimize(t), t;
1778
- }
1779
- adjascentGlobstarOptimize(t) {
1780
- return t.map(((e) => {
1781
- let n = -1;
1782
- for (; (n = e.indexOf("**", n + 1)) !== -1; ) {
1783
- let s = n;
1784
- for (; e[s + 1] === "**"; ) s++;
1785
- s !== n && e.splice(n, s - n);
1786
- }
1787
- return e;
1788
- }));
1789
- }
1790
- levelOneOptimize(t) {
1791
- return t.map(((e) => (e = e.reduce(((n, s) => {
1792
- const o = n[n.length - 1];
1793
- return s === "**" && o === "**" ? n : s === ".." && o && o !== ".." && o !== "." && o !== "**" ? (n.pop(), n) : (n.push(s), n);
1794
- }), [])).length === 0 ? [""] : e));
1795
- }
1796
- levelTwoFileOptimize(t) {
1797
- Array.isArray(t) || (t = this.slashSplit(t));
1798
- let e = !1;
1799
- do {
1800
- if (e = !1, !this.preserveMultipleSlashes) {
1801
- for (let s = 1; s < t.length - 1; s++) {
1802
- const o = t[s];
1803
- s === 1 && o === "" && t[0] === "" || o !== "." && o !== "" || (e = !0, t.splice(s, 1), s--);
1804
- }
1805
- t[0] !== "." || t.length !== 2 || t[1] !== "." && t[1] !== "" || (e = !0, t.pop());
1806
- }
1807
- let n = 0;
1808
- for (; (n = t.indexOf("..", n + 1)) !== -1; ) {
1809
- const s = t[n - 1];
1810
- s && s !== "." && s !== ".." && s !== "**" && (e = !0, t.splice(n - 1, 2), n -= 2);
1811
- }
1812
- } while (e);
1813
- return t.length === 0 ? [""] : t;
1814
- }
1815
- firstPhasePreProcess(t) {
1816
- let e = !1;
1817
- do {
1818
- e = !1;
1819
- for (let n of t) {
1820
- let s = -1;
1821
- for (; (s = n.indexOf("**", s + 1)) !== -1; ) {
1822
- let i = s;
1823
- for (; n[i + 1] === "**"; ) i++;
1824
- i > s && n.splice(s + 1, i - s);
1825
- let a = n[s + 1];
1826
- const l = n[s + 2], c = n[s + 3];
1827
- if (a !== ".." || !l || l === "." || l === ".." || !c || c === "." || c === "..") continue;
1828
- e = !0, n.splice(s, 1);
1829
- const u = n.slice(0);
1830
- u[s] = "**", t.push(u), s--;
1831
- }
1832
- if (!this.preserveMultipleSlashes) {
1833
- for (let i = 1; i < n.length - 1; i++) {
1834
- const a = n[i];
1835
- i === 1 && a === "" && n[0] === "" || a !== "." && a !== "" || (e = !0, n.splice(i, 1), i--);
1836
- }
1837
- n[0] !== "." || n.length !== 2 || n[1] !== "." && n[1] !== "" || (e = !0, n.pop());
1838
- }
1839
- let o = 0;
1840
- for (; (o = n.indexOf("..", o + 1)) !== -1; ) {
1841
- const i = n[o - 1];
1842
- if (i && i !== "." && i !== ".." && i !== "**") {
1843
- e = !0;
1844
- const a = o === 1 && n[o + 1] === "**" ? ["."] : [];
1845
- n.splice(o - 1, 2, ...a), n.length === 0 && n.push(""), o -= 2;
1846
- }
1847
- }
1848
- }
1849
- } while (e);
1850
- return t;
1851
- }
1852
- secondPhasePreProcess(t) {
1853
- for (let e = 0; e < t.length - 1; e++) for (let n = e + 1; n < t.length; n++) {
1854
- const s = this.partsMatch(t[e], t[n], !this.preserveMultipleSlashes);
1855
- if (s) {
1856
- t[e] = [], t[n] = s;
1857
- break;
1858
- }
1859
- }
1860
- return t.filter(((e) => e.length));
1861
- }
1862
- partsMatch(t, e) {
1863
- let n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], s = 0, o = 0, i = [], a = "";
1864
- for (; s < t.length && o < e.length; ) if (t[s] === e[o]) i.push(a === "b" ? e[o] : t[s]), s++, o++;
1865
- else if (n && t[s] === "**" && e[o] === t[s + 1]) i.push(t[s]), s++;
1866
- else if (n && e[o] === "**" && t[s] === e[o + 1]) i.push(e[o]), o++;
1867
- else if (t[s] !== "*" || !e[o] || !this.options.dot && e[o].startsWith(".") || e[o] === "**") {
1868
- if (e[o] !== "*" || !t[s] || !this.options.dot && t[s].startsWith(".") || t[s] === "**" || a === "a") return !1;
1869
- a = "b", i.push(e[o]), s++, o++;
1870
- } else {
1871
- if (a === "b") return !1;
1872
- a = "a", i.push(t[s]), s++, o++;
1873
- }
1874
- return t.length === e.length && i;
1875
- }
1876
- parseNegate() {
1877
- if (this.nonegate) return;
1878
- const t = this.pattern;
1879
- let e = !1, n = 0;
1880
- for (let s = 0; s < t.length && t.charAt(s) === "!"; s++) e = !e, n++;
1881
- n && (this.pattern = t.slice(n)), this.negate = e;
1882
- }
1883
- matchOne(t, e) {
1884
- let n = arguments.length > 2 && arguments[2] !== void 0 && arguments[2];
1885
- const s = this.options;
1886
- if (this.isWindows) {
1887
- const p = typeof t[0] == "string" && /^[a-z]:$/i.test(t[0]), m = !p && t[0] === "" && t[1] === "" && t[2] === "?" && /^[a-z]:$/i.test(t[3]), b = typeof e[0] == "string" && /^[a-z]:$/i.test(e[0]), y = m ? 3 : p ? 0 : void 0, v = !b && e[0] === "" && e[1] === "" && e[2] === "?" && typeof e[3] == "string" && /^[a-z]:$/i.test(e[3]) ? 3 : b ? 0 : void 0;
1888
- if (typeof y == "number" && typeof v == "number") {
1889
- const [w, x] = [t[y], e[v]];
1890
- w.toLowerCase() === x.toLowerCase() && (e[v] = w, v > y ? e = e.slice(v) : y > v && (t = t.slice(y)));
1891
- }
1892
- }
1893
- const { optimizationLevel: o = 1 } = this.options;
1894
- o >= 2 && (t = this.levelTwoFileOptimize(t)), this.debug("matchOne", this, { file: t, pattern: e }), this.debug("matchOne", t.length, e.length);
1895
- for (var i = 0, a = 0, l = t.length, c = e.length; i < l && a < c; i++, a++) {
1896
- this.debug("matchOne loop");
1897
- var u = e[a], f = t[i];
1898
- if (this.debug(e, u, f), u === !1) return !1;
1899
- if (u === z) {
1900
- this.debug("GLOBSTAR", [e, u, f]);
1901
- var h = i, d = a + 1;
1902
- if (d === c) {
1903
- for (this.debug("** at the end"); i < l; i++) if (t[i] === "." || t[i] === ".." || !s.dot && t[i].charAt(0) === ".") return !1;
1904
- return !0;
1905
- }
1906
- for (; h < l; ) {
1907
- var g = t[h];
1908
- if (this.debug(`
1909
- globstar while`, t, h, e, d, g), this.matchOne(t.slice(h), e.slice(d), n)) return this.debug("globstar found match!", h, l, g), !0;
1910
- if (g === "." || g === ".." || !s.dot && g.charAt(0) === ".") {
1911
- this.debug("dot detected!", t, h, e, d);
1912
- break;
1913
- }
1914
- this.debug("globstar swallow a segment, and continue"), h++;
1915
- }
1916
- return !(!n || (this.debug(`
1917
- >>> no match, partial?`, t, h, e, d), h !== l));
1918
- }
1919
- let p;
1920
- if (typeof u == "string" ? (p = f === u, this.debug("string match", u, f, p)) : (p = u.test(f), this.debug("pattern match", u, f, p)), !p) return !1;
1921
- }
1922
- if (i === l && a === c) return !0;
1923
- if (i === l) return n;
1924
- if (a === c) return i === l - 1 && t[i] === "";
1925
- throw new Error("wtf?");
1926
- }
1927
- braceExpand() {
1928
- return nr(this.pattern, this.options);
1929
- }
1930
- parse(t) {
1931
- Rt(t);
1932
- const e = this.options;
1933
- if (t === "**") return z;
1934
- if (t === "") return "";
1935
- let n, s = null;
1936
- (n = t.match(On)) ? s = e.dot ? Cn : Sn : (n = t.match(yn)) ? s = (e.nocase ? e.dot ? xn : wn : e.dot ? vn : bn)(n[1]) : (n = t.match(In)) ? s = (e.nocase ? e.dot ? Fn : $n : e.dot ? jn : Rn)(n) : (n = t.match(Nn)) ? s = e.dot ? En : Pn : (n = t.match(An)) && (s = Tn);
1937
- const o = M.fromGlob(t, this.options).toMMPattern();
1938
- return s && typeof o == "object" && Reflect.defineProperty(o, "test", { value: s }), o;
1939
- }
1940
- makeRe() {
1941
- if (this.regexp || this.regexp === !1) return this.regexp;
1942
- const t = this.set;
1943
- if (!t.length) return this.regexp = !1, this.regexp;
1944
- const e = this.options, n = e.noglobstar ? "[^/]*?" : e.dot ? "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?" : "(?:(?!(?:\\/|^)\\.).)*?", s = new Set(e.nocase ? ["i"] : []);
1945
- let o = t.map(((l) => {
1946
- const c = l.map(((u) => {
1947
- if (u instanceof RegExp) for (const f of u.flags.split("")) s.add(f);
1948
- return typeof u == "string" ? u.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") : u === z ? z : u._src;
1949
- }));
1950
- return c.forEach(((u, f) => {
1951
- const h = c[f + 1], d = c[f - 1];
1952
- u === z && d !== z && (d === void 0 ? h !== void 0 && h !== z ? c[f + 1] = "(?:\\/|" + n + "\\/)?" + h : c[f] = n : h === void 0 ? c[f - 1] = d + "(?:\\/|" + n + ")?" : h !== z && (c[f - 1] = d + "(?:\\/|\\/" + n + "\\/)" + h, c[f + 1] = z));
1953
- })), c.filter(((u) => u !== z)).join("/");
1954
- })).join("|");
1955
- const [i, a] = t.length > 1 ? ["(?:", ")"] : ["", ""];
1956
- o = "^" + i + o + a + "$", this.negate && (o = "^(?!" + o + ").+$");
1957
- try {
1958
- this.regexp = new RegExp(o, [...s].join(""));
1959
- } catch {
1960
- this.regexp = !1;
1961
- }
1962
- return this.regexp;
1963
- }
1964
- slashSplit(t) {
1965
- return this.preserveMultipleSlashes ? t.split("/") : this.isWindows && /^\/\/[^\/]+/.test(t) ? ["", ...t.split(/\/+/)] : t.split(/\/+/);
1966
- }
1967
- match(t) {
1968
- let e = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.partial;
1969
- if (this.debug("match", t, this.pattern), this.comment) return !1;
1970
- if (this.empty) return t === "";
1971
- if (t === "/" && e) return !0;
1972
- const n = this.options;
1973
- this.isWindows && (t = t.split("\\").join("/"));
1974
- const s = this.slashSplit(t);
1975
- this.debug(this.pattern, "split", s);
1976
- const o = this.set;
1977
- this.debug(this.pattern, "set", o);
1978
- let i = s[s.length - 1];
1979
- if (!i) for (let a = s.length - 2; !i && a >= 0; a--) i = s[a];
1980
- for (let a = 0; a < o.length; a++) {
1981
- const l = o[a];
1982
- let c = s;
1983
- if (n.matchBase && l.length === 1 && (c = [i]), this.matchOne(c, l, e)) return !!n.flipNegate || !this.negate;
1984
- }
1985
- return !n.flipNegate && this.negate;
1986
- }
1987
- static defaults(t) {
1988
- return D.defaults(t).Minimatch;
1989
- }
1990
- }
1991
- function ie(r) {
1992
- const t = new Error(`${arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""}Invalid response: ${r.status} ${r.statusText}`);
1993
- return t.status = r.status, t.response = r, t;
1994
- }
1995
- function L(r, t) {
1996
- const { status: e } = t;
1997
- if (e === 401 && r.digest) return t;
1998
- if (e >= 400) throw ie(t);
1999
- return t;
2000
- }
2001
- function pt(r, t) {
2002
- return arguments.length > 2 && arguments[2] !== void 0 && arguments[2] ? { data: t, headers: r.headers ? on(r.headers) : {}, status: r.status, statusText: r.statusText } : t;
2003
- }
2004
- D.AST = M, D.Minimatch = Lt, D.escape = function(r) {
2005
- let { windowsPathsNoEscape: t = !1 } = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2006
- return t ? r.replace(/[?*()[\]]/g, "[$&]") : r.replace(/[?*()[\]\\]/g, "\\$&");
2007
- }, D.unescape = Nt;
2008
- const Ln = (Se = function(r, t, e) {
2009
- let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
2010
- const s = R({ url: C(r.remoteURL, S(t)), method: "COPY", headers: { Destination: C(r.remoteURL, S(e)), Overwrite: n.overwrite === !1 ? "F" : "T", Depth: n.shallow ? "0" : "infinity" } }, r, n);
2011
- return i = function(a) {
2012
- L(r, a);
2013
- }, (o = j(s, r)) && o.then || (o = Promise.resolve(o)), i ? o.then(i) : o;
2014
- var o, i;
2015
- }, function() {
2016
- for (var r = [], t = 0; t < arguments.length; t++) r[t] = arguments[t];
2017
- try {
2018
- return Promise.resolve(Se.apply(this, r));
2019
- } catch (e) {
2020
- return Promise.reject(e);
2021
- }
2022
- });
2023
- var Se;
2024
- const Un = { preserveOrder: !1, attributeNamePrefix: "@_", attributesGroupName: !1, textNodeName: "#text", ignoreAttributes: !0, removeNSPrefix: !1, allowBooleanAttributes: !1, parseTagValue: !0, parseAttributeValue: !1, trimValues: !0, cdataPropName: !1, numberParseOptions: { hex: !0, leadingZeros: !0, eNotation: !0 }, tagValueProcessor: function(r, t) {
2025
- return t;
2026
- }, attributeValueProcessor: function(r, t) {
2027
- return t;
2028
- }, stopNodes: [], alwaysCreateTextNode: !1, isArray: () => !1, commentPropName: !1, unpairedTags: [], processEntities: !0, htmlEntities: !1, ignoreDeclaration: !1, ignorePiTags: !1, transformTagName: !1, transformAttributeName: !1, updateTag: function(r, t, e) {
2029
- return r;
2030
- }, captureMetaData: !1 }, Ce = ":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD", Dn = new RegExp("^[" + Ce + "][" + Ce + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$");
2031
- function sr(r, t) {
2032
- const e = [];
2033
- let n = t.exec(r);
2034
- for (; n; ) {
2035
- const s = [];
2036
- s.startIndex = t.lastIndex - n[0].length;
2037
- const o = n.length;
2038
- for (let i = 0; i < o; i++) s.push(n[i]);
2039
- e.push(s), n = t.exec(r);
2040
- }
2041
- return e;
2042
- }
2043
- const Dt = function(r) {
2044
- return Dn.exec(r) != null;
2045
- };
2046
- let Kt;
2047
- Kt = typeof Symbol != "function" ? "@@xmlMetadata" : /* @__PURE__ */ Symbol("XML Node Metadata");
2048
- class at {
2049
- constructor(t) {
2050
- this.tagname = t, this.child = [], this[":@"] = {};
2051
- }
2052
- add(t, e) {
2053
- t === "__proto__" && (t = "#__proto__"), this.child.push({ [t]: e });
2054
- }
2055
- addChild(t, e) {
2056
- t.tagname === "__proto__" && (t.tagname = "#__proto__"), t[":@"] && Object.keys(t[":@"]).length > 0 ? this.child.push({ [t.tagname]: t.child, ":@": t[":@"] }) : this.child.push({ [t.tagname]: t.child }), e !== void 0 && (this.child[this.child.length - 1][Kt] = { startIndex: e });
2057
- }
2058
- static getMetaDataSymbol() {
2059
- return Kt;
2060
- }
2061
- }
2062
- class kn {
2063
- constructor(t) {
2064
- this.suppressValidationErr = !t;
2065
- }
2066
- readDocType(t, e) {
2067
- const n = {};
2068
- if (t[e + 3] !== "O" || t[e + 4] !== "C" || t[e + 5] !== "T" || t[e + 6] !== "Y" || t[e + 7] !== "P" || t[e + 8] !== "E") throw new Error("Invalid Tag instead of DOCTYPE");
2069
- {
2070
- e += 9;
2071
- let s = 1, o = !1, i = !1, a = "";
2072
- for (; e < t.length; e++) if (t[e] !== "<" || i) if (t[e] === ">") {
2073
- if (i ? t[e - 1] === "-" && t[e - 2] === "-" && (i = !1, s--) : s--, s === 0) break;
2074
- } else t[e] === "[" ? o = !0 : a += t[e];
2075
- else {
2076
- if (o && ot(t, "!ENTITY", e)) {
2077
- let l, c;
2078
- e += 7, [l, c, e] = this.readEntityExp(t, e + 1, this.suppressValidationErr), c.indexOf("&") === -1 && (n[l] = { regx: RegExp(`&${l};`, "g"), val: c });
2079
- } else if (o && ot(t, "!ELEMENT", e)) {
2080
- e += 8;
2081
- const { index: l } = this.readElementExp(t, e + 1);
2082
- e = l;
2083
- } else if (o && ot(t, "!ATTLIST", e)) e += 8;
2084
- else if (o && ot(t, "!NOTATION", e)) {
2085
- e += 9;
2086
- const { index: l } = this.readNotationExp(t, e + 1, this.suppressValidationErr);
2087
- e = l;
2088
- } else {
2089
- if (!ot(t, "!--", e)) throw new Error("Invalid DOCTYPE");
2090
- i = !0;
2091
- }
2092
- s++, a = "";
2093
- }
2094
- if (s !== 0) throw new Error("Unclosed DOCTYPE");
2095
- }
2096
- return { entities: n, i: e };
2097
- }
2098
- readEntityExp(t, e) {
2099
- e = B(t, e);
2100
- let n = "";
2101
- for (; e < t.length && !/\s/.test(t[e]) && t[e] !== '"' && t[e] !== "'"; ) n += t[e], e++;
2102
- if (wt(n), e = B(t, e), !this.suppressValidationErr) {
2103
- if (t.substring(e, e + 6).toUpperCase() === "SYSTEM") throw new Error("External entities are not supported");
2104
- if (t[e] === "%") throw new Error("Parameter entities are not supported");
2105
- }
2106
- let s = "";
2107
- return [e, s] = this.readIdentifierVal(t, e, "entity"), [n, s, --e];
2108
- }
2109
- readNotationExp(t, e) {
2110
- e = B(t, e);
2111
- let n = "";
2112
- for (; e < t.length && !/\s/.test(t[e]); ) n += t[e], e++;
2113
- !this.suppressValidationErr && wt(n), e = B(t, e);
2114
- const s = t.substring(e, e + 6).toUpperCase();
2115
- if (!this.suppressValidationErr && s !== "SYSTEM" && s !== "PUBLIC") throw new Error(`Expected SYSTEM or PUBLIC, found "${s}"`);
2116
- e += s.length, e = B(t, e);
2117
- let o = null, i = null;
2118
- if (s === "PUBLIC") [e, o] = this.readIdentifierVal(t, e, "publicIdentifier"), t[e = B(t, e)] !== '"' && t[e] !== "'" || ([e, i] = this.readIdentifierVal(t, e, "systemIdentifier"));
2119
- else if (s === "SYSTEM" && ([e, i] = this.readIdentifierVal(t, e, "systemIdentifier"), !this.suppressValidationErr && !i)) throw new Error("Missing mandatory system identifier for SYSTEM notation");
2120
- return { notationName: n, publicIdentifier: o, systemIdentifier: i, index: --e };
2121
- }
2122
- readIdentifierVal(t, e, n) {
2123
- let s = "";
2124
- const o = t[e];
2125
- if (o !== '"' && o !== "'") throw new Error(`Expected quoted string, found "${o}"`);
2126
- for (e++; e < t.length && t[e] !== o; ) s += t[e], e++;
2127
- if (t[e] !== o) throw new Error(`Unterminated ${n} value`);
2128
- return [++e, s];
2129
- }
2130
- readElementExp(t, e) {
2131
- e = B(t, e);
2132
- let n = "";
2133
- for (; e < t.length && !/\s/.test(t[e]); ) n += t[e], e++;
2134
- if (!this.suppressValidationErr && !Dt(n)) throw new Error(`Invalid element name: "${n}"`);
2135
- let s = "";
2136
- if (t[e = B(t, e)] === "E" && ot(t, "MPTY", e)) e += 4;
2137
- else if (t[e] === "A" && ot(t, "NY", e)) e += 2;
2138
- else if (t[e] === "(") {
2139
- for (e++; e < t.length && t[e] !== ")"; ) s += t[e], e++;
2140
- if (t[e] !== ")") throw new Error("Unterminated content model");
2141
- } else if (!this.suppressValidationErr) throw new Error(`Invalid Element Expression, found "${t[e]}"`);
2142
- return { elementName: n, contentModel: s.trim(), index: e };
2143
- }
2144
- readAttlistExp(t, e) {
2145
- e = B(t, e);
2146
- let n = "";
2147
- for (; e < t.length && !/\s/.test(t[e]); ) n += t[e], e++;
2148
- wt(n), e = B(t, e);
2149
- let s = "";
2150
- for (; e < t.length && !/\s/.test(t[e]); ) s += t[e], e++;
2151
- if (!wt(s)) throw new Error(`Invalid attribute name: "${s}"`);
2152
- e = B(t, e);
2153
- let o = "";
2154
- if (t.substring(e, e + 8).toUpperCase() === "NOTATION") {
2155
- if (o = "NOTATION", t[e = B(t, e += 8)] !== "(") throw new Error(`Expected '(', found "${t[e]}"`);
2156
- e++;
2157
- let a = [];
2158
- for (; e < t.length && t[e] !== ")"; ) {
2159
- let l = "";
2160
- for (; e < t.length && t[e] !== "|" && t[e] !== ")"; ) l += t[e], e++;
2161
- if (l = l.trim(), !wt(l)) throw new Error(`Invalid notation name: "${l}"`);
2162
- a.push(l), t[e] === "|" && (e++, e = B(t, e));
2163
- }
2164
- if (t[e] !== ")") throw new Error("Unterminated list of notations");
2165
- e++, o += " (" + a.join("|") + ")";
2166
- } else {
2167
- for (; e < t.length && !/\s/.test(t[e]); ) o += t[e], e++;
2168
- const a = ["CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS"];
2169
- if (!this.suppressValidationErr && !a.includes(o.toUpperCase())) throw new Error(`Invalid attribute type: "${o}"`);
2170
- }
2171
- e = B(t, e);
2172
- let i = "";
2173
- return t.substring(e, e + 8).toUpperCase() === "#REQUIRED" ? (i = "#REQUIRED", e += 8) : t.substring(e, e + 7).toUpperCase() === "#IMPLIED" ? (i = "#IMPLIED", e += 7) : [e, i] = this.readIdentifierVal(t, e, "ATTLIST"), { elementName: n, attributeName: s, attributeType: o, defaultValue: i, index: e };
2174
- }
2175
- }
2176
- const B = (r, t) => {
2177
- for (; t < r.length && /\s/.test(r[t]); ) t++;
2178
- return t;
2179
- };
2180
- function ot(r, t, e) {
2181
- for (let n = 0; n < t.length; n++) if (t[n] !== r[e + n + 1]) return !1;
2182
- return !0;
2183
- }
2184
- function wt(r) {
2185
- if (Dt(r)) return r;
2186
- throw new Error(`Invalid entity name ${r}`);
2187
- }
2188
- const Mn = /^[-+]?0x[a-fA-F0-9]+$/, _n = /^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/, Vn = { hex: !0, leadingZeros: !0, decimalPoint: ".", eNotation: !0 }, Bn = /^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;
2189
- function or(r) {
2190
- return typeof r == "function" ? r : Array.isArray(r) ? (t) => {
2191
- for (const e of r)
2192
- if (typeof e == "string" && t === e || e instanceof RegExp && e.test(t)) return !0;
2193
- } : () => !1;
2194
- }
2195
- class Wn {
2196
- constructor(t) {
2197
- if (this.options = t, this.currentNode = null, this.tagsNodeStack = [], this.docTypeEntities = {}, this.lastEntities = { apos: { regex: /&(apos|#39|#x27);/g, val: "'" }, gt: { regex: /&(gt|#62|#x3E);/g, val: ">" }, lt: { regex: /&(lt|#60|#x3C);/g, val: "<" }, quot: { regex: /&(quot|#34|#x22);/g, val: '"' } }, this.ampEntity = { regex: /&(amp|#38|#x26);/g, val: "&" }, this.htmlEntities = { space: { regex: /&(nbsp|#160);/g, val: " " }, cent: { regex: /&(cent|#162);/g, val: "¢" }, pound: { regex: /&(pound|#163);/g, val: "£" }, yen: { regex: /&(yen|#165);/g, val: "¥" }, euro: { regex: /&(euro|#8364);/g, val: "€" }, copyright: { regex: /&(copy|#169);/g, val: "©" }, reg: { regex: /&(reg|#174);/g, val: "®" }, inr: { regex: /&(inr|#8377);/g, val: "₹" }, num_dec: { regex: /&#([0-9]{1,7});/g, val: (e, n) => Ie(n, 10, "&#") }, num_hex: { regex: /&#x([0-9a-fA-F]{1,6});/g, val: (e, n) => Ie(n, 16, "&#x") } }, this.addExternalEntities = qn, this.parseXml = Yn, this.parseTextData = Gn, this.resolveNameSpace = zn, this.buildAttributesMap = Xn, this.isItStopNode = Qn, this.replaceEntitiesValue = Jn, this.readStopNodeData = ts, this.saveTextToParentTag = Kn, this.addChild = Zn, this.ignoreAttributesFn = or(this.options.ignoreAttributes), this.options.stopNodes && this.options.stopNodes.length > 0) {
2198
- this.stopNodesExact = /* @__PURE__ */ new Set(), this.stopNodesWildcard = /* @__PURE__ */ new Set();
2199
- for (let e = 0; e < this.options.stopNodes.length; e++) {
2200
- const n = this.options.stopNodes[e];
2201
- typeof n == "string" && (n.startsWith("*.") ? this.stopNodesWildcard.add(n.substring(2)) : this.stopNodesExact.add(n));
2202
- }
2203
- }
2204
- }
2205
- }
2206
- function qn(r) {
2207
- const t = Object.keys(r);
2208
- for (let e = 0; e < t.length; e++) {
2209
- const n = t[e];
2210
- this.lastEntities[n] = { regex: new RegExp("&" + n + ";", "g"), val: r[n] };
2211
- }
2212
- }
2213
- function Gn(r, t, e, n, s, o, i) {
2214
- if (r !== void 0 && (this.options.trimValues && !n && (r = r.trim()), r.length > 0)) {
2215
- i || (r = this.replaceEntitiesValue(r));
2216
- const a = this.options.tagValueProcessor(t, r, e, s, o);
2217
- return a == null ? r : typeof a != typeof r || a !== r ? a : this.options.trimValues || r.trim() === r ? ir(r, this.options.parseTagValue, this.options.numberParseOptions) : r;
2218
- }
2219
- }
2220
- function zn(r) {
2221
- if (this.options.removeNSPrefix) {
2222
- const t = r.split(":"), e = r.charAt(0) === "/" ? "/" : "";
2223
- if (t[0] === "xmlns") return "";
2224
- t.length === 2 && (r = e + t[1]);
2225
- }
2226
- return r;
2227
- }
2228
- const Hn = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
2229
- function Xn(r, t) {
2230
- if (this.options.ignoreAttributes !== !0 && typeof r == "string") {
2231
- const e = sr(r, Hn), n = e.length, s = {};
2232
- for (let o = 0; o < n; o++) {
2233
- const i = this.resolveNameSpace(e[o][1]);
2234
- if (this.ignoreAttributesFn(i, t)) continue;
2235
- let a = e[o][4], l = this.options.attributeNamePrefix + i;
2236
- if (i.length) if (this.options.transformAttributeName && (l = this.options.transformAttributeName(l)), l === "__proto__" && (l = "#__proto__"), a !== void 0) {
2237
- this.options.trimValues && (a = a.trim()), a = this.replaceEntitiesValue(a);
2238
- const c = this.options.attributeValueProcessor(i, a, t);
2239
- s[l] = c == null ? a : typeof c != typeof a || c !== a ? c : ir(a, this.options.parseAttributeValue, this.options.numberParseOptions);
2240
- } else this.options.allowBooleanAttributes && (s[l] = !0);
2241
- }
2242
- if (!Object.keys(s).length) return;
2243
- if (this.options.attributesGroupName) {
2244
- const o = {};
2245
- return o[this.options.attributesGroupName] = s, o;
2246
- }
2247
- return s;
2248
- }
2249
- }
2250
- const Yn = function(r) {
2251
- r = r.replace(/\r\n?/g, `
2252
- `);
2253
- const t = new at("!xml");
2254
- let e = t, n = "", s = "";
2255
- const o = new kn(this.options.processEntities);
2256
- for (let i = 0; i < r.length; i++) if (r[i] === "<") if (r[i + 1] === "/") {
2257
- const a = ut(r, ">", i, "Closing Tag is not closed.");
2258
- let l = r.substring(i + 2, a).trim();
2259
- if (this.options.removeNSPrefix) {
2260
- const f = l.indexOf(":");
2261
- f !== -1 && (l = l.substr(f + 1));
2262
- }
2263
- this.options.transformTagName && (l = this.options.transformTagName(l)), e && (n = this.saveTextToParentTag(n, e, s));
2264
- const c = s.substring(s.lastIndexOf(".") + 1);
2265
- if (l && this.options.unpairedTags.indexOf(l) !== -1) throw new Error(`Unpaired tag can not be used as closing tag: </${l}>`);
2266
- let u = 0;
2267
- c && this.options.unpairedTags.indexOf(c) !== -1 ? (u = s.lastIndexOf(".", s.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : u = s.lastIndexOf("."), s = s.substring(0, u), e = this.tagsNodeStack.pop(), n = "", i = a;
2268
- } else if (r[i + 1] === "?") {
2269
- let a = Qt(r, i, !1, "?>");
2270
- if (!a) throw new Error("Pi Tag is not closed.");
2271
- if (n = this.saveTextToParentTag(n, e, s), !(this.options.ignoreDeclaration && a.tagName === "?xml" || this.options.ignorePiTags)) {
2272
- const l = new at(a.tagName);
2273
- l.add(this.options.textNodeName, ""), a.tagName !== a.tagExp && a.attrExpPresent && (l[":@"] = this.buildAttributesMap(a.tagExp, s)), this.addChild(e, l, s, i);
2274
- }
2275
- i = a.closeIndex + 1;
2276
- } else if (r.substr(i + 1, 3) === "!--") {
2277
- const a = ut(r, "-->", i + 4, "Comment is not closed.");
2278
- if (this.options.commentPropName) {
2279
- const l = r.substring(i + 4, a - 2);
2280
- n = this.saveTextToParentTag(n, e, s), e.add(this.options.commentPropName, [{ [this.options.textNodeName]: l }]);
2281
- }
2282
- i = a;
2283
- } else if (r.substr(i + 1, 2) === "!D") {
2284
- const a = o.readDocType(r, i);
2285
- this.docTypeEntities = a.entities, i = a.i;
2286
- } else if (r.substr(i + 1, 2) === "![") {
2287
- const a = ut(r, "]]>", i, "CDATA is not closed.") - 2, l = r.substring(i + 9, a);
2288
- n = this.saveTextToParentTag(n, e, s);
2289
- let c = this.parseTextData(l, e.tagname, s, !0, !1, !0, !0);
2290
- c == null && (c = ""), this.options.cdataPropName ? e.add(this.options.cdataPropName, [{ [this.options.textNodeName]: l }]) : e.add(this.options.textNodeName, c), i = a + 2;
2291
- } else {
2292
- let a = Qt(r, i, this.options.removeNSPrefix), l = a.tagName;
2293
- const c = a.rawTagName;
2294
- let u = a.tagExp, f = a.attrExpPresent, h = a.closeIndex;
2295
- if (this.options.transformTagName) {
2296
- const p = this.options.transformTagName(l);
2297
- u === l && (u = p), l = p;
2298
- }
2299
- e && n && e.tagname !== "!xml" && (n = this.saveTextToParentTag(n, e, s, !1));
2300
- const d = e;
2301
- d && this.options.unpairedTags.indexOf(d.tagname) !== -1 && (e = this.tagsNodeStack.pop(), s = s.substring(0, s.lastIndexOf("."))), l !== t.tagname && (s += s ? "." + l : l);
2302
- const g = i;
2303
- if (this.isItStopNode(this.stopNodesExact, this.stopNodesWildcard, s, l)) {
2304
- let p = "";
2305
- if (u.length > 0 && u.lastIndexOf("/") === u.length - 1) l[l.length - 1] === "/" ? (l = l.substr(0, l.length - 1), s = s.substr(0, s.length - 1), u = l) : u = u.substr(0, u.length - 1), i = a.closeIndex;
2306
- else if (this.options.unpairedTags.indexOf(l) !== -1) i = a.closeIndex;
2307
- else {
2308
- const b = this.readStopNodeData(r, c, h + 1);
2309
- if (!b) throw new Error(`Unexpected end of ${c}`);
2310
- i = b.i, p = b.tagContent;
2311
- }
2312
- const m = new at(l);
2313
- l !== u && f && (m[":@"] = this.buildAttributesMap(u, s)), p && (p = this.parseTextData(p, l, s, !0, f, !0, !0)), s = s.substr(0, s.lastIndexOf(".")), m.add(this.options.textNodeName, p), this.addChild(e, m, s, g);
2314
- } else {
2315
- if (u.length > 0 && u.lastIndexOf("/") === u.length - 1) {
2316
- if (l[l.length - 1] === "/" ? (l = l.substr(0, l.length - 1), s = s.substr(0, s.length - 1), u = l) : u = u.substr(0, u.length - 1), this.options.transformTagName) {
2317
- const m = this.options.transformTagName(l);
2318
- u === l && (u = m), l = m;
2319
- }
2320
- const p = new at(l);
2321
- l !== u && f && (p[":@"] = this.buildAttributesMap(u, s)), this.addChild(e, p, s, g), s = s.substr(0, s.lastIndexOf("."));
2322
- } else {
2323
- const p = new at(l);
2324
- this.tagsNodeStack.push(e), l !== u && f && (p[":@"] = this.buildAttributesMap(u, s)), this.addChild(e, p, s, g), e = p;
2325
- }
2326
- n = "", i = h;
2327
- }
2328
- }
2329
- else n += r[i];
2330
- return t.child;
2331
- };
2332
- function Zn(r, t, e, n) {
2333
- this.options.captureMetaData || (n = void 0);
2334
- const s = this.options.updateTag(t.tagname, e, t[":@"]);
2335
- s === !1 || (typeof s == "string" && (t.tagname = s), r.addChild(t, n));
2336
- }
2337
- const Jn = function(r) {
2338
- if (this.options.processEntities) {
2339
- for (let t in this.docTypeEntities) {
2340
- const e = this.docTypeEntities[t];
2341
- r = r.replace(e.regx, e.val);
2342
- }
2343
- for (let t in this.lastEntities) {
2344
- const e = this.lastEntities[t];
2345
- r = r.replace(e.regex, e.val);
2346
- }
2347
- if (this.options.htmlEntities) for (let t in this.htmlEntities) {
2348
- const e = this.htmlEntities[t];
2349
- r = r.replace(e.regex, e.val);
2350
- }
2351
- r = r.replace(this.ampEntity.regex, this.ampEntity.val);
2352
- }
2353
- return r;
2354
- };
2355
- function Kn(r, t, e, n) {
2356
- return r && (n === void 0 && (n = t.child.length === 0), (r = this.parseTextData(r, t.tagname, e, !1, !!t[":@"] && Object.keys(t[":@"]).length !== 0, n)) !== void 0 && r !== "" && t.add(this.options.textNodeName, r), r = ""), r;
2357
- }
2358
- function Qn(r, t, e, n) {
2359
- return !(!t || !t.has(n)) || !(!r || !r.has(e));
2360
- }
2361
- function ut(r, t, e, n) {
2362
- const s = r.indexOf(t, e);
2363
- if (s === -1) throw new Error(n);
2364
- return s + t.length - 1;
2365
- }
2366
- function Qt(r, t, e) {
2367
- const n = (function(u, f) {
2368
- let h, d = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ">", g = "";
2369
- for (let p = f; p < u.length; p++) {
2370
- let m = u[p];
2371
- if (h) m === h && (h = "");
2372
- else if (m === '"' || m === "'") h = m;
2373
- else if (m === d[0]) {
2374
- if (!d[1]) return { data: g, index: p };
2375
- if (u[p + 1] === d[1]) return { data: g, index: p };
2376
- } else m === " " && (m = " ");
2377
- g += m;
2378
- }
2379
- })(r, t + 1, arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ">");
2380
- if (!n) return;
2381
- let s = n.data;
2382
- const o = n.index, i = s.search(/\s/);
2383
- let a = s, l = !0;
2384
- i !== -1 && (a = s.substring(0, i), s = s.substring(i + 1).trimStart());
2385
- const c = a;
2386
- if (e) {
2387
- const u = a.indexOf(":");
2388
- u !== -1 && (a = a.substr(u + 1), l = a !== n.data.substr(u + 1));
2389
- }
2390
- return { tagName: a, tagExp: s, closeIndex: o, attrExpPresent: l, rawTagName: c };
2391
- }
2392
- function ts(r, t, e) {
2393
- const n = e;
2394
- let s = 1;
2395
- for (; e < r.length; e++) if (r[e] === "<") if (r[e + 1] === "/") {
2396
- const o = ut(r, ">", e, `${t} is not closed`);
2397
- if (r.substring(e + 2, o).trim() === t && (s--, s === 0)) return { tagContent: r.substring(n, e), i: o };
2398
- e = o;
2399
- } else if (r[e + 1] === "?") e = ut(r, "?>", e + 1, "StopNode is not closed.");
2400
- else if (r.substr(e + 1, 3) === "!--") e = ut(r, "-->", e + 3, "StopNode is not closed.");
2401
- else if (r.substr(e + 1, 2) === "![") e = ut(r, "]]>", e, "StopNode is not closed.") - 2;
2402
- else {
2403
- const o = Qt(r, e, ">");
2404
- o && ((o && o.tagName) === t && o.tagExp[o.tagExp.length - 1] !== "/" && s++, e = o.closeIndex);
2405
- }
2406
- }
2407
- function ir(r, t, e) {
2408
- if (t && typeof r == "string") {
2409
- const n = r.trim();
2410
- return n === "true" || n !== "false" && (function(s) {
2411
- let o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2412
- if (o = Object.assign({}, Vn, o), !s || typeof s != "string") return s;
2413
- let i = s.trim();
2414
- if (o.skipLike !== void 0 && o.skipLike.test(i)) return s;
2415
- if (s === "0") return 0;
2416
- if (o.hex && Mn.test(i)) return (function(l) {
2417
- if (parseInt) return parseInt(l, 16);
2418
- if (Number.parseInt) return Number.parseInt(l, 16);
2419
- if (window && window.parseInt) return window.parseInt(l, 16);
2420
- throw new Error("parseInt, Number.parseInt, window.parseInt are not supported");
2421
- })(i);
2422
- if (i.includes("e") || i.includes("E")) return (function(l, c, u) {
2423
- if (!u.eNotation) return l;
2424
- const f = c.match(Bn);
2425
- if (f) {
2426
- let h = f[1] || "";
2427
- const d = f[3].indexOf("e") === -1 ? "E" : "e", g = f[2], p = h ? l[g.length + 1] === d : l[g.length] === d;
2428
- return g.length > 1 && p ? l : g.length !== 1 || !f[3].startsWith(`.${d}`) && f[3][0] !== d ? u.leadingZeros && !p ? (c = (f[1] || "") + f[3], Number(c)) : l : Number(c);
2429
- }
2430
- return l;
2431
- })(s, i, o);
2432
- {
2433
- const l = _n.exec(i);
2434
- if (l) {
2435
- const c = l[1] || "", u = l[2];
2436
- let f = ((a = l[3]) && a.indexOf(".") !== -1 && ((a = a.replace(/0+$/, "")) === "." ? a = "0" : a[0] === "." ? a = "0" + a : a[a.length - 1] === "." && (a = a.substring(0, a.length - 1))), a);
2437
- const h = c ? s[u.length + 1] === "." : s[u.length] === ".";
2438
- if (!o.leadingZeros && (u.length > 1 || u.length === 1 && !h)) return s;
2439
- {
2440
- const d = Number(i), g = String(d);
2441
- if (d === 0) return d;
2442
- if (g.search(/[eE]/) !== -1) return o.eNotation ? d : s;
2443
- if (i.indexOf(".") !== -1) return g === "0" || g === f || g === `${c}${f}` ? d : s;
2444
- let p = u ? f : i;
2445
- return u ? p === g || c + p === g ? d : s : p === g || p === c + g ? d : s;
2446
- }
2447
- }
2448
- return s;
2449
- }
2450
- var a;
2451
- })(r, e);
2452
- }
2453
- return r !== void 0 ? r : "";
2454
- }
2455
- function Ie(r, t, e) {
2456
- const n = Number.parseInt(r, t);
2457
- return n >= 0 && n <= 1114111 ? String.fromCodePoint(n) : e + r + ";";
2458
- }
2459
- const Wt = at.getMetaDataSymbol();
2460
- function es(r, t) {
2461
- return ar(r, t);
2462
- }
2463
- function ar(r, t, e) {
2464
- let n;
2465
- const s = {};
2466
- for (let o = 0; o < r.length; o++) {
2467
- const i = r[o], a = rs(i);
2468
- let l = "";
2469
- if (l = e === void 0 ? a : e + "." + a, a === t.textNodeName) n === void 0 ? n = i[a] : n += "" + i[a];
2470
- else {
2471
- if (a === void 0) continue;
2472
- if (i[a]) {
2473
- let c = ar(i[a], t, l);
2474
- const u = ss(c, t);
2475
- i[Wt] !== void 0 && (c[Wt] = i[Wt]), i[":@"] ? ns(c, i[":@"], l, t) : Object.keys(c).length !== 1 || c[t.textNodeName] === void 0 || t.alwaysCreateTextNode ? Object.keys(c).length === 0 && (t.alwaysCreateTextNode ? c[t.textNodeName] = "" : c = "") : c = c[t.textNodeName], s[a] !== void 0 && s.hasOwnProperty(a) ? (Array.isArray(s[a]) || (s[a] = [s[a]]), s[a].push(c)) : t.isArray(a, l, u) ? s[a] = [c] : s[a] = c;
2476
- }
2477
- }
2478
- }
2479
- return typeof n == "string" ? n.length > 0 && (s[t.textNodeName] = n) : n !== void 0 && (s[t.textNodeName] = n), s;
2480
- }
2481
- function rs(r) {
2482
- const t = Object.keys(r);
2483
- for (let e = 0; e < t.length; e++) {
2484
- const n = t[e];
2485
- if (n !== ":@") return n;
2486
- }
2487
- }
2488
- function ns(r, t, e, n) {
2489
- if (t) {
2490
- const s = Object.keys(t), o = s.length;
2491
- for (let i = 0; i < o; i++) {
2492
- const a = s[i];
2493
- n.isArray(a, e + "." + a, !0, !0) ? r[a] = [t[a]] : r[a] = t[a];
2494
- }
2495
- }
2496
- }
2497
- function ss(r, t) {
2498
- const { textNodeName: e } = t, n = Object.keys(r).length;
2499
- return n === 0 || !(n !== 1 || !r[e] && typeof r[e] != "boolean" && r[e] !== 0);
2500
- }
2501
- const os = { allowBooleanAttributes: !1, unpairedTags: [] };
2502
- function $e(r) {
2503
- return r === " " || r === " " || r === `
2504
- ` || r === "\r";
2505
- }
2506
- function Fe(r, t) {
2507
- const e = t;
2508
- for (; t < r.length; t++) if (!(r[t] != "?" && r[t] != " ")) {
2509
- const n = r.substr(e, t - e);
2510
- if (t > 5 && n === "xml") return $("InvalidXml", "XML declaration allowed only at the start of the document.", k(r, t));
2511
- if (r[t] == "?" && r[t + 1] == ">") {
2512
- t++;
2513
- break;
2514
- }
2515
- }
2516
- return t;
2517
- }
2518
- function je(r, t) {
2519
- if (r.length > t + 5 && r[t + 1] === "-" && r[t + 2] === "-") {
2520
- for (t += 3; t < r.length; t++) if (r[t] === "-" && r[t + 1] === "-" && r[t + 2] === ">") {
2521
- t += 2;
2522
- break;
2523
- }
2524
- } else if (r.length > t + 8 && r[t + 1] === "D" && r[t + 2] === "O" && r[t + 3] === "C" && r[t + 4] === "T" && r[t + 5] === "Y" && r[t + 6] === "P" && r[t + 7] === "E") {
2525
- let e = 1;
2526
- for (t += 8; t < r.length; t++) if (r[t] === "<") e++;
2527
- else if (r[t] === ">" && (e--, e === 0)) break;
2528
- } else if (r.length > t + 9 && r[t + 1] === "[" && r[t + 2] === "C" && r[t + 3] === "D" && r[t + 4] === "A" && r[t + 5] === "T" && r[t + 6] === "A" && r[t + 7] === "[") {
2529
- for (t += 8; t < r.length; t++) if (r[t] === "]" && r[t + 1] === "]" && r[t + 2] === ">") {
2530
- t += 2;
2531
- break;
2532
- }
2533
- }
2534
- return t;
2535
- }
2536
- function is(r, t) {
2537
- let e = "", n = "", s = !1;
2538
- for (; t < r.length; t++) {
2539
- if (r[t] === '"' || r[t] === "'") n === "" ? n = r[t] : n !== r[t] || (n = "");
2540
- else if (r[t] === ">" && n === "") {
2541
- s = !0;
2542
- break;
2543
- }
2544
- e += r[t];
2545
- }
2546
- return n === "" && { value: e, index: t, tagClosed: s };
2547
- }
2548
- const as = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
2549
- function Re(r, t) {
2550
- const e = sr(r, as), n = {};
2551
- for (let s = 0; s < e.length; s++) {
2552
- if (e[s][1].length === 0) return $("InvalidAttr", "Attribute '" + e[s][2] + "' has no space in starting.", xt(e[s]));
2553
- if (e[s][3] !== void 0 && e[s][4] === void 0) return $("InvalidAttr", "Attribute '" + e[s][2] + "' is without value.", xt(e[s]));
2554
- if (e[s][3] === void 0 && !t.allowBooleanAttributes) return $("InvalidAttr", "boolean attribute '" + e[s][2] + "' is not allowed.", xt(e[s]));
2555
- const o = e[s][2];
2556
- if (!ls(o)) return $("InvalidAttr", "Attribute '" + o + "' is an invalid name.", xt(e[s]));
2557
- if (n.hasOwnProperty(o)) return $("InvalidAttr", "Attribute '" + o + "' is repeated.", xt(e[s]));
2558
- n[o] = 1;
2559
- }
2560
- return !0;
2561
- }
2562
- function us(r, t) {
2563
- if (r[++t] === ";") return -1;
2564
- if (r[t] === "#") return (function(n, s) {
2565
- let o = /\d/;
2566
- for (n[s] === "x" && (s++, o = /[\da-fA-F]/); s < n.length; s++) {
2567
- if (n[s] === ";") return s;
2568
- if (!n[s].match(o)) break;
2569
- }
2570
- return -1;
2571
- })(r, ++t);
2572
- let e = 0;
2573
- for (; t < r.length; t++, e++) if (!(r[t].match(/\w/) && e < 20)) {
2574
- if (r[t] === ";") break;
2575
- return -1;
2576
- }
2577
- return t;
2578
- }
2579
- function $(r, t, e) {
2580
- return { err: { code: r, msg: t, line: e.line || e, col: e.col } };
2581
- }
2582
- function ls(r) {
2583
- return Dt(r);
2584
- }
2585
- function k(r, t) {
2586
- const e = r.substring(0, t).split(/\r?\n/);
2587
- return { line: e.length, col: e[e.length - 1].length + 1 };
2588
- }
2589
- function xt(r) {
2590
- return r.startIndex + r[1].length;
2591
- }
2592
- class ur {
2593
- constructor(t) {
2594
- this.externalEntities = {}, this.options = (function(e) {
2595
- return Object.assign({}, Un, e);
2596
- })(t);
2597
- }
2598
- parse(t, e) {
2599
- if (typeof t != "string" && t.toString) t = t.toString();
2600
- else if (typeof t != "string") throw new Error("XML data is accepted in String or Bytes[] form.");
2601
- if (e) {
2602
- e === !0 && (e = {});
2603
- const o = (function(i, a) {
2604
- a = Object.assign({}, os, a);
2605
- const l = [];
2606
- let c = !1, u = !1;
2607
- i[0] === "\uFEFF" && (i = i.substr(1));
2608
- for (let f = 0; f < i.length; f++) if (i[f] === "<" && i[f + 1] === "?") {
2609
- if (f += 2, f = Fe(i, f), f.err) return f;
2610
- } else {
2611
- if (i[f] !== "<") {
2612
- if ($e(i[f])) continue;
2613
- return $("InvalidChar", "char '" + i[f] + "' is not expected.", k(i, f));
2614
- }
2615
- {
2616
- let h = f;
2617
- if (f++, i[f] === "!") {
2618
- f = je(i, f);
2619
- continue;
2620
- }
2621
- {
2622
- let d = !1;
2623
- i[f] === "/" && (d = !0, f++);
2624
- let g = "";
2625
- for (; f < i.length && i[f] !== ">" && i[f] !== " " && i[f] !== " " && i[f] !== `
2626
- ` && i[f] !== "\r"; f++) g += i[f];
2627
- if (g = g.trim(), g[g.length - 1] === "/" && (g = g.substring(0, g.length - 1), f--), !Dt(g)) {
2628
- let b;
2629
- return b = g.trim().length === 0 ? "Invalid space after '<'." : "Tag '" + g + "' is an invalid name.", $("InvalidTag", b, k(i, f));
2630
- }
2631
- const p = is(i, f);
2632
- if (p === !1) return $("InvalidAttr", "Attributes for '" + g + "' have open quote.", k(i, f));
2633
- let m = p.value;
2634
- if (f = p.index, m[m.length - 1] === "/") {
2635
- const b = f - m.length;
2636
- m = m.substring(0, m.length - 1);
2637
- const y = Re(m, a);
2638
- if (y !== !0) return $(y.err.code, y.err.msg, k(i, b + y.err.line));
2639
- c = !0;
2640
- } else if (d) {
2641
- if (!p.tagClosed) return $("InvalidTag", "Closing tag '" + g + "' doesn't have proper closing.", k(i, f));
2642
- if (m.trim().length > 0) return $("InvalidTag", "Closing tag '" + g + "' can't have attributes or invalid starting.", k(i, h));
2643
- if (l.length === 0) return $("InvalidTag", "Closing tag '" + g + "' has not been opened.", k(i, h));
2644
- {
2645
- const b = l.pop();
2646
- if (g !== b.tagName) {
2647
- let y = k(i, b.tagStartPos);
2648
- return $("InvalidTag", "Expected closing tag '" + b.tagName + "' (opened in line " + y.line + ", col " + y.col + ") instead of closing tag '" + g + "'.", k(i, h));
2649
- }
2650
- l.length == 0 && (u = !0);
2651
- }
2652
- } else {
2653
- const b = Re(m, a);
2654
- if (b !== !0) return $(b.err.code, b.err.msg, k(i, f - m.length + b.err.line));
2655
- if (u === !0) return $("InvalidXml", "Multiple possible root nodes found.", k(i, f));
2656
- a.unpairedTags.indexOf(g) !== -1 || l.push({ tagName: g, tagStartPos: h }), c = !0;
2657
- }
2658
- for (f++; f < i.length; f++) if (i[f] === "<") {
2659
- if (i[f + 1] === "!") {
2660
- f++, f = je(i, f);
2661
- continue;
2662
- }
2663
- if (i[f + 1] !== "?") break;
2664
- if (f = Fe(i, ++f), f.err) return f;
2665
- } else if (i[f] === "&") {
2666
- const b = us(i, f);
2667
- if (b == -1) return $("InvalidChar", "char '&' is not expected.", k(i, f));
2668
- f = b;
2669
- } else if (u === !0 && !$e(i[f])) return $("InvalidXml", "Extra text at the end", k(i, f));
2670
- i[f] === "<" && f--;
2671
- }
2672
- }
2673
- }
2674
- return c ? l.length == 1 ? $("InvalidTag", "Unclosed tag '" + l[0].tagName + "'.", k(i, l[0].tagStartPos)) : !(l.length > 0) || $("InvalidXml", "Invalid '" + JSON.stringify(l.map(((f) => f.tagName)), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 }) : $("InvalidXml", "Start tag expected.", 1);
2675
- })(t, e);
2676
- if (o !== !0) throw Error(`${o.err.msg}:${o.err.line}:${o.err.col}`);
2677
- }
2678
- const n = new Wn(this.options);
2679
- n.addExternalEntities(this.externalEntities);
2680
- const s = n.parseXml(t);
2681
- return this.options.preserveOrder || s === void 0 ? s : es(s, this.options);
2682
- }
2683
- addEntity(t, e) {
2684
- if (e.indexOf("&") !== -1) throw new Error("Entity value can't have '&'");
2685
- if (t.indexOf("&") !== -1 || t.indexOf(";") !== -1) throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");
2686
- if (e === "&") throw new Error("An entity with value '&' is not permitted");
2687
- this.externalEntities[t] = e;
2688
- }
2689
- static getMetaDataSymbol() {
2690
- return at.getMetaDataSymbol();
2691
- }
2692
- }
2693
- var cs = O(829), Y = O.n(cs), ct = (function(r) {
2694
- return r.Array = "array", r.Object = "object", r.Original = "original", r;
2695
- })(ct || {});
2696
- function lr(r, t) {
2697
- if (!r.endsWith("propstat.prop.displayname")) return t;
2698
- }
2699
- function It(r, t) {
2700
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ct.Original;
2701
- const n = Y().get(r, t);
2702
- return e === "array" && Array.isArray(n) === !1 ? [n] : e === "object" && Array.isArray(n) ? n[0] : n;
2703
- }
2704
- function Tt(r, t) {
2705
- return t = t ?? { attributeNamePrefix: "@", attributeParsers: [], tagParsers: [lr] }, new Promise(((e) => {
2706
- e((function(n) {
2707
- const { multistatus: s } = n;
2708
- if (s === "") return { multistatus: { response: [] } };
2709
- if (!s) throw new Error("Invalid response: No root multistatus found");
2710
- const o = { multistatus: Array.isArray(s) ? s[0] : s };
2711
- return Y().set(o, "multistatus.response", It(o, "multistatus.response", ct.Array)), Y().set(o, "multistatus.response", Y().get(o, "multistatus.response").map(((i) => (function(a) {
2712
- const l = Object.assign({}, a);
2713
- return l.status ? Y().set(l, "status", It(l, "status", ct.Object)) : (Y().set(l, "propstat", It(l, "propstat", ct.Object)), Y().set(l, "propstat.prop", It(l, "propstat.prop", ct.Object))), l;
2714
- })(i)))), o;
2715
- })((function(n) {
2716
- let { attributeNamePrefix: s, attributeParsers: o, tagParsers: i } = n;
2717
- return new ur({ allowBooleanAttributes: !0, attributeNamePrefix: s, textNodeName: "text", ignoreAttributes: !1, removeNSPrefix: !0, numberParseOptions: { hex: !0, leadingZeros: !1 }, attributeValueProcessor(a, l, c) {
2718
- for (const u of o) try {
2719
- const f = u(c, l);
2720
- if (f !== l) return f;
2721
- } catch {
2722
- }
2723
- return l;
2724
- }, tagValueProcessor(a, l, c) {
2725
- for (const u of i) try {
2726
- const f = u(c, l);
2727
- if (f !== l) return f;
2728
- } catch {
2729
- }
2730
- return l;
2731
- } });
2732
- })(t).parse(r)));
2733
- }));
2734
- }
2735
- function kt(r, t) {
2736
- let e = arguments.length > 2 && arguments[2] !== void 0 && arguments[2];
2737
- const { getlastmodified: n = null, getcontentlength: s = "0", resourcetype: o = null, getcontenttype: i = null, getetag: a = null } = r, l = o && typeof o == "object" && o.collection !== void 0 ? "directory" : "file", c = { filename: t, basename: $t().basename(t), lastmod: n, size: parseInt(s, 10), type: l, etag: typeof a == "string" ? a.replace(/"/g, "") : null };
2738
- return l === "file" && (c.mime = i && typeof i == "string" ? i.split(";")[0] : ""), e && (r.displayname !== void 0 && (r.displayname = String(r.displayname)), c.props = r), c;
2739
- }
2740
- function hs(r, t) {
2741
- let e = arguments.length > 2 && arguments[2] !== void 0 && arguments[2], n = null;
2742
- try {
2743
- r.multistatus.response[0].propstat && (n = r.multistatus.response[0]);
2744
- } catch {
2745
- }
2746
- if (!n) throw new Error("Failed getting item stat: bad response");
2747
- const { propstat: { prop: s, status: o } } = n, [i, a, l] = o.split(" ", 3), c = parseInt(a, 10);
2748
- if (c >= 400) {
2749
- const u = new Error(`Invalid response: ${c} ${l}`);
2750
- throw u.status = c, u;
2751
- }
2752
- return kt(s, At(t), e);
2753
- }
2754
- function fs(r) {
2755
- switch (String(r)) {
2756
- case "-3":
2757
- return "unlimited";
2758
- case "-2":
2759
- case "-1":
2760
- return "unknown";
2761
- default:
2762
- return parseInt(String(r), 10);
2763
- }
2764
- }
2765
- function qt(r, t, e) {
2766
- return e ? t ? t(r) : r : (r && r.then || (r = Promise.resolve(r)), t ? r.then(t) : r);
2767
- }
2768
- const ae = /* @__PURE__ */ (function(r) {
2769
- return function() {
2770
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
2771
- try {
2772
- return Promise.resolve(r.apply(this, t));
2773
- } catch (n) {
2774
- return Promise.reject(n);
2775
- }
2776
- };
2777
- })((function(r, t) {
2778
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2779
- const { details: n = !1 } = e, s = R({ url: C(r.remoteURL, S(t)), method: "PROPFIND", headers: { Accept: "text/plain,application/xml", Depth: "0" } }, r, e);
2780
- return qt(j(s, r), (function(o) {
2781
- return L(r, o), qt(o.text(), (function(i) {
2782
- return qt(Tt(i, r.parsing), (function(a) {
2783
- const l = hs(a, t, n);
2784
- return pt(o, l, n);
2785
- }));
2786
- }));
2787
- }));
2788
- }));
2789
- function cr(r, t, e) {
2790
- return e ? t ? t(r) : r : (r && r.then || (r = Promise.resolve(r)), t ? r.then(t) : r);
2791
- }
2792
- const ps = hr((function(r, t) {
2793
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2794
- const n = (function(o) {
2795
- if (!o || o === "/") return [];
2796
- let i = o;
2797
- const a = [];
2798
- do
2799
- a.push(i), i = $t().dirname(i);
2800
- while (i && i !== "/");
2801
- return a;
2802
- })(At(t));
2803
- n.sort(((o, i) => o.length > i.length ? 1 : i.length > o.length ? -1 : 0));
2804
- let s = !1;
2805
- return (function(o, i, a) {
2806
- if (typeof o[Ue] == "function") {
2807
- let p = function(m) {
2808
- try {
2809
- for (; !(l = f.next()).done; ) if ((m = i(l.value)) && m.then) {
2810
- if (!De(m)) return void m.then(p, u || (u = _.bind(null, c = new ht(), 2)));
2811
- m = m.v;
2812
- }
2813
- c ? _(c, 1, m) : c = m;
2814
- } catch (b) {
2815
- _(c || (c = new ht()), 2, b);
2816
- }
2817
- };
2818
- var l, c, u, f = o[Ue]();
2819
- if (p(), f.return) {
2820
- var h = function(m) {
2821
- try {
2822
- l.done || f.return();
2823
- } catch {
2824
- }
2825
- return m;
2826
- };
2827
- if (c && c.then) return c.then(h, (function(m) {
2828
- throw h(m);
2829
- }));
2830
- h();
2831
- }
2832
- return c;
2833
- }
2834
- if (!("length" in o)) throw new TypeError("Object is not iterable");
2835
- for (var d = [], g = 0; g < o.length; g++) d.push(o[g]);
2836
- return (function(p, m, b) {
2837
- var y, v, w = -1;
2838
- return (function x(P) {
2839
- try {
2840
- for (; ++w < p.length && (!b || !b()); ) if ((P = m(w)) && P.then) {
2841
- if (!De(P)) return void P.then(x, v || (v = _.bind(null, y = new ht(), 2)));
2842
- P = P.v;
2843
- }
2844
- y ? _(y, 1, P) : y = P;
2845
- } catch (E) {
2846
- _(y || (y = new ht()), 2, E);
2847
- }
2848
- })(), y;
2849
- })(d, (function(p) {
2850
- return i(d[p]);
2851
- }), a);
2852
- })(n, (function(o) {
2853
- return i = function() {
2854
- return (function(l, c) {
2855
- try {
2856
- var u = cr(ae(r, o), (function(f) {
2857
- if (f.type !== "directory") throw new Error(`Path includes a file: ${t}`);
2858
- }));
2859
- } catch (f) {
2860
- return c(f);
2861
- }
2862
- return u && u.then ? u.then(void 0, c) : u;
2863
- })(0, (function(l) {
2864
- const c = l;
2865
- return (function() {
2866
- if (c.status === 404) return s = !0, Le(te(r, o, { ...e, recursive: !1 }));
2867
- throw l;
2868
- })();
2869
- }));
2870
- }, (a = (function() {
2871
- if (s) return Le(te(r, o, { ...e, recursive: !1 }));
2872
- })()) && a.then ? a.then(i) : i();
2873
- var i, a;
2874
- }), (function() {
2875
- return !1;
2876
- }));
2877
- }));
2878
- function hr(r) {
2879
- return function() {
2880
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
2881
- try {
2882
- return Promise.resolve(r.apply(this, t));
2883
- } catch (n) {
2884
- return Promise.reject(n);
2885
- }
2886
- };
2887
- }
2888
- function gs() {
2889
- }
2890
- function Le(r, t) {
2891
- return r && r.then ? r.then(gs) : Promise.resolve();
2892
- }
2893
- const Ue = typeof Symbol < "u" ? Symbol.iterator || (Symbol.iterator = /* @__PURE__ */ Symbol("Symbol.iterator")) : "@@iterator";
2894
- function _(r, t, e) {
2895
- if (!r.s) {
2896
- if (e instanceof ht) {
2897
- if (!e.s) return void (e.o = _.bind(null, r, t));
2898
- 1 & t && (t = e.s), e = e.v;
2899
- }
2900
- if (e && e.then) return void e.then(_.bind(null, r, t), _.bind(null, r, 2));
2901
- r.s = t, r.v = e;
2902
- const n = r.o;
2903
- n && n(r);
2904
- }
2905
- }
2906
- const ht = (function() {
2907
- function r() {
2908
- }
2909
- return r.prototype.then = function(t, e) {
2910
- const n = new r(), s = this.s;
2911
- if (s) {
2912
- const o = 1 & s ? t : e;
2913
- if (o) {
2914
- try {
2915
- _(n, 1, o(this.v));
2916
- } catch (i) {
2917
- _(n, 2, i);
2918
- }
2919
- return n;
2920
- }
2921
- return this;
2922
- }
2923
- return this.o = function(o) {
2924
- try {
2925
- const i = o.v;
2926
- 1 & o.s ? _(n, 1, t ? t(i) : i) : e ? _(n, 1, e(i)) : _(n, 2, i);
2927
- } catch (i) {
2928
- _(n, 2, i);
2929
- }
2930
- }, n;
2931
- }, r;
2932
- })();
2933
- function De(r) {
2934
- return r instanceof ht && 1 & r.s;
2935
- }
2936
- const te = hr((function(r, t) {
2937
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2938
- if (e.recursive === !0) return ps(r, t, e);
2939
- const n = R({ url: C(r.remoteURL, (s = S(t), s.endsWith("/") ? s : s + "/")), method: "MKCOL" }, r, e);
2940
- var s;
2941
- return cr(j(n, r), (function(o) {
2942
- L(r, o);
2943
- }));
2944
- }));
2945
- var ds = O(388), ke = O.n(ds);
2946
- const ms = /* @__PURE__ */ (function(r) {
2947
- return function() {
2948
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
2949
- try {
2950
- return Promise.resolve(r.apply(this, t));
2951
- } catch (n) {
2952
- return Promise.reject(n);
2953
- }
2954
- };
2955
- })((function(r, t) {
2956
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
2957
- const n = {};
2958
- if (typeof e.range == "object" && typeof e.range.start == "number") {
2959
- let a = `bytes=${e.range.start}-`;
2960
- typeof e.range.end == "number" && (a = `${a}${e.range.end}`), n.Range = a;
2961
- }
2962
- const s = R({ url: C(r.remoteURL, S(t)), method: "GET", headers: n }, r, e);
2963
- return i = function(a) {
2964
- if (L(r, a), n.Range && a.status !== 206) {
2965
- const l = new Error(`Invalid response code for partial request: ${a.status}`);
2966
- throw l.status = a.status, l;
2967
- }
2968
- return e.callback && setTimeout((() => {
2969
- e.callback(a);
2970
- }), 0), a.body;
2971
- }, (o = j(s, r)) && o.then || (o = Promise.resolve(o)), i ? o.then(i) : o;
2972
- var o, i;
2973
- })), ys = () => {
2974
- }, bs = /* @__PURE__ */ (function(r) {
2975
- return function() {
2976
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
2977
- try {
2978
- return Promise.resolve(r.apply(this, t));
2979
- } catch (n) {
2980
- return Promise.reject(n);
2981
- }
2982
- };
2983
- })((function(r, t, e) {
2984
- e.url || (e.url = C(r.remoteURL, S(t)));
2985
- const n = R(e, r, {});
2986
- return o = function(i) {
2987
- return L(r, i), i;
2988
- }, (s = j(n, r)) && s.then || (s = Promise.resolve(s)), o ? s.then(o) : s;
2989
- var s, o;
2990
- })), vs = /* @__PURE__ */ (function(r) {
2991
- return function() {
2992
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
2993
- try {
2994
- return Promise.resolve(r.apply(this, t));
2995
- } catch (n) {
2996
- return Promise.reject(n);
2997
- }
2998
- };
2999
- })((function(r, t) {
3000
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3001
- const n = R({ url: C(r.remoteURL, S(t)), method: "DELETE" }, r, e);
3002
- return o = function(i) {
3003
- L(r, i);
3004
- }, (s = j(n, r)) && s.then || (s = Promise.resolve(s)), o ? s.then(o) : s;
3005
- var s, o;
3006
- })), ws = /* @__PURE__ */ (function(r) {
3007
- return function() {
3008
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3009
- try {
3010
- return Promise.resolve(r.apply(this, t));
3011
- } catch (n) {
3012
- return Promise.reject(n);
3013
- }
3014
- };
3015
- })((function(r, t) {
3016
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3017
- return (function(n, s) {
3018
- try {
3019
- var o = (i = ae(r, t, e), a = function() {
3020
- return !0;
3021
- }, l ? a ? a(i) : i : (i && i.then || (i = Promise.resolve(i)), a ? i.then(a) : i));
3022
- } catch (c) {
3023
- return s(c);
3024
- }
3025
- var i, a, l;
3026
- return o && o.then ? o.then(void 0, s) : o;
3027
- })(0, (function(n) {
3028
- if (n.status === 404) return !1;
3029
- throw n;
3030
- }));
3031
- }));
3032
- function Gt(r, t, e) {
3033
- return e ? t ? t(r) : r : (r && r.then || (r = Promise.resolve(r)), t ? r.then(t) : r);
3034
- }
3035
- const xs = /* @__PURE__ */ (function(r) {
3036
- return function() {
3037
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3038
- try {
3039
- return Promise.resolve(r.apply(this, t));
3040
- } catch (n) {
3041
- return Promise.reject(n);
3042
- }
3043
- };
3044
- })((function(r, t) {
3045
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3046
- const n = R({ url: C(r.remoteURL, S(t), "/"), method: "PROPFIND", headers: { Accept: "text/plain,application/xml", Depth: e.deep ? "infinity" : "1" } }, r, e);
3047
- return Gt(j(n, r), (function(s) {
3048
- return L(r, s), Gt(s.text(), (function(o) {
3049
- if (!o) throw new Error("Failed parsing directory contents: Empty response");
3050
- return Gt(Tt(o, r.parsing), (function(i) {
3051
- const a = me(t);
3052
- let l = (function(c, u, f) {
3053
- let h = arguments.length > 3 && arguments[3] !== void 0 && arguments[3], d = arguments.length > 4 && arguments[4] !== void 0 && arguments[4];
3054
- const g = $t().join(u, "/"), { multistatus: { response: p } } = c, m = p.map(((b) => {
3055
- const y = (function(w) {
3056
- try {
3057
- return w.replace(/^https?:\/\/[^\/]+/, "");
3058
- } catch (x) {
3059
- throw new V(x, "Failed normalising HREF");
3060
- }
3061
- })(b.href), { propstat: { prop: v } } = b;
3062
- return kt(v, g === "/" ? decodeURIComponent(At(y)) : At($t().relative(decodeURIComponent(g), decodeURIComponent(y))), h);
3063
- }));
3064
- return d ? m : m.filter(((b) => b.basename && (b.type === "file" || b.filename !== f.replace(/\/$/, ""))));
3065
- })(i, me(r.remoteBasePath || r.remotePath), a, e.details, e.includeSelf);
3066
- return e.glob && (l = (function(c, u) {
3067
- return c.filter(((f) => D(f.filename, u, { matchBase: !0 })));
3068
- })(l, e.glob)), pt(s, l, e.details);
3069
- }));
3070
- }));
3071
- }));
3072
- }));
3073
- function ue(r) {
3074
- return function() {
3075
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3076
- try {
3077
- return Promise.resolve(r.apply(this, t));
3078
- } catch (n) {
3079
- return Promise.reject(n);
3080
- }
3081
- };
3082
- }
3083
- const Ns = ue((function(r, t) {
3084
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3085
- const n = R({ url: C(r.remoteURL, S(t)), method: "GET", headers: { Accept: "text/plain" }, transformResponse: [As] }, r, e);
3086
- return Ut(j(n, r), (function(s) {
3087
- return L(r, s), Ut(s.text(), (function(o) {
3088
- return pt(s, o, e.details);
3089
- }));
3090
- }));
3091
- }));
3092
- function Ut(r, t, e) {
3093
- return e ? t ? t(r) : r : (r && r.then || (r = Promise.resolve(r)), t ? r.then(t) : r);
3094
- }
3095
- const Ps = ue((function(r, t) {
3096
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3097
- const n = R({ url: C(r.remoteURL, S(t)), method: "GET" }, r, e);
3098
- return Ut(j(n, r), (function(s) {
3099
- let o;
3100
- return L(r, s), (function(i, a) {
3101
- var l = i();
3102
- return l && l.then ? l.then(a) : a();
3103
- })((function() {
3104
- return Ut(s.arrayBuffer(), (function(i) {
3105
- o = i;
3106
- }));
3107
- }), (function() {
3108
- return pt(s, o, e.details);
3109
- }));
3110
- }));
3111
- })), Es = ue((function(r, t) {
3112
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3113
- const { format: n = "binary" } = e;
3114
- if (n !== "binary" && n !== "text") throw new V({ info: { code: et.InvalidOutputFormat } }, `Invalid output format: ${n}`);
3115
- return n === "text" ? Ns(r, t, e) : Ps(r, t, e);
3116
- })), As = (r) => r;
3117
- function Ts(r, t) {
3118
- let e = "";
3119
- return t.format && t.indentBy.length > 0 && (e = `
3120
- `), fr(r, t, "", e);
3121
- }
3122
- function fr(r, t, e, n) {
3123
- let s = "", o = !1;
3124
- for (let i = 0; i < r.length; i++) {
3125
- const a = r[i], l = Os(a);
3126
- if (l === void 0) continue;
3127
- let c = "";
3128
- if (c = e.length === 0 ? l : `${e}.${l}`, l === t.textNodeName) {
3129
- let d = a[l];
3130
- Ss(c, t) || (d = t.tagValueProcessor(l, d), d = pr(d, t)), o && (s += n), s += d, o = !1;
3131
- continue;
3132
- }
3133
- if (l === t.cdataPropName) {
3134
- o && (s += n), s += `<![CDATA[${a[l][0][t.textNodeName]}]]>`, o = !1;
3135
- continue;
3136
- }
3137
- if (l === t.commentPropName) {
3138
- s += n + `<!--${a[l][0][t.textNodeName]}-->`, o = !0;
3139
- continue;
3140
- }
3141
- if (l[0] === "?") {
3142
- const d = Me(a[":@"], t), g = l === "?xml" ? "" : n;
3143
- let p = a[l][0][t.textNodeName];
3144
- p = p.length !== 0 ? " " + p : "", s += g + `<${l}${p}${d}?>`, o = !0;
3145
- continue;
3146
- }
3147
- let u = n;
3148
- u !== "" && (u += t.indentBy);
3149
- const f = n + `<${l}${Me(a[":@"], t)}`, h = fr(a[l], t, c, u);
3150
- t.unpairedTags.indexOf(l) !== -1 ? t.suppressUnpairedNode ? s += f + ">" : s += f + "/>" : h && h.length !== 0 || !t.suppressEmptyNode ? h && h.endsWith(">") ? s += f + `>${h}${n}</${l}>` : (s += f + ">", h && n !== "" && (h.includes("/>") || h.includes("</")) ? s += n + t.indentBy + h + n : s += h, s += `</${l}>`) : s += f + "/>", o = !0;
3151
- }
3152
- return s;
3153
- }
3154
- function Os(r) {
3155
- const t = Object.keys(r);
3156
- for (let e = 0; e < t.length; e++) {
3157
- const n = t[e];
3158
- if (r.hasOwnProperty(n) && n !== ":@") return n;
3159
- }
3160
- }
3161
- function Me(r, t) {
3162
- let e = "";
3163
- if (r && !t.ignoreAttributes) for (let n in r) {
3164
- if (!r.hasOwnProperty(n)) continue;
3165
- let s = t.attributeValueProcessor(n, r[n]);
3166
- s = pr(s, t), s === !0 && t.suppressBooleanAttributes ? e += ` ${n.substr(t.attributeNamePrefix.length)}` : e += ` ${n.substr(t.attributeNamePrefix.length)}="${s}"`;
3167
- }
3168
- return e;
3169
- }
3170
- function Ss(r, t) {
3171
- let e = (r = r.substr(0, r.length - t.textNodeName.length - 1)).substr(r.lastIndexOf(".") + 1);
3172
- for (let n in t.stopNodes) if (t.stopNodes[n] === r || t.stopNodes[n] === "*." + e) return !0;
3173
- return !1;
3174
- }
3175
- function pr(r, t) {
3176
- if (r && r.length > 0 && t.processEntities) for (let e = 0; e < t.entities.length; e++) {
3177
- const n = t.entities[e];
3178
- r = r.replace(n.regex, n.val);
3179
- }
3180
- return r;
3181
- }
3182
- const Cs = { attributeNamePrefix: "@_", attributesGroupName: !1, textNodeName: "#text", ignoreAttributes: !0, cdataPropName: !1, format: !1, indentBy: " ", suppressEmptyNode: !1, suppressUnpairedNode: !0, suppressBooleanAttributes: !0, tagValueProcessor: function(r, t) {
3183
- return t;
3184
- }, attributeValueProcessor: function(r, t) {
3185
- return t;
3186
- }, preserveOrder: !1, commentPropName: !1, unpairedTags: [], entities: [{ regex: new RegExp("&", "g"), val: "&amp;" }, { regex: new RegExp(">", "g"), val: "&gt;" }, { regex: new RegExp("<", "g"), val: "&lt;" }, { regex: new RegExp("'", "g"), val: "&apos;" }, { regex: new RegExp('"', "g"), val: "&quot;" }], processEntities: !0, stopNodes: [], oneListGroup: !1 };
3187
- function tt(r) {
3188
- this.options = Object.assign({}, Cs, r), this.options.ignoreAttributes === !0 || this.options.attributesGroupName ? this.isAttribute = function() {
3189
- return !1;
3190
- } : (this.ignoreAttributesFn = or(this.options.ignoreAttributes), this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = Fs), this.processTextOrObjNode = Is, this.options.format ? (this.indentate = $s, this.tagEndChar = `>
3191
- `, this.newLine = `
3192
- `) : (this.indentate = function() {
3193
- return "";
3194
- }, this.tagEndChar = ">", this.newLine = "");
3195
- }
3196
- function Is(r, t, e, n) {
3197
- const s = this.j2x(r, e + 1, n.concat(t));
3198
- return r[this.options.textNodeName] !== void 0 && Object.keys(r).length === 1 ? this.buildTextValNode(r[this.options.textNodeName], t, s.attrStr, e) : this.buildObjectNode(s.val, t, s.attrStr, e);
3199
- }
3200
- function $s(r) {
3201
- return this.options.indentBy.repeat(r);
3202
- }
3203
- function Fs(r) {
3204
- return !(!r.startsWith(this.options.attributeNamePrefix) || r === this.options.textNodeName) && r.substr(this.attrPrefixLen);
3205
- }
3206
- function js(r) {
3207
- return new tt({ attributeNamePrefix: "@_", format: !0, ignoreAttributes: !1, suppressEmptyNode: !0 }).build(gr({ lockinfo: { "@_xmlns:d": "DAV:", lockscope: { exclusive: {} }, locktype: { write: {} }, owner: { href: r } } }, "d"));
3208
- }
3209
- function gr(r, t) {
3210
- const e = { ...r };
3211
- for (const n in e) e.hasOwnProperty(n) && (e[n] && typeof e[n] == "object" && n.indexOf(":") === -1 ? (e[`${t}:${n}`] = gr(e[n], t), delete e[n]) : /^@_/.test(n) === !1 && (e[`${t}:${n}`] = e[n], delete e[n]));
3212
- return e;
3213
- }
3214
- function ee(r, t, e) {
3215
- return e ? t ? t(r) : r : (r && r.then || (r = Promise.resolve(r)), t ? r.then(t) : r);
3216
- }
3217
- function dr(r) {
3218
- return function() {
3219
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3220
- try {
3221
- return Promise.resolve(r.apply(this, t));
3222
- } catch (n) {
3223
- return Promise.reject(n);
3224
- }
3225
- };
3226
- }
3227
- tt.prototype.build = function(r) {
3228
- return this.options.preserveOrder ? Ts(r, this.options) : (Array.isArray(r) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (r = { [this.options.arrayNodeName]: r }), this.j2x(r, 0, []).val);
3229
- }, tt.prototype.j2x = function(r, t, e) {
3230
- let n = "", s = "";
3231
- const o = e.join(".");
3232
- for (let i in r) if (Object.prototype.hasOwnProperty.call(r, i)) if (r[i] === void 0) this.isAttribute(i) && (s += "");
3233
- else if (r[i] === null) this.isAttribute(i) || i === this.options.cdataPropName ? s += "" : i[0] === "?" ? s += this.indentate(t) + "<" + i + "?" + this.tagEndChar : s += this.indentate(t) + "<" + i + "/" + this.tagEndChar;
3234
- else if (r[i] instanceof Date) s += this.buildTextValNode(r[i], i, "", t);
3235
- else if (typeof r[i] != "object") {
3236
- const a = this.isAttribute(i);
3237
- if (a && !this.ignoreAttributesFn(a, o)) n += this.buildAttrPairStr(a, "" + r[i]);
3238
- else if (!a) if (i === this.options.textNodeName) {
3239
- let l = this.options.tagValueProcessor(i, "" + r[i]);
3240
- s += this.replaceEntitiesValue(l);
3241
- } else s += this.buildTextValNode(r[i], i, "", t);
3242
- } else if (Array.isArray(r[i])) {
3243
- const a = r[i].length;
3244
- let l = "", c = "";
3245
- for (let u = 0; u < a; u++) {
3246
- const f = r[i][u];
3247
- if (f !== void 0) if (f === null) i[0] === "?" ? s += this.indentate(t) + "<" + i + "?" + this.tagEndChar : s += this.indentate(t) + "<" + i + "/" + this.tagEndChar;
3248
- else if (typeof f == "object") if (this.options.oneListGroup) {
3249
- const h = this.j2x(f, t + 1, e.concat(i));
3250
- l += h.val, this.options.attributesGroupName && f.hasOwnProperty(this.options.attributesGroupName) && (c += h.attrStr);
3251
- } else l += this.processTextOrObjNode(f, i, t, e);
3252
- else if (this.options.oneListGroup) {
3253
- let h = this.options.tagValueProcessor(i, f);
3254
- h = this.replaceEntitiesValue(h), l += h;
3255
- } else l += this.buildTextValNode(f, i, "", t);
3256
- }
3257
- this.options.oneListGroup && (l = this.buildObjectNode(l, i, c, t)), s += l;
3258
- } else if (this.options.attributesGroupName && i === this.options.attributesGroupName) {
3259
- const a = Object.keys(r[i]), l = a.length;
3260
- for (let c = 0; c < l; c++) n += this.buildAttrPairStr(a[c], "" + r[i][a[c]]);
3261
- } else s += this.processTextOrObjNode(r[i], i, t, e);
3262
- return { attrStr: n, val: s };
3263
- }, tt.prototype.buildAttrPairStr = function(r, t) {
3264
- return t = this.options.attributeValueProcessor(r, "" + t), t = this.replaceEntitiesValue(t), this.options.suppressBooleanAttributes && t === "true" ? " " + r : " " + r + '="' + t + '"';
3265
- }, tt.prototype.buildObjectNode = function(r, t, e, n) {
3266
- if (r === "") return t[0] === "?" ? this.indentate(n) + "<" + t + e + "?" + this.tagEndChar : this.indentate(n) + "<" + t + e + this.closeTag(t) + this.tagEndChar;
3267
- {
3268
- let s = "</" + t + this.tagEndChar, o = "";
3269
- return t[0] === "?" && (o = "?", s = ""), !e && e !== "" || r.indexOf("<") !== -1 ? this.options.commentPropName !== !1 && t === this.options.commentPropName && o.length === 0 ? this.indentate(n) + `<!--${r}-->` + this.newLine : this.indentate(n) + "<" + t + e + o + this.tagEndChar + r + this.indentate(n) + s : this.indentate(n) + "<" + t + e + o + ">" + r + s;
3270
- }
3271
- }, tt.prototype.closeTag = function(r) {
3272
- let t = "";
3273
- return this.options.unpairedTags.indexOf(r) !== -1 ? this.options.suppressUnpairedNode || (t = "/") : t = this.options.suppressEmptyNode ? "/" : `></${r}`, t;
3274
- }, tt.prototype.buildTextValNode = function(r, t, e, n) {
3275
- if (this.options.cdataPropName !== !1 && t === this.options.cdataPropName) return this.indentate(n) + `<![CDATA[${r}]]>` + this.newLine;
3276
- if (this.options.commentPropName !== !1 && t === this.options.commentPropName) return this.indentate(n) + `<!--${r}-->` + this.newLine;
3277
- if (t[0] === "?") return this.indentate(n) + "<" + t + e + "?" + this.tagEndChar;
3278
- {
3279
- let s = this.options.tagValueProcessor(t, r);
3280
- return s = this.replaceEntitiesValue(s), s === "" ? this.indentate(n) + "<" + t + e + this.closeTag(t) + this.tagEndChar : this.indentate(n) + "<" + t + e + ">" + s + "</" + t + this.tagEndChar;
3281
- }
3282
- }, tt.prototype.replaceEntitiesValue = function(r) {
3283
- if (r && r.length > 0 && this.options.processEntities) for (let t = 0; t < this.options.entities.length; t++) {
3284
- const e = this.options.entities[t];
3285
- r = r.replace(e.regex, e.val);
3286
- }
3287
- return r;
3288
- };
3289
- const Rs = dr((function(r, t, e) {
3290
- let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
3291
- const s = R({ url: C(r.remoteURL, S(t)), method: "UNLOCK", headers: { "Lock-Token": e } }, r, n);
3292
- return ee(j(s, r), (function(o) {
3293
- if (L(r, o), o.status !== 204 && o.status !== 200) throw ie(o);
3294
- }));
3295
- })), Ls = dr((function(r, t) {
3296
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3297
- const { refreshToken: n, timeout: s = Us } = e, o = { Accept: "text/plain,application/xml", Timeout: s };
3298
- n && (o.If = n);
3299
- const i = R({ url: C(r.remoteURL, S(t)), method: "LOCK", headers: o, data: js(r.contactHref) }, r, e);
3300
- return ee(j(i, r), (function(a) {
3301
- return L(r, a), ee(a.text(), (function(l) {
3302
- const c = (h = l, new ur({ removeNSPrefix: !0, parseAttributeValue: !0, parseTagValue: !0 }).parse(h)), u = Y().get(c, "prop.lockdiscovery.activelock.locktoken.href"), f = Y().get(c, "prop.lockdiscovery.activelock.timeout");
3303
- var h;
3304
- if (!u) throw ie(a, "No lock token received: ");
3305
- return { token: u, serverTimeout: f };
3306
- }));
3307
- }));
3308
- })), Us = "Infinite, Second-4100000000";
3309
- function zt(r, t, e) {
3310
- return e ? t ? t(r) : r : (r && r.then || (r = Promise.resolve(r)), t ? r.then(t) : r);
3311
- }
3312
- const Ds = /* @__PURE__ */ (function(r) {
3313
- return function() {
3314
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3315
- try {
3316
- return Promise.resolve(r.apply(this, t));
3317
- } catch (n) {
3318
- return Promise.reject(n);
3319
- }
3320
- };
3321
- })((function(r) {
3322
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3323
- const e = t.path || "/", n = R({ url: C(r.remoteURL, e), method: "PROPFIND", headers: { Accept: "text/plain,application/xml", Depth: "0" } }, r, t);
3324
- return zt(j(n, r), (function(s) {
3325
- return L(r, s), zt(s.text(), (function(o) {
3326
- return zt(Tt(o, r.parsing), (function(i) {
3327
- const a = (function(l) {
3328
- try {
3329
- const [c] = l.multistatus.response, { propstat: { prop: { "quota-used-bytes": u, "quota-available-bytes": f } } } = c;
3330
- return u !== void 0 && f !== void 0 ? { used: parseInt(String(u), 10), available: fs(f) } : null;
3331
- } catch {
3332
- }
3333
- return null;
3334
- })(i);
3335
- return pt(s, a, t.details);
3336
- }));
3337
- }));
3338
- }));
3339
- }));
3340
- function Ht(r, t, e) {
3341
- return e ? t ? t(r) : r : (r && r.then || (r = Promise.resolve(r)), t ? r.then(t) : r);
3342
- }
3343
- const ks = /* @__PURE__ */ (function(r) {
3344
- return function() {
3345
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3346
- try {
3347
- return Promise.resolve(r.apply(this, t));
3348
- } catch (n) {
3349
- return Promise.reject(n);
3350
- }
3351
- };
3352
- })((function(r, t) {
3353
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3354
- const { details: n = !1 } = e, s = R({ url: C(r.remoteURL, S(t)), method: "SEARCH", headers: { Accept: "text/plain,application/xml", "Content-Type": r.headers["Content-Type"] || "application/xml; charset=utf-8" } }, r, e);
3355
- return Ht(j(s, r), (function(o) {
3356
- return L(r, o), Ht(o.text(), (function(i) {
3357
- return Ht(Tt(i, r.parsing), (function(a) {
3358
- const l = (function(c, u, f) {
3359
- const h = { truncated: !1, results: [] };
3360
- return h.truncated = c.multistatus.response.some(((d) => (d.status || d.propstat?.status).split(" ", 3)?.[1] === "507" && d.href.replace(/\/$/, "").endsWith(S(u).replace(/\/$/, "")))), c.multistatus.response.forEach(((d) => {
3361
- if (d.propstat === void 0) return;
3362
- const g = d.href.split("/").map(decodeURIComponent).join("/");
3363
- h.results.push(kt(d.propstat.prop, g, f));
3364
- })), h;
3365
- })(a, t, n);
3366
- return pt(o, l, n);
3367
- }));
3368
- }));
3369
- }));
3370
- })), Ms = /* @__PURE__ */ (function(r) {
3371
- return function() {
3372
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3373
- try {
3374
- return Promise.resolve(r.apply(this, t));
3375
- } catch (n) {
3376
- return Promise.reject(n);
3377
- }
3378
- };
3379
- })((function(r, t, e) {
3380
- let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
3381
- const s = R({ url: C(r.remoteURL, S(t)), method: "MOVE", headers: { Destination: C(r.remoteURL, S(e)), Overwrite: n.overwrite === !1 ? "F" : "T" } }, r, n);
3382
- return i = function(a) {
3383
- L(r, a);
3384
- }, (o = j(s, r)) && o.then || (o = Promise.resolve(o)), i ? o.then(i) : o;
3385
- var o, i;
3386
- }));
3387
- var _s = O(172);
3388
- function Vs(r) {
3389
- if (Je(r)) return r.byteLength;
3390
- if (Ke(r)) return r.length;
3391
- if (typeof r == "string") return (0, _s.d)(r);
3392
- throw new V({ info: { code: et.DataTypeNoLength } }, "Cannot calculate data length: Invalid type");
3393
- }
3394
- const Bs = /* @__PURE__ */ (function(r) {
3395
- return function() {
3396
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3397
- try {
3398
- return Promise.resolve(r.apply(this, t));
3399
- } catch (n) {
3400
- return Promise.reject(n);
3401
- }
3402
- };
3403
- })((function(r, t, e) {
3404
- let n = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
3405
- const { contentLength: s = !0, overwrite: o = !0 } = n, i = { "Content-Type": "application/octet-stream" };
3406
- s === !1 || (i["Content-Length"] = typeof s == "number" ? `${s}` : `${Vs(e)}`), o || (i["If-None-Match"] = "*");
3407
- const a = R({ url: C(r.remoteURL, S(t)), method: "PUT", headers: i, data: e }, r, n);
3408
- return c = function(u) {
3409
- try {
3410
- L(r, u);
3411
- } catch (f) {
3412
- const h = f;
3413
- if (h.status !== 412 || o) throw h;
3414
- return !1;
3415
- }
3416
- return !0;
3417
- }, (l = j(a, r)) && l.then || (l = Promise.resolve(l)), c ? l.then(c) : l;
3418
- var l, c;
3419
- })), mr = /* @__PURE__ */ (function(r) {
3420
- return function() {
3421
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3422
- try {
3423
- return Promise.resolve(r.apply(this, t));
3424
- } catch (n) {
3425
- return Promise.reject(n);
3426
- }
3427
- };
3428
- })((function(r, t) {
3429
- let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3430
- const n = R({ url: C(r.remoteURL, S(t)), method: "OPTIONS" }, r, e);
3431
- return o = function(i) {
3432
- try {
3433
- L(r, i);
3434
- } catch (a) {
3435
- throw a;
3436
- }
3437
- return { compliance: (i.headers.get("DAV") ?? "").split(",").map(((a) => a.trim())), server: i.headers.get("Server") ?? "" };
3438
- }, (s = j(n, r)) && s.then || (s = Promise.resolve(s)), o ? s.then(o) : s;
3439
- var s, o;
3440
- }));
3441
- function Pt(r, t, e) {
3442
- return e ? t ? t(r) : r : (r && r.then || (r = Promise.resolve(r)), t ? r.then(t) : r);
3443
- }
3444
- const Ws = le((function(r, t, e, n, s) {
3445
- let o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
3446
- if (e > n || e < 0) throw new V({ info: { code: et.InvalidUpdateRange } }, `Invalid update range ${e} for partial update`);
3447
- const i = { "Content-Type": "application/octet-stream", "Content-Length": "" + (n - e + 1), "Content-Range": `bytes ${e}-${n}/*` }, a = R({ url: C(r.remoteURL, S(t)), method: "PUT", headers: i, data: s }, r, o);
3448
- return Pt(j(a, r), (function(l) {
3449
- L(r, l);
3450
- }));
3451
- }));
3452
- function _e(r, t) {
3453
- var e = r();
3454
- return e && e.then ? e.then(t) : t(e);
3455
- }
3456
- const qs = le((function(r, t, e, n, s) {
3457
- let o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
3458
- if (e > n || e < 0) throw new V({ info: { code: et.InvalidUpdateRange } }, `Invalid update range ${e} for partial update`);
3459
- const i = { "Content-Type": "application/x-sabredav-partialupdate", "Content-Length": "" + (n - e + 1), "X-Update-Range": `bytes=${e}-${n}` }, a = R({ url: C(r.remoteURL, S(t)), method: "PATCH", headers: i, data: s }, r, o);
3460
- return Pt(j(a, r), (function(l) {
3461
- L(r, l);
3462
- }));
3463
- }));
3464
- function le(r) {
3465
- return function() {
3466
- for (var t = [], e = 0; e < arguments.length; e++) t[e] = arguments[e];
3467
- try {
3468
- return Promise.resolve(r.apply(this, t));
3469
- } catch (n) {
3470
- return Promise.reject(n);
3471
- }
3472
- };
3473
- }
3474
- const Gs = le((function(r, t, e, n, s) {
3475
- let o = arguments.length > 5 && arguments[5] !== void 0 ? arguments[5] : {};
3476
- return Pt(mr(r, t, o), (function(i) {
3477
- let a = !1;
3478
- return _e((function() {
3479
- if (i.compliance.includes("sabredav-partialupdate")) return Pt(qs(r, t, e, n, s, o), (function(l) {
3480
- return a = !0, l;
3481
- }));
3482
- }), (function(l) {
3483
- let c = !1;
3484
- return a ? l : _e((function() {
3485
- if (i.server.includes("Apache") && i.compliance.includes("<http://apache.org/dav/propset/fs/1>")) return Pt(Ws(r, t, e, n, s, o), (function(u) {
3486
- return c = !0, u;
3487
- }));
3488
- }), (function(u) {
3489
- if (c) return u;
3490
- throw new V({ info: { code: et.NotSupported } }, "Not supported");
3491
- }));
3492
- }));
3493
- }));
3494
- })), zs = "https://github.com/perry-mitchell/webdav-client/blob/master/LOCK_CONTACT.md";
3495
- function Hs(r) {
3496
- let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3497
- const { authType: e = null, remoteBasePath: n, contactHref: s = zs, ha1: o, headers: i = {}, httpAgent: a, httpsAgent: l, password: c, token: u, username: f, withCredentials: h } = t;
3498
- let d = e;
3499
- d || (d = f || c ? W.Password : W.None);
3500
- const g = { authType: d, remoteBasePath: n, contactHref: s, ha1: o, headers: Object.assign({}, i), httpAgent: a, httpsAgent: l, password: c, parsing: { attributeNamePrefix: t.attributeNamePrefix ?? "@", attributeParsers: [], tagParsers: [lr] }, remotePath: Kr(r), remoteURL: r, token: u, username: f, withCredentials: h };
3501
- return Ye(g, f, c, u, o), { copyFile: (p, m, b) => Ln(g, p, m, b), createDirectory: (p, m) => te(g, p, m), createReadStream: (p, m) => (function(b, y) {
3502
- let v = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3503
- const w = new (ke()).PassThrough();
3504
- return ms(b, y, v).then(((x) => {
3505
- x.pipe(w);
3506
- })).catch(((x) => {
3507
- w.emit("error", x);
3508
- })), w;
3509
- })(g, p, m), createWriteStream: (p, m, b) => (function(y, v) {
3510
- let w = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}, x = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : ys;
3511
- const P = new (ke()).PassThrough(), E = {};
3512
- w.overwrite === !1 && (E["If-None-Match"] = "*");
3513
- const T = R({ url: C(y.remoteURL, S(v)), method: "PUT", headers: E, data: P, maxRedirects: 0 }, y, w);
3514
- return j(T, y).then(((A) => L(y, A))).then(((A) => {
3515
- setTimeout((() => {
3516
- x(A);
3517
- }), 0);
3518
- })).catch(((A) => {
3519
- P.emit("error", A);
3520
- })), P;
3521
- })(g, p, m, b), customRequest: (p, m) => bs(g, p, m), deleteFile: (p, m) => vs(g, p, m), exists: (p, m) => ws(g, p, m), getDirectoryContents: (p, m) => xs(g, p, m), getFileContents: (p, m) => Es(g, p, m), getFileDownloadLink: (p) => (function(m, b) {
3522
- let y = C(m.remoteURL, S(b));
3523
- const v = /^https:/i.test(y) ? "https" : "http";
3524
- switch (m.authType) {
3525
- case W.None:
3526
- break;
3527
- case W.Password: {
3528
- const w = be(m.headers.Authorization.replace(/^Basic /i, "").trim());
3529
- y = y.replace(/^https?:\/\//, `${v}://${w}@`);
3530
- break;
3531
- }
3532
- default:
3533
- throw new V({ info: { code: et.LinkUnsupportedAuthType } }, `Unsupported auth type for file link: ${m.authType}`);
3534
- }
3535
- return y;
3536
- })(g, p), getFileUploadLink: (p) => (function(m, b) {
3537
- let y = `${C(m.remoteURL, S(b))}?Content-Type=application/octet-stream`;
3538
- const v = /^https:/i.test(y) ? "https" : "http";
3539
- switch (m.authType) {
3540
- case W.None:
3541
- break;
3542
- case W.Password: {
3543
- const w = be(m.headers.Authorization.replace(/^Basic /i, "").trim());
3544
- y = y.replace(/^https?:\/\//, `${v}://${w}@`);
3545
- break;
3546
- }
3547
- default:
3548
- throw new V({ info: { code: et.LinkUnsupportedAuthType } }, `Unsupported auth type for file link: ${m.authType}`);
3549
- }
3550
- return y;
3551
- })(g, p), getHeaders: () => Object.assign({}, g.headers), getQuota: (p) => Ds(g, p), lock: (p, m) => Ls(g, p, m), moveFile: (p, m, b) => Ms(g, p, m, b), putFileContents: (p, m, b) => Bs(g, p, m, b), partialUpdateFileContents: (p, m, b, y, v) => Gs(g, p, m, b, y, v), getDAVCompliance: (p) => mr(g, p), search: (p, m) => ks(g, p, m), setHeaders: (p) => {
3552
- g.headers = Object.assign({}, p);
3553
- }, stat: (p, m) => ae(g, p, m), unlock: (p, m, b) => Rs(g, p, m, b), registerAttributeParser: (p) => {
3554
- g.parsing.attributeParsers.push(p);
3555
- }, registerTagParser: (p) => {
3556
- g.parsing.tagParsers.push(p);
3557
- } };
3558
- }
3559
- const U = [];
3560
- for (let r = 0; r < 256; ++r)
3561
- U.push((r + 256).toString(16).slice(1));
3562
- function Xs(r, t = 0) {
3563
- return (U[r[t + 0]] + U[r[t + 1]] + U[r[t + 2]] + U[r[t + 3]] + "-" + U[r[t + 4]] + U[r[t + 5]] + "-" + U[r[t + 6]] + U[r[t + 7]] + "-" + U[r[t + 8]] + U[r[t + 9]] + "-" + U[r[t + 10]] + U[r[t + 11]] + U[r[t + 12]] + U[r[t + 13]] + U[r[t + 14]] + U[r[t + 15]]).toLowerCase();
3564
- }
3565
- let Xt;
3566
- const Ys = new Uint8Array(16);
3567
- function Zs() {
3568
- if (!Xt) {
3569
- if (typeof crypto > "u" || !crypto.getRandomValues)
3570
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
3571
- Xt = crypto.getRandomValues.bind(crypto);
3572
- }
3573
- return Xt(Ys);
3574
- }
3575
- const Js = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Ve = { randomUUID: Js };
3576
- function Ks(r, t, e) {
3577
- r = r || {};
3578
- const n = r.random ?? r.rng?.() ?? Zs();
3579
- if (n.length < 16)
3580
- throw new Error("Random bytes length must be >= 16");
3581
- return n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, Xs(n);
3582
- }
3583
- function Qs(r, t, e) {
3584
- return Ve.randomUUID && !r ? Ve.randomUUID() : Ks(r);
3585
- }
3586
- const re = (r, t) => Object.fromEntries(
3587
- Object.entries(r).map(([e, n]) => t.includes(e) ? [e, n || ""] : [Et.DavNamespace.includes(e) ? `d:${e}` : `oc:${e}`, n || ""])
3588
- ), Be = (r = [], {
3589
- pattern: t,
3590
- filterRules: e,
3591
- limit: n = 0,
3592
- extraProps: s = []
3593
- }) => {
3594
- let o = "d:propfind";
3595
- t && (o = "oc:search-files"), e && (o = "oc:filter-files");
3596
- const i = r.reduce((u, f) => Object.assign(u, { [f]: null }), {}), a = re(i, s), l = {
3597
- [o]: {
3598
- "d:prop": a,
3599
- "@@xmlns:d": "DAV:",
3600
- "@@xmlns:oc": "http://owncloud.org/ns",
3601
- ...t && {
3602
- "oc:search": { "oc:pattern": t, "oc:limit": n }
3603
- },
3604
- ...e && {
3605
- "oc:filter-rules": re(e, [])
3606
- }
3607
- }
3608
- };
3609
- return new J({
3610
- format: !0,
3611
- ignoreAttributes: !1,
3612
- attributeNamePrefix: "@@",
3613
- suppressEmptyNode: !0
3614
- }).build(l);
3615
- }, to = (r) => {
3616
- const t = {
3617
- "d:propertyupdate": {
3618
- "d:set": { "d:prop": re(r, []) },
3619
- "@@xmlns:d": "DAV:",
3620
- "@@xmlns:oc": "http://owncloud.org/ns"
3621
- }
3622
- };
3623
- return new J({
3624
- format: !0,
3625
- ignoreAttributes: !1,
3626
- attributeNamePrefix: "@@",
3627
- suppressEmptyNode: !0
3628
- }).build(t);
3629
- }, eo = (r) => {
3630
- const t = {}, e = r.get("tus-version");
3631
- return e ? (t.version = e.split(","), r.get("tus-extension") && (t.extension = r.get("tus-extension").split(",")), r.get("tus-resumable") && (t.resumable = r.get("tus-resumable")), r.get("tus-max-size") && (t.maxSize = parseInt(r.get("tus-max-size"), 10)), t) : null;
3632
- }, ro = async (r) => {
3633
- const t = (n) => {
3634
- const s = decodeURIComponent(n);
3635
- return n?.startsWith("/remote.php/dav/") ? I(s.replace("/remote.php/dav/", ""), {
3636
- leadingSlash: !0,
3637
- trailingSlash: !1
3638
- }) : s;
3639
- };
3640
- return (await Tt(r)).multistatus.response.map(({ href: n, propstat: s }) => {
3641
- const o = {
3642
- ...kt(s.prop, t(n), !0),
3643
- processing: s.status === "HTTP/1.1 425 TOO EARLY"
3644
- };
3645
- return o.props.name && (o.props.name = o.props.name.toString()), o;
3646
- });
3647
- }, no = (r) => {
3648
- const t = new Pr(), e = {
3649
- message: "Unknown error",
3650
- errorCode: void 0
3651
- };
3652
- try {
3653
- const n = t.parse(r);
3654
- if (!n["d:error"])
3655
- return e;
3656
- if (n["d:error"]["s:message"]) {
3657
- const s = n["d:error"]["s:message"];
3658
- typeof s == "string" && (e.message = s);
3659
- }
3660
- if (n["d:error"]["s:errorcode"]) {
3661
- const s = n["d:error"]["s:errorcode"];
3662
- typeof s == "string" && (e.errorCode = s);
3663
- }
3664
- } catch {
3665
- return e;
3666
- }
3667
- return e;
3668
- };
3669
- class so {
3670
- client;
3671
- davPath;
3672
- headers;
3673
- extraProps;
3674
- constructor({ baseUrl: t, headers: e }) {
3675
- this.davPath = I(t, "remote.php/dav"), this.client = Hs(this.davPath, {}), this.headers = e, this.extraProps = [];
3676
- }
3677
- mkcol(t, e = {}) {
3678
- return this.request(t, { method: Q.mkcol, ...e });
3679
- }
3680
- async propfind(t, {
3681
- depth: e = 1,
3682
- properties: n = [],
3683
- headers: s = {},
3684
- ...o
3685
- } = {}) {
3686
- const i = { ...s, Depth: e.toString() }, { body: a, result: l } = await this.request(t, {
3687
- method: Q.propfind,
3688
- data: Be(n, { extraProps: this.extraProps }),
3689
- headers: i,
3690
- ...o
3691
- });
3692
- return a?.length && (a[0].tusSupport = eo(l.headers)), a;
3693
- }
3694
- async report(t, {
3695
- pattern: e = "",
3696
- filterRules: n = null,
3697
- limit: s = 30,
3698
- properties: o,
3699
- ...i
3700
- } = {}) {
3701
- const { body: a, result: l } = await this.request(t, {
3702
- method: Q.report,
3703
- data: Be(o, {
3704
- pattern: e,
3705
- filterRules: n,
3706
- limit: s,
3707
- extraProps: this.extraProps
3708
- }),
3709
- ...i
3710
- });
3711
- return {
3712
- results: a,
3713
- range: l.headers.get("content-range")
3714
- };
3715
- }
3716
- copy(t, e, { overwrite: n = !1, headers: s = {}, ...o } = {}) {
3717
- const i = I(this.davPath, Ct(e));
3718
- return this.request(t, {
3719
- method: Q.copy,
3720
- headers: { ...s, Destination: i, overwrite: n ? "T" : "F" },
3721
- ...o
3722
- });
3723
- }
3724
- move(t, e, { overwrite: n = !1, headers: s = {}, ...o } = {}) {
3725
- const i = I(this.davPath, Ct(e));
3726
- return this.request(t, {
3727
- method: Q.move,
3728
- headers: { ...s, Destination: i, overwrite: n ? "T" : "F" },
3729
- ...o
3730
- });
3731
- }
3732
- put(t, e, {
3733
- headers: n = {},
3734
- onUploadProgress: s,
3735
- previousEntityTag: o,
3736
- overwrite: i,
3737
- ...a
3738
- } = {}) {
3739
- const l = { ...n };
3740
- return o ? l["If-Match"] = o : i || (l["If-None-Match"] = "*"), this.request(t, {
3741
- method: Q.put,
3742
- data: e,
3743
- headers: l,
3744
- onUploadProgress: s,
3745
- ...a
3746
- });
3747
- }
3748
- delete(t, e = {}) {
3749
- return this.request(t, { method: Q.delete, ...e });
3750
- }
3751
- propPatch(t, e, n = {}) {
3752
- const s = to(e);
3753
- return this.request(t, { method: Q.proppatch, data: s, ...n });
3754
- }
3755
- getFileUrl(t) {
3756
- return I(this.davPath, Ct(t));
3757
- }
3758
- buildHeaders(t = {}) {
3759
- return {
3760
- "Content-Type": "application/xml; charset=utf-8",
3761
- "X-Requested-With": "XMLHttpRequest",
3762
- "X-Request-ID": Qs(),
3763
- ...this.headers && { ...this.headers() },
3764
- ...t
3765
- };
3766
- }
3767
- async request(t, e) {
3768
- const n = I(this.davPath, Ct(t), { leadingSlash: !0 }), s = {
3769
- ...e,
3770
- url: n,
3771
- headers: this.buildHeaders(e.headers || {})
3772
- };
3773
- try {
3774
- const o = await this.client.customRequest("", s);
3775
- let i;
3776
- if (o.status === 207) {
3777
- const a = await o.text();
3778
- i = await ro(a);
3779
- }
3780
- return {
3781
- body: i,
3782
- status: o.status,
3783
- result: o
3784
- };
3785
- } catch (o) {
3786
- const { response: i } = o, a = await i.text(), l = no(a);
3787
- throw new Er(
3788
- l.message,
3789
- l.errorCode,
3790
- i,
3791
- i.status
3792
- );
3793
- }
3794
- }
3795
- }
3796
- const oo = (r, t) => ({
3797
- async listFileVersions(e, n = {}) {
3798
- const [s, ...o] = await r.propfind(
3799
- I("meta", e, "v", { leadingSlash: !0 }),
3800
- n
3801
- );
3802
- return o.map((i) => lt(i, r.extraProps));
3803
- }
3804
- }), io = (r, t) => ({
3805
- setFavorite(e, { path: n }, s, o = {}) {
3806
- const i = { [ft.IsFavorite]: s ? "true" : "false" };
3807
- return r.propPatch(I(e.webDavPath, n), i, o);
3808
- }
3809
- }), ao = (r, t) => ({
3810
- listFavoriteFiles({
3811
- davProperties: e = Et.Default,
3812
- username: n = "",
3813
- ...s
3814
- } = {}) {
3815
- return r.report(I("files", n), {
3816
- properties: e,
3817
- filterRules: { favorite: 1 },
3818
- ...s
3819
- });
3820
- }
3821
- }), po = (r, t) => {
3822
- const e = br.create();
3823
- t && e.interceptors.request.use((N) => (Object.assign(N.headers, t()), N));
3824
- const n = { axiosClient: e, baseUrl: r }, s = new so({ baseUrl: r, headers: t }), o = (N) => {
3825
- s.extraProps.push(N);
3826
- }, i = Hr(s), { getPathForFileId: a } = i, l = Mr(s, i), { listFiles: c } = l, u = Ur(l), { getFileInfo: f } = u, { createFolder: h } = Rr(s, u), d = Lr(s, n), { getFileContents: g } = d, { putFileContents: p } = Vr(s, u), { getFileUrl: m, revokeUrl: b } = Dr(
3827
- s,
3828
- d,
3829
- u,
3830
- n
3831
- ), { getPublicFileUrl: y } = kr(s), { copyFiles: v } = jr(s), { moveFiles: w } = _r(s), { deleteFile: x } = Br(s), { restoreFile: P } = Wr(s), { listFileVersions: E } = oo(s), { restoreFileVersion: T } = qr(s), { clearTrashBin: A } = Gr(s), { search: F } = zr(s), { listFavoriteFiles: rt } = ao(s), { setFavorite: nt } = io(s);
3832
- return {
3833
- copyFiles: v,
3834
- createFolder: h,
3835
- deleteFile: x,
3836
- restoreFile: P,
3837
- restoreFileVersion: T,
3838
- getFileContents: g,
3839
- getFileInfo: f,
3840
- getFileUrl: m,
3841
- getPublicFileUrl: y,
3842
- getPathForFileId: a,
3843
- listFiles: c,
3844
- listFileVersions: E,
3845
- moveFiles: w,
3846
- putFileContents: p,
3847
- revokeUrl: b,
3848
- clearTrashBin: A,
3849
- search: F,
3850
- listFavoriteFiles: rt,
3851
- setFavorite: nt,
3852
- registerExtraProp: o
3853
- };
3854
- };
3855
- export {
3856
- Er as D,
3857
- qe as H,
3858
- Ct as e,
3859
- po as w
3860
- };