ooxml-core 1.35.0 → 1.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/PptxHandler-2JSQ22VD.cjs +14 -0
- package/dist/{PptxHandler-XCYX5DVX.mjs → PptxHandler-3T5DTNKA.mjs} +2 -2
- package/dist/PptxHandler-7T7ZS7IK.mjs +5 -0
- package/dist/{PresentationBuilder-JBTNOIL7.mjs → PresentationBuilder-D6ZICJWN.mjs} +3 -3
- package/dist/{PresentationBuilder-HA56ZY23.cjs → PresentationBuilder-HCMXZQDK.cjs} +6 -6
- package/dist/{PresentationBuilder-IVLUEB4K.mjs → PresentationBuilder-XHKNDJMD.mjs} +2 -2
- package/dist/automation/index.cjs +20529 -17975
- package/dist/automation/index.mjs +20510 -17975
- package/dist/chart/index.cjs +1 -1
- package/dist/chart/index.mjs +1 -1
- package/dist/chart/region-map/index.cjs +1 -1
- package/dist/chart/region-map/index.mjs +1 -1
- package/dist/{chunk-UQMAPY6D.mjs → chunk-2TQJHNVU.mjs} +1 -1
- package/dist/{chunk-RI56PFGL.mjs → chunk-4YBSHQ76.mjs} +5 -5
- package/dist/{chunk-XF6ZRA2D.cjs → chunk-AFALJ5TA.cjs} +3 -3
- package/dist/{chunk-MK2IBZU6.mjs → chunk-CNIKTXAV.mjs} +1 -1
- package/dist/{chunk-PA5ADSTX.cjs → chunk-GZOYXHDF.cjs} +1269 -1269
- package/dist/{chunk-LSO5SSFX.mjs → chunk-H2Q42P6P.mjs} +1 -1
- package/dist/{chunk-EGBNPVBA.mjs → chunk-J43V3QOA.mjs} +2 -2
- package/dist/{chunk-TJXK4D4U.mjs → chunk-M2DFN3SP.mjs} +4 -4
- package/dist/{chunk-RPJHMPEL.mjs → chunk-OEM2ECAJ.mjs} +1 -1
- package/dist/{chunk-GNGL4BO7.mjs → chunk-RHQQS6LJ.mjs} +4 -4
- package/dist/{chunk-A27O7M5X.cjs → chunk-SNID2FDY.cjs} +1 -1
- package/dist/{chunk-EDRS3OSM.mjs → chunk-WNAPUUAT.mjs} +1 -0
- package/dist/color/theme-palette.d.ts +1 -1
- package/dist/color/theme-palette.d.ts.map +1 -1
- package/dist/crypto/index.cjs +1 -1
- package/dist/crypto/index.mjs +1 -1
- package/dist/diagram/index.cjs +1 -1
- package/dist/diagram/index.mjs +1 -1
- package/dist/docx/block-parser.d.ts.map +1 -1
- package/dist/docx/comment-parts.d.ts +33 -0
- package/dist/docx/comment-parts.d.ts.map +1 -0
- package/dist/docx/comments.d.ts +5 -2
- package/dist/docx/comments.d.ts.map +1 -1
- package/dist/docx/embedded.cjs +15231 -14731
- package/dist/docx/embedded.mjs +15231 -14731
- package/dist/docx/glossary.d.ts.map +1 -1
- package/dist/docx/index.cjs +10771 -10329
- package/dist/docx/index.mjs +10771 -10329
- package/dist/docx/layout/index.cjs +81 -73
- package/dist/docx/layout/index.mjs +81 -73
- package/dist/docx/load/index.cjs +16891 -16391
- package/dist/docx/load/index.mjs +16891 -16391
- package/dist/docx/page-background.d.ts +4 -3
- package/dist/docx/page-background.d.ts.map +1 -1
- package/dist/docx/paragraph-text.d.ts +5 -0
- package/dist/docx/paragraph-text.d.ts.map +1 -0
- package/dist/docx/parse.d.ts.map +1 -1
- package/dist/docx/save.d.ts.map +1 -1
- package/dist/docx/special-characters.d.ts +2 -0
- package/dist/docx/special-characters.d.ts.map +1 -1
- package/dist/docx/theme-color.d.ts.map +1 -1
- package/dist/docx/ui/index.cjs +135 -135
- package/dist/docx/ui/index.mjs +135 -135
- package/dist/docx/write-comment-identities.d.ts +8 -0
- package/dist/docx/write-comment-identities.d.ts.map +1 -0
- package/dist/docx/write-comment-metadata.d.ts +12 -0
- package/dist/docx/write-comment-metadata.d.ts.map +1 -0
- package/dist/docx/write-comment-text.d.ts +3 -0
- package/dist/docx/write-comment-text.d.ts.map +1 -0
- package/dist/docx/write-comments.d.ts +1 -4
- package/dist/docx/write-comments.d.ts.map +1 -1
- package/dist/drawingml/index.cjs +1 -1
- package/dist/drawingml/index.mjs +1 -1
- package/dist/index.cjs +110 -6
- package/dist/index.mjs +91 -6
- package/dist/math/index.cjs +1 -1
- package/dist/math/index.mjs +1 -1
- package/dist/opc/index.cjs +78 -3
- package/dist/opc/index.mjs +78 -3
- package/dist/opc/signature/index.d.ts +1 -0
- package/dist/opc/signature/index.d.ts.map +1 -1
- package/dist/opc/signature/package.d.ts +12 -0
- package/dist/opc/signature/package.d.ts.map +1 -0
- package/dist/pptx/automation/index.cjs +21 -4
- package/dist/pptx/automation/index.d.ts +1 -0
- package/dist/pptx/automation/index.d.ts.map +1 -1
- package/dist/pptx/automation/index.mjs +16 -6
- package/dist/pptx/automation/schemas/index.cjs +1 -0
- package/dist/pptx/automation/schemas/index.mjs +1 -1
- package/dist/pptx/automation/schemas/presentation-schemas.cjs +1 -0
- package/dist/pptx/automation/schemas/presentation-schemas.d.ts +1 -0
- package/dist/pptx/automation/schemas/presentation-schemas.d.ts.map +1 -1
- package/dist/pptx/automation/schemas/presentation-schemas.mjs +1 -1
- package/dist/pptx/cli/index.cjs +10 -4
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.cjs +7 -1
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/custom-show-operations.cjs +2 -2
- package/dist/pptx/editor/render/custom-show-operations.mjs +1 -1
- package/dist/pptx/editor/render/find-replace.cjs +15 -15
- package/dist/pptx/editor/render/find-replace.mjs +2 -2
- package/dist/pptx/editor/render/slide-operations.cjs +9 -9
- package/dist/pptx/editor/render/slide-operations.mjs +3 -3
- package/dist/pptx/index.cjs +10 -4
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/ui/index.d.ts +1 -1
- package/dist/teams/index.cjs +812 -95
- package/dist/teams/index.mjs +811 -95
- package/dist/visio/bevel-3d.d.ts +37 -14
- package/dist/visio/bevel-3d.d.ts.map +1 -1
- package/dist/visio/bevel-shading.d.ts +72 -0
- package/dist/visio/bevel-shading.d.ts.map +1 -0
- package/dist/visio/cff-author.d.ts +14 -0
- package/dist/visio/cff-author.d.ts.map +1 -0
- package/dist/visio/cff-masters.d.ts +11 -0
- package/dist/visio/cff-masters.d.ts.map +1 -1
- package/dist/visio/cff-recalc.d.ts.map +1 -1
- package/dist/visio/collab/index.cjs +1 -1
- package/dist/visio/collab/index.mjs +1 -1
- package/dist/visio/data-graphic-instance.d.ts +44 -0
- package/dist/visio/data-graphic-instance.d.ts.map +1 -0
- package/dist/visio/data-graphic-masters.d.ts +38 -0
- package/dist/visio/data-graphic-masters.d.ts.map +1 -0
- package/dist/visio/data-graphic-place.d.ts +34 -0
- package/dist/visio/data-graphic-place.d.ts.map +1 -0
- package/dist/visio/edit-commands.d.ts +10 -1
- package/dist/visio/edit-commands.d.ts.map +1 -1
- package/dist/visio/edit-data-graphic-guard.d.ts +13 -0
- package/dist/visio/edit-data-graphic-guard.d.ts.map +1 -0
- package/dist/visio/edit-data-graphic-owner.d.ts +9 -0
- package/dist/visio/edit-data-graphic-owner.d.ts.map +1 -0
- package/dist/visio/edit-data-graphic-refresh.d.ts +14 -0
- package/dist/visio/edit-data-graphic-refresh.d.ts.map +1 -0
- package/dist/visio/edit-data-graphic.d.ts +33 -0
- package/dist/visio/edit-data-graphic.d.ts.map +1 -0
- package/dist/visio/edit-formatting-commands.d.ts +6 -0
- package/dist/visio/edit-formatting-commands.d.ts.map +1 -1
- package/dist/visio/edit-formatting-paint.d.ts.map +1 -1
- package/dist/visio/edit-formatting-text-commands.d.ts +8 -0
- package/dist/visio/edit-formatting-text-commands.d.ts.map +1 -1
- package/dist/visio/edit-formatting-text-extra.d.ts +14 -0
- package/dist/visio/edit-formatting-text-extra.d.ts.map +1 -1
- package/dist/visio/edit-formatting-text.d.ts.map +1 -1
- package/dist/visio/edit-formatting.d.ts.map +1 -1
- package/dist/visio/edit-instance-geometry.d.ts.map +1 -1
- package/dist/visio/edit-instance-recalculate.d.ts +6 -1
- package/dist/visio/edit-instance-recalculate.d.ts.map +1 -1
- package/dist/visio/edit-shape-create.d.ts.map +1 -1
- package/dist/visio/edit-shape-data.d.ts.map +1 -1
- package/dist/visio/edit-stencil-connector.d.ts.map +1 -1
- package/dist/visio/edit-swimlane-cff.d.ts +28 -0
- package/dist/visio/edit-swimlane-cff.d.ts.map +1 -0
- package/dist/visio/edit-swimlane-clone.d.ts +8 -4
- package/dist/visio/edit-swimlane-clone.d.ts.map +1 -1
- package/dist/visio/edit-swimlane-layout.d.ts +6 -1
- package/dist/visio/edit-swimlane-layout.d.ts.map +1 -1
- package/dist/visio/edit-swimlane-ops.d.ts.map +1 -1
- package/dist/visio/edit-swimlane-stamp.d.ts +22 -0
- package/dist/visio/edit-swimlane-stamp.d.ts.map +1 -0
- package/dist/visio/edit.d.ts.map +1 -1
- package/dist/visio/formula-analyze.d.ts.map +1 -1
- package/dist/visio/formula-evaluate.d.ts.map +1 -1
- package/dist/visio/formula.d.ts.map +1 -1
- package/dist/visio/index.cjs +4279 -2236
- package/dist/visio/index.d.ts +4 -1
- package/dist/visio/index.d.ts.map +1 -1
- package/dist/visio/index.mjs +4262 -2237
- package/dist/visio/master-list.d.ts +3 -3
- package/dist/visio/master-list.d.ts.map +1 -1
- package/dist/visio/model.d.ts +12 -3
- package/dist/visio/model.d.ts.map +1 -1
- package/dist/visio/path-segments.d.ts +25 -0
- package/dist/visio/path-segments.d.ts.map +1 -0
- package/dist/visio/rotation-presets.d.ts +25 -0
- package/dist/visio/rotation-presets.d.ts.map +1 -0
- package/dist/visio/shape-sections.d.ts +4 -3
- package/dist/visio/shape-sections.d.ts.map +1 -1
- package/dist/visio/shape-structure.d.ts.map +1 -1
- package/dist/visio/shapes.d.ts +2 -0
- package/dist/visio/shapes.d.ts.map +1 -1
- package/dist/visio/solid-3d.d.ts +64 -0
- package/dist/visio/solid-3d.d.ts.map +1 -0
- package/dist/visio/style.d.ts.map +1 -1
- package/dist/visio/theme-solid.d.ts +21 -0
- package/dist/visio/theme-solid.d.ts.map +1 -0
- package/dist/visio/ui/data-graphic-config.d.ts +4 -19
- package/dist/visio/ui/data-graphic-config.d.ts.map +1 -1
- package/dist/visio/ui/data-graphic-items.d.ts.map +1 -1
- package/dist/visio/ui/data-graphic-native.d.ts +20 -0
- package/dist/visio/ui/data-graphic-native.d.ts.map +1 -0
- package/dist/visio/ui/data-graphics.d.ts.map +1 -1
- package/dist/visio/ui/data-visualizer-edits.d.ts +1 -0
- package/dist/visio/ui/data-visualizer-edits.d.ts.map +1 -1
- package/dist/visio/ui/edit-commands.d.ts.map +1 -1
- package/dist/visio/ui/index.cjs +4273 -2347
- package/dist/visio/ui/index.mjs +4270 -2348
- package/dist/visio/ui/org-chart-belt.d.ts +20 -0
- package/dist/visio/ui/org-chart-belt.d.ts.map +1 -0
- package/dist/visio/ui/org-chart-edit.d.ts +8 -1
- package/dist/visio/ui/org-chart-edit.d.ts.map +1 -1
- package/dist/visio/ui/org-chart-import.d.ts.map +1 -1
- package/dist/visio/ui/scene-validation.d.ts.map +1 -1
- package/dist/visio/ui/snapshot-scene.d.ts.map +1 -1
- package/dist/visio/ui/swimlane.d.ts.map +1 -1
- package/dist/visio/ui/text-dialog.d.ts +12 -0
- package/dist/visio/ui/text-dialog.d.ts.map +1 -1
- package/dist/xlsx/collab/index.cjs +45 -2
- package/dist/xlsx/collab/index.mjs +45 -2
- package/dist/xlsx/collab/part-specs.d.ts.map +1 -1
- package/dist/xlsx/collab/sheets.d.ts +1 -0
- package/dist/xlsx/collab/sheets.d.ts.map +1 -1
- package/dist/xlsx/edit/annotations.d.ts +4 -0
- package/dist/xlsx/edit/annotations.d.ts.map +1 -1
- package/dist/xlsx/edit/clipboard-annotations.d.ts.map +1 -1
- package/dist/xlsx/edit/comment-identities.d.ts +4 -0
- package/dist/xlsx/edit/comment-identities.d.ts.map +1 -0
- package/dist/xlsx/edit/session.d.ts.map +1 -1
- package/dist/xlsx/edit/sheets.d.ts.map +1 -1
- package/dist/xlsx/edit/types.d.ts +3 -0
- package/dist/xlsx/edit/types.d.ts.map +1 -1
- package/dist/xlsx/formula/functions/filterxml.d.ts +2 -0
- package/dist/xlsx/formula/functions/filterxml.d.ts.map +1 -0
- package/dist/xlsx/formula/functions/registry.d.ts.map +1 -1
- package/dist/xlsx/index.cjs +1007 -285
- package/dist/xlsx/index.mjs +988 -285
- package/dist/xlsx/layout/split.d.ts +3 -1
- package/dist/xlsx/layout/split.d.ts.map +1 -1
- package/dist/xlsx/load/index.cjs +809 -126
- package/dist/xlsx/load/index.mjs +790 -126
- package/dist/xlsx/model.d.ts +19 -7
- package/dist/xlsx/model.d.ts.map +1 -1
- package/dist/xlsx/read/comments.d.ts +3 -1
- package/dist/xlsx/read/comments.d.ts.map +1 -1
- package/dist/xlsx/read/conditional.d.ts +2 -2
- package/dist/xlsx/read/conditional.d.ts.map +1 -1
- package/dist/xlsx/read/data-validations.d.ts +7 -0
- package/dist/xlsx/read/data-validations.d.ts.map +1 -0
- package/dist/xlsx/read/sheet-props.d.ts.map +1 -1
- package/dist/xlsx/read/worksheet.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/i18n/messages.d.ts.map +1 -1
- package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -1
- package/dist/xlsx/ui/grid/geometry.d.ts +3 -0
- package/dist/xlsx/ui/grid/geometry.d.ts.map +1 -1
- package/dist/xlsx/ui/index.cjs +952 -168
- package/dist/xlsx/ui/index.mjs +933 -169
- package/dist/xlsx/ui/selection.d.ts +3 -0
- package/dist/xlsx/ui/selection.d.ts.map +1 -1
- package/dist/xlsx/validation-extensions.d.ts +6 -0
- package/dist/xlsx/validation-extensions.d.ts.map +1 -0
- package/dist/xlsx/write/comment-ids.d.ts +14 -0
- package/dist/xlsx/write/comment-ids.d.ts.map +1 -0
- package/dist/xlsx/write/comment-mentions.d.ts +6 -0
- package/dist/xlsx/write/comment-mentions.d.ts.map +1 -0
- package/dist/xlsx/write/comment-persons.d.ts +16 -0
- package/dist/xlsx/write/comment-persons.d.ts.map +1 -0
- package/dist/xlsx/write/comments.d.ts +5 -11
- package/dist/xlsx/write/comments.d.ts.map +1 -1
- package/dist/xlsx/write/conditional.d.ts +2 -2
- package/dist/xlsx/write/conditional.d.ts.map +1 -1
- package/dist/xlsx/write/data-validations.d.ts +6 -0
- package/dist/xlsx/write/data-validations.d.ts.map +1 -0
- package/dist/xlsx/write/save.d.ts.map +1 -1
- package/dist/xlsx/write/sheet-parts.d.ts +4 -0
- package/dist/xlsx/write/sheet-parts.d.ts.map +1 -1
- package/dist/xlsx/write/sheet-props.d.ts.map +1 -1
- package/dist/xlsx/write/threaded-comments.d.ts +19 -0
- package/dist/xlsx/write/threaded-comments.d.ts.map +1 -0
- package/dist/xlsx/write/worksheet.d.ts.map +1 -1
- package/dist/xml/index.cjs +31 -1
- package/dist/xml/index.d.ts +1 -0
- package/dist/xml/index.d.ts.map +1 -1
- package/dist/xml/index.mjs +11 -2
- package/dist/xml/xml.d.ts +2 -0
- package/dist/xml/xml.d.ts.map +1 -1
- package/dist/xml/xpath.d.ts +9 -0
- package/dist/xml/xpath.d.ts.map +1 -0
- package/package.json +2 -1
- package/dist/PptxHandler-5UDSMCBG.cjs +0 -14
- package/dist/PptxHandler-TTRTAQAR.mjs +0 -5
package/dist/xlsx/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { XMLSerializer, DOMParser } from '@xmldom/xmldom';
|
|
2
|
+
import * as xpath from 'xpath';
|
|
2
3
|
import JSZip2 from 'jszip';
|
|
3
4
|
import { Inflate } from 'fflate';
|
|
4
5
|
|
|
@@ -187,7 +188,7 @@ function parseXml(xml, options2 = {}) {
|
|
|
187
188
|
try {
|
|
188
189
|
parsed = new DOMParser({
|
|
189
190
|
onError: (level4, message) => {
|
|
190
|
-
if (level4 !== "warning") parseError = message;
|
|
191
|
+
if (level4 !== "warning" || options2.warningsAsErrors) parseError = message;
|
|
191
192
|
}
|
|
192
193
|
}).parseFromString(xml, "application/xml");
|
|
193
194
|
} catch (error) {
|
|
@@ -425,6 +426,14 @@ function startTag(source3, from, namespaces) {
|
|
|
425
426
|
if (i2 < n2 && !isSpace(after) && after !== 62 && after !== 47) return void 0;
|
|
426
427
|
}
|
|
427
428
|
}
|
|
429
|
+
var compiler = xpath;
|
|
430
|
+
function selectXmlNodes(expression, node2, options2 = {}) {
|
|
431
|
+
return compiler.parse(expression).select({
|
|
432
|
+
node: node2,
|
|
433
|
+
...options2.namespaces ? { namespaces: options2.namespaces } : {},
|
|
434
|
+
allowAnyNamespaceForNoPrefix: options2.matchDefaultNamespace ?? false
|
|
435
|
+
});
|
|
436
|
+
}
|
|
428
437
|
|
|
429
438
|
// color/color-primitives.ts
|
|
430
439
|
function clampUnitInterval(value2) {
|
|
@@ -17706,6 +17715,83 @@ var TEXT_EXTRA_FUNCTIONS = [
|
|
|
17706
17715
|
)
|
|
17707
17716
|
];
|
|
17708
17717
|
|
|
17718
|
+
// xlsx/formula/functions/filterxml.ts
|
|
17719
|
+
var XML = "http://www.w3.org/XML/1998/namespace";
|
|
17720
|
+
var XMLNS = "http://www.w3.org/2000/xmlns/";
|
|
17721
|
+
function preservesSpace(node2) {
|
|
17722
|
+
for (let current = node2; current; current = current.parentNode) {
|
|
17723
|
+
if (current.nodeType !== 1) continue;
|
|
17724
|
+
const value2 = current.getAttributeNS(XML, "space");
|
|
17725
|
+
if (value2) return value2 === "preserve";
|
|
17726
|
+
}
|
|
17727
|
+
return false;
|
|
17728
|
+
}
|
|
17729
|
+
function prepare(root) {
|
|
17730
|
+
const namespaces = /* @__PURE__ */ Object.create(null);
|
|
17731
|
+
const visit2 = (element3) => {
|
|
17732
|
+
for (const attr3 of Array.from(element3.attributes)) {
|
|
17733
|
+
if (attr3.namespaceURI !== XMLNS || attr3.localName === "xmlns") continue;
|
|
17734
|
+
const prior = namespaces[attr3.localName];
|
|
17735
|
+
if (prior !== void 0 && prior !== attr3.value) throw new Error("Conflicting namespaces");
|
|
17736
|
+
namespaces[attr3.localName] = attr3.value;
|
|
17737
|
+
}
|
|
17738
|
+
for (const child6 of Array.from(element3.childNodes)) {
|
|
17739
|
+
if (child6.nodeType === 1) visit2(child6);
|
|
17740
|
+
else if (child6.nodeType === 3 && !child6.nodeValue?.trim() && !preservesSpace(element3))
|
|
17741
|
+
element3.removeChild(child6);
|
|
17742
|
+
}
|
|
17743
|
+
};
|
|
17744
|
+
visit2(root);
|
|
17745
|
+
return namespaces;
|
|
17746
|
+
}
|
|
17747
|
+
function nodeValue(node2) {
|
|
17748
|
+
let text3;
|
|
17749
|
+
if (node2.nodeType === 2) text3 = (node2.nodeValue ?? "").trim();
|
|
17750
|
+
else if (node2.nodeType === 1) {
|
|
17751
|
+
const preserve = preservesSpace(node2);
|
|
17752
|
+
text3 = Array.from(node2.childNodes).filter((child6) => child6.nodeType === 3 || child6.nodeType === 4).map((child6) => {
|
|
17753
|
+
const value2 = child6.nodeValue ?? "";
|
|
17754
|
+
return preserve || child6.nodeType === 4 ? value2 : value2.trim();
|
|
17755
|
+
}).join("");
|
|
17756
|
+
} else return ERR.VALUE;
|
|
17757
|
+
if (!text3) return ERR.VALUE;
|
|
17758
|
+
if (/^(true|false)$/i.test(text3)) return text3.toLowerCase() === "true";
|
|
17759
|
+
const date = /^(\d{1,4})[-/](\d{1,2})[-/](\d{1,4})(.*)$/.exec(text3.trim());
|
|
17760
|
+
let numberText = text3;
|
|
17761
|
+
if (date) {
|
|
17762
|
+
let year = Number(date[1]);
|
|
17763
|
+
if (year < 100) year += year < 30 ? 2e3 : 1900;
|
|
17764
|
+
numberText = `${year}-${date[2]}-${date[3]}${date[4]?.replace(/^T/, " ") ?? ""}`;
|
|
17765
|
+
}
|
|
17766
|
+
return parseNumberText(numberText) ?? text3;
|
|
17767
|
+
}
|
|
17768
|
+
var FILTERXML = spec(
|
|
17769
|
+
"FILTERXML",
|
|
17770
|
+
"Web",
|
|
17771
|
+
"FILTERXML(xml, xpath)",
|
|
17772
|
+
"Returns XML element or attribute values selected by XPath, as a column.",
|
|
17773
|
+
2,
|
|
17774
|
+
2,
|
|
17775
|
+
(args) => {
|
|
17776
|
+
const xml = str(args[0]);
|
|
17777
|
+
const expression = str(args[1]);
|
|
17778
|
+
if (xml.length > 32767 || expression.length > 32767) return ERR.VALUE;
|
|
17779
|
+
let nodes;
|
|
17780
|
+
try {
|
|
17781
|
+
const doc = parseXml(xml, { warningsAsErrors: true, label: "FILTERXML" });
|
|
17782
|
+
nodes = selectXmlNodes(expression, doc, {
|
|
17783
|
+
namespaces: prepare(doc.documentElement),
|
|
17784
|
+
matchDefaultNamespace: true
|
|
17785
|
+
});
|
|
17786
|
+
} catch {
|
|
17787
|
+
return ERR.VALUE;
|
|
17788
|
+
}
|
|
17789
|
+
if (!nodes.length) return ERR.VALUE;
|
|
17790
|
+
chargeArrayCells(nodes.length);
|
|
17791
|
+
return new Matrix(nodes.map((node2) => [nodeValue(node2)]));
|
|
17792
|
+
}
|
|
17793
|
+
);
|
|
17794
|
+
|
|
17709
17795
|
// xlsx/formula/functions/registry.ts
|
|
17710
17796
|
var ALL = [
|
|
17711
17797
|
...MATH_FUNCTIONS,
|
|
@@ -17715,6 +17801,7 @@ var ALL = [
|
|
|
17715
17801
|
...LOGICAL_FUNCTIONS,
|
|
17716
17802
|
...TEXT_FUNCTIONS,
|
|
17717
17803
|
...TEXT_EXTRA_FUNCTIONS,
|
|
17804
|
+
FILTERXML,
|
|
17718
17805
|
BAHTTEXT,
|
|
17719
17806
|
GETPIVOTDATA,
|
|
17720
17807
|
...GROUPBY_FUNCTIONS,
|
|
@@ -20660,7 +20747,7 @@ var PROPERTY_CONTENT_TYPES = {
|
|
|
20660
20747
|
};
|
|
20661
20748
|
|
|
20662
20749
|
// opc/properties/patch.ts
|
|
20663
|
-
var
|
|
20750
|
+
var XMLNS2 = "http://www.w3.org/2000/xmlns/";
|
|
20664
20751
|
function tagEnd(xml, from) {
|
|
20665
20752
|
let quote3 = "";
|
|
20666
20753
|
for (let i2 = from + 1; i2 < xml.length; i2++) {
|
|
@@ -20742,7 +20829,7 @@ var PartPatch = class {
|
|
|
20742
20829
|
this.root = root;
|
|
20743
20830
|
for (const attribute2 of Array.from(rootElement.attributes)) {
|
|
20744
20831
|
if (attribute2.name === "xmlns") this.defaultNs = attribute2.value;
|
|
20745
|
-
else if (attribute2.namespaceURI ===
|
|
20832
|
+
else if (attribute2.namespaceURI === XMLNS2 || attribute2.name.startsWith("xmlns:"))
|
|
20746
20833
|
this.prefixes.set(attribute2.value, attribute2.localName);
|
|
20747
20834
|
}
|
|
20748
20835
|
}
|
|
@@ -22595,31 +22682,90 @@ function parsePersons(xml) {
|
|
|
22595
22682
|
}
|
|
22596
22683
|
return persons;
|
|
22597
22684
|
}
|
|
22598
|
-
function parseThreadedComments(xml, persons) {
|
|
22685
|
+
function parseThreadedComments(xml, persons, personsXml) {
|
|
22599
22686
|
if (!xml) return [];
|
|
22600
22687
|
const root = parseXml(xml, { label: "XLSX threaded comments" }).documentElement;
|
|
22601
22688
|
const roots = /* @__PURE__ */ new Map();
|
|
22689
|
+
const personNames = new Map([...persons].map(([id, name]) => [id.toUpperCase(), name]));
|
|
22602
22690
|
const order = [];
|
|
22603
|
-
|
|
22604
|
-
|
|
22691
|
+
const nodes = children(root, "threadedComment", NS.tc);
|
|
22692
|
+
const byId2 = new Map(nodes.map((node2) => [(att(node2, "id") ?? "").toUpperCase(), node2]));
|
|
22693
|
+
const parentRoot = (parent) => {
|
|
22694
|
+
const seen = /* @__PURE__ */ new Set();
|
|
22695
|
+
while (parent) {
|
|
22696
|
+
parent = parent.toUpperCase();
|
|
22697
|
+
if (seen.has(parent)) break;
|
|
22698
|
+
if (roots.has(parent)) return roots.get(parent);
|
|
22699
|
+
seen.add(parent);
|
|
22700
|
+
parent = att(byId2.get(parent), "parentId");
|
|
22701
|
+
}
|
|
22702
|
+
return void 0;
|
|
22703
|
+
};
|
|
22704
|
+
for (const node2 of [
|
|
22705
|
+
...nodes.filter((n2) => !att(n2, "parentId")),
|
|
22706
|
+
...nodes.filter((n2) => att(n2, "parentId"))
|
|
22707
|
+
]) {
|
|
22708
|
+
const parentComment = parentRoot(att(node2, "parentId"));
|
|
22709
|
+
const address2 = parseAddress(att(node2, "ref") ?? "") ?? parentComment?.address;
|
|
22605
22710
|
if (!address2) continue;
|
|
22606
|
-
const author =
|
|
22711
|
+
const author = personNames.get((att(node2, "personId") ?? "").toUpperCase()) ?? "";
|
|
22607
22712
|
const text3 = xText(children(node2, "text", NS.tc)[0]);
|
|
22608
22713
|
const date = att(node2, "dT");
|
|
22609
|
-
const parent = att(node2, "parentId");
|
|
22610
|
-
const parentComment = parent ? roots.get(parent) : void 0;
|
|
22611
22714
|
if (parentComment) {
|
|
22612
|
-
const reply = { author, text: text3 };
|
|
22715
|
+
const reply = { author, text: text3, threadedXml: selfContainedXml(node2) };
|
|
22613
22716
|
if (date) reply.date = date;
|
|
22614
22717
|
(parentComment.replies ??= []).push(reply);
|
|
22615
22718
|
continue;
|
|
22616
22719
|
}
|
|
22617
|
-
const comment = {
|
|
22618
|
-
|
|
22720
|
+
const comment = {
|
|
22721
|
+
address: address2,
|
|
22722
|
+
author,
|
|
22723
|
+
text: text3,
|
|
22724
|
+
replies: [],
|
|
22725
|
+
threadedXml: selfContainedXml(node2)
|
|
22726
|
+
};
|
|
22727
|
+
if (date) comment.date = date;
|
|
22728
|
+
const resolved = boolAttr(node2, "done");
|
|
22729
|
+
if (resolved !== void 0) comment.resolved = resolved;
|
|
22730
|
+
roots.set((att(node2, "id") ?? `${order.length}`).toUpperCase(), comment);
|
|
22619
22731
|
order.push(comment);
|
|
22620
22732
|
}
|
|
22733
|
+
for (const comment of order)
|
|
22734
|
+
comment.replies?.sort((a2, b) => {
|
|
22735
|
+
const aDate = a2.date ? Date.parse(a2.date) : NaN;
|
|
22736
|
+
const bDate = b.date ? Date.parse(b.date) : NaN;
|
|
22737
|
+
return Number.isFinite(aDate) && Number.isFinite(bDate) ? aDate - bDate : 0;
|
|
22738
|
+
});
|
|
22739
|
+
if (personsXml) {
|
|
22740
|
+
const records = /* @__PURE__ */ new Map();
|
|
22741
|
+
for (const person of children(parseXml(personsXml).documentElement, "person", NS.tc)) {
|
|
22742
|
+
const id = att(person, "id") ?? "";
|
|
22743
|
+
records.set(id.toUpperCase(), [id, selfContainedXml(person)]);
|
|
22744
|
+
}
|
|
22745
|
+
for (const comment of order) {
|
|
22746
|
+
const ids = /* @__PURE__ */ new Set();
|
|
22747
|
+
for (const message of [comment, ...comment.replies ?? []]) {
|
|
22748
|
+
const node2 = parseXml(message.threadedXml).documentElement;
|
|
22749
|
+
ids.add((att(node2, "personId") ?? "").toUpperCase());
|
|
22750
|
+
const mentions = first(node2, "mentions", NS.tc);
|
|
22751
|
+
if (mentions)
|
|
22752
|
+
for (const mention of children(mentions, "mention", NS.tc))
|
|
22753
|
+
ids.add((att(mention, "mentionpersonId") ?? "").toUpperCase());
|
|
22754
|
+
}
|
|
22755
|
+
const kept = [...ids].flatMap((id) => records.has(id) ? [records.get(id)] : []);
|
|
22756
|
+
if (kept.length) comment.threadedPersons = Object.fromEntries(kept);
|
|
22757
|
+
}
|
|
22758
|
+
}
|
|
22621
22759
|
return order;
|
|
22622
22760
|
}
|
|
22761
|
+
function threadedCommentEnvelope(xml) {
|
|
22762
|
+
if (!xml) return void 0;
|
|
22763
|
+
const doc = parseXml(xml);
|
|
22764
|
+
for (const node2 of children(doc.documentElement, "threadedComment", NS.tc)) {
|
|
22765
|
+
doc.documentElement.removeChild(node2);
|
|
22766
|
+
}
|
|
22767
|
+
return buildXml(doc);
|
|
22768
|
+
}
|
|
22623
22769
|
function mergeComments(legacy, threaded) {
|
|
22624
22770
|
if (!threaded.length) return legacy;
|
|
22625
22771
|
const key = (c2) => `${c2.address.row}:${c2.address.col}`;
|
|
@@ -23464,7 +23610,7 @@ function readSheetView(sheetViews) {
|
|
|
23464
23610
|
const cols = Math.max(0, Math.round(numAttr(pane, "xSplit") ?? 0));
|
|
23465
23611
|
if (rows2 || cols) view.freeze = { rows: rows2, cols };
|
|
23466
23612
|
}
|
|
23467
|
-
const split2 = pane && state === "split";
|
|
23613
|
+
const split2 = pane && (state === void 0 || state === "split");
|
|
23468
23614
|
if (split2) {
|
|
23469
23615
|
const x = Math.max(0, Math.round(numAttr(pane, "xSplit") ?? 0));
|
|
23470
23616
|
const y = Math.max(0, Math.round(numAttr(pane, "ySplit") ?? 0));
|
|
@@ -23472,9 +23618,8 @@ function readSheetView(sheetViews) {
|
|
|
23472
23618
|
view.split = { x, y };
|
|
23473
23619
|
const first2 = parseAddress(att(node2, "topLeftCell") ?? "");
|
|
23474
23620
|
if (first2) view.split.topLeft = first2;
|
|
23475
|
-
const active = att(pane, "activePane");
|
|
23476
|
-
if (
|
|
23477
|
-
view.split.activePane = active;
|
|
23621
|
+
const active = att(pane, "activePane") ?? "topLeft";
|
|
23622
|
+
if (PANES.has(active)) view.split.activePane = active;
|
|
23478
23623
|
}
|
|
23479
23624
|
}
|
|
23480
23625
|
const topLeft = parseAddress(
|
|
@@ -43663,6 +43808,49 @@ var WORKSHEET_CHILD_ORDER = [
|
|
|
43663
43808
|
"extLst"
|
|
43664
43809
|
];
|
|
43665
43810
|
|
|
43811
|
+
// xlsx/read/data-validations.ts
|
|
43812
|
+
var VALIDATION_XM = "http://schemas.microsoft.com/office/excel/2006/main";
|
|
43813
|
+
var TYPES = /* @__PURE__ */ new Set(["none", "whole", "decimal", "list", "date", "time", "textLength", "custom"]);
|
|
43814
|
+
var ERROR_STYLES = /* @__PURE__ */ new Set(["stop", "warning", "information"]);
|
|
43815
|
+
function readDataValidation(dv) {
|
|
43816
|
+
const extended = dv.namespaceURI === NS.x14;
|
|
43817
|
+
const ns = extended ? NS.x14 : NS.x;
|
|
43818
|
+
const ranges = parseSqref(
|
|
43819
|
+
extended ? first(dv, "sqref", VALIDATION_XM)?.textContent ?? "" : att(dv, "sqref")
|
|
43820
|
+
);
|
|
43821
|
+
if (!ranges.length) return void 0;
|
|
43822
|
+
const type = att(dv, "type") ?? "none";
|
|
43823
|
+
const validation = {
|
|
43824
|
+
ranges,
|
|
43825
|
+
type: TYPES.has(type) ? type : "none"
|
|
43826
|
+
};
|
|
43827
|
+
const operator = att(dv, "operator");
|
|
43828
|
+
if (operator) validation.operator = operator;
|
|
43829
|
+
for (const key of ["formula1", "formula2"]) {
|
|
43830
|
+
const container = first(dv, key, ns);
|
|
43831
|
+
const formula2 = extended ? first(container, "f", VALIDATION_XM) : container;
|
|
43832
|
+
if (formula2) validation[key] = stripFuturePrefixes(formula2.textContent ?? "");
|
|
43833
|
+
}
|
|
43834
|
+
if (boolAttr(dv, "allowBlank")) validation.allowBlank = true;
|
|
43835
|
+
const hideDropDown = boolAttr(dv, "showDropDown");
|
|
43836
|
+
if (validation.type === "list") validation.showDropDown = !hideDropDown;
|
|
43837
|
+
else if (hideDropDown) validation.showDropDown = false;
|
|
43838
|
+
if (boolAttr(dv, "showErrorMessage")) validation.showErrorMessage = true;
|
|
43839
|
+
if (boolAttr(dv, "showInputMessage")) validation.showInputMessage = true;
|
|
43840
|
+
const errorStyle = att(dv, "errorStyle");
|
|
43841
|
+
if (errorStyle && ERROR_STYLES.has(errorStyle))
|
|
43842
|
+
validation.errorStyle = errorStyle;
|
|
43843
|
+
for (const key of ["errorTitle", "error", "promptTitle", "prompt"]) {
|
|
43844
|
+
const value2 = att(dv, key);
|
|
43845
|
+
if (value2 !== void 0) validation[key] = value2;
|
|
43846
|
+
}
|
|
43847
|
+
if (extended) validation.extensionXml = selfContainedXml(dv);
|
|
43848
|
+
return validation;
|
|
43849
|
+
}
|
|
43850
|
+
function readDataValidations(node2) {
|
|
43851
|
+
return node2 ? children(node2, "dataValidation", NS.x).flatMap((dv) => readDataValidation(dv) ?? []) : [];
|
|
43852
|
+
}
|
|
43853
|
+
|
|
43666
43854
|
// xlsx/read/conditional.ts
|
|
43667
43855
|
var CFVO_TYPES = /* @__PURE__ */ new Set(["min", "max", "num", "percent", "percentile", "formula"]);
|
|
43668
43856
|
function cfvo(node2) {
|
|
@@ -43789,55 +43977,151 @@ function readConditionalFormats(blocks, dxfs, palette, warn) {
|
|
|
43789
43977
|
}
|
|
43790
43978
|
return out;
|
|
43791
43979
|
}
|
|
43792
|
-
|
|
43793
|
-
|
|
43794
|
-
|
|
43795
|
-
|
|
43796
|
-
|
|
43797
|
-
|
|
43798
|
-
|
|
43799
|
-
|
|
43800
|
-
|
|
43801
|
-
|
|
43802
|
-
|
|
43803
|
-
|
|
43804
|
-
|
|
43805
|
-
|
|
43806
|
-
|
|
43807
|
-
|
|
43808
|
-
|
|
43809
|
-
|
|
43810
|
-
|
|
43811
|
-
|
|
43812
|
-
|
|
43813
|
-
|
|
43814
|
-
|
|
43815
|
-
|
|
43816
|
-
|
|
43817
|
-
|
|
43818
|
-
|
|
43819
|
-
|
|
43820
|
-
|
|
43821
|
-
|
|
43822
|
-
|
|
43823
|
-
|
|
43824
|
-
|
|
43825
|
-
|
|
43826
|
-
const
|
|
43827
|
-
|
|
43828
|
-
validation.errorStyle = errorStyle;
|
|
43829
|
-
for (const key of ["errorTitle", "error", "promptTitle", "prompt"]) {
|
|
43830
|
-
const value2 = att(dv, key);
|
|
43831
|
-
if (value2 !== void 0) validation[key] = value2;
|
|
43832
|
-
}
|
|
43833
|
-
out.push(validation);
|
|
43980
|
+
|
|
43981
|
+
// xlsx/write/data-validations.ts
|
|
43982
|
+
function usesValidationExtension(dv) {
|
|
43983
|
+
if (dv.extensionXml) return true;
|
|
43984
|
+
return [dv.formula1, dv.formula2].some((formula2) => {
|
|
43985
|
+
if (!formula2) return false;
|
|
43986
|
+
try {
|
|
43987
|
+
return tokenize(formula2).some((token2) => token2.prefix !== void 0);
|
|
43988
|
+
} catch {
|
|
43989
|
+
return false;
|
|
43990
|
+
}
|
|
43991
|
+
});
|
|
43992
|
+
}
|
|
43993
|
+
function validationAttributes(dv) {
|
|
43994
|
+
return {
|
|
43995
|
+
type: dv.type === "none" ? void 0 : dv.type,
|
|
43996
|
+
errorStyle: dv.errorStyle,
|
|
43997
|
+
operator: dv.operator,
|
|
43998
|
+
allowBlank: dv.allowBlank || void 0,
|
|
43999
|
+
showDropDown: dv.showDropDown === false ? true : void 0,
|
|
44000
|
+
showInputMessage: dv.showInputMessage || void 0,
|
|
44001
|
+
showErrorMessage: dv.showErrorMessage || void 0,
|
|
44002
|
+
errorTitle: dv.errorTitle,
|
|
44003
|
+
error: dv.error,
|
|
44004
|
+
promptTitle: dv.promptTitle,
|
|
44005
|
+
prompt: dv.prompt
|
|
44006
|
+
};
|
|
44007
|
+
}
|
|
44008
|
+
function dataValidationXml(dv, extended) {
|
|
44009
|
+
const sqref2 = dv.ranges.map(formatRange).join(" ");
|
|
44010
|
+
if (!extended) {
|
|
44011
|
+
const formulas = ["formula1", "formula2"].map(
|
|
44012
|
+
(key) => dv[key] === void 0 ? "" : `<${key}>${escapeText(addFuturePrefixes(dv[key]))}</${key}>`
|
|
44013
|
+
).join("");
|
|
44014
|
+
const values2 = attrs2({ ...validationAttributes(dv), sqref: sqref2 });
|
|
44015
|
+
return formulas ? `<dataValidation${values2}>${formulas}</dataValidation>` : `<dataValidation${values2}/>`;
|
|
43834
44016
|
}
|
|
43835
|
-
|
|
44017
|
+
const doc = parseXml(
|
|
44018
|
+
dv.extensionXml || `<x14:dataValidation xmlns:x14="${NS.x14}" xmlns:xm="${VALIDATION_XM}"/>`
|
|
44019
|
+
);
|
|
44020
|
+
const node2 = doc.documentElement;
|
|
44021
|
+
for (const [key, value2] of Object.entries(validationAttributes(dv))) {
|
|
44022
|
+
if (value2 === void 0) node2.removeAttribute(key);
|
|
44023
|
+
else node2.setAttribute(key, typeof value2 === "boolean" ? "1" : value2);
|
|
44024
|
+
}
|
|
44025
|
+
for (const key of ["formula1", "formula2"]) {
|
|
44026
|
+
let container = first(node2, key, NS.x14);
|
|
44027
|
+
if (dv[key] === void 0) {
|
|
44028
|
+
if (container) node2.removeChild(container);
|
|
44029
|
+
continue;
|
|
44030
|
+
}
|
|
44031
|
+
if (!container) {
|
|
44032
|
+
container = doc.createElementNS(NS.x14, `x14:${key}`);
|
|
44033
|
+
const next = key === "formula1" ? first(node2, "formula2", NS.x14) : void 0;
|
|
44034
|
+
node2.insertBefore(container, next ?? first(node2, "sqref", VALIDATION_XM) ?? null);
|
|
44035
|
+
}
|
|
44036
|
+
let formula2 = first(container, "f", VALIDATION_XM);
|
|
44037
|
+
if (!formula2) {
|
|
44038
|
+
formula2 = doc.createElementNS(VALIDATION_XM, "xm:f");
|
|
44039
|
+
container.appendChild(formula2);
|
|
44040
|
+
}
|
|
44041
|
+
formula2.textContent = addFuturePrefixes(dv[key]);
|
|
44042
|
+
}
|
|
44043
|
+
let ranges = first(node2, "sqref", VALIDATION_XM);
|
|
44044
|
+
if (!ranges) {
|
|
44045
|
+
ranges = doc.createElementNS(VALIDATION_XM, "xm:sqref");
|
|
44046
|
+
node2.appendChild(ranges);
|
|
44047
|
+
}
|
|
44048
|
+
ranges.textContent = sqref2;
|
|
44049
|
+
return buildXml(doc);
|
|
44050
|
+
}
|
|
44051
|
+
function dataValidationsXml(validations) {
|
|
44052
|
+
const items = validations.filter((dv) => dv.ranges.length && !usesValidationExtension(dv)).map((dv) => dataValidationXml(dv, false));
|
|
44053
|
+
return items.length ? `<dataValidations count="${items.length}">${items.join("")}</dataValidations>` : "";
|
|
44054
|
+
}
|
|
44055
|
+
|
|
44056
|
+
// xlsx/validation-extensions.ts
|
|
44057
|
+
var URI = "{CCE6A557-97BC-4b89-ADB6-D9C93CAAB3DF}";
|
|
44058
|
+
function readValidationExtensions(sheet) {
|
|
44059
|
+
const kept = [];
|
|
44060
|
+
for (const xml of sheet.preserved.get("extLst") ?? []) {
|
|
44061
|
+
const doc = parseXml(xml);
|
|
44062
|
+
let changed = false;
|
|
44063
|
+
for (const ext of children(doc.documentElement, "ext", NS.x)) {
|
|
44064
|
+
if (ext.getAttribute("uri")?.toUpperCase() !== URI.toUpperCase()) continue;
|
|
44065
|
+
const collection = first(ext, "dataValidations", NS.x14);
|
|
44066
|
+
if (!collection) continue;
|
|
44067
|
+
for (const node2 of children(collection, "dataValidation", NS.x14)) {
|
|
44068
|
+
const rule = readDataValidation(node2);
|
|
44069
|
+
if (!rule) continue;
|
|
44070
|
+
sheet.dataValidations.push(rule);
|
|
44071
|
+
collection.removeChild(node2);
|
|
44072
|
+
changed = true;
|
|
44073
|
+
}
|
|
44074
|
+
collection.setAttribute(
|
|
44075
|
+
"count",
|
|
44076
|
+
String(children(collection, "dataValidation", NS.x14).length)
|
|
44077
|
+
);
|
|
44078
|
+
}
|
|
44079
|
+
if (!changed) kept.push(xml);
|
|
44080
|
+
else if (elements(doc.documentElement).length) kept.push(buildXml(doc));
|
|
44081
|
+
}
|
|
44082
|
+
if (kept.length) sheet.preserved.set("extLst", kept);
|
|
44083
|
+
else sheet.preserved.delete("extLst");
|
|
44084
|
+
}
|
|
44085
|
+
function validationExtensionsXml(sheet, extensions, ids = /* @__PURE__ */ new Set()) {
|
|
44086
|
+
const rules = sheet.dataValidations.filter(
|
|
44087
|
+
(dv) => dv.ranges.length && usesValidationExtension(dv)
|
|
44088
|
+
);
|
|
44089
|
+
const doc = parseXml(extensions || `<extLst xmlns="${NS.x}"/>`);
|
|
44090
|
+
let ext = elements(doc.documentElement).find(
|
|
44091
|
+
(node2) => node2.getAttribute("uri")?.toUpperCase() === URI.toUpperCase()
|
|
44092
|
+
);
|
|
44093
|
+
if (!rules.length) {
|
|
44094
|
+
const collection2 = first(ext, "dataValidations", NS.x14);
|
|
44095
|
+
if (ext && collection2 && !elements(collection2).length) {
|
|
44096
|
+
ext.removeChild(collection2);
|
|
44097
|
+
if (!elements(ext).length) doc.documentElement.removeChild(ext);
|
|
44098
|
+
}
|
|
44099
|
+
return elements(doc.documentElement).length ? inlineFragment(buildXml(doc)) : "";
|
|
44100
|
+
}
|
|
44101
|
+
if (!ext) {
|
|
44102
|
+
ext = doc.createElementNS(NS.x, "ext");
|
|
44103
|
+
ext.setAttribute("uri", URI);
|
|
44104
|
+
doc.documentElement.appendChild(ext);
|
|
44105
|
+
}
|
|
44106
|
+
let collection = first(ext, "dataValidations", NS.x14);
|
|
44107
|
+
if (!collection) {
|
|
44108
|
+
collection = doc.createElementNS(NS.x14, "x14:dataValidations");
|
|
44109
|
+
ext.appendChild(collection);
|
|
44110
|
+
}
|
|
44111
|
+
for (const rule of rules) {
|
|
44112
|
+
const node2 = doc.importNode(parseXml(dataValidationXml(rule, true)).documentElement, true);
|
|
44113
|
+
const id = node2.getAttributeNS(NS.xr, "uid");
|
|
44114
|
+
if (id && ids.has(id)) node2.removeAttributeNS(NS.xr, "uid");
|
|
44115
|
+
else if (id) ids.add(id);
|
|
44116
|
+
collection.appendChild(node2);
|
|
44117
|
+
}
|
|
44118
|
+
collection.setAttribute("count", String(children(collection, "dataValidation", NS.x14).length));
|
|
44119
|
+
return inlineFragment(buildXml(doc));
|
|
43836
44120
|
}
|
|
43837
44121
|
|
|
43838
44122
|
// xlsx/conditional-extensions.ts
|
|
43839
44123
|
var XM = "http://schemas.microsoft.com/office/excel/2006/main";
|
|
43840
|
-
var
|
|
44124
|
+
var URI2 = "{78C0D931-6437-407d-A8EE-F0AAD7539E65}";
|
|
43841
44125
|
function writeSettings(node2, rule) {
|
|
43842
44126
|
const bar = first(node2, "dataBar", NS.x14);
|
|
43843
44127
|
if (!bar) return;
|
|
@@ -43931,14 +44215,14 @@ function conditionalExtensionsXml(sheet) {
|
|
|
43931
44215
|
for (const xml of preserved.slice(1))
|
|
43932
44216
|
for (const node2 of elements(parseXml(xml).documentElement))
|
|
43933
44217
|
doc.documentElement.appendChild(doc.importNode(node2, true));
|
|
43934
|
-
let ext = elements(doc.documentElement).find((e) => e.getAttribute("uri") ===
|
|
44218
|
+
let ext = elements(doc.documentElement).find((e) => e.getAttribute("uri") === URI2);
|
|
43935
44219
|
let collection = first(ext, "conditionalFormattings", NS.x14);
|
|
43936
44220
|
for (const format of sheet.conditionalFormats)
|
|
43937
44221
|
for (const rule of format.rules) {
|
|
43938
44222
|
if (rule.type !== "dataBar" || !rule.extensionXml || !rule.extensionId) continue;
|
|
43939
44223
|
if (!ext) {
|
|
43940
44224
|
ext = doc.createElementNS(NS.x, "ext");
|
|
43941
|
-
ext.setAttribute("uri",
|
|
44225
|
+
ext.setAttribute("uri", URI2);
|
|
43942
44226
|
doc.documentElement.appendChild(ext);
|
|
43943
44227
|
}
|
|
43944
44228
|
if (!collection) {
|
|
@@ -47900,7 +48184,7 @@ function slicerFrameXml(kind, name, id, anchor, box2) {
|
|
|
47900
48184
|
}
|
|
47901
48185
|
|
|
47902
48186
|
// xlsx/read/form-control.ts
|
|
47903
|
-
var
|
|
48187
|
+
var TYPES2 = {
|
|
47904
48188
|
checkbox: "checkbox",
|
|
47905
48189
|
radio: "radio",
|
|
47906
48190
|
drop: "dropdown",
|
|
@@ -47942,7 +48226,7 @@ var num4 = (value2) => {
|
|
|
47942
48226
|
};
|
|
47943
48227
|
function readProps(control, xml) {
|
|
47944
48228
|
const props = parseXml(xml, { label: "XLSX form control" }).documentElement;
|
|
47945
|
-
control.controlType =
|
|
48229
|
+
control.controlType = TYPES2[(att(props, "objectType") ?? "").toLowerCase()] ?? "other";
|
|
47946
48230
|
const link = att(props, "fmlaLink");
|
|
47947
48231
|
if (link) control.linkedCell = link;
|
|
47948
48232
|
const range = att(props, "fmlaRange");
|
|
@@ -48717,12 +49001,21 @@ function readTables(ctx, partName, node2, sheet) {
|
|
|
48717
49001
|
function readComments(ctx, partName, sheet) {
|
|
48718
49002
|
const legacyPart = ctx.source.targetOfType(partName, RELATIONSHIP_TYPES.comments);
|
|
48719
49003
|
const threadedPart = ctx.source.targetOfType(partName, RELATIONSHIP_TYPES.threadedComment);
|
|
49004
|
+
const personsPart = ctx.source.targetOfType(
|
|
49005
|
+
ctx.source.workbookPart() ?? "",
|
|
49006
|
+
RELATIONSHIP_TYPES.person
|
|
49007
|
+
);
|
|
48720
49008
|
const legacy = parseLegacyComments(legacyPart ? ctx.source.text(legacyPart) : void 0);
|
|
48721
49009
|
const threaded = parseThreadedComments(
|
|
48722
49010
|
threadedPart ? ctx.source.text(threadedPart) : void 0,
|
|
48723
|
-
ctx.persons
|
|
49011
|
+
ctx.persons,
|
|
49012
|
+
personsPart ? ctx.source.text(personsPart) : void 0
|
|
48724
49013
|
);
|
|
48725
49014
|
sheet.comments = mergeComments(legacy, threaded);
|
|
49015
|
+
const envelope = threadedCommentEnvelope(
|
|
49016
|
+
threadedPart ? ctx.source.text(threadedPart) : void 0
|
|
49017
|
+
);
|
|
49018
|
+
if (envelope) sheet.threadedCommentsXml = envelope;
|
|
48726
49019
|
}
|
|
48727
49020
|
function parseWorksheet(ctx, partName, name, sheetId) {
|
|
48728
49021
|
const xml = ctx.source.text(partName);
|
|
@@ -48793,6 +49086,7 @@ function readWorksheet(ctx, partName, name, sheetId, xml, rows2) {
|
|
|
48793
49086
|
const scenarios = readScenarios(byName.get("scenarios"));
|
|
48794
49087
|
if (scenarios) sheet.scenarios = scenarios;
|
|
48795
49088
|
sheet.dataValidations = readDataValidations(byName.get("dataValidations"));
|
|
49089
|
+
readValidationExtensions(sheet);
|
|
48796
49090
|
readConditionalExtensions(sheet);
|
|
48797
49091
|
sheet.hyperlinks = readHyperlinks(ctx, partName, byName.get("hyperlinks"));
|
|
48798
49092
|
const page = readPageSetup(
|
|
@@ -49164,7 +49458,7 @@ var PartReader = class {
|
|
|
49164
49458
|
|
|
49165
49459
|
// xlsx/read/sparklines.ts
|
|
49166
49460
|
var XM2 = "http://schemas.microsoft.com/office/excel/2006/main";
|
|
49167
|
-
var
|
|
49461
|
+
var TYPES3 = ["line", "column", "stacked"];
|
|
49168
49462
|
var EMPTY = ["gap", "zero", "span"];
|
|
49169
49463
|
var AXES = ["individual", "group", "custom"];
|
|
49170
49464
|
var COLORS = [
|
|
@@ -49187,7 +49481,7 @@ var text = (element3) => {
|
|
|
49187
49481
|
function readSparklineGroup(node2) {
|
|
49188
49482
|
const attr3 = (name) => node2.hasAttribute(name) ? node2.getAttribute(name) : null;
|
|
49189
49483
|
const group2 = {
|
|
49190
|
-
type: pick2(attr3("type"),
|
|
49484
|
+
type: pick2(attr3("type"), TYPES3, "line"),
|
|
49191
49485
|
lineWeight: numAttr(node2, "lineWeight") ?? 0.75,
|
|
49192
49486
|
dateAxis: boolAttr(node2, "dateAxis", false),
|
|
49193
49487
|
markers: boolAttr(node2, "markers", false),
|
|
@@ -49248,7 +49542,7 @@ function sheetSparklineGroups(sheet) {
|
|
|
49248
49542
|
return groups;
|
|
49249
49543
|
}
|
|
49250
49544
|
|
|
49251
|
-
// xlsx/write/
|
|
49545
|
+
// xlsx/write/comment-ids.ts
|
|
49252
49546
|
function guidFrom(seed) {
|
|
49253
49547
|
let h1 = 2166136261;
|
|
49254
49548
|
let h2 = 16777619;
|
|
@@ -49264,32 +49558,406 @@ function guidFrom(seed) {
|
|
|
49264
49558
|
const s = hex2.join("");
|
|
49265
49559
|
return `{${s.slice(0, 8)}-${s.slice(8, 12)}-4${s.slice(13, 16)}-8${s.slice(17, 20)}-${s.slice(20, 32)}}`;
|
|
49266
49560
|
}
|
|
49267
|
-
var
|
|
49561
|
+
var validGuid = (id) => /^\{[\da-f]{8}(?:-[\da-f]{4}){3}-[\da-f]{12}\}$/i.test(id);
|
|
49562
|
+
var CommentIds = class {
|
|
49563
|
+
reserved = /* @__PURE__ */ new Map();
|
|
49564
|
+
used = /* @__PURE__ */ new Set();
|
|
49565
|
+
mentions = /* @__PURE__ */ new WeakMap();
|
|
49566
|
+
constructor(workbook) {
|
|
49567
|
+
for (const matching2 of [true, false])
|
|
49568
|
+
for (const sheet of workbook?.sheets ?? []) {
|
|
49569
|
+
for (const comment of sheet.comments)
|
|
49570
|
+
for (const message of [comment, ...comment.replies ?? []]) {
|
|
49571
|
+
if (comment.regenerateThreadIds) continue;
|
|
49572
|
+
if (!message.threadedXml) continue;
|
|
49573
|
+
const node2 = parseXml(message.threadedXml).documentElement;
|
|
49574
|
+
if (node2.getAttribute("ref") === formatAddress(comment.address) !== matching2)
|
|
49575
|
+
continue;
|
|
49576
|
+
this.reserve(node2.getAttribute("id") ?? "", message);
|
|
49577
|
+
const mentions = first(node2, "mentions", NS.tc);
|
|
49578
|
+
if (mentions)
|
|
49579
|
+
children(mentions, "mention", NS.tc).forEach((mention, index3) => {
|
|
49580
|
+
this.reserve(
|
|
49581
|
+
mention.getAttribute("mentionId") ?? "",
|
|
49582
|
+
this.mentionOwner(message, index3)
|
|
49583
|
+
);
|
|
49584
|
+
});
|
|
49585
|
+
}
|
|
49586
|
+
}
|
|
49587
|
+
}
|
|
49588
|
+
reserve(id, owner) {
|
|
49589
|
+
const key = id.toUpperCase();
|
|
49590
|
+
if (validGuid(id) && !this.reserved.has(key)) this.reserved.set(key, owner);
|
|
49591
|
+
}
|
|
49592
|
+
mentionOwner(message, index3) {
|
|
49593
|
+
let owners = this.mentions.get(message);
|
|
49594
|
+
if (!owners) this.mentions.set(message, owners = []);
|
|
49595
|
+
return owners[index3] ??= {};
|
|
49596
|
+
}
|
|
49597
|
+
claim(source3, seed, owner, preserve = true) {
|
|
49598
|
+
const key = source3.toUpperCase();
|
|
49599
|
+
if (preserve && validGuid(source3) && !this.used.has(key) && (!this.reserved.has(key) || this.reserved.get(key) === owner)) {
|
|
49600
|
+
this.used.add(key);
|
|
49601
|
+
return source3;
|
|
49602
|
+
}
|
|
49603
|
+
let index3 = 0;
|
|
49604
|
+
let id = guidFrom(seed);
|
|
49605
|
+
while (this.used.has(id) || this.reserved.has(id)) id = guidFrom(`${seed}:${++index3}`);
|
|
49606
|
+
this.used.add(id);
|
|
49607
|
+
return id;
|
|
49608
|
+
}
|
|
49609
|
+
};
|
|
49610
|
+
|
|
49611
|
+
// text/text-diff.ts
|
|
49612
|
+
var isLowSurrogate = (text3, at2) => {
|
|
49613
|
+
const code = text3.charCodeAt(at2);
|
|
49614
|
+
return code >= 56320 && code <= 57343;
|
|
49615
|
+
};
|
|
49616
|
+
function shortestEdit(n2, m, same11, maxEdits) {
|
|
49617
|
+
const max = Math.min(n2 + m, maxEdits);
|
|
49618
|
+
const offset2 = max + 1;
|
|
49619
|
+
const v = new Int32Array(2 * max + 3);
|
|
49620
|
+
const trace = [];
|
|
49621
|
+
for (let d = 0; d <= max; d++) {
|
|
49622
|
+
for (let k = -d; k <= d; k += 2) {
|
|
49623
|
+
const down = k === -d || k !== d && v[offset2 + k - 1] < v[offset2 + k + 1];
|
|
49624
|
+
let x = down ? v[offset2 + k + 1] : v[offset2 + k - 1] + 1;
|
|
49625
|
+
let y = x - k;
|
|
49626
|
+
while (x < n2 && y < m && same11(x, y)) {
|
|
49627
|
+
x++;
|
|
49628
|
+
y++;
|
|
49629
|
+
}
|
|
49630
|
+
v[offset2 + k] = x;
|
|
49631
|
+
if (x >= n2 && y >= m) return backtrack(trace, n2, m, d);
|
|
49632
|
+
}
|
|
49633
|
+
trace.push(v.slice(offset2 - d, offset2 + d + 1));
|
|
49634
|
+
}
|
|
49635
|
+
return void 0;
|
|
49636
|
+
}
|
|
49637
|
+
function backtrack(trace, n2, m, d) {
|
|
49638
|
+
const edits = [];
|
|
49639
|
+
let x = n2;
|
|
49640
|
+
let y = m;
|
|
49641
|
+
for (let step2 = d; step2 > 0; step2--) {
|
|
49642
|
+
const previous = trace[step2 - 1];
|
|
49643
|
+
const at2 = (k2) => previous[k2 + step2 - 1];
|
|
49644
|
+
const k = x - y;
|
|
49645
|
+
const down = k === -step2 || k !== step2 && at2(k - 1) < at2(k + 1);
|
|
49646
|
+
const before = down ? k + 1 : k - 1;
|
|
49647
|
+
const startX = at2(before);
|
|
49648
|
+
const startY = startX - before;
|
|
49649
|
+
edits.push(down ? [startX, startY, true] : [startX, startY, false]);
|
|
49650
|
+
x = startX;
|
|
49651
|
+
y = startY;
|
|
49652
|
+
}
|
|
49653
|
+
return edits.reverse();
|
|
49654
|
+
}
|
|
49655
|
+
function changesOf(edits) {
|
|
49656
|
+
const changes = [];
|
|
49657
|
+
for (const [x, y, inserts] of edits) {
|
|
49658
|
+
const last = changes.at(-1);
|
|
49659
|
+
if (last && last.fromEnd === x && last.toEnd === y) {
|
|
49660
|
+
if (inserts) last.toEnd++;
|
|
49661
|
+
else last.fromEnd++;
|
|
49662
|
+
} else
|
|
49663
|
+
changes.push({
|
|
49664
|
+
fromStart: x,
|
|
49665
|
+
fromEnd: inserts ? x : x + 1,
|
|
49666
|
+
toStart: y,
|
|
49667
|
+
toEnd: inserts ? y + 1 : y
|
|
49668
|
+
});
|
|
49669
|
+
}
|
|
49670
|
+
return changes;
|
|
49671
|
+
}
|
|
49672
|
+
function characterChanges(a2, b, maxEdits) {
|
|
49673
|
+
const edits = shortestEdit(
|
|
49674
|
+
a2.length,
|
|
49675
|
+
b.length,
|
|
49676
|
+
(x, y) => a2.charCodeAt(x) === b.charCodeAt(y),
|
|
49677
|
+
maxEdits
|
|
49678
|
+
);
|
|
49679
|
+
return edits && changesOf(edits);
|
|
49680
|
+
}
|
|
49681
|
+
var TOKEN = /[\p{L}\p{N}\p{M}]+|\s+|[\s\S]/gu;
|
|
49682
|
+
function tokensOf(text3, ids) {
|
|
49683
|
+
const tokens2 = [];
|
|
49684
|
+
const starts = [];
|
|
49685
|
+
for (const match2 of text3.matchAll(TOKEN)) {
|
|
49686
|
+
let id = ids.get(match2[0]);
|
|
49687
|
+
if (id === void 0) ids.set(match2[0], id = ids.size);
|
|
49688
|
+
tokens2.push(id);
|
|
49689
|
+
starts.push(match2.index);
|
|
49690
|
+
}
|
|
49691
|
+
starts.push(text3.length);
|
|
49692
|
+
return { tokens: tokens2, starts };
|
|
49693
|
+
}
|
|
49694
|
+
function tokenChanges(a2, b, maxEdits) {
|
|
49695
|
+
const ids = /* @__PURE__ */ new Map();
|
|
49696
|
+
const from = tokensOf(a2, ids);
|
|
49697
|
+
const to = tokensOf(b, ids);
|
|
49698
|
+
const edits = shortestEdit(
|
|
49699
|
+
from.tokens.length,
|
|
49700
|
+
to.tokens.length,
|
|
49701
|
+
(x, y) => from.tokens[x] === to.tokens[y],
|
|
49702
|
+
maxEdits
|
|
49703
|
+
);
|
|
49704
|
+
if (!edits) return void 0;
|
|
49705
|
+
let budget = maxEdits;
|
|
49706
|
+
return changesOf(edits).flatMap((stretch) => {
|
|
49707
|
+
const change = {
|
|
49708
|
+
fromStart: from.starts[stretch.fromStart],
|
|
49709
|
+
fromEnd: from.starts[stretch.fromEnd],
|
|
49710
|
+
toStart: to.starts[stretch.toStart],
|
|
49711
|
+
toEnd: to.starts[stretch.toEnd]
|
|
49712
|
+
};
|
|
49713
|
+
const inner2 = change.fromEnd > change.fromStart && change.toEnd > change.toStart ? characterChanges(
|
|
49714
|
+
a2.slice(change.fromStart, change.fromEnd),
|
|
49715
|
+
b.slice(change.toStart, change.toEnd),
|
|
49716
|
+
budget
|
|
49717
|
+
) : void 0;
|
|
49718
|
+
if (!inner2) return [change];
|
|
49719
|
+
for (const found of inner2)
|
|
49720
|
+
budget -= found.fromEnd - found.fromStart + found.toEnd - found.toStart;
|
|
49721
|
+
return inner2.map((found) => ({
|
|
49722
|
+
fromStart: found.fromStart + change.fromStart,
|
|
49723
|
+
fromEnd: found.fromEnd + change.fromStart,
|
|
49724
|
+
toStart: found.toStart + change.toStart,
|
|
49725
|
+
toEnd: found.toEnd + change.toStart
|
|
49726
|
+
}));
|
|
49727
|
+
});
|
|
49728
|
+
}
|
|
49729
|
+
function diffText(from, to, maxEdits = 500) {
|
|
49730
|
+
let start = 0;
|
|
49731
|
+
while (start < from.length && start < to.length && from.charCodeAt(start) === to.charCodeAt(start))
|
|
49732
|
+
start++;
|
|
49733
|
+
let end = 0;
|
|
49734
|
+
while (end < from.length - start && end < to.length - start && from.charCodeAt(from.length - 1 - end) === to.charCodeAt(to.length - 1 - end))
|
|
49735
|
+
end++;
|
|
49736
|
+
const a2 = from.slice(start, from.length - end);
|
|
49737
|
+
const b = to.slice(start, to.length - end);
|
|
49738
|
+
if (!a2.length && !b.length) return [];
|
|
49739
|
+
const found = a2.length && b.length ? characterChanges(a2, b, maxEdits) ?? tokenChanges(a2, b, maxEdits) : void 0;
|
|
49740
|
+
const changes = found ?? [{ fromStart: 0, fromEnd: a2.length, toStart: 0, toEnd: b.length }];
|
|
49741
|
+
const result2 = [];
|
|
49742
|
+
for (const change of changes) {
|
|
49743
|
+
const placed = {
|
|
49744
|
+
fromStart: change.fromStart + start,
|
|
49745
|
+
fromEnd: change.fromEnd + start,
|
|
49746
|
+
toStart: change.toStart + start,
|
|
49747
|
+
toEnd: change.toEnd + start
|
|
49748
|
+
};
|
|
49749
|
+
if (placed.fromStart > 0 && placed.toStart > 0 && (isLowSurrogate(from, placed.fromStart) || isLowSurrogate(to, placed.toStart))) {
|
|
49750
|
+
placed.fromStart--;
|
|
49751
|
+
placed.toStart--;
|
|
49752
|
+
}
|
|
49753
|
+
if (isLowSurrogate(from, placed.fromEnd) || isLowSurrogate(to, placed.toEnd)) {
|
|
49754
|
+
placed.fromEnd++;
|
|
49755
|
+
placed.toEnd++;
|
|
49756
|
+
}
|
|
49757
|
+
const last = result2.at(-1);
|
|
49758
|
+
if (last && placed.fromStart <= last.fromEnd) {
|
|
49759
|
+
last.fromEnd = Math.max(last.fromEnd, placed.fromEnd);
|
|
49760
|
+
last.toEnd = Math.max(last.toEnd, placed.toEnd);
|
|
49761
|
+
} else result2.push(placed);
|
|
49762
|
+
}
|
|
49763
|
+
return result2;
|
|
49764
|
+
}
|
|
49765
|
+
|
|
49766
|
+
// xlsx/write/comment-mentions.ts
|
|
49767
|
+
function patchCommentMentions(node2, before, message, ids, commentId, preserveIds) {
|
|
49768
|
+
const container = first(node2, "mentions", NS.tc);
|
|
49769
|
+
if (!container) return;
|
|
49770
|
+
const changes = diffText(before, message.text);
|
|
49771
|
+
children(container, "mention", NS.tc).forEach((mention, index3) => {
|
|
49772
|
+
const start = Number(mention.getAttribute("startIndex"));
|
|
49773
|
+
const length = Number(mention.getAttribute("length"));
|
|
49774
|
+
const end = start + length;
|
|
49775
|
+
let shift3 = 0;
|
|
49776
|
+
let intact = Number.isInteger(start) && start >= 0 && Number.isInteger(length) && length > 0 && end <= before.length;
|
|
49777
|
+
for (const change of changes) {
|
|
49778
|
+
if (change.fromEnd <= start)
|
|
49779
|
+
shift3 += change.toEnd - change.toStart - (change.fromEnd - change.fromStart);
|
|
49780
|
+
else if (change.fromStart < end) intact = false;
|
|
49781
|
+
}
|
|
49782
|
+
if (!intact) {
|
|
49783
|
+
container.removeChild(mention);
|
|
49784
|
+
return;
|
|
49785
|
+
}
|
|
49786
|
+
mention.setAttribute("startIndex", String(start + shift3));
|
|
49787
|
+
mention.setAttribute(
|
|
49788
|
+
"mentionId",
|
|
49789
|
+
ids.claim(
|
|
49790
|
+
mention.getAttribute("mentionId") ?? "",
|
|
49791
|
+
`${commentId}:mention:${index3}`,
|
|
49792
|
+
ids.mentionOwner(message, index3),
|
|
49793
|
+
preserveIds
|
|
49794
|
+
)
|
|
49795
|
+
);
|
|
49796
|
+
});
|
|
49797
|
+
if (!children(container, "mention", NS.tc).length) node2.removeChild(container);
|
|
49798
|
+
}
|
|
49799
|
+
|
|
49800
|
+
// xlsx/write/threaded-comments.ts
|
|
49801
|
+
var ThreadedCommentsWriter = class {
|
|
49802
|
+
constructor(persons, options2 = {}) {
|
|
49803
|
+
this.persons = persons;
|
|
49804
|
+
this.doc = parseXml(
|
|
49805
|
+
options2.envelope ?? `${XML_HEADER}<ThreadedComments xmlns="${NS.tc}" xmlns:x="${NS.x}"/>`
|
|
49806
|
+
);
|
|
49807
|
+
for (const node2 of children(this.doc.documentElement, "threadedComment", NS.tc))
|
|
49808
|
+
this.doc.documentElement.removeChild(node2);
|
|
49809
|
+
this.ids = options2.ids ?? new CommentIds();
|
|
49810
|
+
}
|
|
49811
|
+
persons;
|
|
49812
|
+
doc;
|
|
49813
|
+
ids;
|
|
49814
|
+
count = 0;
|
|
49815
|
+
add(comment, ref, sheetName) {
|
|
49816
|
+
this.persons.retain(comment.threadedPersons);
|
|
49817
|
+
const preserve = !comment.regenerateThreadIds;
|
|
49818
|
+
const prepare2 = (message, seed) => {
|
|
49819
|
+
const source3 = parseXml(message.threadedXml ?? `<threadedComment xmlns="${NS.tc}"/>`);
|
|
49820
|
+
const priorId = source3.documentElement.getAttribute("id") ?? "";
|
|
49821
|
+
const id = this.ids.claim(priorId, seed, message, preserve);
|
|
49822
|
+
return { message, source: source3, priorId, id };
|
|
49823
|
+
};
|
|
49824
|
+
const root = prepare2(comment, `${sheetName}!${ref}:${comment.text}`);
|
|
49825
|
+
const replies = (comment.replies ?? []).map(
|
|
49826
|
+
(reply, index3) => prepare2(reply, `${root.id}:reply:${index3}:${reply.text}`)
|
|
49827
|
+
);
|
|
49828
|
+
const identities = new Map(
|
|
49829
|
+
[root, ...replies].filter((item2) => item2.priorId).map((item2) => [item2.priorId.toUpperCase(), item2.id])
|
|
49830
|
+
);
|
|
49831
|
+
this.message(comment, ref, root.source, root.id, preserve, void 0, comment.resolved);
|
|
49832
|
+
for (const reply of replies)
|
|
49833
|
+
this.message(
|
|
49834
|
+
reply.message,
|
|
49835
|
+
ref,
|
|
49836
|
+
reply.source,
|
|
49837
|
+
reply.id,
|
|
49838
|
+
preserve,
|
|
49839
|
+
identities.get(
|
|
49840
|
+
(reply.source.documentElement.getAttribute("parentId") ?? "").toUpperCase()
|
|
49841
|
+
) ?? root.id
|
|
49842
|
+
);
|
|
49843
|
+
return root.id;
|
|
49844
|
+
}
|
|
49845
|
+
message(message, ref, source3, id, preserve, parent, resolved) {
|
|
49846
|
+
const node2 = source3.documentElement;
|
|
49847
|
+
const personId = this.persons.id(message.author, node2.getAttribute("personId") ?? void 0);
|
|
49848
|
+
for (const [key, value2] of Object.entries({
|
|
49849
|
+
id,
|
|
49850
|
+
ref,
|
|
49851
|
+
personId,
|
|
49852
|
+
dT: message.date,
|
|
49853
|
+
parentId: parent
|
|
49854
|
+
})) {
|
|
49855
|
+
if (value2 === void 0) node2.removeAttribute(key);
|
|
49856
|
+
else node2.setAttribute(key, value2);
|
|
49857
|
+
}
|
|
49858
|
+
if (!parent) {
|
|
49859
|
+
if (resolved === void 0) node2.removeAttribute("done");
|
|
49860
|
+
else node2.setAttribute("done", resolved ? "1" : "0");
|
|
49861
|
+
}
|
|
49862
|
+
let text3 = first(node2, "text", NS.tc);
|
|
49863
|
+
patchCommentMentions(node2, text3?.textContent ?? "", message, this.ids, id, preserve);
|
|
49864
|
+
if (!text3) {
|
|
49865
|
+
text3 = source3.createElementNS(NS.tc, node2.prefix ? `${node2.prefix}:text` : "text");
|
|
49866
|
+
node2.insertBefore(text3, node2.firstChild);
|
|
49867
|
+
}
|
|
49868
|
+
text3.textContent = message.text;
|
|
49869
|
+
const root = this.doc.documentElement;
|
|
49870
|
+
root.insertBefore(this.doc.importNode(node2, true), first(root, "extLst", NS.tc) ?? null);
|
|
49871
|
+
this.count++;
|
|
49872
|
+
}
|
|
49873
|
+
xml() {
|
|
49874
|
+
return this.count ? buildXml(this.doc) : void 0;
|
|
49875
|
+
}
|
|
49876
|
+
};
|
|
49877
|
+
|
|
49878
|
+
// xlsx/write/comment-persons.ts
|
|
49268
49879
|
var PersonRegistry = class {
|
|
49880
|
+
constructor(existing, source3) {
|
|
49881
|
+
this.source = source3;
|
|
49882
|
+
for (const [id, name] of existing ?? []) {
|
|
49883
|
+
this.names.set(id, name);
|
|
49884
|
+
this.identities.set(id.toUpperCase(), id);
|
|
49885
|
+
if (!this.byName.has(name)) this.byName.set(name, id);
|
|
49886
|
+
}
|
|
49887
|
+
}
|
|
49888
|
+
source;
|
|
49269
49889
|
names = /* @__PURE__ */ new Map();
|
|
49270
49890
|
byName = /* @__PURE__ */ new Map();
|
|
49271
|
-
|
|
49272
|
-
|
|
49891
|
+
identities = /* @__PURE__ */ new Map();
|
|
49892
|
+
added = /* @__PURE__ */ new Map();
|
|
49893
|
+
retained = /* @__PURE__ */ new Map();
|
|
49894
|
+
get changed() {
|
|
49895
|
+
return this.added.size > 0;
|
|
49896
|
+
}
|
|
49897
|
+
/** Bring referenced account records along with a thread copied from another workbook. */
|
|
49898
|
+
retain(records) {
|
|
49899
|
+
for (const [sourceId, xml] of Object.entries(records ?? {})) {
|
|
49900
|
+
const known = this.identities.get(sourceId.toUpperCase());
|
|
49901
|
+
if (known && (this.source || this.retained.has(known))) continue;
|
|
49902
|
+
const node2 = parseXml(xml).documentElement;
|
|
49903
|
+
if (node2.localName !== "person" || node2.namespaceURI !== NS.tc || node2.getAttribute("id")?.toUpperCase() !== sourceId.toUpperCase())
|
|
49904
|
+
continue;
|
|
49905
|
+
const name = node2.getAttribute("displayName") ?? "";
|
|
49906
|
+
const id = known ?? node2.getAttribute("id");
|
|
49907
|
+
this.retained.set(id, xml);
|
|
49273
49908
|
this.names.set(id, name);
|
|
49909
|
+
this.identities.set(id.toUpperCase(), id);
|
|
49910
|
+
this.added.set(id, name);
|
|
49274
49911
|
if (!this.byName.has(name)) this.byName.set(name, id);
|
|
49275
49912
|
}
|
|
49276
49913
|
}
|
|
49277
|
-
id(name) {
|
|
49914
|
+
id(name, preferred) {
|
|
49915
|
+
const preferredId = preferred ? this.identities.get(preferred.toUpperCase()) : void 0;
|
|
49916
|
+
if (preferredId && this.names.get(preferredId) === name) return preferredId;
|
|
49278
49917
|
let id = this.byName.get(name);
|
|
49279
49918
|
if (!id) {
|
|
49919
|
+
let index3 = 0;
|
|
49280
49920
|
id = guidFrom(`person:${name}`);
|
|
49921
|
+
while (this.identities.has(id.toUpperCase())) id = guidFrom(`person:${name}:${++index3}`);
|
|
49281
49922
|
this.byName.set(name, id);
|
|
49282
49923
|
this.names.set(id, name);
|
|
49924
|
+
this.identities.set(id.toUpperCase(), id);
|
|
49925
|
+
this.added.set(id, name);
|
|
49283
49926
|
}
|
|
49284
49927
|
return id;
|
|
49285
49928
|
}
|
|
49286
49929
|
xml() {
|
|
49287
|
-
|
|
49288
|
-
|
|
49289
|
-
|
|
49290
|
-
|
|
49930
|
+
if (this.source && !this.changed) return this.source;
|
|
49931
|
+
const doc = parseXml(
|
|
49932
|
+
this.source ?? `${XML_HEADER}<personList xmlns="${NS.tc}" xmlns:x="${NS.x}"/>`
|
|
49933
|
+
);
|
|
49934
|
+
const root = doc.documentElement;
|
|
49935
|
+
for (const [id, name] of this.source ? this.added : this.names) {
|
|
49936
|
+
const retained = this.retained.get(id);
|
|
49937
|
+
if (retained) {
|
|
49938
|
+
root.insertBefore(
|
|
49939
|
+
doc.importNode(parseXml(retained).documentElement, true),
|
|
49940
|
+
first(root, "extLst", NS.tc) ?? null
|
|
49941
|
+
);
|
|
49942
|
+
continue;
|
|
49943
|
+
}
|
|
49944
|
+
const person = doc.createElementNS(NS.tc, root.prefix ? `${root.prefix}:person` : "person");
|
|
49945
|
+
for (const [key, value2] of Object.entries({
|
|
49946
|
+
id,
|
|
49947
|
+
displayName: name,
|
|
49948
|
+
userId: name,
|
|
49949
|
+
providerId: "None"
|
|
49950
|
+
})) {
|
|
49951
|
+
person.setAttribute(key, value2);
|
|
49952
|
+
}
|
|
49953
|
+
root.insertBefore(person, first(root, "extLst", NS.tc) ?? null);
|
|
49954
|
+
}
|
|
49955
|
+
return buildXml(doc);
|
|
49291
49956
|
}
|
|
49292
49957
|
};
|
|
49958
|
+
|
|
49959
|
+
// xlsx/write/comments.ts
|
|
49960
|
+
var THREADED_NOTE = "[Threaded comment]\n\nYour version of Excel allows you to read this threaded comment; however, any edits to it will get removed if the file is opened in a newer version of Excel. Learn more: https://go.microsoft.com/fwlink/?linkid=870924\n\nComment:\n ";
|
|
49293
49961
|
function vmlShape(comment, index3, id) {
|
|
49294
49962
|
const { row: row2, col } = comment.address;
|
|
49295
49963
|
const anchor = `${col + 1}, 15, ${Math.max(0, row2 - 1)}, 10, ${col + 3}, 15, ${row2 + 3}, 4`;
|
|
@@ -49311,7 +49979,7 @@ function vmlXml(comments, layout2) {
|
|
|
49311
49979
|
}
|
|
49312
49980
|
return `<xml xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel"><o:shapelayout v:ext="edit"><o:idmap v:ext="edit" data="${data}"/></o:shapelayout>` + NOTE_SHAPETYPE + shapes + "</xml>";
|
|
49313
49981
|
}
|
|
49314
|
-
function commentParts(comments, sheetNumber, persons, sheetName, layout2) {
|
|
49982
|
+
function commentParts(comments, sheetNumber, persons, sheetName, layout2, threadOptions) {
|
|
49315
49983
|
const authors = [];
|
|
49316
49984
|
const authorId = (name) => {
|
|
49317
49985
|
let id = authors.indexOf(name);
|
|
@@ -49321,18 +49989,11 @@ function commentParts(comments, sheetNumber, persons, sheetName, layout2) {
|
|
|
49321
49989
|
const sorted2 = [...comments].sort(
|
|
49322
49990
|
(a2, b) => a2.address.row - b.address.row || a2.address.col - b.address.col
|
|
49323
49991
|
);
|
|
49324
|
-
|
|
49992
|
+
const threads = new ThreadedCommentsWriter(persons, threadOptions);
|
|
49325
49993
|
const list3 = sorted2.map((comment) => {
|
|
49326
49994
|
const ref = formatAddress(comment.address);
|
|
49327
49995
|
if (comment.replies) {
|
|
49328
|
-
const id =
|
|
49329
|
-
const personId = persons.id(comment.author);
|
|
49330
|
-
threaded += `<threadedComment ref="${ref}" personId="${personId}" id="${id}"><text>${escapeText(comment.text)}</text></threadedComment>`;
|
|
49331
|
-
comment.replies.forEach((reply, index3) => {
|
|
49332
|
-
const replyId = guidFrom(`${id}:reply:${index3}:${reply.text}`);
|
|
49333
|
-
const dT = reply.date ? ` dT="${escapeAttr(reply.date)}"` : "";
|
|
49334
|
-
threaded += `<threadedComment ref="${ref}"${dT} personId="${persons.id(reply.author)}" id="${replyId}" parentId="${id}"><text>${escapeText(reply.text)}</text></threadedComment>`;
|
|
49335
|
-
});
|
|
49996
|
+
const id = threads.add(comment, ref, sheetName);
|
|
49336
49997
|
const fallback = `${THREADED_NOTE}${comment.text}${comment.replies.map((r) => `
|
|
49337
49998
|
Reply:
|
|
49338
49999
|
${r.text}`).join("")}`;
|
|
@@ -49350,8 +50011,8 @@ Reply:
|
|
|
49350
50011
|
}
|
|
49351
50012
|
);
|
|
49352
50013
|
const parts = { comments: commentsXml, vml };
|
|
49353
|
-
|
|
49354
|
-
|
|
50014
|
+
const threaded = threads.xml();
|
|
50015
|
+
if (threaded) parts.threaded = threaded;
|
|
49355
50016
|
return parts;
|
|
49356
50017
|
}
|
|
49357
50018
|
|
|
@@ -52426,6 +53087,158 @@ function pageXml(sheet) {
|
|
|
52426
53087
|
return result2;
|
|
52427
53088
|
}
|
|
52428
53089
|
|
|
53090
|
+
// xlsx/layout/viewport.ts
|
|
53091
|
+
var frozenExtent = (count2, start) => count2 > 0 ? start(count2) : 0;
|
|
53092
|
+
function collectVisible(from, to, limit2, at2, start, size, minIndex) {
|
|
53093
|
+
const out = [];
|
|
53094
|
+
if (to <= from) return out;
|
|
53095
|
+
let i2 = Math.max(minIndex, at2(from));
|
|
53096
|
+
while (i2 <= limit2 && start(i2) < to) {
|
|
53097
|
+
if (size(i2) > 0) out.push(i2);
|
|
53098
|
+
i2++;
|
|
53099
|
+
}
|
|
53100
|
+
return out;
|
|
53101
|
+
}
|
|
53102
|
+
function frozenList(count2, size, limit2) {
|
|
53103
|
+
const out = [];
|
|
53104
|
+
for (let i2 = 0; i2 < Math.min(count2, limit2 + 1); i2++) if (size(i2) > 0) out.push(i2);
|
|
53105
|
+
return out;
|
|
53106
|
+
}
|
|
53107
|
+
function visibleCells(metrics, viewport, freeze) {
|
|
53108
|
+
const fRows = Math.max(0, freeze?.rows ?? 0);
|
|
53109
|
+
const fCols = Math.max(0, freeze?.cols ?? 0);
|
|
53110
|
+
const frozenH = frozenExtent(fRows, metrics.rowTop);
|
|
53111
|
+
const frozenW = frozenExtent(fCols, metrics.colLeft);
|
|
53112
|
+
const top = frozenH + Math.max(0, viewport.scrollTop);
|
|
53113
|
+
const left2 = frozenW + Math.max(0, viewport.scrollLeft);
|
|
53114
|
+
const rows2 = collectVisible(
|
|
53115
|
+
top,
|
|
53116
|
+
top + Math.max(0, viewport.height - frozenH),
|
|
53117
|
+
MAX_ROW,
|
|
53118
|
+
metrics.rowAt,
|
|
53119
|
+
metrics.rowTop,
|
|
53120
|
+
metrics.rowHeight,
|
|
53121
|
+
fRows
|
|
53122
|
+
);
|
|
53123
|
+
const cols = collectVisible(
|
|
53124
|
+
left2,
|
|
53125
|
+
left2 + Math.max(0, viewport.width - frozenW),
|
|
53126
|
+
MAX_COL,
|
|
53127
|
+
metrics.colAt,
|
|
53128
|
+
metrics.colLeft,
|
|
53129
|
+
metrics.colWidth,
|
|
53130
|
+
fCols
|
|
53131
|
+
);
|
|
53132
|
+
return {
|
|
53133
|
+
rows: rows2,
|
|
53134
|
+
cols,
|
|
53135
|
+
frozenRows: frozenList(fRows, metrics.rowHeight, MAX_ROW),
|
|
53136
|
+
frozenCols: frozenList(fCols, metrics.colWidth, MAX_COL)
|
|
53137
|
+
};
|
|
53138
|
+
}
|
|
53139
|
+
|
|
53140
|
+
// xlsx/layout/split.ts
|
|
53141
|
+
var TWIPS_PER_PX = 15;
|
|
53142
|
+
var MIN_SPLIT_PANE = 24;
|
|
53143
|
+
function splitActivePane(split2) {
|
|
53144
|
+
const valid = split2.x > 0 && split2.y > 0 ? ["topLeft", "topRight", "bottomLeft", "bottomRight"] : split2.y > 0 ? ["topLeft", "bottomLeft"] : ["topLeft", "topRight"];
|
|
53145
|
+
return split2.activePane && valid.includes(split2.activePane) ? split2.activePane : valid[valid.length - 1];
|
|
53146
|
+
}
|
|
53147
|
+
var splitToPx = (twips, zoom) => twips > 0 ? Math.round(twips / TWIPS_PER_PX * zoom / 100) : 0;
|
|
53148
|
+
var pxToSplit = (px, zoom) => px > 0 ? Math.round(px * TWIPS_PER_PX * 100 / zoom) : 0;
|
|
53149
|
+
function splitAtCell(metrics, active, scroll2, view) {
|
|
53150
|
+
if (view.width <= 0 || view.height <= 0) return void 0;
|
|
53151
|
+
const ax = metrics.colLeft(active.col) - scroll2.left;
|
|
53152
|
+
const ay = metrics.rowTop(active.row) - scroll2.top;
|
|
53153
|
+
let x = ax > 0 && ax < view.width ? ax : 0;
|
|
53154
|
+
let y = ay > 0 && ay < view.height ? ay : 0;
|
|
53155
|
+
if (!x && !y) {
|
|
53156
|
+
x = Math.floor(view.width / 2);
|
|
53157
|
+
y = Math.floor(view.height / 2);
|
|
53158
|
+
}
|
|
53159
|
+
const first2 = {
|
|
53160
|
+
row: metrics.rowAt(scroll2.top),
|
|
53161
|
+
col: metrics.colAt(scroll2.left)
|
|
53162
|
+
};
|
|
53163
|
+
const split2 = {
|
|
53164
|
+
x: pxToSplit(x, metrics.zoom),
|
|
53165
|
+
y: pxToSplit(y, metrics.zoom),
|
|
53166
|
+
topLeft: first2,
|
|
53167
|
+
activePane: x && y ? "bottomRight" : y ? "bottomLeft" : "topRight"
|
|
53168
|
+
};
|
|
53169
|
+
return split2;
|
|
53170
|
+
}
|
|
53171
|
+
function clampSplitBar(px, extent2, zoom) {
|
|
53172
|
+
const min = Math.round(MIN_SPLIT_PANE * zoom / 100);
|
|
53173
|
+
return Math.max(min, Math.min(extent2 - min, Math.round(px)));
|
|
53174
|
+
}
|
|
53175
|
+
function splitVisible(metrics, layout2) {
|
|
53176
|
+
const along = (from, size, at2, start, extent2, limit2) => collectVisible(from, from + Math.max(0, size), limit2, at2, start, extent2, 0);
|
|
53177
|
+
const rest = (total2, taken) => Math.max(0, total2 - taken);
|
|
53178
|
+
return {
|
|
53179
|
+
frozenRows: along(
|
|
53180
|
+
layout2.top,
|
|
53181
|
+
layout2.y,
|
|
53182
|
+
metrics.rowAt,
|
|
53183
|
+
metrics.rowTop,
|
|
53184
|
+
metrics.rowHeight,
|
|
53185
|
+
MAX_ROW
|
|
53186
|
+
),
|
|
53187
|
+
frozenCols: along(
|
|
53188
|
+
layout2.left,
|
|
53189
|
+
layout2.x,
|
|
53190
|
+
metrics.colAt,
|
|
53191
|
+
metrics.colLeft,
|
|
53192
|
+
metrics.colWidth,
|
|
53193
|
+
MAX_COL
|
|
53194
|
+
),
|
|
53195
|
+
rows: along(
|
|
53196
|
+
layout2.mainTop,
|
|
53197
|
+
rest(layout2.height, layout2.y),
|
|
53198
|
+
metrics.rowAt,
|
|
53199
|
+
metrics.rowTop,
|
|
53200
|
+
metrics.rowHeight,
|
|
53201
|
+
MAX_ROW
|
|
53202
|
+
),
|
|
53203
|
+
cols: along(
|
|
53204
|
+
layout2.mainLeft,
|
|
53205
|
+
rest(layout2.width, layout2.x),
|
|
53206
|
+
metrics.colAt,
|
|
53207
|
+
metrics.colLeft,
|
|
53208
|
+
metrics.colWidth,
|
|
53209
|
+
MAX_COL
|
|
53210
|
+
)
|
|
53211
|
+
};
|
|
53212
|
+
}
|
|
53213
|
+
function revealInSplit(metrics, layout2, row2, col) {
|
|
53214
|
+
const axis = (start, size, paneStart, paneSize, mainStart, mainSize) => {
|
|
53215
|
+
const inPane = paneSize > 0 && start >= paneStart && start + size <= paneStart + paneSize;
|
|
53216
|
+
if (inPane) return mainStart;
|
|
53217
|
+
if (start < mainStart) return start;
|
|
53218
|
+
if (start + size > mainStart + mainSize)
|
|
53219
|
+
return Math.max(0, Math.min(start, start + size - mainSize));
|
|
53220
|
+
return mainStart;
|
|
53221
|
+
};
|
|
53222
|
+
return {
|
|
53223
|
+
left: axis(
|
|
53224
|
+
metrics.colLeft(col),
|
|
53225
|
+
metrics.colWidth(col),
|
|
53226
|
+
layout2.left,
|
|
53227
|
+
layout2.x,
|
|
53228
|
+
layout2.mainLeft,
|
|
53229
|
+
Math.max(0, layout2.width - layout2.x)
|
|
53230
|
+
),
|
|
53231
|
+
top: axis(
|
|
53232
|
+
metrics.rowTop(row2),
|
|
53233
|
+
metrics.rowHeight(row2),
|
|
53234
|
+
layout2.top,
|
|
53235
|
+
layout2.y,
|
|
53236
|
+
layout2.mainTop,
|
|
53237
|
+
Math.max(0, layout2.height - layout2.y)
|
|
53238
|
+
)
|
|
53239
|
+
};
|
|
53240
|
+
}
|
|
53241
|
+
|
|
52429
53242
|
// xlsx/write/filter-columns.ts
|
|
52430
53243
|
function criteriaOf(column3) {
|
|
52431
53244
|
const { values: values2, blank, dateGroups, custom, top10, dynamic, color: color3, icon, hiddenButton } = column3;
|
|
@@ -52587,16 +53400,14 @@ function dimensionXml(sheet) {
|
|
|
52587
53400
|
const used = usedRange(sheet);
|
|
52588
53401
|
return `<dimension ref="${used ? formatRange(used) : "A1"}"/>`;
|
|
52589
53402
|
}
|
|
52590
|
-
function splitActivePane(split2) {
|
|
52591
|
-
const both = split2.x > 0 && split2.y > 0;
|
|
52592
|
-
const valid = both ? ["topLeft", "topRight", "bottomLeft", "bottomRight"] : split2.y > 0 ? ["topLeft", "bottomLeft"] : ["topLeft", "topRight"];
|
|
52593
|
-
if (split2.activePane && valid.includes(split2.activePane)) return split2.activePane;
|
|
52594
|
-
return both ? "bottomRight" : split2.y > 0 ? "bottomLeft" : "topRight";
|
|
52595
|
-
}
|
|
52596
53403
|
function selectionXml(selection, pane) {
|
|
53404
|
+
const activeCellId = selection.ranges.findIndex(
|
|
53405
|
+
(range) => rangeContains(range, selection.active)
|
|
53406
|
+
);
|
|
52597
53407
|
return el("selection", {
|
|
52598
53408
|
pane,
|
|
52599
53409
|
activeCell: formatAddress(selection.active),
|
|
53410
|
+
activeCellId: activeCellId > 0 ? activeCellId : void 0,
|
|
52600
53411
|
sqref: sqref(selection.ranges) || formatAddress(selection.active)
|
|
52601
53412
|
});
|
|
52602
53413
|
}
|
|
@@ -53263,28 +54074,6 @@ function conditionalFormatsXml(formats, styles) {
|
|
|
53263
54074
|
return `<conditionalFormatting sqref="${format.ranges.map((r) => formatRange(r)).join(" ")}">${rules}</conditionalFormatting>`;
|
|
53264
54075
|
}).join("");
|
|
53265
54076
|
}
|
|
53266
|
-
function dataValidationsXml(validations) {
|
|
53267
|
-
const items = validations.filter((dv) => dv.ranges.length).map((dv) => {
|
|
53268
|
-
const hideDropDown = dv.showDropDown === false ? true : void 0;
|
|
53269
|
-
const values2 = attrs2({
|
|
53270
|
-
type: dv.type === "none" ? void 0 : dv.type,
|
|
53271
|
-
errorStyle: dv.errorStyle,
|
|
53272
|
-
operator: dv.operator,
|
|
53273
|
-
allowBlank: dv.allowBlank || void 0,
|
|
53274
|
-
showDropDown: hideDropDown,
|
|
53275
|
-
showInputMessage: dv.showInputMessage || void 0,
|
|
53276
|
-
showErrorMessage: dv.showErrorMessage || void 0,
|
|
53277
|
-
errorTitle: dv.errorTitle,
|
|
53278
|
-
error: dv.error,
|
|
53279
|
-
promptTitle: dv.promptTitle,
|
|
53280
|
-
prompt: dv.prompt,
|
|
53281
|
-
sqref: dv.ranges.map((r) => formatRange(r)).join(" ")
|
|
53282
|
-
});
|
|
53283
|
-
const formulas = (dv.formula1 !== void 0 ? formulaXml2(dv.formula1, "formula1") : "") + (dv.formula2 !== void 0 ? formulaXml2(dv.formula2, "formula2") : "");
|
|
53284
|
-
return formulas ? `<dataValidation${values2}>${formulas}</dataValidation>` : `<dataValidation${values2}/>`;
|
|
53285
|
-
});
|
|
53286
|
-
return items.length ? `<dataValidations count="${items.length}">${items.join("")}</dataValidations>` : "";
|
|
53287
|
-
}
|
|
53288
54077
|
|
|
53289
54078
|
// xlsx/write/sheet-data.ts
|
|
53290
54079
|
var MAX_CELL_TEXT = 32767;
|
|
@@ -54522,6 +55311,8 @@ function writeComments(ctx, sheet, index3, partName, rels) {
|
|
|
54522
55311
|
const { writer, source: source3 } = ctx;
|
|
54523
55312
|
const name = (pattern) => writer.uniqueName(pattern, ctx.reserved);
|
|
54524
55313
|
const fromSource = source3 && sheet.partName && source3.has(sheet.partName);
|
|
55314
|
+
const sourceThreaded = fromSource ? source3.targetOfType(sheet.partName ?? "", RELATIONSHIP_TYPES.threadedComment) : void 0;
|
|
55315
|
+
const threadEnvelope = sheet.threadedCommentsXml ?? threadedCommentEnvelope(sourceThreaded ? source3?.text(sourceThreaded) : void 0);
|
|
54525
55316
|
const sourceVml = fromSource ? sourceVmlPart(source3, sheet.partName ?? "") : void 0;
|
|
54526
55317
|
const kept = source3 && sourceVml && !writer.has(sourceVml) ? stripNoteShapes(source3.text(sourceVml) ?? "") : void 0;
|
|
54527
55318
|
const base = kept && kept.kept > 0 ? kept.xml : void 0;
|
|
@@ -54546,11 +55337,13 @@ function writeComments(ctx, sheet, index3, partName, rels) {
|
|
|
54546
55337
|
parseLegacyComments(legacyPart ? source3.text(legacyPart) : void 0),
|
|
54547
55338
|
parseThreadedComments(
|
|
54548
55339
|
threadedPart ? source3.text(threadedPart) : void 0,
|
|
54549
|
-
parsePersons(personsPart ? source3.text(personsPart) : void 0)
|
|
55340
|
+
parsePersons(personsPart ? source3.text(personsPart) : void 0),
|
|
55341
|
+
personsPart ? source3.text(personsPart) : void 0
|
|
54550
55342
|
)
|
|
54551
55343
|
);
|
|
54552
55344
|
const free = [legacyPart, threadedPart, vmlPart].every((p) => !p || !writer.has(p));
|
|
54553
|
-
|
|
55345
|
+
const envelope = threadedCommentEnvelope(threadedPart ? source3.text(threadedPart) : void 0);
|
|
55346
|
+
if (legacyPart && vmlPart && free && sameModel(before, sheet.comments) && (sheet.threadedCommentsXml === void 0 || sheet.threadedCommentsXml === envelope)) {
|
|
54554
55347
|
writer.carry(legacyPart);
|
|
54555
55348
|
writer.carry(vmlPart);
|
|
54556
55349
|
rels.add(RELATIONSHIP_TYPES.comments, relativeTarget(partName, legacyPart));
|
|
@@ -54564,10 +55357,20 @@ function writeComments(ctx, sheet, index3, partName, rels) {
|
|
|
54564
55357
|
}
|
|
54565
55358
|
const own = base ? vmlIdmapBlocks(base) : [];
|
|
54566
55359
|
const layout2 = vmlAllocatorFor(ctx, source3).allocate(sheet.comments.length, index3 + 1, own);
|
|
54567
|
-
const parts = commentParts(
|
|
54568
|
-
|
|
54569
|
-
|
|
54570
|
-
|
|
55360
|
+
const parts = commentParts(
|
|
55361
|
+
sheet.comments,
|
|
55362
|
+
index3 + 1,
|
|
55363
|
+
ctx.persons,
|
|
55364
|
+
sheet.name,
|
|
55365
|
+
{
|
|
55366
|
+
...layout2,
|
|
55367
|
+
...base ? { base } : {}
|
|
55368
|
+
},
|
|
55369
|
+
{
|
|
55370
|
+
...threadEnvelope ? { envelope: threadEnvelope } : {},
|
|
55371
|
+
ids: ctx.commentIds ??= new CommentIds(ctx.workbook)
|
|
55372
|
+
}
|
|
55373
|
+
);
|
|
54571
55374
|
const commentsPart = name((n2) => `xl/comments${n2}.xml`);
|
|
54572
55375
|
writer.add(commentsPart, parts.comments, CONTENT_TYPES.comments);
|
|
54573
55376
|
rels.add(RELATIONSHIP_TYPES.comments, relativeTarget(partName, commentsPart));
|
|
@@ -54758,13 +55561,17 @@ function writeWorksheet(ctx, sheet, index3, partName) {
|
|
|
54758
55561
|
blocks.set("legacyDrawing", writeComments(ctx, sheet, index3, partName, rels));
|
|
54759
55562
|
blocks.set("tableParts", tableParts);
|
|
54760
55563
|
ctx.pivots?.writeSheet(writer, sheet, partName, rels);
|
|
54761
|
-
const extensions =
|
|
55564
|
+
const extensions = validationExtensionsXml(
|
|
55565
|
+
sheet,
|
|
55566
|
+
conditionalExtensionsXml(sheet),
|
|
55567
|
+
ctx.validationIds ??= /* @__PURE__ */ new Set()
|
|
55568
|
+
);
|
|
54762
55569
|
blocks.set(
|
|
54763
55570
|
"extLst",
|
|
54764
55571
|
ctx.slicers?.active ? ctx.slicers.writeSheet(sheet, partName, rels, extensions) : extensions
|
|
54765
55572
|
);
|
|
54766
55573
|
for (const [key, list3] of sheet.preserved) {
|
|
54767
|
-
if (key.startsWith("source:") || !WORKSHEET_CHILD_ORDER.includes(key) || (blocks.get(key) ?? "") !== "" || key === "extLst"
|
|
55574
|
+
if (key.startsWith("source:") || !WORKSHEET_CHILD_ORDER.includes(key) || (blocks.get(key) ?? "") !== "" || key === "extLst")
|
|
54768
55575
|
continue;
|
|
54769
55576
|
const valid = list3.filter(
|
|
54770
55577
|
(xml) => [...xml.matchAll(/\br:(?:id|embed|link|pict)="([^"]*)"/g)].every(
|
|
@@ -55040,7 +55847,7 @@ function dateFilterXml(pivot, filter2) {
|
|
|
55040
55847
|
}
|
|
55041
55848
|
|
|
55042
55849
|
// xlsx/pivot/write.ts
|
|
55043
|
-
var
|
|
55850
|
+
var TYPES4 = {
|
|
55044
55851
|
table: "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml",
|
|
55045
55852
|
definition: "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml",
|
|
55046
55853
|
records: "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml"
|
|
@@ -55106,14 +55913,14 @@ var PivotWritePlan = class {
|
|
|
55106
55913
|
`${NS.r}/pivotCacheRecords`,
|
|
55107
55914
|
relativeTarget(definition2, records)
|
|
55108
55915
|
);
|
|
55109
|
-
writer.add(records, pivotCacheRecordsXml(pivot, cache3),
|
|
55916
|
+
writer.add(records, pivotCacheRecordsXml(pivot, cache3), TYPES4.records);
|
|
55110
55917
|
writer.add(
|
|
55111
55918
|
definition2,
|
|
55112
55919
|
pivotCacheDefinitionXml(pivot, workbook, cache3, recordRel),
|
|
55113
|
-
|
|
55920
|
+
TYPES4.definition
|
|
55114
55921
|
);
|
|
55115
55922
|
writer.rels(definition2, cacheRels);
|
|
55116
|
-
writer.add(table3, pivotTableXml(pivot, cacheId, cache3),
|
|
55923
|
+
writer.add(table3, pivotTableXml(pivot, cacheId, cache3), TYPES4.table);
|
|
55117
55924
|
const tableRels = new RelationshipSet();
|
|
55118
55925
|
tableRels.add(RELATIONSHIP_TYPES.pivotCacheDefinition, relativeTarget(table3, definition2));
|
|
55119
55926
|
writer.rels(table3, tableRels);
|
|
@@ -56640,7 +57447,8 @@ async function saveXlsx(workbook) {
|
|
|
56640
57447
|
styles: new StyleWriter(workbook, stylesPart ? source3?.text(stylesPart) : void 0),
|
|
56641
57448
|
strings: new SharedStringTable(),
|
|
56642
57449
|
persons: new PersonRegistry(
|
|
56643
|
-
parsePersons(personsSource ? source3?.text(personsSource) : void 0)
|
|
57450
|
+
parsePersons(personsSource ? source3?.text(personsSource) : void 0),
|
|
57451
|
+
personsSource ? source3?.text(personsSource) : void 0
|
|
56644
57452
|
),
|
|
56645
57453
|
reserved,
|
|
56646
57454
|
tableIds: /* @__PURE__ */ new Set(),
|
|
@@ -56715,7 +57523,9 @@ async function saveXlsx(workbook) {
|
|
|
56715
57523
|
rels.add(RELATIONSHIP_TYPES.theme, relativeTarget(bookPart, outTheme));
|
|
56716
57524
|
if (ctx.threaded.used) {
|
|
56717
57525
|
const personsPart = personsSource ?? "xl/persons/person.xml";
|
|
56718
|
-
|
|
57526
|
+
if (personsSource) writer.carry(personsSource);
|
|
57527
|
+
if (!personsSource || ctx.persons.changed)
|
|
57528
|
+
writer.add(personsPart, ctx.persons.xml(), CONTENT_TYPES.persons);
|
|
56719
57529
|
rels.add(RELATIONSHIP_TYPES.person, relativeTarget(bookPart, personsPart));
|
|
56720
57530
|
}
|
|
56721
57531
|
writeMetadataPart(
|
|
@@ -57836,6 +58646,37 @@ function setComment(ctx, s, at2, text3, author) {
|
|
|
57836
58646
|
{ sheet: s, ranges: [{ start: at2, end: at2 }] }
|
|
57837
58647
|
);
|
|
57838
58648
|
}
|
|
58649
|
+
function setCommentReply(ctx, s, at2, replyIndex, text3) {
|
|
58650
|
+
const sheet = sheetAt(ctx.workbook, s);
|
|
58651
|
+
const comment = sheet.comments.find((c2) => c2.address.row === at2.row && c2.address.col === at2.col);
|
|
58652
|
+
const reply = Number.isInteger(replyIndex) ? comment?.replies?.[replyIndex] : void 0;
|
|
58653
|
+
if (!reply) throw new RangeError("Comment reply not found.");
|
|
58654
|
+
if (reply.text === text3) return;
|
|
58655
|
+
ctx.run(
|
|
58656
|
+
"Edit comment",
|
|
58657
|
+
"annotations",
|
|
58658
|
+
[{ kind: "sheet", sheet: s }],
|
|
58659
|
+
() => {
|
|
58660
|
+
reply.text = text3;
|
|
58661
|
+
},
|
|
58662
|
+
{ sheet: s, ranges: [{ start: at2, end: at2 }] }
|
|
58663
|
+
);
|
|
58664
|
+
}
|
|
58665
|
+
function setCommentResolved(ctx, s, at2, resolved) {
|
|
58666
|
+
const sheet = sheetAt(ctx.workbook, s);
|
|
58667
|
+
const comment = sheet.comments.find((c2) => c2.address.row === at2.row && c2.address.col === at2.col);
|
|
58668
|
+
if (!comment?.replies) throw new RangeError("Threaded comment not found.");
|
|
58669
|
+
if ((comment.resolved ?? false) === resolved) return;
|
|
58670
|
+
ctx.run(
|
|
58671
|
+
"Edit comment",
|
|
58672
|
+
"annotations",
|
|
58673
|
+
[{ kind: "sheet", sheet: s }],
|
|
58674
|
+
() => {
|
|
58675
|
+
comment.resolved = resolved;
|
|
58676
|
+
},
|
|
58677
|
+
{ sheet: s, ranges: [{ start: at2, end: at2 }] }
|
|
58678
|
+
);
|
|
58679
|
+
}
|
|
57839
58680
|
function setHyperlink(ctx, s, range, link) {
|
|
57840
58681
|
const sheet = sheetAt(ctx.workbook, s);
|
|
57841
58682
|
const r = normalizeRange(range);
|
|
@@ -59196,6 +60037,11 @@ function pasteWidths(ctx, s, selection, cells, transpose2, cut) {
|
|
|
59196
60037
|
return dest;
|
|
59197
60038
|
}
|
|
59198
60039
|
|
|
60040
|
+
// xlsx/edit/comment-identities.ts
|
|
60041
|
+
function resetCommentIdentities(comment) {
|
|
60042
|
+
if (comment.replies) comment.regenerateThreadIds = true;
|
|
60043
|
+
}
|
|
60044
|
+
|
|
59199
60045
|
// xlsx/edit/clipboard-annotations.ts
|
|
59200
60046
|
function copyAnnotations(sheet, area) {
|
|
59201
60047
|
const relative2 = (at2) => ({
|
|
@@ -59237,7 +60083,9 @@ function pasteAnnotations(sheet, dest, cells, mode, transpose2, skipBlanks, cutF
|
|
|
59237
60083
|
for (const comment of cells.comments) {
|
|
59238
60084
|
const address2 = point2(comment.address);
|
|
59239
60085
|
comments.delete(key(address2));
|
|
59240
|
-
|
|
60086
|
+
const pasted = { ...structuredClone(comment), address: address2 };
|
|
60087
|
+
if (!cutFormula) resetCommentIdentities(pasted);
|
|
60088
|
+
comments.set(key(address2), pasted);
|
|
59241
60089
|
}
|
|
59242
60090
|
sheet.comments = [...comments.values()];
|
|
59243
60091
|
}
|
|
@@ -61242,7 +62090,7 @@ function applyPrint(workbook, sheet, index3, saved) {
|
|
|
61242
62090
|
|
|
61243
62091
|
// xlsx/edit/sparkline-xml.ts
|
|
61244
62092
|
var XM4 = "http://schemas.microsoft.com/office/excel/2006/main";
|
|
61245
|
-
var
|
|
62093
|
+
var URI3 = "{05C60535-1F16-4fd2-B633-F4F36F0B64E0}";
|
|
61246
62094
|
var COLORS2 = [
|
|
61247
62095
|
"colorSeries",
|
|
61248
62096
|
"colorNegative",
|
|
@@ -61328,15 +62176,15 @@ function appendSparklineXml(sheet, groupXml3) {
|
|
|
61328
62176
|
const doc = parseXml(source3[index3] ?? `<extLst xmlns="${NS.x}"/>`);
|
|
61329
62177
|
const root = doc.documentElement;
|
|
61330
62178
|
let ext = children(root, "ext", NS.x).find(
|
|
61331
|
-
(node2) => node2.getAttribute("uri")?.toUpperCase() ===
|
|
62179
|
+
(node2) => node2.getAttribute("uri")?.toUpperCase() === URI3.toUpperCase()
|
|
61332
62180
|
);
|
|
61333
62181
|
if (!ext) {
|
|
61334
62182
|
ext = doc.createElementNS(NS.x, "ext");
|
|
61335
|
-
ext.setAttribute("uri",
|
|
62183
|
+
ext.setAttribute("uri", URI3);
|
|
61336
62184
|
ext.setAttribute("xmlns:x14", NS.x14);
|
|
61337
62185
|
root.appendChild(ext);
|
|
61338
62186
|
}
|
|
61339
|
-
ext.setAttribute("uri",
|
|
62187
|
+
ext.setAttribute("uri", URI3);
|
|
61340
62188
|
let groups = first(ext, "sparklineGroups", NS.x14);
|
|
61341
62189
|
if (!groups) {
|
|
61342
62190
|
groups = doc.createElementNS(NS.x14, "x14:sparklineGroups");
|
|
@@ -62542,7 +63390,7 @@ function admitted(space, seriesIndex) {
|
|
|
62542
63390
|
if (!chartSeriesAnalysisSupported(space, seriesIndex))
|
|
62543
63391
|
throw new RangeError("This chart family does not support series analysis editing");
|
|
62544
63392
|
}
|
|
62545
|
-
var
|
|
63393
|
+
var TYPES5 = /* @__PURE__ */ new Set(["linear", "exp", "log", "poly", "power", "movingAvg"]);
|
|
62546
63394
|
function setChartTrendline(space, seriesIndex, index3, edit) {
|
|
62547
63395
|
admitted(space, seriesIndex);
|
|
62548
63396
|
return editChartSpace(space, (draft) => {
|
|
@@ -62556,7 +63404,7 @@ function setChartTrendline(space, seriesIndex, index3, edit) {
|
|
|
62556
63404
|
}
|
|
62557
63405
|
const next = { ...list3[index3] ?? { trendlineType: "linear" } };
|
|
62558
63406
|
if (edit.type !== void 0) {
|
|
62559
|
-
if (!
|
|
63407
|
+
if (!TYPES5.has(edit.type)) throw new RangeError("Unsupported trendline type");
|
|
62560
63408
|
next.trendlineType = edit.type;
|
|
62561
63409
|
if (edit.type !== "poly") delete next.order;
|
|
62562
63410
|
if (edit.type !== "movingAvg") delete next.period;
|
|
@@ -73533,6 +74381,7 @@ function duplicateSheet(ctx, index3) {
|
|
|
73533
74381
|
copy.name = copyName(workbook, sheet.name);
|
|
73534
74382
|
copy.sheetId = nextSheetId(workbook);
|
|
73535
74383
|
delete copy.partName;
|
|
74384
|
+
for (const comment of copy.comments) resetCommentIdentities(comment);
|
|
73536
74385
|
const pivotNames = reservedPivotNames(workbook);
|
|
73537
74386
|
for (const pivot of copy.pivotTables ?? []) {
|
|
73538
74387
|
let suffix = 2;
|
|
@@ -74027,6 +74876,8 @@ function createEditSession(workbook, options2 = {}) {
|
|
|
74027
74876
|
setFreeze: (s, freeze) => setFreeze(ctx, s, freeze),
|
|
74028
74877
|
setSplit: (s, split2, topLeft) => setSplit(ctx, s, split2, topLeft),
|
|
74029
74878
|
setComment: (s, at2, text3, author) => setComment(ctx, s, at2, text3, author),
|
|
74879
|
+
setCommentReply: (s, at2, index3, text3) => setCommentReply(ctx, s, at2, index3, text3),
|
|
74880
|
+
setCommentResolved: (s, at2, resolved) => setCommentResolved(ctx, s, at2, resolved),
|
|
74030
74881
|
setHyperlink: (s, range, link) => setHyperlink(ctx, s, range, link),
|
|
74031
74882
|
addConditionalFormat: (s, cf) => addConditionalFormat(ctx, s, cf),
|
|
74032
74883
|
clearConditionalFormats: (s, range) => clearConditionalFormats(ctx, s, range),
|
|
@@ -74356,154 +75207,6 @@ function chartQuickLayoutPatch(chart, n2) {
|
|
|
74356
75207
|
return patch3;
|
|
74357
75208
|
}
|
|
74358
75209
|
|
|
74359
|
-
// xlsx/layout/viewport.ts
|
|
74360
|
-
var frozenExtent = (count2, start) => count2 > 0 ? start(count2) : 0;
|
|
74361
|
-
function collectVisible(from, to, limit2, at2, start, size, minIndex) {
|
|
74362
|
-
const out = [];
|
|
74363
|
-
if (to <= from) return out;
|
|
74364
|
-
let i2 = Math.max(minIndex, at2(from));
|
|
74365
|
-
while (i2 <= limit2 && start(i2) < to) {
|
|
74366
|
-
if (size(i2) > 0) out.push(i2);
|
|
74367
|
-
i2++;
|
|
74368
|
-
}
|
|
74369
|
-
return out;
|
|
74370
|
-
}
|
|
74371
|
-
function frozenList(count2, size, limit2) {
|
|
74372
|
-
const out = [];
|
|
74373
|
-
for (let i2 = 0; i2 < Math.min(count2, limit2 + 1); i2++) if (size(i2) > 0) out.push(i2);
|
|
74374
|
-
return out;
|
|
74375
|
-
}
|
|
74376
|
-
function visibleCells(metrics, viewport, freeze) {
|
|
74377
|
-
const fRows = Math.max(0, freeze?.rows ?? 0);
|
|
74378
|
-
const fCols = Math.max(0, freeze?.cols ?? 0);
|
|
74379
|
-
const frozenH = frozenExtent(fRows, metrics.rowTop);
|
|
74380
|
-
const frozenW = frozenExtent(fCols, metrics.colLeft);
|
|
74381
|
-
const top = frozenH + Math.max(0, viewport.scrollTop);
|
|
74382
|
-
const left2 = frozenW + Math.max(0, viewport.scrollLeft);
|
|
74383
|
-
const rows2 = collectVisible(
|
|
74384
|
-
top,
|
|
74385
|
-
top + Math.max(0, viewport.height - frozenH),
|
|
74386
|
-
MAX_ROW,
|
|
74387
|
-
metrics.rowAt,
|
|
74388
|
-
metrics.rowTop,
|
|
74389
|
-
metrics.rowHeight,
|
|
74390
|
-
fRows
|
|
74391
|
-
);
|
|
74392
|
-
const cols = collectVisible(
|
|
74393
|
-
left2,
|
|
74394
|
-
left2 + Math.max(0, viewport.width - frozenW),
|
|
74395
|
-
MAX_COL,
|
|
74396
|
-
metrics.colAt,
|
|
74397
|
-
metrics.colLeft,
|
|
74398
|
-
metrics.colWidth,
|
|
74399
|
-
fCols
|
|
74400
|
-
);
|
|
74401
|
-
return {
|
|
74402
|
-
rows: rows2,
|
|
74403
|
-
cols,
|
|
74404
|
-
frozenRows: frozenList(fRows, metrics.rowHeight, MAX_ROW),
|
|
74405
|
-
frozenCols: frozenList(fCols, metrics.colWidth, MAX_COL)
|
|
74406
|
-
};
|
|
74407
|
-
}
|
|
74408
|
-
|
|
74409
|
-
// xlsx/layout/split.ts
|
|
74410
|
-
var TWIPS_PER_PX = 15;
|
|
74411
|
-
var MIN_SPLIT_PANE = 24;
|
|
74412
|
-
var splitToPx = (twips, zoom) => twips > 0 ? Math.round(twips / TWIPS_PER_PX * zoom / 100) : 0;
|
|
74413
|
-
var pxToSplit = (px, zoom) => px > 0 ? Math.round(px * TWIPS_PER_PX * 100 / zoom) : 0;
|
|
74414
|
-
function splitAtCell(metrics, active, scroll2, view) {
|
|
74415
|
-
if (view.width <= 0 || view.height <= 0) return void 0;
|
|
74416
|
-
const ax = metrics.colLeft(active.col) - scroll2.left;
|
|
74417
|
-
const ay = metrics.rowTop(active.row) - scroll2.top;
|
|
74418
|
-
let x = ax > 0 && ax < view.width ? ax : 0;
|
|
74419
|
-
let y = ay > 0 && ay < view.height ? ay : 0;
|
|
74420
|
-
if (!x && !y) {
|
|
74421
|
-
x = Math.floor(view.width / 2);
|
|
74422
|
-
y = Math.floor(view.height / 2);
|
|
74423
|
-
}
|
|
74424
|
-
const first2 = {
|
|
74425
|
-
row: metrics.rowAt(scroll2.top),
|
|
74426
|
-
col: metrics.colAt(scroll2.left)
|
|
74427
|
-
};
|
|
74428
|
-
const split2 = {
|
|
74429
|
-
x: pxToSplit(x, metrics.zoom),
|
|
74430
|
-
y: pxToSplit(y, metrics.zoom),
|
|
74431
|
-
topLeft: first2,
|
|
74432
|
-
activePane: x && y ? "bottomRight" : y ? "bottomLeft" : "topRight"
|
|
74433
|
-
};
|
|
74434
|
-
return split2;
|
|
74435
|
-
}
|
|
74436
|
-
function clampSplitBar(px, extent2, zoom) {
|
|
74437
|
-
const min = Math.round(MIN_SPLIT_PANE * zoom / 100);
|
|
74438
|
-
return Math.max(min, Math.min(extent2 - min, Math.round(px)));
|
|
74439
|
-
}
|
|
74440
|
-
function splitVisible(metrics, layout2) {
|
|
74441
|
-
const along = (from, size, at2, start, extent2, limit2) => collectVisible(from, from + Math.max(0, size), limit2, at2, start, extent2, 0);
|
|
74442
|
-
const rest = (total2, taken) => Math.max(0, total2 - taken);
|
|
74443
|
-
return {
|
|
74444
|
-
frozenRows: along(
|
|
74445
|
-
layout2.top,
|
|
74446
|
-
layout2.y,
|
|
74447
|
-
metrics.rowAt,
|
|
74448
|
-
metrics.rowTop,
|
|
74449
|
-
metrics.rowHeight,
|
|
74450
|
-
MAX_ROW
|
|
74451
|
-
),
|
|
74452
|
-
frozenCols: along(
|
|
74453
|
-
layout2.left,
|
|
74454
|
-
layout2.x,
|
|
74455
|
-
metrics.colAt,
|
|
74456
|
-
metrics.colLeft,
|
|
74457
|
-
metrics.colWidth,
|
|
74458
|
-
MAX_COL
|
|
74459
|
-
),
|
|
74460
|
-
rows: along(
|
|
74461
|
-
layout2.mainTop,
|
|
74462
|
-
rest(layout2.height, layout2.y),
|
|
74463
|
-
metrics.rowAt,
|
|
74464
|
-
metrics.rowTop,
|
|
74465
|
-
metrics.rowHeight,
|
|
74466
|
-
MAX_ROW
|
|
74467
|
-
),
|
|
74468
|
-
cols: along(
|
|
74469
|
-
layout2.mainLeft,
|
|
74470
|
-
rest(layout2.width, layout2.x),
|
|
74471
|
-
metrics.colAt,
|
|
74472
|
-
metrics.colLeft,
|
|
74473
|
-
metrics.colWidth,
|
|
74474
|
-
MAX_COL
|
|
74475
|
-
)
|
|
74476
|
-
};
|
|
74477
|
-
}
|
|
74478
|
-
function revealInSplit(metrics, layout2, row2, col) {
|
|
74479
|
-
const axis = (start, size, paneStart, paneSize, mainStart, mainSize) => {
|
|
74480
|
-
const inPane = paneSize > 0 && start >= paneStart && start + size <= paneStart + paneSize;
|
|
74481
|
-
if (inPane) return mainStart;
|
|
74482
|
-
if (start < mainStart) return start;
|
|
74483
|
-
if (start + size > mainStart + mainSize)
|
|
74484
|
-
return Math.max(0, Math.min(start, start + size - mainSize));
|
|
74485
|
-
return mainStart;
|
|
74486
|
-
};
|
|
74487
|
-
return {
|
|
74488
|
-
left: axis(
|
|
74489
|
-
metrics.colLeft(col),
|
|
74490
|
-
metrics.colWidth(col),
|
|
74491
|
-
layout2.left,
|
|
74492
|
-
layout2.x,
|
|
74493
|
-
layout2.mainLeft,
|
|
74494
|
-
Math.max(0, layout2.width - layout2.x)
|
|
74495
|
-
),
|
|
74496
|
-
top: axis(
|
|
74497
|
-
metrics.rowTop(row2),
|
|
74498
|
-
metrics.rowHeight(row2),
|
|
74499
|
-
layout2.top,
|
|
74500
|
-
layout2.y,
|
|
74501
|
-
layout2.mainTop,
|
|
74502
|
-
Math.max(0, layout2.height - layout2.y)
|
|
74503
|
-
)
|
|
74504
|
-
};
|
|
74505
|
-
}
|
|
74506
|
-
|
|
74507
75210
|
// collab/identity.ts
|
|
74508
75211
|
var MAX_LABEL_CHARS = 20;
|
|
74509
75212
|
function formatCursorLabel(userName, maxChars = MAX_LABEL_CHARS) {
|