1 |
- {"ast":null,"code":"import { RawTexture3D } from \"../Materials/Textures/rawTexture3D.js\";\nimport { MaterialPluginBase } from \"../Materials/materialPluginBase.js\";\n\n/**\n * Material plugin to add hardware accelerated lattice support\n * #HBZD72#5 - webgl2\n * #HBZD72#6 - webgpu\n */\nexport class LatticePluginMaterial extends MaterialPluginBase {\n /**\n * Create a new LatticePluginMaterial\n * @param lattice defines the lattice this plugin is associated with\n * @param material defines the material this plugin is associated with\n */\n constructor(lattice, material) {\n super(material, \"Lattice\", 200);\n this._lattice = lattice;\n this.refreshData();\n // let's enable it by default\n this._enable(true);\n }\n /**\n * Get the class name of the plugin\n * @returns the string \"LatticePluginMaterial\"\n */\n getClassName() {\n return \"LatticePluginMaterial\";\n }\n /**\n * Defines if the plugin supports the specified shader language\n * @param shaderLanguage defines the shader language to check\n * @returns true if supported, false otherwise\n */\n isCompatible(shaderLanguage) {\n switch (shaderLanguage) {\n case 0 /* ShaderLanguage.GLSL */:\n case 1 /* ShaderLanguage.WGSL */:\n return true;\n default:\n return false;\n }\n }\n /**\n * Must be called when the lattice data was updated\n */\n refreshData() {\n const length = this._lattice.resolutionX * this._lattice.resolutionY * this._lattice.resolutionZ * 4;\n if (!this._latticeData || this._latticeData.length !== length) {\n this._latticeData = new Float32Array(length);\n }\n for (let i = 0; i < this._lattice.resolutionX; i++) {\n for (let j = 0; j < this._lattice.resolutionY; j++) {\n for (let k = 0; k < this._lattice.resolutionZ; k++) {\n const control = this._lattice.data[i][j][k];\n const index = i + this._lattice.resolutionX * (j + this._lattice.resolutionY * k);\n control.toArray(this._latticeData, index * 4);\n }\n }\n }\n if (!this._latticeDataTexture || this._latticeDataTexture.width !== this._lattice.resolutionX || this._latticeDataTexture.height !== this._lattice.resolutionY || this._latticeDataTexture.depth !== this._lattice.resolutionZ) {\n if (this._latticeDataTexture) {\n this._latticeDataTexture.dispose();\n }\n this._latticeDataTexture = new RawTexture3D(this._latticeData, this._lattice.resolutionX, this._lattice.resolutionY, this._lattice.resolutionZ, 5, this._material.getScene(), false, false, 1, 1);\n } else {\n this._latticeDataTexture.update(this._latticeData);\n }\n }\n /**\n * Gets the description of the uniforms to add to the ubo (if engine supports ubos) or to inject directly in the vertex/fragment shaders (if engine does not support ubos)\n * @param shaderLanguage The shader language to use.\n * @returns the description of the uniforms\n */\n getUniforms(shaderLanguage = 0 /* ShaderLanguage.GLSL */) {\n if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {\n // For webgpu we only define the UBO with the correct type and size.\n return {\n ubo: [{\n name: \"lattice_cellSize\",\n size: 3,\n type: \"vec3\"\n }, {\n name: \"lattice_min\",\n size: 3,\n type: \"vec3\"\n }, {\n name: \"lattice_max\",\n size: 3,\n type: \"vec3\"\n }, {\n name: \"lattice_resolution\",\n size: 3,\n type: \"vec3\"\n }, {\n name: \"lattice_position\",\n size: 3,\n type: \"vec3\"\n }]\n };\n }\n return {\n // first, define the UBO with the correct type and size.\n ubo: [{\n name: \"lattice_cellSize\",\n size: 3,\n type: \"vec3\"\n }, {\n name: \"lattice_min\",\n size: 3,\n type: \"vec3\"\n }, {\n name: \"lattice_max\",\n size: 3,\n type: \"vec3\"\n }, {\n name: \"lattice_resolution\",\n size: 3,\n type: \"vec3\"\n }, {\n name: \"lattice_position\",\n size: 3,\n type: \"vec3\"\n }],\n // now, on the vertex shader, add the uniform itself in case uniform buffers are not supported by the engine\n vertex: `\n uniform vec3 lattice_cellSize;\n uniform vec3 lattice_min;\n uniform vec3 lattice_max;\n uniform vec3 lattice_resolution;\n uniform vec3 lattice_position;\n `\n };\n }\n /**\n * Binds the material data.\n * @param uniformBuffer defines the Uniform buffer to fill in.\n */\n bindForSubMesh(uniformBuffer) {\n this._lattice.updateInternals();\n uniformBuffer.updateVector3(\"lattice_cellSize\", this._lattice.cellSize);\n uniformBuffer.updateVector3(\"lattice_min\", this._lattice.min);\n uniformBuffer.updateVector3(\"lattice_max\", this._lattice.max);\n uniformBuffer.updateFloat3(\"lattice_resolution\", this._lattice.resolutionX, this._lattice.resolutionY, this._lattice.resolutionZ);\n uniformBuffer.updateVector3(\"lattice_position\", this._lattice.position);\n uniformBuffer.setTexture(\"latticeData\", this._latticeDataTexture);\n }\n /**\n * Gets the samplers used by the plugin.\n * @param samplers list that the sampler names should be added to.\n */\n getSamplers(samplers) {\n samplers.push(\"latticeData\");\n }\n _prepareCode(shaderLanguage = 0 /* ShaderLanguage.GLSL */) {\n if (this._code) {\n return this._code;\n }\n let code = `\n if (positionUpdated.x >= lattice_min.x && positionUpdated.x <= lattice_max.x &&\n positionUpdated.y >= lattice_min.y && positionUpdated.y <= lattice_max.y &&\n positionUpdated.z >= lattice_min.z && positionUpdated.z <= lattice_max.z) {\n\n // Map vertex position to lattice local coordinates\n vec3d localPos = vec3c((positionUpdated.x - lattice_min.x) / lattice_cellSize.x, (positionUpdated.y - lattice_min.y) / lattice_cellSize.y, (positionUpdated.z - lattice_min.z) / lattice_cellSize.z);\n\n // Get integer lattice indices\n intd i0 = intc(floor(localPos.x));\n intd j0 = intc(floor(localPos.y));\n intd k0 = intc(floor(localPos.z));\n\n intd resX = intc(lattice_resolution.x) - 1;\n intd resY = intc(lattice_resolution.y) - 1;\n intd resZ = intc(lattice_resolution.z) - 1;\n\n intd i1 = min(i0 + 1, resX);\n intd j1 = min(j0 + 1, resY);\n intd k1 = min(k0 + 1, resZ);\n\n // Compute interpolation weights\n floatd tx = localPos.x - floatc(i0);\n floatd ty = localPos.y - floatc(j0);\n floatd tz = localPos.z - floatc(k0);\n\n // Ensure indices are within bounds\n intd ii0 = clamp(i0, 0, resX);\n intd jj0 = clamp(j0, 0, resY);\n intd kk0 = clamp(k0, 0, resZ);\n intd ii1 = clamp(i1, 0, resX);\n intd jj1 = clamp(j1, 0, resY);\n intd kk1 = clamp(k1, 0, resZ);\n\n // Get lattice control points\n vec3d p000 = texelFetch(latticeData, ivec3c(ii0, jj0, kk0), 0).rgb;\n vec3d p100 = texelFetch(latticeData, ivec3c(ii1, jj0, kk0), 0).rgb;\n vec3d p010 = texelFetch(latticeData, ivec3c(ii0, jj1, kk0), 0).rgb;\n vec3d p110 = texelFetch(latticeData, ivec3c(ii1, jj1, kk0), 0).rgb;\n vec3d p001 = texelFetch(latticeData, ivec3c(ii0, jj0, kk1), 0).rgb;\n vec3d p101 = texelFetch(latticeData, ivec3c(ii1, jj0, kk1), 0).rgb;\n vec3d p011 = texelFetch(latticeData, ivec3c(ii0, jj1, kk1), 0).rgb;\n vec3d p111 = texelFetch(latticeData, ivec3c(ii1, jj1, kk1), 0).rgb;\n\n // Trilinear interpolation\n vec3d p00 = mix(p000, p100, tx);\n vec3d p01 = mix(p001, p101, tx);\n vec3d p10 = mix(p010, p110, tx);\n vec3d p11 = mix(p011, p111, tx);\n\n vec3d p0 = mix(p00, p10, ty);\n vec3d p1 = mix(p01, p11, ty);\n\n vec3d deformedPos = mix(p0, p1, tz);\n positionUpdated = deformedPos + lattice_position;\n };\n `;\n if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {\n code = `\n let lattice_min = uniforms.lattice_min;\n let lattice_max = uniforms.lattice_max;\n let lattice_resolution = uniforms.lattice_resolution;\n let lattice_position = uniforms.lattice_position;\n let lattice_cellSize = uniforms.lattice_cellSize;\n ` + code;\n code = code.replace(/ivec3c/g, \"vec3i\");\n code = code.replace(/vec3d/g, \"var\");\n code = code.replace(/vec3c/g, \"vec3f\");\n code = code.replace(/intd/g, \"var\");\n code = code.replace(/intc/g, \"i32\");\n code = code.replace(/floatd/g, \"var\");\n code = code.replace(/floatc/g, \"f32\");\n code = code.replace(/texelFetch/g, \"textureLoad\");\n } else {\n code = code.replace(/ivec3c/g, \"ivec3\");\n code = code.replace(/vec3d/g, \"vec3\");\n code = code.replace(/vec3c/g, \"vec3\");\n code = code.replace(/intd/g, \"int\");\n code = code.replace(/intc/g, \"int\");\n code = code.replace(/floatd/g, \"float\");\n code = code.replace(/floatc/g, \"float\");\n }\n this._code = code;\n return this._code;\n }\n /**\n * Returns a list of custom shader code fragments to customize the shader.\n * @param shaderType \"vertex\" or \"fragment\"\n * @param shaderLanguage The shader language to use.\n * @returns null if no code to be added, or a list of pointName =\\> code.\n */\n getCustomCode(shaderType, shaderLanguage = 0 /* ShaderLanguage.GLSL */) {\n if (shaderType === \"vertex\") {\n // we're adding this specific code at the end of the main() function\n if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {\n return {\n CUSTOM_VERTEX_DEFINITIONS: `\n var latticeData: texture_3d<f32>;\n `,\n CUSTOM_VERTEX_UPDATE_POSITION: this._prepareCode(shaderLanguage)\n };\n }\n return {\n CUSTOM_VERTEX_DEFINITIONS: `\n precision highp sampler3D;\n uniform sampler3D latticeData;\n `,\n CUSTOM_VERTEX_UPDATE_POSITION: this._prepareCode(shaderLanguage)\n };\n }\n // for other shader types we're not doing anything, return null\n return null;\n }\n /**\n * Disposes the resources of the material.\n */\n dispose() {\n if (this._latticeDataTexture) {\n this._latticeDataTexture.dispose();\n this._latticeDataTexture = null;\n }\n }\n}","map":{"version":3,"names":["RawTexture3D","MaterialPluginBase","LatticePluginMaterial","constructor","lattice","material","_lattice","refreshData","_enable","getClassName","isCompatible","shaderLanguage","length","resolutionX","resolutionY","resolutionZ","_latticeData","Float32Array","i","j","k","control","data","index","toArray","_latticeDataTexture","width","height","depth","dispose","_material","getScene","update","getUniforms","ubo","name","size","type","vertex","bindForSubMesh","uniformBuffer","updateInternals","updateVector3","cellSize","min","max","updateFloat3","position","setTexture","getSamplers","samplers","push","_prepareCode","_code","code","replace","getCustomCode","shaderType","CUSTOM_VERTEX_DEFINITIONS","CUSTOM_VERTEX_UPDATE_POSITION"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Meshes/lattice.material.js"],"sourcesContent":["import { RawTexture3D } from \"../Materials/Textures/rawTexture3D.js\";\nimport { MaterialPluginBase } from \"../Materials/materialPluginBase.js\";\n\n/**\n * Material plugin to add hardware accelerated lattice support\n * #HBZD72#5 - webgl2\n * #HBZD72#6 - webgpu\n */\nexport class LatticePluginMaterial extends MaterialPluginBase {\n /**\n * Create a new LatticePluginMaterial\n * @param lattice defines the lattice this plugin is associated with\n * @param material defines the material this plugin is associated with\n */\n constructor(lattice, material) {\n super(material, \"Lattice\", 200);\n this._lattice = lattice;\n this.refreshData();\n // let's enable it by default\n this._enable(true);\n }\n /**\n * Get the class name of the plugin\n * @returns the string \"LatticePluginMaterial\"\n */\n getClassName() {\n return \"LatticePluginMaterial\";\n }\n /**\n * Defines if the plugin supports the specified shader language\n * @param shaderLanguage defines the shader language to check\n * @returns true if supported, false otherwise\n */\n isCompatible(shaderLanguage) {\n switch (shaderLanguage) {\n case 0 /* ShaderLanguage.GLSL */:\n case 1 /* ShaderLanguage.WGSL */:\n return true;\n default:\n return false;\n }\n }\n /**\n * Must be called when the lattice data was updated\n */\n refreshData() {\n const length = this._lattice.resolutionX * this._lattice.resolutionY * this._lattice.resolutionZ * 4;\n if (!this._latticeData || this._latticeData.length !== length) {\n this._latticeData = new Float32Array(length);\n }\n for (let i = 0; i < this._lattice.resolutionX; i++) {\n for (let j = 0; j < this._lattice.resolutionY; j++) {\n for (let k = 0; k < this._lattice.resolutionZ; k++) {\n const control = this._lattice.data[i][j][k];\n const index = i + this._lattice.resolutionX * (j + this._lattice.resolutionY * k);\n control.toArray(this._latticeData, index * 4);\n }\n }\n }\n if (!this._latticeDataTexture ||\n this._latticeDataTexture.width !== this._lattice.resolutionX ||\n this._latticeDataTexture.height !== this._lattice.resolutionY ||\n this._latticeDataTexture.depth !== this._lattice.resolutionZ) {\n if (this._latticeDataTexture) {\n this._latticeDataTexture.dispose();\n }\n this._latticeDataTexture = new RawTexture3D(this._latticeData, this._lattice.resolutionX, this._lattice.resolutionY, this._lattice.resolutionZ, 5, this._material.getScene(), false, false, 1, 1);\n }\n else {\n this._latticeDataTexture.update(this._latticeData);\n }\n }\n /**\n * Gets the description of the uniforms to add to the ubo (if engine supports ubos) or to inject directly in the vertex/fragment shaders (if engine does not support ubos)\n * @param shaderLanguage The shader language to use.\n * @returns the description of the uniforms\n */\n getUniforms(shaderLanguage = 0 /* ShaderLanguage.GLSL */) {\n if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {\n // For webgpu we only define the UBO with the correct type and size.\n return {\n ubo: [\n { name: \"lattice_cellSize\", size: 3, type: \"vec3\" },\n { name: \"lattice_min\", size: 3, type: \"vec3\" },\n { name: \"lattice_max\", size: 3, type: \"vec3\" },\n { name: \"lattice_resolution\", size: 3, type: \"vec3\" },\n { name: \"lattice_position\", size: 3, type: \"vec3\" },\n ],\n };\n }\n return {\n // first, define the UBO with the correct type and size.\n ubo: [\n { name: \"lattice_cellSize\", size: 3, type: \"vec3\" },\n { name: \"lattice_min\", size: 3, type: \"vec3\" },\n { name: \"lattice_max\", size: 3, type: \"vec3\" },\n { name: \"lattice_resolution\", size: 3, type: \"vec3\" },\n { name: \"lattice_position\", size: 3, type: \"vec3\" },\n ],\n // now, on the vertex shader, add the uniform itself in case uniform buffers are not supported by the engine\n vertex: `\r\n uniform vec3 lattice_cellSize;\r\n uniform vec3 lattice_min;\r\n uniform vec3 lattice_max;\r\n uniform vec3 lattice_resolution;\r\n uniform vec3 lattice_position;\r\n `,\n };\n }\n /**\n * Binds the material data.\n * @param uniformBuffer defines the Uniform buffer to fill in.\n */\n bindForSubMesh(uniformBuffer) {\n this._lattice.updateInternals();\n uniformBuffer.updateVector3(\"lattice_cellSize\", this._lattice.cellSize);\n uniformBuffer.updateVector3(\"lattice_min\", this._lattice.min);\n uniformBuffer.updateVector3(\"lattice_max\", this._lattice.max);\n uniformBuffer.updateFloat3(\"lattice_resolution\", this._lattice.resolutionX, this._lattice.resolutionY, this._lattice.resolutionZ);\n uniformBuffer.updateVector3(\"lattice_position\", this._lattice.position);\n uniformBuffer.setTexture(\"latticeData\", this._latticeDataTexture);\n }\n /**\n * Gets the samplers used by the plugin.\n * @param samplers list that the sampler names should be added to.\n */\n getSamplers(samplers) {\n samplers.push(\"latticeData\");\n }\n _prepareCode(shaderLanguage = 0 /* ShaderLanguage.GLSL */) {\n if (this._code) {\n return this._code;\n }\n let code = `\r\n if (positionUpdated.x >= lattice_min.x && positionUpdated.x <= lattice_max.x &&\r\n positionUpdated.y >= lattice_min.y && positionUpdated.y <= lattice_max.y &&\r\n positionUpdated.z >= lattice_min.z && positionUpdated.z <= lattice_max.z) {\r\n\r\n // Map vertex position to lattice local coordinates\r\n vec3d localPos = vec3c((positionUpdated.x - lattice_min.x) / lattice_cellSize.x, (positionUpdated.y - lattice_min.y) / lattice_cellSize.y, (positionUpdated.z - lattice_min.z) / lattice_cellSize.z);\r\n\r\n // Get integer lattice indices\r\n intd i0 = intc(floor(localPos.x));\r\n intd j0 = intc(floor(localPos.y));\r\n intd k0 = intc(floor(localPos.z));\r\n\r\n intd resX = intc(lattice_resolution.x) - 1;\r\n intd resY = intc(lattice_resolution.y) - 1;\r\n intd resZ = intc(lattice_resolution.z) - 1;\r\n\r\n intd i1 = min(i0 + 1, resX);\r\n intd j1 = min(j0 + 1, resY);\r\n intd k1 = min(k0 + 1, resZ);\r\n\r\n // Compute interpolation weights\r\n floatd tx = localPos.x - floatc(i0);\r\n floatd ty = localPos.y - floatc(j0);\r\n floatd tz = localPos.z - floatc(k0);\r\n\r\n // Ensure indices are within bounds\r\n intd ii0 = clamp(i0, 0, resX);\r\n intd jj0 = clamp(j0, 0, resY);\r\n intd kk0 = clamp(k0, 0, resZ);\r\n intd ii1 = clamp(i1, 0, resX);\r\n intd jj1 = clamp(j1, 0, resY);\r\n intd kk1 = clamp(k1, 0, resZ);\r\n\r\n // Get lattice control points\r\n vec3d p000 = texelFetch(latticeData, ivec3c(ii0, jj0, kk0), 0).rgb;\r\n vec3d p100 = texelFetch(latticeData, ivec3c(ii1, jj0, kk0), 0).rgb;\r\n vec3d p010 = texelFetch(latticeData, ivec3c(ii0, jj1, kk0), 0).rgb;\r\n vec3d p110 = texelFetch(latticeData, ivec3c(ii1, jj1, kk0), 0).rgb;\r\n vec3d p001 = texelFetch(latticeData, ivec3c(ii0, jj0, kk1), 0).rgb;\r\n vec3d p101 = texelFetch(latticeData, ivec3c(ii1, jj0, kk1), 0).rgb;\r\n vec3d p011 = texelFetch(latticeData, ivec3c(ii0, jj1, kk1), 0).rgb;\r\n vec3d p111 = texelFetch(latticeData, ivec3c(ii1, jj1, kk1), 0).rgb;\r\n\r\n // Trilinear interpolation\r\n vec3d p00 = mix(p000, p100, tx);\r\n vec3d p01 = mix(p001, p101, tx);\r\n vec3d p10 = mix(p010, p110, tx);\r\n vec3d p11 = mix(p011, p111, tx);\r\n\r\n vec3d p0 = mix(p00, p10, ty);\r\n vec3d p1 = mix(p01, p11, ty);\r\n\r\n vec3d deformedPos = mix(p0, p1, tz);\r\n positionUpdated = deformedPos + lattice_position;\r\n };\r\n `;\n if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {\n code =\n `\r\n let lattice_min = uniforms.lattice_min;\r\n let lattice_max = uniforms.lattice_max;\r\n let lattice_resolution = uniforms.lattice_resolution;\r\n let lattice_position = uniforms.lattice_position;\r\n let lattice_cellSize = uniforms.lattice_cellSize;\r\n ` + code;\n code = code.replace(/ivec3c/g, \"vec3i\");\n code = code.replace(/vec3d/g, \"var\");\n code = code.replace(/vec3c/g, \"vec3f\");\n code = code.replace(/intd/g, \"var\");\n code = code.replace(/intc/g, \"i32\");\n code = code.replace(/floatd/g, \"var\");\n code = code.replace(/floatc/g, \"f32\");\n code = code.replace(/texelFetch/g, \"textureLoad\");\n }\n else {\n code = code.replace(/ivec3c/g, \"ivec3\");\n code = code.replace(/vec3d/g, \"vec3\");\n code = code.replace(/vec3c/g, \"vec3\");\n code = code.replace(/intd/g, \"int\");\n code = code.replace(/intc/g, \"int\");\n code = code.replace(/floatd/g, \"float\");\n code = code.replace(/floatc/g, \"float\");\n }\n this._code = code;\n return this._code;\n }\n /**\n * Returns a list of custom shader code fragments to customize the shader.\n * @param shaderType \"vertex\" or \"fragment\"\n * @param shaderLanguage The shader language to use.\n * @returns null if no code to be added, or a list of pointName =\\> code.\n */\n getCustomCode(shaderType, shaderLanguage = 0 /* ShaderLanguage.GLSL */) {\n if (shaderType === \"vertex\") {\n // we're adding this specific code at the end of the main() function\n if (shaderLanguage === 1 /* ShaderLanguage.WGSL */) {\n return {\n CUSTOM_VERTEX_DEFINITIONS: `\r\n var latticeData: texture_3d<f32>;\r\n `,\n CUSTOM_VERTEX_UPDATE_POSITION: this._prepareCode(shaderLanguage),\n };\n }\n return {\n CUSTOM_VERTEX_DEFINITIONS: `\r\n precision highp sampler3D;\r\n uniform sampler3D latticeData;\r\n `,\n CUSTOM_VERTEX_UPDATE_POSITION: this._prepareCode(shaderLanguage),\n };\n }\n // for other shader types we're not doing anything, return null\n return null;\n }\n /**\n * Disposes the resources of the material.\n */\n dispose() {\n if (this._latticeDataTexture) {\n this._latticeDataTexture.dispose();\n this._latticeDataTexture = null;\n }\n }\n}\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,uCAAuC;AACpE,SAASC,kBAAkB,QAAQ,oCAAoC;;AAEvE;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,qBAAqB,SAASD,kBAAkB,CAAC;EAC1D;AACJ;AACA;AACA;AACA;EACIE,WAAWA,CAACC,OAAO,EAAEC,QAAQ,EAAE;IAC3B,KAAK,CAACA,QAAQ,EAAE,SAAS,EAAE,GAAG,CAAC;IAC/B,IAAI,CAACC,QAAQ,GAAGF,OAAO;IACvB,IAAI,CAACG,WAAW,CAAC,CAAC;IAClB;IACA,IAAI,CAACC,OAAO,CAAC,IAAI,CAAC;EACtB;EACA;AACJ;AACA;AACA;EACIC,YAAYA,CAAA,EAAG;IACX,OAAO,uBAAuB;EAClC;EACA;AACJ;AACA;AACA;AACA;EACIC,YAAYA,CAACC,cAAc,EAAE;IACzB,QAAQA,cAAc;MAClB,KAAK,CAAC,CAAC;MACP,KAAK,CAAC,CAAC;QACH,OAAO,IAAI;MACf;QACI,OAAO,KAAK;IACpB;EACJ;EACA;AACJ;AACA;EACIJ,WAAWA,C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