@nextcloud/files 3.0.0-beta.17 → 3.0.0-beta.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,66 +1,65 @@
1
- import { getCurrentUser as c, getRequestToken as N } from "@nextcloud/auth";
2
- import { getLoggerBuilder as m } from "@nextcloud/logger";
3
- import { getCanonicalLocale as A } from "@nextcloud/l10n";
4
- import { join as R, basename as F, extname as S, dirname as d } from "path";
5
- import { generateRemoteUrl as _ } from "@nextcloud/router";
6
- import { createClient as $, getPatcher as V } from "webdav";
7
- import { request as C } from "webdav/dist/node/request.js";
8
- import q from "is-svg";
9
- const L = (e) => e === null ? m().setApp("files").build() : m().setApp("files").setUid(e.uid).build(), o = L(c());
10
- class T {
1
+ import { getCurrentUser as A, getRequestToken as ot } from "@nextcloud/auth";
2
+ import { getLoggerBuilder as j } from "@nextcloud/logger";
3
+ import { getCanonicalLocale as at } from "@nextcloud/l10n";
4
+ import { join as lt, basename as dt, extname as ut, dirname as _ } from "path";
5
+ import { generateRemoteUrl as ct } from "@nextcloud/router";
6
+ import { createClient as ht, getPatcher as pt } from "webdav";
7
+ import { request as ft } from "webdav/dist/node/request.js";
8
+ const gt = (t) => t === null ? j().setApp("files").build() : j().setApp("files").setUid(t.uid).build(), m = gt(A());
9
+ class mt {
11
10
  _entries = [];
12
- registerEntry(t) {
13
- this.validateEntry(t), this._entries.push(t);
11
+ registerEntry(e) {
12
+ this.validateEntry(e), this._entries.push(e);
14
13
  }
15
- unregisterEntry(t) {
16
- const r = typeof t == "string" ? this.getEntryIndex(t) : this.getEntryIndex(t.id);
17
- if (r === -1) {
18
- o.warn("Entry not found, nothing removed", { entry: t, entries: this.getEntries() });
14
+ unregisterEntry(e) {
15
+ const i = typeof e == "string" ? this.getEntryIndex(e) : this.getEntryIndex(e.id);
16
+ if (i === -1) {
17
+ m.warn("Entry not found, nothing removed", { entry: e, entries: this.getEntries() });
19
18
  return;
20
19
  }
21
- this._entries.splice(r, 1);
20
+ this._entries.splice(i, 1);
22
21
  }
23
- getEntries(t, r) {
24
- return t && r ? this._entries.filter((i) => typeof i.if == "function" ? i.if(t, r) : !0) : this._entries;
22
+ getEntries(e) {
23
+ return e ? this._entries.filter((i) => typeof i.if == "function" ? i.if(e) : !0) : this._entries;
25
24
  }
26
- getEntryIndex(t) {
27
- return this._entries.findIndex((r) => r.id === t);
25
+ getEntryIndex(e) {
26
+ return this._entries.findIndex((i) => i.id === e);
28
27
  }
29
- validateEntry(t) {
30
- if (!t.id || !t.displayName || !(t.iconSvgInline || t.iconClass))
28
+ validateEntry(e) {
29
+ if (!e.id || !e.displayName || !(e.iconSvgInline || e.iconClass || e.handler))
31
30
  throw new Error("Invalid entry");
32
- if (typeof t.id != "string" || typeof t.displayName != "string")
31
+ if (typeof e.id != "string" || typeof e.displayName != "string")
33
32
  throw new Error("Invalid id or displayName property");
34
- if (t.iconClass && typeof t.iconClass != "string" || t.iconSvgInline && typeof t.iconSvgInline != "string")
33
+ if (e.iconClass && typeof e.iconClass != "string" || e.iconSvgInline && typeof e.iconSvgInline != "string")
35
34
  throw new Error("Invalid icon provided");
36
- if (t.if !== void 0 && typeof t.if != "function")
35
+ if (e.if !== void 0 && typeof e.if != "function")
37
36
  throw new Error("Invalid if property");
38
- if (t.templateName && typeof t.templateName != "string")
37
+ if (e.templateName && typeof e.templateName != "string")
39
38
  throw new Error("Invalid templateName property");
40
- if (t.handler && typeof t.handler != "function")
39
+ if (e.handler && typeof e.handler != "function")
41
40
  throw new Error("Invalid handler property");
42
- if (!t.templateName && !t.handler)
41
+ if (!e.templateName && !e.handler)
43
42
  throw new Error("At least a templateName or a handler must be provided");
44
- if (this.getEntryIndex(t.id) !== -1)
43
+ if (this.getEntryIndex(e.id) !== -1)
45
44
  throw new Error("Duplicate entry");
46
45
  }
47
46
  }
48
- const p = function() {
49
- return typeof window._nc_newfilemenu > "u" && (window._nc_newfilemenu = new T(), o.debug("NewFileMenu initialized")), window._nc_newfilemenu;
50
- }, u = ["B", "KB", "MB", "GB", "TB", "PB"], l = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
51
- function te(e, t = !1, r = !1) {
52
- typeof e == "string" && (e = Number(e));
53
- let i = e > 0 ? Math.floor(Math.log(e) / Math.log(r ? 1024 : 1e3)) : 0;
54
- i = Math.min((r ? l.length : u.length) - 1, i);
55
- const a = r ? l[i] : u[i];
56
- let n = (e / Math.pow(r ? 1024 : 1e3, i)).toFixed(1);
57
- return t === !0 && i === 0 ? (n !== "0.0" ? "< 1 " : "0 ") + (r ? l[1] : u[1]) : (i < 2 ? n = parseFloat(n).toFixed(0) : n = parseFloat(n).toLocaleString(A()), n + " " + a);
47
+ const S = function() {
48
+ return typeof window._nc_newfilemenu > "u" && (window._nc_newfilemenu = new mt(), m.debug("NewFileMenu initialized")), window._nc_newfilemenu;
49
+ }, I = ["B", "KB", "MB", "GB", "TB", "PB"], P = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
50
+ function Ke(t, e = !1, i = !1) {
51
+ typeof t == "string" && (t = Number(t));
52
+ let s = t > 0 ? Math.floor(Math.log(t) / Math.log(i ? 1024 : 1e3)) : 0;
53
+ s = Math.min((i ? P.length : I.length) - 1, s);
54
+ const n = i ? P[s] : I[s];
55
+ let r = (t / Math.pow(i ? 1024 : 1e3, s)).toFixed(1);
56
+ return e === !0 && s === 0 ? (r !== "0.0" ? "< 1 " : "0 ") + (i ? P[1] : I[1]) : (s < 2 ? r = parseFloat(r).toFixed(0) : r = parseFloat(r).toLocaleString(at()), r + " " + n);
58
57
  }
59
- var v = ((e) => (e.DEFAULT = "default", e.HIDDEN = "hidden", e))(v || {});
60
- class re {
58
+ var H = ((t) => (t.DEFAULT = "default", t.HIDDEN = "hidden", t))(H || {});
59
+ class We {
61
60
  _action;
62
- constructor(t) {
63
- this.validateAction(t), this._action = t;
61
+ constructor(e) {
62
+ this.validateAction(e), this._action = e;
64
63
  }
65
64
  get id() {
66
65
  return this._action.id;
@@ -92,42 +91,42 @@ class re {
92
91
  get renderInline() {
93
92
  return this._action.renderInline;
94
93
  }
95
- validateAction(t) {
96
- if (!t.id || typeof t.id != "string")
94
+ validateAction(e) {
95
+ if (!e.id || typeof e.id != "string")
97
96
  throw new Error("Invalid id");
98
- if (!t.displayName || typeof t.displayName != "function")
97
+ if (!e.displayName || typeof e.displayName != "function")
99
98
  throw new Error("Invalid displayName function");
100
- if (!t.iconSvgInline || typeof t.iconSvgInline != "function")
99
+ if (!e.iconSvgInline || typeof e.iconSvgInline != "function")
101
100
  throw new Error("Invalid iconSvgInline function");
102
- if (!t.exec || typeof t.exec != "function")
101
+ if (!e.exec || typeof e.exec != "function")
103
102
  throw new Error("Invalid exec function");
104
- if ("enabled" in t && typeof t.enabled != "function")
103
+ if ("enabled" in e && typeof e.enabled != "function")
105
104
  throw new Error("Invalid enabled function");
106
- if ("execBatch" in t && typeof t.execBatch != "function")
105
+ if ("execBatch" in e && typeof e.execBatch != "function")
107
106
  throw new Error("Invalid execBatch function");
108
- if ("order" in t && typeof t.order != "number")
107
+ if ("order" in e && typeof e.order != "number")
109
108
  throw new Error("Invalid order");
110
- if (t.default && !Object.values(v).includes(t.default))
109
+ if (e.default && !Object.values(H).includes(e.default))
111
110
  throw new Error("Invalid default");
112
- if ("inline" in t && typeof t.inline != "function")
111
+ if ("inline" in e && typeof e.inline != "function")
113
112
  throw new Error("Invalid inline function");
114
- if ("renderInline" in t && typeof t.renderInline != "function")
113
+ if ("renderInline" in e && typeof e.renderInline != "function")
115
114
  throw new Error("Invalid renderInline function");
116
115
  }
117
116
  }
118
- const ie = function(e) {
119
- if (typeof window._nc_fileactions > "u" && (window._nc_fileactions = [], o.debug("FileActions initialized")), window._nc_fileactions.find((t) => t.id === e.id)) {
120
- o.error(`FileAction ${e.id} already registered`, { action: e });
117
+ const Ye = function(t) {
118
+ if (typeof window._nc_fileactions > "u" && (window._nc_fileactions = [], m.debug("FileActions initialized")), window._nc_fileactions.find((e) => e.id === t.id)) {
119
+ m.error(`FileAction ${t.id} already registered`, { action: t });
121
120
  return;
122
121
  }
123
- window._nc_fileactions.push(e);
124
- }, ne = function() {
125
- return typeof window._nc_fileactions > "u" && (window._nc_fileactions = [], o.debug("FileActions initialized")), window._nc_fileactions;
122
+ window._nc_fileactions.push(t);
123
+ }, Ze = function() {
124
+ return typeof window._nc_fileactions > "u" && (window._nc_fileactions = [], m.debug("FileActions initialized")), window._nc_fileactions;
126
125
  };
127
- class oe {
126
+ class Je {
128
127
  _header;
129
- constructor(t) {
130
- this.validateHeader(t), this._header = t;
128
+ constructor(e) {
129
+ this.validateHeader(e), this._header = e;
131
130
  }
132
131
  get id() {
133
132
  return this._header.id;
@@ -144,72 +143,72 @@ class oe {
144
143
  get updated() {
145
144
  return this._header.updated;
146
145
  }
147
- validateHeader(t) {
148
- if (!t.id || !t.render || !t.updated)
146
+ validateHeader(e) {
147
+ if (!e.id || !e.render || !e.updated)
149
148
  throw new Error("Invalid header: id, render and updated are required");
150
- if (typeof t.id != "string")
149
+ if (typeof e.id != "string")
151
150
  throw new Error("Invalid id property");
152
- if (t.enabled !== void 0 && typeof t.enabled != "function")
151
+ if (e.enabled !== void 0 && typeof e.enabled != "function")
153
152
  throw new Error("Invalid enabled property");
154
- if (t.render && typeof t.render != "function")
153
+ if (e.render && typeof e.render != "function")
155
154
  throw new Error("Invalid render property");
156
- if (t.updated && typeof t.updated != "function")
155
+ if (e.updated && typeof e.updated != "function")
157
156
  throw new Error("Invalid updated property");
158
157
  }
159
158
  }
160
- const se = function(e) {
161
- if (typeof window._nc_filelistheader > "u" && (window._nc_filelistheader = [], o.debug("FileListHeaders initialized")), window._nc_filelistheader.find((t) => t.id === e.id)) {
162
- o.error(`Header ${e.id} already registered`, { header: e });
159
+ const Qe = function(t) {
160
+ if (typeof window._nc_filelistheader > "u" && (window._nc_filelistheader = [], m.debug("FileListHeaders initialized")), window._nc_filelistheader.find((e) => e.id === t.id)) {
161
+ m.error(`Header ${t.id} already registered`, { header: t });
163
162
  return;
164
163
  }
165
- window._nc_filelistheader.push(e);
166
- }, ae = function() {
167
- return typeof window._nc_filelistheader > "u" && (window._nc_filelistheader = [], o.debug("FileListHeaders initialized")), window._nc_filelistheader;
164
+ window._nc_filelistheader.push(t);
165
+ }, ti = function() {
166
+ return typeof window._nc_filelistheader > "u" && (window._nc_filelistheader = [], m.debug("FileListHeaders initialized")), window._nc_filelistheader;
168
167
  };
169
- var s = ((e) => (e[e.NONE = 0] = "NONE", e[e.CREATE = 4] = "CREATE", e[e.READ = 1] = "READ", e[e.UPDATE = 2] = "UPDATE", e[e.DELETE = 8] = "DELETE", e[e.SHARE = 16] = "SHARE", e[e.ALL = 31] = "ALL", e))(s || {});
170
- const y = ["d:getcontentlength", "d:getcontenttype", "d:getetag", "d:getlastmodified", "d:quota-available-bytes", "d:resourcetype", "nc:has-preview", "nc:is-encrypted", "nc:mount-type", "nc:share-attributes", "oc:comments-unread", "oc:favorite", "oc:fileid", "oc:owner-display-name", "oc:owner-id", "oc:permissions", "oc:share-types", "oc:size", "ocs:share-permissions"], E = { d: "DAV:", nc: "http://nextcloud.org/ns", oc: "http://owncloud.org/ns", ocs: "http://open-collaboration-services.org/ns" }, de = function(e, t = { nc: "http://nextcloud.org/ns" }) {
171
- typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...y], window._nc_dav_namespaces = { ...E });
172
- const r = { ...window._nc_dav_namespaces, ...t };
173
- if (window._nc_dav_properties.find((a) => a === e))
174
- return o.error(`${e} already registered`, { prop: e }), !1;
175
- if (e.startsWith("<") || e.split(":").length !== 2)
176
- return o.error(`${e} is not valid. See example: 'oc:fileid'`, { prop: e }), !1;
177
- const i = e.split(":")[0];
178
- return r[i] ? (window._nc_dav_properties.push(e), window._nc_dav_namespaces = r, !0) : (o.error(`${e} namespace unknown`, { prop: e, namespaces: r }), !1);
179
- }, f = function() {
180
- return typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...y]), window._nc_dav_properties.map((e) => `<${e} />`).join(" ");
181
- }, w = function() {
182
- return typeof window._nc_dav_namespaces > "u" && (window._nc_dav_namespaces = { ...E }), Object.keys(window._nc_dav_namespaces).map((e) => `xmlns:${e}="${window._nc_dav_namespaces?.[e]}"`).join(" ");
183
- }, ce = function() {
168
+ var v = ((t) => (t[t.NONE = 0] = "NONE", t[t.CREATE = 4] = "CREATE", t[t.READ = 1] = "READ", t[t.UPDATE = 2] = "UPDATE", t[t.DELETE = 8] = "DELETE", t[t.SHARE = 16] = "SHARE", t[t.ALL = 31] = "ALL", t))(v || {});
169
+ const K = ["d:getcontentlength", "d:getcontenttype", "d:getetag", "d:getlastmodified", "d:quota-available-bytes", "d:resourcetype", "nc:has-preview", "nc:is-encrypted", "nc:mount-type", "nc:share-attributes", "oc:comments-unread", "oc:favorite", "oc:fileid", "oc:owner-display-name", "oc:owner-id", "oc:permissions", "oc:share-types", "oc:size", "ocs:share-permissions"], W = { d: "DAV:", nc: "http://nextcloud.org/ns", oc: "http://owncloud.org/ns", ocs: "http://open-collaboration-services.org/ns" }, ei = function(t, e = { nc: "http://nextcloud.org/ns" }) {
170
+ typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...K], window._nc_dav_namespaces = { ...W });
171
+ const i = { ...window._nc_dav_namespaces, ...e };
172
+ if (window._nc_dav_properties.find((n) => n === t))
173
+ return m.error(`${t} already registered`, { prop: t }), !1;
174
+ if (t.startsWith("<") || t.split(":").length !== 2)
175
+ return m.error(`${t} is not valid. See example: 'oc:fileid'`, { prop: t }), !1;
176
+ const s = t.split(":")[0];
177
+ return i[s] ? (window._nc_dav_properties.push(t), window._nc_dav_namespaces = i, !0) : (m.error(`${t} namespace unknown`, { prop: t, namespaces: i }), !1);
178
+ }, F = function() {
179
+ return typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...K]), window._nc_dav_properties.map((t) => `<${t} />`).join(" ");
180
+ }, V = function() {
181
+ return typeof window._nc_dav_namespaces > "u" && (window._nc_dav_namespaces = { ...W }), Object.keys(window._nc_dav_namespaces).map((t) => `xmlns:${t}="${window._nc_dav_namespaces?.[t]}"`).join(" ");
182
+ }, ii = function() {
184
183
  return `<?xml version="1.0"?>
185
- <d:propfind ${w()}>
184
+ <d:propfind ${V()}>
186
185
  <d:prop>
187
- ${f()}
186
+ ${F()}
188
187
  </d:prop>
189
188
  </d:propfind>`;
190
- }, P = function() {
189
+ }, wt = function() {
191
190
  return `<?xml version="1.0"?>
192
- <oc:filter-files ${w()}>
191
+ <oc:filter-files ${V()}>
193
192
  <d:prop>
194
- ${f()}
193
+ ${F()}
195
194
  </d:prop>
196
195
  <oc:filter-rules>
197
196
  <oc:favorite>1</oc:favorite>
198
197
  </oc:filter-rules>
199
198
  </oc:filter-files>`;
200
- }, ue = function(e) {
199
+ }, ni = function(t) {
201
200
  return `<?xml version="1.0" encoding="UTF-8"?>
202
- <d:searchrequest ${w()}
201
+ <d:searchrequest ${V()}
203
202
  xmlns:ns="https://github.com/icewind1991/SearchDAV/ns">
204
203
  <d:basicsearch>
205
204
  <d:select>
206
205
  <d:prop>
207
- ${f()}
206
+ ${F()}
208
207
  </d:prop>
209
208
  </d:select>
210
209
  <d:from>
211
210
  <d:scope>
212
- <d:href>/files/${c()?.uid}/</d:href>
211
+ <d:href>/files/${A()?.uid}/</d:href>
213
212
  <d:depth>infinity</d:depth>
214
213
  </d:scope>
215
214
  </d:from>
@@ -235,7 +234,7 @@ const y = ["d:getcontentlength", "d:getcontenttype", "d:getetag", "d:getlastmodi
235
234
  <d:prop>
236
235
  <d:getlastmodified/>
237
236
  </d:prop>
238
- <d:literal>${e}</d:literal>
237
+ <d:literal>${t}</d:literal>
239
238
  </d:gt>
240
239
  </d:and>
241
240
  </d:where>
@@ -253,76 +252,76 @@ const y = ["d:getcontentlength", "d:getcontenttype", "d:getetag", "d:getlastmodi
253
252
  </d:limit>
254
253
  </d:basicsearch>
255
254
  </d:searchrequest>`;
256
- }, B = function(e = "") {
257
- let t = s.NONE;
258
- return e && ((e.includes("C") || e.includes("K")) && (t |= s.CREATE), e.includes("G") && (t |= s.READ), (e.includes("W") || e.includes("N") || e.includes("V")) && (t |= s.UPDATE), e.includes("D") && (t |= s.DELETE), e.includes("R") && (t |= s.SHARE)), t;
255
+ }, vt = function(t = "") {
256
+ let e = v.NONE;
257
+ return t && ((t.includes("C") || t.includes("K")) && (e |= v.CREATE), t.includes("G") && (e |= v.READ), (t.includes("W") || t.includes("N") || t.includes("V")) && (e |= v.UPDATE), t.includes("D") && (e |= v.DELETE), t.includes("R") && (e |= v.SHARE)), e;
259
258
  };
260
- var h = ((e) => (e.Folder = "folder", e.File = "file", e))(h || {});
261
- const b = function(e, t) {
262
- return e.match(t) !== null;
263
- }, g = (e, t) => {
264
- if (e.id && typeof e.id != "number")
259
+ var $ = ((t) => (t.Folder = "folder", t.File = "file", t))($ || {});
260
+ const Y = function(t, e) {
261
+ return t.match(e) !== null;
262
+ }, M = (t, e) => {
263
+ if (t.id && typeof t.id != "number")
265
264
  throw new Error("Invalid id type of value");
266
- if (!e.source)
265
+ if (!t.source)
267
266
  throw new Error("Missing mandatory source");
268
267
  try {
269
- new URL(e.source);
268
+ new URL(t.source);
270
269
  } catch {
271
270
  throw new Error("Invalid source format, source must be a valid URL");
272
271
  }
273
- if (!e.source.startsWith("http"))
272
+ if (!t.source.startsWith("http"))
274
273
  throw new Error("Invalid source format, only http(s) is supported");
275
- if (e.mtime && !(e.mtime instanceof Date))
274
+ if (t.mtime && !(t.mtime instanceof Date))
276
275
  throw new Error("Invalid mtime type");
277
- if (e.crtime && !(e.crtime instanceof Date))
276
+ if (t.crtime && !(t.crtime instanceof Date))
278
277
  throw new Error("Invalid crtime type");
279
- if (!e.mime || typeof e.mime != "string" || !e.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))
278
+ if (!t.mime || typeof t.mime != "string" || !t.mime.match(/^[-\w.]+\/[-+\w.]+$/gi))
280
279
  throw new Error("Missing or invalid mandatory mime");
281
- if ("size" in e && typeof e.size != "number" && e.size !== void 0)
280
+ if ("size" in t && typeof t.size != "number" && t.size !== void 0)
282
281
  throw new Error("Invalid size type");
283
- if ("permissions" in e && e.permissions !== void 0 && !(typeof e.permissions == "number" && e.permissions >= s.NONE && e.permissions <= s.ALL))
282
+ if ("permissions" in t && t.permissions !== void 0 && !(typeof t.permissions == "number" && t.permissions >= v.NONE && t.permissions <= v.ALL))
284
283
  throw new Error("Invalid permissions");
285
- if (e.owner && e.owner !== null && typeof e.owner != "string")
284
+ if (t.owner && t.owner !== null && typeof t.owner != "string")
286
285
  throw new Error("Invalid owner type");
287
- if (e.attributes && typeof e.attributes != "object")
286
+ if (t.attributes && typeof t.attributes != "object")
288
287
  throw new Error("Invalid attributes type");
289
- if (e.root && typeof e.root != "string")
288
+ if (t.root && typeof t.root != "string")
290
289
  throw new Error("Invalid root type");
291
- if (e.root && !e.root.startsWith("/"))
290
+ if (t.root && !t.root.startsWith("/"))
292
291
  throw new Error("Root must start with a leading slash");
293
- if (e.root && !e.source.includes(e.root))
292
+ if (t.root && !t.source.includes(t.root))
294
293
  throw new Error("Root must be part of the source");
295
- if (e.root && b(e.source, t)) {
296
- const r = e.source.match(t)[0];
297
- if (!e.source.includes(R(r, e.root)))
294
+ if (t.root && Y(t.source, e)) {
295
+ const i = t.source.match(e)[0];
296
+ if (!t.source.includes(lt(i, t.root)))
298
297
  throw new Error("The root must be relative to the service. e.g /files/emma");
299
298
  }
300
299
  };
301
- class I {
300
+ class Z {
302
301
  _data;
303
302
  _attributes;
304
303
  _knownDavService = /(remote|public)\.php\/(web)?dav/i;
305
- constructor(t, r) {
306
- g(t, r || this._knownDavService), this._data = t;
307
- const i = { set: (a, n, D) => (this.updateMtime(), Reflect.set(a, n, D)), deleteProperty: (a, n) => (this.updateMtime(), Reflect.deleteProperty(a, n)) };
308
- this._attributes = new Proxy(t.attributes || {}, i), delete this._data.attributes, r && (this._knownDavService = r);
304
+ constructor(e, i) {
305
+ M(e, i || this._knownDavService), this._data = e;
306
+ const s = { set: (n, r, l) => (this.updateMtime(), Reflect.set(n, r, l)), deleteProperty: (n, r) => (this.updateMtime(), Reflect.deleteProperty(n, r)) };
307
+ this._attributes = new Proxy(e.attributes || {}, s), delete this._data.attributes, i && (this._knownDavService = i);
309
308
  }
310
309
  get source() {
311
310
  return this._data.source.replace(/\/$/i, "");
312
311
  }
313
312
  get basename() {
314
- return F(this.source);
313
+ return dt(this.source);
315
314
  }
316
315
  get extension() {
317
- return S(this.source);
316
+ return ut(this.source);
318
317
  }
319
318
  get dirname() {
320
319
  if (this.root) {
321
- const r = this.source.indexOf(this.root);
322
- return d(this.source.slice(r + this.root.length) || "/");
320
+ const i = this.source.indexOf(this.root);
321
+ return _(this.source.slice(i + this.root.length) || "/");
323
322
  }
324
- const t = new URL(this.source);
325
- return d(t.pathname);
323
+ const e = new URL(this.source);
324
+ return _(e.pathname);
326
325
  }
327
326
  get mime() {
328
327
  return this._data.mime;
@@ -340,50 +339,50 @@ class I {
340
339
  return this._attributes;
341
340
  }
342
341
  get permissions() {
343
- return this.owner === null && !this.isDavRessource ? s.READ : this._data.permissions !== void 0 ? this._data.permissions : s.NONE;
342
+ return this.owner === null && !this.isDavRessource ? v.READ : this._data.permissions !== void 0 ? this._data.permissions : v.NONE;
344
343
  }
345
344
  get owner() {
346
345
  return this.isDavRessource ? this._data.owner : null;
347
346
  }
348
347
  get isDavRessource() {
349
- return b(this.source, this._knownDavService);
348
+ return Y(this.source, this._knownDavService);
350
349
  }
351
350
  get root() {
352
- return this._data.root ? this._data.root.replace(/^(.+)\/$/, "$1") : this.isDavRessource && d(this.source).split(this._knownDavService).pop() || null;
351
+ return this._data.root ? this._data.root.replace(/^(.+)\/$/, "$1") : this.isDavRessource && _(this.source).split(this._knownDavService).pop() || null;
353
352
  }
354
353
  get path() {
355
354
  if (this.root) {
356
- const t = this.source.indexOf(this.root);
357
- return this.source.slice(t + this.root.length) || "/";
355
+ const e = this.source.indexOf(this.root);
356
+ return this.source.slice(e + this.root.length) || "/";
358
357
  }
359
358
  return (this.dirname + "/" + this.basename).replace(/\/\//g, "/");
360
359
  }
361
360
  get fileid() {
362
361
  return this._data?.id || this.attributes?.fileid;
363
362
  }
364
- move(t) {
365
- g({ ...this._data, source: t }, this._knownDavService), this._data.source = t, this.updateMtime();
363
+ move(e) {
364
+ M({ ...this._data, source: e }, this._knownDavService), this._data.source = e, this.updateMtime();
366
365
  }
367
- rename(t) {
368
- if (t.includes("/"))
366
+ rename(e) {
367
+ if (e.includes("/"))
369
368
  throw new Error("Invalid basename");
370
- this.move(d(this.source) + "/" + t);
369
+ this.move(_(this.source) + "/" + e);
371
370
  }
372
371
  updateMtime() {
373
372
  this._data.mtime && (this._data.mtime = /* @__PURE__ */ new Date());
374
373
  }
375
374
  }
376
- class z extends I {
375
+ class yt extends Z {
377
376
  get type() {
378
- return h.File;
377
+ return $.File;
379
378
  }
380
379
  }
381
- class M extends I {
382
- constructor(t) {
383
- super({ ...t, mime: "httpd/unix-directory" });
380
+ class xt extends Z {
381
+ constructor(e) {
382
+ super({ ...e, mime: "httpd/unix-directory" });
384
383
  }
385
384
  get type() {
386
- return h.Folder;
385
+ return $.Folder;
387
386
  }
388
387
  get extension() {
389
388
  return null;
@@ -392,42 +391,42 @@ class M extends I {
392
391
  return "httpd/unix-directory";
393
392
  }
394
393
  }
395
- const x = `/files/${c()?.uid}`, k = _("dav"), le = function(e = k) {
396
- const t = $(e, { headers: { requesttoken: N() || "" } });
397
- return V().patch("request", (r) => (r.headers?.method && (r.method = r.headers.method, delete r.headers.method), C(r))), t;
398
- }, pe = async (e, t = "/", r = x) => (await e.getDirectoryContents(`${r}${t}`, { details: !0, data: P(), headers: { method: "REPORT" }, includeSelf: !0 })).data.filter((i) => i.filename !== t).map((i) => H(i, r)), H = function(e, t = x) {
399
- const r = e.props, i = B(r?.permissions), a = c()?.uid, n = { id: r?.fileid || 0, source: _(`dav${t}${e.filename}`), mtime: new Date(Date.parse(e.lastmod)), mime: e.mime, size: r?.size || Number.parseInt(r.getcontentlength || "0"), permissions: i, owner: a, root: t, attributes: { ...e, ...r, hasPreview: r?.["has-preview"] } };
400
- return delete n.attributes?.props, e.type === "file" ? new z(n) : new M(n);
394
+ const J = `/files/${A()?.uid}`, Q = ct("dav"), ri = function(t = Q) {
395
+ const e = ht(t, { headers: { requesttoken: ot() || "" } });
396
+ return pt().patch("request", (i) => (i.headers?.method && (i.method = i.headers.method, delete i.headers.method), ft(i))), e;
397
+ }, si = async (t, e = "/", i = J) => (await t.getDirectoryContents(`${i}${e}`, { details: !0, data: wt(), headers: { method: "REPORT" }, includeSelf: !0 })).data.filter((s) => s.filename !== e).map((s) => bt(s, i)), bt = function(t, e = J, i = Q) {
398
+ const s = t.props, n = vt(s?.permissions), r = A()?.uid, l = { id: s?.fileid || 0, source: `${i}${t.filename}`, mtime: new Date(Date.parse(t.lastmod)), mime: t.mime, size: s?.size || Number.parseInt(s.getcontentlength || "0"), permissions: n, owner: r, root: e, attributes: { ...t, ...s, hasPreview: s?.["has-preview"] } };
399
+ return delete l.attributes?.props, t.type === "file" ? new yt(l) : new xt(l);
401
400
  };
402
- class U {
401
+ class Et {
403
402
  _views = [];
404
403
  _currentView = null;
405
- register(t) {
406
- if (this._views.find((r) => r.id === t.id))
407
- throw new Error(`View id ${t.id} is already registered`);
408
- this._views.push(t);
404
+ register(e) {
405
+ if (this._views.find((i) => i.id === e.id))
406
+ throw new Error(`View id ${e.id} is already registered`);
407
+ this._views.push(e);
409
408
  }
410
- remove(t) {
411
- const r = this._views.findIndex((i) => i.id === t);
412
- r !== -1 && this._views.splice(r, 1);
409
+ remove(e) {
410
+ const i = this._views.findIndex((s) => s.id === e);
411
+ i !== -1 && this._views.splice(i, 1);
413
412
  }
414
413
  get views() {
415
414
  return this._views;
416
415
  }
417
- setActive(t) {
418
- this._currentView = t;
416
+ setActive(e) {
417
+ this._currentView = e;
419
418
  }
420
419
  get active() {
421
420
  return this._currentView;
422
421
  }
423
422
  }
424
- const fe = function() {
425
- return typeof window._nc_navigation > "u" && (window._nc_navigation = new U(), o.debug("Navigation service initialized")), window._nc_navigation;
423
+ const oi = function() {
424
+ return typeof window._nc_navigation > "u" && (window._nc_navigation = new Et(), m.debug("Navigation service initialized")), window._nc_navigation;
426
425
  };
427
- class O {
426
+ class Nt {
428
427
  _column;
429
- constructor(t) {
430
- K(t), this._column = t;
428
+ constructor(e) {
429
+ _t(e), this._column = e;
431
430
  }
432
431
  get id() {
433
432
  return this._column.id;
@@ -445,23 +444,875 @@ class O {
445
444
  return this._column.summary;
446
445
  }
447
446
  }
448
- const K = function(e) {
449
- if (!e.id || typeof e.id != "string")
447
+ const _t = function(t) {
448
+ if (!t.id || typeof t.id != "string")
450
449
  throw new Error("A column id is required");
451
- if (!e.title || typeof e.title != "string")
450
+ if (!t.title || typeof t.title != "string")
452
451
  throw new Error("A column title is required");
453
- if (!e.render || typeof e.render != "function")
452
+ if (!t.render || typeof t.render != "function")
454
453
  throw new Error("A render function is required");
455
- if (e.sort && typeof e.sort != "function")
454
+ if (t.sort && typeof t.sort != "function")
456
455
  throw new Error("Column sortFunction must be a function");
457
- if (e.summary && typeof e.summary != "function")
456
+ if (t.summary && typeof t.summary != "function")
458
457
  throw new Error("Column summary must be a function");
459
458
  return !0;
460
459
  };
461
- class we {
462
- _view;
460
+ var k = {}, T = {};
461
+ (function(t) {
462
+ const e = ":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", i = e + "\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040", s = "[" + e + "][" + i + "]*", n = new RegExp("^" + s + "$"), r = function(o, a) {
463
+ const d = [];
464
+ let u = a.exec(o);
465
+ for (; u; ) {
466
+ const h = [];
467
+ h.startIndex = a.lastIndex - u[0].length;
468
+ const c = u.length;
469
+ for (let f = 0; f < c; f++)
470
+ h.push(u[f]);
471
+ d.push(h), u = a.exec(o);
472
+ }
473
+ return d;
474
+ }, l = function(o) {
475
+ const a = n.exec(o);
476
+ return !(a === null || typeof a > "u");
477
+ };
478
+ t.isExist = function(o) {
479
+ return typeof o < "u";
480
+ }, t.isEmptyObject = function(o) {
481
+ return Object.keys(o).length === 0;
482
+ }, t.merge = function(o, a, d) {
483
+ if (a) {
484
+ const u = Object.keys(a), h = u.length;
485
+ for (let c = 0; c < h; c++)
486
+ d === "strict" ? o[u[c]] = [a[u[c]]] : o[u[c]] = a[u[c]];
487
+ }
488
+ }, t.getValue = function(o) {
489
+ return t.isExist(o) ? o : "";
490
+ }, t.isName = l, t.getAllMatches = r, t.nameRegexp = s;
491
+ })(T);
492
+ const R = T, At = { allowBooleanAttributes: !1, unpairedTags: [] };
493
+ k.validate = function(t, e) {
494
+ e = Object.assign({}, At, e);
495
+ const i = [];
496
+ let s = !1, n = !1;
497
+ t[0] === "\uFEFF" && (t = t.substr(1));
498
+ for (let r = 0; r < t.length; r++)
499
+ if (t[r] === "<" && t[r + 1] === "?") {
500
+ if (r += 2, r = q(t, r), r.err)
501
+ return r;
502
+ } else if (t[r] === "<") {
503
+ let l = r;
504
+ if (r++, t[r] === "!") {
505
+ r = U(t, r);
506
+ continue;
507
+ } else {
508
+ let o = !1;
509
+ t[r] === "/" && (o = !0, r++);
510
+ let a = "";
511
+ for (; r < t.length && t[r] !== ">" && t[r] !== " " && t[r] !== " " && t[r] !== `
512
+ ` && t[r] !== "\r"; r++)
513
+ a += t[r];
514
+ if (a = a.trim(), a[a.length - 1] === "/" && (a = a.substring(0, a.length - 1), r--), !Ft(a)) {
515
+ let h;
516
+ return a.trim().length === 0 ? h = "Invalid space after '<'." : h = "Tag '" + a + "' is an invalid name.", p("InvalidTag", h, g(t, r));
517
+ }
518
+ const d = Pt(t, r);
519
+ if (d === !1)
520
+ return p("InvalidAttr", "Attributes for '" + a + "' have open quote.", g(t, r));
521
+ let u = d.value;
522
+ if (r = d.index, u[u.length - 1] === "/") {
523
+ const h = r - u.length;
524
+ u = u.substring(0, u.length - 1);
525
+ const c = z(u, e);
526
+ if (c === !0)
527
+ s = !0;
528
+ else
529
+ return p(c.err.code, c.err.msg, g(t, h + c.err.line));
530
+ } else if (o)
531
+ if (d.tagClosed) {
532
+ if (u.trim().length > 0)
533
+ return p("InvalidTag", "Closing tag '" + a + "' can't have attributes or invalid starting.", g(t, l));
534
+ {
535
+ const h = i.pop();
536
+ if (a !== h.tagName) {
537
+ let c = g(t, h.tagStartPos);
538
+ return p("InvalidTag", "Expected closing tag '" + h.tagName + "' (opened in line " + c.line + ", col " + c.col + ") instead of closing tag '" + a + "'.", g(t, l));
539
+ }
540
+ i.length == 0 && (n = !0);
541
+ }
542
+ } else
543
+ return p("InvalidTag", "Closing tag '" + a + "' doesn't have proper closing.", g(t, r));
544
+ else {
545
+ const h = z(u, e);
546
+ if (h !== !0)
547
+ return p(h.err.code, h.err.msg, g(t, r - u.length + h.err.line));
548
+ if (n === !0)
549
+ return p("InvalidXml", "Multiple possible root nodes found.", g(t, r));
550
+ e.unpairedTags.indexOf(a) !== -1 || i.push({ tagName: a, tagStartPos: l }), s = !0;
551
+ }
552
+ for (r++; r < t.length; r++)
553
+ if (t[r] === "<")
554
+ if (t[r + 1] === "!") {
555
+ r++, r = U(t, r);
556
+ continue;
557
+ } else if (t[r + 1] === "?") {
558
+ if (r = q(t, ++r), r.err)
559
+ return r;
560
+ } else
561
+ break;
562
+ else if (t[r] === "&") {
563
+ const h = Dt(t, r);
564
+ if (h == -1)
565
+ return p("InvalidChar", "char '&' is not expected.", g(t, r));
566
+ r = h;
567
+ } else if (n === !0 && !B(t[r]))
568
+ return p("InvalidXml", "Extra text at the end", g(t, r));
569
+ t[r] === "<" && r--;
570
+ }
571
+ } else {
572
+ if (B(t[r]))
573
+ continue;
574
+ return p("InvalidChar", "char '" + t[r] + "' is not expected.", g(t, r));
575
+ }
576
+ if (s) {
577
+ if (i.length == 1)
578
+ return p("InvalidTag", "Unclosed tag '" + i[0].tagName + "'.", g(t, i[0].tagStartPos));
579
+ if (i.length > 0)
580
+ return p("InvalidXml", "Invalid '" + JSON.stringify(i.map((r) => r.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
581
+ } else
582
+ return p("InvalidXml", "Start tag expected.", 1);
583
+ return !0;
584
+ };
585
+ function B(t) {
586
+ return t === " " || t === " " || t === `
587
+ ` || t === "\r";
588
+ }
589
+ function q(t, e) {
590
+ const i = e;
591
+ for (; e < t.length; e++)
592
+ if (t[e] == "?" || t[e] == " ") {
593
+ const s = t.substr(i, e - i);
594
+ if (e > 5 && s === "xml")
595
+ return p("InvalidXml", "XML declaration allowed only at the start of the document.", g(t, e));
596
+ if (t[e] == "?" && t[e + 1] == ">") {
597
+ e++;
598
+ break;
599
+ } else
600
+ continue;
601
+ }
602
+ return e;
603
+ }
604
+ function U(t, e) {
605
+ if (t.length > e + 5 && t[e + 1] === "-" && t[e + 2] === "-") {
606
+ for (e += 3; e < t.length; e++)
607
+ if (t[e] === "-" && t[e + 1] === "-" && t[e + 2] === ">") {
608
+ e += 2;
609
+ break;
610
+ }
611
+ } else if (t.length > e + 8 && t[e + 1] === "D" && t[e + 2] === "O" && t[e + 3] === "C" && t[e + 4] === "T" && t[e + 5] === "Y" && t[e + 6] === "P" && t[e + 7] === "E") {
612
+ let i = 1;
613
+ for (e += 8; e < t.length; e++)
614
+ if (t[e] === "<")
615
+ i++;
616
+ else if (t[e] === ">" && (i--, i === 0))
617
+ break;
618
+ } else if (t.length > e + 9 && t[e + 1] === "[" && t[e + 2] === "C" && t[e + 3] === "D" && t[e + 4] === "A" && t[e + 5] === "T" && t[e + 6] === "A" && t[e + 7] === "[") {
619
+ for (e += 8; e < t.length; e++)
620
+ if (t[e] === "]" && t[e + 1] === "]" && t[e + 2] === ">") {
621
+ e += 2;
622
+ break;
623
+ }
624
+ }
625
+ return e;
626
+ }
627
+ const Tt = '"', It = "'";
628
+ function Pt(t, e) {
629
+ let i = "", s = "", n = !1;
630
+ for (; e < t.length; e++) {
631
+ if (t[e] === Tt || t[e] === It)
632
+ s === "" ? s = t[e] : s !== t[e] || (s = "");
633
+ else if (t[e] === ">" && s === "") {
634
+ n = !0;
635
+ break;
636
+ }
637
+ i += t[e];
638
+ }
639
+ return s !== "" ? !1 : { value: i, index: e, tagClosed: n };
640
+ }
641
+ const Ot = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
642
+ function z(t, e) {
643
+ const i = R.getAllMatches(t, Ot), s = {};
644
+ for (let n = 0; n < i.length; n++) {
645
+ if (i[n][1].length === 0)
646
+ return p("InvalidAttr", "Attribute '" + i[n][2] + "' has no space in starting.", b(i[n]));
647
+ if (i[n][3] !== void 0 && i[n][4] === void 0)
648
+ return p("InvalidAttr", "Attribute '" + i[n][2] + "' is without value.", b(i[n]));
649
+ if (i[n][3] === void 0 && !e.allowBooleanAttributes)
650
+ return p("InvalidAttr", "boolean attribute '" + i[n][2] + "' is not allowed.", b(i[n]));
651
+ const r = i[n][2];
652
+ if (!St(r))
653
+ return p("InvalidAttr", "Attribute '" + r + "' is an invalid name.", b(i[n]));
654
+ if (!s.hasOwnProperty(r))
655
+ s[r] = 1;
656
+ else
657
+ return p("InvalidAttr", "Attribute '" + r + "' is repeated.", b(i[n]));
658
+ }
659
+ return !0;
660
+ }
661
+ function Ct(t, e) {
662
+ let i = /\d/;
663
+ for (t[e] === "x" && (e++, i = /[\da-fA-F]/); e < t.length; e++) {
664
+ if (t[e] === ";")
665
+ return e;
666
+ if (!t[e].match(i))
667
+ break;
668
+ }
669
+ return -1;
670
+ }
671
+ function Dt(t, e) {
672
+ if (e++, t[e] === ";")
673
+ return -1;
674
+ if (t[e] === "#")
675
+ return e++, Ct(t, e);
676
+ let i = 0;
677
+ for (; e < t.length; e++, i++)
678
+ if (!(t[e].match(/\w/) && i < 20)) {
679
+ if (t[e] === ";")
680
+ break;
681
+ return -1;
682
+ }
683
+ return e;
684
+ }
685
+ function p(t, e, i) {
686
+ return { err: { code: t, msg: e, line: i.line || i, col: i.col } };
687
+ }
688
+ function St(t) {
689
+ return R.isName(t);
690
+ }
691
+ function Ft(t) {
692
+ return R.isName(t);
693
+ }
694
+ function g(t, e) {
695
+ const i = t.substring(0, e).split(/\r?\n/);
696
+ return { line: i.length, col: i[i.length - 1].length + 1 };
697
+ }
698
+ function b(t) {
699
+ return t.startIndex + t[1].length;
700
+ }
701
+ var O = {};
702
+ const tt = { 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(t, e) {
703
+ return e;
704
+ }, attributeValueProcessor: function(t, e) {
705
+ return e;
706
+ }, stopNodes: [], alwaysCreateTextNode: !1, isArray: () => !1, commentPropName: !1, unpairedTags: [], processEntities: !0, htmlEntities: !1, ignoreDeclaration: !1, ignorePiTags: !1, transformTagName: !1, transformAttributeName: !1, updateTag: function(t, e, i) {
707
+ return t;
708
+ } }, Vt = function(t) {
709
+ return Object.assign({}, tt, t);
710
+ };
711
+ O.buildOptions = Vt, O.defaultOptions = tt;
712
+ class $t {
713
+ constructor(e) {
714
+ this.tagname = e, this.child = [], this[":@"] = {};
715
+ }
716
+ add(e, i) {
717
+ e === "__proto__" && (e = "#__proto__"), this.child.push({ [e]: i });
718
+ }
719
+ addChild(e) {
720
+ e.tagname === "__proto__" && (e.tagname = "#__proto__"), e[":@"] && Object.keys(e[":@"]).length > 0 ? this.child.push({ [e.tagname]: e.child, ":@": e[":@"] }) : this.child.push({ [e.tagname]: e.child });
721
+ }
722
+ }
723
+ var kt = $t;
724
+ const Rt = T;
725
+ function Lt(t, e) {
726
+ const i = {};
727
+ 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") {
728
+ e = e + 9;
729
+ let s = 1, n = !1, r = !1, l = "";
730
+ for (; e < t.length; e++)
731
+ if (t[e] === "<" && !r) {
732
+ if (n && Bt(t, e))
733
+ e += 7, [entityName, val, e] = jt(t, e + 1), val.indexOf("&") === -1 && (i[Gt(entityName)] = { regx: RegExp(`&${entityName};`, "g"), val });
734
+ else if (n && qt(t, e))
735
+ e += 8;
736
+ else if (n && Ut(t, e))
737
+ e += 8;
738
+ else if (n && zt(t, e))
739
+ e += 9;
740
+ else if (Mt)
741
+ r = !0;
742
+ else
743
+ throw new Error("Invalid DOCTYPE");
744
+ s++, l = "";
745
+ } else if (t[e] === ">") {
746
+ if (r ? t[e - 1] === "-" && t[e - 2] === "-" && (r = !1, s--) : s--, s === 0)
747
+ break;
748
+ } else
749
+ t[e] === "[" ? n = !0 : l += t[e];
750
+ if (s !== 0)
751
+ throw new Error("Unclosed DOCTYPE");
752
+ } else
753
+ throw new Error("Invalid Tag instead of DOCTYPE");
754
+ return { entities: i, i: e };
755
+ }
756
+ function jt(t, e) {
757
+ let i = "";
758
+ for (; e < t.length && t[e] !== "'" && t[e] !== '"'; e++)
759
+ i += t[e];
760
+ if (i = i.trim(), i.indexOf(" ") !== -1)
761
+ throw new Error("External entites are not supported");
762
+ const s = t[e++];
763
+ let n = "";
764
+ for (; e < t.length && t[e] !== s; e++)
765
+ n += t[e];
766
+ return [i, n, e];
767
+ }
768
+ function Mt(t, e) {
769
+ return t[e + 1] === "!" && t[e + 2] === "-" && t[e + 3] === "-";
770
+ }
771
+ function Bt(t, e) {
772
+ return t[e + 1] === "!" && t[e + 2] === "E" && t[e + 3] === "N" && t[e + 4] === "T" && t[e + 5] === "I" && t[e + 6] === "T" && t[e + 7] === "Y";
773
+ }
774
+ function qt(t, e) {
775
+ return t[e + 1] === "!" && t[e + 2] === "E" && t[e + 3] === "L" && t[e + 4] === "E" && t[e + 5] === "M" && t[e + 6] === "E" && t[e + 7] === "N" && t[e + 8] === "T";
776
+ }
777
+ function Ut(t, e) {
778
+ return t[e + 1] === "!" && t[e + 2] === "A" && t[e + 3] === "T" && t[e + 4] === "T" && t[e + 5] === "L" && t[e + 6] === "I" && t[e + 7] === "S" && t[e + 8] === "T";
779
+ }
780
+ function zt(t, e) {
781
+ return t[e + 1] === "!" && t[e + 2] === "N" && t[e + 3] === "O" && t[e + 4] === "T" && t[e + 5] === "A" && t[e + 6] === "T" && t[e + 7] === "I" && t[e + 8] === "O" && t[e + 9] === "N";
782
+ }
783
+ function Gt(t) {
784
+ if (Rt.isName(t))
785
+ return t;
786
+ throw new Error(`Invalid entity name ${t}`);
787
+ }
788
+ var Xt = Lt;
789
+ const Ht = /^[-+]?0x[a-fA-F0-9]+$/, Kt = /^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;
790
+ !Number.parseInt && window.parseInt && (Number.parseInt = window.parseInt), !Number.parseFloat && window.parseFloat && (Number.parseFloat = window.parseFloat);
791
+ const Wt = { hex: !0, leadingZeros: !0, decimalPoint: ".", eNotation: !0 };
792
+ function Yt(t, e = {}) {
793
+ if (e = Object.assign({}, Wt, e), !t || typeof t != "string")
794
+ return t;
795
+ let i = t.trim();
796
+ if (e.skipLike !== void 0 && e.skipLike.test(i))
797
+ return t;
798
+ if (e.hex && Ht.test(i))
799
+ return Number.parseInt(i, 16);
800
+ {
801
+ const s = Kt.exec(i);
802
+ if (s) {
803
+ const n = s[1], r = s[2];
804
+ let l = Zt(s[3]);
805
+ const o = s[4] || s[6];
806
+ if (!e.leadingZeros && r.length > 0 && n && i[2] !== "." || !e.leadingZeros && r.length > 0 && !n && i[1] !== ".")
807
+ return t;
808
+ {
809
+ const a = Number(i), d = "" + a;
810
+ return d.search(/[eE]/) !== -1 || o ? e.eNotation ? a : t : i.indexOf(".") !== -1 ? d === "0" && l === "" || d === l || n && d === "-" + l ? a : t : r ? l === d || n + l === d ? a : t : i === d || i === n + d ? a : t;
811
+ }
812
+ } else
813
+ return t;
814
+ }
815
+ }
816
+ function Zt(t) {
817
+ return t && t.indexOf(".") !== -1 && (t = t.replace(/0+$/, ""), t === "." ? t = "0" : t[0] === "." ? t = "0" + t : t[t.length - 1] === "." && (t = t.substr(0, t.length - 1))), t;
818
+ }
819
+ var Jt = Yt;
820
+ const L = T, E = kt, Qt = Xt, te = Jt;
821
+ "<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g, L.nameRegexp);
822
+ let ee = class {
463
823
  constructor(t) {
464
- G(t), this._view = t;
824
+ 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: "₹" } }, this.addExternalEntities = ie, this.parseXml = ae, this.parseTextData = ne, this.resolveNameSpace = re, this.buildAttributesMap = oe, this.isItStopNode = ce, this.replaceEntitiesValue = de, this.readStopNodeData = pe, this.saveTextToParentTag = ue, this.addChild = le;
825
+ }
826
+ };
827
+ function ie(t) {
828
+ const e = Object.keys(t);
829
+ for (let i = 0; i < e.length; i++) {
830
+ const s = e[i];
831
+ this.lastEntities[s] = { regex: new RegExp("&" + s + ";", "g"), val: t[s] };
832
+ }
833
+ }
834
+ function ne(t, e, i, s, n, r, l) {
835
+ if (t !== void 0 && (this.options.trimValues && !s && (t = t.trim()), t.length > 0)) {
836
+ l || (t = this.replaceEntitiesValue(t));
837
+ const o = this.options.tagValueProcessor(e, t, i, n, r);
838
+ return o == null ? t : typeof o != typeof t || o !== t ? o : this.options.trimValues ? D(t, this.options.parseTagValue, this.options.numberParseOptions) : t.trim() === t ? D(t, this.options.parseTagValue, this.options.numberParseOptions) : t;
839
+ }
840
+ }
841
+ function re(t) {
842
+ if (this.options.removeNSPrefix) {
843
+ const e = t.split(":"), i = t.charAt(0) === "/" ? "/" : "";
844
+ if (e[0] === "xmlns")
845
+ return "";
846
+ e.length === 2 && (t = i + e[1]);
847
+ }
848
+ return t;
849
+ }
850
+ const se = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
851
+ function oe(t, e, i) {
852
+ if (!this.options.ignoreAttributes && typeof t == "string") {
853
+ const s = L.getAllMatches(t, se), n = s.length, r = {};
854
+ for (let l = 0; l < n; l++) {
855
+ const o = this.resolveNameSpace(s[l][1]);
856
+ let a = s[l][4], d = this.options.attributeNamePrefix + o;
857
+ if (o.length)
858
+ if (this.options.transformAttributeName && (d = this.options.transformAttributeName(d)), d === "__proto__" && (d = "#__proto__"), a !== void 0) {
859
+ this.options.trimValues && (a = a.trim()), a = this.replaceEntitiesValue(a);
860
+ const u = this.options.attributeValueProcessor(o, a, e);
861
+ u == null ? r[d] = a : typeof u != typeof a || u !== a ? r[d] = u : r[d] = D(a, this.options.parseAttributeValue, this.options.numberParseOptions);
862
+ } else
863
+ this.options.allowBooleanAttributes && (r[d] = !0);
864
+ }
865
+ if (!Object.keys(r).length)
866
+ return;
867
+ if (this.options.attributesGroupName) {
868
+ const l = {};
869
+ return l[this.options.attributesGroupName] = r, l;
870
+ }
871
+ return r;
872
+ }
873
+ }
874
+ const ae = function(t) {
875
+ t = t.replace(/\r\n?/g, `
876
+ `);
877
+ const e = new E("!xml");
878
+ let i = e, s = "", n = "";
879
+ for (let r = 0; r < t.length; r++)
880
+ if (t[r] === "<")
881
+ if (t[r + 1] === "/") {
882
+ const l = x(t, ">", r, "Closing Tag is not closed.");
883
+ let o = t.substring(r + 2, l).trim();
884
+ if (this.options.removeNSPrefix) {
885
+ const u = o.indexOf(":");
886
+ u !== -1 && (o = o.substr(u + 1));
887
+ }
888
+ this.options.transformTagName && (o = this.options.transformTagName(o)), i && (s = this.saveTextToParentTag(s, i, n));
889
+ const a = n.substring(n.lastIndexOf(".") + 1);
890
+ if (o && this.options.unpairedTags.indexOf(o) !== -1)
891
+ throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);
892
+ let d = 0;
893
+ a && this.options.unpairedTags.indexOf(a) !== -1 ? (d = n.lastIndexOf(".", n.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : d = n.lastIndexOf("."), n = n.substring(0, d), i = this.tagsNodeStack.pop(), s = "", r = l;
894
+ } else if (t[r + 1] === "?") {
895
+ let l = C(t, r, !1, "?>");
896
+ if (!l)
897
+ throw new Error("Pi Tag is not closed.");
898
+ if (s = this.saveTextToParentTag(s, i, n), !(this.options.ignoreDeclaration && l.tagName === "?xml" || this.options.ignorePiTags)) {
899
+ const o = new E(l.tagName);
900
+ o.add(this.options.textNodeName, ""), l.tagName !== l.tagExp && l.attrExpPresent && (o[":@"] = this.buildAttributesMap(l.tagExp, n, l.tagName)), this.addChild(i, o, n);
901
+ }
902
+ r = l.closeIndex + 1;
903
+ } else if (t.substr(r + 1, 3) === "!--") {
904
+ const l = x(t, "-->", r + 4, "Comment is not closed.");
905
+ if (this.options.commentPropName) {
906
+ const o = t.substring(r + 4, l - 2);
907
+ s = this.saveTextToParentTag(s, i, n), i.add(this.options.commentPropName, [{ [this.options.textNodeName]: o }]);
908
+ }
909
+ r = l;
910
+ } else if (t.substr(r + 1, 2) === "!D") {
911
+ const l = Qt(t, r);
912
+ this.docTypeEntities = l.entities, r = l.i;
913
+ } else if (t.substr(r + 1, 2) === "![") {
914
+ const l = x(t, "]]>", r, "CDATA is not closed.") - 2, o = t.substring(r + 9, l);
915
+ if (s = this.saveTextToParentTag(s, i, n), this.options.cdataPropName)
916
+ i.add(this.options.cdataPropName, [{ [this.options.textNodeName]: o }]);
917
+ else {
918
+ let a = this.parseTextData(o, i.tagname, n, !0, !1, !0);
919
+ a == null && (a = ""), i.add(this.options.textNodeName, a);
920
+ }
921
+ r = l + 2;
922
+ } else {
923
+ let l = C(t, r, this.options.removeNSPrefix), o = l.tagName, a = l.tagExp, d = l.attrExpPresent, u = l.closeIndex;
924
+ this.options.transformTagName && (o = this.options.transformTagName(o)), i && s && i.tagname !== "!xml" && (s = this.saveTextToParentTag(s, i, n, !1));
925
+ const h = i;
926
+ if (h && this.options.unpairedTags.indexOf(h.tagname) !== -1 && (i = this.tagsNodeStack.pop(), n = n.substring(0, n.lastIndexOf("."))), o !== e.tagname && (n += n ? "." + o : o), this.isItStopNode(this.options.stopNodes, n, o)) {
927
+ let c = "";
928
+ if (a.length > 0 && a.lastIndexOf("/") === a.length - 1)
929
+ r = l.closeIndex;
930
+ else if (this.options.unpairedTags.indexOf(o) !== -1)
931
+ r = l.closeIndex;
932
+ else {
933
+ const w = this.readStopNodeData(t, o, u + 1);
934
+ if (!w)
935
+ throw new Error(`Unexpected end of ${o}`);
936
+ r = w.i, c = w.tagContent;
937
+ }
938
+ const f = new E(o);
939
+ o !== a && d && (f[":@"] = this.buildAttributesMap(a, n, o)), c && (c = this.parseTextData(c, o, n, !0, d, !0, !0)), n = n.substr(0, n.lastIndexOf(".")), f.add(this.options.textNodeName, c), this.addChild(i, f, n);
940
+ } else {
941
+ if (a.length > 0 && a.lastIndexOf("/") === a.length - 1) {
942
+ o[o.length - 1] === "/" ? (o = o.substr(0, o.length - 1), n = n.substr(0, n.length - 1), a = o) : a = a.substr(0, a.length - 1), this.options.transformTagName && (o = this.options.transformTagName(o));
943
+ const c = new E(o);
944
+ o !== a && d && (c[":@"] = this.buildAttributesMap(a, n, o)), this.addChild(i, c, n), n = n.substr(0, n.lastIndexOf("."));
945
+ } else {
946
+ const c = new E(o);
947
+ this.tagsNodeStack.push(i), o !== a && d && (c[":@"] = this.buildAttributesMap(a, n, o)), this.addChild(i, c, n), i = c;
948
+ }
949
+ s = "", r = u;
950
+ }
951
+ }
952
+ else
953
+ s += t[r];
954
+ return e.child;
955
+ };
956
+ function le(t, e, i) {
957
+ const s = this.options.updateTag(e.tagname, i, e[":@"]);
958
+ s === !1 || (typeof s == "string" && (e.tagname = s), t.addChild(e));
959
+ }
960
+ const de = function(t) {
961
+ if (this.options.processEntities) {
962
+ for (let e in this.docTypeEntities) {
963
+ const i = this.docTypeEntities[e];
964
+ t = t.replace(i.regx, i.val);
965
+ }
966
+ for (let e in this.lastEntities) {
967
+ const i = this.lastEntities[e];
968
+ t = t.replace(i.regex, i.val);
969
+ }
970
+ if (this.options.htmlEntities)
971
+ for (let e in this.htmlEntities) {
972
+ const i = this.htmlEntities[e];
973
+ t = t.replace(i.regex, i.val);
974
+ }
975
+ t = t.replace(this.ampEntity.regex, this.ampEntity.val);
976
+ }
977
+ return t;
978
+ };
979
+ function ue(t, e, i, s) {
980
+ return t && (s === void 0 && (s = Object.keys(e.child).length === 0), t = this.parseTextData(t, e.tagname, i, !1, e[":@"] ? Object.keys(e[":@"]).length !== 0 : !1, s), t !== void 0 && t !== "" && e.add(this.options.textNodeName, t), t = ""), t;
981
+ }
982
+ function ce(t, e, i) {
983
+ const s = "*." + i;
984
+ for (const n in t) {
985
+ const r = t[n];
986
+ if (s === r || e === r)
987
+ return !0;
988
+ }
989
+ return !1;
990
+ }
991
+ function he(t, e, i = ">") {
992
+ let s, n = "";
993
+ for (let r = e; r < t.length; r++) {
994
+ let l = t[r];
995
+ if (s)
996
+ l === s && (s = "");
997
+ else if (l === '"' || l === "'")
998
+ s = l;
999
+ else if (l === i[0])
1000
+ if (i[1]) {
1001
+ if (t[r + 1] === i[1])
1002
+ return { data: n, index: r };
1003
+ } else
1004
+ return { data: n, index: r };
1005
+ else
1006
+ l === " " && (l = " ");
1007
+ n += l;
1008
+ }
1009
+ }
1010
+ function x(t, e, i, s) {
1011
+ const n = t.indexOf(e, i);
1012
+ if (n === -1)
1013
+ throw new Error(s);
1014
+ return n + e.length - 1;
1015
+ }
1016
+ function C(t, e, i, s = ">") {
1017
+ const n = he(t, e + 1, s);
1018
+ if (!n)
1019
+ return;
1020
+ let r = n.data;
1021
+ const l = n.index, o = r.search(/\s/);
1022
+ let a = r, d = !0;
1023
+ if (o !== -1 && (a = r.substr(0, o).replace(/\s\s*$/, ""), r = r.substr(o + 1)), i) {
1024
+ const u = a.indexOf(":");
1025
+ u !== -1 && (a = a.substr(u + 1), d = a !== n.data.substr(u + 1));
1026
+ }
1027
+ return { tagName: a, tagExp: r, closeIndex: l, attrExpPresent: d };
1028
+ }
1029
+ function pe(t, e, i) {
1030
+ const s = i;
1031
+ let n = 1;
1032
+ for (; i < t.length; i++)
1033
+ if (t[i] === "<")
1034
+ if (t[i + 1] === "/") {
1035
+ const r = x(t, ">", i, `${e} is not closed`);
1036
+ if (t.substring(i + 2, r).trim() === e && (n--, n === 0))
1037
+ return { tagContent: t.substring(s, i), i: r };
1038
+ i = r;
1039
+ } else if (t[i + 1] === "?")
1040
+ i = x(t, "?>", i + 1, "StopNode is not closed.");
1041
+ else if (t.substr(i + 1, 3) === "!--")
1042
+ i = x(t, "-->", i + 3, "StopNode is not closed.");
1043
+ else if (t.substr(i + 1, 2) === "![")
1044
+ i = x(t, "]]>", i, "StopNode is not closed.") - 2;
1045
+ else {
1046
+ const r = C(t, i, ">");
1047
+ r && ((r && r.tagName) === e && r.tagExp[r.tagExp.length - 1] !== "/" && n++, i = r.closeIndex);
1048
+ }
1049
+ }
1050
+ function D(t, e, i) {
1051
+ if (e && typeof t == "string") {
1052
+ const s = t.trim();
1053
+ return s === "true" ? !0 : s === "false" ? !1 : te(t, i);
1054
+ } else
1055
+ return L.isExist(t) ? t : "";
1056
+ }
1057
+ var fe = ee, et = {};
1058
+ function ge(t, e) {
1059
+ return it(t, e);
1060
+ }
1061
+ function it(t, e, i) {
1062
+ let s;
1063
+ const n = {};
1064
+ for (let r = 0; r < t.length; r++) {
1065
+ const l = t[r], o = me(l);
1066
+ let a = "";
1067
+ if (i === void 0 ? a = o : a = i + "." + o, o === e.textNodeName)
1068
+ s === void 0 ? s = l[o] : s += "" + l[o];
1069
+ else {
1070
+ if (o === void 0)
1071
+ continue;
1072
+ if (l[o]) {
1073
+ let d = it(l[o], e, a);
1074
+ const u = ve(d, e);
1075
+ l[":@"] ? we(d, l[":@"], a, e) : Object.keys(d).length === 1 && d[e.textNodeName] !== void 0 && !e.alwaysCreateTextNode ? d = d[e.textNodeName] : Object.keys(d).length === 0 && (e.alwaysCreateTextNode ? d[e.textNodeName] = "" : d = ""), n[o] !== void 0 && n.hasOwnProperty(o) ? (Array.isArray(n[o]) || (n[o] = [n[o]]), n[o].push(d)) : e.isArray(o, a, u) ? n[o] = [d] : n[o] = d;
1076
+ }
1077
+ }
1078
+ }
1079
+ return typeof s == "string" ? s.length > 0 && (n[e.textNodeName] = s) : s !== void 0 && (n[e.textNodeName] = s), n;
1080
+ }
1081
+ function me(t) {
1082
+ const e = Object.keys(t);
1083
+ for (let i = 0; i < e.length; i++) {
1084
+ const s = e[i];
1085
+ if (s !== ":@")
1086
+ return s;
1087
+ }
1088
+ }
1089
+ function we(t, e, i, s) {
1090
+ if (e) {
1091
+ const n = Object.keys(e), r = n.length;
1092
+ for (let l = 0; l < r; l++) {
1093
+ const o = n[l];
1094
+ s.isArray(o, i + "." + o, !0, !0) ? t[o] = [e[o]] : t[o] = e[o];
1095
+ }
1096
+ }
1097
+ }
1098
+ function ve(t, e) {
1099
+ const { textNodeName: i } = e, s = Object.keys(t).length;
1100
+ return !!(s === 0 || s === 1 && (t[i] || typeof t[i] == "boolean" || t[i] === 0));
1101
+ }
1102
+ et.prettify = ge;
1103
+ const { buildOptions: ye } = O, xe = fe, { prettify: be } = et, Ee = k;
1104
+ let Ne = class {
1105
+ constructor(t) {
1106
+ this.externalEntities = {}, this.options = ye(t);
1107
+ }
1108
+ parse(t, e) {
1109
+ if (typeof t != "string")
1110
+ if (t.toString)
1111
+ t = t.toString();
1112
+ else
1113
+ throw new Error("XML data is accepted in String or Bytes[] form.");
1114
+ if (e) {
1115
+ e === !0 && (e = {});
1116
+ const n = Ee.validate(t, e);
1117
+ if (n !== !0)
1118
+ throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`);
1119
+ }
1120
+ const i = new xe(this.options);
1121
+ i.addExternalEntities(this.externalEntities);
1122
+ const s = i.parseXml(t);
1123
+ return this.options.preserveOrder || s === void 0 ? s : be(s, this.options);
1124
+ }
1125
+ addEntity(t, e) {
1126
+ if (e.indexOf("&") !== -1)
1127
+ throw new Error("Entity value can't have '&'");
1128
+ if (t.indexOf("&") !== -1 || t.indexOf(";") !== -1)
1129
+ throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");
1130
+ if (e === "&")
1131
+ throw new Error("An entity with value '&' is not permitted");
1132
+ this.externalEntities[t] = e;
1133
+ }
1134
+ };
1135
+ var _e = Ne;
1136
+ const Ae = `
1137
+ `;
1138
+ function Te(t, e) {
1139
+ let i = "";
1140
+ return e.format && e.indentBy.length > 0 && (i = Ae), nt(t, e, "", i);
1141
+ }
1142
+ function nt(t, e, i, s) {
1143
+ let n = "", r = !1;
1144
+ for (let l = 0; l < t.length; l++) {
1145
+ const o = t[l], a = Ie(o);
1146
+ let d = "";
1147
+ if (i.length === 0 ? d = a : d = `${i}.${a}`, a === e.textNodeName) {
1148
+ let w = o[a];
1149
+ Pe(d, e) || (w = e.tagValueProcessor(a, w), w = rt(w, e)), r && (n += s), n += w, r = !1;
1150
+ continue;
1151
+ } else if (a === e.cdataPropName) {
1152
+ r && (n += s), n += `<![CDATA[${o[a][0][e.textNodeName]}]]>`, r = !1;
1153
+ continue;
1154
+ } else if (a === e.commentPropName) {
1155
+ n += s + `<!--${o[a][0][e.textNodeName]}-->`, r = !0;
1156
+ continue;
1157
+ } else if (a[0] === "?") {
1158
+ const w = G(o[":@"], e), st = a === "?xml" ? "" : s;
1159
+ let N = o[a][0][e.textNodeName];
1160
+ N = N.length !== 0 ? " " + N : "", n += st + `<${a}${N}${w}?>`, r = !0;
1161
+ continue;
1162
+ }
1163
+ let u = s;
1164
+ u !== "" && (u += e.indentBy);
1165
+ const h = G(o[":@"], e), c = s + `<${a}${h}`, f = nt(o[a], e, d, u);
1166
+ e.unpairedTags.indexOf(a) !== -1 ? e.suppressUnpairedNode ? n += c + ">" : n += c + "/>" : (!f || f.length === 0) && e.suppressEmptyNode ? n += c + "/>" : f && f.endsWith(">") ? n += c + `>${f}${s}</${a}>` : (n += c + ">", f && s !== "" && (f.includes("/>") || f.includes("</")) ? n += s + e.indentBy + f + s : n += f, n += `</${a}>`), r = !0;
1167
+ }
1168
+ return n;
1169
+ }
1170
+ function Ie(t) {
1171
+ const e = Object.keys(t);
1172
+ for (let i = 0; i < e.length; i++) {
1173
+ const s = e[i];
1174
+ if (s !== ":@")
1175
+ return s;
1176
+ }
1177
+ }
1178
+ function G(t, e) {
1179
+ let i = "";
1180
+ if (t && !e.ignoreAttributes)
1181
+ for (let s in t) {
1182
+ let n = e.attributeValueProcessor(s, t[s]);
1183
+ n = rt(n, e), n === !0 && e.suppressBooleanAttributes ? i += ` ${s.substr(e.attributeNamePrefix.length)}` : i += ` ${s.substr(e.attributeNamePrefix.length)}="${n}"`;
1184
+ }
1185
+ return i;
1186
+ }
1187
+ function Pe(t, e) {
1188
+ t = t.substr(0, t.length - e.textNodeName.length - 1);
1189
+ let i = t.substr(t.lastIndexOf(".") + 1);
1190
+ for (let s in e.stopNodes)
1191
+ if (e.stopNodes[s] === t || e.stopNodes[s] === "*." + i)
1192
+ return !0;
1193
+ return !1;
1194
+ }
1195
+ function rt(t, e) {
1196
+ if (t && t.length > 0 && e.processEntities)
1197
+ for (let i = 0; i < e.entities.length; i++) {
1198
+ const s = e.entities[i];
1199
+ t = t.replace(s.regex, s.val);
1200
+ }
1201
+ return t;
1202
+ }
1203
+ var Oe = Te;
1204
+ const Ce = Oe, De = { attributeNamePrefix: "@_", attributesGroupName: !1, textNodeName: "#text", ignoreAttributes: !0, cdataPropName: !1, format: !1, indentBy: " ", suppressEmptyNode: !1, suppressUnpairedNode: !0, suppressBooleanAttributes: !0, tagValueProcessor: function(t, e) {
1205
+ return e;
1206
+ }, attributeValueProcessor: function(t, e) {
1207
+ return e;
1208
+ }, 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 };
1209
+ function y(t) {
1210
+ this.options = Object.assign({}, De, t), this.options.ignoreAttributes || this.options.attributesGroupName ? this.isAttribute = function() {
1211
+ return !1;
1212
+ } : (this.attrPrefixLen = this.options.attributeNamePrefix.length, this.isAttribute = Ve), this.processTextOrObjNode = Se, this.options.format ? (this.indentate = Fe, this.tagEndChar = `>
1213
+ `, this.newLine = `
1214
+ `) : (this.indentate = function() {
1215
+ return "";
1216
+ }, this.tagEndChar = ">", this.newLine = "");
1217
+ }
1218
+ y.prototype.build = function(t) {
1219
+ return this.options.preserveOrder ? Ce(t, this.options) : (Array.isArray(t) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t = { [this.options.arrayNodeName]: t }), this.j2x(t, 0).val);
1220
+ }, y.prototype.j2x = function(t, e) {
1221
+ let i = "", s = "";
1222
+ for (let n in t)
1223
+ if (typeof t[n] > "u")
1224
+ this.isAttribute(n) && (s += "");
1225
+ else if (t[n] === null)
1226
+ this.isAttribute(n) ? s += "" : n[0] === "?" ? s += this.indentate(e) + "<" + n + "?" + this.tagEndChar : s += this.indentate(e) + "<" + n + "/" + this.tagEndChar;
1227
+ else if (t[n] instanceof Date)
1228
+ s += this.buildTextValNode(t[n], n, "", e);
1229
+ else if (typeof t[n] != "object") {
1230
+ const r = this.isAttribute(n);
1231
+ if (r)
1232
+ i += this.buildAttrPairStr(r, "" + t[n]);
1233
+ else if (n === this.options.textNodeName) {
1234
+ let l = this.options.tagValueProcessor(n, "" + t[n]);
1235
+ s += this.replaceEntitiesValue(l);
1236
+ } else
1237
+ s += this.buildTextValNode(t[n], n, "", e);
1238
+ } else if (Array.isArray(t[n])) {
1239
+ const r = t[n].length;
1240
+ let l = "";
1241
+ for (let o = 0; o < r; o++) {
1242
+ const a = t[n][o];
1243
+ typeof a > "u" || (a === null ? n[0] === "?" ? s += this.indentate(e) + "<" + n + "?" + this.tagEndChar : s += this.indentate(e) + "<" + n + "/" + this.tagEndChar : typeof a == "object" ? this.options.oneListGroup ? l += this.j2x(a, e + 1).val : l += this.processTextOrObjNode(a, n, e) : l += this.buildTextValNode(a, n, "", e));
1244
+ }
1245
+ this.options.oneListGroup && (l = this.buildObjectNode(l, n, "", e)), s += l;
1246
+ } else if (this.options.attributesGroupName && n === this.options.attributesGroupName) {
1247
+ const r = Object.keys(t[n]), l = r.length;
1248
+ for (let o = 0; o < l; o++)
1249
+ i += this.buildAttrPairStr(r[o], "" + t[n][r[o]]);
1250
+ } else
1251
+ s += this.processTextOrObjNode(t[n], n, e);
1252
+ return { attrStr: i, val: s };
1253
+ }, y.prototype.buildAttrPairStr = function(t, e) {
1254
+ return e = this.options.attributeValueProcessor(t, "" + e), e = this.replaceEntitiesValue(e), this.options.suppressBooleanAttributes && e === "true" ? " " + t : " " + t + '="' + e + '"';
1255
+ };
1256
+ function Se(t, e, i) {
1257
+ const s = this.j2x(t, i + 1);
1258
+ return t[this.options.textNodeName] !== void 0 && Object.keys(t).length === 1 ? this.buildTextValNode(t[this.options.textNodeName], e, s.attrStr, i) : this.buildObjectNode(s.val, e, s.attrStr, i);
1259
+ }
1260
+ y.prototype.buildObjectNode = function(t, e, i, s) {
1261
+ if (t === "")
1262
+ return e[0] === "?" ? this.indentate(s) + "<" + e + i + "?" + this.tagEndChar : this.indentate(s) + "<" + e + i + this.closeTag(e) + this.tagEndChar;
1263
+ {
1264
+ let n = "</" + e + this.tagEndChar, r = "";
1265
+ return e[0] === "?" && (r = "?", n = ""), (i || i === "") && t.indexOf("<") === -1 ? this.indentate(s) + "<" + e + i + r + ">" + t + n : this.options.commentPropName !== !1 && e === this.options.commentPropName && r.length === 0 ? this.indentate(s) + `<!--${t}-->` + this.newLine : this.indentate(s) + "<" + e + i + r + this.tagEndChar + t + this.indentate(s) + n;
1266
+ }
1267
+ }, y.prototype.closeTag = function(t) {
1268
+ let e = "";
1269
+ return this.options.unpairedTags.indexOf(t) !== -1 ? this.options.suppressUnpairedNode || (e = "/") : this.options.suppressEmptyNode ? e = "/" : e = `></${t}`, e;
1270
+ }, y.prototype.buildTextValNode = function(t, e, i, s) {
1271
+ if (this.options.cdataPropName !== !1 && e === this.options.cdataPropName)
1272
+ return this.indentate(s) + `<![CDATA[${t}]]>` + this.newLine;
1273
+ if (this.options.commentPropName !== !1 && e === this.options.commentPropName)
1274
+ return this.indentate(s) + `<!--${t}-->` + this.newLine;
1275
+ if (e[0] === "?")
1276
+ return this.indentate(s) + "<" + e + i + "?" + this.tagEndChar;
1277
+ {
1278
+ let n = this.options.tagValueProcessor(e, t);
1279
+ return n = this.replaceEntitiesValue(n), n === "" ? this.indentate(s) + "<" + e + i + this.closeTag(e) + this.tagEndChar : this.indentate(s) + "<" + e + i + ">" + n + "</" + e + this.tagEndChar;
1280
+ }
1281
+ }, y.prototype.replaceEntitiesValue = function(t) {
1282
+ if (t && t.length > 0 && this.options.processEntities)
1283
+ for (let e = 0; e < this.options.entities.length; e++) {
1284
+ const i = this.options.entities[e];
1285
+ t = t.replace(i.regex, i.val);
1286
+ }
1287
+ return t;
1288
+ };
1289
+ function Fe(t) {
1290
+ return this.options.indentBy.repeat(t);
1291
+ }
1292
+ function Ve(t) {
1293
+ return t.startsWith(this.options.attributeNamePrefix) && t !== this.options.textNodeName ? t.substr(this.attrPrefixLen) : !1;
1294
+ }
1295
+ var $e = y;
1296
+ const ke = k, Re = _e, Le = $e;
1297
+ var X = { XMLParser: Re, XMLValidator: ke, XMLBuilder: Le };
1298
+ function je(t) {
1299
+ if (typeof t != "string")
1300
+ throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
1301
+ if (t = t.trim(), t.length === 0 || X.XMLValidator.validate(t) !== !0)
1302
+ return !1;
1303
+ let e;
1304
+ const i = new X.XMLParser();
1305
+ try {
1306
+ e = i.parse(t);
1307
+ } catch {
1308
+ return !1;
1309
+ }
1310
+ return !(!e || !("svg" in e));
1311
+ }
1312
+ class ai {
1313
+ _view;
1314
+ constructor(e) {
1315
+ Me(e), this._view = e;
465
1316
  }
466
1317
  get id() {
467
1318
  return this._view.id;
@@ -484,20 +1335,20 @@ class we {
484
1335
  get icon() {
485
1336
  return this._view.icon;
486
1337
  }
487
- set icon(t) {
488
- this._view.icon = t;
1338
+ set icon(e) {
1339
+ this._view.icon = e;
489
1340
  }
490
1341
  get order() {
491
1342
  return this._view.order;
492
1343
  }
493
- set order(t) {
494
- this._view.order = t;
1344
+ set order(e) {
1345
+ this._view.order = e;
495
1346
  }
496
1347
  get params() {
497
1348
  return this._view.params;
498
1349
  }
499
- set params(t) {
500
- this._view.params = t;
1350
+ set params(e) {
1351
+ this._view.params = e;
501
1352
  }
502
1353
  get columns() {
503
1354
  return this._view.columns;
@@ -514,80 +1365,80 @@ class we {
514
1365
  get expanded() {
515
1366
  return this._view.expanded;
516
1367
  }
517
- set expanded(t) {
518
- this._view.expanded = t;
1368
+ set expanded(e) {
1369
+ this._view.expanded = e;
519
1370
  }
520
1371
  get defaultSortKey() {
521
1372
  return this._view.defaultSortKey;
522
1373
  }
523
1374
  }
524
- const G = function(e) {
525
- if (!e.id || typeof e.id != "string")
1375
+ const Me = function(t) {
1376
+ if (!t.id || typeof t.id != "string")
526
1377
  throw new Error("View id is required and must be a string");
527
- if (!e.name || typeof e.name != "string")
1378
+ if (!t.name || typeof t.name != "string")
528
1379
  throw new Error("View name is required and must be a string");
529
- if (e.columns && e.columns.length > 0 && (!e.caption || typeof e.caption != "string"))
1380
+ if (t.columns && t.columns.length > 0 && (!t.caption || typeof t.caption != "string"))
530
1381
  throw new Error("View caption is required for top-level views and must be a string");
531
- if (!e.getContents || typeof e.getContents != "function")
1382
+ if (!t.getContents || typeof t.getContents != "function")
532
1383
  throw new Error("View getContents is required and must be a function");
533
- if (!e.icon || typeof e.icon != "string" || !q(e.icon))
1384
+ if (!t.icon || typeof t.icon != "string" || !je(t.icon))
534
1385
  throw new Error("View icon is required and must be a valid svg string");
535
- if (!("order" in e) || typeof e.order != "number")
1386
+ if (!("order" in t) || typeof t.order != "number")
536
1387
  throw new Error("View order is required and must be a number");
537
- if (e.columns && e.columns.forEach((t) => {
538
- if (!(t instanceof O))
1388
+ if (t.columns && t.columns.forEach((e) => {
1389
+ if (!(e instanceof Nt))
539
1390
  throw new Error("View columns must be an array of Column. Invalid column found");
540
- }), e.emptyView && typeof e.emptyView != "function")
1391
+ }), t.emptyView && typeof t.emptyView != "function")
541
1392
  throw new Error("View emptyView must be a function");
542
- if (e.parent && typeof e.parent != "string")
1393
+ if (t.parent && typeof t.parent != "string")
543
1394
  throw new Error("View parent must be a string");
544
- if ("sticky" in e && typeof e.sticky != "boolean")
1395
+ if ("sticky" in t && typeof t.sticky != "boolean")
545
1396
  throw new Error("View sticky must be a boolean");
546
- if ("expanded" in e && typeof e.expanded != "boolean")
1397
+ if ("expanded" in t && typeof t.expanded != "boolean")
547
1398
  throw new Error("View expanded must be a boolean");
548
- if (e.defaultSortKey && typeof e.defaultSortKey != "string")
1399
+ if (t.defaultSortKey && typeof t.defaultSortKey != "string")
549
1400
  throw new Error("View defaultSortKey must be a string");
550
1401
  return !0;
551
- }, he = function(e) {
552
- return p().registerEntry(e);
553
- }, me = function(e) {
554
- return p().unregisterEntry(e);
555
- }, ge = function(e, t) {
556
- return p().getEntries(e, t);
1402
+ }, li = function(t) {
1403
+ return S().registerEntry(t);
1404
+ }, di = function(t) {
1405
+ return S().unregisterEntry(t);
1406
+ }, ui = function(t) {
1407
+ return S().getEntries(t);
557
1408
  };
558
1409
  export {
559
- O as Column,
560
- v as DefaultType,
561
- z as File,
562
- re as FileAction,
563
- h as FileType,
564
- M as Folder,
565
- oe as Header,
566
- U as Navigation,
567
- I as Node,
568
- s as Permission,
569
- we as View,
570
- he as addNewFileMenuEntry,
571
- le as davGetClient,
572
- ce as davGetDefaultPropfind,
573
- P as davGetFavoritesReport,
574
- ue as davGetRecentSearch,
575
- B as davParsePermissions,
576
- k as davRemoteURL,
577
- H as davResultToNode,
578
- x as davRootPath,
579
- E as defaultDavNamespaces,
580
- y as defaultDavProperties,
581
- te as formatFileSize,
582
- w as getDavNameSpaces,
583
- f as getDavProperties,
584
- pe as getFavoriteNodes,
585
- ne as getFileActions,
586
- ae as getFileListHeaders,
587
- fe as getNavigation,
588
- ge as getNewFileMenuEntries,
589
- de as registerDavProperty,
590
- ie as registerFileAction,
591
- se as registerFileListHeaders,
592
- me as removeNewFileMenuEntry
1410
+ Nt as Column,
1411
+ H as DefaultType,
1412
+ yt as File,
1413
+ We as FileAction,
1414
+ $ as FileType,
1415
+ xt as Folder,
1416
+ Je as Header,
1417
+ Et as Navigation,
1418
+ Z as Node,
1419
+ v as Permission,
1420
+ ai as View,
1421
+ li as addNewFileMenuEntry,
1422
+ ri as davGetClient,
1423
+ ii as davGetDefaultPropfind,
1424
+ wt as davGetFavoritesReport,
1425
+ ni as davGetRecentSearch,
1426
+ vt as davParsePermissions,
1427
+ Q as davRemoteURL,
1428
+ bt as davResultToNode,
1429
+ J as davRootPath,
1430
+ W as defaultDavNamespaces,
1431
+ K as defaultDavProperties,
1432
+ Ke as formatFileSize,
1433
+ V as getDavNameSpaces,
1434
+ F as getDavProperties,
1435
+ si as getFavoriteNodes,
1436
+ Ze as getFileActions,
1437
+ ti as getFileListHeaders,
1438
+ oi as getNavigation,
1439
+ ui as getNewFileMenuEntries,
1440
+ ei as registerDavProperty,
1441
+ Ye as registerFileAction,
1442
+ Qe as registerFileListHeaders,
1443
+ di as removeNewFileMenuEntry
593
1444
  };