@pi-outpost/embed 0.35.2 → 0.36.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/dist/CodeEditor-2Vx8PHAy.js +2790 -0
  2. package/dist/CodeEditor-Cb6i9oIs.cjs +6 -0
  3. package/dist/clike-8rZWBES0.cjs +1 -0
  4. package/dist/clike-D-dOQnrm.js +587 -0
  5. package/dist/{conversationExport-DU5Xp2g-.js → conversationExport-D8C7qzeU.js} +2 -2
  6. package/dist/{conversationExport-DwLc0HDC.cjs → conversationExport-DhGnf-eW.cjs} +1 -1
  7. package/dist/{conversationHistory-DTP8xNqg.cjs → conversationHistory-BtFE4dMu.cjs} +1 -1
  8. package/dist/{conversationHistory-DHEPfViO.js → conversationHistory-CwYAL6o8.js} +1 -1
  9. package/dist/dist-B0lO3k1f.js +410 -0
  10. package/dist/dist-B7I27gkN.cjs +1 -0
  11. package/dist/dist-B8gmxwh-.cjs +23 -0
  12. package/dist/dist-BBUKMRrs.js +69 -0
  13. package/dist/dist-BWlGU9XM.js +395 -0
  14. package/dist/dist-BZcglaBe.cjs +1 -0
  15. package/dist/dist-BZjcsPqi.cjs +13 -0
  16. package/dist/dist-BfQGuM1r.js +1340 -0
  17. package/dist/dist-BhNvvg0I.js +471 -0
  18. package/dist/dist-BhXQJ0x3.js +10805 -0
  19. package/dist/dist-BlD6NhiG.js +296 -0
  20. package/dist/dist-Bppoi_v9.js +357 -0
  21. package/dist/dist-BvsCdwbL.cjs +1 -0
  22. package/dist/dist-C0_uLrCb.cjs +6 -0
  23. package/dist/dist-C8jjSrIs.cjs +11 -0
  24. package/dist/dist-C9dtxVRR.cjs +1 -0
  25. package/dist/dist-CA6ERWRG.js +380 -0
  26. package/dist/dist-CHKg1Qb9.js +1583 -0
  27. package/dist/dist-CyFPTQ2l.cjs +1 -0
  28. package/dist/dist-D8I4FQ-Q.cjs +1 -0
  29. package/dist/dist-DEl2Ze0j.cjs +2 -0
  30. package/dist/dist-DJbgM591.cjs +1 -0
  31. package/dist/dist-DPXHxuWb.js +855 -0
  32. package/dist/dist-DZrtSp8H.js +607 -0
  33. package/dist/dist-Dja2VlN5.cjs +1 -0
  34. package/dist/dist-DqbI0un6.cjs +1 -0
  35. package/dist/dist-Dr4zY56l.js +440 -0
  36. package/dist/dist-Dvqp7T4I.cjs +1 -0
  37. package/dist/dist-FSzij9Rn.js +271 -0
  38. package/dist/dist-Xjm88mbq.js +756 -0
  39. package/dist/dist-qNFo_ASR.cjs +9 -0
  40. package/dist/dist-qq9a_ch2.js +431 -0
  41. package/dist/dockerfile-4x0UkDoN.js +291 -0
  42. package/dist/dockerfile-C67wRfne.cjs +1 -0
  43. package/dist/docxExport-BKC_hi5D.js +67 -0
  44. package/dist/docxExport-V7joLrkm.cjs +3 -0
  45. package/dist/{docxExport-BWwEuboU.js → loadReferencedImage-FGse7G4p.js} +538 -306
  46. package/dist/{docxExport-PjDC4XKL.cjs → loadReferencedImage-QespeGh9.cjs} +7 -9
  47. package/dist/pi-outpost-embed.cjs +51 -24
  48. package/dist/pi-outpost-embed.js +3769 -3519
  49. package/dist/properties-C85NeSsH.js +20 -0
  50. package/dist/properties-XjDvZYDm.cjs +1 -0
  51. package/dist/ruby-Bx72aP7E.cjs +1 -0
  52. package/dist/ruby-CjYBP7RB.js +166 -0
  53. package/dist/shell-CD1ADQh5.cjs +1 -0
  54. package/dist/shell-CevoiH_y.js +109 -0
  55. package/dist/toml-CPJF62TK.js +28 -0
  56. package/dist/toml-OuUxin0A.cjs +1 -0
  57. package/package.json +1 -1
  58. package/dist/loadReferencedImage-C8Hn2ejN.js +0 -268
  59. package/dist/loadReferencedImage-q-G47ESL.cjs +0 -1
