(function(e){"use strict";if(typeof define==="function"&&define.amd){define(["jquery","load-image","load-image-meta","load-image-exif","load-image-ios","canvas-to-blob","./jquery.fileupload-process.min"],e)}else{e(window.jQuery,window.loadImage)}})(function(l,d){"use strict";l.blueimp.fileupload.prototype.options.processQueue.unshift({action:"loadImageMetaData",disableImageHead:"@",disableExif:"@",disableExifThumbnail:"@",disableExifSub:"@",disableExifGps:"@",disabled:"@disableImageMetaDataLoad"},{action:"loadImage",prefix:true,fileTypes:"@",maxFileSize:"@",noRevoke:"@",disabled:"@disableImageLoad"},{action:"resizeImage",prefix:"image",maxWidth:"@",maxHeight:"@",minWidth:"@",minHeight:"@",crop:"@",orientation:"@",forceResize:"@",disabled:"@disableImageResize"},{action:"saveImage",quality:"@imageQuality",type:"@imageType",disabled:"@disableImageResize"},{action:"saveImageMetaData",disabled:"@disableImageMetaDataSave"},{action:"resizeImage",prefix:"preview",maxWidth:"@",maxHeight:"@",minWidth:"@",minHeight:"@",crop:"@",orientation:"@",thumbnail:"@",canvas:"@",disabled:"@disableImagePreview"},{action:"setImage",name:"@imagePreviewName",disabled:"@disableImagePreview"},{action:"deleteImageReferences",disabled:"@disableImageReferencesDeletion"});l.widget("blueimp.fileupload",l.blueimp.fileupload,{options:{loadImageFileTypes:/^image\/(gif|jpeg|png)$/,loadImageMaxFileSize:1e7,imageMaxWidth:1920,imageMaxHeight:1080,imageOrientation:false,imageCrop:false,disableImageResize:true,previewMaxWidth:80,previewMaxHeight:80,previewOrientation:true,previewThumbnail:true,previewCrop:false,previewCanvas:true},processActions:{loadImage:function(i,e){if(e.disabled){return i}var a=this,t=i.files[i.index],n=l.Deferred();if(l.type(e.maxFileSize)==="number"&&t.size>e.maxFileSize||e.fileTypes&&!e.fileTypes.test(t.type)||!d(t,function(e){if(e.src){i.img=e}n.resolveWith(a,[i])},e)){return i}return n.promise()},resizeImage:function(i,a){if(a.disabled||!(i.canvas||i.img)){return i}a=l.extend({canvas:true},a);var t=this,n=l.Deferred(),s=a.canvas&&i.canvas||i.img,e=function(e){if(e&&(e.width!==s.width||e.height!==s.height||a.forceResize)){i[e.getContext?"canvas":"img"]=e}i.preview=e;n.resolveWith(t,[i])},r;if(i.exif){if(a.orientation===true){a.orientation=i.exif.get("Orientation")}if(a.thumbnail){r=i.exif.get("Thumbnail");if(r){d(r,e,a);return n.promise()}}}if(s){e(d.scale(s,a));return n.promise()}return i},saveImage:function(i,e){if(!i.canvas||e.disabled){return i}var a=this,t=i.files[i.index],n=l.Deferred();if(i.canvas.toBlob){i.canvas.toBlob(function(e){if(!e.name){if(t.type===e.type){e.name=t.name}else if(t.name){e.name=t.name.replace(/\..+$/,"."+e.type.substr(6))}}if(t.type!==e.type){delete i.imageHead}i.files[i.index]=e;n.resolveWith(a,[i])},e.type||t.type,e.quality)}else{return i}return n.promise()},loadImageMetaData:function(i,e){if(e.disabled){return i}var a=this,t=l.Deferred();d.parseMetaData(i.files[i.index],function(e){l.extend(i,e);t.resolveWith(a,[i])},e);return t.promise()},saveImageMetaData:function(e,i){if(!(e.imageHead&&e.canvas&&e.canvas.toBlob&&!i.disabled)){return e}var a=e.files[e.index],t=new Blob([e.imageHead,this._blobSlice.call(a,20)],{type:a.type});t.name=a.name;e.files[e.index]=t;return e},setImage:function(e,i){if(e.preview&&!i.disabled){e.files[e.index][i.name||"preview"]=e.preview}return e},deleteImageReferences:function(e,i){if(!i.disabled){delete e.img;delete e.canvas;delete e.preview;delete e.imageHead}return e}}})});