lone-format 0.13.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { defineComponent as Ce, useCssVars as $e, ref as q, computed as L, resolveComponent as De, createElementBlock as w, openBlock as $, normalizeStyle as r, createCommentVNode as pe, createElementVNode as n, toDisplayString as E, withKeys as A, withModifiers as j, Fragment as re, renderList as ie, createBlock as Be, nextTick as ne, watch as Ee, normalizeClass as Ve } from "vue";
1
+ import { defineComponent as Ce, useCssVars as $e, ref as I, computed as L, resolveComponent as De, createElementBlock as w, openBlock as $, normalizeStyle as c, createCommentVNode as pe, createElementVNode as n, toDisplayString as D, withKeys as A, withModifiers as j, Fragment as se, renderList as ie, createBlock as Be, nextTick as ae, watch as Ee, normalizeClass as Ve } from "vue";
2
2
  import We from "xpath";
3
3
  import { DOMParser as Ke, XMLSerializer as Xe } from "@xmldom/xmldom";
4
4
  import { _ as we } from "./_plugin-vue_export-helper-CHgC5LLL.js";
@@ -55,749 +55,749 @@ const Re = {
55
55
  cd71bc7c: e.theme.colors.collapsedBackgroundHover,
56
56
  "30a02a6b": e.theme.colors.indentLine
57
57
  }));
