"use strict";Dropzone.autoDiscover=!1;var previewNode=document.querySelector("#template");previewNode.id="";var previewTemplate=previewNode.parentNode.innerHTML;previewNode.parentNode.removeChild(previewNode);var myDropzone=new Dropzone(document.body,{url:"https://www.cssninja.io/dropzone.php",thumbnailWidth:800,thumbnailHeight:600,parallelUploads:20,previewTemplate:previewTemplate,autoQueue:!1,previewsContainer:"#previews",clickable:".fileinput-button"});myDropzone.on("addedfile",(function(e){e.previewElement.querySelector(".start").onclick=function(){myDropzone.enqueueFile(e)},feather.replace()})),myDropzone.on("totaluploadprogress",(function(e){document.querySelector("#total-progress .progress-bar").style.width=e+"%"})),myDropzone.on("sending",(function(e){document.querySelector("#total-progress").style.opacity="1",e.previewElement.querySelector(".start").setAttribute("disabled","disabled")})),myDropzone.on("queuecomplete",(function(e){document.querySelector("#total-progress").style.opacity="0"})),document.querySelector("#actions .start").onclick=function(){myDropzone.enqueueFiles(myDropzone.getFilesWithStatus(Dropzone.ADDED))},document.querySelector("#actions .cancel").onclick=function(){myDropzone.removeAllFiles(!0)};var minSteps=6,maxSteps=60,timeBetweenSteps=100,bytesPerStep=1e5;myDropzone.uploadFiles=function(e){for(var t=this,o=0;o<e.length;o++)for(var r=e[o],n=Math.round(Math.min(maxSteps,Math.max(minSteps,r.size/bytesPerStep))),i=0;i<n;i++){var p=timeBetweenSteps*(i+1);setTimeout(function(e,o,r){return function(){e.upload={progress:100*(r+1)/o,total:e.size,bytesSent:(r+1)*e.size/o},t.emit("uploadprogress",e,e.upload.progress,e.upload.bytesSent),100==e.upload.progress&&(e.status=Dropzone.SUCCESS,t.emit("success",e,"success",null),t.emit("complete",e),t.processQueue())}}(r,n,i),p)}};