text: !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).vue2Dropzone=t()}(this,function(){"use strict";var e,t=(function(e){class t{on(e,t){return this._callbacks=this._callbacks||{},this._callbacks[e]||(this._callbacks[e]=[]),this._callbacks[e].push(t),this}emit(e,...t){this._callbacks=this._callbacks||{};let i=this._callbacks[e];if(i)for(let e of i)e.apply(this,t);return this}off(e,t){if(!this._callbacks||0===arguments.length)return this._callbacks={},this;let i=this._callbacks[e];if(!i)return this;if(1===arguments.length)return delete this._callbacks[e],this;for(let e=0;e<i.length;e++){if(i[e]===t){i.splice(e,1);break}}return this}}class i extends t{static initClass(){this.prototype.Emitter=t,this.prototype.events=["drop","dragstart","dragend","dragenter","dragover","dragleave","addedfile","addedfiles","removedfile","thumbnail","error","errormultiple","processing","processingmultiple","uploadprogress","totaluploadprogress","sending","sendingmultiple","success","successmultiple","canceled","canceledmultiple","complete","completemultiple","reset","maxfilesexceeded","maxfilesreached","queuecomplete"],this.prototype.defaultOptions={url:null,method:"post",withCredentials:!1,timeout:3e4,parallelUploads:2,uploadMultiple:!1,chunking:!1,forceChunking:!1,chunkSize:2e6,parallelChunkUploads:!1,retryChunks:!1,retryChunksLimit:3,maxFilesize:256,paramName:"file",createImageThumbnails:!0,maxThumbnailFilesize:10,thumbnailWidth:120,thumbnailHeight:120,thumbnailMethod:"crop",resizeWidth:null,resizeHeight:null,resizeMimeType:null,resizeQuality:.8,resizeMethod:"contain",filesizeBase:1e3,maxFiles:null,headers:null,clickable:!0,ignoreHiddenFiles:!0,acceptedFiles:null,acceptedMimeTypes:null,autoProcessQueue:!0,autoQueue:!0,addRemoveLinks:!1,previewsContainer:null,hiddenInputContainer:"body",capture:null,renameFilename:null,renameFile:null,forceFallback:!1,dictDefaultMessage:"Drop files here to upload",dictFallbackMessage:"Your browser does not support drag'n'drop file uploads.",dictFallbackText:"Please use the fallback form below to upload your files like in the olden days.",dictFileTooBig:"File is too big ({{filesize}}MiB). Max filesize: {{maxFilesize}}MiB.",dictInvalidFileType:"You can't upload files of this type.",dictResponseError:"Server responded with {{statusCode}} code.",dictCancelUpload:"Cancel upload",dictUploadCanceled:"Upload canceled.",dictCancelUploadConfirmation:"Are you sure you want to cancel this upload?",dictRemoveFile:"Remove file",dictRemoveFileConfirmation:null,dictMaxFilesExceeded:"You can not upload any more files.",dictFileSizeUnits:{tb:"TB",gb:"GB",mb:"MB",kb:"KB",b:"b"},init(){},params(e,t,i){if(i)return{dzuuid:i.file.upload.uuid,dzchunkindex:i.index,dztotalfilesize:i.file.size,dzchunksize:this.options.chunkSize,dztotalchunkcount:i.file.upload.totalChunkCount,dzchunkbyteoffset:i.index*this.options.chunkSize}},accept:(e,t)=>t(),chunksUploaded:function(e,t){t()},fallback(){let e;this.element.className=`${this.element.className} dz-browser-not-supported`;for(let t of this.element.getElementsByTagName("div"))if(/(^| )dz-message($| )/.test(t.className)){e=t,t.className="dz-message";break}e||(e=i.createElement('<div class="dz-message"><span></span></div>'),this.element.appendChild(e));let t=e.getElementsByTagName("span")[0];return t&&(null!=t.textContent?t.textContent=this.options.dictFallbackMessage:null!=t.innerText&&(t.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize(e,t,i,s){let n={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},o=e.width/e.height;null==t&&null==i?(t=n.srcWidth,i=n.srcHeight):null==t?t=i*o:null==i&&(i=t/o);let r=(t=Math.min(t,n.srcWidth))/(i=Math.min(i,n.srcHeight));if(n.srcWidth>t||n.srcHeight>i)if("crop"===s)o>r?(n.srcHeight=e.height,n.srcWidth=n.srcHeight*r):(n.srcWidth=e.width,n.srcHeight=n.srcWidth/r);else{if("contain"!==s)throw new Error(`Unknown resizeMethod '${s}'`);o>r?i=t/o:t=i*o}return n.srcX=(e.width-n.srcWidth)/2,n.srcY=(e.height-n.srcHeight)/2,n.trgWidth=t,n.trgHeight=i,n},transformFile(e,t){return(this.options.resizeWidth||this.options.resizeHeight)&&e.type.match(/image.*/)?this.resizeImage(e,this.options.resizeWidth,this.options.resizeHeight,this.options.resizeMethod,t):t(e)},previewTemplate:'<div class="dz-preview dz-file-preview">\n  <div class="dz-image"><img data-dz-thumbnail /></div>\n  <div class="dz-details">\n    <div class="dz-size"><span data-dz-size></span></div>\n    <div class="dz-filename"><span data-dz-name></span></div>\n  </div>\n  <div class="dz-progress"><span class="dz-upload" data-dz-uploadprogress></span></div>\n  <div class="dz-error-message"><span data-dz-errormessage></span></div>\n  <div class="dz-success-mark">\n    <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n      <title>Check</title>\n      <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n        <path d="M23.5,31.8431458 L17.5852419,25.9283877 C16.0248253,24.3679711 13.4910294,24.366835 11.9289322,25.9289322 C10.3700136,27.4878508 10.3665912,30.0234455 11.9283877,31.5852419 L20.4147581,40.0716123 C20.5133999,40.1702541 20.6159315,40.2626649 20.7218615,40.3488435 C22.2835669,41.8725651 24.794234,41.8626202 26.3461564,40.3106978 L43.3106978,23.3461564 C44.8771021,21.7797521 44.8758057,19.2483887 43.3137085,17.6862915 C41.7547899,16.1273729 39.2176035,16.1255422 37.6538436,17.6893022 L23.5,31.8431458 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z" stroke-opacity="0.198794158" stroke="#747474" fill-opacity="0.816519475" fill="#FFFFFF"></path>\n      </g>\n    </svg>\n  </div>\n  <div class="dz-error-mark">\n    <svg width="54px" height="54px" viewBox="0 0 54 54" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n      <title>Error</title>\n      <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n        <g stroke="#747474" stroke-opacity="0.198794158" fill="#FFFFFF" fill-opacity="0.816519475">\n          <path d="M32.6568542,29 L38.3106978,23.3461564 C39.8771021,21.7797521 39.8758057,19.2483887 38.3137085,17.6862915 C36.7547899,16.1273729 34.2176035,16.1255422 32.6538436,17.6893022 L27,23.3431458 L21.3461564,17.6893022 C19.7823965,16.1255422 17.2452101,16.1273729 15.6862915,17.6862915 C14.1241943,19.2483887 14.1228979,21.7797521 15.6893022,23.3461564 L21.3431458,29 L15.6893022,34.6538436 C14.1228979,36.2202479 14.1241943,38.7516113 15.6862915,40.3137085 C17.2452101,41.8726271 19.7823965,41.8744578 21.3461564,40.3106978 L27,34.6568542 L32.6538436,40.3106978 C34.2176035,41.8744578 36.7547899,41.8726271 38.3137085,40.3137085 C39.8758057,38.7516113 39.8771021,36.2202479 38.3106978,34.6538436 L32.6568542,29 Z M27,53 C41.3594035,53 53,41.3594035 53,27 C53,12.6405965 41.3594035,1 27,1 C12.6405965,1 1,12.6405965 1,27 C1,41.3594035 12.6405965,53 27,53 Z"></path>\n        </g>\n      </g>\n    </svg>\n  </div>\n</div>',drop(e){return this.element.classList.remove("dz-drag-hover")},dragstart(e){},dragend(e){return this.element.classList.remove("dz-drag-hover")},dragenter(e){return this.element.classList.add("dz-drag-hover")},dragover(e){return this.element.classList.add("dz-drag-hover")},dragleave(e){return this.element.classList.remove("dz-drag-hover")},paste(e){},reset(){return this.element.classList.remove("dz-started")},addedfile(e){if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){for(var t of(e.previewElement=i.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement),e.previewElement.querySelectorAll("[data-dz-name]")))t.textContent=e.name;for(t of e.previewElement.querySelectorAll("[data-dz-size]"))t.innerHTML=this.filesize(e.size);this.options.addRemoveLinks&&(e._removeLink=i.createElement(`<a class="dz-remove" href="javascript:undefined;" data-dz-remove>${this.options.dictRemoveFile}</a>`),e.previewElement.appendChild(e._removeLink));let s=t=>(t.preventDefault(),t.stopPropagation(),e.status===i.UPLOADING?i.confirm(this.options.dictCancelUploadConfirmation,()=>this.removeFile(e)):this.options.dictRemoveFileConfirmation?i.confirm(this.options.dictRemoveFileConfirmation,()=>this.removeFile(e)):this.removeFile(e));for(let t of e.previewElement.querySelectorAll("[data-dz-remove]"))t.addEventListener("click",s)}},removedfile(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");for(let i of e.previewElement.querySelectorAll("[data-dz-thumbnail]"))i.alt=e.name,i.src=t;return setTimeout(()=>e.previewElement.classList.add("dz-image-preview"),1)}},error(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"String"!=typeof t&&t.error&&(t=t.error);for(let i of e.previewElement.querySelectorAll("[data-dz-errormessage]"))i.textContent=t}},errormultiple(){},processing(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.innerHTML=this.options.dictCancelUpload},processingmultiple(){},uploadprogress(e,t,i){if(e.previewElement)for(let i of e.previewElement.querySelectorAll("[data-dz-uploadprogress]"))"PROGRESS"===i.nodeName?i.value=t:i.style.width=`${t}%`},totaluploadprogress(){},sending(){},sendingmultiple(){},success(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple(){},canceled(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple(){},complete(e){if(e._removeLink&&(e._removeLink.innerHTML=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple(){},maxfilesexceeded(){},maxfilesreached(){},queuecomplete(){},addedfiles(){}},this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}static extend(e,...t){for(let i of t)for(let t in i){let s=i[t];e[t]=s}return e}constructor(e,t){let s,n;if(super(),this.element=e,this.version=i.version,this.defaultOptions.previewTemplate=this.defaultOptions.previewTemplate.replace(/\n*/g,""),this.clickableElements=[],this.listeners=[],this.files=[],"string"==typeof this.element&&(this.element=document.querySelector(this.element)),!this.element||null==this.element.nodeType)throw new Error("Invalid dropzone element.");if(this.element.dropzone)throw new Error("Dropzone already attached.");i.instances.push(this),this.element.dropzone=this;let o=null!=(n=i.optionsForElement(this.element))?n:{};if(this.options=i.extend({},this.defaultOptions,o,null!=t?t:{}),this.options.forceFallback||!i.isBrowserSupported())return this.options.fallback.call(this);if(null==this.options.url&&(this.options.url=this.element.getAttribute("action")),!this.options.url)throw new Error("No URL provided.");if(this.options.acceptedFiles&&this.options.acceptedMimeTypes)throw new Error("You can't provide both 'acceptedFiles' and 'acceptedMimeTypes'. 'acceptedMimeTypes' is deprecated.");if(this.options.uploadMultiple&&this.options.chunking)throw new Error("You cannot set both: uploadMultiple and chunking.");this.options.acceptedMimeTypes&&(this.options.acceptedFiles=this.options.acceptedMimeTypes,delete this.options.acceptedMimeTypes),null!=this.options.renameFilename&&(this.options.renameFile=(e=>this.options.renameFilename.call(this,e.name,e))),this.options.method=this.options.method.toUpperCase(),(s=this.getExistingFallback())&&s.parentNode&&s.parentNode.removeChild(s),!1!==this.options.previewsContainer&&(this.options.previewsContainer?this.previewsContainer=i.getElement(this.options.previewsContainer,"previewsContainer"):this.previewsContainer=this.element),this.options.clickable&&(!0===this.options.clickable?this.clickableElements=[this.element]:this.clickableElements=i.getElements(this.options.clickable,"clickable")),this.init()}getAcceptedFiles(){return this.files.filter(e=>e.accepted).map(e=>e)}getRejectedFiles(){return this.files.filter(e=>!e.accepted).map(e=>e)}getFilesWithStatus(e){return this.files.filter(t=>t.status===e).map(e=>e)}getQueuedFiles(){return this.getFilesWithStatus(i.QUEUED)}getUploadingFiles(){return this.getFilesWithStatus(i.UPLOADING)}getAddedFiles(){return this.getFilesWithStatus(i.ADDED)}getActiveFiles(){return this.files.filter(e=>e.status===i.UPLOADING||e.status===i.QUEUED).map(e=>e)}init(){if("form"===this.element.tagName&&this.element.setAttribute("enctype","multipart/form-data"),this.element.classList.contains("dropzone")&&!this.element.querySelector(".dz-message")&&this.element.appendChild(i.createElement(`<div class="dz-default dz-message"><button class="dz-button" type="button">${this.options.dictDefaultMessage}</button></div>`)),this.clickableElements.length){let e=()=>(this.hiddenFileInput&&this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=document.createElement("input"),this.hiddenFileInput.setAttribute("type","file"),(null===this.options.maxFiles||this.options.maxFiles>1)&&this.hiddenFileInput.setAttribute("multiple","multiple"),this.hiddenFileInput.className="dz-hidden-input",null!==this.options.acceptedFiles&&this.hiddenFileInput.setAttribute("accept",this.options.acceptedFiles),null!==this.options.capture&&this.hiddenFileInput.setAttribute("capture",this.options.capture),this.hiddenFileInput.style.visibility="hidden",this.hiddenFileInput.style.position="absolute",this.hiddenFileInput.style.top="0",this.hiddenFileInput.style.left="0",this.hiddenFileInput.style.height="0",this.hiddenFileInput.style.width="0",i.getElement(this.options.hiddenInputContainer,"hiddenInputContainer").appendChild(this.hiddenFileInput),this.hiddenFileInput.addEventListener("change",()=>{let{files:t}=this.hiddenFileInput;if(t.length)for(let e of t)this.addFile(e);return this.emit("addedfiles",t),e()}));e()}this.URL=null!==window.URL?window.URL:window.webkitURL;for(let e of this.events)this.on(e,this.options[e]);this.on("uploadprogress",()=>this.updateTotalUploadProgress()),this.on("removedfile",()=>this.updateTotalUploadProgress()),this.on("canceled",e=>this.emit("complete",e)),this.on("complete",e=>{if(0===this.getAddedFiles().length&&0===this.getUploadingFiles().length&&0===this.getQueuedFiles().length)return setTimeout(()=>this.emit("queuecomplete"),0)});let e=function(e){if(function(e){if(e.dataTransfer.types)for(var t=0;t<e.dataTransfer.types.length;t++)if("Files"===e.dataTransfer.types[t])return!0;return!1}(e))return e.stopPropagation(),e.preventDefault?e.preventDefault():e.returnValue=!1};return this.listeners=[{element:this.element,events:{dragstart:e=>this.emit("dragstart",e),dragenter:t=>(e(t),this.emit("dragenter",t)),dragover:t=>{let i;try{i=t.dataTransfer.effectAllowed}catch(e){}return t.dataTransfer.dropEffect="move"===i||"linkMove"===i?"move":"copy",e(t),this.emit("dragover",t)},dragleave:e=>this.emit("dragleave",e),drop:t=>(e(t),this.drop(t)),dragend:e=>this.emit("dragend",e)}}],this.clickableElements.forEach(e=>this.listeners.push({element:e,events:{click:t=>((e!==this.element||t.target===this.element||i.elementInside(t.target,this.element.querySelector(".dz-message")))&&this.hiddenFileInput.click(),!0)}})),this.enable(),this.options.init.call(this)}destroy(){return this.disable(),this.removeAllFiles(!0),(null!=this.hiddenFileInput?this.hiddenFileInput.parentNode:void 0)&&(this.hiddenFileInput.parentNode.removeChild(this.hiddenFileInput),this.hiddenFileInput=null),delete this.element.dropzone,i.instances.splice(i.instances.indexOf(this),1)}updateTotalUploadProgress(){let e,t=0,i=0;if(this.getActiveFiles().length){for(let e of this.getActiveFiles())t+=e.upload.bytesSent,i+=e.upload.total;e=100*t/i}else e=100;return this.emit("totaluploadprogress",e,i,t)}_getParamName(e){return"function"==typeof this.options.paramName?this.options.paramName(e):`${this.options.paramName}${this.options.uploadMultiple?`[${e}]`:""}`}_renameFile(e){return"function"!=typeof this.options.renameFile?e.name:this.options.renameFile(e)}getFallbackForm(){let e,t;if(e=this.getExistingFallback())return e;let s='<div class="dz-fallback">';this.options.dictFallbackText&&(s+=`<p>${this.options.dictFallbackText}</p>`),s+=`<input type="file" name="${this._getParamName(0)}" ${this.options.uploadMultiple?'multiple="multiple"':void 0} /><input type="submit" value="Upload!"></div>`;let n=i.createElement(s);return"FORM"!==this.element.tagName?(t=i.createElement(`<form action="${this.options.url}" enctype="multipart/form-data" method="${this.options.method}"></form>`)).appendChild(n):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=t?t:n}getExistingFallback(){let e=function(e){for(let t of e)if(/(^| )fallback($| )/.test(t.className))return t};for(let i of["div","form"]){var t;if(t=e(this.element.getElementsByTagName(i)))return t}}setupEventListeners(){return this.listeners.map(e=>(()=>{let t=[];for(let i in e.events){let s=e.events[i];t.push(e.element.addEventListener(i,s,!1))}return t})())}removeEventListeners(){return this.listeners.map(e=>(()=>{let t=[];for(let i in e.events){let s=e.events[i];t.push(e.element.removeEventListener(i,s,!1))}return t})())}disable(){return this.clickableElements.forEach(e=>e.classList.remove("dz-clickable")),this.removeEventListeners(),this.disabled=!0,this.files.map(e=>this.cancelUpload(e))}enable(){return delete this.disabled,this.clickableElements.forEach(e=>e.classList.add("dz-clickable")),this.setupEventListeners()}filesize(e){let t=0,i="b";if(e>0){let s=["tb","gb","mb","kb","b"];for(let n=0;n<s.length;n++){let o=s[n];if(e>=Math.pow(this.options.filesizeBase,4-n)/10){t=e/Math.pow(this.options.filesizeBase,4-n),i=o;break}}t=Math.round(10*t)/10}return`<strong>${t}</strong> ${this.options.dictFileSizeUnits[i]}`}_updateMaxFilesReachedClass(){return null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(this.getAcceptedFiles().length===this.options.maxFiles&&this.emit("maxfilesreached",this.files),this.element.classList.add("dz-max-files-reached")):this.element.classList.remove("dz-max-files-reached")}drop(e){if(!e.dataTransfer)return;this.emit("drop",e);let t=[];for(let i=0;i<e.dataTransfer.files.length;i++)t[i]=e.dataTransfer.files[i];if(t.length){let{items:i}=e.dataTransfer;i&&i.length&&null!=i[0].webkitGetAsEntry?this._addFilesFromItems(i):this.handleFiles(t)}this.emit("addedfiles",t)}paste(e){if(null==(t=null!=e?e.clipboardData:void 0,i=(e=>e.items),null!=t?i(t):void 0))return;var t,i;this.emit("paste",e);let{items:s}=e.clipboardData;return s.length?this._addFilesFromItems(s):void 0}handleFiles(e){for(let t of e)this.addFile(t)}_addFilesFromItems(e){return(()=>{let t=[];for(let s of e){var i;null!=s.webkitGetAsEntry&&(i=s.webkitGetAsEntry())?i.isFile?t.push(this.addFile(s.getAsFile())):i.isDirectory?t.push(this._addFilesFromDirectory(i,i.name)):t.push(void 0):null!=s.getAsFile&&(null==s.kind||"file"===s.kind)?t.push(this.addFile(s.getAsFile())):t.push(void 0)}return t})()}_addFilesFromDirectory(e,t){let i=e.createReader(),s=e=>(function(e,t,i){return null!=e&&"function"==typeof e[t]?i(e,t):void 0})(console,"log",t=>t.log(e));var n=()=>i.readEntries(e=>{if(e.length>0){for(let i of e)i.isFile?i.file(e=>{if(!this.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath=`${t}/${e.name}`,this.addFile(e)}):i.isDirectory&&this._addFilesFromDirectory(i,`${t}/${i.name}`);n()}return null},s);return n()}accept(e,t){this.options.maxFilesize&&e.size>1024*this.options.maxFilesize*1024?t(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):i.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(t(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,t):t(this.options.dictInvalidFileType)}addFile(e){e.upload={uuid:i.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e)},this.files.push(e),e.status=i.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,t=>{t?(e.accepted=!1,this._errorProcessing([e],t)):(e.accepted=!0,this.options.autoQueue&&this.enqueueFile(e)),this._updateMaxFilesReachedClass()})}enqueueFiles(e){for(let t of e)this.enqueueFile(t);return null}enqueueFile(e){if(e.status!==i.ADDED||!0!==e.accepted)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=i.QUEUED,this.options.autoProcessQueue)return setTimeout(()=>this.processQueue(),0)}_enqueueThumbnail(e){if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(e),setTimeout(()=>this._processThumbnailQueue(),0)}_processThumbnailQueue(){if(this._processingThumbnail||0===this._thumbnailQueue.length)return;this._processingThumbnail=!0;let e=this._thumbnailQueue.shift();return this.createThumbnail(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,t=>(this.emit("thumbnail",e,t),this._processingThumbnail=!1,this._processThumbnailQueue()))}removeFile(e){if(e.status===i.UPLOADING&&this.cancelUpload(e),this.files=s(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")}removeAllFiles(e){null==e&&(e=!1);for(let t of this.files.slice())(t.status!==i.UPLOADING||e)&&this.removeFile(t);return null}resizeImage(e,t,s,n,o){return this.createThumbnail(e,t,s,n,!0,(t,s)=>{if(null==s)return o(e);{let{resizeMimeType:t}=this.options;null==t&&(t=e.type);let n=s.toDataURL(t,this.options.resizeQuality);return"image/jpeg"!==t&&"image/jpg"!==t||(n=r.restore(e.dataURL,n)),o(i.dataURItoBlob(n))}})}createThumbnail(e,t,i,s,n,o){let r=new FileReader;r.onload=(()=>{e.dataURL=r.result,"image/svg+xml"!==e.type?this.createThumbnailFromUrl(e,t,i,s,n,o):null!=o&&o(r.result)}),r.readAsDataURL(e)}displayExistingFile(e,t,i,s,n=!0){if(this.emit("addedfile",e),this.emit("complete",e),n){let n=t=>{this.emit("thumbnail",e,t),i&&i()};e.dataURL=t,this.createThumbnailFromUrl(e,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.resizeMethod,this.options.fixOrientation,n,s)}else this.emit("thumbnail",e,t),i&&i()}createThumbnailFromUrl(e,t,i,s,n,r,l){let a=document.createElement("img");return l&&(a.crossOrigin=l),a.onload=(()=>{let l=e=>e(1);return"undefined"!=typeof EXIF&&null!==EXIF&&n&&(l=(e=>EXIF.getData(a,function(){return e(EXIF.getTag(this,"Orientation"))}))),l(n=>{e.width=a.width,e.height=a.height;let l=this.options.resize.call(this,e,t,i,s),d=document.createElement("canvas"),u=d.getContext("2d");switch(d.width=l.trgWidth,d.height=l.trgHeight,n>4&&(d.width=l.trgHeight,d.height=l.trgWidth),n){case 2:u.translate(d.width,0),u.scale(-1,1);break;case 3:u.translate(d.width,d.height),u.rotate(Math.PI);break;case 4:u.translate(0,d.height),u.scale(1,-1);break;case 5:u.rotate(.5*Math.PI),u.scale(1,-1);break;case 6:u.rotate(.5*Math.PI),u.translate(0,-d.width);break;case 7:u.rotate(.5*Math.PI),u.translate(d.height,-d.width),u.scale(-1,1);break;case 8:u.rotate(-.5*Math.PI),u.translate(-d.height,0)}o(u,a,null!=l.srcX?l.srcX:0,null!=l.srcY?l.srcY:0,l.srcWidth,l.srcHeight,null!=l.trgX?l.trgX:0,null!=l.trgY?l.trgY:0,l.trgWidth,l.trgHeight);let p=d.toDataURL("image/jpeg",.7);if(null!=r)return r(p,d)})}),null!=r&&(a.onerror=r),a.src=e.dataURL}processQueue(){let{parallelUploads:e}=this.options,t=this.getUploadingFiles().length,i=t;if(t>=e)return;let s=this.getQueuedFiles();if(s.length>0){if(this.options.uploadMultiple)return this.processFiles(s.slice(0,e-t));for(;i<e;){if(!s.length)return;this.processFile(s.shift()),i++}}}processFile(e){return this.processFiles([e])}processFiles(e){for(let t of e)t.processing=!0,t.status=i.UPLOADING,this.emit("processing",t);return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)}_getFilesWithXhr(e){return this.files.filter(t=>t.xhr===e).map(e=>e)}cancelUpload(e){if(e.status===i.UPLOADING){let t=this._getFilesWithXhr(e.xhr);for(let e of t)e.status=i.CANCELED;void 0!==e.xhr&&e.xhr.abort();for(let e of t)this.emit("canceled",e);this.options.uploadMultiple&&this.emit("canceledmultiple",t)}else e.status!==i.ADDED&&e.status!==i.QUEUED||(e.status=i.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}resolveOption(e,...t){return"function"==typeof e?e.apply(this,t):e}uploadFile(e){return this.uploadFiles([e])}uploadFiles(e){this._transformFiles(e,t=>{if(this.options.chunking){let i=t[0];e[0].upload.chunked=this.options.chunking&&(this.options.forceChunking||i.size>this.options.chunkSize),e[0].upload.totalChunkCount=Math.ceil(i.size/this.options.chunkSize)}if(e[0].upload.chunked){let s=e[0],n=t[0];s.upload.chunks=[];let o=()=>{let t=0;for(;void 0!==s.upload.chunks[t];)t++;if(t>=s.upload.totalChunkCount)return;let o=t*this.options.chunkSize,r=Math.min(o+this.options.chunkSize,n.size),l={name:this._getParamName(0),data:n.webkitSlice?n.webkitSlice(o,r):n.slice(o,r),filename:s.upload.filename,chunkIndex:t};s.upload.chunks[t]={file:s,index:t,dataBlock:l,status:i.UPLOADING,progress:0,retries:0},this._uploadData(e,[l])};if(s.upload.finishedChunkUpload=(t=>{let n=!0;t.status=i.SUCCESS,t.dataBlock=null,t.xhr=null;for(let e=0;e<s.upload.totalChunkCount;e++){if(void 0===s.upload.chunks[e])return o();s.upload.chunks[e].status!==i.SUCCESS&&(n=!1)}n&&this.options.chunksUploaded(s,()=>{this._finished(e,"",null)})}),this.options.parallelChunkUploads)for(let e=0;e<s.upload.totalChunkCount;e++)o();else o()}else{let i=[];for(let s=0;s<e.length;s++)i[s]={name:this._getParamName(s),data:t[s],filename:e[s].upload.filename};this._uploadData(e,i)}})}_getChunk(e,t){for(let i=0;i<e.upload.totalChunkCount;i++)if(void 0!==e.upload.chunks[i]&&e.upload.chunks[i].xhr===t)return e.upload.chunks[i]}_uploadData(e,t){let s=new XMLHttpRequest;for(let t of e)t.xhr=s;e[0].upload.chunked&&(e[0].upload.chunks[t[0].chunkIndex].xhr=s);let n=this.resolveOption(this.options.method,e),o=this.resolveOption(this.options.url,e);s.open(n,o,!0),s.timeout=this.resolveOption(this.options.timeout,e),s.withCredentials=!!this.options.withCredentials,s.onload=(t=>{this._finishedUploading(e,s,t)}),s.ontimeout=(()=>{this._handleUploadError(e,s,`Request timedout after ${this.options.timeout/1e3} seconds`)}),s.onerror=(()=>{this._handleUploadError(e,s)}),(null!=s.upload?s.upload:s).onprogress=(t=>this._updateFilesUploadProgress(e,s,t));let r={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};this.options.headers&&i.extend(r,this.options.headers);for(let e in r){let t=r[e];t&&s.setRequestHeader(e,t)}let l=new FormData;if(this.options.params){let t=this.options.params;"function"==typeof t&&(t=t.call(this,e,s,e[0].upload.chunked?this._getChunk(e[0],s):null));for(let e in t){let i=t[e];l.append(e,i)}}for(let t of e)this.emit("sending",t,s,l);this.options.uploadMultiple&&this.emit("sendingmultiple",e,s,l),this._addFormElementData(l);for(let e=0;e<t.length;e++){let i=t[e];l.append(i.name,i.data,i.filename)}this.submitRequest(s,l,e)}_transformFiles(e,t){let i=[],s=0;for(let n=0;n<e.length;n++)this.options.transformFile.call(this,e[n],o=>{i[n]=o,++s===e.length&&t(i)})}_addFormElementData(e){if("FORM"===this.element.tagName)for(let t of this.element.querySelectorAll("input, textarea, select, button")){let i=t.getAttribute("name"),s=t.getAttribute("type");if(s&&(s=s.toLowerCase()),null!=i)if("SELECT"===t.tagName&&t.hasAttribute("multiple"))for(let s of t.options)s.selected&&e.append(i,s.value);else(!s||"checkbox"!==s&&"radio"!==s||t.checked)&&e.append(i,t.value)}}_updateFilesUploadProgress(e,t,i){let s;if(void 0!==i){if(s=100*i.loaded/i.total,e[0].upload.chunked){let n=e[0],o=this._getChunk(n,t);o.progress=s,o.total=i.total,o.bytesSent=i.loaded,n.upload.progress=0,n.upload.total=0,n.upload.bytesSent=0;for(let e=0;e<n.upload.totalChunkCount;e++)void 0!==n.upload.chunks[e]&&void 0!==n.upload.chunks[e].progress&&(n.upload.progress+=n.upload.chunks[e].progress,n.upload.total+=n.upload.chunks[e].total,n.upload.bytesSent+=n.upload.chunks[e].bytesSent);n.upload.progress=n.upload.progress/n.upload.totalChunkCount}else for(let t of e)t.upload.progress=s,t.upload.total=i.total,t.upload.bytesSent=i.loaded;for(let t of e)this.emit("uploadprogress",t,t.upload.progress,t.upload.bytesSent)}else{let t=!0;s=100;for(let i of e)100===i.upload.progress&&i.upload.bytesSent===i.upload.total||(t=!1),i.upload.progress=s,i.upload.bytesSent=i.upload.total;if(t)return;for(let t of e)this.emit("uploadprogress",t,s,t.upload.bytesSent)}}_finishedUploading(e,t,s){let n;if(e[0].status!==i.CANCELED&&4===t.readyState){if("arraybuffer"!==t.responseType&&"blob"!==t.responseType&&(n=t.responseText,t.getResponseHeader("content-type")&&~t.getResponseHeader("content-type").indexOf("application/json")))try{n=JSON.parse(n)}catch(e){s=e,n="Invalid JSON response from server."}this._updateFilesUploadProgress(e),200<=t.status&&t.status<300?e[0].upload.chunked?e[0].upload.finishedChunkUpload(this._getChunk(e[0],t)):this._finished(e,n,s):this._handleUploadError(e,t,n)}}_handleUploadError(e,t,s){if(e[0].status!==i.CANCELED){if(e[0].upload.chunked&&this.options.retryChunks){let i=this._getChunk(e[0],t);if(i.retries++<this.options.retryChunksLimit)return void this._uploadData(e,[i.dataBlock]);console.warn("Retried this chunk too often. Giving up.")}this._errorProcessing(e,s||this.options.dictResponseError.replace("{{statusCode}}",t.status),t)}}submitRequest(e,t,i){e.send(t)}_finished(e,t,s){for(let n of e)n.status=i.SUCCESS,this.emit("success",n,t,s),this.emit("complete",n);if(this.options.uploadMultiple&&(this.emit("successmultiple",e,t,s),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}_errorProcessing(e,t,s){for(let n of e)n.status=i.ERROR,this.emit("error",n,t,s),this.emit("complete",n);if(this.options.uploadMultiple&&(this.emit("errormultiple",e,t,s),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}static uuidv4(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}}i.initClass(),i.version="5.7.1",i.options={},i.optionsForElement=function(e){return e.getAttribute("id")?i.options[n(e.getAttribute("id"))]:void 0},i.instances=[],i.forElement=function(e){if("string"==typeof e&&(e=document.querySelector(e)),null==(null!=e?e.dropzone:void 0))throw new Error("No Dropzone found for given element. This is probably because you're trying to access it before Dropzone had the time to initialize. Use the `init` option to setup any additional observers on your Dropzone.");return e.dropzone},i.autoDiscover=!0,i.discover=function(){let e;if(document.querySelectorAll)e=document.querySelectorAll(".dropzone");else{e=[];let t=t=>(()=>{let i=[];for(let s of t)/(^| )dropzone($| )/.test(s.className)?i.push(e.push(s)):i.push(void 0);return i})();t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))}return(()=>{let t=[];for(let s of e)!1!==i.optionsForElement(s)?t.push(new i(s)):t.push(void 0);return t})()},i.blacklistedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i],i.isBrowserSupported=function(){let e=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a"))for(let t of i.blacklistedBrowsers)t.test(navigator.userAgent)&&(e=!1);else e=!1;else e=!1;return e},i.dataURItoBlob=function(e){let t=atob(e.split(",")[1]),i=e.split(",")[0].split(":")[1].split(";")[0],s=new ArrayBuffer(t.length),n=new Uint8Array(s);for(let e=0,i=t.length,s=0<=i;s?e<=i:e>=i;s?e++:e--)n[e]=t.charCodeAt(e);return new Blob([s],{type:i})};const s=(e,t)=>e.filter(e=>e!==t).map(e=>e),n=e=>e.replace(/[\-_](\w)/g,e=>e.charAt(1).toUpperCase());i.createElement=function(e){let t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]},i.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},i.getElement=function(e,t){let i;if("string"==typeof e?i=document.querySelector(e):null!=e.nodeType&&(i=e),null==i)throw new Error(`Invalid \`${t}\` option provided. Please provide a CSS selector or a plain HTML element.`);return i},i.getElements=function(e,t){let i,s;if(e instanceof Array){s=[];try{for(i of e)s.push(this.getElement(i,t))}catch(e){s=null}}else if("string"==typeof e)for(i of(s=[],document.querySelectorAll(e)))s.push(i);else null!=e.nodeType&&(s=[e]);if(null==s||!s.length)throw new Error(`Invalid \`${t}\` option provided. Please provide a CSS selector, a plain HTML element or a list of those.`);return s},i.confirm=function(e,t,i){return window.confirm(e)?t():null!=i?i():void 0},i.isValidFile=function(e,t){if(!t)return!0;t=t.split(",");let i=e.type,s=i.replace(/\/.*$/,"");for(let n of t)if("."===(n=n.trim()).charAt(0)){if(-1!==e.name.toLowerCase().indexOf(n.toLowerCase(),e.name.length-n.length))return!0}else if(/\/\*$/.test(n)){if(s===n.replace(/\/.*$/,""))return!0}else if(i===n)return!0;return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each(function(){return new i(this,e)})}),null!==e?e.exports=i:window.Dropzone=i,i.ADDED="added",i.QUEUED="queued",i.ACCEPTED=i.QUEUED,i.UPLOADING="uploading",i.PROCESSING=i.UPLOADING,i.CANCELED="canceled",i.ERROR="error",i.SUCCESS="success";var o=function(e,t,i,s,n,o,r,l,a,d){let u=function(e){e.naturalWidth;let t=e.naturalHeight,i=document.createElement("canvas");i.width=1,i.height=t;let s=i.getContext("2d");s.drawImage(e,0,0);let{data:n}=s.getImageData(1,0,1,t),o=0,r=t,l=t;for(;l>o;)0===n[4*(l-1)+3]?r=l:o=l,l=r+o>>1;let a=l/t;return 0===a?1:a}(t);return e.drawImage(t,i,s,n,o,r,l,a,d/u)};class r{static initClass(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}static encode64(e){let t="",i=void 0,s=void 0,n="",o=void 0,r=void 0,l=void 0,a="",d=0;for(;o=(i=e[d++])>>2,r=(3&i)<<4|(s=e[d++])>>4,l=(15&s)<<2|(n=e[d++])>>6,a=63&n,isNaN(s)?l=a=64:isNaN(n)&&(a=64),t=t+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(r)+this.KEY_STR.charAt(l)+this.KEY_STR.charAt(a),i=s=n="",o=r=l=a="",d<e.length;);return t}static restore(e,t){if(!e.match("data:image/jpeg;base64,"))return t;let i=this.decode64(e.replace("data:image/jpeg;base64,","")),s=this.slice2Segments(i),n=this.exifManipulation(t,s);return`data:image/jpeg;base64,${this.encode64(n)}`}static exifManipulation(e,t){let i=this.getExifArray(t),s=this.insertExif(e,i);return new Uint8Array(s)}static getExifArray(e){let t=void 0,i=0;for(;i<e.length;){if(255===(t=e[i])[0]&225===t[1])return t;i++}return[]}static insertExif(e,t){let i=e.replace("data:image/jpeg;base64,",""),s=this.decode64(i),n=s.indexOf(255,3),o=s.slice(0,n),r=s.slice(n),l=o;return l=(l=l.concat(t)).concat(r)}static slice2Segments(e){let t=0,i=[];for(;;){if(255===e[t]&218===e[t+1])break;if(255===e[t]&216===e[t+1])t+=2;else{let s=t+(256*e[t+2]+e[t+3])+2,n=e.slice(t,s);i.push(n),t=s}if(t>e.length)break}return i}static decode64(e){let t=void 0,i=void 0,s="",n=void 0,o=void 0,r=void 0,l="",a=0,d=[];for(/[^A-Za-z0-9\+\/\=]/g.exec(e)&&console.warn("There were invalid base64 characters in the input text.\nValid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='\nExpect errors in decoding."),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");t=(n=this.KEY_STR.indexOf(e.charAt(a++)))<<2|(o=this.KEY_STR.indexOf(e.charAt(a++)))>>4,i=(15&o)<<4|(r=this.KEY_STR.indexOf(e.charAt(a++)))>>2,s=(3&r)<<6|(l=this.KEY_STR.indexOf(e.charAt(a++))),d.push(t),64!==r&&d.push(i),64!==l&&d.push(s),t=i=s="",n=o=r=l="",a<e.length;);return d}}r.initClass(),i._autoDiscoverFunction=function(){if(i.autoDiscover)return i.discover()},function(e,t){let i=!1,s=!0,n=e.document,o=n.documentElement,r=n.addEventListener?"addEventListener":"attachEvent",l=n.addEventListener?"removeEventListener":"detachEvent",a=n.addEventListener?"":"on";var d=function(s){if("readystatechange"!==s.type||"complete"===n.readyState)return("load"===s.type?e:n)[l](a+s.type,d,!1),!i&&(i=!0)?t.call(e,s.type||s):void 0},u=function(){try{o.doScroll("left")}catch(e){return void setTimeout(u,50)}return d("poll")};if("complete"!==n.readyState){if(n.createEventObject&&o.doScroll){try{s=!e.frameElement}catch(e){}s&&u()}n[r](a+"DOMContentLoaded",d,!1),n[r](a+"readystatechange",d,!1),e[r](a+"load",d,!1)}}(window,i._autoDiscoverFunction)}(e={exports:{}},e.exports),e.exports),i={getSignedURL(e,t){let i={filePath:e.name,contentType:e.type};return new Promise((s,n)=>{var o=new FormData;let r=new XMLHttpRequest,l="function"==typeof t.signingURL?t.signingURL(e):t.signingURL;r.open("POST",l),r.onload=function(){200==r.status?s(JSON.parse(r.response)):n(r.statusText)},r.onerror=function(e){console.error("Network Error : Could not send request to AWS (Maybe CORS errors)"),n(e)},!0===t.withCredentials&&(r.withCredentials=!0),Object.entries(t.headers||{}).forEach(([e,t])=>{r.setRequestHeader(e,t)}),i=Object.assign(i,t.params||{}),Object.entries(i).forEach(([e,t])=>{o.append(e,t)}),r.send(o)})},sendFile(e,t,i){var s=i?this.setResponseHandler:this.sendS3Handler;return this.getSignedURL(e,t).then(t=>s(t,e)).catch(e=>e)},setResponseHandler(e,t){t.s3Signature=e.signature,t.s3Url=e.postEndpoint},sendS3Handler(e,t){let i=new FormData,s=e.signature;return Object.keys(s).forEach(function(e){i.append(e,s[e])}),i.append("file",t),new Promise((t,s)=>{let n=new XMLHttpRequest;n.open("POST",e.postEndpoint),n.onload=function(){if(201==n.status){var e=(new window.DOMParser).parseFromString(n.response,"text/xml").firstChild.children[0].innerHTML;t({success:!0,message:e})}else{var i=(new window.DOMParser).parseFromString(n.response,"text/xml").firstChild.children[0].innerHTML;s({success:!1,message:i+". Request is marked as resolved when returns as status 201"})}},n.onerror=function(e){var t=(new window.DOMParser).parseFromString(n.response,"text/xml").firstChild.children[1].innerHTML;s({success:!1,message:t})},n.send(i)})}};t.autoDiscover=!1;return function(e,t,i,s,n,o,r,l,a,d){"boolean"!=typeof r&&(a=l,l=r,r=!1);var u,p="function"==typeof i?i.options:i;if(e&&e.render&&(p.render=e.render,p.staticRenderFns=e.staticRenderFns,p._compiled=!0,n&&(p.functional=!0)),s&&(p._scopeId=s),o?(u=function(e){(e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),t&&t.call(this,a(e)),e&&e._registeredComponents&&e._registeredComponents.add(o)},p._ssrRegister=u):t&&(u=r?function(){t.call(this,d(this.$root.$options.shadowRoot))}:function(e){t.call(this,l(e))}),u)if(p.functional){var h=p.render;p.render=function(e,t){return u.call(t),h(e,t)}}else{var c=p.beforeCreate;p.beforeCreate=c?[].concat(c,u):[u]}return i}({render:function(){var e=this.$createElement,t=this._self._c||e;return t("div",{ref:"dropzoneElement",class:{"vue-dropzone dropzone":this.includeStyling},attrs:{id:this.id}},[this.useCustomSlot?t("div",{staticClass:"dz-message"},[this._t("default",[this._v("Drop files here to upload")])],2):this._e()])},staticRenderFns:[]},void 0,{props:{id:{type:String,required:!0,default:"dropzone"},options:{type:Object,required:!0},includeStyling:{type:Boolean,default:!0,required:!1},awss3:{type:Object,required:!1,default:null},destroyDropzone:{type:Boolean,default:!0,required:!1},duplicateCheck:{type:Boolean,default:!1,required:!1},useCustomSlot:{type:Boolean,default:!1,required:!1}},data:()=>({isS3:!1,isS3OverridesServerPropagation:!1,wasQueueAutoProcess:!0}),computed:{dropzoneSettings(){let e={thumbnailWidth:200,thumbnailHeight:200};return Object.keys(this.options).forEach(function(t){e[t]=this.options[t]},this),null!==this.awss3&&(e.autoProcessQueue=!1,this.isS3=!0,this.isS3OverridesServerPropagation=!1===this.awss3.sendFileToServer,void 0!==this.options.autoProcessQueue&&(this.wasQueueAutoProcess=this.options.autoProcessQueue),this.isS3OverridesServerPropagation&&(e.url=(e=>e[0].s3Url))),e}},mounted(){if(this.$isServer&&this.hasBeenMounted)return;this.hasBeenMounted=!0,this.dropzone=new t(this.$refs.dropzoneElement,this.dropzoneSettings);let e=this;this.dropzone.on("thumbnail",function(t,i){e.$emit("vdropzone-thumbnail",t,i)}),this.dropzone.on("addedfile",function(t){var i,s;if(e.duplicateCheck&&this.files.length)for(i=0,s=this.files.length;i<s-1;i++)this.files[i].name===t.name&&this.files[i].size===t.size&&this.files[i].lastModifiedDate.toString()===t.lastModifiedDate.toString()&&(this.removeFile(t),e.$emit("vdropzone-duplicate-file",t));e.$emit("vdropzone-file-added",t),e.isS3&&e.wasQueueAutoProcess&&!t.manuallyAdded&&e.getSignedAndUploadToS3(t)}),this.dropzone.on("addedfiles",function(t){e.$emit("vdropzone-files-added",t)}),this.dropzone.on("removedfile",function(t){e.$emit("vdropzone-removed-file",t),t.manuallyAdded&&null!==e.dropzone.options.maxFiles&&e.dropzone.options.maxFiles++}),this.dropzone.on("success",function(t,i){if(e.$emit("vdropzone-success",t,i),e.isS3){if(e.isS3OverridesServerPropagation){var s=(new window.DOMParser).parseFromString(i,"text/xml").firstChild.children[0].innerHTML;e.$emit("vdropzone-s3-upload-success",s)}e.wasQueueAutoProcess&&e.setOption("autoProcessQueue",!1)}}),this.dropzone.on("successmultiple",function(t,i){e.$emit("vdropzone-success-multiple",t,i)}),this.dropzone.on("error",function(t,i,s){e.$emit("vdropzone-error",t,i,s),this.isS3&&e.$emit("vdropzone-s3-upload-error")}),this.dropzone.on("errormultiple",function(t,i,s){e.$emit("vdropzone-error-multiple",t,i,s)}),this.dropzone.on("sending",function(t,i,s){if(e.isS3)if(e.isS3OverridesServerPropagation){let e=t.s3Signature;Object.keys(e).forEach(function(t){s.append(t,e[t])})}else s.append("s3ObjectLocation",t.s3ObjectLocation);e.$emit("vdropzone-sending",t,i,s)}),this.dropzone.on("sendingmultiple",function(t,i,s){e.$emit("vdropzone-sending-multiple",t,i,s)}),this.dropzone.on("complete",function(t){e.$emit("vdropzone-complete",t)}),this.dropzone.on("completemultiple",function(t){e.$emit("vdropzone-complete-multiple",t)}),this.dropzone.on("canceled",function(t){e.$emit("vdropzone-canceled",t)}),this.dropzone.on("canceledmultiple",function(t){e.$emit("vdropzone-canceled-multiple",t)}),this.dropzone.on("maxfilesreached",function(t){e.$emit("vdropzone-max-files-reached",t)}),this.dropzone.on("maxfilesexceeded",function(t){e.$emit("vdropzone-max-files-exceeded",t)}),this.dropzone.on("processing",function(t){e.$emit("vdropzone-processing",t)}),this.dropzone.on("processingmultiple",function(t){e.$emit("vdropzone-processing-multiple",t)}),this.dropzone.on("uploadprogress",function(t,i,s){e.$emit("vdropzone-upload-progress",t,i,s)}),this.dropzone.on("totaluploadprogress",function(t,i,s){e.$emit("vdropzone-total-upload-progress",t,i,s)}),this.dropzone.on("reset",function(){e.$emit("vdropzone-reset")}),this.dropzone.on("queuecomplete",function(){e.$emit("vdropzone-queue-complete")}),this.dropzone.on("drop",function(t){e.$emit("vdropzone-drop",t)}),this.dropzone.on("dragstart",function(t){e.$emit("vdropzone-drag-start",t)}),this.dropzone.on("dragend",function(t){e.$emit("vdropzone-drag-end",t)}),this.dropzone.on("dragenter",function(t){e.$emit("vdropzone-drag-enter",t)}),this.dropzone.on("dragover",function(t){e.$emit("vdropzone-drag-over",t)}),this.dropzone.on("dragleave",function(t){e.$emit("vdropzone-drag-leave",t)}),e.$emit("vdropzone-mounted")},beforeDestroy(){this.destroyDropzone&&this.dropzone.destroy()},methods:{manuallyAddFile:function(e,t){e.manuallyAdded=!0,this.dropzone.emit("addedfile",e);let i=!1;if((t.indexOf(".svg")>-1||t.indexOf(".png")>-1||t.indexOf(".jpg")>-1||t.indexOf(".jpeg")>-1||t.indexOf(".gif")>-1||t.indexOf(".webp")>-1)&&(i=!0),this.dropzone.options.createImageThumbnails&&i&&e.size<=1024*this.dropzone.options.maxThumbnailFilesize*1024){t&&this.dropzone.emit("thumbnail",e,t);for(var s=e.previewElement.querySelectorAll("[data-dz-thumbnail]"),n=0;n<s.length;n++)s[n].style.width=this.dropzoneSettings.thumbnailWidth+"px",s[n].style.height=this.dropzoneSettings.thumbnailHeight+"px",s[n].style["object-fit"]="contain"}this.dropzone.emit("complete",e),this.dropzone.options.maxFiles&&this.dropzone.options.maxFiles--,this.dropzone.files.push(e),this.$emit("vdropzone-file-added-manually",e)},setOption:function(e,t){this.dropzone.options[e]=t},removeAllFiles:function(e){this.dropzone.removeAllFiles(e)},processQueue:function(){let e=this.dropzone;this.isS3&&!this.wasQueueAutoProcess?this.getQueuedFiles().forEach(e=>{this.getSignedAndUploadToS3(e)}):this.dropzone.processQueue(),this.dropzone.on("success",function(){e.options.autoProcessQueue=!0}),this.dropzone.on("queuecomplete",function(){e.options.autoProcessQueue=!1})},init:function(){return this.dropzone.init()},destroy:function(){return this.dropzone.destroy()},updateTotalUploadProgress:function(){return this.dropzone.updateTotalUploadProgress()},getFallbackForm:function(){return this.dropzone.getFallbackForm()},getExistingFallback:function(){return this.dropzone.getExistingFallback()},setupEventListeners:function(){return this.dropzone.setupEventListeners()},removeEventListeners:function(){return this.dropzone.removeEventListeners()},disable:function(){return this.dropzone.disable()},enable:function(){return this.dropzone.enable()},filesize:function(e){return this.dropzone.filesize(e)},accept:function(e,t){return this.dropzone.accept(e,t)},addFile:function(e){return this.dropzone.addFile(e)},removeFile:function(e){this.dropzone.removeFile(e)},getAcceptedFiles:function(){return this.dropzone.getAcceptedFiles()},getRejectedFiles:function(){return this.dropzone.getRejectedFiles()},getFilesWithStatus:function(){return this.dropzone.getFilesWithStatus()},getQueuedFiles:function(){return this.dropzone.getQueuedFiles()},getUploadingFiles:function(){return this.dropzone.getUploadingFiles()},getAddedFiles:function(){return this.dropzone.getAddedFiles()},getActiveFiles:function(){return this.dropzone.getActiveFiles()},getSignedAndUploadToS3(e){var t=i.sendFile(e,this.awss3,this.isS3OverridesServerPropagation);this.isS3OverridesServerPropagation?t.then(()=>{setTimeout(()=>this.dropzone.processFile(e))}):t.then(t=>{t.success?(e.s3ObjectLocation=t.message,setTimeout(()=>this.dropzone.processFile(e)),this.$emit("vdropzone-s3-upload-success",t.message)):void 0!==t.message?this.$emit("vdropzone-s3-upload-error",t.message):this.$emit("vdropzone-s3-upload-error","Network Error : Could not send request to AWS. (Maybe CORS error)")}),t.catch(e=>{alert(e)})},setAWSSigningURL(e){this.isS3&&(this.awss3.signingURL=e)}}},void 0,!1,void 0,void 0,void 0)});
  //# sourceMappingURL=vue2Dropzone.js.map
  