@lottiefiles/dotlottie-web
Version:
Lottie and DotLottie player for the web
6 lines • 74.4 kB
JavaScript
"use strict";(()=>{var wt=Object.defineProperty;var vt=(n,t,e)=>t in n?wt(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var d=(n,t,e)=>vt(n,typeof t!="symbol"?t+"":t,e);var J=class{requestAnimationFrame(t){return requestAnimationFrame(t)}cancelAnimationFrame(t){cancelAnimationFrame(t)}},K=class{constructor(){d(this,"_lastHandleId",0);d(this,"_lastImmediate",null)}requestAnimationFrame(t){return this._lastHandleId>=Number.MAX_SAFE_INTEGER&&(this._lastHandleId=0),this._lastHandleId+=1,this._lastImmediate=setImmediate(()=>{t(performance.now())}),this._lastHandleId}cancelAnimationFrame(t){this._lastImmediate&&clearImmediate(this._lastImmediate)}},U=class{constructor(){d(this,"_strategy");this._strategy=typeof requestAnimationFrame=="function"?new J:new K}requestAnimationFrame(t){return this._strategy.requestAnimationFrame(t)}cancelAnimationFrame(t){this._strategy.cancelAnimationFrame(t)}};var y=typeof window<"u"&&typeof window.document<"u";var N=new Uint8Array([80,75,3,4]),rt=["v","ip","op","layers","fr","w","h"],Y="0.82.0",X="@lottiefiles/dotlottie-web",st=.75,ot=4;var s,I=new Array(128).fill(void 0);I.push(void 0,null,!0,!1);function h(n){return I[n]}var D=I.length;function f(n){D===I.length&&I.push(I.length+1);let t=D;return D=I[t],I[t]=n,t}function L(n,t){try{return n.apply(this,t)}catch(e){s.__wbindgen_export_0(f(e))}}var c=0,B=null;function z(){return(B===null||B.byteLength===0)&&(B=new Uint8Array(s.memory.buffer)),B}var W=typeof TextEncoder<"u"?new TextEncoder("utf-8"):{encode:()=>{throw Error("TextEncoder not available")}},bt=typeof W.encodeInto=="function"?function(n,t){return W.encodeInto(n,t)}:function(n,t){let e=W.encode(n);return t.set(e),{read:n.length,written:e.length}};function p(n,t,e){if(e===void 0){let l=W.encode(n),b=t(l.length,1)>>>0;return z().subarray(b,b+l.length).set(l),c=l.length,b}let r=n.length,o=t(r,1)>>>0,i=z(),_=0;for(;_<r;_++){let l=n.charCodeAt(_);if(l>127)break;i[o+_]=l}if(_!==r){_!==0&&(n=n.slice(_)),o=e(o,r,r=_+n.length*3,1)>>>0;let l=z().subarray(o+_,o+r),b=bt(n,l);_+=b.written,o=e(o,r,_,1)>>>0}return c=_,o}var P=null;function u(){return(P===null||P.buffer.detached===!0||P.buffer.detached===void 0&&P.buffer!==s.memory.buffer)&&(P=new DataView(s.memory.buffer)),P}var at=typeof TextDecoder<"u"?new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}):{decode:()=>{throw Error("TextDecoder not available")}};typeof TextDecoder<"u"&&at.decode();function m(n,t){return n=n>>>0,at.decode(z().subarray(n,n+t))}function yt(n){n<132||(I[n]=D,D=n)}function E(n){let t=h(n);return yt(n),t}function _t(n){return n==null}function Z(n,t){let e=t(n.length*1,1)>>>0;return z().set(n,e/1),c=n.length,e}function ct(n,t){let e=p(n,s.__wbindgen_export_1,s.__wbindgen_export_2),r=c,o=Z(t,s.__wbindgen_export_1),i=c;return s.register_font(e,r,o,i)!==0}var $=null;function Et(){return($===null||$.byteLength===0)&&($=new Float32Array(s.memory.buffer)),$}function Mt(n,t){let e=t(n.length*4,4)>>>0;return Et().set(n,e/4),c=n.length,e}function Ct(n,t){let e=t(n.length*4,4)>>>0,r=u();for(let o=0;o<n.length;o++)r.setUint32(e+4*o,f(n[o]),!0);return c=n.length,e}var S=Object.freeze({Forward:0,0:"Forward",Reverse:1,1:"Reverse",Bounce:2,2:"Bounce",ReverseBounce:3,3:"ReverseBounce"}),M=Object.freeze({Idle:0,0:"Idle",Playing:1,1:"Playing",Paused:2,2:"Paused",Stopped:3,3:"Stopped",Tweening:4,4:"Tweening"}),it=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(n=>s.__wbg_dotlottieplayerwasm_free(n>>>0,1)),G=class{__destroy_into_raw(){let t=this.__wbg_ptr;return this.__wbg_ptr=0,it.unregister(this),t}free(){let t=this.__destroy_into_raw();s.__wbg_dotlottieplayerwasm_free(t,0)}clear_slot(t){let e=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),r=c;return s.dotlottieplayerwasm_clear_slot(this.__wbg_ptr,e,r)!==0}layout_fit(){let t,e;try{let i=s.__wbindgen_add_to_stack_pointer(-16);s.dotlottieplayerwasm_layout_fit(i,this.__wbg_ptr);var r=u().getInt32(i+0,!0),o=u().getInt32(i+4,!0);return t=r,e=o,m(r,o)}finally{s.__wbindgen_add_to_stack_pointer(16),s.__wbindgen_export_3(t,e,1)}}loop_count(){return s.dotlottieplayerwasm_loop_count(this.__wbg_ptr)>>>0}poll_event(){let t=s.dotlottieplayerwasm_poll_event(this.__wbg_ptr);return E(t)}reset_slot(t){let e=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),r=c;return s.dotlottieplayerwasm_reset_slot(this.__wbg_ptr,e,r)!==0}set_layout(t,e,r){let o=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),i=c;return s.dotlottieplayerwasm_set_layout(this.__wbg_ptr,o,i,e,r)!==0}set_marker(t){let e=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),r=c;s.dotlottieplayerwasm_set_marker(this.__wbg_ptr,e,r)}clear_slots(){return s.dotlottieplayerwasm_clear_slots(this.__wbg_ptr)!==0}is_complete(){return s.dotlottieplayerwasm_is_complete(this.__wbg_ptr)!==0}reset_slots(){return s.dotlottieplayerwasm_reset_slots(this.__wbg_ptr)!==0}reset_theme(){return s.dotlottieplayerwasm_reset_theme(this.__wbg_ptr)!==0}segment_end(){return s.dotlottieplayerwasm_segment_end(this.__wbg_ptr)}set_quality(t){return s.dotlottieplayerwasm_set_quality(this.__wbg_ptr,t)!==0}set_segment(t,e){return s.dotlottieplayerwasm_set_segment(this.__wbg_ptr,t,e)!==0}sm_set_seed(t){return s.dotlottieplayerwasm_sm_set_seed(this.__wbg_ptr,t)!==0}static unload_font(t){let e=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),r=c;return s.dotlottieplayerwasm_unload_font(e,r)!==0}animation_id(){try{let r=s.__wbindgen_add_to_stack_pointer(-16);s.dotlottieplayerwasm_animation_id(r,this.__wbg_ptr);var t=u().getInt32(r+0,!0),e=u().getInt32(r+4,!0);let o;return t!==0&&(o=m(t,e).slice(),s.__wbindgen_export_3(t,e*1,1)),o}finally{s.__wbindgen_add_to_stack_pointer(16)}}audio_volume(){return s.dotlottieplayerwasm_audio_volume(this.__wbg_ptr)}background_a(){return s.dotlottieplayerwasm_background_a(this.__wbg_ptr)}background_b(){return s.dotlottieplayerwasm_background_b(this.__wbg_ptr)}background_g(){return s.dotlottieplayerwasm_background_g(this.__wbg_ptr)}background_r(){return s.dotlottieplayerwasm_background_r(this.__wbg_ptr)}clear_marker(){s.dotlottieplayerwasm_clear_marker(this.__wbg_ptr)}emit_on_loop(){s.dotlottieplayerwasm_emit_on_loop(this.__wbg_ptr)}get_slot_ids(){let t=s.dotlottieplayerwasm_get_slot_ids(this.__wbg_ptr);return E(t)}get_slot_str(t){try{let o=s.__wbindgen_add_to_stack_pointer(-16),i=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),_=c;s.dotlottieplayerwasm_get_slot_str(o,this.__wbg_ptr,i,_);var e=u().getInt32(o+0,!0),r=u().getInt32(o+4,!0);let l;return e!==0&&(l=m(e,r).slice(),s.__wbindgen_export_3(e,r*1,1)),l}finally{s.__wbindgen_add_to_stack_pointer(16)}}marker_names(){let t=s.dotlottieplayerwasm_marker_names(this.__wbg_ptr);return E(t)}set_autoplay(t){s.dotlottieplayerwasm_set_autoplay(this.__wbg_ptr,t)}set_slot_str(t,e){let r=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),o=c,i=p(e,s.__wbindgen_export_1,s.__wbindgen_export_2),_=c;return s.dotlottieplayerwasm_set_slot_str(this.__wbg_ptr,r,o,i,_)!==0}set_viewport(t,e,r,o){return s.dotlottieplayerwasm_set_viewport(this.__wbg_ptr,t,e,r,o)!==0}total_frames(){return s.dotlottieplayerwasm_total_frames(this.__wbg_ptr)}clear_segment(){return s.dotlottieplayerwasm_clear_segment(this.__wbg_ptr)!==0}current_frame(){return s.dotlottieplayerwasm_current_frame(this.__wbg_ptr)}get_slot_type(t){try{let o=s.__wbindgen_add_to_stack_pointer(-16),i=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),_=c;s.dotlottieplayerwasm_get_slot_type(o,this.__wbg_ptr,i,_);var e=u().getInt32(o+0,!0),r=u().getInt32(o+4,!0);let l;return e!==0&&(l=m(e,r).slice(),s.__wbindgen_export_3(e,r*1,1)),l}finally{s.__wbindgen_add_to_stack_pointer(16)}}get_slots_str(){let t,e;try{let i=s.__wbindgen_add_to_stack_pointer(-16);s.dotlottieplayerwasm_get_slots_str(i,this.__wbg_ptr);var r=u().getInt32(i+0,!0),o=u().getInt32(i+4,!0);return t=r,e=o,m(r,o)}finally{s.__wbindgen_add_to_stack_pointer(16),s.__wbindgen_export_3(t,e,1)}}get_transform(){let t=s.dotlottieplayerwasm_get_transform(this.__wbg_ptr);return E(t)}segment_start(){return s.dotlottieplayerwasm_segment_start(this.__wbg_ptr)}set_slots_str(t){let e=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),r=c;return s.dotlottieplayerwasm_set_slots_str(this.__wbg_ptr,e,r)!==0}set_text_slot(t,e){let r=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),o=c,i=p(e,s.__wbindgen_export_1,s.__wbindgen_export_2),_=c;return s.dotlottieplayerwasm_set_text_slot(this.__wbg_ptr,r,o,i,_)!==0}set_transform(t){let e=Mt(t,s.__wbindgen_export_1),r=c;return s.dotlottieplayerwasm_set_transform(this.__wbg_ptr,e,r)!==0}sm_get_inputs(){let t=s.dotlottieplayerwasm_sm_get_inputs(this.__wbg_ptr);return E(t)}sm_poll_event(){let t=s.dotlottieplayerwasm_sm_poll_event(this.__wbg_ptr);return E(t)}sm_post_click(t,e){s.dotlottieplayerwasm_sm_post_click(this.__wbg_ptr,t,e)}animation_size(){let t=s.dotlottieplayerwasm_animation_size(this.__wbg_ptr);return E(t)}current_marker(){try{let r=s.__wbindgen_add_to_stack_pointer(-16);s.dotlottieplayerwasm_current_marker(r,this.__wbg_ptr);var t=u().getInt32(r+0,!0),e=u().getInt32(r+4,!0);let o;return t!==0&&(o=m(t,e).slice(),s.__wbindgen_export_3(t,e*1,1)),o}finally{s.__wbindgen_add_to_stack_pointer(16)}}layout_align_x(){return s.dotlottieplayerwasm_layout_align_x(this.__wbg_ptr)}layout_align_y(){return s.dotlottieplayerwasm_layout_align_y(this.__wbg_ptr)}load_animation(t){let e=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),r=c;return s.dotlottieplayerwasm_load_animation(this.__wbg_ptr,e,r)!==0}loop_animation(){return s.dotlottieplayerwasm_loop_animation(this.__wbg_ptr)!==0}set_background(t,e,r,o){return s.dotlottieplayerwasm_set_background(this.__wbg_ptr,t,e,r,o)!==0}set_color_slot(t,e,r,o){let i=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),_=c;return s.dotlottieplayerwasm_set_color_slot(this.__wbg_ptr,i,_,e,r,o)!==0}set_image_slot(t,e){let r=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),o=c,i=p(e,s.__wbindgen_export_1,s.__wbindgen_export_2),_=c;return s.dotlottieplayerwasm_set_image_slot(this.__wbg_ptr,r,o,i,_)!==0}set_loop_count(t){s.dotlottieplayerwasm_set_loop_count(this.__wbg_ptr,t)}set_theme_data(t){let e=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),r=c;return s.dotlottieplayerwasm_set_theme_data(this.__wbg_ptr,e,r)!==0}sm_reset_input(t){let e=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),r=c;s.dotlottieplayerwasm_sm_reset_input(this.__wbg_ptr,e,r)}manifest_string(){let t,e;try{let i=s.__wbindgen_add_to_stack_pointer(-16);s.dotlottieplayerwasm_manifest_string(i,this.__wbg_ptr);var r=u().getInt32(i+0,!0),o=u().getInt32(i+4,!0);return t=r,e=o,m(r,o)}finally{s.__wbindgen_add_to_stack_pointer(16),s.__wbindgen_export_3(t,e,1)}}set_scalar_slot(t,e){let r=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),o=c;return s.dotlottieplayerwasm_set_scalar_slot(this.__wbg_ptr,r,o,e)!==0}set_vector_slot(t,e,r){let o=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),i=c;return s.dotlottieplayerwasm_set_vector_slot(this.__wbg_ptr,o,i,e,r)!==0}setup_sw_target(t,e){return s.dotlottieplayerwasm_setup_sw_target(this.__wbg_ptr,t,e)!==0}get_pixel_buffer(){let t=s.dotlottieplayerwasm_get_pixel_buffer(this.__wbg_ptr);return E(t)}set_audio_volume(t){s.dotlottieplayerwasm_set_audio_volume(this.__wbg_ptr,t)}sm_current_state(){let t,e;try{let i=s.__wbindgen_add_to_stack_pointer(-16);s.dotlottieplayerwasm_sm_current_state(i,this.__wbg_ptr);var r=u().getInt32(i+0,!0),o=u().getInt32(i+4,!0);return t=r,e=o,m(r,o)}finally{s.__wbindgen_add_to_stack_pointer(16),s.__wbindgen_export_3(t,e,1)}}state_machine_id(){try{let r=s.__wbindgen_add_to_stack_pointer(-16);s.dotlottieplayerwasm_state_machine_id(r,this.__wbg_ptr);var t=u().getInt32(r+0,!0),e=u().getInt32(r+4,!0);let o;return t!==0&&(o=m(t,e).slice(),s.__wbindgen_export_3(t,e*1,1)),o}finally{s.__wbindgen_add_to_stack_pointer(16)}}get_state_machine(t){try{let o=s.__wbindgen_add_to_stack_pointer(-16),i=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),_=c;s.dotlottieplayerwasm_get_state_machine(o,this.__wbg_ptr,i,_);var e=u().getInt32(o+0,!0),r=u().getInt32(o+4,!0);let l;return e!==0&&(l=m(e,r).slice(),s.__wbindgen_export_3(e,r*1,1)),l}finally{s.__wbindgen_add_to_stack_pointer(16)}}set_position_slot(t,e,r){let o=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),i=c;return s.dotlottieplayerwasm_set_position_slot(this.__wbg_ptr,o,i,e,r)!==0}current_loop_count(){return s.dotlottieplayerwasm_current_loop_count(this.__wbg_ptr)>>>0}set_asset_resolver(t){s.dotlottieplayerwasm_set_asset_resolver(this.__wbg_ptr,_t(t)?0:f(t))}sm_framework_setup(){let t=s.dotlottieplayerwasm_sm_framework_setup(this.__wbg_ptr);return E(t)}sm_post_pointer_up(t,e){s.dotlottieplayerwasm_sm_post_pointer_up(this.__wbg_ptr,t,e)}state_machine_load(t){let e=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),r=c;return s.dotlottieplayerwasm_state_machine_load(this.__wbg_ptr,e,r)!==0}load_dotlottie_data(t){let e=Z(t,s.__wbindgen_export_1),r=c;return s.dotlottieplayerwasm_load_dotlottie_data(this.__wbg_ptr,e,r)!==0}sm_get_string_input(t){try{let o=s.__wbindgen_add_to_stack_pointer(-16),i=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),_=c;s.dotlottieplayerwasm_sm_get_string_input(o,this.__wbg_ptr,i,_);var e=u().getInt32(o+0,!0),r=u().getInt32(o+4,!0);let l;return e!==0&&(l=m(e,r).slice(),s.__wbindgen_export_3(e,r*1,1)),l}finally{s.__wbindgen_add_to_stack_pointer(16)}}sm_set_string_input(t,e){let r=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),o=c,i=p(e,s.__wbindgen_export_1,s.__wbindgen_export_2),_=c;return s.dotlottieplayerwasm_sm_set_string_input(this.__wbg_ptr,r,o,i,_)!==0}sm_get_boolean_input(t){let e=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),r=c,o=s.dotlottieplayerwasm_sm_get_boolean_input(this.__wbg_ptr,e,r);return o===16777215?void 0:o!==0}sm_get_numeric_input(t){let e=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),r=c,o=s.dotlottieplayerwasm_sm_get_numeric_input(this.__wbg_ptr,e,r);return o===4294967297?void 0:o}sm_post_pointer_down(t,e){s.dotlottieplayerwasm_sm_post_pointer_down(this.__wbg_ptr,t,e)}sm_post_pointer_exit(t,e){s.dotlottieplayerwasm_sm_post_pointer_exit(this.__wbg_ptr,t,e)}sm_post_pointer_move(t,e){s.dotlottieplayerwasm_sm_post_pointer_move(this.__wbg_ptr,t,e)}sm_set_boolean_input(t,e){let r=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),o=c;return s.dotlottieplayerwasm_sm_set_boolean_input(this.__wbg_ptr,r,o,e)!==0}sm_set_numeric_input(t,e){let r=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),o=c;return s.dotlottieplayerwasm_sm_set_numeric_input(this.__wbg_ptr,r,o,e)!==0}state_machine_unload(){s.dotlottieplayerwasm_state_machine_unload(this.__wbg_ptr)}sm_post_pointer_enter(t,e){s.dotlottieplayerwasm_sm_post_pointer_enter(this.__wbg_ptr,t,e)}load_animation_from_id(t){let e=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),r=c;return s.dotlottieplayerwasm_load_animation_from_id(this.__wbg_ptr,e,r)!==0}sm_poll_internal_event(){let t=s.dotlottieplayerwasm_sm_poll_internal_event(this.__wbg_ptr);return E(t)}use_frame_interpolation(){return s.dotlottieplayerwasm_use_frame_interpolation(this.__wbg_ptr)!==0}reset_current_loop_count(){s.dotlottieplayerwasm_reset_current_loop_count(this.__wbg_ptr)}sm_override_current_state(t,e){let r=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),o=c;return s.dotlottieplayerwasm_sm_override_current_state(this.__wbg_ptr,r,o,e)!==0}state_machine_load_from_id(t){let e=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),r=c;return s.dotlottieplayerwasm_state_machine_load_from_id(this.__wbg_ptr,e,r)!==0}set_use_frame_interpolation(t){s.dotlottieplayerwasm_set_use_frame_interpolation(this.__wbg_ptr,t)}constructor(){let t=s.dotlottieplayerwasm_new();return this.__wbg_ptr=t>>>0,it.register(this,this.__wbg_ptr,this),this}mode(){return s.dotlottieplayerwasm_mode(this.__wbg_ptr)}play(){return s.dotlottieplayerwasm_play(this.__wbg_ptr)!==0}stop(){return s.dotlottieplayerwasm_stop(this.__wbg_ptr)!==0}tick(t){return s.dotlottieplayerwasm_tick(this.__wbg_ptr,t)!==0}pause(){return s.dotlottieplayerwasm_pause(this.__wbg_ptr)!==0}speed(){return s.dotlottieplayerwasm_speed(this.__wbg_ptr)}width(){return s.dotlottieplayerwasm_width(this.__wbg_ptr)>>>0}height(){return s.dotlottieplayerwasm_height(this.__wbg_ptr)>>>0}render(){return s.dotlottieplayerwasm_render(this.__wbg_ptr)!==0}status(){return s.dotlottieplayerwasm_status(this.__wbg_ptr)}markers(){let t=s.dotlottieplayerwasm_markers(this.__wbg_ptr);return E(t)}sm_fire(t){let e=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),r=c;return s.dotlottieplayerwasm_sm_fire(this.__wbg_ptr,e,r)!==0}sm_stop(){return s.dotlottieplayerwasm_sm_stop(this.__wbg_ptr)!==0}sm_tick(t){return s.dotlottieplayerwasm_sm_tick(this.__wbg_ptr,t)!==0}autoplay(){return s.dotlottieplayerwasm_autoplay(this.__wbg_ptr)!==0}duration(){return s.dotlottieplayerwasm_duration(this.__wbg_ptr)}set_loop(t){s.dotlottieplayerwasm_set_loop(this.__wbg_ptr,t)}set_mode(t){s.dotlottieplayerwasm_set_mode(this.__wbg_ptr,t)}sm_start(t,e){let r=Ct(e,s.__wbindgen_export_1),o=c;return s.dotlottieplayerwasm_sm_start(this.__wbg_ptr,t,r,o)!==0}theme_id(){try{let r=s.__wbindgen_add_to_stack_pointer(-16);s.dotlottieplayerwasm_theme_id(r,this.__wbg_ptr);var t=u().getInt32(r+0,!0),e=u().getInt32(r+4,!0);let o;return t!==0&&(o=m(t,e).slice(),s.__wbindgen_export_3(t,e*1,1)),o}finally{s.__wbindgen_add_to_stack_pointer(16)}}load_font(t,e){let r=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),o=c,i=Z(e,s.__wbindgen_export_1),_=c;return s.dotlottieplayerwasm_load_font(this.__wbg_ptr,r,o,i,_)!==0}set_frame(t){return s.dotlottieplayerwasm_set_frame(this.__wbg_ptr,t)!==0}set_speed(t){s.dotlottieplayerwasm_set_speed(this.__wbg_ptr,t)}set_theme(t){let e=p(t,s.__wbindgen_export_1,s.__wbindgen_export_2),r=c;return s.dotlottieplayerwasm_set_theme(this.__wbg_ptr,e,r)!==0}sm_status(){let t,e;try{let i=s.__wbindgen_add_to_stack_pointer(-16);s.dotlottieplayerwasm_sm_status(i,this.__wbg_ptr);var r=u().getInt32(i+0,!0),o=u().getInt32(i+4,!0);return t=r,e=o,m(r,o)}finally{s.__wbindgen_add_to_stack_pointer(16),s.__wbindgen_export_3(t,e,1)}}};async function It(n,t){if(typeof Response=="function"&&n instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(n,t)}catch(r){if(n.headers.get("Content-Type")!="application/wasm")console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n",r);else throw r}let e=await n.arrayBuffer();return await WebAssembly.instantiate(e,t)}else{let e=await WebAssembly.instantiate(n,t);return e instanceof WebAssembly.Instance?{instance:e,module:n}:e}}function Lt(){let n={};return n.wbg={},n.wbg.__wbg_buffer_609cc3eee51ed158=function(t){let e=h(t).buffer;return f(e)},n.wbg.__wbg_call_7cccdd69e0791ae2=function(){return L(function(t,e,r){let o=h(t).call(h(e),h(r));return f(o)},arguments)},n.wbg.__wbg_createObjectURL_6e98d2f9c7bd9764=function(){return L(function(t,e){let r=URL.createObjectURL(h(e)),o=p(r,s.__wbindgen_export_1,s.__wbindgen_export_2),i=c;u().setInt32(t+4,i,!0),u().setInt32(t+0,o,!0)},arguments)},n.wbg.__wbg_error_7534b8e9a36f1ab4=function(t,e){let r,o;try{r=t,o=e,console.error(m(t,e))}finally{s.__wbindgen_export_3(r,o,1)}},n.wbg.__wbg_length_a446193dc22c12f8=function(t){return h(t).length},n.wbg.__wbg_new_405e22f390576ce2=function(){let t=new Object;return f(t)},n.wbg.__wbg_new_78feb108b6472713=function(){let t=new Array;return f(t)},n.wbg.__wbg_new_8a6f238a6ece86ea=function(){let t=new Error;return f(t)},n.wbg.__wbg_new_a12002a7f91c75be=function(t){let e=new Uint8Array(h(t));return f(e)},n.wbg.__wbg_newwithbyteoffsetandlength_d97e637ebe145a9a=function(t,e,r){let o=new Uint8Array(h(t),e>>>0,r>>>0);return f(o)},n.wbg.__wbg_newwithlength_5a5efe313cfd59f1=function(t){let e=new Float32Array(t>>>0);return f(e)},n.wbg.__wbg_newwithsrc_20307ca7e8762a81=function(){return L(function(t,e){let r=new Audio(m(t,e));return f(r)},arguments)},n.wbg.__wbg_newwithu8arraysequenceandoptions_068570c487f69127=function(){return L(function(t,e){let r=new Blob(h(t),h(e));return f(r)},arguments)},n.wbg.__wbg_pause_b74c96d69f769518=function(){return L(function(t){h(t).pause()},arguments)},n.wbg.__wbg_play_f6ec5fc4e84b0d26=function(){return L(function(t){let e=h(t).play();return f(e)},arguments)},n.wbg.__wbg_push_737cfc8c1432c2c6=function(t,e){return h(t).push(h(e))},n.wbg.__wbg_revokeObjectURL_27267efebeb457c7=function(){return L(function(t,e){URL.revokeObjectURL(m(t,e))},arguments)},n.wbg.__wbg_set_65595bdd868b3009=function(t,e,r){h(t).set(h(e),r>>>0)},n.wbg.__wbg_set_bb8cecf6a62b9f46=function(){return L(function(t,e,r){return Reflect.set(h(t),h(e),h(r))},arguments)},n.wbg.__wbg_setcurrentTime_64727eddd3966512=function(t,e){h(t).currentTime=e},n.wbg.__wbg_setindex_4e73afdcd9bb95cd=function(t,e,r){h(t)[e>>>0]=r},n.wbg.__wbg_setplaybackRate_f5c3b8896f82425e=function(t,e){h(t).playbackRate=e},n.wbg.__wbg_settype_39ed370d3edd403c=function(t,e,r){h(t).type=m(e,r)},n.wbg.__wbg_setvolume_3895e06a030ca4f7=function(t,e){h(t).volume=e},n.wbg.__wbg_stack_0ed75d68575b0f3c=function(t,e){let r=h(e).stack,o=p(r,s.__wbindgen_export_1,s.__wbindgen_export_2),i=c;u().setInt32(t+4,i,!0),u().setInt32(t+0,o,!0)},n.wbg.__wbindgen_is_null=function(t){return h(t)===null},n.wbg.__wbindgen_is_undefined=function(t){return h(t)===void 0},n.wbg.__wbindgen_memory=function(){let t=s.memory;return f(t)},n.wbg.__wbindgen_number_new=function(t){return f(t)},n.wbg.__wbindgen_object_drop_ref=function(t){E(t)},n.wbg.__wbindgen_string_get=function(t,e){let r=h(e),o=typeof r=="string"?r:void 0;var i=_t(o)?0:p(o,s.__wbindgen_export_1,s.__wbindgen_export_2),_=c;u().setInt32(t+4,_,!0),u().setInt32(t+0,i,!0)},n.wbg.__wbindgen_string_new=function(t,e){let r=m(t,e);return f(r)},n.wbg.__wbindgen_throw=function(t,e){throw new Error(m(t,e))},n}function St(n,t){return s=n.exports,dt.__wbindgen_wasm_module=t,P=null,$=null,B=null,s}async function dt(n){if(s!==void 0)return s;if(typeof n<"u"&&(Object.getPrototypeOf(n)===Object.prototype?{module_or_path:n}=n:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),typeof n>"u")throw new Error("WASM module URL must be provided via DotLottieWasmLoader or setWasmUrl().");let t=Lt();(typeof n=="string"||typeof Request=="function"&&n instanceof Request||typeof URL=="function"&&n instanceof URL)&&(n=fetch(n));let{instance:e,module:r}=await It(await n,t);return St(e,r)}var lt=dt;var H=class{constructor(){d(this,"_eventListeners",new Map)}addEventListener(t,e){let r=this._eventListeners.get(t);r||(r=new Set,this._eventListeners.set(t,r)),r.add(e)}removeEventListener(t,e){let r=this._eventListeners.get(t);r&&(e?(r.delete(e),r.size===0&&this._eventListeners.delete(t)):this._eventListeners.delete(t))}dispatch(t){this._eventListeners.get(t.type)?.forEach(r=>r(t))}removeAllEventListeners(){this._eventListeners.clear()}};var v=class v{static _initializeObserver(){if(v._observer)return;let t=e=>{e.forEach(r=>{let o=v._observedCanvases.get(r.target);o&&(r.isIntersecting?o.unfreeze():o.freeze())})};v._observer=new IntersectionObserver(t,{threshold:0})}static observe(t,e){v._initializeObserver(),!v._observedCanvases.has(t)&&(v._observedCanvases.set(t,e),v._observer?.observe(t))}static unobserve(t){v._observer?.unobserve(t),v._observedCanvases.delete(t),v._observedCanvases.size===0&&(v._observer?.disconnect(),v._observer=null)}};d(v,"_observer",null),d(v,"_observedCanvases",new Map);var x=v;var g=class g{static _initializeObserver(){if(g._observer)return;let t=e=>{e.forEach(r=>{let o=g._observedCanvases.get(r.target);if(!o)return;let[i,_]=o;clearTimeout(_);let l=setTimeout(()=>{i.resize()},100);g._observedCanvases.set(r.target,[i,l])})};g._observer=new ResizeObserver(t)}static observe(t,e){g._initializeObserver(),!g._observedCanvases.has(t)&&(g._observedCanvases.set(t,[e,0]),g._observer?.observe(t))}static unobserve(t){let e=g._observedCanvases.get(t);if(e){let r=e[1];r&&clearTimeout(r)}g._observer?.unobserve(t),g._observedCanvases.delete(t),!g._observedCanvases.size&&g._observer&&(g._observer.disconnect(),g._observer=null)}};d(g,"_observer",null),d(g,"_observedCanvases",new Map);var k=g;function xt(n){return/^#([\da-f]{6}|[\da-f]{8})$/iu.test(n)}function pt(n){if(!xt(n))return[0,0,0,0];let t=n.replace("#","");t=t.length===6?`${t}ff`:t;let e=parseInt(t.slice(0,2),16)/255,r=parseInt(t.slice(2,4),16)/255,o=parseInt(t.slice(4,6),16)/255,i=parseInt(t.slice(6,8),16)/255;return[e,r,o,i]}function Q(n){if(n.byteLength<4)return!1;let t=new Uint8Array(n.slice(0,N.byteLength));for(let e=0;e<N.length;e+=1)if(N[e]!==t[e])return!1;return!0}function kt(n){return rt.every(t=>Object.hasOwn(n,t))}function q(n){return typeof n=="string"?/^\s*\{/u.test(n)&&/\}\s*$/u.test(n):kt(n)}function tt(){return 1+((y?window.devicePixelRatio:1)-1)*st}function V(n){let t=n.getBoundingClientRect(),e=window.innerHeight||document.documentElement.clientHeight,r=window.innerWidth||document.documentElement.clientWidth;return!(t.bottom<0||t.top>e||t.right<0||t.left>r)}function T(n){let t=n.target;if(t instanceof HTMLCanvasElement){let e=t.getBoundingClientRect();if(e.width===0||e.height===0||t.width===0||t.height===0)return null;let r=t.width/e.width,o=t.height/e.height,i=(n.clientX-e.left)*r,_=(n.clientY-e.top)*o;return!Number.isFinite(i)||!Number.isFinite(_)||Number.isNaN(i)||Number.isNaN(_)?null:{x:i,y:_}}return null}function Rt(n){return new Promise((t,e)=>{let r=new FileReader;r.onerror=()=>e(r.error??new Error("Failed to read image slot source")),r.onload=()=>t(r.result),r.readAsDataURL(n)})}async function ut(n){if(!/^https?:\/\//i.test(n))return n;let t=await fetch(n);if(!t.ok)throw new Error(`Failed to fetch image slot source from URL: ${n}. ${t.status}: ${t.statusText}`);return Rt(await t.blob())}function ht(n){let t=n.replace("OpenUrl: ",""),e=t.indexOf(" | Target: "),r,o;e===-1?(r=t,o="_blank"):(r=t.substring(0,e),o=t.substring(e+11)),window.open(r,o)}function mt(n,t,e){let r=null,o=t,i=e;async function _(w){await n({module_or_path:w})}async function l(w){let C=await fetch(w);if(!C.ok)throw new Error(`fetch ${w} responded with ${C.status} ${C.statusText}`);let R=await C.arrayBuffer();await n({module_or_path:R})}async function b(w,C){try{return await w(C),null}catch(R){return R}}return{load(){if(!r){let w=o,C=null;C=(async()=>{let R=await b(_,w);if(!R)return;console.warn(`Primary WASM load failed from ${w}: ${R.message}`);let F=null;if(i!==null){if(console.warn(`Attempting to load WASM from backup URL: ${i}`),F=await b(_,i),!F)return;console.warn(`Backup WASM load failed from ${i}: ${F.message}`)}console.warn("Retrying WASM load with buffered instantiation");let O=await b(l,w);if(O&&(console.warn(`Buffered WASM load from ${w} failed: ${O.message}`),!(i!==null&&(O=await b(l,i),!O))))throw console.error(`Primary WASM URL failed: ${R.message}`),F&&console.error(`Backup WASM URL failed: ${F.message}`),console.error(`Buffered fallback failed: ${O.message}`),r===C&&(r=null),new Error("WASM loading failed from all sources.")})(),r=C}return r},setWasmUrl(w){if(typeof w!="string"||w.trim()==="")throw new TypeError("setWasmUrl() expects a non-empty URL string");i=null,w!==o&&(o=w,r=null)}}}var gt=null;function j(){return gt??(gt=mt(lt,`https://cdn.jsdelivr.net/npm/${X}@${Y}/dist/dotlottie-player.wasm`,`https://unpkg.com/${X}@${Y}/dist/dotlottie-player.wasm`)),gt}var et=n=>{switch(n){case"reverse":return S.Reverse;case"bounce":return S.Bounce;case"reverse-bounce":return S.ReverseBounce;default:return S.Forward}},ft=n=>{switch(n){case S.Reverse:return"reverse";case S.Bounce:return"bounce";case S.ReverseBounce:return"reverse-bounce";default:return"forward"}},Pt=n=>{switch(n){case"contain":return"contain";case"cover":return"cover";case"fill":return"fill";case"fit-height":return"fit-height";case"fit-width":return"fit-width";case"none":return"none";default:return"contain"}},A=class{constructor(t){d(this,"_canvas",null);d(this,"_pendingLoad",null);d(this,"_srcFetchAbort",null);d(this,"_context",null);d(this,"_eventManager");d(this,"_animationFrameId",null);d(this,"_frameManager");d(this,"_boundAnimationLoop");d(this,"_dotLottieCore",null);d(this,"_stateMachineId","");d(this,"_themeId","");d(this,"_animationId","");d(this,"_stateMachineConfig",null);d(this,"_isStateMachineRunning",!1);d(this,"_renderConfig",{});d(this,"_isFrozen",!1);d(this,"_backgroundColor",null);d(this,"_volume",1);d(this,"_lastFrameTime",null);d(this,"_boundOnClick",null);d(this,"_boundOnPointerUp",null);d(this,"_boundOnPointerDown",null);d(this,"_boundOnPointerMove",null);d(this,"_boundOnPointerEnter",null);d(this,"_boundOnPointerLeave",null);d(this,"_bufferMismatchCount",0);d(this,"_lastExpectedBufferSize",0);d(this,"_cachedImageData",null);d(this,"_cachedImageDataBuffer",null);d(this,"_cachedImageDataByteOffset",0);d(this,"_marker","");d(this,"_segment",null);this._canvas=t.canvas??null,this._eventManager=new H,this._frameManager=new U,this._boundAnimationLoop=this._animationLoop.bind(this),this._renderConfig={...t.renderConfig,devicePixelRatio:t.renderConfig?.devicePixelRatio||tt(),freezeOnOffscreen:t.renderConfig?.freezeOnOffscreen??!0},t.volume!==void 0&&this.setVolume(t.volume);let e=null;t.src&&!t.data&&(this._srcFetchAbort=new AbortController,e=this._fetchData(t.src,this._srcFetchAbort.signal),e.catch(()=>{})),this._initWasm().then(()=>{this._dotLottieCore=this._createCore(),this._dotLottieCore.set_autoplay(t.autoplay??!1),this._dotLottieCore.set_loop(t.loop??!1),this._dotLottieCore.set_loop_count(t.loopCount??0),this._dotLottieCore.set_mode(et(t.mode??"forward")),this._dotLottieCore.set_speed(t.speed??1),this._dotLottieCore.set_use_frame_interpolation(t.useFrameInterpolation??!0),t.segment&&t.segment.length===2&&(this._segment=[t.segment[0],t.segment[1]],this._dotLottieCore.set_segment(this._segment[0],this._segment[1])),this._marker=t.marker??"",this._marker&&this._dotLottieCore.set_marker(this._marker),this._dotLottieCore.set_layout(t.layout?.fit??"contain",t.layout?.align?.[0]??.5,t.layout?.align?.[1]??.5),this._applyAssetResolver(t.assetResolver??null),this._stateMachineId=t.stateMachineId??"",this._themeId=t.themeId??"",this._animationId=t.animationId??"",this._stateMachineConfig=t.stateMachineConfig??null,this._onCoreCreated(),this._eventManager.dispatch({type:"ready"}),t.data?this._canvas?this._loadFromData(t.data):this._pendingLoad={data:t.data}:t.src&&(this._canvas?this._loadFromSrc(t.src,e):this._pendingLoad={src:t.src,dataPromise:e}),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor)}).catch(r=>{this._srcFetchAbort?.abort(),console.error("[dotlottie-web] Initialization failed:",r),this._eventManager.dispatch({type:"loadError",error:new Error(`Failed to load wasm module: ${r}`)})})}async _initWasm(){return j().load()}_createCore(){return new G}_onCoreCreated(){}_setupTarget(t,e){return this._dotLottieCore?this._dotLottieCore.setup_sw_target(t,e):!1}_drainPlayerEvents({skipFrame:t=!1}={}){if(this._dotLottieCore)for(;;){let e=this._dotLottieCore.poll_event();if(e==null)break;switch(e.type){case"Load":this._dotLottieCore.set_audio_volume(this._volume),setTimeout(()=>this._eventManager.dispatch({type:"load"}),0);break;case"LoadError":setTimeout(()=>this._eventManager.dispatch({type:"loadError",error:new Error("failed to load")}),0);break;case"Play":queueMicrotask(()=>this._eventManager.dispatch({type:"play"}));break;case"Pause":queueMicrotask(()=>this._eventManager.dispatch({type:"pause"}));break;case"Stop":queueMicrotask(()=>this._eventManager.dispatch({type:"stop"}));break;case"Frame":{let r=e.frameNo??0;t||queueMicrotask(()=>this._eventManager.dispatch({type:"frame",currentFrame:r}));break}case"Render":{let r=e.frameNo??0;t||queueMicrotask(()=>this._eventManager.dispatch({type:"render",currentFrame:r}));break}case"Loop":{let r=e.loopCount??0;queueMicrotask(()=>this._eventManager.dispatch({type:"loop",loopCount:r}));break}case"Complete":queueMicrotask(()=>this._eventManager.dispatch({type:"complete"}));break;default:break}}}_discardPlayerEvents(){for(;this._dotLottieCore?.poll_event()!=null;);}_drainSmEvents(){if(this._dotLottieCore){for(;;){let t=this._dotLottieCore.sm_poll_event();if(t==null)break;switch(t.type){case"Start":queueMicrotask(()=>{this._isStateMachineRunning=!0,this._eventManager.dispatch({type:"stateMachineStart"}),this._startAnimationLoop()});break;case"Stop":queueMicrotask(()=>{this._isStateMachineRunning=!1,this._eventManager.dispatch({type:"stateMachineStop"}),this._dotLottieCore?.status()!==M.Playing&&this._stopAnimationLoop()});break;case"CustomEvent":this._eventManager.dispatch({type:"stateMachineCustomEvent",eventName:t.message??""});break;case"BooleanInputChange":this._eventManager.dispatch({type:"stateMachineBooleanInputValueChange",inputName:t.name??"",newValue:t.newValue,oldValue:t.oldValue});break;case"NumericInputChange":this._eventManager.dispatch({type:"stateMachineNumericInputValueChange",inputName:t.name??"",newValue:t.newValue,oldValue:t.oldValue});break;case"StringInputChange":this._eventManager.dispatch({type:"stateMachineStringInputValueChange",inputName:t.name??"",newValue:t.newValue,oldValue:t.oldValue});break;case"InputFired":this._eventManager.dispatch({type:"stateMachineInputFired",inputName:t.name??""});break;case"Transition":this._eventManager.dispatch({type:"stateMachineTransition",fromState:t.previousState??"",toState:t.newState??""});break;case"StateEntered":this._eventManager.dispatch({type:"stateMachineStateEntered",state:t.state??""});break;case"StateExit":this._eventManager.dispatch({type:"stateMachineStateExit",state:t.state??""});break;case"Error":this._eventManager.dispatch({type:"stateMachineError",error:t.message??""});break;default:break}}for(;;){let t=this._dotLottieCore.sm_poll_internal_event();if(t==null)break;if(t.type==="Message"){let e=t.message??"";y&&e.startsWith("OpenUrl: ")?ht(e):this._eventManager.dispatch({type:"stateMachineInternalMessage",message:e})}}}}_dispatchError(t){console.error(t),this._eventManager.dispatch({type:"loadError",error:new Error(t)})}async _fetchData(t,e=null){let r=await fetch(t,{signal:e});if(!r.ok)throw new Error(`Failed to fetch animation data from URL: ${t}. ${r.status}: ${r.statusText}`);let o=await r.arrayBuffer();return Q(o)?o:new TextDecoder().decode(o)}_loadFromData(t){if(this._dotLottieCore===null)return;if(!this._canvas){console.warn("[dotlottie-web] Cannot load animation without canvas. Call setCanvas() first.");return}this._syncCanvasSize(),this._setupTarget(this._canvas.width,this._canvas.height);let e=!1;if(typeof t=="string"){if(e=this._dotLottieCore.load_animation(t),!e&&!q(t)){this._discardPlayerEvents(),this._dispatchError("Invalid Lottie JSON string: The provided string does not conform to the Lottie JSON format.");return}}else if(t instanceof ArrayBuffer){if(!Q(t)){this._dispatchError("Invalid dotLottie ArrayBuffer: The provided ArrayBuffer does not conform to the dotLottie format.");return}e=this._dotLottieCore.load_dotlottie_data(new Uint8Array(t)),e&&this._animationId&&this._dotLottieCore.animation_id()!==this._animationId&&(this._discardPlayerEvents(),e=this._dotLottieCore.load_animation_from_id(this._animationId))}else if(typeof t=="object"){if(!q(t)){this._dispatchError("Invalid Lottie JSON object: The provided object does not conform to the Lottie JSON format.");return}e=this._dotLottieCore.load_animation(JSON.stringify(t))}else{this._dispatchError(`Unsupported data type for animation data. Expected:
- string (Lottie JSON),
- ArrayBuffer (dotLottie),
- object (Lottie JSON).
Received: ${typeof t}`);return}if(e){if(this._renderConfig.quality!==void 0&&this._dotLottieCore.set_quality(this._renderConfig.quality),this._themeId&&this._dotLottieCore.set_theme(this._themeId),this._drainPlayerEvents({skipFrame:!!this._marker||!!this._segment}),this._marker&&this._dotLottieCore.set_marker(this._marker),this._segment){this._dotLottieCore.set_segment(this._segment[0],this._segment[1]);let r=ft(this._dotLottieCore.mode()),o=r==="reverse"||r==="reverse-bounce"?this._segment[1]:this._segment[0];this._dotLottieCore.set_frame(o)}setTimeout(()=>{this._eventManager.dispatch({type:"frame",currentFrame:this.currentFrame})},0),this._dotLottieCore.render(),this._drainPlayerEvents(),this._draw(),this._stateMachineId?this.stateMachineLoad(this._stateMachineId)&&this.stateMachineStart()&&this._startAnimationLoop():this._dotLottieCore.status()===M.Playing&&this._startAnimationLoop(),y&&this._canvas instanceof HTMLCanvasElement&&(this._renderConfig.freezeOnOffscreen&&(x.observe(this._canvas,this),V(this._canvas)||this.freeze()),this._renderConfig.autoResize&&k.observe(this._canvas,this))}else this._drainPlayerEvents()}_loadFromSrc(t,e){(e??this._fetchData(t)).then(r=>this._loadFromData(r)).catch(r=>this._dispatchError(`Failed to load animation data from URL: ${t}. ${r}`))}get buffer(){return this._dotLottieCore?this._dotLottieCore.get_pixel_buffer():null}get activeAnimationId(){return this._dotLottieCore?.animation_id()??void 0}get activeThemeId(){return this._dotLottieCore?.theme_id()??void 0}get layout(){if(this._dotLottieCore)return{align:[this._dotLottieCore.layout_align_x(),this._dotLottieCore.layout_align_y()],fit:Pt(this._dotLottieCore.layout_fit())}}get marker(){return this._dotLottieCore?.current_marker()??""}get manifest(){try{let t=this._dotLottieCore?.manifest_string();if(this._dotLottieCore===null||!t)return null;let e=JSON.parse(t);return Object.keys(e).length===0?null:e}catch{return null}}get renderConfig(){return this._renderConfig}get segment(){if(this._dotLottieCore)return[this._dotLottieCore.segment_start(),this._dotLottieCore.segment_end()]}get loop(){return this._dotLottieCore?.loop_animation()??!1}get mode(){return this._dotLottieCore?ft(this._dotLottieCore.mode()):"forward"}get isFrozen(){return this._isFrozen}get isStateMachineRunning(){return this._isStateMachineRunning}get backgroundColor(){return this._backgroundColor??""}get autoplay(){return this._dotLottieCore?.autoplay()??!1}get useFrameInterpolation(){return this._dotLottieCore?.use_frame_interpolation()??!1}get speed(){return this._dotLottieCore?.speed()??0}get volume(){return this._volume}get isReady(){return this._dotLottieCore!==null}get isLoaded(){return(this._dotLottieCore?.status()??M.Idle)!==M.Idle}get isPlaying(){return this._dotLottieCore?.status()===M.Playing}get isPaused(){return this._dotLottieCore?.status()===M.Paused}get isStopped(){return this._dotLottieCore?.status()===M.Stopped}get currentFrame(){return this._dotLottieCore?Math.round(this._dotLottieCore.current_frame()*100)/100:0}get loopCount(){return this._dotLottieCore?.current_loop_count()??0}get totalFrames(){return this._dotLottieCore?.total_frames()??0}get duration(){return(this._dotLottieCore?.duration()??0)/1e3}get canvas(){return this._canvas}load(t){this._dotLottieCore!==null&&(this._stopAnimationLoop(),this._cleanupCanvas(),this._isFrozen=!1,this._dotLottieCore.set_autoplay(t.autoplay??!1),this._dotLottieCore.set_loop(t.loop??!1),this._dotLottieCore.set_loop_count(t.loopCount??0),this._dotLottieCore.set_mode(et(t.mode??"forward")),this._dotLottieCore.set_speed(t.speed??1),this._dotLottieCore.set_use_frame_interpolation(t.useFrameInterpolation??!0),t.segment&&t.segment.length===2?(this._segment=[t.segment[0],t.segment[1]],this._dotLottieCore.set_segment(this._segment[0],this._segment[1])):(this._segment=null,this._dotLottieCore.clear_segment()),this._marker=t.marker??"",this._marker?this._dotLottieCore.set_marker(this._marker):this._dotLottieCore.clear_marker(),this._themeId=t.themeId??"",this._animationId=t.animationId??"",this._dotLottieCore.set_layout(t.layout?.fit??"contain",t.layout?.align?.[0]??.5,t.layout?.align?.[1]??.5),this._applyAssetResolver(t.assetResolver??null),t.data?this._canvas?this._loadFromData(t.data):this._pendingLoad={data:t.data}:t.src&&(this._canvas?this._loadFromSrc(t.src):this._pendingLoad={src:t.src}),t.backgroundColor&&this.setBackgroundColor(t.backgroundColor))}_draw(){if(this._dotLottieCore===null||this._canvas===null||(!this._context&&"getContext"in this._canvas&&typeof this._canvas.getContext=="function"&&(!y||typeof HTMLCanvasElement<"u"&&this._canvas instanceof HTMLCanvasElement||typeof OffscreenCanvas<"u"&&this._canvas instanceof OffscreenCanvas)&&(this._context=this._canvas.getContext("2d")),!this._context))return;let t=this._dotLottieCore.get_pixel_buffer(),e=this._canvas.width,r=this._canvas.height,o=e*r*ot;if(t.byteLength!==o){this._lastExpectedBufferSize===o?this._bufferMismatchCount+=1:(this._bufferMismatchCount=1,this._lastExpectedBufferSize=o),this._bufferMismatchCount===10&&console.warn(`[dotlottie-web] Persistent buffer size mismatch detected. Expected ${o} bytes for canvas ${e}x${r}, but got ${t.byteLength} bytes. This may indicate a WASM memory allocation issue or invalid canvas dimensions.`);return}this._bufferMismatchCount=0,this._lastExpectedBufferSize=o;let i=this._cachedImageData;if(!(i!==null&&i.width===e&&i.height===r&&i.data.byteLength===o&&this._cachedImageDataBuffer===t.buffer&&this._cachedImageDataByteOffset===t.byteOffset)){if(typeof ImageData>"u")this._cachedImageData=this._context.createImageData(e,r);else{let l=new Uint8ClampedArray(t.buffer,t.byteOffset,t.byteLength);this._cachedImageData=new ImageData(l,e,r)}this._cachedImageDataBuffer=t.buffer,this._cachedImageDataByteOffset=t.byteOffset}if(typeof ImageData>"u"){let l=new Uint8ClampedArray(t.buffer,t.byteOffset,t.byteLength);this._cachedImageData.data.set(l)}this._context.putImageData(this._cachedImageData,0,0)}_cleanupCanvas(){this._canvas&&y&&this._canvas instanceof HTMLCanvasElement&&(x.unobserve(this._canvas),k.unobserve(this._canvas),this._cleanupStateMachineListeners())}_initializeCanvas(){this._setupRendererOnCanvas(),this._canvas&&y&&this._canvas instanceof HTMLCanvasElement&&this.isLoaded&&(this._renderConfig.freezeOnOffscreen&&(x.observe(this._canvas,this),V(this._canvas)||this.freeze()),this._renderConfig.autoResize&&k.observe(this._canvas,this),this._isStateMachineRunning&&this._setupStateMachineListeners()),this._canvas&&this._dotLottieCore&&this.isLoaded&&this._setupTarget(this._canvas.width,this._canvas.height)&&(this._dotLottieCore.render(),this._draw())}_setupRendererOnCanvas(){this._context=null}_stopAnimationLoop(){this._animationFrameId!==null&&(this._frameManager.cancelAnimationFrame(this._animationFrameId),this._animationFrameId=null),this._lastFrameTime=null}_startAnimationLoop(){this._animationFrameId===null&&this._dotLottieCore&&!this._isFrozen&&(this._dotLottieCore.status()===M.Playing||this._isStateMachineRunning)&&(this._animationFrameId=this._frameManager.requestAnimationFrame(this._boundAnimationLoop))}_animationLoop(t){if(this._dotLottieCore===null){this._stopAnimationLoop();return}if(this._dotLottieCore.status()!==M.Playing&&!this._isStateMachineRunning){this._stopAnimationLoop();return}try{let e=this._lastFrameTime!==null?t-this._lastFrameTime:0;this._lastFrameTime=t;let r=this._isStateMachineRunning?this._dotLottieCore.sm_tick(e):this._dotLottieCore.tick(e);this._isStateMachineRunning?this._drainSmEvents():this._drainPlayerEvents(),r&&this._draw(),this._animationFrameId=this._frameManager.requestAnimationFrame(this._boundAnimationLoop)}catch(e){console.error("Error in animation frame:",e),this._eventManager.dispatch({type:"renderError",error:e}),e instanceof WebAssembly.RuntimeError&&this.destroy()}}play(){if(this._dotLottieCore===null||!this.isLoaded)return;this._stopAnimationLoop();let t=this._dotLottieCore.play();this._drainPlayerEvents(),(t||this._dotLottieCore.status()===M.Playing)&&(this._isFrozen=!1,this._startAnimationLoop()),this._canvas&&y&&this._canvas instanceof HTMLCanvasElement&&this._renderConfig.freezeOnOffscreen&&!V(this._canvas)&&this.freeze()}pause(){this._dotLottieCore!==null&&(this._dotLottieCore.pause(),this._drainPlayerEvents(),this._stopAnimationLoop())}stop(){if(this._dotLottieCore===null)return;let t=this._dotLottieCore.stop();this._drainPlayerEvents(),this._stopAnimationLoop(),t&&(this._eventManager.dispatch({type:"frame",currentFrame:this.currentFrame}),this._dotLottieCore.render(),this._draw())}setFrame(t){if(this._dotLottieCore===null)return;if(this._dotLottieCore.set_frame(t)){let r=this._dotLottieCore.render();this._drainPlayerEvents(),r&&this._draw()}}setSpeed(t){this._dotLottieCore!==null&&this._dotLottieCore.set_speed(t)}setVolume(t){Number.isNaN(t)||(this._volume=Math.min(Math.max(t,0),1),this._dotLottieCore?.set_audio_volume(this._volume))}setBackgroundColor(t){if(this._dotLottieCore!==null){if(y&&this._canvas instanceof HTMLCanvasElement)this._canvas.style.backgroundColor=t;else{let[e,r,o,i]=pt(t);this._dotLottieCore.set_background(e,r,o,i)}this._backgroundColor=t}}setLoop(t){this._dotLottieCore!==null&&this._dotLottieCore.set_loop(t)}setLoopCount(t){this._dotLottieCore!==null&&this._dotLottieCore.set_loop_count(t)}setUseFrameInterpolation(t){this._dotLottieCore!==null&&this._dotLottieCore.set_use_frame_interpolation(t)}_applyAssetResolver(t){if(this._dotLottieCore!==null){if(t===null){this._dotLottieCore.set_asset_resolver(null);return}this._dotLottieCore.set_asset_resolver(e=>{try{return t(e)??null}catch(r){return console.error(`[dotlottie-web] assetResolver threw for "${e}":`,r),null}})}}addEventListener(t,e){this._eventManager.addEventListener(t,e)}removeEventListener(t,e){this._eventManager.removeEventListener(t,e)}destroy(){this._stopAnimationLoop(),this._isStateMachineRunning=!1,this._cleanupCanvas(),this._srcFetchAbort?.abort(),this._srcFetchAbort=null,this._pendingLoad=null;let t=this._dotLottieCore;if(this._dotLottieCore=null,this._context=null,t)try{t.free()}catch(e){console.warn("[dotlottie-web] Error freeing wasm core during destroy:",e)}this._eventManager.dispatch({type:"destroy"}),this._eventManager.removeAllEventListeners(),this._cleanupStateMachineListeners()}freeze(){this._animationFrameId!==null&&(this._stopAnimationLoop(),this._isFrozen=!0,this._eventManager.dispatch({type:"freeze"}))}unfreeze(){this._animationFrameId===null&&(this._isFrozen=!1,this._eventManager.dispatch({type:"unfreeze"}),this._startAnimationLoop())}_syncCanvasSize(){if(!(y&&this._canvas instanceof HTMLCanvasElement))return;let t=this._renderConfig.devicePixelRatio||window.devicePixelRatio||1,{height:e,width:r}=this._canvas.getBoundingClientRect();e!==0&&r!==0&&(this._canvas.width=r*t,this._canvas.height=e*t)}resize(){if(!this._dotLottieCore||!this.isLoaded||!this._canvas)return;this._syncCanvasSize(),this._setupTarget(this._canvas.width,this._canvas.height)&&(this._dotLottieCore.render(),this._draw())}setCanvas(t){if(!(!t||this._canvas===t)&&(this._canvas&&this._cleanupCanvas(),this._canvas=t,this._initializeCanvas(),this._pendingLoad)){let e=this._pendingLoad;this._pendingLoad=null,e.data?this._loadFromData(e.data):e.src&&this._loadFromSrc(e.src,e.dataPromise)}}setTransform(t){if(!this._dotLottieCore)return!1;let e=this._dotLottieCore.set_transform(new Float32Array(t));return e&&this._dotLottieCore.render()&&this._draw(),e}getTransform(){if(!this._dotLottieCore)return;let t=this._dotLottieCore.get_transform();return Array.from(t)}setSegment(t,e){this._dotLottieCore!==null&&(this._segment=[t,e],this._dotLottieCore.set_segment(t,e))}resetSegment(){this._dotLottieCore!==null&&(this._segment=null,this._dotLottieCore.clear_segment())}setMode(t){this._dotLottieCore!==null&&this._dotLottieCore.set_mode(et(t))}setRenderConfig(t){let{devicePixelRatio:e,freezeOnOffscreen:r,quality:o,...i}=t;this._renderConfig={...this._renderConfig,...i,devicePixelRatio:e||tt(),freezeOnOffscreen:r??!0,...o!==void 0&&{quality:o}},o!==void 0&&this._dotLottieCore&&this._dotLottieCore.set_quality(o),y&&this._canvas instanceof HTMLCanvasElement&&(this._renderConfig.autoResize?k.observe(this._canvas,this):k.unobserve(this._canvas),this._renderConfig.freezeOnOffscreen?(x.observe(this._canvas,this),V(this._canvas)||this.freeze()):(x.unobserve(this._canvas),this._isFrozen&&this.unfreeze()))}loadAnimation(t){if(this._dotLottieCore===null||this._dotLottieCore.animation_id()===t||!this._canvas)return;this._syncCanvasSize(),this._setupTarget(this._canvas.width,this._canvas.height),this._dotLottieCore.load_animation_from_id(t)?(this._renderConfig.quality!==void 0&&this._dotLottieCore.set_quality(this._renderConfig.quality),this._drainPlayerEvents(),this._dotLottieCore.render(),this._draw()):this._dispatchError(`Failed to load animation with id: ${t}`)}setMarker(t){if(this._dotLottieCore===null)return;this.markers().some(o=>o.name===t)?(this._marker=t,this._dotLottieCore.set_marker(t)):(this._marker="",this._segment=null,this._dotLottieCore.clear_marker(),this._dotLottieCore.clear_segment())}markers(){let t=this._dotLottieCore?.markers();return t&&Array.isArray(t)?t:[]}setTheme(t){if(this._dotLottieCore===null)return!1;let e=this._dotLottieCore.set_theme(t);return e&&(this._dotLottieCore.render(),this._draw()),e}resetTheme(){if(this._dotLottieCore===null)return!1;let t=this._dotLottieCore.reset_theme();return t&&(this._dotLottieCore.render(),this._draw()),t}setThemeData(t){if(this._dotLottieCore===null)return!1;let e=typeof t=="string"?t:JSON.stringify(t),r=this._dotLottieCore.set_theme_data(e);return r&&(this._dotLottieCore.render(),this._draw()),r}setSlots(t){this._dotLottieCore!==null&&this._dotLottieCore.set_slots_str(JSON.stringify(t))&&(this._dotLottieCore.render(),this._draw())}_isKeyframeArray(t){return Array.isArray(t)&&t.length>0&&typeof t[0]=="object"&&t[0]!==null&&"t"in t[0]&&"s"in t[0]}getSlotIds(){if(!this._dotLottieCore)return[];let t=this._dotLottieCore.get_slot_ids();return Array.isArray(t)?t:[]}getSlotType(t){if(!this._dotLottieCore)return;let e=this._dotLottieCore.get_slot_type(t);if(e)return e}getSlot(t){if(!this._dotLottieCore)return;let e=this._dotLottieCore.get_slot_str(t);if(e)try{return JSON.parse(e)}catch{return}}getSlots(){if(!this._dotLottieCore)return{};try{return JSON.parse(this._dotLottieCore.get_slots_str())}catch{return{}}}setColorSlot(t,e){if(this._dotLottieCore===null)return!1;let r=this._isKeyframeArray(e),o=JSON.stringify({a:r?1:0,k:e}),i=this._dotLottieCore.set_slot_str(t,o);return this._dotLottieCore.render(),this._draw(),i}setScalarSlot(t,e){if(this._dotLottieCore===null)return!1;let o=JSON.stringify({a:typeof e!="number"?1:0,k:e}),i=this._dotLottieCore.set_slot_str(t,o);return this._dotLottieCore.render(),this._draw(),i}setVectorSlot(t,e){if(this._dotLottieCore===null)return!1;let r=this._isKeyframeArray(e),o=JSON.stringify({a:r?1:0,k:e}),i=this._dotLottieCore.set_slot_str(t,o);return this._dotLottieCore.render(),this._draw(),i}setGradientSlot(t,e,r){if(this._dotLottieCore===null)return!1;let o=this._isKeyframeArray(e),i=JSON.stringify({k:{a:o?1:0,k:e},p:r}),_=this._dotLottieCore.set_slot_str(t,i);return this._dotLottieCore.render(),this._draw(),_}setTextSlot(t,e){if(this._dotLottieCore===null)return!1;let r=this._dotLottieCore.get_slot_str(t),o=e;if(r){let l=JSON.parse(r);if(l&&"k"in l&&Array.isArray(l.k)){let b=l.k[0];"s"in b&&typeof b.s=="object"&&(o={...b.s,...e})}}let i=JSON.stringify({a:0,k:[{t:0,s:o}]}),_=this._dotLottieCore.set_slot_str(t,i);return this._dotLottieCore.render(),this._draw(),_}async setImageSlot(t,e){if(this._dotLottieCore===null)return!1;let r=await ut(e);if(this._dotLottieCore===null)return!1;let o=this._dotLottieCore.set_image_slot(t,r);return this._dotLottieCore.render(),this._draw(),o}resetSlot(t){if(this._dotLottieCore===null)return!1;let e=this._dotLottieCore.reset_slot(t);return this._dotLottieCore.render(),this._draw(),e}clearSlot(t){if(this._dotLottieCore===null)return!1;let e=this._dotLottieCore.clear_slot(t);return this._dotLottieCore.render(),this._draw(),e}resetSlots(){if(this._dotLottieCore===null)return!1;let t=this._dotLottieCore.reset_slots();return this._dotLottieCore.render(),this._draw(),t}clearSlots(){if(this._dotLottieCore===null)return!1;let t=this._dotLottieCore.clear_slots();return this._dotLottieCore.render(),this._draw(),t}setLayout(t){this._dotLottieCore!==null&&this._dotLottieCore.set_layout(t.fit??"contain",t.align?.[0]??.5,t.align?.[1]??.5)}setViewport(t,e,r,o){return this._dotLottieCore===null?!1:this._dotLottieCore.set_viewport(t,e,r,o)}static setWasmUrl(t){j().setWasmUrl(t)}static preload(){return j().load()}static async registerFont(t,e){try{await j().load();let r;if(typeof e=="string"){let i=await fetch(e);if(!i.ok)return console.error(`Failed to fetch font from URL: ${e}. Status: ${i.status}`),!1;r=new Uint8Array(await i.arrayBuffer())}else e instanceof Uint8Array?r=e:r=new Uint8Array(e);let o=ct(t,r);return o||console.error(`Failed to register font "${t}". Font data may be invalid.`),o}catch(r){return console.error(`Error registering font "${t}":`,r),!1}}animationSize(){let t=this._dotLottieCore?.animation_size();return{width:t?.[0]??0,height:t?.[1]??0}}stateMachineLoad(t){return this._dotLottieCore?this._dotLottieCore.state_machine_load_from_id(t):!1}stateMachineLoadData(t){return this._dotLottieCore?this._dotLottieCore.state_machine_load(t):!1}stateMachineSetConfig(t){this._stateMachineConfig=t}stateMachineStart(){if(this._dotLottieCore===null)return!1;let t=this._dotLottieCore.sm_start(this._stateMachineConfig?.openUrlPolicy?.requireUserInteraction??!0,this._stateMachineConfig?.openUrlPolicy?.whitelist??[]);return this._drainSmEvents(),t&&(this._isStateMachineRunning=!0,this._setupStateMachineListeners(),this._startAnimationLoop()),t}stateMachineStop(){if(!this._dotLottieCore)return!1;let t=this._dotLottieCore.sm_stop();return this._drainSmEvents(),t&&(this._isStateMachineRunning=!1,this._cleanupStateMachineListeners(),this._dotLottieCore.status()!==M.Playing&&this._stopAnimationLoop()),t}stateMachineGetStatus(){return this._dotLottieCore?.sm_status()??""}stateMachineGetCurrentState(){return this._dotLottieCore?.sm_current_state()??""}stateMachineGetActiveId(){return this._dotLottieCore?.state_machine_id()??""}stateMachineOverrideState(t,e=!1){return this._dotLottieCore?.sm_override_current_state(t,e)??!1}stateMachineSetSeed(t){return this._dotLottieCore?.sm_set_seed(BigInt(Math.trunc(t)))??!1}stateMachineGet(t){return this._dotLottieCore?.get_state_machine(t)??""}stateMachineGetListeners(){if(!this._dotLottieCore)return[];let t=this._dotLottieCore.sm_framework_setup();return Array.isArray(t)?t:[]}stateMachineSetBooleanInput(t,e){return this._dotLottieCore?.sm_set_boolean_input(t,e)??!1}stateMachineSetNumericInput(t,e){return this._dotLottieCore?.sm_set_numeric_input(t,e)??!1}stateMachineSetStringInput(t,e){return this._dotLottieCore?.sm_set_string_input(t,e)??!1}stateMachineGetBooleanInput(t){return this._dotLottieCore?.sm_get_boolean_input(t)??void 0}stateMachineGetNumericInput(t){return this._dotLottieCore?.sm_get_numeric_input(t)??void 0}stateMachineGetStringInput(t){return this._dotLottieCore?.sm_get_string_input(t)??void 0}stateMachineGetInputs(){if(!this._dotLottieCore)return[];let t=this._dotLottieCore.sm_get_inputs();return Array.isArray(t)?t:[]}stateMachineFireEvent(t){this._dotLottieCore?.sm_fire(t)}stateMachinePostClickEvent(t,e){this._dotLottieCore?.sm_post_click(t,e)}stateMachinePostPointerUpEvent(t,e){this._dotLottieCore?.sm_post_pointer_up(t,e)}stateMachinePostPointerDownEvent(t,e){this._dotLottieCore?.sm_post_pointer_down(t,e)}stateMachinePostPointerMoveEvent(t,e){this._dotLottieCore?.sm_post_pointer_move(t,e)}stateMachinePostPointerEnterEvent(t,e){this._dotLottieCore?.sm_post_pointer_enter(t,e)}stateMachinePostPointerExitEvent(t,e){this._dotLottieCore?.sm_post_pointer_exit(t,e)}_onClick(t){let e=T(t);e&&this.stateMachinePostClickEvent(e.x,e.y)}_onPointerUp(t){let e=T(t);e&&this.stateMachinePostPointerUpEvent(e.x,e.y)}_onPointerDown(t){let e=T(t);e&&this.stateMachinePostPointerDownEvent(e.x,e.y)}_onPointerMove(t){let e=T(t);e&&this.stateMachinePostPointerMoveEvent(e.x,e.y)}_onPointerEnter(t){let e=T(t);e&&this.stateMachinePostPointerEnterEvent(e.x,e.y)}_onPointerLeave(t){let e=T(t);e&&this.stateMachinePostPointerExitEvent(e.x,e.y)}_setupStateMachineListeners(){if(y&&this._canvas instanceof HTMLCanvasElement&&this._dotLottieCore!==null&&this.isLoaded){let t=this.stateMachineGetListeners();this._cleanupStateMachineListeners(),t.includes("Click")&&(this._boundOnClick=this._onClick.bind(this),this._canvas.addEventListener("click",this._boundOnClick)),t.includes("PointerUp")&&(this._boundOnPointerUp=this._onPointerUp.bind(this),this._canvas.addEventListener("pointerup",this._boundOnPointerUp)),t.includes("PointerDown")&&(this._boundOnPointerDown=this._onPointerDown.bind(this),this._canvas.addEventListener("pointerdown",this._boundOnPointerDown)),t.includes("PointerMove")&&(this._boundOnPointerMove=this._onPointerMove.bind(this),this._canvas.addEventListener("pointermove",this._boundOnPointerMove)),t.includes("PointerEnter")&&(this._boundOnPointerEnter=this._onPointerEnter.bind(this),this._canvas.addEventListener("pointerenter",this._boundOnPointerEnter)),t.includes("PointerExit")&&(this._boundOnPointerLeave=this._onPointerLeave.bind(this),this._canvas.addEventListener("pointerleave",this._boundOnPointerLeave))}}_cleanupStateMachineListeners(){y&&this._canvas instanceof HTMLCanvasElement&&(this._boundOnClick&&(this._canvas.removeEventListener("click",this._boundOnClick),this._boundOnClick=null),this._boundOnPointerUp&&(this._canvas.removeEventListener("pointerup",this._boundOnPointerUp),this._boundOnPointerUp=null),this._boundOnPointerDown&&(this._canvas.removeEventListener("pointerdown",this._boundOnPointerDown),this._boundOnPointerDown=null),this._boundOnPointerMove&&(this._canvas.removeEventListener("pointermove",this._boundOnPointerMove),this._boundOnPointerMove=null),this._boundOnPointerEnter&&(this._canvas.removeEventListener("pointerenter",this._boundOnPointerEnter),this._boundOnPointerEnter=null),this._boundOnPointerLeave&&(this._canvas.removeEventListener("pointerleave",this._boundOnPointerLeave),this._boundOnPointerLeave=null))}};var a=new Map,Tt={ready:n=>t=>{let e={id:"",method:"onReady",result:{instanceId:n,event:t}};self.postMessage(e)},complete:n=>t=>{let e={id:"",method:"onComplete",result:{instanceId:n,event:t}};self.postMessage(e)},load:n=>t=>{let r={id:"",method:"onLoad",result:{instanceId:n,event:t}};self.postMessage(r)},loadError:n=>t=>{let r={id:"",method:"onLoadError",result:{instanceId:n,event:t}};self.postMessage(r)},renderError:n=>t=>{let r={id:"",method:"onRenderError",result:{instanceId:n,event:t}};self.postMessage(r)},loop:n=>t=>{let r={id:"",method:"onLoop",result:{instanceId:n,event:t}};self.postMessage(r)},play:n=>t=>{let r={id:"",method:"onPlay",result:{instanceId:n,event:t}};self.postMessage(r)},pause:n=>t=>{let r={id:"",method:"onPause",result:{instanceId:n,event:t}};self.postMessage(r)},stop:n=>t=>{let r={id:"",method:"onStop",result:{instanceId:n,event:t}};self.postMessage(r)},frame:n=>t=>{let r={id:"",method:"onFrame",result:{instanceId:n,event:t}};self.postMessage(r)},render:n=>t=>{let r={id:"",method:"onRender",result:{instanceId:n,event:t}};self.postMessage(r)},freeze:n=>t=>{let r={id:"",method:"onFreeze",result:{instanceId:n,event:t}};self.postMessage(r)},unfreeze:n=>t=>{let r={id:"",method:"onUnfreeze",result:{instanceId:n,event:t}};self.postMessage(r)},destroy:n=>t=>{let r={id:"",method:"onDestroy",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineStart:n=>t=>{let r={id:"",method:"onStateMachineStart",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineStop:n=>t=>{let r={id:"",method:"onStateMachineStop",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineTransition:n=>t=>{let r={id:"",method:"onStateMachineTransition",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineStateEntered:n=>t=>{let r={id:"",method:"onStateMachineStateEntered",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineStateExit:n=>t=>{let r={id:"",method:"onStateMachineStateExit",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineCustomEvent:n=>t=>{let r={id:"",method:"onStateMachineCustomEvent",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineError:n=>t=>{let r={id:"",method:"onStateMachineError",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineBooleanInputValueChange:n=>t=>{let r={id:"",method:"onStateMachineBooleanInputValueChange",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineNumericInputValueChange:n=>t=>{let r={id:"",method:"onStateMachineNumericInputValueChange",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineStringInputValueChange:n=>t=>{let r={id:"",method:"onStateMachineStringInputValueChange",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineInputFired:n=>t=>{let r={id:"",method:"onStateMachineInputFired",result:{instanceId:n,event:t}};self.postMessage(r)},stateMachineInternalMessage:n=>t=>{let r={id:"",method:"onStateMachineInternalMessage",result:{instanceId:n,event:t}};self.postMessage(r)}},nt={setTransform(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setTransform(n.params.transform)},getTransform(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.getTransform()},getDotLottieInstanceState(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return{state:{loopCount:e.loopCount,isLoaded:e.isLoaded,isPaused:e.isPaused,isPlaying:e.isPlaying,isStopped:e.isStopped,isFrozen:e.isFrozen,loop:e.loop,mode:e.mode,speed:e.speed,volume:e.volume,currentFrame:e.currentFrame,totalFrames:e.totalFrames,duration:e.duration,useFrameInterpolation:e.useFrameInterpolation,renderConfig:e.renderConfig,marker:e.marker,backgroundColor:e.backgroundColor,markers:e.markers(),activeAnimationId:e.activeAnimationId,activeThemeId:e.activeThemeId,autoplay:e.autoplay,segment:e.segment,layout:e.layout,isReady:e.isReady,manifest:e.manifest}}},setLayout(n){let t=n.params.instanceId,e=n.params.layout,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setLayout(e)},stateMachineGetListeners(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineGetListeners()},stateMachineStart(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineStart()},stateMachineStop(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineStop()},stateMachineLoad(n){let t=n.params.instanceId,e=n.params.stateMachineId,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineLoad(e)},stateMachineLoadData(n){let t=n.params.instanceId,e=n.params.stateMachineData,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineLoadData(e)},stateMachinePostClickEvent(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,o=a.get(t);if(!o)throw new Error(`Instance with id ${t} does not exist.`);return o.stateMachinePostClickEvent(e,r)},stateMachinePostPointerUpEvent(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,o=a.get(t);if(!o)throw new Error(`Instance with id ${t} does not exist.`);return o.stateMachinePostPointerUpEvent(e,r)},stateMachinePostPointerDownEvent(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,o=a.get(t);if(!o)throw new Error(`Instance with id ${t} does not exist.`);return o.stateMachinePostPointerDownEvent(e,r)},stateMachinePostPointerMoveEvent(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,o=a.get(t);if(!o)throw new Error(`Instance with id ${t} does not exist.`);return o.stateMachinePostPointerMoveEvent(e,r)},stateMachinePostPointerEnterEvent(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,o=a.get(t);if(!o)throw new Error(`Instance with id ${t} does not exist.`);return o.stateMachinePostPointerEnterEvent(e,r)},stateMachinePostPointerExitEvent(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,o=a.get(t);if(!o)throw new Error(`Instance with id ${t} does not exist.`);return o.stateMachinePostPointerExitEvent(e,r)},stateMachineSetNumericInput:n=>{let t=n.params.instanceId,e=n.params.name,r=n.params.value,o=a.get(t);if(!o)throw new Error(`Instance with id ${t} does not exist.`);return o.stateMachineSetNumericInput(e,r)},stateMachineSetBooleanInput:n=>{let t=n.params.instanceId,e=n.params.name,r=n.params.value,o=a.get(t);if(!o)throw new Error(`Instance with id ${t} does not exist.`);return o.stateMachineSetBooleanInput(e,r)},stateMachineSetConfig:n=>{let t=n.params.instanceId,e=n.params.config,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.stateMachineSetConfig(e)},stateMachineSetStringInput:n=>{let t=n.params.instanceId,e=n.params.name,r=n.params.value,o=a.get(t);if(!o)throw new Error(`Instance with id ${t} does not exist.`);return o.stateMachineSetStringInput(e,r)},stateMachineGetNumericInput:n=>{let t=n.params.instanceId,e=n.params.name,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineGetNumericInput(e)},stateMachineGetBooleanInput:n=>{let t=n.params.instanceId,e=n.params.name,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineGetBooleanInput(e)},stateMachineGetStringInput:n=>{let t=n.params.instanceId,e=n.params.name,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineGetStringInput(e)},stateMachineGetInputs:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineGetInputs()},stateMachineFireEvent:n=>{let t=n.params.instanceId,e=n.params.name,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineFireEvent(e)},stateMachineGetStatus:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineGetStatus()},stateMachineGetCurrentState:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineGetCurrentState()},stateMachineGetActiveId:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.stateMachineGetActiveId()},stateMachineOverrideState:n=>{let t=n.params.instanceId,e=n.params.state,r=n.params.immediate,o=a.get(t);if(!o)throw new Error(`Instance with id ${t} does not exist.`);return o.stateMachineOverrideState(e,r)},stateMachineSetSeed:n=>{let t=n.params.instanceId,e=n.params.seed,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineSetSeed(e)},stateMachineGet:n=>{let t=n.params.instanceId,e=n.params.stateMachineId,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.stateMachineGet(e)},create:n=>{let t=n.params.instanceId,e=n.params.config,r=n.params.width,o=n.params.height;if(a.has(t))throw new Error(`Instance with id ${t} already exists.`);let i=new A(e);return i.canvas&&(i.canvas.height=o,i.canvas.width=r),a.set(t,i),["complete","frame","load","loadError","renderError","loop","pause","play","stop","destroy","freeze","unfreeze","render","ready","stateMachineStart","stateMachineStop","stateMachineTransition","stateMachineStateEntered","stateMachineStateExit","stateMachineCustomEvent","stateMachineError","stateMachineBooleanInputValueChange","stateMachineNumericInputValueChange","stateMachineStringInputValueChange","stateMachineInputFired","stateMachineInternalMessage"].forEach(l=>{i.addEventListener(l,Tt[l](t))}),{instanceId:t}},destroy:n=>{let t=n.params.instanceId,e=a.get(t);e&&(e.destroy(),a.delete(t))},freeze:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);e.freeze()},load:n=>{let t=n.params.instanceId,e=n.params.config,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.load(e)},loadAnimation:n=>{let t=n.params.instanceId,e=n.params.animationId,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.loadAnimation(e)},setTheme:n=>{let t=n.params.instanceId,e=n.params.themeId,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.setTheme(e)},setThemeData:n=>{let t=n.params.instanceId,e=n.params.themeData,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);return r.setThemeData(e)},pause:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.pause()},play:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.play()},registerFont:async n=>{let{fontName:t,fontSource:e}=n.params;return A.registerFont(t,e)},resize:n=>{let t=n.params.instanceId,e=n.params.width,r=n.params.height,o=a.get(t);if(!o)throw new Error(`Instance with id ${t} does not exist.`);o.canvas&&(o.canvas.height=r,o.canvas.width=e),o.resize()},setBackgroundColor:n=>{let t=n.params.instanceId,e=n.params.backgroundColor,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setBackgroundColor(e)},setSlots:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);e.setSlots(n.params.slots)},getSlotIds:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.getSlotIds()},getSlotType:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.getSlotType(n.params.slotId)},getSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.getSlot(n.params.slotId)},getSlots:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.getSlots()},setColorSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setColorSlot(n.params.slotId,n.params.value)},setScalarSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setScalarSlot(n.params.slotId,n.params.value)},setVectorSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setVectorSlot(n.params.slotId,n.params.value)},setGradientSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setGradientSlot(n.params.slotId,n.params.value,n.params.colorStopCount)},setTextSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setTextSlot(n.params.slotId,n.params.value)},setImageSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.setImageSlot(n.params.slotId,n.params.src)},resetSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.resetSlot(n.params.slotId)},clearSlot:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.clearSlot(n.params.slotId)},resetSlots:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.resetSlots()},clearSlots:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);return e.clearSlots()},setFrame:n=>{let t=n.params.instanceId,e=n.params.frame,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setFrame(e)},setMode:n=>{let t=n.params.instanceId,e=n.params.mode,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setMode(e)},setRenderConfig:n=>{let t=n.params.instanceId,e=n.params.renderConfig,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setRenderConfig(e)},setSegment:n=>{let t=n.params.instanceId,e=n.params.segment,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setSegment(e[0],e[1])},resetSegment:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);e.resetSegment()},setSpeed:n=>{let t=n.params.instanceId,e=n.params.speed,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setSpeed(e)},setVolume:n=>{let t=n.params.instanceId,e=n.params.volume,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setVolume(e)},setUseFrameInterpolation:n=>{let t=n.params.instanceId,e=n.params.useFrameInterpolation,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setUseFrameInterpolation(e)},setWasmUrl:n=>{A.setWasmUrl(n.params.url)},stop:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);e.stop()},unfreeze:n=>{let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);e.unfreeze()},setViewport(n){let t=n.params.instanceId,e=n.params.x,r=n.params.y,o=n.params.width,i=n.params.height,_=a.get(t);if(!_)throw new Error(`Instance with id ${t} does not exist.`);return _.setViewport(e,r,o,i)},animationSize(n){let t=n.params.instanceId,e=a.get(t);if(!e)throw new Error(`Instance with id ${t} does not exist.`);let{height:r,width:o}=e.animationSize();return{height:r,width:o}},setMarker(n){let t=n.params.instanceId,e=n.params.marker,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setMarker(e)},setLoop(n){let t=n.params.instanceId,e=n.params.loop,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setLoop(e)},setLoopCount(n){let t=n.params.instanceId,e=n.params.loopCount,r=a.get(t);if(!r)throw new Error(`Instance with id ${t} does not exist.`);r.setLoopCount(e)}};function At(n){let t=n.method;if(Object.hasOwn(nt,t)&&typeof nt[t]=="function")return nt[t](n);throw new Error(`Method ${String(t)} is not implemented in commands.`)}self.onmessage=async n=>{try{let t=await At(n.data),e={id:n.data.id,method:n.data.method,result:t};self.postMessage(e)}catch(t){let e={id:n.data.id,method:n.data.method,error:t.message};self.postMessage(e)}};var Ft="",ie=Ft;})();