(()=>{var e;const{addAction:t}=JetPlugins.hooks,{isEmpty:i}=JetFormBuilderFunctions;function o({pointerId:e,target:t}){-1!==e&&(t.classList.contains("jet-form-builder__field-template")||(t=t.closest(".jet-form-builder__field-template")),t.nextElementSibling.click())}function l(e){e.watch((()=>{const[t]=e.nodes,i=t.closest(".jet-form-builder-row");for(const e of i.querySelectorAll("input.checkradio-field"))e.closest(".jet-form-builder__field-wrap").querySelector(".jet-form-builder__field-template").classList.toggle("jet-form-builder__field-template--checked",e.checked)}))}t("jet.fb.input.makeReactive","jet-form-builder/listing-options",(function(e){if(!function(e){for(const t of e.nodes)if(["radio","checkbox"].includes(t?.type)&&t.classList.contains("checkradio-field"))return!0;return!1}(e))return;let t=null;for(const i of e.nodes)t=i.closest(".jet-form-builder__field-wrap").querySelector(".jet-form-builder__field-template"),t&&t.addEventListener("click",o);t&&(l(e),i(e.getValue())||e.value.notify())})),window.JetFormBuilderFunctions={...null!==(e=window.JetFormBuilderFunctions)&&void 0!==e?e:{},ListingAddTemplateWatcher:l,ListingTemplateClick:o}})();