????JFIF??x?x????'
Server IP : 104.21.16.1 / Your IP : 216.73.216.18 Web Server : LiteSpeed System : Linux premium151.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64 User : tempvsty ( 647) PHP Version : 8.0.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/self/cwd/wp-content/plugins/wpforms-lite/assets/js/admin/builder/themes/modules/ |
Upload File : |
export default function(e,a,n){let l=(a.WPForms||{}).Admin.Builder.Themes||{},{isPro:o,isLicenseActive:t,isModern:i,isFullStyles:d,isLowFormPagesVersion:s,strings:r}=wpforms_builder_themes,c={},p={fieldBorderStyle:{none:{disable:["fieldBorderSize","fieldBorderColor"]}},buttonBorderStyle:{none:{disable:["buttonBorderSize","buttonBorderColor"]}},containerBorderStyle:{none:{disable:["containerBorderWidth","containerBorderColor"]}},backgroundImage:{none:{hide:["backgroundPosition","backgroundRepeat","backgroundSizeMode","backgroundWidth","backgroundHeight"]}},backgroundSizeMode:{cover:{hide:["backgroundWidth","backgroundHeight"]}}},b={init(){b.setup(),b.events(),b.handlePanelSwitch(),b.loadColorPickers(),l.store.initFromDOM(),l.store.subscribeAll((e,r)=>{b.changeStyleSettings(e,r),b.handleFieldDependencies(r,e)}),b.renderSavedSettings(),b.applyAllDependencies(),b.blockProSections(),b.runChecks()},setup(){c.$builder=n("#wpforms-builder"),c.$settings=n(".wpforms-panel-content-section-themes"),c.$sidebar=n("#wpforms-builder-themes-sidebar"),c.$preview=n("#wpforms-builder-themes-preview"),c.$tabs=n("#wpforms-builder-themes-sidebar-tabs > a"),b.isMac()&&c.$sidebar.find(".wpforms-builder-themes-sidebar-content").addClass("wpforms-is-mac")},events(){c.$builder.on("click","#wpforms-builder-themes-back",b.handleClosePreviewSidebar).on("click",".wpforms-panel-sidebar-section-themes",b.handleOpenPreviewSidebar).on("wpformsPanelSwitched",".wpforms-panel-sidebar-section-themes",b.handlePanelSwitch).on("wpformsPanelSectionSwitch",b.handlePanelSectionSwitch).on("click",'.wpforms-panel-settings-button.active[data-panel="settings"]',b.handleSettingsTabClick),c.$tabs.on("click",b.handleTabClick)},handleSettingsTabClick(){c.$sidebar.hasClass("wpforms-hidden")||b.handleClosePreviewSidebar(null)},handleFieldDependencies(e,r){b.applyFieldDependency(e,r),b.applyAllDependencies()},applyFieldDependency(e,t){if(p[e]){let o=p[e];Object.keys(o).forEach(e=>{var r=o[e],e=t===e;r.disable&&e?r.disable.forEach(e=>{b.disableField(e)}):r.disable&&r.disable.forEach(e=>{b.enableField(e)}),r.enable&&e?r.enable.forEach(e=>{b.enableField(e)}):r.enable&&r.enable.forEach(e=>{b.disableField(e)}),r.hide&&e?r.hide.forEach(e=>{b.hideField(e)}):r.hide&&r.hide.forEach(e=>{b.showField(e)}),r.show&&e?r.show.forEach(e=>{b.showField(e)}):r.show&&r.show.forEach(e=>{b.hideField(e)})})}},applyAllDependencies(){let o=l.getSettings();Object.keys(p).forEach(e=>{var r=o[e];void 0!==r&&b.applyFieldDependency(e,r)})},disableField(e){e=c.$sidebar.find(`[name*="${e}"]`);e.length&&e.addClass("wpforms-builder-themes-disabled")},enableField(e){e=c.$sidebar.find(`[name*="${e}"]`);e.length&&e.removeClass("wpforms-builder-themes-disabled")},hideField(e){var e=c.$sidebar.find(`[name*="${e}"]`),r=e.parent().parent().hasClass("wpforms-builder-themes-conditional-hide")?e.parent().parent():e.parent(".wpforms-panel-field");e.length&&(e.prop("disabled",!0),r.addClass("wpforms-builder-themes-hidden"))},showField(e){var e=c.$sidebar.find(`[name*="${e}"]`),r=e.parent().parent().hasClass("wpforms-builder-themes-conditional-hide")?e.parent().parent():e.parent(".wpforms-panel-field");e.length&&(e.prop("disabled",!1),r.removeClass("wpforms-builder-themes-hidden"))},handleOpenPreviewSidebar(e){c.$sidebar?.removeClass("wpforms-hidden"),e?.preventDefault()},handleClosePreviewSidebar(e){c.$sidebar?.addClass("wpforms-hidden"),e?.preventDefault()},handlePanelSwitch(){"themes"===wpf.getQueryString("section")&&b.handleOpenPreviewSidebar(null)},handlePanelSectionSwitch(e,r){"themes"===r&&b.checkForFormFeatures()},handleTabClick(e){e.preventDefault(),c.$tabs.toggleClass("active"),n(".wpforms-builder-themes-sidebar-tab-content").toggleClass("wpforms-hidden")},getStyleAttributesKeys(){return["containerPadding","containerBorderStyle","containerBorderWidth","containerBorderRadius","containerShadowSize","containerBorderColor","fieldSize","fieldBorderStyle","fieldBorderRadius","fieldBorderSize","fieldBackgroundColor","fieldBorderColor","fieldTextColor","fieldMenuColor","pageBreakColor","labelSize","labelColor","labelSublabelColor","labelErrorColor","buttonSize","buttonBorderStyle","buttonBorderSize","buttonBorderRadius","buttonBackgroundColor","buttonBorderColor","buttonTextColor","backgroundColor","backgroundPosition","backgroundUrl","backgroundRepeat","backgroundSize","backgroundSizeMode","backgroundWidth","backgroundHeight","backgroundImage"]},getStyleHandlers(){return{"background-url":l.background.setBackgroundUrl,"background-image":l.background.setContainerBackgroundImage,"background-position":l.background.setContainerBackgroundPosition,"background-repeat":l.background.setContainerBackgroundRepeat,"background-color":l.background.setBackgroundColor,"background-height":l.background.handleSizeFromHeight,"background-width":l.background.handleSizeFromWidth}},changeStyleSettings(e,r){var o=c.$preview.find(".wpforms-container")[0];if(o&&b.getStyleAttributesKeys().includes(r)){var t=l.getSettings(),s=r.replace(/[A-Z]/g,e=>"-"+e.toLowerCase());if(e=b.prepareComplexAttrValues(e,r),"function"==typeof b.getStyleHandlers()[s])b.getStyleHandlers()[s](o,e,t);else switch(s){case"field-size":case"label-size":case"button-size":case"container-shadow-size":for(var a in wpforms_builder_themes.sizes[s][e])o.style.setProperty(`--wpforms-${s}-`+a,wpforms_builder_themes.sizes[s][e][a]);break;case"button-background-color":b.maybeUpdateAccentColor(t.buttonBorderColor,e,o),e=b.maybeSetButtonAltBackgroundColor(e,t.buttonBorderColor,o),b.maybeSetButtonAltTextColor(t.buttonTextColor,e,t.buttonBorderColor,o),o.style.setProperty("--wpforms-"+s,e);break;case"button-border-color":b.maybeUpdateAccentColor(e,t.buttonBackgroundColor,o),b.maybeSetButtonAltTextColor(t.buttonTextColor,t.buttonBackgroundColor,e,o),o.style.setProperty("--wpforms-"+s,e);break;case"button-text-color":b.maybeSetButtonAltTextColor(e,t.buttonBackgroundColor,t.buttonBorderColor,o),o.style.setProperty("--wpforms-"+s,e);break;default:o.style.setProperty("--wpforms-"+s,e),o.style.setProperty(`--wpforms-${s}-spare`,e)}}},maybeUpdateAccentColor(e,r,o){var t=o.querySelector("#builder-themes-form-preview-wrapper");e=WPFormsUtils.cssColorsUtils.isTransparentColor(e)?"#066aab":e,WPFormsUtils.cssColorsUtils.isTransparentColor(r)?(t.style.setProperty("--wpforms-button-background-color-alt","rgba( 0, 0, 0, 0 )"),t.style.setProperty("--wpforms-button-background-color",e)):(o.style.setProperty("--wpforms-button-background-color-alt",r),t.style.setProperty("--wpforms-button-background-color-alt",null),t.style.setProperty("--wpforms-button-background-color",null))},maybeSetButtonAltBackgroundColor(e,r,o){return o.querySelector("#builder-themes-form-preview-wrapper").style.setProperty("--wpforms-button-background-color-alt",e),WPFormsUtils.cssColorsUtils.isTransparentColor(e)?WPFormsUtils.cssColorsUtils.isTransparentColor(r)?"#066aab":r:e},maybeSetButtonAltTextColor(e,r,o,t){var s=t.querySelector("#builder-themes-form-preview-wrapper");let a=null;e=e.toLowerCase(),(WPFormsUtils.cssColorsUtils.isTransparentColor(e)||e===r||WPFormsUtils.cssColorsUtils.isTransparentColor(r)&&e===o)&&(a=WPFormsUtils.cssColorsUtils.getContrastColor(r)),t.style.setProperty("--wpforms-button-text-color-alt",e),s.style.setProperty("--wpforms-button-text-color-alt",a)},prepareComplexAttrValues(e,r){return["fieldBorderRadius","fieldBorderSize","buttonBorderRadius","buttonBorderSize","containerPadding","containerBorderWidth","containerBorderRadius","backgroundWidth","backgroundHeight"].includes(r)&&("number"==typeof e||"string"==typeof e&&!e.trim().endsWith("px"))&&(e+="px"),"backgroundUrl"!==r||"string"!=typeof e||e.trim().startsWith("url(")||(e=e?`url( ${e} )`:"url()"),e=b.removeRgbaSpaces(e)},removeRgbaSpaces(e){return"string"==typeof e&&e.includes("rgb")?e.replace(/\(\s*/g,"(").replace(/\s*\)/g,")"):e},renderSavedSettings(){var e;c.$preview.find(".wpforms-container")[0]&&(e=l.getSettings(),_.each(e,(e,r)=>{b.changeStyleSettings(e,r)}))},loadColorPickers(){WPFormsBuilder.loadColorPickers(c.$sidebar,{position:"top left"})},blockProSections(){var e,r;o&&t||(e=n('.wpforms-add-fields-heading[data-group="background_styles"], .wpforms-add-fields-heading[data-group="container_styles"]'),(r=n(".wpforms-builder-themes-pro-section")).addClass("wpforms-builder-themes-disabled-pro"),e.addClass("wpforms-builder-themes-pro-blocked"),r.off("click").on("click",b.handleProSectionClick))},blockAllSections(e=!1){var r=c.$sidebar.find(".wpforms-add-fields-buttons, .wpforms-builder-themes-sidebar-advanced");e?r.removeClass("wpforms-builder-themes-disabled"):r.addClass("wpforms-builder-themes-disabled")},handleProSectionClick(){var e=n(this).prev("a").data("group")?.replace("_styles","");o?t||b.showLicenseModal(r.pro_sections[e],r.pro_sections[e],"pro-section"):b.showProModal(e,r.pro_sections[e])},showProModal(e,r){let o="pro";var t=wpforms_education.upgrade.pro.message_plural.replace(/%name%/g,r);let s={container:"General Container Styles",background:"General Background Styles",themes:"General Pro Themes"};n.alert({backgroundDismiss:!0,title:r+" "+wpforms_education.upgrade.pro.title_plural,icon:"fa fa-lock",content:t,boxWidth:"550px",theme:"modern,wpforms-education",closeIcon:!0,onOpenBefore:function(){this.$btnc.after('<div class="discount-note">'+wpforms_education.upgrade_bonus+"</div>"),this.$btnc.after(wpforms_education.upgrade.pro.doc.replace(/%25name%25/g,"AP - "+r)),this.$body.find(".jconfirm-content").addClass("lite-upgrade")},buttons:{confirm:{text:wpforms_education.upgrade.pro.button,btnClass:"btn-confirm",keys:["enter"],action:()=>{a.open(WPFormsEducation.core.getUpgradeURL(s[e],o),"_blank"),WPFormsEducation.core.upgradeModalThankYou(o)}}}})},showLicenseModal(e,r,o){WPFormsEducation.proCore.licenseModal(e,r,o)},runChecks(){b.checkForClassicStyles(),o&&t&&i&&d&&b.checkForFormFeatures(),b.checkForOldFP()},checkForClassicStyles(){var e=n(".wpforms-builder-themes-style-notice"),r=n(".wpforms-builder-themes-preview-notice");i&&d||(b.blockAllSections(),e.removeClass("wpforms-hidden"),r.addClass("wpforms-hidden"))},checkForFormFeatures(){var e=n("#wpforms-panel-field-lead_forms-enable"),r=n("#wpforms-panel-field-settings-conversational_forms_enable"),e=e.prop("checked")??!1,r=r.prop("checked")??!1,o=n(".wpforms-builder-themes-lf-notice"),t=n(".wpforms-builder-themes-cf-notice"),s=n(".wpforms-builder-themes-preview-notice");e?o.removeClass("wpforms-hidden"):o.addClass("wpforms-hidden"),r?t.removeClass("wpforms-hidden"):t.addClass("wpforms-hidden"),e||r?(s.addClass("wpforms-hidden"),c.$preview.addClass("wpforms-hidden"),b.blockAllSections()):(c.$preview.removeClass("wpforms-hidden"),i&&d&&(b.blockAllSections(!0),s.removeClass("wpforms-hidden"))),b.setupFormFeatureEventHandlers()},setupFormFeatureEventHandlers(){n(".wpforms-builder-themes-lf-notice a").off("click",b.openLFSettings).on("click",b.openLFSettings),n(".wpforms-builder-themes-cf-notice a").off("click",b.openCFSettings).on("click",b.openCFSettings)},checkForOldFP(){var e=n("#wpforms-form-pages-content-block"),r=n("#wpforms-page-forms-fbst-notice");e.length&&s&&(e.prepend(r),r.removeClass("wpforms-hidden"))},openLFSettings(e){b.handleClosePreviewSidebar(e),n("a.wpforms-panel-sidebar-section-lead_forms").click()},openCFSettings(e){b.handleClosePreviewSidebar(e),n("a.wpforms-panel-sidebar-section-conversational_forms").click()},isMac(){return navigator.userAgent.includes("Macintosh")}};return b}