1 | {"version":3,"file":"BaseTexture.js","sources":["../../src/textures/BaseTexture.ts"],"sourcesContent":["import { ALPHA_MODES, FORMATS, MIPMAP_MODES, SCALE_MODES, TARGETS, TYPES, WRAP_MODES } from '@pixi/constants';\nimport { settings } from '@pixi/settings';\nimport { BaseTextureCache, EventEmitter, isPow2, TextureCache, uid } from '@pixi/utils';\nimport { autoDetectResource } from './resources/autoDetectResource';\nimport { BufferResource } from './resources/BufferResource';\nimport { Resource } from './resources/Resource';\n\nimport type { MSAA_QUALITY } from '@pixi/constants';\nimport type { ICanvas } from '@pixi/settings';\nimport type { GLTexture } from './GLTexture';\nimport type { IAutoDetectOptions } from './resources/autoDetectResource';\nimport type { BufferType, IBufferResourceOptions } from './resources/BufferResource';\n\nconst defaultBufferOptions = {\n scaleMode: SCALE_MODES.NEAREST,\n alphaMode: ALPHA_MODES.NPM,\n};\n\n/**\n * Value types for the constructor of {@link PIXI.BaseTexture}, including:\n * - `HTMLImageElement`\n * - `HTMLVideoElement`\n * - `ImageBitmap`\n * - {@link PIXI.ICanvas}\n * - `VideoFrame`\n * @memberof PIXI\n */\nexport type ImageSource = HTMLImageElement | HTMLVideoElement | ImageBitmap | ICanvas | VideoFrame;\n\nexport interface IBaseTextureOptions<RO = any>\n{\n alphaMode?: ALPHA_MODES;\n mipmap?: MIPMAP_MODES;\n anisotropicLevel?: number;\n scaleMode?: SCALE_MODES;\n width?: number;\n height?: number;\n wrapMode?: WRAP_MODES;\n format?: FORMATS;\n type?: TYPES;\n target?: TARGETS;\n resolution?: number;\n multisample?: MSAA_QUALITY;\n resourceOptions?: RO;\n pixiIdPrefix?: string;\n}\n\nexport interface BaseTexture extends GlobalMixins.BaseTexture, EventEmitter {}\n\n/**\n * A Texture stores the information that represents an image.\n * All textures have a base texture, which contains information about the source.\n * Therefore you can have many textures all using a single BaseTexture\n * @memberof PIXI\n * @typeParam R - The BaseTexture's Resource type.\n * @typeParam RO - The options for constructing resource.\n */\nexport class BaseTexture<R extends Resource = Resource, RO = IAutoDetectOptions> extends EventEmitter\n{\n /**\n * The width of the base texture set when the image has loaded\n * @readonly\n */\n public width: number;\n\n /**\n * The height of the base texture set when the image has loaded\n * @readonly\n */\n public height: number;\n\n /**\n * The resolution / device pixel ratio of the texture\n * @readonly\n * @default PIXI.settings.RESOLUTION\n */\n public resolution: number;\n\n /**\n * How to treat premultiplied alpha, see {@link PIXI.ALPHA_MODES}.\n * @member {PIXI.ALPHA_MODES}\n * @default PIXI.ALPHA_MODES.UNPACK\n */\n public alphaMode: ALPHA_MODES;\n\n /**\n * Anisotropic filtering level of texture\n * @member {number}\n * @default 0\n */\n public anisotropicLevel: number;\n\n /**\n * The pixel format of the texture\n * @default PIXI.FORMATS.RGBA\n */\n public format: FORMATS;\n\n /**\n * The type of resource data\n * @default PIXI.TYPES.UNSIGNED_BYTE\n */\n public type: TYPES;\n\n /**\n * The target type\n * @default PIXI.TARGETS.TEXTURE_2D\n */\n public target: TARGETS;\n\n /**\n * Global unique identifier for this BaseTexture\n * @protected\n */\n public readonly uid: number;\n\n /**\n * Used by automatic texture Garbage Collection, stores last GC tick when it was bound\n * @protected\n */\n touched: number;\n\n /**\n * Whether or not the texture is a power of two, try to use power of two textures as much\n * as you can\n * @readonly\n * @default false\n */\n isPowerOfTwo: boolean;\n\n /**\n * The map of render context textures where this is bound\n * @private\n */\n _glTextures: { [key: number]: GLTexture };\n\n /**\n * Used by TextureSystem to only update texture to the GPU when needed.\n * Please call `update()` to increment it.\n * @readonly\n */\n dirtyId: number;\n\n /**\n * Used by TextureSystem to only update texture style when needed.\n * @protected\n */\n dirtyStyleId: number;\n\n /**\n * Currently default cache ID.\n * @member {string}\n */\n public cacheId: string;\n\n /**\n * Generally speaking means when resource is loaded.\n * @readonly\n * @member {boolean}\n */\n public valid: boolean;\n\n /**\n * The collection of alternative cache ids, since some BaseTextures\n * can have more than one ID, short name and longer full URL\n * @member {Array<string>}\n * @readonly\n */\n public textureCacheIds: Array<string>;\n\n /**\n * Flag if BaseTexture has been destroyed.\n * @member {boolean}\n * @readonly\n */\n public destroyed: boolean;\n\n /**\n * The resource used by this BaseTexture, there can only\n * be one resource per BaseTexture, but textures can share\n * resources.\n * @member {PIXI.Resource}\n * @readonly\n */\n public resource: R;\n\n /**\n * Number of the texture batch, used by multi-texture renderers\n * @member {number}\n */\n _batchEnabled: number;\n\n /**\n * Location inside texture batch, used by multi-texture renderers\n * @member {number}\n */\n _batchLocation: number;\n\n /**\n * Whether its a part of another texture, handled by ArrayResource or CubeResource\n * @member {PIXI.BaseTexture}\n */\n parentTextureArray: BaseTexture;\n\n private _mipmap: MIPMAP_MODES;\n private _scaleMode: SCALE_MODES;\n private _wrapMode: WRAP_MODES;\n\n /**\n * Default options used when creating BaseTexture objects.\n * @static\n * @memberof PIXI.BaseTexture\n * @type {PIXI.IBaseTextureOptions}\n */\n public static defaultOptions: IBaseTextureOptions = {\n /**\n * If mipmapping is enabled for texture.\n * @type {PIXI.MIPMAP_MODES}\n * @default PIXI.MIPMAP_MODES.POW2\n */\n mipmap: MIPMAP_MODES.POW2,\n /** Anisotropic filtering level of texture */\n anisotropicLevel: 0,\n /**\n * Default scale mode, linear, nearest.\n * @type {PIXI.SCALE_MODES}\n * @default PIXI.SCALE_MODES.LINEAR\n */\n scaleMode: SCALE_MODES.LINEAR,\n /**\n * Wrap mode for textures.\n * @type {PIXI.WRAP_MODES}\n * @default PIXI.WRAP_MODES.CLAMP\n */\n wrapMode: WRAP_MODES.CLAMP,\n /**\n * Pre multiply the image alpha\n * @type {PIXI.ALPHA_MODES}\n * @default PIXI.ALPHA_MODES.UNPACK\n */\n alphaMode: ALPHA_MODES.UNPACK,\n /**\n * GL texture target\n * @type {PIXI.TARGETS}\n * @default PIXI.TARGETS.TEXTURE_2D\n */\n target: TARGETS.TEXTURE_2D,\n /**\n * GL format type\n * @type {PIXI.FORMATS}\n * @default PIXI.FORMATS.RGBA\n */\n format: FORMATS.RGBA,\n /**\n * GL data type\n * @type {PIXI.TYPES}\n * @default PIXI.TYPES.UNSIGNED_BYTE\n */\n type: TYPES.UNSIGNED_BYTE,\n };\n\n /**\n * @param {PIXI.Resource|PIXI.ImageSource|string} [resource=null] -\n * The current resource to use, for things that aren't Resource objects, will be converted\n * into a Resource.\n * @param options - Collection of options, default options inherited from {@link PIXI.BaseTexture.defaultOptions}.\n * @param {PIXI.MIPMAP_MODES} [options.mipmap] - If mipmapping is enabled for texture\n * @param {number} [options.anisotropicLevel] - Anisotropic filtering level of texture\n * @param {PIXI.WRAP_MODES} [options.wrapMode] - Wrap mode for textures\n * @param {PIXI.SCALE_MODES} [options.scaleMode] - Default scale mode, linear, nearest\n * @param {PIXI.FORMATS} [options.format] - GL format type\n * @param {PIXI.TYPES} [options.type] - GL data type\n * @param {PIXI.TARGETS} [options.target] - GL texture target\n * @param {PIXI.ALPHA_MODES} [options.alphaMode] - Pre multiply the image alpha\n * @param {number} [options.width=0] - Width of the texture\n * @param {number} [options.height=0] - Height of the texture\n * @param {number} [options.resolution=PIXI.settings.RESOLUTION] - Resolution of the base texture\n * @param {object} [options.resourceOptions] - Optional resource options,\n * see {@link PIXI.autoDetectResource autoDetectResource}\n */\n constructor(resource: R | ImageSource | string | any = null, options: IBaseTextureOptions<RO> = null)\n {\n super();\n\n options = Object.assign({}, BaseTexture.defaultOptions, options);\n\n const {\n alphaMode, mipmap, anisotropicLevel, scaleMode, width, height,\n wrapMode, format, type, target, resolution, resourceOptions\n } = options;\n\n // Convert the resource to a Resource object\n if (resource && !(resource instanceof Resource))\n {\n resource = autoDetectResource<R, RO>(resource, resourceOptions);\n resource.internal = true;\n }\n\n this.resolution = resolution || settings.RESOLUTION;\n this.width = Math.round((width || 0) * this.resolution) / this.resolution;\n this.height = Math.round((height || 0) * this.resolution) / this.resolution;\n this._mipmap = mipmap;\n this.anisotropicLevel = anisotropicLevel;\n this._wrapMode = wrapMode;\n this._scaleMode = scaleMode;\n this.format = format;\n this.type = type;\n this.target = target;\n this.alphaMode = alphaMode;\n\n this.uid = uid();\n this.touched = 0;\n this.isPowerOfTwo = false;\n this._refreshPOT();\n\n this._glTextures = {};\n this.dirtyId = 0;\n this.dirtyStyleId = 0;\n this.cacheId = null;\n this.valid = width > 0 && height > 0;\n this.textureCacheIds = [];\n this.destroyed = false;\n this.resource = null;\n\n this._batchEnabled = 0;\n this._batchLocation = 0;\n this.parentTextureArray = null;\n\n /**\n * Fired when a not-immediately-available source finishes loading.\n * @protected\n * @event PIXI.BaseTexture#loaded\n * @param {PIXI.BaseTexture} baseTexture - Resource loaded.\n */\n\n /**\n * Fired when a not-immediately-available source fails to load.\n * @protected\n * @event PIXI.BaseTexture#error\n * @param {PIXI.BaseTexture} baseTexture - Resource errored.\n * @param {ErrorEvent} event - Load error event.\n */\n\n /**\n * Fired when BaseTexture is updated.\n * @protected\n * @event PIXI.BaseTexture#loaded\n * @param {PIXI.BaseTexture} baseTexture - Resource loaded.\n */\n\n /**\n * Fired when BaseTexture is updated.\n * @protected\n * @event PIXI.BaseTexture#update\n * @param {PIXI.BaseTexture} baseTexture - Instance of texture being updated.\n */\n\n /**\n * Fired when BaseTexture is destroyed.\n * @protected\n * @event PIXI.BaseTexture#dispose\n * @param {PIXI.BaseTexture} baseTexture - Instance of texture being destroyed.\n */\n\n // Set the resource\n this.setResource(resource);\n }\n\n /**\n * Pixel width of the source of this texture\n * @readonly\n */\n get realWidth(): number\n {\n return Math.round(this.width * this.resolution);\n }\n\n /**\n * Pixel height of the source of this texture\n * @readonly\n */\n get realHeight(): number\n {\n return Math.round(this.height * this.resolution);\n }\n\n /**\n * Mipmap mode of the texture, affects downscaled images\n * @default PIXI.MIPMAP_MODES.POW2\n */\n get mipmap(): MIPMAP_MODES\n {\n return this._mipmap;\n }\n set mipmap(value: MIPMAP_MODES)\n {\n if (this._mipmap !== value)\n {\n this._mipmap = value;\n this.dirtyStyleId++;\n }\n }\n\n /**\n * The scale mode to apply when scaling this texture\n * @default PIXI.SCALE_MODES.LINEAR\n */\n get scaleMode(): SCALE_MODES\n {\n return this._scaleMode;\n }\n set scaleMode(value: SCALE_MODES)\n {\n if (this._scaleMode !== value)\n {\n this._scaleMode = value;\n this.dirtyStyleId++;\n }\n }\n\n /**\n * How the texture wraps\n * @default PIXI.WRAP_MODES.CLAMP\n */\n get wrapMode(): WRAP_MODES\n {\n return this._wrapMode;\n }\n set wrapMode(value: WRAP_MODES)\n {\n if (this._wrapMode !== value)\n {\n this._wrapMode = value;\n this.dirtyStyleId++;\n }\n }\n\n /**\n * Changes style options of BaseTexture\n * @param scaleMode - Pixi scalemode\n * @param mipmap - enable mipmaps\n * @returns - this\n */\n setStyle(scaleMode?: SCALE_MODES, mipmap?: MIPMAP_MODES): this\n {\n let dirty;\n\n if (scaleMode !== undefined && scaleMode !== this.scaleMode)\n {\n this.scaleMode = scaleMode;\n dirty = true;\n }\n\n if (mipmap !== undefined && mipmap !== this.mipmap)\n {\n this.mipmap = mipmap;\n dirty = true;\n }\n\n if (dirty)\n {\n this.dirtyStyleId++;\n }\n\n return this;\n }\n\n /**\n * Changes w/h/resolution. Texture becomes valid if width and height are greater than zero.\n * @param desiredWidth - Desired visual width\n * @param desiredHeight - Desired visual height\n * @param resolution - Optionally set resolution\n * @returns - this\n */\n setSize(desiredWidth: number, desiredHeight: number, resolution?: number): this\n {\n resolution = resolution || this.resolution;\n\n return this.setRealSize(desiredWidth * resolution, desiredHeight * resolution, resolution);\n }\n\n /**\n * Sets real size of baseTexture, preserves current resolution.\n * @param realWidth - Full rendered width\n * @param realHeight - Full rendered height\n * @param resolution - Optionally set resolution\n * @returns - this\n */\n setRealSize(realWidth: number, realHeight: number, resolution?: number): this\n {\n this.resolution = resolution || this.resolution;\n this.width = Math.round(realWidth) / this.resolution;\n this.height = Math.round(realHeight) / this.resolution;\n this._refreshPOT();\n this.update();\n\n return this;\n }\n\n /**\n * Refresh check for isPowerOfTwo texture based on size\n * @private\n */\n protected _refreshPOT(): void\n {\n this.isPowerOfTwo = isPow2(this.realWidth) && isPow2(this.realHeight);\n }\n\n /**\n * Changes resolution\n * @param resolution - res\n * @returns - this\n */\n setResolution(resolution: number): this\n {\n const oldResolution = this.resolution;\n\n if (oldResolution === resolution)\n {\n return this;\n }\n\n this.resolution = resolution;\n\n if (this.valid)\n {\n this.width = Math.round(this.width * oldResolution) / resolution;\n this.height = Math.round(this.height * oldResolution) / resolution;\n this.emit('update', this);\n }\n\n this._refreshPOT();\n\n return this;\n }\n\n /**\n * Sets the resource if it wasn't set. Throws error if resource already present\n * @param resource - that is managing this BaseTexture\n * @returns - this\n */\n setResource(resource: R): this\n {\n if (this.resource === resource)\n {\n return this;\n }\n\n if (this.resource)\n {\n throw new Error('Resource can be set only once');\n }\n\n resource.bind(this);\n\n this.resource = resource;\n\n return this;\n }\n\n /** Invalidates the object. Texture becomes valid if width and height are greater than zero. */\n update(): void\n {\n if (!this.valid)\n {\n if (this.width > 0 && this.height > 0)\n {\n this.valid = true;\n this.emit('loaded', this);\n this.emit('update', this);\n }\n }\n else\n {\n this.dirtyId++;\n this.dirtyStyleId++;\n this.emit('update', this);\n }\n }\n\n /**\n * Handle errors with resources.\n * @private\n * @param event - Error event emitted.\n */\n onError(event: ErrorEvent): void\n {\n this.emit('error', this, event);\n }\n\n /**\n * Destroys this base texture.\n * The method stops if resource doesn't want this texture to be destroyed.\n * Removes texture from all caches.\n * @fires PIXI.BaseTexture#destroyed\n */\n destroy(): void\n {\n // remove and destroy the resource\n if (this.resource)\n {\n this.resource.unbind(this);\n // only destroy resourced created internally\n if (this.resource.internal)\n {\n this.resource.destroy();\n }\n this.resource = null;\n }\n\n if (this.cacheId)\n {\n delete BaseTextureCache[this.cacheId];\n delete TextureCache[this.cacheId];\n\n this.cacheId = null;\n }\n\n this.valid = false;\n\n // finally let the WebGL renderer know..\n this.dispose();\n\n BaseTexture.removeFromCache(this);\n this.textureCacheIds = null;\n\n this.destroyed = true;\n this.emit('destroyed', this);\n this.removeAllListeners();\n }\n\n /**\n * Frees the texture from WebGL memory without destroying this texture object.\n * This means you can still use the texture later which will upload it to GPU\n * memory again.\n * @fires PIXI.BaseTexture#dispose\n */\n dispose(): void\n {\n this.emit('dispose', this);\n }\n\n /** Utility function for BaseTexture|Texture cast. */\n castToBaseTexture(): BaseTexture\n {\n return this;\n }\n\n /**\n * Helper function that creates a base texture based on the source you provide.\n * The source can be - image url, image element, canvas element. If the\n * source is an image url or an image element and not in the base texture\n * cache, it will be created and loaded.\n * @static\n * @param {PIXI.ImageSource|string|string[]} source - The\n * source to create base texture from.\n * @param options - See {@link PIXI.BaseTexture}'s constructor for options.\n * @param {string} [options.pixiIdPrefix=pixiid] - If a source has no id, this is the prefix of the generated id\n * @param {boolean} [strict] - Enforce strict-mode, see {@link PIXI.settings.STRICT_TEXTURE_CACHE}.\n * @returns {PIXI.BaseTexture} The new base texture.\n */\n static from<R extends Resource = Resource, RO = IAutoDetectOptions>(source: ImageSource | string | string[],\n options?: IBaseTextureOptions<RO>, strict = settings.STRICT_TEXTURE_CACHE): BaseTexture<R>\n {\n const isFrame = typeof source === 'string';\n let cacheId = null;\n\n if (isFrame)\n {\n cacheId = source;\n }\n else\n {\n if (!(source as any)._pixiId)\n {\n const prefix = options?.pixiIdPrefix || 'pixiid';\n\n (source as any)._pixiId = `${prefix}_${uid()}`;\n }\n\n cacheId = (source as any)._pixiId;\n }\n\n let baseTexture = BaseTextureCache[cacheId] as BaseTexture<R>;\n\n // Strict-mode rejects invalid cacheIds\n if (isFrame && strict && !baseTexture)\n {\n throw new Error(`The cacheId \"${cacheId}\" does not exist in BaseTextureCache.`);\n }\n\n if (!baseTexture)\n {\n baseTexture = new BaseTexture<R>(source, options);\n baseTexture.cacheId = cacheId;\n BaseTexture.addToCache(baseTexture, cacheId);\n }\n\n return baseTexture;\n }\n\n /**\n * Create a new Texture with a BufferResource from a typed array.\n * @param buffer - The optional array to use. If no data is provided, a new Float32Array is created.\n * @param width - Width of the resource\n * @param height - Height of the resource\n * @param options - See {@link PIXI.BaseTexture}'s constructor for options.\n * Default properties are different from the constructor's defaults.\n * @param {PIXI.FORMATS} [options.format] - The format is not given, the type is inferred from the\n * type of the buffer: `RGBA` if Float32Array, Int8Array, Uint8Array, or Uint8ClampedArray,\n * otherwise `RGBA_INTEGER`.\n * @param {PIXI.TYPES} [options.type] - The type is not given, the type is inferred from the\n * type of the buffer. Maps Float32Array to `FLOAT`, Int32Array to `INT`, Uint32Array to\n * `UNSIGNED_INT`, Int16Array to `SHORT`, Uint16Array to `UNSIGNED_SHORT`, Int8Array to `BYTE`,\n * Uint8Array/Uint8ClampedArray to `UNSIGNED_BYTE`.\n * @param {PIXI.ALPHA_MODES} [options.alphaMode=PIXI.ALPHA_MODES.NPM]\n * @param {PIXI.SCALE_MODES} [options.scaleMode=PIXI.SCALE_MODES.NEAREST]\n * @returns - The resulting new BaseTexture\n */\n static fromBuffer(buffer: BufferType, width: number, height: number,\n options?: IBaseTextureOptions<IBufferResourceOptions>): BaseTexture<BufferResource>\n {\n buffer = buffer || new Float32Array(width * height * 4);\n\n const resource = new BufferResource(buffer, { width, height, ...options?.resourceOptions });\n let format: FORMATS;\n let type: TYPES;\n\n if (buffer instanceof Float32Array)\n {\n format = FORMATS.RGBA;\n type = TYPES.FLOAT;\n }\n else if (buffer instanceof Int32Array)\n {\n format = FORMATS.RGBA_INTEGER;\n type = TYPES.INT;\n }\n else if (buffer instanceof Uint32Array)\n {\n format = FORMATS.RGBA_INTEGER;\n type = TYPES.UNSIGNED_INT;\n }\n else if (buffer instanceof Int16Array)\n {\n format = FORMATS.RGBA_INTEGER;\n type = TYPES.SHORT;\n }\n else if (buffer instanceof Uint16Array)\n {\n format = FORMATS.RGBA_INTEGER;\n type = TYPES.UNSIGNED_SHORT;\n }\n else if (buffer instanceof Int8Array)\n {\n format = FORMATS.RGBA;\n type = TYPES.BYTE;\n }\n else\n {\n format = FORMATS.RGBA;\n type = TYPES.UNSIGNED_BYTE;\n }\n\n resource.internal = true;\n\n return new BaseTexture(resource, Object.assign({}, defaultBufferOptions, { type, format }, options));\n }\n\n /**\n * Adds a BaseTexture to the global BaseTextureCache. This cache is shared across the whole PIXI object.\n * @param {PIXI.BaseTexture} baseTexture - The BaseTexture to add to the cache.\n * @param {string} id - The id that the BaseTexture will be stored against.\n */\n static addToCache(baseTexture: BaseTexture, id: string): void\n {\n if (id)\n {\n if (!baseTexture.textureCacheIds.includes(id))\n {\n baseTexture.textureCacheIds.push(id);\n }\n\n // only throw a warning if there is a different base texture mapped to this id.\n if (BaseTextureCache[id] && BaseTextureCache[id] !== baseTexture)\n {\n // eslint-disable-next-line no-console\n console.warn(`BaseTexture added to the cache with an id [${id}] that already had an entry`);\n }\n\n BaseTextureCache[id] = baseTexture;\n }\n }\n\n /**\n * Remove a BaseTexture from the global BaseTextureCache.\n * @param {string|PIXI.BaseTexture} baseTexture - id of a BaseTexture to be removed, or a BaseTexture instance itself.\n * @returns {PIXI.BaseTexture|null} The BaseTexture that was removed.\n */\n static removeFromCache(baseTexture: string | BaseTexture): BaseTexture | null\n {\n if (typeof baseTexture === 'string')\n {\n const baseTextureFromCache = BaseTextureCache[baseTexture];\n\n if (baseTextureFromCache)\n {\n const index = baseTextureFromCache.textureCacheIds.indexOf(baseTexture);\n\n if (index > -1)\n {\n baseTextureFromCache.textureCacheIds.splice(index, 1);\n }\n\n delete BaseTextureCache[baseTexture];\n\n return baseTextureFromCache;\n }\n }\n else if (baseTexture?.textureCacheIds)\n {\n for (let i = 0; i < baseTexture.textureCacheIds.length; ++i)\n {\n delete BaseTextureCache[baseTexture.textureCacheIds[i]];\n }\n\n baseTexture.textureCacheIds.length = 0;\n\n return baseTexture;\n }\n\n return null;\n }\n\n /** Global number of the texture batch, used by multi-texture renderers. */\n static _globalBatch = 0;\n}\n"],"names":["SCALE_MODES","ALPHA_MODES","_BaseTexture","EventEmitter","Resource","autoDetectResource","settings","uid","isPow2","BaseTextureCache","TextureCache","BufferResource","FORMATS","TYPES","MIPMAP_MODES","WRAP_MODES","TARGETS"],"mappings":";;AAaA,MAAM,uBAAuB;AAAA,E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