whoami7 - Manager
:
/
home
/
rattkxnv
/
www
/
wp-content
/
plugins
/
fluentform
/
assets
/
js
/
Upload File:
files >> /home/rattkxnv/www/wp-content/plugins/fluentform/assets/js/fluentform-advanced.js
(()=>{"use strict";const e=function(e,t){var n=t.find(".jss-ff-el-net-promoter");n.length&&e.each(n,(function(t,n){e(n).on("click","label",(function(t){var n=e(this);n.addClass("active"),n.prevAll().removeClass("active"),n.nextAll().removeClass("active")}))}))};var t=function(e){!function(e){e.on("click",".js-repeat .repeat-plus",(function(e){var t=jQuery(this),n=t.closest(".ff-el-repeat"),a=parseInt(n.data("max_repeat")),r=n.find(".ff-t-cell:first-child .ff-el-input--content > input").length;if(!(a&&a<=r)){a&&a-r==1&&n.find(".repeat-plus").hide();var i=t.closest("div"),o=i.index(),f=t.closest(".ff-el-input--content").find(".ff-t-cell").length;t.closest(".ff-el-input--content").find(".ff-t-cell").each((function(e,t){var n=jQuery(this).find(".ff-el-form-control:last-child"),a=n.attr("tabindex"),r=n.clone(),i={value:"",id:"ffrpt-"+(new Date).getTime()+e};a&&(i.tabIndex=parseInt(a)+f),r.prop(i),r.insertAfter(n)})),i.clone().insertAfter(i),t.closest(".ff-el-input--content").find(".ff-t-cell").eq(0).find("input:eq(".concat(o+1,")")).focus()}})),e.on("click",".js-repeat .repeat-minus",(function(e){var t=!1,n=jQuery(this),a=n.closest("div");n.closest(".ff-el-repeat").find(".repeat-plus").show(),n.closest(".ff-el-input--content").find(".ff-t-cell").each((function(){var e=a.index(),n=jQuery(this).find(".ff-el-form-control:eq("+e+")");a.siblings().length&&(t=n.remove().length)})),t&&a.remove()}))}(e),function(e){var t=window.localStorage.getItem("ff_window_type");jQuery(".ff_form_preview").length&&jQuery(".ff_flexible_table").addClass(t),e.on("screen-change",(function(e,t){jQuery(".ff_form_preview").length&&("375px"===t?jQuery(".ff_flexible_table").addClass("mobile"):jQuery(".ff_flexible_table").removeClass("mobile"))})),e.on("click",".js-repeater .repeat-plus",(function(e){var t=jQuery(this),n=t.closest("table"),a=t.closest("tr"),r=parseInt(n.attr("data-max_repeat")),i=n.find("tbody tr").length;if(r&&i==r)n.addClass("repeat-maxed");else{var o=a.clone();o.find("td").each((function(e,t){var n=jQuery(this).find(".ff-el-form-control:last-child"),a="ffrpt-"+(new Date).getTime()+e,r={value:n.attr("data-default")||"",id:a};n.prop(r);var i=n.attr("data-mask");i&&n.mask(i)})),o.insertAfter(a);var f=n.attr("data-root_name"),l=0;n.find("tbody tr").each((function(e,t){jQuery(this).find(".ff-el-form-control").each((function(t,n){var a=jQuery(n);0==e&&(l=a.attr("tabindex")),a.prop({name:f+"["+e+"][]"}),a.attr("data-name",f+"_"+t+"_"+e),l&&a.attr("tabindex",l)}))})),o.find(".ff-el-form-control")[0].focus(),n.trigger("repeat_change"),r&&i+1==r&&n.addClass("repeat-maxed")}})),e.on("click",".js-repeater .repeat-minus",(function(e){var t=jQuery(this),n=t.closest("table");if(1!=n.find("tbody tr").length){t.closest("tr").remove(),n.removeClass("repeat-maxed");var a=n.attr("data-root_name");n.find("tbody tr").each((function(e,t){jQuery(this).find(".ff-el-form-control").each((function(t,n){jQuery(n).prop({name:a+"["+e+"][]"})}))})),n.trigger("repeat_change")}})),e.on("click",".js-container-repeat-buttons .repeat-plus",(function(e){var t=jQuery(this),n=t.closest(".ff-repeater-container"),a=t.closest(".ff_repeater_cont_row"),r=parseInt(n.attr("data-max_repeat")),i=n.attr("data-root_name"),o=n.find(".ff_repeater_cont_row").length;if(r&&o==r)n.addClass("repeat-maxed");else{var f=a.clone();f.find(".ff_repeater_cell").each((function(e,t){var n=jQuery(this).find(".ff-el-form-control:last-child"),a="ffrpt-"+(new Date).getTime()+e,r={value:n.attr("data-default")||"",id:a};n.prop(r);var i=n.attr("data-mask");i&&n.mask(i),jQuery(this).find("label").attr("for",a)})),f.insertAfter(a);var l=0;n.find(".ff_repeater_cont_row").each((function(e,t){jQuery(this).find(".ff-el-form-control").each((function(t,n){var a=jQuery(n);0==e&&(l=a.attr("tabindex")),a.prop({name:i+"["+e+"][]"}),a.attr("data-name",i+"_"+t+"_"+e),l&&a.attr("tabindex",l)}))})),f.find(".ff-el-form-control")[0].focus(),n.trigger("repeat_change"),r&&o+1==r&&n.addClass("repeat-maxed")}})),e.on("click",".js-container-repeat-buttons .repeat-minus",(function(e){var t=jQuery(this),n=t.closest(".ff-repeater-container"),a=t.closest(".ff_repeater_cont_row");n.find(".ff_repeater_cont_row").length>1&&(a.remove(),n.removeClass("repeat-maxed"),n.trigger("repeat_change"))}))}(e),function(e){e.on("keydown",".repeat-plus",(function(e){"Enter"===e.key&&(e.preventDefault(),jQuery(this).click())})),e.on("keydown",".repeat-minus",(function(e){"Enter"===e.key&&(e.preventDefault(),jQuery(this).click())}))}(e)};function n(){n=function(e,t){return new i(e,void 0,t)};var e=RegExp.prototype,t=new WeakMap;function i(e,n,r){var o=new RegExp(e,n);return t.set(o,r||t.get(e)),a(o,i.prototype)}function o(e,n){var a=t.get(n);return Object.keys(a).reduce((function(t,n){var r=a[n];if("number"==typeof r)t[n]=e[r];else{for(var i=0;void 0===e[r[i]]&&i+1<r.length;)i++;t[n]=e[r[i]]}return t}),Object.create(null))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&a(e,t)}(i,RegExp),i.prototype.exec=function(t){var n=e.exec.call(this,t);if(n){n.groups=o(n,this);var a=n.indices;a&&(a.groups=o(a,this))}return n},i.prototype[Symbol.replace]=function(n,a){if("string"==typeof a){var i=t.get(this);return e[Symbol.replace].call(this,n,a.replace(/\$<([^>]+)>/g,(function(e,t){var n=i[t];return"$"+(Array.isArray(n)?n.join("$"):n)})))}if("function"==typeof a){var f=this;return e[Symbol.replace].call(this,n,(function(){var e=arguments;return"object"!=r(e[e.length-1])&&(e=[].slice.call(e)).push(o(e,f)),a.apply(this,e)}))}return e[Symbol.replace].call(this,n,a)},n.apply(this,arguments)}function a(e,t){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},a(e,t)}function r(e){return r="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},r(e)}function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var a=0,r=function(){};return{s:r,n:function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,f=!0,l=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return f=e.done,e},e:function(e){l=!0,i=e},f:function(){try{f||null==n.return||n.return()}finally{if(l)throw i}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function f(e,t){for(var n=0;n<t.length;n++){var a=t[n];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(e,l(a.key),a)}}function l(e){var t=function(e,t){if("object"!=r(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=r(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==r(t)?t:String(t)}const s=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.fields=t,this.formData=n,this.counter=0,this.field_statues={}}var t,a,o;return t=e,(a=[{key:"setFields",value:function(e){this.fields=e}},{key:"setFormData",value:function(e){this.formData=e}},{key:"getCalculatedStatuses",value:function(){for(var e=0,t=Object.keys(this.fields);e<t.length;e++){var n=t[e],a=this.fields[n];this.field_statues[n]=this.evaluate(a,n)}return this.field_statues}},{key:"evaluate",value:function(e,t){var n=this;if(e._visited)return console.warn("Circular dependency detected for field: ".concat(t)),!1;var a=!1;if(e.status){var r,i;this.counter++;var o=e.type,f=1;if(e._visited=!0,"group"===o&&null!=e&&e.condition_groups?a=this.evaluateGroups(e.condition_groups):("any"==o&&(f=0),e.conditions.forEach((function(e){var a=n.getItemEvaluateValue(e,n.formData[e.field]);a&&n.fields[e.field]&&e.field!=t&&(a=n.evaluate(n.fields[e.field],e.field)),"any"==o?a&&(f=1):!a&&f&&(f=!1)})),a=1==f),e._visited=!1,(null!==(r=e.conditions)&&void 0!==r&&r.length||null!==(i=e.condition_groups)&&void 0!==i&&i.length)&&!a)return a}return e.container_condition&&(a=this.evaluate(e.container_condition,t)),a}},{key:"evaluateGroups",value:function(e){var t,n=i(e);try{for(n.s();!(t=n.n()).done;){var a=t.value;if(a&&Array.isArray(a.rules)&&0!==a.rules.length)try{console.log("Evaluating group rules:",a.rules);var r=this.evaluateRuleGroup(a.rules);if(console.log("Group evaluation result:",r),!0===r)return!0}catch(e){console.warn("Error evaluating group:",e);continue}}}catch(e){n.e(e)}finally{n.f()}return!1}},{key:"evaluateRuleGroup",value:function(e){var t=this;return e.map((function(e){try{var n=t.getItemEvaluateValue(e,t.formData[e.field]);return n&&t.fields[e.field]&&t.fields[e.field].status?t.evaluate(t.fields[e.field],e.field):n}catch(t){return console.warn("Error evaluating rule:",e,t),!1}})).every((function(e){return!0===e}))}},{key:"getItemEvaluateValue",value:function(e,t){t=t||null;var n=jQuery("[name='".concat(e.field,"']"));return"="==e.operator?""===e.value?null===t:"object"==r(t)?null!==t&&-1!=t.indexOf(e.value):n.hasClass("ff_numeric")?this.parseFormattedNumericValue(n,t)==this.parseFormattedNumericValue(n,e.value):t==e.value:"!="==e.operator?"object"==r(t)?null!==t&&-1==t.indexOf(e.value):n.hasClass("ff_numeric")?this.parseFormattedNumericValue(n,t)!=this.parseFormattedNumericValue(n,e.value):t!=e.value:">"==e.operator?t&&this.parseFormattedNumericValue(n,t)>this.parseFormattedNumericValue(n,e.value):"<"==e.operator?t&&this.parseFormattedNumericValue(n,t)<this.parseFormattedNumericValue(n,e.value):">="==e.operator?t&&this.parseFormattedNumericValue(n,t)>=this.parseFormattedNumericValue(n,e.value):"<="==e.operator?t&&this.parseFormattedNumericValue(n,t)<=this.parseFormattedNumericValue(n,e.value):"startsWith"==e.operator?t&&t.startsWith(e.value):"endsWith"==e.operator?t&&t.endsWith(e.value):"contains"==e.operator?null!==t&&-1!=t.indexOf(e.value):"doNotContains"==e.operator?null!==t&&-1==t.indexOf(e.value):"test_regex"==e.operator&&(t=t||"",this.stringToRegex(e.value).test(t))}},{key:"stringToRegex",value:function(e){var t,a=(null===(t=String(e).match(n(/^\/(.*)\/([gimsuy]*)$/,{body:1,flags:2})))||void 0===t?void 0:t.groups)||{},r=a.body,i=a.flags;return r?(i=i||"g",RegExp(r,i)):new RegExp(e,"g")}},{key:"parseFormattedNumericValue",value:function(e,t){if(e.hasClass("ff_numeric")){var n=JSON.parse(e.attr("data-formatter"));return currency(t,n).value}return Number(t)||0}}])&&f(t.prototype,a),o&&f(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();const c=function(e,t,n){var a="."+n.form_instance;(function(){var r=this,i={},o={},f=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:300;return function(){for(var a=arguments.length,i=new Array(a),o=0;o<a;o++)i[o]=arguments[o];clearTimeout(t),t=setTimeout((function(){return e.apply(r,i)}),n)}}((function(e){l(e)}),n.debounce_time||300),l=function(n){e.each(n,(function(e,t){var n=u(e).closest(".has-conditions");t?("0px"==n.css("height")&&n.attr("style",""),n.removeClass("ff_excluded").addClass("ff_cond_v").slideDown(200)):n.removeClass("ff_cond_v").addClass("ff_excluded").slideUp(200)})),t.trigger("do_calculation"),t.trigger("ff_render_dynamic_smartcodes",t)},c=function(){var n={};return e.each(i,(function(a,r){var i=r.prop("type")||r.attr("data-type");if("radio"==i)n[a]="",r.each((function(t,r){e(r).is(":checked")&&(n[a]=e(r).val())}));else if("checkbox"==i)a=a.replace("[]",""),n[a]=[],r.each((function(t,r){e(r).is(":checked")&&n[a].push(e(r).val())}));else if("select-multiple"==i){a=a.replace("[]","");var o=r.val();n[a]=o||[]}else if("file"==i){var f="";t.find("input[name="+a+"]").closest(".ff-el-input--content").find(".ff-uploaded-list").find(".ff-upload-preview[data-src]").each((function(t,n){f+=e(this).data("src")})),n[a]=f}else n[a]=r.val()})),n},u=function(t){var n=e(a),r=e("[data-name='"+t+"']",n);return(r=r.length?r:e("[name='"+t+"']",n)).length?r:e("[name='"+t+"[]']",n)};return{init:function(){if(n.conditionals){e.each(n.conditionals,(function(t,n){t&&("group"==n.type&&n.condition_groups?e.each(n.condition_groups,(function(t,n){e.each(n.rules,(function(e,t){var n=u(t.field);i[n.prop("name")]=n}))})):e.each(n.conditions,(function(e,t){var n=u(t.field);i[n.prop("name")]=n})))})),o=c();var t=new s(n.conditionals,o);e.each(i,(function(e,n){n.on("keyup change",(function(){o=c(),t.setFormData(o),f(t.getCalculatedStatuses())}))})),l(t.getCalculatedStatuses())}}}})().init()};function u(e){return u="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},u(e)}function d(e){return d="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},d(e)}function p(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,a)}return n}function v(e,t,n){var a;return a=function(e,t){if("object"!=d(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var a=n.call(e,t||"default");if("object"!=d(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"),(t="symbol"==d(a)?a:String(a))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function m(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return h(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return h(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,a=new Array(t);n<t;n++)a[n]=e[n];return a}function g(e,t,n,a){var r=0,i="";n.stepAnimationDuration=parseInt(n.stepAnimationDuration);var o="yes"==t.find(".ff-step-container").attr("data-enable_step_data_persistency"),f=!1;o&&(f="yes"==t.find(".ff-step-container").attr("data-enable_step_page_resume"));var l=!!window.fluentFormVars.is_rtl,s=!1,c=function(){return window.fluentFormApp(t)},u=function(t){var a=t.response,r=t.step_completed,i=[];if(jQuery.each(a,(function(t,a){if(a){var r=Object.prototype.toString.call(a);if("[object Object]"===r){var o=jQuery("[data-name=".concat(t,"]"));if(o.length&&"tabular-element"===o.attr("data-type"))jQuery.each(a,(function(n,a){var r=jQuery('[name="'.concat(t,"[").concat(n,']\\[\\]"]'));r.length||(r=jQuery('[name="'.concat(t,"[").concat(n,']"]'))),jQuery.each(r,(function(t,n){var r=e(n).val();-1===jQuery.inArray(r,a)&&r!==a||e(n).prop("checked",!0).change()}))}));else if("chained-select"===o.attr("data-type")){var f={meta_key:o.find("select:first").attr("data-meta_key"),form_id:o.closest("form").attr("data-form_id"),action:"fluentform_get_chained_select_options",filter_options:"all",keys:a};jQuery.getJSON(n.ajaxUrl,f).then((function(e){jQuery.each(e,(function(e,t){var n=o.find("select[data-key='".concat(e,"']"));0!=n.attr("data-index")&&jQuery.each(t,(function(e,t){n.append(jQuery("<option />",{value:t,text:t}))})),n.attr("disabled",!1).val(a[e])}))}))}else jQuery.each(a,(function(e,n){jQuery('[name="'.concat(t,"[").concat(e,']"]')).val(n).change()}))}else if("[object Array]"===r){var l=jQuery("[name=".concat(t,"]"));if("file"==(l=(l=l.length?l:jQuery("[data-name=".concat(t,"]"))).length?l:jQuery("[name=".concat(t,"\\[\\]]"))).attr("type"))j(l,a);else if(l.prop("multiple"))if(e.isFunction(window.Choices)){var s=l.data("choicesjs");i.push({handler:s,values:a})}else l.val(a).change();else if("repeater_field"===l.attr("data-type")){var c=l.find("tbody"),u=l.attr("data-name");jQuery.each(a,(function(t,n){0!=t?c.find("tr:last").clone().appendTo(c).find(".ff-el-form-control").each((function(a,r){var i="ffrpt-"+(new Date).getTime()+a;e(r).val(n[a]),e(r).attr({id:i,name:"".concat(u,"[").concat(t,"][]"),value:n[a]}).change()})):c.find("tr:first .ff-el-form-control").each((function(t,a){e(a).val(n[t]).change()}))}))}else l.each((function(t,n){-1!=jQuery.inArray(e(n).val(),a)&&e(n).prop("checked",!0).change()}))}else{var d=jQuery("[name=".concat(t,"]"));if(d.hasClass("fluentform-post-content")&&window.wp&&window.wp.editor){var p=d.attr("id");window.tinymce.get(p).setContent(a)}if("undefined"!=typeof flatpickr&&d.prop("_flatpickr")){var v=d.prop("_flatpickr");v&&(v.config.altInput?v.setDate(a,!0):d.val(a).trigger("change"))}if("radio"===d.prop("type")||"checkbox"===d.prop("type"))jQuery("[name=".concat(t,'][value="').concat(a,'"]')).prop("checked",!0).change();else{var m=d.closest(".ff-el-group").find(".fluentform-signature-pad");if(m.length){var h=m[0].getContext("2d"),g=new Image;g.src=a,g.onload=function(){h.drawImage(g,0,0)}}d.val(a).change()}}}})),i.length>0)for(var o=0;o<i.length;o++)i[o].handler.setValue(i[o].values).change();s=!0;var l=n.stepAnimationDuration;f&&_(r,l,!0).then((function(){x(l)})).catch((function(e){console.error("An error occurred during the slider update:",e)})),s=!1},h=function(t,a){0!==t.length&&(e.each(t,(function(t,n){e(n).attr("data-step-number",t)})),t.on("click",(function(t){var r=c(),i=e(this),o=0,f=n.stepAnimationDuration;try{var l=i.data("step-number");if(isNaN(l))return;e.each(a,(function(t,n){if(o=t,t<l){var a=e(n).find(":input").not(":button").filter((function(t,n){return!e(n).closest(".has-conditions").hasClass("ff_excluded")}));a.length&&r.validate(a)}})),_(l,f,!0).then((function(){x(f)})).catch((function(e){console.error("An error occurred during the slider update:",e)}))}catch(t){if(!(t instanceof window.ffValidationError))throw t;_(o,f,!0).then((function(){x(f)})).catch((function(e){console.error("An error occurred during the slider update:",e)})),r.showErrorMessages(t.messages),r.scrollToFirstError(350)}})))},g=function(a){if(t.find(".ff-el-progress").length){var r=a.totalSteps,i=a.activeStep,o=100/r*(i+1),f=t.find(".ff-el-progress-title li"),l=t.find(".ff-step-header .ff-el-progress-bar"),s=l.find("span");l.css({width:o+"%"}),o?l.append(s.text(parseInt(o)+"%")):s.empty();var c=n.step_text,u=e(f[i]).text();c=c.replace("%activeStep%",i+1).replace("%totalStep%",r).replace("%stepTitle%",u),t.find(".ff-el-progress-status").html(c),f.css("display","none"),e(f[i]).css("display","inline")}},y=function(n){x(n),e(a).on("click",".fluentform-step .step-nav button, .fluentform-step .step-nav img",(function(a){var i=e(this).data("action"),o="next",f=e(this).closest(".fluentform-step"),l=c();if("next"==i){try{var s=f.find(":input").not(":button").filter((function(t,n){return!e(n).closest(".has-conditions").hasClass("ff_excluded")}));s.length&&l.validate(s),r++}catch(a){if(!(a instanceof window.ffValidationError))throw a;return l.showErrorMessages(a.messages),void l.scrollToFirstError(350)}t.trigger("ff_to_next_page",r),jQuery(document).trigger("ff_to_next_page",{step:r,form:t});var u=t.find(".fluentform-step");t.trigger("ff_render_dynamic_smartcodes",e(u[r]))}else r--,o="prev",t.trigger("ff_to_prev_page",r),jQuery(document).trigger("ff_to_prev_page",{step:r,form:t});var d="yes"!=t.find(".ff-step-container").attr("data-disable_auto_focus");_(r,n,d,o).then((function(){x(n)})).catch((function(e){console.error("An error occurred during the slider update:",e)}))}))},_=function(n,i){var f=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],c=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"next";return new Promise((function(u){e("div"+a+"_errors").empty(),r=n;var d=t.find(".ff-step-body"),h=t.find(".ff-step-titles li"),y=t.find(".fluentform-step"),_=y.length;y.removeClass("active"),e(y[r]).addClass("active"),h.removeClass("ff_active ff_completed"),e.each(m(Array(r).keys()),(function(t){e(e(h[t])).addClass("ff_completed")})),e(h[r]).addClass("ff_active");var b,x=l?{right:-100*r+"%"}:{left:-100*r+"%"};switch(e(y[r]).closest(".ff-step-container").data("animation_type")){case"slide":d.css("transition","all ".concat(i,"ms")),d.css(x),b=new Promise((function(e){return setTimeout(e,i)}));break;case"fade":d.css("transition","all ".concat(i,"ms")),d.css(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(Object(n),!0).forEach((function(t){v(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({opacity:0},x)),setTimeout((function(){d.css({opacity:1})}),50),b=new Promise((function(e){return setTimeout(e,2*i)}));break;case"slide_down":d.hide(),d.css(x),b=d.slideDown(i).promise();break;default:d.css(x),b=Promise.resolve()}b.then((function(){if(d.css("pointer-events",""),f&&function(){if(!window.ff_disable_step_scroll){var n,a,r,o,f,l,s=t.find(".ff_step_start");n=window.ff_scroll_top_offset?window.ff_scroll_top_offset:s.offset().top-20,o=(r=(a=s).offset().top)+a.outerHeight(),l=(f=e(window).scrollTop())+e(window).height(),o>f&&r<l&&!window.ff_force_scroll||e("html, body").delay(i).animate({scrollTop:n},0)}}(),!o||s||r===_||w(t,r).then((function(e){console.log(e)})),g({activeStep:r,totalSteps:_}),y.last().hasClass("active")?t.find('button[type="submit"]').css("visibility","visible"):t.find('button[type="submit"]').css("visibility","hidden"),!window.ff_disable_auto_step){var n=t.find(".fluentform-step.active"),a=t.find(".fluentform-step.active > div").length-1,l=t.find(".fluentform-step.active > .ff_excluded").length;if(t.find(".fluentform-step.active > .ff-t-container").length&&(a-=t.find(".fluentform-step.active > .ff-t-container").length,a+=t.find(".fluentform-step.active > .ff-t-container > .ff-t-cell > div").length,l+=t.find(".fluentform-step.active > .ff-t-container > .ff-t-cell > .ff_excluded").length,t.find(".fluentform-step.active > .ff-t-container.ff_excluded").length&&(l-=t.find(".fluentform-step.active > .ff-t-container.ff_excluded").length,l-=t.find(".fluentform-step.active > .ff-t-container.ff_excluded > .ff-t-cell > .ff_excluded").length,l+=t.find(".fluentform-step.active > .ff-t-container.ff_excluded > .ff-t-cell > div").length)),a===l)return n.find(".step-nav button[data-action="+c+"], .step-nav img[data-action="+c+"]").click(),void u()}t.find(".fluentform-step.active").find('.step-nav button[data-action="next"]').css("visibility","visible"),t.find(".fluentform-step.active").find('.step-nav button[data-action="prev"]').css("visibility","visible"),t.find(".fluentform-step.active").find('.step-nav img[data-action="next"]').css("visibility","visible"),t.find(".fluentform-step.active").find('.step-nav img[data-action="prev"]').css("visibility","visible"),u()}))}))},b=!0;function x(n){var r=!1;function i(){return t.find(".fluentform-step").index(t.find(".fluentform-step.active"))}function o(){return t.find(".fluentform-step").length}function f(r){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o="yes"!=t.find(".ff-step-container").attr("data-disable_auto_focus");if(!b)if(o){var f=r.find("input, .ff-custom_html, select, textarea, button, a").filter(":visible");f.length&&i&&setTimeout((function(){f.first().focus()}),n+50),b=!1}else{var l;!(null===(l=window.fluentFormVars)||void 0===l||!l.step_change_focus)&&setTimeout((function(){e("".concat(a," .fluentform-step.active")).attr("tabindex","-1").focus().removeAttr("tabindex")}),n),b=!1}}function l(){r=!0,setTimeout((function(){r=!1,f(t.find(".fluentform-step.active"),!0)}),n+50)}function s(t,n){if(!r){var f=i(),s=0===f,c=f===o()-1;if(!("prev"===n&&s||"next"===n&&c)){t.preventDefault(),t.stopPropagation();var u="prev"===n?".ff-btn-prev":".ff-btn-next",d=e("".concat(a," .fluentform-step.active")).find(".step-nav ".concat(u));d.length&&(d.click(),l())}}}t.off("keydown.stepNavigation").on("keydown.stepNavigation",(function(t){if(!r&&("Tab"===t.key||9===t.keyCode)){var n=e("".concat(a," .fluentform-step.active")).find("input, select, textarea, button, a").filter(":visible"),f=n.first(),l=n.last(),c=i(),u=0===c,d=c===o()-1;t.shiftKey?document.activeElement===f[0]&&(u||s(t,"prev")):document.activeElement===l[0]&&(d||s(t,"next"))}})),t.on("ff_to_next_page ff_to_prev_page",(function(){l()})),"yes"!=t.find(".ff-step-container").attr("data-disable_auto_focus")&&0!==i()&&!b&&f(e("".concat(a," .fluentform-step.active")),!0),b=!1}var w=function(t,a){var r=t.find(":input").filter((function(t,n){return!e(n).closest(".has-conditions").hasClass("ff_excluded")}));r.filter((function(t,n){var a=e(n);return a.parents().hasClass("ff_repeater_table")&&"select"==a.attr("type")&&!a.val()})).prepend("<option selected disabled />");var i=r.serialize();e.each(t.find("[type=file]"),(function(t,n){var a={},r=n.name+"[]";a[r]=[],e(n).closest("div").find(".ff-uploaded-list").find(".ff-upload-preview[data-src]").each((function(t,n){a[r][t]=e(this).data("src")})),e.each(a,(function(t,n){if(n.length){var a={};a[t]=n,i+="&"+e.param(a),!0}}))}));var o={active_step:a,data:i,form_id:t.data("form_id"),action:"fluentform_step_form_save_data"};return jQuery.post(n.ajaxUrl,o)},j=function(t,a){var r=t.closest(".ff-el-input--content").find(".ff-uploaded-list");e.each(a,(function(t,a){a="object"===d(a)?a:{url:a,data_src:a};var i=e("<div/>",{class:"ff-upload-preview","data-src":a.data_src,style:"border: 1px solid rgb(111, 117, 125)"}),o=e("<div/>",{class:"ff-upload-thumb"});o.append(e("<div/>",{class:"ff-upload-preview-img",style:"background-image: url('".concat(k(a.url),"');")}));var f=e("<div/>",{class:"ff-upload-details"}),l=e("<span/>",{html:n.upload_completed_txt,class:"ff-upload-progress-inline-text ff-inline-block"}),s=a.url.substring(a.url.lastIndexOf("/")+1);s.includes("-ff-")&&(s=s.substring(s.lastIndexOf("-ff-")+4));var c=e("<div/>",{class:"ff-upload-filename",html:s}),u=e('\n <div class="ff-upload-progress-inline ff-el-progress">\n <div style="width: 100%;" class="ff-el-progress-bar"></div>\n </div>\n '),p=e("<span/>",{"data-href":"#",html:"×",class:"ff-upload-remove"}),v=e("<div>",{class:"ff-upload-filesize ff-inline-block",html:""}),m=e("<div>",{class:"ff-upload-error",style:"color:red;"});f.append(c,u,l,v,m,p),i.append(o,f),r.append(i)})),t.trigger("change_remaining",-a.length),t.trigger("change")},k=function(e){var t=e.split(/[#?]/)[0].split(".").pop().trim().toLowerCase();if(-1!=["jpg","jpeg","gif","png"].indexOf(t))return e;var n=document.createElement("canvas");n.width=60,n.height=60,n.style.zIndex=8,n.style.position="absolute",n.style.border="1px solid";var a=n.getContext("2d");return a.fillStyle="rgba(0, 0, 0, 0.2)",a.fillRect(0,0,60,60),a.font="13px Arial",a.fillStyle="white",a.textAlign="center",a.fillText(t,30,30,60),n.toDataURL()};return{init:function(){o&&jQuery(document).ready((function(e){jQuery.getJSON(n.ajaxUrl,{form_id:t.data("form_id"),action:"fluentform_step_form_get_data",nonce:null==n?void 0:n.nonce,hash:null==n?void 0:n.hash}).then((function(e){e&&u(e)}))})),t.find(".fluentform-step:first").find('.step-nav [data-action="prev"]').remove(),function(){var a=t.find(".ff-step-body"),o=t.find(".fluentform-step"),f=o.length,l=t.find(".ff-step-titles li");i=100*f+"%",a.css({width:i}),o.css({width:100/f+"%"}),e(o[r]).addClass("active"),e(l[r]).addClass("active");var s=o.first();s.hasClass("active")&&s.find('button[data-action="next"]').css("visibility","visible"),o.length&&!o.last().hasClass("active")&&t.find('button[type="submit"]').css("visibility","hidden"),g({activeStep:r,totalSteps:f}),y(n.stepAnimationDuration),h(l,o)}(),function(){function n(e){if(1==e.closest(".fluentform-step.active").find(".ff-el-group:not(.ff_excluded):not(.ff-custom_html)").length)if(e.closest(".fluentform-step.active").find(".ff_excluded").length){var t=window.ffTransitionTimeOut||400;setTimeout((function(){e.closest(".fluentform-step.active").find(".ff-btn-next").trigger("click")}),t)}else e.closest(".fluentform-step.active").find(".ff-btn-next").trigger("click")}"yes"==t.find(".ff-step-container").attr("data-enable_auto_slider")&&(t.find(".ff-el-form-check-radio,.ff-el-net-label, .ff-el-ratings label").on("click",(function(){n(e(this))})),t.find("select").on("change",(function(){n(e(this))})))}()},updateSlider:_,populateFormDataAndSetActiveStep:u}}var y,_,b=[{type:8,token:"round",show:"round",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return t||0===t||(t=2),e=parseFloat(e).toFixed(t),parseFloat(e)}},{type:0,token:"ceil",show:"ceil",value:function(e){return Math.ceil(e)}},{type:0,token:"floor",show:"floor",value:function(e){return Math.floor(e)}},{type:0,token:"abs",show:"abs",value:function(e){return Math.abs(e)}},{type:8,token:"max",show:"max",value:function(e,t){return e>t?e:t}},{type:8,token:"min",show:"min",value:function(e,t){return e<t?e:t}}];function x(e,t){var n=t.find(".ff_has_formula");if(n.length){var a={},r={};mexp.addToken(b);var i=function(){jQuery.each(n,(function(n,a){var r=jQuery(a),i=r.data("calculation_formula"),f=function(e,t){for(var n,a=[],r=RegExp(e,"g");n=r.exec(t);)delete n.input,a.push(n);return a}(/{(.*?)}/g,i),d={};jQuery.each(f,(function(e,n){var a=n[0];jQuery.each(["{input.","{select.","{checkbox.","{radio.","{repeat.","{payment."],(function(e,n){if(function(e,t){return-1!==e.indexOf(t)}(a,n)){var r=(p=a,v=new RegExp(n+"|}","g"),p.replace(v,"")),i=0;if("{select."===n)i=c(r);else if("{checkbox."===n)i=u(r);else if("{radio."===n)i=s(r);else if("{repeat."===n)i=l(r);else if("{payment."===n)i=function(e){var n=0,a=t.find(":input[data-name="+e+"]");if(a.length&&o(a)){var r=a[0].type;"radio"===r?n=s(e,!0):"hidden"===r?n=a.attr("data-payment_value"):"number"===r||"text"===r?n=window.ff_helper.numericVal(a):"checkbox"===r?n=u(e,!0):"select-one"===r&&(n=c(e,!0))}return n}(r);else{var f=t.find("input[name="+r+"]");o(f)&&(i=window.ff_helper.numericVal(f))}return d[a]=i,!1}var p,v}))})),jQuery.each(d,(function(e,t){t||(t=0),i=i.split(e).join(t)}));var p="";try{i=i.replace(/\n/g,""),p=mexp.eval(i),isNaN(p)&&(p="")}catch(e){console.log(e,a)}if("text"==r[0].type){var v=e(r),m=v.val(),h=window.ff_helper.formatCurrency(v,p);if(v.val(h).prop("defaultValue",h),""==m)return;m!=h&&v.trigger("change")}else r.text(p)}))};t.find("input[type=number],input[data-calc_value],select[data-calc_value],.ff_numeric,.ff_payment_item").on("change keyup",i),i(),t.on("do_calculation",(function(){i()}))}function o(e){return!e.closest(".ff_excluded.has-conditions").length}function f(n){var a=0,r=t.find(n);return r.closest(".ff_excluded.has-conditions").length||e.each(r,(function(t,n){var r=e(n).attr("data-calc_value");r&&!isNaN(r)&&(a+=Number(r))})),a}function l(n){var f=0,l=n.split("."),s=!1;l.length>1&&(n=l[0],s=l[1]);var c=t.find("table[data-root_name="+n+"]");if(a[n]||(a[n]=!0,c.on("repeat_change",(function(){i()}))),o(c))if(s){var u=c.find("tbody tr td:nth-child("+s+")");e.each(u,(function(t,a){var o=e(a).find(":input"),l=n+"_"+s+"_"+o.attr("id");r[l]||(r[l]=!0,o.on("change",(function(){i()})));var c=0;c="select"===o.attr("type")?parseFloat(o.find("option:selected").attr("data-calc_value")):parseFloat(o.val()),isNaN(c)||(f+=c)})),f&&(f=f.toFixed(2))}else f=c.find("tbody tr").length;return f}function s(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=0,r=t.find("input[name="+e+"]:checked");return n?r.attr("data-payment_value"):(o(r)&&(a=r.attr("data-calc_value")||0),a)}function c(e){var n;return arguments.length>1&&void 0!==arguments[1]&&arguments[1]?t.find("select[name="+e+"] option:selected").data("payment_value"):(n=f("select[data-name="+e+"] option:selected"),t.find("select[data-name="+e+"]").attr("data-calc_value",n),n)}function u(e){if(!(arguments.length>1&&void 0!==arguments[1]&&arguments[1]))return f("input[data-name="+e+"]:checked");var n=t.find(":input[data-name="+e+"]").data("group_id"),a=t.find('input[data-group_id="'+n+'"]:checked'),r=0;return a.each((function(e,t){var n=jQuery(t).data("payment_value");n&&(r+=parseFloat(n))})),r}}(y=jQuery)(document.body).on("fluentform_init",(function(n,a,r){if(a.attr("data-form_instance"),r){r.form_id_selector;var i="."+r.form_instance;if(function(e,t,n,a,r){var i=function(){jQuery.fn.fileupload&&(t.find('input[type="file"]').each((function(i,s){var c,d,p=e(this),v=p.closest(".ff-el-group");v.closest(".ff-column-container").is(".ff_columns_total_6, .ff_columns_total_5, .ff_columns_total_4")&&v.width()<162&&(d=v.width()),c=e("<div/>",{class:"ff-uploaded-list",style:"font-size:12px; margin-top: 15px;"+(d?"max-width:".concat(d,"px;"):"")}),p.closest("div").append(c);var m=c.width(),h=n.rules[p.prop("name")],g=h.max_file_count.value;"max_file_count"in h&&(h.max_file_count.remaining=Number(g));var y="";function _(e){var n=p.prop("name");t.trigger("show_element_error",{element:n,message:e})}function b(a,i){if(i&&i.files&&i.files.length){if(t.find(".ff-upload-preview-elem").remove(),"max_file_count"in h){e(r+"_errors").empty(),e(this).closest("div").find(".error").html("");var o=h.max_file_count.remaining;if(!o||i.files.length>o){var f="Maximum 1 file is allowed!";return f=g>1?"Maximum "+g+" files are allowed!":f,h.max_file_count&&h.max_file_count.message&&(f=h.max_file_count.message),_(f),!1}}var s=l(i.files[0],n.rules[p.prop("name")]);return!s.length||(_(s.join(", ")),!1)}}"allowed_file_types"in h?(y=h.allowed_file_types.value.join("|"),p.prop("accept","."+y.replace(/\|/g,",."))):(y=h.allowed_image_types.value.join("|"))?p.prop("accept","."+y.replace(/\|/g,",.")):p.prop("accept","image/*");var x=e(s);p.fileupload({dataType:"json",dropZone:p.closest(".ff-el-group"),url:a.ajaxUrl,formData:function(e){var t=e.serializeArray();return t.push({name:"action",value:"fluentform_file_upload"}),t.push({name:"formId",value:n.id}),t},change:b,add:function(t,n){if(b(0,n)){var r=e("<div/>",{class:"ff-upload-preview"+(d?" ff-upload-container-small-column-image":"")});n.context=r;var i=e("<div/>",{class:"ff-upload-thumb"}),l=e("<div/>",{class:"ff-upload-details"}),s=e("<div/>",{class:"ff-upload-preview-img",style:"background-image: url('".concat(o(n.files[0]),"');")}),u=e("<div>",{class:"ff-upload-error",style:"color:red;"}),p=e("<span/>",{html:a.upload_start_txt,class:"ff-upload-progress-inline-text ff-inline-block"}),v=e('\n\t\t\t\t\t\t\t\t\t<div class="ff-upload-progress-inline ff-el-progress">\n\t\t\t\t\t\t\t\t\t\t<div class="ff-el-progress-bar"></div>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t'),h=e("<div/>",{class:"ff-upload-filename",text:n.files[0].name}),g=e("<span/>",{"data-href":"#","data-attachment-id":"",html:"×",class:"ff-upload-remove"}),y=e("<div>",{class:"ff-upload-filesize ff-inline-block",html:f(n.files[0].size)});i.append(s),l.append(h,v,p,y,u,g),r.append(i,l),c.append(r),d||(m-=91),h.css({maxWidth:m+"px"}),n.submit(),n.context.addClass("ff_uploading")}},progress:function(e,t){var n=parseInt(t.loaded/t.total*100,10);t.context.find(".ff-el-progress-bar").css("width",n+"%"),t.context.find(".ff-upload-progress-inline-text").text(a.uploading_txt)},done:function(e,n){if(n.context.removeClass("ff_uploading"),n.result&&"data"in n.result&&"files"in n.result.data)"error"in n.result.data.files[0]?(_("Upload Error: "+n.result.data.files[0].error),n.context.remove()):(n.context.find(".ff-upload-progress-inline-text").text(a.upload_completed_txt),h.max_file_count.remaining-=1,n.context.attr("data-src",n.result.data.files[0].url),n.context.find(".ff-upload-remove").attr({"data-href":n.result.data.files[0].file,"data-attachment-id":n.result.data.files[0].attachment_id}),n.context.addClass("ff_uploading_complete"),t.find("input[name="+x.data("name")+"]").trigger("change"));else{var r="Sorry! The upload failed for some unknown reason.";if(n.messages){var i=Object.keys(n.messages);i.length&&(r=n.messages[i[0]])}_(r),n.context.remove()}},fail:function(t,n){var a,r,i,o,f=[];null===(a=n.context)||void 0===a||a.remove(),null!==(r=n.jqXHR)&&void 0!==r&&r.responseJSON&&null!==(i=n.jqXHR)&&void 0!==i&&i.responseJSON.errors?e.each(n.jqXHR.responseJSON.errors,(function(t,n){"object"==u(n)?e.each(n,(function(e,t){f.push(t)})):f.push(n)})):null!==(o=n.jqXHR)&&void 0!==o&&o.responseText?f.push(n.jqXHR.responseText):f.push("Something is wrong when uploading the file! Please try again"),_(f.join(", "))}}),x.on("change_remaining",(function(e,t){h.max_file_count.remaining+=t}))})),t.find(".ff_upload_btn").on("keyup",(function(t){32==t.keyCode&&e(this).siblings("input[type=file]").trigger("click")})))},o=function(e){if(e.type.match("image"))return URL.createObjectURL(e);var t=document.createElement("canvas");t.width=60,t.height=60,t.style.zIndex=8,t.style.position="absolute",t.style.border="1px solid";var n=t.getContext("2d");return n.fillStyle="rgba(0, 0, 0, 0.2)",n.fillRect(0,0,60,60),n.font="13px Arial",n.fillStyle="white",n.textAlign="center",n.fillText(e.name.substr(e.name.lastIndexOf(".")+1),30,30,60),t.toDataURL()},f=function(e){return e<1024?e+"bytes":e>=1024&&e<=1048576?(e/1024).toFixed(1)+"KB":e>1048576?(e/1048576).toFixed(1)+"MB":void 0},l=function(e,t){var n=[],a="",r="";if("allowed_file_types"in t?(a=t.allowed_file_types.value,r=t.allowed_file_types.message):"allowed_image_types"in t&&(a=t.allowed_image_types.value,r=t.allowed_image_types.message),a){var i=new RegExp("("+a.join("|")+")","i"),o=e.name.split(".").pop();o=o.toLowerCase(),i.test(o)||n.push(r)}return"max_file_size"in t&&e.size>t.max_file_size.value&&n.push(t.max_file_size.message),n};i(),t.find(".ff-uploaded-list").on("click",".ff-upload-remove",(function(t){t.preventDefault();var n=e(this),r=n.closest(".ff-uploaded-list"),i=r.closest(".ff-el-input--content").find("input[type=file]"),o=n.attr("data-href"),f=n.attr("data-attachment-id");"#"==o?(n.closest(".ff-upload-preview").remove(),r.find(".ff-upload-preview").length||r.siblings(".ff-upload-progress").addClass("ff-hidden"),i.trigger("change_remaining",1)):e.post(a.ajaxUrl,{path:o,attachment_id:f,action:"fluentform_delete_uploaded_file"}).then((function(e){n.closest(".ff-el-input--content").find("input"),i.trigger("change_remaining",1),n.closest(".ff-upload-preview").remove(),r.find(".ff-upload-preview").length||r.siblings(".ff-upload-progress").addClass("ff-hidden"),i.trigger("change")}))})),e(document.body).on("fluentform_reset",(function(){i()}))}(y,a,r,window.fluentFormVars,i),t(a),function(e,t){var n=t.find(".fluentform .js-repeat");e.each(n,(function(t,n){var a=e(n);if(a.find(".ff-t-cell").length>1){var r=a.find(".ff-el-group").height()-a.find(".ff-el-group").find(".ff-el-input--content").height();a.find(".js-repeat-buttons").css("margin-top",r+"px")}var i=a.find(".ff-el-group").find(".ff-el-input--content .ff-el-form-control").outerHeight();a.find(".ff-el-repeat-buttons").height(i)}))}(y,a),c(y,a,r,window.fluentFormVars),x(y,a),function(e,t){var n=t.find(".jss-ff-el-ratings");n.length&&e.each(n,(function(t,n){var a=e(n);a.find("label.active").prevAll().addClass("active"),a.on("mouseenter","label",(function(t){var n=e(this),a="[data-id="+n.find("input").attr("id")+"]";n.addClass("active"),n.prevAll().addClass("active"),n.nextAll().removeClass("active"),n.closest(".ff-el-input--content").find(".ff-el-rating-text").css("display","none"),n.closest(".ff-el-input--content").find(a).css("display","inline-block")})).on("click","label",(function(t){var n=e(this).find(".jss-ff-svg");n.addClass("scale"),n.addClass("scalling"),setTimeout((function(e){n.removeClass("scalling"),n.removeClass("scale")}),150)})).on("mouseleave",(function(t){var n=e(this),a="[data-id="+n.find("input:checked").attr("id")+"]",r=n.find("input:checked").parent("label");r.length?(r.addClass("active"),r.prevAll().addClass("active"),r.nextAll().removeClass("active")):n.find("label").removeClass("active"),n.closest(".ff-el-input--content").find(".ff-el-rating-text").css("display","none"),n.closest(".ff-el-input--content").find(a).css("display","inline-block")}))}))}(y,a),e(y,a),a.hasClass("ff-form-has-steps")){var o=g(y,a,window.fluentFormVars,i);o.init(),a.on("update_slider",(function(e,t){o.updateSlider(t.goBackToStep,t.animDuration,t.isScrollTop,t.actionType)}))}a.hasClass("ff_has_dynamic_smartcode")&&(a.on("ff_render_dynamic_smartcodes",(function(e,t){f(y(t))})),a.on("keyup change",":input",(function(){f(a)})),f(a))}else console.log("No Fluent form JS vars found!");function f(e){jQuery.each(e.find(".ff_dynamic_value"),(function(e,t){var n=y(t).data("ref");if("payment_summary"!=n){var r=a.find('.ff-el-form-control[name="'+n+'"]'),i=" ";r.length||(r=a.find('.ff-field_container[data-name="'+n+'"]').find("input")),r.length||((r=a.find('*[name="'+n+'"]:checked')).length||(r=a.find('*[name="'+n+'[]"]:checked'),i=", "),r.length||(r=a.find('*[name="'+n+'[]"]').find("option:selected"),i=", "));var o=[];if(!r.length){var f=a.find('.ff-el-repeater[data-name="'+n+'"] tbody tr');f.each((function(e){var t=y(this).find("input, select"),n=[];t.each((function(e){var t=y(this).val();if(t){var a=y(this).closest("td").data("label")||"Column-"+(e+1);n.push(a+": "+t)}})),n.length&&o.push("#"+(e+1)+"- "+n.join(" | "))})),f.length&&(i="<br/>")}y.each(r,(function(){var e=y(this).val(),t=y(this).closest(".ff-el-group.has-conditions").hasClass("ff_excluded");e&&!t&&o.push(e)}));var l="";l=o.length?o.join(i):y(t).data("fallback"),y(this).html(l.replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/<iframe[\s\S]*?>[\s\S]*?<\/iframe>/gi,"").replace(/<.*?\bon\w+=["'][^"']*["']/gi,"").replace(/javascript:/gi,"").replace(/</g,"<").replace(/>/g,">").replace(/<br\s*\/?>/gi,"<br/>").replace(/\n/g,"<br/>"))}else a.trigger("calculate_payment_summary",{element:y(t)})}))}})),(_=String.prototype).startsWith||(_.startsWith=function(e,t){return t=!t||t<0?0:+t,this.substring(t,t+e.length)===e}),_.endsWith||(_.endsWith=function(e,t){return(void 0===t||t>this.length)&&(t=this.length),this.substring(t-e.length,t)===e}),_.includes||(_.includes=function(e,t){if(e instanceof RegExp)throw TypeError("first argument must not be a RegExp");return void 0===t&&(t=0),-1!==this.indexOf(e,t)})})();
Copyright ©2021 || Defacer Indonesia