jQuery(document).ready(function($){
if(evo_general_params!=''&&evo_general_params!==undefined&&evo_general_params.is_admin) return;
var BODY=$('body');
var BUS='';
var ajax_url=evo_general_params.ajaxurl;
$.fn.evo_calendar=function (options){
var el=this;
var cal=this;
var cal={};
var calO=$.extend({
'SC': {},
'json':{},
'type':'init' ,
map_delay:0
}, options);
var SC=el.evo_shortcode_data();
this.find('.eventon_list_event').each(function(){
evo_cal_eventcard_interactions($(this));
});
var init=function(){
if($(el).hasClass('evcal_widget')){
$(el).find('.evcal_gmaps').each(function(){
var gmap_id=obj.attr('id');
var new_gmal_id=gmap_id+'_widget';
obj.attr({'id':new_gmal_id})
});
}
_evo_run_eventcard_map_load();
$(el).evo_cal_filtering();
$(el).evo_cal_localize_time();
$(cal).evo_cal_oneevent_onload(calO.type);
el.evo_cal_hide_data();
live_now_cal();
counters();
};
var live_now_cal=function(){
$(el).find('.evo_img_time').each(function(){
if($(this).closest('a.desc_trig').find('em.evcal_time').length){
_html=$(this).closest('a.desc_trig').find('em.evcal_time')[0].outerHTML;
$(this).html(_html);
}});
}
var counters=function(){
$(el).find('.evo_countdowner').each(function(){
$(this).evo_countdown();
});
}
init();
};
var EVO_EventCard_Listeners=function(){
const EVO_Card_Listeners={
E: { B: $('body') },
init(){
const { E }=this;
E.B.on('click.evoCard', '.evo_et_trigger', (e)=> this.evo_handle_et_sidePanel(e));
E.B.on('evo_ajax_success_evo_et_trigger.evoCard', (e, OO, data, el)=> this.evo_handle_et_sp_content(e, OO, data, el));
E.B.on('click.evoCard', '.tzo_trig', (e)=> this.localizeTime(e));
E.B.on('click.evoCard', '.evo_event_more_img', (e)=> this.handle_event_more_img(e));
E.B.on('click.evoCard', '.evo_img_triglb', (e)=> this.handle_img_triglb(e));
E.B.on('click.evoCard', '.evo_repeat_series_date', (e)=> this.handle_repeat_series_date(e));
E.B.on('click.evoCard', '.copy.evo_ss', (e)=> this.handle_copy_event_link(e));
E.B.on('click.evoCard', '.evo_copy_address', (e)=> this.handle_copy_event_address(e));
E.B.on('click.evoCard', '.evo_openmap_trig', (e)=> this.handle_open_inmaps(e));
E.B.on('click.evoCard', '.evo_locimg_more', (e)=> this.handle_locimg_more(e));
E.B.on('click.evoCard', '.evo_gal_icon', (e)=> this.handle_gal_icon(e));
E.B.on('click.evoCard', '.evobtn_details_show_more', (e)=> this.handle_details_show_more(e));
E.B.on('click.evoCard', '.evcal_close', (e)=> this.handle_close_eventcard(e));
E.B.on('click.evoCard', '.evocmd_button', (e)=> this.handle_evocmd_button(e));
E.B.on('click.evoCard', '.evo_org_clk_link', (e)=> this.handle_org_clk_link(e));
E.B.on('click.evoCard', '.editEventBtnET', (e)=> this.handle_edit_event_button(e));
E.B.on('click.evoCard', '.evo_organizer_more_trig', (e)=> this.handle_organizer_more_details(e));
},
handle_organizer_more_details(e){
const { E }=this;
const $el=$(e.currentTarget);
$el.parent().hide();
$el.parent().siblings('.evo_org_details_full').show().removeClass('evodni');
},
evo_handle_et_sidePanel(e){
const { E }=this;
const $el=$(e.currentTarget);
e.preventDefault();
$el.addClass('evo_sp_trig_on');
const aData=$el.data('d');
aData.adata.data['nonce']=evo_general_params.n;
$el.evo_open_sidepanel(aData);
},
evo_handle_et_sp_content(e, OO, data, el){
$(el).evo_populate_sidepanel(data.html);
$('#evo_sp').find('.evo_loading_bar_holder').remove();
},
localizeTime(e){
e.preventDefault();
e.stopPropagation();
$(e.target).evo_localize_time();
},
handle_event_more_img(e){
const $el=$(e.currentTarget);
const box=$el.closest('.evcal_eventcard');
const gal=$el.closest('.evocard_fti_in');
if(box.length===0) return;
$el.siblings('span').removeClass('select');
$el.addClass('select');
const mainIMG=box.find('.evocard_main_image');
mainIMG.data({
h: $el.data('h'),
w: $el.data('w'),
f: $el.data('f'),
a: $el.data('a'),
});
if(mainIMG.hasClass('def')){
mainIMG.css('background-image', `url(${$el.data('f')})`);
}else{
mainIMG.html(`<span style="background-image:url(${$el.data('f')})"></span>`);
mainIMG.eventon_process_main_ft_img();
}},
handle_img_triglb(e){
const $el=$(e.currentTarget);
if($el.hasClass('inlb')) return;
const __ac=parseInt($el.data('w')) >=parseInt($el.data('h')) ? 'iW':'iH';
$el.evo_lightbox_open({
uid: 'evocard_ft_img',
lbc: 'evolb_ft_img',
lbac: `within evocard_img ${__ac}`,
content: `<img class='evocard_main_image inlb' src='${$el.data('f')}' data-w='${$el.data('w')}' data-h='${$el.data('h')}' style='max-width:100%; max-height:100%;'/>`,
end: 'client',
lb_padding: '',
d: { event_id: $el.data('event_id'), ri: $el.data('ri') }});
},
handle_repeat_series_date(e){
const $el=$(e.currentTarget);
if(!$el.parent().hasClass('clickable')) return;
const ux=$el.data('ux');
const URL=$el.data('l');
if(ux==='def') window.location=URL;
if(ux==='defA') window.open(URL, '_blank');
},
handle_copy_event_link(e){
e.preventDefault();
e.stopPropagation();
const $el=$(e.currentTarget);
const ROW=$el.closest('.evcal_evdata_row');
const link=decodeURIComponent($el.data('l'));
navigator.clipboard.writeText(link);
const evo_card_socialshare_html=ROW.html();
ROW.html(`<p style='display:flex'><i class='fa fa-check marr10'></i> ${$el.data('t')}</p>`);
setTimeout(()=> {
ROW.html(evo_card_socialshare_html);
}, 3000);
},
handle_copy_event_address(e){
e.preventDefault();
e.stopPropagation();
const $el=$(e.currentTarget);
const content=decodeURIComponent($el.data('txt'));
navigator.clipboard.writeText(content);
$el.siblings('input').val($el.data('t'));
setTimeout(()=> {
$el.siblings('input').val(content);
}, 3000);
},
handle_open_inmaps(e){
e.preventDefault();
e.stopPropagation();
const $el=$(e.currentTarget);
const address=$el.data('d');
const ua=navigator.userAgent;
if(ua.includes('iphone')||ua.includes('ipad')||ua.includes('ipod')){
window.location='maps://maps.apple.com/?q=' + address;
setTimeout(()=> {
window.open('https://maps.apple.com/?q=' + address, '_blank');
}, 1000);
}
else if(ua.includes('android')){
window.location='geo:0,0?q=' + address;
setTimeout(()=> {
window.open('https://www.google.com/maps/search/?api=1&query=' + address, '_blank');
}, 1000);
}else{
window.open('https://www.google.com/maps/search/?api=1&query=' + address, '_blank', 'noopener');
}},
handle_locimg_more(e){
e.preventDefault();
e.stopPropagation();
$(e.currentTarget).closest('.evo_metarow_locImg').toggleClass('vis');
},
handle_gal_icon(e){
e.preventDefault();
e.stopPropagation();
const $el=$(e.currentTarget);
if($el.hasClass('on')) return;
$el.siblings('div').removeClass('on');
$el.addClass('on');
$el.closest('.evo_gal_box').find('.evo_gal_main_img')
.css('background-image', `url(${$el.data('u')})`)
.data('f', $el.data('u'))
.data('h', $el.data('h'))
.data('w', $el.data('w'));
},
handle_details_show_more(e){
e.preventDefault();
this.control_more_less($(e.currentTarget));
},
handle_close_eventcard(e){
e.preventDefault();
$(e.currentTarget).closest('.evcal_eventcard').slideUp().removeClass('open');
},
handle_evocmd_button(e){
e.preventDefault();
e.stopPropagation();
const $el=$(e.currentTarget);
const href=$el.data('href');
if($el.data('target')==='yes'){
window.open(href, '_blank');
}else{
window.location=href;
}},
handle_org_clk_link(e){
window.open($(e.currentTarget).data('link'), '_blank');
},
handle_edit_event_button(e){
e.stopPropagation();
const href=$(e.currentTarget).attr('href');
window.open(href);
},
control_more_less(obj){
const content=obj.attr('content');
const current_text=obj.find('.ev_more_text').html();
const changeTo_text=obj.find('.ev_more_text').attr('data-txt');
const cell=obj.closest('.evcal_evdata_cell');
if(content==='less'){
cell.removeClass('shorter_desc');
obj.attr('content', 'more');
obj.find('.ev_more_arrow').removeClass('ard');
obj.find('.ev_more_text').attr('data-txt', current_text).html(changeTo_text);
}else{
cell.addClass('shorter_desc');
obj.attr('content', 'less');
obj.find('.ev_more_arrow').addClass('ard');
obj.find('.ev_more_text').attr('data-txt', current_text).html(changeTo_text);
}}
};
EVO_Card_Listeners.init();
}
var evo_cal_eventcard_interactions=function(EC , load_maps){
EC.find(".evocard_main_image").eventon_process_main_ft_img();
EC.find('.evo_elm_HCS').each(function(){
$(this).evoContentSlider();
});
EC.find('.evo_countdowner').each(function(){
var obj=$(this);
obj.removeClass('evo_cd_on');
obj.evo_countdown();
});
$(window).on('resize',function(){
BODY.find(".evocard_main_image").each(function(){
$(this).eventon_process_main_ft_img();
});
});
}
$.fn._evo_cal_eventcard_interactions=function(EC, load_maps){
evo_cal_eventcard_interactions(EC , load_maps);
}
function _evo_run_eventcard_map_load(){
BODY.evo_run_eventcard_map_load();
}
$.fn.evo_run_eventcard_map_load=function(){
time=600;
BODY.find('.evo_metarow_gmap').each(function(index){
O=$(this);
if(!(O.is(":visible"))) return;
O.evo_load_gmap({
map_canvas_id: O.attr('id'),
trigger_point:'evo_calendar',
delay: time
});
time +=600;
});
}
var evo_cal_eventtop_interactions=function(ET){	}
EVO_Global_Init();
function EVO_Global_Init(){
EVO_Interactions();
EVO_EventCard_Listeners();
var run_initload=false;
if($('body').find('.ajde_evcal_calendar').length > 0) run_initload=true;
if($('body').find('.ajax_loading_cal').length > 0) run_initload=true;
if($('body').find('.eventon_single_event').length > 0) run_initload=true;
if(run_initload==false) return false;
var data_arg={};
BODY.trigger('evo_global_page_run');
data_arg['global']=$('#evo_global_data').data('d');
data_arg['cals']={};
data_arg['nonce']=evo_general_params.n;
BODY.find('.ajde_evcal_calendar').each(function(){
const CAL=$(this);
var SC=CAL.evo_shortcode_data();
CAL.evo_pre_cal();
if(CAL.hasClass('ajax_loading_cal')){
data_arg['cals'][ CAL.attr('id')]={};
data_arg['cals'][ CAL.attr('id')]['sc']=SC;
BODY.trigger('evo_global_page_run_after', CAL , SC);
}});
BODY.evo_admin_get_ajax({
adata:{
data:data_arg,
a:'eventon_init_load',ajax_type:'endpoint',end:'client'
},
onSuccess:function(OO, data, LB){
$('#evo_global_data').data('d', data);
BUS=data;
if('cals' in data){
var time=300;
$.each(data.cals, function(i,v){
setTimeout(function(){
CAL=BODY.find('#'+ i);
if(CAL.length===0) return;
if('html' in v){
CAL.find('#evcal_list').html(v.html);
CAL.removeClass('ajax_loading_cal');
CAL.find('.evo_ajax_load_events').remove();
}
CAL.evo_cal_functions({action:'update_shortcodes',SC: v.sc});
CAL.evo_cal_functions({action:'update_json',json: v.json});
$('body').trigger('evo_init_ajax_success_each_cal', [data, i, v, CAL]);
}, time);
time +=300;
});
}
$('body').trigger('evo_init_ajax_success', [data]);
setTimeout(function(){
BODY.find('.ajde_evcal_calendar').each(function(){
if($(this).hasClass('.ajax_loading_cal')) return;
$(this).evo_calendar({'type':'complete'});
});
}, time);
},
onComplete:function(OO, data){
$('body').trigger('evo_init_ajax_completed', [data]);
}});
handlebar_additional_arguments();
EVO_Cal_Body_listeners();
BODY.find('.evo_countdowner').each(function(){
$(this).evo_countdown();
});
}
$('body').on('mouseover','.ajdeToolTip, .evotooltip, .evotooltipfree',function(event){
event.stopPropagation();
const el=$(this);
if(el.hasClass('show')) return;
var free=el.hasClass('free')||el.hasClass('evotooltipfree');
var content=el.data('d')||el.attr('title')||'';
if(!content) return;
var p=el.position();
var cor=getCoords(event.target);
$('.evo_tooltip_box').removeClass('show').removeClass('L').html(content);
var box_height=$('.evo_tooltip_box').height();
var box_width=$('.evo_tooltip_box').width();
var top=cor.top - 55 - box_height + (free ? 20:0);
$('.evo_tooltip_box').css({'top': top, 'left':(cor.left + 5) })
.addClass('show');
if($(this).hasClass('L')){
$('.evo_tooltip_box').css({'left': (cor.left - box_width - 15) }).addClass('L');
}})
.on('mouseout','.ajdeToolTip, .evotooltip, .evotooltipfree',function(e){
event.stopPropagation();
var relatedTarget=$(event.relatedTarget);
var target=$(this);
$('.evo_tooltip_box').removeClass('show');
});
function getCoords(elem){
var box=elem.getBoundingClientRect();
var body=document.body;
var docEl=document.documentElement;
var scrollTop=window.pageYOffset||docEl.scrollTop||body.scrollTop;
var scrollLeft=window.pageXOffset||docEl.scrollLeft||body.scrollLeft;
var clientTop=docEl.clientTop||body.clientTop||0;
var clientLeft=docEl.clientLeft||body.clientLeft||0;
var top=box.top +  scrollTop - clientTop;
var left=box.left + scrollLeft - clientLeft;
return { top: Math.round(top), left: Math.round(left) };}
$('body').on('click','.ajde_yn_btn ', function(event){
if($('body').hasClass('wp-admin')) return false;
var obj=$(this);
var afterstatement=obj.attr('afterstatement');
afterstatement=(afterstatement===undefined)? obj.attr('data-afterstatement'): afterstatement;
var uid='';
if(obj.hasClass('NO')){
obj.removeClass('NO');
obj.siblings('input').val('yes');
if(afterstatement!=''){
var type=(obj.attr('as_type')=='class')? '.':'#';
if(obj.data('uid')!==undefined) uid=obj.data('uid');
$(type+ afterstatement).slideDown('fast');
}}else{
obj.addClass('NO');
obj.siblings('input').val('no');
if(afterstatement!=''){
var type=(obj.attr('as_type')=='class')? '.':'#';
$(type+ afterstatement).slideUp('fast');
}}
});
$.fn.evoContentSlider=function(){
return this.each(function(){
const $slider=$(this);
const $inner=$slider.find('.evo_elm_HCS_in');
const scrollAmount=10;
let scrollTimeout;
updateButtonVisibility($slider);
$slider.data('evo-slider-initialized', true);
$slider.on('click', '.evo_elmHCS_nav.content_slide_trig', function(){
const $button=$(this);
const scrollDistance=parseInt($slider.width()) / 2;
const currentScroll=$inner.scrollLeft();
let newScroll;
if($button.hasClass('HCSnavR')){
newScroll=currentScroll + scrollDistance;
$slider.find('.HCSnavL')[0].classList.add('vis');
}else{
newScroll=Math.max(0, currentScroll - scrollDistance);
}
$inner.animate({ scrollLeft: newScroll }, 200, ()=> {
updateButtonVisibility($slider);
});
});
$inner[0].addEventListener('wheel', function(e){
e.preventDefault();
const delta=e.deltaY;
const scrollableLength=this.scrollWidth - parseInt($slider.width());
const newScroll=Math.max(0, Math.min($inner.scrollLeft() + (delta > 0 ? scrollAmount:-scrollAmount), scrollableLength));
$inner.scrollLeft(newScroll);
updateButtonVisibility($slider);
}, { passive: false });
$inner[0].addEventListener('scroll', function(){
clearTimeout(scrollTimeout);
scrollTimeout=setTimeout(()=> {
updateButtonVisibility($slider);
}, 100);
});
});
};
$('body').on('evo_reload_slider', function(event, $slider){
updateButtonVisibility($slider);
});
function updateButtonVisibility($slider){
const $inner=$slider.find('.evo_elm_HCS_in');
const scrollableLength=$inner[0].scrollWidth - parseInt($slider.width());
const currentScroll=$inner.scrollLeft();
const leftButton=$slider.find('.HCSnavL')[0];
const rightButton=$slider.find('.HCSnavR')[0];
if(scrollableLength <=0){
leftButton.classList.remove('vis');
rightButton.classList.remove('vis');
return;
}
leftButton.classList.toggle('vis', currentScroll >=10);
rightButton.classList.toggle('vis', currentScroll < scrollableLength - 5);
}
let resizeTimeout;
$(window).on('resize', function(){
clearTimeout(resizeTimeout);
resizeTimeout=setTimeout(()=> {
$('.evo_elm_HCS').each(function(){
updateButtonVisibility($(this), $(this).find('.evo_elm_HCS_in'));
});
}, 100);
});
BODY.find('.evo_elm_HCS').each(function(event){
$(this).evoContentSlider();
});
BODY.on('click', '.evo_elm_dynamic_select_trig',function(e){
e.preventDefault();
const btn=$(this);
const row=btn.closest('.evo_elm_dynamic_select');
const list=btn.find('.evoelm_ds_list');
row.toggleClass('open');
btn.toggleClass('open');
if(btn.hasClass('open')){
const options=btn.siblings('div').data('d');
let html=`<div class="evoelm_ds_list evobr10 evodfx evofx_dr_c evobgcw evofz14 evoff_2 evo_ofh evoposa evoleft0 " role="listbox" aria-labelledby="selected-option">`;
$.each(options, (index, value)=> {
html +=`<span class="evoelm_ds_list_item evopad10 evocurp evoborderb" role="option" tabindex="-1" data-index="${index}">${value}</span>`;
});
html +='</div>';
btn.append(html);
}else{
list.remove();
}});
$(document).click(function(event){
if(!$(event.target).closest('.evo_elm_dynamic_select').length){
const openBox=BODY.find('.evo_elm_dynamic_select.open');
openBox.removeClass('open').find('button').removeClass('open');
openBox.find('.evoelm_ds_list').remove();
}});
BODY.on('click','.evoelm_ds_list_item',function(event){
const item=$(this);
const box=item.closest('.evo_elm_dynamic_select');
const value=item.data('index');
box.find('.evoelm_ds_current').html(item.html());
box.find('input').val(value);
BODY.trigger('evoelm_dynamic_select_clicked', [ item, value, box ]);
box.removeClass('open');
box.find('button').removeClass('open');
item.parent().remove();
});
var file_frame;
var __img_index;
var __img_obj;
var __img_box;
var __img_type;
BODY.on('click','.evolm_img_select_trig',function(event){
event.preventDefault();
const $trigger=$(this);
const __img_obj=$(this);
const $row=$trigger.closest('.evo_elm_row');
const __img_box=__img_obj.closest('.evo_metafield_image');
const __img_actions=__img_obj.closest('.evolm_img_actions');
const __img_type=__img_box.hasClass('multi')? 'multi': 'single';
const uploaderId=$row.data('id');
if(__img_type=='single'&&__img_box.hasClass('has_img')) return;
if(__img_type=='multi'){
__img_index=__img_obj.data('index');
if(__img_obj.hasClass('on')){
__img_obj.css('background-image', '').removeClass('on');
__img_obj.find('input').val('');
return;
}}
if(file_frame){     file_frame.close(); file_frame=null;   }
var user_id=__img_actions.data('userid') ? parseInt(__img_actions.data('userid')):0;
var library_args={ type: 'image' };
if(user_id > 0){ library_args.author=user_id; }
file_frame=wp.media.frames.downloadable_file=wp.media({
title: 'Choose an Image',
button: {text: 'Use Image'},
multiple: false,
library: library_args,
});
if(uploaderId!=''||uploaderId!==undefined){
file_frame.uploaderId=uploaderId;
}
file_frame.on('select', function(){
var selection=file_frame.state().get('selection');
if(selection.length > 0){
var attachment=selection.first().toJSON();
if(__img_type=='single'){
__img_box.addClass('has_img');
__img_box.find('input.evo_meta_img').val(attachment.id);
__img_box.find('.evoelm_img_holder').css('background-image', 'url(' + attachment.url + ')');
}else{
__img_obj.css('background-image', 'url(' + attachment.url + ')').addClass('on');
__img_obj.find('input').val(attachment.id);
}}else{
console.log('No image selected');
}});
file_frame.on('error', function(error){
console.error('Media Uploader Error:', error); alert('Error: ' + error.message);
});
file_frame.open();
});
BODY.on('click','.evoel_img_remove_trig',function(){
const field=$(this).closest('.evo_metafield_image');
if(!(field.hasClass('has_img')) ) return;
field.removeClass('has_img');
field.find('input').val('');
field.find('button').addClass('chooseimg');
field.find('.evoelm_img_holder').css('background-image', '');
});
$('body').on('click','.evo_plusminus_change', function(event){
if(evo_general_params.cal.is_admin) return;
OBJ=$(this);
QTY=parseInt(OBJ.siblings('input').val());
MAX=OBJ.siblings('input').data('max');
if(!MAX) MAX=OBJ.siblings('input').attr('max');
NEWQTY=(OBJ.hasClass('plu'))?  QTY+1: QTY-1;
NEWQTY=(NEWQTY <=0)? 0: NEWQTY;
if(NEWQTY==0&&OBJ.hasClass('min')){    return;    }
NEWQTY=(MAX!=''&&NEWQTY > MAX)? MAX: NEWQTY;
if(isNaN(NEWQTY) ) NEWQTY=0;
OBJ.siblings('input').val(NEWQTY).attr('value',NEWQTY);
if(QTY!=NEWQTY) $('body').trigger('evo_plusminus_changed',[NEWQTY, MAX, OBJ]);
if(NEWQTY==MAX){
PLU=OBJ.parent().find('b.plu');
if(!PLU.hasClass('reached')) PLU.addClass('reached');
if(QTY==MAX)   $('body').trigger('evo_plusminus_max_reached',[NEWQTY, MAX, OBJ]);
}else{
OBJ.parent().find('b.plu').removeClass('reached');
}});
function EVO_Cal_Body_listeners(){
BODY.evo_cal_lb_listeners();
const EVO_Listeners={
E: {
B: $('body')
},
init(){
const { B }=this.E;
B.on('click.evoCal', '.evo_faq_toggle', (e)=> this.handle_faq_toggle(e));
B.on('click.evoCal', '.evo_trig_ajax', (e)=> this.handle_general_ajax(e));
B.on('click.evoCal', '.eventon_anywhere.evoajax', (e)=> this.handle_event_anywhere(e));
B.on('click.evoCal', '.evo_no_events_btn', (e)=> this.handle_no_events_btn(e));
B.on('click.evoCal', '.evcal_arrows', (e)=> this.handle_month_switch(e));
B.on('click.evoCal', '.evoShow_more_events', (e)=> this.handle_show_more_events(e));
B.on('runajax_refresh_eventtop.evoCal', (e, OBJ, nonce)=> this.handle_refresh_eventtop(e, OBJ, nonce));
B.on('evo_slidedown_eventcard_complete.evoCal', (e, event_id, obj, is_slide_down)=> this.handle_slidedown_complete(e, event_id, obj, is_slide_down));
B.on('calendar_month_changed.evoCal', (e, CAL)=> this.handle_calendar_month_changed(e, CAL));
B.on('click.evoCal', '.evo-gototoday-btn', (e)=> this.handle_gototoday_btn(e));
B.on('runajax_refresh_now_cal.evoCal', (e, OBJ, nonce)=> this.handle_refresh_now_cal(e, OBJ, nonce));
this.handle_cal_head_interactions();
B.on('show_cal_head_btn.evoCal', (e, obj)=> this.handle_show_cal_head_btn(e, obj));
B.on('hide_cal_head_btn.evoCal', (e, obj)=> this.handle_hide_cal_head_btn(e, obj));
B.on('click.evoCal', '.ajde_evcal_calendar.boxstyle3 .eventon_list_event', (e)=> this.handle_tile_box_click(e));
B.on('click.evoCal', '.eventon_list_event .desc_trig', (e)=> this.handle_desc_trig(e));
},
handle_faq_toggle(e){
const toggle=$(e.currentTarget);
const answer=toggle.next('.evo_faq_answer');
const icon=toggle.find('i.fa');
answer.toggle();
icon.toggleClass('fa-plus fa-minus');
},
handle_general_ajax(e){
const obj=$(e.target);
let ajax_data=obj.data();
$(document).data('evo_data', ajax_data);
this.E.B.trigger('evo_before_trig_ajax', [obj]);
const new_ajax_data=$(document).data('evo_data');
new_ajax_data['nn']=the_ajax_script.postnonce;
$.ajax({
beforeSend: ()=> {
this.E.B.trigger('evo_beforesend_trig_ajax', [obj, new_ajax_data]);
},
type: 'POST',
url: get_ajax_url('eventon_gen_trig_ajax'),
data: new_ajax_data,
dataType: 'json',
success: (return_data)=> {
this.E.B.trigger('evo_success_trig_ajax', [obj, new_ajax_data, return_data]);
},
complete: ()=> {
this.E.B.trigger('evo_complete_trig_ajax', [obj, new_ajax_data]);
}});
},
handle_event_anywhere(e){
e.preventDefault();
const obj=$(e.currentTarget);
const data=obj.data('sc');
if(data.ev_uxval=='4') return;
data['evortl']='no';
if('id' in data) data['event_id']=data.id;
data['ux_val']='3a';
data['ajax_eventtop_show_content']=false;
obj.evo_cal_lightbox_trigger(data, obj, false);
},
handle_no_events_btn(e){
this.E.B.trigger('click_on_no_event_btn', [$(e.currentTarget)]);
},
handle_month_switch(e){
e.preventDefault();
const CAL=$(e.currentTarget).closest('.ajde_evcal_calendar');
let dir=$(e.currentTarget).hasClass('evcal_btn_prev') ? 'prev':'next';
const cal_id=CAL.attr('id');
if(CAL.hasClass('evortl')){
dir=dir=='next' ? 'prev':'next';
}
if($(e.currentTarget).closest('.evo_footer_nav').length > 0){
const BOX=$(e.currentTarget).closest('.evo_footer_nav');
const offset=BOX.offset();
const scrolltop=$(window).scrollTop();
const viewport_top=offset.top - scrolltop;
CAL.addClass('nav_from_foot').data('viewport_top', viewport_top);
}
run_cal_ajax(cal_id, dir, 'switchmonth');
},
handle_show_more_events(e){
const CAL=$(e.currentTarget).closest('.ajde_evcal_calendar');
const SC=CAL.evo_shortcode_data();
const OBJ=$(e.currentTarget);
if(SC.show_limit_redir!==''){
window.location=SC.show_limit_redir;
return false;
}
if(SC.show_limit_ajax=='yes'){
const CURRENT_PAGED=parseInt(SC.show_limit_paged);
CAL.evo_update_cal_sc({ F: 'show_limit_paged', V: CURRENT_PAGED + 1 });
run_cal_ajax(CAL.attr('id'), 'none', 'paged');
}else{
const event_count=parseInt(SC.event_count);
const eventList=OBJ.parent();
const allEvents=eventList.find('.eventon_list_event').length;
const currentShowing=eventList.find('.eventon_list_event:visible').length;
for (let x=1; x <=event_count; x++){
const inde=currentShowing + x - 1;
eventList.find(`.eventon_list_event:eq(${inde})`).slideDown();
}
if(allEvents >=currentShowing&&allEvents <=(currentShowing + event_count)){
OBJ.fadeOut();
}}
},
handle_refresh_eventtop(e, OBJ, nonce){},
handle_slidedown_complete(e, event_id, obj, is_slide_down){
if(!is_slide_down) return;
setTimeout(()=> {
const OO=obj.closest('.eventon_list_event');
evo_cal_eventcard_interactions(OO, true);
}, 300);
},
handle_calendar_month_changed(e, CAL){
const SC=CAL.evo_shortcode_data();
const B=CAL.find('.evo-gototoday-btn');
const O=CAL.find('.evo_j_container');
O.find('.evo_j_months a').removeClass('set');
O.find(`.evo_j_months a[data-val="${SC.fixed_month}"]`).addClass('set');
O.find('.evo_j_years a').removeClass('set');
O.find(`.evo_j_years a[data-val="${SC.fixed_year}"]`).addClass('set');
if(SC.fixed_month!=B.data('mo')||SC.fixed_year!=B.data('yr')){
this.E.B.trigger('show_cal_head_btn', [B]);
}else{
this.E.B.trigger('hide_cal_head_btn', [B]);
}},
handle_gototoday_btn(e){
const obj=$(e.currentTarget);
const CAL=obj.closest('.ajde_evcal_calendar');
const calid=CAL.attr('id');
CAL.evo_update_cal_sc({ F: 'fixed_month', V: obj.data('mo') });
CAL.evo_update_cal_sc({ F: 'fixed_year', V: obj.data('yr') });
run_cal_ajax(calid, 'none', 'today');
this.E.B.trigger('hide_cal_head_btn', [obj]);
},
handle_refresh_now_cal(e, OBJ, nonce){
const section=OBJ.closest('.evo_eventon_live_now_section');
const CAL=section.find('.ajde_evcal_calendar').eq(0);
const dataA={
nonce: evo_general_params.n,
other: OBJ.data(),
SC: CAL.evo_shortcode_data()
};
$.ajax({
beforeSend: ()=> {
section.addClass('evoloading');
},
type: 'POST',
url: get_ajax_url('eventon_refresh_now_cal'),
data: dataA,
dataType: 'json',
success: (data)=> {
if(data.status=='good'){
section.html(data.html);
this.E.B.trigger('evo_refresh_designated_elm', [OBJ, 'evo_vir_data']);
}},
complete: ()=> {
section.removeClass('evoloading');
this.E.B.find('.evo_countdowner').each(function(){
$(this).evo_countdown();
});
}});
},
handle_cal_head_interactions(){
const { B }=this.E;
B.on('click.evoCal', '.cal_head_btn', (e)=> {
const obj=$(e.currentTarget);
if(obj.hasClass('vis')){
this.E.B.trigger('hide_cal_head_btn', [obj]);
}else{
this.E.B.trigger('show_cal_head_btn', [obj]);
}});
B.on('evo_cal_header_btn_clicked',function(event, O, CAL){
var SC=CAL.evo_shortcode_data();
if(evo_general_params.cal.search_openoninit) return;
if(O.hasClass('evo-search')){
if(O.hasClass('vis')){
CAL.find('.evo_search_bar').show(1, function(){
$(this).find('input').focus();
});
}else{
CAL.find('.evo_search_bar').hide();
}}
if(O.hasClass('evo-sort-btn')||O.hasClass('evo-filter-btn')){
CAL.find('.evo_search_bar').hide();
}});
},
handle_show_cal_head_btn(e, obj){
if(!obj.hasClass('evo-gototoday-btn')){
obj.siblings(':not(.evo-gototoday-btn)').removeClass('show vis');
}
obj.addClass('show vis');
const CAL=obj.closest('.ajde_evcal_calendar');
this.E.B.trigger('evo_cal_header_btn_clicked', [obj, CAL, 'show']);
},
handle_hide_cal_head_btn(e, obj){
const CAL=obj.closest('.ajde_evcal_calendar');
obj.removeClass('show vis');
this.E.B.trigger('evo_cal_header_btn_clicked', [obj, CAL, 'hide']);
},
handle_tile_box_click(e){
e.preventDefault();
e.stopPropagation();
$(e.currentTarget).find('.desc_trig').trigger('click');
},
handle_desc_trig(e){
e.preventDefault();
const $this=$(e.currentTarget);
const $eventBox=$this.closest('.eventon_list_event');
const $cal=$this.closest('.evo_lightbox').data('cal_id') ?
$('#' + $this.closest('.evo_lightbox').data('cal_id')) :
$this.closest('.ajde_evcal_calendar');
const SC=$cal.evo_shortcode_data();
const ux_val=$cal.evo_cal_event_get_uxval(SC, $this);
const event_id=$eventBox.data('event_id');
const exlk=$this.data('exlk');
const isSingleEventBox=$this.closest('.eventon_single_event').length > 0&&$cal.find('.evo-data').data('exturl');
const actions={
'3': ()=> this.open_lightbox($this, $cal, SC, event_id, $eventBox, ux_val),
'3a': ()=> this.open_lightbox($this, $cal, SC, event_id, $eventBox, ux_val),
'4': ()=> this.open_url($this, $this.attr('href')||$this.parent().siblings('.evo_event_schema').find('a').attr('href'), '_self'),
'4a': ()=> this.open_url($this, $this.attr('href')||$this.parent().siblings('.evo_event_schema').find('a').attr('href'), '_blank'),
'2': ()=> this.handle_external_link($this, isSingleEventBox),
'X': ()=> false,
'none': ()=> false,
'default': ()=> exlk==='1' ? this.handle_external_link($this, isSingleEventBox):this.slide_down_event_card($this, $eventBox, $cal, SC, event_id)
};
return (actions[ux_val]||actions['default'])();
},
open_lightbox($trigger, $cal, SC, event_id, $eventBox, ux_val){
const repeat_interval=parseInt($eventBox.data('ri'))||0;
const etttc_class=$cal.attr('class').split(' ').find(cls=> cls.startsWith('etttc_'))||'';
const new_SC_data={
...SC,
repeat_interval,
event_id,
ux_val,
evortl: $trigger.closest('.eventon_events_list').hasClass('evortl') ? 'yes':'no',
ajax_eventtop_show_content: true,
additional_class: etttc_class
};
$cal.evo_cal_lightbox_trigger(new_SC_data, $trigger, $cal);
return false;
},
open_url($this, url, target){
target=$this.attr('target')==='_blank' ? '_blank':target;
if(url) window.open(url, target);
return target==='_blank';
},
handle_external_link($trigger, isSingleEventBox){
if(isSingleEventBox) return false;
const url=$trigger.attr('href');
if(url){
window.open(url, $trigger.attr('target')==='_blank' ? '_blank':'_self');
}
return !!url;
},
slide_down_event_card($trigger, $eventBox, $cal, SC, event_id){
const $content=$eventBox.find('.event_description');
const isOpen=$content.hasClass('open');
if(SC.accord==='yes'){
$cal.find('.eventon_list_event').removeClass('open');
$cal.find('.event_description').slideUp().removeClass('open');
}
$eventBox.toggleClass('open', !isOpen);
$content[isOpen ? 'slideUp':'slideDown']().toggleClass('open', !isOpen);
if($eventBox.find('.evo_metarow_gmap').length){
$eventBox.find('.evo_metarow_gmap').evo_load_gmap({ trigger_point: 'slideDownCard' });
}
if($trigger.data('runjs')){
this.E.B.trigger('evo_load_single_event_content', [event_id, $trigger]);
}
this.E.B.trigger('evo_slidedown_eventcard_complete', [event_id, $trigger, !isOpen]);
return false;
}}
EVO_Listeners.init();
}
function EVO_Interactions(){
const interactions_class={
E:{ B: $('body')},
run(){
const { B }=this.E;
this.evoLightboxEnd();
this.evocardNavTrig();
this.evoMapExpandTrig();
this.handle_lightbox_processed();
this.handle_calendar_interactions();
this.handle_global_listners();
this.handle_tabs();
this.handle_aria_population();
},
handle_aria_population(){
const chars='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
const gen=()=> Array.from({length:9},()=>chars[Math.floor(Math.random()*62)]).join('');
const used=new Set();
$('.evo_aria_ready').each(function(){
const $label=$(this);
let $unique_label=$label.text().trim();
const $i=$label.siblings('.evo_aria_ready_match').first();
if(!$i.length) return;
let id;
do { id=gen(); } while (used.has(id));
used.add(id);
$unique_label=$unique_label.replace(/\[[^\]]*\]/, '['+id+']');
$label.html($unique_label);
$i.attr('aria-label', $unique_label);
$(this).attr('for', id);
$i.attr('id', id).removeAttr('aria-label');
});
},
evoLightboxEnd(){
this.E.B.on('evolightbox_end', (event, LB, CAL)=> {
setTimeout(()=> {
LB.find('.eventon_list_event').each(function(){
evo_cal_eventcard_interactions($(this), true);
});
_evo_run_eventcard_map_load();
LB.evo_cal_localize_time();
this.handle_aria_population();
}, 1000);
});
this.E.B.on('evolightbox_end', (e, LB, CAL, OO)=> {
if(!evo_general_params.cal.lbnav) return;
if(evo_general_params.cal.lbnav==='no') return;
if(OO===undefined||!('other_data' in OO)) return;
const event=$(OO.other_data.obj).closest('.event');
const calId=(CAL ? CAL.attr('id'):'');
const buttons=[
{ dir: 'prev', icon: 'left', sibling: event.prev('.event') },
{ dir: 'next', icon: 'right', sibling: event.next('.event') }
].filter(b=> b.sibling.length)
.map(b=> `
<div class='evocard_lb_navs'>
<button class='evocard_nav_trig ${b.dir} evoposa evocurp evohoop7 evobr30 evobgcw evodfx evofxjcc evofxaic evo_transit_all evoboxbb' data-id='${b.sibling.attr('id')}' data-cid='${calId}'>
<i class='fa fa-chevron-${b.icon}'></i>
</button>
</div>
`).join('');
LB.find('.evolb_box').append(buttons);
setTimeout(()=> LB.find('.evocard_nav_trig').addClass('show'), 500);
});
},
evocardNavTrig(){
this.E.B.on('click','.evocard_nav_trig',function(e){
e.preventDefault();
const $el=$(e.currentTarget);
const CAL=$('#' + $el.data('cid'));
const SC=CAL.evo_shortcode_data();
const eventId=$el.data('id').split('_')[1];
const newEvent=CAL.find(`#${$el.data('id')}`);
const newEventTrigger=newEvent.find('.desc_trig');
const LB=$el.closest('.evo_lightbox');
LB.find('.evocard_nav_trig').fadeOut().addClass('old');
setTimeout(()=> LB.find('.evocard_lb_navs').has('.old').remove(), 500);
LB.evo_lightbox_show_open_animation({ animation_type: 'saving' });
const updatedSC={
...SC,
repeat_interval: parseInt(newEvent.data('ri')),
ux_val: CAL.evo_cal_event_get_uxval(SC, newEventTrigger),
event_id: eventId,
ajax_eventtop_show_content: true,
evortl: newEvent.find('.eventon_events_list').hasClass('evortl') ? 'yes':'no',
additional_class: CAL.attr('class').match(/etttc_\w+/)?.[0]||'',
};
const newLbClass="evo_eventcard_"+eventId;
LB.removeClass(LB.data('lbc')).addClass(newLbClass).data('lbc', newLbClass);
setTimeout(()=> CAL.evo_cal_lightbox_trigger(updatedSC, newEventTrigger, CAL, LB), 1000);
});
},
evoMapExpandTrig(){
this.E.B.on('click','.evo_map_expand_trig',function(e){
e.preventDefault();
const $gmapDiv=$(this).closest('.evo_map').find('.evo_metarow_gmap');
const mapID=$gmapDiv.attr('id')+'_exp';
const $newDiv=$('<div id="'+ mapID +'" class="evo_lb_map evobr15" style="min-height:calc(100vh - 120px);"></div>');
const locationAdd=$gmapDiv.data('address');
const locationName=$gmapDiv.data('name');
const extra=`<div class='evodfx evofxdrr evofxaic evogap10 evomarr50'>
<input id="user-address-${mapID}" type="text" placeholder="Enter starting address"/>
<button id="get-directions-${mapID}" class='evo_nonbtn'><i class='fa fa-circle-arrow-right'></i></button>
<i class='fa fa-route evofz24i evocurp evoop5 evohoop7'></i>
<button class='evo_nonbtn evoff_2 evocurp evohoop7 evoop5'><i class='fa fa-calendar evomarr10 evofz24i'></i>More Events</button>
</div>`;
const $topDiv=`<div class='evodfx evofxdrr evogap10 evofxjcsb evofxaic evomarb10'>
<div class='evodfx evofxdrr evofxaic evogap10'>
<p class='evoff_1i evomar0i evofz18i'>${locationName}</p>
<p class='evomar0i evofz14i'>${locationAdd}</p>
</div>
</div>`;
const $botDiv=``;
$.each($gmapDiv.data(), function(key, value){
$newDiv.data(key, value).attr('data-'+key, value);
});
const calID=$(this).closest('.ajde_evcal_calendar').attr('id');
$(this).evo_lightbox_open({
uid: 'evo_map_expand',calid: calID,
lbdata:{ class:'evo_map_expand',content: $topDiv + $newDiv[0].outerHTML + $botDiv }});
});
},
handle_lightbox_processed(){
this.E.B.on('evo_lightbox_processed',function(e, OO, LB){
if(OO.uid=='evo_map_expand'){
setTimeout(function(){
LB.find('.evo_lb_map').evo_load_gmap({	cal: $('body').find('#'+ OO.calid)	});
}, 500);
}}).on('evo_ajax_success_evo_open_eventcard_lightbox', function(e, OO, data, el){
setTimeout(function(){
LB.find('.evcal_gmaps').evo_load_gmap({	cal: $('body').find('#'+ OO.d.calid)	});
}, 500);
});
},
handle_calendar_interactions(){
const { B }=this.E;
B.find('.ajde_evcal_calendar').each((index, calendar)=> {
const $calendar=$(calendar);
const $SC=$calendar.evo_shortcode_data();
if($calendar.hasClass('bub')){
$calendar.on('mouseover.evoCal', '.eventon_list_event', (e)=> {
const $event=$(e.currentTarget);
const $list=$event.closest('.eventon_events_list');
const title=$event.find('.evoet_dayblock').data('bub');
const position=$event.position();
$list.append(`<span class="evo_bub_box">${title}</span>`);
const $bubble=$list.find('.evo_bub_box');
let left=position.left;
let top=position.top - $bubble.height() - 30;
const listWidth=$list.width();
const totalWidth=position.left + $bubble.width() + $event.width();
if(totalWidth > listWidth){
left=position.left - $bubble.width() + $event.width() - 20;
}
$bubble.css({ top, left }).addClass('show');
}).on('mouseout.evoCal', '.eventon_list_event', (e)=> {
$(e.currentTarget).closest('.eventon_events_list').find('.evo_bub_box').remove();
});
}
$calendar.on('click.evoCal', '.evo-jumper-btn', (e)=> {
const $this=$(e.currentTarget);
$this.closest('.calendar_header').find('.evo_j_container').toggle();
$this.toggleClass('vis');
});
$calendar.on('click','.evo_j_dates a',function(){
var val=$(this).attr('data-val'),
type=$(this).parent().parent().attr('data-val'),
CAL=$calendar,
SC=CAL.evo_shortcode_data();
if(type=='m'){
CAL.evo_update_cal_sc({F:'fixed_month', V: val });
}else{
CAL.evo_update_cal_sc({F:'fixed_year', V: val });
}
run_cal_ajax(CAL.attr('id') ,'none','jumper');
if(SC.expj=='no')	container.delay(2000).slideUp();
});
$calendar.on('click', '.evo_vSW',function(){
const O=elm=$(this);
var DATA=O.data('d');
if(O.hasClass('focusX')) return;
CAL=$calendar;
CAL.find('.evoADDS').hide().delay(200).queue(function(){
$(this).remove();
});
var SC=$SC;
const cal_tz=CAL.evo_get_global({S1:'cal_def',S2:'cal_tz'});
var reload_cal_data=false;
_M1=moment().set({'year': SC.fixed_year, 'month':(SC.fixed_month -1), 'date':SC.fixed_day}).tz(cal_tz);
_M1.set('date',1).startOf('date');
_start=_M1.unix();
_M1.endOf('month').endOf('date');
_end=_M1.unix();
var DD=new Date(SC.fixed_year,SC.fixed_month -1 , SC.fixed_day, 0,0,0);
DD.setUTCHours(0);
DD.setUTCFullYear(SC.fixed_year);
DD.setUTCMonth(SC.fixed_month -1);
DD.setUTCDate(SC.fixed_day);
O.siblings('.evo_vSW').removeClass('focusX select');
O.addClass('focusX select');
CAL.find('.evo-viewswitcher-btn em').html(O.html());
O.closest('.evo_cal_view_switcher').removeClass('show');
if(DATA&&'ux_val' in DATA)	CAL.evo_update_cal_sc({F:'ux_val', V: DATA.ux_val });
O.siblings('.evo_vSW').each(function(){
var _d=$(this).data('d');
if(_d&&'c' in _d)	CAL.removeClass(_d['c']);
});
if(DATA&&'c' in DATA)	CAL.addClass(DATA.c);
CAL.find('.evoet_dayblock span').hide();
CAL.find('.evoet_dayblock span.evo_start').show();
CAL.find('.evoet_dayblock span.evo_end').show();
CAL.find('.evoet_dayblock span.evo_end.only_time').hide();
if(SC.focus_start_date_range!=_start&&SC.focus_end_date_range!=_end){
reload_cal_data=true;
CAL.evo_update_cal_sc({F:'focus_start_date_range',V: _start });
CAL.evo_update_cal_sc({F:'focus_end_date_range', V: _end });
}
if('el_visibility' in DATA){
el_visibility=DATA.el_visibility;
if(el_visibility=='show_events') CAL.find('.eventon_list_event').show();
if(el_visibility=='hide_events') CAL.find('.eventon_list_event').hide();
if(el_visibility=='hide_list') CAL.find('#evcal_list').addClass('evo_hide').hide();
if(el_visibility=='show_all'){
CAL.find('#evcal_list').removeClass('evo_hide').show();
CAL.find('.eventon_list_event').show();
}}
CAL.evo_update_cal_sc({F:'calendar_type', V: 'default'});
B.trigger('evo_vSW_clicked_before_ajax', [ O, CAL, DD, reload_cal_data ]);
if(reload_cal_data){
B.trigger('evo_run_cal_ajax',[CAL.attr('id'),'none','filering']);
}else{
B.trigger('evo_vSW_clicked_noajax', [ O, CAL ]);
}
B.trigger('evo_vSW_clicked', [ O, CAL, DD, reload_cal_data]);
if(elm.hasClass('evoti')){
CAL.find('.eventon_list_event').each(function(){
color=$(this).data('colr');
$(this).find('a.desc_trig').css({'background-color': color});
});
CAL.addClass('color').removeClass('sev').data('oC', 'sev');
}else{
if(CAL.hasClass('esty_0')||CAL.hasClass('esty_4')){
CAL.removeClass('color');
CAL.find('.eventon_list_event').each(function(){
$(this).find('a.desc_trig').css({'background-color': ''});
});
if(CAL.data('oC')!==undefined) CAL.addClass(CAL.data('oC'));
}}
});
});
},
handle_global_listners(){
const { B }=this.E;
B.on('evo_trigger_cal_reset', function(event, cal){
cal_resets(cal);
});
B.on('click', function(event){
BODY.trigger('clicked_on_page', [ $(event.target) , event ]);
});
B.find('.evo_location_map').each(function(){
$(this).evo_load_gmap();
});
B.on('evo_ajax_complete_eventon_get_tax_card_content', function(event,  OO){
LB=B.find('.'+ OO.lightbox_key);
setTimeout(function(){
if(LB.find('.evo_trigger_map').length > 0){
map_id_elm=LB.find('.evo_trigger_map');
map_id_elm.evo_load_gmap();
console.log('Loading Event Map');
}
LB.find('.evo_countdowner').each(function(){
$(this).evo_countdown();
});
CAL=LB.find('.ajde_evcal_calendar');
if(CAL.length) CAL.evo_cal_filtering();
},500);
});
},
handle_tabs(){
const { B }=this.E;
B.find('.evo_tab_container').each(function(){
$(this).find('.evo_tab_section').each(function(){
if(!$(this).hasClass('visible')){
$(this).addClass('hidden');
}});
});
B.on('click','.evo_tab',function(){
tab=$(this).data('tab');
tabsection=$(this).closest('.evo_tab_view').find('.evo_tab_container');
tabsection.find('.evo_tab_section').addClass('hidden').removeClass('visible');
tabsection.find('.'+tab).addClass('visible').removeClass('hidden');
$(this).parent().find('.evo_tab').removeClass('selected');
$(this).addClass('selected');
B.trigger('evo_tabs_newtab_selected',[ $(this)]);
});
},
};
interactions_class.run();
}
const EVO={
E:{
B: $('body')
},
init(){
this.Tools.init();
this.Interactions.init();
this.Virtual_Events.init();
this.Search.init();
this.Elements_Interactions.init();
this.setupGlobalListeners();
this.schedule_view();
this.ajax_triggers();
},
setupGlobalListeners(){
const { B }=this.E;
$(document).on('heartbeat-send', (e, data)=> {
if(this.BODY&&this.BODY.find('.evo_refresh_on_heartbeat').length){
this.BODY.find('.evo_refresh_on_heartbeat').each((i, el)=> {
if($(el).closest('.eventon_list_event').length <=0) return;
if($(el).data('refresh')!==undefined&&!$(el).data('refresh')) return;
data['evo_data']=EVO.Tools.build_elm_refresh_data($(el));
});
}});
$(document).on('heartbeat-tick', (e, data)=> {
EVO.Tools.evo_apply_refresh_content(data);
});
B.on('evo_refresh_elements', (e, send_data)=> {
if(!send_data||send_data.length <=0) return;
send_data['nonce']=evo_general_params.n;
$.ajax({
beforeSend: ()=> {
if('evo_data' in send_data){
$.each(send_data.evo_data, (ekey, eclasses)=> {
$.each(eclasses, (classnm, val)=> {
if(val&&'loader' in val&&val.loader&&'loader_class' in val){
$('#event_' + ekey).find('.' + val.loader_class).addClass('evoloading');
}});
});
}},
type: 'POST',
url: EVO.Tools.get_ajax_url('eventon_refresh_elm'),
data: send_data,
dataType: 'json',
success: (data)=> {
if(data.status==='good'){
EVO.Tools.evo_apply_refresh_content(data);
}},
complete: ()=> {
if('evo_data' in send_data){
$.each(send_data.evo_data, (ekey, eclasses)=> {
$.each(eclasses, (classnm, val)=> {
if(val&&'loader' in val&&val.loader&&'loader_class' in val){
$('#event_' + ekey).find('.' + val.loader_class).removeClass('evoloading');
}});
});
}}
});
});
B.on('evo_refresh_designated_elm', function(ee, elm, elm_class, extra_data){
const event=$(elm).closest('.eventon_list_event');
if(!event||event.find('.' + elm_class).length===0) return;
const refresh_elm=event.find('.' + elm_class);
let send_data={};
send_data['evo_data']=EVO.Tools.build_elm_refresh_data(refresh_elm , extra_data);
B.trigger('evo_refresh_elements',[ send_data ]);
});
},
schedule_view(){
EVO.E.B.on('evo_init_ajax_success_each_cal',function(event, data, i, v, CAL){
$('body').find('.ajde_evcal_calendar.evoSV').each(function(){
EVO.Tools.evosv_populate($(this));
});
})
.on('evo_main_ajax_before_fnc', function(event, CAL,  ajaxtype, data_arg){
SC=data_arg.shortcode;
if(SC.calendar_type=='schedule'){
CAL.find('#evcal_list').removeClass('evo_hide').show();
}}).on('evo_main_ajax_success', function(event, CAL,  ajaxtype, data , data_arg){
SC=data_arg.shortcode;
if(SC.calendar_type=='schedule'){
CAL.find('#evcal_list').addClass('evo_hide').hide();
}}).on('evo_main_ajax_complete', function(event, CAL,  ajaxtype, data , data_arg){
SC=data_arg.shortcode;
if(SC.calendar_type=='schedule'){
EVO.Tools.evosv_populate(CAL);
}})
.on('evo_vSW_clicked_before_ajax',function(event, O, CAL, DD, reload_cal_data){
if(!(O.hasClass('evosv'))) return;
var SC=CAL.evo_shortcode_data();
CAL.evo_update_cal_sc({F:'calendar_type', V: 'schedule'});
CAL.evo_update_cal_sc({F:'fixed_day', V: SC.fixed_day });
})
.on('evo_vSW_clicked',function(event, OBJ, CAL, DD, reload_cal_data){
if(!(OBJ.hasClass('evosv'))) return;
CAL.evo_update_cal_sc({F:'calendar_type', V: 'schedule'});
})
.on('evo_vSW_clicked_noajax',function(event, OBJ, CAL, DD, reload_cal_data){
if(!(OBJ.hasClass('evosv'))) return;
EVO.Tools.evosv_populate(CAL);
})
.on('click','.evosv_items',function(event, elm){
O=$(this);
CAL=O.closest('.ajde_evcal_calendar');
var e_cl='event_'+O.data('id');
const clicked_event_uxval=O.data('uxval');
if(clicked_event_uxval=='1'){
CAL.find('.'+e_cl).find('.desc_trig').data('ux_val', 3);
}
CAL.find('.'+e_cl).find('.desc_trig').trigger('click');
});
},
Interactions:{
init(){
const { B }=EVO.E;
},
},
Search:{
init(){
const { B }=EVO.E;
B.on('click.evoSearch', '.evo_do_search', (event)=> {
EVO.Tools.do_search_box($(event.target));
});
B.on('keypress.evoSearch', '.evo_search_field', (ev)=> {
if((ev.keyCode||ev.which)===13){
EVO.Tools.do_search_box($(ev.target).siblings('.evo_do_search'));
}});
B.on('keypress.evoSearch', '.evo_search_bar_in_field', (ev)=> {
if((ev.keyCode||ev.which)===13){
EVO.Tools.search_within_calendar($(ev.target));
}});
B.on('click', '.evosr_search_clear_btn', function(e){
e.preventDefault(); EVO.Tools.reset_search($(this).siblings('input'), $(this));
});
B.on('evo_main_ajax_complete', function(e, CAL, ajaxtype, responseJSON, data){
if(ajaxtype==='search'&&data.shortcode['s']){
CAL.find('.evosr_search_clear_btn').addClass('show');
}});
B.on({
'click': function(){ EVO.Tools.search_within_calendar($(this).siblings('input')); },
'keyup': function(e){
const $input=$(this), $clearBtn=$input.siblings('.evosr_search_clear_btn');
if(e.which===27){ e.preventDefault(); EVO.Tools.reset_search($input, $clearBtn); return; }
$clearBtn.toggleClass('show', $input.val().trim()!=='');
}}, '.evo_search_bar_in_field, .evosr_search_btn');
}},
Elements_Interactions:{
init(){
const { B }=EVO.E;
B.on('click','.evo_qty_change', function(event){
var OBJ=$(this);
var QTY=oQTY=parseInt(OBJ.siblings('em').html());
var MAX=OBJ.siblings('input').attr('max');
var BOX=OBJ.closest('.evo_purchase_box');
var pfd=BOX.find('.evo_purchase_box_data').data('pfd');
(OBJ.hasClass('plu'))?  QTY++: QTY--;
QTY=(QTY==0)? 1: QTY;
QTY=(MAX!=''&&QTY > MAX)? MAX: QTY;
var sin_price=OBJ.parent().data('p');
new_price=sin_price * QTY;
new_price=EVO.Tools.get_format_price(new_price, pfd);
BOX.find('.total .value').html(new_price);
OBJ.siblings('em').html(QTY);
OBJ.siblings('input').val(QTY);
B.trigger('evo_qty_changed',[QTY,oQTY, new_price,OBJ ]);
});
}},
Virtual_Events:{
init(){
const { B }=EVO.E;
this.jitsi();
B.on('click','.evo_vir_signin_btn',function(){
let extra_data={};
extra_data['signin']='y';
extra_data['refresh_main']='y';
extra_data['loader']=true;
extra_data['loader_class']='evo_vir_main_content';
B.trigger('evo_refresh_designated_elm',[ $(this) , 'evo_vir_data',extra_data]);
});
},
jitsi(mod_refresh){
const { B }=EVO.E;
const domain='meet.jit.si';
let api=[];
B.find('.evo-jitsi-wrapper').each(function(index, element){
const O=$(this);
const eventO=O.closest('.eventon_list_event');
if(mod_refresh!=''&&mod_refresh=='mod_refresh_no'&&O.hasClass('mod')) return;
const roomName=$(element).data('n');
const width=$(element).data('width');
const height=$(element).data('height');
const audioMuted=$(element).data('audiomute');
const videoMuted=$(element).data('videomute');
const screenSharing=$(element).data('screen');
const myOverwrite =
{
'TOOLBAR_BUTTONS': $(element).data('d'),
"DEFAULT_BACKGROUND": '#494a4e',
'MOBILE_APP_PROMO': false,
'SETTINGS_SECTIONS':['devices', 'language', 'profile', 'calendar'],
};
const options={
roomName,
width,
height,
parentNode: element,
configOverwrite: {
startWithAudioMuted: audioMuted,
startWithVideoMuted: videoMuted,
startScreenSharing: false,
disableInviteFunctions: false,
},
interfaceConfigOverwrite: myOverwrite,
};
api=new JitsiMeetExternalAPI(domain, options);
api.addEventListener('participantRoleChanged', function(event){
if(event.role==="moderator"){
this._record_moderator_join('yes', eventO.data('event_id'), eventO.data('ri'));
}
const pp=jQuery(element).data('p');
if(event.role==="moderator"&&pp!='__'){
ppp=pp.replace('_','');
api.executeCommand ('password', ppp);
}});
api.addEventListener('videoConferenceLeft', function(event){
if(eventO.find('.evo_vir_data').data('ismod')=='y'){
this._record_moderator_join('no', eventO.data('event_id'), eventO.data('ri'));
O.siblings('.evo_vir_mod_left').show();
O.hide();
}});
});
},
_record_moderator_join(joined, eid, ri){
var data_arg={
'action': 'eventon_record_mod_joined',
'eid': eid,
'ri': ri,
'joined': joined,
'nonce': evo_general_params.n,
};
$.ajax({
beforeSend: function(){},
type: 'POST',url: ajax_url,
data: data_arg,dataType:'json',
success:function(data){	}});
}},
ajax_triggers(){
const { B }=EVO.E;
B.on('evo_before_trig_ajax',function(event, obj){
if(!obj.hasClass('evo_trig_vir_end')) return;
var new_ajax_data=$(document).data('evo_data');
new_ajax_data['fnct']='mark_event_ended';
$(document).data('evo_data', new_ajax_data);
})
.on('evo_beforesend_trig_ajax',function(event, obj, new_ajax_data){
if(!obj.hasClass('evo_trig_vir_end')) return;
obj.closest('.evo_vir_mod_box').addClass('evoloading');
})
.on('evo_success_trig_ajax',function(event, obj, new_ajax_data, return_data){
if(!obj.hasClass('evo_trig_vir_end')) return;
if(!('_vir_ended' in return_data)) return;
extra_data={};
extra_data['refresh_main']='yy';
extra_data['loader']=true;
extra_data['loader_class']='evo_vir_main_content';
B.trigger('evo_refresh_designated_elm',[ obj , 'evo_vir_data',extra_data]);
})
.on('evo_complete_trig_ajax',function(event, obj, new_ajax_data){
if(!obj.hasClass('evo_trig_vir_end')) return;
obj.closest('.evo_vir_mod_box').removeClass('evoloading');
});
},
Tools:{
init(){
const { B }=EVO.E;
B.on('evo_ajax_beforesend_evo_get_search_results', (event, OO, el)=> {
$(el).find('.evo_search_results_count').hide();
$(el).addClass('searching');
}).on('evo_ajax_complete_evo_get_search_results', (event, OO, el)=> {
$(el).removeClass('searching');
}).on('evo_ajax_success_evo_get_search_results', (event, OO, data, el)=> {
$(el).find('.evo_search_results').html(data.content);
if($(el).find('.no_events').length===0){
const Events=$(el).find('.eventon_list_event').length;
$(el).find('.evo_search_results_count span').html(Events);
$(el).find('.evo_search_results_count').fadeIn();
}});
},
do_search_box(OBJ){
const { B }=EVO.E;
const SearchVal=OBJ.closest('.evosr_search_box').find('input').val();
const Evosearch=OBJ.closest('.EVOSR_section');
OBJ.closest('.evo_search_entry').find('.evosr_msg').toggle(!SearchVal);
if(!SearchVal) return false;
var ajax_results=Evosearch.evo_admin_get_ajax({
'ajaxdata': {
search: 		SearchVal,
shortcode:  	Evosearch.find('span.data').data('sc'),
nonce: 			evo_general_params.n
},
ajax_type:'endpoint',
ajax_action:'eventon_search_evo_events',
uid:'evo_get_search_results',
end: 'client',
});
},
search_within_calendar($input){
const ev_cal=$input.closest('.ajde_evcal_calendar');
ev_cal.evo_update_cal_sc({ F: 'show_limit_paged', V: '1' });
ev_cal.evo_update_cal_sc({ F: 's', V: $input.val() });
run_cal_ajax(ev_cal.attr('id'), 'none', 'search');
return false;
},
reset_search($input, $clearBtn){
const ev_cal=$input.closest('.ajde_evcal_calendar');
ev_cal.evo_update_cal_sc({ F: 's', V: '' });
run_cal_ajax(ev_cal.attr('id'), 'none', 'search');
$input.val('');
$clearBtn.removeClass('show');
},
get_format_price(price, data){
PF=data;
totalPrice=price.toFixed(PF.numDec);
htmlPrice=totalPrice.toString().replace('.', PF.decSep);
if(PF.thoSep.length > 0){
htmlPrice=EVO.Tools._addThousandSep(htmlPrice, PF.thoSep);
}
if(PF.curPos=='right'){
htmlPrice=htmlPrice + PF.currencySymbol;
}
else if(PF.curPos=='right_space'){
htmlPrice=htmlPrice + ' ' + PF.currencySymbol;
}
else if(PF.curPos=='left_space'){
htmlPrice=PF.currencySymbol + ' ' + htmlPrice;
}else{
htmlPrice=PF.currencySymbol + htmlPrice;
}
return htmlPrice;
},
_addThousandSep(n, thoSep){
var rx=/(\d+)(\d{3})/;
return String(n).replace(/^\d+/, function(w){
while(rx.test(w)){
w=w.replace(rx, '$1'+thoSep+'$2');
}
return w;
});
},
evo_apply_refresh_content(data){
const { B }=EVO.E;
if(!('evo_data' in data)) return;
$.each(data.evo_data, function(eclass, boxes){
var vir_data_vals=false;
if('evo_vir_data' in boxes) vir_data_vals=boxes.evo_vir_data.data;
B.find('.'+eclass).each(function(){
const event_elm=$(this);
$.each(boxes, (boxclass, boxdata)=> {
if(boxdata=='') return;
if(!boxdata.html||event_elm.find('.' + boxclass).length <=0) return;
event_elm.find('.' + boxclass).html(boxdata.html);
});
if(vir_data_vals){
if(vir_data_vals&&('vir_type' in vir_data_vals)
&& vir_data_vals.vir_type=='jitsi'
&& ('evo_vir_main_content' in boxes)
&& ('html' in boxes.evo_vir_main_content)
&& boxes.evo_vir_main_content.html!=''
){
EVO.Virtual_Events.jitsi('mod_refresh_no');
}
$.each(boxes, function(boxclass, boxdata){
if(boxdata.data==''||boxdata.data===undefined) return;
if(boxdata!==undefined&&vir_data_vals.vir_type=='jitsi'&&vir_data_vals.mod_joined=='left'){
boxdata.data['refresh_main']='yy';
}
event_elm.find('.'+boxclass).data(boxdata.data);
});
}});
});
},
build_elm_refresh_data(elm , extra_data){
const dataObj={};
const event=$(elm).closest('.eventon_list_event');
const ekey=event.data('event_id') + '_' + parseInt(event.data('ri'));
dataObj[ekey]={};
const key2=elm.data('key');
dataObj[ekey][key2]=elm.data();
if(elm.data('check_awaitmod')){
if((event.find('.evo_vir_jitsi_waitmod').length > 0)) dataObj[ekey][key2]['refresh_main']='yy';
if(event.find('.evo-jitsi-wrapper').length > 0&&dataObj[ekey][key2]['mod_joined']!=='left')
dataObj[ekey][key2]['refresh_main']='';
}
if(extra_data&&extra_data!==undefined){
$.each(extra_data, (index, val)=> {
dataObj[ekey][key2][index]=val;
});
}
return dataObj;
},
evosv_populate(CAL){
var SC=CAL.evo_shortcode_data();
OD=CAL.evo_get_OD();
var cal_events=CAL.find('.eventon_list_event');
days_in_month=CAL.evo_day_in_month({M: SC.fixed_month, Y: SC.fixed_year});
time_format=CAL.evo_get_global({S1:'cal_def',S2:'wp_time_format'});
_txt=CAL.evo_get_txt({V:'no_events'});
_txt2=CAL.evo_get_txt({V:'until'});
_txt3=CAL.evo_get_txt({V:'from'});
_txt4=CAL.evo_get_txt({V:'all_day'});
CAL.find('#evcal_list').addClass('evo_hide');
var has_events=false;
var html='';
var template_data={};
var processed_ids={};
var SU=parseInt(SC.focus_start_date_range);	var EU='';
var M=moment.unix(SU).tz(OD.cal_tz);
for(var x=1; x<=days_in_month; x++){
var month_name=CAL.evo_get_dms_vals({ V: (M.get('month') +1), type:'m3'});
var day_name=CAL.evo_get_dms_vals({ V: M.day(), type:'d3'});
SU=M.unix();	M.endOf('day');
EU=M.unix();	M.startOf('day');
var events={};
cal_events.each(function(index, elm){
ED=$(elm).evo_cal_get_basic_eventdata();
if(!ED) return;
processed_ids[ED.uID]=ED.uID;
ESU=ED.unix_start; EEU=ED.unix_end;
var inrange=CAL.evo_is_in_range({
'S': SU,	'E': EU,	'start': ESU,	'end':EEU
});
if(!inrange) return;
has_events=true;
m=moment.unix(ESU).tz(OD.cal_tz);
me=moment.unix(end).tz(OD.cal_tz);
var all_day=$(elm).find('a.desc_trig').hasClass('allday') ? true: false;
if(all_day){
ED['t']=_txt4;
}else{
if(ESU <=SU){
if(EEU >=EU) ED['t']=_txt4;
if(EEU < EU) ED['t']=_txt2+' ' + me.format(time_format);
}else if(ESU > SU){
if(EEU >=EU)  ED['t']=_txt3+' '+ m.format(time_format);
if(EEU < EU) ED['t']=m.format(time_format) +' - '+ me.format(time_format);
}}
if(ED.hide_et=='y')		ED['t']=m.format(time_format);
events[index]=ED;
});
if(events&&Object.keys(events).length > 0){
template_data[ x ]={};
template_data[ x ]['date']='<b>' + M.get('date')+'</b> '+ month_name+' '+ day_name;
template_data[ x ]['d']=M.format('YYYY-M-D');
template_data[ x ]['SU']=SU;
template_data[ x ]['events']={}
$.each(events, function(index, item){
location_data=organizer_data=event_tags='';
if(SC.show_location=='yes'&&'location' in item){
location_data="<div class='evosv_subdata evosv_location'><i class='fa fa-location-pin marr5'></i>" +item.location+"</div>";
}
if(SC.show_organizer=='yes'&&'organizer' in item){
organizer_data="<div class='evosv_subdata evosv_org'>" +item.organizer+"</div>";
}
if(SC.show_tags=='yes'&&'event_tags' in item){
event_tags="<div class='evosv_subdata evosv_tags'>";
$.each(item.event_tags, function(index, val){
event_tags +="<span class='evosv_tag " + index +"'>" + val+"</span>";
});
event_tags +="</div>";
}
template_data[ x ]['events'][ item.uID ]={
'time': item.t,
'ux_val': item.ux_val,
'title': item.event_title,
'color':item.hex_color,
'tag': event_tags,
'loc': location_data,
'org': organizer_data,
'i': item
}});
}
M.add(1, 'd');
}
var html_="<div class='evosv_grid evoADDS'>";
if(!has_events){
no_event_content=CAL.evo_get_global({S1: 'html', S2:'no_events'});
html_ +="<div class='date_row'><div class='row no_events evosv'>"+no_event_content+"</div></div>";
}else{
html_ +=CAL.evo_HB_process_template({
TD:template_data, part:'evosv_grid'
});
}
html_ +='</div>';
if(CAL.find('.evosv_grid').length > 0){
CAL.find('.evosv_grid').replaceWith(html_);
}else{
ELM=CAL.find('#eventon_loadbar_section');
ELM.after(html_);
}},
get_ajax_url(action){
var ajax_type='endpoint';
if('ajax_method' in evo_general_params) ajax_type=evo_general_params.ajax_method;
return EVO.E.B.evo_get_ajax_url({a:action, type: 	ajax_type });
},
}};
EVO.init();
function cal_resets(calOBJ){
calargs=$(calOBJ).find('.cal_arguments');
calargs.attr('data-show_limit_paged', 1);
calOBJ.evo_update_cal_sc({
F:'show_limit_paged',V:'1'
});
}
if($('body').find('.evo_layout_changer').length>0){
$('body').find('.evo_layout_changer').each(function(item){
if($(this).parent().hasClass('boxy')){
$(this).find('.fa-th-large').addClass('on');
}else{
$(this).find('.fa-reorder').addClass('on');
}});
$('.evo_layout_changer').on('click','i',function(){
const CAL=$(this).closest('.ajde_evcal_calendar');
TYPE=$(this).data('type');
$(this).parent().find('i').removeClass('on');
$(this).addClass('on');
if(TYPE=='row'){
CAL.attr('class','ajde_evcal_calendar');
CAL.find('.eventon_list_event').each(function(){
$(this).find('.desc_trig').css('background-color',  '');
$(this).find('.desc_trig_outter').css('background-color',  '');
});
}else if(TYPE=='bar'){
CAL.attr('class','ajde_evcal_calendar  box_2 sev cev');
CAL.find('.eventon_list_event').each(function(){
const color=$(this).data('colr');
$(this).find('.desc_trig').css('background-color',  color);
});
}else{
CAL.find('.eventon_list_event').each(function(){
const color=$(this).data('colr');
$(this).find('.desc_trig_outter').css('background-color',  color);
});
CAL.attr('class','ajde_evcal_calendar boxy boxstyle0 box_2');
}});
}
$('body').on('click', '.evo_sort_option',function(){
O=$(this);
var CAL=O.closest('.ajde_evcal_calendar');
var sort_by=O.data('val');
CAL.evo_update_cal_sc({F:'sort_by',V:sort_by});
O.parent().find('p').removeClass('select');
O.addClass('select');
run_cal_ajax(CAL.attr('id'),'none','sorting');
});
BODY.on('clicked_on_page',function(ev, obj, ee){
if(!(obj.hasClass('eventon_filter')) &&
!(obj.hasClass('filtering_set_val')) &&
!(obj.hasClass('evo_filter_val')) &&
!(obj.hasClass('evofp_filter_search_i')) &&
obj.parents('.filtering_set_val').length==0 
){
BODY.find('.evo_filter_menu').html('');
BODY.find('.evo_filter_tax_box.vis').removeClass('vis');
}});
$.fn.evo_cal_filtering=function(O){
var opt=$.extend({}, O);
var el=this;
const sortbox=el.find('.eventon_sorting_section'),
filter_container=sortbox.find('.evo_filter_container_in'),
filter_line=sortbox.find('.eventon_filter_line'),
fmenu=sortbox.find('.evo_filter_menu'),
all_cal_filter_data=el.evo_get_filter_data(),
SC=el.evo_shortcode_data();
var tterms=[];
var init=function(){
if(SC==''||SC===null) return;
if(el.hasClass('filters_go'))	return;
el.addClass('filters_go');
draw_filter_bar();
filter_actions();
run_filter_nav_check();
}
var draw_filter_bar=function(){
BODY.trigger('evo_filter_before_draw', [ el ]);
html='';
$.each(all_cal_filter_data , function(index, value){
if(SC&&'fast_filter' in SC&&SC.fast_filter=='yes'&&SC.ff_tax!=''&&SC.ff_tax!==undefined){
__t=SC.ff_tax.split(',');
if(__t.includes(index) ) return;
}
html +="<div class='eventon_filter evo_filter_tax_box evo_hideshow_st "+index+"' data-tax='"+ value.__tax +"' data-filter_type='"+ value.__filter_type +"'>";
html +="<div class='eventon_filter_selection'>";
html +="<p class='filtering_set_val'><i class='fa fa-check'></i> "+ value.__name +"<em class='fa fa-caret-down'></em></p>";
html +="</div>";
html +="</div>";
});
filter_line.html(html);
BODY.trigger('evo_filter_drawn', [ el ]);
}
var filter_actions=function(){
el.off('click', '.evo-filter-btn');
el.on('click','.evo-filter-btn',function(){
const CAL=$(this).closest('.ajde_evcal_calendar');
BODY.trigger('evo_filter_btn_trig', [ CAL , O ]);
if(CAL.hasClass('fp_lb')) return;
if(!($(this).hasClass('vis')) ){
sortbox.addClass('vis');
run_filter_nav_check();
}else{
sortbox.removeClass('vis');
}});
BODY.on('evo_cal_header_btn_clicked',function(event, O){
if(O.hasClass('evo-sort-btn')||O.hasClass('evo-search')){
const CAL=O.closest('.ajde_evcal_calendar');
CAL.find('.eventon_sorting_section').removeClass('vis');
}});
el.on('click','.filtering_set_val',function(){
O=$(this);
const filterbox=O.closest('.evo_filter_tax_box'),
filter_tax=filterbox.data('tax');
selected_terms=el.evo_cal_get_filter_sub_data(filter_tax , 'tterms');
el.find('.eventon_sort_line').hide();
if(filterbox.hasClass('vis')){
filterbox.removeClass('vis');
close_filter_menu();
return;
}
if(fmenu.data('tax')==filter_tax){
filterbox.removeClass('vis');
close_filter_menu();
return;
}else{
sortbox.find('.filtering_set_val').removeClass('show');
sortbox.find('.evo_filter_tax_box').removeClass('vis');
filterbox.addClass('vis');
}
var filter_item_data=all_cal_filter_data[ filter_tax ].__list;
var __menu_html='<div class="evo_filter_inside evo_filter_menu_in" data-tax="'+filter_tax+'"><div class="eventon_filter_dropdown">';
var sorted_data=Object.values(filter_item_data);
sorted_data.sort(function(a, b){
return a[1].localeCompare(b[1], 'en', {
numeric: true,
sensitivity: 'base'
});
});
var menuInside='';
var AllHtml='';
$.each(sorted_data, function (index, val){
var icon_html='';
var _class=filter_tax+'_'+ val[0] + ' '+ val[0];
if(val[3]!==undefined&&val[3]!=''&&val[3]=='n') _class +=' np';
if(selected_terms=='all')  _class +=' select';
if(selected_terms.includes(val[0]) )  _class +=' select';
if(val[2]!=''&&val[2]!==undefined){
_class +=' has_icon'; icon_html=val[2];
}
var _tax_color='';
if(val[4]!=''&&val[4]!==undefined){
_tax_color=`style='background-color:#${val[4]};'`;
}
const itemHTML=`<p class="evo_filter_val ${_class}" data-id="${val[0]}" ${_tax_color}>${icon_html} ${val[1]}</p>`;
if(val[0]=='all'){
AllHtml=itemHTML;
}else{
menuInside +=itemHTML;
}});
__menu_html +=AllHtml + menuInside +"</div></div>";
BODY.trigger('evo_filter_menu_html_ready', [ el , __menu_html , O , filterbox, filter_tax]);
if(el.hasClass('fp_side')) return;
const scrolled_width=filter_container.scrollLeft();
fmenu.html(__menu_html);
BODY.trigger('evo_filter_menu_built', [ el , fmenu , filter_tax ]);
__left_margin=filterbox.position().left + 10 - scrolled_width;
__menu_width=fmenu.find('.evo_filter_inside').width();
__cal_left_margin=el.position().left;
if(__left_margin + __menu_width + __cal_left_margin > $(window).width()){
if(( __left_margin + __menu_width) > el.width()){
new_left=el.width() - __menu_width - 10;
}else{
new_left=(el.width() - __menu_width) / 2;
}
fmenu.css('left', new_left);
}else{
fmenu.css('left', __left_margin);
}});
el.on('click','p.filtering_static_val',function(){
BODY.trigger('evo_filter_static_clicked', [ el , $(this) ]);
});
el.on('click','p.evo_filter_val',function (){
var O=$(this);
const filter_menuIN=O.closest('.evo_filter_inside'),
filter_tax=filter_menuIN.data('tax'),
filterbox=sortbox.find('.evo_filter_tax_box.'+ filter_tax),
all_terms_obj=filter_menuIN.find('p'),
new_term_id=O.data('id'),
old_terms=el.evo_cal_get_filter_sub_data(filter_tax , 'terms')
;
var tterms=el.evo_cal_get_filter_sub_data(filter_tax , 'nterms');
var new_terms=[];
if(SC.filter_type=='select'){
if(new_term_id=='all'){
if(O.hasClass('select')){
all_terms_obj.removeClass('select');
}else{
all_terms_obj.addClass('select');
new_terms.push('all');
}}else{
filter_menuIN.find('p.all').removeClass('select');
O.toggleClass('select');
var unselect_count=0;
all_terms_obj.each(function(){
if($(this).hasClass('select')){
new_terms.push($(this).data('id'))
}else{
if(!$(this).hasClass('all')) unselect_count++;
}});
if(unselect_count==0){
filter_menuIN.find('p.all').addClass('select');
new_terms.push('all');
}
if(new_terms.length==0&&O.parent().find('p.all').length==0)
new_terms.push('all');
}}else{
if(new_term_id=='all'){
if(O.hasClass('select')){
new_terms.push('NOT-all');
all_terms_obj.removeClass('select');
}else{
all_terms_obj.addClass('select');
new_terms.push(new_term_id);
}}else{
all_terms_obj.removeClass('select');
O.addClass('select');
new_terms.push(new_term_id);
}
update_filter_data(filter_tax, new_terms);
if(tterms==new_terms){
close_filter_menu();
}else{
cal_resets(el);
el.evo_update_sc_from_filters();
run_cal_ajax(el.attr('id') ,'none','filering');
close_filter_menu();
O.removeClass('show');
}
close_filter_menu();
filterbox.removeClass('vis');
}
if(compare_terms(new_terms, tterms)){
filterbox.removeClass('chg');
}else{
filterbox.addClass('chg');
}
if(compare_terms(old_terms, new_terms)){
filterbox.removeClass('set');
}else{
filterbox.addClass('set');
}
var chg_filters=sortbox.find('.evo_filter_tax_box.chg').length;
var set_count=sortbox.find('.evo_filter_tax_box.set').length;
if(SC.filter_type=='select')
(chg_filters > 0) ? show_apply_btns():hide_apply_btns();
if(!(el.hasClass('flhi')) ){
const filter_btn=el.find('.evo-filter-btn');
if(set_count > 0){
filter_btn.find('em').html(set_count).addClass('o');
}else{
filter_btn.find('em').removeClass('o');
}}
update_filter_data(filter_tax, new_terms , 'tterms');
run_filter_nav_check();
});
el.on('click','.evo_filter_submit',function(){
el.evo_filters_update_from_temp(filter_line, el);
cal_resets(el);
close_filter_menu();
sortbox.find('.filtering_set_val').removeClass('show');
el.evo_update_sc_from_filters();
run_cal_ajax(el.attr('id'),'none','filering');
run_filter_nav_check();
});
el.on('click','.evo_filter_clear',function(){
el.find('.evo_filter_tax_box').each(function(){
const O=$(this),
tax=O.data('tax'),
terms=O.data('terms');
O.removeClass('set');
O.find('.filtering_set_val').removeClass('set show');
el.find('.evo-filter-btn em').removeClass('o');
close_filter_menu();
});
$.each(all_cal_filter_data, function(tax, tdata){
update_filter_data(tax, tdata.terms);
});
hide_apply_btns();
el.evo_update_sc_from_filters();
run_cal_ajax(el.attr('id'),'none','filering');
run_filter_nav_check();
});
el.on('click','.evo_filter_nav',function(){
O=$(this);
_filter_bar=O.closest('.evo_filter_bar');
_filter_container=_filter_bar.find('.evo_filter_container_in');
_filter_line_width=_filter_bar.find('.eventon_filter_line')[0].scrollWidth;
_filter_container_width=parseInt(_filter_container.width()) + 0;
_leftPos=_filter_container.scrollLeft();
_scrollable_legth=_filter_line_width - _filter_container_width;
const scroll_length=_filter_container_width /2;
if(O.hasClass('evo_filter_r')){
_filter_container.animate({scrollLeft:_leftPos + scroll_length},200);
_filter_bar.find('.evo_filter_l').addClass('vis');
}else{
sleft=(_leftPos - scroll_length < scroll_length) ? 0:_leftPos - scroll_length;
_filter_container.animate({scrollLeft: sleft },200);
}
close_filter_menu();
setTimeout(function(){
var _leftPos=_filter_container.scrollLeft();
if(_leftPos < 10){
_filter_bar.find('.evo_filter_l').removeClass('vis');
_filter_bar.find('.evo_filter_r').addClass('vis');
}
if(_leftPos >(_scrollable_legth - 5) ){
_filter_bar.find('.evo_filter_r').removeClass('vis');
}},200);
});
$(window).on('resize',function(){
run_filter_nav_check();
});
}
var compare_terms=function(a, b){
if(a===b) return true;
if(a==null||b==null) return false;
if(a.length!==b.length) return false;
for (var i=0; i < a.length; ++i){
if(a[i]!==b[i]) return false;
}
return true;
}
var close_filter_menu=function(){
fmenu.html('').data('tax','');
}
var show_apply_btns=function(){
sortbox.find('.evo_filter_aply_btns').addClass('vis');
}
var hide_apply_btns=function(){
sortbox.find('.evo_filter_aply_btns').removeClass('vis');
}
var update_filter_data=function(tax, new_val, key){
el.evo_cal_update_filter_data(tax , new_val , key);
}
var run_filter_nav_check=function(){
$.each(el.find('.evo_filter_bar') , function(event){
_filter_bar=$(this);
_filter_container=_filter_bar.find('.evo_filter_container_in');
_filter_line_width=_filter_bar.find('.eventon_filter_line')[0].scrollWidth;
_filter_container_width=parseInt(_filter_container.width()) + 3;
var leftPos=_filter_container.scrollLeft();
if(_filter_line_width > _filter_container_width){
if(( _filter_container_width + leftPos) < _filter_line_width)
_filter_bar.find('.evo_filter_r').addClass('vis');
if(leftPos > 0){
_filter_bar.find('.evo_filter_l').addClass('vis');
}else{
_filter_bar.find('.evo_filter_r').addClass('vis');
}}else{
_filter_bar.find('.evo_filter_l').removeClass('vis');
_filter_bar.find('.evo_filter_r').removeClass('vis');
}});
}
init();
}
$.fn.evo_filters_update_from_temp=function(filter_line, cal){
filter_line.find('.evo_filter_tax_box').each(function(){
var taxonomy=$(this).data('tax');
const tterms=cal.evo_cal_get_filter_sub_data(taxonomy , 'tterms');
cal.evo_cal_update_filter_data(taxonomy , tterms, 'nterms');
$(this).removeClass('chg');
});
}
function run_cal_ajax(cal_id, direction, ajaxtype){
var CAL=ev_cal=$('#'+cal_id);
if(CAL.attr('data-runajax')!='0'){
const EVENTS_LIST=CAL.find('.eventon_events_list');
const $showMoreBtn=EVENTS_LIST.find('.evoShow_more_events');
var cat=CAL.find('.evcal_sort').attr('cat');
if(ajaxtype=='switchmonth'){
CAL.find('.cal_arguments').attr('data-show_limit_paged',1);
CAL.evo_update_cal_sc({F:'show_limit_paged', V: '1'});
}
SC=CAL.evo_cal_functions({action:'load_shortcodes'});
$('body').trigger('evo_main_ajax_before', [CAL, ajaxtype, direction, SC]);
var data_arg={
direction: 		direction,
shortcode: 		SC,
ajaxtype: 		ajaxtype,
nonce: 			evo_general_params.n,
nonceX: 		evo_general_params.nonce
};
$.ajax({
beforeSend: function(xhr){
xhr.setRequestHeader('X-WP-Nonce', evo_general_params.nonce);
CAL.addClass('evo_loading');
if(ajaxtype=='paged'){
const currentContent=$showMoreBtn.html();
$showMoreBtn.data('txt',currentContent);
if(SC.tiles=='yes'){
$showMoreBtn.addClass('evoloading');
$showMoreBtn.find('span').html('');
}else{
$showMoreBtn.find('span').addClass('evobtn_loader full');
}}else{
html=evo_general_params.html.preload_events;
if(SC.tiles=='yes') html=evo_general_params.html.preload_event_tiles;
EVENTS_LIST.html(html);
}
if(CAL.hasClass('nav_from_foot')){
scrolltop=CAL.offset().top;
$('html, body').animate({	scrollTop: scrolltop	},20);
}
$('body').trigger('evo_main_ajax_before_fnc',[CAL, ajaxtype, data_arg ]);
},
type: 'POST', url: get_ajax_url('eventon_get_events'),data: data_arg,dataType:'json',
success:function(data){
if(!data) return false;
if(ajaxtype=='paged'){
$showMoreBtn.remove();
EVENTS_LIST.find('.clear').remove();
EVENTS_LIST.append(data.html + "<div class='clear'></div>");
var events_in_list=EVENTS_LIST.find('.eventon_list_event').length;
if('total_events' in data&&data.total_events==events_in_list){
$showMoreBtn.hide();
}
var T={};
EVENTS_LIST.find('.evcal_month_line').each(function(){
d=$(this).data('d');
if(T[d])
$(this).remove();
else
T[d]=true;
});
var T={};
EVENTS_LIST.find('.sep_month_events').each(function(){
d=$(this).data('d');
if(T[d]){
var H=$(this).html();
EVENTS_LIST.find('.sep_month_events[data-d="'+d+'"]').append(H);
$(this).remove();
}else{T[d]=true;}});
}else{
EVENTS_LIST.html(data.html);
}
CAL.find('.evo_month_title').html(data.cal_month_title);
CAL.evo_cal_functions({action:'update_shortcodes',SC: data.SC});
CAL.evo_cal_functions({action:'update_json',json: data.json});
CAL.evo_calendar({
SC: data.SC,
json: data.json
});
$('body').trigger('calendar_month_changed',[CAL, data]);
$('body').trigger('evo_main_ajax_success', [CAL, ajaxtype, data, data_arg]);
},complete:function(data){
if(! EVENTS_LIST.hasClass('evo_hide')) EVENTS_LIST.delay(300).slideDown('slow');
if(CAL.hasClass('nav_from_foot')){
setTimeout(function(){
scrolltop=CAL.offset().top;
$('html, body').animate({	scrollTop: scrolltop	},20);
CAL.removeClass('nav_from_foot');
},302);
}
$('body').trigger('evo_main_ajax_complete', [CAL, ajaxtype, data.responseJSON , data_arg]);
CAL.removeClass('evo_loading');
}});
}}
$('body').on('evo_run_cal_ajax',function(event,cal_id, direction, ajaxtype){
run_cal_ajax(cal_id, direction, ajaxtype);
});
function ajax_post_content(sortby, cal_id, direction, ajaxtype){
run_cal_ajax(cal_id, direction, ajaxtype);
}
$('body').on('evo_load_single_event_content', function(event, eid, obj){
var ajaxdataa={};
ajaxdataa['eid']=eid;
ajaxdataa['nonce']=the_ajax_script.postnonce;
if(obj.data('j')){
$.each(obj.data('j'), function(index,val){
ajaxdataa[ index]=val;
});
}
$.ajax({
beforeSend: function(){ 	},
url:	get_ajax_url('eventon_load_event_content'),
data: 	ajaxdataa,	dataType:'json', type: 	'POST',
success:function(data){
$('body').trigger('evo_single_event_content_loaded', [data, obj]);
},complete:function(){ 	}});
});
if(BODY.evo_is_mobile()){
if($('body').find('.fb.evo_ss').length!=0){
$('body').find('.fb.evo_ss').each(function(){
obj=$(this);
obj.attr({'href':'http://m.facebook.com/sharer.php?u='+obj.attr('data-url')});
});
}}
if($('body').find('.evo_sin_page').length>0){
$('.evo_sin_page').each(function(){
$('body').trigger('evo_load_single_event_content',[ $(this).data('eid'), $(this)]);
$(this).find('.desc_trig ').attr({'data-ux_val':'none'});
});
}
$('body').find('.eventon_single_event').each(function(){
var _this=$(this);
var CAL=_this.closest('.ajde_evcal_calendar');
var SC=CAL.evo_shortcode_data();
var evObj=CAL.find('.eventon_list_event');
if(SC.expanded=='yes'){
_this.find('.evcal_eventcard').show();
var idd=_this.find('.evcal_gmaps');
_this.find('.evcal_close').parent().css({'padding-right':0});
_this.find('.evcal_close').hide();
var obj=_this.find('.desc_trig');
_this.find('.evo_metarow_gmap').evo_load_gmap();
evObj.find('.event_description').addClass('open');
}else if(SC.uxval=='3'){
var obj=_this.find('.desc_trig');
obj.removeAttr('data-exlk').attr({'data-ux_val':'3'});
}
var ev_excerpt=CAL.find('.event_excerpt').html();
if(ev_excerpt!=''&&ev_excerpt!==undefined&&SC.excerpt=='yes'){
var appendation='<div class="event_excerpt_in">'+ev_excerpt+'</div>'
evObj.append(appendation);
}
var obj=evObj.find('.desc_trig');
var event_id=evObj.data('event_id');
$('body').trigger('evo_slidedown_eventcard_complete',[ event_id, obj]);
});
function get_ajax_url(action){
var ajax_type='endpoint';
if('ajax_method' in evo_general_params) ajax_type=evo_general_params.ajax_method;
return $('body').evo_get_ajax_url({a:action, type: 	ajax_type });
}
function handlebar_additional_arguments(){
Handlebars.registerHelper('ifE',function(v1, options){
return (v1!==undefined&&v1!=''&&v1)
? options.fn(this)
: options.inverse(this);
});
Handlebars.registerHelper('ifEQ',function(v1, v2, options){
return(v1==v2)? options.fn(this): options.inverse(this);
});
Handlebars.registerHelper('ifNEQ',function(v1, v2, options){
return(v1!=v2)? options.fn(this): options.inverse(this);
});
Handlebars.registerHelper('BUStxt',function(V, options){
if(!(V in BUS.txt)) return V;
return BUS.txt[V];
});
Handlebars.registerHelper('GetDMnames',function(V, U, options){
return BUS.dms[U][ V ];
});
Handlebars.registerHelper('forAdds',function(count, add_val, options){
O='';
for(x=1; x<=count; x++){	O +=add_val;	}
return O;
});
Handlebars.registerHelper('GetEvProp',function(EID, PROP, CALID){
EID=EID.split('-');
EV=$('#'+ CALID).find('.evo_cal_events').data('events');
var O='';
$.each(EV, function(i,d){
if(d.ID==EID[0]&&d.ri==EID[1]){
if(!(PROP in d.event_pmv)) return;
O=d.event_pmv[PROP][0];
}});
return O;
});
Handlebars.registerHelper('GetEvV',function(EID, PROP, CALID){
EID=EID.split('-');
EV=$('#'+ CALID).find('.evo_cal_events').data('events');
var O='';
$.each(EV, function(i,d){
if(d.ID==EID[0]&&d.ri==EID[1]){
O=d[PROP];
}});
return O;
});
Handlebars.registerHelper('COUNT',function(V){
return Object.keys(V).length;
});
Handlebars.registerHelper('CountlimitLess',function(AR, C,options){
var L=Object.keys(AR).length;
return(L < C)? options.inverse(this): options.fn(this);
});
Handlebars.registerHelper('ifCOND',function(v1, operator, v2, options){
return checkCondition(v1, operator, v2)
? options.fn(this)
: options.inverse(this);
});
Handlebars.registerHelper('toJSON', function(obj){
return new Handlebars.SafeString(JSON.stringify(obj));
});
Handlebars.registerHelper('Cal_def_check',function(V, options){
if(BUS.cal_def&&BUS.cal_def[V]) return options.fn(this);
return options.inverse(this);
});
Handlebars.registerHelper('TypeCheck',function(V, options){
if(options.type==V) return options.fn(this);
return options.inverse(this);
});
}
function checkCondition(v1, operator, v2){
switch(operator){
case '==':
return (v1==v2);
case '===':
return (v1===v2);
case '!==':
return (v1!==v2);
case '<':
return (v1 < v2);
case '<=':
return (v1 <=v2);
case '>':
return (v1 > v2);
case '>=':
return (v1 >=v2);
case '&&':
return (v1&&v2);
case '||':
return (v1||v2);
default:
return false;
}}
BODY.on('evo_open_lightbox',function(event, lb_class, content){
const LIGHTBOX=$('.evo_lightbox.'+lb_class).eq(0);
if(LIGHTBOX.is("visible")===true) return false;
if(content!=''){
LIGHTBOX.find('.evo_lightbox_body').html(content);
}
BODY.trigger('evolightbox_show', [ lb_class ]);
});
BODY.on('clicked_on_page', function(event, obj, ev){
if(obj.hasClass('evo_content_inin')){
closing_lightbox(obj.closest('.evo_lightbox'));
}});
BODY.on('click','.evolbclose', function(){
if($(this).hasClass('evolb_close_btn')) return;
LIGHTBOX=$(this).closest('.evo_lightbox');
closing_lightbox(LIGHTBOX);
});
function closing_lightbox(lightboxELM){
if(! lightboxELM.hasClass('show')) return false;
Close=(lightboxELM.parent().find('.evo_lightbox.show').length==1)? true: false;
lightboxELM.removeClass('show');
$('body').trigger('lightbox_before_event_closing', [lightboxELM]);
setTimeout(function(){
lightboxELM.find('.evo_lightbox_body').html('');
if(Close){
$('body').removeClass('evo_overflow');
$('html').removeClass('evo_overflow');
}
$('body').trigger('lightbox_event_closing', [lightboxELM]);
}, 100);
}
$('body').on('evolightbox_show',function(event, lb_class){
$('.evo_lightboxes').show();
$('body').addClass('evo_overflow');
$('html').addClass('evo_overflow');
$('body').trigger('evolightbox_opened',[ lb_class ]);
});
});
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).hotkeys=t()}(this,function(){"use strict";var e="undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().indexOf("firefox")>0;function t(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent&&e.attachEvent("on".concat(t),function(){n(window.event)})}function n(e,t){for(var n=t.slice(0,t.length-1),o=0;o<n.length;o++)n[o]=e[n[o].toLowerCase()];return n}function o(e){"string"!=typeof e&&(e="");for(var t=(e=e.replace(/\s/g,"")).split(","),n=t.lastIndexOf("");n>=0;)t[n-1]+=",",t.splice(n,1),n=t.lastIndexOf("");return t}for(var r={backspace:8,tab:9,clear:12,enter:13,return:13,esc:27,escape:27,space:32,left:37,up:38,right:39,down:40,del:46,delete:46,ins:45,insert:45,home:36,end:35,pageup:33,pagedown:34,capslock:20,"⇪":20,",":188,".":190,"/":191,"`":192,"-":e?173:189,"=":e?61:187,";":e?59:186,"'":222,"[":219,"]":221,"\\":220},i={"⇧":16,shift:16,"⌥":18,alt:18,option:18,"⌃":17,ctrl:17,control:17,"⌘":91,cmd:91,command:91},f={16:"shiftKey",18:"altKey",17:"ctrlKey",91:"metaKey",shiftKey:16,ctrlKey:17,altKey:18,metaKey:91},a={16:!1,18:!1,17:!1,91:!1},c={},l=1;l<20;l++)r["f".concat(l)]=111+l;var s=[],p="all",y=[],d=function(e){return r[e.toLowerCase()]||i[e.toLowerCase()]||e.toUpperCase().charCodeAt(0)};function u(e){p=e||"all"}function h(){return p||"all"}var v=function(e){var t=e.key,r=e.scope,f=e.method,a=e.splitKey,l=void 0===a?"+":a;o(t).forEach(function(e){var t=e.split(l),o=t.length,a=t[o-1],s="*"===a?"*":d(a);if(c[s]){r||(r=h());var p=o>1?n(i,t):[];c[s]=c[s].map(function(e){return(!f||e.method===f)&&e.scope===r&&function(e,t){for(var n=e.length>=t.length?e:t,o=e.length>=t.length?t:e,r=!0,i=0;i<n.length;i++)-1===o.indexOf(n[i])&&(r=!1);return r}(e.mods,p)?{}:e})}})};function g(e,t,n){var o;if(t.scope===n||"all"===t.scope){for(var r in o=t.mods.length>0,a)Object.prototype.hasOwnProperty.call(a,r)&&(!a[r]&&t.mods.indexOf(+r)>-1||a[r]&&-1===t.mods.indexOf(+r))&&(o=!1);(0!==t.mods.length||a[16]||a[18]||a[17]||a[91])&&!o&&"*"!==t.shortcut||!1===t.method(e,t)&&(e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation&&e.stopPropagation(),e.cancelBubble&&(e.cancelBubble=!0))}}function w(e){var t=c["*"],n=e.keyCode||e.which||e.charCode;if(k.filter.call(this,e)){if(93!==n&&224!==n||(n=91),-1===s.indexOf(n)&&229!==n&&s.push(n),["ctrlKey","altKey","shiftKey","metaKey"].forEach(function(t){var n=f[t];e[t]&&-1===s.indexOf(n)?s.push(n):!e[t]&&s.indexOf(n)>-1?s.splice(s.indexOf(n),1):"metaKey"===t&&e[t]&&3===s.length&&(e.ctrlKey||e.shiftKey||e.altKey||(s=s.slice(s.indexOf(n))))}),n in a){for(var o in a[n]=!0,i)i[o]===n&&(k[o]=!0);if(!t)return}for(var r in a)Object.prototype.hasOwnProperty.call(a,r)&&(a[r]=e[f[r]]);e.getModifierState&&(!e.altKey||e.ctrlKey)&&e.getModifierState("AltGraph")&&(-1===s.indexOf(17)&&s.push(17),-1===s.indexOf(18)&&s.push(18),a[17]=!0,a[18]=!0);var l=h();if(t)for(var p=0;p<t.length;p++)t[p].scope===l&&("keydown"===e.type&&t[p].keydown||"keyup"===e.type&&t[p].keyup)&&g(e,t[p],l);if(n in c)for(var y=0;y<c[n].length;y++)if(("keydown"===e.type&&c[n][y].keydown||"keyup"===e.type&&c[n][y].keyup)&&c[n][y].key){for(var u=c[n][y],v=u.splitKey,w=u.key.split(v),m=[],O=0;O<w.length;O++)m.push(d(w[O]));m.sort().join("")===s.sort().join("")&&g(e,u,l)}}}function k(e,r,f){s=[];var l=o(e),p=[],u="all",h=document,v=0,g=!1,m=!0,O="+";for(void 0===f&&"function"==typeof r&&(f=r),"[object Object]"===Object.prototype.toString.call(r)&&(r.scope&&(u=r.scope),r.element&&(h=r.element),r.keyup&&(g=r.keyup),void 0!==r.keydown&&(m=r.keydown),"string"==typeof r.splitKey&&(O=r.splitKey)),"string"==typeof r&&(u=r);v<l.length;v++)p=[],(e=l[v].split(O)).length>1&&(p=n(i,e)),(e="*"===(e=e[e.length-1])?"*":d(e))in c||(c[e]=[]),c[e].push({keyup:g,keydown:m,scope:u,mods:p,shortcut:l[v],method:f,key:l[v],splitKey:O});void 0!==h&&!function(e){return y.indexOf(e)>-1}(h)&&window&&(y.push(h),t(h,"keydown",function(e){w(e)}),t(window,"focus",function(){s=[]}),t(h,"keyup",function(e){w(e),function(e){var t=e.keyCode||e.which||e.charCode,n=s.indexOf(t);if(n>=0&&s.splice(n,1),e.key&&"meta"===e.key.toLowerCase()&&s.splice(0,s.length),93!==t&&224!==t||(t=91),t in a)for(var o in a[t]=!1,i)i[o]===t&&(k[o]=!1)}(e)}))}var m={setScope:u,getScope:h,deleteScope:function(e,t){var n,o;for(var r in e||(e=h()),c)if(Object.prototype.hasOwnProperty.call(c,r))for(n=c[r],o=0;o<n.length;)n[o].scope===e?n.splice(o,1):o++;h()===e&&u(t||"all")},getPressedKeyCodes:function(){return s.slice(0)},isPressed:function(e){return"string"==typeof e&&(e=d(e)),-1!==s.indexOf(e)},filter:function(e){var t=e.target||e.srcElement,n=t.tagName,o=!0;return!t.isContentEditable&&("INPUT"!==n&&"TEXTAREA"!==n&&"SELECT"!==n||t.readOnly)||(o=!1),o},unbind:function(e){if(e){if(Array.isArray(e))e.forEach(function(e){e.key&&v(e)});else if("object"==typeof e)e.key&&v(e);else if("string"==typeof e){for(var t=arguments.length,n=new Array(t>1?t-1:0),o=1;o<t;o++)n[o-1]=arguments[o];var r=n[0],i=n[1];"function"==typeof r&&(i=r,r=""),v({key:e,scope:r,method:i,splitKey:"+"})}}else Object.keys(c).forEach(function(e){return delete c[e]})}};for(var O in m)Object.prototype.hasOwnProperty.call(m,O)&&(k[O]=m[O]);if("undefined"!=typeof window){var K=window.hotkeys;k.noConflict=function(e){return e&&window.hotkeys===k&&(window.hotkeys=K),k},window.hotkeys=k}return k});
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.SimpleKeyboard=e():t.SimpleKeyboard=e()}(this,function(){return function(){var t={3099:function(t){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},6077:function(t,e,n){var o=n(111);t.exports=function(t){if(!o(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},1223:function(t,e,n){var o=n(5112),r=n(30),i=n(3070),a=o("unscopables"),s=Array.prototype;null==s[a]&&i.f(s,a,{configurable:!0,value:r(null)}),t.exports=function(t){s[a][t]=!0}},1530:function(t,e,n){"use strict";var o=n(8710).charAt;t.exports=function(t,e,n){return e+(n?o(t,e).length:1)}},9670:function(t,e,n){var o=n(111);t.exports=function(t){if(!o(t))throw TypeError(String(t)+" is not an object");return t}},8533:function(t,e,n){"use strict";var o=n(2092).forEach,r=n(9341)("forEach");t.exports=r?[].forEach:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}},8457:function(t,e,n){"use strict";var o=n(9974),r=n(7908),i=n(3411),a=n(7659),s=n(7466),u=n(6135),c=n(1246);t.exports=function(t){var e,n,l,f,d,p,h=r(t),v="function"==typeof this?this:Array,g=arguments.length,y=g>1?arguments[1]:void 0,m=void 0!==y,b=c(h),x=0;if(m&&(y=o(y,g>2?arguments[2]:void 0,2)),null==b||v==Array&&a(b))for(n=new v(e=s(h.length));e>x;x++)p=m?y(h[x],x):h[x],u(n,x,p);else for(d=(f=b.call(h)).next,n=new v;!(l=d.call(f)).done;x++)p=m?i(f,y,[l.value,x],!0):l.value,u(n,x,p);return n.length=x,n}},1318:function(t,e,n){var o=n(5656),r=n(7466),i=n(1400),a=function(t){return function(e,n,a){var s,u=o(e),c=r(u.length),l=i(a,c);if(t&&n!=n){for(;c>l;)if((s=u[l++])!=s)return!0}else for(;c>l;l++)if((t||l in u)&&u[l]===n)return t||l||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},2092:function(t,e,n){var o=n(9974),r=n(8361),i=n(7908),a=n(7466),s=n(5417),u=[].push,c=function(t){var e=1==t,n=2==t,c=3==t,l=4==t,f=6==t,d=7==t,p=5==t||f;return function(h,v,g,y){for(var m,b,x=i(h),w=r(x),E=o(v,g,3),O=a(w.length),S=0,k=y||s,I=e?k(h,O):n||d?k(h,0):void 0;O>S;S++)if((p||S in w)&&(b=E(m=w[S],S,x),t))if(e)I[S]=b;else if(b)switch(t){case 3:return!0;case 5:return m;case 6:return S;case 2:u.call(I,m)}else switch(t){case 4:return!1;case 7:u.call(I,m)}return f?-1:c||l?l:I}};t.exports={forEach:c(0),map:c(1),filter:c(2),some:c(3),every:c(4),find:c(5),findIndex:c(6),filterOut:c(7)}},1194:function(t,e,n){var o=n(7293),r=n(5112),i=n(7392),a=r("species");t.exports=function(t){return i>=51||!o(function(){var e=[];return(e.constructor={})[a]=function(){return{foo:1}},1!==e[t](Boolean).foo})}},9341:function(t,e,n){"use strict";var o=n(7293);t.exports=function(t,e){var n=[][t];return!!n&&o(function(){n.call(null,e||function(){throw 1},1)})}},3671:function(t,e,n){var o=n(3099),r=n(7908),i=n(8361),a=n(7466),s=function(t){return function(e,n,s,u){o(n);var c=r(e),l=i(c),f=a(c.length),d=t?f-1:0,p=t?-1:1;if(s<2)for(;;){if(d in l){u=l[d],d+=p;break}if(d+=p,t?d<0:f<=d)throw TypeError("Reduce of empty array with no initial value")}for(;t?d>=0:f>d;d+=p)d in l&&(u=n(u,l[d],d,c));return u}};t.exports={left:s(!1),right:s(!0)}},4362:function(t){var e=Math.floor,n=function(t,i){var a=t.length,s=e(a/2);return a<8?o(t,i):r(n(t.slice(0,s),i),n(t.slice(s),i),i)},o=function(t,e){for(var n,o,r=t.length,i=1;i<r;){for(o=i,n=t[i];o&&e(t[o-1],n)>0;)t[o]=t[--o];o!==i++&&(t[o]=n)}return t},r=function(t,e,n){for(var o=t.length,r=e.length,i=0,a=0,s=[];i<o||a<r;)i<o&&a<r?s.push(n(t[i],e[a])<=0?t[i++]:e[a++]):s.push(i<o?t[i++]:e[a++]);return s};t.exports=n},5417:function(t,e,n){var o=n(111),r=n(3157),i=n(5112)("species");t.exports=function(t,e){var n;return r(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!r(n.prototype)?o(n)&&null===(n=n[i])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)}},3411:function(t,e,n){var o=n(9670),r=n(9212);t.exports=function(t,e,n,i){try{return i?e(o(n)[0],n[1]):e(n)}catch(e){throw r(t),e}}},7072:function(t,e,n){var o=n(5112)("iterator"),r=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){r=!0}};a[o]=function(){return this},Array.from(a,function(){throw 2})}catch(t){}t.exports=function(t,e){if(!e&&!r)return!1;var n=!1;try{var i={};i[o]=function(){return{next:function(){return{done:n=!0}}}},t(i)}catch(t){}return n}},4326:function(t){var e={}.toString;t.exports=function(t){return e.call(t).slice(8,-1)}},648:function(t,e,n){var o=n(1694),r=n(4326),i=n(5112)("toStringTag"),a="Arguments"==r(function(){return arguments}());t.exports=o?r:function(t){var e,n,o;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),i))?n:a?r(e):"Object"==(o=r(e))&&"function"==typeof e.callee?"Arguments":o}},9920:function(t,e,n){var o=n(6656),r=n(3887),i=n(1236),a=n(3070);t.exports=function(t,e){for(var n=r(e),s=a.f,u=i.f,c=0;c<n.length;c++){var l=n[c];o(t,l)||s(t,l,u(e,l))}}},4964:function(t,e,n){var o=n(5112)("match");t.exports=function(t){var e=/./;try{"/./"[t](e)}catch(n){try{return e[o]=!1,"/./"[t](e)}catch(t){}}return!1}},8544:function(t,e,n){var o=n(7293);t.exports=!o(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})},4994:function(t,e,n){"use strict";var o=n(3383).IteratorPrototype,r=n(30),i=n(9114),a=n(8003),s=n(7497),u=function(){return this};t.exports=function(t,e,n){var c=e+" Iterator";return t.prototype=r(o,{next:i(1,n)}),a(t,c,!1,!0),s[c]=u,t}},8880:function(t,e,n){var o=n(9781),r=n(3070),i=n(9114);t.exports=o?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},9114:function(t){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},6135:function(t,e,n){"use strict";var o=n(7593),r=n(3070),i=n(9114);t.exports=function(t,e,n){var a=o(e);a in t?r.f(t,a,i(0,n)):t[a]=n}},654:function(t,e,n){"use strict";var o=n(2109),r=n(4994),i=n(9518),a=n(7674),s=n(8003),u=n(8880),c=n(1320),l=n(5112),f=n(1913),d=n(7497),p=n(3383),h=p.IteratorPrototype,v=p.BUGGY_SAFARI_ITERATORS,g=l("iterator"),y="keys",m="values",b="entries",x=function(){return this};t.exports=function(t,e,n,l,p,w,E){r(n,e,l);var O,S,k,I=function(t){if(t===p&&M)return M;if(!v&&t in A)return A[t];switch(t){case y:case m:case b:return function(){return new n(this,t)}}return function(){return new n(this)}},C=e+" Iterator",P=!1,A=t.prototype,T=A[g]||A["@@iterator"]||p&&A[p],M=!v&&T||I(p),N="Array"==e&&A.entries||T;if(N&&(O=i(N.call(new t)),h!==Object.prototype&&O.next&&(f||i(O)===h||(a?a(O,h):"function"!=typeof O[g]&&u(O,g,x)),s(O,C,!0,!0),f&&(d[C]=x))),p==m&&T&&T.name!==m&&(P=!0,M=function(){return T.call(this)}),f&&!E||A[g]===M||u(A,g,M),d[e]=M,p)if(S={values:I(m),keys:w?M:I(y),entries:I(b)},E)for(k in S)(v||P||!(k in A))&&c(A,k,S[k]);else o({target:e,proto:!0,forced:v||P},S);return S}},7235:function(t,e,n){var o=n(857),r=n(6656),i=n(6061),a=n(3070).f;t.exports=function(t){var e=o.Symbol||(o.Symbol={});r(e,t)||a(e,t,{value:i.f(t)})}},9781:function(t,e,n){var o=n(7293);t.exports=!o(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})},317:function(t,e,n){var o=n(7854),r=n(111),i=o.document,a=r(i)&&r(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},8324:function(t){t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},8886:function(t,e,n){var o=n(8113).match(/firefox\/(\d+)/i);t.exports=!!o&&+o[1]},256:function(t,e,n){var o=n(8113);t.exports=/MSIE|Trident/.test(o)},5268:function(t,e,n){var o=n(4326),r=n(7854);t.exports="process"==o(r.process)},8113:function(t,e,n){var o=n(5005);t.exports=o("navigator","userAgent")||""},7392:function(t,e,n){var o,r,i=n(7854),a=n(8113),s=i.process,u=s&&s.versions,c=u&&u.v8;c?r=(o=c.split("."))[0]<4?1:o[0]+o[1]:a&&(!(o=a.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=a.match(/Chrome\/(\d+)/))&&(r=o[1]),t.exports=r&&+r},8008:function(t,e,n){var o=n(8113).match(/AppleWebKit\/(\d+)\./);t.exports=!!o&&+o[1]},748:function(t){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2109:function(t,e,n){var o=n(7854),r=n(1236).f,i=n(8880),a=n(1320),s=n(3505),u=n(9920),c=n(4705);t.exports=function(t,e){var n,l,f,d,p,h=t.target,v=t.global,g=t.stat;if(n=v?o:g?o[h]||s(h,{}):(o[h]||{}).prototype)for(l in e){if(d=e[l],f=t.noTargetGet?(p=r(n,l))&&p.value:n[l],!c(v?l:h+(g?".":"#")+l,t.forced)&&void 0!==f){if(typeof d==typeof f)continue;u(d,f)}(t.sham||f&&f.sham)&&i(d,"sham",!0),a(n,l,d,t)}}},7293:function(t){t.exports=function(t){try{return!!t()}catch(t){return!0}}},7007:function(t,e,n){"use strict";n(4916);var o=n(1320),r=n(2261),i=n(7293),a=n(5112),s=n(8880),u=a("species"),c=RegExp.prototype,l=!i(function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}),f="$0"==="a".replace(/./,"$0"),d=a("replace"),p=!!/./[d]&&""===/./[d]("a","$0"),h=!i(function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var n="ab".split(t);return 2!==n.length||"a"!==n[0]||"b"!==n[1]});t.exports=function(t,e,n,d){var v=a(t),g=!i(function(){var e={};return e[v]=function(){return 7},7!=""[t](e)}),y=g&&!i(function(){var e=!1,n=/a/;return"split"===t&&((n={}).constructor={},n.constructor[u]=function(){return n},n.flags="",n[v]=/./[v]),n.exec=function(){return e=!0,null},n[v](""),!e});if(!g||!y||"replace"===t&&(!l||!f||p)||"split"===t&&!h){var m=/./[v],b=n(v,""[t],function(t,e,n,o,i){var a=e.exec;return a===r||a===c.exec?g&&!i?{done:!0,value:m.call(e,n,o)}:{done:!0,value:t.call(n,e,o)}:{done:!1}},{REPLACE_KEEPS_$0:f,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:p}),x=b[0],w=b[1];o(String.prototype,t,x),o(c,v,2==e?function(t,e){return w.call(t,this,e)}:function(t){return w.call(t,this)})}d&&s(c[v],"sham",!0)}},9974:function(t,e,n){var o=n(3099);t.exports=function(t,e,n){if(o(t),void 0===e)return t;switch(n){case 0:return function(){return t.call(e)};case 1:return function(n){return t.call(e,n)};case 2:return function(n,o){return t.call(e,n,o)};case 3:return function(n,o,r){return t.call(e,n,o,r)}}return function(){return t.apply(e,arguments)}}},5005:function(t,e,n){var o=n(857),r=n(7854),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,e){return arguments.length<2?i(o[t])||i(r[t]):o[t]&&o[t][e]||r[t]&&r[t][e]}},1246:function(t,e,n){var o=n(648),r=n(7497),i=n(5112)("iterator");t.exports=function(t){if(null!=t)return t[i]||t["@@iterator"]||r[o(t)]}},647:function(t,e,n){var o=n(7908),r=Math.floor,i="".replace,a=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,s=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,n,u,c,l){var f=n+t.length,d=u.length,p=s;return void 0!==c&&(c=o(c),p=a),i.call(l,p,function(o,i){var a;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return e.slice(0,n);case"'":return e.slice(f);case"<":a=c[i.slice(1,-1)];break;default:var s=+i;if(0===s)return o;if(s>d){var l=r(s/10);return 0===l?o:l<=d?void 0===u[l-1]?i.charAt(1):u[l-1]+i.charAt(1):o}a=u[s-1]}return void 0===a?"":a})}},7854:function(t,e,n){var o=function(t){return t&&t.Math==Math&&t};t.exports=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof n.g&&n.g)||function(){return this}()||Function("return this")()},6656:function(t,e,n){var o=n(7908),r={}.hasOwnProperty;t.exports=Object.hasOwn||function(t,e){return r.call(o(t),e)}},3501:function(t){t.exports={}},490:function(t,e,n){var o=n(5005);t.exports=o("document","documentElement")},4664:function(t,e,n){var o=n(9781),r=n(7293),i=n(317);t.exports=!o&&!r(function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})},8361:function(t,e,n){var o=n(7293),r=n(4326),i="".split;t.exports=o(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return"String"==r(t)?i.call(t,""):Object(t)}:Object},9587:function(t,e,n){var o=n(111),r=n(7674);t.exports=function(t,e,n){var i,a;return r&&"function"==typeof(i=e.constructor)&&i!==n&&o(a=i.prototype)&&a!==n.prototype&&r(t,a),t}},2788:function(t,e,n){var o=n(5465),r=Function.toString;"function"!=typeof o.inspectSource&&(o.inspectSource=function(t){return r.call(t)}),t.exports=o.inspectSource},9909:function(t,e,n){var o,r,i,a=n(8536),s=n(7854),u=n(111),c=n(8880),l=n(6656),f=n(5465),d=n(6200),p=n(3501),h="Object already initialized",v=s.WeakMap;if(a||f.state){var g=f.state||(f.state=new v),y=g.get,m=g.has,b=g.set;o=function(t,e){if(m.call(g,t))throw new TypeError(h);return e.facade=t,b.call(g,t,e),e},r=function(t){return y.call(g,t)||{}},i=function(t){return m.call(g,t)}}else{var x=d("state");p[x]=!0,o=function(t,e){if(l(t,x))throw new TypeError(h);return e.facade=t,c(t,x,e),e},r=function(t){return l(t,x)?t[x]:{}},i=function(t){return l(t,x)}}t.exports={set:o,get:r,has:i,enforce:function(t){return i(t)?r(t):o(t,{})},getterFor:function(t){return function(e){var n;if(!u(e)||(n=r(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},7659:function(t,e,n){var o=n(5112),r=n(7497),i=o("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(r.Array===t||a[i]===t)}},3157:function(t,e,n){var o=n(4326);t.exports=Array.isArray||function(t){return"Array"==o(t)}},4705:function(t,e,n){var o=n(7293),r=/#|\.prototype\./,i=function(t,e){var n=s[a(t)];return n==c||n!=u&&("function"==typeof e?o(e):!!e)},a=i.normalize=function(t){return String(t).replace(r,".").toLowerCase()},s=i.data={},u=i.NATIVE="N",c=i.POLYFILL="P";t.exports=i},8730:function(t,e,n){var o=n(111),r=Math.floor;t.exports=function(t){return!o(t)&&isFinite(t)&&r(t)===t}},111:function(t){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},1913:function(t){t.exports=!1},7850:function(t,e,n){var o=n(111),r=n(4326),i=n(5112)("match");t.exports=function(t){var e;return o(t)&&(void 0!==(e=t[i])?!!e:"RegExp"==r(t))}},9212:function(t,e,n){var o=n(9670);t.exports=function(t){var e=t.return;if(void 0!==e)return o(e.call(t)).value}},3383:function(t,e,n){"use strict";var o,r,i,a=n(7293),s=n(9518),u=n(8880),c=n(6656),l=n(5112),f=n(1913),d=l("iterator"),p=!1;[].keys&&("next"in(i=[].keys())?(r=s(s(i)))!==Object.prototype&&(o=r):p=!0);var h=null==o||a(function(){var t={};return o[d].call(t)!==t});h&&(o={}),f&&!h||c(o,d)||u(o,d,function(){return this}),t.exports={IteratorPrototype:o,BUGGY_SAFARI_ITERATORS:p}},7497:function(t){t.exports={}},133:function(t,e,n){var o=n(7392),r=n(7293);t.exports=!!Object.getOwnPropertySymbols&&!r(function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&o&&o<41})},8536:function(t,e,n){var o=n(7854),r=n(2788),i=o.WeakMap;t.exports="function"==typeof i&&/native code/.test(r(i))},3929:function(t,e,n){var o=n(7850);t.exports=function(t){if(o(t))throw TypeError("The method doesn't accept regular expressions");return t}},1574:function(t,e,n){"use strict";var o=n(9781),r=n(7293),i=n(1956),a=n(5181),s=n(5296),u=n(7908),c=n(8361),l=Object.assign,f=Object.defineProperty;t.exports=!l||r(function(){if(o&&1!==l({b:1},l(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},n=Symbol(),r="abcdefghijklmnopqrst";return t[n]=7,r.split("").forEach(function(t){e[t]=t}),7!=l({},t)[n]||i(l({},e)).join("")!=r})?function(t,e){for(var n=u(t),r=arguments.length,l=1,f=a.f,d=s.f;r>l;)for(var p,h=c(arguments[l++]),v=f?i(h).concat(f(h)):i(h),g=v.length,y=0;g>y;)p=v[y++],o&&!d.call(h,p)||(n[p]=h[p]);return n}:l},30:function(t,e,n){var o,r=n(9670),i=n(6048),a=n(748),s=n(3501),u=n(490),c=n(317),l=n(6200)("IE_PROTO"),f=function(){},d=function(t){return"<script>"+t+"<\/script>"},p=function(){try{o=document.domain&&new ActiveXObject("htmlfile")}catch(t){}var t,e;p=o?function(t){t.write(d("")),t.close();var e=t.parentWindow.Object;return t=null,e}(o):((e=c("iframe")).style.display="none",u.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(d("document.F=Object")),t.close(),t.F);for(var n=a.length;n--;)delete p.prototype[a[n]];return p()};s[l]=!0,t.exports=Object.create||function(t,e){var n;return null!==t?(f.prototype=r(t),n=new f,f.prototype=null,n[l]=t):n=p(),void 0===e?n:i(n,e)}},6048:function(t,e,n){var o=n(9781),r=n(3070),i=n(9670),a=n(1956);t.exports=o?Object.defineProperties:function(t,e){i(t);for(var n,o=a(e),s=o.length,u=0;s>u;)r.f(t,n=o[u++],e[n]);return t}},3070:function(t,e,n){var o=n(9781),r=n(4664),i=n(9670),a=n(7593),s=Object.defineProperty;e.f=o?s:function(t,e,n){if(i(t),e=a(e,!0),i(n),r)try{return s(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(t[e]=n.value),t}},1236:function(t,e,n){var o=n(9781),r=n(5296),i=n(9114),a=n(5656),s=n(7593),u=n(6656),c=n(4664),l=Object.getOwnPropertyDescriptor;e.f=o?l:function(t,e){if(t=a(t),e=s(e,!0),c)try{return l(t,e)}catch(t){}if(u(t,e))return i(!r.f.call(t,e),t[e])}},1156:function(t,e,n){var o=n(5656),r=n(8006).f,i={}.toString,a="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];t.exports.f=function(t){return a&&"[object Window]"==i.call(t)?function(t){try{return r(t)}catch(t){return a.slice()}}(t):r(o(t))}},8006:function(t,e,n){var o=n(6324),r=n(748).concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return o(t,r)}},5181:function(t,e){e.f=Object.getOwnPropertySymbols},9518:function(t,e,n){var o=n(6656),r=n(7908),i=n(6200),a=n(8544),s=i("IE_PROTO"),u=Object.prototype;t.exports=a?Object.getPrototypeOf:function(t){return t=r(t),o(t,s)?t[s]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?u:null}},6324:function(t,e,n){var o=n(6656),r=n(5656),i=n(1318).indexOf,a=n(3501);t.exports=function(t,e){var n,s=r(t),u=0,c=[];for(n in s)!o(a,n)&&o(s,n)&&c.push(n);for(;e.length>u;)o(s,n=e[u++])&&(~i(c,n)||c.push(n));return c}},1956:function(t,e,n){var o=n(6324),r=n(748);t.exports=Object.keys||function(t){return o(t,r)}},5296:function(t,e){"use strict";var n={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,r=o&&!n.call({1:2},1);e.f=r?function(t){var e=o(this,t);return!!e&&e.enumerable}:n},9026:function(t,e,n){"use strict";var o=n(1913),r=n(7854),i=n(7293),a=n(8008);t.exports=o||!i(function(){if(!(a&&a<535)){var t=Math.random();__defineSetter__.call(null,t,function(){}),delete r[t]}})},7674:function(t,e,n){var o=n(9670),r=n(6077);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,n={};try{(t=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),e=n instanceof Array}catch(t){}return function(n,i){return o(n),r(i),e?t.call(n,i):n.__proto__=i,n}}():void 0)},288:function(t,e,n){"use strict";var o=n(1694),r=n(648);t.exports=o?{}.toString:function(){return"[object "+r(this)+"]"}},3887:function(t,e,n){var o=n(5005),r=n(8006),i=n(5181),a=n(9670);t.exports=o("Reflect","ownKeys")||function(t){var e=r.f(a(t)),n=i.f;return n?e.concat(n(t)):e}},857:function(t,e,n){var o=n(7854);t.exports=o},1320:function(t,e,n){var o=n(7854),r=n(8880),i=n(6656),a=n(3505),s=n(2788),u=n(9909),c=u.get,l=u.enforce,f=String(String).split("String");(t.exports=function(t,e,n,s){var u,c=!!s&&!!s.unsafe,d=!!s&&!!s.enumerable,p=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof e||i(n,"name")||r(n,"name",e),(u=l(n)).source||(u.source=f.join("string"==typeof e?e:""))),t!==o?(c?!p&&t[e]&&(d=!0):delete t[e],d?t[e]=n:r(t,e,n)):d?t[e]=n:a(e,n)})(Function.prototype,"toString",function(){return"function"==typeof this&&c(this).source||s(this)})},7651:function(t,e,n){var o=n(4326),r=n(2261);t.exports=function(t,e){var n=t.exec;if("function"==typeof n){var i=n.call(t,e);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==o(t))throw TypeError("RegExp#exec called on incompatible receiver");return r.call(t,e)}},2261:function(t,e,n){"use strict";var o,r,i=n(7066),a=n(2999),s=n(2309),u=RegExp.prototype.exec,c=s("native-string-replace",String.prototype.replace),l=u,f=(o=/a/,r=/b*/g,u.call(o,"a"),u.call(r,"a"),0!==o.lastIndex||0!==r.lastIndex),d=a.UNSUPPORTED_Y||a.BROKEN_CARET,p=void 0!==/()??/.exec("")[1];(f||p||d)&&(l=function(t){var e,n,o,r,a=this,s=d&&a.sticky,l=i.call(a),h=a.source,v=0,g=t;return s&&(-1===(l=l.replace("y","")).indexOf("g")&&(l+="g"),g=String(t).slice(a.lastIndex),a.lastIndex>0&&(!a.multiline||a.multiline&&"\n"!==t[a.lastIndex-1])&&(h="(?: "+h+")",g=" "+g,v++),n=new RegExp("^(?:"+h+")",l)),p&&(n=new RegExp("^"+h+"$(?!\\s)",l)),f&&(e=a.lastIndex),o=u.call(s?n:a,g),s?o?(o.input=o.input.slice(v),o[0]=o[0].slice(v),o.index=a.lastIndex,a.lastIndex+=o[0].length):a.lastIndex=0:f&&o&&(a.lastIndex=a.global?o.index+o[0].length:e),p&&o&&o.length>1&&c.call(o[0],n,function(){for(r=1;r<arguments.length-2;r++)void 0===arguments[r]&&(o[r]=void 0)}),o}),t.exports=l},7066:function(t,e,n){"use strict";var o=n(9670);t.exports=function(){var t=o(this),e="";return t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.sticky&&(e+="y"),e}},2999:function(t,e,n){"use strict";var o=n(7293);function r(t,e){return RegExp(t,e)}e.UNSUPPORTED_Y=o(function(){var t=r("a","y");return t.lastIndex=2,null!=t.exec("abcd")}),e.BROKEN_CARET=o(function(){var t=r("^r","gy");return t.lastIndex=2,null!=t.exec("str")})},4488:function(t){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},3505:function(t,e,n){var o=n(7854),r=n(8880);t.exports=function(t,e){try{r(o,t,e)}catch(n){o[t]=e}return e}},6340:function(t,e,n){"use strict";var o=n(5005),r=n(3070),i=n(5112),a=n(9781),s=i("species");t.exports=function(t){var e=o(t),n=r.f;a&&e&&!e[s]&&n(e,s,{configurable:!0,get:function(){return this}})}},8003:function(t,e,n){var o=n(3070).f,r=n(6656),i=n(5112)("toStringTag");t.exports=function(t,e,n){t&&!r(t=n?t:t.prototype,i)&&o(t,i,{configurable:!0,value:e})}},6200:function(t,e,n){var o=n(2309),r=n(9711),i=o("keys");t.exports=function(t){return i[t]||(i[t]=r(t))}},5465:function(t,e,n){var o=n(7854),r=n(3505),i="__core-js_shared__",a=o[i]||r(i,{});t.exports=a},2309:function(t,e,n){var o=n(1913),r=n(5465);(t.exports=function(t,e){return r[t]||(r[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.14.0",mode:o?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})},6707:function(t,e,n){var o=n(9670),r=n(3099),i=n(5112)("species");t.exports=function(t,e){var n,a=o(t).constructor;return void 0===a||null==(n=o(a)[i])?e:r(n)}},8710:function(t,e,n){var o=n(9958),r=n(4488),i=function(t){return function(e,n){var i,a,s=String(r(e)),u=o(n),c=s.length;return u<0||u>=c?t?"":void 0:(i=s.charCodeAt(u))<55296||i>56319||u+1===c||(a=s.charCodeAt(u+1))<56320||a>57343?t?s.charAt(u):i:t?s.slice(u,u+2):a-56320+(i-55296<<10)+65536}};t.exports={codeAt:i(!1),charAt:i(!0)}},6091:function(t,e,n){var o=n(7293),r=n(1361);t.exports=function(t){return o(function(){return!!r[t]()||"​᠎"!="​᠎"[t]()||r[t].name!==t})}},3111:function(t,e,n){var o=n(4488),r="["+n(1361)+"]",i=RegExp("^"+r+r+"*"),a=RegExp(r+r+"*$"),s=function(t){return function(e){var n=String(o(e));return 1&t&&(n=n.replace(i,"")),2&t&&(n=n.replace(a,"")),n}};t.exports={start:s(1),end:s(2),trim:s(3)}},1400:function(t,e,n){var o=n(9958),r=Math.max,i=Math.min;t.exports=function(t,e){var n=o(t);return n<0?r(n+e,0):i(n,e)}},5656:function(t,e,n){var o=n(8361),r=n(4488);t.exports=function(t){return o(r(t))}},9958:function(t){var e=Math.ceil,n=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?n:e)(t)}},7466:function(t,e,n){var o=n(9958),r=Math.min;t.exports=function(t){return t>0?r(o(t),9007199254740991):0}},7908:function(t,e,n){var o=n(4488);t.exports=function(t){return Object(o(t))}},7593:function(t,e,n){var o=n(111);t.exports=function(t,e){if(!o(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!o(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!o(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!o(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")}},1694:function(t,e,n){var o={};o[n(5112)("toStringTag")]="z",t.exports="[object z]"===String(o)},9711:function(t){var e=0,n=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++e+n).toString(36)}},3307:function(t,e,n){var o=n(133);t.exports=o&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},6061:function(t,e,n){var o=n(5112);e.f=o},5112:function(t,e,n){var o=n(7854),r=n(2309),i=n(6656),a=n(9711),s=n(133),u=n(3307),c=r("wks"),l=o.Symbol,f=u?l:l&&l.withoutSetter||a;t.exports=function(t){return i(c,t)&&(s||"string"==typeof c[t])||(s&&i(l,t)?c[t]=l[t]:c[t]=f("Symbol."+t)),c[t]}},1361:function(t){t.exports="\t\n\v\f\r                　\u2028\u2029\ufeff"},2222:function(t,e,n){"use strict";var o=n(2109),r=n(7293),i=n(3157),a=n(111),s=n(7908),u=n(7466),c=n(6135),l=n(5417),f=n(1194),d=n(5112),p=n(7392),h=d("isConcatSpreadable"),v=9007199254740991,g="Maximum allowed index exceeded",y=p>=51||!r(function(){var t=[];return t[h]=!1,t.concat()[0]!==t}),m=f("concat"),b=function(t){if(!a(t))return!1;var e=t[h];return void 0!==e?!!e:i(t)};o({target:"Array",proto:!0,forced:!y||!m},{concat:function(t){var e,n,o,r,i,a=s(this),f=l(a,0),d=0;for(e=-1,o=arguments.length;e<o;e++)if(b(i=-1===e?a:arguments[e])){if(d+(r=u(i.length))>v)throw TypeError(g);for(n=0;n<r;n++,d++)n in i&&c(f,d,i[n])}else{if(d>=v)throw TypeError(g);c(f,d++,i)}return f.length=d,f}})},7327:function(t,e,n){"use strict";var o=n(2109),r=n(2092).filter;o({target:"Array",proto:!0,forced:!n(1194)("filter")},{filter:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},1038:function(t,e,n){var o=n(2109),r=n(8457);o({target:"Array",stat:!0,forced:!n(7072)(function(t){Array.from(t)})},{from:r})},6699:function(t,e,n){"use strict";var o=n(2109),r=n(1318).includes,i=n(1223);o({target:"Array",proto:!0},{includes:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}}),i("includes")},2772:function(t,e,n){"use strict";var o=n(2109),r=n(1318).indexOf,i=n(9341),a=[].indexOf,s=!!a&&1/[1].indexOf(1,-0)<0,u=i("indexOf");o({target:"Array",proto:!0,forced:s||!u},{indexOf:function(t){return s?a.apply(this,arguments)||0:r(this,t,arguments.length>1?arguments[1]:void 0)}})},6992:function(t,e,n){"use strict";var o=n(5656),r=n(1223),i=n(7497),a=n(9909),s=n(654),u="Array Iterator",c=a.set,l=a.getterFor(u);t.exports=s(Array,"Array",function(t,e){c(this,{type:u,target:o(t),index:0,kind:e})},function(){var t=l(this),e=t.target,n=t.kind,o=t.index++;return!e||o>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:o,done:!1}:"values"==n?{value:e[o],done:!1}:{value:[o,e[o]],done:!1}},"values"),i.Arguments=i.Array,r("keys"),r("values"),r("entries")},9600:function(t,e,n){"use strict";var o=n(2109),r=n(8361),i=n(5656),a=n(9341),s=[].join,u=r!=Object,c=a("join",",");o({target:"Array",proto:!0,forced:u||!c},{join:function(t){return s.call(i(this),void 0===t?",":t)}})},1249:function(t,e,n){"use strict";var o=n(2109),r=n(2092).map;o({target:"Array",proto:!0,forced:!n(1194)("map")},{map:function(t){return r(this,t,arguments.length>1?arguments[1]:void 0)}})},5827:function(t,e,n){"use strict";var o=n(2109),r=n(3671).left,i=n(9341),a=n(7392),s=n(5268);o({target:"Array",proto:!0,forced:!i("reduce")||!s&&a>79&&a<83},{reduce:function(t){return r(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}})},7042:function(t,e,n){"use strict";var o=n(2109),r=n(111),i=n(3157),a=n(1400),s=n(7466),u=n(5656),c=n(6135),l=n(5112),f=n(1194)("slice"),d=l("species"),p=[].slice,h=Math.max;o({target:"Array",proto:!0,forced:!f},{slice:function(t,e){var n,o,l,f=u(this),v=s(f.length),g=a(t,v),y=a(void 0===e?v:e,v);if(i(f)&&("function"!=typeof(n=f.constructor)||n!==Array&&!i(n.prototype)?r(n)&&null===(n=n[d])&&(n=void 0):n=void 0,n===Array||void 0===n))return p.call(f,g,y);for(o=new(void 0===n?Array:n)(h(y-g,0)),l=0;g<y;g++,l++)g in f&&c(o,l,f[g]);return o.length=l,o}})},2707:function(t,e,n){"use strict";var o=n(2109),r=n(3099),i=n(7908),a=n(7466),s=n(7293),u=n(4362),c=n(9341),l=n(8886),f=n(256),d=n(7392),p=n(8008),h=[],v=h.sort,g=s(function(){h.sort(void 0)}),y=s(function(){h.sort(null)}),m=c("sort"),b=!s(function(){if(d)return d<70;if(!(l&&l>3)){if(f)return!0;if(p)return p<603;var t,e,n,o,r="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:n=3;break;case 68:case 71:n=4;break;default:n=2}for(o=0;o<47;o++)h.push({k:e+o,v:n})}for(h.sort(function(t,e){return e.v-t.v}),o=0;o<h.length;o++)e=h[o].k.charAt(0),r.charAt(r.length-1)!==e&&(r+=e);return"DGBEFHACIJK"!==r}});o({target:"Array",proto:!0,forced:g||!y||!m||!b},{sort:function(t){void 0!==t&&r(t);var e=i(this);if(b)return void 0===t?v.call(e):v.call(e,t);var n,o,s=[],c=a(e.length);for(o=0;o<c;o++)o in e&&s.push(e[o]);for(n=(s=u(s,function(t){return function(e,n){return void 0===n?-1:void 0===e?1:void 0!==t?+t(e,n)||0:String(e)>String(n)?1:-1}}(t))).length,o=0;o<n;)e[o]=s[o++];for(;o<c;)delete e[o++];return e}})},561:function(t,e,n){"use strict";var o=n(2109),r=n(1400),i=n(9958),a=n(7466),s=n(7908),u=n(5417),c=n(6135),l=n(1194)("splice"),f=Math.max,d=Math.min;o({target:"Array",proto:!0,forced:!l},{splice:function(t,e){var n,o,l,p,h,v,g=s(this),y=a(g.length),m=r(t,y),b=arguments.length;if(0===b?n=o=0:1===b?(n=0,o=y-m):(n=b-2,o=d(f(i(e),0),y-m)),y+n-o>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(l=u(g,o),p=0;p<o;p++)(h=m+p)in g&&c(l,p,g[h]);if(l.length=o,n<o){for(p=m;p<y-o;p++)v=p+n,(h=p+o)in g?g[v]=g[h]:delete g[v];for(p=y;p>y-o+n;p--)delete g[p-1]}else if(n>o)for(p=y-o;p>m;p--)v=p+n-1,(h=p+o-1)in g?g[v]=g[h]:delete g[v];for(p=0;p<n;p++)g[p+m]=arguments[p+2];return g.length=y-o+n,l}})},8309:function(t,e,n){var o=n(9781),r=n(3070).f,i=Function.prototype,a=i.toString,s=/^\s*function ([^ (]*)/,u="name";o&&!(u in i)&&r(i,u,{configurable:!0,get:function(){try{return a.call(this).match(s)[1]}catch(t){return""}}})},9653:function(t,e,n){"use strict";var o=n(9781),r=n(7854),i=n(4705),a=n(1320),s=n(6656),u=n(4326),c=n(9587),l=n(7593),f=n(7293),d=n(30),p=n(8006).f,h=n(1236).f,v=n(3070).f,g=n(3111).trim,y="Number",m=r.Number,b=m.prototype,x=u(d(b))==y,w=function(t){var e,n,o,r,i,a,s,u,c=l(t,!1);if("string"==typeof c&&c.length>2)if(43===(e=(c=g(c)).charCodeAt(0))||45===e){if(88===(n=c.charCodeAt(2))||120===n)return NaN}else if(48===e){switch(c.charCodeAt(1)){case 66:case 98:o=2,r=49;break;case 79:case 111:o=8,r=55;break;default:return+c}for(a=(i=c.slice(2)).length,s=0;s<a;s++)if((u=i.charCodeAt(s))<48||u>r)return NaN;return parseInt(i,o)}return+c};if(i(y,!m(" 0o1")||!m("0b1")||m("+0x1"))){for(var E,O=function(t){var e=arguments.length<1?0:t,n=this;return n instanceof O&&(x?f(function(){b.valueOf.call(n)}):u(n)!=y)?c(new m(w(e)),n,O):w(e)},S=o?p(m):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger,fromString,range".split(","),k=0;S.length>k;k++)s(m,E=S[k])&&!s(O,E)&&v(O,E,h(m,E));O.prototype=b,b.constructor=O,a(r,y,O)}},3161:function(t,e,n){n(2109)({target:"Number",stat:!0},{isInteger:n(8730)})},9601:function(t,e,n){var o=n(2109),r=n(1574);o({target:"Object",stat:!0,forced:Object.assign!==r},{assign:r})},9595:function(t,e,n){"use strict";var o=n(2109),r=n(9781),i=n(9026),a=n(7908),s=n(3099),u=n(3070);r&&o({target:"Object",proto:!0,forced:i},{__defineGetter__:function(t,e){u.f(a(this),t,{get:s(e),enumerable:!0,configurable:!0})}})},5003:function(t,e,n){var o=n(2109),r=n(7293),i=n(5656),a=n(1236).f,s=n(9781),u=r(function(){a(1)});o({target:"Object",stat:!0,forced:!s||u,sham:!s},{getOwnPropertyDescriptor:function(t,e){return a(i(t),e)}})},9337:function(t,e,n){var o=n(2109),r=n(9781),i=n(3887),a=n(5656),s=n(1236),u=n(6135);o({target:"Object",stat:!0,sham:!r},{getOwnPropertyDescriptors:function(t){for(var e,n,o=a(t),r=s.f,c=i(o),l={},f=0;c.length>f;)void 0!==(n=r(o,e=c[f++]))&&u(l,e,n);return l}})},6210:function(t,e,n){var o=n(2109),r=n(7293),i=n(1156).f;o({target:"Object",stat:!0,forced:r(function(){return!Object.getOwnPropertyNames(1)})},{getOwnPropertyNames:i})},7941:function(t,e,n){var o=n(2109),r=n(7908),i=n(1956);o({target:"Object",stat:!0,forced:n(7293)(function(){i(1)})},{keys:function(t){return i(r(t))}})},1539:function(t,e,n){var o=n(1694),r=n(1320),i=n(288);o||r(Object.prototype,"toString",i,{unsafe:!0})},4603:function(t,e,n){var o=n(9781),r=n(7854),i=n(4705),a=n(9587),s=n(3070).f,u=n(8006).f,c=n(7850),l=n(7066),f=n(2999),d=n(1320),p=n(7293),h=n(9909).enforce,v=n(6340),g=n(5112)("match"),y=r.RegExp,m=y.prototype,b=/a/g,x=/a/g,w=new y(b)!==b,E=f.UNSUPPORTED_Y;if(o&&i("RegExp",!w||E||p(function(){return x[g]=!1,y(b)!=b||y(x)==x||"/a/i"!=y(b,"i")}))){for(var O=function(t,e){var n,o=this instanceof O,r=c(t),i=void 0===e;if(!o&&r&&t.constructor===O&&i)return t;w?r&&!i&&(t=t.source):t instanceof O&&(i&&(e=l.call(t)),t=t.source),E&&(n=!!e&&e.indexOf("y")>-1)&&(e=e.replace(/y/g,""));var s=a(w?new y(t,e):y(t,e),o?this:m,O);return E&&n&&(h(s).sticky=!0),s},S=function(t){t in O||s(O,t,{configurable:!0,get:function(){return y[t]},set:function(e){y[t]=e}})},k=u(y),I=0;k.length>I;)S(k[I++]);m.constructor=O,O.prototype=m,d(r,"RegExp",O)}v("RegExp")},4916:function(t,e,n){"use strict";var o=n(2109),r=n(2261);o({target:"RegExp",proto:!0,forced:/./.exec!==r},{exec:r})},9714:function(t,e,n){"use strict";var o=n(1320),r=n(9670),i=n(7293),a=n(7066),s="toString",u=RegExp.prototype,c=u.toString,l=i(function(){return"/a/b"!=c.call({source:"a",flags:"b"})}),f=c.name!=s;(l||f)&&o(RegExp.prototype,s,function(){var t=r(this),e=String(t.source),n=t.flags;return"/"+e+"/"+String(void 0===n&&t instanceof RegExp&&!("flags"in u)?a.call(t):n)},{unsafe:!0})},2023:function(t,e,n){"use strict";var o=n(2109),r=n(3929),i=n(4488);o({target:"String",proto:!0,forced:!n(4964)("includes")},{includes:function(t){return!!~String(i(this)).indexOf(r(t),arguments.length>1?arguments[1]:void 0)}})},8783:function(t,e,n){"use strict";var o=n(8710).charAt,r=n(9909),i=n(654),a="String Iterator",s=r.set,u=r.getterFor(a);i(String,"String",function(t){s(this,{type:a,string:String(t),index:0})},function(){var t,e=u(this),n=e.string,r=e.index;return r>=n.length?{value:void 0,done:!0}:(t=o(n,r),e.index+=t.length,{value:t,done:!1})})},4723:function(t,e,n){"use strict";var o=n(7007),r=n(9670),i=n(7466),a=n(4488),s=n(1530),u=n(7651);o("match",1,function(t,e,n){return[function(e){var n=a(this),o=null==e?void 0:e[t];return void 0!==o?o.call(e,n):new RegExp(e)[t](String(n))},function(t){var o=n(e,t,this);if(o.done)return o.value;var a=r(t),c=String(this);if(!a.global)return u(a,c);var l=a.unicode;a.lastIndex=0;for(var f,d=[],p=0;null!==(f=u(a,c));){var h=String(f[0]);d[p]=h,""===h&&(a.lastIndex=s(c,i(a.lastIndex),l)),p++}return 0===p?null:d}]})},5306:function(t,e,n){"use strict";var o=n(7007),r=n(9670),i=n(7466),a=n(9958),s=n(4488),u=n(1530),c=n(647),l=n(7651),f=Math.max,d=Math.min;o("replace",2,function(t,e,n,o){var p=o.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,h=o.REPLACE_KEEPS_$0,v=p?"$":"$0";return[function(n,o){var r=s(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,r,o):e.call(String(r),n,o)},function(t,o){if(!p&&h||"string"==typeof o&&-1===o.indexOf(v)){var s=n(e,t,this,o);if(s.done)return s.value}var g=r(t),y=String(this),m="function"==typeof o;m||(o=String(o));var b=g.global;if(b){var x=g.unicode;g.lastIndex=0}for(var w=[];;){var E=l(g,y);if(null===E)break;if(w.push(E),!b)break;""===String(E[0])&&(g.lastIndex=u(y,i(g.lastIndex),x))}for(var O,S="",k=0,I=0;I<w.length;I++){E=w[I];for(var C=String(E[0]),P=f(d(a(E.index),y.length),0),A=[],T=1;T<E.length;T++)A.push(void 0===(O=E[T])?O:String(O));var M=E.groups;if(m){var N=[C].concat(A,P,y);void 0!==M&&N.push(M);var D=String(o.apply(void 0,N))}else D=c(C,y,P,A,M,o);P>=k&&(S+=y.slice(k,P)+D,k=P+C.length)}return S+y.slice(k)}]})},3123:function(t,e,n){"use strict";var o=n(7007),r=n(7850),i=n(9670),a=n(4488),s=n(6707),u=n(1530),c=n(7466),l=n(7651),f=n(2261),d=n(2999).UNSUPPORTED_Y,p=[].push,h=Math.min,v=4294967295;o("split",2,function(t,e,n){var o;return o="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,n){var o=String(a(this)),i=void 0===n?v:n>>>0;if(0===i)return[];if(void 0===t)return[o];if(!r(t))return e.call(o,t,i);for(var s,u,c,l=[],d=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),h=0,g=new RegExp(t.source,d+"g");(s=f.call(g,o))&&!((u=g.lastIndex)>h&&(l.push(o.slice(h,s.index)),s.length>1&&s.index<o.length&&p.apply(l,s.slice(1)),c=s[0].length,h=u,l.length>=i));)g.lastIndex===s.index&&g.lastIndex++;return h===o.length?!c&&g.test("")||l.push(""):l.push(o.slice(h)),l.length>i?l.slice(0,i):l}:"0".split(void 0,0).length?function(t,n){return void 0===t&&0===n?[]:e.call(this,t,n)}:e,[function(e,n){var r=a(this),i=null==e?void 0:e[t];return void 0!==i?i.call(e,r,n):o.call(String(r),e,n)},function(t,r){var a=n(o,t,this,r,o!==e);if(a.done)return a.value;var f=i(t),p=String(this),g=s(f,RegExp),y=f.unicode,m=(f.ignoreCase?"i":"")+(f.multiline?"m":"")+(f.unicode?"u":"")+(d?"g":"y"),b=new g(d?"^(?:"+f.source+")":f,m),x=void 0===r?v:r>>>0;if(0===x)return[];if(0===p.length)return null===l(b,p)?[p]:[];for(var w=0,E=0,O=[];E<p.length;){b.lastIndex=d?0:E;var S,k=l(b,d?p.slice(E):p);if(null===k||(S=h(c(b.lastIndex+(d?E:0)),p.length))===w)E=u(p,E,y);else{if(O.push(p.slice(w,E)),O.length===x)return O;for(var I=1;I<=k.length-1;I++)if(O.push(k[I]),O.length===x)return O;E=w=S}}return O.push(p.slice(w)),O}]},d)},3210:function(t,e,n){"use strict";var o=n(2109),r=n(3111).trim;o({target:"String",proto:!0,forced:n(6091)("trim")},{trim:function(){return r(this)}})},1817:function(t,e,n){"use strict";var o=n(2109),r=n(9781),i=n(7854),a=n(6656),s=n(111),u=n(3070).f,c=n(9920),l=i.Symbol;if(r&&"function"==typeof l&&(!("description"in l.prototype)||void 0!==l().description)){var f={},d=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:String(arguments[0]),e=this instanceof d?new l(t):void 0===t?l():l(t);return""===t&&(f[e]=!0),e};c(d,l);var p=d.prototype=l.prototype;p.constructor=d;var h=p.toString,v="Symbol(test)"==String(l("test")),g=/^Symbol\((.*)\)[^)]+$/;u(p,"description",{configurable:!0,get:function(){var t=s(this)?this.valueOf():this,e=h.call(t);if(a(f,t))return"";var n=v?e.slice(7,-1):e.replace(g,"$1");return""===n?void 0:n}}),o({global:!0,forced:!0},{Symbol:d})}},2165:function(t,e,n){n(7235)("iterator")},2526:function(t,e,n){"use strict";var o=n(2109),r=n(7854),i=n(5005),a=n(1913),s=n(9781),u=n(133),c=n(3307),l=n(7293),f=n(6656),d=n(3157),p=n(111),h=n(9670),v=n(7908),g=n(5656),y=n(7593),m=n(9114),b=n(30),x=n(1956),w=n(8006),E=n(1156),O=n(5181),S=n(1236),k=n(3070),I=n(5296),C=n(8880),P=n(1320),A=n(2309),T=n(6200),M=n(3501),N=n(9711),D=n(5112),j=n(6061),L=n(7235),R=n(8003),B=n(9909),_=n(2092).forEach,K=T("hidden"),F="Symbol",U=D("toPrimitive"),H=B.set,$=B.getterFor(F),G=Object.prototype,V=r.Symbol,z=i("JSON","stringify"),Y=S.f,W=k.f,X=E.f,J=I.f,q=A("symbols"),Q=A("op-symbols"),Z=A("string-to-symbol-registry"),tt=A("symbol-to-string-registry"),et=A("wks"),nt=r.QObject,ot=!nt||!nt.prototype||!nt.prototype.findChild,rt=s&&l(function(){return 7!=b(W({},"a",{get:function(){return W(this,"a",{value:7}).a}})).a})?function(t,e,n){var o=Y(G,e);o&&delete G[e],W(t,e,n),o&&t!==G&&W(G,e,o)}:W,it=function(t,e){var n=q[t]=b(V.prototype);return H(n,{type:F,tag:t,description:e}),s||(n.description=e),n},at=c?function(t){return"symbol"==typeof t}:function(t){return Object(t)instanceof V},st=function(t,e,n){t===G&&st(Q,e,n),h(t);var o=y(e,!0);return h(n),f(q,o)?(n.enumerable?(f(t,K)&&t[K][o]&&(t[K][o]=!1),n=b(n,{enumerable:m(0,!1)})):(f(t,K)||W(t,K,m(1,{})),t[K][o]=!0),rt(t,o,n)):W(t,o,n)},ut=function(t,e){h(t);var n=g(e),o=x(n).concat(dt(n));return _(o,function(e){s&&!ct.call(n,e)||st(t,e,n[e])}),t},ct=function(t){var e=y(t,!0),n=J.call(this,e);return!(this===G&&f(q,e)&&!f(Q,e))&&(!(n||!f(this,e)||!f(q,e)||f(this,K)&&this[K][e])||n)},lt=function(t,e){var n=g(t),o=y(e,!0);if(n!==G||!f(q,o)||f(Q,o)){var r=Y(n,o);return!r||!f(q,o)||f(n,K)&&n[K][o]||(r.enumerable=!0),r}},ft=function(t){var e=X(g(t)),n=[];return _(e,function(t){f(q,t)||f(M,t)||n.push(t)}),n},dt=function(t){var e=t===G,n=X(e?Q:g(t)),o=[];return _(n,function(t){!f(q,t)||e&&!f(G,t)||o.push(q[t])}),o};u||(P((V=function(){if(this instanceof V)throw TypeError("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?String(arguments[0]):void 0,e=N(t),n=function(t){this===G&&n.call(Q,t),f(this,K)&&f(this[K],e)&&(this[K][e]=!1),rt(this,e,m(1,t))};return s&&ot&&rt(G,e,{configurable:!0,set:n}),it(e,t)}).prototype,"toString",function(){return $(this).tag}),P(V,"withoutSetter",function(t){return it(N(t),t)}),I.f=ct,k.f=st,S.f=lt,w.f=E.f=ft,O.f=dt,j.f=function(t){return it(D(t),t)},s&&(W(V.prototype,"description",{configurable:!0,get:function(){return $(this).description}}),a||P(G,"propertyIsEnumerable",ct,{unsafe:!0}))),o({global:!0,wrap:!0,forced:!u,sham:!u},{Symbol:V}),_(x(et),function(t){L(t)}),o({target:F,stat:!0,forced:!u},{for:function(t){var e=String(t);if(f(Z,e))return Z[e];var n=V(e);return Z[e]=n,tt[n]=e,n},keyFor:function(t){if(!at(t))throw TypeError(t+" is not a symbol");if(f(tt,t))return tt[t]},useSetter:function(){ot=!0},useSimple:function(){ot=!1}}),o({target:"Object",stat:!0,forced:!u,sham:!s},{create:function(t,e){return void 0===e?b(t):ut(b(t),e)},defineProperty:st,defineProperties:ut,getOwnPropertyDescriptor:lt}),o({target:"Object",stat:!0,forced:!u},{getOwnPropertyNames:ft,getOwnPropertySymbols:dt}),o({target:"Object",stat:!0,forced:l(function(){O.f(1)})},{getOwnPropertySymbols:function(t){return O.f(v(t))}}),z&&o({target:"JSON",stat:!0,forced:!u||l(function(){var t=V();return"[null]"!=z([t])||"{}"!=z({a:t})||"{}"!=z(Object(t))})},{stringify:function(t,e,n){for(var o,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(o=e,(p(e)||void 0!==t)&&!at(t))return d(e)||(e=function(t,e){if("function"==typeof o&&(e=o.call(this,t,e)),!at(e))return e}),r[1]=e,z.apply(null,r)}}),V.prototype[U]||C(V.prototype,U,V.prototype.valueOf),R(V,F),M[K]=!0},4747:function(t,e,n){var o=n(7854),r=n(8324),i=n(8533),a=n(8880);for(var s in r){var u=o[s],c=u&&u.prototype;if(c&&c.forEach!==i)try{a(c,"forEach",i)}catch(t){c.forEach=i}}},3948:function(t,e,n){var o=n(7854),r=n(8324),i=n(6992),a=n(8880),s=n(5112),u=s("iterator"),c=s("toStringTag"),l=i.values;for(var f in r){var d=o[f],p=d&&d.prototype;if(p){if(p[u]!==l)try{a(p,u,l)}catch(t){p[u]=l}if(p[c]||a(p,c,f),r[f])for(var h in i)if(p[h]!==i[h])try{a(p,h,i[h])}catch(t){p[h]=i[h]}}}}},e={};function n(o){var r=e[o];if(void 0!==r)return r.exports;var i=e[o]={exports:{}};return t[o](i,i.exports,n),i.exports}n.d=function(t,e){for(var o in e)n.o(e,o)&&!n.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return function(){"use strict";function t(t){return function(t){if(Array.isArray(t))return r(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||e(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function e(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}}function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function s(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}n.r(o),n.d(o,{default:function(){return E}}),n(3210),n(4916),n(5306),n(2772),n(8309),n(3123),n(1539),n(9714),n(561),n(9600),n(9595),n(7042),"undefined"==typeof Element||"remove"in Element.prototype||(Element.prototype.remove=function(){this.parentNode&&this.parentNode.removeChild(this)}),"undefined"!=typeof self&&"document"in self&&((!("classList"in document.createElement("_"))||document.createElementNS&&!("classList"in document.createElementNS("http://www.w3.org/2000/svg","g")))&&function(t){if("Element"in t){var e="classList",n=t.Element.prototype,o=Object,r=String.prototype.trim||function(){return this.replace(/^\s+|\s+$/g,"")},i=Array.prototype.indexOf||function(t){for(var e=0,n=this.length;e<n;e++)if(e in this&&this[e]===t)return e;return-1},a=function(t,e){this.name=t,this.code=DOMException[t],this.message=e},s=function(t,e){if(""===e)throw new a("SYNTAX_ERR","The token must not be empty.");if(/\s/.test(e))throw new a("INVALID_CHARACTER_ERR","The token must not contain space characters.");return i.call(t,e)},u=function(t){for(var e=r.call(t.getAttribute("class")||""),n=e?e.split(/\s+/):[],o=0,i=n.length;o<i;o++)this.push(n[o]);this._updateClassName=function(){t.setAttribute("class",this.toString())}},c=u.prototype=[],l=function(){return new u(this)};if(a.prototype=Error.prototype,c.item=function(t){return this[t]||null},c.contains=function(t){return~s(this,t+"")},c.add=function(){var t,e=arguments,n=0,o=e.length,r=!1;do{~s(this,t=e[n]+"")||(this.push(t),r=!0)}while(++n<o);r&&this._updateClassName()},c.remove=function(){var t,e,n=arguments,o=0,r=n.length,i=!1;do{for(e=s(this,t=n[o]+"");~e;)this.splice(e,1),i=!0,e=s(this,t)}while(++o<r);i&&this._updateClassName()},c.toggle=function(t,e){var n=this.contains(t),o=n?!0!==e&&"remove":!1!==e&&"add";return o&&this[o](t),!0===e||!1===e?e:!n},c.replace=function(t,e){var n=s(t+"");~n&&(this.splice(n,1,e),this._updateClassName())},c.toString=function(){return this.join(" ")},o.defineProperty){var f={get:l,enumerable:!0,configurable:!0};try{o.defineProperty(n,e,f)}catch(t){void 0!==t.number&&-2146823252!==t.number||(f.enumerable=!1,o.defineProperty(n,e,f))}}else o.prototype.__defineGetter__&&n.__defineGetter__(e,l)}}(self),function(){var t=document.createElement("_");if(t.classList.add("c1","c2"),!t.classList.contains("c2")){var e=function(t){var e=DOMTokenList.prototype[t];DOMTokenList.prototype[t]=function(t){var n,o=arguments.length;for(n=0;n<o;n++)t=arguments[n],e.call(this,t)}};e("add"),e("remove")}if(t.classList.toggle("c3",!1),t.classList.contains("c3")){var n=DOMTokenList.prototype.toggle;DOMTokenList.prototype.toggle=function(t,e){return 1 in arguments&&!this.contains(t)==!e?e:n.call(this,t)}}"replace"in document.createElement("_").classList||(DOMTokenList.prototype.replace=function(t,e){var n=this.toString().split(" "),o=n.indexOf(t+"");~o&&(n=n.slice(o),this.remove.apply(this,n),this.add(e),this.add.apply(this,n.slice(1)))}),t=null}()),n(7327),n(2222),n(7941),n(4603),n(2707),n(6699),n(2023),n(4747),n(9601),n(1249),n(1038),n(8783),n(2526),n(5003),n(9337),n(1817),n(2165),n(6992),n(3948),n(3161),n(9653),n(4723),n(5827),n(6210);var u=function(){function n(t){var e=t.getOptions,o=t.getCaretPosition,r=t.getCaretPositionEnd,i=t.dispatch;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,n),s(this,"getOptions",void 0),s(this,"getCaretPosition",void 0),s(this,"getCaretPositionEnd",void 0),s(this,"dispatch",void 0),s(this,"maxLengthReached",void 0),s(this,"isStandardButton",function(t){return t&&!("{"===t[0]&&"}"===t[t.length-1])}),this.getOptions=e,this.getCaretPosition=o,this.getCaretPositionEnd=r,this.dispatch=i,n.bindMethods(n,this)}var o,r,u;return o=n,u=[{key:"bindMethods",value:function(t,n){var o,r=function(t){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=e(t))){n&&(t=n);var o=0,r=function(){};return{s:r,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,s=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){s=!0,i=t},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw i}}}}(Object.getOwnPropertyNames(t.prototype));try{for(r.s();!(o=r.n()).done;){var i=o.value;"constructor"===i||"bindMethods"===i||(n[i]=n[i].bind(n))}}catch(t){r.e(t)}finally{r.f()}}}],(r=[{key:"getButtonType",value:function(t){return t.includes("{")&&t.includes("}")&&"{//}"!==t?"functionBtn":"standardBtn"}},{key:"getButtonClass",value:function(t){var e=this.getButtonType(t),n=t.replace("{","").replace("}",""),o="";return"standardBtn"!==e&&(o=" hg-button-".concat(n)),"hg-".concat(e).concat(o)}},{key:"getDefaultDiplay",value:function(){return{"{bksp}":"backspace","{backspace}":"backspace","{enter}":"< enter","{shift}":"shift","{shiftleft}":"shift","{shiftright}":"shift","{alt}":"alt","{s}":"shift","{tab}":"tab","{lock}":"caps","{capslock}":"caps","{accept}":"Submit","{space}":" ","{//}":" ","{esc}":"esc","{escape}":"esc","{f1}":"f1","{f2}":"f2","{f3}":"f3","{f4}":"f4","{f5}":"f5","{f6}":"f6","{f7}":"f7","{f8}":"f8","{f9}":"f9","{f10}":"f10","{f11}":"f11","{f12}":"f12","{numpaddivide}":"/","{numlock}":"lock","{arrowup}":"↑","{arrowleft}":"←","{arrowdown}":"↓","{arrowright}":"→","{prtscr}":"print","{scrolllock}":"scroll","{pause}":"pause","{insert}":"ins","{home}":"home","{pageup}":"up","{delete}":"del","{forwarddelete}":"del","{end}":"end","{pagedown}":"down","{numpadmultiply}":"*","{numpadsubtract}":"-","{numpadadd}":"+","{numpadenter}":"enter","{period}":".","{numpaddecimal}":".","{numpad0}":"0","{numpad1}":"1","{numpad2}":"2","{numpad3}":"3","{numpad4}":"4","{numpad5}":"5","{numpad6}":"6","{numpad7}":"7","{numpad8}":"8","{numpad9}":"9"}}},{key:"getButtonDisplayName",value:function(t,e,n){return(e=n?Object.assign({},this.getDefaultDiplay(),e):e||this.getDefaultDiplay())[t]||t}},{key:"getUpdatedInput",value:function(t,e,n){var o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:n,r=arguments.length>4&&void 0!==arguments[4]&&arguments[4],i=this.getOptions(),a=[n,o,r],s=e;return("{bksp}"===t||"{backspace}"===t)&&s.length>0?s=this.removeAt.apply(this,[s].concat(a)):("{delete}"===t||"{forwarddelete}"===t)&&s.length>0?s=this.removeForwardsAt.apply(this,[s].concat(a)):"{space}"===t?s=this.addStringAt.apply(this,[s," "].concat(a)):"{tab}"!==t||"boolean"==typeof i.tabCharOnTab&&!1===i.tabCharOnTab?"{enter}"!==t&&"{numpadenter}"!==t||!i.newLineOnEnter?t.includes("numpad")&&Number.isInteger(Number(t[t.length-2]))?s=this.addStringAt.apply(this,[s,t[t.length-2]].concat(a)):"{numpaddivide}"===t?s=this.addStringAt.apply(this,[s,"/"].concat(a)):"{numpadmultiply}"===t?s=this.addStringAt.apply(this,[s,"*"].concat(a)):"{numpadsubtract}"===t?s=this.addStringAt.apply(this,[s,"-"].concat(a)):"{numpadadd}"===t?s=this.addStringAt.apply(this,[s,"+"].concat(a)):"{numpaddecimal}"===t?s=this.addStringAt.apply(this,[s,"."].concat(a)):"{"===t||"}"===t?s=this.addStringAt.apply(this,[s,t].concat(a)):t.includes("{")||t.includes("}")||(s=this.addStringAt.apply(this,[s,t].concat(a))):s=this.addStringAt.apply(this,[s,"\n"].concat(a)):s=this.addStringAt.apply(this,[s,"\t"].concat(a)),s}},{key:"updateCaretPos",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.updateCaretPosAction(t,e);this.dispatch(function(t){t.setCaretPosition(n)})}},{key:"updateCaretPosAction",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=this.getOptions(),o=this.getCaretPosition();return null!=o&&(e?o>0&&(o-=t):o+=t),n.debug&&console.log("Caret at:",o),o}},{key:"addStringAt",value:function(t,e){var n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:t.length,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return o||0===o?(n=[t.slice(0,o),e,t.slice(r)].join(""),this.isMaxLengthReached()||i&&this.updateCaretPos(e.length)):n=t+e,n}},{key:"removeAt",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(0===n&&0===o)return t;if(n===o){var i=/([\uD800-\uDBFF][\uDC00-\uDFFF])/g;n&&n>=0?t.substring(n-2,n).match(i)?(e=t.substr(0,n-2)+t.substr(n),r&&this.updateCaretPos(2,!0)):(e=t.substr(0,n-1)+t.substr(n),r&&this.updateCaretPos(1,!0)):t.slice(-2).match(i)?(e=t.slice(0,-2),r&&this.updateCaretPos(2,!0)):(e=t.slice(0,-1),r&&this.updateCaretPos(1,!0))}else e=t.slice(0,n)+t.slice(o),r&&this.dispatch(function(t){t.setCaretPosition(n)});return e}},{key:"removeForwardsAt",value:function(t){var e,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t.length,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.length,r=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(null==t||!t.length||null===n)return t;if(n===o){e=t.substring(n,n+2).match(/([\uD800-\uDBFF][\uDC00-\uDFFF])/g)?t.substr(0,n)+t.substr(n+2):t.substr(0,n)+t.substr(n+1)}else e=t.slice(0,n)+t.slice(o),r&&this.dispatch(function(t){t.setCaretPosition(n)});return e}},{key:"handleMaxLength",value:function(t,e){var n=this.getOptions(),o=n.maxLength,r=t[n.inputName||"default"],a=e.length-1>=o;if(e.length<=r.length)return!1;if(Number.isInteger(o))return n.debug&&console.log("maxLength (num) reached:",a),a?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1);if("object"===i(o)){var s=e.length-1>=o[n.inputName||"default"];return n.debug&&console.log("maxLength (obj) reached:",s),s?(this.maxLengthReached=!0,!0):(this.maxLengthReached=!1,!1)}}},{key:"isMaxLengthReached",value:function(){return Boolean(this.maxLengthReached)}},{key:"isTouchDevice",value:function(){return"ontouchstart"in window||navigator.maxTouchPoints}},{key:"pointerEventsSupported",value:function(){return!!window.PointerEvent}},{key:"camelCase",value:function(t){return t?t.toLowerCase().trim().split(/[.\-_\s]/g).reduce(function(t,e){return e.length?t+e[0].toUpperCase()+e.slice(1):t}):""}},{key:"chunkArray",value:function(e,n){return t(Array(Math.ceil(e.length/n))).map(function(t,o){return e.slice(n*o,n+n*o)})}}])&&a(o.prototype,r),u&&a(o,u),n}();s(u,"noop",function(){});var c=u;function l(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function f(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var d=function(){function t(e){var n=e.dispatch,o=e.getOptions;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),f(this,"getOptions",void 0),f(this,"dispatch",void 0),this.dispatch=n,this.getOptions=o,c.bindMethods(t,this)}var e,n;return e=t,(n=[{key:"handleHighlightKeyDown",value:function(t){var e=this.getOptions(),n=this.getSimpleKeyboardLayoutKey(t);this.dispatch(function(t){var o=t.getButtonElement(n)||t.getButtonElement("{".concat(n,"}"));o&&(o.style.backgroundColor=e.physicalKeyboardHighlightBgColor||"#dadce4",o.style.color=e.physicalKeyboardHighlightTextColor||"black",e.physicalKeyboardHighlightPress&&o.click())})}},{key:"handleHighlightKeyUp",value:function(t){var e=this.getSimpleKeyboardLayoutKey(t);this.dispatch(function(t){var n=t.getButtonElement(e)||t.getButtonElement("{".concat(e,"}"));n&&n.removeAttribute&&n.removeAttribute("style")})}},{key:"getSimpleKeyboardLayoutKey",value:function(t){var e,n,o=t.code||t.key||this.keyCodeToKey(null==t?void 0:t.keyCode);return(n=null!=o&&o.includes("Numpad")||null!=o&&o.includes("Shift")||null!=o&&o.includes("Space")||null!=o&&o.includes("Backspace")||null!=o&&o.includes("Control")||null!=o&&o.includes("Alt")||null!=o&&o.includes("Meta")?t.code||"":t.key||this.keyCodeToKey(null==t?void 0:t.keyCode)||"").length>1?null===(e=n)||void 0===e?void 0:e.toLowerCase():n}},{key:"keyCodeToKey",value:function(t){return{8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",91:"Meta",96:"Numpad0",97:"Numpad1",98:"Numpad2",99:"Numpad3",100:"Numpad4",101:"Numpad5",102:"Numpad6",103:"Numpad7",104:"Numpad8",105:"Numpad9",106:"NumpadMultiply",107:"NumpadAdd",109:"NumpadSubtract",110:"NumpadDecimal",111:"NumpadDivide",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"}[t]}}])&&l(e.prototype,n),t}();function p(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var v=function(){function t(e){var n=e.utilities;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),h(this,"utilities",void 0),h(this,"candidateBoxElement",void 0),h(this,"pageIndex",0),h(this,"pageSize",void 0),this.utilities=n,c.bindMethods(t,this),this.pageSize=this.utilities.getOptions().layoutCandidatesPageSize||5}var e,n;return e=t,(n=[{key:"destroy",value:function(){this.candidateBoxElement&&(this.candidateBoxElement.remove(),this.pageIndex=0)}},{key:"show",value:function(t){var e=this,n=t.candidateValue,o=t.targetElement,r=t.onSelect;if(n&&n.length){var i=this.utilities.chunkArray(n.split(" "),this.pageSize);this.renderPage({candidateListPages:i,targetElement:o,pageIndex:this.pageIndex,nbPages:i.length,onItemSelected:function(t){r(t),e.destroy()}})}}},{key:"renderPage",value:function(t){var e,n=this,o=t.candidateListPages,r=t.targetElement,i=t.pageIndex,a=t.nbPages,s=t.onItemSelected;null===(e=this.candidateBoxElement)||void 0===e||e.remove(),this.candidateBoxElement=document.createElement("div"),this.candidateBoxElement.className="hg-candidate-box";var u=document.createElement("ul");u.className="hg-candidate-box-list",o[i].forEach(function(t){var e=document.createElement("li");e.className="hg-candidate-box-list-item",e.textContent=t,e.onclick=function(){return s(t)},u.appendChild(e)});var c=i>0,l=document.createElement("div");l.classList.add("hg-candidate-box-prev"),c&&l.classList.add("hg-candidate-box-btn-active"),l.onclick=function(){c&&n.renderPage({candidateListPages:o,targetElement:r,pageIndex:i-1,nbPages:a,onItemSelected:s})},this.candidateBoxElement.appendChild(l),this.candidateBoxElement.appendChild(u);var f=i<a-1,d=document.createElement("div");d.classList.add("hg-candidate-box-next"),f&&d.classList.add("hg-candidate-box-btn-active"),d.onclick=function(){f&&n.renderPage({candidateListPages:o,targetElement:r,pageIndex:i+1,nbPages:a,onItemSelected:s})},this.candidateBoxElement.appendChild(d),r.prepend(this.candidateBoxElement)}}])&&p(e.prototype,n),t}();function g(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=new Array(e);n<e;n++)o[n]=t[n];return o}function m(t){return(m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function b(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function x(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,o.key,o)}}function w(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var E=function(){function t(){var e=this;if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),w(this,"input",void 0),w(this,"options",void 0),w(this,"utilities",void 0),w(this,"caretPosition",void 0),w(this,"caretPositionEnd",void 0),w(this,"keyboardDOM",void 0),w(this,"keyboardPluginClasses",void 0),w(this,"keyboardDOMClass",void 0),w(this,"buttonElements",void 0),w(this,"currentInstanceName",void 0),w(this,"allKeyboardInstances",void 0),w(this,"keyboardInstanceNames",void 0),w(this,"isFirstKeyboardInstance",void 0),w(this,"physicalKeyboard",void 0),w(this,"modules",void 0),w(this,"activeButtonClass",void 0),w(this,"holdInteractionTimeout",void 0),w(this,"holdTimeout",void 0),w(this,"isMouseHold",void 0),w(this,"initialized",void 0),w(this,"candidateBox",void 0),w(this,"keyboardRowsDOM",void 0),w(this,"defaultName","default"),w(this,"activeInputElement",null),w(this,"handleParams",function(t){var e,n,o;if("string"==typeof t[0])e=t[0].split(".").join(""),n=document.querySelector(".".concat(e)),o=t[1];else if(t[0]instanceof HTMLDivElement){if(!t[0].className)throw console.warn("Any DOM element passed as parameter must have a class."),new Error("KEYBOARD_DOM_CLASS_ERROR");e=t[0].className.split(" ")[0],n=t[0],o=t[1]}else e="simple-keyboard",n=document.querySelector(".".concat(e)),o=t[0];return{keyboardDOMClass:e,keyboardDOM:n,options:o}}),w(this,"getOptions",function(){return e.options}),w(this,"getCaretPosition",function(){return e.caretPosition}),w(this,"getCaretPositionEnd",function(){return e.caretPositionEnd}),w(this,"registerModule",function(t,n){e.modules[t]||(e.modules[t]={}),n(e.modules[t])}),w(this,"getKeyboardClassString",function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];var r=[e.keyboardDOMClass].concat(n).filter(function(t){return!!t});return r.join(" ")}),"undefined"!=typeof window){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];var i=this.handleParams(o),a=i.keyboardDOMClass,s=i.keyboardDOM,u=i.options,l=void 0===u?{}:u;this.utilities=new c({getOptions:this.getOptions,getCaretPosition:this.getCaretPosition,getCaretPositionEnd:this.getCaretPositionEnd,dispatch:this.dispatch}),this.caretPosition=null,this.caretPositionEnd=null,this.keyboardDOM=s,this.options=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?b(Object(n),!0).forEach(function(e){w(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):b(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({layoutName:"default",theme:"hg-theme-default",inputName:"default",preventMouseDownDefault:!1,enableLayoutCandidates:!0,excludeFromLayout:{}},l),this.keyboardPluginClasses="",c.bindMethods(t,this);var f=this.options.inputName,p=void 0===f?this.defaultName:f;if(this.input={},this.input[p]="",this.keyboardDOMClass=a,this.buttonElements={},window.SimpleKeyboardInstances||(window.SimpleKeyboardInstances={}),this.currentInstanceName=this.utilities.camelCase(this.keyboardDOMClass),window.SimpleKeyboardInstances[this.currentInstanceName]=this,this.allKeyboardInstances=window.SimpleKeyboardInstances,this.keyboardInstanceNames=Object.keys(window.SimpleKeyboardInstances),this.isFirstKeyboardInstance=this.keyboardInstanceNames[0]===this.currentInstanceName,this.physicalKeyboard=new d({dispatch:this.dispatch,getOptions:this.getOptions}),this.candidateBox=this.options.enableLayoutCandidates?new v({utilities:this.utilities}):null,!this.keyboardDOM)throw console.warn('".'.concat(a,'" was not found in the DOM.')),new Error("KEYBOARD_DOM_ERROR");this.render(),this.modules={},this.loadModules()}}var e,n;return e=t,(n=[{key:"setCaretPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t;this.caretPosition=t,this.caretPositionEnd=e}},{key:"getInputCandidates",value:function(t){var e=this.options.layoutCandidates;if(!e||"object"!==m(e))return{};var n=Object.keys(e).filter(function(e){var n=new RegExp("".concat(e,"$"),"g");return!!g(t.matchAll(n)).length});if(n.length>1){var o=n.sort(function(t,e){return e.length-t.length})[0];return{candidateKey:o,candidateValue:e[o]}}if(n.length){var r=n[0];return{candidateKey:r,candidateValue:e[r]}}return{}}},{key:"showCandidatesBox",value:function(t,e,n){var o=this;this.candidateBox&&this.candidateBox.show({candidateValue:e,targetElement:n,onSelect:function(e){var n=o.getInput(o.options.inputName,!0),r=new RegExp("".concat(t,"$"),"g"),i=n.replace(r,e);o.setInput(i,o.options.inputName,!0),"function"==typeof o.options.onChange&&o.options.onChange(o.getInput(o.options.inputName,!0)),"function"==typeof o.options.onChangeAll&&o.options.onChangeAll(o.getAllInputs())}})}},{key:"handleButtonClicked",value:function(t,e){var n=this.options,o=n.inputName,r=void 0===o?this.defaultName:o,i=n.debug;if("{//}"!==t){this.input[r]||(this.input[r]="");var a=this.utilities.getUpdatedInput(t,this.input[r],this.caretPosition,this.caretPositionEnd);if(this.utilities.isStandardButton(t)&&this.activeInputElement&&this.input[r]&&this.input[r]===a&&0===this.caretPosition&&this.caretPositionEnd===a.length)return this.setInput("",this.options.inputName,!0),this.setCaretPosition(0),this.activeInputElement.value="",this.activeInputElement.setSelectionRange(0,0),void this.handleButtonClicked(t,e);if("function"==typeof this.options.onKeyPress&&this.options.onKeyPress(t),this.input[r]!==a&&(!this.options.inputPattern||this.options.inputPattern&&this.inputPatternIsValid(a))){if(this.options.maxLength&&this.utilities.handleMaxLength(this.input,a))return;var s=this.utilities.getUpdatedInput(t,this.input[r],this.caretPosition,this.caretPositionEnd,!0);if(this.setInput(s,this.options.inputName,!0),i&&console.log("Input changed:",this.getAllInputs()),this.options.debug&&console.log("Caret at: ",this.getCaretPosition(),this.getCaretPositionEnd(),"(".concat(this.keyboardDOMClass,")")),this.options.syncInstanceInputs&&this.syncInstanceInputs(),"function"==typeof this.options.onChange&&this.options.onChange(this.getInput(this.options.inputName,!0)),"function"==typeof this.options.onChangeAll&&this.options.onChangeAll(this.getAllInputs()),null!=e&&e.target&&this.options.enableLayoutCandidates){var u,c=this.getInputCandidates(a),l=c.candidateKey,f=c.candidateValue;l&&f?this.showCandidatesBox(l,f,this.keyboardDOM):null===(u=this.candidateBox)||void 0===u||u.destroy()}}i&&console.log("Key pressed:",t)}}},{key:"handleButtonMouseDown",value:function(t,e){var n=this;e&&(this.options.preventMouseDownDefault&&e.preventDefault(),this.options.stopMouseDownPropagation&&e.stopPropagation(),e.target.classList.add(this.activeButtonClass)),this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdTimeout&&clearTimeout(this.holdTimeout),this.isMouseHold=!0,this.options.disableButtonHold||(this.holdTimeout=window.setTimeout(function(){(n.isMouseHold&&(!t.includes("{")&&!t.includes("}")||"{delete}"===t||"{backspace}"===t||"{bksp}"===t||"{space}"===t||"{tab}"===t)||"{arrowright}"===t||"{arrowleft}"===t||"{arrowup}"===t||"{arrowdown}"===t)&&(n.options.debug&&console.log("Button held:",t),n.handleButtonHold(t)),clearTimeout(n.holdTimeout)},500))}},{key:"handleButtonMouseUp",value:function(t,e){var n=this;e&&(this.options.preventMouseUpDefault&&e.preventDefault&&e.preventDefault(),this.options.stopMouseUpPropagation&&e.stopPropagation&&e.stopPropagation(),!(e.target===this.keyboardDOM||e.target&&this.keyboardDOM.contains(e.target)||this.candidateBox&&this.candidateBox.candidateBoxElement&&(e.target===this.candidateBox.candidateBoxElement||e.target&&this.candidateBox.candidateBoxElement.contains(e.target)))&&this.candidateBox&&this.candidateBox.destroy()),this.recurseButtons(function(t){t.classList.remove(n.activeButtonClass)}),this.isMouseHold=!1,this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),t&&"function"==typeof this.options.onKeyReleased&&this.options.onKeyReleased(t)}},{key:"handleKeyboardContainerMouseDown",value:function(t){this.options.preventMouseDownDefault&&t.preventDefault()}},{key:"handleButtonHold",value:function(t){var e=this;this.holdInteractionTimeout&&clearTimeout(this.holdInteractionTimeout),this.holdInteractionTimeout=window.setTimeout(function(){e.isMouseHold?(e.handleButtonClicked(t),e.handleButtonHold(t)):clearTimeout(e.holdInteractionTimeout)},100)}},{key:"syncInstanceInputs",value:function(){var t=this;this.dispatch(function(e){e.replaceInput(t.input),e.setCaretPosition(t.caretPosition,t.caretPositionEnd)})}},{key:"clearInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.inputName||this.defaultName;this.input[t]="",this.setCaretPosition(0),this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"getInput",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.options.inputName||this.defaultName,e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return this.options.syncInstanceInputs&&!e&&this.syncInstanceInputs(),this.options.rtl?"‫"+this.input[t].replace("‫","").replace("‬","")+"‬":this.input[t]}},{key:"getAllInputs",value:function(){var t=this,e={};return Object.keys(this.input).forEach(function(n){e[n]=t.getInput(n,!0)}),e}},{key:"setInput",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.options.inputName||this.defaultName,n=arguments.length>2?arguments[2]:void 0;this.input[e]=t,!n&&this.options.syncInstanceInputs&&this.syncInstanceInputs()}},{key:"replaceInput",value:function(t){this.input=t}},{key:"setOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.changedOptions(t);this.options=Object.assign(this.options,t),e.length&&(this.options.debug&&console.log("changedOptions",e),this.onSetOptions(e),this.render())}},{key:"changedOptions",value:function(t){var e=this;return Object.keys(t).filter(function(n){return JSON.stringify(t[n])!==JSON.stringify(e.options[n])})}},{key:"onSetOptions",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];t.includes("layoutName")&&this.candidateBox&&this.candidateBox.destroy(),(t.includes("layoutCandidatesPageSize")||t.includes("layoutCandidates"))&&this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=new v({utilities:this.utilities}))}},{key:"resetRows",value:function(){this.keyboardRowsDOM&&this.keyboardRowsDOM.remove(),this.keyboardDOM.className=this.keyboardDOMClass,this.buttonElements={}}},{key:"dispatch",value:function(t){if(!window.SimpleKeyboardInstances)throw console.warn("SimpleKeyboardInstances is not defined. Dispatch cannot be called."),new Error("INSTANCES_VAR_ERROR");return Object.keys(window.SimpleKeyboardInstances).forEach(function(e){t(window.SimpleKeyboardInstances[e],e)})}},{key:"addButtonTheme",value:function(t,e){var n=this;e&&t&&(t.split(" ").forEach(function(o){e.split(" ").forEach(function(e){n.options.buttonTheme||(n.options.buttonTheme=[]);var r=!1;n.options.buttonTheme.map(function(t){if(null!=t&&t.class.split(" ").includes(e)){r=!0;var n=t.buttons.split(" ");n.includes(o)||(r=!0,n.push(o),t.buttons=n.join(" "))}return t}),r||n.options.buttonTheme.push({class:e,buttons:t})})}),this.render())}},{key:"removeButtonTheme",value:function(t,e){var n=this;if(!t&&!e)return this.options.buttonTheme=[],void this.render();t&&Array.isArray(this.options.buttonTheme)&&this.options.buttonTheme.length&&(t.split(" ").forEach(function(t){var o,r;null===(o=n.options)||void 0===o||null===(r=o.buttonTheme)||void 0===r||r.map(function(o,r){if(o&&e&&e.includes(o.class)||!e){var i,a,s=null===(i=o)||void 0===i?void 0:i.buttons.split(" ").filter(function(e){return e!==t});o&&null!=s&&s.length?o.buttons=s.join(" "):(null===(a=n.options.buttonTheme)||void 0===a||a.splice(r,1),o=null)}return o})}),this.render())}},{key:"getButtonElement",value:function(t){var e,n=this.buttonElements[t];return n&&(e=n.length>1?n:n[0]),e}},{key:"inputPatternIsValid",value:function(t){var e,n=this.options.inputPattern;if((e=n instanceof RegExp?n:n[this.options.inputName||this.defaultName])&&t){var o=e.test(t);return this.options.debug&&console.log('inputPattern ("'.concat(e,'"): ').concat(o?"passed":"did not pass!")),o}return!0}},{key:"setEventListeners",value:function(){!this.isFirstKeyboardInstance&&this.allKeyboardInstances||(this.options.debug&&console.log("Caret handling started (".concat(this.keyboardDOMClass,")")),document.addEventListener("keyup",this.handleKeyUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("touchend",this.handleTouchEnd),document.addEventListener("select",this.handleSelect))}},{key:"handleKeyUp",value:function(t){this.caretEventHandler(t),this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyUp(t)}},{key:"handleKeyDown",value:function(t){this.options.physicalKeyboardHighlight&&this.physicalKeyboard.handleHighlightKeyDown(t)}},{key:"handleMouseUp",value:function(t){this.caretEventHandler(t)}},{key:"handleTouchEnd",value:function(t){this.caretEventHandler(t)}},{key:"handleSelect",value:function(t){this.caretEventHandler(t)}},{key:"caretEventHandler",value:function(t){var e,n=this;t.target.tagName&&(e=t.target.tagName.toLowerCase()),this.dispatch(function(o){var r=t.target===o.keyboardDOM||t.target&&o.keyboardDOM.contains(t.target);o.isMouseHold&&(o.isMouseHold=!1),("textarea"===e||"input"===e&&["text","search","url","tel","password"].includes(t.target.type))&&!o.options.disableCaretPositioning?(o.setCaretPosition(t.target.selectionStart,t.target.selectionEnd),n.activeInputElement=t.target,o.options.debug&&console.log("Caret at: ",o.getCaretPosition(),o.getCaretPositionEnd(),t&&t.target.tagName.toLowerCase(),"(".concat(o.keyboardDOMClass,")"))):!o.options.disableCaretPositioning&&r||(o.setCaretPosition(null),n.activeInputElement=null,o.options.debug&&console.log('Caret position reset due to "'.concat(null==t?void 0:t.type,'" event'),t))})}},{key:"recurseButtons",value:function(t){var e=this;t&&Object.keys(this.buttonElements).forEach(function(n){return e.buttonElements[n].forEach(t)})}},{key:"destroy",value:function(){this.options.debug&&console.log("Destroying simple-keyboard instance: ".concat(this.currentInstanceName)),document.removeEventListener("keyup",this.handleKeyUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("touchend",this.handleTouchEnd),document.removeEventListener("select",this.handleSelect),document.onpointerup=null,document.ontouchend=null,document.ontouchcancel=null,document.onmouseup=null,this.recurseButtons(function(t){t&&(t.onpointerdown=null,t.onpointerup=null,t.onpointercancel=null,t.ontouchstart=null,t.ontouchend=null,t.ontouchcancel=null,t.onclick=null,t.onmousedown=null,t.onmouseup=null,t.remove(),t=null)}),this.keyboardDOM.onpointerdown=null,this.keyboardDOM.ontouchstart=null,this.keyboardDOM.onmousedown=null,this.resetRows(),this.candidateBox&&(this.candidateBox.destroy(),this.candidateBox=null),this.activeInputElement=null,this.keyboardDOM.innerHTML="",window.SimpleKeyboardInstances[this.currentInstanceName]=null,delete window.SimpleKeyboardInstances[this.currentInstanceName],this.initialized=!1}},{key:"getButtonThemeClasses",value:function(t){var e=this.options.buttonTheme,n=[];return Array.isArray(e)&&e.forEach(function(e){if(e&&e.class&&"string"==typeof e.class&&e.buttons&&"string"==typeof e.buttons){var o=e.class.split(" ");e.buttons.split(" ").includes(t)&&(n=[].concat(g(n),g(o)))}else console.warn('Incorrect "buttonTheme". Please check the documentation.',e)}),n}},{key:"setDOMButtonAttributes",value:function(t,e){var n=this.options.buttonAttributes;Array.isArray(n)&&n.forEach(function(n){n.attribute&&"string"==typeof n.attribute&&n.value&&"string"==typeof n.value&&n.buttons&&"string"==typeof n.buttons?n.buttons.split(" ").includes(t)&&e(n.attribute,n.value):console.warn('Incorrect "buttonAttributes". Please check the documentation.',n)})}},{key:"onTouchDeviceDetected",value:function(){this.processAutoTouchEvents(),this.disableContextualWindow()}},{key:"disableContextualWindow",value:function(){window.oncontextmenu=function(t){if(t.target.classList.contains("hg-button"))return t.preventDefault(),t.stopPropagation(),!1}}},{key:"processAutoTouchEvents",value:function(){this.options.autoUseTouchEvents&&(this.options.useTouchEvents=!0,this.options.debug&&console.log("autoUseTouchEvents: Touch device detected, useTouchEvents enabled."))}},{key:"onInit",value:function(){this.options.debug&&console.log("".concat(this.keyboardDOMClass," Initialized")),this.setEventListeners(),"function"==typeof this.options.onInit&&this.options.onInit(this)}},{key:"beforeFirstRender",value:function(){this.utilities.isTouchDevice()&&this.onTouchDeviceDetected(),"function"==typeof this.options.beforeFirstRender&&this.options.beforeFirstRender(this),this.isFirstKeyboardInstance&&this.utilities.pointerEventsSupported()&&!this.options.useTouchEvents&&!this.options.useMouseEvents&&this.options.debug&&console.log("Using PointerEvents as it is supported by this browser"),this.options.useTouchEvents&&this.options.debug&&console.log("useTouchEvents has been enabled. Only touch events will be used.")}},{key:"beforeRender",value:function(){"function"==typeof this.options.beforeRender&&this.options.beforeRender(this)}},{key:"onRender",value:function(){"function"==typeof this.options.onRender&&this.options.onRender(this)}},{key:"onModulesLoaded",value:function(){"function"==typeof this.options.onModulesLoaded&&this.options.onModulesLoaded(this)}},{key:"loadModules",value:function(){var t=this;Array.isArray(this.options.modules)&&(this.options.modules.forEach(function(e){var n=new e(t);n.init&&n.init(t)}),this.keyboardPluginClasses="modules-loaded",this.render(),this.onModulesLoaded())}},{key:"getModuleProp",value:function(t,e){return!!this.modules[t]&&this.modules[t][e]}},{key:"getModulesList",value:function(){return Object.keys(this.modules)}},{key:"parseRowDOMContainers",value:function(t,e,n,o){var r=this,i=Array.from(t.children),a=0;return i.length&&n.forEach(function(n,s){var u=o[s];if(!(u&&u>n))return!1;var c=n-a,l=u-a,f=document.createElement("div");f.className+="hg-button-container";var d="".concat(r.options.layoutName,"-r").concat(e,"c").concat(s);f.setAttribute("data-skUID",d);var p=i.splice(c,l-c+1);a=l-c,p.forEach(function(t){return f.appendChild(t)}),i.splice(c,0,f),t.innerHTML="",i.forEach(function(e){return t.appendChild(e)}),r.options.debug&&console.log("rowDOMContainer",p,c,l,a+1)}),t}},{key:"render",value:function(){var t=this;this.resetRows(),this.initialized||this.beforeFirstRender(),this.beforeRender();var e="hg-layout-".concat(this.options.layoutName),n=this.options.layout||{default:["` 1 2 3 4 5 6 7 8 9 0 -={bksp}","{tab} q w e r t y u i o p [ ] \\","{lock} a s d f g h j k l ; ' {enter}","{shift} z x c v b n m , . / {shift}",".com @ {space}"],shift:["~ ! @ # $ % ^ & *() _ + {bksp}","{tab} Q W E R T Y U I O P { } |",'{lock} A S D F G H J K L:" {enter}',"{shift} Z X C V B N M < > ? {shift}",".com @ {space}"]},o=this.options.useTouchEvents||!1,r=o?"hg-touch-events":"",i=this.options.useMouseEvents||!1,a=this.options.disableRowButtonContainers;this.keyboardDOM.className=this.getKeyboardClassString(this.options.theme,e,this.keyboardPluginClasses,r),this.keyboardRowsDOM=document.createElement("div"),this.keyboardRowsDOM.className="hg-rows",n[this.options.layoutName||this.defaultName].forEach(function(e,n){var r=e.split(" ");t.options.excludeFromLayout&&t.options.excludeFromLayout[t.options.layoutName||t.defaultName]&&(r=r.filter(function(e){return t.options.excludeFromLayout&&!t.options.excludeFromLayout[t.options.layoutName||t.defaultName].includes(e)}));var s=document.createElement("div");s.className+="hg-row";var u=[],c=[];r.forEach(function(e,r){var l,f=!a&&"string"==typeof e&&e.length>1&&0===e.indexOf("["),d=!a&&"string"==typeof e&&e.length>1&&e.indexOf("]")===e.length-1;f&&(u.push(r),e=e.replace(/\[/g,"")),d&&(c.push(r),e=e.replace(/\]/g,""));var p=t.utilities.getButtonClass(e),h=t.utilities.getButtonDisplayName(e,t.options.display,t.options.mergeDisplay),v=t.options.useButtonTag?"button":"div",y=document.createElement(v);y.className+="hg-button ".concat(p),(l=y.classList).add.apply(l,g(t.getButtonThemeClasses(e))),t.setDOMButtonAttributes(e,function(t,e){y.setAttribute(t,e)}),t.activeButtonClass="hg-activeButton",!t.utilities.pointerEventsSupported()||o||i?o?(y.ontouchstart=function(n){t.handleButtonClicked(e,n),t.handleButtonMouseDown(e,n)},y.ontouchend=function(n){t.handleButtonMouseUp(e,n)},y.ontouchcancel=function(n){t.handleButtonMouseUp(e,n)}):(y.onclick=function(n){t.isMouseHold=!1,t.handleButtonClicked(e,n)},y.onmousedown=function(n){t.handleButtonMouseDown(e,n)},y.onmouseup=function(n){t.handleButtonMouseUp(e,n)}):(y.onpointerdown=function(n){t.handleButtonClicked(e,n),t.handleButtonMouseDown(e,n)},y.onpointerup=function(n){t.handleButtonMouseUp(e,n)},y.onpointercancel=function(n){t.handleButtonMouseUp(e,n)}),y.setAttribute("data-skBtn",e);var m="".concat(t.options.layoutName,"-r").concat(n,"b").concat(r);y.setAttribute("data-skBtnUID",m);var b=document.createElement("span");b.innerHTML=h,y.appendChild(b),t.buttonElements[e]||(t.buttonElements[e]=[]),t.buttonElements[e].push(y),s.appendChild(y)}),s=t.parseRowDOMContainers(s,n,u,c),t.keyboardRowsDOM.appendChild(s)}),this.keyboardDOM.appendChild(this.keyboardRowsDOM),this.onRender(),this.initialized||(this.initialized=!0,!this.utilities.pointerEventsSupported()||o||i?o?(document.ontouchend=function(e){return t.handleButtonMouseUp(void 0,e)},document.ontouchcancel=function(e){return t.handleButtonMouseUp(void 0,e)},this.keyboardDOM.ontouchstart=function(e){return t.handleKeyboardContainerMouseDown(e)}):o||(document.onmouseup=function(e){return t.handleButtonMouseUp(void 0,e)},this.keyboardDOM.onmousedown=function(e){return t.handleKeyboardContainerMouseDown(e)}):(document.onpointerup=function(e){return t.handleButtonMouseUp(void 0,e)},this.keyboardDOM.onpointerdown=function(e){return t.handleKeyboardContainerMouseDown(e)}),this.onInit())}}])&&x(e.prototype,n),t}()}(),o}()});