function _inheritsLoose(t,e){t.prototype=Object.create(e.prototype),_setPrototypeOf(t.prototype.constructor=t,e)}function _setPrototypeOf(t,e){return(_setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t})(t,e)}var CF_File_Upload_Class=function(o){function t(t){var e=o.call(this,t)||this;return e.formSubmitButton=null==(t=t.closest("form"))?void 0:t.querySelector("button.cf-btn"),e}_inheritsLoose(t,o);var e=t.prototype;return e.onSending=function(t,e,o){o.append("action","upload"),o.append("form_id",this.element.closest("form").querySelector("input[name='cf[form_id]']").value),o.append("field_key",this.element.closest(".cf-control-group").getAttribute("data-key")),this.toggleFormSubmitButton(!1)},e.onAfterFileDelete=function(t,e){0===this.getUploadingFilesCount()&&this.toggleFormSubmitButton(!0)},e.onQueueComplete=function(){o.prototype.onQueueComplete.call(this),this.toggleFormSubmitButton(!0)},e.toggleFormSubmitButton=function(t){this.formSubmitButton&&(t?this.formSubmitButton.classList.remove("cf-disabled"):this.formSubmitButton.classList.add("cf-disabled"))},t}(window.TF_Abstract_File_Upload);window.TF_File_Upload_Class=CF_File_Upload_Class,document.addEventListener("DOMContentLoaded",function(){"undefined"!=typeof ConvertForms&&ConvertForms.Helper&&ConvertForms.Helper.onReady(function(){var t=document.querySelectorAll(".convertforms");t.length&&(t.forEach(function(t){var e=t.querySelectorAll(".tf-file-upload-editor");t.addEventListener("beforeSubmit",function(t){t.defaultPrevented||Array.from(e).some(function(t){return t.dropzone&&(0<t.dropzone.getQueuedFiles().length||0<t.dropzone.getUploadingFiles().length)})&&(t.preventDefault(),t.detail.error=t.detail.instance.text("ERROR_WAIT_FILE_UPLOADS"))}),t.addEventListener("success",function(){e.forEach(function(t){t.dropzone&&t.dropzone.removeAllFiles()})})}),(t=document.querySelectorAll(".dz-hidden-input")).length)&&t.forEach(function(t){t.setAttribute("aria-hidden","true"),t.setAttribute("aria-label","Hidden upload")})})});