@@ -0,0 +1,380 @@
1
+ import { M as e, Q as t, _ as n, _t as r, a as i, k as a, l as o, n as s, vt as c, x as l } from "./dist-BhXQJ0x3.js";
2
+ import { n as u, r as d, t as f } from "./dist-DPXHxuWb.js";
3
+ //#region ../node_modules/@lezer/xml/dist/index.js
4
+ var p = 1, m = 2, h = 3, g = 4, _ = 5, v = 36, y = 37, b = 38, x = 11, S = 13;
5
+ function C(e) {
6
+ return e == 45 || e == 46 || e == 58 || e >= 65 && e <= 90 || e == 95 || e >= 97 && e <= 122 || e >= 161;
7
+ }
8
+ function w(e) {
9
+ return e == 9 || e == 10 || e == 13 || e == 32;
10
+ }
11
+ var T = null, E = null, D = 0;
12
+ function O(e, t) {
13
+ let n = e.pos + t;
14
+ if (E == e && D == n) return T;
15
+ for (; w(e.peek(t));) t++;
16
+ let r = "";
17
+ for (;;) {
18
+ let n = e.peek(t);
19
+ if (!C(n)) break;
20
+ r += String.fromCharCode(n), t++;
21
+ }
22
+ return E = e, D = n, T = r || null;
23
+ }
24
+ function k(e, t) {
25
+ this.name = e, this.parent = t;
26
+ }
27
+ var A = new f({
28
+ start: null,
29
+ shift(e, t, n, r) {
30
+ return t == p ? new k(O(r, 1) || "", e) : e;
31
+ },
32
+ reduce(e, t) {
33
+ return t == x && e ? e.parent : e;
34
+ },
35
+ reuse(e, t, n, r) {
36
+ let i = t.type.id;
37
+ return i == p || i == S ? new k(O(r, 1) || "", e) : e;
38
+ },
39
+ strict: !1
40
+ }), j = new u((e, t) => {
41
+ if (e.next == 60) {
42
+ if (e.advance(), e.next == 47) {
43
+ e.advance();
44
+ let n = O(e, 0);
45
+ if (!n) return e.acceptToken(_);
46
+ if (t.context && n == t.context.name) return e.acceptToken(m);
47
+ for (let r = t.context; r; r = r.parent) if (r.name == n) return e.acceptToken(h, -2);
48
+ e.acceptToken(g);
49
+ } else if (e.next != 33 && e.next != 63) return e.acceptToken(p);
50
+ }
51
+ }, { contextual: !0 });
52
+ function M(e, t) {
53
+ return new u((n) => {
54
+ let r = 0, i = t.charCodeAt(0);
55
+ scan: for (; !(n.next < 0); n.advance(), r++) if (n.next == i) {
56
+ for (let e = 1; e < t.length; e++) if (n.peek(e) != t.charCodeAt(e)) continue scan;
57
+ break;
58
+ }
59
+ r && n.acceptToken(e);
60
+ });
61
+ }
62
+ var N = M(v, "-->"), P = M(y, "?>"), F = M(b, "]]>"), I = r({
63
+ Text: c.content,
64
+ "StartTag StartCloseTag EndTag SelfCloseEndTag": c.angleBracket,
65
+ TagName: c.tagName,
66
+ "MismatchedCloseTag/TagName": [c.tagName, c.invalid],
67
+ AttributeName: c.attributeName,
68
+ AttributeValue: c.attributeValue,
69
+ Is: c.definitionOperator,
70
+ "EntityReference CharacterReference": c.character,
71
+ Comment: c.blockComment,
72
+ ProcessingInst: c.processingInstruction,
73
+ DoctypeDecl: c.documentMeta,
74
+ Cdata: c.special(c.string)
75
+ }), L = d.deserialize({
76
+ version: 14,
77
+ states: ",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'mO!bO,59eOOOO-E6w-E6wO'{OpO1G.uO'{OpO1G.uOOOP1G.u1G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!TQ!r!gR!x!rQ!u!hR!z!uQbRRxbQfTR|fQiUR!OiSXOYTaRb",
80
+ nodeNames: "⚠ StartTag StartCloseTag MissingCloseTag StartCloseTag StartCloseTag Document Text EntityReference CharacterReference Cdata Element EndTag OpenTag TagName Attribute AttributeName Is AttributeValue CloseTag SelfCloseEndTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl",
81
+ maxTerm: 50,
82
+ context: A,
83
+ nodeProps: [
84
+ [
85
+ "closedBy",
86
+ 1,
87
+ "SelfCloseEndTag EndTag",
88
+ 13,
89
+ "CloseTag MissingCloseTag"
90
+ ],
91
+ [
92
+ "openedBy",
93
+ 12,
94
+ "StartTag StartCloseTag",
95
+ 19,
96
+ "OpenTag",
97
+ 20,
98
+ "StartTag"
99
+ ],
100
+ [
101
+ "isolate",
102
+ -6,
103
+ 13,
104
+ 18,
105
+ 19,
106
+ 21,
107
+ 22,
108
+ 24,
109
+ ""
110
+ ]
111
+ ],
112
+ propSources: [I],
113
+ skippedNodes: [0],
114
+ repeatNodeCount: 9,
115
+ tokenData: "!)v~R!YOX$qXY)iYZ)iZ]$q]^)i^p$qpq)iqr$qrs*vsv$qvw+fwx/ix}$q}!O0[!O!P$q!P!Q2z!Q![$q![!]4n!]!^$q!^!_8U!_!`!#t!`!a!$l!a!b!%d!b!c$q!c!}4n!}#P$q#P#Q!'W#Q#R$q#R#S4n#S#T$q#T#o4n#o%W$q%W%o4n%o%p$q%p&a4n&a&b$q&b1p4n1p4U$q4U4d4n4d4e$q4e$IS4n$IS$I`$q$I`$Ib4n$Ib$Kh$q$Kh%#t4n%#t&/x$q&/x&Et4n&Et&FV$q&FV;'S4n;'S;:j8O;:j;=`)c<%l?&r$q?&r?Ah4n?Ah?BY$q?BY?Mn4n?MnO$qi$zXVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qa%nVVP!O`Ov%gwx&Tx!^%g!^!_&o!_;'S%g;'S;=`'W<%lO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o;'S;=`)]<%lO(oiLwX|W!O`Or(ors&osv(owx'}x#c(o#c#dMd#d;'S(o;'S;=`)]<%lO(oiMkX|W!O`Or(ors&osv(owx'}x#V(o#V#WNW#W;'S(o;'S;=`)]<%lO(oiN_X|W!O`Or(ors&osv(owx'}x#h(o#h#iNz#i;'S(o;'S;=`)]<%lO(oi! RX|W!O`Or(ors&osv(owx'}x#m(o#m#n! n#n;'S(o;'S;=`)]<%lO(oi! uX|W!O`Or(ors&osv(owx'}x#d(o#d#e!!b#e;'S(o;'S;=`)]<%lO(oi!!iX|W!O`Or(ors&osv(owx'}x#X(o#X#Y?y#Y;'S(o;'S;=`)]<%lO(oi!#_V!SP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(ok!$PXaQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo!$wX[UVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!%mZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",
116
+ tokenizers: [
117
+ j,
118
+ N,
119
+ P,
120
+ F,
121
+ 0,
122
+ 1,
123
+ 2,
124
+ 3,
125
+ 4
126
+ ],
127
+ topRules: { Document: [0, 6] },
128
+ tokenPrec: 0
129
+ });
130
+ //#endregion
131
+ //#region ../node_modules/@codemirror/lang-xml/dist/index.js
132
+ function R(e, t) {
133
+ let n = t && t.getChild("TagName");
134
+ return n ? e.sliceString(n.from, n.to) : "";
135
+ }
136
+ function z(e, t) {
137
+ let n = t && t.firstChild;
138
+ return !n || n.name != "OpenTag" ? "" : R(e, n);
139
+ }
140
+ function B(e, t, n) {
141
+ let r = t && t.getChildren("Attribute").find((e) => e.from <= n && e.to >= n), i = r && r.getChild("AttributeName");
142
+ return i ? e.sliceString(i.from, i.to) : "";
143
+ }
144
+ function V(e) {
145
+ for (let t = e && e.parent; t; t = t.parent) if (t.name == "Element") return t;
146
+ return null;
147
+ }
148
+ function H(e, t) {
149
+ let n = a(e).resolveInner(t, -1), r = null;
150
+ for (let e = n; !r && e.parent; e = e.parent) (e.name == "OpenTag" || e.name == "CloseTag" || e.name == "SelfClosingTag" || e.name == "MismatchedCloseTag") && (r = e);
151
+ if (r && (r.to > t || r.lastChild.type.isError)) {
152
+ let e = r.parent;
153
+ if (n.name == "TagName") return r.name == "CloseTag" || r.name == "MismatchedCloseTag" ? {
154
+ type: "closeTag",
155
+ from: n.from,
156
+ context: e
157
+ } : {
158
+ type: "openTag",
159
+ from: n.from,
160
+ context: V(e)
161
+ };
162
+ if (n.name == "AttributeName") return {
163
+ type: "attrName",
164
+ from: n.from,
165
+ context: r
166
+ };
167
+ if (n.name == "AttributeValue") return {
168
+ type: "attrValue",
169
+ from: n.from,
170
+ context: r
171
+ };
172
+ let i = n == r || n.name == "Attribute" ? n.childBefore(t) : n;
173
+ return i?.name == "StartTag" ? {
174
+ type: "openTag",
175
+ from: t,
176
+ context: V(e)
177
+ } : i?.name == "StartCloseTag" && i.to <= t ? {
178
+ type: "closeTag",
179
+ from: t,
180
+ context: e
181
+ } : i?.name == "Is" ? {
182
+ type: "attrValue",
183
+ from: t,
184
+ context: r
185
+ } : i ? {
186
+ type: "attrName",
187
+ from: t,
188
+ context: r
189
+ } : null;
190
+ }
191
+ if (n.name == "StartCloseTag") return {
192
+ type: "closeTag",
193
+ from: t,
194
+ context: n.parent
195
+ };
196
+ for (; n.parent && n.to == t && !n.lastChild?.type.isError;) n = n.parent;
197
+ return n.name == "Element" || n.name == "Text" || n.name == "Document" ? {
198
+ type: "tag",
199
+ from: t,
200
+ context: n.name == "Element" ? n : V(n)
201
+ } : null;
202
+ }
203
+ var U = class {
204
+ constructor(e, t, n) {
205
+ this.attrs = t, this.attrValues = n, this.children = [], this.name = e.name, this.completion = Object.assign(Object.assign({ type: "type" }, e.completion || {}), { label: this.name }), this.openCompletion = Object.assign(Object.assign({}, this.completion), { label: "<" + this.name }), this.closeCompletion = Object.assign(Object.assign({}, this.completion), {
206
+ label: "</" + this.name + ">",
207
+ boost: 2
208
+ }), this.closeNameCompletion = Object.assign(Object.assign({}, this.completion), { label: this.name + ">" }), this.text = e.textContent ? e.textContent.map((e) => ({
209
+ label: e,
210
+ type: "text"
211
+ })) : [];
212
+ }
213
+ }, W = /^[:\-\.\w\u00b7-\uffff]*$/;
214
+ function G(e) {
215
+ return Object.assign(Object.assign({ type: "property" }, e.completion || {}), { label: e.name });
216
+ }
217
+ function K(e) {
218
+ return typeof e == "string" ? {
219
+ label: `"${e}"`,
220
+ type: "constant"
221
+ } : /^"/.test(e.label) ? e : Object.assign(Object.assign({}, e), { label: `"${e.label}"` });
222
+ }
223
+ function q(e, t) {
224
+ let n = [], r = [], i = Object.create(null);
225
+ for (let e of t) {
226
+ let t = G(e);
227
+ n.push(t), e.global && r.push(t), e.values && (i[e.name] = e.values.map(K));
228
+ }
229
+ let a = [], o = [], s = Object.create(null);
230
+ for (let t of e) {
231
+ let e = r, c = i;
232
+ t.attributes && (e = e.concat(t.attributes.map((e) => typeof e == "string" ? n.find((t) => t.label == e) || {
233
+ label: e,
234
+ type: "property"
235
+ } : (e.values && (c == i && (c = Object.create(c)), c[e.name] = e.values.map(K)), G(e)))));
236
+ let l = new U(t, e, c);
237
+ s[l.name] = l, a.push(l), t.top && o.push(l);
238
+ }
239
+ o.length || (o = a);
240
+ for (let t = 0; t < a.length; t++) {
241
+ let n = e[t], r = a[t];
242
+ if (n.children) for (let e of n.children) s[e] && r.children.push(s[e]);
243
+ else r.children = a;
244
+ }
245
+ return (e) => {
246
+ let { doc: t } = e.state, n = H(e.state, e.pos);
247
+ if (!n || n.type == "tag" && !e.explicit) return null;
248
+ let { type: c, from: l, context: u } = n;
249
+ if (c == "openTag") {
250
+ let e = o, n = z(t, u);
251
+ return n && (e = s[n]?.children || a), {
252
+ from: l,
253
+ options: e.map((e) => e.completion),
254
+ validFor: W
255
+ };
256
+ }
257
+ if (c == "closeTag") {
258
+ let n = z(t, u);
259
+ return n ? {
260
+ from: l,
261
+ to: e.pos + +(t.sliceString(e.pos, e.pos + 1) == ">"),
262
+ options: [s[n]?.closeNameCompletion || {
263
+ label: n + ">",
264
+ type: "type"
265
+ }],
266
+ validFor: W
267
+ } : null;
268
+ }
269
+ if (c == "attrName") return {
270
+ from: l,
271
+ options: s[R(t, u)]?.attrs || r,
272
+ validFor: W
273
+ };
274
+ if (c == "attrValue") {
275
+ let n = B(t, u, l);
276
+ if (!n) return null;
277
+ let r = (s[R(t, u)]?.attrValues || i)[n];
278
+ return !r || !r.length ? null : {
279
+ from: l,
280
+ to: e.pos + +(t.sliceString(e.pos, e.pos + 1) == "\""),
281
+ options: r,
282
+ validFor: /^"[^"]*"?$/
283
+ };
284
+ }
285
+ if (c == "tag") {
286
+ let n = z(t, u), r = s[n], i = [], c = u && u.lastChild;
287
+ n && (!c || c.name != "CloseTag" || R(t, c) != n) && i.push(r ? r.closeCompletion : {
288
+ label: "</" + n + ">",
289
+ type: "type",
290
+ boost: 2
291
+ });
292
+ let d = i.concat((r?.children || (u ? a : o)).map((e) => e.openCompletion));
293
+ if (u && r?.text.length) {
294
+ let t = u.firstChild;
295
+ t.to > e.pos - 20 && !/\S/.test(e.state.sliceDoc(t.to, e.pos)) && (d = d.concat(r.text));
296
+ }
297
+ return {
298
+ from: l,
299
+ options: d,
300
+ validFor: /^<\/?[:\-\.\w\u00b7-\uffff]*$/
301
+ };
302
+ }
303
+ return null;
304
+ };
305
+ }
306
+ var J = /*@__PURE__*/ s.define({
307
+ name: "xml",
308
+ parser: /*@__PURE__*/ L.configure({ props: [
309
+ /*@__PURE__*/ l.add({
310
+ Element(e) {
311
+ let t = /^\s*<\//.test(e.textAfter);
312
+ return e.lineIndent(e.node.from) + (t ? 0 : e.unit);
313
+ },
314
+ "OpenTag CloseTag SelfClosingTag"(e) {
315
+ return e.column(e.node.from) + e.unit;
316
+ }
317
+ }),
318
+ /*@__PURE__*/ n.add({ Element(e) {
319
+ let t = e.firstChild, n = e.lastChild;
320
+ return !t || t.name != "OpenTag" ? null : {
321
+ from: t.to,
322
+ to: n.name == "CloseTag" ? n.from : e.to
323
+ };
324
+ } }),
325
+ /*@__PURE__*/ o.add({ "OpenTag CloseTag": (e) => e.getChild("TagName") })
326
+ ] }),
327
+ languageData: {
328
+ commentTokens: { block: {
329
+ open: "<!--",
330
+ close: "-->"
331
+ } },
332
+ indentOnInput: /^\s*<\/$/
333
+ }
334
+ });
335
+ function Y(e = {}) {
336
+ let t = [J.data.of({ autocomplete: q(e.elements || [], e.attributes || []) })];
337
+ return e.autoCloseTags !== !1 && t.push(Z), new i(J, t);
338
+ }
339
+ function X(e, t, n = e.length) {
340
+ if (!t) return "";
341
+ let r = t.firstChild, i = r && r.getChild("TagName");
342
+ return i ? e.sliceString(i.from, Math.min(i.to, n)) : "";
343
+ }
344
+ var Z = /*@__PURE__*/ e.inputHandler.of((e, n, r, i, o) => {
345
+ if (e.composing || e.state.readOnly || n != r || i != ">" && i != "/" || !J.isActiveAt(e.state, n, -1)) return !1;
346
+ let s = o(), { state: c } = s, l = c.changeByRange((e) => {
347
+ let { head: n } = e, r = c.doc.sliceString(n - 1, n) == i, o = a(c).resolveInner(n, -1), s;
348
+ if (r && i == ">" && o.name == "EndTag") {
349
+ let t = o.parent;
350
+ if (t.parent?.lastChild?.name != "CloseTag" && (s = X(c.doc, t.parent, n))) return {
351
+ range: e,
352
+ changes: {
353
+ from: n,
354
+ to: n + +(c.doc.sliceString(n, n + 1) === ">"),
355
+ insert: `</${s}>`
356
+ }
357
+ };
358
+ } else if (r && i == "/" && o.name == "StartCloseTag") {
359
+ let e = o.parent;
360
+ if (o.from == n - 2 && e.lastChild?.name != "CloseTag" && (s = X(c.doc, e, n))) {
361
+ let e = n + +(c.doc.sliceString(n, n + 1) === ">"), r = `${s}>`;
362
+ return {
363
+ range: t.cursor(n + r.length, -1),
364
+ changes: {
365
+ from: n,
366
+ to: e,
367
+ insert: r
368
+ }
369
+ };
370
+ }
371
+ }
372
+ return { range: e };
373
+ });
374
+ return !l.changes.empty && (e.dispatch([s, c.update(l, {
375
+ userEvent: "input.complete",
376
+ scrollIntoView: !0
377
+ })]), !0);
378
+ });
379
+ //#endregion
380
+ export { Y as xml };