!function(){var e,t,i;!function(n){var r,o,a,l,s={},d={},c={},f={},u=Object.prototype.hasOwnProperty,h=[].slice,m=/\.js$/;function g(e,t){return u.call(e,t)}function p(e,t){var i,n,r,o,a,l,s,d,f,u,h,g=t&&t.split("/"),p=c.map,v=p&&p["*"]||{};if(e){for(a=(e=e.split("/")).length-1,c.nodeIdCompat&&m.test(e[a])&&(e[a]=e[a].replace(m,"")),"."===e[0].charAt(0)&&g&&(e=g.slice(0,g.length-1).concat(e)),f=0;f0&&(e.splice(f-1,2),f-=2)}e=e.join("/")}if((g||v)&&p){for(f=(i=e.split("/")).length;f>0;f-=1){if(n=i.slice(0,f).join("/"),g)for(u=g.length;u>0;u-=1)if((r=p[g.slice(0,u).join("/")])&&(r=r[n])){o=r,l=f;break}if(o)break;!s&&v&&v[n]&&(s=v[n],d=f)}!o&&s&&(o=s,l=d),o&&(i.splice(0,l,o),e=i.join("/"))}return e}function v(e,t){return function(){var i=h.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),o.apply(n,i.concat([e,t]))}}function y(e){return function(t){s[e]=t}}function b(e){if(g(d,e)){var t=d[e];delete d[e],f[e]=!0,r.apply(n,t)}if(!g(s,e)&&!g(f,e))throw new Error("No "+e);return s[e]}function R(e){var t,i=e?e.indexOf("!"):-1;return i>-1&&(t=e.substring(0,i),e=e.substring(i+1,e.length)),[t,e]}function _(e){return e?R(e):[]}function w(e){return function(){return c&&c.config&&c.config[e]||{}}}a=function(e,t){var i,n,r=R(e),o=r[0],a=t[1];return e=r[1],o&&(i=b(o=p(o,a))),o?e=i&&i.normalize?i.normalize(e,(n=a,function(e){return p(e,n)})):p(e,a):(o=(r=R(e=p(e,a)))[0],e=r[1],o&&(i=b(o))),{f:o?o+"!"+e:e,n:e,pr:o,p:i}},l={require:function(e){return v(e)},exports:function(e){var t=s[e];return void 0!==t?t:s[e]={}},module:function(e){return{id:e,uri:"",exports:s[e],config:w(e)}}},r=function(e,t,i,r){var o,c,u,h,m,p,R,w=[],F=typeof i;if(p=_(r=r||e),"undefined"===F||"function"===F){for(t=!t.length&&i.length?["require","exports","module"]:t,m=0;m0&&nfRadio.channel("submit").request("focus:firstInvalidInput",Object.keys(e.get("fieldErrors")))},showFields:function(){this.invoke("set",{visible:!0}),this.invoke((function(){this.trigger("change:value",this)}))},hideFields:function(){this.invoke("set",{visible:!1}),this.invoke((function(){this.trigger("change:value",this)}))},getFirstFieldByOrder:function(e){let t=0;return _.each(e,(function(e){const i=nfRadio.channel("fields").request("get:field",e).get("order");t=0===t||i()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,i="invalid-email";return Marionette.Object.extend({initialize:function(){this.listenTo(e,"change:modelValue",this.onChangeModelValue),this.listenTo(e,"keyup:field",this.emailKeyup),this.listenTo(e,"blur:field",this.onBlurField)},onChangeModelValue:function(e){var t=e.get("value"),i=e.get("id");this.emailChange(t,i)},onBlurField:function(e,t){var i=jQuery(e).val(),n=t.get("id");this.emailChange(i,n)},emailChange:function(e,n){if(0o){l=nfRadio.channel("fields").request("get:field",t.get("id")),s=nfRadio.channel("app").request("get:form",l.get("formID"));nfRadio.channel("fields").request("add:error",t.get("id"),"number-max",s.get("settings").fieldNumberNumMaxError)}else nfRadio.channel("fields").request("remove:error",t.get("id"),"number-max");var d=Math.round(1e9*parseFloat(n)),c=Math.round(1e9*parseFloat(a));if(a&&n&&0!=d%c){l=nfRadio.channel("fields").request("get:field",t.get("id")),s=nfRadio.channel("app").request("get:form",l.get("formID"));nfRadio.channel("fields").request("add:error",t.get("id"),"number-step",s.get("settings").fieldNumberIncrementBy+a)}else nfRadio.channel("fields").request("remove:error",t.get("id"),"number-step")}})})),i("controllers/mirrorField",[],(function(){var e=nfRadio.channel("fields");return Marionette.Object.extend({listeningModel:"",initialize:function(){this.listenTo(e,"init:model",this.registerMirror)},registerMirror:function(e){if(e.get("mirror_field")){this.listeningModel=e;var t=e.get("mirror_field");this.listenTo(nfRadio.channel("field-"+t),"change:modelValue",this.changeValue)}},changeValue:function(e){this.listeningModel.set("value",e.get("value")),this.listeningModel.trigger("reRender")}})})),i("controllers/confirmField",[],(function(){var e=nfRadio.channel("fields"),t="confirm-mismatch";return Marionette.Object.extend({initialize:function(){this.listenTo(e,"init:model",this.registerConfirm),this.listenTo(e,"keyup:field",this.confirmKeyup)},registerConfirm:function(e){e.get("confirm_field")&&this.listenTo(nfRadio.channel("form"),"loaded",(function(t){this.registerConfirmListeners(e)}))},registerConfirmListeners:function(e){var t=nfRadio.channel("form-"+e.get("formID")).request("get:fieldByKey",e.get("confirm_field"));void 0!==t&&(t.set("confirm_with",e.get("id")),this.listenTo(nfRadio.channel("field-"+t.get("id")),"change:modelValue",this.changeValue),this.listenTo(nfRadio.channel("field-"+e.get("id")),"change:modelValue",this.changeValue))},changeValue:function(i){if(void 0===i.get("confirm_with"))var n=i,r=nfRadio.channel("form-"+i.get("formID")).request("get:fieldByKey",n.get("confirm_field"));else r=i,n=e.request("get:field",r.get("confirm_with"));r.get("id");var o=n.get("id");if(""==n.get("value")||n.get("value")==r.get("value"))nfRadio.channel("fields").request("remove:error",o,t);else{var a=nfRadio.channel("fields").request("get:field",o),l=nfRadio.channel("app").request("get:form",a.get("formID"));nfRadio.channel("fields").request("add:error",o,t,l.get("settings").confirmFieldErrorMsg)}},confirmKeyup:function(e,i,n){var r=jQuery(e).val();if(i.get("confirm_field"))var o=i,a=i.get("id"),l=nfRadio.channel("form-"+i.get("formID")).request("get:fieldByKey",o.get("confirm_field")).get("value"),s=r;else if(i.get("confirm_with"))a=(o=nfRadio.channel("fields").request("get:field",i.get("confirm_with"))).get("id"),l=s=o.get("value");if(void 0!==o)if(""==s)nfRadio.channel("fields").request("remove:error",a,t);else if(r==l)nfRadio.channel("fields").request("remove:error",a,t);else{var d=nfRadio.channel("fields").request("get:field",a),c=nfRadio.channel("app").request("get:form",d.get("formID"));nfRadio.channel("fields").request("add:error",a,t,c.get("settings").confirmFieldErrorMsg)}}})})),i("controllers/updateFieldModel",[],(function(){return Marionette.Object.extend({initialize:function(){nfRadio.channel("nfAdmin").reply("update:field",this.updateField)},updateField:function(e,t){e.get("isUpdated")||(e.set("value",t),e.set("isUpdated",!0),_.isArray(t)&&e.trigger("change:value",e))}})})),i("controllers/submitButton",["controllers/submitButton"],(function(e){return Marionette.Object.extend({bound:{},initialize:function(){this.listenTo(nfRadio.channel("submit"),"init:model",this.registerHandlers)},registerHandlers:function(e){if(void 0!==this.bound[e.get("id")])return!1;this.listenTo(nfRadio.channel("field-"+e.get("id")),"click:field",this.click,this),e.listenTo(nfRadio.channel("form-"+e.get("formID")),"before:submit",this.beforeSubmit,e),e.listenTo(nfRadio.channel("form-"+e.get("formID")),"submit:failed",this.resetLabel,e),e.listenTo(nfRadio.channel("form-"+e.get("formID")),"submit:response",this.resetLabel,e),e.listenTo(nfRadio.channel("form-"+e.get("formID")),"enable:submit",this.maybeEnable,e),e.listenTo(nfRadio.channel("form-"+e.get("formID")),"disable:submit",this.maybeDisable,e),e.listenTo(nfRadio.channel("form-"+e.get("formID")),"processingLabel",this.processingLabel,e),e.listenTo(nfRadio.channel("fields"),"add:error",this.maybeDisable,e),e.listenTo(nfRadio.channel("fields"),"remove:error",this.maybeEnable,e),this.bound[e.get("id")]=!0},click:function(e,t){var i=nfRadio.channel("app").request("get:form",t.get("formID"));_.size(i.get("fieldErrors"))>0&&nfRadio.channel("submit").request("focus:firstInvalidInput",Object.keys(i.get("fieldErrors"))),nfRadio.channel("form-"+t.get("formID")).request("submit",i)},beforeSubmit:function(){this.get("disabled")||(this.set("disabled",!0),nfRadio.channel("form-"+this.get("formID")).trigger("processingLabel",this))},maybeDisable:function(e){void 0!==e&&e.get("formID")!=this.get("formID")||(this.set("disabled",!0),this.trigger("reRender"))},maybeEnable:function(e){if(void 0!==e&&e.get("formID")!=this.get("formID"))return!1;var t=nfRadio.channel("app").request("get:form",this.get("formID"));0==_.size(t.get("fieldErrors"))&&(this.set("disabled",!1),this.trigger("reRender"))},processingLabel:function(){this.set("oldLabel",this.get("label")),this.set("label",this.get("processing_label")),this.set("disabled",!0),this.trigger("reRender")},resetLabel:function(e){void 0!==e.errors&&void 0!==e.errors.nonce&&_.size(e.errors.nonce)>0&&void 0!==e.errors.nonce.new_nonce&&void 0!==e.errors.nonce.nonce_ts||(void 0!==this.get("oldLabel")&&this.set("label",this.get("oldLabel")),this.set("disabled",!1),this.trigger("reRender"))}})})),i("controllers/submitDebug",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(nfRadio.channel("forms"),"submit:response",this.submitDebug)},submitDebug:function(e,t,i,n){if(void 0!==e.debug){if(void 0!==e.debug.form){var r=document.createElement("span");_.each(e.debug.form,(function(e,t){var i=document.createTextNode(e);r.appendChild(i),r.appendChild(document.createElement("br"))})),jQuery(".nf-debug-msg").html(r)}if(void 0!==e.debug.console){console.log("%c%s","","NINJA SUPPORT"),_.each(e.debug.console,(function(e,t){console.log(e)})),console.log("%c%s","","END NINJA SUPPORT")}}}})})),i("controllers/getFormErrors",[],(function(){nfRadio.channel("fields");return Marionette.Object.extend({initialize:function(e){nfRadio.channel("form").reply("get:errors",this.getFormErrors)},getFormErrors:function(e){var t=nfRadio.channel("app").request("get:form",e),i=!1;return t&&(0!==t.get("errors").length&&_.each(t.get("errors").models,(function(e){(i=i||{})[e.get("id")]=e.get("msg")})),_.each(t.get("fields").models,(function(e){"submit"!=e.get("type")&&e.get("errors").length>0&&((i=i||{})[e.get("id")]=e.get("errors"))}))),i}})})),i("controllers/validateRequired",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(nfRadio.channel("fields"),"blur:field",this.validateRequired),this.listenTo(nfRadio.channel("fields"),"change:field",this.validateRequired),this.listenTo(nfRadio.channel("fields"),"keyup:field",this.validateKeyup),this.listenTo(nfRadio.channel("fields"),"change:modelValue",this.validateModelData),this.listenTo(nfRadio.channel("submit"),"validate:field",this.validateModelData)},validateKeyup:function(e,t,i){if(1!=t.get("required"))return!1;t.get("clean")||this.validateRequired(e,t)},validateRequired:function(e,t){if(1!=t.get("required")||!t.get("visible"))return!1;var i=jQuery(e).val(),n=nfRadio.channel(t.get("type")).request("validate:required",e,t),r=!0,o=this.getMask(t);if(o&&i===o&&(00&&void 0!==e.errors.nonce.new_nonce&&void 0!==e.errors.nonce.nonce_ts){nfFrontEnd.ajaxNonce=e.errors.nonce.new_nonce,nfFrontEnd.nonce_ts=e.errors.nonce.nonce_ts;var r=nfRadio.channel("app").request("get:form",n);nfRadio.channel("form-"+n).request("submit",r)}if(_.size(e.errors.fields)>0&&_.each(e.errors.fields,(function(e,t){"object"==typeof e?nfRadio.channel("fields").request("add:error",t,e.slug,e.message):nfRadio.channel("fields").request("add:error",t,"required-error",e)})),_.size(e.errors.form)>0&&_.each(e.errors.form,(function(e,t){nfRadio.channel("form-"+n).request("remove:error",t),nfRadio.channel("form-"+n).request("add:error",t,e)})),void 0!==e.errors.last&&void 0!==e.errors.last.message){var o="background: rgba( 255, 207, 115, .5 ); color: #FFA700; display: block;";console.log("%c NINJA FORMS SUPPORT: SERVER ERROR",o),console.log(e.errors.last.message),console.log("%c END SERVER ERROR MESSAGE",o)}jQuery("#nf-form-"+n+"-cont .nf-field-container").show()},focusFirstInvalidInput:function(e){const t=nfRadio.channel("fields").request("get:firstFieldByOrder",e);null!==document.getElementById("nf-field-"+t)&&document.getElementById("nf-field-"+t).focus()}})})),i("controllers/actionRedirect",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(nfRadio.channel("forms"),"submit:response",this.actionRedirect)},actionRedirect:function(e){void 0!==e.data.halt&&void 0!==e.data.halt.redirect&&""!=e.data.halt.redirect&&(window.location=e.data.halt.redirect),0==_.size(e.errors)&&void 0!==e.data.actions&&void 0!==e.data.actions.redirect&&""!=e.data.actions.redirect&&(window.location=e.data.actions.redirect)}})})),i("controllers/actionSuccess",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(nfRadio.channel("forms"),"submit:response",this.actionSubmit)},actionSubmit:function(e){if(0==_.size(e.errors)&&void 0!==e.data.actions&&void 0!==e.data.actions.success_message&&""!=e.data.actions.success_message){var t=e.data.form_id,i=jQuery("#nf-form-"+t+"-cont .nf-response-msg");const l=e.data.actions.success_message.replace(/(<([^>]+)>)/gi,"");i.attr("tabindex","0"),i.attr("aria-live","assertive"),i.attr("aria-label",l),i.html(e.data.actions.success_message).show(),i.focus();var n=i.offset().top,r=i.offset().top+i.outerHeight(),o=jQuery(window).scrollTop()+jQuery(window).height(),a=jQuery(window).scrollTop();o>r&&a "+this.localeDecodeEquation(n)+" (Setup)");const t=new Mexp;e.set("value",Number(t.eval(this.localeDecodeEquation(n))).toFixed(e.get("dec")))}catch(e){console.log(e)}"NaN"===e.get("value")&&e.set("value","0")},updateCalcFields:function(e,t,i){var n=e.get("fields");n[t]=i,e.set("fields",n)},getCalcValue:function(e){var t=nfRadio.channel(e.get("type")).request("get:calcValue",e),i=e.get("value");void 0!==t&&(t||0===t)&&(i=t);var n=new r(nfi18n.siteLocale,nfi18n.thousands_sep,nfi18n.decimal_point),o=n.numberDecoder(i),a=n.numberEncoder(i);return t=void 0!==o&&jQuery.isNumeric(o)?a:0,e.get("visible")||(t=0),t},replaceKey:function(e,t,i,n){n=n||calcModel.get("eq"),tag="{"+e+":"+t+"}";var r=new RegExp(tag,"g");calcTag="{"+e+":"+t+":calc}";var o=new RegExp(calcTag,"g");return n=(n=n.replace(r,i)).replace(o,i)},replaceAllKeys:function(e){var t=e.get("eq"),i=this;_.each(e.get("fields"),(function(e,n){t=i.replaceKey("field",n,e,t)}));var n=t.match(new RegExp(/{calc:(.*?)}/g));return n&&_.each(n,(function(i){var n=i.replace("}","").replace("{calc:",""),r=e.collection.findWhere({name:n});if(void 0!==r){var o=new RegExp(i,"g");t=t.replace(o,r.get("value"))}})),t},changeField:function(e,t){var i=t.get("key"),n=this.getCalcValue(t);this.updateCalcFields(e,i,n);var r=this.replaceAllKeys(e);r=(r=r.replace(/{([a-zA-Z0-9]|:|_|-)*}/g,"0")).replace(/\r?\n|\r/g,"");try{this.debug("Calculation Decoder "+r+" -> "+this.localeDecodeEquation(r)+" (Change Field)");const t=new Mexp;e.set("value",Number(t.eval(this.localeDecodeEquation(r))).toFixed(e.get("dec")))}catch(e){this.debug()&&console.log(e)}"NaN"===e.get("value")&&e.set("value","0")},initDisplayField:function(e){if(e.get("default")&&"string"==typeof e.get("default")){var t=e.get("default").match(new RegExp(/{calc:(.*?)}/g));t&&_.each(t,(function(t){t=t.replace("{calc:","").replace("}","").replace(":2",""),this.displayFields[t]=this.displayFields[t]||[],this.displayFields[t].push(e)}),this)}},updateDisplayFields:function(e){var t=this;void 0!==this.displayFields[e.get("name")]&&_.each(this.displayFields[e.get("name")],(function(i){var n="",r=(n="html"===i.get("type")?i.get("value"):i.get("default")).match(new RegExp(/(.*?)<\/span>/,"")+"}";n=n.replace(e,t)}));var o=n.match(new RegExp(/{calc:(.*?)}/g));_.each(o,(function(e){var r=e.replace("}","").replace("{calc:","").replace(":2",""),o=t.calcs[i.get("formID")].findWhere({name:r}),a=new RegExp(e,"g"),l=o.get("value");void 0!==l&&(l=t.applyLocaleFormatting(l,o)),n="html"===i.get("type")?n.replace(a,''+l+""):l})),i.set("value",n),t.init[e.get("name")]||i.trigger("reRender"),t.init[e.get("name")]=!1}))},getCalc:function(e,t){return this.calcs[t].findWhere({name:e})},changeCalc:function(e,t){var i=this.replaceAllKeys(e);i=(i=i.replace("[","").replace("]","")).replace(/\r?\n|\r/g,"");try{this.debug("Calculation Decoder "+i+" -> "+this.localeDecodeEquation(i)+" (Change Calc)");const t=new Mexp;e.set("value",Number(t.eval(this.localeDecodeEquation(i))).toFixed(e.get("dec")))}catch(e){console.log(e)}"NaN"===e.get("value")&&e.set("value","0")},applyLocaleFormatting:function(e,t){return new r(nfi18n.siteLocale,nfi18n.thousands_sep,nfi18n.decimal_point).numberEncoder(e,t.get("dec"))},localeDecodeEquation:function(e){var t="",i="",n=/[0-9.,]/,o=new r(nfi18n.siteLocale,nfi18n.thousands_sep,nfi18n.decimal_point);return(e=(e=e.replace(/\s/g,"")).replace(/ /g,"")).split("").forEach((function(e){n.test(e)?i+=e:(0 option").each((function(){this.text=e.pikaday._o.i18n.months[this.value]}))),e.set("locale",t)}Object.keys(e.pikaday._o).length>0&&(console.log("%cDeprecated Ninja Forms Pikaday custom code detected.","color: Red; font-size: large"),console.log("You are using deprecated Ninja Forms Pikaday custom code. Support for this custom code will be removed in a future version of Ninja Forms. Please contact Ninja Forms support for more details."))}})})),i("controllers/fieldDate",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(nfRadio.channel("date"),"init:model",this.initModel),this.listenTo(nfRadio.channel("date"),"render:view",this.initDatepicker)},initModel:function(e){this.registerFunctions(e)},registerFunctions:function(e){e.set("renderHourOptions",this.renderHourOptions),e.set("renderMinuteOptions",this.renderMinuteOptions),e.set("maybeRenderAMPM",this.maybeRenderAMPM),e.set("customClasses",this.customClasses),e.getValue=this.getValue},renderHourOptions:function(){return this.hours_options},renderMinuteOptions:function(){return this.minutes_options},maybeRenderAMPM:function(){if(void 0!==this.hours_24&&1!=this.hours_24)return`
`},initDatepicker:function(e){e.model.set("el",e.el);var t=jQuery(e.el).find(".nf-element")[0];if(e.listenTo(nfRadio.channel("form-"+e.model.get("formID")),"before:submit",this.beforeSubmit,e),void 0!==e.model.get("date_mode")&&"time_only"==e.model.get("date_mode"))return jQuery(t).hide(),!1;var i=this.convertDateFormat(e.model.get("date_format"));e.model.set("date_format",i);var n={onReady:(e,i,n)=>{n.altInput.setAttribute("aria-labelledby",jQuery(t).attr("aria-labelledby")),n.altInput.setAttribute("aria-invalid",!1)},dateFormat:i,altFormat:i,altInput:!0,ariaDateFormat:i,mode:"single",allowInput:!0,disableMobile:"true",minDate:this.getMinDate(e.model),maxDate:this.getMaxDate(e.model)};const r=this.checkCustomLocale();r&&(n.locale=r);let o=nfRadio.channel("flatpickr").request("filter:settings",n,e);void 0!==o&&(n=o);var a=flatpickr(t,n);1==e.model.get("date_default")&&(a.defaultDate=new Date,a.setDate(a.defaultDate),e.model.set("value",a.defaultDate)),nfRadio.channel("pikaday-bc").trigger("init",a,e.model,e),nfRadio.channel("flatpickr").trigger("init",a,e.model,e)},beforeSubmit:function(e){if(_.isObject(this.model.get("value"))){const e=this.el.id.replace("-wrap",""),t=this.el.querySelector("#"+e).value;this.model.set("value",t)}if("date_only"==this.model.get("date_mode"))return!1;let t=jQuery(this.el).find(".hour").val(),i=jQuery(this.el).find(".minute").val(),n=jQuery(this.el).find(".ampm").val(),r=this.model.get("value"),o=!1;o=_.isObject(r)?r.date:r;let a={date:o,hour:t,minute:i,ampm:n};this.model.set("value",a)},getMinDate:function(e){let t=null;if(void 0!==e.get("year_range_start")){const i=e.get("year_range_start");i&&(t=flatpickr.formatDate(new Date(String(i)),e.get("date_format")))}return t},getMaxDate:function(e){let t=null;if(void 0!==e.get("year_range_end")){const i=e.get("year_range_end");i&&(t=flatpickr.formatDate(new Date(String(i)),e.get("date_format")))}return t},convertDateFormat:function(e){!e&&this.model&&(e=this.model.get("date_format")),e||(e="default");const t={"MM/DD/YYYY":"m/d/Y","MM-DD-YYYY":"m-d-Y","MM.DD.YYYY":"m.d.Y","DD/MM/YYYY":"d/m/Y","DD-MM-YYYY":"d-m-Y","DD.MM.YYYY":"d.m.Y","YYYY-MM-DD":"Y-m-d","YYYY/MM/DD":"Y/m/d","YYYY.MM.DD":"Y.m.d","dddd, MMMM D YYYY":"l, F d Y",default:nfi18n.dateFormat?nfi18n.dateFormat:"default"};return Object.keys(t).includes(e)?t[e]:e},customClasses:function(e){return"date_and_time"==this.date_mode&&(e+=" date-and-time"),e},checkCustomLocale:function(){let e={};return nfi18n&&((nfi18n.months||nfi18n.monthsShort)&&(e.months={},nfi18n.months&&(e.months.longhand=nfi18n.months),nfi18n.monthsShort&&(e.months.shorthand=nfi18n.monthsShort)),(nfi18n.weekdays||nfi18n.weekdaysShort)&&(e.weekdays={},nfi18n.weekdays&&(e.weekdays.longhand=nfi18n.weekdays),nfi18n.weekdaysShort&&(e.weekdays.shorthand=nfi18n.weekdaysShort)),nfi18n.startOfWeek&&(e.firstDayOfWeek=nfi18n.startOfWeek)),!_.isEmpty(e)&&e},getValue:function(){if("date_only"==this.get("date_mode"))return this.get("value");let e=this.get("el"),t=jQuery(e).find(".hour").val(),i=jQuery(e).find(".minute").val(),n=jQuery(e).find(".ampm").val(),r=this.get("value"),o=!1;o=_.isObject(r)?r.date:r;let a="";return void 0!==o&&(a+=o),void 0!==t&&void 0!==i&&(a+=" "+t+":"+i),void 0!==n&&(a+=" "+n),a}})})),i("controllers/fieldRecaptcha",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(nfRadio.channel("recaptcha"),"init:model",this.initRecaptcha),this.listenTo(nfRadio.channel("forms"),"submit:response",this.resetRecaptcha)},initRecaptcha:function(e){nfRadio.channel("recaptcha").reply("update:response",this.updateResponse,this,e.id)},updateResponse:function(e,t){var i=nfRadio.channel("fields").request("get:field",t);i.set("value",e),nfRadio.channel("fields").request("remove:error",i.get("id"),"required-error")},resetRecaptcha:function(){var e=0;jQuery(".g-recaptcha").each((function(){try{grecaptcha.reset(e)}catch(e){console.log("Notice: Error trying to reset grecaptcha.")}e++}))}})})),i("controllers/fieldRecaptchaV3",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(nfRadio.channel("recaptcha_v3"),"init:model",this.initRecaptcha)},initRecaptcha:function(e){const t=e.get("formID");this.processRecaptcha(t,e),setInterval(this.processRecaptcha,11e4,t,e)},processRecaptcha:function(e,t){try{nfRadio.channel("form-"+e).trigger("disable:submit",t),grecaptcha.ready((function(){grecaptcha.execute(t.get("site_key"),{action:"register"}).then((function(i){t.set("value",i),nfRadio.channel("form-"+e).trigger("enable:submit",t)}))}))}catch(e){jQuery(document).on("nfFormReady",(e=>{let i,n=nf_check_recaptcha_consent();t.collection.models.forEach((e=>{"submit"===e.get("type")&&(i=e.get("id"))})),nfRadio.channel("fields").request("add:error",i,"recaptcha-v3-missing",t.collection.options.formModel.get("settings").recaptchaConsentMissing),this.nf_build_default_consent_action(t,n.services,i,e)}))}},nf_build_default_consent_action:function(e,t,i,n){if(!(t.length<=1&&t.includes("missing_cookie")||t.length<=0)){let r=document.createElement("div");r.setAttribute("id","nf_recaptcha_consent_event"),r.innerText+=e.collection.options.formModel.get("settings").recaptchaConsentEvent;let o=new CustomEvent("nf_consent_link",{detail:{services:t,element:r,submitFieldID:i,layoutView:n}});document.dispatchEvent(o);const a=document.getElementsByClassName("nf-error-recaptcha-v3-missing");Array.prototype.slice.call(a).forEach((e=>{e.append(r)}))}}})})),i("controllers/fieldHTML",[],(function(){return Marionette.Object.extend({htmlFields:[],trackedMergeTags:[],initialize:function(){this.listenTo(Backbone.Radio.channel("fields-html"),"init:model",this.setupFieldMergeTagTracking)},setupFieldMergeTagTracking:function(e){this.htmlFields.push(e);var t=e.get("formID");this.listenTo(nfRadio.channel("form-"+t),"init:model",(function(t){var i=e.get("default").match(new RegExp(/{field:(.*?)}/g));i&&(_.each(i,(function(e){var i=e.replace("{field:","").replace("}",""),n=t.get("fields").findWhere({key:i});void 0!==n&&(this.trackedMergeTags.push(n),this.listenTo(nfRadio.channel("field-"+n.get("id")),"change:modelValue",this.updateFieldMergeTags))}),this),this.updateFieldMergeTags())}),this)},updateFieldMergeTags:function(e){_.each(this.htmlFields,(function(e){var t=e.get("value");_.each(this.trackedMergeTags,(function(e){var i=t.match(new RegExp(/'+r+"")}),this),e.set("value",t),e.trigger("reRender")}),this)},displayRepeaterData:function(e){const t=Object.keys(e.getValue());let i="",n=[];return _.each(t,(function(e){if(-1===n.indexOf(e)){const t=nfRadio.channel("fields").request("get:field",e);if(void 0!==t){if(-1===["submit","html","hidden","password","passwordconfirm","divider","hr","note","unknown","button","confirm","creditcard","creditcardcvc","creditcardexpiration","creditcardfullname","creditcardnumber","creditcardzip","recaptcha","recaptcha_v3"].indexOf(t.get("type"))&&t.getValue().toString().length>0){const r=Number(e.split("_").pop())+1;i+="

"+t.get("label")+" "+r+" : "+t.getValue()+"

",n.push(e)}}}})),i}})})),i("controllers/helpText",[],(function(){return Marionette.Object.extend({initialize:function(){this.listenTo(nfRadio.channel("form"),"render:view",this.initHelpText),nfRadio.channel("form").reply("init:help",this.initHelpText)},initHelpText:function(e){jQuery(e.el).find(".nf-help").each((function(){var e=jQuery(this).jBox("Tooltip",{theme:"TooltipBorder",content:jQuery(this).data("text"),trigger:"mouseenter focus",closeOnMouseleave:!0,closeOnClick:!0});jQuery(this).on("keydown mouseleave",(function(){e.close()}))}))}})})),i("controllers/fieldTextbox",[],(function(){return Marionette.Object.extend({initialize:function(){nfRadio.channel("textbox").reply("get:calcValue",this.getCalcValue,this)},getCalcValue:function(e){if("currency"==e.get("mask")){var t=nfRadio.channel("app").request("get:form",e.get("formID")),i=void 0!==t?t.get("currencySymbol"):"",n=jQuery("