File "admin-builder.min.js"
Full Path: /home/ycoalition/public_html/blog/wp-admin/js/widgets/plugins/wpforms-lite/assets/js/admin-builder.min.js
File size: 122.83 KB
MIME-type: text/plain
Charset: utf-8
var WPFormsBuilder=window.WPFormsBuilder||function(r,l,b){var m,v,y={},i=!0,a=!1,k={settings:{spinner:'<i class="wpforms-loading-spinner"></i>',spinnerInline:'<i class="wpforms-loading-spinner wpforms-loading-inline"></i>',tinymceDefaults:{tinymce:{toolbar1:"bold,italic,underline,blockquote,strikethrough,bullist,numlist,alignleft,aligncenter,alignright,undo,redo,link"},quicktags:!0},pagebreakTop:!1,pagebreakBottom:!1,upload_img_modal:!1},init:function(){var e=this;wpforms_panel_switch=!0,m=this.settings,b(k.ready),b(l).on("load",function(){"function"==typeof b.ready.then?b.ready.then(k.load):k.load()}),b(l).on("beforeunload",function(){if(!e.formIsSaved()&&i)return wpforms_builder.are_you_sure_to_close})},load:function(){if(wpf.getQueryString("newform")&&k.formSave(!1),"revisions"===b("#wpforms-panels-toggle .active").data("panel")&&k.updateRevisionPreview(),WPFormsUtils.triggerEvent(v,"wpformsBuilderReady").isDefaultPrevented())return!1;k.hideLoadingOverlay(),"1"==wpforms_builder.template_modal_display&&"fields"===wpf.getQueryString("view")&&b.alert({title:wpforms_builder.template_modal_title,content:wpforms_builder.template_modal_msg,icon:"fa fa-info-circle",type:"blue",buttons:{confirm:{text:wpforms_builder.close,btnClass:"btn-confirm",keys:["enter"]}}})},ready:function(){k.isVisitedViaBackButton()?location.reload():(v=b("#wpforms-builder"),y.$helpButton=b("#wpforms-help"),y.$previewButton=b("#wpforms-preview-btn"),y.$embedButton=b("#wpforms-embed"),y.$saveButton=b("#wpforms-save"),y.$exitButton=b("#wpforms-exit"),y.$noFieldsOptions=b("#wpforms-panel-fields .wpforms-no-fields-holder .no-fields"),y.$noFieldsPreview=b("#wpforms-panel-fields .wpforms-no-fields-holder .no-fields-preview"),y.$formPreview=b("#wpforms-panel-fields .wpforms-preview-wrap"),y.$revisionPreview=b("#wpforms-panel-revisions .wpforms-panel-content"),y.defaultEmailSelector=".wpforms-field-option-email .wpforms-field-option-row-default_value input",y.$defaultEmail=b(y.defaultEmailSelector),y.$focusOutTarget=null,y.$nextFieldId=b("#wpforms-field-id"),y.$fieldOptions=b("#wpforms-field-options"),y.$fieldsPreviewWrap=b("#wpforms-panel-fields .wpforms-panel-content-wrap"),y.$sortableFieldsWrap=b("#wpforms-panel-fields .wpforms-field-wrap"),y.$addFieldsButtons=b(".wpforms-add-fields-button").not(".not-draggable").not(".warning-modal").not(".education-modal"),y.$fieldsSidebar=b("#wpforms-panel-fields .wpforms-add-fields"),y.$searchInput=b("#wpforms-search-fields-input"),y.$sidebarToggle=b(".wpforms-panels .wpforms-panel-sidebar-content .wpforms-panel-sidebar-toggle"),k.isBuilderInPopup()&&(y.$embedButton.remove(),y.$previewButton.addClass("wpforms-alone")),k.loadMsWinCSS(),k.bindUIActions(),m.formID=b("#wpforms-builder-form").data("id"),m.pagebreakTop=b(".wpforms-pagebreak-top").length,m.pagebreakBottom=b(".wpforms-pagebreak-bottom").length,v.on("keypress","#wpforms-builder-form :input:not(textarea)",function(e){13===e.keyCode&&e.preventDefault()}),b(".wpforms-panel").each(function(e,i){var o,t=b(this),r=t.find(".wpforms-panel-sidebar-section.configured").first();r.length?(o=r.data("section"),r.addClass("active"),t.find(".wpforms-panel-content-section-"+o).show().addClass("active"),t.find(".wpforms-panel-content-section-default").hide()):(t.find(".wpforms-panel-content-section:first-of-type").show().addClass("active"),t.find(".wpforms-panel-sidebar-section:first-of-type").addClass("active"))}),k.loadEntryPreviewFields(),k.fieldChoiceSortable("select"),k.fieldChoiceSortable("radio"),k.fieldChoiceSortable("checkbox"),k.fieldChoiceSortable("payment-multiple"),k.fieldChoiceSortable("payment-checkbox"),k.fieldChoiceSortable("payment-select"),b(".wpforms-add-fields-group").each(function(e,i){k.fieldGroupToggle(b(this),"load")}),k.registerTemplates(),k.trimFormTitle(),wpf.initTooltips(),k.loadColorPickers(),k.captchaToggle(),k.confirmationsSetup(),k.notificationToggle(),k.notificationsByStatusAlerts(),k.builderHotkeys(),b("#wpforms-setup-name").val(b("#wpforms-panel-field-settings-form_title").val()),jconfirm.defaults={closeIcon:!1,backgroundDismiss:!1,escapeKey:!0,animationBounce:1,useBootstrap:!1,theme:"modern",boxWidth:"400px",animateFromElement:!1,content:wpforms_builder.something_went_wrong},k.dropdownField.init(),k.iconChoices.init(),k.checkEmptyDynamicChoices(),k.initSomeFieldOptions(),k.dismissNotice())},checkEmptyDynamicChoices:function(){var e=wpf.orders.choices||{};Object.keys(e).length&&wpf.orders.fields.forEach(function(i){if(k.dropdownField.helpers.isDynamicChoices(i)){var o=b("#wpforms-field-"+i),t=k.dropdownField.helpers.getDynamicChoicesOptionType(i),r=k.dropdownField.helpers.getDynamicChoicesOptionSource(i),n=k.dropdownField.helpers.isDynamicChoicesOptionModern(i);let e=n?o.find(".has-no-choices").length:0===o.find(".primary-input option:not(.placeholder), .primary-input li").length;n&&!e&&(o=b("#wpforms-field-option-"+i+"-placeholder").val(),n=k.dropdownField.helpers.getInitialChoices(i),e=1===n.length&&n[0].label===o&&!0===n[0].placeholder),e&&k.emptyChoicesNotice(i,r,t)}})},loadMsWinCSS:function(){var e=navigator.userAgent;e.indexOf("Windows")<0||e.indexOf("Chrome")<0&&e.indexOf("Firefox")<0||b("<link>").appendTo("head").attr({type:"text/css",rel:"stylesheet",href:wpforms_builder.ms_win_css_url})},isVisitedViaBackButton:function(){var i;return!!performance&&(i=!1,performance.getEntriesByType("navigation").forEach(function(e){"back_forward"===e.type&&(i=!0)}),i)},hideLoadingOverlay:function(){var e=b("#wpforms-builder-overlay");e.addClass("fade-out"),setTimeout(function(){e.hide()},250)},showLoadingOverlay:function(){var e=b("#wpforms-builder-overlay");e.removeClass("fade-out"),e.show()},initSomeFieldOptions:function(){k.toggleAllOptionGroups(v),v.find(".wpforms-field-option-row-date .type select").trigger("change")},dropdownField:{config:{modernClass:"choicesjs-select",args:{searchEnabled:!1,searchChoices:!1,renderChoiceLimit:1,shouldSort:!1,callbackOnInit:function(){var e=b(this.containerOuter.element),i=e.closest(".wpforms-field").find("select");e.hasClass("is-disabled")&&e.removeClass("is-disabled"),i.is("[readonly]")&&(this.disable(),i.prop("disabled",!1)),this.passedElement.element.multiple&&this.getValue(!0).length&&b(this.input.element).addClass("choices__input--hidden")}}},init:function(){v.find("."+k.dropdownField.config.modernClass).each(function(){k.dropdownField.events.choicesInit(b(this))}),v.on("change",".wpforms-field-option-select .wpforms-field-option-row-multiple input",k.dropdownField.events.multiple),v.on("change",".wpforms-field-option-select .wpforms-field-option-row-style select, .wpforms-field-option-payment-select .wpforms-field-option-row-style select",k.dropdownField.events.applyStyle),v.on("click",".choices",function(e){var i=b(this),o=i.find("select").data("choicesjs");o&&i.hasClass("is-open")&&e.target.classList.contains("choices__inner")&&o.hideDropdown()})},events:{choicesInit:function(e){let i=1===e.data("choicesjs-use-ajax"),o;o="select_pages"===e.data("choicesjs-callback-fn")?WPForms.Admin.Builder.WPFormsChoicesJS.setup(e[0],k.dropdownField.config.args,{action:"wpforms_ajax_search_pages_for_dropdown",nonce:i?wpforms_builder.nonce:null}):new Choices(e[0],k.dropdownField.config.args),k.dropdownField.helpers.setInstance(e,o),k.dropdownField.helpers.addPlaceholderChoice(e,o),e.closest(".choices").toggleClass("wpforms-hidden",!o.config.choices.length)},multiple:function(e){var i=b(this).closest(".wpforms-field-option-row-multiple").data().fieldId,o=k.dropdownField.helpers.getPrimarySelector(i),t=b("#wpforms-field-option-row-"+i+"-choices input.default"),r=o.find(".placeholder"),n=k.dropdownField.helpers.isDynamicChoices(i),e=e.target.checked,s=e?"checkbox":"radio";o.prop("multiple",e),t.prop("type",s),n&&o.find("option:selected").prop("selected",!1),s=t.filter(":checked"),!e&&s.length&&(t.prop("checked",!1),b(s.get(0)).prop("checked",!0)),r.length&&r.prop("selected",!e),k.dropdownField.helpers.update(i,n)},applyStyle:function(){var e=b(this),i=e.closest(".wpforms-field-option-row-style").data().fieldId;"modern"===e.val()?k.dropdownField.helpers.convertClassicToModern(i):k.dropdownField.helpers.convertModernToClassic(i)}},helpers:{convertModernToClassic:function(e){var i=k.dropdownField.helpers.getPrimarySelector(e),o=k.dropdownField.helpers.isDynamicChoices(e),i=k.dropdownField.helpers.getInstance(i);i&&"function"==typeof i.destroy&&(i.destroy(),k.dropdownField.helpers.updatePlaceholderChoice(i,e)),o||k.fieldChoiceUpdate("select",e)},getInitialChoices(e){e=k.dropdownField.helpers.getPrimarySelector(e);return k.dropdownField.helpers.getInstance(e).config.choices},convertClassicToModern:function(e){var i=k.dropdownField.helpers.getPrimarySelector(e);k.dropdownField.helpers.isDynamicChoices(e)||k.fieldChoiceUpdate("select",e),k.dropdownField.events.choicesInit(i)},update:function(e,i){var o=k.dropdownField.helpers.getPrimarySelector(e);k.dropdownField.helpers.isModernSelect(o)?(k.dropdownField.helpers.convertModernToClassic(e),i||k.dropdownField.events.choicesInit(o)):i||k.fieldChoiceUpdate("select",e)},addPlaceholderChoice:function(e,i){var o,t,e=e.closest(".wpforms-field");return!(e.length<=0||(e=e.data().fieldId,o=k.dropdownField.helpers.hasDefaults(e),k.dropdownField.helpers.isDynamicChoices(e)&&(o=!1),!1!==k.dropdownField.helpers.searchPlaceholderChoice(i))||!i.config.choices.length||(e=i.config.choices[0].label,t=b(i.passedElement.element).prop("multiple"),i.setChoices([{value:"",label:e,selected:!(t||o),placeholder:!0}],"value","label",!1),t&&b(i.input.element).prop("placeholder",e),0))},searchPlaceholderChoice:function(e){var t=!1;return e.config.choices.forEach(function(e,i,o){if(void 0!==e.placeholder&&!0===e.placeholder)return!(t={key:i,item:e})}),t},updatePlaceholderChoice:function(e,i){var o=b(e.passedElement.element),i=wpf.sanitizeHTML(b("#wpforms-field-option-"+i+"-placeholder").val()),e=k.dropdownField.helpers.searchPlaceholderChoice(e),t={};"object"==typeof e&&(t=b(o.find("option").get(e.key))),""!==i?!b.isEmptyObject(t)&&t.length?t.addClass("placeholder").text(i):o.prepend('<option value="" class="placeholder">'+i+"</option>"):t.length&&t.remove()},isModernSelect:function(e){e=k.dropdownField.helpers.getInstance(e);return"object"==typeof e&&!b.isEmptyObject(e)&&e.initialised},setInstance:function(e,i){e.data("choicesjs",i)},getInstance:function(e){return e.data("choicesjs")},getDynamicChoicesOption:function(e){e=b("#wpforms-field-option-"+e+"-dynamic_choices");return!!e.length&&e},isDynamicChoices:function(e){e=k.dropdownField.helpers.getDynamicChoicesOption(e);return!!e.length&&""!==e.val()},isDynamicChoicesOptionModern:function(e){e=b("#wpforms-field-option-"+e+"-style");return!!e.length&&"modern"===e.val()},getDynamicChoicesOptionType:function(e){e=k.dropdownField.helpers.getDynamicChoicesOption(e);return!!e.length&&e.val()},getDynamicChoicesOptionSource:function(e){var i=k.dropdownField.helpers.getDynamicChoicesOptionType(e),e=b("#wpforms-field-option-"+e+"-dynamic_"+i);return!!e.length&&e.find("option:selected").text()},hasDefaults:function(e){return!!b("#wpforms-field-option-row-"+e+"-choices .choices-list").find("input.default:checked").length},getPrimarySelector:function(e){return b("#wpforms-field-"+e+" .primary-input")}}},numberSliderEvents:function(e){e.on("input",".wpforms-field-option-row-min_max .wpforms-input-row .wpforms-number-slider-min",k.fieldNumberSliderUpdateMin),e.on("input",".wpforms-field-option-row-min_max .wpforms-input-row .wpforms-number-slider-max",k.fieldNumberSliderUpdateMax),e.on("input",".wpforms-number-slider-default-value",_.debounce(k.changeNumberSliderDefaultValue,500)),e.find(".wpforms-number-slider-default-value").trigger("input"),e.on("input",".wpforms-number-slider-step",_.debounce(k.changeNumberSliderStep,500)),e.on("focusout",".wpforms-number-slider-step",k.checkNumberSliderStep),e.on("input",".wpforms-number-slider-value-display",_.debounce(k.changeNumberSliderValueDisplay,500)),e.on("input",".wpforms-number-slider-min",_.debounce(k.changeNumberSliderMin,500)),e.on("input",".wpforms-number-slider-max",_.debounce(k.changeNumberSliderMax,500))},changeNumberSliderMin:function(e){var i=b(e.target).parents(".wpforms-field-option-row").data("fieldId"),o=parseFloat(e.target.value);isNaN(o)||k.updateNumberSliderDefaultValueAttr(i,e.target.value,"min")},changeNumberSliderMax:function(e){var i=b(e.target).parents(".wpforms-field-option-row").data("fieldId"),o=parseFloat(e.target.value);isNaN(o)||k.updateNumberSliderDefaultValueAttr(i,e.target.value,"max").updateNumberSliderStepValueMaxAttr(i,e.target.value)},changeNumberSliderValueDisplay:function(e){var i=e.target.value,e=b(e.target).parents(".wpforms-field-option-row").data("fieldId"),o=r.getElementById("wpforms-field-option-"+e+"-default_value");o&&k.updateNumberSliderHintStr(e,i).updateNumberSliderHint(e,o.value)},changeNumberSliderStep(e){var i,o=parseFloat(e.target.value);isNaN(o)||o<=0||((i=parseFloat(e.target.max))<o?e.target.value=i:o<(i=parseFloat(e.target.min))?e.target.value=i:(i=b(e.target).parents(".wpforms-field-option-row").data("fieldId"),e=b("#wpforms-field-option-"+i+"-default_value").val(),k.checkMultiplicitySliderDefaultValue(i,e,o).updateNumberSliderAttr(i,o,"step").updateNumberSliderDefaultValueAttr(i,o,"step")))},checkMultiplicitySliderDefaultValue(e,i,o){var t,r,e=b(`#wpforms-field-option-row-${e}-default_value`);return i%o!=0?(t=wpforms_builder.number_slider_error_valid_default_value,r=Math.floor(i/o)*o,i=Math.ceil(i/o)*o,o=t.replace("{from}",r).replace("{to}",i),k.printNotice(o,e)):k.removeNotice(e),this},printNotice(e,i){i.length&&(this.removeNotice(i),i.append(`<div class="wpforms-alert-warning wpforms-alert"><p>${e}</p></div>`))},removeNotice(e){e.length&&e.find(".wpforms-alert").length&&e.find(".wpforms-alert").remove()},checkNumberSliderStep:function(e){var e=parseFloat(e.target.value),i=b(this);!isNaN(e)&&0<e||b.confirm({title:wpforms_builder.heads_up,content:wpforms_builder.error_number_slider_increment,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){i.val("").trigger("focus")}}}})},changeNumberSliderDefaultValue(e){var i,o=parseFloat(e.target.value);isNaN(o)||((i=parseFloat(e.target.max))<o?e.target.value=i:o<(i=parseFloat(e.target.min))?e.target.value=i:(i=parseFloat(e.target.step),e=b(e.target).parents(".wpforms-field-option-row-default_value").data("fieldId"),k.checkMultiplicitySliderDefaultValue(e,o,i).updateNumberSlider(e,o).updateNumberSliderHint(e,o)))},updateNumberSliderDefaultValueAttr:function(e,i,o){var t,e=r.getElementById("wpforms-field-option-"+e+"-default_value");return e&&(t=parseFloat(e.value),e.setAttribute(o,i),i=parseFloat(i),"max"===o&&i<t&&(e.value=i,b(e).trigger("input")),"min"===o)&&t<i&&(e.value=i,b(e).trigger("input")),this},updateNumberSlider:function(e,i){e=r.getElementById("wpforms-number-slider-"+e);return e&&(e.value=i),this},updateNumberSliderAttr:function(e,i,o){e=r.getElementById("wpforms-number-slider-"+e);return e&&e.setAttribute(o,i),this},updateNumberSliderHintStr:function(e,i){e=r.getElementById("wpforms-number-slider-hint-"+e);return e&&(e.dataset.hint=i),this},updateNumberSliderHint:function(e,i){e=r.getElementById("wpforms-number-slider-hint-"+e);return e&&(e.innerHTML=wpf.sanitizeHTML(e.dataset.hint).replace("{value}","<b>"+i+"</b>")),this},fieldNumberSliderUpdateMin:function(e){var i=b(e.target).parents(".wpforms-field-option-row-min_max"),o=parseFloat(i.find(".wpforms-number-slider-max").val()),t=parseFloat(e.target.value);isNaN(t)||(o<=t?(e.preventDefault(),this.value=o):(e=i.data("field-id"),v.find("#wpforms-field-"+e+' input[type="range"]').attr("min",t)))},fieldNumberSliderUpdateMax:function(e){var i=b(e.target).parents(".wpforms-field-option-row-min_max"),o=parseFloat(i.find(".wpforms-number-slider-min").val()),t=parseFloat(e.target.value);isNaN(t)||(t<=o?(e.preventDefault(),this.value=o):(e=i.data("field-id"),v.find("#wpforms-field-"+e+' input[type="range"]').attr("max",t)))},updateNumberSliderStepValueMaxAttr:function(e,i){var o,e=r.getElementById("wpforms-field-option-"+e+"-step");return e&&(o=parseFloat(e.value),e.setAttribute("max",i),(i=parseFloat(i))<o)&&(e.value=i,b(e).trigger("input")),this},fieldFileUploadPreviewUpdate:function(e){var e=b(e).parents(".wpforms-field-option-file-upload"),i=e.data("field-id"),o=e.find("#wpforms-field-option-"+i+"-style").val(),e=e.find("#wpforms-field-option-row-"+i+"-max_file_number"),t=parseInt(e.find("input").val(),10),i=b("#wpforms-field-"+i),r=".wpforms-file-upload-builder-classic",n=".wpforms-file-upload-builder-modern";"classic"===o?(b(r,i).removeClass("wpforms-hide"),b(n,i).addClass("wpforms-hide"),e.addClass("wpforms-hidden")):(1<t?(i.find(".modern-title").text(wpforms_builder.file_upload.preview_title_plural),i.find(".modern-hint").text(wpforms_builder.file_upload.preview_hint.replace("{maxFileNumber}",t)).removeClass("wpforms-hide")):(i.find(".modern-title").text(wpforms_builder.file_upload.preview_title_single),i.find(".modern-hint").text(wpforms_builder.file_upload.preview_hint.replace("{maxFileNumber}",1)).addClass("wpforms-hide")),b(r,i).addClass("wpforms-hide"),b(n,i).removeClass("wpforms-hide"),e.removeClass("wpforms-hidden"))},updateTextFieldsLimitControls:function(e,i){i?b("#wpforms-field-option-row-"+e+"-limit_controls").removeClass("wpforms-hide"):b("#wpforms-field-option-row-"+e+"-limit_controls").addClass("wpforms-hide")},updatePasswordStrengthControls:function(e,i){e=b("#wpforms-field-option-row-"+e+"-password-strength-level");i?e.removeClass("wpforms-hidden"):e.addClass("wpforms-hidden")},updateRichTextMediaFieldsLimitControls:function(){var e=b(this),i=e.closest(".wpforms-field-option-row-media_enabled").data("field-id"),o=b("#wpforms-field-option-row-"+i+"-media_controls"),i=b("#wpforms-field-"+i+" .wpforms-richtext-wrap .mce-toolbar-grp");e.is(":checked")?(o.show(),i.addClass("wpforms-field-richtext-media-enabled")):(o.hide(),i.removeClass("wpforms-field-richtext-media-enabled"))},updateRichTextStylePreview:function(){var e=b(this),i=e.closest(".wpforms-field-option-row-style").data("field-id");b("#wpforms-field-"+i+" .wpforms-richtext-wrap .mce-toolbar-grp").toggleClass("wpforms-field-richtext-toolbar-basic","full"!==e.val())},bindUIActions:function(){k.bindUIActionsPanels(),k.bindUIActionsFields(),k.bindUIActionsSettings(),k.bindUIActionsRevisions(),k.bindUIActionsSaveExit(),k.bindUIActionsGeneral()},bindUIActionsPanels:function(){v.on("click","#wpforms-panels-toggle button, .wpforms-panel-switch",function(e){e.preventDefault(),k.panelSwitch(b(this).data("panel"))}),v.on("click",".wpforms-panel .wpforms-panel-sidebar-section",function(e){k.panelSectionSwitch(this,e)}),v.on("click",".wpforms-panels .wpforms-panel-sidebar-content .wpforms-panel-sidebar-toggle",function(){b(this).parent().toggleClass("wpforms-panel-sidebar-closed")})},panelSwitch:function(e){var i=b("#wpforms-panel-"+e),o=b(".wpforms-panel-"+e+"-button");if(!i.hasClass("active")){if(WPFormsUtils.triggerEvent(v,"wpformsPanelSwitch",[e]).isDefaultPrevented()||!wpforms_panel_switch)return!1;b("#wpforms-panels-toggle").find("button").removeClass("active"),b(".wpforms-panel").removeClass("active"),o.addClass("active"),i.addClass("active"),history.replaceState({},null,wpf.updateQueryString("view",e)),v.trigger("wpformsPanelSwitched",[e])}},panelSectionSwitch:function(e,i){i&&i.preventDefault();var i=b(e),e=i.parent().parent(),o=i.data("section"),t=e.find(".wpforms-panel-sidebar-section"),r=e.find(".wpforms-panel-sidebar-section-"+o);if(!i.hasClass("upgrade-modal")&&!i.hasClass("education-modal")&&!r.hasClass("active")){if(WPFormsUtils.triggerEvent(v,"wpformsPanelSectionSwitch",o).isDefaultPrevented()||!wpforms_panel_switch)return!1;t.removeClass("active"),r.addClass("active"),e.find(".wpforms-panel-content-section").hide(),e.find(".wpforms-panel-content-section-"+o).show()}},bindUIActionsSetup:function(){console.warn('WARNING! Function "WPFormsBuilder.bindUIActionsSetup()" has been deprecated, please use the new "WPForms.Admin.Builder.Setup.events()" function instead!'),WPForms.Admin.Builder.Setup.events()},templateSelect:function(e,i){console.warn('WARNING! Function "WPFormsBuilder.templateSelect()" has been deprecated, please use the new "WPForms.Admin.Builder.Setup.selectTemplate()" function instead!'),WPForms.Admin.Builder.Setup.selectTemplate(i)},bindUIActionsFields:function(){v.on("click",".wpforms-tab a",function(e){e.preventDefault(),k.fieldTabToggle(b(this).parent().attr("id"))}),v.on("click",".wpforms-add-fields-heading",function(e){e.preventDefault(),k.fieldGroupToggle(b(this),"click")}),v.on("click",".wpforms-field",function(e){k.isFieldPreviewActionsDisabled(this)||e.target.classList.contains("wpforms-dismiss-button")||(e.stopPropagation(),k.fieldTabToggle(b(this).data("field-id")))}),v.on("mousedown click",".wpforms-field input, .wpforms-field select, .wpforms-field textarea",function(e){e.preventDefault(),this.blur()}),v.on("click",".wpforms-field-delete",function(e){e.preventDefault(),e.stopPropagation(),k.isFormPreviewActionsDisabled(this)||k.fieldDelete(b(this).parent().data("field-id"))}),v.on("click",".wpforms-field-duplicate",function(e){e.preventDefault(),e.stopPropagation(),k.isFormPreviewActionsDisabled(this)||k.fieldDuplicate(b(this).parent().data("field-id"))}),v.on("click",".wpforms-add-fields-button",function(e){e.preventDefault();var i,e=b(this);e.hasClass("ui-draggable-disabled")||(i=e.data("field-type"),WPFormsUtils.triggerEvent(v,"wpformsBeforeFieldAddOnClick",[i,e]).isDefaultPrevented())||k.fieldAdd(i,{$sortable:"default"})}),v.on("wpformsFieldAdd",function(e,i,o){-1!==b.inArray(o,["select","radio","checkbox","payment-multiple","payment-checkbox","payment-select"])&&k.fieldChoiceSortable(o,`#wpforms-field-option-row-${i}-choices ul`)}),v.on("wpformsFieldOptionTabToggle",function(e,i){k.fieldLayoutSelectorInit(i)}),v.on("click",".wpforms-field-option-row-choices .add",function(e){k.fieldChoiceAdd(e,b(this))}),v.on("click",".wpforms-field-option-row-choices .remove",function(e){k.fieldChoiceDelete(e,b(this))}),v.on("mousedown",".wpforms-field-option-row-choices input[type=radio]",function(e){var i=b(this);i.is(":checked")?i.attr("data-checked","1"):i.attr("data-checked","0")}),v.on("click",".wpforms-field-option-row-choices input[type=radio]",function(e){var i=b(this),o=i.parent().parent();i.parent().parent().find("input[type=radio]").not(this).prop("checked",!1),"1"===i.attr("data-checked")&&(i.prop("checked",!1),i.attr("data-checked","0")),k.fieldChoiceUpdate(o.data("field-type"),o.data("field-id"))}),v.on("change",".wpforms-field-option-row-choices input[type=checkbox]",function(e){var i=b(this).parent().parent();k.fieldChoiceUpdate(i.data("field-type"),i.data("field-id"))}),v.on("change",".wpforms-field-option-row-show_values input",function(e){b(this).closest(".wpforms-field-option").find(".wpforms-field-option-row-choices ul").toggleClass("show-values")}),v.on("change",".wpforms-field-option-row-choices_images input",function(){var e=b(this),i=e.closest(".wpforms-field-option-row"),o=i.data("field-id"),t=b("#wpforms-field-option-"+o),e=e.is(":checked"),r=t.find(".wpforms-field-option-hidden-type").val(),n=i.siblings(".wpforms-field-option-row-choices_icons").find("input");e&&n.is(":checked")&&n.prop("checked",!1).trigger("change"),i.find(".wpforms-alert").toggleClass("wpforms-hidden"),t.find(".wpforms-field-option-row-choices ul").toggleClass("show-images"),t.find(".wpforms-field-option-row-choices_images_style").toggleClass("wpforms-hidden"),t.find(".wpforms-field-option-row-dynamic_choices").toggleClass("wpforms-hidden",e),(e?b("#wpforms-field-option-"+o+"-input_columns").val("inline"):b("#wpforms-field-option-"+o+"-input_columns").val("")).trigger("change"),k.fieldChoiceUpdate(r,o)}),v.on("wpformsImageUploadAdd wpformsImageUploadRemove",function(e,i,o){var o=o.closest(".choices-list"),t=o.data("field-id"),o=o.data("field-type");k.fieldChoiceUpdate(o,t)}),v.on("change",".wpforms-field-option-row-choices_images_style select",function(){var e=b(this).parent().data("field-id"),i=b("#wpforms-field-option-"+e).find(".wpforms-field-option-hidden-type").val();k.fieldChoiceUpdate(i,e)}),v.on("keyup",".wpforms-field-option-row-choices input.label, .wpforms-field-option-row-choices input.value",function(e){var i=b(this).parent().parent();k.fieldChoiceUpdate(i.data("field-type"),i.data("field-id"))}),v.on("focusout",".wpforms-field-option-row-choices input.label, .wpforms-field-option-row-choices input.value",function(e){var i=b(this);i.val(wpf.sanitizeHTML(i.val(),wpforms_builder.allowed_label_html_tags))}),v.on("click",".toggle-bulk-add-display",function(e){e.preventDefault(),k.fieldChoiceBulkAddToggle(this)}),v.on("click",".toggle-bulk-add-presets",function(e){e.preventDefault();e=b(this).closest(".bulk-add-display").find("ul");"block"===e.css("display")?b(this).text(wpforms_builder.bulk_add_presets_show):b(this).text(wpforms_builder.bulk_add_presets_hide),e.stop().slideToggle()}),v.on("click",".bulk-add-preset-insert",function(e){e.preventDefault();var e=b(this),i=e.data("preset"),e=e.closest(".bulk-add-display"),o=e.find("ul"),t=e.find(".toggle-bulk-add-presets"),e=e.find("textarea");e.val(""),e.insertAtCaret(wpforms_preset_choices[i].choices.join("\n")),t.text(wpforms_builder.bulk_add_presets_show),o.slideUp()}),v.on("click",".bulk-add-insert",function(e){e.preventDefault(),k.fieldChoiceBulkAddInsert(this)}),v.on("click",".wpforms-field-option-group-toggle:not(.education-modal)",function(e){if(WPFormsUtils.triggerEvent(v,"wpformsFieldOptionGroupToggle").isDefaultPrevented())return!1;e.preventDefault();e=b(this).closest(".wpforms-field-option-group");e.siblings(".wpforms-field-option-group").removeClass("active"),e.addClass("active")}),v.on("change",".wpforms-field-option-address input.wpforms-subfield-hide",function(e){var i=b(this).closest(".wpforms-field-option-row"),o=i.data("field-id"),i=i.data("subfield");b("#wpforms-field-"+o).find(".wpforms-"+i).toggleClass("wpforms-hide")}),v.on("input",".wpforms-field-option-row-label input, .wpforms-field-option-row-name input",function(e){var i=b(this),o=i.parent().data("field-id"),o=b("#wpforms-field-"+o),t=o.data("field-type");let r=i.val(),n=0===r.length;(n="html"===t?!1:n)&&(r=wpforms_builder.empty_label),o.toggleClass("label_empty",n).find("> .label-title .text").text(r)}),v.on("input",".wpforms-field-option-row-description textarea",function(){var e=b(this),i=wpf.sanitizeHTML(e.val()),o=e.parent().data("field-id"),t=b("#wpforms-field-"+o).find(".description");k.updateDescription(t,i),e.trigger("wpformsDescriptionFieldUpdated",{id:o,descField:t,value:i})}),v.on("change",".wpforms-field-option-row-required input",function(e){var i=b(this).closest(".wpforms-field-option-row").data("field-id");b("#wpforms-field-"+i).toggleClass("required")}),v.on("change",".wpforms-field-option-row-confirmation input",function(e){var i=b(this).closest(".wpforms-field-option-row").data("field-id");b("#wpforms-field-"+i).find(".wpforms-confirm").toggleClass("wpforms-confirm-enabled wpforms-confirm-disabled"),b("#wpforms-field-option-"+i).toggleClass("wpforms-confirm-enabled wpforms-confirm-disabled")}),v.on("change",".wpforms-field-option-row-filter_type select",function(){var e=b(this).parent().data("field-id"),e=b("#wpforms-field-option-"+e);b(this).val()?(e.removeClass("wpforms-filter-allowlist"),e.removeClass("wpforms-filter-denylist"),e.addClass("wpforms-filter-"+b(this).val())):(e.removeClass("wpforms-filter-allowlist"),e.removeClass("wpforms-filter-denylist"))}),v.on("focusout",".wpforms-field-option-row-allowlist textarea,.wpforms-field-option-row-denylist textarea",function(){const e=b(".wpforms-field-option-row-allowlist textarea"),i=b(".wpforms-field-option-row-denylist textarea"),o=b(this);let t="allow";""!==o.val()&&(o.is(i)&&(t="deny"),b.get(wpforms_builder.ajax_url,{nonce:wpforms_builder.nonce,content:JSON.stringify({allow:e.val(),deny:i.val(),current:t}),action:"wpforms_sanitize_restricted_rules"},function(e){e.success&&(o.val(e.data.currentField),0!==(e=e.data.intersect).length)&&(e="<p>"+wpforms_builder.allow_deny_lists_intersect+'</p><p class="bold">'+e+"</p>",b.alert({title:wpforms_builder.heads_up,content:e,icon:"fa fa-exclamation-circle",type:"red",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"]}}}))}))}),v.on("click",function(){k.focusOutEvent()}),v.on("focusout",y.defaultEmailSelector,function(){y.$focusOutTarget=b(this)}),v.on("change",".wpforms-field-option-row-size select",function(e){var i=b(this),o=i.val(),i=i.parent().data("field-id");b("#wpforms-field-"+i).removeClass("size-small size-medium size-large").addClass("size-"+o)}),v.on("input",".wpforms-field-option-row-placeholder input",function(){var e=b(this),i=e.parent().data("field-id"),o=b("#wpforms-field-"+i),t=o.find(".primary-input");let r=wpf.sanitizeHTML(e.val());"payment-single"===o.data("field-type")&&""===r&&(r=b("#wpforms-field-option-"+i+"-price").prop("placeholder")),t.is("select")?k.dropdownField.helpers.isModernSelect(t)?(e=k.dropdownField.helpers.getInstance(t),t.prop("multiple")?b(e.input.element).prop("placeholder",r):(e.setChoiceByValue(""),t.closest(".choices").find(".choices__inner .choices__placeholder").text(r),o=b("#wpforms-field-option-"+i+"-dynamic_choices").val(),k.dropdownField.helpers.update(i,o))):(e=t.find(".placeholder"),!r.length&&e.length?e.remove():(e.length?e.text(r):t.prepend('<option value="" class="placeholder">'+r+"</option>"),t.find(".placeholder").prop("selected",!t.prop("multiple")))):t.prop("placeholder",r)}),v.on("input",".wpforms-field-option-row-confirmation_placeholder input",function(e){var i=b(this),o=i.val(),i=i.parent().data("field-id");b("#wpforms-field-"+i).find(".secondary-input").attr("placeholder",o)}),v.on("input",".wpforms-field-option .format-selected input.placeholder",function(){var e=b(this),i=e.val(),e=e.closest(".wpforms-field-option-row"),o=e.data("field-id"),e=e.data("subfield");b("#wpforms-field-"+o).find(".wpforms-"+e+" input").attr("placeholder",i)}),v.on("input",".wpforms-field-option-address input.placeholder",function(){var e=b(this),i=e.closest(".wpforms-field-option-row"),o=i.data("field-id"),t=i.data("subfield"),r=b("#wpforms-field-"+o+" .wpforms-"+t).find("input, select"),i=i.find("#wpforms-field-option-"+o+"-"+t+"_default");const n=i.val(),s=i.find("option:selected").text();let l=e.val();r.each(function(){var e,i,o=b(this);o.is("select")?(e=o.find(".placeholder"),i=""===n&&""!==l?l:s,e.text(i)):o.attr("placeholder",l)})}),v.on("input",".wpforms-field-option-row-default_value input",function(){var e=b(this),i=wpf.sanitizeHTML(e.val()),e=e.closest(".wpforms-field-option-row").data("field-id");b("#wpforms-field-"+e+" .primary-input").val(i)}),v.on("input",".wpforms-field-options-column input.default",function(){var e=b(this),i=wpf.sanitizeHTML(e.val()),e=e.closest(".wpforms-field-option-row"),o=e.data("field-id"),e=e.data("subfield");b("#wpforms-field-"+o+" .wpforms-"+e+" input").val(i)}),v.on("change",".wpforms-field-option-address select.default",function(){var e=b(this),i=e.val(),o=e.find("option:selected").text(),e=e.closest(".wpforms-field-option-row"),t=e.data("field-id"),r=e.data("subfield"),n=b("#wpforms-field-option-"+t+"-scheme").val(),e=e.find("#wpforms-field-option-"+t+"-"+r+"_placeholder").val(),t=b("#wpforms-field-"+t+" .wpforms-address-scheme-"+n+" .wpforms-"+r+" .placeholder");""===i&&0<e.trim().length?t.text(e):t.text(o)}),v.on("input",".wpforms-field-option-row-confirmation_placeholder input",function(e){var i=b(this),o=i.val(),i=i.parent().data("field-id");b("#wpforms-field-"+i).find(".secondary-input").attr("placeholder",o)}),v.on("change",".wpforms-field-option-row-label_hide input",function(e){var i=b(this).closest(".wpforms-field-option-row").data("field-id");b("#wpforms-field-"+i).toggleClass("label_hide")}),v.on("change",".wpforms-field-option-row-sublabel_hide input",function(e){var i=b(this).closest(".wpforms-field-option-row").data("field-id");b("#wpforms-field-"+i).toggleClass("sublabel_hide")}),v.on("change",".wpforms-field-option-row-format select",function(){var e=b(this),i=e.val(),e=e.parent().data("field-id"),o=b("#wpforms-field-option-row-"+e+"-sublabel_hide");b("#wpforms-field-"+e).find(".format-selected").removeClass().addClass("format-selected format-selected-"+i),b("#wpforms-field-option-"+e).find(".format-selected").removeClass().addClass("format-selected format-selected-"+i),["date-time","first-last","first-middle-last"].includes(i)?o.removeClass("wpforms-hidden"):o.addClass("wpforms-hidden"),["single","user","hidden"].includes(i)&&(o=b("#wpforms-field-option-row-"+e+"-placeholder"),"user"===i?o.removeClass("wpforms-hidden"):o.addClass("wpforms-hidden"))}),v.on("change",".wpforms-field-option-row-scheme select",function(e){var i=b(this),o=i.val(),i=i.parent().data("field-id"),t=b("#wpforms-field-"+i),r=b(`#wpforms-field-option-row-${i}-state`),i=b(`#wpforms-field-option-row-${i}-country`),t=(t.find(".wpforms-address-scheme").addClass("wpforms-hide"),t.find(".wpforms-address-scheme-"+o).removeClass("wpforms-hide"),t.find(`.wpforms-address-scheme-${o} .wpforms-country select, .wpforms-address-scheme-${o} .wpforms-country input`)),t=(0===t.length?i.addClass("wpforms-hidden"):i.removeClass("wpforms-hidden"),r.find(".default .default").not(".wpforms-hidden-strict")),r=r.find(`.default [data-scheme="${o}"]`),n=i.find(".default .default").not(".wpforms-hidden-strict"),i=i.find(`.default [data-scheme="${o}"]`);r.attr({id:t.attr("id"),name:t.attr("name")}).removeClass("wpforms-hidden-strict"),t.attr({id:"",name:""}).addClass("wpforms-hidden-strict"),i.attr({id:n.attr("id"),name:n.attr("name")}).removeClass("wpforms-hidden-strict"),n.attr({id:"",name:""}).addClass("wpforms-hidden-strict")}),v.on("change",".wpforms-field-option-row-date .type select",function(e){var i=b(this),o=i.val(),t=b(this).closest(".wpforms-field-option-row").data("field-id"),r="datepicker"===o?"wpforms-date-type-datepicker":"wpforms-date-type-dropdown",n="datepicker"===o?"wpforms-date-type-dropdown":"wpforms-date-type-datepicker",r=(b("#wpforms-field-"+t).find(".wpforms-date").addClass(r).removeClass(n),b("#wpforms-field-option-"+t).addClass(r).removeClass(n),i.closest(".wpforms-field-option-group-advanced").find(".wpforms-field-option-row-date_limit_days, .wpforms-field-option-row-date_limit_days_options, .wpforms-field-option-row-date_disable_past_dates")),n=b("#wpforms-field-option-row-"+t+"-date_limit_days_options");"dropdown"===o?((i=b("#wpforms-field-option-"+t+"-date_format")).find("option:selected").hasClass("datepicker-only")&&i.prop("selectedIndex",0).trigger("change"),r.hide()):(r.show(),b("#wpforms-field-option-"+t+"-date_limit_days").is(":checked")?n.show():n.hide())}),v.on("change",".wpforms-field-option-row-date .format select",function(e){var i=b(this).val(),o=b(this).closest(".wpforms-field-option-row").data("field-id"),o=b("#wpforms-field-"+o);"m/d/Y"===i?(o.find(".wpforms-date-dropdown .first option").text(wpforms_builder.date_select_month),o.find(".wpforms-date-dropdown .second option").text(wpforms_builder.date_select_day)):"d/m/Y"===i&&(o.find(".wpforms-date-dropdown .first option").text(wpforms_builder.date_select_day),o.find(".wpforms-date-dropdown .second option").text(wpforms_builder.date_select_month))}),v.on("change",".wpforms-field-option-row-time .format select",function(e){const i=b(this),r=i.closest(".wpforms-field-option-row").data("field-id");let n="",o;const s=i.val().match(/[gh]/)?12:24,t=12==s?1:0,l=12==s?13:24;for(let e=t;e<l;e++)o=e<10?"0"+e:e,n+='<option value="{hh}">{hh}</option>'.replace(/{hh}/g,o);_.forEach(["start","end"],function(e){var i=v.find("#wpforms-field-option-"+r+"-time_limit_hours_"+e+"_hour"),e=v.find("#wpforms-field-option-"+r+"-time_limit_hours_"+e+"_ampm");let o=parseInt(i.val(),10),t=e.val();o=(o=24==s?"pm"===t?o+12:o:(t=12<o?"pm":"am",12<o?o-12:o))<10?"0"+o:o,i.html(n).val(o),e.toggleClass("wpforms-hidden-strict",24==s).val(t),e.nextAll("div").toggleClass("wpforms-hidden-strict",12==s)})}),v.on("click",".wpforms-pagebreak-button",function(e){e.preventDefault(),b(this).closest(".wpforms-field").trigger("click")}),k.fieldPageBreakInitDisplayPrevious(v.find(".wpforms-field-pagebreak.wpforms-pagebreak-normal").first()),v.on("input",".wpforms-field-option-row-next input",function(e){var i=b(this),o=i.val(),i=b("#wpforms-field-"+i.parent().data("field-id")).find(".wpforms-pagebreak-next");o?i.css("display","inline-block").text(o):i.css("display","none").empty()}).on("input",".wpforms-field-option-row-prev input",function(e){var i=b(this),o=i.val().trim(),i=b("#wpforms-field-"+i.parent().data("field-id")),t=i.find(".wpforms-pagebreak-prev");o&&0<i.prevAll(".wpforms-field-pagebreak.wpforms-pagebreak-normal").length?t.removeClass("wpforms-hidden").text(o):t.addClass("wpforms-hidden").empty()}).on("change",".wpforms-field-option-row-prev_toggle input",function(e){var i=b(this),o=i.closest(".wpforms-field-option-row-prev_toggle"),t=i.closest(".wpforms-field-option-group-inner").find(".wpforms-field-option-row-prev"),r=t.find("input"),n=b("#wpforms-field-"+i.closest(".wpforms-field-option").data("field-id")).find(".wpforms-pagebreak-prev");if(!o.hasClass("wpforms-entry-preview-block")){if(t.toggleClass("wpforms-hidden",!i.prop("checked")),n.toggleClass("wpforms-hidden",!i.prop("checked")),i.prop("checked")&&!r.val()){let e=r.data("last-value");e=e&&e.trim()?e.trim():wpforms_builder.previous,r.val(e)}i.prop("checked")||(r.data("last-value",r.val()),r.val("")),r.trigger("input")}}).on("wpformsFieldAdd",k.fieldPagebreakAdd).on("wpformsFieldDelete",k.fieldPagebreakDelete).on("wpformsBeforeFieldDelete",k.fieldEntryPreviewDelete),v.on("wpformsFieldMove wpformsFieldAdd wpformsFieldDelete",function(e){v.find(".wpforms-field-pagebreak.wpforms-pagebreak-normal").each(function(e){k.fieldPageBreakInitDisplayPrevious(b(this))})}),v.on("input",".wpforms-field-option-row-title input",function(e){var i=b(this),o=i.val(),i=i.parent().data("field-id");o?b("#wpforms-field-"+i).find(".wpforms-pagebreak-title").text(o):b("#wpforms-field-"+i).find(".wpforms-pagebreak-title").empty()}),v.on("change",".wpforms-field-option-row-nav_align select",function(e){let i=b(this).val();i=i||"center",b(".wpforms-pagebreak-buttons").removeClass("wpforms-pagebreak-buttons-center wpforms-pagebreak-buttons-left wpforms-pagebreak-buttons-right wpforms-pagebreak-buttons-split").addClass("wpforms-pagebreak-buttons-"+i)}),v.on("input",".wpforms-field-option-row-price input",function(e){var i=b(this),o=i.val(),t=wpf.amountSanitize(o),t=wpf.amountFormat(t);let r;r="right"===wpforms_builder.currency_symbol_pos?t+" "+wpforms_builder.currency_symbol:wpforms_builder.currency_symbol+" "+t;var i=i.parent().data("field-id"),n=b("#wpforms-field-option-"+i+"-placeholder").val().trim(),i=b("#wpforms-field-"+i),o=""===o&&""!==n?"":t;i.find(".primary-input").val(o),i.find(".price").text(r)}),v.on("change",".wpforms-field-option-credit-card .payment-icons input",function(e){var i=b(this),o=i.data("card"),i=i.parent().data("field-id");b("#wpforms-field-"+i).find("img.icon-"+o).toggleClass("card_hide")}),v.on("input",".wpforms-field-option input.placeholder-update",function(e){var i=b(this),o=i.val(),t=i.data("field-id"),i=i.data("subfield");b("#wpforms-field-"+t).find(".wpforms-"+i+" input").attr("placeholder",o)}),v.on("change",".wpforms-field-option-row-input_columns select",function(){var e=b(this),i=e.val(),e=e.parent().data("field-id");let o="";"2"===i?o="wpforms-list-2-columns":"3"===i?o="wpforms-list-3-columns":"inline"===i&&(o="wpforms-list-inline"),b("#wpforms-field-"+e).removeClass("wpforms-list-2-columns wpforms-list-3-columns wpforms-list-inline").addClass(o)}),v.on("change",".wpforms-field-option-row .wpforms-toggle-control input",function(e){var i=b(this),o=i.closest(".wpforms-toggle-control").find(".wpforms-toggle-control-status"),i=i.is(":checked")?"on":"off";o.html(o.data(i))}),v.on("change",".wpforms-field-option-row-dynamic_choices select",function(e){k.fieldDynamicChoiceToggle(b(this))}),v.on("change",".wpforms-field-option-row-dynamic_taxonomy select, .wpforms-field-option-row-dynamic_post_type select",function(e){k.fieldDynamicChoiceSource(b(this))}),v.on("click",".toggle-layout-selector-display",function(e){e.preventDefault(),k.fieldLayoutSelectorToggle(this)}),v.on("click",".layout-selector-display-layout",function(e){e.preventDefault(),k.fieldLayoutSelectorLayout(this)}),v.on("click",".layout-selector-display-columns span",function(e){e.preventDefault(),k.fieldLayoutSelectorInsert(this)}),b(r).on("change",".wpforms-field-option-row-scale select",function(){const e=b(this),i=e.val(),o=e.parent().data("field-id"),t=b("#wpforms-field-"+o+" .rating-icon");let r=1;t.each(function(e){r<=i?b(this).show():b(this).hide(),r++})}),b(r).on("change",".wpforms-field-option-row-icon select",function(){var e=b(this),i=e.val(),e=e.parent().data("field-id"),e=b("#wpforms-field-"+e+" .rating-icon");let o="fa-star";"heart"===i?o="fa-heart":"thumb"===i?o="fa-thumbs-up":"smiley"===i&&(o="fa-smile-o"),e.removeClass("fa-star fa-heart fa-thumbs-up fa-smile-o").addClass(o)}),b(r).on("change",".wpforms-field-option-row-icon_size select",function(){var e=b(this),i=e.val(),e=e.parent().data("field-id"),e=b("#wpforms-field-"+e+" .rating-icon");let o="28";"small"===i?o="18":"large"===i&&(o="38"),e.css("font-size",o+"px")}),b(r).on("input",".wpforms-field-option-row-icon_color input.wpforms-color-picker",function(){var e=b(this),i=e.closest(".wpforms-field-option-row").data("field-id");b("#wpforms-field-"+i+" > i.fa").css("color",k.getValidColorPickerValue(e))}),b(r).on("change",".wpforms-field-option-row-disclaimer_format input",function(){var e=b(this).closest(".wpforms-field-option-row").data("field-id");b("#wpforms-field-"+e+" .description").toggleClass("disclaimer")}),v.on("change",".wpforms-field-option-row-limit_enabled input",function(e){k.updateTextFieldsLimitControls(b(e.target).closest(".wpforms-field-option-row-limit_enabled").data().fieldId,e.target.checked)}),v.on("change",".wpforms-field-option-row-password-strength input",function(e){k.updatePasswordStrengthControls(b(e.target).parents(".wpforms-field-option-row-password-strength").data().fieldId,e.target.checked)}),v.on("change",".wpforms-field-option-richtext .wpforms-field-option-row-media_enabled input",k.updateRichTextMediaFieldsLimitControls),v.on("change",".wpforms-field-option-richtext .wpforms-field-option-row-style select",k.updateRichTextStylePreview),v.on("change",".wpforms-field-option-file-upload .wpforms-field-option-row-style select, .wpforms-field-option-file-upload .wpforms-field-option-row-max_file_number input",function(e){k.fieldFileUploadPreviewUpdate(e.target)}),k.numberSliderEvents(v),k.fieldDynamicChoiceToggleImageChoices(),k.fieldDynamicChoiceToggleIconChoices(),v.on("change",".wpforms-field-option-row-show_price_after_labels input",function(e){var i=b(this).closest(".wpforms-field-option-group-basic").find(".wpforms-field-option-row-choices .choices-list");k.fieldChoiceUpdate(i.data("field-type"),i.data("field-id"))}),v.on("input",".wpforms-field-option-row-preview-notice textarea",k.updatePreviewNotice).on("change",".wpforms-field-option-row-preview-notice-enable input",k.toggleEntryPreviewNotice).on("wpformsFieldAdd",k.maybeLockEntryPreviewGroupOnAdd).on("wpformsFieldMove",k.maybeLockEntryPreviewGroupOnMove).on("click",".wpforms-entry-preview-block",k.entryPreviewBlockField),k.defaultStateEntryPreviewNotice()},focusOutEvent:function(){if(null!==y.$focusOutTarget){if(y.$defaultEmail.is(y.$focusOutTarget)){var i=y.$focusOutTarget;if(""===i.val())return;b.get(wpforms_builder.ajax_url,{nonce:wpforms_builder.nonce,content:i.val(),action:"wpforms_sanitize_default_email"},function(e){e.success&&(i.val(e.data),i.trigger("input"))})}y.$focusOutTarget=null}},isFieldPreviewActionsDisabled:function(e){return k.isFormPreviewActionsDisabled(e)||b(e).closest(".wpforms-field").hasClass("ui-sortable-disabled")},isFormPreviewActionsDisabled:function(e){return b(e).closest(".wpforms-field-wrap").hasClass("ui-sortable-disabled")},fieldGroupToggle:function(e,i){var e=b(e),o=e.next(".wpforms-add-fields-buttons"),t=o.parent(),r=e.find("i"),n="wpforms_field_group_"+e.data("group");"click"===i?(t.hasClass("wpforms-closed")?wpCookies.remove(n):wpCookies.set(n,"true",2592e3),r.toggleClass("wpforms-angle-right"),o.stop().slideToggle("",function(){t.toggleClass("wpforms-closed")})):"load"===i&&(o=e.find(".wpforms-add-fields-buttons"),r=e.find(".wpforms-add-fields-heading i"),n=e.find(".wpforms-add-fields-heading").data("group"),"true"===wpCookies.get("wpforms_field_group_"+n))&&(r.toggleClass("wpforms-angle-right"),o.hide(),e.toggleClass("wpforms-closed"))},updateDescription:function(e,i){e.hasClass("nl2br")&&(i=i.replace(/\n/g,"<br>")),e.html(i)},defaultStateEntryPreviewNotice:function(){b(".wpforms-field-option-row-preview-notice-enable input").each(function(){b(this).trigger("change")})},updatePreviewNotice:function(){var e=b(this),i=wpf.sanitizeHTML(e.val()).trim(),e=e.parent().data("field-id"),e=b("#wpforms-field-"+e).find(".wpforms-entry-preview-notice"),i=i||wpforms_builder.entry_preview_default_notice;k.updateDescription(e,i)},toggleEntryPreviewNotice:function(){var e=b(this),i=e.closest(".wpforms-field-option").data("field-id"),o=b("#wpforms-field-"+i),i=b("#wpforms-field-option-"+i+" .wpforms-field-option-row-preview-notice"),t=o.find(".wpforms-entry-preview-notice"),o=o.find(".wpforms-alert-info");(e.is(":checked")?(o.hide(),t.show(),i):(i.hide(),t.hide(),o)).show()},fieldDelete:function(e){var i=b("#wpforms-field-"+e),o=i.data("field-type");"pagebreak"===o&&i.hasClass("wpforms-field-entry-preview-not-deleted")?k.youCantRemovePageBreakFieldPopup():i.hasClass("no-delete")?k.youCantRemoveFieldPopup():k.confirmFieldDeletion(e,o)},youCantRemovePageBreakFieldPopup:function(){b.alert({title:wpforms_builder.heads_up,content:wpforms_builder.entry_preview_require_page_break,icon:"fa fa-exclamation-circle",type:"red",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"]}}})},youCantReorderFieldPopup:function(){console.warn('WARNING! Function "WPFormsBuilder.youCantReorderFieldPopup()" has been deprecated, please use the new "WPForms.Admin.Builder.DragFields.youCantReorderFieldPopup()" function instead!'),WPForms.Admin.Builder.DragFields.youCantReorderFieldPopup()},youCantRemoveFieldPopup:function(){b.alert({title:wpforms_builder.field_locked,content:wpforms_builder.field_locked_no_delete_msg,icon:"fa fa-info-circle",type:"blue",buttons:{confirm:{text:wpforms_builder.close,btnClass:"btn-confirm",keys:["enter"]}}})},validationErrorNotificationPopup:function(e){b.alert({title:wpforms_builder.heads_up,content:e,icon:"fa fa-exclamation-circle",type:"red",buttons:{confirm:{text:wpforms_builder.close,btnClass:"btn-confirm",keys:["enter"]}}})},confirmFieldDeletion:function(e,i){var o={id:e,message:wpforms_builder.delete_confirm};WPFormsUtils.triggerEvent(v,"wpformsBeforeFieldDeleteAlert",[o,i]).isDefaultPrevented()||b.confirm({title:!1,content:o.message,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){k.fieldDeleteById(e)}},cancel:{text:wpforms_builder.cancel}}})},fieldDeleteById:function(t,e=0,i=400){b("#wpforms-field-"+t).fadeOut(i,function(){var e=b(this),i=e.data("field-type"),e=(v.trigger("wpformsBeforeFieldDelete",[t,i]),e.remove(),b("#wpforms-field-option-"+t).remove(),b(".wpforms-field, .wpforms-title-desc").removeClass("active"),k.fieldTabToggle("add-fields"),b(".wpforms-field-option")),o=v.find(".wpforms-field-submit");e.length<1&&(y.$sortableFieldsWrap.append(y.$noFieldsPreview.clone()),y.$fieldOptions.append(y.$noFieldsOptions.clone()),o.hide()),e.filter(":not(.wpforms-field-option-layout)").length||o.hide(),v.trigger("wpformsFieldDelete",[t,i])})},loadEntryPreviewFields:function(){var e=b("#wpforms-panel-fields .wpforms-field-wrap .wpforms-field-entry-preview");e.length&&e.each(function(){k.lockEntryPreviewFieldsPosition(b(this).data("field-id"))})},fieldEntryPreviewDelete:function(e,i,o){"entry-preview"===o&&(i=(o=b("#wpforms-field-"+i)).prevAll(".wpforms-field-pagebreak").first(),o=o.nextAll(".wpforms-field-pagebreak").first().data("field-id"),o=b("#wpforms-field-option-"+o),i.removeClass("wpforms-field-not-draggable wpforms-field-entry-preview-not-deleted"),o.find(".wpforms-entry-preview-block").removeClass("wpforms-entry-preview-block"),v.trigger("wpformsFieldDragToggle",[i.data("field-id"),i.data("field-type")]))},maybeLockEntryPreviewGroupOnMove:function(e,i){i.item.hasClass("wpforms-field-pagebreak")&&k.maybeLockEntryPreviewGroupOnAdd(e,i.item.data("field-id"),"pagebreak")},maybeLockEntryPreviewGroupOnAdd:function(e,i,o){var t,r,n,s,l,a,d,f,p;"pagebreak"===o&&(t=b("#wpforms-field-"+i),n=(r=b("#wpforms-field-option-"+i+" .wpforms-field-option-row-prev_toggle")).find("input"),l=(s=t.prevAll(".wpforms-field-entry-preview,.wpforms-field-pagebreak").first()).data("field-id"),d=(a=b("#wpforms-field-option-"+l+" .wpforms-field-option-row-prev_toggle")).find("input"),f=t.nextAll(".wpforms-field-entry-preview,.wpforms-field-pagebreak").first(),p=b("#wpforms-field-option-"+f.data("field-id")+" .wpforms-field-option-row-prev_toggle"),s.hasClass("wpforms-field-entry-preview")||f.hasClass("wpforms-field-entry-preview"))&&(s.hasClass("wpforms-field-entry-preview")?(n.attr("checked","checked").trigger("change"),r.addClass("wpforms-entry-preview-block"),p.removeClass("wpforms-entry-preview-block")):(t.addClass("wpforms-field-not-draggable wpforms-field-entry-preview-not-deleted"),v.trigger("wpformsFieldDragToggle",[i,o]),s.removeClass("wpforms-field-not-draggable wpforms-field-entry-preview-not-deleted"),v.trigger("wpformsFieldDragToggle",[l,s.data("field-type")]),s.prevAll(".wpforms-field-entry-preview,.wpforms-field-pagebreak").first().hasClass("wpforms-field-entry-preview")&&(d.attr("checked","checked").trigger("change"),a.addClass("wpforms-entry-preview-block"))))},entryPreviewBlockField:function(e){e.preventDefault(),b.alert({title:wpforms_builder.heads_up,content:wpforms_builder.entry_preview_require_previous_button,icon:"fa fa-exclamation-circle",type:"red",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"]}}})},isUncheckedEntryPreviewField:function(e,i){return!("entry-preview"!==e||i&&i.passed)},addEntryPreviewField:function(e,i){var o,t,r,n=b("#wpforms-add-fields-entry-preview");n.hasClass("wpforms-entry-preview-adding")||(r=b("#wpforms-panel-fields .wpforms-field-wrap > .wpforms-field"),o=i&&i.position?i.position:r.length,t=k.isEntryPreviewFieldRequiresPageBreakBefore(r,o),r=k.isEntryPreviewFieldRequiresPageBreakAfter(r,o),n.addClass("wpforms-entry-preview-adding"),(i=i||{}).passed=!0,t||r?t?k.addPageBreakAndEntryPreviewFields(i,o):k.addEntryPreviewAndPageBreakFields(i,o):k.fieldAdd("entry-preview",i).done(function(e){k.lockEntryPreviewFieldsPosition(e.data.field.id)}))},addEntryPreviewFieldAfterPageBreak:function(e){var i=setInterval(function(){2===b("#wpforms-panel-fields .wpforms-field-wrap").find(".wpforms-pagebreak-bottom, .wpforms-pagebreak-top").length&&(k.fieldAdd("entry-preview",e).done(function(e){k.lockEntryPreviewFieldsPosition(e.data.field.id)}),clearInterval(i))},100)},addPageBreakAndEntryPreviewFields:function(i,o){var t=3<=b("#wpforms-panel-fields .wpforms-field-wrap > .wpforms-field-pagebreak").length;k.fieldAdd("pagebreak",{position:o}).done(function(e){i.position=t?o+1:o+2,k.addEntryPreviewFieldAfterPageBreak(i);e=b("#wpforms-field-option-"+e.data.field.id).find(".wpforms-field-option-row-prev_toggle");e.find("input").attr("checked","checked").trigger("change"),e.addClass("wpforms-entry-preview-block")})},fieldDuplicate:function(o){const t=b("#wpforms-field-"+o);t.hasClass("no-duplicate")?b.alert({title:wpforms_builder.field_locked,content:wpforms_builder.field_locked_no_duplicate_msg,icon:"fa fa-info-circle",type:"blue",buttons:{confirm:{text:wpforms_builder.close,btnClass:"btn-confirm",keys:["enter"]}}}):b.confirm({title:!1,content:wpforms_builder.duplicate_confirm,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){var e,i;this.$$confirm.prop("disabled",!0),WPFormsUtils.triggerEvent(v,"wpformsBeforeFieldDuplicate",[o,t]).isDefaultPrevented()||(e=k.fieldDuplicateRoutine(o),i=b("#wpforms-field-"+e),k.increaseNextFieldIdAjaxRequest(),WPFormsUtils.triggerEvent(v,"wpformsFieldDuplicated",[o,t,e,i]))}},cancel:{text:wpforms_builder.cancel}}})},increaseNextFieldIdAjaxRequest:function(){b.post(wpforms_builder.ajax_url,{form_id:m.formID,field_id:y.$nextFieldId.val(),nonce:wpforms_builder.nonce,action:"wpforms_builder_increase_next_field_id"})},fieldDuplicateRoutine:function(e){var i=b("#wpforms-field-"+e),o=b("#wpforms-field-option-"+e),t=y.$sortableFieldsWrap.find(">.active"),r=y.$fieldOptions.find(">:visible"),n=r.find(">.active"),s=i.data("field-type"),l=o.attr("class"),a=k.dropdownField.helpers.isModernSelect(i.find("> .choices .primary-input"));wpf.restoreTooltips(o),a&&k.dropdownField.helpers.convertModernToClassic(e);let d=o.html();const f=i.clone(),p=parseInt(y.$nextFieldId.val(),10),c=b(`#wpforms-field-option-${e}-label`),m=(c.length?c:b(`#wpforms-field-option-${e}-name`)).val(),u=p+1,w={};var h=""!==m?m+" "+wpforms_builder.duplicate_copy:wpforms_builder.field+` #${e} `+wpforms_builder.duplicate_copy;w.fieldOptionsID=new RegExp("ID #"+e,"g"),w.fieldID=new RegExp("fields\\["+e+"\\]","g"),w.dataFieldID=new RegExp('data-field-id="'+e+'"',"g"),w.referenceID=new RegExp('data-reference="'+e+'"',"g"),w.elementID=new RegExp('\\b(id|for)="wpforms-(.*?)'+e+'(.*?)"',"ig"),i.after(f),t.removeClass("active"),f.addClass("active").attr({id:"wpforms-field-"+p,"data-field-id":p}),w.elementIdReplace=function(e,i,o,t,r,n){return`${i}="wpforms-${o}${p}${t}"`},d=(d=(d=(d=(d=d.replace(w.fieldOptionsID,"ID #"+p)).replace(w.fieldID,`fields[${p}]`)).replace(w.dataFieldID,`data-field-id="${p}"`)).replace(w.referenceID,`data-reference="${p}"`)).replace(w.elementID,w.elementIdReplace),r.hide(),o.after(`<div class="${l}" id="wpforms-field-option-${p}" data-field-id="${p}">${d}</div>`);const g=b("#wpforms-field-option-"+p);return t.data("field-id")===e&&n.length&&(i=n.attr("class").match(/wpforms-field-option-group-\S*/i)[0],r=g.find(">."+i),g.find(">").removeClass("active"),r.addClass("active")),t.data("field-id")!==e&&n.length&&(g.find(">").removeClass("active"),g.find(">.wpforms-field-option-group-basic").addClass("active")),o.find(":input").each(function(e,i){var o=b(this),t=o.attr("name");if(!t)return"continue";var t=t.replace(w.fieldID,`fields[${p}]`),r=o.attr("type");"checkbox"===r||"radio"===r?o.is(":checked")?g.find(`[name="${t}"]`).prop("checked",!0).attr("checked","checked"):g.find(`[name="${t}"]`).prop("checked",!1).attr("checked",!1):o.is("select")?o.find("option:selected").length&&(r=o.find("option:selected").val(),g.find(`[name="${t}"]`).find(`[value="${r}"]`).prop("selected",!0)):""===(r=o.val())&&o.hasClass("wpforms-money-input")?g.find(`[name="${t}"]`).val(wpf.numberFormat("0",wpforms_builder.currency_decimals,wpforms_builder.currency_decimal,wpforms_builder.currency_thousands)):g.find(`[name="${t}"]`).val(r)}),g.find(".wpforms-field-option-hidden-id").val(p),y.$nextFieldId.val(u),b("html"===s?`#wpforms-field-option-${p}-name`:`#wpforms-field-option-${p}-label`).val(h).trigger("input"),v.trigger("wpformsFieldAdd",[p,s]),wpf.initTooltips(),a&&(k.dropdownField.helpers.convertClassicToModern(e),k.dropdownField.helpers.convertClassicToModern(p)),k.fieldChoiceUpdate(f.data("field-type"),p),k.loadColorPickers(),p},addEntryPreviewAndPageBreakFields:function(e,o){k.fieldAdd("entry-preview",e).done(function(e){var i=e.data.field.id;k.fieldAdd("pagebreak",{position:o+1}).done(function(e){k.lockEntryPreviewFieldsPosition(i);e=b("#wpforms-field-"+e.data.field.id).nextAll(".wpforms-field-pagebreak, .wpforms-field-entry-preview").first();e.hasClass("wpforms-field-entry-preview")&&k.lockEntryPreviewFieldsPosition(e.data("field-id"))})})},lockEntryPreviewFieldsPosition:function(e){var i=b("#wpforms-field-"+e),o=i.prevAll(".wpforms-field-pagebreak:not(.wpforms-pagebreak-bottom)").first(),t=i.nextAll(".wpforms-field-pagebreak").first().data("field-id"),t=b("#wpforms-field-option-"+t).find(".wpforms-field-option-row-prev_toggle"),r=t.find("input");i.addClass("wpforms-field-not-draggable"),o.addClass("wpforms-field-not-draggable wpforms-field-entry-preview-not-deleted"),r.attr("checked","checked").trigger("change"),t.addClass("wpforms-entry-preview-block"),b("#wpforms-add-fields-entry-preview").removeClass("wpforms-entry-preview-adding"),v.trigger("wpformsFieldDragToggle",[e,i.data("field-type")]),v.trigger("wpformsFieldDragToggle",[o.data("field-id"),o.data("field-type")])},isEntryPreviewFieldRequiresPageBreakBefore:function(e,i){var e=e.slice(0,i).filter(".wpforms-field-pagebreak,.wpforms-field-entry-preview"),o=!0;return e.length&&b(e.get().reverse()).each(function(){var e=b(this);return!e.hasClass("wpforms-field-entry-preview")&&(e.hasClass("wpforms-field-pagebreak")&&!e.hasClass("wpforms-field-stick")?o=!1:void 0)}),o},isEntryPreviewFieldRequiresPageBreakAfter:function(e,i){var e=e.slice(i).filter(".wpforms-field-pagebreak,.wpforms-field-entry-preview"),o=Boolean(e.length);return e.length&&e.each(function(){var e=b(this);return!e.hasClass("wpforms-field-entry-preview")&&(e.hasClass("wpforms-field-pagebreak")?o=!1:void 0)}),o},fieldAdd:function(n,s){var e=b("#wpforms-add-fields-"+n);if(!(e.hasClass("upgrade-modal")||e.hasClass("education-modal")||e.hasClass("warning-modal")))if(["captcha_turnstile","captcha_hcaptcha","captcha_recaptcha","captcha_none"].includes(n))k.captchaUpdate();else{if(a=!0,WPForms.Admin.Builder.DragFields.disableDragAndDrop(),k.disableFormActions(),!k.isUncheckedEntryPreviewField(n,s))return s=b.extend({},{position:"bottom",$sortable:"base",placeholder:!1,scroll:!0,defaults:!1},s),e={action:"wpforms_new_field_"+n,id:m.formID,type:n,defaults:s.defaults,nonce:wpforms_builder.nonce},b.post(wpforms_builder.ajax_url,e,function(i){if(i.success){var o=y.$sortableFieldsWrap,t=b(i.data.preview),r=b(i.data.options);let e=s.$sortable;a=!1,t.css("display","none"),s.placeholder&&s.placeholder.remove(),"default"!==s.$sortable&&s.$sortable.length||(e=o.find(".wpforms-fields-sortable-default")),"base"!==s.$sortable&&e.length||(e=o);o=WPFormsUtils.triggerEvent(v,"wpformsBeforeFieldAddToDOM",[s,t,r,e]);o.isDefaultPrevented()||(o.skipAddFieldToBaseLevel||k.fieldAddToBaseLevel(s,t,r),t.fadeIn(),v.find(".no-fields, .no-fields-preview").remove(),b(".wpforms-field-option:not(.wpforms-field-option-layout)").length&&v.find(".wpforms-field-submit").show(),s.scroll&&s.position.length&&k.scrollPreviewToField(i.data.field.id),y.$nextFieldId.val(i.data.field.id+1),wpf.initTooltips(),k.loadColorPickers(),k.toggleAllOptionGroups(),v.trigger("wpformsFieldAdd",[i.data.field.id,n]))}else wpf.debug("Add field AJAX call is unsuccessful:",i)}).fail(function(e,i,o){a=!1,wpf.debug("Add field AJAX call failed:",e.responseText)}).always(function(){a||(WPForms.Admin.Builder.DragFields.enableDragAndDrop(),k.enableFormActions())});k.addEntryPreviewField(n,s)}},fieldAddToBaseLevel:function(e,i,o){var t=y.$sortableFieldsWrap,r=t.find("> :not(.wpforms-field-drag-pending)"),n=r.last(),r=r.length,s=y.$fieldOptions;"top"===e.position?(t.prepend(i),s.prepend(o)):"bottom"!==e.position||n.length&&n.hasClass("wpforms-field-stick")?("bottom"===e.position&&(e.position=r),e.position===r&&n.length&&n.hasClass("wpforms-field-stick")?(r=n.data("field-id"),n.before(i),s.find("#wpforms-field-option-"+r).before(o)):(n=t.children(":not(.wpforms-field-drag-pending)").eq(e.position)).length?(r=n.data("field-id"),n.before(i),s.find("#wpforms-field-option-"+r).before(o)):(t.append(i),s.append(o))):(t.append(i),s.append(o))},scrollPreviewToField(e){var e=b("#wpforms-field-"+e),i=y.$fieldsPreviewWrap.scrollTop(),o=e.closest(".wpforms-field-layout");let t=e.position().top;e=(t=o.length?o.position().top+t+20:t)>i?t-i:t+i;y.$fieldsPreviewWrap.scrollTop(e)},captchaUpdate(){var e={action:"wpforms_update_field_captcha",id:m.formID,nonce:wpforms_builder.nonce};return b.post(wpforms_builder.ajax_url,e,function(e){var i,o,t;e.success?(i={title:!1,content:!1,icon:"fa fa-exclamation-circle",type:"orange",boxWidth:"450px",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"]}}},o=b("#wpforms-panel-field-settings-recaptcha"),t=e.data.current,o.data("provider",e.data.provider),"configured_not_enabled"!==t&&"configured_enabled"!==t||(t=o.prop("checked")?"configured_enabled":"configured_not_enabled",i.buttons.confirm.action=function(){o.prop("checked","configured_not_enabled"===t).trigger("change")}),i.title=e.data.cases[t].title,i.content=e.data.cases[t].content,e.data.cases[t].cancel&&(i.buttons.cancel={text:wpforms_builder.cancel,keys:["esc"]}),b.confirm(i)):console.log(e)}).fail(function(e,i,o){console.log(e.responseText)})},disableDragAndDrop:function(){console.warn('WARNING! Function "WPFormsBuilder.disableDragAndDrop()" has been deprecated, please use the new "WPForms.Admin.Builder.DragFields.disableDragAndDrop()" function instead!'),WPForms.Admin.Builder.DragFields.disableDragAndDrop()},enableDragAndDrop:function(){console.warn('WARNING! Function "WPFormsBuilder.enableDragAndDrop()" has been deprecated, please use the new "WPForms.Admin.Builder.DragFields.enableDragAndDrop()" function instead!'),WPForms.Admin.Builder.DragFields.enableDragAndDrop()},disableFormActions:function(){b.each([y.$previewButton,y.$embedButton,y.$saveButton,y.$exitButton],function(e,i){i.prop("disabled",!0).addClass("wpforms-disabled")})},enableFormActions:function(){b.each([y.$previewButton,y.$embedButton,y.$saveButton,y.$exitButton],function(e,i){i.prop("disabled",!1).removeClass("wpforms-disabled")})},fieldSortable:function(){console.warn('WARNING! Function "WPFormsBuilder.fieldSortable()" has been deprecated, please use the new "WPForms.Admin.Builder.DragFields.initSortableFields()" function instead!'),WPForms.Admin.Builder.DragFields.initSortableFields()},fieldDragDisable:function(e,i=!0){console.warn('WARNING! Function "WPFormsBuilder.fieldDragDisable()" has been deprecated, please use the new "WPForms.Admin.Builder.DragFields.fieldDragDisable()" function instead!'),WPForms.Admin.Builder.DragFields.fieldDragDisable(e,i)},fieldDragEnable:function(e){console.warn('WARNING! Function "WPFormsBuilder.fieldDragEnable()" has been deprecated, please use the new "WPForms.Admin.Builder.DragFields.fieldDragEnable()" function instead!'),WPForms.Admin.Builder.DragFields.fieldDragEnable(e)},fieldChoiceAdd:function(e,i){e.preventDefault();var e=b(i),i=e.parent(),o=i.find("input.default").is(":checked"),e=e.closest(".wpforms-field-option-row-choices").data("field-id"),t=i.parent().attr("data-next-id"),r=i.parent().data("field-type"),n=i.clone().insertAfter(i);n.attr("data-key",t),n.find("input.label").val("").attr("name","fields["+e+"][choices]["+t+"][label]"),n.find("input.value").val("").attr("name","fields["+e+"][choices]["+t+"][value]"),n.find(".wpforms-image-upload input.source").val("").attr("name","fields["+e+"][choices]["+t+"][image]"),n.find(".wpforms-icon-select input.source-icon").val(wpforms_builder.icon_choices.default_icon).attr("name","fields["+e+"][choices]["+t+"][icon]"),n.find(".wpforms-icon-select input.source-icon-style").val(wpforms_builder.icon_choices.default_icon_style).attr("name","fields["+e+"][choices]["+t+"][icon_style]"),n.find(".wpforms-icon-select .ic-fa-preview").removeClass().addClass("ic-fa-preview ic-fa-"+wpforms_builder.icon_choices.default_icon_style+" ic-fa-"+wpforms_builder.icon_choices.default_icon),n.find(".wpforms-icon-select .ic-fa-preview + span").text(wpforms_builder.icon_choices.default_icon),n.find("input.default").attr("name","fields["+e+"][choices]["+t+"][default]").prop("checked",!1),n.find(".preview").empty(),n.find(".wpforms-image-upload-add").show(),n.find(".wpforms-money-input").trigger("focusout"),!0===o&&i.find("input.default").prop("checked",!0),t++,i.parent().attr("data-next-id",t),v.trigger("wpformsFieldChoiceAdd"),k.fieldChoiceUpdate(r,e)},fieldChoiceDelete:function(e,i){e.preventDefault();var o,t=b(i),r=t.parent().parent(),e=r.find("li").length,i={id:r.data("field-id"),choiceId:t.closest("li").data("key"),message:"<strong>"+wpforms_builder.delete_choice_confirm+"</strong>",trigger:!1};v.trigger("wpformsBeforeFieldDeleteAlert",[i]),1===e?k.fieldChoiceDeleteAlert():(o=function(){t.parent().remove(),k.fieldChoiceUpdate(r.data("field-type"),r.data("field-id")),v.trigger("wpformsFieldChoiceDelete")},i.trigger?b.confirm({title:!1,content:i.message,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){o()}},cancel:{text:wpforms_builder.cancel}}}):o())},fieldChoiceDeleteAlert:function(){b.alert({title:!1,content:wpforms_builder.error_choice,icon:"fa fa-info-circle",type:"blue",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"]}}})},fieldChoiceSortable:function(t,e){b(e=void 0!==e?e:".wpforms-field-option-"+t+" .wpforms-field-option-row-choices ul").sortable({items:"li",axis:"y",delay:100,opacity:.6,handle:".move",stop:function(e,i){var o=i.item.parent().data("field-id");k.fieldChoiceUpdate(t,o),v.trigger("wpformsFieldChoiceMove",i)},update:function(e,i){}})},fieldChoiceLabel:function(e,i){let o=void 0!==e.settings.choices[i].label&&0!==e.settings.choices[i].label.length?wpf.sanitizeHTML(e.settings.choices[i].label,wpforms_builder.allowed_label_html_tags):wpforms_builder.choice_empty_label_tpl.replace("{number}",i);return e.settings.show_price_after_labels&&(o+=" - "+wpf.amountFormatCurrency(e.settings.choices[i].value)),o},fieldChoiceUpdate:function(s,r){const l=k.dropdownField.helpers.isDynamicChoices(r);if("radio"===s||"checkbox"===s||"payment-multiple"===s||"payment-checkbox"===s){var a=wpf.getChoicesOrder(r),d=wp.template("wpforms-field-preview-checkbox-radio-payment-multiple");let i=wpf.getField(r),o={},e=a.slice(0,20),t={settings:i,order:e,type:"radio"};i.choices_icons&&(t.settings.choices_icons_color=k.getValidColorPickerValue(b("#wpforms-field-option-"+r+"-choices_icons_color"))),e.forEach(function(e){o[e]=i.choices[e]}),i.choices=o,"checkbox"!==s&&"payment-checkbox"!==s||(t.type="checkbox"),l||b("#wpforms-field-"+r).find("ul.primary-input").replaceWith(d(t)),void k.firstNChoicesAlert(r,a.length)}else{"payment-select"===(s="payment-checkbox"===(s="payment-multiple"===s?"radio":s)?"checkbox":s)&&(s="select");const f=b("#wpforms-field-"+r+" .primary-input");let n="";"select"===s?l||(n='<option value="{label}">{label}</option>',f.find("option").not(".placeholder").remove()):"radio"!==s&&"checkbox"!==s&&"gdpr-checkbox"!==s||(s="gdpr-checkbox"===s?"checkbox":s,f.find("li").remove(),n='<li><input type="'+s+'" disabled>{label}</li>');const e=b("#wpforms-field-option-row-"+r+"-choices .choices-list"),i=e.find("li").slice(0,20),o=!!e.find("input.default:checked").length,p=[],c=b("#wpforms-field-option-"+r+"-show_price_after_labels").prop("checked"),m=k.dropdownField.helpers.isModernSelect(f);i.each(function(){var e=b(this),i=e.find("input.value").val(),o=e.data("key");let t=wpf.sanitizeHTML(e.find("input.label").val().trim(),wpforms_builder.allowed_label_html_tags),r;if(t=""!==t?t:wpforms_builder.choice_empty_label_tpl.replace("{number}",o),t+=c&&i?" - "+wpf.amountFormatCurrency(i):"",m?p.push({value:t,label:t}):l||(r=b(n.replace(/{label}/g,t)),f.append(r)),!0===e.find("input.default").is(":checked"))switch(s){case"select":m?p[p.length-1].selected=!0:k.setClassicSelectedChoice(r);break;case"radio":case"checkbox":r.find("input").prop("checked","true")}}),m&&(d=f.prop("multiple")?"input.choices__input":".choices__inner .choices__placeholder",a=k.dropdownField.helpers.getInstance(f),l||a.removeActiveItems(),a.setChoices(p,"value","label",!0),k.dropdownField.helpers.update(r,l),f.closest(".choices").find(d).toggleClass("wpforms-hidden",o))}},setClassicSelectedChoice:function(e){void 0!==e&&e.prop("selected","true")},fieldChoiceBulkAddToggle:function(e){var e=b(e),i=e.closest("label");if(e.hasClass("bulk-add-showing")){var o=i.next(".bulk-add-display");o.slideUp(400,function(){o.remove()}),e.find("span").text(wpforms_builder.bulk_add_show)}else{var t,r=(r='<div class="bulk-add-display unfoldable-cont">')+('<p class="heading wpforms-clear">'+wpforms_builder.bulk_add_heading+' <a href="#" class="toggle-bulk-add-presets">'+wpforms_builder.bulk_add_presets_show+"</a></p>")+"<ul>";for(t in wpforms_preset_choices)r+='<li><a href="#" data-preset="'+t+'" class="bulk-add-preset-insert">'+wpforms_preset_choices[t].name+"</a></li>";r=(r=(r+="</ul>")+('<textarea placeholder="'+wpforms_builder.bulk_add_placeholder+'"></textarea>'))+('<button class="bulk-add-insert wpforms-btn wpforms-btn-sm wpforms-btn-blue">'+wpforms_builder.bulk_add_button+"</button>"),i.after(r+="</div>"),i.next(".bulk-add-display").slideDown(400,function(){b(this).find("textarea").trigger("focus")}),e.find("span").text(wpforms_builder.bulk_add_hide)}e.toggleClass("bulk-add-showing")},fieldChoiceBulkAddInsert:function(e){var i,o,t,e=b(e),r=e.closest(".wpforms-field-option-row"),n=r.find("textarea"),s=r.find(".choices-list"),l=s.find("li:first-of-type").clone().wrap("<div>").parent(),a=r.data("field-id"),d=s.data("field-type"),f=Number(s.attr("data-next-id")),p=n.val().split("\n"),c="";for(o in e.prop("disabled",!0).html(e.html()+" "+m.spinner),l.find("input.value,input.label").attr("value",""),l.find("input.default").attr("checked",!1),l.find("input.source-icon").attr("value",wpforms_builder.icon_choices.default_icon),l.find("input.source-icon-style").attr("value",wpforms_builder.icon_choices.default_icon_style),l.find(".ic-fa-preview").removeClass().addClass(`ic-fa-preview ic-fa-${wpforms_builder.icon_choices.default_icon_style} ic-fa-`+wpforms_builder.icon_choices.default_icon),l.find(".ic-fa-preview + span").text(wpforms_builder.icon_choices.default_icon),i=l.html(),p)p.hasOwnProperty(o)&&(t=wpf.sanitizeHTML(p[o]).trim().replace(/"/g,"""),c+=i.replace(/\[choices\]\[(\d+)\]/g,"[choices]["+f+"]").replace(/data-key="(\d+)"/g,'data-key="'+f+'"').replace(/value="" class="label"/g,'value="'+t+'" class="label"').replace(/class="label" type="text" value=""/g,'class="label" type="text" value="'+t+'"'),f++);s.attr("data-next-id",f).append(c),k.fieldChoiceUpdate(d,a),v.trigger("wpformsFieldChoiceAdd"),k.fieldChoiceBulkAddToggle(r.find(".toggle-bulk-add-display"))},fieldTabToggle:function(e){var i;if(WPFormsUtils.triggerEvent(v,"wpformsFieldTabToggle",[e]).isDefaultPrevented())return!1;b(".wpforms-tab a").removeClass("active"),b(".wpforms-field, .wpforms-title-desc").removeClass("active"),"add-fields"===e?(b("#add-fields a").addClass("active"),b(".wpforms-field-options").hide(),b(".wpforms-add-fields").show()):(b("#field-options a").addClass("active"),"field-options"===e?((i=b(".wpforms-field").first()).addClass("active"),e=i.data("field-id")):b("#wpforms-field-"+e).addClass("active"),b(".wpforms-field-option").hide(),b("#wpforms-field-option-"+e).show(),b(".wpforms-add-fields").hide(),b(".wpforms-field-options").show(),v.trigger("wpformsFieldOptionTabToggle",[e]))},fieldPagebreakAdd:function(e,i,o){"pagebreak"===o&&(m.pagebreakTop?m.pagebreakBottom||(m.pagebreakBottom=!0,k.fieldAdd("pagebreak",{position:"bottom",scroll:!1,defaults:{position:"bottom"}}).done(function(e){m.pagebreakBottom=e.data.field.id;var i=b("#wpforms-field-"+e.data.field.id);b("#wpforms-field-option-"+e.data.field.id).find(".wpforms-field-option-group").addClass("wpforms-pagebreak-bottom"),i.addClass("wpforms-field-stick wpforms-pagebreak-bottom")})):(m.pagebreakTop=!0,k.fieldAdd("pagebreak",{position:"top",scroll:!1,defaults:{position:"top",nav_align:"left"}}).done(function(e){m.pagebreakTop=e.data.field.id;var i=b("#wpforms-field-"+e.data.field.id);b("#wpforms-field-option-"+e.data.field.id).find(".wpforms-field-option-group").addClass("wpforms-pagebreak-top"),i.addClass("wpforms-field-stick wpforms-pagebreak-top")})))},fieldPagebreakDelete:function(e,i,o){var t,r,n;"pagebreak"!==o||b("#wpforms-panel-fields .wpforms-field-pagebreak").not(".wpforms-pagebreak-top, .wpforms-pagebreak-bottom").length||(r=(t=(o=b("#wpforms-panel-fields .wpforms-preview-wrap")).find(".wpforms-pagebreak-top")).data("field-id"),n=(o=o.find(".wpforms-pagebreak-bottom")).data("field-id"),t.remove(),b("#wpforms-field-option-"+r).remove(),m.pagebreakTop=!1,o.remove(),b("#wpforms-field-option-"+n).remove(),m.pagebreakBottom=!1)},fieldPageBreakInitDisplayPrevious:function(e){var i=e.data("field-id"),o=b("#wpforms-field-option-row-"+i+"-prev_toggle"),i=b("#wpforms-field-option-row-"+i+"-prev"),t=e.find(".wpforms-pagebreak-prev");0<e.prevAll(".wpforms-field-pagebreak.wpforms-pagebreak-normal").length?(o.removeClass("hidden"),i.removeClass("hidden"),o.find("input").is(":checked")&&t.removeClass("wpforms-hidden").text(i.find("input").val())):(o.addClass("hidden"),i.addClass("hidden"),t.addClass("wpforms-hidden"))},fieldDynamicChoiceToggle:function(e){var e=b(e),i=e.parent(),o=e.val(),t=i.data("field-id"),r=b("#wpforms-field-option-"+t).find(".wpforms-field-option-hidden-type").val(),e=b("#wpforms-field-"+t),n=b("#wpforms-field-option-row-"+t+"-choices"),s=b("#wpforms-field-option-"+t+"-choices_images"),l=b("#wpforms-field-option-"+t+"-choices_icons");if(k.fieldDynamicChoiceToggleImageChoices(),k.fieldDynamicChoiceToggleIconChoices(),v.trigger("wpformsFieldDynamicChoiceToggle"),wpf.fieldOptionLoading(i),b("#wpforms-field-option-row-"+t+"-dynamic_post_type").remove(),b("#wpforms-field-option-row-"+t+"-dynamic_taxonomy").remove(),""!==o)s.addClass("wpforms-hidden"),l.addClass("wpforms-hidden"),n.find(".toggle-bulk-add-display").addClass("wpforms-hidden"),p={type:o,field_id:t,action:"wpforms_builder_dynamic_choices",nonce:wpforms_builder.nonce},b.post(wpforms_builder.ajax_url,p,function(e){e.success?i.after(e.data.markup):console.log(e),wpf.fieldOptionLoading(i,!0),wpf.initTooltips(),b("#wpforms-field-option-"+t+"-dynamic_"+o).find("option").first().prop("selected",!0),b("#wpforms-field-option-"+t+"-dynamic_"+o).trigger("change")}).fail(function(e,i,o){console.log(e.responseText)});else{if(s.removeClass("wpforms-hidden"),l.removeClass("wpforms-hidden"),n.find(".toggle-bulk-add-display").removeClass("wpforms-hidden"),b("#wpforms-field-"+t).find(".wpforms-alert").remove(),-1<["checkbox","radio","payment-multiple","payment-checkbox"].indexOf(r))k.fieldChoiceUpdate(r,t),n.find("ul").removeClass("wpforms-hidden"),n.find(".wpforms-alert").addClass("wpforms-hidden");else{var a,d=[],f=e.find(".primary-input");if(b("#wpforms-field-option-row-"+t+"-choices li").each(function(){var e=b(this);d.push({label:wpf.sanitizeHTML(e.find(".label").val()),selected:e.find(".default").is(":checked")})}),e.hasClass("wpforms-field-select")){var p=k.dropdownField.helpers.isModernSelect(f),c="";if(f.find("option").not(".placeholder").remove(),p&&d.length)k.dropdownField.helpers.update(t,!1);else for(a in d)c="<option",c=(c+=d[a].selected?" selected>":">")+d[a].label+"</option>",f.append(c)}else for(a in r="radio",e.hasClass("wpforms-field-checkbox")&&(r="checkbox"),f.empty(),d)c='<li><input type="'+r+'" disabled',c=(c+=d[a].selected?" selected>":">")+d[a].label+"</li>",f.append(c);n.find("ul").removeClass("wpforms-hidden"),n.find(".wpforms-alert").addClass("wpforms-hidden"),f.removeClass("wpforms-hidden")}wpf.fieldOptionLoading(i,!0)}},fieldDynamicChoiceSource:function(e){var e=b(e),o=e.parent(),e=e.val(),t=o.data("field-id"),i=b("#wpforms-builder-form").data("id"),r=b("#wpforms-field-option-row-"+t+"-choices"),n=b("#wpforms-field-"+t),s=b("#wpforms-field-option-"+t+"-dynamic_choices option:selected").val(),l=20,s=(wpf.fieldOptionLoading(o),{type:s,source:e,field_id:t,form_id:i,action:"wpforms_builder_dynamic_source",nonce:wpforms_builder.nonce});b.post(wpforms_builder.ajax_url,s,function(i){if(i.success){if(r.find(".dynamic-name").text(i.data.source_name),r.find(".dynamic-type").text(i.data.type_name),r.find("ul").addClass("wpforms-hidden"),r.find(".wpforms-alert").removeClass("wpforms-hidden"),k.fieldDynamicChoiceSourceItems(n,i.data.items),n.hasClass("wpforms-field-select")&&(l=200),n.find(".wpforms-notice-dynamic-empty").remove(),Number(i.data.total)>l){let e=wpforms_builder.dynamic_choices.limit_message;e=(e=(e=(e=e.replace("{source}",i.data.source_name)).replace("{type}",i.data.type_name)).replace("{limit}",l)).replace("{total}",i.data.total),b.alert({title:wpforms_builder.heads_up,content:e,icon:"fa fa-info-circle",type:"blue",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"]}}})}k.firstNChoicesAlert(t,i.data.total),0===Number(i.data.total)&&k.emptyChoicesNotice(t,i.data.source_name,i.data.type)}else console.log(i);wpf.fieldOptionLoading(o,!0)}).fail(function(e,i,o){console.log(e.responseText)})},fieldDynamicChoiceSourceItems:function(e,i){var o=e.find(".primary-input"),t=0;if(e.hasClass("wpforms-field-select"))k.dropdownField.helpers.isModernSelect(o)?k.fieldDynamicChoiceSourceForModernSelect(o,i):k.fieldDynamicChoiceSourceForClassicSelect(o,i);else{var r="radio";for(t in e.hasClass("wpforms-field-checkbox")&&(r="checkbox"),o.empty(),i)o.append('<li><input type="'+r+'" disabled> '+wpf.sanitizeHTML(i[t])+"</li>")}},fieldDynamicChoiceSourceForModernSelect:function(e,i){var o=k.dropdownField.helpers.getInstance(e),t=e.closest(".wpforms-field").data().fieldId;o.destroy(),k.dropdownField.helpers.updatePlaceholderChoice(o,t),k.fieldDynamicChoiceSourceForClassicSelect(e,i),k.dropdownField.events.choicesInit(e)},fieldDynamicChoiceSourceForClassicSelect:function(e,i){var o=0,t=i.length;for(e.find("option").not(".placeholder").remove();o<t;o++){var r=wpf.sanitizeHTML(i[o]);e.append('<option value="'+r+'">'+r+"</option>")}e.toggleClass("wpforms-hidden",!t)},fieldDynamicChoiceToggleImageChoices:function(){b("#wpforms-builder .wpforms-field-options .wpforms-field-option").each(function(e,i){var i=b(i),o=i.find(".wpforms-field-option-row-dynamic_choices select").val(),o=void 0!==o&&""!==o,t=i.find(".wpforms-field-option-row-choices_images input").is(":checked");i.find(".wpforms-field-option-row-choices_images").toggleClass("wpforms-hidden",o),t&&!o||i.find(".wpforms-field-option-row-choices_images_style").addClass("wpforms-hidden")})},fieldDynamicChoiceToggleIconChoices:function(){b("#wpforms-builder .wpforms-field-options .wpforms-field-option").each(function(e,i){var i=b(i),o=i.find(".wpforms-field-option-row-dynamic_choices select").val(),o=void 0!==o&&""!==o,t=i.find(".wpforms-field-option-row-choices_icons input").is(":checked");i.find(".wpforms-field-option-row-choices_icons").toggleClass("wpforms-hidden",o),t&&!o||(i.find(".wpforms-field-option-row-choices_icons_color").addClass("wpforms-hidden"),i.find(".wpforms-field-option-row-choices_icons_size").addClass("wpforms-hidden"),i.find(".wpforms-field-option-row-choices_icons_style").addClass("wpforms-hidden"))})},firstNChoicesAlert:function(e,i){var o=wp.template("wpforms-choices-limit-message"),t={total:i},e=b("#wpforms-field-"+e);e.hasClass("wpforms-field-select")||(e.find(".wpforms-alert-dynamic").remove(),20<i&&e.find(".primary-input").after(o(t)))},emptyChoicesNotice:function(e,i,o){e=b("#wpforms-field-"+e),i=wpforms_builder.dynamic_choices.empty_message.replace("{source}",i).replace("{type}",wpforms_builder.dynamic_choices.entities[o]),o=wp.template("wpforms-empty-choice-message"),i={message:i};e.find(".label-title").after(o(i))},fieldLayoutSelectorToggle:function(e){var e=b(e),i=e.closest("label").next(".layout-selector-display");e.hasClass("layout-selector-showing")?(i.slideUp(400),e.find("span").text(wpforms_builder.layout_selector_show)):(i.slideDown(),e.find("span").text(wpforms_builder.layout_selector_hide)),e.toggleClass("layout-selector-showing")},fieldLayoutSelectorInit:function(o){var e=b(`#wpforms-field-option-row-${o}-css > .layout-selector-display`);if(!e.length){var t,r={"layout-1":[{class:"one-half",data:"wpforms-one-half wpforms-first"},{class:"one-half",data:"wpforms-one-half"}],"layout-2":[{class:"one-third",data:"wpforms-one-third wpforms-first"},{class:"one-third",data:"wpforms-one-third"},{class:"one-third",data:"wpforms-one-third"}],"layout-3":[{class:"one-fourth",data:"wpforms-one-fourth wpforms-first"},{class:"one-fourth",data:"wpforms-one-fourth"},{class:"one-fourth",data:"wpforms-one-fourth"},{class:"one-fourth",data:"wpforms-one-fourth"}],"layout-4":[{class:"one-third",data:"wpforms-one-third wpforms-first"},{class:"two-third",data:"wpforms-two-thirds"}],"layout-5":[{class:"two-third",data:"wpforms-two-thirds wpforms-first"},{class:"one-third",data:"wpforms-one-third"}],"layout-6":[{class:"one-fourth",data:"wpforms-one-fourth wpforms-first"},{class:"one-fourth",data:"wpforms-one-fourth"},{class:"two-fourth",data:"wpforms-two-fourths"}],"layout-7":[{class:"two-fourth",data:"wpforms-two-fourths wpforms-first"},{class:"one-fourth",data:"wpforms-one-fourth"},{class:"one-fourth",data:"wpforms-one-fourth"}],"layout-8":[{class:"one-fourth",data:"wpforms-one-fourth wpforms-first"},{class:"two-fourth",data:"wpforms-two-fourths"},{class:"one-fourth",data:"wpforms-one-fourth"}]};let e,i=`<div class="layout-selector-display unfoldable-cont">
<p class="heading">${wpforms_builder.layout_selector_layout}</p>
<div class="layouts">`;for(t in r){for(var n in e=r[t],i+='<div class="layout-selector-display-layout">',e)i+=`<span class="${e[n].class}" data-classes="${e[n].data}"></span>`;i+="</div>"}i+="</div></div>",b(`#wpforms-field-option-row-${o}-css > label`).after(i)}},fieldLayoutSelectorLayout:function(e){e=b(e);e.parent().find(".layout-selector-display-layout").not(e).remove(),e.parent().find(".heading").text(wpforms_builder.layout_selector_column),e.toggleClass("layout-selector-display-layout layout-selector-display-columns")},fieldLayoutSelectorInsert:function(e){var e=b(e),i=e.closest(".layout-selector-display"),o=i.parent(),t=o.find("label"),o=o.find("input[type=text]"),e=e.data("classes");o.val()&&(e=" "+e),o.insertAtCaret(e),i.slideUp(400,function(){i.remove()}),t.find(".toggle-layout-selector-display").removeClass("layout-selector-showing"),t.find(".toggle-layout-selector-display span").text(wpforms_builder.layout_selector_show)},bindUIActionsSettings:function(){v.on("click","#wpforms-panel-fields .wpforms-title-desc, #wpforms-panel-fields .wpforms-field-submit-button, .wpforms-center-form-name",function(e){e.preventDefault(),k.panelSwitch("settings"),(b(this).hasClass("wpforms-center-form-name")||b(this).hasClass("wpforms-title-desc"))&&setTimeout(function(){b("#wpforms-panel-field-settings-form_title").trigger("focus")},300)}),v.on("click",".wpforms-field-pagebreak-last button",function(e){e.preventDefault(),k.panelSwitch("settings"),b("#wpforms-panel-field-settings-pagebreak_prev").trigger("focus")}),v.on("click",".wpforms-panel-content-also-available-item-add-captcha",function(e){e.preventDefault();e=v.find("#wpforms-add-fields-captcha");e.data("action")?e.trigger("click"):k.fieldAdd("captcha",{}).done(function(){k.panelSwitch("fields")})}),v.on("input","#wpforms-panel-field-settings-pagebreak_prev",function(){b(".wpforms-field-pagebreak-last button").text(b(this).val())}),v.on("input","#wpforms-panel-field-settings-form_title, #wpforms-setup-name",function(){var e=b(this).val().toString().trim();b(".wpforms-preview .wpforms-form-name").text(e),b(".wpforms-center-form-name.wpforms-form-name").text(e),k.trimFormTitle()}),v.on("input","#wpforms-panel-field-settings-form_desc",function(){b(".wpforms-form-desc").text(b(this).val())}),v.on("input","#wpforms-panel-field-settings-submit_text",function(){b(".wpforms-field-submit input[type=submit]").val(b(this).val())}),v.on("change","#wpforms-panel-field-settings-recaptcha",function(){k.captchaToggle()}),v.on("change",".wpforms-panel-field-confirmations-type",function(){k.confirmationFieldsToggle(b(this))}),v.on("change",".wpforms-panel-field-confirmations-message_entry_preview",k.confirmationEntryPreviewToggle),v.on("change","#wpforms-panel-field-settings-notification_enable",function(){k.notificationToggle()}),v.on("click",".wpforms-builder-settings-block-add",function(e){e.preventDefault(),wpforms_builder.pro&&k.settingsBlockAdd(b(this))}),v.on("click",".wpforms-builder-settings-block-edit",function(e){e.preventDefault();e=b(this);e.parents(".wpforms-builder-settings-block-header").find(".wpforms-builder-settings-block-name").hasClass("editing")?k.settingsBlockNameEditingHide(e):k.settingsBlockNameEditingShow(e)}),v.on("blur",".wpforms-builder-settings-block-name-edit input",function(e){b(e.relatedTarget).hasClass("wpforms-builder-settings-block-edit")||k.settingsBlockNameEditingHide(b(this))}),v.on("keypress",".wpforms-builder-settings-block-name-edit input",function(e){13===e.keyCode&&(k.settingsBlockNameEditingHide(b(this)),e.preventDefault())}),v.on("click",".wpforms-builder-settings-block-clone",function(e){e.preventDefault(),k.settingsBlockPanelClone(b(this))}),v.on("click",".wpforms-builder-settings-block-toggle",function(e){e.preventDefault(),k.settingsBlockPanelToggle(b(this))}),v.on("click",".wpforms-builder-settings-block-delete",function(e){e.preventDefault(),k.settingsBlockDelete(b(this))})},captchaToggle:function(){var e=v.find(".wpforms-field-recaptcha"),i=b("#wpforms-panel-field-settings-recaptcha"),o=i.data("provider")||"recaptcha";e.length&&(i.is(":checked")?e.show().toggleClass("is-recaptcha","recaptcha"===o):e.hide())},confirmationsSetup:function(){b(".wpforms-panel-field-confirmations-type").each(function(){k.confirmationFieldsToggle(b(this))}),b(".wpforms-panel-field-confirmations-message").each(function(){"undefined"!=typeof tinymce&&void 0!==wp.editor&&wp.editor.initialize(b(this).attr("id"),m.tinymceDefaults)}),v.on("focusout",".wpforms-panel-field-confirmations-redirect",function(e){const i=b(this);var o=i.val().trim();i.val(o),wpf.isURL(o)||""===o||k.confirmationRedirectValidationError(function(){i.trigger("focus")})}),v.on("wpformsBeforeSave wpformsPanelSectionSwitch wpformsPanelSwitch",function(r){b(".wpforms-confirmation").each(function(e,i){var i=b(i),o=i.find(".wpforms-panel-field-confirmations-type");const t=i.find(".wpforms-panel-field-confirmations-redirect");if(!t.is(":hidden")&&!("redirect"!==o.val()||0<t.val().trim().length))return k.confirmationRedirectValidationError(function(){t.trigger("focus")}),r.stopImmediatePropagation(),r.preventDefault(),!1})})},confirmationRedirectValidationError:function(e){b.confirm({title:wpforms_builder.heads_up,content:wpforms_builder.redirect_url_field_error,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"]}},onDestroy:e})},confirmationFieldsToggle:function(e){var i,o;e.length&&(i=e.val(),(o=e.closest(".wpforms-builder-settings-block-content")).find(".wpforms-panel-field").not(e.parent()).not(".wpforms-conditionals-enable-toggle").hide(),o.find(".wpforms-panel-field-confirmations-"+i).closest(".wpforms-panel-field").show(),"message"===i)&&(o.find(".wpforms-panel-field-confirmations-message_scroll").closest(".wpforms-panel-field").show(),o.find(".wpforms-panel-field-confirmations-message_entry_preview").trigger("change").closest(".wpforms-panel-field").show())},confirmationEntryPreviewToggle:function(){var e=b(this),i=e.closest(".wpforms-builder-settings-block-content").find(".wpforms-panel-field-confirmations-message_entry_preview_style").parent();e.is(":checked")?i.show():i.hide()},notificationToggle:function(){var e=b("#wpforms-panel-field-settings-notification_enable"),i=e.closest(".wpforms-panel-content-section").find(".wpforms-builder-settings-block"),e=e.is(":checked");b(".wpforms-notifications-add").toggleClass("wpforms-hidden",!e),e?i.show():i.hide()},notificationsByStatusAlerts:function(){v.on("change",".wpforms-panel-content-section-notifications .wpforms-notification-by-status-alert",function(e){var i,o,t=b(this);t.prop("checked")&&(o="",o=(o=0===(i=b(".wpforms-radio-group-"+t.attr("data-radio-group")+":checked:not(#"+t.attr("id")+")")).length?wpforms_builder.notification_by_status_enable_alert:(o=wpforms_builder.notification_by_status_switch_alert).replace(/%2\$s/g,i.data("provider-title"))).replace(/%1\$s/g,t.data("provider-title")),b.confirm({title:wpforms_builder.heads_up,content:o,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm"}}}))})},settingsBlockAdd:function(l){var a=Number(l.attr("data-next-id")),d=l.closest(".wpforms-panel-content-section").data("panel"),f=l.data("block-type"),e=wpforms_builder[f+"_prompt"],i='<input autofocus="" type="text" id="settings-block-name" placeholder="'+wpforms_builder[f+"_ph"]+'">',o='<p class="error">'+wpforms_builder[f+"_error"]+"</p>",t=b.confirm({container:v,title:!1,content:e+i+o,icon:"fa fa-info-circle",type:"blue",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){var e=this.$content.find("input#settings-block-name").val().toString().trim(),i=this.$content.find(".error");if(""===e)return i.show(),!1;{var i=l.closest(".wpforms-panel-content-section").find(".wpforms-builder-settings-block").first(),o=(wpf.restoreTooltips(i),i.clone()),t=i.data("block-id");o.attr("data-block-id",a),o.find(".wpforms-builder-settings-block-header span").text(e);o.find("input, textarea, select").each(function(){var e=b(this),i=e.parent();e.hasClass("wpforms-disabled")&&(i.hasClass("from-name")||i.hasClass("from-email"))||(i=e).attr("name")&&(i.val("").attr("name",i.attr("name").replace(/\[(\d+)\]/,"["+a+"]")),i.is("select")?(i.find("option").prop("selected",!1).attr("selected",!1),i.find("option").first().prop("selected",!0).attr("selected","selected")):"checkbox"===i.attr("type")?i.prop("checked",!1).attr("checked",!1).val("1"):i.val("").attr("value",""))});var n="wpforms-panel-field-"+d+"-",s=n+t,r=(o.find('[id^="'+s+'"], [for^="'+s+'"]').each(function(e,i){var o=b(this),t="LABEL"===o.prop("tagName")?"for":"id",r=o.attr(t).replace(new RegExp(s,"g"),n+a);o.attr(t,r)}),t+"-notification-by-status"),t=(o.find('[data-radio-group="'+r+'"]').each(function(e,i){b(this).removeClass("wpforms-radio-group-"+r).addClass("wpforms-radio-group-"+a+"-notification-by-status").attr("data-radio-group",a+"-notification-by-status")}),o.find(".wpforms-builder-settings-block-header input").val(e).attr("value",e),"notification"===f&&(o.find(".email-msg textarea").val("{all_fields}").attr("value","{all_fields}"),o.find(".email-recipient input").val("{admin_email}").attr("value","{admin_email}")),o.removeClass("wpforms-builder-settings-block-default"),"confirmation"===f&&(o.find(".wpforms-panel-field-tinymce").remove(),"undefined"!=typeof WPForms)&&o.find(".wpforms-panel-field-confirmations-type-wrap").after(WPForms.Admin.Builder.Templates.get("wpforms-builder-confirmations-message-field")({id:a})),o.find(".wpforms-conditional-block")),e=(t.length&&"undefined"!=typeof WPForms&&t.html(WPForms.Admin.Builder.Templates.get("wpforms-builder-conditional-logic-toggle-field")({id:a,type:f,actions:JSON.stringify(o.find(".wpforms-panel-field-conditional_logic-checkbox").data("actions")),actionDesc:o.find(".wpforms-panel-field-conditional_logic-checkbox").data("action-desc")})),o.find(".wpforms-field-map-table")),e=(e.length&&e.each(function(e,i){var i=b(i),o=(i.find("tr:not(:first-child)").remove(),i.find(".key input")),i=i.find(".field select"),t=i.data("name");o.attr("value",""),i.attr("name","").attr("data-name",t.replace(/\[(\d+)\]/,"["+a+"]"))}),t=(t=o.wrap("<div>").parent().html()).replace(/\[conditionals\]\[(\d+)\]\[(\d+)\]/g,"[conditionals][0][0]"),i.before(t),i.prev());"confirmation"===f&&(k.prepareChoicesJSField(e,a),k.confirmationFieldsToggle(b(".wpforms-panel-field-confirmations-type").first())),"undefined"!=typeof tinymce&&void 0!==wp.editor&&"confirmation"===f&&wp.editor.initialize("wpforms-panel-field-confirmations-message-"+a,m.tinymceDefaults),wpf.initTooltips(),v.trigger("wpformsSettingsBlockAdded",[e]),l.attr("data-next-id",a+1)}}},cancel:{text:wpforms_builder.cancel}}});v.on("keypress","#settings-block-name",function(e){13===e.keyCode&&b(t.buttons.confirm.el).trigger("click")})},prepareChoicesJSField:function(e,i){var o,e=e.find(`#wpforms-panel-field-confirmations-${i}-page-wrap`);e.length<=0||(i=e.find(`#wpforms-panel-field-confirmations-${i}-page`)).length<=0&&!i.hasClass("choicesjs-select")||(o=e.find(".choices")).length<=0||((i=i.first()).removeAttr("data-choice"),i.removeAttr("hidden"),i.removeClass("choices__input"),b(i).appendTo(e.first()),o.first().remove(),k.dropdownField.events.choicesInit(i))},settingsBlockNameEditingShow:function(e){e=e.parents(".wpforms-builder-settings-block-header");e.find(".wpforms-builder-settings-block-name").addClass("editing").hide(),e.find(".wpforms-builder-settings-block-name-edit").addClass("active"),wpf.focusCaretToEnd(e.find("input"))},settingsBlockNameEditingHide:function(e){var i=e.parents(".wpforms-builder-settings-block-header"),o=i.find(".wpforms-builder-settings-block-name"),i=i.find(".wpforms-builder-settings-block-name-edit"),t=i.find("input").val().trim(),e=e.closest(".wpforms-builder-settings-block").data("block-type");t.length||(t=wpforms_builder[e+"_def_name"]),i.find("input").val(t),o.text(t),o.removeClass("editing").show(),i.removeClass("active")},settingsBlockPanelClone:function(e){var i=e.closest(".wpforms-panel-content-section").find(".wpforms-builder-settings-block-add"),e=e.closest(".wpforms-builder-settings-block"),o=e.find(".wpforms-builder-settings-block-content"),t=parseInt(i.attr("data-next-id"),10),r=e.data("block-type"),n=e.find(".wpforms-builder-settings-block-name").text().trim()+wpforms_builder[r+"_clone"],o=o.is(":hidden"),s=(wpf.restoreTooltips(e),e.clone(!1,!0));k.settingsBlockUpdateState(o,t,r),s.data("block-id",t),s.find(".wpforms-builder-settings-block-header span").text(n),s.find(".wpforms-builder-settings-block-header input").val(n),s.removeClass("wpforms-builder-settings-block-default"),i.attr("data-next-id",t+1),s.find("input, textarea, select").each(function(){var e=b(this);e.attr("name")&&e.attr("name",e.attr("name").replace(/\[(\d+)\]/,"["+t+"]")),e.data("name")&&e.data("name",e.data("name").replace(/\[(\d+)\]/,"["+t+"]")),e.attr("class")&&e.attr("class",e.attr("class").replace(/-(\d+)/,"-"+t)),e.attr("data-radio-group")&&e.attr("data-radio-group",e.attr("data-radio-group").replace(/(\d+)-/,t+"-"))}),s.find("*").each(function(){var e=b(this);e.attr("id")&&e.attr("id",e.attr("id").replace(/-(\d+)/,"-"+t)),e.attr("for")&&e.attr("for",e.attr("for").replace(/-(\d+)-/,"-"+t+"-")),e.data("input-name")&&e.data("input-name",e.data("input-name").replace(/\[(\d+)\]/,"["+t+"]"))}),e.find("select").each(function(){var e=b(this).attr("name"),i=b(this).attr("name").replace(/\[(\d+)\]/,"["+t+"]");s.find('select[name="'+i+'"]').val(b(this).attr("name",e).val())}),s.css("display","none").insertBefore(e).show("fast",function(){wpf.initTooltips()}),v.trigger("wpformsSettingsBlockCloned",[s,e.data("block-id")])},settingsBlockPanelToggle:function(e){var i=e.closest(".wpforms-builder-settings-block"),o=i.data("block-id"),t=i.data("block-type"),r=i.find(".wpforms-builder-settings-block-content"),n=r.is(":visible");r.stop().slideToggle({duration:400,start:function(){k.settingsBlockUpdateState(n,o,t)},always:function(){r.is(":visible")?e.html('<i class="fa fa-chevron-circle-up"></i>'):e.html('<i class="fa fa-chevron-circle-down"></i>')}})},settingsBlockDelete:function(e){var i=e.closest(".wpforms-panel-content-section"),o=e.closest(".wpforms-builder-settings-block"),t=o.data("block-type");i.find(".wpforms-builder-settings-block").length<2||b.confirm({title:!1,content:wpforms_builder[t+"_delete"],icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){var e=o.data("block-id"),i=o.data("block-type");b.post(wpforms_builder.ajax_url,{action:"wpforms_builder_settings_block_state_remove",nonce:wpforms_builder.nonce,block_id:e,block_type:i,form_id:m.formID}),o.remove(),v.trigger("wpformsSettingsBlockDeleted",[t,e])}},cancel:{text:wpforms_builder.cancel}}})},settingsBlockUpdateState:function(e,i,o){b.post(wpforms_builder.ajax_url,{action:"wpforms_builder_settings_block_state_save",state:e?"closed":"opened",form_id:m.formID,block_id:i,block_type:o,nonce:wpforms_builder.nonce})},bindUIActionsRevisions:function(){v.on("wpformsPanelSwitched",function(e,i){"revisions"===i&&(k.updateRevisionsList(),k.updateRevisionPreview())}),v.on("wpformsSaved",function(e){"revisions"===wpf.getQueryString("view")&&k.updateRevisionsList()})},updateRevisionsList:function(){var t=b("#wpforms-panel-revisions .wpforms-revisions-content"),i=b(".wpforms-panel-revisions-button .badge-exclamation");i.length&&b.post(wpforms_builder.ajax_url,{action:"wpforms_mark_panel_viewed",form_id:m.formID,nonce:wpforms_builder.nonce}).done(function(e){e.success?i.remove():wpf.debug(e)}).fail(function(e,i,o){wpf.debug(e.responseText||i||"")}),v.hasClass("wpforms-revisions-enabled")&&t.fadeTo(250,.25,function(){b.post(wpforms_builder.ajax_url,{action:"wpforms_get_form_revisions",form_id:m.formID,revision_id:wpf.getQueryString("revision_id"),nonce:wpforms_builder.nonce}).done(function(e){e.success?t.replaceWith(e.data.html):wpf.debug(e)}).fail(function(e,i,o){wpf.debug(e.responseText||i||""),t.fadeTo(250,1)})})},updateRevisionPreview:function(){var e=y.$formPreview.clone();e.find(".wpforms-field-duplicate, .wpforms-field-delete, .wpforms-field-helper, .wpforms-debug").remove().end(),e.find(".wpforms-field-wrap").removeClass("ui-sortable").addClass("ui-sortable-disabled"),e.find(".wpforms-field").removeClass("ui-sortable-handle ui-draggable ui-draggable-handle active").removeAttr("id data-field-id data-field-type").removeData(),e.find(".wpforms-field-submit-button").prop("disabled",!0),y.$revisionPreview.hasClass("has-preview")?y.$revisionPreview.find(".wpforms-preview-wrap").replaceWith(e):y.$revisionPreview.append(e).addClass("has-preview")},confirmSaveRevision:function(){b.confirm({title:wpforms_builder.heads_up,content:wpforms_builder.revision_update_confirm,icon:"fa fa-exclamation-circle",type:"orange",closeIcon:!1,buttons:{confirm:{text:wpforms_builder.save,btnClass:"btn-confirm",keys:["enter"],action:function(){v.addClass("wpforms-revision-is-saving"),WPFormsBuilder.formSave(!1).done(k.revisionSavedReload)}},cancel:{text:wpforms_builder.cancel,action:function(){WPFormsBuilder.setCloseConfirmation(!0)}}}})},revisionSavedReload:function(){wpf.updateQueryString("view",wpf.getQueryString("view")),wpf.removeQueryParam("revision_id"),l.location.reload()},bindUIActionsSaveExit:function(){v.on("click","#wpforms-embed",function(e){e.preventDefault(),b(this).hasClass("wpforms-disabled")||WPFormsFormEmbedWizard.openPopup()}),v.on("click","#wpforms-save",function(e){e.preventDefault(),k.formSave(!1)}),v.on("click","#wpforms-exit",function(e){e.preventDefault(),k.formExit()}),v.on("wpformsSaved",function(e,i){wpf.removeQueryParam("newform")})},formSave:function(i){var e=y.$saveButton,o=e.find("i.fa-check"),t=e.find("i.wpforms-loading-spinner"),r=e.find("span"),n=r.text();if(v.hasClass("wpforms-is-revision")&&!v.hasClass("wpforms-revision-is-saving"))k.confirmSaveRevision();else{"undefined"!=typeof tinyMCE&&tinyMCE.triggerSave();var s=WPFormsUtils.triggerEvent(v,"wpformsBeforeSave");if(!s.isDefaultPrevented())return r.text(wpforms_builder.saving),e.prop("disabled",!0),o.addClass("wpforms-hidden"),t.removeClass("wpforms-hidden"),s={action:"wpforms_save_form",data:JSON.stringify(b("#wpforms-builder-form").serializeArray()),id:m.formID,nonce:wpforms_builder.nonce},b.post(wpforms_builder.ajax_url,s,function(e){e.success?(wpf.savedState=wpf.getFormState("#wpforms-builder-form"),wpf.initialSave=!1,v.trigger("wpformsSaved",e.data),!0===i&&k.isBuilderInPopup()?k.builderInPopupClose("saved"):!0===i&&(l.location.href=wpforms_builder.exit_url)):(wpf.debug(e),k.formSaveError(e.data))}).fail(function(e,i,o){wpf.debug(e),k.formSaveError()}).always(function(){r.text(n),e.prop("disabled",!1),t.addClass("wpforms-hidden"),o.removeClass("wpforms-hidden")})}},formSaveError:function(e){wpf.empty(e)&&(e=wpforms_builder.error_save_form),b.confirm({title:wpforms_builder.heads_up,content:"<p>"+e+"</p><p>"+wpforms_builder.error_contact_support+"</p>",icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"]}}})},formExit:function(){k.isBuilderInPopup()&&k.formIsSaved()?k.builderInPopupClose("saved"):k.formIsSaved()?l.location.href=wpforms_builder.exit_url:b.confirm({title:!1,content:wpforms_builder.exit_confirm,icon:"fa fa-exclamation-circle",type:"orange",closeIcon:!0,buttons:{confirm:{text:wpforms_builder.save_exit,btnClass:"btn-confirm",keys:["enter"],action:function(){k.formSave(!0)}},cancel:{text:wpforms_builder.exit,action:function(){i=!1,k.isBuilderInPopup()?k.builderInPopupClose("canceled"):l.location.href=wpforms_builder.exit_url}}}})},setCloseConfirmation:function(e){i=!!e},formIsSaved:function(){return wpf.savedState==wpf.getFormState("#wpforms-builder-form")},isBuilderInPopup:function(){return l.self!==l.parent&&"wpforms-builder-iframe"===l.self.frameElement.id},builderInPopupClose:function(e){var i=l.parent.jQuery(".wpforms-builder-popup"),o=b(".wpforms-center-form-name").text();i.find("#wpforms-builder-iframe").attr("src","about:blank"),i.fadeOut(),i.trigger("wpformsBuilderInPopupClose",[e,m.formID,o])},bindUIActionsGeneral:function(){v.on("click",".toggle-smart-tag-display",k.smartTagToggle),v.on("click",".smart-tags-list-display a",k.smartTagInsert),v.on("click",".wpforms-panel-fields-group.unfoldable .wpforms-panel-fields-group-title",k.toggleUnfoldableGroup),v.on("click",".wpforms-field-helper-hide ",k.hideFieldHelper),v.on("input",".wpforms-field-map-table .key-source",function(){var e=b(this).val(),i=b(this).parent().parent().find(".key-destination"),o=i.data("name");e&&i.attr("name",o.replace("{source}",e.replace(/[^0-9a-zA-Z_-]/gi,"")))}),v.on("click",".wpforms-field-map-table .remove",function(e){e.preventDefault(),k.fieldMapTableDeleteRow(e,b(this))}),v.on("click",".wpforms-field-map-table .add",function(e){e.preventDefault(),k.fieldMapTableAddRow(e,b(this))}),b(r).on("wpformsFieldUpdate",k.fieldMapSelect),v.on("input",".wpforms-money-input",function(e){var i=b(this),o=i.val(),t=i[0].selectionStart,r=i[0].selectionEnd;i.val(o.replace(/[^0-9.,]/g,"")),i[0].setSelectionRange(t,r)}),v.on("focusout",".wpforms-money-input",function(e){var i=b(this),o=i.val();if(!o)return o;o=wpf.amountSanitize(o),o=wpf.amountFormat(o);i.val(o)}),v.on("change",".wpforms-panel-field-toggle",function(){var e=b(this);e.prop("disabled")||(e.prop("disabled",!0),k.toggleOptionsGroup(e))}),v.on("change",k.getPaymentsTogglesSelector(),function(e){var i=b(this),o=i.attr("id").replace(/wpforms-panel-field-|-enable|_one_time|_recurring/gi,""),t=b('.wpforms-panel-content-section-notifications [id*="-'+o+'-wrap"]');i.prop("checked")||b("#wpforms-panel-field-"+o+"-enable_one_time").prop("checked")||b("#wpforms-panel-field-"+o+"-enable_recurring").prop("checked")?b("#wpforms-panel-field-settings-disable_entries").prop("checked")?(b.confirm({title:wpforms_builder.heads_up,content:wpforms_builder.payments_entries_off,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"]}}}),i.prop("checked",!1)):t.removeClass("wpforms-hidden"):(t.addClass("wpforms-hidden"),t.find('input[id*="-'+o+'"]').prop("checked",!1))}),v.on("change","#wpforms-panel-field-settings-disable_entries",function(e){var i=b(this);i.prop("checked")&&(k.isPaymentsEnabled()?(b.confirm({title:wpforms_builder.heads_up,content:wpforms_builder.payments_on_entries_off,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"]}}}),i.prop("checked",!1)):b.alert({title:wpforms_builder.heads_up,content:wpforms_builder.disable_entries,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"]}}}))}),v.on("click",".wpforms-image-upload-add",function(e){e.preventDefault();var i=b(this),o=i.parent(),t=wp.media.frames.wpforms_media_frame=wp.media({className:"media-frame wpforms-media-frame",frame:"select",multiple:!1,title:wpforms_builder.upload_image_title,library:{type:"image"},button:{text:wpforms_builder.upload_image_button}});t.on("select",function(){var e=t.state().get("selection").first().toJSON();o.find(".source").val(e.url),o.find(".preview").empty(),o.find(".preview").prepend('<img src="'+e.url+'"><a href="#" title="'+wpforms_builder.upload_image_remove+'" class="wpforms-image-upload-remove"><i class="fa fa-trash-o"></i></a>'),"hide"===i.data("after-upload")&&i.hide(),v.trigger("wpformsImageUploadAdd",[i,o])}),t.open()}),v.on("click",".wpforms-image-upload-remove",function(e){e.preventDefault();e=b(this).parent().parent();e.find(".preview").empty(),e.find(".wpforms-image-upload-add").show(),e.find(".source").val(""),v.trigger("wpformsImageUploadRemove",[b(this),e])}),v.on("blur",".wpforms-notification .wpforms-panel-field-text input",function(){k.validateEmailSmartTags(b(this))}),v.on("blur",".wpforms-notification .wpforms-panel-field-textarea textarea",function(){k.validateEmailSmartTags(b(this))}),v.on("focusout",".wpforms-notification .wpforms-panel-field.js-wpforms-from-email-validation input",k.validateFromEmail),v.on("wpformsPanelSectionSwitch",k.notificationsPanelSectionSwitch),v.on("click","#wpforms-builder-mobile-notice .wpforms-fullscreen-notice-button-primary, #wpforms-builder-mobile-notice .close",function(){l.location.href=wpforms_builder.exit_url}),v.on("click","#wpforms-builder-mobile-notice .wpforms-fullscreen-notice-button-secondary",function(){l.location.href=wpf.updateQueryString("force_desktop_view",1,l.location.href)}),b("#wpforms-builder-license-alert .close").on("click",function(){l.location.href=wpforms_builder.exit_url}),b("#wpforms-builder-license-alert .dismiss").on("click",function(e){e.preventDefault(),b("#wpforms-builder-license-alert").remove(),wpCookies.set("wpforms-builder-license-alert","true",3600)}),v.on("change","#wpforms-panel-field-settings-akismet.wpforms-akismet-disabled",function(e){const i=b(this),o=i.data("akismet-status");i.prop("checked")&&b.alert({title:wpforms_builder.heads_up,content:wpforms_builder[o],icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"]}},onClose:function(){i.prop("checked",!1)}})})},notificationsPanelSectionSwitch:function(e,i){"notifications"===i&&b(".wpforms-notification .wpforms-panel-field.js-wpforms-from-email-validation input").trigger("focusout")},isPaymentsEnabled:function(){var e=!1;return b(k.getPaymentsTogglesSelector()).each(function(){if(b(this).prop("checked"))return!(e=!0)}),e},getPaymentsTogglesSelector:function(){return`.wpforms-panel-content-section-payment-toggle-one-time input,
.wpforms-panel-content-section-payment-toggle-recurring input,
#wpforms-panel-field-stripe-enable,
#wpforms-panel-field-paypal_standard-enable,
#wpforms-panel-field-authorize_net-enable,
#wpforms-panel-field-square-enable`},toggleOptionsGroup:function(e){function i(){e.prop("disabled",!1)}var o=e.attr("name"),t=e.attr("type"),r="",o=b('.wpforms-panel-field-toggle-body[data-toggle="'+o+'"]');0===o.length?i():(r="checkbox"!==t&&"radio"!==t||e.prop("checked")?e.val():"0",o.each(function(){var e=b(this);e.attr("data-toggle-value").toString()===r.toString()?e.slideDown("",i):e.slideUp("",i)}))},toggleAllOptionGroups:function(e){(e=e||v||b("#wpforms-builder")||b("body"))&&e.find(".wpforms-panel-field-toggle").each(function(){var e=b(this);e.prop("disabled",!0),k.toggleOptionsGroup(e)})},toggleUnfoldableGroup:function(e){e.preventDefault();var i=b(e.target).closest(".wpforms-panel-fields-group"),e=i.find(".wpforms-panel-fields-group-inner"),o="wpforms_fields_group_"+i.data("group");i.hasClass("opened")?(wpCookies.remove(o),e.stop().slideUp(150,function(){i.removeClass("opened")})):(wpCookies.set(o,"true",2592e3),i.addClass("opened"),e.stop().slideDown(150))},hideFieldHelper:function(e){e.preventDefault(),e.stopPropagation();e=b(".wpforms-field-helper");wpCookies.set("wpforms_field_helper_hide","true",2592e3),e.hide()},smartTagToggle:function(e){e.preventDefault(),y.$focusOutTarget=null;var e=b(this),i=e.closest(".wpforms-panel-field,.wpforms-field-option-row");i.hasClass("smart-tags-toggling")||(i.addClass("smart-tags-toggling"),e.hasClass("smart-tag-showing")?k.removeSmartTagsList(e):k.insertSmartTagsList(e))},removeSmartTagsList:function(e){var i=e.closest(".wpforms-panel-field,.wpforms-field-option-row"),o=i.find(".smart-tags-list-display");e.find("span").text(wpforms_builder.smart_tags_show),o.slideUp("",function(){o.remove(),e.removeClass("smart-tag-showing"),i.removeClass("smart-tags-toggling")})},insertSmartTagsList:function(e){var i,o=e.closest(".wpforms-panel-field,.wpforms-field-option-row"),t=e.closest("label"),r=!0;t.length||(t=o.find("label"),r=!1),i=k.getSmartTagsList(e,-1!==t.attr("for").indexOf("wpforms-field-option-")),(r?t:e).after(i),e.find("span").text(wpforms_builder.smart_tags_hide),o.find(".smart-tags-list-display").slideDown("",function(){e.addClass("smart-tag-showing"),o.removeClass("smart-tags-toggling")})},getSmartTagsList:function(e,i){var o='<ul class="smart-tags-list-display unfoldable-cont">';return(o+=k.getSmartTagsListFieldsElements(e))+k.getSmartTagsListOtherElements(e,i)+"</ul>"},getSmartTagsListFieldsElements:function(e){var i,o=e.data("type"),t=k.getSmartTagsFields(e),r="";if(!["fields","all"].includes(o))return"";if(!t)return'<li class="heading">'+wpforms_builder.fields_unavailable+"</li>";for(i in r+='<li class="heading">'+wpforms_builder.fields_available+"</li>",wpf.orders.fields){var n=wpf.orders.fields[i];t[n]&&(r+=k.getSmartTagsListFieldsElement(t[n]))}return r},getSmartTagsFields:function(e){e=e.data("fields");return e&&e.length?wpf.getFields(e.split(","),!0):wpf.getFields(!1,!0)},getSmartTagsListFieldsElement:function(e){var i=e.label?wpf.encodeHTMLEntities(wpf.sanitizeHTML(e.label)):wpforms_builder.field+" #"+e.id;return'<li><a href="#" data-type="field" data-meta=\''+e.id+"'>"+i+"</a></li>"},getSmartTagsListOtherElements:function(e,i){var o,t,e=e.data("type");if("other"!==e&&"all"!==e)return"";for(t in o='<li class="heading">'+wpforms_builder.other+"</li>",wpforms_builder.smart_tags)i&&-1<wpforms_builder.smart_tags_disabled_for_fields.indexOf(t)||(o+='<li><a href="#" data-type="other" data-meta=\''+t+"'>"+wpforms_builder.smart_tags[t]+"</a></li>");return o},smartTagInsert:function(e){e.preventDefault();var i,e=b(this),o=e.closest(".smart-tags-list-display"),t=o.closest(".wpforms-panel-field,.wpforms-field-option-row"),r=t.find(".toggle-smart-tag-display"),n=t.find("input[type=text], textarea"),s=e.data("meta"),e="field"===e.data("type")?'{field_id="'+s+'"}':"{"+s+"}";"undefined"!=typeof tinyMCE&&(i=tinyMCE.get(n.prop("id")))&&!i.hasFocus()&&i.focus(!0),i&&!i.isHidden()?i.insertContent(e):(n.insertAtCaret(" "+e+" "),n.val(n.val().trim().replace(" "," ")),n.trigger("focus").trigger("input")),o.slideUp("",function(){o.remove()}),r.find("span").text(wpforms_builder.smart_tags_show),t.find(".toggle-smart-tag-display").removeClass("smart-tag-showing")},fieldMapTableDeleteRow:function(e,i){var i=b(i),o=i.closest("tr"),i=i.closest("table"),t=o.closest(".wpforms-builder-settings-block");"1"<i.find("tr").length&&(o.remove(),v.trigger("wpformsFieldMapTableDeletedRow",[t]))},fieldMapTableAddRow:function(e,i){var i=b(i).closest("tr"),o=i.closest(".wpforms-builder-settings-block"),i=i.clone().insertAfter(i);i.find("input").val(""),i.find("select :selected").prop("selected",!1),i.find(".key-destination").attr("name",""),v.trigger("wpformsFieldMapTableAddedRow",[o,i])},fieldMapSelect:function(e,a){b(".wpforms-field-map-select").each(function(e,i){var o,t=b(this),r=t.find("option:selected").val(),n=t.data("field-map-allowed"),s=t.data("field-map-placeholder");if(void 0!==s&&s||(s=wpforms_builder.select_field),t.empty().append(b("<option>",{value:"",text:s})),void 0!==n&&n){if(n=n.split(" "),a&&!b.isEmptyObject(a))for(var l in wpf.orders.fields)Object.prototype.hasOwnProperty.call(wpf.orders.fields,l)&&(l=wpf.orders.fields[l],o="",a[l])&&(o=void 0!==a[l].label&&""!==a[l].label.toString().trim()?wpf.sanitizeHTML(a[l].label.toString().trim()):wpforms_builder.field+" #"+l,0<=b.inArray(a[l].type,n)||0<=b.inArray("all-fields",n))&&t.append(b("<option>",{value:a[l].id,text:o}));r&&t.find('option[value="'+r+'"]').prop("selected",!0);s=t.data("custom-value-support");"boolean"==typeof s&&s&&t.append(b("<option>",{value:"custom_value",text:wpforms_builder.add_custom_value_label,class:"wpforms-field-map-option-custom-value"})),v.trigger("wpformsFieldSelectMapped",[t])}})},validateEmailSmartTags:function(e){var i=e.val();i&&(i=i.replace(/{(([^<>()\[\]\\.,;:\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,}))}/g,function(e){return e.slice(1,-1)}),e.val(i))},validateFromEmail:function(){var e=b(this),i=e.val().trim();const o=e.parent(),t=o.find(".wpforms-alert-warning-wide"),r="wpforms-panel-field-warning";/[\s,;]/g.test(i)?(t.remove(),o.addClass(r),k.validationErrorNotificationPopup(wpforms_builder.allow_only_one_email)):(i={form_id:m.formID,email:e.val(),nonce:wpforms_builder.nonce,action:"wpforms_builder_notification_from_email_validate"},b.post(wpforms_builder.ajax_url,i,function(e){e.success?(t.remove(),o.removeClass(r)):(o.addClass(r),t.length?t.replaceWith(e.data):o.append(e.data))}).fail(function(e,i,o){console.log(e.responseText)}))},iconChoices:{cache:{},config:{colorPropertyName:"--wpforms-icon-choices-color"},init:function(){k.iconChoices.extendJqueryConfirm(),v.on("wpformsBuilderReady",function(e){wpforms_builder.icon_choices.is_active&&!wpforms_builder.icon_choices.is_installed&&(k.iconChoices.openInstallPromptModal(!0),e.preventDefault())}),v.on("change",".wpforms-field-option-row-choices_icons input",k.iconChoices.toggleIconChoices),v.on("change",".wpforms-field-option-row-choices_icons_color .wpforms-color-picker",k.iconChoices.changeIconsColor),v.on("change",".wpforms-field-option-row-choices_icons_style select, .wpforms-field-option-row-choices_icons_size select",function(){var e=b(this).parent().data("field-id"),i=b("#wpforms-field-option-"+e).find(".wpforms-field-option-hidden-type").val();k.fieldChoiceUpdate(i,e)}),v.on("click",".wpforms-field-option-row-choices .choices-list .wpforms-icon-select",k.iconChoices.openIconPickerModal)},toggleIconChoices:function(){var e,i,o=b(this),t=o.is(":checked"),r=o.closest(".wpforms-field-option-row").data("field-id");t&&!wpforms_builder.icon_choices.is_installed?(k.iconChoices.cache.toggle=o,k.iconChoices.openInstallPromptModal()):(i=(o=b("#wpforms-field-option-"+r)).find(`#wpforms-field-option-${r}-choices_images`),e=o.find(`#wpforms-field-option-row-${r}-choices ul`),t&&i.is(":checked")&&i.prop("checked",!1).trigger("change"),o.find(`#wpforms-field-option-row-${r}-dynamic_choices`).toggleClass("wpforms-hidden",t),o.find(`#wpforms-field-option-row-${r}-choices_icons_color`).toggleClass("wpforms-hidden"),o.find(`#wpforms-field-option-row-${r}-choices_icons_size`).toggleClass("wpforms-hidden"),o.find(`#wpforms-field-option-row-${r}-choices_icons_style`).toggleClass("wpforms-hidden"),i=o.find(`#wpforms-field-option-${r}-choices_icons_color`),i=_.isEmpty(i.val())?wpforms_builder.icon_choices.default_color:i.val(),e.prop("style",k.iconChoices.config.colorPropertyName+`: ${i};`),e.toggleClass("show-icons",t),o.find(`#wpforms-field-option-${r}-input_columns`).val(t?"inline":"").trigger("change"),k.fieldChoiceUpdate(o.find(".wpforms-field-option-hidden-type").val(),r))},changeIconsColor:function(){var e=b(this),i=e.parents(".wpforms-field-option-row").data("field-id"),o=b("#wpforms-field-option-"+i),t=o.find(".wpforms-field-option-hidden-type").val(),o=o.find(".wpforms-field-option-row-choices .choices-list"),e=k.getValidColorPickerValue(e);o.prop("style",k.iconChoices.config.colorPropertyName+`: ${e};`),k.fieldChoiceUpdate(t,i)},openInstallPromptModal:function(e=!1){var i=e?wpforms_builder.icon_choices.strings.reinstall_prompt_content:wpforms_builder.icon_choices.strings.install_prompt_content,i=b.confirm({title:wpforms_builder.heads_up,content:i,icon:"fa fa-info-circle",type:"orange",buttons:{continue:{text:wpforms_builder.continue,btnClass:"btn-confirm",keys:["enter"],action:function(){return this.setIcon("fa fa-cloud-download"),this.setTitle(wpforms_builder.icon_choices.strings.install_title),this.setContent(wpforms_builder.icon_choices.strings.install_content),b.each(this.buttons,function(e,i){i.hide()}),k.iconChoices.installIconLibrary(),!1}}},onOpen:function(){!e&&k.iconChoices.cache.toggle&&k.iconChoices.cache.toggle.prop("checked",!1),k.iconChoices.cache.previousModal=this}});e||(i.buttons.cancel={text:wpforms_builder.cancel,keys:["esc"],action:function(){k.iconChoices.cache.toggle.prop("checked",!1)}})},installIconLibrary:function(){var e={nonce:wpforms_builder.nonce,action:"wpforms_icon_choices_install"};b.ajaxSetup({type:"POST",timeout:12e4}),b.post(wpforms_builder.ajax_url,e,function(e){e.success?k.iconChoices.openInstallSuccessModal():k.iconChoices.openInstallErrorModal(e)}).fail(function(e){k.iconChoices.openInstallErrorModal(e)})},openInstallSuccessModal:function(){b.confirm({title:wpforms_builder.done,content:wpforms_builder.icon_choices.strings.install_success_content,icon:"fa fa-check-circle",type:"green",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){var e;k.iconChoices.cache.toggle&&(k.iconChoices.cache.toggle.prop("checked",!0),e=k.iconChoices.cache.toggle.parents(".wpforms-field-option-row").data("field-id"),(e=v.find(`#wpforms-field-option-${e}-choices_images`)).is(":checked"))&&e.prop("checked",!1),k.formSave(!1).done(function(){l.location.reload()})}}},onOpen:function(){var e;k.iconChoices.cache.toggle&&(e=k.iconChoices.cache.toggle.parents(".wpforms-field-option-row-choices_icons").data("field-id"),v.find(`#wpforms-field-option-${e}-input_columns`).val("inline")),k.iconChoices.cache.previousModal.close()}})},openInstallErrorModal:function(e){b.confirm({title:wpforms_builder.uh_oh,content:wpforms_builder.icon_choices.strings.install_error_content,icon:"fa fa-exclamation-circle",type:"red",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){k.iconChoices.cache.toggle?k.iconChoices.cache.toggle.prop("checked",!1):k.formSaveError()}}},onOpen:function(){wpf.debug(e),k.iconChoices.cache.previousModal.close()},onDestroy:function(){delete k.iconChoices.cache.previousModal,delete k.iconChoices.cache.toggle}})},extendJqueryConfirm:function(){l.Jconfirm.prototype._updateContentMaxHeight=function(){var e=b(l).height()-(this.$jconfirmBox.outerHeight()-this.$contentPane.outerHeight())-(this.offsetTop+this.offsetBottom),i=this.contentMaxHeight||e;this.$contentPane.css({"max-height":Math.min(i,e)+"px"})}},openIconPickerModal:function(){var e=b(this);const i={fieldId:e.parents(".wpforms-field-option-row").data("field-id"),choiceId:e.parent().data("key"),selectedIcon:e.find(".source-icon").val(),selectedIconStyle:e.find(".source-icon-style").val()};var e=`
${wpforms_builder.icon_choices.strings.icon_picker_title}
<span class="wpforms-icon-picker-description">${wpforms_builder.icon_choices.strings.icon_picker_description}</span>
<input type="text" placeholder="${wpforms_builder.icon_choices.strings.icon_picker_search_placeholder}" class="search" id="wpforms-icon-picker-search">
`,o=`
<div class="wpforms-icon-picker-container" id="wpforms-icon-picker-icons">
<ul class="wpforms-icon-picker-icons" data-field-id="${i.fieldId}" data-choice-id="${i.choiceId}"></ul>
<ul class="wpforms-icon-picker-pagination"></ul>
<p class="wpforms-icon-picker-not-found wpforms-hidden" data-message="${wpforms_builder.icon_choices.strings.icon_picker_not_found}"></>
</div>`;b.confirm({title:e,titleClass:"wpforms-icon-picker-title",content:o,icon:!1,closeIcon:!0,type:"orange",backgroundDismiss:!0,boxWidth:800,contentMaxHeight:368,smoothContent:!1,buttons:!1,onOpenBefore:function(){this.$body.addClass("wpforms-icon-picker-jconfirm-box"),this.$contentPane.addClass("wpforms-icon-picker-jconfirm-content-pane")},onContentReady:function(){const e=this;k.iconChoices.initIconsList(i),e.$title.find(".search").focus(),e.$content.find(".wpforms-icon-picker-icons").on("click","li",function(){k.iconChoices.selectIcon(e,b(this))})}})},initIconsList:function(o){var e={valueNames:["name"],listClass:"wpforms-icon-picker-icons",page:wpforms_builder.icon_choices.icons_per_page,pagination:{paginationClass:"wpforms-icon-picker-pagination"},item:function(e){var i=e.icon===o.selectedIcon&&e.style===o.selectedIconStyle?'class="selected"':"";return`
<li data-icon="${e.icon}" data-icon-style="${e.style}"${i}>
<i class="ic-fa-${e.style} ic-fa-${e.icon}"></i>
<span class="name">${e.icon}</span>
</li>`},indexAsync:!0};const t=new List("wpforms-icon-picker-icons",e,wpforms_builder.icon_choices.icons);k.iconChoices.infiniteScrollPagination(t),b("#wpforms-icon-picker-search").on("keyup",function(){t.search(b(this).val(),["name"],function(o,e){for(let e=0,i=t.items.length;e<i;e++)t.items[e].found=new RegExp(o).test(t.items[e].values().icon)})}),t.on("searchComplete",function(){var e=b(".wpforms-icon-picker-not-found");e.html(e.data("message").replace("{keyword}",b("#wpforms-icon-picker-search").val())),e.toggleClass("wpforms-hidden",!_.isEmpty(t.matchingItems))})},infiniteScrollPagination:function(i){let o=1;var e={root:r.querySelector(".wpforms-icon-picker-jconfirm-content-pane"),rootMargin:"600px"};new IntersectionObserver(function(e){e[0].isIntersecting&&(o++,i.show(0,o*wpforms_builder.icon_choices.icons_per_page))},e).observe(r.querySelector(".wpforms-icon-picker-pagination"))},selectIcon:function(e,i){var o=i.parent().data("field-id"),t=i.parent().data("choice-id"),r=i.data("icon"),n=i.data("icon-style"),t=b("#wpforms-field-option-row-"+o+"-choices ul li[data-key="+t+"]"),s=b("#wpforms-field-option-row-"+o+"-choices ul").data("field-type");i.addClass("selected"),i.siblings(".selected").removeClass("selected"),t.find(".wpforms-icon-select span").text(r),t.find(".wpforms-icon-select .ic-fa-preview").removeClass().addClass(`ic-fa-preview ic-fa-${n} ic-fa-`+r),t.find(".wpforms-icon-select .source-icon").val(r),t.find(".wpforms-icon-select .source-icon-style").val(n),k.fieldChoiceUpdate(s,o),e.close()}},dismissNotice:function(){v.on("click",".wpforms-alert-field-not-available .wpforms-dismiss-button",function(e){e.preventDefault();var e=b(this),i=e.closest(".wpforms-alert"),e=e.data("field-id");i.addClass("out"),setTimeout(function(){i.remove()},250),e&&b("#wpforms-field-option-"+e).remove()})},trimFormTitle:function(){var e,i=b(".wpforms-center-form-name");38<i.text().length&&(e=i.text().trim().substring(0,38).split(" ").slice(0,-1).join(" ")+"...",i.text(e))},loadColorPickers:function(){b(".wpforms-color-picker").each(function(){var e=b(this);e.hasClass("minicolors-input")&&e.minicolors("destroy"),e.minicolors({defaultValue:e.data("fallback-color")||""})})},getValidColorPickerValue:function(e){var i=e.minicolors("value"),o=_.isEqual(e.minicolors("rgbObject"),{r:0,g:0,b:0}),t=_.includes(["#000","#000000"],i),e=e.data("fallback-color")||"#000000";return o&&!t?e:i},builderHotkeys:function(){b(r).on("keydown",function(e){if(e.ctrlKey){switch(e.keyCode){case 72:b(y.$helpButton,v).trigger("click");break;case 80:l.open(wpforms_builder.preview_url);break;case 66:b(y.$embedButton,v).trigger("click");break;case 69:l.open(wpforms_builder.entries_url);break;case 83:b(y.$saveButton,v).trigger("click");break;case 81:b(y.$exitButton,v).trigger("click");break;case 191:k.openKeyboardShortcutsModal();break;case 84:b(y.$sidebarToggle,v).trigger("click");break;case 70:y.$fieldsSidebar.scrollTop(0),y.$searchInput.focus();break;default:return}return!1}})},openKeyboardShortcutsModal:function(){b(".wpforms-builder-keyboard-shortcuts").length?jconfirm.instances[jconfirm.instances.length-1].close():b.alert({title:wpforms_builder.shortcuts_modal_title,content:wpforms_builder.shortcuts_modal_msg+wp.template("wpforms-builder-keyboard-shortcuts")(),icon:"fa fa-keyboard-o",type:"blue",boxWidth:"550px",smoothContent:!1,buttons:{confirm:{text:wpforms_builder.close,btnClass:"btn-confirm",keys:["enter"]}},onOpenBefore:function(){this.$body.addClass("wpforms-builder-keyboard-shortcuts")}})},registerTemplates:function(){"undefined"!=typeof WPForms&&WPForms.Admin.Builder.Templates.add(["wpforms-builder-confirmations-message-field","wpforms-builder-conditional-logic-toggle-field"])},exitBack:function(){console.warn('WARNING! Function "WPFormsBuilder.exitBack()" has been deprecated.')}};return k}(document,window,jQuery);WPFormsBuilder.init();