(()=>{"use strict";var t={22201:(t,e,r)=>{t.exports=r.p+"img/wpforms-automator-icon.png"},98490:t=>{t.exports=window.wp.domReady}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n](o,o.exports,r),o.exports}r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),(()=>{var t;r.g.importScripts&&(t=r.g.location+"");var e=r.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var n=e.getElementsByTagName("script");if(n.length)for(var i=n.length-1;i>-1&&(!t||!/^http(s?):/.test(t));)t=n[i--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),r.p=t})(),r(22201);var n=r(98490),i={init:function(){this.showCorrectButton(),this.listenTriggerChanges()},showCorrectButton:function(){var t=this.getCurrentTriggerID();this.hideSubmitButtons(),this.showSubmitButton(t)},listenTriggerChanges:function(){for(var t=this,e=this.$getTriggers(),r=0;r<e.length;r++)e[r].addEventListener("change",function(e){var r=e.currentTarget.value;t.deselectAllTriggers({except:r}),t.showCorrectButton()})},getCurrentTriggerID:function(){for(var t=this.$getTriggers(),e=null,r=0,n=t.length;r<n;++r)t[r].checked&&(e=t[r].value);return e},deselectAllTriggers:function(t){for(var e=this.$getTriggers(),r=void 0!==t&&void 0!==t.except,n=0,i=e.length;n<i;++n)e[n].checked=!1,r&&t.except==e[n].value&&(e[n].checked=!0)},hideSubmitButtons:function(){for(var t=this.$getSubmitButtons(),e=0;e<t.length;e++)t[e].style.display="none"},showSubmitButton:function(t){var e=this.$getSubmitButton(t);null!=e&&(e.style.display="block")},$getSubmitButtons:function(){return document.querySelectorAll(".uap-wpf-integration-create-recipe-btn")},$getTriggers:function(){return document.querySelectorAll(".uap-wpf-integration-recipe-trigger-radio")},$getSubmitButton:function(t){return document.querySelector('.uap-wpf-integration-create-recipe-btn[data-id="'+t+'"]')}};r.n(n)()(function(){i.init()})})();
//# sourceMappingURL=wpforms.js.map