%PDF- %PDF-
Direktori : /var/www/projetos/fungraca.org.br/wp-content/plugins/wpforms-lite/assets/js/ |
Current File : /var/www/projetos/fungraca.org.br/wp-content/plugins/wpforms-lite/assets/js/wpforms-modern.min.js |
"use strict";var WPForms=window.WPForms||{};WPForms.FrontendModern=WPForms.FrontendModern||function(i,o){let n={init:function(){o(n.ready)},ready:function(){n.updateGBBlockAccentColors(),n.initPageBreakButtons(),n.events()},events:function(){o("form.wpforms-form").on("wpformsCombinedUploadsSizeError",n.combinedUploadsSizeError).on("wpformsCombinedUploadsSizeOk",n.combinedUploadsSizeOk).on("wpformsFormSubmitButtonDisable",n.formSubmitButtonDisable).on("wpformsFormSubmitButtonRestore",n.formSubmitButtonRestore).on("wpformsPageChange",n.pageChange),o("form.wpforms-form .wpforms-submit").on("keydown click",n.disabledButtonPress)},updateGBBlockAccentColors:function(){o(".wpforms-block.wpforms-container-full").each(function(){var r=o(this);n.updateGBBlockPageIndicatorColor(r),n.updateGBBlockIconChoicesColor(r),n.updateGBBlockRatingColor(r)})},updateGBBlockPageIndicatorColor:function(r){var r=r.find(".wpforms-page-indicator"),o=r.find(".wpforms-page-indicator-page-progress, .wpforms-page-indicator-page.active .wpforms-page-indicator-page-number"),e=o.find(".wpforms-page-indicator-page-triangle");r.data("indicator-color","var( --wpforms-button-background-color )"),o.css("background-color","var( --wpforms-button-background-color )"),e.css("border-top-color","var( --wpforms-button-background-color )")},updateGBBlockPageIndicatorColorF:function(r){var o,e,r=r.querySelector(".wpforms-page-indicator");r&&(e=(o=r.querySelector(".wpforms-page-indicator-page-progress, .wpforms-page-indicator-page.active .wpforms-page-indicator-page-number")).querySelector(".wpforms-page-indicator-page-triangle"),r.dataset.indicatorColor="var( --wpforms-button-background-color )",o&&o.style.setProperty("background-color","var( --wpforms-button-background-color )"),e)&&e.style.setProperty("border-top-color","var( --wpforms-button-background-color )")},updateGBBlockIconChoicesColor:function(r){r.find(".wpforms-icon-choices").css("--wpforms-icon-choices-color","var( --wpforms-button-background-color )")},updateGBBlockRatingColor:function(r){r.find(".wpforms-field-rating-item svg").css("color","var( --wpforms-button-background-color )")},initPageBreakButtons:function(){o(".wpforms-page-button").removeClass("wpforms-disabled").attr("aria-disabled","false").attr("aria-describedby","")},combinedUploadsSizeError:function(r,o,e){var t=o.data("formid"),a=o.attr("aria-errormessage")||"",t=`wpforms-${t}-footer-error`,i=o.find(".wpforms-submit");o.attr({"aria-invalid":"true","aria-errormessage":a+" "+t}),e.attr({role:"alert",id:t}),e.find("> .wpforms-hidden:first-child").remove(),e.prepend(`<span class="wpforms-hidden">${wpforms_settings.formErrorMessagePrefix}</span>`),i.prop("disabled",!1).addClass("wpforms-disabled").attr("aria-disabled","true").attr("aria-describedby",t)},combinedUploadsSizeOk:function(r,o,e){o.find(".wpforms-submit").removeClass("wpforms-disabled").attr("aria-disabled","false").attr("aria-describedby","")},formSubmitButtonDisable:function(r,o,e){o=o.attr("id")+"-submit-btn-disabled";e.before(`<div class="wpforms-hidden" id="${o}">${wpforms_settings.submitBtnDisabled}</div>`),e.prop("disabled",!1).addClass("wpforms-disabled").attr("aria-disabled","true").attr("aria-describedby",o)},formSubmitButtonRestore:function(r,o,e){var t=o.attr("id")+"-submit-btn-disabled";o.find("#"+t).remove(),e.removeClass("wpforms-disabled").attr("aria-disabled","false").attr("aria-describedby","")},disabledButtonPress:function(r){!o(this).hasClass("wpforms-disabled")||"Enter"!==r.key&&"click"!==r.type||(r.preventDefault(),r.stopPropagation())},pageChange:function(r,e,t){var a=t.find(".wpforms-page-indicator");if(wpforms_settings.indicatorStepsPattern&&a.length){t=t.find(".wpforms-page").length;let r=wpforms_settings.indicatorStepsPattern,o;r=r.replace("{current}",e).replace("{total}",t),o=a.hasClass("progress")?a.find(".wpforms-page-indicator-page-title").data(`page-${e}-title`):a.find(`.wpforms-page-indicator-page-${e} .wpforms-page-indicator-page-title`).text(),r=o?o+". "+r:r,a.attr("aria-valuenow",e),n.screenReaderAnnounce(r,"polite")}},screenReaderAnnounce:function(r,o){var e=i.createElement("div"),t="wpforms-screen-reader-announce-"+Date.now();e.setAttribute("id",t),e.setAttribute("aria-live",o||"polite"),e.classList.add("wpforms-screen-reader-announce");let a=i.body.appendChild(e);setTimeout(function(){a.innerHTML=r},100),setTimeout(function(){i.body.removeChild(a)},1e3)},getColorWithOpacity:function(r,o){r=r.trim();var e=n.getColorAsRGBArray(r);if(!e)return r;o=o&&0!==o.length?o.toString():"1";r=4===e.length?parseFloat(e[3]):1,o=parseFloat(o)*r;return`rgba(${e[0]},${e[1]},${e[2]},${o})`.replace(/\s+/g,"")},getSolidColor:function(r){r=r.trim();var o=n.getColorAsRGBArray(r);return o?`rgb(${o[0]},${o[1]},${o[2]})`:r},isValidColor:function(r){var o=(new Option).style;return o.color=r,""!==o.color},getColorAsRGBArray:function(r){if(!n.isValidColor(r))return!1;r=r.replace(/^#/,"");let o;return r.match(/[0-9a-f]{6,8}$/gi)?(o=r.match(/\w\w/g).map(r=>parseInt(r,16)))[3]=o[3]?(o[3]/255).toFixed(2):1:o=r.split("(")[1].split(")")[0].split(","),o},getCssVar:function(r,o){if(!r||"function"!=typeof r.getPropertyValue)return null;let e=r.getPropertyValue(o).trim();return e=o.includes("color")?e.replace(/\s/g,""):e},getCssVars:function(r){if(!r||!r.length)return null;for(var r=r.hasClass("wpforms-container")?r:r.closest(".wpforms-container"),o=getComputedStyle(r.get(0)),e=wpforms_settings.css_vars,t={},a=0;a<e.length;a++)t[e[a]]=n.getCssVar(o,"--wpforms-"+e[a]);return t}};return n}(document,(window,jQuery)),WPForms.FrontendModern.init();