58
- const c = s, f = m, v = q(!1), o = q(null), y = q(null), V = q(!1), B = q(!1), x = q(""), b = q(""), X = q(""), P = q(""), S = q(""), N = q(null), z = q(null), Q = q(null), U = q(null), Y = q(null), K = L(() => Object.keys(c.node).find((i) => !i.startsWith(":") && !i.startsWith("#")) || ""), J = L(() => K.value ? c.parentPath ? `${c.parentPath}.${K.value}[${c.index}]` : `${K.value}[${c.index}]` : ""), te = L(() => c.expanded.has(J.value)), T = L(() => c.node["#comment"] ? "comment" : c.node.__cdata ? "cdata" : K.value ? "element" : "unknown"), R = L(() => {
59
- const e = c.node[":@"] || {}, i = {};
58
+ const i = s, p = m, y = I(!1), o = I(null), h = I(null), E = I(!1), B = I(!1), x = I(""), b = I(""), X = I(""), O = I(""), S = I(""), P = I(null), z = I(null), Q = I(null), U = I(null), Y = I(null), K = L(() => Object.keys(i.node).find((r) => !r.startsWith(":") && !r.startsWith("#")) || ""), J = L(() => K.value ? i.parentPath ? `${i.parentPath}.${K.value}[${i.index}]` : `${K.value}[${i.index}]` : ""), ee = L(() => i.expanded.has(J.value)), T = L(() => i.node["#comment"] ? "comment" : i.node.__cdata ? "cdata" : K.value ? "element" : "unknown"), R = L(() => {
59
+ const e = i.node[":@"] || {}, r = {};
60
60
  return Object.keys(e).forEach((M) => {
61
- M.startsWith("@_") && (i[M.substring(2)] = e[M]);
62
- }), i;
61
+ M.startsWith("@_") && (r[M.substring(2)] = e[M]);
62
+ }), r;
63
63
  }), G = L(() => {
64
64
  if (T.value !== "element" || !K.value) return [];
65
- const e = c.node[K.value];
65
+ const e = i.node[K.value];
66
66
  return Array.isArray(e) ? e : [];
67
67
  }), ue = L(() => G.value.some((e) => e.__cdata)), de = L(() => {
68
68
  if (!ue.value) return "";
69
- const e = G.value.find((i) => i.__cdata);
69
+ const e = G.value.find((r) => r.__cdata);
70
70
  if (e && Array.isArray(e.__cdata)) {
71
- const i = e.__cdata;
72
- if (i.length > 0 && i[0]["#text"])
73
- return i[0]["#text"];
71
+ const r = e.__cdata;
72
+ if (r.length > 0 && r[0]["#text"])
73
+ return r[0]["#text"];
74
74
  }
75
75
  return "";
76
- }), le = L(() => {
76
+ }), te = L(() => {
77
77
  if (T.value !== "element" || !K.value || ue.value) return "";
78
- const e = c.node[K.value];
78
+ const e = i.node[K.value];
79
79
  if (!Array.isArray(e)) return "";
80
- const i = e.find((M) => M["#text"]);
81
- return i ? i["#text"] : "";
82
- }), ye = L(() => {
80
+ const r = e.find((M) => M["#text"]);
81
+ return r ? r["#text"] : "";
82
+ }), he = L(() => {
83
83
  if (T.value !== "comment") return "";
84
- const e = c.node["#comment"];
84
+ const e = i.node["#comment"];
85
85
  return Array.isArray(e) && e.length > 0 && e[0]["#text"] || "";
86
- }), Z = L(() => G.value.some((e) => Object.keys(e).some((M) => !M.startsWith("#") && !M.startsWith(":")))), me = L(() => Z.value ? G.value.filter((e) => Object.keys(e).some((M) => !M.startsWith("#") && !M.startsWith(":"))).length : 0), he = L(() => T.value === "element" && !Z.value && le.value !== ""), fe = L(() => T.value === "element" && !Z.value && le.value === ""), be = L(() => fe.value ? c.node[":selfClosing"] === !0 : !1), oe = () => {
87
- Z.value && f("toggle-expand", J.value);
88
- }, _e = (e, i) => `${J.value}-child-${i}`, xe = () => `${J.value}.${K.value}`, ae = () => {
89
- v.value = !0, x.value = K.value, ne(() => {
90
- if (N.value) {
91
- N.value.focus();
86
+ }), Z = L(() => G.value.some((e) => Object.keys(e).some((M) => !M.startsWith("#") && !M.startsWith(":")))), me = L(() => Z.value ? G.value.filter((e) => Object.keys(e).some((M) => !M.startsWith("#") && !M.startsWith(":"))).length : 0), be = L(() => T.value === "element" && !Z.value && te.value !== ""), fe = L(() => T.value === "element" && !Z.value && te.value === ""), ye = L(() => fe.value ? i.node[":selfClosing"] === !0 : !1), ne = () => {
87
+ Z.value && p("toggle-expand", J.value);
88
+ }, _e = (e, r) => `${J.value}-child-${r}`, xe = () => `${J.value}.${K.value}`, le = () => {
89
+ y.value = !0, x.value = K.value, ae(() => {
90
+ if (P.value) {
91
+ P.value.focus();
92
92
  const e = document.createRange();
93
- e.selectNodeContents(N.value);
94
- const i = window.getSelection();
95
- i?.removeAllRanges(), i?.addRange(e);
93
+ e.selectNodeContents(P.value);
94
+ const r = window.getSelection();
95
+ r?.removeAllRanges(), r?.addRange(e);
96
96
  }
97
97
  });
98
- }, l = (e) => {
99
- o.value = e, b.value = e, ne(() => {
98
+ }, ce = (e) => {
99
+ o.value = e, b.value = e, ae(() => {
100
100
  if (z.value) {
101
101
  z.value.focus();
102
- const i = document.createRange();
103
- i.selectNodeContents(z.value);
102
+ const r = document.createRange();
103
+ r.selectNodeContents(z.value);
104
104
  const M = window.getSelection();
105
- M?.removeAllRanges(), M?.addRange(i);
105
+ M?.removeAllRanges(), M?.addRange(r);
106
106
  }
107
107
  });
108
- }, d = (e) => {
109
- y.value = e, X.value = R.value[e] || "", ne(() => {
108
+ }, t = (e) => {
109
+ h.value = e, X.value = R.value[e] || "", ae(() => {
110
110
  if (Q.value) {
111
111
  Q.value.focus();
112
- const i = document.createRange();
113
- i.selectNodeContents(Q.value);
112
+ const r = document.createRange();
113
+ r.selectNodeContents(Q.value);
114
114
  const M = window.getSelection();
115
- M?.removeAllRanges(), M?.addRange(i);
115
+ M?.removeAllRanges(), M?.addRange(r);
116
116
  }
117
117
  });
118
- }, g = () => {
119
- V.value = !0, P.value = le.value, ne(() => {
118
+ }, d = () => {
119
+ E.value = !0, O.value = te.value, ae(() => {
120
120
  if (U.value) {
121
121
  U.value.focus();
122
122
  const e = document.createRange();
123
123
  e.selectNodeContents(U.value);
124
- const i = window.getSelection();
125
- i?.removeAllRanges(), i?.addRange(e);
124
+ const r = window.getSelection();
125
+ r?.removeAllRanges(), r?.addRange(e);
126
126
  }
127
127
  });
128
- }, t = () => {
129
- if (!v.value) return;
130
- const e = N.value?.innerText.trim() || "";
128
+ }, f = () => {
129
+ if (!y.value) return;
130
+ const e = P.value?.innerText.trim() || "";
131
131
  if (!e || e === K.value) {
132
- v.value = !1;
132
+ y.value = !1;
133
133
  return;
134
134
  }
135
- v.value = !1, f("update:tagName", J.value, K.value, e);
136
- }, a = () => {
135
+ y.value = !1, p("update:tagName", J.value, K.value, e);
136
+ }, l = () => {
137
137
  if (!o.value) return;
138
- const e = o.value, i = z.value?.innerText.trim() || "";
139
- if (!i || i === e) {
138
+ const e = o.value, r = z.value?.innerText.trim() || "";
139
+ if (!r || r === e) {
140
140
  o.value = null;
141
141
  return;
142
142
  }
143
- o.value = null, f("update:attributeName", J.value, e, i);
144
- }, h = () => {
145
- if (!y.value) return;
146
- const e = y.value, i = Q.value?.innerText.trim() || "";
147
- y.value = null, f("update:attributeValue", J.value, e, i);
148
- }, p = () => {
149
- if (!V.value) return;
143
+ o.value = null, p("update:attributeName", J.value, e, r);
144
+ }, a = () => {
145
+ if (!h.value) return;
146
+ const e = h.value, r = Q.value?.innerText.trim() || "";
147
+ h.value = null, p("update:attributeValue", J.value, e, r);
148
+ }, g = () => {
149
+ if (!E.value) return;
150
150
  const e = U.value?.innerText || "";
151
- if (e === le.value) {
152
- V.value = !1;
151
+ if (e === te.value) {
152
+ E.value = !1;
153
153
  return;
154
154
  }
155
- V.value = !1, f("update:textContent", J.value, e);
155
+ E.value = !1, p("update:textContent", J.value, e);
156
+ }, v = () => {
157
+ y.value = !1, x.value = K.value;
156
158
  }, C = () => {
157
- v.value = !1, x.value = K.value;
158
- }, k = () => {
159
159
  o.value && (b.value = o.value, o.value = null);
160
- }, O = () => {
161
- y.value && (X.value = R.value[y.value] || "", y.value = null);
160
+ }, k = () => {
161
+ h.value && (X.value = R.value[h.value] || "", h.value = null);
162
+ }, N = () => {
163
+ E.value = !1, O.value = te.value;
162
164
  }, W = () => {
163
- V.value = !1, P.value = le.value;
164
- }, I = () => {
165
- B.value = !0, S.value = de.value, ne(() => {
165
+ B.value = !0, S.value = de.value, ae(() => {
166
166
  if (Y.value) {
167
167
  Y.value.focus();
168
168
  const e = document.createRange();
169
169
  e.selectNodeContents(Y.value);
170
- const i = window.getSelection();
171
- i?.removeAllRanges(), i?.addRange(e);
170
+ const r = window.getSelection();
171
+ r?.removeAllRanges(), r?.addRange(e);
172
172
  }
173
173
  });
174
- }, D = () => {
174
+ }, q = () => {
175
175
  if (!B.value) return;
176
176
  const e = Y.value?.innerText || "";
177
177
  if (e === de.value) {
178
178
  B.value = !1;
179
179
  return;
180
180
  }
181
- B.value = !1, f("update:cdataContent", J.value, e);
182
- }, ee = () => {
181
+ B.value = !1, p("update:cdataContent", J.value, e);
182
+ }, V = () => {
183
183
  B.value = !1, S.value = de.value;
184
184
  }, H = (e) => {
185
- Z.value && (e.preventDefault(), ae());
185
+ Z.value && (e.preventDefault(), le());
186
186
  };
187
- return (e, i) => {
187
+ return (e, r) => {
188
188
  const M = De("XmlNode", !0);
189
189
  return $(), w("div", {
190
190
  class: "xml-node",
191
- style: r({ paddingLeft: e.level > 0 ? "16px" : "0" })
191
+ style: c({ paddingLeft: e.level > 0 ? "16px" : "0" })
192
192
  }, [
193
193
  T.value === "comment" ? ($(), w("div", Re, [
194
194
  n("span", {
195
- style: r({ color: e.theme.colors.xmlComment })
196
- }, " <!-- " + E(ye.value) + " --> ", 5)
195
+ style: c({ color: e.theme.colors.xmlComment })
196
+ }, " <!-- " + D(he.value) + " --> ", 5)
197
197
  ])) : T.value === "cdata" ? ($(), w("div", je, [
198
198
  n("span", {
199
- style: r({ color: e.theme.colors.xmlCdata })
200
- }, " <![CDATA[" + E(e.node.__cdata) + "]]> ", 5)
199
+ style: c({ color: e.theme.colors.xmlCdata })
200
+ }, " <![CDATA[" + D(e.node.__cdata) + "]]> ", 5)
201
201
  ])) : T.value === "element" ? ($(), w("div", qe, [
202
202
  ue.value ? ($(), w("div", Ie, [
203
203
  n("span", {
204
204
  class: "xml-node__bracket",
205
- style: r({ color: e.theme.colors.xmlBracket })
205
+ style: c({ color: e.theme.colors.xmlBracket })
206
206
  }, "<", 4),
207
207
  n("span", {
208
208
  class: "xml-node__tag xml-node__tag--editable",
209
- style: r({ color: e.theme.colors.xmlTag }),
210
- contenteditable: v.value,
211
- onDblclick: ae,
209
+ style: c({ color: e.theme.colors.xmlTag }),
210
+ contenteditable: y.value,
211
+ onDblclick: le,
212
212
  onContextmenu: H,
213
213
  onKeydown: [
214
- A(j(t, ["prevent"]), ["enter"]),
215
- A(C, ["escape"])
214
+ A(j(f, ["prevent"]), ["enter"]),
215
+ A(v, ["escape"])
216
216
  ],
217
- onBlur: t,
217
+ onBlur: f,
218
218
  ref_key: "tagNameRef",
219
- ref: N,
219
+ ref: P,
220
220
  title: "Double-click to edit tag name"
221
- }, E(v.value ? x.value : K.value), 45, Le),
222
- ($(!0), w(re, null, ie(R.value, (F, u) => ($(), w("span", {
221
+ }, D(y.value ? x.value : K.value), 45, Le),
222
+ ($(!0), w(se, null, ie(R.value, (F, u) => ($(), w("span", {
223
223
  key: u,
224
224
  class: "xml-node__attribute"
225
225
  }, [
226
226
  n("span", {
227
227
  class: "xml-node__attr-name xml-node__attr-name--editable",
228
- style: r({ color: e.theme.colors.xmlAttribute }),
228
+ style: c({ color: e.theme.colors.xmlAttribute }),
229
229
  contenteditable: o.value === u,
230
- onDblclick: (_) => l(u),
230
+ onDblclick: (_) => ce(u),
231
231
  onKeydown: [
232
- A(j(a, ["prevent"]), ["enter"]),
233
- A(k, ["escape"])
232
+ A(j(l, ["prevent"]), ["enter"]),
233
+ A(C, ["escape"])
234
234
  ],
235
- onBlur: a,
235
+ onBlur: l,
236
236
  ref_for: !0,
237
237
  ref: (_) => {
238
238
  o.value === u && (z.value = _);
239
239
  },
240
240
  title: "Double-click to edit attribute name"
241
- }, E(o.value === u ? b.value : u), 45, Ue),
241
+ }, D(o.value === u ? b.value : u), 45, Ue),
242
242
  n("span", {
243
243
  class: "xml-node__equals",
244
- style: r({ color: e.theme.colors.xmlEquals })
244
+ style: c({ color: e.theme.colors.xmlEquals })
245
245
  }, "=", 4),
246
246
  n("span", {
247
247
  class: "xml-node__quote",
248
- style: r({ color: e.theme.colors.xmlQuote })
248
+ style: c({ color: e.theme.colors.xmlQuote })
249
249
  }, '"', 4),
250
250
  n("span", {
251
251
  class: "xml-node__attr-value xml-node__attr-value--editable",
252
- style: r({ color: e.theme.colors.xmlAttributeValue }),
253
- contenteditable: y.value === u,
254
- onDblclick: (_) => d(u),
252
+ style: c({ color: e.theme.colors.xmlAttributeValue }),
253
+ contenteditable: h.value === u,
254
+ onDblclick: (_) => t(u),
255
255
  onKeydown: [
256
- A(j(h, ["prevent"]), ["enter"]),
257
- A(O, ["escape"])
256
+ A(j(a, ["prevent"]), ["enter"]),
257
+ A(k, ["escape"])
258
258
  ],
259
- onBlur: h,
259
+ onBlur: a,
260
260
  ref_for: !0,
261
261
  ref: (_) => {
262
- y.value === u && (Q.value = _);
262
+ h.value === u && (Q.value = _);
263
263
  },
264
264
  title: "Double-click to edit attribute value"
265
- }, E(y.value === u ? X.value : F), 45, Fe),
265
+ }, D(h.value === u ? X.value : F), 45, Fe),
266
266
  n("span", {
267
267
  class: "xml-node__quote",
268
- style: r({ color: e.theme.colors.xmlQuote })
268
+ style: c({ color: e.theme.colors.xmlQuote })
269
269
  }, '"', 4)
270
270
  ]))), 128)),
271
271
  n("span", {
272
272
  class: "xml-node__bracket",
273
- style: r({ color: e.theme.colors.xmlBracket })
273
+ style: c({ color: e.theme.colors.xmlBracket })
274
274
  }, ">", 4),
275
275
  n("span", {
276
276
  class: "xml-node__cdata",
277
- style: r({ color: e.theme.colors.xmlCdata })
277
+ style: c({ color: e.theme.colors.xmlCdata })
278
278
  }, "<![CDATA[", 4),
279
279
  n("span", {
280
280
  class: "xml-node__cdata-content xml-node__cdata-content--editable",
281
- style: r({ color: e.theme.colors.xmlCdata }),
281
+ style: c({ color: e.theme.colors.xmlCdata }),
282
282
  contenteditable: B.value,
283
- onDblclick: I,
283
+ onDblclick: W,
284
284
  onKeydown: [
285
- A(j(D, ["prevent"]), ["enter"]),
286
- A(ee, ["escape"])
285
+ A(j(q, ["prevent"]), ["enter"]),
286
+ A(V, ["escape"])
287
287
  ],
288
- onBlur: D,
288
+ onBlur: q,
289
289
  ref_key: "cdataContentRef",
290
290
  ref: Y,
291
291
  title: "Double-click to edit CDATA content"
292
- }, E(B.value ? S.value : de.value), 45, Me),
292
+ }, D(B.value ? S.value : de.value), 45, Me),
293
293
  n("span", {
294
294
  class: "xml-node__cdata",
295
- style: r({ color: e.theme.colors.xmlCdata })
295
+ style: c({ color: e.theme.colors.xmlCdata })
296
296
  }, "]]>", 4),
297
297
  n("span", {
298
298
  class: "xml-node__bracket",
299
- style: r({ color: e.theme.colors.xmlBracket })
299
+ style: c({ color: e.theme.colors.xmlBracket })
300
300
  }, "</", 4),
301
301
  n("span", {
302
302
  class: "xml-node__tag",
303
- style: r({ color: e.theme.colors.xmlTag })
304
- }, E(v.value ? x.value : K.value), 5),
303
+ style: c({ color: e.theme.colors.xmlTag })
304
+ }, D(y.value ? x.value : K.value), 5),
305
305
  n("span", {
306
306
  class: "xml-node__bracket",
307
- style: r({ color: e.theme.colors.xmlBracket })
307
+ style: c({ color: e.theme.colors.xmlBracket })
308
308
  }, ">", 4)
309
- ])) : he.value ? ($(), w("div", Se, [
309
+ ])) : be.value ? ($(), w("div", Se, [
310
310
  n("span", {
311
311
  class: "xml-node__bracket",
312
- style: r({ color: e.theme.colors.xmlBracket })
312
+ style: c({ color: e.theme.colors.xmlBracket })
313
313
  }, "<", 4),
314
314
  n("span", {
315
315
  class: "xml-node__tag xml-node__tag--editable",
316
- style: r({ color: e.theme.colors.xmlTag }),
317
- contenteditable: v.value,
318
- onDblclick: ae,
316
+ style: c({ color: e.theme.colors.xmlTag }),
317
+ contenteditable: y.value,
318
+ onDblclick: le,
319
319
  onContextmenu: H,
320
320
  onKeydown: [
321
- A(j(t, ["prevent"]), ["enter"]),
322
- A(C, ["escape"])
321
+ A(j(f, ["prevent"]), ["enter"]),
322
+ A(v, ["escape"])
323
323
  ],
324
- onBlur: t,
324
+ onBlur: f,
325
325
  ref_key: "tagNameRef",
326
- ref: N,
326
+ ref: P,
327
327
  title: "Double-click to edit tag name"
328
- }, E(v.value ? x.value : K.value), 45, Qe),
329
- ($(!0), w(re, null, ie(R.value, (F, u) => ($(), w("span", {
328
+ }, D(y.value ? x.value : K.value), 45, Qe),
329
+ ($(!0), w(se, null, ie(R.value, (F, u) => ($(), w("span", {
330
330
  key: u,
331
331
  class: "xml-node__attribute"
332
332
  }, [
333
333
  n("span", {
334
334
  class: "xml-node__attr-name xml-node__attr-name--editable",
335
- style: r({ color: e.theme.colors.xmlAttribute }),
335
+ style: c({ color: e.theme.colors.xmlAttribute }),
336
336
  contenteditable: o.value === u,
337
- onDblclick: (_) => l(u),
337
+ onDblclick: (_) => ce(u),
338
338
  onKeydown: [
339
- A(j(a, ["prevent"]), ["enter"]),
340
- A(k, ["escape"])
339
+ A(j(l, ["prevent"]), ["enter"]),
340
+ A(C, ["escape"])
341
341
  ],
342
- onBlur: a,
342
+ onBlur: l,
343
343
  ref_for: !0,
344
344
  ref: (_) => {
345
345
  o.value === u && (z.value = _);
346
346
  },
347
347
  title: "Double-click to edit attribute name"
348
- }, E(o.value === u ? b.value : u), 45, He),
348
+ }, D(o.value === u ? b.value : u), 45, He),
349
349
  n("span", {
350
350
  class: "xml-node__equals",
351
- style: r({ color: e.theme.colors.xmlEquals })
351
+ style: c({ color: e.theme.colors.xmlEquals })
352
352
  }, "=", 4),
353
353
  n("span", {
354
354
  class: "xml-node__quote",
355
- style: r({ color: e.theme.colors.xmlQuote })
355
+ style: c({ color: e.theme.colors.xmlQuote })
356
356
  }, '"', 4),
357
357
  n("span", {
358
358
  class: "xml-node__attr-value xml-node__attr-value--editable",
359
- style: r({ color: e.theme.colors.xmlAttributeValue }),
360
- contenteditable: y.value === u,
361
- onDblclick: (_) => d(u),
359
+ style: c({ color: e.theme.colors.xmlAttributeValue }),
360
+ contenteditable: h.value === u,
361
+ onDblclick: (_) => t(u),
362
362
  onKeydown: [
363
- A(j(h, ["prevent"]), ["enter"]),
364
- A(O, ["escape"])
363
+ A(j(a, ["prevent"]), ["enter"]),
364
+ A(k, ["escape"])
365
365
  ],
366
- onBlur: h,
366
+ onBlur: a,
367
367
  ref_for: !0,
368
368
  ref: (_) => {
369
- y.value === u && (Q.value = _);
369
+ h.value === u && (Q.value = _);
370
370
  },
371
371
  title: "Double-click to edit attribute value"
372
- }, E(y.value === u ? X.value : F), 45, ze),
372
+ }, D(h.value === u ? X.value : F), 45, ze),
373
373
  n("span", {
374
374
  class: "xml-node__quote",
375
- style: r({ color: e.theme.colors.xmlQuote })
375
+ style: c({ color: e.theme.colors.xmlQuote })
376
376
  }, '"', 4)
377
377
  ]))), 128)),
378
378
  n("span", {
379
379
  class: "xml-node__bracket",
380
- style: r({ color: e.theme.colors.xmlBracket })
380
+ style: c({ color: e.theme.colors.xmlBracket })
381
381
  }, ">", 4),
382
382
  n("span", {
383
383
  class: "xml-node__text-content xml-node__text-content--editable",
384
- style: r({ color: e.theme.colors.xmlText }),
385
- contenteditable: V.value,
386
- onDblclick: g,
384
+ style: c({ color: e.theme.colors.xmlText }),
385
+ contenteditable: E.value,
386
+ onDblclick: d,
387
387
  onKeydown: [
388
- A(j(p, ["prevent"]), ["enter"]),
389
- A(W, ["escape"])
388
+ A(j(g, ["prevent"]), ["enter"]),
389
+ A(N, ["escape"])
390
390
  ],
391
- onBlur: p,
391
+ onBlur: g,
392
392
  ref_key: "textContentRef",
393
393
  ref: U,
394
394
  title: "Double-click to edit text content"
395
- }, E(V.value ? P.value : le.value), 45, Ze),
395
+ }, D(E.value ? O.value : te.value), 45, Ze),
396
396
  n("span", {
397
397
  class: "xml-node__bracket",
398
- style: r({ color: e.theme.colors.xmlBracket })
398
+ style: c({ color: e.theme.colors.xmlBracket })
399
399
  }, "</", 4),
400
400
  n("span", {
401
401
  class: "xml-node__tag",
402
- style: r({ color: e.theme.colors.xmlTag })
403
- }, E(v.value ? x.value : K.value), 5),
402
+ style: c({ color: e.theme.colors.xmlTag })
403
+ }, D(y.value ? x.value : K.value), 5),
404
404
  n("span", {
405
405
  class: "xml-node__bracket",
406
- style: r({ color: e.theme.colors.xmlBracket })
406
+ style: c({ color: e.theme.colors.xmlBracket })
407
407
  }, ">", 4)
408
- ])) : fe.value && be.value ? ($(), w("div", Je, [
408
+ ])) : fe.value && ye.value ? ($(), w("div", Je, [
409
409
  n("span", {
410
410
  class: "xml-node__bracket",
411
- style: r({ color: e.theme.colors.xmlBracket })
411
+ style: c({ color: e.theme.colors.xmlBracket })
412
412
  }, "<", 4),
413
413
  n("span", {
414
414
  class: "xml-node__tag xml-node__tag--editable",
415
- style: r({ color: e.theme.colors.xmlTag }),
416
- contenteditable: v.value,
417
- onDblclick: ae,
415
+ style: c({ color: e.theme.colors.xmlTag }),
416
+ contenteditable: y.value,
417
+ onDblclick: le,
418
418
  onContextmenu: H,
419
419
  onKeydown: [
420
- A(j(t, ["prevent"]), ["enter"]),
421
- A(C, ["escape"])
420
+ A(j(f, ["prevent"]), ["enter"]),
421
+ A(v, ["escape"])
422
422
  ],
423
- onBlur: t,
423
+ onBlur: f,
424
424
  ref_key: "tagNameRef",
425
- ref: N,
425
+ ref: P,
426
426
  title: "Double-click to edit tag name"
427
- }, E(v.value ? x.value : K.value), 45, Ge),
428
- ($(!0), w(re, null, ie(R.value, (F, u) => ($(), w("span", {
427
+ }, D(y.value ? x.value : K.value), 45, Ge),
428
+ ($(!0), w(se, null, ie(R.value, (F, u) => ($(), w("span", {
429
429
  key: u,
430
430
  class: "xml-node__attribute"
431
431
  }, [
432
432
  n("span", {
433
433
  class: "xml-node__attr-name xml-node__attr-name--editable",
434
- style: r({ color: e.theme.colors.xmlAttribute }),
434
+ style: c({ color: e.theme.colors.xmlAttribute }),
435
435
  contenteditable: o.value === u,
436
- onDblclick: (_) => l(u),
436
+ onDblclick: (_) => ce(u),
437
437
  onKeydown: [
438
- A(j(a, ["prevent"]), ["enter"]),
439
- A(k, ["escape"])
438
+ A(j(l, ["prevent"]), ["enter"]),
439
+ A(C, ["escape"])
440
440
  ],
441
- onBlur: a,
441
+ onBlur: l,
442
442
  ref_for: !0,
443
443
  ref: (_) => {
444
444
  o.value === u && (z.value = _);
445
445
  },
446
446
  title: "Double-click to edit attribute name"
447
- }, E(o.value === u ? b.value : u), 45, Ye),
447
+ }, D(o.value === u ? b.value : u), 45, Ye),
448
448
  n("span", {
449
449
  class: "xml-node__equals",
450
- style: r({ color: e.theme.colors.xmlEquals })
450
+ style: c({ color: e.theme.colors.xmlEquals })
451
451
  }, "=", 4),
452
452
  n("span", {
453
453
  class: "xml-node__quote",
454
- style: r({ color: e.theme.colors.xmlQuote })
454
+ style: c({ color: e.theme.colors.xmlQuote })
455
455
  }, '"', 4),
456
456
  n("span", {
457
457
  class: "xml-node__attr-value xml-node__attr-value--editable",
458
- style: r({ color: e.theme.colors.xmlAttributeValue }),
459
- contenteditable: y.value === u,
460
- onDblclick: (_) => d(u),
458
+ style: c({ color: e.theme.colors.xmlAttributeValue }),
459
+ contenteditable: h.value === u,
460
+ onDblclick: (_) => t(u),
461
461
  onKeydown: [
462
- A(j(h, ["prevent"]), ["enter"]),
463
- A(O, ["escape"])
462
+ A(j(a, ["prevent"]), ["enter"]),
463
+ A(k, ["escape"])
464
464
  ],
465
- onBlur: h,
465
+ onBlur: a,
466
466
  ref_for: !0,
467
467
  ref: (_) => {
468
- y.value === u && (Q.value = _);
468
+ h.value === u && (Q.value = _);
469
469
  },
470
470
  title: "Double-click to edit attribute value"
471
- }, E(y.value === u ? X.value : F), 45, et),
471
+ }, D(h.value === u ? X.value : F), 45, et),
472
472
  n("span", {
473
473
  class: "xml-node__quote",
474
- style: r({ color: e.theme.colors.xmlQuote })
474
+ style: c({ color: e.theme.colors.xmlQuote })
475
475
  }, '"', 4)
476
476
  ]))), 128)),
477
477
  n("span", {
478
478
  class: "xml-node__bracket",
479
- style: r({ color: e.theme.colors.xmlBracket })
479
+ style: c({ color: e.theme.colors.xmlBracket })
480
480
  }, " />", 4)
481
481
  ])) : fe.value ? ($(), w("div", tt, [
482
482
  n("span", {
483
483
  class: "xml-node__bracket",
484
- style: r({ color: e.theme.colors.xmlBracket })
484
+ style: c({ color: e.theme.colors.xmlBracket })
485
485
  }, "<", 4),
486
486
  n("span", {
487
487
  class: "xml-node__tag xml-node__tag--editable",
488
- style: r({ color: e.theme.colors.xmlTag }),
489
- contenteditable: v.value,
490
- onDblclick: ae,
488
+ style: c({ color: e.theme.colors.xmlTag }),
489
+ contenteditable: y.value,
490
+ onDblclick: le,
491
491
  onContextmenu: H,
492
492
  onKeydown: [
493
- A(j(t, ["prevent"]), ["enter"]),
494
- A(C, ["escape"])
493
+ A(j(f, ["prevent"]), ["enter"]),
494
+ A(v, ["escape"])
495
495
  ],
496
- onBlur: t,
496
+ onBlur: f,
497
497
  ref_key: "tagNameRef",
498
- ref: N,
498
+ ref: P,
499
499
  title: "Double-click to edit tag name"
500
- }, E(v.value ? x.value : K.value), 45, lt),
501
- ($(!0), w(re, null, ie(R.value, (F, u) => ($(), w("span", {
500
+ }, D(y.value ? x.value : K.value), 45, lt),
501
+ ($(!0), w(se, null, ie(R.value, (F, u) => ($(), w("span", {
502
502
  key: u,
503
503
  class: "xml-node__attribute"
504
504
  }, [
505
505
  n("span", {
506
506
  class: "xml-node__attr-name xml-node__attr-name--editable",
507
- style: r({ color: e.theme.colors.xmlAttribute }),
507
+ style: c({ color: e.theme.colors.xmlAttribute }),
508
508
  contenteditable: o.value === u,
509
- onDblclick: (_) => l(u),
509
+ onDblclick: (_) => ce(u),
510
510
  onKeydown: [
511
- A(j(a, ["prevent"]), ["enter"]),
512
- A(k, ["escape"])
511
+ A(j(l, ["prevent"]), ["enter"]),
512
+ A(C, ["escape"])
513
513
  ],
514
- onBlur: a,
514
+ onBlur: l,
515
515
  ref_for: !0,
516
516
  ref: (_) => {
517
517
  o.value === u && (z.value = _);
518
518
  },
519
519
  title: "Double-click to edit attribute name"
520
- }, E(o.value === u ? b.value : u), 45, at),
520
+ }, D(o.value === u ? b.value : u), 45, at),
521
521
  n("span", {
522
522
  class: "xml-node__equals",
523
- style: r({ color: e.theme.colors.xmlEquals })
523
+ style: c({ color: e.theme.colors.xmlEquals })
524
524
  }, "=", 4),
525
525
  n("span", {
526
526
  class: "xml-node__quote",
527
- style: r({ color: e.theme.colors.xmlQuote })
527
+ style: c({ color: e.theme.colors.xmlQuote })
528
528
  }, '"', 4),
529
529
  n("span", {
530
530
  class: "xml-node__attr-value xml-node__attr-value--editable",
531
- style: r({ color: e.theme.colors.xmlAttributeValue }),
532
- contenteditable: y.value === u,
533
- onDblclick: (_) => d(u),
531
+ style: c({ color: e.theme.colors.xmlAttributeValue }),
532
+ contenteditable: h.value === u,
533
+ onDblclick: (_) => t(u),
534
534
  onKeydown: [
535
- A(j(h, ["prevent"]), ["enter"]),
536
- A(O, ["escape"])
535
+ A(j(a, ["prevent"]), ["enter"]),
536
+ A(k, ["escape"])
537
537
  ],
538
- onBlur: h,
538
+ onBlur: a,
539
539
  ref_for: !0,
540
540
  ref: (_) => {
541
- y.value === u && (Q.value = _);
541
+ h.value === u && (Q.value = _);
542
542
  },
543
543
  title: "Double-click to edit attribute value"
544
- }, E(y.value === u ? X.value : F), 45, nt),
544
+ }, D(h.value === u ? X.value : F), 45, nt),
545
545
  n("span", {
546
546
  class: "xml-node__quote",
547
- style: r({ color: e.theme.colors.xmlQuote })
547
+ style: c({ color: e.theme.colors.xmlQuote })
548
548
  }, '"', 4)
549
549
  ]))), 128)),
550
550
  n("span", {
551
551
  class: "xml-node__bracket",
552
- style: r({ color: e.theme.colors.xmlBracket })
552
+ style: c({ color: e.theme.colors.xmlBracket })
553
553
  }, "></", 4),
554
554
  n("span", {
555
555
  class: "xml-node__tag",
556
- style: r({ color: e.theme.colors.xmlTag })
557
- }, E(v.value ? x.value : K.value), 5),
556
+ style: c({ color: e.theme.colors.xmlTag })
557
+ }, D(y.value ? x.value : K.value), 5),
558
558
  n("span", {
559
559
  class: "xml-node__bracket",
560
- style: r({ color: e.theme.colors.xmlBracket })
560
+ style: c({ color: e.theme.colors.xmlBracket })
561
561
  }, ">", 4)
562
562
  ])) : ($(), w("div", ot, [
563
- !te.value && Z.value ? ($(), w("div", st, [
563
+ !ee.value && Z.value ? ($(), w("div", st, [
564
564
  n("span", {
565
565
  class: "xml-node__clickable-part",
566
- onClick: i[0] || (i[0] = (F) => oe()),
566
+ onClick: r[0] || (r[0] = (F) => ne()),
567
567
  title: "Click to expand"
568
568
  }, [
569
569
  n("span", {
570
570
  class: "xml-node__bracket",
571
- style: r({ color: e.theme.colors.xmlBracket })
571
+ style: c({ color: e.theme.colors.xmlBracket })
572
572
  }, "<", 4),
573
573
  n("span", {
574
574
  class: "xml-node__tag xml-node__tag--editable",
575
- style: r({ color: e.theme.colors.xmlTag }),
576
- contenteditable: v.value,
577
- onDblclick: j(ae, ["stop"]),
575
+ style: c({ color: e.theme.colors.xmlTag }),
576
+ contenteditable: y.value,
577
+ onDblclick: j(le, ["stop"]),
578
578
  onContextmenu: H,
579
579
  onKeydown: [
580
- A(j(t, ["prevent"]), ["enter"]),
581
- A(C, ["escape"])
580
+ A(j(f, ["prevent"]), ["enter"]),
581
+ A(v, ["escape"])
582
582
  ],
583
- onBlur: t,
583
+ onBlur: f,
584
584
  ref_key: "tagNameRef",
585
- ref: N,
585
+ ref: P,
586
586
  title: "Double-click or right-click to edit tag name"
587
- }, E(v.value ? x.value : K.value), 45, rt)
587
+ }, D(y.value ? x.value : K.value), 45, rt)
588
588
  ]),
589
- ($(!0), w(re, null, ie(R.value, (F, u) => ($(), w("span", {
589
+ ($(!0), w(se, null, ie(R.value, (F, u) => ($(), w("span", {
590
590
  key: u,
591
591
  class: "xml-node__attribute"
592
592
  }, [
593
593
  n("span", {
594
594
  class: "xml-node__attr-name xml-node__attr-name--editable",
595
- style: r({ color: e.theme.colors.xmlAttribute }),
595
+ style: c({ color: e.theme.colors.xmlAttribute }),
596
596
  contenteditable: o.value === u,
597
- onDblclick: (_) => l(u),
597
+ onDblclick: (_) => ce(u),
598
598
  onKeydown: [
599
- A(j(a, ["prevent"]), ["enter"]),
600
- A(k, ["escape"])
599
+ A(j(l, ["prevent"]), ["enter"]),
600
+ A(C, ["escape"])
601
601
  ],
602
- onBlur: a,
602
+ onBlur: l,
603
603
  ref_for: !0,
604
604
  ref: (_) => {
605
605
  o.value === u && (z.value = _);
606
606
  },
607
607
  title: "Double-click to edit attribute name"
608
- }, E(o.value === u ? b.value : u), 45, ct),
608
+ }, D(o.value === u ? b.value : u), 45, ct),
609
609
  n("span", {
610
610
  class: "xml-node__equals",
611
- style: r({ color: e.theme.colors.xmlEquals })
611
+ style: c({ color: e.theme.colors.xmlEquals })
612
612
  }, "=", 4),
613
613
  n("span", {
614
614
  class: "xml-node__quote",
615
- style: r({ color: e.theme.colors.xmlQuote })
615
+ style: c({ color: e.theme.colors.xmlQuote })
616
616
  }, '"', 4),
617
617
  n("span", {
618
618
  class: "xml-node__attr-value xml-node__attr-value--editable",
619
- style: r({ color: e.theme.colors.xmlAttributeValue }),
620
- contenteditable: y.value === u,
621
- onDblclick: (_) => d(u),
619
+ style: c({ color: e.theme.colors.xmlAttributeValue }),
620
+ contenteditable: h.value === u,
621
+ onDblclick: (_) => t(u),
622
622
  onKeydown: [
623
- A(j(h, ["prevent"]), ["enter"]),
624
- A(O, ["escape"])
623
+ A(j(a, ["prevent"]), ["enter"]),
624
+ A(k, ["escape"])
625
625
  ],
626
- onBlur: h,
626
+ onBlur: a,
627
627
  ref_for: !0,
628
628
  ref: (_) => {
629
- y.value === u && (Q.value = _);
629
+ h.value === u && (Q.value = _);
630
630
  },
631
631
  title: "Double-click to edit attribute value"
632
- }, E(y.value === u ? X.value : F), 45, it),
632
+ }, D(h.value === u ? X.value : F), 45, it),
633
633
  n("span", {
634
634
  class: "xml-node__quote",
635
- style: r({ color: e.theme.colors.xmlQuote })
635
+ style: c({ color: e.theme.colors.xmlQuote })
636
636
  }, '"', 4)
637
637
  ]))), 128)),
638
638
  n("span", {
639
639
  class: "xml-node__clickable-part",
640
- onClick: i[1] || (i[1] = (F) => oe()),
640
+ onClick: r[1] || (r[1] = (F) => ne()),
641
641
  title: "Click to expand"
642
642
  }, [
643
643
  n("span", {
644
644
  class: "xml-node__bracket",
645
- style: r({ color: e.theme.colors.xmlBracket })
645
+ style: c({ color: e.theme.colors.xmlBracket })
646
646
  }, ">", 4)
647
647
  ]),
648
648
  n("span", {
649
649
  class: "xml-node__collapsed-badge",
650
- onClick: i[2] || (i[2] = (F) => oe()),
650
+ onClick: r[2] || (r[2] = (F) => ne()),
651
651
  title: `Click to expand ${me.value} tag${me.value > 1 ? "s" : ""}`
652
- }, E(me.value) + " tag" + E(me.value > 1 ? "s" : ""), 9, ut),
652
+ }, D(me.value) + " tag" + D(me.value > 1 ? "s" : ""), 9, ut),
653
653
  n("span", {
654
654
  class: "xml-node__clickable-part",
655
- onClick: i[3] || (i[3] = (F) => oe()),
655
+ onClick: r[3] || (r[3] = (F) => ne()),
656
656
  title: "Click to expand"
657
657
  }, [
658
658
  n("span", {
659
659
  class: "xml-node__bracket",
660
- style: r({ color: e.theme.colors.xmlBracket })
660
+ style: c({ color: e.theme.colors.xmlBracket })
661
661
  }, "</", 4),
662
662
  n("span", {
663
663
  class: "xml-node__tag",
664
- style: r({ color: e.theme.colors.xmlTag })
665
- }, E(v.value ? x.value : K.value), 5),
664
+ style: c({ color: e.theme.colors.xmlTag })
665
+ }, D(y.value ? x.value : K.value), 5),
666
666
  n("span", {
667
667
  class: "xml-node__bracket",
668
- style: r({ color: e.theme.colors.xmlBracket })
668
+ style: c({ color: e.theme.colors.xmlBracket })
669
669
  }, ">", 4)
670
670
  ])
671
- ])) : ($(), w(re, { key: 1 }, [
671
+ ])) : ($(), w(se, { key: 1 }, [
672
672
  n("div", dt, [
673
673
  Z.value ? ($(), w("span", {
674
674
  key: 0,
675
675
  class: "xml-node__clickable-part",
676
- onClick: i[4] || (i[4] = (F) => oe()),
677
- title: te.value ? "Click to collapse" : "Click to expand"
676
+ onClick: r[4] || (r[4] = (F) => ne()),
677
+ title: ee.value ? "Click to collapse" : "Click to expand"
678
678
  }, [
679
679
  n("span", {
680
680
  class: "xml-node__bracket",
681
- style: r({ color: e.theme.colors.xmlBracket })
681
+ style: c({ color: e.theme.colors.xmlBracket })
682
682
  }, "<", 4),
683
683
  n("span", {
684
684
  class: "xml-node__tag xml-node__tag--editable",
685
- style: r({ color: e.theme.colors.xmlTag }),
686
- contenteditable: v.value,
687
- onDblclick: j(ae, ["stop"]),
685
+ style: c({ color: e.theme.colors.xmlTag }),
686
+ contenteditable: y.value,
687
+ onDblclick: j(le, ["stop"]),
688
688
  onContextmenu: H,
689
689
  onKeydown: [
690
- A(j(t, ["prevent"]), ["enter"]),
691
- A(C, ["escape"])
690
+ A(j(f, ["prevent"]), ["enter"]),
691
+ A(v, ["escape"])
692
692
  ],
693
- onBlur: t,
693
+ onBlur: f,
694
694
  ref_key: "tagNameRef",
695
- ref: N,
695
+ ref: P,
696
696
  title: "Double-click or right-click to edit tag name"
697
- }, E(v.value ? x.value : K.value), 45, ft)
697
+ }, D(y.value ? x.value : K.value), 45, ft)
698
698
  ], 8, mt)) : ($(), w("span", vt, [
699
699
  n("span", {
700
700
  class: "xml-node__bracket",
701
- style: r({ color: e.theme.colors.xmlBracket })
701
+ style: c({ color: e.theme.colors.xmlBracket })
702
702
  }, "<", 4),
703
703
  n("span", {
704
704
  class: "xml-node__tag xml-node__tag--editable",
705
- style: r({ color: e.theme.colors.xmlTag }),
706
- contenteditable: v.value,
707
- onDblclick: ae,
705
+ style: c({ color: e.theme.colors.xmlTag }),
706
+ contenteditable: y.value,
707
+ onDblclick: le,
708
708
  onKeydown: [
709
- A(j(t, ["prevent"]), ["enter"]),
710
- A(C, ["escape"])
709
+ A(j(f, ["prevent"]), ["enter"]),
710
+ A(v, ["escape"])
711
711
  ],
712
- onBlur: t,
712
+ onBlur: f,
713
713
  ref_key: "tagNameRef",
714
- ref: N,
714
+ ref: P,
715
715
  title: "Double-click to edit tag name"
716
- }, E(v.value ? x.value : K.value), 45, pt)
716
+ }, D(y.value ? x.value : K.value), 45, pt)
717
717
  ])),
718
- ($(!0), w(re, null, ie(R.value, (F, u) => ($(), w("span", {
718
+ ($(!0), w(se, null, ie(R.value, (F, u) => ($(), w("span", {
719
719
  key: u,
720
720
  class: "xml-node__attribute"
721
721
  }, [
722
722
  n("span", {
723
723
  class: "xml-node__attr-name xml-node__attr-name--editable",
724
- style: r({ color: e.theme.colors.xmlAttribute }),
724
+ style: c({ color: e.theme.colors.xmlAttribute }),
725
725
  contenteditable: o.value === u,
726
- onDblclick: (_) => l(u),
726
+ onDblclick: (_) => ce(u),
727
727
  onKeydown: [
728
- A(j(a, ["prevent"]), ["enter"]),
729
- A(k, ["escape"])
728
+ A(j(l, ["prevent"]), ["enter"]),
729
+ A(C, ["escape"])
730
730
  ],
731
- onBlur: a,
731
+ onBlur: l,
732
732
  ref_for: !0,
733
733
  ref: (_) => {
734
734
  o.value === u && (z.value = _);
735
735
  },
736
736
  title: "Double-click to edit attribute name"
737
- }, E(o.value === u ? b.value : u), 45, yt),
737
+ }, D(o.value === u ? b.value : u), 45, yt),
738
738
  n("span", {
739
739
  class: "xml-node__equals",
740
- style: r({ color: e.theme.colors.xmlEquals })
740
+ style: c({ color: e.theme.colors.xmlEquals })
741
741
  }, "=", 4),
742
742
  n("span", {
743
743
  class: "xml-node__quote",
744
- style: r({ color: e.theme.colors.xmlQuote })
744
+ style: c({ color: e.theme.colors.xmlQuote })
745
745
  }, '"', 4),
746
746
  n("span", {
747
747
  class: "xml-node__attr-value xml-node__attr-value--editable",
748
- style: r({ color: e.theme.colors.xmlAttributeValue }),
749
- contenteditable: y.value === u,
750
- onDblclick: (_) => d(u),
748
+ style: c({ color: e.theme.colors.xmlAttributeValue }),
749
+ contenteditable: h.value === u,
750
+ onDblclick: (_) => t(u),
751
751
  onKeydown: [
752
- A(j(h, ["prevent"]), ["enter"]),
753
- A(O, ["escape"])
752
+ A(j(a, ["prevent"]), ["enter"]),
753
+ A(k, ["escape"])
754
754
  ],
755
- onBlur: h,
755
+ onBlur: a,
756
756
  ref_for: !0,
757
757
  ref: (_) => {
758
- y.value === u && (Q.value = _);
758
+ h.value === u && (Q.value = _);
759
759
  },
760
760
  title: "Double-click to edit attribute value"
761
- }, E(y.value === u ? X.value : F), 45, ht),
761
+ }, D(h.value === u ? X.value : F), 45, ht),
762
762
  n("span", {
763
763
  class: "xml-node__quote",
764
- style: r({ color: e.theme.colors.xmlQuote })
764
+ style: c({ color: e.theme.colors.xmlQuote })
765
765
  }, '"', 4)
766
766
  ]))), 128)),
767
767
  Z.value ? ($(), w("span", {
768
768
  key: 2,
769
769
  class: "xml-node__clickable-part",
770
- onClick: i[5] || (i[5] = (F) => oe()),
771
- title: te.value ? "Click to collapse" : "Click to expand"
770
+ onClick: r[5] || (r[5] = (F) => ne()),
771
+ title: ee.value ? "Click to collapse" : "Click to expand"
772
772
  }, [
773
773
  n("span", {
774
774
  class: "xml-node__bracket",
775
- style: r({ color: e.theme.colors.xmlBracket })
775
+ style: c({ color: e.theme.colors.xmlBracket })
776
776
  }, ">", 4)
777
777
  ], 8, bt)) : ($(), w("span", {
778
778
  key: 3,
779
779
  class: "xml-node__bracket",
780
- style: r({ color: e.theme.colors.xmlBracket })
781
- }, E(Z.value ? ">" : "/>"), 5))
780
+ style: c({ color: e.theme.colors.xmlBracket })
781
+ }, D(Z.value ? ">" : "/>"), 5))
782
782
  ]),
783
- te.value && Z.value ? ($(), w("div", _t, [
784
- G.value.length === 0 && le.value.trim() ? ($(), w("div", xt, [
783
+ ee.value && Z.value ? ($(), w("div", _t, [
784
+ G.value.length === 0 && te.value.trim() ? ($(), w("div", xt, [
785
785
  n("span", {
786
786
  class: "xml-node__text-content xml-node__text-content--editable",
787
- style: r({ color: e.theme.colors.xmlText }),
788
- contenteditable: V.value,
789
- onDblclick: g,
787
+ style: c({ color: e.theme.colors.xmlText }),
788
+ contenteditable: E.value,
789
+ onDblclick: d,
790
790
  onKeydown: [
791
- A(j(p, ["prevent"]), ["enter"]),
792
- A(W, ["escape"])
791
+ A(j(g, ["prevent"]), ["enter"]),
792
+ A(N, ["escape"])
793
793
  ],
794
- onBlur: p,
794
+ onBlur: g,
795
795
  ref_key: "textContentRef",
796
796
  ref: U,
797
797
  title: "Double-click to edit text content"
798
- }, E(V.value ? P.value : le.value), 45, gt)
798
+ }, D(E.value ? O.value : te.value), 45, gt)
799
799
  ])) : pe("", !0),
800
- ($(!0), w(re, null, ie(G.value, (F, u) => ($(), Be(M, {
800
+ ($(!0), w(se, null, ie(G.value, (F, u) => ($(), Be(M, {
801
801
  key: _e(F, u),
802
802
  node: F,
803
803
  index: u,
@@ -806,32 +806,32 @@ const Re = {
806
806
  expanded: e.expanded,
807
807
  theme: e.theme,
808
808
  selfClosingTags: e.selfClosingTags,
809
- onToggleExpand: i[6] || (i[6] = (_) => e.$emit("toggle-expand", _)),
810
- onCopy: i[7] || (i[7] = (_) => e.$emit("copy", _)),
811
- "onUpdate:tagName": i[8] || (i[8] = (_, se, ve) => e.$emit("update:tagName", _, se, ve)),
812
- "onUpdate:attributeName": i[9] || (i[9] = (_, se, ve) => e.$emit("update:attributeName", _, se, ve)),
813
- "onUpdate:attributeValue": i[10] || (i[10] = (_, se, ve) => e.$emit("update:attributeValue", _, se, ve)),
814
- "onUpdate:textContent": i[11] || (i[11] = (_, se) => e.$emit("update:textContent", _, se)),
815
- "onUpdate:cdataContent": i[12] || (i[12] = (_, se) => e.$emit("update:cdataContent", _, se))
809
+ onToggleExpand: r[6] || (r[6] = (_) => e.$emit("toggle-expand", _)),
810
+ onCopy: r[7] || (r[7] = (_) => e.$emit("copy", _)),
811
+ "onUpdate:tagName": r[8] || (r[8] = (_, oe, ve) => e.$emit("update:tagName", _, oe, ve)),
812
+ "onUpdate:attributeName": r[9] || (r[9] = (_, oe, ve) => e.$emit("update:attributeName", _, oe, ve)),
813
+ "onUpdate:attributeValue": r[10] || (r[10] = (_, oe, ve) => e.$emit("update:attributeValue", _, oe, ve)),
814
+ "onUpdate:textContent": r[11] || (r[11] = (_, oe) => e.$emit("update:textContent", _, oe)),
815
+ "onUpdate:cdataContent": r[12] || (r[12] = (_, oe) => e.$emit("update:cdataContent", _, oe))
816
816
  }, null, 8, ["node", "index", "level", "parent-path", "expanded", "theme", "selfClosingTags"]))), 128))
817
817
  ])) : pe("", !0),
818
- te.value && Z.value ? ($(), w("div", kt, [
818
+ ee.value && Z.value ? ($(), w("div", kt, [
819
819
  n("span", {
820
820
  class: "xml-node__clickable-part",
821
- onClick: i[13] || (i[13] = (F) => oe()),
821
+ onClick: r[13] || (r[13] = (F) => ne()),
822
822
  title: "Click to collapse"
823
823
  }, [
824
824
  n("span", {
825
825
  class: "xml-node__bracket",
826
- style: r({ color: e.theme.colors.xmlBracket })
826
+ style: c({ color: e.theme.colors.xmlBracket })
827
827
  }, "</", 4),
828
828
  n("span", {
829
829
  class: "xml-node__tag",
830
- style: r({ color: e.theme.colors.xmlTag })
831
- }, E(v.value ? x.value : K.value), 5),
830
+ style: c({ color: e.theme.colors.xmlTag })
831
+ }, D(y.value ? x.value : K.value), 5),
832
832
  n("span", {
833
833
  class: "xml-node__bracket",
834
- style: r({ color: e.theme.colors.xmlBracket })
834
+ style: c({ color: e.theme.colors.xmlBracket })
835
835
  }, ">", 4)
836
836
  ])
837
837
  ])) : pe("", !0)
@@ -1114,25 +1114,25 @@ const Re = {
1114
1114
  suppressBooleanAttributes: !1,
1115
1115
  suppressUnpairedNode: !1
1116
1116
  }, Wt = (s) => {
1117
- const m = /<!\[CDATA\[([\s\S]*?)\]\]>/g, c = [];
1118
- let f;
1119
- for (; (f = m.exec(s)) !== null; )
1120
- c.push({
1121
- start: f.index,
1122
- end: f.index + f[0].length
1117
+ const m = /<!\[CDATA\[([\s\S]*?)\]\]>/g, i = [];
1118
+ let p;
1119
+ for (; (p = m.exec(s)) !== null; )
1120
+ i.push({
1121
+ start: p.index,
1122
+ end: p.index + p[0].length
1123
1123
  });
1124
- const v = (b) => c.some((X) => b >= X.start && b < X.end), o = /&([a-zA-Z0-9#]+);/g, y = ["lt", "gt", "amp", "quot", "apos"];
1125
- let V, B = 1, x = 0;
1126
- for (; (V = o.exec(s)) !== null; ) {
1127
- const b = V[1], X = V.index;
1128
- if (v(X))
1124
+ const y = (b) => i.some((X) => b >= X.start && b < X.end), o = /&([a-zA-Z0-9#]+);/g, h = ["lt", "gt", "amp", "quot", "apos"];
1125
+ let E, B = 1, x = 0;
1126
+ for (; (E = o.exec(s)) !== null; ) {
1127
+ const b = E[1], X = E.index;
1128
+ if (y(X))
1129
1129
  continue;
1130
- const P = s.substring(x, X);
1131
- if (B += (P.match(/\n/g) || []).length, x = X, b.startsWith("#")) {
1130
+ const O = s.substring(x, X);
1131
+ if (B += (O.match(/\n/g) || []).length, x = X, b.startsWith("#")) {
1132
1132
  const S = b.substring(1);
1133
1133
  if (S.startsWith("x") || S.startsWith("X")) {
1134
- const N = S.substring(1);
1135
- if (!/^[0-9a-fA-F]+$/.test(N))
1134
+ const P = S.substring(1);
1135
+ if (!/^[0-9a-fA-F]+$/.test(P))
1136
1136
  return {
1137
1137
  valid: !1,
1138
1138
  error: `Line ${B}: Invalid hexadecimal character reference '&${b};'`
@@ -1144,7 +1144,7 @@ const Re = {
1144
1144
  };
1145
1145
  continue;
1146
1146
  }
1147
- if (!y.includes(b))
1147
+ if (!h.includes(b))
1148
1148
  return {
1149
1149
  valid: !1,
1150
1150
  error: `Line ${B}: Invalid entity reference '&${b};'. Valid predefined entities are: &lt; &gt; &amp; &quot; &apos;`
@@ -1161,8 +1161,8 @@ const Re = {
1161
1161
  valid: !1,
1162
1162
  error: `Line ${m.err.line}: ${m.err.msg}`
1163
1163
  };
1164
- const c = Wt(s);
1165
- return c.valid ? { valid: !0 } : c;
1164
+ const i = Wt(s);
1165
+ return i.valid ? { valid: !0 } : i;
1166
1166
  } catch (m) {
1167
1167
  return {
1168
1168
  valid: !1,
@@ -1175,47 +1175,47 @@ const Re = {
1175
1175
  ...Et,
1176
1176
  ...m
1177
1177
  }).parse(s);
1178
- } catch (c) {
1178
+ } catch (i) {
1179
1179
  throw new Error(
1180
- `XML 解析失败: ${c instanceof Error ? c.message : "Unknown error"}`
1180
+ `XML 解析失败: ${i instanceof Error ? i.message : "Unknown error"}`
1181
1181
  );
1182
1182
  }
1183
1183
  }, ke = (s, m) => {
1184
1184
  try {
1185
- let f = new Ne({
1185
+ let p = new Ne({
1186
1186
  ...Vt,
1187
1187
  format: m?.format ?? !0,
1188
1188
  indentBy: m?.indentBy ?? " "
1189
1189
  }).build(s);
1190
- return m?.showDeclaration !== !1 && !f.startsWith("<?xml") && (f = `<?xml version="1.0" encoding="UTF-8"?>
1191
- ` + f), f;
1192
- } catch (c) {
1190
+ return m?.showDeclaration !== !1 && !p.startsWith("<?xml") && (p = `<?xml version="1.0" encoding="UTF-8"?>
1191
+ ` + p), p;
1192
+ } catch (i) {
1193
1193
  throw new Error(
1194
- `XML 构建失败: ${c instanceof Error ? c.message : "Unknown error"}`
1194
+ `XML 构建失败: ${i instanceof Error ? i.message : "Unknown error"}`
1195
1195
  );
1196
1196
  }
1197
- }, Xt = (s, m) => Array.isArray(s) ? ce(s, { format: !1, originalXml: m }) : ke(s, { format: !1, showDeclaration: !1 }), Ot = (s, m) => {
1198
- const c = ge(s);
1199
- return Array.isArray(c) ? ce(c, {
1197
+ }, Xt = (s, m) => Array.isArray(s) ? re(s, { format: !1, originalXml: m }) : ke(s, { format: !1, showDeclaration: !1 }), Ot = (s, m) => {
1198
+ const i = ge(s);
1199
+ return Array.isArray(i) ? re(i, {
1200
1200
  indent: m?.indentBy || " ",
1201
1201
  originalXml: s
1202
- }) : ke(c, m);
1202
+ }) : ke(i, m);
1203
1203
  }, Ht = (s) => {
1204
1204
  const m = s.match(/<([a-zA-Z0-9_-]+)[\s>]/);
1205
1205
  return m ? m[1] : null;
1206
1206
  }, zt = (s) => {
1207
1207
  let m = 0;
1208
- const c = (f) => {
1209
- f === null || typeof f != "object" || (m++, Array.isArray(f) ? f.forEach(c) : Object.values(f).forEach(c));
1208
+ const i = (p) => {
1209
+ p === null || typeof p != "object" || (m++, Array.isArray(p) ? p.forEach(i) : Object.values(p).forEach(i));
1210
1210
  };
1211
- return c(s), m;
1211
+ return i(s), m;
1212
1212
  }, Zt = (s) => !s || typeof s != "object" ? !1 : Object.keys(s).some((m) => m.startsWith("@_")), Jt = (s) => {
1213
1213
  if (!s || typeof s != "object") return {};
1214
1214
  const m = {};
1215
- return Object.keys(s).forEach((c) => {
1216
- if (c.startsWith("@_")) {
1217
- const f = c.substring(2);
1218
- m[f] = s[c];
1215
+ return Object.keys(s).forEach((i) => {
1216
+ if (i.startsWith("@_")) {
1217
+ const p = i.substring(2);
1218
+ m[p] = s[i];
1219
1219
  }
1220
1220
  }), m;
1221
1221
  }, Gt = (s) => !s || typeof s != "object" ? typeof s == "string" ? s : null : s["#text"] || null, Yt = (s) => {
@@ -1224,67 +1224,67 @@ const Re = {
1224
1224
  const m = Object.keys(s);
1225
1225
  return m.length === 0 || m.length === 1 && m[0].startsWith("@_");
1226
1226
  }, Pt = (s, m) => {
1227
- const c = Te(m), f = /* @__PURE__ */ new Map(), v = (o) => {
1228
- for (const y of o) {
1229
- const V = Object.keys(y).find(
1227
+ const i = Te(m), p = /* @__PURE__ */ new Map(), y = (o) => {
1228
+ for (const h of o) {
1229
+ const E = Object.keys(h).find(
1230
1230
  (b) => !b.startsWith(":") && !b.startsWith("#") && !b.startsWith("__") && !b.startsWith("?")
1231
1231
  );
1232
- if (!V) continue;
1233
- const B = f.get(V) ?? 0;
1234
- f.set(V, B + 1), y[":selfClosing"] = c.get(V)?.[B] ?? !1;
1235
- const x = y[V];
1236
- Array.isArray(x) && x.length > 0 && v(x);
1232
+ if (!E) continue;
1233
+ const B = p.get(E) ?? 0;
1234
+ p.set(E, B + 1), h[":selfClosing"] = i.get(E)?.[B] ?? !1;
1235
+ const x = h[E];
1236
+ Array.isArray(x) && x.length > 0 && y(x);
1237
1237
  }
1238
1238
  };
1239
- v(s);
1239
+ y(s);
1240
1240
  }, Nt = (s) => {
1241
- const m = /* @__PURE__ */ new Set(), c = /<([a-zA-Z0-9_-]+)(?:\s[^>]*)?\s*\/>/g;
1242
- let f;
1243
- for (; (f = c.exec(s)) !== null; )
1244
- m.add(f[1]);
1241
+ const m = /* @__PURE__ */ new Set(), i = /<([a-zA-Z0-9_-]+)(?:\s[^>]*)?\s*\/>/g;
1242
+ let p;
1243
+ for (; (p = i.exec(s)) !== null; )
1244
+ m.add(p[1]);
1245
1245
  return m;
1246
1246
  }, Te = (s) => {
1247
1247
  const m = /* @__PURE__ */ new Map();
1248
- let c = 0;
1249
- for (; c < s.length; ) {
1250
- if (s.startsWith("<!--", c)) {
1251
- const f = s.indexOf("-->", c);
1252
- c = f !== -1 ? f + 3 : s.length;
1248
+ let i = 0;
1249
+ for (; i < s.length; ) {
1250
+ if (s.startsWith("<!--", i)) {
1251
+ const p = s.indexOf("-->", i);
1252
+ i = p !== -1 ? p + 3 : s.length;
1253
1253
  continue;
1254
1254
  }
1255
- if (s.startsWith("<![CDATA[", c)) {
1256
- const f = s.indexOf("]]>", c);
1257
- c = f !== -1 ? f + 3 : s.length;
1255
+ if (s.startsWith("<![CDATA[", i)) {
1256
+ const p = s.indexOf("]]>", i);
1257
+ i = p !== -1 ? p + 3 : s.length;
1258
1258
  continue;
1259
1259
  }
1260
- if (s.startsWith("<?", c)) {
1261
- const f = s.indexOf("?>", c);
1262
- c = f !== -1 ? f + 2 : s.length;
1260
+ if (s.startsWith("<?", i)) {
1261
+ const p = s.indexOf("?>", i);
1262
+ i = p !== -1 ? p + 2 : s.length;
1263
1263
  continue;
1264
1264
  }
1265
- if (s.startsWith("</", c)) {
1266
- const f = s.indexOf(">", c);
1267
- c = f !== -1 ? f + 1 : s.length;
1265
+ if (s.startsWith("</", i)) {
1266
+ const p = s.indexOf(">", i);
1267
+ i = p !== -1 ? p + 1 : s.length;
1268
1268
  continue;
1269
1269
  }
1270
- if (s[c] === "<") {
1271
- const f = s.slice(c + 1).match(/^([a-zA-Z_][a-zA-Z0-9_:.-]*)/);
1272
- if (f) {
1273
- const v = f[1];
1274
- let o = c + 1 + v.length, y = !1, V = "";
1270
+ if (s[i] === "<") {
1271
+ const p = s.slice(i + 1).match(/^([a-zA-Z_][a-zA-Z0-9_:.-]*)/);
1272
+ if (p) {
1273
+ const y = p[1];
1274
+ let o = i + 1 + y.length, h = !1, E = "";
1275
1275
  for (; o < s.length; ) {
1276
1276
  const B = s[o];
1277
- if (y)
1278
- B === V && (y = !1);
1277
+ if (h)
1278
+ B === E && (h = !1);
1279
1279
  else if (B === '"' || B === "'")
1280
- y = !0, V = B;
1280
+ h = !0, E = B;
1281
1281
  else if (B === ">") {
1282
1282
  let x = o - 1;
1283
- for (; x > c && (s[x] === " " || s[x] === " " || s[x] === `
1283
+ for (; x > i && (s[x] === " " || s[x] === " " || s[x] === `
1284
1284
  ` || s[x] === "\r"); )
1285
1285
  x--;
1286
1286
  const b = s[x] === "/";
1287
- m.has(v) || m.set(v, []), m.get(v).push(b), c = o + 1;
1287
+ m.has(y) || m.set(y, []), m.get(y).push(b), i = o + 1;
1288
1288
  break;
1289
1289
  }
1290
1290
  o++;
@@ -1293,47 +1293,47 @@ const Re = {
1293
1293
  continue;
1294
1294
  }
1295
1295
  }
1296
- c++;
1296
+ i++;
1297
1297
  }
1298
1298
  return m;
1299
- }, ce = (s, m = {}) => {
1300
- const c = m.indent !== void 0 ? m.indent : " ", f = m.level || 0, v = m.format !== !1, o = v ? c.repeat(f) : "", y = v ? `
1299
+ }, re = (s, m = {}) => {
1300
+ const i = m.indent !== void 0 ? m.indent : " ", p = m.level || 0, y = m.format !== !1, o = y ? i.repeat(p) : "", h = y ? `
1301
1301
  ` : "";
1302
- let V = m.selfClosingTags, B = m.selfClosingOccurrences, x = m.selfClosingCounters;
1303
- f === 0 && m.originalXml && (B = Te(m.originalXml), x = /* @__PURE__ */ new Map());
1302
+ let E = m.selfClosingTags, B = m.selfClosingOccurrences, x = m.selfClosingCounters;
1303
+ p === 0 && m.originalXml && (B = Te(m.originalXml), x = /* @__PURE__ */ new Map());
1304
1304
  let b = "";
1305
1305
  for (const X of s) {
1306
1306
  if (X["?xml"]) {
1307
1307
  const T = X[":@"] || {}, R = Object.entries(T).map(([G, ue]) => `${G.startsWith("@_") ? G.substring(2) : G}="${ue}"`).join(" ");
1308
- b += `<?xml ${R}?>${y}`;
1308
+ b += `<?xml ${R}?>${h}`;
1309
1309
  continue;
1310
1310
  }
1311
1311
  if (X["#comment"]) {
1312
1312
  const T = X["#comment"];
1313
1313
  if (Array.isArray(T) && T.length > 0) {
1314
1314
  const R = T[0]["#text"] || T[0];
1315
- b += `${o}<!--${R}-->${y}`;
1315
+ b += `${o}<!--${R}-->${h}`;
1316
1316
  }
1317
1317
  continue;
1318
1318
  }
1319
- const P = Object.keys(X).find((T) => !T.startsWith(":") && !T.startsWith("#") && !T.startsWith("__"));
1320
- if (!P) continue;
1319
+ const O = Object.keys(X).find((T) => !T.startsWith(":") && !T.startsWith("#") && !T.startsWith("__"));
1320
+ if (!O) continue;
1321
1321
  let S = 0;
1322
- B && x && (S = x.get(P) ?? 0, x.set(P, S + 1));
1323
- const N = X[P], z = X[":@"] || {}, Q = Object.entries(z).map(([T, R]) => `${T.startsWith("@_") ? T.substring(2) : T}="${R}"`).join(" "), U = Q ? " " + Q : "";
1324
- if (!Array.isArray(N) || N.length === 0) {
1322
+ B && x && (S = x.get(O) ?? 0, x.set(O, S + 1));
1323
+ const P = X[O], z = X[":@"] || {}, Q = Object.entries(z).map(([T, R]) => `${T.startsWith("@_") ? T.substring(2) : T}="${R}"`).join(" "), U = Q ? " " + Q : "";
1324
+ if (!Array.isArray(P) || P.length === 0) {
1325
1325
  let T;
1326
- B ? T = B.get(P)?.[S] ?? !1 : T = !!(V && V.has(P)), T ? b += `${o}<${P}${U}/>${y}` : b += `${o}<${P}${U}></${P}>${y}`;
1326
+ B ? T = B.get(O)?.[S] ?? !1 : T = !!(E && E.has(O)), T ? b += `${o}<${O}${U}/>${h}` : b += `${o}<${O}${U}></${O}>${h}`;
1327
1327
  continue;
1328
1328
  }
1329
- const Y = N.length === 1 && N[0]["#text"] !== void 0, K = Y ? N[0]["#text"] : "", J = N.some((T) => T.__cdata), te = Y && K === "";
1329
+ const Y = P.length === 1 && P[0]["#text"] !== void 0, K = Y ? P[0]["#text"] : "", J = P.some((T) => T.__cdata), ee = Y && K === "";
1330
1330
  if (J) {
1331
- const T = N.find((R) => R.__cdata);
1331
+ const T = P.find((R) => R.__cdata);
1332
1332
  if (T) {
1333
1333
  const R = T.__cdata[0]["#text"] || "";
1334
- b += `${o}<${P}${U}><![CDATA[${R}]]></${P}>${y}`;
1334
+ b += `${o}<${O}${U}><![CDATA[${R}]]></${O}>${h}`;
1335
1335
  }
1336
- } else te ? b += `${o}<${P}${U}></${P}>${y}` : Y ? b += `${o}<${P}${U}>${K}</${P}>${y}` : (b += `${o}<${P}${U}>${y}`, b += ce(N, { indent: c, level: f + 1, format: v, selfClosingTags: V, selfClosingOccurrences: B, selfClosingCounters: x }), b += `${o}</${P}>${y}`);
1336
+ } else ee ? b += `${o}<${O}${U}></${O}>${h}` : Y ? b += `${o}<${O}${U}>${K}</${O}>${h}` : (b += `${o}<${O}${U}>${h}`, b += re(P, { indent: i, level: p + 1, format: y, selfClosingTags: E, selfClosingOccurrences: B, selfClosingCounters: x }), b += `${o}</${O}>${h}`);
1337
1337
  }
1338
1338
  return b;
1339
1339
  }, Rt = { class: "xml-format__content" }, jt = {
@@ -1357,45 +1357,45 @@ const Re = {
1357
1357
  preserveWhitespace: { type: Boolean, default: !1 }
1358
1358
  },
1359
1359
  emits: ["update:modelValue", "copy-success", "copy-error", "expand-all", "collapse-all", "compress", "format"],
1360
- setup(s, { expose: m, emit: c }) {
1361
- $e((l) => ({
1362
- "592bc0b6": U.value.colors.background,
1363
- "6efa1296": U.value.colors.text,
1364
- "470e5180": U.value.colors.error,
1365
- "43e0a2ce": U.value.colors.errorBackground
1360
+ setup(s, { expose: m, emit: i }) {
1361
+ $e((t) => ({
1362
+ "56635be8": U.value.colors.background,
1363
+ "106ac08b": U.value.colors.text,
1364
+ "07c07b2c": U.value.colors.error,
1365
+ "821d1190": U.value.colors.errorBackground
1366
1366
  }));
1367
- const f = s, v = c, o = q(null), y = q(""), V = q(/* @__PURE__ */ new Set()), B = q(null), x = q(""), b = q(""), X = q(/* @__PURE__ */ new Set()), P = q(!1), S = L(() => y.value === ""), N = (l) => {
1368
- if (!l || typeof l != "object")
1369
- return l;
1370
- if (Array.isArray(l)) {
1371
- const t = l.map((k) => N(k)), a = [], h = [];
1372
- t.forEach((k, O) => {
1367
+ const p = s, y = i, o = I(null), h = I(""), E = I(/* @__PURE__ */ new Set()), B = I(null), x = I(""), b = I(""), X = I(/* @__PURE__ */ new Set()), O = I(!1), S = L(() => h.value === ""), P = (t) => {
1368
+ if (!t || typeof t != "object")
1369
+ return t;
1370
+ if (Array.isArray(t)) {
1371
+ const l = t.map((k) => P(k)), a = [], g = [];
1372
+ l.forEach((k, N) => {
1373
1373
  if (!k || typeof k != "object") {
1374
- h.push({ item: k, originalIndex: O });
1374
+ g.push({ item: k, originalIndex: N });
1375
1375
  return;
1376
1376
  }
1377
- const W = Object.keys(k), I = W.find((D) => !D.startsWith("?") && !D.startsWith(":") && !D.startsWith("#") && !D.startsWith("__")) || W[0] || "";
1378
- I.startsWith("#") || I.startsWith("__") ? h.push({ item: k, originalIndex: O }) : I.startsWith("?") ? h.push({ item: k, originalIndex: O }) : a.push({ item: k, originalIndex: O });
1379
- }), a.sort((k, O) => {
1380
- const W = (ee) => {
1381
- const H = Object.keys(ee);
1382
- for (const e of H)
1383
- if (!e.startsWith("?") && !e.startsWith(":") && !e.startsWith("#") && !e.startsWith("__"))
1384
- return e;
1385
- return H[0] || "";
1386
- }, I = W(k.item), D = W(O.item);
1387
- return I.localeCompare(D);
1377
+ const W = Object.keys(k), q = W.find((V) => !V.startsWith("?") && !V.startsWith(":") && !V.startsWith("#") && !V.startsWith("__")) || W[0] || "";
1378
+ q.startsWith("#") || q.startsWith("__") ? g.push({ item: k, originalIndex: N }) : q.startsWith("?") ? g.push({ item: k, originalIndex: N }) : a.push({ item: k, originalIndex: N });
1379
+ }), a.sort((k, N) => {
1380
+ const W = (H) => {
1381
+ const e = Object.keys(H);
1382
+ for (const r of e)
1383
+ if (!r.startsWith("?") && !r.startsWith(":") && !r.startsWith("#") && !r.startsWith("__"))
1384
+ return r;
1385
+ return e[0] || "";
1386
+ }, q = W(k.item), V = W(N.item);
1387
+ return q.localeCompare(V);
1388
1388
  });
1389
- const p = [];
1389
+ const v = [];
1390
1390
  let C = 0;
1391
- for (let k = 0; k < t.length; k++) {
1392
- const O = h.find((W) => W.originalIndex === k);
1393
- O ? p.push(O.item) : C < a.length && (p.push(a[C].item), C++);
1391
+ for (let k = 0; k < l.length; k++) {
1392
+ const N = g.find((W) => W.originalIndex === k);
1393
+ N ? v.push(N.item) : C < a.length && (v.push(a[C].item), C++);
1394
1394
  }
1395
- return p;
1395
+ return v;
1396
1396
  }
1397
- const d = {}, g = Object.keys(l).sort((t, a) => {
1398
- const h = t.startsWith("?") || t.startsWith(":") || t.startsWith("#") || t.startsWith("__"), p = a.startsWith("?") || a.startsWith(":") || a.startsWith("#") || a.startsWith("__"), C = {
1397
+ const d = {}, f = Object.keys(t).sort((l, a) => {
1398
+ const g = l.startsWith("?") || l.startsWith(":") || l.startsWith("#") || l.startsWith("__"), v = a.startsWith("?") || a.startsWith(":") || a.startsWith("#") || a.startsWith("__"), C = {
1399
1399
  "?xml": 0,
1400
1400
  ":@": 1,
1401
1401
  "#text": 2,
@@ -1403,108 +1403,108 @@ const Re = {
1403
1403
  "#cdata": 3,
1404
1404
  "#comment": 4
1405
1405
  };
1406
- if (h && p) {
1407
- const k = C[t] ?? 99, O = C[a] ?? 99;
1408
- return k - O;
1409
- } else return h ? -1 : p ? 1 : t.localeCompare(a);
1406
+ if (g && v) {
1407
+ const k = C[l] ?? 99, N = C[a] ?? 99;
1408
+ return k - N;
1409
+ } else return g ? -1 : v ? 1 : l.localeCompare(a);
1410
1410
  });
1411
- for (const t of g) {
1412
- const a = l[t];
1413
- if (t === ":@" && a && typeof a == "object" && !Array.isArray(a)) {
1414
- const h = {}, p = Object.keys(a).sort();
1415
- for (const C of p)
1416
- h[C] = a[C];
1417
- d[t] = h;
1411
+ for (const l of f) {
1412
+ const a = t[l];
1413
+ if (l === ":@" && a && typeof a == "object" && !Array.isArray(a)) {
1414
+ const g = {}, v = Object.keys(a).sort();
1415
+ for (const C of v)
1416
+ g[C] = a[C];
1417
+ d[l] = g;
1418
1418
  } else
1419
- d[t] = N(a);
1419
+ d[l] = P(a);
1420
1420
  }
1421
1421
  return d;
1422
1422
  }, z = L(() => {
1423
- const l = B.value !== null ? B.value : o.value;
1424
- return !l || !P.value ? l : N(l);
1425
- }), Q = L(() => x.value ? null : z.value), U = L(() => Dt(f.theme)), Y = L(() => {
1426
- const l = Q.value;
1427
- return !l || !Array.isArray(l) ? [] : l.map((d, g) => ({ node: d, originalIndex: g })).filter((d) => !d.node["?xml"]);
1423
+ const t = B.value !== null ? B.value : o.value;
1424
+ return !t || !O.value ? t : P(t);
1425
+ }), Q = L(() => x.value ? null : z.value), U = L(() => Dt(p.theme)), Y = L(() => {
1426
+ const t = Q.value;
1427
+ return !t || !Array.isArray(t) ? [] : t.map((d, f) => ({ node: d, originalIndex: f })).filter((d) => !d.node["?xml"]);
1428
1428
  }), K = L(() => {
1429
- const l = Q.value;
1430
- if (!l || !Array.isArray(l)) return null;
1431
- const d = l.find((a) => a["?xml"]);
1429
+ const t = Q.value;
1430
+ if (!t || !Array.isArray(t)) return null;
1431
+ const d = t.find((a) => a["?xml"]);
1432
1432
  if (!d || !d[":@"]) return null;
1433
- const g = d[":@"], t = [];
1434
- return g["@_version"] && t.push(`version="${g["@_version"]}"`), g["@_encoding"] && t.push(`encoding="${g["@_encoding"]}"`), g["@_standalone"] && t.push(`standalone="${g["@_standalone"]}"`), t.length > 0 ? `<?xml ${t.join(" ")}?>` : null;
1435
- }), J = L(() => Y.value), te = (l) => {
1436
- if (!l || !l.trim()) {
1437
- y.value = "", o.value = null, b.value = "", B.value = null, x.value = "";
1433
+ const f = d[":@"], l = [];
1434
+ return f["@_version"] && l.push(`version="${f["@_version"]}"`), f["@_encoding"] && l.push(`encoding="${f["@_encoding"]}"`), f["@_standalone"] && l.push(`standalone="${f["@_standalone"]}"`), l.length > 0 ? `<?xml ${l.join(" ")}?>` : null;
1435
+ }), J = L(() => Y.value), ee = (t) => {
1436
+ if (!t || !t.trim()) {
1437
+ h.value = "", o.value = null, b.value = "", B.value = null, x.value = "";
1438
1438
  return;
1439
1439
  }
1440
1440
  try {
1441
- const d = Kt(l);
1441
+ const d = Kt(t);
1442
1442
  if (!d.valid) {
1443
- y.value = d.error || "Invalid XML", o.value = null, b.value = "", X.value = /* @__PURE__ */ new Set();
1443
+ h.value = d.error || "Invalid XML", o.value = null, b.value = "", X.value = /* @__PURE__ */ new Set();
1444
1444
  return;
1445
1445
  }
1446
- b.value = l, X.value = Nt(l), o.value = ge(l), Array.isArray(o.value) && Pt(o.value, l), y.value = "", B.value = null, x.value = "", ne(() => {
1446
+ b.value = t, X.value = Nt(t), o.value = ge(t), Array.isArray(o.value) && Pt(o.value, t), h.value = "", B.value = null, x.value = "", ae(() => {
1447
1447
  R();
1448
1448
  });
1449
1449
  } catch (d) {
1450
- y.value = d instanceof Error ? d.message : "Unknown parse error", o.value = null, b.value = "", B.value = null, x.value = "";
1450
+ h.value = d instanceof Error ? d.message : "Unknown parse error", o.value = null, b.value = "", B.value = null, x.value = "";
1451
1451
  }
1452
- }, T = (l) => {
1453
- V.value.has(l) ? V.value.delete(l) : V.value.add(l);
1452
+ }, T = (t) => {
1453
+ E.value.has(t) ? E.value.delete(t) : E.value.add(t);
1454
1454
  }, R = () => {
1455
- const l = /* @__PURE__ */ new Set(), d = (g, t = "") => {
1456
- Array.isArray(g) && g.forEach((a, h) => {
1457
- const p = Object.keys(a).find((O) => !O.startsWith(":") && !O.startsWith("#"));
1458
- if (!p) return;
1459
- const C = t ? `${t}.${p}[${h}]` : `${p}[${h}]`;
1460
- l.add(C);
1461
- const k = a[p];
1462
- Array.isArray(k) && d(k, C + "." + p);
1455
+ const t = /* @__PURE__ */ new Set(), d = (f, l = "") => {
1456
+ Array.isArray(f) && f.forEach((a, g) => {
1457
+ const v = Object.keys(a).find((N) => !N.startsWith(":") && !N.startsWith("#"));
1458
+ if (!v) return;
1459
+ const C = l ? `${l}.${v}[${g}]` : `${v}[${g}]`;
1460
+ t.add(C);
1461
+ const k = a[v];
1462
+ Array.isArray(k) && d(k, C + "." + v);
1463
1463
  });
1464
1464
  };
1465
- Y.value.forEach(({ node: g, originalIndex: t }) => {
1466
- const a = Object.keys(g).find((h) => !h.startsWith(":") && !h.startsWith("#"));
1465
+ Y.value.forEach(({ node: f, originalIndex: l }) => {
1466
+ const a = Object.keys(f).find((g) => !g.startsWith(":") && !g.startsWith("#"));
1467
1467
  if (a) {
1468
- const h = `${a}[${t}]`;
1469
- l.add(h);
1470
- const p = g[a];
1471
- Array.isArray(p) && d(p, h + "." + a);
1468
+ const g = `${a}[${l}]`;
1469
+ t.add(g);
1470
+ const v = f[a];
1471
+ Array.isArray(v) && d(v, g + "." + a);
1472
1472
  }
1473
- }), V.value = l, v("expand-all");
1473
+ }), E.value = t, y("expand-all");
1474
1474
  }, G = () => {
1475
- V.value.clear(), v("collapse-all");
1475
+ E.value.clear(), y("collapse-all");
1476
1476
  }, ue = async () => {
1477
1477
  if (S.value)
1478
1478
  try {
1479
- const l = Q.value || o.value;
1480
- if (!l) return;
1481
- const d = Array.isArray(l) ? ce(l, { indent: " ", originalXml: b.value || void 0 }) : ke(l, { format: !0, indentBy: " " });
1482
- await navigator.clipboard.writeText(d), v("copy-success", d);
1483
- } catch (l) {
1484
- const d = l instanceof Error ? l : new Error("Copy failed");
1485
- v("copy-error", d), console.error("Failed to copy XML:", l);
1479
+ const t = Q.value || o.value;
1480
+ if (!t) return;
1481
+ const d = Array.isArray(t) ? re(t, { indent: " ", originalXml: b.value || void 0 }) : ke(t, { format: !0, indentBy: " " });
1482
+ await navigator.clipboard.writeText(d), y("copy-success", d);
1483
+ } catch (t) {
1484
+ const d = t instanceof Error ? t : new Error("Copy failed");
1485
+ y("copy-error", d), console.error("Failed to copy XML:", t);
1486
1486
  }
1487
1487
  }, de = () => {
1488
1488
  if (!(!S.value || !o.value))
1489
1489
  try {
1490
- const l = Xt(o.value, f.modelValue);
1491
- v("update:modelValue", l), v("compress", l);
1492
- } catch (l) {
1493
- console.error("Failed to compress XML:", l);
1490
+ const t = Xt(o.value, p.modelValue);
1491
+ y("update:modelValue", t), y("compress", t);
1492
+ } catch (t) {
1493
+ console.error("Failed to compress XML:", t);
1494
1494
  }
1495
- }, le = () => {
1495
+ }, te = () => {
1496
1496
  if (S.value)
1497
1497
  try {
1498
- const l = Ot(f.modelValue, {
1498
+ const t = Ot(p.modelValue, {
1499
1499
  format: !0,
1500
1500
  indentBy: " "
1501
1501
  });
1502
- v("update:modelValue", l), v("format", l);
1503
- } catch (l) {
1504
- console.error("Failed to format XML:", l);
1502
+ y("update:modelValue", t), y("format", t);
1503
+ } catch (t) {
1504
+ console.error("Failed to format XML:", t);
1505
1505
  }
1506
- }, ye = (l) => {
1507
- if (!l || !l.expression.trim()) {
1506
+ }, he = (t) => {
1507
+ if (!t || !t.expression.trim()) {
1508
1508
  Z();
1509
1509
  return;
1510
1510
  }
@@ -1513,60 +1513,60 @@ const Re = {
1513
1513
  return;
1514
1514
  }
1515
1515
  try {
1516
- const g = new Ke().parseFromString(b.value, "text/xml"), t = We.select(l.expression, g);
1517
- if (!t || Array.isArray(t) && t.length === 0) {
1516
+ const f = new Ke().parseFromString(b.value, "text/xml"), l = We.select(t.expression, f);
1517
+ if (!l || Array.isArray(l) && l.length === 0) {
1518
1518
  B.value = [], x.value = "";
1519
1519
  return;
1520
1520
  }
1521
1521
  const a = new Xe();
1522
- let h = "";
1523
- Array.isArray(t) ? (h = `<result>
1524
- `, t.forEach((p) => {
1525
- p.nodeType === 1 ? h += " " + a.serializeToString(p) + `
1526
- ` : p.nodeType === 2 ? h += ` <attribute name="${p.name}" value="${p.value}"/>
1527
- ` : p.nodeType === 3 && (h += ` <text>${p.nodeValue}</text>
1522
+ let g = "";
1523
+ Array.isArray(l) ? (g = `<result>
1524
+ `, l.forEach((v) => {
1525
+ v.nodeType === 1 ? g += " " + a.serializeToString(v) + `
1526
+ ` : v.nodeType === 2 ? g += ` <attribute name="${v.name}" value="${v.value}"/>
1527
+ ` : v.nodeType === 3 && (g += ` <text>${v.nodeValue}</text>
1528
1528
  `);
1529
- }), h += "</result>") : h = a.serializeToString(t), B.value = ge(h), x.value = "", ne(() => {
1529
+ }), g += "</result>") : g = a.serializeToString(l), B.value = ge(g), x.value = "", ae(() => {
1530
1530
  R();
1531
1531
  });
1532
1532
  } catch (d) {
1533
1533
  x.value = d instanceof Error ? d.message : "Filter execution error", B.value = null;
1534
1534
  }
1535
1535
  }, Z = () => {
1536
- B.value = null, x.value = "", ne(() => {
1536
+ B.value = null, x.value = "", ae(() => {
1537
1537
  R();
1538
1538
  });
1539
1539
  }, me = () => {
1540
- P.value = !0, ne(() => {
1540
+ O.value = !0, ae(() => {
1541
1541
  R();
1542
1542
  });
1543
- }, he = () => {
1544
- P.value = !1, ne(() => {
1543
+ }, be = () => {
1544
+ O.value = !1, ae(() => {
1545
1545
  R();
1546
1546
  });
1547
- }, fe = async (l) => {
1547
+ }, fe = (t) => typeof t == "string" ? t : JSON.stringify(t, null, 2) ?? "undefined", ye = async (t) => {
1548
1548
  try {
1549
- const d = typeof l == "string" ? l : JSON.stringify(l, null, 2);
1550
- await navigator.clipboard.writeText(d), v("copy-success", d);
1549
+ const d = fe(t);
1550
+ await navigator.clipboard.writeText(d), y("copy-success", d);
1551
1551
  } catch (d) {
1552
- const g = d instanceof Error ? d : new Error("Copy failed");
1553
- v("copy-error", g), console.error("Failed to copy value:", d);
1552
+ const f = d instanceof Error ? d : new Error("Copy failed");
1553
+ y("copy-error", f), console.error("Failed to copy value:", d);
1554
1554
  }
1555
- }, be = (l, d, g) => {
1555
+ }, ne = (t, d, f) => {
1556
1556
  if (!(!o.value || !Array.isArray(o.value)))
1557
1557
  try {
1558
- const t = l.split(/\./).filter(Boolean);
1558
+ const l = t.split(/\./).filter(Boolean);
1559
1559
  let a = o.value;
1560
- for (let p = 0; p < t.length; p++) {
1561
- const C = t[p], k = C.match(/^(.+?)\[(\d+)\]$/);
1560
+ for (let v = 0; v < l.length; v++) {
1561
+ const C = l[v], k = C.match(/^(.+?)\[(\d+)\]$/);
1562
1562
  if (k) {
1563
- const O = k[1], W = parseInt(k[2]);
1564
- if (p === t.length - 1) {
1563
+ const N = k[1], W = parseInt(k[2]);
1564
+ if (v === l.length - 1) {
1565
1565
  if (Array.isArray(a) && a[W]) {
1566
- const I = a[W];
1567
- if (I[d]) {
1568
- const D = I[d];
1569
- delete I[d], I[g] = D, X.value.has(d) && (X.value.delete(d), X.value.add(g));
1566
+ const q = a[W];
1567
+ if (q[d]) {
1568
+ const V = q[d];
1569
+ delete q[d], q[f] = V, X.value.has(d) && (X.value.delete(d), X.value.add(f));
1570
1570
  }
1571
1571
  }
1572
1572
  } else
@@ -1574,29 +1574,29 @@ const Re = {
1574
1574
  } else
1575
1575
  a[C] && (a = a[C]);
1576
1576
  }
1577
- const h = ce(o.value, {
1577
+ const g = re(o.value, {
1578
1578
  indent: " ",
1579
1579
  originalXml: b.value || void 0
1580
1580
  });
1581
- v("update:modelValue", h);
1582
- } catch (t) {
1583
- console.error("Failed to update tag name:", t);
1581
+ y("update:modelValue", g);
1582
+ } catch (l) {
1583
+ console.error("Failed to update tag name:", l);
1584
1584
  }
1585
- }, oe = (l, d, g) => {
1585
+ }, _e = (t, d, f) => {
1586
1586
  if (!(!o.value || !Array.isArray(o.value)))
1587
1587
  try {
1588
- const t = l.split(/\./).filter(Boolean);
1588
+ const l = t.split(/\./).filter(Boolean);
1589
1589
  let a = o.value;
1590
- for (let p = 0; p < t.length; p++) {
1591
- const C = t[p], k = C.match(/^(.+?)\[(\d+)\]$/);
1590
+ for (let v = 0; v < l.length; v++) {
1591
+ const C = l[v], k = C.match(/^(.+?)\[(\d+)\]$/);
1592
1592
  if (k) {
1593
- const O = k[1], W = parseInt(k[2]);
1594
- if (p === t.length - 1) {
1593
+ const N = k[1], W = parseInt(k[2]);
1594
+ if (v === l.length - 1) {
1595
1595
  if (Array.isArray(a) && a[W]) {
1596
- const D = a[W][":@"];
1597
- if (D && D[`@_${d}`] !== void 0) {
1598
- const ee = D[`@_${d}`];
1599
- delete D[`@_${d}`], D[`@_${g}`] = ee;
1596
+ const V = a[W][":@"];
1597
+ if (V && V[`@_${d}`] !== void 0) {
1598
+ const H = V[`@_${d}`];
1599
+ delete V[`@_${d}`], V[`@_${f}`] = H;
1600
1600
  }
1601
1601
  }
1602
1602
  } else
@@ -1604,160 +1604,161 @@ const Re = {
1604
1604
  } else
1605
1605
  a[C] && (a = a[C]);
1606
1606
  }
1607
- const h = ce(o.value, { indent: " ", originalXml: b.value || void 0 });
1608
- v("update:modelValue", h);
1609
- } catch (t) {
1610
- console.error("Failed to update attribute name:", t);
1607
+ const g = re(o.value, { indent: " ", originalXml: b.value || void 0 });
1608
+ y("update:modelValue", g);
1609
+ } catch (l) {
1610
+ console.error("Failed to update attribute name:", l);
1611
1611
  }
1612
- }, _e = (l, d, g) => {
1612
+ }, xe = (t, d, f) => {
1613
1613
  if (!(!o.value || !Array.isArray(o.value)))
1614
1614
  try {
1615
- const t = l.split(/\./).filter(Boolean);
1615
+ const l = t.split(/\./).filter(Boolean);
1616
1616
  let a = o.value;
1617
- for (let p = 0; p < t.length; p++) {
1618
- const C = t[p], k = C.match(/^(.+?)\[(\d+)\]$/);
1617
+ for (let v = 0; v < l.length; v++) {
1618
+ const C = l[v], k = C.match(/^(.+?)\[(\d+)\]$/);
1619
1619
  if (k) {
1620
- const O = k[1], W = parseInt(k[2]);
1621
- if (p === t.length - 1) {
1620
+ const N = k[1], W = parseInt(k[2]);
1621
+ if (v === l.length - 1) {
1622
1622
  if (Array.isArray(a) && a[W]) {
1623
- const D = a[W][":@"];
1624
- D && D[`@_${d}`] !== void 0 && (D[`@_${d}`] = g);
1623
+ const V = a[W][":@"];
1624
+ V && V[`@_${d}`] !== void 0 && (V[`@_${d}`] = f);
1625
1625
  }
1626
1626
  } else
1627
1627
  Array.isArray(a) && a[W] && (a = a[W]);
1628
1628
  } else
1629
1629
  a[C] && (a = a[C]);
1630
1630
  }
1631
- const h = ce(o.value, { indent: " ", originalXml: b.value || void 0 });
1632
- v("update:modelValue", h);
1633
- } catch (t) {
1634
- console.error("Failed to update attribute value:", t);
1631
+ const g = re(o.value, { indent: " ", originalXml: b.value || void 0 });
1632
+ y("update:modelValue", g);
1633
+ } catch (l) {
1634
+ console.error("Failed to update attribute value:", l);
1635
1635
  }
1636
- }, xe = (l, d) => {
1636
+ }, le = (t, d) => {
1637
1637
  if (!(!o.value || !Array.isArray(o.value)))
1638
1638
  try {
1639
- const g = l.split(/\./).filter(Boolean);
1640
- let t = o.value, a = "";
1641
- for (let p = 0; p < g.length; p++) {
1642
- const C = g[p], k = C.match(/^(.+?)\[(\d+)\]$/);
1639
+ const f = t.split(/\./).filter(Boolean);
1640
+ let l = o.value, a = "";
1641
+ for (let v = 0; v < f.length; v++) {
1642
+ const C = f[v], k = C.match(/^(.+?)\[(\d+)\]$/);
1643
1643
  if (k) {
1644
- const O = k[1], W = parseInt(k[2]);
1645
- if (p === g.length - 1) {
1646
- if (Array.isArray(t) && t[W]) {
1647
- const I = t[W];
1648
- if (a = Object.keys(I).find((D) => !D.startsWith(":") && !D.startsWith("#")) || "", a && Array.isArray(I[a])) {
1649
- const D = I[a], ee = D.findIndex((H) => H["#text"] !== void 0);
1650
- ee !== -1 ? D[ee]["#text"] = d : D.push({ "#text": d });
1644
+ const N = k[1], W = parseInt(k[2]);
1645
+ if (v === f.length - 1) {
1646
+ if (Array.isArray(l) && l[W]) {
1647
+ const q = l[W];
1648
+ if (a = Object.keys(q).find((V) => !V.startsWith(":") && !V.startsWith("#")) || "", a && Array.isArray(q[a])) {
1649
+ const V = q[a], H = V.findIndex((e) => e["#text"] !== void 0);
1650
+ H !== -1 ? V[H]["#text"] = d : V.push({ "#text": d });
1651
1651
  }
1652
1652
  }
1653
1653
  } else
1654
- Array.isArray(t) && t[W] && (t = t[W]);
1654
+ Array.isArray(l) && l[W] && (l = l[W]);
1655
1655
  } else
1656
- t[C] && (t = t[C]);
1656
+ l[C] && (l = l[C]);
1657
1657
  }
1658
- const h = ce(o.value, { indent: " ", originalXml: b.value || void 0 });
1659
- v("update:modelValue", h);
1660
- } catch (g) {
1661
- console.error("Failed to update text content:", g);
1658
+ const g = re(o.value, { indent: " ", originalXml: b.value || void 0 });
1659
+ y("update:modelValue", g);
1660
+ } catch (f) {
1661
+ console.error("Failed to update text content:", f);
1662
1662
  }
1663
- }, ae = (l, d) => {
1663
+ }, ce = (t, d) => {
1664
1664
  if (!(!o.value || !Array.isArray(o.value)))
1665
1665
  try {
1666
- const g = l.split(/\./).filter(Boolean);
1667
- let t = o.value;
1668
- for (let h = 0; h < g.length; h++) {
1669
- const p = g[h], C = p.match(/^(.+?)\[(\d+)\]$/);
1666
+ const f = t.split(/\./).filter(Boolean);
1667
+ let l = o.value;
1668
+ for (let g = 0; g < f.length; g++) {
1669
+ const v = f[g], C = v.match(/^(.+?)\[(\d+)\]$/);
1670
1670
  if (C) {
1671
- const k = C[1], O = parseInt(C[2]);
1672
- if (h === g.length - 1) {
1673
- if (Array.isArray(t) && t[O]) {
1674
- const W = t[O], I = Object.keys(W).find((D) => !D.startsWith(":") && !D.startsWith("#"));
1675
- if (I && Array.isArray(W[I])) {
1676
- const D = W[I], ee = D.findIndex((H) => H.__cdata !== void 0);
1677
- if (ee !== -1) {
1678
- const H = D[ee];
1679
- Array.isArray(H.__cdata) && H.__cdata[0] && (H.__cdata[0]["#text"] = d);
1671
+ const k = C[1], N = parseInt(C[2]);
1672
+ if (g === f.length - 1) {
1673
+ if (Array.isArray(l) && l[N]) {
1674
+ const W = l[N], q = Object.keys(W).find((V) => !V.startsWith(":") && !V.startsWith("#"));
1675
+ if (q && Array.isArray(W[q])) {
1676
+ const V = W[q], H = V.findIndex((e) => e.__cdata !== void 0);
1677
+ if (H !== -1) {
1678
+ const e = V[H];
1679
+ Array.isArray(e.__cdata) && e.__cdata[0] && (e.__cdata[0]["#text"] = d);
1680
1680
  } else
1681
- D.push({
1681
+ V.push({
1682
1682
  __cdata: [{ "#text": d }]
1683
1683
  });
1684
1684
  }
1685
1685
  }
1686
1686
  } else
1687
- Array.isArray(t) && t[O] && (t = t[O]);
1687
+ Array.isArray(l) && l[N] && (l = l[N]);
1688
1688
  } else
1689
- t[p] && (t = t[p]);
1689
+ l[v] && (l = l[v]);
1690
1690
  }
1691
- const a = ce(o.value, { indent: " ", originalXml: b.value || void 0 });
1692
- v("update:modelValue", a);
1693
- } catch (g) {
1694
- console.error("Failed to update CDATA content:", g);
1691
+ const a = re(o.value, { indent: " ", originalXml: b.value || void 0 });
1692
+ y("update:modelValue", a);
1693
+ } catch (f) {
1694
+ console.error("Failed to update CDATA content:", f);
1695
1695
  }
1696
1696
  };
1697
- return Ee(() => f.modelValue, (l) => {
1698
- te(l);
1697
+ return Ee(() => p.modelValue, (t) => {
1698
+ ee(t);
1699
1699
  }, { immediate: !0 }), m({
1700
1700
  // 核心操作方法
1701
1701
  copyXml: ue,
1702
1702
  compressSource: de,
1703
- formatSource: le,
1703
+ formatSource: te,
1704
1704
  expandAll: R,
1705
1705
  collapseAll: G,
1706
1706
  toggleExpand: T,
1707
1707
  // 过滤相关方法
1708
- filter: ye,
1708
+ filter: he,
1709
1709
  clearFilter: Z,
1710
1710
  // 排序相关方法
1711
1711
  sort: me,
1712
- clearSort: he,
1713
- isSorted: () => P.value,
1712
+ clearSort: be,
1713
+ isSorted: () => O.value,
1714
1714
  // 状态访问方法
1715
1715
  isValidXml: () => S.value,
1716
1716
  getParsedXml: () => o.value,
1717
1717
  getFilteredXml: () => B.value,
1718
- getExpandedNodes: () => V.value,
1719
- getParseError: () => y.value,
1718
+ getExpandedNodes: () => E.value,
1719
+ getParseError: () => h.value,
1720
1720
  getFilterError: () => x.value,
1721
1721
  // 工具方法
1722
- parseXmlString: (l) => te(l),
1723
- copyValue: (l) => fe(l)
1724
- }), (l, d) => ($(), w("div", {
1722
+ parseXmlString: (t) => ee(t),
1723
+ copyValue: (t) => ye(t),
1724
+ getValue: (t) => fe(t)
1725
+ }), (t, d) => ($(), w("div", {
1725
1726
  class: Ve(["xml-format", `xml-format--${U.value.name}`])
1726
1727
  }, [
1727
1728
  n("div", Rt, [
1728
1729
  S.value ? x.value ? ($(), w("div", qt, [
1729
1730
  d[1] || (d[1] = n("h4", null, "Filter Error:", -1)),
1730
- n("pre", null, E(x.value), 1)
1731
+ n("pre", null, D(x.value), 1)
1731
1732
  ])) : ($(), w("div", It, [
1732
1733
  K.value ? ($(), w("div", {
1733
1734
  key: 0,
1734
1735
  class: "xml-declaration",
1735
- style: r({ color: U.value.colors.xmlDeclaration })
1736
- }, E(K.value), 5)) : pe("", !0),
1737
- ($(!0), w(re, null, ie(J.value, (g, t) => ($(), Be(Ct, {
1738
- key: t,
1739
- node: g.node,
1740
- index: g.originalIndex,
1736
+ style: c({ color: U.value.colors.xmlDeclaration })
1737
+ }, D(K.value), 5)) : pe("", !0),
1738
+ ($(!0), w(se, null, ie(J.value, (f, l) => ($(), Be(Ct, {
1739
+ key: l,
1740
+ node: f.node,
1741
+ index: f.originalIndex,
1741
1742
  level: 0,
1742
- expanded: V.value,
1743
+ expanded: E.value,
1743
1744
  theme: U.value,
1744
1745
  selfClosingTags: X.value,
1745
1746
  onToggleExpand: T,
1746
- onCopy: fe,
1747
- "onUpdate:tagName": be,
1748
- "onUpdate:attributeName": oe,
1749
- "onUpdate:attributeValue": _e,
1750
- "onUpdate:textContent": xe,
1751
- "onUpdate:cdataContent": ae
1747
+ onCopy: ye,
1748
+ "onUpdate:tagName": ne,
1749
+ "onUpdate:attributeName": _e,
1750
+ "onUpdate:attributeValue": xe,
1751
+ "onUpdate:textContent": le,
1752
+ "onUpdate:cdataContent": ce
1752
1753
  }, null, 8, ["node", "index", "expanded", "theme", "selfClosingTags"]))), 128))
1753
1754
  ])) : ($(), w("div", jt, [
1754
1755
  d[0] || (d[0] = n("h4", null, "XML Parse Error:", -1)),
1755
- n("pre", null, E(y.value), 1)
1756
+ n("pre", null, D(h.value), 1)
1756
1757
  ]))
1757
1758
  ])
1758
1759
  ], 2));
1759
1760
  }
1760
- }), el = /* @__PURE__ */ we(Lt, [["__scopeId", "data-v-d4c202e6"]]);
1761
+ }), el = /* @__PURE__ */ we(Lt, [["__scopeId", "data-v-afd6c257"]]);
1761
1762
  export {
1762
1763
  el as X,
1763
1764
  Ct as a,
@@ -1777,7 +1778,7 @@ export {
1777
1778
  Pt as o,
1778
1779
  ge as p,
1779
1780
  Nt as q,
1780
- ce as r,
1781
+ re as r,
1781
1782
  Tt as s,
1782
1783
  Ae as t,
1783
1784
  Kt as v