{"version":3,"file":"NineSliceSprite.mjs","sources":["../../../src/scene/sprite-nine-slice/NineSliceSprite.ts"],"sourcesContent":["import { ObservablePoint } from '../../maths/point/ObservablePoint';\nimport { type PointData } from '../../maths/point/PointData';\nimport { Texture } from '../../rendering/renderers/shared/texture/Texture';\nimport { deprecation, v8_0_0 } from '../../utils/logging/deprecation';\nimport { ViewContainer, type ViewContainerOptions } from '../view/ViewContainer';\nimport { NineSliceGeometry } from './NineSliceGeometry';\nimport { type NineSliceSpriteGpuData } from './NineSliceSpritePipe';\nimport './init';\n\nimport type { Size } from '../../maths/misc/Size';\nimport type { View } from '../../rendering/renderers/shared/view/View';\nimport type { Optional } from '../container/container-mixins/measureMixin';\nimport type { DestroyOptions } from '../container/destroyTypes';\n\n/**\n * Constructor options used for `NineSliceSprite` instances.\n * Defines how the sprite's texture is divided and scaled in nine sections.\n * <pre>\n *      A                          B\n *    +---+----------------------+---+\n *  C | 1 |          2           | 3 |\n *    +---+----------------------+---+\n *    |   |                      |   |\n *    | 4 |          5           | 6 |\n *    |   |                      |   |\n *    +---+----------------------+---+\n *  D | 7 |          8           | 9 |\n *    +---+----------------------+---+\n *  When changing this objects width and/or height:\n *     areas 1 3 7 and 9 will remain unscaled.\n *     areas 2 and 8 will be stretched horizontally\n *     areas 4 and 6 will be stretched vertically\n *     area 5 will be stretched both horizontally and vertically\n * </pre>\n * @example\n * ```ts\n * // Create a basic nine-slice sprite\n * const button = new NineSliceSprite({\n *     texture: Texture.from('button.png'),\n *     leftWidth: 20, // Left border (A)\n *     rightWidth: 20, // Right border (B)\n *     topHeight: 20, // Top border (C)\n *     bottomHeight: 20, // Bottom border (D)\n *     width: 100, // Initial width\n *     height: 50, // Initial height\n *     anchor: 0.5, // Center anchor point\n * });\n * ```\n * @see {@link NineSliceSprite} For the main sprite class\n * @see {@link Texture#defaultBorders} For texture-level border settings\n * @category scene\n * @standard\n */\nexport interface NineSliceSpriteOptions extends PixiMixins.NineSliceSpriteOptions, ViewContainerOptions\n{\n    /**\n     * The texture to use on the NineSliceSprite.\n     * ```ts\n     * // Create a sprite with a texture\n     * const sprite = new NineSliceSprite({\n     *     texture: Texture.from('path/to/image.png')\n     * });\n     * // Update the texture later\n     * sprite.texture = Texture.from('path/to/another-image.png');\n     * ```\n     * @default Texture.EMPTY\n     */\n    texture: Texture;\n\n    /**\n     * Width of the left vertical bar (A).\n     * Controls the size of the left edge that remains unscaled\n     * @example\n     * ```ts\n     * const sprite = new NineSliceSprite({ ..., leftWidth: 20 });\n     * sprite.leftWidth = 20; // Set left border width\n     * ```\n     * @default 10\n     */\n    leftWidth?: number;\n\n    /**\n     * Height of the top horizontal bar (C).\n     * Controls the size of the top edge that remains unscaled\n     * @example\n     * ```ts\n     * const sprite = new NineSliceSprite({ ..., topHeight: 20 });\n     * sprite.topHeight = 20; // Set top border height\n     * ```\n     * @default 10\n     */\n    topHeight?: number;\n\n    /**\n     * Width of the right vertical bar (B).\n     * Controls the size of the right edge that remains unscaled\n     * @example\n     * ```ts\n     * const sprite = new NineSliceSprite({ ..., rightWidth: 20 });\n     * sprite.rightWidth = 20; // Set right border width\n     * ```\n     * @default 10\n     */\n    rightWidth?: number;\n\n    /**\n     * Height of the bottom horizontal bar (D).\n     * Controls the size of the bottom edge that remains unscaled\n     * @example\n     * ```ts\n     * const sprite = new NineSliceSprite({ ..., bottomHeight: 20 });\n     * sprite.bottomHeight = 20; // Set bottom border height\n     * ```\n     * @default 10\n     */\n    bottomHeight?: number;\n\n    /**\n     * Width of the NineSliceSprite.\n     * Modifies the vertices directly rather than UV coordinates\n     * @example\n     * ```ts\n     * const sprite = new NineSliceSprite({ ..., width: 200 });\n     * sprite.width = 200; // Set the width of the sprite\n     * ```\n     * @default 100\n     */\n    width?: number;\n\n    /**\n     * Height of the NineSliceSprite.\n     * Modifies the vertices directly rather than UV coordinates\n     * @example\n     * ```ts\n     * const sprite = new NineSliceSprite({ ..., height: 100 });\n     * sprite.height = 100; // Set the height of the sprite\n     * ```\n     * @default 100\n     */\n    height?: number;\n\n    /**\n     * Whether to round the x/y position to whole pixels\n     * @example\n     * ```ts\n     * const sprite = new NineSliceSprite({ ..., roundPixels: true });\n     * ```\n     * @default false\n     */\n    roundPixels?: boolean;\n\n    /**\n     * The anchor point of the NineSliceSprite (0-1 range)\n     *\n     * Controls the origin point for rotation, scaling, and positioning.\n     * Can be a number for uniform anchor or a PointData for separate x/y values.\n     * @default 0\n     * @example\n     * ```ts\n     * // Centered anchor\n     * const sprite = new NineSliceSprite({ ..., anchor: 0.5 });\n     * sprite.anchor = 0.5;\n     * // Separate x/y anchor\n     * sprite.anchor = { x: 0.5, y: 0.5 };\n     * // Right-aligned anchor\n     * sprite.anchor = { x: 1, y: 0 };\n     * // Update anchor directly\n     * sprite.anchor.set(0.5, 0.5);\n     * ```\n     */\n    anchor?: PointData | number;\n}\n// eslint-disable-next-line requireExport/require-export-jsdoc, requireMemberAPI/require-member-api-doc\nexport interface NineSliceSprite extends PixiMixins.NineSliceSprite, ViewContainer<NineSliceSpriteGpuData> {}\n\n/**\n * The NineSliceSprite allows you to stretch a texture using 9-slice scaling. The corners will remain unscaled (useful\n * for buttons with rounded corners for example) and the other areas will be scaled horizontally and or vertically\n *\n * <pre>\n *      A                          B\n *    +---+----------------------+---+\n *  C | 1 |          2           | 3 |\n *    +---+----------------------+---+\n *    |   |                      |   |\n *    | 4 |          5           | 6 |\n *    |   |                      |   |\n *    +---+----------------------+---+\n *  D | 7 |          8           | 9 |\n *    +---+----------------------+---+\n *  When changing this objects width and/or height:\n *     areas 1 3 7 and 9 will remain unscaled.\n *     areas 2 and 8 will be stretched horizontally\n *     areas 4 and 6 will be stretched vertically\n *     area 5 will be stretched both horizontally and vertically\n * </pre>\n * @example\n * ```ts\n * import { NineSliceSprite, Texture } from 'pixi.js';\n *\n * const plane9 = new NineSliceSprite({\n *   texture: Texture.from('BoxWithRoundedCorners.png'),\n *   leftWidth: 15,\n *   topHeight: 15,\n *   rightWidth: 15,\n *   bottomHeight: 15,\n *   width: 200,\n *   height: 100,\n * });\n * ```\n * @category scene\n * @standard\n */\nexport class NineSliceSprite extends ViewContainer<NineSliceSpriteGpuData> implements View\n{\n    /**\n     * The default options used to override initial values of any options passed in the constructor.\n     * These values are used as fallbacks when specific options are not provided.\n     * @example\n     * ```ts\n     * // Override default options globally\n     * NineSliceSprite.defaultOptions.texture = Texture.from('defaultButton.png');\n     * // Create sprite with default texture\n     * const sprite = new NineSliceSprite({...});\n     * // sprite will use 'defaultButton.png' as its texture\n     *\n     * // Reset to empty texture\n     * NineSliceSprite.defaultOptions.texture = Texture.EMPTY;\n     * ```\n     * @type {NineSliceSpriteOptions}\n     * @see {@link NineSliceSpriteOptions} For all available options\n     * @see {@link Texture#defaultBorders} For texture-level border settings\n     */\n    public static defaultOptions: NineSliceSpriteOptions = {\n        /** @default Texture.EMPTY */\n        texture: Texture.EMPTY,\n    };\n\n    /** @internal */\n    public override readonly renderPipeId: string = 'nineSliceSprite';\n    /** @internal */\n    public _texture: Texture;\n    /** @internal */\n    public _anchor: ObservablePoint;\n    /** @internal */\n    public batched = true;\n    private _leftWidth: number;\n    private _topHeight: number;\n    private _rightWidth: number;\n    private _bottomHeight: number;\n    private _width: number;\n    private _height: number;\n\n    constructor(options: NineSliceSpriteOptions | Texture)\n    {\n        if ((options instanceof Texture))\n        {\n            options = { texture: options };\n        }\n\n        const {\n            width,\n            height,\n            anchor,\n            leftWidth,\n            rightWidth,\n            topHeight,\n            bottomHeight,\n            texture,\n            roundPixels,\n            ...rest\n        } = options;\n\n        super({\n            label: 'NineSliceSprite',\n            ...rest\n        });\n\n        this._leftWidth = leftWidth ?? texture?.defaultBorders?.left ?? NineSliceGeometry.defaultOptions.leftWidth;\n        this._topHeight = topHeight ?? texture?.defaultBorders?.top ?? NineSliceGeometry.defaultOptions.topHeight;\n        this._rightWidth = rightWidth ?? texture?.defaultBorders?.right ?? NineSliceGeometry.defaultOptions.rightWidth;\n        this._bottomHeight = bottomHeight\n                            ?? texture?.defaultBorders?.bottom\n                            ?? NineSliceGeometry.defaultOptions.bottomHeight;\n\n        this._width = width ?? texture.width ?? NineSliceGeometry.defaultOptions.width;\n        this._height = height ?? texture.height ?? NineSliceGeometry.defaultOptions.height;\n\n        this.allowChildren = false;\n        this.texture = texture ?? NineSliceSprite.defaultOptions.texture;\n        this.roundPixels = roundPixels ?? false;\n\n        this._anchor = new ObservablePoint(\n            {\n                _onUpdate: () =>\n                {\n                    this.onViewUpdate();\n                }\n            },\n        );\n\n        if (anchor)\n        {\n            this.anchor = anchor;\n        }\n        else if (this.texture.defaultAnchor)\n        {\n            this.anchor = this.texture.defaultAnchor;\n        }\n    }\n\n    /**\n     * The anchor sets the origin point of the sprite. The default value is taken from the {@link Texture}\n     * and passed to the constructor.\n     *\n     * - The default is `(0,0)`, this means the sprite's origin is the top left.\n     * - Setting the anchor to `(0.5,0.5)` means the sprite's origin is centered.\n     * - Setting the anchor to `(1,1)` would mean the sprite's origin point will be the bottom right corner.\n     *\n     * If you pass only single parameter, it will set both x and y to the same value as shown in the example below.\n     * @example\n     * ```ts\n     * // Center the anchor point\n     * sprite.anchor = 0.5; // Sets both x and y to 0.5\n     * sprite.position.set(400, 300); // Sprite will be centered at this position\n     *\n     * // Set specific x/y anchor points\n     * sprite.anchor = {\n     *     x: 1, // Right edge\n     *     y: 0  // Top edge\n     * };\n     *\n     * // Using individual coordinates\n     * sprite.anchor.set(0.5, 1); // Center-bottom\n     *\n     * // For rotation around center\n     * sprite.anchor.set(0.5);\n     * sprite.rotation = Math.PI / 4; // 45 degrees around center\n     *\n     * // For scaling from center\n     * sprite.anchor.set(0.5);\n     * sprite.scale.set(2); // Scales from center point\n     * ```\n     */\n    get anchor(): ObservablePoint\n    {\n        return this._anchor;\n    }\n\n    set anchor(value: PointData | number)\n    {\n        typeof value === 'number' ? this._anchor.set(value) : this._anchor.copyFrom(value);\n    }\n\n    /**\n     * The width of the NineSliceSprite, setting this will actually modify the vertices and UV's of this plane.\n     * The width affects how the middle sections are scaled.\n     * @example\n     * ```ts\n     * // Create a nine-slice sprite with fixed width\n     * const panel = new NineSliceSprite({\n     *     texture: Texture.from('panel.png'),\n     *     width: 200  // Sets initial width\n     * });\n     *\n     * // Adjust width dynamically\n     * panel.width = 300;  // Stretches middle sections\n     * ```\n     * @see {@link NineSliceSprite#setSize} For setting both width and height efficiently\n     * @see {@link NineSliceSprite#height} For setting height\n     */\n    override get width(): number\n    {\n        return this._width;\n    }\n\n    override set width(value: number)\n    {\n        this._width = value;\n        this.onViewUpdate();\n    }\n\n    /**\n     * The height of the NineSliceSprite, setting this will actually modify the vertices and UV's of this plane.\n     * The height affects how the middle sections are scaled.\n     * @example\n     * ```ts\n     * // Create a nine-slice sprite with fixed height\n     * const panel = new NineSliceSprite({\n     *     texture: Texture.from('panel.png'),\n     *     height: 150  // Sets initial height\n     * });\n     *\n     * // Adjust height dynamically\n     * panel.height = 200;  // Stretches middle sections\n     *\n     * // Create responsive UI element\n     * const dialog = new NineSliceSprite({\n     *     texture: Texture.from('dialog.png'),\n     *     topHeight: 30,\n     *     bottomHeight: 30,\n     *     height: parent.height * 0.5  // 50% of parent height\n     * });\n     * ```\n     * @see {@link NineSliceSprite#setSize} For setting both width and height efficiently\n     * @see {@link NineSliceSprite#width} For setting width\n     */\n    override get height(): number\n    {\n        return this._height;\n    }\n\n    override set height(value: number)\n    {\n        this._height = value;\n        this.onViewUpdate();\n    }\n\n    /**\n     * Sets the size of the NineSliceSprite to the specified width and height.\n     * This method directly modifies the vertices and UV coordinates of the sprite.\n     *\n     * Using this is more efficient than setting width and height separately as it only triggers one update.\n     * @example\n     * ```ts\n     * // Set to specific dimensions\n     * panel.setSize(300, 200); // Width: 300, Height: 200\n     *\n     * // Set uniform size\n     * panel.setSize(200); // Makes a square 200x200\n     *\n     * // Set size using object\n     * panel.setSize({\n     *     width: 400,\n     *     height: 300\n     * });\n     * ```\n     * @param value - This can be either a number or a Size object with width/height properties\n     * @param height - The height to set. Defaults to the value of `width` if not provided\n     * @see {@link NineSliceSprite#width} For setting width only\n     * @see {@link NineSliceSprite#height} For setting height only\n     */\n    public override setSize(value: number | Optional<Size, 'height'>, height?: number): void\n    {\n        if (typeof value === 'object')\n        {\n            height = value.height ?? value.width;\n            value = value.width;\n        }\n\n        this._width = value;\n        this._height = height ?? value;\n\n        this.onViewUpdate();\n    }\n\n    /**\n     * Retrieves the size of the NineSliceSprite as a [Size]{@link Size} object.\n     * This method is more efficient than getting width and height separately.\n     * @example\n     * ```ts\n     * // Get basic size\n     * const size = panel.getSize();\n     * console.log(`Size: ${size.width}x${size.height}`);\n     *\n     * // Reuse existing size object\n     * const reuseSize = { width: 0, height: 0 };\n     * panel.getSize(reuseSize);\n     * ```\n     * @param out - Optional object to store the size in, to avoid allocating a new object\n     * @returns The size of the NineSliceSprite\n     * @see {@link NineSliceSprite#width} For getting just the width\n     * @see {@link NineSliceSprite#height} For getting just the height\n     * @see {@link NineSliceSprite#setSize} For setting both width and height efficiently\n     */\n    public override getSize(out?: Size): Size\n    {\n        out ||= {} as Size;\n        out.width = this._width;\n        out.height = this._height;\n\n        return out;\n    }\n\n    /**\n     * Width of the left vertical bar (A).\n     * Controls the size of the left edge that remains unscaled\n     * @example\n     * ```ts\n     * const sprite = new NineSliceSprite({ ..., leftWidth: 20 });\n     * sprite.leftWidth = 20; // Set left border width\n     * ```\n     * @default 10\n     */\n    get leftWidth(): number\n    {\n        return this._leftWidth;\n    }\n\n    set leftWidth(value: number)\n    {\n        this._leftWidth = value;\n\n        this.onViewUpdate();\n    }\n\n    /**\n     * Height of the top horizontal bar (C).\n     * Controls the size of the top edge that remains unscaled\n     * @example\n     * ```ts\n     * const sprite = new NineSliceSprite({ ..., topHeight: 20 });\n     * sprite.topHeight = 20; // Set top border height\n     * ```\n     * @default 10\n     */\n    get topHeight(): number\n    {\n        return this._topHeight;\n    }\n\n    set topHeight(value: number)\n    {\n        this._topHeight = value;\n        this.onViewUpdate();\n    }\n\n    /**\n     * Width of the right vertical bar (B).\n     * Controls the size of the right edge that remains unscaled\n     * @example\n     * ```ts\n     * const sprite = new NineSliceSprite({ ..., rightWidth: 20 });\n     * sprite.rightWidth = 20; // Set right border width\n     * ```\n     * @default 10\n     */\n    get rightWidth(): number\n    {\n        return this._rightWidth;\n    }\n\n    set rightWidth(value: number)\n    {\n        this._rightWidth = value;\n        this.onViewUpdate();\n    }\n\n    /**\n     * Height of the bottom horizontal bar (D).\n     * Controls the size of the bottom edge that remains unscaled\n     * @example\n     * ```ts\n     * const sprite = new NineSliceSprite({ ..., bottomHeight: 20 });\n     * sprite.bottomHeight = 20; // Set bottom border height\n     * ```\n     * @default 10\n     */\n    get bottomHeight(): number\n    {\n        return this._bottomHeight;\n    }\n\n    set bottomHeight(value: number)\n    {\n        this._bottomHeight = value;\n        this.onViewUpdate();\n    }\n\n    /**\n     * The texture to use on the NineSliceSprite.\n     * ```ts\n     * // Create a sprite with a texture\n     * const sprite = new NineSliceSprite({\n     *     texture: Texture.from('path/to/image.png')\n     * });\n     * // Update the texture later\n     * sprite.texture = Texture.from('path/to/another-image.png');\n     * ```\n     * @default Texture.EMPTY\n     */\n    get texture(): Texture\n    {\n        return this._texture;\n    }\n\n    set texture(value: Texture)\n    {\n        value ||= Texture.EMPTY;\n\n        const currentTexture = this._texture;\n\n        if (currentTexture === value) return;\n\n        if (currentTexture && currentTexture.dynamic) currentTexture.off('update', this.onViewUpdate, this);\n        if (value.dynamic) value.on('update', this.onViewUpdate, this);\n\n        this._texture = value;\n\n        this.onViewUpdate();\n    }\n\n    /**\n     * The original width of the texture before any nine-slice scaling.\n     * This is the width of the source texture used to create the nine-slice sprite.\n     * @example\n     * ```ts\n     * // Get original dimensions\n     * console.log(`Original size: ${sprite.originalWidth}x${sprite.originalHeight}`);\n     *\n     * // Use for relative scaling\n     * sprite.width = sprite.originalWidth * 2; // Double the original width\n     *\n     * // Reset to original size\n     * sprite.setSize(sprite.originalWidth, sprite.originalHeight);\n     * ```\n     * @readonly\n     * @see {@link NineSliceSprite#width} For the current displayed width\n     * @see {@link Texture#width} For direct texture width access\n     * @returns The original width of the texture\n     */\n    get originalWidth()\n    {\n        return this._texture.width;\n    }\n\n    /**\n     * The original height of the texture before any nine-slice scaling.\n     * This is the height of the source texture used to create the nine-slice sprite.\n     * @example\n     * ```ts\n     * // Get original dimensions\n     * console.log(`Original size: ${sprite.originalWidth}x${sprite.originalHeight}`);\n     *\n     * // Use for relative scaling\n     * sprite.height = sprite.originalHeight * 2; // Double the original height\n     *\n     * // Reset to original size\n     * sprite.setSize(sprite.originalWidth, sprite.originalHeight);\n     * ```\n     * @readonly\n     * @see {@link NineSliceSprite#height} For the current displayed height\n     * @see {@link Texture#height} For direct texture height access\n     * @returns The original height of the texture\n     */\n    get originalHeight()\n    {\n        return this._texture.height;\n    }\n\n    /**\n     * The trim rectangle of the underlying texture, or `null` if the texture is not trimmed.\n     * This is forwarded to the {@link NineSliceGeometry} so that UV coordinates are clamped\n     * to the visible pixel region, preventing transparent atlas padding from bleeding into\n     * the rendered sprite corners.\n     * @readonly\n     * @internal\n     */\n    get trim()\n    {\n        return this._texture.trim ?? null;\n    }\n\n    /**\n     * Destroys this sprite renderable and optionally its texture.\n     * @param options - Options parameter. A boolean will act as if all options\n     *  have been set to that value\n     * @example\n     * nineSliceSprite.destroy();\n     * nineSliceSprite.destroy(true);\n     * nineSliceSprite.destroy({ texture: true, textureSource: true });\n     */\n    public override destroy(options?: DestroyOptions): void\n    {\n        super.destroy(options);\n\n        const destroyTexture = typeof options === 'boolean' ? options : options?.texture;\n\n        if (destroyTexture)\n        {\n            const destroyTextureSource = typeof options === 'boolean' ? options : options?.textureSource;\n\n            this._texture.destroy(destroyTextureSource);\n        }\n\n        this._texture = null;\n    }\n\n    /** @private */\n    protected override updateBounds()\n    {\n        const bounds = this._bounds;\n\n        const anchor = this._anchor;\n\n        const width = this._width;\n        const height = this._height;\n\n        bounds.minX = -anchor._x * width;\n        bounds.maxX = bounds.minX + width;\n\n        bounds.minY = -anchor._y * height;\n        bounds.maxY = bounds.minY + height;\n    }\n}\n\n/**\n * Please use the {@link NineSliceSprite} class instead.\n * The NineSlicePlane is deprecated and will be removed in future versions.\n * @deprecated since 8.0.0\n * @category scene\n */\nexport class NineSlicePlane extends NineSliceSprite\n{\n    constructor(options: NineSliceSpriteOptions | Texture);\n    /** @deprecated since 8.0.0 */\n    constructor(texture: Texture, leftWidth: number, topHeight: number, rightWidth: number, bottomHeight: number);\n    constructor(...args: [NineSliceSpriteOptions | Texture] | [Texture, number, number, number, number])\n    {\n        let options = args[0];\n\n        if (options instanceof Texture)\n        {\n            // #if _DEBUG\n            // eslint-disable-next-line max-len\n            deprecation(v8_0_0, 'NineSlicePlane now uses the options object {texture, leftWidth, rightWidth, topHeight, bottomHeight}');\n            // #endif\n\n            options = {\n                texture: options,\n                leftWidth: args[1],\n                topHeight: args[2],\n                rightWidth: args[3],\n                bottomHeight: args[4],\n            };\n        }\n\n        // #if _DEBUG\n        deprecation(v8_0_0, 'NineSlicePlane is deprecated. Use NineSliceSprite instead.');\n        // #endif\n\n        super(options);\n    }\n}\n"],"names":[],"mappings":";;;;;;;;AAqNO,MAAM,gBAAA,GAAN,MAAM,gBAAA,SAAwB,aAAA,CACrC;AAAA,EAuCI,YAAY,OAAA,EACZ;AACI,IAAA,IAAK,mBAAmB,OAAA,EACxB;AACI,MAAA,OAAA,GAAU,EAAE,SAAS,OAAA,EAAQ;AAAA,IACjC;AAEA,IAAA,MAAM;AAAA,MACF,KAAA;AAAA,MACA,MAAA;AAAA,MACA,MAAA;AAAA,MACA,SAAA;AAAA,MACA,UAAA;AAAA,MACA,SAAA;AAAA,MACA,YAAA;AAAA,MACA,OAAA;AAAA,MACA,WAAA;AAAA,MACA,GAAG;AAAA,KACP,GAAI,OAAA;AAEJ,IAAA,KAAA,CAAM;AAAA,MACF,KAAA,EAAO,iBAAA;AAAA,MACP,GAAG;AAAA,KACN,CAAA;AArCL;AAAA,IAAA,IAAA,CAAyB,YAAA,GAAuB,iBAAA;AAMhD;AA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