!function($){"use strict";$.WS_Form=function(e){$.WS_Form.this=this,this.is_admin=this.set_is_admin(),this.user_roles=ws_form_settings.user_roles,this.form_interface=!1,this.group_data_cache=[],this.group_index=0,this.section_data_cache=[],this.field_data_cache=[],this.action_data_cache=[],this.validation_message_cache=[],this.invalid_feedback_cache=[],this.object_cache=[],this.object_cache.condition=[],this.object_cache.then=[],this.object_cache.else=[],this.action=!1,this.object_data_scratch=!1,this.form_history=[],this.history_index=0,this.framework_id=!1,this.framework=!1,this.framework_fields=!1,this.column_resize_obj=!1,this.column_size_value=0,this.column_size_value_old=0,this.offset_value=0,this.offset_value_old=0,this.dragged_field=null,this.dragged_field_in_section=null,this.dragged_section=null,this.dragged_section_in_group=null,this.dragging=!1,this.next_sibling_id_old=null,this.section_id_old=null,this.group_id_old=null,this.section_repeatable_dragged=!1,this.section_repeatable_indexes={},this.checksum=!1,this.checksum_setTimeout=!1,this.published_checksum="",this.recaptchas=[],this.recaptchas_v2_default=[],this.recaptchas_v2_invisible=[],this.recaptchas_v3_default=[],this.recaptchas_conditions=[],this.timeout_recaptcha=3e4,this.hcaptchas=[],this.hcaptchas_default=[],this.hcaptchas_invisible=[],this.hcaptchas_conditions=[],this.timeout_hcaptcha=3e4,this.turnstiles=[],this.turnstiles_default=[],this.turnstiles_conditions=[],this.timeout_turnstile=3e4,this.conditional=!1,this.conditional_data=!1,this.conditional_index_dragged_from=!1,this.conditional_icons_array=!1,this.conditional_highlight_array=!1,this.conditional_highlight_row_index=!1,this.conditional_row_array=!1,this.conditional_actions_run_action=[],this.conditional_actions_run_save=[],this.conditional_actions_run_submit=[],this.conditional_cache=!1,this.conditional_event_selector_to_condition=[],this.signatures=[],this.signatures_by_name=[],this.timeout_signature=3e4,this.google_maps=[],this.timeout_google_maps=3e4,this.timeout_analytics_google=3e4,this.timeout_analytics_data_layer=3e4,this.analytics_function=[],this.debug_height=0,this.debug_field_id_bypass=[],this.debug_timer,this.debug_log_array=[],this.debug_error_array=[],this.debug_timeout,this.text_editor_index=1,this.code_editor_index=1,this.form_events_reset=[],this.keydown=[],this.timeout_interval=100,this.api_call_queue=[],this.api_call_queue_running=!1,this.number_to_word=["nought","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen","twenty"],this.label_old="",this.submit=!1,this.action_js=[],this.form_draft=!1,this.submit_auto_populate=!1,this.form_id_prefix="wsf-",this.field_name_prefix=ws_form_settings.field_prefix,this.meta_key_options_cache=[],this.options_action_objects=[],this.options_action_cache=[],this.sidebar_conditions=[],this.sidebar_expanded_obj=!1,this.sidebar_lock_count=0,this.touch_device="ontouchend"in document,this.hash="",this.token="",this.token_validated=!1,this.form_post_locked=!1,this.form_post_lock_start=0,this.form_post_lock_duration_max=1e3,this.form_loader_showing=!1,this.form_loader_show_start=0,this.form_loader_show_duration_max=this.form_post_lock_duration_max,this.form_loader_timeout_id=!1,this.field_required_bypass=[],this.form_valid=!1,this.form_valid_old=null,this.form_validation_real_time_hooks=[],this.ecommerce_cart_price_type=[],this.has_ecommerce=!1,this.form_ecommerce_calculate_enabled=!0,this.progress=0,this.progress_percent="0%",this.progress_array=[],this.progress_class_complete="",this.progress_class_incomplete="",this.upload_obj=!1;var t=document.createElement("input");t.setAttribute("type","date"),this.native_date="date"==t.type,this.timeout_datetimepicker=5e3;var a=document.createElement("input");a.setAttribute("type","color"),this.native_color="color"==a.type,this.timeout_minicolors=5e3,this.form_action_custom=!1,this.form_ajax=!0,this.object_focus=!1,this.field_type_click_drag_check=!1,this.section_id_click_drag_check=!1,this.password_strength_status=0,this.cascade_cache=[],this.select_ajax_cache=[],this.preview_window=void 0,this.calc=[],this.file_frame=!1,this.file_frame_input_obj=!1,this.api_call_handle=[],this.visual_builder=!1,this.form_bypass_enabled=!1,this.action_js_process_validation_focus=!0,this.action_ga=!1,this.dropzonejs_processes=0,this.dropzonejs_index_dragged_from=0,this.conversational=!1,this.form_stat_add_lock=!1,this.form_geo_cache=!1,this.form_geo_cache_request=!1,this.form_geo_stack=[]},$.WS_Form.prototype.render=function(e){var t=this;void 0===e&&this.error("error_attributes"),void 0===e.obj&&this.error("error_attributes_obj"),void 0===e.form_id&&this.error("error_attributes_form_id"),this.form_canvas_obj=e.obj instanceof $?e.obj:$(e.obj),this.form_obj_id=this.form_canvas_obj.attr("id"),this.form_id=parseInt(e.form_id,10),0!==this.form_id&&(this.form_instance_id=parseInt(this.form_canvas_obj.attr("data-instance-id"),10),0!==this.form_instance_id&&(this.form_id_prefix=this.is_admin?"wsf-":"wsf-"+this.form_instance_id+"-",this.form_id_prefix_function=this.is_admin?"wsf_":"wsf_"+this.form_instance_id+"_",this.form_obj=this.form_canvas_obj.closest("form"),this.form_obj.length?this.form_obj.attr("novalidate",""):this.form_obj=this.form_canvas_obj,this.form_obj[0]!=this.form_canvas_obj[0]&&(this.form_obj.hasClass("wsf-form")||this.form_obj.addClass("wsf-form"),this.form_canvas_obj.hasClass("wsf-form")&&this.form_canvas_obj.removeClass("wsf-form")),this.form_canvas_obj.html(""),this.get_configuration(function(){t.get_form(function(){"function"==typeof t.debug&&t.debug(),t.is_admin||("function"==typeof t.form_loader&&t.form_loader(),"function"==typeof t.form_loader_show&&t.form_loader_show("render")),t.init()})})))},$.WS_Form.configured=!1,$.WS_Form.css_rendered=!1,$.WS_Form.debug,$.WS_Form.debug_rendered=!1,$.WS_Form.analytics,$.WS_Form.tracking,$.WS_Form.ecommerce,$.WS_Form.calc,$.WS_Form.settings_plugin,$.WS_Form.settings_form=null,$.WS_Form.frameworks,$.WS_Form.parse_variables,$.WS_Form.parse_variable_help,$.WS_Form.parse_variable_repairable,$.WS_Form.actions,$.WS_Form.field_types,$.WS_Form.field_type_cache=[],$.WS_Form.file_types,$.WS_Form.meta_keys,$.WS_Form.meta_keys_required_setting=[],$.WS_Form.breakpoints,$.WS_Form.data_sources,$.WS_Form.templates_section,$.WS_Form.prototype.get_configuration=function(e,t,a){if(void 0===t&&(t=!1),void 0===a&&(a=!1),this.options_action_cache=[],a||this.loader_on(),!$.WS_Form.configured||t)if("undefined"==typeof wsf_form_json_config){var r=this;this.api_call("config","GET",!1,function(t){r.set_configuration(t.data),window.wsf_form_json_config=t.data,"function"==typeof e&&e()},!1,a)}else this.set_configuration(wsf_form_json_config),"function"==typeof e&&e();else"function"==typeof e&&e()},$.WS_Form.prototype.set_configuration=function(e){if($.WS_Form.settings_plugin=e.settings_plugin,$.WS_Form.settings_form=e.settings_form,$.WS_Form.frameworks=e.frameworks,$.WS_Form.field_types=e.field_types,$.WS_Form.file_types=e.file_types,$.WS_Form.meta_keys=e.meta_keys,$.WS_Form.parse_variables=e.parse_variables,$.WS_Form.parse_variables_repairable=e.parse_variables_repairable,$.WS_Form.parse_variable_help=e.parse_variable_help,$.WS_Form.actions=e.actions,$.WS_Form.data_sources=e.data_sources,$.WS_Form.templates_section=e.templates_section,$.WS_Form.calc=e.calc,$.WS_Form.tracking=e.tracking,$.WS_Form.ecommerce=e.ecommerce,this.is_admin||($.WS_Form.analytics=JSON.parse(atob(e.analytics))),void 0!==$.WS_Form.parse_variables){var t=[];for(var a in $.WS_Form.parse_variables)$.WS_Form.parse_variables.hasOwnProperty(a)&&t.push([a,$.WS_Form.parse_variables[a].priority]);t.sort(function(e,t){var a=void 0!==e[1]?e[1]:0;return(void 0!==t[1]?t[1]:0)-a});var r={};for(var a in t)if(t.hasOwnProperty(a)){var i=t[a][0];r[i]=$.WS_Form.parse_variables[i]}$.WS_Form.parse_variables=r}void 0!==e.debug&&($.WS_Form.debug=e.debug),this.field_type_cache_build(),$.WS_Form.configured=!0},$.WS_Form.prototype.get_form=function(e){if(0==this.form_id)return this.error("error_form_id"),void this.loader_off();if($("#"+this.form_obj_id).attr("data-id",this.form_id),"undefined"==typeof wsf_form_json||void 0===wsf_form_json[this.form_id]){var t=this;this.api_call("form/"+this.form_id+"/full","GET",!1,function(a){t.form=a.form,void 0===window.wsf_form_json&&(window.wsf_form_json=[]),window.wsf_form_json[t.form_id]=a.form,t.data_cache_build(),"function"==typeof e&&e(),t.loader_off()})}else this.form=wsf_form_json[this.form_id],this.data_cache_build(),"function"==typeof e&&e(),this.loader_off()},$.WS_Form.prototype.form_build=function(){if(this.timer_start=new Date,this.form_canvas_obj.children().not(".wsf-loader").remove(),this.form_canvas_obj.append(this.get_form_html(this.form)),!this.is_admin){var e=this.get_object_meta_value(this.form,"class_form_wrapper","");if(""!=e){var t=this.form_canvas_obj.attr("class");t+=" "+e.trim(),this.form_canvas_obj.attr("class",t)}}this.form_render(),this.timer_duration=new Date-this.timer_start,$.WS_Form.debug_rendered&&this.debug_info("debug_info_duration",this.timer_duration+"ms")},$.WS_Form.prototype.get_framework=function(){var e=this.is_admin?"ws-form":$.WS_Form.settings_plugin.framework;return $.WS_Form.frameworks.types[e]},$.WS_Form.prototype.get_form_html=function(e){if(void 0===e)return"";if(void 0===e.groups)return"";var t=this.get_framework().form[this.is_admin?"admin":"public"],a=this.esc_html(e.label);if(!this.is_admin&&"on"==this.get_object_meta_value(e,"label_render","on"))var r=this.is_admin?"":this.get_object_meta_value(this.form,"label_mask_form",""),i=""!=r?r:void 0!==t.mask_label?t.mask_label:"",s={label:a},_=this.mask_parse(i,s);else _="";var o=this.get_tabs_html(e);o+=this.get_groups_html(e.groups);i=t.mask_single,s={form:o,id:this.form_id_prefix+"tabs",label:_};return this.comment_html("Form: "+a)+this.mask_parse(i,s)+this.comment_html("Form: "+a,!0)},$.WS_Form.prototype.get_tabs_html=function(e){if(void 0===e.groups)return"";var t=e.groups,a=Object.keys(t).length;if(1==a&&!this.is_admin)return"";var r="",i=this.get_framework().tabs[this.is_admin?"admin":"public"],s=this.get_object_meta_value(this.form,"cookie_tab_index")?this.cookie_get("tab_index",0):0;if(a>1||this.is_admin){for(var _ in t)if(t.hasOwnProperty(_)){var o=t[_];r+=this.get_tab_html(o,_,s==_)}var l="";if(!this.is_admin)this.get_object_meta_value(e,"tabs_hide",!1)&&(l+=' style="display:none"');var n=["wsf-group-tabs"];if(!this.is_admin){var c=this.get_object_meta_value(e,"class_tabs_wrapper",!1);""!=c&&n.push(c.trim())}var d=i.mask_wrapper,p={attributes:l,class:n.join(" "),tabs:r,id:this.form_id_prefix+"tabs"};return this.comment_html(this.language("comment_group_tabs"))+this.mask_parse(d,p)+this.comment_html(this.language("comment_group_tabs"),!0)}return""},$.WS_Form.prototype.get_tab_html=function(e,t,a){void 0===t&&(t=0),void 0===a&&(a=!1);var r=this.get_framework().tabs[this.is_admin?"admin":"public"],i=this.esc_html(e.label),s="";!this.is_admin&&"on"==this.get_object_meta_value(e,"hidden","")&&(s=' style="display:none" data-wsf-group-hidden');var _=r.mask_single,o={attributes:s,data_id:e.id,href:"#"+this.form_id_prefix+"group-"+e.id,label:i};return a&&void 0!==r.active?o.active=r.active:o.active="",this.mask_parse(_,o)},$.WS_Form.prototype.get_groups_html=function(e){if(void 0===e)return"";var t=Object.keys(e).length,a=this.get_framework().groups[this.is_admin?"admin":"public"],r=this.get_object_meta_value(this.form,"cookie_tab_index")?this.cookie_get("tab_index",0):0,i="",s=this.is_admin||t>1,_=0;for(var o in e)if(e.hasOwnProperty(o)){var l=e[o];i+=this.get_group_html(l,o==r,s,_++)}var n=s?a.mask_wrapper:"#groups",c={class:["wsf-groups"].join(" "),column_count:$.WS_Form.settings_plugin.framework_column_count,groups:i,id:this.form_id_prefix+"tabs"};return(s?this.comment_html(this.language("comment_groups")):"")+this.mask_parse(n,c)+(s?this.comment_html(this.language("comment_groups"),!0):"")},$.WS_Form.prototype.get_group_html=function(e,t,a,r){void 0===t&&(t=!1),void 0===a&&(a=!0);var i=this.get_framework().groups[this.is_admin?"admin":"public"],s=this.esc_html(e.id),_=this.esc_html(e.label);if(!this.is_admin&&"on"==this.get_object_meta_value(e,"label_render","on"))var o=this.is_admin?"":this.get_object_meta_value(this.form,"label_mask_group",""),l=""!=o?o:void 0!==i.mask_label?i.mask_label:"",n={label:_},c=this.mask_parse(l,n);else c="";var d,p=this.get_sections_html(e),h=[];(void 0!==i.class&&h.push(i.class),this.is_admin)||(""!=(d=this.get_object_meta_value(this.form,"class_group_wrapper",""))&&h.push(d.trim()),""!=(d=this.get_object_meta_value(e,"class_group_wrapper",""))&&h.push(d.trim()));t&&void 0!==i.class_active&&h.push(i.class_active);var u=[];this.is_admin||!this.is_admin&&"on"==this.get_object_meta_value(e,"hidden","")&&u.push("data-wsf-group-hidden");l=a?i.mask_single:"#group",n={attributes:(u.length>0?" ":"")+u.join(" "),class:h.join(" "),column_count:$.WS_Form.settings_plugin.framework_column_count,data_id:e.id,data_group_index:r,group:p,id:this.form_id_prefix+"group-"+s,label:c};return(a?this.comment_html(this.language("comment_group")+": "+_):"")+this.mask_parse(l,n)+(a?this.comment_html(this.language("comment_group")+": "+_,!0):"")},$.WS_Form.prototype.get_sections_html=function(e){var t="",a=this.get_framework().sections[this.is_admin?"admin":"public"],r=(e.id,e.sections),i={};if("object"==typeof this.submit?void 0!==this.submit.section_repeatable&&(i=this.submit.section_repeatable):!1!==this.submit_auto_populate&&void 0!==this.submit_auto_populate.section_repeatable&&(i=this.submit_auto_populate.section_repeatable),void 0===r)return"";for(var s in r)if(r.hasOwnProperty(s)){var _=r[s],o="section_"+_.id,l=!1!==i&&void 0!==i[o]&&void 0!==i[o].index?i[o].index:[!1];for(var n in l)if(l.hasOwnProperty(n)){var c=l[n];t+=this.get_section_html(_,c)}}var d=a.mask_wrapper,p={class:"wsf-sections",column_count:$.WS_Form.settings_plugin.framework_column_count,data_id:e.id,sections:t,id:this.form_id_prefix+"sections-"+e.id};return this.comment_html(this.language("comment_sections"))+this.mask_parse(d,p)+this.comment_html(this.language("comment_sections"),!0)},$.WS_Form.prototype.get_section_html=function(e,t){void 0===t&&(t=!1);var a=!1;if(!this.is_admin&&((a="on"==this.get_object_meta_value(e,"section_repeatable",""))&&!1===t)){t=0;do{t++}while($("#"+this.form_id_prefix+"section-"+e.id+"-repeat-"+t).length)}var r=[],i=this.get_framework().sections[this.is_admin?"admin":"public"],s=this.column_class_array(e);if(a&&!this.is_admin&&(r.push("data-repeatable"),r.push('data-repeatable-index="'+this.esc_attr(t)+'"')),void 0!==i.class_single&&(s=s.concat(i.class_single)),!this.is_admin){var _;""!=(_=this.get_object_meta_value(this.form,"class_section_wrapper",""))&&s.push(_.trim()),""!=(_=this.get_object_meta_value(e,"class_section_wrapper",""))&&s.push(_.trim());var o=this.get_object_meta_value(e,"class_single_vertical_align","");if(o){var l=this.get_field_value_fallback(!1,!1,"class_single_vertical_align");void 0!==l[o]&&s.push(l[o])}if(""!=this.get_object_meta_value(e,"validate_inline","")){var n=void 0!==this.framework.fields.public.class_form_validated?this.framework.fields.public.class_form_validated:[];this.is_iterable(n)?s.push(...n):s.push(n)}var c=this.get_object_meta_value(this.form,"conversational",!1),d=this.get_object_meta_value(e,"conversational_full_height_section",!1);c&&d&&s.push("wsf-form-conversational-section-full-height")}var p=this.esc_html(e.label);if(this.is_admin||"on"==this.get_object_meta_value(e,"label_render","on"))var h=this.is_admin?"":this.get_object_meta_value(this.form,"label_mask_section",""),u=""!=h?h:void 0!==i.mask_label?i.mask_label:"",f={label:p},m=this.mask_parse(u,f);else m="";this.is_admin||("on"==this.get_object_meta_value(e,"disabled_section","")&&r.push('disabled aria-disabled="true"'),"on"==this.get_object_meta_value(e,"hidden_section","")&&r.push('style="display:none;" aria-live="polite" aria-hidden="true"'));var v=this.get_fields_html(e,t);u=i.mask_single,f={attributes:(r.length>0?" ":"")+r.join(" "),class:s.join(" "),column_count:$.WS_Form.settings_plugin.framework_column_count,data_id:e.id,id:this.form_id_prefix+"section-"+e.id+(t?"-repeat-"+t:""),label:m,section:v,section_id:$.WS_Form.settings_plugin.helper_section_id?''+this.language("id")+": "+e.id+"":""};return this.comment_html(this.language("comment_section")+": "+p)+this.mask_parse(u,f)+this.comment_html(this.language("comment_section")+": "+p,!0)},$.WS_Form.prototype.get_fields_html=function(e,t){var a="on"==this.get_object_meta_value(e,"section_repeatable","");void 0===t&&(t=!!a&&0);var r="",i=this.get_framework().fields[this.is_admin?"admin":"public"],s=(e.id,e.fields),_=this.esc_html(e.label);if(!this.is_admin&&"on"==this.get_object_meta_value(e,"label_render","on"))var o=this.is_admin?"":this.get_object_meta_value(this.form,"label_mask_section",""),l=""!=o?o:void 0!==i.mask_wrapper_label?i.mask_wrapper_label:"",n={label:_},c=this.mask_parse(l,n);else c="";if(void 0===s)return"";for(var d in s)if(s.hasOwnProperty(d)){var p=s[d];r+=this.get_field_html(p,t)}l=i.mask_wrapper,n={column_count:$.WS_Form.settings_plugin.framework_column_count,data_id:e.id,fields:r,id:this.form_id_prefix+"fields-"+e.id,label:c};return this.comment_html(this.language("comment_fields"))+this.mask_parse(l,n)+this.comment_html(this.language("comment_fields"),!0)},$.WS_Form.prototype.value_populate_process=function(e,t){if(null===e)return"";switch(t.type){case"datetime":return"function"==typeof this.get_date_by_type?this.get_date_by_type(e,t):"";case"select":case"checkbox":case"radio":case"price_select":case"price_checkbox":case"price_radio":return"object"==typeof e?e.map(function(e){return e.toString()}):e;case"quantity":var a=$.WS_Form.settings_plugin.price_decimal_separator;return"."!==a&&-1!==e.indexOf(a)&&(e=this.get_number(e)),e;default:return this.esc_html(e)}},$.WS_Form.prototype.get_field_html=function(e,t){void 0===t&&(t=!1);var a=[];!1!==t&&a.push('data-repeatable-index="'+this.esc_attr(t)+'"');var r=this.get_framework().fields[this.is_admin?"admin":"public"];this.is_admin||"on"==this.get_object_meta_value(e,"hidden","")&&a.push('style="display:none;" aria-live="polite" aria-hidden="true"');var i=this.column_class_array(e),s=this.get_object_meta_value(e,"sub_type",!1);""==s&&(s=!1);var _=this.get_field_value_fallback(e.type,!1,"class_single",!1,r,s);if(!1!==_&&(i=i.concat(_)),!this.is_admin){var o;""!=(o=this.get_object_meta_value(this.form,"class_field_wrapper",""))&&i.push(o.trim()),""!=(o=this.get_object_meta_value(e,"class_field_wrapper",""))&&i.push(o.trim());var l=this.get_object_meta_value(e,"class_single_vertical_align","");if(l){var n=this.get_field_value_fallback(e.type,!1,"class_single_vertical_align",!1,r,s);void 0!==n[l]&&i.push(n[l])}if(""!=this.get_object_meta_value(e,"validate_inline","")){var c=void 0!==this.framework.fields.public.class_form_validated?this.framework.fields.public.class_form_validated:[];this.is_iterable(c)?i.push(...c):i.push(c)}}var d=!1!==t?"_"+t:"",p=ws_form_settings.field_prefix+e.id+d;if("object"==typeof this.submit){if(void 0!==this.submit.meta&&void 0!==this.submit.meta[p]&&void 0!==this.submit.meta[p].value&&null!==this.submit.meta[p].value){var h=this.submit.meta[p].value;h=this.value_populate_process(h,e)}}else if(!1!==this.submit_auto_populate&&void 0!==this.submit_auto_populate.data&&void 0!==this.submit_auto_populate.data[p]&&null!==this.submit_auto_populate.data[p]){h=this.submit_auto_populate.data[p];h=this.value_populate_process(h,e)}var u=this.is_admin?"":this.get_field_html_single(e,h,!1,t),f=this.esc_html(e.label);if(void 0===$.WS_Form.field_type_cache[e.type])return"";var m=$.WS_Form.field_type_cache[e.type];if(void 0!==m.pro_required&&m.pro_required)return"";var v=!this.is_admin&&(void 0!==m.mask_wrappers_drop&&m.mask_wrappers_drop);if("recaptcha"!=e.type||this.is_admin||"invisible"!=this.get_object_meta_value(e,"recaptcha_recaptcha_type","default")||(v=!0),"hcaptcha"!=e.type||this.is_admin||"invisible"!=this.get_object_meta_value(e,"hcaptcha_type","default")||(v=!0),v)var b="#field";else b=this.get_field_value_fallback(e.type,!1,"mask_single",!1,r,s);switch(e.type){case"checkbox":case"price_checkbox":var g=this.get_object_meta_value(e,"checkbox_min",!1),y=this.get_object_meta_value(e,"checkbox_max",!1),k=this.get_object_meta_value(e,"select_all",!1);if(!1===g&&!1===y)break;!1!==g&&(g=parseInt(g,10))>0&&a.push('data-checkbox-min="'+this.esc_attr(g)+'"'),!1===y||k||(y=parseInt(y,10))>=0&&a.push('data-checkbox-max="'+this.esc_attr(y)+'"');break;case"select":case"price_select":var w=this.get_object_meta_value(e,"select_min",!1),x=this.get_object_meta_value(e,"select_max",!1);if(!1===w&&!1===x)break;!1!==w&&(w=parseInt(w,10))>0&&a.push('data-select-min="'+this.esc_attr(w)+'"'),!1!==x&&(x=parseInt(x,10))>=0&&a.push('data-select-max="'+this.esc_attr(x)+'"')}var j={attributes:(a.length>0?" ":"")+a.join(" "),class:i.join(" "),data_id:e.id,field:u,id:this.get_part_id(e.id,t,"field-wrapper"),type:e.type};return this.comment_html(this.language("comment_field")+": "+f)+this.mask_parse(b,j)+this.comment_html(this.language("comment_field")+": "+f,!0)},$.WS_Form.prototype.field_type_cache_build=function(){if(this.is_admin||($.WS_Form.field_type_cache=$.WS_Form.field_types),$.WS_Form.field_type_cache.length>0)return!0;for(var e in $.WS_Form.field_types){var t=$.WS_Form.field_types[e].types;for(var a in t)$.WS_Form.field_type_cache[a]=t[a]}},$.WS_Form.prototype.esc_html=function(e,t){if("string"!=typeof e)return e;switch(void 0===t&&(t=!1),typeof e){case"string":e=this.esc_html_do(e,t);break;case"object":for(var a in e)e.hasOwnProperty(a)&&"string"==typeof e[a]&&(e[a]=this.esc_html_do(e[a],t))}return e},$.WS_Form.prototype.esc_html_do=function(e,t){void 0===t&&(t=!1);var a=this.replace_all(e,"&","&");return a=this.replace_all(a,"<","<"),a=this.replace_all(a,">",">"),a=this.replace_all(a,'"',"""),t&&(a=this.replace_all(a,"\n","
")),a},$.WS_Form.prototype.esc_attr=function(e,t){if("string"!=typeof e)return e;void 0===t&&(t=!1);var a=this.replace_all(e,"&","&");return a=this.replace_all(a,"<","<"),a=this.replace_all(a,">",">"),a=this.replace_all(a,"'","'"),a=this.replace_all(a,'"',"""),t&&(a=this.replace_all(a,"\n","
")),a},$.WS_Form.prototype.esc_selector=function(e){if("string"!=typeof e)return e;var t=this.replace_all(e,'"','\\"');return t=this.replace_all(t,"'","\\'"),t=this.replace_all(t,"[","\\["),t=this.replace_all(t,"]","\\]"),t=this.replace_all(t,",","\\,"),t=this.replace_all(t,"=","\\=")},$.WS_Form.prototype.html_strip=function(e){switch(typeof e){case"string":e=this.html_strip_do(e);break;case"object":for(var t in e)e.hasOwnProperty(t)&&"string"==typeof e[t]&&(e[t]=this.html_strip_do(e[t]))}return e},$.WS_Form.prototype.html_strip_do=function(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent},$.WS_Form.prototype.js_string_encode=function(e){return"string"!=typeof e?e:this.replace_all(e,"'","\\'")},$.WS_Form.prototype.loader_on=function(){$("#wsf-loader").addClass("wsf-loader-on")},$.WS_Form.prototype.loader_off=function(){$("#wsf-loader").removeClass("wsf-loader-on")},$.WS_Form.prototype.comment_html=function(e,t){return void 0===t&&(t=!1),$.WS_Form.settings_plugin.comments_html?"\x3c!-- "+(t?"/":"")+e+" --\x3e\n"+(t?"\n":""):""},$.WS_Form.prototype.comment_css=function(e){return $.WS_Form.settings_plugin.comments_css?"\t/* "+e+" */\n":""},$.WS_Form.prototype.get_object_value=function(e,t,a){return void 0===a&&(a=!1),void 0===e?a:void 0===e[t]?a:e[t]},$.WS_Form.prototype.get_field_value_fallback=function(e,t,a,r,i,s){if(void 0===r&&(r=!1),i||(i=this.framework_fields),void 0===s&&(s=!1),!1===s)return this.get_field_value_fallback_process(e,t,a,r,i);if((_=this.get_field_value_fallback_process(e,t,a+"_"+s,r,i))===r)var _=this.get_field_value_fallback_process(e,t,a,r,i);return _},$.WS_Form.prototype.get_field_value_fallback_process=function(e,t,a,r,i){var s=i,_=$.WS_Form.field_type_cache[e];if(!1!==t){if(!(void 0===s||void 0===s[t]||void 0===s[t].field_types||void 0===s[t].field_types[e]||void 0===s[t].field_types[e][a]))return s[t].field_types[e][a];if(!(void 0===s||void 0===s[t]||void 0===s[t][a]))return s[t][a]}return void 0===s||void 0===s.field_types||void 0===s.field_types[e]||void 0===s.field_types[e][a]?void 0===s||void 0===s[a]?void 0===_?r:void 0===_[a]?r:_[a]:s[a]:s.field_types[e][a]},$.WS_Form.prototype.get_object_data=function(e,t,a){switch(void 0===a&&(a=!1),e){case"form":return a?this.object_data_scratch:this.form;case"group":return a?this.object_data_scratch:this.group_data_cache[t];case"section":return a?this.object_data_scratch:this.section_data_cache[t];case"field":return a?this.object_data_scratch:this.field_data_cache[t];case"conditional":return this.conditional;case"action":return this.action}return!1},$.WS_Form.prototype.get_object_meta=function(e,t){switch(e){case"form":var a=$.WS_Form.settings_form.sidebars.form.meta;break;case"group":a=$.WS_Form.settings_form.sidebars.group.meta;break;case"section":a=$.WS_Form.settings_form.sidebars.section.meta;break;case"field":var r=this.field_data_cache[t];a=$.WS_Form.field_type_cache[r.type]}return a},$.WS_Form.prototype.get_object_meta_value=function(e,t,a,r,i){if(void 0===a&&(a=!1),void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===e)return a;if(void 0===e.meta)return a;if(void 0===e.meta[t]){if(!r)return a;this.set_object_meta_value(e,t,a)}return i&&"string"==typeof e.meta[t]?this.parse_variables_process(e.meta[t]).output:e.meta[t]},$.WS_Form.prototype.has_object_meta_key=function(e,t){return void 0!==e&&void 0!==e.meta&&void 0!==e.meta[t]&&""!=e.meta[t]},$.WS_Form.prototype.parse_variables_process=function(e,t,a,r,i,s,_,o,l,n){var c=this;if("string"!=typeof e)return this.parse_variables_process_error(e);if(-1==e.indexOf("#"))return this.parse_variables_process_error(e);void 0===t&&(t=!1),void 0===a&&(a=!1);var d="calc"===a;void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===s&&(s=!0),void 0===_&&(_=!1),void 0===o&&(o=1),void 0===l&&(l=e),void 0===n&&(n=r);var p={},h={},u=[];if(o>100)return this.error("error_parse_variable_syntax_error_depth","","error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_depth"));for(var f in $.WS_Form.parse_variables)if($.WS_Form.parse_variables.hasOwnProperty(f)){var m=$.WS_Form.parse_variables[f];if((m.ignore_prefix,m.ignore_prefix)||-1!==e.indexOf("#"+f))for(var v in m.variables)if(m.variables.hasOwnProperty(v)&&-1!==e.indexOf("#"+v)){var b=m.variables[v],g=void 0!==b.value&&b.value,y="object"==typeof b.attributes&&b.attributes,k=void 0!==b.single_parse&&b.single_parse;if(!1!==y||!1===g){if(("object"==typeof b.attributes?b.attributes.length:0)>0){var w=0;do{var x=e.indexOf("#"+v,w);if(-1!==x){var j=-1,S=-1,F=e.substring(x+v.length+1);if("("===F.substring(0,1)&&(j=x+v.length+1,-1!==(S=this.get_bracket_finish_index(F))&&(S+=j)),-1===j||-1===S){w+=v.length+1,M="#"+v;var W=[]}else{w=S;var O=e.substr(j+1,S-1-j),M=e.substr(x,S+1-x),P=void 0!==b.attribute_separator?b.attribute_separator:",";W=this.string_to_attributes(O,P)}for(var I in y)if(y.hasOwnProperty(I)){var N=y[I],z=N.id,D=void 0!==W[I];if((void 0===N.required||N.required)&&!D)return this.error("error_parse_variable_syntax_error_attribute","#"+v+" (Expected "+z+")","error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_attribute","#"+v+" (Expected "+z+")"));var q=void 0!==N.default&&N.default;if(!1===q||D||(W[I]=q),void 0===N.trim||N.trim){var T=W[I];"string"==typeof T&&(W[I]=T.trim())}var C=void 0!==N.valid&&N.valid;if(!1!==C&&!C.includes(W[I]))return this.error("error_parse_variable_syntax_error_attribute_invalid","#"+v+" (Expected "+C.join(", ")+")","error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_attribute_invalid","#"+v+" (Expected "+C.join(", ")+")"))}var E="",A=!0;switch(v){case"calc":case"text":switch(A=!1,a=v){case"calc":var Y=(ct=this.parse_variables_process(W[0],t,"calc",r,i,s,_,o+1,l,n)).output;"object"==typeof ct.fields&&(u=u.concat(ct.fields)),E=this.eval_process(Y,l,!1,n,i);break;case"text":Y=(ct=this.parse_variables_process(W[0],t,"text",r,i,s,_,o+1,l,n)).output;"object"==typeof ct.fields&&(u=u.concat(ct.fields)),E=Y}if(void 0===$.WS_Form.field_type_cache[r.type])break;var U=$.WS_Form.field_type_cache[r.type],J=void 0!==U[a+"_in"]&&U[a+"_in"];if(!1!==r&&void 0!==r&&!d&&s&&("field_label"==i||"field_help"==i||J)){var R=ct.fields,L=[],H=[];for(var B in R)if(R.hasOwnProperty(B)){var G=R[B];-1===H.indexOf(G)&&(H.push(G),L.push(G))}var Z={field:n,field_part:i,type:a,value:l,field_ids_touched:L,section_repeatable_index:t},Q=!1;for(var K in this.calc)if(this.calc.hasOwnProperty(K)){var V=this.calc[K];V.field===r&&V.field_part===i&&V.value===l&&V.section_repeatable_index===t&&(this.calc[K].field_ids_touched=this.calc[K].field_ids_touched.concat(L),this.calc[K].field_ids_touched=this.calc[K].field_ids_touched.filter(function(e,t,a){return a.indexOf(e)===t}),1===o&&(this.calc[K].type=a),Q=!0)}Q||(this.calc.push(Z),this.calc.sort(function(e,t){var a=["field_placeholder","field_min","field_max","field_ecommerce_price_min","field_ecommerce_price_max"],r=a.indexOf(e.field_part),i=a.indexOf(t.field_part);return r===i?0:r",">=","<=","<","^=","$=","!^=","!$=","*=","!*="],le=["&&","||"],ne=[],ce=0,de=0;for(var pe in W)if(W.hasOwnProperty(pe)){var he=W[pe];if(0===de&&(ne[ce]={value_a:"",operator:"!=",value_b:""}),1!=de&&3!=de||(he=this.replace_all(he,"&","&"),he=this.replace_all(he,"<","<"),he=this.replace_all(he,">",">")),0==de||2==de)"string"!=typeof(he=O=(ct=this.parse_variables_process(he,t,!1,r,i,s,_,o+1,l,n)).output)||""===he||isNaN(he)||(he=parseFloat(he));1==de&&-1!==le.indexOf(he)&&(de=3);var ue=!1;switch(de){case 0:case 2:ue=0==de?"value_a":"value_b",ne[ce][ue]=he,ne[ce][ue+"_string"]=O;break;case 1:if(-1===oe.indexOf(he))return this.error("error_parse_variable_syntax_error_operator",O,"parse_variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_operator",O));ne[ce].operator=he;break;case 3:if(-1===le.indexOf(he))return this.error("error_parse_variable_syntax_error_logic",O,"parse_variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_logic",O));ne[ce].logic_next=he}++de>3&&(de=0,ce++)}var fe=!1,me="&&";for(var ce in ne)if(ne.hasOwnProperty(ce)){var ve=ne[ce],be=!1;switch(ve.operator){case"==":be=ve.value_a==ve.value_b;break;case"!=":be=ve.value_a!=ve.value_b;break;case"<":be=ve.value_a":be=ve.value_a>ve.value_b;break;case"<=":be=ve.value_a<=ve.value_b;break;case">=":be=ve.value_a>=ve.value_b;break;case"*=":be=""!==ve.value_b_string&&-1!==ve.value_a_string.indexOf(ve.value_b_string);break;case"!*=":be=""!==ve.value_b_string&&-1===ve.value_a_string.indexOf(ve.value_b_string);break;case"^=":be=""!==ve.value_b_string&&0===ve.value_a_string.indexOf(ve.value_b_string);break;case"!^=":be=""!==ve.value_b_string&&ve.value_a_string.indexOf(ve.value_b_string)>0;break;case"$=":be=""!==ve.value_b_string&&ve.value_a_string.indexOf(ve.value_b_string)===ve.value_a_string.length-ve.value_b_string.length;break;case"!$=":be=""!==ve.value_b_string&&ve.value_a_string.indexOf(ve.value_b_string)!==ve.value_a_string.length-ve.value_b_string.length}fe=0==ce?be:"&&"==me?fe&&be:fe||be,me=void 0!==ve.logic_next?ve.logic_next:"&&"}E=!1,e=fe?(e=e.substring(0,_e)+e.substring(_e+6)).substring(0,x)+e.substring(S+1):e.substring(0,x)+e.substring(_e+6),w=0;break;case"tab_label":if(isNaN(W[0]))return this.error("error_parse_variable_syntax_error_group_id",W[0],"error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_group_id",W[0]));var ge=parseInt(W[0],10);if(void 0===this.group_data_cache[ge]||void 0===this.group_data_cache[ge].label)return this.error("error_parse_variable_syntax_error_group_id",ge,"error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_group_id",ge));E=this.group_data_cache[ge].label;break;case"section_label":if(isNaN(W[0]))return this.error("error_parse_variable_syntax_error_section_id",W[0],"error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_section_id",W[0]));var ye=parseInt(W[0],10);if(void 0===this.section_data_cache[ye]||void 0===this.section_data_cache[ye].label)return this.error("error_parse_variable_syntax_error_section_id",ye,"error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_section_id",ye));E=this.section_data_cache[ye].label;break;case"cookie_get":E=this.cookie_get_raw(W[0]);break;case"session_storage_get":E=this.session_storage_get_raw(W[0]);break;case"local_storage_get":E=this.local_storage_get_raw(W[0]);break;case"field_label":if(isNaN(W[0]))return this.error("error_parse_variable_syntax_error_field_id",W[0],"error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_field_id",W[0]));var ke=parseInt(W[0],10);if(void 0===this.field_data_cache[ke]||void 0===this.field_data_cache[ke].label)return this.error("error_parse_variable_syntax_error_field_id",ke,"error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_field_id",ke));E=this.field_data_cache[ke].label;break;case"field":case"field_float":case"field_date_format":case"field_date_offset":case"field_count_word":case"field_count_char":case"ecommerce_field_price":if(isNaN(W[0]))return this.error("error_parse_variable_syntax_error_field_id",W[0],"error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_field_id",W[0]));ke=parseInt(W[0],10);if(("field_value"===i||!1===i)&&ke===parseInt(n.id,10))return this.error("error_parse_variable_syntax_error_self_ref",M,"error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_self_ref",M));if(void 0===this.field_data_cache[ke])return this.error("error_parse_variable_syntax_error_field_id",ke,"error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_field_id",ke));r.id===n.id&&u.push(ke);var we=this.field_data_cache[ke];if(void 0===$.WS_Form.field_type_cache[we.type])break;var xe=$.WS_Form.field_type_cache[we.type];if(!1!==a)if(!(xe[a+"_out"],xe[a+"_out"]))return this.error("error_parse_variable_syntax_error_"+a+"_out",we.label+" (ID: "+we.id+")","error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_"+a+"_out",we.label+" (ID: "+we.id+")"));var $e=(xe.static,xe.static);if($e){if(!0===$e)var je=void 0!==xe.mask_field_static?xe.mask_field_static:"";else{je=this.get_object_meta_value(we,$e,"");this.wpautop_parse_variable(we,xe)&&(je=this.wpautop(je),A=!1)}"object"==typeof(ct=this.parse_variables_process(je,t,a,we,i,s,_,o+1,l,n)).fields&&(u=u.concat(ct.fields)),E=[ct.output];break}var Se=void 0!==xe.submit_array&&xe.submit_array,Fe=void 0!==we.section_repeatable_section_id&&parseInt(we.section_repeatable_section_id,10),We=void 0!==r.section_repeatable_section_id&&parseInt(r.section_repeatable_section_id,10),Oe=t,Me=(E=!1,void 0!==W[1]?W[1]:","),Pe=void 0!==W[2]&&W[2];if(!1!==Oe&&Fe===_||!1!==Fe&&!1!==We)E=this.get_field_value(we,Oe,Se,Pe);if(!1===E&&!1!==Fe&&!1===We)E=this.get_field_value(we,!0,Se,Pe);if(!1===E&&!1===Fe)E=this.get_field_value(we,!1,Se,Pe);if(!1===E)switch(we.type){case"price_select":case"price_checkbox":case"price_radio":case"select":case"checkbox":case"radio":var Ie=this.get_data_source(we);E=!1!==Ie.default_value?Ie.default_value:[];break;default:var Ne=this.get_object_meta_value(we,"default_value","");"object"==typeof(ct=this.parse_variables_process(Ne,t,a,we,i,s,_,o+1,l,n)).fields&&(u=u.concat(ct.fields)),E=[ct.output]}switch(v){case"field":!1!==Pe&&(E=this.get_data_grid_column(E,we,Pe));break;case"field_count_char":case"field_count_word":var ze="object"==typeof E?E.join(Me):"";if(void 0!==W[1]){var De=/\/(.*)\/(.*)/.exec(W[1]);ze=ze.replace(new RegExp(De[1],De[2]),"")}E=["field_count_char"==v?ze.length:this.get_word_count(ze)]}if(d)if(E.length)switch(we.type){case"price_select":case"price_checkbox":case"price_radio":case"price":case"price_subtotal":case"cart_price":case"cart_total":var qe=0;for(var Te in E)E.hasOwnProperty(Te)&&(qe+=this.get_number(E[Te],0,!0));var Ce=parseInt($.WS_Form.settings_plugin.price_decimals,10);E=this.get_number(qe,0,!1,Ce);break;case"datetime":if(""===E[0]){E="";break}var Ee=this.get_object_meta_value(we,"input_type_datetime","date");(Ue=this.get_object_meta_value(we,"format_date",ws_form_settings.date_format))||(Ue=ws_form_settings.date_format);var Ae=this.get_date(E[0],Ee,Ue);E=this.get_number(Ae.getTime())/1e3;break;default:qe=0;for(var Te in E)E.hasOwnProperty(Te)&&(qe+=c.get_number(E[Te],0,!1));E=qe}else E=0;else E=(E=$.map(E,function(e){return c.esc_html(e)})).join(Me),A=!1;switch(v){case"ecommerce_field_price":E=this.get_price(this.get_number(E));break;case"field_date_format":if("datetime"!==we.type)return this.error("error_parse_variable_syntax_error_field_date_offset",ke,"error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_field_date_offset",ke));var Ye=this.parse_variables_process(E,t,a,we,i,s,_,o).output;if((Je=this.get_object_meta_value(we,"format_date",ws_form_settings.date_format))||(Je=ws_form_settings.date_format),this.is_integer(Ye))et=new Date(1e3*parseInt(Ye,10));else{Ee=this.get_object_meta_value(we,"input_type_datetime","date");et=this.get_date(Ye,Ee,Je)}if(!1!==et&&!isNaN(et.getTime())){if(void 0!==W[1]&&""!=W[1])var Ue=W[1];else Ue=Je;Ue||(Ue=ws_form_settings.date_format),E="function"==typeof this.date_format?this.date_format(et,Ue):""}break;case"field_date_offset":if("datetime"!==we.type)return this.error("error_parse_variable_syntax_error_field_date_offset",ke,"error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_field_date_offset",ke));var Je;Ye=this.parse_variables_process(E,t,a,we,i,s,_,o).output;if((Je=this.get_object_meta_value(we,"format_date",ws_form_settings.date_format))||(Je=ws_form_settings.date_format),this.is_integer(Ye))et=new Date(1e3*parseInt(Ye,10));else{Ee=this.get_object_meta_value(we,"input_type_datetime","date");et=this.get_date(Ye,Ee,Je)}if(!1!==et&&!isNaN(et.getTime())){if((tt=parseInt(this.parse_variables_process(W[1],t,a,r,i,s,_,o).output,10))&&et.setSeconds(et.getSeconds()+tt),void 0!==W[2]&&""!=W[2])Ue=W[2];else Ue=Je;Ue||(Ue=ws_form_settings.date_format),E="function"==typeof this.date_format?this.date_format(et,Ue):""}break;case"field_float":E=this.get_number(E)}"field"===v&&this.wpautop_parse_variable(we,xe)&&(E=this.wpautop(E),A=!1);break;case"ecommerce_price":"object"==typeof(ct=this.parse_variables_process(W[0],t,a,r,i,s,_,o)).fields&&(u=u.concat(ct.fields));var Re=this.eval_process(ct.output,l,!1,n,i);E=this.get_price(Re);break;case"number_format":"object"==typeof(ct=this.parse_variables_process(W[0],t,a,r,i,s,_,o)).fields&&(u=u.concat(ct.fields));var Le=this.eval_process(ct.output,l,!1,n,i),He=W[1],Be=W[2],Ge=W[3];E=this.number_format(Le,He,Be,Ge);break;case"select_option_text":if(isNaN(W[0]))return this.error("error_parse_variable_syntax_error_field_id",W[0],"error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_field_id",W[0]));ke=parseInt(W[0],10);void 0===(Me=W[1])&&(Me=", "),r.id===n.id&&u.push(ke);var Ze=ws_form_settings.field_prefix+ke.toString()+(t?"["+t+"]":"");if((Xe=$('[name="'+this.esc_selector(Ze)+'[]"] option:selected',this.form_canvas_obj)).length)E=$.map(Xe,function(e,t){return $(e).text()}).join(Me);break;case"query_var":E=this.get_query_var(W[0]);break;case"section_row_count":if(isNaN(W[0]))return this.error("error_parse_variable_syntax_error_section_id",W[0],"error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_section_id",W[0]));var Qe=W[0];if(void 0===this.section_data_cache[Qe])return this.error("error_parse_variable_syntax_error_section_id",Qe,"error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_section_id",Qe));var Ke=$('[data-repeatable][data-id="'+this.esc_selector(Qe)+'"]',this.form_canvas_obj);if(0===(E=Ke.length?Ke.length:0)&&"function"==typeof this.get_section_repeat_default){var Ve=this.section_data_cache[Qe];E=this.get_section_repeat_default(Ve)}break;case"checkbox_label":case"radio_label":if(isNaN(W[0]))return this.error("error_parse_variable_syntax_error_field_id",W[0],"error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_field_id",W[0]));ke=parseInt(W[0],10);void 0===(Me=W[1])&&(Me=", "),r.id===n.id&&u.push(ke);Ze=ws_form_settings.field_prefix+ke.toString()+(t?"["+t+"]":"");if((Xe=$('[name="'+this.esc_selector(Ze)+'[]"]:checked',this.form_canvas_obj)).length)E=$.map(Xe,function(e,t){return $('label[for="'+$(e).attr("id")+'"]').text()}).join(Me);break;case"checkbox_count":case"select_count":if(isNaN(W[0]))return this.error("error_parse_variable_syntax_error_field_id",W[0],"error-parse-variables"),this.parse_variables_process_error(this.language("error_parse_variable_syntax_error_field_id",W[0]));ke=parseInt(W[0],10);r.id===n.id&&u.push(ke);Ze=ws_form_settings.field_prefix+ke.toString()+(t?"["+t+"]":"");switch(v){case"checkbox_count":var Xe=$('[name="'+this.esc_selector(Ze)+'[]"]:checked',this.form_canvas_obj);break;case"select_count":Xe=$('select[name="'+this.esc_selector(Ze)+'[]"] :selected',this.form_canvas_obj)}E=Xe?Xe.length:0;break;case"post_date_custom":case"server_date_custom":case"blog_date_custom":var et=this.get_new_date(g);if(void 0!==W[1])(tt=parseInt(this.parse_variables_process(W[1],t,a,r,i,s,_,o).output,10))&&et.setSeconds(et.getSeconds()+tt);E="function"==typeof this.date_format?this.date_format(et,W[0]):"";break;case"client_date_custom":var tt;et=new Date;if(void 0!==W[1])(tt=parseInt(this.parse_variables_process(W[1],t,a,r,i,s,_,o).output,10))&&et.setSeconds(et.getSeconds()+tt);E="function"==typeof this.date_format?this.date_format(et,W[0]):"";break;case"random_number":var at=parseInt(this.get_number(W[0]),10),rt=parseInt(this.get_number(W[1]),10);E=Math.floor(Math.random()*(rt-at+1))+at;break;case"random_string":var it=parseInt(this.get_number(W[0]),10),st=W[1],_t=st.length;E="";for(var ot=0;ot0?"min"==v?Math.min(...dt):Math.max(...dt):0;break;case"avg":qe=0;if(1===W.length)"object"==typeof(ct=this.parse_variables_process(W[0],t,a,r,i,s,_,o)).fields&&(u=u.concat(ct.fields)),W=this.string_to_attributes(ct.output);for(var pt in W){if(W.hasOwnProperty(pt))"object"==typeof(ct=this.parse_variables_process(W[pt],t,a,r,i,s,_,o)).fields&&(u=u.concat(ct.fields)),qe+=Re=this.eval_process(ct.output,l,!1,n,i)}E=qe/W.length}!1!==E&&(A&&(E=this.esc_html(E)),k?h[M.substring(1)]=E:p[M.substring(1)]=E)}}while(-1!==x);e=this.mask_parse(e,p)}}else p[v]=g}}if(-1!=e.indexOf("form")&&(p.form_id=this.form_id,p.form_instance_id=this.form_instance_id,p.form_obj_id=this.form_obj_id,p.form_label=this.form.label,p.form_checksum=this.form.published_checksum,p.form_framework=this.framework.name),-1!=e.indexOf("section")){p.section_row_index=t;var ht=1;!1===_&&!1!==r&&void 0!==r.section_id&&parseInt(r.section_id,10)>0&&(_=parseInt(r.section_id,10)),"object"==typeof this.section_repeatable_indexes["section_"+_]&&(ht=this.section_repeatable_indexes["section_"+_].indexOf(t.toString())+1)<=0&&(ht=1),p.section_row_number=ht}if(-1!=e.indexOf("submit")&&(p.submit_hash=this.hash),-1!=e.indexOf("client")){var ut=new Date;p.client_time="function"==typeof this.date_format?this.date_format(ut,ws_form_settings.time_format):"",p.client_date="function"==typeof this.date_format?this.date_format(ut,ws_form_settings.date_format):""}-1!=e.indexOf("seconds_epoch_midnight")&&((ft=new Date).setHours(0,0,0,0),p.seconds_epoch_midnight=Math.round(ft.getTime()/1e3));if(-1!=e.indexOf("seconds_epoch")){var ft=new Date;p.seconds_epoch=Math.round(ft.getTime()/1e3)}var mt=this.get_currency();if(-1!=e.indexOf("ecommerce"))for(var vt in void 0===this.ecommerce_cart_price_type.total&&(this.ecommerce_cart_price_type.total={float:0,string:this.get_price(0,mt,!1),currency:this.get_price(0,mt)}),p.ecommerce_cart_total_float=this.ecommerce_cart_price_type.total.float,p.ecommerce_cart_total_currency=this.ecommerce_cart_price_type.total.currency,p.ecommerce_cart_total=this.ecommerce_cart_price_type.total.string,$.WS_Form.ecommerce.cart_price_types)$.WS_Form.ecommerce.cart_price_types.hasOwnProperty(vt)&&(void 0===this.ecommerce_cart_price_type[vt]&&(this.ecommerce_cart_price_type[vt]={float:0,string:this.get_price(0,mt,!1),currency:this.get_price(0,mt)}),p["ecommerce_cart_"+vt+"_float"]=this.ecommerce_cart_price_type[vt].float,p["ecommerce_cart_"+vt+"_currency"]=this.ecommerce_cart_price_type[vt].currency,p["ecommerce_cart_"+vt]=this.ecommerce_cart_price_type[vt].string);var bt=e;(e=this.mask_parse(e,p),(e=this.mask_parse(e,h,!0))!==bt&&-1!==e.indexOf("#"))&&(e=(ct=this.parse_variables_process(e,t,a,r,i,s,_,o+1,l,n)).output,"object"==typeof ct.fields&&(u=u.concat(ct.fields)));return{output:e,fields:u}},$.WS_Form.prototype.get_data_grid_column=function(e,t,a){if(0===e.length)return e;var r=[];switch(i=t.type){case"select":case"checkbox":case"radio":break;case"price_select":var i="select_price";break;case"price_checkbox":i="checkbox_price";break;case"price_radio":i="radio_price";break;default:return e}var s="data_grid_"+i,_=this.get_object_meta_value(t,i+"_field_value","0"),o=this.get_object_meta_value(t,i+"_field_label","0"),l=this.get_object_meta_value(t,i+"_field_price","0"),n=this.get_object_meta_value(t,i+"_field_parse_variable","0"),c=this.get_object_meta_value(t,i+"_field_wc","0"),d=this.get_object_meta_value(t,s,!1);if(!1===d)return e;if("object"!=typeof d.columns||"object"!=typeof d.groups)return e;var p=0,h=0,u=0,f=0,m=0,v=d.columns,b=parseInt(a,10);for(var g in v)if(v.hasOwnProperty(g)){var y=v[g];void 0!==y.id&&void 0!==y.label&&(y.id==_&&(p=g),y.id==o&&(h=g),y.id==l&&(u=g),y.id==n&&(f=g),y.id==c&&(m=g),y.label===a&&(b=g))}var k=d.groups;for(var w in k)if(k.hasOwnProperty(w)){var x=k[w];if(void 0!==x.rows){var j=x.rows;for(var S in j)if(j.hasOwnProperty(S)){var F=j[S];if(null!==F&&"object"==typeof F.data){var W=F.data,O=$.extend(!0,[],W);if(void 0!==O[p]&&void 0!==O[b]){var M={data_grid_row_price:"",data_grid_row_price_currency:"",data_grid_row_woocommerce_cart:"",data_grid_row_value:O[p],data_grid_row_action_variable:"",data_grid_row_label:""};for(var P in!1!==h&&void 0!==O[h]&&(M.data_grid_row_label=O[h]),!1!==u&&void 0!==O[u]&&(M.data_grid_row_price_currency=this.get_price(O[u]),M.data_grid_row_price=this.get_number(O[u])),!1!==f&&void 0!==O[f]&&(M.data_grid_row_action_variable=O[f]),!1!==m&&void 0!==O[m]&&(M.data_grid_row_woocommerce_cart=O[m]),O)O.hasOwnProperty(P)&&("number"==typeof O[P]&&(O[P]=O[P].toString()),O[P]=this.mask_parse(O[P],M));for(var I in e){if(e.hasOwnProperty(I))if(e[I]===O[p].toString()){if(void 0===F.data[b])continue;r.push(F.data[b])}}}}}}}return r},$.WS_Form.prototype.wpautop_parse_variable=function(e,t){if("on"==this.get_object_meta_value(e,"wpautop_do_not_process",""))return!1;var a=void 0!==t.wpautop_parse_variable&&t.wpautop_parse_variable;if("object"==typeof a){var r=!1;for(var i in a)if(a.hasOwnProperty(i)){var s=a[i];this.get_object_meta_value(e,s.meta_key,"")===s.meta_value&&(r=!0)}a=r}return a},$.WS_Form.prototype.wpautop=function(e,t){void 0===t&&(t=!0);var a=new Map;if(""===e.trim())return"";if((e+="\n").indexOf("-1){var r=e.split("
"),i=r.pop();e="",r.forEach(function(t,r){var i=t.indexOf("";a[s]=t.substr(i)+"",e+=t.substr(0,i)+s}else e+=t}),e+=i}var s="(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)";(e=(e=(e=(e=e.replace(/
\s*
/,"\n\n")).replace(new RegExp("(<"+s+"[^>]*>)","gmi"),"\n$1")).replace(new RegExp("("+s+">)","gmi"),"$1\n\n")).replace(/\r\n|\r/,"\n")).indexOf("")),e.indexOf("")>-1&&(e=(e=(e=e.replace(/(")).replace(/\s*(<\/?(?:param|embed)[^>]*>)\s*/gim,"$1")),(e.indexOf("-1||e.indexOf("
"),Object.keys(a).length&&(e=e.replace(new RegExp(Object.keys(a).join("|"),"gi"),function(e){return a[e]})),e},$.WS_Form.prototype.eval_process=function(eval_input,parse_string_original,decimals,field,field_part){try{var eval_output=eval(eval_input);return eval_output===1/0&&(eval_output=0),this.get_number(eval_output,0,!1,decimals)}catch(e){return"object"==typeof field&&void 0!==field.id&&void 0!==field.label&&this.error("error_parse_variable_syntax_error_eval",field.id+" | "+this.esc_html(field.label)+(field_part?" | "+this.esc_html(field_part):"")+" | "+e.message+": "+this.esc_html(parse_string_original)),0}},$.WS_Form.prototype.closing_string_index=function(e,t,a,r){for(var i=1;i>0;){var s=e.indexOf(a,r),_=e.indexOf(t,r);if(-1!==s&&-1!==_&&s<_)r=s+a.length,i++;else{if(!(-1!==_&&i>1)){if(-1!==_&&1===i)break;break}r=_+t.length,i--}}return _},$.WS_Form.prototype.string_to_attributes=function(e,t){if("string"!=typeof e||""==e)return[];"string"!=typeof t&&(t=",");var a=1,r=0,i=!1,s="",_=[];e.replace("“",'"'),e.replace("”",'"');for(var o=e.length;r0||a0&&c!=_){var d={id:n.id,size_word:void 0===this.number_to_word[c]?c:this.number_to_word[c],size:c};if(void 0!==n.column_class)var p=n.column_class;else p=i;var h=this.mask_parse(p,d);a.push(h),_=c}var u=this.get_object_meta_value(e,t+"_offset_"+l,""),f=!1;if(""!==u&&u!=o){d={id:n.id,offset_word:void 0===this.number_to_word[u]?u:this.number_to_word[u],offset:u};if(void 0!==n.offset_class)var m=n.offset_class;else m=s;h=this.mask_parse(m,d);a.push(h),o=u,f=!0}f&&a.push("wsf-has-offset")}return a},$.WS_Form.prototype.column_classes_render=function(e,t,a){e.closest(".wsf-sections").css("min-height","auto"),e.closest(".wsf-fields").css("min-height","auto"),void 0===a&&(a=!0);for(var r=this.column_class_array(t),i=0;i0;t--){var a=Math.floor(Math.random()*(t+1)),r=e[t];e[t]=e[a],e[a]=r}return e},$.WS_Form.prototype.get_nice_duration=function(e,t){if(void 0===t&&(t=!0),0==e)return"-";var a=Math.floor(e/3600);if(t)var r=Math.floor(e%3600/60),i=e%60;else r=Math.ceil(e%3600/60);var s=[];return a>0&&s.push(a+" "+(1==a?this.language("hour"):this.language("hours"))),r>0&&s.push(r+" "+(1==r?this.language("minute"):this.language("minutes"))),t&&s.push(i+" "+(1==i?this.language("second"):this.language("seconds"))),s.join(" ")},$.WS_Form.prototype.get_nice_distance=function(e,t){if(0==e)return"-";switch(t){case"IMPERIAL":var a=e/1609;if(a>=1)return Math.floor(a)+" "+(1==a?this.language("mile"):this.language("miles"));var r=3.2808399*e;return Math.floor(r)+" "+(1==r?this.language("feet"):this.language("feets"));default:var i=e/1e3;return i>=1?Math.round(10*i)/10+" "+(1==i?this.language("kilometer"):this.language("kilometers")):Math.round(10*e)/10+" "+(1==e?this.language("meter"):this.language("meters"))}},$.WS_Form.prototype.ucwords=function(e){for(var t=e.split(" "),a=0;a0&&(t=e[0].toUpperCase(),e.length>1&&(t+=e.slice(1))),t},$.WS_Form.prototype.capitalize=function(e){return this.ucwords(e.toLowerCase())},$.WS_Form.prototype.sentence=function(e){return this.ucfirst(e.toLowerCase())},$.WS_Form.prototype.get_label_position=function(e){var t=this.get_object_meta_value(e,"sub_type",!1);""==t&&(t=!1);var a=this.get_object_meta_value(e,"label_position","default");return"default"==(a=this.get_field_value_fallback(e.type,!1,"label_position_force",a,!1,t))&&(a=this.get_object_meta_value(this.form,"label_position_form","top")),a},$.WS_Form.prototype.get_help_position=function(e){var t=this.get_object_meta_value(e,"sub_type",!1);""==t&&(t=!1);var a=this.get_object_meta_value(e,"help_position","default");return"default"==(a=this.get_field_value_fallback(e.type,!1,"help_position_force",a,!1,t))&&(a=this.get_object_meta_value(this.form,"help_position_form","bottom")),a},$.WS_Form.prototype.get_field_html_single=function(e,t,a,r){void 0===a&&(a=!1),void 0===r&&(r=!1);var i=[],s=void 0!==t,_=!a,o=!1!==r?"-repeat-"+r:"",l=this.get_part_id(e.id,r),n=this.get_field_name(e.id,r),c=["default","class","input_type_datetime","multiple","min","max","step"],d=["class"];if(void 0===$.WS_Form.field_type_cache[e.type])return"";var p=$.WS_Form.field_type_cache[e.type];if(p.pro_required)return this.language("error_pro_required");if(a)var h=!0;else h=this.get_object_meta_value(e,"label_render",!0);var u=this.get_object_meta_value(e,"sub_type",!1);if(""==u&&(u=!1),this.get_field_value_fallback(e.type,!1,"label_disabled",!1,!1,u)&&(h=!1),void 0!==p.submit_array&&p.submit_array&&(n+="[]"),h&&!a)var f=this.get_label_position(e);else f="top";var m=!1;-1===this.get_framework().label_positions.indexOf(f)&&(f="top");var v=$.extend(!0,[],this.get_field_value_fallback(e.type,f,"mask_field_attributes",[],!1,u)),b=void 0!==p.mask_wrappers_drop&&p.mask_wrappers_drop;"recaptcha"==e.type&&"invisible"==this.get_object_meta_value(e,"recaptcha_recaptcha_type","default")&&(b=!0),"hcaptcha"==e.type&&"invisible"==this.get_object_meta_value(e,"hcaptcha_type","default")&&(b=!0);var g=b?"#field":this.get_field_value_fallback(e.type,f,"mask","#field",!1,u),y=this.get_field_value_fallback(e.type,f,"mask_field","",!1,u);if(a){var k=this.get_field_value_fallback(e.type,f,"mask_field_submit",!1,!1,u);!1!==k&&(y=k)}"left"!=f&&"right"!=f||(y=(y=y.replace("#pre_help","")).replace("#post_help",""));var w=h?this.get_field_value_fallback(e.type,f,"mask_field_label","",!1,u):"",x=this.get_field_value_fallback(e.type,f,"mask_field_label_hide_group",!1,!1,u),j=this.get_field_value_fallback(e.type,f,"mask_help","",!1,u),S=this.get_field_value_fallback(e.type,f,"mask_help_append","",!1,u),F=this.get_field_value_fallback(e.type,f,"mask_help_append_separator","",!1,u),W=this.get_field_value_fallback(e.type,f,"mask_invalid_feedback","",!1,u),O=this.get_object_meta_value(e,"default_value","",!1,!1),M=this.parse_variables_process(O,r,!1,e,"field_value",_).output,P=this.get_object_meta_value(e,"text_editor","",!1,!1),I=this.parse_variables_process(P,r,!1,e,"field_text_editor",_).output,N=this.get_object_meta_value(e,"html_editor","",!1,!1),z=this.parse_variables_process(N,r,!1,e,"field_html",_).output,D=this.get_object_meta_value(e,"ecommerce_calculation_persist","",!1,!0),q=this.get_object_meta_value(e,"dedupe_value_scope","",!1,!0),T=this.get_object_meta_value(e,"hidden_bypass","",!1,!0),C=this.get_object_meta_value(e,"exclude_cart_total","",!1,!0);if(!s){t="";""!=M&&(t=this.esc_html(M)),""!=I&&(t=I),""!=z&&(t=z)}var E=!0,A="";switch(e.type){case"textarea":E=""===this.get_object_meta_value(e,"input_type_textarea","");break;case"file":case"signature":case"googlemap":"object"==typeof t&&(t=this.esc_html(JSON.stringify(t)));break;case"price_range":s&&"price_range"==e.type&&(t=this.get_number(t));break;case"password":A="";var Y,U="";if(this.get_object_meta_value(e,"password_generate","",!1,!0))""==(Y=this.get_object_meta_value(e,"text_password_generate",""))&&(Y=this.language("password_generate")),A+='',U="margin-left: 8px;";if(this.get_object_meta_value(e,"password_visibility_toggle","",!1,!0))""==(Y=this.get_object_meta_value(e,"text_password_visibility_toggle_off",""))&&(Y=this.language("password_visibility_toggle_off")),A+=''}var J=E?this.parse_variables_process(this.get_object_meta_value(e,"prepend",""),r,!1,e,"field_prepend",_).output:"";A+=E?this.parse_variables_process(this.get_object_meta_value(e,"append",""),r,!1,e,"field_prepend",_).output:"";var R="";if(!a){var L=[],H=this.get_object_meta_value(this.form,"class_field","",!1,!0);if(""!=H&&L.push(H),""!=(R=this.get_object_meta_value(e,"class_field","",!1,!0))&&L.push(R),!this.get_object_meta_value(e,"class_field_full_button_remove","")){var B=this.get_field_value_fallback(e.type,f,"class_field_full_button","",!1,u);"object"==typeof B&&L.push(B.join(" "))}if(!(G=this.get_object_meta_value(e,"class_field_button_type",!1)))var G=this.get_field_value_fallback(e.type,f,"class_field_button_type_fallback",!1,!1,u);if(G){var Z=this.get_field_value_fallback(e.type,f,"class_field_button_type","",!1,u);void 0!==Z[G]&&L.push(Z[G])}var Q=this.get_object_meta_value(e,"class_field_message_type",!1);if(Q){var K=this.get_field_value_fallback(e.type,f,"class_field_message_type","",!1,u);void 0!==K[Q]&&L.push(K[Q])}if(""!==J||""!==A){var V=this.get_field_value_fallback(e.type,f,"class_field_input_group","",!1,u);""!==V&&L.push(V)}var X=void 0!==p.label_inside&&p.label_inside;if(X&&"inside"===f){switch(e.type){case"textarea":var ee=this.get_object_meta_value(e,"input_type_textarea",!1);m=!("tinymce"===ee||"html"===ee);break;case"select":case"price_select":m=!this.get_object_meta_value(e,"select2",!1);break;default:m=!0}m||(f="top")}X||"inside"!==f||(f="top"),m&&(e.meta.placeholder=this.parse_variables_process(e.label,r,!1,e,"field_label",_).output),R=L.join(" ")}var te=parseInt($.WS_Form.settings_plugin.framework_column_count,10),ae=parseInt(this.get_object_meta_value(this.form,"label_column_width_form",3),10),re=this.get_object_meta_value(e,"label_column_width","default");switch(re){case"default":case"":re=ae;break;default:re=parseInt(re,10)}re>=te&&(re=te-1);var ie=te-re,se={id:l,form_id_prefix:this.form_id_prefix,form_id:this.form_id,form_instance_id:this.form_instance_id,field_id:e.id,name:n,label:this.parse_variables_process(e.label,r,!1,e,"field_label",_).output,value:t,required:this.get_object_meta_value(this.form,"label_required")?'':"",column_width_label:re,column_width_field:ie,max_upload_size:ws_form_settings.max_upload_size,locale:ws_form_settings.locale,currency:$.WS_Form.settings_plugin.currency};switch(e.type){case"datetime":"on"==$.WS_Form.settings_plugin.ui_datepicker||"native"==$.WS_Form.settings_plugin.ui_datepicker&&!this.native_date?(se.datetime_type="text",m&&v.push("placeholder")):se.datetime_type=this.get_object_meta_value(e,"input_type_datetime","date");break;case"color":"on"==$.WS_Form.settings_plugin.ui_color||"native"==$.WS_Form.settings_plugin.ui_color&&!this.native_color?se.color_type="text":se.color_type="color";break;case"file":switch(u){case"dropzonejs":var _e=this.get_object_meta_value(e,"placeholder","",!1,!0);""==_e&&(_e=this.language("dropzonejs_default_message")),se.placeholder=_e}}var oe=this.get_field_value_fallback(e.type,f,"meta_key_parse_variables",[],!1,u);for(var le in oe)if(oe.hasOwnProperty(le)){var ne=oe[le],ce=!1!==(bt=void 0!==$.WS_Form.meta_keys[ne]&&$.WS_Form.meta_keys[ne])?void 0===bt.d?"":bt.d:"",de=this.get_object_meta_value(e,ne,ce);"object"==typeof de&&(de=JSON.stringify(de)),de=this.replace_all(de,"'","'"),se[ne]=de}var pe=$.extend(!0,{},se);pe.label_id=this.get_part_id(e.id,r,"label");var he=this.get_part_id(e.id,r,"help"),ue=""!==(me=a?"":this.get_object_meta_value(e,"help","",!1,!1)),fe={value:0,character_count:0,character_count_label:"",character_remaining:0,character_remaining_label:"",character_min:0,character_min_label:"",character_max:0,character_max_label:"",word_count:0,word_count_label:"",word_remaining:0,word_remaining_label:"",word_min:0,word_min_label:"",word_max:0,word_max_label:""};me=this.mask_parse(me,fe);var me=this.parse_variables_process(me,r,!1,e,"field_help",_).output;if(a)switch(e.type){case"range":me="#value"}var ve=this.get_help_position(e),be=this.get_field_value_fallback(e.type,f,"class_help_"+("bottom"==ve?"post":"pre"),[],!1,u);fe.id=l,fe.help_id=he,fe.help_class=be.join(" "),fe.help=me,se.help_class=be.join(" ");var ge=!a&&this.get_object_meta_value(e,"invalid_feedback_render",!1,!1,!0),ye=!1;if(ge){var ke=$.extend(!0,{},se),we=this.form_id_prefix+"invalid-feedback-"+e.id+o,xe=this.get_field_value_fallback(e.type,f,"class_invalid_feedback",[],!1,u),$e=(ye=this.get_field_value_fallback(e.type,f,"invalid_feedback_last_row",!1,!1,u),this.get_object_meta_value(e,"invalid_feedback","",!1,!0)),je=void 0!==p.invalid_feedback?p.invalid_feedback:this.invalid_feedback_mask_placeholder;if(""==$e&&""!=je){var Se=e.label;$e=this.replace_all(je,"#label_lowercase",Se.toLowerCase());$e=this.replace_all($e,"#label",Se)}ke.invalid_feedback_id=we,ke.invalid_feedback_class=xe.join(" "),ke.invalid_feedback=$e,ke.attributes="";var Fe=this.mask_parse(W,ke)}else we=!1,Fe="";if(se.invalid_feedback=Fe,pe.invalid_feedback=Fe,se.attributes="",a)v=c.filter(function(e){return-1!=v.indexOf(e)});if(v.length>0){var We=this.get_attributes(e,v,!1,r);se.attributes+=" "+We.attributes,v=We.mask_attributes,i=We.attribute_values}!1!==r&&(se.attributes+=' data-repeatable-index="'+this.esc_attr(r)+'"');var Oe="",Me=!1,Pe=!1;switch(e.type){case"select":case"price_select":case"checkbox":case"price_checkbox":case"radio":case"price_radio":if(Me=this.get_object_meta_value(e,e.type+"_cascade",!1)){Pe=parseInt(this.get_object_meta_value(e,e.type+"_cascade_field_filter",!1),10);var Ie=parseInt(this.get_object_meta_value(e,e.type+"_cascade_field_id",!1),10);if(Ie>0){var Ne=' data-cascade-field-id="'+this.esc_attr(Ie)+'"';switch(e.type){case"select":case"price_select":se.attributes+=Ne;break;case"checkbox":case"price_checkbox":case"radio":case"price_radio":Oe=Ne}}}var ze=this.get_object_meta_value(e,"select2_ajax",!1);(Me||ze)&&t&&("object"!=typeof t&&(t=[t]),se.attributes+=' data-wsf-populate="'+this.esc_attr(JSON.stringify(t))+'"')}var De=this.get_object_meta_value(e,"custom_attributes",!1);if(!1!==De&&"object"==typeof De&&De.length>0)for(var qe in De)if(De.hasOwnProperty(qe)){var Te=De[qe];""!=Te.custom_attribute_name&&(Te.custom_attribute_value=this.parse_variables_process(Te.custom_attribute_value,r,!1,e).output,se.attributes=this.attribute_modify(se.attributes,Te.custom_attribute_name,Te.custom_attribute_value,!0))}var Ce=this.get_object_meta_value(e,"orientation",!1);if("grid"==Ce)var Ee=this.get_field_value_fallback(e.type,f,"class_orientation_wrapper",[],!1,u),Ae=this.get_field_value_fallback(e.type,f,"class_orientation_row",[],!1,u),Ye=Ee.join(" "),Ue=this.column_class_array(e,"orientation_breakpoint"),Je=(Ue=Ae.concat(Ue)).join(" ");pe.attributes="";var Re=$.extend(!0,[],this.get_field_value_fallback(e.type,f,"mask_field_label_attributes",[],!1,u));if(a)Re=d.filter(function(e){return-1!=Re.indexOf(e)});if(Re.length>0){We=this.get_attributes(e,Re,!1,r);pe.attributes+=We.attributes,Re=We.mask_attributes}var Le="",He=this.get_object_value(p,"data_source",!1),Be=0,Ge=!1!==He;if(Ge){if(void 0===He.type)Ge=!1;else var Ze=He.type;if(void 0===He.id)Ge=!1;else var Qe=He.id}if(Ge){switch(Ze){case"data_grid":var Ke=this.get_object_meta_value(e,Qe,!1)}if(!1===Ke&&(Ge=!1),void 0===Ke.columns)Ge=!1;else var Ve=Ke.columns}if(Ge){var Xe=this.get_field_value_fallback(e.type,f,"mask_group","",!1,u),et=this.get_field_value_fallback(e.type,f,"mask_group_wrapper","",!1,u),tt=this.get_field_value_fallback(e.type,f,"mask_group_label","",!1,u),at=this.get_field_value_fallback(e.type,f,"mask_group_always",!1,!1,u),rt=this.get_field_value_fallback(e.type,f,"mask_row","",!1,u),it=this.get_field_value_fallback(e.type,f,"mask_row_placeholder","",!1,u),st=this.get_field_value_fallback(e.type,f,"mask_row_field","",!1,u),_t=this.get_field_value_fallback(e.type,f,"mask_row_label","",!1,u),ot=this.get_field_value_fallback(e.type,f,"mask_row_lookups",[],!1,u),lt=this.get_field_value_fallback(e.type,f,"datagrid_column_value",!1,!1,u),nt=this.get_field_value_fallback(e.type,f,"mask_row_default","",!1,u),ct=this.get_field_value_fallback(e.type,f,"mask_row_required"," required data-required",!1,u),dt=this.get_field_value_fallback(e.type,f,"mask_row_disabled"," disabled",!1,u),pt=(this.get_field_value_fallback(e.type,f,"mask_row_visible"," visible",!1,u),this.get_object_meta_value(e,"data_grid_rows_randomize","",!1,!0));if(pt)this.get_object_meta_value(e,"data_source_term_hierarchy","",!1,!0)&&(pt=!1);var ht=this.get_object_meta_value(e,"placeholder_row","",!1,!0),ut=this.get_object_meta_value(e,"multiple","",!1,!0);if(""!=ht&&!ut){var ft=$.extend(!0,{},se);ft.value=ht,Le+=this.mask_parse(it,ft)}s&&"object"!=typeof t&&("string"!=typeof t&&(t=t.toString()),t=[t]);var mt=[];for(var vt in ot)if(ot.hasOwnProperty(vt)){if(mt[zt=ot[vt]]=!1,!1===(Ut=this.get_object_meta_value(e,zt,!1,!1,!0))){if(void 0===$.WS_Form.meta_keys[zt])continue;var bt;(Ut=void 0!==(bt=$.WS_Form.meta_keys[zt]).d?bt.d:0)>Ve.length&&(Ut=0)}var gt=!1;for(var yt in Ve){if(Ve.hasOwnProperty(yt))if(Ve[yt].id==Ut){gt=yt;break}}gt&&(mt[zt]=gt)}var kt=!1;if(!1!==Pe){gt=!1;for(var yt in Ve){if(Ve.hasOwnProperty(yt))if(Ve[yt].id==Pe){kt=yt;break}}}if(void 0===Ke.groups)return this.error("error_data_source_groups"),"";var wt=Ke.groups;Object.keys(wt).length;for(var xt in pt&&(wt=this.array_randomize(wt)),wt)if(wt.hasOwnProperty(xt)){var $t=$.extend(!0,{},se);$t.group_id=this.form_id_prefix+"datagrid-"+e.id+"-group-"+xt+o;var jt=wt[xt];if(null!=jt&&"object"==typeof jt){if(void 0===jt.label)return this.error("error_data_group_label"),"";switch(e.type){case"select":case"price_select":var St=!0;break;default:St=void 0===jt.label_render||jt.label_render}if(St){var Ft=$.extend(!0,{},se);Ft.group_label=this.esc_html(jt.label),Ft.label_row_id=this.form_id_prefix+"label-"+e.id+"-group-"+xt+o,$t.group_label=this.mask_parse(tt,Ft)}else $t.group_label="";$t.disabled=void 0!==jt.disabled&&"on"==jt.disabled?" disabled":"";var Wt=void 0!==jt.mask_group&&"on"==jt.mask_group||at;Wt&&x&&(w="");var Ot="";if(void 0!==jt.rows){var Mt=JSON.parse(JSON.stringify(jt.rows)),Pt=this.get_object_meta_value(e,"select_all","");if(("checkbox"==e.type||"price_checkbox"==e.type)&&"on"==Pt){var It=!1,Nt=!1;for(var zt in mt)if(mt.hasOwnProperty(zt)){var Dt=mt[zt];"checkbox_field_value"==zt&&(It=Dt),"checkbox_field_label"==zt&&(Nt=Dt),"checkbox_price_field_value"==zt&&(It=Dt),"checkbox_price_field_label"==zt&&(Nt=Dt)}Pt={id:0,default:"",required:"",hidden:"",disabled:"",select_all:!0,data:[]};var qt=this.get_object_meta_value(e,"select_all_label","");""==qt&&(qt=this.language("select_all_label")),Pt.data[It]=qt,Pt.data[Nt]=qt,Mt.unshift(Pt)}for(var Tt in pt&&(Mt=this.array_randomize(Mt)),Mt)if(Mt.hasOwnProperty(Tt)){var Ct=Mt[Tt];if(null!==Ct&&"object"==typeof Ct&&"object"==typeof Ct.data){var Et=!1;if(!1!==kt)Et=void 0!==Ct.data[kt]&&Ct.data[kt];var At=!ye||Tt==Mt.length-1,Yt=$.extend(!0,{},se);for(var zt in Yt.data_grid_row_value="",Yt.data_grid_row_action_variable="",Yt.data_grid_row_label="",Yt.data_grid_row_price="",Yt.data_grid_row_price_currency="",Yt.data_grid_row_woocommerce_cart="",mt){if(mt.hasOwnProperty(zt))if(Yt[zt]="",!1!==(gt=mt[zt])&&void 0!==Ct.data[gt]){var Ut;switch(null===(Ut=Ct.data[gt])&&(Ut=""),Ut=this.parse_variables_process(Ut.toString(),r,!1,e,"data_grid_row",_).output,Yt[zt+"_html"]=this.esc_html(Ut),e.type){case"range":case"price_range":var Jt=this.get_object_meta_value(e,"min",0);(""==Jt||isNaN(Jt))&&(Jt=0);var Rt=this.get_object_meta_value(e,"max",100);(""==Rt||isNaN(Rt))&&(Rt=100);var Lt=this.get_number(Ut,!0),Ht=parseFloat(Rt)-parseFloat(Jt),Bt=Ht>0?(Lt-Jt)/Ht*100:0;Yt[zt+"_percentage"]=Bt,-1!==zt.indexOf("_field_percentage")&&(Yt.data_grid_row_value_percentage=Bt)}Yt[zt+"_compare"]=Ut;var Gt=!1;if(void 0!==$.WS_Form.meta_keys[zt]){var Zt=$.WS_Form.meta_keys[zt];void 0!==Zt.h&&Zt.h&&(Ut=this.esc_html(Ut));Gt=void 0!==Zt.pr&&Zt.pr}if(Gt){var Qt=this.get_number(Ut),Kt=zt+"_currency",Vt=this.get_price(Qt);Yt[Kt]=Vt,Yt[zt]=Qt,-1!==zt.indexOf("_price_field_price")&&(Yt.data_grid_row_price=Qt),-1!==Kt.indexOf("_price_field_price_currency")&&(Yt.data_grid_row_price_currency=Vt)}else Yt[zt]=Ut;-1!==zt.indexOf("_field_value")&&(Yt.data_grid_row_value=Ut),-1!==zt.indexOf("_field_parse_variable")&&(Yt.data_grid_row_action_variable=Ut),-1!==zt.indexOf("_field_label")&&(Yt.data_grid_row_label=Ut),-1!==zt.indexOf("_field_wc")&&(Yt.data_grid_row_woocommerce_cart=Ut)}}void 0!==p.mask_row_value&&(Yt.row_value=this.mask_parse(p.mask_row_value,Yt),Yt.row_value.indexOf("#")>-1&&(Yt.row_value=this.mask_parse(Yt.row_value,Yt))),void 0!==p.mask_row_price&&(Yt.row_price=this.mask_parse(p.mask_row_price,Yt)),Ct.select_all?Yt.row_id=this.form_id_prefix+"field-"+e.id+"-group-"+xt+"-row-"+Ct.id+o:Yt.row_id=this.form_id_prefix+"field-"+e.id+"-row-"+Ct.id+o,Yt.data_id=Ct.id;var Xt=$.extend(!0,{},Yt),ea=$.extend(!0,{},Yt);ea.label_id=this.form_id_prefix+"label-"+e.id+o,ea.label_row_id=this.form_id_prefix+"label-"+e.id+"-row-"+Ct.id+o;var ta=[];(!s&&Ct.default||s&&!1!==lt&&t.indexOf(Yt[lt+"_compare"])>-1||s&&void 0!==Yt.row_value&&t.indexOf(Yt.row_value)>-1)&&(ta.default=nt),Ct.disabled&&(ta.disabled=dt),Ct.required&&(ta.required=ct),ta.dedupe_value_scope=q,ta.hidden_bypass=T,ta.exclude_cart_total=C,ta.ecommerce_calculation_persist=D,Yt.attributes=Oe,ea.attributes="",Xt.attributes="";var aa=$.extend(!0,[],ta);if(!a){var ra="horizontal"==Ce&&this.get_field_value_fallback(e.type,f,"class_inline",!1,!1,u);!1!==ra&&(aa.class=ra.join(" "));var ia=this.get_field_value_fallback(e.type,f,"class_row",!1,!1,u);if(!1!==ia&&(aa.class=!1!==ra?aa.class+" "+ia.join(" "):ia.join(" ")),Ct.disabled){var sa=this.get_field_value_fallback(e.type,f,"class_row_disabled",!1,!1,u);!1!==sa&&(aa.class+=" "+sa.join(" "))}}var _a=$.extend(!0,[],this.get_field_value_fallback(e.type,f,"mask_row_attributes",[],!1,u));if(_a.length>0){We=this.get_attributes(e,_a,aa,r);Yt.attributes+=" "+We.attributes}if(!1!==Et&&(Yt.attributes+=' data-cascade-value="'+this.esc_attr(Et)+'"'),void 0!==Ct.hidden&&Ct.hidden&&!a)switch(e.type){case"select":continue;default:Yt.attributes+=' style="display:none;"'}"grid"==Ce&&""!=Je&&(Yt.attributes=this.attribute_modify(Yt.attributes,"class",Je,!0));aa=$.extend(!0,[],ta);var oa=this.get_field_value_fallback(e.type,f,"class_row_field_label",!1,!1,u);!1!==oa&&(aa.class=oa.join(" "));var la=$.extend(!0,[],this.get_field_value_fallback(e.type,f,"mask_row_label_attributes",[],!1,u));if(a)la=d.filter(function(e){return-1!=la.indexOf(e)});if(la.length>0){We=this.get_attributes(e,la,aa,r);ea.attributes+=" "+We.attributes}aa=$.extend(!0,[],ta);var na=this.get_field_value_fallback(e.type,f,"class_row_field",!1,!1,u);!1!==na&&(aa.class=na.join(" ")),a||""==R||(aa.class+=" "+R.trim()),aa.aria_labelledby=ea.label_row_id,(!s&&Ct.default||s&&!1!==lt&&t.indexOf(Yt[lt+"_compare"])>-1)&&(aa.default=nt),Ct.disabled&&(aa.disabled=dt),Ct.required&&(aa.required=ct),aa.required_row=i.required;var ca=$.extend(!0,[],this.get_field_value_fallback(e.type,f,"mask_row_field_attributes",[],!1,u));if(a)ca=c.filter(function(e){return-1!=ca.indexOf(e)});if(ca.length>0){We=this.get_attributes(e,ca,aa,r);Xt.attributes+=" "+We.attributes}if(""!=Xt.attributes&&(Xt.attributes=" "+Xt.attributes),void 0!==Ct.select_all&&(Xt.attributes+=" data-wsf-select-all"),void 0!==Ct.hierarchy&&""==Ce&&!pt)switch(e.type){case"checkbox":case"price_checkbox":case"radio":case"price_radio":Yt.attributes+=' data-wsf-hierarchy="'+this.esc_attr(Ct.hierarchy)+'"';break;case"select":case"price_select":Ct.hierarchy>0&&(Yt.select_field_label=" ".repeat(Ct.hierarchy)+Yt.select_field_label)}if(ge&&!ye)if(we=this.form_id_prefix+"invalid-feedback-"+e.id+"-row-"+Ct.id+o,ke.invalid_feedback_id=we,ge)Fe=this.mask_parse(W,ke);else Fe="";Xt.invalid_feedback=At?Fe:"",ea.invalid_feedback=At?Fe:"";var da=this.mask_parse(st,Xt);ea.row_field=da,Yt.row_field=da;var pa=this.mask_parse(_t,ea);Yt.row_label=pa,Ot+=this.mask_parse(rt,Yt),Be++}}}if(""!=et){var ha={group:Ot};"grid"==Ce&&""!=Ye&&(ha.attributes=' class="'+this.esc_attr(Ye)+'"'),Ot=this.mask_parse(et,ha)}!1!==Xe&&Wt?($t.group=Ot,Le+=this.mask_parse(Xe,$t)):Le+=Ot}}}if(se.datalist=Be>0?Le:"",v.length>0){aa=[];void 0!==$t&&void 0!==$t.group_id&&Be>0&&(aa.list=$t.group_id),""===this.get_object_meta_value(e,"aria_label",!1,!1,!0)&&(h&&-1!==w.indexOf("#attributes")?aa.aria_labelledby=this.form_id_prefix+"label-"+e.id+o:aa.aria_label=e.label),ue&&(aa.aria_describedby=he),!1!==(L=this.get_field_value_fallback(e.type,f,"class_field",!1,!1,u))&&(aa.class=L.join(" ")),""!=R&&(aa.class+=" "+R.trim()),""!=(We=this.get_attributes(e,v,aa,r)).attributes&&(se.attributes+=" "+We.attributes)}if(Re.length>0){aa=[];var ua=this.get_field_value_fallback(e.type,f,"class_field_label",!1,!1,u);!1!==ua&&(aa.class=ua.join(" ")),""!=(We=this.get_attributes(e,Re,aa,r)).attributes&&(pe.attributes+=" "+We.attributes)}if(fe.help_append_separator=ue?this.mask_parse(F,fe):"",""!=S){fe.text_clear=this.get_object_meta_value(e,"text_clear",""),""==fe.text_clear&&(fe.text_clear=this.language("clear")),fe.text_reset=this.get_object_meta_value(e,"text_reset",""),""==fe.text_reset&&(fe.text_reset=this.language("reset"));var fa=this.mask_parse(S,fe)}else fa="";fe.help_append=fa,fe.attributes="";var ma=ue||""!=fa?this.mask_parse(j,fe):"";se.pre_help=pe.pre_help="bottom"==ve?"":ma,se.post_help=pe.post_help="bottom"==ve?ma:"",se.help=ma,pe.help=ma,""!=se.attributes&&(se.attributes=" "+se.attributes.trim()),""!=pe.attributes&&(pe.attributes=" "+pe.attributes.trim());var va=this.mask_parse(w,pe);if(""!=va&&!b){var ba=this.get_field_value_fallback(e.type,f,"mask_field_label_wrapper",!1,!1,u);if(!1!==ba){var ga={label:va};va=this.mask_parse(ba,ga)}}var ya=-1!==w.indexOf("#field");switch(f){case"inside":case"bottom":se.pre_label="",se.post_label=ya?se.label:va;break;case"top":se.pre_label=ya?se.label:va,se.post_label="";break;default:se.pre_label="",se.post_label="",pe.pre_label="",pe.post_label=""}if(""!==J||""!==A){var ka=$.extend(!0,{},se);ka.invalid_feedback=se.invalid_feedback,ka.pre_help=se.pre_help,ka.post_help=se.post_help,ka.pre_label=se.pre_label,ka.post_label=se.post_label,se.invalid_feedback="",se.pre_help="",se.post_help="",se.pre_label="",se.post_label="",ka.help=se.help,se.help=""}var wa=this.mask_parse(y,se);if(""!==J||""!==A){var xa=this.get_field_value_fallback(e.type,f,"col_small_prepend_factor",!1,!1,u),$a=this.get_field_value_fallback(e.type,f,"col_small_append_factor",!1,!1,u);if(!1!==xa&&!1!==$a){var ja=""!==J?Math.round(te*xa,0):0;ka.col_small_prepend=ja;var Sa=""!==A?Math.round(te*$a,0):0;ka.col_small_append=Sa,ka.col_small_field=te-(ja+Sa)}ka.field=wa;var Fa=this.get_field_value_fallback(e.type,f,"mask_field_input_group_field","#field",!1,u);if(""!==Fa&&(wa=this.mask_parse(Fa,ka)),""!==J){ka.prepend=J;var Wa=this.get_field_value_fallback(e.type,f,"mask_field_input_group_prepend","#prepend",!1,u);if(""!==Wa)wa=this.mask_parse(Wa,ka)+wa}if(""!==A){ka.append=A;var Oa=this.get_field_value_fallback(e.type,f,"mask_field_input_group_append","#append",!1,u);if(""!==Oa)wa+=this.mask_parse(Oa,ka)}var Ma=this.get_field_value_fallback(e.type,f,"mask_field_input_group","#field",!1,u),Pa=[];""!==J&&Pa.push("wsf-input-group-has-prepend"),""!==A&&Pa.push("wsf-input-group-has-append");var Ia=Pa.join(" ");Ia&&(Ia=" "+Ia),ka.css_input_group=Ia,ka.field=wa,wa=this.mask_parse(Ma,ka)}if(ya&&(pe.field=wa,va=this.mask_parse(w,pe),wa="",pe.field=""),-1!==y.indexOf("#label")&&(se.label=va,wa=this.mask_parse(y,se),va="",se.label=""),""!=wa&&!b){var Na=this.get_field_value_fallback(e.type,f,"mask_field_wrapper",!1,!1,u);if(!1!==Na){var za={field:wa};wa=this.mask_parse(Na,za)}}switch(f){case"right":wa+=va;break;case"left":wa=va+wa;break;default:ya&&(wa=va)}return se.field=wa,this.mask_parse(g,se)},$.WS_Form.prototype.attribute_modify=function(e,t,a,r){var i=this,s=!1,_="";return $("").each(function(){$.each(this.attributes,function(){if(this.specified){var e=this.name,o=this.value;e==t&&(r?o+=" "+a:o=a,o.trim(),s=!0),_+=" "+e,""!==o&&(_+='="'+i.esc_attr(o)+'"')}})}),s||(_+=" "+t,""!==a&&(_+='="'+this.esc_attr(a)+'"')),_},$.WS_Form.prototype.form_help_value=function(e){var t=this;void 0===e&&(e=this.form_canvas_obj),$('input[type="range"]:not([data-init-help-value]),meter:not([data-init-help-value])',e).each(function(){t.form_help_value_render($(this))&&($(this).on("input change",function(){t.form_help_value_render($(this))}),$(this).attr("data-init-help-value",""))})},$.WS_Form.prototype.form_help_value_render=function(e){var t=e.attr("id"),a=e.closest("[data-type]"),r=a.attr("data-id"),i=a.attr("data-repeatable-index"),s=void 0!==i?"-repeat-"+i:"",_=this.field_data_cache[r],o=this.get_object_meta_value(_,"help",""),l=!1;if(void 0!==e.attr("data-fill-lower-track")){var n=parseFloat(e[0].min||"0"),c=parseFloat(e[0].max||"100"),d=parseFloat(e[0].value||n),p=c-n,h=p>0?(d-n)/p*100+"%":"0%";$("#"+t).get(0).style.setProperty("--wsf-fill-lower-track",h),l=!0}if(-1!==o.indexOf("#value")){var u={id:t,value:e.val()},f=this.mask_parse(o,u),m=(f=this.parse_variables_process(f,i,!1,_,"field_help").output,this.form_id_prefix+"help-"+r+s);$("#"+m).html(f),l=!0}return l},$.WS_Form.prototype.get_attributes=function(e,t,a,r){"object"!=typeof a&&(a=!1);var i=[],s=[];if(!1!==t)for(var _ in t)if(t.hasOwnProperty(_)){var o=t[_];if(void 0!==$.WS_Form.meta_keys[o]){var l=$.WS_Form.meta_keys[o];if(this.is_admin)var n=void 0!==l.mask?l.mask:"",c=void 0!==l.mask_disregard_on_empty&&l.mask_disregard_on_empty,d=void 0!==l.mask_disregard_on_zero&&l.mask_disregard_on_zero,p=void 0!==l.default?l.default:"";else n=void 0!==l.m?l.m:"",c=void 0!==l.e&&l.e,d=void 0!==l.z&&l.z,p=void 0!==l.d?l.d:"";if(!1!==a)if(void 0!==a[o])var h=a[o].trim();else h="";else{if(this.is_admin)var u=void 0!==l.key?l.key:o;else u=void 0!==l.k?l.k:o;var f=void 0!==l.c&&l.c;if(!1!==f){h=this.get_object_meta_value(e,u,p,!1,!1);h=this.parse_variables_process(h,r,!1,e,f).output}else h=this.get_object_meta_value(e,u,p,!1,!0);if(""==h&&void 0!==l.g){var m=l.g;void 0!==$.WS_Form.settings_plugin[m]&&$.WS_Form.settings_plugin[m]&&(h=$.WS_Form.settings_plugin[m])}s[u]=h}h=this.esc_html(h);var v=this.mask_parse(n,{value:h});(c&&""!=h||!c)&&(d&&0!=parseInt(h,10)||!d)&&(i.push(v),delete t[_])}}return t=this.array_remove_empty(t),{attributes:i.join(" "),mask_attributes:t,attribute_values:s}},$.WS_Form.prototype.get_number=function(e,t,a,r){if(void 0===t&&(t=0),void 0===a&&(a=!0),void 0===r&&(r=!1),"number"==typeof e&&(e=e.toString()),"string"!=typeof e)return 0;(e=e.trim()).includes(ws_form_settings.currency_symbol)&&(a=!0);var i=$.WS_Form.settings_plugin.price_decimal_separator;if(a){var s=$.WS_Form.settings_plugin.price_thousand_separator,_=ws_form_settings.currency_symbol;e.includes("&")&&(e=this.parse_html_entities(e)),e=e.replace(_,"");var o=new RegExp("[^0-9-"+i+"]","g");if(e=e.replace(o,""),""!==i&&""!==s&&i===s){if(e.substr(-3,1)===i){var l=e.length-3;e=e.substr(0,l)+"[dec]"+e.substr(l+1)}e=(e=e.replace(s,"")).replace("[dec]",".")}else""!==i&&(e=e.replace(i,"."))}else""!==i&&(e=e.replace(i,"."));var n=""===e.trim()?t:isNaN(e)?t:parseFloat(e);return!1!==r&&(n=this.get_number_rounded(parseFloat(n),r)),n},$.WS_Form.prototype.get_number_rounded=function(e,t){return Number(Math.round(e+"e"+t)+"e-"+t)},$.WS_Form.prototype.get_number_to_step=function(e,t){if(isNaN(t))return e;t||(t=1);var a=1/t;return Math.round(e*a)/a},$.WS_Form.prototype.get_float=function(e,t){return void 0===t&&(t=0),"number"==typeof e&&(e=e.toString()),"string"!=typeof e?0:(e=e.trim(),parseFloat(e))},$.WS_Form.prototype.get_currency=function(){var e={},t=parseInt($.WS_Form.settings_plugin.price_decimals,10);switch(e.prefix=ws_form_settings.currency_symbol,e.suffix="",$.WS_Form.settings_plugin.currency_position){case"right":e.prefix="",e.suffix=ws_form_settings.currency_symbol;break;case"left_space":e.prefix=ws_form_settings.currency_symbol+" ";break;case"right_space":e.prefix="",e.suffix=" "+ws_form_settings.currency_symbol}return e.decimals=t<0?0:t,e.decimal_separator=$.WS_Form.settings_plugin.price_decimal_separator,e.thousand_separator=$.WS_Form.settings_plugin.price_thousand_separator,e},$.WS_Form.prototype.get_price=function(e,t,a){return void 0===t&&(t=this.get_currency()),void 0===a&&(a=!0),"number"!=typeof e&&(e=parseFloat(e)),(a?t.prefix:"")+this.replace_all(this.replace_all(e.toFixed(t.decimals).replace(/\B(?=(\d{3})+(?!\d))/g,"[thousand]"),".",t.decimal_separator),"[thousand]",t.thousand_separator)+(a?t.suffix:"")},$.WS_Form.prototype.parse_html_entities=function(e){return e.replace(/([0-9]{1,3});/gi,function(e,t){var a=parseInt(t,10);return String.fromCharCode(a)})},$.WS_Form.prototype.form_add_hidden_input=function(e,t,a,r,i,s){var _=$('input[name="'+this.esc_selector(e)+'"]',this.form_canvas_obj);_.length&&-1===e.indexOf("[]")?_.val(t):(void 0===t&&(t=""),void 0===a&&(a=!1),void 0===r&&(r=!1),void 0===i&&(i=!1),void 0===s&&(s="hidden"),this.form_canvas_obj.append('"))},$.WS_Form.prototype.get_part_id=function(e,t,a){void 0===t&&(t=!1),void 0===a&&(a="field");var r=!1!==t?"-repeat-"+t:"";return this.form_id_prefix+a+"-"+e+r},$.WS_Form.prototype.get_field_name=function(e,t,a){void 0===t&&(t=!1),void 0===a&&(a=!1);return this.field_name_prefix+e+(!1!==t?a?"_"+t:"["+t+"]":"")},$.WS_Form.prototype.is_iterable=function(e){return null!=e&&("object"==typeof e&&"function"==typeof e[Symbol.iterator])},$.WS_Form.prototype.is_integer=function(e){return!isNaN(e)&&/^\d+\.?\d*$/.test(e)},$.WS_Form.prototype.replace_all=function(e,t,a){return void 0===a?e.toString():e.split(t).join(a)},$.WS_Form.prototype.array_remove_empty=function(e){if("object"!=typeof e)return e;var t=[];for(var a in e)e.hasOwnProperty(a)&&null!==e[a]&&t.push(e[a]);return t},$.WS_Form.prototype.get_date=function(e,t,a){switch(t||(t="date"),a||(a=ws_form_settings.date_format),t){case"time":return new Date("01/01/1970 "+e);case"date":e+=" 00:00:00";break;case"week":case"month":return!1}var r=!1;switch(a){case"d/m/Y":r="/";break;case"d.m.Y":r=".";break;case"d-m-Y":r="-"}if(!1!==r){switch(t){case"datetime-local":var i=e.indexOf(" "),s=e.substring(0,i),_=e.substring(i);break;default:s=e,_=""}var o=s.split(r);if(3===o.length){var l=parseInt(o[0],10);s=parseInt(o[1],10)+"/"+l+"/"+parseInt(o[2],10)}e=s+_}return e=e.replace(/(\d+)(st|nd|rd|th)/g,"$1"),e=this.replace_all(e,"."," "),e=this.replace_all(e," "," "),this.get_new_date(e)},$.WS_Form.prototype.get_new_date=function(e){return"-"!=e.charAt(4)||"-"!=e.charAt(7)||"T"==e.charAt(10)||":"!=e.charAt(13)||this.date_valid(e)||(e=e.replace(/-/g,"/")),"-"!=e.charAt(4)||this.date_valid(e)||-1===e.toLowerCase().indexOf("am")&&-1===e.toLowerCase().indexOf("pm")||(e=e.replace(/-/g,"/")),new Date(e)},$.WS_Form.prototype.date_valid=function(e){return e instanceof Date&&!isNaN(e.valueOf())},$.WS_Form.prototype.is_not_number=function(e){return isNaN(e)||"boolean"==typeof e||""===e},$.WS_Form.prototype.get_object_row_id=function(e){var t=e.object_row_id;return void 0!==t&&""!=t&&("object"==typeof t?(t=t.map(function(e){return parseInt(e,10)})).length||(t=!1):t=""!==t&&[parseInt(t,10)],t)},$.WS_Form.prototype.get_date_by_type=function(e,t){if(!e)return"";var a=this.get_object_meta_value(t,"format_date",ws_form_settings.date_format);a||(a=ws_form_settings.date_format);var r=this.get_object_meta_value(t,"format_time",ws_form_settings.time_format);r||(r=ws_form_settings.time_format);var i=this.get_object_meta_value(t,"input_type_datetime","date");switch(i){case"datetime-local":case"date":switch(a){case"d/m/Y":var s=-1!==e.indexOf(" ")?[e.substring(0,e.indexOf(" ")),e.substring(e.indexOf(" ")+1)]:[e];e=(_=s[0].split("/"))[1]+"/"+_[0]+"/"+_[2]+(void 0!==s[1]?" "+s[1]:"");break;case"d-m-Y":s=-1!==e.indexOf(" ")?[e.substring(0,e.indexOf(" ")),e.substring(e.indexOf(" ")+1)]:[e];e=(_=s.split("-"))[1]+"/"+_[0]+"/"+_[2]+(void 0!==s[1]?" "+s[1]:"");break;case"d.m.Y":var _;s=-1!==e.indexOf(" ")?[e.substring(0,e.indexOf(" ")),e.substring(e.indexOf(" ")+1)]:[e];e=(_=s[0].split("."))[1]+"/"+_[0]+"/"+_[2]+(void 0!==s[1]?" "+s[1]:"")}}switch("time"!==i&&4===e.indexOf("-")&&-1===e.indexOf(":")&&(e+=" 00:00:00"),i){case"date":return e=this.get_new_date(e),this.date_format(e,a);case"month":return e=this.get_new_date(e),this.date_format(e,"F Y");case"time":return e=this.get_new_date("1970-01-01 "+e),this.date_format(e,r);case"week":return e=this.get_new_date(e),this.language("week")+" "+this.date_format(e,"W, Y");default:return e=this.get_new_date(e),this.date_format(e,a+" "+r)}},$.WS_Form.prototype.number_format=function(e,t,a,r){if(void 0===e||null==e||!isFinite(e))return 0;if(!t){var i=e.toString().split(".").length;t=i>1?i:0}void 0===a&&(a="."),void 0===r&&(r=",");var s=(e=(e=parseFloat(e).toFixed(t)).replace(".",a)).split(a);return s[0]=s[0].replace(/\B(?=(?:\d{3})+(?!\d))/g,r),e=s.join(a)},$.WS_Form.prototype.date_format=function(e,t){var a=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],r=["January","February","March","April","May","June","July","August","September","October","November","December"],i=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],s=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],_={d:function(){var e=this.getDate();return(e<10?"0":"")+e},D:function(){return i[this.getDay()]},j:function(){return this.getDate()},l:function(){return s[this.getDay()]},N:function(){var e=this.getDay();return 0===e?7:e},S:function(){var e=this.getDate();return e%10==1&&11!==e?"st":e%10==2&&12!==e?"nd":e%10==3&&13!==e?"rd":"th"},w:function(){return this.getDay()},z:function(){var e=new Date(this.getFullYear(),0,1);return Math.ceil((this-e)/864e5)},W:function(){var e=new Date(this.valueOf()),t=(this.getDay()+6)%7;e.setDate(e.getDate()-t+3);var a=e.valueOf();e.setMonth(0,1),4!==e.getDay()&&e.setMonth(0,1+(4-e.getDay()+7)%7);var r=1+Math.ceil((a-e)/6048e5);return r<10?"0"+r:r},F:function(){return r[this.getMonth()]},m:function(){var e=this.getMonth();return(e<9?"0":"")+(e+1)},M:function(){return a[this.getMonth()]},n:function(){return this.getMonth()+1},t:function(){var e=this.getFullYear(),t=this.getMonth()+1;return 12===t&&(e=e++,t=0),new Date(e,t,0).getDate()},L:function(){var e=this.getFullYear();return e%400==0||e%100!=0&&e%4==0},o:function(){var e=new Date(this.valueOf());return e.setDate(e.getDate()-(this.getDay()+6)%7+3),e.getFullYear()},Y:function(){return this.getFullYear()},y:function(){return(""+this.getFullYear()).substr(2)},a:function(){return this.getHours()<12?"am":"pm"},A:function(){return this.getHours()<12?"AM":"PM"},B:function(){return Math.floor(1e3*((this.getUTCHours()+1)%24+this.getUTCMinutes()/60+this.getUTCSeconds()/3600)/24)},g:function(){return this.getHours()%12||12},G:function(){return this.getHours()},h:function(){var e=this.getHours();return((e%12||12)<10?"0":"")+(e%12||12)},H:function(){var e=this.getHours();return(e<10?"0":"")+e},i:function(){var e=this.getMinutes();return(e<10?"0":"")+e},s:function(){var e=this.getSeconds();return(e<10?"0":"")+e},v:function(){var e=this.getMilliseconds();return(e<10?"00":e<100?"0":"")+e},e:function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},I:function(){for(var e=null,t=0;t<12;++t){var a=new Date(this.getFullYear(),t,1).getTimezoneOffset();if(null===e)e=a;else{if(ae)break}}return this.getTimezoneOffset()===e|0},O:function(){var e=this.getTimezoneOffset();return(-e<0?"-":"+")+(Math.abs(e/60)<10?"0":"")+Math.floor(Math.abs(e/60))+(0===Math.abs(e%60)?"00":(Math.abs(e%60)<10?"0":"")+Math.abs(e%60))},P:function(){var e=this.getTimezoneOffset();return(-e<0?"-":"+")+(Math.abs(e/60)<10?"0":"")+Math.floor(Math.abs(e/60))+":"+(0===Math.abs(e%60)?"00":(Math.abs(e%60)<10?"0":"")+Math.abs(e%60))},T:function(){var e=this.toLocaleTimeString(navigator.language,{timeZoneName:"short"}).split(" ");return e[e.length-1]},Z:function(){return 60*-this.getTimezoneOffset()},c:function(){return this.format("Y-m-d\\TH:i:sP")},r:function(){return this.toString()},U:function(){return Math.floor(this.getTime()/1e3)}};return t.replace(/(\\?)(.)/g,function(t,a,r){return""===a&&_[r]?_[r].call(e):r})}}(jQuery);