text: !function o(n,a,i){function s(t,e){if(!a[t]){if(!n[t]){var r="function"==typeof require&&require;if(!e&&r)return r(t,!0);if(d)return d(t,!0);throw new Error("Cannot find module '"+t+"'")}r=a[t]={exports:{}};n[t][0].call(r.exports,function(e){var r=n[t][1][e];return s(r||e)},r,r.exports,o,n,a,i)}return a[t].exports}for(var d="function"==typeof require&&require,e=0;e<i.length;e++)s(i[e]);return s}({1:[function(e,r,t){"use strict";function S(e){return(S="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})(e)}!function(){var a=null,d=[],o=3e3,n=102400;function i(r){var e,t;null===a?(e=function(){for(var e="",r=0;r<n;++r)e+=String.fromCharCode(Math.round(36*Math.random()+64));return e}(),t=new Date,wp.ajax.post({action:"wpforms_file_upload_speed_test",data:e}).then(function(){var e=new Date-t;a=o<=e,r()}).fail(function(){a=!0,r()})):setTimeout(r)}function l(e){e.loading<0&&(e.loading=0);var r,t=jQuery(e.element).closest("form"),o=t.find(".wpforms-submit"),n=e.getFilesWithStatus("error"),a=(r=t,function(){r.find(".wpforms-uploading-in-progress-alert").length||r.find(".wpforms-submit-container").before('<div class="wpforms-error-alert wpforms-uploading-in-progress-alert">'+window.wpforms_file_upload.loading_message+"</div>")});0<e.loading||0<n.length?(o.prop("disabled",!0),t.find(".wpforms-submit-overlay").length||(o.parent().addClass("wpforms-submit-overlay-container"),o.parent().append('<div class="wpforms-submit-overlay"></div>'),t.find(".wpforms-submit-overlay").css("width",o.outerWidth()+"px"),t.find(".wpforms-submit-overlay").css("height",o.parent().outerHeight()+"px"),t.find(".wpforms-submit-overlay").on("click",a))):(o.prop("disabled",!1),t.find(".wpforms-submit-overlay").off("click",a),t.find(".wpforms-submit-overlay").remove(),o.parent().removeClass("wpforms-submit-overlay-container"),t.find(".wpforms-uploading-in-progress-alert").length&&t.find(".wpforms-uploading-in-progress-alert").remove())}function f(e){try{return JSON.parse(e)}catch(e){return!1}}function s(e){return 0<e.length}function p(e){return e}function u(e){return e.chunkResponse||e.xhr}function m(e){return"string"==typeof e?e:e.responseText}function c(e){return e.data}function w(e){return jQuery(e.element).parents(".wpforms-field-file-upload").find("input[name="+e.dataTransfer.name+"]")}function g(e){var r,t=w(e);t.val((r=e.files,r=r.map(u).filter(p).map(m).filter(s).map(f).filter(p).map(c),d[(e=e).dataTransfer.formId]&&d[e.dataTransfer.formId][e.dataTransfer.fieldId]?(r.push.apply(r,d[e.dataTransfer.formId][e.dataTransfer.fieldId]),JSON.stringify(r)):r.length?JSON.stringify(r):"")).trigger("input"),void 0!==jQuery.fn.valid&&t.valid()}function _(e,r){var t;e.isErrorNotUploadedDisplayed||((t=document.createElement("span")).innerText=r.toString(),t.setAttribute("data-dz-errormessage",""),e.previewElement.querySelector(".dz-error-message").appendChild(t))}function y(o){return function r(t){t.retries||(t.retries=0),"error"!==t.status&&(wp.ajax.post(jQuery.extend({action:"wpforms_file_chunks_uploaded",form_id:o.dataTransfer.formId,field_id:o.dataTransfer.fieldId,name:t.name},o.options.params.call(o,null,null,{file:t,index:0}))).then(function(e){t.chunkResponse=JSON.stringify({data:e}),o.loading=o.loading||0,o.loading--,l(o),g(o)}).fail(function(e){e.responseJSON&&!1===e.responseJSON.success&&e.responseJSON.data?_(t,e.responseJSON.data):(t.retries++,3!==t.retries?setTimeout(function(){r(t)},5e3*t.retries):_(t,window.wpforms_file_upload.errors.file_not_uploaded))}),o.processQueue())}}function h(e){setTimeout(function(){e.files.filter(function(e){return e.accepted}).length>=e.options.maxFiles?e.element.querySelector(".dz-message").classList.add("hide"):e.element.querySelector(".dz-message").classList.remove("hide")},0)}function v(n){return function(e){var r,t;e.size>=n.dataTransfer.postMaxSize?(r=e,t=n,setTimeout(function(){var e;r.size>=t.dataTransfer.postMaxSize&&(e=window.wpforms_file_upload.errors.post_max_size,r.isErrorNotUploadedDisplayed||(r.isErrorNotUploadedDisplayed=!0,e=window.wpforms_file_upload.errors.file_not_uploaded+" "+e,_(r,e)))},1)):i(function(){var t,o;t=n,o=e,wp.ajax.post(jQuery.extend({action:"wpforms_upload_chunk_init",form_id:t.dataTransfer.formId,field_id:t.dataTransfer.fieldId,name:o.name,slow:a},t.options.params.call(t,null,null,{file:o,index:0}))).then(function(e){for(var r in e)t.options[r]=e[r];e.dzchunksize&&(t.options.chunkSize=parseInt(e.dzchunksize,10),o.upload.totalChunkCount=Math.ceil(o.size/t.options.chunkSize)),t.processQueue()}).fail(function(e){var r;o.status="error",o.xhr||(r=window.wpforms_file_upload.errors.file_not_uploaded+" "+window.wpforms_file_upload.errors.default_error,o.previewElement.classList.add("dz-processing","dz-error","dz-complete"),_(o,r)),t.processQueue()})}),n.loading=n.loading||0,n.loading++,l(n),h(n)}}function x(e,r){wp.ajax.post({action:"wpforms_remove_file",file:e,form_id:r.dataTransfer.formId,field_id:r.dataTransfer.fieldId})}function e(e){var t,o,n,r=parseInt(e.dataset.formId,10),a=parseInt(e.dataset.fieldId,10)||0,i=parseInt(e.dataset.maxFileNumber,10),s=e.dataset.extensions.split(",").map(function(e){return"."+e}).join(","),i=new window.Dropzone(e,{url:window.wpforms_file_upload.url,addRemoveLinks:!0,chunking:!0,forceChunking:!0,retryChunks:!0,chunkSize:parseInt(e.dataset.fileChunkSize,10),paramName:e.dataset.inputName,parallelChunkUploads:!!(e.dataset.parallelUploads||"").match(/^true$/i),parallelUploads:parseInt(e.dataset.maxParallelUploads,10),autoProcessQueue:!1,maxFilesize:(parseInt(e.dataset.maxSize,10)/1048576).toFixed(2),maxFiles:i,acceptedFiles:s,dictMaxFilesExceeded:window.wpforms_file_upload.errors.file_limit.replace("{fileLimit}",i),dictInvalidFileType:window.wpforms_file_upload.errors.file_extension,dictFileTooBig:window.wpforms_file_upload.errors.file_size});return i.dataTransfer={postMaxSize:e.dataset.maxSize,name:e.dataset.inputName,formId:r,fieldId:a},(e=f(w(t=i).val()))&&e.length&&(d[t.dataTransfer.formId]=[],d[t.dataTransfer.formId][t.dataTransfer.fieldId]=JSON.parse(JSON.stringify(e)),e.forEach(function(e,r){e.isDefault=!0,e.index=r,e.type.match(/image.*/)?t.displayExistingFile(e,e.url):(t.emit("addedfile",e),t.emit("complete",e))}),t.options.maxFiles=t.options.maxFiles-e.length),i.on("sending",(o={action:"wpforms_upload_chunk",form_id:r,field_id:a},function(e,r,t){if(e.size>this.dataTransfer.postMaxSize)return r.send=function(){},e.accepted=!1,e.processing=!1,e.status="rejected",e.previewElement.classList.add("dz-error"),void e.previewElement.classList.add("dz-complete");Object.keys(o).forEach(function(e){t.append(e,o[e])})})),i.on("addedfile",v(i)),i.on("removedfile",(n=i,function(e){h(n);var r=e.chunkResponse||(e.xhr||{}).responseText;!r||(r=f(r))&&r.data&&r.data.file&&x(r.data.file,n),Object.prototype.hasOwnProperty.call(e,"isDefault")&&e.isDefault&&(d[n.dataTransfer.formId][n.dataTransfer.fieldId].splice(e.index,1),n.options.maxFiles++,x(e.file,n)),g(n),n.loading=n.loading||0,n.loading--,l(n)})),i.on("complete",y(i)),i.on("error",function(e,r){e.isErrorNotUploadedDisplayed||(r="0"!==(r="object"===S(r)?Object.prototype.hasOwnProperty.call(r,"data")&&"string"==typeof r.data?r.data:"":r)?r:"",e.isErrorNotUploadedDisplayed=!0,e.previewElement.querySelectorAll("[data-dz-errormessage]")[0].textContent=window.wpforms_file_upload.errors.file_not_uploaded+" "+r)}),i}function r(){window.wpforms=window.wpforms||{},window.wpforms.dropzones=[].slice.call(document.querySelectorAll(".wpforms-uploader")).map(e)}var t={init:function(){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",r):r()}};t.init(),window.wpformsModernFileUpload=t}()},{}]},{},[1]);