Skip to content

Fix JS error when removing CSS layout class#3196

Open
truongwp wants to merge 1 commit into
masterfrom
pro-issue-6528
Open

Fix JS error when removing CSS layout class#3196
truongwp wants to merge 1 commit into
masterfrom
pro-issue-6528

Conversation

@truongwp

@truongwp truongwp commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Fixes https://github.com/Strategy11/formidable-pro/issues/6528

Summary by CodeRabbit

  • Bug Fixes
    • Improved form builder stability when a field’s alignment setting is unavailable.
    • Prevented errors when alignment options are missing, while preserving expected default behavior.
    • Refreshed the administrative interface bundle to include the latest fixes and improvements.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The admin JavaScript bundle was re-emitted, and changeFieldClass now safely handles missing option[data-align] elements by using an empty alignment value.

Changes

Admin UI updates

Layer / File(s) Summary
Rebuild admin UI bundle
js/formidable_admin.js
Replaces the compiled bundle containing addon flows, upgrade UI, hooks, i18n helpers, validation helpers, and form-builder interactions.
Guard missing alignment options
js/src/admin/admin.js
Conditionally reads the alignment attribute and uses an empty string when no alignment option is available.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested reviewers: garretlaxton

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing a JavaScript error related to removing a CSS layout class.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch pro-issue-6528

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@deepsource-io

