@superdoc-dev/cli 0.17.0-next.39 → 0.17.0-next.40

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.
Files changed (2) hide show
  1. package/dist/index.js +1806 -436
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -69157,7 +69157,7 @@ var init_remark_gfm_BUJjZJLy_es = __esm(() => {
69157
69157
  emptyOptions2 = {};
69158
69158
  });
69159
69159
 
69160
- // ../../packages/superdoc/dist/chunks/SuperConverter-DQ2wMaLK.es.js
69160
+ // ../../packages/superdoc/dist/chunks/SuperConverter-5I229j_D.es.js
69161
69161
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
69162
69162
  const fieldValue = extension$1.config[field];
69163
69163
  if (typeof fieldValue === "function")
@@ -83838,6 +83838,34 @@ function extractLineEnds(spPr) {
83838
83838
  tail: tailConfig ?? undefined
83839
83839
  };
83840
83840
  }
83841
+ function extractShapeEffects(spPr) {
83842
+ const outerShadow = extractOuterShadowEffect(spPr);
83843
+ if (!outerShadow)
83844
+ return null;
83845
+ return { outerShadow };
83846
+ }
83847
+ function extractOuterShadowEffect(spPr) {
83848
+ const outerShdw = findChildByLocalName(findChildByLocalName(spPr?.elements, "effectLst")?.elements, "outerShdw");
83849
+ if (!outerShdw)
83850
+ return null;
83851
+ const colorResult = extractColorFromElement(outerShdw);
83852
+ if (!colorResult)
83853
+ return null;
83854
+ return stripUndefined({
83855
+ type: "outerShadow",
83856
+ blurRadius: finiteNumberOrZero(emuToPixels(outerShdw.attributes?.blurRad)),
83857
+ distance: finiteNumberOrZero(emuToPixels(outerShdw.attributes?.dist)),
83858
+ direction: finiteNumberOrZero(rotToDegrees(outerShdw.attributes?.dir)),
83859
+ color: colorResult.color,
83860
+ opacity: colorResult.alpha ?? 1
83861
+ });
83862
+ }
83863
+ function finiteNumberOrZero(value) {
83864
+ return Number.isFinite(value) ? value : 0;
83865
+ }
83866
+ function stripUndefined(value) {
83867
+ return Object.fromEntries(Object.entries(value).filter(([, fieldValue]) => fieldValue !== undefined));
83868
+ }
83841
83869
  function extractStrokeColor(spPr, style) {
83842
83870
  const ln = findChildByLocalName(spPr?.elements, "ln");
83843
83871
  if (ln) {
@@ -85479,6 +85507,26 @@ function resolveParagraphPropertiesForTextBox(paragraph2, params3) {
85479
85507
  nodes: [pPr]
85480
85508
  }) || {} : {}, false, false, null);
85481
85509
  }
