@nextcloud/files 3.0.0-beta.21 → 3.0.0-beta.23

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,11 +1,11 @@
1
- import { getCurrentUser as A, getRequestToken as at } from "@nextcloud/auth";
2
- import { getLoggerBuilder as j } from "@nextcloud/logger";
1
+ import { getCurrentUser as T, getRequestToken as at } from "@nextcloud/auth";
2
+ import { getLoggerBuilder as M } from "@nextcloud/logger";
3
3
  import { getCanonicalLocale as lt } from "@nextcloud/l10n";
4
- import { join as dt, basename as ut, extname as ct, dirname as _ } from "path";
4
+ import { join as dt, basename as ut, extname as ct, dirname as A } from "path";
5
5
  import { generateRemoteUrl as ht } from "@nextcloud/router";
6
6
  import { createClient as pt, getPatcher as ft } from "webdav";
7
7
  import { request as gt } from "webdav/dist/node/request.js";
8
- const mt = (t) => t === null ? j().setApp("files").build() : j().setApp("files").setUid(t.uid).build(), m = mt(A());
8
+ const mt = (t) => t === null ? M().setApp("files").build() : M().setApp("files").setUid(t.uid).build(), m = mt(T());
9
9
  class wt {
10
10
  _entries = [];
11
11
  registerEntry(e) {
@@ -44,18 +44,18 @@ class wt {
44
44
  throw new Error("Duplicate entry");
45
45
  }
46
46
  }
47
- const S = function() {
47
+ const F = function() {
48
48
  return typeof window._nc_newfilemenu > "u" && (window._nc_newfilemenu = new wt(), m.debug("NewFileMenu initialized")), window._nc_newfilemenu;
49
- }, I = ["B", "KB", "MB", "GB", "TB", "PB"], O = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
50
- function We(t, e = !1, i = !1) {
49
+ }, O = ["B", "KB", "MB", "GB", "TB", "PB"], P = ["B", "KiB", "MiB", "GiB", "TiB", "PiB"];
50
+ function We(t, e = !1, i = !0) {
51
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 ? O.length : I.length) - 1, s);
54
- const n = i ? O[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 ? O[1] : I[1]) : (s < 2 ? r = parseFloat(r).toFixed(0) : r = parseFloat(r).toLocaleString(lt()), r + " " + n);
52
+ let r = t > 0 ? Math.floor(Math.log(t) / Math.log(i ? 1024 : 1e3)) : 0;
53
+ r = Math.min((i ? P.length : O.length) - 1, r);
54
+ const n = i ? P[r] : O[r];
55
+ let s = (t / Math.pow(i ? 1024 : 1e3, r)).toFixed(1);
56
+ return e === !0 && r === 0 ? (s !== "0.0" ? "< 1 " : "0 ") + (i ? P[1] : O[1]) : (r < 2 ? s = parseFloat(s).toFixed(0) : s = parseFloat(s).toLocaleString(lt()), s + " " + n);
57
57
  }