deepsource-io Bot commented Jul 21, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in 057c563...bb3f706 on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
PHP Jul 21, 2026 6:36p.m. Review ↗
JavaScript Jul 21, 2026 6:36p.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@js/formidable_admin.js`:
- Line 1: The add-on installer success callback in module 1105 invokes u with
the undefined message identifier. Replace that argument with the intended
status-label value already available from the source module, regenerate the
bundled output, and add coverage for the successful install path to ensure the
UI update completes without a ReferenceError.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d9c2eed0-49a6-44ed-b95d-9d630e1fb583

📥 Commits

Reviewing files that changed from the base of the PR and between 057c563 and bb3f706.

📒 Files selected for processing (2)
  • js/formidable_admin.js
  • js/src/admin/admin.js

Comment thread js/formidable_admin.js
(()=>{var e={65:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(8793),o=n(1323);function i(e){var t=(0,r.A)(e);return function(e){return(0,o.A)(t,e)}}},1323:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r={"!":function(e){return!e},"*":function(e,t){return e*t},"/":function(e,t){return e/t},"%":function(e,t){return e%t},"+":function(e,t){return e+t},"-":function(e,t){return e-t},"<":function(e,t){return e<t},"<=":function(e,t){return e<=t},">":function(e,t){return e>t},">=":function(e,t){return e>=t},"==":function(e,t){return e===t},"!=":function(e,t){return e!==t},"&&":function(e,t){return e&&t},"||":function(e,t){return e||t},"?:":function(e,t,n){if(e)throw t;return n}};function o(e,t){var n,o,i,a,l,s,c=[];for(n=0;n<e.length;n++){if(l=e[n],a=r[l]){for(o=a.length,i=Array(o);o--;)i[o]=c.pop();try{s=a.apply(null,i)}catch(e){return e}}else s=t.hasOwnProperty(l)?t[l]:+l;c.push(s)}return c[0]}},1364:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(65);function o(e){var t=(0,r.A)(e);return function(e){return+t({n:e})}}},8793:(e,t,n)=>{"use strict";var r,o,i,a;function l(e){for(var t,n,l,s,c=[],d=[];t=e.match(a);){for(n=t[0],(l=e.substr(0,t.index).trim())&&c.push(l);s=d.pop();){if(i[n]){if(i[n][0]===s){n=i[n][1]||n;break}}else if(o.indexOf(s)>=0||r[s]<r[n]){d.push(s);break}c.push(s)}i[n]||d.push(n),e=e.substr(t.index+n.length)}return(e=e.trim())&&c.push(e),c.concat(d.reverse())}n.d(t,{A:()=>l}),r={"(":9,"!":8,"*":7,"/":7,"%":7,"+":6,"-":6,"<":5,"<=":5,">":5,">=":5,"==":4,"!=":4,"&&":3,"||":2,"?":1,"?:":1},o=["(","?"],i={")":["("],":":["?","?:"]},a=/<=|>=|==|!=|&&|\|\||\?:|\(|!|\*|\/|%|\+|-|<|>|\?|\)|:/},7521:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(6956),o=n(7395);const i=function(e,t){return function(n,i,a){var l=arguments.length>3&&void 0!==arguments[3]?arguments[3]:10,s=e[t];if((0,o.A)(n)&&(0,r.A)(i))if("function"==typeof a)if("number"==typeof l){var c={callback:a,priority:l,namespace:i};if(s[n]){var d,u=s[n].handlers;for(d=u.length;d>0&&!(l>=u[d-1].priority);d--);d===u.length?u[d]=c:u.splice(d,0,c),s.__current.forEach(function(e){e.name===n&&e.currentIndex>=d&&e.currentIndex++})}else s[n]={handlers:[c],runs:0};"hookAdded"!==n&&e.doAction("hookAdded",n,i,a,l)}else console.error("If specified, the hook priority must be a number.");else console.error("The hook callback must be a function.")}}},11:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(e,t){return function(){var n,r,o=e[t];return null!==(n=null===(r=o.__current[o.__current.length-1])||void 0===r?void 0:r.name)&&void 0!==n?n:null}}},5375:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(7395);const o=function(e,t){return function(n){var o=e[t];if((0,r.A)(n))return o[n]&&o[n].runs?o[n].runs:0}}},3561:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(e,t){return function(n){var r=e[t];return void 0===n?void 0!==r.__current[0]:!!r.__current[0]&&n===r.__current[0].name}}},8830:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(e,t){return function(n,r){var o=e[t];return void 0!==r?n in o&&o[n].handlers.some(function(e){return e.namespace===r}):n in o}}},7765:(e,t,n)=>{"use strict";n.d(t,{A:()=>f});var r=n(3029),o=n(7521),i=n(4194),a=n(8830),l=n(6763),s=n(11),c=n(3561),d=n(5375),u=function e(){(0,r.A)(this,e),this.actions=Object.create(null),this.actions.__current=[],this.filters=Object.create(null),this.filters.__current=[],this.addAction=(0,o.A)(this,"actions"),this.addFilter=(0,o.A)(this,"filters"),this.removeAction=(0,i.A)(this,"actions"),this.removeFilter=(0,i.A)(this,"filters"),this.hasAction=(0,a.A)(this,"actions"),this.hasFilter=(0,a.A)(this,"filters"),this.removeAllActions=(0,i.A)(this,"actions",!0),this.removeAllFilters=(0,i.A)(this,"filters",!0),this.doAction=(0,l.A)(this,"actions"),this.applyFilters=(0,l.A)(this,"filters",!0),this.currentAction=(0,s.A)(this,"actions"),this.currentFilter=(0,s.A)(this,"filters"),this.doingAction=(0,c.A)(this,"actions"),this.doingFilter=(0,c.A)(this,"filters"),this.didAction=(0,d.A)(this,"actions"),this.didFilter=(0,d.A)(this,"filters")};const f=function(){return new u}},4194:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(6956),o=n(7395);const i=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(i,a){var l=e[t];if((0,o.A)(i)&&(n||(0,r.A)(a))){if(!l[i])return 0;var s=0;if(n)s=l[i].handlers.length,l[i]={runs:l[i].runs,handlers:[]};else for(var c=l[i].handlers,d=function(e){c[e].namespace===a&&(c.splice(e,1),s++,l.__current.forEach(function(t){t.name===i&&t.currentIndex>=e&&t.currentIndex--}))},u=c.length-1;u>=0;u--)d(u);return"hookRemoved"!==i&&e.doAction("hookRemoved",i,a),s}}}},6763:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return function(r){var o=e[t];o[r]||(o[r]={handlers:[],runs:0}),o[r].runs++;for(var i=o[r].handlers,a=arguments.length,l=new Array(a>1?a-1:0),s=1;s<a;s++)l[s-1]=arguments[s];if(!i||!i.length)return n?l[0]:void 0;var c={name:r,currentIndex:0};for(o.__current.push(c);c.currentIndex<i.length;){var d=i[c.currentIndex].callback.apply(null,l);n&&(l[0]=d),c.currentIndex++}return o.__current.pop(),n?l[0]:void 0}}},2133:(e,t,n)=>{"use strict";n.d(t,{se:()=>r});var r=(0,n(7765).A)();r.addAction,r.addFilter,r.removeAction,r.removeFilter,r.hasAction,r.hasFilter,r.removeAllActions,r.removeAllFilters,r.doAction,r.applyFilters,r.currentAction,r.currentFilter,r.doingAction,r.doingFilter,r.didAction,r.didFilter,r.actions,r.filters},7395:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(e){return"string"!=typeof e||""===e?(console.error("The hook name must be a non-empty string."),!1):/^__/.test(e)?(console.error("The hook name cannot begin with `__`."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.-]*$/.test(e)||(console.error("The hook name can only contain numbers, letters, dashes, periods and underscores."),!1)}},6956:(e,t,n)=>{"use strict";n.d(t,{A:()=>r});const r=function(e){return"string"!=typeof e||""===e?(console.error("The namespace must be a non-empty string."),!1):!!/^[a-zA-Z][a-zA-Z0-9_.\-\/]*$/.test(e)||(console.error("The namespace can only contain numbers, letters, dashes, periods, underscores and slashes."),!1)}},772:(e,t,n)=>{"use strict";n.d(t,{h:()=>c});var r=n(4467),o=n(5397);function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach(function(t){(0,r.A)(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var l={"":{plural_forms:function(e){return 1===e?0:1}}},s=/^i18n\.(n?gettext|has_translation)(_|$)/,c=function(e,t,n){var r=new o.A({}),i=new Set,c=function(){i.forEach(function(e){return e()})},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"default";r.data[t]=a(a(a({},l),r.data[t]),e),r.data[t][""]=a(a({},l[""]),r.data[t][""])},u=function(e,t){d(e,t),c()},f=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default",t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0;return r.data[e]||d(void 0,e),r.dcnpgettext(e,t,n,o,i)},m=function(){return arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default"},_=function(e,t,r){var o=f(r,t,e);return n?(o=n.applyFilters("i18n.gettext_with_context",o,e,t,r),n.applyFilters("i18n.gettext_with_context_"+m(r),o,e,t,r)):o};if(e&&u(e,t),n){var p=function(e){s.test(e)&&c()};n.addAction("hookAdded","core/i18n",p),n.addAction("hookRemoved","core/i18n",p)}return{getLocaleData:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return r.data[e]},setLocaleData:u,resetLocaleData:function(e,t){r.data={},r.pluralForms={},u(e,t)},subscribe:function(e){return i.add(e),function(){return i.delete(e)}},__:function(e,t){var r=f(t,void 0,e);return n?(r=n.applyFilters("i18n.gettext",r,e,t),n.applyFilters("i18n.gettext_"+m(t),r,e,t)):r},_x:_,_n:function(e,t,r,o){var i=f(o,void 0,e,t,r);return n?(i=n.applyFilters("i18n.ngettext",i,e,t,r,o),n.applyFilters("i18n.ngettext_"+m(o),i,e,t,r,o)):i},_nx:function(e,t,r,o,i){var a=f(i,o,e,t,r);return n?(a=n.applyFilters("i18n.ngettext_with_context",a,e,t,r,o,i),n.applyFilters("i18n.ngettext_with_context_"+m(i),a,e,t,r,o,i)):a},isRTL:function(){return"rtl"===_("ltr","text direction")},hasTranslation:function(e,t,o){var i,a,l=t?t+""+e:e,s=!(null===(i=r.data)||void 0===i||null===(a=i[null!=o?o:"default"])||void 0===a||!a[l]);return n&&(s=n.applyFilters("i18n.has_translation",s,e,t,o),s=n.applyFilters("i18n.has_translation_"+m(o),s,e,t,o)),s}}}},5839:(e,t,n)=>{"use strict";n.d(t,{__:()=>a});var r=n(772),o=n(2133),i=(0,r.h)(void 0,void 0,o.se),a=(i.getLocaleData.bind(i),i.setLocaleData.bind(i),i.resetLocaleData.bind(i),i.subscribe.bind(i),i.__.bind(i));i._x.bind(i),i._n.bind(i),i._nx.bind(i),i.isRTL.bind(i),i.hasTranslation.bind(i)},9575:(e,t,n)=>{"use strict";n.d(t,{__:()=>r.__}),n(181),n(772);var r=n(5839)},181:(e,t,n)=>{"use strict";var r=n(8616),o=n.n(r);n(7604),o()(console.error)},1105:(e,t,n)=>{"use strict";n.r(t),n.d(t,{addonError:()=>f,afterAddonInstall:()=>u,extractErrorFromAddOnResponse:()=>d,toggleAddonState:()=>c});var r=n(9575);function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,l=[],s=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;s=!1}else for(;!(s=(r=i.call(n)).done)&&(l.push(r.value),l.length!==t);s=!0);}catch(e){c=!0,o=e}finally{try{if(!s&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw o}}return l}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var a=frmDom,l=a.div,s=a.svg;function c(e,t){var n,r=null!==(n=window.ajaxurl)&&void 0!==n?n:frm_js.ajax_url;jQuery(".frm-addon-error").remove();var o=jQuery(e),i=o.attr("rel"),a=o.parent(),l=a.parent().find(".addon-status-label");o.addClass("frm_loading_button"),jQuery.ajax({url:r,type:"POST",async:!0,cache:!1,dataType:"json",data:{action:t,nonce:frmGlobal.nonce,plugin:i},success:function(e){var n,r,i;"string"!=typeof(e=null!==(n=null===(r=e)||void 0===r?void 0:r.data)&&void 0!==n?n:e)&&"string"==typeof e.message&&(void 0!==e.saveAndReload&&(i=e.saveAndReload),e=e.message);var s=d(e);s?f(s,a,o):(u(e,o,l,a,i,t),wp.hooks.doAction("frm_update_addon_state",e))},error:function(){o.removeClass("frm_loading_button")}})}function d(e){return"string"!=typeof e&&!e.success&&(e.form&&jQuery(e.form).is("#message")?{message:jQuery(e.form).find("p").html()}:e)}function u(e,t,n,i,a){var c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"frm_activate_addon",d=frm_admin_js,u=document.querySelectorAll(".frm-addon-status");u.forEach(function(t){t.textContent=e,t.style.display="block"}),t.css({opacity:"0"}),document.querySelectorAll(".frm-oneclick").forEach(function(e){e.style.display="none"}),function(){var e=document.getElementById("frm_upgrade_modal");if(e){e.classList.add("frm-success");var t=e.querySelector(".frm-upgrade-message");if(t){var n=t.querySelector("img");t.replaceChildren((0,r.__)("Great! Everything's ready to go!","formidable"),document.createElement("br"),(0,r.__)("You just need to refresh the builder so the new field becomes available.","formidable")),n&&t.append(n)}var o=document.querySelector(".frm-addon-status");o&&(o.textContent="");var i,a=e.querySelector(".frm-circled-icon");if(a)a.classList.add("frm-circled-icon-green"),null===(i=a.querySelector("svg"))||void 0===i||i.replaceWith(s({href:"#frm_checkmark_icon"}))}}();var f={frm_activate_addon:{class:"frm-addon-active",message:d.active},frm_deactivate_addon:{class:"frm-addon-installed",message:d.installed},frm_uninstall_addon:{class:"frm-addon-not-installed",message:d.not_installed}};f.frm_install_addon=f.frm_activate_addon;var _=o(n,1)[0];_&&(_.textContent=f[c].message);var p=o(i,1)[0].parentElement;p.classList.remove("frm-addon-not-installed","frm-addon-installed","frm-addon-active"),p.classList.add(f[c].class),o(t,1)[0].classList.remove("frm_loading_button"),document.querySelectorAll(".frm-admin-page-import, #frm-admin-smtp, #frm-welcome").length>0?window.location.reload():["settings","form_builder"].includes(a)&&u.forEach(function(e){var t=null!==e.closest("#frm_upgrade_modal");e.append(function(e,t){var n,o=[m(e)];return t&&o.push(((n=document.createElement("a")).setAttribute("href","#"),n.classList.add("button","button-secondary","frm-button-secondary","dismiss"),n.textContent=(0,r.__)("Not Now","formidable"),n)),l({className:"frm-save-and-reload-options",children:o})}(a,t))})}function f(e,t,n){e.form?(jQuery(".frm-inline-error").remove(),n.closest(".frm-card").html(e.form).css({padding:5}).find("#upgrade").attr("rel",n.attr("rel")).on("click",_)):(t.append('<div class="frm-addon-error frm_error_style"><p><strong>'.concat(e.message,"</strong></p></div>")),n.removeClass("frm_loading_button"),jQuery(".frm-addon-error").delay(4e3).fadeOut())}function m(e){var t=document.createElement("button");return t.classList.add("frm-save-and-reload","button","button-primary","frm-button-primary"),t.textContent=(0,r.__)("Save and Reload","formidable"),t.addEventListener("click",function(){var t;"form_builder"===e?((t=document.getElementById("frm_submit_side_top")).classList.contains("frm_submit_ajax")&&t.setAttribute("data-new-addon-installed",!0),t.click()):"settings"===e&&function(){var e=document.getElementById("form_settings_page");if(e){var t=e.querySelector("form.frm_form_settings");null!==t&&(wp.hooks.doAction("frm_reset_fields_updated"),t.submit())}}()}),t}function _(e){e.preventDefault();var t=jQuery(this),n=t.parent().parent(),r=t.attr("rel");t.addClass("frm_loading_button"),jQuery.ajax({url:ajaxurl,type:"POST",async:!0,cache:!1,dataType:"json",data:{action:"frm_install_addon",nonce:frmAdminJs.nonce,plugin:r,hostname:n.find("#hostname").val(),username:n.find("#username").val(),password:n.find("#password").val()},success:function(e){var r,o,i=d(e=null!==(r=null===(o=e)||void 0===o?void 0:o.data)&&void 0!==r?r:e);i?f(i,n,t):u(e,t,message,n)},error:function(){t.removeClass("frm_loading_button")}})}},4365:()=>{!function(){function e(e){var t=e.querySelector(".frm-gc-item-type"),n=t.value,r=t.name.replace(/\[type\]$/,"");e.querySelectorAll(".frm-gc-type-settings").forEach(function(e){var t=e.dataset.type===n;e.toggleAttribute("hidden",!t),e.querySelectorAll("[data-frm-gc-field]").forEach(function(e){var n=e.dataset.frmGcField;t?e.name="".concat(r,"[").concat(n,"]"):e.removeAttribute("name")})})}function t(t){var n,r=t.querySelector(".frm_gc_add_item"),o=null!==(n=null==r?void 0:r.dataset.fieldNameBase)&&void 0!==n?n:"",i=t.querySelectorAll(".frm_gc_item_row");i.forEach(function(n,r){var i=n.querySelector(".frm-gc-item-type");i&&o&&(i.name="".concat(o,"[").concat(r,"][type]")),function(e,t,n){var r=e.querySelector('[data-frm-gc-field="type"]');if(r){r.id="".concat(t,"_type_").concat(n);var o=e.querySelector('[data-frm-gc-for="type"]');o&&(o.htmlFor=r.id)}e.querySelectorAll(".frm-gc-type-settings").forEach(function(e){var r=e.dataset.type;e.querySelectorAll("[data-frm-gc-field]").forEach(function(o){var i=o.dataset.frmGcField;o.id="".concat(t,"_").concat(i,"_").concat(r,"_").concat(n);var a=e.querySelector('[data-frm-gc-for="'.concat(i,'"]'));a&&(a.htmlFor=o.id)})})}(n,t.id,r),e(n)}),t.dataset.itemCount=i.length}function n(e){var t=e.getAttribute("aria-label");e.classList.add("is-copied"),e.setAttribute("aria-label",e.dataset.copiedLabel||"Copied!"),setTimeout(function(){e.classList.remove("is-copied"),e.setAttribute("aria-label",t)},1600)}document.addEventListener("click",function(e){var r=e.target.closest(".frm_gc_add_item");if(r){var o=r.closest(".frm_gated_content_settings"),i=o.querySelector(".frm_gc_items_list"),a=o.querySelector(".frm_gc_item_template");return i.append(a.content.cloneNode(!0)),t(o),void frmDom.autocomplete.initSelectionAutocomplete(i.lastElementChild)}var l=e.target.closest(".frm_gc_remove_item");if(l){var s=l.closest(".frm_gated_content_settings");return l.closest(".frm_gc_item_row").remove(),void t(s)}var c=e.target.closest(".frm_gc_copy_shortcode");if(c){var d,u=c.dataset.frmCopy;if(null!==(d=navigator.clipboard)&&void 0!==d&&d.writeText)navigator.clipboard.writeText(u).then(function(){return n(c)});else{var f=document.createElement("textarea");f.value=u,f.style.cssText="position:fixed;opacity:0;",document.body.append(f),f.select(),document.execCommand("copy"),f.remove(),n(c)}}}),document.addEventListener("change",function(t){var n=t.target.closest(".frm-gc-item-type");if(n)e(n.closest(".frm_gc_item_row"));else{var r=t.target.closest(".frm-gc-file-form-select");r&&function(e){var t=e.closest(".frm-gc-type-settings"),n=null==t?void 0:t.querySelector('[data-frm-gc-field="id"]');if(n){var r=e.value;Array.from(n.options).forEach(function(e){var t=e.dataset.formId;e.style.display=t?r&&t===r?"":"none":""});var o=n.options[n.selectedIndex];"none"===(null==o?void 0:o.style.display)&&(n.value="")}}(r)}}),jQuery(document).on("frm-multiselect-changed",'select[id^="event_"]',function(){var e=document.querySelector('.frm_gc_update_section[data-frm-gc-event-id="'.concat(this.id,'"]'));if(e){var t=Array.from(this.options).some(function(e){return e.selected&&"update"===e.value});e.hidden=!t}})}()},8095:(e,t,n)=>{"use strict";function r(e,t){var n=t();return n?(frmAdminBuild.infoModal(n),e.classList.add("frm_invalid_field"),function(e){var t=document.querySelectorAll("#frm_info_modal .dismiss, #frm_info_modal #frm-info-click, .ui-widget-overlay.ui-front");function n(){setTimeout(function(){return e.focus()},0),t.forEach(function(e){return e.removeEventListener("click",n)})}t.forEach(function(e){return e.addEventListener("click",n)})}(e)):e.classList.remove("frm_invalid_field"),n}n.r(t),n.d(t,{validateField:()=>r})},4746:(e,t,n)=>{"use strict";n.r(t),n.d(t,{getRangeSettingsDefaults:()=>l,validateNumberRangeSetting:()=>s,validateRangeSettings:()=>d,validateStepSetting:()=>c});var r=n(9575),o=n(8095),i=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t?t.dataset.fid:null==n||null===(e=n.closest(".frm-single-settings"))||void 0===e?void 0:e.dataset.fid},a=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return t||(t=null==n?void 0:n.closest(".frm-single-settings")),null===(e=t)||void 0===e||null===(e=e.className.match(/frm-type-(\w+)/))||void 0===e?void 0:e[1]};function l(e){var t=a(e)||"number";return wp.hooks.applyFilters("frm_range_settings_defaults",{maxNum:9999999,minNum:0,step:1},{singleSettings:e,fieldType:t})}function s(e){if(e.closest(".frm-number-range")){var t=e.closest(".frm-single-settings"),n=i(t);if(n){var a=document.querySelector('[name="field_options[minnum_'.concat(n,']"]'));if(a){var s=document.querySelector('[name="field_options[maxnum_'.concat(n,']"]'));if(s)return(0,o.validateField)(e,function(){var e=l(t),n=e.minNum,o=e.maxNum;return parseFloat(a.value||n)>=parseFloat(s.value||o)?(0,r.__)("Minimum value cannot be greater than or equal to maximum value.","formidable"):""})}}}}function c(e){if(e.closest(".frm-step")){var t=e.closest(".frm-single-settings"),n=i(t);if(n){var a=document.querySelector('[name="field_options[step_'.concat(n,']"]'));if(a)return(0,o.validateField)(e,function(){var e=l(t),o=e.step,i=e.minNum,s=e.maxNum,c=parseFloat(a.value||o);if(c<=0)return(0,r.__)("Step value must be greater than 0.","formidable");var d=document.querySelector('[name="field_options[maxnum_'.concat(n,']"]'));if(!d)return"";var u=document.querySelector('[name="field_options[minnum_'.concat(n,']"]')),f=parseFloat((null==u?void 0:u.value)||i);return c>parseFloat(d.value||s)-f?(0,r.__)("Step value cannot be greater than the difference between the minimum and maximum values.","formidable"):""})}}}function d(e){var t=s(e);return t||(t=c(e)),wp.hooks.applyFilters("frm_validate_range_settings",t||"",{field:e})}},4260:(e,t,n)=>{"use strict";n.r(t),n.d(t,{addOneClick:()=>i,initModal:()=>a,initUpgradeModal:()=>l});var r=n(9575),o=frmDom.svg;function i(e,t,n){var i;if("modal"===t)i=document.getElementById("frm_upgrade_modal");else{if("tab"!==t)return;i=document.getElementById(e.getAttribute("href").substr(1))}var a,l=i.querySelector(".frm-oneclick"),s=i.querySelector(".frm-upgrade-message"),c=i.querySelector(".frm-upgrade-link"),d=i.querySelector(".frm-oneclick-button"),u=i.querySelector(".frm-addon-status"),f=e.getAttribute("data-oneclick"),m=e.getAttribute("data-message"),_="block",p="block",g="none",v=i.querySelector(".frm-circled-icon");v&&(v.classList.remove("frm-circled-icon-green"),null===(a=v.querySelector("svg"))||void 0===a||a.replaceWith(o({href:"#frm_filled_lock_icon"})));var y=i.querySelector(".frm-learn-more");if(y&&(e.dataset.learnMore?(y.href=e.dataset.learnMore,y.style.display=""):y.style.display="none"),null!==l&&null!==d&&void 0!==f&&f){null===m&&(p="none"),_="none",g="block",f=JSON.parse(f),d.className=d.className.replace(" frm-install-addon","").replace(" frm-activate-addon",""),d.className="".concat(d.className," ").concat(f.class),d.rel=f.url,l.textContent=(0,r.__)("This plugin is not activated. Would you like to activate it now?","formidable"),d.textContent=(0,r.__)("Activate","formidable");var h=e.querySelector("use");h&&(null==v||v.querySelector("svg").replaceWith(o({href:h.getAttribute("href")||h.getAttribute("xlink:href"),classList:["frm_svg32"]})))}m||(m=s.getAttribute("data-default")),void 0!==n&&(m=m.replace('<span class="frm_feature_label"></span>',n)),s.innerHTML=m,e.dataset.upsellImage&&s.append(frmDom.img({src:e.dataset.upsellImage,alt:e.dataset.upgrade})),c.href=function(e,t){var n=e.getAttribute("data-link");return null!=n&&""!==n||(n=t.getAttribute("data-default")),n}(e,c),u.style.display="none",l&&(l.style.display=g),d&&(d.style.display="block"===g?"inline-block":g),s.style.display=p,c.style.display="block"===_?"inline-block":_;var b=c.closest(".frm-upgrade-modal-actions");b&&(b.style.display="block"===_?"flex":_)}function a(e,t){var n=jQuery(e);if(!n.length)return!1;void 0===t&&(t="552px");var r={dialogClass:"frm-dialog",modal:!0,autoOpen:!1,closeOnEscape:!0,width:t,resizable:!1,draggable:!1,open:function(){var e,t;jQuery(".ui-dialog-titlebar").addClass("frm_hidden").removeClass("ui-helper-clearfix"),jQuery("#wpwrap").addClass("frm_overlay"),jQuery(".frm-dialog").removeClass("ui-widget ui-widget-content ui-corner-all"),n.removeClass("ui-dialog-content ui-widget-content"),e=n,t=function(){e.dialog("close")},jQuery(".ui-widget-overlay").on("click",t),e.on("click","a.dismiss",t)},close:function(){jQuery("#wpwrap").removeClass("frm_overlay"),jQuery(".spinner").css("visibility","hidden"),this.removeAttribute("data-option-type");var e=document.getElementById("bulk-option-type");e&&(e.value="")}};return n.dialog(r),n}function l(){var e=a("#frm_upgrade_modal");function t(t){var n,o,a;if((n=t.target).classList){var l=n.classList.contains("frm_show_expired_modal")||null!==n.querySelector(".frm_show_expired_modal")||n.closest(".frm_show_expired_modal");if("change"===t.type&&n.classList.contains("frm_select_with_upgrade")){var s,c=n.options[n.selectedIndex];null!=c&&null!==(s=c.dataset)&&void 0!==s&&s.upgrade&&(n=c)}if(!n.dataset.upgrade){var d=n.closest("[data-upgrade]");if(!d){if(!(d=n.closest(".frm_field_box")))return;n.dataset.upgrade=""}n=d}if(l)wp.hooks.doAction("frm_show_expired_modal",n);else{var u=n.dataset.upgrade;if(u&&!n.classList.contains("frm_show_upgrade_tab")){t.preventDefault();var f=e.get(0);f.classList.remove("frm-success");var m=f.querySelector(".frm_lock_icon");m&&(m.style.display="block",m.classList.remove("frm_lock_open_icon"),m.querySelector("use").setAttribute("href","#frm_lock_icon"));var _="frm_upgrade_modal_image",p=document.getElementById(_);p&&p.remove(),n.dataset.image&&m&&(m.style.display="none",m.parentNode.insertBefore(frmDom.img({id:_,src:"".concat(frmGlobal.url,"/images/").concat(n.dataset.image)}),m));var g=f.querySelector(".license-level");g&&(g.textContent=function(e){return e.dataset.requires?e.dataset.requires:"Pro"}(n)),i(n,"modal",u);var v=f.querySelector(".frm_are_not_installed");v.style.display=n.dataset.image||n.dataset.oneclick?"none":"inline-block",v.textContent=v.dataset.default,f.querySelector(".frm-upgrade-modal-title-prefix").style.display=n.dataset.oneclick?"inline":"none",f.querySelector(".frm_feature_label").textContent=u,f.querySelector(".frm-upgrade-modal-title-suffix").style.display="none",f.querySelector("h2").style.display="block",e.dialog("open");var y=f.querySelector(".button-primary:not(.frm-oneclick-button)");o=y.getAttribute("href").replace(/(medium=)[a-z_-]+/gi,"$1".concat(n.getAttribute("data-medium"))),null===(a=n.getAttribute("data-content"))&&(a=""),o=o.replace(/(content=)[a-z_-]+/gi,"$1".concat(a)),y.setAttribute("href",o),n.classList.contains("frm_show_update")&&function(e){var t=e.querySelector(".frm-upgrade-modal-title-prefix");t&&(t.style.display="none");var n=e.querySelector(".frm_are_not_installed");n&&(n.textContent=(0,r.__)("require an update","formidable"),n.style.display="");var o=e.querySelector(".frm-oneclick");o&&(o.style.display="none");var i=e.querySelector(".frm-oneclick-button");i&&(i.textContent=(0,r.__)("Update Now","formidable"))}(f)}}}}!1!==e&&(document.addEventListener("click",t),frmDom.util.documentOn("change","select.frm_select_with_upgrade",t))}},8616:e=>{e.exports=function(e,t){var n,r,o=0;function i(){var i,a,l=n,s=arguments.length;e:for(;l;){if(l.args.length===arguments.length){for(a=0;a<s;a++)if(l.args[a]!==arguments[a]){l=l.next;continue e}return l!==n&&(l===r&&(r=l.prev),l.prev.next=l.next,l.next&&(l.next.prev=l.prev),l.next=n,l.prev=null,n.prev=l,n=l),l.val}l=l.next}for(i=new Array(s),a=0;a<s;a++)i[a]=arguments[a];return l={args:i,val:e.apply(null,i)},n?(n.prev=l,l.next=n):r=l,o===t.maxSize?(r=r.prev).next=null:o++,n=l,l.val}return t=t||{},i.clear=function(){n=null,r=null,o=0},i}},7604:(e,t,n)=>{var r;!function(){"use strict";var o={not_string:/[^s]/,not_bool:/[^t]/,not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,not_json:/[^j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function i(e){return function(e,t){var n,r,a,l,s,c,d,u,f,m=1,_=e.length,p="";for(r=0;r<_;r++)if("string"==typeof e[r])p+=e[r];else if("object"==typeof e[r]){if((l=e[r]).keys)for(n=t[m],a=0;a<l.keys.length;a++){if(null==n)throw new Error(i('[sprintf] Cannot access property "%s" of undefined value "%s"',l.keys[a],l.keys[a-1]));n=n[l.keys[a]]}else n=l.param_no?t[l.param_no]:t[m++];if(o.not_type.test(l.type)&&o.not_primitive.test(l.type)&&n instanceof Function&&(n=n()),o.numeric_arg.test(l.type)&&"number"!=typeof n&&isNaN(n))throw new TypeError(i("[sprintf] expecting number but found %T",n));switch(o.number.test(l.type)&&(u=n>=0),l.type){case"b":n=parseInt(n,10).toString(2);break;case"c":n=String.fromCharCode(parseInt(n,10));break;case"d":case"i":n=parseInt(n,10);break;case"j":n=JSON.stringify(n,null,l.width?parseInt(l.width):0);break;case"e":n=l.precision?parseFloat(n).toExponential(l.precision):parseFloat(n).toExponential();break;case"f":n=l.precision?parseFloat(n).toFixed(l.precision):parseFloat(n);break;case"g":n=l.precision?String(Number(n.toPrecision(l.precision))):parseFloat(n);break;case"o":n=(parseInt(n,10)>>>0).toString(8);break;case"s":n=String(n),n=l.precision?n.substring(0,l.precision):n;break;case"t":n=String(!!n),n=l.precision?n.substring(0,l.precision):n;break;case"T":n=Object.prototype.toString.call(n).slice(8,-1).toLowerCase(),n=l.precision?n.substring(0,l.precision):n;break;case"u":n=parseInt(n,10)>>>0;break;case"v":n=n.valueOf(),n=l.precision?n.substring(0,l.precision):n;break;case"x":n=(parseInt(n,10)>>>0).toString(16);break;case"X":n=(parseInt(n,10)>>>0).toString(16).toUpperCase()}o.json.test(l.type)?p+=n:(!o.number.test(l.type)||u&&!l.sign?f="":(f=u?"+":"-",n=n.toString().replace(o.sign,"")),c=l.pad_char?"0"===l.pad_char?"0":l.pad_char.charAt(1):" ",d=l.width-(f+n).length,s=l.width&&d>0?c.repeat(d):"",p+=l.align?f+n+s:"0"===c?f+s+n:s+f+n)}return p}(function(e){if(l[e])return l[e];for(var t,n=e,r=[],i=0;n;){if(null!==(t=o.text.exec(n)))r.push(t[0]);else if(null!==(t=o.modulo.exec(n)))r.push("%");else{if(null===(t=o.placeholder.exec(n)))throw new SyntaxError("[sprintf] unexpected placeholder");if(t[2]){i|=1;var a=[],s=t[2],c=[];if(null===(c=o.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(a.push(c[1]);""!==(s=s.substring(c[0].length));)if(null!==(c=o.key_access.exec(s)))a.push(c[1]);else{if(null===(c=o.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");a.push(c[1])}t[2]=a}else i|=2;if(3===i)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");r.push({placeholder:t[0],param_no:t[1],keys:t[2],sign:t[3],pad_char:t[4],align:t[5],width:t[6],precision:t[7],type:t[8]})}n=n.substring(t[0].length)}return l[e]=r}(e),arguments)}function a(e,t){return i.apply(null,[e].concat(t||[]))}var l=Object.create(null);"undefined"!=typeof window&&(window.sprintf=i,window.vsprintf=a,void 0===(r=function(){return{sprintf:i,vsprintf:a}}.call(t,n,t,e))||(e.exports=r))}()},5397:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(1364),o={contextDelimiter:"",onMissingKey:null};function i(e,t){var n;for(n in this.data=e,this.pluralForms={},this.options={},o)this.options[n]=void 0!==t&&n in t?t[n]:o[n]}i.prototype.getPluralForm=function(e,t){var n,o,i,a=this.pluralForms[e];return a||("function"!=typeof(i=(n=this.data[e][""])["Plural-Forms"]||n["plural-forms"]||n.plural_forms)&&(o=function(e){var t,n,r;for(t=e.split(";"),n=0;n<t.length;n++)if(0===(r=t[n].trim()).indexOf("plural="))return r.substr(7)}(n["Plural-Forms"]||n["plural-forms"]||n.plural_forms),i=(0,r.A)(o)),a=this.pluralForms[e]=i),a(t)},i.prototype.dcnpgettext=function(e,t,n,r,o){var i,a,l;return i=void 0===o?0:this.getPluralForm(e,o),a=n,t&&(a=t+this.options.contextDelimiter+n),(l=this.data[e][a])&&l[i]?l[i]:(this.options.onMissingKey&&this.options.onMissingKey(n,e),0===i?n:r)}},3029:(e,t,n)=>{"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}n.d(t,{A:()=>r})},4467:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(9922);function o(e,t,n){return(t=(0,r.A)(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},2327:(e,t,n)=>{"use strict";n.d(t,{A:()=>o});var r=n(2284);function o(e,t){if("object"!=(0,r.A)(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t||"default");if("object"!=(0,r.A)(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}},9922:(e,t,n)=>{"use strict";n.d(t,{A:()=>i});var r=n(2284),o=n(2327);function i(e){var t=(0,o.A)(e,"string");return"symbol"==(0,r.A)(t)?t:t+""}},2284:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}n.d(t,{A:()=>r})}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={exports:{}};return e[r](i,i.exports,n),i.exports}function r(e){return function(e){if(Array.isArray(e))return l(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||a(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function i(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=a(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,l=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return l=e.done,e},e:function(e){s=!0,i=e},f:function(){try{l||null==n.return||n.return()}finally{if(s)throw i}}}}function a(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var s=n(8095).validateField,c=n(4746),d=c.getRangeSettingsDefaults,u=c.validateNumberRangeSetting,f=c.validateStepSetting,m=c.validateRangeSettings;window.FrmFormsConnect=window.FrmFormsConnect||function(e,t,n){var r={messageBox:null,reset:null,setElements:function(){r.messageBox=e.querySelector(".frm_pro_license_msg"),r.reset=e.getElementById("frm_reconnect_link")}},o={init:function(){r.setElements(),n(e.getElementById("frm_deauthorize_link")).on("click",o.deauthorize),n(".frm_authorize_link").on("click",o.authorize),n(".frm-dashboard-license-options").on("click","#frm_deauthorize_link",o.deauthorize),n(".frm-dashboard-license-options").on("click","#frm_reconnect_link",o.reauthorize),null!==r.reset&&n(r.reset).on("click",o.reauthorize)},authorize:function(){var t=this,r=this.getAttribute("data-plugin"),i=e.getElementById("edd_".concat(r,"_license_key")),a=i.value,l=e.getElementById("proplug-wpmu");this.classList.add("frm_loading_button"),l=l&&l.checked?1:0,n.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"frm_addon_activate",license:a,plugin:r,wpmu:l,nonce:frmGlobal.nonce},success:function(e){o.afterAuthorize(e,i),t.classList.remove("frm_loading_button")}})},afterAuthorize:function(e,t){!0===e.success&&(t.value="•••••••••••••••••••"),wp.hooks.doAction("frm_after_authorize",e),o.showMessage(e)},showProgress:function(e){null===r.messageBox&&r.setElements();var t=r.messageBox;null!==t&&(!0===e.success?(t.classList.remove("frm_error_style"),t.classList.add("frm_message","frm_updated_message")):(t.classList.add("frm_error_style"),t.classList.remove("frm_message","frm_updated_message")),t.classList.remove("frm_hidden"),t.innerHTML=e.message)},showMessage:function(n){null===r.messageBox&&r.setElements();var i=r.messageBox;!0===n.success&&(o.showAuthorized(!0),o.showInlineSuccess(),wp.hooks.doAction("frmAdmin.afterLicenseAuthorizeSuccess",{msg:n})),o.showProgress(n),""!==n.message&&(setTimeout(function(){i.innerHTML="",i.classList.add("frm_hidden"),i.classList.remove("frm_error_style","frm_message","frm_updated_message")},1e4),e.querySelector(".frm-admin-page-dashboard")&&setTimeout(function(){t.location.reload()},1e3))},showAuthorized:function(t){var n=t?"unauthorized":"authorized",r=t?"authorized":"unauthorized",o=e.querySelectorAll(".frm_".concat(n,"_box"));o.length&&o.forEach(function(e){e.className=e.className.replace("frm_".concat(n,"_box"),"frm_".concat(r,"_box"))})},showInlineSuccess:function(){var t=e.querySelectorAll(".frm-confirm-msg [data-success]");t.length&&t.forEach(function(e){e.innerHTML=frmAdminBuild.purifyHtml(e.getAttribute("data-success"))})},reauthorize:function(){return this.innerHTML='<span class="frm-wait frm_spinner" style="visibility:visible;float:none"></span>',n.ajax({type:"POST",url:ajaxurl,dataType:"json",data:{action:"frm_reset_cache",plugin:"formidable_pro",nonce:frmGlobal.nonce},success:function(e){r.reset.textContent=e.message,"1"===r.reset.getAttribute("data-refresh")&&t.location.reload()}}),!1},deauthorize:function(){if(!confirm(frmGlobal.deauthorize))return!1;var t=this.getAttribute("data-plugin"),r=e.getElementById("edd_".concat(t,"_license_key")),i=r.value,a=this;return this.innerHTML='<span class="frm-wait frm_spinner" style="visibility:visible;"></span>',n.ajax({type:"POST",url:ajaxurl,data:{action:"frm_addon_deactivate",license:i,plugin:t,nonce:frmGlobal.nonce},success:function(){o.showAuthorized(!1),r.value="",a.replaceWith("Disconnected"),wp.hooks.doAction("frmAdmin.afterLicenseDeauthorizeSuccess",{})}}),!1}};return o}(document,window,jQuery),window.frmAdminBuildJS=function(){var e,t,a=frm_admin_js,l=frmDom,c=l.tag,_=l.div,p=l.span,g=l.a,v=l.svg,y=l.img,h=frmDom.util.onClickPreventDefault,b=frmDom.ajax.doJsonPost;a.contextualShortcodes=(t=null===(e=document.getElementById("frm_adv_info"))||void 0===e?void 0:e.dataset.contextualShortcodes)?((t=JSON.parse(t)).addressSelector="[id^=email_to], [id^=from_], [id^=cc], [id^=bcc]",t.bodySelector="[id^=email_message_]",t):[];var w,j,x,E={save:v({href:"#frm_save_icon"}),drag:v({href:"#frm_drag_icon",classList:["frm_drag_icon","frm-drag"]})},k=jQuery(document.getElementById("frm-show-fields")),Q=document.getElementById("new_fields"),S=document.getElementById("form_id"),A=!1,L=0,I=0,q=0,B={},C=0,N=wp.i18n,T=N.__,O=N.sprintf,F={dragging:!1};S&&(I=S.value);var D,M=new URL(window.location.href),P=M.searchParams,H=document.getElementById("frm_builder_page");function z(e){e.stopPropagation(),e.preventDefault(),R(this)}function R(e){var t=e.getAttribute("data-frmverify"),n=e.getAttribute("data-loaded-from");return null===t||"frm-confirmed-click"===e.id||("entries-list"===n?wp.hooks.applyFilters("frm_on_multiple_entries_delete",{link:e,initModal:Mi}):function(e){var t=Mi("#frm_confirm_modal","400px"),n=document.getElementById("frm-confirmed-click");if(!1===t)return!1;n&&(n.style.display="block");var r=e.getAttribute("data-frmverify"),o=r?e.getAttribute("data-frmverify-btn"):"",i=jQuery(".frm-confirm-msg");i.empty(),r&&(i.append(document.createTextNode(r)),o&&(null==n||n.classList.add(o)));var a=e.dataset;if(n){for(var l in n.dataset)n.removeAttribute("data-".concat(l));for(var s in a)"frmverify"!==s&&n.setAttribute("data-".concat(s),a[s])}return wp.hooks.doAction("frmAdmin.beforeOpenConfirmModal",{$info:t,link:e}),t.dialog("open"),null==n||n.setAttribute("href",e.getAttribute("href")||e.getAttribute("data-href")),!1}(e))}function G(e,t){var n=Mi("#frm_info_modal",t||"400px");if(!1===n)return!1;"string"==typeof e&&(e={msg:e}),e=Object.assign({title:"",msg:T("Are you sure?","formidable"),img:"",closeText:T("Got it!","formidable"),actionUrl:"",actionText:"",noCenter:!1},e);var r=n[0].querySelector(".info-modal-title");r.textContent=e.title||"",r.classList.toggle("frm_hidden",!e.title),e.msg&&(n[0].querySelector(".frm-info-msg").innerHTML=br(e.msg)),n[0].querySelector(".info-modal-img").src=e.img,n[0].querySelector(".info-modal-img-wrapper").classList.toggle("frm_hidden",!e.img);var o=document.getElementById("frm-info-click");e.closeText&&(o.textContent=e.closeText),o.classList.toggle("button-primary",!e.actionUrl),o.classList.toggle("frm-button-primary",!e.actionUrl),o.classList.toggle("button-secondary",Boolean(e.actionUrl)),o.classList.toggle("frm-button-secondary",Boolean(e.actionUrl));var i=n[0].querySelector(".info-modal-action-link");return e.actionUrl&&(i.href=e.actionUrl,e.actionText&&(i.textContent=e.actionText)),i.classList.toggle("frm_hidden",!e.actionUrl),n[0].querySelector(".info-modal-inside").classList.toggle("frmcenter",!e.noCenter),n[0].querySelector(".info-modal-buttons").classList.toggle("frmright",e.noCenter),n.dialog("open"),!1}function U(e){var t=this.getAttribute("data-frmtoggle"),n=this.getAttribute("data-toggletext"),r=jQuery(t);return e.preventDefault(),r.toggle(),null!==n&&""!==n&&(this.setAttribute("data-toggletext",this.innerHTML),this.textContent=n),!1}function W(e){var t=this.getAttribute("data-frmhide"),n=this.getAttribute("data-frmshow"),r=this.getAttribute("data-frmuncheck"),o=r?r.split(","):[];"INPUT"!==this.nodeName||"checkbox"!==this.type||this.checked||(null!==t?(n=t,t=null):null!==n&&(t=n,n=null)),e.preventDefault();var i=this.getAttribute("data-toggleclass")||"frm_hidden";null!==t&&jQuery(t).addClass(i),null!==n&&jQuery(n).removeClass(i);var a=this.parentNode.querySelectorAll("a.current");if(null!==a){for(var l=0;l<a.length;l++)a[l].classList.remove("current");this.classList.add("current")}return o.length&&o.forEach(function(e){var t=document.querySelector(e);t&&(t.checked=!1)}),!1}function $(){document.querySelectorAll(".tooltip").forEach(function(e){e.remove()})}function V(){var e,t,n;if(!parseInt(this.getAttribute("data-skip-frm-js"))&&!1!==R(this)){var r=jQuery(this),o=r.attr("data-removeid");void 0===(e=r.attr("data-showlast"))&&(e=""),void 0===(t=r.attr("data-hidelast"))&&(t=""),n=r.attr("data-removemore"),""!==e?r.closest(".frm_add_remove").find(".frm_remove_tag:visible").length>1&&(e="",t=""):0===o.indexOf("frm_postmeta_")&&(jQuery("#frm_postmeta_rows .frm_postmeta_row").length<2&&(e=".frm_add_postmeta_row.button"),jQuery(".frm_toggle_cf_opts").length&&jQuery("#frm_postmeta_rows .frm_postmeta_row:not(#".concat(o,")")).last().length&&(""!==e&&(e+=","),e+="#".concat(jQuery("#frm_postmeta_rows .frm_postmeta_row:not(#".concat(o,")")).last().attr("id")," .frm_toggle_cf_opts")));var a=document.getElementById(o),l=jQuery(a);return l.fadeOut(300,function(){var n;l.remove(),Vo(),""!==t&&(jQuery(t).hide(),function(e){var t=document.querySelector(e);if(t){var n,r=i(t.classList);try{for(r.s();!(n=r.n()).done;){var o=n.value,a=document.querySelector('input[data-toggleclass="'.concat(o,'"]'));if(null!=a&&a.checked)return void(a.checked=!1)}}catch(e){r.e(e)}finally{r.f()}}}(t)),""!==e&&jQuery("".concat(e," a,").concat(e)).removeClass("frm_hidden").fadeIn("slow"),this.closest(".frm_form_action_settings")&&function(e){var t;po(e),"payment"===e&&["stripe","square","paypal"].forEach(function(e){return po(e)}),document.querySelector(".frm_form_action_settings")||null===(t=document.querySelector(".frm-no-actions-message"))||void 0===t||t.classList.remove("frm_hidden");var n={type:e};wp.hooks.doAction("frm_after_action_removed",n)}(this.closest(".frm_form_action_settings").querySelector(".frm_action_name").value),null===(n=document.querySelector(".tooltip"))||void 0===n||n.remove()}),void 0!==n&&(n=jQuery(n)).fadeOut(400,function(){n.remove()}),""!==e&&jQuery(this).closest(".frm_logic_rows").fadeOut("slow"),wp.hooks.doAction("frm_admin_tag_removed",o,a),!1}}function K(){var e,t=document.querySelector("#frm-actions-filter-content .frm-action:not(.frm_hidden)");null===(e=document.getElementById("frm-actions-no-results"))||void 0===e||e.classList.toggle("frm_hidden",t)}function J(e,t){void 0===t&&(t=this),it(t,!1);var n=jQuery(t).closest(".frm_form_action_settings"),r=e.target;if(n.length&&void 0!==r){var o=r.parentElement.className;if("string"==typeof o&&(o.includes("frm_email_icons")||o.includes("frm_toggle")))return void e.stopPropagation()}var i=n.children(".widget-inside");if(n.length&&i.find("p, div, table").length<1){var a=n.find('input[name$="[ID]"]').val(),l=n.find('input[name$="[post_excerpt]"]').val();l&&(i.html('<span class="frm-wait frm_spinner"></span>'),n.find(".spinner").fadeIn("slow"),jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"frm_form_action_fill",action_id:a,action_type:l,nonce:frmGlobal.nonce},success:function(e){i.html(e),vi(),ro("#".concat(n.attr("id"))),ki(i),jQuery(t).trigger("frm-action-loaded"),wp.hooks.doAction("frm_filled_form_action",i)}}))}jQuery(t).closest(".frm_field_box").siblings().find(".widget-inside").slideUp("fast"),void 0!==t.className&&t.className.includes("widget-action")||jQuery(t).closest(".start_divider").length<1||((i=jQuery(t).closest("div.widget").children(".widget-inside")).is(":hidden")?i.slideDown("fast"):i.slideUp("fast"))}function X(){var e=this.getAttribute("href");if(null===e)return!1;var t=e.replace("#","."),n=jQuery(this);n.closest("li").addClass("frm-tabs active").siblings("li").removeClass("frm-tabs active starttab"),n.closest("div").children(".tabs-panel").not(e).not(t).hide();var r=document.getElementById(e.replace("#",""));return r&&(r.style.display="block"),"frm_insert_fields_tab"!==this.id||this.closest("#frm_adv_info")||et(),!1}function Y(e,t){var n=(e=jQuery(e)).attr("href");if(void 0!==n){var r,o,i=n.replace("#",".");if(e.closest("li").addClass("frm-tabs active").siblings("li").removeClass("frm-tabs active starttab"),e.closest("div").find(".tabs-panel").length)e.closest("div").children(".tabs-panel").not(n).not(i).hide();else if(null!==document.getElementById("form_global_settings")){var a=e.data("frmajax");e.closest(".frm_wrap").find(".tabs-panel, .hide_with_tabs").hide(),void 0!==a&&"1"==a&&(r=n.replace("#",""),(o=jQuery(".frm_".concat(r,"_ajax"))).length&&jQuery.ajax({type:"POST",url:ajaxurl,data:{action:"frm_settings_tab",tab:r.replace("_settings",""),nonce:frmGlobal.nonce},success:function(e){o.replaceWith(e)}}))}else jQuery("#frm-categorydiv .tabs-panel, .hide_with_tabs").hide();jQuery(n).show(),jQuery(i).show(),ni(),"auto"!==t&&(jQuery(".frm_updated_message").hide(),jQuery(".frm_warning_style:not(.frm_force_visible_warning)").hide()),jQuery(e).closest("#frm_adv_info").length||(jQuery(".frm_form_settings").length?jQuery(".frm_form_settings").attr("action","?page=formidable&frm_action=settings&id=".concat(jQuery('.frm_form_settings input[name="id"]').val(),"&t=").concat(n.replace("#",""))):jQuery(".frm_settings_form").attr("action","?page=formidable-settings&t=".concat(n.replace("#",""))))}}function Z(e){var t,n;document.querySelectorAll(e).forEach(function(e){ee(e),Array.from(e.children).forEach(function(e){return re(e,".frm-move")});var t=jQuery(e).children('[data-type="divider"]').children(".divider_section_only");t.length&&ee(t)}),t=jQuery("#frm_builder_page"),n={items:".frm_sortable_field_opts li",axis:"y",opacity:.65,forcePlaceholderSize:!1,handle:".frm-drag",helper:function(e,t){return A=t.clone().insertAfter(t),t.clone()},stop:function(e,t){A&&A.remove(),ur(t.item.attr("id").replace("frm_delete_field_","").replace("-".concat(t.item.data("optkey"),"_container"),"")),Vo()}},jQuery(t).sortable(n)}function ee(e){jQuery(e).droppable({accept:".frmbutton, li.frm_field_box",deactivate:se,over:te,out:ne,tolerance:"pointer"})}function te(e,t){var n=function(e){return e.classList.contains("divider_section_only")&&(e=jQuery(e).nextAll(".start_divider.frm_sorting").get(0)),e}(e.target);if(!Se(t.draggable[0],n,e))return n.classList.remove("frm-over-droppable"),void jQuery(n).parents("ul.frm_sorting").addClass("frm-over-droppable");document.querySelectorAll(".frm-over-droppable").forEach(function(e){return e.classList.remove("frm-over-droppable")}),n.classList.add("frm-over-droppable"),jQuery(n).parents("ul.frm_sorting").addClass("frm-over-droppable")}function ne(e){e.target.classList.remove("frm-over-droppable")}function re(e,t){var n={helper:oe,revert:"invalid",delay:10,start:ie,stop:ae,drag:le,cursor:"grabbing",refreshPositions:!0,cursorAt:{top:0,left:90}};"string"==typeof t&&(n.handle=t),jQuery(e).draggable(n)}function oe(e){var t,n=e.delegateTarget;if(Le(n)){var r=document.getElementById("frm-insert-fields").querySelector(".frm_ttext").cloneNode(!0);return r.querySelector("use").setAttributeNS("http://www.w3.org/1999/xlink","href","#frm_field_group_layout_icon"),r.querySelector("span").textContent=T("Field Group","formidable"),r.classList.add("frm_field_box"),r.classList.add("ui-sortable-helper"),r}if(n.classList.contains("frmbutton"))return(t=n.cloneNode(!0)).classList.add("ui-sortable-helper"),n.classList.add("frm-new-field"),t;if(n.hasAttribute("data-ftype")){var o=n.getAttribute("data-ftype");if(t=document.getElementById("frm-insert-fields").querySelector(".frm_t".concat(o)))return(t=t.cloneNode(!0)).classList.add("form-field"),t.classList.add("ui-sortable-helper"),t.cloneNode(!0)}return _({className:"frmbutton"})}function ie(e,t){if(e.target.classList.contains("frm_at_limit"))return Ne(),!1;F.dragging=!0;var n,r=j;r.classList.add("frm-dragging-field"),document.body.classList.add("frm-dragging"),t.helper.addClass("frm-sortable-helper"),t.helper.initialOffset=r.scrollTop,e.target.classList.add("frm-drag-fade"),En(),(n=document.querySelectorAll("ul.start_divider")).length&&n.forEach(function(e){[].slice.call(e.children).forEach(function(e){(0===e.children.length||1===e.children.length&&"ul"===e.firstElementChild.nodeName.toLowerCase()&&0===e.firstElementChild.children.length)&&e.remove()})}),Re(),Pe(),$()}function ae(){j.classList.remove("frm-dragging-field"),document.body.classList.remove("frm-dragging");var e=document.querySelector(".frm-drag-fade");e&&e.classList.remove("frm-drag-fade")}function le(e,t){!function(e){x.scrollTop(function(t,n){var r=e.clientY,o=j.offsetHeight,i=e.clientY-j.offsetTop,a=i-o/2;return i>o-50&&r>5?n+.1*a:i<70&&r<130?n-Math.abs(.1*a):n})}(e);var n=e.target,r=function(){for(var e=document.getElementById("frm-show-fields");e.querySelector(".frm-over-droppable");)e=e.querySelector(".frm-over-droppable");return"frm-show-fields"!==e.id||e.classList.contains("frm-over-droppable")||(e=!1),e}(),o=document.getElementById("frm_drag_placeholder");if(Se(n,r,e)){o||(o=c("li",{id:"frm_drag_placeholder",className:"sortable-placeholder"}));var i,a=t.helper.get(0);if((a.classList.contains("form-field")||a.classList.contains("frm_field_box"))&&(a.style.transform="translateY(".concat((i=t.helper,j.scrollTop-i.initialOffset),"px)")),"frm-show-fields"===r.id||r.classList.contains("start_divider"))return o.style.left=0,void function(e){var t,n=e.y,r=e.placeholder,o=jQuery(e.droppable),i=o.children().not(".edit_field_type_end_divider");if(0===i.length)o.prepend(r),t=0;else{var a=ce(o,n);if(a===i.length){var l=jQuery(i.get(a-1));t=l.offset().top+l.outerHeight(),o.append(r);var s=o.children(".edit_field_type_end_divider");s.length&&o.append(s)}else t=jQuery(i.get(a)).offset().top,jQuery(i.get(a)).before(r)}t-=o.offset().top,r.style.top="".concat(t,"px")}({droppable:r,y:e.clientY,placeholder:o});o.style.top="",function(e){var t,n=e.x,r=e.placeholder,o=jQuery(e.droppable),i=ue(o);if(i.length){var a=function(e,t){var n,r,o,i,a=ue(e);for(i=0,n=a.length-1;n>=0;--n)if(r=a.get(n),t>(o=jQuery(r).offset().left)){i=n,t>o+jQuery(r).outerWidth()/2&&(i=n+1);break}return i}(o,n);if(a===i.length){var l=jQuery(i.get(a-1));t=l.offset().left+l.outerWidth(),o.append(r)}else t=jQuery(i.get(a)).offset().left,jQuery(i.get(a)).before(r),t-=0===a?4:8;t-=o.offset().left,r.style.left="".concat(t,"px")}}({droppable:r,x:e.clientX,placeholder:o})}else o&&o.remove()}function se(e,t){if(F.dragging){F.dragging=!1;var n=t.draggable[0],r=document.getElementById("frm_drag_placeholder");if(!r)return t.helper

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Fix the undefined message argument in the add-on install success path.

In module 1105, the inline installer calls u(e,t,message,n), but message is not declared in that scope. A successful add-on installation therefore throws ReferenceError: message is not defined before updating the UI. Pass the intended status-label element/value from the source module, then regenerate the bundle and cover this success path with a test.

🧰 Tools
🪛 ast-grep (0.44.1)

[warning] Do not use variable for regular expressions
Context: new RegExp(r)
Note: [CWE-1333] Inefficient Regular Expression Complexity. Security best practice.

(regexp-non-literal)


[warning] Detects non-literal values in regular expressions
Context: new RegExp('optkey="'.concat(l,'"'),"g")
Note: [CWE-1333] Inefficient Regular Expression Complexity (ReDoS via non-literal RegExp).

(detect-non-literal-regexp)


[warning] Detects non-literal values in regular expressions
Context: new RegExp("-".concat(l,"_"),"g")
Note: [CWE-1333] Inefficient Regular Expression Complexity (ReDoS via non-literal RegExp).

(detect-non-literal-regexp)


[warning] Detects non-literal values in regular expressions
Context: new RegExp("-".concat(l,'"'),"g")
Note: [CWE-1333] Inefficient Regular Expression Complexity (ReDoS via non-literal RegExp).

(detect-non-literal-regexp)


[warning] Detects non-literal values in regular expressions
Context: new RegExp("\[".concat(l,"\]"),"g")
Note: [CWE-1333] Inefficient Regular Expression Complexity (ReDoS via non-literal RegExp).

(detect-non-literal-regexp)


[warning] Detects non-literal values in regular expressions
Context: new RegExp("\[".concat(l,"\]"),"g")
Note: [CWE-1333] Inefficient Regular Expression Complexity (ReDoS via non-literal RegExp).

(detect-non-literal-regexp)


[warning] Detects non-literal values in regular expressions
Context: new RegExp("_".concat(l,'"'),"g")
Note: [CWE-1333] Inefficient Regular Expression Complexity (ReDoS via non-literal RegExp).

(detect-non-literal-regexp)


[warning] Detects non-literal values in regular expressions
Context: new RegExp("_".concat(l," "),"g")
Note: [CWE-1333] Inefficient Regular Expression Complexity (ReDoS via non-literal RegExp).

(detect-non-literal-regexp)


[warning] Detects non-literal values in regular expressions
Context: new RegExp("-".concat(l,'"'),"g")
Note: [CWE-1333] Inefficient Regular Expression Complexity (ReDoS via non-literal RegExp).

(detect-non-literal-regexp)


[warning] Detects non-literal values in regular expressions
Context: new RegExp('"'.concat(l,'"'),"g")
Note: [CWE-1333] Inefficient Regular Expression Complexity (ReDoS via non-literal RegExp).

(detect-non-literal-regexp)


[warning] Detects non-literal values in regular expressions
Context: new RegExp("".concat(o,"\s*$"))
Note: [CWE-1333] Inefficient Regular Expression Complexity (ReDoS via non-literal RegExp).

(detect-non-literal-regexp)


[warning] Detects non-literal values in regular expressions
Context: new RegExp("^\s*".concat(o))
Note: [CWE-1333] Inefficient Regular Expression Complexity (ReDoS via non-literal RegExp).

(detect-non-literal-regexp)


[warning] Detects non-literal values in regular expressions
Context: new RegExp(r)
Note: [CWE-1333] Inefficient Regular Expression Complexity (ReDoS via non-literal RegExp).

(detect-non-literal-regexp)


[warning] Avoid SQL injections
Context: "SELECT"===e.tagName
Note: [CWE-89] Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). Security best practice.

(variable-sql-statement-injection)


[warning] Avoid SQL injections
Context: r&&(null!==o?"SELECT"===r.tagName&&"placeholder"===o?""===(e=r.options[0]).value?e.innerHTML=n:vr(r,n):"class"===o?function(e,t){var n,r,o,i=" ".concat(t.value),a=e.getAttribute("data-fid");if(""===i.trim()){var l=t.querySelector("option[data-align]");i=l?" ".concat(l.getAttribute("data-align")):""}void 0!==a&&(t.classList.contains("field_options_align")?i+=" ".concat(document.getElementById("frm_classes_".concat(a)).value):t.classList.contains("frm_classes")&&(o=document.getElementById("field_options_align_".concat(a)))&&(i+=" ".concat(o.value))),i=(i+=" ").replace(" block "," vertical_radio ").replace(" inline "," horizontal_radio "),""===(n=0===(n=e.className.split(" frmstart ")[1]).indexOf("frmend ")?"":n.split(" frmend ")[0]).trim()?(r=" frmstart frmend ",e.className.includes(r)||(r=" frmstart frmend "),i=" frmstart ".concat(i.trim()," frmend ")):(r=n.trim(),i=i.trim()),e.className=e.className.replace(r,i)}(r,this):"range"===(t=r).type&&t.parentNode.classList.contains("frm_range_container")?function(e,t,n){if(frmGlobal.proIncludesSliderJs){var r={field:e,att:t,newValue:n};wp.hooks.doAction("frm_update_slider_field_preview",r)}else{var o;if("value"===t?(""===n&&(n=ft(e)),e.value=n):e.setAttribute(t,n),["value","min","max"].includes(t))"max"!==t&&"min"!==t||""!==(o=e.id,document.querySelector('input[data-changeme="'.concat(o,'"][data-changeatt="value"]')).value)||(e.value=ft(e)),e.parentNode.querySelector(".frm_range_value").textContent=e.value}}(r,o,n):r.setAttribute(o,n):0===r.id.indexOf("setup-message")?""!==n&&(r.innerHTML=''):(r.innerHTML=br(n),"TEXTAREA"===r.nodeName&&r.classList.contains("wp-editor-area")&&jQuery(r).trigger("change"),r.classList.contains("frm_primary_label")&&"break"===r.nextElementSibling.getAttribute("data-ftype")&&(r.nextElementSibling.querySelector(".frm_button_submit").textContent=n)))
Note: [CWE-89] Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). Security best practice.

(variable-sql-statement-injection)


[warning] Avoid SQL injections
Context: "SELECT"===r.tagName&&"placeholder"===o
Note: [CWE-89] Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). Security best practice.

(variable-sql-statement-injection)


[warning] Avoid SQL injections
Context: "SELECT"===r.tagName
Note: [CWE-89] Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). Security best practice.

(variable-sql-statement-injection)


[warning] Avoid SQL injections
Context: void 0!==e&&(r=function(e){return"divider"===e?e="section":"range"===e?e="slider":"data"===e?e="dynamic":"form"===e&&(e="embed form"),e}(r="SELECT"===n.tagName?n.options[n.selectedIndex].text.toLowerCase():r.replace("_"," ")),setTimeout(function(){e.value.toLowerCase()===r?e.select():e.focus()},50))
Note: [CWE-89] Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). Security best practice.

(variable-sql-statement-injection)


[warning] Avoid SQL injections
Context: "SELECT"===n.tagName
Note: [CWE-89] Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). Security best practice.

(variable-sql-statement-injection)


[warning] Avoid SQL injections
Context: "SELECT"===this.tagName&&(r=function(e){for(var t,n=[],r=null==e?void 0:e.options,o=0,i=null==r?void 0:r.length;o<i;o++)(t=r[o]).selected&&n.push(t.value);return n}(this),r=r.join("|").toLowerCase(),n=!0)
Note: [CWE-89] Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). Security best practice.

(variable-sql-statement-injection)


[warning] Avoid SQL injections
Context: n&&n.addEventListener("change",function(e){var t=e.target;"SELECT"===t.nodeName&&t.dataset.name&&!t.getAttribute("name")&&t.setAttribute("name",t.dataset.name)})
Note: [CWE-89] Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). Security best practice.

(variable-sql-statement-injection)


[warning] Avoid SQL injections
Context: "SELECT"===t.nodeName&&t.dataset.name&&!t.getAttribute("name")&&t.setAttribute("name",t.dataset.name)
Note: [CWE-89] Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). Security best practice.

(variable-sql-statement-injection)


[warning] Avoid SQL injections
Context: "SELECT"===t.nodeName&&t.dataset.name&&!t.getAttribute("name")
Note: [CWE-89] Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). Security best practice.

(variable-sql-statement-injection)


[warning] Avoid SQL injections
Context: "SELECT"===t.nodeName&&t.dataset.name
Note: [CWE-89] Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). Security best practice.

(variable-sql-statement-injection)


[warning] Avoid SQL injections
Context: "SELECT"===t.nodeName
Note: [CWE-89] Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'). Security best practice.

(variable-sql-statement-injection)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: s.innerHTML=m
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: t.innerHTML=e.message
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: e.innerHTML=frmAdminBuild.purifyHtml(e.getAttribute("data-success"))
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: n[0].querySelector(".frm-info-msg").innerHTML=br(e.msg)
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: t.innerHTML=e
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: o.innerHTML='')
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: t.innerHTML=e
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: (r=_()).innerHTML=n
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: e.innerHTML=o.join("")
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: e.innerHTML=n
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: r.innerHTML=br(n)
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: e.innerHTML=n
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: t.innerHTML=O(frm_admin_js.holdShiftMsg,'',"")
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: t.innerHTML=e
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: u.innerHTML=br(c)
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: n.innerHTML=t
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: (r=_({className:"frm_empty_url"})).innerHTML=a.image_placeholder_icon
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: s.innerHTML=o
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: i.innerHTML=t
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: y.innerHTML=v
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: o.innerHTML=e
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: (t=document.createElement("select")).innerHTML=r
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: r.querySelector(".frm_post_parent_opt_wrapper").innerHTML=e.replaceAll("REPLACETHISNAME",t)
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: r.innerHTML="[".concat(i,"[/if ").concat(o,"]")
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: e.innerHTML=n
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: document.getElementById("frm_field_".concat(e,"_opts")).innerHTML=t
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: t.outerHTML=n
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid assigning untrusted data to innerHTML/outerHTML or document.write
Context: document.getElementById("frm_show_selected_values_".concat(t,"_").concat(n)).innerHTML=e
Note: [CWE-79] Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').

(inner-outer-html)


[warning] Avoid using the initial state variable in setState
Context: setTimeout(t,1e3)
Note: [CWE-710] Improper Adherence to Coding Standards. Security best practice.

(setstate-same-var)

🪛 Biome (2.5.3)

[error] 1-1: Unsafe usage of 'return'.

(lint/correctness/noUnsafeFinally)


[error] 1-1: Unsafe usage of 'throw'.

(lint/correctness/noUnsafeFinally)


[error] 1-1: Unsafe usage of 'throw'.

(lint/correctness/noUnsafeFinally)

🪛 OpenGrep (1.25.0)

[ERROR] 1-1: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)


[ERROR] 1-1: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)


[ERROR] 1-1: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)


[ERROR] 1-1: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)


[ERROR] 1-1: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)


[ERROR] 1-1: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)


[ERROR] 1-1: Dynamic command passed to child_process.exec/execSync. Use child_process.execFile or spawn with an argument array instead.

(coderabbit.command-injection.exec-js)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@js/formidable_admin.js` at line 1, The add-on installer success callback in
module 1105 invokes u with the undefined message identifier. Replace that
argument with the intended status-label value already available from the source
module, regenerate the bundled output, and add coverage for the successful
install path to ensure the UI update completes without a ReferenceError.

@garretlaxton garretlaxton left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants