Your IP : 216.73.216.164


Current Path : /var/www/html/soar-backup/wp-content/plugins/formcraft3/dist/
Upload File :
Current File : /var/www/html/soar-backup/wp-content/plugins/formcraft3/dist/form.min.js

!function(e){function t(i){if(r[i])return r[i].exports;var a=r[i]={exports:{},id:i,loaded:!1};return e[i].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function i(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){e="error"===e?"red":"green",jQuery("#notification-panel").removeClass("red green").addClass(e).html(t)}var s="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},o=function(){function e(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,r,i){return r&&e(t.prototype,r),i&&e(t,i),t}}(),u=r(1),l=i(u),c=r(2),d=(i(c),r(3)),p=i(d),h=window.FC.fct,f=r(4).Parser,y=new f;"function"!=typeof Object.assign&&(Object.assign=function(e){if(null===e)throw new TypeError("Cannot convert undefined or null to object");e=Object(e);for(var t=1;t<arguments.length;t++){var r=arguments[t];if(null!==r)for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(e[i]=r[i])}return e});var m=function(){function e(t){a(this,e),this.form=t,this.formID=t.attr("data-id"),this.parentElement=t.parents(".form-live");var r=this;this.setupAutocomplete(),this.setupInputMasks(),this.setupCharacterCount(),this.setupSliderFields(),this.setupDatepickerFields(),this.setupFileUploadFields(),this.setupTimepickerFields(),this.setupAddressFields(),t.find(".star-cover label").removeClass("fake-click fake-hover active"),this.form.find(".textarea-cover textarea").each(function(){(0,l["default"])(this)}).on("input",function(){var e=document.createEvent("Event");e.initEvent("autosize:update",!0,!1),this.dispatchEvent(e)}),jQuery().tooltip&&(p["default"].isMobile()===!0?this.parentElement.find('.fc-form [data-toggle="tooltip"]').tooltip({container:".fc-form",placement:"top"}):this.parentElement.find('.fc-form [data-toggle="tooltip"]').tooltip({container:".fc-form"})),jQuery(".formcraft-icon").each(function(){""!==jQuery(this).text()&&"no-icon"!==jQuery(this).text()||jQuery(this).remove()}),this.prepareMathFormulas(),jQuery(this.form).on("submit",function(e){e.preventDefault(),FormCraftSubmitForm(r.form,"all")}),jQuery(this.form).find("span.error").text(""),setTimeout(function(){jQuery(this.form).find(".form-element.error-field").removeClass("error-field")},300),r.form.hasClass("save-form-true")&&setInterval(function(){return r.saveProgress()},3e3),this.FormCraftLogic=window.formcraftLogic[this.formID]?window.formcraftLogic[this.formID]:null,t.on("input",'.oneLineText-cover input[type="text"], .address-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(){r.setValue=[],r.checkIfApplyMath(jQuery(this)),r.checkIfApplyLogic(jQuery(this))}),t.on("change",'.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',function(){r.setValue=[],r.checkIfApplyMath(jQuery(this)),r.checkIfApplyLogic(jQuery(this))}),t.on("change",'.checkbox-cover input[type="checkbox"]',function(){var e=t.data("FieldLabels")||{},r=jQuery(this).attr("name").replace(/[\[\]']+/g,"")+".label";e[r]=[],jQuery(this).parents(".checkbox-cover").find('input[type="checkbox"]').each(function(){if(jQuery(this).prop("checked")){var t=jQuery(this).parent().find("span").html().replace(/(<([^>]+)>)/gi,"");e[r].push(t)}}),t.data("FieldLabels",e)}),t.on("change",'.checkbox-cover input[type="radio"]',function(){var e=t.data("FieldLabels")||{},r=jQuery(this).attr("name").replace(/[\[\]']+/g,"")+".label";e[r]=[],jQuery(this).parents(".checkbox-cover").find('input[type="radio"]').each(function(){if(jQuery(this).prop("checked")){var t=jQuery(this).parent().find("span").html().replace(/(<([^>]+)>)/gi,"");e[r].push(t)}}),t.data("FieldLabels",e)}),t.on("change",".dropdown-cover select",function(){var e=t.data("FieldLabels")||{},r=jQuery(this).attr("name").replace(/[\[\]']+/g,"")+".label";e[r]=[],e[r].push(jQuery(this).find("option:selected").text()),t.data("FieldLabels",e)}),setTimeout(function(){var e={};r.form.parents(".form-live").find(".pre-populate-data").each(function(){var t=jQuery(this).text().replace(/“/g,'"').replace(/”/g,'"').replace(/″/g,'"');if(""===t)return!0;t=jQuery.parseJSON(t);for(var r in t)(""===t[r]||"object"===s(t[r])&&""===t[r][0])&&delete t[r];e=Object.assign(e,t)}),r.setFormValues(e),setTimeout(function(){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"],.star-cover input[type="radio"],.thumb-cover input[type="radio"],.dropdown-cover select').trigger("change")},0)},0),t.keypress(function(e){13===e.which&&t.hasClass("disable-enter-true")===!0&&"textarea"!=e.target.type&&e.preventDefault()}),this.form.find(".required_field").hide(),this.form.find('[make-read-only="true"]').attr("readonly",!0).addClass("is-read-only")}return o(e,[{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,r){t.push(r.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")}),e.addEventListener("awesomplete-open",function(t){jQuery(e).parents(".form-element").addClass("index-true")}),e.addEventListener("awesomplete-close",function(t){jQuery(e).parents(".form-element").removeClass("index-true")})})},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")||"",r=jQuery(this).find("> span").attr("data-suffix")||"";e.create=function(){e.range===!0?jQuery(this).find(".ui-slider-range").eq(0).append('<span class="ui-slider-handle-nos">0</span>'):jQuery(this).find("span.ui-slider-handle").eq(0).append('<span class="ui-slider-handle-nos">0</span>'),jQuery(this).parents(".slider-cover").find('input[type="hidden"]').val("").trigger("change").attr("data-prefix",t).attr("data-suffix",r)},e.change=e.slide=function(e,i){jQuery(this).parents(".ui-slider-cover").find(".ui-slider-handle-nos").show();var a=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,u=void 0,l=void 0,c=void 0,d=void 0;i.values?(o=i.values[0]+" - "+i.values[1],c=i.values[0].toString().replace(/[.]/g,n).replace(/\B(?=(\d{3})+(?!\d))/g,a),u=i.values[1].toString().replace(/[.]/g,n).replace(/\B(?=(\d{3})+(?!\d))/g,a),d=i.values[0],l=i.values[1],i.values[0]=t+i.values[0]+r,i.values[1]=t+i.values[1]+r,s=i.values[0]+" - "+i.values[1]):(o=i.value,s=parseFloat(i.value),c=s.toString().replace(/[.]/g,n).replace(/\B(?=(\d{3})+(?!\d))/g,a),d=s,u="",l="",s=t+s+r),jQuery(this).parents(".slider-cover").find("input").val(o).trigger("change"),s=s.replace(d,c).replace(l,u),jQuery(this).parents(".slider-cover").find(".ui-slider-handle-nos").text(s)},jQuery(this).html("<span></span>"),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 r=void 0;""!==jQuery(this).attr("data-date-min")&&parseInt(jQuery(this).attr("data-date-min"),10).toString()===jQuery(this).attr("data-date-min")?(r=new Date,r.setDate(r.getDate()+parseInt(jQuery(this).attr("data-date-min"),10))):r=new Date(jQuery(this).attr("data-date-min-alt")),e.minDate=r}if(jQuery(this).attr("data-date-days")){var i=jQuery.map(jQuery.parseJSON(jQuery(this).attr("data-date-days")),function(e,t){if(e===!0)return t.toString()});e.beforeShowDay=function(e){return i.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").each(function(){var e=jQuery(this).attr("data-allow-extensions").replace(/ /g,"").split(",").map(function(e){return"."+e}).join(",");jQuery(this).attr("accept",e)}),this.form.find(".fileupload-cover .button-file input").fileupload({dataType:"json",add:function(e,t){var r=jQuery(this).parents("form").data("FormCraft");if(r.disableSubmit(),""!==jQuery(this).attr("data-allow-extensions")&&jQuery(this).attr("data-allow-extensions").indexOf(",")){var i=jQuery(this).attr("data-allow-extensions").replace(/ /g,"").split(",");for(var a in t.files){var n=t.files[a].name.split("."),s=n[n.length-1];if(i.indexOf(s.toLowerCase())===-1)return"undefined"==typeof window["FC_Validation_"+r.formID].is_invalid?alert("Invalid extension"):alert(window["FC_Validation_"+r.formID].is_invalid),r.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"undefined"==typeof window["FC_Validation_"+r.formID].max_files?alert("Reached max files allowed"):alert(window["FC_Validation_"+r.formID].max_files.replace("[x]",parseInt(jQuery(this).attr("data-max-files"),10))),r.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_"+r.formID].max_file_size?alert("File too big"):alert(window["FC_Validation_"+r.formID].max_file_size.replace("[x]",o)),r.enableSubmit(),!1}var u=jQuery(this).parents(".fc-form").attr("data-id");t.url=""+FC.ajaxurl+(FC.ajaxurl.indexOf("?")===-1?"?":"&")+"action=formcraft3_file_upload&id="+u;var l=jQuery(this).parent().parent();0===l.find(".files-list").length&&l.append('<ul class="files-list"></ul>'),l.find(".files-list").append("<li><div></div></li>"),t.listPosition=l.find("li").length-1,l.find(".files-list li").eq(t.listPosition).slideDown(100),t.timeout=0,window.jqXHR=t.submit()},progress:function e(t,r){var i=jQuery(this).parent().parent(),e=parseInt(r.loaded/r.total*100,10);i.find(".files-list li").eq(r.listPosition).find("div").css("width",e+"%")},done:function(e,t){var r=jQuery(this).parents("form").data("FormCraft");r.enableSubmit();var i=jQuery(this).parent().parent();if(t.result.success){var a=jQuery(this).attr("data-name-list");i.find(".files-list li").eq(t.listPosition).find("div").text(t.result.file_name),i.find(".files-list li").eq(t.listPosition).append('<span class="delete-file" title="Delete File">&times;</span><input type="hidden" data-field-id="'+a+'" name="'+a+'[]" value="'+t.result.success+'"/>'),i.find(".files-list li").eq(t.listPosition).find("input").trigger("change")}else t.result.failed&&(i.find(".files-list li").eq(t.listPosition).remove(),showDebug===!0&&n("error",t.result.debug))}}),this.form.find(".fileupload-cover").on("click",".files-list .delete-file",function(e){e.preventDefault();var t=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="+t+"&formcraft3_wpnonce="+jQuery("#formcraft3_wpnonce").val(),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(),r=e.find("select").eq(1).val(),i=e.find("input").val();jQuery(this).parent().hasClass("hide-meridian-true")?e.parent().find('input[type="hidden"]').val(t+":"+r).trigger("change"):e.parent().find('input[type="hidden"]').val(t+":"+r+" "+i).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(h.needAPIKey).css("height","auto").css("color","red"):void jQuery(".address-picker-field").each(function(){var e=this,t=jQuery(this);if(jQuery(this).on("click",function(e){p["default"].isiOS()&&(e.preventDefault(),t.focus())}),!jQuery(this).is("[class*=tt-]")){var r=jQuery(this).attr("data-map-restrict")||"";"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,autocompleteService:{componentRestrictions:{country:r}}})),jQuery(this).typeahead(null,{displayKey:"description",source:jQuery(this).data("addressField").ttAdapter()}),jQuery(this).on("typeahead:selected",jQuery(this).data("addressField").updateMap),jQuery(this).on("typeahead:cursorchanged",jQuery(this).data("addressField").updateMap),jQuery(jQuery(this).data("addressField")).on("addresspicker:selected",function(t,r){jQuery(e).parents(".address-cover").find(".address-picker-field-hidden").val(r.placeResult.formatted_address),jQuery(e).val(r.address())})):(jQuery(this).data("addressField",new AddressPicker({autocompleteService:{componentRestrictions:{country:r}}})),jQuery(this).typeahead(null,{displayKey:"description",source:jQuery(this).data("addressField").ttAdapter()}),jQuery(this).parents(".field-cover").find(".address-field-map").hide(),jQuery(this).on("typeahead:selected",jQuery(this).data("addressField").updateMap),jQuery(this).on("typeahead:cursorchanged",jQuery(this).data("addressField").updateMap),jQuery(jQuery(this).data("addressField")).on("addresspicker:selected",function(t,r){jQuery(e).parents(".address-cover").find(".address-picker-field-hidden").val(r.placeResult.formatted_address),jQuery(e).val(r.address())})),jQuery(".tt-hint").prop("readonly",!1).prop("disabled",!0)}})}},{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,r=void 0,i=void 0,a=void 0;if("hidden"===jQuery(this).prop("type"))i=a=jQuery(this).val();else{i=jQuery(this).text(),t=jQuery(this).html();var n=jQuery("<div>").html(t);n.find(".fc-third-party").remove(),a=n.text()}for(var s=/\[(.*?)\]/g;null!==(r=s.exec(a));){r[0]=jQuery("<div/>").text(r[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(r[0],'<span id="bind-math-'+o+'"></span>'),jQuery(this).html(t)),e.FormCraftMath[o]={identifier:o,variables:[]},e.FormCraftMath[o].string=r[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 u=e.FormCraftMath[o].string.split(/[*()\-,+\/]/);for(var l in u)""!==u[l]&&"function"!=typeof u[l]&&u[l].replace(/[^\d.-]/g,"")!==u[l]&&e.FormCraftMath[o].variables.push(u[l]);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 r in this.FormCraftMath)for(var i in this.FormCraftMath[r].variables)this.FormCraftMath[r].variables[i]===t&&this.calculateAndApplyMath(this.FormCraftMath[r])}},{key:"calculateAndApplyMath",value:function(e){var t=void 0,r=jQuery("#bind-math-"+e.identifier).parents("form"),i=jQuery("#bind-math-"+e.identifier).parents("form").attr("data-thousand"),a=jQuery("#bind-math-"+e.identifier).parents("form").attr("data-decimal");if(1===e.variables.length&&e.variables[0]===e.string)t=this.getFieldValue(jQuery('[data-field-id="'+e.variables[0]+'"]'),"string"),"hidden"===jQuery("#bind-math-"+e.identifier).prop("type")?(t=parseFloat(t),setTimeout(function(){jQuery("#bind-math-"+e.identifier).val(t).trigger("change")})):(t=t.toString().replace(/[.]/g,a).replace(/\B(?=(\d{3})+(?!\d))/g,i),jQuery("#bind-math-"+e.identifier).text(t)),jQuery(document).trigger("formcraft_math_change",[r]);else{var n=e.string;for(var s in e.variables)if("function"!=typeof e.variables[s]){var o=this.getFieldValue(jQuery(r).find('[data-field-id="'+e.variables[s]+'"]'),"number"),u=new RegExp(e.variables[s],"g");o=""===o?0:o,n=n.replace(u,o)}n=n.replace(/--/g,"+"),t=parseFloat(y.evaluate(n).toFixed(2)),t=isNaN(t)?0:t,t=isFinite(t)?t:"∞","hidden"===jQuery("#bind-math-"+e.identifier).prop("type")?jQuery("#bind-math-"+e.identifier).val(t).trigger("change"):(t=t.toString().replace(/[.]/g,a).replace(/\B(?=(\d{3})+(?!\d))/g,i),jQuery("#bind-math-"+e.identifier).text(t)),jQuery(document).trigger("formcraft_math_change",[r])}}},{key:"checkIfApplyLogic",value:function(e){var t=this.form.parents(".form-live").attr("data-uniq"),r=jQuery(e).attr("data-field-id"),i=!1;if("undefined"!=typeof this.FormCraftLogic&&null!==this.FormCraftLogic&&0!==this.FormCraftLogic.length)for(var a in this.FormCraftLogic)for(var n in this.FormCraftLogic[a][0]){var s=this.FormCraftLogic[a][0][n][2];"undefined"!=typeof s&&"["===s.slice(0,1)&&s.replace("[","").replace("]","")===r?(this.applyLogic(this.FormCraftLogic[a],t),i=!0):this.FormCraftLogic[a][0][n][0]===r&&(this.applyLogic(this.FormCraftLogic[a],t),i=!0)}if(i===!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]){var u="default",l=!0,c=!1,d=void 0;try{for(var p,h=this.finalHideShowList[o][Symbol.iterator]();!(l=(p=h.next()).done);l=!0){var f=p.value;"default"!==f&&(u=f)}}catch(y){c=!0,d=y}finally{try{!l&&h["return"]&&h["return"]()}finally{if(c)throw d}}switch(u){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 r=this.FormCraftLogic.indexOf(e),i=e[0],a=e[1],n=0,s="or"===e[2]?1:i.length;for(var o in i){var u=this.getFieldValue(jQuery(".uniq-"+t+' [data-field-id="'+i[o][0]+'"]'),"string"),l=void 0,c=void 0;switch(i[o][2]=i[o][2]||"","["===i[o][2].slice(0,1)?(l=i[o][2].replace("[","").replace("]",""),l=this.getFieldValue(jQuery('[data-field-id="'+l+'"]'),"string")):l=i[o][2],i[o][1]){case"equal_to":c=4===l.toString().indexOf("-")?this.dateToDifference(l).toString():l,c===u.toString()&&n++;break;case"not_equal_to":c=4===l.toString().indexOf("-")?this.dateToDifference(l).toString():l,c!==u.toString()&&n++;break;case"contains":if(""===l){""!==u&&n++;break}u.toString().indexOf(l)!==-1&&n++;break;case"contains_not":u.toString().indexOf(l)===-1&&n++;break;case"greater_than":c=l.toString().indexOf("-")!==-1?this.dateToDifference(l):l,!isNaN(parseFloat(u))&&parseFloat(u)>parseFloat(c)&&n++;break;case"less_than":c=l.toString().indexOf("-")!==-1?this.dateToDifference(l):l,!isNaN(parseFloat(u))&&parseFloat(u)<parseFloat(c)&&n++}}this.executeLogic(a,r,s,n)}},{key:"executeLogic",value:function(e,t,r,i){for(var a in e)switch(e[a][0]){case"hide_fields":if(!e[a][1])continue;var n=e[a][1].split(",");for(var s in n)"function"!=typeof n[s]&&(this.finalHideShowList[n[s]]=this.finalHideShowList[n[s]]||[],i>=r?this.finalHideShowList[n[s]].push("hide"):this.finalHideShowList[n[s]].push("default"));break;case"show_fields":if(!e[a][1])continue;var o=e[a][1].split(",");for(var u in o)"function"!=typeof o[u]&&(this.finalHideShowList[o[u]]=this.finalHideShowList[o[u]]||[],i>=r?this.finalHideShowList[o[u]].push("show"):this.finalHideShowList[o[u]].push("default"));break;case"email_to":if(!e[a][2])continue;var l=e[a][2];i>=r?window.finalEmailsTo.indexOf(t+":"+l)===-1&&window.finalEmailsTo.push(t+":"+l):window.finalEmailsTo.indexOf(t+":"+l)!==-1&&window.finalEmailsTo.splice(window.finalEmailsTo.indexOf(t+":"+l),1);break;case"redirect_to":window.finalRedirect=window.finalRedirect||[],i>=r?window.finalRedirect.push(e[a][2]):window.finalRedirect.indexOf(e[a][2])!==-1&&window.finalRedirect.splice(window.finalRedirect.indexOf(e[a][2]),1);break;case"trigger_integration":if(!e[a][3])continue;window.triggerIntegration=window.triggerIntegration||[],i>=r?window.triggerIntegration.indexOf(e[a][3])===-1&&window.triggerIntegration.push(e[a][3]):window.triggerIntegration.indexOf(e[a][3])!==-1&&window.triggerIntegration.splice(window.triggerIntegration.indexOf(e[a][3]),1);break;case"set_value":this.setValue=this.setValue||[];var c=void 0;e[a][2]&&"["===e[a][2].slice(0,1)?(c=e[a][2].replace("[","").replace("]",""),c=this.getFieldValue(jQuery('[data-field-id="'+c+'"]'),"string")):c=e[a][2],i>=r?this.setValue[e[a][4]]=c:"undefined"!=typeof this.setValue[e[a][4]]&&this.setValue[e[a][4]]===c}}},{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=formcraft3_save_form_progress&"+e+"&formcraft3_wpnonce="+jQuery("#formcraft3_wpnonce").val(),dataType:"json"}))}},{key:"getFieldValue",value:function(e,t){var r=this.parentElement.attr("data-uniq");if(0===jQuery(e).length)return 0;var i=jQuery(e).prop("type"),a=void 0,n=","===jQuery(e).parents(".fc-form").attr("data-decimal")?",":".";switch(i=jQuery(e).is("select")?"select":i,i=jQuery(e).hasClass("hasDatepicker")?"date":i,i=jQuery(e).parent().parent().hasClass("files-list")?"file":i,i=jQuery(e).parent().parent().hasClass("slider-cover")?"slider":i){case"text":case"password":case"select":case"hidden":case"email":case"textarea":a=jQuery(e).val().replace(n,".");break;case"slider":a=jQuery(e).val().replace(n,"."),a.indexOf(" - ")!==-1&&(a=(parseFloat(a.split(" - ")[0])+parseFloat(a.split(" - ")[1]))/2);break;case"radio":case"checkbox":a=[],jQuery(".uniq-"+r+' [name="'+jQuery(e).prop("name")+'"]:checked').each(function(){a.push(jQuery(this).val().replace(n,"."))});break;case"date":var o=jQuery(e).datepicker("getDate");if(null===o)return"";var u=new Date,l=new Date(u.getFullYear(),u.getMonth(),u.getDate());o=null===o?l:o,a=parseInt((o-l)/864e5,10);break;case"file":var c=jQuery(e).attr("name");a=0,jQuery('[name="'+c+'"]').each(function(){""!==jQuery(this).val()&&a++})}if("string"===t)return"object"===("undefined"==typeof a?"undefined":s(a))?a.join(", "):a;if("object"===("undefined"==typeof a?"undefined":s(a))){var d=0;for(var p in a)d+=isNaN(parseFloat(a[p]))?0:parseFloat(a[p]);return d}if("string"==typeof a&&a.indexOf("-")!==-1){var h=a.split("-");return a=(parseFloat(h[0].trim())+parseFloat(h[1].trim()))/2,isNaN(parseFloat(a))?0:parseFloat(a)}return isNaN(parseFloat(a))?0:parseFloat(a)}},{key:"setFormValues",value:function(e){var t=this.form;for(var r in e){var i=0===t.find('[name="'+r+'"]').length?t.find('[name="'+r+'[]"]'):t.find('[name="'+r+'"]'),a=i.prop("type");switch(a=i.is("select")?"select":a,a=i.hasClass("hasDatepicker")?"date":a,a=i.parent().parent().hasClass("files-list")?"file":a,a=i.parents(".field-cover").hasClass("slider-cover")?"slider":a,a=i.parents(".field-cover").hasClass("timepicker-cover")?"timepicker":a){case"text":case"email":case"select":case"hidden":case"textarea":case"date":if(i.attr("id")&&"bind-math"===i.attr("id").substr(0,9))break;e[r]!==i.val()&&i.val(e[r]).trigger("input").trigger("change");break;case"radio":case"checkbox":("string"==typeof e[r]&&""===e[r]||null===e[r]&&t.find('[name="'+r+'[]"]').length>0)&&t.find('[name="'+r+'[]"]').prop("checked",!1).trigger("change"),"string"==typeof e[r]&&e[r].indexOf("||")>-1&&(e[r]=e[r].split("||")),e[r]="string"==typeof e[r]?[e[r]]:e[r];for(var n in e[r])0===t.find('[name="'+r+'[]"]').length?t.find('[name="'+r+'"][value="'+e[r][n]+'"]').prop("checked",!0).trigger("change"):t.find('[name="'+r+'[]"][value="'+e[r][n]+'"]').prop("checked",!0).trigger("change");break;case"timepicker":i.val(e[r]).trigger("change");var s=e[r].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],i.parents(".timepicker-cover").find(".time-fields-cover > select").eq(0).val(s[0]),i.parents(".timepicker-cover").find(".time-fields-cover > select").eq(1).val(s[1]),i.parents(".timepicker-cover").find(".time-fields-cover > input").eq(0).val(s[2]);break;case"slider":if(""===e[r])break;if(e[r].indexOf(" - ")!==-1){var o=e[r].split(" - ");o=o.map(function(e){return parseFloat(e.replace(/[^\d.-]/g,""))}),i.parents(".slider-cover").find(".ui-slider-cover > span").slider("values",o)}else e[r]=e[r].replace(i.attr("data-prefix"),"").replace(i.attr("data-suffix"),""),e[r]=isNaN(e[r])?0:parseFloat(e[r].replace(/[^\d.-]/g,"")),i.parents(".slider-cover").find(".ui-slider-cover > span").slider("value",e[r])}}}},{key:"dateToDifference",value:function(e){var t=e.toString().split("-"),r=new Date,i=new Date(r.getFullYear(),r.getMonth(),r.getDate()),a=new Date(t[0],parseInt(t[1],10)-1,t[2]);return parseInt((a-i)/864e5,10)}}]),e}();jQuery(document).ready(function(){jQuery(".fc-form").each(function(){var e=new m(jQuery(this));jQuery(this).data("FormCraft",e);var t=jQuery(this).parents(".form-live.align-left").length?"align-left":"";t=jQuery(this).parents(".form-live.align-center").length?"align-center":t,t=jQuery(this).parents(".form-live.align-right").length?"align-right":t,jQuery(this).addClass(t)}),jQuery("[accept]").each(function(){"."===jQuery(this).attr("accept")&&jQuery(this).removeAttr("accept")}),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.disableFormCraftForm=function(e){e.find(".submit-cover").addClass("disabled"),e.find(".submit-button").attr("disabled",!0)},window.enableFormCraftForm=function(e){e.find(".submit-cover").removeClass("disabled"),e.find(".submit-button").attr("disabled",!1)},window.canSubmitFormCraftForm=function(e){return!e.find(".submit-button").attr("disabled")},window.FormCraftSubmitForm=function(e,t,r){var i="",a=jQuery(e);if("all"===t&&a.find(".form-element-type-submit.state-hidden").length===a.find(".form-element-type-submit").length)return!1;if(!window.canSubmitFormCraftForm(a))return!1;window.disableFormCraftForm(a),a.find(".submit-response").slideUp("fast").html();var s=jQuery(e).hasClass("dont-submit-hidden-true")?a.find(".form-element").not(".state-hidden").find("input, select, textarea").serialize():a.serialize(),o=[];a.find(".form-element.state-hidden").each(function(){o.push(jQuery(this).attr("data-identifier"))}),o=o.join(", ");var u="";if("undefined"!=typeof window.finalEmailsTo)for(var l in window.finalEmailsTo)"function"!=typeof window.finalEmailsTo[l]&&(u=u+","+encodeURIComponent(window.finalEmailsTo[l].substr(window.finalEmailsTo[l].indexOf(":")+1)));"undefined"!=typeof window.finalRedirect&&0!==window.finalRedirect.length&&(i=encodeURIComponent(window.finalRedirect[window.finalRedirect.length-1]));var c=void 0;"undefined"!=typeof window.triggerIntegration&&(c=encodeURIComponent(JSON.stringify(window.triggerIntegration)));var d=void 0;"undefined"!=typeof a.data("FieldLabels")&&(d=encodeURIComponent(JSON.stringify(a.data("FieldLabels"))));var h=s+"&id="+a.attr("data-id")+"&location="+encodeURIComponent(window.location.href)+"&emails="+u+"&hidden="+o+"&redirect="+i+"&type="+t+"&triggerIntegration="+c+"&fieldLabels="+d,f={abort:!1};if("all"===t)a.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 y=t-1;a.find(".form-page-"+y+" .validation-lenient, .validation-strict").each(function(){if(!jQuery(this).parents(".form-element").hasClass("state-hidden")&&0!==jQuery(this).parents(".form-page-"+y).length){var e=jQuery(this).fcValidate();e===!1&&(f.abort=!0)}})}if("all"===t&&jQuery(document).trigger("formcraft_submit_trigger",[a,h,f]),f.abort===!0){if(0===a.find(".error-field").length)return!1;if(p["default"].isElementInViewport(a.find(".error-field").first())===!1&&"true"!==a.attr("data-auto-scroll")){var m=a.find(".error-field").first()[0];m.scrollIntoView({behavior:"smooth",block:"start"})}return"undefined"!=typeof r&&r(!1),window.enableFormCraftForm(a),!1}a.find(".form-element").removeClass("error-field");var v=a;jQuery.ajax({url:FC.ajaxurl,type:"POST",timeout:12e4,data:"action=formcraft3_form_submit&"+h+"&formcraft3_wpnonce="+jQuery("#formcraft3_wpnonce").val(),dataType:"json"}).done(function(e){if(a=v,e.debug){if(e.debug.failed&&showDebug===!0)for(var t in e.debug.failed)n("error",e.debug.failed[t]);if(e.debug.success&&showDebug===!0)for(var i in e.debug.success)n("success","<i class='formcraft-icon'>check</i> "+e.debug.success[i])}if(e.failed){if(0!==a.parents(".fc-form-modal").length&&(setTimeout(function(){a.addClass("shake")},600),setTimeout(function(){a.removeClass("shake")},1100)),a.find(".validation-lenient").addClass("validation-strict").removeClass(".validation-lenient"),a.find(".submit-response").html('<span class="has-error">'+e.failed+"</span>").slideDown("fast"),e.errors)for(var s in e.errors)a.find(".form-element-"+s).addClass("error-field"),a.find(".form-element-"+s+" .error").text(e.errors[s]);if(0!==a.find(".error-field").length&&p["default"].isElementInViewport(a.find(".error-field").first())===!1&&"true"!==a.attr("data-auto-scroll")){var o=a.find(".error-field").first()[0];o.scrollIntoView({behavior:"smooth",block:"start"})}}else if("undefined"!=typeof e.success){window.disableFormCraftForm(a),jQuery(document).trigger("formcraft_submit_result",[a,e]);var u=parseInt(a.attr("data-delay"),10);u=isNaN(u)?0:u,u=Math.max(0,u),e.redirect&&"true"===a.attr("data-no-message-redirect")?(setTimeout(function(){a.find(".submit-cover").addClass("disabled")},0),setTimeout(function(){window.location.assign(e.redirect)},1e3*u)):(a.append('<div class="final-success"><i class="final-success-check formcraft-icon">check</i><span></span></div>'),a.find(".final-success > span").html(e.success),a.addClass("submitted"),a.find(".final-success").slideDown(800,function(){}),a.find(".form-page").slideUp(800,function(){a.find(".form-element").remove()}),0===a.parents(".fc-form-modal").length&&0===a.parents(".fc-sticky").length&&"true"!==a.attr("data-auto-scroll")&&jQuery("html, body").animate({scrollTop:a.offset().top-100},800)),e.redirect&&setTimeout(function(){window.location.assign(e.redirect)},1e3*u)}"undefined"!=typeof r&&r(e,a)}).fail(function(){jQuery(e).find(".response").text("Connection error"),"undefined"!=typeof r&&r(!1)}).always(function(e){jQuery(document).trigger("formcraft_submit_success_trigger",[a,e]),a.find(".submit-cover").addClass("enabled"),a.find(".submit-cover").removeClass("disabled"),"all"===t&&window.enableFormCraftForm(a)})},jQuery(document).ready(function(){p["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="'+parseInt(t[t.length-1],10)+'"]').length){var r=jQuery('.fc-form-modal .fc-form[data-id="'+parseInt(t[t.length-1],10)+'"]').first(),i=r.parents(".fc-form-modal").attr("id");jQuery(this).removeAttr("href"),jQuery(this).attr("data-toggle","fc_modal"),jQuery(this).attr("data-target","#"+i)}}}),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"],.star-cover input[type="radio"],.thumb-cover input[type="radio"],.dropdown-cover select').trigger("change"),jQuery('.checkbox-cover input[type="checkbox"], .checkbox-cover input[type="radio"]').length>50?jQuery('.checkbox-cover input[type="checkbox"], .checkbox-cover input[type="radio"]').filter(function(e,t){return jQuery(t).prop("checked")}).trigger("change"):jQuery('.checkbox-cover input[type="checkbox"], .checkbox-cover input[type="radio"]').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",".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")}}),jQuery("body").on("change",".checkbox-cover label input",function(){jQuery(this).is(":checked")&&(jQuery(this).parent().parent().find(".active").removeClass("active"),jQuery(this).parent().addClass("active"))}),p["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 r=e.find(".fc-form").attr("data-id");jQuery.get(FC.ajaxurl+"?action=formcraft3_trigger_view&id="+r),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"),r=jQuery(".formcraft-datepicker"),i=jQuery(".fc-sticky-button");t.is(e.target)||0!==t.has(e.target).length||r.is(e.target)||0!==r.has(e.target).length||i.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(),r=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":r/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").on("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,r){var i,a,n;!function(r,s){a=[t,e],i=s,n="function"==typeof i?i.apply(t,a):i,!(void 0!==n&&(e.exports=n))}(void 0,function(e,t){"use strict";function r(e){function t(){var t=window.getComputedStyle(e,null);h=t.overflowY,"vertical"===t.resize?e.style.resize="none":"both"===t.resize&&(e.style.resize="horizontal"),p="content-box"===t.boxSizing?-(parseFloat(t.paddingTop)+parseFloat(t.paddingBottom)):parseFloat(t.borderTopWidth)+parseFloat(t.borderBottomWidth),isNaN(p)&&(p=0),a()}function r(t){var r=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=r,h=t,d&&(e.style.overflowY=t),i()}function i(){var t=window.pageYOffset,r=document.body.scrollTop,i=e.style.height;e.style.height="auto";var a=e.scrollHeight+p;return 0===e.scrollHeight?void(e.style.height=i):(e.style.height=a+"px",f=e.clientWidth,document.documentElement.scrollTop=t,void(document.body.scrollTop=r))}function a(){var t=e.style.height;i();var a=window.getComputedStyle(e,null);if(a.height!==e.style.height?"visible"!==h&&r("visible"):"hidden"!==h&&r("hidden"),t!==e.style.height){var n=s("autosize:resized");e.dispatchEvent(n)}}var o=void 0===arguments[1]?{}:arguments[1],u=o.setOverflowX,l=void 0===u||u,c=o.setOverflowY,d=void 0===c||c;if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!n.has(e)){var p=null,h=null,f=e.clientWidth,y=function(){e.clientWidth!==f&&a()},m=function(t){window.removeEventListener("resize",y,!1),e.removeEventListener("input",a,!1),e.removeEventListener("keyup",a,!1),e.removeEventListener("autosize:destroy",m,!1),e.removeEventListener("autosize:update",a,!1),n["delete"](e),Object.keys(t).forEach(function(r){e.style[r]=t[r]})}.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",m,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",a,!1),window.addEventListener("resize",y,!1),e.addEventListener("input",a,!1),e.addEventListener("autosize:update",a,!1),n.add(e),l&&(e.style.overflowX="hidden",e.style.wordWrap="break-word"),t()}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName){var t=s("autosize:destroy");e.dispatchEvent(t)}}function a(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 u=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?(u=function(e){return e},u.destroy=function(e){return e},u.update=function(e){return e}):(u=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],function(e){return r(e,t)}),e},u.destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],i),e},u.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.exports=u})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e){e.fn.fcValidate=function(){var e=void 0,t=void 0,r=void 0,i=void 0,a=void 0;jQuery(this).attr("data-allow-spaces")&&"true"===jQuery(this).attr("data-allow-spaces")?(e=/^[A-Za-z ]+$/,i=/^[0-9 ]+$/,t=/^[0-9A-Za-z ]+$/,a=/(http|https):\/\/(\w+:{0,1}\w*)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%!\-\/]))?/,r=/^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i):(e=/^[A-Za-z]+$/,i=/^[0-9]+$/,t=/^[0-9A-Za-z]+$/,a=/(http|https):\/\/(\w+:{0,1}\w*)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%!\-\/]))?/,r=/^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i);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 u=jQuery(this).attr("name");o=jQuery('[name="'+u+'"]:checked').val(),o="undefined"==typeof o?"":o}o=o||"";var l=jQuery(this);if(l.attr("data-is-required")&&"true"===l.attr("data-is-required")&&""===o.trim())return l.parents(".form-element").find(".error").text(s.is_required),l.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 l.parents(".form-element").find(".error").text(s.is_invalid),l.parents(".form-element").addClass("error-field"),!1;if(jQuery(this).attr("data-is-required")&&"false"===jQuery(this).attr("data-is-required")&&""===o.trim())return l.parents(".form-element").find(".error").text(""),l.parents(".form-element").removeClass("error-field"),!0;if(jQuery(this).attr("data-min-char")&&jQuery(this).attr("data-min-char")>o.length)return l.parents(".form-element").find(".error").text(s.min_char.replace("[x]",jQuery(this).attr("data-min-char"))),l.parents(".form-element").addClass("error-field"),!1;if(jQuery(this).attr("data-max-char")&&jQuery(this).attr("data-max-char")<o.length)return l.parents(".form-element").find(".error").text(s.max_char.replace("[x]",jQuery(this).attr("data-max-char"))),l.parents(".form-element").addClass("error-field"),!1;if(jQuery(this).attr("data-val-type")&&"email"===jQuery(this).attr("data-val-type")&&!o.match(r))return l.parents(".form-element").find(".error").text(s.allow_email),l.parents(".form-element").addClass("error-field"),!1;if(jQuery(this).attr("data-val-type")&&"alphabets"===jQuery(this).attr("data-val-type")&&!o.match(e))return l.parents(".form-element").find(".error").text(s.allow_alphabets),l.parents(".form-element").addClass("error-field"),!1;if(jQuery(this).attr("data-val-type")&&"numbers"===jQuery(this).attr("data-val-type")&&!o.match(i))return l.parents(".form-element").find(".error").text(s.allow_numbers),l.parents(".form-element").addClass("error-field"),!1;if(jQuery(this).attr("data-val-type")&&"alphanumeric"===jQuery(this).attr("data-val-type")&&!o.match(t))return l.parents(".form-element").find(".error").text(s.allow_alphanumeric),l.parents(".form-element").addClass("error-field"),!1;if(jQuery(this).attr("data-val-type")&&"url"===jQuery(this).attr("data-val-type")&&!o.match(a))return l.parents(".form-element").find(".error").text(s.allow_url),l.parents(".form-element").addClass("error-field"),!1;if(jQuery(this).attr("data-val-type")&&"regexp"===jQuery(this).attr("data-val-type")){var c=jQuery(this).attr("data-regexp").replace(/.*\/([gimy]*)$/,"$1"),d=jQuery(this).attr("data-regexp").replace(new RegExp("^/(.*?)/"+c+"$"),"$1"),p=new RegExp(d);if(null===p.exec(o))return l.parents(".form-element").find(".error").text(s.allow_regexp),l.parents(".form-element").addClass("error-field"),!1}return l.parents(".form-element").removeClass("error-field"),!0}}(jQuery);t["default"]=r},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r={isMobile:function(){return!(!/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent)&&!/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4)))},isiOS:function(){return!!navigator.userAgent.match(/iPad|iPhone|iPod/g)},spinTo:function(e,t,r,i){var a=""===jQuery(e).text()?0:parseFloat(jQuery(e).text().replace(/[^0-9.]+/g,""));t=isNaN(parseFloat(t))?0:parseFloat(t),a=isNaN(parseFloat(a))?0:parseFloat(a),r="undefined"==typeof r?"":r,i="undefined"==typeof i?".":i;var n=jQuery(e).parents("form");jQuery({someValue:a}).animate({someValue:parseFloat(t)},{duration:600,easing:"swing",context:t,step:function(){var a=void 0;a=parseInt(t,10)!==parseFloat(t,10)?(Math.ceil(100*this.someValue)/100).toString().replace(/[.]/g,i).replace(/\B(?=(\d{3})+(?!\d))/g,r):Math.ceil(this.someValue).toString().replace(/[.]/g,i).replace(/\B(?=(\d{3})+(?!\d))/g,r),jQuery(e).text(a)},complete:function(){jQuery(document).trigger("formcraft_math_change",[n])}}),setTimeout(function(){jQuery(e).text(parseFloat(t).toString().replace(/[.]/g,i).replace(/\B(?=(\d{3})+(?!\d))/g,r))},650)},isElementInViewport:function(e){"function"==typeof jQuery&&e instanceof jQuery&&(e=e[0]);var t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&t.right<=(window.innerWidth||document.documentElement.clientWidth)}};t["default"]=r},function(e,t,r){var i,a,n="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};!function(s,o){"object"==n(t)&&"undefined"!=typeof e?e.exports=o():(i=o,a="function"==typeof i?i.call(t,r,t,e):i,!(void 0!==a&&(e.exports=a)))}(void 0,function(){"use strict";function e(e,t){this.type=e,this.value=void 0!==t&&null!==t?t:0}function t(t){return new e(Z,t)}function r(t){return new e(K,t)}function i(t){return new e(J,t)}function a(t,r,i,n,s){for(var o,u,l,c,d=[],p=[],h=0;h<t.length;h++){var f=t[h],y=f.type;if(y===X)d.push(f);else if(y===ee&&s.hasOwnProperty(f.value))f=new e(X,s[f.value]),d.push(f);else if(y===K&&d.length>1)u=d.pop(),o=d.pop(),c=i[f.value],f=new e(X,c(o.value,u.value)),d.push(f);else if(y===J&&d.length>2)l=d.pop(),u=d.pop(),o=d.pop(),"?"===f.value?d.push(o.value?u.value:l.value):(c=n[f.value],f=new e(X,c(o.value,u.value,l.value)),d.push(f));else if(y===Z&&d.length>0)o=d.pop(),c=r[f.value],f=new e(X,c(o.value)),d.push(f);else if(y===re){for(;d.length>0;)p.push(d.shift());p.push(new e(re,a(f.value,r,i,n,s)))}else if(y===ie&&d.length>0)o=d.pop(),d.push(new e(X,o.value[f.value]));else{for(;d.length>0;)p.push(d.shift());p.push(f)}}for(;d.length>0;)p.push(d.shift());return p}function n(a,s,o){for(var u=[],l=0;l<a.length;l++){var c=a[l],d=c.type;if(d===ee&&c.value===s)for(var p=0;p<o.tokens.length;p++){var h,f=o.tokens[p];h=f.type===Z?t(f.value):f.type===K?r(f.value):f.type===J?i(f.value):new e(f.type,f.value),u.push(h)}else d===re?u.push(new e(re,n(c.value,s,o))):u.push(c)}return u}function s(e,t,r){for(var i,a,n,o,u=[],l=0;l<e.length;l++){var c=e[l],d=c.type;if(d===X)u.push(c.value);else if(d===K)a=u.pop(),i=u.pop(),o=t.binaryOps[c.value],u.push(o(i,a));else if(d===J)n=u.pop(),a=u.pop(),i=u.pop(),"?"===c.value?u.push(s(i?a:n,t,r)):(o=t.ternaryOps[c.value],u.push(o(i,a,n)));else if(d===ee)if(c.value in t.functions)u.push(t.functions[c.value]);else{var p=r[c.value];if(void 0===p)throw new Error("undefined variable: "+c.value);u.push(p)}else if(d===Z)i=u.pop(),o=t.unaryOps[c.value],u.push(o(i));else if(d===te){for(var h=c.value,f=[];h-- >0;)f.unshift(u.pop());if(!(o=u.pop()).apply||!o.call)throw new Error(o+" is not a function");u.push(o.apply(void 0,f))}else if(d===re)u.push(c.value);else{if(d!==ie)throw new Error("invalid Expression");i=u.pop(),u.push(i[c.value])}}if(u.length>1)throw new Error("invalid Expression (parity)");return u[0]}function o(e,t){for(var r,i,a,n,s=[],l=0;l<e.length;l++){var c=e[l],d=c.type;if(d===X)"number"==typeof c.value&&c.value<0?s.push("("+c.value+")"):s.push(u(c.value));else if(d===K)i=s.pop(),r=s.pop(),n=c.value,t?"^"===n?s.push("Math.pow("+r+", "+i+")"):"and"===n?s.push("(!!"+r+" && !!"+i+")"):"or"===n?s.push("(!!"+r+" || !!"+i+")"):"||"===n?s.push("(String("+r+") + String("+i+"))"):"=="===n?s.push("("+r+" === "+i+")"):"!="===n?s.push("("+r+" !== "+i+")"):s.push("("+r+" "+n+" "+i+")"):s.push("("+r+" "+n+" "+i+")");else if(d===J){if(a=s.pop(),i=s.pop(),r=s.pop(),"?"!==(n=c.value))throw new Error("invalid Expression");s.push("("+r+" ? "+i+" : "+a+")")}else if(d===ee)s.push(c.value);else if(d===Z)r=s.pop(),"-"===(n=c.value)||"+"===n?s.push("("+n+r+")"):t?"not"===n?s.push("(!"+r+")"):"!"===n?s.push("fac("+r+")"):s.push(n+"("+r+")"):"!"===n?s.push("("+r+"!)"):s.push("("+n+" "+r+")");else if(d===te){for(var p=c.value,h=[];p-- >0;)h.unshift(s.pop());n=s.pop(),s.push(n+"("+h.join(", ")+")")}else if(d===ie)r=s.pop(),s.push(r+"."+c.value);else{if(d!==re)throw new Error("invalid Expression");s.push("("+o(c.value,t)+")")}}if(s.length>1)throw new Error("invalid Expression (parity)");return String(s[0])}function u(e){return"string"==typeof e?JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029"):e}function l(e,t){for(var r=0;r<e.length;r++)if(e[r]===t)return!0;return!1}function c(e,t,r){for(var i=!!(r=r||{}).withMembers,a=null,n=0;n<e.length;n++){var s=e[n];s.type!==ee||l(t,s.value)?s.type===ie&&i&&null!==a?a+="."+s.value:s.type===re?c(s.value,t,r):null!==a&&(l(t,a)||t.push(a),a=null):i?null!==a?(l(t,a)||t.push(a),a=s.value):a=s.value:t.push(s.value)}null===a||l(t,a)||t.push(a)}function d(e,t){this.tokens=e,this.parser=t,this.unaryOps=t.unaryOps,this.binaryOps=t.binaryOps,this.ternaryOps=t.ternaryOps,this.functions=t.functions}function p(e,t,r){this.type=e,this.value=t,this.index=r}function h(e,t){this.pos=0,this.current=null,this.unaryOps=e.unaryOps,this.binaryOps=e.binaryOps,this.ternaryOps=e.ternaryOps,this.consts=e.consts,this.expression=t,this.savedPosition=0,this.savedCurrent=null,this.options=e.options}function f(e){return se.hasOwnProperty(e)?se[e]:e}function y(e,t,r){this.parser=e,this.tokens=t,this.current=null,this.nextToken=null,this.next(),this.savedCurrent=null,this.savedNextToken=null,this.allowMemberAccess=!1!==r.allowMemberAccess}function m(e,t){return Number(e)+Number(t)}function v(e,t){return e-t}function g(e,t){return e*t}function j(e,t){return e/t}function w(e,t){return e%t}function Q(e,t){return""+e+t}function b(e,t){return e===t}function x(e,t){return e!==t}function k(e,t){return e>t}function C(e,t){return e<t}function M(e,t){return e>=t}function F(e,t){return e<=t}function E(e,t){return Boolean(e&&t)}function T(e,t){return Boolean(e||t)}function _(e,t){return l(t,e)}function S(e){return(Math.exp(e)-Math.exp(-e))/2}function A(e){return(Math.exp(e)+Math.exp(-e))/2}function O(e){return e===1/0?1:e===-1/0?-1:(Math.exp(e)-Math.exp(-e))/(Math.exp(e)+Math.exp(-e))}function I(e){return e===-1/0?e:Math.log(e+Math.sqrt(e*e+1))}function L(e){return Math.log(e+Math.sqrt(e*e-1))}function N(e){return Math.log((1+e)/(1-e))/2}function D(e){return Math.log(e)*Math.LOG10E}function P(e){return-e}function q(e){return!e}function R(e){return e<0?Math.ceil(e):Math.floor(e)}function z(e){return Math.random()*(e||1)}function V(e){return H(e+1)}function B(e){return isFinite(e)&&e===Math.round(e)}function H(e){var t,r;if(B(e)){if(e<=0)return isFinite(e)?1/0:NaN;if(e>171)return 1/0;for(var i=e-2,a=e-1;i>1;)a*=i,i--;return 0===a&&(a=1),a}if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*H(1-e));if(e>=171.35)return 1/0;if(e>85){var n=e*e,s=n*e,o=s*e,u=o*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*n)-139/(51840*s)-571/(2488320*o)+163879/(209018880*u)+5246819/(75246796800*u*e))}--e,r=de[0];for(var l=1;l<de.length;++l)r+=de[l]/(e+l);return t=e+ce+.5,
Math.sqrt(2*Math.PI)*Math.pow(t,e+.5)*Math.exp(-t)*r}function U(e){return String(e).length}function W(){for(var e=0,t=0,r=0;r<arguments.length;r++){var i,a=Math.abs(arguments[r]);t<a?(e=e*(i=t/a)*i+1,t=a):e+=a>0?(i=a/t)*i:a}return t===1/0?1/0:t*Math.sqrt(e)}function $(e,t,r){return e?t:r}function G(e,t){return void 0===t||0==+t?Math.round(e):(e=+e,t=-+t,isNaN(e)||"number"!=typeof t||t%1!=0?NaN:(e=e.toString().split("e"),e=Math.round(+(e[0]+"e"+(e[1]?+e[1]-t:-t))),+((e=e.toString().split("e"))[0]+"e"+(e[1]?+e[1]+t:t))))}function Y(e){this.options=e||{},this.unaryOps={sin:Math.sin,cos:Math.cos,tan:Math.tan,asin:Math.asin,acos:Math.acos,atan:Math.atan,sinh:Math.sinh||S,cosh:Math.cosh||A,tanh:Math.tanh||O,asinh:Math.asinh||I,acosh:Math.acosh||L,atanh:Math.atanh||N,sqrt:Math.sqrt,log:Math.log,ln:Math.log,lg:Math.log10||D,log10:Math.log10||D,abs:Math.abs,ceil:Math.ceil,floor:Math.floor,round:Math.round,trunc:Math.trunc||R,"-":P,"+":Number,exp:Math.exp,not:q,length:U,"!":V},this.binaryOps={"+":m,"-":v,"*":g,"/":j,"%":w,"^":Math.pow,"||":Q,"==":b,"!=":x,">":k,"<":C,">=":M,"<=":F,and:E,or:T,"in":_},this.ternaryOps={"?":$},this.functions={random:z,fac:V,min:Math.min,max:Math.max,hypot:Math.hypot||W,pyt:Math.hypot||W,pow:Math.pow,atan2:Math.atan2,"if":$,gamma:H,roundTo:G},this.consts={E:Math.E,PI:Math.PI,"true":!0,"false":!1}}var X="INUMBER",Z="IOP1",K="IOP2",J="IOP3",ee="IVAR",te="IFUNCALL",re="IEXPR",ie="IMEMBER";e.prototype.toString=function(){switch(this.type){case X:case Z:case K:case J:case ee:return this.value;case te:return"CALL "+this.value;case ie:return"."+this.value;default:return"Invalid Instruction"}},d.prototype.simplify=function(e){return e=e||{},new d(a(this.tokens,this.unaryOps,this.binaryOps,this.ternaryOps,e),this.parser)},d.prototype.substitute=function(e,t){return t instanceof d||(t=this.parser.parse(String(t))),new d(n(this.tokens,e,t),this.parser)},d.prototype.evaluate=function(e){return e=e||{},s(this.tokens,this,e)},d.prototype.toString=function(){return o(this.tokens,!1)},d.prototype.symbols=function(e){e=e||{};var t=[];return c(this.tokens,t,e),t},d.prototype.variables=function(e){e=e||{};var t=[];c(this.tokens,t,e);var r=this.functions;return t.filter(function(e){return!(e in r)})},d.prototype.toJSFunction=function(e,t){var r=this,i=new Function(e,"with(this.functions) with (this.ternaryOps) with (this.binaryOps) with (this.unaryOps) { return "+o(this.simplify(t).tokens,!0)+"; }");return function(){return i.apply(r,arguments)}};var ae="TOP";p.prototype.toString=function(){return this.type+": "+this.value},h.prototype.newToken=function(e,t,r){return new p(e,t,null!=r?r:this.pos)},h.prototype.save=function(){this.savedPosition=this.pos,this.savedCurrent=this.current},h.prototype.restore=function(){this.pos=this.savedPosition,this.current=this.savedCurrent},h.prototype.next=function(){return this.pos>=this.expression.length?this.newToken("TEOF","EOF"):this.isWhitespace()||this.isComment()?this.next():this.isRadixInteger()||this.isNumber()||this.isOperator()||this.isString()||this.isParen()||this.isComma()||this.isNamedOp()||this.isConst()||this.isName()?this.current:void this.parseError('Unknown character "'+this.expression.charAt(this.pos)+'"')},h.prototype.isString=function(){var e=!1,t=this.pos,r=this.expression.charAt(t);if("'"===r||'"'===r)for(var i=this.expression.indexOf(r,t+1);i>=0&&this.pos<this.expression.length;){if(this.pos=i+1,"\\"!==this.expression.charAt(i-1)){var a=this.expression.substring(t+1,i);this.current=this.newToken("TSTRING",this.unescape(a),t),e=!0;break}i=this.expression.indexOf(r,i+1)}return e},h.prototype.isParen=function(){var e=this.expression.charAt(this.pos);return("("===e||")"===e)&&(this.current=this.newToken("TPAREN",e),this.pos++,!0)},h.prototype.isComma=function(){return","===this.expression.charAt(this.pos)&&(this.current=this.newToken("TCOMMA",","),this.pos++,!0)},h.prototype.isConst=function(){for(var e=this.pos,t=e;t<this.expression.length;t++){var r=this.expression.charAt(t);if(r.toUpperCase()===r.toLowerCase()&&(t===this.pos||"_"!==r&&"."!==r&&(r<"0"||r>"9")))break}if(t>e){var i=this.expression.substring(e,t);if(i in this.consts)return this.current=this.newToken("TNUMBER",this.consts[i]),this.pos+=i.length,!0}return!1},h.prototype.isNamedOp=function(){for(var e=this.pos,t=e;t<this.expression.length;t++){var r=this.expression.charAt(t);if(r.toUpperCase()===r.toLowerCase()&&(t===this.pos||"_"!==r&&(r<"0"||r>"9")))break}if(t>e){var i=this.expression.substring(e,t);if(this.isOperatorEnabled(i)&&(i in this.binaryOps||i in this.unaryOps||i in this.ternaryOps))return this.current=this.newToken(ae,i),this.pos+=i.length,!0}return!1},h.prototype.isName=function(){for(var e=this.pos,t=e,r=!1;t<this.expression.length;t++){var i=this.expression.charAt(t);if(i.toUpperCase()===i.toLowerCase()){if(t===this.pos&&"$"===i)continue;if(t===this.pos||!r||"_"!==i&&(i<"0"||i>"9"))break}else r=!0}if(r){var a=this.expression.substring(e,t);return this.current=this.newToken("TNAME",a),this.pos+=a.length,!0}return!1},h.prototype.isWhitespace=function(){for(var e=!1,t=this.expression.charAt(this.pos);!(" "!==t&&"\t"!==t&&"\n"!==t&&"\r"!==t||(e=!0,++this.pos>=this.expression.length));)t=this.expression.charAt(this.pos);return e};var ne=/^[0-9a-f]{4}$/i;h.prototype.unescape=function(e){var t=e.indexOf("\\");if(t<0)return e;for(var r=e.substring(0,t);t>=0;){var i=e.charAt(++t);switch(i){case"'":r+="'";break;case'"':r+='"';break;case"\\":r+="\\";break;case"/":r+="/";break;case"b":r+="\b";break;case"f":r+="\f";break;case"n":r+="\n";break;case"r":r+="\r";break;case"t":r+="\t";break;case"u":var a=e.substring(t+1,t+5);ne.test(a)||this.parseError("Illegal escape sequence: \\u"+a),r+=String.fromCharCode(parseInt(a,16)),t+=4;break;default:throw this.parseError('Illegal escape sequence: "\\'+i+'"')}++t;var n=e.indexOf("\\",t);r+=e.substring(t,n<0?e.length:n),t=n}return r},h.prototype.isComment=function(){return"/"===this.expression.charAt(this.pos)&&"*"===this.expression.charAt(this.pos+1)&&(this.pos=this.expression.indexOf("*/",this.pos)+2,1===this.pos&&(this.pos=this.expression.length),!0)},h.prototype.isRadixInteger=function(){var e=this.pos;if(e>=this.expression.length-2||"0"!==this.expression.charAt(e))return!1;++e;var t,r;if("x"===this.expression.charAt(e))t=16,r=/^[0-9a-f]$/i,++e;else{if("b"!==this.expression.charAt(e))return!1;t=2,r=/^[01]$/i,++e}for(var i=!1,a=e;e<this.expression.length;){var n=this.expression.charAt(e);if(!r.test(n))break;e++,i=!0}return i&&(this.current=this.newToken("TNUMBER",parseInt(this.expression.substring(a,e),t)),this.pos=e),i},h.prototype.isNumber=function(){for(var e,t=!1,r=this.pos,i=r,a=r,n=!1,s=!1;r<this.expression.length&&((e=this.expression.charAt(r))>="0"&&e<="9"||!n&&"."===e);)"."===e?n=!0:s=!0,r++,t=s;if(t&&(a=r),"e"===e||"E"===e){r++;for(var o=!0,u=!1;r<this.expression.length;){if(e=this.expression.charAt(r),!o||"+"!==e&&"-"!==e){if(!(e>="0"&&e<="9"))break;u=!0,o=!1}else o=!1;r++}u||(r=a)}return t?(this.current=this.newToken("TNUMBER",parseFloat(this.expression.substring(i,r))),this.pos=r):this.pos=a,t},h.prototype.isOperator=function(){var e=this.pos,t=this.expression.charAt(this.pos);if("+"===t||"-"===t||"*"===t||"/"===t||"%"===t||"^"===t||"?"===t||":"===t||"."===t)this.current=this.newToken(ae,t);else if("∙"===t||"•"===t)this.current=this.newToken(ae,"*");else if(">"===t)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(ae,">="),this.pos++):this.current=this.newToken(ae,">");else if("<"===t)"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(ae,"<="),this.pos++):this.current=this.newToken(ae,"<");else if("|"===t){if("|"!==this.expression.charAt(this.pos+1))return!1;this.current=this.newToken(ae,"||"),this.pos++}else if("="===t){if("="!==this.expression.charAt(this.pos+1))return!1;this.current=this.newToken(ae,"=="),this.pos++}else{if("!"!==t)return!1;"="===this.expression.charAt(this.pos+1)?(this.current=this.newToken(ae,"!="),this.pos++):this.current=this.newToken(ae,t)}return this.pos++,!!this.isOperatorEnabled(this.current.value)||(this.pos=e,!1)};var se={"+":"add","-":"subtract","*":"multiply","/":"divide","%":"remainder","^":"power","!":"factorial","<":"comparison",">":"comparison","<=":"comparison",">=":"comparison","==":"comparison","!=":"comparison","||":"concatenate",and:"logical",or:"logical",not:"logical","?":"conditional",":":"conditional"};h.prototype.isOperatorEnabled=function(e){var t=f(e),r=this.options.operators||{};return"in"===t?!!r["in"]:!(t in r&&!r[t])},h.prototype.getCoordinates=function(){var e,t=0,r=-1;do t++,e=this.pos-r,r=this.expression.indexOf("\n",r+1);while(r>=0&&r<this.pos);return{line:t,column:e}},h.prototype.parseError=function(e){var t=this.getCoordinates();throw new Error("parse error ["+t.line+":"+t.column+"]: "+e)},y.prototype.next=function(){return this.current=this.nextToken,this.nextToken=this.tokens.next()},y.prototype.tokenMatches=function(e,t){return void 0===t||(Array.isArray(t)?l(t,e.value):"function"==typeof t?t(e):e.value===t)},y.prototype.save=function(){this.savedCurrent=this.current,this.savedNextToken=this.nextToken,this.tokens.save()},y.prototype.restore=function(){this.tokens.restore(),this.current=this.savedCurrent,this.nextToken=this.savedNextToken},y.prototype.accept=function(e,t){return!(this.nextToken.type!==e||!this.tokenMatches(this.nextToken,t)||(this.next(),0))},y.prototype.expect=function(e,t){if(!this.accept(e,t)){var r=this.tokens.getCoordinates();throw new Error("parse error ["+r.line+":"+r.column+"]: Expected "+(t||e))}},y.prototype.parseAtom=function(t){if(this.accept("TNAME"))t.push(new e(ee,this.current.value));else if(this.accept("TNUMBER"))t.push(new e(X,this.current.value));else if(this.accept("TSTRING"))t.push(new e(X,this.current.value));else{if(!this.accept("TPAREN","("))throw new Error("unexpected "+this.nextToken);this.parseExpression(t),this.expect("TPAREN",")")}},y.prototype.parseExpression=function(e){this.parseConditionalExpression(e)},y.prototype.parseConditionalExpression=function(t){for(this.parseOrExpression(t);this.accept(ae,"?");){var r=[],a=[];this.parseConditionalExpression(r),this.expect(ae,":"),this.parseConditionalExpression(a),t.push(new e(re,r)),t.push(new e(re,a)),t.push(i("?"))}},y.prototype.parseOrExpression=function(e){for(this.parseAndExpression(e);this.accept(ae,"or");)this.parseAndExpression(e),e.push(r("or"))},y.prototype.parseAndExpression=function(e){for(this.parseComparison(e);this.accept(ae,"and");)this.parseComparison(e),e.push(r("and"))};var oe=["==","!=","<","<=",">=",">","in"];y.prototype.parseComparison=function(e){for(this.parseAddSub(e);this.accept(ae,oe);){var t=this.current;this.parseAddSub(e),e.push(r(t.value))}};var ue=["+","-","||"];y.prototype.parseAddSub=function(e){for(this.parseTerm(e);this.accept(ae,ue);){var t=this.current;this.parseTerm(e),e.push(r(t.value))}};var le=["*","/","%"];y.prototype.parseTerm=function(e){for(this.parseFactor(e);this.accept(ae,le);){var t=this.current;this.parseFactor(e),e.push(r(t.value))}},y.prototype.parseFactor=function(e){var r=this.tokens.unaryOps;if(this.save(),this.accept(ae,function(e){return e.value in r}))if("-"!==this.current.value&&"+"!==this.current.value&&"TPAREN"===this.nextToken.type&&"("===this.nextToken.value)this.restore(),this.parseExponential(e);else{var i=this.current;this.parseFactor(e),e.push(t(i.value))}else this.parseExponential(e)},y.prototype.parseExponential=function(e){for(this.parsePostfixExpression(e);this.accept(ae,"^");)this.parseFactor(e),e.push(r("^"))},y.prototype.parsePostfixExpression=function(e){for(this.parseFunctionCall(e);this.accept(ae,"!");)e.push(t("!"))},y.prototype.parseFunctionCall=function(r){var i=this.tokens.unaryOps;if(this.accept(ae,function(e){return e.value in i})){var a=this.current;this.parseAtom(r),r.push(t(a.value))}else for(this.parseMemberExpression(r);this.accept("TPAREN","(");)if(this.accept("TPAREN",")"))r.push(new e(te,0));else{var n=this.parseArgumentList(r);r.push(new e(te,n))}},y.prototype.parseArgumentList=function(e){for(var t=0;!this.accept("TPAREN",")");)for(this.parseExpression(e),++t;this.accept("TCOMMA");)this.parseExpression(e),++t;return t},y.prototype.parseMemberExpression=function(t){for(this.parseAtom(t);this.accept(ae,".");){if(!this.allowMemberAccess)throw new Error('unexpected ".", member access is not permitted');this.expect("TNAME"),t.push(new e(ie,this.current.value))}};var ce=4.7421875,de=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22];Y.prototype.parse=function(e){var t=[],r=new y(this,new h(this,e),{allowMemberAccess:this.options.allowMemberAccess});return r.parseExpression(t),r.expect("TEOF","EOF"),new d(t,this)},Y.prototype.evaluate=function(e,t){return this.parse(e).evaluate(t)};var pe=new Y;return Y.parse=function(e){return pe.parse(e)},Y.evaluate=function(e,t){return pe.parse(e).evaluate(t)},{Parser:Y,Expression:d}})}]),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,r,i){var a={invalid:[],getCaret:function(){try{var e,r=0,i=t.get(0),n=document.selection,s=i.selectionStart;return n&&navigator.appVersion.indexOf("MSIE 10")===-1?(e=n.createRange(),e.moveStart("character",-a.val().length),r=e.text.length):(s||"0"===s)&&(r=s),r}catch(o){}},setCaret:function(e){try{if(t.is(":focus")){var r,i=t.get(0);i.setSelectionRange?(i.focus(),i.setSelectionRange(e,e)):(r=i.createTextRange(),r.collapse(!0),r.moveEnd("character",e),r.moveStart("character",e),r.select())}}catch(a){}},events:function(){t.on("keydown.mask",function(e){t.data("mask-keycode",e.keyCode||e.which)}).on(e.jMaskGlobals.useInput?"input.mask":"keyup.mask",a.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===a.val()||t.data("changed")||t.trigger("change"),t.data("changed",!1)}).on("blur.mask",function(){o=a.val()}).on("focus.mask",function(t){i.selectOnFocus===!0&&e(t.target).select()}).on("focusout.mask",function(){i.clearIfNotMatch&&!n.test(a.val())&&a.val("")})},getRegexMask:function(){for(var e,t,i,a,n,o,u=[],l=0;l<r.length;l++)e=s.translation[r.charAt(l)],e?(t=e.pattern.toString().replace(/.{1}$|^.{1}/g,""),i=e.optional,a=e.recursive,a?(u.push(r.charAt(l)),n={digit:r.charAt(l),pattern:t}):u.push(i||a?t+"?":t)):u.push(r.charAt(l).replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"));return o=u.join(""),n&&(o=o.replace(new RegExp("("+n.digit+"(.*"+n.digit+")?)"),"($1)?").replace(new RegExp(n.digit,"g"),n.pattern)),new RegExp(o)},destroyEvents:function(){t.off(["input","keydown","keyup","paste","drop","blur","focusout",""].join(".mask "))},val:function(e){var r,i=t.is("input"),a=i?"val":"text";return arguments.length>0?(t[a]()!==e&&t[a](e),r=t):r=t[a](),r},getMCharsBeforeCount:function(e,t){for(var i=0,a=0,n=r.length;a<n&&a<e;a++)s.translation[r.charAt(a)]||(e=t?e+1:e,i++);return i},caretPos:function(e,t,i,n){var o=s.translation[r.charAt(Math.min(e-1,r.length-1))];return o?Math.min(e+i-t-n,i):a.caretPos(e+1,t,i,n)},behaviour:function(r){r=r||window.event,a.invalid=[];var i=t.data("mask-keycode");if(e.inArray(i,s.byPassKeys)===-1){var n=a.getCaret(),o=a.val(),u=o.length,l=a.getMasked(),c=l.length,d=a.getMCharsBeforeCount(c-1)-a.getMCharsBeforeCount(u-1),p=n<u;return a.val(l),p&&(8!==i&&46!==i&&(n=a.caretPos(n,u,c,d)),a.setCaret(n)),a.callbacks(r)}},getMasked:function(e,t){var n,o,u=[],l=void 0===t?a.val():t+"",c=0,d=r.length,p=0,h=l.length,f=1,y="push",m=-1;for(i.reverse?(y="unshift",f=-1,n=0,c=d-1,p=h-1,o=function(){return c>-1&&p>-1}):(n=d-1,o=function(){return c<d&&p<h});o();){var v=r.charAt(c),g=l.charAt(p),j=s.translation[v];j?(g.match(j.pattern)?(u[y](g),j.recursive&&(m===-1?m=c:c===n&&(c=m-f),n===m&&(c-=f)),c+=f):j.optional?(c+=f,p-=f):j.fallback?(u[y](j.fallback),c+=f,p-=f):a.invalid.push({p:p,v:g,e:j.pattern}),p+=f):(e||u[y](v),g===v&&(p+=f),c+=f)}var w=r.charAt(n);return d!==h+1||s.translation[w]||u.push(w),u.join("")},callbacks:function(e){var n=a.val(),s=n!==o,u=[n,e,t,i],l=function(e,t,r){"function"==typeof i[e]&&t&&i[e].apply(this,r)};l("onChange",s===!0,u),l("onKeyPress",s===!0,u),l("onComplete",n.length===r.length,u),l("onInvalid",a.invalid.length>0,[n,e,t,a.invalid,i])}};t=e(t);var n,s=this,o=a.val();r="function"==typeof r?r(a.val(),void 0,t,i):r,s.mask=r,s.options=i,s.remove=function(){var e=a.getCaret();return a.destroyEvents(),a.val(s.getCleanVal()),a.setCaret(e-a.getMCharsBeforeCount(e)),t},s.getCleanVal=function(){return a.getMasked(!0)},s.getMaskedVal=function(e){return a.getMasked(!1,e)},s.init=function(r){if(r=r||!1,i=i||{},s.clearIfNotMatch=e.jMaskGlobals.clearIfNotMatch,s.byPassKeys=e.jMaskGlobals.byPassKeys,s.translation=e.extend({},e.jMaskGlobals.translation,i.translation),s=e.extend(!0,{},s,i),n=a.getRegexMask(),r===!1){i.placeholder&&t.attr("placeholder",i.placeholder),t.data("mask")&&t.attr("autocomplete","off"),a.destroyEvents(),a.events();var o=a.getCaret();a.val(a.getMasked()),a.setCaret(o+a.getMCharsBeforeCount(o,!0))}else a.events(),a.val(a.getMasked())},s.init(!t.is("input"))};e.maskWatchers={};var r=function(){var r=e(this),a={},n="data-mask-",s=r.attr("data-mask");if(r.attr(n+"reverse")&&(a.reverse=!0),r.attr(n+"clearifnotmatch")&&(a.clearIfNotMatch=!0),"true"===r.attr(n+"selectonfocus")&&(a.selectOnFocus=!0),i(r,s,a))return r.data("mask",new t(this,s,a))},i=function(t,r,i){i=i||{};var a=e(t).data("mask"),n=JSON.stringify,s=e(t).val()||e(t).text();try{return"function"==typeof r&&(r=r(s)),"object"!=typeof a||n(a.options)!==n(i)||a.mask!==r}catch(o){}},a=function(e){var t,r=document.createElement("div");return e="on"+e,t=e in r,t||(r.setAttribute(e,"return;"),t="function"==typeof r[e]),r=null,t};e.fn.mask=function(r,a){a=a||{};var n=this.selector,s=e.jMaskGlobals,o=s.watchInterval,u=a.watchInputs||s.watchInputs,l=function(){if(i(this,r,a))return e(this).data("mask",new t(this,r,a))};return e(this).each(l),n&&""!==n&&u&&(clearInterval(e.maskWatchers[n]),e.maskWatchers[n]=setInterval(function(){e(document).find(n).each(l)},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 i=t instanceof e?t:e(t);i.filter(e.jMaskGlobals.dataMaskAttr).each(r)};var n={maskElements:"input,td,span,div",dataMaskAttr:"*[data-mask]",dataMask:!0,watchInterval:300,watchInputs:!0,useInput:a("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 r=e.originalEvent.changedTouches[0],i=document.createEvent("MouseEvents");i.initMouseEvent(t,!0,!0,window,1,r.screenX,r.screenY,r.clientX,r.clientY,!1,!1,!1,!1,0,null),e.target.dispatchEvent(i)}}if(e.support.touch="ontouchend"in document,e.support.touch){var r,i=e.ui.mouse.prototype,a=i._mouseInit,n=i._mouseDestroy;i._touchStart=function(e){var i=this;!r&&i._mouseCapture(e.originalEvent.changedTouches[0])&&(r=!0,i._touchMoved=!1,t(e,"mouseover"),t(e,"mousemove"),t(e,"mousedown"))},i._touchMove=function(e){r&&(this._touchMoved=!0,t(e,"mousemove"))},i._touchEnd=function(e){r&&(t(e,"mouseup"),t(e,"mouseout"),this._touchMoved||t(e,"click"),r=!1)},i._mouseInit=function(){var t=this;t.element.bind({touchstart:e.proxy(t,"_touchStart"),touchmove:e.proxy(t,"_touchMove"),touchend:e.proxy(t,"_touchEnd")}),a.call(t)},i._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);