ooxml-core 1.44.0 → 1.46.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-FZ43IJFP.mjs +5 -0
- package/dist/{PptxHandler-3VAVJDFB.mjs → PptxHandler-HWEOIHEA.mjs} +2 -2
- package/dist/PptxHandler-XAUKKK36.cjs +14 -0
- package/dist/{PresentationBuilder-KHL6GONR.cjs → PresentationBuilder-2BCCMZW7.cjs} +6 -6
- package/dist/{PresentationBuilder-7LJMTRJ6.mjs → PresentationBuilder-66RV4F45.mjs} +2 -2
- package/dist/{PresentationBuilder-PY2GB4IG.mjs → PresentationBuilder-AFD72LIG.mjs} +3 -3
- package/dist/automation/index.cjs +22 -8
- package/dist/automation/index.mjs +22 -8
- package/dist/chart/edit/fill.d.ts +6 -2
- package/dist/chart/edit/fill.d.ts.map +1 -1
- package/dist/chart/edit/group-options.d.ts +4 -0
- package/dist/chart/edit/group-options.d.ts.map +1 -1
- package/dist/chart/edit/new-chart-minimal.d.ts +13 -0
- package/dist/chart/edit/new-chart-minimal.d.ts.map +1 -0
- package/dist/chart/edit/new-chart.d.ts +34 -1
- package/dist/chart/edit/new-chart.d.ts.map +1 -1
- package/dist/chart/edit/secondary-axis.d.ts +8 -1
- package/dist/chart/edit/secondary-axis.d.ts.map +1 -1
- package/dist/chart/edit/type.d.ts +2 -0
- package/dist/chart/edit/type.d.ts.map +1 -1
- package/dist/chart/index.cjs +426 -266
- package/dist/chart/index.mjs +424 -267
- package/dist/{chunk-3J6VIKLP.cjs → chunk-5TOVSCVT.cjs} +3 -3
- package/dist/{chunk-4LEVL6ZW.mjs → chunk-E2TTMUKU.mjs} +681 -142
- package/dist/{chunk-7T3SJQA6.cjs → chunk-E5TGYYKO.cjs} +1 -0
- package/dist/{chunk-VKFKEVHK.mjs → chunk-EI6555OK.mjs} +1 -1
- package/dist/{chunk-R7NS42KQ.mjs → chunk-FKU2Z6ZB.mjs} +1 -1
- package/dist/{chunk-243ZYX2B.mjs → chunk-G6LEU3Y5.mjs} +1 -1
- package/dist/{chunk-JHYU7HGG.mjs → chunk-H43QQVJU.mjs} +1 -1
- package/dist/{chunk-HLYOHD2Z.mjs → chunk-HH3AYM63.mjs} +664 -146
- package/dist/{chunk-RNZQ2OU4.cjs → chunk-IBRV3AK3.cjs} +1930 -1412
- package/dist/{chunk-WEAWSXUX.mjs → chunk-L6MJGE3Q.mjs} +4 -4
- package/dist/{chunk-IPV3J3I5.mjs → chunk-LXVE2VKR.mjs} +4 -1
- package/dist/{chunk-QZPOPUI5.cjs → chunk-QUAFASFC.cjs} +4 -0
- package/dist/{chunk-XTUX5RMG.cjs → chunk-T4BVZTII.cjs} +9 -9
- package/dist/{chunk-KCDLTVUI.mjs → chunk-X2DC7XRL.mjs} +17 -16
- package/dist/{chunk-OORQCSVA.mjs → chunk-ZLUHU2SU.mjs} +1 -0
- package/dist/docx/index.cjs +300 -144
- package/dist/docx/index.mjs +300 -144
- package/dist/index.cjs +496 -336
- package/dist/index.mjs +496 -336
- package/dist/pptx/automation/index.cjs +879 -310
- package/dist/pptx/automation/index.d.ts +6 -6
- package/dist/pptx/automation/index.mjs +5 -5
- package/dist/pptx/chunks/{elements-PBugbKtv.d.ts → elements-B4Z6N-Gz.d.ts} +4 -477
- package/dist/pptx/chunks/elements-B4Z6N-Gz.d.ts.map +1 -0
- package/dist/pptx/chunks/{index-CCJiD-Bm.d.ts → index-BPGaFlm5.d.ts} +6 -6
- package/dist/pptx/chunks/{index-CCJiD-Bm.d.ts.map → index-BPGaFlm5.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-Bj-hur0D.d.ts → index-D4-WJQ1r.d.ts} +4 -4
- package/dist/pptx/chunks/{index-Bj-hur0D.d.ts.map → index-D4-WJQ1r.d.ts.map} +1 -1
- package/dist/pptx/chunks/{index-CGNb1TV9.d.ts → index-DtFoPmk7.d.ts} +108 -10
- package/dist/pptx/chunks/index-DtFoPmk7.d.ts.map +1 -0
- package/dist/pptx/chunks/{table-C7ITXL3Y.d.ts → table-BfgZfw5R.d.ts} +488 -4
- package/dist/pptx/chunks/table-BfgZfw5R.d.ts.map +1 -0
- package/dist/pptx/chunks/{text-operations-BNJr7aGa.d.ts → text-operations-CVHXOSit.d.ts} +19 -4
- package/dist/pptx/chunks/{text-operations-BNJr7aGa.d.ts.map → text-operations-CVHXOSit.d.ts.map} +1 -1
- package/dist/pptx/cli/index.cjs +832 -263
- package/dist/pptx/cli/index.d.ts +1 -1
- package/dist/pptx/cli/index.mjs +4 -4
- package/dist/pptx/converter/index.cjs +1 -0
- package/dist/pptx/converter/index.d.ts +1 -1
- package/dist/pptx/converter/index.mjs +2 -2
- package/dist/pptx/editor/render/collaboration-live-patch-target.cjs +4 -4
- package/dist/pptx/editor/render/collaboration-live-patch-target.mjs +2 -2
- package/dist/pptx/editor/render/collaboration-reconcile.cjs +8 -8
- package/dist/pptx/editor/render/collaboration-reconcile.mjs +2 -2
- package/dist/pptx/editor/render/collaboration-sync.cjs +14 -14
- package/dist/pptx/editor/render/collaboration-sync.d.ts.map +1 -1
- package/dist/pptx/editor/render/collaboration-sync.mjs +1 -1
- 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.d.ts +2 -2
- 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/editor/render/table-layout.d.ts +1 -1
- package/dist/pptx/editor/render/text-runs-style-patch.d.ts +1 -1
- package/dist/pptx/editor/render/text-style-scope.d.ts +1 -1
- package/dist/pptx/index.cjs +909 -315
- package/dist/pptx/index.d.ts +7 -7
- package/dist/pptx/index.mjs +5 -5
- package/dist/pptx/node/index.d.ts +1 -1
- package/dist/xlsx/index.cjs +22 -8
- package/dist/xlsx/index.mjs +22 -8
- package/dist/xlsx/ui/index.cjs +22 -8
- package/dist/xlsx/ui/index.mjs +22 -8
- package/package.json +1 -1
- package/dist/PptxHandler-V23RDNEX.cjs +0 -14
- package/dist/PptxHandler-WB3KL2WH.mjs +0 -5
- package/dist/pptx/chunks/elements-PBugbKtv.d.ts.map +0 -1
- package/dist/pptx/chunks/index-CGNb1TV9.d.ts.map +0 -1
- package/dist/pptx/chunks/table-C7ITXL3Y.d.ts.map +0 -1
package/dist/pptx/cli/index.cjs
CHANGED
|
@@ -408,9 +408,9 @@ function parseFormula(fmla) {
|
|
|
408
408
|
return { op: op2, args };
|
|
409
409
|
}
|
|
410
410
|
function resolveOperand(token3, variables) {
|
|
411
|
-
const
|
|
412
|
-
if (Number.isFinite(
|
|
413
|
-
return
|
|
411
|
+
const num5 = Number(token3);
|
|
412
|
+
if (Number.isFinite(num5)) {
|
|
413
|
+
return num5;
|
|
414
414
|
}
|
|
415
415
|
const value = variables.get(token3);
|
|
416
416
|
if (value !== void 0) {
|
|
@@ -636,9 +636,9 @@ function resolveCoordinate(value, variables) {
|
|
|
636
636
|
return value;
|
|
637
637
|
}
|
|
638
638
|
const trimmed2 = String(value).trim();
|
|
639
|
-
const
|
|
640
|
-
if (Number.isFinite(
|
|
641
|
-
return
|
|
639
|
+
const num5 = Number(trimmed2);
|
|
640
|
+
if (Number.isFinite(num5)) {
|
|
641
|
+
return num5;
|
|
642
642
|
}
|
|
643
643
|
return resolveOperand(trimmed2, variables);
|
|
644
644
|
}
|
|
@@ -11918,9 +11918,9 @@ function resolveToken(token3, vars) {
|
|
|
11918
11918
|
if (trimmed2 === "") {
|
|
11919
11919
|
return 0;
|
|
11920
11920
|
}
|
|
11921
|
-
const
|
|
11922
|
-
if (Number.isFinite(
|
|
11923
|
-
return
|
|
11921
|
+
const num5 = Number(trimmed2);
|
|
11922
|
+
if (Number.isFinite(num5)) {
|
|
11923
|
+
return num5;
|
|
11924
11924
|
}
|
|
11925
11925
|
return resolveOperand(trimmed2, vars);
|
|
11926
11926
|
}
|
|
@@ -13464,6 +13464,7 @@ var init_collaboration_field_schema = __esm({
|
|
|
13464
13464
|
backgroundImage: "scalar",
|
|
13465
13465
|
backgroundImageProperties: "complex",
|
|
13466
13466
|
backgroundGradient: "scalar",
|
|
13467
|
+
backgroundGradientFill: "complex",
|
|
13467
13468
|
backgroundStyleRef: "complex",
|
|
13468
13469
|
backgroundPattern: "complex",
|
|
13469
13470
|
backgroundShadeToTitle: "scalar",
|
|
@@ -14751,6 +14752,9 @@ function normalizeDegrees(deg) {
|
|
|
14751
14752
|
function ooxmlGradientAngleToCssDegrees(angleDegrees) {
|
|
14752
14753
|
return normalizeDegrees(angleDegrees + OOXML_TO_CSS_OFFSET_DEG);
|
|
14753
14754
|
}
|
|
14755
|
+
function cssDegreesToOoxmlGradientAngle(cssDegrees) {
|
|
14756
|
+
return normalizeDegrees(cssDegrees - OOXML_TO_CSS_OFFSET_DEG);
|
|
14757
|
+
}
|
|
14754
14758
|
var OOXML_TO_CSS_OFFSET_DEG;
|
|
14755
14759
|
var init_gradient_angle = __esm({
|
|
14756
14760
|
"pptx/core/utils/gradient-angle.ts"() {
|
|
@@ -27423,8 +27427,8 @@ var init_smartart_layout_interpreter_cycle_ring_nested_hub = __esm({
|
|
|
27423
27427
|
|
|
27424
27428
|
// diagram/layout/smartart-layout-interpreter-cycle-ring-offset.ts
|
|
27425
27429
|
function resolveRingAxisOffset(dimension2, boundSize, scale, values) {
|
|
27426
|
-
const
|
|
27427
|
-
const epsilon =
|
|
27430
|
+
const span2 = Math.max(1e-9, Math.max(...values) - Math.min(...values));
|
|
27431
|
+
const epsilon = span2 * TIE_EPSILON_FRACTION;
|
|
27428
27432
|
const minValue = Math.min(...values);
|
|
27429
27433
|
const maxValue = Math.max(...values);
|
|
27430
27434
|
const lowCount = values.filter((v) => v - minValue <= epsilon).length;
|
|
@@ -29720,8 +29724,8 @@ function centeredAxisPitch(dimension2, itemSize, gapRatio, count2) {
|
|
|
29720
29724
|
const n = Math.max(1, count2);
|
|
29721
29725
|
const gap = n > 1 ? itemSize * Math.max(0, gapRatio) : 0;
|
|
29722
29726
|
const pitch = itemSize + gap;
|
|
29723
|
-
const
|
|
29724
|
-
const shift = (dimension2 -
|
|
29727
|
+
const span2 = n * itemSize + Math.max(0, n - 1) * gap;
|
|
29728
|
+
const shift = (dimension2 - span2) / 2;
|
|
29725
29729
|
return { pitch, shift };
|
|
29726
29730
|
}
|
|
29727
29731
|
function compositeFanPitch(dimension2, boxW, compositeWidthFactor, cardOffsetXRatio, sibSpRatio, count2) {
|
|
@@ -40196,7 +40200,7 @@ var init_patch = __esm({
|
|
|
40196
40200
|
init_xml2();
|
|
40197
40201
|
XMLNS = "http://www.w3.org/2000/xmlns/";
|
|
40198
40202
|
escapeText = (text2) => text2.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/\r/g, "
");
|
|
40199
|
-
qualifiedName = (xml,
|
|
40203
|
+
qualifiedName = (xml, span2) => /^<([^\s/>]+)/.exec(xml.slice(span2.start, span2.openEnd))?.[1] ?? "";
|
|
40200
40204
|
PartPatch = class {
|
|
40201
40205
|
constructor(xml, rootElement) {
|
|
40202
40206
|
this.xml = xml;
|
|
@@ -40223,9 +40227,9 @@ var init_patch = __esm({
|
|
|
40223
40227
|
this.edits.push({ start, end, text: text2, seq: this.seq++ });
|
|
40224
40228
|
}
|
|
40225
40229
|
span(element2) {
|
|
40226
|
-
const
|
|
40227
|
-
if (!
|
|
40228
|
-
return
|
|
40230
|
+
const span2 = this.spans.get(element2);
|
|
40231
|
+
if (!span2) throw new Error("Element is not a child of the patched root");
|
|
40232
|
+
return span2;
|
|
40229
40233
|
}
|
|
40230
40234
|
/** The prefix bound to `ns` on the root, declaring `preferred` for it when none is. */
|
|
40231
40235
|
prefix(ns, preferred) {
|
|
@@ -40245,20 +40249,20 @@ var init_patch = __esm({
|
|
|
40245
40249
|
}
|
|
40246
40250
|
/** Replaces the element's content, keeping its start tag (and attributes) as written. */
|
|
40247
40251
|
setContent(element2, content2) {
|
|
40248
|
-
const
|
|
40249
|
-
if (
|
|
40250
|
-
this.add(
|
|
40251
|
-
else this.add(
|
|
40252
|
+
const span2 = this.span(element2);
|
|
40253
|
+
if (span2.selfClosing)
|
|
40254
|
+
this.add(span2.openEnd - 2, span2.openEnd, `>${content2}</${qualifiedName(this.xml, span2)}>`);
|
|
40255
|
+
else this.add(span2.openEnd, span2.closeStart, content2);
|
|
40252
40256
|
}
|
|
40253
40257
|
/** Adds ` name="value"` text to the element's start tag. */
|
|
40254
40258
|
addAttribute(element2, attribute5) {
|
|
40255
|
-
const
|
|
40256
|
-
const at2 =
|
|
40259
|
+
const span2 = this.span(element2);
|
|
40260
|
+
const at2 = span2.openEnd - (span2.selfClosing ? 2 : 1);
|
|
40257
40261
|
this.add(at2, at2, attribute5);
|
|
40258
40262
|
}
|
|
40259
40263
|
remove(element2) {
|
|
40260
|
-
const
|
|
40261
|
-
this.add(
|
|
40264
|
+
const span2 = this.span(element2);
|
|
40265
|
+
this.add(span2.start, span2.end, "");
|
|
40262
40266
|
}
|
|
40263
40267
|
/** Inserts `markup` before `before`, or as the root's last child. */
|
|
40264
40268
|
insert(markup, before) {
|
|
@@ -41694,18 +41698,18 @@ function groupTransform(group, parent) {
|
|
|
41694
41698
|
const ext = first(xfrm, "ext", NS.a);
|
|
41695
41699
|
const chOff = first(xfrm, "chOff", NS.a);
|
|
41696
41700
|
const chExt = first(xfrm, "chExt", NS.a);
|
|
41697
|
-
const
|
|
41698
|
-
const cx =
|
|
41699
|
-
const cy =
|
|
41700
|
-
const chCx =
|
|
41701
|
-
const chCy =
|
|
41701
|
+
const num5 = (element2, name) => Number.parseInt(element2?.getAttribute(name) ?? "", 10);
|
|
41702
|
+
const cx = num5(ext, "cx");
|
|
41703
|
+
const cy = num5(ext, "cy");
|
|
41704
|
+
const chCx = num5(chExt, "cx");
|
|
41705
|
+
const chCy = num5(chExt, "cy");
|
|
41702
41706
|
if (!off || ![cx, cy, chCx, chCy].every(Number.isFinite) || chCx === 0 || chCy === 0)
|
|
41703
41707
|
return parent;
|
|
41704
41708
|
const scaleX = cx / chCx;
|
|
41705
41709
|
const scaleY = cy / chCy;
|
|
41706
41710
|
const local = {
|
|
41707
|
-
offsetX:
|
|
41708
|
-
offsetY:
|
|
41711
|
+
offsetX: num5(off, "x") - (num5(chOff, "x") || 0) * scaleX,
|
|
41712
|
+
offsetY: num5(off, "y") - (num5(chOff, "y") || 0) * scaleY,
|
|
41709
41713
|
scaleX,
|
|
41710
41714
|
scaleY
|
|
41711
41715
|
};
|
|
@@ -48738,9 +48742,9 @@ function parseValueColorPositions(node, xmlLookup) {
|
|
|
48738
48742
|
const entry2 = { kind };
|
|
48739
48743
|
const rawVal = posNode["@_val"];
|
|
48740
48744
|
if (rawVal !== void 0) {
|
|
48741
|
-
const
|
|
48742
|
-
if (Number.isFinite(
|
|
48743
|
-
entry2.value =
|
|
48745
|
+
const num5 = Number.parseFloat(String(rawVal));
|
|
48746
|
+
if (Number.isFinite(num5)) {
|
|
48747
|
+
entry2.value = num5;
|
|
48744
48748
|
}
|
|
48745
48749
|
}
|
|
48746
48750
|
positions2.push(entry2);
|
|
@@ -49102,8 +49106,8 @@ var init_chart_cx_parser = __esm({
|
|
|
49102
49106
|
// pptx/core/utils/chart-user-shapes-parser.ts
|
|
49103
49107
|
function markerFraction(marker2, axis, xml) {
|
|
49104
49108
|
const raw2 = xml.getScalarChildByLocalName(marker2, axis);
|
|
49105
|
-
const
|
|
49106
|
-
return Number.isFinite(
|
|
49109
|
+
const num5 = Number.parseFloat(String(raw2 ?? ""));
|
|
49110
|
+
return Number.isFinite(num5) ? num5 : 0;
|
|
49107
49111
|
}
|
|
49108
49112
|
function parseShapeParagraphs(shape2, xml, colors) {
|
|
49109
49113
|
const txBody = xml.getChildByLocalName(shape2, "txBody");
|
|
@@ -49226,13 +49230,13 @@ function buildUserShape(shape2, kind, base, xml, colors) {
|
|
|
49226
49230
|
};
|
|
49227
49231
|
}
|
|
49228
49232
|
function parseOffExt(offNode, extNode) {
|
|
49229
|
-
const
|
|
49233
|
+
const num5 = (node, attr6) => {
|
|
49230
49234
|
const raw2 = Number.parseFloat(String(node?.[attr6] ?? ""));
|
|
49231
49235
|
return Number.isFinite(raw2) ? raw2 : 0;
|
|
49232
49236
|
};
|
|
49233
49237
|
return {
|
|
49234
|
-
off: { x:
|
|
49235
|
-
ext: { cx:
|
|
49238
|
+
off: { x: num5(offNode, "@_x"), y: num5(offNode, "@_y") },
|
|
49239
|
+
ext: { cx: num5(extNode, "@_cx"), cy: num5(extNode, "@_cy") }
|
|
49236
49240
|
};
|
|
49237
49241
|
}
|
|
49238
49242
|
function parseGroupTransform(group, xml) {
|
|
@@ -49528,8 +49532,8 @@ function resolveCellValue(cell2, sharedStrings) {
|
|
|
49528
49532
|
case "inlineStr":
|
|
49529
49533
|
return cell2.value;
|
|
49530
49534
|
default: {
|
|
49531
|
-
const
|
|
49532
|
-
return Number.isFinite(
|
|
49535
|
+
const num5 = Number.parseFloat(cell2.value);
|
|
49536
|
+
return Number.isFinite(num5) ? num5 : cell2.value;
|
|
49533
49537
|
}
|
|
49534
49538
|
}
|
|
49535
49539
|
}
|
|
@@ -49614,8 +49618,8 @@ async function parseEmbeddedXlsx(xlsxData) {
|
|
|
49614
49618
|
} else if (typeof cellVal === "number") {
|
|
49615
49619
|
values.push(cellVal);
|
|
49616
49620
|
} else {
|
|
49617
|
-
const
|
|
49618
|
-
values.push(Number.isFinite(
|
|
49621
|
+
const num5 = Number.parseFloat(String(cellVal));
|
|
49622
|
+
values.push(Number.isFinite(num5) ? num5 : 0);
|
|
49619
49623
|
}
|
|
49620
49624
|
}
|
|
49621
49625
|
series.push({ name, values });
|
|
@@ -50129,8 +50133,8 @@ function parseVmlOpacity(value) {
|
|
|
50129
50133
|
const pct = parseFloat(trimmed2.slice(0, -1));
|
|
50130
50134
|
return Number.isFinite(pct) ? pct / 100 : void 0;
|
|
50131
50135
|
}
|
|
50132
|
-
const
|
|
50133
|
-
return Number.isFinite(
|
|
50136
|
+
const num5 = parseFloat(trimmed2);
|
|
50137
|
+
return Number.isFinite(num5) ? Math.min(1, Math.max(0, num5)) : void 0;
|
|
50134
50138
|
}
|
|
50135
50139
|
var NAMED_COLORS;
|
|
50136
50140
|
var init_vml_color_parser = __esm({
|
|
@@ -50173,29 +50177,29 @@ function parseCssDimension(value, containerPx) {
|
|
|
50173
50177
|
if (trimmed2.length === 0) {
|
|
50174
50178
|
return 0;
|
|
50175
50179
|
}
|
|
50176
|
-
const
|
|
50177
|
-
if (!Number.isFinite(
|
|
50180
|
+
const num5 = parseFloat(trimmed2);
|
|
50181
|
+
if (!Number.isFinite(num5)) {
|
|
50178
50182
|
return 0;
|
|
50179
50183
|
}
|
|
50180
50184
|
if (trimmed2.endsWith("pt")) {
|
|
50181
|
-
return
|
|
50185
|
+
return num5 / PT_PER_PX2;
|
|
50182
50186
|
}
|
|
50183
50187
|
if (trimmed2.endsWith("in")) {
|
|
50184
|
-
return
|
|
50188
|
+
return num5 * 96;
|
|
50185
50189
|
}
|
|
50186
50190
|
if (trimmed2.endsWith("cm")) {
|
|
50187
|
-
return
|
|
50191
|
+
return num5 * (96 / 2.54);
|
|
50188
50192
|
}
|
|
50189
50193
|
if (trimmed2.endsWith("mm")) {
|
|
50190
|
-
return
|
|
50194
|
+
return num5 * (96 / 25.4);
|
|
50191
50195
|
}
|
|
50192
50196
|
if (trimmed2.endsWith("emu")) {
|
|
50193
|
-
return
|
|
50197
|
+
return num5 / EMU_PER_PX6;
|
|
50194
50198
|
}
|
|
50195
50199
|
if (trimmed2.endsWith("%")) {
|
|
50196
|
-
return containerPx ?
|
|
50200
|
+
return containerPx ? num5 / 100 * containerPx : 0;
|
|
50197
50201
|
}
|
|
50198
|
-
return
|
|
50202
|
+
return num5;
|
|
50199
50203
|
}
|
|
50200
50204
|
function parseVmlStyle(styleAttr) {
|
|
50201
50205
|
const result = {};
|
|
@@ -58583,8 +58587,8 @@ function rebaseCommentMentions(mentions, oldText, newText, loaded) {
|
|
|
58583
58587
|
}
|
|
58584
58588
|
continue;
|
|
58585
58589
|
}
|
|
58586
|
-
const
|
|
58587
|
-
if (
|
|
58590
|
+
const span2 = oldText.slice(start, end);
|
|
58591
|
+
if (span2.length !== mention.length) {
|
|
58588
58592
|
continue;
|
|
58589
58593
|
}
|
|
58590
58594
|
let next = -1;
|
|
@@ -58593,11 +58597,11 @@ function rebaseCommentMentions(mentions, oldText, newText, loaded) {
|
|
|
58593
58597
|
} else if (start >= changeEnd) {
|
|
58594
58598
|
next = start + delta2;
|
|
58595
58599
|
}
|
|
58596
|
-
if (next >= 0 && newText.slice(next, next + mention.length) ===
|
|
58600
|
+
if (next >= 0 && newText.slice(next, next + mention.length) === span2) {
|
|
58597
58601
|
result.push(next === start ? mention : { ...mention, startIndex: next });
|
|
58598
58602
|
continue;
|
|
58599
58603
|
}
|
|
58600
|
-
const relocated = nearestOccurrence(newText,
|
|
58604
|
+
const relocated = nearestOccurrence(newText, span2, next >= 0 ? next : start);
|
|
58601
58605
|
if (relocated >= 0) {
|
|
58602
58606
|
result.push({ ...mention, startIndex: relocated });
|
|
58603
58607
|
}
|
|
@@ -58657,17 +58661,17 @@ var init_modern_comment_mentions = __esm({
|
|
|
58657
58661
|
}
|
|
58658
58662
|
return index;
|
|
58659
58663
|
};
|
|
58660
|
-
nearestOccurrence = (text2,
|
|
58664
|
+
nearestOccurrence = (text2, span2, hint) => {
|
|
58661
58665
|
let best = -1;
|
|
58662
58666
|
let bestDistance = Number.POSITIVE_INFINITY;
|
|
58663
|
-
let at2 = text2.indexOf(
|
|
58667
|
+
let at2 = text2.indexOf(span2);
|
|
58664
58668
|
while (at2 !== -1) {
|
|
58665
58669
|
const distance = Math.abs(at2 - hint);
|
|
58666
58670
|
if (distance < bestDistance) {
|
|
58667
58671
|
best = at2;
|
|
58668
58672
|
bestDistance = distance;
|
|
58669
58673
|
}
|
|
58670
|
-
at2 = text2.indexOf(
|
|
58674
|
+
at2 = text2.indexOf(span2, at2 + 1);
|
|
58671
58675
|
}
|
|
58672
58676
|
return best;
|
|
58673
58677
|
};
|
|
@@ -59494,8 +59498,8 @@ function renderBars(element2, x, y, w, h2) {
|
|
|
59494
59498
|
const values = chartValues(element2);
|
|
59495
59499
|
const min = Math.min(0, ...values);
|
|
59496
59500
|
const max = Math.max(0, ...values);
|
|
59497
|
-
const
|
|
59498
|
-
const zeroY = y + max /
|
|
59501
|
+
const span2 = max - min || 1;
|
|
59502
|
+
const zeroY = y + max / span2 * h2;
|
|
59499
59503
|
const categoryCount = Math.max(
|
|
59500
59504
|
data.categories.length,
|
|
59501
59505
|
...data.series.map((s) => s.values.length),
|
|
@@ -59506,7 +59510,7 @@ function renderBars(element2, x, y, w, h2) {
|
|
|
59506
59510
|
const parts = [`<line x1="${x}" y1="${zeroY}" x2="${x + w}" y2="${zeroY}" stroke="#666666" />`];
|
|
59507
59511
|
data.series.forEach((series, seriesIndex) => {
|
|
59508
59512
|
series.values.forEach((value, categoryIndex) => {
|
|
59509
|
-
const valueY = y + (max - value) /
|
|
59513
|
+
const valueY = y + (max - value) / span2 * h2;
|
|
59510
59514
|
parts.push(
|
|
59511
59515
|
`<rect data-chart-mark="bar" x="${x + categoryIndex * clusterWidth + clusterWidth * 0.14 + seriesIndex * barWidth}" y="${Math.min(valueY, zeroY)}" width="${Math.max(barWidth - 1, 1)}" height="${Math.max(Math.abs(zeroY - valueY), 0.5)}" fill="${esc3(color(series, seriesIndex))}" />`
|
|
59512
59516
|
);
|
|
@@ -59519,10 +59523,10 @@ function renderLines(element2, x, y, w, h2) {
|
|
|
59519
59523
|
const values = chartValues(element2);
|
|
59520
59524
|
const min = Math.min(...values);
|
|
59521
59525
|
const max = Math.max(...values);
|
|
59522
|
-
const
|
|
59526
|
+
const span2 = max - min || 1;
|
|
59523
59527
|
return data.series.map((series, seriesIndex) => {
|
|
59524
59528
|
const denominator = Math.max(series.values.length - 1, 1);
|
|
59525
|
-
const points7 = series.values.map((value, index) => `${x + index / denominator * w},${y + (max - value) /
|
|
59529
|
+
const points7 = series.values.map((value, index) => `${x + index / denominator * w},${y + (max - value) / span2 * h2}`).join(" ");
|
|
59526
59530
|
return `<polyline data-chart-mark="line" points="${points7}" fill="none" stroke="${esc3(color(series, seriesIndex))}" stroke-width="2" />`;
|
|
59527
59531
|
}).join("");
|
|
59528
59532
|
}
|
|
@@ -60435,6 +60439,130 @@ var init_json = __esm({
|
|
|
60435
60439
|
}
|
|
60436
60440
|
});
|
|
60437
60441
|
|
|
60442
|
+
// pptx/core/utils/slide-background-gradient.ts
|
|
60443
|
+
function cssColor(color3, opacity2) {
|
|
60444
|
+
if (opacity2 === void 0 || opacity2 >= 1) {
|
|
60445
|
+
return color3;
|
|
60446
|
+
}
|
|
60447
|
+
const hex3 = color3.replace("#", "");
|
|
60448
|
+
const channel = (index) => Number.parseInt(hex3.slice(index, index + 2), 16);
|
|
60449
|
+
return `rgba(${channel(0)}, ${channel(2)}, ${channel(4)}, ${num3(opacity2)})`;
|
|
60450
|
+
}
|
|
60451
|
+
function slideBackgroundGradientCss(gradient) {
|
|
60452
|
+
const stops = (gradient.fillGradientStops ?? []).map((stop) => `${cssColor(stop.color, stop.opacity)} ${num3(stop.position)}%`).join(", ");
|
|
60453
|
+
if (gradient.fillGradientType !== "radial") {
|
|
60454
|
+
const angle = ooxmlGradientAngleToCssDegrees(gradient.fillGradientAngle ?? 0);
|
|
60455
|
+
return `linear-gradient(${num3(angle)}deg, ${stops})`;
|
|
60456
|
+
}
|
|
60457
|
+
const focus = gradient.fillGradientFillToRect;
|
|
60458
|
+
const cx = focus ? (focus.l + (1 - focus.r)) / 2 * 100 : 50;
|
|
60459
|
+
const cy = focus ? (focus.t + (1 - focus.b)) / 2 * 100 : 50;
|
|
60460
|
+
const at2 = `at ${num3(cx)}% ${num3(cy)}%`;
|
|
60461
|
+
switch (gradient.fillGradientPathType) {
|
|
60462
|
+
case "rect":
|
|
60463
|
+
return `radial-gradient(${num3(Math.max(cx, 100 - cx))}% ${num3(Math.max(cy, 100 - cy))}% ${at2}, ${stops})`;
|
|
60464
|
+
case "shape":
|
|
60465
|
+
return `radial-gradient(farthest-side ${at2}, ${stops})`;
|
|
60466
|
+
default:
|
|
60467
|
+
return `radial-gradient(circle ${at2}, ${stops})`;
|
|
60468
|
+
}
|
|
60469
|
+
}
|
|
60470
|
+
function slideBackgroundGradientToWrite(slide) {
|
|
60471
|
+
const gradient = slide.backgroundGradientFill;
|
|
60472
|
+
if (!gradient || !slide.backgroundGradient) {
|
|
60473
|
+
return void 0;
|
|
60474
|
+
}
|
|
60475
|
+
return slide.backgroundGradient === slideBackgroundGradientCss(gradient) ? gradient : void 0;
|
|
60476
|
+
}
|
|
60477
|
+
var num3;
|
|
60478
|
+
var init_slide_background_gradient = __esm({
|
|
60479
|
+
"pptx/core/utils/slide-background-gradient.ts"() {
|
|
60480
|
+
init_gradient_angle();
|
|
60481
|
+
num3 = (value) => String(Number(value.toFixed(3)));
|
|
60482
|
+
}
|
|
60483
|
+
});
|
|
60484
|
+
|
|
60485
|
+
// pptx/core/builders/sdk/background-gradient-input.ts
|
|
60486
|
+
function finite3(name, value, min, max) {
|
|
60487
|
+
if (typeof value !== "number" || !Number.isFinite(value)) {
|
|
60488
|
+
throw new RangeError(`${WHERE}.${name} must be a finite number, got ${String(value)}`);
|
|
60489
|
+
}
|
|
60490
|
+
if (min !== void 0 && value < min || max !== void 0 && value > max) {
|
|
60491
|
+
throw new RangeError(`${WHERE}.${name} must be between ${min} and ${max}, got ${value}`);
|
|
60492
|
+
}
|
|
60493
|
+
return value;
|
|
60494
|
+
}
|
|
60495
|
+
function stopsOf(input) {
|
|
60496
|
+
if (!Array.isArray(input.stops) || input.stops.length < 2) {
|
|
60497
|
+
throw new RangeError(`${WHERE}.stops needs at least two stops (a:gsLst)`);
|
|
60498
|
+
}
|
|
60499
|
+
return input.stops.map((stop, index) => {
|
|
60500
|
+
if (typeof stop.color !== "string" || !HEX.test(stop.color)) {
|
|
60501
|
+
throw new RangeError(
|
|
60502
|
+
`${WHERE}.stops[${index}].color must be #RRGGBB, got ${String(stop.color)}`
|
|
60503
|
+
);
|
|
60504
|
+
}
|
|
60505
|
+
const position4 = finite3(`stops[${index}].position`, stop.position, 0, 1);
|
|
60506
|
+
const opacity2 = stop.opacity === void 0 ? void 0 : finite3(`stops[${index}].opacity`, stop.opacity, 0, 1);
|
|
60507
|
+
return {
|
|
60508
|
+
color: `#${stop.color.replace("#", "").toUpperCase()}`,
|
|
60509
|
+
// The shape gradient model keeps positions in percent.
|
|
60510
|
+
position: position4 * 100,
|
|
60511
|
+
...opacity2 !== void 0 ? { opacity: opacity2 } : {}
|
|
60512
|
+
};
|
|
60513
|
+
});
|
|
60514
|
+
}
|
|
60515
|
+
function mapBackgroundGradientInput(input) {
|
|
60516
|
+
const fillGradientStops = stopsOf(input);
|
|
60517
|
+
let gradient;
|
|
60518
|
+
if (input.path !== void 0) {
|
|
60519
|
+
if (!PATHS.has(input.path)) {
|
|
60520
|
+
throw new RangeError(
|
|
60521
|
+
`${WHERE}.path must be circle, rect or shape, got ${String(input.path)}`
|
|
60522
|
+
);
|
|
60523
|
+
}
|
|
60524
|
+
if (input.angle !== void 0) {
|
|
60525
|
+
throw new RangeError(`${WHERE}.angle applies to a linear gradient, not a path one`);
|
|
60526
|
+
}
|
|
60527
|
+
const focus = input.focus ?? { l: 0.5, t: 0.5, r: 0.5, b: 0.5 };
|
|
60528
|
+
gradient = {
|
|
60529
|
+
fillGradientType: "radial",
|
|
60530
|
+
fillGradientPathType: input.path,
|
|
60531
|
+
fillGradientStops,
|
|
60532
|
+
fillGradientFillToRect: {
|
|
60533
|
+
l: finite3("focus.l", focus.l),
|
|
60534
|
+
t: finite3("focus.t", focus.t),
|
|
60535
|
+
r: finite3("focus.r", focus.r),
|
|
60536
|
+
b: finite3("focus.b", focus.b)
|
|
60537
|
+
}
|
|
60538
|
+
};
|
|
60539
|
+
} else {
|
|
60540
|
+
if (input.focus !== void 0) {
|
|
60541
|
+
throw new RangeError(`${WHERE}.focus needs a path gradient`);
|
|
60542
|
+
}
|
|
60543
|
+
const cssAngle = finite3("angle", input.angle ?? 180);
|
|
60544
|
+
gradient = {
|
|
60545
|
+
fillGradientType: "linear",
|
|
60546
|
+
fillGradientAngle: cssDegreesToOoxmlGradientAngle(cssAngle),
|
|
60547
|
+
fillGradientStops
|
|
60548
|
+
};
|
|
60549
|
+
}
|
|
60550
|
+
return {
|
|
60551
|
+
backgroundGradient: slideBackgroundGradientCss(gradient),
|
|
60552
|
+
backgroundGradientFill: gradient
|
|
60553
|
+
};
|
|
60554
|
+
}
|
|
60555
|
+
var HEX, PATHS, WHERE;
|
|
60556
|
+
var init_background_gradient_input = __esm({
|
|
60557
|
+
"pptx/core/builders/sdk/background-gradient-input.ts"() {
|
|
60558
|
+
init_gradient_angle();
|
|
60559
|
+
init_slide_background_gradient();
|
|
60560
|
+
HEX = /^#?[0-9a-f]{6}$/iu;
|
|
60561
|
+
PATHS = /* @__PURE__ */ new Set(["circle", "rect", "shape"]);
|
|
60562
|
+
WHERE = "BackgroundInput";
|
|
60563
|
+
}
|
|
60564
|
+
});
|
|
60565
|
+
|
|
60438
60566
|
// pptx/core/core/runtime/table-style-defaults.ts
|
|
60439
60567
|
var DEFAULT_POWERPOINT_TABLE_STYLE_ID;
|
|
60440
60568
|
var init_table_style_defaults = __esm({
|
|
@@ -60810,8 +60938,8 @@ function authoredValue(node) {
|
|
|
60810
60938
|
return void 0;
|
|
60811
60939
|
}
|
|
60812
60940
|
const raw2 = node["@_val"];
|
|
60813
|
-
const
|
|
60814
|
-
return Number.isFinite(
|
|
60941
|
+
const num5 = raw2 === void 0 || raw2 === null || raw2 === "" ? NaN : Number.parseFloat(String(raw2));
|
|
60942
|
+
return Number.isFinite(num5) ? num5 : void 0;
|
|
60815
60943
|
}
|
|
60816
60944
|
function applyChartGroupOptionsToXml(container2, containerLocal, chartData, getLocalName2) {
|
|
60817
60945
|
let changed = false;
|
|
@@ -61003,6 +61131,44 @@ var init_chart_layout_input = __esm({
|
|
|
61003
61131
|
}
|
|
61004
61132
|
});
|
|
61005
61133
|
|
|
61134
|
+
// pptx/core/utils/chart-container-type-map.ts
|
|
61135
|
+
function chartContainerLocalNameToType(localName28) {
|
|
61136
|
+
return CONTAINER_LOCAL_NAME_TO_TYPE[localName28];
|
|
61137
|
+
}
|
|
61138
|
+
function isLineDrawnChartType(type) {
|
|
61139
|
+
return type !== void 0 && LINE_DRAWN_CHART_TYPES.has(type);
|
|
61140
|
+
}
|
|
61141
|
+
var CONTAINER_LOCAL_NAME_TO_TYPE, LINE_DRAWN_CHART_TYPES;
|
|
61142
|
+
var init_chart_container_type_map = __esm({
|
|
61143
|
+
"pptx/core/utils/chart-container-type-map.ts"() {
|
|
61144
|
+
CONTAINER_LOCAL_NAME_TO_TYPE = {
|
|
61145
|
+
barChart: "bar",
|
|
61146
|
+
bar3DChart: "bar3D",
|
|
61147
|
+
lineChart: "line",
|
|
61148
|
+
line3DChart: "line3D",
|
|
61149
|
+
pieChart: "pie",
|
|
61150
|
+
pie3DChart: "pie3D",
|
|
61151
|
+
ofPieChart: "ofPie",
|
|
61152
|
+
doughnutChart: "doughnut",
|
|
61153
|
+
areaChart: "area",
|
|
61154
|
+
area3DChart: "area3D",
|
|
61155
|
+
scatterChart: "scatter",
|
|
61156
|
+
bubbleChart: "bubble",
|
|
61157
|
+
radarChart: "radar",
|
|
61158
|
+
stockChart: "stock",
|
|
61159
|
+
surfaceChart: "surface",
|
|
61160
|
+
surface3DChart: "surface"
|
|
61161
|
+
};
|
|
61162
|
+
LINE_DRAWN_CHART_TYPES = /* @__PURE__ */ new Set([
|
|
61163
|
+
"line",
|
|
61164
|
+
"line3D",
|
|
61165
|
+
"scatter",
|
|
61166
|
+
"radar",
|
|
61167
|
+
"stock"
|
|
61168
|
+
]);
|
|
61169
|
+
}
|
|
61170
|
+
});
|
|
61171
|
+
|
|
61006
61172
|
// pptx/core/builders/sdk/chart-operations.ts
|
|
61007
61173
|
function ensureChartData(element2) {
|
|
61008
61174
|
if (!element2.chartData) {
|
|
@@ -61277,6 +61443,289 @@ var init_shape_style_input = __esm({
|
|
|
61277
61443
|
}
|
|
61278
61444
|
});
|
|
61279
61445
|
|
|
61446
|
+
// pptx/core/builders/sdk/table-border-input.ts
|
|
61447
|
+
function borderDashSegments(edge, lengths, width) {
|
|
61448
|
+
const name = `TableCellInput.borders.${edge}.dash`;
|
|
61449
|
+
if (lengths.length === 0) {
|
|
61450
|
+
throw new RangeError(`${name} must give at least one length`);
|
|
61451
|
+
}
|
|
61452
|
+
if (lengths.some((n) => !Number.isFinite(n) || n <= 0)) {
|
|
61453
|
+
throw new RangeError(`${name} lengths must be finite and above 0, got [${lengths.join(", ")}]`);
|
|
61454
|
+
}
|
|
61455
|
+
const segments = customDashSegments([...lengths], width !== void 0 && width > 0 ? width : 1);
|
|
61456
|
+
if (segments.some((s) => s.dash <= 0 || s.space <= 0)) {
|
|
61457
|
+
throw new RangeError(`${name} has a length too short to write: [${lengths.join(", ")}]`);
|
|
61458
|
+
}
|
|
61459
|
+
if (segments.some((s) => s.dash > MAX_DASH_UNITS || s.space > MAX_DASH_UNITS)) {
|
|
61460
|
+
throw new RangeError(`${name} has a length too long to write: [${lengths.join(", ")}]`);
|
|
61461
|
+
}
|
|
61462
|
+
return segments;
|
|
61463
|
+
}
|
|
61464
|
+
function edgeStyle(edge, prefix, input) {
|
|
61465
|
+
if (input.width !== void 0 && (!Number.isFinite(input.width) || input.width < 0)) {
|
|
61466
|
+
throw new RangeError(
|
|
61467
|
+
`TableCellInput.borders.${edge}.width must be a finite width of 0 or more, got ${input.width}`
|
|
61468
|
+
);
|
|
61469
|
+
}
|
|
61470
|
+
const out = {};
|
|
61471
|
+
if (input.width !== void 0) out[`${prefix}Width`] = input.width;
|
|
61472
|
+
if (input.color !== void 0) out[`${prefix}Color`] = input.color;
|
|
61473
|
+
if (Array.isArray(input.dash)) {
|
|
61474
|
+
out[`${prefix}Dash`] = "custom";
|
|
61475
|
+
out[`${prefix}DashSegments`] = borderDashSegments(edge, input.dash, input.width);
|
|
61476
|
+
} else if (input.dash !== void 0) {
|
|
61477
|
+
if (input.dash === "custom") {
|
|
61478
|
+
throw new RangeError(`TableCellInput.borders.${edge}.dash: give 'custom' as a length list`);
|
|
61479
|
+
}
|
|
61480
|
+
out[`${prefix}Dash`] = input.dash;
|
|
61481
|
+
}
|
|
61482
|
+
return out;
|
|
61483
|
+
}
|
|
61484
|
+
function tableCellBorderStyle(borders) {
|
|
61485
|
+
if (!borders) {
|
|
61486
|
+
return {};
|
|
61487
|
+
}
|
|
61488
|
+
const out = {};
|
|
61489
|
+
for (const [edge, prefix] of EDGES) {
|
|
61490
|
+
const own = borders[edge];
|
|
61491
|
+
const input = borders.all || own ? { ...borders.all, ...own } : void 0;
|
|
61492
|
+
if (input) {
|
|
61493
|
+
Object.assign(out, edgeStyle(own ? edge : "all", prefix, input));
|
|
61494
|
+
}
|
|
61495
|
+
}
|
|
61496
|
+
return out;
|
|
61497
|
+
}
|
|
61498
|
+
var MAX_DASH_UNITS, EDGES;
|
|
61499
|
+
var init_table_border_input = __esm({
|
|
61500
|
+
"pptx/core/builders/sdk/table-border-input.ts"() {
|
|
61501
|
+
init_shape_style_input();
|
|
61502
|
+
MAX_DASH_UNITS = 2147483647;
|
|
61503
|
+
EDGES = [
|
|
61504
|
+
["top", "borderTop"],
|
|
61505
|
+
["right", "borderRight"],
|
|
61506
|
+
["bottom", "borderBottom"],
|
|
61507
|
+
["left", "borderLeft"]
|
|
61508
|
+
];
|
|
61509
|
+
}
|
|
61510
|
+
});
|
|
61511
|
+
|
|
61512
|
+
// pptx/core/builders/sdk/table-cell-input.ts
|
|
61513
|
+
function refuseGradientExtras(fill3) {
|
|
61514
|
+
const radial = fill3.path !== void 0 || fill3.gradientType === "radial";
|
|
61515
|
+
const unsupported3 = [
|
|
61516
|
+
fill3.tile !== void 0 ? "tile" : void 0,
|
|
61517
|
+
fill3.scaled === false ? "scaled: false" : void 0,
|
|
61518
|
+
fill3.rotWithShape !== void 0 ? "rotWithShape" : void 0,
|
|
61519
|
+
fill3.focus !== void 0 && !radial ? "focus on a linear gradient" : void 0
|
|
61520
|
+
].filter((name) => name !== void 0);
|
|
61521
|
+
if (unsupported3.length > 0) {
|
|
61522
|
+
throw new RangeError(
|
|
61523
|
+
`TableCellInput.fill: ${unsupported3.join(", ")} cannot be written on a table cell`
|
|
61524
|
+
);
|
|
61525
|
+
}
|
|
61526
|
+
if (fill3.stops.length === 0) {
|
|
61527
|
+
throw new RangeError("TableCellInput.fill: a gradient needs at least one stop");
|
|
61528
|
+
}
|
|
61529
|
+
}
|
|
61530
|
+
function tableCellFillStyle(fill3) {
|
|
61531
|
+
switch (fill3?.type) {
|
|
61532
|
+
case void 0:
|
|
61533
|
+
return {};
|
|
61534
|
+
case "solid":
|
|
61535
|
+
if (fill3.opacity !== void 0 && fill3.opacity !== 1) {
|
|
61536
|
+
throw new RangeError(
|
|
61537
|
+
`TableCellInput.fill.opacity cannot be written on a table cell, got ${fill3.opacity}`
|
|
61538
|
+
);
|
|
61539
|
+
}
|
|
61540
|
+
return {
|
|
61541
|
+
fillMode: "solid",
|
|
61542
|
+
backgroundColor: fill3.color,
|
|
61543
|
+
...fill3.themeColorRef ? { backgroundColorRef: fill3.themeColorRef } : {}
|
|
61544
|
+
};
|
|
61545
|
+
case "gradient": {
|
|
61546
|
+
refuseGradientExtras(fill3);
|
|
61547
|
+
const radial = fill3.path !== void 0 || fill3.gradientType === "radial";
|
|
61548
|
+
return {
|
|
61549
|
+
fillMode: "gradient",
|
|
61550
|
+
gradientFillType: radial ? "radial" : "linear",
|
|
61551
|
+
gradientFillAngle: fill3.angle ?? 0,
|
|
61552
|
+
gradientFillStops: fill3.stops.map((stop) => ({
|
|
61553
|
+
color: stop.color,
|
|
61554
|
+
position: stop.position,
|
|
61555
|
+
...stop.opacity !== void 0 ? { opacity: stop.opacity } : {}
|
|
61556
|
+
})),
|
|
61557
|
+
...radial ? { gradientFillPathType: fill3.path ?? "circle" } : {},
|
|
61558
|
+
...fill3.focus ? { gradientFillFillToRect: { ...fill3.focus } } : {}
|
|
61559
|
+
};
|
|
61560
|
+
}
|
|
61561
|
+
case "pattern":
|
|
61562
|
+
if (!fill3.preset) {
|
|
61563
|
+
throw new RangeError("TableCellInput.fill: a pattern fill needs a preset");
|
|
61564
|
+
}
|
|
61565
|
+
return {
|
|
61566
|
+
fillMode: "pattern",
|
|
61567
|
+
patternFillPreset: fill3.preset,
|
|
61568
|
+
...fill3.foreground !== void 0 ? { patternFillForeground: fill3.foreground } : {},
|
|
61569
|
+
...fill3.background !== void 0 ? { patternFillBackground: fill3.background } : {}
|
|
61570
|
+
};
|
|
61571
|
+
case "image":
|
|
61572
|
+
throw new RangeError("TableCellInput.fill: an image fill cannot be written on a table cell");
|
|
61573
|
+
case "none":
|
|
61574
|
+
return { fillMode: "none" };
|
|
61575
|
+
}
|
|
61576
|
+
}
|
|
61577
|
+
function tableCellTextStyle(style) {
|
|
61578
|
+
const out = {};
|
|
61579
|
+
if (style?.fontSize !== void 0) out.fontSize = style.fontSize;
|
|
61580
|
+
if (style?.bold !== void 0) out.bold = style.bold;
|
|
61581
|
+
if (style?.italic !== void 0) out.italic = style.italic;
|
|
61582
|
+
if (style?.color !== void 0) out.color = style.color;
|
|
61583
|
+
if (style?.alignment !== void 0) out.align = style.alignment;
|
|
61584
|
+
return out;
|
|
61585
|
+
}
|
|
61586
|
+
function tableCellStyle(cell2) {
|
|
61587
|
+
const style = {
|
|
61588
|
+
...tableCellTextStyle(cell2.style),
|
|
61589
|
+
...tableCellFillStyle(cell2.fill),
|
|
61590
|
+
...tableCellBorderStyle(cell2.borders)
|
|
61591
|
+
};
|
|
61592
|
+
return cell2.style || Object.keys(style).length > 0 ? style : void 0;
|
|
61593
|
+
}
|
|
61594
|
+
var init_table_cell_input = __esm({
|
|
61595
|
+
"pptx/core/builders/sdk/table-cell-input.ts"() {
|
|
61596
|
+
init_table_border_input();
|
|
61597
|
+
}
|
|
61598
|
+
});
|
|
61599
|
+
|
|
61600
|
+
// pptx/core/builders/sdk/table-merge-input.ts
|
|
61601
|
+
function span(value, name) {
|
|
61602
|
+
if (value === void 0) {
|
|
61603
|
+
return 1;
|
|
61604
|
+
}
|
|
61605
|
+
if (!Number.isInteger(value) || value < 1) {
|
|
61606
|
+
throw new RangeError(`TableCellInput.${name} must be a whole number from 1, got ${value}`);
|
|
61607
|
+
}
|
|
61608
|
+
return value;
|
|
61609
|
+
}
|
|
61610
|
+
function placeTableCells(input) {
|
|
61611
|
+
const rowCount = input.rows.length;
|
|
61612
|
+
const slots = input.rows.map(() => []);
|
|
61613
|
+
input.rows.forEach((row, ri) => {
|
|
61614
|
+
const rowSlots = slots[ri] ?? [];
|
|
61615
|
+
let ci = 0;
|
|
61616
|
+
for (const cell2 of row.cells) {
|
|
61617
|
+
while (rowSlots[ci]) {
|
|
61618
|
+
ci += 1;
|
|
61619
|
+
}
|
|
61620
|
+
const colSpan = span(cell2.gridSpan, "gridSpan");
|
|
61621
|
+
const rowSpan = span(cell2.rowSpan, "rowSpan");
|
|
61622
|
+
if (ri + rowSpan > rowCount) {
|
|
61623
|
+
throw new RangeError(
|
|
61624
|
+
`A cell in row ${ri} spans ${rowSpan} rows, past the table's ${rowCount} rows`
|
|
61625
|
+
);
|
|
61626
|
+
}
|
|
61627
|
+
for (let dr = 0; dr < rowSpan; dr++) {
|
|
61628
|
+
for (let dc = 0; dc < colSpan; dc++) {
|
|
61629
|
+
const target = slots[ri + dr] ?? [];
|
|
61630
|
+
if (target[ci + dc]) {
|
|
61631
|
+
throw new RangeError(
|
|
61632
|
+
`A cell in row ${ri} overlaps the merge covering row ${ri + dr}, column ${ci + dc}`
|
|
61633
|
+
);
|
|
61634
|
+
}
|
|
61635
|
+
target[ci + dc] = dr === 0 && dc === 0 ? { cell: cell2 } : { hMerge: dc > 0, vMerge: dr > 0 };
|
|
61636
|
+
}
|
|
61637
|
+
}
|
|
61638
|
+
ci += colSpan;
|
|
61639
|
+
}
|
|
61640
|
+
});
|
|
61641
|
+
const widest = Math.max(...slots.map((row) => row.length), 1);
|
|
61642
|
+
const declared = input.columnWidths?.length;
|
|
61643
|
+
if (declared !== void 0 && widest > declared) {
|
|
61644
|
+
throw new RangeError(`A row takes ${widest} columns, but columnWidths gives ${declared}`);
|
|
61645
|
+
}
|
|
61646
|
+
const columnCount = declared ?? widest;
|
|
61647
|
+
return {
|
|
61648
|
+
columnCount,
|
|
61649
|
+
rows: slots.map(
|
|
61650
|
+
(row) => Array.from({ length: columnCount }, (_, ci) => row[ci] ?? { cell: { text: "" } })
|
|
61651
|
+
)
|
|
61652
|
+
};
|
|
61653
|
+
}
|
|
61654
|
+
function columnFractions(columnWidths, columnCount) {
|
|
61655
|
+
if (!columnWidths) {
|
|
61656
|
+
return Array.from({ length: columnCount }, () => 1 / columnCount);
|
|
61657
|
+
}
|
|
61658
|
+
if (columnWidths.length !== columnCount) {
|
|
61659
|
+
throw new RangeError(
|
|
61660
|
+
`columnWidths gives ${columnWidths.length} widths for a table of ${columnCount} columns`
|
|
61661
|
+
);
|
|
61662
|
+
}
|
|
61663
|
+
if (columnWidths.some((w) => !Number.isFinite(w) || w < 0)) {
|
|
61664
|
+
throw new RangeError("columnWidths must be finite widths of 0 or more");
|
|
61665
|
+
}
|
|
61666
|
+
const sum = columnWidths.reduce((a, b) => a + b, 0);
|
|
61667
|
+
if (sum <= 0) {
|
|
61668
|
+
throw new RangeError("columnWidths must not all be 0");
|
|
61669
|
+
}
|
|
61670
|
+
return columnWidths.map((w) => w / sum);
|
|
61671
|
+
}
|
|
61672
|
+
var init_table_merge_input = __esm({
|
|
61673
|
+
"pptx/core/builders/sdk/table-merge-input.ts"() {
|
|
61674
|
+
}
|
|
61675
|
+
});
|
|
61676
|
+
|
|
61677
|
+
// pptx/core/builders/sdk/text-segment-style.ts
|
|
61678
|
+
function elementStyleForSegments(textStyle, segments) {
|
|
61679
|
+
const styled = segments.filter((segment) => !segment.isParagraphBreak);
|
|
61680
|
+
const first2 = styled[0]?.style;
|
|
61681
|
+
if (!first2) {
|
|
61682
|
+
return textStyle;
|
|
61683
|
+
}
|
|
61684
|
+
const next = { ...textStyle };
|
|
61685
|
+
for (const key2 of RUN_KEYS) {
|
|
61686
|
+
const value = first2[key2];
|
|
61687
|
+
if (!styled.every((segment) => sameValue(segment.style?.[key2], value))) {
|
|
61688
|
+
continue;
|
|
61689
|
+
}
|
|
61690
|
+
if (value === void 0) {
|
|
61691
|
+
delete next[key2];
|
|
61692
|
+
} else {
|
|
61693
|
+
next[key2] = value;
|
|
61694
|
+
}
|
|
61695
|
+
}
|
|
61696
|
+
return next;
|
|
61697
|
+
}
|
|
61698
|
+
function sameValue(a, b) {
|
|
61699
|
+
if (a === b) {
|
|
61700
|
+
return true;
|
|
61701
|
+
}
|
|
61702
|
+
if (a && b && typeof a === "object" && typeof b === "object") {
|
|
61703
|
+
return JSON.stringify(a) === JSON.stringify(b);
|
|
61704
|
+
}
|
|
61705
|
+
return false;
|
|
61706
|
+
}
|
|
61707
|
+
var RUN_KEYS;
|
|
61708
|
+
var init_text_segment_style = __esm({
|
|
61709
|
+
"pptx/core/builders/sdk/text-segment-style.ts"() {
|
|
61710
|
+
RUN_KEYS = [
|
|
61711
|
+
"fontFamily",
|
|
61712
|
+
"fontSize",
|
|
61713
|
+
"bold",
|
|
61714
|
+
"italic",
|
|
61715
|
+
"underline",
|
|
61716
|
+
"strikethrough",
|
|
61717
|
+
"color",
|
|
61718
|
+
"colorRef",
|
|
61719
|
+
"characterSpacing",
|
|
61720
|
+
"hyperlink",
|
|
61721
|
+
"hyperlinkAction",
|
|
61722
|
+
"hyperlinkTargetSlideIndex",
|
|
61723
|
+
"hyperlinkTooltip",
|
|
61724
|
+
"align"
|
|
61725
|
+
];
|
|
61726
|
+
}
|
|
61727
|
+
});
|
|
61728
|
+
|
|
61280
61729
|
// pptx/core/builders/sdk/ElementFactory.ts
|
|
61281
61730
|
function generateId(prefix) {
|
|
61282
61731
|
idCounter += 1;
|
|
@@ -61385,6 +61834,7 @@ function createTextElement(text2, options2) {
|
|
|
61385
61834
|
verticalAlignment: options2?.verticalAlignment,
|
|
61386
61835
|
lineSpacing: options2?.lineSpacing
|
|
61387
61836
|
};
|
|
61837
|
+
const textSegments = buildTextSegments(text2, textStyleBase);
|
|
61388
61838
|
return {
|
|
61389
61839
|
type: "text",
|
|
61390
61840
|
id: generateId("txt"),
|
|
@@ -61392,8 +61842,8 @@ function createTextElement(text2, options2) {
|
|
|
61392
61842
|
rotation: options2?.rotation,
|
|
61393
61843
|
opacity: options2?.opacity,
|
|
61394
61844
|
text: plainText,
|
|
61395
|
-
textStyle: mapTextStyleInput(textStyleBase),
|
|
61396
|
-
textSegments
|
|
61845
|
+
textStyle: elementStyleForSegments(mapTextStyleInput(textStyleBase), textSegments),
|
|
61846
|
+
textSegments,
|
|
61397
61847
|
shapeStyle: buildShapeStyle(effectInputs(options2, options2?.fill))
|
|
61398
61848
|
};
|
|
61399
61849
|
}
|
|
@@ -61473,32 +61923,30 @@ function createImageElement(source2, options2) {
|
|
|
61473
61923
|
cropBottom: options2?.cropBottom
|
|
61474
61924
|
};
|
|
61475
61925
|
}
|
|
61926
|
+
function createTableCell(cellInput) {
|
|
61927
|
+
return {
|
|
61928
|
+
text: cellInput.text,
|
|
61929
|
+
gridSpan: cellInput.gridSpan,
|
|
61930
|
+
rowSpan: cellInput.rowSpan,
|
|
61931
|
+
style: tableCellStyle(cellInput)
|
|
61932
|
+
};
|
|
61933
|
+
}
|
|
61476
61934
|
function createTableElement(input, options2) {
|
|
61477
|
-
const
|
|
61935
|
+
const grid = input.fillMergedCells ? placeTableCells(input) : void 0;
|
|
61936
|
+
const numCols = grid?.columnCount ?? Math.max(...input.rows.map((r) => r.cells.length), 1);
|
|
61478
61937
|
const rowHeight = input.rows.length > 0 ? Math.max(30, Math.floor(200 / input.rows.length)) : 30;
|
|
61479
61938
|
const totalHeight = options2?.height ?? Math.max(100, input.rows.length * rowHeight);
|
|
61480
61939
|
const p2 = pos("table", { ...options2, height: totalHeight });
|
|
61481
|
-
|
|
61482
|
-
|
|
61483
|
-
const sum = input.columnWidths.reduce((a, b) => a + b, 0);
|
|
61484
|
-
colWidths = input.columnWidths.map((w) => w / sum);
|
|
61485
|
-
} else {
|
|
61486
|
-
colWidths = Array(numCols).fill(1 / numCols);
|
|
61487
|
-
}
|
|
61488
|
-
const rows = input.rows.map((rowInput) => ({
|
|
61940
|
+
const colWidths = columnFractions(input.columnWidths, numCols);
|
|
61941
|
+
const rows = input.rows.map((rowInput, ri) => ({
|
|
61489
61942
|
height: rowInput.height ?? rowHeight,
|
|
61490
|
-
cells:
|
|
61491
|
-
|
|
61492
|
-
|
|
61493
|
-
|
|
61494
|
-
|
|
61495
|
-
|
|
61496
|
-
|
|
61497
|
-
italic: cellInput.style.italic,
|
|
61498
|
-
color: cellInput.style.color,
|
|
61499
|
-
align: cellInput.style.alignment
|
|
61500
|
-
} : void 0
|
|
61501
|
-
}))
|
|
61943
|
+
cells: grid ? (grid.rows[ri] ?? []).map(
|
|
61944
|
+
(slot2) => slot2.cell ? createTableCell(slot2.cell) : {
|
|
61945
|
+
text: "",
|
|
61946
|
+
...slot2.hMerge ? { hMerge: true } : {},
|
|
61947
|
+
...slot2.vMerge ? { vMerge: true } : {}
|
|
61948
|
+
}
|
|
61949
|
+
) : rowInput.cells.map(createTableCell)
|
|
61502
61950
|
}));
|
|
61503
61951
|
const tableData = {
|
|
61504
61952
|
rows,
|
|
@@ -61513,7 +61961,9 @@ function createTableElement(input, options2) {
|
|
|
61513
61961
|
// Accent 1 unless the caller picked a style. This is decided at
|
|
61514
61962
|
// creation time so the save pipeline never has to invent a style for
|
|
61515
61963
|
// loaded tables that legitimately have none.
|
|
61516
|
-
|
|
61964
|
+
// `style: 'none'` (or '') opts out, so the cells' own formatting is not
|
|
61965
|
+
// painted over by the theme banding.
|
|
61966
|
+
tableStyleId: input.style === "none" ? void 0 : input.style ?? DEFAULT_POWERPOINT_TABLE_STYLE_ID
|
|
61517
61967
|
};
|
|
61518
61968
|
return {
|
|
61519
61969
|
type: "table",
|
|
@@ -61631,6 +62081,9 @@ var init_ElementFactory = __esm({
|
|
|
61631
62081
|
init_custom_geometry();
|
|
61632
62082
|
init_chart_gradient_input();
|
|
61633
62083
|
init_chart_layout_operations();
|
|
62084
|
+
init_table_cell_input();
|
|
62085
|
+
init_table_merge_input();
|
|
62086
|
+
init_text_segment_style();
|
|
61634
62087
|
init_shape_style_input();
|
|
61635
62088
|
idCounter = 0;
|
|
61636
62089
|
DEFAULTS = {
|
|
@@ -61650,6 +62103,7 @@ var init_ElementFactory = __esm({
|
|
|
61650
62103
|
var SlideBuilder;
|
|
61651
62104
|
var init_SlideBuilder = __esm({
|
|
61652
62105
|
"pptx/core/builders/sdk/SlideBuilder.ts"() {
|
|
62106
|
+
init_background_gradient_input();
|
|
61653
62107
|
init_ElementFactory();
|
|
61654
62108
|
SlideBuilder = class {
|
|
61655
62109
|
/**
|
|
@@ -61760,12 +62214,12 @@ var init_SlideBuilder = __esm({
|
|
|
61760
62214
|
switch (bg.type) {
|
|
61761
62215
|
case "solid":
|
|
61762
62216
|
this.slide.backgroundColor = bg.color;
|
|
62217
|
+
delete this.slide.backgroundGradient;
|
|
62218
|
+
delete this.slide.backgroundGradientFill;
|
|
61763
62219
|
break;
|
|
61764
|
-
case "gradient":
|
|
61765
|
-
|
|
61766
|
-
this.slide.backgroundGradient = `linear-gradient(${bg.angle ?? 180}deg, ${stops})`;
|
|
62220
|
+
case "gradient":
|
|
62221
|
+
Object.assign(this.slide, mapBackgroundGradientInput(bg));
|
|
61767
62222
|
break;
|
|
61768
|
-
}
|
|
61769
62223
|
case "image":
|
|
61770
62224
|
this.slide.backgroundImage = bg.source;
|
|
61771
62225
|
break;
|
|
@@ -65668,7 +66122,15 @@ var init_PptxSlideBackgroundBuilder = __esm({
|
|
|
65668
66122
|
init.reportUnsupportedBackground?.(rawBackgroundImage);
|
|
65669
66123
|
}
|
|
65670
66124
|
}
|
|
65671
|
-
if (backgroundProperties["a:blipFill"] === void 0 &&
|
|
66125
|
+
if (backgroundProperties["a:blipFill"] === void 0 && hasBackgroundGradient) {
|
|
66126
|
+
const gradFill2 = init.buildBackgroundGradientFill?.();
|
|
66127
|
+
if (gradFill2) {
|
|
66128
|
+
backgroundProperties["a:gradFill"] = gradFill2;
|
|
66129
|
+
} else if (!hasBackgroundColor && !hasBackgroundImage) {
|
|
66130
|
+
init.reportUnsupportedGradient?.();
|
|
66131
|
+
}
|
|
66132
|
+
}
|
|
66133
|
+
if (backgroundProperties["a:blipFill"] === void 0 && backgroundProperties["a:gradFill"] === void 0 && hasBackgroundColor && init.slide.backgroundColor) {
|
|
65672
66134
|
backgroundProperties["a:solidFill"] = {
|
|
65673
66135
|
"a:srgbClr": {
|
|
65674
66136
|
"@_val": init.slide.backgroundColor.replace("#", "").toUpperCase()
|
|
@@ -68726,6 +69188,10 @@ function applyCellFillStyle(cellProperties, style, context, slidePath) {
|
|
|
68726
69188
|
}
|
|
68727
69189
|
return hasStyle;
|
|
68728
69190
|
}
|
|
69191
|
+
function presetDashValue(value) {
|
|
69192
|
+
const text2 = typeof value === "string" || typeof value === "number" ? String(value) : "";
|
|
69193
|
+
return text2 ? text2 : void 0;
|
|
69194
|
+
}
|
|
68729
69195
|
function applyCellBorderStyle(cellProperties, style, context) {
|
|
68730
69196
|
if (!cellProperties) {
|
|
68731
69197
|
return false;
|
|
@@ -68763,13 +69229,13 @@ function applyCellBorderStyle(cellProperties, style, context) {
|
|
|
68763
69229
|
style[`${prefix}Color`] = color3;
|
|
68764
69230
|
hasStyle = true;
|
|
68765
69231
|
}
|
|
68766
|
-
const
|
|
68767
|
-
if (
|
|
68768
|
-
|
|
68769
|
-
if (
|
|
68770
|
-
style[`${prefix}
|
|
68771
|
-
hasStyle = true;
|
|
69232
|
+
const dash = parseDrawingLineDash(node, presetDashValue);
|
|
69233
|
+
if (dash.strokeDash) {
|
|
69234
|
+
style[`${prefix}Dash`] = dash.strokeDash;
|
|
69235
|
+
if (dash.strokeDash === "custom") {
|
|
69236
|
+
style[`${prefix}DashSegments`] = dash.customDashSegments;
|
|
68772
69237
|
}
|
|
69238
|
+
hasStyle = true;
|
|
68773
69239
|
}
|
|
68774
69240
|
}
|
|
68775
69241
|
const firstBorderColor = style.borderTopColor || style.borderBottomColor || style.borderLeftColor || style.borderRightColor;
|
|
@@ -68861,6 +69327,7 @@ var init_table_cell_fill_border_helpers = __esm({
|
|
|
68861
69327
|
"pptx/core/core/builders/table-cell-fill-border-helpers.ts"() {
|
|
68862
69328
|
init_theme_color_ref();
|
|
68863
69329
|
init_color_xml_preservation();
|
|
69330
|
+
init_drawing_line_dash();
|
|
68864
69331
|
}
|
|
68865
69332
|
});
|
|
68866
69333
|
|
|
@@ -70556,8 +71023,8 @@ function decodeAinkInk(inkRoot) {
|
|
|
70556
71023
|
if (raw2.length === 0) {
|
|
70557
71024
|
return 2;
|
|
70558
71025
|
}
|
|
70559
|
-
const
|
|
70560
|
-
return Number.isFinite(
|
|
71026
|
+
const num5 = Number(raw2);
|
|
71027
|
+
return Number.isFinite(num5) && num5 > 0 ? num5 : 2;
|
|
70561
71028
|
})();
|
|
70562
71029
|
const traces = ensureArrayLike3(inkRoot["aink:trace"]);
|
|
70563
71030
|
for (const trace of traces) {
|
|
@@ -72718,9 +73185,9 @@ async function ensureCustomPropertiesPackagingArtifacts(context) {
|
|
|
72718
73185
|
let maxId = 0;
|
|
72719
73186
|
for (const rel of rels) {
|
|
72720
73187
|
const id = String(rel?.["@_Id"] || "");
|
|
72721
|
-
const
|
|
72722
|
-
if (Number.isFinite(
|
|
72723
|
-
maxId =
|
|
73188
|
+
const num5 = Number.parseInt(id.replace(/^rId/, ""), 10);
|
|
73189
|
+
if (Number.isFinite(num5) && num5 > maxId) {
|
|
73190
|
+
maxId = num5;
|
|
72724
73191
|
}
|
|
72725
73192
|
}
|
|
72726
73193
|
rels.push({
|
|
@@ -72805,11 +73272,11 @@ var init_PptxDocumentPropertiesUpdater = __esm({
|
|
|
72805
73272
|
this.context = context;
|
|
72806
73273
|
}
|
|
72807
73274
|
async updateOnSave(slides, options2) {
|
|
72808
|
-
await this.updateCoreProperties(options2?.coreProperties);
|
|
73275
|
+
await this.updateCoreProperties(options2?.coreProperties, options2?.fixedDate);
|
|
72809
73276
|
await this.updateAppProperties(slides, options2?.appProperties);
|
|
72810
73277
|
await this.updateCustomProperties(options2?.customProperties);
|
|
72811
73278
|
}
|
|
72812
|
-
async updateCoreProperties(overrides) {
|
|
73279
|
+
async updateCoreProperties(overrides, fixedDate) {
|
|
72813
73280
|
const coreFile = this.context.zip.file("docProps/core.xml");
|
|
72814
73281
|
if (!coreFile) {
|
|
72815
73282
|
return;
|
|
@@ -72818,7 +73285,12 @@ var init_PptxDocumentPropertiesUpdater = __esm({
|
|
|
72818
73285
|
const coreXml = await coreFile.async("string");
|
|
72819
73286
|
const core = applyCoreOverrides(parseCoreProperties(coreXml), overrides);
|
|
72820
73287
|
const revision = Number.parseInt(core.revision?.trim() ?? "", 10);
|
|
72821
|
-
const next = {
|
|
73288
|
+
const next = fixedDate ? {
|
|
73289
|
+
...core,
|
|
73290
|
+
revision: overrides?.revision ?? "1",
|
|
73291
|
+
created: overrides?.created ?? formatW3cdtf(fixedDate),
|
|
73292
|
+
modified: overrides?.modified ?? formatW3cdtf(fixedDate)
|
|
73293
|
+
} : {
|
|
72822
73294
|
...core,
|
|
72823
73295
|
revision: String(Number.isFinite(revision) && revision >= 0 ? revision + 1 : 1),
|
|
72824
73296
|
modified: formatW3cdtf(/* @__PURE__ */ new Date())
|
|
@@ -99592,14 +100064,14 @@ function valXml(local, value) {
|
|
|
99592
100064
|
const text2 = typeof value === "boolean" ? value ? "1" : "0" : typeof value === "number" ? chartNumber(value) : escapeAttribute(value);
|
|
99593
100065
|
return `<c:${local} val="${text2}"/>`;
|
|
99594
100066
|
}
|
|
99595
|
-
function
|
|
100067
|
+
function sameValue2(left, right) {
|
|
99596
100068
|
if (left === right) return true;
|
|
99597
100069
|
if (typeof left !== "object" || typeof right !== "object" || !left || !right) return false;
|
|
99598
100070
|
if (Array.isArray(left) !== Array.isArray(right)) return false;
|
|
99599
100071
|
const entries = (value) => Object.entries(value).filter(([, item2]) => item2 !== void 0);
|
|
99600
100072
|
const a = entries(left);
|
|
99601
100073
|
const b = new Map(entries(right));
|
|
99602
|
-
return a.length === b.size && a.every(([key2, item2]) => b.has(key2) &&
|
|
100074
|
+
return a.length === b.size && a.every(([key2, item2]) => b.has(key2) && sameValue2(item2, b.get(key2)));
|
|
99603
100075
|
}
|
|
99604
100076
|
var INVALID_XML, escapeText2, escapeAttribute, elementXml, raw;
|
|
99605
100077
|
var init_write_util = __esm({
|
|
@@ -100345,13 +100817,13 @@ function chartFillXml(fill3) {
|
|
|
100345
100817
|
}
|
|
100346
100818
|
function patchShape(root, shape2, read) {
|
|
100347
100819
|
const doc = root.ownerDocument;
|
|
100348
|
-
if (!
|
|
100820
|
+
if (!sameValue2(read.fill, shape2.fill)) {
|
|
100349
100821
|
const xml = shape2.fill && chartFillXml(shape2.fill);
|
|
100350
100822
|
if (xml) setDrawingFillXml(root, xml);
|
|
100351
100823
|
else if (!shape2.fill)
|
|
100352
100824
|
for (let fill3 = fillElementOf(root); fill3; fill3 = fillElementOf(root)) root.removeChild(fill3);
|
|
100353
100825
|
}
|
|
100354
|
-
if (!
|
|
100826
|
+
if (!sameValue2(read.line, shape2.line)) {
|
|
100355
100827
|
let ln = first(root, "ln", NS.a);
|
|
100356
100828
|
if (!shape2.line) {
|
|
100357
100829
|
if (ln) root.removeChild(ln);
|
|
@@ -100383,7 +100855,7 @@ function shapePropertiesInnerXml(context, shape2) {
|
|
|
100383
100855
|
if (sourceXml !== void 0) {
|
|
100384
100856
|
const root = wrap("spPr", sourceXml);
|
|
100385
100857
|
const read = readShapeFields(root);
|
|
100386
|
-
if (
|
|
100858
|
+
if (sameValue2(read, fields)) inner = sourceXml;
|
|
100387
100859
|
else {
|
|
100388
100860
|
patchShape(root, fields, read);
|
|
100389
100861
|
inner = innerXml(root);
|
|
@@ -100398,14 +100870,14 @@ function textBodyInnerXml(context, body) {
|
|
|
100398
100870
|
const { sourceXml, ...fields } = body;
|
|
100399
100871
|
if (sourceXml !== void 0) {
|
|
100400
100872
|
const read = parseDrawingTextBody(wrap("txPr", sourceXml));
|
|
100401
|
-
if (
|
|
100873
|
+
if (sameValue2(read, fields)) return raw(context, sourceXml);
|
|
100402
100874
|
}
|
|
100403
100875
|
return raw(context, writeTextBody(fields));
|
|
100404
100876
|
}
|
|
100405
100877
|
function layoutXml(context, value) {
|
|
100406
100878
|
if (!value) return "";
|
|
100407
100879
|
const { sourceXml, ...layout } = value;
|
|
100408
|
-
if (sourceXml !== void 0 &&
|
|
100880
|
+
if (sourceXml !== void 0 && sameValue2(readLayoutFields(wrap("layout", sourceXml)), layout))
|
|
100409
100881
|
return elementXml("layout", raw(context, sourceXml));
|
|
100410
100882
|
const manual = LAYOUT_FIELDS.map(([local, key2]) => {
|
|
100411
100883
|
const value2 = layout[key2];
|
|
@@ -103626,7 +104098,16 @@ function repaintSeriesForFamily(series, toLine) {
|
|
|
103626
104098
|
shape2.fill = structuredClone(shape2.line.fill);
|
|
103627
104099
|
}
|
|
103628
104100
|
function clearPointPaint(series, key2) {
|
|
103629
|
-
|
|
104101
|
+
const emptied2 = (part) => Object.keys(part).every((name) => name === "sourceXml");
|
|
104102
|
+
for (const point2 of series.dataPoints) {
|
|
104103
|
+
if (!point2.spPr) continue;
|
|
104104
|
+
delete point2.spPr[key2];
|
|
104105
|
+
if (point2.spPr.line && emptied2(point2.spPr.line)) delete point2.spPr.line;
|
|
104106
|
+
if (emptied2(point2.spPr)) delete point2.spPr;
|
|
104107
|
+
}
|
|
104108
|
+
series.dataPoints = series.dataPoints.filter(
|
|
104109
|
+
(point2) => Object.keys(point2).some((name) => name !== "index")
|
|
104110
|
+
);
|
|
103630
104111
|
}
|
|
103631
104112
|
function setChartSeriesFill(space, index, fill3) {
|
|
103632
104113
|
return editChartSpace(space, (draft) => {
|
|
@@ -103635,7 +104116,7 @@ function setChartSeriesFill(space, index, fill3) {
|
|
|
103635
104116
|
clearPointPaint(series, "fill");
|
|
103636
104117
|
});
|
|
103637
104118
|
}
|
|
103638
|
-
function setChartSeriesColor(space, index, color3) {
|
|
104119
|
+
function setChartSeriesColor(space, index, color3, options2 = {}) {
|
|
103639
104120
|
return editChartSpace(space, (draft) => {
|
|
103640
104121
|
const { series } = chartSeriesEntryAt(draft, index);
|
|
103641
104122
|
const shape2 = series.spPr ??= {};
|
|
@@ -103645,7 +104126,7 @@ function setChartSeriesColor(space, index, color3) {
|
|
|
103645
104126
|
const fill3 = color3 ? { kind: "solid", color: withAlphaOf(color3, previous) } : void 0;
|
|
103646
104127
|
if (line2) assignOrDelete(shape2.line ??= {}, "fill", fill3);
|
|
103647
104128
|
else assignOrDelete(shape2, "fill", fill3);
|
|
103648
|
-
clearPointPaint(series, line2 ? "line" : "fill");
|
|
104129
|
+
if (!options2.keepPointColors) clearPointPaint(series, line2 ? "line" : "fill");
|
|
103649
104130
|
});
|
|
103650
104131
|
}
|
|
103651
104132
|
var paintsLine, painted;
|
|
@@ -105058,7 +105539,7 @@ var init_type_axes = __esm({
|
|
|
105058
105539
|
});
|
|
105059
105540
|
|
|
105060
105541
|
// chart/edit/type.ts
|
|
105061
|
-
function
|
|
105542
|
+
function chartGroupElement(kind, is3D) {
|
|
105062
105543
|
const match = Object.entries(CHART_GROUP_ELEMENTS).find(
|
|
105063
105544
|
([, value]) => value.kind === kind && value.is3D === is3D
|
|
105064
105545
|
);
|
|
@@ -105073,7 +105554,7 @@ function groupingFor(element2, grouping) {
|
|
|
105073
105554
|
}
|
|
105074
105555
|
function newGroup(base, target, series) {
|
|
105075
105556
|
const is3D = target.is3D ?? (base.is3D && SWITCHABLE[target.kind] === true);
|
|
105076
|
-
const element2 =
|
|
105557
|
+
const element2 = chartGroupElement(target.kind, is3D);
|
|
105077
105558
|
const group = { kind: target.kind, element: element2, is3D, series, axisIds: [] };
|
|
105078
105559
|
const allowed = GROUP_FIELDS[element2] ?? [];
|
|
105079
105560
|
for (const key2 of allowed)
|
|
@@ -105282,6 +105763,11 @@ var init_target = __esm({
|
|
|
105282
105763
|
});
|
|
105283
105764
|
|
|
105284
105765
|
// chart/edit/group-options.ts
|
|
105766
|
+
function assertChartGroupOption(key2, value) {
|
|
105767
|
+
const [min, max] = RANGES[key2];
|
|
105768
|
+
if (!Number.isInteger(value) || value < min || value > max)
|
|
105769
|
+
throw new RangeError(`Chart ${key2} must be a whole number from ${min} to ${max}`);
|
|
105770
|
+
}
|
|
105285
105771
|
function setChartGroupOptions2(space, seriesIndex, edit) {
|
|
105286
105772
|
return editChartSpace(space, (draft) => {
|
|
105287
105773
|
const { group } = chartSeriesEntryAt(draft, seriesIndex);
|
|
@@ -105294,9 +105780,7 @@ function setChartGroupOptions2(space, seriesIndex, edit) {
|
|
|
105294
105780
|
delete group[key2];
|
|
105295
105781
|
continue;
|
|
105296
105782
|
}
|
|
105297
|
-
|
|
105298
|
-
if (!Number.isInteger(value) || value < min || value > max)
|
|
105299
|
-
throw new RangeError(`Chart ${key2} must be a whole number from ${min} to ${max}`);
|
|
105783
|
+
assertChartGroupOption(key2, value);
|
|
105300
105784
|
group[key2] = value;
|
|
105301
105785
|
}
|
|
105302
105786
|
});
|
|
@@ -106865,44 +107349,6 @@ var init_chart2 = __esm({
|
|
|
106865
107349
|
}
|
|
106866
107350
|
});
|
|
106867
107351
|
|
|
106868
|
-
// pptx/core/utils/chart-container-type-map.ts
|
|
106869
|
-
function chartContainerLocalNameToType(localName28) {
|
|
106870
|
-
return CONTAINER_LOCAL_NAME_TO_TYPE[localName28];
|
|
106871
|
-
}
|
|
106872
|
-
function isLineDrawnChartType(type) {
|
|
106873
|
-
return type !== void 0 && LINE_DRAWN_CHART_TYPES.has(type);
|
|
106874
|
-
}
|
|
106875
|
-
var CONTAINER_LOCAL_NAME_TO_TYPE, LINE_DRAWN_CHART_TYPES;
|
|
106876
|
-
var init_chart_container_type_map = __esm({
|
|
106877
|
-
"pptx/core/utils/chart-container-type-map.ts"() {
|
|
106878
|
-
CONTAINER_LOCAL_NAME_TO_TYPE = {
|
|
106879
|
-
barChart: "bar",
|
|
106880
|
-
bar3DChart: "bar3D",
|
|
106881
|
-
lineChart: "line",
|
|
106882
|
-
line3DChart: "line3D",
|
|
106883
|
-
pieChart: "pie",
|
|
106884
|
-
pie3DChart: "pie3D",
|
|
106885
|
-
ofPieChart: "ofPie",
|
|
106886
|
-
doughnutChart: "doughnut",
|
|
106887
|
-
areaChart: "area",
|
|
106888
|
-
area3DChart: "area3D",
|
|
106889
|
-
scatterChart: "scatter",
|
|
106890
|
-
bubbleChart: "bubble",
|
|
106891
|
-
radarChart: "radar",
|
|
106892
|
-
stockChart: "stock",
|
|
106893
|
-
surfaceChart: "surface",
|
|
106894
|
-
surface3DChart: "surface"
|
|
106895
|
-
};
|
|
106896
|
-
LINE_DRAWN_CHART_TYPES = /* @__PURE__ */ new Set([
|
|
106897
|
-
"line",
|
|
106898
|
-
"line3D",
|
|
106899
|
-
"scatter",
|
|
106900
|
-
"radar",
|
|
106901
|
-
"stock"
|
|
106902
|
-
]);
|
|
106903
|
-
}
|
|
106904
|
-
});
|
|
106905
|
-
|
|
106906
107352
|
// pptx/core/utils/chart-from-neutral-labels.ts
|
|
106907
107353
|
function setOrRemove(target, key2, value) {
|
|
106908
107354
|
if (value === void 0) delete target[key2];
|
|
@@ -107043,8 +107489,8 @@ function titleText(title) {
|
|
|
107043
107489
|
}
|
|
107044
107490
|
function scalingFromNeutral(axis, out) {
|
|
107045
107491
|
const { scaling } = axis;
|
|
107046
|
-
setOrRemove(out, "min",
|
|
107047
|
-
setOrRemove(out, "max",
|
|
107492
|
+
setOrRemove(out, "min", finite4(scaling.min));
|
|
107493
|
+
setOrRemove(out, "max", finite4(scaling.max));
|
|
107048
107494
|
const logBase = scaling.logBase !== void 0 && scaling.logBase > 0 ? scaling.logBase : void 0;
|
|
107049
107495
|
setOrRemove(out, "logBase", logBase);
|
|
107050
107496
|
setOrRemove(out, "logScale", logBase !== void 0 ? true : void 0);
|
|
@@ -107056,7 +107502,7 @@ function labelsFromNeutral(axis, out) {
|
|
|
107056
107502
|
setOrRemove(out, "minorTickMark", oneOf(TICK_MARKS2, axis.minorTickMark));
|
|
107057
107503
|
setOrRemove(out, "tickLblPos", oneOf(["high", "low", "nextTo", "none"], axis.tickLabelPosition));
|
|
107058
107504
|
setOrRemove(out, "crosses", oneOf(["autoZero", "min", "max"], axis.crosses));
|
|
107059
|
-
setOrRemove(out, "crossesAt",
|
|
107505
|
+
setOrRemove(out, "crossesAt", finite4(axis.crossesAt));
|
|
107060
107506
|
const valueAxis = type === "valAx";
|
|
107061
107507
|
const categoryOrDate = type === "catAx" || type === "dateAx";
|
|
107062
107508
|
const skips = type === "catAx" || type === "serAx";
|
|
@@ -107110,8 +107556,8 @@ function axisFromNeutral(axis, out) {
|
|
|
107110
107556
|
setOrRemove(out, "displayUnits", custom ? "custom" : builtIn);
|
|
107111
107557
|
setOrRemove(out, "displayUnitsValue", custom || void 0);
|
|
107112
107558
|
}
|
|
107113
|
-
setOrRemove(out, "majorUnit",
|
|
107114
|
-
setOrRemove(out, "minorUnit",
|
|
107559
|
+
setOrRemove(out, "majorUnit", finite4(axis.majorUnit));
|
|
107560
|
+
setOrRemove(out, "minorUnit", finite4(axis.minorUnit));
|
|
107115
107561
|
setOrRemove(
|
|
107116
107562
|
out,
|
|
107117
107563
|
"baseTimeUnit",
|
|
@@ -107132,12 +107578,12 @@ function axesFromNeutral(axes, styled) {
|
|
|
107132
107578
|
);
|
|
107133
107579
|
});
|
|
107134
107580
|
}
|
|
107135
|
-
var oneOf,
|
|
107581
|
+
var oneOf, finite4, positiveInteger, TICK_MARKS2, TIME_UNITS2, BUILT_IN_UNITS2;
|
|
107136
107582
|
var init_chart_from_neutral_axes = __esm({
|
|
107137
107583
|
"pptx/core/utils/chart-from-neutral-axes.ts"() {
|
|
107138
107584
|
init_chart_from_neutral_labels();
|
|
107139
107585
|
oneOf = (values, value) => value !== void 0 && values.includes(value) ? value : void 0;
|
|
107140
|
-
|
|
107586
|
+
finite4 = (value) => value !== void 0 && Number.isFinite(value) ? value : void 0;
|
|
107141
107587
|
positiveInteger = (value) => value !== void 0 && Number.isInteger(value) && value > 0 ? value : void 0;
|
|
107142
107588
|
TICK_MARKS2 = ["cross", "in", "none", "out"];
|
|
107143
107589
|
TIME_UNITS2 = ["days", "months", "years"];
|
|
@@ -114230,16 +114676,16 @@ function tableToShapeGroup(tableData, bounds) {
|
|
|
114230
114676
|
const y = bounds.y + rowIndex * rowHeightEmu;
|
|
114231
114677
|
let colIndex = 0;
|
|
114232
114678
|
for (const cell2 of row.cells) {
|
|
114233
|
-
const
|
|
114679
|
+
const span2 = Math.max(1, cell2.gridSpan ?? 1);
|
|
114234
114680
|
if (cell2.vMerge) {
|
|
114235
114681
|
vMergeActive[colIndex] = true;
|
|
114236
|
-
colIndex +=
|
|
114682
|
+
colIndex += span2;
|
|
114237
114683
|
continue;
|
|
114238
114684
|
}
|
|
114239
114685
|
vMergeActive[colIndex] = false;
|
|
114240
114686
|
if (!cell2.hMerge) {
|
|
114241
114687
|
const x = colStartX[colIndex] ?? bounds.x;
|
|
114242
|
-
const w = colEmuWidths.slice(colIndex, colIndex +
|
|
114688
|
+
const w = colEmuWidths.slice(colIndex, colIndex + span2).reduce((s, v) => s + v, 0);
|
|
114243
114689
|
children16.push({
|
|
114244
114690
|
kind: "shape",
|
|
114245
114691
|
spt: 1,
|
|
@@ -114253,7 +114699,7 @@ function tableToShapeGroup(tableData, bounds) {
|
|
|
114253
114699
|
text: { textType: 4, paragraphs: cellParagraphs(cell2.text) }
|
|
114254
114700
|
});
|
|
114255
114701
|
}
|
|
114256
|
-
colIndex +=
|
|
114702
|
+
colIndex += span2;
|
|
114257
114703
|
}
|
|
114258
114704
|
});
|
|
114259
114705
|
return { kind: "group", anchor: bounds, children: children16 };
|
|
@@ -117872,7 +118318,7 @@ async function readSlideMasterPaths(zip) {
|
|
|
117872
118318
|
}
|
|
117873
118319
|
return paths;
|
|
117874
118320
|
}
|
|
117875
|
-
function
|
|
118321
|
+
function num4(xml, pattern) {
|
|
117876
118322
|
const value = pattern.exec(xml)?.[1];
|
|
117877
118323
|
return value === void 0 ? void 0 : Number(value);
|
|
117878
118324
|
}
|
|
@@ -117884,14 +118330,14 @@ function readPlaceholders(masterXml) {
|
|
|
117884
118330
|
continue;
|
|
117885
118331
|
}
|
|
117886
118332
|
const kind = PLACEHOLDER_KINDS[/\btype="([^"]+)"/u.exec(phType)?.[1] ?? "body"];
|
|
117887
|
-
const x =
|
|
117888
|
-
const y =
|
|
117889
|
-
const w =
|
|
117890
|
-
const h2 =
|
|
118333
|
+
const x = num4(sp, /<a:off\b[^>]*\bx="(-?\d+)"/u);
|
|
118334
|
+
const y = num4(sp, /<a:off\b[^>]*\by="(-?\d+)"/u);
|
|
118335
|
+
const w = num4(sp, /<a:ext\b[^>]*\bcx="(\d+)"/u);
|
|
118336
|
+
const h2 = num4(sp, /<a:ext\b[^>]*\bcy="(\d+)"/u);
|
|
117891
118337
|
if (!kind || x === void 0 || y === void 0 || !w || !h2 || out.some((p2) => p2.kind === kind)) {
|
|
117892
118338
|
continue;
|
|
117893
118339
|
}
|
|
117894
|
-
const size =
|
|
118340
|
+
const size = num4(sp, /<a:lvl1pPr\b[\s\S]*?<a:defRPr\b[^>]*\bsz="(\d+)"/u);
|
|
117895
118341
|
out.push({ kind, rect: { x, y, w, h: h2 }, ...size ? { sizePt: size / 100 } : {} });
|
|
117896
118342
|
}
|
|
117897
118343
|
return out;
|
|
@@ -124634,6 +125080,10 @@ var init_chart_neutral_save_chrome = __esm({
|
|
|
124634
125080
|
});
|
|
124635
125081
|
|
|
124636
125082
|
// pptx/core/utils/chart-neutral-save-points.ts
|
|
125083
|
+
function pointShape(shape2) {
|
|
125084
|
+
if (shape2.line && emptied(shape2.line)) delete shape2.line;
|
|
125085
|
+
return emptied(shape2) ? null : shape2;
|
|
125086
|
+
}
|
|
124637
125087
|
function pointEdit(edits, seriesIndex, old, next) {
|
|
124638
125088
|
for (const key2 of ["picture", "impliedPicture", "uniqueId"])
|
|
124639
125089
|
if (!same6(old?.[key2], next[key2])) return false;
|
|
@@ -124656,6 +125106,7 @@ function pointEdit(edits, seriesIndex, old, next) {
|
|
|
124656
125106
|
) ?? null
|
|
124657
125107
|
});
|
|
124658
125108
|
}
|
|
125109
|
+
if (edit.spPr) edit.spPr = pointShape(edit.spPr);
|
|
124659
125110
|
if (!same6(old?.marker, next.marker)) {
|
|
124660
125111
|
if (!next.marker) edit.marker = null;
|
|
124661
125112
|
else {
|
|
@@ -124698,6 +125149,7 @@ function planNeutralChartPoints(before, probe, edits) {
|
|
|
124698
125149
|
series.dataPoints = previous.dataPoints;
|
|
124699
125150
|
});
|
|
124700
125151
|
}
|
|
125152
|
+
var emptied;
|
|
124701
125153
|
var init_chart_neutral_save_points = __esm({
|
|
124702
125154
|
"pptx/core/utils/chart-neutral-save-points.ts"() {
|
|
124703
125155
|
init_chart2();
|
|
@@ -124705,6 +125157,7 @@ var init_chart_neutral_save_points = __esm({
|
|
|
124705
125157
|
init_chart_neutral_save_common();
|
|
124706
125158
|
init_chart_neutral_save_shape();
|
|
124707
125159
|
init_chart_container_type_map();
|
|
125160
|
+
emptied = (part) => Object.keys(part).every((key2) => key2 === "sourceXml");
|
|
124708
125161
|
}
|
|
124709
125162
|
});
|
|
124710
125163
|
|
|
@@ -124920,7 +125373,9 @@ function planNeutralChartSeriesColors(before, probe, edits) {
|
|
|
124920
125373
|
const value = series.color?.replace(/^#/, "");
|
|
124921
125374
|
if (value !== void 0 && !/^[\da-f]{6}$/i.test(value)) return;
|
|
124922
125375
|
edits.push(
|
|
124923
|
-
(space) => setChartSeriesColor(space, index, value ? { kind: "srgb", value, transforms: [] } : null
|
|
125376
|
+
(space) => setChartSeriesColor(space, index, value ? { kind: "srgb", value, transforms: [] } : null, {
|
|
125377
|
+
keepPointColors: true
|
|
125378
|
+
})
|
|
124924
125379
|
);
|
|
124925
125380
|
if (previous.color === void 0) delete series.color;
|
|
124926
125381
|
else series.color = previous.color;
|
|
@@ -126372,26 +126827,26 @@ function buildImgEffects(effects2) {
|
|
|
126372
126827
|
if (effects2.backgroundRemoval) {
|
|
126373
126828
|
out.push({ "a14:backgroundRemoval": buildBackgroundRemovalNode(effects2.backgroundRemoval) });
|
|
126374
126829
|
}
|
|
126375
|
-
if (
|
|
126830
|
+
if (finite5(effects2.sharpenSoften?.amount)) {
|
|
126376
126831
|
out.push({ "a14:sharpenSoften": { "@_amount": round4(effects2.sharpenSoften.amount) } });
|
|
126377
126832
|
}
|
|
126378
126833
|
const bc = effects2.brightnessContrast;
|
|
126379
|
-
if (bc && (
|
|
126834
|
+
if (bc && (finite5(bc.bright) || finite5(bc.contrast))) {
|
|
126380
126835
|
const node = {};
|
|
126381
|
-
if (
|
|
126836
|
+
if (finite5(bc.bright)) {
|
|
126382
126837
|
node["@_bright"] = round4(bc.bright);
|
|
126383
126838
|
}
|
|
126384
|
-
if (
|
|
126839
|
+
if (finite5(bc.contrast)) {
|
|
126385
126840
|
node["@_contrast"] = round4(bc.contrast);
|
|
126386
126841
|
}
|
|
126387
126842
|
out.push({ "a14:brightnessContrast": node });
|
|
126388
126843
|
}
|
|
126389
|
-
if (
|
|
126844
|
+
if (finite5(effects2.colorTemperature?.colorTemp)) {
|
|
126390
126845
|
out.push({
|
|
126391
126846
|
"a14:colorTemperature": { "@_colorTemp": round4(effects2.colorTemperature.colorTemp) }
|
|
126392
126847
|
});
|
|
126393
126848
|
}
|
|
126394
|
-
if (
|
|
126849
|
+
if (finite5(effects2.colorSaturation?.sat)) {
|
|
126395
126850
|
out.push({ "a14:saturation": { "@_sat": round4(effects2.colorSaturation.sat) } });
|
|
126396
126851
|
}
|
|
126397
126852
|
const artistic = a14ArtisticElementName(effects2.artisticEffect);
|
|
@@ -126441,7 +126896,7 @@ function applyA14ImageExtension(blip, effects2) {
|
|
|
126441
126896
|
extLst[extKey] = entries.length === 1 ? entries[0] : entries;
|
|
126442
126897
|
blip[extLstKey] = extLst;
|
|
126443
126898
|
}
|
|
126444
|
-
var GALLERY_TO_A14, round4,
|
|
126899
|
+
var GALLERY_TO_A14, round4, finite5;
|
|
126445
126900
|
var init_image_a14_effects_writer = __esm({
|
|
126446
126901
|
"pptx/core/core/runtime/image-a14-effects-writer.ts"() {
|
|
126447
126902
|
init_image_a14_effects();
|
|
@@ -126474,7 +126929,7 @@ var init_image_a14_effects_writer = __esm({
|
|
|
126474
126929
|
watercolorSponge: "artisticWatercolorSponge"
|
|
126475
126930
|
};
|
|
126476
126931
|
round4 = (value) => String(Math.round(value));
|
|
126477
|
-
|
|
126932
|
+
finite5 = (value) => typeof value === "number" && Number.isFinite(value);
|
|
126478
126933
|
}
|
|
126479
126934
|
});
|
|
126480
126935
|
|
|
@@ -132133,6 +132588,17 @@ var init_save_group_fill = __esm({
|
|
|
132133
132588
|
});
|
|
132134
132589
|
|
|
132135
132590
|
// pptx/core/core/runtime/save-shape-xml-frames.ts
|
|
132591
|
+
function tableGridXml(el, widthEmu) {
|
|
132592
|
+
const fractions = el.tableData?.columnWidths ?? [];
|
|
132593
|
+
if (fractions.length === 0 || !(widthEmu > 0)) {
|
|
132594
|
+
return {};
|
|
132595
|
+
}
|
|
132596
|
+
const widths = fractions.map((fraction) => Math.max(0, Math.round(fraction * widthEmu)));
|
|
132597
|
+
const last = widths.length - 1;
|
|
132598
|
+
widths[last] = Math.max(0, (widths[last] ?? 0) + widthEmu - widths.reduce((a, b) => a + b, 0));
|
|
132599
|
+
const cols = widths.map((w) => ({ "@_w": String(w) }));
|
|
132600
|
+
return { "a:gridCol": cols.length === 1 ? cols[0] : cols };
|
|
132601
|
+
}
|
|
132136
132602
|
function buildTableGraphicFrameXml(el, emuPerPx) {
|
|
132137
132603
|
el.locks = { noGrouping: true, ...el.locks };
|
|
132138
132604
|
const offX = String(Math.round(el.x * emuPerPx));
|
|
@@ -132163,7 +132629,7 @@ function buildTableGraphicFrameXml(el, emuPerPx) {
|
|
|
132163
132629
|
"@_uri": "http://schemas.openxmlformats.org/drawingml/2006/table",
|
|
132164
132630
|
"a:tbl": {
|
|
132165
132631
|
"a:tblPr": tblPr,
|
|
132166
|
-
"a:tblGrid":
|
|
132632
|
+
"a:tblGrid": tableGridXml(el, Number(extCx))
|
|
132167
132633
|
}
|
|
132168
132634
|
}
|
|
132169
132635
|
}
|
|
@@ -132540,11 +133006,31 @@ var init_PptxHandlerRuntimeSaveShapeXml = __esm({
|
|
|
132540
133006
|
* default) is correct at depth 0. See `group-xfrm-preservation.ts`'s
|
|
132541
133007
|
* module doc for why a nested group must not re-derive this itself.
|
|
132542
133008
|
*/
|
|
133009
|
+
/**
|
|
133010
|
+
* `PptxHandlerSaveOptions.fixedDate` of the save in progress: set, the save
|
|
133011
|
+
* mints reproducible ids and names (new table columns' `a16:colId`, the
|
|
133012
|
+
* fallback name of a new group) instead of random or time-based ones.
|
|
133013
|
+
*/
|
|
133014
|
+
saveFixedDate;
|
|
133015
|
+
/**
|
|
133016
|
+
* The `p:cNvPr/@name` of a group with neither a name nor one from its
|
|
133017
|
+
* file: its element id, or for a reproducible save (`fixedDate`), which
|
|
133018
|
+
* must not depend on the time-based ids of elements made in code,
|
|
133019
|
+
* `Group <shape id>` as PowerPoint names groups.
|
|
133020
|
+
*/
|
|
133021
|
+
groupFallbackName(group) {
|
|
133022
|
+
return this.saveFixedDate ? `Group ${group.shapeId ?? ""}`.trim() : group.id;
|
|
133023
|
+
}
|
|
132543
133024
|
buildGroupShapeXml(group, ctx, ownEmuOverride) {
|
|
132544
133025
|
if (group.rawXml && group.children.length === 0) {
|
|
132545
133026
|
return {
|
|
132546
133027
|
...group.rawXml,
|
|
132547
|
-
"p:nvGrpSpPr": buildGroupNonVisualXml(
|
|
133028
|
+
"p:nvGrpSpPr": buildGroupNonVisualXml(
|
|
133029
|
+
group.rawXml,
|
|
133030
|
+
group.name,
|
|
133031
|
+
this.groupFallbackName(group),
|
|
133032
|
+
group.shapeId
|
|
133033
|
+
)
|
|
132548
133034
|
};
|
|
132549
133035
|
}
|
|
132550
133036
|
const EMU = _PptxHandlerRuntime.EMU_PER_PX;
|
|
@@ -132553,7 +133039,12 @@ var init_PptxHandlerRuntimeSaveShapeXml = __esm({
|
|
|
132553
133039
|
const xfrm = buildGroupTransformXml(group, EMU, ownEmuOverride, rewrap);
|
|
132554
133040
|
const childSpace = group;
|
|
132555
133041
|
const grpXml2 = {
|
|
132556
|
-
"p:nvGrpSpPr": buildGroupNonVisualXml(
|
|
133042
|
+
"p:nvGrpSpPr": buildGroupNonVisualXml(
|
|
133043
|
+
rawGroupXml,
|
|
133044
|
+
group.name,
|
|
133045
|
+
this.groupFallbackName(group),
|
|
133046
|
+
group.shapeId
|
|
133047
|
+
),
|
|
132557
133048
|
"p:grpSpPr": buildGroupPropertiesXml(rawGroupXml, xfrm)
|
|
132558
133049
|
};
|
|
132559
133050
|
const rawExtLst = rawGroupXml?.["p:extLst"];
|
|
@@ -134386,12 +134877,92 @@ var init_PptxHandlerRuntimeLayoutSwitching = __esm({
|
|
|
134386
134877
|
}
|
|
134387
134878
|
});
|
|
134388
134879
|
|
|
134880
|
+
// pptx/core/core/runtime/table-cell-border-save.ts
|
|
134881
|
+
function cellEdges(style) {
|
|
134882
|
+
return [
|
|
134883
|
+
{
|
|
134884
|
+
xmlKey: "a:lnT",
|
|
134885
|
+
width: style.borderTopWidth,
|
|
134886
|
+
color: style.borderTopColor,
|
|
134887
|
+
dash: style.borderTopDash,
|
|
134888
|
+
segments: style.borderTopDashSegments
|
|
134889
|
+
},
|
|
134890
|
+
{
|
|
134891
|
+
xmlKey: "a:lnB",
|
|
134892
|
+
width: style.borderBottomWidth,
|
|
134893
|
+
color: style.borderBottomColor,
|
|
134894
|
+
dash: style.borderBottomDash,
|
|
134895
|
+
segments: style.borderBottomDashSegments
|
|
134896
|
+
},
|
|
134897
|
+
{
|
|
134898
|
+
xmlKey: "a:lnL",
|
|
134899
|
+
width: style.borderLeftWidth,
|
|
134900
|
+
color: style.borderLeftColor,
|
|
134901
|
+
dash: style.borderLeftDash,
|
|
134902
|
+
segments: style.borderLeftDashSegments
|
|
134903
|
+
},
|
|
134904
|
+
{
|
|
134905
|
+
xmlKey: "a:lnR",
|
|
134906
|
+
width: style.borderRightWidth,
|
|
134907
|
+
color: style.borderRightColor,
|
|
134908
|
+
dash: style.borderRightDash,
|
|
134909
|
+
segments: style.borderRightDashSegments
|
|
134910
|
+
}
|
|
134911
|
+
];
|
|
134912
|
+
}
|
|
134913
|
+
function writeEdgeDash(ln, edge) {
|
|
134914
|
+
if (edge.dash === void 0 || edge.dash === "") {
|
|
134915
|
+
return;
|
|
134916
|
+
}
|
|
134917
|
+
if (edge.dash === "solid") {
|
|
134918
|
+
delete ln["a:prstDash"];
|
|
134919
|
+
delete ln["a:custDash"];
|
|
134920
|
+
return;
|
|
134921
|
+
}
|
|
134922
|
+
if (edge.dash === "custom") {
|
|
134923
|
+
if (edge.segments && edge.segments.length > 0) {
|
|
134924
|
+
applyDrawingLineDash(ln, { strokeDash: "custom", customDashSegments: edge.segments });
|
|
134925
|
+
}
|
|
134926
|
+
return;
|
|
134927
|
+
}
|
|
134928
|
+
applyDrawingLineDash(ln, { strokeDash: edge.dash });
|
|
134929
|
+
}
|
|
134930
|
+
function writeCellEdgeBorders(tcPr, style, emuPerPx) {
|
|
134931
|
+
for (const edge of cellEdges(style)) {
|
|
134932
|
+
if (edge.width === void 0 && edge.color === void 0 && edge.dash === void 0) {
|
|
134933
|
+
continue;
|
|
134934
|
+
}
|
|
134935
|
+
const existing = tcPr[edge.xmlKey];
|
|
134936
|
+
const ln = existing && typeof existing === "object" ? existing : {};
|
|
134937
|
+
if (edge.width !== void 0) {
|
|
134938
|
+
ln["@_w"] = String(Math.round(edge.width * emuPerPx));
|
|
134939
|
+
}
|
|
134940
|
+
if (edge.color) {
|
|
134941
|
+
delete ln["a:noFill"];
|
|
134942
|
+
delete ln["a:gradFill"];
|
|
134943
|
+
delete ln["a:pattFill"];
|
|
134944
|
+
ln["a:solidFill"] = {
|
|
134945
|
+
"a:srgbClr": { "@_val": edge.color.replace("#", "") }
|
|
134946
|
+
};
|
|
134947
|
+
}
|
|
134948
|
+
writeEdgeDash(ln, edge);
|
|
134949
|
+
tcPr[edge.xmlKey] = reorderObjectKeys(ln, LN_CHILD_ORDER);
|
|
134950
|
+
}
|
|
134951
|
+
}
|
|
134952
|
+
var init_table_cell_border_save = __esm({
|
|
134953
|
+
"pptx/core/core/runtime/table-cell-border-save.ts"() {
|
|
134954
|
+
init_drawing_line_dash();
|
|
134955
|
+
init_xml_reorder();
|
|
134956
|
+
}
|
|
134957
|
+
});
|
|
134958
|
+
|
|
134389
134959
|
// pptx/core/core/runtime/table-cell-save-helpers.ts
|
|
134390
134960
|
function writeCellFill(tcPr, style, resolveColorXml) {
|
|
134391
134961
|
if (style.fillMode === "gradient" && style.gradientFillStops && style.gradientFillStops.length > 0) {
|
|
134392
134962
|
delete tcPr["a:solidFill"];
|
|
134393
134963
|
delete tcPr["a:pattFill"];
|
|
134394
134964
|
delete tcPr["a:blipFill"];
|
|
134965
|
+
delete tcPr["a:noFill"];
|
|
134395
134966
|
const stops = style.gradientFillStops.map((stop) => {
|
|
134396
134967
|
const posRaw = typeof stop.position === "number" ? stop.position : 0;
|
|
134397
134968
|
const position4 = Math.round(Math.max(0, Math.min(1, posRaw / 100)) * 1e5);
|
|
@@ -134443,6 +135014,7 @@ function writeCellFill(tcPr, style, resolveColorXml) {
|
|
|
134443
135014
|
delete tcPr["a:solidFill"];
|
|
134444
135015
|
delete tcPr["a:gradFill"];
|
|
134445
135016
|
delete tcPr["a:blipFill"];
|
|
135017
|
+
delete tcPr["a:noFill"];
|
|
134446
135018
|
const pattXml = {
|
|
134447
135019
|
"@_prst": style.patternFillPreset
|
|
134448
135020
|
};
|
|
@@ -134466,10 +135038,12 @@ function writeCellFill(tcPr, style, resolveColorXml) {
|
|
|
134466
135038
|
delete tcPr["a:gradFill"];
|
|
134467
135039
|
delete tcPr["a:pattFill"];
|
|
134468
135040
|
delete tcPr["a:blipFill"];
|
|
135041
|
+
tcPr["a:noFill"] = tcPr["a:noFill"] ?? {};
|
|
134469
135042
|
} else if (style.fillMode !== "image" && style.backgroundColor) {
|
|
134470
135043
|
delete tcPr["a:gradFill"];
|
|
134471
135044
|
delete tcPr["a:pattFill"];
|
|
134472
135045
|
delete tcPr["a:blipFill"];
|
|
135046
|
+
delete tcPr["a:noFill"];
|
|
134473
135047
|
const resolvedOriginal = style.backgroundColorXml && resolveColorXml ? resolveColorXml(style.backgroundColorXml) : void 0;
|
|
134474
135048
|
tcPr["a:solidFill"] = serializeColorChoiceWithRef(
|
|
134475
135049
|
style.backgroundColorRef,
|
|
@@ -134689,6 +135263,7 @@ var init_PptxHandlerRuntimeSaveTableStyles = __esm({
|
|
|
134689
135263
|
init_xml_access();
|
|
134690
135264
|
init_xml_reorder();
|
|
134691
135265
|
init_PptxHandlerRuntimeLayoutSwitching();
|
|
135266
|
+
init_table_cell_border_save();
|
|
134692
135267
|
init_table_cell_save_helpers();
|
|
134693
135268
|
init_table_cell_text_xml();
|
|
134694
135269
|
PptxHandlerRuntime22 = class _PptxHandlerRuntime extends PptxHandlerRuntime21 {
|
|
@@ -134766,53 +135341,7 @@ var init_PptxHandlerRuntimeSaveTableStyles = __esm({
|
|
|
134766
135341
|
pPr["@_algn"] = token3;
|
|
134767
135342
|
}
|
|
134768
135343
|
}
|
|
134769
|
-
|
|
134770
|
-
{
|
|
134771
|
-
xmlKey: "a:lnT",
|
|
134772
|
-
width: style.borderTopWidth,
|
|
134773
|
-
color: style.borderTopColor,
|
|
134774
|
-
dash: style.borderTopDash
|
|
134775
|
-
},
|
|
134776
|
-
{
|
|
134777
|
-
xmlKey: "a:lnB",
|
|
134778
|
-
width: style.borderBottomWidth,
|
|
134779
|
-
color: style.borderBottomColor,
|
|
134780
|
-
dash: style.borderBottomDash
|
|
134781
|
-
},
|
|
134782
|
-
{
|
|
134783
|
-
xmlKey: "a:lnL",
|
|
134784
|
-
width: style.borderLeftWidth,
|
|
134785
|
-
color: style.borderLeftColor,
|
|
134786
|
-
dash: style.borderLeftDash
|
|
134787
|
-
},
|
|
134788
|
-
{
|
|
134789
|
-
xmlKey: "a:lnR",
|
|
134790
|
-
width: style.borderRightWidth,
|
|
134791
|
-
color: style.borderRightColor,
|
|
134792
|
-
dash: style.borderRightDash
|
|
134793
|
-
}
|
|
134794
|
-
];
|
|
134795
|
-
for (const edge of borderEdges) {
|
|
134796
|
-
if (edge.width !== void 0 || edge.color !== void 0 || edge.dash !== void 0) {
|
|
134797
|
-
if (!tcPr[edge.xmlKey]) {
|
|
134798
|
-
tcPr[edge.xmlKey] = {};
|
|
134799
|
-
}
|
|
134800
|
-
const ln = tcPr[edge.xmlKey];
|
|
134801
|
-
if (edge.width !== void 0) {
|
|
134802
|
-
ln["@_w"] = String(Math.round(edge.width * _PptxHandlerRuntime.EMU_PER_PX));
|
|
134803
|
-
}
|
|
134804
|
-
if (edge.color) {
|
|
134805
|
-
ln["a:solidFill"] = {
|
|
134806
|
-
"a:srgbClr": { "@_val": edge.color.replace("#", "") }
|
|
134807
|
-
};
|
|
134808
|
-
}
|
|
134809
|
-
if (edge.dash && edge.dash !== "solid") {
|
|
134810
|
-
ln["a:prstDash"] = { "@_val": edge.dash };
|
|
134811
|
-
} else if (edge.dash === "solid") {
|
|
134812
|
-
delete ln["a:prstDash"];
|
|
134813
|
-
}
|
|
134814
|
-
}
|
|
134815
|
-
}
|
|
135344
|
+
writeCellEdgeBorders(tcPr, style, _PptxHandlerRuntime.EMU_PER_PX);
|
|
134816
135345
|
const emuPerPx = _PptxHandlerRuntime.EMU_PER_PX;
|
|
134817
135346
|
if (style.marginLeft !== void 0) {
|
|
134818
135347
|
tcPr["@_marL"] = String(Math.round(style.marginLeft * emuPerPx));
|
|
@@ -135247,10 +135776,13 @@ var init_table_style_change_cell_clear = __esm({
|
|
|
135247
135776
|
"a:grpFill"
|
|
135248
135777
|
];
|
|
135249
135778
|
LINE_KEYS = [
|
|
135250
|
-
["a:lnL", ["borderLeftWidth", "borderLeftColor", "borderLeftDash"]],
|
|
135251
|
-
["a:lnR", ["borderRightWidth", "borderRightColor", "borderRightDash"]],
|
|
135252
|
-
["a:lnT", ["borderTopWidth", "borderTopColor", "borderTopDash"]],
|
|
135253
|
-
[
|
|
135779
|
+
["a:lnL", ["borderLeftWidth", "borderLeftColor", "borderLeftDash", "borderLeftDashSegments"]],
|
|
135780
|
+
["a:lnR", ["borderRightWidth", "borderRightColor", "borderRightDash", "borderRightDashSegments"]],
|
|
135781
|
+
["a:lnT", ["borderTopWidth", "borderTopColor", "borderTopDash", "borderTopDashSegments"]],
|
|
135782
|
+
[
|
|
135783
|
+
"a:lnB",
|
|
135784
|
+
["borderBottomWidth", "borderBottomColor", "borderBottomDash", "borderBottomDashSegments"]
|
|
135785
|
+
],
|
|
135254
135786
|
["a:lnTlToBr", ["borderDiagDownWidth", "borderDiagDownColor"]],
|
|
135255
135787
|
["a:lnBlToTr", ["borderDiagUpWidth", "borderDiagUpColor"]]
|
|
135256
135788
|
];
|
|
@@ -135494,7 +136026,15 @@ function slideContainsA16Element(node) {
|
|
|
135494
136026
|
function randomColumnId() {
|
|
135495
136027
|
return String(Math.floor(Math.random() * 4294967295));
|
|
135496
136028
|
}
|
|
135497
|
-
function
|
|
136029
|
+
function deterministicColumnId(index) {
|
|
136030
|
+
let hash2 = 2166136261;
|
|
136031
|
+
for (const ch of `a16:colId:${index}`) {
|
|
136032
|
+
hash2 ^= ch.charCodeAt(0);
|
|
136033
|
+
hash2 = Math.imul(hash2, 16777619) >>> 0;
|
|
136034
|
+
}
|
|
136035
|
+
return String(hash2);
|
|
136036
|
+
}
|
|
136037
|
+
function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn, newColumnId = randomColumnId) {
|
|
135498
136038
|
const existingXmlRows = ensureArrayFn(tbl["a:tr"]);
|
|
135499
136039
|
const existingGridCols = ensureArrayFn(
|
|
135500
136040
|
tbl["a:tblGrid"]?.["a:gridCol"]
|
|
@@ -135525,7 +136065,7 @@ function rebuildTableXmlFromData(tbl, tableData, emuPerPx, ensureArrayFn) {
|
|
|
135525
136065
|
// `ensureA16NamespaceOnSlideRoot`; emitting it here too is
|
|
135526
136066
|
// schema-redundant and PowerPoint flags it.
|
|
135527
136067
|
"a16:colId": {
|
|
135528
|
-
"@_val": existingColIds[i2] ||
|
|
136068
|
+
"@_val": existingColIds[i2] || newColumnId(i2)
|
|
135529
136069
|
}
|
|
135530
136070
|
}
|
|
135531
136071
|
}
|
|
@@ -135839,6 +136379,7 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
|
|
|
135839
136379
|
init_table_style_change_cell_clear();
|
|
135840
136380
|
init_table_paragraph_save_order();
|
|
135841
136381
|
init_table_structural_ops();
|
|
136382
|
+
init_table_xml_rebuild();
|
|
135842
136383
|
init_table_tblpr_save();
|
|
135843
136384
|
CHART_DATA_DISPLAY_OPTIONS_EXT_URI = "{56B9EC1D-385E-4148-901F-78D8002777C0}";
|
|
135844
136385
|
PptxHandlerRuntime24 = class _PptxHandlerRuntime extends PptxHandlerRuntime23 {
|
|
@@ -135875,7 +136416,8 @@ var init_PptxHandlerRuntimeSaveDataSerialization = __esm({
|
|
|
135875
136416
|
tbl,
|
|
135876
136417
|
tableData,
|
|
135877
136418
|
_PptxHandlerRuntime.EMU_PER_PX,
|
|
135878
|
-
this.ensureArray.bind(this)
|
|
136419
|
+
this.ensureArray.bind(this),
|
|
136420
|
+
this.saveFixedDate ? deterministicColumnId : void 0
|
|
135879
136421
|
);
|
|
135880
136422
|
const rebuiltRows = this.ensureArray(tbl["a:tr"]);
|
|
135881
136423
|
for (let rIdx = 0; rIdx < tableData.rows.length; rIdx++) {
|
|
@@ -138484,9 +139026,9 @@ var init_PptxHandlerRuntimeSaveDocumentParts = __esm({
|
|
|
138484
139026
|
let maxId = 0;
|
|
138485
139027
|
for (const rel of relationships3) {
|
|
138486
139028
|
const id = String(rel?.["@_Id"] || "");
|
|
138487
|
-
const
|
|
138488
|
-
if (Number.isFinite(
|
|
138489
|
-
maxId =
|
|
139029
|
+
const num5 = parseInt(id.replace(/^rId/u, ""), 10);
|
|
139030
|
+
if (Number.isFinite(num5) && num5 > maxId) {
|
|
139031
|
+
maxId = num5;
|
|
138490
139032
|
}
|
|
138491
139033
|
}
|
|
138492
139034
|
const existingFontTargets = /* @__PURE__ */ new Set();
|
|
@@ -138629,9 +139171,9 @@ var init_PptxHandlerRuntimeSaveDocumentParts = __esm({
|
|
|
138629
139171
|
let maxId = 0;
|
|
138630
139172
|
for (const rel of relationships3) {
|
|
138631
139173
|
const id = String(rel?.["@_Id"] || "");
|
|
138632
|
-
const
|
|
138633
|
-
if (Number.isFinite(
|
|
138634
|
-
maxId =
|
|
139174
|
+
const num5 = parseInt(id.replace(/^rId/u, ""), 10);
|
|
139175
|
+
if (Number.isFinite(num5) && num5 > maxId) {
|
|
139176
|
+
maxId = num5;
|
|
138635
139177
|
}
|
|
138636
139178
|
}
|
|
138637
139179
|
relationships3.push({
|
|
@@ -142986,6 +143528,7 @@ var init_PptxHandlerRuntimeSaveSlideWriter = __esm({
|
|
|
142986
143528
|
init_slide_name();
|
|
142987
143529
|
init_utils();
|
|
142988
143530
|
init_modern_comment_package();
|
|
143531
|
+
init_slide_background_gradient();
|
|
142989
143532
|
init_slide_synchronization();
|
|
142990
143533
|
init_theme_override_utils();
|
|
142991
143534
|
init_builders();
|
|
@@ -143243,6 +143786,16 @@ var init_PptxHandlerRuntimeSaveSlideWriter = __esm({
|
|
|
143243
143786
|
message: `Slide background image could not be embedded and was preserved as-is or omitted: ${imageUrl.slice(0, 120)}`,
|
|
143244
143787
|
scope: "save",
|
|
143245
143788
|
slideId: slide.id
|
|
143789
|
+
}),
|
|
143790
|
+
buildBackgroundGradientFill: () => {
|
|
143791
|
+
const gradient = slideBackgroundGradientToWrite(slide);
|
|
143792
|
+
return gradient ? this.buildGradientFillXml({ fillMode: "gradient", ...gradient }) : void 0;
|
|
143793
|
+
},
|
|
143794
|
+
reportUnsupportedGradient: () => this.compatibilityService.reportWarning({
|
|
143795
|
+
code: "SAVE_BACKGROUND_GRADIENT_UNSUPPORTED",
|
|
143796
|
+
message: "Slide background gradient has no structured form (backgroundGradientFill) matching its CSS gradient and could not be written; the slide was saved without a background of its own.",
|
|
143797
|
+
scope: "save",
|
|
143798
|
+
slideId: slide.id
|
|
143246
143799
|
})
|
|
143247
143800
|
});
|
|
143248
143801
|
this.slideCommentPartWriter.writeComments({
|
|
@@ -145594,6 +146147,15 @@ var init_PptxHandlerRuntimeSaveStructuralIds = __esm({
|
|
|
145594
146147
|
});
|
|
145595
146148
|
|
|
145596
146149
|
// pptx/core/core/runtime/PptxHandlerRuntimeSavePipeline.ts
|
|
146150
|
+
function validFixedDate(date) {
|
|
146151
|
+
if (date === void 0) {
|
|
146152
|
+
return void 0;
|
|
146153
|
+
}
|
|
146154
|
+
if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
|
|
146155
|
+
throw new RangeError("PptxHandlerSaveOptions.fixedDate must be a valid Date");
|
|
146156
|
+
}
|
|
146157
|
+
return date;
|
|
146158
|
+
}
|
|
145597
146159
|
var PptxHandlerRuntime54;
|
|
145598
146160
|
var init_PptxHandlerRuntimeSavePipeline = __esm({
|
|
145599
146161
|
"pptx/core/core/runtime/PptxHandlerRuntimeSavePipeline.ts"() {
|
|
@@ -145639,6 +146201,7 @@ var init_PptxHandlerRuntimeSavePipeline = __esm({
|
|
|
145639
146201
|
/** One save, with the package to itself; callers go through {@link save}. */
|
|
145640
146202
|
async saveNow(slides, options2) {
|
|
145641
146203
|
validateSlideGeometry(slides);
|
|
146204
|
+
this.saveFixedDate = validFixedDate(options2?.fixedDate);
|
|
145642
146205
|
const templates = [
|
|
145643
146206
|
...options2?.slideMasters ?? [],
|
|
145644
146207
|
...options2?.slideLayouts ?? [],
|
|
@@ -145829,7 +146392,8 @@ var init_PptxHandlerRuntimeSavePipeline = __esm({
|
|
|
145829
146392
|
await this.documentPropertiesUpdater.updateOnSave(slides, {
|
|
145830
146393
|
coreProperties: options2?.coreProperties,
|
|
145831
146394
|
appProperties: options2?.appProperties,
|
|
145832
|
-
customProperties: options2?.customProperties
|
|
146395
|
+
customProperties: options2?.customProperties,
|
|
146396
|
+
fixedDate: this.saveFixedDate
|
|
145833
146397
|
});
|
|
145834
146398
|
await this.applyTagCollectionChanges(options2?.tags);
|
|
145835
146399
|
await this.applyNotesMasterChanges(options2?.notesMaster);
|
|
@@ -145873,6 +146437,11 @@ var init_PptxHandlerRuntimeSavePipeline = __esm({
|
|
|
145873
146437
|
delete this.zip.files[name];
|
|
145874
146438
|
}
|
|
145875
146439
|
}
|
|
146440
|
+
if (this.saveFixedDate) {
|
|
146441
|
+
for (const file of Object.values(this.zip.files)) {
|
|
146442
|
+
file.date = this.saveFixedDate;
|
|
146443
|
+
}
|
|
146444
|
+
}
|
|
145876
146445
|
return await this.zip.generateAsync({
|
|
145877
146446
|
type: "uint8array",
|
|
145878
146447
|
compression: "DEFLATE",
|
|
@@ -155837,8 +156406,8 @@ function parseNumberVal(node) {
|
|
|
155837
156406
|
if (raw2 === void 0 || raw2 === null || raw2 === "") {
|
|
155838
156407
|
return void 0;
|
|
155839
156408
|
}
|
|
155840
|
-
const
|
|
155841
|
-
return Number.isFinite(
|
|
156409
|
+
const num5 = Number.parseFloat(String(raw2));
|
|
156410
|
+
return Number.isFinite(num5) ? num5 : void 0;
|
|
155842
156411
|
}
|
|
155843
156412
|
var CHART_DATA_DISPLAY_OPTIONS_EXT_URI2, PptxHandlerRuntime93;
|
|
155844
156413
|
var init_PptxHandlerRuntimeChartParsingHelpers = __esm({
|
|
@@ -158431,12 +159000,12 @@ var init_PptxHandlerRuntimeThemeEffects = __esm({
|
|
|
158431
159000
|
* in-memory format schemes of the masters on those parts and, when the deck's part is among
|
|
158432
159001
|
* them, the deck's.
|
|
158433
159002
|
*/
|
|
158434
|
-
async writeFormatScheme(
|
|
159003
|
+
async writeFormatScheme(elementFor, themePaths) {
|
|
158435
159004
|
const deckBefore = this.getThemeFormatScheme();
|
|
158436
159005
|
const replaced = /* @__PURE__ */ new Map();
|
|
158437
159006
|
const schemes = /* @__PURE__ */ new Map();
|
|
158438
159007
|
const written = await this.rewriteThemeParts(themePaths, (data, path4) => {
|
|
158439
|
-
const element2 =
|
|
159008
|
+
const element2 = elementFor(path4);
|
|
158440
159009
|
const elements2 = data["a:theme"]?.["a:themeElements"];
|
|
158441
159010
|
if (!element2 || !elements2) {
|
|
158442
159011
|
return false;
|
|
@@ -158474,7 +159043,7 @@ var init_PptxHandlerRuntimeThemeEffects = __esm({
|
|
|
158474
159043
|
this.themeFormatScheme = deck;
|
|
158475
159044
|
this.heldFormatSchemes.holdParts(
|
|
158476
159045
|
deck,
|
|
158477
|
-
new Map(written.map((path4) => [path4,
|
|
159046
|
+
new Map(written.map((path4) => [path4, elementFor(path4)]))
|
|
158478
159047
|
);
|
|
158479
159048
|
}
|
|
158480
159049
|
return this.getThemeFormatScheme();
|
|
@@ -165367,12 +165936,12 @@ var OmmlLatexConverter = class {
|
|
|
165367
165936
|
if (!f6) {
|
|
165368
165937
|
return null;
|
|
165369
165938
|
}
|
|
165370
|
-
const
|
|
165939
|
+
const num5 = this.renderNode(f6["m:num"]).trim();
|
|
165371
165940
|
const den = this.renderNode(f6["m:den"]).trim();
|
|
165372
|
-
if (!
|
|
165941
|
+
if (!num5 && !den) {
|
|
165373
165942
|
return null;
|
|
165374
165943
|
}
|
|
165375
|
-
return `\\frac{${
|
|
165944
|
+
return `\\frac{${num5 || " "}}{${den || " "}}`;
|
|
165376
165945
|
}
|
|
165377
165946
|
trySuperscript(node) {
|
|
165378
165947
|
const value = node["m:sSup"];
|