/*! dropzone v5.4.0 | Copyright (c) 2012 Matias Meno */"use strict";function _possibleConstructorReturn(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function __guard__(e,t){return"undefined"!=typeof e&&null!==e?t(e):void 0}function __guardMethod__(e,t,i){return"undefined"!=typeof e&&null!==e&&"function"==typeof e[t]?i(e,t):void 0}var _createClass=function(){function e(e,t){for(var i=0;i1?i-1:0),r=1;r=o.length)break;s=o[l++]}else{if(l=o.next(),l.done)break;s=l.value}var u=s;u.apply(this,n)}}return this}},{key:"off",value:function(e,t){if(!this._callbacks||0===arguments.length)return this._callbacks={},this;var i=this._callbacks[e];if(!i)return this;if(1===arguments.length)return delete this._callbacks[e],this;for(var n=0;n=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;if(/(^| )dz-message($| )/.test(a.className)){e=a,a.className="dz-message";break}}e||(e=t.createElement('
'),this.element.appendChild(e));var l=e.getElementsByTagName("span")[0];return l&&(null!=l.textContent?l.textContent=this.options.dictFallbackMessage:null!=l.innerText&&(l.innerText=this.options.dictFallbackMessage)),this.element.appendChild(this.getFallbackForm())},resize:function(e,t,i,n){var r={srcX:0,srcY:0,srcWidth:e.width,srcHeight:e.height},o=e.width/e.height;null==t&&null==i?(t=r.srcWidth,i=r.srcHeight):null==t?t=i*o:null==i&&(i=t/o),t=Math.min(t,r.srcWidth),i=Math.min(i,r.srcHeight);var a=t/i;if(r.srcWidth>t||r.srcHeight>i)if("crop"===n)o>a?(r.srcHeight=e.height,r.srcWidth=r.srcHeight*a):(r.srcWidth=e.width,r.srcHeight=r.srcWidth/a);else{if("contain"!==n)throw new Error("Unknown resizeMethod '"+n+"'");o>a?i=t/o:t=i*o}return r.srcX=(e.width-r.srcWidth)/2,r.srcY=(e.height-r.srcHeight)/2,r.trgWidth=t,r.trgHeight=i,r},transformFile:function(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:'
\n
\n
\n
\n
\n
\n
\n
\n
\n \n Check\n \n \n \n \n \n
\n
\n \n Error\n \n \n \n \n \n \n \n
\n
',drop:function(e){return this.element.classList.remove("dz-drag-hover")},dragstart:function(e){},dragend:function(e){return this.element.classList.remove("dz-drag-hover")},dragenter:function(e){return this.element.classList.add("dz-drag-hover")},dragover:function(e){return this.element.classList.add("dz-drag-hover")},dragleave:function(e){return this.element.classList.remove("dz-drag-hover")},paste:function(e){},reset:function(){return this.element.classList.remove("dz-started")},addedfile:function(e){var i=this;if(this.element===this.previewsContainer&&this.element.classList.add("dz-started"),this.previewsContainer){e.previewElement=t.createElement(this.options.previewTemplate.trim()),e.previewTemplate=e.previewElement,this.previewsContainer.appendChild(e.previewElement);for(var n=e.previewElement.querySelectorAll("[data-dz-name]"),r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l=a;l.textContent=e.name}for(var s=e.previewElement.querySelectorAll("[data-dz-size]"),u=!0,d=0,s=u?s:s[Symbol.iterator]();;){if(u){if(d>=s.length)break;l=s[d++]}else{if(d=s.next(),d.done)break;l=d.value}l.innerHTML=this.filesize(e.size)}this.options.addRemoveLinks&&(e._removeLink=t.createElement(''+this.options.dictRemoveFile+""),e.previewElement.appendChild(e._removeLink));for(var c=function(n){return n.preventDefault(),n.stopPropagation(),e.status===t.UPLOADING?t.confirm(i.options.dictCancelUploadConfirmation,function(){return i.removeFile(e)}):i.options.dictRemoveFileConfirmation?t.confirm(i.options.dictRemoveFileConfirmation,function(){return i.removeFile(e)}):i.removeFile(e)},p=e.previewElement.querySelectorAll("[data-dz-remove]"),h=!0,f=0,p=h?p:p[Symbol.iterator]();;){var v;if(h){if(f>=p.length)break;v=p[f++]}else{if(f=p.next(),f.done)break;v=f.value}var m=v;m.addEventListener("click",c)}}},removedfile:function(e){return null!=e.previewElement&&null!=e.previewElement.parentNode&&e.previewElement.parentNode.removeChild(e.previewElement),this._updateMaxFilesReachedClass()},thumbnail:function(e,t){if(e.previewElement){e.previewElement.classList.remove("dz-file-preview");for(var i=e.previewElement.querySelectorAll("[data-dz-thumbnail]"),n=!0,r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;a.alt=e.name,a.src=t}return setTimeout(function(){return e.previewElement.classList.add("dz-image-preview")},1)}},error:function(e,t){if(e.previewElement){e.previewElement.classList.add("dz-error"),"String"!=typeof t&&t.error&&(t=t.error);for(var i=e.previewElement.querySelectorAll("[data-dz-errormessage]"),n=!0,r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;a.textContent=t}}},errormultiple:function(){},processing:function(e){if(e.previewElement&&(e.previewElement.classList.add("dz-processing"),e._removeLink))return e._removeLink.textContent=this.options.dictCancelUpload},processingmultiple:function(){},uploadprogress:function(e,t,i){if(e.previewElement)for(var n=e.previewElement.querySelectorAll("[data-dz-uploadprogress]"),r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l=a;"PROGRESS"===l.nodeName?l.value=t:l.style.width=t+"%"}},totaluploadprogress:function(){},sending:function(){},sendingmultiple:function(){},success:function(e){if(e.previewElement)return e.previewElement.classList.add("dz-success")},successmultiple:function(){},canceled:function(e){return this.emit("error",e,this.options.dictUploadCanceled)},canceledmultiple:function(){},complete:function(e){if(e._removeLink&&(e._removeLink.textContent=this.options.dictRemoveFile),e.previewElement)return e.previewElement.classList.add("dz-complete")},completemultiple:function(){},maxfilesexceeded:function(){},maxfilesreached:function(){},queuecomplete:function(){},addedfiles:function(){}},this.prototype._thumbnailQueue=[],this.prototype._processingThumbnail=!1}},{key:"extend",value:function(e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n=r.length)break;l=r[a++]}else{if(a=r.next(),a.done)break;l=a.value}var s=l;for(var u in s){var d=s[u];e[u]=d}}return e}}]),_createClass(t,[{key:"getAcceptedFiles",value:function(){return this.files.filter(function(e){return e.accepted}).map(function(e){return e})}},{key:"getRejectedFiles",value:function(){return this.files.filter(function(e){return!e.accepted}).map(function(e){return e})}},{key:"getFilesWithStatus",value:function(e){return this.files.filter(function(t){return t.status===e}).map(function(e){return e})}},{key:"getQueuedFiles",value:function(){return this.getFilesWithStatus(t.QUEUED)}},{key:"getUploadingFiles",value:function(){return this.getFilesWithStatus(t.UPLOADING)}},{key:"getAddedFiles",value:function(){return this.getFilesWithStatus(t.ADDED)}},{key:"getActiveFiles",value:function(){return this.files.filter(function(e){return e.status===t.UPLOADING||e.status===t.QUEUED}).map(function(e){return e})}},{key:"init",value:function(){var e=this;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(t.createElement('
'+this.options.dictDefaultMessage+"
")),this.clickableElements.length){var i=function t(){return e.hiddenFileInput&&e.hiddenFileInput.parentNode.removeChild(e.hiddenFileInput),e.hiddenFileInput=document.createElement("input"),e.hiddenFileInput.setAttribute("type","file"),(null===e.options.maxFiles||e.options.maxFiles>1)&&e.hiddenFileInput.setAttribute("multiple","multiple"),e.hiddenFileInput.className="dz-hidden-input",null!==e.options.acceptedFiles&&e.hiddenFileInput.setAttribute("accept",e.options.acceptedFiles),null!==e.options.capture&&e.hiddenFileInput.setAttribute("capture",e.options.capture),e.hiddenFileInput.style.visibility="hidden",e.hiddenFileInput.style.position="absolute",e.hiddenFileInput.style.top="0",e.hiddenFileInput.style.left="0",e.hiddenFileInput.style.height="0",e.hiddenFileInput.style.width="0",document.querySelector(e.options.hiddenInputContainer).appendChild(e.hiddenFileInput),e.hiddenFileInput.addEventListener("change",function(){var i=e.hiddenFileInput.files;if(i.length)for(var n=i,r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l=a;e.addFile(l)}return e.emit("addedfiles",i),t()})};i()}this.URL=null!==window.URL?window.URL:window.webkitURL;for(var n=this.events,r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l=a;this.on(l,this.options[l])}this.on("uploadprogress",function(){return e.updateTotalUploadProgress()}),this.on("removedfile",function(){return e.updateTotalUploadProgress()}),this.on("canceled",function(t){return e.emit("complete",t)}),this.on("complete",function(t){if(0===e.getAddedFiles().length&&0===e.getUploadingFiles().length&&0===e.getQueuedFiles().length)return setTimeout(function(){return e.emit("queuecomplete")},0)});var s=function(e){return e.stopPropagation(),e.preventDefault?e.preventDefault():e.returnValue=!1};return this.listeners=[{element:this.element,events:{dragstart:function(t){return e.emit("dragstart",t)},dragenter:function(t){return s(t),e.emit("dragenter",t)},dragover:function(t){var i=void 0;try{i=t.dataTransfer.effectAllowed}catch(e){}return t.dataTransfer.dropEffect="move"===i||"linkMove"===i?"move":"copy",s(t),e.emit("dragover",t)},dragleave:function(t){return e.emit("dragleave",t)},drop:function(t){return s(t),e.drop(t)},dragend:function(t){return e.emit("dragend",t)}}}],this.clickableElements.forEach(function(i){return e.listeners.push({element:i,events:{click:function(n){return(i!==e.element||n.target===e.element||t.elementInside(n.target,e.element.querySelector(".dz-message")))&&e.hiddenFileInput.click(),!0}}})}),this.enable(),this.options.init.call(this)}},{key:"destroy",value:function(){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,t.instances.splice(t.instances.indexOf(this),1)}},{key:"updateTotalUploadProgress",value:function(){var e=void 0,t=0,i=0,n=this.getActiveFiles();if(n.length){for(var r=this.getActiveFiles(),o=!0,a=0,r=o?r:r[Symbol.iterator]();;){var l;if(o){if(a>=r.length)break;l=r[a++]}else{if(a=r.next(),a.done)break;l=a.value}var s=l;t+=s.upload.bytesSent,i+=s.upload.total}e=100*t/i}else e=100;return this.emit("totaluploadprogress",e,i,t)}},{key:"_getParamName",value:function(e){return"function"==typeof this.options.paramName?this.options.paramName(e):""+this.options.paramName+(this.options.uploadMultiple?"["+e+"]":"")}},{key:"_renameFile",value:function(e){return"function"!=typeof this.options.renameFile?e.name:this.options.renameFile(e)}},{key:"getFallbackForm",value:function(){var e=void 0,i=void 0;if(e=this.getExistingFallback())return e;var n='
';this.options.dictFallbackText&&(n+="

"+this.options.dictFallbackText+"

"),n+='
';var r=t.createElement(n);return"FORM"!==this.element.tagName?(i=t.createElement('
'),i.appendChild(r)):(this.element.setAttribute("enctype","multipart/form-data"),this.element.setAttribute("method",this.options.method)),null!=i?i:r}},{key:"getExistingFallback",value:function(){for(var e=function(e){for(var t=e,i=!0,n=0,t=i?t:t[Symbol.iterator]();;){var r;if(i){if(n>=t.length)break;r=t[n++]}else{if(n=t.next(),n.done)break;r=n.value}var o=r;if(/(^| )fallback($| )/.test(o.className))return o}},t=["div","form"],i=0;i0){for(var n=["tb","gb","mb","kb","b"],r=0;r=a){t=e/Math.pow(this.options.filesizeBase,4-r),i=o;break}}t=Math.round(10*t)/10}return""+t+" "+this.options.dictFileSizeUnits[i]}},{key:"_updateMaxFilesReachedClass",value:function(){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")}},{key:"drop",value:function(e){if(e.dataTransfer){this.emit("drop",e);var t=e.dataTransfer.files;if(this.emit("addedfiles",t),t.length){var i=e.dataTransfer.items;i&&i.length&&null!=i[0].webkitGetAsEntry?this._addFilesFromItems(i):this.handleFiles(t)}}}},{key:"paste",value:function(e){if(null!=__guard__(null!=e?e.clipboardData:void 0,function(e){return e.items})){this.emit("paste",e);var t=e.clipboardData.items;return t.length?this._addFilesFromItems(t):void 0}}},{key:"handleFiles",value:function(e){for(var t=e,i=!0,n=0,t=i?t:t[Symbol.iterator]();;){var r;if(i){if(n>=t.length)break;r=t[n++]}else{if(n=t.next(),n.done)break;r=n.value}var o=r;this.addFile(o)}}},{key:"_addFilesFromItems",value:function(e){var t=this;return function(){for(var i=[],n=e,r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l,s=a;null!=s.webkitGetAsEntry&&(l=s.webkitGetAsEntry())?l.isFile?i.push(t.addFile(s.getAsFile())):l.isDirectory?i.push(t._addFilesFromDirectory(l,l.name)):i.push(void 0):null!=s.getAsFile&&(null==s.kind||"file"===s.kind)?i.push(t.addFile(s.getAsFile())):i.push(void 0)}return i}()}},{key:"_addFilesFromDirectory",value:function(e,t){var i=this,n=e.createReader(),r=function(e){return __guardMethod__(console,"log",function(t){return t.log(e)})},o=function e(){return n.readEntries(function(n){if(n.length>0){for(var r=n,o=!0,a=0,r=o?r:r[Symbol.iterator]();;){var l;if(o){if(a>=r.length)break;l=r[a++]}else{if(a=r.next(),a.done)break;l=a.value}var s=l;s.isFile?s.file(function(e){if(!i.options.ignoreHiddenFiles||"."!==e.name.substring(0,1))return e.fullPath=t+"/"+e.name,i.addFile(e)}):s.isDirectory&&i._addFilesFromDirectory(s,t+"/"+s.name)}e()}return null},r)};return o()}},{key:"accept",value:function(e,i){return e.size>1024*this.options.maxFilesize*1024?i(this.options.dictFileTooBig.replace("{{filesize}}",Math.round(e.size/1024/10.24)/100).replace("{{maxFilesize}}",this.options.maxFilesize)):t.isValidFile(e,this.options.acceptedFiles)?null!=this.options.maxFiles&&this.getAcceptedFiles().length>=this.options.maxFiles?(i(this.options.dictMaxFilesExceeded.replace("{{maxFiles}}",this.options.maxFiles)),this.emit("maxfilesexceeded",e)):this.options.accept.call(this,e,i):i(this.options.dictInvalidFileType)}},{key:"addFile",value:function(e){var i=this;return e.upload={uuid:t.uuidv4(),progress:0,total:e.size,bytesSent:0,filename:this._renameFile(e),chunked:this.options.chunking&&(this.options.forceChunking||e.size>this.options.chunkSize),totalChunkCount:Math.ceil(e.size/this.options.chunkSize)},this.files.push(e),e.status=t.ADDED,this.emit("addedfile",e),this._enqueueThumbnail(e),this.accept(e,function(t){return t?(e.accepted=!1,i._errorProcessing([e],t)):(e.accepted=!0,i.options.autoQueue&&i.enqueueFile(e)),i._updateMaxFilesReachedClass()})}},{key:"enqueueFiles",value:function(e){for(var t=e,i=!0,n=0,t=i?t:t[Symbol.iterator]();;){var r;if(i){if(n>=t.length)break;r=t[n++]}else{if(n=t.next(),n.done)break;r=n.value}var o=r;this.enqueueFile(o)}return null}},{key:"enqueueFile",value:function(e){var i=this;if(e.status!==t.ADDED||e.accepted!==!0)throw new Error("This file can't be queued because it has already been processed or was rejected.");if(e.status=t.QUEUED,this.options.autoProcessQueue)return setTimeout(function(){return i.processQueue()},0)}},{key:"_enqueueThumbnail",value:function(e){var t=this;if(this.options.createImageThumbnails&&e.type.match(/image.*/)&&e.size<=1024*this.options.maxThumbnailFilesize*1024)return this._thumbnailQueue.push(e),setTimeout(function(){return t._processThumbnailQueue()},0)}},{key:"_processThumbnailQueue",value:function(){var e=this;if(!this._processingThumbnail&&0!==this._thumbnailQueue.length){this._processingThumbnail=!0;var t=this._thumbnailQueue.shift();return this.createThumbnail(t,this.options.thumbnailWidth,this.options.thumbnailHeight,this.options.thumbnailMethod,!0,function(i){return e.emit("thumbnail",t,i),e._processingThumbnail=!1,e._processThumbnailQueue()})}}},{key:"removeFile",value:function(e){if(e.status===t.UPLOADING&&this.cancelUpload(e),this.files=without(this.files,e),this.emit("removedfile",e),0===this.files.length)return this.emit("reset")}},{key:"removeAllFiles",value:function(e){null==e&&(e=!1);for(var i=this.files.slice(),n=!0,r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;(a.status!==t.UPLOADING||e)&&this.removeFile(a)}return null}},{key:"resizeImage",value:function(e,i,n,r,o){var a=this;return this.createThumbnail(e,i,n,r,!1,function(i,n){if(null==n)return o(e);var r=a.options.resizeMimeType;null==r&&(r=e.type);var l=n.toDataURL(r,a.options.resizeQuality);return"image/jpeg"!==r&&"image/jpg"!==r||(l=ExifRestore.restore(e.dataURL,l)),o(t.dataURItoBlob(l))})}},{key:"createThumbnail",value:function(e,t,i,n,r,o){var a=this,l=new FileReader;return l.onload=function(){return e.dataURL=l.result,"image/svg+xml"===e.type?void(null!=o&&o(l.result)):a.createThumbnailFromUrl(e,t,i,n,r,o)},l.readAsDataURL(e)}},{key:"createThumbnailFromUrl",value:function(e,t,i,n,r,o,a){var l=this,s=document.createElement("img");return a&&(s.crossOrigin=a),s.onload=function(){var a=function(e){return e(1)};return"undefined"!=typeof EXIF&&null!==EXIF&&r&&(a=function(e){return EXIF.getData(s,function(){return e(EXIF.getTag(this,"Orientation"))})}),a(function(r){e.width=s.width,e.height=s.height;var a=l.options.resize.call(l,e,t,i,n),u=document.createElement("canvas"),d=u.getContext("2d");switch(u.width=a.trgWidth,u.height=a.trgHeight,r>4&&(u.width=a.trgHeight,u.height=a.trgWidth),r){case 2:d.translate(u.width,0),d.scale(-1,1);break;case 3:d.translate(u.width,u.height),d.rotate(Math.PI);break;case 4:d.translate(0,u.height),d.scale(1,-1);break;case 5:d.rotate(.5*Math.PI),d.scale(1,-1);break;case 6:d.rotate(.5*Math.PI),d.translate(0,-u.height);break;case 7:d.rotate(.5*Math.PI),d.translate(u.width,-u.height),d.scale(-1,1);break;case 8:d.rotate(-.5*Math.PI),d.translate(-u.width,0)}drawImageIOSFix(d,s,null!=a.srcX?a.srcX:0,null!=a.srcY?a.srcY:0,a.srcWidth,a.srcHeight,null!=a.trgX?a.trgX:0,null!=a.trgY?a.trgY:0,a.trgWidth,a.trgHeight);var c=u.toDataURL("image/png");if(null!=o)return o(c,u)})},null!=o&&(s.onerror=o),s.src=e.dataURL}},{key:"processQueue",value:function(){var e=this.options.parallelUploads,t=this.getUploadingFiles().length,i=t;if(!(t>=e)){var n=this.getQueuedFiles();if(n.length>0){if(this.options.uploadMultiple)return this.processFiles(n.slice(0,e-t));for(;i=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;a.processing=!0,a.status=t.UPLOADING,this.emit("processing",a)}return this.options.uploadMultiple&&this.emit("processingmultiple",e),this.uploadFiles(e)}},{key:"_getFilesWithXhr",value:function(e){var t=void 0;return t=this.files.filter(function(t){return t.xhr===e}).map(function(e){return e})}},{key:"cancelUpload",value:function(e){if(e.status===t.UPLOADING){for(var i=this._getFilesWithXhr(e.xhr),n=i,r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l=a;l.status=t.CANCELED}"undefined"!=typeof e.xhr&&e.xhr.abort();for(var s=i,u=!0,d=0,s=u?s:s[Symbol.iterator]();;){var c;if(u){if(d>=s.length)break;c=s[d++]}else{if(d=s.next(),d.done)break;c=d.value}var p=c;this.emit("canceled",p)}this.options.uploadMultiple&&this.emit("canceledmultiple",i)}else e.status!==t.ADDED&&e.status!==t.QUEUED||(e.status=t.CANCELED,this.emit("canceled",e),this.options.uploadMultiple&&this.emit("canceledmultiple",[e]));if(this.options.autoProcessQueue)return this.processQueue()}},{key:"resolveOption",value:function(e){if("function"==typeof e){for(var t=arguments.length,i=Array(t>1?t-1:0),n=1;n=r.upload.totalChunkCount)){a++;var l=n*i.options.chunkSize,s=Math.min(l+i.options.chunkSize,r.size),u={name:i._getParamName(0),data:o.webkitSlice?o.webkitSlice(l,s):o.slice(l,s),filename:r.upload.filename,chunkIndex:n};r.upload.chunks[n]={file:r,index:n,dataBlock:u,status:t.UPLOADING,progress:0,retries:0},i._uploadData(e,[u])}};if(r.upload.finishedChunkUpload=function(n){var o=!0;n.status=t.SUCCESS,n.dataBlock=null;for(var a=0;a=o.length)break;s=o[l++]}else{if(l=o.next(),l.done)break;s=l.value}var u=s;u.xhr=r}e[0].upload.chunked&&(e[0].upload.chunks[i[0].chunkIndex].xhr=r);var d=this.resolveOption(this.options.method,e),c=this.resolveOption(this.options.url,e);r.open(d,c,!0),r.timeout=this.resolveOption(this.options.timeout,e),r.withCredentials=!!this.options.withCredentials,r.onload=function(t){n._finishedUploading(e,r,t)},r.onerror=function(){n._handleUploadError(e,r)};var p=null!=r.upload?r.upload:r;p.onprogress=function(t){return n._updateFilesUploadProgress(e,r,t)};var h={Accept:"application/json","Cache-Control":"no-cache","X-Requested-With":"XMLHttpRequest"};this.options.headers&&t.extend(h,this.options.headers);for(var f in h){var v=h[f];v&&r.setRequestHeader(f,v)}var m=new FormData;if(this.options.params){var g=this.options.params;"function"==typeof g&&(g=g.call(this,e,r,e[0].upload.chunked?this._getChunk(e[0],r):null));for(var k in g){var b=g[k];m.append(k,b)}}for(var y=e,F=!0,w=0,y=F?y:y[Symbol.iterator]();;){var x;if(F){if(w>=y.length)break;x=y[w++]}else{if(w=y.next(),w.done)break;x=w.value}var E=x;this.emit("sending",E,r,m)}this.options.uploadMultiple&&this.emit("sendingmultiple",e,r,m),this._addFormElementData(m);for(var z=0;z=t.length)break;r=t[n++]}else{if(n=t.next(),n.done)break;r=n.value}var o=r,a=o.getAttribute("name"),l=o.getAttribute("type");if(l&&(l=l.toLowerCase()),"undefined"!=typeof a&&null!==a)if("SELECT"===o.tagName&&o.hasAttribute("multiple"))for(var s=o.options,u=!0,d=0,s=u?s:s[Symbol.iterator]();;){var c;if(u){if(d>=s.length)break;c=s[d++]}else{if(d=s.next(),d.done)break;c=d.value}var p=c;p.selected&&e.append(a,p.value)}else(!l||"checkbox"!==l&&"radio"!==l||o.checked)&&e.append(a,o.value)}}},{key:"_updateFilesUploadProgress",value:function(e,t,i){var n=void 0;if("undefined"!=typeof i){if(n=100*i.loaded/i.total,e[0].upload.chunked){var r=e[0],o=this._getChunk(r,t);o.progress=n,o.total=i.total,o.bytesSent=i.loaded;r.upload.progress=0,r.upload.total=0,r.upload.bytesSent=0;for(var a=0;a=l.length)break;d=l[u++]}else{if(u=l.next(),u.done)break;d=u.value}var c=d;c.upload.progress=n,c.upload.total=i.total,c.upload.bytesSent=i.loaded}for(var p=e,h=!0,f=0,p=h?p:p[Symbol.iterator]();;){var v;if(h){if(f>=p.length)break;v=p[f++]}else{if(f=p.next(),f.done)break;v=f.value}var m=v;this.emit("uploadprogress",m,m.upload.progress,m.upload.bytesSent)}}else{var g=!0;n=100;for(var k=e,b=!0,y=0,k=b?k:k[Symbol.iterator]();;){var F;if(b){if(y>=k.length)break;F=k[y++]}else{if(y=k.next(),y.done)break;F=y.value}var w=F;100===w.upload.progress&&w.upload.bytesSent===w.upload.total||(g=!1),w.upload.progress=n,w.upload.bytesSent=w.upload.total}if(g)return;for(var x=e,E=!0,z=0,x=E?x:x[Symbol.iterator]();;){var C;if(E){if(z>=x.length)break;C=x[z++]}else{if(z=x.next(),z.done)break;C=z.value}var S=C;this.emit("uploadprogress",S,n,S.upload.bytesSent)}}}},{key:"_finishedUploading",value:function(e,i,n){var r=void 0;if(e[0].status!==t.CANCELED&&4===i.readyState){if("arraybuffer"!==i.responseType&&"blob"!==i.responseType&&(r=i.responseText,i.getResponseHeader("content-type")&&~i.getResponseHeader("content-type").indexOf("application/json")))try{r=JSON.parse(r)}catch(e){n=e,r="Invalid JSON response from server."}this._updateFilesUploadProgress(e),200<=i.status&&i.status<300?e[0].upload.chunked?e[0].upload.finishedChunkUpload(this._getChunk(e[0],i)):this._finished(e,r,n):this._handleUploadError(e,i,r)}}},{key:"_handleUploadError",value:function(e,i,n){if(e[0].status!==t.CANCELED){if(e[0].upload.chunked&&this.options.retryChunks){var r=this._getChunk(e[0],i);if(r.retries++=o.length)break;s=o[l++]}else{if(l=o.next(),l.done)break;s=l.value}this._errorProcessing(e,n||this.options.dictResponseError.replace("{{statusCode}}",i.status),i)}}}},{key:"submitRequest",value:function(e,t,i){e.send(t)}},{key:"_finished",value:function(e,i,n){for(var r=e,o=!0,a=0,r=o?r:r[Symbol.iterator]();;){var l;if(o){if(a>=r.length)break;l=r[a++]}else{if(a=r.next(),a.done)break;l=a.value}var s=l;s.status=t.SUCCESS,this.emit("success",s,i,n),this.emit("complete",s)}if(this.options.uploadMultiple&&(this.emit("successmultiple",e,i,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}},{key:"_errorProcessing",value:function(e,i,n){for(var r=e,o=!0,a=0,r=o?r:r[Symbol.iterator]();;){var l;if(o){if(a>=r.length)break;l=r[a++]}else{if(a=r.next(),a.done)break;l=a.value}var s=l;s.status=t.ERROR,this.emit("error",s,i,n),this.emit("complete",s)}if(this.options.uploadMultiple&&(this.emit("errormultiple",e,i,n),this.emit("completemultiple",e)),this.options.autoProcessQueue)return this.processQueue()}}],[{key:"uuidv4",value:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0,i="x"===e?t:3&t|8;return i.toString(16)})}}]),t}(Emitter);Dropzone.initClass(),Dropzone.version="5.3.1",Dropzone.options={},Dropzone.optionsForElement=function(e){return e.getAttribute("id")?Dropzone.options[camelize(e.getAttribute("id"))]:void 0},Dropzone.instances=[],Dropzone.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},Dropzone.autoDiscover=!0,Dropzone.discover=function(){var e=void 0;if(document.querySelectorAll)e=document.querySelectorAll(".dropzone");else{e=[];var t=function(t){return function(){for(var i=[],n=t,r=!0,o=0,n=r?n:n[Symbol.iterator]();;){var a;if(r){if(o>=n.length)break;a=n[o++]}else{if(o=n.next(),o.done)break;a=o.value}var l=a;/(^| )dropzone($| )/.test(l.className)?i.push(e.push(l)):i.push(void 0)}return i}()};t(document.getElementsByTagName("div")),t(document.getElementsByTagName("form"))}return function(){for(var t=[],i=e,n=!0,r=0,i=n?i:i[Symbol.iterator]();;){var o;if(n){if(r>=i.length)break;o=i[r++]}else{if(r=i.next(),r.done)break;o=r.value}var a=o;Dropzone.optionsForElement(a)!==!1?t.push(new Dropzone(a)):t.push(void 0)}return t}()},Dropzone.blacklistedBrowsers=[/opera.*(Macintosh|Windows Phone).*version\/12/i],Dropzone.isBrowserSupported=function(){var e=!0;if(window.File&&window.FileReader&&window.FileList&&window.Blob&&window.FormData&&document.querySelector)if("classList"in document.createElement("a"))for(var t=Dropzone.blacklistedBrowsers,i=!0,n=0,t=i?t:t[Symbol.iterator]();;){var r;if(i){if(n>=t.length)break;r=t[n++]}else{if(n=t.next(),n.done)break;r=n.value}var o=r;o.test(navigator.userAgent)&&(e=!1)}else e=!1;else e=!1;return e},Dropzone.dataURItoBlob=function(e){for(var t=atob(e.split(",")[1]),i=e.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(t.length),r=new Uint8Array(n),o=0,a=t.length,l=0<=a;l?o<=a:o>=a;l?o++:o--)r[o]=t.charCodeAt(o);return new Blob([n],{type:i})};var without=function(e,t){return e.filter(function(e){return e!==t}).map(function(e){return e})},camelize=function(e){return e.replace(/[\-_](\w)/g,function(e){return e.charAt(1).toUpperCase()})};Dropzone.createElement=function(e){var t=document.createElement("div");return t.innerHTML=e,t.childNodes[0]},Dropzone.elementInside=function(e,t){if(e===t)return!0;for(;e=e.parentNode;)if(e===t)return!0;return!1},Dropzone.getElement=function(e,t){var i=void 0;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},Dropzone.getElements=function(e,t){var i=void 0,n=void 0;if(e instanceof Array){n=[];try{for(var r=e,o=!0,a=0,r=o?r:r[Symbol.iterator]();;){if(o){if(a>=r.length)break;i=r[a++]}else{if(a=r.next(),a.done)break;i=a.value}n.push(this.getElement(i,t))}}catch(e){n=null}}else if("string"==typeof e){n=[];for(var l=document.querySelectorAll(e),s=!0,u=0,l=s?l:l[Symbol.iterator]();;){if(s){if(u>=l.length)break;i=l[u++]}else{if(u=l.next(),u.done)break;i=u.value}n.push(i)}}else null!=e.nodeType&&(n=[e]);if(null==n||!n.length)throw new Error("Invalid `"+t+"` option provided. Please provide a CSS selector, a plain HTML element or a list of those.");return n},Dropzone.confirm=function(e,t,i){return window.confirm(e)?t():null!=i?i():void 0},Dropzone.isValidFile=function(e,t){if(!t)return!0;t=t.split(",");for(var i=e.type,n=i.replace(/\/.*$/,""),r=t,o=!0,a=0,r=o?r:r[Symbol.iterator]();;){var l;if(o){if(a>=r.length)break;l=r[a++]}else{if(a=r.next(),a.done)break;l=a.value}var s=l;if(s=s.trim(),"."===s.charAt(0)){if(e.name.toLowerCase().indexOf(s.toLowerCase(),e.name.length-s.length)!==-1)return!0}else if(/\/\*$/.test(s)){if(n===s.replace(/\/.*$/,""))return!0}else if(i===s)return!0}return!1},"undefined"!=typeof jQuery&&null!==jQuery&&(jQuery.fn.dropzone=function(e){return this.each(function(){return new Dropzone(this,e)})}),"undefined"!=typeof module&&null!==module?module.exports=Dropzone:window.Dropzone=Dropzone,Dropzone.ADDED="added",Dropzone.QUEUED="queued",Dropzone.ACCEPTED=Dropzone.QUEUED,Dropzone.UPLOADING="uploading",Dropzone.PROCESSING=Dropzone.UPLOADING,Dropzone.CANCELED="canceled",Dropzone.ERROR="error",Dropzone.SUCCESS="success";var detectVerticalSquash=function(e){var t=(e.naturalWidth,e.naturalHeight),i=document.createElement("canvas");i.width=1,i.height=t;var n=i.getContext("2d");n.drawImage(e,0,0);for(var r=n.getImageData(1,0,1,t),o=r.data,a=0,l=t,s=t;s>a;){var u=o[4*(s-1)+3];0===u?l=s:a=s,s=l+a>>1}var d=s/t;return 0===d?1:d},drawImageIOSFix=function(e,t,i,n,r,o,a,l,s,u){var d=detectVerticalSquash(t);return e.drawImage(t,i,n,r,o,a,l,s,u/d)},ExifRestore=function(){function e(){_classCallCheck(this,e)}return _createClass(e,null,[{key:"initClass",value:function(){this.KEY_STR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}},{key:"encode64",value:function(e){for(var t="",i=void 0,n=void 0,r="",o=void 0,a=void 0,l=void 0,s="",u=0;;)if(i=e[u++],n=e[u++],r=e[u++],o=i>>2,a=(3&i)<<4|n>>4,l=(15&n)<<2|r>>6,s=63&r,isNaN(n)?l=s=64:isNaN(r)&&(s=64),t=t+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(a)+this.KEY_STR.charAt(l)+this.KEY_STR.charAt(s),i=n=r="",o=a=l=s="",!(ue.length)break}return i}},{key:"decode64",value:function(e){var t=void 0,i=void 0,n="",r=void 0,o=void 0,a=void 0,l="",s=0,u=[],d=/[^A-Za-z0-9\+\/\=]/g;for(d.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,"");;)if(r=this.KEY_STR.indexOf(e.charAt(s++)),o=this.KEY_STR.indexOf(e.charAt(s++)),a=this.KEY_STR.indexOf(e.charAt(s++)),l=this.KEY_STR.indexOf(e.charAt(s++)),t=r<<2|o>>4,i=(15&o)<<4|a>>2,n=(3&a)<<6|l,u.push(t),64!==a&&u.push(i),64!==l&&u.push(n),t=i=n="",r=o=a=l="",!(s