@aixa-transformation/pptx-viewer 2.0.31 → 2.0.33

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.
@@ -8624,7 +8624,7 @@ var PptxPresentationSlidesReconciler = class {
8624
8624
  if (typeof relationshipId2 === "string" && relationshipId2.length > 0) {
8625
8625
  usedRIds.add(relationshipId2);
8626
8626
  }
8627
- if (relationshipType === input.slideRelationshipType && typeof relationshipId2 === "string" && typeof relationshipTarget2 === "string") {
8627
+ if (this.isSlideRelationshipType(relationshipType, input.slideRelationshipType) && typeof relationshipId2 === "string" && typeof relationshipTarget2 === "string") {
8628
8628
  slideTargetByRid.set(relationshipId2, relationshipTarget2);
8629
8629
  continue;
8630
8630
  }
@@ -8839,6 +8839,13 @@ var PptxPresentationSlidesReconciler = class {
8839
8839
  }
8840
8840
  return [value];
8841
8841
  }
8842
+ /** Match equivalent Strict and Transitional slide relationship URIs. */
8843
+ isSlideRelationshipType(value, expected) {
8844
+ if (typeof value !== "string") {
8845
+ return false;
8846
+ }
8847
+ return value === expected || value.endsWith("/relationships/slide");
8848
+ }
8842
8849
  };
