@superdoc-dev/cli 0.8.0-next.110 → 0.8.0-next.112

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 +1201 -116
  2. package/package.json +8 -8
package/dist/index.js CHANGED
@@ -6801,6 +6801,74 @@ More content with **bold** and *italic*.`
6801
6801
  referenceDocPath: "permission-ranges/update-principal.mdx",
6802
6802
  referenceGroup: "permissionRanges",
6803
6803
  skipAsATool: true
6804
+ },
6805
+ "customXml.parts.list": {
6806
+ memberPath: "customXml.parts.list",
6807
+ description: "List Custom XML Data Storage Parts in the document, optionally filtered by root namespace or schema reference.",
6808
+ expectedResult: "Returns a CustomXmlPartsListResult with summary entries (no content); fetch content via get.",
6809
+ requiresDocumentContext: true,
6810
+ metadata: readOperation({
6811
+ idempotency: "idempotent",
6812
+ throws: T_REF_READ_LIST
6813
+ }),
6814
+ referenceDocPath: "custom-xml/parts/list.mdx",
6815
+ referenceGroup: "customXml"
6816
+ },
6817
+ "customXml.parts.get": {
6818
+ memberPath: "customXml.parts.get",
6819
+ description: "Get a single Custom XML Data Storage Part by itemID or package part name, including its full content. " + "v1 partName targeting is limited to Word-style customXml/itemN.xml paths.",
6820
+ expectedResult: "Returns a CustomXmlPartInfo with id, partName, namespaces, schemaRefs, and content; or null if not found.",
6821
+ requiresDocumentContext: true,
6822
+ metadata: readOperation({
6823
+ throws: T_NOT_FOUND_CAPABLE
6824
+ }),
6825
+ referenceDocPath: "custom-xml/parts/get.mdx",
6826
+ referenceGroup: "customXml"
6827
+ },
6828
+ "customXml.parts.create": {
6829
+ memberPath: "customXml.parts.create",
6830
+ description: "Add a new Custom XML Data Storage Part to the document. Generates a fresh itemID GUID and emits the Properties Part.",
6831
+ expectedResult: "Returns a CustomXmlPartsCreateResult with the generated id and package part names on success.",
6832
+ requiresDocumentContext: true,
6833
+ metadata: mutationOperation({
6834
+ idempotency: "non-idempotent",
6835
+ supportsDryRun: true,
6836
+ supportsTrackedMode: false,
6837
+ possibleFailureCodes: ["INVALID_INPUT"],
6838
+ throws: T_REF_INSERT
6839
+ }),
6840
+ referenceDocPath: "custom-xml/parts/create.mdx",
6841
+ referenceGroup: "customXml"
6842
+ },
6843
+ "customXml.parts.patch": {
6844
+ memberPath: "customXml.parts.patch",
6845
+ description: "Replace the content and/or schemaRefs of an existing Custom XML Data Storage Part. " + "At least one of content or schemaRefs is required. " + "v1 partName targeting is limited to Word-style customXml/itemN.xml paths.",
6846
+ expectedResult: "Returns a CustomXmlPartsMutationResult indicating success with the resolved target or a failure.",
6847
+ requiresDocumentContext: true,
6848
+ metadata: mutationOperation({
6849
+ idempotency: "idempotent",
6850
+ supportsDryRun: true,
6851
+ supportsTrackedMode: false,
6852
+ possibleFailureCodes: ["TARGET_NOT_FOUND", "INVALID_INPUT"],
6853
+ throws: T_REF_MUTATION
6854
+ }),
6855
+ referenceDocPath: "custom-xml/parts/patch.mdx",
6856
+ referenceGroup: "customXml"
6857
+ },
6858
+ "customXml.parts.remove": {
6859
+ memberPath: "customXml.parts.remove",
6860
+ description: "Remove a Custom XML Data Storage Part and clean up all linked package files (item, props, rels, content-types entry). " + "v1 partName targeting is limited to Word-style customXml/itemN.xml paths.",
6861
+ expectedResult: "Returns a CustomXmlPartsMutationResult indicating success or a failure.",
6862
+ requiresDocumentContext: true,
6863
+ metadata: mutationOperation({
6864
+ idempotency: "non-idempotent",
6865
+ supportsDryRun: true,
6866
+ supportsTrackedMode: false,
6867
+ possibleFailureCodes: ["TARGET_NOT_FOUND"],
6868
+ throws: T_REF_MUTATION_REMOVE
6869
+ }),
6870
+ referenceDocPath: "custom-xml/parts/remove.mdx",
6871
+ referenceGroup: "customXml"
6804
6872
  }
6805
6873
  };
6806
6874
  OPERATION_IDS = Object.freeze(Object.keys(OPERATION_DEFINITIONS));
@@ -8562,7 +8630,7 @@ function buildInternalContractSchemas() {
8562
8630
  operations
8563
8631
  };
8564
8632
  }
8565
- var nodeTypeValues, blockNodeTypeValues, deletableBlockNodeTypeValues, inlineNodeTypeValues, knownTargetKindValues, SHARED_DEFS, rangeSchema, positionSchema, inlineAnchorSchema, targetKindSchema, textAddressSchema, textTargetSchema, blockNodeAddressSchema, deletableBlockNodeAddressSchema, tableAddressSchema, tableRowAddressSchema, tableCellAddressSchema, tableOrCellAddressSchema, paragraphAddressSchema, headingAddressSchema, listItemAddressSchema, paragraphTargetSchema, sectionAddressSchema, inlineNodeAddressSchema, nodeAddressSchema, commentAddressSchema, trackedChangeAddressSchema, entityAddressSchema, selectionTargetSchema, targetLocatorSchema, deleteBehaviorSchema, resolvedHandleSchema, pageInfoSchema, receiptSuccessSchema, textMutationRangeSchema, textMutationResolutionSchema, textMutationSuccessSchema, matchRunSchema, matchBlockSchema, storyLocatorSchema, trackChangeRefSchema, createParagraphSuccessSchema, createHeadingSuccessSchema, headingLevelSchema, listsInsertSuccessSchema, listsMutateItemSuccessSchema, listsExitSuccessSchema, nodeSummarySchema, nodeInfoSchema, matchContextSchema, unknownNodeDiagnosticSchema, textSelectorSchema, nodeSelectorSchema, selectorShorthandSchema, sdTextSelectorSchema, sdNodeSelectorSchema, sdSelectorSchema, sdReadOptionsSchema, sdFindInputSchema, sdNodeResultSchema, sdFindResultSchema, sdMutationResolutionSchema, sdMutationSuccessSchema, documentInfoCountsSchema, documentInfoOutlineItemSchema, documentInfoCapabilitiesSchema, documentStyleInfoSchema, documentStylesSchema, documentDefaultsSchema, documentInfoSchema, listKindSchema, listInsertPositionSchema, listItemInfoSchema, listItemDomainItemSchema, listsListResultSchema, sectionBreakTypeSchema, sectionOrientationSchema, sectionVerticalAlignSchema, sectionDirectionSchema, sectionHeaderFooterKindSchema, sectionHeaderFooterVariantSchema, sectionLineNumberRestartSchema, sectionPageNumberFormatSchema, sectionRangeDomainSchema, sectionPageMarginsSchema, sectionHeaderFooterMarginsSchema, sectionPageSetupSchema, sectionColumnsSchema, sectionLineNumberingSchema, sectionPageNumberingSchema, sectionHeaderFooterRefsSchema, sectionBorderSpecSchema, sectionPageBordersSchema, sectionInfoSchema, sectionResolvedHandleSchema, sectionDomainItemSchema, sectionsListResultSchema, sectionMutationSuccessSchema, documentMutationSuccessSchema, paragraphMutationTargetSchema, paragraphMutationSuccessSchema, createSectionBreakSuccessSchema, commentInfoSchema, commentDomainItemSchema, commentsListResultSchema, trackChangeWordRevisionIdsSchema, trackChangeInfoSchema, trackChangeDomainItemSchema, trackChangesListResultSchema, capabilityReasonCodeSchema, capabilityReasonsSchema, capabilityFlagSchema, operationRuntimeCapabilitySchema, operationCapabilitiesSchema, inlinePropertyCapabilitySchema, inlinePropertyCapabilitiesByKeySchema, formatCapabilitiesSchema, planEngineCapabilitiesSchema, capabilitiesOutputSchema, strictEmptyObjectSchema, tableBorderColorPattern, tableBorderSpecSchema, nullableTableBorderSpecSchema, sdFragmentSchema, placementSchema, nestingPolicySchema, insertInputSchema, tableLocatorSchema, cellLocatorSchema, cellOrTableScopedCellLocatorSchema, tableOrCellLocatorSchema, mergeRangeLocatorSchema, tableCreateLocationSchema, tableMutationSuccessSchema, createTableSuccessSchema, tableMutationFailureCodes, tableMutationFailureSchema, tableMutationResultSchema, createTableResultSchema, historyActionSuccessSchema, historyActionFailureSchema, formatInlineAliasOperationSchemas, tocMutationFailureCodes, tocMutationFailureSchema, tocMutationSuccessSchema, tocEntryMutationFailureCodes, tocEntryMutationFailureSchema, tocEntryMutationSuccessSchema, hyperlinkTargetSchema, hyperlinkReadPropertiesSchema, hyperlinkDestinationSchema, hyperlinkSpecSchema, hyperlinkPatchSchema, hyperlinkDomainSchema, hyperlinkMutationSuccessSchema, hyperlinkMutationFailureCodes, hyperlinkMutationFailureSchema, hyperlinkInfoSchema, contentControlTargetSchema, contentControlMutationSuccessSchema, contentControlMutationFailureSchema, ccListResultSchema, ccInfoSchema, refListQueryProperties, refListQuerySchema, discoveryOutputSchema, receiptFailureSchema, refFailureSchema, bookmarkAddressSchema, bookmarkMutation, footnoteAddressSchema, footnoteConfigScopeSchema, footnoteNumberingSchema, footnoteMutation, footnoteConfig, crossRefAddressSchema, crossRefTargetSchema, crossRefDisplaySchema, crossRefMutation, indexAddressSchema, indexEntryAddressSchema, indexConfigSchema, indexEntryDataSchema, indexEntryPatchSchema, indexMutation, indexEntryMutation, captionAddressSchema, captionMutation, captionConfig, fieldAddressSchema, fieldMutation, citationAddressSchema, citationSourceAddressSchema, bibliographyAddressSchema, citationMutation, citationSourceMutation, bibliographyMutation, citationPersonSchema, citationSourceFieldsSchema, tocCreateLocationSchema, authoritiesAddressSchema, authorityEntryAddressSchema, authoritiesConfigSchema, authorityEntryDataSchema, authorityEntryPatchSchema, authoritiesMutation, authorityEntryMutation, diffCoverageSchema, diffSummarySchema, diffSnapshotSchema, diffPayloadSchema, diffApplyResultSchema, operationSchemas;
8633
+ var nodeTypeValues, blockNodeTypeValues, deletableBlockNodeTypeValues, inlineNodeTypeValues, knownTargetKindValues, SHARED_DEFS, rangeSchema, positionSchema, inlineAnchorSchema, targetKindSchema, textAddressSchema, textTargetSchema, blockNodeAddressSchema, deletableBlockNodeAddressSchema, tableAddressSchema, tableRowAddressSchema, tableCellAddressSchema, tableOrCellAddressSchema, paragraphAddressSchema, headingAddressSchema, listItemAddressSchema, paragraphTargetSchema, sectionAddressSchema, inlineNodeAddressSchema, nodeAddressSchema, commentAddressSchema, trackedChangeAddressSchema, entityAddressSchema, selectionTargetSchema, targetLocatorSchema, deleteBehaviorSchema, resolvedHandleSchema, pageInfoSchema, receiptSuccessSchema, textMutationRangeSchema, textMutationResolutionSchema, textMutationSuccessSchema, matchRunSchema, matchBlockSchema, storyLocatorSchema, trackChangeRefSchema, createParagraphSuccessSchema, createHeadingSuccessSchema, headingLevelSchema, listsInsertSuccessSchema, listsMutateItemSuccessSchema, listsExitSuccessSchema, nodeSummarySchema, nodeInfoSchema, matchContextSchema, unknownNodeDiagnosticSchema, textSelectorSchema, nodeSelectorSchema, selectorShorthandSchema, sdTextSelectorSchema, sdNodeSelectorSchema, sdSelectorSchema, sdReadOptionsSchema, sdFindInputSchema, sdNodeResultSchema, sdFindResultSchema, sdMutationResolutionSchema, sdMutationSuccessSchema, documentInfoCountsSchema, documentInfoOutlineItemSchema, documentInfoCapabilitiesSchema, documentStyleInfoSchema, documentStylesSchema, documentDefaultsSchema, documentInfoSchema, listKindSchema, listInsertPositionSchema, listItemInfoSchema, listItemDomainItemSchema, listsListResultSchema, sectionBreakTypeSchema, sectionOrientationSchema, sectionVerticalAlignSchema, sectionDirectionSchema, sectionHeaderFooterKindSchema, sectionHeaderFooterVariantSchema, sectionLineNumberRestartSchema, sectionPageNumberFormatSchema, sectionRangeDomainSchema, sectionPageMarginsSchema, sectionHeaderFooterMarginsSchema, sectionPageSetupSchema, sectionColumnsSchema, sectionLineNumberingSchema, sectionPageNumberingSchema, sectionHeaderFooterRefsSchema, sectionBorderSpecSchema, sectionPageBordersSchema, sectionInfoSchema, sectionResolvedHandleSchema, sectionDomainItemSchema, sectionsListResultSchema, sectionMutationSuccessSchema, documentMutationSuccessSchema, paragraphMutationTargetSchema, paragraphMutationSuccessSchema, createSectionBreakSuccessSchema, commentInfoSchema, commentDomainItemSchema, commentsListResultSchema, trackChangeWordRevisionIdsSchema, trackChangeInfoSchema, trackChangeDomainItemSchema, trackChangesListResultSchema, capabilityReasonCodeSchema, capabilityReasonsSchema, capabilityFlagSchema, operationRuntimeCapabilitySchema, operationCapabilitiesSchema, inlinePropertyCapabilitySchema, inlinePropertyCapabilitiesByKeySchema, formatCapabilitiesSchema, planEngineCapabilitiesSchema, capabilitiesOutputSchema, strictEmptyObjectSchema, tableBorderColorPattern, tableBorderSpecSchema, nullableTableBorderSpecSchema, sdFragmentSchema, placementSchema, nestingPolicySchema, insertInputSchema, tableLocatorSchema, cellLocatorSchema, cellOrTableScopedCellLocatorSchema, tableOrCellLocatorSchema, mergeRangeLocatorSchema, tableCreateLocationSchema, tableMutationSuccessSchema, createTableSuccessSchema, tableMutationFailureCodes, tableMutationFailureSchema, tableMutationResultSchema, createTableResultSchema, historyActionSuccessSchema, historyActionFailureSchema, formatInlineAliasOperationSchemas, tocMutationFailureCodes, tocMutationFailureSchema, tocMutationSuccessSchema, tocEntryMutationFailureCodes, tocEntryMutationFailureSchema, tocEntryMutationSuccessSchema, hyperlinkTargetSchema, hyperlinkReadPropertiesSchema, hyperlinkDestinationSchema, hyperlinkSpecSchema, hyperlinkPatchSchema, hyperlinkDomainSchema, hyperlinkMutationSuccessSchema, hyperlinkMutationFailureCodes, hyperlinkMutationFailureSchema, hyperlinkInfoSchema, contentControlTargetSchema, contentControlMutationSuccessSchema, contentControlMutationFailureSchema, ccListResultSchema, ccInfoSchema, refListQueryProperties, refListQuerySchema, discoveryOutputSchema, receiptFailureSchema, refFailureSchema, bookmarkAddressSchema, bookmarkMutation, customXmlPartTargetSchema, customXmlPartMutation, customXmlPartCreateMutation, footnoteAddressSchema, footnoteConfigScopeSchema, footnoteNumberingSchema, footnoteMutation, footnoteConfig, crossRefAddressSchema, crossRefTargetSchema, crossRefDisplaySchema, crossRefMutation, indexAddressSchema, indexEntryAddressSchema, indexConfigSchema, indexEntryDataSchema, indexEntryPatchSchema, indexMutation, indexEntryMutation, captionAddressSchema, captionMutation, captionConfig, fieldAddressSchema, fieldMutation, citationAddressSchema, citationSourceAddressSchema, bibliographyAddressSchema, citationMutation, citationSourceMutation, bibliographyMutation, citationPersonSchema, citationSourceFieldsSchema, tocCreateLocationSchema, authoritiesAddressSchema, authorityEntryAddressSchema, authoritiesConfigSchema, authorityEntryDataSchema, authorityEntryPatchSchema, authoritiesMutation, authorityEntryMutation, diffCoverageSchema, diffSummarySchema, diffSnapshotSchema, diffPayloadSchema, diffApplyResultSchema, operationSchemas;
8566
8634
  var init_schemas = __esm(() => {
8567
8635
  init_command_catalog();
8568
8636
  init_types2();
@@ -9664,6 +9732,21 @@ var init_schemas = __esm(() => {
9664
9732
  story: ref("StoryLocator")
9665
9733
  }, ["kind", "entityType", "name"]);
9666
9734
  bookmarkMutation = refMutationSchemas({ bookmark: bookmarkAddressSchema }, ["bookmark"]);
9735
+ customXmlPartTargetSchema = {
9736
+ oneOf: [
9737
+ objectSchema({ id: { type: "string", minLength: 1 } }, ["id"]),
9738
+ objectSchema({ partName: { type: "string", minLength: 1 } }, ["partName"])
9739
+ ]
9740
+ };
9741
+ customXmlPartMutation = refMutationSchemas({
9742
+ target: customXmlPartTargetSchema,
9743
+ id: { type: "string", minLength: 1 }
9744
+ }, ["target"]);
9745
+ customXmlPartCreateMutation = refMutationSchemas({
9746
+ id: { type: "string" },
9747
+ partName: { type: "string" },
9748
+ propsPartName: { type: "string" }
9749
+ }, ["id", "partName", "propsPartName"]);
9667
9750
  footnoteAddressSchema = objectSchema({ kind: { const: "entity" }, entityType: { const: "footnote" }, noteId: { type: "string" } }, ["kind", "entityType", "noteId"]);
9668
9751
  footnoteConfigScopeSchema = {
9669
9752
  oneOf: [
@@ -13532,6 +13615,43 @@ var init_schemas = __esm(() => {
13532
13615
  output: { type: "object" },
13533
13616
  success: { type: "object" },
13534
13617
  failure: { type: "object" }
13618
+ },
13619
+ "customXml.parts.list": {
13620
+ input: objectSchema({
13621
+ ...refListQueryProperties,
13622
+ rootNamespace: { type: "string" },
13623
+ schemaRef: { type: "string" }
13624
+ }),
13625
+ output: discoveryOutputSchema
13626
+ },
13627
+ "customXml.parts.get": {
13628
+ input: objectSchema({ target: customXmlPartTargetSchema }, ["target"]),
13629
+ output: { oneOf: [{ type: "object" }, { type: "null" }] }
13630
+ },
13631
+ "customXml.parts.create": {
13632
+ input: objectSchema({
13633
+ content: { type: "string", minLength: 1 },
13634
+ schemaRefs: { type: "array", items: { type: "string", minLength: 1 } }
13635
+ }, ["content"]),
13636
+ ...customXmlPartCreateMutation
13637
+ },
13638
+ "customXml.parts.patch": {
13639
+ input: {
13640
+ type: "object",
13641
+ properties: {
13642
+ target: customXmlPartTargetSchema,
13643
+ content: { type: "string", minLength: 1 },
13644
+ schemaRefs: { type: "array", items: { type: "string", minLength: 1 } }
13645
+ },
13646
+ required: ["target"],
13647
+ anyOf: [{ required: ["content"] }, { required: ["schemaRefs"] }],
13648
+ additionalProperties: false
13649
+ },
13650
+ ...customXmlPartMutation
13651
+ },
13652
+ "customXml.parts.remove": {
13653
+ input: objectSchema({ target: customXmlPartTargetSchema }, ["target"]),
13654
+ ...customXmlPartMutation
13535
13655
  }
13536
13656
  };
13537
13657
  });
@@ -13721,6 +13841,11 @@ var init_reference_doc_map = __esm(() => {
13721
13841
  title: "Permission Ranges",
13722
13842
  description: "Permission range exception operations for protected documents.",
13723
13843
  pagePath: "permission-ranges/index.mdx"
13844
+ },
13845
+ customXml: {
13846
+ title: "Custom XML",
13847
+ description: "Custom XML Data Storage Part operations (ECMA-376 §15.2.5, §15.2.6). Raw read and write of custom XML parts in the OOXML package.",
13848
+ pagePath: "custom-xml/index.mdx"
13724
13849
  }
13725
13850
  };
13726
13851
  REFERENCE_OPERATION_GROUPS = Object.keys(GROUP_METADATA).map((key) => ({
@@ -16490,7 +16615,12 @@ function buildDispatchTable(api) {
16490
16615
  "permissionRanges.get": (input) => api.permissionRanges.get(input),
16491
16616
  "permissionRanges.create": (input, options) => api.permissionRanges.create(input, options),
16492
16617
  "permissionRanges.remove": (input, options) => api.permissionRanges.remove(input, options),
16493
- "permissionRanges.updatePrincipal": (input, options) => api.permissionRanges.updatePrincipal(input, options)
16618
+ "permissionRanges.updatePrincipal": (input, options) => api.permissionRanges.updatePrincipal(input, options),
16619
+ "customXml.parts.list": (input) => api.customXml.parts.list(input),
16620
+ "customXml.parts.get": (input) => api.customXml.parts.get(input),
16621
+ "customXml.parts.create": (input, options) => api.customXml.parts.create(input, options),
16622
+ "customXml.parts.patch": (input, options) => api.customXml.parts.patch(input, options),
16623
+ "customXml.parts.remove": (input, options) => api.customXml.parts.remove(input, options)
16494
16624
  };
16495
16625
  }
16496
16626
  var init_invoke = __esm(() => {
@@ -18298,6 +18428,80 @@ var init_bookmarks = __esm(() => {
18298
18428
  init_story_validator();
18299
18429
  });
18300
18430
 
18431
+ // ../../packages/document-api/src/customXml/customXml.ts
18432
+ function validateTarget(target, operationName) {
18433
+ if (!target || typeof target !== "object") {
18434
+ throw new DocumentApiValidationError("INVALID_TARGET", `${operationName} requires a target with either { id } or { partName }.`, { target });
18435
+ }
18436
+ const t = target;
18437
+ const hasId = typeof t.id === "string" && t.id.length > 0;
18438
+ const hasPartName = typeof t.partName === "string" && t.partName.length > 0;
18439
+ if (!hasId && !hasPartName) {
18440
+ throw new DocumentApiValidationError("INVALID_TARGET", `${operationName} target must have a non-empty 'id' or 'partName'.`, { target });
18441
+ }
18442
+ if (hasId && hasPartName) {
18443
+ throw new DocumentApiValidationError("INVALID_TARGET", `${operationName} target must not provide both 'id' and 'partName'; choose one.`, { target });
18444
+ }
18445
+ }
18446
+ function validateContent(content, operationName) {
18447
+ if (typeof content !== "string" || content.length === 0) {
18448
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName} requires a non-empty 'content' string of well-formed XML.`, { contentType: typeof content });
18449
+ }
18450
+ if (!/<\s*[A-Za-z_]/.test(content)) {
18451
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName} 'content' does not contain a root XML element.`);
18452
+ }
18453
+ }
18454
+ function validateSchemaRefs(schemaRefs, operationName) {
18455
+ if (!Array.isArray(schemaRefs)) {
18456
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName} 'schemaRefs' must be an array of strings.`);
18457
+ }
18458
+ for (const [i, entry] of schemaRefs.entries()) {
18459
+ if (typeof entry !== "string" || entry.length === 0) {
18460
+ throw new DocumentApiValidationError("INVALID_INPUT", `${operationName} 'schemaRefs[${i}]' must be a non-empty string.`);
18461
+ }
18462
+ }
18463
+ }
18464
+ function executeCustomXmlPartsList(adapter, query2) {
18465
+ if (query2?.rootNamespace !== undefined && typeof query2.rootNamespace !== "string") {
18466
+ throw new DocumentApiValidationError("INVALID_INPUT", `customXml.parts.list 'rootNamespace' must be a string when provided.`);
18467
+ }
18468
+ if (query2?.schemaRef !== undefined && typeof query2.schemaRef !== "string") {
18469
+ throw new DocumentApiValidationError("INVALID_INPUT", `customXml.parts.list 'schemaRef' must be a string when provided.`);
18470
+ }
18471
+ return adapter.list(query2);
18472
+ }
18473
+ function executeCustomXmlPartsGet(adapter, input) {
18474
+ validateTarget(input.target, "customXml.parts.get");
18475
+ return adapter.get(input);
18476
+ }
18477
+ function executeCustomXmlPartsCreate(adapter, input, options) {
18478
+ validateContent(input.content, "customXml.parts.create");
18479
+ if (input.schemaRefs !== undefined) {
18480
+ validateSchemaRefs(input.schemaRefs, "customXml.parts.create");
18481
+ }
18482
+ return adapter.create(input, normalizeMutationOptions(options));
18483
+ }
18484
+ function executeCustomXmlPartsPatch(adapter, input, options) {
18485
+ validateTarget(input.target, "customXml.parts.patch");
18486
+ if (input.content === undefined && input.schemaRefs === undefined) {
18487
+ throw new DocumentApiValidationError("INVALID_INPUT", `customXml.parts.patch requires at least one of 'content' or 'schemaRefs'.`);
18488
+ }
18489
+ if (input.content !== undefined) {
18490
+ validateContent(input.content, "customXml.parts.patch");
18491
+ }
18492
+ if (input.schemaRefs !== undefined) {
18493
+ validateSchemaRefs(input.schemaRefs, "customXml.parts.patch");
18494
+ }
18495
+ return adapter.patch(input, normalizeMutationOptions(options));
18496
+ }
18497
+ function executeCustomXmlPartsRemove(adapter, input, options) {
18498
+ validateTarget(input.target, "customXml.parts.remove");
18499
+ return adapter.remove(input, normalizeMutationOptions(options));
18500
+ }
18501
+ var init_customXml = __esm(() => {
18502
+ init_errors2();
18503
+ });
18504
+
18301
18505
  // ../../packages/document-api/src/protection/protection.ts