58
- var H = ((t) => (t.DEFAULT = "default", t.HIDDEN = "hidden", t))(H || {});
58
+ var K = ((t) => (t.DEFAULT = "default", t.HIDDEN = "hidden", t))(K || {});
59
59
  class Ye {
60
60
  _action;
61
61
  constructor(e) {
@@ -67,6 +67,9 @@ class Ye {
67
67
  get displayName() {
68
68
  return this._action.displayName;
69
69
  }
70
+ get title() {
71
+ return this._action.title;
72
+ }
70
73
  get iconSvgInline() {
71
74
  return this._action.iconSvgInline;
72
75
  }
@@ -96,6 +99,8 @@ class Ye {
96
99
  throw new Error("Invalid id");
97
100
  if (!e.displayName || typeof e.displayName != "function")
98
101
  throw new Error("Invalid displayName function");
102
+ if ("title" in e && typeof e.title != "function")
103
+ throw new Error("Invalid title function");
99
104
  if (!e.iconSvgInline || typeof e.iconSvgInline != "function")
100
105
  throw new Error("Invalid iconSvgInline function");
101
106
  if (!e.exec || typeof e.exec != "function")
@@ -106,7 +111,7 @@ class Ye {
106
111
  throw new Error("Invalid execBatch function");
107
112
  if ("order" in e && typeof e.order != "number")
108
113
  throw new Error("Invalid order");
109
- if (e.default && !Object.values(H).includes(e.default))
114
+ if (e.default && !Object.values(K).includes(e.default))
110
115
  throw new Error("Invalid default");
111
116
  if ("inline" in e && typeof e.inline != "function")
112
117
  throw new Error("Invalid inline function");
@@ -166,31 +171,31 @@ const ti = function(t) {
166
171
  return typeof window._nc_filelistheader > "u" && (window._nc_filelistheader = [], m.debug("FileListHeaders initialized")), window._nc_filelistheader;
167
172
  };
168
173
  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" }, ii = 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 });
174
+ const W = ["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"], Y = { d: "DAV:", nc: "http://nextcloud.org/ns", oc: "http://owncloud.org/ns", ocs: "http://open-collaboration-services.org/ns" }, ii = function(t, e = { nc: "http://nextcloud.org/ns" }) {
175
+ typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...W], window._nc_dav_namespaces = { ...Y });
171
176
  const i = { ...window._nc_dav_namespaces, ...e };
172
177
  if (window._nc_dav_properties.find((n) => n === t))
173
178
  return m.error(`${t} already registered`, { prop: t }), !1;
174
179
  if (t.startsWith("<") || t.split(":").length !== 2)
175
180
  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(" ");
181
+ const r = t.split(":")[0];
182
+ return i[r] ? (window._nc_dav_properties.push(t), window._nc_dav_namespaces = i, !0) : (m.error(`${t} namespace unknown`, { prop: t, namespaces: i }), !1);
180
183
  }, 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(" ");
184
+ return typeof window._nc_dav_properties > "u" && (window._nc_dav_properties = [...W]), window._nc_dav_properties.map((t) => `<${t} />`).join(" ");
185
+ }, $ = function() {
186
+ return typeof window._nc_dav_namespaces > "u" && (window._nc_dav_namespaces = { ...Y }), Object.keys(window._nc_dav_namespaces).map((t) => `xmlns:${t}="${window._nc_dav_namespaces?.[t]}"`).join(" ");
182
187
  }, ni = function() {
183
188
  return `<?xml version="1.0"?>
184
- <d:propfind ${V()}>
189
+ <d:propfind ${$()}>
185
190
  <d:prop>
186
- ${F()}
191
+ ${V()}
187
192
  </d:prop>
188
193
  </d:propfind>`;
189
194
  }, vt = function() {
190
195
  return `<?xml version="1.0"?>
191
- <oc:filter-files ${V()}>
196
+ <oc:filter-files ${$()}>
192
197
  <d:prop>
193
- ${F()}
198
+ ${V()}
194
199
  </d:prop>
195
200
  <oc:filter-rules>
196
201
  <oc:favorite>1</oc:favorite>
@@ -198,17 +203,17 @@ const K = ["d:getcontentlength", "d:getcontenttype", "d:getetag", "d:getlastmodi
198
203
  </oc:filter-files>`;
199
204
  }, ri = function(t) {
200
205
  return `<?xml version="1.0" encoding="UTF-8"?>
201
- <d:searchrequest ${V()}
206
+ <d:searchrequest ${$()}
202
207
  xmlns:ns="https://github.com/icewind1991/SearchDAV/ns">
203
208
  <d:basicsearch>
204
209
  <d:select>
205
210
  <d:prop>
206
- ${F()}
211
+ ${V()}
207
212
  </d:prop>
208
213
  </d:select>
209
214
  <d:from>
210
215
  <d:scope>
211
- <d:href>/files/${A()?.uid}/</d:href>
216
+ <d:href>/files/${T()?.uid}/</d:href>
212
217
  <d:depth>infinity</d:depth>
213
218
  </d:scope>
214
219
  </d:from>
@@ -256,10 +261,10 @@ const K = ["d:getcontentlength", "d:getcontenttype", "d:getetag", "d:getlastmodi
256
261
  let e = v.NONE;
257
262
  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;
258
263
  };
259
- var $ = ((t) => (t.Folder = "folder", t.File = "file", t))($ || {});
260
- const Y = function(t, e) {
264
+ var k = ((t) => (t.Folder = "folder", t.File = "file", t))(k || {});
265
+ const Z = function(t, e) {
261
266
  return t.match(e) !== null;
262
- }, M = (t, e) => {
267
+ }, B = (t, e) => {
263
268
  if (t.id && typeof t.id != "number")
264
269
  throw new Error("Invalid id type of value");
265
270
  if (!t.source)
@@ -291,23 +296,23 @@ const Y = function(t, e) {
291
296
  throw new Error("Root must start with a leading slash");
292
297
  if (t.root && !t.source.includes(t.root))
293
298
  throw new Error("Root must be part of the source");
294
- if (t.root && Y(t.source, e)) {
299
+ if (t.root && Z(t.source, e)) {
295
300
  const i = t.source.match(e)[0];
296
301
  if (!t.source.includes(dt(i, t.root)))
297
302
  throw new Error("The root must be relative to the service. e.g /files/emma");
298
303
  }
299
- if (t.status && !Object.values(Z).includes(t.status))
304
+ if (t.status && !Object.values(J).includes(t.status))
300
305
  throw new Error("Status must be a valid NodeStatus");
301
306
  };
302
- var Z = ((t) => (t.NEW = "new", t.FAILED = "failed", t.LOADING = "loading", t.LOCKED = "locked", t))(Z || {});
303
- class J {
307
+ var J = ((t) => (t.NEW = "new", t.FAILED = "failed", t.LOADING = "loading", t.LOCKED = "locked", t))(J || {});
308
+ class Q {
304
309
  _data;
305
310
  _attributes;
306
311
  _knownDavService = /(remote|public)\.php\/(web)?dav/i;
307
312
  constructor(e, i) {
308
- M(e, i || this._knownDavService), this._data = e;
309
- const s = { set: (n, r, l) => (this.updateMtime(), Reflect.set(n, r, l)), deleteProperty: (n, r) => (this.updateMtime(), Reflect.deleteProperty(n, r)) };
310
- this._attributes = new Proxy(e.attributes || {}, s), delete this._data.attributes, i && (this._knownDavService = i);
313
+ B(e, i || this._knownDavService), this._data = e;
314
+ const r = { set: (n, s, a) => (this.updateMtime(), Reflect.set(n, s, a)), deleteProperty: (n, s) => (this.updateMtime(), Reflect.deleteProperty(n, s)) };
315
+ this._attributes = new Proxy(e.attributes || {}, r), delete this._data.attributes, i && (this._knownDavService = i);
311
316
  }
312
317
  get source() {
313
318
  return this._data.source.replace(/\/$/i, "");
@@ -321,10 +326,10 @@ class J {
321
326
  get dirname() {
322
327
  if (this.root) {
323
328
  const i = this.source.indexOf(this.root);
324
- return _(this.source.slice(i + this.root.length) || "/");
329
+ return A(this.source.slice(i + this.root.length) || "/");
325
330
  }
326
331
  const e = new URL(this.source);
327
- return _(e.pathname);
332
+ return A(e.pathname);
328
333
  }
329
334
  get mime() {
330
335
  return this._data.mime;
@@ -348,10 +353,10 @@ class J {
348
353
  return this.isDavRessource ? this._data.owner : null;
349
354
  }
350
355
  get isDavRessource() {
351
- return Y(this.source, this._knownDavService);
356
+ return Z(this.source, this._knownDavService);
352
357
  }
353
358
  get root() {
354
- return this._data.root ? this._data.root.replace(/^(.+)\/$/, "$1") : this.isDavRessource && _(this.source).split(this._knownDavService).pop() || null;
359
+ return this._data.root ? this._data.root.replace(/^(.+)\/$/, "$1") : this.isDavRessource && A(this.source).split(this._knownDavService).pop() || null;
355
360
  }
356
361
  get path() {
357
362
  if (this.root) {
@@ -370,28 +375,28 @@ class J {
370
375
  this._data.status = e;
371
376
  }
372
377
  move(e) {
373
- M({ ...this._data, source: e }, this._knownDavService), this._data.source = e, this.updateMtime();
378
+ B({ ...this._data, source: e }, this._knownDavService), this._data.source = e, this.updateMtime();
374
379
  }
375
380
  rename(e) {
376
381
  if (e.includes("/"))
377
382
  throw new Error("Invalid basename");
378
- this.move(_(this.source) + "/" + e);
383
+ this.move(A(this.source) + "/" + e);
379
384
  }
380
385
  updateMtime() {
381
386
  this._data.mtime && (this._data.mtime = /* @__PURE__ */ new Date());
382
387
  }
383
388
  }
384
- class xt extends J {
389
+ class xt extends Q {
385
390
  get type() {
386
- return $.File;
391
+ return k.File;
387
392
  }
388
393
  }
389
- class bt extends J {
394
+ class bt extends Q {
390
395
  constructor(e) {
391
396
  super({ ...e, mime: "httpd/unix-directory" });
392
397
  }
393
398
  get type() {
394
- return $.Folder;
399
+ return k.Folder;
395
400
  }
396
401
  get extension() {
397
402
  return null;
@@ -400,12 +405,12 @@ class bt extends J {
400
405
  return "httpd/unix-directory";
401
406
  }
402
407
  }
403
- const Q = `/files/${A()?.uid}`, tt = ht("dav"), si = function(t = tt) {
408
+ const tt = `/files/${T()?.uid}`, et = ht("dav"), si = function(t = et) {
404
409
  const e = pt(t, { headers: { requesttoken: at() || "" } });
405
410
  return ft().patch("request", (i) => (i.headers?.method && (i.method = i.headers.method, delete i.headers.method), gt(i))), e;
406
- }, oi = async (t, e = "/", i = Q) => (await t.getDirectoryContents(`${i}${e}`, { details: !0, data: vt(), headers: { method: "REPORT" }, includeSelf: !0 })).data.filter((s) => s.filename !== e).map((s) => Et(s, i)), Et = function(t, e = Q, i = tt) {
407
- const s = t.props, n = yt(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"] } };
408
- return delete l.attributes?.props, t.type === "file" ? new xt(l) : new bt(l);
411
+ }, oi = async (t, e = "/", i = tt) => (await t.getDirectoryContents(`${i}${e}`, { details: !0, data: vt(), headers: { method: "REPORT" }, includeSelf: !0 })).data.filter((r) => r.filename !== e).map((r) => Et(r, i)), Et = function(t, e = tt, i = et) {
412
+ const r = t.props, n = yt(r?.permissions), s = T()?.uid, a = { id: r?.fileid || 0, source: `${i}${t.filename}`, mtime: new Date(Date.parse(t.lastmod)), mime: t.mime, size: r?.size || Number.parseInt(r.getcontentlength || "0"), permissions: n, owner: s, root: e, attributes: { ...t, ...r, hasPreview: r?.["has-preview"] } };
413
+ return delete a.attributes?.props, t.type === "file" ? new xt(a) : new bt(a);
409
414
  };
410
415
  class Nt {
411
416
  _views = [];
@@ -416,7 +421,7 @@ class Nt {
416
421
  this._views.push(e);
417
422
  }
418
423
  remove(e) {
419
- const i = this._views.findIndex((s) => s.id === e);
424
+ const i = this._views.findIndex((r) => r.id === e);
420
425
  i !== -1 && this._views.splice(i, 1);
421
426
  }
422
427
  get views() {
@@ -466,142 +471,142 @@ const At = function(t) {
466
471
  throw new Error("Column summary must be a function");
467
472
  return !0;
468
473
  };
469
- var k = {}, T = {};
474
+ var L = {}, I = {};
470
475
  (function(t) {
471
- 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) {
476
+ 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", r = "[" + e + "][" + i + "]*", n = new RegExp("^" + r + "$"), s = function(o, l) {
472
477
  const d = [];
473
- let u = a.exec(o);
478
+ let u = l.exec(o);
474
479
  for (; u; ) {
475
- const h = [];
476
- h.startIndex = a.lastIndex - u[0].length;
477
- const c = u.length;
478
- for (let f = 0; f < c; f++)
479
- h.push(u[f]);
480
- d.push(h), u = a.exec(o);
480
+ const c = [];
481
+ c.startIndex = l.lastIndex - u[0].length;
482
+ const p = u.length;
483
+ for (let h = 0; h < p; h++)
484
+ c.push(u[h]);
485
+ d.push(c), u = l.exec(o);
481
486
  }
482
487
  return d;
483
- }, l = function(o) {
484
- const a = n.exec(o);
485
- return !(a === null || typeof a > "u");
488
+ }, a = function(o) {
489
+ const l = n.exec(o);
490
+ return !(l === null || typeof l > "u");
486
491
  };
487
492
  t.isExist = function(o) {
488
493
  return typeof o < "u";
489
494
  }, t.isEmptyObject = function(o) {
490
495
  return Object.keys(o).length === 0;
491
- }, t.merge = function(o, a, d) {
492
- if (a) {
493
- const u = Object.keys(a), h = u.length;
494
- for (let c = 0; c < h; c++)
495
- d === "strict" ? o[u[c]] = [a[u[c]]] : o[u[c]] = a[u[c]];
496
+ }, t.merge = function(o, l, d) {
497
+ if (l) {
498
+ const u = Object.keys(l), c = u.length;
499
+ for (let p = 0; p < c; p++)
500
+ d === "strict" ? o[u[p]] = [l[u[p]]] : o[u[p]] = l[u[p]];
496
501
  }
497
502
  }, t.getValue = function(o) {
498
503
  return t.isExist(o) ? o : "";
499
- }, t.isName = l, t.getAllMatches = r, t.nameRegexp = s;
500
- })(T);
501
- const L = T, Tt = { allowBooleanAttributes: !1, unpairedTags: [] };
502
- k.validate = function(t, e) {
504
+ }, t.isName = a, t.getAllMatches = s, t.nameRegexp = r;
505
+ })(I);
506
+ const R = I, Tt = { allowBooleanAttributes: !1, unpairedTags: [] };
507
+ L.validate = function(t, e) {
503
508
  e = Object.assign({}, Tt, e);
504
509
  const i = [];
505
- let s = !1, n = !1;
510
+ let r = !1, n = !1;
506
511
  t[0] === "\uFEFF" && (t = t.substr(1));
507
- for (let r = 0; r < t.length; r++)
508
- if (t[r] === "<" && t[r + 1] === "?") {
509
- if (r += 2, r = q(t, r), r.err)
510
- return r;
511
- } else if (t[r] === "<") {
512
- let l = r;
513
- if (r++, t[r] === "!") {
514
- r = U(t, r);
512
+ for (let s = 0; s < t.length; s++)
513
+ if (t[s] === "<" && t[s + 1] === "?") {
514
+ if (s += 2, s = U(t, s), s.err)
515
+ return s;
516
+ } else if (t[s] === "<") {
517
+ let a = s;
518
+ if (s++, t[s] === "!") {
519
+ s = z(t, s);
515
520
  continue;
516
521
  } else {
517
522
  let o = !1;
518
- t[r] === "/" && (o = !0, r++);
519
- let a = "";
520
- for (; r < t.length && t[r] !== ">" && t[r] !== " " && t[r] !== " " && t[r] !== `
521
- ` && t[r] !== "\r"; r++)
522
- a += t[r];
523
- if (a = a.trim(), a[a.length - 1] === "/" && (a = a.substring(0, a.length - 1), r--), !Vt(a)) {
524
- let h;
525
- return a.trim().length === 0 ? h = "Invalid space after '<'." : h = "Tag '" + a + "' is an invalid name.", p("InvalidTag", h, g(t, r));
523
+ t[s] === "/" && (o = !0, s++);
524
+ let l = "";
525
+ for (; s < t.length && t[s] !== ">" && t[s] !== " " && t[s] !== " " && t[s] !== `
526
+ ` && t[s] !== "\r"; s++)
527
+ l += t[s];
528
+ if (l = l.trim(), l[l.length - 1] === "/" && (l = l.substring(0, l.length - 1), s--), !Vt(l)) {
529
+ let c;
530
+ return l.trim().length === 0 ? c = "Invalid space after '<'." : c = "Tag '" + l + "' is an invalid name.", f("InvalidTag", c, g(t, s));
526
531
  }
527
- const d = Pt(t, r);
532
+ const d = Pt(t, s);
528
533
  if (d === !1)
529
- return p("InvalidAttr", "Attributes for '" + a + "' have open quote.", g(t, r));
534
+ return f("InvalidAttr", "Attributes for '" + l + "' have open quote.", g(t, s));
530
535
  let u = d.value;
531
- if (r = d.index, u[u.length - 1] === "/") {
532
- const h = r - u.length;
536
+ if (s = d.index, u[u.length - 1] === "/") {
537
+ const c = s - u.length;
533
538
  u = u.substring(0, u.length - 1);
534
- const c = z(u, e);
535
- if (c === !0)
536
- s = !0;
539
+ const p = G(u, e);
540
+ if (p === !0)
541
+ r = !0;
537
542
  else
538
- return p(c.err.code, c.err.msg, g(t, h + c.err.line));
543
+ return f(p.err.code, p.err.msg, g(t, c + p.err.line));
539
544
  } else if (o)
540
545
  if (d.tagClosed) {
541
546
  if (u.trim().length > 0)
542
- return p("InvalidTag", "Closing tag '" + a + "' can't have attributes or invalid starting.", g(t, l));
547
+ return f("InvalidTag", "Closing tag '" + l + "' can't have attributes or invalid starting.", g(t, a));
543
548
  {
544
- const h = i.pop();
545
- if (a !== h.tagName) {
546
- let c = g(t, h.tagStartPos);
547
- return p("InvalidTag", "Expected closing tag '" + h.tagName + "' (opened in line " + c.line + ", col " + c.col + ") instead of closing tag '" + a + "'.", g(t, l));
549
+ const c = i.pop();
550
+ if (l !== c.tagName) {
551
+ let p = g(t, c.tagStartPos);
552
+ return f("InvalidTag", "Expected closing tag '" + c.tagName + "' (opened in line " + p.line + ", col " + p.col + ") instead of closing tag '" + l + "'.", g(t, a));
548
553
  }
549
554
  i.length == 0 && (n = !0);
550
555
  }
551
556
  } else
552
- return p("InvalidTag", "Closing tag '" + a + "' doesn't have proper closing.", g(t, r));
557
+ return f("InvalidTag", "Closing tag '" + l + "' doesn't have proper closing.", g(t, s));
553
558
  else {
554
- const h = z(u, e);
555
- if (h !== !0)
556
- return p(h.err.code, h.err.msg, g(t, r - u.length + h.err.line));
559
+ const c = G(u, e);
560
+ if (c !== !0)
561
+ return f(c.err.code, c.err.msg, g(t, s - u.length + c.err.line));
557
562
  if (n === !0)
558
- return p("InvalidXml", "Multiple possible root nodes found.", g(t, r));
559
- e.unpairedTags.indexOf(a) !== -1 || i.push({ tagName: a, tagStartPos: l }), s = !0;
563
+ return f("InvalidXml", "Multiple possible root nodes found.", g(t, s));
564
+ e.unpairedTags.indexOf(l) !== -1 || i.push({ tagName: l, tagStartPos: a }), r = !0;
560
565
  }
561
- for (r++; r < t.length; r++)
562
- if (t[r] === "<")
563
- if (t[r + 1] === "!") {
564
- r++, r = U(t, r);
566
+ for (s++; s < t.length; s++)
567
+ if (t[s] === "<")
568
+ if (t[s + 1] === "!") {
569
+ s++, s = z(t, s);
565
570
  continue;
566
- } else if (t[r + 1] === "?") {
567
- if (r = q(t, ++r), r.err)
568
- return r;
571
+ } else if (t[s + 1] === "?") {
572
+ if (s = U(t, ++s), s.err)
573
+ return s;
569
574
  } else
570
575
  break;
571
- else if (t[r] === "&") {
572
- const h = St(t, r);
573
- if (h == -1)
574
- return p("InvalidChar", "char '&' is not expected.", g(t, r));
575
- r = h;
576
- } else if (n === !0 && !B(t[r]))
577
- return p("InvalidXml", "Extra text at the end", g(t, r));
578
- t[r] === "<" && r--;
576
+ else if (t[s] === "&") {
577
+ const c = St(t, s);
578
+ if (c == -1)
579
+ return f("InvalidChar", "char '&' is not expected.", g(t, s));
580
+ s = c;
581
+ } else if (n === !0 && !q(t[s]))
582
+ return f("InvalidXml", "Extra text at the end", g(t, s));
583
+ t[s] === "<" && s--;
579
584
  }
580
585
  } else {
581
- if (B(t[r]))
586
+ if (q(t[s]))
582
587
  continue;
583
- return p("InvalidChar", "char '" + t[r] + "' is not expected.", g(t, r));
588
+ return f("InvalidChar", "char '" + t[s] + "' is not expected.", g(t, s));
584
589
  }
585
- if (s) {
590
+ if (r) {
586
591
  if (i.length == 1)
587
- return p("InvalidTag", "Unclosed tag '" + i[0].tagName + "'.", g(t, i[0].tagStartPos));
592
+ return f("InvalidTag", "Unclosed tag '" + i[0].tagName + "'.", g(t, i[0].tagStartPos));
588
593
  if (i.length > 0)
589
- return p("InvalidXml", "Invalid '" + JSON.stringify(i.map((r) => r.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
594
+ return f("InvalidXml", "Invalid '" + JSON.stringify(i.map((s) => s.tagName), null, 4).replace(/\r?\n/g, "") + "' found.", { line: 1, col: 1 });
590
595
  } else
591
- return p("InvalidXml", "Start tag expected.", 1);
596
+ return f("InvalidXml", "Start tag expected.", 1);
592
597
  return !0;
593
598
  };
594
- function B(t) {
599
+ function q(t) {
595
600
  return t === " " || t === " " || t === `
596
601
  ` || t === "\r";
597
602
  }
598
- function q(t, e) {
603
+ function U(t, e) {
599
604
  const i = e;
600
605
  for (; e < t.length; e++)
601
606
  if (t[e] == "?" || t[e] == " ") {
602
- const s = t.substr(i, e - i);
603
- if (e > 5 && s === "xml")
604
- return p("InvalidXml", "XML declaration allowed only at the start of the document.", g(t, e));
607
+ const r = t.substr(i, e - i);
608
+ if (e > 5 && r === "xml")
609
+ return f("InvalidXml", "XML declaration allowed only at the start of the document.", g(t, e));
605
610
  if (t[e] == "?" && t[e + 1] == ">") {
606
611
  e++;
607
612
  break;
@@ -610,7 +615,7 @@ function q(t, e) {
610
615
  }
611
616
  return e;
612
617
  }
613
- function U(t, e) {
618
+ function z(t, e) {
614
619
  if (t.length > e + 5 && t[e + 1] === "-" && t[e + 2] === "-") {
615
620
  for (e += 3; e < t.length; e++)
616
621
  if (t[e] === "-" && t[e + 1] === "-" && t[e + 2] === ">") {
@@ -635,35 +640,35 @@ function U(t, e) {
635
640
  }
636
641
  const It = '"', Ot = "'";
637
642
  function Pt(t, e) {
638
- let i = "", s = "", n = !1;
643
+ let i = "", r = "", n = !1;
639
644
  for (; e < t.length; e++) {
640
645
  if (t[e] === It || t[e] === Ot)
641
- s === "" ? s = t[e] : s !== t[e] || (s = "");
642
- else if (t[e] === ">" && s === "") {
646
+ r === "" ? r = t[e] : r !== t[e] || (r = "");
647
+ else if (t[e] === ">" && r === "") {
643
648
  n = !0;
644
649
  break;
645
650
  }
646
651
  i += t[e];
647
652
  }
648
- return s !== "" ? !1 : { value: i, index: e, tagClosed: n };
653
+ return r !== "" ? !1 : { value: i, index: e, tagClosed: n };
649
654
  }
650
655
  const Ct = new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`, "g");
651
- function z(t, e) {
652
- const i = L.getAllMatches(t, Ct), s = {};
656
+ function G(t, e) {
657
+ const i = R.getAllMatches(t, Ct), r = {};
653
658
  for (let n = 0; n < i.length; n++) {
654
659
  if (i[n][1].length === 0)
655
- return p("InvalidAttr", "Attribute '" + i[n][2] + "' has no space in starting.", b(i[n]));
660
+ return f("InvalidAttr", "Attribute '" + i[n][2] + "' has no space in starting.", E(i[n]));
656
661
  if (i[n][3] !== void 0 && i[n][4] === void 0)
657
- return p("InvalidAttr", "Attribute '" + i[n][2] + "' is without value.", b(i[n]));
662
+ return f("InvalidAttr", "Attribute '" + i[n][2] + "' is without value.", E(i[n]));
658
663
  if (i[n][3] === void 0 && !e.allowBooleanAttributes)
659
- return p("InvalidAttr", "boolean attribute '" + i[n][2] + "' is not allowed.", b(i[n]));
660
- const r = i[n][2];
661
- if (!Ft(r))
662
- return p("InvalidAttr", "Attribute '" + r + "' is an invalid name.", b(i[n]));
663
- if (!s.hasOwnProperty(r))
664
- s[r] = 1;
664
+ return f("InvalidAttr", "boolean attribute '" + i[n][2] + "' is not allowed.", E(i[n]));
665
+ const s = i[n][2];
666
+ if (!Ft(s))
667
+ return f("InvalidAttr", "Attribute '" + s + "' is an invalid name.", E(i[n]));
668
+ if (!r.hasOwnProperty(s))
669
+ r[s] = 1;
665
670
  else
666
- return p("InvalidAttr", "Attribute '" + r + "' is repeated.", b(i[n]));
671
+ return f("InvalidAttr", "Attribute '" + s + "' is repeated.", E(i[n]));
667
672
  }
668
673
  return !0;
669
674
  }
@@ -691,33 +696,33 @@ function St(t, e) {
691
696
  }
692
697
  return e;
693
698
  }
694
- function p(t, e, i) {
699
+ function f(t, e, i) {
695
700
  return { err: { code: t, msg: e, line: i.line || i, col: i.col } };
696
701
  }
697
702
  function Ft(t) {
698
- return L.isName(t);
703
+ return R.isName(t);
699
704
  }
700
705
  function Vt(t) {
701
- return L.isName(t);
706
+ return R.isName(t);
702
707
  }
703
708
  function g(t, e) {
704
709
  const i = t.substring(0, e).split(/\r?\n/);
705
710
  return { line: i.length, col: i[i.length - 1].length + 1 };
706
711
  }
707
- function b(t) {
712
+ function E(t) {
708
713
  return t.startIndex + t[1].length;
709
714
  }
710
- var P = {};
711
- const et = { 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) {
715
+ var C = {};
716
+ const it = { 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) {
712
717
  return e;
713
718
  }, attributeValueProcessor: function(t, e) {
714
719
  return e;
715
720
  }, 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) {
716
721
  return t;
717
722
  } }, $t = function(t) {
718
- return Object.assign({}, et, t);
723
+ return Object.assign({}, it, t);
719
724
  };
720
- P.buildOptions = $t, P.defaultOptions = et;
725
+ C.buildOptions = $t, C.defaultOptions = it;
721
726
  class kt {
722
727
  constructor(e) {
723
728
  this.tagname = e, this.child = [], this[":@"] = {};
@@ -730,14 +735,14 @@ class kt {
730
735
  }
731
736
  }
732
737
  var Lt = kt;
733
- const Rt = T;
738
+ const Rt = I;
734
739
  function jt(t, e) {
735
740
  const i = {};
736
741
  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") {
737
742
  e = e + 9;
738
- let s = 1, n = !1, r = !1, l = "";
743
+ let r = 1, n = !1, s = !1, a = "";
739
744
  for (; e < t.length; e++)
740
- if (t[e] === "<" && !r) {
745
+ if (t[e] === "<" && !s) {
741
746
  if (n && qt(t, e))
742
747
  e += 7, [entityName, val, e] = Mt(t, e + 1), val.indexOf("&") === -1 && (i[Xt(entityName)] = { regx: RegExp(`&${entityName};`, "g"), val });
743
748
  else if (n && Ut(t, e))
@@ -747,16 +752,16 @@ function jt(t, e) {
747
752
  else if (n && Gt(t, e))
748
753
  e += 9;
749
754
  else if (Bt)
750
- r = !0;
755
+ s = !0;
751
756
  else
752
757
  throw new Error("Invalid DOCTYPE");
753
- s++, l = "";
758
+ r++, a = "";
754
759
  } else if (t[e] === ">") {
755
- if (r ? t[e - 1] === "-" && t[e - 2] === "-" && (r = !1, s--) : s--, s === 0)
760
+ if (s ? t[e - 1] === "-" && t[e - 2] === "-" && (s = !1, r--) : r--, r === 0)
756
761
  break;
757
762
  } else
758
- t[e] === "[" ? n = !0 : l += t[e];
759
- if (s !== 0)
763
+ t[e] === "[" ? n = !0 : a += t[e];
764
+ if (r !== 0)
760
765
  throw new Error("Unclosed DOCTYPE");
761
766
  } else
762
767
  throw new Error("Invalid Tag instead of DOCTYPE");
@@ -768,9 +773,9 @@ function Mt(t, e) {
768
773
  i += t[e];
769
774
  if (i = i.trim(), i.indexOf(" ") !== -1)
770
775
  throw new Error("External entites are not supported");
771
- const s = t[e++];
776
+ const r = t[e++];
772
777
  let n = "";
773
- for (; e < t.length && t[e] !== s; e++)
778
+ for (; e < t.length && t[e] !== r; e++)
774
779
  n += t[e];
775
780
  return [i, n, e];
776
781
  }
@@ -807,16 +812,16 @@ function Zt(t, e = {}) {
807
812
  if (e.hex && Kt.test(i))
808
813
  return Number.parseInt(i, 16);
809
814
  {
810
- const s = Wt.exec(i);
811
- if (s) {
812
- const n = s[1], r = s[2];
813
- let l = Jt(s[3]);
814
- const o = s[4] || s[6];
815
- if (!e.leadingZeros && r.length > 0 && n && i[2] !== "." || !e.leadingZeros && r.length > 0 && !n && i[1] !== ".")
815
+ const r = Wt.exec(i);
816
+ if (r) {
817
+ const n = r[1], s = r[2];
818
+ let a = Jt(r[3]);
819
+ const o = r[4] || r[6];
820
+ if (!e.leadingZeros && s.length > 0 && n && i[2] !== "." || !e.leadingZeros && s.length > 0 && !n && i[1] !== ".")
816
821
  return t;
817
822
  {
818
- const a = Number(i), d = "" + a;
819
- 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;
823
+ const l = Number(i), d = "" + l;
824
+ return d.search(/[eE]/) !== -1 || o ? e.eNotation ? l : t : i.indexOf(".") !== -1 ? d === "0" && a === "" || d === a || n && d === "-" + a ? l : t : s ? a === d || n + a === d ? l : t : i === d || i === n + d ? l : t;
820
825
  }
821
826
  } else
822
827
  return t;
@@ -826,8 +831,8 @@ function Jt(t) {
826
831
  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;
827
832
  }
828
833
  var Qt = Zt;
829
- const R = T, E = Lt, te = Ht, ee = Qt;
830
- "<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g, R.nameRegexp);
834
+ const j = I, N = Lt, te = Ht, ee = Qt;
835
+ "<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)".replace(/NAME/g, j.nameRegexp);
831
836
  let ie = class {
832
837
  constructor(t) {
833
838
  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 = ne, this.parseXml = le, this.parseTextData = re, this.resolveNameSpace = se, this.buildAttributesMap = ae, this.isItStopNode = he, this.replaceEntitiesValue = ue, this.readStopNodeData = fe, this.saveTextToParentTag = ce, this.addChild = de;
@@ -836,15 +841,15 @@ let ie = class {
836
841
  function ne(t) {
837
842
  const e = Object.keys(t);
838
843
  for (let i = 0; i < e.length; i++) {
839
- const s = e[i];
840
- this.lastEntities[s] = { regex: new RegExp("&" + s + ";", "g"), val: t[s] };
844
+ const r = e[i];
845
+ this.lastEntities[r] = { regex: new RegExp("&" + r + ";", "g"), val: t[r] };
841
846
  }
842
847
  }
843
- function re(t, e, i, s, n, r, l) {
844
- if (t !== void 0 && (this.options.trimValues && !s && (t = t.trim()), t.length > 0)) {
845
- l || (t = this.replaceEntitiesValue(t));
846
- const o = this.options.tagValueProcessor(e, t, i, n, r);
847
- 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;
848
+ function re(t, e, i, r, n, s, a) {
849
+ if (t !== void 0 && (this.options.trimValues && !r && (t = t.trim()), t.length > 0)) {
850
+ a || (t = this.replaceEntitiesValue(t));
851
+ const o = this.options.tagValueProcessor(e, t, i, n, s);
852
+ return o == null ? t : typeof o != typeof t || o !== t ? o : this.options.trimValues ? S(t, this.options.parseTagValue, this.options.numberParseOptions) : t.trim() === t ? S(t, this.options.parseTagValue, this.options.numberParseOptions) : t;
848
853
  }
849
854
  }
850
855
  function se(t) {
@@ -859,112 +864,114 @@ function se(t) {
859
864
  const oe = new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`, "gm");
860
865
  function ae(t, e, i) {
861
866
  if (!this.options.ignoreAttributes && typeof t == "string") {
862
- const s = R.getAllMatches(t, oe), n = s.length, r = {};
863
- for (let l = 0; l < n; l++) {
864
- const o = this.resolveNameSpace(s[l][1]);
865
- let a = s[l][4], d = this.options.attributeNamePrefix + o;
867
+ const r = j.getAllMatches(t, oe), n = r.length, s = {};
868
+ for (let a = 0; a < n; a++) {
869
+ const o = this.resolveNameSpace(r[a][1]);
870
+ let l = r[a][4], d = this.options.attributeNamePrefix + o;
866
871
  if (o.length)
867
- if (this.options.transformAttributeName && (d = this.options.transformAttributeName(d)), d === "__proto__" && (d = "#__proto__"), a !== void 0) {
868
- this.options.trimValues && (a = a.trim()), a = this.replaceEntitiesValue(a);
869
- const u = this.options.attributeValueProcessor(o, a, e);
870
- u == null ? r[d] = a : typeof u != typeof a || u !== a ? r[d] = u : r[d] = D(a, this.options.parseAttributeValue, this.options.numberParseOptions);
872
+ if (this.options.transformAttributeName && (d = this.options.transformAttributeName(d)), d === "__proto__" && (d = "#__proto__"), l !== void 0) {
873
+ this.options.trimValues && (l = l.trim()), l = this.replaceEntitiesValue(l);
874
+ const u = this.options.attributeValueProcessor(o, l, e);
875
+ u == null ? s[d] = l : typeof u != typeof l || u !== l ? s[d] = u : s[d] = S(l, this.options.parseAttributeValue, this.options.numberParseOptions);
871
876
  } else
872
- this.options.allowBooleanAttributes && (r[d] = !0);
877
+ this.options.allowBooleanAttributes && (s[d] = !0);
873
878
  }
874
- if (!Object.keys(r).length)
879
+ if (!Object.keys(s).length)
875
880
  return;
876
881
  if (this.options.attributesGroupName) {
877
- const l = {};
878
- return l[this.options.attributesGroupName] = r, l;
882
+ const a = {};
883
+ return a[this.options.attributesGroupName] = s, a;
879
884
  }
880
- return r;
885
+ return s;
881
886
  }
882
887
  }
883
888
  const le = function(t) {
884
889
  t = t.replace(/\r\n?/g, `
885
890
  `);
886
- const e = new E("!xml");
887
- let i = e, s = "", n = "";
888
- for (let r = 0; r < t.length; r++)
889
- if (t[r] === "<")
890
- if (t[r + 1] === "/") {
891
- const l = x(t, ">", r, "Closing Tag is not closed.");
892
- let o = t.substring(r + 2, l).trim();
891
+ const e = new N("!xml");
892
+ let i = e, r = "", n = "";
893
+ for (let s = 0; s < t.length; s++)
894
+ if (t[s] === "<")
895
+ if (t[s + 1] === "/") {
896
+ const a = x(t, ">", s, "Closing Tag is not closed.");
897
+ let o = t.substring(s + 2, a).trim();
893
898
  if (this.options.removeNSPrefix) {
894
899
  const u = o.indexOf(":");
895
900
  u !== -1 && (o = o.substr(u + 1));
896
901
  }
897
- this.options.transformTagName && (o = this.options.transformTagName(o)), i && (s = this.saveTextToParentTag(s, i, n));
898
- const a = n.substring(n.lastIndexOf(".") + 1);
902
+ this.options.transformTagName && (o = this.options.transformTagName(o)), i && (r = this.saveTextToParentTag(r, i, n));
903
+ const l = n.substring(n.lastIndexOf(".") + 1);
899
904
  if (o && this.options.unpairedTags.indexOf(o) !== -1)
900
905
  throw new Error(`Unpaired tag can not be used as closing tag: </${o}>`);
901
906
  let d = 0;
902
- 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;
903
- } else if (t[r + 1] === "?") {
904
- let l = C(t, r, !1, "?>");
905
- if (!l)
907
+ l && this.options.unpairedTags.indexOf(l) !== -1 ? (d = n.lastIndexOf(".", n.lastIndexOf(".") - 1), this.tagsNodeStack.pop()) : d = n.lastIndexOf("."), n = n.substring(0, d), i = this.tagsNodeStack.pop(), r = "", s = a;
908
+ } else if (t[s + 1] === "?") {
909
+ let a = D(t, s, !1, "?>");
910
+ if (!a)
906
911
  throw new Error("Pi Tag is not closed.");
907
- if (s = this.saveTextToParentTag(s, i, n), !(this.options.ignoreDeclaration && l.tagName === "?xml" || this.options.ignorePiTags)) {
908
- const o = new E(l.tagName);
909
- o.add(this.options.textNodeName, ""), l.tagName !== l.tagExp && l.attrExpPresent && (o[":@"] = this.buildAttributesMap(l.tagExp, n, l.tagName)), this.addChild(i, o, n);
912
+ if (r = this.saveTextToParentTag(r, i, n), !(this.options.ignoreDeclaration && a.tagName === "?xml" || this.options.ignorePiTags)) {
913
+ const o = new N(a.tagName);
914
+ o.add(this.options.textNodeName, ""), a.tagName !== a.tagExp && a.attrExpPresent && (o[":@"] = this.buildAttributesMap(a.tagExp, n, a.tagName)), this.addChild(i, o, n);
910
915
  }
911
- r = l.closeIndex + 1;
912
- } else if (t.substr(r + 1, 3) === "!--") {
913
- const l = x(t, "-->", r + 4, "Comment is not closed.");
916
+ s = a.closeIndex + 1;
917
+ } else if (t.substr(s + 1, 3) === "!--") {
918
+ const a = x(t, "-->", s + 4, "Comment is not closed.");
914
919
  if (this.options.commentPropName) {
915
- const o = t.substring(r + 4, l - 2);
916
- s = this.saveTextToParentTag(s, i, n), i.add(this.options.commentPropName, [{ [this.options.textNodeName]: o }]);
920
+ const o = t.substring(s + 4, a - 2);
921
+ r = this.saveTextToParentTag(r, i, n), i.add(this.options.commentPropName, [{ [this.options.textNodeName]: o }]);
917
922
  }
918
- r = l;
919
- } else if (t.substr(r + 1, 2) === "!D") {
920
- const l = te(t, r);
921
- this.docTypeEntities = l.entities, r = l.i;
922
- } else if (t.substr(r + 1, 2) === "![") {
923
- const l = x(t, "]]>", r, "CDATA is not closed.") - 2, o = t.substring(r + 9, l);
924
- if (s = this.saveTextToParentTag(s, i, n), this.options.cdataPropName)
923
+ s = a;
924
+ } else if (t.substr(s + 1, 2) === "!D") {
925
+ const a = te(t, s);
926
+ this.docTypeEntities = a.entities, s = a.i;
927
+ } else if (t.substr(s + 1, 2) === "![") {
928
+ const a = x(t, "]]>", s, "CDATA is not closed.") - 2, o = t.substring(s + 9, a);
929
+ if (r = this.saveTextToParentTag(r, i, n), this.options.cdataPropName)
925
930
  i.add(this.options.cdataPropName, [{ [this.options.textNodeName]: o }]);
926
931
  else {
927
- let a = this.parseTextData(o, i.tagname, n, !0, !1, !0);
928
- a == null && (a = ""), i.add(this.options.textNodeName, a);
932
+ let l = this.parseTextData(o, i.tagname, n, !0, !1, !0);
933
+ l == null && (l = ""), i.add(this.options.textNodeName, l);
929
934
  }
930
- r = l + 2;
935
+ s = a + 2;
931
936
  } else {
932
- let l = C(t, r, this.options.removeNSPrefix), o = l.tagName, a = l.tagExp, d = l.attrExpPresent, u = l.closeIndex;
933
- this.options.transformTagName && (o = this.options.transformTagName(o)), i && s && i.tagname !== "!xml" && (s = this.saveTextToParentTag(s, i, n, !1));
934
- const h = i;
935
- 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)) {
936
- let c = "";
937
- if (a.length > 0 && a.lastIndexOf("/") === a.length - 1)
938
- r = l.closeIndex;
937
+ let a = D(t, s, this.options.removeNSPrefix), o = a.tagName;
938
+ const l = a.rawTagName;
939
+ let d = a.tagExp, u = a.attrExpPresent, c = a.closeIndex;
940
+ this.options.transformTagName && (o = this.options.transformTagName(o)), i && r && i.tagname !== "!xml" && (r = this.saveTextToParentTag(r, i, n, !1));
941
+ const p = i;
942
+ if (p && this.options.unpairedTags.indexOf(p.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)) {
943
+ let h = "";
944
+ if (d.length > 0 && d.lastIndexOf("/") === d.length - 1)
945
+ s = a.closeIndex;
939
946
  else if (this.options.unpairedTags.indexOf(o) !== -1)
940
- r = l.closeIndex;
947
+ s = a.closeIndex;
941
948
  else {
942
- const w = this.readStopNodeData(t, o, u + 1);
943
- if (!w)
944
- throw new Error(`Unexpected end of ${o}`);
945
- r = w.i, c = w.tagContent;
949
+ const b = this.readStopNodeData(t, l, c + 1);
950
+ if (!b)
951
+ throw new Error(`Unexpected end of ${l}`);
952
+ s = b.i, h = b.tagContent;
946
953
  }
947
- const f = new E(o);
948
- 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);
954
+ const w = new N(o);
955
+ o !== d && u && (w[":@"] = this.buildAttributesMap(d, n, o)), h && (h = this.parseTextData(h, o, n, !0, u, !0, !0)), n = n.substr(0, n.lastIndexOf(".")), w.add(this.options.textNodeName, h), this.addChild(i, w, n);
949
956
  } else {
950
- if (a.length > 0 && a.lastIndexOf("/") === a.length - 1) {
951
- 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));
952
- const c = new E(o);
953
- o !== a && d && (c[":@"] = this.buildAttributesMap(a, n, o)), this.addChild(i, c, n), n = n.substr(0, n.lastIndexOf("."));
957
+ if (d.length > 0 && d.lastIndexOf("/") === d.length - 1) {
958
+ o[o.length - 1] === "/" ? (o = o.substr(0, o.length - 1), n = n.substr(0, n.length - 1), d = o) : d = d.substr(0, d.length - 1), this.options.transformTagName && (o = this.options.transformTagName(o));
959
+ const h = new N(o);
960
+ o !== d && u && (h[":@"] = this.buildAttributesMap(d, n, o)), this.addChild(i, h, n), n = n.substr(0, n.lastIndexOf("."));
954
961
  } else {
955
- const c = new E(o);
956
- this.tagsNodeStack.push(i), o !== a && d && (c[":@"] = this.buildAttributesMap(a, n, o)), this.addChild(i, c, n), i = c;
962
+ const h = new N(o);
963
+ this.tagsNodeStack.push(i), o !== d && u && (h[":@"] = this.buildAttributesMap(d, n, o)), this.addChild(i, h, n), i = h;
957
964
  }
958
- s = "", r = u;
965
+ r = "", s = c;
959
966
  }
960
967
  }
961
968
  else
962
- s += t[r];
969
+ r += t[s];
963
970
  return e.child;
964
971
  };
965
972
  function de(t, e, i) {
966
- const s = this.options.updateTag(e.tagname, i, e[":@"]);
967
- s === !1 || (typeof s == "string" && (e.tagname = s), t.addChild(e));
973
+ const r = this.options.updateTag(e.tagname, i, e[":@"]);
974
+ r === !1 || (typeof r == "string" && (e.tagname = r), t.addChild(e));
968
975
  }
969
976
  const ue = function(t) {
970
977
  if (this.options.processEntities) {
@@ -985,66 +992,68 @@ const ue = function(t) {
985
992
  }
986
993
  return t;
987
994
  };
988
- function ce(t, e, i, s) {
989
- 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;
995
+ function ce(t, e, i, r) {
996
+ return t && (r === void 0 && (r = Object.keys(e.child).length === 0), t = this.parseTextData(t, e.tagname, i, !1, e[":@"] ? Object.keys(e[":@"]).length !== 0 : !1, r), t !== void 0 && t !== "" && e.add(this.options.textNodeName, t), t = ""), t;
990
997
  }
991
998
  function he(t, e, i) {
992
- const s = "*." + i;
999
+ const r = "*." + i;
993
1000
  for (const n in t) {
994
- const r = t[n];
995
- if (s === r || e === r)
1001
+ const s = t[n];
1002
+ if (r === s || e === s)
996
1003
  return !0;
997
1004
  }
998
1005
  return !1;
999
1006
  }
1000
1007
  function pe(t, e, i = ">") {
1001
- let s, n = "";
1002
- for (let r = e; r < t.length; r++) {
1003
- let l = t[r];
1004
- if (s)
1005
- l === s && (s = "");
1006
- else if (l === '"' || l === "'")
1007
- s = l;
1008
- else if (l === i[0])
1008
+ let r, n = "";
1009
+ for (let s = e; s < t.length; s++) {
1010
+ let a = t[s];
1011
+ if (r)
1012
+ a === r && (r = "");
1013
+ else if (a === '"' || a === "'")
1014
+ r = a;
1015
+ else if (a === i[0])
1009
1016
  if (i[1]) {
1010
- if (t[r + 1] === i[1])
1011
- return { data: n, index: r };
1017
+ if (t[s + 1] === i[1])
1018
+ return { data: n, index: s };
1012
1019
  } else
1013
- return { data: n, index: r };
1020
+ return { data: n, index: s };
1014
1021
  else
1015
- l === " " && (l = " ");
1016
- n += l;
1022
+ a === " " && (a = " ");
1023
+ n += a;
1017
1024
  }
1018
1025
  }
1019
- function x(t, e, i, s) {
1026
+ function x(t, e, i, r) {
1020
1027
  const n = t.indexOf(e, i);
1021
1028
  if (n === -1)
1022
- throw new Error(s);
1029
+ throw new Error(r);
1023
1030
  return n + e.length - 1;
1024
1031
  }
1025
- function C(t, e, i, s = ">") {
1026
- const n = pe(t, e + 1, s);
1032
+ function D(t, e, i, r = ">") {
1033
+ const n = pe(t, e + 1, r);
1027
1034
  if (!n)
1028
1035
  return;
1029
- let r = n.data;
1030
- const l = n.index, o = r.search(/\s/);
1031
- let a = r, d = !0;
1032
- if (o !== -1 && (a = r.substr(0, o).replace(/\s\s*$/, ""), r = r.substr(o + 1)), i) {
1033
- const u = a.indexOf(":");
1034
- u !== -1 && (a = a.substr(u + 1), d = a !== n.data.substr(u + 1));
1035
- }
1036
- return { tagName: a, tagExp: r, closeIndex: l, attrExpPresent: d };
1036
+ let s = n.data;
1037
+ const a = n.index, o = s.search(/\s/);
1038
+ let l = s, d = !0;
1039
+ o !== -1 && (l = s.substr(0, o).replace(/\s\s*$/, ""), s = s.substr(o + 1));
1040
+ const u = l;
1041
+ if (i) {
1042
+ const c = l.indexOf(":");
1043
+ c !== -1 && (l = l.substr(c + 1), d = l !== n.data.substr(c + 1));
1044
+ }
1045
+ return { tagName: l, tagExp: s, closeIndex: a, attrExpPresent: d, rawTagName: u };
1037
1046
  }
1038
1047
  function fe(t, e, i) {
1039
- const s = i;
1048
+ const r = i;
1040
1049
  let n = 1;
1041
1050
  for (; i < t.length; i++)
1042
1051
  if (t[i] === "<")
1043
1052
  if (t[i + 1] === "/") {
1044
- const r = x(t, ">", i, `${e} is not closed`);
1045
- if (t.substring(i + 2, r).trim() === e && (n--, n === 0))
1046
- return { tagContent: t.substring(s, i), i: r };
1047
- i = r;
1053
+ const s = x(t, ">", i, `${e} is not closed`);
1054
+ if (t.substring(i + 2, s).trim() === e && (n--, n === 0))
1055
+ return { tagContent: t.substring(r, i), i: s };
1056
+ i = s;
1048
1057
  } else if (t[i + 1] === "?")
1049
1058
  i = x(t, "?>", i + 1, "StopNode is not closed.");
1050
1059
  else if (t.substr(i + 1, 3) === "!--")
@@ -1052,64 +1061,64 @@ function fe(t, e, i) {
1052
1061
  else if (t.substr(i + 1, 2) === "![")
1053
1062
  i = x(t, "]]>", i, "StopNode is not closed.") - 2;
1054
1063
  else {
1055
- const r = C(t, i, ">");
1056
- r && ((r && r.tagName) === e && r.tagExp[r.tagExp.length - 1] !== "/" && n++, i = r.closeIndex);
1064
+ const s = D(t, i, ">");
1065
+ s && ((s && s.tagName) === e && s.tagExp[s.tagExp.length - 1] !== "/" && n++, i = s.closeIndex);
1057
1066
  }
1058
1067
  }
1059
- function D(t, e, i) {
1068
+ function S(t, e, i) {
1060
1069
  if (e && typeof t == "string") {
1061
- const s = t.trim();
1062
- return s === "true" ? !0 : s === "false" ? !1 : ee(t, i);
1070
+ const r = t.trim();
1071
+ return r === "true" ? !0 : r === "false" ? !1 : ee(t, i);
1063
1072
  } else
1064
- return R.isExist(t) ? t : "";
1073
+ return j.isExist(t) ? t : "";
1065
1074
  }
1066
- var ge = ie, it = {};
1075
+ var ge = ie, nt = {};
1067
1076
  function me(t, e) {
1068
- return nt(t, e);
1077
+ return rt(t, e);
1069
1078
  }
1070
- function nt(t, e, i) {
1071
- let s;
1079
+ function rt(t, e, i) {
1080
+ let r;
1072
1081
  const n = {};
1073
- for (let r = 0; r < t.length; r++) {
1074
- const l = t[r], o = we(l);
1075
- let a = "";
1076
- if (i === void 0 ? a = o : a = i + "." + o, o === e.textNodeName)
1077
- s === void 0 ? s = l[o] : s += "" + l[o];
1082
+ for (let s = 0; s < t.length; s++) {
1083
+ const a = t[s], o = we(a);
1084
+ let l = "";
1085
+ if (i === void 0 ? l = o : l = i + "." + o, o === e.textNodeName)
1086
+ r === void 0 ? r = a[o] : r += "" + a[o];
1078
1087
  else {
1079
1088
  if (o === void 0)
1080
1089
  continue;
1081
- if (l[o]) {
1082
- let d = nt(l[o], e, a);
1090
+ if (a[o]) {
1091
+ let d = rt(a[o], e, l);
1083
1092
  const u = ye(d, e);
1084
- l[":@"] ? ve(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;
1093
+ a[":@"] ? ve(d, a[":@"], l, 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, l, u) ? n[o] = [d] : n[o] = d;
1085
1094
  }
1086
1095
  }
1087
1096
  }
1088
- return typeof s == "string" ? s.length > 0 && (n[e.textNodeName] = s) : s !== void 0 && (n[e.textNodeName] = s), n;
1097
+ return typeof r == "string" ? r.length > 0 && (n[e.textNodeName] = r) : r !== void 0 && (n[e.textNodeName] = r), n;
1089
1098
  }
1090
1099
  function we(t) {
1091
1100
  const e = Object.keys(t);
1092
1101
  for (let i = 0; i < e.length; i++) {
1093
- const s = e[i];
1094
- if (s !== ":@")
1095
- return s;
1102
+ const r = e[i];
1103
+ if (r !== ":@")
1104
+ return r;
1096
1105
  }
1097
1106
  }
1098
- function ve(t, e, i, s) {
1107
+ function ve(t, e, i, r) {
1099
1108
  if (e) {
1100
- const n = Object.keys(e), r = n.length;
1101
- for (let l = 0; l < r; l++) {
1102
- const o = n[l];
1103
- s.isArray(o, i + "." + o, !0, !0) ? t[o] = [e[o]] : t[o] = e[o];
1109
+ const n = Object.keys(e), s = n.length;
1110
+ for (let a = 0; a < s; a++) {
1111
+ const o = n[a];
1112
+ r.isArray(o, i + "." + o, !0, !0) ? t[o] = [e[o]] : t[o] = e[o];
1104
1113
  }
1105
1114
  }
1106
1115
  }
1107
1116
  function ye(t, e) {
1108
- const { textNodeName: i } = e, s = Object.keys(t).length;
1109
- return !!(s === 0 || s === 1 && (t[i] || typeof t[i] == "boolean" || t[i] === 0));
1117
+ const { textNodeName: i } = e, r = Object.keys(t).length;
1118
+ return !!(r === 0 || r === 1 && (t[i] || typeof t[i] == "boolean" || t[i] === 0));
1110
1119
  }
1111
- it.prettify = me;
1112
- const { buildOptions: xe } = P, be = ge, { prettify: Ee } = it, Ne = k;
1120
+ nt.prettify = me;
1121
+ const { buildOptions: xe } = C, be = ge, { prettify: Ee } = nt, Ne = L;
1113
1122
  let _e = class {
1114
1123
  constructor(t) {
1115
1124
  this.externalEntities = {}, this.options = xe(t);
@@ -1128,8 +1137,8 @@ let _e = class {
1128
1137
  }
1129
1138
  const i = new be(this.options);
1130
1139
  i.addExternalEntities(this.externalEntities);
1131
- const s = i.parseXml(t);
1132
- return this.options.preserveOrder || s === void 0 ? s : Ee(s, this.options);
1140
+ const r = i.parseXml(t);
1141
+ return this.options.preserveOrder || r === void 0 ? r : Ee(r, this.options);
1133
1142
  }
1134
1143
  addEntity(t, e) {
1135
1144
  if (e.indexOf("&") !== -1)
@@ -1146,66 +1155,70 @@ const Te = `
1146
1155
  `;
1147
1156
  function Ie(t, e) {
1148
1157
  let i = "";
1149
- return e.format && e.indentBy.length > 0 && (i = Te), rt(t, e, "", i);
1158
+ return e.format && e.indentBy.length > 0 && (i = Te), st(t, e, "", i);
1150
1159
  }
1151
- function rt(t, e, i, s) {
1152
- let n = "", r = !1;
1153
- for (let l = 0; l < t.length; l++) {
1154
- const o = t[l], a = Oe(o);
1160
+ function st(t, e, i, r) {
1161
+ let n = "", s = !1;
1162
+ for (let a = 0; a < t.length; a++) {
1163
+ const o = t[a], l = Oe(o);
1164
+ if (l === void 0)
1165
+ continue;
1155
1166
  let d = "";
1156
- if (i.length === 0 ? d = a : d = `${i}.${a}`, a === e.textNodeName) {
1157
- let w = o[a];
1158
- Pe(d, e) || (w = e.tagValueProcessor(a, w), w = st(w, e)), r && (n += s), n += w, r = !1;
1167
+ if (i.length === 0 ? d = l : d = `${i}.${l}`, l === e.textNodeName) {
1168
+ let w = o[l];
1169
+ Pe(d, e) || (w = e.tagValueProcessor(l, w), w = ot(w, e)), s && (n += r), n += w, s = !1;
1159
1170
  continue;
1160
- } else if (a === e.cdataPropName) {
1161
- r && (n += s), n += `<![CDATA[${o[a][0][e.textNodeName]}]]>`, r = !1;
1171
+ } else if (l === e.cdataPropName) {
1172
+ s && (n += r), n += `<![CDATA[${o[l][0][e.textNodeName]}]]>`, s = !1;
1162
1173
  continue;
1163
- } else if (a === e.commentPropName) {
1164
- n += s + `<!--${o[a][0][e.textNodeName]}-->`, r = !0;
1174
+ } else if (l === e.commentPropName) {
1175
+ n += r + `<!--${o[l][0][e.textNodeName]}-->`, s = !0;
1165
1176
  continue;
1166
- } else if (a[0] === "?") {
1167
- const w = G(o[":@"], e), ot = a === "?xml" ? "" : s;
1168
- let N = o[a][0][e.textNodeName];
1169
- N = N.length !== 0 ? " " + N : "", n += ot + `<${a}${N}${w}?>`, r = !0;
1177
+ } else if (l[0] === "?") {
1178
+ const w = X(o[":@"], e), b = l === "?xml" ? "" : r;
1179
+ let _ = o[l][0][e.textNodeName];
1180
+ _ = _.length !== 0 ? " " + _ : "", n += b + `<${l}${_}${w}?>`, s = !0;
1170
1181
  continue;
1171
1182
  }
1172
- let u = s;
1183
+ let u = r;
1173
1184
  u !== "" && (u += e.indentBy);
1174
- const h = G(o[":@"], e), c = s + `<${a}${h}`, f = rt(o[a], e, d, u);
1175
- 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;
1185
+ const c = X(o[":@"], e), p = r + `<${l}${c}`, h = st(o[l], e, d, u);
1186
+ e.unpairedTags.indexOf(l) !== -1 ? e.suppressUnpairedNode ? n += p + ">" : n += p + "/>" : (!h || h.length === 0) && e.suppressEmptyNode ? n += p + "/>" : h && h.endsWith(">") ? n += p + `>${h}${r}</${l}>` : (n += p + ">", h && r !== "" && (h.includes("/>") || h.includes("</")) ? n += r + e.indentBy + h + r : n += h, n += `</${l}>`), s = !0;
1176
1187
  }
1177
1188
  return n;
1178
1189
  }
1179
1190
  function Oe(t) {
1180
1191
  const e = Object.keys(t);
1181
1192
  for (let i = 0; i < e.length; i++) {
1182
- const s = e[i];
1183
- if (s !== ":@")
1184
- return s;
1193
+ const r = e[i];
1194
+ if (t.hasOwnProperty(r) && r !== ":@")
1195
+ return r;
1185
1196
  }
1186
1197
  }
1187
- function G(t, e) {
1198
+ function X(t, e) {
1188
1199
  let i = "";
1189
1200
  if (t && !e.ignoreAttributes)
1190
- for (let s in t) {
1191
- let n = e.attributeValueProcessor(s, t[s]);
1192
- n = st(n, e), n === !0 && e.suppressBooleanAttributes ? i += ` ${s.substr(e.attributeNamePrefix.length)}` : i += ` ${s.substr(e.attributeNamePrefix.length)}="${n}"`;
1201
+ for (let r in t) {
1202
+ if (!t.hasOwnProperty(r))
1203
+ continue;
1204
+ let n = e.attributeValueProcessor(r, t[r]);
1205
+ n = ot(n, e), n === !0 && e.suppressBooleanAttributes ? i += ` ${r.substr(e.attributeNamePrefix.length)}` : i += ` ${r.substr(e.attributeNamePrefix.length)}="${n}"`;
1193
1206
  }
1194
1207
  return i;
1195
1208
  }
1196
1209
  function Pe(t, e) {
1197
1210
  t = t.substr(0, t.length - e.textNodeName.length - 1);
1198
1211
  let i = t.substr(t.lastIndexOf(".") + 1);
1199
- for (let s in e.stopNodes)
1200
- if (e.stopNodes[s] === t || e.stopNodes[s] === "*." + i)
1212
+ for (let r in e.stopNodes)
1213
+ if (e.stopNodes[r] === t || e.stopNodes[r] === "*." + i)
1201
1214
  return !0;
1202
1215
  return !1;
1203
1216
  }
1204
- function st(t, e) {
1217
+ function ot(t, e) {
1205
1218
  if (t && t.length > 0 && e.processEntities)
1206
1219
  for (let i = 0; i < e.entities.length; i++) {
1207
- const s = e.entities[i];
1208
- t = t.replace(s.regex, s.val);
1220
+ const r = e.entities[i];
1221
+ t = t.replace(r.regex, r.val);
1209
1222
  }
1210
1223
  return t;
1211
1224
  }
@@ -1227,65 +1240,66 @@ function y(t) {
1227
1240
  y.prototype.build = function(t) {
1228
1241
  return this.options.preserveOrder ? De(t, this.options) : (Array.isArray(t) && this.options.arrayNodeName && this.options.arrayNodeName.length > 1 && (t = { [this.options.arrayNodeName]: t }), this.j2x(t, 0).val);
1229
1242
  }, y.prototype.j2x = function(t, e) {
1230
- let i = "", s = "";
1243
+ let i = "", r = "";
1231
1244
  for (let n in t)
1232
- if (typeof t[n] > "u")
1233
- this.isAttribute(n) && (s += "");
1234
- else if (t[n] === null)
1235
- this.isAttribute(n) ? s += "" : n[0] === "?" ? s += this.indentate(e) + "<" + n + "?" + this.tagEndChar : s += this.indentate(e) + "<" + n + "/" + this.tagEndChar;
1236
- else if (t[n] instanceof Date)
1237
- s += this.buildTextValNode(t[n], n, "", e);
1238
- else if (typeof t[n] != "object") {
1239
- const r = this.isAttribute(n);
1240
- if (r)
1241
- i += this.buildAttrPairStr(r, "" + t[n]);
1242
- else if (n === this.options.textNodeName) {
1243
- let l = this.options.tagValueProcessor(n, "" + t[n]);
1244
- s += this.replaceEntitiesValue(l);
1245
+ if (t.hasOwnProperty(n))
1246
+ if (typeof t[n] > "u")
1247
+ this.isAttribute(n) && (r += "");
1248
+ else if (t[n] === null)
1249
+ this.isAttribute(n) ? r += "" : n[0] === "?" ? r += this.indentate(e) + "<" + n + "?" + this.tagEndChar : r += this.indentate(e) + "<" + n + "/" + this.tagEndChar;
1250
+ else if (t[n] instanceof Date)
1251
+ r += this.buildTextValNode(t[n], n, "", e);
1252
+ else if (typeof t[n] != "object") {
1253
+ const s = this.isAttribute(n);
1254
+ if (s)
1255
+ i += this.buildAttrPairStr(s, "" + t[n]);
1256
+ else if (n === this.options.textNodeName) {
1257
+ let a = this.options.tagValueProcessor(n, "" + t[n]);
1258
+ r += this.replaceEntitiesValue(a);
1259
+ } else
1260
+ r += this.buildTextValNode(t[n], n, "", e);
1261
+ } else if (Array.isArray(t[n])) {
1262
+ const s = t[n].length;
1263
+ let a = "";
1264
+ for (let o = 0; o < s; o++) {
1265
+ const l = t[n][o];
1266
+ typeof l > "u" || (l === null ? n[0] === "?" ? r += this.indentate(e) + "<" + n + "?" + this.tagEndChar : r += this.indentate(e) + "<" + n + "/" + this.tagEndChar : typeof l == "object" ? this.options.oneListGroup ? a += this.j2x(l, e + 1).val : a += this.processTextOrObjNode(l, n, e) : a += this.buildTextValNode(l, n, "", e));
1267
+ }
1268
+ this.options.oneListGroup && (a = this.buildObjectNode(a, n, "", e)), r += a;
1269
+ } else if (this.options.attributesGroupName && n === this.options.attributesGroupName) {
1270
+ const s = Object.keys(t[n]), a = s.length;
1271
+ for (let o = 0; o < a; o++)
1272
+ i += this.buildAttrPairStr(s[o], "" + t[n][s[o]]);
1245
1273
  } else
1246
- s += this.buildTextValNode(t[n], n, "", e);
1247
- } else if (Array.isArray(t[n])) {
1248
- const r = t[n].length;
1249
- let l = "";
1250
- for (let o = 0; o < r; o++) {
1251
- const a = t[n][o];
1252
- 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));
1253
- }
1254
- this.options.oneListGroup && (l = this.buildObjectNode(l, n, "", e)), s += l;
1255
- } else if (this.options.attributesGroupName && n === this.options.attributesGroupName) {
1256
- const r = Object.keys(t[n]), l = r.length;
1257
- for (let o = 0; o < l; o++)
1258
- i += this.buildAttrPairStr(r[o], "" + t[n][r[o]]);
1259
- } else
1260
- s += this.processTextOrObjNode(t[n], n, e);
1261
- return { attrStr: i, val: s };
1274
+ r += this.processTextOrObjNode(t[n], n, e);
1275
+ return { attrStr: i, val: r };
1262
1276
  }, y.prototype.buildAttrPairStr = function(t, e) {
1263
1277
  return e = this.options.attributeValueProcessor(t, "" + e), e = this.replaceEntitiesValue(e), this.options.suppressBooleanAttributes && e === "true" ? " " + t : " " + t + '="' + e + '"';
1264
1278
  };
1265
1279
  function Fe(t, e, i) {
1266
- const s = this.j2x(t, i + 1);
1267
- 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);
1280
+ const r = this.j2x(t, i + 1);
1281
+ return t[this.options.textNodeName] !== void 0 && Object.keys(t).length === 1 ? this.buildTextValNode(t[this.options.textNodeName], e, r.attrStr, i) : this.buildObjectNode(r.val, e, r.attrStr, i);
1268
1282
  }
1269
- y.prototype.buildObjectNode = function(t, e, i, s) {
1283
+ y.prototype.buildObjectNode = function(t, e, i, r) {
1270
1284
  if (t === "")
1271
- return e[0] === "?" ? this.indentate(s) + "<" + e + i + "?" + this.tagEndChar : this.indentate(s) + "<" + e + i + this.closeTag(e) + this.tagEndChar;
1285
+ return e[0] === "?" ? this.indentate(r) + "<" + e + i + "?" + this.tagEndChar : this.indentate(r) + "<" + e + i + this.closeTag(e) + this.tagEndChar;
1272
1286
  {
1273
- let n = "</" + e + this.tagEndChar, r = "";
1274
- 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;
1287
+ let n = "</" + e + this.tagEndChar, s = "";
1288
+ return e[0] === "?" && (s = "?", n = ""), (i || i === "") && t.indexOf("<") === -1 ? this.indentate(r) + "<" + e + i + s + ">" + t + n : this.options.commentPropName !== !1 && e === this.options.commentPropName && s.length === 0 ? this.indentate(r) + `<!--${t}-->` + this.newLine : this.indentate(r) + "<" + e + i + s + this.tagEndChar + t + this.indentate(r) + n;
1275
1289
  }
1276
1290
  }, y.prototype.closeTag = function(t) {
1277
1291
  let e = "";
1278
1292
  return this.options.unpairedTags.indexOf(t) !== -1 ? this.options.suppressUnpairedNode || (e = "/") : this.options.suppressEmptyNode ? e = "/" : e = `></${t}`, e;
1279
- }, y.prototype.buildTextValNode = function(t, e, i, s) {
1293
+ }, y.prototype.buildTextValNode = function(t, e, i, r) {
1280
1294
  if (this.options.cdataPropName !== !1 && e === this.options.cdataPropName)
1281
- return this.indentate(s) + `<![CDATA[${t}]]>` + this.newLine;
1295
+ return this.indentate(r) + `<![CDATA[${t}]]>` + this.newLine;
1282
1296
  if (this.options.commentPropName !== !1 && e === this.options.commentPropName)
1283
- return this.indentate(s) + `<!--${t}-->` + this.newLine;
1297
+ return this.indentate(r) + `<!--${t}-->` + this.newLine;
1284
1298
  if (e[0] === "?")
1285
- return this.indentate(s) + "<" + e + i + "?" + this.tagEndChar;
1299
+ return this.indentate(r) + "<" + e + i + "?" + this.tagEndChar;
1286
1300
  {
1287
1301
  let n = this.options.tagValueProcessor(e, t);
1288
- 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;
1302
+ return n = this.replaceEntitiesValue(n), n === "" ? this.indentate(r) + "<" + e + i + this.closeTag(e) + this.tagEndChar : this.indentate(r) + "<" + e + i + ">" + n + "</" + e + this.tagEndChar;
1289
1303
  }
1290
1304
  }, y.prototype.replaceEntitiesValue = function(t) {
1291
1305
  if (t && t.length > 0 && this.options.processEntities)
@@ -1302,15 +1316,15 @@ function $e(t) {
1302
1316
  return t.startsWith(this.options.attributeNamePrefix) && t !== this.options.textNodeName ? t.substr(this.attrPrefixLen) : !1;
1303
1317
  }
1304
1318
  var ke = y;
1305
- const Le = k, Re = Ae, je = ke;
1306
- var X = { XMLParser: Re, XMLValidator: Le, XMLBuilder: je };
1319
+ const Le = L, Re = Ae, je = ke;
1320
+ var H = { XMLParser: Re, XMLValidator: Le, XMLBuilder: je };
1307
1321
  function Me(t) {
1308
1322
  if (typeof t != "string")
1309
1323
  throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);
1310
- if (t = t.trim(), t.length === 0 || X.XMLValidator.validate(t) !== !0)
1324
+ if (t = t.trim(), t.length === 0 || H.XMLValidator.validate(t) !== !0)
1311
1325
  return !1;
1312
1326
  let e;
1313
- const i = new X.XMLParser();
1327
+ const i = new H.XMLParser();
1314
1328
  try {
1315
1329
  e = i.parse(t);
1316
1330
  } catch {
@@ -1409,23 +1423,23 @@ const Be = function(t) {
1409
1423
  throw new Error("View defaultSortKey must be a string");
1410
1424
  return !0;
1411
1425
  }, di = function(t) {
1412
- return S().registerEntry(t);
1426
+ return F().registerEntry(t);
1413
1427
  }, ui = function(t) {
1414
- return S().unregisterEntry(t);
1428
+ return F().unregisterEntry(t);
1415
1429
  }, ci = function(t) {
1416
- return S().getEntries(t);
1430
+ return F().getEntries(t);
1417
1431
  };
1418
1432
  export {
1419
1433
  _t as Column,
1420
- H as DefaultType,
1434
+ K as DefaultType,
1421
1435
  xt as File,
1422
1436
  Ye as FileAction,
1423
- $ as FileType,
1437
+ k as FileType,
1424
1438
  bt as Folder,
1425
1439
  Qe as Header,
1426
1440
  Nt as Navigation,
1427
- J as Node,
1428
- Z as NodeStatus,
1441
+ Q as Node,
1442
+ J as NodeStatus,
1429
1443
  v as Permission,
1430
1444
  li as View,
1431
1445
  di as addNewFileMenuEntry,
@@ -1434,14 +1448,14 @@ export {
1434
1448
  vt as davGetFavoritesReport,
1435
1449
  ri as davGetRecentSearch,
1436
1450
  yt as davParsePermissions,
1437
- tt as davRemoteURL,
1451
+ et as davRemoteURL,
1438
1452
  Et as davResultToNode,
1439
- Q as davRootPath,
1440
- W as defaultDavNamespaces,
1441
- K as defaultDavProperties,
1453
+ tt as davRootPath,
1454
+ Y as defaultDavNamespaces,
1455
+ W as defaultDavProperties,
1442
1456
  We as formatFileSize,
1443
- V as getDavNameSpaces,
1444
- F as getDavProperties,
1457
+ $ as getDavNameSpaces,
1458
+ V as getDavProperties,
1445
1459
  oi as getFavoriteNodes,
1446
1460
  Je as getFileActions,
1447
1461
  ei as getFileListHeaders,