@sobree/core 0.1.26 → 0.1.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -167,7 +167,7 @@ function Mo(t) {
|
|
|
167
167
|
raw: t
|
|
168
168
|
};
|
|
169
169
|
}
|
|
170
|
-
const
|
|
170
|
+
const g = {
|
|
171
171
|
/** WordprocessingML — the main body namespace. */
|
|
172
172
|
w: "http://schemas.openxmlformats.org/wordprocessingml/2006/main",
|
|
173
173
|
/** Relationships (images, headers, hyperlinks). */
|
|
@@ -190,11 +190,11 @@ const m = {
|
|
|
190
190
|
/** Content types. */
|
|
191
191
|
ct: "http://schemas.openxmlformats.org/package/2006/content-types"
|
|
192
192
|
}, Do = {
|
|
193
|
-
"xmlns:w":
|
|
194
|
-
"xmlns:r":
|
|
195
|
-
"xmlns:wp":
|
|
196
|
-
"xmlns:a":
|
|
197
|
-
"xmlns:pic":
|
|
193
|
+
"xmlns:w": g.w,
|
|
194
|
+
"xmlns:r": g.r,
|
|
195
|
+
"xmlns:wp": g.wp,
|
|
196
|
+
"xmlns:a": g.a,
|
|
197
|
+
"xmlns:pic": g.pic
|
|
198
198
|
};
|
|
199
199
|
function Y(t) {
|
|
200
200
|
var i;
|
|
@@ -203,19 +203,19 @@ function Y(t) {
|
|
|
203
203
|
return n;
|
|
204
204
|
}
|
|
205
205
|
function k(t, e) {
|
|
206
|
-
return t.getElementsByTagNameNS(
|
|
206
|
+
return t.getElementsByTagNameNS(g.w, e)[0] ?? null;
|
|
207
207
|
}
|
|
208
208
|
function te(t, e) {
|
|
209
|
-
return Array.from(t.getElementsByTagNameNS(
|
|
209
|
+
return Array.from(t.getElementsByTagNameNS(g.w, e));
|
|
210
210
|
}
|
|
211
211
|
function xe(t, e) {
|
|
212
212
|
const n = [];
|
|
213
213
|
for (const r of Array.from(t.children))
|
|
214
|
-
r.namespaceURI ===
|
|
214
|
+
r.namespaceURI === g.w && r.localName === e && n.push(r);
|
|
215
215
|
return n;
|
|
216
216
|
}
|
|
217
217
|
function C(t) {
|
|
218
|
-
return t ? t.getAttributeNS(
|
|
218
|
+
return t ? t.getAttributeNS(g.w, "val") ?? t.getAttribute("w:val") : null;
|
|
219
219
|
}
|
|
220
220
|
function Oo(t, e) {
|
|
221
221
|
const n = k(t, e);
|
|
@@ -249,51 +249,51 @@ function Ho(t, e) {
|
|
|
249
249
|
function _o(t, e) {
|
|
250
250
|
const n = Y(t), r = te(n, "font"), i = [], o = /* @__PURE__ */ new Set();
|
|
251
251
|
for (const s of r) {
|
|
252
|
-
const a = s.getAttributeNS(
|
|
252
|
+
const a = s.getAttributeNS(g.w, "name") ?? s.getAttribute("w:name") ?? "";
|
|
253
253
|
if (!a) continue;
|
|
254
254
|
const c = { name: a }, l = k(s, "altName");
|
|
255
255
|
if (l) {
|
|
256
|
-
const
|
|
257
|
-
|
|
256
|
+
const m = C(l);
|
|
257
|
+
m && (c.altName = m);
|
|
258
258
|
}
|
|
259
259
|
const u = k(s, "panose1");
|
|
260
260
|
if (u) {
|
|
261
|
-
const
|
|
262
|
-
|
|
261
|
+
const m = C(u);
|
|
262
|
+
m && (c.panose = m);
|
|
263
263
|
}
|
|
264
264
|
const f = k(s, "charset");
|
|
265
265
|
if (f) {
|
|
266
|
-
const
|
|
267
|
-
|
|
266
|
+
const m = C(f);
|
|
267
|
+
m && (c.charset = m);
|
|
268
268
|
}
|
|
269
269
|
const d = k(s, "family");
|
|
270
270
|
if (d) {
|
|
271
|
-
const
|
|
272
|
-
|
|
271
|
+
const m = C(d);
|
|
272
|
+
m && (c.family = m);
|
|
273
273
|
}
|
|
274
274
|
const h = k(s, "pitch");
|
|
275
275
|
if (h) {
|
|
276
|
-
const
|
|
277
|
-
|
|
276
|
+
const m = C(h);
|
|
277
|
+
m && (c.pitch = m);
|
|
278
278
|
}
|
|
279
279
|
const p = k(s, "sig");
|
|
280
280
|
if (p) {
|
|
281
|
-
const
|
|
282
|
-
|
|
281
|
+
const m = zo(p);
|
|
282
|
+
m && (c.sig = m);
|
|
283
283
|
}
|
|
284
284
|
k(s, "notTrueType") && (c.notTrueType = !0);
|
|
285
|
-
const
|
|
286
|
-
if (
|
|
287
|
-
c.embed =
|
|
288
|
-
for (const
|
|
289
|
-
|
|
285
|
+
const y = Uo(s, e);
|
|
286
|
+
if (y) {
|
|
287
|
+
c.embed = y;
|
|
288
|
+
for (const m of Object.values(y))
|
|
289
|
+
m != null && m.partPath && o.add(m.partPath);
|
|
290
290
|
}
|
|
291
291
|
i.push(c);
|
|
292
292
|
}
|
|
293
293
|
return { declarations: i, embeddedPartPaths: o };
|
|
294
294
|
}
|
|
295
295
|
function zo(t) {
|
|
296
|
-
const e = (c) => t.getAttributeNS(
|
|
296
|
+
const e = (c) => t.getAttributeNS(g.w, c) ?? t.getAttribute(`w:${c}`), n = e("usb0"), r = e("usb1"), i = e("usb2"), o = e("usb3"), s = e("csb0"), a = e("csb1");
|
|
297
297
|
return !n && !r && !i && !o && !s && !a ? null : {
|
|
298
298
|
usb0: n ?? "00000000",
|
|
299
299
|
usb1: r ?? "00000000",
|
|
@@ -320,13 +320,13 @@ function Uo(t, e) {
|
|
|
320
320
|
return i ? r : null;
|
|
321
321
|
}
|
|
322
322
|
function jo(t, e) {
|
|
323
|
-
const n = t.getAttributeNS(
|
|
323
|
+
const n = t.getAttributeNS(g.r, "id") ?? t.getAttribute("r:id");
|
|
324
324
|
if (!n) return null;
|
|
325
325
|
const r = e.get(n);
|
|
326
326
|
if (!r) return null;
|
|
327
|
-
const o = { partPath: r.startsWith("word/") ? r : `word/${r}` }, s = t.getAttributeNS(
|
|
327
|
+
const o = { partPath: r.startsWith("word/") ? r : `word/${r}` }, s = t.getAttributeNS(g.w, "fontKey") ?? t.getAttribute("w:fontKey");
|
|
328
328
|
s && (o.fontKey = s);
|
|
329
|
-
const a = t.getAttributeNS(
|
|
329
|
+
const a = t.getAttributeNS(g.w, "subsetted") ?? t.getAttribute("w:subsetted");
|
|
330
330
|
return (a === "true" || a === "1") && (o.subsetted = !0), o;
|
|
331
331
|
}
|
|
332
332
|
const Wo = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/font", Xo = "application/vnd.openxmlformats-officedocument.wordprocessingml.fontTable+xml";
|
|
@@ -347,9 +347,9 @@ function Yo(t, e) {
|
|
|
347
347
|
function Vo(t) {
|
|
348
348
|
if (!t.fonts || t.fonts.length === 0) return null;
|
|
349
349
|
let e = 1;
|
|
350
|
-
const n = [], r = t.fonts.map((a) => qo(a, () => `rId${e++}`, n)), i = ne(b("w:fonts", { "xmlns:w":
|
|
350
|
+
const n = [], r = t.fonts.map((a) => qo(a, () => `rId${e++}`, n)), i = ne(b("w:fonts", { "xmlns:w": g.w, "xmlns:r": g.r }, r)), o = n.map(
|
|
351
351
|
({ id: a, target: c }) => b("Relationship", { Id: a, Type: Wo, Target: c })
|
|
352
|
-
), s = ne(b("Relationships", { xmlns:
|
|
352
|
+
), s = ne(b("Relationships", { xmlns: g.rel }, o));
|
|
353
353
|
return { fontTableXml: i, fontTableRelsXml: s };
|
|
354
354
|
}
|
|
355
355
|
function Go(t) {
|
|
@@ -403,8 +403,8 @@ function Ko(t, e, n, r = {}) {
|
|
|
403
403
|
);
|
|
404
404
|
continue;
|
|
405
405
|
}
|
|
406
|
-
const p = Zo(a),
|
|
407
|
-
a[p] = Io(f,
|
|
406
|
+
const p = Zo(a), y = Ro();
|
|
407
|
+
a[p] = Io(f, y), s[u] = { partPath: p, fontKey: y };
|
|
408
408
|
}
|
|
409
409
|
if (Object.keys(s).length === 0)
|
|
410
410
|
return { next: t, warnings: i };
|
|
@@ -473,8 +473,8 @@ class Qo {
|
|
|
473
473
|
if (!d) continue;
|
|
474
474
|
const h = Fo(f.fontKey) ? d : Po(d, f.fontKey ?? ""), p = new Blob([new Uint8Array(h)], {
|
|
475
475
|
type: "application/font-sfnt"
|
|
476
|
-
}),
|
|
477
|
-
this.blobUrls.push(
|
|
476
|
+
}), y = URL.createObjectURL(p);
|
|
477
|
+
this.blobUrls.push(y), s.push(es(a.name, y, u));
|
|
478
478
|
}
|
|
479
479
|
}
|
|
480
480
|
this.styleEl.textContent = s.join(`
|
|
@@ -550,7 +550,7 @@ function is(t = [], e = []) {
|
|
|
550
550
|
const i = t.map(
|
|
551
551
|
(o) => b("Override", { PartName: o.partName, ContentType: o.contentType })
|
|
552
552
|
);
|
|
553
|
-
return ne(b("Types", { xmlns:
|
|
553
|
+
return ne(b("Types", { xmlns: g.ct }, [...n, ...i]));
|
|
554
554
|
}
|
|
555
555
|
function os() {
|
|
556
556
|
const t = [
|
|
@@ -560,7 +560,7 @@ function os() {
|
|
|
560
560
|
Target: "word/document.xml"
|
|
561
561
|
})
|
|
562
562
|
];
|
|
563
|
-
return ne(b("Relationships", { xmlns:
|
|
563
|
+
return ne(b("Relationships", { xmlns: g.rel }, t));
|
|
564
564
|
}
|
|
565
565
|
function ss(t = []) {
|
|
566
566
|
const e = b("Relationship", {
|
|
@@ -575,7 +575,7 @@ function ss(t = []) {
|
|
|
575
575
|
};
|
|
576
576
|
return r.external && (i.TargetMode = "External"), b("Relationship", i);
|
|
577
577
|
});
|
|
578
|
-
return ne(b("Relationships", { xmlns:
|
|
578
|
+
return ne(b("Relationships", { xmlns: g.rel }, [e, ...n]));
|
|
579
579
|
}
|
|
580
580
|
function as(t) {
|
|
581
581
|
const e = t.toLowerCase();
|
|
@@ -639,11 +639,11 @@ function gs(t, e, n) {
|
|
|
639
639
|
{ prst: "rect" },
|
|
640
640
|
b("a:avLst")
|
|
641
641
|
)}`
|
|
642
|
-
), f = b("pic:pic", { "xmlns:pic":
|
|
642
|
+
), f = b("pic:pic", { "xmlns:pic": g.pic }, `${l}${c}${u}`), d = b("a:graphicData", { uri: g.pic }, f), h = b("a:graphic", { "xmlns:a": g.a }, d), p = b("wp:extent", { cx: r, cy: i }), y = b("wp:docPr", {
|
|
643
643
|
id: n,
|
|
644
644
|
name: o,
|
|
645
645
|
descr: at(s)
|
|
646
|
-
}),
|
|
646
|
+
}), m = b(
|
|
647
647
|
"wp:inline",
|
|
648
648
|
{
|
|
649
649
|
distT: 0,
|
|
@@ -651,9 +651,9 @@ function gs(t, e, n) {
|
|
|
651
651
|
distL: 0,
|
|
652
652
|
distR: 0
|
|
653
653
|
},
|
|
654
|
-
`${p}${
|
|
654
|
+
`${p}${y}${h}`
|
|
655
655
|
);
|
|
656
|
-
return b("w:r", null, b("w:drawing", { "xmlns:wp":
|
|
656
|
+
return b("w:r", null, b("w:drawing", { "xmlns:wp": g.wp }, m));
|
|
657
657
|
}
|
|
658
658
|
function Wr(t, e, n) {
|
|
659
659
|
const r = [];
|
|
@@ -929,7 +929,7 @@ function Fs(t, e) {
|
|
|
929
929
|
}
|
|
930
930
|
function Bs(t, e, n, r) {
|
|
931
931
|
const i = t === "header" ? "w:hdr" : "w:ftr", o = Es(e, n, r);
|
|
932
|
-
return o.length === 0 && o.push(b("w:p")), ne(b(i, { "xmlns:w":
|
|
932
|
+
return o.length === 0 && o.push(b("w:p")), ne(b(i, { "xmlns:w": g.w, "xmlns:r": g.r }, o));
|
|
933
933
|
}
|
|
934
934
|
function Ls(t, e, n) {
|
|
935
935
|
const r = [];
|
|
@@ -991,7 +991,7 @@ function Os(t) {
|
|
|
991
991
|
), n = t.map(
|
|
992
992
|
(r, i) => b("w:num", { "w:numId": r.numId }, [b("w:abstractNumId", { "w:val": i })])
|
|
993
993
|
);
|
|
994
|
-
return ne(b("w:numbering", { "xmlns:w":
|
|
994
|
+
return ne(b("w:numbering", { "xmlns:w": g.w }, [...e, ...n]));
|
|
995
995
|
}
|
|
996
996
|
function $s(t) {
|
|
997
997
|
const e = [
|
|
@@ -1027,7 +1027,7 @@ function Hs(t) {
|
|
|
1027
1027
|
), t.some((r) => r.id === "Normal") || e.push(Tn({ id: "Normal", type: "paragraph", displayName: "Normal" }, !0));
|
|
1028
1028
|
for (const r of t)
|
|
1029
1029
|
e.push(Tn(r, r.id === "Normal"));
|
|
1030
|
-
return ne(b("w:styles", { "xmlns:w":
|
|
1030
|
+
return ne(b("w:styles", { "xmlns:w": g.w }, e));
|
|
1031
1031
|
}
|
|
1032
1032
|
function Tn(t, e) {
|
|
1033
1033
|
const n = {
|
|
@@ -1276,14 +1276,14 @@ class Ks {
|
|
|
1276
1276
|
*/
|
|
1277
1277
|
fitTo(e, n, r = !1) {
|
|
1278
1278
|
var E;
|
|
1279
|
-
const i = this.container.getBoundingClientRect(), o = e.getBoundingClientRect(), s = this.stage.getBoundingClientRect(), a = this.scale, c = o.width / a, l = o.height / a, u = (o.left - s.left) / a, f = (o.top - s.top) / a, d = 32, h = i.width - d * 2, p = i.height - d * 2,
|
|
1280
|
-
let
|
|
1279
|
+
const i = this.container.getBoundingClientRect(), o = e.getBoundingClientRect(), s = this.stage.getBoundingClientRect(), a = this.scale, c = o.width / a, l = o.height / a, u = (o.left - s.left) / a, f = (o.top - s.top) / a, d = 32, h = i.width - d * 2, p = i.height - d * 2, y = h / c, m = p / l, v = An(n === "width" ? y : Math.min(y, m), this.minScale, this.maxScale), x = i.width / 2 - (u + c / 2) * v;
|
|
1280
|
+
let S;
|
|
1281
1281
|
if (n === "width") {
|
|
1282
|
-
const
|
|
1283
|
-
|
|
1282
|
+
const I = (i.height / 2 - this.ty) / a;
|
|
1283
|
+
S = i.height / 2 - I * v;
|
|
1284
1284
|
} else
|
|
1285
|
-
|
|
1286
|
-
this.scale =
|
|
1285
|
+
S = i.height / 2 - (f + l / 2) * v;
|
|
1286
|
+
this.scale = v, this.tx = x, this.ty = S, this.wheelGestures.engageHorizontalLock(), r ? this.applyTransformAnimated() : this.applyTransform(), (E = this.onScaleChange) == null || E.call(this, this.scale);
|
|
1287
1287
|
}
|
|
1288
1288
|
/**
|
|
1289
1289
|
* Pan the stage by `(dx, dy)` CSS pixels. Optional `animate` runs the
|
|
@@ -1958,11 +1958,11 @@ function Ea(t) {
|
|
|
1958
1958
|
} catch {
|
|
1959
1959
|
return;
|
|
1960
1960
|
}
|
|
1961
|
-
const n = e.getElementsByTagNameNS(
|
|
1961
|
+
const n = e.getElementsByTagNameNS(g.a, "clrScheme")[0];
|
|
1962
1962
|
if (!n) return;
|
|
1963
1963
|
const r = {};
|
|
1964
1964
|
for (const i of Array.from(n.children)) {
|
|
1965
|
-
if (i.namespaceURI !==
|
|
1965
|
+
if (i.namespaceURI !== g.a) continue;
|
|
1966
1966
|
const o = lt(i, "srgbClr"), s = lt(i, "sysClr"), a = (o == null ? void 0 : o.getAttribute("val")) ?? (s == null ? void 0 : s.getAttribute("lastClr"));
|
|
1967
1967
|
a && /^[0-9A-Fa-f]{6}$/.test(a) && (r[i.localName] = `#${a.toUpperCase()}`);
|
|
1968
1968
|
}
|
|
@@ -1997,7 +1997,7 @@ function Ca(t) {
|
|
|
1997
1997
|
function Mn(t, e) {
|
|
1998
1998
|
let [n, r, i] = Aa(t), o = null;
|
|
1999
1999
|
for (const s of Array.from(e.children)) {
|
|
2000
|
-
if (s.namespaceURI !==
|
|
2000
|
+
if (s.namespaceURI !== g.a) continue;
|
|
2001
2001
|
const a = Number(s.getAttribute("val") ?? "0");
|
|
2002
2002
|
if (Number.isFinite(a))
|
|
2003
2003
|
switch (s.localName) {
|
|
@@ -2072,7 +2072,7 @@ function Nt(t, e, n) {
|
|
|
2072
2072
|
}
|
|
2073
2073
|
function lt(t, e) {
|
|
2074
2074
|
for (const n of Array.from(t.children))
|
|
2075
|
-
if (n.namespaceURI ===
|
|
2075
|
+
if (n.namespaceURI === g.a && n.localName === e) return n;
|
|
2076
2076
|
return null;
|
|
2077
2077
|
}
|
|
2078
2078
|
function Na(t) {
|
|
@@ -2085,7 +2085,7 @@ function Na(t) {
|
|
|
2085
2085
|
const o = [];
|
|
2086
2086
|
for (const a of n)
|
|
2087
2087
|
for (const c of Array.from(a.children)) {
|
|
2088
|
-
if (c.namespaceURI !==
|
|
2088
|
+
if (c.namespaceURI !== g.a) continue;
|
|
2089
2089
|
const l = Pa(c);
|
|
2090
2090
|
l && o.push(l);
|
|
2091
2091
|
}
|
|
@@ -2112,17 +2112,17 @@ function Pa(t) {
|
|
|
2112
2112
|
function Ia(t) {
|
|
2113
2113
|
const e = [];
|
|
2114
2114
|
for (const n of Array.from(t.children))
|
|
2115
|
-
n.namespaceURI ===
|
|
2115
|
+
n.namespaceURI === g.a && n.localName === "pt" && e.push([ut(n, "x"), ut(n, "y")]);
|
|
2116
2116
|
return e;
|
|
2117
2117
|
}
|
|
2118
2118
|
function Ra(t, e) {
|
|
2119
2119
|
for (const n of Array.from(t.children))
|
|
2120
|
-
if (n.namespaceURI ===
|
|
2120
|
+
if (n.namespaceURI === g.a && n.localName === e) return n;
|
|
2121
2121
|
return null;
|
|
2122
2122
|
}
|
|
2123
2123
|
function Fa(t, e) {
|
|
2124
2124
|
return Array.from(t.children).filter(
|
|
2125
|
-
(n) => n.namespaceURI ===
|
|
2125
|
+
(n) => n.namespaceURI === g.a && n.localName === e
|
|
2126
2126
|
);
|
|
2127
2127
|
}
|
|
2128
2128
|
function ut(t, e) {
|
|
@@ -2131,10 +2131,10 @@ function ut(t, e) {
|
|
|
2131
2131
|
}
|
|
2132
2132
|
function ii(t, e, n = !0) {
|
|
2133
2133
|
var a;
|
|
2134
|
-
const r = [], i = [], o = Array.from(t.getElementsByTagNameNS(
|
|
2134
|
+
const r = [], i = [], o = Array.from(t.getElementsByTagNameNS(g.w, "drawing"));
|
|
2135
2135
|
let s = 0;
|
|
2136
2136
|
for (const c of o) {
|
|
2137
|
-
const l =
|
|
2137
|
+
const l = B(c, g.wp, "anchor");
|
|
2138
2138
|
if (!l) continue;
|
|
2139
2139
|
const u = Ma(l, c, e, () => `anchor-${s++}`);
|
|
2140
2140
|
u && (r.push(u), i.push(c));
|
|
@@ -2148,7 +2148,7 @@ function oi(t, e, n = !0) {
|
|
|
2148
2148
|
const r = [], i = [];
|
|
2149
2149
|
let o = 0;
|
|
2150
2150
|
for (const a of ["pict", "object"])
|
|
2151
|
-
for (const c of Array.from(t.getElementsByTagNameNS(
|
|
2151
|
+
for (const c of Array.from(t.getElementsByTagNameNS(g.w, a))) {
|
|
2152
2152
|
const l = Ba(c, e, () => `vml-${o++}`);
|
|
2153
2153
|
l && (r.push(l), i.push(c));
|
|
2154
2154
|
}
|
|
@@ -2157,13 +2157,13 @@ function oi(t, e, n = !0) {
|
|
|
2157
2157
|
return r;
|
|
2158
2158
|
}
|
|
2159
2159
|
function Ba(t, e, n) {
|
|
2160
|
-
const r = t.getElementsByTagNameNS(
|
|
2160
|
+
const r = t.getElementsByTagNameNS(g.v, "imagedata")[0];
|
|
2161
2161
|
if (!r) return null;
|
|
2162
2162
|
const i = r.parentElement, o = La((i == null ? void 0 : i.getAttribute("style")) ?? "");
|
|
2163
2163
|
if (o.position !== "absolute") return null;
|
|
2164
2164
|
const s = We(o.width), a = We(o.height);
|
|
2165
2165
|
if (s <= 0 || a <= 0) return null;
|
|
2166
|
-
const c = r.getAttributeNS(
|
|
2166
|
+
const c = r.getAttributeNS(g.r, "id") ?? r.getAttribute("r:id");
|
|
2167
2167
|
if (!c) return null;
|
|
2168
2168
|
const l = e.rels.get(c);
|
|
2169
2169
|
if (!l) return null;
|
|
@@ -2202,11 +2202,11 @@ function We(t) {
|
|
|
2202
2202
|
return Math.round(i * 12700);
|
|
2203
2203
|
}
|
|
2204
2204
|
function Ma(t, e, n, r) {
|
|
2205
|
-
const i = Xa(t, e, n), o =
|
|
2205
|
+
const i = Xa(t, e, n), o = B(t, g.wp, "extent");
|
|
2206
2206
|
if (!o) return null;
|
|
2207
2207
|
const s = W(o, "cx"), a = W(o, "cy");
|
|
2208
2208
|
if (s <= 0 || a <= 0) return null;
|
|
2209
|
-
const c = Ya(t), l = t.getElementsByTagNameNS(
|
|
2209
|
+
const c = Ya(t), l = t.getElementsByTagNameNS(g.a, "graphicData")[0];
|
|
2210
2210
|
if (!l) return null;
|
|
2211
2211
|
const u = Ha(l, n, r);
|
|
2212
2212
|
if (!u) return null;
|
|
@@ -2225,14 +2225,14 @@ function Ma(t, e, n, r) {
|
|
|
2225
2225
|
d.wrap = h;
|
|
2226
2226
|
const p = Oa(t);
|
|
2227
2227
|
p && (d.wrapText = p);
|
|
2228
|
-
const
|
|
2229
|
-
|
|
2228
|
+
const y = $a(t);
|
|
2229
|
+
y && (d.textDistancesEmu = y);
|
|
2230
2230
|
}
|
|
2231
2231
|
return d;
|
|
2232
2232
|
}
|
|
2233
2233
|
function Da(t) {
|
|
2234
2234
|
for (const e of Array.from(t.children))
|
|
2235
|
-
if (e.namespaceURI ===
|
|
2235
|
+
if (e.namespaceURI === g.wp)
|
|
2236
2236
|
switch (e.localName) {
|
|
2237
2237
|
case "wrapSquare":
|
|
2238
2238
|
return "square";
|
|
@@ -2248,7 +2248,7 @@ function Da(t) {
|
|
|
2248
2248
|
}
|
|
2249
2249
|
function Oa(t) {
|
|
2250
2250
|
for (const e of Array.from(t.children))
|
|
2251
|
-
if (e.namespaceURI ===
|
|
2251
|
+
if (e.namespaceURI === g.wp && (e.localName === "wrapSquare" || e.localName === "wrapTight" || e.localName === "wrapThrough")) {
|
|
2252
2252
|
const n = e.getAttribute("wrapText");
|
|
2253
2253
|
if (n === "left" || n === "right" || n === "bothSides" || n === "largest") return n;
|
|
2254
2254
|
}
|
|
@@ -2269,23 +2269,23 @@ function Xe(t) {
|
|
|
2269
2269
|
return Number.isFinite(e) ? e : 0;
|
|
2270
2270
|
}
|
|
2271
2271
|
function Ha(t, e, n) {
|
|
2272
|
-
const r =
|
|
2272
|
+
const r = B(t, g.wpg, "wgp");
|
|
2273
2273
|
if (r) return si(r, e, n);
|
|
2274
|
-
const i =
|
|
2274
|
+
const i = B(t, g.wps, "wsp");
|
|
2275
2275
|
if (i) return ai(i, e);
|
|
2276
|
-
const o =
|
|
2276
|
+
const o = B(t, g.pic, "pic");
|
|
2277
2277
|
return o ? ci(o, e) : null;
|
|
2278
2278
|
}
|
|
2279
2279
|
function si(t, e, n) {
|
|
2280
|
-
const r =
|
|
2280
|
+
const r = B(t, g.wpg, "grpSpPr"), i = r ? r.getElementsByTagNameNS(g.a, "xfrm")[0] : void 0, o = i ? i.getElementsByTagNameNS(g.a, "chExt")[0] : void 0, s = i ? i.getElementsByTagNameNS(g.a, "chOff")[0] : void 0, a = o ? W(o, "cx") : 0, c = o ? W(o, "cy") : 0, l = s ? W(s, "x") : 0, u = s ? W(s, "y") : 0, f = [];
|
|
2281
2281
|
for (const d of Array.from(t.children))
|
|
2282
|
-
if (d.namespaceURI ===
|
|
2282
|
+
if (d.namespaceURI === g.wps && d.localName === "wsp") {
|
|
2283
2283
|
const h = _a(d, e, n);
|
|
2284
2284
|
h && f.push(h);
|
|
2285
|
-
} else if (d.namespaceURI ===
|
|
2285
|
+
} else if (d.namespaceURI === g.pic && d.localName === "pic") {
|
|
2286
2286
|
const h = za(d, e, n);
|
|
2287
2287
|
h && f.push(h);
|
|
2288
|
-
} else if (d.namespaceURI ===
|
|
2288
|
+
} else if (d.namespaceURI === g.wpg && d.localName === "grpSp") {
|
|
2289
2289
|
const h = Ua(d, e, n);
|
|
2290
2290
|
h && f.push(h);
|
|
2291
2291
|
}
|
|
@@ -2341,7 +2341,7 @@ function Ua(t, e, n) {
|
|
|
2341
2341
|
};
|
|
2342
2342
|
}
|
|
2343
2343
|
function ja(t) {
|
|
2344
|
-
const e =
|
|
2344
|
+
const e = B(t, g.wps, "bodyPr");
|
|
2345
2345
|
if (!e) return;
|
|
2346
2346
|
const n = (l) => {
|
|
2347
2347
|
const u = e.getAttribute(l);
|
|
@@ -2360,9 +2360,9 @@ function ja(t) {
|
|
|
2360
2360
|
};
|
|
2361
2361
|
}
|
|
2362
2362
|
function ai(t, e) {
|
|
2363
|
-
const n =
|
|
2363
|
+
const n = B(t, g.wps, "txbx");
|
|
2364
2364
|
if (n) {
|
|
2365
|
-
const a =
|
|
2365
|
+
const a = B(n, g.w, "txbxContent");
|
|
2366
2366
|
if (a) {
|
|
2367
2367
|
const c = {
|
|
2368
2368
|
kind: "textbox",
|
|
@@ -2378,7 +2378,7 @@ function ai(t, e) {
|
|
|
2378
2378
|
const r = {
|
|
2379
2379
|
kind: "shape",
|
|
2380
2380
|
geometry: Va(t)
|
|
2381
|
-
}, i = t.getElementsByTagNameNS(
|
|
2381
|
+
}, i = t.getElementsByTagNameNS(g.a, "custGeom")[0];
|
|
2382
2382
|
if (i) {
|
|
2383
2383
|
const a = Na(i);
|
|
2384
2384
|
a && (r.geometry = "custom", r.path = a);
|
|
@@ -2389,20 +2389,20 @@ function ai(t, e) {
|
|
|
2389
2389
|
return s !== void 0 && (r.border = s), r;
|
|
2390
2390
|
}
|
|
2391
2391
|
function ci(t, e) {
|
|
2392
|
-
const n = t.getElementsByTagNameNS(
|
|
2392
|
+
const n = t.getElementsByTagNameNS(g.a, "blip")[0];
|
|
2393
2393
|
if (!n) return null;
|
|
2394
|
-
const r = n.getAttributeNS(
|
|
2394
|
+
const r = n.getAttributeNS(g.r, "embed") ?? n.getAttribute("r:embed");
|
|
2395
2395
|
if (!r) return null;
|
|
2396
2396
|
const i = e.rels.get(r);
|
|
2397
2397
|
if (!i) return null;
|
|
2398
|
-
const o = fi(i), s = t.getElementsByTagNameNS(
|
|
2398
|
+
const o = fi(i), s = t.getElementsByTagNameNS(g.pic, "cNvPr")[0], a = s == null ? void 0 : s.getAttribute("descr"), c = { kind: "picture", partPath: o };
|
|
2399
2399
|
return a && (c.altText = a), c;
|
|
2400
2400
|
}
|
|
2401
2401
|
function Wa(t, e) {
|
|
2402
2402
|
if (e.parseBlockBody) return e.parseBlockBody(t);
|
|
2403
2403
|
const n = [];
|
|
2404
2404
|
for (const r of Array.from(t.children))
|
|
2405
|
-
if (r.namespaceURI ===
|
|
2405
|
+
if (r.namespaceURI === g.w && r.localName === "p") {
|
|
2406
2406
|
const i = (r.textContent ?? "").trim();
|
|
2407
2407
|
n.push({
|
|
2408
2408
|
kind: "paragraph",
|
|
@@ -2413,11 +2413,11 @@ function Wa(t, e) {
|
|
|
2413
2413
|
return n;
|
|
2414
2414
|
}
|
|
2415
2415
|
function Xa(t, e, n) {
|
|
2416
|
-
const r =
|
|
2416
|
+
const r = B(t, g.wp, "positionH"), i = B(t, g.wp, "positionV"), o = r ? li(r.getAttribute("relativeFrom")) : "page", s = i ? ui(i.getAttribute("relativeFrom")) : "page";
|
|
2417
2417
|
let a;
|
|
2418
2418
|
if (n.bodyParagraphIndexByElement) {
|
|
2419
2419
|
let l = e.parentElement;
|
|
2420
|
-
for (; l && !(l.namespaceURI ===
|
|
2420
|
+
for (; l && !(l.namespaceURI === g.w && l.localName === "p"); )
|
|
2421
2421
|
l = l.parentElement;
|
|
2422
2422
|
l && (a = n.bodyParagraphIndexByElement.get(l));
|
|
2423
2423
|
}
|
|
@@ -2429,7 +2429,7 @@ function Xa(t, e, n) {
|
|
|
2429
2429
|
return a !== void 0 && (c.paragraphIndex = a), c;
|
|
2430
2430
|
}
|
|
2431
2431
|
function Ya(t) {
|
|
2432
|
-
const e =
|
|
2432
|
+
const e = B(t, g.wp, "positionH"), n = B(t, g.wp, "positionV");
|
|
2433
2433
|
return {
|
|
2434
2434
|
x: On(e),
|
|
2435
2435
|
y: On(n)
|
|
@@ -2437,13 +2437,13 @@ function Ya(t) {
|
|
|
2437
2437
|
}
|
|
2438
2438
|
function On(t) {
|
|
2439
2439
|
if (!t) return 0;
|
|
2440
|
-
const e =
|
|
2440
|
+
const e = B(t, g.wp, "posOffset");
|
|
2441
2441
|
if (!e) return 0;
|
|
2442
2442
|
const n = Number(e.textContent ?? "0");
|
|
2443
2443
|
return Number.isFinite(n) ? n : 0;
|
|
2444
2444
|
}
|
|
2445
2445
|
function cn(t) {
|
|
2446
|
-
const e = Array.from(t.getElementsByTagNameNS(
|
|
2446
|
+
const e = Array.from(t.getElementsByTagNameNS(g.a, "xfrm"));
|
|
2447
2447
|
let n, r = Number.POSITIVE_INFINITY;
|
|
2448
2448
|
for (const a of e) {
|
|
2449
2449
|
let c = 0, l = a;
|
|
@@ -2452,11 +2452,11 @@ function cn(t) {
|
|
|
2452
2452
|
c < r && (r = c, n = a);
|
|
2453
2453
|
}
|
|
2454
2454
|
if (!n) return {};
|
|
2455
|
-
const i = n.getElementsByTagNameNS(
|
|
2455
|
+
const i = n.getElementsByTagNameNS(g.a, "off")[0], o = n.getElementsByTagNameNS(g.a, "ext")[0], s = {};
|
|
2456
2456
|
return i && (s.off = { x: W(i, "x"), y: W(i, "y") }), o && (s.ext = { cx: W(o, "cx"), cy: W(o, "cy") }), s;
|
|
2457
2457
|
}
|
|
2458
2458
|
function Va(t) {
|
|
2459
|
-
const e = t.getElementsByTagNameNS(
|
|
2459
|
+
const e = t.getElementsByTagNameNS(g.a, "prstGeom")[0];
|
|
2460
2460
|
switch (e == null ? void 0 : e.getAttribute("prst")) {
|
|
2461
2461
|
case "ellipse":
|
|
2462
2462
|
return "ellipse";
|
|
@@ -2470,21 +2470,21 @@ function Va(t) {
|
|
|
2470
2470
|
}
|
|
2471
2471
|
}
|
|
2472
2472
|
function $n(t, e) {
|
|
2473
|
-
const n =
|
|
2473
|
+
const n = B(t, g.wps, "spPr") ?? B(t, g.pic, "spPr");
|
|
2474
2474
|
if (n) {
|
|
2475
2475
|
for (const r of Array.from(n.children))
|
|
2476
|
-
if (r.namespaceURI ===
|
|
2476
|
+
if (r.namespaceURI === g.a && r.localName === "solidFill")
|
|
2477
2477
|
return wt(r, e);
|
|
2478
2478
|
}
|
|
2479
2479
|
}
|
|
2480
2480
|
function Hn(t, e) {
|
|
2481
|
-
const n =
|
|
2481
|
+
const n = B(t, g.wps, "spPr") ?? B(t, g.pic, "spPr");
|
|
2482
2482
|
if (!n) return;
|
|
2483
|
-
const r =
|
|
2483
|
+
const r = B(n, g.a, "ln");
|
|
2484
2484
|
if (!r) return;
|
|
2485
|
-
const i = W(r, "w"), o =
|
|
2485
|
+
const i = W(r, "w"), o = B(r, g.a, "solidFill"), s = o ? wt(o, e) : void 0;
|
|
2486
2486
|
if (!s) return;
|
|
2487
|
-
const a =
|
|
2487
|
+
const a = B(r, g.a, "prstDash"), c = Ga(a == null ? void 0 : a.getAttribute("val"));
|
|
2488
2488
|
return { color: s, widthEmu: i || 0, style: c };
|
|
2489
2489
|
}
|
|
2490
2490
|
function Ga(t) {
|
|
@@ -2524,7 +2524,7 @@ function W(t, e) {
|
|
|
2524
2524
|
const n = Number(t.getAttribute(e) ?? "0");
|
|
2525
2525
|
return Number.isFinite(n) ? n : 0;
|
|
2526
2526
|
}
|
|
2527
|
-
function
|
|
2527
|
+
function B(t, e, n) {
|
|
2528
2528
|
for (const r of Array.from(t.children))
|
|
2529
2529
|
if (r.namespaceURI === e && r.localName === n) return r;
|
|
2530
2530
|
return null;
|
|
@@ -2550,7 +2550,7 @@ const qa = {
|
|
|
2550
2550
|
dashDot: "dashed"
|
|
2551
2551
|
};
|
|
2552
2552
|
function Ye(t, e) {
|
|
2553
|
-
return t.getAttributeNS(
|
|
2553
|
+
return t.getAttributeNS(g.w, e) ?? t.getAttribute(`w:${e}`);
|
|
2554
2554
|
}
|
|
2555
2555
|
function di(t) {
|
|
2556
2556
|
const e = k(t, "pBdr");
|
|
@@ -2574,12 +2574,12 @@ function di(t) {
|
|
|
2574
2574
|
function Pt(t) {
|
|
2575
2575
|
const e = k(t, "br");
|
|
2576
2576
|
if (e) {
|
|
2577
|
-
const l = e.getAttributeNS(
|
|
2577
|
+
const l = e.getAttributeNS(g.w, "type") ?? e.getAttribute("w:type");
|
|
2578
2578
|
return { text: "", format: {}, isHardBreak: !0, breakType: l === "page" ? "page" : l === "column" ? "column" : "line" };
|
|
2579
2579
|
}
|
|
2580
2580
|
const n = k(t, "drawing");
|
|
2581
2581
|
if (n) {
|
|
2582
|
-
if (n.getElementsByTagNameNS(
|
|
2582
|
+
if (n.getElementsByTagNameNS(g.wp, "anchor")[0])
|
|
2583
2583
|
return { text: "", format: {}, isHardBreak: !1 };
|
|
2584
2584
|
const u = Za(n);
|
|
2585
2585
|
return { text: "", format: {}, isHardBreak: !1, drawing: u };
|
|
@@ -2591,25 +2591,25 @@ function Pt(t) {
|
|
|
2591
2591
|
}
|
|
2592
2592
|
const i = k(t, "footnoteReference");
|
|
2593
2593
|
if (i) {
|
|
2594
|
-
const l = i.getAttributeNS(
|
|
2594
|
+
const l = i.getAttributeNS(g.w, "id") ?? i.getAttribute("w:id"), u = Number(l);
|
|
2595
2595
|
if (Number.isFinite(u) && u >= 1)
|
|
2596
2596
|
return { text: "", format: {}, isHardBreak: !1, footnoteRefId: u };
|
|
2597
2597
|
}
|
|
2598
2598
|
const o = k(t, "commentReference");
|
|
2599
2599
|
if (o) {
|
|
2600
|
-
const l = o.getAttributeNS(
|
|
2600
|
+
const l = o.getAttributeNS(g.w, "id") ?? o.getAttribute("w:id"), u = Number(l);
|
|
2601
2601
|
if (Number.isFinite(u) && u >= 0)
|
|
2602
2602
|
return { text: "", format: {}, isHardBreak: !1, commentRefId: u };
|
|
2603
2603
|
}
|
|
2604
2604
|
let s = "";
|
|
2605
2605
|
for (const l of Array.from(t.children))
|
|
2606
|
-
l.namespaceURI ===
|
|
2606
|
+
l.namespaceURI === g.w && (l.localName === "t" || l.localName === "delText" ? s += l.textContent ?? "" : l.localName === "tab" && (s += " "));
|
|
2607
2607
|
s = Ka(s);
|
|
2608
2608
|
const a = k(t, "rPr"), c = a ? _n(a) : {};
|
|
2609
2609
|
if (a) {
|
|
2610
2610
|
const l = k(a, "rPrChange");
|
|
2611
2611
|
if (l) {
|
|
2612
|
-
const u = k(l, "rPr"), f = u ? _n(u) : {}, d = l.getAttributeNS(
|
|
2612
|
+
const u = k(l, "rPr"), f = u ? _n(u) : {}, d = l.getAttributeNS(g.w, "author") ?? l.getAttribute("w:author") ?? void 0, h = l.getAttributeNS(g.w, "date") ?? l.getAttribute("w:date") ?? void 0;
|
|
2613
2613
|
c.revisionFormat = {
|
|
2614
2614
|
before: f,
|
|
2615
2615
|
...d !== void 0 ? { author: d } : {},
|
|
@@ -2633,7 +2633,7 @@ function _n(t) {
|
|
|
2633
2633
|
s && s !== "none" && (e.highlight = s);
|
|
2634
2634
|
const a = k(t, "rFonts");
|
|
2635
2635
|
if (a) {
|
|
2636
|
-
const u = a.getAttributeNS(
|
|
2636
|
+
const u = a.getAttributeNS(g.w, "ascii") ?? a.getAttribute("w:ascii") ?? a.getAttributeNS(g.w, "hAnsi") ?? a.getAttribute("w:hAnsi");
|
|
2637
2637
|
u && (e.fontFamily = u);
|
|
2638
2638
|
}
|
|
2639
2639
|
const c = C(k(t, "sz"));
|
|
@@ -2647,7 +2647,7 @@ function _n(t) {
|
|
|
2647
2647
|
function Ja(t) {
|
|
2648
2648
|
const e = "urn:schemas-microsoft-com:vml", n = t.getElementsByTagNameNS(e, "imagedata")[0];
|
|
2649
2649
|
if (!n) return null;
|
|
2650
|
-
const r = n.getAttributeNS(
|
|
2650
|
+
const r = n.getAttributeNS(g.r, "id") ?? n.getAttribute("r:id");
|
|
2651
2651
|
if (!r) return null;
|
|
2652
2652
|
const i = { embedRelId: r }, o = t.getElementsByTagNameNS(e, "shape")[0], s = (o == null ? void 0 : o.getAttribute("style")) ?? "", a = zn(s.match(/width:\s*([\d.]+)([a-z%]*)/i)), c = zn(s.match(/height:\s*([\d.]+)([a-z%]*)/i));
|
|
2653
2653
|
return a > 0 && (i.widthEmu = Math.round(a * 12700)), c > 0 && (i.heightEmu = Math.round(c * 12700)), i;
|
|
@@ -2672,17 +2672,17 @@ function zn(t) {
|
|
|
2672
2672
|
}
|
|
2673
2673
|
}
|
|
2674
2674
|
function Za(t) {
|
|
2675
|
-
const e = {}, n = t.getElementsByTagNameNS(
|
|
2675
|
+
const e = {}, n = t.getElementsByTagNameNS(g.wp, "inline")[0], r = t.getElementsByTagNameNS(g.wp, "anchor")[0], i = n ?? r, o = t.getElementsByTagNameNS(g.a, "blip")[0];
|
|
2676
2676
|
if (o) {
|
|
2677
|
-
const c = o.getAttributeNS(
|
|
2677
|
+
const c = o.getAttributeNS(g.r, "embed") ?? o.getAttribute("r:embed");
|
|
2678
2678
|
c && (e.embedRelId = c);
|
|
2679
2679
|
}
|
|
2680
|
-
const s = i == null ? void 0 : i.getElementsByTagNameNS(
|
|
2680
|
+
const s = i == null ? void 0 : i.getElementsByTagNameNS(g.wp, "extent")[0];
|
|
2681
2681
|
if (s) {
|
|
2682
2682
|
const c = Number(s.getAttribute("cx")), l = Number(s.getAttribute("cy"));
|
|
2683
2683
|
Number.isFinite(c) && c > 0 && (e.widthEmu = c), Number.isFinite(l) && l > 0 && (e.heightEmu = l);
|
|
2684
2684
|
}
|
|
2685
|
-
const a = i == null ? void 0 : i.getElementsByTagNameNS(
|
|
2685
|
+
const a = i == null ? void 0 : i.getElementsByTagNameNS(g.wp, "docPr")[0];
|
|
2686
2686
|
if (a) {
|
|
2687
2687
|
const c = a.getAttribute("descr") ?? a.getAttribute("title");
|
|
2688
2688
|
c && (e.altText = c);
|
|
@@ -2690,7 +2690,7 @@ function Za(t) {
|
|
|
2690
2690
|
return r && (e.anchor = Qa(r)), e;
|
|
2691
2691
|
}
|
|
2692
2692
|
function Qa(t) {
|
|
2693
|
-
const e = t.getElementsByTagNameNS(
|
|
2693
|
+
const e = t.getElementsByTagNameNS(g.wp, "positionH")[0], n = t.getElementsByTagNameNS(g.wp, "positionV")[0], r = t.getAttribute("behindDoc") === "1", i = {
|
|
2694
2694
|
offsetXEmu: Un(e),
|
|
2695
2695
|
offsetYEmu: Un(n),
|
|
2696
2696
|
relativeFromH: ec((e == null ? void 0 : e.getAttribute("relativeFrom")) ?? "column"),
|
|
@@ -2700,7 +2700,7 @@ function Qa(t) {
|
|
|
2700
2700
|
}
|
|
2701
2701
|
function Un(t) {
|
|
2702
2702
|
if (!t) return 0;
|
|
2703
|
-
const e = t.getElementsByTagNameNS(
|
|
2703
|
+
const e = t.getElementsByTagNameNS(g.wp, "posOffset")[0];
|
|
2704
2704
|
if (!e) return 0;
|
|
2705
2705
|
const n = Number(e.textContent ?? "0");
|
|
2706
2706
|
return Number.isFinite(n) ? n : 0;
|
|
@@ -2743,11 +2743,11 @@ function Yt(t, e, n, r) {
|
|
|
2743
2743
|
i = "before", o = "", s = "", a = [];
|
|
2744
2744
|
};
|
|
2745
2745
|
for (const u of Array.from(t.children))
|
|
2746
|
-
if (u.namespaceURI ===
|
|
2746
|
+
if (u.namespaceURI === g.w) {
|
|
2747
2747
|
if (u.localName === "r") {
|
|
2748
2748
|
const f = k(u, "fldChar"), d = k(u, "instrText");
|
|
2749
2749
|
if (f) {
|
|
2750
|
-
const p = f.getAttributeNS(
|
|
2750
|
+
const p = f.getAttributeNS(g.w, "fldCharType") ?? f.getAttribute("w:fldCharType");
|
|
2751
2751
|
if (p === "begin") {
|
|
2752
2752
|
c(), i = "code";
|
|
2753
2753
|
continue;
|
|
@@ -2768,8 +2768,8 @@ function Yt(t, e, n, r) {
|
|
|
2768
2768
|
if (i === "result") {
|
|
2769
2769
|
const p = k(u, "t");
|
|
2770
2770
|
p && (s += p.textContent ?? "");
|
|
2771
|
-
const
|
|
2772
|
-
n && (
|
|
2771
|
+
const y = Pt(u);
|
|
2772
|
+
n && (y.revision = n), r.size > 0 && (y.commentIds = Array.from(r)), a.push(y);
|
|
2773
2773
|
continue;
|
|
2774
2774
|
}
|
|
2775
2775
|
if (i === "code")
|
|
@@ -2777,7 +2777,7 @@ function Yt(t, e, n, r) {
|
|
|
2777
2777
|
const h = Pt(u);
|
|
2778
2778
|
n && (h.revision = n), r.size > 0 && (h.commentIds = Array.from(r)), e.push({ kind: "run", run: h });
|
|
2779
2779
|
} else if (u.localName === "hyperlink") {
|
|
2780
|
-
const f = u.getAttributeNS(
|
|
2780
|
+
const f = u.getAttributeNS(g.r, "id") ?? u.getAttribute("r:id") ?? void 0, d = xe(u, "r").map((h) => {
|
|
2781
2781
|
const p = Pt(h);
|
|
2782
2782
|
return n && (p.revision = n), r.size > 0 && (p.commentIds = Array.from(r)), p;
|
|
2783
2783
|
});
|
|
@@ -2798,7 +2798,7 @@ function Yt(t, e, n, r) {
|
|
|
2798
2798
|
const f = jn(u);
|
|
2799
2799
|
f !== null && r.delete(f);
|
|
2800
2800
|
} else if (u.localName === "fldSimple") {
|
|
2801
|
-
const f = u.getAttributeNS(
|
|
2801
|
+
const f = u.getAttributeNS(g.w, "instr") ?? u.getAttribute("w:instr") ?? "", d = k(u, "r"), h = d ? ((l = k(d, "t")) == null ? void 0 : l.textContent) ?? "" : "", p = {
|
|
2802
2802
|
text: "",
|
|
2803
2803
|
format: {},
|
|
2804
2804
|
isHardBreak: !1,
|
|
@@ -2814,7 +2814,7 @@ function rc(t) {
|
|
|
2814
2814
|
return r != null && r[1] ? n != null && n[1] ? `${r[1]}#${n[1]}` : r[1] : n != null && n[1] ? `#${n[1]}` : null;
|
|
2815
2815
|
}
|
|
2816
2816
|
function jn(t) {
|
|
2817
|
-
const e = t.getAttributeNS(
|
|
2817
|
+
const e = t.getAttributeNS(g.w, "id") ?? t.getAttribute("w:id");
|
|
2818
2818
|
if (e === null) return null;
|
|
2819
2819
|
const n = Number(e);
|
|
2820
2820
|
return Number.isFinite(n) ? n : null;
|
|
@@ -2822,7 +2822,7 @@ function jn(t) {
|
|
|
2822
2822
|
function ic(t) {
|
|
2823
2823
|
const e = {}, n = k(t, "rFonts");
|
|
2824
2824
|
if (n) {
|
|
2825
|
-
const i = n.getAttributeNS(
|
|
2825
|
+
const i = n.getAttributeNS(g.w, "ascii") ?? n.getAttribute("w:ascii") ?? n.getAttributeNS(g.w, "hAnsi") ?? n.getAttribute("w:hAnsi");
|
|
2826
2826
|
i && (e.fontFamily = i);
|
|
2827
2827
|
}
|
|
2828
2828
|
const r = C(k(t, "sz"));
|
|
@@ -2833,9 +2833,9 @@ function ic(t) {
|
|
|
2833
2833
|
return e;
|
|
2834
2834
|
}
|
|
2835
2835
|
function oc(t) {
|
|
2836
|
-
const e = {}, n = t.getAttributeNS(
|
|
2836
|
+
const e = {}, n = t.getAttributeNS(g.w, "author") ?? t.getAttribute("w:author");
|
|
2837
2837
|
n && (e.author = n);
|
|
2838
|
-
const r = t.getAttributeNS(
|
|
2838
|
+
const r = t.getAttributeNS(g.w, "date") ?? t.getAttribute("w:date");
|
|
2839
2839
|
return r && (e.date = r), e;
|
|
2840
2840
|
}
|
|
2841
2841
|
function sc(t) {
|
|
@@ -2850,17 +2850,17 @@ function sc(t) {
|
|
|
2850
2850
|
if (i) {
|
|
2851
2851
|
const f = i.getAttributeNS(i.namespaceURI, "line") ?? i.getAttribute("w:line"), d = i.getAttributeNS(i.namespaceURI, "lineRule") ?? i.getAttribute("w:lineRule");
|
|
2852
2852
|
if (f && (!d || d === "auto")) {
|
|
2853
|
-
const
|
|
2854
|
-
Number.isFinite(
|
|
2853
|
+
const y = Number(f);
|
|
2854
|
+
Number.isFinite(y) && y > 0 && (e.lineHeight = ps(y));
|
|
2855
2855
|
}
|
|
2856
2856
|
const h = i.getAttributeNS(i.namespaceURI, "after") ?? i.getAttribute("w:after"), p = i.getAttributeNS(i.namespaceURI, "before") ?? i.getAttribute("w:before");
|
|
2857
2857
|
if (h !== null) {
|
|
2858
|
-
const
|
|
2859
|
-
Number.isFinite(
|
|
2858
|
+
const y = Number(h);
|
|
2859
|
+
Number.isFinite(y) && (e.spacingAfterTwips = y);
|
|
2860
2860
|
}
|
|
2861
2861
|
if (p !== null) {
|
|
2862
|
-
const
|
|
2863
|
-
Number.isFinite(
|
|
2862
|
+
const y = Number(p);
|
|
2863
|
+
Number.isFinite(y) && (e.spacingBeforeTwips = y);
|
|
2864
2864
|
}
|
|
2865
2865
|
}
|
|
2866
2866
|
const o = k(t, "numPr");
|
|
@@ -2873,30 +2873,30 @@ function sc(t) {
|
|
|
2873
2873
|
const f = [];
|
|
2874
2874
|
for (const d of Array.from(s.children)) {
|
|
2875
2875
|
if (d.namespaceURI !== s.namespaceURI || d.localName !== "tab") continue;
|
|
2876
|
-
const h = d.getAttributeNS(d.namespaceURI, "pos") ?? d.getAttribute("w:pos"), p = d.getAttributeNS(d.namespaceURI, "val") ?? d.getAttribute("w:val"),
|
|
2876
|
+
const h = d.getAttributeNS(d.namespaceURI, "pos") ?? d.getAttribute("w:pos"), p = d.getAttributeNS(d.namespaceURI, "val") ?? d.getAttribute("w:val"), y = d.getAttributeNS(d.namespaceURI, "leader") ?? d.getAttribute("w:leader");
|
|
2877
2877
|
if (h === null) continue;
|
|
2878
|
-
const
|
|
2879
|
-
Number.isFinite(
|
|
2880
|
-
positionTwips:
|
|
2878
|
+
const m = Number(h);
|
|
2879
|
+
Number.isFinite(m) && f.push({
|
|
2880
|
+
positionTwips: m,
|
|
2881
2881
|
alignment: p ?? "left",
|
|
2882
|
-
...
|
|
2882
|
+
...y ? { leader: y } : {}
|
|
2883
2883
|
});
|
|
2884
2884
|
}
|
|
2885
2885
|
f.length > 0 && (e.tabStops = f);
|
|
2886
2886
|
}
|
|
2887
2887
|
const a = k(t, "ind");
|
|
2888
2888
|
if (a) {
|
|
2889
|
-
const f = (
|
|
2890
|
-
const
|
|
2891
|
-
if (
|
|
2892
|
-
const x = Number(
|
|
2889
|
+
const f = (m) => {
|
|
2890
|
+
const v = a.getAttributeNS(a.namespaceURI, m) ?? a.getAttribute(`w:${m}`);
|
|
2891
|
+
if (v === null) return;
|
|
2892
|
+
const x = Number(v);
|
|
2893
2893
|
return Number.isFinite(x) ? x : void 0;
|
|
2894
|
-
}, d = f("left") ?? f("start"), h = f("right") ?? f("end"), p = f("firstLine"),
|
|
2895
|
-
(d !== void 0 || h !== void 0 || p !== void 0 ||
|
|
2894
|
+
}, d = f("left") ?? f("start"), h = f("right") ?? f("end"), p = f("firstLine"), y = f("hanging");
|
|
2895
|
+
(d !== void 0 || h !== void 0 || p !== void 0 || y !== void 0) && (e.indent = {
|
|
2896
2896
|
...d !== void 0 ? { leftTwips: d } : {},
|
|
2897
2897
|
...h !== void 0 ? { rightTwips: h } : {},
|
|
2898
2898
|
...p !== void 0 ? { firstLineTwips: p } : {},
|
|
2899
|
-
...
|
|
2899
|
+
...y !== void 0 ? { hangingTwips: y } : {}
|
|
2900
2900
|
});
|
|
2901
2901
|
}
|
|
2902
2902
|
const c = di(t);
|
|
@@ -2909,11 +2909,11 @@ function sc(t) {
|
|
|
2909
2909
|
(f.fontFamily || f.fontSizePt !== void 0) && (e.markFormat = f);
|
|
2910
2910
|
const d = k(u, "ins"), h = k(u, "del"), p = d ?? h;
|
|
2911
2911
|
if (p) {
|
|
2912
|
-
const
|
|
2912
|
+
const y = d ? "ins" : "del", m = p.getAttributeNS(p.namespaceURI, "author") ?? p.getAttribute("w:author") ?? void 0, v = p.getAttributeNS(p.namespaceURI, "date") ?? p.getAttribute("w:date") ?? void 0;
|
|
2913
2913
|
e.revision = {
|
|
2914
|
-
type:
|
|
2915
|
-
...
|
|
2916
|
-
...
|
|
2914
|
+
type: y,
|
|
2915
|
+
...m !== void 0 ? { author: m } : {},
|
|
2916
|
+
...v !== void 0 ? { date: v } : {}
|
|
2917
2917
|
};
|
|
2918
2918
|
}
|
|
2919
2919
|
}
|
|
@@ -3191,19 +3191,19 @@ function kc(t, e, n) {
|
|
|
3191
3191
|
}
|
|
3192
3192
|
const i = n ? vc(n) : /* @__PURE__ */ new Map(), o = {}, s = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
|
|
3193
3193
|
for (const c of te(r, "comment")) {
|
|
3194
|
-
const l = c.getAttributeNS(
|
|
3194
|
+
const l = c.getAttributeNS(g.w, "id") ?? c.getAttribute("w:id"), u = Number(l);
|
|
3195
3195
|
if (!Number.isFinite(u) || u < 0) continue;
|
|
3196
3196
|
const f = [];
|
|
3197
3197
|
let d = null;
|
|
3198
|
-
for (const
|
|
3199
|
-
|
|
3198
|
+
for (const m of Array.from(c.children))
|
|
3199
|
+
m.namespaceURI === g.w && (m.localName === "p" ? (d === null && (d = m.getAttributeNS(wc, "paraId") ?? m.getAttribute("w14:paraId")), f.push(De(m, e))) : m.localName === "tbl" && f.push(vt(m, e)));
|
|
3200
3200
|
d !== null && (s.set(d, u), a.set(u, d));
|
|
3201
|
-
const h = c.getAttributeNS(
|
|
3201
|
+
const h = c.getAttributeNS(g.w, "author") ?? c.getAttribute("w:author"), p = c.getAttributeNS(g.w, "initials") ?? c.getAttribute("w:initials"), y = c.getAttributeNS(g.w, "date") ?? c.getAttribute("w:date");
|
|
3202
3202
|
o[u] = {
|
|
3203
3203
|
id: u,
|
|
3204
3204
|
...h ? { author: h } : {},
|
|
3205
3205
|
...p ? { initials: p } : {},
|
|
3206
|
-
...
|
|
3206
|
+
...y ? { date: y } : {},
|
|
3207
3207
|
body: f
|
|
3208
3208
|
};
|
|
3209
3209
|
}
|
|
@@ -3326,8 +3326,9 @@ function Ac(t, e) {
|
|
|
3326
3326
|
const r = (n.pageMargins.leftTwips ?? 0) * It, i = (n.pageMargins.rightTwips ?? 0) * It, o = (n.pageSize.wTwips ?? 0) * It, a = (t.anchor.horizontalFrom === "page" ? 0 : r) + t.offsetXEmu + t.widthEmu / 2, c = r + (o - r - i) / 2;
|
|
3327
3327
|
return a >= c ? "floatRight" : "floatLeft";
|
|
3328
3328
|
}
|
|
3329
|
-
function Nc(t) {
|
|
3330
|
-
|
|
3329
|
+
function Nc(t, e) {
|
|
3330
|
+
var n, r;
|
|
3331
|
+
if (t.behindText || (((r = (n = e[t.anchor.sectionIndex]) == null ? void 0 : n.columns) == null ? void 0 : r.count) ?? 1) > 1 || t.anchor.horizontalFrom !== "column" || t.anchor.verticalFrom !== "paragraph" || t.anchor.paragraphIndex === void 0) return !1;
|
|
3331
3332
|
switch (t.wrap) {
|
|
3332
3333
|
case "square":
|
|
3333
3334
|
case "topAndBottom":
|
|
@@ -3409,29 +3410,29 @@ function Xn(t, e) {
|
|
|
3409
3410
|
const r = t[n], i = { ...r, runs: [...e, ...r.runs] }, o = t.slice();
|
|
3410
3411
|
return o[n] = i, o;
|
|
3411
3412
|
}
|
|
3412
|
-
function Bc(t, e) {
|
|
3413
|
-
const
|
|
3414
|
-
if (
|
|
3413
|
+
function Bc(t, e, n) {
|
|
3414
|
+
const r = e.filter((l) => Nc(l, n));
|
|
3415
|
+
if (r.length === 0)
|
|
3415
3416
|
return { body: t.slice(), frames: e.slice() };
|
|
3416
|
-
const
|
|
3417
|
-
for (const
|
|
3418
|
-
const
|
|
3419
|
-
|
|
3417
|
+
const i = /* @__PURE__ */ new Map();
|
|
3418
|
+
for (const l of r) {
|
|
3419
|
+
const u = l.anchor.paragraphIndex, f = i.get(u);
|
|
3420
|
+
f ? f.push(l) : i.set(u, [l]);
|
|
3420
3421
|
}
|
|
3421
|
-
const
|
|
3422
|
-
for (let
|
|
3423
|
-
|
|
3424
|
-
const
|
|
3425
|
-
if (
|
|
3426
|
-
for (const
|
|
3422
|
+
const o = [], s = /* @__PURE__ */ new Map();
|
|
3423
|
+
for (let l = 0; l < t.length; l++) {
|
|
3424
|
+
s.set(l, o.length), o.push(t[l]);
|
|
3425
|
+
const u = i.get(l);
|
|
3426
|
+
if (u)
|
|
3427
|
+
for (const f of u) o.push(...Ic(f));
|
|
3427
3428
|
}
|
|
3428
|
-
const
|
|
3429
|
-
for (const
|
|
3430
|
-
if (
|
|
3431
|
-
const
|
|
3432
|
-
|
|
3429
|
+
const a = new Set(r.map((l) => l.id)), c = [];
|
|
3430
|
+
for (const l of e) {
|
|
3431
|
+
if (a.has(l.id)) continue;
|
|
3432
|
+
const u = l.anchor.paragraphIndex, f = u !== void 0 ? s.get(u) : void 0;
|
|
3433
|
+
f !== void 0 && f !== u ? c.push({ ...l, anchor: { ...l.anchor, paragraphIndex: f } }) : c.push(l);
|
|
3433
3434
|
}
|
|
3434
|
-
return { body:
|
|
3435
|
+
return { body: o, frames: c };
|
|
3435
3436
|
}
|
|
3436
3437
|
function Lc(t, e) {
|
|
3437
3438
|
if (!t) return {};
|
|
@@ -3443,13 +3444,13 @@ function Lc(t, e) {
|
|
|
3443
3444
|
}
|
|
3444
3445
|
const r = {};
|
|
3445
3446
|
for (const i of te(n, "footnote")) {
|
|
3446
|
-
const o = i.getAttributeNS(
|
|
3447
|
+
const o = i.getAttributeNS(g.w, "type") ?? i.getAttribute("w:type");
|
|
3447
3448
|
if (o === "separator" || o === "continuationSeparator") continue;
|
|
3448
|
-
const s = i.getAttributeNS(
|
|
3449
|
+
const s = i.getAttributeNS(g.w, "id") ?? i.getAttribute("w:id"), a = Number(s);
|
|
3449
3450
|
if (!Number.isFinite(a) || a < 1) continue;
|
|
3450
3451
|
const c = [];
|
|
3451
3452
|
for (const l of Array.from(i.children))
|
|
3452
|
-
l.namespaceURI ===
|
|
3453
|
+
l.namespaceURI === g.w && (l.localName === "p" ? c.push(De(l, e)) : l.localName === "tbl" && c.push(vt(l, e)));
|
|
3453
3454
|
r[a] = c;
|
|
3454
3455
|
}
|
|
3455
3456
|
return r;
|
|
@@ -3464,13 +3465,13 @@ function Vt(t) {
|
|
|
3464
3465
|
}
|
|
3465
3466
|
function H(t, e) {
|
|
3466
3467
|
if (!t) return null;
|
|
3467
|
-
const n = t.getAttributeNS(
|
|
3468
|
+
const n = t.getAttributeNS(g.w, e) ?? t.getAttribute(`w:${e}`);
|
|
3468
3469
|
if (!n) return null;
|
|
3469
3470
|
const r = Number(n);
|
|
3470
3471
|
return Number.isFinite(r) ? r : null;
|
|
3471
3472
|
}
|
|
3472
3473
|
function Mc(t, e) {
|
|
3473
|
-
const n = k(t, "pgSz"), r = k(t, "pgMar"), i = C(k(t, "vAlign")), o = C(k(t, "type")), s = (n == null ? void 0 : n.getAttributeNS(
|
|
3474
|
+
const n = k(t, "pgSz"), r = k(t, "pgMar"), i = C(k(t, "vAlign")), o = C(k(t, "type")), s = (n == null ? void 0 : n.getAttributeNS(g.w, "orient")) ?? (n == null ? void 0 : n.getAttribute("w:orient")) ?? null, a = H(n, "w") ?? 11906, c = H(n, "h") ?? 16838, l = {
|
|
3474
3475
|
pageSize: {
|
|
3475
3476
|
wTwips: a,
|
|
3476
3477
|
hTwips: c,
|
|
@@ -3495,18 +3496,18 @@ function Mc(t, e) {
|
|
|
3495
3496
|
if (f > 1) {
|
|
3496
3497
|
const d = { count: f }, h = H(u, "space");
|
|
3497
3498
|
h !== null && h > 0 && (d.spaceTwips = h);
|
|
3498
|
-
const p = u.getAttributeNS(
|
|
3499
|
+
const p = u.getAttributeNS(g.w, "equalWidth") ?? u.getAttribute("w:equalWidth");
|
|
3499
3500
|
if (p === "0" || p === "false") {
|
|
3500
|
-
const
|
|
3501
|
-
for (const
|
|
3502
|
-
const x = H(
|
|
3501
|
+
const y = xe(u, "col"), m = [];
|
|
3502
|
+
for (const v of y) {
|
|
3503
|
+
const x = H(v, "w");
|
|
3503
3504
|
if (x === null || x <= 0) continue;
|
|
3504
|
-
const
|
|
3505
|
-
|
|
3506
|
-
|
|
3505
|
+
const S = H(v, "space");
|
|
3506
|
+
m.push(
|
|
3507
|
+
S !== null && S > 0 ? { widthTwips: x, spaceTwips: S } : { widthTwips: x }
|
|
3507
3508
|
);
|
|
3508
3509
|
}
|
|
3509
|
-
|
|
3510
|
+
m.length === f && (d.equalWidth = !1, d.columns = m);
|
|
3510
3511
|
}
|
|
3511
3512
|
l.columns = d;
|
|
3512
3513
|
}
|
|
@@ -3516,7 +3517,7 @@ function Mc(t, e) {
|
|
|
3516
3517
|
function Yn(t, e, n) {
|
|
3517
3518
|
const r = [];
|
|
3518
3519
|
for (const i of xe(t, e)) {
|
|
3519
|
-
const o = i.getAttributeNS(
|
|
3520
|
+
const o = i.getAttributeNS(g.w, "type") ?? i.getAttribute("w:type") ?? "default", s = i.getAttributeNS(g.r, "id") ?? i.getAttribute("r:id");
|
|
3520
3521
|
if (!s) continue;
|
|
3521
3522
|
const a = n.get(s);
|
|
3522
3523
|
a && (o === "default" || o === "first" || o === "even") && r.push({ type: o, partId: a.replace(/^word\//, "") });
|
|
@@ -3525,24 +3526,24 @@ function Yn(t, e, n) {
|
|
|
3525
3526
|
}
|
|
3526
3527
|
function Dc(t, e, n = !0) {
|
|
3527
3528
|
var o;
|
|
3528
|
-
const r = [], i = Array.from(t.getElementsByTagNameNS(
|
|
3529
|
+
const r = [], i = Array.from(t.getElementsByTagNameNS(g.w, "drawing"));
|
|
3529
3530
|
for (const s of i) {
|
|
3530
|
-
const a =
|
|
3531
|
+
const a = R(s, g.wp, "inline");
|
|
3531
3532
|
if (!a) continue;
|
|
3532
|
-
const c = ce(a,
|
|
3533
|
+
const c = ce(a, g.a, "graphicData");
|
|
3533
3534
|
if (!c) continue;
|
|
3534
|
-
const l = Uc(s,
|
|
3535
|
+
const l = Uc(s, g.w, "p");
|
|
3535
3536
|
if (!l) continue;
|
|
3536
|
-
const u =
|
|
3537
|
+
const u = R(c, g.wpg, "wgp");
|
|
3537
3538
|
if (u) {
|
|
3538
|
-
if (!zc(u,
|
|
3539
|
+
if (!zc(u, g.wps, "wsp").some((y) => R(y, g.wps, "txbx") !== null)) continue;
|
|
3539
3540
|
const p = Oc(u, l, e);
|
|
3540
3541
|
if (!p) continue;
|
|
3541
3542
|
r.push({ frame: p, drawingEl: s, hostParagraphEl: l });
|
|
3542
3543
|
continue;
|
|
3543
3544
|
}
|
|
3544
|
-
const f =
|
|
3545
|
-
if (f &&
|
|
3545
|
+
const f = R(c, g.wps, "wsp");
|
|
3546
|
+
if (f && R(f, g.wps, "txbx") === null) {
|
|
3546
3547
|
const d = $c(a, f, l, e);
|
|
3547
3548
|
d && r.push({ frame: d, drawingEl: s, hostParagraphEl: l });
|
|
3548
3549
|
}
|
|
@@ -3553,81 +3554,81 @@ function Dc(t, e, n = !0) {
|
|
|
3553
3554
|
return r;
|
|
3554
3555
|
}
|
|
3555
3556
|
function Oc(t, e, n, r) {
|
|
3556
|
-
const i =
|
|
3557
|
+
const i = R(t, g.wpg, "grpSpPr"), o = i ? ce(i, g.a, "xfrm") : void 0, s = o ? ce(o, g.a, "chExt") : void 0, a = o ? ce(o, g.a, "ext") : void 0, c = s ? { wEmu: _(s, "cx"), hEmu: _(s, "cy") } : { wEmu: _(a, "cx"), hEmu: _(a, "cy") }, l = a ? { wEmu: _(a, "cx"), hEmu: _(a, "cy") } : c;
|
|
3557
3558
|
if (c.wEmu <= 0 || c.hEmu <= 0) return null;
|
|
3558
|
-
const u =
|
|
3559
|
-
let f = u ?
|
|
3560
|
-
const d = u ?
|
|
3559
|
+
const u = R(e, g.w, "pPr");
|
|
3560
|
+
let f = u ? R(u, g.w, "pageBreakBefore") !== null : !1;
|
|
3561
|
+
const d = u ? R(u, g.w, "keepNext") !== null : !1;
|
|
3561
3562
|
!f && n.honorLastRenderedPageBreaks && _c(e) && (f = !0);
|
|
3562
|
-
const h = [], p = [],
|
|
3563
|
-
for (const
|
|
3564
|
-
if (
|
|
3565
|
-
|
|
3566
|
-
else if (
|
|
3567
|
-
const E =
|
|
3563
|
+
const h = [], p = [], y = [], m = (x) => {
|
|
3564
|
+
for (const S of Array.from(x.children))
|
|
3565
|
+
if (S.namespaceURI === g.wpg && S.localName === "grpSp")
|
|
3566
|
+
m(S);
|
|
3567
|
+
else if (S.namespaceURI === g.wps && S.localName === "wsp") {
|
|
3568
|
+
const E = R(S, g.wps, "txbx");
|
|
3568
3569
|
if (E) {
|
|
3569
|
-
const
|
|
3570
|
-
if (!
|
|
3571
|
-
const { off:
|
|
3572
|
-
offsetEmu: { xEmu:
|
|
3573
|
-
sizeEmu: { wEmu:
|
|
3574
|
-
body: n.parseBlockBody(
|
|
3575
|
-
}, M = Gt(
|
|
3576
|
-
M !== void 0 && (
|
|
3577
|
-
const L = qt(
|
|
3578
|
-
L !== void 0 && (
|
|
3579
|
-
const D =
|
|
3570
|
+
const I = R(E, g.w, "txbxContent");
|
|
3571
|
+
if (!I) continue;
|
|
3572
|
+
const { off: N, ext: A } = rt(S), F = {
|
|
3573
|
+
offsetEmu: { xEmu: N.x, yEmu: N.y },
|
|
3574
|
+
sizeEmu: { wEmu: A.cx, hEmu: A.cy },
|
|
3575
|
+
body: n.parseBlockBody(I)
|
|
3576
|
+
}, M = Gt(S, n.theme);
|
|
3577
|
+
M !== void 0 && (F.fill = M);
|
|
3578
|
+
const L = qt(S, n.theme);
|
|
3579
|
+
L !== void 0 && (F.border = L);
|
|
3580
|
+
const D = R(S, g.wps, "bodyPr");
|
|
3580
3581
|
if (D) {
|
|
3581
|
-
|
|
3582
|
+
F.padding = {
|
|
3582
3583
|
leftEmu: qe(D, "lIns", 91440),
|
|
3583
3584
|
topEmu: qe(D, "tIns", 45720),
|
|
3584
3585
|
rightEmu: qe(D, "rIns", 91440),
|
|
3585
3586
|
bottomEmu: qe(D, "bIns", 45720)
|
|
3586
3587
|
};
|
|
3587
3588
|
const K = D.getAttribute("anchor");
|
|
3588
|
-
K === "ctr" ?
|
|
3589
|
+
K === "ctr" ? F.vAlign = "center" : K === "b" ? F.vAlign = "bottom" : F.vAlign = "top";
|
|
3589
3590
|
}
|
|
3590
|
-
h.push(
|
|
3591
|
+
h.push(F);
|
|
3591
3592
|
} else {
|
|
3592
|
-
const { off:
|
|
3593
|
-
if (
|
|
3594
|
-
const
|
|
3595
|
-
geometry:
|
|
3596
|
-
offsetEmu: { xEmu:
|
|
3597
|
-
sizeEmu: { wEmu:
|
|
3593
|
+
const { off: I, ext: N } = rt(S);
|
|
3594
|
+
if (N.cx <= 0 || N.cy <= 0) continue;
|
|
3595
|
+
const A = xi(S), F = Gt(S, n.theme), M = qt(S, n.theme), L = {
|
|
3596
|
+
geometry: A,
|
|
3597
|
+
offsetEmu: { xEmu: I.x, yEmu: I.y },
|
|
3598
|
+
sizeEmu: { wEmu: N.cx, hEmu: N.cy }
|
|
3598
3599
|
};
|
|
3599
|
-
|
|
3600
|
+
F !== void 0 && (L.fill = F), M !== void 0 && (L.border = M), y.push(L);
|
|
3600
3601
|
}
|
|
3601
|
-
} else if (
|
|
3602
|
-
const E =
|
|
3602
|
+
} else if (S.namespaceURI === g.pic && S.localName === "pic") {
|
|
3603
|
+
const E = S.getElementsByTagNameNS(g.a, "blip")[0];
|
|
3603
3604
|
if (!E) continue;
|
|
3604
|
-
const
|
|
3605
|
-
if (!A) continue;
|
|
3606
|
-
const I = n.rels.get(A);
|
|
3605
|
+
const I = E.getAttributeNS(g.r, "embed") ?? E.getAttribute("r:embed");
|
|
3607
3606
|
if (!I) continue;
|
|
3608
|
-
const
|
|
3607
|
+
const N = n.rels.get(I);
|
|
3608
|
+
if (!N) continue;
|
|
3609
|
+
const A = jc(N), { off: F, ext: M } = rt(S);
|
|
3609
3610
|
if (M.cx <= 0 || M.cy <= 0) continue;
|
|
3610
|
-
const L =
|
|
3611
|
-
partPath:
|
|
3612
|
-
offsetEmu: { xEmu:
|
|
3611
|
+
const L = S.getElementsByTagNameNS(g.pic, "cNvPr")[0], D = L == null ? void 0 : L.getAttribute("descr"), K = {
|
|
3612
|
+
partPath: A,
|
|
3613
|
+
offsetEmu: { xEmu: F.x, yEmu: F.y },
|
|
3613
3614
|
sizeEmu: { wEmu: M.cx, hEmu: M.cy }
|
|
3614
3615
|
};
|
|
3615
3616
|
D && (K.altText = D), p.push(K);
|
|
3616
3617
|
}
|
|
3617
3618
|
};
|
|
3618
|
-
|
|
3619
|
-
const
|
|
3619
|
+
m(t);
|
|
3620
|
+
const v = {
|
|
3620
3621
|
kind: "inline_frame",
|
|
3621
3622
|
groupExtentEmu: c,
|
|
3622
3623
|
sizeEmu: l,
|
|
3623
3624
|
textboxes: h,
|
|
3624
3625
|
pictures: p,
|
|
3625
|
-
shapes:
|
|
3626
|
+
shapes: y
|
|
3626
3627
|
};
|
|
3627
|
-
return f && (
|
|
3628
|
+
return f && (v.pageBreakBefore = !0), d && (v.keepNext = !0), v;
|
|
3628
3629
|
}
|
|
3629
3630
|
function $c(t, e, n, r) {
|
|
3630
|
-
const i =
|
|
3631
|
+
const i = R(t, g.wp, "extent"), o = _(i, "cx"), s = _(i, "cy");
|
|
3631
3632
|
if (o <= 0 || s <= 0) return null;
|
|
3632
3633
|
const { off: a, ext: c } = rt(e), l = {
|
|
3633
3634
|
geometry: xi(e),
|
|
@@ -3637,7 +3638,7 @@ function $c(t, e, n, r) {
|
|
|
3637
3638
|
u !== void 0 && (l.fill = u);
|
|
3638
3639
|
const f = qt(e, r.theme);
|
|
3639
3640
|
f !== void 0 && (l.border = f);
|
|
3640
|
-
const d =
|
|
3641
|
+
const d = R(n, g.w, "pPr"), h = {
|
|
3641
3642
|
kind: "inline_frame",
|
|
3642
3643
|
groupExtentEmu: { wEmu: o, hEmu: s },
|
|
3643
3644
|
sizeEmu: { wEmu: o, hEmu: s },
|
|
@@ -3645,21 +3646,21 @@ function $c(t, e, n, r) {
|
|
|
3645
3646
|
pictures: [],
|
|
3646
3647
|
shapes: [l]
|
|
3647
3648
|
};
|
|
3648
|
-
return d &&
|
|
3649
|
+
return d && R(d, g.w, "pageBreakBefore") !== null && (h.pageBreakBefore = !0), d && R(d, g.w, "keepNext") !== null && (h.keepNext = !0), h;
|
|
3649
3650
|
}
|
|
3650
3651
|
function rt(t) {
|
|
3651
|
-
const e =
|
|
3652
|
+
const e = R(t, g.wps, "spPr") ?? R(t, g.pic, "spPr");
|
|
3652
3653
|
if (!e) return { off: { x: 0, y: 0 }, ext: { cx: 0, cy: 0 } };
|
|
3653
|
-
const n = ce(e,
|
|
3654
|
+
const n = ce(e, g.a, "xfrm");
|
|
3654
3655
|
if (!n) return { off: { x: 0, y: 0 }, ext: { cx: 0, cy: 0 } };
|
|
3655
|
-
const r = ce(n,
|
|
3656
|
+
const r = ce(n, g.a, "off"), i = ce(n, g.a, "ext");
|
|
3656
3657
|
return {
|
|
3657
3658
|
off: r ? { x: _(r, "x"), y: _(r, "y") } : { x: 0, y: 0 },
|
|
3658
3659
|
ext: i ? { cx: _(i, "cx"), cy: _(i, "cy") } : { cx: 0, cy: 0 }
|
|
3659
3660
|
};
|
|
3660
3661
|
}
|
|
3661
3662
|
function xi(t) {
|
|
3662
|
-
const e = t.getElementsByTagNameNS(
|
|
3663
|
+
const e = t.getElementsByTagNameNS(g.a, "prstGeom")[0];
|
|
3663
3664
|
switch (e == null ? void 0 : e.getAttribute("prst")) {
|
|
3664
3665
|
case "ellipse":
|
|
3665
3666
|
return "ellipse";
|
|
@@ -3673,21 +3674,21 @@ function xi(t) {
|
|
|
3673
3674
|
}
|
|
3674
3675
|
}
|
|
3675
3676
|
function Gt(t, e) {
|
|
3676
|
-
const n =
|
|
3677
|
+
const n = R(t, g.wps, "spPr") ?? R(t, g.pic, "spPr");
|
|
3677
3678
|
if (n) {
|
|
3678
3679
|
for (const r of Array.from(n.children))
|
|
3679
|
-
if (r.namespaceURI ===
|
|
3680
|
+
if (r.namespaceURI === g.a && r.localName === "solidFill")
|
|
3680
3681
|
return wt(r, e);
|
|
3681
3682
|
}
|
|
3682
3683
|
}
|
|
3683
3684
|
function qt(t, e) {
|
|
3684
|
-
const n =
|
|
3685
|
+
const n = R(t, g.wps, "spPr") ?? R(t, g.pic, "spPr");
|
|
3685
3686
|
if (!n) return;
|
|
3686
|
-
const r =
|
|
3687
|
+
const r = R(n, g.a, "ln");
|
|
3687
3688
|
if (!r) return;
|
|
3688
|
-
const i = _(r, "w"), o =
|
|
3689
|
+
const i = _(r, "w"), o = R(r, g.a, "solidFill"), s = o ? wt(o, e) : void 0;
|
|
3689
3690
|
if (!s) return;
|
|
3690
|
-
const a =
|
|
3691
|
+
const a = R(r, g.a, "prstDash"), c = Hc(a == null ? void 0 : a.getAttribute("val"));
|
|
3691
3692
|
return { color: s, widthEmu: i || 0, style: c };
|
|
3692
3693
|
}
|
|
3693
3694
|
function Hc(t) {
|
|
@@ -3709,7 +3710,7 @@ function _c(t) {
|
|
|
3709
3710
|
const n = e.pop();
|
|
3710
3711
|
for (const r of Array.from(n.children))
|
|
3711
3712
|
if (r.localName !== "txbxContent") {
|
|
3712
|
-
if (r.localName === "lastRenderedPageBreak" && r.namespaceURI ===
|
|
3713
|
+
if (r.localName === "lastRenderedPageBreak" && r.namespaceURI === g.w)
|
|
3713
3714
|
return !0;
|
|
3714
3715
|
e.push(r);
|
|
3715
3716
|
}
|
|
@@ -3727,7 +3728,7 @@ function qe(t, e, n) {
|
|
|
3727
3728
|
const i = Number(r);
|
|
3728
3729
|
return Number.isFinite(i) ? i : n;
|
|
3729
3730
|
}
|
|
3730
|
-
function
|
|
3731
|
+
function R(t, e, n) {
|
|
3731
3732
|
for (const r of Array.from(t.children))
|
|
3732
3733
|
if (r.namespaceURI === e && r.localName === n) return r;
|
|
3733
3734
|
return null;
|
|
@@ -3762,7 +3763,7 @@ function Wc(t) {
|
|
|
3762
3763
|
}
|
|
3763
3764
|
const n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map();
|
|
3764
3765
|
for (const a of te(e, "abstractNum")) {
|
|
3765
|
-
const c = a.getAttributeNS(
|
|
3766
|
+
const c = a.getAttributeNS(g.w, "abstractNumId") ?? a.getAttribute("w:abstractNumId");
|
|
3766
3767
|
if (!c) continue;
|
|
3767
3768
|
const l = Number.parseInt(c, 10);
|
|
3768
3769
|
if (!Number.isFinite(l)) continue;
|
|
@@ -3780,7 +3781,7 @@ function Wc(t) {
|
|
|
3780
3781
|
}
|
|
3781
3782
|
const s = [];
|
|
3782
3783
|
for (const a of te(e, "num")) {
|
|
3783
|
-
const c = a.getAttributeNS(
|
|
3784
|
+
const c = a.getAttributeNS(g.w, "numId") ?? a.getAttribute("w:numId");
|
|
3784
3785
|
if (!c) continue;
|
|
3785
3786
|
const l = Number.parseInt(c, 10);
|
|
3786
3787
|
if (!Number.isFinite(l)) continue;
|
|
@@ -3794,7 +3795,7 @@ function Wc(t) {
|
|
|
3794
3795
|
function Xc(t) {
|
|
3795
3796
|
const e = [];
|
|
3796
3797
|
for (const n of te(t, "lvl")) {
|
|
3797
|
-
const r = n.getAttributeNS(
|
|
3798
|
+
const r = n.getAttributeNS(g.w, "ilvl") ?? n.getAttribute("w:ilvl");
|
|
3798
3799
|
if (!r) continue;
|
|
3799
3800
|
const i = Number.parseInt(r, 10);
|
|
3800
3801
|
if (!Number.isFinite(i)) continue;
|
|
@@ -3802,22 +3803,22 @@ function Xc(t) {
|
|
|
3802
3803
|
let s = C(k(n, "lvlText")) ?? "";
|
|
3803
3804
|
const a = C(k(n, "lvlRestart")), c = a ? Number.parseInt(a, 10) : void 0, l = k(n, "pPr"), u = l ? Yc(l) : void 0, f = k(n, "rPr"), d = f ? k(f, "rFonts") : null, h = (d == null ? void 0 : d.getAttribute("w:ascii")) ?? (d == null ? void 0 : d.getAttribute("w:hAnsi")) ?? "", p = h.toLowerCase().includes("wingdings") || h.toLowerCase().includes("symbol");
|
|
3804
3805
|
p && (s = Vc(s, h));
|
|
3805
|
-
const
|
|
3806
|
+
const y = {};
|
|
3806
3807
|
if (f) {
|
|
3807
|
-
const
|
|
3808
|
-
|
|
3808
|
+
const v = C(k(f, "color"));
|
|
3809
|
+
v && v !== "auto" && /^[0-9A-Fa-f]{6}$/.test(v) && (y.color = `#${v.toUpperCase()}`), h && !p && (y.fontFamily = h);
|
|
3809
3810
|
const x = C(k(f, "sz"));
|
|
3810
3811
|
if (x) {
|
|
3811
|
-
const
|
|
3812
|
-
Number.isFinite(
|
|
3812
|
+
const S = Number.parseInt(x, 10);
|
|
3813
|
+
Number.isFinite(S) && S > 0 && (y.fontSizePt = S / 2);
|
|
3813
3814
|
}
|
|
3814
3815
|
}
|
|
3815
|
-
const
|
|
3816
|
+
const m = {
|
|
3816
3817
|
level: i,
|
|
3817
3818
|
format: o ?? "decimal",
|
|
3818
3819
|
text: s
|
|
3819
3820
|
};
|
|
3820
|
-
c !== void 0 && Number.isFinite(c) && (
|
|
3821
|
+
c !== void 0 && Number.isFinite(c) && (m.restart = c), u && (m.paragraphIndent = u), Object.keys(y).length > 0 && (m.runDefaults = y), e.push(m);
|
|
3821
3822
|
}
|
|
3822
3823
|
return e;
|
|
3823
3824
|
}
|
|
@@ -3834,7 +3835,7 @@ function Yc(t) {
|
|
|
3834
3835
|
return s !== null && (n.hangingTwips = s), Object.keys(n).length > 0 ? n : void 0;
|
|
3835
3836
|
}
|
|
3836
3837
|
function Ke(t, e) {
|
|
3837
|
-
const n = t.getAttributeNS(
|
|
3838
|
+
const n = t.getAttributeNS(g.w, e) ?? t.getAttribute(`w:${e}`);
|
|
3838
3839
|
if (n === null) return null;
|
|
3839
3840
|
const r = Number.parseInt(n, 10);
|
|
3840
3841
|
return Number.isFinite(r) ? r : null;
|
|
@@ -3876,8 +3877,8 @@ function Gc(t) {
|
|
|
3876
3877
|
return e;
|
|
3877
3878
|
}
|
|
3878
3879
|
for (const i of te(n, "compatSetting")) {
|
|
3879
|
-
if ((i.getAttributeNS(
|
|
3880
|
-
const s = i.getAttributeNS(
|
|
3880
|
+
if ((i.getAttributeNS(g.w, "name") ?? i.getAttribute("w:name")) !== "compatibilityMode") continue;
|
|
3881
|
+
const s = i.getAttributeNS(g.w, "val") ?? i.getAttribute("w:val");
|
|
3881
3882
|
if (s) {
|
|
3882
3883
|
const a = Number.parseInt(s, 10);
|
|
3883
3884
|
Number.isFinite(a) && (e.compatibilityMode = a);
|
|
@@ -3886,7 +3887,7 @@ function Gc(t) {
|
|
|
3886
3887
|
if (e.compatibilityMode === void 0) {
|
|
3887
3888
|
const i = k(n, "compatibilityMode");
|
|
3888
3889
|
if (i) {
|
|
3889
|
-
const o = i.getAttributeNS(
|
|
3890
|
+
const o = i.getAttributeNS(g.w, "val") ?? i.getAttribute("w:val");
|
|
3890
3891
|
if (o) {
|
|
3891
3892
|
const s = Number.parseInt(o, 10);
|
|
3892
3893
|
Number.isFinite(s) && (e.compatibilityMode = s);
|
|
@@ -3896,7 +3897,7 @@ function Gc(t) {
|
|
|
3896
3897
|
k(n, "doNotUseHTMLParagraphAutoSpacing") && (e.doNotUseHTMLParagraphAutoSpacing = !0);
|
|
3897
3898
|
const r = k(n, "defaultTabStop");
|
|
3898
3899
|
if (r) {
|
|
3899
|
-
const i = r.getAttributeNS(
|
|
3900
|
+
const i = r.getAttributeNS(g.w, "val") ?? r.getAttribute("w:val");
|
|
3900
3901
|
if (i) {
|
|
3901
3902
|
const o = Number.parseInt(i, 10);
|
|
3902
3903
|
Number.isFinite(o) && o > 0 && (e.defaultTabStopTwips = o);
|
|
@@ -4057,20 +4058,20 @@ function il(t, e = { doNotUseHTMLParagraphAutoSpacing: !1 }) {
|
|
|
4057
4058
|
});
|
|
4058
4059
|
}
|
|
4059
4060
|
for (const o of te(n, "style")) {
|
|
4060
|
-
const s = o.getAttributeNS(
|
|
4061
|
+
const s = o.getAttributeNS(g.w, "styleId") ?? o.getAttribute("w:styleId");
|
|
4061
4062
|
if (!s) continue;
|
|
4062
|
-
const a = Rt(s), c = o.getAttributeNS(
|
|
4063
|
+
const a = Rt(s), c = o.getAttributeNS(g.w, "type") ?? o.getAttribute("w:type"), l = sl(c);
|
|
4063
4064
|
if (!l) continue;
|
|
4064
|
-
const u = C(k(o, "name")) ?? s, f = C(k(o, "basedOn")), d = C(k(o, "next")), h = k(o, "rPr"), p = k(o, "pPr"),
|
|
4065
|
+
const u = C(k(o, "name")) ?? s, f = C(k(o, "basedOn")), d = C(k(o, "next")), h = k(o, "rPr"), p = k(o, "pPr"), y = h ? Gn(h) : void 0, m = p ? qn(p) : void 0, v = p ? al(p) : void 0, x = l === "table" ? tl(o) : null;
|
|
4065
4066
|
r.push({
|
|
4066
4067
|
id: a,
|
|
4067
4068
|
type: l,
|
|
4068
4069
|
displayName: u,
|
|
4069
4070
|
...f ? { basedOn: Rt(f) } : {},
|
|
4070
4071
|
...d ? { nextStyleId: Rt(d) } : {},
|
|
4071
|
-
...
|
|
4072
|
-
...
|
|
4073
|
-
...
|
|
4072
|
+
...y ? { runDefaults: y } : {},
|
|
4073
|
+
...m ? { paragraphDefaults: m } : {},
|
|
4074
|
+
...v ? { numbering: v } : {},
|
|
4074
4075
|
...x ? { tableStyle: x } : {}
|
|
4075
4076
|
});
|
|
4076
4077
|
}
|
|
@@ -4082,10 +4083,10 @@ function il(t, e = { doNotUseHTMLParagraphAutoSpacing: !1 }) {
|
|
|
4082
4083
|
function ol(t, e, n) {
|
|
4083
4084
|
let r;
|
|
4084
4085
|
for (const l of te(e, "style")) {
|
|
4085
|
-
if ((l.getAttributeNS(
|
|
4086
|
-
const f = l.getAttributeNS(
|
|
4086
|
+
if ((l.getAttributeNS(g.w, "type") ?? l.getAttribute("w:type")) !== "paragraph") continue;
|
|
4087
|
+
const f = l.getAttributeNS(g.w, "default") ?? l.getAttribute("w:default");
|
|
4087
4088
|
if (f === "1" || f === "true") {
|
|
4088
|
-
r = l.getAttributeNS(
|
|
4089
|
+
r = l.getAttributeNS(g.w, "styleId") ?? l.getAttribute("w:styleId") ?? void 0;
|
|
4089
4090
|
break;
|
|
4090
4091
|
}
|
|
4091
4092
|
}
|
|
@@ -4148,7 +4149,7 @@ function sl(t) {
|
|
|
4148
4149
|
function Gn(t) {
|
|
4149
4150
|
const e = {}, n = k(t, "rFonts");
|
|
4150
4151
|
if (n) {
|
|
4151
|
-
const a = n.getAttributeNS(
|
|
4152
|
+
const a = n.getAttributeNS(g.w, "ascii") ?? n.getAttribute("w:ascii");
|
|
4152
4153
|
a && (e.fontFamily = a);
|
|
4153
4154
|
}
|
|
4154
4155
|
const r = C(k(t, "sz"));
|
|
@@ -4175,7 +4176,7 @@ function qn(t) {
|
|
|
4175
4176
|
if (i) {
|
|
4176
4177
|
const c = {}, l = J(i, "line");
|
|
4177
4178
|
l !== null && (c.line = l);
|
|
4178
|
-
const u = i.getAttributeNS(
|
|
4179
|
+
const u = i.getAttributeNS(g.w, "lineRule") ?? i.getAttribute("w:lineRule");
|
|
4179
4180
|
(u === "auto" || u === "exact" || u === "atLeast") && (c.lineRule = u);
|
|
4180
4181
|
const f = J(i, "before");
|
|
4181
4182
|
f !== null && (c.beforeTwips = f);
|
|
@@ -4228,7 +4229,7 @@ function Je(t) {
|
|
|
4228
4229
|
return e === null || e === "1" || e === "true";
|
|
4229
4230
|
}
|
|
4230
4231
|
function J(t, e) {
|
|
4231
|
-
const n = t.getAttributeNS(
|
|
4232
|
+
const n = t.getAttributeNS(g.w, e) ?? t.getAttribute(`w:${e}`);
|
|
4232
4233
|
if (n === null) return null;
|
|
4233
4234
|
const r = Number.parseInt(n, 10);
|
|
4234
4235
|
return Number.isFinite(r) ? r : null;
|
|
@@ -4269,24 +4270,25 @@ async function dl(t) {
|
|
|
4269
4270
|
for (const { hostParagraphEl: j, frame: _e } of d)
|
|
4270
4271
|
_e.hostProps = De(j, { rels: o }).properties, p.set(j, _e);
|
|
4271
4272
|
const {
|
|
4272
|
-
body:
|
|
4273
|
-
warnings:
|
|
4274
|
-
sectPrEls:
|
|
4273
|
+
body: y,
|
|
4274
|
+
warnings: m,
|
|
4275
|
+
sectPrEls: v
|
|
4275
4276
|
} = xc(
|
|
4276
4277
|
r,
|
|
4277
4278
|
{ rels: o },
|
|
4278
4279
|
{
|
|
4279
4280
|
replaceParagraphs: p
|
|
4280
4281
|
}
|
|
4281
|
-
), { body:
|
|
4282
|
-
|
|
4283
|
-
c
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
E
|
|
4288
|
-
), { bodies: F, frames: B } = hl(
|
|
4282
|
+
), x = v.map((j) => Mc(j, o)), { body: S, frames: E } = Bc(
|
|
4283
|
+
y,
|
|
4284
|
+
c,
|
|
4285
|
+
x
|
|
4286
|
+
), { body: I, frames: N } = Ec(
|
|
4287
|
+
S,
|
|
4289
4288
|
E,
|
|
4289
|
+
x
|
|
4290
|
+
), { bodies: A, frames: F } = hl(
|
|
4291
|
+
x,
|
|
4290
4292
|
e.text,
|
|
4291
4293
|
o,
|
|
4292
4294
|
s
|
|
@@ -4298,9 +4300,9 @@ async function dl(t) {
|
|
|
4298
4300
|
{ rels: o },
|
|
4299
4301
|
e.text["word/commentsExtended.xml"]
|
|
4300
4302
|
), Ct = {
|
|
4301
|
-
body:
|
|
4302
|
-
sections:
|
|
4303
|
-
headerFooterBodies:
|
|
4303
|
+
body: I,
|
|
4304
|
+
sections: x.length > 0 ? x : [ml()],
|
|
4305
|
+
headerFooterBodies: A,
|
|
4304
4306
|
styles: K ?? sn(),
|
|
4305
4307
|
// Parse the docx's numbering definitions so the renderer can apply
|
|
4306
4308
|
// per-level indentation (matches Word's ruler markers). Without
|
|
@@ -4314,11 +4316,11 @@ async function dl(t) {
|
|
|
4314
4316
|
// the renderer can apply per-document tab geometry instead of
|
|
4315
4317
|
// falling back to CSS's 8-char default.
|
|
4316
4318
|
...D.defaultTabStopTwips !== void 0 ? { settings: { defaultTabStopTwips: D.defaultTabStopTwips } } : {},
|
|
4317
|
-
...
|
|
4318
|
-
...Object.keys(
|
|
4319
|
+
...N.length > 0 ? { anchoredFrames: N } : {},
|
|
4320
|
+
...Object.keys(F).length > 0 ? { headerFooterFrames: F } : {},
|
|
4319
4321
|
...h.length > 0 ? { inlineFrames: h } : {}
|
|
4320
4322
|
};
|
|
4321
|
-
return Ct.body.length === 0 && Ct.body.push({ kind: "paragraph", properties: {}, runs: [] }), { document: Ct, warnings:
|
|
4323
|
+
return Ct.body.length === 0 && Ct.body.push({ kind: "paragraph", properties: {}, runs: [] }), { document: Ct, warnings: m };
|
|
4322
4324
|
}
|
|
4323
4325
|
function hl(t, e, n, r) {
|
|
4324
4326
|
const i = {}, o = {}, s = /* @__PURE__ */ new Set();
|
|
@@ -4333,12 +4335,12 @@ function hl(t, e, n, r) {
|
|
|
4333
4335
|
const f = e[`word/_rels/${c.partId}.rels`], d = f ? pl(Vt(f), n) : n, h = u.documentElement, p = ii(u, {
|
|
4334
4336
|
rels: d,
|
|
4335
4337
|
bodyParagraphIndexByElement: Ti(h),
|
|
4336
|
-
parseBlockBody: (
|
|
4338
|
+
parseBlockBody: (m) => Be(m, { rels: d }).body,
|
|
4337
4339
|
...r ? { theme: r } : {}
|
|
4338
4340
|
});
|
|
4339
4341
|
p.push(...oi(u, { rels: d })), p.length > 0 && (o[c.partId] = p);
|
|
4340
|
-
const { body:
|
|
4341
|
-
i[c.partId] =
|
|
4342
|
+
const { body: y } = Be(h, { rels: d });
|
|
4343
|
+
i[c.partId] = y;
|
|
4342
4344
|
}
|
|
4343
4345
|
return { bodies: i, frames: o };
|
|
4344
4346
|
}
|
|
@@ -4713,7 +4715,7 @@ class Pi {
|
|
|
4713
4715
|
}
|
|
4714
4716
|
}
|
|
4715
4717
|
}
|
|
4716
|
-
const un = "body", fn = "meta", xt = "parts", Ii = "partRefs", ee = "id", ke = "kind", ie = "text", ft = "props", le = "_ast",
|
|
4718
|
+
const un = "body", fn = "meta", xt = "parts", Ii = "partRefs", ee = "id", ke = "kind", ie = "text", ft = "props", le = "_ast", P = {
|
|
4717
4719
|
sections: "sections",
|
|
4718
4720
|
headerFooterBodies: "headerFooterBodies",
|
|
4719
4721
|
// Floating layer (absolute-positioned drawings). Persisted alongside the
|
|
@@ -4874,7 +4876,7 @@ function Li(t, e, n) {
|
|
|
4874
4876
|
s.length > 0 && r.insert(0, s);
|
|
4875
4877
|
for (let a = 0; a < e.body.length; a++)
|
|
4876
4878
|
Di(s[a], e.body[a]);
|
|
4877
|
-
i.set(
|
|
4879
|
+
i.set(P.sections, JSON.stringify(e.sections)), i.set(P.headerFooterBodies, JSON.stringify(e.headerFooterBodies)), i.set(P.anchoredFrames, JSON.stringify(e.anchoredFrames ?? [])), i.set(P.headerFooterFrames, JSON.stringify(e.headerFooterFrames ?? {})), i.set(P.footnotes, JSON.stringify(e.footnotes ?? {})), i.set(P.comments, JSON.stringify(e.comments ?? {})), i.set(P.settings, JSON.stringify(e.settings ?? {})), i.set(P.styles, JSON.stringify(e.styles)), i.set(P.numbering, JSON.stringify(e.numbering)), i.set(P.fonts, JSON.stringify(e.fonts));
|
|
4878
4880
|
for (const [a, c] of Object.entries(e.rawParts))
|
|
4879
4881
|
o.set(a, c);
|
|
4880
4882
|
},
|
|
@@ -4898,25 +4900,25 @@ function Oi(t, e) {
|
|
|
4898
4900
|
}
|
|
4899
4901
|
function dt(t) {
|
|
4900
4902
|
const e = t.getArray(un), n = t.getMap(fn), r = t.getMap(xt), i = t.getMap(Ii), o = [], s = [];
|
|
4901
|
-
e.forEach((
|
|
4902
|
-
const E =
|
|
4903
|
-
|
|
4903
|
+
e.forEach((S) => {
|
|
4904
|
+
const E = S.get(ee) ?? "", I = Al(S);
|
|
4905
|
+
I && (o.push(I), s.push(E));
|
|
4904
4906
|
});
|
|
4905
|
-
const a = V(n,
|
|
4907
|
+
const a = V(n, P.sections, []), c = V(
|
|
4906
4908
|
n,
|
|
4907
|
-
|
|
4909
|
+
P.headerFooterBodies,
|
|
4908
4910
|
{}
|
|
4909
|
-
), l = V(n,
|
|
4911
|
+
), l = V(n, P.anchoredFrames, []), u = V(
|
|
4910
4912
|
n,
|
|
4911
|
-
|
|
4913
|
+
P.headerFooterFrames,
|
|
4912
4914
|
{}
|
|
4913
|
-
), f = V(n,
|
|
4914
|
-
r.forEach((
|
|
4915
|
-
|
|
4915
|
+
), f = V(n, P.footnotes, {}), d = V(n, P.comments, {}), h = V(n, P.settings, {}), p = V(n, P.styles, []), y = V(n, P.numbering, []), m = V(n, P.fonts, []), v = {};
|
|
4916
|
+
r.forEach((S, E) => {
|
|
4917
|
+
v[E] = S;
|
|
4916
4918
|
});
|
|
4917
4919
|
const x = {};
|
|
4918
|
-
return i.forEach((
|
|
4919
|
-
x[E] =
|
|
4920
|
+
return i.forEach((S, E) => {
|
|
4921
|
+
x[E] = S;
|
|
4920
4922
|
}), {
|
|
4921
4923
|
doc: {
|
|
4922
4924
|
body: o,
|
|
@@ -4930,9 +4932,9 @@ function dt(t) {
|
|
|
4930
4932
|
...Object.keys(d).length > 0 ? { comments: d } : {},
|
|
4931
4933
|
...h.defaultTabStopTwips !== void 0 ? { settings: h } : {},
|
|
4932
4934
|
styles: p,
|
|
4933
|
-
numbering:
|
|
4934
|
-
rawParts:
|
|
4935
|
-
fonts:
|
|
4935
|
+
numbering: y,
|
|
4936
|
+
rawParts: v,
|
|
4937
|
+
fonts: m
|
|
4936
4938
|
},
|
|
4937
4939
|
ids: s,
|
|
4938
4940
|
partRefs: x
|
|
@@ -5139,11 +5141,11 @@ function $l(t, e, n) {
|
|
|
5139
5141
|
return -1;
|
|
5140
5142
|
}
|
|
5141
5143
|
function Hl(t, e) {
|
|
5142
|
-
G(t,
|
|
5144
|
+
G(t, P.sections, JSON.stringify(e.sections)), G(t, P.headerFooterBodies, JSON.stringify(e.headerFooterBodies)), G(t, P.anchoredFrames, JSON.stringify(e.anchoredFrames ?? [])), G(
|
|
5143
5145
|
t,
|
|
5144
|
-
|
|
5146
|
+
P.headerFooterFrames,
|
|
5145
5147
|
JSON.stringify(e.headerFooterFrames ?? {})
|
|
5146
|
-
), G(t,
|
|
5148
|
+
), G(t, P.footnotes, JSON.stringify(e.footnotes ?? {})), G(t, P.comments, JSON.stringify(e.comments ?? {})), G(t, P.settings, JSON.stringify(e.settings ?? {})), G(t, P.styles, JSON.stringify(e.styles)), G(t, P.numbering, JSON.stringify(e.numbering)), G(t, P.fonts, JSON.stringify(e.fonts));
|
|
5147
5149
|
}
|
|
5148
5150
|
function G(t, e, n) {
|
|
5149
5151
|
t.get(e) !== n && t.set(e, n);
|
|
@@ -5940,7 +5942,7 @@ function qi(t) {
|
|
|
5940
5942
|
return t / Vi * Gi;
|
|
5941
5943
|
}
|
|
5942
5944
|
function pn(t, e, n = []) {
|
|
5943
|
-
var l, u, f, d, h, p,
|
|
5945
|
+
var l, u, f, d, h, p, y, m, v;
|
|
5944
5946
|
const r = e.styleId ?? "Normal", { runDefaults: i, paragraphDefaults: o } = n.length > 0 ? Si(n, r) : { runDefaults: {}, paragraphDefaults: {} }, s = yu(o, e), a = { ...i, ...e.runDefaults ?? {} };
|
|
5945
5947
|
if (a.fontFamily) {
|
|
5946
5948
|
const x = $e(a.fontFamily);
|
|
@@ -5956,15 +5958,15 @@ function pn(t, e, n = []) {
|
|
|
5956
5958
|
else (u = s.spacing) != null && u.line && s.spacing.lineRule === "exact" && (t.style.lineHeight = `${s.spacing.line / 20}pt`);
|
|
5957
5959
|
((f = s.spacing) == null ? void 0 : f.beforeTwips) !== void 0 && (t.style.marginTop = `${O(s.spacing.beforeTwips)}mm`), ((d = s.spacing) == null ? void 0 : d.afterTwips) !== void 0 && (t.style.marginBottom = `${O(s.spacing.afterTwips)}mm`);
|
|
5958
5960
|
const c = t.tagName === "LI";
|
|
5959
|
-
if (((h = s.indent) == null ? void 0 : h.leftTwips) !== void 0 && !c && (t.style.marginLeft = `${O(s.indent.leftTwips)}mm`), ((p = s.indent) == null ? void 0 : p.rightTwips) !== void 0 && (t.style.marginRight = `${O(s.indent.rightTwips)}mm`), c || (((
|
|
5961
|
+
if (((h = s.indent) == null ? void 0 : h.leftTwips) !== void 0 && !c && (t.style.marginLeft = `${O(s.indent.leftTwips)}mm`), ((p = s.indent) == null ? void 0 : p.rightTwips) !== void 0 && (t.style.marginRight = `${O(s.indent.rightTwips)}mm`), c || (((y = s.indent) == null ? void 0 : y.firstLineTwips) !== void 0 ? t.style.textIndent = `${O(s.indent.firstLineTwips)}mm` : ((m = s.indent) == null ? void 0 : m.hangingTwips) !== void 0 && (t.style.textIndent = `-${O(s.indent.hangingTwips)}mm`)), s.borders)
|
|
5960
5962
|
for (const x of ["top", "bottom", "left", "right"]) {
|
|
5961
|
-
const
|
|
5962
|
-
if (!
|
|
5963
|
-
const E = Math.max(1, Math.round(
|
|
5964
|
-
t.style[`border${x[0].toUpperCase() + x.slice(1)}`] = `${E}px ${ku(
|
|
5963
|
+
const S = s.borders[x];
|
|
5964
|
+
if (!S || S.style === "none") continue;
|
|
5965
|
+
const E = Math.max(1, Math.round(S.sizeEighthsOfPt / 8 * (96 / 72)));
|
|
5966
|
+
t.style[`border${x[0].toUpperCase() + x.slice(1)}`] = `${E}px ${ku(S.style)} ${vu(S.color)}`;
|
|
5965
5967
|
}
|
|
5966
|
-
if ((
|
|
5967
|
-
const x = Math.min(...s.tabStops.map((
|
|
5968
|
+
if ((v = s.shading) != null && v.fill && s.shading.fill !== "#auto" && (t.style.backgroundColor = s.shading.fill), s.pageBreakBefore && t.setAttribute("data-page-break-before", ""), s.keepNext && t.setAttribute("data-keep-next", ""), s.tabStops && s.tabStops.length > 0) {
|
|
5969
|
+
const x = Math.min(...s.tabStops.map((S) => S.positionTwips));
|
|
5968
5970
|
x > 0 && (t.style.setProperty("tab-size", `${O(x)}mm`), t.style.setProperty("-moz-tab-size", `${O(x)}mm`));
|
|
5969
5971
|
}
|
|
5970
5972
|
}
|
|
@@ -5992,14 +5994,14 @@ function xu(t, e, n, r, i) {
|
|
|
5992
5994
|
const s = t.groupExtentEmu.wEmu, a = t.groupExtentEmu.hEmu, c = (p) => s > 0 ? p / s * 100 : 0, l = (p) => a > 0 ? p / a * 100 : 0, u = t.textboxes.length > 1 || t.textboxes.length === 1 && t.pictures.length === 0 && t.shapes.length === 0;
|
|
5993
5995
|
if (!u)
|
|
5994
5996
|
for (const p of t.pictures) {
|
|
5995
|
-
const
|
|
5996
|
-
if (!
|
|
5997
|
-
const
|
|
5998
|
-
|
|
5997
|
+
const y = Yi(p.partPath, r);
|
|
5998
|
+
if (!y) continue;
|
|
5999
|
+
const m = document.createElement("img");
|
|
6000
|
+
m.src = y, m.alt = p.altText ?? "", m.style.position = "absolute", m.style.left = `${c(p.offsetEmu.xEmu)}%`, m.style.top = `${l(p.offsetEmu.yEmu)}%`, m.style.width = `${c(p.sizeEmu.wEmu)}%`, m.style.height = `${l(p.sizeEmu.hEmu)}%`, m.style.objectFit = "fill", o.appendChild(m);
|
|
5999
6001
|
}
|
|
6000
6002
|
for (const p of t.shapes) {
|
|
6001
|
-
const
|
|
6002
|
-
|
|
6003
|
+
const y = document.createElement("div");
|
|
6004
|
+
y.style.position = "absolute", y.style.left = `${c(p.offsetEmu.xEmu)}%`, y.style.top = `${l(p.offsetEmu.yEmu)}%`, y.style.width = `${c(p.sizeEmu.wEmu)}%`, y.style.height = `${l(p.sizeEmu.hEmu)}%`, p.fill && (y.style.background = p.fill), p.geometry === "ellipse" ? y.style.borderRadius = "50%" : p.geometry === "roundedRect" && (y.style.borderRadius = "8px"), o.appendChild(y);
|
|
6003
6005
|
}
|
|
6004
6006
|
const f = t.groupExtentEmu.wEmu > 0 ? t.sizeEmu.wEmu / t.groupExtentEmu.wEmu : 1, d = t.groupExtentEmu.hEmu > 0 ? t.sizeEmu.hEmu / t.groupExtentEmu.hEmu : 1, h = u ? t.pictures.map(
|
|
6005
6007
|
(p) => ({
|
|
@@ -6013,14 +6015,14 @@ function xu(t, e, n, r, i) {
|
|
|
6013
6015
|
...p.altText !== void 0 ? { altText: p.altText } : {}
|
|
6014
6016
|
})
|
|
6015
6017
|
) : [];
|
|
6016
|
-
return t.textboxes.forEach((p,
|
|
6017
|
-
const
|
|
6018
|
-
if (
|
|
6019
|
-
const
|
|
6020
|
-
|
|
6021
|
-
}
|
|
6022
|
-
const
|
|
6023
|
-
i(x,
|
|
6018
|
+
return t.textboxes.forEach((p, y) => {
|
|
6019
|
+
const m = document.createElement("div");
|
|
6020
|
+
if (m.style.position = "absolute", m.style.left = `${c(p.offsetEmu.xEmu)}%`, m.style.top = `${l(p.offsetEmu.yEmu)}%`, m.style.width = `${c(p.sizeEmu.wEmu)}%`, m.style.height = `${l(p.sizeEmu.hEmu)}%`, m.style.overflow = u ? "visible" : "hidden", m.style.boxSizing = "border-box", m.style.display = "flex", m.style.flexDirection = "column", m.style.justifyContent = p.vAlign === "center" ? "center" : p.vAlign === "bottom" ? "flex-end" : "flex-start", p.fill && (m.style.background = p.fill), p.padding) {
|
|
6021
|
+
const S = p.padding;
|
|
6022
|
+
m.style.padding = `${z(S.topEmu)}mm ${z(S.rightEmu)}mm ${z(S.bottomEmu)}mm ${z(S.leftEmu)}mm`;
|
|
6023
|
+
}
|
|
6024
|
+
const v = u ? Su(p.body) : p.body, x = y === 0 && h.length > 0 ? Eu(v, h) : v;
|
|
6025
|
+
i(x, m, e, n, r), o.appendChild(m);
|
|
6024
6026
|
}), o;
|
|
6025
6027
|
}
|
|
6026
6028
|
function Su(t) {
|
|
@@ -6286,12 +6288,12 @@ function Wu(t, e, n) {
|
|
|
6286
6288
|
t.shading && i.push({ shading: t.shading });
|
|
6287
6289
|
const o = n.rowCount - 1, s = n.colCount - 1, a = e.firstRow === !0 && n.rowIndex === 0, c = e.lastRow === !0 && n.rowIndex === o, l = e.firstColumn === !0 && n.colIndex === 0, u = e.lastColumn === !0 && n.colIndex === s;
|
|
6288
6290
|
if (e.vBand && !l && !u) {
|
|
6289
|
-
const p = e.firstColumn ? 1 : 0,
|
|
6290
|
-
|
|
6291
|
+
const p = e.firstColumn ? 1 : 0, y = e.lastColumn ? s - 1 : s, m = ur(n.colIndex, p, y, t.colBandSize ?? 1);
|
|
6292
|
+
m && i.push(r[m === 1 ? "band1Vert" : "band2Vert"]);
|
|
6291
6293
|
}
|
|
6292
6294
|
if (e.hBand && !a && !c) {
|
|
6293
|
-
const p = e.firstRow ? 1 : 0,
|
|
6294
|
-
|
|
6295
|
+
const p = e.firstRow ? 1 : 0, y = e.lastRow ? o - 1 : o, m = ur(n.rowIndex, p, y, t.rowBandSize ?? 1);
|
|
6296
|
+
m && i.push(r[m === 1 ? "band1Horz" : "band2Horz"]);
|
|
6295
6297
|
}
|
|
6296
6298
|
l && i.push(r.firstCol), u && i.push(r.lastCol), a && i.push(r.firstRow), c && i.push(r.lastRow), a && l && i.push(r.nwCell), a && u && i.push(r.neCell), c && l && i.push(r.swCell), c && u && i.push(r.seCell);
|
|
6297
6299
|
let f, d;
|
|
@@ -6348,7 +6350,7 @@ function fr(t, e, n, r, i, o, s, a, c) {
|
|
|
6348
6350
|
colIndex: u,
|
|
6349
6351
|
rowCount: i.rowCount,
|
|
6350
6352
|
colCount: i.colCount
|
|
6351
|
-
}, p = r.get(`${e}:${u}`) ?? 1,
|
|
6353
|
+
}, p = r.get(`${e}:${u}`) ?? 1, y = Yu(
|
|
6352
6354
|
f,
|
|
6353
6355
|
n,
|
|
6354
6356
|
i,
|
|
@@ -6359,7 +6361,7 @@ function fr(t, e, n, r, i, o, s, a, c) {
|
|
|
6359
6361
|
a,
|
|
6360
6362
|
c
|
|
6361
6363
|
);
|
|
6362
|
-
d > 1 &&
|
|
6364
|
+
d > 1 && y.setAttribute("colspan", String(d)), p > 1 && y.setAttribute("rowspan", String(p)), l.appendChild(y), u += d;
|
|
6363
6365
|
}
|
|
6364
6366
|
return l;
|
|
6365
6367
|
}
|
|
@@ -6473,45 +6475,50 @@ function nf(t) {
|
|
|
6473
6475
|
}
|
|
6474
6476
|
return e;
|
|
6475
6477
|
}
|
|
6476
|
-
function ve(t, e, n, r = [], i = {}, o, s = []) {
|
|
6477
|
-
const
|
|
6478
|
-
let
|
|
6479
|
-
const
|
|
6480
|
-
if (
|
|
6481
|
-
for (const
|
|
6482
|
-
if (
|
|
6478
|
+
function ve(t, e, n, r = [], i = {}, o, s = [], a = /* @__PURE__ */ new Set()) {
|
|
6479
|
+
const c = Ru(t, r, n);
|
|
6480
|
+
let l = null, u = 0, f = cr(e, s[0], 0), d = !1;
|
|
6481
|
+
const h = (m) => {
|
|
6482
|
+
if (m.kind === "section_break" || m.kind === "table" || m.kind !== "paragraph") return !1;
|
|
6483
|
+
for (const v of m.runs)
|
|
6484
|
+
if (v.kind === "text" && v.text.trim().length > 0 || v.kind === "drawing" || v.kind === "tab" || v.kind === "field" || v.kind === "hyperlink" || v.kind === "footnoteRef") return !1;
|
|
6483
6485
|
return !0;
|
|
6484
|
-
},
|
|
6485
|
-
|
|
6486
|
+
}, p = (m) => m.kind === "paragraph" && m.runs.some((v) => v.kind === "break" && v.type === "page"), y = () => {
|
|
6487
|
+
l = null;
|
|
6486
6488
|
};
|
|
6487
|
-
for (let
|
|
6488
|
-
|
|
6489
|
-
if (!
|
|
6490
|
-
const
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6489
|
+
for (let m = 0; m < t.length; m++) {
|
|
6490
|
+
let v = t[m];
|
|
6491
|
+
if (!v) continue;
|
|
6492
|
+
const x = o == null ? void 0 : o[m];
|
|
6493
|
+
let S = !1;
|
|
6494
|
+
v.kind === "paragraph" && h(v) && (v.properties.pageBreakBefore || p(v)) && (d = !0, S = !0, v = {
|
|
6495
|
+
...v,
|
|
6496
|
+
properties: { ...v.properties, pageBreakBefore: !1 },
|
|
6497
|
+
runs: v.runs.filter((A) => !(A.kind === "break" && A.type === "page"))
|
|
6498
|
+
}), d && !S && (!h(v) || a.has(m)) && (v.kind === "paragraph" && (v = { ...v, properties: { ...v.properties, pageBreakBefore: !0 } }), d = !1);
|
|
6499
|
+
const E = Cu(v, n);
|
|
6500
|
+
if (E) {
|
|
6501
|
+
if (!l || l.numId !== E.numId) {
|
|
6502
|
+
const F = Au(E, u);
|
|
6503
|
+
f.appendChild(F), l = { el: F, numId: E.numId };
|
|
6497
6504
|
}
|
|
6498
|
-
const
|
|
6499
|
-
|
|
6505
|
+
const A = document.createElement("li");
|
|
6506
|
+
x && (A.dataset.blockId = x), A.dataset.sectionIndex = String(u), A.dataset.blockIndex = String(m), pn(A, v.properties, r), Nu(A, v, n), dr(A, v.properties), Ie(A, v.runs, i, r), l.el.appendChild(A);
|
|
6500
6507
|
continue;
|
|
6501
6508
|
}
|
|
6502
|
-
|
|
6503
|
-
const
|
|
6504
|
-
if (
|
|
6505
|
-
if (
|
|
6506
|
-
dr(
|
|
6507
|
-
const
|
|
6508
|
-
|
|
6509
|
+
y();
|
|
6510
|
+
const I = v.kind === "section_break" ? s[v.toSectionIndex] : void 0, N = rf(v, n, r, i, I);
|
|
6511
|
+
if (N) {
|
|
6512
|
+
if (x && (N.dataset.blockId = x), N.dataset.sectionIndex = String(u), N.dataset.blockIndex = String(m), v.kind === "paragraph") {
|
|
6513
|
+
dr(N, v.properties);
|
|
6514
|
+
const A = c.get(m);
|
|
6515
|
+
A && (N.dataset.outlineNumber = A);
|
|
6509
6516
|
}
|
|
6510
|
-
|
|
6517
|
+
v.kind === "section_break" ? (lr(f, e), e.appendChild(N)) : f.appendChild(N);
|
|
6511
6518
|
}
|
|
6512
|
-
|
|
6519
|
+
v.kind === "section_break" && (zu(e), u += 1, f = cr(e, s[u], u));
|
|
6513
6520
|
}
|
|
6514
|
-
lr(
|
|
6521
|
+
lr(f, e);
|
|
6515
6522
|
}
|
|
6516
6523
|
function rf(t, e, n, r, i) {
|
|
6517
6524
|
return t.kind === "paragraph" ? Du(t, n, r) : t.kind === "table" ? Xu(t, ve, e, n, r) : t.kind === "section_break" ? of(i) : t.kind === "inline_frame" ? xu(t, e, n, r, ve) : null;
|
|
@@ -6531,8 +6538,21 @@ function dr(t, e) {
|
|
|
6531
6538
|
n && (t.dataset.blockRevision = n.type, n.author !== void 0 && (t.dataset.blockRevisionAuthor = n.author), n.date !== void 0 && (t.dataset.blockRevisionDate = n.date));
|
|
6532
6539
|
}
|
|
6533
6540
|
function Re(t, e, n) {
|
|
6534
|
-
var
|
|
6535
|
-
e.replaceChildren(), sf(e, ((
|
|
6541
|
+
var i;
|
|
6542
|
+
e.replaceChildren(), sf(e, ((i = t.settings) == null ? void 0 : i.defaultTabStopTwips) ?? 720);
|
|
6543
|
+
const r = /* @__PURE__ */ new Set();
|
|
6544
|
+
for (const o of t.anchoredFrames ?? [])
|
|
6545
|
+
o.anchor.paragraphIndex !== void 0 && r.add(o.anchor.paragraphIndex);
|
|
6546
|
+
ve(
|
|
6547
|
+
t.body,
|
|
6548
|
+
e,
|
|
6549
|
+
t.numbering,
|
|
6550
|
+
t.styles,
|
|
6551
|
+
t.rawParts,
|
|
6552
|
+
n,
|
|
6553
|
+
t.sections,
|
|
6554
|
+
r
|
|
6555
|
+
), t.footnotes && Object.keys(t.footnotes).length > 0 && af(t, e);
|
|
6536
6556
|
}
|
|
6537
6557
|
function sf(t, e) {
|
|
6538
6558
|
const n = e / 1440 * 25.4;
|
|
@@ -8283,12 +8303,12 @@ function uo(t, e, n) {
|
|
|
8283
8303
|
let h = d;
|
|
8284
8304
|
const p = d.kind === "text" ? d.properties.revision : void 0;
|
|
8285
8305
|
if (p && (n === void 0 || p.author === n)) {
|
|
8286
|
-
const
|
|
8287
|
-
if (c = !0,
|
|
8288
|
-
h =
|
|
8306
|
+
const m = Tt(h, e);
|
|
8307
|
+
if (c = !0, m.length === 0) return m;
|
|
8308
|
+
h = m[0];
|
|
8289
8309
|
}
|
|
8290
|
-
const
|
|
8291
|
-
return
|
|
8310
|
+
const y = h.kind === "text" ? h.properties.revisionFormat : void 0;
|
|
8311
|
+
return y && (n === void 0 || y.author === n) && (h = Et(h, e), c = !0), [h];
|
|
8292
8312
|
});
|
|
8293
8313
|
let u = a;
|
|
8294
8314
|
c && (u = { ...a, runs: $(l) });
|
|
@@ -8336,21 +8356,21 @@ function bd(t, e, n) {
|
|
|
8336
8356
|
if (l.kind !== "paragraph") return l;
|
|
8337
8357
|
let u = !1;
|
|
8338
8358
|
const f = l.runs.flatMap((p) => {
|
|
8339
|
-
let
|
|
8340
|
-
const
|
|
8341
|
-
if (
|
|
8342
|
-
const x = Tt(
|
|
8359
|
+
let y = p;
|
|
8360
|
+
const m = p.kind === "text" ? p.properties.revision : void 0;
|
|
8361
|
+
if (m && (n === void 0 || m.author === n)) {
|
|
8362
|
+
const x = Tt(y, e);
|
|
8343
8363
|
if (u = !0, x.length === 0) return x;
|
|
8344
|
-
|
|
8364
|
+
y = x[0];
|
|
8345
8365
|
}
|
|
8346
|
-
const
|
|
8347
|
-
return
|
|
8366
|
+
const v = y.kind === "text" ? y.properties.revisionFormat : void 0;
|
|
8367
|
+
return v && (n === void 0 || v.author === n) && (y = Et(y, e), u = !0), [y];
|
|
8348
8368
|
});
|
|
8349
8369
|
let d = u ? { ...l, runs: $(f) } : l;
|
|
8350
8370
|
const h = l.properties.revision;
|
|
8351
8371
|
if (h && (n === void 0 || h.author === n)) {
|
|
8352
|
-
const { revision: p, ...
|
|
8353
|
-
d = { ...d, properties:
|
|
8372
|
+
const { revision: p, ...y } = d.properties;
|
|
8373
|
+
d = { ...d, properties: y }, u = !0;
|
|
8354
8374
|
}
|
|
8355
8375
|
return u && (a = !0, r = !0), d;
|
|
8356
8376
|
});
|
|
@@ -8389,15 +8409,15 @@ function yd(t) {
|
|
|
8389
8409
|
case "insertReplacementText": {
|
|
8390
8410
|
const p = d.data ?? "";
|
|
8391
8411
|
if (!p) return !1;
|
|
8392
|
-
const
|
|
8393
|
-
return
|
|
8412
|
+
const y = r(h);
|
|
8413
|
+
return y ? (ge(t, y, { kind: "text", text: p, properties: {} }).ok && Z(t, y.block.id, y.offset + p.length), !0) : !1;
|
|
8394
8414
|
}
|
|
8395
8415
|
case "deleteContentBackward":
|
|
8396
8416
|
case "deleteWordBackward": {
|
|
8397
8417
|
if (t.trackChanges.enabled && h.kind === "caret" && h.at.offset === 0) {
|
|
8398
|
-
const
|
|
8399
|
-
if (
|
|
8400
|
-
return hd(t,
|
|
8418
|
+
const m = t.registry.indexOf(h.at.block.id);
|
|
8419
|
+
if (m > 0)
|
|
8420
|
+
return hd(t, m).ok && Z(t, h.at.block.id, 0), !0;
|
|
8401
8421
|
}
|
|
8402
8422
|
const p = i(h);
|
|
8403
8423
|
return p ? (Pe(t, p).ok && Z(t, p.from.block.id, p.from.offset), !0) : !1;
|
|
@@ -8412,20 +8432,20 @@ function yd(t) {
|
|
|
8412
8432
|
case "insertParagraph": {
|
|
8413
8433
|
const p = r(h);
|
|
8414
8434
|
if (!p) return !1;
|
|
8415
|
-
const
|
|
8416
|
-
return
|
|
8435
|
+
const y = Qt(t, p);
|
|
8436
|
+
return y.ok && Z(t, y.value.id, 0), !0;
|
|
8417
8437
|
}
|
|
8418
8438
|
case "insertLineBreak": {
|
|
8419
8439
|
const p = r(h);
|
|
8420
8440
|
if (!p) return !1;
|
|
8421
|
-
const
|
|
8441
|
+
const y = {
|
|
8422
8442
|
kind: "break",
|
|
8423
8443
|
type: "line",
|
|
8424
8444
|
properties: {
|
|
8425
8445
|
revision: t.trackChanges.author === void 0 ? { type: "ins" } : { type: "ins", author: t.trackChanges.author }
|
|
8426
8446
|
}
|
|
8427
8447
|
};
|
|
8428
|
-
return ge(t, p,
|
|
8448
|
+
return ge(t, p, y).ok && Z(t, p.block.id, p.offset + 1), !0;
|
|
8429
8449
|
}
|
|
8430
8450
|
default:
|
|
8431
8451
|
return n.has(d.inputType) || (n.add(d.inputType), console.warn(
|
|
@@ -8451,72 +8471,72 @@ function yd(t) {
|
|
|
8451
8471
|
t.selection.set({ kind: "caret", at: h.caret });
|
|
8452
8472
|
return;
|
|
8453
8473
|
}
|
|
8454
|
-
const
|
|
8455
|
-
if (!
|
|
8456
|
-
const
|
|
8457
|
-
block: { id:
|
|
8474
|
+
const y = Me(t, h.caret.block.id);
|
|
8475
|
+
if (!y) return;
|
|
8476
|
+
const m = {
|
|
8477
|
+
block: { id: y.id, version: y.version },
|
|
8458
8478
|
offset: h.caret.offset
|
|
8459
8479
|
};
|
|
8460
|
-
t.selection.set({ kind: "caret", at:
|
|
8480
|
+
t.selection.set({ kind: "caret", at: m }), ge(t, m, { kind: "text", text: p, properties: {} }).ok && Z(t, y.id, m.offset + p.length);
|
|
8461
8481
|
}
|
|
8462
8482
|
function l() {
|
|
8463
8483
|
const d = typeof window < "u" ? window.getSelection() : null;
|
|
8464
8484
|
if (!d || d.rangeCount === 0) return !1;
|
|
8465
|
-
const h = d.getRangeAt(0), { startContainer: p } = h,
|
|
8466
|
-
if (!
|
|
8467
|
-
const
|
|
8468
|
-
return
|
|
8485
|
+
const h = d.getRangeAt(0), { startContainer: p } = h, y = p.nodeType === Node.ELEMENT_NODE ? p : p.parentElement;
|
|
8486
|
+
if (!y) return !1;
|
|
8487
|
+
const m = y.closest("[data-block-id]");
|
|
8488
|
+
return m ? !!m.querySelector(
|
|
8469
8489
|
"ins.sobree-revision, del.sobree-revision, span.sobree-revision-format"
|
|
8470
8490
|
) : !1;
|
|
8471
8491
|
}
|
|
8472
8492
|
function u(d) {
|
|
8473
8493
|
const h = t.selection.get(), p = r(h);
|
|
8474
8494
|
if (!p) return;
|
|
8475
|
-
const
|
|
8495
|
+
const y = d.replace(/\r\n?/g, `
|
|
8476
8496
|
`).split(`
|
|
8477
8497
|
`);
|
|
8478
|
-
let
|
|
8479
|
-
for (let x = 0; x <
|
|
8480
|
-
const
|
|
8481
|
-
if (
|
|
8482
|
-
if (!ge(t,
|
|
8483
|
-
|
|
8498
|
+
let m = p, v = 0;
|
|
8499
|
+
for (let x = 0; x < y.length; x++) {
|
|
8500
|
+
const S = y[x];
|
|
8501
|
+
if (S !== "" && m) {
|
|
8502
|
+
if (!ge(t, m, { kind: "text", text: S, properties: {} }).ok) return;
|
|
8503
|
+
v = S.length;
|
|
8484
8504
|
} else
|
|
8485
|
-
|
|
8486
|
-
if (x <
|
|
8505
|
+
v = 0;
|
|
8506
|
+
if (x < y.length - 1 && m) {
|
|
8487
8507
|
const E = de(t, {
|
|
8488
|
-
block:
|
|
8489
|
-
offset:
|
|
8508
|
+
block: m.block,
|
|
8509
|
+
offset: m.offset + v
|
|
8490
8510
|
});
|
|
8491
8511
|
if (!E) return;
|
|
8492
|
-
const
|
|
8493
|
-
if (!
|
|
8494
|
-
|
|
8512
|
+
const I = Qt(t, E);
|
|
8513
|
+
if (!I.ok) return;
|
|
8514
|
+
m = { block: I.value, offset: 0 };
|
|
8495
8515
|
} else
|
|
8496
|
-
|
|
8497
|
-
block:
|
|
8498
|
-
offset:
|
|
8516
|
+
m = m ? de(t, {
|
|
8517
|
+
block: m.block,
|
|
8518
|
+
offset: m.offset + v
|
|
8499
8519
|
}) : null;
|
|
8500
8520
|
}
|
|
8501
|
-
|
|
8521
|
+
m && Z(t, m.block.id, m.offset);
|
|
8502
8522
|
}
|
|
8503
8523
|
async function f(d) {
|
|
8504
|
-
var p,
|
|
8524
|
+
var p, y;
|
|
8505
8525
|
const h = (p = d.clipboardData) == null ? void 0 : p.items;
|
|
8506
8526
|
if (h) {
|
|
8507
|
-
for (const
|
|
8508
|
-
if (
|
|
8527
|
+
for (const m of Array.from(h)) {
|
|
8528
|
+
if (m.kind !== "file" || !m.type.startsWith("image/")) continue;
|
|
8509
8529
|
d.preventDefault();
|
|
8510
|
-
const
|
|
8511
|
-
if (
|
|
8512
|
-
await lo(t,
|
|
8530
|
+
const v = m.getAsFile();
|
|
8531
|
+
if (v) {
|
|
8532
|
+
await lo(t, v);
|
|
8513
8533
|
return;
|
|
8514
8534
|
}
|
|
8515
8535
|
}
|
|
8516
8536
|
if (t.trackChanges.enabled) {
|
|
8517
|
-
const
|
|
8518
|
-
if (
|
|
8519
|
-
d.preventDefault(), u(
|
|
8537
|
+
const m = ((y = d.clipboardData) == null ? void 0 : y.getData("text/plain")) ?? "";
|
|
8538
|
+
if (m === "") return;
|
|
8539
|
+
d.preventDefault(), u(m);
|
|
8520
8540
|
}
|
|
8521
8541
|
}
|
|
8522
8542
|
}
|
|
@@ -8997,17 +9017,17 @@ function $d(t) {
|
|
|
8997
9017
|
}, l = (u) => {
|
|
8998
9018
|
if (!e) return;
|
|
8999
9019
|
u.preventDefault(), u.stopPropagation();
|
|
9000
|
-
const f = e, d = u.clientX, h = u.clientY, p = f.getBoundingClientRect().width,
|
|
9001
|
-
let E = Math.max(20, p + (
|
|
9002
|
-
if (!
|
|
9003
|
-
const
|
|
9004
|
-
|
|
9020
|
+
const f = e, d = u.clientX, h = u.clientY, p = f.getBoundingClientRect().width, y = f.getBoundingClientRect().height, m = p > 0 && y > 0 ? p / y : 1, v = (S) => {
|
|
9021
|
+
let E = Math.max(20, p + (S.clientX - d)), I = Math.max(20, y + (S.clientY - h));
|
|
9022
|
+
if (!S.shiftKey) {
|
|
9023
|
+
const N = Math.abs(E - p), A = Math.abs(I - y);
|
|
9024
|
+
N >= A ? I = E / m : E = I * m;
|
|
9005
9025
|
}
|
|
9006
|
-
f.style.width = `${Math.round(E)}px`, f.style.height = `${Math.round(
|
|
9026
|
+
f.style.width = `${Math.round(E)}px`, f.style.height = `${Math.round(I)}px`, c();
|
|
9007
9027
|
}, x = () => {
|
|
9008
|
-
window.removeEventListener("mousemove",
|
|
9028
|
+
window.removeEventListener("mousemove", v), window.removeEventListener("mouseup", x), t.dispatchEvent(new Event("input", { bubbles: !0 }));
|
|
9009
9029
|
};
|
|
9010
|
-
window.addEventListener("mousemove",
|
|
9030
|
+
window.addEventListener("mousemove", v), window.addEventListener("mouseup", x);
|
|
9011
9031
|
};
|
|
9012
9032
|
return t.addEventListener("click", r), window.addEventListener("scroll", i, { capture: !0 }), window.addEventListener("resize", o), () => {
|
|
9013
9033
|
a(), t.removeEventListener("click", r), window.removeEventListener("scroll", i, { capture: !0 }), window.removeEventListener("resize", o);
|
|
@@ -10291,64 +10311,64 @@ function vh(t) {
|
|
|
10291
10311
|
const o = /* @__PURE__ */ new Set(), s = /* @__PURE__ */ new Set(), a = [];
|
|
10292
10312
|
for (let l = 0; l < t.length; l++) {
|
|
10293
10313
|
const u = /* @__PURE__ */ new Set(), f = [];
|
|
10294
|
-
let d = null, h = null, p = null,
|
|
10295
|
-
for (const
|
|
10296
|
-
if (
|
|
10297
|
-
const
|
|
10314
|
+
let d = null, h = null, p = null, y = null;
|
|
10315
|
+
for (const m of t[l].items) {
|
|
10316
|
+
if (m.type !== "box") continue;
|
|
10317
|
+
const v = m;
|
|
10298
10318
|
let x;
|
|
10299
|
-
if (
|
|
10300
|
-
if (u.add(x),
|
|
10301
|
-
const
|
|
10302
|
-
if (!E || !
|
|
10303
|
-
f.push(x), d = null, h = null, p = null,
|
|
10319
|
+
if (v.lineIndex !== void 0 ? x = ((c = n.get(v.el)) == null ? void 0 : c.get(l)) ?? v.el : x = v.el, !u.has(x)) {
|
|
10320
|
+
if (u.add(x), v.cellTr) {
|
|
10321
|
+
const S = v.cellTr, E = S.closest("table"), I = E == null ? void 0 : E.querySelector(":scope > tbody");
|
|
10322
|
+
if (!E || !I) {
|
|
10323
|
+
f.push(x), d = null, h = null, p = null, y = null;
|
|
10304
10324
|
continue;
|
|
10305
10325
|
}
|
|
10306
|
-
E !== d && (h = Cr(E), f.push(h), d = E, o.add(E), p = null,
|
|
10307
|
-
const
|
|
10308
|
-
if (!
|
|
10326
|
+
E !== d && (h = Cr(E), f.push(h), d = E, o.add(E), p = null, y = null), S !== p && (y = Sh(S), h.querySelector(":scope > tbody").appendChild(y), p = S, s.add(S));
|
|
10327
|
+
const N = x.closest("td, th");
|
|
10328
|
+
if (!N) {
|
|
10309
10329
|
f.push(x);
|
|
10310
10330
|
continue;
|
|
10311
10331
|
}
|
|
10312
|
-
const
|
|
10332
|
+
const A = Array.from(S.children), F = A.indexOf(N), M = y.children[F];
|
|
10313
10333
|
if (!M) {
|
|
10314
10334
|
f.push(x);
|
|
10315
10335
|
continue;
|
|
10316
10336
|
}
|
|
10317
|
-
if (
|
|
10318
|
-
for (let L = 0; L <
|
|
10319
|
-
if (L ===
|
|
10320
|
-
const D =
|
|
10337
|
+
if (v.isFirstParaOfRow)
|
|
10338
|
+
for (let L = 0; L < A.length; L++) {
|
|
10339
|
+
if (L === F) continue;
|
|
10340
|
+
const D = A[L], K = y.children[L];
|
|
10321
10341
|
for (; D.firstChild; ) K.appendChild(D.firstChild);
|
|
10322
10342
|
}
|
|
10323
10343
|
M.appendChild(x);
|
|
10324
10344
|
continue;
|
|
10325
10345
|
}
|
|
10326
10346
|
if (x.tagName === "LI") {
|
|
10327
|
-
const
|
|
10328
|
-
if (!
|
|
10347
|
+
const S = x.parentElement;
|
|
10348
|
+
if (!S || !Er(S)) {
|
|
10329
10349
|
f.push(x), d = null, h = null;
|
|
10330
10350
|
continue;
|
|
10331
10351
|
}
|
|
10332
|
-
if (
|
|
10333
|
-
const E = r.get(x) ?? yo(
|
|
10334
|
-
h = Eh(
|
|
10352
|
+
if (S !== d) {
|
|
10353
|
+
const E = r.get(x) ?? yo(S);
|
|
10354
|
+
h = Eh(S, E), f.push(h), d = S, o.add(S);
|
|
10335
10355
|
}
|
|
10336
10356
|
x.dataset.pagContinuation === "1" ? x.classList.add("sobree-li-continuation") : x.classList.remove("sobree-li-continuation"), h.appendChild(x);
|
|
10337
|
-
} else if (x.tagName === "TR" && !
|
|
10338
|
-
const
|
|
10357
|
+
} else if (x.tagName === "TR" && !v.cellTr) {
|
|
10358
|
+
const S = x.parentElement, E = S == null ? void 0 : S.closest("table");
|
|
10339
10359
|
if (!E) {
|
|
10340
10360
|
f.push(x), d = null, h = null;
|
|
10341
10361
|
continue;
|
|
10342
10362
|
}
|
|
10343
10363
|
E !== d && (h = Cr(E), f.push(h), d = E, o.add(E));
|
|
10344
|
-
const
|
|
10345
|
-
let
|
|
10346
|
-
if (
|
|
10347
|
-
let
|
|
10348
|
-
|
|
10364
|
+
const I = (S == null ? void 0 : S.tagName) === "THEAD";
|
|
10365
|
+
let N;
|
|
10366
|
+
if (I) {
|
|
10367
|
+
let A = h.querySelector(":scope > thead");
|
|
10368
|
+
A || (A = document.createElement("thead"), h.insertBefore(A, h.firstChild)), N = A;
|
|
10349
10369
|
} else
|
|
10350
|
-
|
|
10351
|
-
|
|
10370
|
+
N = h.querySelector(":scope > tbody") ?? h;
|
|
10371
|
+
N.appendChild(x);
|
|
10352
10372
|
} else
|
|
10353
10373
|
f.push(x), d = null, h = null;
|
|
10354
10374
|
}
|
|
@@ -11172,7 +11192,7 @@ class ip {
|
|
|
11172
11192
|
o,
|
|
11173
11193
|
e,
|
|
11174
11194
|
n.length > 0 ? n : void 0
|
|
11175
|
-
), a = lp(s), c = Math.max(1, a.length);
|
|
11195
|
+
), a = lp(s, this.anchoredBlockIndices()), c = Math.max(1, a.length);
|
|
11176
11196
|
this.ensurePaperCount(c);
|
|
11177
11197
|
for (let l = 0; l < c; l++) {
|
|
11178
11198
|
const u = this.papers[l], f = a[l];
|
|
@@ -11328,6 +11348,14 @@ class ip {
|
|
|
11328
11348
|
*
|
|
11329
11349
|
* Cheap and idempotent; safe to call after any layout change.
|
|
11330
11350
|
*/
|
|
11351
|
+
/** Body block indices a floating frame is anchored to. A body-empty page
|
|
11352
|
+
* holding one of these carries an absolute overlay and must not collapse. */
|
|
11353
|
+
anchoredBlockIndices() {
|
|
11354
|
+
const e = /* @__PURE__ */ new Set();
|
|
11355
|
+
for (const n of this.anchoredFrames ?? [])
|
|
11356
|
+
n.anchor.paragraphIndex !== void 0 && e.add(n.anchor.paragraphIndex);
|
|
11357
|
+
return e;
|
|
11358
|
+
}
|
|
11331
11359
|
paintAnchorLayers() {
|
|
11332
11360
|
const e = this.anchoredFrames, n = this.anchorRenderDeps;
|
|
11333
11361
|
if (e === null || n === null) {
|
|
@@ -11455,20 +11483,23 @@ function vo(t, e) {
|
|
|
11455
11483
|
for (; e.firstChild; ) t.appendChild(e.firstChild);
|
|
11456
11484
|
delete t.dataset.pagContinuation, t.classList.remove("sobree-li-continuation");
|
|
11457
11485
|
}
|
|
11458
|
-
function lp(t) {
|
|
11459
|
-
const
|
|
11460
|
-
|
|
11461
|
-
|
|
11462
|
-
|
|
11463
|
-
|
|
11486
|
+
function lp(t, e = /* @__PURE__ */ new Set()) {
|
|
11487
|
+
const n = t.map((i) => i.slice()), r = (i) => i.some((o) => {
|
|
11488
|
+
const s = o.getAttribute("data-block-index");
|
|
11489
|
+
return s !== null && e.has(Number(s));
|
|
11490
|
+
});
|
|
11491
|
+
for (; n.length >= 2; ) {
|
|
11492
|
+
const i = n[n.length - 1];
|
|
11493
|
+
if (!i || r(i) || !i.every(Br)) break;
|
|
11494
|
+
n[n.length - 2].push(...i), n.pop();
|
|
11464
11495
|
}
|
|
11465
|
-
for (let
|
|
11466
|
-
const
|
|
11467
|
-
if (
|
|
11468
|
-
const
|
|
11469
|
-
|
|
11496
|
+
for (let i = n.length - 2; i >= 0; i--) {
|
|
11497
|
+
const o = n[i];
|
|
11498
|
+
if (o.length === 0 || r(o) || !o.every(Br)) continue;
|
|
11499
|
+
const s = n[i + 1];
|
|
11500
|
+
s && (s.unshift(...o), n.splice(i, 1));
|
|
11470
11501
|
}
|
|
11471
|
-
return
|
|
11502
|
+
return n;
|
|
11472
11503
|
}
|
|
11473
11504
|
function Br(t) {
|
|
11474
11505
|
const e = t.tagName;
|
|
@@ -11508,7 +11539,7 @@ function dp(t) {
|
|
|
11508
11539
|
const i = t.getDocument(), o = i.sections.slice(), s = o.length - 1, a = o[s];
|
|
11509
11540
|
a && (o.push(structuredClone(a)), t.setDocument({ ...i, sections: o }));
|
|
11510
11541
|
}
|
|
11511
|
-
const hp = "0.1.
|
|
11542
|
+
const hp = "0.1.27", pp = hp;
|
|
11512
11543
|
function gp(t = document) {
|
|
11513
11544
|
const e = t.createElement("div");
|
|
11514
11545
|
return e.className = "sobree-version-badge", e.textContent = `@sobree/core v${pp}`, e.setAttribute("aria-hidden", "true"), Object.assign(e.style, {
|
|
@@ -11988,8 +12019,8 @@ function tg(t, e = {}) {
|
|
|
11988
12019
|
const p = l[h];
|
|
11989
12020
|
try {
|
|
11990
12021
|
p.instance.destroy();
|
|
11991
|
-
} catch (
|
|
11992
|
-
console.error(`[sobree] plugin "${p.name ?? "?"}" destroy failed:`,
|
|
12022
|
+
} catch (y) {
|
|
12023
|
+
console.error(`[sobree] plugin "${p.name ?? "?"}" destroy failed:`, y);
|
|
11993
12024
|
}
|
|
11994
12025
|
}
|
|
11995
12026
|
a.destroy();
|
|
@@ -12050,17 +12081,17 @@ function rg(t) {
|
|
|
12050
12081
|
const h = () => {
|
|
12051
12082
|
if (d) return;
|
|
12052
12083
|
d = !0;
|
|
12053
|
-
const
|
|
12054
|
-
e.contentEditable = "false", r.contentEditable = f || "true", r.classList.remove("is-zone-editing"), e.removeEventListener("blur", p), e.removeEventListener("keydown",
|
|
12084
|
+
const v = (e.textContent ?? "").replace(/\n+$/, "");
|
|
12085
|
+
e.contentEditable = "false", r.contentEditable = f || "true", r.classList.remove("is-zone-editing"), e.removeEventListener("blur", p), e.removeEventListener("keydown", y), document.removeEventListener("mousedown", m, !0);
|
|
12055
12086
|
const x = structuredClone(i());
|
|
12056
|
-
x[n][a] =
|
|
12057
|
-
}, p = () => h(),
|
|
12058
|
-
(
|
|
12059
|
-
},
|
|
12060
|
-
const x =
|
|
12087
|
+
x[n][a] = v, o(x), s();
|
|
12088
|
+
}, p = () => h(), y = (v) => {
|
|
12089
|
+
(v.key === "Escape" || v.key === "Enter") && (v.preventDefault(), h());
|
|
12090
|
+
}, m = (v) => {
|
|
12091
|
+
const x = v.target;
|
|
12061
12092
|
e.contains(x) || x instanceof Element && x.closest(".sobree-block-indicator") || h();
|
|
12062
12093
|
};
|
|
12063
|
-
return e.addEventListener("blur", p), e.addEventListener("keydown",
|
|
12094
|
+
return e.addEventListener("blur", p), e.addEventListener("keydown", y), document.addEventListener("mousedown", m, !0), h;
|
|
12064
12095
|
}
|
|
12065
12096
|
function Tp(t, e, n, r) {
|
|
12066
12097
|
const i = Array.from(n.querySelectorAll(".paper")), o = t.closest(".paper");
|
|
@@ -12476,10 +12507,10 @@ function og(t, e, n) {
|
|
|
12476
12507
|
`[data-block-id="${Pp(h.selection.blockId)}"]`
|
|
12477
12508
|
);
|
|
12478
12509
|
if (!p) continue;
|
|
12479
|
-
const
|
|
12480
|
-
|
|
12510
|
+
const y = p.getBoundingClientRect(), m = r.getBoundingClientRect(), v = document.createElement("div");
|
|
12511
|
+
v.className = "sobree-caret", v.style.cssText = `position:absolute; top:${y.top - m.top}px; left:${y.left - m.left - 2}px; width:2px; height:${y.height}px; background:${h.user.color}; opacity:0.85;`;
|
|
12481
12512
|
const x = document.createElement("span");
|
|
12482
|
-
x.className = "sobree-caret-label", x.textContent = h.user.name, x.style.cssText = `position:absolute; top:-1.4em; left:0; padding:0 4px; background:${h.user.color}; color:#fff; font:11px/1.4 system-ui, sans-serif; border-radius:3px 3px 3px 0; white-space:nowrap;`,
|
|
12513
|
+
x.className = "sobree-caret-label", x.textContent = h.user.name, x.style.cssText = `position:absolute; top:-1.4em; left:0; padding:0 4px; background:${h.user.color}; color:#fff; font:11px/1.4 system-ui, sans-serif; border-radius:3px 3px 3px 0; white-space:nowrap;`, v.appendChild(x), s.appendChild(v);
|
|
12483
12514
|
}
|
|
12484
12515
|
}, l = Ap(t, e, {
|
|
12485
12516
|
...n,
|