18302
18506
  function validateSetEditingRestrictionInput(input) {
18303
18507
  if (!input || typeof input !== "object") {
@@ -20013,6 +20217,25 @@ function createDocumentApi(adapters) {
20013
20217
  return executePermissionRangesUpdatePrincipal(adapters.permissionRanges, input, options);
20014
20218
  }
20015
20219
  },
20220
+ customXml: {
20221
+ parts: {
20222
+ list(input) {
20223
+ return executeCustomXmlPartsList(requireAdapter(adapters.customXml, "customXml").parts, input);
20224
+ },
20225
+ get(input) {
20226
+ return executeCustomXmlPartsGet(requireAdapter(adapters.customXml, "customXml").parts, input);
20227
+ },
20228
+ create(input, options) {
20229
+ return executeCustomXmlPartsCreate(requireAdapter(adapters.customXml, "customXml").parts, input, options);
20230
+ },
20231
+ patch(input, options) {
20232
+ return executeCustomXmlPartsPatch(requireAdapter(adapters.customXml, "customXml").parts, input, options);
20233
+ },
20234
+ remove(input, options) {
20235
+ return executeCustomXmlPartsRemove(requireAdapter(adapters.customXml, "customXml").parts, input, options);
20236
+ }
20237
+ }
20238
+ },
20016
20239
  invoke(request) {
20017
20240
  if (!Object.prototype.hasOwnProperty.call(dispatch, request.operationId)) {
20018
20241
  throw new Error(`Unknown operationId: "${request.operationId}"`);
@@ -20059,6 +20282,7 @@ var init_src = __esm(() => {
20059
20282
  init_hyperlinks();
20060
20283
  init_content_controls();
20061
20284
  init_bookmarks();
20285
+ init_customXml();
20062
20286
  init_protection();
20063
20287
  init_permission_ranges();
20064
20288
  init_footnotes();
@@ -66096,7 +66320,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
66096
66320
  emptyOptions2 = {};
66097
66321
  });
66098
66322
 
66099
- // ../../packages/superdoc/dist/chunks/SuperConverter-1Voea3gd.es.js
66323
+ // ../../packages/superdoc/dist/chunks/SuperConverter-Db6xeFxo.es.js
66100
66324
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
66101
66325
  const fieldValue = extension$1.config[field];
66102
66326
  if (typeof fieldValue === "function")
@@ -70910,7 +71134,12 @@ function buildDispatchTable2(api) {
70910
71134
  "permissionRanges.get": (input) => api.permissionRanges.get(input),
70911
71135
  "permissionRanges.create": (input, options) => api.permissionRanges.create(input, options),
70912
71136
  "permissionRanges.remove": (input, options) => api.permissionRanges.remove(input, options),
70913
- "permissionRanges.updatePrincipal": (input, options) => api.permissionRanges.updatePrincipal(input, options)
71137
+ "permissionRanges.updatePrincipal": (input, options) => api.permissionRanges.updatePrincipal(input, options),
71138
+ "customXml.parts.list": (input) => api.customXml.parts.list(input),
71139
+ "customXml.parts.get": (input) => api.customXml.parts.get(input),
71140
+ "customXml.parts.create": (input, options) => api.customXml.parts.create(input, options),
71141
+ "customXml.parts.patch": (input, options) => api.customXml.parts.patch(input, options),
71142
+ "customXml.parts.remove": (input, options) => api.customXml.parts.remove(input, options)
70914
71143
  };
70915
71144
  }
70916
71145
  function executeHistoryGet2(adapter) {
@@ -72463,6 +72692,61 @@ function executeBookmarksRemove2(adapter, input, options) {
72463
72692
  validateBookmarkTarget2(input.target, "bookmarks.remove");
72464
72693
  return adapter.remove(input, normalizeMutationOptions2(options));
72465
72694
  }
72695
+ function validateTarget2(target, operationName) {
72696
+ if (!target || typeof target !== "object")
72697
+ throw new DocumentApiValidationError2("INVALID_TARGET", `${operationName} requires a target with either { id } or { partName }.`, { target });
72698
+ const t = target;
72699
+ const hasId = typeof t.id === "string" && t.id.length > 0;
72700
+ const hasPartName = typeof t.partName === "string" && t.partName.length > 0;
72701
+ if (!hasId && !hasPartName)
72702
+ throw new DocumentApiValidationError2("INVALID_TARGET", `${operationName} target must have a non-empty 'id' or 'partName'.`, { target });
72703
+ if (hasId && hasPartName)
72704
+ throw new DocumentApiValidationError2("INVALID_TARGET", `${operationName} target must not provide both 'id' and 'partName'; choose one.`, { target });
72705
+ }
72706
+ function validateContent2(content$2, operationName) {
72707
+ if (typeof content$2 !== "string" || content$2.length === 0)
72708
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName} requires a non-empty 'content' string of well-formed XML.`, { contentType: typeof content$2 });
72709
+ if (!/<\s*[A-Za-z_]/.test(content$2))
72710
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName} 'content' does not contain a root XML element.`);
72711
+ }
72712
+ function validateSchemaRefs2(schemaRefs, operationName) {
72713
+ if (!Array.isArray(schemaRefs))
72714
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName} 'schemaRefs' must be an array of strings.`);
72715
+ for (const [i$1, entry] of schemaRefs.entries())
72716
+ if (typeof entry !== "string" || entry.length === 0)
72717
+ throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName} 'schemaRefs[${i$1}]' must be a non-empty string.`);
72718
+ }
72719
+ function executeCustomXmlPartsList2(adapter, query2) {
72720
+ if (query2?.rootNamespace !== undefined && typeof query2.rootNamespace !== "string")
72721
+ throw new DocumentApiValidationError2("INVALID_INPUT", `customXml.parts.list 'rootNamespace' must be a string when provided.`);
72722
+ if (query2?.schemaRef !== undefined && typeof query2.schemaRef !== "string")
72723
+ throw new DocumentApiValidationError2("INVALID_INPUT", `customXml.parts.list 'schemaRef' must be a string when provided.`);
72724
+ return adapter.list(query2);
72725
+ }
72726
+ function executeCustomXmlPartsGet2(adapter, input) {
72727
+ validateTarget2(input.target, "customXml.parts.get");
72728
+ return adapter.get(input);
72729
+ }
72730
+ function executeCustomXmlPartsCreate2(adapter, input, options) {
72731
+ validateContent2(input.content, "customXml.parts.create");
72732
+ if (input.schemaRefs !== undefined)
72733
+ validateSchemaRefs2(input.schemaRefs, "customXml.parts.create");
72734
+ return adapter.create(input, normalizeMutationOptions2(options));
72735
+ }
72736
+ function executeCustomXmlPartsPatch2(adapter, input, options) {
72737
+ validateTarget2(input.target, "customXml.parts.patch");
72738
+ if (input.content === undefined && input.schemaRefs === undefined)
72739
+ throw new DocumentApiValidationError2("INVALID_INPUT", `customXml.parts.patch requires at least one of 'content' or 'schemaRefs'.`);
72740
+ if (input.content !== undefined)
72741
+ validateContent2(input.content, "customXml.parts.patch");
72742
+ if (input.schemaRefs !== undefined)
72743
+ validateSchemaRefs2(input.schemaRefs, "customXml.parts.patch");
72744
+ return adapter.patch(input, normalizeMutationOptions2(options));
72745
+ }
72746
+ function executeCustomXmlPartsRemove2(adapter, input, options) {
72747
+ validateTarget2(input.target, "customXml.parts.remove");
72748
+ return adapter.remove(input, normalizeMutationOptions2(options));
72749
+ }
72466
72750
  function validateSetEditingRestrictionInput2(input) {
72467
72751
  if (!input || typeof input !== "object")
72468
72752
  throw new DocumentApiValidationError2("INVALID_INPUT", "protection.setEditingRestriction requires an object with a mode property.");
@@ -74071,6 +74355,23 @@ function createDocumentApi2(adapters) {
74071
74355
  return executePermissionRangesUpdatePrincipal2(adapters.permissionRanges, input, options);
74072
74356
  }
74073
74357
  },