8843
8850
  function isExternalTarget(target) {
8844
8851
  const normalized = target.trim();
@@ -16381,8 +16388,16 @@ var PptxDocumentPropertiesUpdater = class {
16381
16388
  const relationships = relsData["Relationships"];
16382
16389
  if (relationships) {
16383
16390
  const rels = Array.isArray(relationships["Relationship"]) ? relationships["Relationship"] : relationships["Relationship"] ? [relationships["Relationship"]] : [];
16384
- const hasCustomRel = rels.some((r) => String(r?.["@_Type"] || "") === customRelType);
16385
- if (!hasCustomRel) {
16391
+ const customRelationships = rels.filter(
16392
+ (relationship) => this.isCustomPropertiesRelationship(relationship)
16393
+ );
16394
+ if (customRelationships.length > 0) {
16395
+ const retained = customRelationships[0];
16396
+ relationships["Relationship"] = rels.filter(
16397
+ (relationship) => !this.isCustomPropertiesRelationship(relationship) || relationship === retained
16398
+ );
16399
+ this.context.zip.file("_rels/.rels", this.context.builder.build(relsData));
16400
+ } else {
16386
16401
  let maxId = 0;
16387
16402
  for (const rel of rels) {
16388
16403
  const id = String(rel?.["@_Id"] || "");
@@ -16411,7 +16426,6 @@ var PptxDocumentPropertiesUpdater = class {
16411
16426
  * orphan content-type entry referencing a deleted part.
16412
16427
  */
16413
16428
  async removeCustomPropertiesPackagingArtifacts() {
16414
- const customRelType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties";
16415
16429
  const ctFile = this.context.zip.file("[Content_Types].xml");
16416
16430
  if (ctFile) {
16417
16431
  try {
@@ -16439,7 +16453,9 @@ var PptxDocumentPropertiesUpdater = class {
16439
16453
  const relationships = relsData["Relationships"];
16440
16454
  if (relationships) {
16441
16455
  const rels = Array.isArray(relationships["Relationship"]) ? relationships["Relationship"] : relationships["Relationship"] ? [relationships["Relationship"]] : [];
16442
- const filtered = rels.filter((r) => String(r?.["@_Type"] || "") !== customRelType);
16456
+ const filtered = rels.filter(
16457
+ (relationship) => !this.isCustomPropertiesRelationship(relationship)
16458
+ );
16443
16459
  if (filtered.length !== rels.length) {
16444
16460
  relationships["Relationship"] = filtered;
16445
16461
  this.context.zip.file("_rels/.rels", this.context.builder.build(relsData));
@@ -16449,6 +16465,11 @@ var PptxDocumentPropertiesUpdater = class {
16449
16465
  }
16450
16466
  }
16451
16467
  }
16468
+ isCustomPropertiesRelationship(relationship) {
16469
+ const type = String(relationship?.["@_Type"] || "");
16470
+ const target = String(relationship?.["@_Target"] || "").replace(/\\/gu, "/").replace(/^\.\//u, "");
16471
+ return target === "docProps/custom.xml" || type.endsWith("/relationships/custom-properties") || type.endsWith("/relationships/customProperties");
16472
+ }
16452
16473
  normalizeCustomPropertyType(type) {
16453
16474
  const supportedTypes = /* @__PURE__ */ new Set([
16454
16475
  "lpwstr",
@@ -31687,6 +31708,45 @@ function isEotFormat(data) {
31687
31708
  const magic = readUint16LE(data, EOT_MAGIC_OFFSET);
31688
31709
  return magic === EOT_MAGIC;
31689
31710
  }
31711
+ function createEotFromSfnt(fontData, options) {
31712
+ const encodeName2 = (value) => {
31713
+ const bytes = new Uint8Array((value.length + 1) * 2);
31714
+ const view2 = new DataView(bytes.buffer);
31715
+ for (let i = 0; i < value.length; i++) {
31716
+ view2.setUint16(i * 2, value.charCodeAt(i), true);
31717
+ }
31718
+ return bytes;
31719
+ };
31720
+ const names = [
31721
+ encodeName2(options.familyName),
31722
+ encodeName2(options.styleName ?? ""),
31723
+ encodeName2(""),
31724
+ encodeName2(options.fullName ?? options.familyName)
31725
+ ];
31726
+ const headerSize = 80 + names.reduce((sum, name) => sum + 4 + name.length, 0);
31727
+ const result = new Uint8Array(headerSize + fontData.length);
31728
+ const view = new DataView(result.buffer);
31729
+ view.setUint32(0, result.length, true);
31730
+ view.setUint32(4, fontData.length, true);
31731
+ view.setUint32(8, 131073, true);
31732
+ view.setUint32(12, 0, true);
31733
+ result[26] = 1;
31734
+ result[27] = options.italic ? 1 : 0;
31735
+ view.setUint32(28, options.weight ?? 400, true);
31736
+ view.setUint16(32, 0, true);
31737
+ view.setUint16(34, EOT_MAGIC, true);
31738
+ let offset = 80;
31739
+ for (const name of names) {
31740
+ view.setUint16(offset, 0, true);
31741
+ offset += 2;
31742
+ view.setUint16(offset, name.length, true);
31743
+ offset += 2;
31744
+ result.set(name, offset);
31745
+ offset += name.length;
31746
+ }
31747
+ result.set(fontData, offset);
31748
+ return result;
31749
+ }
31690
31750
  function parseEotHeader(data) {
31691
31751
  if (!isEotFormat(data)) {
31692
31752
  return null;
@@ -31789,7 +31849,8 @@ function guidToKey(guid) {
31789
31849
  }
31790
31850
  const key = new Uint8Array(KEY_LENGTH);
31791
31851
  for (let i = 0; i < KEY_LENGTH; i++) {
31792
- key[i] = parseInt(stripped.substring(i * 2, i * 2 + 2), 16);
31852
+ const sourceIndex = KEY_LENGTH - i - 1;
31853
+ key[i] = parseInt(stripped.substring(sourceIndex * 2, sourceIndex * 2 + 2), 16);
31793
31854
  }
31794
31855
  return key;
31795
31856
  }
@@ -41641,9 +41702,13 @@ var NAMESPACE_PAIRS = [
41641
41702
  "http://schemas.openxmlformats.org/officeDocument/2006/bibliography"
41642
41703
  ],
41643
41704
  [
41644
- "http://purl.oclc.org/ooxml/officeDocument/custom-properties",
41705
+ "http://purl.oclc.org/ooxml/officeDocument/customProperties",
41645
41706
  "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties"
41646
41707
  ],
41708
+ [
41709
+ "http://purl.oclc.org/ooxml/officeDocument/relationships/customProperties",
41710
+ "http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties"
41711
+ ],
41647
41712
  [
41648
41713
  "http://purl.oclc.org/ooxml/officeDocument/extended-properties",
41649
41714
  "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties"
@@ -62285,6 +62350,13 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime7 extends PptxHandlerRuntime
62285
62350
  };
62286
62351
  for (const variant of variants) {
62287
62352
  const fontData = variant.rawFontData;
62353
+ const isWebFont = variant.format === "woff" || variant.format === "woff2";
62354
+ const hasSfntSignature = fontData.length >= 4 && (fontData[0] === 0 && fontData[1] === 1 && fontData[2] === 0 && fontData[3] === 0 || String.fromCharCode(fontData[0], fontData[1], fontData[2], fontData[3]) === "OTTO" || String.fromCharCode(fontData[0], fontData[1], fontData[2], fontData[3]) === "true" || String.fromCharCode(fontData[0], fontData[1], fontData[2], fontData[3]) === "ttcf");
62355
+ if (!variant.originalRId && (isWebFont || !hasSfntSignature)) {
62356
+ throw new Error(
62357
+ `Cannot embed custom font "${variant.name}" in PowerPoint: use a valid .ttf or .otf font file, not WOFF/WOFF2 browser data.`
62358
+ );
62359
+ }
62288
62360
  const hasOriginal = Boolean(variant.originalRId && variant.partPath);
62289
62361
  const reuseObfuscation = hasOriginal && Boolean(variant.fontGuid);
62290
62362
  const reuseVerbatim = hasOriginal && !variant.fontGuid && Boolean(variant.originalPartBytes);
@@ -62307,10 +62379,16 @@ var PptxHandlerRuntime24 = class _PptxHandlerRuntime7 extends PptxHandlerRuntime
62307
62379
  bytesToWrite = variant.originalPartBytes;
62308
62380
  } else {
62309
62381
  guid = variant.fontGuid ?? generateFontGuid();
62310
- const fileName = `{${guid}}.fntdata`;
62382
+ const usedFontNumbers = relationships.map((relationship) => /fonts\/font(?<number>\d+)\.fntdata$/iu.exec(String(relationship?.["@_Target"] || ""))?.groups?.number).map((number) => Number(number)).filter((number) => Number.isFinite(number));
62383
+ const fileName = `font${Math.max(0, ...usedFontNumbers) + 1}.fntdata`;
62311
62384
  fontPartPath = `ppt/fonts/${fileName}`;
62312
62385
  relativeTarget4 = `fonts/${fileName}`;
62313
- bytesToWrite = obfuscateFont(fontData, guid);
62386
+ bytesToWrite = createEotFromSfnt(fontData, {
62387
+ familyName: variant.name,
62388
+ styleName: variant.bold ? variant.italic ? "Bold Italic" : "Bold" : variant.italic ? "Italic" : "Regular",
62389
+ weight: variant.bold ? 700 : 400,
62390
+ italic: variant.italic
62391
+ });
62314
62392
  const existingRel = relationships.find(
62315
62393
  (r) => String(r?.["@_Target"] || "") === relativeTarget4
62316
62394
  );
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkYOOFW6LR_js = require('./chunk-YOOFW6LR.js');
3
+ var chunkWGHMMJOJ_js = require('./chunk-WGHMMJOJ.js');
4
4
  var DOMPurify = require('dompurify');
5
5
 
6
6
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -238,7 +238,7 @@ function resolveThemeCatalogEntry(key, catalog = THEME_CATALOG) {
238
238
  return catalog.find((entry) => entry.key === key)?.theme;
239
239
  }
240
240
  function corePreset(id) {
241
- const preset = chunkYOOFW6LR_js.THEME_PRESETS.find((p) => p.id === id);
241
+ const preset = chunkWGHMMJOJ_js.THEME_PRESETS.find((p) => p.id === id);
242
242
  if (!preset) {
243
243
  throw new Error(`theme-gallery-presets: core THEME_PRESETS is missing "${id}"`);
244
244
  }
@@ -414,7 +414,7 @@ function buildInitialGuides(presentationGuides, firstSlideGuides) {
414
414
  guides.push({
415
415
  id: g.id,
416
416
  axis: g.orientation === "horz" ? "h" : "v",
417
- position: chunkYOOFW6LR_js.guideEmuToPx(g.positionEmu)
417
+ position: chunkWGHMMJOJ_js.guideEmuToPx(g.positionEmu)
418
418
  });
419
419
  }
420
420
  }
@@ -423,7 +423,7 @@ function buildInitialGuides(presentationGuides, firstSlideGuides) {
423
423
  guides.push({
424
424
  id: g.id,
425
425
  axis: g.orientation === "horz" ? "h" : "v",
426
- position: chunkYOOFW6LR_js.guideEmuToPx(g.positionEmu)
426
+ position: chunkWGHMMJOJ_js.guideEmuToPx(g.positionEmu)
427
427
  });
428
428
  }
429
429
  }
@@ -436,23 +436,23 @@ function getResolvedShapeClipPathFor(shapeType, width, height, adjustments) {
436
436
  return void 0;
437
437
  }
438
438
  if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) {
439
- return chunkYOOFW6LR_js.getShapeClipPath(shapeType);
439
+ return chunkWGHMMJOJ_js.getShapeClipPath(shapeType);
440
440
  }
441
441
  if (adjustments && Object.keys(adjustments).length > 0) {
442
- const adjusted = chunkYOOFW6LR_js.getAdjustmentAwareShapeClipPath(shapeType, width, height, adjustments);
442
+ const adjusted = chunkWGHMMJOJ_js.getAdjustmentAwareShapeClipPath(shapeType, width, height, adjustments);
443
443
  if (adjusted !== void 0) {
444
444
  return adjusted;
445
445
  }
446
446
  }
447
- const fromPreset = chunkYOOFW6LR_js.getShapeClipPathFromPreset(shapeType, width, height, adjustments);
447
+ const fromPreset = chunkWGHMMJOJ_js.getShapeClipPathFromPreset(shapeType, width, height, adjustments);
448
448
  if (fromPreset !== void 0) {
449
449
  return fromPreset;
450
450
  }
451
- const cloud = chunkYOOFW6LR_js.getCloudPathForRendering(shapeType, width, height);
451
+ const cloud = chunkWGHMMJOJ_js.getCloudPathForRendering(shapeType, width, height);
452
452
  if (cloud !== void 0) {
453
453
  return cloud;
454
454
  }
455
- return chunkYOOFW6LR_js.getShapeClipPath(shapeType);
455
+ return chunkWGHMMJOJ_js.getShapeClipPath(shapeType);
456
456
  }
457
457
  function buildCustomGeometryClipPath(pathData, pathWidth, pathHeight, elemWidth, elemHeight) {
458
458
  if (!pathData || !Number.isFinite(pathWidth) || !Number.isFinite(pathHeight) || pathWidth <= 0 || pathHeight <= 0 || !Number.isFinite(elemWidth) || !Number.isFinite(elemHeight) || elemWidth <= 0 || elemHeight <= 0) {
@@ -1101,7 +1101,7 @@ var OOXML_PATTERN_PRESETS = [
1101
1101
  "zigZag"
1102
1102
  ];
1103
1103
  function getComputedFillStyle(element, parentGroupFill) {
1104
- if (!chunkYOOFW6LR_js.hasShapeProperties(element)) {
1104
+ if (!chunkWGHMMJOJ_js.hasShapeProperties(element)) {
1105
1105
  return void 0;
1106
1106
  }
1107
1107
  const ss = element.shapeStyle;
@@ -1170,7 +1170,7 @@ function getGroupChildParentFill(group) {
1170
1170
  return group.type === "group" ? group.groupFill : void 0;
1171
1171
  }
1172
1172
  function resolveGroupChildFill(child2, parentGroupFill) {
1173
- if (!parentGroupFill || !chunkYOOFW6LR_js.hasShapeProperties(child2) || child2.shapeStyle?.fillMode !== "group") {
1173
+ if (!parentGroupFill || !chunkWGHMMJOJ_js.hasShapeProperties(child2) || child2.shapeStyle?.fillMode !== "group") {
1174
1174
  return void 0;
1175
1175
  }
1176
1176
  return getComputedFillStyle(child2, parentGroupFill);
@@ -1373,7 +1373,7 @@ var DEFAULT_SCHEME_COLOR_MAP = {
1373
1373
  phclr: "#4472C4"
1374
1374
  };
1375
1375
  function applyDrawingColorTransforms2(baseColor, colorNode) {
1376
- return chunkYOOFW6LR_js.applyDrawingColorTransforms(baseColor, colorNode);
1376
+ return chunkWGHMMJOJ_js.applyDrawingColorTransforms(baseColor, colorNode);
1377
1377
  }
1378
1378
  function parseDrawingColorChoice(colorNode, schemeColorOverrides) {
1379
1379
  if (!colorNode) {
@@ -1425,7 +1425,7 @@ function parseDrawingColorChoice(colorNode, schemeColorOverrides) {
1425
1425
  const h = hueRaw / 6e4;
1426
1426
  const s = clampUnitInterval(satRaw / 1e5);
1427
1427
  const l = clampUnitInterval(lumRaw / 1e5);
1428
- const rgb = chunkYOOFW6LR_js.hslToRgb(h, s, l);
1428
+ const rgb = chunkWGHMMJOJ_js.hslToRgb(h, s, l);
1429
1429
  const toHex2 = (value) => Math.min(255, Math.max(0, Math.round(value))).toString(16).padStart(2, "0").toUpperCase();
1430
1430
  const base = `#${toHex2(rgb.r)}${toHex2(rgb.g)}${toHex2(rgb.b)}`;
1431
1431
  return applyDrawingColorTransforms2(base, hslNode);
@@ -1435,7 +1435,7 @@ function parseDrawingColorChoice(colorNode, schemeColorOverrides) {
1435
1435
  const preset = String(
1436
1436
  colorNode["a:prstClr"]?.["@_val"] || ""
1437
1437
  ).toLowerCase();
1438
- const mapped = chunkYOOFW6LR_js.PRESET_COLOR_MAP[preset];
1438
+ const mapped = chunkWGHMMJOJ_js.PRESET_COLOR_MAP[preset];
1439
1439
  if (!mapped) {
1440
1440
  return void 0;
1441
1441
  }
@@ -1978,7 +1978,7 @@ function hexToRgbUnit2(hex) {
1978
1978
  };
1979
1979
  }
1980
1980
  function getEffects(element) {
1981
- if (!chunkYOOFW6LR_js.isImageLikeElement(element)) {
1981
+ if (!chunkWGHMMJOJ_js.isImageLikeElement(element)) {
1982
1982
  return void 0;
1983
1983
  }
1984
1984
  return element.imageEffects;
@@ -2167,7 +2167,7 @@ function buildDuotoneFilterMarkup(color1, color2) {
2167
2167
  const c2 = hexToRgbUnit2(color2);
2168
2168
  return `<feColorMatrix type="matrix" values="${GRAYSCALE_LUMINANCE_MATRIX}"/><feComponentTransfer><feFuncR type="linear" slope="${c2.r - c1.r}" intercept="${c1.r}"/><feFuncG type="linear" slope="${c2.g - c1.g}" intercept="${c1.g}"/><feFuncB type="linear" slope="${c2.b - c1.b}" intercept="${c1.b}"/></feComponentTransfer>`;
2169
2169
  }
2170
- function getDuotoneImageFilter(element, elementId = chunkYOOFW6LR_js.isImageLikeElement(element) ? element.id : "") {
2170
+ function getDuotoneImageFilter(element, elementId = chunkWGHMMJOJ_js.isImageLikeElement(element) ? element.id : "") {
2171
2171
  const effects = getEffects(element);
2172
2172
  if (!effects?.duotone) {
2173
2173
  return void 0;
@@ -2269,7 +2269,7 @@ function buildImageAlphaFilterMarkup(effects) {
2269
2269
  }
2270
2270
  return parts.length > 0 ? parts.join("") : void 0;
2271
2271
  }
2272
- function getImageAlphaFilter(element, elementId = chunkYOOFW6LR_js.isImageLikeElement(element) ? element.id : "") {
2272
+ function getImageAlphaFilter(element, elementId = chunkWGHMMJOJ_js.isImageLikeElement(element) ? element.id : "") {
2273
2273
  const effects = getEffects(element);
2274
2274
  if (!effects || !hasAdvancedImageAlphaEffects(element)) {
2275
2275
  return void 0;
@@ -2359,7 +2359,7 @@ function buildArtisticFilterMarkup(effectName, radius) {
2359
2359
  return void 0;
2360
2360
  }
2361
2361
  }
2362
- function getArtisticImageFilter(element, elementId = chunkYOOFW6LR_js.isImageLikeElement(element) ? element.id : "") {
2362
+ function getArtisticImageFilter(element, elementId = chunkWGHMMJOJ_js.isImageLikeElement(element) ? element.id : "") {
2363
2363
  const effects = getEffects(element);
2364
2364
  if (!effects?.artisticEffect || !needsSvgArtisticFilter(effects.artisticEffect)) {
2365
2365
  return void 0;
@@ -3318,7 +3318,7 @@ function convertChildren(node) {
3318
3318
  if (key.startsWith("@_")) {
3319
3319
  continue;
3320
3320
  }
3321
- const tag = chunkYOOFW6LR_js.stripXmlOrderSuffix(key);
3321
+ const tag = chunkWGHMMJOJ_js.stripXmlOrderSuffix(key);
3322
3322
  if (tag === "m:oMathPara") {
3323
3323
  continue;
3324
3324
  }
@@ -3390,7 +3390,7 @@ function findOmathRoots(node) {
3390
3390
  }
3391
3391
  }
3392
3392
  const contentTags = /* @__PURE__ */ new Set(["m:r", "m:f", "m:rad", "m:sSup", "m:sSub", "m:box"]);
3393
- if (Object.keys(node).some((key) => contentTags.has(chunkYOOFW6LR_js.stripXmlOrderSuffix(key)))) {
3393
+ if (Object.keys(node).some((key) => contentTags.has(chunkWGHMMJOJ_js.stripXmlOrderSuffix(key)))) {
3394
3394
  return [node];
3395
3395
  }
3396
3396
  return [];
@@ -3600,7 +3600,7 @@ function mergeSiblings(nodes) {
3600
3600
  }
3601
3601
  const ordered2 = {};
3602
3602
  for (const [position, [key, value]] of entries.entries()) {
3603
- ordered2[(counts.get(key) ?? 0) > 1 ? chunkYOOFW6LR_js.orderedXmlKey(key, position) : key] = value;
3603
+ ordered2[(counts.get(key) ?? 0) > 1 ? chunkWGHMMJOJ_js.orderedXmlKey(key, position) : key] = value;
3604
3604
  }
3605
3605
  return ordered2;
3606
3606
  }
@@ -4004,7 +4004,7 @@ function ommlChildrenToLatex(node) {
4004
4004
  if (key.startsWith("@_")) {
4005
4005
  continue;
4006
4006
  }
4007
- const tag = chunkYOOFW6LR_js.stripXmlOrderSuffix(key);
4007
+ const tag = chunkWGHMMJOJ_js.stripXmlOrderSuffix(key);
4008
4008
  const items = ensureArr(node[key]);
4009
4009
  for (const item of items) {
4010
4010
  const result = ommlElementToLatex(tag, item);
@@ -12185,7 +12185,7 @@ function buildSegmentCounts(slide, nativeAnims) {
12185
12185
  for (const anim of nativeAnims) {
12186
12186
  if (anim.buildType && anim.buildType !== "allAtOnce" && anim.targetId) {
12187
12187
  const el = slide.elements.find((e) => e.id === anim.targetId);
12188
- if (el && chunkYOOFW6LR_js.hasTextProperties(el) && el.textSegments && el.textSegments.length > 0) {
12188
+ if (el && chunkWGHMMJOJ_js.hasTextProperties(el) && el.textSegments && el.textSegments.length > 0) {
12189
12189
  segmentCounts.set(anim.targetId, countTextSegments(el.textSegments));
12190
12190
  }
12191
12191
  }
@@ -14403,7 +14403,7 @@ function rotateDelta(dx, dy, rotationDeg) {
14403
14403
  }
14404
14404
  function applyResize(box, handle, dxScreen, dyScreen, zoom, opts = {}) {
14405
14405
  const scale = zoom || 1;
14406
- const minSize = opts.minSize ?? chunkYOOFW6LR_js.MIN_ELEMENT_SIZE;
14406
+ const minSize = opts.minSize ?? chunkWGHMMJOJ_js.MIN_ELEMENT_SIZE;
14407
14407
  const rotation = rotationOf(box);
14408
14408
  const local = rotateDelta(dxScreen / scale, dyScreen / scale, rotation);
14409
14409
  const dx = local.x;
@@ -14430,7 +14430,7 @@ function applyResize(box, handle, dxScreen, dyScreen, zoom, opts = {}) {
14430
14430
  }
14431
14431
  return { x: newX, y: newY, width: newW, height: newH, rotation };
14432
14432
  }
14433
- function snapBoxToGrid(box, handle, gridSpacingPx, minSize = chunkYOOFW6LR_js.MIN_ELEMENT_SIZE) {
14433
+ function snapBoxToGrid(box, handle, gridSpacingPx, minSize = chunkWGHMMJOJ_js.MIN_ELEMENT_SIZE) {
14434
14434
  if (handle === null || gridSpacingPx <= 0) {
14435
14435
  return box;
14436
14436
  }
@@ -14460,7 +14460,7 @@ function snapBoxToGrid(box, handle, gridSpacingPx, minSize = chunkYOOFW6LR_js.MI
14460
14460
  }
14461
14461
  return { x, y, width, height };
14462
14462
  }
14463
- function computeMarqueeHitIds(marquee, elements, minSize = chunkYOOFW6LR_js.MIN_ELEMENT_SIZE) {
14463
+ function computeMarqueeHitIds(marquee, elements, minSize = chunkWGHMMJOJ_js.MIN_ELEMENT_SIZE) {
14464
14464
  const minX = Math.min(marquee.startX, marquee.currentX);
14465
14465
  const minY = Math.min(marquee.startY, marquee.currentY);
14466
14466
  const maxX = Math.max(marquee.startX, marquee.currentX);
@@ -16016,7 +16016,7 @@ var THEME_COLOR_LABELS = {
16016
16016
  };
16017
16017
  function buildThemeColorGrid(colorScheme) {
16018
16018
  return THEME_COLOR_TINT_ROWS.map(
16019
- (row) => chunkYOOFW6LR_js.THEME_COLOR_SCHEME_KEYS.map((key) => ({
16019
+ (row) => chunkWGHMMJOJ_js.THEME_COLOR_SCHEME_KEYS.map((key) => ({
16020
16020
  hex: row.transform(colorScheme[key]),
16021
16021
  schemeKey: key,
16022
16022
  rowLabel: row.label,
@@ -16352,12 +16352,12 @@ function getShapeConnectionSites(shape) {
16352
16352
  }
16353
16353
  const pathW = geo.pathWidth && geo.pathWidth > 0 ? geo.pathWidth : shape.width;
16354
16354
  const pathH = geo.pathHeight && geo.pathHeight > 0 ? geo.pathHeight : shape.height;
16355
- const vars = chunkYOOFW6LR_js.createBuiltinVariables({ w: pathW, h: pathH });
16355
+ const vars = chunkWGHMMJOJ_js.createBuiltinVariables({ w: pathW, h: pathH });
16356
16356
  const scaleX = pathW > 0 ? shape.width / pathW : 1;
16357
16357
  const scaleY = pathH > 0 ? shape.height / pathH : 1;
16358
16358
  return cxn.map((site, index) => ({
16359
- x: chunkYOOFW6LR_js.resolveCoordinate(site.posX, vars) * scaleX,
16360
- y: chunkYOOFW6LR_js.resolveCoordinate(site.posY, vars) * scaleY,
16359
+ x: chunkWGHMMJOJ_js.resolveCoordinate(site.posX, vars) * scaleX,
16360
+ y: chunkWGHMMJOJ_js.resolveCoordinate(site.posY, vars) * scaleY,
16361
16361
  index
16362
16362
  }));
16363
16363
  }
@@ -16520,7 +16520,7 @@ function svgLineCap(lineCap) {
16520
16520
  }
16521
16521
  function copyFormatFromElement(element) {
16522
16522
  const result = {};
16523
- if (chunkYOOFW6LR_js.hasShapeProperties(element) && element.shapeStyle) {
16523
+ if (chunkWGHMMJOJ_js.hasShapeProperties(element) && element.shapeStyle) {
16524
16524
  const s = element.shapeStyle;
16525
16525
  result.shapeStyle = {
16526
16526
  fillColor: s.fillColor,
@@ -16549,7 +16549,7 @@ function copyFormatFromElement(element) {
16549
16549
  softEdgeRadius: s.softEdgeRadius
16550
16550
  };
16551
16551
  }
16552
- if (chunkYOOFW6LR_js.hasTextProperties(element) && element.textStyle) {
16552
+ if (chunkWGHMMJOJ_js.hasTextProperties(element) && element.textStyle) {
16553
16553
  const t = element.textStyle;
16554
16554
  result.textStyle = {
16555
16555
  fontFamily: t.fontFamily,
@@ -16580,7 +16580,7 @@ function definedEntries(obj) {
16580
16580
  }
16581
16581
  function applyFormatToElement(element, format) {
16582
16582
  let updated = { ...element };
16583
- if (format.shapeStyle && chunkYOOFW6LR_js.hasShapeProperties(updated)) {
16583
+ if (format.shapeStyle && chunkWGHMMJOJ_js.hasShapeProperties(updated)) {
16584
16584
  updated = {
16585
16585
  ...updated,
16586
16586
  shapeStyle: {
@@ -16589,7 +16589,7 @@ function applyFormatToElement(element, format) {
16589
16589
  }
16590
16590
  };
16591
16591
  }
16592
- if (format.textStyle && chunkYOOFW6LR_js.hasTextProperties(updated)) {
16592
+ if (format.textStyle && chunkWGHMMJOJ_js.hasTextProperties(updated)) {
16593
16593
  updated = {
16594
16594
  ...updated,
16595
16595
  textStyle: {
@@ -16604,7 +16604,7 @@ function hasCopyableFormat(element) {
16604
16604
  if (!element) {
16605
16605
  return false;
16606
16606
  }
16607
- return chunkYOOFW6LR_js.hasShapeProperties(element) || chunkYOOFW6LR_js.hasTextProperties(element);
16607
+ return chunkWGHMMJOJ_js.hasShapeProperties(element) || chunkWGHMMJOJ_js.hasTextProperties(element);
16608
16608
  }
16609
16609
  function copySegmentMetadata(from, to) {
16610
16610
  if (from.equationXml !== void 0) {
@@ -16741,7 +16741,7 @@ function getRoundRectRadiusPx(element) {
16741
16741
  return Math.min(Math.max(element.width, 1), Math.max(element.height, 1)) * 0.5 * normalizedAdjustment;
16742
16742
  }
16743
16743
  function getShapeAdjustmentHandleDescriptor(element) {
16744
- if (!chunkYOOFW6LR_js.hasShapeProperties(element)) {
16744
+ if (!chunkWGHMMJOJ_js.hasShapeProperties(element)) {
16745
16745
  return null;
16746
16746
  }
16747
16747
  const normalizedShapeType = String(element.shapeType || "").toLowerCase();
@@ -17750,7 +17750,7 @@ function createSyncGate(onOpen, graceMs = INITIAL_SYNC_GRACE_MS) {
17750
17750
  var POSITION_THRESHOLD = 2;
17751
17751
  var SIZE_THRESHOLD = 2;
17752
17752
  function getElementText(element) {
17753
- if (!chunkYOOFW6LR_js.hasTextProperties(element)) {
17753
+ if (!chunkWGHMMJOJ_js.hasTextProperties(element)) {
17754
17754
  return "";
17755
17755
  }
17756
17756
  if (element.textSegments && element.textSegments.length > 0) {
@@ -23102,7 +23102,7 @@ function getAriaRole(element) {
23102
23102
  case "model3d":
23103
23103
  return "img";
23104
23104
  case "shape": {
23105
- if (chunkYOOFW6LR_js.hasTextProperties(element) && element.text) {
23105
+ if (chunkWGHMMJOJ_js.hasTextProperties(element) && element.text) {
23106
23106
  return "group";
23107
23107
  }
23108
23108
  return "img";
@@ -23115,7 +23115,7 @@ function getAriaLabel(element) {
23115
23115
  if ((element.type === "image" || element.type === "picture") && "altText" in element && typeof element.altText === "string" && element.altText.trim()) {
23116
23116
  return element.altText.trim();
23117
23117
  }
23118
- if (chunkYOOFW6LR_js.hasTextProperties(element) && element.text) {
23118
+ if (chunkWGHMMJOJ_js.hasTextProperties(element) && element.text) {
23119
23119
  const text = element.text.trim();
23120
23120
  if (text) {
23121
23121
  return text.length > 120 ? `${text.slice(0, 117)}...` : text;
@@ -23522,7 +23522,7 @@ var DEFAULT_CHART_POSITION = { x: 120, y: 120, width: 480, height: 320 };
23522
23522
  var DEFAULT_CATEGORIES = ["Category 1", "Category 2", "Category 3"];
23523
23523
  var DEFAULT_SERIES_VALUES = [4, 3, 5];
23524
23524
  function createDefaultChartElement(chartType = DEFAULT_INSERT_CHART_TYPE, position) {
23525
- return chunkYOOFW6LR_js.createChartElement(
23525
+ return chunkWGHMMJOJ_js.createChartElement(
23526
23526
  chartType,
23527
23527
  {
23528
23528
  categories: [...DEFAULT_CATEGORIES],
@@ -24557,7 +24557,7 @@ function computeVirtualRange(totalItems, itemHeight, scrollTop, viewportHeight,
24557
24557
  };
24558
24558
  }
24559
24559
  function collectFontsFromElement(element, fonts) {
24560
- if (chunkYOOFW6LR_js.hasTextProperties(element)) {
24560
+ if (chunkWGHMMJOJ_js.hasTextProperties(element)) {
24561
24561
  if (element.textStyle?.fontFamily) {
24562
24562
  fonts.add(element.textStyle.fontFamily);
24563
24563
  }