@office-open/core 0.10.12 → 0.10.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -9
- package/dist/chart/index.d.mts +1 -1
- package/dist/chart/index.mjs +1 -1
- package/dist/{chart-DwE8FCFk.mjs → chart-DOO1st0K.mjs} +3 -1
- package/dist/chart-DOO1st0K.mjs.map +1 -0
- package/dist/converters-C_Y2QX1w.mjs +1789 -0
- package/dist/converters-C_Y2QX1w.mjs.map +1 -0
- package/dist/data-type-CZMKVaaT.d.mts +10 -0
- package/dist/data-type-CZMKVaaT.d.mts.map +1 -0
- package/dist/descriptor/index.d.mts +2 -2
- package/dist/descriptor/index.mjs +2 -2
- package/dist/{descriptor-DAER86Rt.mjs → descriptor-BjNkn5jo.mjs} +3 -33
- package/dist/descriptor-BjNkn5jo.mjs.map +1 -0
- package/dist/drawingml/index.d.mts +2 -2
- package/dist/drawingml/index.mjs +2 -2
- package/dist/{src-bVqU5Bh3.mjs → drawingml-sj1J3lb0.mjs} +22 -3728
- package/dist/drawingml-sj1J3lb0.mjs.map +1 -0
- package/dist/index-BVK2dv6C.d.mts +63 -0
- package/dist/index-BVK2dv6C.d.mts.map +1 -0
- package/dist/index-BfHfKuKy.d.mts +275 -0
- package/dist/index-BfHfKuKy.d.mts.map +1 -0
- package/dist/index-CE53SwpZ.d.mts +1463 -0
- package/dist/index-CE53SwpZ.d.mts.map +1 -0
- package/dist/{index-3STznXzZ.d.mts → index-D6VE-MnJ.d.mts} +3 -15
- package/dist/index-D6VE-MnJ.d.mts.map +1 -0
- package/dist/{index-CN0YjNSx.d.mts → index-DDyd2ErZ.d.mts} +3 -15
- package/dist/index-DDyd2ErZ.d.mts.map +1 -0
- package/dist/{index-CsQP7Cl4.d.mts → index-DlPA26cw.d.mts} +2 -47
- package/dist/index-DlPA26cw.d.mts.map +1 -0
- package/dist/index-k8WKLXnA.d.mts +150 -0
- package/dist/index-k8WKLXnA.d.mts.map +1 -0
- package/dist/index.d.mts +650 -8
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +1271 -7
- package/dist/index.mjs.map +1 -0
- package/dist/output-D_G_JR_8.d.mts +24 -0
- package/dist/output-D_G_JR_8.d.mts.map +1 -0
- package/dist/patch/index.d.mts +2 -2
- package/dist/patch/index.mjs +1 -1
- package/dist/{patch-OSbQIQAi.mjs → patch-BmRfghOo.mjs} +65 -84
- package/dist/patch-BmRfghOo.mjs.map +1 -0
- package/dist/smartart/index.d.mts +1 -1
- package/dist/smartart/index.mjs +1 -1
- package/dist/{smartart-DCY-Vdv7.mjs → smartart-B7ukZ-Tw.mjs} +5 -3
- package/dist/smartart-B7ukZ-Tw.mjs.map +1 -0
- package/dist/theme/index.d.mts +1 -1
- package/dist/theme-CiNzdl-9.mjs +2 -0
- package/dist/theme-CiNzdl-9.mjs.map +1 -0
- package/dist/util/index.d.mts +4 -0
- package/dist/util/index.mjs +3 -0
- package/dist/util-Tq9PSjK0.mjs +1113 -0
- package/dist/util-Tq9PSjK0.mjs.map +1 -0
- package/dist/values-8di32lIe.d.mts +56 -0
- package/dist/values-8di32lIe.d.mts.map +1 -0
- package/package.json +7 -6
- package/dist/index-CHGFwCCQ.d.mts +0 -266
- package/dist/index-CpNwAcem.d.mts +0 -169
- package/dist/index-DdXU1_sq.d.mts +0 -5029
- package/dist/util/values.d.mts +0 -2
- package/dist/util/values.mjs +0 -2
- package/dist/values-CVIZcTRw.mjs +0 -371
- package/dist/values-DQfI1FSg.d.mts +0 -426
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drawingml-sj1J3lb0.mjs","names":["SYSTEM_COLOR_VALUES","PRESET_COLOR_VALUES","SCHEME_COLOR_VALUES","createBlurEffect","stringify","stringify","parse","stringify","parse","stringify","parse","stringify","parse","stringify","parse"],"sources":["../src/drawingml/color/color-transform.ts","../src/drawingml/color/hsl-color.ts","../src/drawingml/color/preset-color.ts","../src/drawingml/color/rgb-color.ts","../src/drawingml/color/sc-rgb-color.ts","../src/drawingml/color/scheme-color.ts","../src/drawingml/color/system-color.ts","../src/drawingml/color/solid-fill.ts","../src/drawingml/blip/blip-effects.ts","../src/drawingml/blip/source-rectangle.ts","../src/drawingml/blip/tile.ts","../src/drawingml/fill/gradient-fill.ts","../src/drawingml/fill/pattern-fill.ts","../src/drawingml/fill/fill-options.ts","../src/drawingml/fill/no-fill.ts","../src/drawingml/fill/group-fill.ts","../src/drawingml/outline/custom-dash.ts","../src/drawingml/outline/line-end.ts","../src/drawingml/outline/outline.ts","../src/drawingml/effects/fill-overlay.ts","../src/drawingml/effects/glow.ts","../src/drawingml/effects/inner-shadow.ts","../src/drawingml/effects/outer-shadow.ts","../src/drawingml/effects/preset-shadow.ts","../src/drawingml/effects/reflection.ts","../src/drawingml/effects/soft-edge.ts","../src/drawingml/effects/effect-list.ts","../src/drawingml/effects/effect-dag.ts","../src/drawingml/three-d/scene-3d.ts","../src/drawingml/three-d/bevel.ts","../src/drawingml/three-d/shape-3d.ts","../src/drawingml/geometry/adjustment-values.ts","../src/drawingml/geometry/preset-geometry.ts","../src/drawingml/geometry/custom-geometry.ts","../src/drawingml/blip/blip-extensions.ts","../src/drawingml/blip/blip.ts","../src/drawingml/blip/blip-fill.ts","../src/drawingml/blip/stretch.ts","../src/drawingml/transform.ts","../src/drawingml/table-style.ts","../src/drawingml/locking/locking.ts","../src/drawingml/diagram/layout-vars.ts","../src/drawingml/diagram/headers.ts","../src/drawingml/diagram/diagram-style.ts","../src/drawingml/diagram/diagram-rel.ts","../src/drawingml/diagram/diagram-props.ts","../src/drawingml/color/color-descriptors.ts","../src/drawingml/blip/blip-descriptors.ts","../src/drawingml/fill/fill-descriptors.ts","../src/drawingml/outline/outline-descriptors.ts","../src/drawingml/effects/effect-descriptors.ts","../src/drawingml/locking/locking-descriptors.ts","../src/drawingml/geometry/geometry-descriptors.ts","../src/drawingml/transform-descriptors.ts","../src/drawingml/three-d/three-d-descriptors.ts","../src/drawingml/diagram/diagram-descriptors.ts"],"sourcesContent":["/**\n * Color transform elements for DrawingML colors.\n *\n * This module provides color transformation elements defined in EG_ColorTransform,\n * which can be applied as child elements to any color type (srgbClr, schemeClr, etc.).\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, EG_ColorTransform\n *\n * @module\n */\n\n/**\n * Options for color transforms.\n *\n * All percentage values are in 1/1000th of a percent (e.g., 50000 = 50%).\n * Angle values are in 60,000ths of a degree.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, EG_ColorTransform\n */\nexport interface ColorTransformOptions {\n /** Tint: moves color toward white (0-100000) */\n tint?: number;\n /** Shade: moves color toward black (0-100000) */\n shade?: number;\n /** Complement: inverts the color (no value) */\n comp?: boolean;\n /** Inverse: inverts the color (no value) */\n inv?: boolean;\n /** Grayscale: converts to grayscale (no value) */\n gray?: boolean;\n /** Alpha: sets transparency (0-100000) */\n alpha?: number;\n /** Alpha offset: adjusts alpha by fixed amount (-100000 to 100000) */\n alphaOff?: number;\n /** Alpha modulation: scales alpha by percentage (0-100000) */\n alphaMod?: number;\n /** Hue: sets hue angle (0-21600000) */\n hue?: number;\n /** Hue offset: adjusts hue by angle (-5400000 to 5400000) */\n hueOff?: number;\n /** Hue modulation: scales hue by percentage (0-100000) */\n hueMod?: number;\n /** Saturation: sets saturation (-100000 to 100000) */\n sat?: number;\n /** Saturation offset: adjusts saturation (-100000 to 100000) */\n satOff?: number;\n /** Saturation modulation: scales saturation (0-100000) */\n satMod?: number;\n /** Luminance: sets luminance (-100000 to 100000) */\n lum?: number;\n /** Luminance offset: adjusts luminance (-100000 to 100000) */\n lumOff?: number;\n /** Luminance modulation: scales luminance (0-100000) */\n lumMod?: number;\n /** Red: sets red channel (-100000 to 100000) */\n red?: number;\n /** Red offset: adjusts red channel (-100000 to 100000) */\n redOff?: number;\n /** Red modulation: scales red channel (0-100000) */\n redMod?: number;\n /** Green: sets green channel (-100000 to 100000) */\n green?: number;\n /** Green offset: adjusts green channel (-100000 to 100000) */\n greenOff?: number;\n /** Green modulation: scales green channel (0-100000) */\n greenMod?: number;\n /** Blue: sets blue channel (-100000 to 100000) */\n blue?: number;\n /** Blue offset: adjusts blue channel (-100000 to 100000) */\n blueOff?: number;\n /** Blue modulation: scales blue channel (0-100000) */\n blueMod?: number;\n /** Gamma correction (no value) */\n gamma?: boolean;\n /** Inverse gamma correction (no value) */\n invGamma?: boolean;\n}\n\n/**\n * Creates color transform child elements as XML strings.\n *\n * These elements modify the parent color according to OOXML color transform rules.\n * Multiple transforms can be applied in sequence.\n *\n * @example\n * ```typescript\n * // Lighten accent1 by 40%\n * createColorTransforms({ tint: 40000 });\n * // Semi-transparent red with 50% alpha\n * createColorTransforms({ alpha: 50000 });\n * ```\n */\nexport const createColorTransforms = (options: ColorTransformOptions): readonly string[] => {\n const t: string[] = [];\n\n if (options.tint !== undefined) t.push(`<a:tint val=\"${options.tint}\"/>`);\n if (options.shade !== undefined) t.push(`<a:shade val=\"${options.shade}\"/>`);\n if (options.comp) t.push(`<a:comp/>`);\n if (options.inv) t.push(`<a:inv/>`);\n if (options.gray) t.push(`<a:gray/>`);\n if (options.alpha !== undefined) t.push(`<a:alpha val=\"${options.alpha}\"/>`);\n if (options.alphaOff !== undefined) t.push(`<a:alphaOff val=\"${options.alphaOff}\"/>`);\n if (options.alphaMod !== undefined) t.push(`<a:alphaMod val=\"${options.alphaMod}\"/>`);\n if (options.hue !== undefined) t.push(`<a:hue val=\"${options.hue}\"/>`);\n if (options.hueOff !== undefined) t.push(`<a:hueOff val=\"${options.hueOff}\"/>`);\n if (options.hueMod !== undefined) t.push(`<a:hueMod val=\"${options.hueMod}\"/>`);\n if (options.sat !== undefined) t.push(`<a:sat val=\"${options.sat}\"/>`);\n if (options.satOff !== undefined) t.push(`<a:satOff val=\"${options.satOff}\"/>`);\n if (options.satMod !== undefined) t.push(`<a:satMod val=\"${options.satMod}\"/>`);\n if (options.lum !== undefined) t.push(`<a:lum val=\"${options.lum}\"/>`);\n if (options.lumOff !== undefined) t.push(`<a:lumOff val=\"${options.lumOff}\"/>`);\n if (options.lumMod !== undefined) t.push(`<a:lumMod val=\"${options.lumMod}\"/>`);\n if (options.red !== undefined) t.push(`<a:red val=\"${options.red}\"/>`);\n if (options.redOff !== undefined) t.push(`<a:redOff val=\"${options.redOff}\"/>`);\n if (options.redMod !== undefined) t.push(`<a:redMod val=\"${options.redMod}\"/>`);\n if (options.green !== undefined) t.push(`<a:green val=\"${options.green}\"/>`);\n if (options.greenOff !== undefined) t.push(`<a:greenOff val=\"${options.greenOff}\"/>`);\n if (options.greenMod !== undefined) t.push(`<a:greenMod val=\"${options.greenMod}\"/>`);\n if (options.blue !== undefined) t.push(`<a:blue val=\"${options.blue}\"/>`);\n if (options.blueOff !== undefined) t.push(`<a:blueOff val=\"${options.blueOff}\"/>`);\n if (options.blueMod !== undefined) t.push(`<a:blueMod val=\"${options.blueMod}\"/>`);\n if (options.gamma) t.push(`<a:gamma/>`);\n if (options.invGamma) t.push(`<a:invGamma/>`);\n\n return t;\n};\n","/**\n * HSL color element for DrawingML.\n *\n * This module provides HSL (Hue, Saturation, Luminance) color support.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_HslColor\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport type { ColorTransformOptions } from \"./color-transform\";\nimport { createColorTransforms } from \"./color-transform\";\n\n/**\n * Options for HSL color.\n */\nexport interface HslColorOptions {\n /** Hue angle in 60,000ths of a degree (0-21600000) */\n hue: number;\n /** Saturation in 1/1000th of a percent (0-100000) */\n saturation: number;\n /** Luminance in 1/1000th of a percent (0-100000) */\n luminance: number;\n /** Optional color transforms */\n transforms?: ColorTransformOptions;\n}\n\n/**\n * Creates an HSL color element as an XML string.\n *\n * Specifies a color using Hue, Saturation, and Luminance values.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_HslColor\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_ColorTransform\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"hue\" type=\"ST_PositiveFixedAngle\" use=\"required\"/>\n * <xsd:attribute name=\"sat\" type=\"ST_Percentage\" use=\"required\"/>\n * <xsd:attribute name=\"lum\" type=\"ST_Percentage\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createHslColor = (options: HslColorOptions): string => {\n const transforms = options.transforms ? createColorTransforms(options.transforms) : [];\n return element(\n \"a:hslClr\",\n { hue: options.hue, sat: options.saturation, lum: options.luminance },\n transforms,\n );\n};\n","/**\n * Preset color element for DrawingML.\n *\n * This module provides named preset colors (CSS named colors).\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_PresetColor / ST_PresetColorVal\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport type { ColorTransformOptions } from \"./color-transform\";\nimport { createColorTransforms } from \"./color-transform\";\n\n/**\n * Preset color values (CSS named colors).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_PresetColorVal\">\n * <xsd:restriction base=\"xsd:token\">\n * <xsd:enumeration value=\"aliceBlue\"/>\n * ...\n * <xsd:enumeration value=\"yellowGreen\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n */\nexport const PresetColor = {\n ALICE_BLUE: \"aliceBlue\",\n ANTIQUE_WHITE: \"antiqueWhite\",\n AQUA: \"aqua\",\n AQUAMARINE: \"aquamarine\",\n AZURE: \"azure\",\n BEIGE: \"beige\",\n BISQUE: \"bisque\",\n BLACK: \"black\",\n BLANCHED_ALMOND: \"blanchedAlmond\",\n BLUE: \"blue\",\n BLUE_VIOLET: \"blueViolet\",\n BROWN: \"brown\",\n BURLY_WOOD: \"burlyWood\",\n CADET_BLUE: \"cadetBlue\",\n CHARTREUSE: \"chartreuse\",\n CHOCOLATE: \"chocolate\",\n CORAL: \"coral\",\n CORNFLOWER_BLUE: \"cornflowerBlue\",\n CORNSILK: \"cornsilk\",\n CRIMSON: \"crimson\",\n CYAN: \"cyan\",\n DARK_BLUE: \"darkBlue\",\n DARK_CYAN: \"darkCyan\",\n DARK_GOLDENROD: \"darkGoldenrod\",\n DARK_GRAY: \"darkGray\",\n DARK_GREY: \"darkGrey\",\n DARK_GREEN: \"darkGreen\",\n DARK_KHAKI: \"darkKhaki\",\n DARK_MAGENTA: \"darkMagenta\",\n DARK_OLIVE_GREEN: \"darkOliveGreen\",\n DARK_ORANGE: \"darkOrange\",\n DARK_ORCHID: \"darkOrchid\",\n DARK_RED: \"darkRed\",\n DARK_SALMON: \"darkSalmon\",\n DARK_SEA_GREEN: \"darkSeaGreen\",\n DARK_SLATE_BLUE: \"darkSlateBlue\",\n DARK_SLATE_GRAY: \"darkSlateGray\",\n DARK_SLATE_GREY: \"darkSlateGrey\",\n DARK_TURQUOISE: \"darkTurquoise\",\n DARK_VIOLET: \"darkViolet\",\n DEEP_PINK: \"deepPink\",\n DEEP_SKY_BLUE: \"deepSkyBlue\",\n DIM_GRAY: \"dimGray\",\n DIM_GREY: \"dimGrey\",\n DODGER_BLUE: \"dodgerBlue\",\n FIREBRICK: \"firebrick\",\n FLORAL_WHITE: \"floralWhite\",\n FOREST_GREEN: \"forestGreen\",\n FUCHSIA: \"fuchsia\",\n GAINSBORO: \"gainsboro\",\n GHOST_WHITE: \"ghostWhite\",\n GOLD: \"gold\",\n GOLDENROD: \"goldenrod\",\n GRAY: \"gray\",\n GREY: \"grey\",\n GREEN: \"green\",\n GREEN_YELLOW: \"greenYellow\",\n HONEYDEW: \"honeydew\",\n HOT_PINK: \"hotPink\",\n INDIAN_RED: \"indianRed\",\n INDIGO: \"indigo\",\n IVORY: \"ivory\",\n KHAKI: \"khaki\",\n LAVENDER: \"lavender\",\n LAVENDER_BLUSH: \"lavenderBlush\",\n LAWN_GREEN: \"lawnGreen\",\n LEMON_CHIFFON: \"lemonChiffon\",\n LIGHT_BLUE: \"lightBlue\",\n LIGHT_CORAL: \"lightCoral\",\n LIGHT_CYAN: \"lightCyan\",\n LIGHT_GOLDENROD_YELLOW: \"lightGoldenrodYellow\",\n LIGHT_GRAY: \"lightGray\",\n LIGHT_GREY: \"lightGrey\",\n LIGHT_GREEN: \"lightGreen\",\n LIGHT_PINK: \"lightPink\",\n LIGHT_SALMON: \"lightSalmon\",\n LIGHT_SEA_GREEN: \"lightSeaGreen\",\n LIGHT_SKY_BLUE: \"lightSkyBlue\",\n LIGHT_SLATE_GRAY: \"lightSlateGray\",\n LIGHT_SLATE_GREY: \"lightSlateGrey\",\n LIGHT_STEEL_BLUE: \"lightSteelBlue\",\n LIGHT_YELLOW: \"lightYellow\",\n LIME: \"lime\",\n LIME_GREEN: \"limeGreen\",\n LINEN: \"linen\",\n MAGENTA: \"magenta\",\n MAROON: \"maroon\",\n MEDIUM_AQUAMARINE: \"mediumAquamarine\",\n MEDIUM_BLUE: \"mediumBlue\",\n MEDIUM_ORCHID: \"mediumOrchid\",\n MEDIUM_PURPLE: \"mediumPurple\",\n MEDIUM_SEA_GREEN: \"mediumSeaGreen\",\n MEDIUM_SLATE_BLUE: \"mediumSlateBlue\",\n MEDIUM_SPRING_GREEN: \"mediumSpringGreen\",\n MEDIUM_TURQUOISE: \"mediumTurquoise\",\n MEDIUM_VIOLET_RED: \"mediumVioletRed\",\n MIDNIGHT_BLUE: \"midnightBlue\",\n MINT_CREAM: \"mintCream\",\n MISTY_ROSE: \"mistyRose\",\n MOCCASIN: \"moccasin\",\n NAVAJO_WHITE: \"navajoWhite\",\n NAVY: \"navy\",\n OLD_LACE: \"oldLace\",\n OLIVE: \"olive\",\n OLIVE_DRAB: \"oliveDrab\",\n ORANGE: \"orange\",\n ORANGE_RED: \"orangeRed\",\n ORCHID: \"orchid\",\n PALE_GOLDENROD: \"paleGoldenrod\",\n PALE_GREEN: \"paleGreen\",\n PALE_TURQUOISE: \"paleTurquoise\",\n PALE_VIOLET_RED: \"paleVioletRed\",\n PAPAYA_WHIP: \"papayaWhip\",\n PEACH_PUFF: \"peachPuff\",\n PERU: \"peru\",\n PINK: \"pink\",\n PLUM: \"plum\",\n POWDER_BLUE: \"powderBlue\",\n PURPLE: \"purple\",\n RED: \"red\",\n ROSY_BROWN: \"rosyBrown\",\n ROYAL_BLUE: \"royalBlue\",\n SADDLE_BROWN: \"saddleBrown\",\n SALMON: \"salmon\",\n SANDY_BROWN: \"sandyBrown\",\n SEA_GREEN: \"seaGreen\",\n SEA_SHELL: \"seaShell\",\n SIENNA: \"sienna\",\n SILVER: \"silver\",\n SKY_BLUE: \"skyBlue\",\n SLATE_BLUE: \"slateBlue\",\n SLATE_GRAY: \"slateGray\",\n SLATE_GREY: \"slateGrey\",\n SNOW: \"snow\",\n SPRING_GREEN: \"springGreen\",\n STEEL_BLUE: \"steelBlue\",\n TAN: \"tan\",\n TEAL: \"teal\",\n THISTLE: \"thistle\",\n TOMATO: \"tomato\",\n TURQUOISE: \"turquoise\",\n VIOLET: \"violet\",\n WHEAT: \"wheat\",\n WHITE: \"white\",\n WHITE_SMOKE: \"whiteSmoke\",\n YELLOW: \"yellow\",\n YELLOW_GREEN: \"yellowGreen\",\n} as const;\n\n/**\n * Options for preset color.\n */\nexport interface PresetColorOptions {\n /** Preset color value */\n value: (typeof PresetColor)[keyof typeof PresetColor];\n /** Optional color transforms */\n transforms?: ColorTransformOptions;\n}\n\n/**\n * Creates a preset color element as an XML string.\n *\n * Specifies a color using a named preset (CSS named color).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_PresetColor\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_ColorTransform\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"val\" type=\"ST_PresetColorVal\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createPresetColor = (options: PresetColorOptions): string => {\n const transforms = options.transforms ? createColorTransforms(options.transforms) : [];\n return element(\"a:prstClr\", { val: options.value }, transforms);\n};\n","/**\n * RGB color element for DrawingML shapes.\n *\n * This module provides RGB color support for solid fills.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_SRgbColor\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport type { ColorTransformOptions } from \"./color-transform\";\nimport { createColorTransforms } from \"./color-transform\";\n\n/**\n * Options for RGB color.\n */\nexport interface RgbColorOptions {\n /** Hex color value (e.g., \"FF0000\" for red) */\n value: string;\n /** Optional color transforms */\n transforms?: ColorTransformOptions;\n}\n\n/**\n * Creates an sRGB color element as an XML string.\n *\n * Specifies a color using RGB hex values.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SRgbColor\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_ColorTransform\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"val\" type=\"s:ST_HexColorRGB\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * const redColor = createRgbColor({ value: \"FF0000\" });\n * // With alpha transform\n * const semiRed = createRgbColor({ value: \"FF0000\", transforms: { alpha: 50000 } });\n * ```\n */\nexport const createRgbColor = (options: RgbColorOptions): string => {\n const transforms = options.transforms ? createColorTransforms(options.transforms) : [];\n return element(\"a:srgbClr\", { val: options.value }, transforms);\n};\n","/**\n * ScRGB color element for DrawingML shapes.\n *\n * This module provides scRGB color support using percentage-based RGB values.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_ScRgbColor\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport type { ColorTransformOptions } from \"./color-transform\";\nimport { createColorTransforms } from \"./color-transform\";\n\n/**\n * Options for scRGB color.\n */\nexport interface ScRgbColorOptions {\n /** Red percentage (e.g., \"50%\" or \"100%\") */\n r: string;\n /** Green percentage (e.g., \"50%\" or \"100%\") */\n g: string;\n /** Blue percentage (e.g., \"50%\" or \"100%\") */\n b: string;\n /** Optional color transforms */\n transforms?: ColorTransformOptions;\n}\n\n/**\n * Creates an scRGB color element as an XML string.\n *\n * Specifies a color using percentage-based RGB values.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_ScRgbColor\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_ColorTransform\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"r\" type=\"ST_Percentage\" use=\"required\"/>\n * <xsd:attribute name=\"g\" type=\"ST_Percentage\" use=\"required\"/>\n * <xsd:attribute name=\"b\" type=\"ST_Percentage\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * const redColor = createScRgbColor({ r: \"100%\", g: \"0%\", b: \"0%\" });\n * // With alpha transform\n * const semiRed = createScRgbColor({ r: \"100%\", g: \"0%\", b: \"0%\", transforms: { alpha: 50000 } });\n * ```\n */\nexport const createScRgbColor = (options: ScRgbColorOptions): string => {\n const transforms = options.transforms ? createColorTransforms(options.transforms) : [];\n return element(\"a:scrgbClr\", { r: options.r, g: options.g, b: options.b }, transforms);\n};\n","/**\n * Scheme color element for DrawingML shapes.\n *\n * This module provides scheme-based color support for solid fills,\n * allowing colors to be defined using theme color schemes.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_SchemeColor / ST_SchemeColorVal\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport type { ColorTransformOptions } from \"./color-transform\";\nimport { createColorTransforms } from \"./color-transform\";\n\n/**\n * Options for scheme color.\n */\nexport interface SchemeColorOptions {\n /** Scheme color value */\n value: (typeof SchemeColor)[keyof typeof SchemeColor];\n /** Optional color transforms */\n transforms?: ColorTransformOptions;\n}\n\n// <xsd:simpleType name=\"ST_SchemeColorVal\">\n// <xsd:restriction base=\"xsd:string\">\n// <xsd:enumeration value=\"bg1\"/>\n// <xsd:enumeration value=\"tx1\"/>\n// <xsd:enumeration value=\"bg2\"/>\n// <xsd:enumeration value=\"tx2\"/>\n// <xsd:enumeration value=\"accent1\"/>\n// <xsd:enumeration value=\"accent2\"/>\n// <xsd:enumeration value=\"accent3\"/>\n// <xsd:enumeration value=\"accent4\"/>\n// <xsd:enumeration value=\"accent5\"/>\n// <xsd:enumeration value=\"accent6\"/>\n// <xsd:enumeration value=\"hlink\"/>\n// <xsd:enumeration value=\"folHlink\"/>\n// <xsd:enumeration value=\"dk1\"/>\n// <xsd:enumeration value=\"lt1\"/>\n// <xsd:enumeration value=\"dk2\"/>\n// <xsd:enumeration value=\"lt2\"/>\n// <xsd:enumeration value=\"phClr\"/>\n// </xsd:restriction>\n// </xsd:simpleType>\n\n// Cspell:ignore folHlink, phClr, hlink\n\n/**\n * Scheme color values for theme-based colors.\n *\n * These values reference colors defined in the document's color scheme/theme.\n */\nexport const SchemeColor = {\n /** Background color 1 */\n BG1: \"bg1\",\n /** Text color 1 */\n TX1: \"tx1\",\n /** Background color 2 */\n BG2: \"bg2\",\n /** Text color 2 */\n TX2: \"tx2\",\n /** Accent color 1 */\n ACCENT1: \"accent1\",\n /** Accent color 2 */\n ACCENT2: \"accent2\",\n /** Accent color 3 */\n ACCENT3: \"accent3\",\n /** Accent color 4 */\n ACCENT4: \"accent4\",\n /** Accent color 5 */\n ACCENT5: \"accent5\",\n /** Accent color 6 */\n ACCENT6: \"accent6\",\n /** Hyperlink color */\n HLINK: \"hlink\",\n /** Followed hyperlink color */\n FOLHLINK: \"folHlink\",\n /** Dark color 1 */\n DK1: \"dk1\",\n /** Light color 1 */\n LT1: \"lt1\",\n /** Dark color 2 */\n DK2: \"dk2\",\n /** Light color 2 */\n LT2: \"lt2\",\n /** Placeholder color */\n PHCLR: \"phClr\",\n} as const;\n\n/**\n * Creates a scheme color element as an XML string.\n *\n * Specifies a color using a theme color scheme reference.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SchemeColor\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_ColorTransform\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"val\" type=\"ST_SchemeColorVal\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * const accentColor = createSchemeColor({ value: SchemeColor.ACCENT1 });\n * // With tint transform\n * const lightAccent = createSchemeColor({\n * value: SchemeColor.ACCENT1,\n * transforms: { tint: 40000 },\n * });\n * ```\n */\nexport const createSchemeColor = (options: SchemeColorOptions): string => {\n const transforms = options.transforms ? createColorTransforms(options.transforms) : [];\n return element(\"a:schemeClr\", { val: options.value }, transforms);\n};\n","/**\n * System color element for DrawingML.\n *\n * This module provides system color support, referencing OS-level UI colors.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_SystemColor / ST_SystemColorVal\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport type { ColorTransformOptions } from \"./color-transform\";\nimport { createColorTransforms } from \"./color-transform\";\n\n/**\n * System color values referencing OS UI colors.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_SystemColorVal\">\n * <xsd:restriction base=\"xsd:token\">\n * <xsd:enumeration value=\"scrollBar\"/>\n * <xsd:enumeration value=\"background\"/>\n * ...\n * <xsd:enumeration value=\"menuBar\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n */\nexport const SystemColor = {\n SCROLL_BAR: \"scrollBar\",\n BACKGROUND: \"background\",\n ACTIVE_CAPTION: \"activeCaption\",\n INACTIVE_CAPTION: \"inactiveCaption\",\n MENU: \"menu\",\n WINDOW: \"window\",\n WINDOW_FRAME: \"windowFrame\",\n MENU_TEXT: \"menuText\",\n WINDOW_TEXT: \"windowText\",\n CAPTION_TEXT: \"captionText\",\n ACTIVE_BORDER: \"activeBorder\",\n INACTIVE_BORDER: \"inactiveBorder\",\n APP_WORKSPACE: \"appWorkspace\",\n HIGHLIGHT: \"highlight\",\n HIGHLIGHT_TEXT: \"highlightText\",\n BTN_FACE: \"btnFace\",\n BTN_SHADOW: \"btnShadow\",\n GRAY_TEXT: \"grayText\",\n BTN_TEXT: \"btnText\",\n INACTIVE_CAPTION_TEXT: \"inactiveCaptionText\",\n BTN_HIGHLIGHT: \"btnHighlight\",\n THREE_D_DK_SHADOW: \"3dDkShadow\",\n THREE_D_LIGHT: \"3dLight\",\n INFO_TEXT: \"infoText\",\n INFO_BK: \"infoBk\",\n HOT_LIGHT: \"hotLight\",\n GRADIENT_ACTIVE_CAPTION: \"gradientActiveCaption\",\n GRADIENT_INACTIVE_CAPTION: \"gradientInactiveCaption\",\n MENU_HIGHLIGHT: \"menuHighlight\",\n MENU_BAR: \"menuBar\",\n} as const;\n\n/**\n * Options for system color.\n */\nexport interface SystemColorOptions {\n /** System color value */\n value: (typeof SystemColor)[keyof typeof SystemColor];\n /** Last known RGB color value (optional fallback) */\n lastClr?: string;\n /** Optional color transforms */\n transforms?: ColorTransformOptions;\n}\n\n/**\n * Creates a system color element as an XML string.\n *\n * References a system-defined UI color (e.g., window background, button face).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SystemColor\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_ColorTransform\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"val\" type=\"ST_SystemColorVal\" use=\"required\"/>\n * <xsd:attribute name=\"lastClr\" type=\"s:ST_HexColorRGB\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createSystemColor = (options: SystemColorOptions): string => {\n const transforms = options.transforms ? createColorTransforms(options.transforms) : [];\n return element(\"a:sysClr\", { val: options.value, lastClr: options.lastClr }, transforms);\n};\n","/**\n * Solid fill element for DrawingML shapes.\n *\n * This module provides solid fill support for outlines and shapes,\n * supporting RGB, scheme, HSL, system, and preset colors.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_SolidColorFillProperties\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport { createHslColor } from \"./hsl-color\";\nimport type { HslColorOptions } from \"./hsl-color\";\nimport { createPresetColor, PresetColor } from \"./preset-color\";\nimport type { PresetColorOptions } from \"./preset-color\";\nimport { createRgbColor } from \"./rgb-color\";\nimport type { RgbColorOptions } from \"./rgb-color\";\nimport { createScRgbColor } from \"./sc-rgb-color\";\nimport type { ScRgbColorOptions } from \"./sc-rgb-color\";\nimport { createSchemeColor, SchemeColor } from \"./scheme-color\";\nimport type { SchemeColorOptions } from \"./scheme-color\";\nimport { createSystemColor, SystemColor } from \"./system-color\";\nimport type { SystemColorOptions } from \"./system-color\";\n\n/**\n * Union type for all color options supported by solid fill.\n *\n * Extends the original pattern with additional color types:\n * RGB, scheme, HSL, system, and preset colors.\n */\nexport type SolidFillOptions =\n | ScRgbColorOptions\n | RgbColorOptions\n | SchemeColorOptions\n | HslColorOptions\n | SystemColorOptions\n | PresetColorOptions;\n\n/**\n * Creates the color child element for a solid fill based on the color type.\n */\nconst SYSTEM_COLOR_VALUES: ReadonlySet<string> = new Set(Object.values(SystemColor));\nconst PRESET_COLOR_VALUES: ReadonlySet<string> = new Set(Object.values(PresetColor));\nconst SCHEME_COLOR_VALUES: ReadonlySet<string> = new Set(Object.values(SchemeColor));\n\nexport const createColorElement = (color: SolidFillOptions): string => {\n if (\"hue\" in color && \"saturation\" in color && \"luminance\" in color) {\n return createHslColor(color);\n }\n if (\"r\" in color && \"g\" in color && \"b\" in color) {\n return createScRgbColor(color);\n }\n // At this point, color is guaranteed to have a string value property\n const colorValue = (color as { readonly value: string }).value;\n if (SYSTEM_COLOR_VALUES.has(colorValue)) {\n return createSystemColor(color as SystemColorOptions);\n }\n if (PRESET_COLOR_VALUES.has(colorValue)) {\n return createPresetColor(color as PresetColorOptions);\n }\n if (SCHEME_COLOR_VALUES.has(colorValue)) {\n return createSchemeColor(color as SchemeColorOptions);\n }\n return createRgbColor(color as RgbColorOptions);\n};\n\n/**\n * Creates a solid fill element as an XML string.\n *\n * Specifies a solid color fill using any supported color type.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SolidColorFillProperties\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_ColorChoice\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_EffectProperties\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // RGB solid fill\n * const fill = createSolidFill({ value: \"FF0000\" });\n * // Scheme solid fill with tint\n * const schemeFill = createSolidFill({\n * value: SchemeColor.ACCENT1, transforms: { tint: 40000 },\n * });\n * // HSL solid fill\n * const hslFill = createSolidFill({ hue: 120000, saturation: 100000, luminance: 50000 });\n * ```\n */\nexport const createSolidFill = (options: SolidFillOptions): string =>\n element(\"a:solidFill\", undefined, [createColorElement(options)]);\n","/**\n * Blip image adjustment effects for DrawingML.\n *\n * These effects are applied directly to the image data within the `<a:blip>` element,\n * corresponding to Word's \"Picture Format > Adjust\" features (brightness, contrast,\n * grayscale, tint, duotone, etc.).\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_Blip children\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport { createColorElement } from \"../color/solid-fill\";\nimport type { SolidFillOptions } from \"../color/solid-fill\";\n\n// ─── Effect option interfaces ────────────────────────────────────────\n\n/**\n * Options for luminance (brightness/contrast) effect.\n *\n * ## XSD: CT_LuminanceEffect\n * ```xml\n * <xsd:attribute name=\"bright\" type=\"ST_FixedPercentage\" default=\"0%\"/>\n * <xsd:attribute name=\"contrast\" type=\"ST_FixedPercentage\" default=\"0%\"/>\n * ```\n */\nexport interface LuminanceEffectOptions {\n /** Brightness adjustment in percentage points (-100 to 100). Default 0. */\n bright?: number;\n /** Contrast adjustment in percentage points (-100 to 100). Default 0. */\n contrast?: number;\n}\n\n/**\n * Options for HSL effect.\n *\n * ## XSD: CT_HSLEffect\n * ```xml\n * <xsd:attribute name=\"hue\" type=\"ST_PositiveFixedAngle\" default=\"0\"/>\n * <xsd:attribute name=\"sat\" type=\"ST_FixedPercentage\" default=\"0%\"/>\n * <xsd:attribute name=\"lum\" type=\"ST_FixedPercentage\" default=\"0%\"/>\n * ```\n */\nexport interface HSLEffectOptions {\n /** Hue rotation in 60000ths of a degree. Default 0. */\n hue?: number;\n /** Saturation adjustment in percentage points (-100 to 100). Default 0. */\n saturation?: number;\n /** Luminance adjustment in percentage points (-100 to 100). Default 0. */\n luminance?: number;\n}\n\n/**\n * Options for tint effect.\n *\n * ## XSD: CT_TintEffect\n * ```xml\n * <xsd:attribute name=\"hue\" type=\"ST_PositiveFixedAngle\" default=\"0\"/>\n * <xsd:attribute name=\"amt\" type=\"ST_FixedPercentage\" default=\"0%\"/>\n * ```\n */\nexport interface TintEffectOptions {\n /** Hue in 60000ths of a degree. Default 0. */\n hue?: number;\n /** Amount in percentage points (0 to 100). Default 0. */\n amount?: number;\n}\n\n/**\n * Options for duotone effect.\n *\n * ## XSD: CT_DuotoneEffect\n * ```xml\n * <xsd:group ref=\"EG_ColorChoice\" minOccurs=\"2\" maxOccurs=\"2\"/>\n * ```\n */\nexport interface DuotoneEffectOptions {\n /** First color (dark). */\n color1: SolidFillOptions;\n /** Second color (light). */\n color2: SolidFillOptions;\n}\n\n/**\n * Options for biLevel (black & white threshold) effect.\n *\n * ## XSD: CT_BiLevelEffect\n * ```xml\n * <xsd:attribute name=\"thresh\" type=\"ST_PositiveFixedPercentage\" use=\"required\"/>\n * ```\n */\nexport interface BiLevelEffectOptions {\n /** Threshold percentage (0 to 100). Pixels above are white, below are black. */\n threshold: number;\n}\n\n/**\n * Options for alpha replace effect.\n *\n * ## XSD: CT_AlphaReplaceEffect\n * ```xml\n * <xsd:attribute name=\"a\" type=\"ST_PositiveFixedPercentage\" use=\"required\"/>\n * ```\n */\nexport interface AlphaReplaceEffectOptions {\n /** Alpha percentage (0 = fully transparent, 100 = fully opaque). */\n amount: number;\n}\n\n/**\n * Options for alpha bi-level effect.\n *\n * ## XSD: CT_AlphaBiLevelEffect\n * ```xml\n * <xsd:attribute name=\"thresh\" type=\"ST_PositiveFixedPercentage\" use=\"required\"/>\n * ```\n */\nexport interface AlphaBiLevelEffectOptions {\n /** Threshold percentage (0 to 100). Alpha above is fully opaque, below is fully transparent. */\n threshold: number;\n}\n\n/**\n * Options for alpha modulate fixed effect.\n *\n * ## XSD: CT_AlphaModulateFixedEffect\n * ```xml\n * <xsd:attribute name=\"amt\" type=\"ST_PositivePercentage\" default=\"100%\"/>\n * ```\n */\nexport interface AlphaModulateFixedEffectOptions {\n /** Alpha amount in percentage (0 to 100). Default 100. */\n amount?: number;\n}\n\n/**\n * Options for color change effect.\n *\n * ## XSD: CT_ColorChangeEffect\n * ```xml\n * <xsd:element name=\"clrFrom\" type=\"CT_Color\"/>\n * <xsd:element name=\"clrTo\" type=\"CT_Color\"/>\n * <xsd:attribute name=\"useA\" type=\"xsd:boolean\" default=\"true\"/>\n * ```\n */\nexport interface ColorChangeEffectOptions {\n /** Source color to change from. */\n from: SolidFillOptions;\n /** Target color to change to. */\n to: SolidFillOptions;\n /** Whether to use alpha channel. Default true. */\n useAlpha?: boolean;\n}\n\n/**\n * Options for color replace effect.\n *\n * ## XSD: CT_ColorReplaceEffect\n * ```xml\n * <xsd:group ref=\"EG_ColorChoice\" minOccurs=\"1\" maxOccurs=\"1\"/>\n * ```\n */\nexport interface ColorReplaceEffectOptions {\n /** Replacement color. */\n color: SolidFillOptions;\n}\n\n/**\n * Options for blur effect on blip.\n *\n * ## XSD: CT_BlurEffect\n * ```xml\n * <xsd:attribute name=\"rad\" type=\"ST_PositiveCoordinate\" default=\"0\"/>\n * <xsd:attribute name=\"grow\" type=\"xsd:boolean\" default=\"true\"/>\n * ```\n */\nexport interface BlipBlurEffectOptions {\n /** Blur radius in EMUs. Default 0. */\n radius?: number;\n /** Whether to grow the blur boundary. Default true. */\n grow?: boolean;\n}\n\n/**\n * All blip image adjustment effects.\n */\nexport interface BlipEffectsOptions {\n /** Grayscale effect (no options needed). */\n grayscale?: boolean;\n /** Luminance (brightness/contrast) effect. */\n luminance?: LuminanceEffectOptions;\n /** HSL adjustment effect. */\n hsl?: HSLEffectOptions;\n /** Tint effect. */\n tint?: TintEffectOptions;\n /** Duotone effect (two-color mapping). */\n duotone?: DuotoneEffectOptions;\n /** Black & white threshold effect. */\n biLevel?: BiLevelEffectOptions;\n /** Alpha ceiling effect (no options needed). */\n alphaCeiling?: boolean;\n /** Alpha floor effect (no options needed). */\n alphaFloor?: boolean;\n /** Alpha inverse effect (with optional color). */\n alphaInverse?: SolidFillOptions;\n /** Alpha modulate fixed effect. */\n alphaModFix?: AlphaModulateFixedEffectOptions;\n /** Alpha replace effect. */\n alphaRepl?: AlphaReplaceEffectOptions;\n /** Alpha bi-level effect. */\n alphaBiLevel?: AlphaBiLevelEffectOptions;\n /** Color change effect. */\n colorChange?: ColorChangeEffectOptions;\n /** Color replace effect. */\n colorRepl?: ColorReplaceEffectOptions;\n /** Blur effect on blip. */\n blur?: BlipBlurEffectOptions;\n}\n\n// ─── Factory functions ───────────────────────────────────────────────\n\n/**\n * Creates blip effect elements from BlipEffectsOptions.\n *\n * @returns Array of XML strings representing blip effects\n */\nexport const createBlipEffects = (options: BlipEffectsOptions): string[] => {\n const children: string[] = [];\n\n if (options.grayscale) {\n children.push(`<a:grayscl/>`);\n }\n\n if (options.luminance) {\n const attrs: Record<string, string | number | undefined> = {};\n if (options.luminance.bright !== undefined) {\n attrs.bright = `${options.luminance.bright}`;\n }\n if (options.luminance.contrast !== undefined) {\n attrs.contrast = `${options.luminance.contrast}`;\n }\n children.push(element(\"a:lum\", attrs));\n }\n\n if (options.hsl) {\n const attrs: Record<string, string | number | undefined> = {};\n if (options.hsl.hue !== undefined) {\n attrs.hue = String(options.hsl.hue);\n }\n if (options.hsl.saturation !== undefined) {\n attrs.sat = `${options.hsl.saturation}`;\n }\n if (options.hsl.luminance !== undefined) {\n attrs.lum = `${options.hsl.luminance}`;\n }\n children.push(element(\"a:hsl\", attrs));\n }\n\n if (options.tint) {\n const attrs: Record<string, string | number | undefined> = {};\n if (options.tint.hue !== undefined) {\n attrs.hue = String(options.tint.hue);\n }\n if (options.tint.amount !== undefined) {\n attrs.amt = `${options.tint.amount}`;\n }\n children.push(element(\"a:tint\", attrs));\n }\n\n if (options.duotone) {\n children.push(\n element(\"a:duotone\", undefined, [\n createColorElement(options.duotone.color1),\n createColorElement(options.duotone.color2),\n ]),\n );\n }\n\n if (options.biLevel) {\n children.push(`<a:biLevel thresh=\"${options.biLevel.threshold}\"/>`);\n }\n\n if (options.alphaCeiling) {\n children.push(`<a:alphaCeiling/>`);\n }\n\n if (options.alphaFloor) {\n children.push(`<a:alphaFloor/>`);\n }\n\n if (options.alphaInverse !== undefined) {\n if (typeof options.alphaInverse === \"boolean\") {\n children.push(`<a:alphaInv/>`);\n } else {\n children.push(element(\"a:alphaInv\", undefined, [createColorElement(options.alphaInverse)]));\n }\n }\n\n if (options.alphaModFix) {\n const amt = options.alphaModFix.amount ?? 100;\n children.push(`<a:alphaModFix amt=\"${amt}\"/>`);\n }\n\n if (options.alphaRepl) {\n children.push(`<a:alphaRepl a=\"${options.alphaRepl.amount}\"/>`);\n }\n\n if (options.alphaBiLevel) {\n children.push(`<a:alphaBiLevel thresh=\"${options.alphaBiLevel.threshold}\"/>`);\n }\n\n if (options.colorChange) {\n const attrs: Record<string, string | number | undefined> = {};\n if (options.colorChange.useAlpha === false) {\n attrs.useA = \"0\";\n }\n children.push(\n element(\"a:clrChange\", attrs, [\n element(\"a:clrFrom\", undefined, [createColorElement(options.colorChange.from)]),\n element(\"a:clrTo\", undefined, [createColorElement(options.colorChange.to)]),\n ]),\n );\n }\n\n if (options.colorRepl) {\n children.push(element(\"a:clrRepl\", undefined, [createColorElement(options.colorRepl.color)]));\n }\n\n if (options.blur) {\n const attrs: Record<string, string | number | undefined> = {};\n if (options.blur.radius !== undefined) {\n attrs.rad = options.blur.radius;\n }\n if (options.blur.grow === false) {\n attrs.grow = 0;\n }\n children.push(element(\"a:blur\", attrs));\n }\n\n return children;\n};\n","/**\n * Source rectangle module for blip fills.\n *\n * This module defines the portion of an image to use when filling a shape.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_RelativeRect\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\n/**\n * Options for source rectangle cropping.\n *\n * Each value is a percentage (0-100000) of the image dimension to crop.\n * The values represent the inset from each edge.\n */\nexport interface SourceRectangleOptions {\n /** Left inset percentage (0-100000) */\n left?: number;\n /** Top inset percentage (0-100000) */\n top?: number;\n /** Right inset percentage (0-100000) */\n right?: number;\n /** Bottom inset percentage (0-100000) */\n bottom?: number;\n}\n\n/**\n * Creates a source rectangle element for blip fill cropping.\n *\n * This element specifies a portion of the blip (image) to use as the fill.\n * When no options are provided, the entire blip is used.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_RelativeRect\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_RelativeRect\">\n * <xsd:attribute name=\"l\" type=\"ST_Percentage\" use=\"optional\" default=\"0\"/>\n * <xsd:attribute name=\"t\" type=\"ST_Percentage\" use=\"optional\" default=\"0\"/>\n * <xsd:attribute name=\"r\" type=\"ST_Percentage\" use=\"optional\" default=\"0\"/>\n * <xsd:attribute name=\"b\" type=\"ST_Percentage\" use=\"optional\" default=\"0\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Crop 10% from left and right\n * createSourceRectangle({ left: 10000, right: 10000 });\n * ```\n */\nexport const createSourceRectangle = (options?: SourceRectangleOptions): string => {\n if (!options) {\n return element(\"a:srcRect\");\n }\n\n const attrs: Record<string, string | number | undefined> = {};\n if (options.left !== undefined) attrs.l = options.left;\n if (options.top !== undefined) attrs.t = options.top;\n if (options.right !== undefined) attrs.r = options.right;\n if (options.bottom !== undefined) attrs.b = options.bottom;\n\n return element(\"a:srcRect\", attrs);\n};\n","/**\n * Tile fill module for blip fills.\n *\n * This module defines how images are tiled (repeated) to fill shapes.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_TileInfoProperties\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport { xsdRectAlignment } from \"../../util/mappings\";\n\n/**\n * Tile flip mode for tiling images.\n *\n * Specifies whether the image is flipped along the x-axis, y-axis,\n * both axes, or not at all when tiling.\n */\nexport const TileFlipMode = {\n /** No flipping */\n NONE: \"none\",\n /** Flip along x-axis */\n X: \"x\",\n /** Flip along y-axis */\n Y: \"y\",\n /** Flip along both axes */\n XY: \"xy\",\n} as const;\n\n/**\n * Tile alignment within the shape.\n *\n * Specifies the anchor position of the first tile relative to the shape.\n */\nexport const TileAlignment = {\n /** Top-left corner */\n TOP_LEFT: \"topLeft\",\n /** Top center */\n TOP: \"top\",\n /** Top-right corner */\n TOP_RIGHT: \"topRight\",\n /** Middle-left */\n LEFT: \"left\",\n /** Center */\n CENTER: \"center\",\n /** Middle-right */\n RIGHT: \"right\",\n /** Bottom-left corner */\n BOTTOM_LEFT: \"bottomLeft\",\n /** Bottom center */\n BOTTOM: \"bottom\",\n /** Bottom-right corner */\n BOTTOM_RIGHT: \"bottomRight\",\n} as const;\n\n/**\n * Options for tile fill mode.\n *\n * Configures how an image is tiled (repeated) to fill a shape.\n */\nexport interface TileOptions {\n /** Horizontal offset for the tile origin (in EMUs) */\n tx?: number;\n /** Vertical offset for the tile origin (in EMUs) */\n ty?: number;\n /** Horizontal scale factor as percentage (e.g., 50 = 50%) */\n sx?: number;\n /** Vertical scale factor as percentage (e.g., 50 = 50%) */\n sy?: number;\n /** Flip mode for alternating tiles */\n flip?: (typeof TileFlipMode)[keyof typeof TileFlipMode];\n /** Alignment of the first tile within the shape */\n align?: (typeof TileAlignment)[keyof typeof TileAlignment];\n}\n\n/**\n * Creates a tile fill mode element for blip fills.\n *\n * When a blip fill uses tile mode, the image is repeated (tiled) to fill\n * the shape instead of being stretched. This element controls the tiling\n * parameters such as offset, scale, flip, and alignment.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_TileInfoProperties\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TileInfoProperties\">\n * <xsd:attribute name=\"tx\" type=\"ST_Coordinate\" use=\"optional\"/>\n * <xsd:attribute name=\"ty\" type=\"ST_Coordinate\" use=\"optional\"/>\n * <xsd:attribute name=\"sx\" type=\"ST_Percentage\" use=\"optional\"/>\n * <xsd:attribute name=\"sy\" type=\"ST_Percentage\" use=\"optional\"/>\n * <xsd:attribute name=\"flip\" type=\"ST_TileFlipMode\" default=\"none\"/>\n * <xsd:attribute name=\"algn\" type=\"ST_RectAlignment\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Tile with 50% scale\n * createTileInfo({ sx: 50, sy: 50 });\n * // Tile with flip and alignment\n * createTileInfo({ flip: \"XY\", align: \"CENTER\" });\n * ```\n */\nexport const createTileInfo = (options?: TileOptions): string => {\n if (!options) {\n return `<a:tile/>`;\n }\n\n const attrs: Record<string, string | number | undefined> = {};\n if (options.tx !== undefined) attrs.tx = options.tx;\n if (options.ty !== undefined) attrs.ty = options.ty;\n if (options.sx !== undefined) attrs.sx = options.sx;\n if (options.sy !== undefined) attrs.sy = options.sy;\n if (options.flip !== undefined) attrs.flip = options.flip;\n if (options.align !== undefined) attrs.algn = xsdRectAlignment.to(options.align);\n\n return element(\"a:tile\", attrs);\n};\n","/**\n * Gradient fill element for DrawingML shapes.\n *\n * This module provides gradient fill support with linear and path shading.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_GradientFillProperties\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport type { SolidFillOptions } from \"../color/solid-fill\";\nimport { createColorElement } from \"../color/solid-fill\";\n\n/**\n * Gradient stop position (0-100000, representing 0%-100%).\n */\nexport interface GradientStop {\n /** Position of the color stop (0-100000) */\n position: number;\n /** Color at this stop */\n color: SolidFillOptions;\n}\n\n/**\n * Path shade type for radial gradients.\n */\nexport const PathShadeType = {\n /** Follow shape path */\n SHAPE: \"shape\",\n /** Circular gradient */\n CIRCLE: \"circle\",\n /** Rectangular gradient */\n RECT: \"rect\",\n} as const;\n\n/**\n * Tile flip mode for gradient fill.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_TileFlipMode\">\n * <xsd:restriction base=\"xsd:string\">\n * <xsd:enumeration value=\"none\"/>\n * <xsd:enumeration value=\"x\"/>\n * <xsd:enumeration value=\"y\"/>\n * <xsd:enumeration value=\"xy\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n */\nexport const TileFlipMode = {\n /** No flip */\n NONE: \"none\",\n /** Flip horizontally */\n X: \"x\",\n /** Flip vertically */\n Y: \"y\",\n /** Flip both horizontally and vertically */\n XY: \"xy\",\n} as const;\n\n/**\n * Options for linear gradient shading.\n */\nexport interface LinearShadeOptions {\n /** Angle in 60,000ths of a degree (e.g., 5400000 = 90°) */\n angle?: number;\n /** Whether the angle scales with the shape */\n scaled?: boolean;\n}\n\n/**\n * Relative rectangle (CT_RelativeRect) with percentage offsets.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_RelativeRect\">\n * <xsd:attribute name=\"l\" type=\"ST_Percentage\" default=\"0%\"/>\n * <xsd:attribute name=\"t\" type=\"ST_Percentage\" default=\"0%\"/>\n * <xsd:attribute name=\"r\" type=\"ST_Percentage\" default=\"0%\"/>\n * <xsd:attribute name=\"b\" type=\"ST_Percentage\" default=\"0%\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface RelativeRect {\n /** Left offset percentage (e.g., \"0%\") */\n left?: string;\n /** Top offset percentage (e.g., \"0%\") */\n top?: string;\n /** Right offset percentage (e.g., \"0%\") */\n right?: string;\n /** Bottom offset percentage (e.g., \"0%\") */\n bottom?: string;\n}\n\n/**\n * Options for path (radial) gradient shading.\n */\nexport interface PathShadeOptions {\n /** Path type */\n path?: (typeof PathShadeType)[keyof typeof PathShadeType];\n /**\n * Fill-to rectangle for path gradient.\n *\n * Defines the rectangle to which the gradient fills.\n */\n fillToRectangle?: RelativeRect;\n}\n\n/**\n * Gradient shade options (linear or path).\n */\nexport type GradientShadeOptions = LinearShadeOptions | PathShadeOptions;\n\n/**\n * Options for gradient fill.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_GradientFillProperties\">\n * <xsd:sequence>\n * <xsd:element name=\"gsLst\" type=\"CT_GradientStopList\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_ShadeProperties\" minOccurs=\"0\"/>\n * <xsd:element name=\"tileRect\" type=\"CT_RelativeRect\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"flip\" type=\"ST_TileFlipMode\" use=\"optional\"/>\n * <xsd:attribute name=\"rotWithShape\" type=\"xsd:boolean\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface GradientFillOptions {\n /** Gradient color stops (minimum 2) */\n stops: readonly GradientStop[];\n /** Shade type (linear or path) */\n shade?: GradientShadeOptions;\n /**\n * Tile flip mode.\n *\n * Controls how the gradient is flipped when tiled.\n */\n flip?: (typeof TileFlipMode)[keyof typeof TileFlipMode];\n /**\n * Tile rectangle for gradient tiling.\n *\n * Defines the rectangle used for gradient tiling.\n */\n tileRectangle?: RelativeRect;\n /** Whether gradient rotates with the shape */\n rotateWithShape?: boolean;\n}\n\n/**\n * Creates a gradient stop element (a:gs).\n *\n * @example\n * ```typescript\n * createGradientStop({ position: 0, color: { value: \"FF0000\" } });\n * createGradientStop({ position: 100000, color: { value: \"0000FF\" } });\n * ```\n */\nexport const createGradientStop = (stop: GradientStop): string =>\n element(\"a:gs\", { pos: stop.position }, [createColorElement(stop.color)]);\n\n/**\n * Creates a relative rect element.\n */\nconst createRelativeRect = (name: string, rect?: RelativeRect): string =>\n element(name, {\n l: rect?.left,\n t: rect?.top,\n r: rect?.right,\n b: rect?.bottom,\n });\n\n/**\n * Creates the shade element (a:lin or a:path).\n */\nconst createShadeElement = (shade: GradientShadeOptions): string => {\n if (\"angle\" in shade) {\n return element(\"a:lin\", {\n ang: shade.angle,\n scaled: shade.scaled,\n });\n }\n const pathShade = shade as PathShadeOptions;\n const children: string[] = [];\n\n if (pathShade.fillToRectangle) {\n children.push(createRelativeRect(\"a:fillToRect\", pathShade.fillToRectangle));\n }\n\n return element(\"a:path\", { path: pathShade.path }, children);\n};\n\n/**\n * Creates a gradient fill element.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_GradientFillProperties\">\n * <xsd:sequence>\n * <xsd:element name=\"gsLst\" type=\"CT_GradientStopList\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_ShadeProperties\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"rotWithShape\" type=\"xsd:boolean\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Linear gradient from red to blue\n * createGradientFill({\n * stops: [\n * { position: 0, color: { value: \"FF0000\" } },\n * { position: 100000, color: { value: \"0000FF\" } },\n * ],\n * shade: { angle: 5400000 },\n * });\n * ```\n */\nexport const createGradientFill = (options: GradientFillOptions): string => {\n const children: string[] = [];\n\n // Gradient stop list\n const stopElements = options.stops.map(createGradientStop);\n children.push(element(\"a:gsLst\", undefined, stopElements));\n\n // Shade properties (a:lin or a:path)\n if (options.shade) {\n children.push(createShadeElement(options.shade));\n }\n\n // Tile rectangle\n if (options.tileRectangle) {\n children.push(createRelativeRect(\"a:tileRect\", options.tileRectangle));\n }\n\n return element(\n \"a:gradFill\",\n {\n flip: options.flip,\n rotWithShape: options.rotateWithShape,\n },\n children,\n );\n};\n","/**\n * Pattern fill element for DrawingML shapes.\n *\n * This module provides pattern fill support with preset patterns and\n * optional foreground/background colors.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_PatternFillProperties\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport { xsdPattern } from \"../../util/mappings\";\nimport type { SolidFillOptions } from \"../color/solid-fill\";\nimport { createColorElement } from \"../color/solid-fill\";\n\n/**\n * Preset pattern values for pattern fill.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_PresetPatternVal\">\n * <xsd:restriction base=\"xsd:token\">\n * <xsd:enumeration value=\"pct5\"/> ... <xsd:enumeration value=\"zigZag\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const PresetPattern = {\n /** 5% pattern */\n PCT5: \"percent5\",\n /** 10% pattern */\n PCT10: \"percent10\",\n /** 20% pattern */\n PCT20: \"percent20\",\n /** 25% pattern */\n PCT25: \"percent25\",\n /** 30% pattern */\n PCT30: \"percent30\",\n /** 40% pattern */\n PCT40: \"percent40\",\n /** 50% pattern */\n PCT50: \"percent50\",\n /** 60% pattern */\n PCT60: \"percent60\",\n /** 70% pattern */\n PCT70: \"percent70\",\n /** 75% pattern */\n PCT75: \"percent75\",\n /** 80% pattern */\n PCT80: \"percent80\",\n /** 90% pattern */\n PCT90: \"percent90\",\n /** Horizontal lines */\n HORZ: \"horizontal\",\n /** Vertical lines */\n VERT: \"vertical\",\n /** Light horizontal lines */\n LT_HORZ: \"lightHorizontal\",\n /** Light vertical lines */\n LT_VERT: \"lightVertical\",\n /** Dark horizontal lines */\n DK_HORZ: \"darkHorizontal\",\n /** Dark vertical lines */\n DK_VERT: \"darkVertical\",\n /** Narrow horizontal lines */\n NAR_HORZ: \"narrowHorizontal\",\n /** Narrow vertical lines */\n NAR_VERT: \"narrowVertical\",\n /** Dashed horizontal lines */\n DASH_HORZ: \"dashedHorizontal\",\n /** Dashed vertical lines */\n DASH_VERT: \"dashedVertical\",\n /** Cross pattern (+) */\n CROSS: \"cross\",\n /** Downward diagonal lines (\\) */\n DN_DIAG: \"downDiagonal\",\n /** Upward diagonal lines (/) */\n UP_DIAG: \"upDiagonal\",\n /** Light downward diagonal lines */\n LT_DN_DIAG: \"lightDownDiagonal\",\n /** Light upward diagonal lines */\n LT_UP_DIAG: \"lightUpDiagonal\",\n /** Dark downward diagonal lines */\n DK_DN_DIAG: \"darkDownDiagonal\",\n /** Dark upward diagonal lines */\n DK_UP_DIAG: \"darkUpDiagonal\",\n /** Wide downward diagonal lines */\n WD_DN_DIAG: \"wideDownDiagonal\",\n /** Wide upward diagonal lines */\n WD_UP_DIAG: \"wideUpDiagonal\",\n /** Dashed downward diagonal lines */\n DASH_DN_DIAG: \"dashedDownDiagonal\",\n /** Dashed upward diagonal lines */\n DASH_UP_DIAG: \"dashedUpDiagonal\",\n /** Diagonal cross pattern (X) */\n DIAG_CROSS: \"diagonalCross\",\n /** Small checkerboard */\n SM_CHECK: \"smallChecker\",\n /** Large checkerboard */\n LG_CHECK: \"largeChecker\",\n /** Small grid */\n SM_GRID: \"smallGrid\",\n /** Large grid */\n LG_GRID: \"largeGrid\",\n /** Dot grid */\n DOT_GRID: \"dotGrid\",\n /** Small confetti */\n SM_CONFETTI: \"smallConfetti\",\n /** Large confetti */\n LG_CONFETTI: \"largeConfetti\",\n /** Horizontal brick pattern */\n HORZ_BRICK: \"horizontalBrick\",\n /** Diagonal brick pattern */\n DIAG_BRICK: \"diagonalBrick\",\n /** Solid diamond */\n SOLID_DMND: \"solidDiamond\",\n /** Open diamond */\n OPEN_DMND: \"openDiamond\",\n /** Dotted diamond */\n DOT_DMND: \"dottedDiamond\",\n /** Plaid pattern */\n PLAID: \"plaid\",\n /** Sphere pattern */\n SPHERE: \"sphere\",\n /** Weave pattern */\n WEAVE: \"weave\",\n /** Divot pattern */\n DIVOT: \"divot\",\n /** Shingle pattern */\n SHINGLE: \"shingle\",\n /** Wave pattern */\n WAVE: \"wave\",\n /** Trellis pattern */\n TRELLIS: \"trellis\",\n /** Zigzag pattern */\n ZIG_ZAG: \"zigZag\",\n} as const;\n\n/**\n * Options for pattern fill.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_PatternFillProperties\">\n * <xsd:sequence>\n * <xsd:element name=\"fgClr\" type=\"CT_Color\" minOccurs=\"0\"/>\n * <xsd:element name=\"bgClr\" type=\"CT_Color\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"prst\" type=\"ST_PresetPatternVal\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface PatternFillOptions {\n /** Preset pattern type */\n pattern: (typeof PresetPattern)[keyof typeof PresetPattern];\n /** Foreground color */\n foregroundColor?: SolidFillOptions;\n /** Background color */\n backgroundColor?: SolidFillOptions;\n}\n\n/**\n * Creates a pattern fill element (a:pattFill).\n *\n * Specifies a pattern fill using preset patterns with optional\n * foreground and background colors.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_PatternFillProperties\">\n * <xsd:sequence>\n * <xsd:element name=\"fgClr\" type=\"CT_Color\" minOccurs=\"0\"/>\n * <xsd:element name=\"bgClr\" type=\"CT_Color\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"prst\" type=\"ST_PresetPatternVal\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Simple crosshatch pattern\n * createPatternFill({ pattern: PresetPattern.CROSS });\n * // Pattern with foreground color\n * createPatternFill({\n * pattern: PresetPattern.DIAG_CROSS,\n * foregroundColor: { value: \"FF0000\" },\n * });\n * // Pattern with foreground and background colors\n * createPatternFill({\n * pattern: PresetPattern.HORZ,\n * foregroundColor: { value: \"0000FF\" },\n * backgroundColor: { value: \"FFFF00\" },\n * });\n * ```\n */\nexport const createPatternFill = (options: PatternFillOptions): string => {\n const children: string[] = [];\n\n if (options.foregroundColor) {\n children.push(element(\"a:fgClr\", undefined, [createColorElement(options.foregroundColor)]));\n }\n\n if (options.backgroundColor) {\n children.push(element(\"a:bgClr\", undefined, [createColorElement(options.backgroundColor)]));\n }\n\n return element(\"a:pattFill\", { prst: xsdPattern.to(options.pattern) }, children);\n};\n","import { element } from \"@office-open/xml\";\n\nimport { toUint8Array } from \"../../util/data-type\";\nimport type { DataType } from \"../../util/data-type\";\nimport { uniqueId } from \"../../util/generators\";\nimport { createBlipEffects } from \"../blip/blip-effects\";\nimport type { BlipEffectsOptions } from \"../blip/blip-effects\";\nimport { createSourceRectangle } from \"../blip/source-rectangle\";\nimport type { SourceRectangleOptions } from \"../blip/source-rectangle\";\nimport { createTileInfo } from \"../blip/tile\";\nimport type { TileOptions } from \"../blip/tile\";\nimport type { SolidFillOptions } from \"../color/solid-fill\";\nimport { createSolidFill } from \"../color/solid-fill\";\nimport { createGradientFill } from \"./gradient-fill\";\nimport type { GradientFillOptions } from \"./gradient-fill\";\nimport type { PatternFillOptions } from \"./pattern-fill\";\nimport { createPatternFill } from \"./pattern-fill\";\n\n/**\n * Gradient stop options (simplified API).\n * Position is 0-100 (percentage), color is a hex string or SolidFillOptions.\n */\nexport interface GradientStopOptions {\n position: number;\n color: string | SolidFillOptions;\n}\n\n/**\n * Blip fill options (image fill) for DrawingML shapes.\n */\nexport interface BlipFillConfigOptions {\n /** Image data: raw bytes, ArrayBuffer, or a base64 data URL string. */\n data: DataType;\n /** Image type */\n imageType: \"png\" | \"jpg\" | \"gif\" | \"bmp\" | \"tif\" | \"ico\" | \"emf\" | \"wmf\";\n /** DPI of the image */\n dpi?: number;\n /** Whether the fill rotates with the shape */\n rotWithShape?: boolean;\n /** Image adjustment effects (brightness, contrast, grayscale, etc.) */\n blipEffects?: BlipEffectsOptions;\n /** Source rectangle for cropping */\n sourceRectangle?: SourceRectangleOptions;\n /** Tile fill mode (if omitted, defaults to stretch) */\n tile?: TileOptions;\n}\n\n/**\n * Media data extracted from a blip fill, for registration with the document's media store.\n */\nexport interface BlipFillMediaData {\n fileName: string;\n data: Uint8Array;\n type: string;\n}\n\n/**\n * Fill options — discriminated union for DrawingML EG_FillProperties.\n *\n * Supports string shorthand for solid fill (most common case).\n * Color fields accept hex strings or advanced SolidFillOptions\n * (scheme color, HSL, etc.).\n *\n * @example\n * // Solid fill (shorthand)\n * fill: \"4472C4\"\n * // Solid fill with scheme color\n * fill: { type: \"solid\", color: { value: \"accent1\" } }\n * // No fill\n * fill: { type: \"none\" }\n * // Gradient fill — linear\n * fill: { type: \"gradient\", angle: 90, stops: [{ position: 0, color: \"4472C4\" }, { position: 100, color: \"ED7D31\" }] }\n * // Gradient fill — path (radial)\n * fill: { type: \"gradient\", path: \"circle\", stops: [{ position: 0, color: \"FFFFFF\" }, { position: 100, color: \"4472C4\" }] }\n * // Gradient fill (core API for advanced options)\n * fill: { type: \"gradient\", options: { stops: [...], shade: { angle: 5400000 } } }\n * // Blip fill (image)\n * fill: { type: \"blip\", data: imageBuffer, imageType: \"png\" }\n * // Pattern fill\n * fill: { type: \"pattern\", pattern: \"cross\", foregroundColor: \"FF0000\" }\n * // Group fill\n * fill: { type: \"group\" }\n */\nexport type FillOptions =\n | string\n | { type: \"solid\"; color: string | SolidFillOptions }\n | { type: \"none\" }\n | {\n type: \"gradient\";\n angle?: number;\n scaled?: boolean;\n path?: \"shape\" | \"circle\" | \"rect\";\n stops: readonly GradientStopOptions[];\n }\n | { type: \"gradient\"; options: GradientFillOptions }\n | ({ type: \"blip\" } & BlipFillConfigOptions)\n | {\n type: \"pattern\";\n pattern: string;\n foregroundColor?: string | SolidFillOptions;\n backgroundColor?: string | SolidFillOptions;\n }\n | { type: \"group\" };\n\nfunction normalizeColor(color: string | SolidFillOptions): SolidFillOptions {\n return typeof color === \"string\" ? { value: color.replace(\"#\", \"\") } : color;\n}\n\n/**\n * Extracts media data from a blip fill option, if present.\n * Returns undefined for non-blip fills.\n *\n * The returned data should be registered with the document's media store\n * during serialization so the packer can resolve the `{fileName}` placeholder.\n *\n * @param fill - Fill options to inspect\n * @param nameAllocator - Optional sequential name provider (e.g. a format\n * package's media counter). When omitted, falls back to a random id so the\n * function stays usable from contexts without a shared counter.\n */\nexport const extractBlipFillMedia = (\n fill: FillOptions,\n nameAllocator?: (type: string) => string,\n): BlipFillMediaData | undefined => {\n if (typeof fill === \"string\" || fill.type !== \"blip\") return undefined;\n const raw = toUint8Array(fill.data);\n const fileName = nameAllocator\n ? nameAllocator(fill.imageType)\n : `${uniqueId()}.${fill.imageType}`;\n return { data: raw, fileName, type: fill.imageType };\n};\n\n/**\n * Builds a DrawingML fill XML string from a FillOptions config.\n */\nexport const buildFill = (options: FillOptions, embedPlaceholder?: string): string => {\n if (typeof options === \"string\") {\n return createSolidFill({ value: options.replace(\"#\", \"\") });\n }\n\n switch (options.type) {\n case \"solid\":\n return createSolidFill(normalizeColor(options.color));\n case \"none\":\n return \"<a:noFill/>\";\n case \"gradient\":\n if (\"options\" in options) {\n return createGradientFill(options.options);\n }\n return createGradientFill({\n stops: options.stops.map((stop) => ({\n position: stop.position * 1000,\n color: normalizeColor(stop.color),\n })),\n ...(!options.path &&\n options.angle !== undefined && {\n shade: { angle: options.angle * 60000, scaled: options.scaled ?? true },\n }),\n ...(options.path && {\n shade: { path: options.path as \"shape\" | \"circle\" | \"rect\" },\n }),\n });\n case \"blip\": {\n const fileName = `${uniqueId()}.${options.imageType}`;\n\n // Build a:blip with {fileName} placeholder — the packer's ImageReplacer\n // will replace `{fileName}` with `rId{N}` and create the relationship.\n // We do NOT use createBlip here because it prefixes \"rId\" to the value,\n // which would produce \"rIdrId{N}\" after replacement. When the caller\n // supplies embedPlaceholder (a media reference already registered with\n // the write context, e.g. `{image1.png}`), use it verbatim instead of\n // minting a fresh id so the emitted reference matches the registration.\n const embed = embedPlaceholder ?? `{${fileName}}`;\n const blipChildren: string[] = [];\n if (options.blipEffects) {\n blipChildren.push(...createBlipEffects(options.blipEffects));\n }\n const blip = element(\n \"a:blip\",\n { cstate: \"none\", \"r:embed\": embed },\n blipChildren.length > 0 ? blipChildren : undefined,\n );\n\n const children: string[] = [blip, createSourceRectangle(options.sourceRectangle)];\n if (options.tile) {\n children.push(createTileInfo(options.tile));\n } else {\n children.push(\"<a:stretch><a:fillRect/></a:stretch>\");\n }\n const attrs: Record<string, string | number | undefined> = {};\n if (options.dpi !== undefined) attrs.dpi = options.dpi;\n if (options.rotWithShape !== undefined) attrs.rotWithShape = options.rotWithShape ? 1 : 0;\n return element(\"a:blipFill\", attrs, children);\n }\n case \"pattern\": {\n const coreOpts: PatternFillOptions = {\n pattern: options.pattern as PatternFillOptions[\"pattern\"],\n ...(options.foregroundColor && {\n foregroundColor: normalizeColor(options.foregroundColor),\n }),\n ...(options.backgroundColor && {\n backgroundColor: normalizeColor(options.backgroundColor),\n }),\n };\n return createPatternFill(coreOpts);\n }\n case \"group\":\n return \"<a:grpFill/>\";\n }\n};\n","/**\n * No fill element for DrawingML shapes.\n *\n * This module provides the no-fill option for outline and shape fills.\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\n/**\n * Creates a no-fill element.\n *\n * Specifies that the outline or shape should have no fill applied.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:element name=\"noFill\" type=\"CT_Empty\"/>\n * ```\n *\n * @example\n * ```typescript\n * const noFill = createNoFill();\n * ```\n */\nexport const createNoFill = (): string => element(\"a:noFill\");\n","/**\n * Group fill element for DrawingML shapes.\n *\n * This module provides group fill support which inherits the fill\n * from the parent group shape.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_GroupFillProperties\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\n/**\n * Creates a group fill element (a:grpFill).\n *\n * This element specifies that the shape should inherit its fill\n * from the parent group shape. This is useful when shapes are\n * grouped together and should share the same fill.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_GroupFillProperties\"/>\n * ```\n *\n * @example\n * ```typescript\n * // Shape inherits fill from parent group\n * createGroupFill();\n * ```\n */\nexport const createGroupFill = (): string => element(\"a:grpFill\");\n","/**\n * Custom dash pattern for DrawingML outlines.\n *\n * This module provides support for custom dash patterns defined by\n * a list of dash stops, each specifying dash and space lengths as\n * percentages relative to line width.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_DashStopList, CT_DashStop\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\n/**\n * A single dash stop in a custom dash pattern.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_DashStop\">\n * <xsd:attribute name=\"d\" type=\"ST_PositivePercentage\" use=\"required\"/>\n * <xsd:attribute name=\"sp\" type=\"ST_PositivePercentage\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * `ST_PositivePercentage` is a string matching `[0-9]+(\\.[0-9]+)?%`\n * (e.g., `\"100%\"`, `\"500%\"`, `\"50.5%\"`).\n *\n * @example\n * ```typescript\n * // A dash stop with 500% dash length and 200% space length\n * { d: \"500%\", sp: \"200%\" }\n * ```\n */\nexport interface DashStop {\n /** Dash length as a percentage of line width (e.g., \"500%\") */\n d: string;\n /** Space length as a percentage of line width (e.g., \"200%\") */\n sp: string;\n}\n\n/**\n * Creates a custom dash element (a:custDash) for outlines.\n *\n * The custom dash element specifies a repeating pattern of dash and space\n * segments. Each segment is defined by a `DashStop` with dash (`d`) and\n * space (`sp`) lengths as positive percentages of the line width.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_DashStopList\">\n * <xsd:sequence>\n * <xsd:element name=\"ds\" type=\"CT_DashStop\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Simple dash pattern\n * createCustomDash([\n * { d: \"500%\", sp: \"200%\" },\n * ]);\n *\n * // Complex alternating pattern\n * createCustomDash([\n * { d: \"500%\", sp: \"200%\" },\n * { d: \"100%\", sp: \"200%\" },\n * ]);\n * ```\n */\nexport const createCustomDash = (stops: readonly DashStop[]): string => {\n const children: string[] = [];\n\n for (const stop of stops) {\n children.push(`<a:ds d=\"${stop.d}\" sp=\"${stop.sp}\"/>`);\n }\n\n return element(\"a:custDash\", undefined, children);\n};\n","/**\n * Line end (arrow) properties for DrawingML outlines.\n *\n * This module provides support for line end markers (arrows) on shape outlines.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_LineEndProperties\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport { xsdLineEndSize } from \"../../util/mappings\";\n\n/**\n * Line end types (arrow head styles).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_LineEndType\">\n * <xsd:restriction base=\"xsd:token\">\n * <xsd:enumeration value=\"none\"/>\n * <xsd:enumeration value=\"triangle\"/>\n * <xsd:enumeration value=\"stealth\"/>\n * <xsd:enumeration value=\"diamond\"/>\n * <xsd:enumeration value=\"oval\"/>\n * <xsd:enumeration value=\"arrow\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const LineEndType = {\n /** No line end */\n NONE: \"none\",\n /** Triangle arrow */\n TRIANGLE: \"triangle\",\n /** Stealth arrow (filled triangle) */\n STEALTH: \"stealth\",\n /** Diamond shape */\n DIAMOND: \"diamond\",\n /** Oval shape */\n OVAL: \"oval\",\n /** Simple arrow */\n ARROW: \"arrow\",\n} as const;\n\n/**\n * Line end width options.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_LineEndWidth\">\n * <xsd:restriction base=\"xsd:token\">\n * <xsd:enumeration value=\"sm\"/>\n * <xsd:enumeration value=\"med\"/>\n * <xsd:enumeration value=\"lg\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const LineEndWidth = {\n /** Small width */\n SMALL: \"small\",\n /** Medium width */\n MEDIUM: \"medium\",\n /** Large width */\n LARGE: \"large\",\n} as const;\n\n/**\n * Line end length options.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_LineEndLength\">\n * <xsd:restriction base=\"xsd:token\">\n * <xsd:enumeration value=\"sm\"/>\n * <xsd:enumeration value=\"med\"/>\n * <xsd:enumeration value=\"lg\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n *\n * @publicApi\n */\nexport const LineEndLength = {\n /** Small length */\n SMALL: \"small\",\n /** MEDIUM length */\n MEDIUM: \"medium\",\n /** Large length */\n LARGE: \"large\",\n} as const;\n\n/**\n * Options for line end (arrow) properties.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_LineEndProperties\">\n * <xsd:attribute name=\"type\" type=\"ST_LineEndType\" use=\"optional\" default=\"none\"/>\n * <xsd:attribute name=\"w\" type=\"ST_LineEndWidth\" use=\"optional\"/>\n * <xsd:attribute name=\"len\" type=\"ST_LineEndLength\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface LineEndOptions {\n /** Arrow/head type */\n type: (typeof LineEndType)[keyof typeof LineEndType];\n /** Arrow width */\n width?: (typeof LineEndWidth)[keyof typeof LineEndWidth];\n /** Arrow length */\n length?: (typeof LineEndLength)[keyof typeof LineEndLength];\n}\n\n/**\n * Creates a line end element (a:headEnd or a:tailEnd).\n *\n * @example\n * ```typescript\n * // Stealth arrow at start, medium size\n * createLineEnd(\"a:headEnd\", { type: \"STEALTH\", width: \"MEDIUM\", length: \"MEDIUM\" });\n * // Triangle arrow at end\n * createLineEnd(\"a:tailEnd\", { type: \"TRIANGLE\" });\n * ```\n */\nexport const createLineEnd = (name: string, options: LineEndOptions): string =>\n element(name, {\n type: options.type,\n w: options.width ? xsdLineEndSize.to(options.width) : undefined,\n len: options.length ? xsdLineEndSize.to(options.length) : undefined,\n });\n","import { element } from \"@office-open/xml\";\n\nimport { convertToEmu } from \"../../util/converters\";\nimport { xsdCompoundLine, xsdLineCap, xsdPenAlignment } from \"../../util/mappings\";\n/**\n * Outline (line) properties for DrawingML shapes.\n *\n * This module provides support for configuring outline properties including\n * width, cap style, compound line types, fill properties, dash, and join.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_LineProperties\n *\n * @module\n */\nimport type { UniversalMeasure } from \"../../util/values\";\nimport { createSolidFill } from \"../color/solid-fill\";\nimport type { SolidFillOptions } from \"../color/solid-fill\";\nimport { createGradientFill } from \"../fill/gradient-fill\";\nimport type { GradientFillOptions } from \"../fill/gradient-fill\";\nimport { createNoFill } from \"../fill/no-fill\";\nimport { createPatternFill } from \"../fill/pattern-fill\";\nimport type { PatternFillOptions } from \"../fill/pattern-fill\";\nimport { createCustomDash } from \"./custom-dash\";\nimport type { DashStop } from \"./custom-dash\";\nimport { createLineEnd } from \"./line-end\";\nimport type { LineEndOptions } from \"./line-end\";\n\n// <xsd:complexType name=\"CT_LineProperties\">\n// <xsd:sequence>\n// <xsd:group ref=\"EG_LineFillProperties\" minOccurs=\"0\"/>\n// <xsd:group ref=\"EG_LineDashProperties\" minOccurs=\"0\"/>\n// <xsd:group ref=\"EG_LineJoinProperties\" minOccurs=\"0\"/>\n// </xsd:sequence>\n// <xsd:attribute name=\"w\" use=\"optional\" type=\"a:ST_LineWidth\"/>\n// <xsd:attribute name=\"cap\" use=\"optional\" type=\"ST_LineCap\"/>\n// <xsd:attribute name=\"cmpd\" use=\"optional\" type=\"ST_CompoundLine\"/>\n// <xsd:attribute name=\"algn\" use=\"optional\" type=\"ST_PenAlignment\"/>\n// </xsd:complexType>\n\n// <xsd:simpleType name=\"ST_LineCap\">\n// <xsd:restriction base=\"xsd:string\">\n// <xsd:enumeration value=\"rnd\"/>\n// <xsd:enumeration value=\"sq\"/>\n// <xsd:enumeration value=\"flat\"/>\n// </xsd:restriction>\n// </xsd:simpleType>\n\n/**\n * Line cap styles for outline endpoints.\n *\n * Defines how the ends of a line are rendered.\n */\nexport const LineCap = {\n /** Round cap style */\n ROUND: \"round\",\n /** Square cap style */\n SQUARE: \"square\",\n /** Flat cap style */\n FLAT: \"flat\",\n} as const;\n\n// <xsd:simpleType name=\"ST_CompoundLine\">\n// <xsd:restriction base=\"xsd:string\">\n// <xsd:enumeration value=\"sng\"/>\n// <xsd:enumeration value=\"dbl\"/>\n// <xsd:enumeration value=\"thickThin\"/>\n// <xsd:enumeration value=\"thinThick\"/>\n// <xsd:enumeration value=\"tri\"/>\n// </xsd:restriction>\n// </xsd:simpleType>\n\n/**\n * Compound line types for outlines.\n *\n * Defines the structure of compound lines (single, double, etc.).\n */\nexport const CompoundLine = {\n /** Single line */\n SINGLE: \"single\",\n /** Double line */\n DOUBLE: \"double\",\n /** Thick-thin double line */\n THICK_THIN: \"thickThin\",\n /** Thin-thick double line */\n THIN_THICK: \"thinThick\",\n /** Triple line */\n TRI: \"triple\",\n} as const;\n\n// <xsd:simpleType name=\"ST_PenAlignment\">\n// <xsd:restriction base=\"xsd:string\">\n// <xsd:enumeration value=\"ctr\"/>\n// <xsd:enumeration value=\"in\"/>\n// </xsd:restriction>\n// </xsd:simpleType>\n\n/**\n * Pen alignment options for outline positioning.\n *\n * Defines how the outline is aligned relative to the shape edge.\n */\nexport const PenAlignment = {\n /** Center alignment */\n CENTER: \"center\",\n /** Inset alignment */\n INSET: \"inside\",\n} as const;\n\n/**\n * Preset dash styles for outlines.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_PresetLineDashVal\">\n * <xsd:restriction base=\"xsd:token\">\n * <xsd:enumeration value=\"solid\"/>\n * <xsd:enumeration value=\"dot\"/>\n * <xsd:enumeration value=\"dash\"/>\n * <xsd:enumeration value=\"lgDash\"/>\n * <xsd:enumeration value=\"dashDot\"/>\n * <xsd:enumeration value=\"lgDashDot\"/>\n * <xsd:enumeration value=\"lgDashDotDot\"/>\n * <xsd:enumeration value=\"sysDash\"/>\n * <xsd:enumeration value=\"sysDot\"/>\n * <xsd:enumeration value=\"sysDashDot\"/>\n * <xsd:enumeration value=\"sysDashDotDot\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n */\nexport const PresetDash = {\n SOLID: \"solid\",\n DOT: \"dot\",\n DASH: \"dash\",\n LG_DASH: \"lgDash\",\n DASH_DOT: \"dashDot\",\n LG_DASH_DOT: \"lgDashDot\",\n LG_DASH_DOT_DOT: \"lgDashDotDot\",\n SYS_DASH: \"sysDash\",\n SYS_DOT: \"sysDot\",\n SYS_DASH_DOT: \"sysDashDot\",\n SYS_DASH_DOT_DOT: \"sysDashDotDot\",\n} as const;\n\n/**\n * Line join styles.\n */\nexport const LineJoin = {\n ROUND: \"round\",\n BEVEL: \"bevel\",\n MITER: \"miter\",\n} as const;\n\n/**\n * Attributes for configuring outline properties.\n */\nexport interface OutlineProperties {\n /** Line width in EMUs (English Metric Units) or universal measure (e.g., \"1pt\", \"2mm\") */\n width?: number | UniversalMeasure;\n /** Line cap style */\n cap?: (typeof LineCap)[keyof typeof LineCap];\n /** Compound line type */\n compoundLine?: (typeof CompoundLine)[keyof typeof CompoundLine];\n /** Pen alignment */\n align?: (typeof PenAlignment)[keyof typeof PenAlignment];\n /**\n * Preset dash style.\n *\n * Mutually exclusive with `customDash` — only one can be specified.\n */\n dash?: (typeof PresetDash)[keyof typeof PresetDash];\n /**\n * Custom dash pattern (list of dash/space stops).\n *\n * Mutually exclusive with `dash` — only one can be specified.\n */\n customDash?: readonly DashStop[];\n /** Line join style */\n join?: (typeof LineJoin)[keyof typeof LineJoin];\n /** Miter limit (only when join is MITER) */\n miterLimit?: number;\n /** Line start arrow/head */\n headEnd?: LineEndOptions;\n /** Line end arrow/tail */\n tailEnd?: LineEndOptions;\n}\n\n/**\n * Fill properties for outline (EG_LineFillProperties).\n *\n * Supports noFill, solidFill, gradFill, and pattFill per XSD.\n * blipFill and grpFill are not applicable to lines.\n */\nexport interface OutlineFillProperties {\n /** Fill type */\n type?: \"noFill\" | \"solidFill\" | \"gradFill\" | \"pattFill\";\n /** Color definition (required when type is \"solidFill\") */\n color?: SolidFillOptions;\n /** Gradient fill options (required when type is \"gradFill\") */\n gradientFill?: GradientFillOptions;\n /** Pattern fill options (required when type is \"pattFill\") */\n patternFill?: PatternFillOptions;\n}\n\n/**\n * Complete outline configuration options.\n *\n * Combines outline attributes with fill properties.\n */\nexport type OutlineOptions = OutlineProperties & OutlineFillProperties;\n\n/**\n * Creates the fill child element for an outline.\n *\n * Returns null when no fill type is specified (OOXML allows outline without fill).\n */\nconst createOutlineFill = (options: OutlineOptions): string | null => {\n if (options.type === \"noFill\") {\n return createNoFill();\n }\n if (options.type === \"solidFill\" && options.color) {\n return createSolidFill(options.color);\n }\n if (options.type === \"gradFill\" && options.gradientFill) {\n return createGradientFill(options.gradientFill);\n }\n if (options.type === \"pattFill\" && options.patternFill) {\n return createPatternFill(options.patternFill);\n }\n return null;\n};\n\n/**\n * Creates an outline element for DrawingML shapes.\n *\n * The outline element specifies the line properties for the shape border,\n * including width, cap style, compound line type, alignment, dash, join, and fill.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_LineProperties\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_FillProperties\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_LineDashProperties\" minOccurs=\"0\"/>\n * <xsd:group ref=\"EG_LineJoinProperties\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"w\" use=\"optional\" type=\"a:ST_LineWidth\"/>\n * <xsd:attribute name=\"cap\" use=\"optional\" type=\"ST_LineCap\"/>\n * <xsd:attribute name=\"cmpd\" use=\"optional\" type=\"ST_CompoundLine\"/>\n * <xsd:attribute name=\"algn\" use=\"optional\" type=\"ST_PenAlignment\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Outline with RGB color and dash\n * const outline = createOutline({\n * width: 9525,\n * type: \"solidFill\",\n * color: { value: \"FF0000\" },\n * dash: \"DASH\",\n * });\n * ```\n */\nexport const createOutline = (options: OutlineOptions): string => {\n const children: string[] = [];\n\n // Fill (optional per OOXML spec)\n const fill = createOutlineFill(options);\n if (fill) {\n children.push(fill);\n }\n\n // Dash (prstDash and custDash are mutually exclusive per XSD choice)\n if (options.customDash !== undefined) {\n children.push(createCustomDash(options.customDash));\n } else if (options.dash !== undefined) {\n children.push(`<a:prstDash val=\"${options.dash}\"/>`);\n }\n\n // Join\n if (options.join !== undefined) {\n if (options.join === \"miter\" && options.miterLimit !== undefined) {\n children.push(`<a:miter lim=\"${options.miterLimit}\"/>`);\n } else {\n children.push(`<a:${options.join}/>`);\n }\n }\n\n // Line end markers (arrows)\n if (options.headEnd) {\n children.push(createLineEnd(\"a:headEnd\", options.headEnd));\n }\n if (options.tailEnd) {\n children.push(createLineEnd(\"a:tailEnd\", options.tailEnd));\n }\n\n return element(\n \"a:ln\",\n {\n algn: options.align ? xsdPenAlignment.to(options.align) : undefined,\n cap: options.cap ? xsdLineCap.to(options.cap) : undefined,\n cmpd: options.compoundLine ? xsdCompoundLine.to(options.compoundLine) : undefined,\n w: options.width !== undefined ? convertToEmu(options.width) : undefined,\n },\n children,\n );\n};\n","/**\n * Fill overlay effect for DrawingML shapes.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_FillOverlayEffect\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport { xsdBlendMode } from \"../../util/mappings\";\nimport { createSolidFill } from \"../color/solid-fill\";\nimport type { SolidFillOptions } from \"../color/solid-fill\";\nimport { createGradientFill } from \"../fill/gradient-fill\";\nimport type { GradientFillOptions } from \"../fill/gradient-fill\";\nimport { createGroupFill } from \"../fill/group-fill\";\nimport { createNoFill } from \"../fill/no-fill\";\nimport { createPatternFill } from \"../fill/pattern-fill\";\nimport type { PatternFillOptions } from \"../fill/pattern-fill\";\n\n/**\n * Blend modes for fill overlay effect.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_BlendMode\">\n * <xsd:restriction base=\"xsd:token\">\n * <xsd:enumeration value=\"over\"/>\n * <xsd:enumeration value=\"mult\"/>\n * <xsd:enumeration value=\"screen\"/>\n * <xsd:enumeration value=\"darken\"/>\n * <xsd:enumeration value=\"lighten\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n */\nexport const BlendMode = {\n /** Over blend mode */\n OVER: \"over\",\n /** Multiply blend mode */\n MULTIPLY: \"multiply\",\n /** Screen blend mode */\n SCREEN: \"screen\",\n /** Darken blend mode */\n DARKEN: \"darken\",\n /** Lighten blend mode */\n LIGHTEN: \"lighten\",\n} as const;\n\n/**\n * Options for fill overlay effect.\n */\nexport interface FillOverlayEffectOptions {\n /** Blend mode (required) */\n blend: (typeof BlendMode)[keyof typeof BlendMode];\n /** Solid fill color */\n solidFill?: SolidFillOptions;\n /** Gradient fill */\n gradientFill?: GradientFillOptions;\n /** Pattern fill */\n patternFill?: PatternFillOptions;\n /** Group fill (inherit from parent) */\n groupFill?: boolean;\n /** No fill */\n noFill?: boolean;\n}\n\n/**\n * Creates a fill overlay effect element.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_FillOverlayEffect\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_FillProperties\" minOccurs=\"1\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"blend\" type=\"ST_BlendMode\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Solid fill overlay\n * const fillOverlay = createFillOverlayEffect({\n * blend: BlendMode.MULTIPLY,\n * solidFill: { value: \"FF0000\" },\n * });\n *\n * // Gradient fill overlay\n * const fillOverlay = createFillOverlayEffect({\n * blend: BlendMode.SCREEN,\n * gradientFill: { type: \"linear\", stops: [...] },\n * });\n * ```\n */\nexport const createFillOverlayEffect = (options: FillOverlayEffectOptions): string => {\n let fillElement: string;\n\n if (options.noFill) {\n fillElement = createNoFill();\n } else if (options.solidFill) {\n fillElement = createSolidFill(options.solidFill);\n } else if (options.gradientFill) {\n fillElement = createGradientFill(options.gradientFill);\n } else if (options.patternFill) {\n fillElement = createPatternFill(options.patternFill);\n } else if (options.groupFill) {\n fillElement = createGroupFill();\n } else {\n // Default to solid fill if nothing specified\n fillElement = createSolidFill({ value: \"000000\" });\n }\n\n return element(\"a:fillOverlay\", { blend: xsdBlendMode.to(options.blend) }, [fillElement]);\n};\n","/**\n * Glow effect for DrawingML shapes.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_GlowEffect\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport { createColorElement } from \"../color/solid-fill\";\nimport type { SolidFillOptions } from \"../color/solid-fill\";\n\n/**\n * Options for glow effect.\n */\nexport interface GlowEffectOptions {\n /** Glow radius in EMUs */\n radius?: number;\n /** Glow color */\n color: SolidFillOptions;\n}\n\n/**\n * Creates a glow effect element.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_GlowEffect\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_ColorChoice\" minOccurs=\"1\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"rad\" type=\"ST_PositiveCoordinate\" use=\"optional\" default=\"0\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createGlowEffect = (options: GlowEffectOptions): string => {\n const colorChild = createColorElement(options.color);\n if (options.radius === undefined) {\n return element(\"a:glow\", undefined, [colorChild]);\n }\n\n return element(\"a:glow\", { rad: options.radius }, [colorChild]);\n};\n","/**\n * Inner shadow effect for DrawingML shapes.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_InnerShadowEffect\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport { createColorElement } from \"../color/solid-fill\";\nimport type { SolidFillOptions } from \"../color/solid-fill\";\n\n/**\n * Options for inner shadow effect.\n */\nexport interface InnerShadowEffectOptions {\n /** Blur radius in EMUs */\n blurRadius?: number;\n /** Distance from shape edge in EMUs */\n distance?: number;\n /** Direction angle in 60,000ths of a degree */\n direction?: number;\n /** Shadow color */\n color: SolidFillOptions;\n}\n\n/**\n * Creates an inner shadow effect element.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_InnerShadowEffect\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_ColorChoice\" minOccurs=\"1\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"blurRad\" type=\"ST_PositiveCoordinate\" default=\"0\"/>\n * <xsd:attribute name=\"dist\" type=\"ST_PositiveCoordinate\" default=\"0\"/>\n * <xsd:attribute name=\"dir\" type=\"ST_PositiveFixedAngle\" default=\"0\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createInnerShadowEffect = (options: InnerShadowEffectOptions): string => {\n const colorChild = createColorElement(options.color);\n\n const attrs: Record<string, number> = {};\n if (options.blurRadius !== undefined) attrs.blurRad = options.blurRadius;\n if (options.distance !== undefined) attrs.dist = options.distance;\n if (options.direction !== undefined) attrs.dir = options.direction;\n\n const hasAttributes = Object.keys(attrs).length > 0;\n\n return element(\"a:innerShdw\", hasAttributes ? attrs : undefined, [colorChild]);\n};\n","/**\n * Outer shadow effect for DrawingML shapes.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_OuterShadowEffect\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport { xsdRectAlignment } from \"../../util/mappings\";\nimport { createColorElement } from \"../color/solid-fill\";\nimport type { SolidFillOptions } from \"../color/solid-fill\";\n\n/**\n * Rectangle alignment for shadow positioning.\n */\nexport const RectAlignment = {\n TOP_LEFT: \"topLeft\",\n TOP: \"top\",\n TOP_RIGHT: \"topRight\",\n LEFT: \"left\",\n CENTER: \"center\",\n RIGHT: \"right\",\n BOTTOM_LEFT: \"bottomLeft\",\n BOTTOM: \"bottom\",\n BOTTOM_RIGHT: \"bottomRight\",\n} as const;\n\n/**\n * Options for outer shadow effect.\n */\nexport interface OuterShadowEffectOptions {\n /** Blur radius in EMUs */\n blurRadius?: number;\n /** Distance from shape in EMUs */\n distance?: number;\n /** Direction angle in 60,000ths of a degree */\n direction?: number;\n /** Horizontal scale percentage (e.g., 100000 = 100%) */\n scaleX?: number;\n /** Vertical scale percentage */\n scaleY?: number;\n /** Horizontal skew angle in 60,000ths of a degree */\n skewX?: number;\n /** Vertical skew angle */\n skewY?: number;\n /** Shadow alignment */\n alignment?: (typeof RectAlignment)[keyof typeof RectAlignment];\n /** Whether shadow rotates with shape */\n rotWithShape?: boolean;\n /** Shadow color */\n color: SolidFillOptions;\n}\n\n/**\n * Creates an outer shadow effect element.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_OuterShadowEffect\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_ColorChoice\" minOccurs=\"1\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"blurRad\" type=\"ST_PositiveCoordinate\" default=\"0\"/>\n * <xsd:attribute name=\"dist\" type=\"ST_PositiveCoordinate\" default=\"0\"/>\n * <xsd:attribute name=\"dir\" type=\"ST_PositiveFixedAngle\" default=\"0\"/>\n * <xsd:attribute name=\"sx\" type=\"ST_Percentage\" default=\"100%\"/>\n * <xsd:attribute name=\"sy\" type=\"ST_Percentage\" default=\"100%\"/>\n * <xsd:attribute name=\"kx\" type=\"ST_FixedAngle\" default=\"0\"/>\n * <xsd:attribute name=\"ky\" type=\"ST_FixedAngle\" default=\"0\"/>\n * <xsd:attribute name=\"algn\" type=\"ST_RectAlignment\" default=\"b\"/>\n * <xsd:attribute name=\"rotWithShape\" type=\"xsd:boolean\" default=\"true\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createOuterShadowEffect = (options: OuterShadowEffectOptions): string => {\n const attrs: Record<string, string | number> = {};\n\n if (options.blurRadius !== undefined) attrs.blurRad = options.blurRadius;\n if (options.distance !== undefined) attrs.dist = options.distance;\n if (options.direction !== undefined) attrs.dir = options.direction;\n if (options.scaleX !== undefined) attrs.sx = options.scaleX;\n if (options.scaleY !== undefined) attrs.sy = options.scaleY;\n if (options.skewX !== undefined) attrs.kx = options.skewX;\n if (options.skewY !== undefined) attrs.ky = options.skewY;\n if (options.alignment !== undefined) attrs.algn = xsdRectAlignment.to(options.alignment);\n if (options.rotWithShape === false) attrs.rotWithShape = 0;\n\n return element(\"a:outerShdw\", attrs, [createColorElement(options.color)]);\n};\n","/**\n * Preset shadow effect for DrawingML shapes.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_PresetShadowEffect\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport { xsdPresetShadow } from \"../../util/mappings\";\nimport { createColorElement } from \"../color/solid-fill\";\nimport type { SolidFillOptions } from \"../color/solid-fill\";\n\n/**\n * Preset shadow types (20 variations).\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, ST_PresetShadowVal\n */\nexport const PresetShadowVal = {\n SHDW1: \"shadow1\",\n SHDW2: \"shadow2\",\n SHDW3: \"shadow3\",\n SHDW4: \"shadow4\",\n SHDW5: \"shadow5\",\n SHDW6: \"shadow6\",\n SHDW7: \"shadow7\",\n SHDW8: \"shadow8\",\n SHDW9: \"shadow9\",\n SHDW10: \"shadow10\",\n SHDW11: \"shadow11\",\n SHDW12: \"shadow12\",\n SHDW13: \"shadow13\",\n SHDW14: \"shadow14\",\n SHDW15: \"shadow15\",\n SHDW16: \"shadow16\",\n SHDW17: \"shadow17\",\n SHDW18: \"shadow18\",\n SHDW19: \"shadow19\",\n SHDW20: \"shadow20\",\n} as const;\n\n/**\n * Options for preset shadow effect.\n */\nexport interface PresetShadowEffectOptions {\n /** Preset shadow type (required) */\n preset: (typeof PresetShadowVal)[keyof typeof PresetShadowVal];\n /** Distance from shape in EMUs */\n distance?: number;\n /** Direction angle in 60,000ths of a degree */\n direction?: number;\n /** Shadow color */\n color: SolidFillOptions;\n}\n\n/**\n * Creates a preset shadow effect element.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_PresetShadowEffect\">\n * <xsd:sequence>\n * <xsd:group ref=\"EG_ColorChoice\" minOccurs=\"1\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"prst\" type=\"ST_PresetShadowVal\" use=\"required\"/>\n * <xsd:attribute name=\"dist\" type=\"ST_PositiveCoordinate\" default=\"0\"/>\n * <xsd:attribute name=\"dir\" type=\"ST_PositiveFixedAngle\" default=\"0\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createPresetShadowEffect = (options: PresetShadowEffectOptions): string => {\n const attrs: Record<string, string | number> = {\n prst: xsdPresetShadow.to(options.preset),\n };\n\n if (options.distance !== undefined) attrs.dist = options.distance;\n if (options.direction !== undefined) attrs.dir = options.direction;\n\n return element(\"a:prstShdw\", attrs, [createColorElement(options.color)]);\n};\n","/**\n * Reflection effect for DrawingML shapes.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_ReflectionEffect\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport { xsdRectAlignment } from \"../../util/mappings\";\n\n/**\n * Options for reflection effect.\n *\n * All properties are optional with XSD defaults.\n */\nexport interface ReflectionEffectOptions {\n /** Blur radius in EMUs */\n blurRadius?: number;\n /** Start opacity (fixed percentage, e.g., 100000 = 100%) */\n startAlpha?: number;\n /** Start position (fixed percentage) */\n startPosition?: number;\n /** End opacity (fixed percentage) */\n endAlpha?: number;\n /** End position (fixed percentage) */\n endPosition?: number;\n /** Distance from shape in EMUs */\n distance?: number;\n /** Direction angle in 60,000ths of a degree */\n direction?: number;\n /** Fade direction angle in 60,000ths of a degree */\n fadeDirection?: number;\n /** Horizontal scale percentage */\n scaleX?: number;\n /** Vertical scale percentage */\n scaleY?: number;\n /** Horizontal skew angle */\n skewX?: number;\n /** Vertical skew angle */\n skewY?: number;\n /** Alignment */\n alignment?: string;\n /** Whether reflection rotates with shape */\n rotWithShape?: boolean;\n}\n\n/**\n * Creates a reflection effect element.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_ReflectionEffect\">\n * <xsd:attribute name=\"blurRad\" type=\"ST_PositiveCoordinate\" default=\"0\"/>\n * <xsd:attribute name=\"stA\" type=\"ST_PositiveFixedPercentage\" default=\"100%\"/>\n * <xsd:attribute name=\"stPos\" type=\"ST_PositiveFixedPercentage\" default=\"0%\"/>\n * <xsd:attribute name=\"endA\" type=\"ST_PositiveFixedPercentage\" default=\"0%\"/>\n * <xsd:attribute name=\"endPos\" type=\"ST_PositiveFixedPercentage\" default=\"100%\"/>\n * <xsd:attribute name=\"dist\" type=\"ST_PositiveCoordinate\" default=\"0\"/>\n * <xsd:attribute name=\"dir\" type=\"ST_PositiveFixedAngle\" default=\"0\"/>\n * <xsd:attribute name=\"fadeDir\" type=\"ST_PositiveFixedAngle\" default=\"5400000\"/>\n * <xsd:attribute name=\"sx\" type=\"ST_Percentage\" default=\"100%\"/>\n * <xsd:attribute name=\"sy\" type=\"ST_Percentage\" default=\"100%\"/>\n * <xsd:attribute name=\"kx\" type=\"ST_FixedAngle\" default=\"0\"/>\n * <xsd:attribute name=\"ky\" type=\"ST_FixedAngle\" default=\"0\"/>\n * <xsd:attribute name=\"algn\" type=\"ST_RectAlignment\" default=\"b\"/>\n * <xsd:attribute name=\"rotWithShape\" type=\"xsd:boolean\" default=\"true\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createReflectionEffect = (options?: ReflectionEffectOptions): string => {\n if (!options) {\n return \"<a:reflection/>\";\n }\n\n const attrs: Record<string, string | number> = {};\n\n if (options.blurRadius !== undefined) attrs.blurRad = options.blurRadius;\n if (options.startAlpha !== undefined) attrs.stA = options.startAlpha;\n if (options.startPosition !== undefined) attrs.stPos = options.startPosition;\n if (options.endAlpha !== undefined) attrs.endA = options.endAlpha;\n if (options.endPosition !== undefined) attrs.endPos = options.endPosition;\n if (options.distance !== undefined) attrs.dist = options.distance;\n if (options.direction !== undefined) attrs.dir = options.direction;\n if (options.fadeDirection !== undefined) attrs.fadeDir = options.fadeDirection;\n if (options.scaleX !== undefined) attrs.sx = options.scaleX;\n if (options.scaleY !== undefined) attrs.sy = options.scaleY;\n if (options.skewX !== undefined) attrs.kx = options.skewX;\n if (options.skewY !== undefined) attrs.ky = options.skewY;\n if (options.alignment !== undefined) attrs.algn = xsdRectAlignment.to(options.alignment);\n if (options.rotWithShape === false) attrs.rotWithShape = 0;\n\n return element(\"a:reflection\", attrs);\n};\n","/**\n * Soft edge effect for DrawingML shapes.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_SoftEdgesEffect\n *\n * @module\n */\n\n/**\n * Creates a soft edge effect element.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SoftEdgesEffect\">\n * <xsd:attribute name=\"rad\" type=\"ST_PositiveCoordinate\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * @param rad - Soft edge radius in EMUs (required)\n */\nexport const createSoftEdgeEffect = (rad: number): string => `<a:softEdge rad=\"${rad}\"/>`;\n","/**\n * Effect list container for DrawingML shapes.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_EffectList, EG_EffectProperties\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport type { FillOverlayEffectOptions } from \"./fill-overlay\";\nimport { createFillOverlayEffect } from \"./fill-overlay\";\nimport type { GlowEffectOptions } from \"./glow\";\nimport { createGlowEffect } from \"./glow\";\nimport type { InnerShadowEffectOptions } from \"./inner-shadow\";\nimport { createInnerShadowEffect } from \"./inner-shadow\";\nimport type { OuterShadowEffectOptions } from \"./outer-shadow\";\nimport { createOuterShadowEffect } from \"./outer-shadow\";\nimport type { PresetShadowEffectOptions } from \"./preset-shadow\";\nimport { createPresetShadowEffect } from \"./preset-shadow\";\nimport type { ReflectionEffectOptions } from \"./reflection\";\nimport { createReflectionEffect } from \"./reflection\";\nimport { createSoftEdgeEffect } from \"./soft-edge\";\n\n/**\n * Effect extent calculation result.\n * Represents the additional space needed on each edge (in EMUs).\n */\nexport interface EffectExtent {\n /** Left edge extension */\n l: number;\n /** Top edge extension */\n t: number;\n /** Right edge extension */\n r: number;\n /** Bottom edge extension */\n b: number;\n}\n\n/**\n * Calculates the effect extent for a given set of effects.\n *\n * The effectExtent specifies the additional extent which shall be added to each edge\n * of the image (top, bottom, left, right) in order to compensate for any drawing effects\n * applied to the DrawingML object.\n *\n * Reference: CT_EffectExtent in dml-wordprocessingDrawing.xsd\n *\n * @param options - Effect list options\n * @returns The calculated effect extent in EMUs\n */\nexport const calculateEffectExtent = (options?: EffectListOptions): EffectExtent => {\n if (!options) {\n return { l: 0, t: 0, r: 0, b: 0 };\n }\n\n let l = 0,\n t = 0,\n r = 0,\n b = 0;\n\n // Outer shadow: distance + blurRadius extends in the shadow direction\n if (options.outerShadow) {\n const dist = options.outerShadow.distance ?? 0;\n const blur = options.outerShadow.blurRadius ?? 0;\n const dir = options.outerShadow.direction ?? 0;\n\n // Direction is in 60,000ths of a degree, convert to radians\n const radians = (dir / 60000) * (Math.PI / 180);\n const dx = Math.cos(radians) * dist;\n const dy = Math.sin(radians) * dist;\n\n // Shadow extends in direction + blur radius in all directions\n const extend = Math.abs(dx) + blur;\n const extendY = Math.abs(dy) + blur;\n\n if (dx > 0) r = Math.max(r, extend);\n else l = Math.max(l, extend);\n\n if (dy > 0) b = Math.max(b, extendY);\n else t = Math.max(t, extendY);\n }\n\n // Glow: radius extends equally in all directions\n if (options.glow) {\n const radius = options.glow.radius ?? 0;\n l = Math.max(l, radius);\n t = Math.max(t, radius);\n r = Math.max(r, radius);\n b = Math.max(b, radius);\n }\n\n // Reflection: typically extends downward\n if (options.reflection && options.reflection !== true) {\n const dist = options.reflection.distance ?? 0;\n const blur = options.reflection.blurRadius ?? 0;\n // Reflection typically extends downward\n b = Math.max(b, dist + blur);\n }\n\n // Soft edge: radius extends equally in all directions\n if (options.softEdge !== undefined) {\n l = Math.max(l, options.softEdge);\n t = Math.max(t, options.softEdge);\n r = Math.max(r, options.softEdge);\n b = Math.max(b, options.softEdge);\n }\n\n // EMU coordinates must be integers (ST_Coordinate); the cos/sin projections\n // above produce floats, so round before emitting.\n return { l: Math.round(l), t: Math.round(t), r: Math.round(r), b: Math.round(b) };\n};\n\n/**\n * Blur effect options.\n */\nexport interface BlurEffectOptions {\n /** Blur radius in EMUs */\n radius?: number;\n /** Whether to grow the shape boundary */\n grow?: boolean;\n}\n\n/**\n * Options for the effect list container.\n *\n * Each property corresponds to an optional child effect element.\n * Only specified effects will be included in the output.\n */\nexport interface EffectListOptions {\n /** Blur effect */\n blur?: BlurEffectOptions;\n /** Fill overlay effect */\n fillOverlay?: FillOverlayEffectOptions;\n /** Glow effect */\n glow?: GlowEffectOptions;\n /** Inner shadow effect */\n innerShadow?: InnerShadowEffectOptions;\n /** Outer shadow effect */\n outerShadow?: OuterShadowEffectOptions;\n /** Preset shadow effect */\n presetShadow?: PresetShadowEffectOptions;\n /** Reflection effect (pass object for attributes, or true for defaults) */\n reflection?: ReflectionEffectOptions | true;\n /** Soft edge radius in EMUs */\n softEdge?: number;\n}\n\n/**\n * Creates a blur effect element.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_BlurEffect\">\n * <xsd:attribute name=\"rad\" type=\"ST_PositiveCoordinate\" default=\"0\"/>\n * <xsd:attribute name=\"grow\" type=\"xsd:boolean\" default=\"true\"/>\n * </xsd:complexType>\n * ```\n */\nconst createBlurEffect = (options: BlurEffectOptions): string => {\n const attrs: Record<string, number> = {};\n if (options.radius !== undefined) attrs.rad = options.radius;\n if (options.grow === false) attrs.grow = 0;\n\n return Object.keys(attrs).length > 0 ? element(\"a:blur\", attrs) : element(\"a:blur\");\n};\n\n/**\n * Creates an effect list element (a:effectLst).\n *\n * This is the EG_EffectProperties choice for a flat list of effects.\n * Effects are emitted in XSD order: blur, glow, innerShdw, outerShdw, prstShdw, reflection, softEdge.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_EffectList\">\n * <xsd:sequence>\n * <xsd:element name=\"blur\" type=\"CT_BlurEffect\" minOccurs=\"0\"/>\n * <xsd:element name=\"fillOverlay\" type=\"CT_FillOverlayEffect\" minOccurs=\"0\"/>\n * <xsd:element name=\"glow\" type=\"CT_GlowEffect\" minOccurs=\"0\"/>\n * <xsd:element name=\"innerShdw\" type=\"CT_InnerShadowEffect\" minOccurs=\"0\"/>\n * <xsd:element name=\"outerShdw\" type=\"CT_OuterShadowEffect\" minOccurs=\"0\"/>\n * <xsd:element name=\"prstShdw\" type=\"CT_PresetShadowEffect\" minOccurs=\"0\"/>\n * <xsd:element name=\"reflection\" type=\"CT_ReflectionEffect\" minOccurs=\"0\"/>\n * <xsd:element name=\"softEdge\" type=\"CT_SoftEdgesEffect\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createEffectList = (options: EffectListOptions): string => {\n const children: string[] = [];\n\n if (options.blur) {\n children.push(createBlurEffect(options.blur));\n }\n if (options.fillOverlay) {\n children.push(createFillOverlayEffect(options.fillOverlay));\n }\n if (options.glow) {\n children.push(createGlowEffect(options.glow));\n }\n if (options.innerShadow) {\n children.push(createInnerShadowEffect(options.innerShadow));\n }\n if (options.outerShadow) {\n children.push(createOuterShadowEffect(options.outerShadow));\n }\n if (options.presetShadow) {\n children.push(createPresetShadowEffect(options.presetShadow));\n }\n if (options.reflection) {\n children.push(\n createReflectionEffect(options.reflection === true ? undefined : options.reflection),\n );\n }\n if (options.softEdge !== undefined) {\n children.push(createSoftEdgeEffect(options.softEdge));\n }\n\n return element(\"a:effectLst\", undefined, children);\n};\n","/**\n * Effect container (effectDag) for DrawingML shapes.\n *\n * Provides CT_EffectContainer — a directed acyclic graph (DAG) of effects\n * supporting 28 effect types including alpha/color operations, nested containers,\n * and all effects from CT_EffectList.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_EffectContainer, EG_Effect\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport { xsdBlendMode, xsdEffectContainer } from \"../../util/mappings\";\nimport { createSolidFill } from \"../color/solid-fill\";\nimport type { SolidFillOptions } from \"../color/solid-fill\";\nimport { createColorElement } from \"../color/solid-fill\";\nimport { createGradientFill } from \"../fill/gradient-fill\";\nimport type { GradientFillOptions } from \"../fill/gradient-fill\";\nimport { createGroupFill } from \"../fill/group-fill\";\nimport { createNoFill } from \"../fill/no-fill\";\nimport { createPatternFill } from \"../fill/pattern-fill\";\nimport type { PatternFillOptions } from \"../fill/pattern-fill\";\nimport type { BlurEffectOptions } from \"./effect-list\";\nimport type { FillOverlayEffectOptions } from \"./fill-overlay\";\nimport { BlendMode } from \"./fill-overlay\";\nimport { createFillOverlayEffect } from \"./fill-overlay\";\nimport type { GlowEffectOptions } from \"./glow\";\nimport { createGlowEffect } from \"./glow\";\nimport type { InnerShadowEffectOptions } from \"./inner-shadow\";\nimport { createInnerShadowEffect } from \"./inner-shadow\";\nimport type { OuterShadowEffectOptions } from \"./outer-shadow\";\nimport { createOuterShadowEffect } from \"./outer-shadow\";\nimport type { PresetShadowEffectOptions } from \"./preset-shadow\";\nimport { createPresetShadowEffect } from \"./preset-shadow\";\nimport type { ReflectionEffectOptions } from \"./reflection\";\nimport { createReflectionEffect } from \"./reflection\";\nimport { createSoftEdgeEffect } from \"./soft-edge\";\n\n// ─── Effect Container Type ──────────────────────────────────────────────────\n\n/**\n * Effect container type (ST_EffectContainerType).\n *\n * Controls how child effects are combined:\n * - `sib`: sibling effects are applied in parallel\n * - `tree`: effects are applied sequentially in tree order\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_EffectContainerType\">\n * <xsd:restriction base=\"xsd:token\">\n * <xsd:enumeration value=\"sib\"/>\n * <xsd:enumeration value=\"tree\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n */\nexport const EffectContainerType = {\n SIB: \"sibling\",\n TREE: \"tree\",\n} as const;\n\n// ─── New Effect Options ─────────────────────────────────────────────────────\n\n/** Alpha bi-level effect — clips alpha to threshold (CT_AlphaBiLevelEffect). */\nexport interface AlphaBiLevelEffectOptions {\n /** Alpha threshold (fixed percentage, required) */\n threshold: number;\n}\n\n/** Alpha inverse effect — inverts alpha, optionally with color (CT_AlphaInverseEffect). */\nexport interface AlphaInverseEffectOptions {\n /** Optional color to apply inverse to */\n color?: SolidFillOptions;\n}\n\n/** Alpha modulate fixed effect (CT_AlphaModulateFixedEffect). */\nexport interface AlphaModulateFixedEffectOptions {\n /** Amount percentage (default 100%) */\n amount?: number;\n}\n\n/** Alpha outset effect (CT_AlphaOutsetEffect). */\nexport interface AlphaOutsetEffectOptions {\n /** Outset radius */\n radius?: number;\n}\n\n/** Alpha replace effect — replaces alpha value (CT_AlphaReplaceEffect). */\nexport interface AlphaReplaceEffectOptions {\n /** New alpha value (fixed percentage, required) */\n alpha: number;\n}\n\n/** Blend effect — blends with nested container (CT_BlendEffect). */\nexport interface BlendEffectOptions {\n /** Blend mode (required) */\n blend: (typeof BlendMode)[keyof typeof BlendMode];\n /** Nested effect container */\n container: EffectDagOptions;\n}\n\n/** Color change effect — maps one color to another (CT_ColorChangeEffect). */\nexport interface ColorChangeEffectOptions {\n /** Source color to replace */\n from: SolidFillOptions;\n /** Target color */\n to: SolidFillOptions;\n /** Whether to use alpha channel (default true) */\n useA?: boolean;\n}\n\n/** Duotone effect — two-color tone mapping (CT_DuotoneEffect). */\nexport interface DuotoneEffectOptions {\n /** First color */\n color1: SolidFillOptions;\n /** Second color */\n color2: SolidFillOptions;\n}\n\n/** Fill effect — applies a fill as an effect (CT_FillEffect). */\nexport interface FillEffectOptions {\n /** Solid fill */\n solidFill?: SolidFillOptions;\n /** Gradient fill */\n gradientFill?: GradientFillOptions;\n /** Pattern fill */\n patternFill?: PatternFillOptions;\n /** Group fill (inherit from parent) */\n groupFill?: boolean;\n /** No fill */\n noFill?: boolean;\n}\n\n/** HSL effect — adjusts hue, saturation, luminance (CT_HSLEffect). */\nexport interface HSLEffectOptions {\n /** Hue angle in 60,000ths of a degree (default 0) */\n hue?: number;\n /** Saturation percentage (default 0%) */\n saturation?: number;\n /** Luminance percentage (default 0%) */\n luminance?: number;\n}\n\n/** Luminance effect — adjusts brightness and contrast (CT_LuminanceEffect). */\nexport interface LuminanceEffectOptions {\n /** Brightness percentage (default 0%) */\n bright?: number;\n /** Contrast percentage (default 0%) */\n contrast?: number;\n}\n\n/** Tint effect — applies tint with hue and amount (CT_TintEffect). */\nexport interface TintEffectOptions {\n /** Hue angle in 60,000ths of a degree (default 0) */\n hue?: number;\n /** Tint amount percentage (default 0%) */\n amount?: number;\n}\n\n/** Relative offset effect (CT_RelativeOffsetEffect). */\nexport interface RelativeOffsetEffectOptions {\n /** Horizontal offset percentage (default 0%) */\n translateX?: number;\n /** Vertical offset percentage (default 0%) */\n translateY?: number;\n}\n\n/** Transform effect — scale, skew, translate (CT_TransformEffect). */\nexport interface TransformEffectOptions {\n /** Horizontal scale percentage (default 100%) */\n scaleX?: number;\n /** Vertical scale percentage (default 100%) */\n scaleY?: number;\n /** Horizontal skew angle (default 0) */\n skewX?: number;\n /** Vertical skew angle (default 0) */\n skewY?: number;\n /** Horizontal translation */\n translateX?: number;\n /** Vertical translation */\n translateY?: number;\n}\n\n/** Effect reference — references an effect by ID (CT_EffectReference). */\nexport interface EffectReferenceOptions {\n /** Reference ID (required) */\n ref: string;\n}\n\n// ─── Effect Container Options ───────────────────────────────────────────────\n\n/**\n * Options for an effect container (CT_EffectContainer).\n *\n * Supports all 28 effect types from EG_Effect, including recursive nesting.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_EffectContainer\">\n * <xsd:group ref=\"EG_Effect\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <xsd:attribute name=\"type\" type=\"ST_EffectContainerType\" default=\"sib\"/>\n * <xsd:attribute name=\"name\" type=\"xsd:token\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface EffectDagOptions {\n /** Container type: \"sib\" (parallel) or \"tree\" (sequential) */\n type?: (typeof EffectContainerType)[keyof typeof EffectContainerType];\n /** Container name */\n name?: string;\n\n // ── Existing effects (also in CT_EffectList) ──\n blur?: BlurEffectOptions;\n fillOverlay?: FillOverlayEffectOptions;\n glow?: GlowEffectOptions;\n innerShadow?: InnerShadowEffectOptions;\n outerShadow?: OuterShadowEffectOptions;\n presetShadow?: PresetShadowEffectOptions;\n reflection?: ReflectionEffectOptions | true;\n softEdge?: number;\n\n // ── New effects for CT_EffectContainer ──\n /** Nested effect containers */\n containers?: readonly EffectDagOptions[];\n /** Effect references */\n effectRefs?: readonly EffectReferenceOptions[];\n /** Alpha bi-level effect */\n alphaBiLevel?: AlphaBiLevelEffectOptions;\n /** Alpha ceiling effect (empty element) */\n alphaCeiling?: boolean;\n /** Alpha floor effect (empty element) */\n alphaFloor?: boolean;\n /** Alpha inverse effect */\n alphaInverse?: AlphaInverseEffectOptions;\n /** Alpha modulate effect (requires nested container) */\n alphaModulate?: EffectDagOptions;\n /** Alpha modulate fixed effect */\n alphaModulateFixed?: AlphaModulateFixedEffectOptions;\n /** Alpha outset effect */\n alphaOutset?: AlphaOutsetEffectOptions;\n /** Alpha replace effect */\n alphaReplace?: AlphaReplaceEffectOptions;\n /** Bi-level effect (threshold) */\n biLevel?: { threshold: number };\n /** Blend effect (requires nested container) */\n blend?: BlendEffectOptions;\n /** Color change effect */\n colorChange?: ColorChangeEffectOptions;\n /** Color replace effect */\n colorReplace?: SolidFillOptions;\n /** Duotone effect */\n duotone?: DuotoneEffectOptions;\n /** Fill effect */\n fill?: FillEffectOptions;\n /** Grayscale effect (empty element) */\n grayscale?: boolean;\n /** HSL effect */\n hsl?: HSLEffectOptions;\n /** Luminance effect */\n luminance?: LuminanceEffectOptions;\n /** Tint effect */\n tint?: TintEffectOptions;\n /** Relative offset effect */\n relativeOffset?: RelativeOffsetEffectOptions;\n /** Transform effect */\n transform?: TransformEffectOptions;\n}\n\n// ─── New Effect Factories ───────────────────────────────────────────────────\n\nconst createAlphaBiLevelEffect = (options: AlphaBiLevelEffectOptions): string =>\n `<a:alphaBiLevel thresh=\"${options.threshold}\"/>`;\n\nconst createAlphaCeilingEffect = (): string => \"<a:alphaCeiling/>\";\n\nconst createAlphaFloorEffect = (): string => \"<a:alphaFloor/>\";\n\nconst createAlphaInverseEffect = (options?: AlphaInverseEffectOptions): string =>\n element(\n \"a:alphaInv\",\n undefined,\n options?.color ? [createColorElement(options.color)] : undefined,\n );\n\nconst createAlphaModulateFixedEffect = (options?: AlphaModulateFixedEffectOptions): string =>\n options?.amount === undefined ? \"<a:alphaModFix/>\" : `<a:alphaModFix amt=\"${options.amount}\"/>`;\n\nconst createAlphaOutsetEffect = (options?: AlphaOutsetEffectOptions): string =>\n options?.radius === undefined ? \"<a:alphaOutset/>\" : `<a:alphaOutset rad=\"${options.radius}\"/>`;\n\nconst createAlphaReplaceEffect = (options: AlphaReplaceEffectOptions): string =>\n `<a:alphaRepl a=\"${options.alpha}\"/>`;\n\nconst createBiLevelEffect = (thresh: number): string => `<a:biLevel thresh=\"${thresh}\"/>`;\n\nconst createBlendEffect = (options: BlendEffectOptions): string =>\n element(\"a:blend\", { blend: xsdBlendMode.to(options.blend) }, [\n createEffectContainer(options.container),\n ]);\n\nconst createColorChangeEffect = (options: ColorChangeEffectOptions): string => {\n const children: string[] = [\n element(\"a:clrFrom\", undefined, [createColorElement(options.from)]),\n element(\"a:clrTo\", undefined, [createColorElement(options.to)]),\n ];\n\n if (options.useA === false) {\n return element(\"a:clrChange\", { useA: 0 }, children);\n }\n\n return element(\"a:clrChange\", undefined, children);\n};\n\nconst createColorReplaceEffect = (color: SolidFillOptions): string =>\n element(\"a:clrRepl\", undefined, [createColorElement(color)]);\n\nconst createDuotoneEffect = (options: DuotoneEffectOptions): string =>\n element(\"a:duotone\", undefined, [\n createColorElement(options.color1),\n createColorElement(options.color2),\n ]);\n\nconst createFillEffect = (options: FillEffectOptions): string => {\n let fillElement: string;\n\n if (options.noFill) {\n fillElement = createNoFill();\n } else if (options.solidFill) {\n fillElement = createSolidFill(options.solidFill);\n } else if (options.gradientFill) {\n fillElement = createGradientFill(options.gradientFill);\n } else if (options.patternFill) {\n fillElement = createPatternFill(options.patternFill);\n } else if (options.groupFill) {\n fillElement = createGroupFill();\n } else {\n fillElement = createNoFill();\n }\n\n return element(\"a:fill\", undefined, [fillElement]);\n};\n\nconst createGrayscaleEffect = (): string => \"<a:grayscl/>\";\n\nconst createHSLEffect = (options?: HSLEffectOptions): string => {\n const attrs: Record<string, number> = {};\n if (options?.hue !== undefined) attrs.hue = options.hue;\n if (options?.saturation !== undefined) attrs.sat = options.saturation;\n if (options?.luminance !== undefined) attrs.lum = options.luminance;\n return element(\"a:hsl\", Object.keys(attrs).length > 0 ? attrs : undefined);\n};\n\nconst createLuminanceEffect = (options?: LuminanceEffectOptions): string => {\n const attrs: Record<string, number> = {};\n if (options?.bright !== undefined) attrs.bright = options.bright;\n if (options?.contrast !== undefined) attrs.contrast = options.contrast;\n return element(\"a:lum\", Object.keys(attrs).length > 0 ? attrs : undefined);\n};\n\nconst createTintEffect = (options?: TintEffectOptions): string => {\n const attrs: Record<string, number> = {};\n if (options?.hue !== undefined) attrs.hue = options.hue;\n if (options?.amount !== undefined) attrs.amt = options.amount;\n return element(\"a:tint\", Object.keys(attrs).length > 0 ? attrs : undefined);\n};\n\nconst createRelativeOffsetEffect = (options?: RelativeOffsetEffectOptions): string => {\n const attrs: Record<string, number> = {};\n if (options?.translateX !== undefined) attrs.tx = options.translateX;\n if (options?.translateY !== undefined) attrs.ty = options.translateY;\n return element(\"a:relOff\", Object.keys(attrs).length > 0 ? attrs : undefined);\n};\n\nconst createTransformEffect = (options?: TransformEffectOptions): string => {\n const attrs: Record<string, number> = {};\n if (options?.scaleX !== undefined) attrs.sx = options.scaleX;\n if (options?.scaleY !== undefined) attrs.sy = options.scaleY;\n if (options?.skewX !== undefined) attrs.kx = options.skewX;\n if (options?.skewY !== undefined) attrs.ky = options.skewY;\n if (options?.translateX !== undefined) attrs.tx = options.translateX;\n if (options?.translateY !== undefined) attrs.ty = options.translateY;\n return element(\"a:xfrm\", Object.keys(attrs).length > 0 ? attrs : undefined);\n};\n\nconst createEffectReference = (options: EffectReferenceOptions): string =>\n `<a:effect ref=\"${options.ref}\"/>`;\n\n// ─── Blur Effect (from effect-list, re-implemented for DAG) ─────────────────\n\nconst createBlurEffect = (options: BlurEffectOptions): string => {\n const attrs: Record<string, number> = {};\n if (options.radius !== undefined) attrs.rad = options.radius;\n if (options.grow === false) attrs.grow = 0;\n return element(\"a:blur\", Object.keys(attrs).length > 0 ? attrs : undefined);\n};\n\n// ─── Effect Container ───────────────────────────────────────────────────────\n\n/**\n * Creates an effect container element (a:effectDag or a:cont).\n *\n * This is the CT_EffectContainer type — a recursive DAG of effects.\n * All 28 EG_Effect types are supported.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_EffectContainer\">\n * <xsd:group ref=\"EG_Effect\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * <xsd:attribute name=\"type\" type=\"ST_EffectContainerType\" default=\"sib\"/>\n * <xsd:attribute name=\"name\" type=\"xsd:token\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @param options - Container options with effects\n * @param elementName - Element name, defaults to \"a:cont\" for top-level\n */\nconst createEffectContainer = (options: EffectDagOptions, elementName = \"a:cont\"): string => {\n const attrs: Record<string, string | number> = {};\n if (options.type) attrs.type = xsdEffectContainer.to(options.type);\n if (options.name) attrs.name = options.name;\n\n const children: string[] = [];\n\n // ── Existing effects (also in CT_EffectList) ──\n if (options.blur) {\n children.push(createBlurEffect(options.blur));\n }\n if (options.fillOverlay) {\n children.push(createFillOverlayEffect(options.fillOverlay));\n }\n if (options.glow) {\n children.push(createGlowEffect(options.glow));\n }\n if (options.innerShadow) {\n children.push(createInnerShadowEffect(options.innerShadow));\n }\n if (options.outerShadow) {\n children.push(createOuterShadowEffect(options.outerShadow));\n }\n if (options.presetShadow) {\n children.push(createPresetShadowEffect(options.presetShadow));\n }\n if (options.reflection) {\n children.push(\n createReflectionEffect(options.reflection === true ? undefined : options.reflection),\n );\n }\n if (options.softEdge !== undefined) {\n children.push(createSoftEdgeEffect(options.softEdge));\n }\n\n // ── New effects for CT_EffectContainer ──\n if (options.containers) {\n for (const nested of options.containers) {\n children.push(createEffectContainer(nested));\n }\n }\n if (options.effectRefs) {\n for (const ref of options.effectRefs) {\n children.push(createEffectReference(ref));\n }\n }\n if (options.alphaBiLevel) {\n children.push(createAlphaBiLevelEffect(options.alphaBiLevel));\n }\n if (options.alphaCeiling) {\n children.push(createAlphaCeilingEffect());\n }\n if (options.alphaFloor) {\n children.push(createAlphaFloorEffect());\n }\n if (options.alphaInverse) {\n children.push(createAlphaInverseEffect(options.alphaInverse));\n }\n if (options.alphaModulate) {\n children.push(element(\"a:alphaMod\", undefined, [createEffectContainer(options.alphaModulate)]));\n }\n if (options.alphaModulateFixed) {\n children.push(createAlphaModulateFixedEffect(options.alphaModulateFixed));\n }\n if (options.alphaOutset) {\n children.push(createAlphaOutsetEffect(options.alphaOutset));\n }\n if (options.alphaReplace) {\n children.push(createAlphaReplaceEffect(options.alphaReplace));\n }\n if (options.biLevel) {\n children.push(createBiLevelEffect(options.biLevel.threshold));\n }\n if (options.blend) {\n children.push(createBlendEffect(options.blend));\n }\n if (options.colorChange) {\n children.push(createColorChangeEffect(options.colorChange));\n }\n if (options.colorReplace) {\n children.push(createColorReplaceEffect(options.colorReplace));\n }\n if (options.duotone) {\n children.push(createDuotoneEffect(options.duotone));\n }\n if (options.fill) {\n children.push(createFillEffect(options.fill));\n }\n if (options.grayscale) {\n children.push(createGrayscaleEffect());\n }\n if (options.hsl) {\n children.push(createHSLEffect(options.hsl));\n }\n if (options.luminance) {\n children.push(createLuminanceEffect(options.luminance));\n }\n if (options.tint) {\n children.push(createTintEffect(options.tint));\n }\n if (options.relativeOffset) {\n children.push(createRelativeOffsetEffect(options.relativeOffset));\n }\n if (options.transform) {\n children.push(createTransformEffect(options.transform));\n }\n\n return element(\n elementName,\n Object.keys(attrs).length > 0 ? attrs : undefined,\n children.length > 0 ? children : undefined,\n );\n};\n\n/**\n * Creates an effect DAG element (a:effectDag).\n *\n * This is the EG_EffectProperties choice alternative to effectLst,\n * supporting all 28 effect types with recursive nesting.\n *\n * @example\n * ```typescript\n * // Simple effect DAG with glow and outer shadow\n * createEffectDag({\n * glow: { radius: 50800, color: { value: \"FF0000\" } },\n * outerShadow: { color: { value: \"000000\" }, blurRadius: 76200 },\n * });\n *\n * // DAG with alpha effects and nested container\n * createEffectDag({\n * type: \"tree\",\n * alphaBiLevel: { threshold: 50000 },\n * containers: [{\n * glow: { color: { value: \"FF0000\" } },\n * }],\n * });\n * ```\n */\nexport const createEffectDag = (options: EffectDagOptions): string =>\n createEffectContainer(options, \"a:effectDag\");\n","/**\n * 3D scene module for DrawingML shapes.\n *\n * Provides CT_Scene3D — the 3D scene properties including camera, light rig,\n * and optional backdrop that define how a 3D shape is rendered.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_Scene3D\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\n// ─── Sphere Coordinates ─────────────────────────────────────────────────────\n\n/**\n * Sphere coordinates (CT_SphereCoords).\n *\n * Used for camera and light rig rotation. All angles are in 1/60000 of a degree.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_SphereCoords\">\n * <xsd:attribute name=\"lat\" type=\"ST_PositiveFixedAngle\" use=\"required\"/>\n * <xsd:attribute name=\"lon\" type=\"ST_PositiveFixedAngle\" use=\"required\"/>\n * <xsd:attribute name=\"rev\" type=\"ST_PositiveFixedAngle\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface SphereCoords {\n /** Latitude angle (0 to 21600000, in 1/60000 degree units) */\n lat: number;\n /** Longitude angle (0 to 21600000) */\n lon: number;\n /** Revolution angle (0 to 21600000) */\n rev: number;\n}\n\nconst createSphereCoords = (coords: SphereCoords): string =>\n `<a:rot lat=\"${coords.lat}\" lon=\"${coords.lon}\" rev=\"${coords.rev}\"/>`;\n\n// ─── Camera ─────────────────────────────────────────────────────────────────\n\n/**\n * Camera options (CT_Camera).\n *\n * Defines the camera type and optional rotation for the 3D scene.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Camera\">\n * <xsd:sequence>\n * <xsd:element name=\"rot\" type=\"CT_SphereCoords\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"prst\" type=\"ST_PresetCameraType\" use=\"required\"/>\n * <xsd:attribute name=\"fov\" type=\"ST_FOVAngle\" use=\"optional\"/>\n * <xsd:attribute name=\"zoom\" type=\"ST_PositivePercentage\" use=\"optional\" default=\"100%\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface CameraOptions {\n /** Preset camera type (e.g., \"perspectiveFront\", \"isometricTopUp\") */\n preset: string;\n /** Field of view angle (0 to 10800000, in 1/60000 degree units, max 180°) */\n fov?: number;\n /** Zoom percentage (e.g., \"100%\") */\n zoom?: string;\n /** Camera rotation */\n rotation?: SphereCoords;\n}\n\nconst createCamera = (options: CameraOptions): string => {\n const children: string[] = [];\n if (options.rotation) {\n children.push(createSphereCoords(options.rotation));\n }\n\n return element(\n \"a:camera\",\n { prst: options.preset, fov: options.fov, zoom: options.zoom },\n children,\n );\n};\n\n// ─── Light Rig ──────────────────────────────────────────────────────────────\n\n/**\n * Light rig options (CT_LightRig).\n *\n * Defines the lighting setup for the 3D scene.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_LightRig\">\n * <xsd:sequence>\n * <xsd:element name=\"rot\" type=\"CT_SphereCoords\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"rig\" type=\"ST_LightRigType\" use=\"required\"/>\n * <xsd:attribute name=\"dir\" type=\"ST_LightRigDirection\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface LightRigOptions {\n /** Light rig type (e.g., \"threePt\", \"balanced\", \"soft\") */\n rig: string;\n /** Light direction (e.g., \"tl\", \"t\", \"tr\", \"l\", \"r\", \"bl\", \"b\", \"br\") */\n direction: string;\n /** Light rig rotation */\n rotation?: SphereCoords;\n}\n\nconst createLightRig = (options: LightRigOptions): string => {\n const children: string[] = [];\n if (options.rotation) {\n children.push(createSphereCoords(options.rotation));\n }\n\n return element(\"a:lightRig\", { rig: options.rig, dir: options.direction }, children);\n};\n\n// ─── Backdrop ───────────────────────────────────────────────────────────────\n\n/**\n * 3D point (CT_Point3D).\n */\nexport interface Point3D {\n x: number;\n y: number;\n z: number;\n}\n\n/**\n * 3D vector (CT_Vector3D).\n */\nexport interface Vector3D {\n dx: number;\n dy: number;\n dz: number;\n}\n\n/**\n * Backdrop options (CT_Backdrop).\n *\n * Defines the backdrop plane for the 3D scene.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Backdrop\">\n * <xsd:sequence>\n * <xsd:element name=\"anchor\" type=\"CT_Point3D\" use=\"required\"/>\n * <xsd:element name=\"norm\" type=\"CT_Vector3D\" use=\"required\"/>\n * <xsd:element name=\"up\" type=\"CT_Vector3D\" use=\"required\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport interface BackdropOptions {\n /** Anchor point */\n anchor: Point3D;\n /** Normal vector */\n normal: Vector3D;\n /** Up vector */\n up: Vector3D;\n}\n\nconst createPoint3D = (name: string, point: Point3D): string =>\n `<${name} x=\"${point.x}\" y=\"${point.y}\" z=\"${point.z}\"/>`;\n\nconst createVector3D = (name: string, vector: Vector3D): string =>\n `<${name} dx=\"${vector.dx}\" dy=\"${vector.dy}\" dz=\"${vector.dz}\"/>`;\n\nconst createBackdrop = (options: BackdropOptions): string =>\n element(\"a:backdrop\", undefined, [\n createPoint3D(\"a:anchor\", options.anchor),\n createVector3D(\"a:norm\", options.normal),\n createVector3D(\"a:up\", options.up),\n ]);\n\n// ─── Scene 3D ───────────────────────────────────────────────────────────────\n\n/**\n * Options for a 3D scene (CT_Scene3D).\n *\n * Both `camera` and `lightRig` are required. `backdrop` is optional.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Scene3D\">\n * <xsd:sequence>\n * <xsd:element name=\"camera\" type=\"CT_Camera\" minOccurs=\"1\"/>\n * <xsd:element name=\"lightRig\" type=\"CT_LightRig\" minOccurs=\"1\"/>\n * <xsd:element name=\"backdrop\" type=\"CT_Backdrop\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * createScene3D({\n * camera: { preset: \"perspectiveFront\" },\n * lightRig: { rig: \"threePt\", direction: \"t\" },\n * });\n * ```\n */\nexport interface Scene3DOptions {\n /** Camera settings (required) */\n camera: CameraOptions;\n /** Light rig settings (required) */\n lightRig: LightRigOptions;\n /** Backdrop settings (optional) */\n backdrop?: BackdropOptions;\n}\n\n/**\n * Creates a 3D scene element (a:scene3d).\n *\n * @example\n * ```typescript\n * // Simple scene with default camera and lighting\n * createScene3D({\n * camera: { preset: \"perspectiveFront\" },\n * lightRig: { rig: \"threePt\", direction: \"t\" },\n * });\n *\n * // Scene with rotated camera and backdrop\n * createScene3D({\n * camera: {\n * preset: \"isometricTopUp\",\n * rotation: { lat: 0, lon: 0, rev: 5400000 },\n * },\n * lightRig: { rig: \"balanced\", direction: \"tl\" },\n * backdrop: {\n * anchor: { x: 0, y: 0, z: 0 },\n * normal: { dx: 0, dy: 0, dz: 1 },\n * up: { dx: 0, dy: 1, dz: 0 },\n * },\n * });\n * ```\n */\nexport const createScene3D = (options: Scene3DOptions): string => {\n const children: string[] = [createCamera(options.camera), createLightRig(options.lightRig)];\n\n if (options.backdrop) {\n children.push(createBackdrop(options.backdrop));\n }\n\n return element(\"a:scene3d\", undefined, children);\n};\n","/**\n * Bevel element for DrawingML 3D shapes.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_Bevel\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\n/**\n * Bevel preset types (12 variations).\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, ST_BevelPresetType\n */\nexport const BevelPresetType = {\n RELAXED_INSET: \"relaxedInset\",\n CIRCLE: \"circle\",\n SLOPE: \"slope\",\n CROSS: \"cross\",\n ANGLE: \"angle\",\n SOFT_ROUND: \"softRound\",\n CONVEX: \"convex\",\n COOL_SLANT: \"coolSlant\",\n DIVOT: \"divot\",\n RIBLET: \"riblet\",\n HARD_EDGE: \"hardEdge\",\n ART_DECO: \"artDeco\",\n} as const;\n\n/**\n * Options for a bevel element.\n */\nexport interface BevelOptions {\n /** Bevel width in EMUs (default 76200) */\n w?: number;\n /** Bevel height in EMUs (default 76200) */\n h?: number;\n /** Bevel preset type */\n prst?: (typeof BevelPresetType)[keyof typeof BevelPresetType];\n}\n\n/**\n * Creates a bevel element.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Bevel\">\n * <xsd:attribute name=\"w\" type=\"ST_PositiveCoordinate\" default=\"76200\"/>\n * <xsd:attribute name=\"h\" type=\"ST_PositiveCoordinate\" default=\"76200\"/>\n * <xsd:attribute name=\"prst\" type=\"ST_BevelPresetType\" default=\"circle\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createBevel = (options?: BevelOptions): string => {\n if (!options) {\n return `<a:bevelT/>`;\n }\n\n const attrs: Record<string, string | number> = {};\n\n if (options.w !== undefined) {\n attrs.w = options.w;\n }\n if (options.h !== undefined) {\n attrs.h = options.h;\n }\n if (options.prst !== undefined) {\n attrs.prst = options.prst;\n }\n\n return element(\"a:bevelT\", attrs);\n};\n\n/**\n * Creates a bottom bevel element (a:bevelB).\n */\nexport const createBottomBevel = (options?: BevelOptions): string => {\n if (!options) {\n return `<a:bevelB/>`;\n }\n\n const attrs: Record<string, string | number> = {};\n\n if (options.w !== undefined) {\n attrs.w = options.w;\n }\n if (options.h !== undefined) {\n attrs.h = options.h;\n }\n if (options.prst !== undefined) {\n attrs.prst = options.prst;\n }\n\n return element(\"a:bevelB\", attrs);\n};\n","/**\n * 3D shape properties for DrawingML.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_Shape3D\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport { xsdMaterialType } from \"../../util/mappings\";\nimport { createColorElement } from \"../color/solid-fill\";\nimport type { SolidFillOptions } from \"../color/solid-fill\";\nimport { createBevel, createBottomBevel } from \"./bevel\";\nimport type { BevelOptions } from \"./bevel\";\n\n/**\n * Preset material types for 3D shapes (15 variations).\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, ST_PresetMaterialType\n */\nexport const PresetMaterialType = {\n LEGACY_MATTE: \"legacyMatte\",\n LEGACY_PLASTIC: \"legacyPlastic\",\n LEGACY_METAL: \"legacyMetal\",\n LEGACY_WIREFRAME: \"legacyWireframe\",\n MATTE: \"matte\",\n PLASTIC: \"plastic\",\n METAL: \"metal\",\n WARM_MATTE: \"warmMatte\",\n TRANSLUCENT_POWDER: \"translucentPowder\",\n POWDER: \"powder\",\n DK_EDGE: \"darkEdge\",\n SOFT_EDGE: \"softEdge\",\n CLEAR: \"clear\",\n FLAT: \"flat\",\n SOFT_METAL: \"softMetal\",\n} as const;\n\n/**\n * Options for 3D shape properties.\n */\nexport interface Shape3DOptions {\n /** Top bevel options */\n bevelT?: BevelOptions;\n /** Bottom bevel options */\n bevelB?: BevelOptions;\n /** Extrusion color (CT_Color / EG_ColorChoice) */\n extrusionColor?: SolidFillOptions;\n /** Contour color (CT_Color / EG_ColorChoice) */\n contourColor?: SolidFillOptions;\n /** Depth in EMUs (default 0) */\n z?: number;\n /** Extrusion height in EMUs (default 0) */\n extrusionH?: number;\n /** Contour width in EMUs (default 0) */\n contourW?: number;\n /** Material preset type */\n prstMaterial?: (typeof PresetMaterialType)[keyof typeof PresetMaterialType];\n}\n\n/**\n * Creates a 3D shape properties element (a:sp3d).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Shape3D\">\n * <xsd:sequence>\n * <xsd:element name=\"bevelT\" type=\"CT_Bevel\" minOccurs=\"0\"/>\n * <xsd:element name=\"bevelB\" type=\"CT_Bevel\" minOccurs=\"0\"/>\n * <xsd:element name=\"extrusionClr\" type=\"CT_Color\" minOccurs=\"0\"/>\n * <xsd:element name=\"contourClr\" type=\"CT_Color\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"z\" type=\"ST_Coordinate\" default=\"0\"/>\n * <xsd:attribute name=\"extrusionH\" type=\"ST_PositiveCoordinate\" default=\"0\"/>\n * <xsd:attribute name=\"contourW\" type=\"ST_PositiveCoordinate\" default=\"0\"/>\n * <xsd:attribute name=\"prstMaterial\" type=\"ST_PresetMaterialType\" default=\"warmMatte\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createShape3D = (options: Shape3DOptions): string => {\n const children: string[] = [];\n\n if (options.bevelT) {\n children.push(createBevel(options.bevelT));\n }\n if (options.bevelB) {\n children.push(createBottomBevel(options.bevelB));\n }\n if (options.extrusionColor) {\n children.push(\n element(\"a:extrusionClr\", undefined, [createColorElement(options.extrusionColor)]),\n );\n }\n if (options.contourColor) {\n children.push(element(\"a:contourClr\", undefined, [createColorElement(options.contourColor)]));\n }\n\n const attrs: Record<string, string | number> = {};\n if (options.z !== undefined) attrs.z = options.z;\n if (options.extrusionH !== undefined) attrs.extrusionH = options.extrusionH;\n if (options.contourW !== undefined) attrs.contourW = options.contourW;\n if (options.prstMaterial !== undefined)\n attrs.prstMaterial = xsdMaterialType.to(options.prstMaterial);\n\n return element(\"a:sp3d\", attrs, children);\n};\n","/**\n * Adjustment values module for preset geometries.\n *\n * @module\n */\n\nimport { escapeXml } from \"@office-open/xml\";\n\n/**\n * A single geometry guide that defines an adjustment value.\n */\nexport interface GeometryGuide {\n /** Guide name (identifier) */\n name: string;\n /** Guide formula (e.g., \"val 16667\") */\n formula: string;\n}\n\n/**\n * Build a:avLst XML string from geometry guides.\n */\nexport function stringifyAdjustmentValues(guides?: readonly GeometryGuide[]): string {\n if (!guides || guides.length === 0) return \"<a:avLst/>\";\n const inner = guides\n .map((g) => `<a:gd name=\"${escapeXml(g.name)}\" fmla=\"${escapeXml(g.formula)}\"/>`)\n .join(\"\");\n return `<a:avLst>${inner}</a:avLst>`;\n}\n","/**\n * Preset geometry stringifier for DrawingML shapes.\n *\n * @module\n */\n\nimport type { GeometryGuide } from \"./adjustment-values\";\nimport { stringifyAdjustmentValues } from \"./adjustment-values\";\n\nexport interface PresetGeometryOptions {\n preset?: string;\n adjustmentValues?: readonly GeometryGuide[];\n}\n\n/**\n * Build a:prstGeom XML string.\n */\nexport function stringifyPresetGeometry(options?: PresetGeometryOptions): string {\n const prst = options?.preset ?? \"rect\";\n const avLst = stringifyAdjustmentValues(options?.adjustmentValues);\n return `<a:prstGeom prst=\"${prst}\">${avLst}</a:prstGeom>`;\n}\n","/**\n * Custom geometry module for DrawingML shapes.\n *\n * Provides CT_CustomGeometry2D — user-defined 2D geometry with paths,\n * guides, adjust handles, connection sites, and a text insertion rectangle.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_CustomGeometry2D\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport { xsdPathFillMode } from \"../../util/mappings\";\nimport type { GeometryGuide } from \"./adjustment-values\";\n\n/**\n * Creates a geometry guide list element (a:avLst or a:gdLst).\n *\n * Both CT_GeomGuideList types share the same structure — a list of `a:gd` children.\n * The only difference is the wrapper element name.\n */\nconst createGuideList = (name: string, guides: readonly GeometryGuide[]): string => {\n const children = guides.map((guide) => `<a:gd name=\"${guide.name}\" fmla=\"${guide.formula}\"/>`);\n return element(name, undefined, children);\n};\n\n// ─── Path Fill Mode ─────────────────────────────────────────────────────────\n\n/**\n * Path fill mode (ST_PathFillMode).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:simpleType name=\"ST_PathFillMode\">\n * <xsd:restriction base=\"xsd:token\">\n * <xsd:enumeration value=\"none\"/>\n * <xsd:enumeration value=\"norm\"/>\n * <xsd:enumeration value=\"lighten\"/>\n * <xsd:enumeration value=\"lightenLess\"/>\n * <xsd:enumeration value=\"darken\"/>\n * <xsd:enumeration value=\"darkenLess\"/>\n * </xsd:restriction>\n * </xsd:simpleType>\n * ```\n */\nexport const PathFillMode = {\n NONE: \"none\",\n NORM: \"normal\",\n LIGHTEN: \"lighten\",\n LIGHTEN_LESS: \"lightenLess\",\n DARKEN: \"darken\",\n DARKEN_LESS: \"darkenLess\",\n} as const;\n\n// ─── Point ──────────────────────────────────────────────────────────────────\n\n/**\n * An adjustable point (CT_AdjPoint2D).\n *\n * Coordinates can be absolute values or references to geometry guide names.\n */\nexport interface AdjustPoint {\n /** X coordinate (absolute value or guide name) */\n x: string;\n /** Y coordinate (absolute value or guide name) */\n y: string;\n}\n\nconst createAdjustPoint = (name: string, point: AdjustPoint): string =>\n element(name, undefined, [`<a:pt x=\"${point.x}\" y=\"${point.y}\"/>`]);\n\n// ─── Path Commands ──────────────────────────────────────────────────────────\n\n/** Move-to path command (CT_Path2DMoveTo). */\nexport interface PathMoveTo {\n command: \"moveTo\";\n point: AdjustPoint;\n}\n\n/** Line-to path command (CT_Path2DLineTo). */\nexport interface PathLineTo {\n command: \"lineTo\";\n point: AdjustPoint;\n}\n\n/** Arc-to path command (CT_Path2DArcTo). */\nexport interface PathArcTo {\n command: \"arcTo\";\n widthRadius: string;\n heightRadius: string;\n startAngle: string;\n sweepAngle: string;\n}\n\n/** Quadratic Bezier-to path command (CT_Path2DQuadBezierTo). */\nexport interface PathQuadBezTo {\n command: \"quadBezTo\";\n points: readonly [AdjustPoint, AdjustPoint];\n}\n\n/** Cubic Bezier-to path command (CT_Path2DCubicBezierTo). */\nexport interface PathCubicBezTo {\n command: \"cubicBezTo\";\n points: readonly [AdjustPoint, AdjustPoint, AdjustPoint];\n}\n\n/** Close path command (CT_Path2DClose). */\nexport interface PathClose {\n command: \"close\";\n}\n\n/** A path command within a custom geometry path. */\nexport type PathCommand =\n | PathMoveTo\n | PathLineTo\n | PathArcTo\n | PathQuadBezTo\n | PathCubicBezTo\n | PathClose;\n\nconst createPathCommand = (cmd: PathCommand): string => {\n switch (cmd.command) {\n case \"moveTo\":\n return createAdjustPoint(\"a:moveTo\", cmd.point);\n case \"lineTo\":\n return createAdjustPoint(\"a:lnTo\", cmd.point);\n case \"arcTo\":\n return `<a:arcTo wR=\"${cmd.widthRadius}\" hR=\"${cmd.heightRadius}\" stAng=\"${cmd.startAngle}\" swAng=\"${cmd.sweepAngle}\"/>`;\n case \"quadBezTo\":\n return element(\n \"a:quadBezTo\",\n undefined,\n cmd.points.map((pt) => `<a:pt x=\"${pt.x}\" y=\"${pt.y}\"/>`),\n );\n case \"cubicBezTo\":\n return element(\n \"a:cubicBezTo\",\n undefined,\n cmd.points.map((pt) => `<a:pt x=\"${pt.x}\" y=\"${pt.y}\"/>`),\n );\n case \"close\":\n return \"<a:close/>\";\n }\n};\n\n// ─── Path ───────────────────────────────────────────────────────────────────\n\n/**\n * Options for a 2D path (CT_Path2D).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Path2D\">\n * <xsd:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n * <xsd:element name=\"close\" type=\"CT_Path2DClose\"/>\n * <xsd:element name=\"moveTo\" type=\"CT_Path2DMoveTo\"/>\n * <xsd:element name=\"lnTo\" type=\"CT_Path2DLineTo\"/>\n * <xsd:element name=\"arcTo\" type=\"CT_Path2DArcTo\"/>\n * <xsd:element name=\"quadBezTo\" type=\"CT_Path2DQuadBezierTo\"/>\n * <xsd:element name=\"cubicBezTo\" type=\"CT_Path2DCubicBezierTo\"/>\n * </xsd:choice>\n * <xsd:attribute name=\"w\" type=\"ST_PositiveCoordinate\" default=\"0\"/>\n * <xsd:attribute name=\"h\" type=\"ST_PositiveCoordinate\" default=\"0\"/>\n * <xsd:attribute name=\"fill\" type=\"ST_PathFillMode\" default=\"norm\"/>\n * <xsd:attribute name=\"stroke\" type=\"xsd:boolean\" default=\"true\"/>\n * <xsd:attribute name=\"extrusionOk\" type=\"xsd:boolean\" default=\"true\"/>\n * </xsd:complexType>\n * ```\n */\nexport interface PathOptions {\n /** Path width (coordinate value, default 0 = use shape width) */\n w?: number;\n /** Path height (coordinate value, default 0 = use shape height) */\n h?: number;\n /** Fill mode for this path */\n fill?: (typeof PathFillMode)[keyof typeof PathFillMode];\n /** Whether to stroke the path */\n stroke?: boolean;\n /** Whether extrusion is allowed */\n extrusionOk?: boolean;\n /** Path commands (moveTo, lineTo, arcTo, etc.) */\n commands: readonly PathCommand[];\n}\n\nconst createPath = (options: PathOptions): string => {\n const attrs: Record<string, string | number | boolean | undefined> = {};\n if (options.w !== undefined) attrs.w = options.w;\n if (options.h !== undefined) attrs.h = options.h;\n if (options.fill !== undefined) attrs.fill = xsdPathFillMode.to(options.fill);\n if (options.stroke !== undefined) attrs.stroke = options.stroke;\n if (options.extrusionOk !== undefined) attrs.extrusionOk = options.extrusionOk;\n\n return element(\"a:path\", attrs, options.commands.map(createPathCommand));\n};\n\n// ─── Adjust Handle ──────────────────────────────────────────────────────────\n\n/**\n * A position reference for adjust handles and connection sites.\n */\nexport interface AdjustHandlePosition {\n x: string;\n y: string;\n}\n\n/**\n * XY adjust handle (CT_XYAdjustHandle).\n *\n * Allows the user to drag a handle in X/Y directions.\n */\nexport interface XYAdjustHandle {\n type: \"xy\";\n guideRefX?: string;\n minX?: string;\n maxX?: string;\n guideRefY?: string;\n minY?: string;\n maxY?: string;\n position: AdjustHandlePosition;\n}\n\n/**\n * Polar adjust handle (CT_PolarAdjustHandle).\n *\n * Allows the user to drag a handle in radius/angle directions.\n */\nexport interface PolarAdjustHandle {\n type: \"polar\";\n guideRefRadius?: string;\n minRadius?: string;\n maxRadius?: string;\n guideRefAngle?: string;\n minAngle?: string;\n maxAngle?: string;\n position: AdjustHandlePosition;\n}\n\n/** An adjust handle (XY or Polar). */\nexport type AdjustHandle = XYAdjustHandle | PolarAdjustHandle;\n\nconst createAdjustHandlePos = (position: AdjustHandlePosition): string =>\n `<a:pos x=\"${position.x}\" y=\"${position.y}\"/>`;\n\nconst createXYAdjustHandle = (handle: XYAdjustHandle): string => {\n const attrs: Record<string, string | undefined> = {};\n if (handle.guideRefX !== undefined) attrs.gdRefX = handle.guideRefX;\n if (handle.minX !== undefined) attrs.minX = handle.minX;\n if (handle.maxX !== undefined) attrs.maxX = handle.maxX;\n if (handle.guideRefY !== undefined) attrs.gdRefY = handle.guideRefY;\n if (handle.minY !== undefined) attrs.minY = handle.minY;\n if (handle.maxY !== undefined) attrs.maxY = handle.maxY;\n\n return element(\"a:ahXY\", attrs, [createAdjustHandlePos(handle.position)]);\n};\n\nconst createPolarAdjustHandle = (handle: PolarAdjustHandle): string => {\n const attrs: Record<string, string | undefined> = {};\n if (handle.guideRefRadius !== undefined) attrs.gdRefR = handle.guideRefRadius;\n if (handle.minRadius !== undefined) attrs.minR = handle.minRadius;\n if (handle.maxRadius !== undefined) attrs.maxR = handle.maxRadius;\n if (handle.guideRefAngle !== undefined) attrs.gdRefAng = handle.guideRefAngle;\n if (handle.minAngle !== undefined) attrs.minAng = handle.minAngle;\n if (handle.maxAngle !== undefined) attrs.maxAng = handle.maxAngle;\n\n return element(\"a:ahPolar\", attrs, [createAdjustHandlePos(handle.position)]);\n};\n\n// ─── Connection Site ────────────────────────────────────────────────────────\n\n/**\n * Connection site (CT_ConnectionSite).\n *\n * Defines a point on the shape boundary where connectors can attach.\n */\nexport interface ConnectionSite {\n /** Angle (absolute value or guide name) */\n angle: string;\n /** Position */\n position: AdjustHandlePosition;\n}\n\nconst createConnectionSite = (site: ConnectionSite): string =>\n element(\"a:cxn\", { ang: site.angle }, [createAdjustHandlePos(site.position)]);\n\n// ─── Geometry Rectangle ─────────────────────────────────────────────────────\n\n/**\n * Text insertion rectangle (CT_GeomRect).\n *\n * Defines the rectangle within the shape where text is placed.\n * Coordinates can be absolute values or references to geometry guide names.\n */\nexport interface GeomRect {\n left: string;\n top: string;\n right: string;\n bottom: string;\n}\n\nconst createGeomRect = (rect: GeomRect): string =>\n `<a:rect l=\"${rect.left}\" t=\"${rect.top}\" r=\"${rect.right}\" b=\"${rect.bottom}\"/>`;\n\n// ─── Custom Geometry ────────────────────────────────────────────────────────\n\n/**\n * Options for a custom 2D geometry (CT_CustomGeometry2D).\n *\n * Only `pathList` is required. All other sub-elements are optional.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_CustomGeometry2D\">\n * <xsd:sequence>\n * <xsd:element name=\"avLst\" type=\"CT_GeomGuideList\" minOccurs=\"0\"/>\n * <xsd:element name=\"gdLst\" type=\"CT_GeomGuideList\" minOccurs=\"0\"/>\n * <xsd:element name=\"ahLst\" type=\"CT_AdjustHandleList\" minOccurs=\"0\"/>\n * <xsd:element name=\"cxnLst\" type=\"CT_ConnectionSiteList\" minOccurs=\"0\"/>\n * <xsd:element name=\"rect\" type=\"CT_GeomRect\" minOccurs=\"0\"/>\n * <xsd:element name=\"pathLst\" type=\"CT_Path2DList\" minOccurs=\"1\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @example\n * ```typescript\n * // Simple triangle\n * createCustomGeometry({\n * pathList: [{\n * commands: [\n * { command: \"moveTo\", point: { x: \"0\", y: \"0\" } },\n * { command: \"lineTo\", point: { x: \"10000000\", y: \"0\" } },\n * { command: \"lineTo\", point: { x: \"5000000\", y: \"10000000\" } },\n * { command: \"close\" },\n * ],\n * }],\n * });\n * ```\n */\nexport interface CustomGeometryOptions {\n /** Adjustment value guides (a:avLst) */\n adjustmentValues?: readonly GeometryGuide[];\n /** Geometry guide formulas (a:gdLst) */\n guides?: readonly GeometryGuide[];\n /** Adjust handles (a:ahLst) */\n adjustHandles?: readonly AdjustHandle[];\n /** Connection sites (a:cxnLst) */\n connectionSites?: readonly ConnectionSite[];\n /** Text insertion rectangle (a:rect) */\n textRectangle?: GeomRect;\n /** Path definitions (a:pathLst) — required */\n pathList: readonly PathOptions[];\n}\n\n/**\n * Creates a custom 2D geometry element as an XML string (a:custGeom).\n *\n * @example\n * ```typescript\n * // Diamond shape\n * const geom = createCustomGeometry({\n * pathList: [{\n * commands: [\n * { command: \"moveTo\", point: { x: \"5000000\", y: \"0\" } },\n * { command: \"lineTo\", point: { x: \"10000000\", y: \"5000000\" } },\n * { command: \"lineTo\", point: { x: \"5000000\", y: \"10000000\" } },\n * { command: \"lineTo\", point: { x: \"0\", y: \"5000000\" } },\n * { command: \"close\" },\n * ],\n * }],\n * textRectangle: { left: \"2000000\", top: \"2000000\", right: \"8000000\", bottom: \"8000000\" },\n * });\n * ```\n */\nexport const createCustomGeometry = (options: CustomGeometryOptions): string => {\n const children: string[] = [];\n\n // a:avLst\n if (options.adjustmentValues) {\n children.push(createGuideList(\"a:avLst\", options.adjustmentValues));\n }\n\n // a:gdLst\n if (options.guides) {\n children.push(createGuideList(\"a:gdLst\", options.guides));\n }\n\n // a:ahLst\n if (options.adjustHandles && options.adjustHandles.length > 0) {\n children.push(\n element(\n \"a:ahLst\",\n undefined,\n options.adjustHandles.map((h) =>\n h.type === \"xy\" ? createXYAdjustHandle(h) : createPolarAdjustHandle(h),\n ),\n ),\n );\n }\n\n // a:cxnLst\n if (options.connectionSites && options.connectionSites.length > 0) {\n children.push(\n element(\"a:cxnLst\", undefined, options.connectionSites.map(createConnectionSite)),\n );\n }\n\n // a:rect\n if (options.textRectangle) {\n children.push(createGeomRect(options.textRectangle));\n }\n\n // a:pathLst (required)\n children.push(element(\"a:pathLst\", undefined, options.pathList.map(createPath)));\n\n return element(\"a:custGeom\", undefined, children);\n};\n","/**\n * Blip extensions module for SVG support.\n *\n * This module provides extension elements that enable SVG image support\n * within blip elements using Office-specific extensions.\n *\n * Reference: http://officeopenxml.com/drwPic.php\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\n/**\n * Creates an SVG blip element for embedding SVG images.\n *\n * This element is a Microsoft Office extension that allows SVG images\n * to be referenced within a blip.\n *\n * @param svgReferenceId - The reference ID for the SVG image\n * @returns An XML string representing the SVG blip element\n * @internal\n */\nconst createSvgBlip = (svgReferenceId: string): string =>\n `<asvg:svgBlip xmlns:asvg=\"http://schemas.microsoft.com/office/drawing/2016/SVG/main\" r:embed=\"{${svgReferenceId}}\"/>`;\n\n/**\n * Creates an extension element for SVG support.\n *\n * This element wraps the SVG blip extension with the appropriate URI\n * to identify it as an SVG extension.\n *\n * @param svgReferenceId - The reference ID for the SVG image\n * @returns An XML string representing the extension element\n * @internal\n */\nconst createExtension = (svgReferenceId: string): string =>\n element(\"a:ext\", { uri: \"{96DAC541-7B7A-43D3-8B79-37D633B846F1}\" }, [\n createSvgBlip(svgReferenceId),\n ]);\n\n/**\n * Creates an extension list for SVG images.\n *\n * This element contains the extensions needed to embed SVG images\n * within a blip. It wraps the SVG-specific extension elements.\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_OfficeArtExtensionList\">\n * <xsd:sequence>\n * <xsd:element name=\"ext\" type=\"CT_OfficeArtExtension\" minOccurs=\"0\" maxOccurs=\"unbounded\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n *\n * @param svgReferenceId - The reference ID for the SVG image\n * @returns An XML string representing the extension list\n */\nexport const createExtensionList = (svgReferenceId: string): string =>\n element(\"a:extLst\", undefined, [createExtension(svgReferenceId)]);\n","/**\n * Blip (Binary Large Image or Picture) module for DrawingML.\n *\n * This module provides the blip element that references the actual\n * image data within a picture.\n *\n * Reference: http://officeopenxml.com/drwPic.php\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport { createBlipEffects } from \"./blip-effects\";\nimport type { BlipEffectsOptions } from \"./blip-effects\";\nimport { createExtensionList } from \"./blip-extensions\";\n\n/**\n * Options for creating a blip element.\n */\nexport interface BlipOptions {\n /** File name used as placeholder; the packer's ImageReplacer replaces `{referenceId}` with `rId{N}` */\n referenceId: string;\n /** Image type for SVG detection */\n type?: \"svg\" | string;\n /** For SVG images, the fallback image file name */\n fallbackFileName?: string;\n}\n\n/**\n * Creates a blip element for an image.\n *\n * A blip references the actual image data stored in the document package\n * through a relationship ID. For SVG images, it includes extensions that\n * reference the SVG data.\n *\n * Reference: http://officeopenxml.com/drwPic.php\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_Blip\">\n * <xsd:sequence>\n * <xsd:choice minOccurs=\"0\" maxOccurs=\"unbounded\">\n * <xsd:element name=\"alphaBiLevel\" type=\"CT_AlphaBiLevelEffect\"/>\n * <xsd:element name=\"alphaCeiling\" type=\"CT_AlphaCeilingEffect\"/>\n * <xsd:element name=\"alphaFloor\" type=\"CT_AlphaFloorEffect\"/>\n * <xsd:element name=\"alphaInv\" type=\"CT_AlphaInverseEffect\"/>\n * <xsd:element name=\"alphaMod\" type=\"CT_AlphaModulateEffect\"/>\n * <xsd:element name=\"alphaModFix\" type=\"CT_AlphaModulateFixedEffect\"/>\n * <xsd:element name=\"alphaRepl\" type=\"CT_AlphaReplaceEffect\"/>\n * <xsd:element name=\"biLevel\" type=\"CT_BiLevelEffect\"/>\n * <xsd:element name=\"blur\" type=\"CT_BlurEffect\"/>\n * <xsd:element name=\"clrChange\" type=\"CT_ColorChangeEffect\"/>\n * <xsd:element name=\"clrRepl\" type=\"CT_ColorReplaceEffect\"/>\n * <xsd:element name=\"duotone\" type=\"CT_DuotoneEffect\"/>\n * <xsd:element name=\"fillOverlay\" type=\"CT_FillOverlayEffect\"/>\n * <xsd:element name=\"grayscl\" type=\"CT_GrayscaleEffect\"/>\n * <xsd:element name=\"hsl\" type=\"CT_HSLEffect\"/>\n * <xsd:element name=\"lum\" type=\"CT_LuminanceEffect\"/>\n * <xsd:element name=\"tint\" type=\"CT_TintEffect\"/>\n * </xsd:choice>\n * <xsd:element name=\"extLst\" type=\"CT_OfficeArtExtensionList\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute ref=\"r:embed\"/>\n * <xsd:attribute ref=\"r:link\"/>\n * <xsd:attribute name=\"cstate\" type=\"ST_BlipCompression\"/>\n * </xsd:complexType>\n * ```\n *\n * @param options - Blip options including referenceId and type\n * @param blipEffects - Optional blip effects (brightness, contrast, etc.)\n * @returns An XML string representing the blip element\n */\nexport const createBlip = (options: BlipOptions, blipEffects?: BlipEffectsOptions): string => {\n const children: string[] = [];\n\n if (blipEffects) {\n children.push(...createBlipEffects(blipEffects));\n }\n\n if (options.type === \"svg\" && options.fallbackFileName) {\n children.push(createExtensionList(options.referenceId));\n }\n\n return element(\n \"a:blip\",\n {\n cstate: \"none\",\n \"r:embed\": `{${options.type === \"svg\" && options.fallbackFileName ? options.fallbackFileName : options.referenceId}}`,\n },\n children.length > 0 ? children : undefined,\n );\n};\n","/**\n * Blip fill module for DrawingML pictures.\n *\n * This module defines how an image (blip) fills a picture shape,\n * including stretching and cropping options.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_BlipFillProperties\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport { createBlip } from \"./blip\";\nimport type { BlipOptions } from \"./blip\";\nimport type { BlipEffectsOptions } from \"./blip-effects\";\nimport { createSourceRectangle } from \"./source-rectangle\";\nimport type { SourceRectangleOptions } from \"./source-rectangle\";\nimport { createTileInfo } from \"./tile\";\nimport type { TileOptions } from \"./tile\";\n\n/**\n * Options for blip fill properties.\n */\nexport interface BlipFillOptions {\n /** DPI of the image */\n dpi?: number;\n /** Whether the fill rotates with the shape */\n rotWithShape?: boolean;\n /** Image adjustment effects (brightness, contrast, grayscale, etc.) */\n blipEffects?: BlipEffectsOptions;\n /** Source rectangle for cropping */\n sourceRectangle?: SourceRectangleOptions;\n /** Tile fill mode (if omitted, defaults to stretch) */\n tile?: TileOptions;\n}\n\n/**\n * Creates a blip fill element.\n *\n * This element specifies the type of fill used for a picture. It contains the blip (image)\n * reference, an optional source rectangle for cropping, and the fill mode (typically stretch).\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_BlipFillProperties\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_BlipFillProperties\">\n * <xsd:sequence>\n * <xsd:element name=\"blip\" type=\"CT_Blip\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:element name=\"srcRect\" type=\"CT_RelativeRect\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * <xsd:group ref=\"EG_FillModeProperties\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"dpi\" type=\"xsd:unsignedInt\" use=\"optional\"/>\n * <xsd:attribute name=\"rotWithShape\" type=\"xsd:boolean\" use=\"optional\"/>\n * </xsd:complexType>\n * ```\n *\n * @param blipOptions - Blip options including referenceId and type\n * @param fillOptions - Optional blip fill options\n * @returns An XML string representing the blip fill element\n */\nexport const createBlipFill = (blipOptions: BlipOptions, fillOptions?: BlipFillOptions): string => {\n const children: string[] = [];\n\n children.push(createBlip(blipOptions, fillOptions?.blipEffects));\n children.push(createSourceRectangle(fillOptions?.sourceRectangle));\n\n if (fillOptions?.tile) {\n children.push(createTileInfo(fillOptions.tile));\n } else {\n children.push(\"<a:stretch><a:fillRect/></a:stretch>\");\n }\n\n const attrs: Record<string, string | number | undefined> = {};\n if (fillOptions?.dpi !== undefined) {\n attrs.dpi = fillOptions.dpi;\n }\n if (fillOptions?.rotWithShape !== undefined) {\n attrs.rotWithShape = fillOptions.rotWithShape ? 1 : 0;\n }\n\n return element(\"pic:blipFill\", attrs, children);\n};\n","/**\n * Stretch fill stringifier for blip fills.\n *\n * @module\n */\n\n/**\n * Build a:stretch XML string with a:fillRect child.\n */\nexport function stringifyStretch(): string {\n return \"<a:stretch><a:fillRect/></a:stretch>\";\n}\n","import { element } from \"@office-open/xml\";\n\nimport { convertToEmu } from \"../util/converters\";\n/**\n * 2D transform for DrawingML shapes.\n *\n * This module provides factory functions for creating transform elements\n * (a:xfrm) used in shape properties, picture properties, and group shapes.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_Transform2D / CT_GroupTransform2D\n *\n * @module\n */\nimport type { UniversalMeasure } from \"../util/values\";\n\n// <xsd:complexType name=\"CT_Transform2D\">\n// <xsd:sequence>\n// <xsd:element name=\"off\" type=\"CT_Point2D\" minOccurs=\"0\"/>\n// <xsd:element name=\"ext\" type=\"CT_PositiveSize2D\" minOccurs=\"0\"/>\n// </xsd:sequence>\n// <xsd:attribute name=\"rot\" type=\"ST_Angle\" use=\"optional\"/>\n// <xsd:attribute name=\"flipH\" type=\"xsd:boolean\" use=\"optional\"/>\n// <xsd:attribute name=\"flipV\" type=\"xsd:boolean\" use=\"optional\"/>\n// </xsd:complexType>\n\nexport interface Transform2DOptions {\n x?: number | UniversalMeasure;\n y?: number | UniversalMeasure;\n width?: number | UniversalMeasure;\n height?: number | UniversalMeasure;\n flipHorizontal?: boolean;\n flipVertical?: boolean;\n rotation?: number;\n}\n\n// <xsd:complexType name=\"CT_GroupTransform2D\">\n// <xsd:complexContent>\n// <xsd:extension base=\"CT_Transform2D\">\n// <xsd:sequence>\n// <xsd:element name=\"chOff\" type=\"CT_Point2D\" minOccurs=\"0\"/>\n// <xsd:element name=\"chExt\" type=\"CT_PositiveSize2D\" minOccurs=\"0\"/>\n// </xsd:sequence>\n// </xsd:extension>\n// </xsd:complexContent>\n// </xsd:complexType>\n\nexport interface GroupTransform2DOptions extends Transform2DOptions {\n childOffsetX?: number | UniversalMeasure;\n childOffsetY?: number | UniversalMeasure;\n childExtentWidth?: number | UniversalMeasure;\n childExtentHeight?: number | UniversalMeasure;\n}\n\nfunction buildXfrmAttrs(\n options: Transform2DOptions,\n): Record<string, string | number | boolean> | undefined {\n const attrs: Record<string, string | number | boolean> = {};\n if (options.flipHorizontal !== undefined) attrs.flipH = options.flipHorizontal;\n if (options.flipVertical !== undefined) attrs.flipV = options.flipVertical;\n if (options.rotation !== undefined) attrs.rot = options.rotation;\n return Object.keys(attrs).length > 0 ? attrs : undefined;\n}\n\n/**\n * Creates a 2D transform element (a:xfrm).\n *\n * @param options - Transform options including position, size, rotation, and flip.\n * @param elementName - Element name, defaults to \"a:xfrm\".\n */\nexport const createTransform2D = (\n options: Transform2DOptions,\n elementName: string = \"a:xfrm\",\n): string => {\n const children: string[] = [];\n\n if (options.x !== undefined || options.y !== undefined) {\n const x = options.x !== undefined ? convertToEmu(options.x) : 0;\n const y = options.y !== undefined ? convertToEmu(options.y) : 0;\n children.push(`<a:off x=\"${x}\" y=\"${y}\"/>`);\n }\n\n if (options.width !== undefined || options.height !== undefined) {\n const cx = options.width !== undefined ? convertToEmu(options.width) : 0;\n const cy = options.height !== undefined ? convertToEmu(options.height) : 0;\n children.push(`<a:ext cx=\"${cx}\" cy=\"${cy}\"/>`);\n }\n\n return element(elementName, buildXfrmAttrs(options), children);\n};\n\n/**\n * Creates a group transform element (a:xfrm with chOff/chExt children).\n */\nexport const createGroupTransform2D = (\n options: GroupTransform2DOptions,\n elementName: string = \"a:xfrm\",\n): string => {\n const children: string[] = [];\n\n if (options.x !== undefined || options.y !== undefined) {\n const x = options.x !== undefined ? convertToEmu(options.x) : 0;\n const y = options.y !== undefined ? convertToEmu(options.y) : 0;\n children.push(`<a:off x=\"${x}\" y=\"${y}\"/>`);\n }\n\n if (options.width !== undefined || options.height !== undefined) {\n const cx = options.width !== undefined ? convertToEmu(options.width) : 0;\n const cy = options.height !== undefined ? convertToEmu(options.height) : 0;\n children.push(`<a:ext cx=\"${cx}\" cy=\"${cy}\"/>`);\n }\n\n const chOffX = options.childOffsetX !== undefined ? convertToEmu(options.childOffsetX) : 0;\n const chOffY = options.childOffsetY !== undefined ? convertToEmu(options.childOffsetY) : 0;\n children.push(`<a:chOff x=\"${chOffX}\" y=\"${chOffY}\"/>`);\n\n const chExtCx =\n options.childExtentWidth !== undefined ? convertToEmu(options.childExtentWidth) : 0;\n const chExtCy =\n options.childExtentHeight !== undefined ? convertToEmu(options.childExtentHeight) : 0;\n children.push(`<a:chExt cx=\"${chExtCx}\" cy=\"${chExtCy}\"/>`);\n\n return element(elementName, buildXfrmAttrs(options), children);\n};\n","/**\n * Table Style system for DrawingML.\n *\n * Generates CT_TableStyle and CT_TableStyleList XML for custom table styles\n * in presentations (PPTX) and documents.\n *\n * Reference: ISO/IEC 29500-4, dml-main.xsd, CT_TableStyle / CT_TableStyleList\n *\n * @module\n */\nimport { attr, attrNum, element, findChild, stringify } from \"@office-open/xml\";\nimport type { Element } from \"@office-open/xml\";\n\n// ── Options ──\n\nexport type TableStyleRegion =\n | \"tblBg\"\n | \"wholeTbl\"\n | \"band1H\"\n | \"band2H\"\n | \"band1V\"\n | \"band2V\"\n | \"lastCol\"\n | \"firstCol\"\n | \"lastRow\"\n | \"seCell\"\n | \"swCell\"\n | \"firstRow\"\n | \"neCell\"\n | \"nwCell\";\n\nexport type OnOffStyleType = \"on\" | \"off\" | \"def\";\n\nexport interface TablePartStyleOptions {\n /** Cell text style */\n text?: TableTextStyleOptions;\n /** Cell style (fill, borders, 3D) */\n cell?: TableCellStyleOptions;\n}\n\nexport interface TableTextStyleOptions {\n /** Bold style */\n bold?: OnOffStyleType;\n /** Italic style */\n italic?: OnOffStyleType;\n /** Font reference (themeable) */\n fontReference?: StyleMatrixReferenceOptions;\n /** Color element */\n color?: string;\n}\n\nexport interface TableCellStyleOptions {\n /** Cell borders */\n borders?: TableCellBorderOptions;\n /** Fill reference (themeable) */\n fillReference?: StyleMatrixReferenceOptions;\n /** Direct fill */\n fill?: string;\n}\n\nexport interface TableCellBorderOptions {\n left?: ThemeableLineStyleOptions;\n right?: ThemeableLineStyleOptions;\n top?: ThemeableLineStyleOptions;\n bottom?: ThemeableLineStyleOptions;\n insideH?: ThemeableLineStyleOptions;\n insideV?: ThemeableLineStyleOptions;\n}\n\nexport interface ThemeableLineStyleOptions {\n /** Line width in EMUs */\n width?: number;\n /** Fill color component */\n color?: string;\n /** Line reference (a:lnRef) into the theme style matrix */\n lineReference?: StyleMatrixReferenceOptions;\n}\n\nexport interface StyleMatrixReferenceOptions {\n /** Index into the theme style matrix */\n idx: number;\n /** Color component */\n color?: string;\n}\n\nexport interface TableStyleOptions {\n /** Unique GUID for this style */\n styleId: string;\n /** Display name */\n styleName: string;\n /** Style regions */\n regions?: Partial<Record<TableStyleRegion, TablePartStyleOptions>>;\n}\n\nexport interface TableStyleListOptions {\n /** Default style GUID */\n defaultStyleId: string;\n /** Custom table styles */\n styles?: readonly TableStyleOptions[];\n}\n\n// ── Helpers ──\n\nfunction onOffAttr(val: OnOffStyleType | undefined): string {\n if (val === undefined) return \"\";\n return val;\n}\n\n/** Pass through a string value (all color/fill factories now return string). */\nfunction toStr(el: string): string {\n return el;\n}\n\n/** Create a:styleMatrixReference (fillRef, lnRef, effectRef, fontRef) */\nfunction createStyleMatrixRef(elementName: string, opts: StyleMatrixReferenceOptions): string {\n const children: string[] = [];\n if (opts.color) children.push(opts.color);\n return element(\n `a:${elementName}`,\n { idx: String(opts.idx) },\n children.length > 0 ? children : undefined,\n );\n}\n\n/** Create border line element (a:ln with color) or a:lnRef */\nfunction createThemeableLine(opts: ThemeableLineStyleOptions): string {\n if (opts.lineReference !== undefined) {\n const children: string[] = [];\n if (opts.color) children.push(toStr(opts.color));\n return element(\n \"a:lnRef\",\n { idx: String(opts.lineReference.idx) },\n children.length > 0 ? children : undefined,\n );\n }\n const children: string[] = [];\n if (opts.color) children.push(toStr(opts.color));\n const attrs: Record<string, string> = {};\n if (opts.width !== undefined) attrs.w = String(opts.width);\n return element(\"a:ln\", attrs, children.length > 0 ? children : undefined);\n}\n\n// ── Part builders ──\n\n/** Each cell-border side: Options key → a:tcBdr child element name. */\nconst BORDER_SIDES: ReadonlyArray<[keyof TableCellBorderOptions, string]> = [\n [\"left\", \"a:left\"],\n [\"right\", \"a:right\"],\n [\"top\", \"a:top\"],\n [\"bottom\", \"a:bottom\"],\n [\"insideH\", \"a:insideH\"],\n [\"insideV\", \"a:insideV\"],\n];\n\n/** CT_TableCellBorderStyle: each side wraps an EG_ThemeableLineStyle choice. */\nfunction buildCellBorders(opts: TableCellBorderOptions): string {\n const children: string[] = [];\n for (const [key, name] of BORDER_SIDES) {\n const line = opts[key];\n if (line) children.push(element(name, undefined, [createThemeableLine(line)]));\n }\n return element(\"a:tcBdr\", undefined, children);\n}\n\nfunction buildTextStyle(opts: TableTextStyleOptions): string {\n const children: string[] = [];\n if (opts.fontReference) children.push(createStyleMatrixRef(\"fontRef\", opts.fontReference));\n if (opts.color) children.push(toStr(opts.color));\n const attrs: Record<string, string> = {};\n if (opts.bold && opts.bold !== \"def\") attrs.b = onOffAttr(opts.bold);\n if (opts.italic && opts.italic !== \"def\") attrs.i = onOffAttr(opts.italic);\n return element(\"a:tcTxStyle\", attrs, children.length > 0 ? children : undefined);\n}\n\nfunction buildCellStyle(opts: TableCellStyleOptions): string {\n const children: string[] = [];\n if (opts.borders) children.push(buildCellBorders(opts.borders));\n if (opts.fillReference) children.push(createStyleMatrixRef(\"fillRef\", opts.fillReference));\n else if (opts.fill) children.push(toStr(opts.fill));\n return element(\"a:tcStyle\", undefined, children);\n}\n\nfunction buildPartStyle(elementName: string, opts: TablePartStyleOptions): string {\n const children: string[] = [];\n if (opts.text) children.push(buildTextStyle(opts.text));\n if (opts.cell) children.push(buildCellStyle(opts.cell));\n return element(elementName, undefined, children);\n}\n\n// ── Public API ──\n\n/** XSD ordering for CT_TableStyle children */\nconst REGION_ORDER: readonly TableStyleRegion[] = [\n \"tblBg\",\n \"wholeTbl\",\n \"band1H\",\n \"band2H\",\n \"band1V\",\n \"band2V\",\n \"lastCol\",\n \"firstCol\",\n \"lastRow\",\n \"seCell\",\n \"swCell\",\n \"firstRow\",\n \"neCell\",\n \"nwCell\",\n];\n\n/** XML element name for each region */\nconst REGION_ELEMENTS: Record<TableStyleRegion, string> = {\n tblBg: \"a:tblBg\",\n wholeTbl: \"a:wholeTbl\",\n band1H: \"a:band1H\",\n band2H: \"a:band2H\",\n band1V: \"a:band1V\",\n band2V: \"a:band2V\",\n lastCol: \"a:lastCol\",\n firstCol: \"a:firstCol\",\n lastRow: \"a:lastRow\",\n seCell: \"a:seCell\",\n swCell: \"a:swCell\",\n firstRow: \"a:firstRow\",\n neCell: \"a:neCell\",\n nwCell: \"a:nwCell\",\n};\n\n/** Create a single table style (CT_TableStyle) */\nexport function createTableStyle(opts: TableStyleOptions): string {\n const children: string[] = [];\n if (opts.regions) {\n for (const region of REGION_ORDER) {\n const part = opts.regions[region];\n if (!part) continue;\n children.push(buildPartStyle(REGION_ELEMENTS[region], part));\n }\n }\n return element(\n \"a:tblStyle\",\n { styleId: opts.styleId, styleName: opts.styleName },\n children.length > 0 ? children : undefined,\n );\n}\n\n/** Create table style list (CT_TableStyleList) */\nexport function createTableStyleList(opts: TableStyleListOptions): string {\n const children: string[] = [];\n if (opts.styles) {\n for (const style of opts.styles) {\n children.push(createTableStyle(style));\n }\n }\n return element(\n \"a:tblStyleLst\",\n {\n \"xmlns:a\": \"http://schemas.openxmlformats.org/drawingml/2006/main\",\n def: opts.defaultStyleId,\n },\n children.length > 0 ? children : undefined,\n );\n}\n\n// ── Parse (Element → TableStyleListOptions) ──\n\n/**\n * Serialize a single parsed element. `stringify` treats its argument as a\n * document root and serializes the `elements` array, so wrap the child to\n * serialize the child itself (round-trips raw color/fill child elements).\n */\nfunction serializeChild(child: Element): string {\n return stringify({ elements: [child] });\n}\n\n/** Reverse of REGION_ELEMENTS: XML element name → region key. */\nconst ELEMENT_TO_REGION = Object.fromEntries(\n Object.entries(REGION_ELEMENTS).map(([region, name]) => [name, region]),\n) as Record<string, TableStyleRegion>;\n\n/** Parse a:tblStyleLst → TableStyleListOptions (reverse of createTableStyleList). */\nexport function parseTableStyleList(el: Element): TableStyleListOptions {\n const defaultStyleId = attr(el, \"def\") ?? \"\";\n const styles: TableStyleOptions[] = [];\n for (const child of el.elements ?? []) {\n if (child.name !== \"a:tblStyle\") continue;\n const style = parseTableStyle(child);\n if (style) styles.push(style);\n }\n return { defaultStyleId, ...(styles.length > 0 ? { styles } : {}) };\n}\n\nfunction parseTableStyle(el: Element): TableStyleOptions | undefined {\n const styleId = attr(el, \"styleId\");\n const styleName = attr(el, \"styleName\");\n if (styleId === undefined || styleName === undefined) return undefined;\n const regions: Partial<Record<TableStyleRegion, TablePartStyleOptions>> = {};\n for (const child of el.elements ?? []) {\n if (!child.name) continue;\n const region = ELEMENT_TO_REGION[child.name];\n if (!region) continue;\n const part = parsePartStyle(child);\n if (part) regions[region] = part;\n }\n return { styleId, styleName, ...(Object.keys(regions).length > 0 ? { regions } : {}) };\n}\n\nfunction parsePartStyle(el: Element): TablePartStyleOptions | undefined {\n const part: TablePartStyleOptions = {};\n const txStyle = findChild(el, \"a:tcTxStyle\");\n if (txStyle) {\n const text = parseTableTextStyle(txStyle);\n if (text) part.text = text;\n }\n const cellStyle = findChild(el, \"a:tcStyle\");\n if (cellStyle) {\n const cell = parseTableCellStyle(cellStyle);\n if (cell) part.cell = cell;\n }\n return Object.keys(part).length > 0 ? part : undefined;\n}\n\nfunction parseTableTextStyle(el: Element): TableTextStyleOptions | undefined {\n const opts: TableTextStyleOptions = {};\n const b = attr(el, \"b\");\n if (b === \"on\" || b === \"off\") opts.bold = b;\n const i = attr(el, \"i\");\n if (i === \"on\" || i === \"off\") opts.italic = i;\n const fontRefEl = findChild(el, \"a:fontRef\");\n if (fontRefEl) opts.fontReference = parseStyleMatrixRef(fontRefEl);\n // color: first non-fontRef child element, serialized back to the raw string\n // buildTextStyle stores (it pushes opts.color verbatim).\n for (const child of el.elements ?? []) {\n if (child.name === \"a:fontRef\") continue;\n opts.color = serializeChild(child);\n break;\n }\n return Object.keys(opts).length > 0 ? opts : undefined;\n}\n\nfunction parseTableCellStyle(el: Element): TableCellStyleOptions | undefined {\n const opts: TableCellStyleOptions = {};\n const tcBdr = findChild(el, \"a:tcBdr\");\n if (tcBdr) {\n const borders = parseCellBorders(tcBdr);\n if (borders) opts.borders = borders;\n }\n const fillRefEl = findChild(el, \"a:fillRef\");\n if (fillRefEl) {\n opts.fillReference = parseStyleMatrixRef(fillRefEl);\n } else {\n // fill: first non-tcBdr child element, serialized (buildCellStyle pushes\n // opts.fill verbatim).\n for (const child of el.elements ?? []) {\n if (child.name === \"a:tcBdr\") continue;\n opts.fill = serializeChild(child);\n break;\n }\n }\n return Object.keys(opts).length > 0 ? opts : undefined;\n}\n\nfunction parseCellBorders(el: Element): TableCellBorderOptions | undefined {\n const borders: TableCellBorderOptions = {};\n for (const [key, name] of BORDER_SIDES) {\n const borderEl = findChild(el, name);\n if (!borderEl) continue;\n // Each side wraps an EG_ThemeableLineStyle choice (a:ln or a:lnRef).\n const lineEl = borderEl.elements?.find((c) => c.type === \"element\");\n if (!lineEl) continue;\n const line = parseThemeableLine(lineEl);\n if (line) borders[key] = line;\n }\n return Object.keys(borders).length > 0 ? borders : undefined;\n}\n\nfunction parseThemeableLine(el: Element): ThemeableLineStyleOptions | undefined {\n const opts: ThemeableLineStyleOptions = {};\n if (el.name === \"a:lnRef\") {\n const idx = attrNum(el, \"idx\");\n if (idx !== undefined) opts.lineReference = { idx };\n } else {\n const w = attrNum(el, \"w\");\n if (w !== undefined) opts.width = w;\n }\n for (const child of el.elements ?? []) {\n opts.color = serializeChild(child);\n break;\n }\n return Object.keys(opts).length > 0 ? opts : undefined;\n}\n\nfunction parseStyleMatrixRef(el: Element): StyleMatrixReferenceOptions {\n const idx = attrNum(el, \"idx\") ?? 0;\n const opts: StyleMatrixReferenceOptions = { idx };\n for (const child of el.elements ?? []) {\n opts.color = serializeChild(child);\n break;\n }\n return opts;\n}\n","/**\n * DrawingML shape locking properties.\n *\n * Controls which aspects of a shape can be modified by users.\n *\n * Reference: OOXML transitional, dml-main.xsd, AG_Locking / CT_ShapeLocking / CT_PictureLocking / CT_GroupLocking\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\n// ── Common locking attributes (AG_Locking) ──\n\nexport interface BaseLockingOptions {\n /** Prevent grouping */\n noGrp?: boolean;\n /** Prevent selection */\n noSelect?: boolean;\n /** Prevent rotation */\n noRot?: boolean;\n /** Prevent aspect ratio change */\n noChangeAspect?: boolean;\n /** Prevent moving */\n noMove?: boolean;\n /** Prevent resizing */\n noResize?: boolean;\n /** Prevent edit points */\n noEditPoints?: boolean;\n /** Prevent adjust handles */\n noAdjustHandles?: boolean;\n /** Prevent changing arrowheads */\n noChangeArrowheads?: boolean;\n /** Prevent changing shape type */\n noChangeShapeType?: boolean;\n}\n\n// ── Shape locking (CT_ShapeLocking) ──\n\nexport interface ShapeLockingOptions extends BaseLockingOptions {\n /** Prevent text editing */\n noTextEdit?: boolean;\n}\n\n// ── Picture locking (CT_PictureLocking) ──\n\nexport interface PictureLockingOptions extends BaseLockingOptions {\n /** Prevent cropping */\n noCrop?: boolean;\n}\n\n// ── Group locking (CT_GroupLocking) ──\n\nexport interface GroupLockingOptions {\n noGrp?: boolean;\n noUngrp?: boolean;\n noSelect?: boolean;\n noRot?: boolean;\n noChangeAspect?: boolean;\n noMove?: boolean;\n noResize?: boolean;\n}\n\n// ── Graphic frame locking (CT_GraphicalObjectFrameLocking) ──\n\nexport interface GraphicFrameLockingOptions {\n noGrp?: boolean;\n noDrilldown?: boolean;\n noSelect?: boolean;\n noChangeAspect?: boolean;\n noMove?: boolean;\n noResize?: boolean;\n}\n\n// ── Factory functions ──\n\nfunction toFlatAttrs(opts: Readonly<Record<string, boolean | undefined>>): Record<string, boolean> {\n const result: Record<string, boolean> = {};\n for (const key of Object.keys(opts)) {\n if (opts[key] !== undefined) {\n result[key] = opts[key]!;\n }\n }\n return result;\n}\n\nexport function createShapeLocking(opts: ShapeLockingOptions): string {\n return element(\"a:spLocks\", toFlatAttrs(opts as Record<string, boolean | undefined>));\n}\n\nexport function createPictureLocking(opts: PictureLockingOptions): string {\n return element(\"a:picLocks\", toFlatAttrs(opts as Record<string, boolean | undefined>));\n}\n\nexport function createGroupLocking(opts: GroupLockingOptions): string {\n return element(\"a:grpSpLocks\", toFlatAttrs(opts as Record<string, boolean | undefined>));\n}\n\nexport function createGraphicFrameLocking(opts: GraphicFrameLockingOptions): string {\n return element(\"a:graphicFrameLocks\", toFlatAttrs(opts as Record<string, boolean | undefined>));\n}\n","/**\n * Diagram layout variable property set elements.\n *\n * Reference: ISO/IEC 29500-4, dml-diagram.xsd\n * CT_LayoutVariablePropertySet and its child elements.\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\n// ---------------------------------------------------------------------------\n// dgm:adj — adjustment handle (CT_Adj)\n// ---------------------------------------------------------------------------\n\nexport interface AdjustOptions {\n /** 1-based index (required) */\n idx: number;\n /** Adjustment value (required) */\n val: number;\n}\n\n/** Creates a dgm:adj element. */\nexport const createAdjust = (options: AdjustOptions): string =>\n `<dgm:adj idx=\"${options.idx}\" val=\"${options.val}\"/>`;\n\n// ---------------------------------------------------------------------------\n// dgm:animLvl — animation level (CT_AnimLvl)\n// ---------------------------------------------------------------------------\n\nexport const AnimationLevelValue = {\n NONE: \"none\",\n LEVEL: \"lvl\",\n CENTER: \"ctr\",\n} as const;\n\nexport interface AnimationLevelOptions {\n val?: (typeof AnimationLevelValue)[keyof typeof AnimationLevelValue];\n}\n\n/** Creates a dgm:animLvl element. */\nexport const createAnimationLevel = (options?: AnimationLevelOptions): string =>\n options?.val !== undefined ? `<dgm:animLvl val=\"${options.val}\"/>` : \"<dgm:animLvl/>\";\n\n// ---------------------------------------------------------------------------\n// dgm:animOne — animation one-by-one (CT_AnimOne)\n// ---------------------------------------------------------------------------\n\nexport const AnimateOneByOneValue = {\n NONE: \"none\",\n ONE: \"one\",\n BRANCH: \"branch\",\n} as const;\n\nexport interface AnimateOneByOneOptions {\n val?: (typeof AnimateOneByOneValue)[keyof typeof AnimateOneByOneValue];\n}\n\n/** Creates a dgm:animOne element. */\nexport const createAnimateOneByOne = (options?: AnimateOneByOneOptions): string =>\n options?.val !== undefined ? `<dgm:animOne val=\"${options.val}\"/>` : \"<dgm:animOne/>\";\n\n// ---------------------------------------------------------------------------\n// dgm:chMax — max children constraint (CT_ChildMax)\n// ---------------------------------------------------------------------------\n\nexport interface MaxChildrenOptions {\n val?: number;\n}\n\n/** Creates a dgm:chMax element. */\nexport const createMaxChildren = (options?: MaxChildrenOptions): string =>\n options?.val !== undefined ? `<dgm:chMax val=\"${options.val}\"/>` : \"<dgm:chMax/>\";\n\n// ---------------------------------------------------------------------------\n// dgm:chPref — preferred children count (CT_ChildPref)\n// ---------------------------------------------------------------------------\n\nexport interface PreferredChildrenOptions {\n val?: number;\n}\n\n/** Creates a dgm:chPref element. */\nexport const createPreferredChildren = (options?: PreferredChildrenOptions): string =>\n options?.val !== undefined ? `<dgm:chPref val=\"${options.val}\"/>` : \"<dgm:chPref/>\";\n\n// ---------------------------------------------------------------------------\n// dgm:orgChart — organization chart flag (CT_OrgChart)\n// ---------------------------------------------------------------------------\n\nexport interface OrgChartOptions {\n val?: boolean;\n}\n\n/** Creates a dgm:orgChart element. */\nexport const createOrgChart = (options?: OrgChartOptions): string =>\n options?.val !== undefined ? `<dgm:orgChart val=\"${options.val}\"/>` : \"<dgm:orgChart/>\";\n\n// ---------------------------------------------------------------------------\n// dgm:hierBranch — hierarchy branch style (CT_HierBranchStyle)\n// ---------------------------------------------------------------------------\n\nexport const HierBranchStyle = {\n LEFT: \"l\",\n RIGHT: \"r\",\n HANGING: \"hang\",\n STANDARD: \"std\",\n INITIAL: \"init\",\n} as const;\n\nexport interface HierBranchOptions {\n val?: (typeof HierBranchStyle)[keyof typeof HierBranchStyle];\n}\n\n/** Creates a dgm:hierBranch element. */\nexport const createHierBranch = (options?: HierBranchOptions): string =>\n options?.val !== undefined ? `<dgm:hierBranch val=\"${options.val}\"/>` : \"<dgm:hierBranch/>\";\n\n// ---------------------------------------------------------------------------\n// dgm:presLayoutVars — presentation layout variables (CT_LayoutVariablePropertySet)\n// ---------------------------------------------------------------------------\n\nexport interface PresentationLayoutVariablesOptions {\n orgChart?: OrgChartOptions;\n maxChildren?: MaxChildrenOptions;\n preferredChildren?: PreferredChildrenOptions;\n animateOneByOne?: AnimateOneByOneOptions;\n animationLevel?: AnimationLevelOptions;\n hierBranch?: HierBranchOptions;\n}\n\n/**\n * Creates a dgm:presLayoutVars element (CT_LayoutVariablePropertySet).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_LayoutVariablePropertySet\">\n * <xsd:sequence>\n * <xsd:element name=\"orgChart\" type=\"CT_OrgChart\" minOccurs=\"0\"/>\n * <xsd:element name=\"chMax\" type=\"CT_ChildMax\" minOccurs=\"0\"/>\n * <xsd:element name=\"chPref\" type=\"CT_ChildPref\" minOccurs=\"0\"/>\n * <xsd:element name=\"bulletEnabled\" type=\"CT_BulletEnabled\" minOccurs=\"0\"/>\n * <xsd:element name=\"dir\" type=\"CT_Direction\" minOccurs=\"0\"/>\n * <xsd:element name=\"hierBranch\" type=\"CT_HierBranchStyle\" minOccurs=\"0\"/>\n * <xsd:element name=\"animOne\" type=\"CT_AnimOne\" minOccurs=\"0\"/>\n * <xsd:element name=\"animLvl\" type=\"CT_AnimLvl\" minOccurs=\"0\"/>\n * <xsd:element name=\"resizeHandles\" type=\"CT_ResizeHandles\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createPresentationLayoutVariables = (\n options?: PresentationLayoutVariablesOptions,\n): string => {\n const children: string[] = [];\n if (options?.orgChart) children.push(createOrgChart(options.orgChart));\n if (options?.maxChildren) children.push(createMaxChildren(options.maxChildren));\n if (options?.preferredChildren) children.push(createPreferredChildren(options.preferredChildren));\n if (options?.animateOneByOne) children.push(createAnimateOneByOne(options.animateOneByOne));\n if (options?.animationLevel) children.push(createAnimationLevel(options.animationLevel));\n if (options?.hierBranch) children.push(createHierBranch(options.hierBranch));\n\n return element(\"dgm:presLayoutVars\", undefined, children);\n};\n\n// ---------------------------------------------------------------------------\n// dgm:adjLst — adjustment list (CT_AdjLst)\n// ---------------------------------------------------------------------------\n\nexport interface AdjustListOptions {\n adjustments?: readonly AdjustOptions[];\n}\n\n/** Creates a dgm:adjLst element containing dgm:adj children. */\nexport const createAdjustList = (options?: AdjustListOptions): string => {\n const children: string[] = [];\n if (options?.adjustments) {\n for (const a of options.adjustments) {\n children.push(createAdjust(a));\n }\n }\n return element(\"dgm:adjLst\", undefined, children);\n};\n","/**\n * Diagram definition header elements.\n *\n * Reference: ISO/IEC 29500-4, dml-diagram.xsd\n * CT_ColorTransformHeader, CT_DiagramDefinitionHeader, CT_StyleDefinitionHeader\n * and their list containers.\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\n// ---------------------------------------------------------------------------\n// Shared name/description/category types\n// ---------------------------------------------------------------------------\n\nexport interface DiagramNameOptions {\n lang?: string;\n val: string;\n}\n\nexport interface DiagramDescriptionOptions {\n lang?: string;\n val: string;\n}\n\nexport interface DiagramCategoryOptions {\n type: string;\n pri: number;\n}\n\nconst createNameEl = (tag: string, options: DiagramNameOptions): string => {\n const attrs: Record<string, string> = { val: options.val };\n if (options.lang) attrs.lang = options.lang;\n return element(tag, attrs);\n};\n\nconst createDescEl = (tag: string, options: DiagramDescriptionOptions): string => {\n const attrs: Record<string, string> = { val: options.val };\n if (options.lang) attrs.lang = options.lang;\n return element(tag, attrs);\n};\n\nconst createCatEl = (options: DiagramCategoryOptions): string =>\n `<dgm:cat type=\"${options.type}\" pri=\"${options.pri}\"/>`;\n\nconst createCatLst = (categories?: readonly DiagramCategoryOptions[]): string => {\n const children: string[] = [];\n if (categories) {\n for (const cat of categories) {\n children.push(createCatEl(cat));\n }\n }\n return element(\"dgm:catLst\", undefined, children);\n};\n\n// ---------------------------------------------------------------------------\n// dgm:colorsDefHdr — color definition header (CT_ColorTransformHeader)\n// ---------------------------------------------------------------------------\n\nexport interface ColorsDefinitionHeaderOptions {\n uniqueId: string;\n minVer?: string;\n resId?: number;\n title: readonly DiagramNameOptions[];\n desc: readonly DiagramDescriptionOptions[];\n categories?: readonly DiagramCategoryOptions[];\n}\n\n/**\n * Creates a dgm:colorsDefHdr element (CT_ColorTransformHeader).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_ColorTransformHeader\">\n * <xsd:sequence>\n * <xsd:element name=\"title\" type=\"CT_CTName\" minOccurs=\"1\" maxOccurs=\"unbounded\"/>\n * <xsd:element name=\"desc\" type=\"CT_CTDescription\" minOccurs=\"1\" maxOccurs=\"unbounded\"/>\n * <xsd:element name=\"catLst\" type=\"CT_CTCategories\" minOccurs=\"0\"/>\n * <xsd:element name=\"extLst\" type=\"a:CT_OfficeArtExtensionList\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"uniqueId\" type=\"xsd:string\" use=\"required\"/>\n * <xsd:attribute name=\"minVer\" type=\"xsd:string\" use=\"optional\"/>\n * <xsd:attribute name=\"resId\" type=\"xsd:int\" use=\"optional\" default=\"0\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createColorsDefinitionHeader = (options: ColorsDefinitionHeaderOptions): string => {\n const children: string[] = [];\n for (const t of options.title) children.push(createNameEl(\"dgm:title\", t));\n for (const d of options.desc) children.push(createDescEl(\"dgm:desc\", d));\n if (options.categories?.length) children.push(createCatLst(options.categories));\n\n const attrs: Record<string, string | number> = { uniqueId: options.uniqueId };\n if (options.minVer !== undefined) attrs.minVer = options.minVer;\n if (options.resId !== undefined) attrs.resId = options.resId;\n\n return element(\"dgm:colorsDefHdr\", attrs, children);\n};\n\n// ---------------------------------------------------------------------------\n// dgm:colorsDefHdrLst — list of color definition headers (CT_ColorTransformHeaderLst)\n// ---------------------------------------------------------------------------\n\nexport interface ColorsDefinitionHeaderListOptions {\n headers?: readonly ColorsDefinitionHeaderOptions[];\n}\n\n/** Creates a dgm:colorsDefHdrLst element. */\nexport const createColorsDefinitionHeaderList = (\n options?: ColorsDefinitionHeaderListOptions,\n): string => {\n const children: string[] = [];\n if (options?.headers) {\n for (const hdr of options.headers) {\n children.push(createColorsDefinitionHeader(hdr));\n }\n }\n return element(\"dgm:colorsDefHdrLst\", undefined, children);\n};\n\n// ---------------------------------------------------------------------------\n// dgm:layoutDefHdr — layout definition header (CT_DiagramDefinitionHeader)\n// ---------------------------------------------------------------------------\n\nexport interface LayoutDefinitionHeaderOptions {\n uniqueId: string;\n minVer?: string;\n defStyle?: string;\n resId?: number;\n title: readonly DiagramNameOptions[];\n desc: readonly DiagramDescriptionOptions[];\n categories?: readonly DiagramCategoryOptions[];\n}\n\n/**\n * Creates a dgm:layoutDefHdr element (CT_DiagramDefinitionHeader).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_DiagramDefinitionHeader\">\n * <xsd:sequence>\n * <xsd:element name=\"title\" type=\"CT_Name\" minOccurs=\"1\" maxOccurs=\"unbounded\"/>\n * <xsd:element name=\"desc\" type=\"CT_Description\" minOccurs=\"1\" maxOccurs=\"unbounded\"/>\n * <xsd:element name=\"catLst\" type=\"CT_Categories\" minOccurs=\"0\"/>\n * <xsd:element name=\"extLst\" type=\"a:CT_OfficeArtExtensionList\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"uniqueId\" type=\"xsd:string\" use=\"required\"/>\n * <xsd:attribute name=\"minVer\" type=\"xsd:string\" use=\"optional\"/>\n * <xsd:attribute name=\"defStyle\" type=\"xsd:string\" use=\"optional\" default=\"\"/>\n * <xsd:attribute name=\"resId\" type=\"xsd:int\" use=\"optional\" default=\"0\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createLayoutDefinitionHeader = (options: LayoutDefinitionHeaderOptions): string => {\n const children: string[] = [];\n for (const t of options.title) children.push(createNameEl(\"dgm:title\", t));\n for (const d of options.desc) children.push(createDescEl(\"dgm:desc\", d));\n if (options.categories?.length) children.push(createCatLst(options.categories));\n\n const attrs: Record<string, string | number> = { uniqueId: options.uniqueId };\n if (options.minVer !== undefined) attrs.minVer = options.minVer;\n if (options.defStyle !== undefined) attrs.defStyle = options.defStyle;\n if (options.resId !== undefined) attrs.resId = options.resId;\n\n return element(\"dgm:layoutDefHdr\", attrs, children);\n};\n\n// ---------------------------------------------------------------------------\n// dgm:layoutDefHdrLst — list of layout definition headers (CT_DiagramDefinitionHeaderLst)\n// ---------------------------------------------------------------------------\n\nexport interface LayoutDefinitionHeaderListOptions {\n headers?: readonly LayoutDefinitionHeaderOptions[];\n}\n\n/** Creates a dgm:layoutDefHdrLst element. */\nexport const createLayoutDefinitionHeaderList = (\n options?: LayoutDefinitionHeaderListOptions,\n): string => {\n const children: string[] = [];\n if (options?.headers) {\n for (const hdr of options.headers) {\n children.push(createLayoutDefinitionHeader(hdr));\n }\n }\n return element(\"dgm:layoutDefHdrLst\", undefined, children);\n};\n\n// ---------------------------------------------------------------------------\n// dgm:styleDefHdr — style definition header (CT_StyleDefinitionHeader)\n// ---------------------------------------------------------------------------\n\nexport interface StyleDefinitionHeaderOptions {\n uniqueId: string;\n minVer?: string;\n resId?: number;\n title: readonly DiagramNameOptions[];\n desc: readonly DiagramDescriptionOptions[];\n categories?: readonly DiagramCategoryOptions[];\n}\n\n/**\n * Creates a dgm:styleDefHdr element (CT_StyleDefinitionHeader).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_StyleDefinitionHeader\">\n * <xsd:sequence>\n * <xsd:element name=\"title\" type=\"CT_SDName\" minOccurs=\"1\" maxOccurs=\"unbounded\"/>\n * <xsd:element name=\"desc\" type=\"CT_SDDescription\" minOccurs=\"1\" maxOccurs=\"unbounded\"/>\n * <xsd:element name=\"catLst\" type=\"CT_SDCategories\" minOccurs=\"0\"/>\n * <xsd:element name=\"extLst\" type=\"a:CT_OfficeArtExtensionList\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"uniqueId\" type=\"xsd:string\" use=\"required\"/>\n * <xsd:attribute name=\"minVer\" type=\"xsd:string\" use=\"optional\"/>\n * <xsd:attribute name=\"resId\" type=\"xsd:int\" use=\"optional\" default=\"0\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createStyleDefinitionHeader = (options: StyleDefinitionHeaderOptions): string => {\n const children: string[] = [];\n for (const t of options.title) children.push(createNameEl(\"dgm:title\", t));\n for (const d of options.desc) children.push(createDescEl(\"dgm:desc\", d));\n if (options.categories?.length) children.push(createCatLst(options.categories));\n\n const attrs: Record<string, string | number> = { uniqueId: options.uniqueId };\n if (options.minVer !== undefined) attrs.minVer = options.minVer;\n if (options.resId !== undefined) attrs.resId = options.resId;\n\n return element(\"dgm:styleDefHdr\", attrs, children);\n};\n\n// ---------------------------------------------------------------------------\n// dgm:styleDefHdrLst — list of style definition headers (CT_StyleDefinitionHeaderLst)\n// ---------------------------------------------------------------------------\n\nexport interface StyleDefinitionHeaderListOptions {\n headers?: readonly StyleDefinitionHeaderOptions[];\n}\n\n/** Creates a dgm:styleDefHdrLst element. */\nexport const createStyleDefinitionHeaderList = (\n options?: StyleDefinitionHeaderListOptions,\n): string => {\n const children: string[] = [];\n if (options?.headers) {\n for (const hdr of options.headers) {\n children.push(createStyleDefinitionHeader(hdr));\n }\n }\n return element(\"dgm:styleDefHdrLst\", undefined, children);\n};\n","/**\n * Diagram style, color list, and style label elements.\n *\n * Reference: ISO/IEC 29500-4, dml-diagram.xsd\n * CT_Style, CT_StyleLabel, CT_Colors, CT_CTStyleLabel\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport { SchemeColor } from \"../color/scheme-color\";\nimport type { SolidFillOptions } from \"../color/solid-fill\";\nimport { createColorElement } from \"../color/solid-fill\";\n\n// ---------------------------------------------------------------------------\n// dgm:style — diagram style (CT_ShapeStyle from dml-main.xsd)\n// ---------------------------------------------------------------------------\n\nexport const StyleMatrixIndex = {\n SUBTLE: \"subtle\",\n MODERATE: \"moderate\",\n INTENSE: \"intense\",\n} as const;\n\nexport const FontCollectionIndex = {\n MAJOR: \"major\",\n MINOR: \"minor\",\n NONE: \"none\",\n} as const;\n\n/** Reference into the theme style matrix (a:lnRef/fillRef/effectRef). */\nexport interface DiagramStyleReferenceOptions {\n /** Index into the theme style matrix (a:*Ref @idx) */\n idx: number;\n}\n\n/** Font reference (a:fontRef) — idx is a FontCollectionIndex (major/minor/none). */\nexport interface DiagramFontReferenceOptions {\n /** Font collection index (FontCollectionIndex.MAJOR/MINOR/NONE) */\n idx: string;\n}\n\nexport interface DiagramStyleOptions {\n /** Line reference (a:lnRef) */\n lineReference?: DiagramStyleReferenceOptions;\n /** Fill reference (a:fillRef) */\n fillReference?: DiagramStyleReferenceOptions;\n /** Effect reference (a:effectRef) */\n effectReference?: DiagramStyleReferenceOptions;\n /** Font reference (a:fontRef) */\n fontReference?: DiagramFontReferenceOptions;\n}\n\n/**\n * Creates a dgm:style element (a:CT_ShapeStyle).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_ShapeStyle\">\n * <xsd:sequence>\n * <xsd:element name=\"lnRef\" type=\"CT_StyleMatrixReference\"/>\n * <xsd:element name=\"fillRef\" type=\"CT_StyleMatrixReference\"/>\n * <xsd:element name=\"effectRef\" type=\"CT_StyleMatrixReference\"/>\n * <xsd:element name=\"fontRef\" type=\"CT_FontReference\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createDiagramStyle = (options?: DiagramStyleOptions): string => {\n const children: string[] = [];\n\n children.push(\n element(\"a:lnRef\", { idx: options?.lineReference?.idx ?? 1 }, [\n createColorElement({ value: SchemeColor.ACCENT1 }),\n ]),\n );\n children.push(\n element(\"a:fillRef\", { idx: options?.fillReference?.idx ?? 1 }, [\n createColorElement({ value: SchemeColor.ACCENT1 }),\n ]),\n );\n children.push(\n element(\"a:effectRef\", { idx: options?.effectReference?.idx ?? 0 }, [\n createColorElement({ value: SchemeColor.ACCENT1 }),\n ]),\n );\n children.push(\n element(\"a:fontRef\", { idx: options?.fontReference?.idx ?? \"minor\" }, [\n createColorElement({ value: SchemeColor.TX1 }),\n ]),\n );\n\n return element(\"dgm:style\", undefined, children);\n};\n\n// ---------------------------------------------------------------------------\n// Color list elements (CT_Colors) — used for fillClrLst, linClrLst, etc.\n// ---------------------------------------------------------------------------\n\nexport const ColorMethod = {\n SPAN: \"span\",\n CYCLE: \"cycle\",\n REPEAT: \"repeat\",\n} as const;\n\nexport const HueDirection = {\n CLOCKWISE: \"cw\",\n COUNTER_CLOCKWISE: \"ccw\",\n} as const;\n\nexport interface ColorListOptions {\n /** Color method (default: span) */\n meth?: (typeof ColorMethod)[keyof typeof ColorMethod];\n /** Hue direction (default: cw) */\n hueDir?: (typeof HueDirection)[keyof typeof HueDirection];\n /** Colors (EG_ColorChoice items) */\n colors?: readonly SolidFillOptions[];\n}\n\n/** Creates a generic CT_Colors element with the given tag. */\nconst createColorList = (tag: string, options?: ColorListOptions): string => {\n const children: string[] = [];\n if (options?.colors) {\n for (const c of options.colors) {\n children.push(createColorElement(c));\n }\n }\n\n const hasAttrs = options?.meth !== undefined || options?.hueDir !== undefined;\n const attrs: Record<string, string> = {};\n if (options?.meth) attrs.meth = options.meth;\n if (options?.hueDir) attrs.hueDir = options.hueDir;\n\n return element(tag, hasAttrs ? attrs : undefined, children.length > 0 ? children : undefined);\n};\n\n// ---------------------------------------------------------------------------\n// dgm:fillClrLst / dgm:linClrLst / dgm:effectClrLst (used in CT_CTStyleLabel)\n// ---------------------------------------------------------------------------\n\nexport const createFillColorList = (options?: ColorListOptions): string =>\n createColorList(\"dgm:fillClrLst\", options);\nexport const createLineColorList = (options?: ColorListOptions): string =>\n createColorList(\"dgm:linClrLst\", options);\nexport const createEffectColorList = (options?: ColorListOptions): string =>\n createColorList(\"dgm:effectClrLst\", options);\n\n// ---------------------------------------------------------------------------\n// dgm:txFillClrLst / dgm:txLinClrLst / dgm:txEffectClrLst (text color lists)\n// ---------------------------------------------------------------------------\n\nexport const createTextFillColorList = (options?: ColorListOptions): string =>\n createColorList(\"dgm:txFillClrLst\", options);\n\nexport const createTextLineColorList = (options?: ColorListOptions): string =>\n createColorList(\"dgm:txLinClrLst\", options);\n\nexport const createTextEffectColorList = (options?: ColorListOptions): string =>\n createColorList(\"dgm:txEffectClrLst\", options);\n\n// ---------------------------------------------------------------------------\n// dgm:styleLbl — style label (CT_StyleLabel)\n// ---------------------------------------------------------------------------\n\nexport interface DiagramStyleLabelOptions {\n /** Label name (required) */\n name: string;\n fillColorList?: ColorListOptions;\n lineColorList?: ColorListOptions;\n effectColorList?: ColorListOptions;\n textFillColorList?: ColorListOptions;\n textLineColorList?: ColorListOptions;\n textEffectColorList?: ColorListOptions;\n}\n\n/**\n * Creates a dgm:styleLbl element (CT_StyleLabel or CT_CTStyleLabel).\n *\n * ## XSD Schema (CT_CTStyleLabel, for color transforms)\n * ```xml\n * <xsd:complexType name=\"CT_CTStyleLabel\">\n * <xsd:sequence>\n * <xsd:element name=\"fillClrLst\" type=\"CT_Colors\" minOccurs=\"0\"/>\n * <xsd:element name=\"linClrLst\" type=\"CT_Colors\" minOccurs=\"0\"/>\n * <xsd:element name=\"effectClrLst\" type=\"CT_Colors\" minOccurs=\"0\"/>\n * <xsd:element name=\"txLinClrLst\" type=\"CT_Colors\" minOccurs=\"0\"/>\n * <xsd:element name=\"txFillClrLst\" type=\"CT_Colors\" minOccurs=\"0\"/>\n * <xsd:element name=\"txEffectClrLst\" type=\"CT_Colors\" minOccurs=\"0\"/>\n * <xsd:element name=\"extLst\" type=\"a:CT_OfficeArtExtensionList\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n *\n * ## XSD Schema (CT_StyleLabel, for quick styles)\n * ```xml\n * <xsd:complexType name=\"CT_StyleLabel\">\n * <xsd:sequence>\n * <xsd:element name=\"scene3d\" type=\"a:CT_Scene3D\" minOccurs=\"0\"/>\n * <xsd:element name=\"sp3d\" type=\"a:CT_Shape3D\" minOccurs=\"0\"/>\n * <xsd:element name=\"txPr\" type=\"CT_TextProps\" minOccurs=\"0\"/>\n * <xsd:element name=\"style\" type=\"a:CT_ShapeStyle\" minOccurs=\"0\"/>\n * <xsd:element name=\"extLst\" type=\"a:CT_OfficeArtExtensionList\" minOccurs=\"0\"/>\n * </xsd:sequence>\n * <xsd:attribute name=\"name\" type=\"xsd:string\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createStyleLabel = (options: DiagramStyleLabelOptions): string => {\n const children: string[] = [];\n if (options.fillColorList) children.push(createFillColorList(options.fillColorList));\n if (options.lineColorList) children.push(createLineColorList(options.lineColorList));\n if (options.effectColorList) children.push(createEffectColorList(options.effectColorList));\n if (options.textFillColorList) children.push(createTextFillColorList(options.textFillColorList));\n if (options.textLineColorList) children.push(createTextLineColorList(options.textLineColorList));\n if (options.textEffectColorList)\n children.push(createTextEffectColorList(options.textEffectColorList));\n\n return element(\"dgm:styleLbl\", { name: options.name }, children);\n};\n","/**\n * Diagram relationship IDs element.\n *\n * Reference: ISO/IEC 29500-4, dml-diagram.xsd, CT_RelIds\n *\n * @module\n */\n\n// ---------------------------------------------------------------------------\n// dgm:relIds — relationship IDs (CT_RelIds)\n// ---------------------------------------------------------------------------\n\nexport interface DiagramRelationshipIdsOptions {\n /** Relationship to data model part */\n dm: string;\n /** Relationship to layout definition part */\n lo: string;\n /** Relationship to quick style part */\n qs: string;\n /** Relationship to color transform part */\n cs: string;\n}\n\n/**\n * Creates a dgm:relIds element (CT_RelIds).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_RelIds\">\n * <xsd:attribute ref=\"r:dm\" use=\"required\"/>\n * <xsd:attribute ref=\"r:lo\" use=\"required\"/>\n * <xsd:attribute ref=\"r:qs\" use=\"required\"/>\n * <xsd:attribute ref=\"r:cs\" use=\"required\"/>\n * </xsd:complexType>\n * ```\n */\nexport const createDiagramRelationshipIds = (options: DiagramRelationshipIdsOptions): string =>\n `<dgm:relIds r:dm=\"${options.dm}\" r:lo=\"${options.lo}\" r:qs=\"${options.qs}\" r:cs=\"${options.cs}\"/>`;\n","/**\n * Diagram extension list, 3D shape, and text properties.\n *\n * Reference: ISO/IEC 29500-4, dml-diagram.xsd, dml-main.xsd\n *\n * @module\n */\nimport { element } from \"@office-open/xml\";\n\nimport type { Shape3DOptions } from \"../three-d/shape-3d\";\nimport { createShape3D } from \"../three-d/shape-3d\";\n\n// ---------------------------------------------------------------------------\n// dgm:extLst — extension list (a:CT_OfficeArtExtensionList)\n// ---------------------------------------------------------------------------\n\nexport interface DiagramExtensionListOptions {\n /** Extension URIs */\n extensions?: readonly DiagramExtensionOptions[];\n}\n\nexport interface DiagramExtensionOptions {\n uri: string;\n content?: string;\n}\n\n/**\n * Creates a dgm:extLst element (a:CT_OfficeArtExtensionList).\n *\n * Generic extension list pattern used across OOXML.\n */\nexport const createDiagramExtensionList = (options?: DiagramExtensionListOptions): string => {\n const children: string[] = [];\n if (options?.extensions) {\n for (const ext of options.extensions) {\n children.push(`<a:ext uri=\"${ext.uri}\"/>`);\n }\n }\n return element(\"dgm:extLst\", undefined, children);\n};\n\n// ---------------------------------------------------------------------------\n// dgm:sp3d — 3D shape properties (a:CT_Shape3D)\n// ---------------------------------------------------------------------------\n\n/**\n * Creates a dgm:sp3d element wrapping a:CT_Shape3D.\n *\n * Delegates to the shared createShape3D factory but wraps in dgm: namespace context.\n */\nexport const createDiagramShape3D = (options: Shape3DOptions): string => createShape3D(options);\n\n// ---------------------------------------------------------------------------\n// dgm:txPr — text properties (CT_TextProps)\n// ---------------------------------------------------------------------------\n\nexport interface DiagramTextPropertiesOptions {\n /** 3D text properties (flat text, no 3D) — empty element */\n flat?: boolean;\n}\n\n/**\n * Creates a dgm:txPr element (CT_TextProps).\n *\n * ## XSD Schema\n * ```xml\n * <xsd:complexType name=\"CT_TextProps\">\n * <xsd:sequence>\n * <xsd:group ref=\"a:EG_Text3D\" minOccurs=\"0\" maxOccurs=\"1\"/>\n * </xsd:sequence>\n * </xsd:complexType>\n * ```\n */\nexport const createDiagramTextProperties = (_options?: DiagramTextPropertiesOptions): string =>\n \"<dgm:txPr/>\";\n","/**\n * Color descriptors for DrawingML.\n *\n * @module\n */\n\nimport { escapeXml } from \"@office-open/xml\";\nimport type { Element as XmlElement } from \"@office-open/xml\";\n\nimport type { CustomDescriptor, ReadContext, WriteContext } from \"../../descriptor\";\nimport { stringify } from \"../../descriptor\";\nimport type { ColorTransformOptions } from \"./color-transform\";\nimport type { HslColorOptions } from \"./hsl-color\";\nimport type { PresetColorOptions } from \"./preset-color\";\nimport { PresetColor } from \"./preset-color\";\nimport type { RgbColorOptions } from \"./rgb-color\";\nimport type { ScRgbColorOptions } from \"./sc-rgb-color\";\nimport type { SchemeColorOptions } from \"./scheme-color\";\nimport { SchemeColor } from \"./scheme-color\";\nimport type { SolidFillOptions } from \"./solid-fill\";\nimport type { SystemColorOptions } from \"./system-color\";\nimport { SystemColor } from \"./system-color\";\n\n// ── Color transform helpers ──\n\nconst TRANSFORM_KEYS: readonly (keyof ColorTransformOptions & string)[] = [\n \"tint\",\n \"shade\",\n \"comp\",\n \"inv\",\n \"gray\",\n \"alpha\",\n \"alphaOff\",\n \"alphaMod\",\n \"hue\",\n \"hueOff\",\n \"hueMod\",\n \"sat\",\n \"satOff\",\n \"satMod\",\n \"lum\",\n \"lumOff\",\n \"lumMod\",\n \"red\",\n \"redOff\",\n \"redMod\",\n \"green\",\n \"greenOff\",\n \"greenMod\",\n \"blue\",\n \"blueOff\",\n \"blueMod\",\n \"gamma\",\n \"invGamma\",\n];\n\nfunction stringifyTransforms(opts: ColorTransformOptions): string {\n const parts: string[] = [];\n for (const key of TRANSFORM_KEYS) {\n const v = (opts as Record<string, unknown>)[key];\n if (v === undefined || v === false) continue;\n if (v === true) {\n parts.push(`<a:${key}/>`);\n } else {\n parts.push(`<a:${key} val=\"${escapeXml(String(v as number))}\"/>`);\n }\n }\n return parts.join(\"\");\n}\n\nfunction readTransforms(el: XmlElement): ColorTransformOptions | undefined {\n if (!el.elements || el.elements.length === 0) return undefined;\n const result: ColorTransformOptions = {};\n for (const child of el.elements) {\n if (!child.name || !child.name.startsWith(\"a:\")) continue;\n const key = child.name.slice(2) as keyof ColorTransformOptions & string;\n if (!TRANSFORM_KEYS.includes(key)) continue;\n const val = child.attributes?.[\"val\"];\n if (val !== undefined) {\n (result as Record<string, unknown>)[key] = Number(val);\n } else {\n (result as Record<string, unknown>)[key] = true;\n }\n }\n return Object.keys(result).length > 0 ? result : undefined;\n}\n\n// ── RgbColor descriptor ──\n\nexport const rgbColorDesc: CustomDescriptor<RgbColorOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const transforms = opts.transforms ? stringifyTransforms(opts.transforms) : \"\";\n if (transforms) {\n return `<a:srgbClr val=\"${escapeXml(opts.value)}\">${transforms}</a:srgbClr>`;\n }\n return `<a:srgbClr val=\"${escapeXml(opts.value)}\"/>`;\n },\n parse(el, _ctx) {\n const result: RgbColorOptions = { value: String(el.attributes?.[\"val\"] ?? \"\") };\n const transforms = readTransforms(el);\n if (transforms) result.transforms = transforms;\n return result;\n },\n};\n\n// ── SchemeColor descriptor ──\n\nexport const schemeColorDesc: CustomDescriptor<SchemeColorOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const transforms = opts.transforms ? stringifyTransforms(opts.transforms) : \"\";\n if (transforms) {\n return `<a:schemeClr val=\"${escapeXml(opts.value)}\">${transforms}</a:schemeClr>`;\n }\n return `<a:schemeClr val=\"${escapeXml(opts.value)}\"/>`;\n },\n parse(el, _ctx) {\n const result: SchemeColorOptions = {\n value: String(el.attributes?.[\"val\"] ?? \"\") as SchemeColorOptions[\"value\"],\n };\n const transforms = readTransforms(el);\n if (transforms) result.transforms = transforms;\n return result;\n },\n};\n\n// ── HslColor descriptor ──\n\nexport const hslColorDesc: CustomDescriptor<HslColorOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const transforms = opts.transforms ? stringifyTransforms(opts.transforms) : \"\";\n if (transforms) {\n return `<a:hslClr hue=\"${opts.hue}\" sat=\"${opts.saturation}\" lum=\"${opts.luminance}\">${transforms}</a:hslClr>`;\n }\n return `<a:hslClr hue=\"${opts.hue}\" sat=\"${opts.saturation}\" lum=\"${opts.luminance}\"/>`;\n },\n parse(el, _ctx) {\n const result: HslColorOptions = {\n hue: Number(el.attributes?.[\"hue\"] ?? 0),\n saturation: Number(el.attributes?.[\"sat\"] ?? 0),\n luminance: Number(el.attributes?.[\"lum\"] ?? 0),\n };\n const transforms = readTransforms(el);\n if (transforms) result.transforms = transforms;\n return result;\n },\n};\n\n// ── SystemColor descriptor ──\n\nexport const systemColorDesc: CustomDescriptor<SystemColorOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const transforms = opts.transforms ? stringifyTransforms(opts.transforms) : \"\";\n const attrParts: string[] = [`val=\"${escapeXml(opts.value)}\"`];\n if (opts.lastClr) attrParts.push(`lastClr=\"${escapeXml(opts.lastClr)}\"`);\n const attrStr = attrParts.join(\" \");\n if (transforms) {\n return `<a:sysClr ${attrStr}>${transforms}</a:sysClr>`;\n }\n return `<a:sysClr ${attrStr}/>`;\n },\n parse(el, _ctx) {\n const result: SystemColorOptions = {\n value: String(el.attributes?.[\"val\"] ?? \"\") as SystemColorOptions[\"value\"],\n };\n const lastClr = el.attributes?.[\"lastClr\"];\n if (lastClr) result.lastClr = String(lastClr);\n const transforms = readTransforms(el);\n if (transforms) result.transforms = transforms;\n return result;\n },\n};\n\n// ── PresetColor descriptor ──\n\nexport const presetColorDesc: CustomDescriptor<PresetColorOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const transforms = opts.transforms ? stringifyTransforms(opts.transforms) : \"\";\n if (transforms) {\n return `<a:prstClr val=\"${escapeXml(opts.value)}\">${transforms}</a:prstClr>`;\n }\n return `<a:prstClr val=\"${escapeXml(opts.value)}\"/>`;\n },\n parse(el, _ctx) {\n const result: PresetColorOptions = {\n value: String(el.attributes?.[\"val\"] ?? \"\") as PresetColorOptions[\"value\"],\n };\n const transforms = readTransforms(el);\n if (transforms) result.transforms = transforms;\n return result;\n },\n};\n\n// ── ScRgbColor descriptor ──\n\nexport const scRgbColorDesc: CustomDescriptor<ScRgbColorOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const transforms = opts.transforms ? stringifyTransforms(opts.transforms) : \"\";\n if (transforms) {\n return `<a:scrgbClr r=\"${escapeXml(opts.r)}\" g=\"${escapeXml(opts.g)}\" b=\"${escapeXml(opts.b)}\">${transforms}</a:scrgbClr>`;\n }\n return `<a:scrgbClr r=\"${escapeXml(opts.r)}\" g=\"${escapeXml(opts.g)}\" b=\"${escapeXml(opts.b)}\"/>`;\n },\n parse(el, _ctx) {\n const result: ScRgbColorOptions = {\n r: String(el.attributes?.[\"r\"] ?? \"\"),\n g: String(el.attributes?.[\"g\"] ?? \"\"),\n b: String(el.attributes?.[\"b\"] ?? \"\"),\n };\n const transforms = readTransforms(el);\n if (transforms) result.transforms = transforms;\n return result;\n },\n};\n\n// ── Color discrimination (SolidFillOptions) ──\n\nconst SYSTEM_COLOR_VALUES: ReadonlySet<string> = new Set(Object.values(SystemColor));\nconst PRESET_COLOR_VALUES: ReadonlySet<string> = new Set(Object.values(PresetColor));\nconst SCHEME_COLOR_VALUES: ReadonlySet<string> = new Set(Object.values(SchemeColor));\n\n/** Stringify an EG_ColorChoice (direct color element, no `a:solidFill` wrapper).\n * Used for gradient stops, fg/bg clr, and effect colors. Replaces the former\n * `getColorDescriptor` which returned a polymorphic `CustomDescriptor<any>`. */\nexport function stringifyColorChoice(color: SolidFillOptions, ctx: WriteContext): string {\n if (\"hue\" in color) return stringify(hslColorDesc, color, ctx) ?? \"\";\n if (\"r\" in color) return stringify(scRgbColorDesc, color, ctx) ?? \"\";\n // Remaining variants (rgb/scheme/system/preset) share a `value` key.\n const colorValue = (color as { value: string }).value;\n if (SYSTEM_COLOR_VALUES.has(colorValue))\n return stringify(systemColorDesc, color as SystemColorOptions, ctx) ?? \"\";\n if (PRESET_COLOR_VALUES.has(colorValue))\n return stringify(presetColorDesc, color as PresetColorOptions, ctx) ?? \"\";\n if (SCHEME_COLOR_VALUES.has(colorValue))\n return stringify(schemeColorDesc, color as SchemeColorOptions, ctx) ?? \"\";\n return stringify(rgbColorDesc, color as RgbColorOptions, ctx) ?? \"\";\n}\n\n/**\n * Parse an EG_ColorChoice from an element's direct children. Handles all six\n * color element kinds (srgbClr/schemeClr/hslClr/sysClr/prstClr/scrgbClr) —\n * used both by {@link solidFillDesc} (under a:solidFill) and by fill\n * descriptors reading direct colors under a:gs / a:fgClr / a:bgClr.\n */\nexport function parseColorChoice(el: XmlElement, ctx: ReadContext): SolidFillOptions {\n if (!el.elements) return {} as SolidFillOptions;\n for (const child of el.elements) {\n switch (child.name) {\n case \"a:srgbClr\":\n return rgbColorDesc.parse(child, ctx);\n case \"a:schemeClr\":\n return schemeColorDesc.parse(child, ctx);\n case \"a:hslClr\":\n return hslColorDesc.parse(child, ctx);\n case \"a:sysClr\":\n return systemColorDesc.parse(child, ctx);\n case \"a:prstClr\":\n return presetColorDesc.parse(child, ctx);\n case \"a:scrgbClr\":\n return scRgbColorDesc.parse(child, ctx);\n }\n }\n return {} as SolidFillOptions;\n}\n\n// ── SolidFill descriptor ──\n\nexport const solidFillDesc: CustomDescriptor<SolidFillOptions> = {\n kind: \"custom\",\n stringify(color, ctx) {\n const inner = stringifyColorChoice(color, ctx);\n if (!inner) return undefined;\n return `<a:solidFill>${inner}</a:solidFill>`;\n },\n parse(el, _ctx) {\n return parseColorChoice(el, _ctx);\n },\n};\n","/**\n * Blip descriptor for DrawingML pictures.\n *\n * @module\n */\n\nimport { escapeXml } from \"@office-open/xml\";\nimport type { Element as XmlElement } from \"@office-open/xml\";\nimport { findChild } from \"@office-open/xml\";\n\nimport type { CustomDescriptor, ReadContext, WriteContext } from \"../../descriptor\";\nimport { stringify, parse } from \"../../descriptor\";\nimport { xsdRectAlignment } from \"../../util/mappings\";\nimport { solidFillDesc } from \"../color/color-descriptors\";\nimport type { SolidFillOptions } from \"../color/solid-fill\";\nimport type { BlipOptions } from \"./blip\";\nimport type {\n BlipEffectsOptions,\n LuminanceEffectOptions,\n HSLEffectOptions,\n TintEffectOptions,\n AlphaModulateFixedEffectOptions,\n ColorChangeEffectOptions,\n BlipBlurEffectOptions,\n} from \"./blip-effects\";\nimport type { BlipFillOptions } from \"./blip-fill\";\nimport type { SourceRectangleOptions } from \"./source-rectangle\";\nimport type { TileOptions } from \"./tile\";\n\n// ── Tile descriptor (a:tile) ──\n\nexport const tileDesc: CustomDescriptor<TileOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const attrParts: string[] = [];\n if (opts.tx !== undefined) attrParts.push(`tx=\"${opts.tx}\"`);\n if (opts.ty !== undefined) attrParts.push(`ty=\"${opts.ty}\"`);\n if (opts.sx !== undefined) attrParts.push(`sx=\"${opts.sx}\"`);\n if (opts.sy !== undefined) attrParts.push(`sy=\"${opts.sy}\"`);\n if (opts.flip !== undefined) attrParts.push(`flip=\"${escapeXml(opts.flip)}\"`);\n if (opts.align !== undefined)\n attrParts.push(`algn=\"${escapeXml(xsdRectAlignment.to(opts.align))}\"`);\n const attrStr = attrParts.length ? \" \" + attrParts.join(\" \") : \"\";\n return `<a:tile${attrStr}/>`;\n },\n parse(el, _ctx) {\n const result: TileOptions = {};\n if (el.attributes?.[\"tx\"] !== undefined) result.tx = Number(el.attributes[\"tx\"]);\n if (el.attributes?.[\"ty\"] !== undefined) result.ty = Number(el.attributes[\"ty\"]);\n if (el.attributes?.[\"sx\"] !== undefined) result.sx = Number(el.attributes[\"sx\"]);\n if (el.attributes?.[\"sy\"] !== undefined) result.sy = Number(el.attributes[\"sy\"]);\n if (el.attributes?.[\"flip\"] !== undefined)\n result.flip = String(el.attributes[\"flip\"]) as TileOptions[\"flip\"];\n if (el.attributes?.[\"algn\"] !== undefined)\n result.align = xsdRectAlignment.from(String(el.attributes[\"algn\"])) as TileOptions[\"align\"];\n return result;\n },\n};\n\n// ── SourceRectangle descriptor (a:srcRect) ──\n\nexport const sourceRectangleDesc: CustomDescriptor<SourceRectangleOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const attrParts: string[] = [];\n if (opts.left !== undefined) attrParts.push(`l=\"${opts.left}\"`);\n if (opts.top !== undefined) attrParts.push(`t=\"${opts.top}\"`);\n if (opts.right !== undefined) attrParts.push(`r=\"${opts.right}\"`);\n if (opts.bottom !== undefined) attrParts.push(`b=\"${opts.bottom}\"`);\n const attrStr = attrParts.length ? \" \" + attrParts.join(\" \") : \"\";\n return `<a:srcRect${attrStr}/>`;\n },\n parse(el, _ctx) {\n const result: SourceRectangleOptions = {};\n if (el.attributes?.[\"l\"] !== undefined) result.left = Number(el.attributes[\"l\"]);\n if (el.attributes?.[\"t\"] !== undefined) result.top = Number(el.attributes[\"t\"]);\n if (el.attributes?.[\"r\"] !== undefined) result.right = Number(el.attributes[\"r\"]);\n if (el.attributes?.[\"b\"] !== undefined) result.bottom = Number(el.attributes[\"b\"]);\n return result;\n },\n};\n\n// ── Stretch descriptor (a:stretch) ──\n\nexport const stretchDesc: CustomDescriptor<SourceRectangleOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const attrParts: string[] = [];\n if (opts.left !== undefined) attrParts.push(`l=\"${opts.left}\"`);\n if (opts.top !== undefined) attrParts.push(`t=\"${opts.top}\"`);\n if (opts.right !== undefined) attrParts.push(`r=\"${opts.right}\"`);\n if (opts.bottom !== undefined) attrParts.push(`b=\"${opts.bottom}\"`);\n const attrStr = attrParts.length ? \" \" + attrParts.join(\" \") : \"\";\n return `<a:stretch><a:fillRect${attrStr}/></a:stretch>`;\n },\n parse(el, _ctx) {\n const fillRect = findChild(el, \"a:fillRect\");\n if (!fillRect) return {};\n const result: SourceRectangleOptions = {};\n if (fillRect.attributes?.[\"l\"] !== undefined) result.left = Number(fillRect.attributes[\"l\"]);\n if (fillRect.attributes?.[\"t\"] !== undefined) result.top = Number(fillRect.attributes[\"t\"]);\n if (fillRect.attributes?.[\"r\"] !== undefined) result.right = Number(fillRect.attributes[\"r\"]);\n if (fillRect.attributes?.[\"b\"] !== undefined) result.bottom = Number(fillRect.attributes[\"b\"]);\n return result;\n },\n};\n\n// ── Blip effects helpers ──\n\nfunction stringifyBlipEffects(opts: BlipEffectsOptions, ctx: WriteContext): string {\n const parts: string[] = [];\n\n if (opts.grayscale) {\n parts.push(\"<a:grayscl/>\");\n }\n\n if (opts.luminance) {\n const attrParts: string[] = [];\n if (opts.luminance.bright !== undefined) attrParts.push(`bright=\"${opts.luminance.bright}\"`);\n if (opts.luminance.contrast !== undefined)\n attrParts.push(`contrast=\"${opts.luminance.contrast}\"`);\n const attrStr = attrParts.length ? \" \" + attrParts.join(\" \") : \"\";\n parts.push(`<a:lum${attrStr}/>`);\n }\n\n if (opts.hsl) {\n const attrParts: string[] = [];\n if (opts.hsl.hue !== undefined) attrParts.push(`hue=\"${opts.hsl.hue}\"`);\n if (opts.hsl.saturation !== undefined) attrParts.push(`sat=\"${opts.hsl.saturation}\"`);\n if (opts.hsl.luminance !== undefined) attrParts.push(`lum=\"${opts.hsl.luminance}\"`);\n const attrStr = attrParts.length ? \" \" + attrParts.join(\" \") : \"\";\n parts.push(`<a:hsl${attrStr}/>`);\n }\n\n if (opts.tint) {\n const attrParts: string[] = [];\n if (opts.tint.hue !== undefined) attrParts.push(`hue=\"${opts.tint.hue}\"`);\n if (opts.tint.amount !== undefined) attrParts.push(`amt=\"${opts.tint.amount}\"`);\n const attrStr = attrParts.length ? \" \" + attrParts.join(\" \") : \"\";\n parts.push(`<a:tint${attrStr}/>`);\n }\n\n if (opts.duotone) {\n const c1 = stringify(solidFillDesc, opts.duotone.color1, ctx);\n const c2 = stringify(solidFillDesc, opts.duotone.color2, ctx);\n parts.push(`<a:duotone>${c1 ?? \"\"}${c2 ?? \"\"}</a:duotone>`);\n }\n\n if (opts.biLevel) {\n parts.push(`<a:biLevel thresh=\"${opts.biLevel.threshold}\"/>`);\n }\n\n if (opts.alphaCeiling) {\n parts.push(\"<a:alphaCeiling/>\");\n }\n\n if (opts.alphaFloor) {\n parts.push(\"<a:alphaFloor/>\");\n }\n\n if (opts.alphaInverse !== undefined) {\n if (typeof opts.alphaInverse === \"boolean\") {\n parts.push(\"<a:alphaInv/>\");\n } else {\n const colorXml = stringify(solidFillDesc, opts.alphaInverse, ctx);\n parts.push(`<a:alphaInv>${colorXml ?? \"\"}</a:alphaInv>`);\n }\n }\n\n if (opts.alphaModFix) {\n const amt = opts.alphaModFix.amount ?? 100;\n parts.push(`<a:alphaModFix amt=\"${amt}\"/>`);\n }\n\n if (opts.alphaRepl) {\n parts.push(`<a:alphaRepl a=\"${opts.alphaRepl.amount}\"/>`);\n }\n\n if (opts.alphaBiLevel) {\n parts.push(`<a:alphaBiLevel thresh=\"${opts.alphaBiLevel.threshold}\"/>`);\n }\n\n if (opts.colorChange) {\n const fromXml = stringify(solidFillDesc, opts.colorChange.from, ctx);\n const toXml = stringify(solidFillDesc, opts.colorChange.to, ctx);\n const attrParts: string[] = [];\n if (opts.colorChange.useAlpha === false) attrParts.push('useA=\"0\"');\n const attrStr = attrParts.length ? \" \" + attrParts.join(\" \") : \"\";\n parts.push(\n `<a:clrChange${attrStr}><a:clrFrom>${fromXml ?? \"\"}</a:clrFrom><a:clrTo>${toXml ?? \"\"}</a:clrTo></a:clrChange>`,\n );\n }\n\n if (opts.colorRepl) {\n const colorXml = stringify(solidFillDesc, opts.colorRepl.color, ctx);\n parts.push(`<a:clrRepl>${colorXml ?? \"\"}</a:clrRepl>`);\n }\n\n if (opts.blur) {\n const attrParts: string[] = [];\n if (opts.blur.radius !== undefined) attrParts.push(`rad=\"${opts.blur.radius}\"`);\n if (opts.blur.grow === false) attrParts.push('grow=\"0\"');\n const attrStr = attrParts.length ? \" \" + attrParts.join(\" \") : \"\";\n parts.push(`<a:blur${attrStr}/>`);\n }\n\n return parts.join(\"\");\n}\n\nfunction readBlipEffects(el: XmlElement, ctx: ReadContext): BlipEffectsOptions | undefined {\n const result: BlipEffectsOptions = {};\n\n if (findChild(el, \"a:grayscl\")) result.grayscale = true;\n\n const lum = findChild(el, \"a:lum\");\n if (lum) {\n const opts: LuminanceEffectOptions = {};\n if (lum.attributes?.[\"bright\"] !== undefined)\n opts.bright = Number(String(lum.attributes[\"bright\"]).replace(\"%\", \"\"));\n if (lum.attributes?.[\"contrast\"] !== undefined)\n opts.contrast = Number(String(lum.attributes[\"contrast\"]).replace(\"%\", \"\"));\n result.luminance = opts;\n }\n\n const hsl = findChild(el, \"a:hsl\");\n if (hsl) {\n const opts: HSLEffectOptions = {};\n if (hsl.attributes?.[\"hue\"] !== undefined) opts.hue = Number(hsl.attributes[\"hue\"]);\n if (hsl.attributes?.[\"sat\"] !== undefined)\n opts.saturation = Number(String(hsl.attributes[\"sat\"]).replace(\"%\", \"\"));\n if (hsl.attributes?.[\"lum\"] !== undefined)\n opts.luminance = Number(String(hsl.attributes[\"lum\"]).replace(\"%\", \"\"));\n result.hsl = opts;\n }\n\n const tint = findChild(el, \"a:tint\");\n if (tint) {\n const opts: TintEffectOptions = {};\n if (tint.attributes?.[\"hue\"] !== undefined) opts.hue = Number(tint.attributes[\"hue\"]);\n if (tint.attributes?.[\"amt\"] !== undefined)\n opts.amount = Number(String(tint.attributes[\"amt\"]).replace(\"%\", \"\"));\n result.tint = opts;\n }\n\n const biLevel = findChild(el, \"a:biLevel\");\n if (biLevel?.attributes?.[\"thresh\"] !== undefined) {\n result.biLevel = {\n threshold: Number(String(biLevel.attributes[\"thresh\"]).replace(\"%\", \"\")),\n };\n }\n\n if (findChild(el, \"a:alphaCeiling\")) result.alphaCeiling = true;\n if (findChild(el, \"a:alphaFloor\")) result.alphaFloor = true;\n\n const alphaInv = findChild(el, \"a:alphaInv\");\n if (alphaInv) {\n const solidFill = findChild(alphaInv, \"a:solidFill\");\n if (solidFill) {\n result.alphaInverse = parse(solidFillDesc, solidFill, ctx);\n } else {\n result.alphaInverse = {} as SolidFillOptions;\n }\n }\n\n const alphaModFix = findChild(el, \"a:alphaModFix\");\n if (alphaModFix) {\n const opts: AlphaModulateFixedEffectOptions = {};\n if (alphaModFix.attributes?.[\"amt\"] !== undefined)\n opts.amount = Number(String(alphaModFix.attributes[\"amt\"]).replace(\"%\", \"\"));\n result.alphaModFix = opts;\n }\n\n const alphaRepl = findChild(el, \"a:alphaRepl\");\n if (alphaRepl?.attributes?.[\"a\"] !== undefined) {\n result.alphaRepl = {\n amount: Number(String(alphaRepl.attributes[\"a\"]).replace(\"%\", \"\")),\n };\n }\n\n const alphaBiLevel = findChild(el, \"a:alphaBiLevel\");\n if (alphaBiLevel?.attributes?.[\"thresh\"] !== undefined) {\n result.alphaBiLevel = {\n threshold: Number(String(alphaBiLevel.attributes[\"thresh\"]).replace(\"%\", \"\")),\n };\n }\n\n const clrChange = findChild(el, \"a:clrChange\");\n if (clrChange) {\n const opts: Partial<ColorChangeEffectOptions> = {};\n if (clrChange.attributes?.[\"useA\"] !== undefined)\n opts.useAlpha = clrChange.attributes[\"useA\"] !== \"0\";\n const clrFrom = findChild(clrChange, \"a:clrFrom\");\n if (clrFrom) {\n const fromFill = findChild(clrFrom, \"a:solidFill\");\n if (fromFill) opts.from = parse(solidFillDesc, fromFill, ctx);\n }\n const clrTo = findChild(clrChange, \"a:clrTo\");\n if (clrTo) {\n const toFill = findChild(clrTo, \"a:solidFill\");\n if (toFill) opts.to = parse(solidFillDesc, toFill, ctx);\n }\n result.colorChange = opts as ColorChangeEffectOptions;\n }\n\n const clrRepl = findChild(el, \"a:clrRepl\");\n if (clrRepl) {\n const solidFill = findChild(clrRepl, \"a:solidFill\");\n if (solidFill)\n result.colorRepl = { color: parse(solidFillDesc, solidFill, ctx) as SolidFillOptions };\n }\n\n const blur = findChild(el, \"a:blur\");\n if (blur) {\n const opts: BlipBlurEffectOptions = {};\n if (blur.attributes?.[\"rad\"] !== undefined) opts.radius = Number(blur.attributes[\"rad\"]);\n if (blur.attributes?.[\"grow\"] !== undefined) opts.grow = blur.attributes[\"grow\"] !== \"0\";\n result.blur = opts;\n }\n\n const duotone = findChild(el, \"a:duotone\");\n if (duotone?.elements) {\n // Try to read two solidFill children\n const fills: SolidFillOptions[] = [];\n for (const child of duotone.elements) {\n const sf = findChild(child, \"a:solidFill\");\n if (sf) fills.push(parse(solidFillDesc, sf, ctx) as SolidFillOptions);\n }\n const [color1, color2] = fills;\n if (color1 && color2) {\n result.duotone = { color1, color2 };\n }\n }\n\n return Object.keys(result).length > 0 ? (result as BlipEffectsOptions) : undefined;\n}\n\n// ── Blip descriptor (a:blip) ──\n\nexport const blipDesc: CustomDescriptor<BlipOptions & { blipEffects?: BlipEffectsOptions }> = {\n kind: \"custom\",\n stringify(opts, ctx) {\n const attrParts: string[] = [];\n const embedValue = `{${opts.referenceId}}`;\n attrParts.push(`r:embed=\"${escapeXml(embedValue)}\"`);\n attrParts.push('cstate=\"none\"');\n const attrStr = \" \" + attrParts.join(\" \");\n\n const parts: string[] = [];\n if (opts.blipEffects) {\n parts.push(stringifyBlipEffects(opts.blipEffects, ctx));\n }\n\n const content = parts.join(\"\");\n if (!content) return `<a:blip${attrStr}/>`;\n return `<a:blip${attrStr}>${content}</a:blip>`;\n },\n parse(el, ctx) {\n const result: Partial<BlipOptions & { blipEffects?: BlipEffectsOptions }> = {};\n const embed = el.attributes?.[\"r:embed\"];\n if (embed !== undefined) {\n // Strip { and } wrapper if present\n result.referenceId = String(embed).replace(/^\\{(.+)\\}$/, \"$1\");\n }\n const link = el.attributes?.[\"r:link\"];\n if (link !== undefined) {\n result.referenceId = String(link).replace(/^\\{(.+)\\}$/, \"$1\");\n }\n const effects = readBlipEffects(el, ctx);\n if (effects) result.blipEffects = effects;\n return result as BlipOptions & { blipEffects?: BlipEffectsOptions };\n },\n};\n\n// ── BlipFill descriptor (pic:blipFill / a:blipFill) ──\n\nexport const blipFillDesc: CustomDescriptor<\n BlipFillOptions & { referenceId?: string; blipEffects?: BlipEffectsOptions }\n> = {\n kind: \"custom\",\n stringify(opts, ctx) {\n const attrParts: string[] = [];\n if (opts.dpi !== undefined) attrParts.push(`dpi=\"${opts.dpi}\"`);\n if (opts.rotWithShape !== undefined)\n attrParts.push(`rotWithShape=\"${opts.rotWithShape ? 1 : 0}\"`);\n const attrStr = attrParts.length ? \" \" + attrParts.join(\" \") : \"\";\n\n const parts: string[] = [];\n\n // Blip child (uses referenceId from parent)\n if (opts.referenceId) {\n const blipOpts = { referenceId: opts.referenceId, blipEffects: opts.blipEffects };\n const blipXml = stringify(blipDesc, blipOpts, ctx);\n if (blipXml) parts.push(blipXml);\n }\n\n // Source rectangle\n if (opts.sourceRectangle) {\n const srcRectXml = stringify(sourceRectangleDesc, opts.sourceRectangle, ctx);\n if (srcRectXml) parts.push(srcRectXml);\n }\n\n // Tile or stretch\n if (opts.tile) {\n const tileXml = stringify(tileDesc, opts.tile, ctx);\n if (tileXml) parts.push(tileXml);\n } else {\n parts.push(\"<a:stretch><a:fillRect/></a:stretch>\");\n }\n\n const content = parts.join(\"\");\n if (!attrStr && !content) return undefined;\n if (!content) return `<pic:blipFill${attrStr}/>`;\n return `<pic:blipFill${attrStr}>${content}</pic:blipFill>`;\n },\n parse(el, ctx) {\n const result: Partial<\n BlipFillOptions & { referenceId?: string; blipEffects?: BlipEffectsOptions }\n > = {};\n\n // Attributes\n if (el.attributes?.[\"dpi\"] !== undefined) result.dpi = Number(el.attributes[\"dpi\"]);\n if (el.attributes?.[\"rotWithShape\"] !== undefined)\n result.rotWithShape = el.attributes[\"rotWithShape\"] !== \"0\";\n\n // Blip child\n const blip = findChild(el, \"a:blip\");\n if (blip) {\n const blipResult = parse(blipDesc, blip, ctx);\n if (blipResult.referenceId) result.referenceId = blipResult.referenceId;\n if (blipResult.blipEffects) result.blipEffects = blipResult.blipEffects;\n }\n\n // Source rectangle\n const srcRect = findChild(el, \"a:srcRect\");\n if (srcRect) result.sourceRectangle = parse(sourceRectangleDesc, srcRect, ctx);\n\n // Tile\n const tile = findChild(el, \"a:tile\");\n if (tile) result.tile = parse(tileDesc, tile, ctx);\n\n return result as BlipFillOptions & { referenceId?: string; blipEffects?: BlipEffectsOptions };\n },\n};\n","/**\n * Fill descriptors for DrawingML EG_FillProperties.\n *\n * @module\n */\n\nimport { escapeXml } from \"@office-open/xml\";\nimport type { Element as XmlElement } from \"@office-open/xml\";\nimport { findChild } from \"@office-open/xml\";\n\nimport type { CustomDescriptor, ReadContext } from \"../../descriptor\";\nimport { stringify, parse } from \"../../descriptor\";\nimport { toUint8Array } from \"../../util/data-type\";\nimport { xsdPattern } from \"../../util/mappings\";\nimport { blipFillDesc } from \"../blip/blip-descriptors\";\nimport { solidFillDesc, parseColorChoice, stringifyColorChoice } from \"../color/color-descriptors\";\nimport type { SolidFillOptions } from \"../color/solid-fill\";\nimport { buildFill, type BlipFillConfigOptions, type FillOptions } from \"./fill-options\";\nimport type {\n GradientFillOptions,\n GradientShadeOptions,\n LinearShadeOptions,\n PathShadeOptions,\n RelativeRect,\n} from \"./gradient-fill\";\nimport type { PatternFillOptions } from \"./pattern-fill\";\n\n// ── Gradient fill helpers ──\n\nfunction stringifyRelativeRect(tag: string, rect: RelativeRect): string {\n const parts: string[] = [];\n if (rect.left) parts.push(`l=\"${escapeXml(rect.left)}\"`);\n if (rect.top) parts.push(`t=\"${escapeXml(rect.top)}\"`);\n if (rect.right) parts.push(`r=\"${escapeXml(rect.right)}\"`);\n if (rect.bottom) parts.push(`b=\"${escapeXml(rect.bottom)}\"`);\n const attrStr = parts.length ? \" \" + parts.join(\" \") : \"\";\n return `<${tag}${attrStr}/>`;\n}\n\nfunction readRelativeRect(el: XmlElement): RelativeRect {\n const result: RelativeRect = {};\n if (el.attributes?.[\"l\"]) result.left = String(el.attributes[\"l\"]);\n if (el.attributes?.[\"t\"]) result.top = String(el.attributes[\"t\"]);\n if (el.attributes?.[\"r\"]) result.right = String(el.attributes[\"r\"]);\n if (el.attributes?.[\"b\"]) result.bottom = String(el.attributes[\"b\"]);\n return result as RelativeRect;\n}\n\nfunction stringifyShade(shade: GradientShadeOptions): string {\n if (\"angle\" in shade) {\n const parts: string[] = [];\n if (shade.angle !== undefined) parts.push(`ang=\"${shade.angle}\"`);\n if (shade.scaled !== undefined) parts.push(`scaled=\"${shade.scaled ? 1 : 0}\"`);\n const attrStr = parts.length ? \" \" + parts.join(\" \") : \"\";\n return `<a:lin${attrStr}/>`;\n }\n const pathShade = shade as PathShadeOptions;\n const parts: string[] = [];\n if (pathShade.path) parts.push(`path=\"${escapeXml(pathShade.path)}\"`);\n const attrStr = parts.length ? \" \" + parts.join(\" \") : \"\";\n if (pathShade.fillToRectangle) {\n return `<a:path${attrStr}>${stringifyRelativeRect(\"a:fillToRect\", pathShade.fillToRectangle)}</a:path>`;\n }\n return `<a:path${attrStr}/>`;\n}\n\n// ── GradientFill descriptor ──\n\nexport const gradientFillDesc: CustomDescriptor<GradientFillOptions> = {\n kind: \"custom\",\n stringify(opts, ctx) {\n const parts: string[] = [];\n\n // Gradient stop list — a:gs expects EG_ColorChoice (direct color), NOT solidFill\n const stopsXml = opts.stops\n .map((stop) => {\n const colorXml = stringifyColorChoice(stop.color, ctx);\n if (!colorXml) return `<a:gs pos=\"${stop.position}\"/>`;\n return `<a:gs pos=\"${stop.position}\">${colorXml}</a:gs>`;\n })\n .join(\"\");\n parts.push(`<a:gsLst>${stopsXml}</a:gsLst>`);\n\n // Shade\n if (opts.shade) parts.push(stringifyShade(opts.shade));\n\n // Tile rect\n if (opts.tileRectangle) parts.push(stringifyRelativeRect(\"a:tileRect\", opts.tileRectangle));\n\n // Attributes\n const attrParts: string[] = [];\n if (opts.flip) attrParts.push(`flip=\"${escapeXml(opts.flip)}\"`);\n if (opts.rotateWithShape !== undefined)\n attrParts.push(`rotWithShape=\"${opts.rotateWithShape ? 1 : 0}\"`);\n const attrStr = attrParts.length ? \" \" + attrParts.join(\" \") : \"\";\n\n return `<a:gradFill${attrStr}>${parts.join(\"\")}</a:gradFill>`;\n },\n parse(el, ctx) {\n const result: Partial<GradientFillOptions> = {};\n\n // Stops — a:gs contains EG_ColorChoice directly (no solidFill wrapper)\n const gsLst = findChild(el, \"a:gsLst\");\n if (gsLst?.elements) {\n result.stops = gsLst.elements\n .filter((c) => c.name === \"a:gs\")\n .map((gs) => {\n const pos = Number(gs.attributes?.[\"pos\"] ?? 0);\n const color = readDirectColor(gs, ctx);\n return { position: pos, color };\n });\n }\n\n // Shade (a:lin or a:path)\n const lin = findChild(el, \"a:lin\");\n if (lin) {\n const shade: LinearShadeOptions = {};\n if (lin.attributes?.[\"ang\"] !== undefined) shade.angle = Number(lin.attributes[\"ang\"]);\n if (lin.attributes?.[\"scaled\"] !== undefined) shade.scaled = lin.attributes[\"scaled\"] !== \"0\";\n result.shade = shade;\n } else {\n const path = findChild(el, \"a:path\");\n if (path) {\n const shade: PathShadeOptions = {};\n if (path.attributes?.[\"path\"] !== undefined)\n shade.path = String(path.attributes[\"path\"]) as PathShadeOptions[\"path\"];\n const fillToRectangle = findChild(path, \"a:fillToRect\");\n if (fillToRectangle) shade.fillToRectangle = readRelativeRect(fillToRectangle);\n result.shade = shade;\n }\n }\n\n // Flip\n if (el.attributes?.[\"flip\"] !== undefined)\n result.flip = String(el.attributes[\"flip\"]) as GradientFillOptions[\"flip\"];\n\n // Rotate with shape\n if (el.attributes?.[\"rotWithShape\"] !== undefined)\n result.rotateWithShape = el.attributes[\"rotWithShape\"] !== \"0\";\n\n // Tile rect\n const tileRectangle = findChild(el, \"a:tileRect\");\n if (tileRectangle) result.tileRectangle = readRelativeRect(tileRectangle);\n\n return result as GradientFillOptions;\n },\n};\n\n// ── PatternFill descriptor ──\n\nexport const patternFillDesc: CustomDescriptor<PatternFillOptions> = {\n kind: \"custom\",\n stringify(opts, ctx) {\n const parts: string[] = [];\n const prst = xsdPattern.to(opts.pattern);\n\n // a:fgClr/a:bgClr expect EG_ColorChoice (direct color), NOT solidFill\n if (opts.foregroundColor) {\n const colorXml = stringifyColorChoice(opts.foregroundColor, ctx);\n if (colorXml) parts.push(`<a:fgClr>${colorXml}</a:fgClr>`);\n }\n if (opts.backgroundColor) {\n const colorXml = stringifyColorChoice(opts.backgroundColor, ctx);\n if (colorXml) parts.push(`<a:bgClr>${colorXml}</a:bgClr>`);\n }\n\n const inner = parts.join(\"\");\n return `<a:pattFill prst=\"${escapeXml(prst)}\">${inner}</a:pattFill>`;\n },\n parse(el, ctx) {\n const result: Partial<PatternFillOptions> = {};\n\n const prst = el.attributes?.[\"prst\"];\n if (prst) result.pattern = xsdPattern.from(String(prst)) as PatternFillOptions[\"pattern\"];\n\n const fgClr = findChild(el, \"a:fgClr\");\n if (fgClr) {\n result.foregroundColor = readDirectColor(fgClr, ctx);\n }\n\n const bgClr = findChild(el, \"a:bgClr\");\n if (bgClr) {\n result.backgroundColor = readDirectColor(bgClr, ctx);\n }\n\n return result as PatternFillOptions;\n },\n};\n\n// ── Fill (EG_FillProperties) descriptor ──\n\n// Infer the image-type token from a media path's file extension. Mirrors the\n// docx imageTypeFromPath helper; kept local to avoid a cross-package import.\nfunction imageTypeFromPath(\n path: string,\n): \"png\" | \"jpg\" | \"gif\" | \"bmp\" | \"tif\" | \"ico\" | \"emf\" | \"wmf\" {\n const ext = path.split(\".\").pop()?.toLowerCase() ?? \"\";\n switch (ext) {\n case \"png\":\n return \"png\";\n case \"jpg\":\n case \"jpeg\":\n return \"jpg\";\n case \"gif\":\n return \"gif\";\n case \"bmp\":\n return \"bmp\";\n case \"tif\":\n case \"tiff\":\n return \"tif\";\n case \"ico\":\n return \"ico\";\n case \"emf\":\n return \"emf\";\n case \"wmf\":\n return \"wmf\";\n default:\n return \"png\";\n }\n}\n\nexport const fillDesc: CustomDescriptor<FillOptions> = {\n kind: \"custom\",\n stringify(opts, ctx) {\n // String shorthand → solid fill\n if (typeof opts === \"string\") {\n return stringify(solidFillDesc, { value: opts.replace(\"#\", \"\") } as SolidFillOptions, ctx);\n }\n\n switch (opts.type) {\n case \"none\":\n return \"<a:noFill/>\";\n\n case \"solid\": {\n const color =\n typeof opts.color === \"string\"\n ? ({ value: opts.color.replace(\"#\", \"\") } as SolidFillOptions)\n : opts.color;\n return stringify(solidFillDesc, color, ctx);\n }\n\n case \"gradient\": {\n // Core API variant\n if (\"options\" in opts) {\n return stringify(gradientFillDesc, opts.options, ctx);\n }\n // Simplified API variant\n const gradOpts: GradientFillOptions = {\n stops: opts.stops.map((stop) => ({\n position: stop.position * 1000,\n color:\n typeof stop.color === \"string\"\n ? ({ value: stop.color.replace(\"#\", \"\") } as SolidFillOptions)\n : stop.color,\n })),\n };\n if (!opts.path && opts.angle !== undefined) {\n gradOpts.shade = { angle: opts.angle * 60000, scaled: opts.scaled ?? true };\n }\n if (opts.path) {\n gradOpts.shade = { path: opts.path };\n }\n return stringify(gradientFillDesc, gradOpts, ctx);\n }\n\n case \"blip\": {\n // Register the image media via the write context, then emit a:blipFill\n // with the returned {fileName} placeholder. The format-package compiler\n // replaces the placeholder with a relationship rId at pack time.\n const placeholder = ctx.addMedia(\n toUint8Array(opts.data, { encoding: \"base64\" }),\n opts.imageType,\n );\n return buildFill(opts, placeholder);\n }\n\n case \"pattern\": {\n const patternOpts: PatternFillOptions = {\n pattern: opts.pattern as PatternFillOptions[\"pattern\"],\n ...(opts.foregroundColor && {\n foregroundColor:\n typeof opts.foregroundColor === \"string\"\n ? ({ value: opts.foregroundColor.replace(\"#\", \"\") } as SolidFillOptions)\n : opts.foregroundColor,\n }),\n ...(opts.backgroundColor && {\n backgroundColor:\n typeof opts.backgroundColor === \"string\"\n ? ({ value: opts.backgroundColor.replace(\"#\", \"\") } as SolidFillOptions)\n : opts.backgroundColor,\n }),\n };\n return stringify(patternFillDesc, patternOpts, ctx);\n }\n\n case \"group\":\n return \"<a:grpFill/>\";\n }\n },\n parse(el, ctx) {\n // Resolve fill element — either el itself or a child\n const resolve = (tag: string): XmlElement | undefined =>\n el.name === tag ? el : findChild(el, tag);\n\n const noFill = resolve(\"a:noFill\");\n if (noFill) {\n return { type: \"none\" };\n }\n\n const solidFill = resolve(\"a:solidFill\");\n if (solidFill) {\n const color = parse(solidFillDesc, solidFill, ctx);\n return { type: \"solid\", color };\n }\n\n const gradFill = resolve(\"a:gradFill\");\n if (gradFill) {\n const gradOpts = parse(gradientFillDesc, gradFill, ctx);\n return { type: \"gradient\", options: gradOpts as GradientFillOptions };\n }\n\n const pattFill = resolve(\"a:pattFill\");\n if (pattFill) {\n const pattOpts = parse(patternFillDesc, pattFill, ctx);\n return { type: \"pattern\", ...(pattOpts as PatternFillOptions) };\n }\n\n const grpFill = resolve(\"a:grpFill\");\n if (grpFill) {\n return { type: \"group\" };\n }\n\n // Blip fill (image) — resolve r:embed to binary media via the read context\n const blipFill = resolve(\"a:blipFill\");\n if (blipFill) {\n const blipOpts = parse(blipFillDesc, blipFill, ctx);\n const mediaPath = blipOpts.referenceId\n ? ctx.resolveRelationship(blipOpts.referenceId)\n : undefined;\n const data = mediaPath ? ctx.getRaw(mediaPath) : undefined;\n if (mediaPath && data) {\n const blip: BlipFillConfigOptions & { type: \"blip\" } = {\n type: \"blip\",\n data,\n imageType: imageTypeFromPath(mediaPath),\n };\n if (blipOpts.dpi !== undefined) blip.dpi = blipOpts.dpi;\n if (blipOpts.rotWithShape !== undefined) blip.rotWithShape = blipOpts.rotWithShape;\n if (blipOpts.blipEffects) blip.blipEffects = blipOpts.blipEffects;\n if (blipOpts.sourceRectangle) blip.sourceRectangle = blipOpts.sourceRectangle;\n if (blipOpts.tile) blip.tile = blipOpts.tile;\n return blip;\n }\n }\n\n return { type: \"none\" };\n },\n};\n\n// ── Helper: read EG_ColorChoice directly from an element ──\n\nfunction readDirectColor(el: XmlElement, ctx: ReadContext): SolidFillOptions {\n // Handles all six color kinds (srgbClr/schemeClr/hslClr/sysClr/prstClr/scrgbClr).\n const color = parseColorChoice(el, ctx);\n if (Object.keys(color).length > 0) return color;\n // Fallback: try solidFill wrapper (for backward compat with old-generated XML)\n const solidFill = findChild(el, \"a:solidFill\");\n if (solidFill) return parse(solidFillDesc, solidFill, ctx);\n return { value: \"\" };\n}\n","/**\n * Outline descriptor for DrawingML shapes.\n *\n * @module\n */\n\nimport { escapeXml } from \"@office-open/xml\";\nimport type { Element as XmlElement } from \"@office-open/xml\";\nimport { findChild } from \"@office-open/xml\";\n\nimport type { CustomDescriptor } from \"../../descriptor\";\nimport { stringify, parse } from \"../../descriptor\";\nimport { convertToEmu } from \"../../util/converters\";\nimport { xsdCompoundLine, xsdLineCap, xsdPenAlignment } from \"../../util/mappings\";\nimport { solidFillDesc } from \"../color/color-descriptors\";\nimport { gradientFillDesc } from \"../fill/fill-descriptors\";\nimport type { DashStop } from \"./custom-dash\";\nimport type { LineEndOptions } from \"./line-end\";\nimport type { OutlineOptions } from \"./outline\";\n\n// ── LineEnd helpers ──\n\nfunction stringifyLineEnd(tag: string, opts: LineEndOptions): string {\n const parts: string[] = [];\n if (opts.type) parts.push(`type=\"${escapeXml(opts.type)}\"`);\n if (opts.width) parts.push(`w=\"${escapeXml(opts.width)}\"`);\n if (opts.length) parts.push(`len=\"${escapeXml(opts.length)}\"`);\n const attrStr = parts.length ? \" \" + parts.join(\" \") : \"\";\n return `<${tag}${attrStr}/>`;\n}\n\nfunction readLineEnd(el: XmlElement): LineEndOptions {\n const result: Partial<LineEndOptions> = {};\n if (el.attributes?.[\"type\"])\n result.type = String(el.attributes[\"type\"]) as LineEndOptions[\"type\"];\n if (el.attributes?.[\"w\"]) result.width = String(el.attributes[\"w\"]) as LineEndOptions[\"width\"];\n if (el.attributes?.[\"len\"])\n result.length = String(el.attributes[\"len\"]) as LineEndOptions[\"length\"];\n return result as LineEndOptions;\n}\n\n// ── Custom dash helper ──\n\nfunction stringifyCustomDash(stops: readonly DashStop[]): string {\n const inner = stops.map((s) => `<a:ds d=\"${escapeXml(s.d)}\" sp=\"${escapeXml(s.sp)}\"/>`).join(\"\");\n return `<a:custDash>${inner}</a:custDash>`;\n}\n\n// ── Outline descriptor ──\n\nexport const outlineDesc: CustomDescriptor<OutlineOptions> = {\n kind: \"custom\",\n stringify(opts, ctx) {\n const parts: string[] = [];\n\n // Attributes\n const attrParts: string[] = [];\n // ST_LineWidth is EMU (integer) or a universal measure; normalize so the\n // descriptor path matches createOutline (outline.ts) and stays XSD-valid.\n if (opts.width !== undefined) attrParts.push(`w=\"${convertToEmu(opts.width)}\"`);\n // Map full-word enums to XSD tokens (rnd/sng/ctr), matching createOutline.\n if (opts.cap !== undefined) attrParts.push(`cap=\"${escapeXml(xsdLineCap.to(opts.cap))}\"`);\n if (opts.compoundLine !== undefined)\n attrParts.push(`cmpd=\"${escapeXml(xsdCompoundLine.to(opts.compoundLine))}\"`);\n if (opts.align !== undefined)\n attrParts.push(`algn=\"${escapeXml(xsdPenAlignment.to(opts.align))}\"`);\n const attrStr = attrParts.length ? \" \" + attrParts.join(\" \") : \"\";\n\n // Fill\n if (opts.type === \"noFill\") {\n parts.push(\"<a:noFill/>\");\n } else if (opts.type === \"solidFill\" && opts.color) {\n const fillXml = stringify(solidFillDesc, opts.color, ctx);\n if (fillXml) parts.push(fillXml);\n } else if (opts.type === \"gradFill\" && opts.gradientFill) {\n const gradXml = stringify(gradientFillDesc, opts.gradientFill, ctx);\n if (gradXml) parts.push(gradXml);\n }\n\n // Dash\n if (opts.customDash) {\n parts.push(stringifyCustomDash(opts.customDash));\n } else if (opts.dash) {\n parts.push(`<a:prstDash val=\"${escapeXml(opts.dash)}\"/>`);\n }\n\n // Join\n if (opts.join) {\n if (opts.join === \"miter\" && opts.miterLimit !== undefined) {\n parts.push(`<a:miter lim=\"${opts.miterLimit}\"/>`);\n } else {\n parts.push(`<a:${opts.join}/>`);\n }\n }\n\n // Line ends\n if (opts.headEnd) parts.push(stringifyLineEnd(\"a:headEnd\", opts.headEnd));\n if (opts.tailEnd) parts.push(stringifyLineEnd(\"a:tailEnd\", opts.tailEnd));\n\n if (parts.length === 0 && !attrStr) return undefined;\n if (parts.length === 0) return `<a:ln${attrStr}/>`;\n return `<a:ln${attrStr}>${parts.join(\"\")}</a:ln>`;\n },\n parse(el, _ctx) {\n const result: OutlineOptions = {};\n\n // Attributes\n if (el.attributes) {\n if (el.attributes[\"w\"] !== undefined) result.width = Number(el.attributes[\"w\"]);\n // Reverse-map XSD tokens back to full-word enums so the parsed Options\n // match the user-facing type (round/single/center), not raw tokens.\n if (el.attributes[\"cap\"] !== undefined)\n result.cap = xsdLineCap.from(String(el.attributes[\"cap\"])) as OutlineOptions[\"cap\"];\n if (el.attributes[\"cmpd\"] !== undefined)\n result.compoundLine = xsdCompoundLine.from(\n String(el.attributes[\"cmpd\"]),\n ) as OutlineOptions[\"compoundLine\"];\n if (el.attributes[\"algn\"] !== undefined)\n result.align = xsdPenAlignment.from(\n String(el.attributes[\"algn\"]),\n ) as OutlineOptions[\"align\"];\n }\n\n // Fill\n const solidFill = findChild(el, \"a:solidFill\");\n if (solidFill) {\n result.type = \"solidFill\";\n result.color = parse(solidFillDesc, solidFill, _ctx);\n }\n if (findChild(el, \"a:noFill\")) {\n result.type = \"noFill\";\n }\n if (findChild(el, \"a:gradFill\")) {\n result.type = \"gradFill\";\n const gradFill = findChild(el, \"a:gradFill\")!;\n result.gradientFill = parse(gradientFillDesc, gradFill, _ctx);\n }\n\n // Dash\n const prstDash = findChild(el, \"a:prstDash\");\n if (prstDash?.attributes?.[\"val\"])\n result.dash = String(prstDash.attributes[\"val\"]) as OutlineOptions[\"dash\"];\n const custDash = findChild(el, \"a:custDash\");\n if (custDash?.elements) {\n result.customDash = custDash.elements\n .filter((c) => c.name === \"a:ds\")\n .map((c) => ({\n d: String(c.attributes?.[\"d\"] ?? \"\"),\n sp: String(c.attributes?.[\"sp\"] ?? \"\"),\n }));\n }\n\n // Join\n if (findChild(el, \"a:round\")) result.join = \"round\";\n else if (findChild(el, \"a:bevel\")) result.join = \"bevel\";\n else {\n const miter = findChild(el, \"a:miter\");\n if (miter) {\n result.join = \"miter\";\n if (miter.attributes?.[\"lim\"]) result.miterLimit = Number(miter.attributes[\"lim\"]);\n }\n }\n\n // Line ends\n const headEnd = findChild(el, \"a:headEnd\");\n if (headEnd) result.headEnd = readLineEnd(headEnd);\n const tailEnd = findChild(el, \"a:tailEnd\");\n if (tailEnd) result.tailEnd = readLineEnd(tailEnd);\n\n return result;\n },\n};\n","/**\n * Effect list descriptor for DrawingML shapes.\n *\n * @module\n */\n\nimport { escapeXml } from \"@office-open/xml\";\nimport type { Element as XmlElement } from \"@office-open/xml\";\nimport { findChild } from \"@office-open/xml\";\n\nimport type { CustomDescriptor, ReadContext, WriteContext } from \"../../descriptor\";\nimport { xsdBlendMode, xsdRectAlignment } from \"../../util/mappings\";\nimport { parseColorChoice, stringifyColorChoice } from \"../color/color-descriptors\";\nimport type { SolidFillOptions } from \"../color/solid-fill\";\nimport type { BlurEffectOptions, EffectListOptions } from \"./effect-list\";\nimport type { FillOverlayEffectOptions } from \"./fill-overlay\";\nimport type { GlowEffectOptions } from \"./glow\";\nimport type { InnerShadowEffectOptions } from \"./inner-shadow\";\nimport type { OuterShadowEffectOptions } from \"./outer-shadow\";\nimport type { PresetShadowEffectOptions } from \"./preset-shadow\";\nimport type { ReflectionEffectOptions } from \"./reflection\";\n\n// ── Helper: stringify a color into an effect element ──\n\nfunction stringifyEffectColor(\n color: SolidFillOptions | undefined,\n ctx: WriteContext,\n): string | undefined {\n if (!color) return undefined;\n // Effect elements expect EG_ColorChoice (direct color), NOT wrapped in solidFill\n return stringifyColorChoice(color, ctx);\n}\n\nfunction stringifyColorEffect(\n tag: string,\n attrs: Record<string, string | number | undefined>,\n color: SolidFillOptions | undefined,\n ctx: WriteContext,\n): string | undefined {\n const attrParts: string[] = [];\n for (const [key, val] of Object.entries(attrs)) {\n if (val !== undefined) attrParts.push(`${key}=\"${escapeXml(String(val as number | string))}\"`);\n }\n const attrStr = attrParts.length ? \" \" + attrParts.join(\" \") : \"\";\n\n const colorXml = stringifyEffectColor(color, ctx);\n if (!colorXml && !attrStr) return undefined;\n\n if (!colorXml) return `<${tag}${attrStr}/>`;\n return `<${tag}${attrStr}>${colorXml}</${tag}>`;\n}\n\nfunction readColorFromElement(el: XmlElement, ctx: ReadContext): SolidFillOptions | undefined {\n // Effect elements contain EG_ColorChoice directly (not wrapped in solidFill).\n // Reuse parseColorChoice for full coverage (srgb/scheme/hsl/sys/prst/scrgb + transforms).\n const color = parseColorChoice(el, ctx);\n if (!color || Object.keys(color).length === 0) return undefined;\n return color;\n}\n\n// ── EffectList descriptor ──\n\nexport const effectListDesc: CustomDescriptor<EffectListOptions> = {\n kind: \"custom\",\n stringify(opts, ctx) {\n const parts: string[] = [];\n\n // Blur\n if (opts.blur) {\n const attrParts: string[] = [];\n if (opts.blur.radius !== undefined) attrParts.push(`rad=\"${opts.blur.radius}\"`);\n if (opts.blur.grow === false) attrParts.push('grow=\"0\"');\n const attrStr = attrParts.length ? \" \" + attrParts.join(\" \") : \"\";\n parts.push(`<a:blur${attrStr}/>`);\n }\n\n // Fill overlay\n if (opts.fillOverlay) {\n parts.push(`<a:fillOverlay blend=\"${escapeXml(xsdBlendMode.to(opts.fillOverlay.blend))}\"/>`);\n }\n\n // Glow\n if (opts.glow) {\n parts.push(\n stringifyColorEffect(\"a:glow\", { rad: opts.glow.radius }, opts.glow.color, ctx) ?? \"\",\n );\n }\n\n // Inner shadow\n if (opts.innerShadow) {\n parts.push(\n stringifyColorEffect(\n \"a:innerShdw\",\n {\n blurRad: opts.innerShadow.blurRadius,\n dist: opts.innerShadow.distance,\n dir: opts.innerShadow.direction,\n },\n opts.innerShadow.color,\n ctx,\n ) ?? \"\",\n );\n }\n\n // Outer shadow\n if (opts.outerShadow) {\n parts.push(\n stringifyColorEffect(\n \"a:outerShdw\",\n {\n blurRad: opts.outerShadow.blurRadius,\n dist: opts.outerShadow.distance,\n dir: opts.outerShadow.direction,\n sx: opts.outerShadow.scaleX,\n sy: opts.outerShadow.scaleY,\n kx: opts.outerShadow.skewX,\n ky: opts.outerShadow.skewY,\n algn:\n opts.outerShadow.alignment !== undefined\n ? xsdRectAlignment.to(opts.outerShadow.alignment)\n : undefined,\n rotWithShape: opts.outerShadow.rotWithShape === false ? 0 : undefined,\n },\n opts.outerShadow.color,\n ctx,\n ) ?? \"\",\n );\n }\n\n // Preset shadow\n if (opts.presetShadow) {\n parts.push(\n stringifyColorEffect(\n \"a:prstShdw\",\n {\n prst: opts.presetShadow.preset,\n dist: opts.presetShadow.distance,\n dir: opts.presetShadow.direction,\n },\n opts.presetShadow.color,\n ctx,\n ) ?? \"\",\n );\n }\n\n // Reflection\n if (opts.reflection) {\n const refOpts = opts.reflection === true ? ({} as ReflectionEffectOptions) : opts.reflection;\n const attrParts: string[] = [];\n if (refOpts.blurRadius !== undefined) attrParts.push(`blurRad=\"${refOpts.blurRadius}\"`);\n if (refOpts.startAlpha !== undefined) attrParts.push(`stA=\"${refOpts.startAlpha}\"`);\n if (refOpts.startPosition !== undefined) attrParts.push(`stPos=\"${refOpts.startPosition}\"`);\n if (refOpts.endAlpha !== undefined) attrParts.push(`endA=\"${refOpts.endAlpha}\"`);\n if (refOpts.endPosition !== undefined) attrParts.push(`endPos=\"${refOpts.endPosition}\"`);\n if (refOpts.distance !== undefined) attrParts.push(`dist=\"${refOpts.distance}\"`);\n if (refOpts.direction !== undefined) attrParts.push(`dir=\"${refOpts.direction}\"`);\n if (refOpts.fadeDirection !== undefined) attrParts.push(`fadeDir=\"${refOpts.fadeDirection}\"`);\n if (refOpts.scaleX !== undefined) attrParts.push(`sx=\"${refOpts.scaleX}\"`);\n if (refOpts.scaleY !== undefined) attrParts.push(`sy=\"${refOpts.scaleY}\"`);\n if (refOpts.skewX !== undefined) attrParts.push(`kx=\"${refOpts.skewX}\"`);\n if (refOpts.skewY !== undefined) attrParts.push(`ky=\"${refOpts.skewY}\"`);\n if (refOpts.alignment !== undefined)\n attrParts.push(`algn=\"${escapeXml(xsdRectAlignment.to(refOpts.alignment))}\"`);\n if (refOpts.rotWithShape !== undefined)\n attrParts.push(`rotWithShape=\"${refOpts.rotWithShape ? 1 : 0}\"`);\n const attrStr = attrParts.length ? \" \" + attrParts.join(\" \") : \"\";\n parts.push(`<a:reflection${attrStr}/>`);\n }\n\n // Soft edge\n if (opts.softEdge !== undefined) {\n parts.push(`<a:softEdge rad=\"${opts.softEdge}\"/>`);\n }\n\n // Filter empty strings\n const content = parts.filter(Boolean).join(\"\");\n if (!content) return undefined;\n return `<a:effectLst>${content}</a:effectLst>`;\n },\n parse(el, ctx) {\n const result: EffectListOptions = {};\n\n // Blur\n const blur = findChild(el, \"a:blur\");\n if (blur) {\n const blurOpts: BlurEffectOptions = {};\n if (blur.attributes?.[\"rad\"] !== undefined) blurOpts.radius = Number(blur.attributes[\"rad\"]);\n if (blur.attributes?.[\"grow\"] !== undefined) blurOpts.grow = blur.attributes[\"grow\"] !== \"0\";\n result.blur = blurOpts;\n }\n\n // Glow\n const glow = findChild(el, \"a:glow\");\n if (glow) {\n const glowOpts: Partial<GlowEffectOptions> = {};\n if (glow.attributes?.[\"rad\"] !== undefined) glowOpts.radius = Number(glow.attributes[\"rad\"]);\n const color = readColorFromElement(glow, ctx);\n if (color) glowOpts.color = color;\n result.glow = glowOpts as GlowEffectOptions;\n }\n\n // Inner shadow\n const innerShdw = findChild(el, \"a:innerShdw\");\n if (innerShdw) {\n const innerOpts: Partial<InnerShadowEffectOptions> = {};\n if (innerShdw.attributes?.[\"blurRad\"] !== undefined)\n innerOpts.blurRadius = Number(innerShdw.attributes[\"blurRad\"]);\n if (innerShdw.attributes?.[\"dist\"] !== undefined)\n innerOpts.distance = Number(innerShdw.attributes[\"dist\"]);\n if (innerShdw.attributes?.[\"dir\"] !== undefined)\n innerOpts.direction = Number(innerShdw.attributes[\"dir\"]);\n const color = readColorFromElement(innerShdw, ctx);\n if (color) innerOpts.color = color;\n result.innerShadow = innerOpts as InnerShadowEffectOptions;\n }\n\n // Outer shadow\n const outerShdw = findChild(el, \"a:outerShdw\");\n if (outerShdw) {\n const outerOpts: Partial<OuterShadowEffectOptions> = {};\n if (outerShdw.attributes?.[\"blurRad\"] !== undefined)\n outerOpts.blurRadius = Number(outerShdw.attributes[\"blurRad\"]);\n if (outerShdw.attributes?.[\"dist\"] !== undefined)\n outerOpts.distance = Number(outerShdw.attributes[\"dist\"]);\n if (outerShdw.attributes?.[\"dir\"] !== undefined)\n outerOpts.direction = Number(outerShdw.attributes[\"dir\"]);\n if (outerShdw.attributes?.[\"sx\"] !== undefined)\n outerOpts.scaleX = Number(outerShdw.attributes[\"sx\"]);\n if (outerShdw.attributes?.[\"sy\"] !== undefined)\n outerOpts.scaleY = Number(outerShdw.attributes[\"sy\"]);\n if (outerShdw.attributes?.[\"kx\"] !== undefined)\n outerOpts.skewX = Number(outerShdw.attributes[\"kx\"]);\n if (outerShdw.attributes?.[\"ky\"] !== undefined)\n outerOpts.skewY = Number(outerShdw.attributes[\"ky\"]);\n if (outerShdw.attributes?.[\"algn\"] !== undefined)\n outerOpts.alignment = xsdRectAlignment.from(\n String(outerShdw.attributes[\"algn\"]),\n ) as OuterShadowEffectOptions[\"alignment\"];\n if (outerShdw.attributes?.[\"rotWithShape\"] !== undefined)\n outerOpts.rotWithShape = outerShdw.attributes[\"rotWithShape\"] !== \"0\";\n const color = readColorFromElement(outerShdw, ctx);\n if (color) outerOpts.color = color;\n result.outerShadow = outerOpts as OuterShadowEffectOptions;\n }\n\n // Fill overlay\n const fillOverlay = findChild(el, \"a:fillOverlay\");\n if (fillOverlay) {\n const overlayOpts: Partial<FillOverlayEffectOptions> = {};\n if (fillOverlay.attributes?.[\"blend\"] !== undefined)\n overlayOpts.blend = xsdBlendMode.from(\n String(fillOverlay.attributes[\"blend\"]),\n ) as FillOverlayEffectOptions[\"blend\"];\n result.fillOverlay = overlayOpts as FillOverlayEffectOptions;\n }\n\n // Preset shadow\n const prstShdw = findChild(el, \"a:prstShdw\");\n if (prstShdw) {\n const prstOpts: Partial<PresetShadowEffectOptions> = {};\n if (prstShdw.attributes?.[\"prst\"] !== undefined)\n prstOpts.preset = String(\n prstShdw.attributes[\"prst\"],\n ) as PresetShadowEffectOptions[\"preset\"];\n if (prstShdw.attributes?.[\"dist\"] !== undefined)\n prstOpts.distance = Number(prstShdw.attributes[\"dist\"]);\n if (prstShdw.attributes?.[\"dir\"] !== undefined)\n prstOpts.direction = Number(prstShdw.attributes[\"dir\"]);\n const color = readColorFromElement(prstShdw, ctx);\n if (color) prstOpts.color = color;\n result.presetShadow = prstOpts as PresetShadowEffectOptions;\n }\n\n // Reflection\n const reflection = findChild(el, \"a:reflection\");\n if (reflection) {\n const refOpts: ReflectionEffectOptions = {};\n if (reflection.attributes?.[\"blurRad\"] !== undefined)\n refOpts.blurRadius = Number(reflection.attributes[\"blurRad\"]);\n if (reflection.attributes?.[\"stA\"] !== undefined)\n refOpts.startAlpha = Number(reflection.attributes[\"stA\"]);\n if (reflection.attributes?.[\"stPos\"] !== undefined)\n refOpts.startPosition = Number(reflection.attributes[\"stPos\"]);\n if (reflection.attributes?.[\"endA\"] !== undefined)\n refOpts.endAlpha = Number(reflection.attributes[\"endA\"]);\n if (reflection.attributes?.[\"endPos\"] !== undefined)\n refOpts.endPosition = Number(reflection.attributes[\"endPos\"]);\n if (reflection.attributes?.[\"dist\"] !== undefined)\n refOpts.distance = Number(reflection.attributes[\"dist\"]);\n if (reflection.attributes?.[\"dir\"] !== undefined)\n refOpts.direction = Number(reflection.attributes[\"dir\"]);\n if (reflection.attributes?.[\"fadeDir\"] !== undefined)\n refOpts.fadeDirection = Number(reflection.attributes[\"fadeDir\"]);\n if (reflection.attributes?.[\"sx\"] !== undefined)\n refOpts.scaleX = Number(reflection.attributes[\"sx\"]);\n if (reflection.attributes?.[\"sy\"] !== undefined)\n refOpts.scaleY = Number(reflection.attributes[\"sy\"]);\n if (reflection.attributes?.[\"kx\"] !== undefined)\n refOpts.skewX = Number(reflection.attributes[\"kx\"]);\n if (reflection.attributes?.[\"ky\"] !== undefined)\n refOpts.skewY = Number(reflection.attributes[\"ky\"]);\n if (reflection.attributes?.[\"algn\"] !== undefined)\n refOpts.alignment = xsdRectAlignment.from(String(reflection.attributes[\"algn\"]));\n if (reflection.attributes?.[\"rotWithShape\"] !== undefined)\n refOpts.rotWithShape = reflection.attributes[\"rotWithShape\"] !== \"0\";\n result.reflection = refOpts;\n }\n\n // Soft edge\n const softEdge = findChild(el, \"a:softEdge\");\n if (softEdge?.attributes?.[\"rad\"] !== undefined) {\n result.softEdge = Number(softEdge.attributes[\"rad\"]);\n }\n\n return result;\n },\n};\n","/**\n * Locking descriptor for DrawingML shapes.\n *\n * @module\n */\n\nimport type { Element as XmlElement } from \"@office-open/xml\";\n\nimport type { CustomDescriptor } from \"../../descriptor\";\nimport type {\n BaseLockingOptions,\n GraphicFrameLockingOptions,\n GroupLockingOptions,\n PictureLockingOptions,\n ShapeLockingOptions,\n} from \"./locking\";\n\n// ── Common locking attribute keys ──\n\nconst BASE_LOCKING_KEYS: readonly (keyof BaseLockingOptions & string)[] = [\n \"noGrp\",\n \"noSelect\",\n \"noRot\",\n \"noChangeAspect\",\n \"noMove\",\n \"noResize\",\n \"noEditPoints\",\n \"noAdjustHandles\",\n \"noChangeArrowheads\",\n \"noChangeShapeType\",\n];\n\nconst SHAPE_EXTRA_KEYS: readonly (keyof ShapeLockingOptions & string)[] = [\"noTextEdit\"];\nconst PICTURE_EXTRA_KEYS: readonly (keyof PictureLockingOptions & string)[] = [\"noCrop\"];\nconst GROUP_EXTRA_KEYS: readonly (keyof GroupLockingOptions & string)[] = [\"noUngrp\"];\nconst FRAME_EXTRA_KEYS: readonly (keyof GraphicFrameLockingOptions & string)[] = [\"noDrilldown\"];\n\n// ── Helper: stringify boolean attributes ──\n\nfunction stringifyLockingAttrs(\n opts: Readonly<Record<string, boolean | undefined>>,\n keys: readonly string[],\n): string {\n const parts: string[] = [];\n for (const key of keys) {\n if (opts[key] !== undefined) {\n parts.push(`${key}=\"${opts[key] ? 1 : 0}\"`);\n }\n }\n return parts.length ? \" \" + parts.join(\" \") : \"\";\n}\n\nfunction readLockingAttrs(el: XmlElement, keys: readonly string[]): Record<string, boolean> {\n const result: Record<string, boolean> = {};\n if (!el.attributes) return result;\n for (const key of keys) {\n const val = el.attributes[key];\n if (val !== undefined) result[key] = val === \"1\" || val === 1 || val === \"true\";\n }\n return result;\n}\n\n// ── Shape locking descriptor ──\n\nexport const shapeLockingDesc: CustomDescriptor<ShapeLockingOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const allKeys = [...BASE_LOCKING_KEYS, ...SHAPE_EXTRA_KEYS];\n const attrStr = stringifyLockingAttrs(opts as Record<string, boolean | undefined>, allKeys);\n if (!attrStr) return undefined;\n return `<a:spLocks${attrStr}/>`;\n },\n parse(el, _ctx) {\n const allKeys = [...BASE_LOCKING_KEYS, ...SHAPE_EXTRA_KEYS];\n return readLockingAttrs(el, allKeys);\n },\n};\n\n// ── Picture locking descriptor ──\n\nexport const pictureLockingDesc: CustomDescriptor<PictureLockingOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const allKeys = [...BASE_LOCKING_KEYS, ...PICTURE_EXTRA_KEYS];\n const attrStr = stringifyLockingAttrs(opts as Record<string, boolean | undefined>, allKeys);\n if (!attrStr) return undefined;\n return `<a:picLocks${attrStr}/>`;\n },\n parse(el, _ctx) {\n const allKeys = [...BASE_LOCKING_KEYS, ...PICTURE_EXTRA_KEYS];\n return readLockingAttrs(el, allKeys);\n },\n};\n\n// ── Group locking descriptor ──\n\nexport const groupLockingDesc: CustomDescriptor<GroupLockingOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const allKeys = [...BASE_LOCKING_KEYS, ...GROUP_EXTRA_KEYS];\n const attrStr = stringifyLockingAttrs(opts as Record<string, boolean | undefined>, allKeys);\n if (!attrStr) return undefined;\n return `<a:grpSpLocks${attrStr}/>`;\n },\n parse(el, _ctx) {\n const allKeys = [...BASE_LOCKING_KEYS, ...GROUP_EXTRA_KEYS];\n return readLockingAttrs(el, allKeys);\n },\n};\n\n// ── Graphic frame locking descriptor ──\n\nexport const graphicFrameLockingDesc: CustomDescriptor<GraphicFrameLockingOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const allKeys = [...BASE_LOCKING_KEYS, ...FRAME_EXTRA_KEYS];\n const attrStr = stringifyLockingAttrs(opts as Record<string, boolean | undefined>, allKeys);\n if (!attrStr) return undefined;\n return `<a:graphicFrameLocks${attrStr}/>`;\n },\n parse(el, _ctx) {\n const allKeys = [...BASE_LOCKING_KEYS, ...FRAME_EXTRA_KEYS];\n return readLockingAttrs(el, allKeys);\n },\n};\n","/**\n * Geometry descriptors for DrawingML shapes.\n *\n * @module\n */\n\nimport { escapeXml, findChild } from \"@office-open/xml\";\nimport type { Element as XmlElement } from \"@office-open/xml\";\n\nimport type { CustomDescriptor } from \"../../descriptor\";\nimport { stringify, parse } from \"../../descriptor\";\nimport type { GeometryGuide } from \"./adjustment-values\";\nimport type {\n CustomGeometryOptions,\n PathOptions,\n PathCommand,\n AdjustPoint,\n AdjustHandle,\n XYAdjustHandle,\n PolarAdjustHandle,\n ConnectionSite,\n GeomRect,\n} from \"./custom-geometry\";\nimport type { PresetGeometryOptions } from \"./preset-geometry\";\n\n// ── Adjustment values helper ──\n\nconst adjustmentValuesDesc: CustomDescriptor<readonly GeometryGuide[]> = {\n kind: \"custom\",\n stringify(guides, _ctx) {\n if (!guides || guides.length === 0) return \"<a:avLst/>\";\n const inner = guides\n .map((g) => `<a:gd name=\"${escapeXml(g.name)}\" fmla=\"${escapeXml(g.formula)}\"/>`)\n .join(\"\");\n return `<a:avLst>${inner}</a:avLst>`;\n },\n parse(el, _ctx) {\n const result: GeometryGuide[] = [];\n if (el.elements) {\n for (const child of el.elements) {\n if (child.name === \"a:gd\" && child.attributes) {\n const name = child.attributes[\"name\"];\n const fmla = child.attributes[\"fmla\"];\n if (name !== undefined && fmla !== undefined) {\n result.push({ name: String(name), formula: String(fmla) });\n }\n }\n }\n }\n return result as readonly GeometryGuide[];\n },\n};\n\n// ── Preset geometry descriptor ──\n\nexport const presetGeometryDesc: CustomDescriptor<PresetGeometryOptions> = {\n kind: \"custom\",\n stringify(opts, ctx) {\n const prst = opts.preset ?? \"rect\";\n let avXml = \"\";\n if (opts.adjustmentValues) {\n avXml = stringify(adjustmentValuesDesc, opts.adjustmentValues, ctx) ?? \"<a:avLst/>\";\n } else {\n avXml = \"<a:avLst/>\";\n }\n return `<a:prstGeom prst=\"${escapeXml(prst)}\">${avXml}</a:prstGeom>`;\n },\n parse(el, ctx) {\n const result: PresetGeometryOptions = {};\n if (el.attributes?.[\"prst\"] !== undefined) {\n result.preset = String(el.attributes[\"prst\"]);\n }\n const avLst = findChild(el, \"a:avLst\");\n if (avLst) {\n const guides = parse(adjustmentValuesDesc, avLst, ctx);\n if (guides.length > 0) {\n result.adjustmentValues = guides;\n }\n }\n return result;\n },\n};\n\n// ── Path command helpers ──\n\nfunction stringifyAdjustPoint(pt: AdjustPoint): string {\n return `<a:pt x=\"${escapeXml(pt.x)}\" y=\"${escapeXml(pt.y)}\"/>`;\n}\n\nfunction stringifyPathCommand(cmd: PathCommand): string {\n switch (cmd.command) {\n case \"moveTo\":\n return `<a:moveTo>${stringifyAdjustPoint(cmd.point)}</a:moveTo>`;\n case \"lineTo\":\n return `<a:lnTo>${stringifyAdjustPoint(cmd.point)}</a:lnTo>`;\n case \"arcTo\":\n return (\n `<a:arcTo wR=\"${escapeXml(cmd.widthRadius)}\" hR=\"${escapeXml(cmd.heightRadius)}\"` +\n ` stAng=\"${escapeXml(cmd.startAngle)}\" swAng=\"${escapeXml(cmd.sweepAngle)}\"/>`\n );\n case \"quadBezTo\": {\n const pts = cmd.points.map(stringifyAdjustPoint).join(\"\");\n return `<a:quadBezTo>${pts}</a:quadBezTo>`;\n }\n case \"cubicBezTo\": {\n const pts = cmd.points.map(stringifyAdjustPoint).join(\"\");\n return `<a:cubicBezTo>${pts}</a:cubicBezTo>`;\n }\n case \"close\":\n return \"<a:close/>\";\n }\n}\n\nfunction stringifyPath(path: PathOptions): string {\n const attrs: string[] = [];\n if (path.w !== undefined) attrs.push(`w=\"${path.w}\"`);\n if (path.h !== undefined) attrs.push(`h=\"${path.h}\"`);\n if (path.fill !== undefined) attrs.push(`fill=\"${escapeXml(path.fill)}\"`);\n if (path.stroke !== undefined) attrs.push(`stroke=\"${path.stroke}\"`);\n if (path.extrusionOk !== undefined) attrs.push(`extrusionOk=\"${path.extrusionOk}\"`);\n const attrStr = attrs.length ? \" \" + attrs.join(\" \") : \"\";\n const cmds = path.commands.map(stringifyPathCommand).join(\"\");\n if (!cmds && !attrStr) return \"<a:path/>\";\n return `<a:path${attrStr}>${cmds}</a:path>`;\n}\n\nfunction readAdjustPoint(el: XmlElement): AdjustPoint | undefined {\n if (!el.attributes) return undefined;\n const x = el.attributes[\"x\"];\n const y = el.attributes[\"y\"];\n if (x === undefined || y === undefined) return undefined;\n return { x: String(x), y: String(y) };\n}\n\nfunction readPathCommand(tag: string, el: XmlElement): PathCommand | undefined {\n switch (tag) {\n case \"a:moveTo\": {\n const pt = el.elements?.find((c) => c.name === \"a:pt\");\n if (!pt) return undefined;\n const point = readAdjustPoint(pt);\n if (!point) return undefined;\n return { command: \"moveTo\", point };\n }\n case \"a:lnTo\": {\n const pt = el.elements?.find((c) => c.name === \"a:pt\");\n if (!pt) return undefined;\n const point = readAdjustPoint(pt);\n if (!point) return undefined;\n return { command: \"lineTo\", point };\n }\n case \"a:arcTo\": {\n const a = el.attributes;\n if (!a) return undefined;\n return {\n command: \"arcTo\",\n widthRadius: String(a[\"wR\"] ?? \"\"),\n heightRadius: String(a[\"hR\"] ?? \"\"),\n startAngle: String(a[\"stAng\"] ?? \"\"),\n sweepAngle: String(a[\"swAng\"] ?? \"\"),\n };\n }\n case \"a:quadBezTo\": {\n const points = (el.elements ?? [])\n .filter((c) => c.name === \"a:pt\")\n .map(readAdjustPoint)\n .filter((p): p is AdjustPoint => p !== undefined);\n const [p0, p1] = points;\n if (!p0 || !p1) return undefined;\n return { command: \"quadBezTo\", points: [p0, p1] };\n }\n case \"a:cubicBezTo\": {\n const points = (el.elements ?? [])\n .filter((c) => c.name === \"a:pt\")\n .map(readAdjustPoint)\n .filter((p): p is AdjustPoint => p !== undefined);\n const [p0, p1, p2] = points;\n if (!p0 || !p1 || !p2) return undefined;\n return { command: \"cubicBezTo\", points: [p0, p1, p2] };\n }\n case \"a:close\":\n return { command: \"close\" };\n default:\n return undefined;\n }\n}\n\nfunction readPath(el: XmlElement): Partial<PathOptions> {\n const result: Partial<PathOptions> = {};\n if (el.attributes) {\n if (el.attributes[\"w\"] !== undefined) result.w = Number(el.attributes[\"w\"]);\n if (el.attributes[\"h\"] !== undefined) result.h = Number(el.attributes[\"h\"]);\n if (el.attributes[\"fill\"] !== undefined)\n result.fill = String(el.attributes[\"fill\"]) as PathOptions[\"fill\"];\n if (el.attributes[\"stroke\"] !== undefined)\n result.stroke = el.attributes[\"stroke\"] !== \"0\" && el.attributes[\"stroke\"] !== \"false\";\n if (el.attributes[\"extrusionOk\"] !== undefined)\n result.extrusionOk =\n el.attributes[\"extrusionOk\"] !== \"0\" && el.attributes[\"extrusionOk\"] !== \"false\";\n }\n const commands: PathCommand[] = [];\n if (el.elements) {\n for (const child of el.elements) {\n if (child.name) {\n const cmd = readPathCommand(child.name, child);\n if (cmd) commands.push(cmd);\n }\n }\n }\n if (commands.length > 0) result.commands = commands;\n return result as PathOptions;\n}\n\n// ── Guide list helper (avLst / gdLst) ──\n\nfunction stringifyGuideList(tag: string, guides: readonly GeometryGuide[]): string {\n if (!guides || guides.length === 0) return `<${tag}/>`;\n const inner = guides\n .map((g) => `<a:gd name=\"${escapeXml(g.name)}\" fmla=\"${escapeXml(g.formula)}\"/>`)\n .join(\"\");\n return `<${tag}>${inner}</${tag}>`;\n}\n\nfunction readGuideList(el: XmlElement): GeometryGuide[] {\n const result: GeometryGuide[] = [];\n if (el.elements) {\n for (const child of el.elements) {\n if (child.name === \"a:gd\" && child.attributes) {\n const name = child.attributes[\"name\"];\n const fmla = child.attributes[\"fmla\"];\n if (name !== undefined && fmla !== undefined) {\n result.push({ name: String(name), formula: String(fmla) });\n }\n }\n }\n }\n return result;\n}\n\n// ── Adjust handle helpers ──\n\nfunction stringifyAdjustHandlePos(pos: { x: string; y: string }): string {\n return `<a:pos x=\"${escapeXml(pos.x)}\" y=\"${escapeXml(pos.y)}\"/>`;\n}\n\nfunction stringifyXYAdjustHandle(h: XYAdjustHandle): string {\n const attrs: string[] = [];\n if (h.guideRefX !== undefined) attrs.push(`gdRefX=\"${escapeXml(h.guideRefX)}\"`);\n if (h.minX !== undefined) attrs.push(`minX=\"${escapeXml(h.minX)}\"`);\n if (h.maxX !== undefined) attrs.push(`maxX=\"${escapeXml(h.maxX)}\"`);\n if (h.guideRefY !== undefined) attrs.push(`gdRefY=\"${escapeXml(h.guideRefY)}\"`);\n if (h.minY !== undefined) attrs.push(`minY=\"${escapeXml(h.minY)}\"`);\n if (h.maxY !== undefined) attrs.push(`maxY=\"${escapeXml(h.maxY)}\"`);\n const attrStr = attrs.length ? \" \" + attrs.join(\" \") : \"\";\n return `<a:ahXY${attrStr}>${stringifyAdjustHandlePos(h.position)}</a:ahXY>`;\n}\n\nfunction stringifyPolarAdjustHandle(h: PolarAdjustHandle): string {\n const attrs: string[] = [];\n if (h.guideRefRadius !== undefined) attrs.push(`gdRefR=\"${escapeXml(h.guideRefRadius)}\"`);\n if (h.minRadius !== undefined) attrs.push(`minR=\"${escapeXml(h.minRadius)}\"`);\n if (h.maxRadius !== undefined) attrs.push(`maxR=\"${escapeXml(h.maxRadius)}\"`);\n if (h.guideRefAngle !== undefined) attrs.push(`gdRefAng=\"${escapeXml(h.guideRefAngle)}\"`);\n if (h.minAngle !== undefined) attrs.push(`minAng=\"${escapeXml(h.minAngle)}\"`);\n if (h.maxAngle !== undefined) attrs.push(`maxAng=\"${escapeXml(h.maxAngle)}\"`);\n const attrStr = attrs.length ? \" \" + attrs.join(\" \") : \"\";\n return `<a:ahPolar${attrStr}>${stringifyAdjustHandlePos(h.position)}</a:ahPolar>`;\n}\n\nfunction stringifyAdjustHandle(h: AdjustHandle): string {\n return h.type === \"xy\" ? stringifyXYAdjustHandle(h) : stringifyPolarAdjustHandle(h);\n}\n\nfunction readAdjustHandlePos(el: XmlElement): { x: string; y: string } | undefined {\n const pos = el.elements?.find((c) => c.name === \"a:pos\");\n if (!pos?.attributes) return undefined;\n const x = pos.attributes[\"x\"];\n const y = pos.attributes[\"y\"];\n if (x === undefined || y === undefined) return undefined;\n return { x: String(x), y: String(y) };\n}\n\nfunction readXYAdjustHandle(el: XmlElement): XYAdjustHandle | undefined {\n const position = readAdjustHandlePos(el);\n if (!position) return undefined;\n const result: XYAdjustHandle = { type: \"xy\", position };\n if (el.attributes?.[\"gdRefX\"] !== undefined) result.guideRefX = String(el.attributes[\"gdRefX\"]);\n if (el.attributes?.[\"minX\"] !== undefined) result.minX = String(el.attributes[\"minX\"]);\n if (el.attributes?.[\"maxX\"] !== undefined) result.maxX = String(el.attributes[\"maxX\"]);\n if (el.attributes?.[\"gdRefY\"] !== undefined) result.guideRefY = String(el.attributes[\"gdRefY\"]);\n if (el.attributes?.[\"minY\"] !== undefined) result.minY = String(el.attributes[\"minY\"]);\n if (el.attributes?.[\"maxY\"] !== undefined) result.maxY = String(el.attributes[\"maxY\"]);\n return result;\n}\n\nfunction readPolarAdjustHandle(el: XmlElement): PolarAdjustHandle | undefined {\n const position = readAdjustHandlePos(el);\n if (!position) return undefined;\n const result: PolarAdjustHandle = { type: \"polar\", position };\n if (el.attributes?.[\"gdRefR\"] !== undefined)\n result.guideRefRadius = String(el.attributes[\"gdRefR\"]);\n if (el.attributes?.[\"minR\"] !== undefined) result.minRadius = String(el.attributes[\"minR\"]);\n if (el.attributes?.[\"maxR\"] !== undefined) result.maxRadius = String(el.attributes[\"maxR\"]);\n if (el.attributes?.[\"gdRefAng\"] !== undefined)\n result.guideRefAngle = String(el.attributes[\"gdRefAng\"]);\n if (el.attributes?.[\"minAng\"] !== undefined) result.minAngle = String(el.attributes[\"minAng\"]);\n if (el.attributes?.[\"maxAng\"] !== undefined) result.maxAngle = String(el.attributes[\"maxAng\"]);\n return result;\n}\n\n// ── Connection site helpers ──\n\nfunction stringifyConnectionSite(site: ConnectionSite): string {\n return `<a:cxn ang=\"${escapeXml(site.angle)}\">${stringifyAdjustHandlePos(site.position)}</a:cxn>`;\n}\n\nfunction readConnectionSite(el: XmlElement): ConnectionSite | undefined {\n const ang = el.attributes?.[\"ang\"];\n if (ang === undefined) return undefined;\n const position = readAdjustHandlePos(el);\n if (!position) return undefined;\n return { angle: String(ang), position };\n}\n\n// ── Geom rect helpers ──\n\nfunction stringifyGeomRect(rect: GeomRect): string {\n return (\n `<a:rect l=\"${escapeXml(rect.left)}\" t=\"${escapeXml(rect.top)}\"` +\n ` r=\"${escapeXml(rect.right)}\" b=\"${escapeXml(rect.bottom)}\"/>`\n );\n}\n\nfunction readGeomRect(el: XmlElement): GeomRect | undefined {\n const a = el.attributes;\n if (!a) return undefined;\n const l = a[\"l\"];\n const t = a[\"t\"];\n const r = a[\"r\"];\n const b = a[\"b\"];\n if (l === undefined || t === undefined || r === undefined || b === undefined) return undefined;\n return { left: String(l), top: String(t), right: String(r), bottom: String(b) };\n}\n\n// ── Custom geometry descriptor ──\n\nexport const customGeometryDesc: CustomDescriptor<CustomGeometryOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const parts: string[] = [];\n\n // a:avLst\n if (opts.adjustmentValues && opts.adjustmentValues.length > 0) {\n parts.push(stringifyGuideList(\"a:avLst\", opts.adjustmentValues));\n } else {\n parts.push(\"<a:avLst/>\");\n }\n\n // a:gdLst\n if (opts.guides && opts.guides.length > 0) {\n parts.push(stringifyGuideList(\"a:gdLst\", opts.guides));\n }\n\n // a:ahLst\n if (opts.adjustHandles && opts.adjustHandles.length > 0) {\n const inner = opts.adjustHandles.map(stringifyAdjustHandle).join(\"\");\n parts.push(`<a:ahLst>${inner}</a:ahLst>`);\n }\n\n // a:cxnLst\n if (opts.connectionSites && opts.connectionSites.length > 0) {\n const inner = opts.connectionSites.map(stringifyConnectionSite).join(\"\");\n parts.push(`<a:cxnLst>${inner}</a:cxnLst>`);\n }\n\n // a:rect\n if (opts.textRectangle) {\n parts.push(stringifyGeomRect(opts.textRectangle));\n }\n\n // a:pathLst (required)\n const pathsXml = opts.pathList.map(stringifyPath).join(\"\");\n parts.push(`<a:pathLst>${pathsXml}</a:pathLst>`);\n\n return `<a:custGeom>${parts.join(\"\")}</a:custGeom>`;\n },\n parse(el, _ctx) {\n const result: Partial<CustomGeometryOptions> = {};\n\n // a:avLst\n const avLst = findChild(el, \"a:avLst\");\n if (avLst) {\n const guides = readGuideList(avLst);\n if (guides.length > 0) result.adjustmentValues = guides;\n }\n\n // a:gdLst\n const gdLst = findChild(el, \"a:gdLst\");\n if (gdLst) {\n const guides = readGuideList(gdLst);\n if (guides.length > 0) result.guides = guides;\n }\n\n // a:ahLst\n const ahLst = findChild(el, \"a:ahLst\");\n if (ahLst?.elements) {\n const handles: AdjustHandle[] = [];\n for (const child of ahLst.elements) {\n if (child.name === \"a:ahXY\") {\n const h = readXYAdjustHandle(child);\n if (h) handles.push(h);\n } else if (child.name === \"a:ahPolar\") {\n const h = readPolarAdjustHandle(child);\n if (h) handles.push(h);\n }\n }\n if (handles.length > 0) result.adjustHandles = handles;\n }\n\n // a:cxnLst\n const cxnLst = findChild(el, \"a:cxnLst\");\n if (cxnLst?.elements) {\n const sites: ConnectionSite[] = [];\n for (const child of cxnLst.elements) {\n if (child.name === \"a:cxn\") {\n const site = readConnectionSite(child);\n if (site) sites.push(site);\n }\n }\n if (sites.length > 0) result.connectionSites = sites;\n }\n\n // a:rect\n const rect = findChild(el, \"a:rect\");\n if (rect) {\n const textRectangle = readGeomRect(rect);\n if (textRectangle) result.textRectangle = textRectangle;\n }\n\n // a:pathLst (required)\n const pathLst = findChild(el, \"a:pathLst\");\n if (pathLst?.elements) {\n const paths: PathOptions[] = [];\n for (const child of pathLst.elements) {\n if (child.name === \"a:path\") {\n const p = readPath(child);\n if (p.commands && p.commands.length > 0) {\n paths.push(p as PathOptions);\n }\n }\n }\n if (paths.length > 0) result.pathList = paths;\n }\n\n return result as CustomGeometryOptions;\n },\n};\n","/**\n * Transform 2D descriptor for DrawingML shapes.\n *\n * @module\n */\n\nimport { attrMeasure, findChild } from \"@office-open/xml\";\n\nimport type { CustomDescriptor } from \"../descriptor\";\nimport { convertToEmu } from \"../util/converters\";\nimport type { GroupTransform2DOptions, Transform2DOptions } from \"./transform\";\n\n// ── Transform2D descriptor ──\n// x, y, width, height: number (EMU) | string (UniversalMeasure)\n\nexport const transform2DDesc: CustomDescriptor<Transform2DOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const parts: string[] = [];\n\n // Attributes\n const attrParts: string[] = [];\n if (opts.flipHorizontal !== undefined) attrParts.push(`flipH=\"${opts.flipHorizontal ? 1 : 0}\"`);\n if (opts.flipVertical !== undefined) attrParts.push(`flipV=\"${opts.flipVertical ? 1 : 0}\"`);\n if (opts.rotation !== undefined) attrParts.push(`rot=\"${opts.rotation}\"`);\n const attrStr = attrParts.length ? \" \" + attrParts.join(\" \") : \"\";\n\n // Child elements: off, ext\n if (opts.x !== undefined || opts.y !== undefined) {\n const x = opts.x !== undefined ? convertToEmu(opts.x) : 0;\n const y = opts.y !== undefined ? convertToEmu(opts.y) : 0;\n parts.push(`<a:off x=\"${x}\" y=\"${y}\"/>`);\n }\n if (opts.width !== undefined || opts.height !== undefined) {\n const cx = opts.width !== undefined ? convertToEmu(opts.width) : 0;\n const cy = opts.height !== undefined ? convertToEmu(opts.height) : 0;\n parts.push(`<a:ext cx=\"${cx}\" cy=\"${cy}\"/>`);\n }\n\n if (parts.length === 0 && !attrStr) return undefined;\n if (parts.length === 0) return `<a:xfrm${attrStr}/>`;\n return `<a:xfrm${attrStr}>${parts.join(\"\")}</a:xfrm>`;\n },\n parse(el, _ctx) {\n const result: Record<string, unknown> = {};\n\n // Attributes\n if (el.attributes) {\n if (el.attributes[\"flipH\"] !== undefined)\n result.flipHorizontal = el.attributes[\"flipH\"] === 1 || el.attributes[\"flipH\"] === \"1\";\n if (el.attributes[\"flipV\"] !== undefined)\n result.flipVertical = el.attributes[\"flipV\"] === 1 || el.attributes[\"flipV\"] === \"1\";\n if (el.attributes[\"rot\"] !== undefined) result.rotation = Number(el.attributes[\"rot\"]);\n }\n\n // Child: off — a:off x/y are ST_Coordinate (number EMU | UniversalMeasure)\n const off = findChild(el, \"a:off\");\n if (off?.attributes) {\n const xv = attrMeasure(off, \"x\");\n result.x = xv ?? 0;\n const yv = attrMeasure(off, \"y\");\n result.y = yv ?? 0;\n }\n\n // Child: ext\n const ext = findChild(el, \"a:ext\");\n if (ext?.attributes) {\n const cxv = attrMeasure(ext, \"cx\");\n result.width = cxv ?? 0;\n const cyv = attrMeasure(ext, \"cy\");\n result.height = cyv ?? 0;\n }\n\n return result as Transform2DOptions;\n },\n};\n\n// ── GroupTransform2D descriptor ──\n\nexport const groupTransform2DDesc: CustomDescriptor<GroupTransform2DOptions> = {\n kind: \"custom\",\n stringify(opts, ctx) {\n const base = transform2DDesc.stringify(opts, ctx) ?? \"<a:xfrm/>\";\n\n // Append chOff and chExt children before closing tag (values are already in EMU)\n const chOff = `<a:chOff x=\"${opts.childOffsetX ?? 0}\" y=\"${opts.childOffsetY ?? 0}\"/>`;\n const chExt = `<a:chExt cx=\"${opts.childExtentWidth ?? 0}\" cy=\"${opts.childExtentHeight ?? 0}\"/>`;\n\n if (base.endsWith(\"/>\")) {\n return `<a:xfrm>${chOff}${chExt}</a:xfrm>`;\n }\n return base.replace(/<\\/a:xfrm>$/, `${chOff}${chExt}</a:xfrm>`);\n },\n parse(el, ctx) {\n const result = transform2DDesc.parse(el, ctx) as Record<string, unknown>;\n\n const chOff = findChild(el, \"a:chOff\");\n if (chOff?.attributes) {\n const cx = attrMeasure(chOff, \"x\");\n result.childOffsetX = cx ?? 0;\n const cy = attrMeasure(chOff, \"y\");\n result.childOffsetY = cy ?? 0;\n }\n\n const chExt = findChild(el, \"a:chExt\");\n if (chExt?.attributes) {\n const ccx = attrMeasure(chExt, \"cx\");\n result.childExtentWidth = ccx ?? 0;\n const ccy = attrMeasure(chExt, \"cy\");\n result.childExtentHeight = ccy ?? 0;\n }\n\n return result as GroupTransform2DOptions;\n },\n};\n","/**\n * 3D descriptor for DrawingML shapes.\n *\n * @module\n */\n\nimport { escapeXml } from \"@office-open/xml\";\nimport type { Element as XmlElement } from \"@office-open/xml\";\nimport { findChild } from \"@office-open/xml\";\n\nimport type { CustomDescriptor } from \"../../descriptor\";\nimport { stringify, parse } from \"../../descriptor\";\nimport { xsdMaterialType } from \"../../util/mappings\";\nimport { solidFillDesc } from \"../color/color-descriptors\";\nimport type { BevelOptions } from \"./bevel\";\nimport type {\n Scene3DOptions,\n CameraOptions,\n LightRigOptions,\n SphereCoords,\n BackdropOptions,\n Point3D,\n Vector3D,\n} from \"./scene-3d\";\nimport type { Shape3DOptions } from \"./shape-3d\";\n\n// ── SphereCoords helper ──\n\nfunction stringifySphereCoords(coords: SphereCoords): string {\n return `<a:rot lat=\"${coords.lat}\" lon=\"${coords.lon}\" rev=\"${coords.rev}\"/>`;\n}\n\nfunction readSphereCoords(el: XmlElement): SphereCoords | undefined {\n const lat = el.attributes?.[\"lat\"];\n const lon = el.attributes?.[\"lon\"];\n const rev = el.attributes?.[\"rev\"];\n if (lat === undefined || lon === undefined || rev === undefined) return undefined;\n return { lat: Number(lat), lon: Number(lon), rev: Number(rev) };\n}\n\n// ── Bevel descriptor (a:bevelT / a:bevelB) ──\n\nexport const bevelDesc: CustomDescriptor<BevelOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const attrParts: string[] = [];\n if (opts.w !== undefined) attrParts.push(`w=\"${opts.w}\"`);\n if (opts.h !== undefined) attrParts.push(`h=\"${opts.h}\"`);\n if (opts.prst !== undefined) attrParts.push(`prst=\"${escapeXml(opts.prst)}\"`);\n const attrStr = attrParts.length ? \" \" + attrParts.join(\" \") : \"\";\n return `<a:bevel${attrStr}/>`;\n },\n parse(el, _ctx) {\n const result: BevelOptions = {};\n if (el.attributes?.[\"w\"] !== undefined) result.w = Number(el.attributes[\"w\"]);\n if (el.attributes?.[\"h\"] !== undefined) result.h = Number(el.attributes[\"h\"]);\n if (el.attributes?.[\"prst\"] !== undefined)\n result.prst = String(el.attributes[\"prst\"]) as BevelOptions[\"prst\"];\n return result;\n },\n};\n\n// ── Shape3D descriptor (a:sp3d) ──\n\nexport const shape3DDesc: CustomDescriptor<Shape3DOptions> = {\n kind: \"custom\",\n stringify(opts, ctx) {\n const parts: string[] = [];\n\n // Children\n if (opts.bevelT) {\n const bevelXml = stringify(bevelDesc, opts.bevelT, ctx);\n if (bevelXml) parts.push(bevelXml.replace(\"<a:bevel\", \"<a:bevelT\"));\n }\n if (opts.bevelB) {\n const bevelXml = stringify(bevelDesc, opts.bevelB, ctx);\n if (bevelXml) parts.push(bevelXml.replace(\"<a:bevel\", \"<a:bevelB\"));\n }\n if (opts.extrusionColor) {\n const colorXml = stringify(solidFillDesc, opts.extrusionColor, ctx);\n if (colorXml) parts.push(`<a:extrusionClr>${colorXml}</a:extrusionClr>`);\n }\n if (opts.contourColor) {\n const colorXml = stringify(solidFillDesc, opts.contourColor, ctx);\n if (colorXml) parts.push(`<a:contourClr>${colorXml}</a:contourClr>`);\n }\n\n // Attributes\n const attrParts: string[] = [];\n if (opts.z !== undefined) attrParts.push(`z=\"${opts.z}\"`);\n if (opts.extrusionH !== undefined) attrParts.push(`extrusionH=\"${opts.extrusionH}\"`);\n if (opts.contourW !== undefined) attrParts.push(`contourW=\"${opts.contourW}\"`);\n if (opts.prstMaterial !== undefined) {\n attrParts.push(`prstMaterial=\"${escapeXml(xsdMaterialType.to(opts.prstMaterial))}\"`);\n }\n const attrStr = attrParts.length ? \" \" + attrParts.join(\" \") : \"\";\n\n const content = parts.join(\"\");\n if (!attrStr && !content) return undefined;\n if (!content) return `<a:sp3d${attrStr}/>`;\n return `<a:sp3d${attrStr}>${content}</a:sp3d>`;\n },\n parse(el, ctx) {\n const result: Shape3DOptions = {};\n\n // Attributes\n if (el.attributes?.[\"z\"] !== undefined) result.z = Number(el.attributes[\"z\"]);\n if (el.attributes?.[\"extrusionH\"] !== undefined)\n result.extrusionH = Number(el.attributes[\"extrusionH\"]);\n if (el.attributes?.[\"contourW\"] !== undefined)\n result.contourW = Number(el.attributes[\"contourW\"]);\n if (el.attributes?.[\"prstMaterial\"] !== undefined) {\n result.prstMaterial = xsdMaterialType.from(\n String(el.attributes[\"prstMaterial\"]),\n ) as Shape3DOptions[\"prstMaterial\"];\n }\n\n // Children\n const bevelT = findChild(el, \"a:bevelT\");\n if (bevelT) result.bevelT = parse(bevelDesc, bevelT, ctx);\n\n const bevelB = findChild(el, \"a:bevelB\");\n if (bevelB) result.bevelB = parse(bevelDesc, bevelB, ctx);\n\n const extrusionClr = findChild(el, \"a:extrusionClr\");\n if (extrusionClr) {\n const solidFill = findChild(extrusionClr, \"a:solidFill\");\n if (solidFill) result.extrusionColor = parse(solidFillDesc, solidFill, ctx);\n }\n\n const contourClr = findChild(el, \"a:contourClr\");\n if (contourClr) {\n const solidFill = findChild(contourClr, \"a:solidFill\");\n if (solidFill) result.contourColor = parse(solidFillDesc, solidFill, ctx);\n }\n\n return result;\n },\n};\n\n// ── Camera descriptor ──\n\nconst cameraDesc: CustomDescriptor<CameraOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const attrParts: string[] = [];\n attrParts.push(`prst=\"${escapeXml(opts.preset)}\"`);\n if (opts.fov !== undefined) attrParts.push(`fov=\"${opts.fov}\"`);\n if (opts.zoom !== undefined) attrParts.push(`zoom=\"${escapeXml(opts.zoom)}\"`);\n const attrStr = \" \" + attrParts.join(\" \");\n\n const parts: string[] = [];\n if (opts.rotation) parts.push(stringifySphereCoords(opts.rotation));\n\n const content = parts.join(\"\");\n if (!content) return `<a:camera${attrStr}/>`;\n return `<a:camera${attrStr}>${content}</a:camera>`;\n },\n parse(el, _ctx) {\n const result: Partial<CameraOptions> = {};\n if (el.attributes?.[\"prst\"] !== undefined) result.preset = String(el.attributes[\"prst\"]);\n if (el.attributes?.[\"fov\"] !== undefined) result.fov = Number(el.attributes[\"fov\"]);\n if (el.attributes?.[\"zoom\"] !== undefined) result.zoom = String(el.attributes[\"zoom\"]);\n const rot = findChild(el, \"a:rot\");\n if (rot) result.rotation = readSphereCoords(rot);\n return result as CameraOptions;\n },\n};\n\n// ── LightRig descriptor ──\n\nconst lightRigDesc: CustomDescriptor<LightRigOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const attrParts: string[] = [];\n attrParts.push(`rig=\"${escapeXml(opts.rig)}\"`);\n attrParts.push(`dir=\"${escapeXml(opts.direction)}\"`);\n const attrStr = \" \" + attrParts.join(\" \");\n\n const parts: string[] = [];\n if (opts.rotation) parts.push(stringifySphereCoords(opts.rotation));\n\n const content = parts.join(\"\");\n if (!content) return `<a:lightRig${attrStr}/>`;\n return `<a:lightRig${attrStr}>${content}</a:lightRig>`;\n },\n parse(el, _ctx) {\n const result: Partial<LightRigOptions> = {};\n if (el.attributes?.[\"rig\"] !== undefined) result.rig = String(el.attributes[\"rig\"]);\n if (el.attributes?.[\"dir\"] !== undefined) result.direction = String(el.attributes[\"dir\"]);\n const rot = findChild(el, \"a:rot\");\n if (rot) result.rotation = readSphereCoords(rot);\n return result as LightRigOptions;\n },\n};\n\n// ── Scene3D descriptor (a:scene3d) ──\n\nexport const scene3DDesc: CustomDescriptor<Scene3DOptions> = {\n kind: \"custom\",\n stringify(opts, ctx) {\n const parts: string[] = [];\n\n // Camera (required)\n const cameraXml = stringify(cameraDesc, opts.camera, ctx);\n if (cameraXml) parts.push(cameraXml);\n\n // Light rig (required)\n const lightRigXml = stringify(lightRigDesc, opts.lightRig, ctx);\n if (lightRigXml) parts.push(lightRigXml);\n\n // Backdrop (optional)\n if (opts.backdrop) {\n parts.push(stringifyBackdrop(opts.backdrop));\n }\n\n const content = parts.join(\"\");\n if (!content) return undefined;\n return `<a:scene3d>${content}</a:scene3d>`;\n },\n parse(el, ctx) {\n const result: Partial<Scene3DOptions> = {};\n\n const camera = findChild(el, \"a:camera\");\n if (camera) result.camera = parse(cameraDesc, camera, ctx);\n\n const lightRig = findChild(el, \"a:lightRig\");\n if (lightRig) result.lightRig = parse(lightRigDesc, lightRig, ctx);\n\n const backdrop = findChild(el, \"a:backdrop\");\n if (backdrop) result.backdrop = readBackdrop(backdrop);\n\n return result as Scene3DOptions;\n },\n};\n\n// ── Backdrop helpers ──\n\nfunction stringifyPoint3D(name: string, point: Point3D): string {\n return `<${name} x=\"${point.x}\" y=\"${point.y}\" z=\"${point.z}\"/>`;\n}\n\nfunction stringifyVector3D(name: string, vector: Vector3D): string {\n return `<${name} dx=\"${vector.dx}\" dy=\"${vector.dy}\" dz=\"${vector.dz}\"/>`;\n}\n\nfunction stringifyBackdrop(opts: BackdropOptions): string {\n const content =\n stringifyPoint3D(\"a:anchor\", opts.anchor) +\n stringifyVector3D(\"a:norm\", opts.normal) +\n stringifyVector3D(\"a:up\", opts.up);\n return `<a:backdrop>${content}</a:backdrop>`;\n}\n\nfunction readPoint3D(el: XmlElement): Point3D | undefined {\n const x = el.attributes?.[\"x\"];\n const y = el.attributes?.[\"y\"];\n const z = el.attributes?.[\"z\"];\n if (x === undefined || y === undefined || z === undefined) return undefined;\n return { x: Number(x), y: Number(y), z: Number(z) };\n}\n\nfunction readVector3D(el: XmlElement): Vector3D | undefined {\n const dx = el.attributes?.[\"dx\"];\n const dy = el.attributes?.[\"dy\"];\n const dz = el.attributes?.[\"dz\"];\n if (dx === undefined || dy === undefined || dz === undefined) return undefined;\n return { dx: Number(dx), dy: Number(dy), dz: Number(dz) };\n}\n\nfunction readBackdrop(el: XmlElement): BackdropOptions | undefined {\n const anchor = findChild(el, \"a:anchor\");\n const norm = findChild(el, \"a:norm\");\n const up = findChild(el, \"a:up\");\n if (!anchor || !norm || !up) return undefined;\n const anchorPt = readPoint3D(anchor);\n const normVec = readVector3D(norm);\n const upVec = readVector3D(up);\n if (!anchorPt || !normVec || !upVec) return undefined;\n return { anchor: anchorPt, normal: normVec, up: upVec };\n}\n","/**\n * Diagram descriptors for declarative XML read/write.\n *\n * @module\n */\n\nimport { escapeXml, findChild } from \"@office-open/xml\";\n\nimport type { CustomDescriptor } from \"../../descriptor\";\nimport type { DiagramExtensionListOptions } from \"./diagram-props\";\nimport type { DiagramRelationshipIdsOptions } from \"./diagram-rel\";\nimport type { DiagramStyleOptions } from \"./diagram-style\";\nimport type { PresentationLayoutVariablesOptions } from \"./layout-vars\";\n\n// ── dgm:relIds descriptor ──\n\nexport const diagramRelationshipIdsDesc: CustomDescriptor<DiagramRelationshipIdsOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n return `<dgm:relIds r:dm=\"${escapeXml(opts.dm)}\" r:lo=\"${escapeXml(opts.lo)}\" r:qs=\"${escapeXml(opts.qs)}\" r:cs=\"${escapeXml(opts.cs)}\"/>`;\n },\n parse(el, _ctx) {\n const result: Partial<DiagramRelationshipIdsOptions> = {};\n if (el.attributes) {\n if (el.attributes[\"r:dm\"] !== undefined) result.dm = String(el.attributes[\"r:dm\"]);\n if (el.attributes[\"r:lo\"] !== undefined) result.lo = String(el.attributes[\"r:lo\"]);\n if (el.attributes[\"r:qs\"] !== undefined) result.qs = String(el.attributes[\"r:qs\"]);\n if (el.attributes[\"r:cs\"] !== undefined) result.cs = String(el.attributes[\"r:cs\"]);\n }\n return result as DiagramRelationshipIdsOptions;\n },\n};\n\n// ── dgm:style descriptor ──\n\nexport const diagramStyleDesc: CustomDescriptor<DiagramStyleOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const lineIdx = opts.lineReference?.idx ?? 1;\n const fillIdx = opts.fillReference?.idx ?? 1;\n const effectIdx = opts.effectReference?.idx ?? 0;\n const fontIdx = opts.fontReference?.idx ?? \"minor\";\n\n return (\n `<dgm:style>` +\n `<a:lnRef idx=\"${lineIdx}\"><a:schemeClr val=\"accent1\"/></a:lnRef>` +\n `<a:fillRef idx=\"${fillIdx}\"><a:schemeClr val=\"accent1\"/></a:fillRef>` +\n `<a:effectRef idx=\"${effectIdx}\"><a:schemeClr val=\"accent1\"/></a:effectRef>` +\n `<a:fontRef idx=\"${escapeXml(fontIdx)}\"><a:schemeClr val=\"tx1\"/></a:fontRef>` +\n `</dgm:style>`\n );\n },\n parse(el, _ctx) {\n const result: DiagramStyleOptions = {};\n\n const lnRef = findChild(el, \"a:lnRef\");\n if (lnRef?.attributes?.[\"idx\"] !== undefined)\n result.lineReference = { idx: Number(lnRef.attributes[\"idx\"]) };\n\n const fillRef = findChild(el, \"a:fillRef\");\n if (fillRef?.attributes?.[\"idx\"] !== undefined)\n result.fillReference = { idx: Number(fillRef.attributes[\"idx\"]) };\n\n const effectRef = findChild(el, \"a:effectRef\");\n if (effectRef?.attributes?.[\"idx\"] !== undefined)\n result.effectReference = { idx: Number(effectRef.attributes[\"idx\"]) };\n\n const fontRef = findChild(el, \"a:fontRef\");\n if (fontRef?.attributes?.[\"idx\"] !== undefined)\n result.fontReference = { idx: String(fontRef.attributes[\"idx\"]) };\n\n return result;\n },\n};\n\n// ── dgm:presLayoutVars descriptor ──\n\nexport const presentationLayoutVariablesDesc: CustomDescriptor<PresentationLayoutVariablesOptions> =\n {\n kind: \"custom\",\n stringify(opts, _ctx) {\n const parts: string[] = [];\n\n if (opts.orgChart?.val !== undefined)\n parts.push(`<dgm:orgChart val=\"${opts.orgChart.val ? 1 : 0}\"/>`);\n\n if (opts.maxChildren?.val !== undefined)\n parts.push(`<dgm:chMax val=\"${opts.maxChildren.val}\"/>`);\n\n if (opts.preferredChildren?.val !== undefined)\n parts.push(`<dgm:chPref val=\"${opts.preferredChildren.val}\"/>`);\n\n if (opts.animateOneByOne?.val !== undefined)\n parts.push(`<dgm:animOne val=\"${escapeXml(opts.animateOneByOne.val)}\"/>`);\n\n if (opts.animationLevel?.val !== undefined)\n parts.push(`<dgm:animLvl val=\"${escapeXml(opts.animationLevel.val)}\"/>`);\n\n if (opts.hierBranch?.val !== undefined)\n parts.push(`<dgm:hierBranch val=\"${escapeXml(opts.hierBranch.val)}\"/>`);\n\n if (parts.length === 0) return `<dgm:presLayoutVars/>`;\n return `<dgm:presLayoutVars>${parts.join(\"\")}</dgm:presLayoutVars>`;\n },\n parse(el, _ctx) {\n const result: PresentationLayoutVariablesOptions = {};\n\n const orgChart = findChild(el, \"dgm:orgChart\");\n if (orgChart?.attributes?.[\"val\"] !== undefined)\n result.orgChart = {\n val: orgChart.attributes[\"val\"] === 1 || orgChart.attributes[\"val\"] === \"1\",\n };\n\n const chMax = findChild(el, \"dgm:chMax\");\n if (chMax?.attributes?.[\"val\"] !== undefined)\n result.maxChildren = { val: Number(chMax.attributes[\"val\"]) };\n\n const chPref = findChild(el, \"dgm:chPref\");\n if (chPref?.attributes?.[\"val\"] !== undefined)\n result.preferredChildren = { val: Number(chPref.attributes[\"val\"]) };\n\n const animOne = findChild(el, \"dgm:animOne\");\n if (animOne?.attributes?.[\"val\"] !== undefined)\n result.animateOneByOne = {\n val: String(\n animOne.attributes[\"val\"],\n ) as PresentationLayoutVariablesOptions[\"animateOneByOne\"] extends\n | { val?: infer V }\n | undefined\n ? V\n : never,\n };\n\n const animLvl = findChild(el, \"dgm:animLvl\");\n if (animLvl?.attributes?.[\"val\"] !== undefined)\n result.animationLevel = {\n val: String(\n animLvl.attributes[\"val\"],\n ) as PresentationLayoutVariablesOptions[\"animationLevel\"] extends\n | { val?: infer V }\n | undefined\n ? V\n : never,\n };\n\n const hierBranch = findChild(el, \"dgm:hierBranch\");\n if (hierBranch?.attributes?.[\"val\"] !== undefined)\n result.hierBranch = {\n val: String(\n hierBranch.attributes[\"val\"],\n ) as PresentationLayoutVariablesOptions[\"hierBranch\"] extends\n | { val?: infer V }\n | undefined\n ? V\n : never,\n };\n\n return result;\n },\n };\n\n// ── dgm:extLst descriptor ──\n\nexport const diagramExtensionListDesc: CustomDescriptor<DiagramExtensionListOptions> = {\n kind: \"custom\",\n stringify(opts, _ctx) {\n if (!opts.extensions?.length) return undefined;\n\n const inner = opts.extensions.map((ext) => `<a:ext uri=\"${escapeXml(ext.uri)}\"/>`).join(\"\");\n\n return `<dgm:extLst>${inner}</dgm:extLst>`;\n },\n parse(el, _ctx) {\n const result: DiagramExtensionListOptions = {};\n\n if (el.elements) {\n const extensions = el.elements\n .filter((c) => c.name === \"a:ext\")\n .map((c) => ({ uri: String(c.attributes?.[\"uri\"] ?? \"\") }));\n if (extensions.length) result.extensions = extensions;\n }\n\n return result;\n },\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;AA4FA,MAAa,yBAAyB,YAAsD;CAC1F,MAAM,IAAc,CAAC;CAErB,IAAI,QAAQ,SAAS,KAAA,GAAW,EAAE,KAAK,gBAAgB,QAAQ,KAAK,IAAI;CACxE,IAAI,QAAQ,UAAU,KAAA,GAAW,EAAE,KAAK,iBAAiB,QAAQ,MAAM,IAAI;CAC3E,IAAI,QAAQ,MAAM,EAAE,KAAK,WAAW;CACpC,IAAI,QAAQ,KAAK,EAAE,KAAK,UAAU;CAClC,IAAI,QAAQ,MAAM,EAAE,KAAK,WAAW;CACpC,IAAI,QAAQ,UAAU,KAAA,GAAW,EAAE,KAAK,iBAAiB,QAAQ,MAAM,IAAI;CAC3E,IAAI,QAAQ,aAAa,KAAA,GAAW,EAAE,KAAK,oBAAoB,QAAQ,SAAS,IAAI;CACpF,IAAI,QAAQ,aAAa,KAAA,GAAW,EAAE,KAAK,oBAAoB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