kline-orderbook-chart 0.2.13 → 0.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chart_engine.js +1 -1
- package/dist/chart_engine_bg.wasm +0 -0
- package/dist/index.d.ts +45 -0
- package/dist/mrd-chart-engine.mjs +1 -1
- package/package.json +1 -1
package/dist/chart_engine.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
class D{__destroy_into_raw(){const _=this.__mrd_ptr;return this.__mrd_ptr=0,L.unregister(this),_}free(){const _=this.__destroy_into_raw();t.__mrd_chartengine_free(_,0)}add_anchored_vwap(_,e,r,n,s,i,a){return t.chartengine_add_anchored_vwap(this.__mrd_ptr,_,e,r,n,s,i,a)>>>0}add_arrow(_,e,r,n,s,i,a,c,h,g){return t.chartengine_add_arrow(this.__mrd_ptr,_,e,r,n,s,i,a,c,h,g)>>>0}add_arrow_marker_down(_,e,r,n,s,i,a){return t.chartengine_add_arrow_marker_down(this.__mrd_ptr,_,e,r,n,s,i,a)>>>0}add_arrow_marker_up(_,e,r,n,s,i,a){return t.chartengine_add_arrow_marker_up(this.__mrd_ptr,_,e,r,n,s,i,a)>>>0}add_brush_point(_,e){t.chartengine_add_brush_point(this.__mrd_ptr,_,e)}add_circle(_,e,r,n,s,i,a,c,h,g){return t.chartengine_add_circle(this.__mrd_ptr,_,e,r,n,s,i,a,c,h,g)>>>0}add_elliott_impulse(_,e,r,n,s,i,a){return t.chartengine_add_elliott_impulse(this.__mrd_ptr,_,e,r,n,s,i,a)>>>0}add_elliott_manual_point(_,e){return t.chartengine_add_elliott_manual_point(this.__mrd_ptr,_,e)!==0}add_fib_extension(_,e,r,n,s,i,a,c,h,g,m,u){return t.chartengine_add_fib_extension(this.__mrd_ptr,_,e,r,n,s,i,a,c,h,g,m,u)>>>0}add_fib_retracement(_,e,r,n,s,i,a,c,h,g){return t.chartengine_add_fib_retracement(this.__mrd_ptr,_,e,r,n,s,i,a,c,h,g)>>>0}add_horizontal_line(_,e,r,n,s,i,a,c){return t.chartengine_add_horizontal_line(this.__mrd_ptr,_,e,r,n,s,i,a,c)>>>0}add_long_position(_,e,r,n,s,i,a,c,h,g){return t.chartengine_add_long_position(this.__mrd_ptr,_,e,r,n,s,i,a,c,h,g)>>>0}add_marker(_,e,r){t.chartengine_add_marker(this.__mrd_ptr,_,e,r)}add_parallel_channel(_,e,r,n,s,i,a,c,h,g,m,u){return t.chartengine_add_parallel_channel(this.__mrd_ptr,_,e,r,n,s,i,a,c,h,g,m,u)>>>0}add_path_point(_,e){t.chartengine_add_path_point(this.__mrd_ptr,_,e)}add_price_label(_,e,r,n,s,i,a){return t.chartengine_add_price_label(this.__mrd_ptr,_,e,r,n,s,i,a)>>>0}add_price_range(_,e,r,n,s,i,a,c,h,g){return t.chartengine_add_price_range(this.__mrd_ptr,_,e,r,n,s,i,a,c,h,g)>>>0}add_short_position(_,e,r,n,s,i,a,c,h,g){return t.chartengine_add_short_position(this.__mrd_ptr,_,e,r,n,s,i,a,c,h,g)>>>0}add_text_note(_,e,r,n,s,i,a){return t.chartengine_add_text_note(this.__mrd_ptr,_,e,r,n,s,i,a)>>>0}add_trendline(_,e,r,n,s,i,a,c,h,g){return t.chartengine_add_trendline(this.__mrd_ptr,_,e,r,n,s,i,a,c,h,g)>>>0}append_heatmap_column(_,e,r,n){const s=p(_,t.__wbindgen_export),i=d;t.chartengine_append_heatmap_column(this.__mrd_ptr,s,i,e,r,n)}append_kline(_,e,r,n,s,i){t.chartengine_append_kline(this.__mrd_ptr,_,e,r,n,s,i)}append_real_timestamp(_){t.chartengine_append_real_timestamp(this.__mrd_ptr,_)}cancel_brush(){t.chartengine_cancel_brush(this.__mrd_ptr)}cancel_elliott_manual(){t.chartengine_cancel_elliott_manual(this.__mrd_ptr)}cancel_path(){t.chartengine_cancel_path(this.__mrd_ptr)}chart_area_h(){return t.chartengine_chart_area_h(this.__mrd_ptr)}chart_area_w(){return t.chartengine_chart_area_w(this.__mrd_ptr)}chart_area_x(){return t.chartengine_chart_area_x(this.__mrd_ptr)}chart_area_y(){return t.chartengine_chart_area_y(this.__mrd_ptr)}clear_channel_preview(){t.chartengine_clear_channel_preview(this.__mrd_ptr)}clear_drawing_preview(){t.chartengine_clear_drawing_preview(this.__mrd_ptr)}clear_drawings(){t.chartengine_clear_drawings(this.__mrd_ptr)}clear_elliott_preview(){t.chartengine_clear_elliott_preview(this.__mrd_ptr)}clear_fib_ext_preview(){t.chartengine_clear_fib_ext_preview(this.__mrd_ptr)}clear_heatmap_prefetch_range(){t.chartengine_clear_heatmap_prefetch_range(this.__mrd_ptr)}clear_hover_price(){t.chartengine_clear_hover_price(this.__mrd_ptr)}clear_large_trades(){t.chartengine_clear_large_trades(this.__mrd_ptr)}clear_live_signals(){t.chartengine_clear_live_signals(this.__mrd_ptr)}clear_markers(){t.chartengine_clear_markers(this.__mrd_ptr)}custom_band(_,e,r,n,s,i){const a=p(_,t.__wbindgen_export),c=d,h=p(e,t.__wbindgen_export),g=d;t.chartengine_custom_band(this.__mrd_ptr,a,c,h,g,r,n,s,i)}custom_begin(){t.chartengine_custom_begin(this.__mrd_ptr)}custom_circle_px(_,e,r,n,s,i,a,c,h,g,m,u){t.chartengine_custom_circle_px(this.__mrd_ptr,_,e,r,n,s,i,a,c,h,g,m,u)}custom_clip_rect(_,e,r,n){t.chartengine_custom_clip_rect(this.__mrd_ptr,_,e,r,n)}custom_command_count(){return t.chartengine_custom_command_count(this.__mrd_ptr)>>>0}custom_dashed_hline(_,e,r,n,s,i,a,c){t.chartengine_custom_dashed_hline(this.__mrd_ptr,_,e,r,n,s,i,a,c)}custom_end(){t.chartengine_custom_end(this.__mrd_ptr)}custom_fill_rect_px(_,e,r,n,s,i,a,c){t.chartengine_custom_fill_rect_px(this.__mrd_ptr,_,e,r,n,s,i,a,c)}custom_hline(_,e,r,n,s,i){t.chartengine_custom_hline(this.__mrd_ptr,_,e,r,n,s,i)}custom_line_px(_,e,r,n,s,i,a,c,h){t.chartengine_custom_line_px(this.__mrd_ptr,_,e,r,n,s,i,a,c,h)}custom_marker(_,e,r,n,s,i,a){t.chartengine_custom_marker(this.__mrd_ptr,_,e,r,n,s,i,a)}custom_marker_down(_,e,r,n,s,i,a){t.chartengine_custom_marker_down(this.__mrd_ptr,_,e,r,n,s,i,a)}custom_marker_up(_,e,r,n,s,i,a){t.chartengine_custom_marker_up(this.__mrd_ptr,_,e,r,n,s,i,a)}custom_price_label(_,e,r,n,s,i,a){const c=R(e,t.__wbindgen_export,t.__wbindgen_export2),h=d;t.chartengine_custom_price_label(this.__mrd_ptr,_,c,h,r,n,s,i,a)}custom_restore(){t.chartengine_custom_restore(this.__mrd_ptr)}custom_save(){t.chartengine_custom_save(this.__mrd_ptr)}custom_series_dashed_line(_,e,r,n,s,i,a,c){const h=p(_,t.__wbindgen_export),g=d;t.chartengine_custom_series_dashed_line(this.__mrd_ptr,h,g,e,r,n,s,i,a,c)}custom_series_line(_,e,r,n,s,i){const a=p(_,t.__wbindgen_export),c=d;t.chartengine_custom_series_line(this.__mrd_ptr,a,c,e,r,n,s,i)}custom_stroke_rect_px(_,e,r,n,s,i,a,c,h){t.chartengine_custom_stroke_rect_px(this.__mrd_ptr,_,e,r,n,s,i,a,c,h)}custom_text(_,e,r,n,s,i,a,c,h){const g=R(r,t.__wbindgen_export,t.__wbindgen_export2),m=d;t.chartengine_custom_text(this.__mrd_ptr,_,e,g,m,n,s,i,a,c,h)}custom_text_px(_,e,r,n,s,i,a,c,h){const g=R(r,t.__wbindgen_export,t.__wbindgen_export2),m=d;t.chartengine_custom_text_px(this.__mrd_ptr,_,e,g,m,n,s,i,a,c,h)}delta_histogram_enabled(){return t.chartengine_delta_histogram_enabled(this.__mrd_ptr)!==0}deselect_drawing(){t.chartengine_deselect_drawing(this.__mrd_ptr)}deselect_marker(){t.chartengine_deselect_marker(this.__mrd_ptr)}disable_cvd(){t.chartengine_disable_cvd(this.__mrd_ptr)}disable_delta_histogram(){t.chartengine_disable_delta_histogram(this.__mrd_ptr)}disable_ema_structure(){t.chartengine_disable_ema_structure(this.__mrd_ptr)}disable_forex_signals(){t.chartengine_disable_forex_signals(this.__mrd_ptr)}disable_funding_rate(){t.chartengine_disable_funding_rate(this.__mrd_ptr)}disable_large_trades(){t.chartengine_disable_large_trades(this.__mrd_ptr)}disable_liq_heatmap(){t.chartengine_disable_liq_heatmap(this.__mrd_ptr)}disable_live_signals(){t.chartengine_disable_live_signals(this.__mrd_ptr)}disable_oi(){t.chartengine_disable_oi(this.__mrd_ptr)}disable_rsi(){t.chartengine_disable_rsi(this.__mrd_ptr)}disable_smart_ranges(){t.chartengine_disable_smart_ranges(this.__mrd_ptr)}disable_stop_iceberg(){t.chartengine_disable_stop_iceberg(this.__mrd_ptr)}disable_tpo(){t.chartengine_disable_tpo(this.__mrd_ptr)}disable_volume(){t.chartengine_disable_volume(this.__mrd_ptr)}disable_vpin(){t.chartengine_disable_vpin(this.__mrd_ptr)}disable_vrvp(){t.chartengine_disable_vrvp(this.__mrd_ptr)}drawing_count(){return t.chartengine_drawing_count(this.__mrd_ptr)>>>0}enable_cvd(){t.chartengine_enable_cvd(this.__mrd_ptr)}enable_delta_histogram(){t.chartengine_enable_delta_histogram(this.__mrd_ptr)}enable_ema_structure(){t.chartengine_enable_ema_structure(this.__mrd_ptr)}enable_forex_signals(){t.chartengine_enable_forex_signals(this.__mrd_ptr)}enable_funding_rate(){t.chartengine_enable_funding_rate(this.__mrd_ptr)}enable_large_trades(){t.chartengine_enable_large_trades(this.__mrd_ptr)}enable_liq_heatmap(){t.chartengine_enable_liq_heatmap(this.__mrd_ptr)}enable_live_signals(){t.chartengine_enable_live_signals(this.__mrd_ptr)}enable_oi(){t.chartengine_enable_oi(this.__mrd_ptr)}enable_rsi(){t.chartengine_enable_rsi(this.__mrd_ptr)}enable_smart_ranges(){t.chartengine_enable_smart_ranges(this.__mrd_ptr)}enable_stop_iceberg(){t.chartengine_enable_stop_iceberg(this.__mrd_ptr)}enable_tpo(){t.chartengine_enable_tpo(this.__mrd_ptr)}enable_volume(){t.chartengine_enable_volume(this.__mrd_ptr)}enable_vpin(){t.chartengine_enable_vpin(this.__mrd_ptr)}enable_vrvp(){t.chartengine_enable_vrvp(this.__mrd_ptr)}export_drawings_json(){let _,e;try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_export_drawings_json(s,this.__mrd_ptr);var r=l().getInt32(s+4*0,!0),n=l().getInt32(s+4*1,!0);return _=r,e=n,b(r,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(_,e,1)}}finish_brush(){return t.chartengine_finish_brush(this.__mrd_ptr)>>>0}finish_elliott_manual(){return t.chartengine_finish_elliott_manual(this.__mrd_ptr)>>>0}finish_path(){return t.chartengine_finish_path(this.__mrd_ptr)>>>0}fit_content(){t.chartengine_fit_content(this.__mrd_ptr)}footprint_add_trade(_,e,r,n){t.chartengine_footprint_add_trade(this.__mrd_ptr,_,e,r,n)}footprint_add_trade_batch(_){const e=p(_,t.__wbindgen_export),r=d;t.chartengine_footprint_add_trade_batch(this.__mrd_ptr,e,r)}footprint_clear(){t.chartengine_footprint_clear(this.__mrd_ptr)}footprint_clear_bar(_){t.chartengine_footprint_clear_bar(this.__mrd_ptr,_)}footprint_ensure_len(_){t.chartengine_footprint_ensure_len(this.__mrd_ptr,_)}footprint_get_display_mode(){return t.chartengine_footprint_get_display_mode(this.__mrd_ptr)}footprint_get_show_profile(){return t.chartengine_footprint_get_show_profile(this.__mrd_ptr)!==0}footprint_get_show_signals(){return t.chartengine_footprint_get_show_signals(this.__mrd_ptr)!==0}footprint_prepend_empty(_){t.chartengine_footprint_prepend_empty(this.__mrd_ptr,_)}footprint_profile_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_footprint_profile_hit_test(a,this.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,b(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(r,n,1)}}footprint_set_bar(_,e,r,n,s){const i=p(r,t.__wbindgen_export),a=d,c=p(n,t.__wbindgen_export),h=d,g=p(s,t.__wbindgen_export),m=d;t.chartengine_footprint_set_bar(this.__mrd_ptr,_,e,i,a,c,h,g,m)}footprint_set_display_mode(_){t.chartengine_footprint_set_display_mode(this.__mrd_ptr,_)}footprint_set_show_profile(_){t.chartengine_footprint_set_show_profile(this.__mrd_ptr,_)}footprint_set_show_signals(_){t.chartengine_footprint_set_show_signals(this.__mrd_ptr,_)}footprint_signal_count(){return t.chartengine_footprint_signal_count(this.__mrd_ptr)>>>0}get_chart_type(){return t.chartengine_get_chart_type(this.__mrd_ptr)}get_command_buffer_len(){return t.chartengine_get_command_buffer_len(this.__mrd_ptr)>>>0}get_command_buffer_ptr(){return t.chartengine_get_command_buffer_ptr(this.__mrd_ptr)>>>0}get_custom_buffer_len(){return t.chartengine_get_custom_buffer_len(this.__mrd_ptr)>>>0}get_custom_buffer_ptr(){return t.chartengine_get_custom_buffer_ptr(this.__mrd_ptr)>>>0}get_cvd_mode(){return t.chartengine_get_cvd_mode(this.__mrd_ptr)}get_cvd_ratio(){return t.chartengine_get_cvd_ratio(this.__mrd_ptr)}get_cvd_show_delta(){return t.chartengine_get_cvd_show_delta(this.__mrd_ptr)!==0}get_cvd_show_divergence(){return t.chartengine_get_cvd_show_divergence(this.__mrd_ptr)!==0}get_cvd_show_signals(){return t.chartengine_get_cvd_show_signals(this.__mrd_ptr)!==0}get_cvd_source(){return t.chartengine_get_cvd_source(this.__mrd_ptr)}get_drawing_color(_){return t.chartengine_get_drawing_color(this.__mrd_ptr,_)>>>0}get_drawing_dashed(_){return t.chartengine_get_drawing_dashed(this.__mrd_ptr,_)!==0}get_drawing_font_size(_){return t.chartengine_get_drawing_font_size(this.__mrd_ptr,_)}get_drawing_hide_label(_){return t.chartengine_get_drawing_hide_label(this.__mrd_ptr,_)!==0}get_drawing_kind_id(_){return t.chartengine_get_drawing_kind_id(this.__mrd_ptr,_)}get_drawing_text(_){let e,r;try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_get_drawing_text(i,this.__mrd_ptr,_);var n=l().getInt32(i+4*0,!0),s=l().getInt32(i+4*1,!0);return e=n,r=s,b(n,s)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(e,r,1)}}get_forex_signals_count(){return t.chartengine_get_forex_signals_count(this.__mrd_ptr)>>>0}get_fr_ratio(){return t.chartengine_get_fr_ratio(this.__mrd_ptr)}get_heatmap_data_max(){return t.chartengine_get_heatmap_data_max(this.__mrd_ptr)}get_heatmap_data_min(){return t.chartengine_get_heatmap_data_min(this.__mrd_ptr)}get_heatmap_last_timestamp(){return t.chartengine_get_heatmap_last_timestamp(this.__mrd_ptr)}get_heatmap_prefetch_max(){return t.chartengine_get_heatmap_prefetch_max(this.__mrd_ptr)}get_heatmap_x_step(){return t.chartengine_get_heatmap_x_step(this.__mrd_ptr)}get_iceberg_count(){return t.chartengine_get_iceberg_count(this.__mrd_ptr)>>>0}get_last_candle_json(){let _,e;try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_get_last_candle_json(s,this.__mrd_ptr);var r=l().getInt32(s+4*0,!0),n=l().getInt32(s+4*1,!0);return _=r,e=n,b(r,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(_,e,1)}}get_last_close(){return t.chartengine_get_last_close(this.__mrd_ptr)}get_liq_heatmap_cell_height(){return t.chartengine_get_liq_heatmap_cell_height(this.__mrd_ptr)}get_liq_heatmap_filled_pct(){return t.chartengine_get_liq_heatmap_filled_pct(this.__mrd_ptr)}get_liq_heatmap_max(){return t.chartengine_get_liq_heatmap_max(this.__mrd_ptr)}get_liq_heatmap_min(){return t.chartengine_get_liq_heatmap_min(this.__mrd_ptr)}get_liq_heatmap_seg_max(){return t.chartengine_get_liq_heatmap_seg_max(this.__mrd_ptr)}get_live_signals_count(){return t.chartengine_get_live_signals_count(this.__mrd_ptr)>>>0}get_live_signals_leverage(){return t.chartengine_get_live_signals_leverage(this.__mrd_ptr)}get_lt_data_max_vol(){return t.chartengine_get_lt_data_max_vol(this.__mrd_ptr)}get_lt_data_min_vol(){return t.chartengine_get_lt_data_min_vol(this.__mrd_ptr)}get_oi_ratio(){return t.chartengine_get_oi_ratio(this.__mrd_ptr)}get_rsi_ratio(){return t.chartengine_get_rsi_ratio(this.__mrd_ptr)}get_selected_drawing(){return t.chartengine_get_selected_drawing(this.__mrd_ptr)>>>0}get_selected_marker(){return t.chartengine_get_selected_marker(this.__mrd_ptr)>>>0}get_sr_signals_count(){return t.chartengine_get_sr_signals_count(this.__mrd_ptr)>>>0}get_stop_run_count(){return t.chartengine_get_stop_run_count(this.__mrd_ptr)>>>0}get_theme(){return t.chartengine_get_theme(this.__mrd_ptr)}get_tooltip_data(){let _,e;try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_get_tooltip_data(s,this.__mrd_ptr);var r=l().getInt32(s+4*0,!0),n=l().getInt32(s+4*1,!0);return _=r,e=n,b(r,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(_,e,1)}}get_tpo_period(){return t.chartengine_get_tpo_period(this.__mrd_ptr)>>>0}get_volume_color_mode(){return t.chartengine_get_volume_color_mode(this.__mrd_ptr)}get_volume_ma_period(){return t.chartengine_get_volume_ma_period(this.__mrd_ptr)>>>0}get_volume_show_ma(){return t.chartengine_get_volume_show_ma(this.__mrd_ptr)!==0}get_volume_show_signals(){return t.chartengine_get_volume_show_signals(this.__mrd_ptr)!==0}get_vpin_bucket_size(){return t.chartengine_get_vpin_bucket_size(this.__mrd_ptr)>>>0}get_vpin_num_buckets(){return t.chartengine_get_vpin_num_buckets(this.__mrd_ptr)>>>0}get_vpin_ratio(){return t.chartengine_get_vpin_ratio(this.__mrd_ptr)}get_vpin_threshold(){return t.chartengine_get_vpin_threshold(this.__mrd_ptr)}hide_crosshair(){t.chartengine_hide_crosshair(this.__mrd_ptr)}hit_test_drawing(_,e){return t.chartengine_hit_test_drawing(this.__mrd_ptr,_,e)>>>0}hit_test_drawing_anchor(_,e){return t.chartengine_hit_test_drawing_anchor(this.__mrd_ptr,_,e)}hit_test_marker(_,e){return t.chartengine_hit_test_marker(this.__mrd_ptr,_,e)>>>0}hit_zone(_,e){return t.chartengine_hit_zone(this.__mrd_ptr,_,e)}hover_hit_test(_,e){try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_hover_hit_test(i,this.__mrd_ptr,_,e);var r=l().getInt32(i+4*0,!0),n=l().getInt32(i+4*1,!0),s=H(r,n).slice();return t.__wbindgen_export3(r,n*4,4),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}import_drawings_json(_){const e=R(_,t.__wbindgen_export,t.__wbindgen_export2),r=d;t.chartengine_import_drawings_json(this.__mrd_ptr,e,r)}is_cvd_enabled(){return t.chartengine_is_cvd_enabled(this.__mrd_ptr)!==0}is_dirty(){return t.chartengine_is_dirty(this.__mrd_ptr)!==0}is_ema_structure_enabled(){return t.chartengine_is_ema_structure_enabled(this.__mrd_ptr)!==0}is_forex_signals_enabled(){return t.chartengine_is_forex_signals_enabled(this.__mrd_ptr)!==0}is_funding_rate_enabled(){return t.chartengine_is_funding_rate_enabled(this.__mrd_ptr)!==0}is_large_trades_enabled(){return t.chartengine_is_large_trades_enabled(this.__mrd_ptr)!==0}is_liq_heatmap_enabled(){return t.chartengine_is_liq_heatmap_enabled(this.__mrd_ptr)!==0}is_liq_heatmap_filled_zones(){return t.chartengine_is_liq_heatmap_filled_zones(this.__mrd_ptr)!==0}is_liq_heatmap_predictions(){return t.chartengine_is_liq_heatmap_predictions(this.__mrd_ptr)!==0}is_liq_heatmap_profile(){return t.chartengine_is_liq_heatmap_profile(this.__mrd_ptr)!==0}is_live_signals_enabled(){return t.chartengine_is_live_signals_enabled(this.__mrd_ptr)!==0}is_oi_enabled(){return t.chartengine_is_oi_enabled(this.__mrd_ptr)!==0}is_rsi_enabled(){return t.chartengine_is_rsi_enabled(this.__mrd_ptr)!==0}is_rsi_show_traps(){return t.chartengine_is_rsi_show_traps(this.__mrd_ptr)!==0}is_smart_ranges_enabled(){return t.chartengine_is_smart_ranges_enabled(this.__mrd_ptr)!==0}is_stop_iceberg_enabled(){return t.chartengine_is_stop_iceberg_enabled(this.__mrd_ptr)!==0}is_tpo_enabled(){return t.chartengine_is_tpo_enabled(this.__mrd_ptr)!==0}is_tpo_signals(){return t.chartengine_is_tpo_signals(this.__mrd_ptr)!==0}is_volume_enabled(){return t.chartengine_is_volume_enabled(this.__mrd_ptr)!==0}is_vpin_enabled(){return t.chartengine_is_vpin_enabled(this.__mrd_ptr)!==0}is_vrvp_enabled(){return t.chartengine_is_vrvp_enabled(this.__mrd_ptr)!==0}kline_closes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_closes(n,this.__mrd_ptr);var _=l().getInt32(n+4*0,!0),e=l().getInt32(n+4*1,!0),r=y(_,e).slice();return t.__wbindgen_export3(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}kline_count(){return t.chartengine_kline_count(this.__mrd_ptr)>>>0}kline_highs(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_highs(n,this.__mrd_ptr);var _=l().getInt32(n+4*0,!0),e=l().getInt32(n+4*1,!0),r=y(_,e).slice();return t.__wbindgen_export3(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}kline_lows(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_lows(n,this.__mrd_ptr);var _=l().getInt32(n+4*0,!0),e=l().getInt32(n+4*1,!0),r=y(_,e).slice();return t.__wbindgen_export3(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}kline_opens(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_opens(n,this.__mrd_ptr);var _=l().getInt32(n+4*0,!0),e=l().getInt32(n+4*1,!0),r=y(_,e).slice();return t.__wbindgen_export3(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}kline_timestamps(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_timestamps(n,this.__mrd_ptr);var _=l().getInt32(n+4*0,!0),e=l().getInt32(n+4*1,!0),r=y(_,e).slice();return t.__wbindgen_export3(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}kline_volumes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_volumes(n,this.__mrd_ptr);var _=l().getInt32(n+4*0,!0),e=l().getInt32(n+4*1,!0),r=y(_,e).slice();return t.__wbindgen_export3(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}liq_filled_zone_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_liq_filled_zone_hit_test(a,this.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,b(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(r,n,1)}}liq_heatmap_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_liq_heatmap_hit_test(a,this.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,b(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(r,n,1)}}liq_predict_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_liq_predict_hit_test(a,this.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,b(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(r,n,1)}}liq_zone_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_liq_zone_hit_test(a,this.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,b(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(r,n,1)}}lt_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_lt_hit_test(a,this.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,b(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(r,n,1)}}move_drawing(_,e){t.chartengine_move_drawing(this.__mrd_ptr,_,e)}constructor(_,e){const r=t.chartengine_new(_,e);return this.__mrd_ptr=r>>>0,L.register(this,this.__mrd_ptr,this),this}oi_to_screen_y(_){return t.chartengine_oi_to_screen_y(this.__mrd_ptr,_)}pan(_,e){t.chartengine_pan(this.__mrd_ptr,_,e)}pan_indicator_y(_,e){t.chartengine_pan_indicator_y(this.__mrd_ptr,_,e)}pan_x(_){t.chartengine_pan_x(this.__mrd_ptr,_)}pan_y(_){t.chartengine_pan_y(this.__mrd_ptr,_)}pop_last_kline(){return t.chartengine_pop_last_kline(this.__mrd_ptr)!==0}prepend_klines(_,e,r,n,s,i){const a=p(_,t.__wbindgen_export),c=d,h=p(e,t.__wbindgen_export),g=d,m=p(r,t.__wbindgen_export),u=d,f=p(n,t.__wbindgen_export),x=d,k=p(s,t.__wbindgen_export),z=d,I=p(i,t.__wbindgen_export),q=d;t.chartengine_prepend_klines(this.__mrd_ptr,a,c,h,g,m,u,f,x,k,z,I,q)}push_large_trade(_,e,r,n){t.chartengine_push_large_trade(this.__mrd_ptr,_,e,r,n)}remove_drawing(_){t.chartengine_remove_drawing(this.__mrd_ptr,_)}remove_marker(_){t.chartengine_remove_marker(this.__mrd_ptr,_)}render(){return t.chartengine_render(this.__mrd_ptr)>>>0}reset_indicator_y_auto(_){t.chartengine_reset_indicator_y_auto(this.__mrd_ptr,_)}resize(_,e){t.chartengine_resize(this.__mrd_ptr,_,e)}rsi_to_screen_y(_){return t.chartengine_rsi_to_screen_y(this.__mrd_ptr,_)}screen_to_cvd_y(_){return t.chartengine_screen_to_cvd_y(this.__mrd_ptr,_)}screen_to_fr_y(_){return t.chartengine_screen_to_fr_y(this.__mrd_ptr,_)}screen_to_oi_y(_){return t.chartengine_screen_to_oi_y(this.__mrd_ptr,_)}screen_to_rsi_y(_){return t.chartengine_screen_to_rsi_y(this.__mrd_ptr,_)}screen_to_vpin_y(_){return t.chartengine_screen_to_vpin_y(this.__mrd_ptr,_)}screen_to_world_x(_){return t.chartengine_screen_to_world_x(this.__mrd_ptr,_)}screen_to_world_y(_){return t.chartengine_screen_to_world_y(this.__mrd_ptr,_)}select_drawing(_){t.chartengine_select_drawing(this.__mrd_ptr,_)}select_marker(_){t.chartengine_select_marker(this.__mrd_ptr,_)}set_candle_interval(_){t.chartengine_set_candle_interval(this.__mrd_ptr,_)}set_channel_preview(_,e,r,n,s,i,a,c,h,g,m,u){t.chartengine_set_channel_preview(this.__mrd_ptr,_,e,r,n,s,i,a,c,h,g,m,u)}set_chart_type(_){t.chartengine_set_chart_type(this.__mrd_ptr,_)}set_crosshair(_,e){t.chartengine_set_crosshair(this.__mrd_ptr,_,e)}set_cvd_data(_,e){const r=p(_,t.__wbindgen_export),n=d,s=p(e,t.__wbindgen_export),i=d;t.chartengine_set_cvd_data(this.__mrd_ptr,r,n,s,i)}set_cvd_mode(_){t.chartengine_set_cvd_mode(this.__mrd_ptr,_)}set_cvd_ratio(_){t.chartengine_set_cvd_ratio(this.__mrd_ptr,_)}set_cvd_show_delta(_){t.chartengine_set_cvd_show_delta(this.__mrd_ptr,_)}set_cvd_show_divergence(_){t.chartengine_set_cvd_show_divergence(this.__mrd_ptr,_)}set_cvd_show_signals(_){t.chartengine_set_cvd_show_signals(this.__mrd_ptr,_)}set_cvd_source(_){t.chartengine_set_cvd_source(this.__mrd_ptr,_)}set_cvd_spot_data(_,e){const r=p(_,t.__wbindgen_export),n=d,s=p(e,t.__wbindgen_export),i=d;t.chartengine_set_cvd_spot_data(this.__mrd_ptr,r,n,s,i)}set_drawing_dashed(_,e){t.chartengine_set_drawing_dashed(this.__mrd_ptr,_,e)}set_drawing_font_size(_,e){t.chartengine_set_drawing_font_size(this.__mrd_ptr,_,e)}set_drawing_hide_label(_,e){t.chartengine_set_drawing_hide_label(this.__mrd_ptr,_,e)}set_drawing_preview(_,e,r,n,s,i,a,c,h,g,m){t.chartengine_set_drawing_preview(this.__mrd_ptr,_,e,r,n,s,i,a,c,h,g,m)}set_drawing_style(_,e,r,n,s){t.chartengine_set_drawing_style(this.__mrd_ptr,_,e,r,n,s)}set_drawing_text(_,e){const r=R(e,t.__wbindgen_export,t.__wbindgen_export2),n=d;t.chartengine_set_drawing_text(this.__mrd_ptr,_,r,n)}set_elliott_manual_cursor(_,e){t.chartengine_set_elliott_manual_cursor(this.__mrd_ptr,_,e)}set_elliott_preview(_,e,r,n,s,i,a){t.chartengine_set_elliott_preview(this.__mrd_ptr,_,e,r,n,s,i,a)}set_es_ema1_len(_){t.chartengine_set_es_ema1_len(this.__mrd_ptr,_)}set_es_ema2_len(_){t.chartengine_set_es_ema2_len(this.__mrd_ptr,_)}set_es_show_bos(_){t.chartengine_set_es_show_bos(this.__mrd_ptr,_)}set_es_show_ema1(_){t.chartengine_set_es_show_ema1(this.__mrd_ptr,_)}set_es_show_ema2(_){t.chartengine_set_es_show_ema2(this.__mrd_ptr,_)}set_es_show_wma(_){t.chartengine_set_es_show_wma(this.__mrd_ptr,_)}set_es_swing_len(_){t.chartengine_set_es_swing_len(this.__mrd_ptr,_)}set_es_wma_len(_){t.chartengine_set_es_wma_len(this.__mrd_ptr,_)}set_fib_ext_preview(_,e,r,n,s,i,a,c,h,g,m,u){t.chartengine_set_fib_ext_preview(this.__mrd_ptr,_,e,r,n,s,i,a,c,h,g,m,u)}set_footprint_tick_size(_){t.chartengine_set_footprint_tick_size(this.__mrd_ptr,_)}set_forex_signals_mode(_){t.chartengine_set_forex_signals_mode(this.__mrd_ptr,_)}set_forex_signals_setup(_){t.chartengine_set_forex_signals_setup(this.__mrd_ptr,_)}set_forex_signals_show_stats(_){t.chartengine_set_forex_signals_show_stats(this.__mrd_ptr,_)}set_fr_agg_data(_,e){const r=p(_,t.__wbindgen_export),n=d,s=p(e,t.__wbindgen_export),i=d;t.chartengine_set_fr_agg_data(this.__mrd_ptr,r,n,s,i)}set_fr_binance_data(_,e){const r=p(_,t.__wbindgen_export),n=d,s=p(e,t.__wbindgen_export),i=d;t.chartengine_set_fr_binance_data(this.__mrd_ptr,r,n,s,i)}set_fr_ratio(_){t.chartengine_set_fr_ratio(this.__mrd_ptr,_)}set_fr_show_agg(_){t.chartengine_set_fr_show_agg(this.__mrd_ptr,_)}set_fr_show_sma(_){t.chartengine_set_fr_show_sma(this.__mrd_ptr,_)}set_heatmap(_,e,r,n,s,i,a){const c=p(_,t.__wbindgen_export),h=d;t.chartengine_set_heatmap(this.__mrd_ptr,c,h,e,r,n,s,i,a)}set_heatmap_prefetch_range(_){t.chartengine_set_heatmap_prefetch_range(this.__mrd_ptr,_)}set_heatmap_range(_,e){t.chartengine_set_heatmap_range(this.__mrd_ptr,_,e)}set_hover_price(_){t.chartengine_set_hover_price(this.__mrd_ptr,_)}set_iceberg_events(_,e,r,n,s,i){const a=p(_,t.__wbindgen_export),c=d,h=p(e,t.__wbindgen_export),g=d,m=p(r,t.__wbindgen_export),u=d,f=p(n,t.__wbindgen_export),x=d,k=J(s,t.__wbindgen_export),z=d,I=G(i,t.__wbindgen_export),q=d;t.chartengine_set_iceberg_events(this.__mrd_ptr,a,c,h,g,m,u,f,x,k,z,I,q)}set_klines(_,e,r,n,s,i){const a=p(_,t.__wbindgen_export),c=d,h=p(e,t.__wbindgen_export),g=d,m=p(r,t.__wbindgen_export),u=d,f=p(n,t.__wbindgen_export),x=d,k=p(s,t.__wbindgen_export),z=d,I=p(i,t.__wbindgen_export),q=d;t.chartengine_set_klines(this.__mrd_ptr,a,c,h,g,m,u,f,x,k,z,I,q)}set_large_trades_data(_){const e=p(_,t.__wbindgen_export),r=d;t.chartengine_set_large_trades_data(this.__mrd_ptr,e,r)}set_license_state(_,e,r){t.chartengine_set_license_state(this.__mrd_ptr,_,e,r)}set_liq_heatmap_cell_height(_){t.chartengine_set_liq_heatmap_cell_height(this.__mrd_ptr,_)}set_liq_heatmap_filled_pct(_){t.chartengine_set_liq_heatmap_filled_pct(this.__mrd_ptr,_)}set_liq_heatmap_filled_zones(_){t.chartengine_set_liq_heatmap_filled_zones(this.__mrd_ptr,_)}set_liq_heatmap_predictions(_){t.chartengine_set_liq_heatmap_predictions(this.__mrd_ptr,_)}set_liq_heatmap_profile(_){t.chartengine_set_liq_heatmap_profile(this.__mrd_ptr,_)}set_liq_heatmap_range(_,e){t.chartengine_set_liq_heatmap_range(this.__mrd_ptr,_,e)}set_live_signals_data(_){const e=p(_,t.__wbindgen_export),r=d;t.chartengine_set_live_signals_data(this.__mrd_ptr,e,r)}set_live_signals_leverage(_){t.chartengine_set_live_signals_leverage(this.__mrd_ptr,_)}set_live_signals_loading(_){t.chartengine_set_live_signals_loading(this.__mrd_ptr,_)}set_live_signals_pip_value(_){t.chartengine_set_live_signals_pip_value(this.__mrd_ptr,_)}set_live_signals_show_entry(_){t.chartengine_set_live_signals_show_entry(this.__mrd_ptr,_)}set_live_signals_show_labels(_){t.chartengine_set_live_signals_show_labels(this.__mrd_ptr,_)}set_live_signals_show_max_profit(_){t.chartengine_set_live_signals_show_max_profit(this.__mrd_ptr,_)}set_live_signals_show_tp_sl(_){t.chartengine_set_live_signals_show_tp_sl(this.__mrd_ptr,_)}set_live_signals_show_zones(_){t.chartengine_set_live_signals_show_zones(this.__mrd_ptr,_)}set_live_signals_text_size(_){t.chartengine_set_live_signals_text_size(this.__mrd_ptr,_)}set_live_signals_trial(_){t.chartengine_set_live_signals_trial(this.__mrd_ptr,_)}set_lt_bubble_scale(_){t.chartengine_set_lt_bubble_scale(this.__mrd_ptr,_)}set_lt_volume_filter(_,e){t.chartengine_set_lt_volume_filter(this.__mrd_ptr,_,e)}set_oi_data(_){const e=p(_,t.__wbindgen_export),r=d;t.chartengine_set_oi_data(this.__mrd_ptr,e,r)}set_oi_data_ts(_,e){const r=p(_,t.__wbindgen_export),n=d,s=p(e,t.__wbindgen_export),i=d;t.chartengine_set_oi_data_ts(this.__mrd_ptr,r,n,s,i)}set_oi_display_mode(_){t.chartengine_set_oi_display_mode(this.__mrd_ptr,_)}set_oi_ratio(_){t.chartengine_set_oi_ratio(this.__mrd_ptr,_)}set_oi_show_on_chart(_){t.chartengine_set_oi_show_on_chart(this.__mrd_ptr,_)}set_path_cursor(_,e){t.chartengine_set_path_cursor(this.__mrd_ptr,_,e)}set_price_precision(_){t.chartengine_set_price_precision(this.__mrd_ptr,_)}set_real_timestamps(_){const e=p(_,t.__wbindgen_export),r=d;t.chartengine_set_real_timestamps(this.__mrd_ptr,e,r)}set_replay_hovered(_){t.chartengine_set_replay_hovered(this.__mrd_ptr,_)}set_replay_preview(_){t.chartengine_set_replay_preview(this.__mrd_ptr,_)}set_replay_state(_,e,r){t.chartengine_set_replay_state(this.__mrd_ptr,_,e,r)}set_rsi_period(_){t.chartengine_set_rsi_period(this.__mrd_ptr,_)}set_rsi_ratio(_){t.chartengine_set_rsi_ratio(this.__mrd_ptr,_)}set_rsi_show_divergence(_){t.chartengine_set_rsi_show_divergence(this.__mrd_ptr,_)}set_rsi_show_ema(_){t.chartengine_set_rsi_show_ema(this.__mrd_ptr,_)}set_rsi_show_signals(_){t.chartengine_set_rsi_show_signals(this.__mrd_ptr,_)}set_rsi_show_traps(_){t.chartengine_set_rsi_show_traps(this.__mrd_ptr,_)}set_rsi_show_wma(_){t.chartengine_set_rsi_show_wma(this.__mrd_ptr,_)}set_rsi_smoothing(_){t.chartengine_set_rsi_smoothing(this.__mrd_ptr,_)}set_si_show_icebergs(_){t.chartengine_set_si_show_icebergs(this.__mrd_ptr,_)}set_si_show_stops(_){t.chartengine_set_si_show_stops(this.__mrd_ptr,_)}set_si_show_zones(_){t.chartengine_set_si_show_zones(this.__mrd_ptr,_)}set_sr_fvg_extend(_){t.chartengine_set_sr_fvg_extend(this.__mrd_ptr,_)}set_sr_fvg_htf(_){t.chartengine_set_sr_fvg_htf(this.__mrd_ptr,_)}set_sr_fvg_mitigation(_){t.chartengine_set_sr_fvg_mitigation(this.__mrd_ptr,_)}set_sr_fvg_theme(_){t.chartengine_set_sr_fvg_theme(this.__mrd_ptr,_)}set_sr_htf_minutes(_){t.chartengine_set_sr_htf_minutes(this.__mrd_ptr,_)}set_sr_mitigation(_){t.chartengine_set_sr_mitigation(this.__mrd_ptr,_)}set_sr_ob_last(_){t.chartengine_set_sr_ob_last(this.__mrd_ptr,_)}set_sr_show_breakers(_){t.chartengine_set_sr_show_breakers(this.__mrd_ptr,_)}set_sr_show_fvg(_){t.chartengine_set_sr_show_fvg(this.__mrd_ptr,_)}set_sr_show_fvg_signals(_){t.chartengine_set_sr_show_fvg_signals(this.__mrd_ptr,_)}set_sr_show_htf_ob(_){t.chartengine_set_sr_show_htf_ob(this.__mrd_ptr,_)}set_sr_show_metrics(_){t.chartengine_set_sr_show_metrics(this.__mrd_ptr,_)}set_sr_show_ob(_){t.chartengine_set_sr_show_ob(this.__mrd_ptr,_)}set_sr_show_ob_activity(_){t.chartengine_set_sr_show_ob_activity(this.__mrd_ptr,_)}set_sr_show_ob_signals(_){t.chartengine_set_sr_show_ob_signals(this.__mrd_ptr,_)}set_sr_show_predict(_){t.chartengine_set_sr_show_predict(this.__mrd_ptr,_)}set_sr_show_smart_rev(_){t.chartengine_set_sr_show_smart_rev(this.__mrd_ptr,_)}set_sr_smart_rev_htf(_){t.chartengine_set_sr_smart_rev_htf(this.__mrd_ptr,_)}set_sr_stats_position(_){t.chartengine_set_sr_stats_position(this.__mrd_ptr,_)}set_sr_stats_type(_){t.chartengine_set_sr_stats_type(this.__mrd_ptr,_)}set_sr_text_size(_){t.chartengine_set_sr_text_size(this.__mrd_ptr,_)}set_theme(_){t.chartengine_set_theme(this.__mrd_ptr,_)}set_tpo_ib(_){t.chartengine_set_tpo_ib(this.__mrd_ptr,_)}set_tpo_ib_minutes(_){t.chartengine_set_tpo_ib_minutes(this.__mrd_ptr,_)}set_tpo_letter_minutes(_){t.chartengine_set_tpo_letter_minutes(this.__mrd_ptr,_)}set_tpo_naked_poc(_){t.chartengine_set_tpo_naked_poc(this.__mrd_ptr,_)}set_tpo_period(_){t.chartengine_set_tpo_period(this.__mrd_ptr,_)}set_tpo_poc_line(_){t.chartengine_set_tpo_poc_line(this.__mrd_ptr,_)}set_tpo_profile_shape(_){t.chartengine_set_tpo_profile_shape(this.__mrd_ptr,_)}set_tpo_signals(_){t.chartengine_set_tpo_signals(this.__mrd_ptr,_)}set_tpo_single_prints(_){t.chartengine_set_tpo_single_prints(this.__mrd_ptr,_)}set_tpo_va_lines(_){t.chartengine_set_tpo_va_lines(this.__mrd_ptr,_)}set_volume_color_mode(_){t.chartengine_set_volume_color_mode(this.__mrd_ptr,_)}set_volume_ma_period(_){t.chartengine_set_volume_ma_period(this.__mrd_ptr,_)}set_volume_show_ma(_){t.chartengine_set_volume_show_ma(this.__mrd_ptr,_)}set_volume_show_signals(_){t.chartengine_set_volume_show_signals(this.__mrd_ptr,_)}set_vpin_bucket_size(_){t.chartengine_set_vpin_bucket_size(this.__mrd_ptr,_)}set_vpin_data(_,e){const r=p(_,t.__wbindgen_export),n=d,s=p(e,t.__wbindgen_export),i=d;t.chartengine_set_vpin_data(this.__mrd_ptr,r,n,s,i)}set_vpin_num_buckets(_){t.chartengine_set_vpin_num_buckets(this.__mrd_ptr,_)}set_vpin_ratio(_){t.chartengine_set_vpin_ratio(this.__mrd_ptr,_)}set_vpin_show_sma(_){t.chartengine_set_vpin_show_sma(this.__mrd_ptr,_)}set_vpin_show_zones(_){t.chartengine_set_vpin_show_zones(this.__mrd_ptr,_)}set_vpin_threshold(_){t.chartengine_set_vpin_threshold(this.__mrd_ptr,_)}set_vrvp_poc_line(_){t.chartengine_set_vrvp_poc_line(this.__mrd_ptr,_)}show_latest(_){t.chartengine_show_latest(this.__mrd_ptr,_)}start_brush(_,e,r,n,s){t.chartengine_start_brush(this.__mrd_ptr,_,e,r,n,s)}start_elliott_manual(_,e,r,n,s){t.chartengine_start_elliott_manual(this.__mrd_ptr,_,e,r,n,s)}start_path(_,e,r,n,s,i){t.chartengine_start_path(this.__mrd_ptr,_,e,r,n,s,i)}update_drawing_anchor(_,e,r){t.chartengine_update_drawing_anchor(this.__mrd_ptr,_,e,r)}update_heatmap_column(_,e){const r=p(e,t.__wbindgen_export),n=d;t.chartengine_update_heatmap_column(this.__mrd_ptr,_,r,n)}update_heatmap_column_at(_,e,r,n){const s=p(_,t.__wbindgen_export),i=d;t.chartengine_update_heatmap_column_at(this.__mrd_ptr,s,i,e,r,n)}update_last_heatmap_column(_,e,r){const n=p(_,t.__wbindgen_export),s=d;t.chartengine_update_last_heatmap_column(this.__mrd_ptr,n,s,e,r)}update_last_kline(_,e,r,n,s,i){t.chartengine_update_last_kline(this.__mrd_ptr,_,e,r,n,s,i)}vpin_to_screen_y(_){return t.chartengine_vpin_to_screen_y(this.__mrd_ptr,_)}vrvp_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_vrvp_hit_test(a,this.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,b(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export3(r,n,1)}}world_to_screen_x(_){return t.chartengine_world_to_screen_x(this.__mrd_ptr,_)}world_to_screen_y(_){return t.chartengine_world_to_screen_y(this.__mrd_ptr,_)}zoom(_,e,r){t.chartengine_zoom(this.__mrd_ptr,_,e,r)}zoom_indicator_y(_,e,r){t.chartengine_zoom_indicator_y(this.__mrd_ptr,_,e,r)}zoom_x(_,e){t.chartengine_zoom_x(this.__mrd_ptr,_,e)}zoom_y(_,e){t.chartengine_zoom_y(this.__mrd_ptr,_,e)}}Symbol.dispose&&(D.prototype[Symbol.dispose]=D.prototype.free);function r_(){const o=t.wasm_memory();return K(o)}function U(){return{__proto__:null,"./chart_engine_bg.js":{__proto__:null,__mrd___wbindgen_memory_edb3f01e3930bbf6:function(){const _=t.memory;return V(_)},__mrd___wbindgen_throw_6ddd609b62940d55:function(_,e){throw new Error(b(_,e))}}}}const L=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(o=>t.__mrd_chartengine_free(o>>>0,1));function V(o){F===w.length&&w.push(w.length+1);const _=F;return F=w[_],w[_]=o,_}function P(o){o<1028||(w[o]=F,F=o)}function y(o,_){return o=o>>>0,C().subarray(o/8,o/8+_)}function H(o,_){return o=o>>>0,N().subarray(o/4,o/4+_)}let v=null;function l(){return(v===null||v.buffer.detached===!0||v.buffer.detached===void 0&&v.buffer!==t.memory.buffer)&&(v=new DataView(t.memory.buffer)),v}let A=null;function C(){return(A===null||A.byteLength===0)&&(A=new Float64Array(t.memory.buffer)),A}let M=null;function N(){return(M===null||M.byteLength===0)&&(M=new Int32Array(t.memory.buffer)),M}function b(o,_){return o=o>>>0,Z(o,_)}let W=null;function X(){return(W===null||W.byteLength===0)&&(W=new Uint32Array(t.memory.buffer)),W}let j=null;function O(){return(j===null||j.byteLength===0)&&(j=new Uint8Array(t.memory.buffer)),j}function Y(o){return w[o]}let w=new Array(1024).fill(void 0);w.push(void 0,null,!0,!1);let F=w.length;function G(o,_){const e=_(o.length*4,4)>>>0;return X().set(o,e/4),d=o.length,e}function J(o,_){const e=_(o.length*1,1)>>>0;return O().set(o,e/1),d=o.length,e}function p(o,_){const e=_(o.length*8,8)>>>0;return C().set(o,e/8),d=o.length,e}function R(o,_,e){if(e===void 0){const a=T.encode(o),c=_(a.length,1)>>>0;return O().subarray(c,c+a.length).set(a),d=a.length,c}let r=o.length,n=_(r,1)>>>0;const s=O();let i=0;for(;i<r;i++){const a=o.charCodeAt(i);if(a>127)break;s[n+i]=a}if(i!==r){i!==0&&(o=o.slice(i)),n=e(n,r,r=i+o.length*3,1)>>>0;const a=O().subarray(n+i,n+r),c=T.encodeInto(o,a);i+=c.written,n=e(n,r,i,1)>>>0}return d=i,n}function K(o){const _=Y(o);return P(o),_}let S=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});S.decode();const Q=2146435072;let E=0;function Z(o,_){return E+=_,E>=Q&&(S=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),S.decode(),E=_),S.decode(O().subarray(o,o+_))}const T=new TextEncoder;"encodeInto"in T||(T.encodeInto=function(o,_){const e=T.encode(o);return _.set(e),{read:o.length,written:e.length}});let d=0,$,t;function B(o,_){return t=o.exports,$=_,v=null,A=null,M=null,W=null,j=null,t}async function __(o,_){if(typeof Response=="function"&&o instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(o,_)}catch(n){if(o.ok&&e(o.type)&&o.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",n);else throw n}const r=await o.arrayBuffer();return await WebAssembly.instantiate(r,_)}else{const r=await WebAssembly.instantiate(o,_);return r instanceof WebAssembly.Instance?{instance:r,module:o}:r}function e(r){switch(r){case"basic":case"cors":case"default":return!0}return!1}}function t_(o){if(t!==void 0)return t;o!==void 0&&(Object.getPrototypeOf(o)===Object.prototype?{module:o}=o:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const _=U();o instanceof WebAssembly.Module||(o=new WebAssembly.Module(o));const e=new WebAssembly.Instance(o,_);return B(e,o)}async function e_(o){if(t!==void 0)return t;o!==void 0&&(Object.getPrototypeOf(o)===Object.prototype?{module_or_path:o}=o:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),o===void 0&&(o=new URL("chart_engine_bg.wasm",import.meta.url));const _=U();(typeof o=="string"||typeof Request=="function"&&o instanceof Request||typeof URL=="function"&&o instanceof URL)&&(o=fetch(o));const{instance:e,module:r}=await __(await o,_);return B(e,r)}export{D as ChartEngine,e_ as default,t_ as initSync,r_ as wasm_memory};
|
|
1
|
+
class D{__destroy_into_raw(){const _=this.__mrd_ptr;return this.__mrd_ptr=0,C.unregister(this),_}free(){const _=this.__destroy_into_raw();t.__mrd_chartengine_free(_,0)}add_anchored_vwap(_,e,r,n,s,i,a){return t.chartengine_add_anchored_vwap(this.__mrd_ptr,_,e,r,n,s,i,a)>>>0}add_arrow(_,e,r,n,s,i,a,c,p,g){return t.chartengine_add_arrow(this.__mrd_ptr,_,e,r,n,s,i,a,c,p,g)>>>0}add_arrow_marker_down(_,e,r,n,s,i,a){return t.chartengine_add_arrow_marker_down(this.__mrd_ptr,_,e,r,n,s,i,a)>>>0}add_arrow_marker_up(_,e,r,n,s,i,a){return t.chartengine_add_arrow_marker_up(this.__mrd_ptr,_,e,r,n,s,i,a)>>>0}add_brush_point(_,e){t.chartengine_add_brush_point(this.__mrd_ptr,_,e)}add_circle(_,e,r,n,s,i,a,c,p,g){return t.chartengine_add_circle(this.__mrd_ptr,_,e,r,n,s,i,a,c,p,g)>>>0}add_elliott_impulse(_,e,r,n,s,i,a){return t.chartengine_add_elliott_impulse(this.__mrd_ptr,_,e,r,n,s,i,a)>>>0}add_elliott_manual_point(_,e){return t.chartengine_add_elliott_manual_point(this.__mrd_ptr,_,e)!==0}add_fib_extension(_,e,r,n,s,i,a,c,p,g,m,u){return t.chartengine_add_fib_extension(this.__mrd_ptr,_,e,r,n,s,i,a,c,p,g,m,u)>>>0}add_fib_retracement(_,e,r,n,s,i,a,c,p,g){return t.chartengine_add_fib_retracement(this.__mrd_ptr,_,e,r,n,s,i,a,c,p,g)>>>0}add_horizontal_line(_,e,r,n,s,i,a,c){return t.chartengine_add_horizontal_line(this.__mrd_ptr,_,e,r,n,s,i,a,c)>>>0}add_long_position(_,e,r,n,s,i,a,c,p,g){return t.chartengine_add_long_position(this.__mrd_ptr,_,e,r,n,s,i,a,c,p,g)>>>0}add_marker(_,e,r){t.chartengine_add_marker(this.__mrd_ptr,_,e,r)}add_parallel_channel(_,e,r,n,s,i,a,c,p,g,m,u){return t.chartengine_add_parallel_channel(this.__mrd_ptr,_,e,r,n,s,i,a,c,p,g,m,u)>>>0}add_path_point(_,e){t.chartengine_add_path_point(this.__mrd_ptr,_,e)}add_price_label(_,e,r,n,s,i,a){return t.chartengine_add_price_label(this.__mrd_ptr,_,e,r,n,s,i,a)>>>0}add_price_range(_,e,r,n,s,i,a,c,p,g){return t.chartengine_add_price_range(this.__mrd_ptr,_,e,r,n,s,i,a,c,p,g)>>>0}add_short_position(_,e,r,n,s,i,a,c,p,g){return t.chartengine_add_short_position(this.__mrd_ptr,_,e,r,n,s,i,a,c,p,g)>>>0}add_text_note(_,e,r,n,s,i,a){return t.chartengine_add_text_note(this.__mrd_ptr,_,e,r,n,s,i,a)>>>0}add_trendline(_,e,r,n,s,i,a,c,p,g){return t.chartengine_add_trendline(this.__mrd_ptr,_,e,r,n,s,i,a,c,p,g)>>>0}append_heatmap_column(_,e,r,n){const s=h(_,t.__wbindgen_export2),i=d;t.chartengine_append_heatmap_column(this.__mrd_ptr,s,i,e,r,n)}append_kline(_,e,r,n,s,i){t.chartengine_append_kline(this.__mrd_ptr,_,e,r,n,s,i)}append_real_timestamp(_){t.chartengine_append_real_timestamp(this.__mrd_ptr,_)}cancel_brush(){t.chartengine_cancel_brush(this.__mrd_ptr)}cancel_elliott_manual(){t.chartengine_cancel_elliott_manual(this.__mrd_ptr)}cancel_path(){t.chartengine_cancel_path(this.__mrd_ptr)}chart_area_h(){return t.chartengine_chart_area_h(this.__mrd_ptr)}chart_area_w(){return t.chartengine_chart_area_w(this.__mrd_ptr)}chart_area_x(){return t.chartengine_chart_area_x(this.__mrd_ptr)}chart_area_y(){return t.chartengine_chart_area_y(this.__mrd_ptr)}clear_channel_preview(){t.chartengine_clear_channel_preview(this.__mrd_ptr)}clear_drawing_preview(){t.chartengine_clear_drawing_preview(this.__mrd_ptr)}clear_drawings(){t.chartengine_clear_drawings(this.__mrd_ptr)}clear_elliott_preview(){t.chartengine_clear_elliott_preview(this.__mrd_ptr)}clear_fib_ext_preview(){t.chartengine_clear_fib_ext_preview(this.__mrd_ptr)}clear_heatmap_prefetch_range(){t.chartengine_clear_heatmap_prefetch_range(this.__mrd_ptr)}clear_hover_price(){t.chartengine_clear_hover_price(this.__mrd_ptr)}clear_large_trades(){t.chartengine_clear_large_trades(this.__mrd_ptr)}clear_live_signals(){t.chartengine_clear_live_signals(this.__mrd_ptr)}clear_markers(){t.chartengine_clear_markers(this.__mrd_ptr)}clear_ob_flow(){t.chartengine_clear_ob_flow(this.__mrd_ptr)}clear_ob_signals(){t.chartengine_clear_ob_signals(this.__mrd_ptr)}custom_band(_,e,r,n,s,i){const a=h(_,t.__wbindgen_export2),c=d,p=h(e,t.__wbindgen_export2),g=d;t.chartengine_custom_band(this.__mrd_ptr,a,c,p,g,r,n,s,i)}custom_begin(){t.chartengine_custom_begin(this.__mrd_ptr)}custom_circle_px(_,e,r,n,s,i,a,c,p,g,m,u){t.chartengine_custom_circle_px(this.__mrd_ptr,_,e,r,n,s,i,a,c,p,g,m,u)}custom_clip_rect(_,e,r,n){t.chartengine_custom_clip_rect(this.__mrd_ptr,_,e,r,n)}custom_command_count(){return t.chartengine_custom_command_count(this.__mrd_ptr)>>>0}custom_dashed_hline(_,e,r,n,s,i,a,c){t.chartengine_custom_dashed_hline(this.__mrd_ptr,_,e,r,n,s,i,a,c)}custom_end(){t.chartengine_custom_end(this.__mrd_ptr)}custom_fill_rect_px(_,e,r,n,s,i,a,c){t.chartengine_custom_fill_rect_px(this.__mrd_ptr,_,e,r,n,s,i,a,c)}custom_hline(_,e,r,n,s,i){t.chartengine_custom_hline(this.__mrd_ptr,_,e,r,n,s,i)}custom_line_px(_,e,r,n,s,i,a,c,p){t.chartengine_custom_line_px(this.__mrd_ptr,_,e,r,n,s,i,a,c,p)}custom_marker(_,e,r,n,s,i,a){t.chartengine_custom_marker(this.__mrd_ptr,_,e,r,n,s,i,a)}custom_marker_down(_,e,r,n,s,i,a){t.chartengine_custom_marker_down(this.__mrd_ptr,_,e,r,n,s,i,a)}custom_marker_up(_,e,r,n,s,i,a){t.chartengine_custom_marker_up(this.__mrd_ptr,_,e,r,n,s,i,a)}custom_price_label(_,e,r,n,s,i,a){const c=f(e,t.__wbindgen_export2,t.__wbindgen_export3),p=d;t.chartengine_custom_price_label(this.__mrd_ptr,_,c,p,r,n,s,i,a)}custom_restore(){t.chartengine_custom_restore(this.__mrd_ptr)}custom_save(){t.chartengine_custom_save(this.__mrd_ptr)}custom_series_dashed_line(_,e,r,n,s,i,a,c){const p=h(_,t.__wbindgen_export2),g=d;t.chartengine_custom_series_dashed_line(this.__mrd_ptr,p,g,e,r,n,s,i,a,c)}custom_series_line(_,e,r,n,s,i){const a=h(_,t.__wbindgen_export2),c=d;t.chartengine_custom_series_line(this.__mrd_ptr,a,c,e,r,n,s,i)}custom_stroke_rect_px(_,e,r,n,s,i,a,c,p){t.chartengine_custom_stroke_rect_px(this.__mrd_ptr,_,e,r,n,s,i,a,c,p)}custom_text(_,e,r,n,s,i,a,c,p){const g=f(r,t.__wbindgen_export2,t.__wbindgen_export3),m=d;t.chartengine_custom_text(this.__mrd_ptr,_,e,g,m,n,s,i,a,c,p)}custom_text_px(_,e,r,n,s,i,a,c,p){const g=f(r,t.__wbindgen_export2,t.__wbindgen_export3),m=d;t.chartengine_custom_text_px(this.__mrd_ptr,_,e,g,m,n,s,i,a,c,p)}delta_histogram_enabled(){return t.chartengine_delta_histogram_enabled(this.__mrd_ptr)!==0}deselect_drawing(){t.chartengine_deselect_drawing(this.__mrd_ptr)}deselect_marker(){t.chartengine_deselect_marker(this.__mrd_ptr)}disable_cvd(){t.chartengine_disable_cvd(this.__mrd_ptr)}disable_delta_histogram(){t.chartengine_disable_delta_histogram(this.__mrd_ptr)}disable_ema_structure(){t.chartengine_disable_ema_structure(this.__mrd_ptr)}disable_forex_signals(){t.chartengine_disable_forex_signals(this.__mrd_ptr)}disable_funding_rate(){t.chartengine_disable_funding_rate(this.__mrd_ptr)}disable_large_trades(){t.chartengine_disable_large_trades(this.__mrd_ptr)}disable_liq_heatmap(){t.chartengine_disable_liq_heatmap(this.__mrd_ptr)}disable_live_signals(){t.chartengine_disable_live_signals(this.__mrd_ptr)}disable_ob_flow(){t.chartengine_disable_ob_flow(this.__mrd_ptr)}disable_ob_signals(){t.chartengine_disable_ob_signals(this.__mrd_ptr)}disable_oi(){t.chartengine_disable_oi(this.__mrd_ptr)}disable_rsi(){t.chartengine_disable_rsi(this.__mrd_ptr)}disable_smart_ranges(){t.chartengine_disable_smart_ranges(this.__mrd_ptr)}disable_stop_iceberg(){t.chartengine_disable_stop_iceberg(this.__mrd_ptr)}disable_tpo(){t.chartengine_disable_tpo(this.__mrd_ptr)}disable_volume(){t.chartengine_disable_volume(this.__mrd_ptr)}disable_vpin(){t.chartengine_disable_vpin(this.__mrd_ptr)}disable_vrvp(){t.chartengine_disable_vrvp(this.__mrd_ptr)}drawing_count(){return t.chartengine_drawing_count(this.__mrd_ptr)>>>0}enable_cvd(){t.chartengine_enable_cvd(this.__mrd_ptr)}enable_delta_histogram(){t.chartengine_enable_delta_histogram(this.__mrd_ptr)}enable_ema_structure(){t.chartengine_enable_ema_structure(this.__mrd_ptr)}enable_forex_signals(){t.chartengine_enable_forex_signals(this.__mrd_ptr)}enable_funding_rate(){t.chartengine_enable_funding_rate(this.__mrd_ptr)}enable_large_trades(){t.chartengine_enable_large_trades(this.__mrd_ptr)}enable_liq_heatmap(){t.chartengine_enable_liq_heatmap(this.__mrd_ptr)}enable_live_signals(){t.chartengine_enable_live_signals(this.__mrd_ptr)}enable_ob_flow(){t.chartengine_enable_ob_flow(this.__mrd_ptr)}enable_ob_signals(){t.chartengine_enable_ob_signals(this.__mrd_ptr)}enable_oi(){t.chartengine_enable_oi(this.__mrd_ptr)}enable_rsi(){t.chartengine_enable_rsi(this.__mrd_ptr)}enable_smart_ranges(){t.chartengine_enable_smart_ranges(this.__mrd_ptr)}enable_stop_iceberg(){t.chartengine_enable_stop_iceberg(this.__mrd_ptr)}enable_tpo(){t.chartengine_enable_tpo(this.__mrd_ptr)}enable_volume(){t.chartengine_enable_volume(this.__mrd_ptr)}enable_vpin(){t.chartengine_enable_vpin(this.__mrd_ptr)}enable_vrvp(){t.chartengine_enable_vrvp(this.__mrd_ptr)}export_drawings_json(){let _,e;try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_export_drawings_json(s,this.__mrd_ptr);var r=l().getInt32(s+4*0,!0),n=l().getInt32(s+4*1,!0);return _=r,e=n,b(r,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(_,e,1)}}finish_brush(){return t.chartengine_finish_brush(this.__mrd_ptr)>>>0}finish_elliott_manual(){return t.chartengine_finish_elliott_manual(this.__mrd_ptr)>>>0}finish_path(){return t.chartengine_finish_path(this.__mrd_ptr)>>>0}fit_content(){t.chartengine_fit_content(this.__mrd_ptr)}footprint_add_trade(_,e,r,n){t.chartengine_footprint_add_trade(this.__mrd_ptr,_,e,r,n)}footprint_add_trade_batch(_){const e=h(_,t.__wbindgen_export2),r=d;t.chartengine_footprint_add_trade_batch(this.__mrd_ptr,e,r)}footprint_clear(){t.chartengine_footprint_clear(this.__mrd_ptr)}footprint_clear_bar(_){t.chartengine_footprint_clear_bar(this.__mrd_ptr,_)}footprint_ensure_len(_){t.chartengine_footprint_ensure_len(this.__mrd_ptr,_)}footprint_get_display_mode(){return t.chartengine_footprint_get_display_mode(this.__mrd_ptr)}footprint_get_show_profile(){return t.chartengine_footprint_get_show_profile(this.__mrd_ptr)!==0}footprint_get_show_signals(){return t.chartengine_footprint_get_show_signals(this.__mrd_ptr)!==0}footprint_prepend_empty(_){t.chartengine_footprint_prepend_empty(this.__mrd_ptr,_)}footprint_profile_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_footprint_profile_hit_test(a,this.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,b(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}footprint_set_bar(_,e,r,n,s){const i=h(r,t.__wbindgen_export2),a=d,c=h(n,t.__wbindgen_export2),p=d,g=h(s,t.__wbindgen_export2),m=d;t.chartengine_footprint_set_bar(this.__mrd_ptr,_,e,i,a,c,p,g,m)}footprint_set_display_mode(_){t.chartengine_footprint_set_display_mode(this.__mrd_ptr,_)}footprint_set_show_profile(_){t.chartengine_footprint_set_show_profile(this.__mrd_ptr,_)}footprint_set_show_signals(_){t.chartengine_footprint_set_show_signals(this.__mrd_ptr,_)}footprint_signal_count(){return t.chartengine_footprint_signal_count(this.__mrd_ptr)>>>0}get_chart_type(){return t.chartengine_get_chart_type(this.__mrd_ptr)}get_command_buffer_len(){return t.chartengine_get_command_buffer_len(this.__mrd_ptr)>>>0}get_command_buffer_ptr(){return t.chartengine_get_command_buffer_ptr(this.__mrd_ptr)>>>0}get_custom_buffer_len(){return t.chartengine_get_custom_buffer_len(this.__mrd_ptr)>>>0}get_custom_buffer_ptr(){return t.chartengine_get_custom_buffer_ptr(this.__mrd_ptr)>>>0}get_cvd_mode(){return t.chartengine_get_cvd_mode(this.__mrd_ptr)}get_cvd_ratio(){return t.chartengine_get_cvd_ratio(this.__mrd_ptr)}get_cvd_show_delta(){return t.chartengine_get_cvd_show_delta(this.__mrd_ptr)!==0}get_cvd_show_divergence(){return t.chartengine_get_cvd_show_divergence(this.__mrd_ptr)!==0}get_cvd_show_signals(){return t.chartengine_get_cvd_show_signals(this.__mrd_ptr)!==0}get_cvd_source(){return t.chartengine_get_cvd_source(this.__mrd_ptr)}get_drawing_color(_){return t.chartengine_get_drawing_color(this.__mrd_ptr,_)>>>0}get_drawing_dashed(_){return t.chartengine_get_drawing_dashed(this.__mrd_ptr,_)!==0}get_drawing_font_size(_){return t.chartengine_get_drawing_font_size(this.__mrd_ptr,_)}get_drawing_hide_label(_){return t.chartengine_get_drawing_hide_label(this.__mrd_ptr,_)!==0}get_drawing_kind_id(_){return t.chartengine_get_drawing_kind_id(this.__mrd_ptr,_)}get_drawing_text(_){let e,r;try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_get_drawing_text(i,this.__mrd_ptr,_);var n=l().getInt32(i+4*0,!0),s=l().getInt32(i+4*1,!0);return e=n,r=s,b(n,s)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(e,r,1)}}get_forex_signals_count(){return t.chartengine_get_forex_signals_count(this.__mrd_ptr)>>>0}get_fr_ratio(){return t.chartengine_get_fr_ratio(this.__mrd_ptr)}get_heatmap_data_max(){return t.chartengine_get_heatmap_data_max(this.__mrd_ptr)}get_heatmap_data_min(){return t.chartengine_get_heatmap_data_min(this.__mrd_ptr)}get_heatmap_last_timestamp(){return t.chartengine_get_heatmap_last_timestamp(this.__mrd_ptr)}get_heatmap_prefetch_max(){return t.chartengine_get_heatmap_prefetch_max(this.__mrd_ptr)}get_heatmap_x_step(){return t.chartengine_get_heatmap_x_step(this.__mrd_ptr)}get_iceberg_count(){return t.chartengine_get_iceberg_count(this.__mrd_ptr)>>>0}get_last_candle_json(){let _,e;try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_get_last_candle_json(s,this.__mrd_ptr);var r=l().getInt32(s+4*0,!0),n=l().getInt32(s+4*1,!0);return _=r,e=n,b(r,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(_,e,1)}}get_last_close(){return t.chartengine_get_last_close(this.__mrd_ptr)}get_liq_heatmap_cell_height(){return t.chartengine_get_liq_heatmap_cell_height(this.__mrd_ptr)}get_liq_heatmap_filled_pct(){return t.chartengine_get_liq_heatmap_filled_pct(this.__mrd_ptr)}get_liq_heatmap_max(){return t.chartengine_get_liq_heatmap_max(this.__mrd_ptr)}get_liq_heatmap_min(){return t.chartengine_get_liq_heatmap_min(this.__mrd_ptr)}get_liq_heatmap_seg_max(){return t.chartengine_get_liq_heatmap_seg_max(this.__mrd_ptr)}get_live_signals_count(){return t.chartengine_get_live_signals_count(this.__mrd_ptr)>>>0}get_live_signals_leverage(){return t.chartengine_get_live_signals_leverage(this.__mrd_ptr)}get_lt_data_max_vol(){return t.chartengine_get_lt_data_max_vol(this.__mrd_ptr)}get_lt_data_min_vol(){return t.chartengine_get_lt_data_min_vol(this.__mrd_ptr)}get_obf_ratio(){return t.chartengine_get_obf_ratio(this.__mrd_ptr)}get_oi_ratio(){return t.chartengine_get_oi_ratio(this.__mrd_ptr)}get_rsi_ratio(){return t.chartengine_get_rsi_ratio(this.__mrd_ptr)}get_selected_drawing(){return t.chartengine_get_selected_drawing(this.__mrd_ptr)>>>0}get_selected_marker(){return t.chartengine_get_selected_marker(this.__mrd_ptr)>>>0}get_sr_signals_count(){return t.chartengine_get_sr_signals_count(this.__mrd_ptr)>>>0}get_stop_run_count(){return t.chartengine_get_stop_run_count(this.__mrd_ptr)>>>0}get_theme(){return t.chartengine_get_theme(this.__mrd_ptr)}get_tooltip_data(){let _,e;try{const s=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_get_tooltip_data(s,this.__mrd_ptr);var r=l().getInt32(s+4*0,!0),n=l().getInt32(s+4*1,!0);return _=r,e=n,b(r,n)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(_,e,1)}}get_tpo_period(){return t.chartengine_get_tpo_period(this.__mrd_ptr)>>>0}get_volume_color_mode(){return t.chartengine_get_volume_color_mode(this.__mrd_ptr)}get_volume_ma_period(){return t.chartengine_get_volume_ma_period(this.__mrd_ptr)>>>0}get_volume_show_ma(){return t.chartengine_get_volume_show_ma(this.__mrd_ptr)!==0}get_volume_show_signals(){return t.chartengine_get_volume_show_signals(this.__mrd_ptr)!==0}get_vpin_bucket_size(){return t.chartengine_get_vpin_bucket_size(this.__mrd_ptr)>>>0}get_vpin_num_buckets(){return t.chartengine_get_vpin_num_buckets(this.__mrd_ptr)>>>0}get_vpin_ratio(){return t.chartengine_get_vpin_ratio(this.__mrd_ptr)}get_vpin_threshold(){return t.chartengine_get_vpin_threshold(this.__mrd_ptr)}hide_crosshair(){t.chartengine_hide_crosshair(this.__mrd_ptr)}hit_test_drawing(_,e){return t.chartengine_hit_test_drawing(this.__mrd_ptr,_,e)>>>0}hit_test_drawing_anchor(_,e){return t.chartengine_hit_test_drawing_anchor(this.__mrd_ptr,_,e)}hit_test_marker(_,e){return t.chartengine_hit_test_marker(this.__mrd_ptr,_,e)>>>0}hit_zone(_,e){return t.chartengine_hit_zone(this.__mrd_ptr,_,e)}hover_hit_test(_,e){try{const i=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_hover_hit_test(i,this.__mrd_ptr,_,e);var r=l().getInt32(i+4*0,!0),n=l().getInt32(i+4*1,!0),s=G(r,n).slice();return t.__wbindgen_export(r,n*4,4),s}finally{t.__wbindgen_add_to_stack_pointer(16)}}import_drawings_json(_){const e=f(_,t.__wbindgen_export2,t.__wbindgen_export3),r=d;t.chartengine_import_drawings_json(this.__mrd_ptr,e,r)}is_cvd_enabled(){return t.chartengine_is_cvd_enabled(this.__mrd_ptr)!==0}is_dirty(){return t.chartengine_is_dirty(this.__mrd_ptr)!==0}is_ema_structure_enabled(){return t.chartengine_is_ema_structure_enabled(this.__mrd_ptr)!==0}is_forex_signals_enabled(){return t.chartengine_is_forex_signals_enabled(this.__mrd_ptr)!==0}is_funding_rate_enabled(){return t.chartengine_is_funding_rate_enabled(this.__mrd_ptr)!==0}is_large_trades_enabled(){return t.chartengine_is_large_trades_enabled(this.__mrd_ptr)!==0}is_liq_heatmap_enabled(){return t.chartengine_is_liq_heatmap_enabled(this.__mrd_ptr)!==0}is_liq_heatmap_filled_zones(){return t.chartengine_is_liq_heatmap_filled_zones(this.__mrd_ptr)!==0}is_liq_heatmap_predictions(){return t.chartengine_is_liq_heatmap_predictions(this.__mrd_ptr)!==0}is_liq_heatmap_profile(){return t.chartengine_is_liq_heatmap_profile(this.__mrd_ptr)!==0}is_live_signals_enabled(){return t.chartengine_is_live_signals_enabled(this.__mrd_ptr)!==0}is_ob_flow_enabled(){return t.chartengine_is_ob_flow_enabled(this.__mrd_ptr)!==0}is_ob_signals_enabled(){return t.chartengine_is_ob_signals_enabled(this.__mrd_ptr)!==0}is_oi_enabled(){return t.chartengine_is_oi_enabled(this.__mrd_ptr)!==0}is_rsi_enabled(){return t.chartengine_is_rsi_enabled(this.__mrd_ptr)!==0}is_rsi_show_traps(){return t.chartengine_is_rsi_show_traps(this.__mrd_ptr)!==0}is_smart_ranges_enabled(){return t.chartengine_is_smart_ranges_enabled(this.__mrd_ptr)!==0}is_stop_iceberg_enabled(){return t.chartengine_is_stop_iceberg_enabled(this.__mrd_ptr)!==0}is_tpo_enabled(){return t.chartengine_is_tpo_enabled(this.__mrd_ptr)!==0}is_tpo_signals(){return t.chartengine_is_tpo_signals(this.__mrd_ptr)!==0}is_volume_enabled(){return t.chartengine_is_volume_enabled(this.__mrd_ptr)!==0}is_vpin_enabled(){return t.chartengine_is_vpin_enabled(this.__mrd_ptr)!==0}is_vrvp_enabled(){return t.chartengine_is_vrvp_enabled(this.__mrd_ptr)!==0}kline_closes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_closes(n,this.__mrd_ptr);var _=l().getInt32(n+4*0,!0),e=l().getInt32(n+4*1,!0),r=x(_,e).slice();return t.__wbindgen_export(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}kline_count(){return t.chartengine_kline_count(this.__mrd_ptr)>>>0}kline_highs(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_highs(n,this.__mrd_ptr);var _=l().getInt32(n+4*0,!0),e=l().getInt32(n+4*1,!0),r=x(_,e).slice();return t.__wbindgen_export(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}kline_lows(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_lows(n,this.__mrd_ptr);var _=l().getInt32(n+4*0,!0),e=l().getInt32(n+4*1,!0),r=x(_,e).slice();return t.__wbindgen_export(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}kline_opens(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_opens(n,this.__mrd_ptr);var _=l().getInt32(n+4*0,!0),e=l().getInt32(n+4*1,!0),r=x(_,e).slice();return t.__wbindgen_export(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}kline_timestamps(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_timestamps(n,this.__mrd_ptr);var _=l().getInt32(n+4*0,!0),e=l().getInt32(n+4*1,!0),r=x(_,e).slice();return t.__wbindgen_export(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}kline_volumes(){try{const n=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_kline_volumes(n,this.__mrd_ptr);var _=l().getInt32(n+4*0,!0),e=l().getInt32(n+4*1,!0),r=x(_,e).slice();return t.__wbindgen_export(_,e*8,8),r}finally{t.__wbindgen_add_to_stack_pointer(16)}}liq_filled_zone_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_liq_filled_zone_hit_test(a,this.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,b(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}liq_heatmap_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_liq_heatmap_hit_test(a,this.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,b(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}liq_predict_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_liq_predict_hit_test(a,this.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,b(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}liq_zone_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_liq_zone_hit_test(a,this.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,b(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}lt_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_lt_hit_test(a,this.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,b(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}move_drawing(_,e){t.chartengine_move_drawing(this.__mrd_ptr,_,e)}constructor(_,e){const r=t.chartengine_new(_,e);return this.__mrd_ptr=r>>>0,C.register(this,this.__mrd_ptr,this),this}ob_flow_to_screen_y(_){return t.chartengine_ob_flow_to_screen_y(this.__mrd_ptr,_)}oi_to_screen_y(_){return t.chartengine_oi_to_screen_y(this.__mrd_ptr,_)}pan(_,e){t.chartengine_pan(this.__mrd_ptr,_,e)}pan_indicator_y(_,e){t.chartengine_pan_indicator_y(this.__mrd_ptr,_,e)}pan_x(_){t.chartengine_pan_x(this.__mrd_ptr,_)}pan_y(_){t.chartengine_pan_y(this.__mrd_ptr,_)}pop_last_kline(){return t.chartengine_pop_last_kline(this.__mrd_ptr)!==0}prepend_klines(_,e,r,n,s,i){const a=h(_,t.__wbindgen_export2),c=d,p=h(e,t.__wbindgen_export2),g=d,m=h(r,t.__wbindgen_export2),u=d,v=h(n,t.__wbindgen_export2),k=d,z=h(s,t.__wbindgen_export2),I=d,q=h(i,t.__wbindgen_export2),A=d;t.chartengine_prepend_klines(this.__mrd_ptr,a,c,p,g,m,u,v,k,z,I,q,A)}push_large_trade(_,e,r,n){t.chartengine_push_large_trade(this.__mrd_ptr,_,e,r,n)}push_obf_sample(_,e,r,n){t.chartengine_push_obf_sample(this.__mrd_ptr,_,e,r,n)}push_obs_alert(_,e,r,n,s){t.chartengine_push_obs_alert(this.__mrd_ptr,_,e,r,n,s)}remove_drawing(_){t.chartengine_remove_drawing(this.__mrd_ptr,_)}remove_marker(_){t.chartengine_remove_marker(this.__mrd_ptr,_)}render(){return t.chartengine_render(this.__mrd_ptr)>>>0}reset_indicator_y_auto(_){t.chartengine_reset_indicator_y_auto(this.__mrd_ptr,_)}resize(_,e){t.chartengine_resize(this.__mrd_ptr,_,e)}rsi_to_screen_y(_){return t.chartengine_rsi_to_screen_y(this.__mrd_ptr,_)}screen_to_cvd_y(_){return t.chartengine_screen_to_cvd_y(this.__mrd_ptr,_)}screen_to_fr_y(_){return t.chartengine_screen_to_fr_y(this.__mrd_ptr,_)}screen_to_ob_flow_y(_){return t.chartengine_screen_to_ob_flow_y(this.__mrd_ptr,_)}screen_to_oi_y(_){return t.chartengine_screen_to_oi_y(this.__mrd_ptr,_)}screen_to_rsi_y(_){return t.chartengine_screen_to_rsi_y(this.__mrd_ptr,_)}screen_to_vpin_y(_){return t.chartengine_screen_to_vpin_y(this.__mrd_ptr,_)}screen_to_world_x(_){return t.chartengine_screen_to_world_x(this.__mrd_ptr,_)}screen_to_world_y(_){return t.chartengine_screen_to_world_y(this.__mrd_ptr,_)}select_drawing(_){t.chartengine_select_drawing(this.__mrd_ptr,_)}select_marker(_){t.chartengine_select_marker(this.__mrd_ptr,_)}set_candle_interval(_){t.chartengine_set_candle_interval(this.__mrd_ptr,_)}set_channel_preview(_,e,r,n,s,i,a,c,p,g,m,u){t.chartengine_set_channel_preview(this.__mrd_ptr,_,e,r,n,s,i,a,c,p,g,m,u)}set_chart_type(_){t.chartengine_set_chart_type(this.__mrd_ptr,_)}set_crosshair(_,e){t.chartengine_set_crosshair(this.__mrd_ptr,_,e)}set_cvd_data(_,e){const r=h(_,t.__wbindgen_export2),n=d,s=h(e,t.__wbindgen_export2),i=d;t.chartengine_set_cvd_data(this.__mrd_ptr,r,n,s,i)}set_cvd_mode(_){t.chartengine_set_cvd_mode(this.__mrd_ptr,_)}set_cvd_ratio(_){t.chartengine_set_cvd_ratio(this.__mrd_ptr,_)}set_cvd_show_delta(_){t.chartengine_set_cvd_show_delta(this.__mrd_ptr,_)}set_cvd_show_divergence(_){t.chartengine_set_cvd_show_divergence(this.__mrd_ptr,_)}set_cvd_show_signals(_){t.chartengine_set_cvd_show_signals(this.__mrd_ptr,_)}set_cvd_source(_){t.chartengine_set_cvd_source(this.__mrd_ptr,_)}set_cvd_spot_data(_,e){const r=h(_,t.__wbindgen_export2),n=d,s=h(e,t.__wbindgen_export2),i=d;t.chartengine_set_cvd_spot_data(this.__mrd_ptr,r,n,s,i)}set_drawing_dashed(_,e){t.chartengine_set_drawing_dashed(this.__mrd_ptr,_,e)}set_drawing_font_size(_,e){t.chartengine_set_drawing_font_size(this.__mrd_ptr,_,e)}set_drawing_hide_label(_,e){t.chartengine_set_drawing_hide_label(this.__mrd_ptr,_,e)}set_drawing_preview(_,e,r,n,s,i,a,c,p,g,m){t.chartengine_set_drawing_preview(this.__mrd_ptr,_,e,r,n,s,i,a,c,p,g,m)}set_drawing_style(_,e,r,n,s){t.chartengine_set_drawing_style(this.__mrd_ptr,_,e,r,n,s)}set_drawing_text(_,e){const r=f(e,t.__wbindgen_export2,t.__wbindgen_export3),n=d;t.chartengine_set_drawing_text(this.__mrd_ptr,_,r,n)}set_elliott_manual_cursor(_,e){t.chartengine_set_elliott_manual_cursor(this.__mrd_ptr,_,e)}set_elliott_preview(_,e,r,n,s,i,a){t.chartengine_set_elliott_preview(this.__mrd_ptr,_,e,r,n,s,i,a)}set_es_ema1_len(_){t.chartengine_set_es_ema1_len(this.__mrd_ptr,_)}set_es_ema2_len(_){t.chartengine_set_es_ema2_len(this.__mrd_ptr,_)}set_es_show_bos(_){t.chartengine_set_es_show_bos(this.__mrd_ptr,_)}set_es_show_ema1(_){t.chartengine_set_es_show_ema1(this.__mrd_ptr,_)}set_es_show_ema2(_){t.chartengine_set_es_show_ema2(this.__mrd_ptr,_)}set_es_show_wma(_){t.chartengine_set_es_show_wma(this.__mrd_ptr,_)}set_es_swing_len(_){t.chartengine_set_es_swing_len(this.__mrd_ptr,_)}set_es_wma_len(_){t.chartengine_set_es_wma_len(this.__mrd_ptr,_)}set_fib_ext_preview(_,e,r,n,s,i,a,c,p,g,m,u){t.chartengine_set_fib_ext_preview(this.__mrd_ptr,_,e,r,n,s,i,a,c,p,g,m,u)}set_footprint_tick_size(_){t.chartengine_set_footprint_tick_size(this.__mrd_ptr,_)}set_forex_signals_mode(_){t.chartengine_set_forex_signals_mode(this.__mrd_ptr,_)}set_forex_signals_setup(_){t.chartengine_set_forex_signals_setup(this.__mrd_ptr,_)}set_forex_signals_show_stats(_){t.chartengine_set_forex_signals_show_stats(this.__mrd_ptr,_)}set_fr_agg_data(_,e){const r=h(_,t.__wbindgen_export2),n=d,s=h(e,t.__wbindgen_export2),i=d;t.chartengine_set_fr_agg_data(this.__mrd_ptr,r,n,s,i)}set_fr_binance_data(_,e){const r=h(_,t.__wbindgen_export2),n=d,s=h(e,t.__wbindgen_export2),i=d;t.chartengine_set_fr_binance_data(this.__mrd_ptr,r,n,s,i)}set_fr_ratio(_){t.chartengine_set_fr_ratio(this.__mrd_ptr,_)}set_fr_show_agg(_){t.chartengine_set_fr_show_agg(this.__mrd_ptr,_)}set_fr_show_sma(_){t.chartengine_set_fr_show_sma(this.__mrd_ptr,_)}set_heatmap(_,e,r,n,s,i,a){const c=h(_,t.__wbindgen_export2),p=d;t.chartengine_set_heatmap(this.__mrd_ptr,c,p,e,r,n,s,i,a)}set_heatmap_prefetch_range(_){t.chartengine_set_heatmap_prefetch_range(this.__mrd_ptr,_)}set_heatmap_range(_,e){t.chartengine_set_heatmap_range(this.__mrd_ptr,_,e)}set_hover_price(_){t.chartengine_set_hover_price(this.__mrd_ptr,_)}set_iceberg_events(_,e,r,n,s,i){const a=h(_,t.__wbindgen_export2),c=d,p=h(e,t.__wbindgen_export2),g=d,m=h(r,t.__wbindgen_export2),u=d,v=h(n,t.__wbindgen_export2),k=d,z=Z(s,t.__wbindgen_export2),I=d,q=Q(i,t.__wbindgen_export2),A=d;t.chartengine_set_iceberg_events(this.__mrd_ptr,a,c,p,g,m,u,v,k,z,I,q,A)}set_klines(_,e,r,n,s,i){const a=h(_,t.__wbindgen_export2),c=d,p=h(e,t.__wbindgen_export2),g=d,m=h(r,t.__wbindgen_export2),u=d,v=h(n,t.__wbindgen_export2),k=d,z=h(s,t.__wbindgen_export2),I=d,q=h(i,t.__wbindgen_export2),A=d;t.chartengine_set_klines(this.__mrd_ptr,a,c,p,g,m,u,v,k,z,I,q,A)}set_large_trades_data(_){const e=h(_,t.__wbindgen_export2),r=d;t.chartengine_set_large_trades_data(this.__mrd_ptr,e,r)}set_license_state(_,e,r){t.chartengine_set_license_state(this.__mrd_ptr,_,e,r)}set_liq_heatmap_cell_height(_){t.chartengine_set_liq_heatmap_cell_height(this.__mrd_ptr,_)}set_liq_heatmap_filled_pct(_){t.chartengine_set_liq_heatmap_filled_pct(this.__mrd_ptr,_)}set_liq_heatmap_filled_zones(_){t.chartengine_set_liq_heatmap_filled_zones(this.__mrd_ptr,_)}set_liq_heatmap_predictions(_){t.chartengine_set_liq_heatmap_predictions(this.__mrd_ptr,_)}set_liq_heatmap_profile(_){t.chartengine_set_liq_heatmap_profile(this.__mrd_ptr,_)}set_liq_heatmap_range(_,e){t.chartengine_set_liq_heatmap_range(this.__mrd_ptr,_,e)}set_live_signals_data(_){const e=h(_,t.__wbindgen_export2),r=d;t.chartengine_set_live_signals_data(this.__mrd_ptr,e,r)}set_live_signals_leverage(_){t.chartengine_set_live_signals_leverage(this.__mrd_ptr,_)}set_live_signals_loading(_){t.chartengine_set_live_signals_loading(this.__mrd_ptr,_)}set_live_signals_pip_value(_){t.chartengine_set_live_signals_pip_value(this.__mrd_ptr,_)}set_live_signals_show_entry(_){t.chartengine_set_live_signals_show_entry(this.__mrd_ptr,_)}set_live_signals_show_labels(_){t.chartengine_set_live_signals_show_labels(this.__mrd_ptr,_)}set_live_signals_show_max_profit(_){t.chartengine_set_live_signals_show_max_profit(this.__mrd_ptr,_)}set_live_signals_show_tp_sl(_){t.chartengine_set_live_signals_show_tp_sl(this.__mrd_ptr,_)}set_live_signals_show_zones(_){t.chartengine_set_live_signals_show_zones(this.__mrd_ptr,_)}set_live_signals_text_size(_){t.chartengine_set_live_signals_text_size(this.__mrd_ptr,_)}set_live_signals_trial(_){t.chartengine_set_live_signals_trial(this.__mrd_ptr,_)}set_lt_bubble_scale(_){t.chartengine_set_lt_bubble_scale(this.__mrd_ptr,_)}set_lt_volume_filter(_,e){t.chartengine_set_lt_volume_filter(this.__mrd_ptr,_,e)}set_obf_data(_){const e=h(_,t.__wbindgen_export2),r=d;t.chartengine_set_obf_data(this.__mrd_ptr,e,r)}set_obf_ratio(_){t.chartengine_set_obf_ratio(this.__mrd_ptr,_)}set_obf_show_cum_delta(_){t.chartengine_set_obf_show_cum_delta(this.__mrd_ptr,_)}set_obf_show_net_flow(_){t.chartengine_set_obf_show_net_flow(this.__mrd_ptr,_)}set_obf_show_obi(_){t.chartengine_set_obf_show_obi(this.__mrd_ptr,_)}set_obs_com(_){t.chartengine_set_obs_com(this.__mrd_ptr,_)}set_obs_gaps(_,e){const r=h(_,t.__wbindgen_export2),n=d,s=h(e,t.__wbindgen_export2),i=d;t.chartengine_set_obs_gaps(this.__mrd_ptr,r,n,s,i)}set_obs_show_alerts(_){t.chartengine_set_obs_show_alerts(this.__mrd_ptr,_)}set_obs_show_com(_){t.chartengine_set_obs_show_com(this.__mrd_ptr,_)}set_obs_show_gaps(_){t.chartengine_set_obs_show_gaps(this.__mrd_ptr,_)}set_obs_show_walls(_){t.chartengine_set_obs_show_walls(this.__mrd_ptr,_)}set_obs_walls(_,e){const r=h(_,t.__wbindgen_export2),n=d,s=h(e,t.__wbindgen_export2),i=d;t.chartengine_set_obs_walls(this.__mrd_ptr,r,n,s,i)}set_oi_data(_){const e=h(_,t.__wbindgen_export2),r=d;t.chartengine_set_oi_data(this.__mrd_ptr,e,r)}set_oi_data_ts(_,e){const r=h(_,t.__wbindgen_export2),n=d,s=h(e,t.__wbindgen_export2),i=d;t.chartengine_set_oi_data_ts(this.__mrd_ptr,r,n,s,i)}set_oi_display_mode(_){t.chartengine_set_oi_display_mode(this.__mrd_ptr,_)}set_oi_ratio(_){t.chartengine_set_oi_ratio(this.__mrd_ptr,_)}set_oi_show_on_chart(_){t.chartengine_set_oi_show_on_chart(this.__mrd_ptr,_)}set_path_cursor(_,e){t.chartengine_set_path_cursor(this.__mrd_ptr,_,e)}set_price_precision(_){t.chartengine_set_price_precision(this.__mrd_ptr,_)}set_real_timestamps(_){const e=h(_,t.__wbindgen_export2),r=d;t.chartengine_set_real_timestamps(this.__mrd_ptr,e,r)}set_replay_hovered(_){t.chartengine_set_replay_hovered(this.__mrd_ptr,_)}set_replay_preview(_){t.chartengine_set_replay_preview(this.__mrd_ptr,_)}set_replay_state(_,e,r){t.chartengine_set_replay_state(this.__mrd_ptr,_,e,r)}set_rsi_period(_){t.chartengine_set_rsi_period(this.__mrd_ptr,_)}set_rsi_ratio(_){t.chartengine_set_rsi_ratio(this.__mrd_ptr,_)}set_rsi_show_divergence(_){t.chartengine_set_rsi_show_divergence(this.__mrd_ptr,_)}set_rsi_show_ema(_){t.chartengine_set_rsi_show_ema(this.__mrd_ptr,_)}set_rsi_show_signals(_){t.chartengine_set_rsi_show_signals(this.__mrd_ptr,_)}set_rsi_show_traps(_){t.chartengine_set_rsi_show_traps(this.__mrd_ptr,_)}set_rsi_show_wma(_){t.chartengine_set_rsi_show_wma(this.__mrd_ptr,_)}set_rsi_smoothing(_){t.chartengine_set_rsi_smoothing(this.__mrd_ptr,_)}set_si_show_icebergs(_){t.chartengine_set_si_show_icebergs(this.__mrd_ptr,_)}set_si_show_stops(_){t.chartengine_set_si_show_stops(this.__mrd_ptr,_)}set_si_show_zones(_){t.chartengine_set_si_show_zones(this.__mrd_ptr,_)}set_sr_fvg_extend(_){t.chartengine_set_sr_fvg_extend(this.__mrd_ptr,_)}set_sr_fvg_htf(_){t.chartengine_set_sr_fvg_htf(this.__mrd_ptr,_)}set_sr_fvg_mitigation(_){t.chartengine_set_sr_fvg_mitigation(this.__mrd_ptr,_)}set_sr_fvg_theme(_){t.chartengine_set_sr_fvg_theme(this.__mrd_ptr,_)}set_sr_htf_minutes(_){t.chartengine_set_sr_htf_minutes(this.__mrd_ptr,_)}set_sr_mitigation(_){t.chartengine_set_sr_mitigation(this.__mrd_ptr,_)}set_sr_ob_last(_){t.chartengine_set_sr_ob_last(this.__mrd_ptr,_)}set_sr_show_breakers(_){t.chartengine_set_sr_show_breakers(this.__mrd_ptr,_)}set_sr_show_fvg(_){t.chartengine_set_sr_show_fvg(this.__mrd_ptr,_)}set_sr_show_fvg_signals(_){t.chartengine_set_sr_show_fvg_signals(this.__mrd_ptr,_)}set_sr_show_htf_ob(_){t.chartengine_set_sr_show_htf_ob(this.__mrd_ptr,_)}set_sr_show_metrics(_){t.chartengine_set_sr_show_metrics(this.__mrd_ptr,_)}set_sr_show_ob(_){t.chartengine_set_sr_show_ob(this.__mrd_ptr,_)}set_sr_show_ob_activity(_){t.chartengine_set_sr_show_ob_activity(this.__mrd_ptr,_)}set_sr_show_ob_signals(_){t.chartengine_set_sr_show_ob_signals(this.__mrd_ptr,_)}set_sr_show_predict(_){t.chartengine_set_sr_show_predict(this.__mrd_ptr,_)}set_sr_show_smart_rev(_){t.chartengine_set_sr_show_smart_rev(this.__mrd_ptr,_)}set_sr_smart_rev_htf(_){t.chartengine_set_sr_smart_rev_htf(this.__mrd_ptr,_)}set_sr_stats_position(_){t.chartengine_set_sr_stats_position(this.__mrd_ptr,_)}set_sr_stats_type(_){t.chartengine_set_sr_stats_type(this.__mrd_ptr,_)}set_sr_text_size(_){t.chartengine_set_sr_text_size(this.__mrd_ptr,_)}set_theme(_){t.chartengine_set_theme(this.__mrd_ptr,_)}set_tpo_ib(_){t.chartengine_set_tpo_ib(this.__mrd_ptr,_)}set_tpo_ib_minutes(_){t.chartengine_set_tpo_ib_minutes(this.__mrd_ptr,_)}set_tpo_letter_minutes(_){t.chartengine_set_tpo_letter_minutes(this.__mrd_ptr,_)}set_tpo_naked_poc(_){t.chartengine_set_tpo_naked_poc(this.__mrd_ptr,_)}set_tpo_period(_){t.chartengine_set_tpo_period(this.__mrd_ptr,_)}set_tpo_poc_line(_){t.chartengine_set_tpo_poc_line(this.__mrd_ptr,_)}set_tpo_profile_shape(_){t.chartengine_set_tpo_profile_shape(this.__mrd_ptr,_)}set_tpo_signals(_){t.chartengine_set_tpo_signals(this.__mrd_ptr,_)}set_tpo_single_prints(_){t.chartengine_set_tpo_single_prints(this.__mrd_ptr,_)}set_tpo_va_lines(_){t.chartengine_set_tpo_va_lines(this.__mrd_ptr,_)}set_volume_color_mode(_){t.chartengine_set_volume_color_mode(this.__mrd_ptr,_)}set_volume_ma_period(_){t.chartengine_set_volume_ma_period(this.__mrd_ptr,_)}set_volume_show_ma(_){t.chartengine_set_volume_show_ma(this.__mrd_ptr,_)}set_volume_show_signals(_){t.chartengine_set_volume_show_signals(this.__mrd_ptr,_)}set_vpin_bucket_size(_){t.chartengine_set_vpin_bucket_size(this.__mrd_ptr,_)}set_vpin_data(_,e){const r=h(_,t.__wbindgen_export2),n=d,s=h(e,t.__wbindgen_export2),i=d;t.chartengine_set_vpin_data(this.__mrd_ptr,r,n,s,i)}set_vpin_num_buckets(_){t.chartengine_set_vpin_num_buckets(this.__mrd_ptr,_)}set_vpin_ratio(_){t.chartengine_set_vpin_ratio(this.__mrd_ptr,_)}set_vpin_show_sma(_){t.chartengine_set_vpin_show_sma(this.__mrd_ptr,_)}set_vpin_show_zones(_){t.chartengine_set_vpin_show_zones(this.__mrd_ptr,_)}set_vpin_threshold(_){t.chartengine_set_vpin_threshold(this.__mrd_ptr,_)}set_vrvp_poc_line(_){t.chartengine_set_vrvp_poc_line(this.__mrd_ptr,_)}show_latest(_){t.chartengine_show_latest(this.__mrd_ptr,_)}start_brush(_,e,r,n,s){t.chartengine_start_brush(this.__mrd_ptr,_,e,r,n,s)}start_elliott_manual(_,e,r,n,s){t.chartengine_start_elliott_manual(this.__mrd_ptr,_,e,r,n,s)}start_path(_,e,r,n,s,i){t.chartengine_start_path(this.__mrd_ptr,_,e,r,n,s,i)}update_drawing_anchor(_,e,r){t.chartengine_update_drawing_anchor(this.__mrd_ptr,_,e,r)}update_heatmap_column(_,e){const r=h(e,t.__wbindgen_export2),n=d;t.chartengine_update_heatmap_column(this.__mrd_ptr,_,r,n)}update_heatmap_column_at(_,e,r,n){const s=h(_,t.__wbindgen_export2),i=d;t.chartengine_update_heatmap_column_at(this.__mrd_ptr,s,i,e,r,n)}update_last_heatmap_column(_,e,r){const n=h(_,t.__wbindgen_export2),s=d;t.chartengine_update_last_heatmap_column(this.__mrd_ptr,n,s,e,r)}update_last_kline(_,e,r,n,s,i){t.chartengine_update_last_kline(this.__mrd_ptr,_,e,r,n,s,i)}vpin_to_screen_y(_){return t.chartengine_vpin_to_screen_y(this.__mrd_ptr,_)}vrvp_hit_test(_,e){let r,n;try{const a=t.__wbindgen_add_to_stack_pointer(-16);t.chartengine_vrvp_hit_test(a,this.__mrd_ptr,_,e);var s=l().getInt32(a+4*0,!0),i=l().getInt32(a+4*1,!0);return r=s,n=i,b(s,i)}finally{t.__wbindgen_add_to_stack_pointer(16),t.__wbindgen_export(r,n,1)}}world_to_screen_x(_){return t.chartengine_world_to_screen_x(this.__mrd_ptr,_)}world_to_screen_y(_){return t.chartengine_world_to_screen_y(this.__mrd_ptr,_)}zoom(_,e,r){t.chartengine_zoom(this.__mrd_ptr,_,e,r)}zoom_indicator_y(_,e,r){t.chartengine_zoom_indicator_y(this.__mrd_ptr,_,e,r)}zoom_x(_,e){t.chartengine_zoom_x(this.__mrd_ptr,_,e)}zoom_y(_,e){t.chartengine_zoom_y(this.__mrd_ptr,_,e)}}Symbol.dispose&&(D.prototype[Symbol.dispose]=D.prototype.free);class U{__destroy_into_raw(){const _=this.__mrd_ptr;return this.__mrd_ptr=0,B.unregister(this),_}free(){const _=this.__destroy_into_raw();t.__mrd_orderbookengine_free(_,0)}center_on_mid(){t.orderbookengine_center_on_mid(this.__mrd_ptr)}clear(){t.orderbookengine_clear(this.__mrd_ptr)}clear_hover(){t.orderbookengine_clear_hover(this.__mrd_ptr)}get_command_buffer_len(){return t.orderbookengine_get_command_buffer_len(this.__mrd_ptr)>>>0}get_command_buffer_ptr(){return t.orderbookengine_get_command_buffer_ptr(this.__mrd_ptr)>>>0}get_hover_price(){return t.orderbookengine_get_hover_price(this.__mrd_ptr)}get_hover_qty(){return t.orderbookengine_get_hover_qty(this.__mrd_ptr)}get_hover_side(){return t.orderbookengine_get_hover_side(this.__mrd_ptr)}get_theme(){return t.orderbookengine_get_theme(this.__mrd_ptr)>>>0}is_dirty(){return t.orderbookengine_is_dirty(this.__mrd_ptr)!==0}constructor(_,e){const r=t.orderbookengine_new(_,e);return this.__mrd_ptr=r>>>0,B.register(this,this.__mrd_ptr,this),this}pan_y(_){t.orderbookengine_pan_y(this.__mrd_ptr,_)}push_heatmap_col(_,e,r){const n=h(_,t.__wbindgen_export2),s=d,i=h(e,t.__wbindgen_export2),a=d;t.orderbookengine_push_heatmap_col(this.__mrd_ptr,n,s,i,a,r)}push_snapshot(_,e,r){const n=h(_,t.__wbindgen_export2),s=d,i=h(e,t.__wbindgen_export2),a=d;t.orderbookengine_push_snapshot(this.__mrd_ptr,n,s,i,a,r)}render(){return t.orderbookengine_render(this.__mrd_ptr)>>>0}reset_ring(){t.orderbookengine_reset_ring(this.__mrd_ptr)}resize(_,e){t.orderbookengine_resize(this.__mrd_ptr,_,e)}set_auto_center(_){t.orderbookengine_set_auto_center(this.__mrd_ptr,_)}set_depth_book(_,e,r){const n=h(_,t.__wbindgen_export2),s=d,i=h(e,t.__wbindgen_export2),a=d;t.orderbookengine_set_depth_book(this.__mrd_ptr,n,s,i,a,r)}set_exchange_count(_){t.orderbookengine_set_exchange_count(this.__mrd_ptr,_)}set_exchange_labels(_){const e=f(_,t.__wbindgen_export2,t.__wbindgen_export3),r=d;t.orderbookengine_set_exchange_labels(this.__mrd_ptr,e,r)}set_heatmap_cols(_){t.orderbookengine_set_heatmap_cols(this.__mrd_ptr,_)}set_hover(_,e){t.orderbookengine_set_hover(this.__mrd_ptr,_,e)}set_hover_y(_){t.orderbookengine_set_hover_y(this.__mrd_ptr,_)}set_price_precision(_){t.orderbookengine_set_price_precision(this.__mrd_ptr,_)}set_ring_capacity(_,e){t.orderbookengine_set_ring_capacity(this.__mrd_ptr,_,e)}set_signal_absorption(_,e){t.orderbookengine_set_signal_absorption(this.__mrd_ptr,_,e)}set_signal_flow(_,e){t.orderbookengine_set_signal_flow(this.__mrd_ptr,_,e)}set_signal_gaps(_,e){const r=h(_,t.__wbindgen_export2),n=d,s=h(e,t.__wbindgen_export2),i=d;t.orderbookengine_set_signal_gaps(this.__mrd_ptr,r,n,s,i)}set_signal_obi(_,e,r){t.orderbookengine_set_signal_obi(this.__mrd_ptr,_,e,r)}set_signal_spoof(_){t.orderbookengine_set_signal_spoof(this.__mrd_ptr,_)}set_signal_walls(_,e){const r=h(_,t.__wbindgen_export2),n=d,s=h(e,t.__wbindgen_export2),i=d;t.orderbookengine_set_signal_walls(this.__mrd_ptr,r,n,s,i)}set_symbol(_){const e=f(_,t.__wbindgen_export2,t.__wbindgen_export3),r=d;t.orderbookengine_set_symbol(this.__mrd_ptr,e,r)}set_theme(_){t.orderbookengine_set_theme(this.__mrd_ptr,_)}set_tick_size(_){t.orderbookengine_set_tick_size(this.__mrd_ptr,_)}set_visible_ticks(_){t.orderbookengine_set_visible_ticks(this.__mrd_ptr,_)}zoom_y(_,e){t.orderbookengine_zoom_y(this.__mrd_ptr,_,e)}}Symbol.dispose&&(U.prototype[Symbol.dispose]=U.prototype.free);function s_(){t.wasm_init()}function i_(){const o=t.wasm_memory();return N(o)}function L(){return{__proto__:null,"./chart_engine_bg.js":{__proto__:null,__mrd___wbindgen_memory_edb3f01e3930bbf6:function(){const _=t.memory;return V(_)},__mrd___wbindgen_throw_6ddd609b62940d55:function(_,e){throw new Error(b(_,e))},__mrd_error_a6fa202b58aa1cd3:function(_,e){let r,n;try{r=_,n=e,console.error(b(_,e))}finally{t.__wbindgen_export(r,n,1)}},__mrd_new_227d7c05414eb861:function(){const _=new Error;return V(_)},__mrd_stack_3b0d974bbf31e44f:function(_,e){const r=H(e).stack,n=f(r,t.__wbindgen_export2,t.__wbindgen_export3),s=d;l().setInt32(_+4,s,!0),l().setInt32(_+0,n,!0)},__wbindgen_object_drop_ref:function(_){N(_)}}}}const C=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(o=>t.__mrd_chartengine_free(o>>>0,1)),B=typeof FinalizationRegistry>"u"?{register:()=>{},unregister:()=>{}}:new FinalizationRegistry(o=>t.__mrd_orderbookengine_free(o>>>0,1));function V(o){R===w.length&&w.push(w.length+1);const _=R;return R=w[_],w[_]=o,_}function Y(o){o<1028||(w[o]=R,R=o)}function x(o,_){return o=o>>>0,P().subarray(o/8,o/8+_)}function G(o,_){return o=o>>>0,J().subarray(o/4,o/4+_)}let y=null;function l(){return(y===null||y.buffer.detached===!0||y.buffer.detached===void 0&&y.buffer!==t.memory.buffer)&&(y=new DataView(t.memory.buffer)),y}let M=null;function P(){return(M===null||M.byteLength===0)&&(M=new Float64Array(t.memory.buffer)),M}let W=null;function J(){return(W===null||W.byteLength===0)&&(W=new Int32Array(t.memory.buffer)),W}function b(o,_){return o=o>>>0,__(o,_)}let j=null;function K(){return(j===null||j.byteLength===0)&&(j=new Uint32Array(t.memory.buffer)),j}let F=null;function O(){return(F===null||F.byteLength===0)&&(F=new Uint8Array(t.memory.buffer)),F}function H(o){return w[o]}let w=new Array(1024).fill(void 0);w.push(void 0,null,!0,!1);let R=w.length;function Q(o,_){const e=_(o.length*4,4)>>>0;return K().set(o,e/4),d=o.length,e}function Z(o,_){const e=_(o.length*1,1)>>>0;return O().set(o,e/1),d=o.length,e}function h(o,_){const e=_(o.length*8,8)>>>0;return P().set(o,e/8),d=o.length,e}function f(o,_,e){if(e===void 0){const a=E.encode(o),c=_(a.length,1)>>>0;return O().subarray(c,c+a.length).set(a),d=a.length,c}let r=o.length,n=_(r,1)>>>0;const s=O();let i=0;for(;i<r;i++){const a=o.charCodeAt(i);if(a>127)break;s[n+i]=a}if(i!==r){i!==0&&(o=o.slice(i)),n=e(n,r,r=i+o.length*3,1)>>>0;const a=O().subarray(n+i,n+r),c=E.encodeInto(o,a);i+=c.written,n=e(n,r,i,1)>>>0}return d=i,n}function N(o){const _=H(o);return Y(o),_}let S=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0});S.decode();const $=2146435072;let T=0;function __(o,_){return T+=_,T>=$&&(S=new TextDecoder("utf-8",{ignoreBOM:!0,fatal:!0}),S.decode(),T=_),S.decode(O().subarray(o,o+_))}const E=new TextEncoder;"encodeInto"in E||(E.encodeInto=function(o,_){const e=E.encode(o);return _.set(e),{read:o.length,written:e.length}});let d=0,t_,t;function X(o,_){return t=o.exports,t_=_,y=null,M=null,W=null,j=null,F=null,t.__wbindgen_start(),t}async function e_(o,_){if(typeof Response=="function"&&o instanceof Response){if(typeof WebAssembly.instantiateStreaming=="function")try{return await WebAssembly.instantiateStreaming(o,_)}catch(n){if(o.ok&&e(o.type)&&o.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",n);else throw n}const r=await o.arrayBuffer();return await WebAssembly.instantiate(r,_)}else{const r=await WebAssembly.instantiate(o,_);return r instanceof WebAssembly.Instance?{instance:r,module:o}:r}function e(r){switch(r){case"basic":case"cors":case"default":return!0}return!1}}function r_(o){if(t!==void 0)return t;o!==void 0&&(Object.getPrototypeOf(o)===Object.prototype?{module:o}=o:console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));const _=L();o instanceof WebAssembly.Module||(o=new WebAssembly.Module(o));const e=new WebAssembly.Instance(o,_);return X(e,o)}async function n_(o){if(t!==void 0)return t;o!==void 0&&(Object.getPrototypeOf(o)===Object.prototype?{module_or_path:o}=o:console.warn("using deprecated parameters for the initialization function; pass a single object instead")),o===void 0&&(o=new URL("chart_engine_bg.wasm",import.meta.url));const _=L();(typeof o=="string"||typeof Request=="function"&&o instanceof Request||typeof URL=="function"&&o instanceof URL)&&(o=fetch(o));const{instance:e,module:r}=await e_(await o,_);return X(e,r)}export{D as ChartEngine,U as OrderbookEngine,n_ as default,r_ as initSync,s_ as wasm_init,i_ as wasm_memory};
|
|
Binary file
|
package/dist/index.d.ts
CHANGED
|
@@ -47,3 +47,48 @@ export interface MrdChart {
|
|
|
47
47
|
setIndicatorEnabled(id: string, enabled: boolean): void;
|
|
48
48
|
listIndicators(): any[];
|
|
49
49
|
}
|
|
50
|
+
|
|
51
|
+
// ── Orderbook Engine ──
|
|
52
|
+
|
|
53
|
+
export declare function createOrderbookBridge(
|
|
54
|
+
canvas: HTMLCanvasElement,
|
|
55
|
+
options?: OrderbookBridgeOptions,
|
|
56
|
+
): Promise<MrdOrderbook>;
|
|
57
|
+
|
|
58
|
+
export interface OrderbookBridgeOptions {
|
|
59
|
+
symbol?: string;
|
|
60
|
+
tickSize?: number;
|
|
61
|
+
visibleTicks?: number;
|
|
62
|
+
heatmapCols?: number;
|
|
63
|
+
exchangeCount?: number;
|
|
64
|
+
pricePrecision?: number;
|
|
65
|
+
theme?: 'dark' | 'light';
|
|
66
|
+
ringCols?: number;
|
|
67
|
+
ringRows?: number;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface MrdOrderbook {
|
|
71
|
+
engine: any;
|
|
72
|
+
start(): void;
|
|
73
|
+
stop(): void;
|
|
74
|
+
resize(): void;
|
|
75
|
+
destroy(): void;
|
|
76
|
+
clear(): void;
|
|
77
|
+
|
|
78
|
+
pushSnapshot(bids: [number, number][], asks: [number, number][], midPrice: number): void;
|
|
79
|
+
pushSnapshotFlat(bidFlat: Float64Array, askFlat: Float64Array, midPrice: number): void;
|
|
80
|
+
|
|
81
|
+
setSymbol(s: string): void;
|
|
82
|
+
setTickSize(t: number): void;
|
|
83
|
+
setVisibleTicks(n: number): void;
|
|
84
|
+
setHeatmapCols(n: number): void;
|
|
85
|
+
setExchangeCount(n: number): void;
|
|
86
|
+
setPrecision(d: number): void;
|
|
87
|
+
setAutoCenter(b: boolean): void;
|
|
88
|
+
centerOnMid(): void;
|
|
89
|
+
setTheme(name: 'dark' | 'light'): void;
|
|
90
|
+
|
|
91
|
+
getHoverPrice(): number;
|
|
92
|
+
getHoverQty(): number;
|
|
93
|
+
getHoverSide(): number;
|
|
94
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var P={FILL_RECT:1,STROKE_RECT:2,LINE:3,DASHED_LINE:4,POLYLINE:5,TEXT:6,CIRCLE:7,TRIANGLE:8,SAVE:9,RESTORE:10,CLIP_RECT:11,ROTATED_TEXT:12,BUBBLE_3D:13,FILL_POLYGON:14,DASHED_POLYLINE:15,END_FRAME:255},Pe=["left","center","right"],St=new Map,Re=4096;function Ye(t,o,n,s){return t<<24|o<<16|n<<8|s}function Z(t,o,n,s){let p=Ye(t,o,n,s),r=St.get(p);return r||(r=`rgba(${t},${o},${n},${(s/255).toFixed(3)})`,St.size>=Re&&St.clear(),St.set(p,r),r)}var Kt=new TextDecoder;function ft(t,o,n,s){let p=o.buffer;if(n+s>p.byteLength)return;let r=new DataView(p,n,s),i=new Uint8Array(p,n,s),e=0,a="",f="",l=-1,g="";for(;e<s;){let u=i[e];if(e+=1,u===P.END_FRAME)break;switch(u){case P.FILL_RECT:{let _=r.getFloat32(e,!0);e+=4;let c=r.getFloat32(e,!0);e+=4;let h=r.getFloat32(e,!0);e+=4;let d=r.getFloat32(e,!0);e+=4;let w=Z(i[e],i[e+1],i[e+2],i[e+3]);e+=4,w!==a&&(t.fillStyle=w,a=w),t.fillRect(_,c,h,d);break}case P.STROKE_RECT:{let _=r.getFloat32(e,!0);e+=4;let c=r.getFloat32(e,!0);e+=4;let h=r.getFloat32(e,!0);e+=4;let d=r.getFloat32(e,!0);e+=4;let w=Z(i[e],i[e+1],i[e+2],i[e+3]);e+=4;let m=r.getFloat32(e,!0);e+=4,w!==f&&(t.strokeStyle=w,f=w),m!==l&&(t.lineWidth=m,l=m),t.strokeRect(_,c,h,d);break}case P.LINE:{let _=r.getFloat32(e,!0);e+=4;let c=r.getFloat32(e,!0);e+=4;let h=r.getFloat32(e,!0);e+=4;let d=r.getFloat32(e,!0);e+=4;let w=Z(i[e],i[e+1],i[e+2],i[e+3]);e+=4;let m=r.getFloat32(e,!0);e+=4,t.beginPath(),w!==f&&(t.strokeStyle=w,f=w),m!==l&&(t.lineWidth=m,l=m),t.setLineDash([]),t.moveTo(_,c),t.lineTo(h,d),t.stroke();break}case P.DASHED_LINE:{let _=r.getFloat32(e,!0);e+=4;let c=r.getFloat32(e,!0);e+=4;let h=r.getFloat32(e,!0);e+=4;let d=r.getFloat32(e,!0);e+=4;let w=Z(i[e],i[e+1],i[e+2],i[e+3]);e+=4;let m=r.getFloat32(e,!0);e+=4;let M=r.getFloat32(e,!0);e+=4;let I=r.getFloat32(e,!0);e+=4,t.beginPath(),w!==f&&(t.strokeStyle=w,f=w),m!==l&&(t.lineWidth=m,l=m),t.setLineDash([M,I]),t.moveTo(_,c),t.lineTo(h,d),t.stroke(),t.setLineDash([]);break}case P.POLYLINE:{let _=r.getUint16(e,!0);e+=2;let c=Z(i[e],i[e+1],i[e+2],i[e+3]);e+=4;let h=r.getFloat32(e,!0);if(e+=4,_>0){let d=new Float32Array(_*2);for(let w=0;w<_;w++)d[w*2]=r.getFloat32(e,!0),e+=4,d[w*2+1]=r.getFloat32(e,!0),e+=4;if(t.beginPath(),c!==f&&(t.strokeStyle=c,f=c),h!==l&&(t.lineWidth=h,l=h),t.setLineDash([]),t.lineJoin="round",t.lineCap="round",_<=3){t.moveTo(d[0],d[1]);for(let w=1;w<_;w++)t.lineTo(d[w*2],d[w*2+1])}else{t.moveTo(d[0],d[1]),t.lineTo((d[0]+d[2])*.5,(d[1]+d[3])*.5);for(let w=1;w<_-1;w++){let m=d[w*2],M=d[w*2+1],I=d[(w+1)*2],C=d[(w+1)*2+1];t.quadraticCurveTo(m,M,(m+I)*.5,(M+C)*.5)}t.lineTo(d[(_-1)*2],d[(_-1)*2+1])}t.stroke()}break}case P.TEXT:{let _=r.getFloat32(e,!0);e+=4;let c=r.getFloat32(e,!0);e+=4;let h=Z(i[e],i[e+1],i[e+2],i[e+3]);e+=4;let d=r.getFloat32(e,!0);e+=4;let w=i[e];e+=1;let m=r.getUint16(e,!0);e+=2;let M=Kt.decode(new Uint8Array(o.buffer,n+e,m));e+=m,h!==a&&(t.fillStyle=h,a=h);let I=`${d}px "IBM Plex Mono",monospace`;I!==g&&(t.font=I,g=I),t.textAlign=Pe[w]||"left",t.textBaseline="middle",t.fillText(M,_,c);break}case P.CIRCLE:{let _=r.getFloat32(e,!0);e+=4;let c=r.getFloat32(e,!0);e+=4;let h=r.getFloat32(e,!0);e+=4;let d=Z(i[e],i[e+1],i[e+2],i[e+3]);e+=4;let w=Z(i[e],i[e+1],i[e+2],i[e+3]);e+=4;let m=r.getFloat32(e,!0);e+=4,t.beginPath(),t.arc(_,c,h,0,Math.PI*2),d!==a&&(t.fillStyle=d,a=d),t.fill(),m>0&&(w!==f&&(t.strokeStyle=w,f=w),m!==l&&(t.lineWidth=m,l=m),t.stroke());break}case P.TRIANGLE:{let _=r.getFloat32(e,!0);e+=4;let c=r.getFloat32(e,!0);e+=4;let h=r.getFloat32(e,!0);e+=4;let d=r.getFloat32(e,!0);e+=4;let w=r.getFloat32(e,!0);e+=4;let m=r.getFloat32(e,!0);e+=4;let M=Z(i[e],i[e+1],i[e+2],i[e+3]);e+=4,t.beginPath(),t.moveTo(_,c),t.lineTo(h,d),t.lineTo(w,m),t.closePath(),M!==a&&(t.fillStyle=M,a=M),t.fill();break}case P.SAVE:{t.save();break}case P.RESTORE:{t.restore(),a="",f="",l=-1,g="";break}case P.CLIP_RECT:{let _=r.getFloat32(e,!0);e+=4;let c=r.getFloat32(e,!0);e+=4;let h=r.getFloat32(e,!0);e+=4;let d=r.getFloat32(e,!0);e+=4,t.beginPath(),t.rect(_,c,h,d),t.clip();break}case P.ROTATED_TEXT:{let _=r.getFloat32(e,!0);e+=4;let c=r.getFloat32(e,!0);e+=4;let h=Z(i[e],i[e+1],i[e+2],i[e+3]);e+=4;let d=r.getFloat32(e,!0);e+=4;let w=r.getFloat32(e,!0);e+=4;let m=r.getUint16(e,!0);e+=2;let M=Kt.decode(i.subarray(e,e+m));e+=m;let I=`${d}px sans-serif`;I!==g&&(t.font=I,g=I),h!==a&&(t.fillStyle=h,a=h),t.textAlign="center",t.textBaseline="middle",t.save(),t.translate(_,c),t.rotate(w),t.fillText(M,0,0),t.restore();break}case P.BUBBLE_3D:{let _=r.getFloat32(e,!0);e+=4;let c=r.getFloat32(e,!0);e+=4;let h=r.getFloat32(e,!0);e+=4;let d=i[e],w=i[e+1],m=i[e+2],M=i[e+3];e+=4;let I=i[e],C=i[e+1],y=i[e+2],$=i[e+3];e+=4;let T=i[e],tt=i[e+1],et=i[e+2],gt=i[e+3];e+=4;let bt=r.getFloat32(e,!0);e+=4;let E=h;if(E<10){let O=`rgba(${d},${w},${m},${(M/255).toFixed(3)})`;t.beginPath(),t.arc(_,c,E,0,Math.PI*2),t.fillStyle=O,t.fill(),a=""}else if(E<18){let O=_-E*.25,G=c-E*.25,W=t.createRadialGradient(O,G,E*.08,_,c,E);W.addColorStop(0,`rgba(${I},${C},${y},${($/255).toFixed(3)})`),W.addColorStop(1,`rgba(${d},${w},${m},${(M/255).toFixed(3)})`),t.beginPath(),t.arc(_,c,E,0,Math.PI*2),t.fillStyle=W,t.fill(),a=""}else{let O=_-E*.25,G=c-E*.25,W=t.createRadialGradient(_,c,E*.85,_,c,E*1.2);W.addColorStop(0,`rgba(${T},${tt},${et},${(gt/255*.5).toFixed(3)})`),W.addColorStop(1,`rgba(${T},${tt},${et},0)`),t.beginPath(),t.arc(_,c,E*1.2,0,Math.PI*2),t.fillStyle=W,t.fill();let B=t.createRadialGradient(O,G,E*.08,_,c,E);B.addColorStop(0,`rgba(${I},${C},${y},${($/255).toFixed(3)})`),B.addColorStop(1,`rgba(${d},${w},${m},${(M/255).toFixed(3)})`),t.beginPath(),t.arc(_,c,E,0,Math.PI*2),t.fillStyle=B,t.fill();let lt=E*.2,rt=t.createRadialGradient(O,G,0,O,G,lt);rt.addColorStop(0,"rgba(255,255,255,0.22)"),rt.addColorStop(1,"rgba(255,255,255,0)"),t.beginPath(),t.arc(O,G,lt,0,Math.PI*2),t.fillStyle=rt,t.fill(),a=""}break}case P.FILL_POLYGON:{let _=r.getUint16(e,!0);e+=2;let c=Z(i[e],i[e+1],i[e+2],i[e+3]);if(e+=4,_>2){t.beginPath();let h=r.getFloat32(e,!0);e+=4;let d=r.getFloat32(e,!0);e+=4,t.moveTo(h,d);for(let w=1;w<_;w++)t.lineTo(r.getFloat32(e,!0),r.getFloat32(e+4,!0)),e+=8;t.closePath(),c!==a&&(t.fillStyle=c,a=c),t.fill()}else e+=_*8;break}case P.DASHED_POLYLINE:{let _=r.getUint16(e,!0);e+=2;let c=Z(i[e],i[e+1],i[e+2],i[e+3]);e+=4;let h=r.getFloat32(e,!0);e+=4;let d=r.getFloat32(e,!0);e+=4;let w=r.getFloat32(e,!0);if(e+=4,_>1){t.beginPath(),c!==f&&(t.strokeStyle=c,f=c),h!==l&&(t.lineWidth=h,l=h),t.setLineDash([d,w]),t.lineJoin="round";let m=r.getFloat32(e,!0);e+=4;let M=r.getFloat32(e,!0);e+=4,t.moveTo(m,M);for(let I=1;I<_;I++)t.lineTo(r.getFloat32(e,!0),r.getFloat32(e+4,!0)),e+=8;t.stroke(),t.setLineDash([])}else e+=_*8;break}default:return}}}var z={trendline:{type:"2point",previewKind:0,addFn:"add_trendline"},arrow:{type:"2point",previewKind:4,addFn:"add_arrow"},measure:{type:"2point",previewKind:2,addFn:"add_price_range"},fib:{type:"2point",previewKind:3,addFn:"add_fib_retracement"},long:{type:"2point",previewKind:5,addFn:"add_long_position"},short:{type:"2point",previewKind:5,addFn:"add_short_position"},hline:{type:"1point_xp",previewKind:1,addFn:"add_horizontal_line"},vwap:{type:"1point_x",previewKind:6,addFn:"add_anchored_vwap"},pricelabel:{type:"1point_xy",previewKind:7,addFn:"add_price_label"},circle:{type:"2point",previewKind:8,addFn:"add_circle"},arrowup:{type:"1point_xy",previewKind:9,addFn:"add_arrow_marker_up"},arrowdown:{type:"1point_xy",previewKind:10,addFn:"add_arrow_marker_down"},textnote:{type:"1point_xy",previewKind:11,addFn:"add_text_note"},channel:{type:"3point",previewKind:0,addFn:"add_parallel_channel"},fibext:{type:"3point",previewKind:0,addFn:"add_fib_extension",previewFn:"fib_ext"},brush:{type:"freehand"},path:{type:"npoint"},elliott:{type:"elliott_manual"},elliottauto:{type:"1point_xy",previewKind:12,addFn:"add_elliott_impulse",previewFn:"elliott"}};function _t(t){return z[t]?.type==="2point"}function dt(t){return z[t]?.type==="3point"}function st(t){let o=z[t]?.type;return o==="1point"||o==="1point_x"||o==="1point_xy"||o==="1point_xp"}function It(t){return z[t]?.type==="freehand"}function q(t){return z[t]?.type==="npoint"}function K(t){return z[t]?.type==="elliott_manual"}var Ut={r:.04,g:.49,b:1,lineWidth:2,dashed:!1,fontSize:12};function U(t,o,n,s,p,r){r=r||Ut;let i=z[o];if(!i)return 0;let e=0;return i.type==="3point"?e=t[i.addFn](n.x1,n.y1,n.x2,n.y2,s,p,r.r,r.g,r.b,r.lineWidth,r.dashed,n.pane):i.type==="2point"?e=t[i.addFn](n.x1,n.y1,s,p,r.r,r.g,r.b,r.lineWidth,r.dashed,n.pane):i.type==="1point_x"?e=t[i.addFn](s,r.r,r.g,r.b,r.lineWidth,r.dashed,n.pane):i.type==="1point_xp"?e=t[i.addFn](s,p,r.r,r.g,r.b,r.lineWidth,r.dashed,n.pane):i.type==="1point_xy"?e=t[i.addFn](s,p,r.r,r.g,r.b,r.fontSize||12,n.pane):e=t[i.addFn](p,r.r,r.g,r.b,r.lineWidth,r.dashed,n.pane),e||0}function D(t,o,n,s,p,r,i){r=r||Ut;let e=z[o];if(e){if(e.previewFn==="elliott"){t.set_elliott_preview(s,p,r.r,r.g,r.b,r.lineWidth,i);return}e.type==="3point"?n.step===1?t.set_drawing_preview(e.previewKind,n.x1,n.y1,s,p,r.r,r.g,r.b,r.lineWidth,r.dashed,i):n.step===2&&(e.previewFn==="fib_ext"?t.set_fib_ext_preview(n.x1,n.y1,n.x2,n.y2,s,p,r.r,r.g,r.b,r.lineWidth,r.dashed,i):t.set_channel_preview(n.x1,n.y1,n.x2,n.y2,s,p,r.r,r.g,r.b,r.lineWidth,r.dashed,i)):e.type==="2point"?t.set_drawing_preview(e.previewKind,n.x1,n.y1,s,p,r.r,r.g,r.b,r.lineWidth,r.dashed,i):e.type==="1point_x"?t.set_drawing_preview(e.previewKind,s,0,0,0,r.r,r.g,r.b,r.lineWidth,r.dashed,i):e.type==="1point_xp"||e.type==="1point_xy"?t.set_drawing_preview(e.previewKind,s,p,0,0,r.r,r.g,r.b,r.lineWidth,r.dashed,i):t.set_drawing_preview(e.previewKind,0,p,0,0,r.r,r.g,r.b,r.lineWidth,r.dashed,i)}}function v(t,o,n,s){let p=t.screen_to_world_x(o),r;switch(s){case 1:r=t.screen_to_rsi_y(n);break;case 2:r=t.screen_to_oi_y(n);break;case 3:r=t.screen_to_fr_y(n);break;case 4:r=t.screen_to_cvd_y(n);break;case 5:r=t.screen_to_vpin_y(n);break;default:r=t.screen_to_world_y(n);break}return{wx:p,wy:r}}function H(t){return t===4?1:t===6?2:t===8?3:t===10?4:t===12?5:0}function k(t){return t===4||t===6||t===8||t===10||t===12}function Y(t){return t===14||t===15||t===16||t===17||t===18}function X(t){return t===4||t===14?1:t===6||t===15?2:t===8||t===16?3:t===10||t===17?4:t===12||t===18?5:0}function x(t,o,n,s){k(o)?(t.pan(n,0),Math.abs(s)>.01&&t.pan_indicator_y(X(o),s)):t.pan(n,s)}function F(t){return t===0||t===4||t===6||t===8||t===10||t===12}function ee(t,o,n,s){t.addEventListener("wheel",e=>{if(s.disposed)return;e.preventDefault(),s.cancelMomentum();let a=e.deltaY>0?1.1:.9,f=o.hit_zone(e.offsetX,e.offsetY);Y(f)?o.zoom_indicator_y(X(f),e.offsetY,a):k(f)?e.ctrlKey?o.zoom_indicator_y(X(f),e.offsetY,a):o.zoom_x(e.offsetX,a):e.ctrlKey?o.zoom_y(e.offsetY,a):e.shiftKey||f===2?o.zoom_x(e.offsetX,a):f===3?o.zoom_y(e.offsetY,a):o.zoom(e.offsetX,e.offsetY,a),n.onDirty()},{passive:!1}),t.addEventListener("mousedown",e=>{if(s.disposed||e.button!==0)return;s.cancelMomentum(),r();let a=performance.now();if(a-s.lastClickTime<300){s.lastClickTime=a;return}s.lastClickTime=a;let f=s.drawingMode;if(f){let g=o.hit_zone(e.offsetX,e.offsetY);if(!F(g))return;let u=H(g),{wx:_,wy:c}=v(o,e.offsetX,e.offsetY,u),h=f.style,d=f.tool;if(K(d)){if(!f.pathStarted)f.pane=u,o.start_elliott_manual(h.r,h.g,h.b,h.lineWidth,u),o.add_elliott_manual_point(_,c),f.pathStarted=!0,f.step=1;else if(o.add_elliott_manual_point(_,c)){s.finishDrawing(),n.onDirty();return}}else if(q(d))f.pathStarted?o.add_path_point(_,c):(f.pane=u,o.start_path(h.r,h.g,h.b,h.lineWidth,h.dashed,u),o.add_path_point(_,c),f.pathStarted=!0,f.step=1);else if(It(d))f.pane=u,o.start_brush(h.r,h.g,h.b,h.lineWidth,u),o.add_brush_point(_,c),s.isBrushing=!0;else if(dt(d))if(f.step===0)f.x1=_,f.y1=c,f.pane=u,f.step=1;else if(f.step===1)f.x2=_,f.y2=c,f.step=2,o.clear_drawing_preview();else{let w=z[d];w&&w.previewFn==="fib_ext"?o.clear_fib_ext_preview():o.clear_channel_preview(),U(o,d,f,_,c,h),s.finishDrawing()}else if(_t(d))f.step===0?(f.x1=_,f.y1=c,f.pane=u,f.step=1):(U(o,d,f,_,c,h),s.finishDrawing());else{f.pane=u;let w=U(o,d,f,_,c,h);s.finishDrawing(),d==="textnote"&&w>0&&(o.select_drawing(w),n.onDrawingSelected?.(w),n.onDrawingDblClick?.(w,e.offsetX,e.offsetY,e.clientX,e.clientY))}n.onDirty();return}let l=o.hit_zone(e.offsetX,e.offsetY);if(l===5){s.isResizingRsi=!0,s.resizeStartY=e.offsetY,s.resizeStartRatio=o.get_rsi_ratio(),t.style.cursor="ns-resize";return}if(l===7){s.isResizingOi=!0,s.resizeStartY=e.offsetY,s.resizeStartRatio=o.get_oi_ratio(),t.style.cursor="ns-resize";return}if(l===9){s.isResizingFr=!0,s.resizeStartY=e.offsetY,s.resizeStartRatio=o.get_fr_ratio(),t.style.cursor="ns-resize";return}if(l===11){s.isResizingCvd=!0,s.resizeStartY=e.offsetY,s.resizeStartRatio=o.get_cvd_ratio(),t.style.cursor="ns-resize";return}if(l===13){s.isResizingVpin=!0,s.resizeStartY=e.offsetY,s.resizeStartRatio=o.get_vpin_ratio(),t.style.cursor="ns-resize";return}if(F(l)){let g=o.get_selected_drawing();if(g>0){let d=o.hit_test_drawing_anchor(e.offsetX,e.offsetY);if(d>=0){s.isDraggingAnchor=!0,s.dragAnchorIdx=d,s.dragAnchorPane=H(l),t.style.cursor="grabbing";return}if(o.hit_test_drawing(e.offsetX,e.offsetY)===g){s.isDraggingDrawing=!0,s.dragDrawingPane=H(l);let{wx:m,wy:M}=v(o,e.offsetX,e.offsetY,s.dragDrawingPane);s.dragDrawingLastWx=m,s.dragDrawingLastWy=M,t.style.cursor="move";return}}let u=o.hit_test_drawing(e.offsetX,e.offsetY);if(u>0){o.deselect_marker(),n.onMarkerSelected?.(0),o.select_drawing(u),n.onDrawingSelected?.(u),n.onDirty();return}let _=o.hit_test_marker(e.offsetX,e.offsetY);if(_>0){o.deselect_drawing(),n.onDrawingSelected?.(0),o.select_marker(_),n.onMarkerSelected?.(_),n.onDirty();return}let c=o.get_selected_drawing(),h=o.get_selected_marker();c>0&&(o.deselect_drawing(),n.onDrawingSelected?.(0),n.onDirty()),h>0&&(o.deselect_marker(),n.onMarkerSelected?.(0),n.onDirty())}F(l)&&(s.liqPinSx=e.offsetX,s.liqPinSy=e.offsetY,s.liqPinTimer&&clearTimeout(s.liqPinTimer),s.liqPinTimer=setTimeout(()=>{s.liqPinTimer=null,n.onLiqAnnotationPin?.(s.liqPinSx,s.liqPinSy)},700)),s.isDragging=!0,s.dragZone=l,s.lastX=e.offsetX,s.lastY=e.offsetY,l===2?t.style.cursor="ew-resize":l===3||Y(l)?t.style.cursor="ns-resize":t.style.cursor="grabbing"});let p=null;function r(){p&&(cancelAnimationFrame(p),p=null)}function i(e,a){let f=o.hover_hit_test(e,a),l=f[0],g=f[1],u=f[2],_=f[3],c=f[4],h=s.drawingMode;l===2?(t.style.cursor="ew-resize",o.hide_crosshair()):l===3||Y(l)?(t.style.cursor="ns-resize",o.hide_crosshair()):(o.set_crosshair(e,a),l===5||l===7||l===9||l===11||l===13?t.style.cursor="ns-resize":!h&&F(l)&&g>0&&u>=0?t.style.cursor="grab":!h&&F(l)&&g>0&&_===g?t.style.cursor="move":!h&&F(l)&&(_>0||c>0)?t.style.cursor="pointer":t.style.cursor="crosshair"),n.onDirty(),n.onCrosshairMove?.(e,a,l),n.onVrvpHover?.(e,a)}t.addEventListener("mousemove",e=>{if(s.disposed)return;if(s.liqPinTimer){let f=Math.abs(e.offsetX-s.liqPinSx),l=Math.abs(e.offsetY-s.liqPinSy);(f>6||l>6)&&(clearTimeout(s.liqPinTimer),s.liqPinTimer=null)}if(s.isResizingRsi){let l=t.getBoundingClientRect().height-28,u=(s.resizeStartY-e.offsetY)/l,_=Math.max(.05,Math.min(.5,s.resizeStartRatio+u));o.set_rsi_ratio(_),n.onDirty();return}if(s.isResizingOi){let l=t.getBoundingClientRect().height-28,u=(s.resizeStartY-e.offsetY)/l,_=Math.max(.05,Math.min(.5,s.resizeStartRatio+u));o.set_oi_ratio(_),n.onDirty();return}if(s.isResizingFr){let l=t.getBoundingClientRect().height-28,u=(s.resizeStartY-e.offsetY)/l,_=Math.max(.05,Math.min(.5,s.resizeStartRatio+u));o.set_fr_ratio(_),n.onDirty();return}if(s.isResizingCvd){let l=t.getBoundingClientRect().height-28,u=(s.resizeStartY-e.offsetY)/l,_=Math.max(.05,Math.min(.5,s.resizeStartRatio+u));o.set_cvd_ratio(_),n.onDirty();return}if(s.isResizingVpin){let l=t.getBoundingClientRect().height-28,u=(s.resizeStartY-e.offsetY)/l,_=Math.max(.05,Math.min(.5,s.resizeStartRatio+u));o.set_vpin_ratio(_),n.onDirty();return}if(s.isDraggingAnchor){let{wx:f,wy:l}=v(o,e.offsetX,e.offsetY,s.dragAnchorPane);o.update_drawing_anchor(s.dragAnchorIdx,f,l),o.set_crosshair(e.offsetX,e.offsetY),n.onDirty(),n.onCrosshairMove?.(e.offsetX,e.offsetY,o.hit_zone(e.offsetX,e.offsetY));return}if(s.isDraggingDrawing){let{wx:f,wy:l}=v(o,e.offsetX,e.offsetY,s.dragDrawingPane),g=f-s.dragDrawingLastWx,u=l-s.dragDrawingLastWy;o.move_drawing(g,u),s.dragDrawingLastWx=f,s.dragDrawingLastWy=l,o.set_crosshair(e.offsetX,e.offsetY),n.onDirty(),n.onCrosshairMove?.(e.offsetX,e.offsetY,o.hit_zone(e.offsetX,e.offsetY));return}let a=s.drawingMode;if(s.isBrushing&&a){let f=a.pane||0,{wx:l,wy:g}=v(o,e.offsetX,e.offsetY,f);o.add_brush_point(l,g),o.set_crosshair(e.offsetX,e.offsetY),n.onDirty();return}if(a&&K(a.tool)&&a.pathStarted){let f=a.pane||0,{wx:l,wy:g}=v(o,e.offsetX,e.offsetY,f);o.set_elliott_manual_cursor(l,g),o.set_crosshair(e.offsetX,e.offsetY);let u=o.hit_zone(e.offsetX,e.offsetY);n.onDirty(),n.onCrosshairMove?.(e.offsetX,e.offsetY,u);return}if(a&&q(a.tool)&&a.pathStarted){let f=a.pane||0,{wx:l,wy:g}=v(o,e.offsetX,e.offsetY,f);o.set_path_cursor(l,g),o.set_crosshair(e.offsetX,e.offsetY);let u=o.hit_zone(e.offsetX,e.offsetY);n.onDirty(),n.onCrosshairMove?.(e.offsetX,e.offsetY,u);return}if(a&&a.step>0){let f=a.pane||0,{wx:l,wy:g}=v(o,e.offsetX,e.offsetY,f);D(o,a.tool,a,l,g,a.style,f),o.set_crosshair(e.offsetX,e.offsetY);let u=o.hit_zone(e.offsetX,e.offsetY);n.onDirty(),n.onCrosshairMove?.(e.offsetX,e.offsetY,u);return}if(a&&st(a.tool)){let f=o.hit_zone(e.offsetX,e.offsetY),l=H(f),{wx:g,wy:u}=v(o,e.offsetX,e.offsetY,l);D(o,a.tool,a,g,u,a.style,l),o.set_crosshair(e.offsetX,e.offsetY),n.onDirty(),n.onCrosshairMove?.(e.offsetX,e.offsetY,f);return}if(s.isDragging){let f=e.offsetX-s.lastX,l=e.offsetY-s.lastY;s.lastX=e.offsetX,s.lastY=e.offsetY,s.dragZone===2?o.pan_x(f):s.dragZone===3?o.pan_y(l):Y(s.dragZone)?o.pan_indicator_y(X(s.dragZone),l):x(o,s.dragZone,f,l),n.onDirty(),n.onCrosshairMove?.(e.offsetX,e.offsetY,s.dragZone),n.onVrvpHover?.(e.offsetX,e.offsetY);return}s._pendingHoverX=e.offsetX,s._pendingHoverY=e.offsetY,p||(p=requestAnimationFrame(()=>{p=null,s.disposed||i(s._pendingHoverX,s._pendingHoverY)}))}),t.addEventListener("mouseup",()=>{s.disposed||(s.liqPinTimer&&(clearTimeout(s.liqPinTimer),s.liqPinTimer=null),s.isBrushing&&(s.isBrushing=!1,o.finish_brush(),s.finishDrawing(),n.onDirty()),s.isDragging=!1,s.isResizingRsi=!1,s.isResizingOi=!1,s.isResizingFr=!1,s.isResizingCvd=!1,s.isResizingVpin=!1,s.isDraggingAnchor=!1,s.isDraggingDrawing=!1,s.dragAnchorIdx=-1,t.style.cursor="crosshair")}),t.addEventListener("mouseleave",()=>{s.disposed||(r(),s.liqPinTimer&&(clearTimeout(s.liqPinTimer),s.liqPinTimer=null),s.isBrushing&&(s.isBrushing=!1,o.finish_brush(),s.finishDrawing()),s.isDragging=!1,s.isResizingRsi=!1,s.isResizingOi=!1,s.isResizingFr=!1,s.isResizingCvd=!1,s.isResizingVpin=!1,s.isDraggingAnchor=!1,s.isDraggingDrawing=!1,s.dragAnchorIdx=-1,o.hide_crosshair(),t.style.cursor="crosshair",n.onDirty(),n.onCrosshairHide?.(),n.onVrvpHover?.(null,null))}),t.addEventListener("dblclick",e=>{if(s.disposed)return;e.preventDefault(),e.stopPropagation();let a=s.drawingMode;if(a&&K(a.tool)&&a.pathStarted){o.finish_elliott_manual(),s.finishDrawing(),n.onDirty();return}if(a&&q(a.tool)&&a.pathStarted){o.finish_path(),s.finishDrawing(),n.onDirty();return}if(a)return;let f=o.hit_zone(e.offsetX,e.offsetY);if(k(f)||Y(f)){o.reset_indicator_y_auto(X(f)),n.onDirty();return}let l=o.hit_test_drawing(e.offsetX,e.offsetY);l>0&&(o.select_drawing(l),n.onDirty(),n.onDrawingDblClick?.(l,e.offsetX,e.offsetY,e.clientX,e.clientY))}),t.addEventListener("contextmenu",e=>{if(s.disposed)return;let a=s.drawingMode;if(a&&K(a.tool)&&a.pathStarted){e.preventDefault(),e.stopPropagation(),o.finish_elliott_manual(),s.finishDrawing(),n.onDirty();return}if(a&&q(a.tool)&&a.pathStarted){e.preventDefault(),e.stopPropagation(),o.finish_path(),s.finishDrawing(),n.onDirty();return}})}function re(t,o,n,s){t.addEventListener("touchstart",p=>{if(!s.disposed){if(p.preventDefault(),s.cancelMomentum(),p.touches.length===2){clearTimeout(s.longPressTimer),s.isCrosshairMode=!1;let r=t.getBoundingClientRect(),i=p.touches[1].clientX-p.touches[0].clientX,e=p.touches[1].clientY-p.touches[0].clientY;s.lastTouchDist=Math.sqrt(i*i+e*e),s.lastX=(p.touches[0].clientX+p.touches[1].clientX)/2-r.left,s.lastY=(p.touches[0].clientY+p.touches[1].clientY)/2-r.top,s.dragZone=o.hit_zone(s.lastX,s.lastY)}else if(p.touches.length===1){let r=t.getBoundingClientRect(),i=p.touches[0].clientX-r.left,e=p.touches[0].clientY-r.top;s.touchStartX=i,s.touchStartY=e,s.touchMoved=!1;let a=s.drawingMode;if(a){let _=o.hit_zone(i,e);if(F(_)){let c=H(_),{wx:h,wy:d}=v(o,i,e,c),w=a.tool;if(K(w)){if(!a.pathStarted)a.pane=c,o.start_elliott_manual(a.style.r,a.style.g,a.style.b,a.style.lineWidth,c),o.add_elliott_manual_point(h,d),a.pathStarted=!0,a.step=1;else if(o.add_elliott_manual_point(h,d)){s.finishDrawing(),n.onDirty();return}}else q(w)?a.pathStarted?o.add_path_point(h,d):(a.pane=c,o.start_path(a.style.r,a.style.g,a.style.b,a.style.lineWidth,a.style.dashed,c),o.add_path_point(h,d),a.pathStarted=!0,a.step=1):It(w)?(a.pane=c,o.start_brush(a.style.r,a.style.g,a.style.b,a.style.lineWidth,c),o.add_brush_point(h,d),s.isBrushing=!0):dt(w)?a.step===0?(a.x1=h,a.y1=d,a.pane=c,a.step=1,a._stepAtTouchStart=0,D(o,w,a,h,d,a.style,c)):a.step===1?(a._stepAtTouchStart=1,D(o,w,a,h,d,a.style,a.pane)):(a._stepAtTouchStart=2,D(o,w,a,h,d,a.style,a.pane)):_t(w)?a.step===0?(a.x1=h,a.y1=d,a.pane=c,a.step=1,a._stepAtTouchStart=0,D(o,w,a,h,d,a.style,c)):(a._stepAtTouchStart=1,D(o,w,a,h,d,a.style,a.pane)):st(w)?(a.pane=c,D(o,w,a,h,d,a.style,c)):(a.pane=c,U(o,w,a,h,d,a.style),s.finishDrawing());o.set_crosshair(i,e),n.onDirty(),n.onCrosshairMove?.(i,e,_)}return}let f=o.hover_hit_test(i,e),l=f[0],g=f[1],u=f[2];if(F(l)&&!s.drawingMode&&g>0){if(u>=0){s.isDraggingAnchor=!0,s.dragAnchorIdx=u,s.dragAnchorPane=H(l);return}if(f[3]===g){s.isDraggingDrawing=!0,s.dragDrawingPane=H(l);let{wx:c,wy:h}=v(o,i,e,s.dragDrawingPane);s.dragDrawingLastWx=c,s.dragDrawingLastWy=h;return}}s.isDragging=!0,s.isCrosshairMode=!1,s.lastX=i,s.lastY=e,s.dragZone=l,clearTimeout(s.longPressTimer),s.longPressTimer=setTimeout(()=>{s.isDragging&&!s.touchMoved&&(s.isCrosshairMode=!0,o.set_crosshair(i,e),n.onDirty(),n.onCrosshairMove?.(i,e,s.dragZone),n.onVrvpHover?.(i,e))},300),F(s.dragZone)&&(s.liqPinSx=i,s.liqPinSy=e,s.liqPinTimer&&clearTimeout(s.liqPinTimer),s.liqPinTimer=setTimeout(()=>{s.liqPinTimer=null,s.touchMoved||n.onLiqAnnotationPin?.(s.liqPinSx,s.liqPinSy)},700))}}},{passive:!1}),t.addEventListener("touchmove",p=>{if(s.disposed)return;p.preventDefault();let r=t.getBoundingClientRect();if(s.isDraggingAnchor&&p.touches.length===1){let e=p.touches[0].clientX-r.left,a=p.touches[0].clientY-r.top,{wx:f,wy:l}=v(o,e,a,s.dragAnchorPane);o.update_drawing_anchor(s.dragAnchorIdx,f,l),o.set_crosshair(e,a),n.onDirty();return}if(s.isDraggingDrawing&&p.touches.length===1){let e=p.touches[0].clientX-r.left,a=p.touches[0].clientY-r.top;s.touchMoved=!0;let{wx:f,wy:l}=v(o,e,a,s.dragDrawingPane),g=f-s.dragDrawingLastWx,u=l-s.dragDrawingLastWy;o.move_drawing(g,u),s.dragDrawingLastWx=f,s.dragDrawingLastWy=l,o.set_crosshair(e,a),n.onDirty();return}let i=s.drawingMode;if(s.isBrushing&&i&&p.touches.length===1){let e=p.touches[0].clientX-r.left,a=p.touches[0].clientY-r.top,f=i.pane||0,{wx:l,wy:g}=v(o,e,a,f);o.add_brush_point(l,g),o.set_crosshair(e,a),n.onDirty(),s.touchMoved=!0;return}if(i&&K(i.tool)&&i.pathStarted&&p.touches.length===1){let e=p.touches[0].clientX-r.left,a=p.touches[0].clientY-r.top,f=i.pane||0,{wx:l,wy:g}=v(o,e,a,f);o.set_elliott_manual_cursor(l,g),o.set_crosshair(e,a),n.onDirty(),s.touchMoved=!0;return}if(i&&q(i.tool)&&i.pathStarted&&p.touches.length===1){let e=p.touches[0].clientX-r.left,a=p.touches[0].clientY-r.top,f=i.pane||0,{wx:l,wy:g}=v(o,e,a,f);o.set_path_cursor(l,g),o.set_crosshair(e,a),n.onDirty(),s.touchMoved=!0;return}if(i&&i.step>0&&p.touches.length===1){let e=p.touches[0].clientX-r.left,a=p.touches[0].clientY-r.top;!s.touchMoved&&(Math.abs(e-s.touchStartX)>10||Math.abs(a-s.touchStartY)>10)&&(s.touchMoved=!0);let f=i.pane||0,{wx:l,wy:g}=v(o,e,a,f);D(o,i.tool,i,l,g,i.style,f),o.set_crosshair(e,a);let u=o.hit_zone(e,a);n.onDirty(),n.onCrosshairMove?.(e,a,u);return}if(i&&st(i.tool)&&p.touches.length===1){let e=p.touches[0].clientX-r.left,a=p.touches[0].clientY-r.top,f=o.hit_zone(e,a),l=H(f),{wx:g,wy:u}=v(o,e,a,l);D(o,i.tool,i,g,u,i.style,l),o.set_crosshair(e,a),n.onDirty(),n.onCrosshairMove?.(e,a,f);return}if(p.touches.length===2){s.velSamples=[];let e=p.touches[1].clientX-p.touches[0].clientX,a=p.touches[1].clientY-p.touches[0].clientY,f=Math.sqrt(e*e+a*a),l=s.lastTouchDist/f,g=(p.touches[0].clientX+p.touches[1].clientX)/2-r.left,u=(p.touches[0].clientY+p.touches[1].clientY)/2-r.top;s.dragZone===3?o.zoom_y(u,l):Y(s.dragZone)?o.zoom_indicator_y(X(s.dragZone),u,l):s.dragZone===2?o.zoom_x(g,l):k(s.dragZone)?(o.zoom_x(g,l),x(o,s.dragZone,g-s.lastX,u-s.lastY)):(o.zoom(g,u,l),x(o,s.dragZone,g-s.lastX,u-s.lastY)),s.lastTouchDist=f,s.lastX=g,s.lastY=u,n.onDirty()}else if(p.touches.length===1&&s.isDragging){let e=p.touches[0].clientX-r.left,a=p.touches[0].clientY-r.top,f=e-s.lastX,l=a-s.lastY;if(!s.touchMoved&&(Math.abs(e-s.touchStartX)>10||Math.abs(a-s.touchStartY)>10)&&(s.touchMoved=!0,s.isCrosshairMode||clearTimeout(s.longPressTimer),s.liqPinTimer&&(clearTimeout(s.liqPinTimer),s.liqPinTimer=null)),s.isCrosshairMode)o.set_crosshair(e,a),n.onDirty(),n.onCrosshairMove?.(e,a,s.dragZone),n.onVrvpHover?.(e,a);else{if(s.lastX=e,s.lastY=a,s.dragZone===3||Y(s.dragZone)||s.recordVelocity(f,l),s.dragZone===2)o.pan_x(f);else if(s.dragZone===3){let u=Math.pow(1.005,l);o.zoom_y(a,u)}else if(Y(s.dragZone)){let u=Math.pow(1.005,l);o.zoom_indicator_y(X(s.dragZone),a,u)}else x(o,s.dragZone,f,l);n.onDirty()}}},{passive:!1}),t.addEventListener("touchend",p=>{if(s.disposed)return;if(clearTimeout(s.longPressTimer),s.liqPinTimer&&(clearTimeout(s.liqPinTimer),s.liqPinTimer=null),s.isDraggingAnchor){s.isDraggingAnchor=!1,s.dragAnchorIdx=-1,o.hide_crosshair(),n.onDirty(),n.onCrosshairHide?.();return}if(s.isDraggingDrawing){if(s.isDraggingDrawing=!1,o.hide_crosshair(),n.onDirty(),n.onCrosshairHide?.(),!s.touchMoved){let i=o.get_selected_drawing();if(i>0){let e=t.getBoundingClientRect();n.onDrawingDblClick?.(i,s.touchStartX,s.touchStartY,s.touchStartX+e.left,s.touchStartY+e.top)}}return}if(s.isBrushing){s.isBrushing=!1,o.finish_brush(),s.finishDrawing(),n.onDirty(),n.onCrosshairHide?.();return}let r=s.drawingMode;if(r&&K(r.tool)&&r.pathStarted){let i=Date.now(),e=s.touchStartX-(s._pathLastTapX||0),a=s.touchStartY-(s._pathLastTapY||0),f=Math.sqrt(e*e+a*a);i-(s._pathLastTapTime||0)<350&&f<30?(o.finish_elliott_manual(),s.finishDrawing(),s._pathLastTapTime=0):(s._pathLastTapTime=i,s._pathLastTapX=s.touchStartX,s._pathLastTapY=s.touchStartY),s.isDragging=!1,s.lastTouchDist=0,n.onDirty();return}if(r&&q(r.tool)&&r.pathStarted){let i=Date.now(),e=s.touchStartX-(s._pathLastTapX||0),a=s.touchStartY-(s._pathLastTapY||0),f=Math.sqrt(e*e+a*a);i-(s._pathLastTapTime||0)<350&&f<30?(o.finish_path(),s.finishDrawing(),s._pathLastTapTime=0):(s._pathLastTapTime=i,s._pathLastTapX=s.touchStartX,s._pathLastTapY=s.touchStartY),s.isDragging=!1,s.lastTouchDist=0,n.onDirty();return}if(r&&dt(r.tool)){let i=r._stepAtTouchStart;if(r.step===1&&(i===1||s.touchMoved)){let e=t.getBoundingClientRect(),a=p.changedTouches?.[0];if(a){let f=a.clientX-e.left,l=a.clientY-e.top,g=r.pane||0,{wx:u,wy:_}=v(o,f,l,g);r.x2=u,r.y2=_,r.step=2,o.clear_drawing_preview()}}else if(r.step===2&&(i===2||s.touchMoved)){let e=t.getBoundingClientRect(),a=p.changedTouches?.[0];if(a){let f=a.clientX-e.left,l=a.clientY-e.top,g=r.pane||0,{wx:u,wy:_}=v(o,f,l,g),c=z[r.tool];c&&c.previewFn==="fib_ext"?o.clear_fib_ext_preview():o.clear_channel_preview(),U(o,r.tool,r,u,_,r.style),s.finishDrawing()}}s.isDragging=!1,s.lastTouchDist=0,s.drawingMode||(o.hide_crosshair(),n.onCrosshairHide?.()),n.onDirty();return}if(r&&r.step===1&&_t(r.tool)){if(r._stepAtTouchStart===1||s.touchMoved){let e=t.getBoundingClientRect(),a=p.changedTouches?.[0];if(a){let f=a.clientX-e.left,l=a.clientY-e.top,g=r.pane||0,{wx:u,wy:_}=v(o,f,l,g);U(o,r.tool,r,u,_,r.style),s.finishDrawing()}}s.isDragging=!1,s.lastTouchDist=0,s.drawingMode||(o.hide_crosshair(),n.onCrosshairHide?.()),n.onDirty();return}if(r&&st(r.tool)){let i=t.getBoundingClientRect(),e=p.changedTouches?.[0];if(e){let a=e.clientX-i.left,f=e.clientY-i.top,l=o.hit_zone(a,f),g=F(l)?H(l):r.pane||0,{wx:u,wy:_}=v(o,a,f,g),c=r.tool;o.clear_drawing_preview();let h=U(o,c,r,u,_,r.style);s.finishDrawing(),c==="textnote"&&h>0&&(o.select_drawing(h),n.onDrawingSelected?.(h),n.onDrawingDblClick?.(h,a,f,a+i.left,f+i.top))}s.isDragging=!1,s.lastTouchDist=0,o.hide_crosshair(),n.onCrosshairHide?.(),n.onDirty();return}if(!s.touchMoved&&!s.drawingMode&&s.isDragging){let i=Date.now(),e=s.touchStartX-s.lastTapX,a=s.touchStartY-s.lastTapY,f=Math.sqrt(e*e+a*a),l=i-s.lastTapTime<350&&f<30,g=o.hover_hit_test(s.touchStartX,s.touchStartY),u=g[0],_=g[1],c=g[3],h=g[4];if(l&&(k(u)||Y(u)))o.reset_indicator_y_auto(X(u)),n.onDirty(),s.lastTapTime=i,s.lastTapX=s.touchStartX,s.lastTapY=s.touchStartY;else if(F(u))if(c>0){o.deselect_marker(),n.onMarkerSelected?.(0),o.select_drawing(c);let d=t.getBoundingClientRect(),w=s.touchStartX+d.left,m=s.touchStartY+d.top;n.onDrawingSelected?.(c,w,m),(_<=0||_===c)&&n.onDrawingDblClick?.(c,s.touchStartX,s.touchStartY,w,m),n.onDirty()}else h>0?(o.deselect_drawing(),n.onDrawingSelected?.(0),o.select_marker(h),n.onMarkerSelected?.(h),n.onDirty()):(_>0&&(o.deselect_drawing(),n.onDrawingSelected?.(0),n.onDirty()),o.get_selected_marker()>0&&(o.deselect_marker(),n.onMarkerSelected?.(0),n.onDirty()));s.lastTapTime=i,s.lastTapX=s.touchStartX,s.lastTapY=s.touchStartY}s.touchMoved&&!s.isCrosshairMode&&!s.drawingMode&&s.dragZone!==3&&!Y(s.dragZone)&&s.startMomentum(s.dragZone),s.isDragging=!1,s.isCrosshairMode=!1,s.lastTouchDist=0,(!s.drawingMode||s.drawingMode.step===0)&&(o.hide_crosshair(),n.onCrosshairHide?.()),n.onDirty(),n.onVrvpHover?.(null,null)})}function Yt(t,o,n){let s={disposed:!1,isDragging:!1,dragZone:0,lastX:0,lastY:0,lastTouchDist:0,isResizingRsi:!1,isResizingOi:!1,isResizingFr:!1,isResizingCvd:!1,resizeStartY:0,resizeStartRatio:0,lastClickTime:0,isDraggingAnchor:!1,dragAnchorIdx:-1,dragAnchorPane:0,isBrushing:!1,isDraggingDrawing:!1,dragDrawingPane:0,dragDrawingLastWx:0,dragDrawingLastWy:0,touchStartX:0,touchStartY:0,touchMoved:!1,longPressTimer:null,isCrosshairMode:!1,liqPinTimer:null,liqPinSx:0,liqPinSy:0,velSamples:[],momentumRaf:null,momentumVx:0,momentumVy:0,momentumZone:0,lastTapTime:0,lastTapX:0,lastTapY:0,drawingMode:null},p=.92,r=.5,i=80;s.recordVelocity=function(l,g){let u=performance.now();for(s.velSamples.push({dx:l,dy:g,t:u});s.velSamples.length>0&&u-s.velSamples[0].t>i;)s.velSamples.shift()};function e(){if(s.velSamples.length<2)return{vx:0,vy:0};let l=s.velSamples[0],u=s.velSamples[s.velSamples.length-1].t-l.t;if(u<5)return{vx:0,vy:0};let _=0,c=0;for(let d of s.velSamples)_+=d.dx,c+=d.dy;let h=16.67;return{vx:_/u*h,vy:c/u*h}}s.cancelMomentum=function(){s.momentumRaf&&(cancelAnimationFrame(s.momentumRaf),s.momentumRaf=null),s.velSamples=[]},s.startMomentum=function(l){let{vx:g,vy:u}=e();if(s.velSamples=[],Math.abs(g)<r&&Math.abs(u)<r)return;s.momentumVx=g,s.momentumVy=u,s.momentumZone=l;function _(){if(s.momentumVx*=p,s.momentumVy*=p,Math.abs(s.momentumVx)<r&&Math.abs(s.momentumVy)<r){s.momentumRaf=null;return}s.momentumZone===2?o.pan_x(s.momentumVx):s.momentumZone===3?o.pan_y(s.momentumVy):Y(s.momentumZone)?o.pan_indicator_y(X(s.momentumZone),s.momentumVy):x(o,s.momentumZone,s.momentumVx,s.momentumVy),n.onDirty(),s.momentumRaf=requestAnimationFrame(_)}s.momentumRaf=requestAnimationFrame(_)};let a={setMode(l,g){l?(s.drawingMode={tool:l,style:g,step:0,x1:0,y1:0},t.style.cursor="crosshair"):(s.drawingMode?.pathStarted&&o.finish_path(),s.drawingMode=null,o.clear_drawing_preview(),t.style.cursor="crosshair"),n.onDirty()},getMode(){return s.drawingMode}};n.drawingApi?.(a),s.finishDrawing=function(){o.clear_drawing_preview(),n.onDrawingComplete?.(),s.drawingMode=null,t.style.cursor="crosshair"},ee(t,o,n,s),re(t,o,n,s);let f=l=>{let g=document.activeElement?.tagName,u=g==="INPUT"||g==="TEXTAREA"||document.activeElement?.isContentEditable;if((l.key==="Delete"||l.key==="Backspace")&&!s.drawingMode&&!u){let c=o.get_selected_drawing();if(c>0){o.remove_drawing(c),n.onDrawingSelected?.(0),n.onDirty();return}let h=o.get_selected_marker();if(h>0){o.remove_marker(h),n.onMarkerSelected?.(0),n.onDirty();return}}if(l.key==="Escape"&&!s.drawingMode){if(o.get_selected_drawing()>0){o.deselect_drawing(),n.onDrawingSelected?.(0),n.onDirty();return}if(o.get_selected_marker()>0){o.deselect_marker(),n.onMarkerSelected?.(0),n.onDirty();return}}if(l.key==="Escape"&&s.drawingMode){if(s.drawingMode.pathStarted){s.drawingMode.tool==="elliott"?o.finish_elliott_manual():o.finish_path(),s.finishDrawing(),n.onDirty();return}o.clear_drawing_preview(),s.drawingMode=null,t.style.cursor="crosshair",n.onDrawingCancel?.(),n.onDirty();return}let _=20;switch(l.key){case"+":case"=":o.zoom(t.width/2,t.height/2,.9);break;case"-":o.zoom(t.width/2,t.height/2,1.1);break;case"ArrowLeft":o.pan_x(_);break;case"ArrowRight":o.pan_x(-_);break;case"ArrowUp":o.pan_y(-_);break;case"ArrowDown":o.pan_y(_);break;case"r":case"R":o.auto_scale_y();for(let c=1;c<=5;c++)o.reset_indicator_y_auto(c);break;default:return}n.onDirty()};return window.addEventListener("keydown",f),()=>{s.disposed=!0,s.cancelMomentum(),window.removeEventListener("keydown",f)}}function se(t,o,n,s){let p=r=>s()(r);return{enableRsi(){t.enable_rsi(),o()},disableRsi(){t.disable_rsi(),o()},setRsiPeriod(r){t.set_rsi_period(r),o()},isRsiEnabled(){return t.is_rsi_enabled()},setRsiShowEma(r){t.set_rsi_show_ema(r),o()},setRsiShowWma(r){t.set_rsi_show_wma(r),o()},setRsiShowSignals(r){t.set_rsi_show_signals(r),o()},setRsiShowDivergence(r){t.set_rsi_show_divergence(r),o()},setRsiShowTraps(r){t.set_rsi_show_traps(r),o()},setRsiSmoothing(r){t.set_rsi_smoothing(r),o()},setRsiRatio(r){t.set_rsi_ratio(r),o()},getRsiRatio(){return t.get_rsi_ratio()},enableForexSignals(){p("forexSignals")&&(t.enable_forex_signals(),o())},disableForexSignals(){t.disable_forex_signals(),o()},isForexSignalsEnabled(){return t.is_forex_signals_enabled()},setForexSignalsSetup(r){t.set_forex_signals_setup(r),o()},setForexSignalsMode(r){t.set_forex_signals_mode(r),o()},setForexSignalsShowStats(r){t.set_forex_signals_show_stats(r),o()},getForexSignalsCount(){return t.get_forex_signals_count()},enableOi(){n()||p("oi")&&(t.enable_oi(),o())},disableOi(){n()||(t.disable_oi(),o())},isOiEnabled(){if(n())return!1;try{return t.is_oi_enabled()}catch{return!1}},setOiData(r){n()||(t.set_oi_data(r),o())},setOiDataTs(r,i){n()||(t.set_oi_data_ts(r,i),o())},setOiShowOnChart(r){n()||(t.set_oi_show_on_chart(r),o())},setOiDisplayMode(r){n()||(t.set_oi_display_mode(r),o())},setOiRatio(r){n()||(t.set_oi_ratio(r),o())},getOiRatio(){if(n())return .2;try{return t.get_oi_ratio()}catch{return .2}},enableFundingRate(){n()||p("fundingRate")&&(t.enable_funding_rate(),o())},disableFundingRate(){n()||(t.disable_funding_rate(),o())},isFundingRateEnabled(){if(n())return!1;try{return t.is_funding_rate_enabled()}catch{return!1}},setFrBinanceData(r,i){n()||(t.set_fr_binance_data(r,i),o())},setFrAggData(r,i){n()||(t.set_fr_agg_data(r,i),o())},setFrShowAgg(r){n()||(t.set_fr_show_agg(r),o())},setFrShowSma(r){n()||(t.set_fr_show_sma(r),o())},enableCvd(){n()||p("cvd")&&(t.enable_cvd(),o())},disableCvd(){n()||(t.disable_cvd(),o())},isCvdEnabled(){if(n())return!1;try{return t.is_cvd_enabled()}catch{return!1}},setCvdData(r,i){n()||(t.set_cvd_data(r,i),o())},setCvdSpotData(r,i){n()||(t.set_cvd_spot_data(r,i),o())},setCvdSource(r){n()||(t.set_cvd_source(r),o())},getCvdSource(){if(n())return 0;try{return t.get_cvd_source()}catch{return 0}},setCvdMode(r){n()||(t.set_cvd_mode(r),o())},getCvdMode(){if(n())return 0;try{return t.get_cvd_mode()}catch{return 0}},setCvdShowDelta(r){n()||(t.set_cvd_show_delta(r),o())},getCvdShowDelta(){if(n())return!0;try{return t.get_cvd_show_delta()}catch{return!0}},setCvdShowSignals(r){n()||(t.set_cvd_show_signals(r),o())},getCvdShowSignals(){if(n())return!0;try{return t.get_cvd_show_signals()}catch{return!0}},setCvdShowDivergence(r){n()||(t.set_cvd_show_divergence(r),o())},getCvdShowDivergence(){if(n())return!1;try{return t.get_cvd_show_divergence()}catch{return!1}},enableLargeTrades(){n()||p("largeTrades")&&(t.enable_large_trades(),o())},disableLargeTrades(){n()||(t.disable_large_trades(),o())},isLargeTradesEnabled(){if(n())return!1;try{return t.is_large_trades_enabled()}catch{return!1}},setLargeTradesData(r){n()||(t.set_large_trades_data(r),o())},pushLargeTrade(r,i,e,a){n()||(t.push_large_trade(r,i,e,a),o())},clearLargeTrades(){n()||(t.clear_large_trades(),o())},setLtVolumeFilter(r,i){n()||(t.set_lt_volume_filter(r,i),o())},setLtBubbleScale(r){n()||(t.set_lt_bubble_scale(r),o())},getLtDataMinVol(){return n()?0:t.get_lt_data_min_vol()},getLtDataMaxVol(){return n()?0:t.get_lt_data_max_vol()},ltHitTest(r,i){if(n())return"";try{return t.lt_hit_test(r,i)}catch{return""}},enableVrvp(){n()||p("vrvp")&&(t.enable_vrvp(),o())},disableVrvp(){n()||(t.disable_vrvp(),o())},isVrvpEnabled(){if(n())return!1;try{return t.is_vrvp_enabled()}catch{return!1}},setVrvpPocLine(r){n()||(t.set_vrvp_poc_line(r),o())},vrvpHitTest(r,i){if(n())return"";try{return t.vrvp_hit_test(r,i)}catch{return""}},enableTpo(){n()||p("tpo")&&(t.enable_tpo(),o())},disableTpo(){n()||(t.disable_tpo(),o())},isTpoEnabled(){if(n())return!1;try{return t.is_tpo_enabled()}catch{return!1}},setTpoPocLine(r){n()||(t.set_tpo_poc_line(r),o())},setTpoVaLines(r){n()||(t.set_tpo_va_lines(r),o())},setTpoIb(r){n()||(t.set_tpo_ib(r),o())},setTpoSinglePrints(r){n()||(t.set_tpo_single_prints(r),o())},setTpoPeriod(r){n()||(t.set_tpo_period(r),o())},getTpoPeriod(){if(n())return 1440;try{return t.get_tpo_period()}catch{return 1440}},setTpoNakedPoc(r){n()||(t.set_tpo_naked_poc(r),o())},setTpoProfileShape(r){n()||(t.set_tpo_profile_shape(r),o())},setTpoIbMinutes(r){n()||(t.set_tpo_ib_minutes(r),o())},setTpoLetterMinutes(r){n()||(t.set_tpo_letter_minutes(r),o())},setTpoSignals(r){n()||(t.set_tpo_signals(r),o())},isTpoSignals(){if(n())return!1;try{return t.is_tpo_signals()}catch{return!1}},enableLiqHeatmap(){n()||p("liqHeatmap")&&(t.enable_liq_heatmap(),o())},disableLiqHeatmap(){n()||(t.disable_liq_heatmap(),o())},isLiqHeatmapEnabled(){if(n())return!1;try{return t.is_liq_heatmap_enabled()}catch{return!1}},setLiqHeatmapRange(r,i){n()||(t.set_liq_heatmap_range(r,i),o())},getLiqHeatmapMin(){if(n())return 0;try{return t.get_liq_heatmap_min()}catch{return 0}},getLiqHeatmapMax(){if(n())return 1;try{return t.get_liq_heatmap_max()}catch{return 1}},getLiqHeatmapSegMax(){if(n())return 0;try{return t.get_liq_heatmap_seg_max()}catch{return 0}},setLiqHeatmapProfile(r){n()||(t.set_liq_heatmap_profile(r),o())},isLiqHeatmapProfile(){if(n())return!0;try{return t.is_liq_heatmap_profile()}catch{return!0}},setLiqHeatmapCellHeight(r){n()||(t.set_liq_heatmap_cell_height(r),o())},getLiqHeatmapCellHeight(){if(n())return 1;try{return t.get_liq_heatmap_cell_height()}catch{return 1}},setLiqHeatmapPredictions(r){n()||(t.set_liq_heatmap_predictions(r),o())},setLiqHeatmapFilledPct(r){n()||(t.set_liq_heatmap_filled_pct(r),o())},getLiqHeatmapFilledPct(){if(n())return .85;try{return t.get_liq_heatmap_filled_pct()}catch{return .85}},liqHeatmapHitTest(r,i){if(n())return"";try{return t.liq_heatmap_hit_test(r,i)}catch{return""}},liqZoneHitTest(r,i){if(n())return"";try{return t.liq_zone_hit_test(r,i)}catch{return""}},enableSmartRanges(){n()||p("smartRanges")&&(t.enable_smart_ranges(),o())},disableSmartRanges(){n()||(t.disable_smart_ranges(),o())},isSmartRangesEnabled(){if(n())return!1;try{return t.is_smart_ranges_enabled()}catch{return!1}},setSrTextSize(r){n()||(t.set_sr_text_size(r),o())},setSrShowOb(r){n()||(t.set_sr_show_ob(r),o())},setSrObLast(r){n()||(t.set_sr_ob_last(r),o())},setSrShowObActivity(r){n()||(t.set_sr_show_ob_activity(r),o())},setSrShowBreakers(r){n()||(t.set_sr_show_breakers(r),o())},setSrMitigation(r){n()||(t.set_sr_mitigation(r),o())},setSrShowMetrics(r){n()||(t.set_sr_show_metrics(r),o())},setSrShowHtfOb(r){n()||(t.set_sr_show_htf_ob(r),o())},setSrHtfMinutes(r){n()||(t.set_sr_htf_minutes(r),o())},setSrShowFvg(r){n()||(t.set_sr_show_fvg(r),o())},setSrFvgTheme(r){n()||(t.set_sr_fvg_theme(r),o())},setSrFvgMitigation(r){n()||(t.set_sr_fvg_mitigation(r),o())},setSrFvgHtf(r){n()||(t.set_sr_fvg_htf(r),o())},setSrFvgExtend(r){n()||(t.set_sr_fvg_extend(r),o())},setSrShowObSignals(r){n()||(t.set_sr_show_ob_signals(r),o())},setSrShowPredict(r){n()||(t.set_sr_show_predict(r),o())},setSrShowFvgSignals(r){n()||(t.set_sr_show_fvg_signals(r),o())},setSrShowSmartRev(r){n()||(t.set_sr_show_smart_rev(r),o())},setSrSmartRevHtf(r){n()||(t.set_sr_smart_rev_htf(r),o())},setSrStatsType(r){n()||(t.set_sr_stats_type(r),o())},setSrStatsPosition(r){n()||(t.set_sr_stats_position(r),o())},getSrSignalsCount(){if(n())return 0;try{return t.get_sr_signals_count()}catch{return 0}},enableEmaStructure(){n()||p("emaStructure")&&(t.enable_ema_structure(),o())},disableEmaStructure(){n()||(t.disable_ema_structure(),o())},isEmaStructureEnabled(){if(n())return!1;try{return t.is_ema_structure_enabled()}catch{return!1}},setEsEma1Len(r){n()||(t.set_es_ema1_len(r),o())},setEsEma2Len(r){n()||(t.set_es_ema2_len(r),o())},setEsWmaLen(r){n()||(t.set_es_wma_len(r),o())},setEsShowEma1(r){n()||(t.set_es_show_ema1(r),o())},setEsShowEma2(r){n()||(t.set_es_show_ema2(r),o())},setEsShowWma(r){n()||(t.set_es_show_wma(r),o())},setEsSwingLen(r){n()||(t.set_es_swing_len(r),o())},setEsShowBos(r){n()||(t.set_es_show_bos(r),o())},enableLiveSignals(){n()||(t.enable_live_signals(),o())},disableLiveSignals(){n()||(t.disable_live_signals(),o())},isLiveSignalsEnabled(){if(n())return!1;try{return t.is_live_signals_enabled()}catch{return!1}},setLiveSignalsData(r){n()||(t.set_live_signals_data(new Float64Array(r)),o())},clearLiveSignals(){n()||(t.clear_live_signals(),o())},setLiveSignalsLeverage(r){n()||(t.set_live_signals_leverage(r),o())},getLiveSignalsLeverage(){if(n())return 10;try{return t.get_live_signals_leverage()}catch{return 10}},setLiveSignalsTrial(r){n()||(t.set_live_signals_trial(r),o())},setLiveSignalsShowEntry(r){n()||(t.set_live_signals_show_entry(r),o())},setLiveSignalsShowTpSl(r){n()||(t.set_live_signals_show_tp_sl(r),o())},setLiveSignalsShowMaxProfit(r){n()||(t.set_live_signals_show_max_profit(r),o())},setLiveSignalsShowLabels(r){n()||(t.set_live_signals_show_labels(r),o())},setLiveSignalsShowZones(r){n()||(t.set_live_signals_show_zones(r),o())},setLiveSignalsTextSize(r){n()||(t.set_live_signals_text_size(r),o())},setLiveSignalsPipValue(r){n()||(t.set_live_signals_pip_value(r),o())},setLiveSignalsLoading(r){n()||(t.set_live_signals_loading(r),o())},getLiveSignalsCount(){if(n())return 0;try{return t.get_live_signals_count()}catch{return 0}},enableVpin(){n()||p("vpin")&&(t.enable_vpin(),o())},disableVpin(){n()||(t.disable_vpin(),o())},isVpinEnabled(){if(n())return!1;try{return t.is_vpin_enabled()}catch{return!1}},setVpinData(r,i){n()||(t.set_vpin_data(r,i),o())},setVpinBucketSize(r){n()||(t.set_vpin_bucket_size(r),o())},getVpinBucketSize(){if(n())return 50;try{return t.get_vpin_bucket_size()}catch{return 50}},setVpinNumBuckets(r){n()||(t.set_vpin_num_buckets(r),o())},getVpinNumBuckets(){if(n())return 50;try{return t.get_vpin_num_buckets()}catch{return 50}},setVpinThreshold(r){n()||(t.set_vpin_threshold(r),o())},getVpinThreshold(){if(n())return .7;try{return t.get_vpin_threshold()}catch{return .7}},setVpinShowSma(r){n()||(t.set_vpin_show_sma(r),o())},setVpinShowZones(r){n()||(t.set_vpin_show_zones(r),o())},enableStopIceberg(){n()||p("stopIceberg")&&(t.enable_stop_iceberg(),o())},disableStopIceberg(){n()||(t.disable_stop_iceberg(),o())},isStopIcebergEnabled(){if(n())return!1;try{return t.is_stop_iceberg_enabled()}catch{return!1}},setSiShowStops(r){n()||(t.set_si_show_stops(r),o())},setSiShowIcebergs(r){n()||(t.set_si_show_icebergs(r),o())},setSiShowZones(r){n()||(t.set_si_show_zones(r),o())},setIcebergEvents(r,i,e,a,f,l){n()||(t.set_iceberg_events(r,i,e,a,f,l),o())},getStopRunCount(){if(n())return 0;try{return t.get_stop_run_count()}catch{return 0}},getIcebergCount(){if(n())return 0;try{return t.get_iceberg_count()}catch{return 0}},enableVolume(){t.enable_volume(),o()},disableVolume(){t.disable_volume(),o()},isVolumeEnabled(){return t.is_volume_enabled()},setVolumeMaPeriod(r){t.set_volume_ma_period(r),o()},setVolumeShowMa(r){t.set_volume_show_ma(r),o()},setVolumeShowSignals(r){t.set_volume_show_signals(r),o()},setVolumeColorMode(r){t.set_volume_color_mode(r),o()},getVolumeMaPeriod(){return t.get_volume_ma_period()},getVolumeShowMa(){return t.get_volume_show_ma()},getVolumeShowSignals(){return t.get_volume_show_signals()},getVolumeColorMode(){return t.get_volume_color_mode()}}}function ne(t,o,n,s){let p=i=>s()(i),r=(i,e,a)=>i<=1&&e<=1&&a<=1&&(i>0||e>0||a>0)?[Math.round(i*255),Math.round(e*255),Math.round(a*255)]:[i&255,e&255,a&255];return{addMarker(i,e,a){t.add_marker(i,e,a),o()},clearMarkers(){t.clear_markers(),o()},hitTestMarker(i,e){return t.hit_test_marker(i,e)},selectMarker(i){t.select_marker(i),o()},deselectMarker(){t.deselect_marker(),o()},getSelectedMarker(){return t.get_selected_marker()},removeMarker(i){t.remove_marker(i),o()},deleteSelectedMarker(){let i=t.get_selected_marker();return i>0&&(t.remove_marker(i),o()),i},addTrendline(i,e,a,f,l,g,u,_,c,h=0){let[d,w,m]=r(l,g,u),M=t.add_trendline(i,e,a,f,d,w,m,_,c,h);return o(),M},addHorizontalLine(i,e,a,f,l,g,u,_=0){let[c,h,d]=r(a,f,l),w=t.add_horizontal_line(i,e,c,h,d,g,u,_);return o(),w},addArrow(i,e,a,f,l,g,u,_,c,h=0){let[d,w,m]=r(l,g,u),M=t.add_arrow(i,e,a,f,d,w,m,_,c,h);return o(),M},addFibRetracement(i,e,a,f,l,g,u,_,c,h=0){if(!p("drawingFull"))return 0;let[d,w,m]=r(l,g,u),M=t.add_fib_retracement(i,e,a,f,d,w,m,_,c,h);return o(),M},addFibExtension(i,e,a,f,l,g,u,_,c,h,d,w=0){if(!p("drawingFull"))return 0;let[m,M,I]=r(u,_,c),C=t.add_fib_extension(i,e,a,f,l,g,m,M,I,h,d,w);return o(),C},addLongPosition(i,e,a,f,l,g,u,_,c,h=0){if(!p("drawingFull"))return 0;let[d,w,m]=r(l,g,u),M=t.add_long_position(i,e,a,f,d,w,m,_,c,h);return o(),M},addShortPosition(i,e,a,f,l,g,u,_,c,h=0){if(!p("drawingFull"))return 0;let[d,w,m]=r(l,g,u),M=t.add_short_position(i,e,a,f,d,w,m,_,c,h);return o(),M},addAnchoredVwap(i,e,a,f,l,g,u=0){if(!p("drawingFull"))return 0;let[_,c,h]=r(e,a,f),d=t.add_anchored_vwap(i,_,c,h,l,g,u);return o(),d},addPriceLabel(i,e,a,f,l,g,u=0){let[_,c,h]=r(a,f,l),d=t.add_price_label(i,e,_,c,h,g,u);return o(),d},addElliottImpulse(i,e,a,f,l,g,u=0){if(!p("drawingFull"))return 0;let[_,c,h]=r(a,f,l),d=t.add_elliott_impulse(i,e,_,c,h,g,u);return o(),d},setDrawingFontSize(i,e){t.set_drawing_font_size(i,e),o()},getDrawingFontSize(i){return t.get_drawing_font_size(i)},setDrawingText(i,e){t.set_drawing_text(i,e),o()},getDrawingText(i){return t.get_drawing_text(i)},setDrawingStyle(i,e,a,f,l){let[g,u,_]=r(e,a,f);t.set_drawing_style(i,g,u,_,l),o()},getDrawingColor(i){let e=t.get_drawing_color(i);return e?{r:e>>>24&255,g:e>>>16&255,b:e>>>8&255,lineWidth:(e&255)/10}:null},getDrawingDashed(i){try{return t.get_drawing_dashed(i)}catch{return!1}},setDrawingDashed(i,e){t.set_drawing_dashed(i,e),o()},getDrawingHideLabel(i){try{return t.get_drawing_hide_label(i)}catch{return!1}},setDrawingHideLabel(i,e){t.set_drawing_hide_label(i,e),o()},getDrawingKindId(i){try{return t.get_drawing_kind_id(i)}catch{return 255}},removeDrawing(i){t.remove_drawing(i),o()},clearDrawings(){t.clear_drawings(),o()},drawingCount(){return t.drawing_count()},setDrawingPreview(i,e,a,f,l,g,u,_,c,h,d=0){let[w,m,M]=r(g,u,_);t.set_drawing_preview(i,e,a,f,l,w,m,M,c,h,d),o()},clearDrawingPreview(){t.clear_drawing_preview(),o()},cancelBrush(){t.cancel_brush(),o()},selectDrawing(i){t.select_drawing(i),o()},deselectDrawing(){t.deselect_drawing(),o()},getSelectedDrawing(){return t.get_selected_drawing()},deleteSelectedDrawing(){let i=t.get_selected_drawing();return i>0&&(t.remove_drawing(i),o()),i},exportDrawingsJson(){try{return t.export_drawings_json()}catch{return"[]"}},importDrawingsJson(i){try{t.import_drawings_json(i),o()}catch(e){console.warn("[bridge] importDrawingsJson failed",e)}},screenToWorld(i,e){return{x:t.screen_to_world_x(i),y:t.screen_to_world_y(e)}},worldToScreen(i,e){try{return{x:t.world_to_screen_x(i),y:t.world_to_screen_y(e)}}catch{return null}}}}var N=t=>t instanceof Float64Array?t:new Float64Array(t);function ie(t,o,n,s){let p=r=>s()(r);return{setKlines(r,i,e,a,f,l){t.set_klines(N(r),N(i),N(e),N(a),N(f),N(l)),o()},setRealTimestamps(r){t.set_real_timestamps(N(r)),o()},appendRealTimestamp(r){t.append_real_timestamp(r)},prependKlines(r,i,e,a,f,l){t.prepend_klines(N(r),N(i),N(e),N(a),N(f),N(l)),o()},appendKline(r,i,e,a,f,l){t.append_kline(r,i,e,a,f,l),o()},updateLastKline(r,i,e,a,f,l){t.update_last_kline(r,i,e,a,f,l),o()},popLastKline(){let r=t.pop_last_kline();return r&&o(),r},getLastClose(){try{return t.get_last_close()}catch{return 0}},getKlineCount(){if(n())return 0;try{return t.kline_count()}catch{return 0}},getKlineTimestamps(){if(n())return null;try{return t.kline_timestamps()}catch{return null}},getKlineOpens(){if(n())return null;try{return t.kline_opens()}catch{return null}},getKlineHighs(){if(n())return null;try{return t.kline_highs()}catch{return null}},getKlineLows(){if(n())return null;try{return t.kline_lows()}catch{return null}},getKlineCloses(){if(n())return null;try{return t.kline_closes()}catch{return null}},getKlineVolumes(){if(n())return null;try{return t.kline_volumes()}catch{return null}},setHeatmap(r,i,e,a,f,l,g){p("heatmap")&&(t.set_heatmap(N(r),i,e,a,f,l,g),o())},appendHeatmapColumn(r,i,e,a){p("heatmap")&&(t.append_heatmap_column(N(r),i,e,a),o())},updateLastHeatmapColumn(r,i,e){t.update_last_heatmap_column(N(r),i,e),o()},getHeatmapLastTimestamp(){try{return t.get_heatmap_last_timestamp()}catch{return 0}},getHeatmapXStep(){try{return t.get_heatmap_x_step()}catch{return 0}},updateHeatmapColumnAt(r,i,e,a){t.update_heatmap_column_at(N(r),i,e,a),o()},setHeatmapRange(r,i){t.set_heatmap_range(r,i),o()},getHeatmapDataRange(){try{return{min:t.get_heatmap_data_min(),max:t.get_heatmap_data_max()}}catch{return{min:0,max:0}}},setHeatmapPrefetchRange(r){try{t.set_heatmap_prefetch_range(r)}catch{}},clearHeatmapPrefetchRange(){try{t.clear_heatmap_prefetch_range()}catch{}},getHeatmapPrefetchMax(){try{return t.get_heatmap_prefetch_max()}catch{return 0}},setChartType(r){n()||r===2&&!p("footprint")||(t.set_chart_type(r),o())},getChartType(){if(n())return 0;try{return t.get_chart_type()}catch{return 0}},setFootprintTickSize(r){n()||p("footprint")&&(t.set_footprint_tick_size(r),o())},footprintEnsureLen(r){n()||t.footprint_ensure_len(r)},footprintAddTrade(r,i,e,a){n()||t.footprint_add_trade(r,i,e,a)},footprintAddTradeBatch(r){n()||!r||r.length===0||t.footprint_add_trade_batch(N(r))},footprintSetBar(r,i,e,a,f){n()||(t.footprint_set_bar(r,i,e,a,f),o())},footprintClear(){n()||(t.footprint_clear(),o())},footprintClearBar(r){n()||t.footprint_clear_bar(r)},footprintPrependEmpty(r){n()||t.footprint_prepend_empty(r)},footprintSetShowSignals(r){n()||(t.footprint_set_show_signals(r),o())},footprintGetShowSignals(){if(n())return!0;try{return t.footprint_get_show_signals()}catch{return!0}},footprintSignalCount(){if(n())return 0;try{return t.footprint_signal_count()}catch{return 0}},footprintSetShowProfile(r){n()||(t.footprint_set_show_profile(r),o())},footprintGetShowProfile(){if(n())return!1;try{return t.footprint_get_show_profile()}catch{return!1}},footprintProfileHitTest(r,i){if(n())return"";try{return t.footprint_profile_hit_test(r,i)}catch{return""}},footprintSetDisplayMode(r){n()||(t.footprint_set_display_mode(r),o())},footprintGetDisplayMode(){if(n())return 0;try{return t.footprint_get_display_mode()}catch{return 0}},enableDeltaHistogram(){n()||t.enable_delta_histogram()},disableDeltaHistogram(){n()||t.disable_delta_histogram()},deltaHistogramEnabled(){if(n())return!1;try{return t.delta_histogram_enabled()}catch{return!1}}}}var Fe=1;function j(t){if(typeof t!="string")return{r:255,g:255,b:255,a:153};if(t.startsWith("#")){let n=t.slice(1);if(n.length===8)return{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16),a:parseInt(n.slice(6,8),16)};let s=parseInt(n.slice(0,2),16),p=parseInt(n.slice(2,4),16),r=parseInt(n.slice(4,6),16);return{r:s,g:p,b:r,a:255}}let o=t.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\)/);return o?{r:+o[1],g:+o[2],b:+o[3],a:o[4]!==void 0?Math.round(+o[4]*255):255}:{r:255,g:255,b:255,a:153}}function jt(t,o,n){let s=new Map,p=null,r=0,i=NaN;function e(){let u;try{u=t.kline_count()}catch{return p}if(u===0)return null;let _=t.kline_closes(),c=_?.[u-1]??NaN;if(p&&!(u!==r||c!==i))return p;try{let d=t.kline_timestamps(),w=t.kline_opens(),m=t.kline_highs(),M=t.kline_lows(),I=t.kline_volumes();if(!d||!_)return p;p={timestamps:Array.from(d),open:Array.from(w),high:Array.from(m),low:Array.from(M),close:Array.from(_),volume:Array.from(I),length:u},r=u,i=c;for(let C of s.values())C._needsCompute=!0}catch{}return p}function a(){return{seriesLine(u,_="#ffffff99",c=1.5){let h=j(_);t.custom_series_line(new Float64Array(u),h.r,h.g,h.b,h.a,c)},seriesDashedLine(u,_="#ffffff66",c=1,h=4,d=4){let w=j(_);t.custom_series_dashed_line(new Float64Array(u),w.r,w.g,w.b,w.a,c,h,d)},band(u,_,c="rgba(100,149,237,0.08)"){let h=j(c);t.custom_band(new Float64Array(u),new Float64Array(_),h.r,h.g,h.b,h.a)},hline(u,_="#ffffff66",c=1){let h=j(_);t.custom_hline(u,h.r,h.g,h.b,h.a,c)},dashedHline(u,_="#ffffff66",c=1,h=6,d=4){let w=j(_);t.custom_dashed_hline(u,w.r,w.g,w.b,w.a,c,h,d)},marker(u,_,c="#e8a04a",h=3){let d=j(c);t.custom_marker(u,_,d.r,d.g,d.b,d.a,h)},markerUp(u,_,c="#26a69a",h=5){let d=j(c);t.custom_marker_up(u,_,d.r,d.g,d.b,d.a,h)},markerDown(u,_,c="#ef5350",h=5){let d=j(c);t.custom_marker_down(u,_,d.r,d.g,d.b,d.a,h)},text(u,_,c,h="#ffffffaa",d=10,w="center"){let m=j(h),M=w==="center"?1:w==="right"?2:0;t.custom_text(u,_,c,m.r,m.g,m.b,m.a,d,M)},priceLabel(u,_,c="#ffffffaa",h=10){let d=j(c);t.custom_price_label(u,_,d.r,d.g,d.b,d.a,h)},linePx(u,_,c,h,d,w=1){let m=j(d);t.custom_line_px(u,_,c,h,m.r,m.g,m.b,m.a,w)},fillRectPx(u,_,c,h,d){let w=j(d);t.custom_fill_rect_px(u,_,c,h,w.r,w.g,w.b,w.a)},strokeRectPx(u,_,c,h,d,w=1){let m=j(d);t.custom_stroke_rect_px(u,_,c,h,m.r,m.g,m.b,m.a,w)},textPx(u,_,c,h,d=10,w="left"){let m=j(h),M=w==="center"?1:w==="right"?2:0;t.custom_text_px(u,_,c,m.r,m.g,m.b,m.a,d,M)},worldToScreenX:u=>t.world_to_screen_x(u),worldToScreenY:u=>t.world_to_screen_y(u),screenToWorldX:u=>t.screen_to_world_x(u),screenToWorldY:u=>t.screen_to_world_y(u),chartArea:()=>({x:t.chart_area_x(),y:t.chart_area_y(),w:t.chart_area_w(),h:t.chart_area_h()})}}function f(u){if(!u.compute)return;let _=e();if(_)try{u._computed=u.compute(_,u.params)||{}}catch(c){console.warn(`[CustomIndicator "${u.name}"] compute error:`,c),u._computed={}}}function l(u){if(s.size===0)return;let _=e();if(!_)return;t.custom_begin();let c=a();for(let d of s.values())if(d.enabled){d._needsCompute&&(f(d),d._needsCompute=!1);try{d.render.call(d,c,d._computed||{},_)}catch(w){console.warn(`[CustomIndicator "${d.name}"] render error:`,w)}}if(t.custom_end(),t.custom_command_count()>0){let d=t.get_custom_buffer_ptr(),w=t.get_custom_buffer_len();n(u,o,d,w)}}function g(){p=null,r=0,i=NaN;for(let u of s.values())u._needsCompute=!0}return{add(u){let _=Fe++,c={id:_,name:u.name||`Custom ${_}`,params:{...u.params},compute:u.compute||null,render:u.render,enabled:!0,_computed:{},_needsCompute:!0};return s.set(_,c),_},remove(u){s.delete(u)},updateParams(u,_){let c=s.get(u);c&&(Object.assign(c.params,_),c._needsCompute=!0)},setEnabled(u,_){let c=s.get(u);c&&(c.enabled=_)},list(){return[...s.values()].map(u=>({id:u.id,name:u.name,params:{...u.params},enabled:u.enabled}))},invalidateCompute:g,renderAll:l}}var ae={trial:{candlestick:!0,volume:!0,rsi:!0,drawingBasic:!0,drawingFull:!0,heatmap:!0,footprint:!0,liqHeatmap:!0,oi:!0,fundingRate:!0,cvd:!0,largeTrades:!0,vrvp:!0,tpo:!0,smartRanges:!0,emaStructure:!0,customIndicators:!0,forexSignals:!0,vpin:!0,stopIceberg:!0},standard:{candlestick:!0,volume:!0,rsi:!0,drawingBasic:!0,drawingFull:!1,heatmap:!1,footprint:!1,liqHeatmap:!1,oi:!1,fundingRate:!1,cvd:!1,largeTrades:!1,vrvp:!1,tpo:!1,smartRanges:!1,emaStructure:!1,customIndicators:!1,forexSignals:!1,vpin:!1,stopIceberg:!1},professional:{candlestick:!0,volume:!0,rsi:!0,drawingBasic:!0,drawingFull:!0,heatmap:!0,footprint:!0,liqHeatmap:!0,oi:!0,fundingRate:!0,cvd:!0,largeTrades:!0,vrvp:!1,tpo:!1,smartRanges:!1,emaStructure:!1,customIndicators:!1,forexSignals:!1,vpin:!1,stopIceberg:!1},enterprise:{candlestick:!0,volume:!0,rsi:!0,drawingBasic:!0,drawingFull:!0,heatmap:!0,footprint:!0,liqHeatmap:!0,oi:!0,fundingRate:!0,cvd:!0,largeTrades:!0,vrvp:!0,tpo:!0,smartRanges:!0,emaStructure:!0,customIndicators:!0,forexSignals:!0,vpin:!0,stopIceberg:!0}},Ze={rsi:"RSI",drawingBasic:"Basic Drawing Tools",heatmap:"Orderbook Heatmap",footprint:"Footprint Chart",liqHeatmap:"Liquidation Heatmap",oi:"Open Interest",fundingRate:"Funding Rate",cvd:"CVD",largeTrades:"Large Trades",vrvp:"VRVP",tpo:"TPO / Market Profile",smartRanges:"Smart Ranges",emaStructure:"EMA Structure",drawingFull:"All Drawing Tools",customIndicators:"Custom Indicators",forexSignals:"Forex Signals",vpin:"VPIN",stopIceberg:"Stops & Icebergs"},ze={rsi:"Standard",drawingBasic:"Standard",heatmap:"Professional",footprint:"Professional",liqHeatmap:"Professional",oi:"Professional",fundingRate:"Professional",cvd:"Professional",largeTrades:"Professional",drawingFull:"Professional",vrvp:"Enterprise",tpo:"Enterprise",smartRanges:"Enterprise",emaStructure:"Enterprise",customIndicators:"Enterprise",forexSignals:"Enterprise",vpin:"Enterprise",stopIceberg:"Enterprise"};function nt(t){return ae[t]||ae.trial}function Ft(t){let o=nt(t),n=new Set;return function(p){if(o[p])return!0;if(!n.has(p)){n.add(p);let r=Ze[p]||p,i=ze[p]||"a higher";console.warn(`[MRD Chart Engine] "${r}" requires ${i} plan. Current plan: ${t}. Upgrade at https://mrd-chart.dev/pricing`)}return!1}}var De=14,le="trial",ct="free";var zt=[95,95,109,114].map(t=>String.fromCharCode(t)).join(""),Xe=1297237059;function de(t){let o=`${t}:${Xe}:${(t^2043453)>>>0}`,n=2166136261;for(let s=0;s<o.length;s++)n^=o.charCodeAt(s),n=Math.imul(n,16777619);return(n>>>0).toString(36)}function ht(t){return`${t}.${de(t)}`}function pt(t){if(!t||typeof t!="string")return null;let o=t.lastIndexOf(".");if(o<1)return null;let n=parseInt(t.slice(0,o),10);return!n||n<1e9||n>2e9||t.slice(o+1)!==de(n)?null:n}var ce=zt+"e7x",he=zt+"p3q",pe="mrd_engine_session_id",we="mrd_ce_db",it="meta",ge="trial_ts",me=zt+"ck";function Dt(){try{return pt(localStorage.getItem(ce))}catch{return null}}function Xt(t){try{localStorage.setItem(ce,ht(t))}catch{}}function Ot(){try{return pt(localStorage.getItem(he))}catch{return null}}function Ht(t){try{localStorage.setItem(he,ht(t))}catch{}}function Vt(){try{return pt(sessionStorage.getItem(pe))}catch{return null}}function Wt(t){try{sessionStorage.setItem(pe,ht(t))}catch{}}function Bt(){try{let t=document.cookie.match(new RegExp(`(?:^|;\\s*)${me}=([^;]+)`));return t?pt(decodeURIComponent(t[1])):null}catch{return null}}function Gt(t){try{let o=encodeURIComponent(ht(t));document.cookie=`${me}=${o};path=/;max-age=${86400*400};SameSite=Lax`}catch{}}var at=null,ue=!1;function Oe(){if(!(ue||typeof indexedDB>"u")){ue=!0;try{let t=indexedDB.open(we,1);t.onupgradeneeded=()=>{let o=t.result;o.objectStoreNames.contains(it)||o.createObjectStore(it)},t.onsuccess=()=>{let s=t.result.transaction(it,"readonly").objectStore(it).get(ge);s.onsuccess=()=>{let p=pt(s.result);p&&(!at||p<at)&&(at=p,He(p))}}}catch{}}}function Me(t){at=t;try{let o=indexedDB.open(we,1);o.onsuccess=()=>{o.result.transaction(it,"readwrite").objectStore(it).put(ht(t),ge)}}catch{}}function He(t){let o=Math.floor(Date.now()/1e3),n=Se([Dt(),Ot(),Vt(),Bt(),t],o);n&&n!==t||n&&(Xt(n),Ht(n),Wt(n),Gt(n))}function Se(t,o){let n=null;for(let s of t)s&&(s>o+60||s<17e8||(!n||s<n)&&(n=s));return n}function Ve(){let t=Math.floor(Date.now()/1e3),o=[Dt(),Ot(),Vt(),Bt(),at];return Se(o,t)}function We(t){Xt(t),Ht(t),Wt(t),Gt(t),Me(t)}function Be(t){Dt()||Xt(t),Ot()||Ht(t),Vt()||Wt(t),Bt()||Gt(t),at||Me(t)}Oe();function Ct(t){if(!t||t==="trial")return Ge();try{let o=JSON.parse(atob(t)),{p:n,d:s,e:p,s:r}=o;if(!n||!r)return{valid:!1,error:"Invalid license key format"};let i={...o};if(delete i.s,r!==Ie(i))return{valid:!1,error:"Invalid license key signature"};if(p>0&&Date.now()/1e3>p)return{valid:!0,plan:ct,watermark:!0,trialExpired:!0,originalPlan:n,error:`License expired on ${new Date(p*1e3).toLocaleDateString()}`,features:nt(ct)};let e=o.pl||"web";if((e==="web"||e==="any")&&s&&s!=="*"&&typeof window<"u"){let a=window.location.hostname;if(a&&a!=="localhost"&&a!=="127.0.0.1"&&a!=="0.0.0.0"&&a!==""&&!s.split(",").map(g=>g.trim()).some(g=>qe(g,a)))return{valid:!1,error:`License not valid for domain: ${a}`}}if(e==="mobile"&&o.a&&typeof window<"u"){let a=window.__mrd_app_id;if(a&&a!==o.a)return{valid:!1,error:`License not valid for app: ${a}`}}return{valid:!0,plan:n,domain:s,platform:e,appId:o.a||null,expiry:p,watermark:!1,features:nt(n)}}catch{return{valid:!1,error:"Invalid license key"}}}function Ie(t){let o="mrd-ce-hmac-2024-x9k2m",n=JSON.stringify(t),s=o+":"+n,p=2166136261,r=1818371886,i=3735928559;for(let e=0;e<s.length;e++){let a=s.charCodeAt(e);p=Math.imul(p^a,16777619)>>>0,r=Math.imul(r^a,1540483477)>>>0,i=Math.imul(i^a,461845907)>>>0}return(p.toString(36)+r.toString(36)+i.toString(36)).slice(0,24)}function Ge(){let t=Ve();t?Be(t):(t=Math.floor(Date.now()/1e3),We(t));let o=t+De*86400,n=Date.now()/1e3,s=Math.max(0,Math.ceil((o-n)/86400));return n>o?{valid:!0,plan:ct,watermark:!0,trialExpired:!0,daysLeft:0,features:nt(ct)}:{valid:!0,plan:le,watermark:!1,daysLeft:s,trialEnd:o,features:nt(le)}}function qe(t,o){if(t==="*"||t===o)return!0;if(t.startsWith("*.")){let n=t.slice(1);return o.endsWith(n)||o===t.slice(2)}return!1}var Ke="MRD-Indicators",fe="mrd-indicators.com",Ue="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgPGRlZnM+CiAgICA8c3R5bGU+CiAgICAgIC5jbHMtMSB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtNCk7CiAgICAgIH0KCiAgICAgIC5jbHMtMiB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtMik7CiAgICAgIH0KCiAgICAgIC5jbHMtMiwgLmNscy0zLCAuY2xzLTQsIC5jbHMtNSwgLmNscy02IHsKICAgICAgICBtaXgtYmxlbmQtbW9kZTogbXVsdGlwbHk7CiAgICAgIH0KCiAgICAgIC5jbHMtMyB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtMyk7CiAgICAgIH0KCiAgICAgIC5jbHMtNCB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtNik7CiAgICAgIH0KCiAgICAgIC5jbHMtNSB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtNSk7CiAgICAgIH0KCiAgICAgIC5jbHMtNiB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtNyk7CiAgICAgIH0KCiAgICAgIC5jbHMtNyB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQpOwogICAgICB9CgogICAgICAuY2xzLTggewogICAgICAgIGlzb2xhdGlvbjogaXNvbGF0ZTsKICAgICAgfQogICAgPC9zdHlsZT4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0ibGluZWFyLWdyYWRpZW50IiB4MT0iOS4xMiIgeTE9IjE1Ljg4IiB4Mj0iMTkuNjMiIHkyPSI1LjM3IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2IzNTA5ZSIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNmNWE0YzciLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9ImxpbmVhci1ncmFkaWVudC0yIiB4MT0iOS4wOCIgeTE9IjYuODEiIHgyPSI5LjA4IiB5Mj0iMTQuNzMiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjMjM0ZmIzIi8+CiAgICAgIDxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI2ZmZiIvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0ibGluZWFyLWdyYWRpZW50LTMiIHgxPSIxNy42NyIgeTE9IjYuMTEiIHgyPSI4LjQxIiB5Mj0iNi4xMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgogICAgICA8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiM1YTJhOGIiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmZmIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQtNCIgeDE9IjIwLjAzIiB5MT0iMTUuODkiIHgyPSIxMC45OCIgeTI9IjE1Ljg5IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2Y2YWFjYiIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiM3NzJhOGQiLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9ImxpbmVhci1ncmFkaWVudC01IiB4MT0iMTkuMDMiIHkxPSIxNi44MiIgeDI9IjE0Ljc5IiB5Mj0iMTIuNTgiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjZmZmIi8+CiAgICAgIDxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI2VkMzQ4ZCIvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0ibGluZWFyLWdyYWRpZW50LTYiIHgxPSIxNS4yNyIgeTE9IjE1LjA2IiB4Mj0iMTUuMjciIHkyPSIxOS4zNyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgogICAgICA8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNmZmYiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZWU0YzliIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQtNyIgeDE9IjUuNTEiIHkxPSItMTI4LjAyIiB4Mj0iLTMuNyIgeTI9Ii0xMjguMDIiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEwOS4xMiAxMC4wMSkgcm90YXRlKDg5LjYpIiB4bGluazpocmVmPSIjbGluZWFyLWdyYWRpZW50LTMiLz4KICA8L2RlZnM+CiAgPGcgY2xhc3M9ImNscy04IiBpZD0iTG9nbyI+CiAgICA8ZyBpZD0iT0JKRUNUUyIgPgogICAgICA8ZyBpZCA9IkxvZ28iPiAKICAgICAgICA8cGF0aCBjbGFzcz0iY2xzLTciIGQ9Ik00LjIzLDExYzAsNS4zNiw0LjM3LDkuNzEsOS43Niw5LjcxczkuNzYtNC4zNSw5Ljc2LTkuNzFTMTkuMzksMS4yOSwxNCwxLjI5LDQuMjMsNS42NCw0LjIzLDExWk0xMC4yNiwxMC4wN2MwLTEuNTQsMS4yNS0yLjc4LDIuOC0yLjc4aDEuODdjMS41NSwwLDIuOCwxLjI1LDIuOCwyLjc4djEuODZjMCwxLjU0LTEuMjUsMi43OC0yLjgsMi43OGgtMS4yMmMtLjQ1LDAtLjg4LjE1LTEuMjIuNDRsLTIuMjMsMS44NHYtNi45MloiLz4KICAgICAgICA8cGF0aCBjbGFzcz0iY2xzLTIiIGQ9Ik0xMC4yNiwxNi45OXYtNi45MnMwLS4wMiwwLS4wM2MuMDItMS41MiwxLjI2LTIuNzUsMi44LTIuNzVoLTUuMDljLTIuMDUsMC0zLjczLDEuNjQtMy43NCwzLjY4LDAsLjAxLDAsLjAzLDAsLjA0LDAsLjA4LDAsLjE2LDAsLjI0LDAsLjA0LDAsLjA4LDAsLjEyLDAsLjA0LDAsLjA4LDAsLjEyLDAsLjA2LDAsLjExLjAxLjE3LDAsLjAyLDAsLjA1LDAsLjA3LDAsLjA2LjAxLjEzLjAyLjE5LDAsLjAxLDAsLjAzLDAsLjA0LDAsLjA3LjAxLjE0LjAyLjIxLDAsMCwwLC4wMSwwLC4wMiwwLC4wNy4wMi4xNS4wMy4yMiwwLDAsMCwwLDAsMCwuNjgsNC42OCw0LjcxLDguMjcsOS42LDguMy0yLjA0LS4wMi0zLjY3LTEuNjktMy42Ny0zLjcyWiIvPgogICAgICAgIDxwYXRoIGNsYXNzPSJjbHMtMyIgZD0iTTE0LjA0LDEuMjlzLS4wMywwLS4wNCwwYy0uMDgsMC0uMTYsMC0uMjQsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDYsMC0uMTEsMC0uMTcsMC0uMDIsMC0uMDUsMC0uMDcsMC0uMDYsMC0uMTMuMDEtLjE5LjAyLS4wMSwwLS4wMywwLS4wNCwwLS4wNywwLS4xNC4wMS0uMjEuMDIsMCwwLS4wMSwwLS4wMiwwLS4wNywwLS4xNS4wMi0uMjIuMDMsMCwwLDAsMCwwLDAtNC43LjY4LTguMzIsNC42OS04LjM1LDkuNTQuMDItMi4wMiwxLjctMy42NSwzLjc0LTMuNjVoNi45NnMuMDIsMCwuMDMsMGMxLjUzLjAyLDIuNzcsMS4yNiwyLjc3LDIuNzh2LTUuMDZjMC0yLjA0LTEuNjUtMy43MS0zLjctMy43MloiLz4KICAgICAgICA8cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0xNC45MywxNC43MWg1LjA5YzIuMDQsMCwzLjcyLTEuNjMsMy43NC0zLjY1LS4wMyw0Ljg2LTMuNjUsOC44Ny04LjM1LDkuNTQsMCwwLDAsMCwwLDAtLjA3LjAxLS4xNS4wMi0uMjIuMDMsMCwwLS4wMSwwLS4wMiwwLS4wNywwLS4xNC4wMi0uMjEuMDItLjAxLDAtLjAzLDAtLjA0LDAtLjA2LDAtLjEzLjAxLS4xOS4wMi0uMDIsMC0uMDUsMC0uMDcsMC0uMDYsMC0uMTEsMC0uMTcsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDgsMC0uMTYsMC0uMjQsMC0uMDEsMC0uMDMsMC0uMDQsMC0yLjA1LDAtMy43LTEuNjgtMy43LTMuNzJsMi4yMy0xLjg0Yy4zNC0uMjguNzgtLjQ0LDEuMjItLjQ0aDEuMjJaIi8+CiAgICAgICAgPHBhdGggY2xhc3M9ImNscy01IiBkPSJNMTQuOTMsMTQuNzFoNS4wOWMyLjA0LDAsMy43Mi0xLjYzLDMuNzQtMy42NS0uMDMsNC44Ni0zLjY1LDguODctOC4zNSw5LjU0LDAsMCwwLDAsMCwwLS4wNy4wMS0uMTUuMDItLjIyLjAzLDAsMC0uMDEsMC0uMDIsMC0uMDcsMC0uMTQuMDItLjIxLjAyLS4wMSwwLS4wMywwLS4wNCwwLS4wNiwwLS4xMy4wMS0uMTkuMDItLjAyLDAtLjA1LDAtLjA3LDAtLjA2LDAtLjExLDAtLjE3LDAtLjA0LDAtLjA4LDAtLjEyLDAtLjA0LDAtLjA4LDAtLjEyLDAtLjA4LDAtLjE2LDAtLjI0LDAtLjAxLDAtLjAzLDAtLjA0LDAtMi4wNSwwLTMuNy0xLjY4LTMuNy0zLjcybDIuMjMtMS44NGMuMzQtLjI4Ljc4LS40NCwxLjIyLS40NGgxLjIyWiIvPgogICAgICAgIDxwYXRoIGNsYXNzPSJjbHMtNCIgZD0iTTIwLjI4LDE0LjcxYy0uMDgsMC0uMTcsMC0uMjUsMGgtNi4zMWMtLjQ1LDAtLjg4LjE1LTEuMjIuNDRsLTIuMjMsMS44NGMwLC4wOCwwLC4xNywwLC4yNSwxLjA5LjY1LDIuMzcsMS4wMiwzLjczLDEuMDIsMi42NywwLDUuMDEtMS40Myw2LjI4LTMuNTVaIi8+CiAgICAgICAgPHBhdGggY2xhc3M9ImNscy02IiBkPSJNMjMuNzcsMTAuOTdzMC0uMDMsMC0uMDRjMC0uMDgsMC0uMTYsMC0uMjQsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDYsMC0uMTEtLjAxLS4xNywwLS4wMiwwLS4wNSwwLS4wNywwLS4wNi0uMDEtLjEzLS4wMi0uMTksMC0uMDEsMC0uMDMsMC0uMDQsMC0uMDctLjAyLS4xNC0uMDItLjIxLDAsMCwwLS4wMSwwLS4wMiwwLS4wNy0uMDItLjE1LS4wMy0uMjIsMCwwLDAsMCwwLDAtLjcxLTQuNjctNC43Ny04LjI0LTkuNjYtOC4yNCwyLjA0LDAsMy42OCwxLjY2LDMuNywzLjY5bC4wNCw1LjA2djEuODZzLjAxLjAyLjAxLjAzYzAsMS41Mi0xLjI1LDIuNzYtMi43OCwyLjc3bDUuMDktLjA0YzIuMDUtLjAxLDMuNzItMS42NiwzLjcxLTMuN1oiLz4KICAgICAgPC9nPgogICAgPC9nPgogIDwvZz4KPC9zdmc+",Zt=null,_e=!1;function Le(){if(Zt||_e)return Zt;_e=!0;let t=new Image;return t.onload=()=>{Zt=t},t.src=Ue,null}function Qe(){return Math.floor(Date.now()/864e5)}function $e(t){let o=(t^2654435769)>>>0;return function(){o=o+1831565813>>>0;let n=Math.imul(o^o>>>15,1|o);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}function xe(t,o,n,s,p,r){let i=Le();t.save(),t.setTransform(1,0,0,1,0,0),t.font="bold 10px Inter, system-ui, sans-serif";let e=t.measureText(s);t.font="8px Inter, system-ui, sans-serif";let a=t.measureText(p),f=i?18:0,l=i?14:0,g=7,u=5,_=i?5:0,h=f+_+Math.max(e.width,a.width)+g*2,d=Math.max(l,20)+u*2,w=Math.round(o-h/2),m=Math.round(n-d/2);t.globalAlpha=.45,t.fillStyle=r?"rgba(255,255,255,0.8)":"rgba(18,18,28,0.8)",t.shadowColor=r?"rgba(0,0,0,0.06)":"rgba(0,0,0,0.25)",t.shadowBlur=8,t.shadowOffsetY=1,t.beginPath(),t.roundRect(w,m,h,d,6),t.fill(),t.shadowColor="transparent",t.strokeStyle=r?"rgba(0,0,0,0.04)":"rgba(255,255,255,0.04)",t.lineWidth=.5,t.stroke();let M=w+g,I=m+d/2;i&&(t.globalAlpha=.5,t.drawImage(i,M,I-l/2,f,l),M+=f+_),t.globalAlpha=.5,t.font="bold 10px Inter, system-ui, sans-serif",t.fillStyle=r?"#1a1a2e":"#ededf5",t.textAlign="left",t.textBaseline="alphabetic",t.fillText(s,M,I-1),t.font="8px Inter, system-ui, sans-serif",t.fillStyle=r?"#777790":"#8080a0",t.textBaseline="top",t.fillText(p,M,I+2),t.restore()}function Ce(t,o,n,s){Le();let p=o.width,r=o.height;if(p<100||r<80)return;t.save(),t.setTransform(1,0,0,1,0,0);let i=$e(Qe()),e=100,a=Math.max(p-e*2,60),f=Math.max(r-e*2,40),l=e+i()*a,g=e+i()*f,u=n.trialExpired||n.plan===ct,_=Ke,c=u?`Free \u2014 ${fe}/pricing`:`Trial: ${n.daysLeft||0}d left \u2014 ${fe}`;xe(t,l,g,_,c,s),t.restore()}function Je({plan:t,domain:o="*",expiryDays:n=365,name:s,email:p}){let r=n>0?Math.floor(Date.now()/1e3)+n*86400:0,i={p:t,d:o,e:r,...s?{n:s}:{},...p?{m:p}:{},i:Date.now()};return i.s=Ie(i),btoa(JSON.stringify(i))}var At=null,vt=null,wt=null;async function Ae(){return At||wt||(wt=(async()=>{let t=await import("./chart_engine.js");return await t.default(),vt=t.wasm_memory(),At=t,t})(),wt)}function ke(){!At&&!wt&&Ae().catch(()=>{})}async function tr(t,o={}){o.appId&&typeof window<"u"&&(window.__mrd_app_id=o.appId);let n=o.licenseKey||o.key||null,s=Ct(n);if(!s.valid)if(s.expired)console.warn(`[MRD Chart Engine] ${s.error}. Get a license at https://mrd-chart.dev/pricing`);else throw new Error(`[MRD Chart Engine] ${s.error}`);s.plan==="trial"&&console.info(`[MRD Chart Engine] Trial mode \u2014 ${s.daysLeft} days remaining. Purchase: https://mrd-chart.dev/pricing`);let p=await Ae(),r=window.devicePixelRatio||1,i=t.getBoundingClientRect();(i.width<1||i.height<1)&&(await new Promise(S=>{let L=new ResizeObserver(A=>{for(let b of A)if(b.contentRect.width>0&&b.contentRect.height>0){L.disconnect(),S();return}});L.observe(t.parentElement||t),setTimeout(()=>{L.disconnect(),S()},2e3)}),i=t.getBoundingClientRect());let e=Math.max(i.width,100),a=Math.max(i.height,100);t.width=e*r,t.height=a*r;let f=t.getContext("2d");f.scale(r,r);let l=new p.ChartEngine(e,a);try{let S=s.expired?2:s.watermark?1:0,L=s.daysLeft||0,A=1297237059;A=Math.imul(A,31)+S>>>0,A=Math.imul(A,31)+L>>>0,A=(A^A>>>16)>>>0,A=Math.imul(A,73244475)>>>0,A=(A^A>>>16)>>>0,l.set_license_state(S,L,A)}catch(S){console.warn("[MRD] set_license_state failed:",S.message)}let g=!0,u=null,_=!1,c=!1,h=!1,d=null,w=null,m=0,M=!1,I=!1,y=("ontouchstart"in window||navigator.maxTouchPoints>0)&&window.innerWidth<=1399?33:0;function $(){if(!(!_||c||u)){if(y>0){let S=performance.now()-m;if(S<y){w||(w=setTimeout(()=>{w=null,$()},y-S));return}}u=requestAnimationFrame(Te)}}let T=()=>{g=!0,$()},tt=()=>h,et=null,gt=null,bt=null,E=null,O=null,G=null,W=null,B=null,lt=0,rt=null,qt=null,Tt=0,Et=0,ot=-1,mt=!1,Mt=!1,ve=Yt(t,l,{onDirty:T,onCrosshairMove:(S,L,A)=>{Tt=S,Et=L,ot=A,mt=!0,Mt=!0},onCrosshairHide:()=>{Mt&&(Mt=!1,mt=!0,ot=-1)},drawingApi:S=>{et=S},onDrawingComplete:()=>{gt?.()},onDrawingCancel:()=>{bt?.()},onDrawingSelected:(S,L,A)=>{E?.(S,L,A)},onMarkerSelected:S=>{O?.(S)},onDrawingDblClick:(S,L,A,b,Nt)=>{G?.(S,L,A,b,Nt)},onVrvpHover:(S,L)=>{W?.(S,L)},onLiqAnnotationPin:(S,L)=>{qt?.(S,L)}});function be(){if(!(!mt||I)){if(mt=!1,!Mt){d&&d(null,0,0),B&&B("");return}if(d)if(ot===0||ot===1)try{let S=l.get_tooltip_data();d(S,Tt,Et)}catch{}else d(null,0,0);if(B){let S=performance.now();if(ot===0||ot===1){if(S-lt>=80){lt=S;try{B(l.lt_hit_test(Tt,Et))}catch{}}}else B("")}}}function Te(){if(u=null,!(!_||c||I)){M=!0;try{let S=!1;try{S=g||l.is_dirty()}catch{I=!0;return}if(S){g=!1,m=performance.now();let L=!1;try{if(l.render()>0){let b=l.get_command_buffer_ptr(),Nt=l.get_command_buffer_len();f.save(),f.setTransform(1,0,0,1,0,0),f.clearRect(0,0,t.width,t.height),f.restore(),ft(f,vt,b,Nt),L=!0}try{J.renderAll(f)}catch{}}catch(A){if(L||(g=!0),A instanceof WebAssembly.RuntimeError){I=!0,console.error("[MRD] Engine crashed:",A.message);return}}be();try{rt?.()}catch{}if(s.watermark)try{let A=l.get_theme()===1;Ce(f,t,s,A)}catch{}try{(g||l.is_dirty())&&$()}catch{}}}finally{M=!1}}}let ut=Ft(s.plan),Ee=se(l,T,tt,()=>ut),Ne=ne(l,T,tt,()=>ut),ye=ie(l,T,tt,()=>ut),J=jt(l,vt,ft);return{engine:l,start(){_=!0,c=!1,g=!0,$()},stop(){_=!1,u&&(cancelAnimationFrame(u),u=null),w&&(clearTimeout(w),w=null)},resize(S){if(I||M)return;if(i=t.getBoundingClientRect(),i.width<1||i.height<1){(S||0)<8&&setTimeout(()=>this.resize((S||0)+1),250);return}r=window.devicePixelRatio||1;let L=i.width*r,A=i.height*r;t.width=L,t.height=A,f.setTransform(1,0,0,1,0,0),f.scale(r,r);try{l.resize(i.width,i.height)}catch(b){if(b instanceof WebAssembly.RuntimeError){I=!0;return}throw b}T()},renderSync(){if(I)return 0;try{let S=l.render();if(S>0){let L=l.get_command_buffer_ptr(),A=l.get_command_buffer_len();f.save(),f.setTransform(1,0,0,1,0,0),f.clearRect(0,0,t.width,t.height),f.restore(),ft(f,vt,L,A)}return S}catch(S){return S instanceof WebAssembly.RuntimeError&&(I=!0),0}},setHoverPrice(S){l.set_hover_price(S),T()},clearHoverPrice(){l.clear_hover_price(),T()},hitZone(S,L){return l.hit_zone(S,L)},startDrawing(S,L){et?.setMode(S,L)},cancelDrawing(){et?.setMode(null)},onDrawingComplete(S){gt=S},onDrawingCancel(S){bt=S},onDrawingSelected(S){E=S},onMarkerSelected(S){O=S},onDrawingDblClick(S){G=S},setReplayState(S,L,A){l.set_replay_state(S,L,A),T()},setReplayHovered(S){l.set_replay_hovered(S)},setReplayPreview(S){l.set_replay_preview(S),T()},setPrecision(S){l.set_price_precision(S),T()},setCandleInterval(S){l.set_candle_interval(S)},setTheme(S){let L=S==="light"?1:0;typeof l.set_theme=="function"?(l.set_theme(L),T()):console.warn("[ChartEngine] set_theme not available \u2014 reload page to load updated WASM")},getTheme(){return l.get_theme()===1?"light":"dark"},onTooltip(S){d=S},onVrvpHover(S){W=S},onLtHover(S){B=S},onPostRender(S){rt=S},onLiqAnnotationPin(S){qt=S},pause(){c||(c=!0,u&&(cancelAnimationFrame(u),u=null),w&&(clearTimeout(w),w=null))},resume(){c&&(c=!1,_&&(g=!0,$()))},get isPaused(){return c},destroy(){h=!0,_=!1,c=!1,u&&(cancelAnimationFrame(u),u=null),w&&(clearTimeout(w),w=null),ve();try{l.free()}catch{}},addIndicator(S){if(!ut("customIndicators"))return null;let L=J.add(S);return T(),L},removeIndicator(S){J.remove(S),T()},updateIndicatorParams(S,L){J.updateParams(S,L),T()},setIndicatorEnabled(S,L){J.setEnabled(S,L),T()},listIndicators(){return J.list()},invalidateCustomIndicators(){J.invalidateCompute(),T()},get license(){return{plan:s.plan,valid:s.valid,expired:!!s.expired,watermark:!!s.watermark,daysLeft:s.daysLeft,features:s.features||{}}},setLicenseKey(S){s=Ct(S),!s.valid&&!s.expired&&console.error(`[MRD Chart Engine] ${s.error}`),ut=Ft(s.plan);try{let L=s.expired?2:s.watermark?1:0,A=s.daysLeft||0,b=1297237059;b=Math.imul(b,31)+L>>>0,b=Math.imul(b,31)+A>>>0,b=(b^b>>>16)>>>0,b=Math.imul(b,73244475)>>>0,b=(b^b>>>16)>>>0,l.set_license_state(L,A,b)}catch{}return T(),s.valid},...ye,...Ee,...Ne}}function er(t,o){let{t:n,o:s,h:p,l:r,c:i,v:e}=t,a=i.length;if(a===0||o<=0)return{t:[],o:[],h:[],l:[],c:[],v:[]};let f=[],l=[],g=[],u=[],_=[],c=[],h=Math.round(i[0]/o)*o,d=0;for(let w=0;w<a;w++){d+=e[w];let M=i[w]-h;for(;M>=o;){let I=h,C=h+o;f.push(n[w]),l.push(I),g.push(C),u.push(I),_.push(C),c.push(d),d=0,h=C}for(;-M>=o;){let I=h,C=h-o;f.push(n[w]),l.push(I),g.push(I),u.push(C),_.push(C),c.push(d),d=0,h=C}}return{t:f,o:l,h:g,l:u,c:_,v:c}}function rr(t,o){let{t:n,o:s,h:p,l:r,c:i,v:e}=t,a=i.length;if(a===0||o<=0)return{t:[],o:[],h:[],l:[],c:[],v:[]};let f=[],l=[],g=[],u=[],_=[],c=[],h=s[0],d=p[0],w=r[0],m=0,M=n[0];for(let I=0;I<a;I++)for(d=Math.max(d,p[I]),w=Math.min(w,r[I]),m+=e[I];d-w>=o;){let C=i[I]>=h,y=C?w+o:d-o;if(f.push(M),l.push(h),g.push(d),u.push(w),_.push(y),c.push(m),h=y,d=C?Math.max(p[I],y):y,w=C?y:Math.min(r[I],y),m=0,M=n[I],d-w<o)break}return(m>0||f.length===0)&&(f.push(M),l.push(h),g.push(d),u.push(w),_.push(i[a-1]),c.push(m)),{t:f,o:l,h:g,l:u,c:_,v:c}}function or(t,o){let{t:n,o:s,h:p,l:r,c:i,v:e}=t,a=i.length;if(a===0||o<=0)return{t:[],o:[],h:[],l:[],c:[],v:[]};let f=[],l=[],g=[],u=[],_=[],c=[],h=Math.max(1,Math.round(o));for(let d=0;d<a;d+=h){let w=Math.min(d+h,a),m=-1/0,M=1/0,I=0;for(let C=d;C<w;C++)p[C]>m&&(m=p[C]),r[C]<M&&(M=r[C]),I+=e[C];f.push(n[d]),l.push(s[d]),g.push(m),u.push(M),_.push(i[w-1]),c.push(I)}return{t:f,o:l,h:g,l:u,c:_,v:c}}function sr(t,o){let n=t>1e4?50:t>1e3?10:t>100?1:t>1?.1:.001,s=n*2,p=o<=60?10:o<=300?5:3;return{brickSize:n,rangeSize:s,tickCount:p}}var nr={minRefills:3,hiddenRatio:2,refillWindowMs:1e4,maxTrackedLevels:200,maxEvents:500,decayMs:3e5};function ir(t={}){let o={...nr,...t},n=new Map,s=new Map,p=[],r=0;function i(u){return Math.round(u*1e8)/1e8}function e(u,_,c,h){for(let[d,w]of u){let m=i(d),M=_.get(m);if(!M){_.set(m,{lastVol:w,refills:0,totalConsumed:0,lastRefillTs:h,peakVisible:w});continue}if(w<M.lastVol*.3&&M.lastVol>0){let I=M.lastVol-w;M.totalConsumed+=I,M.lastVol=w;continue}if(w>M.lastVol*1.5&&M.totalConsumed>0)if(h-M.lastRefillTs<o.refillWindowMs){if(M.refills++,M.lastRefillTs=h,M.peakVisible=Math.max(M.peakVisible,w),M.refills>=o.minRefills){let C=M.totalConsumed,y=M.peakVisible;C>=y*o.hiddenRatio&&(p.push({timestamp:h,price:d,visibleSize:y,hiddenSize:C,isBid:c,refillCount:M.refills}),p.length>o.maxEvents&&p.shift(),M.refills=0,M.totalConsumed=0)}}else M.refills=1,M.totalConsumed=0,M.lastRefillTs=h;M.lastVol=w}if(_.size>o.maxTrackedLevels){let d=[..._.entries()];d.sort((m,M)=>m[1].lastRefillTs-M[1].lastRefillTs);let w=d.length-o.maxTrackedLevels;for(let m=0;m<w;m++)_.delete(d[m][0])}}function a(u,_,c){let h=c||Date.now();r=h;let d=u instanceof Map?u:new Map(u.map(([M,I])=>[M,I])),w=_ instanceof Map?_:new Map(_.map(([M,I])=>[M,I]));e(d,n,!0,h),e(w,s,!1,h);let m=h-o.decayMs;for(;p.length>0&&p[0].timestamp<m;)p.shift()}function f(){return p}function l(u){if(!u||p.length===0)return;let _=p.length,c=new Float64Array(_),h=new Float64Array(_),d=new Float64Array(_),w=new Float64Array(_),m=new Uint8Array(_),M=new Uint32Array(_);for(let I=0;I<_;I++){let C=p[I];c[I]=C.timestamp,h[I]=C.price,d[I]=C.visibleSize,w[I]=C.hiddenSize,m[I]=C.isBid?1:0,M[I]=C.refillCount}u.setIcebergEvents(c,h,d,w,m,M)}function g(){n.clear(),s.clear(),p.length=0}return{onOrderbookUpdate:a,getEvents:f,pushToEngine:l,reset:g}}export{rr as buildRange,er as buildRenko,or as buildTick,tr as createChartBridge,jt as createCustomIndicatorManager,ir as createIcebergDetector,ft as dispatchCommands,Je as generateLicenseKey,ke as prefetchWasm,Yt as setupEvents,sr as suggestDefaults,Ct as validateLicense};
|
|
1
|
+
var z={FILL_RECT:1,STROKE_RECT:2,LINE:3,DASHED_LINE:4,POLYLINE:5,TEXT:6,CIRCLE:7,TRIANGLE:8,SAVE:9,RESTORE:10,CLIP_RECT:11,ROTATED_TEXT:12,BUBBLE_3D:13,FILL_POLYGON:14,DASHED_POLYLINE:15,END_FRAME:255},De=["left","center","right"],Ct=new Map,Xe=4096;function We(t,o,n,s){return t<<24|o<<16|n<<8|s}function K(t,o,n,s){let w=We(t,o,n,s),e=Ct.get(w);return e||(e=`rgba(${t},${o},${n},${(s/255).toFixed(3)})`,Ct.size>=Xe&&Ct.clear(),Ct.set(w,e),e)}var $t=new TextDecoder;function lt(t,o,n,s){let w=o.buffer;if(n+s>w.byteLength)return;let e=new DataView(w,n,s),a=new Uint8Array(w,n,s),r=0,i="",f="",u=-1,g="";for(;r<s;){let _=a[r];if(r+=1,_===z.END_FRAME)break;switch(_){case z.FILL_RECT:{let l=e.getFloat32(r,!0);r+=4;let d=e.getFloat32(r,!0);r+=4;let p=e.getFloat32(r,!0);r+=4;let h=e.getFloat32(r,!0);r+=4;let c=K(a[r],a[r+1],a[r+2],a[r+3]);r+=4,c!==i&&(t.fillStyle=c,i=c),t.fillRect(l,d,p,h);break}case z.STROKE_RECT:{let l=e.getFloat32(r,!0);r+=4;let d=e.getFloat32(r,!0);r+=4;let p=e.getFloat32(r,!0);r+=4;let h=e.getFloat32(r,!0);r+=4;let c=K(a[r],a[r+1],a[r+2],a[r+3]);r+=4;let m=e.getFloat32(r,!0);r+=4,c!==f&&(t.strokeStyle=c,f=c),m!==u&&(t.lineWidth=m,u=m),t.strokeRect(l,d,p,h);break}case z.LINE:{let l=e.getFloat32(r,!0);r+=4;let d=e.getFloat32(r,!0);r+=4;let p=e.getFloat32(r,!0);r+=4;let h=e.getFloat32(r,!0);r+=4;let c=K(a[r],a[r+1],a[r+2],a[r+3]);r+=4;let m=e.getFloat32(r,!0);r+=4,t.beginPath(),c!==f&&(t.strokeStyle=c,f=c),m!==u&&(t.lineWidth=m,u=m),t.setLineDash([]),t.moveTo(l,d),t.lineTo(p,h),t.stroke();break}case z.DASHED_LINE:{let l=e.getFloat32(r,!0);r+=4;let d=e.getFloat32(r,!0);r+=4;let p=e.getFloat32(r,!0);r+=4;let h=e.getFloat32(r,!0);r+=4;let c=K(a[r],a[r+1],a[r+2],a[r+3]);r+=4;let m=e.getFloat32(r,!0);r+=4;let M=e.getFloat32(r,!0);r+=4;let I=e.getFloat32(r,!0);r+=4,t.beginPath(),c!==f&&(t.strokeStyle=c,f=c),m!==u&&(t.lineWidth=m,u=m),t.setLineDash([M,I]),t.moveTo(l,d),t.lineTo(p,h),t.stroke(),t.setLineDash([]);break}case z.POLYLINE:{let l=e.getUint16(r,!0);r+=2;let d=K(a[r],a[r+1],a[r+2],a[r+3]);r+=4;let p=e.getFloat32(r,!0);if(r+=4,l>0){let h=new Float32Array(l*2);for(let c=0;c<l;c++)h[c*2]=e.getFloat32(r,!0),r+=4,h[c*2+1]=e.getFloat32(r,!0),r+=4;if(t.beginPath(),d!==f&&(t.strokeStyle=d,f=d),p!==u&&(t.lineWidth=p,u=p),t.setLineDash([]),t.lineJoin="round",t.lineCap="round",l<=3){t.moveTo(h[0],h[1]);for(let c=1;c<l;c++)t.lineTo(h[c*2],h[c*2+1])}else{t.moveTo(h[0],h[1]),t.lineTo((h[0]+h[2])*.5,(h[1]+h[3])*.5);for(let c=1;c<l-1;c++){let m=h[c*2],M=h[c*2+1],I=h[(c+1)*2],A=h[(c+1)*2+1];t.quadraticCurveTo(m,M,(m+I)*.5,(M+A)*.5)}t.lineTo(h[(l-1)*2],h[(l-1)*2+1])}t.stroke()}break}case z.TEXT:{let l=e.getFloat32(r,!0);r+=4;let d=e.getFloat32(r,!0);r+=4;let p=K(a[r],a[r+1],a[r+2],a[r+3]);r+=4;let h=e.getFloat32(r,!0);r+=4;let c=a[r];r+=1;let m=e.getUint16(r,!0);r+=2;let M=$t.decode(new Uint8Array(o.buffer,n+r,m));r+=m,p!==i&&(t.fillStyle=p,i=p);let I=`${h}px "IBM Plex Mono",monospace`;I!==g&&(t.font=I,g=I),t.textAlign=De[c]||"left",t.textBaseline="middle",t.fillText(M,l,d);break}case z.CIRCLE:{let l=e.getFloat32(r,!0);r+=4;let d=e.getFloat32(r,!0);r+=4;let p=e.getFloat32(r,!0);r+=4;let h=K(a[r],a[r+1],a[r+2],a[r+3]);r+=4;let c=K(a[r],a[r+1],a[r+2],a[r+3]);r+=4;let m=e.getFloat32(r,!0);r+=4,t.beginPath(),t.arc(l,d,p,0,Math.PI*2),h!==i&&(t.fillStyle=h,i=h),t.fill(),m>0&&(c!==f&&(t.strokeStyle=c,f=c),m!==u&&(t.lineWidth=m,u=m),t.stroke());break}case z.TRIANGLE:{let l=e.getFloat32(r,!0);r+=4;let d=e.getFloat32(r,!0);r+=4;let p=e.getFloat32(r,!0);r+=4;let h=e.getFloat32(r,!0);r+=4;let c=e.getFloat32(r,!0);r+=4;let m=e.getFloat32(r,!0);r+=4;let M=K(a[r],a[r+1],a[r+2],a[r+3]);r+=4,t.beginPath(),t.moveTo(l,d),t.lineTo(p,h),t.lineTo(c,m),t.closePath(),M!==i&&(t.fillStyle=M,i=M),t.fill();break}case z.SAVE:{t.save();break}case z.RESTORE:{t.restore(),i="",f="",u=-1,g="";break}case z.CLIP_RECT:{let l=e.getFloat32(r,!0);r+=4;let d=e.getFloat32(r,!0);r+=4;let p=e.getFloat32(r,!0);r+=4;let h=e.getFloat32(r,!0);r+=4,t.beginPath(),t.rect(l,d,p,h),t.clip();break}case z.ROTATED_TEXT:{let l=e.getFloat32(r,!0);r+=4;let d=e.getFloat32(r,!0);r+=4;let p=K(a[r],a[r+1],a[r+2],a[r+3]);r+=4;let h=e.getFloat32(r,!0);r+=4;let c=e.getFloat32(r,!0);r+=4;let m=e.getUint16(r,!0);r+=2;let M=$t.decode(a.subarray(r,r+m));r+=m;let I=`${h}px sans-serif`;I!==g&&(t.font=I,g=I),p!==i&&(t.fillStyle=p,i=p),t.textAlign="center",t.textBaseline="middle",t.save(),t.translate(l,d),t.rotate(c),t.fillText(M,0,0),t.restore();break}case z.BUBBLE_3D:{let l=e.getFloat32(r,!0);r+=4;let d=e.getFloat32(r,!0);r+=4;let p=e.getFloat32(r,!0);r+=4;let h=a[r],c=a[r+1],m=a[r+2],M=a[r+3];r+=4;let I=a[r],A=a[r+1],P=a[r+2],G=a[r+3];r+=4;let R=a[r],tt=a[r+1],k=a[r+2],it=a[r+3];r+=4;let ft=e.getFloat32(r,!0);r+=4;let F=p;if(F<10){let D=`rgba(${h},${c},${m},${(M/255).toFixed(3)})`;t.beginPath(),t.arc(l,d,F,0,Math.PI*2),t.fillStyle=D,t.fill(),i=""}else if(F<18){let D=l-F*.25,X=d-F*.25,V=t.createRadialGradient(D,X,F*.08,l,d,F);V.addColorStop(0,`rgba(${I},${A},${P},${(G/255).toFixed(3)})`),V.addColorStop(1,`rgba(${h},${c},${m},${(M/255).toFixed(3)})`),t.beginPath(),t.arc(l,d,F,0,Math.PI*2),t.fillStyle=V,t.fill(),i=""}else{let D=l-F*.25,X=d-F*.25,V=t.createRadialGradient(l,d,F*.85,l,d,F*1.2);V.addColorStop(0,`rgba(${R},${tt},${k},${(it/255*.5).toFixed(3)})`),V.addColorStop(1,`rgba(${R},${tt},${k},0)`),t.beginPath(),t.arc(l,d,F*1.2,0,Math.PI*2),t.fillStyle=V,t.fill();let q=t.createRadialGradient(D,X,F*.08,l,d,F);q.addColorStop(0,`rgba(${I},${A},${P},${(G/255).toFixed(3)})`),q.addColorStop(1,`rgba(${h},${c},${m},${(M/255).toFixed(3)})`),t.beginPath(),t.arc(l,d,F,0,Math.PI*2),t.fillStyle=q,t.fill();let S=F*.2,C=t.createRadialGradient(D,X,0,D,X,S);C.addColorStop(0,"rgba(255,255,255,0.22)"),C.addColorStop(1,"rgba(255,255,255,0)"),t.beginPath(),t.arc(D,X,S,0,Math.PI*2),t.fillStyle=C,t.fill(),i=""}break}case z.FILL_POLYGON:{let l=e.getUint16(r,!0);r+=2;let d=K(a[r],a[r+1],a[r+2],a[r+3]);if(r+=4,l>2){t.beginPath();let p=e.getFloat32(r,!0);r+=4;let h=e.getFloat32(r,!0);r+=4,t.moveTo(p,h);for(let c=1;c<l;c++)t.lineTo(e.getFloat32(r,!0),e.getFloat32(r+4,!0)),r+=8;t.closePath(),d!==i&&(t.fillStyle=d,i=d),t.fill()}else r+=l*8;break}case z.DASHED_POLYLINE:{let l=e.getUint16(r,!0);r+=2;let d=K(a[r],a[r+1],a[r+2],a[r+3]);r+=4;let p=e.getFloat32(r,!0);r+=4;let h=e.getFloat32(r,!0);r+=4;let c=e.getFloat32(r,!0);if(r+=4,l>1){t.beginPath(),d!==f&&(t.strokeStyle=d,f=d),p!==u&&(t.lineWidth=p,u=p),t.setLineDash([h,c]),t.lineJoin="round";let m=e.getFloat32(r,!0);r+=4;let M=e.getFloat32(r,!0);r+=4,t.moveTo(m,M);for(let I=1;I<l;I++)t.lineTo(e.getFloat32(r,!0),e.getFloat32(r+4,!0)),r+=8;t.stroke(),t.setLineDash([])}else r+=l*8;break}default:return}}}var x={trendline:{type:"2point",previewKind:0,addFn:"add_trendline"},arrow:{type:"2point",previewKind:4,addFn:"add_arrow"},measure:{type:"2point",previewKind:2,addFn:"add_price_range"},fib:{type:"2point",previewKind:3,addFn:"add_fib_retracement"},long:{type:"2point",previewKind:5,addFn:"add_long_position"},short:{type:"2point",previewKind:5,addFn:"add_short_position"},hline:{type:"1point_xp",previewKind:1,addFn:"add_horizontal_line"},vwap:{type:"1point_x",previewKind:6,addFn:"add_anchored_vwap"},pricelabel:{type:"1point_xy",previewKind:7,addFn:"add_price_label"},circle:{type:"2point",previewKind:8,addFn:"add_circle"},arrowup:{type:"1point_xy",previewKind:9,addFn:"add_arrow_marker_up"},arrowdown:{type:"1point_xy",previewKind:10,addFn:"add_arrow_marker_down"},textnote:{type:"1point_xy",previewKind:11,addFn:"add_text_note"},channel:{type:"3point",previewKind:0,addFn:"add_parallel_channel"},fibext:{type:"3point",previewKind:0,addFn:"add_fib_extension",previewFn:"fib_ext"},brush:{type:"freehand"},path:{type:"npoint"},elliott:{type:"elliott_manual"},elliottauto:{type:"1point_xy",previewKind:12,addFn:"add_elliott_impulse",previewFn:"elliott"}};function wt(t){return x[t]?.type==="2point"}function gt(t){return x[t]?.type==="3point"}function _t(t){let o=x[t]?.type;return o==="1point"||o==="1point_x"||o==="1point_xy"||o==="1point_xp"}function bt(t){return x[t]?.type==="freehand"}function et(t){return x[t]?.type==="npoint"}function rt(t){return x[t]?.type==="elliott_manual"}var Jt={r:.04,g:.49,b:1,lineWidth:2,dashed:!1,fontSize:12};function ot(t,o,n,s,w,e){e=e||Jt;let a=x[o];if(!a)return 0;let r=0;return a.type==="3point"?r=t[a.addFn](n.x1,n.y1,n.x2,n.y2,s,w,e.r,e.g,e.b,e.lineWidth,e.dashed,n.pane):a.type==="2point"?r=t[a.addFn](n.x1,n.y1,s,w,e.r,e.g,e.b,e.lineWidth,e.dashed,n.pane):a.type==="1point_x"?r=t[a.addFn](s,e.r,e.g,e.b,e.lineWidth,e.dashed,n.pane):a.type==="1point_xp"?r=t[a.addFn](s,w,e.r,e.g,e.b,e.lineWidth,e.dashed,n.pane):a.type==="1point_xy"?r=t[a.addFn](s,w,e.r,e.g,e.b,e.fontSize||12,n.pane):r=t[a.addFn](w,e.r,e.g,e.b,e.lineWidth,e.dashed,n.pane),r||0}function U(t,o,n,s,w,e,a){e=e||Jt;let r=x[o];if(r){if(r.previewFn==="elliott"){t.set_elliott_preview(s,w,e.r,e.g,e.b,e.lineWidth,a);return}r.type==="3point"?n.step===1?t.set_drawing_preview(r.previewKind,n.x1,n.y1,s,w,e.r,e.g,e.b,e.lineWidth,e.dashed,a):n.step===2&&(r.previewFn==="fib_ext"?t.set_fib_ext_preview(n.x1,n.y1,n.x2,n.y2,s,w,e.r,e.g,e.b,e.lineWidth,e.dashed,a):t.set_channel_preview(n.x1,n.y1,n.x2,n.y2,s,w,e.r,e.g,e.b,e.lineWidth,e.dashed,a)):r.type==="2point"?t.set_drawing_preview(r.previewKind,n.x1,n.y1,s,w,e.r,e.g,e.b,e.lineWidth,e.dashed,a):r.type==="1point_x"?t.set_drawing_preview(r.previewKind,s,0,0,0,e.r,e.g,e.b,e.lineWidth,e.dashed,a):r.type==="1point_xp"||r.type==="1point_xy"?t.set_drawing_preview(r.previewKind,s,w,0,0,e.r,e.g,e.b,e.lineWidth,e.dashed,a):t.set_drawing_preview(r.previewKind,0,w,0,0,e.r,e.g,e.b,e.lineWidth,e.dashed,a)}}function N(t,o,n,s){let w=t.screen_to_world_x(o),e;switch(s){case 1:e=t.screen_to_rsi_y(n);break;case 2:e=t.screen_to_oi_y(n);break;case 3:e=t.screen_to_fr_y(n);break;case 4:e=t.screen_to_cvd_y(n);break;case 5:e=t.screen_to_vpin_y(n);break;case 6:e=t.screen_to_ob_flow_y(n);break;default:e=t.screen_to_world_y(n);break}return{wx:w,wy:e}}function $(t){return t===4?1:t===6?2:t===8?3:t===10?4:t===12?5:t===19?6:0}function ut(t){return t===4||t===6||t===8||t===10||t===12||t===19}function W(t){return t===14||t===15||t===16||t===17||t===18||t===21}function Q(t){return t===4||t===14?1:t===6||t===15?2:t===8||t===16?3:t===10||t===17?4:t===12||t===18?5:t===19||t===21?6:0}function nt(t,o,n,s){ut(o)?(t.pan(n,0),Math.abs(s)>.01&&t.pan_indicator_y(Q(o),s)):t.pan(n,s)}function B(t){return t===0||t===4||t===6||t===8||t===10||t===12}function ie(t,o,n,s){t.addEventListener("wheel",r=>{if(s.disposed)return;r.preventDefault(),s.cancelMomentum();let i=r.deltaY>0?1.1:.9,f=o.hit_zone(r.offsetX,r.offsetY);W(f)?o.zoom_indicator_y(Q(f),r.offsetY,i):ut(f)?r.ctrlKey?o.zoom_indicator_y(Q(f),r.offsetY,i):o.zoom_x(r.offsetX,i):r.ctrlKey?o.zoom_y(r.offsetY,i):r.shiftKey||f===2?o.zoom_x(r.offsetX,i):f===3?o.zoom_y(r.offsetY,i):o.zoom(r.offsetX,r.offsetY,i),n.onDirty()},{passive:!1}),t.addEventListener("mousedown",r=>{if(s.disposed||r.button!==0)return;s.cancelMomentum(),e();let i=performance.now();if(i-s.lastClickTime<300){s.lastClickTime=i;return}s.lastClickTime=i;let f=s.drawingMode;if(f){let g=o.hit_zone(r.offsetX,r.offsetY);if(!B(g))return;let _=$(g),{wx:l,wy:d}=N(o,r.offsetX,r.offsetY,_),p=f.style,h=f.tool;if(rt(h)){if(!f.pathStarted)f.pane=_,o.start_elliott_manual(p.r,p.g,p.b,p.lineWidth,_),o.add_elliott_manual_point(l,d),f.pathStarted=!0,f.step=1;else if(o.add_elliott_manual_point(l,d)){s.finishDrawing(),n.onDirty();return}}else if(et(h))f.pathStarted?o.add_path_point(l,d):(f.pane=_,o.start_path(p.r,p.g,p.b,p.lineWidth,p.dashed,_),o.add_path_point(l,d),f.pathStarted=!0,f.step=1);else if(bt(h))f.pane=_,o.start_brush(p.r,p.g,p.b,p.lineWidth,_),o.add_brush_point(l,d),s.isBrushing=!0;else if(gt(h))if(f.step===0)f.x1=l,f.y1=d,f.pane=_,f.step=1;else if(f.step===1)f.x2=l,f.y2=d,f.step=2,o.clear_drawing_preview();else{let c=x[h];c&&c.previewFn==="fib_ext"?o.clear_fib_ext_preview():o.clear_channel_preview(),ot(o,h,f,l,d,p),s.finishDrawing()}else if(wt(h))f.step===0?(f.x1=l,f.y1=d,f.pane=_,f.step=1):(ot(o,h,f,l,d,p),s.finishDrawing());else{f.pane=_;let c=ot(o,h,f,l,d,p);s.finishDrawing(),h==="textnote"&&c>0&&(o.select_drawing(c),n.onDrawingSelected?.(c),n.onDrawingDblClick?.(c,r.offsetX,r.offsetY,r.clientX,r.clientY))}n.onDirty();return}let u=o.hit_zone(r.offsetX,r.offsetY);if(u===5){s.isResizingRsi=!0,s.resizeStartY=r.offsetY,s.resizeStartRatio=o.get_rsi_ratio(),t.style.cursor="ns-resize";return}if(u===7){s.isResizingOi=!0,s.resizeStartY=r.offsetY,s.resizeStartRatio=o.get_oi_ratio(),t.style.cursor="ns-resize";return}if(u===9){s.isResizingFr=!0,s.resizeStartY=r.offsetY,s.resizeStartRatio=o.get_fr_ratio(),t.style.cursor="ns-resize";return}if(u===11){s.isResizingCvd=!0,s.resizeStartY=r.offsetY,s.resizeStartRatio=o.get_cvd_ratio(),t.style.cursor="ns-resize";return}if(u===13){s.isResizingVpin=!0,s.resizeStartY=r.offsetY,s.resizeStartRatio=o.get_vpin_ratio(),t.style.cursor="ns-resize";return}if(u===20){s.isResizingObFlow=!0,s.resizeStartY=r.offsetY,s.resizeStartRatio=o.get_obf_ratio(),t.style.cursor="ns-resize";return}if(B(u)){let g=o.get_selected_drawing();if(g>0){let h=o.hit_test_drawing_anchor(r.offsetX,r.offsetY);if(h>=0){s.isDraggingAnchor=!0,s.dragAnchorIdx=h,s.dragAnchorPane=$(u),t.style.cursor="grabbing";return}if(o.hit_test_drawing(r.offsetX,r.offsetY)===g){s.isDraggingDrawing=!0,s.dragDrawingPane=$(u);let{wx:m,wy:M}=N(o,r.offsetX,r.offsetY,s.dragDrawingPane);s.dragDrawingLastWx=m,s.dragDrawingLastWy=M,t.style.cursor="move";return}}let _=o.hit_test_drawing(r.offsetX,r.offsetY);if(_>0){o.deselect_marker(),n.onMarkerSelected?.(0),o.select_drawing(_),n.onDrawingSelected?.(_),n.onDirty();return}let l=o.hit_test_marker(r.offsetX,r.offsetY);if(l>0){o.deselect_drawing(),n.onDrawingSelected?.(0),o.select_marker(l),n.onMarkerSelected?.(l),n.onDirty();return}let d=o.get_selected_drawing(),p=o.get_selected_marker();d>0&&(o.deselect_drawing(),n.onDrawingSelected?.(0),n.onDirty()),p>0&&(o.deselect_marker(),n.onMarkerSelected?.(0),n.onDirty())}B(u)&&(s.liqPinSx=r.offsetX,s.liqPinSy=r.offsetY,s.liqPinTimer&&clearTimeout(s.liqPinTimer),s.liqPinTimer=setTimeout(()=>{s.liqPinTimer=null,n.onLiqAnnotationPin?.(s.liqPinSx,s.liqPinSy)},700)),s.isDragging=!0,s.dragZone=u,s.lastX=r.offsetX,s.lastY=r.offsetY,u===2?t.style.cursor="ew-resize":u===3||W(u)?t.style.cursor="ns-resize":t.style.cursor="grabbing"});let w=null;function e(){w&&(cancelAnimationFrame(w),w=null)}function a(r,i){let f=o.hover_hit_test(r,i),u=f[0],g=f[1],_=f[2],l=f[3],d=f[4],p=s.drawingMode;u===2?(t.style.cursor="ew-resize",o.hide_crosshair()):u===3||W(u)?(t.style.cursor="ns-resize",o.hide_crosshair()):(o.set_crosshair(r,i),u===5||u===7||u===9||u===11||u===13||u===20?t.style.cursor="ns-resize":!p&&B(u)&&g>0&&_>=0?t.style.cursor="grab":!p&&B(u)&&g>0&&l===g?t.style.cursor="move":!p&&B(u)&&(l>0||d>0)?t.style.cursor="pointer":t.style.cursor="crosshair"),n.onDirty(),n.onCrosshairMove?.(r,i,u),n.onVrvpHover?.(r,i)}t.addEventListener("mousemove",r=>{if(s.disposed)return;if(s.liqPinTimer){let f=Math.abs(r.offsetX-s.liqPinSx),u=Math.abs(r.offsetY-s.liqPinSy);(f>6||u>6)&&(clearTimeout(s.liqPinTimer),s.liqPinTimer=null)}if(s.isResizingRsi){let u=t.getBoundingClientRect().height-28,_=(s.resizeStartY-r.offsetY)/u,l=Math.max(.05,Math.min(.5,s.resizeStartRatio+_));o.set_rsi_ratio(l),n.onDirty();return}if(s.isResizingOi){let u=t.getBoundingClientRect().height-28,_=(s.resizeStartY-r.offsetY)/u,l=Math.max(.05,Math.min(.5,s.resizeStartRatio+_));o.set_oi_ratio(l),n.onDirty();return}if(s.isResizingFr){let u=t.getBoundingClientRect().height-28,_=(s.resizeStartY-r.offsetY)/u,l=Math.max(.05,Math.min(.5,s.resizeStartRatio+_));o.set_fr_ratio(l),n.onDirty();return}if(s.isResizingCvd){let u=t.getBoundingClientRect().height-28,_=(s.resizeStartY-r.offsetY)/u,l=Math.max(.05,Math.min(.5,s.resizeStartRatio+_));o.set_cvd_ratio(l),n.onDirty();return}if(s.isResizingVpin){let u=t.getBoundingClientRect().height-28,_=(s.resizeStartY-r.offsetY)/u,l=Math.max(.05,Math.min(.5,s.resizeStartRatio+_));o.set_vpin_ratio(l),n.onDirty();return}if(s.isResizingObFlow){let u=t.getBoundingClientRect().height-28,_=(s.resizeStartY-r.offsetY)/u,l=Math.max(.05,Math.min(.5,s.resizeStartRatio+_));o.set_obf_ratio(l),n.onDirty();return}if(s.isDraggingAnchor){let{wx:f,wy:u}=N(o,r.offsetX,r.offsetY,s.dragAnchorPane);o.update_drawing_anchor(s.dragAnchorIdx,f,u),o.set_crosshair(r.offsetX,r.offsetY),n.onDirty(),n.onCrosshairMove?.(r.offsetX,r.offsetY,o.hit_zone(r.offsetX,r.offsetY));return}if(s.isDraggingDrawing){let{wx:f,wy:u}=N(o,r.offsetX,r.offsetY,s.dragDrawingPane),g=f-s.dragDrawingLastWx,_=u-s.dragDrawingLastWy;o.move_drawing(g,_),s.dragDrawingLastWx=f,s.dragDrawingLastWy=u,o.set_crosshair(r.offsetX,r.offsetY),n.onDirty(),n.onCrosshairMove?.(r.offsetX,r.offsetY,o.hit_zone(r.offsetX,r.offsetY));return}let i=s.drawingMode;if(s.isBrushing&&i){let f=i.pane||0,{wx:u,wy:g}=N(o,r.offsetX,r.offsetY,f);o.add_brush_point(u,g),o.set_crosshair(r.offsetX,r.offsetY),n.onDirty();return}if(i&&rt(i.tool)&&i.pathStarted){let f=i.pane||0,{wx:u,wy:g}=N(o,r.offsetX,r.offsetY,f);o.set_elliott_manual_cursor(u,g),o.set_crosshair(r.offsetX,r.offsetY);let _=o.hit_zone(r.offsetX,r.offsetY);n.onDirty(),n.onCrosshairMove?.(r.offsetX,r.offsetY,_);return}if(i&&et(i.tool)&&i.pathStarted){let f=i.pane||0,{wx:u,wy:g}=N(o,r.offsetX,r.offsetY,f);o.set_path_cursor(u,g),o.set_crosshair(r.offsetX,r.offsetY);let _=o.hit_zone(r.offsetX,r.offsetY);n.onDirty(),n.onCrosshairMove?.(r.offsetX,r.offsetY,_);return}if(i&&i.step>0){let f=i.pane||0,{wx:u,wy:g}=N(o,r.offsetX,r.offsetY,f);U(o,i.tool,i,u,g,i.style,f),o.set_crosshair(r.offsetX,r.offsetY);let _=o.hit_zone(r.offsetX,r.offsetY);n.onDirty(),n.onCrosshairMove?.(r.offsetX,r.offsetY,_);return}if(i&&_t(i.tool)){let f=o.hit_zone(r.offsetX,r.offsetY),u=$(f),{wx:g,wy:_}=N(o,r.offsetX,r.offsetY,u);U(o,i.tool,i,g,_,i.style,u),o.set_crosshair(r.offsetX,r.offsetY),n.onDirty(),n.onCrosshairMove?.(r.offsetX,r.offsetY,f);return}if(s.isDragging){let f=r.offsetX-s.lastX,u=r.offsetY-s.lastY;s.lastX=r.offsetX,s.lastY=r.offsetY,s.dragZone===2?o.pan_x(f):s.dragZone===3?o.pan_y(u):W(s.dragZone)?o.pan_indicator_y(Q(s.dragZone),u):nt(o,s.dragZone,f,u),n.onDirty(),n.onCrosshairMove?.(r.offsetX,r.offsetY,s.dragZone),n.onVrvpHover?.(r.offsetX,r.offsetY);return}s._pendingHoverX=r.offsetX,s._pendingHoverY=r.offsetY,w||(w=requestAnimationFrame(()=>{w=null,s.disposed||a(s._pendingHoverX,s._pendingHoverY)}))}),t.addEventListener("mouseup",()=>{s.disposed||(s.liqPinTimer&&(clearTimeout(s.liqPinTimer),s.liqPinTimer=null),s.isBrushing&&(s.isBrushing=!1,o.finish_brush(),s.finishDrawing(),n.onDirty()),s.isDragging=!1,s.isResizingRsi=!1,s.isResizingOi=!1,s.isResizingFr=!1,s.isResizingCvd=!1,s.isResizingVpin=!1,s.isResizingObFlow=!1,s.isDraggingAnchor=!1,s.isDraggingDrawing=!1,s.dragAnchorIdx=-1,t.style.cursor="crosshair")}),t.addEventListener("mouseleave",()=>{s.disposed||(e(),s.liqPinTimer&&(clearTimeout(s.liqPinTimer),s.liqPinTimer=null),s.isBrushing&&(s.isBrushing=!1,o.finish_brush(),s.finishDrawing()),s.isDragging=!1,s.isResizingRsi=!1,s.isResizingOi=!1,s.isResizingFr=!1,s.isResizingCvd=!1,s.isResizingVpin=!1,s.isResizingObFlow=!1,s.isDraggingAnchor=!1,s.isDraggingDrawing=!1,s.dragAnchorIdx=-1,o.hide_crosshair(),t.style.cursor="crosshair",n.onDirty(),n.onCrosshairHide?.(),n.onVrvpHover?.(null,null))}),t.addEventListener("dblclick",r=>{if(s.disposed)return;r.preventDefault(),r.stopPropagation();let i=s.drawingMode;if(i&&rt(i.tool)&&i.pathStarted){o.finish_elliott_manual(),s.finishDrawing(),n.onDirty();return}if(i&&et(i.tool)&&i.pathStarted){o.finish_path(),s.finishDrawing(),n.onDirty();return}if(i)return;let f=o.hit_zone(r.offsetX,r.offsetY);if(ut(f)||W(f)){o.reset_indicator_y_auto(Q(f)),n.onDirty();return}let u=o.hit_test_drawing(r.offsetX,r.offsetY);u>0&&(o.select_drawing(u),n.onDirty(),n.onDrawingDblClick?.(u,r.offsetX,r.offsetY,r.clientX,r.clientY))}),t.addEventListener("contextmenu",r=>{if(s.disposed)return;let i=s.drawingMode;if(i&&rt(i.tool)&&i.pathStarted){r.preventDefault(),r.stopPropagation(),o.finish_elliott_manual(),s.finishDrawing(),n.onDirty();return}if(i&&et(i.tool)&&i.pathStarted){r.preventDefault(),r.stopPropagation(),o.finish_path(),s.finishDrawing(),n.onDirty();return}})}function ae(t,o,n,s){t.addEventListener("touchstart",w=>{if(!s.disposed){if(w.preventDefault(),s.cancelMomentum(),w.touches.length===2){clearTimeout(s.longPressTimer),s.isCrosshairMode=!1;let e=t.getBoundingClientRect(),a=w.touches[1].clientX-w.touches[0].clientX,r=w.touches[1].clientY-w.touches[0].clientY;s.lastTouchDist=Math.sqrt(a*a+r*r),s.lastX=(w.touches[0].clientX+w.touches[1].clientX)/2-e.left,s.lastY=(w.touches[0].clientY+w.touches[1].clientY)/2-e.top,s.dragZone=o.hit_zone(s.lastX,s.lastY)}else if(w.touches.length===1){let e=t.getBoundingClientRect(),a=w.touches[0].clientX-e.left,r=w.touches[0].clientY-e.top;s.touchStartX=a,s.touchStartY=r,s.touchMoved=!1;let i=s.drawingMode;if(i){let l=o.hit_zone(a,r);if(B(l)){let d=$(l),{wx:p,wy:h}=N(o,a,r,d),c=i.tool;if(rt(c)){if(!i.pathStarted)i.pane=d,o.start_elliott_manual(i.style.r,i.style.g,i.style.b,i.style.lineWidth,d),o.add_elliott_manual_point(p,h),i.pathStarted=!0,i.step=1;else if(o.add_elliott_manual_point(p,h)){s.finishDrawing(),n.onDirty();return}}else et(c)?i.pathStarted?o.add_path_point(p,h):(i.pane=d,o.start_path(i.style.r,i.style.g,i.style.b,i.style.lineWidth,i.style.dashed,d),o.add_path_point(p,h),i.pathStarted=!0,i.step=1):bt(c)?(i.pane=d,o.start_brush(i.style.r,i.style.g,i.style.b,i.style.lineWidth,d),o.add_brush_point(p,h),s.isBrushing=!0):gt(c)?i.step===0?(i.x1=p,i.y1=h,i.pane=d,i.step=1,i._stepAtTouchStart=0,U(o,c,i,p,h,i.style,d)):i.step===1?(i._stepAtTouchStart=1,U(o,c,i,p,h,i.style,i.pane)):(i._stepAtTouchStart=2,U(o,c,i,p,h,i.style,i.pane)):wt(c)?i.step===0?(i.x1=p,i.y1=h,i.pane=d,i.step=1,i._stepAtTouchStart=0,U(o,c,i,p,h,i.style,d)):(i._stepAtTouchStart=1,U(o,c,i,p,h,i.style,i.pane)):_t(c)?(i.pane=d,U(o,c,i,p,h,i.style,d)):(i.pane=d,ot(o,c,i,p,h,i.style),s.finishDrawing());o.set_crosshair(a,r),n.onDirty(),n.onCrosshairMove?.(a,r,l)}return}let f=o.hover_hit_test(a,r),u=f[0],g=f[1],_=f[2];if(B(u)&&!s.drawingMode&&g>0){if(_>=0){s.isDraggingAnchor=!0,s.dragAnchorIdx=_,s.dragAnchorPane=$(u);return}if(f[3]===g){s.isDraggingDrawing=!0,s.dragDrawingPane=$(u);let{wx:d,wy:p}=N(o,a,r,s.dragDrawingPane);s.dragDrawingLastWx=d,s.dragDrawingLastWy=p;return}}s.isDragging=!0,s.isCrosshairMode=!1,s.lastX=a,s.lastY=r,s.dragZone=u,clearTimeout(s.longPressTimer),s.longPressTimer=setTimeout(()=>{s.isDragging&&!s.touchMoved&&(s.isCrosshairMode=!0,o.set_crosshair(a,r),n.onDirty(),n.onCrosshairMove?.(a,r,s.dragZone),n.onVrvpHover?.(a,r))},300),B(s.dragZone)&&(s.liqPinSx=a,s.liqPinSy=r,s.liqPinTimer&&clearTimeout(s.liqPinTimer),s.liqPinTimer=setTimeout(()=>{s.liqPinTimer=null,s.touchMoved||n.onLiqAnnotationPin?.(s.liqPinSx,s.liqPinSy)},700))}}},{passive:!1}),t.addEventListener("touchmove",w=>{if(s.disposed)return;w.preventDefault();let e=t.getBoundingClientRect();if(s.isDraggingAnchor&&w.touches.length===1){let r=w.touches[0].clientX-e.left,i=w.touches[0].clientY-e.top,{wx:f,wy:u}=N(o,r,i,s.dragAnchorPane);o.update_drawing_anchor(s.dragAnchorIdx,f,u),o.set_crosshair(r,i),n.onDirty();return}if(s.isDraggingDrawing&&w.touches.length===1){let r=w.touches[0].clientX-e.left,i=w.touches[0].clientY-e.top;s.touchMoved=!0;let{wx:f,wy:u}=N(o,r,i,s.dragDrawingPane),g=f-s.dragDrawingLastWx,_=u-s.dragDrawingLastWy;o.move_drawing(g,_),s.dragDrawingLastWx=f,s.dragDrawingLastWy=u,o.set_crosshair(r,i),n.onDirty();return}let a=s.drawingMode;if(s.isBrushing&&a&&w.touches.length===1){let r=w.touches[0].clientX-e.left,i=w.touches[0].clientY-e.top,f=a.pane||0,{wx:u,wy:g}=N(o,r,i,f);o.add_brush_point(u,g),o.set_crosshair(r,i),n.onDirty(),s.touchMoved=!0;return}if(a&&rt(a.tool)&&a.pathStarted&&w.touches.length===1){let r=w.touches[0].clientX-e.left,i=w.touches[0].clientY-e.top,f=a.pane||0,{wx:u,wy:g}=N(o,r,i,f);o.set_elliott_manual_cursor(u,g),o.set_crosshair(r,i),n.onDirty(),s.touchMoved=!0;return}if(a&&et(a.tool)&&a.pathStarted&&w.touches.length===1){let r=w.touches[0].clientX-e.left,i=w.touches[0].clientY-e.top,f=a.pane||0,{wx:u,wy:g}=N(o,r,i,f);o.set_path_cursor(u,g),o.set_crosshair(r,i),n.onDirty(),s.touchMoved=!0;return}if(a&&a.step>0&&w.touches.length===1){let r=w.touches[0].clientX-e.left,i=w.touches[0].clientY-e.top;!s.touchMoved&&(Math.abs(r-s.touchStartX)>10||Math.abs(i-s.touchStartY)>10)&&(s.touchMoved=!0);let f=a.pane||0,{wx:u,wy:g}=N(o,r,i,f);U(o,a.tool,a,u,g,a.style,f),o.set_crosshair(r,i);let _=o.hit_zone(r,i);n.onDirty(),n.onCrosshairMove?.(r,i,_);return}if(a&&_t(a.tool)&&w.touches.length===1){let r=w.touches[0].clientX-e.left,i=w.touches[0].clientY-e.top,f=o.hit_zone(r,i),u=$(f),{wx:g,wy:_}=N(o,r,i,u);U(o,a.tool,a,g,_,a.style,u),o.set_crosshair(r,i),n.onDirty(),n.onCrosshairMove?.(r,i,f);return}if(w.touches.length===2){s.velSamples=[];let r=w.touches[1].clientX-w.touches[0].clientX,i=w.touches[1].clientY-w.touches[0].clientY,f=Math.sqrt(r*r+i*i),u=s.lastTouchDist/f,g=(w.touches[0].clientX+w.touches[1].clientX)/2-e.left,_=(w.touches[0].clientY+w.touches[1].clientY)/2-e.top;s.dragZone===3?o.zoom_y(_,u):W(s.dragZone)?o.zoom_indicator_y(Q(s.dragZone),_,u):s.dragZone===2?o.zoom_x(g,u):ut(s.dragZone)?(o.zoom_x(g,u),nt(o,s.dragZone,g-s.lastX,_-s.lastY)):(o.zoom(g,_,u),nt(o,s.dragZone,g-s.lastX,_-s.lastY)),s.lastTouchDist=f,s.lastX=g,s.lastY=_,n.onDirty()}else if(w.touches.length===1&&s.isDragging){let r=w.touches[0].clientX-e.left,i=w.touches[0].clientY-e.top,f=r-s.lastX,u=i-s.lastY;if(!s.touchMoved&&(Math.abs(r-s.touchStartX)>10||Math.abs(i-s.touchStartY)>10)&&(s.touchMoved=!0,s.isCrosshairMode||clearTimeout(s.longPressTimer),s.liqPinTimer&&(clearTimeout(s.liqPinTimer),s.liqPinTimer=null)),s.isCrosshairMode)o.set_crosshair(r,i),n.onDirty(),n.onCrosshairMove?.(r,i,s.dragZone),n.onVrvpHover?.(r,i);else{if(s.lastX=r,s.lastY=i,s.dragZone===3||W(s.dragZone)||s.recordVelocity(f,u),s.dragZone===2)o.pan_x(f);else if(s.dragZone===3){let _=Math.pow(1.005,u);o.zoom_y(i,_)}else if(W(s.dragZone)){let _=Math.pow(1.005,u);o.zoom_indicator_y(Q(s.dragZone),i,_)}else nt(o,s.dragZone,f,u);n.onDirty()}}},{passive:!1}),t.addEventListener("touchend",w=>{if(s.disposed)return;if(clearTimeout(s.longPressTimer),s.liqPinTimer&&(clearTimeout(s.liqPinTimer),s.liqPinTimer=null),s.isDraggingAnchor){s.isDraggingAnchor=!1,s.dragAnchorIdx=-1,o.hide_crosshair(),n.onDirty(),n.onCrosshairHide?.();return}if(s.isDraggingDrawing){if(s.isDraggingDrawing=!1,o.hide_crosshair(),n.onDirty(),n.onCrosshairHide?.(),!s.touchMoved){let a=o.get_selected_drawing();if(a>0){let r=t.getBoundingClientRect();n.onDrawingDblClick?.(a,s.touchStartX,s.touchStartY,s.touchStartX+r.left,s.touchStartY+r.top)}}return}if(s.isBrushing){s.isBrushing=!1,o.finish_brush(),s.finishDrawing(),n.onDirty(),n.onCrosshairHide?.();return}let e=s.drawingMode;if(e&&rt(e.tool)&&e.pathStarted){let a=Date.now(),r=s.touchStartX-(s._pathLastTapX||0),i=s.touchStartY-(s._pathLastTapY||0),f=Math.sqrt(r*r+i*i);a-(s._pathLastTapTime||0)<350&&f<30?(o.finish_elliott_manual(),s.finishDrawing(),s._pathLastTapTime=0):(s._pathLastTapTime=a,s._pathLastTapX=s.touchStartX,s._pathLastTapY=s.touchStartY),s.isDragging=!1,s.lastTouchDist=0,n.onDirty();return}if(e&&et(e.tool)&&e.pathStarted){let a=Date.now(),r=s.touchStartX-(s._pathLastTapX||0),i=s.touchStartY-(s._pathLastTapY||0),f=Math.sqrt(r*r+i*i);a-(s._pathLastTapTime||0)<350&&f<30?(o.finish_path(),s.finishDrawing(),s._pathLastTapTime=0):(s._pathLastTapTime=a,s._pathLastTapX=s.touchStartX,s._pathLastTapY=s.touchStartY),s.isDragging=!1,s.lastTouchDist=0,n.onDirty();return}if(e&>(e.tool)){let a=e._stepAtTouchStart;if(e.step===1&&(a===1||s.touchMoved)){let r=t.getBoundingClientRect(),i=w.changedTouches?.[0];if(i){let f=i.clientX-r.left,u=i.clientY-r.top,g=e.pane||0,{wx:_,wy:l}=N(o,f,u,g);e.x2=_,e.y2=l,e.step=2,o.clear_drawing_preview()}}else if(e.step===2&&(a===2||s.touchMoved)){let r=t.getBoundingClientRect(),i=w.changedTouches?.[0];if(i){let f=i.clientX-r.left,u=i.clientY-r.top,g=e.pane||0,{wx:_,wy:l}=N(o,f,u,g),d=x[e.tool];d&&d.previewFn==="fib_ext"?o.clear_fib_ext_preview():o.clear_channel_preview(),ot(o,e.tool,e,_,l,e.style),s.finishDrawing()}}s.isDragging=!1,s.lastTouchDist=0,s.drawingMode||(o.hide_crosshair(),n.onCrosshairHide?.()),n.onDirty();return}if(e&&e.step===1&&wt(e.tool)){if(e._stepAtTouchStart===1||s.touchMoved){let r=t.getBoundingClientRect(),i=w.changedTouches?.[0];if(i){let f=i.clientX-r.left,u=i.clientY-r.top,g=e.pane||0,{wx:_,wy:l}=N(o,f,u,g);ot(o,e.tool,e,_,l,e.style),s.finishDrawing()}}s.isDragging=!1,s.lastTouchDist=0,s.drawingMode||(o.hide_crosshair(),n.onCrosshairHide?.()),n.onDirty();return}if(e&&_t(e.tool)){let a=t.getBoundingClientRect(),r=w.changedTouches?.[0];if(r){let i=r.clientX-a.left,f=r.clientY-a.top,u=o.hit_zone(i,f),g=B(u)?$(u):e.pane||0,{wx:_,wy:l}=N(o,i,f,g),d=e.tool;o.clear_drawing_preview();let p=ot(o,d,e,_,l,e.style);s.finishDrawing(),d==="textnote"&&p>0&&(o.select_drawing(p),n.onDrawingSelected?.(p),n.onDrawingDblClick?.(p,i,f,i+a.left,f+a.top))}s.isDragging=!1,s.lastTouchDist=0,o.hide_crosshair(),n.onCrosshairHide?.(),n.onDirty();return}if(!s.touchMoved&&!s.drawingMode&&s.isDragging){let a=Date.now(),r=s.touchStartX-s.lastTapX,i=s.touchStartY-s.lastTapY,f=Math.sqrt(r*r+i*i),u=a-s.lastTapTime<350&&f<30,g=o.hover_hit_test(s.touchStartX,s.touchStartY),_=g[0],l=g[1],d=g[3],p=g[4];if(u&&(ut(_)||W(_)))o.reset_indicator_y_auto(Q(_)),n.onDirty(),s.lastTapTime=a,s.lastTapX=s.touchStartX,s.lastTapY=s.touchStartY;else if(B(_))if(d>0){o.deselect_marker(),n.onMarkerSelected?.(0),o.select_drawing(d);let h=t.getBoundingClientRect(),c=s.touchStartX+h.left,m=s.touchStartY+h.top;n.onDrawingSelected?.(d,c,m),(l<=0||l===d)&&n.onDrawingDblClick?.(d,s.touchStartX,s.touchStartY,c,m),n.onDirty()}else p>0?(o.deselect_drawing(),n.onDrawingSelected?.(0),o.select_marker(p),n.onMarkerSelected?.(p),n.onDirty()):(l>0&&(o.deselect_drawing(),n.onDrawingSelected?.(0),n.onDirty()),o.get_selected_marker()>0&&(o.deselect_marker(),n.onMarkerSelected?.(0),n.onDirty()));s.lastTapTime=a,s.lastTapX=s.touchStartX,s.lastTapY=s.touchStartY}s.touchMoved&&!s.isCrosshairMode&&!s.drawingMode&&s.dragZone!==3&&!W(s.dragZone)&&s.startMomentum(s.dragZone),s.isDragging=!1,s.isCrosshairMode=!1,s.lastTouchDist=0,(!s.drawingMode||s.drawingMode.step===0)&&(o.hide_crosshair(),n.onCrosshairHide?.()),n.onDirty(),n.onVrvpHover?.(null,null)})}function jt(t,o,n){let s={disposed:!1,isDragging:!1,dragZone:0,lastX:0,lastY:0,lastTouchDist:0,isResizingRsi:!1,isResizingOi:!1,isResizingFr:!1,isResizingCvd:!1,resizeStartY:0,resizeStartRatio:0,lastClickTime:0,isDraggingAnchor:!1,dragAnchorIdx:-1,dragAnchorPane:0,isBrushing:!1,isDraggingDrawing:!1,dragDrawingPane:0,dragDrawingLastWx:0,dragDrawingLastWy:0,touchStartX:0,touchStartY:0,touchMoved:!1,longPressTimer:null,isCrosshairMode:!1,liqPinTimer:null,liqPinSx:0,liqPinSy:0,velSamples:[],momentumRaf:null,momentumVx:0,momentumVy:0,momentumZone:0,lastTapTime:0,lastTapX:0,lastTapY:0,drawingMode:null},w=.92,e=.5,a=80;s.recordVelocity=function(u,g){let _=performance.now();for(s.velSamples.push({dx:u,dy:g,t:_});s.velSamples.length>0&&_-s.velSamples[0].t>a;)s.velSamples.shift()};function r(){if(s.velSamples.length<2)return{vx:0,vy:0};let u=s.velSamples[0],_=s.velSamples[s.velSamples.length-1].t-u.t;if(_<5)return{vx:0,vy:0};let l=0,d=0;for(let h of s.velSamples)l+=h.dx,d+=h.dy;let p=16.67;return{vx:l/_*p,vy:d/_*p}}s.cancelMomentum=function(){s.momentumRaf&&(cancelAnimationFrame(s.momentumRaf),s.momentumRaf=null),s.velSamples=[]},s.startMomentum=function(u){let{vx:g,vy:_}=r();if(s.velSamples=[],Math.abs(g)<e&&Math.abs(_)<e)return;s.momentumVx=g,s.momentumVy=_,s.momentumZone=u;function l(){if(s.momentumVx*=w,s.momentumVy*=w,Math.abs(s.momentumVx)<e&&Math.abs(s.momentumVy)<e){s.momentumRaf=null;return}s.momentumZone===2?o.pan_x(s.momentumVx):s.momentumZone===3?o.pan_y(s.momentumVy):W(s.momentumZone)?o.pan_indicator_y(Q(s.momentumZone),s.momentumVy):nt(o,s.momentumZone,s.momentumVx,s.momentumVy),n.onDirty(),s.momentumRaf=requestAnimationFrame(l)}s.momentumRaf=requestAnimationFrame(l)};let i={setMode(u,g){u?(s.drawingMode={tool:u,style:g,step:0,x1:0,y1:0},t.style.cursor="crosshair"):(s.drawingMode?.pathStarted&&o.finish_path(),s.drawingMode=null,o.clear_drawing_preview(),t.style.cursor="crosshair"),n.onDirty()},getMode(){return s.drawingMode}};n.drawingApi?.(i),s.finishDrawing=function(){o.clear_drawing_preview(),n.onDrawingComplete?.(),s.drawingMode=null,t.style.cursor="crosshair"},ie(t,o,n,s),ae(t,o,n,s);let f=u=>{let g=document.activeElement?.tagName,_=g==="INPUT"||g==="TEXTAREA"||document.activeElement?.isContentEditable;if((u.key==="Delete"||u.key==="Backspace")&&!s.drawingMode&&!_){let d=o.get_selected_drawing();if(d>0){o.remove_drawing(d),n.onDrawingSelected?.(0),n.onDirty();return}let p=o.get_selected_marker();if(p>0){o.remove_marker(p),n.onMarkerSelected?.(0),n.onDirty();return}}if(u.key==="Escape"&&!s.drawingMode){if(o.get_selected_drawing()>0){o.deselect_drawing(),n.onDrawingSelected?.(0),n.onDirty();return}if(o.get_selected_marker()>0){o.deselect_marker(),n.onMarkerSelected?.(0),n.onDirty();return}}if(u.key==="Escape"&&s.drawingMode){if(s.drawingMode.pathStarted){s.drawingMode.tool==="elliott"?o.finish_elliott_manual():o.finish_path(),s.finishDrawing(),n.onDirty();return}o.clear_drawing_preview(),s.drawingMode=null,t.style.cursor="crosshair",n.onDrawingCancel?.(),n.onDirty();return}let l=20;switch(u.key){case"+":case"=":o.zoom(t.width/2,t.height/2,.9);break;case"-":o.zoom(t.width/2,t.height/2,1.1);break;case"ArrowLeft":o.pan_x(l);break;case"ArrowRight":o.pan_x(-l);break;case"ArrowUp":o.pan_y(-l);break;case"ArrowDown":o.pan_y(l);break;case"r":case"R":o.auto_scale_y();for(let d=1;d<=5;d++)o.reset_indicator_y_auto(d);break;default:return}n.onDirty()};return window.addEventListener("keydown",f),()=>{s.disposed=!0,s.cancelMomentum(),window.removeEventListener("keydown",f)}}function ue(t,o,n,s){let w=e=>s()(e);return{enableRsi(){t.enable_rsi(),o()},disableRsi(){t.disable_rsi(),o()},setRsiPeriod(e){t.set_rsi_period(e),o()},isRsiEnabled(){return t.is_rsi_enabled()},setRsiShowEma(e){t.set_rsi_show_ema(e),o()},setRsiShowWma(e){t.set_rsi_show_wma(e),o()},setRsiShowSignals(e){t.set_rsi_show_signals(e),o()},setRsiShowDivergence(e){t.set_rsi_show_divergence(e),o()},setRsiShowTraps(e){t.set_rsi_show_traps(e),o()},setRsiSmoothing(e){t.set_rsi_smoothing(e),o()},setRsiRatio(e){t.set_rsi_ratio(e),o()},getRsiRatio(){return t.get_rsi_ratio()},enableForexSignals(){w("forexSignals")&&(t.enable_forex_signals(),o())},disableForexSignals(){t.disable_forex_signals(),o()},isForexSignalsEnabled(){return t.is_forex_signals_enabled()},setForexSignalsSetup(e){t.set_forex_signals_setup(e),o()},setForexSignalsMode(e){t.set_forex_signals_mode(e),o()},setForexSignalsShowStats(e){t.set_forex_signals_show_stats(e),o()},getForexSignalsCount(){return t.get_forex_signals_count()},enableOi(){n()||w("oi")&&(t.enable_oi(),o())},disableOi(){n()||(t.disable_oi(),o())},isOiEnabled(){if(n())return!1;try{return t.is_oi_enabled()}catch{return!1}},setOiData(e){n()||(t.set_oi_data(e),o())},setOiDataTs(e,a){n()||(t.set_oi_data_ts(e,a),o())},setOiShowOnChart(e){n()||(t.set_oi_show_on_chart(e),o())},setOiDisplayMode(e){n()||(t.set_oi_display_mode(e),o())},setOiRatio(e){n()||(t.set_oi_ratio(e),o())},getOiRatio(){if(n())return .2;try{return t.get_oi_ratio()}catch{return .2}},enableFundingRate(){n()||w("fundingRate")&&(t.enable_funding_rate(),o())},disableFundingRate(){n()||(t.disable_funding_rate(),o())},isFundingRateEnabled(){if(n())return!1;try{return t.is_funding_rate_enabled()}catch{return!1}},setFrBinanceData(e,a){n()||(t.set_fr_binance_data(e,a),o())},setFrAggData(e,a){n()||(t.set_fr_agg_data(e,a),o())},setFrShowAgg(e){n()||(t.set_fr_show_agg(e),o())},setFrShowSma(e){n()||(t.set_fr_show_sma(e),o())},enableCvd(){n()||w("cvd")&&(t.enable_cvd(),o())},disableCvd(){n()||(t.disable_cvd(),o())},isCvdEnabled(){if(n())return!1;try{return t.is_cvd_enabled()}catch{return!1}},setCvdData(e,a){n()||(t.set_cvd_data(e,a),o())},setCvdSpotData(e,a){n()||(t.set_cvd_spot_data(e,a),o())},setCvdSource(e){n()||(t.set_cvd_source(e),o())},getCvdSource(){if(n())return 0;try{return t.get_cvd_source()}catch{return 0}},setCvdMode(e){n()||(t.set_cvd_mode(e),o())},getCvdMode(){if(n())return 0;try{return t.get_cvd_mode()}catch{return 0}},setCvdShowDelta(e){n()||(t.set_cvd_show_delta(e),o())},getCvdShowDelta(){if(n())return!0;try{return t.get_cvd_show_delta()}catch{return!0}},setCvdShowSignals(e){n()||(t.set_cvd_show_signals(e),o())},getCvdShowSignals(){if(n())return!0;try{return t.get_cvd_show_signals()}catch{return!0}},setCvdShowDivergence(e){n()||(t.set_cvd_show_divergence(e),o())},getCvdShowDivergence(){if(n())return!1;try{return t.get_cvd_show_divergence()}catch{return!1}},enableLargeTrades(){n()||w("largeTrades")&&(t.enable_large_trades(),o())},disableLargeTrades(){n()||(t.disable_large_trades(),o())},isLargeTradesEnabled(){if(n())return!1;try{return t.is_large_trades_enabled()}catch{return!1}},setLargeTradesData(e){n()||(t.set_large_trades_data(e),o())},pushLargeTrade(e,a,r,i){n()||(t.push_large_trade(e,a,r,i),o())},clearLargeTrades(){n()||(t.clear_large_trades(),o())},setLtVolumeFilter(e,a){n()||(t.set_lt_volume_filter(e,a),o())},setLtBubbleScale(e){n()||(t.set_lt_bubble_scale(e),o())},getLtDataMinVol(){return n()?0:t.get_lt_data_min_vol()},getLtDataMaxVol(){return n()?0:t.get_lt_data_max_vol()},ltHitTest(e,a){if(n())return"";try{return t.lt_hit_test(e,a)}catch{return""}},enableVrvp(){n()||w("vrvp")&&(t.enable_vrvp(),o())},disableVrvp(){n()||(t.disable_vrvp(),o())},isVrvpEnabled(){if(n())return!1;try{return t.is_vrvp_enabled()}catch{return!1}},setVrvpPocLine(e){n()||(t.set_vrvp_poc_line(e),o())},vrvpHitTest(e,a){if(n())return"";try{return t.vrvp_hit_test(e,a)}catch{return""}},enableTpo(){n()||w("tpo")&&(t.enable_tpo(),o())},disableTpo(){n()||(t.disable_tpo(),o())},isTpoEnabled(){if(n())return!1;try{return t.is_tpo_enabled()}catch{return!1}},setTpoPocLine(e){n()||(t.set_tpo_poc_line(e),o())},setTpoVaLines(e){n()||(t.set_tpo_va_lines(e),o())},setTpoIb(e){n()||(t.set_tpo_ib(e),o())},setTpoSinglePrints(e){n()||(t.set_tpo_single_prints(e),o())},setTpoPeriod(e){n()||(t.set_tpo_period(e),o())},getTpoPeriod(){if(n())return 1440;try{return t.get_tpo_period()}catch{return 1440}},setTpoNakedPoc(e){n()||(t.set_tpo_naked_poc(e),o())},setTpoProfileShape(e){n()||(t.set_tpo_profile_shape(e),o())},setTpoIbMinutes(e){n()||(t.set_tpo_ib_minutes(e),o())},setTpoLetterMinutes(e){n()||(t.set_tpo_letter_minutes(e),o())},setTpoSignals(e){n()||(t.set_tpo_signals(e),o())},isTpoSignals(){if(n())return!1;try{return t.is_tpo_signals()}catch{return!1}},enableLiqHeatmap(){n()||w("liqHeatmap")&&(t.enable_liq_heatmap(),o())},disableLiqHeatmap(){n()||(t.disable_liq_heatmap(),o())},isLiqHeatmapEnabled(){if(n())return!1;try{return t.is_liq_heatmap_enabled()}catch{return!1}},setLiqHeatmapRange(e,a){n()||(t.set_liq_heatmap_range(e,a),o())},getLiqHeatmapMin(){if(n())return 0;try{return t.get_liq_heatmap_min()}catch{return 0}},getLiqHeatmapMax(){if(n())return 1;try{return t.get_liq_heatmap_max()}catch{return 1}},getLiqHeatmapSegMax(){if(n())return 0;try{return t.get_liq_heatmap_seg_max()}catch{return 0}},setLiqHeatmapProfile(e){n()||(t.set_liq_heatmap_profile(e),o())},isLiqHeatmapProfile(){if(n())return!0;try{return t.is_liq_heatmap_profile()}catch{return!0}},setLiqHeatmapCellHeight(e){n()||(t.set_liq_heatmap_cell_height(e),o())},getLiqHeatmapCellHeight(){if(n())return 1;try{return t.get_liq_heatmap_cell_height()}catch{return 1}},setLiqHeatmapPredictions(e){n()||(t.set_liq_heatmap_predictions(e),o())},setLiqHeatmapFilledPct(e){n()||(t.set_liq_heatmap_filled_pct(e),o())},getLiqHeatmapFilledPct(){if(n())return .85;try{return t.get_liq_heatmap_filled_pct()}catch{return .85}},liqHeatmapHitTest(e,a){if(n())return"";try{return t.liq_heatmap_hit_test(e,a)}catch{return""}},liqZoneHitTest(e,a){if(n())return"";try{return t.liq_zone_hit_test(e,a)}catch{return""}},enableSmartRanges(){n()||w("smartRanges")&&(t.enable_smart_ranges(),o())},disableSmartRanges(){n()||(t.disable_smart_ranges(),o())},isSmartRangesEnabled(){if(n())return!1;try{return t.is_smart_ranges_enabled()}catch{return!1}},setSrTextSize(e){n()||(t.set_sr_text_size(e),o())},setSrShowOb(e){n()||(t.set_sr_show_ob(e),o())},setSrObLast(e){n()||(t.set_sr_ob_last(e),o())},setSrShowObActivity(e){n()||(t.set_sr_show_ob_activity(e),o())},setSrShowBreakers(e){n()||(t.set_sr_show_breakers(e),o())},setSrMitigation(e){n()||(t.set_sr_mitigation(e),o())},setSrShowMetrics(e){n()||(t.set_sr_show_metrics(e),o())},setSrShowHtfOb(e){n()||(t.set_sr_show_htf_ob(e),o())},setSrHtfMinutes(e){n()||(t.set_sr_htf_minutes(e),o())},setSrShowFvg(e){n()||(t.set_sr_show_fvg(e),o())},setSrFvgTheme(e){n()||(t.set_sr_fvg_theme(e),o())},setSrFvgMitigation(e){n()||(t.set_sr_fvg_mitigation(e),o())},setSrFvgHtf(e){n()||(t.set_sr_fvg_htf(e),o())},setSrFvgExtend(e){n()||(t.set_sr_fvg_extend(e),o())},setSrShowObSignals(e){n()||(t.set_sr_show_ob_signals(e),o())},setSrShowPredict(e){n()||(t.set_sr_show_predict(e),o())},setSrShowFvgSignals(e){n()||(t.set_sr_show_fvg_signals(e),o())},setSrShowSmartRev(e){n()||(t.set_sr_show_smart_rev(e),o())},setSrSmartRevHtf(e){n()||(t.set_sr_smart_rev_htf(e),o())},setSrStatsType(e){n()||(t.set_sr_stats_type(e),o())},setSrStatsPosition(e){n()||(t.set_sr_stats_position(e),o())},getSrSignalsCount(){if(n())return 0;try{return t.get_sr_signals_count()}catch{return 0}},enableEmaStructure(){n()||w("emaStructure")&&(t.enable_ema_structure(),o())},disableEmaStructure(){n()||(t.disable_ema_structure(),o())},isEmaStructureEnabled(){if(n())return!1;try{return t.is_ema_structure_enabled()}catch{return!1}},setEsEma1Len(e){n()||(t.set_es_ema1_len(e),o())},setEsEma2Len(e){n()||(t.set_es_ema2_len(e),o())},setEsWmaLen(e){n()||(t.set_es_wma_len(e),o())},setEsShowEma1(e){n()||(t.set_es_show_ema1(e),o())},setEsShowEma2(e){n()||(t.set_es_show_ema2(e),o())},setEsShowWma(e){n()||(t.set_es_show_wma(e),o())},setEsSwingLen(e){n()||(t.set_es_swing_len(e),o())},setEsShowBos(e){n()||(t.set_es_show_bos(e),o())},enableLiveSignals(){n()||(t.enable_live_signals(),o())},disableLiveSignals(){n()||(t.disable_live_signals(),o())},isLiveSignalsEnabled(){if(n())return!1;try{return t.is_live_signals_enabled()}catch{return!1}},setLiveSignalsData(e){n()||(t.set_live_signals_data(new Float64Array(e)),o())},clearLiveSignals(){n()||(t.clear_live_signals(),o())},setLiveSignalsLeverage(e){n()||(t.set_live_signals_leverage(e),o())},getLiveSignalsLeverage(){if(n())return 10;try{return t.get_live_signals_leverage()}catch{return 10}},setLiveSignalsTrial(e){n()||(t.set_live_signals_trial(e),o())},setLiveSignalsShowEntry(e){n()||(t.set_live_signals_show_entry(e),o())},setLiveSignalsShowTpSl(e){n()||(t.set_live_signals_show_tp_sl(e),o())},setLiveSignalsShowMaxProfit(e){n()||(t.set_live_signals_show_max_profit(e),o())},setLiveSignalsShowLabels(e){n()||(t.set_live_signals_show_labels(e),o())},setLiveSignalsShowZones(e){n()||(t.set_live_signals_show_zones(e),o())},setLiveSignalsTextSize(e){n()||(t.set_live_signals_text_size(e),o())},setLiveSignalsPipValue(e){n()||(t.set_live_signals_pip_value(e),o())},setLiveSignalsLoading(e){n()||(t.set_live_signals_loading(e),o())},getLiveSignalsCount(){if(n())return 0;try{return t.get_live_signals_count()}catch{return 0}},enableVpin(){n()||w("vpin")&&(t.enable_vpin(),o())},disableVpin(){n()||(t.disable_vpin(),o())},isVpinEnabled(){if(n())return!1;try{return t.is_vpin_enabled()}catch{return!1}},setVpinData(e,a){n()||(t.set_vpin_data(e,a),o())},setVpinBucketSize(e){n()||(t.set_vpin_bucket_size(e),o())},getVpinBucketSize(){if(n())return 50;try{return t.get_vpin_bucket_size()}catch{return 50}},setVpinNumBuckets(e){n()||(t.set_vpin_num_buckets(e),o())},getVpinNumBuckets(){if(n())return 50;try{return t.get_vpin_num_buckets()}catch{return 50}},setVpinThreshold(e){n()||(t.set_vpin_threshold(e),o())},getVpinThreshold(){if(n())return .7;try{return t.get_vpin_threshold()}catch{return .7}},setVpinShowSma(e){n()||(t.set_vpin_show_sma(e),o())},setVpinShowZones(e){n()||(t.set_vpin_show_zones(e),o())},enableStopIceberg(){n()||w("stopIceberg")&&(t.enable_stop_iceberg(),o())},disableStopIceberg(){n()||(t.disable_stop_iceberg(),o())},isStopIcebergEnabled(){if(n())return!1;try{return t.is_stop_iceberg_enabled()}catch{return!1}},setSiShowStops(e){n()||(t.set_si_show_stops(e),o())},setSiShowIcebergs(e){n()||(t.set_si_show_icebergs(e),o())},setSiShowZones(e){n()||(t.set_si_show_zones(e),o())},setIcebergEvents(e,a,r,i,f,u){n()||(t.set_iceberg_events(e,a,r,i,f,u),o())},getStopRunCount(){if(n())return 0;try{return t.get_stop_run_count()}catch{return 0}},getIcebergCount(){if(n())return 0;try{return t.get_iceberg_count()}catch{return 0}},enableVolume(){t.enable_volume(),o()},disableVolume(){t.disable_volume(),o()},isVolumeEnabled(){return t.is_volume_enabled()},setVolumeMaPeriod(e){t.set_volume_ma_period(e),o()},setVolumeShowMa(e){t.set_volume_show_ma(e),o()},setVolumeShowSignals(e){t.set_volume_show_signals(e),o()},setVolumeColorMode(e){t.set_volume_color_mode(e),o()},getVolumeMaPeriod(){return t.get_volume_ma_period()},getVolumeShowMa(){return t.get_volume_show_ma()},getVolumeShowSignals(){return t.get_volume_show_signals()},getVolumeColorMode(){return t.get_volume_color_mode()},enableObSignals(){t.enable_ob_signals(),o()},disableObSignals(){t.disable_ob_signals(),o()},isObSignalsEnabled(){return t.is_ob_signals_enabled()},setObsShowWalls(e){t.set_obs_show_walls(e),o()},setObsShowGaps(e){t.set_obs_show_gaps(e),o()},setObsShowAlerts(e){t.set_obs_show_alerts(e),o()},setObsShowCom(e){t.set_obs_show_com(e),o()},setObsWalls(e,a){t.set_obs_walls(new Float64Array(e),new Float64Array(a)),o()},setObsGaps(e,a){t.set_obs_gaps(new Float64Array(e),new Float64Array(a)),o()},pushObsAlert(e,a,r,i,f){t.push_obs_alert(e,a,r,i,f),o()},setObsCom(e){t.set_obs_com(e),o()},clearObSignals(){t.clear_ob_signals(),o()},enableObFlow(){t.enable_ob_flow(),o()},disableObFlow(){t.disable_ob_flow(),o()},isObFlowEnabled(){return t.is_ob_flow_enabled()},setObfShowObi(e){t.set_obf_show_obi(e),o()},setObfShowNetFlow(e){t.set_obf_show_net_flow(e),o()},setObfShowCumDelta(e){t.set_obf_show_cum_delta(e),o()},pushObfSample(e,a,r,i){t.push_obf_sample(e,a,r,i),o()},setObfData(e){t.set_obf_data(new Float64Array(e)),o()},clearObFlow(){t.clear_ob_flow(),o()},setObfRatio(e){t.set_obf_ratio(e),o()},getObfRatio(){return t.get_obf_ratio()}}}function fe(t,o,n,s){let w=a=>s()(a),e=(a,r,i)=>a<=1&&r<=1&&i<=1&&(a>0||r>0||i>0)?[Math.round(a*255),Math.round(r*255),Math.round(i*255)]:[a&255,r&255,i&255];return{addMarker(a,r,i){t.add_marker(a,r,i),o()},clearMarkers(){t.clear_markers(),o()},hitTestMarker(a,r){return t.hit_test_marker(a,r)},selectMarker(a){t.select_marker(a),o()},deselectMarker(){t.deselect_marker(),o()},getSelectedMarker(){return t.get_selected_marker()},removeMarker(a){t.remove_marker(a),o()},deleteSelectedMarker(){let a=t.get_selected_marker();return a>0&&(t.remove_marker(a),o()),a},addTrendline(a,r,i,f,u,g,_,l,d,p=0){let[h,c,m]=e(u,g,_),M=t.add_trendline(a,r,i,f,h,c,m,l,d,p);return o(),M},addHorizontalLine(a,r,i,f,u,g,_,l=0){let[d,p,h]=e(i,f,u),c=t.add_horizontal_line(a,r,d,p,h,g,_,l);return o(),c},addArrow(a,r,i,f,u,g,_,l,d,p=0){let[h,c,m]=e(u,g,_),M=t.add_arrow(a,r,i,f,h,c,m,l,d,p);return o(),M},addFibRetracement(a,r,i,f,u,g,_,l,d,p=0){if(!w("drawingFull"))return 0;let[h,c,m]=e(u,g,_),M=t.add_fib_retracement(a,r,i,f,h,c,m,l,d,p);return o(),M},addFibExtension(a,r,i,f,u,g,_,l,d,p,h,c=0){if(!w("drawingFull"))return 0;let[m,M,I]=e(_,l,d),A=t.add_fib_extension(a,r,i,f,u,g,m,M,I,p,h,c);return o(),A},addLongPosition(a,r,i,f,u,g,_,l,d,p=0){if(!w("drawingFull"))return 0;let[h,c,m]=e(u,g,_),M=t.add_long_position(a,r,i,f,h,c,m,l,d,p);return o(),M},addShortPosition(a,r,i,f,u,g,_,l,d,p=0){if(!w("drawingFull"))return 0;let[h,c,m]=e(u,g,_),M=t.add_short_position(a,r,i,f,h,c,m,l,d,p);return o(),M},addAnchoredVwap(a,r,i,f,u,g,_=0){if(!w("drawingFull"))return 0;let[l,d,p]=e(r,i,f),h=t.add_anchored_vwap(a,l,d,p,u,g,_);return o(),h},addPriceLabel(a,r,i,f,u,g,_=0){let[l,d,p]=e(i,f,u),h=t.add_price_label(a,r,l,d,p,g,_);return o(),h},addElliottImpulse(a,r,i,f,u,g,_=0){if(!w("drawingFull"))return 0;let[l,d,p]=e(i,f,u),h=t.add_elliott_impulse(a,r,l,d,p,g,_);return o(),h},setDrawingFontSize(a,r){t.set_drawing_font_size(a,r),o()},getDrawingFontSize(a){return t.get_drawing_font_size(a)},setDrawingText(a,r){t.set_drawing_text(a,r),o()},getDrawingText(a){return t.get_drawing_text(a)},setDrawingStyle(a,r,i,f,u){let[g,_,l]=e(r,i,f);t.set_drawing_style(a,g,_,l,u),o()},getDrawingColor(a){let r=t.get_drawing_color(a);return r?{r:r>>>24&255,g:r>>>16&255,b:r>>>8&255,lineWidth:(r&255)/10}:null},getDrawingDashed(a){try{return t.get_drawing_dashed(a)}catch{return!1}},setDrawingDashed(a,r){t.set_drawing_dashed(a,r),o()},getDrawingHideLabel(a){try{return t.get_drawing_hide_label(a)}catch{return!1}},setDrawingHideLabel(a,r){t.set_drawing_hide_label(a,r),o()},getDrawingKindId(a){try{return t.get_drawing_kind_id(a)}catch{return 255}},removeDrawing(a){t.remove_drawing(a),o()},clearDrawings(){t.clear_drawings(),o()},drawingCount(){return t.drawing_count()},setDrawingPreview(a,r,i,f,u,g,_,l,d,p,h=0){let[c,m,M]=e(g,_,l);t.set_drawing_preview(a,r,i,f,u,c,m,M,d,p,h),o()},clearDrawingPreview(){t.clear_drawing_preview(),o()},cancelBrush(){t.cancel_brush(),o()},selectDrawing(a){t.select_drawing(a),o()},deselectDrawing(){t.deselect_drawing(),o()},getSelectedDrawing(){return t.get_selected_drawing()},deleteSelectedDrawing(){let a=t.get_selected_drawing();return a>0&&(t.remove_drawing(a),o()),a},exportDrawingsJson(){try{return t.export_drawings_json()}catch{return"[]"}},importDrawingsJson(a){try{t.import_drawings_json(a),o()}catch(r){console.warn("[bridge] importDrawingsJson failed",r)}},screenToWorld(a,r){return{x:t.screen_to_world_x(a),y:t.screen_to_world_y(r)}},worldToScreen(a,r){try{return{x:t.world_to_screen_x(a),y:t.world_to_screen_y(r)}}catch{return null}}}}var O=t=>t instanceof Float64Array?t:new Float64Array(t);function _e(t,o,n,s){let w=e=>s()(e);return{setKlines(e,a,r,i,f,u){t.set_klines(O(e),O(a),O(r),O(i),O(f),O(u)),o()},setRealTimestamps(e){t.set_real_timestamps(O(e)),o()},appendRealTimestamp(e){t.append_real_timestamp(e)},prependKlines(e,a,r,i,f,u){t.prepend_klines(O(e),O(a),O(r),O(i),O(f),O(u)),o()},appendKline(e,a,r,i,f,u){t.append_kline(e,a,r,i,f,u),o()},updateLastKline(e,a,r,i,f,u){t.update_last_kline(e,a,r,i,f,u),o()},popLastKline(){let e=t.pop_last_kline();return e&&o(),e},getLastClose(){try{return t.get_last_close()}catch{return 0}},getKlineCount(){if(n())return 0;try{return t.kline_count()}catch{return 0}},getKlineTimestamps(){if(n())return null;try{return t.kline_timestamps()}catch{return null}},getKlineOpens(){if(n())return null;try{return t.kline_opens()}catch{return null}},getKlineHighs(){if(n())return null;try{return t.kline_highs()}catch{return null}},getKlineLows(){if(n())return null;try{return t.kline_lows()}catch{return null}},getKlineCloses(){if(n())return null;try{return t.kline_closes()}catch{return null}},getKlineVolumes(){if(n())return null;try{return t.kline_volumes()}catch{return null}},setHeatmap(e,a,r,i,f,u,g){w("heatmap")&&(t.set_heatmap(O(e),a,r,i,f,u,g),o())},appendHeatmapColumn(e,a,r,i){w("heatmap")&&(t.append_heatmap_column(O(e),a,r,i),o())},updateLastHeatmapColumn(e,a,r){t.update_last_heatmap_column(O(e),a,r),o()},getHeatmapLastTimestamp(){try{return t.get_heatmap_last_timestamp()}catch{return 0}},getHeatmapXStep(){try{return t.get_heatmap_x_step()}catch{return 0}},updateHeatmapColumnAt(e,a,r,i){t.update_heatmap_column_at(O(e),a,r,i),o()},setHeatmapRange(e,a){t.set_heatmap_range(e,a),o()},getHeatmapDataRange(){try{return{min:t.get_heatmap_data_min(),max:t.get_heatmap_data_max()}}catch{return{min:0,max:0}}},setHeatmapPrefetchRange(e){try{t.set_heatmap_prefetch_range(e)}catch{}},clearHeatmapPrefetchRange(){try{t.clear_heatmap_prefetch_range()}catch{}},getHeatmapPrefetchMax(){try{return t.get_heatmap_prefetch_max()}catch{return 0}},setChartType(e){n()||e===2&&!w("footprint")||(t.set_chart_type(e),o())},getChartType(){if(n())return 0;try{return t.get_chart_type()}catch{return 0}},setFootprintTickSize(e){n()||w("footprint")&&(t.set_footprint_tick_size(e),o())},footprintEnsureLen(e){n()||t.footprint_ensure_len(e)},footprintAddTrade(e,a,r,i){n()||t.footprint_add_trade(e,a,r,i)},footprintAddTradeBatch(e){n()||!e||e.length===0||t.footprint_add_trade_batch(O(e))},footprintSetBar(e,a,r,i,f){n()||(t.footprint_set_bar(e,a,r,i,f),o())},footprintClear(){n()||(t.footprint_clear(),o())},footprintClearBar(e){n()||t.footprint_clear_bar(e)},footprintPrependEmpty(e){n()||t.footprint_prepend_empty(e)},footprintSetShowSignals(e){n()||(t.footprint_set_show_signals(e),o())},footprintGetShowSignals(){if(n())return!0;try{return t.footprint_get_show_signals()}catch{return!0}},footprintSignalCount(){if(n())return 0;try{return t.footprint_signal_count()}catch{return 0}},footprintSetShowProfile(e){n()||(t.footprint_set_show_profile(e),o())},footprintGetShowProfile(){if(n())return!1;try{return t.footprint_get_show_profile()}catch{return!1}},footprintProfileHitTest(e,a){if(n())return"";try{return t.footprint_profile_hit_test(e,a)}catch{return""}},footprintSetDisplayMode(e){n()||(t.footprint_set_display_mode(e),o())},footprintGetDisplayMode(){if(n())return 0;try{return t.footprint_get_display_mode()}catch{return 0}},enableDeltaHistogram(){n()||t.enable_delta_histogram()},disableDeltaHistogram(){n()||t.disable_delta_histogram()},deltaHistogramEnabled(){if(n())return!1;try{return t.delta_histogram_enabled()}catch{return!1}}}}var Ve=1;function H(t){if(typeof t!="string")return{r:255,g:255,b:255,a:153};if(t.startsWith("#")){let n=t.slice(1);if(n.length===8)return{r:parseInt(n.slice(0,2),16),g:parseInt(n.slice(2,4),16),b:parseInt(n.slice(4,6),16),a:parseInt(n.slice(6,8),16)};let s=parseInt(n.slice(0,2),16),w=parseInt(n.slice(2,4),16),e=parseInt(n.slice(4,6),16);return{r:s,g:w,b:e,a:255}}let o=t.match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*([\d.]+))?\)/);return o?{r:+o[1],g:+o[2],b:+o[3],a:o[4]!==void 0?Math.round(+o[4]*255):255}:{r:255,g:255,b:255,a:153}}function Ot(t,o,n){let s=new Map,w=null,e=0,a=NaN;function r(){let _;try{_=t.kline_count()}catch{return w}if(_===0)return null;let l=t.kline_closes(),d=l?.[_-1]??NaN;if(w&&!(_!==e||d!==a))return w;try{let h=t.kline_timestamps(),c=t.kline_opens(),m=t.kline_highs(),M=t.kline_lows(),I=t.kline_volumes();if(!h||!l)return w;w={timestamps:Array.from(h),open:Array.from(c),high:Array.from(m),low:Array.from(M),close:Array.from(l),volume:Array.from(I),length:_},e=_,a=d;for(let A of s.values())A._needsCompute=!0}catch{}return w}function i(){return{seriesLine(_,l="#ffffff99",d=1.5){let p=H(l);t.custom_series_line(new Float64Array(_),p.r,p.g,p.b,p.a,d)},seriesDashedLine(_,l="#ffffff66",d=1,p=4,h=4){let c=H(l);t.custom_series_dashed_line(new Float64Array(_),c.r,c.g,c.b,c.a,d,p,h)},band(_,l,d="rgba(100,149,237,0.08)"){let p=H(d);t.custom_band(new Float64Array(_),new Float64Array(l),p.r,p.g,p.b,p.a)},hline(_,l="#ffffff66",d=1){let p=H(l);t.custom_hline(_,p.r,p.g,p.b,p.a,d)},dashedHline(_,l="#ffffff66",d=1,p=6,h=4){let c=H(l);t.custom_dashed_hline(_,c.r,c.g,c.b,c.a,d,p,h)},marker(_,l,d="#e8a04a",p=3){let h=H(d);t.custom_marker(_,l,h.r,h.g,h.b,h.a,p)},markerUp(_,l,d="#26a69a",p=5){let h=H(d);t.custom_marker_up(_,l,h.r,h.g,h.b,h.a,p)},markerDown(_,l,d="#ef5350",p=5){let h=H(d);t.custom_marker_down(_,l,h.r,h.g,h.b,h.a,p)},text(_,l,d,p="#ffffffaa",h=10,c="center"){let m=H(p),M=c==="center"?1:c==="right"?2:0;t.custom_text(_,l,d,m.r,m.g,m.b,m.a,h,M)},priceLabel(_,l,d="#ffffffaa",p=10){let h=H(d);t.custom_price_label(_,l,h.r,h.g,h.b,h.a,p)},linePx(_,l,d,p,h,c=1){let m=H(h);t.custom_line_px(_,l,d,p,m.r,m.g,m.b,m.a,c)},fillRectPx(_,l,d,p,h){let c=H(h);t.custom_fill_rect_px(_,l,d,p,c.r,c.g,c.b,c.a)},strokeRectPx(_,l,d,p,h,c=1){let m=H(h);t.custom_stroke_rect_px(_,l,d,p,m.r,m.g,m.b,m.a,c)},textPx(_,l,d,p,h=10,c="left"){let m=H(p),M=c==="center"?1:c==="right"?2:0;t.custom_text_px(_,l,d,m.r,m.g,m.b,m.a,h,M)},worldToScreenX:_=>t.world_to_screen_x(_),worldToScreenY:_=>t.world_to_screen_y(_),screenToWorldX:_=>t.screen_to_world_x(_),screenToWorldY:_=>t.screen_to_world_y(_),chartArea:()=>({x:t.chart_area_x(),y:t.chart_area_y(),w:t.chart_area_w(),h:t.chart_area_h()})}}function f(_){if(!_.compute)return;let l=r();if(l)try{_._computed=_.compute(l,_.params)||{}}catch(d){console.warn(`[CustomIndicator "${_.name}"] compute error:`,d),_._computed={}}}function u(_){if(s.size===0)return;let l=r();if(!l)return;t.custom_begin();let d=i();for(let h of s.values())if(h.enabled){h._needsCompute&&(f(h),h._needsCompute=!1);try{h.render.call(h,d,h._computed||{},l)}catch(c){console.warn(`[CustomIndicator "${h.name}"] render error:`,c)}}if(t.custom_end(),t.custom_command_count()>0){let h=t.get_custom_buffer_ptr(),c=t.get_custom_buffer_len();n(_,o,h,c)}}function g(){w=null,e=0,a=NaN;for(let _ of s.values())_._needsCompute=!0}return{add(_){let l=Ve++,d={id:l,name:_.name||`Custom ${l}`,params:{..._.params},compute:_.compute||null,render:_.render,enabled:!0,_computed:{},_needsCompute:!0};return s.set(l,d),l},remove(_){s.delete(_)},updateParams(_,l){let d=s.get(_);d&&(Object.assign(d.params,l),d._needsCompute=!0)},setEnabled(_,l){let d=s.get(_);d&&(d.enabled=l)},list(){return[...s.values()].map(_=>({id:_.id,name:_.name,params:{..._.params},enabled:_.enabled}))},invalidateCompute:g,renderAll:u}}var ce={trial:{candlestick:!0,volume:!0,rsi:!0,drawingBasic:!0,drawingFull:!0,heatmap:!0,footprint:!0,liqHeatmap:!0,oi:!0,fundingRate:!0,cvd:!0,largeTrades:!0,vrvp:!0,tpo:!0,smartRanges:!0,emaStructure:!0,customIndicators:!0,forexSignals:!0,vpin:!0,stopIceberg:!0},standard:{candlestick:!0,volume:!0,rsi:!0,drawingBasic:!0,drawingFull:!1,heatmap:!1,footprint:!1,liqHeatmap:!1,oi:!1,fundingRate:!1,cvd:!1,largeTrades:!1,vrvp:!1,tpo:!1,smartRanges:!1,emaStructure:!1,customIndicators:!1,forexSignals:!1,vpin:!1,stopIceberg:!1},professional:{candlestick:!0,volume:!0,rsi:!0,drawingBasic:!0,drawingFull:!0,heatmap:!0,footprint:!0,liqHeatmap:!0,oi:!0,fundingRate:!0,cvd:!0,largeTrades:!0,vrvp:!1,tpo:!1,smartRanges:!1,emaStructure:!1,customIndicators:!1,forexSignals:!1,vpin:!1,stopIceberg:!1},enterprise:{candlestick:!0,volume:!0,rsi:!0,drawingBasic:!0,drawingFull:!0,heatmap:!0,footprint:!0,liqHeatmap:!0,oi:!0,fundingRate:!0,cvd:!0,largeTrades:!0,vrvp:!0,tpo:!0,smartRanges:!0,emaStructure:!0,customIndicators:!0,forexSignals:!0,vpin:!0,stopIceberg:!0}},Be={rsi:"RSI",drawingBasic:"Basic Drawing Tools",heatmap:"Orderbook Heatmap",footprint:"Footprint Chart",liqHeatmap:"Liquidation Heatmap",oi:"Open Interest",fundingRate:"Funding Rate",cvd:"CVD",largeTrades:"Large Trades",vrvp:"VRVP",tpo:"TPO / Market Profile",smartRanges:"Smart Ranges",emaStructure:"EMA Structure",drawingFull:"All Drawing Tools",customIndicators:"Custom Indicators",forexSignals:"Forex Signals",vpin:"VPIN",stopIceberg:"Stops & Icebergs"},Ge={rsi:"Standard",drawingBasic:"Standard",heatmap:"Professional",footprint:"Professional",liqHeatmap:"Professional",oi:"Professional",fundingRate:"Professional",cvd:"Professional",largeTrades:"Professional",drawingFull:"Professional",vrvp:"Enterprise",tpo:"Enterprise",smartRanges:"Enterprise",emaStructure:"Enterprise",customIndicators:"Enterprise",forexSignals:"Enterprise",vpin:"Enterprise",stopIceberg:"Enterprise"};function ct(t){return ce[t]||ce.trial}function zt(t){let o=ct(t),n=new Set;return function(w){if(o[w])return!0;if(!n.has(w)){n.add(w);let e=Be[w]||w,a=Ge[w]||"a higher";console.warn(`[MRD Chart Engine] "${e}" requires ${a} plan. Current plan: ${t}. Upgrade at https://mrd-chart.dev/pricing`)}return!1}}var qe=14,de="trial",mt="free";var Dt=[95,95,109,114].map(t=>String.fromCharCode(t)).join(""),Ke=1297237059;function ge(t){let o=`${t}:${Ke}:${(t^2043453)>>>0}`,n=2166136261;for(let s=0;s<o.length;s++)n^=o.charCodeAt(s),n=Math.imul(n,16777619);return(n>>>0).toString(36)}function Mt(t){return`${t}.${ge(t)}`}function St(t){if(!t||typeof t!="string")return null;let o=t.lastIndexOf(".");if(o<1)return null;let n=parseInt(t.slice(0,o),10);return!n||n<1e9||n>2e9||t.slice(o+1)!==ge(n)?null:n}var me=Dt+"e7x",Me=Dt+"p3q",Se="mrd_engine_session_id",Le="mrd_ce_db",dt="meta",Ie="trial_ts",Ce=Dt+"ck";function Xt(){try{return St(localStorage.getItem(me))}catch{return null}}function Wt(t){try{localStorage.setItem(me,Mt(t))}catch{}}function Ht(){try{return St(localStorage.getItem(Me))}catch{return null}}function Vt(t){try{localStorage.setItem(Me,Mt(t))}catch{}}function Bt(){try{return St(sessionStorage.getItem(Se))}catch{return null}}function Gt(t){try{sessionStorage.setItem(Se,Mt(t))}catch{}}function qt(){try{let t=document.cookie.match(new RegExp(`(?:^|;\\s*)${Ce}=([^;]+)`));return t?St(decodeURIComponent(t[1])):null}catch{return null}}function Kt(t){try{let o=encodeURIComponent(Mt(t));document.cookie=`${Ce}=${o};path=/;max-age=${86400*400};SameSite=Lax`}catch{}}var ht=null,he=!1;function xe(){if(!(he||typeof indexedDB>"u")){he=!0;try{let t=indexedDB.open(Le,1);t.onupgradeneeded=()=>{let o=t.result;o.objectStoreNames.contains(dt)||o.createObjectStore(dt)},t.onsuccess=()=>{let s=t.result.transaction(dt,"readonly").objectStore(dt).get(Ie);s.onsuccess=()=>{let w=St(s.result);w&&(!ht||w<ht)&&(ht=w,Ue(w))}}}catch{}}}function be(t){ht=t;try{let o=indexedDB.open(Le,1);o.onsuccess=()=>{o.result.transaction(dt,"readwrite").objectStore(dt).put(Mt(t),Ie)}}catch{}}function Ue(t){let o=Math.floor(Date.now()/1e3),n=Ae([Xt(),Ht(),Bt(),qt(),t],o);n&&n!==t||n&&(Wt(n),Vt(n),Gt(n),Kt(n))}function Ae(t,o){let n=null;for(let s of t)s&&(s>o+60||s<17e8||(!n||s<n)&&(n=s));return n}function Qe(){let t=Math.floor(Date.now()/1e3),o=[Xt(),Ht(),Bt(),qt(),ht];return Ae(o,t)}function $e(t){Wt(t),Vt(t),Gt(t),Kt(t),be(t)}function Je(t){Xt()||Wt(t),Ht()||Vt(t),Bt()||Gt(t),qt()||Kt(t),ht||be(t)}xe();function vt(t){if(!t||t==="trial")return ke();try{let o=JSON.parse(atob(t)),{p:n,d:s,e:w,s:e}=o;if(!n||!e)return{valid:!1,error:"Invalid license key format"};let a={...o};if(delete a.s,e!==ve(a))return{valid:!1,error:"Invalid license key signature"};if(w>0&&Date.now()/1e3>w)return{valid:!0,plan:mt,watermark:!0,trialExpired:!0,originalPlan:n,error:`License expired on ${new Date(w*1e3).toLocaleDateString()}`,features:ct(mt)};let r=o.pl||"web";if((r==="web"||r==="any")&&s&&s!=="*"&&typeof window<"u"){let i=window.location.hostname;if(i&&i!=="localhost"&&i!=="127.0.0.1"&&i!=="0.0.0.0"&&i!==""&&!s.split(",").map(g=>g.trim()).some(g=>tr(g,i)))return{valid:!1,error:`License not valid for domain: ${i}`}}if(r==="mobile"&&o.a&&typeof window<"u"){let i=window.__mrd_app_id;if(i&&i!==o.a)return{valid:!1,error:`License not valid for app: ${i}`}}return{valid:!0,plan:n,domain:s,platform:r,appId:o.a||null,expiry:w,watermark:!1,features:ct(n)}}catch{return{valid:!1,error:"Invalid license key"}}}function ve(t){let o="mrd-ce-hmac-2024-x9k2m",n=JSON.stringify(t),s=o+":"+n,w=2166136261,e=1818371886,a=3735928559;for(let r=0;r<s.length;r++){let i=s.charCodeAt(r);w=Math.imul(w^i,16777619)>>>0,e=Math.imul(e^i,1540483477)>>>0,a=Math.imul(a^i,461845907)>>>0}return(w.toString(36)+e.toString(36)+a.toString(36)).slice(0,24)}function ke(){let t=Qe();t?Je(t):(t=Math.floor(Date.now()/1e3),$e(t));let o=t+qe*86400,n=Date.now()/1e3,s=Math.max(0,Math.ceil((o-n)/86400));return n>o?{valid:!0,plan:mt,watermark:!0,trialExpired:!0,daysLeft:0,features:ct(mt)}:{valid:!0,plan:de,watermark:!1,daysLeft:s,trialEnd:o,features:ct(de)}}function tr(t,o){if(t==="*"||t===o)return!0;if(t.startsWith("*.")){let n=t.slice(1);return o.endsWith(n)||o===t.slice(2)}return!1}var er="MRD-Indicators",pe="mrd-indicators.com",rr="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iMzAiIHZpZXdCb3g9IjAgMCAzMCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+CiAgPGRlZnM+CiAgICA8c3R5bGU+CiAgICAgIC5jbHMtMSB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtNCk7CiAgICAgIH0KCiAgICAgIC5jbHMtMiB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtMik7CiAgICAgIH0KCiAgICAgIC5jbHMtMiwgLmNscy0zLCAuY2xzLTQsIC5jbHMtNSwgLmNscy02IHsKICAgICAgICBtaXgtYmxlbmQtbW9kZTogbXVsdGlwbHk7CiAgICAgIH0KCiAgICAgIC5jbHMtMyB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtMyk7CiAgICAgIH0KCiAgICAgIC5jbHMtNCB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtNik7CiAgICAgIH0KCiAgICAgIC5jbHMtNSB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtNSk7CiAgICAgIH0KCiAgICAgIC5jbHMtNiB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQtNyk7CiAgICAgIH0KCiAgICAgIC5jbHMtNyB7CiAgICAgICAgZmlsbDogdXJsKCNsaW5lYXItZ3JhZGllbnQpOwogICAgICB9CgogICAgICAuY2xzLTggewogICAgICAgIGlzb2xhdGlvbjogaXNvbGF0ZTsKICAgICAgfQogICAgPC9zdHlsZT4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0ibGluZWFyLWdyYWRpZW50IiB4MT0iOS4xMiIgeTE9IjE1Ljg4IiB4Mj0iMTkuNjMiIHkyPSI1LjM3IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2IzNTA5ZSIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiNmNWE0YzciLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9ImxpbmVhci1ncmFkaWVudC0yIiB4MT0iOS4wOCIgeTE9IjYuODEiIHgyPSI5LjA4IiB5Mj0iMTQuNzMiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjMjM0ZmIzIi8+CiAgICAgIDxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI2ZmZiIvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0ibGluZWFyLWdyYWRpZW50LTMiIHgxPSIxNy42NyIgeTE9IjYuMTEiIHgyPSI4LjQxIiB5Mj0iNi4xMSIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgogICAgICA8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiM1YTJhOGIiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZmZmIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQtNCIgeDE9IjIwLjAzIiB5MT0iMTUuODkiIHgyPSIxMC45OCIgeTI9IjE1Ljg5IiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2Y2YWFjYiIvPgogICAgICA8c3RvcCBvZmZzZXQ9IjEiIHN0b3AtY29sb3I9IiM3NzJhOGQiLz4KICAgIDwvbGluZWFyR3JhZGllbnQ+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9ImxpbmVhci1ncmFkaWVudC01IiB4MT0iMTkuMDMiIHkxPSIxNi44MiIgeDI9IjE0Ljc5IiB5Mj0iMTIuNTgiIGdyYWRpZW50VW5pdHM9InVzZXJTcGFjZU9uVXNlIj4KICAgICAgPHN0b3Agb2Zmc2V0PSIwIiBzdG9wLWNvbG9yPSIjZmZmIi8+CiAgICAgIDxzdG9wIG9mZnNldD0iMSIgc3RvcC1jb2xvcj0iI2VkMzQ4ZCIvPgogICAgPC9saW5lYXJHcmFkaWVudD4KICAgIDxsaW5lYXJHcmFkaWVudCBpZD0ibGluZWFyLWdyYWRpZW50LTYiIHgxPSIxNS4yNyIgeTE9IjE1LjA2IiB4Mj0iMTUuMjciIHkyPSIxOS4zNyIgZ3JhZGllbnRVbml0cz0idXNlclNwYWNlT25Vc2UiPgogICAgICA8c3RvcCBvZmZzZXQ9IjAiIHN0b3AtY29sb3I9IiNmZmYiLz4KICAgICAgPHN0b3Agb2Zmc2V0PSIxIiBzdG9wLWNvbG9yPSIjZWU0YzliIi8+CiAgICA8L2xpbmVhckdyYWRpZW50PgogICAgPGxpbmVhckdyYWRpZW50IGlkPSJsaW5lYXItZ3JhZGllbnQtNyIgeDE9IjUuNTEiIHkxPSItMTI4LjAyIiB4Mj0iLTMuNyIgeTI9Ii0xMjguMDIiIGdyYWRpZW50VHJhbnNmb3JtPSJ0cmFuc2xhdGUoLTEwOS4xMiAxMC4wMSkgcm90YXRlKDg5LjYpIiB4bGluazpocmVmPSIjbGluZWFyLWdyYWRpZW50LTMiLz4KICA8L2RlZnM+CiAgPGcgY2xhc3M9ImNscy04IiBpZD0iTG9nbyI+CiAgICA8ZyBpZD0iT0JKRUNUUyIgPgogICAgICA8ZyBpZCA9IkxvZ28iPiAKICAgICAgICA8cGF0aCBjbGFzcz0iY2xzLTciIGQ9Ik00LjIzLDExYzAsNS4zNiw0LjM3LDkuNzEsOS43Niw5LjcxczkuNzYtNC4zNSw5Ljc2LTkuNzFTMTkuMzksMS4yOSwxNCwxLjI5LDQuMjMsNS42NCw0LjIzLDExWk0xMC4yNiwxMC4wN2MwLTEuNTQsMS4yNS0yLjc4LDIuOC0yLjc4aDEuODdjMS41NSwwLDIuOCwxLjI1LDIuOCwyLjc4djEuODZjMCwxLjU0LTEuMjUsMi43OC0yLjgsMi43OGgtMS4yMmMtLjQ1LDAtLjg4LjE1LTEuMjIuNDRsLTIuMjMsMS44NHYtNi45MloiLz4KICAgICAgICA8cGF0aCBjbGFzcz0iY2xzLTIiIGQ9Ik0xMC4yNiwxNi45OXYtNi45MnMwLS4wMiwwLS4wM2MuMDItMS41MiwxLjI2LTIuNzUsMi44LTIuNzVoLTUuMDljLTIuMDUsMC0zLjczLDEuNjQtMy43NCwzLjY4LDAsLjAxLDAsLjAzLDAsLjA0LDAsLjA4LDAsLjE2LDAsLjI0LDAsLjA0LDAsLjA4LDAsLjEyLDAsLjA0LDAsLjA4LDAsLjEyLDAsLjA2LDAsLjExLjAxLjE3LDAsLjAyLDAsLjA1LDAsLjA3LDAsLjA2LjAxLjEzLjAyLjE5LDAsLjAxLDAsLjAzLDAsLjA0LDAsLjA3LjAxLjE0LjAyLjIxLDAsMCwwLC4wMSwwLC4wMiwwLC4wNy4wMi4xNS4wMy4yMiwwLDAsMCwwLDAsMCwuNjgsNC42OCw0LjcxLDguMjcsOS42LDguMy0yLjA0LS4wMi0zLjY3LTEuNjktMy42Ny0zLjcyWiIvPgogICAgICAgIDxwYXRoIGNsYXNzPSJjbHMtMyIgZD0iTTE0LjA0LDEuMjlzLS4wMywwLS4wNCwwYy0uMDgsMC0uMTYsMC0uMjQsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDYsMC0uMTEsMC0uMTcsMC0uMDIsMC0uMDUsMC0uMDcsMC0uMDYsMC0uMTMuMDEtLjE5LjAyLS4wMSwwLS4wMywwLS4wNCwwLS4wNywwLS4xNC4wMS0uMjEuMDIsMCwwLS4wMSwwLS4wMiwwLS4wNywwLS4xNS4wMi0uMjIuMDMsMCwwLDAsMCwwLDAtNC43LjY4LTguMzIsNC42OS04LjM1LDkuNTQuMDItMi4wMiwxLjctMy42NSwzLjc0LTMuNjVoNi45NnMuMDIsMCwuMDMsMGMxLjUzLjAyLDIuNzcsMS4yNiwyLjc3LDIuNzh2LTUuMDZjMC0yLjA0LTEuNjUtMy43MS0zLjctMy43MloiLz4KICAgICAgICA8cGF0aCBjbGFzcz0iY2xzLTEiIGQ9Ik0xNC45MywxNC43MWg1LjA5YzIuMDQsMCwzLjcyLTEuNjMsMy43NC0zLjY1LS4wMyw0Ljg2LTMuNjUsOC44Ny04LjM1LDkuNTQsMCwwLDAsMCwwLDAtLjA3LjAxLS4xNS4wMi0uMjIuMDMsMCwwLS4wMSwwLS4wMiwwLS4wNywwLS4xNC4wMi0uMjEuMDItLjAxLDAtLjAzLDAtLjA0LDAtLjA2LDAtLjEzLjAxLS4xOS4wMi0uMDIsMC0uMDUsMC0uMDcsMC0uMDYsMC0uMTEsMC0uMTcsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDgsMC0uMTYsMC0uMjQsMC0uMDEsMC0uMDMsMC0uMDQsMC0yLjA1LDAtMy43LTEuNjgtMy43LTMuNzJsMi4yMy0xLjg0Yy4zNC0uMjguNzgtLjQ0LDEuMjItLjQ0aDEuMjJaIi8+CiAgICAgICAgPHBhdGggY2xhc3M9ImNscy01IiBkPSJNMTQuOTMsMTQuNzFoNS4wOWMyLjA0LDAsMy43Mi0xLjYzLDMuNzQtMy42NS0uMDMsNC44Ni0zLjY1LDguODctOC4zNSw5LjU0LDAsMCwwLDAsMCwwLS4wNy4wMS0uMTUuMDItLjIyLjAzLDAsMC0uMDEsMC0uMDIsMC0uMDcsMC0uMTQuMDItLjIxLjAyLS4wMSwwLS4wMywwLS4wNCwwLS4wNiwwLS4xMy4wMS0uMTkuMDItLjAyLDAtLjA1LDAtLjA3LDAtLjA2LDAtLjExLDAtLjE3LDAtLjA0LDAtLjA4LDAtLjEyLDAtLjA0LDAtLjA4LDAtLjEyLDAtLjA4LDAtLjE2LDAtLjI0LDAtLjAxLDAtLjAzLDAtLjA0LDAtMi4wNSwwLTMuNy0xLjY4LTMuNy0zLjcybDIuMjMtMS44NGMuMzQtLjI4Ljc4LS40NCwxLjIyLS40NGgxLjIyWiIvPgogICAgICAgIDxwYXRoIGNsYXNzPSJjbHMtNCIgZD0iTTIwLjI4LDE0LjcxYy0uMDgsMC0uMTcsMC0uMjUsMGgtNi4zMWMtLjQ1LDAtLjg4LjE1LTEuMjIuNDRsLTIuMjMsMS44NGMwLC4wOCwwLC4xNywwLC4yNSwxLjA5LjY1LDIuMzcsMS4wMiwzLjczLDEuMDIsMi42NywwLDUuMDEtMS40Myw2LjI4LTMuNTVaIi8+CiAgICAgICAgPHBhdGggY2xhc3M9ImNscy02IiBkPSJNMjMuNzcsMTAuOTdzMC0uMDMsMC0uMDRjMC0uMDgsMC0uMTYsMC0uMjQsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDQsMC0uMDgsMC0uMTIsMC0uMDYsMC0uMTEtLjAxLS4xNywwLS4wMiwwLS4wNSwwLS4wNywwLS4wNi0uMDEtLjEzLS4wMi0uMTksMC0uMDEsMC0uMDMsMC0uMDQsMC0uMDctLjAyLS4xNC0uMDItLjIxLDAsMCwwLS4wMSwwLS4wMiwwLS4wNy0uMDItLjE1LS4wMy0uMjIsMCwwLDAsMCwwLDAtLjcxLTQuNjctNC43Ny04LjI0LTkuNjYtOC4yNCwyLjA0LDAsMy42OCwxLjY2LDMuNywzLjY5bC4wNCw1LjA2djEuODZzLjAxLjAyLjAxLjAzYzAsMS41Mi0xLjI1LDIuNzYtMi43OCwyLjc3bDUuMDktLjA0YzIuMDUtLjAxLDMuNzItMS42NiwzLjcxLTMuN1oiLz4KICAgICAgPC9nPgogICAgPC9nPgogIDwvZz4KPC9zdmc+",Zt=null,we=!1;function Te(){if(Zt||we)return Zt;we=!0;let t=new Image;return t.onload=()=>{Zt=t},t.src=rr,null}function or(){return Math.floor(Date.now()/864e5)}function sr(t){let o=(t^2654435769)>>>0;return function(){o=o+1831565813>>>0;let n=Math.imul(o^o>>>15,1|o);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}function nr(t,o,n,s,w,e){let a=Te();t.save(),t.setTransform(1,0,0,1,0,0),t.font="bold 10px Inter, system-ui, sans-serif";let r=t.measureText(s);t.font="8px Inter, system-ui, sans-serif";let i=t.measureText(w),f=a?18:0,u=a?14:0,g=7,_=5,l=a?5:0,p=f+l+Math.max(r.width,i.width)+g*2,h=Math.max(u,20)+_*2,c=Math.round(o-p/2),m=Math.round(n-h/2);t.globalAlpha=.45,t.fillStyle=e?"rgba(255,255,255,0.8)":"rgba(18,18,28,0.8)",t.shadowColor=e?"rgba(0,0,0,0.06)":"rgba(0,0,0,0.25)",t.shadowBlur=8,t.shadowOffsetY=1,t.beginPath(),t.roundRect(c,m,p,h,6),t.fill(),t.shadowColor="transparent",t.strokeStyle=e?"rgba(0,0,0,0.04)":"rgba(255,255,255,0.04)",t.lineWidth=.5,t.stroke();let M=c+g,I=m+h/2;a&&(t.globalAlpha=.5,t.drawImage(a,M,I-u/2,f,u),M+=f+l),t.globalAlpha=.5,t.font="bold 10px Inter, system-ui, sans-serif",t.fillStyle=e?"#1a1a2e":"#ededf5",t.textAlign="left",t.textBaseline="alphabetic",t.fillText(s,M,I-1),t.font="8px Inter, system-ui, sans-serif",t.fillStyle=e?"#777790":"#8080a0",t.textBaseline="top",t.fillText(w,M,I+2),t.restore()}function Ee(t,o,n,s){Te();let w=o.width,e=o.height;if(w<100||e<80)return;t.save(),t.setTransform(1,0,0,1,0,0);let a=sr(or()),r=100,i=Math.max(w-r*2,60),f=Math.max(e-r*2,40),u=r+a()*i,g=r+a()*f,_=n.trialExpired||n.plan===mt,l=er,d=_?`Free \u2014 ${pe}/pricing`:`Trial: ${n.daysLeft||0}d left \u2014 ${pe}`;nr(t,u,g,l,d,s),t.restore()}function ir({plan:t,domain:o="*",expiryDays:n=365,name:s,email:w}){let e=n>0?Math.floor(Date.now()/1e3)+n*86400:0,a={p:t,d:o,e,...s?{n:s}:{},...w?{m:w}:{},i:Date.now()};return a.s=ve(a),btoa(JSON.stringify(a))}var xt=null,Ut=null,Tt=null;async function Et(){return xt?{module:xt,memory:Ut}:Tt||(Tt=(async()=>{let t=await import("./chart_engine.js");return await t.default(),Ut=t.wasm_memory(),xt=t,{module:t,memory:Ut}})(),Tt)}var yt=null,Nt=null;async function ye(){if(yt)return yt;let{module:t,memory:o}=await Et();return yt=t,Nt=o,t}function ar(){yt||ye().catch(()=>{})}async function lr(t,o={}){o.appId&&typeof window<"u"&&(window.__mrd_app_id=o.appId);let n=o.licenseKey||o.key||null,s=vt(n);if(!s.valid)if(s.expired)console.warn(`[MRD Chart Engine] ${s.error}. Get a license at https://mrd-chart.dev/pricing`);else throw new Error(`[MRD Chart Engine] ${s.error}`);s.plan==="trial"&&console.info(`[MRD Chart Engine] Trial mode \u2014 ${s.daysLeft} days remaining. Purchase: https://mrd-chart.dev/pricing`);let w=await ye(),e=window.devicePixelRatio||1,a=t.getBoundingClientRect();(a.width<1||a.height<1)&&(await new Promise(L=>{let T=new ResizeObserver(y=>{for(let Y of y)if(Y.contentRect.width>0&&Y.contentRect.height>0){T.disconnect(),L();return}});T.observe(t.parentElement||t),setTimeout(()=>{T.disconnect(),L()},2e3)}),a=t.getBoundingClientRect());let r=Math.max(a.width,100),i=Math.max(a.height,100);t.width=r*e,t.height=i*e;let f=t.getContext("2d");f.scale(e,e);let u=new w.ChartEngine(r,i);try{let L=s.expired?2:s.watermark?1:0,T=s.daysLeft||0,y=1297237059;y=Math.imul(y,31)+L>>>0,y=Math.imul(y,31)+T>>>0,y=(y^y>>>16)>>>0,y=Math.imul(y,73244475)>>>0,y=(y^y>>>16)>>>0,u.set_license_state(L,T,y)}catch(L){console.warn("[MRD] set_license_state failed:",L.message)}let g=!0,_=null,l=!1,d=!1,p=!1,h=null,c=null,m=0,M=!1,I=!1,P=("ontouchstart"in window||navigator.maxTouchPoints>0)&&window.innerWidth<=1399?33:0;function G(){if(!(!l||d||_)){if(P>0){let L=performance.now()-m;if(L<P){c||(c=setTimeout(()=>{c=null,G()},P-L));return}}_=requestAnimationFrame(je)}}let R=()=>{g=!0,G()},tt=()=>p,k=null,it=null,ft=null,F=null,D=null,X=null,V=null,q=null,S=0,C=null,v=null,E=0,j=0,b=-1,Lt=!1,It=!1,Fe=jt(t,u,{onDirty:R,onCrosshairMove:(L,T,y)=>{E=L,j=T,b=y,Lt=!0,It=!0},onCrosshairHide:()=>{It&&(It=!1,Lt=!0,b=-1)},drawingApi:L=>{k=L},onDrawingComplete:()=>{it?.()},onDrawingCancel:()=>{ft?.()},onDrawingSelected:(L,T,y)=>{F?.(L,T,y)},onMarkerSelected:L=>{D?.(L)},onDrawingDblClick:(L,T,y,Y,Pt)=>{X?.(L,T,y,Y,Pt)},onVrvpHover:(L,T)=>{V?.(L,T)},onLiqAnnotationPin:(L,T)=>{v?.(L,T)}});function Ye(){if(!(!Lt||I)){if(Lt=!1,!It){h&&h(null,0,0),q&&q("");return}if(h)if(b===0||b===1)try{let L=u.get_tooltip_data();h(L,E,j)}catch{}else h(null,0,0);if(q){let L=performance.now();if(b===0||b===1){if(L-S>=80){S=L;try{q(u.lt_hit_test(E,j))}catch{}}}else q("")}}}function je(){if(_=null,!(!l||d||I)){M=!0;try{let L=!1;try{L=g||u.is_dirty()}catch{I=!0;return}if(L){g=!1,m=performance.now();let T=!1;try{if(u.render()>0){let Y=u.get_command_buffer_ptr(),Pt=u.get_command_buffer_len();f.save(),f.setTransform(1,0,0,1,0,0),f.clearRect(0,0,t.width,t.height),f.restore(),lt(f,Nt,Y,Pt),T=!0}try{at.renderAll(f)}catch{}}catch(y){if(T||(g=!0),y instanceof WebAssembly.RuntimeError){I=!0,console.error("[MRD] Engine crashed:",y.message);return}}Ye();try{C?.()}catch{}if(s.watermark)try{let y=u.get_theme()===1;Ee(f,t,s,y)}catch{}try{(g||u.is_dirty())&&G()}catch{}}}finally{M=!1}}}let pt=zt(s.plan),Oe=ue(u,R,tt,()=>pt),ze=fe(u,R,tt,()=>pt),Ze=_e(u,R,tt,()=>pt),at=Ot(u,Nt,lt);return{engine:u,start(){l=!0,d=!1,g=!0,G()},stop(){l=!1,_&&(cancelAnimationFrame(_),_=null),c&&(clearTimeout(c),c=null)},resize(L){if(I||M)return;if(a=t.getBoundingClientRect(),a.width<1||a.height<1){(L||0)<8&&setTimeout(()=>this.resize((L||0)+1),250);return}e=window.devicePixelRatio||1;let T=a.width*e,y=a.height*e;t.width=T,t.height=y,f.setTransform(1,0,0,1,0,0),f.scale(e,e);try{u.resize(a.width,a.height)}catch(Y){if(Y instanceof WebAssembly.RuntimeError){I=!0;return}throw Y}R()},renderSync(){if(I)return 0;try{let L=u.render();if(L>0){let T=u.get_command_buffer_ptr(),y=u.get_command_buffer_len();f.save(),f.setTransform(1,0,0,1,0,0),f.clearRect(0,0,t.width,t.height),f.restore(),lt(f,Nt,T,y)}return L}catch(L){return L instanceof WebAssembly.RuntimeError&&(I=!0),0}},setHoverPrice(L){u.set_hover_price(L),R()},clearHoverPrice(){u.clear_hover_price(),R()},hitZone(L,T){return u.hit_zone(L,T)},startDrawing(L,T){k?.setMode(L,T)},cancelDrawing(){k?.setMode(null)},onDrawingComplete(L){it=L},onDrawingCancel(L){ft=L},onDrawingSelected(L){F=L},onMarkerSelected(L){D=L},onDrawingDblClick(L){X=L},setReplayState(L,T,y){u.set_replay_state(L,T,y),R()},setReplayHovered(L){u.set_replay_hovered(L)},setReplayPreview(L){u.set_replay_preview(L),R()},setPrecision(L){u.set_price_precision(L),R()},setCandleInterval(L){u.set_candle_interval(L)},setTheme(L){let T=L==="light"?1:0;typeof u.set_theme=="function"?(u.set_theme(T),R()):console.warn("[ChartEngine] set_theme not available \u2014 reload page to load updated WASM")},getTheme(){return u.get_theme()===1?"light":"dark"},onTooltip(L){h=L},onVrvpHover(L){V=L},onLtHover(L){q=L},onPostRender(L){C=L},onLiqAnnotationPin(L){v=L},pause(){d||(d=!0,_&&(cancelAnimationFrame(_),_=null),c&&(clearTimeout(c),c=null))},resume(){d&&(d=!1,l&&(g=!0,G()))},get isPaused(){return d},destroy(){p=!0,l=!1,d=!1,_&&(cancelAnimationFrame(_),_=null),c&&(clearTimeout(c),c=null),Fe();try{u.free()}catch{}},addIndicator(L){if(!pt("customIndicators"))return null;let T=at.add(L);return R(),T},removeIndicator(L){at.remove(L),R()},updateIndicatorParams(L,T){at.updateParams(L,T),R()},setIndicatorEnabled(L,T){at.setEnabled(L,T),R()},listIndicators(){return at.list()},invalidateCustomIndicators(){at.invalidateCompute(),R()},get license(){return{plan:s.plan,valid:s.valid,expired:!!s.expired,watermark:!!s.watermark,daysLeft:s.daysLeft,features:s.features||{}}},setLicenseKey(L){s=vt(L),!s.valid&&!s.expired&&console.error(`[MRD Chart Engine] ${s.error}`),pt=zt(s.plan);try{let T=s.expired?2:s.watermark?1:0,y=s.daysLeft||0,Y=1297237059;Y=Math.imul(Y,31)+T>>>0,Y=Math.imul(Y,31)+y>>>0,Y=(Y^Y>>>16)>>>0,Y=Math.imul(Y,73244475)>>>0,Y=(Y^Y>>>16)>>>0,u.set_license_state(T,y,Y)}catch{}return R(),s.valid},...Ze,...Oe,...ze}}function ur(t,o){let{t:n,o:s,h:w,l:e,c:a,v:r}=t,i=a.length;if(i===0||o<=0)return{t:[],o:[],h:[],l:[],c:[],v:[]};let f=[],u=[],g=[],_=[],l=[],d=[],p=Math.round(a[0]/o)*o,h=0;for(let c=0;c<i;c++){h+=r[c];let M=a[c]-p;for(;M>=o;){let I=p,A=p+o;f.push(n[c]),u.push(I),g.push(A),_.push(I),l.push(A),d.push(h),h=0,p=A}for(;-M>=o;){let I=p,A=p-o;f.push(n[c]),u.push(I),g.push(I),_.push(A),l.push(A),d.push(h),h=0,p=A}}return{t:f,o:u,h:g,l:_,c:l,v:d}}function fr(t,o){let{t:n,o:s,h:w,l:e,c:a,v:r}=t,i=a.length;if(i===0||o<=0)return{t:[],o:[],h:[],l:[],c:[],v:[]};let f=[],u=[],g=[],_=[],l=[],d=[],p=s[0],h=w[0],c=e[0],m=0,M=n[0];for(let I=0;I<i;I++)for(h=Math.max(h,w[I]),c=Math.min(c,e[I]),m+=r[I];h-c>=o;){let A=a[I]>=p,P=A?c+o:h-o;if(f.push(M),u.push(p),g.push(h),_.push(c),l.push(P),d.push(m),p=P,h=A?Math.max(w[I],P):P,c=A?P:Math.min(e[I],P),m=0,M=n[I],h-c<o)break}return(m>0||f.length===0)&&(f.push(M),u.push(p),g.push(h),_.push(c),l.push(a[i-1]),d.push(m)),{t:f,o:u,h:g,l:_,c:l,v:d}}function _r(t,o){let{t:n,o:s,h:w,l:e,c:a,v:r}=t,i=a.length;if(i===0||o<=0)return{t:[],o:[],h:[],l:[],c:[],v:[]};let f=[],u=[],g=[],_=[],l=[],d=[],p=Math.max(1,Math.round(o));for(let h=0;h<i;h+=p){let c=Math.min(h+p,i),m=-1/0,M=1/0,I=0;for(let A=h;A<c;A++)w[A]>m&&(m=w[A]),e[A]<M&&(M=e[A]),I+=r[A];f.push(n[h]),u.push(s[h]),g.push(m),_.push(M),l.push(a[c-1]),d.push(I)}return{t:f,o:u,h:g,l:_,c:l,v:d}}function cr(t,o){let n=t>1e4?50:t>1e3?10:t>100?1:t>1?.1:.001,s=n*2,w=o<=60?10:o<=300?5:3;return{brickSize:n,rangeSize:s,tickCount:w}}var dr={minRefills:3,hiddenRatio:2,refillWindowMs:1e4,maxTrackedLevels:200,maxEvents:500,decayMs:3e5};function hr(t={}){let o={...dr,...t},n=new Map,s=new Map,w=[],e=0;function a(_){return Math.round(_*1e8)/1e8}function r(_,l,d,p){for(let[h,c]of _){let m=a(h),M=l.get(m);if(!M){l.set(m,{lastVol:c,refills:0,totalConsumed:0,lastRefillTs:p,peakVisible:c});continue}if(c<M.lastVol*.3&&M.lastVol>0){let I=M.lastVol-c;M.totalConsumed+=I,M.lastVol=c;continue}if(c>M.lastVol*1.5&&M.totalConsumed>0)if(p-M.lastRefillTs<o.refillWindowMs){if(M.refills++,M.lastRefillTs=p,M.peakVisible=Math.max(M.peakVisible,c),M.refills>=o.minRefills){let A=M.totalConsumed,P=M.peakVisible;A>=P*o.hiddenRatio&&(w.push({timestamp:p,price:h,visibleSize:P,hiddenSize:A,isBid:d,refillCount:M.refills}),w.length>o.maxEvents&&w.shift(),M.refills=0,M.totalConsumed=0)}}else M.refills=1,M.totalConsumed=0,M.lastRefillTs=p;M.lastVol=c}if(l.size>o.maxTrackedLevels){let h=[...l.entries()];h.sort((m,M)=>m[1].lastRefillTs-M[1].lastRefillTs);let c=h.length-o.maxTrackedLevels;for(let m=0;m<c;m++)l.delete(h[m][0])}}function i(_,l,d){let p=d||Date.now();e=p;let h=_ instanceof Map?_:new Map(_.map(([M,I])=>[M,I])),c=l instanceof Map?l:new Map(l.map(([M,I])=>[M,I]));r(h,n,!0,p),r(c,s,!1,p);let m=p-o.decayMs;for(;w.length>0&&w[0].timestamp<m;)w.shift()}function f(){return w}function u(_){if(!_||w.length===0)return;let l=w.length,d=new Float64Array(l),p=new Float64Array(l),h=new Float64Array(l),c=new Float64Array(l),m=new Uint8Array(l),M=new Uint32Array(l);for(let I=0;I<l;I++){let A=w[I];d[I]=A.timestamp,p[I]=A.price,h[I]=A.visibleSize,c[I]=A.hiddenSize,m[I]=A.isBid?1:0,M[I]=A.refillCount}_.setIcebergEvents(d,p,h,c,m,M)}function g(){n.clear(),s.clear(),w.length=0}return{onOrderbookUpdate:i,getEvents:f,pushToEngine:u,reset:g}}var Qt=null,Re=null;async function pr(){if(Qt)return Qt;let{module:t,memory:o}=await Et();return Qt=t,Re=o,t}var Ne=Promise.resolve();async function wr(t,o={}){let n=await pr();return await(Ne=Ne.then(()=>Pe(n,t,o),()=>Pe(n,t,o)))}function Pe(t,o,n){let s=window.devicePixelRatio||1,w=o.getBoundingClientRect(),e=Math.max(w.width,60),a=Math.max(w.height,60);o.width=e*s,o.height=a*s;let r=o.getContext("2d");r.scale(s,s);let i=new t.OrderbookEngine(e,a);n.symbol&&i.set_symbol(n.symbol),n.tickSize&&i.set_tick_size(n.tickSize),n.visibleTicks&&i.set_visible_ticks(n.visibleTicks),n.exchangeCount&&i.set_exchange_count(n.exchangeCount),n.pricePrecision!=null&&i.set_price_precision(n.pricePrecision),n.theme==="light"&&i.set_theme(1),n.heatmapCols&&i.set_heatmap_cols(n.heatmapCols),(n.ringCols||n.ringRows)&&i.set_ring_capacity(n.ringCols||300,n.ringRows||400);let f=!0,u=null,g=!1,_=!1,l=!1,d=null,p=null;function h(){!g||l||u||(u=requestAnimationFrame(m))}let c=()=>{f=!0,h()};function m(){if(u=null,!g||l)return;let S=!1;try{S=f||i.is_dirty()}catch{l=!0;return}if(S){f=!1;try{if(i.render()>0){let v=i.get_command_buffer_ptr(),E=i.get_command_buffer_len();r.save(),r.setTransform(1,0,0,1,0,0),r.clearRect(0,0,o.width,o.height),r.restore(),lt(r,Re,v,E)}}catch(C){if(C instanceof WebAssembly.RuntimeError){l=!0,console.error("[OrderbookEngine] crashed:",C.message);return}f=!0}}}o.style.touchAction="none";let M=!1,I=0,A=new Map,P=0,G=0,R=0,tt=0,k=!1;function it(S){if(l)return;S.preventDefault();let C=S.deltaY>0?1.08:.93;i.zoom_y(C,S.offsetY),c()}function ft(S){if(!l){if(A.set(S.pointerId,{y:S.offsetY}),o.setPointerCapture(S.pointerId),A.size===1)M=!0,I=S.offsetY,tt=S.offsetX,R=S.offsetY,k=!1;else if(A.size===2){M=!1;let C=[...A.values()];P=Math.abs(C[0].y-C[1].y),G=(C[0].y+C[1].y)/2}}}function F(S){if(!l){if(A.set(S.pointerId,{y:S.offsetY}),A.size>=2){let C=[...A.values()],v=Math.abs(C[0].y-C[1].y),E=(C[0].y+C[1].y)/2;if(P>0){let b=P/Math.max(v,1);i.zoom_y(b,E)}let j=E-G;Math.abs(j)>.5&&i.pan_y(j),P=v,G=E,c()}else if(M){let C=S.offsetY-I;I=S.offsetY,(Math.abs(S.offsetX-tt)>4||Math.abs(S.offsetY-R)>4)&&(k=!0),i.pan_y(C),c()}else if(i.set_hover(S.offsetX,S.offsetY),c(),d)try{let C=i.get_hover_price();if(C>0){let v=i.get_hover_qty(),E=i.get_hover_side();d({price:C,qty:v,side:E===2?"ask":"bid"})}else d(null)}catch{}}}function D(){l||(d&&d(null),!M&&A.size===0&&(i.clear_hover(),c()))}function X(S){let C=M&&!k&&A.size===1;A.delete(S.pointerId);try{o.releasePointerCapture(S.pointerId)}catch{}if(A.size===0){if(C&&p&&!l)try{i.set_hover(S.offsetX,S.offsetY);let v=i.get_hover_price();if(v>0){let E=i.get_hover_qty(),j=i.get_hover_side();p({price:v,qty:E,side:j===2?"ask":"bid"})}}catch{}M=!1,P=0}else A.size===1&&(M=!0,I=[...A.values()][0].y,P=0)}function V(){l||(i.center_on_mid(),c())}o.addEventListener("wheel",it,{passive:!1}),o.addEventListener("pointerdown",ft),o.addEventListener("pointermove",F),o.addEventListener("pointerup",X),o.addEventListener("pointercancel",X),o.addEventListener("pointerleave",D),o.addEventListener("dblclick",V);function q(){o.removeEventListener("wheel",it),o.removeEventListener("pointerdown",ft),o.removeEventListener("pointermove",F),o.removeEventListener("pointerup",X),o.removeEventListener("pointercancel",X),o.removeEventListener("pointerleave",D),o.removeEventListener("dblclick",V)}return{engine:i,start(){g=!0,f=!0,h()},stop(){g=!1,u&&(cancelAnimationFrame(u),u=null)},resize(){if(!(_||l)&&(w=o.getBoundingClientRect(),!(w.width<1||w.height<1))){s=window.devicePixelRatio||1,o.width=w.width*s,o.height=w.height*s,r.setTransform(1,0,0,1,0,0),r.scale(s,s);try{i.resize(w.width,w.height)}catch(S){if(S instanceof WebAssembly.RuntimeError){l=!0;return}throw S}c()}},pushSnapshot(S,C,v){if(l)return;let E=new Float64Array(S.length*2);for(let b=0;b<S.length;b++)E[b*2]=S[b][0],E[b*2+1]=S[b][1];let j=new Float64Array(C.length*2);for(let b=0;b<C.length;b++)j[b*2]=C[b][0],j[b*2+1]=C[b][1];try{i.push_snapshot(E,j,v)}catch(b){if(b instanceof WebAssembly.RuntimeError){l=!0;return}throw b}c()},pushSnapshotFlat(S,C,v){if(!l){try{i.push_snapshot(S,C,v)}catch(E){if(E instanceof WebAssembly.RuntimeError){l=!0;return}throw E}c()}},setDepthBook(S,C,v){if(l)return;let E=new Float64Array(S.length*2);for(let b=0;b<S.length;b++)E[b*2]=S[b][0],E[b*2+1]=S[b][1];let j=new Float64Array(C.length*2);for(let b=0;b<C.length;b++)j[b*2]=C[b][0],j[b*2+1]=C[b][1];try{i.set_depth_book(E,j,v)}catch(b){if(b instanceof WebAssembly.RuntimeError){l=!0;return}throw b}c()},setDepthBookFlat(S,C,v){if(!l){try{i.set_depth_book(S,C,v)}catch(E){if(E instanceof WebAssembly.RuntimeError){l=!0;return}throw E}c()}},pushHeatmapCol(S,C,v){if(l)return;let E=new Float64Array(S.length*2);for(let b=0;b<S.length;b++)E[b*2]=S[b][0],E[b*2+1]=S[b][1];let j=new Float64Array(C.length*2);for(let b=0;b<C.length;b++)j[b*2]=C[b][0],j[b*2+1]=C[b][1];try{i.push_heatmap_col(E,j,v)}catch(b){if(b instanceof WebAssembly.RuntimeError){l=!0;return}throw b}c()},pushHeatmapColFlat(S,C,v){if(!l){try{i.push_heatmap_col(S,C,v)}catch(E){if(E instanceof WebAssembly.RuntimeError){l=!0;return}throw E}c()}},resetRing(){if(!l){try{i.reset_ring()}catch(S){if(S instanceof WebAssembly.RuntimeError){l=!0;return}throw S}c()}},setExchangeLabels(S){if(l)return;let C=Array.isArray(S)?S.join(","):String(S);try{i.set_exchange_labels(C)}catch(v){if(v instanceof WebAssembly.RuntimeError){l=!0;return}throw v}c()},setSignalObi(S,C,v){if(!l){try{i.set_signal_obi(S,C,v)}catch(E){if(E instanceof WebAssembly.RuntimeError){l=!0;return}throw E}c()}},setSignalSpoof(S){if(!l){try{i.set_signal_spoof(S)}catch(C){if(C instanceof WebAssembly.RuntimeError){l=!0;return}throw C}c()}},setSignalAbsorption(S,C){if(!l){try{i.set_signal_absorption(S,C)}catch(v){if(v instanceof WebAssembly.RuntimeError){l=!0;return}throw v}c()}},setSignalFlow(S,C){if(!l){try{i.set_signal_flow(S,C)}catch(v){if(v instanceof WebAssembly.RuntimeError){l=!0;return}throw v}c()}},setSignalWalls(S,C){if(!l){try{i.set_signal_walls(new Float64Array(S),new Float64Array(C))}catch(v){if(v instanceof WebAssembly.RuntimeError){l=!0;return}throw v}c()}},setSignalGaps(S,C){if(!l){try{i.set_signal_gaps(new Float64Array(S),new Float64Array(C))}catch(v){if(v instanceof WebAssembly.RuntimeError){l=!0;return}throw v}c()}},setSymbol(S){l||(i.set_symbol(S),c())},setTickSize(S){l||(i.set_tick_size(S),c())},setVisibleTicks(S){l||(i.set_visible_ticks(S),c())},setExchangeCount(S){l||(i.set_exchange_count(S),c())},setPrecision(S){l||(i.set_price_precision(S),c())},setAutoCenter(S){l||i.set_auto_center(S)},centerOnMid(){l||(i.center_on_mid(),c())},setHeatmapCols(S){l||(i.set_heatmap_cols(S),c())},getHoverPrice(){return l?0:i.get_hover_price()},getHoverQty(){return l?0:i.get_hover_qty()},getHoverSide(){return l?0:i.get_hover_side()},onHoverPrice(S){d=S},onClickPrice(S){p=S},setTheme(S){l||(i.set_theme(S==="light"?1:0),c())},clear(){l||(i.clear(),c())},get isDead(){return l},destroy(){_=!0,g=!1,u&&(cancelAnimationFrame(u),u=null),q();try{i.free()}catch{}}}}export{fr as buildRange,ur as buildRenko,_r as buildTick,lr as createChartBridge,Ot as createCustomIndicatorManager,hr as createIcebergDetector,wr as createOrderbookBridge,lt as dispatchCommands,ir as generateLicenseKey,ar as prefetchWasm,jt as setupEvents,cr as suggestDefaults,vt as validateLicense};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kline-orderbook-chart",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.14",
|
|
4
4
|
"description": "Candlestick chart with built-in orderbook heatmap, footprint chart, and liquidation heatmap. Native high-performance engine. 60 fps, zero dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/mrd-chart-engine.mjs",
|