index of
/
home
/
thefkyzp
/
easyloanly.com
/
wp-content
/
plugins
/
wpforms-lite
/
assets
/
js
/
admin
/
builder
/
File: /home/thefkyzp/easyloanly.com/wp-content/plugins/wpforms-lite/assets/js/admin/builder/setup.min.js
"use strict";var WPForms=window.WPForms||{};WPForms.Admin=WPForms.Admin||{},WPForms.Admin.Builder=WPForms.Admin.Builder||{},WPForms.Admin.Builder.Setup=WPForms.Admin.Builder.Setup||function(s,r){var o={},l={};const a=r(".wpforms-template.selected .wpforms-template-name").text().trim();var m={init(){r(m.ready),r(s).on("load",function(){"function"==typeof r.ready.then?r.ready.then(m.load):m.load()})},ready(){m.setup(),m.setPanelsToggleState(),m.setupTitleFocus(),m.setTriggerBlankLink(),m.setSelectedTemplate(),m.events(),o.$builder.trigger("wpformsBuilderSetupReady")},load(){m.applyTemplateOnRequest()},setup(){o={$builder:r("#wpforms-builder"),$form:r("#wpforms-builder-form"),$formName:r("#wpforms-setup-name"),$panel:r("#wpforms-panel-setup"),$categories:r("#wpforms-panel-setup .wpforms-setup-templates-categories")},l.spinner='<i class="wpforms-loading-spinner wpforms-loading-white wpforms-loading-inline"></i>',l.formID=o.$form.data("id")},events(){o.$builder.on("wpformsBuilderPanelLoaded",m.panelLoaded),m.panelEvents(),o.$builder.on("wpformsPanelSwitched",m.setupTitleFocus),o.$builder.on("input","#wpforms-panel-field-settings-form_title",m.syncTitle).on("input","#wpforms-setup-name",m.syncTitle)},panelEvents(){o.$panel.on("keyup","#wpforms-setup-template-search",_.debounce(WPFormsFormTemplates.searchTemplate,200)).on("click",".wpforms-setup-templates-categories li div",WPFormsFormTemplates.selectCategory).on("click",".wpforms-setup-templates-categories li .chevron",WPFormsFormTemplates.toggleSubcategoriesList).on("click",".wpforms-setup-templates-subcategories li",WPFormsFormTemplates.selectSubCategory).on("click",".wpforms-template-select",m.selectTemplate).on("click",".wpforms-trigger-blank",m.selectBlankTemplate)},panelLoaded(e,t){"setup"===t&&(m.setup(),WPFormsFormTemplates.setup(),m.setSelectedTemplate(),m.panelEvents())},setPanelsToggleState:function(){o.$builder.find("#wpforms-panels-toggle button:not(.active)").toggleClass("wpforms-disabled",""===l.formID)},setTriggerBlankLink:function(){o.$builder.find(".wpforms-trigger-blank").attr({"data-template-name-raw":"Blank Form","data-template":"blank"})},setupTitleFocus(e,t){"setup"===(t=t||wpf.getQueryString("view"))&&(r("#wpforms-setup-name").val(r("#wpforms-panel-field-settings-form_title").val()),o.$formName.trigger("focus"))},setSelectedTemplate(){var e;o.$panel.length&&wpforms_builder.form_meta?.template&&(e=o.$builder.find(`.wpforms-template-select[data-template="${wpforms_builder.form_meta.template}"]`).closest(".wpforms-template")).length&&(e.addClass("selected").addClass("badge"),e.find(".wpforms-badge").remove(),e.find(".wpforms-template-favorite, .wpforms-template-remove").after(wpforms_builder.template_selected_badge),e.hasClass("wpforms-user-template"))&&e.find(".wpforms-template-edit, .wpforms-template-remove").remove()},syncTitle:function(e){("wpforms-setup-name"===e.target.id?r("#wpforms-panel-field-settings-form_title"):r("#wpforms-setup-name")).val(e.target.value)},searchTemplate:function(e){console.warn('WARNING! Function "WPForms.Admin.Builder.Setup.searchTemplate( e )" has been deprecated, please use the new "WPFormsFormTemplates.searchTemplate( e )" function instead!'),WPFormsFormTemplates.searchTemplate(e)},selectCategory:function(e){console.warn('WARNING! Function "WPForms.Admin.Builder.Setup.selectCategory( e )" has been deprecated, please use the new "WPFormsFormTemplates.selectCategory( e )" function instead!'),WPFormsFormTemplates.selectCategory(e)},selectTemplate(e){e.preventDefault();var t,a,e=r(this);e.hasClass("education-modal")||(t=e.data("template"),!l.formID&&t.match(/wpforms-user-template-(\d+)/)&&e.data("create-url")?s.location.href=e.data("create-url"):(o.$panel.find(".wpforms-template").removeClass("active"),e.closest(".wpforms-template").addClass("active"),e.data("labelOriginal",e.html()),e.html(l.spinner+wpforms_builder.loading),a=m.getFormName(e),m.applyTemplate(a,t,e)))},getFormName:function(e){var e=e.data("template-name-raw"),t=o.$formName.val();return!t||a===t?e:t},applyTemplate:function(e,t,a){o.$builder.trigger("wpformsTemplateSelect",t),l.formID?m.selectTemplateExistingForm(e,t,a):WPFormsFormTemplates.selectTemplateProcess(e,t,a,m.selectTemplateProcessAjax)},selectBlankTemplate:function(e){e.preventDefault();var e=r(e.target),t=o.$formName.val()||wpforms_builder.blank_form;m.applyTemplate(t,"blank",e)},selectTemplateExistingForm:function(e,t,a){r.confirm({title:wpforms_builder.heads_up,content:wpforms_builder.template_confirm,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"],action:function(){WPFormsFormTemplates.selectTemplateProcess(e,t,a,m.selectTemplateProcessAjax)}},cancel:{text:wpforms_builder.cancel,action:function(){WPFormsFormTemplates.selectTemplateCancel()}}}})},selectTemplateProcess:function(e,t,a){console.warn('WARNING! Function "WPForms.Admin.Builder.Setup.selectTemplateProcess( formName, template, $button )" has been deprecated, please use the new "WPFormsFormTemplates.selectTemplateProcess( formName, template, $button, callback )" function instead!'),WPFormsFormTemplates.selectTemplateProcess(e,t,a,m.selectTemplateProcessAjax)},selectTemplateCancel:function(){console.warn('WARNING! Function "WPForms.Admin.Builder.Setup.selectTemplateCancel" has been deprecated, please use the new "WPFormsFormTemplates.selectTemplateCancel" function instead!'),WPFormsFormTemplates.selectTemplateCancel()},selectTemplateProcessAjax:function(t,e){WPFormsBuilder.showLoadingOverlay();e={title:t,action:l.formID?"wpforms_update_form_template":"wpforms_new_form",template:e,form_id:l.formID,nonce:wpforms_builder.nonce};r.post(wpforms_builder.ajax_url,e).done(function(e){e.success?(WPFormsBuilder.setCloseConfirmation(!1),s.location.href=wpf.getQueryString("force_desktop_view")?wpf.updateQueryString("force_desktop_view",1,e.data.redirect):e.data.redirect):(wpf.debug(e),"invalid_template"===e.data.error_type?m.selectTemplateProcessInvalidTemplateError(e.data.message,t):m.selectTemplateProcessError(e.data.message))}).fail(function(e,t,a){wpf.debug(e.responseText||t||""),m.selectTemplateProcessError("")})},selectTemplateProcessInvalidTemplateError(e,t){r.alert({title:wpforms_builder.heads_up,content:e,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_builder.use_default_template,btnClass:"btn-confirm",keys:["enter"],action(){m.selectTemplateProcessAjax(t,"simple-contact-form-template"),WPFormsBuilder.hideLoadingOverlay()}},cancel:{text:wpforms_builder.cancel,action(){WPFormsFormTemplates.selectTemplateCancel(),WPFormsBuilder.hideLoadingOverlay()}}}})},selectTemplateProcessError(e){r.alert({title:e,content:wpforms_builder.error_select_template,icon:"fa fa-exclamation-circle",type:"orange",buttons:{confirm:{text:wpforms_builder.ok,btnClass:"btn-confirm",keys:["enter"],action(){WPFormsFormTemplates.selectTemplateCancel(),WPFormsBuilder.hideLoadingOverlay()}}}})},addonsModal:function(e,t,a){console.warn('WARNING! Function "WPForms.Admin.Builder.Setup.addonsModal( formName, template, $button )" has been deprecated, please use the new "WPFormsFormTemplates.addonsModal( formName, template, $button, callback )" function instead!'),WPFormsFormTemplates.addonsModal(e,t,a,m.selectTemplateProcessAjax)},installActivateAddons:function(e,t,a,s){console.warn('WARNING! Function "WPForms.Admin.Builder.Setup.installActivateAddons( addons, previousModal, formName, template )" has been deprecated, please use the new "WPFormsFormTemplates.installActivateAddons( addons, previousModal, formName, template, callback )" function instead!'),WPFormsFormTemplates.installActivateAddons(e,t,a,s,m.selectTemplateProcessAjax)},installActivateAddonsError:function(e,t){console.warn('WARNING! Function "WPForms.Admin.Builder.Setup.installActivateAddonsError( formName, template )" has been deprecated, please use the new "WPFormsFormTemplates.installActivateAddonsError( formName, template, callback )" function instead!'),WPFormsFormTemplates.installActivateAddonsError(e,t,m.selectTemplateProcessAjax)},installActivateAddonAjax:function(e){return console.warn('WARNING! Function "WPForms.Admin.Builder.Setup.installActivateAddonAjax( addon )" has been deprecated, please use the new "WPFormsFormTemplates.installActivateAddonAjax( addon )" function instead!'),WPFormsFormTemplates.installActivateAddonAjax(e)},applyTemplateOnRequest:function(){var e=new URLSearchParams(s.location.search),t=e.get("template_id");"setup"===e.get("view")&&!e.get("form_id")&&t&&o.$panel.find('.wpforms-template .wpforms-btn[data-template="'+t+'"]').trigger("click")}};return m}((document,window),jQuery),WPForms.Admin.Builder.Setup.init();