74358
+ customXml: { parts: {
74359
+ list(input) {
74360
+ return executeCustomXmlPartsList2(requireAdapter2(adapters.customXml, "customXml").parts, input);
74361
+ },
74362
+ get(input) {
74363
+ return executeCustomXmlPartsGet2(requireAdapter2(adapters.customXml, "customXml").parts, input);
74364
+ },
74365
+ create(input, options) {
74366
+ return executeCustomXmlPartsCreate2(requireAdapter2(adapters.customXml, "customXml").parts, input, options);
74367
+ },
74368
+ patch(input, options) {
74369
+ return executeCustomXmlPartsPatch2(requireAdapter2(adapters.customXml, "customXml").parts, input, options);
74370
+ },
74371
+ remove(input, options) {
74372
+ return executeCustomXmlPartsRemove2(requireAdapter2(adapters.customXml, "customXml").parts, input, options);
74373
+ }
74374
+ } },
74074
74375
  invoke(request) {
74075
74376
  if (!Object.prototype.hasOwnProperty.call(dispatch, request.operationId))
74076
74377
  throw new Error(`Unknown operationId: "${request.operationId}"`);
@@ -104900,7 +105201,7 @@ var isRegExp = (value) => {
104900
105201
  tracked: false,
104901
105202
  carrier: runAttributeCarrier2(runPropertyKey ?? key),
104902
105203
  schema
104903
- }), INLINE_PROPERTY_REGISTRY2, INLINE_PROPERTY_KEY_SET2, INLINE_PROPERTY_BY_KEY2, UNDERLINE_OBJECT_ALLOWED_KEYS2, SHADING_ALLOWED_KEYS2, BORDER_ALLOWED_KEYS2, FIT_TEXT_ALLOWED_KEYS2, LANG_ALLOWED_KEYS2, RFONTS_ALLOWED_KEYS2, EAST_ASIAN_LAYOUT_ALLOWED_KEYS2, STYLISTIC_SET_ALLOWED_KEYS2, VERT_ALIGN_VALUES2, PROPERTY_VALIDATOR_MAP2, NONE_FAILURES2, NONE_THROWS2, T_NOT_FOUND2, T_NOT_FOUND_CAPABLE2, T_PLAN_ENGINE2, T_NOT_FOUND_COMMAND2, T_IMAGE_COMMAND2, T_CC_READ2, T_CC_MUTATION2, T_CC_TYPED2, T_CC_TYPED_READ2, T_CC_RAW2, T_QUERY_MATCH2, T_SECTION_CREATE2, T_SECTION_READ2, T_PARAGRAPH_MUTATION2, T_SECTION_MUTATION2, T_SECTION_SETTINGS_MUTATION2, T_HEADER_FOOTER_MUTATION2, T_STORY2, T_REF_READ_LIST2, T_REF_MUTATION2, T_REF_MUTATION_REMOVE2, T_REF_INSERT2, T_PROTECTION_READ2, T_PROTECTION_MUTATION2, T_PERM_RANGE_READ2, T_PERM_RANGE_MUTATION2, FORMAT_INLINE_ALIAS_OPERATION_DEFINITIONS2, OPERATION_DEFINITIONS2, OPERATION_IDS2, COMMAND_CATALOG3, TABLE_COLOR_PATTERN_SOURCE2 = "^(#?([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})|auto)$", TABLE_COLOR_PATTERN2, PARAGRAPH_ALIGNMENTS2, TAB_STOP_ALIGNMENTS2, TAB_STOP_LEADERS2, BORDER_SIDES2, CLEAR_BORDER_SIDES2, LINE_RULES2, PARAGRAPH_DIRECTIONS2, ALIGNMENT_POLICIES2, PARAGRAPH_BLOCK_TYPES2, SET_STYLE_KEYS2, CLEAR_STYLE_KEYS2, RESET_DIRECT_FORMATTING_KEYS2, SET_ALIGNMENT_KEYS2, CLEAR_ALIGNMENT_KEYS2, SET_INDENTATION_KEYS2, CLEAR_INDENTATION_KEYS2, SET_SPACING_KEYS2, CLEAR_SPACING_KEYS2, SET_KEEP_OPTIONS_KEYS2, SET_OUTLINE_LEVEL_KEYS2, SET_FLOW_OPTIONS_KEYS2, SET_TAB_STOP_KEYS2, CLEAR_TAB_STOP_KEYS2, CLEAR_ALL_TAB_STOPS_KEYS2, SET_BORDER_KEYS2, CLEAR_BORDER_KEYS2, SET_SHADING_KEYS2, CLEAR_SHADING_KEYS2, SET_DIRECTION_KEYS2, CLEAR_DIRECTION_KEYS2, ST_ON_OFF_ON_VALUES2, ST_ON_OFF_OFF_VALUES2, ST_UNDERLINE_VALUES2, ST_UNDERLINE_VALUE_SET2, ST_VERTICAL_ALIGN_RUN2, ST_EM2, ST_TEXT_ALIGNMENT2, ST_TEXT_DIRECTION2, ST_TEXTBOX_TIGHT_WRAP2, ST_TEXT_TRANSFORM2, ST_JUSTIFICATION2, FONT_FAMILY_SCHEMA2, COLOR_SCHEMA2, SPACING_SCHEMA2, INDENT_SCHEMA2, UNDERLINE_SCHEMA2, BORDER_PROPERTIES_SCHEMA2, SHADING_SCHEMA2, LANG_SCHEMA2, EAST_ASIAN_LAYOUT_SCHEMA2, FIT_TEXT_SCHEMA2, NUMBERING_PROPERTIES_SCHEMA2, FRAME_PR_SCHEMA2, PARAGRAPH_BORDERS_SCHEMA2, TAB_STOP_SCHEMA2, PROPERTY_REGISTRY2, ALLOWED_KEYS_BY_CHANNEL2, PROPERTY_INDEX2, EXCLUDED_KEYS2, INPUT_ALLOWED_KEYS2, TARGET_ALLOWED_KEYS2, OPTIONS_ALLOWED_KEYS2, VALID_CHANNELS2, Z_ORDER_RELATIVE_HEIGHT_MAX2 = 4294967295, nodeTypeValues2, blockNodeTypeValues2, deletableBlockNodeTypeValues2, inlineNodeTypeValues2, rangeSchema2, textAddressSchema2, textTargetSchema2, blockNodeAddressSchema2, deletableBlockNodeAddressSchema2, tableAddressSchema2, tableRowAddressSchema2, tableCellAddressSchema2, tableOrCellAddressSchema2, paragraphAddressSchema2, headingAddressSchema2, listItemAddressSchema2, paragraphTargetSchema2, sectionAddressSchema2, nodeAddressSchema2, commentAddressSchema2, trackedChangeAddressSchema2, entityAddressSchema2, selectionTargetSchema2, deleteBehaviorSchema2, resolvedHandleSchema2, pageInfoSchema2, receiptSuccessSchema2, textMutationRangeSchema2, textMutationResolutionSchema2, textMutationSuccessSchema2, matchBlockSchema2, storyLocatorSchema2, trackChangeRefSchema2, createParagraphSuccessSchema2, createHeadingSuccessSchema2, headingLevelSchema2, listsInsertSuccessSchema2, listsMutateItemSuccessSchema2, textSelectorSchema2, nodeSelectorSchema2, sdMutationResolutionSchema2, sdMutationSuccessSchema2, documentInfoCountsSchema2, documentInfoOutlineItemSchema2, documentInfoCapabilitiesSchema2, documentStylesSchema2, documentDefaultsSchema2, listKindSchema2, listInsertPositionSchema2, sectionBreakTypeSchema2, sectionOrientationSchema2, sectionVerticalAlignSchema2, sectionDirectionSchema2, sectionHeaderFooterKindSchema2, sectionHeaderFooterVariantSchema2, sectionLineNumberRestartSchema2, sectionPageNumberFormatSchema2, sectionRangeDomainSchema2, sectionPageMarginsSchema2, sectionHeaderFooterMarginsSchema2, sectionPageSetupSchema2, sectionColumnsSchema2, sectionLineNumberingSchema2, sectionPageNumberingSchema2, sectionHeaderFooterRefsSchema2, sectionBorderSpecSchema2, sectionPageBordersSchema2, sectionMutationSuccessSchema2, documentMutationSuccessSchema2, paragraphMutationTargetSchema2, paragraphMutationSuccessSchema2, createSectionBreakSuccessSchema2, trackChangeWordRevisionIdsSchema2, capabilityReasonsSchema2, capabilityFlagSchema2, operationRuntimeCapabilitySchema2, operationCapabilitiesSchema2, inlinePropertyCapabilitySchema2, formatCapabilitiesSchema2, planEngineCapabilitiesSchema2, tableBorderColorPattern2, nullableTableBorderSpecSchema2, sdFragmentSchema2, placementSchema2, nestingPolicySchema2, tableCreateLocationSchema2, formatInlineAliasOperationSchemas2, tocMutationFailureSchema2, tocMutationSuccessSchema2, tocEntryMutationFailureSchema2, tocEntryMutationSuccessSchema2, hyperlinkTargetSchema2, hyperlinkReadPropertiesSchema2, hyperlinkSpecSchema2, hyperlinkPatchSchema2, hyperlinkDomainSchema2, hyperlinkMutationSuccessSchema2, hyperlinkMutationFailureSchema2, contentControlTargetSchema2, contentControlMutationSuccessSchema2, contentControlMutationFailureSchema2, ccListResultSchema2, ccInfoSchema2, refListQueryProperties2, refFailureSchema2, bookmarkAddressSchema2, bookmarkMutation2, footnoteAddressSchema2, footnoteConfigScopeSchema2, footnoteNumberingSchema2, footnoteMutation2, footnoteConfig2, crossRefAddressSchema2, crossRefTargetSchema2, crossRefDisplaySchema2, crossRefMutation2, indexAddressSchema2, indexEntryAddressSchema2, indexConfigSchema2, indexEntryDataSchema2, indexEntryPatchSchema2, indexMutation2, indexEntryMutation2, captionAddressSchema2, captionMutation2, captionConfig2, fieldAddressSchema2, fieldMutation2, citationAddressSchema2, citationSourceAddressSchema2, bibliographyAddressSchema2, citationMutation2, citationSourceMutation2, bibliographyMutation2, citationPersonSchema2, citationSourceFieldsSchema2, tocCreateLocationSchema2, authoritiesAddressSchema2, authorityEntryAddressSchema2, authoritiesConfigSchema2, authorityEntryDataSchema2, authorityEntryPatchSchema2, authoritiesMutation2, authorityEntryMutation2, diffCoverageSchema2, diffSummarySchema2, diffSnapshotSchema2, diffPayloadSchema2, GROUP_METADATA2, STEP_OP_CATALOG_UNFROZEN2, PUBLIC_STEP_OP_CATALOG_UNFROZEN2, PUBLIC_MUTATION_STEP_OP_IDS2, PUBLIC_MUTATION_STEP_OP_SET2, CAPABILITY_REASON_CODES, VALID_EDGE_VALUES2, VALID_EDGE_NODE_TYPES2, VALID_DOCUMENT_EDGES2, VALID_REF_BOUNDARIES2, VALID_ANCHOR_KINDS2, RESOLVE_RANGE_ALLOWED_KEYS2, SELECTION_CURRENT_ALLOWED_KEYS2, CREATE_COMMENT_ALLOWED_KEYS2, PATCH_COMMENT_ALLOWED_KEYS2, STYLE_APPLY_INPUT_ALLOWED_KEYS2, INLINE_ALIAS_INPUT_ALLOWED_KEYS2, DELETE_INPUT_ALLOWED_KEYS2, VALID_BEHAVIORS2, CONTENT_KIND_SET2, INLINE_KIND_SET2, LEGACY_TOP_LEVEL_TYPES2, TEXT_INSERT_ALLOWED_KEYS2, STRUCTURAL_INSERT_ALLOWED_KEYS2, VALID_INSERT_TYPES2, LIST_KINDS2, LIST_INSERT_POSITIONS2, JOIN_DIRECTIONS2, MUTATION_SCOPES2, LEVEL_ALIGNMENTS2, TRAILING_CHARACTERS2, LIST_PRESET_IDS2, VALID_BLOCK_NODE_TYPES$1, VALID_LIST_KINDS2, VALID_INSERT_POSITIONS2, VALID_JOIN_DIRECTIONS2, VALID_MUTATION_SCOPES2, VALID_LEVEL_ALIGNMENTS2, VALID_TRAILING_CHARACTERS2, VALID_LIST_PRESETS2, VALID_CONTINUITY_VALUES2, VALID_SEQUENCE_MODES2, VALID_LIST_CREATE_MODES2, TEXT_REPLACE_ALLOWED_KEYS2, STRUCTURAL_REPLACE_ALLOWED_KEYS2, VALID_HEADING_LEVELS2, SECTION_BREAK_TYPES$1, SUPPORTED_DELETE_NODE_TYPES2, REJECTED_DELETE_NODE_TYPES2, VALID_BLOCK_NODE_TYPES3, SNAPSHOT_VERSIONS2, PAYLOAD_VERSIONS2, VALID_STYLE_OPTION_FLAGS2, VALID_APPLY_TO_VALUES2, VALID_BORDER_EDGE_KEYS2, HEADER_FOOTER_KINDS$1, HEADER_FOOTER_VARIANTS$1, DEFAULT_SECTIONS_LIST_LIMIT2 = 250, SECTION_BREAK_TYPES3, SECTION_ORIENTATIONS2, SECTION_VERTICAL_ALIGNS2, SECTION_DIRECTIONS2, HEADER_FOOTER_KINDS3, HEADER_FOOTER_VARIANTS3, LINE_NUMBER_RESTARTS2, PAGE_NUMBER_FORMATS2, PAGE_BORDER_DISPLAYS2, PAGE_BORDER_OFFSET_FROM_VALUES2, PAGE_BORDER_Z_ORDER_VALUES2, VALID_WRAP_TYPES2, VALID_WRAP_SIDES2, VALID_IMAGE_SIZE_UNITS2, VALID_TOC_UPDATE_MODES2, EDIT_ENTRY_PATCH_ALLOWED_KEYS2, PATCH_FIELDS2, CONTENT_CONTROL_TYPES2, LOCK_MODES2, CONTENT_CONTROL_APPEARANCES2, VALID_NODE_KINDS2, VALID_LOCK_MODES$1, VALID_CC_TYPES2, VALID_CC_APPEARANCES2, VALID_CONTENT_FORMATS2, VALID_RAW_PATCH_OPS2, VALID_SET_MODES2, VALID_CREATE_LOCATION_KINDS2, DEFAULT_PROTECTION_STATE, ADAPTER_GATED_PREFIXES2, _buffers, _defaultCollectionId = null, _nextCollectionId = 1, generateV2HandlerEntity = (handlerName, translator$218) => ({
105204
+ }), INLINE_PROPERTY_REGISTRY2, INLINE_PROPERTY_KEY_SET2, INLINE_PROPERTY_BY_KEY2, UNDERLINE_OBJECT_ALLOWED_KEYS2, SHADING_ALLOWED_KEYS2, BORDER_ALLOWED_KEYS2, FIT_TEXT_ALLOWED_KEYS2, LANG_ALLOWED_KEYS2, RFONTS_ALLOWED_KEYS2, EAST_ASIAN_LAYOUT_ALLOWED_KEYS2, STYLISTIC_SET_ALLOWED_KEYS2, VERT_ALIGN_VALUES2, PROPERTY_VALIDATOR_MAP2, NONE_FAILURES2, NONE_THROWS2, T_NOT_FOUND2, T_NOT_FOUND_CAPABLE2, T_PLAN_ENGINE2, T_NOT_FOUND_COMMAND2, T_IMAGE_COMMAND2, T_CC_READ2, T_CC_MUTATION2, T_CC_TYPED2, T_CC_TYPED_READ2, T_CC_RAW2, T_QUERY_MATCH2, T_SECTION_CREATE2, T_SECTION_READ2, T_PARAGRAPH_MUTATION2, T_SECTION_MUTATION2, T_SECTION_SETTINGS_MUTATION2, T_HEADER_FOOTER_MUTATION2, T_STORY2, T_REF_READ_LIST2, T_REF_MUTATION2, T_REF_MUTATION_REMOVE2, T_REF_INSERT2, T_PROTECTION_READ2, T_PROTECTION_MUTATION2, T_PERM_RANGE_READ2, T_PERM_RANGE_MUTATION2, FORMAT_INLINE_ALIAS_OPERATION_DEFINITIONS2, OPERATION_DEFINITIONS2, OPERATION_IDS2, COMMAND_CATALOG3, TABLE_COLOR_PATTERN_SOURCE2 = "^(#?([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})|auto)$", TABLE_COLOR_PATTERN2, PARAGRAPH_ALIGNMENTS2, TAB_STOP_ALIGNMENTS2, TAB_STOP_LEADERS2, BORDER_SIDES2, CLEAR_BORDER_SIDES2, LINE_RULES2, PARAGRAPH_DIRECTIONS2, ALIGNMENT_POLICIES2, PARAGRAPH_BLOCK_TYPES2, SET_STYLE_KEYS2, CLEAR_STYLE_KEYS2, RESET_DIRECT_FORMATTING_KEYS2, SET_ALIGNMENT_KEYS2, CLEAR_ALIGNMENT_KEYS2, SET_INDENTATION_KEYS2, CLEAR_INDENTATION_KEYS2, SET_SPACING_KEYS2, CLEAR_SPACING_KEYS2, SET_KEEP_OPTIONS_KEYS2, SET_OUTLINE_LEVEL_KEYS2, SET_FLOW_OPTIONS_KEYS2, SET_TAB_STOP_KEYS2, CLEAR_TAB_STOP_KEYS2, CLEAR_ALL_TAB_STOPS_KEYS2, SET_BORDER_KEYS2, CLEAR_BORDER_KEYS2, SET_SHADING_KEYS2, CLEAR_SHADING_KEYS2, SET_DIRECTION_KEYS2, CLEAR_DIRECTION_KEYS2, ST_ON_OFF_ON_VALUES2, ST_ON_OFF_OFF_VALUES2, ST_UNDERLINE_VALUES2, ST_UNDERLINE_VALUE_SET2, ST_VERTICAL_ALIGN_RUN2, ST_EM2, ST_TEXT_ALIGNMENT2, ST_TEXT_DIRECTION2, ST_TEXTBOX_TIGHT_WRAP2, ST_TEXT_TRANSFORM2, ST_JUSTIFICATION2, FONT_FAMILY_SCHEMA2, COLOR_SCHEMA2, SPACING_SCHEMA2, INDENT_SCHEMA2, UNDERLINE_SCHEMA2, BORDER_PROPERTIES_SCHEMA2, SHADING_SCHEMA2, LANG_SCHEMA2, EAST_ASIAN_LAYOUT_SCHEMA2, FIT_TEXT_SCHEMA2, NUMBERING_PROPERTIES_SCHEMA2, FRAME_PR_SCHEMA2, PARAGRAPH_BORDERS_SCHEMA2, TAB_STOP_SCHEMA2, PROPERTY_REGISTRY2, ALLOWED_KEYS_BY_CHANNEL2, PROPERTY_INDEX2, EXCLUDED_KEYS2, INPUT_ALLOWED_KEYS2, TARGET_ALLOWED_KEYS2, OPTIONS_ALLOWED_KEYS2, VALID_CHANNELS2, Z_ORDER_RELATIVE_HEIGHT_MAX2 = 4294967295, nodeTypeValues2, blockNodeTypeValues2, deletableBlockNodeTypeValues2, inlineNodeTypeValues2, rangeSchema2, textAddressSchema2, textTargetSchema2, blockNodeAddressSchema2, deletableBlockNodeAddressSchema2, tableAddressSchema2, tableRowAddressSchema2, tableCellAddressSchema2, tableOrCellAddressSchema2, paragraphAddressSchema2, headingAddressSchema2, listItemAddressSchema2, paragraphTargetSchema2, sectionAddressSchema2, nodeAddressSchema2, commentAddressSchema2, trackedChangeAddressSchema2, entityAddressSchema2, selectionTargetSchema2, deleteBehaviorSchema2, resolvedHandleSchema2, pageInfoSchema2, receiptSuccessSchema2, textMutationRangeSchema2, textMutationResolutionSchema2, textMutationSuccessSchema2, matchBlockSchema2, storyLocatorSchema2, trackChangeRefSchema2, createParagraphSuccessSchema2, createHeadingSuccessSchema2, headingLevelSchema2, listsInsertSuccessSchema2, listsMutateItemSuccessSchema2, textSelectorSchema2, nodeSelectorSchema2, sdMutationResolutionSchema2, sdMutationSuccessSchema2, documentInfoCountsSchema2, documentInfoOutlineItemSchema2, documentInfoCapabilitiesSchema2, documentStylesSchema2, documentDefaultsSchema2, listKindSchema2, listInsertPositionSchema2, sectionBreakTypeSchema2, sectionOrientationSchema2, sectionVerticalAlignSchema2, sectionDirectionSchema2, sectionHeaderFooterKindSchema2, sectionHeaderFooterVariantSchema2, sectionLineNumberRestartSchema2, sectionPageNumberFormatSchema2, sectionRangeDomainSchema2, sectionPageMarginsSchema2, sectionHeaderFooterMarginsSchema2, sectionPageSetupSchema2, sectionColumnsSchema2, sectionLineNumberingSchema2, sectionPageNumberingSchema2, sectionHeaderFooterRefsSchema2, sectionBorderSpecSchema2, sectionPageBordersSchema2, sectionMutationSuccessSchema2, documentMutationSuccessSchema2, paragraphMutationTargetSchema2, paragraphMutationSuccessSchema2, createSectionBreakSuccessSchema2, trackChangeWordRevisionIdsSchema2, capabilityReasonsSchema2, capabilityFlagSchema2, operationRuntimeCapabilitySchema2, operationCapabilitiesSchema2, inlinePropertyCapabilitySchema2, formatCapabilitiesSchema2, planEngineCapabilitiesSchema2, tableBorderColorPattern2, nullableTableBorderSpecSchema2, sdFragmentSchema2, placementSchema2, nestingPolicySchema2, tableCreateLocationSchema2, formatInlineAliasOperationSchemas2, tocMutationFailureSchema2, tocMutationSuccessSchema2, tocEntryMutationFailureSchema2, tocEntryMutationSuccessSchema2, hyperlinkTargetSchema2, hyperlinkReadPropertiesSchema2, hyperlinkSpecSchema2, hyperlinkPatchSchema2, hyperlinkDomainSchema2, hyperlinkMutationSuccessSchema2, hyperlinkMutationFailureSchema2, contentControlTargetSchema2, contentControlMutationSuccessSchema2, contentControlMutationFailureSchema2, ccListResultSchema2, ccInfoSchema2, refListQueryProperties2, refFailureSchema2, bookmarkAddressSchema2, bookmarkMutation2, customXmlPartTargetSchema2, customXmlPartMutation2, customXmlPartCreateMutation2, footnoteAddressSchema2, footnoteConfigScopeSchema2, footnoteNumberingSchema2, footnoteMutation2, footnoteConfig2, crossRefAddressSchema2, crossRefTargetSchema2, crossRefDisplaySchema2, crossRefMutation2, indexAddressSchema2, indexEntryAddressSchema2, indexConfigSchema2, indexEntryDataSchema2, indexEntryPatchSchema2, indexMutation2, indexEntryMutation2, captionAddressSchema2, captionMutation2, captionConfig2, fieldAddressSchema2, fieldMutation2, citationAddressSchema2, citationSourceAddressSchema2, bibliographyAddressSchema2, citationMutation2, citationSourceMutation2, bibliographyMutation2, citationPersonSchema2, citationSourceFieldsSchema2, tocCreateLocationSchema2, authoritiesAddressSchema2, authorityEntryAddressSchema2, authoritiesConfigSchema2, authorityEntryDataSchema2, authorityEntryPatchSchema2, authoritiesMutation2, authorityEntryMutation2, diffCoverageSchema2, diffSummarySchema2, diffSnapshotSchema2, diffPayloadSchema2, GROUP_METADATA2, STEP_OP_CATALOG_UNFROZEN2, PUBLIC_STEP_OP_CATALOG_UNFROZEN2, PUBLIC_MUTATION_STEP_OP_IDS2, PUBLIC_MUTATION_STEP_OP_SET2, CAPABILITY_REASON_CODES, VALID_EDGE_VALUES2, VALID_EDGE_NODE_TYPES2, VALID_DOCUMENT_EDGES2, VALID_REF_BOUNDARIES2, VALID_ANCHOR_KINDS2, RESOLVE_RANGE_ALLOWED_KEYS2, SELECTION_CURRENT_ALLOWED_KEYS2, CREATE_COMMENT_ALLOWED_KEYS2, PATCH_COMMENT_ALLOWED_KEYS2, STYLE_APPLY_INPUT_ALLOWED_KEYS2, INLINE_ALIAS_INPUT_ALLOWED_KEYS2, DELETE_INPUT_ALLOWED_KEYS2, VALID_BEHAVIORS2, CONTENT_KIND_SET2, INLINE_KIND_SET2, LEGACY_TOP_LEVEL_TYPES2, TEXT_INSERT_ALLOWED_KEYS2, STRUCTURAL_INSERT_ALLOWED_KEYS2, VALID_INSERT_TYPES2, LIST_KINDS2, LIST_INSERT_POSITIONS2, JOIN_DIRECTIONS2, MUTATION_SCOPES2, LEVEL_ALIGNMENTS2, TRAILING_CHARACTERS2, LIST_PRESET_IDS2, VALID_BLOCK_NODE_TYPES$1, VALID_LIST_KINDS2, VALID_INSERT_POSITIONS2, VALID_JOIN_DIRECTIONS2, VALID_MUTATION_SCOPES2, VALID_LEVEL_ALIGNMENTS2, VALID_TRAILING_CHARACTERS2, VALID_LIST_PRESETS2, VALID_CONTINUITY_VALUES2, VALID_SEQUENCE_MODES2, VALID_LIST_CREATE_MODES2, TEXT_REPLACE_ALLOWED_KEYS2, STRUCTURAL_REPLACE_ALLOWED_KEYS2, VALID_HEADING_LEVELS2, SECTION_BREAK_TYPES$1, SUPPORTED_DELETE_NODE_TYPES2, REJECTED_DELETE_NODE_TYPES2, VALID_BLOCK_NODE_TYPES3, SNAPSHOT_VERSIONS2, PAYLOAD_VERSIONS2, VALID_STYLE_OPTION_FLAGS2, VALID_APPLY_TO_VALUES2, VALID_BORDER_EDGE_KEYS2, HEADER_FOOTER_KINDS$1, HEADER_FOOTER_VARIANTS$1, DEFAULT_SECTIONS_LIST_LIMIT2 = 250, SECTION_BREAK_TYPES3, SECTION_ORIENTATIONS2, SECTION_VERTICAL_ALIGNS2, SECTION_DIRECTIONS2, HEADER_FOOTER_KINDS3, HEADER_FOOTER_VARIANTS3, LINE_NUMBER_RESTARTS2, PAGE_NUMBER_FORMATS2, PAGE_BORDER_DISPLAYS2, PAGE_BORDER_OFFSET_FROM_VALUES2, PAGE_BORDER_Z_ORDER_VALUES2, VALID_WRAP_TYPES2, VALID_WRAP_SIDES2, VALID_IMAGE_SIZE_UNITS2, VALID_TOC_UPDATE_MODES2, EDIT_ENTRY_PATCH_ALLOWED_KEYS2, PATCH_FIELDS2, CONTENT_CONTROL_TYPES2, LOCK_MODES2, CONTENT_CONTROL_APPEARANCES2, VALID_NODE_KINDS2, VALID_LOCK_MODES$1, VALID_CC_TYPES2, VALID_CC_APPEARANCES2, VALID_CONTENT_FORMATS2, VALID_RAW_PATCH_OPS2, VALID_SET_MODES2, VALID_CREATE_LOCATION_KINDS2, DEFAULT_PROTECTION_STATE, ADAPTER_GATED_PREFIXES2, _buffers, _defaultCollectionId = null, _nextCollectionId = 1, generateV2HandlerEntity = (handlerName, translator$218) => ({
104904
105205
  handlerName,
104905
105206
  handler: (params3) => {
104906
105207
  const { nodes } = params3;
@@ -119756,7 +120057,7 @@ var isRegExp = (value) => {
119756
120057
  state.kern = kernNode.attributes["w:val"];
119757
120058
  }
119758
120059
  }, SuperConverter;
119759
- var init_SuperConverter_1Voea3gd_es = __esm(() => {
120060
+ var init_SuperConverter_Db6xeFxo_es = __esm(() => {
119760
120061
  init_rolldown_runtime_Bg48TavK_es();
119761
120062
  init_jszip_C49i9kUs_es();
119762
120063
  init_xml_js_CqGKpaft_es();
@@ -128262,6 +128563,72 @@ var init_SuperConverter_1Voea3gd_es = __esm(() => {
128262
128563
  referenceDocPath: "permission-ranges/update-principal.mdx",
128263
128564
  referenceGroup: "permissionRanges",
128264
128565
  skipAsATool: true
128566
+ },
128567
+ "customXml.parts.list": {
128568
+ memberPath: "customXml.parts.list",
128569
+ description: "List Custom XML Data Storage Parts in the document, optionally filtered by root namespace or schema reference.",
128570
+ expectedResult: "Returns a CustomXmlPartsListResult with summary entries (no content); fetch content via get.",
128571
+ requiresDocumentContext: true,
128572
+ metadata: readOperation2({
128573
+ idempotency: "idempotent",
128574
+ throws: T_REF_READ_LIST2
128575
+ }),
128576
+ referenceDocPath: "custom-xml/parts/list.mdx",
128577
+ referenceGroup: "customXml"
128578
+ },
128579
+ "customXml.parts.get": {
128580
+ memberPath: "customXml.parts.get",
128581
+ description: "Get a single Custom XML Data Storage Part by itemID or package part name, including its full content. v1 partName targeting is limited to Word-style customXml/itemN.xml paths.",
128582
+ expectedResult: "Returns a CustomXmlPartInfo with id, partName, namespaces, schemaRefs, and content; or null if not found.",
128583
+ requiresDocumentContext: true,
128584
+ metadata: readOperation2({ throws: T_NOT_FOUND_CAPABLE2 }),
128585
+ referenceDocPath: "custom-xml/parts/get.mdx",
128586
+ referenceGroup: "customXml"
128587
+ },
128588
+ "customXml.parts.create": {
128589
+ memberPath: "customXml.parts.create",
128590
+ description: "Add a new Custom XML Data Storage Part to the document. Generates a fresh itemID GUID and emits the Properties Part.",
128591
+ expectedResult: "Returns a CustomXmlPartsCreateResult with the generated id and package part names on success.",
128592
+ requiresDocumentContext: true,
128593
+ metadata: mutationOperation2({
128594
+ idempotency: "non-idempotent",
128595
+ supportsDryRun: true,
128596
+ supportsTrackedMode: false,
128597
+ possibleFailureCodes: ["INVALID_INPUT"],
128598
+ throws: T_REF_INSERT2
128599
+ }),
128600
+ referenceDocPath: "custom-xml/parts/create.mdx",
128601
+ referenceGroup: "customXml"
128602
+ },
128603
+ "customXml.parts.patch": {
128604
+ memberPath: "customXml.parts.patch",
128605
+ description: "Replace the content and/or schemaRefs of an existing Custom XML Data Storage Part. At least one of content or schemaRefs is required. v1 partName targeting is limited to Word-style customXml/itemN.xml paths.",
128606
+ expectedResult: "Returns a CustomXmlPartsMutationResult indicating success with the resolved target or a failure.",
128607
+ requiresDocumentContext: true,
128608
+ metadata: mutationOperation2({
128609
+ idempotency: "idempotent",
128610
+ supportsDryRun: true,
128611
+ supportsTrackedMode: false,
128612
+ possibleFailureCodes: ["TARGET_NOT_FOUND", "INVALID_INPUT"],
128613
+ throws: T_REF_MUTATION2
128614
+ }),
128615
+ referenceDocPath: "custom-xml/parts/patch.mdx",
128616
+ referenceGroup: "customXml"
128617
+ },
128618
+ "customXml.parts.remove": {
128619
+ memberPath: "customXml.parts.remove",
128620
+ description: "Remove a Custom XML Data Storage Part and clean up all linked package files (item, props, rels, content-types entry). v1 partName targeting is limited to Word-style customXml/itemN.xml paths.",
128621
+ expectedResult: "Returns a CustomXmlPartsMutationResult indicating success or a failure.",
128622
+ requiresDocumentContext: true,
128623
+ metadata: mutationOperation2({
128624
+ idempotency: "non-idempotent",
128625
+ supportsDryRun: true,
128626
+ supportsTrackedMode: false,
128627
+ possibleFailureCodes: ["TARGET_NOT_FOUND"],
128628
+ throws: T_REF_MUTATION_REMOVE2
128629
+ }),
128630
+ referenceDocPath: "custom-xml/parts/remove.mdx",
128631
+ referenceGroup: "customXml"
128265
128632
  }
128266
128633
  };
128267
128634
  OPERATION_IDS2 = Object.freeze(Object.keys(OPERATION_DEFINITIONS2));
@@ -130517,6 +130884,29 @@ var init_SuperConverter_1Voea3gd_es = __esm(() => {
130517
130884
  "name"
130518
130885
  ]);
130519
130886
  bookmarkMutation2 = refMutationSchemas2({ bookmark: bookmarkAddressSchema2 }, ["bookmark"]);
130887
+ customXmlPartTargetSchema2 = { oneOf: [objectSchema2({ id: {
130888
+ type: "string",
130889
+ minLength: 1
130890
+ } }, ["id"]), objectSchema2({ partName: {
130891
+ type: "string",
130892
+ minLength: 1
130893
+ } }, ["partName"])] };
130894
+ customXmlPartMutation2 = refMutationSchemas2({
130895
+ target: customXmlPartTargetSchema2,
130896
+ id: {
130897
+ type: "string",
130898
+ minLength: 1
130899
+ }
130900
+ }, ["target"]);
130901
+ customXmlPartCreateMutation2 = refMutationSchemas2({
130902
+ id: { type: "string" },
130903
+ partName: { type: "string" },
130904
+ propsPartName: { type: "string" }
130905
+ }, [
130906
+ "id",
130907
+ "partName",
130908
+ "propsPartName"
130909
+ ]);
130520
130910
  footnoteAddressSchema2 = objectSchema2({
130521
130911
  kind: { const: "entity" },
130522
130912
  entityType: { const: "footnote" },
@@ -134421,7 +134811,23 @@ var init_SuperConverter_1Voea3gd_es = __esm(() => {
134421
134811
  },
134422
134812
  id: { type: "string" }
134423
134813
  }, ["kind"])
134424
- }, ["id", "principal"]);
134814
+ }, ["id", "principal"]), objectSchema2({
134815
+ ...refListQueryProperties2,
134816
+ rootNamespace: { type: "string" },
134817
+ schemaRef: { type: "string" }
134818
+ }), objectSchema2({ target: customXmlPartTargetSchema2 }, ["target"]), objectSchema2({
134819
+ content: {
134820
+ type: "string",
134821
+ minLength: 1
134822
+ },
134823
+ schemaRefs: {
134824
+ type: "array",
134825
+ items: {
134826
+ type: "string",
134827
+ minLength: 1
134828
+ }
134829
+ }
134830
+ }, ["content"]), { ...customXmlPartCreateMutation2 }, { ...customXmlPartMutation2 }, objectSchema2({ target: customXmlPartTargetSchema2 }, ["target"]), { ...customXmlPartMutation2 };
134425
134831
  projectFromDefinitions2((_id, entry) => entry.memberPath);
134426
134832
  [...new Set(OPERATION_IDS2.map((id2) => OPERATION_DEFINITIONS2[id2].memberPath))];
134427
134833
  projectFromDefinitions2((_id, entry) => entry.referenceDocPath);
@@ -134595,6 +135001,11 @@ var init_SuperConverter_1Voea3gd_es = __esm(() => {
134595
135001
  title: "Permission Ranges",
134596
135002
  description: "Permission range exception operations for protected documents.",
134597
135003
  pagePath: "permission-ranges/index.mdx"
135004
+ },
135005
+ customXml: {
135006
+ title: "Custom XML",
135007
+ description: "Custom XML Data Storage Part operations (ECMA-376 §15.2.5, §15.2.6). Raw read and write of custom XML parts in the OOXML package.",
135008
+ pagePath: "custom-xml/index.mdx"
134598
135009
  }
134599
135010
  };
134600
135011
  Object.keys(GROUP_METADATA2).map((key) => ({
@@ -157636,7 +158047,7 @@ var init_SuperConverter_1Voea3gd_es = __esm(() => {
157636
158047
  };
157637
158048
  });
157638
158049
 
157639
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-cNPAdMd2.es.js
158050
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-BongFwHh.es.js
157640
158051
  function parseSizeUnit(val = "0") {
157641
158052
  const length3 = val.toString() || "0";
157642
158053
  const value = Number.parseFloat(length3);
@@ -160358,8 +160769,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
160358
160769
  }
160359
160770
  };
160360
160771
  };
160361
- var init_create_headless_toolbar_cNPAdMd2_es = __esm(() => {
160362
- init_SuperConverter_1Voea3gd_es();
160772
+ var init_create_headless_toolbar_BongFwHh_es = __esm(() => {
160773
+ init_SuperConverter_Db6xeFxo_es();
160363
160774
  init_constants_DrU4EASo_es();
160364
160775
  init_dist_B8HfvhaK_es();
160365
160776
  CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
@@ -161806,7 +162217,7 @@ var init_decrypt_docx_4kQ488M9_es = __esm(() => {
161806
162217
  ]);
161807
162218
  });
161808
162219
 
161809
- // ../../packages/superdoc/dist/chunks/DocxZipper-TPSo9G36.es.js
162220
+ // ../../packages/superdoc/dist/chunks/DocxZipper-Bphhij1P.es.js
161810
162221
  function sniffEncoding(u8) {
161811
162222
  if (u8.length >= 2) {
161812
162223
  const b0 = u8[0], b1 = u8[1];
@@ -162303,6 +162714,19 @@ var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.docum
162303
162714
  const staleOverridePartNames = COMMENT_FILE_BASENAMES.map((name) => `/word/${name}`).filter((partName) => {
162304
162715
  return !hasFile(partName.slice(1));
162305
162716
  });
162717
+ const CUSTOM_XML_PROPS_CT = "application/vnd.openxmlformats-officedocument.customXmlProperties+xml";
162718
+ if (types3?.elements?.length)
162719
+ for (const el of types3.elements) {
162720
+ if (el?.name !== "Override")
162721
+ continue;
162722
+ if (el?.attributes?.ContentType !== CUSTOM_XML_PROPS_CT)
162723
+ continue;
162724
+ const partName = el?.attributes?.PartName;
162725
+ if (typeof partName !== "string" || !partName.startsWith("/"))
162726
+ continue;
162727
+ if (!hasFile(partName.slice(1)))
162728
+ staleOverridePartNames.push(partName);
162729
+ }
162306
162730
  const beginningString = '<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">';
162307
162731
  let updatedContentTypesXml = contentTypesXml.replace(beginningString, `${beginningString}${typesString}`);
162308
162732
  for (const partName of staleOverridePartNames) {
@@ -162466,7 +162890,7 @@ var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.docum
162466
162890
  return `image/${MIME_TYPE_FOR_EXT[detectedType] || detectedType}`;
162467
162891
  }
162468
162892
  }, DocxZipper_default;
162469
- var init_DocxZipper_TPSo9G36_es = __esm(() => {
162893
+ var init_DocxZipper_Bphhij1P_es = __esm(() => {
162470
162894
  init_rolldown_runtime_Bg48TavK_es();
162471
162895
  init_jszip_C49i9kUs_es();
162472
162896
  init_xml_js_CqGKpaft_es();
@@ -209057,7 +209481,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
209057
209481
  init_remark_gfm_BhnWr3yf_es();
209058
209482
  });
209059
209483
 
209060
- // ../../packages/superdoc/dist/chunks/src-GAfNMk63.es.js
209484
+ // ../../packages/superdoc/dist/chunks/src-ChfKFC3W.es.js
209061
209485
  function deleteProps(obj, propOrProps) {
209062
209486
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
209063
209487
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -209307,9 +209731,9 @@ function getParagraphInlineDirection(attrs) {
209307
209731
  if (fromContext != null)
209308
209732
  return fromContext;
209309
209733
  const ppRtl = attrs?.paragraphProperties?.rightToLeft;
209310
- if (attrs?.direction === "rtl" || attrs?.dir === "rtl" || attrs?.rtl === true || ppRtl === true)
209734
+ if (ppRtl === true)
209311
209735
  return "rtl";
209312
- if (attrs?.direction === "ltr" || attrs?.dir === "ltr" || attrs?.rtl === false || ppRtl === false)
209736
+ if (ppRtl === false)
209313
209737
  return "ltr";
209314
209738
  }
209315
209739
  function getTableVisualDirection(attrs) {
@@ -211222,11 +211646,11 @@ function syncSplitParagraphRunProperties(attrs, runProperties) {
211222
211646
  paragraphProperties: nextParagraphProperties
211223
211647
  };
211224
211648
  }
211225
- function getConverter$72(editor) {
211649
+ function getConverter$82(editor) {
211226
211650
  return editor.converter;
211227
211651
  }
211228
211652
  function readTranslatedLinkedStyles(editor) {
211229
- return getConverter$72(editor)?.translatedLinkedStyles ?? null;
211653
+ return getConverter$82(editor)?.translatedLinkedStyles ?? null;
211230
211654
  }
211231
211655
  function isHeadingStyleId$1(styleId) {
211232
211656
  return typeof styleId === "string" && /^heading\s*[1-6]$/i.test(styleId.trim());
@@ -232186,7 +232610,7 @@ function makeTrackedChangeAnchorKey(ref$1) {
232186
232610
  function makeCommentAnchorKey(commentId) {
232187
232611
  return `${COMMENT_ANCHOR_KEY_PREFIX}${commentId}`;
232188
232612
  }
232189
- function getConverter$62(editor) {
232613
+ function getConverter$72(editor) {
232190
232614
  return editor.converter;
232191
232615
  }
232192
232616
  function toRevisionCapableNoteId(note) {
@@ -232203,7 +232627,7 @@ function enumerateRevisionCapableStories(editor) {
232203
232627
  kind: "story",
232204
232628
  storyType: "body"
232205
232629
  }];
232206
- const converter = getConverter$62(editor);
232630
+ const converter = getConverter$72(editor);
232207
232631
  if (!converter)
232208
232632
  return stories;
232209
232633
  if (converter.headers)
@@ -236293,15 +236717,15 @@ function previewPlan(editor, input2) {
236293
236717
  }
236294
236718
  stepPreviews.push(preview);
236295
236719
  }
236296
- for (const failure of assertFailures)
236720
+ for (const failure$1 of assertFailures)
236297
236721
  failures.push({
236298
236722
  code: "PRECONDITION_FAILED",
236299
- stepId: failure.stepId,
236723
+ stepId: failure$1.stepId,
236300
236724
  phase: "assert",
236301
- message: `assert "${failure.stepId}" expected ${failure.expectedCount} matches but found ${failure.actualCount}`,
236725
+ message: `assert "${failure$1.stepId}" expected ${failure$1.expectedCount} matches but found ${failure$1.actualCount}`,
236302
236726
  details: {
236303
- expectedCount: failure.expectedCount,
236304
- actualCount: failure.actualCount
236727
+ expectedCount: failure$1.expectedCount,
236728
+ actualCount: failure$1.actualCount
236305
236729
  }
236306
236730
  });
236307
236731
  } catch (error3) {
@@ -240693,10 +241117,10 @@ function registerBuiltInExecutors() {
240693
241117
  };
240694
241118
  } });
240695
241119
  }
240696
- function getConverter$52(editor) {
241120
+ function getConverter$62(editor) {
240697
241121
  return editor.converter;
240698
241122
  }
240699
- function getConverter$42(editor) {
241123
+ function getConverter$52(editor) {
240700
241124
  return editor.converter;
240701
241125
  }
240702
241126
  function createEmptyHeaderFooterJson() {
@@ -240709,7 +241133,7 @@ function createEmptyHeaderFooterJson() {
240709
241133
  };
240710
241134
  }
240711
241135
  function syncHeaderFooterCaches(editor, part) {
240712
- const converter = getConverter$42(editor);
241136
+ const converter = getConverter$52(editor);
240713
241137
  if (!converter)
240714
241138
  return;
240715
241139
  const relsRoot = part?.elements?.find((el) => el.name === "Relationships");
@@ -240771,7 +241195,7 @@ function createTableWrapper(editor, input2, options) {
240771
241195
  });
240772
241196
  return adapterResult;
240773
241197
  }
240774
- function getConverter$32(editor) {
241198
+ function getConverter$42(editor) {
240775
241199
  return editor.converter;
240776
241200
  }
240777
241201
  function toSectionFailure2(code7, message) {
@@ -240839,7 +241263,7 @@ function buildSectionMarginsForAttrs2(sectPr) {
240839
241263
  };
240840
241264
  }
240841
241265
  function syncConverterBodySection2(editor, sectPr) {
240842
- const converter = getConverter$32(editor);
241266
+ const converter = getConverter$42(editor);
240843
241267
  if (!converter)
240844
241268
  return;
240845
241269
  converter.bodySectPr = cloneXmlElement(sectPr);
@@ -240959,7 +241383,7 @@ function createSectionBreakNode(editor, breakParagraphId, input2) {
240959
241383
  return paragraphNode;
240960
241384
  }
240961
241385
  function updateGlobalTitlePageFlag(editor) {
240962
- const converter = getConverter$32(editor);
241386
+ const converter = getConverter$42(editor);
240963
241387
  if (!converter)
240964
241388
  return;
240965
241389
  const anyTitlePage = resolveSectionProjections(editor).some((entry) => entry.domain.titlePage === true);
@@ -241043,7 +241467,7 @@ function sectionsSetTitlePageAdapter(editor, input2, options) {
241043
241467
  }
241044
241468
  function sectionsSetOddEvenHeadersFootersAdapter(editor, input2, options) {
241045
241469
  rejectTrackedMode("sections.setOddEvenHeadersFooters", options);
241046
- const converter = getConverter$32(editor);
241470
+ const converter = getConverter$42(editor);
241047
241471
  if (!converter)
241048
241472
  throw new DocumentApiAdapterError("CAPABILITY_UNAVAILABLE", "sections.setOddEvenHeadersFooters requires an active document converter.");
241049
241473
  return mutatePart({
@@ -241079,13 +241503,13 @@ function sectionsSetSectionDirectionAdapter(editor, input2, options) {
241079
241503
  }
241080
241504
  function sectionsSetHeaderFooterRefAdapter(editor, input2, options) {
241081
241505
  return sectionMutationBySectPr$1(editor, input2, options, "sections.setHeaderFooterRef", (sectPr, _projection, _sections, dryRun) => {
241082
- const converter = getConverter$32(editor) ?? null;
241506
+ const converter = getConverter$42(editor) ?? null;
241083
241507
  return setHeaderFooterRefMutation(sectPr, input2.kind, input2.variant, input2.refId, converter, "sections.setHeaderFooterRef", dryRun);
241084
241508
  });
241085
241509
  }
241086
241510
  function sectionsClearHeaderFooterRefAdapter(editor, input2, options) {
241087
241511
  return sectionMutationBySectPr$1(editor, input2, options, "sections.clearHeaderFooterRef", (sectPr, _projection, _sections, dryRun) => {
241088
- const converter = getConverter$32(editor) ?? null;
241512
+ const converter = getConverter$42(editor) ?? null;
241089
241513
  clearHeaderFooterRefMutation(sectPr, input2.kind, input2.variant, converter, dryRun);
241090
241514
  });
241091
241515
  }
@@ -245714,11 +246138,11 @@ function createContentControlsAdapter(editor) {
245714
246138
  create: (input2, options) => createWrapper(editor, input2, options)
245715
246139
  };
245716
246140
  }
245717
- function getConverter$22(editor) {
246141
+ function getConverter$32(editor) {
245718
246142
  return editor.converter;
245719
246143
  }
245720
246144
  function requireConverter$1(editor, operationName) {
245721
- const converter = getConverter$22(editor);
246145
+ const converter = getConverter$32(editor);
245722
246146
  if (!converter)
245723
246147
  throw new DocumentApiAdapterError("CAPABILITY_UNAVAILABLE", `${operationName} requires an active document converter.`);
245724
246148
  return converter;
@@ -245824,7 +246248,7 @@ function headerFootersResolveAdapter(editor, input2) {
245824
246248
  function headerFootersRefsSetAdapter(editor, input2, options) {
245825
246249
  const { section, headerFooterKind, variant } = input2.target;
245826
246250
  const result = sectionMutationBySectPr(editor, { target: section }, options, "headerFooters.refs.set", (sectPr, _projection, _sections, dryRun) => {
245827
- const converter = getConverter$22(editor) ?? null;
246251
+ const converter = getConverter$32(editor) ?? null;
245828
246252
  return setHeaderFooterRefMutation(sectPr, headerFooterKind, variant, input2.refId, converter, "headerFooters.refs.set", dryRun);
245829
246253
  });
245830
246254
  invalidateSlotRuntimesAfterRefChange(editor, result, options);
@@ -245833,7 +246257,7 @@ function headerFootersRefsSetAdapter(editor, input2, options) {
245833
246257
  function headerFootersRefsClearAdapter(editor, input2, options) {
245834
246258
  const { section, headerFooterKind, variant } = input2.target;
245835
246259
  const result = sectionMutationBySectPr(editor, { target: section }, options, "headerFooters.refs.clear", (sectPr, _projection, _sections, dryRun) => {
245836
- clearHeaderFooterRefMutation(sectPr, headerFooterKind, variant, getConverter$22(editor) ?? null, dryRun);
246260
+ clearHeaderFooterRefMutation(sectPr, headerFooterKind, variant, getConverter$32(editor) ?? null, dryRun);
245837
246261
  });
245838
246262
  invalidateSlotRuntimesAfterRefChange(editor, result, options);
245839
246263
  return result;
@@ -246669,6 +247093,672 @@ function bookmarksRemoveWrapper(editor, input2, options) {
246669
247093
  disposeEphemeralWriteRuntime(runtime);
246670
247094
  }
246671
247095
  }
247096
+ function executeOutOfBandMutation(editor, mutateFn, options) {
247097
+ if (!options.dryRun)
247098
+ if (editor.options?.collaborationProvider && editor.options?.ydoc)
247099
+ try {
247100
+ yUndoPluginKey.getState(editor.state)?.undoManager?.stopCapturing();
247101
+ } catch {}
247102
+ else
247103
+ try {
247104
+ editor.view?.dispatch?.(closeHistory(editor.state.tr));
247105
+ } catch {}
247106
+ checkRevision(editor, options.expectedRevision);
247107
+ const result = mutateFn(options.dryRun);
247108
+ if (result.changed && !options.dryRun) {
247109
+ const converter = editor.converter;
247110
+ if (converter) {
247111
+ converter.documentModified = true;
247112
+ if (!converter.documentGuid && typeof converter.promoteToGuid === "function")
247113
+ converter.promoteToGuid();
247114
+ }
247115
+ incrementRevision(editor);
247116
+ }
247117
+ return result.payload;
247118
+ }
247119
+ function getLocalName2(name) {
247120
+ if (!name || typeof name !== "string")
247121
+ return "";
247122
+ const i4 = name.indexOf(":");
247123
+ return i4 >= 0 ? name.slice(i4 + 1) : name;
247124
+ }
247125
+ function findFirstElement(parent, localName) {
247126
+ if (!parent?.elements?.length)
247127
+ return null;
247128
+ return parent.elements.find((el) => el?.type === "element" && getLocalName2(el.name) === localName) ?? null;
247129
+ }
247130
+ function findAllElements(parent, localName) {
247131
+ if (!parent?.elements?.length)
247132
+ return [];
247133
+ return parent.elements.filter((el) => el?.type === "element" && getLocalName2(el.name) === localName);
247134
+ }
247135
+ function partNameFromIndex(index2) {
247136
+ return `customXml/item${index2}.xml`;
247137
+ }
247138
+ function propsPartNameFromIndex(index2) {
247139
+ return `customXml/itemProps${index2}.xml`;
247140
+ }
247141
+ function indexFromPartName(partName) {
247142
+ const m$1 = /^customXml\/item(\d+)\.xml$/i.exec(partName ?? "");
247143
+ return m$1 ? Number.parseInt(m$1[1], 10) : null;
247144
+ }
247145
+ function indexFromPropsPartName(propsPartName) {
247146
+ const m$1 = /^customXml\/itemProps(\d+)\.xml$/i.exec(propsPartName ?? "");
247147
+ return m$1 ? Number.parseInt(m$1[1], 10) : null;
247148
+ }
247149
+ function isCustomXmlStoragePartName(partName) {
247150
+ return indexFromPartName(partName) != null;
247151
+ }
247152
+ function listCustomXmlStoragePartNames(convertedXml) {
247153
+ if (!convertedXml || typeof convertedXml !== "object")
247154
+ return [];
247155
+ const indexes = [];
247156
+ for (const path2 of Object.keys(convertedXml)) {
247157
+ const idx = indexFromPartName(path2);
247158
+ if (idx != null)
247159
+ indexes.push(idx);
247160
+ }
247161
+ indexes.sort((a2, b$1) => a2 - b$1);
247162
+ return indexes.map(partNameFromIndex);
247163
+ }
247164
+ function findPropsPartFor(convertedXml, partName) {
247165
+ if (!convertedXml)
247166
+ return null;
247167
+ const idx = indexFromPartName(partName);
247168
+ if (idx == null)
247169
+ return null;
247170
+ const relsRoot = convertedXml[`customXml/_rels/item${idx}.xml.rels`]?.elements?.find((el) => getLocalName2(el?.name) === "Relationships");
247171
+ if (relsRoot?.elements?.length)
247172
+ for (const rel of relsRoot.elements) {
247173
+ if (rel?.attributes?.Type !== "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps")
247174
+ continue;
247175
+ const target = rel?.attributes?.Target;
247176
+ if (typeof target !== "string" || target.length === 0)
247177
+ continue;
247178
+ const candidate = resolveOpcTargetPath(target, "customXml");
247179
+ if (candidate && convertedXml[candidate])
247180
+ return candidate;
247181
+ }
247182
+ const indexCandidate = propsPartNameFromIndex(idx);
247183
+ return convertedXml[indexCandidate] ? indexCandidate : null;
247184
+ }
247185
+ function parsePropsPart(propsDoc) {
247186
+ const root3 = propsDoc?.elements?.find((el) => el?.type === "element" && getLocalName2(el.name) === "datastoreItem");
247187
+ if (!root3)
247188
+ return null;
247189
+ const itemId = root3.attributes?.["ds:itemID"] ?? root3.attributes?.itemID ?? null;
247190
+ const schemaRefs = findAllElements(findFirstElement(root3, "schemaRefs"), "schemaRef").map((el) => el.attributes?.["ds:uri"] ?? el.attributes?.uri ?? null).filter((uri) => typeof uri === "string" && uri.length > 0);
247191
+ return {
247192
+ itemId: typeof itemId === "string" && itemId.length > 0 ? itemId : null,
247193
+ schemaRefs
247194
+ };
247195
+ }
247196
+ function parseStoragePartRootNamespace(storageDoc) {
247197
+ const root3 = storageDoc?.elements?.find((el) => el?.type === "element");
247198
+ if (!root3)
247199
+ return null;
247200
+ const xmlns2 = root3.attributes?.xmlns;
247201
+ if (typeof xmlns2 === "string" && xmlns2.length > 0)
247202
+ return xmlns2;
247203
+ const elementName = root3.name ?? "";
247204
+ const colonIdx = elementName.indexOf(":");
247205
+ if (colonIdx > 0) {
247206
+ const prefixedAttr = `xmlns:${elementName.slice(0, colonIdx)}`;
247207
+ const prefixedValue = root3.attributes?.[prefixedAttr];
247208
+ if (typeof prefixedValue === "string" && prefixedValue.length > 0)
247209
+ return prefixedValue;
247210
+ }
247211
+ return null;
247212
+ }
247213
+ function serializeXmlDoc(xmlDoc) {
247214
+ if (!xmlDoc)
247215
+ return "";
247216
+ return import_lib4.js2xml(xmlDoc, {
247217
+ compact: false,
247218
+ spaces: 0
247219
+ });
247220
+ }
247221
+ function readCustomXmlPart(convertedXml, target) {
247222
+ if (!target || !convertedXml)
247223
+ return null;
247224
+ let partName = null;
247225
+ let itemId = null;
247226
+ if (typeof target.partName === "string" && target.partName.length > 0) {
247227
+ if (!isCustomXmlStoragePartName(target.partName))
247228
+ return null;
247229
+ partName = target.partName;
247230
+ } else if (typeof target.id === "string" && target.id.length > 0) {
247231
+ itemId = target.id;
247232
+ for (const candidatePartName of listCustomXmlStoragePartNames(convertedXml)) {
247233
+ const propsName = findPropsPartFor(convertedXml, candidatePartName);
247234
+ if (!propsName)
247235
+ continue;
247236
+ if (parsePropsPart(convertedXml[propsName])?.itemId === itemId) {
247237
+ partName = candidatePartName;
247238
+ break;
247239
+ }
247240
+ }
247241
+ if (!partName)
247242
+ return null;
247243
+ } else
247244
+ return null;
247245
+ const storageDoc = convertedXml[partName];
247246
+ if (!storageDoc)
247247
+ return null;
247248
+ const propsPartName = findPropsPartFor(convertedXml, partName);
247249
+ const props = propsPartName ? parsePropsPart(convertedXml[propsPartName]) : null;
247250
+ return {
247251
+ id: props?.itemId ?? null,
247252
+ partName,
247253
+ propsPartName: propsPartName ?? null,
247254
+ rootNamespace: parseStoragePartRootNamespace(storageDoc),
247255
+ schemaRefs: props?.schemaRefs ?? [],
247256
+ content: serializeXmlDoc(storageDoc)
247257
+ };
247258
+ }
247259
+ function listCustomXmlParts(convertedXml) {
247260
+ return listCustomXmlStoragePartNames(convertedXml).map((partName) => {
247261
+ const propsPartName = findPropsPartFor(convertedXml, partName);
247262
+ const props = propsPartName ? parsePropsPart(convertedXml[propsPartName]) : null;
247263
+ return {
247264
+ id: props?.itemId ?? null,
247265
+ partName,
247266
+ propsPartName: propsPartName ?? null,
247267
+ rootNamespace: parseStoragePartRootNamespace(convertedXml[partName]),
247268
+ schemaRefs: props?.schemaRefs ?? []
247269
+ };
247270
+ });
247271
+ }
247272
+ function nextCustomXmlItemIndex(convertedXml, converter) {
247273
+ const used = /* @__PURE__ */ new Set;
247274
+ for (const path2 of Object.keys(convertedXml ?? {})) {
247275
+ const idx = indexFromPartName(path2) ?? indexFromPropsPartName(path2);
247276
+ if (idx != null)
247277
+ used.add(idx);
247278
+ }
247279
+ let candidate = 1;
247280
+ while (used.has(candidate))
247281
+ candidate += 1;
247282
+ return candidate;
247283
+ }
247284
+ function createXmlDocument2(rootElement, declaration) {
247285
+ const nextDeclaration = declaration ?? DEFAULT_XML_DECLARATION;
247286
+ return {
247287
+ declaration: {
247288
+ ...nextDeclaration,
247289
+ attributes: { ...nextDeclaration.attributes }
247290
+ },
247291
+ elements: [rootElement]
247292
+ };
247293
+ }
247294
+ function parseContentToRootElement(content3) {
247295
+ const parsed = import_lib4.xml2js(content3, { compact: false });
247296
+ const root3 = (parsed.elements ?? []).find((el) => el?.type === "element");
247297
+ if (!root3)
247298
+ throw new Error("Custom XML content is missing a root element.");
247299
+ return {
247300
+ root: root3,
247301
+ declaration: parsed.declaration ?? null
247302
+ };
247303
+ }
247304
+ function ensureDocumentRelationshipsRoot2(convertedXml) {
247305
+ if (!convertedXml["word/_rels/document.xml.rels"])
247306
+ convertedXml["word/_rels/document.xml.rels"] = createXmlDocument2({
247307
+ type: "element",
247308
+ name: "Relationships",
247309
+ attributes: { xmlns: "http://schemas.openxmlformats.org/package/2006/relationships" },
247310
+ elements: []
247311
+ });
247312
+ const relsData = convertedXml["word/_rels/document.xml.rels"];
247313
+ relsData.elements ??= [];
247314
+ let relsRoot = relsData.elements.find((el) => getLocalName2(el?.name) === "Relationships");
247315
+ if (!relsRoot) {
247316
+ relsRoot = {
247317
+ type: "element",
247318
+ name: "Relationships",
247319
+ attributes: { xmlns: "http://schemas.openxmlformats.org/package/2006/relationships" },
247320
+ elements: []
247321
+ };
247322
+ relsData.elements.push(relsRoot);
247323
+ }
247324
+ relsRoot.elements ??= [];
247325
+ return relsRoot;
247326
+ }
247327
+ function getNextRelationshipId2(relsRoot) {
247328
+ const used = (relsRoot?.elements ?? []).map((rel) => {
247329
+ const id2 = rel?.attributes?.Id;
247330
+ const m$1 = typeof id2 === "string" ? /^rId(\d+)$/.exec(id2) : null;
247331
+ return m$1 ? Number.parseInt(m$1[1], 10) : NaN;
247332
+ }).filter((n) => Number.isFinite(n));
247333
+ return `rId${(used.length > 0 ? Math.max(...used) : 0) + 1}`;
247334
+ }
247335
+ function buildDocumentRelTarget(partName) {
247336
+ return partName.startsWith("customXml/") ? `../${partName}` : partName;
247337
+ }
247338
+ function buildItemPropsRoot(itemId, schemaRefs) {
247339
+ return [{
247340
+ type: "element",
247341
+ name: "ds:datastoreItem",
247342
+ attributes: {
247343
+ "ds:itemID": itemId,
247344
+ "xmlns:ds": CUSTOM_XML_DATASTORE_NAMESPACE
247345
+ },
247346
+ elements: schemaRefs === undefined ? [] : [{
247347
+ type: "element",
247348
+ name: "ds:schemaRefs",
247349
+ elements: schemaRefs.map((uri) => ({
247350
+ type: "element",
247351
+ name: "ds:schemaRef",
247352
+ attributes: { "ds:uri": uri }
247353
+ }))
247354
+ }]
247355
+ }][0];
247356
+ }
247357
+ function buildItemRelsRoot(propsPartFileName) {
247358
+ return {
247359
+ type: "element",
247360
+ name: "Relationships",
247361
+ attributes: { xmlns: "http://schemas.openxmlformats.org/package/2006/relationships" },
247362
+ elements: [{
247363
+ type: "element",
247364
+ name: "Relationship",
247365
+ attributes: {
247366
+ Id: "rId1",
247367
+ Type: CUSTOM_XML_PROPS_RELATIONSHIP_TYPE2,
247368
+ Target: propsPartFileName
247369
+ }
247370
+ }]
247371
+ };
247372
+ }
247373
+ function resolveTargetPartName(convertedXml, target) {
247374
+ if (!target)
247375
+ return null;
247376
+ if (typeof target.partName === "string" && target.partName.length > 0) {
247377
+ if (!isCustomXmlStoragePartName(target.partName))
247378
+ return null;
247379
+ return convertedXml[target.partName] ? target.partName : null;
247380
+ }
247381
+ if (typeof target.id === "string" && target.id.length > 0)
247382
+ for (const partName of listCustomXmlStoragePartNames(convertedXml)) {
247383
+ const propsName = findPropsPartFor(convertedXml, partName);
247384
+ if (!propsName)
247385
+ continue;
247386
+ if (parsePropsPart(convertedXml[propsName])?.itemId === target.id)
247387
+ return partName;
247388
+ }
247389
+ return null;
247390
+ }
247391
+ function createCustomXmlPart(convertedXml, { content: content3, schemaRefs }, converter) {
247392
+ const { root: root3, declaration } = parseContentToRootElement(content3);
247393
+ const index2 = nextCustomXmlItemIndex(convertedXml, converter);
247394
+ const partName = partNameFromIndex(index2);
247395
+ const propsPartName = propsPartNameFromIndex(index2);
247396
+ const itemRelsPath = `customXml/_rels/item${index2}.xml.rels`;
247397
+ const itemId = `{${v4_default().toUpperCase()}}`;
247398
+ convertedXml[partName] = createXmlDocument2(root3, declaration);
247399
+ convertedXml[propsPartName] = createXmlDocument2(buildItemPropsRoot(itemId, schemaRefs));
247400
+ convertedXml[itemRelsPath] = createXmlDocument2(buildItemRelsRoot(`itemProps${index2}.xml`));
247401
+ const relsRoot = ensureDocumentRelationshipsRoot2(convertedXml);
247402
+ relsRoot.elements.push({
247403
+ type: "element",
247404
+ name: "Relationship",
247405
+ attributes: {
247406
+ Id: getNextRelationshipId2(relsRoot),
247407
+ Type: CUSTOM_XML_DATA_RELATIONSHIP_TYPE,
247408
+ Target: buildDocumentRelTarget(partName)
247409
+ }
247410
+ });
247411
+ if (converter?.removedCustomXmlPaths instanceof Set) {
247412
+ converter.removedCustomXmlPaths.delete(partName);
247413
+ converter.removedCustomXmlPaths.delete(propsPartName);
247414
+ converter.removedCustomXmlPaths.delete(itemRelsPath);
247415
+ }
247416
+ return {
247417
+ id: itemId,
247418
+ partName,
247419
+ propsPartName
247420
+ };
247421
+ }
247422
+ function patchCustomXmlPart(convertedXml, target, { content: content3, schemaRefs }, converter) {
247423
+ const partName = resolveTargetPartName(convertedXml, target);
247424
+ if (!partName)
247425
+ return null;
247426
+ if (content3 !== undefined) {
247427
+ const { root: root3, declaration } = parseContentToRootElement(content3);
247428
+ convertedXml[partName] = createXmlDocument2(root3, convertedXml[partName]?.declaration ?? declaration);
247429
+ }
247430
+ let resolvedId = null;
247431
+ if (schemaRefs !== undefined) {
247432
+ let propsPartName = findPropsPartFor(convertedXml, partName);
247433
+ if (propsPartName)
247434
+ resolvedId = parsePropsPart(convertedXml[propsPartName])?.itemId ?? null;
247435
+ if (!propsPartName) {
247436
+ const idx = indexFromPartName(partName);
247437
+ if (idx == null)
247438
+ return null;
247439
+ propsPartName = propsPartNameFromIndex(idx);
247440
+ const itemRelsPath = `customXml/_rels/item${idx}.xml.rels`;
247441
+ resolvedId = `{${v4_default().toUpperCase()}}`;
247442
+ convertedXml[itemRelsPath] = createXmlDocument2(buildItemRelsRoot(`itemProps${idx}.xml`));
247443
+ }
247444
+ if (!resolvedId)
247445
+ resolvedId = `{${v4_default().toUpperCase()}}`;
247446
+ const existingDecl = convertedXml[propsPartName]?.declaration;
247447
+ convertedXml[propsPartName] = createXmlDocument2(buildItemPropsRoot(resolvedId, schemaRefs), existingDecl);
247448
+ } else {
247449
+ const propsPartName = findPropsPartFor(convertedXml, partName);
247450
+ if (propsPartName)
247451
+ resolvedId = parsePropsPart(convertedXml[propsPartName])?.itemId ?? null;
247452
+ }
247453
+ if (converter)
247454
+ invalidateConverterCachesForPath(converter, partName);
247455
+ return resolvedId ? {
247456
+ partName,
247457
+ id: resolvedId
247458
+ } : { partName };
247459
+ }
247460
+ function removeCustomXmlPart(convertedXml, target, converter) {
247461
+ const partName = resolveTargetPartName(convertedXml, target);
247462
+ if (!partName)
247463
+ return false;
247464
+ const index2 = indexFromPartName(partName);
247465
+ const removedPaths = [
247466
+ partName,
247467
+ findPropsPartFor(convertedXml, partName),
247468
+ index2 == null ? null : `customXml/_rels/item${index2}.xml.rels`
247469
+ ].filter((path2) => typeof path2 === "string" && path2.length > 0);
247470
+ for (const path2 of removedPaths)
247471
+ delete convertedXml[path2];
247472
+ const relsRoot = convertedXml["word/_rels/document.xml.rels"]?.elements?.find((el) => getLocalName2(el?.name) === "Relationships");
247473
+ if (relsRoot?.elements?.length)
247474
+ relsRoot.elements = relsRoot.elements.filter((rel) => {
247475
+ if (rel?.attributes?.Type !== "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml")
247476
+ return true;
247477
+ return resolveOpcTargetPath(rel?.attributes?.Target, "word") !== partName;
247478
+ });
247479
+ if (converter) {
247480
+ if (!(converter.removedCustomXmlPaths instanceof Set))
247481
+ converter.removedCustomXmlPaths = /* @__PURE__ */ new Set;
247482
+ for (const path2 of removedPaths)
247483
+ converter.removedCustomXmlPaths.add(path2);
247484
+ invalidateConverterCachesForPath(converter, partName);
247485
+ }
247486
+ return true;
247487
+ }
247488
+ function invalidateConverterCachesForPath(converter, partName) {
247489
+ if (!converter || typeof partName !== "string")
247490
+ return;
247491
+ const biblio = converter.bibliographyPart;
247492
+ if (biblio && biblio.partPath === partName)
247493
+ converter.bibliographyPart = {
247494
+ sources: [],
247495
+ partPath: null,
247496
+ itemPropsPath: null,
247497
+ itemRelsPath: null,
247498
+ selectedStyle: null,
247499
+ styleName: null,
247500
+ version: null
247501
+ };
247502
+ }
247503
+ function getConverter$22(editor) {
247504
+ return editor.converter ?? null;
247505
+ }
247506
+ function getConvertedXml2(editor) {
247507
+ return getConverter$22(editor)?.convertedXml ?? {};
247508
+ }
247509
+ function toSummary(record) {
247510
+ const summary = {
247511
+ partName: record.partName,
247512
+ schemaRefs: record.schemaRefs
247513
+ };
247514
+ if (record.id)
247515
+ summary.id = record.id;
247516
+ if (record.propsPartName)
247517
+ summary.propsPartName = record.propsPartName;
247518
+ if (record.rootNamespace)
247519
+ summary.rootNamespace = record.rootNamespace;
247520
+ return summary;
247521
+ }
247522
+ function customXmlPartsListWrapper(editor, query2) {
247523
+ const revision = getRevision(editor);
247524
+ let filtered = listCustomXmlParts(getConvertedXml2(editor));
247525
+ if (query2?.rootNamespace !== undefined)
247526
+ filtered = filtered.filter((p$12) => p$12.rootNamespace === query2.rootNamespace);
247527
+ if (query2?.schemaRef !== undefined)
247528
+ filtered = filtered.filter((p$12) => p$12.schemaRefs.includes(query2.schemaRef));
247529
+ const { total, items: paged } = paginate(filtered.map((record) => {
247530
+ const summary = toSummary(record);
247531
+ const stableId = summary.id ?? summary.partName;
247532
+ return buildDiscoveryItem(stableId, buildResolvedHandle(`customXml:${stableId}`, "ephemeral", "ext:customXmlPart"), summary);
247533
+ }), query2?.offset, query2?.limit);
247534
+ return buildDiscoveryResult({
247535
+ evaluatedRevision: revision,
247536
+ total,
247537
+ items: paged,
247538
+ page: {
247539
+ limit: query2?.limit ?? total,
247540
+ offset: query2?.offset ?? 0,
247541
+ returned: paged.length
247542
+ }
247543
+ });
247544
+ }
247545
+ function customXmlPartsGetWrapper(editor, input2) {
247546
+ const record = readCustomXmlPart(getConvertedXml2(editor), input2.target);
247547
+ if (!record)
247548
+ return null;
247549
+ const info = {
247550
+ partName: record.partName,
247551
+ rootNamespace: record.rootNamespace ?? undefined,
247552
+ schemaRefs: record.schemaRefs,
247553
+ content: record.content
247554
+ };
247555
+ if (record.id)
247556
+ info.id = record.id;
247557
+ if (record.propsPartName)
247558
+ info.propsPartName = record.propsPartName;
247559
+ return info;
247560
+ }
247561
+ function failure(code7, message) {
247562
+ return {
247563
+ success: false,
247564
+ failure: {
247565
+ code: code7,
247566
+ message
247567
+ }
247568
+ };
247569
+ }
247570
+ function isWriteFailure(outcome) {
247571
+ return outcome.ok === false;
247572
+ }
247573
+ function targetNotFound() {
247574
+ return {
247575
+ ok: false,
247576
+ code: "TARGET_NOT_FOUND",
247577
+ message: "No custom XML part matched the supplied target."
247578
+ };
247579
+ }
247580
+ function safeValidate(fn2) {
247581
+ try {
247582
+ return {
247583
+ ok: true,
247584
+ payload: fn2()
247585
+ };
247586
+ } catch (e) {
247587
+ return {
247588
+ ok: false,
247589
+ code: "INVALID_INPUT",
247590
+ message: e instanceof Error ? e.message : String(e)
247591
+ };
247592
+ }
247593
+ }
247594
+ function customXmlPartsCreateWrapper(editor, input2, options) {
247595
+ rejectTrackedMode("customXml.parts.create", options);
247596
+ const outcome = executeOutOfBandMutation(editor, (dryRun) => {
247597
+ if (dryRun) {
247598
+ const probe$1 = safeValidate(() => createCustomXmlPart({}, {
247599
+ content: input2.content,
247600
+ schemaRefs: input2.schemaRefs
247601
+ }));
247602
+ if (isWriteFailure(probe$1))
247603
+ return {
247604
+ changed: false,
247605
+ payload: probe$1
247606
+ };
247607
+ return {
247608
+ changed: false,
247609
+ payload: {
247610
+ ok: true,
247611
+ payload: {
247612
+ id: "{DRY-RUN}",
247613
+ partName: "",
247614
+ propsPartName: ""
247615
+ }
247616
+ }
247617
+ };
247618
+ }
247619
+ const probe = safeValidate(() => createCustomXmlPart(getConvertedXml2(editor), {
247620
+ content: input2.content,
247621
+ schemaRefs: input2.schemaRefs
247622
+ }, getConverter$22(editor)));
247623
+ if (isWriteFailure(probe))
247624
+ return {
247625
+ changed: false,
247626
+ payload: probe
247627
+ };
247628
+ return {
247629
+ changed: true,
247630
+ payload: {
247631
+ ok: true,
247632
+ payload: probe.payload
247633
+ }
247634
+ };
247635
+ }, {
247636
+ dryRun: options?.dryRun === true,
247637
+ expectedRevision: options?.expectedRevision
247638
+ });
247639
+ if (isWriteFailure(outcome))
247640
+ return failure(outcome.code, outcome.message);
247641
+ return {
247642
+ success: true,
247643
+ id: outcome.payload.id,
247644
+ partName: outcome.payload.partName,
247645
+ propsPartName: outcome.payload.propsPartName
247646
+ };
247647
+ }
247648
+ function customXmlPartsPatchWrapper(editor, input2, options) {
247649
+ rejectTrackedMode("customXml.parts.patch", options);
247650
+ const outcome = executeOutOfBandMutation(editor, (dryRun) => {
247651
+ if (dryRun) {
247652
+ if (!resolveTargetPartName(getConvertedXml2(editor), input2.target))
247653
+ return {
247654
+ changed: false,
247655
+ payload: targetNotFound()
247656
+ };
247657
+ if (input2.content !== undefined) {
247658
+ const probe$1 = safeValidate(() => createCustomXmlPart({}, {
247659
+ content: input2.content,
247660
+ schemaRefs: undefined
247661
+ }));
247662
+ if (isWriteFailure(probe$1))
247663
+ return {
247664
+ changed: false,
247665
+ payload: probe$1
247666
+ };
247667
+ }
247668
+ return {
247669
+ changed: false,
247670
+ payload: {
247671
+ ok: true,
247672
+ payload: { id: null }
247673
+ }
247674
+ };
247675
+ }
247676
+ if (!resolveTargetPartName(getConvertedXml2(editor), input2.target))
247677
+ return {
247678
+ changed: false,
247679
+ payload: targetNotFound()
247680
+ };
247681
+ const probe = safeValidate(() => patchCustomXmlPart(getConvertedXml2(editor), input2.target, {
247682
+ content: input2.content,
247683
+ schemaRefs: input2.schemaRefs
247684
+ }, getConverter$22(editor)));
247685
+ if (isWriteFailure(probe))
247686
+ return {
247687
+ changed: false,
247688
+ payload: probe
247689
+ };
247690
+ if (!probe.payload)
247691
+ return {
247692
+ changed: false,
247693
+ payload: targetNotFound()
247694
+ };
247695
+ return {
247696
+ changed: true,
247697
+ payload: {
247698
+ ok: true,
247699
+ payload: { id: probe.payload.id ?? null }
247700
+ }
247701
+ };
247702
+ }, {
247703
+ dryRun: options?.dryRun === true,
247704
+ expectedRevision: options?.expectedRevision
247705
+ });
247706
+ if (isWriteFailure(outcome))
247707
+ return failure(outcome.code, outcome.message);
247708
+ const result = {
247709
+ success: true,
247710
+ target: input2.target
247711
+ };
247712
+ if (outcome.payload.id)
247713
+ result.id = outcome.payload.id;
247714
+ return result;
247715
+ }
247716
+ function customXmlPartsRemoveWrapper(editor, input2, options) {
247717
+ rejectTrackedMode("customXml.parts.remove", options);
247718
+ const outcome = executeOutOfBandMutation(editor, (dryRun) => {
247719
+ if (dryRun)
247720
+ return resolveTargetPartName(getConvertedXml2(editor), input2.target) ? {
247721
+ changed: false,
247722
+ payload: {
247723
+ ok: true,
247724
+ payload: true
247725
+ }
247726
+ } : {
247727
+ changed: false,
247728
+ payload: targetNotFound()
247729
+ };
247730
+ if (!removeCustomXmlPart(getConvertedXml2(editor), input2.target, getConverter$22(editor)))
247731
+ return {
247732
+ changed: false,
247733
+ payload: targetNotFound()
247734
+ };
247735
+ return {
247736
+ changed: true,
247737
+ payload: {
247738
+ ok: true,
247739
+ payload: true
247740
+ }
247741
+ };
247742
+ }, {
247743
+ dryRun: options?.dryRun === true,
247744
+ expectedRevision: options?.expectedRevision
247745
+ });
247746
+ if (isWriteFailure(outcome))
247747
+ return failure(outcome.code, outcome.message);
247748
+ return {
247749
+ success: true,
247750
+ target: input2.target
247751
+ };
247752
+ }
247753
+ function createCustomXmlPartsAdapter(editor) {
247754
+ return {
247755
+ list: (query2) => customXmlPartsListWrapper(editor, query2),
247756
+ get: (input2) => customXmlPartsGetWrapper(editor, input2),
247757
+ create: (input2, options) => customXmlPartsCreateWrapper(editor, input2, options),
247758
+ patch: (input2, options) => customXmlPartsPatchWrapper(editor, input2, options),
247759
+ remove: (input2, options) => customXmlPartsRemoveWrapper(editor, input2, options)
247760
+ };
247761
+ }
246672
247762
  function getConverter$12(editor) {
246673
247763
  return editor.converter ?? undefined;
246674
247764
  }
@@ -249065,29 +250155,6 @@ function buildCitationAddress(doc$12, resolved) {
249065
250155
  }
249066
250156
  };
249067
250157
  }
249068
- function executeOutOfBandMutation(editor, mutateFn, options) {
249069
- if (!options.dryRun)
249070
- if (editor.options?.collaborationProvider && editor.options?.ydoc)
249071
- try {
249072
- yUndoPluginKey.getState(editor.state)?.undoManager?.stopCapturing();
249073
- } catch {}
249074
- else
249075
- try {
249076
- editor.view?.dispatch?.(closeHistory(editor.state.tr));
249077
- } catch {}
249078
- checkRevision(editor, options.expectedRevision);
249079
- const result = mutateFn(options.dryRun);
249080
- if (result.changed && !options.dryRun) {
249081
- const converter = editor.converter;
249082
- if (converter) {
249083
- converter.documentModified = true;
249084
- if (!converter.documentGuid && typeof converter.promoteToGuid === "function")
249085
- converter.promoteToGuid();
249086
- }
249087
- incrementRevision(editor);
249088
- }
249089
- return result.payload;
249090
- }
249091
250158
  function citationSuccess(address2) {
249092
250159
  return {
249093
250160
  success: true,
@@ -250305,6 +251372,7 @@ function assembleDocumentApiAdapters(editor) {
250305
251372
  rename: (input2, options) => bookmarksRenameWrapper(editor, input2, options),
250306
251373
  remove: (input2, options) => bookmarksRemoveWrapper(editor, input2, options)
250307
251374
  },
251375
+ customXml: { parts: createCustomXmlPartsAdapter(editor) },
250308
251376
  footnotes: {
250309
251377
  list: (query2) => footnotesListWrapper(editor, query2),
250310
251378
  get: (input2) => footnotesGetWrapper(editor, input2),
@@ -287133,7 +288201,7 @@ var Node$13 = class Node$14 {
287133
288201
  return () => {};
287134
288202
  const handle3 = setInterval(callback, intervalMs);
287135
288203
  return () => clearInterval(handle3);
287136
- }, HISTORY_UNSAFE_OPS, CANONICAL_COMMENT_IGNORED_KEYS, INITIAL_HASH, ROUND_CONSTANTS, V1_COVERAGE, V2_COVERAGE, SNAPSHOT_VERSION_V2 = "sd-diff-snapshot/v2", PAYLOAD_VERSION_V1 = "sd-diff-payload/v1", PAYLOAD_VERSION_V2 = "sd-diff-payload/v2", ENGINE_ID = "super-editor", STAGED_CONVERTER_KEYS, DiffServiceError, DEFAULT_LEVEL = 1, SWITCH_PATTERN, TOC_BOOKMARK_PREFIX = "_Toc", ALLOWED_SOURCE_MARK_TYPES, TEXT_STYLE_ALLOWED_ATTRS, DEFAULT_RIGHT_TAB_POS = 9350, TAB_LEADER_MAP, NO_ENTRIES_PLACEHOLDER, TOC_ENTRY_STYLE_RE, TC_LEVEL_MIN = 1, TC_LEVEL_MAX = 9, ALLOWED_WRAP_ATTRS, WRAP_TYPES_SUPPORTING_SIDE, WRAP_TYPES_SUPPORTING_DISTANCES, RELATIVE_HEIGHT_MIN = 0, RELATIVE_HEIGHT_MAX = 4294967295, FORBIDDEN_RAW_PATCH_NAMES, CONTROL_TYPE_SDT_PR_ELEMENTS, DEFAULT_CHECKBOX_SYMBOL_FONT2 = "MS Gothic", DEFAULT_CHECKBOX_CHECKED_HEX2 = "2612", DEFAULT_CHECKBOX_UNCHECKED_HEX2 = "2610", VARIANT_ORDER, KIND_ORDER, HEADER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", DOCUMENT_RELS_PATH2 = "word/_rels/document.xml.rels", HEADER_FILE_PATTERN2, FOOTER_FILE_PATTERN2, SPECIAL_NOTE_TYPES, BOOKMARK_SCAN_REVISION_PREFIX = "bookmark-scan:", SETTINGS_PART, RESTART_POLICY_TO_OOXML, VALID_DISPLAYS, REFERENCE_BLOCK_PREFIX, CAPTION_STYLE_NAMES, CAPTION_PARAGRAPH_STYLE_ID = "Caption", CAPTION_FORMAT_TO_OOXML, DOCUMENT_STAT_FIELD_TYPES, TOA_LEADER_REVERSE_MAP, EDGE_NODE_TYPES, CONTENT_TYPES_PART_ID = "[Content_Types].xml", CONTENT_TYPES_NS = "http://schemas.openxmlformats.org/package/2006/content-types", contentTypesPartDescriptor, empty_exports, init_empty, CURRENT_APP_VERSION2 = "1.32.0", PIXELS_PER_INCH2 = 96, MAX_HEIGHT_BUFFER_PX = 50, MAX_WIDTH_BUFFER_PX = 20, cloneExtensionInstance = (extension3) => {
288204
+ }, HISTORY_UNSAFE_OPS, CANONICAL_COMMENT_IGNORED_KEYS, INITIAL_HASH, ROUND_CONSTANTS, V1_COVERAGE, V2_COVERAGE, SNAPSHOT_VERSION_V2 = "sd-diff-snapshot/v2", PAYLOAD_VERSION_V1 = "sd-diff-payload/v1", PAYLOAD_VERSION_V2 = "sd-diff-payload/v2", ENGINE_ID = "super-editor", STAGED_CONVERTER_KEYS, DiffServiceError, DEFAULT_LEVEL = 1, SWITCH_PATTERN, TOC_BOOKMARK_PREFIX = "_Toc", ALLOWED_SOURCE_MARK_TYPES, TEXT_STYLE_ALLOWED_ATTRS, DEFAULT_RIGHT_TAB_POS = 9350, TAB_LEADER_MAP, NO_ENTRIES_PLACEHOLDER, TOC_ENTRY_STYLE_RE, TC_LEVEL_MIN = 1, TC_LEVEL_MAX = 9, ALLOWED_WRAP_ATTRS, WRAP_TYPES_SUPPORTING_SIDE, WRAP_TYPES_SUPPORTING_DISTANCES, RELATIVE_HEIGHT_MIN = 0, RELATIVE_HEIGHT_MAX = 4294967295, FORBIDDEN_RAW_PATCH_NAMES, CONTROL_TYPE_SDT_PR_ELEMENTS, DEFAULT_CHECKBOX_SYMBOL_FONT2 = "MS Gothic", DEFAULT_CHECKBOX_CHECKED_HEX2 = "2612", DEFAULT_CHECKBOX_UNCHECKED_HEX2 = "2610", VARIANT_ORDER, KIND_ORDER, HEADER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE3 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", DOCUMENT_RELS_PATH2 = "word/_rels/document.xml.rels", HEADER_FILE_PATTERN2, FOOTER_FILE_PATTERN2, SPECIAL_NOTE_TYPES, BOOKMARK_SCAN_REVISION_PREFIX = "bookmark-scan:", import_lib4, CUSTOM_XML_DATA_RELATIONSHIP_TYPE = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml", CUSTOM_XML_PROPS_RELATIONSHIP_TYPE2 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXmlProps", CUSTOM_XML_DATASTORE_NAMESPACE = "http://schemas.openxmlformats.org/officeDocument/2006/customXml", SETTINGS_PART, RESTART_POLICY_TO_OOXML, VALID_DISPLAYS, REFERENCE_BLOCK_PREFIX, CAPTION_STYLE_NAMES, CAPTION_PARAGRAPH_STYLE_ID = "Caption", CAPTION_FORMAT_TO_OOXML, DOCUMENT_STAT_FIELD_TYPES, TOA_LEADER_REVERSE_MAP, EDGE_NODE_TYPES, CONTENT_TYPES_PART_ID = "[Content_Types].xml", CONTENT_TYPES_NS = "http://schemas.openxmlformats.org/package/2006/content-types", contentTypesPartDescriptor, empty_exports, init_empty, CURRENT_APP_VERSION2 = "1.32.0", PIXELS_PER_INCH2 = 96, MAX_HEIGHT_BUFFER_PX = 50, MAX_WIDTH_BUFFER_PX = 20, cloneExtensionInstance = (extension3) => {
287137
288205
  const extensionLike = extension3;
287138
288206
  const config2 = extensionLike?.config;
287139
288207
  const ExtensionCtor = extensionLike?.constructor;
@@ -293708,7 +294776,7 @@ menclose::after {
293708
294776
  return true;
293709
294777
  if (!a2 || !b$1)
293710
294778
  return !a2 && !b$1;
293711
- if (a2.alignment !== b$1.alignment || a2.contextualSpacing !== b$1.contextualSpacing || a2.suppressFirstLineIndent !== b$1.suppressFirstLineIndent || a2.dropCap !== b$1.dropCap || a2.decimalSeparator !== b$1.decimalSeparator || a2.tabIntervalTwips !== b$1.tabIntervalTwips || a2.keepNext !== b$1.keepNext || a2.keepLines !== b$1.keepLines || a2.direction !== b$1.direction || a2.floatAlignment !== b$1.floatAlignment)
294779
+ if (a2.alignment !== b$1.alignment || a2.contextualSpacing !== b$1.contextualSpacing || a2.suppressFirstLineIndent !== b$1.suppressFirstLineIndent || a2.dropCap !== b$1.dropCap || a2.decimalSeparator !== b$1.decimalSeparator || a2.tabIntervalTwips !== b$1.tabIntervalTwips || a2.keepNext !== b$1.keepNext || a2.keepLines !== b$1.keepLines || getParagraphInlineDirection(a2) !== getParagraphInlineDirection(b$1) || a2.floatAlignment !== b$1.floatAlignment)
293712
294780
  return false;
293713
294781
  if (!paragraphSpacingEqual(a2.spacing, b$1.spacing))
293714
294782
  return false;
@@ -296164,7 +297232,6 @@ menclose::after {
296164
297232
  keepLines: resolvedParagraphProperties.keepLines,
296165
297233
  floatAlignment,
296166
297234
  pageBreakBefore: resolvedParagraphProperties.pageBreakBefore,
296167
- ...normalizedDirection ? { direction: normalizedDirection } : {},
296168
297235
  directionContext
296169
297236
  };
296170
297237
  if (normalizedNumberingProperties && normalizedListRendering) {
@@ -302872,18 +303939,19 @@ menclose::after {
302872
303939
  return;
302873
303940
  console.log(...args$1);
302874
303941
  }, 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;
302875
- var init_src_GAfNMk63_es = __esm(() => {
303942
+ var init_src_ChfKFC3W_es = __esm(() => {
302876
303943
  init_rolldown_runtime_Bg48TavK_es();
302877
- init_SuperConverter_1Voea3gd_es();
303944
+ init_SuperConverter_Db6xeFxo_es();
302878
303945
  init_jszip_C49i9kUs_es();
303946
+ init_xml_js_CqGKpaft_es();
302879
303947
  init_uuid_qzgm05fK_es();
302880
- init_create_headless_toolbar_cNPAdMd2_es();
303948
+ init_create_headless_toolbar_BongFwHh_es();
302881
303949
  init_constants_DrU4EASo_es();
302882
303950
  init_dist_B8HfvhaK_es();
302883
303951
  init_unified_Dsuw2be5_es();
302884
303952
  init_remark_gfm_BhnWr3yf_es();
302885
303953
  init_remark_stringify_6MMJfY0k_es();
302886
- init_DocxZipper_TPSo9G36_es();
303954
+ init_DocxZipper_Bphhij1P_es();
302887
303955
  init__plugin_vue_export_helper_HmhZBO0u_es();
302888
303956
  init_eventemitter3_UwU_CLPU_es();
302889
303957
  init_errors_C_DoKMoN_es();
@@ -326722,7 +327790,7 @@ function print() { __p += __j.call(arguments, '') }
326722
327790
  stylesPartDescriptor = {
326723
327791
  id: STYLES_PART_ID,
326724
327792
  ensurePart(editor) {
326725
- const converter = getConverter$52(editor);
327793
+ const converter = getConverter$62(editor);
326726
327794
  if (converter?.convertedXml[STYLES_PART_ID])
326727
327795
  return converter.convertedXml[STYLES_PART_ID];
326728
327796
  return {
@@ -326737,7 +327805,7 @@ function print() { __p += __j.call(arguments, '') }
326737
327805
  },
326738
327806
  afterCommit(ctx$1) {
326739
327807
  if (ctx$1.source.startsWith("collab:remote:")) {
326740
- const converter = getConverter$52(ctx$1.editor);
327808
+ const converter = getConverter$62(ctx$1.editor);
326741
327809
  if (converter)
326742
327810
  try {
326743
327811
  converter.translatedLinkedStyles = translateStyleDefinitions(converter.convertedXml);
@@ -327165,6 +328233,7 @@ function print() { __p += __j.call(arguments, '') }
327165
328233
  HEADER_FILE_PATTERN2 = /header(\d+)\.xml$/;
327166
328234
  FOOTER_FILE_PATTERN2 = /footer(\d+)\.xml$/;
327167
328235
  SPECIAL_NOTE_TYPES = new Set(["separator", "continuationSeparator"]);
328236
+ import_lib4 = /* @__PURE__ */ __toESM2(require_lib(), 1);
327168
328237
  SETTINGS_PART = SETTINGS_PART_PATH;
327169
328238
  RESTART_POLICY_TO_OOXML = {
327170
328239
  continuous: "continuous",
@@ -327415,14 +328484,14 @@ function print() { __p += __j.call(arguments, '') }
327415
328484
  if (!allowed.includes(this.#editorLifecycleState))
327416
328485
  throw new InvalidStateError(`Invalid operation: editor is in '${this.#editorLifecycleState}' state, expected one of: ${allowed.join(", ")}`);
327417
328486
  }
327418
- async#withState(during, success, failure, operation) {
328487
+ async#withState(during, success, failure$1, operation) {
327419
328488
  this.#editorLifecycleState = during;
327420
328489
  try {
327421
328490
  const result = await operation();
327422
328491
  this.#editorLifecycleState = success;
327423
328492
  return result;
327424
328493
  } catch (error3) {
327425
- this.#editorLifecycleState = failure;
328494
+ this.#editorLifecycleState = failure$1;
327426
328495
  throw error3;
327427
328496
  }
327428
328497
  }
@@ -328802,6 +329871,10 @@ function print() { __p += __j.call(arguments, '') }
328802
329871
  if (partData?.elements?.[0])
328803
329872
  updatedDocs[path2] = String(this.converter.schemaToXml(partData.elements[0]));
328804
329873
  }
329874
+ const removedCustomXmlPaths = this.converter.removedCustomXmlPaths;
329875
+ if (removedCustomXmlPaths instanceof Set)
329876
+ for (const path2 of removedCustomXmlPaths)
329877
+ updatedDocs[path2] = null;
328805
329878
  const zipper = new DocxZipper_default;
328806
329879
  if (getUpdatedDocs) {
328807
329880
  updatedDocs["[Content_Types].xml"] = await zipper.updateContentTypes({ files: this.options.content }, media2, true, updatedDocs, this.options.fonts);
@@ -336543,11 +337616,23 @@ function print() { __p += __j.call(arguments, '') }
336543
337616
  if (pageIndex != null) {
336544
337617
  const pageEl = getPageElementByIndex(this.#viewportHost, pageIndex);
336545
337618
  if (pageEl) {
336546
- (this.#findElementAtPosition(pageEl, clampedPos) ?? pageEl).scrollIntoView({
337619
+ const elToScroll = this.#findElementAtPosition(pageEl, clampedPos) ?? pageEl;
337620
+ elToScroll.scrollIntoView({
336547
337621
  block,
336548
337622
  inline: "nearest",
336549
337623
  behavior
336550
337624
  });
337625
+ this.#shouldScrollSelectionIntoView = false;
337626
+ const win = this.#visibleHost.ownerDocument?.defaultView;
337627
+ if (win)
337628
+ win.requestAnimationFrame(() => {
337629
+ elToScroll.scrollIntoView({
337630
+ block,
337631
+ inline: "nearest",
337632
+ behavior
337633
+ });
337634
+ this.#shouldScrollSelectionIntoView = false;
337635
+ });
336551
337636
  return true;
336552
337637
  }
336553
337638
  }
@@ -340927,11 +342012,11 @@ function print() { __p += __j.call(arguments, '') }
340927
342012
  ];
340928
342013
  });
340929
342014
 
340930
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-C8mCHw5x.es.js
342015
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-DWR-WlL-.es.js
340931
342016
  var 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;
340932
- var init_create_super_doc_ui_C8mCHw5x_es = __esm(() => {
340933
- init_SuperConverter_1Voea3gd_es();
340934
- init_create_headless_toolbar_cNPAdMd2_es();
342017
+ var init_create_super_doc_ui_DWR_WlL_es = __esm(() => {
342018
+ init_SuperConverter_Db6xeFxo_es();
342019
+ init_create_headless_toolbar_BongFwHh_es();
340935
342020
  MOD_ALIASES = new Set([
340936
342021
  "Mod",
340937
342022
  "Meta",
@@ -340973,16 +342058,16 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
340973
342058
 
340974
342059
  // ../../packages/superdoc/dist/super-editor.es.js
340975
342060
  var init_super_editor_es = __esm(() => {
340976
- init_src_GAfNMk63_es();
340977
- init_SuperConverter_1Voea3gd_es();
342061
+ init_src_ChfKFC3W_es();
342062
+ init_SuperConverter_Db6xeFxo_es();
340978
342063
  init_jszip_C49i9kUs_es();
340979
342064
  init_xml_js_CqGKpaft_es();
340980
- init_create_headless_toolbar_cNPAdMd2_es();
342065
+ init_create_headless_toolbar_BongFwHh_es();
340981
342066
  init_constants_DrU4EASo_es();
340982
342067
  init_dist_B8HfvhaK_es();
340983
342068
  init_unified_Dsuw2be5_es();
340984
- init_DocxZipper_TPSo9G36_es();
340985
- init_create_super_doc_ui_C8mCHw5x_es();
342069
+ init_DocxZipper_Bphhij1P_es();
342070
+ init_create_super_doc_ui_DWR_WlL_es();
340986
342071
  init_ui_CGB3qmy3_es();
340987
342072
  init_eventemitter3_UwU_CLPU_es();
340988
342073
  init_errors_C_DoKMoN_es();
@@ -389713,104 +390798,104 @@ function mapFailedReceipt(operationId, result2) {
389713
390798
  return null;
389714
390799
  if (result2.success)
389715
390800
  return null;
389716
- const failure = result2.failure;
390801
+ const failure2 = result2.failure;
389717
390802
  const family = resolveOperationFamily(operationId);
389718
- if (!failure) {
390803
+ if (!failure2) {
389719
390804
  return new CliError("COMMAND_FAILED", `${operationId}: operation failed.`, { operationId });
389720
390805
  }
389721
- const failureCode = failure.code;
389722
- const failureMessage = failure.message ?? `${operationId}: operation failed.`;
390806
+ const failureCode = failure2.code;
390807
+ const failureMessage = failure2.message ?? `${operationId}: operation failed.`;
389723
390808
  if (failureCode && PLAN_ENGINE_PASSTHROUGH_CODES.has(failureCode)) {
389724
- return new CliError(failureCode, failureMessage, { operationId, failure });
390809
+ return new CliError(failureCode, failureMessage, { operationId, failure: failure2 });
389725
390810
  }
389726
390811
  if (family === "trackChanges") {
389727
390812
  if (failureCode === "TRACK_CHANGE_COMMAND_UNAVAILABLE") {
389728
- return new CliError("TRACK_CHANGE_COMMAND_UNAVAILABLE", failureMessage, { operationId, failure });
390813
+ return new CliError("TRACK_CHANGE_COMMAND_UNAVAILABLE", failureMessage, { operationId, failure: failure2 });
389729
390814
  }
389730
390815
  if (failureCode === "INVALID_TARGET") {
389731
- return new CliError("TRACK_CHANGE_NOT_FOUND", failureMessage, { operationId, failure });
390816
+ return new CliError("TRACK_CHANGE_NOT_FOUND", failureMessage, { operationId, failure: failure2 });
389732
390817
  }
389733
- return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure });
390818
+ return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure: failure2 });
389734
390819
  }
389735
390820
  if (family === "comments") {
389736
390821
  if (failureCode === "TARGET_NOT_FOUND") {
389737
- return new CliError("TARGET_NOT_FOUND", failureMessage, { operationId, failure });
390822
+ return new CliError("TARGET_NOT_FOUND", failureMessage, { operationId, failure: failure2 });
389738
390823
  }
389739
390824
  if (failureCode === "INVALID_TARGET") {
389740
- return new CliError("INVALID_ARGUMENT", failureMessage, { operationId, failure });
390825
+ return new CliError("INVALID_ARGUMENT", failureMessage, { operationId, failure: failure2 });
389741
390826
  }
389742
- return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure });
390827
+ return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure: failure2 });
389743
390828
  }
389744
390829
  if (family === "lists") {
389745
390830
  if (failureCode === "INVALID_TARGET") {
389746
- return new CliError("INVALID_TARGET", failureMessage, { operationId, failure });
390831
+ return new CliError("INVALID_TARGET", failureMessage, { operationId, failure: failure2 });
389747
390832
  }
389748
390833
  if (failureCode === "CAPABILITY_UNAVAILABLE") {
389749
- return new CliError("TRACK_CHANGE_COMMAND_UNAVAILABLE", failureMessage, { operationId, failure });
390834
+ return new CliError("TRACK_CHANGE_COMMAND_UNAVAILABLE", failureMessage, { operationId, failure: failure2 });
389750
390835
  }
389751
- return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure });
390836
+ return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure: failure2 });
389752
390837
  }
389753
390838
  if (family === "textMutation") {
389754
390839
  if (failureCode === "TRACK_CHANGE_COMMAND_UNAVAILABLE" || failureCode === "CAPABILITY_UNAVAILABLE") {
389755
- return new CliError("TRACK_CHANGE_COMMAND_UNAVAILABLE", failureMessage, { operationId, failure });
390840
+ return new CliError("TRACK_CHANGE_COMMAND_UNAVAILABLE", failureMessage, { operationId, failure: failure2 });
389756
390841
  }
389757
390842
  if (failureCode === "INVALID_TARGET") {
389758
- return new CliError("INVALID_ARGUMENT", failureMessage, { operationId, failure });
390843
+ return new CliError("INVALID_ARGUMENT", failureMessage, { operationId, failure: failure2 });
389759
390844
  }
389760
- return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure });
390845
+ return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure: failure2 });
389761
390846
  }
389762
390847
  if (family === "blocks") {
389763
390848
  if (failureCode === "INVALID_TARGET") {
389764
- return new CliError("INVALID_ARGUMENT", failureMessage, { operationId, failure });
390849
+ return new CliError("INVALID_ARGUMENT", failureMessage, { operationId, failure: failure2 });
389765
390850
  }
389766
- return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure });
390851
+ return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure: failure2 });
389767
390852
  }
389768
390853
  if (family === "create") {
389769
390854
  if (failureCode === "TRACK_CHANGE_COMMAND_UNAVAILABLE") {
389770
- return new CliError("TRACK_CHANGE_COMMAND_UNAVAILABLE", failureMessage, { operationId, failure });
390855
+ return new CliError("TRACK_CHANGE_COMMAND_UNAVAILABLE", failureMessage, { operationId, failure: failure2 });
389771
390856
  }
389772
390857
  if (failureCode === "INVALID_TARGET") {
389773
- return new CliError("INVALID_TARGET", failureMessage, { operationId, failure });
390858
+ return new CliError("INVALID_TARGET", failureMessage, { operationId, failure: failure2 });
389774
390859
  }
389775
- return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure });
390860
+ return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure: failure2 });
389776
390861
  }
389777
390862
  if (family === "toc") {
389778
390863
  if (failureCode === "TARGET_NOT_FOUND") {
389779
- return new CliError("TARGET_NOT_FOUND", failureMessage, { operationId, failure });
390864
+ return new CliError("TARGET_NOT_FOUND", failureMessage, { operationId, failure: failure2 });
389780
390865
  }
389781
390866
  if (failureCode === "INVALID_TARGET") {
389782
- return new CliError("INVALID_ARGUMENT", failureMessage, { operationId, failure });
390867
+ return new CliError("INVALID_ARGUMENT", failureMessage, { operationId, failure: failure2 });
389783
390868
  }
389784
390869
  if (failureCode === "PAGE_NUMBERS_NOT_MATERIALIZED") {
389785
- return new CliError("PAGE_NUMBERS_NOT_MATERIALIZED", failureMessage, { operationId, failure });
390870
+ return new CliError("PAGE_NUMBERS_NOT_MATERIALIZED", failureMessage, { operationId, failure: failure2 });
389786
390871
  }
389787
390872
  if (failureCode === "CAPABILITY_UNAVAILABLE") {
389788
- return new CliError("CAPABILITY_UNAVAILABLE", failureMessage, { operationId, failure });
390873
+ return new CliError("CAPABILITY_UNAVAILABLE", failureMessage, { operationId, failure: failure2 });
389789
390874
  }
389790
- return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure });
390875
+ return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure: failure2 });
389791
390876
  }
389792
390877
  if (family === "images") {
389793
390878
  if (failureCode === "TARGET_NOT_FOUND") {
389794
- return new CliError("TARGET_NOT_FOUND", failureMessage, { operationId, failure });
390879
+ return new CliError("TARGET_NOT_FOUND", failureMessage, { operationId, failure: failure2 });
389795
390880
  }
389796
390881
  if (failureCode === "INVALID_TARGET") {
389797
- return new CliError("INVALID_ARGUMENT", failureMessage, { operationId, failure });
390882
+ return new CliError("INVALID_ARGUMENT", failureMessage, { operationId, failure: failure2 });
389798
390883
  }
389799
- return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure });
390884
+ return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure: failure2 });
389800
390885
  }
389801
390886
  if (family === "tables") {
389802
390887
  if (failureCode === "TARGET_NOT_FOUND") {
389803
- return new CliError("TARGET_NOT_FOUND", failureMessage, { operationId, failure });
390888
+ return new CliError("TARGET_NOT_FOUND", failureMessage, { operationId, failure: failure2 });
389804
390889
  }
389805
390890
  if (failureCode === "INVALID_TARGET") {
389806
- return new CliError("INVALID_ARGUMENT", failureMessage, { operationId, failure });
390891
+ return new CliError("INVALID_ARGUMENT", failureMessage, { operationId, failure: failure2 });
389807
390892
  }
389808
390893
  if (failureCode === "CAPABILITY_UNAVAILABLE") {
389809
- return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure });
390894
+ return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure: failure2 });
389810
390895
  }
389811
- return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure });
390896
+ return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure: failure2 });
389812
390897
  }
389813
- return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure });
390898
+ return new CliError("COMMAND_FAILED", failureMessage, { operationId, failure: failure2 });
389814
390899
  }
389815
390900
  var PLAN_ENGINE_PASSTHROUGH_CODES, FAMILY_MAPPERS;
389816
390901
  var init_error_mapping = __esm(() => {