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