@loaders.gl/draco 4.4.0-alpha.1 → 4.4.0-alpha.11
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/dist/dist.dev.js +110 -26
- package/dist/dist.min.js +6 -6
- package/dist/draco-arrow-loader.d.ts +1 -1
- package/dist/draco-arrow-loader.js +1 -0
- package/dist/draco-arrow-loader.js.map +1 -0
- package/dist/draco-format.js +1 -0
- package/dist/draco-format.js.map +1 -0
- package/dist/draco-loader.d.ts +4 -4
- package/dist/draco-loader.d.ts.map +1 -1
- package/dist/draco-loader.js +2 -1
- package/dist/draco-loader.js.map +1 -0
- package/dist/draco-worker-node.js +197 -91
- package/dist/draco-worker-node.js.map +4 -4
- package/dist/draco-worker.js +98 -26
- package/dist/draco-worker.js.map +2 -2
- package/dist/draco-writer-worker-node.js +158 -72
- package/dist/draco-writer-worker-node.js.map +4 -4
- package/dist/draco-writer-worker.js +60 -7
- package/dist/draco-writer-worker.js.map +2 -2
- package/dist/draco-writer.js +2 -1
- package/dist/draco-writer.js.map +1 -0
- package/dist/draco3d/draco3d-types.js +1 -0
- package/dist/draco3d/draco3d-types.js.map +1 -0
- package/dist/index.cjs +49 -11
- package/dist/index.cjs.map +3 -3
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/draco-builder.js +1 -0
- package/dist/lib/draco-builder.js.map +1 -0
- package/dist/lib/draco-module-loader.d.ts +3 -2
- package/dist/lib/draco-module-loader.d.ts.map +1 -1
- package/dist/lib/draco-module-loader.js +53 -10
- package/dist/lib/draco-module-loader.js.map +1 -0
- package/dist/lib/draco-parser.js +1 -0
- package/dist/lib/draco-parser.js.map +1 -0
- package/dist/lib/draco-types.js +1 -0
- package/dist/lib/draco-types.js.map +1 -0
- package/dist/lib/utils/get-draco-schema.js +1 -0
- package/dist/lib/utils/get-draco-schema.js.map +1 -0
- package/dist/lib/utils/version.js +2 -1
- package/dist/lib/utils/version.js.map +1 -0
- package/dist/libs/libs/draco_decoder.wasm +0 -0
- package/dist/libs/libs/draco_encoder.js +52 -0
- package/dist/libs/libs/draco_wasm_wrapper.js +117 -0
- package/dist/workers/draco-worker-node.js +1 -0
- package/dist/workers/draco-worker-node.js.map +1 -0
- package/dist/workers/draco-worker.js +1 -0
- package/dist/workers/draco-worker.js.map +1 -0
- package/dist/workers/draco-writer-worker-node.cjs +18 -0
- package/dist/workers/draco-writer-worker-node.cjs.map +1 -0
- package/dist/workers/draco-writer-worker-node.d.cts +2 -0
- package/dist/workers/draco-writer-worker-node.d.cts.map +1 -0
- package/dist/workers/draco-writer-worker-node.js +1 -0
- package/dist/workers/draco-writer-worker-node.js.map +1 -0
- package/dist/workers/draco-writer-worker.js +1 -0
- package/dist/workers/draco-writer-worker.js.map +1 -0
- package/package.json +19 -7
- package/src/draco-loader.ts +6 -3
- package/src/draco-writer.ts +1 -1
- package/src/lib/draco-module-loader.ts +87 -23
- package/src/workers/draco-writer-worker-node.cjs +18 -0
package/dist/index.cjs.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["index.
|
|
4
|
-
"sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n// Module constants\nexport { DRACO_EXTERNAL_LIBRARIES, DRACO_EXTERNAL_LIBRARY_URLS } from \"./lib/draco-module-loader.js\";\nexport { DracoWriterWorker, DracoWriter } from \"./draco-writer.js\";\nexport { DracoWorkerLoader, DracoLoader } from \"./draco-loader.js\";\nexport { DracoArrowLoader } from \"./draco-arrow-loader.js\";\n", "// Dynamic DRACO module loading inspired by THREE.DRACOLoader\n// https://github.com/mrdoob/three.js/blob/398c4f39ebdb8b23eefd4a7a5ec49ec0c96c7462/examples/jsm/loaders/DRACOLoader.js\n// by Don McCurdy / https://www.donmccurdy.com / MIT license\nimport { loadLibrary } from '@loaders.gl/worker-utils';\nconst DRACO_DECODER_VERSION = '1.5.6';\nconst DRACO_ENCODER_VERSION = '1.4.1';\nconst STATIC_DECODER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_DECODER_VERSION}`;\nexport const DRACO_EXTERNAL_LIBRARIES = {\n /** The primary Draco3D encoder, javascript wrapper part */\n DECODER: 'draco_wasm_wrapper.js',\n /** The primary draco decoder, compiled web assembly part */\n DECODER_WASM: 'draco_decoder.wasm',\n /** Fallback decoder for non-webassebly environments. Very big bundle, lower performance */\n FALLBACK_DECODER: 'draco_decoder.js',\n /** Draco encoder */\n ENCODER: 'draco_encoder.js'\n};\nexport const DRACO_EXTERNAL_LIBRARY_URLS = {\n [DRACO_EXTERNAL_LIBRARIES.DECODER]: `${STATIC_DECODER_URL}/${DRACO_EXTERNAL_LIBRARIES.DECODER}`,\n [DRACO_EXTERNAL_LIBRARIES.DECODER_WASM]: `${STATIC_DECODER_URL}/${DRACO_EXTERNAL_LIBRARIES.DECODER_WASM}`,\n [DRACO_EXTERNAL_LIBRARIES.FALLBACK_DECODER]: `${STATIC_DECODER_URL}/${DRACO_EXTERNAL_LIBRARIES.FALLBACK_DECODER}`,\n [DRACO_EXTERNAL_LIBRARIES.ENCODER]: `https://raw.githubusercontent.com/google/draco/${DRACO_ENCODER_VERSION}/javascript/${DRACO_EXTERNAL_LIBRARIES.ENCODER}`\n};\nlet loadDecoderPromise;\nlet loadEncoderPromise;\nexport async function loadDracoDecoderModule(options) {\n const modules = options.modules || {};\n // Check if a bundled draco3d library has been supplied by application\n if (modules.draco3d) {\n loadDecoderPromise ||= modules.draco3d.createDecoderModule({}).then((draco) => {\n return { draco };\n });\n }\n else {\n // If not, dynamically load the WASM script from our CDN\n loadDecoderPromise ||= loadDracoDecoder(options);\n }\n return await loadDecoderPromise;\n}\nexport async function loadDracoEncoderModule(options) {\n const modules = options.modules || {};\n // Check if a bundled draco3d library has been supplied by application\n if (modules.draco3d) {\n loadEncoderPromise ||= modules.draco3d.createEncoderModule({}).then((draco) => {\n return { draco };\n });\n }\n else {\n // If not, dynamically load the WASM script from our CDN\n loadEncoderPromise ||= loadDracoEncoder(options);\n }\n return await loadEncoderPromise;\n}\n// DRACO DECODER LOADING\nasync function loadDracoDecoder(options) {\n let DracoDecoderModule;\n let wasmBinary;\n switch (options.draco && options.draco.decoderType) {\n case 'js':\n DracoDecoderModule = await loadLibrary(DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.FALLBACK_DECODER], 'draco', options, DRACO_EXTERNAL_LIBRARIES.FALLBACK_DECODER);\n break;\n case 'wasm':\n default:\n [DracoDecoderModule, wasmBinary] = await Promise.all([\n await loadLibrary(DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.DECODER], 'draco', options, DRACO_EXTERNAL_LIBRARIES.DECODER),\n await loadLibrary(DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.DECODER_WASM], 'draco', options, DRACO_EXTERNAL_LIBRARIES.DECODER_WASM)\n ]);\n }\n // Depends on how import happened...\n // @ts-ignore\n DracoDecoderModule = DracoDecoderModule || globalThis.DracoDecoderModule;\n return await initializeDracoDecoder(DracoDecoderModule, wasmBinary);\n}\nfunction initializeDracoDecoder(DracoDecoderModule, wasmBinary) {\n const options = {};\n if (wasmBinary) {\n options.wasmBinary = wasmBinary;\n }\n return new Promise((resolve) => {\n DracoDecoderModule({\n ...options,\n onModuleLoaded: (draco) => resolve({ draco }) // Module is Promise-like. Wrap in object to avoid loop.\n });\n });\n}\n// ENCODER\nasync function loadDracoEncoder(options) {\n let DracoEncoderModule = await loadLibrary(DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.ENCODER], 'draco', options, DRACO_EXTERNAL_LIBRARIES.ENCODER);\n // @ts-ignore\n DracoEncoderModule = DracoEncoderModule || globalThis.DracoEncoderModule;\n return new Promise((resolve) => {\n DracoEncoderModule({\n onModuleLoaded: (draco) => resolve({ draco }) // Module is Promise-like. Wrap in object to avoid loop.\n });\n });\n}\n", "// Native Draco attribute names to GLTF attribute names.\nconst GLTF_TO_DRACO_ATTRIBUTE_NAME_MAP = {\n POSITION: 'POSITION',\n NORMAL: 'NORMAL',\n COLOR_0: 'COLOR',\n TEXCOORD_0: 'TEX_COORD'\n};\nconst noop = () => { };\nexport default class DracoBuilder {\n draco;\n dracoEncoder;\n dracoMeshBuilder;\n dracoMetadataBuilder;\n log;\n // draco - the draco decoder, either import `draco3d` or load dynamically\n constructor(draco) {\n this.draco = draco;\n this.dracoEncoder = new this.draco.Encoder();\n this.dracoMeshBuilder = new this.draco.MeshBuilder();\n this.dracoMetadataBuilder = new this.draco.MetadataBuilder();\n }\n destroy() {\n this.destroyEncodedObject(this.dracoMeshBuilder);\n this.destroyEncodedObject(this.dracoEncoder);\n this.destroyEncodedObject(this.dracoMetadataBuilder);\n // @ts-ignore\n this.dracoMeshBuilder = null;\n // @ts-ignore\n this.dracoEncoder = null;\n // @ts-ignore\n this.draco = null;\n }\n // TBD - when does this need to be called?\n destroyEncodedObject(object) {\n if (object) {\n this.draco.destroy(object);\n }\n }\n /**\n * Encode mesh or point cloud\n * @param mesh =({})\n * @param options\n */\n encodeSync(mesh, options = {}) {\n this.log = noop; // TODO\n this._setOptions(options);\n return options.pointcloud\n ? this._encodePointCloud(mesh, options)\n : this._encodeMesh(mesh, options);\n }\n // PRIVATE\n _getAttributesFromMesh(mesh) {\n // TODO - Change the encodePointCloud interface instead?\n const attributes = { ...mesh, ...mesh.attributes };\n // Fold indices into the attributes\n if (mesh.indices) {\n attributes.indices = mesh.indices;\n }\n return attributes;\n }\n _encodePointCloud(pointcloud, options) {\n const dracoPointCloud = new this.draco.PointCloud();\n if (options.metadata) {\n this._addGeometryMetadata(dracoPointCloud, options.metadata);\n }\n const attributes = this._getAttributesFromMesh(pointcloud);\n // Build a `DracoPointCloud` from the input data\n this._createDracoPointCloud(dracoPointCloud, attributes, options);\n const dracoData = new this.draco.DracoInt8Array();\n try {\n const encodedLen = this.dracoEncoder.EncodePointCloudToDracoBuffer(dracoPointCloud, false, dracoData);\n if (!(encodedLen > 0)) {\n throw new Error('Draco encoding failed.');\n }\n this.log(`DRACO encoded ${dracoPointCloud.num_points()} points\n with ${dracoPointCloud.num_attributes()} attributes into ${encodedLen} bytes`);\n return dracoInt8ArrayToArrayBuffer(dracoData);\n }\n finally {\n this.destroyEncodedObject(dracoData);\n this.destroyEncodedObject(dracoPointCloud);\n }\n }\n _encodeMesh(mesh, options) {\n const dracoMesh = new this.draco.Mesh();\n if (options.metadata) {\n this._addGeometryMetadata(dracoMesh, options.metadata);\n }\n const attributes = this._getAttributesFromMesh(mesh);\n // Build a `DracoMesh` from the input data\n this._createDracoMesh(dracoMesh, attributes, options);\n const dracoData = new this.draco.DracoInt8Array();\n try {\n const encodedLen = this.dracoEncoder.EncodeMeshToDracoBuffer(dracoMesh, dracoData);\n if (encodedLen <= 0) {\n throw new Error('Draco encoding failed.');\n }\n this.log(`DRACO encoded ${dracoMesh.num_points()} points\n with ${dracoMesh.num_attributes()} attributes into ${encodedLen} bytes`);\n return dracoInt8ArrayToArrayBuffer(dracoData);\n }\n finally {\n this.destroyEncodedObject(dracoData);\n this.destroyEncodedObject(dracoMesh);\n }\n }\n /**\n * Set encoding options.\n * @param {{speed?: any; method?: any; quantization?: any;}} options\n */\n _setOptions(options) {\n if ('speed' in options) {\n // @ts-ignore\n this.dracoEncoder.SetSpeedOptions(...options.speed);\n }\n if ('method' in options) {\n const dracoMethod = this.draco[options.method || 'MESH_SEQUENTIAL_ENCODING'];\n // assert(dracoMethod)\n this.dracoEncoder.SetEncodingMethod(dracoMethod);\n }\n if ('quantization' in options) {\n for (const attribute in options.quantization) {\n const bits = options.quantization[attribute];\n const dracoPosition = this.draco[attribute];\n this.dracoEncoder.SetAttributeQuantization(dracoPosition, bits);\n }\n }\n }\n /**\n * @param {Mesh} dracoMesh\n * @param {object} attributes\n * @returns {Mesh}\n */\n _createDracoMesh(dracoMesh, attributes, options) {\n const optionalMetadata = options.attributesMetadata || {};\n try {\n const positions = this._getPositionAttribute(attributes);\n if (!positions) {\n throw new Error('positions');\n }\n const vertexCount = positions.length / 3;\n for (let attributeName in attributes) {\n const attribute = attributes[attributeName];\n attributeName = GLTF_TO_DRACO_ATTRIBUTE_NAME_MAP[attributeName] || attributeName;\n const uniqueId = this._addAttributeToMesh(dracoMesh, attributeName, attribute, vertexCount);\n if (uniqueId !== -1) {\n this._addAttributeMetadata(dracoMesh, uniqueId, {\n name: attributeName,\n ...(optionalMetadata[attributeName] || {})\n });\n }\n }\n }\n catch (error) {\n this.destroyEncodedObject(dracoMesh);\n throw error;\n }\n return dracoMesh;\n }\n /**\n * @param {} dracoPointCloud\n * @param {object} attributes\n */\n _createDracoPointCloud(dracoPointCloud, attributes, options) {\n const optionalMetadata = options.attributesMetadata || {};\n try {\n const positions = this._getPositionAttribute(attributes);\n if (!positions) {\n throw new Error('positions');\n }\n const vertexCount = positions.length / 3;\n for (let attributeName in attributes) {\n const attribute = attributes[attributeName];\n attributeName = GLTF_TO_DRACO_ATTRIBUTE_NAME_MAP[attributeName] || attributeName;\n const uniqueId = this._addAttributeToMesh(dracoPointCloud, attributeName, attribute, vertexCount);\n if (uniqueId !== -1) {\n this._addAttributeMetadata(dracoPointCloud, uniqueId, {\n name: attributeName,\n ...(optionalMetadata[attributeName] || {})\n });\n }\n }\n }\n catch (error) {\n this.destroyEncodedObject(dracoPointCloud);\n throw error;\n }\n return dracoPointCloud;\n }\n /**\n * @param mesh\n * @param attributeName\n * @param attribute\n * @param vertexCount\n */\n _addAttributeToMesh(mesh, attributeName, attribute, vertexCount) {\n if (!ArrayBuffer.isView(attribute)) {\n return -1;\n }\n const type = this._getDracoAttributeType(attributeName);\n // @ts-ignore TODO/fix types\n const size = attribute.length / vertexCount;\n if (type === 'indices') {\n // @ts-ignore TODO/fix types\n const numFaces = attribute.length / 3;\n this.log(`Adding attribute ${attributeName}, size ${numFaces}`);\n // @ts-ignore assumes mesh is a Mesh, not a point cloud\n this.dracoMeshBuilder.AddFacesToMesh(mesh, numFaces, attribute);\n return -1;\n }\n this.log(`Adding attribute ${attributeName}, size ${size}`);\n const builder = this.dracoMeshBuilder;\n const { buffer } = attribute;\n switch (attribute.constructor) {\n case Int8Array:\n return builder.AddInt8Attribute(mesh, type, vertexCount, size, new Int8Array(buffer));\n case Int16Array:\n return builder.AddInt16Attribute(mesh, type, vertexCount, size, new Int16Array(buffer));\n case Int32Array:\n return builder.AddInt32Attribute(mesh, type, vertexCount, size, new Int32Array(buffer));\n case Uint8Array:\n case Uint8ClampedArray:\n return builder.AddUInt8Attribute(mesh, type, vertexCount, size, new Uint8Array(buffer));\n case Uint16Array:\n return builder.AddUInt16Attribute(mesh, type, vertexCount, size, new Uint16Array(buffer));\n case Uint32Array:\n return builder.AddUInt32Attribute(mesh, type, vertexCount, size, new Uint32Array(buffer));\n case Float32Array:\n return builder.AddFloatAttribute(mesh, type, vertexCount, size, new Float32Array(buffer));\n default:\n // eslint-disable-next-line no-console\n console.warn('Unsupported attribute type', attribute);\n return -1;\n }\n // case Float64Array:\n // Add attribute does not seem to be exposed\n // return builder.AddAttribute(mesh, type, vertexCount, size, new Float32Array(buffer));\n }\n /**\n * DRACO can compress attributes of know type better\n * TODO - expose an attribute type map?\n * @param attributeName\n */\n _getDracoAttributeType(attributeName) {\n switch (attributeName.toLowerCase()) {\n case 'indices':\n return 'indices';\n case 'position':\n case 'positions':\n case 'vertices':\n return this.draco.POSITION;\n case 'normal':\n case 'normals':\n return this.draco.NORMAL;\n case 'color':\n case 'colors':\n return this.draco.COLOR;\n case 'texcoord':\n case 'texcoords':\n return this.draco.TEX_COORD;\n default:\n return this.draco.GENERIC;\n }\n }\n _getPositionAttribute(attributes) {\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n const dracoType = this._getDracoAttributeType(attributeName);\n if (dracoType === this.draco.POSITION) {\n return attribute;\n }\n }\n return null;\n }\n /**\n * Add metadata for the geometry.\n * @param dracoGeometry - WASM Draco Object\n * @param metadata\n */\n _addGeometryMetadata(dracoGeometry, metadata) {\n const dracoMetadata = new this.draco.Metadata();\n this._populateDracoMetadata(dracoMetadata, metadata);\n this.dracoMeshBuilder.AddMetadata(dracoGeometry, dracoMetadata);\n }\n /**\n * Add metadata for an attribute to geometry.\n * @param dracoGeometry - WASM Draco Object\n * @param uniqueAttributeId\n * @param metadata\n */\n _addAttributeMetadata(dracoGeometry, uniqueAttributeId, metadata) {\n // Note: Draco JS IDL doesn't seem to expose draco.AttributeMetadata, however it seems to\n // create such objects automatically from draco.Metadata object.\n const dracoAttributeMetadata = new this.draco.Metadata();\n this._populateDracoMetadata(dracoAttributeMetadata, metadata);\n // Draco3d doc note: Directly add attribute metadata to geometry.\n // You can do this without explicitly adding |GeometryMetadata| to mesh.\n this.dracoMeshBuilder.SetMetadataForAttribute(dracoGeometry, uniqueAttributeId, dracoAttributeMetadata);\n }\n /**\n * Add contents of object or map to a WASM Draco Metadata Object\n * @param dracoMetadata - WASM Draco Object\n * @param metadata\n */\n _populateDracoMetadata(dracoMetadata, metadata) {\n for (const [key, value] of getEntries(metadata)) {\n switch (typeof value) {\n case 'number':\n if (Math.trunc(value) === value) {\n this.dracoMetadataBuilder.AddIntEntry(dracoMetadata, key, value);\n }\n else {\n this.dracoMetadataBuilder.AddDoubleEntry(dracoMetadata, key, value);\n }\n break;\n case 'object':\n if (value instanceof Int32Array) {\n this.dracoMetadataBuilder.AddIntEntryArray(dracoMetadata, key, value, value.length);\n }\n break;\n case 'string':\n default:\n this.dracoMetadataBuilder.AddStringEntry(dracoMetadata, key, value);\n }\n }\n }\n}\n// HELPER FUNCTIONS\n/**\n * Copy encoded data to buffer\n * @param dracoData\n */\nfunction dracoInt8ArrayToArrayBuffer(dracoData) {\n const byteLength = dracoData.size();\n const outputBuffer = new ArrayBuffer(byteLength);\n const outputData = new Int8Array(outputBuffer);\n for (let i = 0; i < byteLength; ++i) {\n outputData[i] = dracoData.GetValue(i);\n }\n return outputBuffer;\n}\n/** Enable iteration over either an object or a map */\nfunction getEntries(container) {\n const hasEntriesFunc = container.entries && !container.hasOwnProperty('entries');\n return hasEntriesFunc ? container.entries() : Object.entries(container);\n}\n", "// Version constant cannot be imported, it needs to correspond to the build version of **this** module.\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nexport const VERSION = typeof \"4.4.0-alpha.0\" !== 'undefined' ? \"4.4.0-alpha.0\" : 'latest';\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport DRACOBuilder from \"./lib/draco-builder.js\";\nimport { loadDracoEncoderModule } from \"./lib/draco-module-loader.js\";\nimport { VERSION } from \"./lib/utils/version.js\";\nconst DEFAULT_DRACO_WRITER_OPTIONS = {\n pointcloud: false, // Set to true if pointcloud (mode: 0, no indices)\n attributeNameEntry: 'name'\n // Draco Compression Parameters\n // method: 'MESH_EDGEBREAKER_ENCODING', // Use draco defaults\n // speed: [5, 5], // Use draco defaults\n // quantization: { // Use draco defaults\n // POSITION: 10\n // }\n};\n/**\n * Browser worker doesn't work because of issue during \"draco_encoder.js\" loading.\n * Refused to execute script from 'https://raw.githubusercontent.com/google/draco/1.4.1/javascript/draco_encoder.js' because its MIME type ('') is not executable.\n */\nexport const DracoWriterWorker = {\n id: 'draco-writer',\n name: 'Draco compressed geometry writer',\n module: 'draco',\n version: VERSION,\n worker: true,\n options: {\n draco: {},\n source: null\n }\n};\n/**\n * Exporter for Draco3D compressed geometries\n */\nexport const DracoWriter = {\n name: 'DRACO',\n id: 'draco',\n module: 'draco',\n version: VERSION,\n extensions: ['drc'],\n mimeTypes: ['application/octet-stream'],\n options: {\n draco: DEFAULT_DRACO_WRITER_OPTIONS\n },\n encode\n};\nasync function encode(data, options = {}) {\n // Dynamically load draco\n const { draco } = await loadDracoEncoderModule(options);\n const dracoBuilder = new DRACOBuilder(draco);\n try {\n return dracoBuilder.encodeSync(data, options.draco);\n }\n finally {\n dracoBuilder.destroy();\n }\n}\n", "/* eslint-disable camelcase */\nimport { getMeshBoundingBox } from '@loaders.gl/schema-utils';\nimport { getDracoSchema } from \"./utils/get-draco-schema.js\";\n// @ts-ignore\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst GEOMETRY_TYPE = {\n TRIANGULAR_MESH: 0,\n POINT_CLOUD: 1\n};\n// Native Draco attribute names to GLTF attribute names.\nconst DRACO_TO_GLTF_ATTRIBUTE_NAME_MAP = {\n POSITION: 'POSITION',\n NORMAL: 'NORMAL',\n COLOR: 'COLOR_0',\n TEX_COORD: 'TEXCOORD_0'\n};\nconst DRACO_DATA_TYPE_TO_TYPED_ARRAY_MAP = {\n 1: Int8Array,\n 2: Uint8Array,\n 3: Int16Array,\n 4: Uint16Array,\n 5: Int32Array,\n 6: Uint32Array,\n // 7: BigInt64Array,\n // 8: BigUint64Array,\n 9: Float32Array\n // 10: Float64Array\n // 11: BOOL - What array type do we use for this?\n};\nconst INDEX_ITEM_SIZE = 4;\nexport default class DracoParser {\n draco;\n decoder;\n metadataQuerier;\n // draco - the draco decoder, either import `draco3d` or load dynamically\n constructor(draco) {\n this.draco = draco;\n this.decoder = new this.draco.Decoder();\n this.metadataQuerier = new this.draco.MetadataQuerier();\n }\n /**\n * Destroy draco resources\n */\n destroy() {\n this.draco.destroy(this.decoder);\n this.draco.destroy(this.metadataQuerier);\n }\n /**\n * NOTE: caller must call `destroyGeometry` on the return value after using it\n * @param arrayBuffer\n * @param options\n */\n parseSync(arrayBuffer, options = {}) {\n const buffer = new this.draco.DecoderBuffer();\n buffer.Init(new Int8Array(arrayBuffer), arrayBuffer.byteLength);\n this._disableAttributeTransforms(options);\n const geometry_type = this.decoder.GetEncodedGeometryType(buffer);\n const dracoGeometry = geometry_type === this.draco.TRIANGULAR_MESH\n ? new this.draco.Mesh()\n : new this.draco.PointCloud();\n try {\n let dracoStatus;\n switch (geometry_type) {\n case this.draco.TRIANGULAR_MESH:\n dracoStatus = this.decoder.DecodeBufferToMesh(buffer, dracoGeometry);\n break;\n case this.draco.POINT_CLOUD:\n dracoStatus = this.decoder.DecodeBufferToPointCloud(buffer, dracoGeometry);\n break;\n default:\n throw new Error('DRACO: Unknown geometry type.');\n }\n if (!dracoStatus.ok() || !dracoGeometry.ptr) {\n const message = `DRACO decompression failed: ${dracoStatus.error_msg()}`;\n // console.error(message);\n throw new Error(message);\n }\n const loaderData = this._getDracoLoaderData(dracoGeometry, geometry_type, options);\n const geometry = this._getMeshData(dracoGeometry, loaderData, options);\n const boundingBox = getMeshBoundingBox(geometry.attributes);\n const schema = getDracoSchema(geometry.attributes, loaderData, geometry.indices);\n const data = {\n loader: 'draco',\n loaderData,\n header: {\n vertexCount: dracoGeometry.num_points(),\n boundingBox\n },\n ...geometry,\n schema\n };\n return data;\n }\n finally {\n this.draco.destroy(buffer);\n if (dracoGeometry) {\n this.draco.destroy(dracoGeometry);\n }\n }\n }\n // Draco specific \"loader data\"\n /**\n * Extract\n * @param dracoGeometry\n * @param geometry_type\n * @param options\n * @returns\n */\n _getDracoLoaderData(dracoGeometry, geometry_type, options) {\n const metadata = this._getTopLevelMetadata(dracoGeometry);\n const attributes = this._getDracoAttributes(dracoGeometry, options);\n return {\n geometry_type,\n num_attributes: dracoGeometry.num_attributes(),\n num_points: dracoGeometry.num_points(),\n num_faces: dracoGeometry instanceof this.draco.Mesh ? dracoGeometry.num_faces() : 0,\n metadata,\n attributes\n };\n }\n /**\n * Extract all draco provided information and metadata for each attribute\n * @param dracoGeometry\n * @param options\n * @returns\n */\n _getDracoAttributes(dracoGeometry, options) {\n const dracoAttributes = {};\n for (let attributeId = 0; attributeId < dracoGeometry.num_attributes(); attributeId++) {\n // Note: Draco docs do not seem clear on `GetAttribute` ids just being a zero-based index,\n // but it does seems to work this way\n const dracoAttribute = this.decoder.GetAttribute(dracoGeometry, attributeId);\n const metadata = this._getAttributeMetadata(dracoGeometry, attributeId);\n dracoAttributes[dracoAttribute.unique_id()] = {\n unique_id: dracoAttribute.unique_id(),\n attribute_type: dracoAttribute.attribute_type(),\n data_type: dracoAttribute.data_type(),\n num_components: dracoAttribute.num_components(),\n byte_offset: dracoAttribute.byte_offset(),\n byte_stride: dracoAttribute.byte_stride(),\n normalized: dracoAttribute.normalized(),\n attribute_index: attributeId,\n metadata\n };\n // Add transformation parameters for any attributes app wants untransformed\n const quantization = this._getQuantizationTransform(dracoAttribute, options);\n if (quantization) {\n dracoAttributes[dracoAttribute.unique_id()].quantization_transform = quantization;\n }\n const octahedron = this._getOctahedronTransform(dracoAttribute, options);\n if (octahedron) {\n dracoAttributes[dracoAttribute.unique_id()].octahedron_transform = octahedron;\n }\n }\n return dracoAttributes;\n }\n /**\n * Get standard loaders.gl mesh category data\n * Extracts the geometry from draco\n * @param dracoGeometry\n * @param options\n */\n _getMeshData(dracoGeometry, loaderData, options) {\n const attributes = this._getMeshAttributes(loaderData, dracoGeometry, options);\n const positionAttribute = attributes.POSITION;\n if (!positionAttribute) {\n throw new Error('DRACO: No position attribute found.');\n }\n // For meshes, we need indices to define the faces.\n if (dracoGeometry instanceof this.draco.Mesh) {\n switch (options.topology) {\n case 'triangle-strip':\n return {\n topology: 'triangle-strip',\n // TODO - mode is wrong?\n mode: 4, // GL.TRIANGLES\n attributes,\n indices: {\n value: this._getTriangleStripIndices(dracoGeometry),\n size: 1\n }\n };\n case 'triangle-list':\n default:\n return {\n topology: 'triangle-list',\n // TODO - mode is wrong?\n mode: 5, // GL.TRIANGLE_STRIP\n attributes,\n indices: {\n value: this._getTriangleListIndices(dracoGeometry),\n size: 1\n }\n };\n }\n }\n // PointCloud - must come last as Mesh inherits from PointCloud\n return {\n topology: 'point-list',\n mode: 0, // GL.POINTS\n attributes\n };\n }\n _getMeshAttributes(loaderData, dracoGeometry, options) {\n const attributes = {};\n for (const loaderAttribute of Object.values(loaderData.attributes)) {\n const attributeName = this._deduceAttributeName(loaderAttribute, options);\n loaderAttribute.name = attributeName;\n const values = this._getAttributeValues(dracoGeometry, loaderAttribute);\n if (values) {\n const { value, size } = values;\n attributes[attributeName] = {\n value,\n size,\n byteOffset: loaderAttribute.byte_offset,\n byteStride: loaderAttribute.byte_stride,\n normalized: loaderAttribute.normalized\n };\n }\n }\n return attributes;\n }\n // MESH INDICES EXTRACTION\n /**\n * For meshes, we need indices to define the faces.\n * @param dracoGeometry\n */\n _getTriangleListIndices(dracoGeometry) {\n // Example on how to retrieve mesh and attributes.\n const numFaces = dracoGeometry.num_faces();\n const numIndices = numFaces * 3;\n const byteLength = numIndices * INDEX_ITEM_SIZE;\n const ptr = this.draco._malloc(byteLength);\n try {\n this.decoder.GetTrianglesUInt32Array(dracoGeometry, byteLength, ptr);\n return new Uint32Array(this.draco.HEAPF32.buffer, ptr, numIndices).slice();\n }\n finally {\n this.draco._free(ptr);\n }\n }\n /**\n * For meshes, we need indices to define the faces.\n * @param dracoGeometry\n */\n _getTriangleStripIndices(dracoGeometry) {\n const dracoArray = new this.draco.DracoInt32Array();\n try {\n /* const numStrips = */ this.decoder.GetTriangleStripsFromMesh(dracoGeometry, dracoArray);\n return getUint32Array(dracoArray);\n }\n finally {\n this.draco.destroy(dracoArray);\n }\n }\n /**\n *\n * @param dracoGeometry\n * @param dracoAttribute\n * @param attributeName\n */\n _getAttributeValues(dracoGeometry, attribute) {\n const TypedArrayCtor = DRACO_DATA_TYPE_TO_TYPED_ARRAY_MAP[attribute.data_type];\n if (!TypedArrayCtor) {\n // eslint-disable-next-line no-console\n console.warn(`DRACO: Unsupported attribute type ${attribute.data_type}`);\n return null;\n }\n const numComponents = attribute.num_components;\n const numPoints = dracoGeometry.num_points();\n const numValues = numPoints * numComponents;\n const byteLength = numValues * TypedArrayCtor.BYTES_PER_ELEMENT;\n const dataType = getDracoDataType(this.draco, TypedArrayCtor);\n let value;\n const ptr = this.draco._malloc(byteLength);\n try {\n const dracoAttribute = this.decoder.GetAttribute(dracoGeometry, attribute.attribute_index);\n this.decoder.GetAttributeDataArrayForAllPoints(dracoGeometry, dracoAttribute, dataType, byteLength, ptr);\n value = new TypedArrayCtor(this.draco.HEAPF32.buffer, ptr, numValues).slice();\n }\n finally {\n this.draco._free(ptr);\n }\n return { value, size: numComponents };\n }\n // Attribute names\n /**\n * DRACO does not store attribute names - We need to deduce an attribute name\n * for each attribute\n _getAttributeNames(\n dracoGeometry: Mesh | PointCloud,\n options: DracoParseOptions\n ): {[unique_id: number]: string} {\n const attributeNames: {[unique_id: number]: string} = {};\n for (let attributeId = 0; attributeId < dracoGeometry.num_attributes(); attributeId++) {\n const dracoAttribute = this.decoder.GetAttribute(dracoGeometry, attributeId);\n const attributeName = this._deduceAttributeName(dracoAttribute, options);\n attributeNames[attributeName] = attributeName;\n }\n return attributeNames;\n }\n */\n /**\n * Deduce an attribute name.\n * @note DRACO does not save attribute names, just general type (POSITION, COLOR)\n * to help optimize compression. We generate GLTF compatible names for the Draco-recognized\n * types\n * @param attributeData\n */\n _deduceAttributeName(attribute, options) {\n // Deduce name based on application provided map\n const uniqueId = attribute.unique_id;\n for (const [attributeName, attributeUniqueId] of Object.entries(options.extraAttributes || {})) {\n if (attributeUniqueId === uniqueId) {\n return attributeName;\n }\n }\n // Deduce name based on attribute type\n const thisAttributeType = attribute.attribute_type;\n for (const dracoAttributeConstant in DRACO_TO_GLTF_ATTRIBUTE_NAME_MAP) {\n const attributeType = this.draco[dracoAttributeConstant];\n if (attributeType === thisAttributeType) {\n // TODO - Return unique names if there multiple attributes per type\n // (e.g. multiple TEX_COORDS or COLORS)\n return DRACO_TO_GLTF_ATTRIBUTE_NAME_MAP[dracoAttributeConstant];\n }\n }\n // Look up in metadata\n // TODO - shouldn't this have priority?\n const entryName = options.attributeNameEntry || 'name';\n if (attribute.metadata[entryName]) {\n return attribute.metadata[entryName].string;\n }\n // Attribute of \"GENERIC\" type, we need to assign some name\n return `CUSTOM_ATTRIBUTE_${uniqueId}`;\n }\n // METADATA EXTRACTION\n /** Get top level metadata */\n _getTopLevelMetadata(dracoGeometry) {\n const dracoMetadata = this.decoder.GetMetadata(dracoGeometry);\n return this._getDracoMetadata(dracoMetadata);\n }\n /** Get per attribute metadata */\n _getAttributeMetadata(dracoGeometry, attributeId) {\n const dracoMetadata = this.decoder.GetAttributeMetadata(dracoGeometry, attributeId);\n return this._getDracoMetadata(dracoMetadata);\n }\n /**\n * Extract metadata field values\n * @param dracoMetadata\n * @returns\n */\n _getDracoMetadata(dracoMetadata) {\n // The not so wonderful world of undocumented Draco APIs :(\n if (!dracoMetadata || !dracoMetadata.ptr) {\n return {};\n }\n const result = {};\n const numEntries = this.metadataQuerier.NumEntries(dracoMetadata);\n for (let entryIndex = 0; entryIndex < numEntries; entryIndex++) {\n const entryName = this.metadataQuerier.GetEntryName(dracoMetadata, entryIndex);\n result[entryName] = this._getDracoMetadataField(dracoMetadata, entryName);\n }\n return result;\n }\n /**\n * Extracts possible values for one metadata entry by name\n * @param dracoMetadata\n * @param entryName\n */\n _getDracoMetadataField(dracoMetadata, entryName) {\n const dracoArray = new this.draco.DracoInt32Array();\n try {\n // Draco metadata fields can hold int32 arrays\n this.metadataQuerier.GetIntEntryArray(dracoMetadata, entryName, dracoArray);\n const intArray = getInt32Array(dracoArray);\n return {\n int: this.metadataQuerier.GetIntEntry(dracoMetadata, entryName),\n string: this.metadataQuerier.GetStringEntry(dracoMetadata, entryName),\n double: this.metadataQuerier.GetDoubleEntry(dracoMetadata, entryName),\n intArray\n };\n }\n finally {\n this.draco.destroy(dracoArray);\n }\n }\n // QUANTIZED ATTRIBUTE SUPPORT (NO DECOMPRESSION)\n /** Skip transforms for specific attribute types */\n _disableAttributeTransforms(options) {\n const { quantizedAttributes = [], octahedronAttributes = [] } = options;\n const skipAttributes = [...quantizedAttributes, ...octahedronAttributes];\n for (const dracoAttributeName of skipAttributes) {\n this.decoder.SkipAttributeTransform(this.draco[dracoAttributeName]);\n }\n }\n /**\n * Extract (and apply?) Position Transform\n * @todo not used\n */\n _getQuantizationTransform(dracoAttribute, options) {\n const { quantizedAttributes = [] } = options;\n const attribute_type = dracoAttribute.attribute_type();\n const skip = quantizedAttributes.map((type) => this.decoder[type]).includes(attribute_type);\n if (skip) {\n const transform = new this.draco.AttributeQuantizationTransform();\n try {\n if (transform.InitFromAttribute(dracoAttribute)) {\n return {\n quantization_bits: transform.quantization_bits(),\n range: transform.range(),\n min_values: new Float32Array([1, 2, 3]).map((i) => transform.min_value(i))\n };\n }\n }\n finally {\n this.draco.destroy(transform);\n }\n }\n return null;\n }\n _getOctahedronTransform(dracoAttribute, options) {\n const { octahedronAttributes = [] } = options;\n const attribute_type = dracoAttribute.attribute_type();\n const octahedron = octahedronAttributes\n .map((type) => this.decoder[type])\n .includes(attribute_type);\n if (octahedron) {\n const transform = new this.draco.AttributeQuantizationTransform();\n try {\n if (transform.InitFromAttribute(dracoAttribute)) {\n return {\n quantization_bits: transform.quantization_bits()\n };\n }\n }\n finally {\n this.draco.destroy(transform);\n }\n }\n return null;\n }\n}\n/**\n * Get draco specific data type by TypedArray constructor type\n * @param attributeType\n * @returns draco specific data type\n */\nfunction getDracoDataType(draco, attributeType) {\n switch (attributeType) {\n case Float32Array:\n return draco.DT_FLOAT32;\n case Int8Array:\n return draco.DT_INT8;\n case Int16Array:\n return draco.DT_INT16;\n case Int32Array:\n return draco.DT_INT32;\n case Uint8Array:\n return draco.DT_UINT8;\n case Uint16Array:\n return draco.DT_UINT16;\n case Uint32Array:\n return draco.DT_UINT32;\n default:\n return draco.DT_INVALID;\n }\n}\n/**\n * Copy a Draco int32 array into a JS typed array\n */\nfunction getInt32Array(dracoArray) {\n const numValues = dracoArray.size();\n const intArray = new Int32Array(numValues);\n for (let i = 0; i < numValues; i++) {\n intArray[i] = dracoArray.GetValue(i);\n }\n return intArray;\n}\n/**\n * Copy a Draco int32 array into a JS typed array\n */\nfunction getUint32Array(dracoArray) {\n const numValues = dracoArray.size();\n const intArray = new Int32Array(numValues);\n for (let i = 0; i < numValues; i++) {\n intArray[i] = dracoArray.GetValue(i);\n }\n return intArray;\n}\n", "import { deduceMeshField } from '@loaders.gl/schema-utils';\n/** Extract an arrow-like schema from a Draco mesh */\nexport function getDracoSchema(attributes, loaderData, indices) {\n const metadata = makeMetadata(loaderData.metadata);\n const fields = [];\n const namedLoaderDataAttributes = transformAttributesLoaderData(loaderData.attributes);\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n const field = getArrowFieldFromAttribute(attributeName, attribute, namedLoaderDataAttributes[attributeName]);\n fields.push(field);\n }\n if (indices) {\n const indicesField = getArrowFieldFromAttribute('indices', indices);\n fields.push(indicesField);\n }\n return { fields, metadata };\n}\nfunction transformAttributesLoaderData(loaderData) {\n const result = {};\n for (const key in loaderData) {\n const dracoAttribute = loaderData[key];\n result[dracoAttribute.name || 'undefined'] = dracoAttribute;\n }\n return result;\n}\nfunction getArrowFieldFromAttribute(attributeName, attribute, loaderData) {\n const metadataMap = loaderData ? makeMetadata(loaderData.metadata) : undefined;\n const field = deduceMeshField(attributeName, attribute, metadataMap);\n return field;\n}\nfunction makeMetadata(metadata) {\n Object.entries(metadata);\n const serializedMetadata = {};\n for (const key in metadata) {\n serializedMetadata[`${key}.string`] = JSON.stringify(metadata[key]);\n }\n return serializedMetadata;\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { VERSION } from \"./lib/utils/version.js\";\nimport DracoParser from \"./lib/draco-parser.js\";\nimport { loadDracoDecoderModule } from \"./lib/draco-module-loader.js\";\n/**\n * Worker loader for Draco3D compressed geometries\n */\nexport const DracoWorkerLoader = {\n dataType: null,\n batchType: null,\n name: 'Draco',\n id: 'draco',\n module: 'draco',\n // shapes: ['mesh'],\n version: VERSION,\n worker: true,\n extensions: ['drc'],\n mimeTypes: ['application/octet-stream'],\n binary: true,\n tests: ['DRACO'],\n options: {\n draco: {\n decoderType: typeof WebAssembly === 'object' ? 'wasm' : 'js', // 'js' for IE11\n libraryPath: 'libs/',\n extraAttributes: {},\n attributeNameEntry: undefined\n }\n }\n};\n/**\n * Loader for Draco3D compressed geometries\n */\nexport const DracoLoader = {\n ...DracoWorkerLoader,\n parse\n};\nasync function parse(arrayBuffer, options) {\n const { draco } = await loadDracoDecoderModule(options);\n const dracoParser = new DracoParser(draco);\n try {\n return dracoParser.parseSync(arrayBuffer, options?.draco);\n }\n finally {\n dracoParser.destroy();\n }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nimport { DracoLoader } from \"./draco-loader.js\";\nimport { convertMeshToTable } from '@loaders.gl/schema-utils';\n/**\n * Loader for Draco3D compressed geometries\n */\nexport const DracoArrowLoader = {\n ...DracoLoader,\n dataType: null,\n worker: false,\n parse\n};\nasync function parse(arrayBuffer, options) {\n const mesh = await DracoLoader.parse(arrayBuffer, options);\n const arrowTable = convertMeshToTable(mesh, 'arrow-table');\n return arrowTable;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACGA,0BAA4B;AAC5B,IAAM,wBAAwB;AAC9B,IAAM,wBAAwB;AAC9B,IAAM,qBAAqB,oDAAoD;AACxE,IAAM,2BAA2B;AAAA;AAAA,EAEpC,SAAS;AAAA;AAAA,EAET,cAAc;AAAA;AAAA,EAEd,kBAAkB;AAAA;AAAA,EAElB,SAAS;AACb;AACO,IAAM,8BAA8B;AAAA,EACvC,CAAC,yBAAyB,OAAO,GAAG,GAAG,sBAAsB,yBAAyB;AAAA,EACtF,CAAC,yBAAyB,YAAY,GAAG,GAAG,sBAAsB,yBAAyB;AAAA,EAC3F,CAAC,yBAAyB,gBAAgB,GAAG,GAAG,sBAAsB,yBAAyB;AAAA,EAC/F,CAAC,yBAAyB,OAAO,GAAG,kDAAkD,oCAAoC,yBAAyB;AACvJ;AACA,IAAI;AACJ,IAAI;AACJ,eAAsB,uBAAuB,SAAS;AAClD,QAAM,UAAU,QAAQ,WAAW,CAAC;AAEpC,MAAI,QAAQ,SAAS;AACjB,2BAAu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AAK;AACzC,MAAI;AACA,WAAO,YAAY,UAAU,aAAa,mCAAS,KAAK;AAAA,EAC5D,UACA;AACI,gBAAY,QAAQ;AAAA,EACxB;AACJ;;;AC3CA,IAAAC,uBAAmC;AAI5B,IAAM,mBAAmB;AAAA,EAC5B,GAAG;AAAA,EACH,UAAU;AAAA,EACV,QAAQ;AAAA,EACR,OAAAC;AACJ;AACA,eAAeA,OAAM,aAAa,SAAS;AACvC,QAAM,OAAO,MAAM,YAAY,MAAM,aAAa,OAAO;AACzD,QAAM,iBAAa,yCAAmB,MAAM,aAAa;AACzD,SAAO;AACX;",
|
|
3
|
+
"sources": ["../src/index.ts", "../src/lib/draco-module-loader.ts", "../src/lib/draco-builder.ts", "../src/lib/utils/version.ts", "../src/draco-writer.ts", "../src/lib/draco-parser.ts", "../src/lib/utils/get-draco-schema.ts", "../src/draco-loader.ts", "../src/draco-arrow-loader.ts"],
|
|
4
|
+
"sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\n// Module constants\nexport {DRACO_EXTERNAL_LIBRARIES, DRACO_EXTERNAL_LIBRARY_URLS} from './lib/draco-module-loader';\n\n// Draco data types\n\nexport type {DracoMesh, DracoLoaderData} from './lib/draco-types';\n\n// Draco Writer\n\nexport type {DracoWriterOptions} from './draco-writer';\nexport {DracoWriterWorker, DracoWriter} from './draco-writer';\n\n// Draco Loader\n\nexport type {DracoLoaderOptions} from './draco-loader';\nexport {DracoWorkerLoader, DracoLoader} from './draco-loader';\nexport {DracoArrowLoader} from './draco-arrow-loader';\n", "// Dynamic DRACO module loading inspired by THREE.DRACOLoader\n// https://github.com/mrdoob/three.js/blob/398c4f39ebdb8b23eefd4a7a5ec49ec0c96c7462/examples/jsm/loaders/DRACOLoader.js\n// by Don McCurdy / https://www.donmccurdy.com / MIT license\n\nimport {isBrowser, loadLibrary, type LoadLibraryOptions} from '@loaders.gl/worker-utils';\n\nconst DRACO_DECODER_VERSION = '1.5.6';\nconst DRACO_ENCODER_VERSION = '1.4.1';\n\nconst STATIC_DECODER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_DECODER_VERSION}`;\n\nexport const DRACO_EXTERNAL_LIBRARIES = {\n /** The primary Draco3D encoder, javascript wrapper part */\n DECODER: 'draco_wasm_wrapper.js',\n /** The primary draco decoder, compiled web assembly part */\n DECODER_WASM: 'draco_decoder.wasm',\n /** Fallback decoder for non-webassebly environments. Very big bundle, lower performance */\n FALLBACK_DECODER: 'draco_decoder.js',\n /** Draco encoder */\n ENCODER: 'draco_encoder.js'\n};\n\nexport const DRACO_EXTERNAL_LIBRARY_URLS = {\n [DRACO_EXTERNAL_LIBRARIES.DECODER]: `${STATIC_DECODER_URL}/${DRACO_EXTERNAL_LIBRARIES.DECODER}`,\n [DRACO_EXTERNAL_LIBRARIES.DECODER_WASM]: `${STATIC_DECODER_URL}/${DRACO_EXTERNAL_LIBRARIES.DECODER_WASM}`,\n [DRACO_EXTERNAL_LIBRARIES.FALLBACK_DECODER]: `${STATIC_DECODER_URL}/${DRACO_EXTERNAL_LIBRARIES.FALLBACK_DECODER}`,\n [DRACO_EXTERNAL_LIBRARIES.ENCODER]: `https://raw.githubusercontent.com/google/draco/${DRACO_ENCODER_VERSION}/javascript/${DRACO_EXTERNAL_LIBRARIES.ENCODER}`\n};\n\nlet loadDecoderPromise;\nlet loadEncoderPromise;\n\nexport async function loadDracoDecoderModule(\n options: LoadLibraryOptions = {},\n type: 'wasm' | 'js'\n) {\n const modules = options.modules || {};\n\n // Check if a bundled draco3d library has been supplied by application\n if (modules.draco3d) {\n loadDecoderPromise ||= modules.draco3d.createDecoderModule({}).then((draco) => {\n return {draco};\n });\n } else {\n // If not, dynamically load the WASM script from our CDN\n loadDecoderPromise ||= loadDracoDecoder(options, type);\n }\n return await loadDecoderPromise;\n}\n\nexport async function loadDracoEncoderModule(options: LoadLibraryOptions) {\n const modules = options.modules || {};\n\n // Check if a bundled draco3d library has been supplied by application\n if (modules.draco3d) {\n loadEncoderPromise ||= modules.draco3d.createEncoderModule({}).then((draco) => {\n return {draco};\n });\n } else {\n // If not, dynamically load the WASM script from our CDN\n loadEncoderPromise ||= loadDracoEncoder(options);\n }\n return await loadEncoderPromise;\n}\n\nfunction getLibraryExport(library: any, exportName: string): any {\n if (library && typeof library === 'object') {\n if (library.default) {\n return library.default;\n }\n if (library[exportName]) {\n return library[exportName];\n }\n }\n return library;\n}\n\n// DRACO DECODER LOADING\n/** @todo - type the options, they are inconsistent */\nasync function loadDracoDecoder(options: LoadLibraryOptions, type: 'wasm' | 'js') {\n let DracoDecoderModule;\n let wasmBinary;\n switch (type) {\n case 'js':\n DracoDecoderModule = await loadLibrary(\n DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.FALLBACK_DECODER],\n 'draco',\n options,\n DRACO_EXTERNAL_LIBRARIES.FALLBACK_DECODER\n );\n break;\n\n case 'wasm':\n default:\n try {\n [DracoDecoderModule, wasmBinary] = await Promise.all([\n await loadLibrary(\n DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.DECODER],\n 'draco',\n options,\n DRACO_EXTERNAL_LIBRARIES.DECODER\n ),\n await loadLibrary(\n DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.DECODER_WASM],\n 'draco',\n options,\n DRACO_EXTERNAL_LIBRARIES.DECODER_WASM\n )\n ]);\n } catch {\n DracoDecoderModule = null;\n wasmBinary = null;\n }\n }\n DracoDecoderModule = getLibraryExport(DracoDecoderModule, 'DracoDecoderModule');\n // @ts-ignore\n DracoDecoderModule = DracoDecoderModule || globalThis.DracoDecoderModule;\n\n // In Node environments without network access, fall back to local copies in the repo.\n if (!DracoDecoderModule && !isBrowser) {\n [DracoDecoderModule, wasmBinary] = await Promise.all([\n await loadLibrary(\n DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.DECODER],\n 'draco',\n {...options, useLocalLibraries: true},\n DRACO_EXTERNAL_LIBRARIES.DECODER\n ),\n await loadLibrary(\n DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.DECODER_WASM],\n 'draco',\n {...options, useLocalLibraries: true},\n DRACO_EXTERNAL_LIBRARIES.DECODER_WASM\n )\n ]);\n DracoDecoderModule = getLibraryExport(DracoDecoderModule, 'DracoDecoderModule');\n // @ts-ignore\n DracoDecoderModule = DracoDecoderModule || globalThis.DracoDecoderModule;\n }\n\n return await initializeDracoDecoder(DracoDecoderModule, wasmBinary);\n}\n\nfunction initializeDracoDecoder(DracoDecoderModule, wasmBinary) {\n if (typeof DracoDecoderModule !== 'function') {\n throw new Error('DracoDecoderModule could not be loaded');\n }\n\n const options: {wasmBinary?: any} = {};\n if (wasmBinary) {\n options.wasmBinary = wasmBinary;\n }\n\n return new Promise((resolve) => {\n DracoDecoderModule({\n ...options,\n onModuleLoaded: (draco) => resolve({draco}) // Module is Promise-like. Wrap in object to avoid loop.\n });\n });\n}\n\n// ENCODER\n\nasync function loadDracoEncoder(options: LoadLibraryOptions) {\n let DracoEncoderModule = await loadLibrary(\n DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.ENCODER],\n 'draco',\n options,\n DRACO_EXTERNAL_LIBRARIES.ENCODER\n );\n DracoEncoderModule = getLibraryExport(DracoEncoderModule, 'DracoEncoderModule');\n // @ts-ignore\n DracoEncoderModule = DracoEncoderModule || globalThis.DracoEncoderModule;\n\n // In Node environments without network access, fall back to local copies in the repo.\n if (!DracoEncoderModule && !isBrowser) {\n DracoEncoderModule = await loadLibrary(\n DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.ENCODER],\n 'draco',\n {...options, useLocalLibraries: true},\n DRACO_EXTERNAL_LIBRARIES.ENCODER\n );\n DracoEncoderModule = getLibraryExport(DracoEncoderModule, 'DracoEncoderModule');\n // @ts-ignore\n DracoEncoderModule = DracoEncoderModule || globalThis.DracoEncoderModule;\n }\n\n if (typeof DracoEncoderModule !== 'function') {\n throw new Error('DracoEncoderModule could not be loaded');\n }\n\n return new Promise((resolve) => {\n DracoEncoderModule({\n onModuleLoaded: (draco) => resolve({draco}) // Module is Promise-like. Wrap in object to avoid loop.\n });\n });\n}\n", "/* eslint-disable camelcase */\n// This code is inspired by example code in the DRACO repository\nimport type {\n Draco3D,\n DracoInt8Array,\n Encoder,\n Mesh,\n MeshBuilder,\n PointCloud,\n Metadata,\n MetadataBuilder,\n draco_GeometryAttribute_Type\n} from '../draco3d/draco3d-types';\n\nimport type {TypedArray} from '@loaders.gl/schema';\nimport type {DracoMesh} from './draco-types';\n\nexport type DracoBuildOptions = {\n pointcloud?: boolean;\n metadata?: {[key: string]: string};\n attributesMetadata?: {};\n log?: any;\n\n // draco encoding options\n speed?: [number, number];\n method?: string;\n quantization?: {[attributeName: string]: number};\n};\n\n// Native Draco attribute names to GLTF attribute names.\nconst GLTF_TO_DRACO_ATTRIBUTE_NAME_MAP = {\n POSITION: 'POSITION',\n NORMAL: 'NORMAL',\n COLOR_0: 'COLOR',\n TEXCOORD_0: 'TEX_COORD'\n};\n\nconst noop = () => {};\n\nexport default class DracoBuilder {\n draco: Draco3D;\n dracoEncoder: Encoder;\n dracoMeshBuilder: MeshBuilder;\n dracoMetadataBuilder: MetadataBuilder;\n log: any;\n\n // draco - the draco decoder, either import `draco3d` or load dynamically\n constructor(draco: Draco3D) {\n this.draco = draco;\n this.dracoEncoder = new this.draco.Encoder();\n this.dracoMeshBuilder = new this.draco.MeshBuilder();\n this.dracoMetadataBuilder = new this.draco.MetadataBuilder();\n }\n\n destroy(): void {\n this.destroyEncodedObject(this.dracoMeshBuilder);\n this.destroyEncodedObject(this.dracoEncoder);\n this.destroyEncodedObject(this.dracoMetadataBuilder);\n // @ts-ignore\n this.dracoMeshBuilder = null;\n // @ts-ignore\n this.dracoEncoder = null;\n // @ts-ignore\n this.draco = null;\n }\n\n // TBD - when does this need to be called?\n destroyEncodedObject(object): void {\n if (object) {\n this.draco.destroy(object);\n }\n }\n\n /**\n * Encode mesh or point cloud\n * @param mesh =({})\n * @param options\n */\n encodeSync(mesh: DracoMesh, options: DracoBuildOptions = {}): ArrayBuffer {\n this.log = noop; // TODO\n this._setOptions(options);\n\n return options.pointcloud\n ? this._encodePointCloud(mesh, options)\n : this._encodeMesh(mesh, options);\n }\n\n // PRIVATE\n\n _getAttributesFromMesh(mesh: DracoMesh) {\n // TODO - Change the encodePointCloud interface instead?\n const attributes = {...mesh, ...mesh.attributes};\n // Fold indices into the attributes\n if (mesh.indices) {\n attributes.indices = mesh.indices;\n }\n return attributes;\n }\n\n _encodePointCloud(pointcloud: DracoMesh, options: DracoBuildOptions): ArrayBuffer {\n const dracoPointCloud = new this.draco.PointCloud();\n\n if (options.metadata) {\n this._addGeometryMetadata(dracoPointCloud, options.metadata);\n }\n\n const attributes = this._getAttributesFromMesh(pointcloud);\n\n // Build a `DracoPointCloud` from the input data\n this._createDracoPointCloud(dracoPointCloud, attributes, options);\n\n const dracoData = new this.draco.DracoInt8Array();\n\n try {\n const encodedLen = this.dracoEncoder.EncodePointCloudToDracoBuffer(\n dracoPointCloud,\n false,\n dracoData\n );\n\n if (!(encodedLen > 0)) {\n throw new Error('Draco encoding failed.');\n }\n\n this.log(`DRACO encoded ${dracoPointCloud.num_points()} points\n with ${dracoPointCloud.num_attributes()} attributes into ${encodedLen} bytes`);\n\n return dracoInt8ArrayToArrayBuffer(dracoData);\n } finally {\n this.destroyEncodedObject(dracoData);\n this.destroyEncodedObject(dracoPointCloud);\n }\n }\n\n _encodeMesh(mesh: DracoMesh, options: DracoBuildOptions): ArrayBuffer {\n const dracoMesh = new this.draco.Mesh();\n\n if (options.metadata) {\n this._addGeometryMetadata(dracoMesh, options.metadata);\n }\n\n const attributes = this._getAttributesFromMesh(mesh);\n\n // Build a `DracoMesh` from the input data\n this._createDracoMesh(dracoMesh, attributes, options);\n\n const dracoData = new this.draco.DracoInt8Array();\n\n try {\n const encodedLen = this.dracoEncoder.EncodeMeshToDracoBuffer(dracoMesh, dracoData);\n if (encodedLen <= 0) {\n throw new Error('Draco encoding failed.');\n }\n\n this.log(`DRACO encoded ${dracoMesh.num_points()} points\n with ${dracoMesh.num_attributes()} attributes into ${encodedLen} bytes`);\n\n return dracoInt8ArrayToArrayBuffer(dracoData);\n } finally {\n this.destroyEncodedObject(dracoData);\n this.destroyEncodedObject(dracoMesh);\n }\n }\n\n /**\n * Set encoding options.\n * @param {{speed?: any; method?: any; quantization?: any;}} options\n */\n _setOptions(options: DracoBuildOptions): void {\n if ('speed' in options) {\n // @ts-ignore\n this.dracoEncoder.SetSpeedOptions(...options.speed);\n }\n if ('method' in options) {\n const dracoMethod = this.draco[options.method || 'MESH_SEQUENTIAL_ENCODING'];\n // assert(dracoMethod)\n this.dracoEncoder.SetEncodingMethod(dracoMethod);\n }\n if ('quantization' in options) {\n for (const attribute in options.quantization) {\n const bits = options.quantization[attribute];\n const dracoPosition = this.draco[attribute];\n this.dracoEncoder.SetAttributeQuantization(dracoPosition, bits);\n }\n }\n }\n\n /**\n * @param {Mesh} dracoMesh\n * @param {object} attributes\n * @returns {Mesh}\n */\n _createDracoMesh(dracoMesh: Mesh, attributes, options: DracoBuildOptions): Mesh {\n const optionalMetadata = options.attributesMetadata || {};\n\n try {\n const positions = this._getPositionAttribute(attributes);\n if (!positions) {\n throw new Error('positions');\n }\n const vertexCount = positions.length / 3;\n\n for (let attributeName in attributes) {\n const attribute = attributes[attributeName];\n attributeName = GLTF_TO_DRACO_ATTRIBUTE_NAME_MAP[attributeName] || attributeName;\n const uniqueId = this._addAttributeToMesh(dracoMesh, attributeName, attribute, vertexCount);\n\n if (uniqueId !== -1) {\n this._addAttributeMetadata(dracoMesh, uniqueId, {\n name: attributeName,\n ...(optionalMetadata[attributeName] || {})\n });\n }\n }\n } catch (error) {\n this.destroyEncodedObject(dracoMesh);\n throw error;\n }\n\n return dracoMesh;\n }\n\n /**\n * @param {} dracoPointCloud\n * @param {object} attributes\n */\n _createDracoPointCloud(\n dracoPointCloud: PointCloud,\n attributes: object,\n options: DracoBuildOptions\n ): PointCloud {\n const optionalMetadata = options.attributesMetadata || {};\n\n try {\n const positions = this._getPositionAttribute(attributes);\n if (!positions) {\n throw new Error('positions');\n }\n const vertexCount = positions.length / 3;\n\n for (let attributeName in attributes) {\n const attribute = attributes[attributeName];\n attributeName = GLTF_TO_DRACO_ATTRIBUTE_NAME_MAP[attributeName] || attributeName;\n const uniqueId = this._addAttributeToMesh(\n dracoPointCloud,\n attributeName,\n attribute,\n vertexCount\n );\n if (uniqueId !== -1) {\n this._addAttributeMetadata(dracoPointCloud, uniqueId, {\n name: attributeName,\n ...(optionalMetadata[attributeName] || {})\n });\n }\n }\n } catch (error) {\n this.destroyEncodedObject(dracoPointCloud);\n throw error;\n }\n\n return dracoPointCloud;\n }\n\n /**\n * @param mesh\n * @param attributeName\n * @param attribute\n * @param vertexCount\n */\n _addAttributeToMesh(\n mesh: PointCloud,\n attributeName: string,\n attribute: TypedArray,\n vertexCount: number\n ): number {\n if (!ArrayBuffer.isView(attribute)) {\n return -1;\n }\n\n const type = this._getDracoAttributeType(attributeName);\n // @ts-ignore TODO/fix types\n const size = attribute.length / vertexCount;\n\n if (type === 'indices') {\n // @ts-ignore TODO/fix types\n const numFaces = attribute.length / 3;\n this.log(`Adding attribute ${attributeName}, size ${numFaces}`);\n\n // @ts-ignore assumes mesh is a Mesh, not a point cloud\n this.dracoMeshBuilder.AddFacesToMesh(mesh, numFaces, attribute);\n return -1;\n }\n\n this.log(`Adding attribute ${attributeName}, size ${size}`);\n\n const builder = this.dracoMeshBuilder;\n const {buffer} = attribute;\n\n switch (attribute.constructor) {\n case Int8Array:\n return builder.AddInt8Attribute(mesh, type, vertexCount, size, new Int8Array(buffer));\n\n case Int16Array:\n return builder.AddInt16Attribute(mesh, type, vertexCount, size, new Int16Array(buffer));\n\n case Int32Array:\n return builder.AddInt32Attribute(mesh, type, vertexCount, size, new Int32Array(buffer));\n case Uint8Array:\n case Uint8ClampedArray:\n return builder.AddUInt8Attribute(mesh, type, vertexCount, size, new Uint8Array(buffer));\n\n case Uint16Array:\n return builder.AddUInt16Attribute(mesh, type, vertexCount, size, new Uint16Array(buffer));\n\n case Uint32Array:\n return builder.AddUInt32Attribute(mesh, type, vertexCount, size, new Uint32Array(buffer));\n\n case Float32Array:\n return builder.AddFloatAttribute(mesh, type, vertexCount, size, new Float32Array(buffer));\n\n default:\n // eslint-disable-next-line no-console\n console.warn('Unsupported attribute type', attribute);\n return -1;\n }\n\n // case Float64Array:\n // Add attribute does not seem to be exposed\n // return builder.AddAttribute(mesh, type, vertexCount, size, new Float32Array(buffer));\n }\n\n /**\n * DRACO can compress attributes of know type better\n * TODO - expose an attribute type map?\n * @param attributeName\n */\n _getDracoAttributeType(attributeName: string): draco_GeometryAttribute_Type | 'indices' {\n switch (attributeName.toLowerCase()) {\n case 'indices':\n return 'indices';\n case 'position':\n case 'positions':\n case 'vertices':\n return this.draco.POSITION;\n case 'normal':\n case 'normals':\n return this.draco.NORMAL;\n case 'color':\n case 'colors':\n return this.draco.COLOR;\n case 'texcoord':\n case 'texcoords':\n return this.draco.TEX_COORD;\n default:\n return this.draco.GENERIC;\n }\n }\n\n _getPositionAttribute(attributes) {\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n const dracoType = this._getDracoAttributeType(attributeName);\n if (dracoType === this.draco.POSITION) {\n return attribute;\n }\n }\n return null;\n }\n\n /**\n * Add metadata for the geometry.\n * @param dracoGeometry - WASM Draco Object\n * @param metadata\n */\n _addGeometryMetadata(dracoGeometry: PointCloud, metadata: {[key: string]: string}) {\n const dracoMetadata = new this.draco.Metadata();\n this._populateDracoMetadata(dracoMetadata, metadata);\n this.dracoMeshBuilder.AddMetadata(dracoGeometry, dracoMetadata);\n }\n\n /**\n * Add metadata for an attribute to geometry.\n * @param dracoGeometry - WASM Draco Object\n * @param uniqueAttributeId\n * @param metadata\n */\n _addAttributeMetadata(\n dracoGeometry: PointCloud,\n uniqueAttributeId: number,\n metadata: Map<string, string> | {[key: string]: string}\n ) {\n // Note: Draco JS IDL doesn't seem to expose draco.AttributeMetadata, however it seems to\n // create such objects automatically from draco.Metadata object.\n const dracoAttributeMetadata = new this.draco.Metadata();\n this._populateDracoMetadata(dracoAttributeMetadata, metadata);\n // Draco3d doc note: Directly add attribute metadata to geometry.\n // You can do this without explicitly adding |GeometryMetadata| to mesh.\n this.dracoMeshBuilder.SetMetadataForAttribute(\n dracoGeometry,\n uniqueAttributeId,\n dracoAttributeMetadata\n );\n }\n\n /**\n * Add contents of object or map to a WASM Draco Metadata Object\n * @param dracoMetadata - WASM Draco Object\n * @param metadata\n */\n _populateDracoMetadata(\n dracoMetadata: Metadata,\n metadata: Map<string, string> | {[key: string]: string}\n ) {\n for (const [key, value] of getEntries(metadata)) {\n switch (typeof value) {\n case 'number':\n if (Math.trunc(value) === value) {\n this.dracoMetadataBuilder.AddIntEntry(dracoMetadata, key, value);\n } else {\n this.dracoMetadataBuilder.AddDoubleEntry(dracoMetadata, key, value);\n }\n break;\n case 'object':\n if (value instanceof Int32Array) {\n this.dracoMetadataBuilder.AddIntEntryArray(dracoMetadata, key, value, value.length);\n }\n break;\n case 'string':\n default:\n this.dracoMetadataBuilder.AddStringEntry(dracoMetadata, key, value);\n }\n }\n }\n}\n\n// HELPER FUNCTIONS\n\n/**\n * Copy encoded data to buffer\n * @param dracoData\n */\nfunction dracoInt8ArrayToArrayBuffer(dracoData: DracoInt8Array) {\n const byteLength = dracoData.size();\n const outputBuffer = new ArrayBuffer(byteLength);\n const outputData = new Int8Array(outputBuffer);\n for (let i = 0; i < byteLength; ++i) {\n outputData[i] = dracoData.GetValue(i);\n }\n return outputBuffer;\n}\n\n/** Enable iteration over either an object or a map */\nfunction getEntries(container) {\n const hasEntriesFunc = container.entries && !container.hasOwnProperty('entries');\n return hasEntriesFunc ? container.entries() : Object.entries(container);\n}\n", "// Version constant cannot be imported, it needs to correspond to the build version of **this** module.\n// __VERSION__ is injected by babel-plugin-version-inline\n// @ts-ignore TS2304: Cannot find name '__VERSION__'.\nexport const VERSION = typeof __VERSION__ !== 'undefined' ? __VERSION__ : 'latest';\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {WriterWithEncoder, WriterOptions} from '@loaders.gl/loader-utils';\nimport type {DracoMesh} from './lib/draco-types';\nimport type {DracoBuildOptions} from './lib/draco-builder';\nimport DRACOBuilder from './lib/draco-builder';\nimport {loadDracoEncoderModule} from './lib/draco-module-loader';\nimport {VERSION} from './lib/utils/version';\n\n/** Writer Options for draco */\nexport type DracoWriterOptions = WriterOptions & {\n draco?: DracoBuildOptions & {\n method?: 'MESH_EDGEBREAKER_ENCODING' | 'MESH_SEQUENTIAL_ENCODING';\n speed?: [number, number];\n quantization?: Record<string, number>;\n attributeNameEntry?: string;\n };\n};\n\nconst DEFAULT_DRACO_WRITER_OPTIONS = {\n pointcloud: false, // Set to true if pointcloud (mode: 0, no indices)\n attributeNameEntry: 'name'\n // Draco Compression Parameters\n // method: 'MESH_EDGEBREAKER_ENCODING', // Use draco defaults\n // speed: [5, 5], // Use draco defaults\n // quantization: { // Use draco defaults\n // POSITION: 10\n // }\n};\n\n/**\n * Browser worker doesn't work because of issue during \"draco_encoder.js\" loading.\n * Refused to execute script from 'https://raw.githubusercontent.com/google/draco/1.4.1/javascript/draco_encoder.js' because its MIME type ('') is not executable.\n */\nexport const DracoWriterWorker = {\n id: 'draco-writer',\n name: 'Draco compressed geometry writer',\n module: 'draco',\n version: VERSION,\n worker: true,\n options: {\n draco: {},\n source: null\n }\n};\n\n/**\n * Exporter for Draco3D compressed geometries\n */\nexport const DracoWriter = {\n name: 'DRACO',\n id: 'draco',\n module: 'draco',\n version: VERSION,\n extensions: ['drc'],\n mimeTypes: ['application/octet-stream'],\n options: {\n draco: DEFAULT_DRACO_WRITER_OPTIONS\n },\n encode\n} as const satisfies WriterWithEncoder<DracoMesh, unknown, DracoWriterOptions>;\n\nasync function encode(data: DracoMesh, options: DracoWriterOptions = {}): Promise<ArrayBuffer> {\n // Dynamically load draco\n const {draco} = await loadDracoEncoderModule(options.core || {});\n const dracoBuilder = new DRACOBuilder(draco);\n\n try {\n return dracoBuilder.encodeSync(data, options.draco);\n } finally {\n dracoBuilder.destroy();\n }\n}\n", "/* eslint-disable camelcase */\n\nimport type {TypedArray, MeshAttribute, MeshGeometry} from '@loaders.gl/schema';\n\n// Draco types (input)\nimport type {\n Draco3D,\n Decoder,\n Mesh,\n PointCloud,\n PointAttribute,\n Metadata,\n MetadataQuerier,\n DracoInt32Array,\n draco_DataType\n} from '../draco3d/draco3d-types';\n\n// Parsed data types (output)\nimport type {\n DracoMesh,\n DracoLoaderData,\n DracoAttribute,\n DracoMetadataEntry,\n DracoQuantizationTransform,\n DracoOctahedronTransform\n} from './draco-types';\n\nimport {getMeshBoundingBox} from '@loaders.gl/schema-utils';\nimport {getDracoSchema} from './utils/get-draco-schema';\n\n/** Options to control draco parsing */\nexport type DracoParseOptions = {\n /** How triangle indices should be generated (mesh only) */\n topology?: 'triangle-list' | 'triangle-strip';\n /** Specify which attribute metadata entry stores the attribute name */\n attributeNameEntry?: string;\n /** Names and ids of extra attributes to include in the output */\n extraAttributes?: {[uniqueId: string]: number};\n /** Skip transforms specific quantized attributes */\n quantizedAttributes?: ('POSITION' | 'NORMAL' | 'COLOR' | 'TEX_COORD' | 'GENERIC')[];\n /** Skip transforms specific octahedron encoded attributes */\n octahedronAttributes?: ('POSITION' | 'NORMAL' | 'COLOR' | 'TEX_COORD' | 'GENERIC')[];\n};\n\n// @ts-ignore\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nconst GEOMETRY_TYPE = {\n TRIANGULAR_MESH: 0,\n POINT_CLOUD: 1\n};\n\n// Native Draco attribute names to GLTF attribute names.\nconst DRACO_TO_GLTF_ATTRIBUTE_NAME_MAP = {\n POSITION: 'POSITION',\n NORMAL: 'NORMAL',\n COLOR: 'COLOR_0',\n TEX_COORD: 'TEXCOORD_0'\n};\n\nconst DRACO_DATA_TYPE_TO_TYPED_ARRAY_MAP = {\n 1: Int8Array,\n 2: Uint8Array,\n 3: Int16Array,\n 4: Uint16Array,\n 5: Int32Array,\n 6: Uint32Array,\n // 7: BigInt64Array,\n // 8: BigUint64Array,\n 9: Float32Array\n // 10: Float64Array\n // 11: BOOL - What array type do we use for this?\n};\n\nconst INDEX_ITEM_SIZE = 4;\n\nexport default class DracoParser {\n draco: Draco3D;\n decoder: Decoder;\n metadataQuerier: MetadataQuerier;\n\n // draco - the draco decoder, either import `draco3d` or load dynamically\n constructor(draco: Draco3D) {\n this.draco = draco;\n this.decoder = new this.draco.Decoder();\n this.metadataQuerier = new this.draco.MetadataQuerier();\n }\n\n /**\n * Destroy draco resources\n */\n destroy(): void {\n this.draco.destroy(this.decoder);\n this.draco.destroy(this.metadataQuerier);\n }\n\n /**\n * NOTE: caller must call `destroyGeometry` on the return value after using it\n * @param arrayBuffer\n * @param options\n */\n parseSync(arrayBuffer: ArrayBuffer, options: DracoParseOptions = {}): DracoMesh {\n const buffer = new this.draco.DecoderBuffer();\n buffer.Init(new Int8Array(arrayBuffer), arrayBuffer.byteLength);\n\n this._disableAttributeTransforms(options);\n\n const geometry_type = this.decoder.GetEncodedGeometryType(buffer);\n const dracoGeometry =\n geometry_type === this.draco.TRIANGULAR_MESH\n ? new this.draco.Mesh()\n : new this.draco.PointCloud();\n\n try {\n let dracoStatus;\n switch (geometry_type) {\n case this.draco.TRIANGULAR_MESH:\n dracoStatus = this.decoder.DecodeBufferToMesh(buffer, dracoGeometry as Mesh);\n break;\n\n case this.draco.POINT_CLOUD:\n dracoStatus = this.decoder.DecodeBufferToPointCloud(buffer, dracoGeometry);\n break;\n\n default:\n throw new Error('DRACO: Unknown geometry type.');\n }\n\n if (!dracoStatus.ok() || !dracoGeometry.ptr) {\n const message = `DRACO decompression failed: ${dracoStatus.error_msg()}`;\n // console.error(message);\n throw new Error(message);\n }\n\n const loaderData = this._getDracoLoaderData(dracoGeometry, geometry_type, options);\n\n const geometry = this._getMeshData(dracoGeometry, loaderData, options);\n\n const boundingBox = getMeshBoundingBox(geometry.attributes);\n\n const schema = getDracoSchema(geometry.attributes, loaderData, geometry.indices);\n\n const data: DracoMesh = {\n loader: 'draco',\n loaderData,\n header: {\n vertexCount: dracoGeometry.num_points(),\n boundingBox\n },\n ...geometry,\n schema\n };\n return data;\n } finally {\n this.draco.destroy(buffer);\n if (dracoGeometry) {\n this.draco.destroy(dracoGeometry);\n }\n }\n }\n\n // Draco specific \"loader data\"\n\n /**\n * Extract\n * @param dracoGeometry\n * @param geometry_type\n * @param options\n * @returns\n */\n _getDracoLoaderData(\n dracoGeometry: Mesh | PointCloud,\n geometry_type,\n options: DracoParseOptions\n ): DracoLoaderData {\n const metadata = this._getTopLevelMetadata(dracoGeometry);\n const attributes = this._getDracoAttributes(dracoGeometry, options);\n\n return {\n geometry_type,\n num_attributes: dracoGeometry.num_attributes(),\n num_points: dracoGeometry.num_points(),\n num_faces: dracoGeometry instanceof this.draco.Mesh ? dracoGeometry.num_faces() : 0,\n metadata,\n attributes\n };\n }\n\n /**\n * Extract all draco provided information and metadata for each attribute\n * @param dracoGeometry\n * @param options\n * @returns\n */\n _getDracoAttributes(\n dracoGeometry: Mesh | PointCloud,\n options: DracoParseOptions\n ): {[unique_id: number]: DracoAttribute} {\n const dracoAttributes: {[unique_id: number]: DracoAttribute} = {};\n\n for (let attributeId = 0; attributeId < dracoGeometry.num_attributes(); attributeId++) {\n // Note: Draco docs do not seem clear on `GetAttribute` ids just being a zero-based index,\n // but it does seems to work this way\n const dracoAttribute = this.decoder.GetAttribute(dracoGeometry, attributeId);\n\n const metadata = this._getAttributeMetadata(dracoGeometry, attributeId);\n\n dracoAttributes[dracoAttribute.unique_id()] = {\n unique_id: dracoAttribute.unique_id(),\n attribute_type: dracoAttribute.attribute_type(),\n data_type: dracoAttribute.data_type(),\n num_components: dracoAttribute.num_components(),\n\n byte_offset: dracoAttribute.byte_offset(),\n byte_stride: dracoAttribute.byte_stride(),\n normalized: dracoAttribute.normalized(),\n attribute_index: attributeId,\n\n metadata\n };\n\n // Add transformation parameters for any attributes app wants untransformed\n const quantization = this._getQuantizationTransform(dracoAttribute, options);\n if (quantization) {\n dracoAttributes[dracoAttribute.unique_id()].quantization_transform = quantization;\n }\n\n const octahedron = this._getOctahedronTransform(dracoAttribute, options);\n if (octahedron) {\n dracoAttributes[dracoAttribute.unique_id()].octahedron_transform = octahedron;\n }\n }\n\n return dracoAttributes;\n }\n\n /**\n * Get standard loaders.gl mesh category data\n * Extracts the geometry from draco\n * @param dracoGeometry\n * @param options\n */\n _getMeshData(\n dracoGeometry: Mesh | PointCloud,\n loaderData: DracoLoaderData,\n options: DracoParseOptions\n ): MeshGeometry {\n const attributes = this._getMeshAttributes(loaderData, dracoGeometry, options);\n\n const positionAttribute = attributes.POSITION;\n if (!positionAttribute) {\n throw new Error('DRACO: No position attribute found.');\n }\n\n // For meshes, we need indices to define the faces.\n if (dracoGeometry instanceof this.draco.Mesh) {\n switch (options.topology) {\n case 'triangle-strip':\n return {\n topology: 'triangle-strip',\n // TODO - mode is wrong?\n mode: 4, // GL.TRIANGLES\n attributes,\n indices: {\n value: this._getTriangleStripIndices(dracoGeometry),\n size: 1\n }\n };\n case 'triangle-list':\n default:\n return {\n topology: 'triangle-list',\n // TODO - mode is wrong?\n mode: 5, // GL.TRIANGLE_STRIP\n attributes,\n indices: {\n value: this._getTriangleListIndices(dracoGeometry),\n size: 1\n }\n };\n }\n }\n\n // PointCloud - must come last as Mesh inherits from PointCloud\n return {\n topology: 'point-list',\n mode: 0, // GL.POINTS\n attributes\n };\n }\n\n _getMeshAttributes(\n loaderData: DracoLoaderData,\n dracoGeometry: Mesh | PointCloud,\n options: DracoParseOptions\n ): {[attributeName: string]: MeshAttribute} {\n const attributes: {[key: string]: MeshAttribute} = {};\n\n for (const loaderAttribute of Object.values(loaderData.attributes)) {\n const attributeName = this._deduceAttributeName(loaderAttribute, options);\n loaderAttribute.name = attributeName;\n const values = this._getAttributeValues(dracoGeometry, loaderAttribute);\n if (values) {\n const {value, size} = values;\n attributes[attributeName] = {\n value,\n size,\n byteOffset: loaderAttribute.byte_offset,\n byteStride: loaderAttribute.byte_stride,\n normalized: loaderAttribute.normalized\n };\n }\n }\n\n return attributes;\n }\n\n // MESH INDICES EXTRACTION\n\n /**\n * For meshes, we need indices to define the faces.\n * @param dracoGeometry\n */\n _getTriangleListIndices(dracoGeometry: Mesh) {\n // Example on how to retrieve mesh and attributes.\n const numFaces = dracoGeometry.num_faces();\n const numIndices = numFaces * 3;\n const byteLength = numIndices * INDEX_ITEM_SIZE;\n\n const ptr = this.draco._malloc(byteLength);\n try {\n this.decoder.GetTrianglesUInt32Array(dracoGeometry, byteLength, ptr);\n return new Uint32Array(this.draco.HEAPF32.buffer, ptr, numIndices).slice();\n } finally {\n this.draco._free(ptr);\n }\n }\n\n /**\n * For meshes, we need indices to define the faces.\n * @param dracoGeometry\n */\n _getTriangleStripIndices(dracoGeometry: Mesh) {\n const dracoArray = new this.draco.DracoInt32Array();\n try {\n /* const numStrips = */ this.decoder.GetTriangleStripsFromMesh(dracoGeometry, dracoArray);\n return getUint32Array(dracoArray);\n } finally {\n this.draco.destroy(dracoArray);\n }\n }\n\n /**\n *\n * @param dracoGeometry\n * @param dracoAttribute\n * @param attributeName\n */\n _getAttributeValues(\n dracoGeometry: Mesh | PointCloud,\n attribute: DracoAttribute\n ): {value: TypedArray; size: number} | null {\n const TypedArrayCtor = DRACO_DATA_TYPE_TO_TYPED_ARRAY_MAP[attribute.data_type];\n if (!TypedArrayCtor) {\n // eslint-disable-next-line no-console\n console.warn(`DRACO: Unsupported attribute type ${attribute.data_type}`);\n return null;\n }\n const numComponents = attribute.num_components;\n const numPoints = dracoGeometry.num_points();\n const numValues = numPoints * numComponents;\n\n const byteLength = numValues * TypedArrayCtor.BYTES_PER_ELEMENT;\n const dataType = getDracoDataType(this.draco, TypedArrayCtor);\n\n let value: TypedArray;\n\n const ptr = this.draco._malloc(byteLength);\n try {\n const dracoAttribute = this.decoder.GetAttribute(dracoGeometry, attribute.attribute_index);\n this.decoder.GetAttributeDataArrayForAllPoints(\n dracoGeometry,\n dracoAttribute,\n dataType,\n byteLength,\n ptr\n );\n value = new TypedArrayCtor(this.draco.HEAPF32.buffer, ptr, numValues).slice();\n } finally {\n this.draco._free(ptr);\n }\n\n return {value, size: numComponents};\n }\n\n // Attribute names\n\n /** \n * DRACO does not store attribute names - We need to deduce an attribute name\n * for each attribute\n _getAttributeNames(\n dracoGeometry: Mesh | PointCloud,\n options: DracoParseOptions\n ): {[unique_id: number]: string} {\n const attributeNames: {[unique_id: number]: string} = {};\n for (let attributeId = 0; attributeId < dracoGeometry.num_attributes(); attributeId++) {\n const dracoAttribute = this.decoder.GetAttribute(dracoGeometry, attributeId);\n const attributeName = this._deduceAttributeName(dracoAttribute, options);\n attributeNames[attributeName] = attributeName;\n }\n return attributeNames;\n }\n */\n\n /**\n * Deduce an attribute name.\n * @note DRACO does not save attribute names, just general type (POSITION, COLOR)\n * to help optimize compression. We generate GLTF compatible names for the Draco-recognized\n * types\n * @param attributeData\n */\n _deduceAttributeName(attribute: DracoAttribute, options: DracoParseOptions): string {\n // Deduce name based on application provided map\n const uniqueId = attribute.unique_id;\n for (const [attributeName, attributeUniqueId] of Object.entries(\n options.extraAttributes || {}\n )) {\n if (attributeUniqueId === uniqueId) {\n return attributeName;\n }\n }\n\n // Deduce name based on attribute type\n const thisAttributeType = attribute.attribute_type;\n for (const dracoAttributeConstant in DRACO_TO_GLTF_ATTRIBUTE_NAME_MAP) {\n const attributeType = this.draco[dracoAttributeConstant];\n if (attributeType === thisAttributeType) {\n // TODO - Return unique names if there multiple attributes per type\n // (e.g. multiple TEX_COORDS or COLORS)\n return DRACO_TO_GLTF_ATTRIBUTE_NAME_MAP[dracoAttributeConstant];\n }\n }\n\n // Look up in metadata\n // TODO - shouldn't this have priority?\n const entryName = options.attributeNameEntry || 'name';\n if (attribute.metadata[entryName]) {\n return attribute.metadata[entryName].string;\n }\n\n // Attribute of \"GENERIC\" type, we need to assign some name\n return `CUSTOM_ATTRIBUTE_${uniqueId}`;\n }\n\n // METADATA EXTRACTION\n\n /** Get top level metadata */\n _getTopLevelMetadata(dracoGeometry: Mesh | PointCloud) {\n const dracoMetadata = this.decoder.GetMetadata(dracoGeometry);\n return this._getDracoMetadata(dracoMetadata);\n }\n\n /** Get per attribute metadata */\n _getAttributeMetadata(dracoGeometry: Mesh | PointCloud, attributeId: number) {\n const dracoMetadata = this.decoder.GetAttributeMetadata(dracoGeometry, attributeId);\n return this._getDracoMetadata(dracoMetadata);\n }\n\n /**\n * Extract metadata field values\n * @param dracoMetadata\n * @returns\n */\n _getDracoMetadata(dracoMetadata: Metadata): {[entry: string]: DracoMetadataEntry} {\n // The not so wonderful world of undocumented Draco APIs :(\n if (!dracoMetadata || !dracoMetadata.ptr) {\n return {};\n }\n const result = {};\n const numEntries = this.metadataQuerier.NumEntries(dracoMetadata);\n for (let entryIndex = 0; entryIndex < numEntries; entryIndex++) {\n const entryName = this.metadataQuerier.GetEntryName(dracoMetadata, entryIndex);\n result[entryName] = this._getDracoMetadataField(dracoMetadata, entryName);\n }\n return result;\n }\n\n /**\n * Extracts possible values for one metadata entry by name\n * @param dracoMetadata\n * @param entryName\n */\n _getDracoMetadataField(dracoMetadata: Metadata, entryName: string): DracoMetadataEntry {\n const dracoArray = new this.draco.DracoInt32Array();\n try {\n // Draco metadata fields can hold int32 arrays\n this.metadataQuerier.GetIntEntryArray(dracoMetadata, entryName, dracoArray);\n const intArray = getInt32Array(dracoArray);\n return {\n int: this.metadataQuerier.GetIntEntry(dracoMetadata, entryName),\n string: this.metadataQuerier.GetStringEntry(dracoMetadata, entryName),\n double: this.metadataQuerier.GetDoubleEntry(dracoMetadata, entryName),\n intArray\n };\n } finally {\n this.draco.destroy(dracoArray);\n }\n }\n\n // QUANTIZED ATTRIBUTE SUPPORT (NO DECOMPRESSION)\n\n /** Skip transforms for specific attribute types */\n _disableAttributeTransforms(options: DracoParseOptions) {\n const {quantizedAttributes = [], octahedronAttributes = []} = options;\n const skipAttributes = [...quantizedAttributes, ...octahedronAttributes];\n for (const dracoAttributeName of skipAttributes) {\n this.decoder.SkipAttributeTransform(this.draco[dracoAttributeName]);\n }\n }\n\n /**\n * Extract (and apply?) Position Transform\n * @todo not used\n */\n _getQuantizationTransform(\n dracoAttribute: PointAttribute,\n options: DracoParseOptions\n ): DracoQuantizationTransform | null {\n const {quantizedAttributes = []} = options;\n const attribute_type = dracoAttribute.attribute_type();\n const skip = quantizedAttributes.map((type) => this.decoder[type]).includes(attribute_type);\n if (skip) {\n const transform = new this.draco.AttributeQuantizationTransform();\n try {\n if (transform.InitFromAttribute(dracoAttribute)) {\n return {\n quantization_bits: transform.quantization_bits(),\n range: transform.range(),\n min_values: new Float32Array([1, 2, 3]).map((i) => transform.min_value(i))\n };\n }\n } finally {\n this.draco.destroy(transform);\n }\n }\n return null;\n }\n\n _getOctahedronTransform(\n dracoAttribute: PointAttribute,\n options: DracoParseOptions\n ): DracoOctahedronTransform | null {\n const {octahedronAttributes = []} = options;\n const attribute_type = dracoAttribute.attribute_type();\n const octahedron = octahedronAttributes\n .map((type) => this.decoder[type])\n .includes(attribute_type);\n if (octahedron) {\n const transform = new this.draco.AttributeQuantizationTransform();\n try {\n if (transform.InitFromAttribute(dracoAttribute)) {\n return {\n quantization_bits: transform.quantization_bits()\n };\n }\n } finally {\n this.draco.destroy(transform);\n }\n }\n return null;\n }\n\n // HELPERS\n}\n\n/**\n * Get draco specific data type by TypedArray constructor type\n * @param attributeType\n * @returns draco specific data type\n */\nfunction getDracoDataType(draco: Draco3D, attributeType: any): draco_DataType {\n switch (attributeType) {\n case Float32Array:\n return draco.DT_FLOAT32;\n case Int8Array:\n return draco.DT_INT8;\n case Int16Array:\n return draco.DT_INT16;\n case Int32Array:\n return draco.DT_INT32;\n case Uint8Array:\n return draco.DT_UINT8;\n case Uint16Array:\n return draco.DT_UINT16;\n case Uint32Array:\n return draco.DT_UINT32;\n default:\n return draco.DT_INVALID;\n }\n}\n\n/**\n * Copy a Draco int32 array into a JS typed array\n */\nfunction getInt32Array(dracoArray: DracoInt32Array): Int32Array {\n const numValues = dracoArray.size();\n const intArray = new Int32Array(numValues);\n for (let i = 0; i < numValues; i++) {\n intArray[i] = dracoArray.GetValue(i);\n }\n return intArray;\n}\n\n/**\n * Copy a Draco int32 array into a JS typed array\n */\nfunction getUint32Array(dracoArray: DracoInt32Array): Int32Array {\n const numValues = dracoArray.size();\n const intArray = new Int32Array(numValues);\n for (let i = 0; i < numValues; i++) {\n intArray[i] = dracoArray.GetValue(i);\n }\n return intArray;\n}\n", "import {MeshAttribute, Schema, Field} from '@loaders.gl/schema';\nimport {deduceMeshField} from '@loaders.gl/schema-utils';\nimport type {DracoAttribute, DracoLoaderData, DracoMetadataEntry} from '../draco-types';\n\n/** Extract an arrow-like schema from a Draco mesh */\nexport function getDracoSchema(\n attributes: {[attributeName: string]: MeshAttribute},\n loaderData: DracoLoaderData,\n indices?: MeshAttribute\n): Schema {\n const metadata = makeMetadata(loaderData.metadata);\n const fields: Field[] = [];\n const namedLoaderDataAttributes = transformAttributesLoaderData(loaderData.attributes);\n for (const attributeName in attributes) {\n const attribute = attributes[attributeName];\n const field = getArrowFieldFromAttribute(\n attributeName,\n attribute,\n namedLoaderDataAttributes[attributeName]\n );\n fields.push(field);\n }\n if (indices) {\n const indicesField = getArrowFieldFromAttribute('indices', indices);\n fields.push(indicesField);\n }\n return {fields, metadata};\n}\n\nfunction transformAttributesLoaderData(loaderData: {[key: number]: DracoAttribute}): {\n [attributeName: string]: DracoAttribute;\n} {\n const result: {[attributeName: string]: DracoAttribute} = {};\n for (const key in loaderData) {\n const dracoAttribute = loaderData[key];\n result[dracoAttribute.name || 'undefined'] = dracoAttribute;\n }\n return result;\n}\n\nfunction getArrowFieldFromAttribute(\n attributeName: string,\n attribute: MeshAttribute,\n loaderData?: DracoAttribute\n): Field {\n const metadataMap = loaderData ? makeMetadata(loaderData.metadata) : undefined;\n const field = deduceMeshField(attributeName, attribute, metadataMap);\n return field;\n}\n\nfunction makeMetadata(metadata: {[key: string]: DracoMetadataEntry}): Record<string, string> {\n Object.entries(metadata);\n const serializedMetadata: Record<string, string> = {};\n for (const key in metadata) {\n serializedMetadata[`${key}.string`] = JSON.stringify(metadata[key]);\n }\n return serializedMetadata;\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {Loader, LoaderWithParser, StrictLoaderOptions} from '@loaders.gl/loader-utils';\nimport type {DracoMesh} from './lib/draco-types';\nimport type {DracoParseOptions} from './lib/draco-parser';\nimport {VERSION} from './lib/utils/version';\nimport DracoParser from './lib/draco-parser';\nimport {loadDracoDecoderModule} from './lib/draco-module-loader';\n\nexport type DracoLoaderOptions = StrictLoaderOptions & {\n draco?: DracoParseOptions & {\n /** @deprecated WASM decoding is faster but JS is more backwards compatible */\n decoderType?: 'wasm' | 'js';\n /** @deprecated Specify where to load the Draco decoder library */\n libraryPath?: string;\n /** Override the URL to the worker bundle (by default loads from unpkg.com) */\n workerUrl?: string;\n };\n};\n\n/**\n * Worker loader for Draco3D compressed geometries\n */\nexport const DracoWorkerLoader = {\n dataType: null as unknown as DracoMesh,\n batchType: null as never,\n name: 'Draco',\n id: 'draco',\n module: 'draco',\n // shapes: ['mesh'],\n version: VERSION,\n worker: true,\n extensions: ['drc'],\n mimeTypes: ['application/octet-stream'],\n binary: true,\n tests: ['DRACO'],\n options: {\n draco: {\n decoderType: typeof WebAssembly === 'object' ? 'wasm' : 'js', // 'js' for IE11\n libraryPath: 'libs/',\n extraAttributes: {},\n attributeNameEntry: undefined\n }\n }\n} as const satisfies Loader<DracoMesh, never, DracoLoaderOptions>;\n\n/**\n * Loader for Draco3D compressed geometries\n */\nexport const DracoLoader = {\n ...DracoWorkerLoader,\n parse\n} as const satisfies LoaderWithParser<DracoMesh, never, DracoLoaderOptions>;\n\nasync function parse(arrayBuffer: ArrayBuffer, options?: DracoLoaderOptions): Promise<DracoMesh> {\n const {draco} = await loadDracoDecoderModule(\n options?.core,\n options?.draco?.decoderType || 'wasm'\n );\n const dracoParser = new DracoParser(draco);\n try {\n return dracoParser.parseSync(arrayBuffer, options?.draco);\n } finally {\n dracoParser.destroy();\n }\n}\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {ArrowTable} from '@loaders.gl/schema';\nimport type {LoaderWithParser} from '@loaders.gl/loader-utils';\nimport type {DracoLoaderOptions} from './draco-loader';\nimport {DracoLoader} from './draco-loader';\nimport {convertMeshToTable} from '@loaders.gl/schema-utils';\n\n/**\n * Loader for Draco3D compressed geometries\n */\nexport const DracoArrowLoader = {\n ...DracoLoader,\n dataType: null as unknown as ArrowTable,\n worker: false,\n parse\n} as const satisfies LoaderWithParser<ArrowTable, never, DracoLoaderOptions>;\n\nasync function parse(arrayBuffer: ArrayBuffer, options?: DracoLoaderOptions): Promise<ArrowTable> {\n const mesh = await DracoLoader.parse(arrayBuffer, options);\n const arrowTable = convertMeshToTable(mesh, 'arrow-table');\n return arrowTable;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;ACIA,0BAA8D;AAE9D,IAAM,wBAAwB;AAC9B,IAAM,wBAAwB;AAE9B,IAAM,qBAAqB,oDAAoD;AAExE,IAAM,2BAA2B;;EAEtC,SAAS;;EAET,cAAc;;EAEd,kBAAkB;;EAElB,SAAS;;AAGJ,IAAM,8BAA8B;EACzC,CAAC,yBAAyB,OAAO,GAAG,GAAG,sBAAsB,yBAAyB;EACtF,CAAC,yBAAyB,YAAY,GAAG,GAAG,sBAAsB,yBAAyB;EAC3F,CAAC,yBAAyB,gBAAgB,GAAG,GAAG,sBAAsB,yBAAyB;EAC/F,CAAC,yBAAyB,OAAO,GAAG,kDAAkD,oCAAoC,yBAAyB;;AAGrJ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,WAAW,SAAS,CAAC;EACrC;AACA,SAAO;AACT;AAKA,SAAS,eAAe,YAA2B;AACjD,QAAM,YAAY,WAAW,KAAI;AACjC,QAAM,WAAW,IAAI,WAAW,SAAS;AACzC,WAAS,IAAI,GAAG,IAAI,WAAW,KAAK;AAClC,aAAS,CAAC,IAAI,WAAW,SAAS,CAAC;EACrC;AACA,SAAO;AACT;;;AErlBO,IAAM,oBAAoB;EAC/B,UAAU;EACV,WAAW;EACX,MAAM;EACN,IAAI;EACJ,QAAQ;;EAER,SAAS;EACT,QAAQ;EACR,YAAY,CAAC,KAAK;EAClB,WAAW,CAAC,0BAA0B;EACtC,QAAQ;EACR,OAAO,CAAC,OAAO;EACf,SAAS;IACP,OAAO;MACL,aAAa,OAAO,gBAAgB,WAAW,SAAS;;MACxD,aAAa;MACb,iBAAiB,CAAA;MACjB,oBAAoB;;;;AAQnB,IAAM,cAAc;EACzB,GAAG;EACH;;AAGF,eAAe,MAAM,aAA0B,SAA4B;AAxD3E;AAyDE,QAAM,EAAC,MAAK,IAAI,MAAM,uBACpB,mCAAS,QACT,wCAAS,UAAT,mBAAgB,gBAAe,MAAM;AAEvC,QAAM,cAAc,IAAI,YAAY,KAAK;AACzC,MAAI;AACF,WAAO,YAAY,UAAU,aAAa,mCAAS,KAAK;EAC1D;AACE,gBAAY,QAAO;EACrB;AACF;;;AC3DA,IAAAC,uBAAiC;AAK1B,IAAM,mBAAmB;EAC9B,GAAG;EACH,UAAU;EACV,QAAQ;EACR,OAAAC;;AAGF,eAAeA,OAAM,aAA0B,SAA4B;AACzE,QAAM,OAAO,MAAM,YAAY,MAAM,aAAa,OAAO;AACzD,QAAM,iBAAa,yCAAmB,MAAM,aAAa;AACzD,SAAO;AACT;",
|
|
6
6
|
"names": ["import_schema_utils", "import_schema_utils", "parse"]
|
|
7
7
|
}
|
package/dist/index.js
CHANGED
|
@@ -6,3 +6,4 @@ export { DRACO_EXTERNAL_LIBRARIES, DRACO_EXTERNAL_LIBRARY_URLS } from "./lib/dra
|
|
|
6
6
|
export { DracoWriterWorker, DracoWriter } from "./draco-writer.js";
|
|
7
7
|
export { DracoWorkerLoader, DracoLoader } from "./draco-loader.js";
|
|
8
8
|
export { DracoArrowLoader } from "./draco-arrow-loader.js";
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,aAAa;AACb,+BAA+B;AAC/B,oCAAoC;AAEpC,mBAAmB;AACnB,OAAO,EAAC,wBAAwB,EAAE,2BAA2B,EAAC,qCAAkC;AAShG,OAAO,EAAC,iBAAiB,EAAE,WAAW,EAAC,0BAAuB;AAK9D,OAAO,EAAC,iBAAiB,EAAE,WAAW,EAAC,0BAAuB;AAC9D,OAAO,EAAC,gBAAgB,EAAC,gCAA6B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draco-builder.js","sourceRoot":"","sources":["../../src/lib/draco-builder.ts"],"names":[],"mappings":"AA6BA,wDAAwD;AACxD,MAAM,gCAAgC,GAAG;IACvC,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,OAAO,EAAE,OAAO;IAChB,UAAU,EAAE,WAAW;CACxB,CAAC;AAEF,MAAM,IAAI,GAAG,GAAG,EAAE,GAAE,CAAC,CAAC;AAEtB,MAAM,CAAC,OAAO,OAAO,YAAY;IAC/B,KAAK,CAAU;IACf,YAAY,CAAU;IACtB,gBAAgB,CAAc;IAC9B,oBAAoB,CAAkB;IACtC,GAAG,CAAM;IAET,yEAAyE;IACzE,YAAY,KAAc;QACxB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,YAAY,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC;QAC7C,IAAI,CAAC,gBAAgB,GAAG,IAAI,IAAI,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC;Q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E,CAAC,EAAE,CAAC;QACpC,UAAU,CAAC,CAAC,CAAC,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;IACxC,CAAC;IACD,OAAO,YAAY,CAAC;AACtB,CAAC;AAED,sDAAsD;AACtD,SAAS,UAAU,CAAC,SAAS;IAC3B,MAAM,cAAc,GAAG,SAAS,CAAC,OAAO,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC;IACjF,OAAO,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAC1E,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type LoadLibraryOptions } from '@loaders.gl/worker-utils';
|
|
1
2
|
export declare const DRACO_EXTERNAL_LIBRARIES: {
|
|
2
3
|
/** The primary Draco3D encoder, javascript wrapper part */
|
|
3
4
|
DECODER: string;
|
|
@@ -11,6 +12,6 @@ export declare const DRACO_EXTERNAL_LIBRARIES: {
|
|
|
11
12
|
export declare const DRACO_EXTERNAL_LIBRARY_URLS: {
|
|
12
13
|
[x: string]: string;
|
|
13
14
|
};
|
|
14
|
-
export declare function loadDracoDecoderModule(options:
|
|
15
|
-
export declare function loadDracoEncoderModule(options:
|
|
15
|
+
export declare function loadDracoDecoderModule(options: LoadLibraryOptions | undefined, type: 'wasm' | 'js'): Promise<any>;
|
|
16
|
+
export declare function loadDracoEncoderModule(options: LoadLibraryOptions): Promise<any>;
|
|
16
17
|
//# sourceMappingURL=draco-module-loader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"draco-module-loader.d.ts","sourceRoot":"","sources":["../../src/lib/draco-module-loader.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"draco-module-loader.d.ts","sourceRoot":"","sources":["../../src/lib/draco-module-loader.ts"],"names":[],"mappings":"AAIA,OAAO,EAAyB,KAAK,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AAOzF,eAAO,MAAM,wBAAwB;IACnC,2DAA2D;;IAE3D,4DAA4D;;IAE5D,2FAA2F;;IAE3F,oBAAoB;;CAErB,CAAC;AAEF,eAAO,MAAM,2BAA2B;;CAKvC,CAAC;AAKF,wBAAsB,sBAAsB,CAC1C,OAAO,EAAE,kBAAkB,YAAK,EAChC,IAAI,EAAE,MAAM,GAAG,IAAI,gBAcpB;AAED,wBAAsB,sBAAsB,CAAC,OAAO,EAAE,kBAAkB,gBAavE"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Dynamic DRACO module loading inspired by THREE.DRACOLoader
|
|
2
2
|
// https://github.com/mrdoob/three.js/blob/398c4f39ebdb8b23eefd4a7a5ec49ec0c96c7462/examples/jsm/loaders/DRACOLoader.js
|
|
3
3
|
// by Don McCurdy / https://www.donmccurdy.com / MIT license
|
|
4
|
-
import { loadLibrary } from '@loaders.gl/worker-utils';
|
|
4
|
+
import { isBrowser, loadLibrary } from '@loaders.gl/worker-utils';
|
|
5
5
|
const DRACO_DECODER_VERSION = '1.5.6';
|
|
6
6
|
const DRACO_ENCODER_VERSION = '1.4.1';
|
|
7
7
|
const STATIC_DECODER_URL = `https://www.gstatic.com/draco/versioned/decoders/${DRACO_DECODER_VERSION}`;
|
|
@@ -23,7 +23,7 @@ export const DRACO_EXTERNAL_LIBRARY_URLS = {
|
|
|
23
23
|
};
|
|
24
24
|
let loadDecoderPromise;
|
|
25
25
|
let loadEncoderPromise;
|
|
26
|
-
export async function loadDracoDecoderModule(options) {
|
|
26
|
+
export async function loadDracoDecoderModule(options = {}, type) {
|
|
27
27
|
const modules = options.modules || {};
|
|
28
28
|
// Check if a bundled draco3d library has been supplied by application
|
|
29
29
|
if (modules.draco3d) {
|
|
@@ -33,7 +33,7 @@ export async function loadDracoDecoderModule(options) {
|
|
|
33
33
|
}
|
|
34
34
|
else {
|
|
35
35
|
// If not, dynamically load the WASM script from our CDN
|
|
36
|
-
loadDecoderPromise ||= loadDracoDecoder(options);
|
|
36
|
+
loadDecoderPromise ||= loadDracoDecoder(options, type);
|
|
37
37
|
}
|
|
38
38
|
return await loadDecoderPromise;
|
|
39
39
|
}
|
|
@@ -51,27 +51,58 @@ export async function loadDracoEncoderModule(options) {
|
|
|
51
51
|
}
|
|
52
52
|
return await loadEncoderPromise;
|
|
53
53
|
}
|
|
54
|
+
function getLibraryExport(library, exportName) {
|
|
55
|
+
if (library && typeof library === 'object') {
|
|
56
|
+
if (library.default) {
|
|
57
|
+
return library.default;
|
|
58
|
+
}
|
|
59
|
+
if (library[exportName]) {
|
|
60
|
+
return library[exportName];
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return library;
|
|
64
|
+
}
|
|
54
65
|
// DRACO DECODER LOADING
|
|
55
|
-
|
|
66
|
+
/** @todo - type the options, they are inconsistent */
|
|
67
|
+
async function loadDracoDecoder(options, type) {
|
|
56
68
|
let DracoDecoderModule;
|
|
57
69
|
let wasmBinary;
|
|
58
|
-
switch (
|
|
70
|
+
switch (type) {
|
|
59
71
|
case 'js':
|
|
60
72
|
DracoDecoderModule = await loadLibrary(DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.FALLBACK_DECODER], 'draco', options, DRACO_EXTERNAL_LIBRARIES.FALLBACK_DECODER);
|
|
61
73
|
break;
|
|
62
74
|
case 'wasm':
|
|
63
75
|
default:
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
76
|
+
try {
|
|
77
|
+
[DracoDecoderModule, wasmBinary] = await Promise.all([
|
|
78
|
+
await loadLibrary(DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.DECODER], 'draco', options, DRACO_EXTERNAL_LIBRARIES.DECODER),
|
|
79
|
+
await loadLibrary(DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.DECODER_WASM], 'draco', options, DRACO_EXTERNAL_LIBRARIES.DECODER_WASM)
|
|
80
|
+
]);
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
DracoDecoderModule = null;
|
|
84
|
+
wasmBinary = null;
|
|
85
|
+
}
|
|
68
86
|
}
|
|
69
|
-
|
|
87
|
+
DracoDecoderModule = getLibraryExport(DracoDecoderModule, 'DracoDecoderModule');
|
|
70
88
|
// @ts-ignore
|
|
71
89
|
DracoDecoderModule = DracoDecoderModule || globalThis.DracoDecoderModule;
|
|
90
|
+
// In Node environments without network access, fall back to local copies in the repo.
|
|
91
|
+
if (!DracoDecoderModule && !isBrowser) {
|
|
92
|
+
[DracoDecoderModule, wasmBinary] = await Promise.all([
|
|
93
|
+
await loadLibrary(DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.DECODER], 'draco', { ...options, useLocalLibraries: true }, DRACO_EXTERNAL_LIBRARIES.DECODER),
|
|
94
|
+
await loadLibrary(DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.DECODER_WASM], 'draco', { ...options, useLocalLibraries: true }, DRACO_EXTERNAL_LIBRARIES.DECODER_WASM)
|
|
95
|
+
]);
|
|
96
|
+
DracoDecoderModule = getLibraryExport(DracoDecoderModule, 'DracoDecoderModule');
|
|
97
|
+
// @ts-ignore
|
|
98
|
+
DracoDecoderModule = DracoDecoderModule || globalThis.DracoDecoderModule;
|
|
99
|
+
}
|
|
72
100
|
return await initializeDracoDecoder(DracoDecoderModule, wasmBinary);
|
|
73
101
|
}
|
|
74
102
|
function initializeDracoDecoder(DracoDecoderModule, wasmBinary) {
|
|
103
|
+
if (typeof DracoDecoderModule !== 'function') {
|
|
104
|
+
throw new Error('DracoDecoderModule could not be loaded');
|
|
105
|
+
}
|
|
75
106
|
const options = {};
|
|
76
107
|
if (wasmBinary) {
|
|
77
108
|
options.wasmBinary = wasmBinary;
|
|
@@ -86,11 +117,23 @@ function initializeDracoDecoder(DracoDecoderModule, wasmBinary) {
|
|
|
86
117
|
// ENCODER
|
|
87
118
|
async function loadDracoEncoder(options) {
|
|
88
119
|
let DracoEncoderModule = await loadLibrary(DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.ENCODER], 'draco', options, DRACO_EXTERNAL_LIBRARIES.ENCODER);
|
|
120
|
+
DracoEncoderModule = getLibraryExport(DracoEncoderModule, 'DracoEncoderModule');
|
|
89
121
|
// @ts-ignore
|
|
90
122
|
DracoEncoderModule = DracoEncoderModule || globalThis.DracoEncoderModule;
|
|
123
|
+
// In Node environments without network access, fall back to local copies in the repo.
|
|
124
|
+
if (!DracoEncoderModule && !isBrowser) {
|
|
125
|
+
DracoEncoderModule = await loadLibrary(DRACO_EXTERNAL_LIBRARY_URLS[DRACO_EXTERNAL_LIBRARIES.ENCODER], 'draco', { ...options, useLocalLibraries: true }, DRACO_EXTERNAL_LIBRARIES.ENCODER);
|
|
126
|
+
DracoEncoderModule = getLibraryExport(DracoEncoderModule, 'DracoEncoderModule');
|
|
127
|
+
// @ts-ignore
|
|
128
|
+
DracoEncoderModule = DracoEncoderModule || globalThis.DracoEncoderModule;
|
|
129
|
+
}
|
|
130
|
+
if (typeof DracoEncoderModule !== 'function') {
|
|
131
|
+
throw new Error('DracoEncoderModule could not be loaded');
|
|
132
|
+
}
|
|
91
133
|
return new Promise((resolve) => {
|
|
92
134
|
DracoEncoderModule({
|
|
93
135
|
onModuleLoaded: (draco) => resolve({ draco }) // Module is Promise-like. Wrap in object to avoid loop.
|
|
94
136
|
});
|
|
95
137
|
});
|
|
96
138
|
}
|
|
139
|
+
//# sourceMappingURL=draco-module-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draco-module-loader.js","sourceRoot":"","sources":["../../src/lib/draco-module-loader.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,uHAAuH;AACvH,4DAA4D;AAE5D,OAAO,EAAC,SAAS,EAAE,WAAW,EAA0B,MAAM,0BAA0B,CAAC;AAE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AAE,iBAAiB,EAAE,IAAI,EAAC,EACrC,wBAAwB,CAAC,OAAO,CACjC,CAAC;QACF,kBAAkB,GAAG,gBAAgB,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAAC;QAChF,aAAa;QACb,kBAAkB,GAAG,kBAAkB,IAAI,UAAU,CAAC,kBAAkB,CAAC;IAC3E,CAAC;IAED,IAAI,OAAO,kBAAkB,KAAK,UAAU,EAAE,CAAC;QAC7C,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAC5D,CAAC;IAED,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,kBAAkB,CAAC;YACjB,cAAc,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,OAAO,CAAC,EAAC,KAAK,EAAC,CAAC,CAAC,wDAAwD;SACrG,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
package/dist/lib/draco-parser.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"draco-parser.js","sourceRoot":"","sources":["../../src/lib/draco-parser.ts"],"names":[],"mappings":"AAAA,8BAA8B;AA2B9B,OAAO,EAAC,kBAAkB,EAAC,MAAM,0BAA0B,CAAC;AAC5D,OAAO,EAAC,cAAc,EAAC,oCAAiC;AAgBxD,aAAa;AACb,6DAA6D;AAC7D,MAAM,aAAa,GAAG;IACpB,eAAe,EAAE,CAAC;IAClB,WAAW,EAAE,CAAC;CACf,CAAC;AAEF,wDAAwD;AACxD,MAAM,gCAAgC,GAAG;IACvC,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,SAAS;IAChB,SAAS,EAAE,YAAY;CACxB,CAAC;AAEF,MAAM,kCAAkC,GAAG;IACzC,CAAC,EAAE,SAAS;IACZ,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,WAAW;IACd,CAAC,EAAE,UAAU;IACb,CAAC,EAAE,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2B;IAE3B,MAAM,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/E,MAAM,KAAK,GAAG,eAAe,CAAC,aAAa,EAAE,SAAS,EAAE,WAAW,CAAC,CAAC;IACrE,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,YAAY,CAAC,QAA6C;IACjE,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACzB,MAAM,kBAAkB,GAA2B,EAAE,CAAC;IACtD,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC3B,kBAAkB,CAAC,GAAG,GAAG,SAAS,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,kBAAkB,CAAC;AAC5B,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// Version constant cannot be imported, it needs to correspond to the build version of **this** module.
|
|
2
2
|
// __VERSION__ is injected by babel-plugin-version-inline
|
|
3
3
|
// @ts-ignore TS2304: Cannot find name '__VERSION__'.
|
|
4
|
-
export const VERSION = typeof "4.4.0-alpha.
|
|
4
|
+
export const VERSION = typeof "4.4.0-alpha.11" !== 'undefined' ? "4.4.0-alpha.11" : 'latest';
|
|
5
|
+
//# sourceMappingURL=version.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/lib/utils/version.ts"],"names":[],"mappings":"AAAA,uGAAuG;AACvG,yDAAyD;AACzD,qDAAqD;AACrD,MAAM,CAAC,MAAM,OAAO,GAAG,uBAAkB,KAAK,WAAW,CAAC,CAAC,kBAAa,CAAC,CAAC,QAAQ,CAAC"}
|
|
Binary file
|