!function(e){function t(r){if(a[r])return a[r].exports;var i=a[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var a={};return t.m=e,t.c=a,t.p="",t(0)}([function(module,exports,__webpack_require__){"use strict";function _interopRequireDefault(e){return e&&e.__esModule?e:{"default":e}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function globalNotification(e,t){e="error"===e?"red":"green",jQuery("#notification-panel").removeClass("red green").addClass(e).html(t)}var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_createClass=function(){function e(e,t){for(var a=0;a]+)>)/gi,"");t[a].push(e)}}),e.data("FieldLabels",t)}),e.on("change",".dropdown-cover select",function(){var t=e.data("FieldLabels")||{},a=jQuery(this).attr("name").replace(/[\[\]']+/g,"")+".label";t[a]=[],t[a].push(jQuery(this).find("option:selected").text()),e.data("FieldLabels",t)}),setTimeout(function(){var e={};t.form.parents(".form-live").find(".pre-populate-data").each(function(){var t=jQuery(this).text().replace(/“/g,'"').replace(/”/g,'"');t=jQuery.parseJSON(t);for(var a in t)(""===t[a]||"object"===_typeof(t[a])&&""===t[a][0])&&delete t[a];e=Object.assign(e,t)}),t.setFormValues(e)},0),e.keypress(function(t){13===t.which&&e.hasClass("disable-enter-true")===!0&&t.preventDefault()}),this.form.find(".required_field").hide(),this.form.find('[make-read-only="true"]').attr("readonly",!0).addClass("is-read-only")}return _createClass(FormCraft,[{key:"disableSubmit",value:function(){this.form.find(".submit-button").attr("disabled",!0)}},{key:"enableSubmit",value:function(){this.form.find(".submit-button").attr("disabled",!1)}},{key:"setupCharacterCount",value:function(){this.form.find(".textarea-cover textarea").on("input",function(){var e=jQuery(this).val().length,t=parseInt(jQuery(this).parents(".textarea-cover").find(".count-true > span.max-count").text(),10);e>t?jQuery(this).parents(".textarea-cover").find(".count-true").css("color","red"):jQuery(this).parents(".textarea-cover").find(".count-true").css("color","inherit"),jQuery(this).parents(".textarea-cover").find(".count-true > span.current-count").text(e)})}},{key:"setupAutocomplete",value:function(){var e=this;setTimeout(function(){e.form.find(".dropdown-cover.autocomplete-type-true").each(function(){jQuery(this).find("input").val(jQuery(this).find("select").val()),jQuery(this).parents(".form-element").css("z-index",102);var e=jQuery(this).find("input")[0],t=[];jQuery(this).find("select option").each(function(e,a){t.push(a.text)}),new Awesomplete(e,{minChars:1,list:t}),e.addEventListener("awesomplete-select",function(t){jQuery(e).parents(".dropdown-cover").find('select option:contains("'+t.text.label+'")')[0].selected=!0,jQuery(e).parents(".dropdown-cover").find("select").trigger("change")})})},250)}},{key:"setupInputMasks",value:function(){this.form.find("[data-input-mask]").each(function(){var e={onComplete:function(e,t){jQuery(t.srcElement).removeClass("mask-invalid")},onChange:function(e,t){jQuery(t.srcElement).addClass("mask-invalid")}};""!==jQuery(this).attr("data-input-mask").replace(/[^a-zA-Z0-9 ():\-\/]+/g,"").trim()&&jQuery(this).mask(jQuery(this).attr("data-input-mask").replace(/[^a-zA-Z0-9 ():\-\/]+/g,""),e)})}},{key:"setupSliderFields",value:function(){this.form.find(".slider-cover .ui-slider-cover").each(function(){var e={};e.min=parseFloat(jQuery(this).find("> span").attr("range-min")),e.max=parseFloat(jQuery(this).find("> span").attr("range-max")),e.step=parseFloat(jQuery(this).find("> span").attr("range-step")),e.range="true"===jQuery(this).find("> span").attr("range-true")||"min";var t=jQuery(this).find("> span").attr("data-prefix")||"",a=jQuery(this).find("> span").attr("data-suffix")||"";e.create=function(){e.range===!0?jQuery(this).find(".ui-slider-range").eq(0).append('0'):jQuery(this).find("span.ui-slider-handle").eq(0).append('0'),jQuery(this).parents(".slider-cover").find('input[type="hidden"]').val("").trigger("change").attr("data-prefix",t).attr("data-suffix",a)},e.change=e.slide=function(e,r){jQuery(this).parents(".ui-slider-cover").find(".ui-slider-handle-nos").show();var i=jQuery(this).parents(".fc-form").attr("data-thousand"),n=jQuery(this).parents(".fc-form").attr("data-decimal");jQuery(this).parents(".slider-cover").find(".ui-slider-handle-nos").css("margin-left","-"+(jQuery(this).parents(".slider-cover").find(".ui-slider-handle-nos").outerWidth()/2-9)+"px");var s=void 0,o=void 0,l=void 0,d=void 0,u=void 0,c=void 0;r.values?(o=r.values[0]+" - "+r.values[1],u=r.values[0].toString().replace(/[.]/g,n).replace(/\B(?=(\d{3})+(?!\d))/g,i),l=r.values[1].toString().replace(/[.]/g,n).replace(/\B(?=(\d{3})+(?!\d))/g,i),c=r.values[0],d=r.values[1],r.values[0]=t+r.values[0]+a,r.values[1]=t+r.values[1]+a,s=r.values[0]+" - "+r.values[1]):(o=r.value,s=parseFloat(r.value),u=s.toString().replace(/[.]/g,n).replace(/\B(?=(\d{3})+(?!\d))/g,i),c=s,l="",d="",s=t+s+a),jQuery(this).parents(".slider-cover").find("input").val(o).trigger("change"),s=s.replace(c,u).replace(d,l),jQuery(this).parents(".slider-cover").find(".ui-slider-handle-nos").text(s)},jQuery(this).html(""),jQuery(this).find("span").slider(e)})}},{key:"setupDatepickerFields",value:function(){this.form.find('.datepicker-cover input[type="text"]').each(function(){jQuery(this).removeClass("hasDatepicker");var e={};if(e.beforeShow=function(){jQuery("#ui-datepicker-div").removeClass("ui-datepicker").addClass("formcraft-datepicker")},e.onClose=function(){jQuery(this).trigger("blur")},e.onSelect=function(){jQuery(this).trigger("change").trigger("input"),0!==jQuery('[data-date-min-range="['+jQuery(this).attr("data-field-id")+']"]').length&&jQuery('[data-date-min-range="['+jQuery(this).attr("data-field-id")+']"]').hasClass("hasDatepicker")&&jQuery('[data-date-min-range="['+jQuery(this).attr("data-field-id")+']"]').datepicker("option","minDate",jQuery(this).datepicker("getDate"))},jQuery(this).attr("data-date-lang")&&"en"!==jQuery(this).attr("data-date-lang")&&window.datepickerLoad===!1&&(jQuery.getScript(FC.datepickerLang+"datepicker-"+jQuery(this).attr("data-date-lang")+".js"),window.datepickerLoad=!0),jQuery(this).attr("data-date-format")&&(e.dateFormat=jQuery(this).attr("data-date-format")),jQuery(this).attr("data-date-max")){var t=void 0;""!==jQuery(this).attr("data-date-max")&&parseInt(jQuery(this).attr("data-date-max"),10).toString()===jQuery(this).attr("data-date-max")?(t=new Date,t.setDate(t.getDate()+parseInt(jQuery(this).attr("data-date-max"),10))):t=new Date(jQuery(this).attr("data-date-max-alt")),e.maxDate=t}if(jQuery(this).attr("data-date-min")){var a=void 0;""!==jQuery(this).attr("data-date-min")&&parseInt(jQuery(this).attr("data-date-min"),10).toString()===jQuery(this).attr("data-date-min")?(a=new Date,a.setDate(a.getDate()+parseInt(jQuery(this).attr("data-date-min"),10))):a=new Date(jQuery(this).attr("data-date-min-alt")),e.minDate=a}if(jQuery(this).attr("data-date-days")){var r=jQuery.map(jQuery.parseJSON(jQuery(this).attr("data-date-days")),function(e,t){if(e===!0)return t});e.beforeShowDay=function(e){return r.indexOf(e.getDay().toString())!==-1?[!0,""]:[!1,""]}}e.nextText="❯",e.prevText="❮",e.hideIfNoPrevNext=!0,e.changeYear=!0,e.changeMonth=!0,e.showAnim=!1,e.yearRange="c-100:c+100",e.shortYearCutoff=50,e.showOtherMonths=!0,jQuery(this).datepicker(e)})}},{key:"setupFileUploadFields",value:function(){0!==this.form.find(".fileupload-cover .button-file input").length&&(this.form.find(".fileupload-cover .button-file input").fileupload({dataType:"json",add:function(e,t){var a=jQuery(this).parents("form").data("FormCraft");if(a.disableSubmit(),""!==jQuery(this).attr("data-allow-extensions")&&jQuery(this).attr("data-allow-extensions").indexOf(",")){var r=jQuery(this).attr("data-allow-extensions").replace(/ /g,"").split(",");for(var i in t.files){var n=t.files[i].name.split("."),s=n[n.length-1];if(r.indexOf(s.toLowerCase())===-1)return a.enableSubmit(),!1}}if(""!==jQuery(this).attr("data-max-files")&&jQuery(this).parent().parent().find(".files-list li").length>=parseInt(jQuery(this).attr("data-max-files"),10))return a.enableSubmit(),!1;if("undefined"!=typeof jQuery(this).attr("data-max-size")&&""!==jQuery(this).attr("data-max-size")){var o=parseFloat(jQuery(this).attr("data-max-size"));if(t.files[0].size/1024>o)return"undefined"==typeof window["FC_Validation_"+a.formID].max_file_size?alert("File too big"):alert(window["FC_Validation_"+a.formID].max_file_size.replace("[x]",o)),a.enableSubmit(),!1}var l=jQuery(this).parents(".fc-form").attr("data-id");t.url=""+FC.ajaxurl+(FC.ajaxurl.indexOf("?")===-1?"?":"&")+"action=formcraft3_file_upload&id="+l;var d=jQuery(this).parent().parent();0===d.find(".files-list").length&&d.append(''),d.find(".files-list").append("
  • "),t.listPosition=d.find("li").length-1,d.find(".files-list li").eq(t.listPosition).slideDown(100),t.timeout=0,window.jqXHR=t.submit()},progress:function e(t,a){var r=jQuery(this).parent().parent(),e=parseInt(a.loaded/a.total*100,10);r.find(".files-list li").eq(a.listPosition).find("div").css("width",e+"%")},done:function(e,t){var a=jQuery(this).parents("form").data("FormCraft");a.enableSubmit();var r=jQuery(this).parent().parent();if(t.result.success){var i=jQuery(this).attr("data-name-list");r.find(".files-list li").eq(t.listPosition).find("div").text(t.result.file_name),r.find(".files-list li").eq(t.listPosition).append('×'),r.find(".files-list li").eq(t.listPosition).find("input").trigger("change")}else t.result.failed&&(r.find(".files-list li").eq(t.listPosition).remove(),showDebug===!0&&globalNotification("error",t.result.debug))}}),this.form.find(".fileupload-cover").on("click",".files-list .delete-file",function(){var e=jQuery(this).parent().find("input").val();jQuery(this).addClass("icon-spin5 animate-spin").html(""),jQuery.ajax({url:FC.ajaxurl,type:"POST",context:jQuery(this),data:"action=formcraft3_file_delete&id="+e,dataType:"json"}).done(function(e){e.success?jQuery(this).parent().slideUp(200,function(){jQuery(this).find("input").val("").trigger("change"),jQuery(this).remove()}):jQuery(this).removeClass("icon-spin5 animate-spin").html("×")}).always(function(){jQuery(this).removeClass("icon-spin5 animate-spin").html("×")})}))}},{key:"setupTimepickerFields",value:function(){this.form.on("input, change",".time-fields-cover > select, .time-fields-cover > input",function(){var e=jQuery(this).parent(),t=e.find("select").eq(0).val(),a=e.find("select").eq(1).val(),r=e.find("input").val();jQuery(this).parent().hasClass("hide-meridian-true")?e.parent().find('input[type="hidden"]').val(t+":"+a).trigger("change"):e.parent().find('input[type="hidden"]').val(t+":"+a+" "+r).trigger("change")}),this.form.on("focus",".meridian-picker",function(){"am"===jQuery(this).val()?jQuery(this).val("pm").trigger("change"):"pm"===jQuery(this).val()?jQuery(this).val("am").trigger("change"):jQuery(this).val("am").trigger("change"),jQuery(this).blur(),jQuery(this).trigger("input")})}},{key:"setupAddressFields",value:function(){return"undefined"==typeof AddressPicker?void jQuery(".address-picker-field").parents(".field-cover").find(".address-field-map").html("You need to enter the Google API Key when editing the field to make the autocomplete address field work").css("height","auto").css("color","red"):void jQuery(".address-picker-field").each(function(){var e=this;jQuery(this).is("[class*=tt-]")||("true"===jQuery(this).attr("data-show-map")?(jQuery(this).parents(".field-cover").find(".address-field-map").css("height",jQuery(this).attr("data-map-height")),jQuery(this).data("addressField",new AddressPicker({map:{id:jQuery(this).parents(".field-cover").find(".address-field-map")[0]},reverseGeocoding:!0})),jQuery(this).typeahead(null,{displayKey:"description",source:jQuery(this).data("addressField").ttAdapter()}),jQuery(this).bind("typeahead:selected",jQuery(this).data("addressField").updateMap),jQuery(this).bind("typeahead:cursorchanged",jQuery(this).data("addressField").updateMap),jQuery(jQuery(this).data("addressField")).on("addresspicker:selected",function(t,a){jQuery(e).parents(".address-cover").find(".address-picker-field-hidden").val(a.placeResult.formatted_address),jQuery(e).val(a.address())})):(jQuery(this).data("addressField",new AddressPicker),jQuery(this).typeahead(null,{displayKey:"description",source:jQuery(this).data("addressField").ttAdapter()}),jQuery(this).parents(".field-cover").find(".address-field-map").hide(),jQuery(this).bind("typeahead:selected",jQuery(this).data("addressField").updateMap),jQuery(this).bind("typeahead:cursorchanged",jQuery(this).data("addressField").updateMap),jQuery(jQuery(this).data("addressField")).on("addresspicker:selected",function(t,a){jQuery(e).parents(".address-cover").find(".address-picker-field-hidden").val(a.placeResult.formatted_address),jQuery(e).val(a.address())})))})}},{key:"prepareMathFormulas",value:function(){this.FormCraftMath=[];var e=this;this.form.find('.customText-cover > div, .stripe-cover div.stripe-amount-show, .stripe-cover input.stripe-amount-hidden, .customText-cover input[type="hidden"], .allow-math').each(function(){var t=void 0,a=void 0,r=void 0,i=void 0;if("hidden"===jQuery(this).prop("type"))r=i=jQuery(this).val();else{r=jQuery(this).text(),t=jQuery(this).html();var n=jQuery("
    ").html(t);n.find(".fc-third-party").remove(),i=n.text()}for(var s=/\[(.*?)\]/g;null!==(a=s.exec(i));){a[0]=jQuery("
    ").text(a[0]).html();var o=Math.random().toString(36).replace(/[^a-z]+/g,"").substring(0,8);"hidden"===jQuery(this).prop("type")?jQuery(this).attr("id","bind-math-"+o).val(""):(t=t.replace(a[0],''),jQuery(this).html(t)),e.FormCraftMath[o]={identifier:o,variables:[]},e.FormCraftMath[o].string=a[1].replace(/[^a-zA-Z0-9.*()\-,+\/]+/g,"").toLowerCase(),""!==e.FormCraftMath[o].string.slice(-1).replace(/[^.*\-,+\/]+/g,"")&&(e.FormCraftMath[o].string=e.FormCraftMath[o].string.slice(0,e.FormCraftMath[o].string.length-1)),""===e.FormCraftMath[o].string.replace(/[^.*()\-,+\/]+/g,"")?e.FormCraftMath[o].resultType="string":e.FormCraftMath[o].resultType="math";var l=e.FormCraftMath[o].string.split(/[*()\-,+\/]/);for(var d in l)""!==l[d]&&"function"!=typeof l[d]&&l[d].replace(/[^\d.-]/g,"")!==l[d]&&e.FormCraftMath[o].variables.push(l[d]);e.FormCraftMath[o].variables=e.FormCraftMath[o].variables.sort(function(e,t){return parseInt(t.replace("field",""),10)-parseInt(e.replace("field",""),10)})}})}},{key:"checkIfApplyMath",value:function(e){var t=jQuery(e).attr("data-field-id");for(var a in this.FormCraftMath)for(var r in this.FormCraftMath[a].variables)this.FormCraftMath[a].variables[r]===t&&this.calculateAndApplyMath(this.FormCraftMath[a])}},{key:"calculateAndApplyMath",value:function calculateAndApplyMath(formula){var mathResult=void 0,form=jQuery("#bind-math-"+formula.identifier).parents("form"),thousand=jQuery("#bind-math-"+formula.identifier).parents("form").attr("data-thousand"),decimal=jQuery("#bind-math-"+formula.identifier).parents("form").attr("data-decimal");if(1===formula.variables.length&&formula.variables[0]===formula.string)mathResult=this.getFieldValue(jQuery('[data-field-id="'+formula.variables[0]+'"]'),"string"),"hidden"===jQuery("#bind-math-"+formula.identifier).prop("type")?(mathResult=parseFloat(mathResult),setTimeout(function(){jQuery("#bind-math-"+formula.identifier).val(mathResult).trigger("change")})):jQuery(".fc-form.spin-true").length&&!isNaN(parseFloat(mathResult))?_helpers2["default"].spinTo("#bind-math-"+formula.identifier,mathResult,thousand,decimal):(mathResult=mathResult.toString().replace(/[.]/g,decimal).replace(/\B(?=(\d{3})+(?!\d))/g,thousand),jQuery("#bind-math-"+formula.identifier).text(mathResult)),jQuery(document).trigger("formcraft_math_change",[form]);else{var string=formula.string;for(var field in formula.variables)if("function"!=typeof formula.variables[field]){var value=this.getFieldValue(jQuery(form).find('[data-field-id="'+formula.variables[field]+'"]'),"number"),reg=new RegExp(formula.variables[field],"g");value=""===value?0:value,string=string.replace(reg,value)}string=string.replace(/--/g,"+");try{mathResult=parseFloat(eval(string).toFixed(2))}catch(e){mathResult=0,e instanceof SyntaxError&&console.log("%cMath Formula Syntax Error. Formula: "+string+". FormID: "+this.formID+". Error: "+e.message,"color: red")}"hidden"===jQuery("#bind-math-"+formula.identifier).prop("type")?jQuery("#bind-math-"+formula.identifier).val(mathResult).trigger("change"):jQuery(".fc-form.spin-true").length?_helpers2["default"].spinTo("#bind-math-"+formula.identifier,mathResult,thousand,decimal):(mathResult=mathResult.toString().replace(/[.]/g,decimal).replace(/\B(?=(\d{3})+(?!\d))/g,thousand),jQuery("#bind-math-"+formula.identifier).text(mathResult)),jQuery(document).trigger("formcraft_math_change",[form])}}},{key:"checkIfApplyLogic",value:function(e){var t=this.form.parents(".form-live").attr("data-uniq"),a=jQuery(e).attr("data-field-id"),r=!1;if("undefined"!=typeof this.FormCraftLogic&&0!==this.FormCraftLogic.length)for(var i in this.FormCraftLogic)for(var n in this.FormCraftLogic[i][0]){var s=this.FormCraftLogic[i][0][n][2];"undefined"!=typeof s&&"["===s.slice(0,1)&&s.replace("[","").replace("]","")===a?(this.applyLogic(this.FormCraftLogic[i],t),r=!0):this.FormCraftLogic[i][0][n][0]===a&&(this.applyLogic(this.FormCraftLogic[i],t),r=!0)}if(r===!0&&this.setFormValues(this.setValue),"undefined"==typeof this.finalHideShowList)return!1;for(var o in this.finalHideShowList)if("field"===o.substr(0,5)&&0!==this.finalHideShowList[o].length&&"function"!=typeof this.finalHideShowList[o]){this.finalHideShowList[o]=this.finalHideShowList[o].sort();var l=this.finalHideShowList[o][this.finalHideShowList[o].length-1];switch(l){case"hide":jQuery(".uniq-"+t+" form .form-element-"+o).hasClass("state-hidden")||(jQuery(".uniq-"+t+" form .form-element-"+o).removeClass("state-hidden state-shown over-write"),jQuery(".uniq-"+t+" form .form-element-"+o).slideUp(300).addClass("state-hidden"),jQuery(".uniq-"+t+" form .form-element-"+o).trigger("hideElement"));break;case"show":jQuery(".uniq-"+t+" form .form-element-"+o).hasClass("state-shown")||(jQuery(".uniq-"+t+" form .form-element-"+o).removeClass("state-hidden state-shown over-write"),jQuery(".uniq-"+t+" form .form-element-"+o).slideDown(300).addClass("state-shown"),jQuery(".uniq-"+t+" form .form-element-"+o).trigger("showElement"));break;case"default":jQuery(".uniq-"+t+" form .form-element-"+o).hasClass("default-false")&&jQuery(".uniq-"+t+" form .form-element-"+o).hasClass("state-hidden")&&(jQuery(".uniq-"+t+" form .form-element-"+o).slideDown(300).removeClass("state-hidden state-shown").addClass("state-shown"),jQuery(".uniq-"+t+" form .form-element-"+o).trigger("showElement")),jQuery(".uniq-"+t+" form .form-element-"+o).hasClass("default-true")&&jQuery(".uniq-"+t+" form .form-element-"+o).hasClass("state-shown")&&(jQuery(".uniq-"+t+" form .form-element-"+o).slideUp(300).removeClass("state-hidden state-shown").addClass("state-hidden"),jQuery(".uniq-"+t+" form .form-element-"+o).trigger("hideElement"))}}this.finalHideShowList=[]}},{key:"applyLogic",value:function(e,t){this.finalHideShowList=this.finalHideShowList||[],window.finalEmailsTo=window.finalEmailsTo||[];var a=this.FormCraftLogic.indexOf(e),r=e[0],i=e[1],n=0,s="or"===e[2]?1:r.length;for(var o in r){var l=this.getFieldValue(jQuery(".uniq-"+t+' [data-field-id="'+r[o][0]+'"]'),"string"),d=void 0,u=void 0;switch(r[o][2]=r[o][2]||"","["===r[o][2].slice(0,1)?(d=r[o][2].replace("[","").replace("]",""),d=this.getFieldValue(jQuery('[data-field-id="'+d+'"]'),"string")):d=r[o][2],r[o][1]){case"equal_to":u=4===d.toString().indexOf("-")?this.dateToDifference(d).toString():d,u===l.toString()&&n++;break;case"not_equal_to":u=4===d.toString().indexOf("-")?this.dateToDifference(d).toString():d,u!==l.toString()&&n++;break;case"contains":if(""===d){""!==l&&n++;break}l.toString().indexOf(d)!==-1&&n++;break;case"contains_not":l.toString().indexOf(d)===-1&&n++;break;case"greater_than":u=d.toString().indexOf("-")!==-1?this.dateToDifference(d):d,!isNaN(parseFloat(l))&&parseFloat(l)>parseFloat(u)&&n++;break;case"less_than":u=d.toString().indexOf("-")!==-1?this.dateToDifference(d):d,!isNaN(parseFloat(l))&&parseFloat(l)=a?this.finalHideShowList[n[s]].push("hide"):this.finalHideShowList[n[s]].push("default"));break;case"show_fields":if(!e[i][1])continue;var o=e[i][1].split(",");for(var l in o)"function"!=typeof o[l]&&(this.finalHideShowList[o[l]]=this.finalHideShowList[o[l]]||[],r>=a?this.finalHideShowList[o[l]].push("show"):this.finalHideShowList[o[l]].push("default"));break;case"email_to":if(!e[i][2])continue;var d=e[i][2];r>=a?window.finalEmailsTo.indexOf(t+":"+d)===-1&&window.finalEmailsTo.push(t+":"+d):window.finalEmailsTo.indexOf(t+":"+d)!==-1&&window.finalEmailsTo.splice(window.finalEmailsTo.indexOf(t+":"+d),1);break;case"redirect_to":window.finalRedirect=window.finalRedirect||[],r>=a?window.finalRedirect.push(e[i][2]):window.finalRedirect.indexOf(e[i][2])!==-1&&window.finalRedirect.splice(window.finalRedirect.indexOf(e[i][2]),1);break;case"trigger_integration":if(!e[i][3])continue;window.triggerIntegration=window.triggerIntegration||[],r>=a?window.triggerIntegration.indexOf(e[i][3])===-1&&window.triggerIntegration.push(e[i][3]):window.triggerIntegration.indexOf(e[i][3])!==-1&&window.triggerIntegration.splice(window.triggerIntegration.indexOf(e[i][3]),1);break;case"set_value":this.setValue=this.setValue||[];var u=void 0;e[i][2]&&"["===e[i][2].slice(0,1)?(u=e[i][2].replace("[","").replace("]",""),u=this.getFieldValue(jQuery('[data-field-id="'+u+'"]'),"string")):u=e[i][2],r>=a?this.setValue[e[i][4]]=u:"undefined"!=typeof this.setValue[e[i][4]]&&this.setValue[e[i][4]]===u}}},{key:"saveProgress",value:function(){var e=this.form.find("input, textarea, select").not('.no-save, [type="password"], .stripe-amount-hidden').serialize()+"&id="+this.form.attr("data-id");return(!this.lastSaveProgress||this.lastSaveProgress!==e)&&(this.lastSaveProgress=e,jQuery.ajax({url:FC.ajaxurl,type:"POST",data:"action=formcraft_save_form_progress&"+e,dataType:"json"}))}},{key:"getFieldValue",value:function(e,t){var a=this.parentElement.attr("data-uniq");if(0===jQuery(e).length)return 0;var r=jQuery(e).prop("type"),i=void 0,n=","===jQuery(e).parents(".fc-form").attr("data-decimal")?",":".";switch(r=jQuery(e).is("select")?"select":r,r=jQuery(e).hasClass("hasDatepicker")?"date":r,r=jQuery(e).parent().parent().hasClass("files-list")?"file":r,r=jQuery(e).parent().parent().hasClass("slider-cover")?"slider":r){case"text":case"password":case"select":case"hidden":case"email":case"textarea":i=jQuery(e).val().replace(n,".");break;case"slider":i=jQuery(e).val().replace(n,"."),i.indexOf(" - ")!==-1&&(i=(parseFloat(i.split(" - ")[0])+parseFloat(i.split(" - ")[1]))/2);break;case"radio":case"checkbox":i=[],jQuery(".uniq-"+a+' [name="'+jQuery(e).prop("name")+'"]:checked').each(function(){i.push(jQuery(this).val().replace(n,"."))});break;case"date":var s=jQuery(e).datepicker("getDate");if(null===s)return"";var o=new Date,l=new Date(o.getFullYear(),o.getMonth(),o.getDate());s=null===s?l:s,i=parseInt((s-l)/864e5,10);break;case"file":var d=jQuery(e).attr("name");i=0,jQuery('[name="'+d+'"]').each(function(){""!==jQuery(this).val()&&i++})}if("string"===t)return"object"===("undefined"==typeof i?"undefined":_typeof(i))?i.join(", "):i;if("object"===("undefined"==typeof i?"undefined":_typeof(i))){var u=0;for(var c in i)u+=isNaN(parseFloat(i[c]))?0:parseFloat(i[c]);return u}if("string"==typeof i&&i.indexOf("-")!==-1){var f=i.split("-");return i=(parseFloat(f[0].trim())+parseFloat(f[1].trim()))/2,isNaN(parseFloat(i))?0:parseFloat(i)}return isNaN(parseFloat(i))?0:parseFloat(i)}},{key:"setFormValues",value:function(e){var t=this.form;for(var a in e){var r=0===t.find('[name="'+a+'"]').length?t.find('[name="'+a+'[]"]'):t.find('[name="'+a+'"]'),i=r.prop("type");switch(i=r.is("select")?"select":i,i=r.hasClass("hasDatepicker")?"date":i,i=r.parent().parent().hasClass("files-list")?"file":i,i=r.parents(".field-cover").hasClass("slider-cover")?"slider":i,i=r.parents(".field-cover").hasClass("timepicker-cover")?"timepicker":i){case"text":case"email":case"select":case"hidden":case"textarea":case"date":if(r.attr("id")&&"bind-math"===r.attr("id").substr(0,9))break;e[a]!==r.val()&&r.val(e[a]).trigger("input").trigger("change");break;case"radio":case"checkbox":("string"==typeof e[a]&&""===e[a]||null===e[a]&&t.find('[name="'+a+'[]"]').length>0)&&t.find('[name="'+a+'[]"]').prop("checked",!1).trigger("change"),e[a]="string"==typeof e[a]?[e[a]]:e[a];for(var n in e[a])0===t.find('[name="'+a+'[]"]').length?t.find('[name="'+a+'"][value="'+e[a][n]+'"]').prop("checked",!0).trigger("change"):t.find('[name="'+a+'[]"][value="'+e[a][n]+'"]').prop("checked",!0).trigger("change");break;case"timepicker":r.val(e[a]).trigger("change");var s=e[a].replace(" ",":").split(":");s[0]=""===s[0]||"undefined"==typeof s[0]?"00":s[0],s[1]=""===s[1]||"undefined"==typeof s[1]?"00":s[1],s[2]=""===s[2]||"undefined"==typeof s[2]?"am":s[2],r.parents(".timepicker-cover").find(".time-fields-cover > select").eq(0).val(s[0]),r.parents(".timepicker-cover").find(".time-fields-cover > select").eq(1).val(s[1]),r.parents(".timepicker-cover").find(".time-fields-cover > input").eq(0).val(s[2]);break;case"slider":if(""===e[a])break;if(e[a].indexOf(" - ")!==-1){var o=e[a].split(" - ");o=o.map(function(e){return parseFloat(e.replace(/[^\d.-]/g,""))}),r.parents(".slider-cover").find(".ui-slider-cover > span").slider("values",o)}else e[a]=e[a].replace(r.attr("data-prefix"),"").replace(r.attr("data-suffix"),""),e[a]=isNaN(e[a])?0:parseFloat(e[a].replace(/[^\d.-]/g,"")),r.parents(".slider-cover").find(".ui-slider-cover > span").slider("value",e[a])}}}},{key:"dateToDifference",value:function(e){var t=e.toString().split("-"),a=new Date,r=new Date(a.getFullYear(),a.getMonth(),a.getDate()),i=new Date(t[0],parseInt(t[1],10)-1,t[2]);return parseInt((i-r)/864e5,10)}}]),FormCraft}();jQuery(document).ready(function(){jQuery(".fc-form").each(function(){var e=new FormCraft(jQuery(this));jQuery(this).data("FormCraft",e)}),jQuery(".fc-form-modal").on("shown.bs.fc_modal",function(){var e=jQuery(this).find(".fc-form").attr("data-id");jQuery(this).find(".fc-form").find("textarea").trigger("input"),jQuery.get(FC.ajaxurl+"?action=formcraft3_trigger_view&id="+e)})}),window.setFormValues=function(e,t){e.data("FormCraft").setFormValues(t)},window.datepickerLoad=!1,window.showDebug=window.location.href.indexOf("preview=true")>-1,"https:"===window.location.protocol&&(FC.ajaxurl=FC.ajaxurl.replace("http:","https:"),FC.datepickerLang=FC.datepickerLang.replace("http:","https:")),window.FormCraftSubmitForm=function(e,t,a){var r="",i=jQuery(e);if("all"===t&&i.find(".form-element-type-submit.state-hidden").length===i.find(".form-element-type-submit").length)return!1;i.find(".submit-response").slideUp("fast").html();var n=jQuery(e).hasClass("dont-submit-hidden-true")?i.find(".form-element").not(".state-hidden").find("input, select, textarea").serialize():i.serialize(),s=[];i.find(".form-element.state-hidden").each(function(){s.push(jQuery(this).attr("data-identifier"))}),s=s.join(", ");var o="";if("undefined"!=typeof window.finalEmailsTo)for(var l in window.finalEmailsTo)"function"!=typeof window.finalEmailsTo[l]&&(o=o+","+encodeURIComponent(window.finalEmailsTo[l].substr(window.finalEmailsTo[l].indexOf(":")+1)));"undefined"!=typeof window.finalRedirect&&0!==window.finalRedirect.length&&(r=encodeURIComponent(window.finalRedirect[window.finalRedirect.length-1]));var d=void 0;"undefined"!=typeof window.triggerIntegration&&(d=encodeURIComponent(JSON.stringify(window.triggerIntegration))); var u=void 0;"undefined"!=typeof i.data("FieldLabels")&&(u=encodeURIComponent(JSON.stringify(i.data("FieldLabels"))));var c=n+"&id="+i.attr("data-id")+"&location="+encodeURIComponent(window.location.href)+"&emails="+o+"&hidden="+s+"&redirect="+r+"&type="+t+"&triggerIntegration="+d+"&fieldLabels="+u,f={abort:!1};if("all"===t)i.find(".validation-lenient, .validation-strict").each(function(){if(!jQuery(this).parents(".form-element").hasClass("state-hidden")){var e=jQuery(this).fcValidate();e===!1&&(f.abort=!0)}});else{var p=t-1;i.find(".form-page-"+p+" .validation-lenient, .validation-strict").each(function(){if(!jQuery(this).parents(".form-element").hasClass("state-hidden")&&0!==jQuery(this).parents(".form-page-"+p).length){var e=jQuery(this).fcValidate();e===!1&&(f.abort=!0)}})}if("all"===t&&jQuery(document).trigger("formcraft_submit_trigger",[i,c,f]),f.abort===!0){if(0===i.find(".error-field").length)return!1;if(_helpers2["default"].isElementInViewport(i.find(".error-field").first())===!1){var h=i.find(".error-field").first().offset().top;i.parents(".fc-form-modal").length?(h=i.parents(".fc-form-modal").scrollTop()+h-(i.height()+130),i.parents(".fc-form-modal").animate({scrollTop:i.find(".error-field").first().position().top},600)):i.parents(".fc-sticky").length?jQuery(".fc-sticky").animate({scrollTop:i.find(".error-field").first().position().top-30},600):i.parent().find(".fc-pagination.fixed").length?jQuery("html, body").animate({scrollTop:h-200},600):jQuery("html, body").animate({scrollTop:h-120},600)}return"undefined"!=typeof a&&a(!1),!1}i.find(".submit-cover").addClass("disabled"),i.find(".form-element").removeClass("error-field"),"all"===t&&i.find(".submit-button").attr("disabled",!0);var m=i;jQuery.ajax({url:FC.ajaxurl,type:"POST",timeout:12e4,data:"action=formcraft3_form_submit&"+c,dataType:"json"}).done(function(e){if(i=m,e.debug){if(e.debug.failed&&showDebug===!0)for(var t in e.debug.failed)globalNotification("error",e.debug.failed[t]);if(e.debug.success&&showDebug===!0)for(var r in e.debug.success)globalNotification("success","check "+e.debug.success[r])}if(e.failed){if(0!==i.parents(".fc-form-modal").length&&(setTimeout(function(){i.addClass("shake")},600),setTimeout(function(){i.removeClass("shake")},1100)),i.find(".validation-lenient").addClass("validation-strict").removeClass(".validation-lenient"),i.find(".submit-response").html(''+e.failed+"").slideDown("fast"),e.errors)for(var n in e.errors)i.find(".form-element-"+n).addClass("error-field"),i.find(".form-element-"+n+" .error").text(e.errors[n]);if(0!==i.find(".error-field").length&&_helpers2["default"].isElementInViewport(i.find(".error-field").first())===!1){var s=i.find(".error-field").first().offset().top;i.parents(".fc-form-modal").length?(s=i.parents(".fc-form-modal").scrollTop()+s-(i.height()+130),i.parents(".fc-form-modal").animate({scrollTop:i.find(".error-field").first().position().top},600)):i.parents(".fc-sticky").length?jQuery(".fc-sticky").animate({scrollTop:i.find(".error-field").first().position().top-30},600):i.parent().find(".fc-pagination.fixed").length?jQuery("html, body").animate({scrollTop:s-200},600):jQuery("html, body").animate({scrollTop:s-120},600)}}else if("undefined"!=typeof e.success&&(i.append('
    check
    '),i.find(".final-success > span").html(e.success),i.addClass("submitted"),i.find(".final-success").slideDown(800,function(){}),i.find(".form-page").slideUp(800,function(){i.find(".form-element").remove()}),0===i.parents(".fc-form-modal").length&&0===i.parents(".fc-sticky").length&&jQuery("html, body").animate({scrollTop:i.offset().top-100},800),jQuery(document).trigger("formcraft_submit_result",[i,e]),e.redirect)){var o=parseInt(i.attr("data-delay"),10);o=isNaN(o)?2:o,o=Math.max(0,o),setTimeout(function(){window.location.assign(e.redirect)},1e3*o)}"undefined"!=typeof a&&a(e,i)}).fail(function(){jQuery(e).find(".response").text("Connection error"),"undefined"!=typeof a&&a(!1)}).always(function(e){jQuery(document).trigger("formcraft_submit_success_trigger",[i,e]),i.find(".submit-cover").addClass("enabled"),i.find(".submit-cover").removeClass("disabled"),"all"===t&&i.find(".submit-button").removeAttr("disabled")})},jQuery(document).ready(function(){_helpers2["default"].isMobile()===!0&&jQuery('.email-cover input[type="text"]').prop("type","email"),1===jQuery("#fc-form-preview").length&&jQuery("body").addClass("formcraft-css"),jQuery("body").on("click",".fc-trigger-close",function(){jQuery(".fc-sticky").each(function(){jQuery(this).hasClass("show")&&jQuery(this).parent().find('[data-toggle="fc-sticky"]').trigger("click")})}),jQuery(".form-element.default-true").hide(),jQuery(".fc-form").removeClass("fc-temp-class"),jQuery(".fc-form .form-element.default-true").addClass("state-hidden"),jQuery("body").on("click",'.field-cover div [class^="icon-"]',function(){jQuery(this).parent().find("input").focus()}),jQuery("[href]").each(function(){var e=jQuery(this).attr("href");if(e.indexOf("form-view/")!==-1){var t=e.split("form-view/");if(jQuery('.fc-form-modal .fc-form[data-id="'+t[t.length-1]+'"]').length){var a=jQuery('.fc-form-modal .fc-form[data-id="'+t[t.length-1]+'"]').first(),r=a.parents(".fc-form-modal").attr("id");jQuery(this).removeAttr("href"),jQuery(this).attr("data-toggle","fc_modal"),jQuery(this).attr("data-target","#"+r)}}}),jQuery(".fc-form-modal .form-live").each(function(){if(""!==jQuery(this).attr("data-bind")){var e=jQuery(this).attr("data-uniq");jQuery(jQuery(this).attr("data-bind")).each(function(){jQuery(this).attr("data-toggle","fc_modal"),jQuery(this).attr("data-target","#modal-"+e)})}}),jQuery(".fc-form").each(function(){var e=jQuery(this);jQuery(document).trigger("formcraft_math_change",[e])}),jQuery("body").on("focus",'.password-cover input[type="password"], .address-cover input[type="text"] ,.oneLineText-cover input[type="text"],.datepicker-cover input[type="text"],.email-cover input[type="text"],.email-cover input[type="email"],.textarea-cover textarea,.dropdown-cover select,.matrix-cover input,.star-cover input,.thumb-cover input',function(){jQuery(this).parents(".field-cover").addClass("has-focus")}),jQuery("body").on("blur",'.password-cover input[type="password"], .address-cover input[type="text"] ,.oneLineText-cover input[type="text"],.datepicker-cover input[type="text"],.email-cover input[type="text"],.email-cover input[type="email"],.textarea-cover textarea,.dropdown-cover select,.matrix-cover input,.star-cover input,.thumb-cover input',function(){jQuery(this).parents(".field-cover").removeClass("has-focus")}),jQuery("body").on("change",".dropdown-cover select",function(){jQuery(this).find("option:checked").length>0&&""!==jQuery(this).find("option:checked").text()?jQuery(this).parents(".field-cover").addClass("has-input"):jQuery(this).parents(".field-cover").removeClass("has-input")}),jQuery("body").on("input",'.address-cover input[type="text"], .oneLineText-cover input[type="text"],.password-cover input[type="password"],.datepicker-cover input[type="text"],.email-cover input[type="text"],.email-cover input[type="email"], .textarea-cover textarea',function(){jQuery(this).val().length>0||"undefined"!=typeof jQuery(this).attr("placeholder")&&jQuery(this).attr("placeholder").length>0?jQuery(this).parents(".field-cover").addClass("has-input"):jQuery(this).parents(".field-cover").removeClass("has-input")}),jQuery('.oneLineText-cover input[type="text"],.datepicker-cover input[type="text"], .email-cover input[type="text"], .email-cover input[type="email"], .textarea-cover textarea').trigger("input"),jQuery('.customText-cover input[type="hidden"],.timepicker-cover input[type="hidden"],.slider-cover input[type="hidden"],.fileupload-cover input[type="hidden"],.checkbox-cover input[type="radio"],.star-cover input[type="radio"],.thumb-cover input[type="radio"],.checkbox-cover input[type="checkbox"],.dropdown-cover select').trigger("change"),setTimeout(function(){jQuery(".time-fields-cover > select").first().trigger("change")},500),jQuery(".fc-pagination").each(function(){jQuery(this).find(".pagination-trigger").eq(0).addClass("active")}),jQuery(".fc-form .form-page-0").addClass("active"),jQuery("body").on("change",".checkbox-cover label input,.update-label label input",function(){if(jQuery(this).is(":checked")){var e=jQuery(this).attr("name");jQuery('[name="'+e+'"]').parent().removeClass("active"),jQuery(this).parent().addClass("active")}}),_helpers2["default"].isiOS()&&(jQuery("body").on("touchstart",".star-cover label, .thumb-cover label",function(){event.preventDefault(),jQuery(this).trigger("click")}),jQuery("body").on("touchstart",'[data-toggle="fc_modal"]',function(e){e.preventDefault(),jQuery(this).trigger("click")}),jQuery("body").on("touchstart",'[data-toggle="fc-sticky"]',function(){event.preventDefault(),jQuery(this).trigger("click")})),jQuery("body").on("change",".star-cover label input",function(){if(jQuery(this).is(":checked")){var e=jQuery(this).attr("name");jQuery('[name="'+e+'"]').parent().removeClass("active"),jQuery(this).parent().addClass("active");var t=jQuery(this).parent().index();jQuery(this).parent().parent().find("label").removeClass("fake-click"),jQuery(this).parent().parent().find("label").slice(0,t+1).addClass("fake-click")}}),jQuery(".update-label label.active").removeClass("active"),jQuery(".powered-by").each(function(){var e=jQuery(this).parent().find(".fc-form").outerWidth();jQuery(this).css("width",e+" px")}),setTimeout(function(){jQuery(".fc-form-modal").appendTo("body")},500),jQuery(".formcraft-css.placement-right").appendTo("body"),jQuery(".formcraft-css.placement-left").appendTo("body"),jQuery(".body-append").appendTo("body"),setTimeout(function(){jQuery(".image_button_cover a").each(function(){var e=parseInt(jQuery(this).outerWidth(),10)/2+jQuery(this).outerHeight();jQuery(this).css("top","-"+e+"px")})},100),setTimeout(function(){jQuery(".image_button_cover a").each(function(){jQuery(this).parents(".image_button_cover").addClass("now-show")})},400),jQuery("body").on("click",'[data-toggle="fc-sticky"]',function(){var e=jQuery(jQuery(this).attr("data-target")),t=jQuery(jQuery(this).attr("data-target")).parent().find(".fc-sticky-button");if(e.hasClass("show"))e.addClass("hiding"),t.addClass("showing"),setTimeout(function(){e.removeClass("show hiding"),t.removeClass("hide showing")},400);else{var a=e.find(".fc-form").attr("data-id");jQuery.get(FC.ajaxurl+"?action=formcraft3_trigger_view&id="+a),e.addClass("show"),t.addClass("hide")}}),jQuery(document).keyup(function(e){jQuery(".fc-sticky").each(function(){jQuery(this).hasClass("show")&&27===e.which&&jQuery(this).parent().find('[data-toggle="fc-sticky"]').trigger("click")})});var e=.8*parseInt(jQuery(window).height(),10);jQuery(".fc-sticky").css("max-height",e+"px"),jQuery(document).mouseup(function(e){var t=jQuery(".fc-sticky"),a=jQuery(".fc-datepicker"),r=jQuery(".fc-sticky-button");t.is(e.target)||0!==t.has(e.target).length||a.is(e.target)||0!==a.has(e.target).length||r.is(e.target)||jQuery(".fc-sticky").each(function(){jQuery(this).hasClass("show")&&jQuery(this).parent().find('[data-toggle="fc-sticky"]').trigger("click")})}),setTimeout(function(){jQuery(".fc-sticky").each(function(){if(jQuery(this).hasClass("fc-sticky-right")||jQuery(this).hasClass("fc-sticky-left")){var t=jQuery(this).find(".fc-form").height();t=Math.min(e,t),jQuery(this).css("margin-top","-"+t/2+"px"),jQuery(this).find(".fc-form").addClass("calculated")}})},500),jQuery(".fc-form-modal").each(function(){if(jQuery(this).attr("data-auto")&&!isNaN(parseFloat(jQuery(this).attr("data-auto")))){var e=jQuery(this);setTimeout(function(){e.fc_modal("show")},1e3*parseFloat(jQuery(this).attr("data-auto")))}if(jQuery(this).find(".pagination-trigger").length>1){var t=jQuery(this).find(".fc_close").parents(".fc_modal-dialog").find(".fc-pagination-cover").height(),a=jQuery(this).find(".fc_close").parents(".fc_modal-dialog").find(".fc-form").width();jQuery(this).find(".fc_close").css({"margin-top":t,left:"50%","margin-left":a/2-30})}}),jQuery(".fc-sticky").each(function(){if(jQuery(this).attr("data-auto")&&!isNaN(parseFloat(jQuery(this).attr("data-auto")))){var e=jQuery(this);setTimeout(function(){e.hasClass("show")||e.parent().find(".fc-sticky-button").trigger("click")},1e3*parseFloat(jQuery(this).attr("data-auto")))}}),jQuery(".star-cover label").hover(function(){var e=jQuery(this).index();jQuery(this).parent().find("label").slice(0,e+1-jQuery(this).prevAll(".formcraft-icon").length).addClass("fake-hover"),jQuery(this).parent().find("label").slice(e+1-jQuery(this).prevAll(".formcraft-icon").length,jQuery(this).parent().find("label").length).addClass("fake-empty")},function(){jQuery(this).parent().find("label").removeClass("fake-hover fake-empty")}),/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)&&jQuery('.datepicker-cover input[type="text"]').attr("readonly","readonly"),setTimeout(function(){jQuery("body").on("blur change",".fc-form .validation-lenient",function(e){jQuery(this).fcValidate()===!1&&jQuery(this).addClass("validation-strict").removeClass("validation-lenient")})},1e3),jQuery("body").on("keyup change input",".fc-form .validation-strict",function(){jQuery(this).fcValidate()===!1?jQuery(this).addClass("validation-strict").removeClass("validation-lenient"):jQuery(this).addClass("validation-lenient").removeClass("validation-strict")})})},function(e,t,a){var r,i,n;!function(a,s){i=[t,e],r=s,n="function"==typeof r?r.apply(t,i):r,!(void 0!==n&&(e.exports=n))}(void 0,function(e,t){"use strict";function a(e){function t(){var t=window.getComputedStyle(e,null);p=t.overflowY,"vertical"===t.resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),f="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(f)&&(f=0),i()}function a(t){var a=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=a,p=t,c&&(e.style.overflowY=t),r()}function r(){var t=window.pageYOffset,a=document.body.scrollTop,r=e.style.height;e.style.height="auto";var i=e.scrollHeight+f;return 0===e.scrollHeight?void(e.style.height=r):(e.style.height=i+"px",h=e.clientWidth,document.documentElement.scrollTop=t,void(document.body.scrollTop=a))}function i(){var t=e.style.height;r();var i=window.getComputedStyle(e,null);if(i.height!==e.style.height?"visible"!==p&&a("visible"):"hidden"!==p&&a("hidden"),t!==e.style.height){var n=s("autosize:resized");e.dispatchEvent(n)}}var o=void 0===arguments[1]?{}:arguments[1],l=o.setOverflowX,d=void 0===l||l,u=o.setOverflowY,c=void 0===u||u;if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!n.has(e)){var f=null,p=null,h=e.clientWidth,m=function(){e.clientWidth!==h&&i()},y=function(t){window.removeEventListener("resize",m,!1),e.removeEventListener("input",i,!1),e.removeEventListener("keyup",i,!1),e.removeEventListener("autosize:destroy",y,!1),e.removeEventListener("autosize:update",i,!1),n["delete"](e),Object.keys(t).forEach(function(a){e.style[a]=t[a]})}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",y,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",i,!1),window.addEventListener("resize",m,!1),e.addEventListener("input",i,!1),e.addEventListener("autosize:update",i,!1),n.add(e),d&&(e.style.overflowX="hidden",e.style.wordWrap="break-word"),t()}}function r(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName){var t=s("autosize:destroy");e.dispatchEvent(t)}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName){var t=s("autosize:update");e.dispatchEvent(t)}}var n="function"==typeof Set?new Set:function(){var e=[];return{has:function(t){return Boolean(e.indexOf(t)>-1)},add:function(t){e.push(t)},"delete":function(t){e.splice(e.indexOf(t),1)}}}(),s=function(e){return new Event(e)};try{new Event("test")}catch(o){s=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}var l=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?(l=function(e){return e},l.destroy=function(e){return e},l.update=function(e){return e}):(l=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return a(e,t)}),e},l.destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],r),e},l.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e}),t.exports=l})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=function(e){e.fn.fcValidate=function(){var e=void 0,t=void 0,a=void 0,r=void 0,i=void 0;jQuery(this).attr("data-allow-spaces")&&"true"===jQuery(this).attr("data-allow-spaces")?(e=/^[A-Za-z ]+$/,r=/^[0-9 ]+$/,t=/^[0-9A-Za-z ]+$/,i=/(http|https):\/\/(\w+:{0,1}\w*)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%!\-\/]))?/,a=/^([a-zA-Z0-9_\+.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,6})+$/):(e=/^[A-Za-z]+$/,r=/^[0-9]+$/,t=/^[0-9A-Za-z]+$/,i=/(http|https):\/\/(\w+:{0,1}\w*)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%!\-\/]))?/,a=/^([a-zA-Z0-9_\+.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,6})+$/);var n=jQuery(this).parents("form").attr("data-id"),s=window["FC_Validation_"+n],o=jQuery(this).val();if(jQuery(this).is('[type="checkbox"]')||jQuery(this).is('[type="radio"]')){var l=jQuery(this).attr("name");o=jQuery('[name="'+l+'"]:checked').val(),o="undefined"==typeof o?"":o}o=o||"";var d=jQuery(this);if(d.attr("data-is-required")&&"true"===d.attr("data-is-required")&&""===o.trim())return d.parents(".form-element").find(".error").text(s.is_required),d.parents(".form-element").addClass("error-field"),!1;if(jQuery(this).attr("data-input-mask")&&""!==jQuery(this).attr("data-input-mask")&&jQuery(this).hasClass("mask-invalid")&&""!==o)return d.parents(".form-element").find(".error").text(s.is_invalid),d.parents(".form-element").addClass("error-field"),!1;if(jQuery(this).attr("data-is-required")&&"false"===jQuery(this).attr("data-is-required")&&""===o.trim())return d.parents(".form-element").find(".error").text(""),d.parents(".form-element").removeClass("error-field"),!0;if(jQuery(this).attr("data-min-char")&&jQuery(this).attr("data-min-char")>o.length)return d.parents(".form-element").find(".error").text(s.min_char.replace("[x]",jQuery(this).attr("data-min-char"))),d.parents(".form-element").addClass("error-field"),!1;if(jQuery(this).attr("data-max-char")&&jQuery(this).attr("data-max-char")=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}};t["default"]=a}]),function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):e(jQuery||Zepto)}(function(e){var t=function(t,a,r){var i={invalid:[],getCaret:function(){try{var e,a=0,r=t.get(0),n=document.selection,s=r.selectionStart;return n&&navigator.appVersion.indexOf("MSIE 10")===-1?(e=n.createRange(),e.moveStart("character",-i.val().length),a=e.text.length):(s||"0"===s)&&(a=s),a}catch(o){}},setCaret:function(e){try{if(t.is(":focus")){var a,r=t.get(0);r.setSelectionRange?(r.focus(),r.setSelectionRange(e,e)):(a=r.createTextRange(),a.collapse(!0),a.moveEnd("character",e),a.moveStart("character",e),a.select())}}catch(i){}},events:function(){t.on("keydown.mask",function(e){t.data("mask-keycode",e.keyCode||e.which)}).on(e.jMaskGlobals.useInput?"input.mask":"keyup.mask",i.behaviour).on("paste.mask drop.mask",function(){setTimeout(function(){t.keydown().keyup()},100)}).on("change.mask",function(){t.data("changed",!0)}).on("blur.mask",function(){o===i.val()||t.data("changed")||t.trigger("change"),t.data("changed",!1)}).on("blur.mask",function(){o=i.val()}).on("focus.mask",function(t){r.selectOnFocus===!0&&e(t.target).select()}).on("focusout.mask",function(){r.clearIfNotMatch&&!n.test(i.val())&&i.val("")})},getRegexMask:function(){for(var e,t,r,i,n,o,l=[],d=0;d0?(t[i]()!==e&&t[i](e),a=t):a=t[i](),a},getMCharsBeforeCount:function(e,t){for(var r=0,i=0,n=a.length;i-1&&f>-1}):(n=c-1,o=function(){return u0,[n,e,t,i.invalid,r])}};t=e(t);var n,s=this,o=i.val();a="function"==typeof a?a(i.val(),void 0,t,r):a,s.mask=a,s.options=r,s.remove=function(){var e=i.getCaret();return i.destroyEvents(),i.val(s.getCleanVal()),i.setCaret(e-i.getMCharsBeforeCount(e)),t},s.getCleanVal=function(){return i.getMasked(!0)},s.getMaskedVal=function(e){return i.getMasked(!1,e)},s.init=function(a){if(a=a||!1,r=r||{},s.clearIfNotMatch=e.jMaskGlobals.clearIfNotMatch,s.byPassKeys=e.jMaskGlobals.byPassKeys,s.translation=e.extend({},e.jMaskGlobals.translation,r.translation),s=e.extend(!0,{},s,r),n=i.getRegexMask(),a===!1){r.placeholder&&t.attr("placeholder",r.placeholder),t.data("mask")&&t.attr("autocomplete","off"),i.destroyEvents(),i.events();var o=i.getCaret();i.val(i.getMasked()),i.setCaret(o+i.getMCharsBeforeCount(o,!0))}else i.events(),i.val(i.getMasked())},s.init(!t.is("input"))};e.maskWatchers={};var a=function(){var a=e(this),i={},n="data-mask-",s=a.attr("data-mask");if(a.attr(n+"reverse")&&(i.reverse=!0),a.attr(n+"clearifnotmatch")&&(i.clearIfNotMatch=!0),"true"===a.attr(n+"selectonfocus")&&(i.selectOnFocus=!0),r(a,s,i))return a.data("mask",new t(this,s,i))},r=function(t,a,r){r=r||{};var i=e(t).data("mask"),n=JSON.stringify,s=e(t).val()||e(t).text();try{return"function"==typeof a&&(a=a(s)),"object"!=typeof i||n(i.options)!==n(r)||i.mask!==a}catch(o){}},i=function(e){var t,a=document.createElement("div");return e="on"+e,t=e in a,t||(a.setAttribute(e,"return;"),t="function"==typeof a[e]),a=null,t};e.fn.mask=function(a,i){i=i||{};var n=this.selector,s=e.jMaskGlobals,o=s.watchInterval,l=i.watchInputs||s.watchInputs,d=function(){if(r(this,a,i))return e(this).data("mask",new t(this,a,i))};return e(this).each(d),n&&""!==n&&l&&(clearInterval(e.maskWatchers[n]),e.maskWatchers[n]=setInterval(function(){e(document).find(n).each(d)},o)),this},e.fn.masked=function(e){return this.data("mask").getMaskedVal(e)},e.fn.unmask=function(){return clearInterval(e.maskWatchers[this.selector]),delete e.maskWatchers[this.selector],this.each(function(){var t=e(this).data("mask");t&&t.remove().removeData("mask")})},e.fn.cleanVal=function(){return this.data("mask").getCleanVal()},e.applyDataMask=function(t){t=t||e.jMaskGlobals.maskElements;var r=t instanceof e?t:e(t);r.filter(e.jMaskGlobals.dataMaskAttr).each(a)};var n={maskElements:"input,td,span,div",dataMaskAttr:"*[data-mask]",dataMask:!0,watchInterval:300,watchInputs:!0,useInput:i("input"),watchDataMask:!1,byPassKeys:[9,16,17,18,36,37,38,39,40,91],translation:{0:{pattern:/\d/},9:{pattern:/\d/,optional:!0},"#":{pattern:/\d/,recursive:!0},A:{pattern:/[a-zA-Z0-9]/},S:{pattern:/[a-zA-Z]/}}};e.jMaskGlobals=e.jMaskGlobals||{},n=e.jMaskGlobals=e.extend(!0,{},n,e.jMaskGlobals),n.dataMask&&e.applyDataMask(),setInterval(function(){e.jMaskGlobals.watchDataMask&&e.applyDataMask()},n.watchInterval)}),function(e){function t(e,t){if(!(e.originalEvent.touches.length>1)){e.preventDefault();var a=e.originalEvent.changedTouches[0],r=document.createEvent("MouseEvents");r.initMouseEvent(t,!0,!0,window,1,a.screenX,a.screenY,a.clientX,a.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(r)}}if(e.support.touch="ontouchend"in document,e.support.touch){var a,r=e.ui.mouse.prototype,i=r._mouseInit,n=r._mouseDestroy;r._touchStart=function(e){var r=this;!a&&r._mouseCapture(e.originalEvent.changedTouches[0])&&(a=!0,r._touchMoved=!1,t(e,"mouseover"),t(e,"mousemove"),t(e,"mousedown"))},r._touchMove=function(e){a&&(this._touchMoved=!0,t(e,"mousemove"))},r._touchEnd=function(e){a&&(t(e,"mouseup"),t(e,"mouseout"),this._touchMoved||t(e,"click"),a=!1)},r._mouseInit=function(){var t=this;t.element.bind({touchstart:e.proxy(t,"_touchStart"),touchmove:e.proxy(t,"_touchMove"),touchend:e.proxy(t,"_touchEnd")}),i.call(t)},r._mouseDestroy=function(){var t=this;t.element.unbind({touchstart:e.proxy(t,"_touchStart"),touchmove:e.proxy(t,"_touchMove"),touchend:e.proxy(t,"_touchEnd")}),n.call(t)}}}(jQuery);