openwork-server 0.18.71 → 0.18.72
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/opencode-plugin-deps-1.18.33.tgz +0 -0
- package/dist/opencode-plugins/agent-instruction-compose.js +0 -24
- package/dist/opencode-plugins/approval-loopback-fetch.js +0 -9
- package/dist/opencode-plugins/browser-tool-args.js +37 -0
- package/dist/opencode-plugins/computer-listing-files.js +0 -19
- package/dist/opencode-plugins/drive-file-tools.js +0 -4
- package/dist/opencode-plugins/gmail-attachment-fulfillment.js +0 -14
- package/dist/opencode-plugins/managed-policy-client.js +0 -2
- package/dist/opencode-plugins/opencode-stop-fence-client.js +0 -1
- package/dist/opencode-plugins/openwork-agent-questions.js +2 -10
- package/dist/opencode-plugins/openwork-capabilities-knowledge.js +2 -2
- package/dist/opencode-plugins/openwork-chrome-devtools.js +47 -4
- package/dist/opencode-plugins/openwork-cloud-skills-v2.js +34 -49
- package/dist/opencode-plugins/openwork-codemode-discovery-v2.js +0 -7
- package/dist/opencode-plugins/openwork-context-v2.js +81 -12
- package/dist/opencode-plugins/openwork-extensions-preview-steering.js +0 -16
- package/dist/opencode-plugins/openwork-extensions-preview.js +1 -1
- package/dist/opencode-plugins/openwork-office-attachments.js +1401 -10
- package/dist/opencode-plugins/openwork-provider-adapters.js +0 -11
- package/dist/opencode-plugins/openwork-session-groups.js +0 -13
- package/dist/opencode-plugins/openwork-spreadsheets.js +1401 -10
- package/dist/opencode-plugins/openwork-ui-bridge.js +1 -6
- package/dist/opencode-plugins/provider-safe-tool-schema.js +0 -10
- package/dist/opencode-plugins/session-read-detail.js +0 -36
- package/dist/opencode-plugins/workspace-file-destinations.js +0 -5
- package/dist/openwork-server.mjs +3190 -1101
- package/package.json +1 -1
- package/web/assets/{abnfDiagram-VCTEODGH-DlWncS8i.js → abnfDiagram-VCTEODGH-Bk2JrJ3j.js} +1 -1
- package/web/assets/app-BinIaXyk.css +32 -0
- package/web/assets/{app-DSUHKGsm.js → app-CNo6L1tq.js} +487 -479
- package/web/assets/{arc-BtZC6wuw.js → arc-BeMgz_zn.js} +1 -1
- package/web/assets/{architectureDiagram-5GKGNRK7-DTbl4Rnl.js → architectureDiagram-5GKGNRK7-CRxylST_.js} +1 -1
- package/web/assets/{artifact-code-view-Ck4sjscy.js → artifact-code-view-BwBuxnOh.js} +1 -1
- package/web/assets/artifact-office-preview-v_N9yGCg.js +6 -0
- package/web/assets/artifact-spreadsheet-editor-5lpd49cl.js +4 -0
- package/web/assets/{artifact-text-editor-DjSmnNjJ.js → artifact-text-editor-Dj0SDUYJ.js} +1 -1
- package/web/assets/{blockDiagram-OSKFZWR5-DAYSy6DL.js → blockDiagram-OSKFZWR5-CYcFpnr1.js} +1 -1
- package/web/assets/{c4Diagram-7LVT6UL2-CjyvESYl.js → c4Diagram-7LVT6UL2-KL6win2t.js} +1 -1
- package/web/assets/channel-C7q2VHY_.js +1 -0
- package/web/assets/{chunk-2Q5K7J3B-CcMgFZAV.js → chunk-2Q5K7J3B-CjBMu5Dk.js} +1 -1
- package/web/assets/{chunk-5VM5RSS4-D4c8XRGl.js → chunk-5VM5RSS4-CVfSxxeV.js} +1 -1
- package/web/assets/{chunk-F27PBJKO-BnyyjaCS.js → chunk-F27PBJKO-Da-CK7uS.js} +1 -1
- package/web/assets/{chunk-HLEWEB6X-JXz7B5zc.js → chunk-HLEWEB6X-DaBpQjxM.js} +1 -1
- package/web/assets/{chunk-JWPE2WC7-CYcnmDz7.js → chunk-JWPE2WC7-eZhhKb-9.js} +1 -1
- package/web/assets/{chunk-POPQ4Y6H-2llTUUN7.js → chunk-POPQ4Y6H-BuQza4Dl.js} +1 -1
- package/web/assets/{chunk-SVP7TREG-BnWFSOpJ.js → chunk-SVP7TREG-MuA1wNzK.js} +1 -1
- package/web/assets/{chunk-XXDRQBXY-XqHzbo0u.js → chunk-XXDRQBXY-CIpJOQtx.js} +1 -1
- package/web/assets/{chunk-ZLD2IHE6-Dz_IjbQJ.js → chunk-ZLD2IHE6-NhKoLW1Y.js} +1 -1
- package/web/assets/classDiagram-CYGNFDIV-DKD7FwJZ.js +1 -0
- package/web/assets/classDiagram-v2-TLXNO2FR-DKD7FwJZ.js +1 -0
- package/web/assets/{cose-bilkent-JH36ORCC--bD81EP5.js → cose-bilkent-JH36ORCC-B_lNY9db.js} +1 -1
- package/web/assets/{cynefin-OW5HDTMX-tTD-HcrI.js → cynefin-OW5HDTMX-BmqyCndA.js} +1 -1
- package/web/assets/{cynefinDiagram-5FMLGOSQ-CMslIrwy.js → cynefinDiagram-5FMLGOSQ-By2KC7b4.js} +1 -1
- package/web/assets/{dagre-OS7QT2EB-B__oM1cx.js → dagre-OS7QT2EB-By7csWyW.js} +1 -1
- package/web/assets/{diagram-S7CK7UJ4-D2ghWE6t.js → diagram-S7CK7UJ4-5_mhvlGk.js} +1 -1
- package/web/assets/{diagram-UQ7AKVKN-BanDxdhW.js → diagram-UQ7AKVKN-BPHF9t90.js} +1 -1
- package/web/assets/{diagram-VSXAHHWV-DGvbp0xT.js → diagram-VSXAHHWV-CyVv5z8B.js} +1 -1
- package/web/assets/{diagram-VX7I27RA-CThCeJli.js → diagram-VX7I27RA-BdfxwGwk.js} +1 -1
- package/web/assets/{diagram-Z3DM3KII-CAt65CmM.js → diagram-Z3DM3KII-BXg_HOys.js} +1 -1
- package/web/assets/{ebnfDiagram-PWID7BFC-Cp5nPs03.js → ebnfDiagram-PWID7BFC-57--ZiB5.js} +1 -1
- package/web/assets/{erDiagram-2YWLMYGG-HLBdDnlf.js → erDiagram-2YWLMYGG-2WR_i4mr.js} +1 -1
- package/web/assets/{flowDiagram-T62WH6J4-CELW8hlc.js → flowDiagram-T62WH6J4-1qB430Tj.js} +1 -1
- package/web/assets/{ganttDiagram-EL5Y4UJY-C7R0OzTb.js → ganttDiagram-EL5Y4UJY-DlsKL-gN.js} +1 -1
- package/web/assets/{gitGraphDiagram-WWUBYQGX-qBuuQIor.js → gitGraphDiagram-WWUBYQGX-DQ8IU_wC.js} +1 -1
- package/web/assets/{infoDiagram-FKFFQAWI-iEzBkgjk.js → infoDiagram-FKFFQAWI-kh9s5sRC.js} +1 -1
- package/web/assets/{ishikawaDiagram-5VMMS53U-DrK4XY4T.js → ishikawaDiagram-5VMMS53U-CaknQUcm.js} +1 -1
- package/web/assets/{journeyDiagram-EYS64GPL-CGd8HUPB.js → journeyDiagram-EYS64GPL-DenZYZs9.js} +1 -1
- package/web/assets/{kanban-definition-UXKFOSKX-DQmiyxel.js → kanban-definition-UXKFOSKX-ptoI6qD1.js} +1 -1
- package/web/assets/{layout-DLjmmpHK.js → layout-B4UdHd1t.js} +1 -1
- package/web/assets/{linear-DHJPnkfR.js → linear-DbhtXtCn.js} +1 -1
- package/web/assets/{mermaid.core-PQNy-dHT.js → mermaid.core-BoXM2BMZ.js} +6 -6
- package/web/assets/{mindmap-definition-THT77NOG-B5jNdC9x.js → mindmap-definition-THT77NOG-Bcw34klO.js} +1 -1
- package/web/assets/{pegDiagram-XKGWAZYB-wbhF-roR.js → pegDiagram-XKGWAZYB-CZ49Cylj.js} +1 -1
- package/web/assets/{pieDiagram-E7YTZNPT-2HAV5f46.js → pieDiagram-E7YTZNPT-F5Tl-jOo.js} +1 -1
- package/web/assets/{quadrantDiagram-AXDQQJYC-CLDLYWPn.js → quadrantDiagram-AXDQQJYC-BindC9Ln.js} +1 -1
- package/web/assets/{railroadDiagram-O6MQD6OU-Be5VkSOo.js → railroadDiagram-O6MQD6OU-BHfARQKt.js} +1 -1
- package/web/assets/{requirementDiagram-IS5BZ75X-qBk4BaLm.js → requirementDiagram-IS5BZ75X-DeyyjrFZ.js} +1 -1
- package/web/assets/{sankeyDiagram-P5KCCOFB-a-kGn14g.js → sankeyDiagram-P5KCCOFB-Bf4RYjdY.js} +1 -1
- package/web/assets/{sequenceDiagram-WJ2MYXX4-B19t616Z.js → sequenceDiagram-WJ2MYXX4-D0I5Iail.js} +1 -1
- package/web/assets/{sizeCapture-INFHLROL-CGM0ZmNa.js → sizeCapture-INFHLROL-ZMHjeD6L.js} +1 -1
- package/web/assets/{stateDiagram-XQSTLZYL-CQYuKN4p.js → stateDiagram-XQSTLZYL-XMu0akCC.js} +1 -1
- package/web/assets/stateDiagram-v2-IH3M54BS-CNv5Ofd5.js +1 -0
- package/web/assets/{swimlanes-V6O3JKXN-CvzknNlU.js → swimlanes-V6O3JKXN-BX1vgjAt.js} +1 -1
- package/web/assets/swimlanesDiagram-JKAHXJPX-yIR7kUmA.js +8 -0
- package/web/assets/{timeline-definition-24CTP7MA-BhF3gzcl.js → timeline-definition-24CTP7MA-B-V8Y7U9.js} +1 -1
- package/web/assets/{vennDiagram-4TSXK5OY-6DNrrc2_.js → vennDiagram-4TSXK5OY-iHvsobDU.js} +1 -1
- package/web/assets/{wardleyDiagram-VM6X3IG4-DO0onK3t.js → wardleyDiagram-VM6X3IG4-BTl7bSNi.js} +1 -1
- package/web/assets/{workspace-file-tree-BCpC4HYD.js → workspace-file-tree-EJaUSokl.js} +1 -1
- package/web/assets/xlsx-workbook-DVIQLEdk.js +9 -0
- package/web/assets/{xychartDiagram-S5SC5T6Z-44sg_69l.js → xychartDiagram-S5SC5T6Z-BKhJK0Av.js} +1 -1
- package/web/index.html +2 -2
- package/web/assets/app-CfKQPy_C.css +0 -32
- package/web/assets/artifact-spreadsheet-editor-O5R5Qt-8.js +0 -11
- package/web/assets/channel-OiorT9Re.js +0 -1
- package/web/assets/classDiagram-CYGNFDIV-CLY7M0C9.js +0 -1
- package/web/assets/classDiagram-v2-TLXNO2FR-CLY7M0C9.js +0 -1
- package/web/assets/stateDiagram-v2-IH3M54BS-CVq-yI8K.js +0 -1
- package/web/assets/swimlanesDiagram-JKAHXJPX-YWNRXT7V.js +0 -8
|
@@ -1519,6 +1519,1258 @@ class Parser {
|
|
|
1519
1519
|
this.end(chunk);
|
|
1520
1520
|
}
|
|
1521
1521
|
}
|
|
1522
|
+
// ../../node_modules/.pnpm/domelementtype@2.3.0/node_modules/domelementtype/lib/esm/index.js
|
|
1523
|
+
var ElementType;
|
|
1524
|
+
(function(ElementType2) {
|
|
1525
|
+
ElementType2["Root"] = "root";
|
|
1526
|
+
ElementType2["Text"] = "text";
|
|
1527
|
+
ElementType2["Directive"] = "directive";
|
|
1528
|
+
ElementType2["Comment"] = "comment";
|
|
1529
|
+
ElementType2["Script"] = "script";
|
|
1530
|
+
ElementType2["Style"] = "style";
|
|
1531
|
+
ElementType2["Tag"] = "tag";
|
|
1532
|
+
ElementType2["CDATA"] = "cdata";
|
|
1533
|
+
ElementType2["Doctype"] = "doctype";
|
|
1534
|
+
})(ElementType || (ElementType = {}));
|
|
1535
|
+
function isTag(elem) {
|
|
1536
|
+
return elem.type === ElementType.Tag || elem.type === ElementType.Script || elem.type === ElementType.Style;
|
|
1537
|
+
}
|
|
1538
|
+
var Root = ElementType.Root;
|
|
1539
|
+
var Text = ElementType.Text;
|
|
1540
|
+
var Directive = ElementType.Directive;
|
|
1541
|
+
var Comment = ElementType.Comment;
|
|
1542
|
+
var Script = ElementType.Script;
|
|
1543
|
+
var Style = ElementType.Style;
|
|
1544
|
+
var Tag = ElementType.Tag;
|
|
1545
|
+
var CDATA = ElementType.CDATA;
|
|
1546
|
+
var Doctype = ElementType.Doctype;
|
|
1547
|
+
|
|
1548
|
+
// ../../node_modules/.pnpm/domhandler@5.0.3/node_modules/domhandler/lib/esm/node.js
|
|
1549
|
+
class Node {
|
|
1550
|
+
constructor() {
|
|
1551
|
+
this.parent = null;
|
|
1552
|
+
this.prev = null;
|
|
1553
|
+
this.next = null;
|
|
1554
|
+
this.startIndex = null;
|
|
1555
|
+
this.endIndex = null;
|
|
1556
|
+
}
|
|
1557
|
+
get parentNode() {
|
|
1558
|
+
return this.parent;
|
|
1559
|
+
}
|
|
1560
|
+
set parentNode(parent) {
|
|
1561
|
+
this.parent = parent;
|
|
1562
|
+
}
|
|
1563
|
+
get previousSibling() {
|
|
1564
|
+
return this.prev;
|
|
1565
|
+
}
|
|
1566
|
+
set previousSibling(prev) {
|
|
1567
|
+
this.prev = prev;
|
|
1568
|
+
}
|
|
1569
|
+
get nextSibling() {
|
|
1570
|
+
return this.next;
|
|
1571
|
+
}
|
|
1572
|
+
set nextSibling(next) {
|
|
1573
|
+
this.next = next;
|
|
1574
|
+
}
|
|
1575
|
+
cloneNode(recursive = false) {
|
|
1576
|
+
return cloneNode(this, recursive);
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
class DataNode extends Node {
|
|
1581
|
+
constructor(data) {
|
|
1582
|
+
super();
|
|
1583
|
+
this.data = data;
|
|
1584
|
+
}
|
|
1585
|
+
get nodeValue() {
|
|
1586
|
+
return this.data;
|
|
1587
|
+
}
|
|
1588
|
+
set nodeValue(data) {
|
|
1589
|
+
this.data = data;
|
|
1590
|
+
}
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
class Text2 extends DataNode {
|
|
1594
|
+
constructor() {
|
|
1595
|
+
super(...arguments);
|
|
1596
|
+
this.type = ElementType.Text;
|
|
1597
|
+
}
|
|
1598
|
+
get nodeType() {
|
|
1599
|
+
return 3;
|
|
1600
|
+
}
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
class Comment2 extends DataNode {
|
|
1604
|
+
constructor() {
|
|
1605
|
+
super(...arguments);
|
|
1606
|
+
this.type = ElementType.Comment;
|
|
1607
|
+
}
|
|
1608
|
+
get nodeType() {
|
|
1609
|
+
return 8;
|
|
1610
|
+
}
|
|
1611
|
+
}
|
|
1612
|
+
|
|
1613
|
+
class ProcessingInstruction extends DataNode {
|
|
1614
|
+
constructor(name, data) {
|
|
1615
|
+
super(data);
|
|
1616
|
+
this.name = name;
|
|
1617
|
+
this.type = ElementType.Directive;
|
|
1618
|
+
}
|
|
1619
|
+
get nodeType() {
|
|
1620
|
+
return 1;
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
|
|
1624
|
+
class NodeWithChildren extends Node {
|
|
1625
|
+
constructor(children) {
|
|
1626
|
+
super();
|
|
1627
|
+
this.children = children;
|
|
1628
|
+
}
|
|
1629
|
+
get firstChild() {
|
|
1630
|
+
var _a2;
|
|
1631
|
+
return (_a2 = this.children[0]) !== null && _a2 !== undefined ? _a2 : null;
|
|
1632
|
+
}
|
|
1633
|
+
get lastChild() {
|
|
1634
|
+
return this.children.length > 0 ? this.children[this.children.length - 1] : null;
|
|
1635
|
+
}
|
|
1636
|
+
get childNodes() {
|
|
1637
|
+
return this.children;
|
|
1638
|
+
}
|
|
1639
|
+
set childNodes(children) {
|
|
1640
|
+
this.children = children;
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
class CDATA2 extends NodeWithChildren {
|
|
1645
|
+
constructor() {
|
|
1646
|
+
super(...arguments);
|
|
1647
|
+
this.type = ElementType.CDATA;
|
|
1648
|
+
}
|
|
1649
|
+
get nodeType() {
|
|
1650
|
+
return 4;
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
class Document extends NodeWithChildren {
|
|
1655
|
+
constructor() {
|
|
1656
|
+
super(...arguments);
|
|
1657
|
+
this.type = ElementType.Root;
|
|
1658
|
+
}
|
|
1659
|
+
get nodeType() {
|
|
1660
|
+
return 9;
|
|
1661
|
+
}
|
|
1662
|
+
}
|
|
1663
|
+
|
|
1664
|
+
class Element extends NodeWithChildren {
|
|
1665
|
+
constructor(name, attribs, children = [], type = name === "script" ? ElementType.Script : name === "style" ? ElementType.Style : ElementType.Tag) {
|
|
1666
|
+
super(children);
|
|
1667
|
+
this.name = name;
|
|
1668
|
+
this.attribs = attribs;
|
|
1669
|
+
this.type = type;
|
|
1670
|
+
}
|
|
1671
|
+
get nodeType() {
|
|
1672
|
+
return 1;
|
|
1673
|
+
}
|
|
1674
|
+
get tagName() {
|
|
1675
|
+
return this.name;
|
|
1676
|
+
}
|
|
1677
|
+
set tagName(name) {
|
|
1678
|
+
this.name = name;
|
|
1679
|
+
}
|
|
1680
|
+
get attributes() {
|
|
1681
|
+
return Object.keys(this.attribs).map((name) => {
|
|
1682
|
+
var _a2, _b;
|
|
1683
|
+
return {
|
|
1684
|
+
name,
|
|
1685
|
+
value: this.attribs[name],
|
|
1686
|
+
namespace: (_a2 = this["x-attribsNamespace"]) === null || _a2 === undefined ? undefined : _a2[name],
|
|
1687
|
+
prefix: (_b = this["x-attribsPrefix"]) === null || _b === undefined ? undefined : _b[name]
|
|
1688
|
+
};
|
|
1689
|
+
});
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
function isTag2(node) {
|
|
1693
|
+
return isTag(node);
|
|
1694
|
+
}
|
|
1695
|
+
function isCDATA(node) {
|
|
1696
|
+
return node.type === ElementType.CDATA;
|
|
1697
|
+
}
|
|
1698
|
+
function isText(node) {
|
|
1699
|
+
return node.type === ElementType.Text;
|
|
1700
|
+
}
|
|
1701
|
+
function isComment(node) {
|
|
1702
|
+
return node.type === ElementType.Comment;
|
|
1703
|
+
}
|
|
1704
|
+
function isDirective(node) {
|
|
1705
|
+
return node.type === ElementType.Directive;
|
|
1706
|
+
}
|
|
1707
|
+
function isDocument(node) {
|
|
1708
|
+
return node.type === ElementType.Root;
|
|
1709
|
+
}
|
|
1710
|
+
function hasChildren(node) {
|
|
1711
|
+
return Object.prototype.hasOwnProperty.call(node, "children");
|
|
1712
|
+
}
|
|
1713
|
+
function cloneNode(node, recursive = false) {
|
|
1714
|
+
let result;
|
|
1715
|
+
if (isText(node)) {
|
|
1716
|
+
result = new Text2(node.data);
|
|
1717
|
+
} else if (isComment(node)) {
|
|
1718
|
+
result = new Comment2(node.data);
|
|
1719
|
+
} else if (isTag2(node)) {
|
|
1720
|
+
const children = recursive ? cloneChildren(node.children) : [];
|
|
1721
|
+
const clone = new Element(node.name, { ...node.attribs }, children);
|
|
1722
|
+
children.forEach((child) => child.parent = clone);
|
|
1723
|
+
if (node.namespace != null) {
|
|
1724
|
+
clone.namespace = node.namespace;
|
|
1725
|
+
}
|
|
1726
|
+
if (node["x-attribsNamespace"]) {
|
|
1727
|
+
clone["x-attribsNamespace"] = { ...node["x-attribsNamespace"] };
|
|
1728
|
+
}
|
|
1729
|
+
if (node["x-attribsPrefix"]) {
|
|
1730
|
+
clone["x-attribsPrefix"] = { ...node["x-attribsPrefix"] };
|
|
1731
|
+
}
|
|
1732
|
+
result = clone;
|
|
1733
|
+
} else if (isCDATA(node)) {
|
|
1734
|
+
const children = recursive ? cloneChildren(node.children) : [];
|
|
1735
|
+
const clone = new CDATA2(children);
|
|
1736
|
+
children.forEach((child) => child.parent = clone);
|
|
1737
|
+
result = clone;
|
|
1738
|
+
} else if (isDocument(node)) {
|
|
1739
|
+
const children = recursive ? cloneChildren(node.children) : [];
|
|
1740
|
+
const clone = new Document(children);
|
|
1741
|
+
children.forEach((child) => child.parent = clone);
|
|
1742
|
+
if (node["x-mode"]) {
|
|
1743
|
+
clone["x-mode"] = node["x-mode"];
|
|
1744
|
+
}
|
|
1745
|
+
result = clone;
|
|
1746
|
+
} else if (isDirective(node)) {
|
|
1747
|
+
const instruction = new ProcessingInstruction(node.name, node.data);
|
|
1748
|
+
if (node["x-name"] != null) {
|
|
1749
|
+
instruction["x-name"] = node["x-name"];
|
|
1750
|
+
instruction["x-publicId"] = node["x-publicId"];
|
|
1751
|
+
instruction["x-systemId"] = node["x-systemId"];
|
|
1752
|
+
}
|
|
1753
|
+
result = instruction;
|
|
1754
|
+
} else {
|
|
1755
|
+
throw new Error(`Not implemented yet: ${node.type}`);
|
|
1756
|
+
}
|
|
1757
|
+
result.startIndex = node.startIndex;
|
|
1758
|
+
result.endIndex = node.endIndex;
|
|
1759
|
+
if (node.sourceCodeLocation != null) {
|
|
1760
|
+
result.sourceCodeLocation = node.sourceCodeLocation;
|
|
1761
|
+
}
|
|
1762
|
+
return result;
|
|
1763
|
+
}
|
|
1764
|
+
function cloneChildren(childs) {
|
|
1765
|
+
const children = childs.map((child) => cloneNode(child, true));
|
|
1766
|
+
for (let i = 1;i < children.length; i++) {
|
|
1767
|
+
children[i].prev = children[i - 1];
|
|
1768
|
+
children[i - 1].next = children[i];
|
|
1769
|
+
}
|
|
1770
|
+
return children;
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1773
|
+
// ../../node_modules/.pnpm/domhandler@5.0.3/node_modules/domhandler/lib/esm/index.js
|
|
1774
|
+
var defaultOpts = {
|
|
1775
|
+
withStartIndices: false,
|
|
1776
|
+
withEndIndices: false,
|
|
1777
|
+
xmlMode: false
|
|
1778
|
+
};
|
|
1779
|
+
|
|
1780
|
+
class DomHandler {
|
|
1781
|
+
constructor(callback, options, elementCB) {
|
|
1782
|
+
this.dom = [];
|
|
1783
|
+
this.root = new Document(this.dom);
|
|
1784
|
+
this.done = false;
|
|
1785
|
+
this.tagStack = [this.root];
|
|
1786
|
+
this.lastNode = null;
|
|
1787
|
+
this.parser = null;
|
|
1788
|
+
if (typeof options === "function") {
|
|
1789
|
+
elementCB = options;
|
|
1790
|
+
options = defaultOpts;
|
|
1791
|
+
}
|
|
1792
|
+
if (typeof callback === "object") {
|
|
1793
|
+
options = callback;
|
|
1794
|
+
callback = undefined;
|
|
1795
|
+
}
|
|
1796
|
+
this.callback = callback !== null && callback !== undefined ? callback : null;
|
|
1797
|
+
this.options = options !== null && options !== undefined ? options : defaultOpts;
|
|
1798
|
+
this.elementCB = elementCB !== null && elementCB !== undefined ? elementCB : null;
|
|
1799
|
+
}
|
|
1800
|
+
onparserinit(parser) {
|
|
1801
|
+
this.parser = parser;
|
|
1802
|
+
}
|
|
1803
|
+
onreset() {
|
|
1804
|
+
this.dom = [];
|
|
1805
|
+
this.root = new Document(this.dom);
|
|
1806
|
+
this.done = false;
|
|
1807
|
+
this.tagStack = [this.root];
|
|
1808
|
+
this.lastNode = null;
|
|
1809
|
+
this.parser = null;
|
|
1810
|
+
}
|
|
1811
|
+
onend() {
|
|
1812
|
+
if (this.done)
|
|
1813
|
+
return;
|
|
1814
|
+
this.done = true;
|
|
1815
|
+
this.parser = null;
|
|
1816
|
+
this.handleCallback(null);
|
|
1817
|
+
}
|
|
1818
|
+
onerror(error) {
|
|
1819
|
+
this.handleCallback(error);
|
|
1820
|
+
}
|
|
1821
|
+
onclosetag() {
|
|
1822
|
+
this.lastNode = null;
|
|
1823
|
+
const elem = this.tagStack.pop();
|
|
1824
|
+
if (this.options.withEndIndices) {
|
|
1825
|
+
elem.endIndex = this.parser.endIndex;
|
|
1826
|
+
}
|
|
1827
|
+
if (this.elementCB)
|
|
1828
|
+
this.elementCB(elem);
|
|
1829
|
+
}
|
|
1830
|
+
onopentag(name, attribs) {
|
|
1831
|
+
const type = this.options.xmlMode ? ElementType.Tag : undefined;
|
|
1832
|
+
const element = new Element(name, attribs, undefined, type);
|
|
1833
|
+
this.addNode(element);
|
|
1834
|
+
this.tagStack.push(element);
|
|
1835
|
+
}
|
|
1836
|
+
ontext(data) {
|
|
1837
|
+
const { lastNode } = this;
|
|
1838
|
+
if (lastNode && lastNode.type === ElementType.Text) {
|
|
1839
|
+
lastNode.data += data;
|
|
1840
|
+
if (this.options.withEndIndices) {
|
|
1841
|
+
lastNode.endIndex = this.parser.endIndex;
|
|
1842
|
+
}
|
|
1843
|
+
} else {
|
|
1844
|
+
const node2 = new Text2(data);
|
|
1845
|
+
this.addNode(node2);
|
|
1846
|
+
this.lastNode = node2;
|
|
1847
|
+
}
|
|
1848
|
+
}
|
|
1849
|
+
oncomment(data) {
|
|
1850
|
+
if (this.lastNode && this.lastNode.type === ElementType.Comment) {
|
|
1851
|
+
this.lastNode.data += data;
|
|
1852
|
+
return;
|
|
1853
|
+
}
|
|
1854
|
+
const node2 = new Comment2(data);
|
|
1855
|
+
this.addNode(node2);
|
|
1856
|
+
this.lastNode = node2;
|
|
1857
|
+
}
|
|
1858
|
+
oncommentend() {
|
|
1859
|
+
this.lastNode = null;
|
|
1860
|
+
}
|
|
1861
|
+
oncdatastart() {
|
|
1862
|
+
const text = new Text2("");
|
|
1863
|
+
const node2 = new CDATA2([text]);
|
|
1864
|
+
this.addNode(node2);
|
|
1865
|
+
text.parent = node2;
|
|
1866
|
+
this.lastNode = text;
|
|
1867
|
+
}
|
|
1868
|
+
oncdataend() {
|
|
1869
|
+
this.lastNode = null;
|
|
1870
|
+
}
|
|
1871
|
+
onprocessinginstruction(name, data) {
|
|
1872
|
+
const node2 = new ProcessingInstruction(name, data);
|
|
1873
|
+
this.addNode(node2);
|
|
1874
|
+
}
|
|
1875
|
+
handleCallback(error) {
|
|
1876
|
+
if (typeof this.callback === "function") {
|
|
1877
|
+
this.callback(error, this.dom);
|
|
1878
|
+
} else if (error) {
|
|
1879
|
+
throw error;
|
|
1880
|
+
}
|
|
1881
|
+
}
|
|
1882
|
+
addNode(node2) {
|
|
1883
|
+
const parent = this.tagStack[this.tagStack.length - 1];
|
|
1884
|
+
const previousSibling = parent.children[parent.children.length - 1];
|
|
1885
|
+
if (this.options.withStartIndices) {
|
|
1886
|
+
node2.startIndex = this.parser.startIndex;
|
|
1887
|
+
}
|
|
1888
|
+
if (this.options.withEndIndices) {
|
|
1889
|
+
node2.endIndex = this.parser.endIndex;
|
|
1890
|
+
}
|
|
1891
|
+
parent.children.push(node2);
|
|
1892
|
+
if (previousSibling) {
|
|
1893
|
+
node2.prev = previousSibling;
|
|
1894
|
+
previousSibling.next = node2;
|
|
1895
|
+
}
|
|
1896
|
+
node2.parent = parent;
|
|
1897
|
+
this.lastNode = null;
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
// ../../node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/index.js
|
|
1901
|
+
var exports_esm2 = {};
|
|
1902
|
+
__export(exports_esm2, {
|
|
1903
|
+
uniqueSort: () => uniqueSort,
|
|
1904
|
+
textContent: () => textContent,
|
|
1905
|
+
testElement: () => testElement,
|
|
1906
|
+
replaceElement: () => replaceElement,
|
|
1907
|
+
removeSubsets: () => removeSubsets,
|
|
1908
|
+
removeElement: () => removeElement,
|
|
1909
|
+
prevElementSibling: () => prevElementSibling,
|
|
1910
|
+
prependChild: () => prependChild,
|
|
1911
|
+
prepend: () => prepend,
|
|
1912
|
+
nextElementSibling: () => nextElementSibling,
|
|
1913
|
+
isText: () => isText,
|
|
1914
|
+
isTag: () => isTag2,
|
|
1915
|
+
isDocument: () => isDocument,
|
|
1916
|
+
isComment: () => isComment,
|
|
1917
|
+
isCDATA: () => isCDATA,
|
|
1918
|
+
innerText: () => innerText,
|
|
1919
|
+
hasChildren: () => hasChildren,
|
|
1920
|
+
hasAttrib: () => hasAttrib,
|
|
1921
|
+
getText: () => getText,
|
|
1922
|
+
getSiblings: () => getSiblings,
|
|
1923
|
+
getParent: () => getParent,
|
|
1924
|
+
getOuterHTML: () => getOuterHTML,
|
|
1925
|
+
getName: () => getName,
|
|
1926
|
+
getInnerHTML: () => getInnerHTML,
|
|
1927
|
+
getFeed: () => getFeed,
|
|
1928
|
+
getElementsByTagType: () => getElementsByTagType,
|
|
1929
|
+
getElementsByTagName: () => getElementsByTagName,
|
|
1930
|
+
getElementsByClassName: () => getElementsByClassName,
|
|
1931
|
+
getElements: () => getElements,
|
|
1932
|
+
getElementById: () => getElementById,
|
|
1933
|
+
getChildren: () => getChildren,
|
|
1934
|
+
getAttributeValue: () => getAttributeValue,
|
|
1935
|
+
findOneChild: () => findOneChild,
|
|
1936
|
+
findOne: () => findOne,
|
|
1937
|
+
findAll: () => findAll,
|
|
1938
|
+
find: () => find,
|
|
1939
|
+
filter: () => filter,
|
|
1940
|
+
existsOne: () => existsOne,
|
|
1941
|
+
compareDocumentPosition: () => compareDocumentPosition,
|
|
1942
|
+
appendChild: () => appendChild,
|
|
1943
|
+
append: () => append,
|
|
1944
|
+
DocumentPosition: () => DocumentPosition
|
|
1945
|
+
});
|
|
1946
|
+
|
|
1947
|
+
// ../../node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/escape.js
|
|
1948
|
+
var xmlReplacer = /["&'<>$\x80-\uFFFF]/g;
|
|
1949
|
+
var xmlCodeMap = new Map([
|
|
1950
|
+
[34, """],
|
|
1951
|
+
[38, "&"],
|
|
1952
|
+
[39, "'"],
|
|
1953
|
+
[60, "<"],
|
|
1954
|
+
[62, ">"]
|
|
1955
|
+
]);
|
|
1956
|
+
var getCodePoint = String.prototype.codePointAt != null ? (str, index) => str.codePointAt(index) : (c, index) => (c.charCodeAt(index) & 64512) === 55296 ? (c.charCodeAt(index) - 55296) * 1024 + c.charCodeAt(index + 1) - 56320 + 65536 : c.charCodeAt(index);
|
|
1957
|
+
function encodeXML(str) {
|
|
1958
|
+
let ret = "";
|
|
1959
|
+
let lastIdx = 0;
|
|
1960
|
+
let match;
|
|
1961
|
+
while ((match = xmlReplacer.exec(str)) !== null) {
|
|
1962
|
+
const i = match.index;
|
|
1963
|
+
const char = str.charCodeAt(i);
|
|
1964
|
+
const next = xmlCodeMap.get(char);
|
|
1965
|
+
if (next !== undefined) {
|
|
1966
|
+
ret += str.substring(lastIdx, i) + next;
|
|
1967
|
+
lastIdx = i + 1;
|
|
1968
|
+
} else {
|
|
1969
|
+
ret += `${str.substring(lastIdx, i)}&#x${getCodePoint(str, i).toString(16)};`;
|
|
1970
|
+
lastIdx = xmlReplacer.lastIndex += Number((char & 64512) === 55296);
|
|
1971
|
+
}
|
|
1972
|
+
}
|
|
1973
|
+
return ret + str.substr(lastIdx);
|
|
1974
|
+
}
|
|
1975
|
+
function getEscaper(regex, map) {
|
|
1976
|
+
return function escape(data) {
|
|
1977
|
+
let match;
|
|
1978
|
+
let lastIdx = 0;
|
|
1979
|
+
let result = "";
|
|
1980
|
+
while (match = regex.exec(data)) {
|
|
1981
|
+
if (lastIdx !== match.index) {
|
|
1982
|
+
result += data.substring(lastIdx, match.index);
|
|
1983
|
+
}
|
|
1984
|
+
result += map.get(match[0].charCodeAt(0));
|
|
1985
|
+
lastIdx = match.index + 1;
|
|
1986
|
+
}
|
|
1987
|
+
return result + data.substring(lastIdx);
|
|
1988
|
+
};
|
|
1989
|
+
}
|
|
1990
|
+
var escapeUTF8 = getEscaper(/[&<>'"]/g, xmlCodeMap);
|
|
1991
|
+
var escapeAttribute = getEscaper(/["&\u00A0]/g, new Map([
|
|
1992
|
+
[34, """],
|
|
1993
|
+
[38, "&"],
|
|
1994
|
+
[160, " "]
|
|
1995
|
+
]));
|
|
1996
|
+
var escapeText = getEscaper(/[&<>\u00A0]/g, new Map([
|
|
1997
|
+
[38, "&"],
|
|
1998
|
+
[60, "<"],
|
|
1999
|
+
[62, ">"],
|
|
2000
|
+
[160, " "]
|
|
2001
|
+
]));
|
|
2002
|
+
// ../../node_modules/.pnpm/entities@4.5.0/node_modules/entities/lib/esm/index.js
|
|
2003
|
+
var EntityLevel;
|
|
2004
|
+
(function(EntityLevel2) {
|
|
2005
|
+
EntityLevel2[EntityLevel2["XML"] = 0] = "XML";
|
|
2006
|
+
EntityLevel2[EntityLevel2["HTML"] = 1] = "HTML";
|
|
2007
|
+
})(EntityLevel || (EntityLevel = {}));
|
|
2008
|
+
var EncodingMode;
|
|
2009
|
+
(function(EncodingMode2) {
|
|
2010
|
+
EncodingMode2[EncodingMode2["UTF8"] = 0] = "UTF8";
|
|
2011
|
+
EncodingMode2[EncodingMode2["ASCII"] = 1] = "ASCII";
|
|
2012
|
+
EncodingMode2[EncodingMode2["Extensive"] = 2] = "Extensive";
|
|
2013
|
+
EncodingMode2[EncodingMode2["Attribute"] = 3] = "Attribute";
|
|
2014
|
+
EncodingMode2[EncodingMode2["Text"] = 4] = "Text";
|
|
2015
|
+
})(EncodingMode || (EncodingMode = {}));
|
|
2016
|
+
|
|
2017
|
+
// ../../node_modules/.pnpm/dom-serializer@2.0.0/node_modules/dom-serializer/lib/esm/foreignNames.js
|
|
2018
|
+
var elementNames = new Map([
|
|
2019
|
+
"altGlyph",
|
|
2020
|
+
"altGlyphDef",
|
|
2021
|
+
"altGlyphItem",
|
|
2022
|
+
"animateColor",
|
|
2023
|
+
"animateMotion",
|
|
2024
|
+
"animateTransform",
|
|
2025
|
+
"clipPath",
|
|
2026
|
+
"feBlend",
|
|
2027
|
+
"feColorMatrix",
|
|
2028
|
+
"feComponentTransfer",
|
|
2029
|
+
"feComposite",
|
|
2030
|
+
"feConvolveMatrix",
|
|
2031
|
+
"feDiffuseLighting",
|
|
2032
|
+
"feDisplacementMap",
|
|
2033
|
+
"feDistantLight",
|
|
2034
|
+
"feDropShadow",
|
|
2035
|
+
"feFlood",
|
|
2036
|
+
"feFuncA",
|
|
2037
|
+
"feFuncB",
|
|
2038
|
+
"feFuncG",
|
|
2039
|
+
"feFuncR",
|
|
2040
|
+
"feGaussianBlur",
|
|
2041
|
+
"feImage",
|
|
2042
|
+
"feMerge",
|
|
2043
|
+
"feMergeNode",
|
|
2044
|
+
"feMorphology",
|
|
2045
|
+
"feOffset",
|
|
2046
|
+
"fePointLight",
|
|
2047
|
+
"feSpecularLighting",
|
|
2048
|
+
"feSpotLight",
|
|
2049
|
+
"feTile",
|
|
2050
|
+
"feTurbulence",
|
|
2051
|
+
"foreignObject",
|
|
2052
|
+
"glyphRef",
|
|
2053
|
+
"linearGradient",
|
|
2054
|
+
"radialGradient",
|
|
2055
|
+
"textPath"
|
|
2056
|
+
].map((val) => [val.toLowerCase(), val]));
|
|
2057
|
+
var attributeNames = new Map([
|
|
2058
|
+
"definitionURL",
|
|
2059
|
+
"attributeName",
|
|
2060
|
+
"attributeType",
|
|
2061
|
+
"baseFrequency",
|
|
2062
|
+
"baseProfile",
|
|
2063
|
+
"calcMode",
|
|
2064
|
+
"clipPathUnits",
|
|
2065
|
+
"diffuseConstant",
|
|
2066
|
+
"edgeMode",
|
|
2067
|
+
"filterUnits",
|
|
2068
|
+
"glyphRef",
|
|
2069
|
+
"gradientTransform",
|
|
2070
|
+
"gradientUnits",
|
|
2071
|
+
"kernelMatrix",
|
|
2072
|
+
"kernelUnitLength",
|
|
2073
|
+
"keyPoints",
|
|
2074
|
+
"keySplines",
|
|
2075
|
+
"keyTimes",
|
|
2076
|
+
"lengthAdjust",
|
|
2077
|
+
"limitingConeAngle",
|
|
2078
|
+
"markerHeight",
|
|
2079
|
+
"markerUnits",
|
|
2080
|
+
"markerWidth",
|
|
2081
|
+
"maskContentUnits",
|
|
2082
|
+
"maskUnits",
|
|
2083
|
+
"numOctaves",
|
|
2084
|
+
"pathLength",
|
|
2085
|
+
"patternContentUnits",
|
|
2086
|
+
"patternTransform",
|
|
2087
|
+
"patternUnits",
|
|
2088
|
+
"pointsAtX",
|
|
2089
|
+
"pointsAtY",
|
|
2090
|
+
"pointsAtZ",
|
|
2091
|
+
"preserveAlpha",
|
|
2092
|
+
"preserveAspectRatio",
|
|
2093
|
+
"primitiveUnits",
|
|
2094
|
+
"refX",
|
|
2095
|
+
"refY",
|
|
2096
|
+
"repeatCount",
|
|
2097
|
+
"repeatDur",
|
|
2098
|
+
"requiredExtensions",
|
|
2099
|
+
"requiredFeatures",
|
|
2100
|
+
"specularConstant",
|
|
2101
|
+
"specularExponent",
|
|
2102
|
+
"spreadMethod",
|
|
2103
|
+
"startOffset",
|
|
2104
|
+
"stdDeviation",
|
|
2105
|
+
"stitchTiles",
|
|
2106
|
+
"surfaceScale",
|
|
2107
|
+
"systemLanguage",
|
|
2108
|
+
"tableValues",
|
|
2109
|
+
"targetX",
|
|
2110
|
+
"targetY",
|
|
2111
|
+
"textLength",
|
|
2112
|
+
"viewBox",
|
|
2113
|
+
"viewTarget",
|
|
2114
|
+
"xChannelSelector",
|
|
2115
|
+
"yChannelSelector",
|
|
2116
|
+
"zoomAndPan"
|
|
2117
|
+
].map((val) => [val.toLowerCase(), val]));
|
|
2118
|
+
|
|
2119
|
+
// ../../node_modules/.pnpm/dom-serializer@2.0.0/node_modules/dom-serializer/lib/esm/index.js
|
|
2120
|
+
var unencodedElements = new Set([
|
|
2121
|
+
"style",
|
|
2122
|
+
"script",
|
|
2123
|
+
"xmp",
|
|
2124
|
+
"iframe",
|
|
2125
|
+
"noembed",
|
|
2126
|
+
"noframes",
|
|
2127
|
+
"plaintext",
|
|
2128
|
+
"noscript"
|
|
2129
|
+
]);
|
|
2130
|
+
function replaceQuotes(value) {
|
|
2131
|
+
return value.replace(/"/g, """);
|
|
2132
|
+
}
|
|
2133
|
+
function formatAttributes(attributes, opts) {
|
|
2134
|
+
var _a2;
|
|
2135
|
+
if (!attributes)
|
|
2136
|
+
return;
|
|
2137
|
+
const encode = ((_a2 = opts.encodeEntities) !== null && _a2 !== undefined ? _a2 : opts.decodeEntities) === false ? replaceQuotes : opts.xmlMode || opts.encodeEntities !== "utf8" ? encodeXML : escapeAttribute;
|
|
2138
|
+
return Object.keys(attributes).map((key) => {
|
|
2139
|
+
var _a3, _b;
|
|
2140
|
+
const value = (_a3 = attributes[key]) !== null && _a3 !== undefined ? _a3 : "";
|
|
2141
|
+
if (opts.xmlMode === "foreign") {
|
|
2142
|
+
key = (_b = attributeNames.get(key)) !== null && _b !== undefined ? _b : key;
|
|
2143
|
+
}
|
|
2144
|
+
if (!opts.emptyAttrs && !opts.xmlMode && value === "") {
|
|
2145
|
+
return key;
|
|
2146
|
+
}
|
|
2147
|
+
return `${key}="${encode(value)}"`;
|
|
2148
|
+
}).join(" ");
|
|
2149
|
+
}
|
|
2150
|
+
var singleTag = new Set([
|
|
2151
|
+
"area",
|
|
2152
|
+
"base",
|
|
2153
|
+
"basefont",
|
|
2154
|
+
"br",
|
|
2155
|
+
"col",
|
|
2156
|
+
"command",
|
|
2157
|
+
"embed",
|
|
2158
|
+
"frame",
|
|
2159
|
+
"hr",
|
|
2160
|
+
"img",
|
|
2161
|
+
"input",
|
|
2162
|
+
"isindex",
|
|
2163
|
+
"keygen",
|
|
2164
|
+
"link",
|
|
2165
|
+
"meta",
|
|
2166
|
+
"param",
|
|
2167
|
+
"source",
|
|
2168
|
+
"track",
|
|
2169
|
+
"wbr"
|
|
2170
|
+
]);
|
|
2171
|
+
function render(node2, options = {}) {
|
|
2172
|
+
const nodes = "length" in node2 ? node2 : [node2];
|
|
2173
|
+
let output = "";
|
|
2174
|
+
for (let i = 0;i < nodes.length; i++) {
|
|
2175
|
+
output += renderNode(nodes[i], options);
|
|
2176
|
+
}
|
|
2177
|
+
return output;
|
|
2178
|
+
}
|
|
2179
|
+
var esm_default = render;
|
|
2180
|
+
function renderNode(node2, options) {
|
|
2181
|
+
switch (node2.type) {
|
|
2182
|
+
case Root:
|
|
2183
|
+
return render(node2.children, options);
|
|
2184
|
+
case Doctype:
|
|
2185
|
+
case Directive:
|
|
2186
|
+
return renderDirective(node2);
|
|
2187
|
+
case Comment:
|
|
2188
|
+
return renderComment(node2);
|
|
2189
|
+
case CDATA:
|
|
2190
|
+
return renderCdata(node2);
|
|
2191
|
+
case Script:
|
|
2192
|
+
case Style:
|
|
2193
|
+
case Tag:
|
|
2194
|
+
return renderTag(node2, options);
|
|
2195
|
+
case Text:
|
|
2196
|
+
return renderText(node2, options);
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
var foreignModeIntegrationPoints = new Set([
|
|
2200
|
+
"mi",
|
|
2201
|
+
"mo",
|
|
2202
|
+
"mn",
|
|
2203
|
+
"ms",
|
|
2204
|
+
"mtext",
|
|
2205
|
+
"annotation-xml",
|
|
2206
|
+
"foreignObject",
|
|
2207
|
+
"desc",
|
|
2208
|
+
"title"
|
|
2209
|
+
]);
|
|
2210
|
+
var foreignElements = new Set(["svg", "math"]);
|
|
2211
|
+
function renderTag(elem, opts) {
|
|
2212
|
+
var _a2;
|
|
2213
|
+
if (opts.xmlMode === "foreign") {
|
|
2214
|
+
elem.name = (_a2 = elementNames.get(elem.name)) !== null && _a2 !== undefined ? _a2 : elem.name;
|
|
2215
|
+
if (elem.parent && foreignModeIntegrationPoints.has(elem.parent.name)) {
|
|
2216
|
+
opts = { ...opts, xmlMode: false };
|
|
2217
|
+
}
|
|
2218
|
+
}
|
|
2219
|
+
if (!opts.xmlMode && foreignElements.has(elem.name)) {
|
|
2220
|
+
opts = { ...opts, xmlMode: "foreign" };
|
|
2221
|
+
}
|
|
2222
|
+
let tag = `<${elem.name}`;
|
|
2223
|
+
const attribs = formatAttributes(elem.attribs, opts);
|
|
2224
|
+
if (attribs) {
|
|
2225
|
+
tag += ` ${attribs}`;
|
|
2226
|
+
}
|
|
2227
|
+
if (elem.children.length === 0 && (opts.xmlMode ? opts.selfClosingTags !== false : opts.selfClosingTags && singleTag.has(elem.name))) {
|
|
2228
|
+
if (!opts.xmlMode)
|
|
2229
|
+
tag += " ";
|
|
2230
|
+
tag += "/>";
|
|
2231
|
+
} else {
|
|
2232
|
+
tag += ">";
|
|
2233
|
+
if (elem.children.length > 0) {
|
|
2234
|
+
tag += render(elem.children, opts);
|
|
2235
|
+
}
|
|
2236
|
+
if (opts.xmlMode || !singleTag.has(elem.name)) {
|
|
2237
|
+
tag += `</${elem.name}>`;
|
|
2238
|
+
}
|
|
2239
|
+
}
|
|
2240
|
+
return tag;
|
|
2241
|
+
}
|
|
2242
|
+
function renderDirective(elem) {
|
|
2243
|
+
return `<${elem.data}>`;
|
|
2244
|
+
}
|
|
2245
|
+
function renderText(elem, opts) {
|
|
2246
|
+
var _a2;
|
|
2247
|
+
let data = elem.data || "";
|
|
2248
|
+
if (((_a2 = opts.encodeEntities) !== null && _a2 !== undefined ? _a2 : opts.decodeEntities) !== false && !(!opts.xmlMode && elem.parent && unencodedElements.has(elem.parent.name))) {
|
|
2249
|
+
data = opts.xmlMode || opts.encodeEntities !== "utf8" ? encodeXML(data) : escapeText(data);
|
|
2250
|
+
}
|
|
2251
|
+
return data;
|
|
2252
|
+
}
|
|
2253
|
+
function renderCdata(elem) {
|
|
2254
|
+
return `<![CDATA[${elem.children[0].data}]]>`;
|
|
2255
|
+
}
|
|
2256
|
+
function renderComment(elem) {
|
|
2257
|
+
return `<!--${elem.data}-->`;
|
|
2258
|
+
}
|
|
2259
|
+
|
|
2260
|
+
// ../../node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/stringify.js
|
|
2261
|
+
function getOuterHTML(node2, options) {
|
|
2262
|
+
return esm_default(node2, options);
|
|
2263
|
+
}
|
|
2264
|
+
function getInnerHTML(node2, options) {
|
|
2265
|
+
return hasChildren(node2) ? node2.children.map((node3) => getOuterHTML(node3, options)).join("") : "";
|
|
2266
|
+
}
|
|
2267
|
+
function getText(node2) {
|
|
2268
|
+
if (Array.isArray(node2))
|
|
2269
|
+
return node2.map(getText).join("");
|
|
2270
|
+
if (isTag2(node2))
|
|
2271
|
+
return node2.name === "br" ? `
|
|
2272
|
+
` : getText(node2.children);
|
|
2273
|
+
if (isCDATA(node2))
|
|
2274
|
+
return getText(node2.children);
|
|
2275
|
+
if (isText(node2))
|
|
2276
|
+
return node2.data;
|
|
2277
|
+
return "";
|
|
2278
|
+
}
|
|
2279
|
+
function textContent(node2) {
|
|
2280
|
+
if (Array.isArray(node2))
|
|
2281
|
+
return node2.map(textContent).join("");
|
|
2282
|
+
if (hasChildren(node2) && !isComment(node2)) {
|
|
2283
|
+
return textContent(node2.children);
|
|
2284
|
+
}
|
|
2285
|
+
if (isText(node2))
|
|
2286
|
+
return node2.data;
|
|
2287
|
+
return "";
|
|
2288
|
+
}
|
|
2289
|
+
function innerText(node2) {
|
|
2290
|
+
if (Array.isArray(node2))
|
|
2291
|
+
return node2.map(innerText).join("");
|
|
2292
|
+
if (hasChildren(node2) && (node2.type === ElementType.Tag || isCDATA(node2))) {
|
|
2293
|
+
return innerText(node2.children);
|
|
2294
|
+
}
|
|
2295
|
+
if (isText(node2))
|
|
2296
|
+
return node2.data;
|
|
2297
|
+
return "";
|
|
2298
|
+
}
|
|
2299
|
+
// ../../node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/traversal.js
|
|
2300
|
+
function getChildren(elem) {
|
|
2301
|
+
return hasChildren(elem) ? elem.children : [];
|
|
2302
|
+
}
|
|
2303
|
+
function getParent(elem) {
|
|
2304
|
+
return elem.parent || null;
|
|
2305
|
+
}
|
|
2306
|
+
function getSiblings(elem) {
|
|
2307
|
+
const parent = getParent(elem);
|
|
2308
|
+
if (parent != null)
|
|
2309
|
+
return getChildren(parent);
|
|
2310
|
+
const siblings = [elem];
|
|
2311
|
+
let { prev, next } = elem;
|
|
2312
|
+
while (prev != null) {
|
|
2313
|
+
siblings.unshift(prev);
|
|
2314
|
+
({ prev } = prev);
|
|
2315
|
+
}
|
|
2316
|
+
while (next != null) {
|
|
2317
|
+
siblings.push(next);
|
|
2318
|
+
({ next } = next);
|
|
2319
|
+
}
|
|
2320
|
+
return siblings;
|
|
2321
|
+
}
|
|
2322
|
+
function getAttributeValue(elem, name) {
|
|
2323
|
+
var _a2;
|
|
2324
|
+
return (_a2 = elem.attribs) === null || _a2 === undefined ? undefined : _a2[name];
|
|
2325
|
+
}
|
|
2326
|
+
function hasAttrib(elem, name) {
|
|
2327
|
+
return elem.attribs != null && Object.prototype.hasOwnProperty.call(elem.attribs, name) && elem.attribs[name] != null;
|
|
2328
|
+
}
|
|
2329
|
+
function getName(elem) {
|
|
2330
|
+
return elem.name;
|
|
2331
|
+
}
|
|
2332
|
+
function nextElementSibling(elem) {
|
|
2333
|
+
let { next } = elem;
|
|
2334
|
+
while (next !== null && !isTag2(next))
|
|
2335
|
+
({ next } = next);
|
|
2336
|
+
return next;
|
|
2337
|
+
}
|
|
2338
|
+
function prevElementSibling(elem) {
|
|
2339
|
+
let { prev } = elem;
|
|
2340
|
+
while (prev !== null && !isTag2(prev))
|
|
2341
|
+
({ prev } = prev);
|
|
2342
|
+
return prev;
|
|
2343
|
+
}
|
|
2344
|
+
// ../../node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/manipulation.js
|
|
2345
|
+
function removeElement(elem) {
|
|
2346
|
+
if (elem.prev)
|
|
2347
|
+
elem.prev.next = elem.next;
|
|
2348
|
+
if (elem.next)
|
|
2349
|
+
elem.next.prev = elem.prev;
|
|
2350
|
+
if (elem.parent) {
|
|
2351
|
+
const childs = elem.parent.children;
|
|
2352
|
+
const childsIndex = childs.lastIndexOf(elem);
|
|
2353
|
+
if (childsIndex >= 0) {
|
|
2354
|
+
childs.splice(childsIndex, 1);
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
elem.next = null;
|
|
2358
|
+
elem.prev = null;
|
|
2359
|
+
elem.parent = null;
|
|
2360
|
+
}
|
|
2361
|
+
function replaceElement(elem, replacement) {
|
|
2362
|
+
const prev = replacement.prev = elem.prev;
|
|
2363
|
+
if (prev) {
|
|
2364
|
+
prev.next = replacement;
|
|
2365
|
+
}
|
|
2366
|
+
const next = replacement.next = elem.next;
|
|
2367
|
+
if (next) {
|
|
2368
|
+
next.prev = replacement;
|
|
2369
|
+
}
|
|
2370
|
+
const parent = replacement.parent = elem.parent;
|
|
2371
|
+
if (parent) {
|
|
2372
|
+
const childs = parent.children;
|
|
2373
|
+
childs[childs.lastIndexOf(elem)] = replacement;
|
|
2374
|
+
elem.parent = null;
|
|
2375
|
+
}
|
|
2376
|
+
}
|
|
2377
|
+
function appendChild(parent, child) {
|
|
2378
|
+
removeElement(child);
|
|
2379
|
+
child.next = null;
|
|
2380
|
+
child.parent = parent;
|
|
2381
|
+
if (parent.children.push(child) > 1) {
|
|
2382
|
+
const sibling = parent.children[parent.children.length - 2];
|
|
2383
|
+
sibling.next = child;
|
|
2384
|
+
child.prev = sibling;
|
|
2385
|
+
} else {
|
|
2386
|
+
child.prev = null;
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
function append(elem, next) {
|
|
2390
|
+
removeElement(next);
|
|
2391
|
+
const { parent } = elem;
|
|
2392
|
+
const currNext = elem.next;
|
|
2393
|
+
next.next = currNext;
|
|
2394
|
+
next.prev = elem;
|
|
2395
|
+
elem.next = next;
|
|
2396
|
+
next.parent = parent;
|
|
2397
|
+
if (currNext) {
|
|
2398
|
+
currNext.prev = next;
|
|
2399
|
+
if (parent) {
|
|
2400
|
+
const childs = parent.children;
|
|
2401
|
+
childs.splice(childs.lastIndexOf(currNext), 0, next);
|
|
2402
|
+
}
|
|
2403
|
+
} else if (parent) {
|
|
2404
|
+
parent.children.push(next);
|
|
2405
|
+
}
|
|
2406
|
+
}
|
|
2407
|
+
function prependChild(parent, child) {
|
|
2408
|
+
removeElement(child);
|
|
2409
|
+
child.parent = parent;
|
|
2410
|
+
child.prev = null;
|
|
2411
|
+
if (parent.children.unshift(child) !== 1) {
|
|
2412
|
+
const sibling = parent.children[1];
|
|
2413
|
+
sibling.prev = child;
|
|
2414
|
+
child.next = sibling;
|
|
2415
|
+
} else {
|
|
2416
|
+
child.next = null;
|
|
2417
|
+
}
|
|
2418
|
+
}
|
|
2419
|
+
function prepend(elem, prev) {
|
|
2420
|
+
removeElement(prev);
|
|
2421
|
+
const { parent } = elem;
|
|
2422
|
+
if (parent) {
|
|
2423
|
+
const childs = parent.children;
|
|
2424
|
+
childs.splice(childs.indexOf(elem), 0, prev);
|
|
2425
|
+
}
|
|
2426
|
+
if (elem.prev) {
|
|
2427
|
+
elem.prev.next = prev;
|
|
2428
|
+
}
|
|
2429
|
+
prev.parent = parent;
|
|
2430
|
+
prev.prev = elem.prev;
|
|
2431
|
+
prev.next = elem;
|
|
2432
|
+
elem.prev = prev;
|
|
2433
|
+
}
|
|
2434
|
+
// ../../node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/querying.js
|
|
2435
|
+
function filter(test, node2, recurse = true, limit = Infinity) {
|
|
2436
|
+
return find(test, Array.isArray(node2) ? node2 : [node2], recurse, limit);
|
|
2437
|
+
}
|
|
2438
|
+
function find(test, nodes, recurse, limit) {
|
|
2439
|
+
const result = [];
|
|
2440
|
+
const nodeStack = [Array.isArray(nodes) ? nodes : [nodes]];
|
|
2441
|
+
const indexStack = [0];
|
|
2442
|
+
for (;; ) {
|
|
2443
|
+
if (indexStack[0] >= nodeStack[0].length) {
|
|
2444
|
+
if (indexStack.length === 1) {
|
|
2445
|
+
return result;
|
|
2446
|
+
}
|
|
2447
|
+
nodeStack.shift();
|
|
2448
|
+
indexStack.shift();
|
|
2449
|
+
continue;
|
|
2450
|
+
}
|
|
2451
|
+
const elem = nodeStack[0][indexStack[0]++];
|
|
2452
|
+
if (test(elem)) {
|
|
2453
|
+
result.push(elem);
|
|
2454
|
+
if (--limit <= 0)
|
|
2455
|
+
return result;
|
|
2456
|
+
}
|
|
2457
|
+
if (recurse && hasChildren(elem) && elem.children.length > 0) {
|
|
2458
|
+
indexStack.unshift(0);
|
|
2459
|
+
nodeStack.unshift(elem.children);
|
|
2460
|
+
}
|
|
2461
|
+
}
|
|
2462
|
+
}
|
|
2463
|
+
function findOneChild(test, nodes) {
|
|
2464
|
+
return nodes.find(test);
|
|
2465
|
+
}
|
|
2466
|
+
function findOne(test, nodes, recurse = true) {
|
|
2467
|
+
const searchedNodes = Array.isArray(nodes) ? nodes : [nodes];
|
|
2468
|
+
for (let i = 0;i < searchedNodes.length; i++) {
|
|
2469
|
+
const node2 = searchedNodes[i];
|
|
2470
|
+
if (isTag2(node2) && test(node2)) {
|
|
2471
|
+
return node2;
|
|
2472
|
+
}
|
|
2473
|
+
if (recurse && hasChildren(node2) && node2.children.length > 0) {
|
|
2474
|
+
const found = findOne(test, node2.children, true);
|
|
2475
|
+
if (found)
|
|
2476
|
+
return found;
|
|
2477
|
+
}
|
|
2478
|
+
}
|
|
2479
|
+
return null;
|
|
2480
|
+
}
|
|
2481
|
+
function existsOne(test, nodes) {
|
|
2482
|
+
return (Array.isArray(nodes) ? nodes : [nodes]).some((node2) => isTag2(node2) && test(node2) || hasChildren(node2) && existsOne(test, node2.children));
|
|
2483
|
+
}
|
|
2484
|
+
function findAll(test, nodes) {
|
|
2485
|
+
const result = [];
|
|
2486
|
+
const nodeStack = [Array.isArray(nodes) ? nodes : [nodes]];
|
|
2487
|
+
const indexStack = [0];
|
|
2488
|
+
for (;; ) {
|
|
2489
|
+
if (indexStack[0] >= nodeStack[0].length) {
|
|
2490
|
+
if (nodeStack.length === 1) {
|
|
2491
|
+
return result;
|
|
2492
|
+
}
|
|
2493
|
+
nodeStack.shift();
|
|
2494
|
+
indexStack.shift();
|
|
2495
|
+
continue;
|
|
2496
|
+
}
|
|
2497
|
+
const elem = nodeStack[0][indexStack[0]++];
|
|
2498
|
+
if (isTag2(elem) && test(elem))
|
|
2499
|
+
result.push(elem);
|
|
2500
|
+
if (hasChildren(elem) && elem.children.length > 0) {
|
|
2501
|
+
indexStack.unshift(0);
|
|
2502
|
+
nodeStack.unshift(elem.children);
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
}
|
|
2506
|
+
// ../../node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/legacy.js
|
|
2507
|
+
var Checks = {
|
|
2508
|
+
tag_name(name) {
|
|
2509
|
+
if (typeof name === "function") {
|
|
2510
|
+
return (elem) => isTag2(elem) && name(elem.name);
|
|
2511
|
+
} else if (name === "*") {
|
|
2512
|
+
return isTag2;
|
|
2513
|
+
}
|
|
2514
|
+
return (elem) => isTag2(elem) && elem.name === name;
|
|
2515
|
+
},
|
|
2516
|
+
tag_type(type) {
|
|
2517
|
+
if (typeof type === "function") {
|
|
2518
|
+
return (elem) => type(elem.type);
|
|
2519
|
+
}
|
|
2520
|
+
return (elem) => elem.type === type;
|
|
2521
|
+
},
|
|
2522
|
+
tag_contains(data) {
|
|
2523
|
+
if (typeof data === "function") {
|
|
2524
|
+
return (elem) => isText(elem) && data(elem.data);
|
|
2525
|
+
}
|
|
2526
|
+
return (elem) => isText(elem) && elem.data === data;
|
|
2527
|
+
}
|
|
2528
|
+
};
|
|
2529
|
+
function getAttribCheck(attrib, value) {
|
|
2530
|
+
if (typeof value === "function") {
|
|
2531
|
+
return (elem) => isTag2(elem) && value(elem.attribs[attrib]);
|
|
2532
|
+
}
|
|
2533
|
+
return (elem) => isTag2(elem) && elem.attribs[attrib] === value;
|
|
2534
|
+
}
|
|
2535
|
+
function combineFuncs(a, b) {
|
|
2536
|
+
return (elem) => a(elem) || b(elem);
|
|
2537
|
+
}
|
|
2538
|
+
function compileTest(options) {
|
|
2539
|
+
const funcs = Object.keys(options).map((key) => {
|
|
2540
|
+
const value = options[key];
|
|
2541
|
+
return Object.prototype.hasOwnProperty.call(Checks, key) ? Checks[key](value) : getAttribCheck(key, value);
|
|
2542
|
+
});
|
|
2543
|
+
return funcs.length === 0 ? null : funcs.reduce(combineFuncs);
|
|
2544
|
+
}
|
|
2545
|
+
function testElement(options, node2) {
|
|
2546
|
+
const test = compileTest(options);
|
|
2547
|
+
return test ? test(node2) : true;
|
|
2548
|
+
}
|
|
2549
|
+
function getElements(options, nodes, recurse, limit = Infinity) {
|
|
2550
|
+
const test = compileTest(options);
|
|
2551
|
+
return test ? filter(test, nodes, recurse, limit) : [];
|
|
2552
|
+
}
|
|
2553
|
+
function getElementById(id, nodes, recurse = true) {
|
|
2554
|
+
if (!Array.isArray(nodes))
|
|
2555
|
+
nodes = [nodes];
|
|
2556
|
+
return findOne(getAttribCheck("id", id), nodes, recurse);
|
|
2557
|
+
}
|
|
2558
|
+
function getElementsByTagName(tagName, nodes, recurse = true, limit = Infinity) {
|
|
2559
|
+
return filter(Checks["tag_name"](tagName), nodes, recurse, limit);
|
|
2560
|
+
}
|
|
2561
|
+
function getElementsByClassName(className, nodes, recurse = true, limit = Infinity) {
|
|
2562
|
+
return filter(getAttribCheck("class", className), nodes, recurse, limit);
|
|
2563
|
+
}
|
|
2564
|
+
function getElementsByTagType(type, nodes, recurse = true, limit = Infinity) {
|
|
2565
|
+
return filter(Checks["tag_type"](type), nodes, recurse, limit);
|
|
2566
|
+
}
|
|
2567
|
+
// ../../node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/helpers.js
|
|
2568
|
+
function removeSubsets(nodes) {
|
|
2569
|
+
let idx = nodes.length;
|
|
2570
|
+
while (--idx >= 0) {
|
|
2571
|
+
const node2 = nodes[idx];
|
|
2572
|
+
if (idx > 0 && nodes.lastIndexOf(node2, idx - 1) >= 0) {
|
|
2573
|
+
nodes.splice(idx, 1);
|
|
2574
|
+
continue;
|
|
2575
|
+
}
|
|
2576
|
+
for (let ancestor = node2.parent;ancestor; ancestor = ancestor.parent) {
|
|
2577
|
+
if (nodes.includes(ancestor)) {
|
|
2578
|
+
nodes.splice(idx, 1);
|
|
2579
|
+
break;
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2582
|
+
}
|
|
2583
|
+
return nodes;
|
|
2584
|
+
}
|
|
2585
|
+
var DocumentPosition;
|
|
2586
|
+
(function(DocumentPosition2) {
|
|
2587
|
+
DocumentPosition2[DocumentPosition2["DISCONNECTED"] = 1] = "DISCONNECTED";
|
|
2588
|
+
DocumentPosition2[DocumentPosition2["PRECEDING"] = 2] = "PRECEDING";
|
|
2589
|
+
DocumentPosition2[DocumentPosition2["FOLLOWING"] = 4] = "FOLLOWING";
|
|
2590
|
+
DocumentPosition2[DocumentPosition2["CONTAINS"] = 8] = "CONTAINS";
|
|
2591
|
+
DocumentPosition2[DocumentPosition2["CONTAINED_BY"] = 16] = "CONTAINED_BY";
|
|
2592
|
+
})(DocumentPosition || (DocumentPosition = {}));
|
|
2593
|
+
function compareDocumentPosition(nodeA, nodeB) {
|
|
2594
|
+
const aParents = [];
|
|
2595
|
+
const bParents = [];
|
|
2596
|
+
if (nodeA === nodeB) {
|
|
2597
|
+
return 0;
|
|
2598
|
+
}
|
|
2599
|
+
let current = hasChildren(nodeA) ? nodeA : nodeA.parent;
|
|
2600
|
+
while (current) {
|
|
2601
|
+
aParents.unshift(current);
|
|
2602
|
+
current = current.parent;
|
|
2603
|
+
}
|
|
2604
|
+
current = hasChildren(nodeB) ? nodeB : nodeB.parent;
|
|
2605
|
+
while (current) {
|
|
2606
|
+
bParents.unshift(current);
|
|
2607
|
+
current = current.parent;
|
|
2608
|
+
}
|
|
2609
|
+
const maxIdx = Math.min(aParents.length, bParents.length);
|
|
2610
|
+
let idx = 0;
|
|
2611
|
+
while (idx < maxIdx && aParents[idx] === bParents[idx]) {
|
|
2612
|
+
idx++;
|
|
2613
|
+
}
|
|
2614
|
+
if (idx === 0) {
|
|
2615
|
+
return DocumentPosition.DISCONNECTED;
|
|
2616
|
+
}
|
|
2617
|
+
const sharedParent = aParents[idx - 1];
|
|
2618
|
+
const siblings = sharedParent.children;
|
|
2619
|
+
const aSibling = aParents[idx];
|
|
2620
|
+
const bSibling = bParents[idx];
|
|
2621
|
+
if (siblings.indexOf(aSibling) > siblings.indexOf(bSibling)) {
|
|
2622
|
+
if (sharedParent === nodeB) {
|
|
2623
|
+
return DocumentPosition.FOLLOWING | DocumentPosition.CONTAINED_BY;
|
|
2624
|
+
}
|
|
2625
|
+
return DocumentPosition.FOLLOWING;
|
|
2626
|
+
}
|
|
2627
|
+
if (sharedParent === nodeA) {
|
|
2628
|
+
return DocumentPosition.PRECEDING | DocumentPosition.CONTAINS;
|
|
2629
|
+
}
|
|
2630
|
+
return DocumentPosition.PRECEDING;
|
|
2631
|
+
}
|
|
2632
|
+
function uniqueSort(nodes) {
|
|
2633
|
+
nodes = nodes.filter((node2, i, arr) => !arr.includes(node2, i + 1));
|
|
2634
|
+
nodes.sort((a, b) => {
|
|
2635
|
+
const relative = compareDocumentPosition(a, b);
|
|
2636
|
+
if (relative & DocumentPosition.PRECEDING) {
|
|
2637
|
+
return -1;
|
|
2638
|
+
} else if (relative & DocumentPosition.FOLLOWING) {
|
|
2639
|
+
return 1;
|
|
2640
|
+
}
|
|
2641
|
+
return 0;
|
|
2642
|
+
});
|
|
2643
|
+
return nodes;
|
|
2644
|
+
}
|
|
2645
|
+
// ../../node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/feeds.js
|
|
2646
|
+
function getFeed(doc) {
|
|
2647
|
+
const feedRoot = getOneElement(isValidFeed, doc);
|
|
2648
|
+
return !feedRoot ? null : feedRoot.name === "feed" ? getAtomFeed(feedRoot) : getRssFeed(feedRoot);
|
|
2649
|
+
}
|
|
2650
|
+
function getAtomFeed(feedRoot) {
|
|
2651
|
+
var _a2;
|
|
2652
|
+
const childs = feedRoot.children;
|
|
2653
|
+
const feed = {
|
|
2654
|
+
type: "atom",
|
|
2655
|
+
items: getElementsByTagName("entry", childs).map((item) => {
|
|
2656
|
+
var _a3;
|
|
2657
|
+
const { children } = item;
|
|
2658
|
+
const entry = { media: getMediaElements(children) };
|
|
2659
|
+
addConditionally(entry, "id", "id", children);
|
|
2660
|
+
addConditionally(entry, "title", "title", children);
|
|
2661
|
+
const href2 = (_a3 = getOneElement("link", children)) === null || _a3 === undefined ? undefined : _a3.attribs["href"];
|
|
2662
|
+
if (href2) {
|
|
2663
|
+
entry.link = href2;
|
|
2664
|
+
}
|
|
2665
|
+
const description = fetch("summary", children) || fetch("content", children);
|
|
2666
|
+
if (description) {
|
|
2667
|
+
entry.description = description;
|
|
2668
|
+
}
|
|
2669
|
+
const pubDate = fetch("updated", children);
|
|
2670
|
+
if (pubDate) {
|
|
2671
|
+
entry.pubDate = new Date(pubDate);
|
|
2672
|
+
}
|
|
2673
|
+
return entry;
|
|
2674
|
+
})
|
|
2675
|
+
};
|
|
2676
|
+
addConditionally(feed, "id", "id", childs);
|
|
2677
|
+
addConditionally(feed, "title", "title", childs);
|
|
2678
|
+
const href = (_a2 = getOneElement("link", childs)) === null || _a2 === undefined ? undefined : _a2.attribs["href"];
|
|
2679
|
+
if (href) {
|
|
2680
|
+
feed.link = href;
|
|
2681
|
+
}
|
|
2682
|
+
addConditionally(feed, "description", "subtitle", childs);
|
|
2683
|
+
const updated = fetch("updated", childs);
|
|
2684
|
+
if (updated) {
|
|
2685
|
+
feed.updated = new Date(updated);
|
|
2686
|
+
}
|
|
2687
|
+
addConditionally(feed, "author", "email", childs, true);
|
|
2688
|
+
return feed;
|
|
2689
|
+
}
|
|
2690
|
+
function getRssFeed(feedRoot) {
|
|
2691
|
+
var _a2, _b;
|
|
2692
|
+
const childs = (_b = (_a2 = getOneElement("channel", feedRoot.children)) === null || _a2 === undefined ? undefined : _a2.children) !== null && _b !== undefined ? _b : [];
|
|
2693
|
+
const feed = {
|
|
2694
|
+
type: feedRoot.name.substr(0, 3),
|
|
2695
|
+
id: "",
|
|
2696
|
+
items: getElementsByTagName("item", feedRoot.children).map((item) => {
|
|
2697
|
+
const { children } = item;
|
|
2698
|
+
const entry = { media: getMediaElements(children) };
|
|
2699
|
+
addConditionally(entry, "id", "guid", children);
|
|
2700
|
+
addConditionally(entry, "title", "title", children);
|
|
2701
|
+
addConditionally(entry, "link", "link", children);
|
|
2702
|
+
addConditionally(entry, "description", "description", children);
|
|
2703
|
+
const pubDate = fetch("pubDate", children) || fetch("dc:date", children);
|
|
2704
|
+
if (pubDate)
|
|
2705
|
+
entry.pubDate = new Date(pubDate);
|
|
2706
|
+
return entry;
|
|
2707
|
+
})
|
|
2708
|
+
};
|
|
2709
|
+
addConditionally(feed, "title", "title", childs);
|
|
2710
|
+
addConditionally(feed, "link", "link", childs);
|
|
2711
|
+
addConditionally(feed, "description", "description", childs);
|
|
2712
|
+
const updated = fetch("lastBuildDate", childs);
|
|
2713
|
+
if (updated) {
|
|
2714
|
+
feed.updated = new Date(updated);
|
|
2715
|
+
}
|
|
2716
|
+
addConditionally(feed, "author", "managingEditor", childs, true);
|
|
2717
|
+
return feed;
|
|
2718
|
+
}
|
|
2719
|
+
var MEDIA_KEYS_STRING = ["url", "type", "lang"];
|
|
2720
|
+
var MEDIA_KEYS_INT = [
|
|
2721
|
+
"fileSize",
|
|
2722
|
+
"bitrate",
|
|
2723
|
+
"framerate",
|
|
2724
|
+
"samplingrate",
|
|
2725
|
+
"channels",
|
|
2726
|
+
"duration",
|
|
2727
|
+
"height",
|
|
2728
|
+
"width"
|
|
2729
|
+
];
|
|
2730
|
+
function getMediaElements(where) {
|
|
2731
|
+
return getElementsByTagName("media:content", where).map((elem) => {
|
|
2732
|
+
const { attribs } = elem;
|
|
2733
|
+
const media = {
|
|
2734
|
+
medium: attribs["medium"],
|
|
2735
|
+
isDefault: !!attribs["isDefault"]
|
|
2736
|
+
};
|
|
2737
|
+
for (const attrib of MEDIA_KEYS_STRING) {
|
|
2738
|
+
if (attribs[attrib]) {
|
|
2739
|
+
media[attrib] = attribs[attrib];
|
|
2740
|
+
}
|
|
2741
|
+
}
|
|
2742
|
+
for (const attrib of MEDIA_KEYS_INT) {
|
|
2743
|
+
if (attribs[attrib]) {
|
|
2744
|
+
media[attrib] = parseInt(attribs[attrib], 10);
|
|
2745
|
+
}
|
|
2746
|
+
}
|
|
2747
|
+
if (attribs["expression"]) {
|
|
2748
|
+
media.expression = attribs["expression"];
|
|
2749
|
+
}
|
|
2750
|
+
return media;
|
|
2751
|
+
});
|
|
2752
|
+
}
|
|
2753
|
+
function getOneElement(tagName, node2) {
|
|
2754
|
+
return getElementsByTagName(tagName, node2, true, 1)[0];
|
|
2755
|
+
}
|
|
2756
|
+
function fetch(tagName, where, recurse = false) {
|
|
2757
|
+
return textContent(getElementsByTagName(tagName, where, recurse, 1)).trim();
|
|
2758
|
+
}
|
|
2759
|
+
function addConditionally(obj, prop, tagName, where, recurse = false) {
|
|
2760
|
+
const val = fetch(tagName, where, recurse);
|
|
2761
|
+
if (val)
|
|
2762
|
+
obj[prop] = val;
|
|
2763
|
+
}
|
|
2764
|
+
function isValidFeed(value) {
|
|
2765
|
+
return value === "rss" || value === "feed" || value === "rdf:RDF";
|
|
2766
|
+
}
|
|
2767
|
+
// ../../node_modules/.pnpm/htmlparser2@8.0.2/node_modules/htmlparser2/lib/esm/index.js
|
|
2768
|
+
function parseDocument(data, options) {
|
|
2769
|
+
const handler = new DomHandler(undefined, options);
|
|
2770
|
+
new Parser(handler, options).end(data);
|
|
2771
|
+
return handler.root;
|
|
2772
|
+
}
|
|
2773
|
+
|
|
1522
2774
|
// ../../packages/workbook/src/ooxml-package.ts
|
|
1523
2775
|
var ZIP_LOCAL_FILE_HEADER = 67324752;
|
|
1524
2776
|
var ZIP_CENTRAL_DIRECTORY_HEADER = 33639248;
|
|
@@ -1533,6 +2785,9 @@ var MAX_ZIP_ENTRIES = 128;
|
|
|
1533
2785
|
var MAX_TOTAL_UNCOMPRESSED_BYTES = 10 * 1024 * 1024;
|
|
1534
2786
|
var MAX_ENTRY_UNCOMPRESSED_BYTES = 2 * 1024 * 1024;
|
|
1535
2787
|
var MAX_ZIP_COMPRESSION_RATIO = 100;
|
|
2788
|
+
|
|
2789
|
+
class OfficeSizeLimitError extends Error {
|
|
2790
|
+
}
|
|
1536
2791
|
var textEncoder = new TextEncoder;
|
|
1537
2792
|
var textDecoder = new TextDecoder("utf-8");
|
|
1538
2793
|
function utf8Bytes(text) {
|
|
@@ -1569,7 +2824,7 @@ async function readStreamBounded(stream, limit, label) {
|
|
|
1569
2824
|
total += value.byteLength;
|
|
1570
2825
|
if (total > limit) {
|
|
1571
2826
|
await reader.cancel();
|
|
1572
|
-
throw new
|
|
2827
|
+
throw new OfficeSizeLimitError(`ZIP entry ${label} inflated beyond its declared size.`);
|
|
1573
2828
|
}
|
|
1574
2829
|
chunks.push(value);
|
|
1575
2830
|
}
|
|
@@ -1621,7 +2876,7 @@ function localSizeMatches(localFlags, localSize, centralSize) {
|
|
|
1621
2876
|
}
|
|
1622
2877
|
function listZipEntries(bytes) {
|
|
1623
2878
|
if (bytes.byteLength > MAX_COMPRESSED_BYTES)
|
|
1624
|
-
throw new
|
|
2879
|
+
throw new OfficeSizeLimitError("ZIP input exceeds compressed byte limit.");
|
|
1625
2880
|
const view = dataView(bytes);
|
|
1626
2881
|
const eocd = findEndOfCentralDirectory(bytes);
|
|
1627
2882
|
const disk = view.getUint16(eocd + 4, true);
|
|
@@ -1636,7 +2891,7 @@ function listZipEntries(bytes) {
|
|
|
1636
2891
|
if (count === 65535 || centralSize === 4294967295 || centralOffset === 4294967295)
|
|
1637
2892
|
throw new Error("ZIP64 archives are not supported.");
|
|
1638
2893
|
if (count > MAX_ZIP_ENTRIES)
|
|
1639
|
-
throw new
|
|
2894
|
+
throw new OfficeSizeLimitError(`ZIP entry count ${count} exceeds limit ${MAX_ZIP_ENTRIES}.`);
|
|
1640
2895
|
if (centralOffset + centralSize > bytes.byteLength)
|
|
1641
2896
|
throw new Error("ZIP central directory is out of bounds.");
|
|
1642
2897
|
if (centralEnd > eocd)
|
|
@@ -1664,14 +2919,14 @@ function listZipEntries(bytes) {
|
|
|
1664
2919
|
if (method !== ZIP_STORED && method !== ZIP_DEFLATE)
|
|
1665
2920
|
throw new Error(`ZIP entry ${name} uses unsupported compression method ${method}.`);
|
|
1666
2921
|
if (uncompressedSize > MAX_ENTRY_UNCOMPRESSED_BYTES)
|
|
1667
|
-
throw new
|
|
2922
|
+
throw new OfficeSizeLimitError(`ZIP entry ${name} exceeds per-entry uncompressed limit.`);
|
|
1668
2923
|
if (uncompressedSize > 0 && compressedSize === 0)
|
|
1669
2924
|
throw new Error(`ZIP entry ${name} has an invalid compression ratio.`);
|
|
1670
2925
|
if (compressedSize > 0 && uncompressedSize / compressedSize > MAX_ZIP_COMPRESSION_RATIO)
|
|
1671
|
-
throw new
|
|
2926
|
+
throw new OfficeSizeLimitError(`ZIP entry ${name} exceeds compression ratio limit.`);
|
|
1672
2927
|
totalUncompressed += uncompressedSize;
|
|
1673
2928
|
if (totalUncompressed > MAX_TOTAL_UNCOMPRESSED_BYTES)
|
|
1674
|
-
throw new
|
|
2929
|
+
throw new OfficeSizeLimitError("ZIP archive exceeds total uncompressed limit.");
|
|
1675
2930
|
entries.push({ name, flags, method, compressedSize, uncompressedSize, localOffset });
|
|
1676
2931
|
cursor += 46 + nameLength + extraLength + commentLength;
|
|
1677
2932
|
}
|
|
@@ -1741,17 +2996,17 @@ function crc32(bytes) {
|
|
|
1741
2996
|
}
|
|
1742
2997
|
async function buildZip(files) {
|
|
1743
2998
|
if (files.length > MAX_ZIP_ENTRIES)
|
|
1744
|
-
throw new
|
|
2999
|
+
throw new OfficeSizeLimitError(`ZIP entry count ${files.length} exceeds limit ${MAX_ZIP_ENTRIES}.`);
|
|
1745
3000
|
const localChunks = [];
|
|
1746
3001
|
const centralChunks = [];
|
|
1747
3002
|
let offset = 0;
|
|
1748
3003
|
let totalUncompressed = 0;
|
|
1749
3004
|
for (const file of files) {
|
|
1750
3005
|
if (file.data.byteLength > MAX_ENTRY_UNCOMPRESSED_BYTES)
|
|
1751
|
-
throw new
|
|
3006
|
+
throw new OfficeSizeLimitError(`ZIP entry ${file.name} exceeds per-entry uncompressed limit.`);
|
|
1752
3007
|
totalUncompressed += file.data.byteLength;
|
|
1753
3008
|
if (totalUncompressed > MAX_TOTAL_UNCOMPRESSED_BYTES)
|
|
1754
|
-
throw new
|
|
3009
|
+
throw new OfficeSizeLimitError("ZIP archive exceeds total uncompressed limit.");
|
|
1755
3010
|
const deflated = await deflateRaw(file.data);
|
|
1756
3011
|
const useDeflate = deflated.byteLength < file.data.byteLength && file.data.byteLength / Math.max(1, deflated.byteLength) <= MAX_ZIP_COMPRESSION_RATIO;
|
|
1757
3012
|
const stored = useDeflate ? deflated : file.data;
|
|
@@ -1796,7 +3051,7 @@ async function buildZip(files) {
|
|
|
1796
3051
|
}
|
|
1797
3052
|
function assertSafeOfficeXml(xml) {
|
|
1798
3053
|
if (utf8ByteLength(xml) > MAX_ENTRY_UNCOMPRESSED_BYTES)
|
|
1799
|
-
throw new
|
|
3054
|
+
throw new OfficeSizeLimitError("Office XML exceeds the parser input limit.");
|
|
1800
3055
|
const lower = xml.toLowerCase();
|
|
1801
3056
|
if (lower.includes("<!doctype") || lower.includes("<!entity"))
|
|
1802
3057
|
throw new Error("Office XML DTD and entity declarations are not supported.");
|
|
@@ -2095,9 +3350,22 @@ function parseNumberFormats(stylesXml) {
|
|
|
2095
3350
|
return custom.get(id) ?? builtinNumberFormat(id);
|
|
2096
3351
|
});
|
|
2097
3352
|
}
|
|
3353
|
+
var ELAPSED_TIME_TOKEN = /\[(?:h+|m+|s+)\]/i;
|
|
3354
|
+
function isElapsedTimeFormat(format) {
|
|
3355
|
+
return !!format && ELAPSED_TIME_TOKEN.test(format.replace(/"[^"]*"/g, ""));
|
|
3356
|
+
}
|
|
3357
|
+
function excelSerialToElapsedTime(serial) {
|
|
3358
|
+
if (!Number.isFinite(serial) || serial < 0)
|
|
3359
|
+
return null;
|
|
3360
|
+
const totalSeconds = Math.round(serial * 86400);
|
|
3361
|
+
const hours = Math.floor(totalSeconds / 3600);
|
|
3362
|
+
return `${hours}:${pad(Math.floor(totalSeconds % 3600 / 60))}:${pad(totalSeconds % 60)}`;
|
|
3363
|
+
}
|
|
2098
3364
|
function isDateNumberFormat(format) {
|
|
2099
3365
|
if (!format || format === "General" || format === "@")
|
|
2100
3366
|
return false;
|
|
3367
|
+
if (isElapsedTimeFormat(format))
|
|
3368
|
+
return false;
|
|
2101
3369
|
const stripped = format.replace(/"[^"]*"/g, "").replace(/\[[^\]]*\]/g, "").replace(/\\./g, "").replace(/[Ee][+-]/g, "");
|
|
2102
3370
|
return /[ymdhs]/i.test(stripped);
|
|
2103
3371
|
}
|
|
@@ -2146,6 +3414,9 @@ function displayedCellValue(type, rawValue, body, sharedStrings, numberFormat, d
|
|
|
2146
3414
|
}
|
|
2147
3415
|
if (type === "b" && rawValue !== undefined)
|
|
2148
3416
|
return rawValue === "1" ? "TRUE" : "FALSE";
|
|
3417
|
+
if ((type === "" || type === "n") && rawValue !== undefined && isElapsedTimeFormat(numberFormat)) {
|
|
3418
|
+
return excelSerialToElapsedTime(Number(rawValue)) ?? rawValue;
|
|
3419
|
+
}
|
|
2149
3420
|
if ((type === "" || type === "n") && rawValue !== undefined && isDateNumberFormat(numberFormat)) {
|
|
2150
3421
|
return excelSerialToIso(Number(rawValue), date1904) ?? rawValue;
|
|
2151
3422
|
}
|
|
@@ -2494,6 +3765,121 @@ async function writeXlsxWorkbook(input) {
|
|
|
2494
3765
|
sheets: sheets.map((sheet, index) => ({ name: sheet.name, rows: worksheets[index].rows, columns: worksheets[index].columns }))
|
|
2495
3766
|
};
|
|
2496
3767
|
}
|
|
3768
|
+
// ../../packages/workbook/src/office-outline.ts
|
|
3769
|
+
function localName(name) {
|
|
3770
|
+
return name.slice(name.lastIndexOf(":") + 1);
|
|
3771
|
+
}
|
|
3772
|
+
function attribute(node2, name) {
|
|
3773
|
+
return node2 && Object.entries(node2.attribs).find(([key]) => localName(key) === name)?.[1];
|
|
3774
|
+
}
|
|
3775
|
+
function* elements(nodes, name) {
|
|
3776
|
+
const pending = nodes.slice().reverse();
|
|
3777
|
+
while (pending.length > 0) {
|
|
3778
|
+
const node2 = pending.pop();
|
|
3779
|
+
if (!node2 || !exports_esm2.isTag(node2))
|
|
3780
|
+
continue;
|
|
3781
|
+
if (localName(node2.name) === name) {
|
|
3782
|
+
yield node2;
|
|
3783
|
+
continue;
|
|
3784
|
+
}
|
|
3785
|
+
for (let index = node2.children.length - 1;index >= 0; index--)
|
|
3786
|
+
pending.push(node2.children[index]);
|
|
3787
|
+
}
|
|
3788
|
+
}
|
|
3789
|
+
function parse(xml) {
|
|
3790
|
+
assertSafeOfficeXml(xml);
|
|
3791
|
+
return parseDocument(xml, { xmlMode: true }).children;
|
|
3792
|
+
}
|
|
3793
|
+
function paragraphText(paragraph) {
|
|
3794
|
+
return Array.from(elements(paragraph.children, "t"), (run) => run.children.map((node2) => exports_esm2.isText(node2) ? node2.data : "").join("")).join("").trim();
|
|
3795
|
+
}
|
|
3796
|
+
function isTitle(paragraph) {
|
|
3797
|
+
let ancestor = paragraph.parent;
|
|
3798
|
+
while (ancestor && exports_esm2.isTag(ancestor)) {
|
|
3799
|
+
const current = ancestor;
|
|
3800
|
+
ancestor = current.parent;
|
|
3801
|
+
if (localName(current.name) !== "sp")
|
|
3802
|
+
continue;
|
|
3803
|
+
const props = current.children.find((node2) => exports_esm2.isTag(node2) && localName(node2.name) === "nvSpPr");
|
|
3804
|
+
const placeholder = props && elements([props], "ph").next().value;
|
|
3805
|
+
const type = attribute(placeholder, "type");
|
|
3806
|
+
return type === "title" || type === "ctrTitle";
|
|
3807
|
+
}
|
|
3808
|
+
return false;
|
|
3809
|
+
}
|
|
3810
|
+
async function slideParts(bytes, entries) {
|
|
3811
|
+
const manifest = await readZipTextEntry(bytes, entries, "ppt/presentation.xml");
|
|
3812
|
+
if (manifest === null) {
|
|
3813
|
+
return [...entries.keys()].filter((name) => /^ppt\/slides\/slide\d+\.xml$/.test(name)).sort((a, b) => a.localeCompare(b, undefined, { numeric: true }));
|
|
3814
|
+
}
|
|
3815
|
+
const rels = relationshipTargets(await readZipTextEntry(bytes, entries, "ppt/_rels/presentation.xml.rels"), "ppt");
|
|
3816
|
+
const list = elements(parse(manifest), "sldIdLst").next().value;
|
|
3817
|
+
if (!list)
|
|
3818
|
+
return [];
|
|
3819
|
+
return Array.from(elements(list.children, "sldId"), (node2) => {
|
|
3820
|
+
const id = Object.entries(node2.attribs).find(([key]) => key.endsWith(":id"))?.[1];
|
|
3821
|
+
const part = id && rels.get(id);
|
|
3822
|
+
if (!part || !/^ppt\/slides\/[^/]+\.xml$/.test(part))
|
|
3823
|
+
throw new Error("Missing or unsupported Office slide part.");
|
|
3824
|
+
return part;
|
|
3825
|
+
});
|
|
3826
|
+
}
|
|
3827
|
+
async function extractOfficeOutline(kind, bytes, entries, maxChars) {
|
|
3828
|
+
let remaining = maxChars;
|
|
3829
|
+
let truncated = false;
|
|
3830
|
+
const bounded = (text) => {
|
|
3831
|
+
if (text.length > remaining)
|
|
3832
|
+
truncated = true;
|
|
3833
|
+
let end = Math.min(text.length, remaining);
|
|
3834
|
+
if (end < text.length && /[\uD800-\uDBFF]/.test(text.charAt(end - 1)))
|
|
3835
|
+
end--;
|
|
3836
|
+
const visible = text.slice(0, end);
|
|
3837
|
+
remaining -= visible.length;
|
|
3838
|
+
return visible;
|
|
3839
|
+
};
|
|
3840
|
+
const read = async (part, root) => {
|
|
3841
|
+
const xml = await readZipTextEntry(bytes, entries, part);
|
|
3842
|
+
const node2 = xml !== null && elements(parse(xml), root).next().value;
|
|
3843
|
+
if (!node2)
|
|
3844
|
+
throw new Error("Missing or unreadable Office text part.");
|
|
3845
|
+
return node2.children;
|
|
3846
|
+
};
|
|
3847
|
+
if (kind === "docx") {
|
|
3848
|
+
const paragraphs = [];
|
|
3849
|
+
for (const paragraph of elements(await read("word/document.xml", "body"), "p")) {
|
|
3850
|
+
const text = bounded(paragraphText(paragraph));
|
|
3851
|
+
const style = attribute(elements(paragraph.children, "pStyle").next().value, "val");
|
|
3852
|
+
const level = attribute(elements(paragraph.children, "outlineLvl").next().value, "val");
|
|
3853
|
+
if (text)
|
|
3854
|
+
paragraphs.push({ text, heading: /^(?:title|heading[1-9])$/i.test(style ?? "") || /^[0-8]$/.test(level ?? "") });
|
|
3855
|
+
if (truncated)
|
|
3856
|
+
break;
|
|
3857
|
+
}
|
|
3858
|
+
return { kind, paragraphs, truncated };
|
|
3859
|
+
}
|
|
3860
|
+
const slides = [];
|
|
3861
|
+
for (const part of await slideParts(bytes, entries)) {
|
|
3862
|
+
const slide = { title: "", bullets: [] };
|
|
3863
|
+
for (const paragraph of elements(await read(part, "sld"), "p")) {
|
|
3864
|
+
const text = bounded(paragraphText(paragraph));
|
|
3865
|
+
if (text) {
|
|
3866
|
+
if (isTitle(paragraph))
|
|
3867
|
+
slide.title = slide.title ? `${slide.title}
|
|
3868
|
+
${text}` : text;
|
|
3869
|
+
else
|
|
3870
|
+
slide.bullets.push(text);
|
|
3871
|
+
}
|
|
3872
|
+
if (truncated)
|
|
3873
|
+
break;
|
|
3874
|
+
}
|
|
3875
|
+
if (!truncated || slide.title || slide.bullets.length)
|
|
3876
|
+
slides.push(slide);
|
|
3877
|
+
if (truncated)
|
|
3878
|
+
break;
|
|
3879
|
+
}
|
|
3880
|
+
return { kind, slides, truncated };
|
|
3881
|
+
}
|
|
3882
|
+
|
|
2497
3883
|
// ../../packages/workbook/src/office-text.ts
|
|
2498
3884
|
var DOCX_MIME = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
|
|
2499
3885
|
var PPTX_MIME = "application/vnd.openxmlformats-officedocument.presentationml.presentation";
|
|
@@ -2603,6 +3989,11 @@ async function extractXlsxText(bytes, options) {
|
|
|
2603
3989
|
`).slice(0, MAX_OFFICE_TEXT_CHARS);
|
|
2604
3990
|
}
|
|
2605
3991
|
async function extractOfficeText(kind, bytes, options = {}) {
|
|
3992
|
+
if ("format" in options) {
|
|
3993
|
+
if (kind === "xlsx")
|
|
3994
|
+
throw new Error("Workbook outlines are not supported.");
|
|
3995
|
+
return extractOfficeOutline(kind, bytes, zipEntryMap(listZipEntries(bytes)), MAX_OFFICE_TEXT_CHARS);
|
|
3996
|
+
}
|
|
2606
3997
|
if (kind === "xlsx")
|
|
2607
3998
|
return await extractXlsxText(bytes, options);
|
|
2608
3999
|
const entries = listZipEntries(bytes).filter((entry) => relevantXmlEntry(kind, entry.name)).sort(compareEntryName);
|