85510
+ function extractTextBoxParagraphSpacing(paragraphProperties, { paragraphIndex, paragraphCount, spcFirstLastPara } = {}) {
85511
+ const spacing = paragraphProperties?.spacing;
85512
+ if (!spacing)
85513
+ return;
85514
+ const honorFirstLast = spcFirstLastPara === "1" || spcFirstLastPara === 1 || spcFirstLastPara === true || spcFirstLastPara === "true" || spcFirstLastPara === "on";
85515
+ const isFirst = paragraphIndex === 0;
85516
+ const isLast = paragraphCount != null && paragraphIndex === paragraphCount - 1;
85517
+ const result = {};
85518
+ if (typeof spacing.before === "number" && !(isFirst && !honorFirstLast)) {
85519
+ const px = twipsToPixels(spacing.before);
85520
+ if (typeof px === "number")
85521
+ result.before = px;
85522
+ }
85523
+ if (typeof spacing.after === "number" && !(isLast && !honorFirstLast)) {
85524
+ const px = twipsToPixels(spacing.after);
85525
+ if (typeof px === "number")
85526
+ result.after = px;
85527
+ }
85528
+ return result.before === undefined && result.after === undefined ? undefined : result;
85529
+ }
85482
85530
  function extractRunFormatting(rPr, paragraphProperties, params3) {
85483
85531
  const resolvedRunProperties = resolveRunProperties(params3, rPr ? translator$133.encode({
85484
85532
  ...params3,
@@ -85542,10 +85590,12 @@ function extractBodyPrProperties(bodyPr) {
85542
85590
  left: lIns * EMU_TO_PX
85543
85591
  };
85544
85592
  const wrap$1 = bodyPrAttrs["wrap"] || "square";
85593
+ const spcFirstLastPara = bodyPrAttrs["spcFirstLastPara"];
85545
85594
  return {
85546
85595
  verticalAlign,
85547
85596
  insets,
85548
- wrap: wrap$1
85597
+ wrap: wrap$1,
85598
+ spcFirstLastPara
85549
85599
  };
85550
85600
  }
85551
85601
  function isValidRelativeHeight(value) {
@@ -85935,14 +85985,13 @@ function handleImageNode$1(node3, params3, isAnchor) {
85935
85985
  left: positionHValue,
85936
85986
  horizontal: positionHValue,
85937
85987
  top: positionVValue
85938
- }, anchorData, wrap$1, isHidden);
85988
+ }, anchorData, wrap$1, extractEffectExtent(node3), isHidden);
85939
85989
  if (uri === "http://schemas.openxmlformats.org/drawingml/2006/chart")
85940
85990
  return handleChartDrawing(params3, node3, graphicData, size2, padding, marginOffset, anchorData, wrap$1, isAnchor);
85941
85991
  const picture = graphicData?.elements.find((el) => el.name === "pic:pic");
85942
85992
  if (!picture || !picture.elements)
85943
85993
  return null;
85944
- const blipFill = picture.elements.find((el) => el.name === "pic:blipFill");
85945
- const blip = findChildByLocalName(blipFill?.elements, "blip");
85994
+ const blip = findChildByLocalName(picture.elements.find((el) => el.name === "pic:blipFill")?.elements, "blip");
85946
85995
  if (!blip)
85947
85996
  return null;
85948
85997
  const hasGrayscale = someChildHasLocalName(blip.elements, "grayscl");
@@ -85954,23 +86003,7 @@ function handleImageNode$1(node3, params3, isAnchor) {
85954
86003
  ...Number.isFinite(rawContrast) ? { contrast: rawContrast } : {}
85955
86004
  } : undefined;
85956
86005
  const alphaModFix = extractAlphaModFix(blip);
85957
- const stretch = findChildByLocalName(blipFill?.elements, "stretch");
85958
- const fillRect = findChildByLocalName(stretch?.elements, "fillRect");
85959
- const srcRect = findChildByLocalName(blipFill?.elements, "srcRect");
85960
- const srcRectAttrs = srcRect?.attributes || {};
85961
- const clipPath = buildClipPathFromSrcRect(srcRectAttrs);
85962
- const srcRectHasNegativeValues = [
85963
- "l",
85964
- "t",
85965
- "r",
85966
- "b"
85967
- ].some((attr) => {
85968
- const val = srcRectAttrs[attr];
85969
- return val != null && parseFloat(val) < 0;
85970
- });
85971
- const shouldStretch = Boolean(stretch && fillRect);
85972
- const shouldCover = shouldStretch && !srcRectHasNegativeValues && !clipPath;
85973
- const shouldFillClippedStretch = shouldStretch && !srcRectHasNegativeValues && Boolean(clipPath);
86006
+ const { clipPath, rawSrcRect, shouldCover, shouldFillClippedStretch, shouldCoverShapeStretch, shapeClipPath } = extractPicturePresentation(picture);
85974
86007
  const spPr = picture.elements.find((el) => el.name === "pic:spPr");
85975
86008
  if (spPr) {
85976
86009
  const xfrm = findChildByLocalName(spPr.elements, "xfrm");
@@ -86090,9 +86123,10 @@ function handleImageNode$1(node3, params3, isAnchor) {
86090
86123
  ...wrap$1.type === "Square" && wrap$1.attrs.wrapText ? { wrapText: wrap$1.attrs.wrapText } : {},
86091
86124
  wrapTopAndBottom: wrap$1.type === "TopAndBottom",
86092
86125
  shouldCover,
86093
- ...shouldFillClippedStretch ? { objectFit: "fill" } : {},
86126
+ ...shouldFillClippedStretch ? { objectFit: "fill" } : shouldCoverShapeStretch ? { objectFit: "cover" } : {},
86094
86127
  ...clipPath ? { clipPath } : {},
86095
- rawSrcRect: srcRect,
86128
+ ...shapeClipPath ? { shapeClipPath } : {},
86129
+ rawSrcRect,
86096
86130
  originalPadding: {
86097
86131
  distT: attributes["distT"],
86098
86132
  distB: attributes["distB"],
@@ -86140,7 +86174,9 @@ function extractTextFromTextBox(textBoxContent, bodyPr, params3 = {}) {
86140
86174
  return null;
86141
86175
  const paragraphs = collectTextBoxParagraphs(preProcessTextBoxContent(textBoxContent, params3)?.elements || []);
86142
86176
  const textParts = [];
86177
+ const paragraphMetadata = [];
86143
86178
  let horizontalAlign = null;
86179
+ const { verticalAlign, insets, wrap: wrap$1, spcFirstLastPara } = extractBodyPrProperties(bodyPr);
86144
86180
  const appendFieldPart = (fieldType, node3, paragraphProperties) => {
86145
86181
  const rPr = node3?.elements?.find((el) => el.name === "w:rPr");
86146
86182
  const formatting = extractRunFormatting(rPr, paragraphProperties, params3);
@@ -86247,6 +86283,11 @@ function extractTextFromTextBox(textBoxContent, bodyPr, params3 = {}) {
86247
86283
  };
86248
86284
  paragraphs.forEach((paragraph2, paragraphIndex) => {
86249
86285
  const paragraphProperties = resolveParagraphPropertiesForTextBox(paragraph2, params3);
86286
+ paragraphMetadata.push({ spacing: extractTextBoxParagraphSpacing(paragraphProperties, {
86287
+ paragraphIndex,
86288
+ paragraphCount: paragraphs.length,
86289
+ spcFirstLastPara
86290
+ }) });
86250
86291
  if (!horizontalAlign)
86251
86292
  horizontalAlign = extractParagraphAlignment(paragraph2);
86252
86293
  let paragraphHasText = false;
@@ -86260,18 +86301,20 @@ function extractTextFromTextBox(textBoxContent, bodyPr, params3 = {}) {
86260
86301
  `,
86261
86302
  formatting: {},
86262
86303
  isLineBreak: true,
86263
- isEmptyParagraph: !paragraphHasText
86304
+ isEmptyParagraph: !paragraphHasText,
86305
+ isParagraphBoundary: true
86264
86306
  });
86265
86307
  });
86266
86308
  if (textParts.length === 0)
86267
86309
  return null;
86268
- const { verticalAlign, insets, wrap: wrap$1 } = extractBodyPrProperties(bodyPr);
86310
+ const hasParagraphSpacing = paragraphMetadata.some((paragraph2) => paragraph2.spacing);
86269
86311
  return {
86270
86312
  parts: textParts,
86271
86313
  horizontalAlign: horizontalAlign || "left",
86272
86314
  verticalAlign,
86273
86315
  insets,
86274
- wrap: wrap$1
86316
+ wrap: wrap$1,
86317
+ ...hasParagraphSpacing ? { paragraphs: paragraphMetadata } : {}
86275
86318
  };
86276
86319
  }
86277
86320
  function extractFieldInlineNodes(node3) {
@@ -86421,6 +86464,7 @@ function getVectorShape({ params: params3, node: node3, graphicData, size: size2
86421
86464
  const strokeColor = extractStrokeColor(spPr, style);
86422
86465
  const strokeWidth = extractStrokeWidth(spPr);
86423
86466
  const lineEnds = extractLineEnds(spPr);
86467
+ const effects = extractShapeEffects(spPr);
86424
86468
  const effectExtent = extractEffectExtent(node3);
86425
86469
  const textBoxContent = wsp.elements?.find((el) => el.name === "wps:txbx")?.elements?.find((el) => el.name === "w:txbxContent");
86426
86470
  const bodyPr = wsp.elements?.find((el) => el.name === "wps:bodyPr");
@@ -86444,6 +86488,7 @@ function getVectorShape({ params: params3, node: node3, graphicData, size: size2
86444
86488
  strokeColor,
86445
86489
  strokeWidth,
86446
86490
  lineEnds,
86491
+ effects,
86447
86492
  effectExtent,
86448
86493
  marginOffset,
86449
86494
  anchorData,
@@ -86477,6 +86522,7 @@ function getVectorShape({ params: params3, node: node3, graphicData, size: size2
86477
86522
  strokeColor,
86478
86523
  strokeWidth,
86479
86524
  lineEnds,
86525
+ effects,
86480
86526
  effectExtent,
86481
86527
  marginOffset,
86482
86528
  anchorData,
@@ -105707,7 +105753,7 @@ function isShapeGroupTransform(value) {
105707
105753
  if (!value || typeof value !== "object")
105708
105754
  return false;
105709
105755
  const maybe = value;
105710
- return isFiniteNumber(maybe.x) || isFiniteNumber(maybe.y) || isFiniteNumber(maybe.width) || isFiniteNumber(maybe.height) || isFiniteNumber(maybe.childWidth) || isFiniteNumber(maybe.childHeight) || isFiniteNumber(maybe.childX) || isFiniteNumber(maybe.childY);
105756
+ return isFiniteNumber(maybe.x) || isFiniteNumber(maybe.y) || isFiniteNumber(maybe.width) || isFiniteNumber(maybe.height) || isFiniteNumber(maybe.childWidth) || isFiniteNumber(maybe.childHeight) || isFiniteNumber(maybe.childX) || isFiniteNumber(maybe.childY) || isFiniteNumber(maybe.rotation) || maybe.flipH === true || maybe.flipV === true;
105711
105757
  }
105712
105758
  function normalizeShapeSize(value) {
105713
105759
  if (!value || typeof value !== "object")
@@ -105755,13 +105801,73 @@ function normalizeEffectExtent(value) {
105755
105801
  bottom: clamp(bottom)
105756
105802
  };
105757
105803
  }
105804
+ function normalizeShapeEffects(value) {
105805
+ if (!value || typeof value !== "object")
105806
+ return;
105807
+ const outerShadow = normalizeOuterShadowEffect(value.outerShadow);
105808
+ return outerShadow ? { outerShadow } : undefined;
105809
+ }
105810
+ function normalizeOuterShadowEffect(value) {
105811
+ if (!value || typeof value !== "object")
105812
+ return;
105813
+ const maybe = value;
105814
+ if (maybe.type !== "outerShadow")
105815
+ return;
105816
+ const blurRadius = coerceNumber(maybe.blurRadius);
105817
+ const distance2 = coerceNumber(maybe.distance);
105818
+ const direction = coerceNumber(maybe.direction);
105819
+ const opacity = coerceNumber(maybe.opacity);
105820
+ if (blurRadius == null || blurRadius < 0 || distance2 == null || distance2 < 0 || direction == null || opacity == null || typeof maybe.color !== "string")
105821
+ return;
105822
+ const clamp = (val) => Math.max(0, Math.min(1, val));
105823
+ const normalized = {
105824
+ type: "outerShadow",
105825
+ blurRadius,
105826
+ distance: distance2,
105827
+ direction,
105828
+ color: maybe.color,
105829
+ opacity: clamp(opacity)
105830
+ };
105831
+ return Object.fromEntries(Object.entries(normalized).filter(([, fieldValue]) => fieldValue !== undefined));
105832
+ }
105758
105833
  function normalizeShapeGroupChildren(value) {
105759
105834
  if (!Array.isArray(value))
105760
105835
  return [];
105761
- return value.filter((child) => {
105836
+ return value.flatMap((child) => {
105762
105837
  if (!child || typeof child !== "object")
105763
- return false;
105764
- return typeof child.shapeType === "string";
105838
+ return [];
105839
+ if (typeof child.shapeType !== "string")
105840
+ return [];
105841
+ const shapeChild = child;
105842
+ if (shapeChild.shapeType !== "vectorShape")
105843
+ return [shapeChild];
105844
+ const attrs = shapeChild.attrs;
105845
+ if (!attrs || typeof attrs !== "object")
105846
+ return [shapeChild];
105847
+ const rawAttrs = attrs;
105848
+ const normalizedAttrs = { ...rawAttrs };
105849
+ const normalizeAttr = (key, normalize$1) => {
105850
+ if (!(key in rawAttrs))
105851
+ return;
105852
+ const normalized = normalize$1(rawAttrs[key]);
105853
+ if (normalized !== undefined)
105854
+ normalizedAttrs[key] = normalized;
105855
+ else
105856
+ delete normalizedAttrs[key];
105857
+ };
105858
+ normalizeAttr("fillColor", normalizeFillColor);
105859
+ normalizeAttr("strokeColor", normalizeStrokeColor);
105860
+ normalizeAttr("strokeWidth", coerceNumber);
105861
+ normalizeAttr("lineEnds", normalizeLineEnds);
105862
+ normalizeAttr("effects", normalizeShapeEffects);
105863
+ normalizeAttr("textContent", normalizeTextContent);
105864
+ normalizeAttr("textAlign", (value$1) => typeof value$1 === "string" ? value$1 : undefined);
105865
+ normalizeAttr("textVerticalAlign", normalizeTextVerticalAlign);
105866
+ normalizeAttr("textInsets", normalizeTextInsets);
105867
+ return [{
105868
+ ...shapeChild,
105869
+ attrs: normalizedAttrs
105870
+ }];
105765
105871
  });
105766
105872
  }
105767
105873
  function normalizeMediaKey(value) {
@@ -106050,6 +106156,25 @@ function normalizeTextContent(value) {
106050
106156
  "right"
106051
106157
  ].includes(value.horizontalAlign))
106052
106158
  result.horizontalAlign = value.horizontalAlign;
106159
+ if (Array.isArray(value.paragraphs)) {
106160
+ const normalizedParagraphs = value.paragraphs.map((paragraph2) => {
106161
+ if (!isPlainObject3(paragraph2))
106162
+ return {};
106163
+ const spacing = isPlainObject3(paragraph2.spacing) ? paragraph2.spacing : undefined;
106164
+ const before2 = Number.isFinite(spacing?.before) ? spacing.before : undefined;
106165
+ const after2 = Number.isFinite(spacing?.after) ? spacing.after : undefined;
106166
+ if (before2 === undefined && after2 === undefined)
106167
+ return {};
106168
+ const out = { spacing: {} };
106169
+ if (before2 !== undefined)
106170
+ out.spacing.before = before2;
106171
+ if (after2 !== undefined)
106172
+ out.spacing.after = after2;
106173
+ return out;
106174
+ });
106175
+ if (normalizedParagraphs.some((paragraph2) => ("spacing" in paragraph2)))
106176
+ result.paragraphs = normalizedParagraphs;
106177
+ }
106053
106178
  return result;
106054
106179
  }
106055
106180
  function normalizeTextVerticalAlign(value) {
@@ -107722,6 +107847,10 @@ function imageNodeToRun({ node: node3, positions, sdtMetadata }) {
107722
107847
  run$1.title = attrs.title;
107723
107848
  if (typeof attrs.clipPath === "string")
107724
107849
  run$1.clipPath = attrs.clipPath;
107850
+ if (typeof attrs.shapeClipPath === "string")
107851
+ run$1.shapeClipPath = attrs.shapeClipPath;
107852
+ if (isAllowedObjectFit$1(attrs.objectFit))
107853
+ run$1.objectFit = attrs.objectFit;
107725
107854
  const distTop = pickNumber(wrapAttrs.distTop ?? wrapAttrs.distT);
107726
107855
  if (distTop != null)
107727
107856
  run$1.distTop = distTop;
@@ -107996,7 +108125,7 @@ function vectorShapeNodeToDrawingBlock(node3, nextBlockId, positions) {
107996
108125
  const rawAttrs = getAttrs$2(node3);
107997
108126
  if (isHiddenDrawing$1(rawAttrs))
107998
108127
  return null;
107999
- const effectExtent = normalizeEffectExtent(rawAttrs.effectExtent);
108128
+ const effectExtent = mergeEffectExtents(normalizeEffectExtent(rawAttrs.effectExtent), getRequiredVectorShapeEffectExtent(rawAttrs));
108000
108129
  const baseWidth = coercePositiveNumber(rawAttrs.width, 1);
108001
108130
  const baseHeight = coercePositiveNumber(rawAttrs.height, 1);
108002
108131
  const extraWidth = (effectExtent?.left ?? 0) + (effectExtent?.right ?? 0);
@@ -108020,16 +108149,23 @@ function shapeGroupNodeToDrawingBlock(node3, nextBlockId, positions) {
108020
108149
  const size2 = normalizeShapeSize(rawAttrs.size);
108021
108150
  const width = size2?.width ?? groupTransform?.width ?? 1;
108022
108151
  const height = size2?.height ?? groupTransform?.height ?? 1;
108152
+ const childCoordinateWidth = groupTransform?.width ?? width;
108153
+ const childCoordinateHeight = groupTransform?.height ?? height;
108154
+ const shapes = normalizeShapeGroupChildren(rawAttrs.shapes);
108155
+ const effectExtent = mergeEffectExtents(normalizeEffectExtent(rawAttrs.effectExtent), getRequiredGroupEffectExtentFromChildren(shapes, childCoordinateWidth, childCoordinateHeight));
108156
+ const extraWidth = (effectExtent?.left ?? 0) + (effectExtent?.right ?? 0);
108157
+ const extraHeight = (effectExtent?.top ?? 0) + (effectExtent?.bottom ?? 0);
108023
108158
  return buildDrawingBlock(rawAttrs, nextBlockId, positions, node3, {
108024
- width: coercePositiveNumber(width, 1),
108025
- height: coercePositiveNumber(height, 1),
108159
+ width: coercePositiveNumber(width + extraWidth, 1),
108160
+ height: coercePositiveNumber(height + extraHeight, 1),
108026
108161
  rotation: coerceNumber(rawAttrs.rotation) ?? 0,
108027
108162
  flipH: coerceBoolean(rawAttrs.flipH) ?? false,
108028
108163
  flipV: coerceBoolean(rawAttrs.flipV) ?? false
108029
108164
  }, "shapeGroup", {
108030
108165
  groupTransform,
108031
- shapes: normalizeShapeGroupChildren(rawAttrs.shapes),
108032
- size: size2
108166
+ shapes,
108167
+ size: size2,
108168
+ effectExtent
108033
108169
  });
108034
108170
  }
108035
108171
  function shapeContainerNodeToDrawingBlock(node3, nextBlockId, positions) {
@@ -108877,7 +109013,13 @@ function paragraphToFlowBlocks({ para, nextBlockId, positions, storyKey, tracked
108877
109013
  visitNode(child, [], undefined, undefined);
108878
109014
  });
108879
109015
  flushParagraph();
108880
- if (!blocks.some((block) => block.kind === "paragraph") && !suppressedByVanish && !paragraphProps.runProperties?.vanish)
109016
+ if (!blocks.some((block) => block.kind === "paragraph") && !suppressedByVanish && !paragraphProps.runProperties?.vanish) {
109017
+ let syntheticParagraphAttrs = deepClone2(paragraphAttrs);
109018
+ if (isSectPrMarker)
109019
+ if (syntheticParagraphAttrs)
109020
+ syntheticParagraphAttrs.sectPrMarker = true;
109021
+ else
109022
+ syntheticParagraphAttrs = { sectPrMarker: true };
108881
109023
  blocks.push({
108882
109024
  kind: "paragraph",
108883
109025
  id: baseBlockId,
@@ -108886,9 +109028,10 @@ function paragraphToFlowBlocks({ para, nextBlockId, positions, storyKey, tracked
108886
109028
  fontFamily: defaultFont,
108887
109029
  fontSize: defaultSize
108888
109030
  }],
108889
- attrs: deepClone2(paragraphAttrs),
109031
+ attrs: syntheticParagraphAttrs,
108890
109032
  sourceAnchor
108891
109033
  });
109034
+ }
108892
109035
  blocks.forEach((block) => {
108893
109036
  if (block.kind === "paragraph" && block.runs.length > 1)
108894
109037
  block.runs = mergeAdjacentRuns(block.runs);
@@ -118160,7 +118303,24 @@ var isRegExp = (value) => {
118160
118303
  return true;
118161
118304
  }, areAttrsEqual = (attrsA = {}, attrsB = {}) => {
118162
118305
  return objectIncludes(attrsA, attrsB);
118163
- }, TrackInsertMarkName = "trackInsert", TrackDeleteMarkName = "trackDelete", TrackFormatMarkName = "trackFormat", TrackedFormatMarkNames, TAB_POSITION_TOLERANCE_TWIPS = 20, OOXML_PCT_DIVISOR = 5000, TWIPS_PER_PX = 15, isPlainObject$3 = (value) => value !== null && typeof value === "object" && !Array.isArray(value), OOXML_Z_INDEX_BASE = 251658240, SPACE_CHARS, SUBSCRIPT_SUPERSCRIPT_SCALE = 0.65, BASELINE_SHIFT_EPSILON = 0.000001, isAtomicRunKind = (kind) => kind === "image" || kind === "lineBreak" || kind === "break" || kind === "tab" || kind === "fieldAnnotation", isImageLikeRun = (run$1) => {
118306
+ }, TrackInsertMarkName = "trackInsert", TrackDeleteMarkName = "trackDelete", TrackFormatMarkName = "trackFormat", TrackedFormatMarkNames, TAB_POSITION_TOLERANCE_TWIPS = 20, OOXML_PCT_DIVISOR = 5000, TWIPS_PER_PX = 15, isPlainObject$3 = (value) => value !== null && typeof value === "object" && !Array.isArray(value), OOXML_Z_INDEX_BASE = 251658240, resolveOuterShadowOffset = (shadow) => {
118307
+ const radians = shadow.direction * Math.PI / 180;
118308
+ return {
118309
+ dx: shadow.distance * Math.cos(radians),
118310
+ dy: shadow.distance * Math.sin(radians)
118311
+ };
118312
+ }, getOuterShadowStdDeviation = (shadow) => {
118313
+ return Math.max(0, shadow.blurRadius / 2);
118314
+ }, getOuterShadowPaintExtent = (shadow) => {
118315
+ const { dx, dy } = resolveOuterShadowOffset(shadow);
118316
+ const spread = getOuterShadowStdDeviation(shadow) * 3;
118317
+ return {
118318
+ left: Math.max(0, spread - dx),
118319
+ top: Math.max(0, spread - dy),
118320
+ right: Math.max(0, spread + dx),
118321
+ bottom: Math.max(0, spread + dy)
118322
+ };
118323
+ }, SPACE_CHARS, SUBSCRIPT_SUPERSCRIPT_SCALE = 0.65, BASELINE_SHIFT_EPSILON = 0.000001, isAtomicRunKind = (kind) => kind === "image" || kind === "lineBreak" || kind === "break" || kind === "tab" || kind === "fieldAnnotation", isImageLikeRun = (run$1) => {
118164
118324
  if (!run$1 || typeof run$1 !== "object")
118165
118325
  return false;
118166
118326
  return typeof run$1.src === "string";
@@ -124678,6 +124838,37 @@ var isRegExp = (value) => {
124678
124838
  const alphaModFix = findChildByLocalName(blip?.elements, "alphaModFix");
124679
124839
  const amt = Number(alphaModFix?.attributes?.amt);
124680
124840
  return Number.isFinite(amt) ? { amt } : undefined;
124841
+ }, buildShapeClipPathFromPreset = (preset) => {
124842
+ if (preset === "ellipse")
124843
+ return "ellipse(50% 50% at 50% 50%)";
124844
+ return null;
124845
+ }, extractPicturePresentation = (picture) => {
124846
+ const blipFill = picture?.elements?.find((el) => el.name === "pic:blipFill");
124847
+ const stretch = findChildByLocalName(blipFill?.elements, "stretch");
124848
+ const fillRect = findChildByLocalName(stretch?.elements, "fillRect");
124849
+ const srcRect = findChildByLocalName(blipFill?.elements, "srcRect");
124850
+ const srcRectAttrs = srcRect?.attributes || {};
124851
+ const clipPath = buildClipPathFromSrcRect(srcRectAttrs);
124852
+ const srcRectHasNegativeValues = [
124853
+ "l",
124854
+ "t",
124855
+ "r",
124856
+ "b"
124857
+ ].some((attr) => {
124858
+ const val = srcRectAttrs[attr];
124859
+ return val != null && parseFloat(val) < 0;
124860
+ });
124861
+ const spPr = picture?.elements?.find((el) => el.name === "pic:spPr");
124862
+ const shapeClipPath = buildShapeClipPathFromPreset(findChildByLocalName(spPr?.elements, "prstGeom")?.attributes?.["prst"]);
124863
+ const shouldStretch = Boolean(stretch && fillRect);
124864
+ return {
124865
+ clipPath,
124866
+ rawSrcRect: srcRect,
124867
+ shouldCover: shouldStretch && !srcRectHasNegativeValues && !clipPath,
124868
+ shouldFillClippedStretch: shouldStretch && !srcRectHasNegativeValues && Boolean(clipPath),
124869
+ shouldCoverShapeStretch: shouldStretch && Boolean(shapeClipPath) && !clipPath,
124870
+ shapeClipPath
124871
+ };
124681
124872
  }, mergeAnchorPaddingIntoWrapDistances = (wrap$1, padding) => {
124682
124873
  if (!wrap$1?.attrs || !padding)
124683
124874
  return;
@@ -124748,7 +124939,289 @@ var isRegExp = (value) => {
124748
124939
  if (placeholder?.attrs && isHidden)
124749
124940
  placeholder.attrs.hidden = true;
124750
124941
  return placeholder;
124751
- }, handleShapeGroup = (params3, node3, graphicData, size2, padding, marginOffset, anchorData, wrap$1, isHidden) => {
124942
+ }, parseEmuNumber = (value, fallback = 0) => {
124943
+ const numeric = Number(value);
124944
+ return Number.isFinite(numeric) ? numeric : fallback;
124945
+ }, getGroupXfrm = (groupNode) => {
124946
+ return findChildByLocalName(findChildByLocalName(groupNode?.elements, "grpSpPr")?.elements, "xfrm");
124947
+ }, buildShapeGroupTransformAttrs = (xfrm) => {
124948
+ const groupTransform = {};
124949
+ if (!xfrm)
124950
+ return groupTransform;
124951
+ if (xfrm.attributes?.["rot"])
124952
+ groupTransform.rotation = rotToDegrees(xfrm.attributes["rot"]);
124953
+ if (xfrm.attributes?.["flipH"] === "1")
124954
+ groupTransform.flipH = true;
124955
+ if (xfrm.attributes?.["flipV"] === "1")
124956
+ groupTransform.flipV = true;
124957
+ const off = findChildByLocalName(xfrm.elements, "off");
124958
+ const ext = findChildByLocalName(xfrm.elements, "ext");
124959
+ const chOff = findChildByLocalName(xfrm.elements, "chOff");
124960
+ const chExt = findChildByLocalName(xfrm.elements, "chExt");
124961
+ if (off) {
124962
+ groupTransform.x = emuToPixels(off.attributes?.["x"] || 0);
124963
+ groupTransform.y = emuToPixels(off.attributes?.["y"] || 0);
124964
+ }
124965
+ if (ext) {
124966
+ groupTransform.width = emuToPixels(ext.attributes?.["cx"] || 0);
124967
+ groupTransform.height = emuToPixels(ext.attributes?.["cy"] || 0);
124968
+ }
124969
+ if (chOff) {
124970
+ groupTransform.childX = emuToPixels(chOff.attributes?.["x"] || 0);
124971
+ groupTransform.childY = emuToPixels(chOff.attributes?.["y"] || 0);
124972
+ groupTransform.childOriginXEmu = parseEmuNumber(chOff.attributes?.["x"]);
124973
+ groupTransform.childOriginYEmu = parseEmuNumber(chOff.attributes?.["y"]);
124974
+ }
124975
+ if (chExt) {
124976
+ groupTransform.childWidth = emuToPixels(chExt.attributes?.["cx"] || 0);
124977
+ groupTransform.childHeight = emuToPixels(chExt.attributes?.["cy"] || 0);
124978
+ }
124979
+ return groupTransform;
124980
+ }, identityMatrix = () => ({
124981
+ a: 1,
124982
+ b: 0,
124983
+ c: 0,
124984
+ d: 1,
124985
+ e: 0,
124986
+ f: 0
124987
+ }), multiplyMatrix = (left, right) => ({
124988
+ a: left.a * right.a + left.c * right.b,
124989
+ b: left.b * right.a + left.d * right.b,
124990
+ c: left.a * right.c + left.c * right.d,
124991
+ d: left.b * right.c + left.d * right.d,
124992
+ e: left.a * right.e + left.c * right.f + left.e,
124993
+ f: left.b * right.e + left.d * right.f + left.f
124994
+ }), transformPoint = (matrix, x, y) => ({
124995
+ x: matrix.a * x + matrix.c * y + matrix.e,
124996
+ y: matrix.b * x + matrix.d * y + matrix.f
124997
+ }), normalizeDegrees = (degrees) => {
124998
+ const normalized = (degrees % 360 + 360) % 360;
124999
+ return Object.is(normalized, -0) ? 0 : normalized;
125000
+ }, decomposeMatrixOrientation = (matrix) => {
125001
+ if (matrix.a * matrix.d - matrix.b * matrix.c < 0)
125002
+ return {
125003
+ rotation: normalizeDegrees(Math.atan2(-matrix.b, -matrix.a) * 180 / Math.PI),
125004
+ flipH: true,
125005
+ flipV: false
125006
+ };
125007
+ return {
125008
+ rotation: normalizeDegrees(Math.atan2(matrix.b, matrix.a) * 180 / Math.PI),
125009
+ flipH: false,
125010
+ flipV: false
125011
+ };
125012
+ }, getVisualOrientationMatrix = ({ rotation = 0, flipH = false, flipV = false } = {}) => {
125013
+ const radians = rotation * Math.PI / 180;
125014
+ const cos = Math.cos(radians);
125015
+ const sin = Math.sin(radians);
125016
+ const flipScaleX = flipH ? -1 : 1;
125017
+ const flipScaleY = flipV ? -1 : 1;
125018
+ return {
125019
+ a: cos * flipScaleX,
125020
+ b: sin * flipScaleX,
125021
+ c: -sin * flipScaleY,
125022
+ d: cos * flipScaleY,
125023
+ e: 0,
125024
+ f: 0
125025
+ };
125026
+ }, getGroupAffineTransform = (xfrm, { includeVisualTransform = false } = {}) => {
125027
+ if (!xfrm)
125028
+ return {
125029
+ matrix: identityMatrix(),
125030
+ rotation: 0,
125031
+ flipH: false,
125032
+ flipV: false
125033
+ };
125034
+ const off = findChildByLocalName(xfrm.elements, "off");
125035
+ const ext = findChildByLocalName(xfrm.elements, "ext");
125036
+ const chOff = findChildByLocalName(xfrm.elements, "chOff");
125037
+ const chExt = findChildByLocalName(xfrm.elements, "chExt");
125038
+ const childWidth = parseEmuNumber(chExt?.attributes?.["cx"]);
125039
+ const childHeight = parseEmuNumber(chExt?.attributes?.["cy"]);
125040
+ const width = parseEmuNumber(ext?.attributes?.["cx"], childWidth || 0);
125041
+ const height = parseEmuNumber(ext?.attributes?.["cy"], childHeight || 0);
125042
+ const childX = parseEmuNumber(chOff?.attributes?.["x"]);
125043
+ const childY = parseEmuNumber(chOff?.attributes?.["y"]);
125044
+ const x = parseEmuNumber(off?.attributes?.["x"]);
125045
+ const y = parseEmuNumber(off?.attributes?.["y"]);
125046
+ const scaleX = childWidth !== 0 ? width / childWidth : 1;
125047
+ const scaleY = childHeight !== 0 ? height / childHeight : 1;
125048
+ const rotation = xfrm.attributes?.["rot"] ? rotToDegrees(xfrm.attributes["rot"]) : 0;
125049
+ const flipH = xfrm.attributes?.["flipH"] === "1";
125050
+ const flipV = xfrm.attributes?.["flipV"] === "1";
125051
+ const baseMatrix = {
125052
+ a: scaleX,
125053
+ b: 0,
125054
+ c: 0,
125055
+ d: scaleY,
125056
+ e: x - childX * scaleX,
125057
+ f: y - childY * scaleY
125058
+ };
125059
+ if (!includeVisualTransform || !rotation && !flipH && !flipV)
125060
+ return {
125061
+ matrix: baseMatrix,
125062
+ rotation: 0,
125063
+ flipH: false,
125064
+ flipV: false
125065
+ };
125066
+ const radians = rotation * Math.PI / 180;
125067
+ const cos = Math.cos(radians);
125068
+ const sin = Math.sin(radians);
125069
+ const flipScaleX = flipH ? -1 : 1;
125070
+ const flipScaleY = flipV ? -1 : 1;
125071
+ const centerX = x + width / 2;
125072
+ const centerY = y + height / 2;
125073
+ return {
125074
+ matrix: multiplyMatrix({
125075
+ a: cos * flipScaleX,
125076
+ b: sin * flipScaleX,
125077
+ c: -sin * flipScaleY,
125078
+ d: cos * flipScaleY,
125079
+ e: centerX - (cos * flipScaleX * centerX + -sin * flipScaleY * centerY),
125080
+ f: centerY - (sin * flipScaleX * centerX + cos * flipScaleY * centerY)
125081
+ }, baseMatrix),
125082
+ rotation,
125083
+ flipH,
125084
+ flipV
125085
+ };
125086
+ }, composeShapeGroupTransform = (parent, child) => {
125087
+ const matrix = multiplyMatrix(parent.matrix, child.matrix);
125088
+ return {
125089
+ matrix,
125090
+ ...decomposeMatrixOrientation(matrix)
125091
+ };
125092
+ }, composeShapeGroupChildOrientation = (rect, xfrm) => {
125093
+ return decomposeMatrixOrientation(multiplyMatrix(getVisualOrientationMatrix({
125094
+ rotation: rect.rotation ?? 0,
125095
+ flipH: Boolean(rect.flipH),
125096
+ flipV: Boolean(rect.flipV)
125097
+ }), getVisualOrientationMatrix({
125098
+ rotation: xfrm?.attributes?.["rot"] ? rotToDegrees(xfrm.attributes["rot"]) : 0,
125099
+ flipH: xfrm?.attributes?.["flipH"] === "1",
125100
+ flipV: xfrm?.attributes?.["flipV"] === "1"
125101
+ })));
125102
+ }, transformShapeGroupChildRect = (transform, rawX, rawY, rawWidth, rawHeight) => {
125103
+ const matrix = transform.matrix ?? identityMatrix();
125104
+ const width = Math.hypot(matrix.a, matrix.b) * rawWidth;
125105
+ const height = Math.hypot(matrix.c, matrix.d) * rawHeight;
125106
+ const center = transformPoint(matrix, rawX + rawWidth / 2, rawY + rawHeight / 2);
125107
+ return {
125108
+ x: emuToPixels(center.x - width / 2),
125109
+ y: emuToPixels(center.y - height / 2),
125110
+ width: emuToPixels(width),
125111
+ height: emuToPixels(height),
125112
+ rotation: transform.rotation ?? 0,
125113
+ flipH: Boolean(transform.flipH),
125114
+ flipV: Boolean(transform.flipV)
125115
+ };
125116
+ }, resolveShapeGroupPicturePath = (pic, params3) => {
125117
+ const blip = findChildByLocalName(findChildByLocalName(pic.elements, "blipFill")?.elements, "blip");
125118
+ if (!blip)
125119
+ return null;
125120
+ const rEmbed = blip.attributes?.["r:embed"];
125121
+ if (!rEmbed)
125122
+ return null;
125123
+ const currentFile = params3.filename || "document.xml";
125124
+ let rels = params3.docx[`word/_rels/${currentFile}.rels`];
125125
+ if (!rels)
125126
+ rels = params3.docx[`word/_rels/document.xml.rels`];
125127
+ const rel = rels?.elements.find((el) => el.name === "Relationships")?.elements?.find((el) => el.attributes["Id"] === rEmbed);
125128
+ if (!rel)
125129
+ return null;
125130
+ return normalizeTargetPath$1(rel.attributes?.["Target"]);
125131
+ }, parseShapeGroupVectorChild = (wsp, transform, params3) => {
125132
+ const spPr = findChildByLocalName(wsp.elements, "spPr");
125133
+ if (!spPr)
125134
+ return null;
125135
+ const shapeKind = findChildByLocalName(spPr.elements, "prstGeom")?.attributes?.["prst"];
125136
+ const customGeom = !shapeKind ? extractCustomGeometry(spPr) : null;
125137
+ const shapeXfrm = findChildByLocalName(spPr.elements, "xfrm");
125138
+ const shapeOff = findChildByLocalName(shapeXfrm?.elements, "off");
125139
+ const shapeExt = findChildByLocalName(shapeXfrm?.elements, "ext");
125140
+ const rect = transformShapeGroupChildRect(transform, parseEmuNumber(shapeOff?.attributes?.["x"]), parseEmuNumber(shapeOff?.attributes?.["y"]), parseEmuNumber(shapeExt?.attributes?.["cx"], 914400), parseEmuNumber(shapeExt?.attributes?.["cy"], 914400));
125141
+ const orientation = composeShapeGroupChildOrientation(rect, shapeXfrm);
125142
+ const style = findChildByLocalName(wsp.elements, "style");
125143
+ const fillColor = extractFillColor(spPr, style);
125144
+ const strokeColor = extractStrokeColor(spPr, style);
125145
+ const strokeWidth = extractStrokeWidth(spPr);
125146
+ const lineEnds = extractLineEnds(spPr);
125147
+ const effects = extractShapeEffects(spPr);
125148
+ const cNvPr = findChildByLocalName(wsp.elements, "cNvPr");
125149
+ const shapeId = cNvPr?.attributes?.["id"];
125150
+ const shapeName = cNvPr?.attributes?.["name"];
125151
+ const textBoxContent = findChildByLocalName(findChildByLocalName(wsp.elements, "txbx")?.elements, "txbxContent");
125152
+ const bodyPr = findChildByLocalName(wsp.elements, "bodyPr");
125153
+ const textContent = textBoxContent ? extractTextFromTextBox(textBoxContent, bodyPr, params3) : null;
125154
+ const textAlign = textContent?.horizontalAlign || "left";
125155
+ return {
125156
+ shapeType: "vectorShape",
125157
+ attrs: {
125158
+ kind: shapeKind,
125159
+ customGeometry: customGeom || undefined,
125160
+ ...rect,
125161
+ ...orientation,
125162
+ fillColor,
125163
+ strokeColor,
125164
+ strokeWidth,
125165
+ lineEnds,
125166
+ effects,
125167
+ shapeId,
125168
+ shapeName,
125169
+ textContent,
125170
+ textAlign,
125171
+ textVerticalAlign: textContent?.verticalAlign,
125172
+ textInsets: textContent?.insets
125173
+ }
125174
+ };
125175
+ }, parseShapeGroupImageChild = (pic, transform, params3) => {
125176
+ const spPr = findChildByLocalName(pic.elements, "spPr");
125177
+ if (!spPr)
125178
+ return null;
125179
+ const xfrm = findChildByLocalName(spPr.elements, "xfrm");
125180
+ const off = findChildByLocalName(xfrm?.elements, "off");
125181
+ const ext = findChildByLocalName(xfrm?.elements, "ext");
125182
+ const rect = transformShapeGroupChildRect(transform, parseEmuNumber(off?.attributes?.["x"]), parseEmuNumber(off?.attributes?.["y"]), parseEmuNumber(ext?.attributes?.["cx"], 914400), parseEmuNumber(ext?.attributes?.["cy"], 914400));
125183
+ const orientation = composeShapeGroupChildOrientation(rect, xfrm);
125184
+ const path2 = resolveShapeGroupPicturePath(pic, params3);
125185
+ if (!path2)
125186
+ return null;
125187
+ const alphaModFix = extractAlphaModFix(findChildByLocalName(findChildByLocalName(pic.elements, "blipFill")?.elements, "blip"));
125188
+ const cNvPr = findChildByLocalName(findChildByLocalName(pic.elements, "nvPicPr")?.elements, "cNvPr");
125189
+ const picId = cNvPr?.attributes?.["id"];
125190
+ const picName = cNvPr?.attributes?.["name"];
125191
+ const { clipPath, shouldCover, shouldFillClippedStretch, shouldCoverShapeStretch, shapeClipPath } = extractPicturePresentation(pic);
125192
+ return {
125193
+ shapeType: "image",
125194
+ attrs: {
125195
+ ...rect,
125196
+ ...orientation,
125197
+ src: path2,
125198
+ imageId: picId,
125199
+ imageName: picName,
125200
+ ...alphaModFix ? { alphaModFix } : {},
125201
+ ...clipPath ? { clipPath } : {},
125202
+ ...shapeClipPath ? { shapeClipPath } : {},
125203
+ ...shouldFillClippedStretch || shouldCoverShapeStretch ? { objectFit: shouldFillClippedStretch ? "fill" : "cover" } : shouldCover ? { objectFit: "cover" } : {}
125204
+ }
125205
+ };
125206
+ }, collectShapeGroupChildren = (groupNode, transform, params3) => {
125207
+ const children = [];
125208
+ for (const child of groupNode?.elements || []) {
125209
+ const localName = getLocalName$1(child?.name);
125210
+ if (localName === "wsp") {
125211
+ const shape = parseShapeGroupVectorChild(child, transform, params3);
125212
+ if (shape)
125213
+ children.push(shape);
125214
+ } else if (localName === "pic") {
125215
+ const picture = parseShapeGroupImageChild(child, transform, params3);
125216
+ if (picture)
125217
+ children.push(picture);
125218
+ } else if (localName === "grpSp") {
125219
+ const nestedTransform = composeShapeGroupTransform(transform, getGroupAffineTransform(getGroupXfrm(child), { includeVisualTransform: true }));
125220
+ children.push(...collectShapeGroupChildren(child, nestedTransform, params3));
125221
+ }
125222
+ }
125223
+ return children;
125224
+ }, handleShapeGroup = (params3, node3, graphicData, size2, padding, marginOffset, anchorData, wrap$1, effectExtent, isHidden) => {
124752
125225
  const wgp = graphicData.elements.find((el) => el.name === "wpg:wgp");
124753
125226
  if (!wgp) {
124754
125227
  const placeholder = buildShapePlaceholder(node3, size2, padding, marginOffset, "group");
@@ -124756,166 +125229,9 @@ var isRegExp = (value) => {
124756
125229
  placeholder.attrs.hidden = true;
124757
125230
  return placeholder;
124758
125231
  }
124759
- const xfrm = findChildByLocalName(wgp.elements.find((el) => el.name === "wpg:grpSpPr")?.elements, "xfrm");
124760
- const groupTransform = {};
124761
- if (xfrm) {
124762
- const off = findChildByLocalName(xfrm.elements, "off");
124763
- const ext = findChildByLocalName(xfrm.elements, "ext");
124764
- const chOff = findChildByLocalName(xfrm.elements, "chOff");
124765
- const chExt = findChildByLocalName(xfrm.elements, "chExt");
124766
- if (off) {
124767
- groupTransform.x = emuToPixels(off.attributes?.["x"] || 0);
124768
- groupTransform.y = emuToPixels(off.attributes?.["y"] || 0);
124769
- }
124770
- if (ext) {
124771
- groupTransform.width = emuToPixels(ext.attributes?.["cx"] || 0);
124772
- groupTransform.height = emuToPixels(ext.attributes?.["cy"] || 0);
124773
- }
124774
- if (chOff) {
124775
- groupTransform.childX = emuToPixels(chOff.attributes?.["x"] || 0);
124776
- groupTransform.childY = emuToPixels(chOff.attributes?.["y"] || 0);
124777
- groupTransform.childOriginXEmu = parseFloat(chOff.attributes?.["x"] || 0);
124778
- groupTransform.childOriginYEmu = parseFloat(chOff.attributes?.["y"] || 0);
124779
- }
124780
- if (chExt) {
124781
- groupTransform.childWidth = emuToPixels(chExt.attributes?.["cx"] || 0);
124782
- groupTransform.childHeight = emuToPixels(chExt.attributes?.["cy"] || 0);
124783
- }
124784
- }
124785
- const childShapes = wgp.elements.filter((el) => el.name === "wps:wsp");
124786
- const childPictures = wgp.elements.filter((el) => el.name === "pic:pic");
124787
- const shapes = childShapes.map((wsp) => {
124788
- const spPr = wsp.elements?.find((el) => el.name === "wps:spPr");
124789
- if (!spPr)
124790
- return null;
124791
- const shapeKind = findChildByLocalName(spPr.elements, "prstGeom")?.attributes?.["prst"];
124792
- const customGeom = !shapeKind ? extractCustomGeometry(spPr) : null;
124793
- const shapeXfrm = findChildByLocalName(spPr.elements, "xfrm");
124794
- const shapeOff = findChildByLocalName(shapeXfrm?.elements, "off");
124795
- const shapeExt = findChildByLocalName(shapeXfrm?.elements, "ext");
124796
- const rawX = shapeOff?.attributes?.["x"] ? parseFloat(shapeOff.attributes["x"]) : 0;
124797
- const rawY = shapeOff?.attributes?.["y"] ? parseFloat(shapeOff.attributes["y"]) : 0;
124798
- const rawWidth = shapeExt?.attributes?.["cx"] ? parseFloat(shapeExt.attributes["cx"]) : 914400;
124799
- const rawHeight = shapeExt?.attributes?.["cy"] ? parseFloat(shapeExt.attributes["cy"]) : 914400;
124800
- let x, y, width, height;
124801
- if (groupTransform.childWidth && groupTransform.childHeight) {
124802
- const scaleX = groupTransform.width / groupTransform.childWidth;
124803
- const scaleY = groupTransform.height / groupTransform.childHeight;
124804
- const childOriginX = groupTransform.childOriginXEmu || 0;
124805
- const childOriginY = groupTransform.childOriginYEmu || 0;
124806
- x = groupTransform.x + emuToPixels((rawX - childOriginX) * scaleX);
124807
- y = groupTransform.y + emuToPixels((rawY - childOriginY) * scaleY);
124808
- width = emuToPixels(rawWidth * scaleX);
124809
- height = emuToPixels(rawHeight * scaleY);
124810
- } else {
124811
- x = emuToPixels(rawX);
124812
- y = emuToPixels(rawY);
124813
- width = emuToPixels(rawWidth);
124814
- height = emuToPixels(rawHeight);
124815
- }
124816
- const rotation = shapeXfrm?.attributes?.["rot"] ? rotToDegrees(shapeXfrm.attributes["rot"]) : 0;
124817
- const flipH = shapeXfrm?.attributes?.["flipH"] === "1";
124818
- const flipV = shapeXfrm?.attributes?.["flipV"] === "1";
124819
- const style = wsp.elements?.find((el) => el.name === "wps:style");
124820
- const fillColor = extractFillColor(spPr, style);
124821
- const strokeColor = extractStrokeColor(spPr, style);
124822
- const strokeWidth = extractStrokeWidth(spPr);
124823
- const lineEnds = extractLineEnds(spPr);
124824
- const cNvPr = wsp.elements?.find((el) => el.name === "wps:cNvPr");
124825
- const shapeId = cNvPr?.attributes?.["id"];
124826
- const shapeName = cNvPr?.attributes?.["name"];
124827
- const textBoxContent = wsp.elements?.find((el) => el.name === "wps:txbx")?.elements?.find((el) => el.name === "w:txbxContent");
124828
- const bodyPr = wsp.elements?.find((el) => el.name === "wps:bodyPr");
124829
- let textContent = null;
124830
- if (textBoxContent)
124831
- textContent = extractTextFromTextBox(textBoxContent, bodyPr, params3);
124832
- const textAlign = textContent?.horizontalAlign || "left";
124833
- return {
124834
- shapeType: "vectorShape",
124835
- attrs: {
124836
- kind: shapeKind,
124837
- customGeometry: customGeom || undefined,
124838
- x,
124839
- y,
124840
- width,
124841
- height,
124842
- rotation,
124843
- flipH,
124844
- flipV,
124845
- fillColor,
124846
- strokeColor,
124847
- strokeWidth,
124848
- lineEnds,
124849
- shapeId,
124850
- shapeName,
124851
- textContent,
124852
- textAlign,
124853
- textVerticalAlign: textContent?.verticalAlign,
124854
- textInsets: textContent?.insets
124855
- }
124856
- };
124857
- }).filter(Boolean);
124858
- const allShapes = [...childPictures.map((pic) => {
124859
- const spPr = pic.elements?.find((el) => el.name === "pic:spPr");
124860
- if (!spPr)
124861
- return null;
124862
- const xfrm$1 = findChildByLocalName(spPr.elements, "xfrm");
124863
- const off = findChildByLocalName(xfrm$1?.elements, "off");
124864
- const ext = findChildByLocalName(xfrm$1?.elements, "ext");
124865
- const rawX = off?.attributes?.["x"] ? parseFloat(off.attributes["x"]) : 0;
124866
- const rawY = off?.attributes?.["y"] ? parseFloat(off.attributes["y"]) : 0;
124867
- const rawWidth = ext?.attributes?.["cx"] ? parseFloat(ext.attributes["cx"]) : 914400;
124868
- const rawHeight = ext?.attributes?.["cy"] ? parseFloat(ext.attributes["cy"]) : 914400;
124869
- let x, y, width, height;
124870
- if (groupTransform.childWidth && groupTransform.childHeight) {
124871
- const scaleX = groupTransform.width / groupTransform.childWidth;
124872
- const scaleY = groupTransform.height / groupTransform.childHeight;
124873
- const childOriginX = groupTransform.childOriginXEmu || 0;
124874
- const childOriginY = groupTransform.childOriginYEmu || 0;
124875
- x = groupTransform.x + emuToPixels((rawX - childOriginX) * scaleX);
124876
- y = groupTransform.y + emuToPixels((rawY - childOriginY) * scaleY);
124877
- width = emuToPixels(rawWidth * scaleX);
124878
- height = emuToPixels(rawHeight * scaleY);
124879
- } else {
124880
- x = emuToPixels(rawX);
124881
- y = emuToPixels(rawY);
124882
- width = emuToPixels(rawWidth);
124883
- height = emuToPixels(rawHeight);
124884
- }
124885
- const blipFill = pic.elements?.find((el) => el.name === "pic:blipFill");
124886
- const blip = findChildByLocalName(blipFill?.elements, "blip");
124887
- if (!blip)
124888
- return null;
124889
- const alphaModFix = extractAlphaModFix(blip);
124890
- const rEmbed = blip.attributes?.["r:embed"];
124891
- if (!rEmbed)
124892
- return null;
124893
- const currentFile = params3.filename || "document.xml";
124894
- let rels = params3.docx[`word/_rels/${currentFile}.rels`];
124895
- if (!rels)
124896
- rels = params3.docx[`word/_rels/document.xml.rels`];
124897
- const { elements } = rels?.elements.find((el) => el.name === "Relationships") || [];
124898
- const rel = elements?.find((el) => el.attributes["Id"] === rEmbed);
124899
- if (!rel)
124900
- return null;
124901
- const path2 = normalizeTargetPath$1(rel.attributes?.["Target"]);
124902
- const cNvPr = pic.elements?.find((el) => el.name === "pic:nvPicPr")?.elements?.find((el) => el.name === "pic:cNvPr");
124903
- const picId = cNvPr?.attributes?.["id"];
124904
- const picName = cNvPr?.attributes?.["name"];
124905
- return {
124906
- shapeType: "image",
124907
- attrs: {
124908
- x,
124909
- y,
124910
- width,
124911
- height,
124912
- src: path2,
124913
- imageId: picId,
124914
- imageName: picName,
124915
- ...alphaModFix ? { alphaModFix } : {}
124916
- }
124917
- };
124918
- }).filter(Boolean), ...shapes];
125232
+ const groupXfrm = getGroupXfrm(wgp);
125233
+ const groupTransform = buildShapeGroupTransformAttrs(groupXfrm);
125234
+ const allShapes = collectShapeGroupChildren(wgp, getGroupAffineTransform(groupXfrm), params3);
124919
125235
  const schemaAttrs = {};
124920
125236
  const drawingNode = params3.nodes?.[0];
124921
125237
  if (drawingNode?.name === DRAWING_XML_TAG)
@@ -124930,6 +125246,7 @@ var isRegExp = (value) => {
124930
125246
  size: size2,
124931
125247
  padding,
124932
125248
  marginOffset,
125249
+ effectExtent,
124933
125250
  anchorData,
124934
125251
  wrap: wrap$1,
124935
125252
  originalAttributes: node3?.attributes
@@ -135685,7 +136002,7 @@ Docs: https://docs.superdoc.dev/getting-started/fonts`);
135685
136002
  return children;
135686
136003
  }
135687
136004
  return [];
135688
- }, NON_RENDERED_STRUCTURAL_INLINE_TYPES, PARAGRAPH_CONTAINER_TYPES, NON_BREAKING_HYPHEN = "‑", DEFAULT_IMAGE_DIMENSION_PX = 100, isNodeHidden = (node3) => {
136005
+ }, NON_RENDERED_STRUCTURAL_INLINE_TYPES, PARAGRAPH_CONTAINER_TYPES, NON_BREAKING_HYPHEN = "‑", DEFAULT_IMAGE_DIMENSION_PX = 100, ALLOWED_OBJECT_FIT, isAllowedObjectFit$1 = (value) => typeof value === "string" && ALLOWED_OBJECT_FIT.has(value), isNodeHidden = (node3) => {
135689
136006
  const attrs = node3.attrs ?? {};
135690
136007
  if (attrs.hidden === true)
135691
136008
  return true;
@@ -136007,6 +136324,7 @@ Docs: https://docs.superdoc.dev/getting-started/fonts`);
136007
136324
  fillColor: normalizeFillColor(rawAttrs.fillColor),
136008
136325
  strokeColor: normalizeStrokeColor(rawAttrs.strokeColor),
136009
136326
  strokeWidth: coerceNumber(rawAttrs.strokeWidth),
136327
+ effects: normalizeShapeEffects(rawAttrs.effects),
136010
136328
  textContent: normalizeTextContent(rawAttrs.textContent),
136011
136329
  textAlign: typeof rawAttrs.textAlign === "string" ? rawAttrs.textAlign : undefined,
136012
136330
  textVerticalAlign: normalizeTextVerticalAlign(rawAttrs.textVerticalAlign),
@@ -136014,6 +136332,77 @@ Docs: https://docs.superdoc.dev/getting-started/fonts`);
136014
136332
  sourceAnchor,
136015
136333
  ...extraProps
136016
136334
  };
136335
+ }, mergeEffectExtents = (base$1, supplement) => {
136336
+ if (!base$1)
136337
+ return supplement;
136338
+ if (!supplement)
136339
+ return base$1;
136340
+ return {
136341
+ left: Math.max(base$1.left, supplement.left),
136342
+ top: Math.max(base$1.top, supplement.top),
136343
+ right: Math.max(base$1.right, supplement.right),
136344
+ bottom: Math.max(base$1.bottom, supplement.bottom)
136345
+ };
136346
+ }, hasEffectExtent = (extent) => {
136347
+ return !!extent && (extent.left > 0 || extent.top > 0 || extent.right > 0 || extent.bottom > 0);
136348
+ }, getCenteredStrokeHalfExtent = (attrs) => {
136349
+ if (!("fillColor" in attrs))
136350
+ return 0;
136351
+ if ("lineEnds" in attrs && attrs.lineEnds)
136352
+ return 0;
136353
+ if (attrs.strokeColor === null)
136354
+ return 0;
136355
+ const strokeWidth = pickNumber(attrs.strokeWidth) ?? 1;
136356
+ return strokeWidth > 0 ? strokeWidth / 2 : 0;
136357
+ }, getShapeGroupChildStrokeExtent = (child) => {
136358
+ if (child.shapeType !== "vectorShape" || !isPlainObject3(child.attrs))
136359
+ return 0;
136360
+ return getCenteredStrokeHalfExtent(child.attrs);
136361
+ }, getOuterShadowPaintExtent$1 = (attrs) => {
136362
+ if ("lineEnds" in attrs && attrs.lineEnds)
136363
+ return;
136364
+ const shadow = normalizeShapeEffects(attrs.effects)?.outerShadow;
136365
+ if (!shadow)
136366
+ return;
136367
+ const extent = getOuterShadowPaintExtent(shadow);
136368
+ return hasEffectExtent(extent) ? extent : undefined;
136369
+ }, getRequiredVectorShapeEffectExtent = (attrs) => {
136370
+ const strokeExtent = getCenteredStrokeHalfExtent(attrs);
136371
+ return mergeEffectExtents(strokeExtent > 0 ? {
136372
+ left: strokeExtent,
136373
+ top: strokeExtent,
136374
+ right: strokeExtent,
136375
+ bottom: strokeExtent
136376
+ } : undefined, getOuterShadowPaintExtent$1(attrs));
136377
+ }, getRequiredGroupEffectExtentFromChildren = (children, width, height) => {
136378
+ const required = {
136379
+ left: 0,
136380
+ top: 0,
136381
+ right: 0,
136382
+ bottom: 0
136383
+ };
136384
+ for (const child of children) {
136385
+ if (child.shapeType !== "vectorShape" || !isPlainObject3(child.attrs))
136386
+ continue;
136387
+ const strokeExtent = getShapeGroupChildStrokeExtent(child);
136388
+ const paintExtent = mergeEffectExtents(strokeExtent > 0 ? {
136389
+ left: strokeExtent,
136390
+ top: strokeExtent,
136391
+ right: strokeExtent,
136392
+ bottom: strokeExtent
136393
+ } : undefined, getOuterShadowPaintExtent$1(child.attrs));
136394
+ if (!paintExtent)
136395
+ continue;
136396
+ const childX = pickNumber(child.attrs.x) ?? 0;
136397
+ const childY = pickNumber(child.attrs.y) ?? 0;
136398
+ const childWidth = pickNumber(child.attrs.width) ?? 0;
136399
+ const childHeight = pickNumber(child.attrs.height) ?? 0;
136400
+ required.left = Math.max(required.left, Math.max(0, paintExtent.left - childX));
136401
+ required.top = Math.max(required.top, Math.max(0, paintExtent.top - childY));
136402
+ required.right = Math.max(required.right, Math.max(0, childX + childWidth + paintExtent.right - width));
136403
+ required.bottom = Math.max(required.bottom, Math.max(0, childY + childHeight + paintExtent.bottom - height));
136404
+ }
136405
+ return hasEffectExtent(required) ? required : undefined;
136017
136406
  }, getAttrs$1 = (node3) => {
136018
136407
  return isPlainObject3(node3.attrs) ? { ...node3.attrs } : {};
136019
136408
  }, parseFullWidth = (value) => {
@@ -137316,7 +137705,7 @@ Docs: https://docs.superdoc.dev/getting-started/fonts`);
137316
137705
  state.kern = kernNode.attributes["w:val"];
137317
137706
  }
137318
137707
  }, SuperConverter;
137319
- var init_SuperConverter_DQ2wMaLK_es = __esm(() => {
137708
+ var init_SuperConverter_5I229j_D_es = __esm(() => {
137320
137709
  init_rolldown_runtime_Bg48TavK_es();
137321
137710
  init_jszip_C49i9kUs_es();
137322
137711
  init_xml_js_CqGKpaft_es();
@@ -164760,6 +165149,12 @@ var init_SuperConverter_DQ2wMaLK_es = __esm(() => {
164760
165149
  "index",
164761
165150
  "tableOfAuthorities"
164762
165151
  ]);
165152
+ ALLOWED_OBJECT_FIT = new Set([
165153
+ "contain",
165154
+ "cover",
165155
+ "fill",
165156
+ "scale-down"
165157
+ ]);
164763
165158
  VERTICAL_ELEMENTS = {
164764
165159
  "m:f": 0.6,
164765
165160
  "m:bar": 0.25,
@@ -166325,7 +166720,7 @@ var init_SuperConverter_DQ2wMaLK_es = __esm(() => {
166325
166720
  };
166326
166721
  });
166327
166722
 
166328
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-BhSfQYaO.es.js
166723
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-CJ0cxWlH.es.js
166329
166724
  function parseSizeUnit(val = "0") {
166330
166725
  const length3 = val.toString() || "0";
166331
166726
  const value = Number.parseFloat(length3);
@@ -177068,9 +177463,9 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, MARK_KEYS, STEP_OP_CATALOG_UNFROZEN2, P
177068
177463
  }
177069
177464
  };
177070
177465
  };
177071
- var init_create_headless_toolbar_BhSfQYaO_es = __esm(() => {
177466
+ var init_create_headless_toolbar_CJ0cxWlH_es = __esm(() => {
177072
177467
  init_rolldown_runtime_Bg48TavK_es();
177073
- init_SuperConverter_DQ2wMaLK_es();
177468
+ init_SuperConverter_5I229j_D_es();
177074
177469
  init_jszip_C49i9kUs_es();
177075
177470
  init_uuid_B2wVPhPi_es();
177076
177471
  init_constants_D9qj59G2_es();
@@ -227164,7 +227559,7 @@ var init_remark_gfm_DCND_V_3_es = __esm(() => {
227164
227559
  init_remark_gfm_BUJjZJLy_es();
227165
227560
  });
227166
227561
 
227167
- // ../../packages/superdoc/dist/chunks/src-CR8eXLKh.es.js
227562
+ // ../../packages/superdoc/dist/chunks/src-H1-ZZyp0.es.js
227168
227563
  function deleteProps(obj, propOrProps) {
227169
227564
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
227170
227565
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -233430,11 +233825,25 @@ function x0(t, n, o) {
233430
233825
  paths: l.paths
233431
233826
  } : null;
233432
233827
  }
233828
+ function W0(t, n, o) {
233829
+ let L = Math.max(0, Number(t) || 0), e = Math.max(0, Number(n) || 0), l = Math.min(L, e) * (16667 / 1e5), r$1 = Math.max(0, L - l), i3 = Math.max(0, e - l);
233830
+ return {
233831
+ preset: "roundRect",
233832
+ viewBox: `0 0 ${L} ${e}`,
233833
+ paths: l0([{
233834
+ d: `M 0 ${l} A ${l} ${l} 0 0 1 ${l} 0 L ${r$1} 0 A ${l} ${l} 0 0 1 ${L} ${l} L ${L} ${i3} A ${l} ${l} 0 0 1 ${r$1} ${e} L ${l} ${e} A ${l} ${l} 0 0 1 0 ${i3} Z`,
233835
+ fill: "#000000",
233836
+ stroke: "#000000"
233837
+ }], o)
233838
+ };
233839
+ }
233433
233840
  function i0(t) {
233434
233841
  let { preset: n, styleOverrides: o, width: L, height: e } = t;
233435
233842
  if (!n)
233436
233843
  throw new Error("createPresetShape requires a preset name.");
233437
- if (F.has(n) && L != null && e != null && L !== e) {
233844
+ if (n === "roundRect" && L != null && e != null)
233845
+ return W0(L, e, o);
233846
+ if (F.has(n) && L != null && e != null && (L !== e || n === "leftUpArrow")) {
233438
233847
  let i3 = x0(n, L, e);
233439
233848
  if (i3)
233440
233849
  return {
@@ -271477,6 +271886,19 @@ function calculateFirstLineIndent(block, measure) {
271477
271886
  const gutterWidthRaw = measure.marker.gutterWidth ?? 0;
271478
271887
  return markerWidth + (Number.isFinite(gutterWidthRaw) && gutterWidthRaw >= 0 ? gutterWidthRaw : 0);
271479
271888
  }
271889
+ function getSuppressedMarkerImageGroupAnchorOffset(entry, suppressVisibleSectPrMarkerParagraph, hasPageRelativeAnchorForParagraph, markerSpacingBefore) {
271890
+ if (!suppressVisibleSectPrMarkerParagraph || !hasPageRelativeAnchorForParagraph)
271891
+ return 0;
271892
+ if (entry.block.kind !== "drawing" || entry.block.drawingKind !== "shapeGroup")
271893
+ return 0;
271894
+ if (!entry.block.shapes?.some((child) => child.shapeType === "image"))
271895
+ return 0;
271896
+ if ((entry.block.anchor?.vRelativeFrom ?? "paragraph") !== "paragraph")
271897
+ return 0;
271898
+ if (entry.block.anchor?.alignV && entry.block.anchor.alignV !== "top")
271899
+ return 0;
271900
+ return Math.max(0, markerSpacingBefore / 2);
271901
+ }
271480
271902
  function layoutParagraphBlock(ctx$1, anchors) {
271481
271903
  const { block, measure, columnWidth, ensurePage, advanceColumn, columnX, floatManager } = ctx$1;
271482
271904
  const remeasureParagraph$1 = ctx$1.remeasureParagraph;
@@ -271513,6 +271935,13 @@ function layoutParagraphBlock(ctx$1, anchors) {
271513
271935
  if (!spacingExplicit.after)
271514
271936
  spacingAfter = 0;
271515
271937
  }
271938
+ const markerSpacingBefore = spacingBefore;
271939
+ const hasAnchoredObjects = Boolean(anchors?.anchoredDrawings?.length || anchors?.anchoredTables?.length);
271940
+ const suppressVisibleSectPrMarkerParagraph = attrs?.sectPrMarker === true && emptyTextParagraph && hasAnchoredObjects;
271941
+ if (suppressVisibleSectPrMarkerParagraph) {
271942
+ spacingBefore = 0;
271943
+ spacingAfter = 0;
271944
+ }
271516
271945
  const baseSpacingBefore = spacingBefore;
271517
271946
  let appliedSpacingBefore = spacingBefore === 0;
271518
271947
  let lastState = null;
@@ -271531,7 +271960,11 @@ function layoutParagraphBlock(ctx$1, anchors) {
271531
271960
  suppressSpacingBefore: shouldSuppressOwnSpacing(styleId$1, contextualSpacing, previewState.lastParagraphStyleId),
271532
271961
  rewindTrailingFromPrevious: shouldSuppressOwnSpacing(previewState.lastParagraphStyleId, previewState.lastParagraphContextualSpacing, styleId$1)
271533
271962
  }) + borderExpansion.top - (inBorderGroup ? rawBorderExpansion.bottom : 0);
271963
+ const sectionBaseTopMargin = anchors?.sectionBaseTopMargin;
271964
+ const sectionHeaderDistance = typeof anchors?.sectionHeaderDistance === "number" ? Math.max(0, anchors.sectionHeaderDistance) : 0;
271965
+ const effectiveParagraphAnchorBaseY = suppressVisibleSectPrMarkerParagraph && typeof sectionBaseTopMargin === "number" && anchors?.hasPageRelativeAnchorForParagraph !== true && Math.abs(previewState.cursorY - previewState.topMargin) < 0.001 && Math.abs(paragraphAnchorBaseY - previewState.topMargin) < 0.001 ? Math.min(sectionBaseTopMargin + sectionHeaderDistance, paragraphAnchorBaseY) : paragraphAnchorBaseY;
271534
271966
  let paragraphContentEndY = paragraphAnchorBaseY;
271967
+ const anchorFirstLineHeight = suppressVisibleSectPrMarkerParagraph ? 0 : measure.lines?.[0]?.lineHeight ?? 0;
271535
271968
  const registerAnchoredDrawingsAt = (paragraphContentStartY) => {
271536
271969
  if (!anchors?.anchoredDrawings?.length)
271537
271970
  return;
@@ -271541,14 +271974,15 @@ function layoutParagraphBlock(ctx$1, anchors) {
271541
271974
  const state = ensurePage();
271542
271975
  const contentTop = state.topMargin;
271543
271976
  const contentBottom = state.contentBottom;
271977
+ const anchorParagraphY = paragraphContentStartY + getSuppressedMarkerImageGroupAnchorOffset(entry, suppressVisibleSectPrMarkerParagraph, anchors.hasPageRelativeAnchorForParagraph === true, markerSpacingBefore);
271544
271978
  const anchorY = resolveAnchoredGraphicY({
271545
271979
  anchor: entry.block.anchor,
271546
271980
  objectHeight: entry.measure.height,
271547
271981
  contentTop,
271548
271982
  contentBottom,
271549
271983
  pageBottomMargin: anchors.pageMargins.bottom ?? 0,
271550
- anchorParagraphY: paragraphContentStartY,
271551
- firstLineHeight: measure.lines?.[0]?.lineHeight ?? 0
271984
+ anchorParagraphY,
271985
+ firstLineHeight: anchorFirstLineHeight
271552
271986
  });
271553
271987
  floatManager.registerDrawing(entry.block, entry.measure, anchorY, state.columnIndex, state.page.number);
271554
271988
  const anchorX = entry.block.anchor ? resolveAnchoredGraphicX(entry.block.anchor, state.columnIndex, anchors.columns, entry.measure.width, {
@@ -271627,7 +272061,7 @@ function layoutParagraphBlock(ctx$1, anchors) {
271627
272061
  anchors.placedAnchoredIds.add(entry.block.id);
271628
272062
  }
271629
272063
  };
271630
- registerAnchoredDrawingsAt(paragraphAnchorBaseY);
272064
+ registerAnchoredDrawingsAt(effectiveParagraphAnchorBaseY);
271631
272065
  const registerAnchoredTablesAt = (paragraphContentStartY, entries2) => {
271632
272066
  if (!entries2.length)
271633
272067
  return;
@@ -271643,7 +272077,7 @@ function layoutParagraphBlock(ctx$1, anchors) {
271643
272077
  const contentTop = state.topMargin;
271644
272078
  const contentBottom = state.contentBottom;
271645
272079
  const layoutOffsetV = entry.layoutOffsetV;
271646
- const firstLineHeight = measure.lines?.[0]?.lineHeight ?? 0;
272080
+ const firstLineHeight = anchorFirstLineHeight;
271647
272081
  const wrapType = entry.block.wrap?.type ?? "None";
271648
272082
  const anchorY = resolveAnchoredGraphicY({
271649
272083
  anchor: graphicAnchorY(anchorForLineScopedFormField(layoutOffsetV != null && entry.block.anchor ? {
@@ -271655,7 +272089,7 @@ function layoutParagraphBlock(ctx$1, anchors) {
271655
272089
  contentBottom,
271656
272090
  pageBottomMargin: anchors.pageMargins.bottom ?? 0,
271657
272091
  anchorParagraphY: nextStackY,
271658
- firstLineHeight: measure.lines?.[0]?.lineHeight ?? 0
272092
+ firstLineHeight: anchorFirstLineHeight
271659
272093
  });
271660
272094
  floatManager.registerTable(entry.block, entry.measure, anchorY, state.columnIndex, state.page.number);
271661
272095
  const anchorX = entry.block.anchor ? resolveAnchoredGraphicX(graphicAnchorH(entry.block.anchor), state.columnIndex, anchors.columns, totalWidth, {
@@ -271676,11 +272110,15 @@ function layoutParagraphBlock(ctx$1, anchors) {
271676
272110
  const remainingHeightOnStartPage = previewState.contentBottom - paragraphAnchorBaseY;
271677
272111
  const paragraphWillSpanPages = lines.length > 1 && totalLineHeight > remainingHeightOnStartPage;
271678
272112
  const shouldPreLayoutSquareTable = (entry) => entry.lineScopedOnAnchor === true && !paragraphWillSpanPages;
271679
- registerAnchoredTablesAt(paragraphAnchorBaseY, anchoredTablesForPara.filter((entry) => {
272113
+ registerAnchoredTablesAt(effectiveParagraphAnchorBaseY, anchoredTablesForPara.filter((entry) => {
271680
272114
  if ((entry.block.wrap?.type ?? "None") === "None")
271681
272115
  return true;
271682
272116
  return shouldPreLayoutSquareTable(entry);
271683
272117
  }));
272118
+ if (suppressVisibleSectPrMarkerParagraph) {
272119
+ registerAnchoredTablesAt(effectiveParagraphAnchorBaseY, anchors?.anchoredTables ?? []);
272120
+ return;
272121
+ }
271684
272122
  if (frame?.wrap === "none") {
271685
272123
  let state = ensurePage();
271686
272124
  if (state.cursorY >= state.contentBottom)
@@ -272141,6 +272579,34 @@ function collectPreRegisteredAnchors(blocks2, measures) {
272141
272579
  }
272142
272580
  return result;
272143
272581
  }
272582
+ function collectPageRelativeAnchorsByParagraph(blocks2, measures) {
272583
+ const map$12 = /* @__PURE__ */ new Map;
272584
+ const len2 = Math.min(blocks2.length, measures.length);
272585
+ const paragraphIndexById = buildParagraphIndexById(blocks2, len2);
272586
+ for (let i3 = 0;i3 < len2; i3 += 1) {
272587
+ const block = blocks2[i3];
272588
+ const measure = measures[i3];
272589
+ const isImage = block.kind === "image" && measure?.kind === "image";
272590
+ const isDrawing = block.kind === "drawing" && measure?.kind === "drawing";
272591
+ if (!isImage && !isDrawing)
272592
+ continue;
272593
+ const drawingBlock = block;
272594
+ const drawingMeasure = measure;
272595
+ if (!drawingBlock.anchor?.isAnchored || !isPageRelativeAnchor(drawingBlock))
272596
+ continue;
272597
+ const anchorParagraphId = typeof drawingBlock.attrs === "object" && drawingBlock.attrs ? drawingBlock.attrs.anchorParagraphId : undefined;
272598
+ const anchorParaIndex = resolveAnchorParagraphIndex(blocks2, len2, paragraphIndexById, i3, anchorParagraphId);
272599
+ if (anchorParaIndex == null)
272600
+ continue;
272601
+ const list5 = map$12.get(anchorParaIndex) ?? [];
272602
+ list5.push({
272603
+ block: drawingBlock,
272604
+ measure: drawingMeasure
272605
+ });
272606
+ map$12.set(anchorParaIndex, list5);
272607
+ }
272608
+ return map$12;
272609
+ }
272144
272610
  function collectAnchoredDrawings(blocks2, measures) {
272145
272611
  const byParagraph = /* @__PURE__ */ new Map;
272146
272612
  const withoutParagraph = [];
@@ -274083,7 +274549,58 @@ function layoutDocument(blocks2, measures, options = {}) {
274083
274549
  const paragraphlessAnchoredTables = anchoredTables.withoutParagraph;
274084
274550
  const placedAnchoredIds = /* @__PURE__ */ new Set;
274085
274551
  const preRegisteredAnchors = collectPreRegisteredAnchors(blocks2, measures);
274086
- const preRegisteredPositions = /* @__PURE__ */ new Map;
274552
+ const pageRelativeAnchorsByParagraph = collectPageRelativeAnchorsByParagraph(blocks2, measures);
274553
+ const preRegisteredAnchorIds = /* @__PURE__ */ new Set;
274554
+ const blockIndexById = new Map(blocks2.map((candidateBlock, candidateIndex) => [candidateBlock.id, candidateIndex]));
274555
+ const hasHardBreakBetween = (startIndex, endIndex) => {
274556
+ const first$1 = Math.min(startIndex, endIndex) + 1;
274557
+ const last2 = Math.max(startIndex, endIndex);
274558
+ for (let candidateIndex = first$1;candidateIndex < last2; candidateIndex += 1) {
274559
+ const candidateBlock = blocks2[candidateIndex];
274560
+ if (candidateBlock.kind === "pageBreak" || candidateBlock.kind === "sectionBreak" || candidateBlock.kind === "columnBreak")
274561
+ return true;
274562
+ }
274563
+ return false;
274564
+ };
274565
+ const shouldWrapParagraphWithPageRelativeAnchor = (anchorBlock, paragraphIndex, paragraphId) => {
274566
+ const anchorParagraphId = anchorBlock.attrs != null && typeof anchorBlock.attrs === "object" ? anchorBlock.attrs.anchorParagraphId : undefined;
274567
+ if (typeof anchorParagraphId === "string")
274568
+ return anchorParagraphId === paragraphId;
274569
+ const anchorIndex = blockIndexById.get(anchorBlock.id);
274570
+ if (anchorIndex == null || anchorIndex === paragraphIndex)
274571
+ return false;
274572
+ return !hasHardBreakBetween(paragraphIndex, anchorIndex);
274573
+ };
274574
+ const isWrappingDrawingAnchor = (anchorBlock) => {
274575
+ const wrapType = anchorBlock.wrap?.type ?? "None";
274576
+ return wrapType !== "None" && wrapType !== "Inline";
274577
+ };
274578
+ const collectLaterPageRelativeAnchorsForParagraph = (paragraphIndex, paragraphId) => {
274579
+ const anchors = [];
274580
+ for (const entry of preRegisteredAnchors) {
274581
+ const anchorIndex = blockIndexById.get(entry.block.id);
274582
+ if (anchorIndex == null || anchorIndex <= paragraphIndex)
274583
+ continue;
274584
+ if (!isWrappingDrawingAnchor(entry.block))
274585
+ continue;
274586
+ if (!shouldWrapParagraphWithPageRelativeAnchor(entry.block, paragraphIndex, paragraphId))
274587
+ continue;
274588
+ anchors.push(entry);
274589
+ }
274590
+ return anchors.length > 0 ? anchors : undefined;
274591
+ };
274592
+ const mergeAnchoredDrawings = (...groups) => {
274593
+ const merged = [];
274594
+ const seen = /* @__PURE__ */ new Set;
274595
+ for (const group of groups)
274596
+ for (const entry of group ?? []) {
274597
+ if (seen.has(entry.block.id))
274598
+ continue;
274599
+ seen.add(entry.block.id);
274600
+ merged.push(entry);
274601
+ }
274602
+ return merged.length > 0 ? merged : undefined;
274603
+ };
274087
274604
  const resolveParagraphlessAnchoredTableY = (block, measure, state) => {
274088
274605
  const contentTop = state.topMargin;
274089
274606
  const contentBottom = state.contentBottom;
@@ -274097,40 +274614,36 @@ function layoutDocument(blocks2, measures, options = {}) {
274097
274614
  preRegisteredFallbackToContentTop: true
274098
274615
  });
274099
274616
  };
274100
- const resolveParagraphlessAnchoredDrawingY = (block, measure, state) => resolveAnchoredGraphicY({
274101
- anchor: block.anchor,
274102
- objectHeight: measure.height ?? 0,
274103
- contentTop: state.topMargin,
274104
- contentBottom: state.contentBottom,
274105
- pageBottomMargin: state.page.margins?.bottom ?? activeBottomMargin,
274106
- preRegisteredFallbackToContentTop: true
274107
- });
274108
- const resolveParagraphlessAnchoredDrawingX = (block, measure, state) => block.anchor ? computeAnchorX(block.anchor, state.columnIndex, normalizeColumns(activeColumns, activePageSize.w - (activeLeftMargin + activeRightMargin)), measure.width, {
274109
- left: activeLeftMargin,
274110
- right: activeRightMargin
274111
- }, activePageSize.w) : columnX(state);
274112
- for (const entry of preRegisteredAnchors) {
274113
- const state = paginator.ensurePage();
274617
+ const resolveAnchoredDrawingPosition = (block, measure, state) => {
274114
274618
  const contentTop = state.topMargin;
274115
274619
  const contentBottom = state.contentBottom;
274116
274620
  const anchorY = resolveAnchoredGraphicY({
274117
- anchor: entry.block.anchor,
274118
- objectHeight: entry.measure.height ?? 0,
274621
+ anchor: block.anchor,
274622
+ objectHeight: measure.height ?? 0,
274119
274623
  contentTop,
274120
274624
  contentBottom,
274121
274625
  pageBottomMargin: state.page.margins?.bottom ?? activeBottomMargin,
274122
274626
  preRegisteredFallbackToContentTop: true
274123
274627
  });
274124
- const anchorX = entry.block.anchor ? computeAnchorX(entry.block.anchor, state.columnIndex, normalizeColumns(activeColumns, activePageSize.w - (activeLeftMargin + activeRightMargin)), entry.measure.width, {
274125
- left: activeLeftMargin,
274126
- right: activeRightMargin
274127
- }, activePageSize.w) : activeLeftMargin;
274128
- floatManager.registerDrawing(entry.block, entry.measure, anchorY, state.columnIndex, state.page.number);
274129
- preRegisteredPositions.set(entry.block.id, {
274130
- anchorX,
274628
+ const columns = getActiveColumnsForState(state);
274629
+ const pageMargins = {
274630
+ top: state.page.margins?.top ?? activeTopMargin,
274631
+ bottom: state.page.margins?.bottom ?? activeBottomMargin,
274632
+ left: state.page.margins?.left ?? activeLeftMargin,
274633
+ right: state.page.margins?.right ?? activeRightMargin
274634
+ };
274635
+ const pageWidth = state.page.size?.w ?? activePageSize.w;
274636
+ const contentWidth = pageWidth - ((pageMargins.left ?? 0) + (pageMargins.right ?? 0));
274637
+ return {
274638
+ anchorX: block.anchor ? computeAnchorX(block.anchor, state.columnIndex, normalizeColumns(columns, contentWidth), measure.width, {
274639
+ left: pageMargins.left,
274640
+ right: pageMargins.right
274641
+ }, pageWidth) : pageMargins.left ?? activeLeftMargin,
274131
274642
  anchorY
274132
- });
274133
- }
274643
+ };
274644
+ };
274645
+ for (const entry of preRegisteredAnchors)
274646
+ preRegisteredAnchorIds.add(entry.block.id);
274134
274647
  const keepNextChains = computeKeepNextChains(blocks2);
274135
274648
  const midChainIndices = /* @__PURE__ */ new Set;
274136
274649
  for (const chain of keepNextChains.values())
@@ -274342,20 +274855,25 @@ function layoutDocument(blocks2, measures, options = {}) {
274342
274855
  if (measure.kind !== "paragraph")
274343
274856
  throw new Error(`layoutDocument: expected paragraph measure for block ${block.id}`);
274344
274857
  const paraBlock = block;
274345
- if (!paraBlock.runs || paraBlock.runs.length === 0 || paraBlock.runs.length === 1 && (!paraBlock.runs[0].kind || paraBlock.runs[0].kind === "text") && (!paraBlock.runs[0].text || paraBlock.runs[0].text === "")) {
274858
+ const isEmpty3 = !paraBlock.runs || paraBlock.runs.length === 0 || paraBlock.runs.length === 1 && (!paraBlock.runs[0].kind || paraBlock.runs[0].kind === "text") && (!paraBlock.runs[0].text || paraBlock.runs[0].text === "");
274859
+ const drawingAnchorsForPara = anchoredByParagraph.get(index2);
274860
+ const wrappingPageRelativeAnchorsForPara = pageRelativeAnchorsByParagraph.get(index2)?.filter(({ block: anchorBlock }) => shouldWrapParagraphWithPageRelativeAnchor(anchorBlock, index2, paraBlock.id));
274861
+ const laterPageRelativeAnchorsForPara = collectLaterPageRelativeAnchorsForParagraph(index2, paraBlock.id);
274862
+ const anchorsForPara = mergeAnchoredDrawings(drawingAnchorsForPara, wrappingPageRelativeAnchorsForPara, laterPageRelativeAnchorsForPara);
274863
+ const tablesForPara = anchoredTablesByParagraph.get(index2);
274864
+ if (isEmpty3) {
274346
274865
  const isSectPrMarker = paraBlock.attrs?.sectPrMarker === true;
274347
274866
  const prevBlock = index2 > 0 ? blocks2[index2 - 1] : null;
274348
274867
  const nextBlock = index2 < blocks2.length - 1 ? blocks2[index2 + 1] : null;
274349
274868
  const nextSectionBreak = nextBlock?.kind === "sectionBreak" ? nextBlock : null;
274350
274869
  const nextBreakType = nextSectionBreak?.type ?? (nextSectionBreak?.attrs?.source === "sectPr" ? "nextPage" : undefined);
274351
274870
  const nextBreakForcesPage = nextSectionBreak && (nextBreakType === "nextPage" || nextBreakType === "evenPage" || nextBreakType === "oddPage" || nextSectionBreak.attrs?.requirePageBoundary === true);
274352
- if (isSectPrMarker && nextBreakForcesPage)
274871
+ const hasAnchoredObjectsForMarker = Boolean(anchorsForPara?.length || tablesForPara?.length);
274872
+ if (isSectPrMarker && nextBreakForcesPage && !hasAnchoredObjectsForMarker)
274353
274873
  continue;
274354
- if (prevBlock?.kind === "pageBreak" && nextBlock?.kind === "sectionBreak")
274874
+ if (prevBlock?.kind === "pageBreak" && nextBlock?.kind === "sectionBreak" && !hasAnchoredObjectsForMarker)
274355
274875
  continue;
274356
274876
  }
274357
- const anchorsForPara = anchoredByParagraph.get(index2);
274358
- const tablesForPara = anchoredTablesByParagraph.get(index2);
274359
274877
  const chain = keepNextChains.get(index2);
274360
274878
  if (midChainIndices.has(index2)) {} else if (chain) {
274361
274879
  let state = paginator.ensurePage();
@@ -274426,6 +274944,10 @@ function layoutDocument(blocks2, measures, options = {}) {
274426
274944
  overrideSpacingAfter = 0;
274427
274945
  }
274428
274946
  }
274947
+ const hasPageRelativeAnchorForPara = Boolean(pageRelativeAnchorsByParagraph.get(index2)?.length || laterPageRelativeAnchorsForPara?.length || tablesForPara?.some(({ block: tableBlock }) => {
274948
+ const vRelativeFrom = tableBlock.anchor?.vRelativeFrom;
274949
+ return vRelativeFrom === "page" || vRelativeFrom === "margin";
274950
+ }));
274429
274951
  layoutParagraphBlock({
274430
274952
  block,
274431
274953
  measure,
@@ -274451,6 +274973,9 @@ function layoutDocument(blocks2, measures, options = {}) {
274451
274973
  left: activeLeftMargin,
274452
274974
  right: activeRightMargin
274453
274975
  },
274976
+ sectionBaseTopMargin: activeSectionBaseTopMargin,
274977
+ sectionHeaderDistance: activeHeaderDistance,
274978
+ hasPageRelativeAnchorForParagraph: hasPageRelativeAnchorForPara,
274454
274979
  columns: getCurrentColumns(),
274455
274980
  placedAnchoredIds
274456
274981
  } : undefined);
@@ -274478,11 +275003,14 @@ function layoutDocument(blocks2, measures, options = {}) {
274478
275003
  if (block.kind === "image") {
274479
275004
  if (measure.kind !== "image")
274480
275005
  throw new Error(`layoutDocument: expected image measure for block ${block.id}`);
274481
- const preRegPos = preRegisteredPositions.get(block.id);
274482
- if (preRegPos && Number.isFinite(preRegPos.anchorX) && Number.isFinite(preRegPos.anchorY)) {
275006
+ if (placedAnchoredIds.has(block.id))
275007
+ continue;
275008
+ if (preRegisteredAnchorIds.has(block.id)) {
274483
275009
  const state = paginator.ensurePage();
274484
275010
  const imgBlock = block;
274485
275011
  const imgMeasure = measure;
275012
+ const { anchorX, anchorY } = resolveAnchoredDrawingPosition(imgBlock, imgMeasure, state);
275013
+ floatManager.registerDrawing(imgBlock, imgMeasure, anchorY, state.columnIndex, state.page.number);
274486
275014
  const pageContentHeight = Math.max(0, state.contentBottom - state.topMargin);
274487
275015
  const relativeFrom = imgBlock.anchor?.hRelativeFrom ?? "column";
274488
275016
  const cols = getCurrentColumns();
@@ -274508,8 +275036,8 @@ function layoutDocument(blocks2, measures, options = {}) {
274508
275036
  const fragment2 = {
274509
275037
  kind: "image",
274510
275038
  blockId: imgBlock.id,
274511
- x: preRegPos.anchorX,
274512
- y: preRegPos.anchorY,
275039
+ x: anchorX,
275040
+ y: anchorY,
274513
275041
  width: imgMeasure.width,
274514
275042
  height: imgMeasure.height,
274515
275043
  isAnchored: true,
@@ -274540,18 +275068,21 @@ function layoutDocument(blocks2, measures, options = {}) {
274540
275068
  if (block.kind === "drawing") {
274541
275069
  if (measure.kind !== "drawing")
274542
275070
  throw new Error(`layoutDocument: expected drawing measure for block ${block.id}`);
274543
- const preRegPos = preRegisteredPositions.get(block.id);
274544
- if (preRegPos && Number.isFinite(preRegPos.anchorX) && Number.isFinite(preRegPos.anchorY)) {
275071
+ if (placedAnchoredIds.has(block.id))
275072
+ continue;
275073
+ if (preRegisteredAnchorIds.has(block.id)) {
274545
275074
  const state = paginator.ensurePage();
274546
275075
  const drawBlock = block;
274547
275076
  const drawMeasure = measure;
275077
+ const { anchorX, anchorY } = resolveAnchoredDrawingPosition(drawBlock, drawMeasure, state);
275078
+ floatManager.registerDrawing(drawBlock, drawMeasure, anchorY, state.columnIndex, state.page.number);
274548
275079
  const contentMeasures = drawBlock.drawingKind === "textboxShape" && typeof options.remeasureParagraph === "function" ? layoutTextboxContent(drawBlock, options.remeasureParagraph) : undefined;
274549
275080
  const fragment2 = {
274550
275081
  kind: "drawing",
274551
275082
  blockId: drawBlock.id,
274552
275083
  drawingKind: drawBlock.drawingKind,
274553
- x: preRegPos.anchorX,
274554
- y: preRegPos.anchorY,
275084
+ x: anchorX,
275085
+ y: anchorY,
274555
275086
  width: drawMeasure.width,
274556
275087
  height: drawMeasure.height,
274557
275088
  geometry: drawMeasure.geometry,
@@ -274633,8 +275164,7 @@ function layoutDocument(blocks2, measures, options = {}) {
274633
275164
  for (const { block, measure } of paragraphlessAnchoredDrawings) {
274634
275165
  if (placedAnchoredIds.has(block.id))
274635
275166
  continue;
274636
- const anchorX = resolveParagraphlessAnchoredDrawingX(block, measure, state);
274637
- const anchorY = resolveParagraphlessAnchoredDrawingY(block, measure, state);
275167
+ const { anchorX, anchorY } = resolveAnchoredDrawingPosition(block, measure, state);
274638
275168
  if (block.kind === "image" && measure.kind === "image") {
274639
275169
  const pageContentHeight = Math.max(0, state.contentBottom - state.topMargin);
274640
275170
  const aspectRatio = measure.width > 0 && measure.height > 0 ? measure.width / measure.height : 1;
@@ -274902,6 +275432,15 @@ function getPageRelativeMeasurementBand(kind, constraints) {
274902
275432
  end: bandSize
274903
275433
  };
274904
275434
  }
275435
+ function isHeaderFooterAbsoluteOverlay(block, kind, fragment2, fragmentBottom, canvasHeight) {
275436
+ if (!kind)
275437
+ return false;
275438
+ if (block.anchor?.isAnchored !== true)
275439
+ return false;
275440
+ if (block.wrap?.type !== "None")
275441
+ return false;
275442
+ return fragment2.y < 0 || fragmentBottom > canvasHeight;
275443
+ }
274905
275444
  function shouldExcludeFromMeasurement(fragment2, block, fragmentBottom, canvasHeight, kind, constraints) {
274906
275445
  if (!((fragment2.kind === "image" || fragment2.kind === "drawing") && fragment2.isAnchored === true))
274907
275446
  return false;
@@ -274910,6 +275449,8 @@ function shouldExcludeFromMeasurement(fragment2, block, fragmentBottom, canvasHe
274910
275449
  const anchoredBlock = block;
274911
275450
  if (anchoredBlock.anchor?.behindDoc)
274912
275451
  return true;
275452
+ if (isHeaderFooterAbsoluteOverlay(anchoredBlock, kind, fragment2, fragmentBottom, canvasHeight))
275453
+ return true;
274913
275454
  if (isPageRelativeAnchor(anchoredBlock)) {
274914
275455
  const fragmentTop = fragment2.y;
274915
275456
  if (fragmentBottom <= 0 || fragmentTop >= canvasHeight)
@@ -274920,13 +275461,6 @@ function shouldExcludeFromMeasurement(fragment2, block, fragmentBottom, canvasHe
274920
275461
  if (measurementBand && !rangesIntersect(fragment2.y, fragmentBottom, measurementBand.start, measurementBand.end))
274921
275462
  return true;
274922
275463
  }
274923
- const fragmentHeight = typeof fragment2.height === "number" ? fragment2.height : fragmentBottom - fragment2.y;
274924
- const fragmentWidth = typeof fragment2.width === "number" ? fragment2.width : 0;
274925
- const heightCoversCanvas = Number.isFinite(fragmentHeight) && fragmentHeight >= canvasHeight;
274926
- const widthCoversCanvas = Number.isFinite(constraints.width) && constraints.width > 0 && fragmentWidth >= constraints.width;
274927
- const isOverlayWrap = anchoredBlock.wrap?.type === "None";
274928
- if (kind && heightCoversCanvas && widthCoversCanvas && isOverlayWrap)
274929
- return true;
274930
275464
  return false;
274931
275465
  }
274932
275466
  function layoutHeaderFooter(blocks2, measures, constraints, kind, remeasureParagraph$1) {
@@ -286967,13 +287501,17 @@ async function buildMeasuredAutoFitContentMetrics(block, workingInput, fixedLayo
286967
287501
  cellMetricKeys: contentMetrics.cellMetricKeys
286968
287502
  };
286969
287503
  }
287504
+ function isBehindDocOverlay(block) {
287505
+ return block.anchor?.behindDoc === true || block.wrap?.type === "None" && block.wrap?.behindDoc === true;
287506
+ }
287507
+ function hasNegativeVerticalPosition(block) {
287508
+ return block.anchor?.isAnchored === true && (typeof block.anchor?.offsetV === "number" && block.anchor.offsetV < 0 || typeof block.margin?.top === "number" && block.margin.top < 0);
287509
+ }
286970
287510
  async function measureImageBlock(block, constraints) {
286971
287511
  const intrinsic = getIntrinsicImageSize(block, constraints.maxWidth);
286972
- const isBlockBehindDoc = block.anchor?.behindDoc;
286973
- const isBlockWrapBehindDoc = block.wrap?.type === "None" && block.wrap?.behindDoc;
286974
287512
  const isPageRelativeAnchor$1 = block.anchor?.isAnchored && (block.anchor?.hRelativeFrom === "page" || block.anchor?.hRelativeFrom === "margin");
286975
- const maxWidth = isBlockBehindDoc || isBlockWrapBehindDoc || isPageRelativeAnchor$1 || constraints.maxWidth <= 0 ? intrinsic.width : constraints.maxWidth;
286976
- const maxHeight = block.anchor?.isAnchored && (typeof block.anchor?.offsetV === "number" && block.anchor.offsetV < 0 || typeof block.margin?.top === "number" && block.margin.top < 0) || block.objectFit === "cover" || !constraints.maxHeight || constraints.maxHeight <= 0 ? Infinity : constraints.maxHeight;
287513
+ const maxWidth = isBehindDocOverlay(block) || isPageRelativeAnchor$1 || constraints.maxWidth <= 0 ? intrinsic.width : constraints.maxWidth;
287514
+ const maxHeight = isBehindDocOverlay(block) || hasNegativeVerticalPosition(block) || block.objectFit === "cover" || !constraints.maxHeight || constraints.maxHeight <= 0 ? Infinity : constraints.maxHeight;
286977
287515
  const widthScale = maxWidth / intrinsic.width;
286978
287516
  const heightScale = maxHeight / intrinsic.height;
286979
287517
  const scale = Math.min(1, widthScale, heightScale);
@@ -286986,8 +287524,9 @@ async function measureImageBlock(block, constraints) {
286986
287524
  async function measureDrawingBlock(block, constraints) {
286987
287525
  if (block.drawingKind === "image") {
286988
287526
  const intrinsic = getIntrinsicSizeFromDims(block.width, block.height, constraints.maxWidth);
286989
- const maxWidth$1 = constraints.maxWidth > 0 ? constraints.maxWidth : intrinsic.width;
286990
- const maxHeight$1 = constraints.maxHeight && constraints.maxHeight > 0 ? constraints.maxHeight : Infinity;
287527
+ const isPageRelativeAnchor$1 = block.anchor?.isAnchored === true && (block.anchor.hRelativeFrom === "page" || block.anchor.hRelativeFrom === "margin");
287528
+ const maxWidth$1 = isBehindDocOverlay(block) || isPageRelativeAnchor$1 || constraints.maxWidth <= 0 ? intrinsic.width : constraints.maxWidth;
287529
+ const maxHeight$1 = isBehindDocOverlay(block) || hasNegativeVerticalPosition(block) || !constraints.maxHeight || constraints.maxHeight <= 0 ? Infinity : constraints.maxHeight;
286991
287530
  const widthScale$1 = maxWidth$1 / intrinsic.width;
286992
287531
  const heightScale$1 = maxHeight$1 / intrinsic.height;
286993
287532
  const scale$1 = Math.min(1, widthScale$1, heightScale$1);
@@ -287009,6 +287548,21 @@ async function measureDrawingBlock(block, constraints) {
287009
287548
  };
287010
287549
  }
287011
287550
  const geometry = ensureDrawingGeometry(block.geometry);
287551
+ if (block.drawingKind === "shapeGroup" && block.groupTransform) {
287552
+ const effectExtent = block.effectExtent ?? {
287553
+ left: 0,
287554
+ top: 0,
287555
+ right: 0,
287556
+ bottom: 0
287557
+ };
287558
+ const groupWidth = block.groupTransform.width ?? geometry.width;
287559
+ const groupHeight = block.groupTransform.height ?? geometry.height;
287560
+ geometry.width = Math.max(1, geometry.width, groupWidth + effectExtent.left + effectExtent.right);
287561
+ geometry.height = Math.max(1, geometry.height, groupHeight + effectExtent.top + effectExtent.bottom);
287562
+ geometry.rotation = normalizeRotation(block.groupTransform.rotation ?? geometry.rotation ?? 0);
287563
+ geometry.flipH = Boolean(block.groupTransform.flipH ?? geometry.flipH);
287564
+ geometry.flipV = Boolean(block.groupTransform.flipV ?? geometry.flipV);
287565
+ }
287012
287566
  const attrs = block.attrs;
287013
287567
  const indentLeft = typeof attrs?.hrIndentLeft === "number" ? attrs.hrIndentLeft : 0;
287014
287568
  const indentRight = typeof attrs?.hrIndentRight === "number" ? attrs.hrIndentRight : 0;
@@ -287020,7 +287574,7 @@ async function measureDrawingBlock(block, constraints) {
287020
287574
  const naturalHeight = Math.max(1, rotatedBounds.height);
287021
287575
  const isFloating = block.wrap?.type === "None" || block.anchor?.isAnchored === true;
287022
287576
  const maxWidth = fullWidthMax ?? (constraints.maxWidth > 0 && !isFloating ? constraints.maxWidth : naturalWidth);
287023
- const maxHeight = block.anchor?.isAnchored && (typeof block.anchor?.offsetV === "number" && block.anchor.offsetV < 0 || typeof block.margin?.top === "number" && block.margin.top < 0) || !constraints.maxHeight || constraints.maxHeight <= 0 ? Infinity : constraints.maxHeight;
287577
+ const maxHeight = isBehindDocOverlay(block) || hasNegativeVerticalPosition(block) || !constraints.maxHeight || constraints.maxHeight <= 0 ? Infinity : constraints.maxHeight;
287024
287578
  const widthScale = maxWidth / naturalWidth;
287025
287579
  const heightScale = maxHeight / naturalHeight;
287026
287580
  const normalizedScale = Math.min(1, widthScale, heightScale);
@@ -287608,15 +288162,17 @@ function shiftResolvedPaintItemY(item, yOffset) {
287608
288162
  y: item.y + yOffset
287609
288163
  };
287610
288164
  }
287611
- function isExplicitBehindDocMediaFragment(fragment2) {
287612
- return (fragment2.kind === "image" || fragment2.kind === "drawing") && fragment2.behindDoc === true;
288165
+ function isExcludedFromDecorationNormalization(fragment2) {
288166
+ if (fragment2.kind !== "image" && fragment2.kind !== "drawing")
288167
+ return false;
288168
+ return fragment2.behindDoc === true || fragment2.isAnchored === true || fragment2.sourceAnchor != null;
287613
288169
  }
287614
288170
  function getDecorationNormalizationMinY(fragments, layoutMinY) {
287615
288171
  if (!Number.isFinite(layoutMinY) || layoutMinY >= 0)
287616
288172
  return 0;
287617
288173
  let minY = Infinity;
287618
288174
  for (const fragment2 of fragments) {
287619
- if (isExplicitBehindDocMediaFragment(fragment2))
288175
+ if (isExcludedFromDecorationNormalization(fragment2))
287620
288176
  continue;
287621
288177
  if (Number.isFinite(fragment2.y))
287622
288178
  minY = Math.min(minY, fragment2.y);
@@ -309179,6 +309735,12 @@ menclose::after {
309179
309735
  if (!SUPPORTED_IMAGE_CLIP_PATH_PREFIXES.some((prefix2) => lower.startsWith(prefix2)))
309180
309736
  return "";
309181
309737
  return normalized;
309738
+ }, applyImageObjectFit = (img2, objectFit) => {
309739
+ img2.style.objectFit = objectFit;
309740
+ if (objectFit === "cover")
309741
+ img2.style.objectPosition = "left top";
309742
+ else
309743
+ img2.style.removeProperty("object-position");
309182
309744
  }, applyRunDataAttributes = (element3, dataAttrs) => {
309183
309745
  if (!dataAttrs)
309184
309746
  return;
@@ -309466,7 +310028,10 @@ menclose::after {
309466
310028
  }, renderImageRun = (run2, context) => {
309467
310029
  if (!run2.src)
309468
310030
  return null;
309469
- const hasClipPath = typeof run2.clipPath === "string" && run2.clipPath.trim().length > 0;
310031
+ const runClipPath = readImageClipPathValue(run2.clipPath);
310032
+ const shapeClipPath = readImageClipPathValue(run2.shapeClipPath);
310033
+ const hasClipPath = runClipPath.length > 0;
310034
+ const hasShapeClipPath = shapeClipPath.length > 0;
309470
310035
  const img2 = context.doc.createElement("img");
309471
310036
  img2.classList.add(DOM_CLASS_NAMES.INLINE_IMAGE);
309472
310037
  if (typeof run2.src === "string" && run2.src.startsWith("data:")) {
@@ -309480,7 +310045,7 @@ menclose::after {
309480
310045
  else
309481
310046
  return null;
309482
310047
  }
309483
- if (!hasClipPath) {
310048
+ if (!hasClipPath && !hasShapeClipPath) {
309484
310049
  img2.width = run2.width;
309485
310050
  img2.height = run2.height;
309486
310051
  } else
@@ -309493,7 +310058,9 @@ menclose::after {
309493
310058
  minWidth: "0",
309494
310059
  minHeight: "0"
309495
310060
  });
309496
- applyImageClipPath(img2, run2.clipPath);
310061
+ applyImageClipPath(img2, runClipPath);
310062
+ if (run2.objectFit)
310063
+ applyImageObjectFit(img2, run2.objectFit);
309497
310064
  if (run2.width > 0 && run2.height > 0) {
309498
310065
  const aspectRatio = run2.width / run2.height;
309499
310066
  const inlineImageMetadata = {
@@ -309511,7 +310078,7 @@ menclose::after {
309511
310078
  if (run2.title)
309512
310079
  img2.title = run2.title;
309513
310080
  img2.style.display = "inline-block";
309514
- const useWrapper = hasClipPath && run2.width > 0 && run2.height > 0;
310081
+ const useWrapper = (hasClipPath || hasShapeClipPath) && run2.width > 0 && run2.height > 0;
309515
310082
  if (!useWrapper) {
309516
310083
  img2.style.verticalAlign = run2.verticalAlign ?? "top";
309517
310084
  if (run2.distTop)
@@ -309572,6 +310139,8 @@ menclose::after {
309572
310139
  wrapper.style.marginRight = `${run2.distRight}px`;
309573
310140
  wrapper.style.position = "relative";
309574
310141
  wrapper.style.zIndex = "1";
310142
+ if (shapeClipPath)
310143
+ wrapper.style.clipPath = shapeClipPath;
309575
310144
  if (run2.pmStart != null)
309576
310145
  wrapper.dataset.pmStart = String(run2.pmStart);
309577
310146
  if (run2.pmEnd != null)
@@ -309591,7 +310160,6 @@ menclose::after {
309591
310160
  context.applySdtDataset(img2, run2.sdt);
309592
310161
  if (run2.dataAttrs)
309593
310162
  applyRunDataAttributes(img2, run2.dataAttrs);
309594
- const runClipPath = readImageClipPathValue(run2.clipPath);
309595
310163
  if (runClipPath) {
309596
310164
  img2.style.clipPath = runClipPath;
309597
310165
  img2.style.display = "block";
@@ -309637,6 +310205,12 @@ menclose::after {
309637
310205
  return "";
309638
310206
  const record = block;
309639
310207
  return readImageClipPathValue(record.clipPath) || resolveClipPathFromAttrs$1(record.attrs);
310208
+ }, resolveBlockImageShapeClipPath = (block) => {
310209
+ if (!block || typeof block !== "object")
310210
+ return "";
310211
+ const record = block;
310212
+ const attrs = record.attrs && typeof record.attrs === "object" ? record.attrs : undefined;
310213
+ return readImageClipPathValue(record.shapeClipPath) || readImageClipPathValue(attrs?.shapeClipPath);
309640
310214
  }, createBlockImageContent = ({ doc: doc$12, block, className, clipContainer, imageDisplay, hyperlinkDisplay = "block", buildImageHyperlinkAnchor: buildImageHyperlinkAnchor$1 }) => {
309641
310215
  const img2 = doc$12.createElement("img");
309642
310216
  if (className)
@@ -309646,10 +310220,19 @@ menclose::after {
309646
310220
  img2.alt = block.alt ?? "";
309647
310221
  img2.style.width = "100%";
309648
310222
  img2.style.height = "100%";
309649
- img2.style.objectFit = block.objectFit ?? "contain";
309650
- if (block.objectFit === "cover")
309651
- img2.style.objectPosition = "left top";
309652
- applyImageClipPath(img2, resolveBlockImageClipPath(block), clipContainer ? { clipContainer } : undefined);
310223
+ applyImageObjectFit(img2, block.objectFit ?? "contain");
310224
+ const shapeClipPath = resolveBlockImageShapeClipPath(block);
310225
+ const ownShapeClipContainer = shapeClipPath && !clipContainer ? doc$12.createElement("div") : undefined;
310226
+ if (ownShapeClipContainer) {
310227
+ ownShapeClipContainer.style.width = "100%";
310228
+ ownShapeClipContainer.style.height = "100%";
310229
+ }
310230
+ const shapeClipContainer = clipContainer ?? ownShapeClipContainer;
310231
+ if (shapeClipPath && shapeClipContainer) {
310232
+ shapeClipContainer.style.clipPath = shapeClipPath;
310233
+ shapeClipContainer.style.overflow = "hidden";
310234
+ }
310235
+ applyImageClipPath(img2, resolveBlockImageClipPath(block), shapeClipContainer ? { clipContainer: shapeClipContainer } : undefined);
309653
310236
  img2.style.display = imageDisplay ?? (block.display === "inline" ? "inline-block" : "block");
309654
310237
  const filters = buildImageFilters(block);
309655
310238
  if (filters.length > 0)
@@ -309657,7 +310240,12 @@ menclose::after {
309657
310240
  const opacity = resolveImageOpacity(block);
309658
310241
  if (opacity != null)
309659
310242
  img2.style.opacity = opacity;
309660
- return buildImageHyperlinkAnchor$1?.(img2, block.hyperlink, hyperlinkDisplay) ?? img2;
310243
+ const content3 = buildImageHyperlinkAnchor$1?.(img2, block.hyperlink, hyperlinkDisplay) ?? img2;
310244
+ if (ownShapeClipContainer) {
310245
+ ownShapeClipContainer.appendChild(content3);
310246
+ return ownShapeClipContainer;
310247
+ }
310248
+ return content3;
309661
310249
  }, buildImageHyperlinkAnchor = (doc$12, imageEl, hyperlink, display) => {
309662
310250
  if (!hyperlink?.url)
309663
310251
  return imageEl;
@@ -313793,13 +314381,24 @@ menclose::after {
313793
314381
  const img2 = doc$12.createElement("img");
313794
314382
  img2.src = attrs.src;
313795
314383
  img2.alt = attrs.alt ?? "";
313796
- img2.style.objectFit = "contain";
314384
+ applyImageObjectFit(img2, attrs.objectFit ?? "contain");
313797
314385
  img2.style.display = "block";
313798
- applyImageClipPath(img2, attrs.clipPath);
313799
314386
  const opacity = resolveImageOpacity(attrs);
313800
314387
  if (opacity != null)
313801
314388
  img2.style.opacity = opacity;
313802
- return img2;
314389
+ img2.style.width = "100%";
314390
+ img2.style.height = "100%";
314391
+ if (!attrs.clipPath && !attrs.shapeClipPath)
314392
+ return img2;
314393
+ const clipContainer = doc$12.createElement("div");
314394
+ clipContainer.style.width = "100%";
314395
+ clipContainer.style.height = "100%";
314396
+ clipContainer.style.overflow = "hidden";
314397
+ if (attrs.shapeClipPath)
314398
+ clipContainer.style.clipPath = attrs.shapeClipPath;
314399
+ applyImageClipPath(img2, attrs.clipPath, { clipContainer });
314400
+ clipContainer.appendChild(img2);
314401
+ return clipContainer;
313803
314402
  }, createShapeTextImageElement = (doc$12, part) => {
313804
314403
  const img2 = doc$12.createElement("img");
313805
314404
  img2.src = part.src;
@@ -313890,7 +314489,7 @@ menclose::after {
313890
314489
  });
313891
314490
  return createErrorPlaceholder(fragment2.blockId, error3);
313892
314491
  }
313893
- }, ACTIVE_HEADER_FOOTER_WATERMARK_PREVIEW_OPACITY = "1", INACTIVE_HEADER_FOOTER_WATERMARK_PREVIEW_OPACITY = "0.5", resolveOrBuildFragmentIdentity = (fragment2, story, existing) => buildLayoutSourceIdentityForFragment(existing ? {
314492
+ }, ACTIVE_HEADER_FOOTER_WATERMARK_PREVIEW_OPACITY = "1", INACTIVE_HEADER_FOOTER_WATERMARK_PREVIEW_OPACITY = "0.5", normalizeRotationDegrees = (rotation) => (rotation % 360 + 360) % 360, resolveOrBuildFragmentIdentity = (fragment2, story, existing) => buildLayoutSourceIdentityForFragment(existing ? {
313894
314493
  ...fragment2,
313895
314494
  layoutSourceIdentity: existing,
313896
314495
  sourceAnchor: fragment2.sourceAnchor ?? existing.sourceAnchor
@@ -313904,7 +314503,7 @@ menclose::after {
313904
314503
  kind,
313905
314504
  id: id2
313906
314505
  } : { kind };
313907
- }, DEFAULT_PAGE_HEIGHT_PX = 1056, DEFAULT_VIRTUALIZED_PAGE_GAP = 72, SVG_NS = "http://www.w3.org/2000/svg", WORDART_LINE_FILL_RATIO = 0.9, DomPainter = class {
314506
+ }, DEFAULT_PAGE_HEIGHT_PX = 1056, DEFAULT_VIRTUALIZED_PAGE_GAP = 72, PAGE_BACKGROUND_OVERLAY_Z_ORDER_OFFSET = 1e6, SVG_NS = "http://www.w3.org/2000/svg", WORDART_LINE_FILL_RATIO = 0.9, DomPainter = class {
313908
314507
  constructor(options = {}) {
313909
314508
  this.mount = null;
313910
314509
  this.doc = null;
@@ -314735,6 +315334,63 @@ menclose::after {
314735
315334
  return false;
314736
315335
  return block.anchor?.vRelativeFrom === "page";
314737
315336
  }
315337
+ isHorizontallyPageRelativeAnchoredFragment(fragment2, resolvedItem) {
315338
+ if (fragment2.kind !== "image" && fragment2.kind !== "drawing")
315339
+ return false;
315340
+ const block = resolvedItem && "block" in resolvedItem ? resolvedItem.block : undefined;
315341
+ if (!block || block.kind !== "image" && block.kind !== "drawing")
315342
+ return false;
315343
+ return block.anchor?.hRelativeFrom === "page";
315344
+ }
315345
+ isHeaderFooterAbsoluteOverlayFragment(fragment2, kind, resolvedItem) {
315346
+ if (kind !== "header" && kind !== "footer")
315347
+ return false;
315348
+ if (fragment2.kind !== "image" && fragment2.kind !== "drawing")
315349
+ return false;
315350
+ if (fragment2.isAnchored !== true)
315351
+ return false;
315352
+ const block = resolvedItem && "block" in resolvedItem ? resolvedItem.block : undefined;
315353
+ if (!block || block.kind !== "image" && block.kind !== "drawing")
315354
+ return false;
315355
+ if (block.anchor?.isAnchored !== true)
315356
+ return false;
315357
+ if (block.wrap?.type !== "None")
315358
+ return false;
315359
+ if (fragment2.behindDoc === true || block.anchor?.behindDoc === true)
315360
+ return false;
315361
+ return true;
315362
+ }
315363
+ getPageBackgroundDecorationZOrder(fragment2, resolvedItem) {
315364
+ const block = resolvedItem && "block" in resolvedItem ? resolvedItem.block : undefined;
315365
+ const isDrawingBlock = block?.kind === "image" || block?.kind === "drawing";
315366
+ const normalizedZIndex = normalizeZIndex(isDrawingBlock ? block.attrs?.originalAttributes : undefined);
315367
+ const isBehindDoc = (fragment2.kind === "image" || fragment2.kind === "drawing") && fragment2.behindDoc === true || isDrawingBlock && block.anchor?.behindDoc === true;
315368
+ if (isBehindDoc && normalizedZIndex != null)
315369
+ return normalizedZIndex;
315370
+ if ((fragment2.kind === "image" || fragment2.kind === "drawing") && typeof fragment2.zIndex === "number")
315371
+ return isBehindDoc ? fragment2.zIndex : PAGE_BACKGROUND_OVERLAY_Z_ORDER_OFFSET + Math.max(1, fragment2.zIndex);
315372
+ if (normalizedZIndex != null)
315373
+ return PAGE_BACKGROUND_OVERLAY_Z_ORDER_OFFSET + Math.max(1, normalizedZIndex);
315374
+ return 0;
315375
+ }
315376
+ insertPageBackgroundDecoration(pageEl, fragEl, zOrder) {
315377
+ fragEl.dataset.pageBackgroundZIndex = String(zOrder);
315378
+ let lastBackgroundDecoration = null;
315379
+ let insertBefore = null;
315380
+ for (const child of Array.from(pageEl.children)) {
315381
+ const el = child;
315382
+ if (el.dataset.behindDocSection != null || el.dataset.headerFooterOverlaySection != null) {
315383
+ if (Number(el.dataset.pageBackgroundZIndex ?? 0) > zOrder) {
315384
+ insertBefore = el;
315385
+ break;
315386
+ }
315387
+ lastBackgroundDecoration = el;
315388
+ continue;
315389
+ }
315390
+ break;
315391
+ }
315392
+ pageEl.insertBefore(fragEl, insertBefore ?? lastBackgroundDecoration?.nextSibling ?? pageEl.firstChild);
315393
+ }
314738
315394
  getDecorationAnchorPageOriginY(page, kind, effectiveOffset) {
314739
315395
  if (kind === "header")
314740
315396
  return effectiveOffset;
@@ -314759,8 +315415,12 @@ menclose::after {
314759
315415
  const className = kind === "header" ? CLASS_NAMES$1.pageHeader : CLASS_NAMES$1.pageFooter;
314760
315416
  const existing = pageEl.querySelector(`.${className}`);
314761
315417
  const data = provider ? provider(page.number, page.margins, page) : null;
315418
+ const behindDocSelector = `[data-behind-doc-section="${kind}"]`;
315419
+ const overlaySelector = `[data-header-footer-overlay-section="${kind}"]`;
314762
315420
  if (!data || data.fragments.length === 0) {
314763
315421
  existing?.remove();
315422
+ pageEl.querySelectorAll(behindDocSelector).forEach((el) => el.remove());
315423
+ pageEl.querySelectorAll(overlaySelector).forEach((el) => el.remove());
314764
315424
  return;
314765
315425
  }
314766
315426
  const container = existing ?? this.doc.createElement("div");
@@ -314822,27 +315482,34 @@ menclose::after {
314822
315482
  const decorationItems = data.items ?? [];
314823
315483
  const betweenBorderFlags = computeBetweenBorderFlags(decorationItems);
314824
315484
  const behindDocFragments = [];
315485
+ const absoluteOverlayFragments = [];
314825
315486
  const normalFragments = [];
314826
315487
  for (let fi = 0;fi < data.fragments.length; fi += 1) {
314827
315488
  const fragment2 = data.fragments[fi];
315489
+ const resolvedItem = decorationItems[fi];
314828
315490
  let isBehindDoc = false;
314829
315491
  if (fragment2.kind === "image" || fragment2.kind === "drawing") {
314830
- const resolvedItem = decorationItems[fi];
314831
- isBehindDoc = fragment2.behindDoc === true || fragment2.behindDoc == null && "zIndex" in fragment2 && fragment2.zIndex === 0 || this.shouldRenderBehindPageContent(fragment2, kind, resolvedItem);
315492
+ const resolvedMediaItem = resolvedItem;
315493
+ isBehindDoc = fragment2.behindDoc === true || fragment2.behindDoc == null && "zIndex" in fragment2 && fragment2.zIndex === 0 || this.shouldRenderBehindPageContent(fragment2, kind, resolvedMediaItem);
314832
315494
  }
314833
315495
  if (isBehindDoc)
314834
315496
  behindDocFragments.push({
314835
315497
  fragment: fragment2,
314836
315498
  originalIndex: fi
314837
315499
  });
315500
+ else if (this.isHeaderFooterAbsoluteOverlayFragment(fragment2, kind, resolvedItem))
315501
+ absoluteOverlayFragments.push({
315502
+ fragment: fragment2,
315503
+ originalIndex: fi
315504
+ });
314838
315505
  else
314839
315506
  normalFragments.push({
314840
315507
  fragment: fragment2,
314841
315508
  originalIndex: fi
314842
315509
  });
314843
315510
  }
314844
- const behindDocSelector = `[data-behind-doc-section="${kind}"]`;
314845
315511
  pageEl.querySelectorAll(behindDocSelector).forEach((el) => el.remove());
315512
+ pageEl.querySelectorAll(overlaySelector).forEach((el) => el.remove());
314846
315513
  behindDocFragments.forEach(({ fragment: fragment2, originalIndex }) => {
314847
315514
  const resolvedItem = data.items?.[originalIndex];
314848
315515
  const fragEl = this.renderFragment(fragment2, context, undefined, betweenBorderFlags.get(originalIndex), resolvedItem);
@@ -314855,11 +315522,12 @@ menclose::after {
314855
315522
  pageY = fragment2.y;
314856
315523
  else
314857
315524
  pageY = effectiveOffset + fragment2.y + (kind === "footer" ? footerYOffset : 0);
315525
+ const isHorizontallyPageRelative = this.isHorizontallyPageRelativeAnchoredFragment(fragment2, resolvedItem);
314858
315526
  fragEl.style.top = `${pageY}px`;
314859
- fragEl.style.left = `${isPageRelative ? fragment2.x : marginLeft + fragment2.x}px`;
315527
+ fragEl.style.left = `${isHorizontallyPageRelative ? fragment2.x : marginLeft + fragment2.x}px`;
314860
315528
  fragEl.style.zIndex = "0";
314861
315529
  fragEl.dataset.behindDocSection = kind;
314862
- pageEl.insertBefore(fragEl, pageEl.firstChild);
315530
+ this.insertPageBackgroundDecoration(pageEl, fragEl, this.getPageBackgroundDecorationZOrder(fragment2, resolvedItem));
314863
315531
  });
314864
315532
  normalFragments.forEach(({ fragment: fragment2, originalIndex }) => {
314865
315533
  const resolvedItem = data.items?.[originalIndex];
@@ -314878,6 +315546,27 @@ menclose::after {
314878
315546
  });
314879
315547
  if (!existing)
314880
315548
  pageEl.appendChild(container);
315549
+ absoluteOverlayFragments.forEach(({ fragment: fragment2, originalIndex }) => {
315550
+ const resolvedItem = data.items?.[originalIndex];
315551
+ const fragEl = this.renderFragment(fragment2, context, undefined, betweenBorderFlags.get(originalIndex), resolvedItem);
315552
+ const isPageRelative = this.isPageRelativeAnchoredFragment(fragment2, resolvedItem);
315553
+ this.applyHeaderFooterTextWatermarkPreviewOpacity(fragEl, data.isActiveHeaderFooter === true);
315554
+ let pageY;
315555
+ if (isPageRelative && kind === "footer")
315556
+ pageY = footerAnchorPageOriginY + fragment2.y;
315557
+ else if (isPageRelative)
315558
+ pageY = fragment2.y;
315559
+ else
315560
+ pageY = effectiveOffset + fragment2.y + (kind === "footer" ? footerYOffset : 0);
315561
+ const isHorizontallyPageRelative = this.isHorizontallyPageRelativeAnchoredFragment(fragment2, resolvedItem);
315562
+ fragEl.style.top = `${pageY}px`;
315563
+ fragEl.style.left = `${isHorizontallyPageRelative ? fragment2.x : marginLeft + fragment2.x}px`;
315564
+ fragEl.style.zIndex = "0";
315565
+ if (data.isActiveHeaderFooter !== true)
315566
+ fragEl.style.pointerEvents = "none";
315567
+ fragEl.dataset.headerFooterOverlaySection = kind;
315568
+ this.insertPageBackgroundDecoration(pageEl, fragEl, this.getPageBackgroundDecorationZOrder(fragment2, resolvedItem));
315569
+ });
314881
315570
  }
314882
315571
  resetState() {
314883
315572
  if (this.mount) {
@@ -315302,6 +315991,19 @@ menclose::after {
315302
315991
  innerWrapper.style.width = `${fragment2.geometry.width}px`;
315303
315992
  innerWrapper.style.height = `${fragment2.geometry.height}px`;
315304
315993
  innerWrapper.style.transformOrigin = "center";
315994
+ if (block.drawingKind === "shapeGroup" && block.groupTransform) {
315995
+ const effectExtent = block.effectExtent ?? {
315996
+ left: 0,
315997
+ top: 0,
315998
+ right: 0,
315999
+ bottom: 0
316000
+ };
316001
+ const groupWidth = block.groupTransform.width ?? Math.max(0, block.geometry.width - effectExtent.left - effectExtent.right);
316002
+ const groupHeight = block.groupTransform.height ?? Math.max(0, block.geometry.height - effectExtent.top - effectExtent.bottom);
316003
+ const originX = effectExtent.left + groupWidth / 2;
316004
+ const originY = effectExtent.top + groupHeight / 2;
316005
+ innerWrapper.style.transformOrigin = `${originX}px ${originY}px`;
316006
+ }
315305
316007
  const scale = fragment2.scale ?? 1;
315306
316008
  const transforms = ["translate(-50%, -50%)"];
315307
316009
  transforms.push(`rotate(${fragment2.geometry.rotation ?? 0}deg)`);
@@ -315328,7 +316030,7 @@ menclose::after {
315328
316030
  if (block.drawingKind === "vectorShape" || block.drawingKind === "textboxShape")
315329
316031
  return this.createVectorShapeElement(block, fragment2.geometry, false, 1, 1, context, fragment2);
315330
316032
  if (block.drawingKind === "shapeGroup")
315331
- return this.createShapeGroupElement(block, context);
316033
+ return this.createShapeGroupElement(block, context, fragment2.geometry);
315332
316034
  if (block.drawingKind === "chart")
315333
316035
  return this.createChartElement(block);
315334
316036
  return this.createDrawingPlaceholder();
@@ -315360,12 +316062,14 @@ menclose::after {
315360
316062
  svgElement.setAttribute("width", "100%");
315361
316063
  svgElement.setAttribute("height", "100%");
315362
316064
  svgElement.style.display = "block";
316065
+ svgElement.style.overflow = "visible";
315363
316066
  if (block.fillColor && typeof block.fillColor === "object") {
315364
316067
  if ("type" in block.fillColor && block.fillColor.type === "gradient")
315365
316068
  applyGradientToSVG(svgElement, block.fillColor);
315366
316069
  else if ("type" in block.fillColor && block.fillColor.type === "solidWithAlpha")
315367
316070
  applyAlphaToSVG(svgElement, block.fillColor);
315368
316071
  }
316072
+ this.applyShapeEffects(svgElement, block);
315369
316073
  this.applyLineEnds(svgElement, block);
315370
316074
  contentContainer.appendChild(svgElement);
315371
316075
  if (block.drawingKind === "textboxShape" || this.hasShapeTextContent(block.textContent)) {
@@ -315616,19 +316320,40 @@ menclose::after {
315616
316320
  textDiv.style.textAlign = "right";
315617
316321
  else
315618
316322
  textDiv.style.textAlign = "left";
315619
- let currentParagraph = this.doc.createElement("div");
315620
- currentParagraph.style.width = "100%";
315621
- currentParagraph.style.minWidth = "0";
315622
- currentParagraph.style.whiteSpace = "normal";
316323
+ const paragraphSpacing = textContent$1.paragraphs;
316324
+ const spacingBefore = (index2) => paragraphSpacing?.[index2]?.spacing?.before;
316325
+ const spacingAfter = (index2) => paragraphSpacing?.[index2]?.spacing?.after;
316326
+ const createParagraphElement = () => {
316327
+ const paragraph2 = this.doc.createElement("div");
316328
+ paragraph2.style.width = "100%";
316329
+ paragraph2.style.minWidth = "0";
316330
+ paragraph2.style.whiteSpace = "normal";
316331
+ paragraph2.style.marginLeft = "0";
316332
+ paragraph2.style.marginRight = "0";
316333
+ return paragraph2;
316334
+ };
316335
+ let logicalParagraphIndex = 0;
316336
+ let currentParagraph = createParagraphElement();
316337
+ const firstParagraphBefore = spacingBefore(logicalParagraphIndex);
316338
+ if (typeof firstParagraphBefore === "number")
316339
+ currentParagraph.style.marginTop = `${firstParagraphBefore}px`;
315623
316340
  textContent$1.parts.forEach((part) => {
315624
316341
  if (part.isLineBreak) {
316342
+ if (part.isParagraphBoundary) {
316343
+ const currentParagraphAfter = spacingAfter(logicalParagraphIndex);
316344
+ if (typeof currentParagraphAfter === "number")
316345
+ currentParagraph.style.marginBottom = `${currentParagraphAfter}px`;
316346
+ }
315625
316347
  textDiv.appendChild(currentParagraph);
315626
- currentParagraph = this.doc.createElement("div");
315627
- currentParagraph.style.width = "100%";
315628
- currentParagraph.style.minWidth = "0";
315629
- currentParagraph.style.whiteSpace = "normal";
316348
+ currentParagraph = createParagraphElement();
315630
316349
  if (part.isEmptyParagraph)
315631
316350
  currentParagraph.style.minHeight = "1em";
316351
+ if (part.isParagraphBoundary) {
316352
+ logicalParagraphIndex += 1;
316353
+ const nextParagraphBefore = spacingBefore(logicalParagraphIndex);
316354
+ if (typeof nextParagraphBefore === "number")
316355
+ currentParagraph.style.marginTop = `${nextParagraphBefore}px`;
316356
+ }
315632
316357
  } else if (part.kind === "image" && part.src)
315633
316358
  currentParagraph.appendChild(createShapeTextImageElement(this.doc, part));
315634
316359
  else {
@@ -315654,6 +316379,9 @@ menclose::after {
315654
316379
  currentParagraph.appendChild(span);
315655
316380
  }
315656
316381
  });
316382
+ const finalParagraphAfter = spacingAfter(logicalParagraphIndex);
316383
+ if (typeof finalParagraphAfter === "number")
316384
+ currentParagraph.style.marginBottom = `${finalParagraphAfter}px`;
315657
316385
  textDiv.appendChild(currentParagraph);
315658
316386
  return textDiv;
315659
316387
  }
@@ -315705,6 +316433,7 @@ menclose::after {
315705
316433
  const viewH = firstPath.h || height;
315706
316434
  if (viewW === 0 || viewH === 0)
315707
316435
  return null;
316436
+ const explicitStrokeEffect = viewW / width > 10 || viewH / height > 10 ? ' vector-effect="non-scaling-stroke"' : "";
315708
316437
  const edgeStroke = fillColor !== "none" && strokeColor === "none" ? ` stroke="${fillColor}" stroke-width="0.5" vector-effect="non-scaling-stroke"` : "";
315709
316438
  return `<svg xmlns="http://www.w3.org/2000/svg" width="${width}" height="${height}" viewBox="0 0 ${viewW} ${viewH}" preserveAspectRatio="none">
315710
316439
  ${custGeom.paths.map((p$12) => {
@@ -315714,7 +316443,7 @@ menclose::after {
315714
316443
  const scaleX = viewW / pathW;
315715
316444
  const scaleY = viewH / pathH;
315716
316445
  const transform = needsTransform ? ` transform="scale(${scaleX}, ${scaleY})"` : "";
315717
- const strokeAttr = strokeColor !== "none" ? ` stroke="${strokeColor}" stroke-width="${strokeWidth}"` : edgeStroke;
316446
+ const strokeAttr = strokeColor !== "none" ? ` stroke="${strokeColor}" stroke-width="${strokeWidth}"${explicitStrokeEffect}` : edgeStroke;
315718
316447
  return `<path d="${p$12.d}" fill="${fillColor}" fill-rule="evenodd"${strokeAttr}${transform} />`;
315719
316448
  }).join(`
315720
316449
  `)}
@@ -315788,6 +316517,112 @@ menclose::after {
315788
316517
  target.setAttribute("marker-end", `url(#${id2})`);
315789
316518
  }
315790
316519
  }
316520
+ applyShapeEffects(svgElement, block) {
316521
+ const outerShadow = block.effects?.outerShadow;
316522
+ if (!outerShadow)
316523
+ return;
316524
+ this.applyOuterShadowEffect(svgElement, block.id, outerShadow);
316525
+ }
316526
+ applyOuterShadowEffect(svgElement, blockId, shadow) {
316527
+ const targets = this.findShapeEffectTargets(svgElement);
316528
+ if (!targets.length)
316529
+ return;
316530
+ const defs = this.ensureSvgDefs(svgElement);
316531
+ const filterId = this.sanitizeSvgId(`sd-shadow-${blockId}`);
316532
+ const outlineFilterId = this.sanitizeSvgId(`sd-shadow-outline-${blockId}`);
316533
+ if (!defs.querySelector(`#${filterId}`)) {
316534
+ const filter = this.doc.createElementNS("http://www.w3.org/2000/svg", "filter");
316535
+ filter.setAttribute("id", filterId);
316536
+ filter.setAttribute("x", "-50%");
316537
+ filter.setAttribute("y", "-50%");
316538
+ filter.setAttribute("width", "200%");
316539
+ filter.setAttribute("height", "200%");
316540
+ const { dx, dy } = resolveOuterShadowOffset(shadow);
316541
+ const dropShadow = this.doc.createElementNS("http://www.w3.org/2000/svg", "feDropShadow");
316542
+ dropShadow.setAttribute("dx", this.formatSvgNumber(dx));
316543
+ dropShadow.setAttribute("dy", this.formatSvgNumber(dy));
316544
+ dropShadow.setAttribute("stdDeviation", this.formatSvgNumber(getOuterShadowStdDeviation(shadow)));
316545
+ dropShadow.setAttribute("flood-color", shadow.color);
316546
+ dropShadow.setAttribute("flood-opacity", this.formatSvgNumber(shadow.opacity));
316547
+ filter.appendChild(dropShadow);
316548
+ defs.appendChild(filter);
316549
+ }
316550
+ targets.forEach((target) => {
316551
+ if (this.shouldRenderFilledShadowClone(target)) {
316552
+ this.appendFilledShadowClone(svgElement, defs, target, outlineFilterId, shadow);
316553
+ return;
316554
+ }
316555
+ target.setAttribute("filter", `url(#${filterId})`);
316556
+ });
316557
+ }
316558
+ findShapeEffectTargets(svgElement) {
316559
+ return Array.from(svgElement.querySelectorAll("path, line, polyline, polygon, rect, ellipse, circle")).filter((target) => !target.closest("defs") && !target.hasAttribute("data-sd-shadow-clone"));
316560
+ }
316561
+ shouldRenderFilledShadowClone(target) {
316562
+ if (target.getAttribute("fill") !== "none")
316563
+ return false;
316564
+ if (target.tagName.toLowerCase() === "path")
316565
+ return /z\s*$/i.test(target.getAttribute("d") ?? "");
316566
+ return [
316567
+ "polygon",
316568
+ "rect",
316569
+ "ellipse",
316570
+ "circle"
316571
+ ].includes(target.tagName.toLowerCase());
316572
+ }
316573
+ appendFilledShadowClone(svgElement, defs, target, filterId, shadow) {
316574
+ this.ensureOuterShadowOnlyFilter(defs, filterId, shadow);
316575
+ const clone$1 = target.cloneNode(false);
316576
+ clone$1.setAttribute("data-sd-shadow-clone", filterId);
316577
+ clone$1.setAttribute("aria-hidden", "true");
316578
+ clone$1.setAttribute("fill", "#000000");
316579
+ clone$1.setAttribute("stroke", "none");
316580
+ clone$1.setAttribute("filter", `url(#${filterId})`);
316581
+ target.parentNode?.insertBefore(clone$1, target);
316582
+ }
316583
+ ensureOuterShadowOnlyFilter(defs, filterId, shadow) {
316584
+ if (defs.querySelector(`#${filterId}`))
316585
+ return;
316586
+ const filter = this.doc.createElementNS("http://www.w3.org/2000/svg", "filter");
316587
+ filter.setAttribute("id", filterId);
316588
+ filter.setAttribute("x", "-50%");
316589
+ filter.setAttribute("y", "-50%");
316590
+ filter.setAttribute("width", "200%");
316591
+ filter.setAttribute("height", "200%");
316592
+ const blur = this.doc.createElementNS("http://www.w3.org/2000/svg", "feGaussianBlur");
316593
+ blur.setAttribute("in", "SourceAlpha");
316594
+ blur.setAttribute("stdDeviation", this.formatSvgNumber(getOuterShadowStdDeviation(shadow)));
316595
+ blur.setAttribute("result", "blur");
316596
+ const { dx, dy } = resolveOuterShadowOffset(shadow);
316597
+ const offset$1 = this.doc.createElementNS("http://www.w3.org/2000/svg", "feOffset");
316598
+ offset$1.setAttribute("in", "blur");
316599
+ offset$1.setAttribute("dx", this.formatSvgNumber(dx));
316600
+ offset$1.setAttribute("dy", this.formatSvgNumber(dy));
316601
+ offset$1.setAttribute("result", "offsetBlur");
316602
+ const flood = this.doc.createElementNS("http://www.w3.org/2000/svg", "feFlood");
316603
+ flood.setAttribute("flood-color", shadow.color);
316604
+ flood.setAttribute("flood-opacity", this.formatSvgNumber(shadow.opacity));
316605
+ flood.setAttribute("result", "shadowColor");
316606
+ const composite = this.doc.createElementNS("http://www.w3.org/2000/svg", "feComposite");
316607
+ composite.setAttribute("in", "shadowColor");
316608
+ composite.setAttribute("in2", "offsetBlur");
316609
+ composite.setAttribute("operator", "in");
316610
+ composite.setAttribute("result", "shadow");
316611
+ const outsideOnly = this.doc.createElementNS("http://www.w3.org/2000/svg", "feComposite");
316612
+ outsideOnly.setAttribute("in", "shadow");
316613
+ outsideOnly.setAttribute("in2", "SourceAlpha");
316614
+ outsideOnly.setAttribute("operator", "out");
316615
+ outsideOnly.setAttribute("result", "outerShadow");
316616
+ filter.appendChild(blur);
316617
+ filter.appendChild(offset$1);
316618
+ filter.appendChild(flood);
316619
+ filter.appendChild(composite);
316620
+ filter.appendChild(outsideOnly);
316621
+ defs.appendChild(filter);
316622
+ }
316623
+ formatSvgNumber(value) {
316624
+ return Number.isFinite(value) ? Number(value.toFixed(4)).toString() : "0";
316625
+ }
315791
316626
  findLineEndTarget(svgElement) {
315792
316627
  const line = svgElement.querySelector("line");
315793
316628
  if (line)
@@ -315876,7 +316711,7 @@ menclose::after {
315876
316711
  target.style.removeProperty("transform-origin");
315877
316712
  }
315878
316713
  }
315879
- createShapeGroupElement(block, context) {
316714
+ createShapeGroupElement(block, context, fragmentGeometry) {
315880
316715
  const groupEl = this.doc.createElement("div");
315881
316716
  groupEl.classList.add("superdoc-shape-group");
315882
316717
  groupEl.style.position = "relative";
@@ -315884,32 +316719,56 @@ menclose::after {
315884
316719
  groupEl.style.height = "100%";
315885
316720
  const groupTransform = block.groupTransform;
315886
316721
  let contentContainer = groupEl;
315887
- const visibleWidth = groupTransform?.width ?? block.geometry.width ?? 0;
315888
- const visibleHeight = groupTransform?.height ?? block.geometry.height ?? 0;
315889
- if (groupTransform) {
316722
+ const groupEffectExtent = block.effectExtent ?? {
316723
+ left: 0,
316724
+ top: 0,
316725
+ right: 0,
316726
+ bottom: 0
316727
+ };
316728
+ const hasGroupEffectExtent = groupEffectExtent.left > 0 || groupEffectExtent.top > 0 || groupEffectExtent.right > 0 || groupEffectExtent.bottom > 0;
316729
+ const visibleWidth = groupTransform?.width ?? Math.max(0, (block.geometry.width ?? 0) - groupEffectExtent.left - groupEffectExtent.right);
316730
+ const visibleHeight = groupTransform?.height ?? Math.max(0, (block.geometry.height ?? 0) - groupEffectExtent.top - groupEffectExtent.bottom);
316731
+ if (groupTransform || hasGroupEffectExtent) {
315890
316732
  const inner = this.doc.createElement("div");
315891
316733
  inner.style.position = "absolute";
315892
- inner.style.left = "0";
315893
- inner.style.top = "0";
316734
+ inner.style.left = `${groupEffectExtent.left}px`;
316735
+ inner.style.top = `${groupEffectExtent.top}px`;
315894
316736
  inner.style.width = `${Math.max(1, visibleWidth)}px`;
315895
316737
  inner.style.height = `${Math.max(1, visibleHeight)}px`;
316738
+ const groupTransforms = [];
316739
+ const normalizedGroupRotation = typeof groupTransform?.rotation === "number" ? normalizeRotationDegrees(groupTransform.rotation) : 0;
316740
+ const normalizedFragmentRotation = typeof fragmentGeometry?.rotation === "number" ? normalizeRotationDegrees(fragmentGeometry.rotation) : 0;
316741
+ const groupRotation = normalizedGroupRotation && normalizedGroupRotation !== normalizedFragmentRotation ? groupTransform?.rotation ?? 0 : 0;
316742
+ const groupFlipH = groupTransform?.flipH && groupTransform.flipH !== fragmentGeometry?.flipH;
316743
+ const groupFlipV = groupTransform?.flipV && groupTransform.flipV !== fragmentGeometry?.flipV;
316744
+ if (groupRotation)
316745
+ groupTransforms.push(`rotate(${groupRotation}deg)`);
316746
+ if (groupFlipH)
316747
+ groupTransforms.push("scaleX(-1)");
316748
+ if (groupFlipV)
316749
+ groupTransforms.push("scaleY(-1)");
316750
+ if (groupTransforms.length > 0) {
316751
+ inner.style.transformOrigin = "center";
316752
+ inner.style.transform = groupTransforms.join(" ");
316753
+ }
315896
316754
  groupEl.appendChild(inner);
315897
316755
  contentContainer = inner;
315898
316756
  }
315899
- block.shapes.forEach((child) => {
315900
- const childContent = this.createGroupChildContent(child, 1, 1, context);
316757
+ block.shapes.forEach((child, childIndex) => {
316758
+ const attrs = child.attrs ?? {};
316759
+ const paintExtent = this.getShapeGroupChildPaintExtent(child);
316760
+ const childContent = this.createGroupChildContent(child, 1, 1, context, paintExtent, block.id, childIndex);
315901
316761
  if (!childContent)
315902
316762
  return;
315903
- const attrs = child.attrs ?? {};
315904
316763
  const wrapper = this.doc.createElement("div");
315905
316764
  wrapper.classList.add("superdoc-shape-group__child");
315906
316765
  wrapper.style.position = "absolute";
315907
- wrapper.style.left = `${Number(attrs.x ?? 0)}px`;
315908
- wrapper.style.top = `${Number(attrs.y ?? 0)}px`;
316766
+ wrapper.style.left = `${Number(attrs.x ?? 0) - paintExtent.left}px`;
316767
+ wrapper.style.top = `${Number(attrs.y ?? 0) - paintExtent.top}px`;
315909
316768
  const childW = typeof attrs.width === "number" ? attrs.width : block.geometry.width;
315910
316769
  const childH = typeof attrs.height === "number" ? attrs.height : block.geometry.height;
315911
- wrapper.style.width = `${Math.max(1, childW)}px`;
315912
- wrapper.style.height = `${Math.max(1, childH)}px`;
316770
+ wrapper.style.width = `${Math.max(1, childW + paintExtent.left + paintExtent.right)}px`;
316771
+ wrapper.style.height = `${Math.max(1, childH + paintExtent.top + paintExtent.bottom)}px`;
315913
316772
  wrapper.style.transformOrigin = "center";
315914
316773
  const transforms = [];
315915
316774
  if (attrs.rotation)
@@ -315927,20 +316786,63 @@ menclose::after {
315927
316786
  });
315928
316787
  return groupEl;
315929
316788
  }
315930
- createGroupChildContent(child, groupScaleX = 1, groupScaleY = 1, context) {
316789
+ getShapeGroupChildPaintExtent(child) {
316790
+ if (child.shapeType !== "vectorShape" || !("fillColor" in child.attrs))
316791
+ return {
316792
+ left: 0,
316793
+ top: 0,
316794
+ right: 0,
316795
+ bottom: 0
316796
+ };
316797
+ const attrs = child.attrs;
316798
+ const shadowExtent = attrs.effects?.outerShadow ? getOuterShadowPaintExtent(attrs.effects.outerShadow) : {
316799
+ left: 0,
316800
+ top: 0,
316801
+ right: 0,
316802
+ bottom: 0
316803
+ };
316804
+ if (attrs.lineEnds)
316805
+ return {
316806
+ left: 0,
316807
+ top: 0,
316808
+ right: 0,
316809
+ bottom: 0
316810
+ };
316811
+ if (attrs.strokeColor === null)
316812
+ return shadowExtent;
316813
+ const rawStrokeWidth = child.attrs.strokeWidth;
316814
+ const parsedStrokeWidth = typeof rawStrokeWidth === "number" ? rawStrokeWidth : typeof rawStrokeWidth === "string" && rawStrokeWidth.trim() !== "" ? Number(rawStrokeWidth) : undefined;
316815
+ const strokeWidth = parsedStrokeWidth != null && Number.isFinite(parsedStrokeWidth) ? parsedStrokeWidth : 1;
316816
+ if (strokeWidth <= 0)
316817
+ return shadowExtent;
316818
+ const extent = strokeWidth / 2;
316819
+ return {
316820
+ left: Math.max(extent, shadowExtent.left),
316821
+ top: Math.max(extent, shadowExtent.top),
316822
+ right: Math.max(extent, shadowExtent.right),
316823
+ bottom: Math.max(extent, shadowExtent.bottom)
316824
+ };
316825
+ }
316826
+ createGroupChildContent(child, groupScaleX = 1, groupScaleY = 1, context, paintExtent = {
316827
+ left: 0,
316828
+ top: 0,
316829
+ right: 0,
316830
+ bottom: 0
316831
+ }, groupId, childIndex) {
315931
316832
  if (child.shapeType === "vectorShape" && "fillColor" in child.attrs) {
315932
316833
  const attrs = child.attrs;
315933
316834
  const childGeometry = {
315934
- width: attrs.width ?? 0,
315935
- height: attrs.height ?? 0,
316835
+ width: (attrs.width ?? 0) + paintExtent.left + paintExtent.right,
316836
+ height: (attrs.height ?? 0) + paintExtent.top + paintExtent.bottom,
315936
316837
  rotation: attrs.rotation ?? 0,
315937
316838
  flipH: attrs.flipH ?? false,
315938
316839
  flipV: attrs.flipV ?? false
315939
316840
  };
316841
+ const hasPaintExtent = paintExtent.left > 0 || paintExtent.top > 0 || paintExtent.right > 0 || paintExtent.bottom > 0;
315940
316842
  const vectorChild = {
315941
316843
  drawingKind: "vectorShape",
315942
316844
  kind: "drawing",
315943
- id: `${attrs.shapeId ?? child.shapeType}`,
316845
+ id: groupId != null ? `${groupId}-${childIndex ?? 0}-${attrs.shapeId ?? child.shapeType}` : `${attrs.shapeId ?? child.shapeType}`,
315944
316846
  geometry: childGeometry,
315945
316847
  padding: undefined,
315946
316848
  margin: undefined,
@@ -315955,10 +316857,12 @@ menclose::after {
315955
316857
  strokeColor: attrs.strokeColor,
315956
316858
  strokeWidth: attrs.strokeWidth,
315957
316859
  lineEnds: attrs.lineEnds,
316860
+ effects: attrs.effects,
315958
316861
  textContent: attrs.textContent,
315959
316862
  textAlign: attrs.textAlign,
315960
316863
  textVerticalAlign: attrs.textVerticalAlign,
315961
- textInsets: attrs.textInsets
316864
+ textInsets: attrs.textInsets,
316865
+ effectExtent: hasPaintExtent ? paintExtent : undefined
315962
316866
  };
315963
316867
  return this.createVectorShapeElement(vectorChild, childGeometry, false, groupScaleX, groupScaleY, context);
315964
316868
  }
@@ -316590,11 +317494,20 @@ menclose::after {
316590
317494
  if (!attrs || typeof attrs !== "object")
316591
317495
  return "";
316592
317496
  return readClipPathValue(attrs.clipPath);
317497
+ }, resolveShapeClipPathFromAttrs = (attrs) => {
317498
+ if (!attrs || typeof attrs !== "object")
317499
+ return "";
317500
+ return readClipPathValue(attrs.shapeClipPath);
316593
317501
  }, resolveBlockClipPath = (block) => {
316594
317502
  if (!block || typeof block !== "object")
316595
317503
  return "";
316596
317504
  const record = block;
316597
317505
  return readClipPathValue(record.clipPath) || resolveClipPathFromAttrs(record.attrs);
317506
+ }, resolveBlockShapeClipPath = (block) => {
317507
+ if (!block || typeof block !== "object")
317508
+ return "";
317509
+ const record = block;
317510
+ return readClipPathValue(record.shapeClipPath) || resolveShapeClipPathFromAttrs(record.attrs);
316598
317511
  }, imageHyperlinkVersion = (hyperlink) => {
316599
317512
  if (!hyperlink)
316600
317513
  return "";
@@ -316633,7 +317546,8 @@ menclose::after {
316633
317546
  image2.flipH ? 1 : 0,
316634
317547
  image2.flipV ? 1 : 0,
316635
317548
  imageHyperlinkVersion(image2.hyperlink),
316636
- resolveBlockClipPath(image2)
317549
+ resolveBlockClipPath(image2),
317550
+ resolveBlockShapeClipPath(image2)
316637
317551
  ].join("|"), renderedInlineImageRunVersion = (image2) => [
316638
317552
  "img",
316639
317553
  image2.src ?? "",
@@ -316642,6 +317556,8 @@ menclose::after {
316642
317556
  image2.alt ?? "",
316643
317557
  image2.title ?? "",
316644
317558
  typeof image2.clipPath === "string" ? image2.clipPath.trim() : "",
317559
+ typeof image2.shapeClipPath === "string" ? image2.shapeClipPath.trim() : "",
317560
+ image2.objectFit ?? "",
316645
317561
  image2.distTop ?? "",
316646
317562
  image2.distBottom ?? "",
316647
317563
  image2.distLeft ?? "",
@@ -316840,7 +317756,9 @@ menclose::after {
316840
317756
  vector.geometry.flipV ? 1 : 0,
316841
317757
  drawingTextVersion(vector),
316842
317758
  block.anchor?.offsetH ?? "",
316843
- block.anchor?.offsetV ?? ""
317759
+ block.anchor?.offsetV ?? "",
317760
+ vector.effects ? JSON.stringify(vector.effects) : "",
317761
+ vector.effectExtent ? JSON.stringify(vector.effectExtent) : ""
316844
317762
  ].join("|");
316845
317763
  }
316846
317764
  if (block.drawingKind === "shapeGroup") {
@@ -316850,6 +317768,7 @@ menclose::after {
316850
317768
  "drawing:group",
316851
317769
  group.geometry.width,
316852
317770
  group.geometry.height,
317771
+ group.effectExtent ? JSON.stringify(group.effectExtent) : "",
316853
317772
  group.groupTransform ? JSON.stringify(group.groupTransform) : "",
316854
317773
  childSignature
316855
317774
  ].join("|");
@@ -317545,6 +318464,7 @@ menclose::after {
317545
318464
  JSON.stringify(block.customGeometry ?? null),
317546
318465
  JSON.stringify(block.lineEnds ?? null),
317547
318466
  JSON.stringify(block.effectExtent ?? null),
318467
+ JSON.stringify(block.effects ?? null),
317548
318468
  JSON.stringify(block.textContent ?? null),
317549
318469
  block.textAlign ?? "",
317550
318470
  block.textVerticalAlign ?? "",
@@ -317708,7 +318628,7 @@ menclose::after {
317708
318628
  return `${block.id}:table:${contentHash}${tableAttrsKey}`;
317709
318629
  }
317710
318630
  if (block.kind !== "paragraph")
317711
- return block.id;
318631
+ return hashNonParagraphCellBlock(block);
317712
318632
  const trackedMode = block.attrs && "trackedChangesMode" in block.attrs && block.attrs.trackedChangesMode || "review";
317713
318633
  const trackedEnabled = resolveTrackedChangesEnabled(block.attrs, true);
317714
318634
  const runsHash = block.runs.map((run2) => {
@@ -318577,7 +319497,7 @@ menclose::after {
318577
319497
  }
318578
319498
  return true;
318579
319499
  }, imageRunsEqual = (a2, b$1) => {
318580
- return a2.src === b$1.src && a2.width === b$1.width && a2.height === b$1.height && a2.alt === b$1.alt && a2.title === b$1.title && a2.clipPath === b$1.clipPath && a2.distTop === b$1.distTop && a2.distBottom === b$1.distBottom && a2.distLeft === b$1.distLeft && a2.distRight === b$1.distRight && a2.verticalAlign === b$1.verticalAlign && a2.rotation === b$1.rotation && a2.flipH === b$1.flipH && a2.flipV === b$1.flipV && a2.gain === b$1.gain && a2.blacklevel === b$1.blacklevel && a2.grayscale === b$1.grayscale && jsonEqual(a2.lum, b$1.lum) && jsonEqual(a2.hyperlink, b$1.hyperlink) && jsonEqual(a2.sdt, b$1.sdt) && shallowRecordEqual(a2.dataAttrs, b$1.dataAttrs);
319500
+ return a2.src === b$1.src && a2.width === b$1.width && a2.height === b$1.height && a2.alt === b$1.alt && a2.title === b$1.title && a2.clipPath === b$1.clipPath && a2.shapeClipPath === b$1.shapeClipPath && a2.objectFit === b$1.objectFit && a2.distTop === b$1.distTop && a2.distBottom === b$1.distBottom && a2.distLeft === b$1.distLeft && a2.distRight === b$1.distRight && a2.verticalAlign === b$1.verticalAlign && a2.rotation === b$1.rotation && a2.flipH === b$1.flipH && a2.flipV === b$1.flipV && a2.gain === b$1.gain && a2.blacklevel === b$1.blacklevel && a2.grayscale === b$1.grayscale && jsonEqual(a2.lum, b$1.lum) && jsonEqual(a2.hyperlink, b$1.hyperlink) && jsonEqual(a2.sdt, b$1.sdt) && shallowRecordEqual(a2.dataAttrs, b$1.dataAttrs);
318581
319501
  }, imageBlocksEqual = (a2, b$1) => {
318582
319502
  return a2.src === b$1.src && a2.width === b$1.width && a2.height === b$1.height && a2.alt === b$1.alt && a2.title === b$1.title && a2.objectFit === b$1.objectFit && a2.display === b$1.display && boxSpacingEqual(a2.margin, b$1.margin) && boxSpacingEqual(a2.padding, b$1.padding) && imageAnchorEqual(a2.anchor, b$1.anchor) && imageWrapEqual(a2.wrap, b$1.wrap) && shallowRecordEqual(a2.attrs, b$1.attrs);
318583
319503
  }, drawingBlocksEqual = (a2, b$1) => {
@@ -318603,10 +319523,10 @@ menclose::after {
318603
319523
  return imageBlocksEqual(a2, b$1);
318604
319524
  if ((a2.drawingKind === "vectorShape" || a2.drawingKind === "textboxShape") && (b$1.drawingKind === "vectorShape" || b$1.drawingKind === "textboxShape")) {
318605
319525
  const textboxContentEqual = a2.drawingKind !== "textboxShape" || b$1.drawingKind !== "textboxShape" || jsonEqual(a2.contentBlocks, b$1.contentBlocks);
318606
- return drawingGeometryEqual(a2.geometry, b$1.geometry) && a2.shapeKind === b$1.shapeKind && a2.fillColor === b$1.fillColor && a2.strokeColor === b$1.strokeColor && a2.strokeWidth === b$1.strokeWidth && a2.textAlign === b$1.textAlign && a2.textVerticalAlign === b$1.textVerticalAlign && jsonEqual(a2.textInsets, b$1.textInsets) && jsonEqual(a2.textContent, b$1.textContent) && jsonEqual(a2.customGeometry, b$1.customGeometry) && jsonEqual(a2.lineEnds, b$1.lineEnds) && jsonEqual(a2.effectExtent, b$1.effectExtent) && textboxContentEqual;
319526
+ return drawingGeometryEqual(a2.geometry, b$1.geometry) && a2.shapeKind === b$1.shapeKind && jsonEqual(a2.customGeometry, b$1.customGeometry) && a2.fillColor === b$1.fillColor && a2.strokeColor === b$1.strokeColor && a2.strokeWidth === b$1.strokeWidth && a2.textAlign === b$1.textAlign && a2.textVerticalAlign === b$1.textVerticalAlign && jsonEqual(a2.textInsets, b$1.textInsets) && jsonEqual(a2.textContent, b$1.textContent) && jsonEqual(a2.lineEnds, b$1.lineEnds) && jsonEqual(a2.effects, b$1.effects) && jsonEqual(a2.effectExtent, b$1.effectExtent) && textboxContentEqual;
318607
319527
  }
318608
319528
  if (a2.drawingKind === "shapeGroup" && b$1.drawingKind === "shapeGroup")
318609
- return drawingGeometryEqual(a2.geometry, b$1.geometry) && shapeGroupTransformEqual(a2.groupTransform, b$1.groupTransform) && shapeGroupSizeEqual(a2.size, b$1.size) && shapeGroupChildrenEqual(a2.shapes, b$1.shapes);
319529
+ return drawingGeometryEqual(a2.geometry, b$1.geometry) && jsonEqual(a2.effectExtent, b$1.effectExtent) && shapeGroupTransformEqual(a2.groupTransform, b$1.groupTransform) && shapeGroupSizeEqual(a2.size, b$1.size) && shapeGroupChildrenEqual(a2.shapes, b$1.shapes);
318610
319530
  if (a2.drawingKind === "chart" && b$1.drawingKind === "chart")
318611
319531
  return drawingGeometryEqual(a2.geometry, b$1.geometry) && a2.chartRelId === b$1.chartRelId && jsonEqual(a2.chartData, b$1.chartData);
318612
319532
  return true;
@@ -318658,7 +319578,7 @@ menclose::after {
318658
319578
  return true;
318659
319579
  if (!a2 || !b$1)
318660
319580
  return !a2 && !b$1;
318661
- return a2.x === b$1.x && a2.y === b$1.y && a2.width === b$1.width && a2.height === b$1.height && a2.childX === b$1.childX && a2.childY === b$1.childY && a2.childWidth === b$1.childWidth && a2.childHeight === b$1.childHeight && a2.childOriginXEmu === b$1.childOriginXEmu && a2.childOriginYEmu === b$1.childOriginYEmu;
319581
+ return a2.x === b$1.x && a2.y === b$1.y && a2.width === b$1.width && a2.height === b$1.height && a2.childX === b$1.childX && a2.childY === b$1.childY && a2.childWidth === b$1.childWidth && a2.childHeight === b$1.childHeight && a2.childOriginXEmu === b$1.childOriginXEmu && a2.childOriginYEmu === b$1.childOriginYEmu && (a2.rotation ?? 0) === (b$1.rotation ?? 0) && Boolean(a2.flipH) === Boolean(b$1.flipH) && Boolean(a2.flipV) === Boolean(b$1.flipV);
318662
319582
  }, shapeGroupSizeEqual = (a2, b$1) => {
318663
319583
  if (a2 === b$1)
318664
319584
  return true;
@@ -322043,9 +322963,10 @@ menclose::after {
322043
322963
  const visiblePointerSurface = resolveVisibleSurfaceAtPointer(event.target, event.clientX, event.clientY);
322044
322964
  const clickedInsideVisibleActiveSurface = visiblePointerSurface?.kind === "headerFooter" && visiblePointerSurface.surface.closest(activeSurfaceSelector) != null;
322045
322965
  if (visiblePointerSurface?.kind === "bodyContent") {
322046
- const behindDocSection = (event.target instanceof Element ? event.target.closest("[data-behind-doc-section]") : null)?.dataset.behindDocSection;
322966
+ const targetElement = event.target instanceof Element ? event.target : null;
322967
+ const pageLevelSection = targetElement?.closest("[data-behind-doc-section]")?.dataset.behindDocSection ?? targetElement?.closest("[data-header-footer-overlay-section]")?.dataset.headerFooterOverlaySection;
322047
322968
  const sessionMode = session?.session?.mode;
322048
- if (behindDocSection && behindDocSection === sessionMode)
322969
+ if (pageLevelSection && pageLevelSection === sessionMode)
322049
322970
  return false;
322050
322971
  this.#callbacks.exitHeaderFooterMode?.();
322051
322972
  return false;
@@ -324138,6 +325059,11 @@ menclose::after {
324138
325059
  if (this.#activeEditor)
324139
325060
  this.#applyChildEditorDocumentMode(this.#activeEditor, mode);
324140
325061
  }
325062
+ syncEditorDocumentMode(editor) {
325063
+ if (!editor)
325064
+ return;
325065
+ this.#applyChildEditorDocumentMode(editor, this.#documentMode);
325066
+ }
324141
325067
  setTrackedChangesRenderConfig(config2) {
324142
325068
  const nextConfig = {
324143
325069
  mode: config2.mode,
@@ -326331,13 +327257,13 @@ menclose::after {
326331
327257
  return;
326332
327258
  console.log(...args$1);
326333
327259
  }, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions, TRACKED_MARK_NAMES;
326334
- var init_src_CR8eXLKh_es = __esm(() => {
327260
+ var init_src_H1_ZZyp0_es = __esm(() => {
326335
327261
  init_rolldown_runtime_Bg48TavK_es();
326336
- init_SuperConverter_DQ2wMaLK_es();
327262
+ init_SuperConverter_5I229j_D_es();
326337
327263
  init_jszip_C49i9kUs_es();
326338
327264
  init_xml_js_CqGKpaft_es();
326339
327265
  init_uuid_B2wVPhPi_es();
326340
- init_create_headless_toolbar_BhSfQYaO_es();
327266
+ init_create_headless_toolbar_CJ0cxWlH_es();
326341
327267
  init_constants_D9qj59G2_es();
326342
327268
  init_unified_BDuVPlMu_es();
326343
327269
  init_remark_gfm_BUJjZJLy_es();
@@ -338758,6 +339684,14 @@ ${err.toString()}`);
338758
339684
  return { style: style2 };
338759
339685
  }
338760
339686
  },
339687
+ shapeClipPath: {
339688
+ default: null,
339689
+ rendered: false
339690
+ },
339691
+ objectFit: {
339692
+ default: null,
339693
+ rendered: false
339694
+ },
338761
339695
  size: {
338762
339696
  default: {},
338763
339697
  renderDOM: ({ size: size$1, shouldCover }) => {
@@ -339811,6 +340745,10 @@ ${err.toString()}`);
339811
340745
  default: null,
339812
340746
  rendered: false
339813
340747
  },
340748
+ effects: {
340749
+ default: null,
340750
+ rendered: false
340751
+ },
339814
340752
  lineEnds: {
339815
340753
  default: null,
339816
340754
  rendered: false
@@ -342502,32 +343440,419 @@ ${err.toString()}`);
342502
343440
  }]
342503
343441
  }
342504
343442
  };
342505
- F = new Set(["leftRightArrow", "upDownArrow"]);
343443
+ F = new Set([
343444
+ "bentArrow",
343445
+ "bentUpArrow",
343446
+ "downArrow",
343447
+ "leftArrow",
343448
+ "leftRightArrow",
343449
+ "leftRightUpArrow",
343450
+ "leftUpArrow",
343451
+ "quadArrow",
343452
+ "rightArrow",
343453
+ "upArrow",
343454
+ "upDownArrow",
343455
+ "uturnArrow"
343456
+ ]);
342506
343457
  X = {
343458
+ bentArrow: `<bentArrow>
343459
+ <pathLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
343460
+ <path w="588010" h="648335">
343461
+ <moveTo>
343462
+ <pt x="0" y="648335"/>
343463
+ </moveTo>
343464
+ <lnTo>
343465
+ <pt x="0" y="330756"/>
343466
+ </lnTo>
343467
+ <cubicBezTo>
343468
+ <pt x="0" y="188679"/>
343469
+ <pt x="115177" y="73502"/>
343470
+ <pt x="257254" y="73502"/>
343471
+ </cubicBezTo>
343472
+ <lnTo>
343473
+ <pt x="441008" y="73501"/>
343474
+ </lnTo>
343475
+ <lnTo>
343476
+ <pt x="441008" y="0"/>
343477
+ </lnTo>
343478
+ <lnTo>
343479
+ <pt x="588010" y="147003"/>
343480
+ </lnTo>
343481
+ <lnTo>
343482
+ <pt x="441008" y="294005"/>
343483
+ </lnTo>
343484
+ <lnTo>
343485
+ <pt x="441008" y="220504"/>
343486
+ </lnTo>
343487
+ <lnTo>
343488
+ <pt x="257254" y="220504"/>
343489
+ </lnTo>
343490
+ <cubicBezTo>
343491
+ <pt x="196364" y="220504"/>
343492
+ <pt x="147002" y="269866"/>
343493
+ <pt x="147002" y="330756"/>
343494
+ </cubicBezTo>
343495
+ <cubicBezTo>
343496
+ <pt x="147002" y="436616"/>
343497
+ <pt x="147003" y="542475"/>
343498
+ <pt x="147003" y="648335"/>
343499
+ </cubicBezTo>
343500
+ <lnTo>
343501
+ <pt x="0" y="648335"/>
343502
+ </lnTo>
343503
+ <close/>
343504
+ </path>
343505
+ </pathLst>
343506
+ </bentArrow>`,
343507
+ bentUpArrow: `<bentUpArrow>
343508
+ <pathLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
343509
+ <path w="850265" h="731520">
343510
+ <moveTo>
343511
+ <pt x="0" y="548640"/>
343512
+ </moveTo>
343513
+ <lnTo>
343514
+ <pt x="575945" y="548640"/>
343515
+ </lnTo>
343516
+ <lnTo>
343517
+ <pt x="575945" y="182880"/>
343518
+ </lnTo>
343519
+ <lnTo>
343520
+ <pt x="484505" y="182880"/>
343521
+ </lnTo>
343522
+ <lnTo>
343523
+ <pt x="667385" y="0"/>
343524
+ </lnTo>
343525
+ <lnTo>
343526
+ <pt x="850265" y="182880"/>
343527
+ </lnTo>
343528
+ <lnTo>
343529
+ <pt x="758825" y="182880"/>
343530
+ </lnTo>
343531
+ <lnTo>
343532
+ <pt x="758825" y="731520"/>
343533
+ </lnTo>
343534
+ <lnTo>
343535
+ <pt x="0" y="731520"/>
343536
+ </lnTo>
343537
+ <lnTo>
343538
+ <pt x="0" y="548640"/>
343539
+ </lnTo>
343540
+ <close/>
343541
+ </path>
343542
+ </pathLst>
343543
+ </bentUpArrow>`,
343544
+ downArrow: `<downArrow>
343545
+ <pathLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
343546
+ <path w="394970" h="576580">
343547
+ <moveTo>
343548
+ <pt x="0" y="379095"/>
343549
+ </moveTo>
343550
+ <lnTo>
343551
+ <pt x="98743" y="379095"/>
343552
+ </lnTo>
343553
+ <lnTo>
343554
+ <pt x="98743" y="0"/>
343555
+ </lnTo>
343556
+ <lnTo>
343557
+ <pt x="296228" y="0"/>
343558
+ </lnTo>
343559
+ <lnTo>
343560
+ <pt x="296228" y="379095"/>
343561
+ </lnTo>
343562
+ <lnTo>
343563
+ <pt x="394970" y="379095"/>
343564
+ </lnTo>
343565
+ <lnTo>
343566
+ <pt x="197485" y="576580"/>
343567
+ </lnTo>
343568
+ <lnTo>
343569
+ <pt x="0" y="379095"/>
343570
+ </lnTo>
343571
+ <close/>
343572
+ </path>
343573
+ </pathLst>
343574
+ </downArrow>`,
343575
+ leftArrow: `<leftArrow>
343576
+ <pathLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
343577
+ <path w="662549" h="367128">
343578
+ <moveTo>
343579
+ <pt x="0" y="183564"/>
343580
+ </moveTo>
343581
+ <lnTo>
343582
+ <pt x="183564" y="0"/>
343583
+ </lnTo>
343584
+ <lnTo>
343585
+ <pt x="183564" y="91782"/>
343586
+ </lnTo>
343587
+ <lnTo>
343588
+ <pt x="662549" y="91782"/>
343589
+ </lnTo>
343590
+ <lnTo>
343591
+ <pt x="662549" y="275346"/>
343592
+ </lnTo>
343593
+ <lnTo>
343594
+ <pt x="183564" y="275346"/>
343595
+ </lnTo>
343596
+ <lnTo>
343597
+ <pt x="183564" y="367128"/>
343598
+ </lnTo>
343599
+ <lnTo>
343600
+ <pt x="0" y="183564"/>
343601
+ </lnTo>
343602
+ <close/>
343603
+ </path>
343604
+ </pathLst>
343605
+ </leftArrow>`,
342507
343606
  leftRightArrow: `<leftRightArrow>
343607
+ <pathLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
343608
+ <path w="985520" h="379730">
343609
+ <moveTo>
343610
+ <pt x="0" y="189865"/>
343611
+ </moveTo>
343612
+ <lnTo>
343613
+ <pt x="189865" y="0"/>
343614
+ </lnTo>
343615
+ <lnTo>
343616
+ <pt x="189865" y="94933"/>
343617
+ </lnTo>
343618
+ <lnTo>
343619
+ <pt x="795655" y="94933"/>
343620
+ </lnTo>
343621
+ <lnTo>
343622
+ <pt x="795655" y="0"/>
343623
+ </lnTo>
343624
+ <lnTo>
343625
+ <pt x="985520" y="189865"/>
343626
+ </lnTo>
343627
+ <lnTo>
343628
+ <pt x="795655" y="379730"/>
343629
+ </lnTo>
343630
+ <lnTo>
343631
+ <pt x="795655" y="284798"/>
343632
+ </lnTo>
343633
+ <lnTo>
343634
+ <pt x="189865" y="284798"/>
343635
+ </lnTo>
343636
+ <lnTo>
343637
+ <pt x="189865" y="379730"/>
343638
+ </lnTo>
343639
+ <lnTo>
343640
+ <pt x="0" y="189865"/>
343641
+ </lnTo>
343642
+ <close/>
343643
+ </path>
343644
+ </pathLst>
343645
+ </leftRightArrow>`,
343646
+ leftRightUpArrow: `<leftRightUpArrow>
343647
+ <pathLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
343648
+ <path w="928370" h="634365">
343649
+ <moveTo>
343650
+ <pt x="0" y="475774"/>
343651
+ </moveTo>
343652
+ <lnTo>
343653
+ <pt x="158591" y="317183"/>
343654
+ </lnTo>
343655
+ <lnTo>
343656
+ <pt x="158591" y="396478"/>
343657
+ </lnTo>
343658
+ <lnTo>
343659
+ <pt x="384889" y="396478"/>
343660
+ </lnTo>
343661
+ <lnTo>
343662
+ <pt x="384889" y="158591"/>
343663
+ </lnTo>
343664
+ <lnTo>
343665
+ <pt x="305594" y="158591"/>
343666
+ </lnTo>
343667
+ <lnTo>
343668
+ <pt x="464185" y="0"/>
343669
+ </lnTo>
343670
+ <lnTo>
343671
+ <pt x="622776" y="158591"/>
343672
+ </lnTo>
343673
+ <lnTo>
343674
+ <pt x="543481" y="158591"/>
343675
+ </lnTo>
343676
+ <lnTo>
343677
+ <pt x="543481" y="396478"/>
343678
+ </lnTo>
343679
+ <lnTo>
343680
+ <pt x="769779" y="396478"/>
343681
+ </lnTo>
343682
+ <lnTo>
343683
+ <pt x="769779" y="317183"/>
343684
+ </lnTo>
343685
+ <lnTo>
343686
+ <pt x="928370" y="475774"/>
343687
+ </lnTo>
343688
+ <lnTo>
343689
+ <pt x="769779" y="634365"/>
343690
+ </lnTo>
343691
+ <lnTo>
343692
+ <pt x="769779" y="555069"/>
343693
+ </lnTo>
343694
+ <lnTo>
343695
+ <pt x="158591" y="555069"/>
343696
+ </lnTo>
343697
+ <lnTo>
343698
+ <pt x="158591" y="634365"/>
343699
+ </lnTo>
343700
+ <lnTo>
343701
+ <pt x="0" y="475774"/>
343702
+ </lnTo>
343703
+ <close/>
343704
+ </path>
343705
+ </pathLst>
343706
+ </leftRightUpArrow>`,
343707
+ leftUpArrow: `<leftUpArrow>
343708
+ <pathLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
343709
+ <path w="850265" h="850265">
343710
+ <moveTo>
343711
+ <pt x="0" y="637699"/>
343712
+ </moveTo>
343713
+ <lnTo>
343714
+ <pt x="212566" y="425133"/>
343715
+ </lnTo>
343716
+ <lnTo>
343717
+ <pt x="212566" y="531416"/>
343718
+ </lnTo>
343719
+ <lnTo>
343720
+ <pt x="531416" y="531416"/>
343721
+ </lnTo>
343722
+ <lnTo>
343723
+ <pt x="531416" y="212566"/>
343724
+ </lnTo>
343725
+ <lnTo>
343726
+ <pt x="425133" y="212566"/>
343727
+ </lnTo>
343728
+ <lnTo>
343729
+ <pt x="637699" y="0"/>
343730
+ </lnTo>
343731
+ <lnTo>
343732
+ <pt x="850265" y="212566"/>
343733
+ </lnTo>
343734
+ <lnTo>
343735
+ <pt x="743982" y="212566"/>
343736
+ </lnTo>
343737
+ <lnTo>
343738
+ <pt x="743982" y="743982"/>
343739
+ </lnTo>
343740
+ <lnTo>
343741
+ <pt x="212566" y="743982"/>
343742
+ </lnTo>
343743
+ <lnTo>
343744
+ <pt x="212566" y="850265"/>
343745
+ </lnTo>
343746
+ <lnTo>
343747
+ <pt x="0" y="637699"/>
343748
+ </lnTo>
343749
+ <close/>
343750
+ </path>
343751
+ </pathLst>
343752
+ </leftUpArrow>`,
343753
+ quadArrow: `<quadArrow>
343754
+ <pathLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
343755
+ <path w="788670" h="831215">
343756
+ <moveTo>
343757
+ <pt x="0" y="415608"/>
343758
+ </moveTo>
343759
+ <lnTo>
343760
+ <pt x="177451" y="238157"/>
343761
+ </lnTo>
343762
+ <lnTo>
343763
+ <pt x="177451" y="326882"/>
343764
+ </lnTo>
343765
+ <lnTo>
343766
+ <pt x="305610" y="326882"/>
343767
+ </lnTo>
343768
+ <lnTo>
343769
+ <pt x="305610" y="177451"/>
343770
+ </lnTo>
343771
+ <lnTo>
343772
+ <pt x="216884" y="177451"/>
343773
+ </lnTo>
343774
+ <lnTo>
343775
+ <pt x="394335" y="0"/>
343776
+ </lnTo>
343777
+ <lnTo>
343778
+ <pt x="571786" y="177451"/>
343779
+ </lnTo>
343780
+ <lnTo>
343781
+ <pt x="483060" y="177451"/>
343782
+ </lnTo>
343783
+ <lnTo>
343784
+ <pt x="483060" y="326882"/>
343785
+ </lnTo>
343786
+ <lnTo>
343787
+ <pt x="611219" y="326882"/>
343788
+ </lnTo>
343789
+ <lnTo>
343790
+ <pt x="611219" y="238157"/>
343791
+ </lnTo>
343792
+ <lnTo>
343793
+ <pt x="788670" y="415608"/>
343794
+ </lnTo>
343795
+ <lnTo>
343796
+ <pt x="611219" y="593058"/>
343797
+ </lnTo>
343798
+ <lnTo>
343799
+ <pt x="611219" y="504333"/>
343800
+ </lnTo>
343801
+ <lnTo>
343802
+ <pt x="483060" y="504333"/>
343803
+ </lnTo>
343804
+ <lnTo>
343805
+ <pt x="483060" y="653764"/>
343806
+ </lnTo>
343807
+ <lnTo>
343808
+ <pt x="571786" y="653764"/>
343809
+ </lnTo>
343810
+ <lnTo>
343811
+ <pt x="394335" y="831215"/>
343812
+ </lnTo>
343813
+ <lnTo>
343814
+ <pt x="216884" y="653764"/>
343815
+ </lnTo>
343816
+ <lnTo>
343817
+ <pt x="305610" y="653764"/>
343818
+ </lnTo>
343819
+ <lnTo>
343820
+ <pt x="305610" y="504333"/>
343821
+ </lnTo>
343822
+ <lnTo>
343823
+ <pt x="177451" y="504333"/>
343824
+ </lnTo>
343825
+ <lnTo>
343826
+ <pt x="177451" y="593058"/>
343827
+ </lnTo>
343828
+ <lnTo>
343829
+ <pt x="0" y="415608"/>
343830
+ </lnTo>
343831
+ <close/>
343832
+ </path>
343833
+ </pathLst>
343834
+ </quadArrow>`,
343835
+ rightArrow: `<rightArrow>
342508
343836
  <avLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
342509
343837
  <gd name="adj1" fmla="val 50000"/>
342510
343838
  <gd name="adj2" fmla="val 50000"/>
342511
343839
  </avLst>
342512
343840
  <gdLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
342513
- <gd name="maxAdj2" fmla="*/ 50000 w ss"/>
343841
+ <gd name="maxAdj2" fmla="*/ 100000 w ss"/>
342514
343842
  <gd name="a1" fmla="pin 0 adj1 100000"/>
342515
343843
  <gd name="a2" fmla="pin 0 adj2 maxAdj2"/>
342516
- <gd name="x2" fmla="*/ ss a2 100000"/>
342517
- <gd name="x3" fmla="+- r 0 x2"/>
342518
- <gd name="dy" fmla="*/ h a1 200000"/>
342519
- <gd name="y1" fmla="+- vc 0 dy"/>
342520
- <gd name="y2" fmla="+- vc dy 0"/>
342521
- <gd name="dx1" fmla="*/ y1 x2 hd2"/>
342522
- <gd name="x1" fmla="+- x2 0 dx1"/>
342523
- <gd name="x4" fmla="+- x3 dx1 0"/>
343844
+ <gd name="dx1" fmla="*/ ss a2 100000"/>
343845
+ <gd name="x1" fmla="+- r 0 dx1"/>
343846
+ <gd name="dy1" fmla="*/ h a1 200000"/>
343847
+ <gd name="y1" fmla="+- vc 0 dy1"/>
343848
+ <gd name="y2" fmla="+- vc dy1 0"/>
342524
343849
  </gdLst>
342525
343850
  <ahLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
342526
343851
  <ahXY gdRefY="adj1" minY="0" maxY="100000">
342527
- <pos x="x3" y="y1"/>
343852
+ <pos x="x1" y="y1"/>
342528
343853
  </ahXY>
342529
343854
  <ahXY gdRefX="adj2" minX="0" maxX="maxAdj2">
342530
- <pos x="x2" y="t"/>
343855
+ <pos x="x1" y="t"/>
342531
343856
  </ahXY>
342532
343857
  </ahLst>
342533
343858
  <cxnLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
@@ -342535,147 +343860,177 @@ ${err.toString()}`);
342535
343860
  <pos x="r" y="vc"/>
342536
343861
  </cxn>
342537
343862
  <cxn ang="cd4">
342538
- <pos x="x3" y="b"/>
342539
- </cxn>
342540
- <cxn ang="cd4">
342541
- <pos x="x2" y="b"/>
343863
+ <pos x="x1" y="b"/>
342542
343864
  </cxn>
342543
343865
  <cxn ang="cd2">
342544
343866
  <pos x="l" y="vc"/>
342545
343867
  </cxn>
342546
343868
  <cxn ang="3cd4">
342547
- <pos x="x2" y="t"/>
342548
- </cxn>
342549
- <cxn ang="3cd4">
342550
- <pos x="x3" y="t"/>
343869
+ <pos x="x1" y="t"/>
342551
343870
  </cxn>
342552
343871
  </cxnLst>
342553
- <rect l="x1" t="y1" r="x4" b="y2" xmlns="http://schemas.openxmlformats.org/drawingml/2006/main"/>
343872
+ <rect l="l" t="y1" r="x1" b="y2" xmlns="http://schemas.openxmlformats.org/drawingml/2006/main"/>
342554
343873
  <pathLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
342555
343874
  <path>
342556
343875
  <moveTo>
342557
- <pt x="l" y="vc"/>
343876
+ <pt x="l" y="y1"/>
342558
343877
  </moveTo>
342559
343878
  <lnTo>
342560
- <pt x="x2" y="t"/>
343879
+ <pt x="x1" y="y1"/>
343880
+ </lnTo>
343881
+ <lnTo>
343882
+ <pt x="x1" y="t"/>
342561
343883
  </lnTo>
342562
343884
  <lnTo>
342563
- <pt x="x2" y="y1"/>
343885
+ <pt x="r" y="vc"/>
342564
343886
  </lnTo>
342565
343887
  <lnTo>
342566
- <pt x="x3" y="y1"/>
343888
+ <pt x="x1" y="b"/>
342567
343889
  </lnTo>
342568
343890
  <lnTo>
342569
- <pt x="x3" y="t"/>
343891
+ <pt x="x1" y="y2"/>
342570
343892
  </lnTo>
342571
343893
  <lnTo>
342572
- <pt x="r" y="vc"/>
343894
+ <pt x="l" y="y2"/>
343895
+ </lnTo>
343896
+ <close/>
343897
+ </path>
343898
+ </pathLst>
343899
+ </rightArrow>`,
343900
+ upArrow: `<upArrow>
343901
+ <pathLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
343902
+ <path w="367127" h="550008">
343903
+ <moveTo>
343904
+ <pt x="0" y="183564"/>
343905
+ </moveTo>
343906
+ <lnTo>
343907
+ <pt x="183564" y="0"/>
343908
+ </lnTo>
343909
+ <lnTo>
343910
+ <pt x="367127" y="183564"/>
342573
343911
  </lnTo>
342574
343912
  <lnTo>
342575
- <pt x="x3" y="b"/>
343913
+ <pt x="275345" y="183564"/>
342576
343914
  </lnTo>
342577
343915
  <lnTo>
342578
- <pt x="x3" y="y2"/>
343916
+ <pt x="275345" y="550008"/>
342579
343917
  </lnTo>
342580
343918
  <lnTo>
342581
- <pt x="x2" y="y2"/>
343919
+ <pt x="91782" y="550008"/>
342582
343920
  </lnTo>
342583
343921
  <lnTo>
342584
- <pt x="x2" y="b"/>
343922
+ <pt x="91782" y="183564"/>
343923
+ </lnTo>
343924
+ <lnTo>
343925
+ <pt x="0" y="183564"/>
342585
343926
  </lnTo>
342586
343927
  <close/>
342587
343928
  </path>
342588
343929
  </pathLst>
342589
- </leftRightArrow>`,
343930
+ </upArrow>`,
342590
343931
  upDownArrow: `<upDownArrow>
342591
- <avLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
342592
- <gd name="adj1" fmla="val 50000"/>
342593
- <gd name="adj2" fmla="val 50000"/>
342594
- </avLst>
342595
- <gdLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
342596
- <gd name="maxAdj2" fmla="*/ 50000 h ss"/>
342597
- <gd name="a1" fmla="pin 0 adj1 100000"/>
342598
- <gd name="a2" fmla="pin 0 adj2 maxAdj2"/>
342599
- <gd name="y2" fmla="*/ ss a2 100000"/>
342600
- <gd name="y3" fmla="+- b 0 y2"/>
342601
- <gd name="dx1" fmla="*/ w a1 200000"/>
342602
- <gd name="x1" fmla="+- hc 0 dx1"/>
342603
- <gd name="x2" fmla="+- hc dx1 0"/>
342604
- <gd name="dy1" fmla="*/ x1 y2 wd2"/>
342605
- <gd name="y1" fmla="+- y2 0 dy1"/>
342606
- <gd name="y4" fmla="+- y3 dy1 0"/>
342607
- </gdLst>
342608
- <ahLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
342609
- <ahXY gdRefX="adj1" minX="0" maxX="100000">
342610
- <pos x="x1" y="y3"/>
342611
- </ahXY>
342612
- <ahXY gdRefY="adj2" minY="0" maxY="maxAdj2">
342613
- <pos x="l" y="y2"/>
342614
- </ahXY>
342615
- </ahLst>
342616
- <cxnLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
342617
- <cxn ang="3cd4">
342618
- <pos x="hc" y="t"/>
342619
- </cxn>
342620
- <cxn ang="cd2">
342621
- <pos x="l" y="y2"/>
342622
- </cxn>
342623
- <cxn ang="cd2">
342624
- <pos x="x1" y="vc"/>
342625
- </cxn>
342626
- <cxn ang="cd2">
342627
- <pos x="l" y="y3"/>
342628
- </cxn>
342629
- <cxn ang="cd4">
342630
- <pos x="hc" y="b"/>
342631
- </cxn>
342632
- <cxn ang="0">
342633
- <pos x="r" y="y3"/>
342634
- </cxn>
342635
- <cxn ang="0">
342636
- <pos x="x2" y="vc"/>
342637
- </cxn>
342638
- <cxn ang="0">
342639
- <pos x="r" y="y2"/>
342640
- </cxn>
342641
- </cxnLst>
342642
- <rect l="x1" t="y1" r="x2" b="y4" xmlns="http://schemas.openxmlformats.org/drawingml/2006/main"/>
342643
343932
  <pathLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
342644
- <path>
343933
+ <path w="296545" h="746760">
342645
343934
  <moveTo>
342646
- <pt x="l" y="y2"/>
343935
+ <pt x="0" y="148273"/>
342647
343936
  </moveTo>
342648
343937
  <lnTo>
342649
- <pt x="hc" y="t"/>
343938
+ <pt x="148273" y="0"/>
342650
343939
  </lnTo>
342651
343940
  <lnTo>
342652
- <pt x="r" y="y2"/>
343941
+ <pt x="296545" y="148273"/>
342653
343942
  </lnTo>
342654
343943
  <lnTo>
342655
- <pt x="x2" y="y2"/>
343944
+ <pt x="222409" y="148273"/>
342656
343945
  </lnTo>
342657
343946
  <lnTo>
342658
- <pt x="x2" y="y3"/>
343947
+ <pt x="222409" y="598488"/>
342659
343948
  </lnTo>
342660
343949
  <lnTo>
342661
- <pt x="r" y="y3"/>
343950
+ <pt x="296545" y="598488"/>
342662
343951
  </lnTo>
342663
343952
  <lnTo>
342664
- <pt x="hc" y="b"/>
343953
+ <pt x="148273" y="746760"/>
342665
343954
  </lnTo>
342666
343955
  <lnTo>
342667
- <pt x="l" y="y3"/>
343956
+ <pt x="0" y="598488"/>
342668
343957
  </lnTo>
342669
343958
  <lnTo>
342670
- <pt x="x1" y="y3"/>
343959
+ <pt x="74136" y="598488"/>
342671
343960
  </lnTo>
342672
343961
  <lnTo>
342673
- <pt x="x1" y="y2"/>
343962
+ <pt x="74136" y="148273"/>
343963
+ </lnTo>
343964
+ <lnTo>
343965
+ <pt x="0" y="148273"/>
343966
+ </lnTo>
343967
+ <close/>
343968
+ </path>
343969
+ </pathLst>
343970
+ </upDownArrow>`,
343971
+ uturnArrow: `<uturnArrow>
343972
+ <pathLst xmlns="http://schemas.openxmlformats.org/drawingml/2006/main">
343973
+ <path w="886460" h="661035">
343974
+ <moveTo>
343975
+ <pt x="0" y="661035"/>
343976
+ </moveTo>
343977
+ <lnTo>
343978
+ <pt x="0" y="289203"/>
343979
+ </lnTo>
343980
+ <cubicBezTo>
343981
+ <pt x="0" y="129481"/>
343982
+ <pt x="129481" y="0"/>
343983
+ <pt x="289203" y="0"/>
343984
+ </cubicBezTo>
343985
+ <lnTo>
343986
+ <pt x="514628" y="0"/>
343987
+ </lnTo>
343988
+ <cubicBezTo>
343989
+ <pt x="674350" y="0"/>
343990
+ <pt x="803831" y="129481"/>
343991
+ <pt x="803831" y="289203"/>
343992
+ </cubicBezTo>
343993
+ <lnTo>
343994
+ <pt x="803831" y="330518"/>
343995
+ </lnTo>
343996
+ <lnTo>
343997
+ <pt x="886460" y="330518"/>
343998
+ </lnTo>
343999
+ <lnTo>
344000
+ <pt x="721201" y="495776"/>
344001
+ </lnTo>
344002
+ <lnTo>
344003
+ <pt x="555943" y="330518"/>
344004
+ </lnTo>
344005
+ <lnTo>
344006
+ <pt x="638572" y="330518"/>
344007
+ </lnTo>
344008
+ <lnTo>
344009
+ <pt x="638572" y="289203"/>
344010
+ </lnTo>
344011
+ <cubicBezTo>
344012
+ <pt x="638572" y="220751"/>
344013
+ <pt x="583080" y="165259"/>
344014
+ <pt x="514628" y="165259"/>
344015
+ </cubicBezTo>
344016
+ <lnTo>
344017
+ <pt x="289203" y="165259"/>
344018
+ </lnTo>
344019
+ <cubicBezTo>
344020
+ <pt x="220751" y="165259"/>
344021
+ <pt x="165259" y="220751"/>
344022
+ <pt x="165259" y="289203"/>
344023
+ </cubicBezTo>
344024
+ <lnTo>
344025
+ <pt x="165259" y="661035"/>
344026
+ </lnTo>
344027
+ <lnTo>
344028
+ <pt x="0" y="661035"/>
342674
344029
  </lnTo>
342675
344030
  <close/>
342676
344031
  </path>
342677
344032
  </pathLst>
342678
- </upDownArrow>`
344033
+ </uturnArrow>`
342679
344034
  };
342680
344035
  G = {
342681
344036
  darken: "color-mix(in srgb, currentColor 60%, black)",
@@ -342779,6 +344134,10 @@ ${err.toString()}`);
342779
344134
  default: null,
342780
344135
  rendered: false
342781
344136
  },
344137
+ effects: {
344138
+ default: null,
344139
+ rendered: false
344140
+ },
342782
344141
  rotation: {
342783
344142
  default: 0,
342784
344143
  renderDOM: (attrs) => {
@@ -342913,6 +344272,10 @@ ${err.toString()}`);
342913
344272
  return offsetData;
342914
344273
  }
342915
344274
  },
344275
+ effectExtent: {
344276
+ default: null,
344277
+ rendered: false
344278
+ },
342916
344279
  hidden: {
342917
344280
  default: false,
342918
344281
  rendered: false
@@ -365475,7 +366838,14 @@ function print() { __p += __j.call(arguments, '') }
365475
366838
  this.#historyCoordinator?.syncParticipant(participantKey);
365476
366839
  }
365477
366840
  #syncActiveStorySessionDocumentMode(session) {
365478
- if (!session || session.kind !== "note")
366841
+ if (!session)
366842
+ return;
366843
+ if (session.kind === "headerFooter") {
366844
+ this.#headerFooterSession?.setDocumentMode(this.#documentMode);
366845
+ this.#headerFooterSession?.syncEditorDocumentMode(session.editor);
366846
+ return;
366847
+ }
366848
+ if (session.kind !== "note")
365479
366849
  return;
365480
366850
  if (typeof session.editor.setDocumentMode === "function") {
365481
366851
  session.editor.setDocumentMode(this.#documentMode);
@@ -369187,11 +370557,11 @@ function print() { __p += __j.call(arguments, '') }
369187
370557
  ]);
369188
370558
  });
369189
370559
 
369190
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-BjToI9WN.es.js
370560
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-DH0tcWfI.es.js
369191
370561
  var DEFAULT_TEXT_ALIGN_OPTIONS, DEFAULT_LINE_HEIGHT_OPTIONS, DEFAULT_ZOOM_OPTIONS, DEFAULT_DOCUMENT_MODE_OPTIONS, DEFAULT_FONT_SIZE_OPTIONS, headlessToolbarConstants, MOD_ALIASES, ALT_ALIASES, CTRL_ALIASES, SHIFT_ALIASES, BUILTIN_CONTEXT_MENU_GROUPS, BUILTIN_GROUP_ORDER, RESERVED_PROXY_PROPERTY_NAMES, ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS, FONT_SIZE_OPTIONS;
369192
- var init_create_super_doc_ui_BjToI9WN_es = __esm(() => {
369193
- init_SuperConverter_DQ2wMaLK_es();
369194
- init_create_headless_toolbar_BhSfQYaO_es();
370562
+ var init_create_super_doc_ui_DH0tcWfI_es = __esm(() => {
370563
+ init_SuperConverter_5I229j_D_es();
370564
+ init_create_headless_toolbar_CJ0cxWlH_es();
369195
370565
  DEFAULT_TEXT_ALIGN_OPTIONS = [
369196
370566
  {
369197
370567
  label: "Left",
@@ -369482,15 +370852,15 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
369482
370852
 
369483
370853
  // ../../packages/superdoc/dist/super-editor.es.js
369484
370854
  var init_super_editor_es = __esm(() => {
369485
- init_src_CR8eXLKh_es();
369486
- init_SuperConverter_DQ2wMaLK_es();
370855
+ init_src_H1_ZZyp0_es();
370856
+ init_SuperConverter_5I229j_D_es();
369487
370857
  init_jszip_C49i9kUs_es();
369488
370858
  init_xml_js_CqGKpaft_es();
369489
- init_create_headless_toolbar_BhSfQYaO_es();
370859
+ init_create_headless_toolbar_CJ0cxWlH_es();
369490
370860
  init_constants_D9qj59G2_es();
369491
370861
  init_unified_BDuVPlMu_es();
369492
370862
  init_DocxZipper_BzS208BW_es();
369493
- init_create_super_doc_ui_BjToI9WN_es();
370863
+ init_create_super_doc_ui_DH0tcWfI_es();
369494
370864
  init_ui_CGB3qmy3_es();
369495
370865
  init_eventemitter3_UwU_CLPU_es();
369496
370866
  init_errors_C_DoKMoN_es();