@lottiefiles/dotlottie-web 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -46
- package/dist/{chunk-2ELNS7EO.js → chunk-STWLHF3O.js} +3 -3
- package/dist/chunk-STWLHF3O.js.map +1 -0
- package/dist/chunk-YUMEQPLC.js +10 -0
- package/dist/chunk-YUMEQPLC.js.map +1 -0
- package/dist/dotlottie.d.ts +112 -15
- package/dist/dotlottie.js +2 -2
- package/dist/event-manager.d.ts +6 -3
- package/dist/event-manager.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -2
- package/package.json +1 -1
- package/dist/chunk-2ELNS7EO.js.map +0 -1
- package/dist/chunk-4GVX2PO3.js +0 -10
- package/dist/chunk-4GVX2PO3.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../package.json","../src/renderer-wasm/bin/renderer.js","../src/renderer-wasm/index.ts","../src/dotlottie.ts"],"names":["package_default","createRendererModule","_scriptDir","moduleArg","Module","readyPromiseResolve","readyPromiseReject","resolve","reject","moduleOverrides","arguments_","thisProgram","quit_","status","toThrow","ENVIRONMENT_IS_WEB","ENVIRONMENT_IS_WORKER","scriptDirectory","locateFile","path","read_","readAsync","readBinary","url","xhr","onload","onerror","out","err","wasmBinary","abort","wasmMemory","ABORT","EXITSTATUS","assert","condition","text","HEAP8","HEAPU8","HEAP16","HEAPU16","HEAP32","HEAPU32","HEAPF32","HEAPF64","updateMemoryViews","b","__ATPRERUN__","__ATINIT__","__ATPOSTRUN__","runtimeInitialized","preRun","addOnPreRun","callRuntimeCallbacks","initRuntime","postRun","addOnPostRun","cb","addOnInit","runDependencies","runDependencyWatcher","dependenciesFulfilled","addRunDependency","id","removeRunDependency","callback","what","e","dataURIPrefix","isDataURI","filename","wasmBinaryFile","getBinarySync","file","getBinaryPromise","binaryFile","response","instantiateArrayBuffer","imports","receiver","binary","instance","reason","instantiateAsync","result","createWasm","info","wasmImports","receiveInstance","module","wasmExports","wasmTable","receiveInstantiationResult","callbacks","noExitRuntime","UTF8Decoder","UTF8ArrayToString","heapOrArray","idx","maxBytesToRead","endIdx","endPtr","str","u0","u1","u2","ch","UTF8ToString","ptr","___assert_fail","line","func","SYSCALLS","ret","___syscall_fcntl64","fd","cmd","varargs","___syscall_ioctl","op","___syscall_openat","dirfd","flags","__embind_register_bigint","primitiveType","name","size","minRange","maxRange","embind_init_charCodes","codes","i","embind_charCodes","readLatin1String","c","awaitingDependencies","registeredTypes","typeDependencies","BindingError","throwBindingError","message","InternalError","throwInternalError","whenDependentTypesAreResolved","myTypes","dependentTypes","getTypeConverters","type","onComplete","typeConverters","myTypeConverters","registerType","unregisteredTypes","registered","dt","sharedRegisterType","rawType","registeredInstance","options","GenericWireTypeSize","__embind_register_bool","trueValue","falseValue","wt","destructors","pointer","shallowCopyInternalPointer","o","throwInstanceAlreadyDeleted","obj","getInstanceTypeName","handle","finalizationRegistry","detachFinalizer","runDestructor","$$","releaseClassHandle","toDelete","downcastPointer","ptrClass","desiredClass","rv","registeredPointers","getInheritedInstanceCount","registeredInstances","getLiveInheritedInstances","k","deletionQueue","flushPendingDeletes","delayFunction","setDelayFunction","fn","init_embind","getBasestPointer","class_","getInheritedInstance","makeClassHandle","prototype","record","hasSmartPtrType","hasSmartPtr","attachFinalizer","RegisteredPointer_fromWireType","rawPointer","makeDefaultHandle","actualType","registeredPointerRecord","toType","dp","init_ClassHandle","ClassHandle","other","leftClass","left","rightClass","right","clone","char_0","char_9","makeLegalFunctionName","f","createNamedFunction","body","ensureOverloadTable","proto","methodName","humanName","prevFunc","exposePublicSymbol","value","numArguments","RegisteredClass","constructor","instancePrototype","rawDestructor","baseClass","getActualType","upcast","downcast","upcastPointer","constNoSmartPtrRawPointerToWireType","embindRepr","handleClass","genericPointerToWireType","clonedHandle","Emval","nonConstNoSmartPtrRawPointerToWireType","readPointer","init_RegisteredPointer","RegisteredPointer","registeredClass","isReference","isConst","isSmartPointer","pointeeType","sharingPolicy","rawGetPointee","rawConstructor","rawShare","replacePublicSymbol","dynCallLegacy","sig","args","getWasmTableEntry","funcPtr","dynCall","rtn","getDynCaller","argCache","embind__requireFunction","signature","rawFunction","makeDynCaller","fp","extendError","baseErrorType","errorName","errorClass","stack","UnboundTypeError","getTypeName","___getTypeName","_free","throwUnboundTypeError","types","unboundTypes","seen","visit","__embind_register_class","rawPointerType","rawConstPointerType","baseClassRawType","getActualTypeSignature","upcastSignature","downcastSignature","destructorSignature","legalFunctionName","base","basePrototype","referenceConverter","pointerConverter","constPointerConverter","heap32VectorToArray","count","firstElement","array","runDestructors","del","craftInvokerFunction","argTypes","classType","cppInvokerFunc","cppTargetFunc","isAsync","argCount","isClassMethodFunc","needsDestructorStack","returns","expectedArgCount","argsWired","invokerFuncArgs","thisWired","onDone","param","__embind_register_class_constructor","rawClassType","rawArgTypesAddr","invokerSignature","invoker","rawArgTypes","getFunctionName","argsIndex","__embind_register_class_function","rawInvoker","context","isPureVirtual","unboundTypesHandler","method","memberFunction","handleAllocatorInit","HandleAllocator","emval_handles","__emval_decref","count_emval_handles","init_emval","simpleReadValueFromPointer","__embind_register_emval","v","t","floatReadValueFromPointer","width","__embind_register_float","integerReadValueFromPointer","signed","__embind_register_integer","fromWireType","bitshift","isUnsignedType","checkAssertions","toTypeName","toWireType","__embind_register_memory_view","dataTypeIndex","typeMapping","TA","decodeMemoryView","data","stringToUTF8Array","heap","outIdx","maxBytesToWrite","startIdx","u","stringToUTF8","outPtr","lengthBytesUTF8","len","__embind_register_std_string","stdStringIsUTF8","length","payload","decodeStartPtr","currentBytePtr","maxRead","stringSegment","a","valueIsOfTypeString","_malloc","charCode","UTF16Decoder","UTF16ToString","maxIdx","codeUnit","stringToUTF16","startPtr","numCharsToWrite","lengthBytesUTF16","UTF32ToString","utf32","stringToUTF32","trailSurrogate","lengthBytesUTF32","__embind_register_std_wstring","charSize","decodeString","encodeString","getHeap","lengthBytesUTF","shift","HEAP","maxReadBytes","__embind_register_void","__emscripten_throw_longjmp","__emval_incref","requireRegisteredType","impl","__emval_take_value","arg","_abort","_emscripten_memcpy_js","dest","src","num","getHeapMax","growMemory","pages","_emscripten_resize_heap","requestedSize","oldSize","maxHeapSize","alignUp","x","multiple","cutDown","overGrownHeapSize","newSize","replacement","_fd_close","_fd_read","iov","iovcnt","pnum","convertI32PairToI53Checked","lo","hi","_fd_seek","offset_low","offset_high","whence","newOffset","offset","printCharBuffers","printChar","stream","curr","buffer","_fd_write","j","invoke_ii","invoke_iiii","invoke_iiiiii","invoke_vi","invoke_vii","invoke_viiii","invoke_viiij","___wasm_call_ctors","a0","__embind_initialize_bindings","___errno_location","_setThrew","a1","stackSave","stackRestore","___cxa_increment_exception_refcount","___cxa_is_pointer_type","dynCall_viiij","a2","a3","a4","a5","dynCall_jiji","index","sp","calledRun","runCaller","run","doRun","renderer_default","WasmLoader","initialError","backupUrl","backupError","__publicField","MS_TO_SEC_FACTOR","DotLottie","config","EventManager","error","animationURL","loadAnimationJSONFromURL","animationJSON","loadAnimation","animationData","getAnimationJSONFromDotLottie","height","clampedBuffer","imageData","effectiveStartFrame","effectiveEndFrame","frameDuration","frameProgress","shouldUpdate","frame","effectiveDuration","effectiveTotalFrames","frameTime","speed","currentTime","loop","mode","startFrame","endFrame","listener","color","dpr"],"mappings":"kIAAA,IAAAA,GAAA,CACE,KAAQ,6BACR,QAAW,QACX,KAAQ,SACR,YAAe,0CACf,WAAc,CACZ,KAAQ,MACR,IAAO,uDACP,UAAa,cACf,EACA,SAAY,sDACZ,KAAQ,sDACR,OAAU,cACV,aAAgB,CACd,4CACF,EACA,QAAW,MACX,QAAW,CACT,KAAQ,MACV,EACA,KAAQ,gBACR,OAAU,gBACV,MAAS,kBACT,MAAS,CACP,MACF,EACA,SAAY,CACV,YACA,SACA,SACA,YACA,MACA,SACA,YACF,EACA,QAAW,CACT,MAAS,OACT,aAAc,kBACd,oBAAqB,yBACrB,IAAO,eACP,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AK,QAAQ,OAASpB,EAASoB,EAG/B,KAAK,QAAQ,CACf,CAGF","sourcesContent":["{\n \"name\": \"@lottiefiles/dotlottie-web\",\n \"version\": \"0.8.0\",\n \"type\": \"module\",\n \"description\": \"Lottie and DotLottie player for the web\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"git+https://github.com/LottieFiles/dotlottie-web.git\",\n \"directory\": \"packages/web\"\n },\n \"homepage\": \"https://github.com/LottieFiles/dotlottie-web#readme\",\n \"bugs\": \"https://github.com/LottieFiles/dotlottie-web/issues\",\n \"author\": \"LottieFiles\",\n \"contributors\": [\n \"Abdelrahman Ashraf <a.theashraf@gmail.com>\"\n ],\n \"license\": \"MIT\",\n \"engines\": {\n \"node\": \">=18\"\n },\n \"main\": \"dist/index.js\",\n \"module\": \"dist/index.js\",\n \"types\": \"dist/index.d.ts\",\n \"files\": [\n \"dist\"\n ],\n \"keywords\": [\n \"dotlottie\",\n \"lottie\",\n \"player\",\n \"animation\",\n \"web\",\n \"canvas\",\n \"javascript\"\n ],\n \"scripts\": {\n \"build\": \"tsup\",\n \"build:wasm\": \"./build_wasm.sh\",\n \"build:wasm:docker\": \"./docker_build_wasm.sh\",\n \"dev\": \"tsup --watch\",\n \"lint\": \"eslint --fix .\",\n \"size:why\": \"size-limit --why --clean-dir --save-bundle ./tmp\",\n \"stats:eslint\": \"cross-env TIMING=1 eslint .\",\n \"stats:ts\": \"tsc -p tsconfig.build.json --extendedDiagnostics\",\n \"type-check\": \"tsc --noEmit\"\n },\n \"dependencies\": {\n \"@dotlottie/dotlottie-js\": \"^0.6.0\"\n },\n \"devDependencies\": {\n \"cross-env\": \"7.0.3\",\n \"tsup\": \"7.2.0\",\n \"typescript\": \"5.0.4\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n }\n}\n","var createRendererModule = (() => {\n var _scriptDir = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : undefined;\n\n return function (moduleArg = {}) {\n var Module = moduleArg;\n\n var readyPromiseResolve, readyPromiseReject;\n\n Module['ready'] = new Promise((resolve, reject) => {\n readyPromiseResolve = resolve;\n readyPromiseReject = reject;\n });\n\n var moduleOverrides = Object.assign({}, Module);\n\n var arguments_ = [];\n\n var thisProgram = './this.program';\n\n var quit_ = (status, toThrow) => {\n throw toThrow;\n };\n\n var ENVIRONMENT_IS_WEB = true;\n\n var ENVIRONMENT_IS_WORKER = false;\n\n var scriptDirectory = '';\n\n function locateFile(path) {\n if (Module['locateFile']) {\n return Module['locateFile'](path, scriptDirectory);\n }\n return scriptDirectory + path;\n }\n\n var read_, readAsync, readBinary;\n\n if (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER) {\n if (ENVIRONMENT_IS_WORKER) {\n scriptDirectory = self.location.href;\n } else if (typeof document != 'undefined' && document.currentScript) {\n scriptDirectory = document.currentScript.src;\n }\n if (_scriptDir) {\n scriptDirectory = _scriptDir;\n }\n if (scriptDirectory.indexOf('blob:') !== 0) {\n scriptDirectory = scriptDirectory.substr(0, scriptDirectory.replace(/[?#].*/, '').lastIndexOf('/') + 1);\n } else {\n scriptDirectory = '';\n }\n {\n read_ = (url) => {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n xhr.send(null);\n return xhr.responseText;\n };\n if (ENVIRONMENT_IS_WORKER) {\n readBinary = (url) => {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, false);\n xhr.responseType = 'arraybuffer';\n xhr.send(null);\n return new Uint8Array(/** @type{!ArrayBuffer} */ (xhr.response));\n };\n }\n readAsync = (url, onload, onerror) => {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, true);\n xhr.responseType = 'arraybuffer';\n xhr.onload = () => {\n if (xhr.status == 200 || (xhr.status == 0 && xhr.response)) {\n onload(xhr.response);\n return;\n }\n onerror();\n };\n xhr.onerror = onerror;\n xhr.send(null);\n };\n }\n } else {\n }\n\n var out = Module['print'] || console.log.bind(console);\n\n var err = Module['printErr'] || console.error.bind(console);\n\n Object.assign(Module, moduleOverrides);\n\n moduleOverrides = null;\n\n if (Module['arguments']) arguments_ = Module['arguments'];\n\n if (Module['thisProgram']) thisProgram = Module['thisProgram'];\n\n if (Module['quit']) quit_ = Module['quit'];\n\n var wasmBinary;\n\n if (Module['wasmBinary']) wasmBinary = Module['wasmBinary'];\n\n if (typeof WebAssembly != 'object') {\n abort('no native wasm support detected');\n }\n\n var wasmMemory;\n\n var ABORT = false;\n\n var EXITSTATUS;\n\n /** @type {function(*, string=)} */ function assert(condition, text) {\n if (!condition) {\n abort(text);\n }\n }\n\n var /** @type {!Int8Array} */ HEAP8,\n /** @type {!Uint8Array} */ HEAPU8,\n /** @type {!Int16Array} */ HEAP16,\n /** @type {!Uint16Array} */ HEAPU16,\n /** @type {!Int32Array} */ HEAP32,\n /** @type {!Uint32Array} */ HEAPU32,\n /** @type {!Float32Array} */ HEAPF32,\n /** @type {!Float64Array} */ HEAPF64;\n\n function updateMemoryViews() {\n var b = wasmMemory.buffer;\n Module['HEAP8'] = HEAP8 = new Int8Array(b);\n Module['HEAP16'] = HEAP16 = new Int16Array(b);\n Module['HEAPU8'] = HEAPU8 = new Uint8Array(b);\n Module['HEAPU16'] = HEAPU16 = new Uint16Array(b);\n Module['HEAP32'] = HEAP32 = new Int32Array(b);\n Module['HEAPU32'] = HEAPU32 = new Uint32Array(b);\n Module['HEAPF32'] = HEAPF32 = new Float32Array(b);\n Module['HEAPF64'] = HEAPF64 = new Float64Array(b);\n }\n\n var __ATPRERUN__ = [];\n\n var __ATINIT__ = [];\n\n var __ATPOSTRUN__ = [];\n\n var runtimeInitialized = false;\n\n function preRun() {\n if (Module['preRun']) {\n if (typeof Module['preRun'] == 'function') Module['preRun'] = [Module['preRun']];\n while (Module['preRun'].length) {\n addOnPreRun(Module['preRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPRERUN__);\n }\n\n function initRuntime() {\n runtimeInitialized = true;\n callRuntimeCallbacks(__ATINIT__);\n }\n\n function postRun() {\n if (Module['postRun']) {\n if (typeof Module['postRun'] == 'function') Module['postRun'] = [Module['postRun']];\n while (Module['postRun'].length) {\n addOnPostRun(Module['postRun'].shift());\n }\n }\n callRuntimeCallbacks(__ATPOSTRUN__);\n }\n\n function addOnPreRun(cb) {\n __ATPRERUN__.unshift(cb);\n }\n\n function addOnInit(cb) {\n __ATINIT__.unshift(cb);\n }\n\n function addOnPostRun(cb) {\n __ATPOSTRUN__.unshift(cb);\n }\n\n var runDependencies = 0;\n\n var runDependencyWatcher = null;\n\n var dependenciesFulfilled = null;\n\n function addRunDependency(id) {\n runDependencies++;\n if (Module['monitorRunDependencies']) {\n Module['monitorRunDependencies'](runDependencies);\n }\n }\n\n function removeRunDependency(id) {\n runDependencies--;\n if (Module['monitorRunDependencies']) {\n Module['monitorRunDependencies'](runDependencies);\n }\n if (runDependencies == 0) {\n if (runDependencyWatcher !== null) {\n clearInterval(runDependencyWatcher);\n runDependencyWatcher = null;\n }\n if (dependenciesFulfilled) {\n var callback = dependenciesFulfilled;\n dependenciesFulfilled = null;\n callback();\n }\n }\n }\n\n /** @param {string|number=} what */ function abort(what) {\n if (Module['onAbort']) {\n Module['onAbort'](what);\n }\n what = 'Aborted(' + what + ')';\n err(what);\n ABORT = true;\n EXITSTATUS = 1;\n what += '. Build with -sASSERTIONS for more info.';\n /** @suppress {checkTypes} */ var e = new WebAssembly.RuntimeError(what);\n readyPromiseReject(e);\n throw e;\n }\n\n var dataURIPrefix = 'data:application/octet-stream;base64,';\n\n /**\n * Indicates whether filename is a base64 data URI.\n * @noinline\n */ var isDataURI = (filename) => filename.startsWith(dataURIPrefix);\n\n var wasmBinaryFile;\n\n wasmBinaryFile = 'renderer.wasm';\n\n if (!isDataURI(wasmBinaryFile)) {\n wasmBinaryFile = locateFile(wasmBinaryFile);\n }\n\n function getBinarySync(file) {\n if (file == wasmBinaryFile && wasmBinary) {\n return new Uint8Array(wasmBinary);\n }\n if (readBinary) {\n return readBinary(file);\n }\n throw 'both async and sync fetching of the wasm failed';\n }\n\n function getBinaryPromise(binaryFile) {\n if (!wasmBinary && (ENVIRONMENT_IS_WEB || ENVIRONMENT_IS_WORKER)) {\n if (typeof fetch == 'function') {\n return fetch(binaryFile, {\n credentials: 'same-origin',\n })\n .then((response) => {\n if (!response['ok']) {\n throw \"failed to load wasm binary file at '\" + binaryFile + \"'\";\n }\n return response['arrayBuffer']();\n })\n .catch(() => getBinarySync(binaryFile));\n }\n }\n return Promise.resolve().then(() => getBinarySync(binaryFile));\n }\n\n function instantiateArrayBuffer(binaryFile, imports, receiver) {\n return getBinaryPromise(binaryFile)\n .then((binary) => WebAssembly.instantiate(binary, imports))\n .then((instance) => instance)\n .then(receiver, (reason) => {\n err(`failed to asynchronously prepare wasm: ${reason}`);\n abort(reason);\n });\n }\n\n function instantiateAsync(binary, binaryFile, imports, callback) {\n if (\n !binary &&\n typeof WebAssembly.instantiateStreaming == 'function' &&\n !isDataURI(binaryFile) &&\n typeof fetch == 'function'\n ) {\n return fetch(binaryFile, {\n credentials: 'same-origin',\n }).then((response) => {\n /** @suppress {checkTypes} */ var result = WebAssembly.instantiateStreaming(response, imports);\n return result.then(callback, function (reason) {\n err(`wasm streaming compile failed: ${reason}`);\n err('falling back to ArrayBuffer instantiation');\n return instantiateArrayBuffer(binaryFile, imports, callback);\n });\n });\n }\n return instantiateArrayBuffer(binaryFile, imports, callback);\n }\n\n function createWasm() {\n var info = {\n a: wasmImports,\n };\n /** @param {WebAssembly.Module=} module*/ function receiveInstance(instance, module) {\n wasmExports = instance.exports;\n wasmMemory = wasmExports['I'];\n updateMemoryViews();\n wasmTable = wasmExports['O'];\n addOnInit(wasmExports['J']);\n removeRunDependency('wasm-instantiate');\n return wasmExports;\n }\n addRunDependency('wasm-instantiate');\n function receiveInstantiationResult(result) {\n receiveInstance(result['instance']);\n }\n if (Module['instantiateWasm']) {\n try {\n return Module['instantiateWasm'](info, receiveInstance);\n } catch (e) {\n err(`Module.instantiateWasm callback failed with error: ${e}`);\n readyPromiseReject(e);\n }\n }\n instantiateAsync(wasmBinary, wasmBinaryFile, info, receiveInstantiationResult).catch(readyPromiseReject);\n return {};\n }\n\n var callRuntimeCallbacks = (callbacks) => {\n while (callbacks.length > 0) {\n callbacks.shift()(Module);\n }\n };\n\n var noExitRuntime = Module['noExitRuntime'] || true;\n\n var UTF8Decoder = typeof TextDecoder != 'undefined' ? new TextDecoder('utf8') : undefined;\n\n /**\n * Given a pointer 'idx' to a null-terminated UTF8-encoded string in the given\n * array that contains uint8 values, returns a copy of that string as a\n * Javascript String object.\n * heapOrArray is either a regular array, or a JavaScript typed array view.\n * @param {number} idx\n * @param {number=} maxBytesToRead\n * @return {string}\n */ var UTF8ArrayToString = (heapOrArray, idx, maxBytesToRead) => {\n var endIdx = idx + maxBytesToRead;\n var endPtr = idx;\n while (heapOrArray[endPtr] && !(endPtr >= endIdx)) ++endPtr;\n if (endPtr - idx > 16 && heapOrArray.buffer && UTF8Decoder) {\n return UTF8Decoder.decode(heapOrArray.subarray(idx, endPtr));\n }\n var str = '';\n while (idx < endPtr) {\n var u0 = heapOrArray[idx++];\n if (!(u0 & 128)) {\n str += String.fromCharCode(u0);\n continue;\n }\n var u1 = heapOrArray[idx++] & 63;\n if ((u0 & 224) == 192) {\n str += String.fromCharCode(((u0 & 31) << 6) | u1);\n continue;\n }\n var u2 = heapOrArray[idx++] & 63;\n if ((u0 & 240) == 224) {\n u0 = ((u0 & 15) << 12) | (u1 << 6) | u2;\n } else {\n u0 = ((u0 & 7) << 18) | (u1 << 12) | (u2 << 6) | (heapOrArray[idx++] & 63);\n }\n if (u0 < 65536) {\n str += String.fromCharCode(u0);\n } else {\n var ch = u0 - 65536;\n str += String.fromCharCode(55296 | (ch >> 10), 56320 | (ch & 1023));\n }\n }\n return str;\n };\n\n /**\n * Given a pointer 'ptr' to a null-terminated UTF8-encoded string in the\n * emscripten HEAP, returns a copy of that string as a Javascript String object.\n *\n * @param {number} ptr\n * @param {number=} maxBytesToRead - An optional length that specifies the\n * maximum number of bytes to read. You can omit this parameter to scan the\n * string until the first 0 byte. If maxBytesToRead is passed, and the string\n * at [ptr, ptr+maxBytesToReadr[ contains a null byte in the middle, then the\n * string will cut short at that byte index (i.e. maxBytesToRead will not\n * produce a string of exact length [ptr, ptr+maxBytesToRead[) N.B. mixing\n * frequent uses of UTF8ToString() with and without maxBytesToRead may throw\n * JS JIT optimizations off, so it is worth to consider consistently using one\n * @return {string}\n */ var UTF8ToString = (ptr, maxBytesToRead) => (ptr ? UTF8ArrayToString(HEAPU8, ptr, maxBytesToRead) : '');\n\n var ___assert_fail = (condition, filename, line, func) => {\n abort(\n `Assertion failed: ${UTF8ToString(condition)}, at: ` +\n [\n filename ? UTF8ToString(filename) : 'unknown filename',\n line,\n func ? UTF8ToString(func) : 'unknown function',\n ],\n );\n };\n\n var SYSCALLS = {\n varargs: undefined,\n get() {\n var ret = HEAP32[+SYSCALLS.varargs >> 2];\n SYSCALLS.varargs += 4;\n return ret;\n },\n getp() {\n return SYSCALLS.get();\n },\n getStr(ptr) {\n var ret = UTF8ToString(ptr);\n return ret;\n },\n };\n\n function ___syscall_fcntl64(fd, cmd, varargs) {\n SYSCALLS.varargs = varargs;\n return 0;\n }\n\n function ___syscall_ioctl(fd, op, varargs) {\n SYSCALLS.varargs = varargs;\n return 0;\n }\n\n function ___syscall_openat(dirfd, path, flags, varargs) {\n SYSCALLS.varargs = varargs;\n }\n\n var __embind_register_bigint = (primitiveType, name, size, minRange, maxRange) => {};\n\n var embind_init_charCodes = () => {\n var codes = new Array(256);\n for (var i = 0; i < 256; ++i) {\n codes[i] = String.fromCharCode(i);\n }\n embind_charCodes = codes;\n };\n\n var embind_charCodes;\n\n var readLatin1String = (ptr) => {\n var ret = '';\n var c = ptr;\n while (HEAPU8[c]) {\n ret += embind_charCodes[HEAPU8[c++]];\n }\n return ret;\n };\n\n var awaitingDependencies = {};\n\n var registeredTypes = {};\n\n var typeDependencies = {};\n\n var BindingError;\n\n var throwBindingError = (message) => {\n throw new BindingError(message);\n };\n\n var InternalError;\n\n var throwInternalError = (message) => {\n throw new InternalError(message);\n };\n\n var whenDependentTypesAreResolved = (myTypes, dependentTypes, getTypeConverters) => {\n myTypes.forEach(function (type) {\n typeDependencies[type] = dependentTypes;\n });\n function onComplete(typeConverters) {\n var myTypeConverters = getTypeConverters(typeConverters);\n if (myTypeConverters.length !== myTypes.length) {\n throwInternalError('Mismatched type converter count');\n }\n for (var i = 0; i < myTypes.length; ++i) {\n registerType(myTypes[i], myTypeConverters[i]);\n }\n }\n var typeConverters = new Array(dependentTypes.length);\n var unregisteredTypes = [];\n var registered = 0;\n dependentTypes.forEach((dt, i) => {\n if (registeredTypes.hasOwnProperty(dt)) {\n typeConverters[i] = registeredTypes[dt];\n } else {\n unregisteredTypes.push(dt);\n if (!awaitingDependencies.hasOwnProperty(dt)) {\n awaitingDependencies[dt] = [];\n }\n awaitingDependencies[dt].push(() => {\n typeConverters[i] = registeredTypes[dt];\n ++registered;\n if (registered === unregisteredTypes.length) {\n onComplete(typeConverters);\n }\n });\n }\n });\n if (0 === unregisteredTypes.length) {\n onComplete(typeConverters);\n }\n };\n\n /** @param {Object=} options */ function sharedRegisterType(rawType, registeredInstance, options = {}) {\n var name = registeredInstance.name;\n if (!rawType) {\n throwBindingError(`type \"${name}\" must have a positive integer typeid pointer`);\n }\n if (registeredTypes.hasOwnProperty(rawType)) {\n if (options.ignoreDuplicateRegistrations) {\n return;\n } else {\n throwBindingError(`Cannot register type '${name}' twice`);\n }\n }\n registeredTypes[rawType] = registeredInstance;\n delete typeDependencies[rawType];\n if (awaitingDependencies.hasOwnProperty(rawType)) {\n var callbacks = awaitingDependencies[rawType];\n delete awaitingDependencies[rawType];\n callbacks.forEach((cb) => cb());\n }\n }\n\n /** @param {Object=} options */ function registerType(rawType, registeredInstance, options = {}) {\n if (!('argPackAdvance' in registeredInstance)) {\n throw new TypeError('registerType registeredInstance requires argPackAdvance');\n }\n return sharedRegisterType(rawType, registeredInstance, options);\n }\n\n var GenericWireTypeSize = 8;\n\n /** @suppress {globalThis} */ var __embind_register_bool = (rawType, name, trueValue, falseValue) => {\n name = readLatin1String(name);\n registerType(rawType, {\n name: name,\n fromWireType: function (wt) {\n return !!wt;\n },\n toWireType: function (destructors, o) {\n return o ? trueValue : falseValue;\n },\n argPackAdvance: GenericWireTypeSize,\n readValueFromPointer: function (pointer) {\n return this['fromWireType'](HEAPU8[pointer]);\n },\n destructorFunction: null,\n });\n };\n\n var shallowCopyInternalPointer = (o) => ({\n count: o.count,\n deleteScheduled: o.deleteScheduled,\n preservePointerOnDelete: o.preservePointerOnDelete,\n ptr: o.ptr,\n ptrType: o.ptrType,\n smartPtr: o.smartPtr,\n smartPtrType: o.smartPtrType,\n });\n\n var throwInstanceAlreadyDeleted = (obj) => {\n function getInstanceTypeName(handle) {\n return handle.$$.ptrType.registeredClass.name;\n }\n throwBindingError(getInstanceTypeName(obj) + ' instance already deleted');\n };\n\n var finalizationRegistry = false;\n\n var detachFinalizer = (handle) => {};\n\n var runDestructor = ($$) => {\n if ($$.smartPtr) {\n $$.smartPtrType.rawDestructor($$.smartPtr);\n } else {\n $$.ptrType.registeredClass.rawDestructor($$.ptr);\n }\n };\n\n var releaseClassHandle = ($$) => {\n $$.count.value -= 1;\n var toDelete = 0 === $$.count.value;\n if (toDelete) {\n runDestructor($$);\n }\n };\n\n var downcastPointer = (ptr, ptrClass, desiredClass) => {\n if (ptrClass === desiredClass) {\n return ptr;\n }\n if (undefined === desiredClass.baseClass) {\n return null;\n }\n var rv = downcastPointer(ptr, ptrClass, desiredClass.baseClass);\n if (rv === null) {\n return null;\n }\n return desiredClass.downcast(rv);\n };\n\n var registeredPointers = {};\n\n var getInheritedInstanceCount = () => Object.keys(registeredInstances).length;\n\n var getLiveInheritedInstances = () => {\n var rv = [];\n for (var k in registeredInstances) {\n if (registeredInstances.hasOwnProperty(k)) {\n rv.push(registeredInstances[k]);\n }\n }\n return rv;\n };\n\n var deletionQueue = [];\n\n var flushPendingDeletes = () => {\n while (deletionQueue.length) {\n var obj = deletionQueue.pop();\n obj.$$.deleteScheduled = false;\n obj['delete']();\n }\n };\n\n var delayFunction;\n\n var setDelayFunction = (fn) => {\n delayFunction = fn;\n if (deletionQueue.length && delayFunction) {\n delayFunction(flushPendingDeletes);\n }\n };\n\n var init_embind = () => {\n Module['getInheritedInstanceCount'] = getInheritedInstanceCount;\n Module['getLiveInheritedInstances'] = getLiveInheritedInstances;\n Module['flushPendingDeletes'] = flushPendingDeletes;\n Module['setDelayFunction'] = setDelayFunction;\n };\n\n var registeredInstances = {};\n\n var getBasestPointer = (class_, ptr) => {\n if (ptr === undefined) {\n throwBindingError('ptr should not be undefined');\n }\n while (class_.baseClass) {\n ptr = class_.upcast(ptr);\n class_ = class_.baseClass;\n }\n return ptr;\n };\n\n var getInheritedInstance = (class_, ptr) => {\n ptr = getBasestPointer(class_, ptr);\n return registeredInstances[ptr];\n };\n\n var makeClassHandle = (prototype, record) => {\n if (!record.ptrType || !record.ptr) {\n throwInternalError('makeClassHandle requires ptr and ptrType');\n }\n var hasSmartPtrType = !!record.smartPtrType;\n var hasSmartPtr = !!record.smartPtr;\n if (hasSmartPtrType !== hasSmartPtr) {\n throwInternalError('Both smartPtrType and smartPtr must be specified');\n }\n record.count = {\n value: 1,\n };\n return attachFinalizer(\n Object.create(prototype, {\n $$: {\n value: record,\n },\n }),\n );\n };\n\n /** @suppress {globalThis} */ function RegisteredPointer_fromWireType(ptr) {\n var rawPointer = this.getPointee(ptr);\n if (!rawPointer) {\n this.destructor(ptr);\n return null;\n }\n var registeredInstance = getInheritedInstance(this.registeredClass, rawPointer);\n if (undefined !== registeredInstance) {\n if (0 === registeredInstance.$$.count.value) {\n registeredInstance.$$.ptr = rawPointer;\n registeredInstance.$$.smartPtr = ptr;\n return registeredInstance['clone']();\n } else {\n var rv = registeredInstance['clone']();\n this.destructor(ptr);\n return rv;\n }\n }\n function makeDefaultHandle() {\n if (this.isSmartPointer) {\n return makeClassHandle(this.registeredClass.instancePrototype, {\n ptrType: this.pointeeType,\n ptr: rawPointer,\n smartPtrType: this,\n smartPtr: ptr,\n });\n } else {\n return makeClassHandle(this.registeredClass.instancePrototype, {\n ptrType: this,\n ptr: ptr,\n });\n }\n }\n var actualType = this.registeredClass.getActualType(rawPointer);\n var registeredPointerRecord = registeredPointers[actualType];\n if (!registeredPointerRecord) {\n return makeDefaultHandle.call(this);\n }\n var toType;\n if (this.isConst) {\n toType = registeredPointerRecord.constPointerType;\n } else {\n toType = registeredPointerRecord.pointerType;\n }\n var dp = downcastPointer(rawPointer, this.registeredClass, toType.registeredClass);\n if (dp === null) {\n return makeDefaultHandle.call(this);\n }\n if (this.isSmartPointer) {\n return makeClassHandle(toType.registeredClass.instancePrototype, {\n ptrType: toType,\n ptr: dp,\n smartPtrType: this,\n smartPtr: ptr,\n });\n } else {\n return makeClassHandle(toType.registeredClass.instancePrototype, {\n ptrType: toType,\n ptr: dp,\n });\n }\n }\n\n var attachFinalizer = (handle) => {\n if ('undefined' === typeof FinalizationRegistry) {\n attachFinalizer = (handle) => handle;\n return handle;\n }\n finalizationRegistry = new FinalizationRegistry((info) => {\n releaseClassHandle(info.$$);\n });\n attachFinalizer = (handle) => {\n var $$ = handle.$$;\n var hasSmartPtr = !!$$.smartPtr;\n if (hasSmartPtr) {\n var info = {\n $$: $$,\n };\n finalizationRegistry.register(handle, info, handle);\n }\n return handle;\n };\n detachFinalizer = (handle) => finalizationRegistry.unregister(handle);\n return attachFinalizer(handle);\n };\n\n var init_ClassHandle = () => {\n Object.assign(ClassHandle.prototype, {\n isAliasOf(other) {\n if (!(this instanceof ClassHandle)) {\n return false;\n }\n if (!(other instanceof ClassHandle)) {\n return false;\n }\n var leftClass = this.$$.ptrType.registeredClass;\n var left = this.$$.ptr;\n other.$$ = /** @type {Object} */ (other.$$);\n var rightClass = other.$$.ptrType.registeredClass;\n var right = other.$$.ptr;\n while (leftClass.baseClass) {\n left = leftClass.upcast(left);\n leftClass = leftClass.baseClass;\n }\n while (rightClass.baseClass) {\n right = rightClass.upcast(right);\n rightClass = rightClass.baseClass;\n }\n return leftClass === rightClass && left === right;\n },\n clone() {\n if (!this.$$.ptr) {\n throwInstanceAlreadyDeleted(this);\n }\n if (this.$$.preservePointerOnDelete) {\n this.$$.count.value += 1;\n return this;\n } else {\n var clone = attachFinalizer(\n Object.create(Object.getPrototypeOf(this), {\n $$: {\n value: shallowCopyInternalPointer(this.$$),\n },\n }),\n );\n clone.$$.count.value += 1;\n clone.$$.deleteScheduled = false;\n return clone;\n }\n },\n delete() {\n if (!this.$$.ptr) {\n throwInstanceAlreadyDeleted(this);\n }\n if (this.$$.deleteScheduled && !this.$$.preservePointerOnDelete) {\n throwBindingError('Object already scheduled for deletion');\n }\n detachFinalizer(this);\n releaseClassHandle(this.$$);\n if (!this.$$.preservePointerOnDelete) {\n this.$$.smartPtr = undefined;\n this.$$.ptr = undefined;\n }\n },\n isDeleted() {\n return !this.$$.ptr;\n },\n deleteLater() {\n if (!this.$$.ptr) {\n throwInstanceAlreadyDeleted(this);\n }\n if (this.$$.deleteScheduled && !this.$$.preservePointerOnDelete) {\n throwBindingError('Object already scheduled for deletion');\n }\n deletionQueue.push(this);\n if (deletionQueue.length === 1 && delayFunction) {\n delayFunction(flushPendingDeletes);\n }\n this.$$.deleteScheduled = true;\n return this;\n },\n });\n };\n\n /** @constructor */ function ClassHandle() {}\n\n var char_0 = 48;\n\n var char_9 = 57;\n\n var makeLegalFunctionName = (name) => {\n if (undefined === name) {\n return '_unknown';\n }\n name = name.replace(/[^a-zA-Z0-9_]/g, '$');\n var f = name.charCodeAt(0);\n if (f >= char_0 && f <= char_9) {\n return `_${name}`;\n }\n return name;\n };\n\n function createNamedFunction(name, body) {\n name = makeLegalFunctionName(name);\n return {\n [name]: function () {\n return body.apply(this, arguments);\n },\n }[name];\n }\n\n var ensureOverloadTable = (proto, methodName, humanName) => {\n if (undefined === proto[methodName].overloadTable) {\n var prevFunc = proto[methodName];\n proto[methodName] = function () {\n if (!proto[methodName].overloadTable.hasOwnProperty(arguments.length)) {\n throwBindingError(\n `Function '${humanName}' called with an invalid number of arguments (${arguments.length}) - expects one of (${proto[methodName].overloadTable})!`,\n );\n }\n return proto[methodName].overloadTable[arguments.length].apply(this, arguments);\n };\n proto[methodName].overloadTable = [];\n proto[methodName].overloadTable[prevFunc.argCount] = prevFunc;\n }\n };\n\n /** @param {number=} numArguments */ var exposePublicSymbol = (name, value, numArguments) => {\n if (Module.hasOwnProperty(name)) {\n if (\n undefined === numArguments ||\n (undefined !== Module[name].overloadTable && undefined !== Module[name].overloadTable[numArguments])\n ) {\n throwBindingError(`Cannot register public name '${name}' twice`);\n }\n ensureOverloadTable(Module, name, name);\n if (Module.hasOwnProperty(numArguments)) {\n throwBindingError(\n `Cannot register multiple overloads of a function with the same number of arguments (${numArguments})!`,\n );\n }\n Module[name].overloadTable[numArguments] = value;\n } else {\n Module[name] = value;\n if (undefined !== numArguments) {\n Module[name].numArguments = numArguments;\n }\n }\n };\n\n /** @constructor */ function RegisteredClass(\n name,\n constructor,\n instancePrototype,\n rawDestructor,\n baseClass,\n getActualType,\n upcast,\n downcast,\n ) {\n this.name = name;\n this.constructor = constructor;\n this.instancePrototype = instancePrototype;\n this.rawDestructor = rawDestructor;\n this.baseClass = baseClass;\n this.getActualType = getActualType;\n this.upcast = upcast;\n this.downcast = downcast;\n this.pureVirtualFunctions = [];\n }\n\n var upcastPointer = (ptr, ptrClass, desiredClass) => {\n while (ptrClass !== desiredClass) {\n if (!ptrClass.upcast) {\n throwBindingError(`Expected null or instance of ${desiredClass.name}, got an instance of ${ptrClass.name}`);\n }\n ptr = ptrClass.upcast(ptr);\n ptrClass = ptrClass.baseClass;\n }\n return ptr;\n };\n\n /** @suppress {globalThis} */ function constNoSmartPtrRawPointerToWireType(destructors, handle) {\n if (handle === null) {\n if (this.isReference) {\n throwBindingError(`null is not a valid ${this.name}`);\n }\n return 0;\n }\n if (!handle.$$) {\n throwBindingError(`Cannot pass \"${embindRepr(handle)}\" as a ${this.name}`);\n }\n if (!handle.$$.ptr) {\n throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`);\n }\n var handleClass = handle.$$.ptrType.registeredClass;\n var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass);\n return ptr;\n }\n\n /** @suppress {globalThis} */ function genericPointerToWireType(destructors, handle) {\n var ptr;\n if (handle === null) {\n if (this.isReference) {\n throwBindingError(`null is not a valid ${this.name}`);\n }\n if (this.isSmartPointer) {\n ptr = this.rawConstructor();\n if (destructors !== null) {\n destructors.push(this.rawDestructor, ptr);\n }\n return ptr;\n } else {\n return 0;\n }\n }\n if (!handle.$$) {\n throwBindingError(`Cannot pass \"${embindRepr(handle)}\" as a ${this.name}`);\n }\n if (!handle.$$.ptr) {\n throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`);\n }\n if (!this.isConst && handle.$$.ptrType.isConst) {\n throwBindingError(\n `Cannot convert argument of type ${\n handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name\n } to parameter type ${this.name}`,\n );\n }\n var handleClass = handle.$$.ptrType.registeredClass;\n ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass);\n if (this.isSmartPointer) {\n if (undefined === handle.$$.smartPtr) {\n throwBindingError('Passing raw pointer to smart pointer is illegal');\n }\n switch (this.sharingPolicy) {\n case 0:\n if (handle.$$.smartPtrType === this) {\n ptr = handle.$$.smartPtr;\n } else {\n throwBindingError(\n `Cannot convert argument of type ${\n handle.$$.smartPtrType ? handle.$$.smartPtrType.name : handle.$$.ptrType.name\n } to parameter type ${this.name}`,\n );\n }\n break;\n\n case 1:\n ptr = handle.$$.smartPtr;\n break;\n\n case 2:\n if (handle.$$.smartPtrType === this) {\n ptr = handle.$$.smartPtr;\n } else {\n var clonedHandle = handle['clone']();\n ptr = this.rawShare(\n ptr,\n Emval.toHandle(() => clonedHandle['delete']()),\n );\n if (destructors !== null) {\n destructors.push(this.rawDestructor, ptr);\n }\n }\n break;\n\n default:\n throwBindingError('Unsupporting sharing policy');\n }\n }\n return ptr;\n }\n\n /** @suppress {globalThis} */ function nonConstNoSmartPtrRawPointerToWireType(destructors, handle) {\n if (handle === null) {\n if (this.isReference) {\n throwBindingError(`null is not a valid ${this.name}`);\n }\n return 0;\n }\n if (!handle.$$) {\n throwBindingError(`Cannot pass \"${embindRepr(handle)}\" as a ${this.name}`);\n }\n if (!handle.$$.ptr) {\n throwBindingError(`Cannot pass deleted object as a pointer of type ${this.name}`);\n }\n if (handle.$$.ptrType.isConst) {\n throwBindingError(`Cannot convert argument of type ${handle.$$.ptrType.name} to parameter type ${this.name}`);\n }\n var handleClass = handle.$$.ptrType.registeredClass;\n var ptr = upcastPointer(handle.$$.ptr, handleClass, this.registeredClass);\n return ptr;\n }\n\n /** @suppress {globalThis} */ function readPointer(pointer) {\n return this['fromWireType'](HEAPU32[pointer >> 2]);\n }\n\n var init_RegisteredPointer = () => {\n Object.assign(RegisteredPointer.prototype, {\n getPointee(ptr) {\n if (this.rawGetPointee) {\n ptr = this.rawGetPointee(ptr);\n }\n return ptr;\n },\n destructor(ptr) {\n if (this.rawDestructor) {\n this.rawDestructor(ptr);\n }\n },\n argPackAdvance: GenericWireTypeSize,\n readValueFromPointer: readPointer,\n deleteObject(handle) {\n if (handle !== null) {\n handle['delete']();\n }\n },\n fromWireType: RegisteredPointer_fromWireType,\n });\n };\n\n /** @constructor\n @param {*=} pointeeType,\n @param {*=} sharingPolicy,\n @param {*=} rawGetPointee,\n @param {*=} rawConstructor,\n @param {*=} rawShare,\n @param {*=} rawDestructor,\n */ function RegisteredPointer(\n name,\n registeredClass,\n isReference,\n isConst,\n isSmartPointer,\n pointeeType,\n sharingPolicy,\n rawGetPointee,\n rawConstructor,\n rawShare,\n rawDestructor,\n ) {\n this.name = name;\n this.registeredClass = registeredClass;\n this.isReference = isReference;\n this.isConst = isConst;\n this.isSmartPointer = isSmartPointer;\n this.pointeeType = pointeeType;\n this.sharingPolicy = sharingPolicy;\n this.rawGetPointee = rawGetPointee;\n this.rawConstructor = rawConstructor;\n this.rawShare = rawShare;\n this.rawDestructor = rawDestructor;\n if (!isSmartPointer && registeredClass.baseClass === undefined) {\n if (isConst) {\n this['toWireType'] = constNoSmartPtrRawPointerToWireType;\n this.destructorFunction = null;\n } else {\n this['toWireType'] = nonConstNoSmartPtrRawPointerToWireType;\n this.destructorFunction = null;\n }\n } else {\n this['toWireType'] = genericPointerToWireType;\n }\n }\n\n /** @param {number=} numArguments */ var replacePublicSymbol = (name, value, numArguments) => {\n if (!Module.hasOwnProperty(name)) {\n throwInternalError('Replacing nonexistant public symbol');\n }\n if (undefined !== Module[name].overloadTable && undefined !== numArguments) {\n Module[name].overloadTable[numArguments] = value;\n } else {\n Module[name] = value;\n Module[name].argCount = numArguments;\n }\n };\n\n var dynCallLegacy = (sig, ptr, args) => {\n var f = Module['dynCall_' + sig];\n return args && args.length ? f.apply(null, [ptr].concat(args)) : f.call(null, ptr);\n };\n\n var wasmTable;\n\n var getWasmTableEntry = (funcPtr) => wasmTable.get(funcPtr);\n\n /** @param {Object=} args */ var dynCall = (sig, ptr, args) => {\n if (sig.includes('j')) {\n return dynCallLegacy(sig, ptr, args);\n }\n var rtn = getWasmTableEntry(ptr).apply(null, args);\n return rtn;\n };\n\n var getDynCaller = (sig, ptr) => {\n var argCache = [];\n return function () {\n argCache.length = 0;\n Object.assign(argCache, arguments);\n return dynCall(sig, ptr, argCache);\n };\n };\n\n var embind__requireFunction = (signature, rawFunction) => {\n signature = readLatin1String(signature);\n function makeDynCaller() {\n if (signature.includes('j')) {\n return getDynCaller(signature, rawFunction);\n }\n return getWasmTableEntry(rawFunction);\n }\n var fp = makeDynCaller();\n if (typeof fp != 'function') {\n throwBindingError(`unknown function pointer with signature ${signature}: ${rawFunction}`);\n }\n return fp;\n };\n\n var extendError = (baseErrorType, errorName) => {\n var errorClass = createNamedFunction(errorName, function (message) {\n this.name = errorName;\n this.message = message;\n var stack = new Error(message).stack;\n if (stack !== undefined) {\n this.stack = this.toString() + '\\n' + stack.replace(/^Error(:[^\\n]*)?\\n/, '');\n }\n });\n errorClass.prototype = Object.create(baseErrorType.prototype);\n errorClass.prototype.constructor = errorClass;\n errorClass.prototype.toString = function () {\n if (this.message === undefined) {\n return this.name;\n } else {\n return `${this.name}: ${this.message}`;\n }\n };\n return errorClass;\n };\n\n var UnboundTypeError;\n\n var getTypeName = (type) => {\n var ptr = ___getTypeName(type);\n var rv = readLatin1String(ptr);\n _free(ptr);\n return rv;\n };\n\n var throwUnboundTypeError = (message, types) => {\n var unboundTypes = [];\n var seen = {};\n function visit(type) {\n if (seen[type]) {\n return;\n }\n if (registeredTypes[type]) {\n return;\n }\n if (typeDependencies[type]) {\n typeDependencies[type].forEach(visit);\n return;\n }\n unboundTypes.push(type);\n seen[type] = true;\n }\n types.forEach(visit);\n throw new UnboundTypeError(`${message}: ` + unboundTypes.map(getTypeName).join([', ']));\n };\n\n var __embind_register_class = (\n rawType,\n rawPointerType,\n rawConstPointerType,\n baseClassRawType,\n getActualTypeSignature,\n getActualType,\n upcastSignature,\n upcast,\n downcastSignature,\n downcast,\n name,\n destructorSignature,\n rawDestructor,\n ) => {\n name = readLatin1String(name);\n getActualType = embind__requireFunction(getActualTypeSignature, getActualType);\n if (upcast) {\n upcast = embind__requireFunction(upcastSignature, upcast);\n }\n if (downcast) {\n downcast = embind__requireFunction(downcastSignature, downcast);\n }\n rawDestructor = embind__requireFunction(destructorSignature, rawDestructor);\n var legalFunctionName = makeLegalFunctionName(name);\n exposePublicSymbol(legalFunctionName, function () {\n throwUnboundTypeError(`Cannot construct ${name} due to unbound types`, [baseClassRawType]);\n });\n whenDependentTypesAreResolved(\n [rawType, rawPointerType, rawConstPointerType],\n baseClassRawType ? [baseClassRawType] : [],\n function (base) {\n base = base[0];\n var baseClass;\n var basePrototype;\n if (baseClassRawType) {\n baseClass = base.registeredClass;\n basePrototype = baseClass.instancePrototype;\n } else {\n basePrototype = ClassHandle.prototype;\n }\n var constructor = createNamedFunction(legalFunctionName, function () {\n if (Object.getPrototypeOf(this) !== instancePrototype) {\n throw new BindingError(\"Use 'new' to construct \" + name);\n }\n if (undefined === registeredClass.constructor_body) {\n throw new BindingError(name + ' has no accessible constructor');\n }\n var body = registeredClass.constructor_body[arguments.length];\n if (undefined === body) {\n throw new BindingError(\n `Tried to invoke ctor of ${name} with invalid number of parameters (${\n arguments.length\n }) - expected (${Object.keys(registeredClass.constructor_body).toString()}) parameters instead!`,\n );\n }\n return body.apply(this, arguments);\n });\n var instancePrototype = Object.create(basePrototype, {\n constructor: {\n value: constructor,\n },\n });\n constructor.prototype = instancePrototype;\n var registeredClass = new RegisteredClass(\n name,\n constructor,\n instancePrototype,\n rawDestructor,\n baseClass,\n getActualType,\n upcast,\n downcast,\n );\n if (registeredClass.baseClass) {\n if (registeredClass.baseClass.__derivedClasses === undefined) {\n registeredClass.baseClass.__derivedClasses = [];\n }\n registeredClass.baseClass.__derivedClasses.push(registeredClass);\n }\n var referenceConverter = new RegisteredPointer(name, registeredClass, true, false, false);\n var pointerConverter = new RegisteredPointer(name + '*', registeredClass, false, false, false);\n var constPointerConverter = new RegisteredPointer(name + ' const*', registeredClass, false, true, false);\n registeredPointers[rawType] = {\n pointerType: pointerConverter,\n constPointerType: constPointerConverter,\n };\n replacePublicSymbol(legalFunctionName, constructor);\n return [referenceConverter, pointerConverter, constPointerConverter];\n },\n );\n };\n\n var heap32VectorToArray = (count, firstElement) => {\n var array = [];\n for (var i = 0; i < count; i++) {\n array.push(HEAPU32[(firstElement + i * 4) >> 2]);\n }\n return array;\n };\n\n var runDestructors = (destructors) => {\n while (destructors.length) {\n var ptr = destructors.pop();\n var del = destructors.pop();\n del(ptr);\n }\n };\n\n function craftInvokerFunction(\n humanName,\n argTypes,\n classType,\n cppInvokerFunc,\n cppTargetFunc,\n /** boolean= */ isAsync,\n ) {\n var argCount = argTypes.length;\n if (argCount < 2) {\n throwBindingError(\"argTypes array size mismatch! Must at least get return value and 'this' types!\");\n }\n var isClassMethodFunc = argTypes[1] !== null && classType !== null;\n var needsDestructorStack = false;\n for (var i = 1; i < argTypes.length; ++i) {\n if (argTypes[i] !== null && argTypes[i].destructorFunction === undefined) {\n needsDestructorStack = true;\n break;\n }\n }\n var returns = argTypes[0].name !== 'void';\n var expectedArgCount = argCount - 2;\n var argsWired = new Array(expectedArgCount);\n var invokerFuncArgs = [];\n var destructors = [];\n return function () {\n if (arguments.length !== expectedArgCount) {\n throwBindingError(\n `function ${humanName} called with ${arguments.length} arguments, expected ${expectedArgCount}`,\n );\n }\n destructors.length = 0;\n var thisWired;\n invokerFuncArgs.length = isClassMethodFunc ? 2 : 1;\n invokerFuncArgs[0] = cppTargetFunc;\n if (isClassMethodFunc) {\n thisWired = argTypes[1]['toWireType'](destructors, this);\n invokerFuncArgs[1] = thisWired;\n }\n for (var i = 0; i < expectedArgCount; ++i) {\n argsWired[i] = argTypes[i + 2]['toWireType'](destructors, arguments[i]);\n invokerFuncArgs.push(argsWired[i]);\n }\n var rv = cppInvokerFunc.apply(null, invokerFuncArgs);\n function onDone(rv) {\n if (needsDestructorStack) {\n runDestructors(destructors);\n } else {\n for (var i = isClassMethodFunc ? 1 : 2; i < argTypes.length; i++) {\n var param = i === 1 ? thisWired : argsWired[i - 2];\n if (argTypes[i].destructorFunction !== null) {\n argTypes[i].destructorFunction(param);\n }\n }\n }\n if (returns) {\n return argTypes[0]['fromWireType'](rv);\n }\n }\n return onDone(rv);\n };\n }\n\n var __embind_register_class_constructor = (\n rawClassType,\n argCount,\n rawArgTypesAddr,\n invokerSignature,\n invoker,\n rawConstructor,\n ) => {\n var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr);\n invoker = embind__requireFunction(invokerSignature, invoker);\n whenDependentTypesAreResolved([], [rawClassType], function (classType) {\n classType = classType[0];\n var humanName = `constructor ${classType.name}`;\n if (undefined === classType.registeredClass.constructor_body) {\n classType.registeredClass.constructor_body = [];\n }\n if (undefined !== classType.registeredClass.constructor_body[argCount - 1]) {\n throw new BindingError(\n `Cannot register multiple constructors with identical number of parameters (${argCount - 1}) for class '${\n classType.name\n }'! Overload resolution is currently only performed using the parameter count, not actual type info!`,\n );\n }\n classType.registeredClass.constructor_body[argCount - 1] = () => {\n throwUnboundTypeError(`Cannot construct ${classType.name} due to unbound types`, rawArgTypes);\n };\n whenDependentTypesAreResolved([], rawArgTypes, (argTypes) => {\n argTypes.splice(1, 0, null);\n classType.registeredClass.constructor_body[argCount - 1] = craftInvokerFunction(\n humanName,\n argTypes,\n null,\n invoker,\n rawConstructor,\n );\n return [];\n });\n return [];\n });\n };\n\n var getFunctionName = (signature) => {\n signature = signature.trim();\n const argsIndex = signature.indexOf('(');\n if (argsIndex !== -1) {\n assert(signature[signature.length - 1] == ')', 'Parentheses for argument names should match.');\n return signature.substr(0, argsIndex);\n } else {\n return signature;\n }\n };\n\n var __embind_register_class_function = (\n rawClassType,\n methodName,\n argCount,\n rawArgTypesAddr,\n invokerSignature,\n rawInvoker,\n context,\n isPureVirtual,\n isAsync,\n ) => {\n var rawArgTypes = heap32VectorToArray(argCount, rawArgTypesAddr);\n methodName = readLatin1String(methodName);\n methodName = getFunctionName(methodName);\n rawInvoker = embind__requireFunction(invokerSignature, rawInvoker);\n whenDependentTypesAreResolved([], [rawClassType], function (classType) {\n classType = classType[0];\n var humanName = `${classType.name}.${methodName}`;\n if (methodName.startsWith('@@')) {\n methodName = Symbol[methodName.substring(2)];\n }\n if (isPureVirtual) {\n classType.registeredClass.pureVirtualFunctions.push(methodName);\n }\n function unboundTypesHandler() {\n throwUnboundTypeError(`Cannot call ${humanName} due to unbound types`, rawArgTypes);\n }\n var proto = classType.registeredClass.instancePrototype;\n var method = proto[methodName];\n if (\n undefined === method ||\n (undefined === method.overloadTable &&\n method.className !== classType.name &&\n method.argCount === argCount - 2)\n ) {\n unboundTypesHandler.argCount = argCount - 2;\n unboundTypesHandler.className = classType.name;\n proto[methodName] = unboundTypesHandler;\n } else {\n ensureOverloadTable(proto, methodName, humanName);\n proto[methodName].overloadTable[argCount - 2] = unboundTypesHandler;\n }\n whenDependentTypesAreResolved([], rawArgTypes, function (argTypes) {\n var memberFunction = craftInvokerFunction(humanName, argTypes, classType, rawInvoker, context, isAsync);\n if (undefined === proto[methodName].overloadTable) {\n memberFunction.argCount = argCount - 2;\n proto[methodName] = memberFunction;\n } else {\n proto[methodName].overloadTable[argCount - 2] = memberFunction;\n }\n return [];\n });\n return [];\n });\n };\n\n function handleAllocatorInit() {\n Object.assign(\n HandleAllocator.prototype,\n /** @lends {HandleAllocator.prototype} */ {\n get(id) {\n return this.allocated[id];\n },\n has(id) {\n return this.allocated[id] !== undefined;\n },\n allocate(handle) {\n var id = this.freelist.pop() || this.allocated.length;\n this.allocated[id] = handle;\n return id;\n },\n free(id) {\n this.allocated[id] = undefined;\n this.freelist.push(id);\n },\n },\n );\n }\n\n /** @constructor */ function HandleAllocator() {\n this.allocated = [undefined];\n this.freelist = [];\n }\n\n var emval_handles = new HandleAllocator();\n\n var __emval_decref = (handle) => {\n if (handle >= emval_handles.reserved && 0 === --emval_handles.get(handle).refcount) {\n emval_handles.free(handle);\n }\n };\n\n var count_emval_handles = () => {\n var count = 0;\n for (var i = emval_handles.reserved; i < emval_handles.allocated.length; ++i) {\n if (emval_handles.allocated[i] !== undefined) {\n ++count;\n }\n }\n return count;\n };\n\n var init_emval = () => {\n emval_handles.allocated.push(\n {\n value: undefined,\n },\n {\n value: null,\n },\n {\n value: true,\n },\n {\n value: false,\n },\n );\n emval_handles.reserved = emval_handles.allocated.length;\n Module['count_emval_handles'] = count_emval_handles;\n };\n\n var Emval = {\n toValue: (handle) => {\n if (!handle) {\n throwBindingError('Cannot use deleted val. handle = ' + handle);\n }\n return emval_handles.get(handle).value;\n },\n toHandle: (value) => {\n switch (value) {\n case undefined:\n return 1;\n\n case null:\n return 2;\n\n case true:\n return 3;\n\n case false:\n return 4;\n\n default: {\n return emval_handles.allocate({\n refcount: 1,\n value: value,\n });\n }\n }\n },\n };\n\n /** @suppress {globalThis} */ function simpleReadValueFromPointer(pointer) {\n return this['fromWireType'](HEAP32[pointer >> 2]);\n }\n\n var __embind_register_emval = (rawType, name) => {\n name = readLatin1String(name);\n registerType(rawType, {\n name: name,\n fromWireType: (handle) => {\n var rv = Emval.toValue(handle);\n __emval_decref(handle);\n return rv;\n },\n toWireType: (destructors, value) => Emval.toHandle(value),\n argPackAdvance: GenericWireTypeSize,\n readValueFromPointer: simpleReadValueFromPointer,\n destructorFunction: null,\n });\n };\n\n var embindRepr = (v) => {\n if (v === null) {\n return 'null';\n }\n var t = typeof v;\n if (t === 'object' || t === 'array' || t === 'function') {\n return v.toString();\n } else {\n return '' + v;\n }\n };\n\n var floatReadValueFromPointer = (name, width) => {\n switch (width) {\n case 4:\n return function (pointer) {\n return this['fromWireType'](HEAPF32[pointer >> 2]);\n };\n\n case 8:\n return function (pointer) {\n return this['fromWireType'](HEAPF64[pointer >> 3]);\n };\n\n default:\n throw new TypeError(`invalid float width (${width}): ${name}`);\n }\n };\n\n var __embind_register_float = (rawType, name, size) => {\n name = readLatin1String(name);\n registerType(rawType, {\n name: name,\n fromWireType: (value) => value,\n toWireType: (destructors, value) => value,\n argPackAdvance: GenericWireTypeSize,\n readValueFromPointer: floatReadValueFromPointer(name, size),\n destructorFunction: null,\n });\n };\n\n var integerReadValueFromPointer = (name, width, signed) => {\n switch (width) {\n case 1:\n return signed ? (pointer) => HEAP8[pointer >> 0] : (pointer) => HEAPU8[pointer >> 0];\n\n case 2:\n return signed ? (pointer) => HEAP16[pointer >> 1] : (pointer) => HEAPU16[pointer >> 1];\n\n case 4:\n return signed ? (pointer) => HEAP32[pointer >> 2] : (pointer) => HEAPU32[pointer >> 2];\n\n default:\n throw new TypeError(`invalid integer width (${width}): ${name}`);\n }\n };\n\n /** @suppress {globalThis} */ var __embind_register_integer = (primitiveType, name, size, minRange, maxRange) => {\n name = readLatin1String(name);\n if (maxRange === -1) {\n maxRange = 4294967295;\n }\n var fromWireType = (value) => value;\n if (minRange === 0) {\n var bitshift = 32 - 8 * size;\n fromWireType = (value) => (value << bitshift) >>> bitshift;\n }\n var isUnsignedType = name.includes('unsigned');\n var checkAssertions = (value, toTypeName) => {};\n var toWireType;\n if (isUnsignedType) {\n toWireType = function (destructors, value) {\n checkAssertions(value, this.name);\n return value >>> 0;\n };\n } else {\n toWireType = function (destructors, value) {\n checkAssertions(value, this.name);\n return value;\n };\n }\n registerType(primitiveType, {\n name: name,\n fromWireType: fromWireType,\n toWireType: toWireType,\n argPackAdvance: GenericWireTypeSize,\n readValueFromPointer: integerReadValueFromPointer(name, size, minRange !== 0),\n destructorFunction: null,\n });\n };\n\n var __embind_register_memory_view = (rawType, dataTypeIndex, name) => {\n var typeMapping = [\n Int8Array,\n Uint8Array,\n Int16Array,\n Uint16Array,\n Int32Array,\n Uint32Array,\n Float32Array,\n Float64Array,\n ];\n var TA = typeMapping[dataTypeIndex];\n function decodeMemoryView(handle) {\n var size = HEAPU32[handle >> 2];\n var data = HEAPU32[(handle + 4) >> 2];\n return new TA(HEAP8.buffer, data, size);\n }\n name = readLatin1String(name);\n registerType(\n rawType,\n {\n name: name,\n fromWireType: decodeMemoryView,\n argPackAdvance: GenericWireTypeSize,\n readValueFromPointer: decodeMemoryView,\n },\n {\n ignoreDuplicateRegistrations: true,\n },\n );\n };\n\n var stringToUTF8Array = (str, heap, outIdx, maxBytesToWrite) => {\n if (!(maxBytesToWrite > 0)) return 0;\n var startIdx = outIdx;\n var endIdx = outIdx + maxBytesToWrite - 1;\n for (var i = 0; i < str.length; ++i) {\n var u = str.charCodeAt(i);\n if (u >= 55296 && u <= 57343) {\n var u1 = str.charCodeAt(++i);\n u = (65536 + ((u & 1023) << 10)) | (u1 & 1023);\n }\n if (u <= 127) {\n if (outIdx >= endIdx) break;\n heap[outIdx++] = u;\n } else if (u <= 2047) {\n if (outIdx + 1 >= endIdx) break;\n heap[outIdx++] = 192 | (u >> 6);\n heap[outIdx++] = 128 | (u & 63);\n } else if (u <= 65535) {\n if (outIdx + 2 >= endIdx) break;\n heap[outIdx++] = 224 | (u >> 12);\n heap[outIdx++] = 128 | ((u >> 6) & 63);\n heap[outIdx++] = 128 | (u & 63);\n } else {\n if (outIdx + 3 >= endIdx) break;\n heap[outIdx++] = 240 | (u >> 18);\n heap[outIdx++] = 128 | ((u >> 12) & 63);\n heap[outIdx++] = 128 | ((u >> 6) & 63);\n heap[outIdx++] = 128 | (u & 63);\n }\n }\n heap[outIdx] = 0;\n return outIdx - startIdx;\n };\n\n var stringToUTF8 = (str, outPtr, maxBytesToWrite) => stringToUTF8Array(str, HEAPU8, outPtr, maxBytesToWrite);\n\n var lengthBytesUTF8 = (str) => {\n var len = 0;\n for (var i = 0; i < str.length; ++i) {\n var c = str.charCodeAt(i);\n if (c <= 127) {\n len++;\n } else if (c <= 2047) {\n len += 2;\n } else if (c >= 55296 && c <= 57343) {\n len += 4;\n ++i;\n } else {\n len += 3;\n }\n }\n return len;\n };\n\n var __embind_register_std_string = (rawType, name) => {\n name = readLatin1String(name);\n var stdStringIsUTF8 = name === 'std::string';\n registerType(rawType, {\n name: name,\n fromWireType(value) {\n var length = HEAPU32[value >> 2];\n var payload = value + 4;\n var str;\n if (stdStringIsUTF8) {\n var decodeStartPtr = payload;\n for (var i = 0; i <= length; ++i) {\n var currentBytePtr = payload + i;\n if (i == length || HEAPU8[currentBytePtr] == 0) {\n var maxRead = currentBytePtr - decodeStartPtr;\n var stringSegment = UTF8ToString(decodeStartPtr, maxRead);\n if (str === undefined) {\n str = stringSegment;\n } else {\n str += String.fromCharCode(0);\n str += stringSegment;\n }\n decodeStartPtr = currentBytePtr + 1;\n }\n }\n } else {\n var a = new Array(length);\n for (var i = 0; i < length; ++i) {\n a[i] = String.fromCharCode(HEAPU8[payload + i]);\n }\n str = a.join('');\n }\n _free(value);\n return str;\n },\n toWireType(destructors, value) {\n if (value instanceof ArrayBuffer) {\n value = new Uint8Array(value);\n }\n var length;\n var valueIsOfTypeString = typeof value == 'string';\n if (\n !(\n valueIsOfTypeString ||\n value instanceof Uint8Array ||\n value instanceof Uint8ClampedArray ||\n value instanceof Int8Array\n )\n ) {\n throwBindingError('Cannot pass non-string to std::string');\n }\n if (stdStringIsUTF8 && valueIsOfTypeString) {\n length = lengthBytesUTF8(value);\n } else {\n length = value.length;\n }\n var base = _malloc(4 + length + 1);\n var ptr = base + 4;\n HEAPU32[base >> 2] = length;\n if (stdStringIsUTF8 && valueIsOfTypeString) {\n stringToUTF8(value, ptr, length + 1);\n } else {\n if (valueIsOfTypeString) {\n for (var i = 0; i < length; ++i) {\n var charCode = value.charCodeAt(i);\n if (charCode > 255) {\n _free(ptr);\n throwBindingError('String has UTF-16 code units that do not fit in 8 bits');\n }\n HEAPU8[ptr + i] = charCode;\n }\n } else {\n for (var i = 0; i < length; ++i) {\n HEAPU8[ptr + i] = value[i];\n }\n }\n }\n if (destructors !== null) {\n destructors.push(_free, base);\n }\n return base;\n },\n argPackAdvance: GenericWireTypeSize,\n readValueFromPointer: readPointer,\n destructorFunction(ptr) {\n _free(ptr);\n },\n });\n };\n\n var UTF16Decoder = typeof TextDecoder != 'undefined' ? new TextDecoder('utf-16le') : undefined;\n\n var UTF16ToString = (ptr, maxBytesToRead) => {\n var endPtr = ptr;\n var idx = endPtr >> 1;\n var maxIdx = idx + maxBytesToRead / 2;\n while (!(idx >= maxIdx) && HEAPU16[idx]) ++idx;\n endPtr = idx << 1;\n if (endPtr - ptr > 32 && UTF16Decoder) return UTF16Decoder.decode(HEAPU8.subarray(ptr, endPtr));\n var str = '';\n for (var i = 0; !(i >= maxBytesToRead / 2); ++i) {\n var codeUnit = HEAP16[(ptr + i * 2) >> 1];\n if (codeUnit == 0) break;\n str += String.fromCharCode(codeUnit);\n }\n return str;\n };\n\n var stringToUTF16 = (str, outPtr, maxBytesToWrite) => {\n if (maxBytesToWrite === undefined) {\n maxBytesToWrite = 2147483647;\n }\n if (maxBytesToWrite < 2) return 0;\n maxBytesToWrite -= 2;\n var startPtr = outPtr;\n var numCharsToWrite = maxBytesToWrite < str.length * 2 ? maxBytesToWrite / 2 : str.length;\n for (var i = 0; i < numCharsToWrite; ++i) {\n var codeUnit = str.charCodeAt(i);\n HEAP16[outPtr >> 1] = codeUnit;\n outPtr += 2;\n }\n HEAP16[outPtr >> 1] = 0;\n return outPtr - startPtr;\n };\n\n var lengthBytesUTF16 = (str) => str.length * 2;\n\n var UTF32ToString = (ptr, maxBytesToRead) => {\n var i = 0;\n var str = '';\n while (!(i >= maxBytesToRead / 4)) {\n var utf32 = HEAP32[(ptr + i * 4) >> 2];\n if (utf32 == 0) break;\n ++i;\n if (utf32 >= 65536) {\n var ch = utf32 - 65536;\n str += String.fromCharCode(55296 | (ch >> 10), 56320 | (ch & 1023));\n } else {\n str += String.fromCharCode(utf32);\n }\n }\n return str;\n };\n\n var stringToUTF32 = (str, outPtr, maxBytesToWrite) => {\n if (maxBytesToWrite === undefined) {\n maxBytesToWrite = 2147483647;\n }\n if (maxBytesToWrite < 4) return 0;\n var startPtr = outPtr;\n var endPtr = startPtr + maxBytesToWrite - 4;\n for (var i = 0; i < str.length; ++i) {\n var codeUnit = str.charCodeAt(i);\n if (codeUnit >= 55296 && codeUnit <= 57343) {\n var trailSurrogate = str.charCodeAt(++i);\n codeUnit = (65536 + ((codeUnit & 1023) << 10)) | (trailSurrogate & 1023);\n }\n HEAP32[outPtr >> 2] = codeUnit;\n outPtr += 4;\n if (outPtr + 4 > endPtr) break;\n }\n HEAP32[outPtr >> 2] = 0;\n return outPtr - startPtr;\n };\n\n var lengthBytesUTF32 = (str) => {\n var len = 0;\n for (var i = 0; i < str.length; ++i) {\n var codeUnit = str.charCodeAt(i);\n if (codeUnit >= 55296 && codeUnit <= 57343) ++i;\n len += 4;\n }\n return len;\n };\n\n var __embind_register_std_wstring = (rawType, charSize, name) => {\n name = readLatin1String(name);\n var decodeString, encodeString, getHeap, lengthBytesUTF, shift;\n if (charSize === 2) {\n decodeString = UTF16ToString;\n encodeString = stringToUTF16;\n lengthBytesUTF = lengthBytesUTF16;\n getHeap = () => HEAPU16;\n shift = 1;\n } else if (charSize === 4) {\n decodeString = UTF32ToString;\n encodeString = stringToUTF32;\n lengthBytesUTF = lengthBytesUTF32;\n getHeap = () => HEAPU32;\n shift = 2;\n }\n registerType(rawType, {\n name: name,\n fromWireType: (value) => {\n var length = HEAPU32[value >> 2];\n var HEAP = getHeap();\n var str;\n var decodeStartPtr = value + 4;\n for (var i = 0; i <= length; ++i) {\n var currentBytePtr = value + 4 + i * charSize;\n if (i == length || HEAP[currentBytePtr >> shift] == 0) {\n var maxReadBytes = currentBytePtr - decodeStartPtr;\n var stringSegment = decodeString(decodeStartPtr, maxReadBytes);\n if (str === undefined) {\n str = stringSegment;\n } else {\n str += String.fromCharCode(0);\n str += stringSegment;\n }\n decodeStartPtr = currentBytePtr + charSize;\n }\n }\n _free(value);\n return str;\n },\n toWireType: (destructors, value) => {\n if (!(typeof value == 'string')) {\n throwBindingError(`Cannot pass non-string to C++ string type ${name}`);\n }\n var length = lengthBytesUTF(value);\n var ptr = _malloc(4 + length + charSize);\n HEAPU32[ptr >> 2] = length >> shift;\n encodeString(value, ptr + 4, length + charSize);\n if (destructors !== null) {\n destructors.push(_free, ptr);\n }\n return ptr;\n },\n argPackAdvance: GenericWireTypeSize,\n readValueFromPointer: simpleReadValueFromPointer,\n destructorFunction(ptr) {\n _free(ptr);\n },\n });\n };\n\n var __embind_register_void = (rawType, name) => {\n name = readLatin1String(name);\n registerType(rawType, {\n isVoid: true,\n name: name,\n argPackAdvance: 0,\n fromWireType: () => undefined,\n toWireType: (destructors, o) => undefined,\n });\n };\n\n var __emscripten_throw_longjmp = () => {\n throw Infinity;\n };\n\n var __emval_incref = (handle) => {\n if (handle > 4) {\n emval_handles.get(handle).refcount += 1;\n }\n };\n\n var requireRegisteredType = (rawType, humanName) => {\n var impl = registeredTypes[rawType];\n if (undefined === impl) {\n throwBindingError(humanName + ' has unknown type ' + getTypeName(rawType));\n }\n return impl;\n };\n\n var __emval_take_value = (type, arg) => {\n type = requireRegisteredType(type, '_emval_take_value');\n var v = type['readValueFromPointer'](arg);\n return Emval.toHandle(v);\n };\n\n var _abort = () => {\n abort('');\n };\n\n var _emscripten_memcpy_js = (dest, src, num) => HEAPU8.copyWithin(dest, src, src + num);\n\n var getHeapMax = () => 2147483648;\n\n var growMemory = (size) => {\n var b = wasmMemory.buffer;\n var pages = (size - b.byteLength + 65535) / 65536;\n try {\n wasmMemory.grow(pages);\n updateMemoryViews();\n return 1;\n } /*success*/ catch (e) {}\n };\n\n var _emscripten_resize_heap = (requestedSize) => {\n var oldSize = HEAPU8.length;\n requestedSize >>>= 0;\n var maxHeapSize = getHeapMax();\n if (requestedSize > maxHeapSize) {\n return false;\n }\n var alignUp = (x, multiple) => x + ((multiple - (x % multiple)) % multiple);\n for (var cutDown = 1; cutDown <= 4; cutDown *= 2) {\n var overGrownHeapSize = oldSize * (1 + 0.2 / cutDown);\n overGrownHeapSize = Math.min(overGrownHeapSize, requestedSize + 100663296);\n var newSize = Math.min(maxHeapSize, alignUp(Math.max(requestedSize, overGrownHeapSize), 65536));\n var replacement = growMemory(newSize);\n if (replacement) {\n return true;\n }\n }\n return false;\n };\n\n var _fd_close = (fd) => 52;\n\n var _fd_read = (fd, iov, iovcnt, pnum) => 52;\n\n var convertI32PairToI53Checked = (lo, hi) =>\n (hi + 2097152) >>> 0 < 4194305 - !!lo ? (lo >>> 0) + hi * 4294967296 : NaN;\n\n function _fd_seek(fd, offset_low, offset_high, whence, newOffset) {\n var offset = convertI32PairToI53Checked(offset_low, offset_high);\n return 70;\n }\n\n var printCharBuffers = [null, [], []];\n\n var printChar = (stream, curr) => {\n var buffer = printCharBuffers[stream];\n if (curr === 0 || curr === 10) {\n (stream === 1 ? out : err)(UTF8ArrayToString(buffer, 0));\n buffer.length = 0;\n } else {\n buffer.push(curr);\n }\n };\n\n var _fd_write = (fd, iov, iovcnt, pnum) => {\n var num = 0;\n for (var i = 0; i < iovcnt; i++) {\n var ptr = HEAPU32[iov >> 2];\n var len = HEAPU32[(iov + 4) >> 2];\n iov += 8;\n for (var j = 0; j < len; j++) {\n printChar(fd, HEAPU8[ptr + j]);\n }\n num += len;\n }\n HEAPU32[pnum >> 2] = num;\n return 0;\n };\n\n embind_init_charCodes();\n\n BindingError = Module['BindingError'] = class BindingError extends Error {\n constructor(message) {\n super(message);\n this.name = 'BindingError';\n }\n };\n\n InternalError = Module['InternalError'] = class InternalError extends Error {\n constructor(message) {\n super(message);\n this.name = 'InternalError';\n }\n };\n\n init_ClassHandle();\n\n init_embind();\n\n init_RegisteredPointer();\n\n UnboundTypeError = Module['UnboundTypeError'] = extendError(Error, 'UnboundTypeError');\n\n handleAllocatorInit();\n\n init_emval();\n\n var wasmImports = {\n /** @export */ b: ___assert_fail,\n /** @export */ n: ___syscall_fcntl64,\n /** @export */ D: ___syscall_ioctl,\n /** @export */ E: ___syscall_openat,\n /** @export */ w: __embind_register_bigint,\n /** @export */ q: __embind_register_bool,\n /** @export */ H: __embind_register_class,\n /** @export */ G: __embind_register_class_constructor,\n /** @export */ e: __embind_register_class_function,\n /** @export */ F: __embind_register_emval,\n /** @export */ o: __embind_register_float,\n /** @export */ f: __embind_register_integer,\n /** @export */ d: __embind_register_memory_view,\n /** @export */ p: __embind_register_std_string,\n /** @export */ k: __embind_register_std_wstring,\n /** @export */ r: __embind_register_void,\n /** @export */ y: __emscripten_throw_longjmp,\n /** @export */ s: __emval_decref,\n /** @export */ t: __emval_incref,\n /** @export */ g: __emval_take_value,\n /** @export */ h: _abort,\n /** @export */ A: _emscripten_memcpy_js,\n /** @export */ z: _emscripten_resize_heap,\n /** @export */ m: _fd_close,\n /** @export */ C: _fd_read,\n /** @export */ v: _fd_seek,\n /** @export */ B: _fd_write,\n /** @export */ j: invoke_ii,\n /** @export */ i: invoke_iiii,\n /** @export */ l: invoke_iiiiii,\n /** @export */ a: invoke_vi,\n /** @export */ c: invoke_vii,\n /** @export */ x: invoke_viiii,\n /** @export */ u: invoke_viiij,\n };\n\n var wasmExports = createWasm();\n\n var ___wasm_call_ctors = () => (___wasm_call_ctors = wasmExports['J'])();\n\n var _free = (a0) => (_free = wasmExports['K'])(a0);\n\n var _malloc = (a0) => (_malloc = wasmExports['L'])(a0);\n\n var ___getTypeName = (a0) => (___getTypeName = wasmExports['M'])(a0);\n\n var __embind_initialize_bindings = (Module['__embind_initialize_bindings'] = () =>\n (__embind_initialize_bindings = Module['__embind_initialize_bindings'] = wasmExports['N'])());\n\n var ___errno_location = () => (___errno_location = wasmExports['__errno_location'])();\n\n var _setThrew = (a0, a1) => (_setThrew = wasmExports['P'])(a0, a1);\n\n var stackSave = () => (stackSave = wasmExports['Q'])();\n\n var stackRestore = (a0) => (stackRestore = wasmExports['R'])(a0);\n\n var ___cxa_increment_exception_refcount = (a0) =>\n (___cxa_increment_exception_refcount = wasmExports['__cxa_increment_exception_refcount'])(a0);\n\n var ___cxa_is_pointer_type = (a0) => (___cxa_is_pointer_type = wasmExports['__cxa_is_pointer_type'])(a0);\n\n var dynCall_viiij = (Module['dynCall_viiij'] = (a0, a1, a2, a3, a4, a5) =>\n (dynCall_viiij = Module['dynCall_viiij'] = wasmExports['S'])(a0, a1, a2, a3, a4, a5));\n\n var dynCall_jiji = (Module['dynCall_jiji'] = (a0, a1, a2, a3, a4) =>\n (dynCall_jiji = Module['dynCall_jiji'] = wasmExports['T'])(a0, a1, a2, a3, a4));\n\n function invoke_vi(index, a1) {\n var sp = stackSave();\n try {\n getWasmTableEntry(index)(a1);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n }\n\n function invoke_vii(index, a1, a2) {\n var sp = stackSave();\n try {\n getWasmTableEntry(index)(a1, a2);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n }\n\n function invoke_ii(index, a1) {\n var sp = stackSave();\n try {\n return getWasmTableEntry(index)(a1);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n }\n\n function invoke_iiii(index, a1, a2, a3) {\n var sp = stackSave();\n try {\n return getWasmTableEntry(index)(a1, a2, a3);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n }\n\n function invoke_iiiiii(index, a1, a2, a3, a4, a5) {\n var sp = stackSave();\n try {\n return getWasmTableEntry(index)(a1, a2, a3, a4, a5);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n }\n\n function invoke_viiii(index, a1, a2, a3, a4) {\n var sp = stackSave();\n try {\n getWasmTableEntry(index)(a1, a2, a3, a4);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n }\n\n function invoke_viiij(index, a1, a2, a3, a4, a5) {\n var sp = stackSave();\n try {\n dynCall_viiij(index, a1, a2, a3, a4, a5);\n } catch (e) {\n stackRestore(sp);\n if (e !== e + 0) throw e;\n _setThrew(1, 0);\n }\n }\n\n var calledRun;\n\n dependenciesFulfilled = function runCaller() {\n if (!calledRun) run();\n if (!calledRun) dependenciesFulfilled = runCaller;\n };\n\n function run() {\n if (runDependencies > 0) {\n return;\n }\n preRun();\n if (runDependencies > 0) {\n return;\n }\n function doRun() {\n if (calledRun) return;\n calledRun = true;\n Module['calledRun'] = true;\n if (ABORT) return;\n initRuntime();\n readyPromiseResolve(Module);\n if (Module['onRuntimeInitialized']) Module['onRuntimeInitialized']();\n postRun();\n }\n if (Module['setStatus']) {\n Module['setStatus']('Running...');\n setTimeout(function () {\n setTimeout(function () {\n Module['setStatus']('');\n }, 1);\n doRun();\n }, 1);\n } else {\n doRun();\n }\n }\n\n if (Module['preInit']) {\n if (typeof Module['preInit'] == 'function') Module['preInit'] = [Module['preInit']];\n while (Module['preInit'].length > 0) {\n Module['preInit'].pop()();\n }\n }\n\n run();\n\n return moduleArg.ready;\n };\n})();\nexport default createRendererModule;\n","/**\n * Copyright 2023 Design Barn Inc.\n */\n\nimport pkg from '../../package.json';\n\nimport createRendererModule from './bin/renderer';\n\nexport interface Renderer {\n duration(): number;\n error(): string;\n frame(no: number): boolean;\n load(data: string, width: number, height: number): boolean;\n render(): Uint8Array;\n resize(width: number, height: number): void;\n size(): Float32Array;\n totalFrames(): number;\n update(): boolean;\n}\n\ninterface Module {\n Renderer: new () => Renderer;\n}\n\n/**\n * WasmLoader is a utility class for loading WebAssembly modules.\n * It provides methods to load modules with a primary URL and a backup URL.\n */\n// eslint-disable-next-line @typescript-eslint/no-extraneous-class\nexport class WasmLoader {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n private static _ModulePromise: Promise<Module> | null = null;\n\n // URL for the WASM file, constructed using package information\n private static _wasmURL = `https://unpkg.com/${pkg.name}@${pkg.version}/dist/renderer.wasm`;\n\n private constructor() {\n throw new Error('WasmLoader is a static class and cannot be instantiated.');\n }\n\n private static async _tryLoad(url: string): Promise<Module> {\n const module = await createRendererModule({ locateFile: () => url });\n\n return module;\n }\n\n /**\n * Tries to load the WASM module from the primary URL, falling back to a backup URL if necessary.\n * Throws an error if both URLs fail to load the module.\n * @returns Promise<Module> - A promise that resolves to the loaded module.\n */\n private static async _loadWithBackup(): Promise<Module> {\n if (!this._ModulePromise) {\n this._ModulePromise = this._tryLoad(this._wasmURL).catch(async (initialError): Promise<Module> => {\n const backupUrl = `https://cdn.jsdelivr.net/npm/${pkg.name}@${pkg.version}/dist/renderer.wasm`;\n\n console.warn(`Trying backup URL for WASM loading: ${backupUrl}`);\n try {\n return await this._tryLoad(backupUrl);\n } catch (backupError) {\n console.error(\n `Both primary and backup WASM URLs failed. Primary error: ${\n (initialError as Error).message\n }, Backup error: ${(backupError as Error).message}`,\n );\n throw new Error('WASM loading failed from all sources.');\n }\n });\n }\n\n return this._ModulePromise;\n }\n\n /**\n * Public method to load the WebAssembly module.\n * Utilizes a primary and backup URL for robustness.\n * @returns Promise<Module> - A promise that resolves to the loaded module.\n */\n public static async load(): Promise<Module> {\n return this._loadWithBackup();\n }\n\n /**\n * Sets a new URL for the WASM file and invalidates the current module promise.\n *\n * @param string - The new URL for the WASM file.\n */\n public static setWasmUrl(url: string): void {\n this._wasmURL = url;\n // Invalidate current module promise\n this._ModulePromise = null;\n }\n}\n","/**\n * Copyright 2023 Design Barn Inc.\n */\n\n/* eslint-disable promise/prefer-await-to-then */\n/* eslint-disable @typescript-eslint/unbound-method */\n\nimport type { EventListener, EventType } from './event-manager';\nimport { EventManager } from './event-manager';\nimport type { Renderer } from './renderer-wasm';\nimport { WasmLoader } from './renderer-wasm';\nimport { getAnimationJSONFromDotLottie, loadAnimationJSONFromURL } from './utils';\n\nconst ENVIRONMENT_IS_WEB = typeof window !== 'undefined';\nconst MS_TO_SEC_FACTOR = 1000;\n\nexport type Mode = 'forward' | 'reverse' | 'bounce' | 'bounce-reverse';\n\ntype PlaybackState = 'playing' | 'paused' | 'stopped';\n\ninterface RenderConfig {\n /**\n * The device pixel ratio to use when resizing the canvas.\n *\n * Default is window.devicePixelRatio or 1.\n */\n devicePixelRatio?: number;\n}\n\nexport interface Config {\n /**\n * Boolean indicating if the animation should start playing automatically.\n */\n autoplay?: boolean;\n /**\n * Animation canvas background color.\n */\n backgroundColor?: string;\n /**\n * The canvas element to render the animation on.\n */\n canvas: HTMLCanvasElement;\n /**\n * The animation data.\n * string: The JSON string of the animation data.\n * ArrayBuffer: The ArrayBuffer of the .lottie file.\n *\n * If the data is an ArrayBuffer, the JSON string will be extracted from the .lottie file.\n */\n data?: string | ArrayBuffer;\n /**\n * Boolean indicating if the animation should loop.\n */\n loop?: boolean;\n /**\n * The playback mode of the animation.\n *\n * forward: The animation will play from start to end.\n * reverse: The animation will play from end to start.\n * bounce: The animation will play from start to end and then from end to start.\n * bounce-reverse: The animation will play from end to start and then from start to end.\n *\n */\n mode?: Mode;\n /**\n * The render configuration.\n */\n renderConfig?: RenderConfig;\n /**\n * The frame boundaries of the animation.\n *\n * The animation will only play between the given start and end frames.\n *\n * e.g. [0, 10] will play the first 10 frames of the animation only.\n *\n */\n segments?: [number, number];\n /**\n * The speed of the animation.\n */\n speed?: number;\n /**\n * The source URL of the animation.\n *\n * If the data is provided, the src will be ignored.\n */\n src?: string;\n}\n\nexport class DotLottie {\n private readonly _canvas: HTMLCanvasElement;\n\n private _context: CanvasRenderingContext2D | null;\n\n private readonly _eventManager = new EventManager();\n\n private _renderer: Renderer | null = null;\n\n private _beginTime = 0;\n\n private _elapsedTime = 0;\n\n private _totalFrames = 0;\n\n private _loop = false;\n\n private _speed = 1;\n\n private _currentFrame = 0;\n\n private _duration = 0;\n\n private _loopCount = 0;\n\n private _autoplay = false;\n\n private _mode: Mode = 'forward';\n\n private _direction = 1;\n\n private _bounceCount = 0;\n\n private _animationFrameId?: number | null = null;\n\n private _segments: [number, number] | null = null;\n\n private _playbackState: PlaybackState = 'stopped';\n\n private _backgroundColor = '';\n\n private _renderConfig: RenderConfig = {};\n\n public constructor(config: Config) {\n this._animationLoop = this._animationLoop.bind(this);\n\n this._canvas = config.canvas;\n this._context = this._canvas.getContext('2d');\n if (!this._context) {\n throw new Error('2D context not supported or canvas already initialized with another context type.');\n }\n\n this._loop = config.loop ?? false;\n this._speed = config.speed ?? 1;\n this._autoplay = config.autoplay ?? false;\n this._mode = config.mode ?? 'forward';\n this._segments = config.segments ?? null;\n this._backgroundColor = config.backgroundColor ?? '';\n this._renderConfig = config.renderConfig ?? {};\n\n this.setBackgroundColor(this._backgroundColor);\n\n WasmLoader.load()\n .then((module) => {\n this._renderer = new module.Renderer();\n\n if (config.src) {\n this._loadAnimationFromURL(config.src);\n } else if (config.data) {\n this._initializeAnimationFromData(config.data);\n }\n })\n .catch((error) => {\n this._eventManager.dispatch({\n type: 'loadError',\n error: error as Error,\n });\n });\n }\n\n // #region Getters and Setters\n\n /**\n * Gets the autoplay status of the animation.\n *\n * @returns The autoplay status of the animation.\n */\n public get autoplay(): boolean {\n return this._autoplay;\n }\n\n /**\n * Gets the background color of the canvas.\n *\n * @returns The background color of the canvas.\n */\n public get backgroundColor(): string {\n return this._backgroundColor;\n }\n\n /**\n * Gets the current direction of the animation.\n *\n * @returns The current direction of the animation.\n */\n public get direction(): number {\n return this._direction;\n }\n\n /**\n * Gets the current frame number.\n *\n * @returns The current frame number.\n */\n public get currentFrame(): number {\n return this._currentFrame;\n }\n\n /**\n * Gets the duration of the animation in seconds.\n *\n * @returns The duration of the animation in seconds.\n */\n public get duration(): number {\n return this._duration;\n }\n\n /**\n * Gets the number of frames in the animation.\n *\n * @returns The number of frames in the animation.\n */\n public get totalFrames(): number {\n return this._totalFrames;\n }\n\n /**\n * Gets the loop status of the animation.\n *\n * @returns The loop status of the animation.\n */\n public get loop(): boolean {\n return this._loop;\n }\n\n /**\n * Gets the speed of the animation.\n *\n * @returns The speed of the animation.\n */\n public get speed(): number {\n return this._speed;\n }\n\n /**\n * Gets the loop count of the animation.\n *\n * @returns The loop count of the animation.\n */\n public get loopCount(): number {\n return this._loopCount;\n }\n\n /**\n * Gets the segments of the animation if any are set.\n * Default is 0 to total frames. but if segments are set, it will be the start and end frames.\n *\n */\n public get segments(): [number, number] | null {\n return this._segments;\n }\n\n public get isPlaying(): boolean {\n return this._playbackState === 'playing';\n }\n\n public get isPaused(): boolean {\n return this._playbackState === 'paused';\n }\n\n public get isStopped(): boolean {\n return this._playbackState === 'stopped';\n }\n // #endregion Getters and Setters\n\n // #region Private Methods\n /**\n * Loads and initializes the animation from a given URL.\n *\n * @public\n * @param animationURL - The source URL of the animation.\n */\n private _loadAnimationFromURL(animationURL: string): void {\n loadAnimationJSONFromURL(animationURL)\n .then((animationJSON) => {\n this._initializeAnimationFromData(animationJSON);\n })\n .catch((error) => {\n this._eventManager.dispatch({\n type: 'loadError',\n error: error as Error,\n });\n });\n }\n\n /**\n * Initializes the animation from the given data.\n *\n * @public\n * @param data - The animation data.\n */\n private _initializeAnimationFromData(data: string | ArrayBuffer): void {\n const loadAnimation = (animationData: string): void => {\n try {\n if (this._renderer?.load(animationData, this._canvas.width, this._canvas.height)) {\n this._setupAnimationDetails();\n this._eventManager.dispatch({ type: 'load' });\n this.resize();\n if (this._autoplay) {\n this.play();\n } else {\n this._render();\n }\n } else {\n this._eventManager.dispatch({\n type: 'loadError',\n error: new Error('Error encountered while initializing animation from data.'),\n });\n }\n } catch (error) {\n this._eventManager.dispatch({\n type: 'loadError',\n error: error as Error,\n });\n }\n };\n\n if (typeof data === 'string') {\n loadAnimation(data);\n } else if (data instanceof ArrayBuffer) {\n getAnimationJSONFromDotLottie(data)\n .then(loadAnimation)\n .catch((error) => {\n this._eventManager.dispatch({\n type: 'loadError',\n error: error as Error,\n });\n });\n } else {\n console.error('Unsupported data type for animation data. Expected a string or ArrayBuffer.');\n }\n }\n\n /**\n * Sets up animation details like total frames and duration.\n */\n private _setupAnimationDetails(): void {\n if (this._renderer) {\n this._totalFrames = this._renderer.totalFrames();\n this._duration = this._renderer.duration();\n this._segments = [\n Math.max(0, this._segments?.[0] ?? 0),\n Math.min(this._totalFrames - 1, this.segments?.[1] ?? this._totalFrames - 1),\n ];\n }\n }\n\n /**\n * Renders the animation frame on the canvas.\n */\n private _render(): void {\n if (!this._context || !this._renderer) {\n return;\n }\n\n const width = this._canvas.width;\n const height = this._canvas.height;\n\n this._renderer.resize(width, height);\n\n if (this._renderer.update()) {\n const buffer = this._renderer.render();\n\n if (buffer.length === 0) {\n console.warn('Empty buffer received from renderer.');\n\n return;\n }\n\n const clampedBuffer = new Uint8ClampedArray(buffer);\n const imageData = new ImageData(clampedBuffer, this._canvas.width, this._canvas.height);\n\n this._context.putImageData(imageData, 0, 0);\n }\n }\n\n /**\n * Updates the current frame and animation state.\n * @returns Boolean indicating if the frame was updated.\n */\n private _update(): boolean {\n // animation is not loaded yet\n if (this._duration === 0 || this._totalFrames === 0) return false;\n\n const effectiveStartFrame = this._getEffectiveStartFrame();\n const effectiveEndFrame = this._getEffectiveEndFrame();\n const effectiveDuration = this._getEffectiveDuration();\n const frameDuration = effectiveDuration / (effectiveEndFrame - effectiveStartFrame);\n\n this._elapsedTime = (Date.now() / MS_TO_SEC_FACTOR - this._beginTime) * this._speed;\n const frameProgress = this._elapsedTime / frameDuration;\n\n // determine the current frame based on the animation mode and progress\n if (this._mode === 'forward' || this._mode === 'reverse') {\n this._currentFrame =\n this._mode === 'forward' ? effectiveStartFrame + frameProgress : effectiveEndFrame - frameProgress;\n } else {\n // handle bounce or bounce-reverse mode\n // eslint-disable-next-line no-lonely-if\n if (this._direction === 1) {\n this._currentFrame = effectiveStartFrame + frameProgress;\n if (this._currentFrame >= effectiveEndFrame) {\n this._currentFrame = effectiveEndFrame;\n this._direction = -1;\n this._beginTime = Date.now() / MS_TO_SEC_FACTOR;\n }\n } else {\n this._currentFrame = effectiveEndFrame - frameProgress;\n if (this._currentFrame <= effectiveStartFrame) {\n this._currentFrame = effectiveStartFrame;\n this._direction = 1;\n this._beginTime = Date.now() / MS_TO_SEC_FACTOR;\n }\n }\n }\n\n // clamp the current frame within the effective range and round it\n this._currentFrame =\n Math.round(Math.max(effectiveStartFrame, Math.min(this._currentFrame, effectiveEndFrame)) * 100) / 100;\n\n let shouldUpdate = false;\n\n if (this._renderer?.frame(this._currentFrame)) {\n this._eventManager.dispatch({\n type: 'frame',\n currentFrame: this._currentFrame,\n });\n\n shouldUpdate = true;\n }\n\n // check if the animation should loop or complete\n if (this._mode === 'forward' || this._mode === 'reverse') {\n if (this._currentFrame >= effectiveEndFrame || this._currentFrame <= effectiveStartFrame) {\n this._handleLoopOrCompletion();\n }\n } else if (this._currentFrame <= effectiveStartFrame || this._currentFrame >= effectiveEndFrame) {\n this._bounceCount += 1;\n if (this._bounceCount % 2 === 0) {\n this._bounceCount = 0;\n this._handleLoopOrCompletion();\n }\n }\n\n return shouldUpdate;\n }\n\n /**\n * Handles the loop or completion logic for the animation.\n */\n private _handleLoopOrCompletion(): void {\n if (this._loop) {\n this._loopCount += 1;\n this._eventManager.dispatch({ type: 'loop', loopCount: this._loopCount });\n this._beginTime = Date.now() / MS_TO_SEC_FACTOR;\n } else {\n this._playbackState = 'stopped';\n this._eventManager.dispatch({ type: 'complete' });\n }\n }\n\n /**\n * Loop that handles the animation playback.\n */\n private _animationLoop(): void {\n if (this.isPlaying && this._update()) {\n this._render();\n\n this._animationFrameId = window.requestAnimationFrame(this._animationLoop);\n }\n }\n\n /**\n * Stops the animation loop.\n *\n * This is used to ensure that the animation loop is only stopped once.\n */\n private _stopAnimationLoop(): void {\n if (this._animationFrameId) {\n window.cancelAnimationFrame(this._animationFrameId);\n this._animationFrameId = null;\n }\n }\n\n /**\n * Starts the animation loop.\n *\n * This is used to ensure that the animation loop is only started once.\n */\n private _startAnimationLoop(): void {\n if (!this._animationFrameId) {\n this._animationFrameId = window.requestAnimationFrame(this._animationLoop);\n }\n }\n\n private _getEffectiveStartFrame(): number {\n return this._segments ? this._segments[0] : 0;\n }\n\n private _getEffectiveEndFrame(): number {\n return this._segments ? this._segments[1] : this._totalFrames - 1;\n }\n\n private _getEffectiveTotalFrames(): number {\n return this._segments ? this._segments[1] - this._segments[0] : this._totalFrames;\n }\n\n private _getEffectiveDuration(): number {\n return this._segments\n ? this._duration * ((this._segments[1] - this._segments[0]) / this._totalFrames)\n : this._duration;\n }\n\n /**\n * Synchronizes the animation timing based on the current frame, direction, and speed settings.\n * This method calculates the appropriate begin time for the animation loop, ensuring that the\n * animation's playback is consistent with the specified parameters.\n *\n * @param frame - The current frame number from which the animation timing will be synchronized.\n * This frame number is used to calculate the correct position in the animation timeline.\n *\n * Usage:\n * - This function should be called whenever there is a change in the frame, speed, or direction\n * of the animation to maintain the correct timing.\n * - It is used internally in methods like `play`, `setFrame`, and `setMode` to ensure that the\n * animation's playback remains smooth and accurate.\n */\n private _synchronizeAnimationTiming(frame: number): void {\n const effectiveDuration = this._getEffectiveDuration();\n const effectiveTotalFrames = this._getEffectiveTotalFrames();\n const frameDuration = effectiveDuration / effectiveTotalFrames;\n let frameTime = (frame - this._getEffectiveStartFrame()) * frameDuration;\n\n if (this._direction === -1) {\n frameTime = effectiveDuration - frameTime;\n }\n\n this._beginTime = Date.now() / MS_TO_SEC_FACTOR - frameTime / this._speed;\n }\n\n // #endregion\n\n // #region Public Methods\n\n /**\n * Starts the animation playback.\n */\n public play(): void {\n if (this._totalFrames === 0) {\n console.error('Animation is not loaded yet.');\n\n return;\n }\n\n const effectiveStartFrame = this._getEffectiveStartFrame();\n const effectiveEndFrame = this._getEffectiveEndFrame();\n\n // reset begin time and loop count if starting from the beginning\n // eslint-disable-next-line no-negated-condition\n if (this._playbackState !== 'paused') {\n this._currentFrame =\n this._mode === 'reverse' || this._mode === 'bounce-reverse' ? effectiveEndFrame : effectiveStartFrame;\n this._beginTime = Date.now() / MS_TO_SEC_FACTOR;\n } else {\n this._synchronizeAnimationTiming(this._currentFrame);\n }\n\n if (!this.isPlaying) {\n this._playbackState = 'playing';\n this._eventManager.dispatch({\n type: 'play',\n });\n this._startAnimationLoop();\n }\n }\n\n /**\n * Stops the animation playback and resets the current frame.\n */\n public stop(): void {\n if (this.isStopped) return;\n\n this._stopAnimationLoop();\n this._playbackState = 'stopped';\n this._bounceCount = 0;\n\n if (this._mode === 'reverse' || this._mode === 'bounce-reverse') {\n this._currentFrame = this._getEffectiveEndFrame();\n this._direction = -1;\n } else {\n this._currentFrame = this._getEffectiveStartFrame();\n this._direction = 1;\n }\n\n this.setFrame(this._currentFrame);\n this._render();\n\n this._eventManager.dispatch({\n type: 'stop',\n });\n }\n\n /**\n * Pauses the animation playback.\n */\n public pause(): void {\n if (this.isPaused) return;\n\n this._stopAnimationLoop();\n\n this._playbackState = 'paused';\n\n this._eventManager.dispatch({\n type: 'pause',\n });\n }\n\n /**\n * Sets the speed for animation playback.\n * @param speed - Speed multiplier for playback.\n */\n public setSpeed(speed: number): void {\n if (speed <= 0) {\n console.error('Speed must be a positive number.');\n\n return;\n }\n\n if (this._speed === speed) return;\n\n if (this.isPlaying) {\n // recalculate the begin time based on the new speed to maintain the current position\n const currentTime = Date.now() / MS_TO_SEC_FACTOR;\n\n this._beginTime = currentTime - this._elapsedTime / speed;\n }\n\n this._speed = speed;\n }\n\n /**\n * Sets the loop state for animation playback.\n * @param loop - Boolean indicating if the animation should loop.\n */\n public setLoop(loop: boolean): void {\n this._loop = loop;\n }\n\n /**\n * Sets the current frame of the animation.\n * @param frame - Frame number to set.\n */\n public setFrame(frame: number): void {\n const effectiveStartFrame = this._getEffectiveStartFrame();\n const effectiveEndFrame = this._getEffectiveEndFrame();\n\n // validate the frame number within the effective frame range\n if (frame < effectiveStartFrame || frame > effectiveEndFrame) {\n console.error(\n `Invalid frame number: ${frame}. It should be between ${effectiveStartFrame} and ${effectiveEndFrame}.`,\n );\n\n return;\n }\n\n this._currentFrame = frame;\n\n if (this.isPlaying) {\n this._synchronizeAnimationTiming(frame);\n }\n\n if (this._renderer?.frame(this._currentFrame)) {\n this._render();\n this._eventManager.dispatch({\n type: 'frame',\n currentFrame: this._currentFrame,\n });\n }\n }\n\n /**\n *\n * Sets the playback mode of the animation.\n *\n */\n public setMode(mode: Mode): void {\n if (this._mode === mode) {\n return;\n }\n\n this._mode = mode;\n this._bounceCount = 0;\n this._direction = mode.includes('reverse') ? -1 : 1;\n\n if (this.isPlaying) {\n this._synchronizeAnimationTiming(this._currentFrame);\n }\n }\n\n public load(config: Omit<Config, 'canvas'>): void {\n if (!this._renderer || !this._context) {\n return;\n }\n\n if (!config.src && !config.data) {\n console.error('Either \"src\" or \"data\" must be provided.');\n\n return;\n }\n\n this._stopAnimationLoop();\n this._playbackState = 'stopped';\n\n this._loop = config.loop ?? false;\n this._speed = config.speed ?? 1;\n this._autoplay = config.autoplay ?? false;\n this._mode = config.mode ?? 'forward';\n this._segments = config.segments ?? null;\n this._loopCount = 0;\n this._bounceCount = 0;\n this._direction = this._mode.includes('reverse') ? -1 : 1;\n this._renderConfig = config.renderConfig ?? {};\n\n // Set the initial frame based on the mode and segments\n const effectiveStartFrame = this._getEffectiveStartFrame();\n const effectiveEndFrame = this._getEffectiveEndFrame();\n\n this._currentFrame =\n this._mode === 'reverse' || this._mode === 'bounce-reverse' ? effectiveEndFrame : effectiveStartFrame;\n\n // Reset other properties\n this._beginTime = 0;\n this._totalFrames = 0;\n this._duration = 0;\n this._backgroundColor = config.backgroundColor ?? '';\n\n this.setBackgroundColor(this._backgroundColor);\n\n this._context.clearRect(0, 0, this._canvas.width, this._canvas.height);\n\n if (config.src) {\n this._loadAnimationFromURL(config.src);\n } else if (config.data) {\n this._initializeAnimationFromData(config.data);\n }\n }\n\n public setSegments(startFrame: number, endFrame: number): void {\n if (!this._renderer) {\n console.error('Animation not initialized.');\n\n return;\n }\n\n // Validate the frame range\n if (startFrame < 0 || endFrame >= this._totalFrames || startFrame > endFrame) {\n console.error('Invalid frame range.');\n\n return;\n }\n\n this._segments = [startFrame, endFrame];\n\n if (this._currentFrame < startFrame || this._currentFrame > endFrame) {\n this._currentFrame = this._direction === 1 ? startFrame : endFrame;\n\n // render the current frame\n if (this._renderer.frame(this._currentFrame)) {\n this._render();\n this._eventManager.dispatch({\n type: 'frame',\n currentFrame: this._currentFrame,\n });\n }\n }\n\n // If playing, adjust the animation timing\n if (this.isPlaying) {\n this._synchronizeAnimationTiming(this._currentFrame);\n }\n }\n\n /**\n * Registers an event listener for a specific event type.\n *\n * @param type - The type of the event to listen for.\n * @param listener - The callback function to be called when the event is dispatched.\n */\n public addEventListener<T extends EventType>(type: T, listener: EventListener<T>): void {\n this._eventManager.addEventListener(type, listener);\n }\n\n /**\n * Removes an event listener for a specific event type.\n *\n * @param type - The type of the event to listen for.\n * @param listener - The callback function to be called when the event is dispatched.\n */\n public removeEventListener<T extends EventType>(type: T, listener?: EventListener<T>): void {\n this._eventManager.removeEventListener(type, listener);\n }\n\n /**\n * Sets the source URL of the WASM file to load.\n * @param url - The URL of the WASM file to load.\n */\n public static setWasmUrl(url: string): void {\n WasmLoader.setWasmUrl(url);\n }\n\n /**\n * Destroys the DotLottie instance.\n *\n */\n public destroy(): void {\n this._stopAnimationLoop();\n this._playbackState = 'stopped';\n\n this._context = null;\n this._renderer = null;\n\n this._eventManager.dispatch({\n type: 'destroy',\n });\n\n this._eventManager.removeAllEventListeners();\n }\n\n /**\n * Freezes the animation by stopping the animation loop.\n *\n */\n public freeze(): void {\n this._stopAnimationLoop();\n }\n\n /**\n * Unfreezes the animation by resuming the animation loop.\n *\n */\n public unfreeze(): void {\n this._synchronizeAnimationTiming(this._currentFrame);\n this._startAnimationLoop();\n }\n\n /**\n * Sets the background color of the canvas.\n *\n * @param color - The background color of the canvas.\n */\n public setBackgroundColor(color: string): void {\n this._backgroundColor = color;\n\n if (ENVIRONMENT_IS_WEB) {\n // eslint-disable-next-line no-warning-comments\n // TODO: Change the background color from the renderer instead of the canvas to support non web environments\n this._canvas.style.backgroundColor = color;\n }\n }\n\n /**\n * Adjusts the canvas size to match the size of its bounding box, considering the device's pixel ratio.\n * This method ensures that the canvas is correctly scaled for high-density displays, maintaining\n * the clarity and quality of the rendered animation.\n *\n * Call this method whenever the size of the canvas element changes (e.g., due to window resizing,\n * orientation changes, or dynamic layout updates) to ensure that the canvas is always properly scaled.\n *\n */\n public resize(): void {\n if (!ENVIRONMENT_IS_WEB) return;\n\n const { height, width } = this._canvas.getBoundingClientRect();\n\n const dpr = this._renderConfig.devicePixelRatio || window.devicePixelRatio || 1;\n\n this._canvas.width = width * dpr;\n this._canvas.height = height * dpr;\n\n // resize the renderer and render the current frame\n this._render();\n }\n\n // #endregion\n}\n"]}
|
package/dist/dotlottie.d.ts
CHANGED
|
@@ -4,7 +4,15 @@ import { EventType, EventListener } from './event-manager.js';
|
|
|
4
4
|
* Copyright 2023 Design Barn Inc.
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
-
type Mode = '
|
|
7
|
+
type Mode = 'forward' | 'reverse' | 'bounce' | 'bounce-reverse';
|
|
8
|
+
interface RenderConfig {
|
|
9
|
+
/**
|
|
10
|
+
* The device pixel ratio to use when resizing the canvas.
|
|
11
|
+
*
|
|
12
|
+
* Default is window.devicePixelRatio or 1.
|
|
13
|
+
*/
|
|
14
|
+
devicePixelRatio?: number;
|
|
15
|
+
}
|
|
8
16
|
interface Config {
|
|
9
17
|
/**
|
|
10
18
|
* Boolean indicating if the animation should start playing automatically.
|
|
@@ -22,6 +30,8 @@ interface Config {
|
|
|
22
30
|
* The animation data.
|
|
23
31
|
* string: The JSON string of the animation data.
|
|
24
32
|
* ArrayBuffer: The ArrayBuffer of the .lottie file.
|
|
33
|
+
*
|
|
34
|
+
* If the data is an ArrayBuffer, the JSON string will be extracted from the .lottie file.
|
|
25
35
|
*/
|
|
26
36
|
data?: string | ArrayBuffer;
|
|
27
37
|
/**
|
|
@@ -31,14 +41,34 @@ interface Config {
|
|
|
31
41
|
/**
|
|
32
42
|
* The playback mode of the animation.
|
|
33
43
|
*
|
|
44
|
+
* forward: The animation will play from start to end.
|
|
45
|
+
* reverse: The animation will play from end to start.
|
|
46
|
+
* bounce: The animation will play from start to end and then from end to start.
|
|
47
|
+
* bounce-reverse: The animation will play from end to start and then from start to end.
|
|
48
|
+
*
|
|
34
49
|
*/
|
|
35
50
|
mode?: Mode;
|
|
51
|
+
/**
|
|
52
|
+
* The render configuration.
|
|
53
|
+
*/
|
|
54
|
+
renderConfig?: RenderConfig;
|
|
55
|
+
/**
|
|
56
|
+
* The frame boundaries of the animation.
|
|
57
|
+
*
|
|
58
|
+
* The animation will only play between the given start and end frames.
|
|
59
|
+
*
|
|
60
|
+
* e.g. [0, 10] will play the first 10 frames of the animation only.
|
|
61
|
+
*
|
|
62
|
+
*/
|
|
63
|
+
segments?: [number, number];
|
|
36
64
|
/**
|
|
37
65
|
* The speed of the animation.
|
|
38
66
|
*/
|
|
39
67
|
speed?: number;
|
|
40
68
|
/**
|
|
41
69
|
* The source URL of the animation.
|
|
70
|
+
*
|
|
71
|
+
* If the data is provided, the src will be ignored.
|
|
42
72
|
*/
|
|
43
73
|
src?: string;
|
|
44
74
|
}
|
|
@@ -47,7 +77,6 @@ declare class DotLottie {
|
|
|
47
77
|
private _context;
|
|
48
78
|
private readonly _eventManager;
|
|
49
79
|
private _renderer;
|
|
50
|
-
private _playing;
|
|
51
80
|
private _beginTime;
|
|
52
81
|
private _elapsedTime;
|
|
53
82
|
private _totalFrames;
|
|
@@ -61,9 +90,23 @@ declare class DotLottie {
|
|
|
61
90
|
private _direction;
|
|
62
91
|
private _bounceCount;
|
|
63
92
|
private _animationFrameId?;
|
|
64
|
-
private
|
|
65
|
-
private
|
|
93
|
+
private _segments;
|
|
94
|
+
private _playbackState;
|
|
95
|
+
private _backgroundColor;
|
|
96
|
+
private _renderConfig;
|
|
66
97
|
constructor(config: Config);
|
|
98
|
+
/**
|
|
99
|
+
* Gets the autoplay status of the animation.
|
|
100
|
+
*
|
|
101
|
+
* @returns The autoplay status of the animation.
|
|
102
|
+
*/
|
|
103
|
+
get autoplay(): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Gets the background color of the canvas.
|
|
106
|
+
*
|
|
107
|
+
* @returns The background color of the canvas.
|
|
108
|
+
*/
|
|
109
|
+
get backgroundColor(): string;
|
|
67
110
|
/**
|
|
68
111
|
* Gets the current direction of the animation.
|
|
69
112
|
*
|
|
@@ -107,11 +150,14 @@ declare class DotLottie {
|
|
|
107
150
|
*/
|
|
108
151
|
get loopCount(): number;
|
|
109
152
|
/**
|
|
110
|
-
*
|
|
153
|
+
* Gets the segments of the animation if any are set.
|
|
154
|
+
* Default is 0 to total frames. but if segments are set, it will be the start and end frames.
|
|
111
155
|
*
|
|
112
|
-
* @returns The playing status of the animation.
|
|
113
156
|
*/
|
|
114
|
-
get
|
|
157
|
+
get segments(): [number, number] | null;
|
|
158
|
+
get isPlaying(): boolean;
|
|
159
|
+
get isPaused(): boolean;
|
|
160
|
+
get isStopped(): boolean;
|
|
115
161
|
/**
|
|
116
162
|
* Loads and initializes the animation from a given URL.
|
|
117
163
|
*
|
|
@@ -136,30 +182,48 @@ declare class DotLottie {
|
|
|
136
182
|
private _render;
|
|
137
183
|
/**
|
|
138
184
|
* Updates the current frame and animation state.
|
|
139
|
-
* @returns Boolean indicating if
|
|
185
|
+
* @returns Boolean indicating if the frame was updated.
|
|
140
186
|
*/
|
|
141
187
|
private _update;
|
|
142
188
|
/**
|
|
143
|
-
*
|
|
189
|
+
* Handles the loop or completion logic for the animation.
|
|
144
190
|
*/
|
|
145
|
-
private
|
|
191
|
+
private _handleLoopOrCompletion;
|
|
146
192
|
/**
|
|
147
|
-
*
|
|
148
|
-
*
|
|
193
|
+
* Loop that handles the animation playback.
|
|
149
194
|
*/
|
|
150
|
-
|
|
195
|
+
private _animationLoop;
|
|
151
196
|
/**
|
|
152
197
|
* Stops the animation loop.
|
|
153
198
|
*
|
|
154
199
|
* This is used to ensure that the animation loop is only stopped once.
|
|
155
200
|
*/
|
|
156
|
-
_stopAnimationLoop
|
|
201
|
+
private _stopAnimationLoop;
|
|
157
202
|
/**
|
|
158
203
|
* Starts the animation loop.
|
|
159
204
|
*
|
|
160
205
|
* This is used to ensure that the animation loop is only started once.
|
|
161
206
|
*/
|
|
162
|
-
_startAnimationLoop
|
|
207
|
+
private _startAnimationLoop;
|
|
208
|
+
private _getEffectiveStartFrame;
|
|
209
|
+
private _getEffectiveEndFrame;
|
|
210
|
+
private _getEffectiveTotalFrames;
|
|
211
|
+
private _getEffectiveDuration;
|
|
212
|
+
/**
|
|
213
|
+
* Synchronizes the animation timing based on the current frame, direction, and speed settings.
|
|
214
|
+
* This method calculates the appropriate begin time for the animation loop, ensuring that the
|
|
215
|
+
* animation's playback is consistent with the specified parameters.
|
|
216
|
+
*
|
|
217
|
+
* @param frame - The current frame number from which the animation timing will be synchronized.
|
|
218
|
+
* This frame number is used to calculate the correct position in the animation timeline.
|
|
219
|
+
*
|
|
220
|
+
* Usage:
|
|
221
|
+
* - This function should be called whenever there is a change in the frame, speed, or direction
|
|
222
|
+
* of the animation to maintain the correct timing.
|
|
223
|
+
* - It is used internally in methods like `play`, `setFrame`, and `setMode` to ensure that the
|
|
224
|
+
* animation's playback remains smooth and accurate.
|
|
225
|
+
*/
|
|
226
|
+
private _synchronizeAnimationTiming;
|
|
163
227
|
/**
|
|
164
228
|
* Starts the animation playback.
|
|
165
229
|
*/
|
|
@@ -187,7 +251,14 @@ declare class DotLottie {
|
|
|
187
251
|
* @param frame - Frame number to set.
|
|
188
252
|
*/
|
|
189
253
|
setFrame(frame: number): void;
|
|
254
|
+
/**
|
|
255
|
+
*
|
|
256
|
+
* Sets the playback mode of the animation.
|
|
257
|
+
*
|
|
258
|
+
*/
|
|
259
|
+
setMode(mode: Mode): void;
|
|
190
260
|
load(config: Omit<Config, 'canvas'>): void;
|
|
261
|
+
setSegments(startFrame: number, endFrame: number): void;
|
|
191
262
|
/**
|
|
192
263
|
* Registers an event listener for a specific event type.
|
|
193
264
|
*
|
|
@@ -212,6 +283,32 @@ declare class DotLottie {
|
|
|
212
283
|
*
|
|
213
284
|
*/
|
|
214
285
|
destroy(): void;
|
|
286
|
+
/**
|
|
287
|
+
* Freezes the animation by stopping the animation loop.
|
|
288
|
+
*
|
|
289
|
+
*/
|
|
290
|
+
freeze(): void;
|
|
291
|
+
/**
|
|
292
|
+
* Unfreezes the animation by resuming the animation loop.
|
|
293
|
+
*
|
|
294
|
+
*/
|
|
295
|
+
unfreeze(): void;
|
|
296
|
+
/**
|
|
297
|
+
* Sets the background color of the canvas.
|
|
298
|
+
*
|
|
299
|
+
* @param color - The background color of the canvas.
|
|
300
|
+
*/
|
|
301
|
+
setBackgroundColor(color: string): void;
|
|
302
|
+
/**
|
|
303
|
+
* Adjusts the canvas size to match the size of its bounding box, considering the device's pixel ratio.
|
|
304
|
+
* This method ensures that the canvas is correctly scaled for high-density displays, maintaining
|
|
305
|
+
* the clarity and quality of the rendered animation.
|
|
306
|
+
*
|
|
307
|
+
* Call this method whenever the size of the canvas element changes (e.g., due to window resizing,
|
|
308
|
+
* orientation changes, or dynamic layout updates) to ensure that the canvas is always properly scaled.
|
|
309
|
+
*
|
|
310
|
+
*/
|
|
311
|
+
resize(): void;
|
|
215
312
|
}
|
|
216
313
|
|
|
217
314
|
export { Config, DotLottie, Mode };
|