Add backload

This commit is contained in:
2016-11-17 15:02:29 -05:00
parent eeacfebec9
commit a3b8b7a881
263 changed files with 29788 additions and 18 deletions
@@ -0,0 +1,111 @@
/*
* JavaScript Canvas to Blob
* https://github.com/blueimp/JavaScript-Canvas-to-Blob
*
* Copyright 2012, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*
* Based on stackoverflow user Stoive's code snippet:
* http://stackoverflow.com/q/4998908
*/
/*global window, atob, Blob, ArrayBuffer, Uint8Array, define, module */
;(function (window) {
'use strict'
var CanvasPrototype = window.HTMLCanvasElement &&
window.HTMLCanvasElement.prototype
var hasBlobConstructor = window.Blob && (function () {
try {
return Boolean(new Blob())
} catch (e) {
return false
}
}())
var hasArrayBufferViewSupport = hasBlobConstructor && window.Uint8Array &&
(function () {
try {
return new Blob([new Uint8Array(100)]).size === 100
} catch (e) {
return false
}
}())
var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder ||
window.MozBlobBuilder || window.MSBlobBuilder
var dataURIPattern = /^data:((.*?)(;charset=.*?)?)(;base64)?,/
var dataURLtoBlob = (hasBlobConstructor || BlobBuilder) && window.atob &&
window.ArrayBuffer && window.Uint8Array &&
function (dataURI) {
var matches,
mediaType,
isBase64,
dataString,
byteString,
arrayBuffer,
intArray,
i,
bb
// Parse the dataURI components as per RFC 2397
matches = dataURI.match(dataURIPattern)
if (!matches) {
throw new Error('invalid data URI')
}
// Default to text/plain;charset=US-ASCII
mediaType = matches[2]
? matches[1]
: 'text/plain' + (matches[3] || ';charset=US-ASCII')
isBase64 = !!matches[4]
dataString = dataURI.slice(matches[0].length)
if (isBase64) {
// Convert base64 to raw binary data held in a string:
byteString = atob(dataString)
} else {
// Convert base64/URLEncoded data component to raw binary:
byteString = decodeURIComponent(dataString)
}
// Write the bytes of the string to an ArrayBuffer:
arrayBuffer = new ArrayBuffer(byteString.length)
intArray = new Uint8Array(arrayBuffer)
for (i = 0; i < byteString.length; i += 1) {
intArray[i] = byteString.charCodeAt(i)
}
// Write the ArrayBuffer (or ArrayBufferView) to a blob:
if (hasBlobConstructor) {
return new Blob(
[hasArrayBufferViewSupport ? intArray : arrayBuffer],
{type: mediaType}
)
}
bb = new BlobBuilder()
bb.append(arrayBuffer)
return bb.getBlob(mediaType)
}
if (window.HTMLCanvasElement && !CanvasPrototype.toBlob) {
if (CanvasPrototype.mozGetAsFile) {
CanvasPrototype.toBlob = function (callback, type, quality) {
if (quality && CanvasPrototype.toDataURL && dataURLtoBlob) {
callback(dataURLtoBlob(this.toDataURL(type, quality)))
} else {
callback(this.mozGetAsFile('blob', type))
}
}
} else if (CanvasPrototype.toDataURL && dataURLtoBlob) {
CanvasPrototype.toBlob = function (callback, type, quality) {
callback(dataURLtoBlob(this.toDataURL(type, quality)))
}
}
}
if (typeof define === 'function' && define.amd) {
define(function () {
return dataURLtoBlob
})
} else if (typeof module === 'object' && module.exports) {
module.exports = dataURLtoBlob
} else {
window.dataURLtoBlob = dataURLtoBlob
}
}(window))
@@ -0,0 +1,2 @@
!function(t){"use strict";var e=t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype,o=t.Blob&&function(){try{return Boolean(new Blob)}catch(t){return!1}}(),n=o&&t.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(t){return!1}}(),r=t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,a=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,i=(o||r)&&t.atob&&t.ArrayBuffer&&t.Uint8Array&&function(t){var e,i,l,u,b,c,d,B,f;if(e=t.match(a),!e)throw new Error("invalid data URI");for(i=e[2]?e[1]:"text/plain"+(e[3]||";charset=US-ASCII"),l=!!e[4],u=t.slice(e[0].length),b=l?atob(u):decodeURIComponent(u),c=new ArrayBuffer(b.length),d=new Uint8Array(c),B=0;B<b.length;B+=1)d[B]=b.charCodeAt(B);return o?new Blob([n?d:c],{type:i}):(f=new r,f.append(c),f.getBlob(i))};t.HTMLCanvasElement&&!e.toBlob&&(e.mozGetAsFile?e.toBlob=function(t,o,n){t(n&&e.toDataURL&&i?i(this.toDataURL(o,n)):this.mozGetAsFile("blob",o))}:e.toDataURL&&i&&(e.toBlob=function(t,e,o){t(i(this.toDataURL(e,o)))})),"function"==typeof define&&define.amd?define(function(){return i}):"object"==typeof module&&module.exports?module.exports=i:t.dataURLtoBlob=i}(window);
//# sourceMappingURL=canvas-to-blob.min.js.map
@@ -0,0 +1,36 @@
{
"name": "blueimp-canvas-to-blob",
"version": "3.3.0",
"title": "JavaScript Canvas to Blob",
"description": "Canvas to Blob is a polyfill for the standard JavaScript canvas.toBlob method. It can be used to create Blob objects from an HTML canvas element.",
"keywords": [
"javascript",
"canvas",
"blob",
"convert",
"conversion"
],
"homepage": "https://github.com/blueimp/JavaScript-Canvas-to-Blob",
"author": {
"name": "Sebastian Tschan",
"url": "https://blueimp.net"
},
"repository": {
"type": "git",
"url": "git://github.com/blueimp/JavaScript-Canvas-to-Blob.git"
},
"license": "MIT",
"main": "./js/canvas-to-blob.js",
"devDependencies": {
"mocha-phantomjs": "4.0.1",
"standard": "6.0.7",
"uglify-js": "2.6.1"
},
"scripts": {
"test": "standard js/*.js test/*.js && mocha-phantomjs test/index.html",
"build": "cd js && uglifyjs canvas-to-blob.js -c -m -o canvas-to-blob.min.js --source-map canvas-to-blob.min.js.map",
"preversion": "npm test",
"version": "npm run build && git add -A js",
"postversion": "git push --tags origin master master:gh-pages && npm publish"
}
}
@@ -0,0 +1,9 @@
Bundles all css files used by the jQuery File Upload Plugin
and can be used with all themes.
Bundle: jquery.fileupload.bundle.min.css
Theme: All themes
Files included:
<link href="~/Backload/Client/blueimp/fileupload/css/jquery.fileupload.css" rel="stylesheet" />
<link href="~/Backload/Client/blueimp/fileupload/css/jquery.fileupload-ui.css" rel="stylesheet" />
@@ -0,0 +1 @@
@charset "UTF-8";.fileinput-button{position:relative;overflow:hidden;display:inline-block}.fileinput-button input{position:absolute;top:0;right:0;margin:0;opacity:0;-ms-filter:'alpha(opacity=0)';font-size:200px !important;direction:ltr;cursor:pointer}@media screen\9{.fileinput-button input{filter:alpha(opacity=0);font-size:100%;height:100%}}@charset "UTF-8";.fileupload-buttonbar .btn,.fileupload-buttonbar .toggle{margin-bottom:5px}.progress-animated .progress-bar,.progress-animated .bar{background:url("../img/progressbar.gif") !important;filter:none}.fileupload-process{float:right;display:none}.fileupload-processing .fileupload-process,.files .processing .preview{display:block;width:32px;height:32px;background:url("../img/loading.gif") center no-repeat;background-size:contain}.files audio,.files video{max-width:300px}@media(max-width:767px){.fileupload-buttonbar .toggle,.files .toggle,.files .btn span{display:none}.files .name{width:80px;word-wrap:break-word}.files audio,.files video{max-width:80px}.files img,.files canvas{max-width:100%}}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

@@ -0,0 +1,78 @@
Bundles Javascript files used different themes of the jQuery File Upload Plugin
(In case of problems include the single files from the blueimp/fileupload folder)
Bundle: jquery.fileupload.basic.min.js
Theme: Basic
Files included:
<script src="~/Backload/Client/blueimp/fileupload/js/vendor/jquery.ui.widget.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.iframe-transport.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/themes/jquery.fileupload-themes.js"></script>
Bundle: jquery.fileupload.basicplus.min.js
Theme: BasicPlus
Files included:
<script src="~/Backload/Client/blueimp/loadimage/js/load-image.all.min.js"></script>
<script src="~/Backload/Client/blueimp/blob/js/canvas-to-blob.min.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/vendor/jquery.ui.widget.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.iframe-transport.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-process.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-image.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-audio.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-video.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-validate.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/themes/jquery.fileupload-themes.js"></script>
Bundle: jquery.fileupload.basicplusui.min.js
Theme: BasicPlusUi
Files included:
<script src="~/Backload/Client/blueimp/templates/js/tmpl.min.js"></script>
<script src="~/Backload/Client/blueimp/loadimage/js/load-image.all.min.js"></script>
<script src="~/Backload/Client/blueimp/blob/js/canvas-to-blob.min.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/vendor/jquery.ui.widget.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.iframe-transport.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-process.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-image.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-audio.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-video.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-validate.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-ui.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/themes/jquery.fileupload-themes.js"></script>
Bundle: jquery.fileupload.angularjs.min.js
Theme: AngularJS
Files included:
<script src="~/Backload/Client/blueimp/loadimage/js/load-image.all.min.js"></script>
<script src="~/Backload/Client/blueimp/blob/js/canvas-to-blob.min.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/vendor/jquery.ui.widget.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.iframe-transport.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-process.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-image.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-audio.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-video.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-validate.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-angular.js"></script>
Bundle: jquery.fileupload.jqueryui.min.js
Theme: JQueryUI
Files included:
<script src="~/Backload/Client/blueimp/templates/js/tmpl.min.js"></script>
<script src="~/Backload/Client/blueimp/loadimage/js/load-image.all.min.js"></script>
<script src="~/Backload/Client/blueimp/blob/js/canvas-to-blob.min.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.iframe-transport.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-process.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-image.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-audio.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-video.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-validate.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-ui.js"></script>
<script src="~/Backload/Client/blueimp/fileupload/js/jquery.fileupload-jquery-ui.js"></script>
@@ -0,0 +1,122 @@
(function(b){"function"===typeof define&&define.amd?define(["jquery"],b):"object"===typeof exports?b(require("jquery")):b(jQuery)})(function(b){var g=0,a=Array.prototype.slice;b.cleanData=function(a){return function(c){var f,e,h;for(h=0;null!=(e=c[h]);h++)try{(f=b._data(e,"events"))&&f.remove&&b(e).triggerHandler("remove")}catch(k){}a(c)}}(b.cleanData);b.widget=function(a,c,f){var e,h,k,g,n={},l=a.split(".")[0];a=a.split(".")[1];e=l+"-"+a;f||(f=c,c=b.Widget);b.expr[":"][e.toLowerCase()]=function(a){return!!b.data(a,
e)};b[l]=b[l]||{};h=b[l][a];k=b[l][a]=function(a,d){if(!this._createWidget)return new k(a,d);arguments.length&&this._createWidget(a,d)};b.extend(k,h,{version:f.version,_proto:b.extend({},f),_childConstructors:[]});g=new c;g.options=b.widget.extend({},g.options);b.each(f,function(a,d){b.isFunction(d)?n[a]=function(){var b=function(){return c.prototype[a].apply(this,arguments)},e=function(d){return c.prototype[a].apply(this,d)};return function(){var a=this._super,c=this._superApply,f;this._super=b;
this._superApply=e;f=d.apply(this,arguments);this._super=a;this._superApply=c;return f}}():n[a]=d});k.prototype=b.widget.extend(g,{widgetEventPrefix:h?g.widgetEventPrefix||a:a},n,{constructor:k,namespace:l,widgetName:a,widgetFullName:e});h?(b.each(h._childConstructors,function(a,d){var c=d.prototype;b.widget(c.namespace+"."+c.widgetName,k,d._proto)}),delete h._childConstructors):c._childConstructors.push(k);b.widget.bridge(a,k);return k};b.widget.extend=function(d){for(var c=a.call(arguments,1),f=
0,e=c.length,h,k;f<e;f++)for(h in c[f])k=c[f][h],c[f].hasOwnProperty(h)&&void 0!==k&&(b.isPlainObject(k)?d[h]=b.isPlainObject(d[h])?b.widget.extend({},d[h],k):b.widget.extend({},k):d[h]=k);return d};b.widget.bridge=function(d,c){var f=c.prototype.widgetFullName||d;b.fn[d]=function(e){var h="string"===typeof e,k=a.call(arguments,1),g=this;h?this.each(function(){var a,c=b.data(this,f);if("instance"===e)return g=c,!1;if(!c)return b.error("cannot call methods on "+d+" prior to initialization; attempted to call method '"+
e+"'");if(!b.isFunction(c[e])||"_"===e.charAt(0))return b.error("no such method '"+e+"' for "+d+" widget instance");a=c[e].apply(c,k);if(a!==c&&void 0!==a)return g=a&&a.jquery?g.pushStack(a.get()):a,!1}):(k.length&&(e=b.widget.extend.apply(null,[e].concat(k))),this.each(function(){var a=b.data(this,f);a?(a.option(e||{}),a._init&&a._init()):b.data(this,f,new c(e,this))}));return g}};b.Widget=function(){};b.Widget._childConstructors=[];b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",
options:{disabled:!1,create:null},_createWidget:function(a,c){c=b(c||this.defaultElement||this)[0];this.element=b(c);this.uuid=g++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=b();this.hoverable=b();this.focusable=b();c!==this&&(b.data(c,this.widgetFullName,this),this._on(!0,this.element,{remove:function(a){a.target===c&&this.destroy()}}),this.document=b(c.style?c.ownerDocument:c.document||c),this.window=b(this.document[0].defaultView||this.document[0].parentWindow));this.options=
b.widget.extend({},this.options,this._getCreateOptions(),a);this._create();this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:b.noop,_getCreateEventData:b.noop,_create:b.noop,_init:b.noop,destroy:function(){this._destroy();this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(b.camelCase(this.widgetFullName));this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled");
this.bindings.unbind(this.eventNamespace);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")},_destroy:b.noop,widget:function(){return this.element},option:function(a,c){var f=a,e,h,k;if(0===arguments.length)return b.widget.extend({},this.options);if("string"===typeof a)if(f={},e=a.split("."),a=e.shift(),e.length){h=f[a]=b.widget.extend({},this.options[a]);for(k=0;k<e.length-1;k++)h[e[k]]=h[e[k]]||{},h=h[e[k]];a=e.pop();if(1===arguments.length)return void 0===
h[a]?null:h[a];h[a]=c}else{if(1===arguments.length)return void 0===this.options[a]?null:this.options[a];f[a]=c}this._setOptions(f);return this},_setOptions:function(a){for(var c in a)this._setOption(c,a[c]);return this},_setOption:function(a,c){this.options[a]=c;"disabled"===a&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!c),c&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")));return this},enable:function(){return this._setOptions({disabled:!1})},
disable:function(){return this._setOptions({disabled:!0})},_on:function(a,c,f){var e,h=this;"boolean"!==typeof a&&(f=c,c=a,a=!1);f?(c=e=b(c),this.bindings=this.bindings.add(c)):(f=c,c=this.element,e=this.widget());b.each(f,function(f,g){function n(){if(a||!0!==h.options.disabled&&!b(this).hasClass("ui-state-disabled"))return("string"===typeof g?h[g]:g).apply(h,arguments)}"string"!==typeof g&&(n.guid=g.guid=g.guid||n.guid||b.guid++);var l=f.match(/^([\w:-]*)\s*(.*)$/),m=l[1]+h.eventNamespace;(l=l[2])?
e.delegate(l,m,n):c.bind(m,n)})},_off:function(a,c){c=(c||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;a.unbind(c).undelegate(c);this.bindings=b(this.bindings.not(a).get());this.focusable=b(this.focusable.not(a).get());this.hoverable=b(this.hoverable.not(a).get())},_delay:function(a,c){var b=this;return setTimeout(function(){return("string"===typeof a?b[a]:a).apply(b,arguments)},c||0)},_hoverable:function(a){this.hoverable=this.hoverable.add(a);this._on(a,{mouseenter:function(a){b(a.currentTarget).addClass("ui-state-hover")},
mouseleave:function(a){b(a.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(a){this.focusable=this.focusable.add(a);this._on(a,{focusin:function(a){b(a.currentTarget).addClass("ui-state-focus")},focusout:function(a){b(a.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(a,c,f){var e,h=this.options[a];f=f||{};c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();c.target=this.element[0];if(a=c.originalEvent)for(e in a)e in c||
(c[e]=a[e]);this.element.trigger(c,f);return!(b.isFunction(h)&&!1===h.apply(this.element[0],[c].concat(f))||c.isDefaultPrevented())}};b.each({show:"fadeIn",hide:"fadeOut"},function(a,c){b.Widget.prototype["_"+a]=function(f,e,h){"string"===typeof e&&(e={effect:e});var k,g=e?!0===e||"number"===typeof e?c:e.effect||c:a;e=e||{};"number"===typeof e&&(e={duration:e});k=!b.isEmptyObject(e);e.complete=h;e.delay&&f.delay(e.delay);if(k&&b.effects&&b.effects.effect[g])f[a](e);else if(g!==a&&f[g])f[g](e.duration,
e.easing,h);else f.queue(function(c){b(this)[a]();h&&h.call(f[0]);c()})}})});
!function(b){var g=function(a,c,b){var e,h,k=document.createElement("img");if(k.onerror=c,k.onload=function(){!h||b&&b.noRevoke||g.revokeObjectURL(h);c&&c(g.scale(k,b))},g.isInstanceOf("Blob",a)||g.isInstanceOf("File",a))e=h=g.createObjectURL(a),k._type=a.type;else{if("string"!=typeof a)return!1;e=a;b&&b.crossOrigin&&(k.crossOrigin=b.crossOrigin)}return e?(k.src=e,k):g.readFile(a,function(a){var d=a.target;d&&d.result?k.src=d.result:c&&c(a)})},a=window.createObjectURL&&window||window.URL&&URL.revokeObjectURL&&
URL||window.webkitURL&&webkitURL;g.isInstanceOf=function(a,c){return Object.prototype.toString.call(c)==="[object "+a+"]"};g.transformCoordinates=function(){};g.getTransformedOptions=function(a,c){var b,e,h,k,g=c.aspectRatio;if(!g)return c;b={};for(e in c)c.hasOwnProperty(e)&&(b[e]=c[e]);return b.crop=!0,h=a.naturalWidth||a.width,k=a.naturalHeight||a.height,h/k>g?(b.maxWidth=k*g,b.maxHeight=k):(b.maxWidth=h,b.maxHeight=h/g),b};g.renderImageToCanvas=function(a,c,b,e,h,g,p,n,l,m){return a.getContext("2d").drawImage(c,
b,e,h,g,p,n,l,m),a};g.hasCanvasOption=function(a){return a.canvas||a.crop||!!a.aspectRatio};g.scale=function(a,c){function b(){var a=Math.max((p||r)/r,(n||t)/t);1<a&&(r*=a,t*=a)}function e(){var a=Math.min((h||r)/r,(k||t)/t);1>a&&(r*=a,t*=a)}c=c||{};var h,k,p,n,l,m,q,u,w,x,A,v=document.createElement("canvas"),B=a.getContext||g.hasCanvasOption(c)&&v.getContext,y=a.naturalWidth||a.width,z=a.naturalHeight||a.height,r=y,t=z;if(B&&(c=g.getTransformedOptions(a,c),q=c.left||0,u=c.top||0,c.sourceWidth?(l=
c.sourceWidth,void 0!==c.right&&void 0===c.left&&(q=y-l-c.right)):l=y-q-(c.right||0),c.sourceHeight?(m=c.sourceHeight,void 0!==c.bottom&&void 0===c.top&&(u=z-m-c.bottom)):m=z-u-(c.bottom||0),r=l,t=m),h=c.maxWidth,k=c.maxHeight,p=c.minWidth,n=c.minHeight,B&&h&&k&&c.crop?(r=h,t=k,A=l/m-h/k,0>A?(m=k*l/h,void 0===c.top&&void 0===c.bottom&&(u=(z-m)/2)):0<A&&(l=h*m/k,void 0===c.left&&void 0===c.right&&(q=(y-l)/2))):((c.contain||c.cover)&&(p=h=h||p,n=k=k||n),c.cover?(e(),b()):(b(),e())),B){if(w=c.pixelRatio,
1<w&&(v.style.width=r+"px",v.style.height=t+"px",r*=w,t*=w,v.getContext("2d").scale(w,w)),x=c.downsamplingRatio,0<x&&1>x&&l>r&&m>t)for(;l*x>r;)v.width=l*x,v.height=m*x,g.renderImageToCanvas(v,a,q,u,l,m,0,0,v.width,v.height),l=v.width,m=v.height,a=document.createElement("canvas"),a.width=l,a.height=m,g.renderImageToCanvas(a,v,0,0,l,m,0,0,l,m);return v.width=r,v.height=t,g.transformCoordinates(v,c),g.renderImageToCanvas(v,a,q,u,l,m,0,0,r,t)}return a.width=r,a.height=t,a};g.createObjectURL=function(b){return a?
a.createObjectURL(b):!1};g.revokeObjectURL=function(b){return a?a.revokeObjectURL(b):!1};g.readFile=function(a,c,b){if(window.FileReader){var e=new FileReader;if(e.onload=e.onerror=c,b=b||"readAsDataURL",e[b])return e[b](a),e}return!1};"function"==typeof define&&define.amd?define(function(){return g}):"object"==typeof module&&module.exports?module.exports=g:b.loadImage=g}(window);
(function(b){"function"==typeof define&&define.amd?define(["./load-image"],b):b("object"==typeof module&&module.exports?require("./load-image"):window.loadImage)})(function(b){var g=b.hasCanvasOption,a=b.transformCoordinates,d=b.getTransformedOptions;b.hasCanvasOption=function(a){return!!a.orientation||g.call(b,a)};b.transformCoordinates=function(c,d){a.call(b,c,d);var e=c.getContext("2d"),h=c.width,g=c.height,p=c.style.width,n=c.style.height,l=d.orientation;if(l&&!(8<l))switch(4<l&&(c.width=g,c.height=
h,c.style.width=n,c.style.height=p),l){case 2:e.translate(h,0);e.scale(-1,1);break;case 3:e.translate(h,g);e.rotate(Math.PI);break;case 4:e.translate(0,g);e.scale(1,-1);break;case 5:e.rotate(.5*Math.PI);e.scale(1,-1);break;case 6:e.rotate(.5*Math.PI);e.translate(0,-g);break;case 7:e.rotate(.5*Math.PI);e.translate(h,-g);e.scale(-1,1);break;case 8:e.rotate(-.5*Math.PI),e.translate(-h,0)}};b.getTransformedOptions=function(a,f){var e,h,g=d.call(b,a,f);e=g.orientation;if(!e||8<e||1===e)return g;e={};for(h in g)g.hasOwnProperty(h)&&
(e[h]=g[h]);switch(g.orientation){case 2:e.left=g.right;e.right=g.left;break;case 3:e.left=g.right;e.top=g.bottom;e.right=g.left;e.bottom=g.top;break;case 4:e.top=g.bottom;e.bottom=g.top;break;case 5:e.left=g.top;e.top=g.left;e.right=g.bottom;e.bottom=g.right;break;case 6:e.left=g.top;e.top=g.right;e.right=g.bottom;e.bottom=g.left;break;case 7:e.left=g.bottom;e.top=g.right;e.right=g.top;e.bottom=g.left;break;case 8:e.left=g.bottom,e.top=g.left,e.right=g.top,e.bottom=g.right}return 4<g.orientation&&
(e.maxWidth=g.maxHeight,e.maxHeight=g.maxWidth,e.minWidth=g.minHeight,e.minHeight=g.minWidth,e.sourceWidth=g.sourceHeight,e.sourceHeight=g.sourceWidth),e}});
(function(b){"function"==typeof define&&define.amd?define(["./load-image"],b):b("object"==typeof module&&module.exports?require("./load-image"):window.loadImage)})(function(b){b.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice)&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)};b.metaDataParsers={jpeg:{65505:[]}};b.parseMetaData=function(g,a,d){d=d||{};var c=this,f=d.maxMetaDataSize||262144,e={};window.DataView&&
g&&12<=g.size&&"image/jpeg"===g.type&&b.blobSlice&&b.readFile(b.blobSlice.call(g,0,f),function(f){if(f.target.error)return console.log(f.target.error),void a(e);var g,p,n,l;f=f.target.result;var m=new DataView(f),q=2,u=m.byteLength-4;n=q;if(65496===m.getUint16(0)){for(;u>q&&(g=m.getUint16(q),65504<=g&&65519>=g||65534===g);){if(p=m.getUint16(q+2)+2,q+p>m.byteLength){console.log("Invalid meta data: Invalid segment size.");break}if(n=b.metaDataParsers.jpeg[g])for(l=0;l<n.length;l+=1)n[l].call(c,m,q,
p,e,d);n=q+=p}!d.disableImageHead&&6<n&&(f.slice?e.imageHead=f.slice(0,n):e.imageHead=(new Uint8Array(f)).subarray(0,n))}else console.log("Invalid JPEG file: Missing JPEG marker.");a(e)},"readAsArrayBuffer")||a(e)}});
(function(b){"function"==typeof define&&define.amd?define(["./load-image","./load-image-meta"],b):"object"==typeof module&&module.exports?b(require("./load-image"),require("./load-image-meta")):b(window.loadImage)})(function(b){b.ExifMap=function(){return this};b.ExifMap.prototype.map={Orientation:274};b.ExifMap.prototype.get=function(b){return this[b]||this[this.map[b]]};b.getExifThumbnail=function(b,a,d){var c,f,e;if(!d||a+d>b.byteLength)return void console.log("Invalid Exif data: Invalid thumbnail data.");
c=[];for(f=0;d>f;f+=1)e=b.getUint8(a+f),c.push((16>e?"0":"")+e.toString(16));return"data:image/jpeg,%"+c.join("%")};b.exifTagTypes={1:{getValue:function(b,a){return b.getUint8(a)},size:1},2:{getValue:function(b,a){return String.fromCharCode(b.getUint8(a))},size:1,ascii:!0},3:{getValue:function(b,a,d){return b.getUint16(a,d)},size:2},4:{getValue:function(b,a,d){return b.getUint32(a,d)},size:4},5:{getValue:function(b,a,d){return b.getUint32(a,d)/b.getUint32(a+4,d)},size:8},9:{getValue:function(b,a,
d){return b.getInt32(a,d)},size:4},10:{getValue:function(b,a,d){return b.getInt32(a,d)/b.getInt32(a+4,d)},size:8}};b.exifTagTypes[7]=b.exifTagTypes[1];b.getExifValue=function(g,a,d,c,f,e){var h,k,p;c=b.exifTagTypes[c];if(!c)return void console.log("Invalid Exif data: Invalid tag type.");if(h=c.size*f,k=4<h?a+g.getUint32(d+8,e):d+8,k+h>g.byteLength)return void console.log("Invalid Exif data: Invalid data offset.");if(1===f)return c.getValue(g,k,e);a=[];for(d=0;f>d;d+=1)a[d]=c.getValue(g,k+d*c.size,
e);if(c.ascii){g="";for(d=0;d<a.length&&(p=a[d],"\x00"!==p);d+=1)g+=p;return g}return a};b.parseExifTag=function(g,a,d,c,f){var e=g.getUint16(d,c);f.exif[e]=b.getExifValue(g,a,d,g.getUint16(d+2,c),g.getUint32(d+4,c),c)};b.parseExifTags=function(b,a,d,c,f){var e,h,k;if(d+6>b.byteLength)return void console.log("Invalid Exif data: Invalid directory offset.");if(e=b.getUint16(d,c),h=d+2+12*e,h+4>b.byteLength)return void console.log("Invalid Exif data: Invalid directory size.");for(k=0;e>k;k+=1)this.parseExifTag(b,
a,d+2+12*k,c,f);return b.getUint32(h,c)};b.parseExifData=function(g,a,d,c,f){if(!f.disableExif){var e,h;d=a+10;if(1165519206===g.getUint32(a+4)){if(d+8>g.byteLength)return void console.log("Invalid Exif data: Invalid segment size.");if(0!==g.getUint16(a+8))return void console.log("Invalid Exif data: Missing byte alignment offset.");switch(g.getUint16(d)){case 18761:a=!0;break;case 19789:a=!1;break;default:return void console.log("Invalid Exif data: Invalid byte alignment marker.")}if(42!==g.getUint16(d+
2,a))return void console.log("Invalid Exif data: Missing TIFF marker.");e=g.getUint32(d+4,a);c.exif=new b.ExifMap;(e=b.parseExifTags(g,d,d+e,a,c))&&!f.disableExifThumbnail&&(h={exif:{}},b.parseExifTags(g,d,d+e,a,h),h.exif[513]&&(c.exif.Thumbnail=b.getExifThumbnail(g,d+h.exif[513],h.exif[514])));c.exif[34665]&&!f.disableExifSub&&b.parseExifTags(g,d,d+c.exif[34665],a,c);c.exif[34853]&&!f.disableExifGps&&b.parseExifTags(g,d,d+c.exif[34853],a,c)}}};b.metaDataParsers.jpeg[65505].push(b.parseExifData)});
(function(b){"function"==typeof define&&define.amd?define(["./load-image","./load-image-exif"],b):"object"==typeof module&&module.exports?b(require("./load-image"),require("./load-image-exif")):b(window.loadImage)})(function(b){b.ExifMap.prototype.tags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",
530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright",36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",
40962:"PixelXDimension",40963:"PixelYDimension",42240:"Gamma",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"PhotographicSensitivity",34856:"OECF",34864:"SensitivityType",34865:"StandardOutputSensitivity",
34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",
41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:"LensSpecification",42035:"LensMake",42036:"LensModel",
42037:"LensSerialNumber",0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",
26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"};b.ExifMap.prototype.stringValues={ExposureProgram:{0:"Undefined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",
1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",
7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",
71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},
SensingMethod:{1:"Undefined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",
4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},ComponentsConfiguration:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"},Orientation:{1:"top-left",2:"top-right",3:"bottom-right",4:"bottom-left",5:"left-top",6:"right-top",7:"right-bottom",8:"left-bottom"}};b.ExifMap.prototype.getText=function(b){var a=
this.get(b);switch(b){case "LightSource":case "Flash":case "MeteringMode":case "ExposureProgram":case "SensingMethod":case "SceneCaptureType":case "SceneType":case "CustomRendered":case "WhiteBalance":case "GainControl":case "Contrast":case "Saturation":case "Sharpness":case "SubjectDistanceRange":case "FileSource":case "Orientation":return this.stringValues[b][a];case "ExifVersion":case "FlashpixVersion":return String.fromCharCode(a[0],a[1],a[2],a[3]);case "ComponentsConfiguration":return this.stringValues[b][a[0]]+
this.stringValues[b][a[1]]+this.stringValues[b][a[2]]+this.stringValues[b][a[3]];case "GPSVersionID":return a[0]+"."+a[1]+"."+a[2]+"."+a[3]}return String(a)};(function(b){var a,d=b.tags;b=b.map;for(a in d)d.hasOwnProperty(a)&&(b[d[a]]=a)})(b.ExifMap.prototype);b.ExifMap.prototype.getAll=function(){var b,a,d={};for(b in this)this.hasOwnProperty(b)&&(a=this.tags[b],a&&(d[a]=this.getText(a)));return d}});
!function(b){var g=b.HTMLCanvasElement&&b.HTMLCanvasElement.prototype,a;if(a=b.Blob)try{a=!!new Blob}catch(k){a=!1}var d=a;if(a=d&&b.Uint8Array)try{a=100===(new Blob([new Uint8Array(100)])).size}catch(k){a=!1}var c=a,f=b.BlobBuilder||b.WebKitBlobBuilder||b.MozBlobBuilder||b.MSBlobBuilder,e=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,h=(d||f)&&b.atob&&b.ArrayBuffer&&b.Uint8Array&&function(a){var b,h,g,m,q;if(b=a.match(e),!b)throw Error("invalid data URI");h=b[2]?b[1]:"text/plain"+(b[3]||";charset=US-ASCII");
g=!!b[4];a=a.slice(b[0].length);g=g?atob(a):decodeURIComponent(a);a=new ArrayBuffer(g.length);b=new Uint8Array(a);for(m=0;m<g.length;m+=1)b[m]=g.charCodeAt(m);return d?new Blob([c?b:a],{type:h}):(q=new f,q.append(a),q.getBlob(h))};b.HTMLCanvasElement&&!g.toBlob&&(g.mozGetAsFile?g.toBlob=function(a,b,c){a(c&&g.toDataURL&&h?h(this.toDataURL(b,c)):this.mozGetAsFile("blob",b))}:g.toDataURL&&h&&(g.toBlob=function(a,b,c){a(h(this.toDataURL(b,c)))}));"function"==typeof define&&define.amd?define(function(){return h}):
"object"==typeof module&&module.exports?module.exports=h:b.dataURLtoBlob=h}(window);
(function(b){"function"===typeof define&&define.amd?define(["jquery"],b):"object"===typeof exports?b(require("jquery")):b(window.jQuery)})(function(b){var g=0;b.ajaxTransport("iframe",function(a){if(a.async){var d=a.initialIframeSrc||"javascript:false;",c,f,e;return{send:function(h,k){c=b('<form style="display:none;"></form>');c.attr("accept-charset",a.formAcceptCharset);e=/\?/.test(a.url)?"&":"?";"DELETE"===a.type?(a.url=a.url+e+"_method=DELETE",a.type="POST"):"PUT"===a.type?(a.url=a.url+e+"_method=PUT",
a.type="POST"):"PATCH"===a.type&&(a.url=a.url+e+"_method=PATCH",a.type="POST");g+=1;f=b('<iframe src="'+d+'" name="iframe-transport-'+g+'"></iframe>').bind("load",function(){var e,h=b.isArray(a.paramName)?a.paramName:[a.paramName];f.unbind("load").bind("load",function(){var a;try{if(a=f.contents(),!a.length||!a[0].firstChild)throw Error();}catch(e){a=void 0}k(200,"success",{iframe:a});b('<iframe src="'+d+'"></iframe>').appendTo(c);window.setTimeout(function(){c.remove()},0)});c.prop("target",f.prop("name")).prop("action",
a.url).prop("method",a.type);a.formData&&b.each(a.formData,function(a,d){b('<input type="hidden"/>').prop("name",d.name).val(d.value).appendTo(c)});a.fileInput&&a.fileInput.length&&"POST"===a.type&&(e=a.fileInput.clone(),a.fileInput.after(function(a){return e[a]}),a.paramName&&a.fileInput.each(function(c){b(this).prop("name",h[c]||a.paramName)}),c.append(a.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"),a.fileInput.removeAttr("form"));c.submit();e&&e.length&&
a.fileInput.each(function(a,c){var d=b(e[a]);b(c).prop("name",d.prop("name")).attr("form",d.attr("form"));d.replaceWith(c)})});c.append(f).appendTo(document.body)},abort:function(){f&&f.unbind("load").prop("src",d);c&&c.remove()}}}});b.ajaxSetup({converters:{"iframe text":function(a){return a&&b(a[0].body).text()},"iframe json":function(a){return a&&b.parseJSON(b(a[0].body).text())},"iframe html":function(a){return a&&b(a[0].body).html()},"iframe xml":function(a){return(a=a&&a[0])&&b.isXMLDoc(a)?
a:b.parseXML(a.XMLDocument&&a.XMLDocument.xml||b(a.body).html())},"iframe script":function(a){return a&&b.globalEval(b(a[0].body).text())}}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","jquery.ui.widget"],b):"object"===typeof exports?b(require("jquery"),require("./vendor/jquery.ui.widget")):b(window.jQuery)})(function(b){function g(a){var d="dragover"===a;return function(c){c.dataTransfer=c.originalEvent&&c.originalEvent.dataTransfer;var f=c.dataTransfer;f&&-1!==b.inArray("Files",f.types)&&!1!==this._trigger(a,b.Event(a,{delegatedEvent:c}))&&(c.preventDefault(),d&&(f.dropEffect="copy"))}}b.support.fileInput=!(/(Android (1\.[0156]|2\.[01]))|(Windows Phone (OS 7|8\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1\.0|2\.[05]|3\.0))/.test(window.navigator.userAgent)||
b('<input type="file">').prop("disabled"));b.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader);b.support.xhrFormDataFileUpload=!!window.FormData;b.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice);b.widget("blueimp.fileupload",{options:{dropZone:b(document),pasteZone:void 0,fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,limitMultiFileUploadSize:void 0,limitMultiFileUploadSizeOverhead:512,
sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(a,d){a=this.messages[a]||a.toString();d&&b.each(d,function(b,d){a=a.replace("{"+b+"}",d)});return a},formData:function(a){return a.serializeArray()},add:function(a,
d){if(a.isDefaultPrevented())return!1;(d.autoUpload||!1!==d.autoUpload&&b(this).fileupload("option","autoUpload"))&&d.process().done(function(){d.submit()})},processData:!1,contentType:!1,cache:!1,timeout:0},_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:b.support.blobSlice&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime();this.bitrate=
this.loaded=0;this.getBitrate=function(a,b,c){var f=a-this.timestamp;if(!this.bitrate||!c||f>c)this.bitrate=1E3/f*(b-this.loaded)*8,this.loaded=b,this.timestamp=a;return this.bitrate}},_isXHRUpload:function(a){return!a.forceIframeTransport&&(!a.multipart&&b.support.xhrFileUpload||b.support.xhrFormDataFileUpload)},_getFormData:function(a){var d;return"function"===b.type(a.formData)?a.formData(a.form):b.isArray(a.formData)?a.formData:"object"===b.type(a.formData)?(d=[],b.each(a.formData,function(a,
b){d.push({name:a,value:b})}),d):[]},_getTotal:function(a){var d=0;b.each(a,function(a,b){d+=b.size||1});return d},_initProgressObject:function(a){var d={loaded:0,total:0,bitrate:0};a._progress?b.extend(a._progress,d):a._progress=d},_initResponseObject:function(a){var b;if(a._response)for(b in a._response)a._response.hasOwnProperty(b)&&delete a._response[b];else a._response={}},_onProgress:function(a,d){if(a.lengthComputable){var c=Date.now?Date.now():(new Date).getTime(),f;d._time&&d.progressInterval&&
c-d._time<d.progressInterval&&a.loaded!==a.total||(d._time=c,f=Math.floor(a.loaded/a.total*(d.chunkSize||d._progress.total))+(d.uploadedBytes||0),this._progress.loaded+=f-d._progress.loaded,this._progress.bitrate=this._bitrateTimer.getBitrate(c,this._progress.loaded,d.bitrateInterval),d._progress.loaded=d.loaded=f,d._progress.bitrate=d.bitrate=d._bitrateTimer.getBitrate(c,f,d.bitrateInterval),this._trigger("progress",b.Event("progress",{delegatedEvent:a}),d),this._trigger("progressall",b.Event("progressall",
{delegatedEvent:a}),this._progress))}},_initProgressListener:function(a){var d=this,c=a.xhr?a.xhr():b.ajaxSettings.xhr();c.upload&&(b(c.upload).bind("progress",function(b){var c=b.originalEvent;b.lengthComputable=c.lengthComputable;b.loaded=c.loaded;b.total=c.total;d._onProgress(b,a)}),a.xhr=function(){return c})},_isInstanceOf:function(a,b){return Object.prototype.toString.call(b)==="[object "+a+"]"},_initXHRData:function(a){var d=this,c,f=a.files[0],e=a.multipart||!b.support.xhrFileUpload,h="array"===
b.type(a.paramName)?a.paramName[0]:a.paramName;a.headers=b.extend({},a.headers);a.contentRange&&(a.headers["Content-Range"]=a.contentRange);e&&!a.blob&&this._isInstanceOf("File",f)||(a.headers["Content-Disposition"]='attachment; filename="'+encodeURI(f.name)+'"');e?b.support.xhrFormDataFileUpload&&(a.postMessage?(c=this._getFormData(a),a.blob?c.push({name:h,value:a.blob}):b.each(a.files,function(d,e){c.push({name:"array"===b.type(a.paramName)&&a.paramName[d]||h,value:e})})):(d._isInstanceOf("FormData",
a.formData)?c=a.formData:(c=new FormData,b.each(this._getFormData(a),function(a,b){c.append(b.name,b.value)})),a.blob?c.append(h,a.blob,f.name):b.each(a.files,function(e,f){(d._isInstanceOf("File",f)||d._isInstanceOf("Blob",f))&&c.append("array"===b.type(a.paramName)&&a.paramName[e]||h,f,f.uploadName||f.name)})),a.data=c):(a.contentType=f.type||"application/octet-stream",a.data=a.blob||f);a.blob=null},_initIframeSettings:function(a){var d=b("<a></a>").prop("href",a.url).prop("host");a.dataType="iframe "+
(a.dataType||"");a.formData=this._getFormData(a);a.redirect&&d&&d!==location.host&&a.formData.push({name:a.redirectParamName||"redirect",value:a.redirect})},_initDataSettings:function(a){this._isXHRUpload(a)?(this._chunkedUpload(a,!0)||(a.data||this._initXHRData(a),this._initProgressListener(a)),a.postMessage&&(a.dataType="postmessage "+(a.dataType||""))):this._initIframeSettings(a)},_getParamName:function(a){var d=b(a.fileInput),c=a.paramName;c?b.isArray(c)||(c=[c]):(c=[],d.each(function(){for(var a=
b(this),d=a.prop("name")||"files[]",a=(a.prop("files")||[1]).length;a;)c.push(d),--a}),c.length||(c=[d.prop("name")||"files[]"]));return c},_initFormSettings:function(a){a.form&&a.form.length||(a.form=b(a.fileInput.prop("form")),a.form.length||(a.form=b(this.options.fileInput.prop("form"))));a.paramName=this._getParamName(a);a.url||(a.url=a.form.prop("action")||location.href);a.type=(a.type||"string"===b.type(a.form.prop("method"))&&a.form.prop("method")||"").toUpperCase();"POST"!==a.type&&"PUT"!==
a.type&&"PATCH"!==a.type&&(a.type="POST");a.formAcceptCharset||(a.formAcceptCharset=a.form.attr("accept-charset"))},_getAJAXSettings:function(a){a=b.extend({},this.options,a);this._initFormSettings(a);this._initDataSettings(a);return a},_getDeferredState:function(a){return a.state?a.state():a.isResolved()?"resolved":a.isRejected()?"rejected":"pending"},_enhancePromise:function(a){a.success=a.done;a.error=a.fail;a.complete=a.always;return a},_getXHRPromise:function(a,d,c){var f=b.Deferred(),e=f.promise();
d=d||this.options.context||e;!0===a?f.resolveWith(d,c):!1===a&&f.rejectWith(d,c);e.abort=f.promise;return this._enhancePromise(e)},_addConvenienceMethods:function(a,d){var c=this,f=function(a){return b.Deferred().resolveWith(c,a).promise()};d.process=function(a,h){if(a||h)d._processQueue=this._processQueue=(this._processQueue||f([this])).then(function(){return d.errorThrown?b.Deferred().rejectWith(c,[d]).promise():f(arguments)}).then(a,h);return this._processQueue||f([this])};d.submit=function(){"pending"!==
this.state()&&(d.jqXHR=this.jqXHR=!1!==c._trigger("submit",b.Event("submit",{delegatedEvent:a}),this)&&c._onSend(a,this));return this.jqXHR||c._getXHRPromise()};d.abort=function(){if(this.jqXHR)return this.jqXHR.abort();this.errorThrown="abort";c._trigger("fail",null,this);return c._getXHRPromise(!1)};d.state=function(){if(this.jqXHR)return c._getDeferredState(this.jqXHR);if(this._processQueue)return c._getDeferredState(this._processQueue)};d.processing=function(){return!this.jqXHR&&this._processQueue&&
"pending"===c._getDeferredState(this._processQueue)};d.progress=function(){return this._progress};d.response=function(){return this._response}},_getUploadedBytes:function(a){return(a=(a=(a=a.getResponseHeader("Range"))&&a.split("-"))&&1<a.length&&parseInt(a[1],10))&&a+1},_chunkedUpload:function(a,d){a.uploadedBytes=a.uploadedBytes||0;var c=this,f=a.files[0],e=f.size,h=a.uploadedBytes,g=a.maxChunkSize||e,p=this._blobSlice,n=b.Deferred(),l=n.promise(),m,q;if(!(this._isXHRUpload(a)&&p&&(h||g<e))||a.data)return!1;
if(d)return!0;if(h>=e)return f.error=a.i18n("uploadedBytes"),this._getXHRPromise(!1,a.context,[null,"error",f.error]);q=function(){var d=b.extend({},a),l=d._progress.loaded;d.blob=p.call(f,h,h+g,f.type);d.chunkSize=d.blob.size;d.contentRange="bytes "+h+"-"+(h+d.chunkSize-1)+"/"+e;c._initXHRData(d);c._initProgressListener(d);m=(!1!==c._trigger("chunksend",null,d)&&b.ajax(d)||c._getXHRPromise(!1,d.context)).done(function(f,g,k){h=c._getUploadedBytes(k)||h+d.chunkSize;l+d.chunkSize-d._progress.loaded&&
c._onProgress(b.Event("progress",{lengthComputable:!0,loaded:h-d.uploadedBytes,total:h-d.uploadedBytes}),d);a.uploadedBytes=d.uploadedBytes=h;d.result=f;d.textStatus=g;d.jqXHR=k;c._trigger("chunkdone",null,d);c._trigger("chunkalways",null,d);h<e?q():n.resolveWith(d.context,[f,g,k])}).fail(function(a,b,e){d.jqXHR=a;d.textStatus=b;d.errorThrown=e;c._trigger("chunkfail",null,d);c._trigger("chunkalways",null,d);n.rejectWith(d.context,[a,b,e])})};this._enhancePromise(l);l.abort=function(){return m.abort()};
q();return l},_beforeSend:function(a,b){0===this._active&&(this._trigger("start"),this._bitrateTimer=new this._BitrateTimer,this._progress.loaded=this._progress.total=0,this._progress.bitrate=0);this._initResponseObject(b);this._initProgressObject(b);b._progress.loaded=b.loaded=b.uploadedBytes||0;b._progress.total=b.total=this._getTotal(b.files)||1;b._progress.bitrate=b.bitrate=0;this._active+=1;this._progress.loaded+=b.loaded;this._progress.total+=b.total},_onDone:function(a,d,c,f){var e=f._progress.total,
h=f._response;f._progress.loaded<e&&this._onProgress(b.Event("progress",{lengthComputable:!0,loaded:e,total:e}),f);h.result=f.result=a;h.textStatus=f.textStatus=d;h.jqXHR=f.jqXHR=c;this._trigger("done",null,f)},_onFail:function(a,b,c,f){var e=f._response;f.recalculateProgress&&(this._progress.loaded-=f._progress.loaded,this._progress.total-=f._progress.total);e.jqXHR=f.jqXHR=a;e.textStatus=f.textStatus=b;e.errorThrown=f.errorThrown=c;this._trigger("fail",null,f)},_onAlways:function(a,b,c,f){this._trigger("always",
null,f)},_onSend:function(a,d){d.submit||this._addConvenienceMethods(a,d);var c=this,f,e,h,g,p=c._getAJAXSettings(d),n=function(){c._sending+=1;p._bitrateTimer=new c._BitrateTimer;return f=f||((e||!1===c._trigger("send",b.Event("send",{delegatedEvent:a}),p))&&c._getXHRPromise(!1,p.context,e)||c._chunkedUpload(p)||b.ajax(p)).done(function(a,b,d){c._onDone(a,b,d,p)}).fail(function(a,b,d){c._onFail(a,b,d,p)}).always(function(a,b,d){c._onAlways(a,b,d,p);--c._sending;--c._active;if(p.limitConcurrentUploads&&
p.limitConcurrentUploads>c._sending)for(a=c._slots.shift();a;){if("pending"===c._getDeferredState(a)){a.resolve();break}a=c._slots.shift()}0===c._active&&c._trigger("stop")})};this._beforeSend(a,p);return this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(1<this.options.limitConcurrentUploads?(h=b.Deferred(),this._slots.push(h),g=h.then(n)):g=this._sequence=this._sequence.then(n,n),g.abort=function(){e=[void 0,"abort","abort"];
return f?f.abort():(h&&h.rejectWith(p.context,e),n())},this._enhancePromise(g)):n()},_onAdd:function(a,d){var c=this,f=!0,e=b.extend({},this.options,d),h=d.files,g=h.length,p=e.limitMultiFileUploads,n=e.limitMultiFileUploadSize,l=e.limitMultiFileUploadSizeOverhead,m=0,q=this._getParamName(e),u,w,x=0;if(!g)return!1;n&&void 0===h[0].size&&(n=void 0);if((e.singleFileUploads||p||n)&&this._isXHRUpload(e))if(e.singleFileUploads||n||!p)if(!e.singleFileUploads&&n)for(w=[],u=[],e=0;e<g;e+=1){if(m+=h[e].size+
l,e+1===g||m+h[e+1].size+l>n||p&&e+1-x>=p)w.push(h.slice(x,e+1)),m=q.slice(x,e+1),m.length||(m=q),u.push(m),x=e+1,m=0}else u=q;else for(w=[],u=[],e=0;e<g;e+=p)w.push(h.slice(e,e+p)),m=q.slice(e,e+p),m.length||(m=q),u.push(m);else w=[h],u=[q];d.originalFiles=h;b.each(w||h,function(e,g){var h=b.extend({},d);h.files=w?g:[g];h.paramName=u[e];c._initResponseObject(h);c._initProgressObject(h);c._addConvenienceMethods(a,h);return f=c._trigger("add",b.Event("add",{delegatedEvent:a}),h)});return f},_replaceFileInput:function(a){var d=
a.fileInput,c=d.clone(!0),f=d.is(document.activeElement);a.fileInputClone=c;b("<form></form>").append(c)[0].reset();d.after(c).detach();f&&c.focus();b.cleanData(d.unbind("remove"));this.options.fileInput=this.options.fileInput.map(function(a,b){return b===d[0]?c[0]:b});d[0]===this.element[0]&&(this.element=c)},_handleFileTreeEntry:function(a,d){var c=this,f=b.Deferred(),e=function(b){b&&!b.entry&&(b.entry=a);f.resolve([b])},g=function(b){c._handleFileTreeEntries(b,d+a.name+"/").done(function(a){f.resolve(a)}).fail(e)},
k=function(){p.readEntries(function(a){a.length?(n=n.concat(a),k()):g(n)},e)},p,n=[];d=d||"";a.isFile?a._file?(a._file.relativePath=d,f.resolve(a._file)):a.file(function(a){a.relativePath=d;f.resolve(a)},e):a.isDirectory?(p=a.createReader(),k()):f.resolve([]);return f.promise()},_handleFileTreeEntries:function(a,d){var c=this;return b.when.apply(b,b.map(a,function(a){return c._handleFileTreeEntry(a,d)})).then(function(){return Array.prototype.concat.apply([],arguments)})},_getDroppedFiles:function(a){a=
a||{};var d=a.items;return d&&d.length&&(d[0].webkitGetAsEntry||d[0].getAsEntry)?this._handleFileTreeEntries(b.map(d,function(a){var b;if(a.webkitGetAsEntry){if(b=a.webkitGetAsEntry())b._file=a.getAsFile();return b}return a.getAsEntry()})):b.Deferred().resolve(b.makeArray(a.files)).promise()},_getSingleFileInputFiles:function(a){a=b(a);var d=a.prop("webkitEntries")||a.prop("entries");if(d&&d.length)return this._handleFileTreeEntries(d);d=b.makeArray(a.prop("files"));if(d.length)void 0===d[0].name&&
d[0].fileName&&b.each(d,function(a,b){b.name=b.fileName;b.size=b.fileSize});else{a=a.prop("value");if(!a)return b.Deferred().resolve([]).promise();d=[{name:a.replace(/^.*\\/,"")}]}return b.Deferred().resolve(d).promise()},_getFileInputFiles:function(a){return a instanceof b&&1!==a.length?b.when.apply(b,b.map(a,this._getSingleFileInputFiles)).then(function(){return Array.prototype.concat.apply([],arguments)}):this._getSingleFileInputFiles(a)},_onChange:function(a){var d=this,c={fileInput:b(a.target),
form:b(a.target.form)};this._getFileInputFiles(c.fileInput).always(function(f){c.files=f;d.options.replaceFileInput&&d._replaceFileInput(c);!1!==d._trigger("change",b.Event("change",{delegatedEvent:a}),c)&&d._onAdd(a,c)})},_onPaste:function(a){var d=a.originalEvent&&a.originalEvent.clipboardData&&a.originalEvent.clipboardData.items,c={files:[]};d&&d.length&&(b.each(d,function(a,b){var d=b.getAsFile&&b.getAsFile();d&&c.files.push(d)}),!1!==this._trigger("paste",b.Event("paste",{delegatedEvent:a}),
c)&&this._onAdd(a,c))},_onDrop:function(a){a.dataTransfer=a.originalEvent&&a.originalEvent.dataTransfer;var d=this,c=a.dataTransfer,f={};c&&c.files&&c.files.length&&(a.preventDefault(),this._getDroppedFiles(c).always(function(c){f.files=c;!1!==d._trigger("drop",b.Event("drop",{delegatedEvent:a}),f)&&d._onAdd(a,f)}))},_onDragOver:g("dragover"),_onDragEnter:g("dragenter"),_onDragLeave:g("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,
drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste}));b.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop");this._off(this.options.pasteZone,"paste");this._off(this.options.fileInput,"change")},_setOption:function(a,d){var c=-1!==b.inArray(a,this._specialOptions);c&&this._destroyEventHandlers();
this._super(a,d);c&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var a=this.options;void 0===a.fileInput?a.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):a.fileInput instanceof b||(a.fileInput=b(a.fileInput));a.dropZone instanceof b||(a.dropZone=b(a.dropZone));a.pasteZone instanceof b||(a.pasteZone=b(a.pasteZone))},_getRegExp:function(a){a=a.split("/");var b=a.pop();a.shift();return new RegExp(a.join("/"),
b)},_isRegExpOption:function(a,d){return"url"!==a&&"string"===b.type(d)&&/^\/.*\/[igm]{0,3}$/.test(d)},_initDataAttributes:function(){var a=this,d=this.options,c=this.element.data();b.each(this.element[0].attributes,function(b,e){var g=e.name.toLowerCase(),k;/^data-/.test(g)&&(g=g.slice(5).replace(/-[a-z]/g,function(a){return a.charAt(1).toUpperCase()}),k=c[g],a._isRegExpOption(g,k)&&(k=a._getRegExp(k)),d[g]=k)})},_create:function(){this._initDataAttributes();this._initSpecialOptions();this._slots=
[];this._sequence=this._getXHRPromise(!0);this._sending=this._active=0;this._initProgressObject(this);this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(a){var d=this;a&&!this.options.disabled&&(a.fileInput&&!a.files?this._getFileInputFiles(a.fileInput).always(function(b){a.files=b;d._onAdd(null,a)}):(a.files=b.makeArray(a.files),this._onAdd(null,a)))},send:function(a){if(a&&!this.options.disabled){if(a.fileInput&&!a.files){var d=
this,c=b.Deferred(),f=c.promise(),e,g;f.abort=function(){g=!0;if(e)return e.abort();c.reject(null,"abort","abort");return f};this._getFileInputFiles(a.fileInput).always(function(b){g||(b.length?(a.files=b,e=d._onSend(null,a),e.then(function(a,b,d){c.resolve(a,b,d)},function(a,b,d){c.reject(a,b,d)})):c.reject())});return this._enhancePromise(f)}a.files=b.makeArray(a.files);if(a.files.length)return this._onSend(null,a)}return this._getXHRPromise(!1,a&&a.context)}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","./jquery.fileupload"],b):"object"===typeof exports?b(require("jquery")):b(window.jQuery)})(function(b){var g=b.blueimp.fileupload.prototype.options.add;b.widget("blueimp.fileupload",b.blueimp.fileupload,{options:{processQueue:[],add:function(a,d){var c=b(this);d.process(function(){return c.fileupload("process",d)});g.call(this,a,d)}},processActions:{},_processFile:function(a,d){var c=this,f=b.Deferred().resolveWith(c,[a]).promise();
this._trigger("process",null,a);b.each(a.processQueue,function(a,g){var k=function(a){return d.errorThrown?b.Deferred().rejectWith(c,[d]).promise():c.processActions[g.action].call(c,a,g)};f=f.then(k,g.always&&k)});f.done(function(){c._trigger("processdone",null,a);c._trigger("processalways",null,a)}).fail(function(){c._trigger("processfail",null,a);c._trigger("processalways",null,a)});return f},_transformProcessQueue:function(a){var d=[];b.each(a.processQueue,function(){var c={},f=this.action,e=!0===
this.prefix?f:this.prefix;b.each(this,function(d,f){"string"===b.type(f)&&"@"===f.charAt(0)?c[d]=a[f.slice(1)||(e?e+d.charAt(0).toUpperCase()+d.slice(1):d)]:c[d]=f});d.push(c)});a.processQueue=d},processing:function(){return this._processing},process:function(a){var d=this,c=b.extend({},this.options,a);c.processQueue&&c.processQueue.length&&(this._transformProcessQueue(c),0===this._processing&&this._trigger("processstart"),b.each(a.files,function(f){var e=f?b.extend({},c):c,g=function(){return a.errorThrown?
b.Deferred().rejectWith(d,[a]).promise():d._processFile(e,a)};e.index=f;d._processing+=1;d._processingQueue=d._processingQueue.then(g,g).always(function(){--d._processing;0===d._processing&&d._trigger("processstop")})}));return this._processingQueue},_create:function(){this._super();this._processing=0;this._processingQueue=b.Deferred().resolveWith(this).promise()}})});
(function(b){"function"===typeof define&&define.amd?define("jquery load-image load-image-meta load-image-exif canvas-to-blob ./jquery.fileupload-process".split(" "),b):"object"===typeof exports?b(require("jquery"),require("blueimp-load-image/js/load-image"),require("blueimp-load-image/js/load-image-meta"),require("blueimp-load-image/js/load-image-exif"),require("blueimp-canvas-to-blob"),require("./jquery.fileupload-process")):b(window.jQuery,window.loadImage)})(function(b,g){b.blueimp.fileupload.prototype.options.processQueue.unshift({action:"loadImageMetaData",
disableImageHead:"@",disableExif:"@",disableExifThumbnail:"@",disableExifSub:"@",disableExifGps:"@",disabled:"@disableImageMetaDataLoad"},{action:"loadImage",prefix:!0,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"});b.widget("blueimp.fileupload",b.blueimp.fileupload,{options:{loadImageFileTypes:/^image\/(gif|jpeg|png|svg\+xml)$/,loadImageMaxFileSize:1E7,
imageMaxWidth:1920,imageMaxHeight:1080,imageOrientation:!1,imageCrop:!1,disableImageResize:!0,previewMaxWidth:80,previewMaxHeight:80,previewOrientation:!0,previewThumbnail:!0,previewCrop:!1,previewCanvas:!0},processActions:{loadImage:function(a,d){if(d.disabled)return a;var c=this,f=a.files[a.index],e=b.Deferred();return"number"===b.type(d.maxFileSize)&&f.size>d.maxFileSize||d.fileTypes&&!d.fileTypes.test(f.type)||!g(f,function(b){b.src&&(a.img=b);e.resolveWith(c,[a])},d)?a:e.promise()},resizeImage:function(a,
d){if(d.disabled||!a.canvas&&!a.img)return a;d=b.extend({canvas:!0},d);var c=this,f=b.Deferred(),e=d.canvas&&a.canvas||a.img,h=function(b){b&&(b.width!==e.width||b.height!==e.height||d.forceResize)&&(a[b.getContext?"canvas":"img"]=b);a.preview=b;f.resolveWith(c,[a])},k;if(a.exif){!0===d.orientation&&(d.orientation=a.exif.get("Orientation"));if(d.thumbnail&&(k=a.exif.get("Thumbnail")))return g(k,h,d),f.promise();a.orientation?delete d.orientation:a.orientation=d.orientation}return e?(h(g.scale(e,d)),
f.promise()):a},saveImage:function(a,d){if(!a.canvas||d.disabled)return a;var c=this,f=a.files[a.index],e=b.Deferred();if(a.canvas.toBlob)a.canvas.toBlob(function(b){b.name||(f.type===b.type?b.name=f.name:f.name&&(b.name=f.name.replace(/\.\w+$/,"."+b.type.substr(6))));f.type!==b.type&&delete a.imageHead;a.files[a.index]=b;e.resolveWith(c,[a])},d.type||f.type,d.quality);else return a;return e.promise()},loadImageMetaData:function(a,d){if(d.disabled)return a;var c=this,f=b.Deferred();g.parseMetaData(a.files[a.index],
function(d){b.extend(a,d);f.resolveWith(c,[a])},d);return f.promise()},saveImageMetaData:function(a,b){if(!(a.imageHead&&a.canvas&&a.canvas.toBlob)||b.disabled)return a;var c=a.files[a.index],f=new Blob([a.imageHead,this._blobSlice.call(c,20)],{type:c.type});f.name=c.name;a.files[a.index]=f;return a},setImage:function(a,b){a.preview&&!b.disabled&&(a.files[a.index][b.name||"preview"]=a.preview);return a},deleteImageReferences:function(a,b){b.disabled||(delete a.img,delete a.canvas,delete a.preview,
delete a.imageHead);return a}}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","load-image","./jquery.fileupload-process"],b):"object"===typeof exports?b(require("jquery"),require("load-image")):b(window.jQuery,window.loadImage)})(function(b,g){b.blueimp.fileupload.prototype.options.processQueue.unshift({action:"loadAudio",prefix:!0,fileTypes:"@",maxFileSize:"@",disabled:"@disableAudioPreview"},{action:"setAudio",name:"@audioPreviewName",disabled:"@disableAudioPreview"});b.widget("blueimp.fileupload",b.blueimp.fileupload,
{options:{loadAudioFileTypes:/^audio\/.*$/},_audioElement:document.createElement("audio"),processActions:{loadAudio:function(a,d){if(d.disabled)return a;var c=a.files[a.index],f;this._audioElement.canPlayType&&this._audioElement.canPlayType(c.type)&&("number"!==b.type(d.maxFileSize)||c.size<=d.maxFileSize)&&(!d.fileTypes||d.fileTypes.test(c.type))&&(c=g.createObjectURL(c))&&(f=this._audioElement.cloneNode(!1),f.src=c,f.controls=!0,a.audio=f);return a},setAudio:function(a,b){a.audio&&!b.disabled&&
(a.files[a.index][b.name||"preview"]=a.audio);return a}}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","load-image","./jquery.fileupload-process"],b):"object"===typeof exports?b(require("jquery"),require("load-image")):b(window.jQuery,window.loadImage)})(function(b,g){b.blueimp.fileupload.prototype.options.processQueue.unshift({action:"loadVideo",prefix:!0,fileTypes:"@",maxFileSize:"@",disabled:"@disableVideoPreview"},{action:"setVideo",name:"@videoPreviewName",disabled:"@disableVideoPreview"});b.widget("blueimp.fileupload",b.blueimp.fileupload,
{options:{loadVideoFileTypes:/^video\/.*$/},_videoElement:document.createElement("video"),processActions:{loadVideo:function(a,d){if(d.disabled)return a;var c=a.files[a.index],f;this._videoElement.canPlayType&&this._videoElement.canPlayType(c.type)&&("number"!==b.type(d.maxFileSize)||c.size<=d.maxFileSize)&&(!d.fileTypes||d.fileTypes.test(c.type))&&(c=g.createObjectURL(c))&&(f=this._videoElement.cloneNode(!1),f.src=c,f.controls=!0,a.video=f);return a},setVideo:function(a,b){a.video&&!b.disabled&&
(a.files[a.index][b.name||"preview"]=a.video);return a}}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","./jquery.fileupload-process"],b):"object"===typeof exports?b(require("jquery")):b(window.jQuery)})(function(b){b.blueimp.fileupload.prototype.options.processQueue.push({action:"validate",always:!0,acceptFileTypes:"@",maxFileSize:"@",minFileSize:"@",maxNumberOfFiles:"@",disabled:"@disableValidation"});b.widget("blueimp.fileupload",b.blueimp.fileupload,{options:{getNumberOfFiles:b.noop,messages:{maxNumberOfFiles:"Maximum number of files exceeded",
acceptFileTypes:"File type not allowed",maxFileSize:"File is too large",minFileSize:"File is too small"}},processActions:{validate:function(g,a){if(a.disabled)return g;var d=b.Deferred(),c=this.options,f=g.files[g.index],e;if(a.minFileSize||a.maxFileSize)e=f.size;"number"===b.type(a.maxNumberOfFiles)&&(c.getNumberOfFiles()||0)+g.files.length>a.maxNumberOfFiles?f.error=c.i18n("maxNumberOfFiles"):!a.acceptFileTypes||a.acceptFileTypes.test(f.type)||a.acceptFileTypes.test(f.name)?e>a.maxFileSize?f.error=
c.i18n("maxFileSize"):"number"===b.type(e)&&e<a.minFileSize?f.error=c.i18n("minFileSize"):delete f.error:f.error=c.i18n("acceptFileTypes");f.error||g.files.error?(g.files.error=!0,d.rejectWith(this,[g])):d.resolveWith(this,[g]);return d.promise()}}})});
(function(b){"function"===typeof define&&define.amd?define("jquery angular ./jquery.fileupload-image ./jquery.fileupload-audio ./jquery.fileupload-video ./jquery.fileupload-validate".split(" "),b):b()})(function(){angular.module("blueimp.fileupload",[]).provider("fileUpload",function(){var b=function(a){angular.element(this).fileupload("option","scope").$evalAsync(a)},g=function(a,b){var f=b.files,e=f[0];angular.forEach(f,function(a,d){a._index=d;a.$state=function(){return b.state()};a.$processing=
function(){return b.processing()};a.$progress=function(){return b.progress()};a.$response=function(){return b.response()}});e.$submit=function(){if(!e.error)return b.submit()};e.$cancel=function(){return b.abort()}},a;a=this.defaults={handleResponse:function(a,b){var f=b.result&&b.result.files;if(f)b.scope.replace(b.files,f);else if(b.errorThrown||"error"===b.textStatus)b.files[0].error=b.errorThrown||b.textStatus},add:function(a,b){if(a.isDefaultPrevented())return!1;var f=b.scope,e=[];angular.forEach(b.files,
function(a){e.push(a)});f.$parent.$applyAsync(function(){g(f,b);var a=f.option("prependFiles")?"unshift":"push";Array.prototype[a].apply(f.queue,b.files)});b.process(function(){return f.process(b)}).always(function(){f.$parent.$applyAsync(function(){g(f,b);f.replace(e,b.files)})}).then(function(){(f.option("autoUpload")||b.autoUpload)&&!1!==b.autoUpload&&b.submit()})},done:function(a,b){if(a.isDefaultPrevented())return!1;var f=this;b.scope.$apply(function(){b.handleResponse.call(f,a,b)})},fail:function(a,
b){if(a.isDefaultPrevented())return!1;var f=this,e=b.scope;"abort"===b.errorThrown?e.clear(b.files):e.$apply(function(){b.handleResponse.call(f,a,b)})},stop:b,processstart:b,processstop:b,getNumberOfFiles:function(){var a=this.scope;return a.queue.length-a.processing()},dataType:"json",autoUpload:!1};this.$get=[function(){return{defaults:a}}]}).provider("formatFileSizeFilter",function(){var b={units:[{size:1E9,suffix:" GB"},{size:1E6,suffix:" MB"},{size:1E3,suffix:" KB"}]};this.defaults=b;this.$get=
function(){return function(g){if(!angular.isNumber(g))return"";for(var a=!0,d=0,c,f;a;){a=b.units[d];c=a.prefix||"";f=a.suffix||"";if(d===b.units.length-1||g>=a.size)return c+(g/a.size).toFixed(2)+f;d+=1}}}}).controller("FileUploadController",["$scope","$element","$attrs","$window","fileUpload",function(b,g,a,d,c){var f={progress:function(){return g.fileupload("progress")},active:function(){return g.fileupload("active")},option:function(a,b){if(1===arguments.length)return g.fileupload("option",a);
g.fileupload("option",a,b)},add:function(a){return g.fileupload("add",a)},send:function(a){return g.fileupload("send",a)},process:function(a){return g.fileupload("process",a)},processing:function(a){return g.fileupload("processing",a)}};b.disabled=!d.jQuery.support.fileInput;b.queue=b.queue||[];b.clear=function(a){var b=this.queue,c=b.length,d=a,f=1;angular.isArray(a)&&(d=a[0],f=a.length);for(;c;)if(--c,b[c]===d)return b.splice(c,f)};b.replace=function(a,b){var c=this.queue,d=a[0],f;for(f=0;f<c.length;f+=
1)if(c[f]===d){for(d=0;d<b.length;d+=1)c[f+d]=b[d];break}};b.applyOnQueue=function(a){var b=this.queue.slice(0),c,d;for(c=0;c<b.length;c+=1)if(d=b[c],d[a])d[a]()};b.submit=function(){this.applyOnQueue("$submit")};b.cancel=function(){this.applyOnQueue("$cancel")};angular.extend(b,f);g.fileupload(angular.extend({scope:b},c.defaults)).on("fileuploadadd",function(a,c){c.scope=b}).on("fileuploadfail",function(a,b){if("abort"!==b.errorThrown&&b.dataType&&b.dataType.indexOf("json")===b.dataType.length-4)try{b.result=
angular.fromJson(b.jqXHR.responseText)}catch(c){}}).on("fileuploadadd fileuploadsubmit fileuploadsend fileuploaddone fileuploadfail fileuploadalways fileuploadprogress fileuploadprogressall fileuploadstart fileuploadstop fileuploadchange fileuploadpaste fileuploaddrop fileuploaddragover fileuploadchunksend fileuploadchunkdone fileuploadchunkfail fileuploadchunkalways fileuploadprocessstart fileuploadprocess fileuploadprocessdone fileuploadprocessfail fileuploadprocessalways fileuploadprocessstop",
function(a,c){b.$parent.$applyAsync(function(){b.$emit(a.type,c).defaultPrevented&&a.preventDefault()})}).on("remove",function(){for(var a in f)f.hasOwnProperty(a)&&delete b[a]});b.$watch(a.fileUpload,function(a){a&&g.fileupload("option",a)})}]).controller("FileUploadProgressController",["$scope","$attrs","$parse",function(b,g,a){var d=a(g.fileUploadProgress),c=function(){var a=d(b);a&&a.total&&(b.num=Math.floor(a.loaded/a.total*100))};c();b.$watch(g.fileUploadProgress+".loaded",function(a,b){a!==
b&&c()})}]).controller("FileUploadPreviewController",["$scope","$element","$attrs",function(b,g,a){b.$watch(a.fileUploadPreview+".preview",function(a){g.empty();a&&g.append(a)})}]).directive("fileUpload",function(){return{controller:"FileUploadController",scope:!0}}).directive("fileUploadProgress",function(){return{controller:"FileUploadProgressController",scope:!0}}).directive("fileUploadPreview",function(){return{controller:"FileUploadPreviewController"}}).directive("download",function(){return function(b,
g){g.on("dragstart",function(a){try{a.originalEvent.dataTransfer.setData("DownloadURL",["application/octet-stream",g.prop("download"),g.prop("href")].join(":"))}catch(b){}})}})});
@@ -0,0 +1,59 @@
(function(b){"function"===typeof define&&define.amd?define(["jquery"],b):"object"===typeof exports?b(require("jquery")):b(jQuery)})(function(b){var l=0,a=Array.prototype.slice;b.cleanData=function(a){return function(c){var f,e,g;for(g=0;null!=(e=c[g]);g++)try{(f=b._data(e,"events"))&&f.remove&&b(e).triggerHandler("remove")}catch(h){}a(c)}}(b.cleanData);b.widget=function(a,c,f){var e,g,h,k,m={},n=a.split(".")[0];a=a.split(".")[1];e=n+"-"+a;f||(f=c,c=b.Widget);b.expr[":"][e.toLowerCase()]=function(a){return!!b.data(a,
e)};b[n]=b[n]||{};g=b[n][a];h=b[n][a]=function(a,d){if(!this._createWidget)return new h(a,d);arguments.length&&this._createWidget(a,d)};b.extend(h,g,{version:f.version,_proto:b.extend({},f),_childConstructors:[]});k=new c;k.options=b.widget.extend({},k.options);b.each(f,function(a,d){b.isFunction(d)?m[a]=function(){var b=function(){return c.prototype[a].apply(this,arguments)},f=function(d){return c.prototype[a].apply(this,d)};return function(){var a=this._super,c=this._superApply,e;this._super=b;
this._superApply=f;e=d.apply(this,arguments);this._super=a;this._superApply=c;return e}}():m[a]=d});h.prototype=b.widget.extend(k,{widgetEventPrefix:g?k.widgetEventPrefix||a:a},m,{constructor:h,namespace:n,widgetName:a,widgetFullName:e});g?(b.each(g._childConstructors,function(a,d){var c=d.prototype;b.widget(c.namespace+"."+c.widgetName,h,d._proto)}),delete g._childConstructors):c._childConstructors.push(h);b.widget.bridge(a,h);return h};b.widget.extend=function(d){for(var c=a.call(arguments,1),f=
0,e=c.length,g,h;f<e;f++)for(g in c[f])h=c[f][g],c[f].hasOwnProperty(g)&&void 0!==h&&(b.isPlainObject(h)?d[g]=b.isPlainObject(d[g])?b.widget.extend({},d[g],h):b.widget.extend({},h):d[g]=h);return d};b.widget.bridge=function(d,c){var f=c.prototype.widgetFullName||d;b.fn[d]=function(e){var g="string"===typeof e,h=a.call(arguments,1),k=this;g?this.each(function(){var a,c=b.data(this,f);if("instance"===e)return k=c,!1;if(!c)return b.error("cannot call methods on "+d+" prior to initialization; attempted to call method '"+
e+"'");if(!b.isFunction(c[e])||"_"===e.charAt(0))return b.error("no such method '"+e+"' for "+d+" widget instance");a=c[e].apply(c,h);if(a!==c&&void 0!==a)return k=a&&a.jquery?k.pushStack(a.get()):a,!1}):(h.length&&(e=b.widget.extend.apply(null,[e].concat(h))),this.each(function(){var a=b.data(this,f);a?(a.option(e||{}),a._init&&a._init()):b.data(this,f,new c(e,this))}));return k}};b.Widget=function(){};b.Widget._childConstructors=[];b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",
options:{disabled:!1,create:null},_createWidget:function(a,c){c=b(c||this.defaultElement||this)[0];this.element=b(c);this.uuid=l++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=b();this.hoverable=b();this.focusable=b();c!==this&&(b.data(c,this.widgetFullName,this),this._on(!0,this.element,{remove:function(a){a.target===c&&this.destroy()}}),this.document=b(c.style?c.ownerDocument:c.document||c),this.window=b(this.document[0].defaultView||this.document[0].parentWindow));this.options=
b.widget.extend({},this.options,this._getCreateOptions(),a);this._create();this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:b.noop,_getCreateEventData:b.noop,_create:b.noop,_init:b.noop,destroy:function(){this._destroy();this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(b.camelCase(this.widgetFullName));this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled");
this.bindings.unbind(this.eventNamespace);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")},_destroy:b.noop,widget:function(){return this.element},option:function(a,c){var f=a,e,g,h;if(0===arguments.length)return b.widget.extend({},this.options);if("string"===typeof a)if(f={},e=a.split("."),a=e.shift(),e.length){g=f[a]=b.widget.extend({},this.options[a]);for(h=0;h<e.length-1;h++)g[e[h]]=g[e[h]]||{},g=g[e[h]];a=e.pop();if(1===arguments.length)return void 0===
g[a]?null:g[a];g[a]=c}else{if(1===arguments.length)return void 0===this.options[a]?null:this.options[a];f[a]=c}this._setOptions(f);return this},_setOptions:function(a){for(var c in a)this._setOption(c,a[c]);return this},_setOption:function(a,c){this.options[a]=c;"disabled"===a&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!c),c&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")));return this},enable:function(){return this._setOptions({disabled:!1})},
disable:function(){return this._setOptions({disabled:!0})},_on:function(a,c,f){var e,g=this;"boolean"!==typeof a&&(f=c,c=a,a=!1);f?(c=e=b(c),this.bindings=this.bindings.add(c)):(f=c,c=this.element,e=this.widget());b.each(f,function(f,k){function m(){if(a||!0!==g.options.disabled&&!b(this).hasClass("ui-state-disabled"))return("string"===typeof k?g[k]:k).apply(g,arguments)}"string"!==typeof k&&(m.guid=k.guid=k.guid||m.guid||b.guid++);var n=f.match(/^([\w:-]*)\s*(.*)$/),u=n[1]+g.eventNamespace;(n=n[2])?
e.delegate(n,u,m):c.bind(u,m)})},_off:function(a,c){c=(c||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;a.unbind(c).undelegate(c);this.bindings=b(this.bindings.not(a).get());this.focusable=b(this.focusable.not(a).get());this.hoverable=b(this.hoverable.not(a).get())},_delay:function(a,c){var b=this;return setTimeout(function(){return("string"===typeof a?b[a]:a).apply(b,arguments)},c||0)},_hoverable:function(a){this.hoverable=this.hoverable.add(a);this._on(a,{mouseenter:function(a){b(a.currentTarget).addClass("ui-state-hover")},
mouseleave:function(a){b(a.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(a){this.focusable=this.focusable.add(a);this._on(a,{focusin:function(a){b(a.currentTarget).addClass("ui-state-focus")},focusout:function(a){b(a.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(a,c,f){var e,g=this.options[a];f=f||{};c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();c.target=this.element[0];if(a=c.originalEvent)for(e in a)e in c||
(c[e]=a[e]);this.element.trigger(c,f);return!(b.isFunction(g)&&!1===g.apply(this.element[0],[c].concat(f))||c.isDefaultPrevented())}};b.each({show:"fadeIn",hide:"fadeOut"},function(a,c){b.Widget.prototype["_"+a]=function(f,e,g){"string"===typeof e&&(e={effect:e});var h,k=e?!0===e||"number"===typeof e?c:e.effect||c:a;e=e||{};"number"===typeof e&&(e={duration:e});h=!b.isEmptyObject(e);e.complete=g;e.delay&&f.delay(e.delay);if(h&&b.effects&&b.effects.effect[k])f[a](e);else if(k!==a&&f[k])f[k](e.duration,
e.easing,g);else f.queue(function(c){b(this)[a]();g&&g.call(f[0]);c()})}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery"],b):"object"===typeof exports?b(require("jquery")):b(window.jQuery)})(function(b){var l=0;b.ajaxTransport("iframe",function(a){if(a.async){var d=a.initialIframeSrc||"javascript:false;",c,f,e;return{send:function(g,h){c=b('<form style="display:none;"></form>');c.attr("accept-charset",a.formAcceptCharset);e=/\?/.test(a.url)?"&":"?";"DELETE"===a.type?(a.url=a.url+e+"_method=DELETE",a.type="POST"):"PUT"===a.type?(a.url=a.url+e+"_method=PUT",
a.type="POST"):"PATCH"===a.type&&(a.url=a.url+e+"_method=PATCH",a.type="POST");l+=1;f=b('<iframe src="'+d+'" name="iframe-transport-'+l+'"></iframe>').bind("load",function(){var e,g=b.isArray(a.paramName)?a.paramName:[a.paramName];f.unbind("load").bind("load",function(){var a;try{if(a=f.contents(),!a.length||!a[0].firstChild)throw Error();}catch(e){a=void 0}h(200,"success",{iframe:a});b('<iframe src="'+d+'"></iframe>').appendTo(c);window.setTimeout(function(){c.remove()},0)});c.prop("target",f.prop("name")).prop("action",
a.url).prop("method",a.type);a.formData&&b.each(a.formData,function(a,d){b('<input type="hidden"/>').prop("name",d.name).val(d.value).appendTo(c)});a.fileInput&&a.fileInput.length&&"POST"===a.type&&(e=a.fileInput.clone(),a.fileInput.after(function(a){return e[a]}),a.paramName&&a.fileInput.each(function(c){b(this).prop("name",g[c]||a.paramName)}),c.append(a.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"),a.fileInput.removeAttr("form"));c.submit();e&&e.length&&
a.fileInput.each(function(a,c){var d=b(e[a]);b(c).prop("name",d.prop("name")).attr("form",d.attr("form"));d.replaceWith(c)})});c.append(f).appendTo(document.body)},abort:function(){f&&f.unbind("load").prop("src",d);c&&c.remove()}}}});b.ajaxSetup({converters:{"iframe text":function(a){return a&&b(a[0].body).text()},"iframe json":function(a){return a&&b.parseJSON(b(a[0].body).text())},"iframe html":function(a){return a&&b(a[0].body).html()},"iframe xml":function(a){return(a=a&&a[0])&&b.isXMLDoc(a)?
a:b.parseXML(a.XMLDocument&&a.XMLDocument.xml||b(a.body).html())},"iframe script":function(a){return a&&b.globalEval(b(a[0].body).text())}}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","jquery.ui.widget"],b):"object"===typeof exports?b(require("jquery"),require("./vendor/jquery.ui.widget")):b(window.jQuery)})(function(b){function l(a){var d="dragover"===a;return function(c){c.dataTransfer=c.originalEvent&&c.originalEvent.dataTransfer;var f=c.dataTransfer;f&&-1!==b.inArray("Files",f.types)&&!1!==this._trigger(a,b.Event(a,{delegatedEvent:c}))&&(c.preventDefault(),d&&(f.dropEffect="copy"))}}b.support.fileInput=!(/(Android (1\.[0156]|2\.[01]))|(Windows Phone (OS 7|8\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1\.0|2\.[05]|3\.0))/.test(window.navigator.userAgent)||
b('<input type="file">').prop("disabled"));b.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader);b.support.xhrFormDataFileUpload=!!window.FormData;b.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice);b.widget("blueimp.fileupload",{options:{dropZone:b(document),pasteZone:void 0,fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,limitMultiFileUploadSize:void 0,limitMultiFileUploadSizeOverhead:512,
sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(a,d){a=this.messages[a]||a.toString();d&&b.each(d,function(c,b){a=a.replace("{"+c+"}",b)});return a},formData:function(a){return a.serializeArray()},add:function(a,
d){if(a.isDefaultPrevented())return!1;(d.autoUpload||!1!==d.autoUpload&&b(this).fileupload("option","autoUpload"))&&d.process().done(function(){d.submit()})},processData:!1,contentType:!1,cache:!1,timeout:0},_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:b.support.blobSlice&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime();this.bitrate=
this.loaded=0;this.getBitrate=function(a,b,c){var f=a-this.timestamp;if(!this.bitrate||!c||f>c)this.bitrate=1E3/f*(b-this.loaded)*8,this.loaded=b,this.timestamp=a;return this.bitrate}},_isXHRUpload:function(a){return!a.forceIframeTransport&&(!a.multipart&&b.support.xhrFileUpload||b.support.xhrFormDataFileUpload)},_getFormData:function(a){var d;return"function"===b.type(a.formData)?a.formData(a.form):b.isArray(a.formData)?a.formData:"object"===b.type(a.formData)?(d=[],b.each(a.formData,function(a,
b){d.push({name:a,value:b})}),d):[]},_getTotal:function(a){var d=0;b.each(a,function(a,b){d+=b.size||1});return d},_initProgressObject:function(a){var d={loaded:0,total:0,bitrate:0};a._progress?b.extend(a._progress,d):a._progress=d},_initResponseObject:function(a){var b;if(a._response)for(b in a._response)a._response.hasOwnProperty(b)&&delete a._response[b];else a._response={}},_onProgress:function(a,d){if(a.lengthComputable){var c=Date.now?Date.now():(new Date).getTime(),f;d._time&&d.progressInterval&&
c-d._time<d.progressInterval&&a.loaded!==a.total||(d._time=c,f=Math.floor(a.loaded/a.total*(d.chunkSize||d._progress.total))+(d.uploadedBytes||0),this._progress.loaded+=f-d._progress.loaded,this._progress.bitrate=this._bitrateTimer.getBitrate(c,this._progress.loaded,d.bitrateInterval),d._progress.loaded=d.loaded=f,d._progress.bitrate=d.bitrate=d._bitrateTimer.getBitrate(c,f,d.bitrateInterval),this._trigger("progress",b.Event("progress",{delegatedEvent:a}),d),this._trigger("progressall",b.Event("progressall",
{delegatedEvent:a}),this._progress))}},_initProgressListener:function(a){var d=this,c=a.xhr?a.xhr():b.ajaxSettings.xhr();c.upload&&(b(c.upload).bind("progress",function(c){var b=c.originalEvent;c.lengthComputable=b.lengthComputable;c.loaded=b.loaded;c.total=b.total;d._onProgress(c,a)}),a.xhr=function(){return c})},_isInstanceOf:function(a,b){return Object.prototype.toString.call(b)==="[object "+a+"]"},_initXHRData:function(a){var d=this,c,f=a.files[0],e=a.multipart||!b.support.xhrFileUpload,g="array"===
b.type(a.paramName)?a.paramName[0]:a.paramName;a.headers=b.extend({},a.headers);a.contentRange&&(a.headers["Content-Range"]=a.contentRange);e&&!a.blob&&this._isInstanceOf("File",f)||(a.headers["Content-Disposition"]='attachment; filename="'+encodeURI(f.name)+'"');e?b.support.xhrFormDataFileUpload&&(a.postMessage?(c=this._getFormData(a),a.blob?c.push({name:g,value:a.blob}):b.each(a.files,function(d,f){c.push({name:"array"===b.type(a.paramName)&&a.paramName[d]||g,value:f})})):(d._isInstanceOf("FormData",
a.formData)?c=a.formData:(c=new FormData,b.each(this._getFormData(a),function(a,b){c.append(b.name,b.value)})),a.blob?c.append(g,a.blob,f.name):b.each(a.files,function(f,e){(d._isInstanceOf("File",e)||d._isInstanceOf("Blob",e))&&c.append("array"===b.type(a.paramName)&&a.paramName[f]||g,e,e.uploadName||e.name)})),a.data=c):(a.contentType=f.type||"application/octet-stream",a.data=a.blob||f);a.blob=null},_initIframeSettings:function(a){var d=b("<a></a>").prop("href",a.url).prop("host");a.dataType="iframe "+
(a.dataType||"");a.formData=this._getFormData(a);a.redirect&&d&&d!==location.host&&a.formData.push({name:a.redirectParamName||"redirect",value:a.redirect})},_initDataSettings:function(a){this._isXHRUpload(a)?(this._chunkedUpload(a,!0)||(a.data||this._initXHRData(a),this._initProgressListener(a)),a.postMessage&&(a.dataType="postmessage "+(a.dataType||""))):this._initIframeSettings(a)},_getParamName:function(a){var d=b(a.fileInput),c=a.paramName;c?b.isArray(c)||(c=[c]):(c=[],d.each(function(){for(var a=
b(this),d=a.prop("name")||"files[]",a=(a.prop("files")||[1]).length;a;)c.push(d),--a}),c.length||(c=[d.prop("name")||"files[]"]));return c},_initFormSettings:function(a){a.form&&a.form.length||(a.form=b(a.fileInput.prop("form")),a.form.length||(a.form=b(this.options.fileInput.prop("form"))));a.paramName=this._getParamName(a);a.url||(a.url=a.form.prop("action")||location.href);a.type=(a.type||"string"===b.type(a.form.prop("method"))&&a.form.prop("method")||"").toUpperCase();"POST"!==a.type&&"PUT"!==
a.type&&"PATCH"!==a.type&&(a.type="POST");a.formAcceptCharset||(a.formAcceptCharset=a.form.attr("accept-charset"))},_getAJAXSettings:function(a){a=b.extend({},this.options,a);this._initFormSettings(a);this._initDataSettings(a);return a},_getDeferredState:function(a){return a.state?a.state():a.isResolved()?"resolved":a.isRejected()?"rejected":"pending"},_enhancePromise:function(a){a.success=a.done;a.error=a.fail;a.complete=a.always;return a},_getXHRPromise:function(a,d,c){var f=b.Deferred(),e=f.promise();
d=d||this.options.context||e;!0===a?f.resolveWith(d,c):!1===a&&f.rejectWith(d,c);e.abort=f.promise;return this._enhancePromise(e)},_addConvenienceMethods:function(a,d){var c=this,f=function(a){return b.Deferred().resolveWith(c,a).promise()};d.process=function(a,g){if(a||g)d._processQueue=this._processQueue=(this._processQueue||f([this])).then(function(){return d.errorThrown?b.Deferred().rejectWith(c,[d]).promise():f(arguments)}).then(a,g);return this._processQueue||f([this])};d.submit=function(){"pending"!==
this.state()&&(d.jqXHR=this.jqXHR=!1!==c._trigger("submit",b.Event("submit",{delegatedEvent:a}),this)&&c._onSend(a,this));return this.jqXHR||c._getXHRPromise()};d.abort=function(){if(this.jqXHR)return this.jqXHR.abort();this.errorThrown="abort";c._trigger("fail",null,this);return c._getXHRPromise(!1)};d.state=function(){if(this.jqXHR)return c._getDeferredState(this.jqXHR);if(this._processQueue)return c._getDeferredState(this._processQueue)};d.processing=function(){return!this.jqXHR&&this._processQueue&&
"pending"===c._getDeferredState(this._processQueue)};d.progress=function(){return this._progress};d.response=function(){return this._response}},_getUploadedBytes:function(a){return(a=(a=(a=a.getResponseHeader("Range"))&&a.split("-"))&&1<a.length&&parseInt(a[1],10))&&a+1},_chunkedUpload:function(a,d){a.uploadedBytes=a.uploadedBytes||0;var c=this,f=a.files[0],e=f.size,g=a.uploadedBytes,h=a.maxChunkSize||e,k=this._blobSlice,m=b.Deferred(),n=m.promise(),l,p;if(!(this._isXHRUpload(a)&&k&&(g||h<e))||a.data)return!1;
if(d)return!0;if(g>=e)return f.error=a.i18n("uploadedBytes"),this._getXHRPromise(!1,a.context,[null,"error",f.error]);p=function(){var d=b.extend({},a),n=d._progress.loaded;d.blob=k.call(f,g,g+h,f.type);d.chunkSize=d.blob.size;d.contentRange="bytes "+g+"-"+(g+d.chunkSize-1)+"/"+e;c._initXHRData(d);c._initProgressListener(d);l=(!1!==c._trigger("chunksend",null,d)&&b.ajax(d)||c._getXHRPromise(!1,d.context)).done(function(f,h,k){g=c._getUploadedBytes(k)||g+d.chunkSize;n+d.chunkSize-d._progress.loaded&&
c._onProgress(b.Event("progress",{lengthComputable:!0,loaded:g-d.uploadedBytes,total:g-d.uploadedBytes}),d);a.uploadedBytes=d.uploadedBytes=g;d.result=f;d.textStatus=h;d.jqXHR=k;c._trigger("chunkdone",null,d);c._trigger("chunkalways",null,d);g<e?p():m.resolveWith(d.context,[f,h,k])}).fail(function(a,b,f){d.jqXHR=a;d.textStatus=b;d.errorThrown=f;c._trigger("chunkfail",null,d);c._trigger("chunkalways",null,d);m.rejectWith(d.context,[a,b,f])})};this._enhancePromise(n);n.abort=function(){return l.abort()};
p();return n},_beforeSend:function(a,b){0===this._active&&(this._trigger("start"),this._bitrateTimer=new this._BitrateTimer,this._progress.loaded=this._progress.total=0,this._progress.bitrate=0);this._initResponseObject(b);this._initProgressObject(b);b._progress.loaded=b.loaded=b.uploadedBytes||0;b._progress.total=b.total=this._getTotal(b.files)||1;b._progress.bitrate=b.bitrate=0;this._active+=1;this._progress.loaded+=b.loaded;this._progress.total+=b.total},_onDone:function(a,d,c,f){var e=f._progress.total,
g=f._response;f._progress.loaded<e&&this._onProgress(b.Event("progress",{lengthComputable:!0,loaded:e,total:e}),f);g.result=f.result=a;g.textStatus=f.textStatus=d;g.jqXHR=f.jqXHR=c;this._trigger("done",null,f)},_onFail:function(a,b,c,f){var e=f._response;f.recalculateProgress&&(this._progress.loaded-=f._progress.loaded,this._progress.total-=f._progress.total);e.jqXHR=f.jqXHR=a;e.textStatus=f.textStatus=b;e.errorThrown=f.errorThrown=c;this._trigger("fail",null,f)},_onAlways:function(a,b,c,f){this._trigger("always",
null,f)},_onSend:function(a,d){d.submit||this._addConvenienceMethods(a,d);var c=this,f,e,g,h,k=c._getAJAXSettings(d),m=function(){c._sending+=1;k._bitrateTimer=new c._BitrateTimer;return f=f||((e||!1===c._trigger("send",b.Event("send",{delegatedEvent:a}),k))&&c._getXHRPromise(!1,k.context,e)||c._chunkedUpload(k)||b.ajax(k)).done(function(a,b,d){c._onDone(a,b,d,k)}).fail(function(a,b,d){c._onFail(a,b,d,k)}).always(function(a,b,d){c._onAlways(a,b,d,k);--c._sending;--c._active;if(k.limitConcurrentUploads&&
k.limitConcurrentUploads>c._sending)for(a=c._slots.shift();a;){if("pending"===c._getDeferredState(a)){a.resolve();break}a=c._slots.shift()}0===c._active&&c._trigger("stop")})};this._beforeSend(a,k);return this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(1<this.options.limitConcurrentUploads?(g=b.Deferred(),this._slots.push(g),h=g.then(m)):h=this._sequence=this._sequence.then(m,m),h.abort=function(){e=[void 0,"abort","abort"];
return f?f.abort():(g&&g.rejectWith(k.context,e),m())},this._enhancePromise(h)):m()},_onAdd:function(a,d){var c=this,f=!0,e=b.extend({},this.options,d),g=d.files,h=g.length,k=e.limitMultiFileUploads,m=e.limitMultiFileUploadSize,n=e.limitMultiFileUploadSizeOverhead,l=0,p=this._getParamName(e),q,r,t=0;if(!h)return!1;m&&void 0===g[0].size&&(m=void 0);if((e.singleFileUploads||k||m)&&this._isXHRUpload(e))if(e.singleFileUploads||m||!k)if(!e.singleFileUploads&&m)for(r=[],q=[],e=0;e<h;e+=1){if(l+=g[e].size+
n,e+1===h||l+g[e+1].size+n>m||k&&e+1-t>=k)r.push(g.slice(t,e+1)),l=p.slice(t,e+1),l.length||(l=p),q.push(l),t=e+1,l=0}else q=p;else for(r=[],q=[],e=0;e<h;e+=k)r.push(g.slice(e,e+k)),l=p.slice(e,e+k),l.length||(l=p),q.push(l);else r=[g],q=[p];d.originalFiles=g;b.each(r||g,function(e,g){var h=b.extend({},d);h.files=r?g:[g];h.paramName=q[e];c._initResponseObject(h);c._initProgressObject(h);c._addConvenienceMethods(a,h);return f=c._trigger("add",b.Event("add",{delegatedEvent:a}),h)});return f},_replaceFileInput:function(a){var d=
a.fileInput,c=d.clone(!0),f=d.is(document.activeElement);a.fileInputClone=c;b("<form></form>").append(c)[0].reset();d.after(c).detach();f&&c.focus();b.cleanData(d.unbind("remove"));this.options.fileInput=this.options.fileInput.map(function(a,b){return b===d[0]?c[0]:b});d[0]===this.element[0]&&(this.element=c)},_handleFileTreeEntry:function(a,d){var c=this,f=b.Deferred(),e=function(b){b&&!b.entry&&(b.entry=a);f.resolve([b])},g=function(b){c._handleFileTreeEntries(b,d+a.name+"/").done(function(a){f.resolve(a)}).fail(e)},
h=function(){k.readEntries(function(a){a.length?(l=l.concat(a),h()):g(l)},e)},k,l=[];d=d||"";a.isFile?a._file?(a._file.relativePath=d,f.resolve(a._file)):a.file(function(a){a.relativePath=d;f.resolve(a)},e):a.isDirectory?(k=a.createReader(),h()):f.resolve([]);return f.promise()},_handleFileTreeEntries:function(a,d){var c=this;return b.when.apply(b,b.map(a,function(a){return c._handleFileTreeEntry(a,d)})).then(function(){return Array.prototype.concat.apply([],arguments)})},_getDroppedFiles:function(a){a=
a||{};var d=a.items;return d&&d.length&&(d[0].webkitGetAsEntry||d[0].getAsEntry)?this._handleFileTreeEntries(b.map(d,function(a){var b;if(a.webkitGetAsEntry){if(b=a.webkitGetAsEntry())b._file=a.getAsFile();return b}return a.getAsEntry()})):b.Deferred().resolve(b.makeArray(a.files)).promise()},_getSingleFileInputFiles:function(a){a=b(a);var d=a.prop("webkitEntries")||a.prop("entries");if(d&&d.length)return this._handleFileTreeEntries(d);d=b.makeArray(a.prop("files"));if(d.length)void 0===d[0].name&&
d[0].fileName&&b.each(d,function(a,b){b.name=b.fileName;b.size=b.fileSize});else{a=a.prop("value");if(!a)return b.Deferred().resolve([]).promise();d=[{name:a.replace(/^.*\\/,"")}]}return b.Deferred().resolve(d).promise()},_getFileInputFiles:function(a){return a instanceof b&&1!==a.length?b.when.apply(b,b.map(a,this._getSingleFileInputFiles)).then(function(){return Array.prototype.concat.apply([],arguments)}):this._getSingleFileInputFiles(a)},_onChange:function(a){var d=this,c={fileInput:b(a.target),
form:b(a.target.form)};this._getFileInputFiles(c.fileInput).always(function(f){c.files=f;d.options.replaceFileInput&&d._replaceFileInput(c);!1!==d._trigger("change",b.Event("change",{delegatedEvent:a}),c)&&d._onAdd(a,c)})},_onPaste:function(a){var d=a.originalEvent&&a.originalEvent.clipboardData&&a.originalEvent.clipboardData.items,c={files:[]};d&&d.length&&(b.each(d,function(a,b){var d=b.getAsFile&&b.getAsFile();d&&c.files.push(d)}),!1!==this._trigger("paste",b.Event("paste",{delegatedEvent:a}),
c)&&this._onAdd(a,c))},_onDrop:function(a){a.dataTransfer=a.originalEvent&&a.originalEvent.dataTransfer;var d=this,c=a.dataTransfer,f={};c&&c.files&&c.files.length&&(a.preventDefault(),this._getDroppedFiles(c).always(function(c){f.files=c;!1!==d._trigger("drop",b.Event("drop",{delegatedEvent:a}),f)&&d._onAdd(a,f)}))},_onDragOver:l("dragover"),_onDragEnter:l("dragenter"),_onDragLeave:l("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,
drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste}));b.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop");this._off(this.options.pasteZone,"paste");this._off(this.options.fileInput,"change")},_setOption:function(a,d){var c=-1!==b.inArray(a,this._specialOptions);c&&this._destroyEventHandlers();
this._super(a,d);c&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var a=this.options;void 0===a.fileInput?a.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):a.fileInput instanceof b||(a.fileInput=b(a.fileInput));a.dropZone instanceof b||(a.dropZone=b(a.dropZone));a.pasteZone instanceof b||(a.pasteZone=b(a.pasteZone))},_getRegExp:function(a){a=a.split("/");var b=a.pop();a.shift();return new RegExp(a.join("/"),
b)},_isRegExpOption:function(a,d){return"url"!==a&&"string"===b.type(d)&&/^\/.*\/[igm]{0,3}$/.test(d)},_initDataAttributes:function(){var a=this,d=this.options,c=this.element.data();b.each(this.element[0].attributes,function(b,e){var g=e.name.toLowerCase(),h;/^data-/.test(g)&&(g=g.slice(5).replace(/-[a-z]/g,function(a){return a.charAt(1).toUpperCase()}),h=c[g],a._isRegExpOption(g,h)&&(h=a._getRegExp(h)),d[g]=h)})},_create:function(){this._initDataAttributes();this._initSpecialOptions();this._slots=
[];this._sequence=this._getXHRPromise(!0);this._sending=this._active=0;this._initProgressObject(this);this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(a){var d=this;a&&!this.options.disabled&&(a.fileInput&&!a.files?this._getFileInputFiles(a.fileInput).always(function(b){a.files=b;d._onAdd(null,a)}):(a.files=b.makeArray(a.files),this._onAdd(null,a)))},send:function(a){if(a&&!this.options.disabled){if(a.fileInput&&!a.files){var d=
this,c=b.Deferred(),f=c.promise(),e,g;f.abort=function(){g=!0;if(e)return e.abort();c.reject(null,"abort","abort");return f};this._getFileInputFiles(a.fileInput).always(function(b){g||(b.length?(a.files=b,e=d._onSend(null,a),e.then(function(a,b,d){c.resolve(a,b,d)},function(a,b,d){c.reject(a,b,d)})):c.reject())});return this._enhancePromise(f)}a.files=b.makeArray(a.files);if(a.files.length)return this._onSend(null,a)}return this._getXHRPromise(!1,a&&a.context)}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","../jquery.fileupload"],b):"object"===typeof exports?b(require("jquery"),require("../jquery.fileupload")):b(window.jQuery)})(function(b){b.widget("blueimp.fileupload",b.blueimp.fileupload,{getUploadButton:function(){return b("<button/>").addClass("btn").prop("disabled",!0).text("Processing...").on("click",function(){var l=b(this),a=l.data();l.off("click").text("Abort").on("click",function(){l.remove();a.abort()});a.submit().always(function(){l.remove()})})},
initTheme:function(b){var a=this.element;b=b.toLowerCase();return a?("basic"==b?this._initBasicTheme(a):"basicplus"==b?this._initBasicPlusTheme(a):"basicplusui"!=b&&"jqueryui"!=b||this._initBasicPlusUITheme(a),a):null},_initBasicTheme:function(l){l.on("fileuploaddone",function(a,d){b.each(d.result.files,function(a,d){b("<p/>").text(d.name).appendTo("#files")})}).on("fileuploadprogressall",function(a,d){var c=parseInt(d.loaded/d.total*100,10);b("#progress .progress-bar").css("width",c+"%")}).prop("disabled",
!b.support.fileInput).parent().addClass(b.support.fileInput?void 0:"disabled")},_initBasicPlusTheme:function(l){l.on("fileuploadadd",function(a,d){var c=b(a.target).data("blueimp-fileupload").getUploadButton();d.context=b("<div/>").appendTo("#files");b.each(d.files,function(a,e){var g=b("<p/>").append(b("<span/>").text(e.name));a||g.append("<br>").append(c.clone(!0).data(d));g.appendTo(d.context)})}).on("fileuploadprocessalways",function(a,d){var c=d.index,f=d.files[c],e=b(d.context.children()[c]);
f.preview&&e.prepend("<br>").prepend(f.preview);f.error&&e.append("<br>").append(f.error);c+1===d.files.length&&d.context.find("button").text("Upload").prop("disabled",!!d.files.error)}).on("fileuploadprogressall",function(a,d){var c=parseInt(d.loaded/d.total*100,10);b("#progress .bar").css("width",c+"%")}).on("fileuploaddone",function(a,d){b.each(d.result.files,function(a,f){var e=b("<a>").attr("target","_blank").prop("href",f.url);b(d.context.children()[a]).wrap(e)})}).on("fileuploadfail",function(a,
d){b.each(d.result.files,function(a,f){var e=b("<span/>").text(f.error);b(d.context.children()[a]).append("<br>").append(e)})}).prop("disabled",!b.support.fileInput).parent().addClass(b.support.fileInput?void 0:"disabled")},_initBasicPlusUITheme:function(l){l.prop("disabled",!b.support.fileInput).parent().addClass(b.support.fileInput?void 0:"disabled")}})});
@@ -0,0 +1,116 @@
(function(b){"function"===typeof define&&define.amd?define(["jquery"],b):"object"===typeof exports?b(require("jquery")):b(jQuery)})(function(b){var e=0,a=Array.prototype.slice;b.cleanData=function(a){return function(c){var g,f,h;for(h=0;null!=(f=c[h]);h++)try{(g=b._data(f,"events"))&&g.remove&&b(f).triggerHandler("remove")}catch(k){}a(c)}}(b.cleanData);b.widget=function(a,c,g){var f,h,k,e,p={},m=a.split(".")[0];a=a.split(".")[1];f=m+"-"+a;g||(g=c,c=b.Widget);b.expr[":"][f.toLowerCase()]=function(a){return!!b.data(a,
f)};b[m]=b[m]||{};h=b[m][a];k=b[m][a]=function(a,d){if(!this._createWidget)return new k(a,d);arguments.length&&this._createWidget(a,d)};b.extend(k,h,{version:g.version,_proto:b.extend({},g),_childConstructors:[]});e=new c;e.options=b.widget.extend({},e.options);b.each(g,function(a,d){b.isFunction(d)?p[a]=function(){var b=function(){return c.prototype[a].apply(this,arguments)},f=function(d){return c.prototype[a].apply(this,d)};return function(){var a=this._super,c=this._superApply,g;this._super=b;
this._superApply=f;g=d.apply(this,arguments);this._super=a;this._superApply=c;return g}}():p[a]=d});k.prototype=b.widget.extend(e,{widgetEventPrefix:h?e.widgetEventPrefix||a:a},p,{constructor:k,namespace:m,widgetName:a,widgetFullName:f});h?(b.each(h._childConstructors,function(a,d){var c=d.prototype;b.widget(c.namespace+"."+c.widgetName,k,d._proto)}),delete h._childConstructors):c._childConstructors.push(k);b.widget.bridge(a,k);return k};b.widget.extend=function(d){for(var c=a.call(arguments,1),g=
0,f=c.length,h,k;g<f;g++)for(h in c[g])k=c[g][h],c[g].hasOwnProperty(h)&&void 0!==k&&(b.isPlainObject(k)?d[h]=b.isPlainObject(d[h])?b.widget.extend({},d[h],k):b.widget.extend({},k):d[h]=k);return d};b.widget.bridge=function(d,c){var g=c.prototype.widgetFullName||d;b.fn[d]=function(f){var h="string"===typeof f,k=a.call(arguments,1),e=this;h?this.each(function(){var a,c=b.data(this,g);if("instance"===f)return e=c,!1;if(!c)return b.error("cannot call methods on "+d+" prior to initialization; attempted to call method '"+
f+"'");if(!b.isFunction(c[f])||"_"===f.charAt(0))return b.error("no such method '"+f+"' for "+d+" widget instance");a=c[f].apply(c,k);if(a!==c&&void 0!==a)return e=a&&a.jquery?e.pushStack(a.get()):a,!1}):(k.length&&(f=b.widget.extend.apply(null,[f].concat(k))),this.each(function(){var a=b.data(this,g);a?(a.option(f||{}),a._init&&a._init()):b.data(this,g,new c(f,this))}));return e}};b.Widget=function(){};b.Widget._childConstructors=[];b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",
options:{disabled:!1,create:null},_createWidget:function(a,c){c=b(c||this.defaultElement||this)[0];this.element=b(c);this.uuid=e++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=b();this.hoverable=b();this.focusable=b();c!==this&&(b.data(c,this.widgetFullName,this),this._on(!0,this.element,{remove:function(a){a.target===c&&this.destroy()}}),this.document=b(c.style?c.ownerDocument:c.document||c),this.window=b(this.document[0].defaultView||this.document[0].parentWindow));this.options=
b.widget.extend({},this.options,this._getCreateOptions(),a);this._create();this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:b.noop,_getCreateEventData:b.noop,_create:b.noop,_init:b.noop,destroy:function(){this._destroy();this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(b.camelCase(this.widgetFullName));this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled");
this.bindings.unbind(this.eventNamespace);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")},_destroy:b.noop,widget:function(){return this.element},option:function(a,c){var g=a,f,h,k;if(0===arguments.length)return b.widget.extend({},this.options);if("string"===typeof a)if(g={},f=a.split("."),a=f.shift(),f.length){h=g[a]=b.widget.extend({},this.options[a]);for(k=0;k<f.length-1;k++)h[f[k]]=h[f[k]]||{},h=h[f[k]];a=f.pop();if(1===arguments.length)return void 0===
h[a]?null:h[a];h[a]=c}else{if(1===arguments.length)return void 0===this.options[a]?null:this.options[a];g[a]=c}this._setOptions(g);return this},_setOptions:function(a){for(var c in a)this._setOption(c,a[c]);return this},_setOption:function(a,c){this.options[a]=c;"disabled"===a&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!c),c&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")));return this},enable:function(){return this._setOptions({disabled:!1})},
disable:function(){return this._setOptions({disabled:!0})},_on:function(a,c,g){var f,h=this;"boolean"!==typeof a&&(g=c,c=a,a=!1);g?(c=f=b(c),this.bindings=this.bindings.add(c)):(g=c,c=this.element,f=this.widget());b.each(g,function(g,e){function p(){if(a||!0!==h.options.disabled&&!b(this).hasClass("ui-state-disabled"))return("string"===typeof e?h[e]:e).apply(h,arguments)}"string"!==typeof e&&(p.guid=e.guid=e.guid||p.guid||b.guid++);var m=g.match(/^([\w:-]*)\s*(.*)$/),n=m[1]+h.eventNamespace;(m=m[2])?
f.delegate(m,n,p):c.bind(n,p)})},_off:function(a,c){c=(c||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;a.unbind(c).undelegate(c);this.bindings=b(this.bindings.not(a).get());this.focusable=b(this.focusable.not(a).get());this.hoverable=b(this.hoverable.not(a).get())},_delay:function(a,c){var b=this;return setTimeout(function(){return("string"===typeof a?b[a]:a).apply(b,arguments)},c||0)},_hoverable:function(a){this.hoverable=this.hoverable.add(a);this._on(a,{mouseenter:function(a){b(a.currentTarget).addClass("ui-state-hover")},
mouseleave:function(a){b(a.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(a){this.focusable=this.focusable.add(a);this._on(a,{focusin:function(a){b(a.currentTarget).addClass("ui-state-focus")},focusout:function(a){b(a.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(a,c,g){var f,h=this.options[a];g=g||{};c=b.Event(c);c.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();c.target=this.element[0];if(a=c.originalEvent)for(f in a)f in c||
(c[f]=a[f]);this.element.trigger(c,g);return!(b.isFunction(h)&&!1===h.apply(this.element[0],[c].concat(g))||c.isDefaultPrevented())}};b.each({show:"fadeIn",hide:"fadeOut"},function(a,c){b.Widget.prototype["_"+a]=function(g,f,h){"string"===typeof f&&(f={effect:f});var k,e=f?!0===f||"number"===typeof f?c:f.effect||c:a;f=f||{};"number"===typeof f&&(f={duration:f});k=!b.isEmptyObject(f);f.complete=h;f.delay&&g.delay(f.delay);if(k&&b.effects&&b.effects.effect[e])g[a](f);else if(e!==a&&g[e])g[e](f.duration,
f.easing,h);else g.queue(function(c){b(this)[a]();h&&h.call(g[0]);c()})}})});
!function(b){var e=function(a,c,b){var f,h,k=document.createElement("img");if(k.onerror=c,k.onload=function(){!h||b&&b.noRevoke||e.revokeObjectURL(h);c&&c(e.scale(k,b))},e.isInstanceOf("Blob",a)||e.isInstanceOf("File",a))f=h=e.createObjectURL(a),k._type=a.type;else{if("string"!=typeof a)return!1;f=a;b&&b.crossOrigin&&(k.crossOrigin=b.crossOrigin)}return f?(k.src=f,k):e.readFile(a,function(a){var d=a.target;d&&d.result?k.src=d.result:c&&c(a)})},a=window.createObjectURL&&window||window.URL&&URL.revokeObjectURL&&
URL||window.webkitURL&&webkitURL;e.isInstanceOf=function(a,c){return Object.prototype.toString.call(c)==="[object "+a+"]"};e.transformCoordinates=function(){};e.getTransformedOptions=function(a,c){var b,f,h,e,l=c.aspectRatio;if(!l)return c;b={};for(f in c)c.hasOwnProperty(f)&&(b[f]=c[f]);return b.crop=!0,h=a.naturalWidth||a.width,e=a.naturalHeight||a.height,h/e>l?(b.maxWidth=e*l,b.maxHeight=e):(b.maxWidth=h,b.maxHeight=h/l),b};e.renderImageToCanvas=function(a,c,b,f,h,e,l,p,m,n){return a.getContext("2d").drawImage(c,
b,f,h,e,l,p,m,n),a};e.hasCanvasOption=function(a){return a.canvas||a.crop||!!a.aspectRatio};e.scale=function(a,c){function b(){var a=Math.max((l||r)/r,(p||t)/t);1<a&&(r*=a,t*=a)}function f(){var a=Math.min((h||r)/r,(k||t)/t);1>a&&(r*=a,t*=a)}c=c||{};var h,k,l,p,m,n,q,u,w,x,A,v=document.createElement("canvas"),B=a.getContext||e.hasCanvasOption(c)&&v.getContext,y=a.naturalWidth||a.width,z=a.naturalHeight||a.height,r=y,t=z;if(B&&(c=e.getTransformedOptions(a,c),q=c.left||0,u=c.top||0,c.sourceWidth?(m=
c.sourceWidth,void 0!==c.right&&void 0===c.left&&(q=y-m-c.right)):m=y-q-(c.right||0),c.sourceHeight?(n=c.sourceHeight,void 0!==c.bottom&&void 0===c.top&&(u=z-n-c.bottom)):n=z-u-(c.bottom||0),r=m,t=n),h=c.maxWidth,k=c.maxHeight,l=c.minWidth,p=c.minHeight,B&&h&&k&&c.crop?(r=h,t=k,A=m/n-h/k,0>A?(n=k*m/h,void 0===c.top&&void 0===c.bottom&&(u=(z-n)/2)):0<A&&(m=h*n/k,void 0===c.left&&void 0===c.right&&(q=(y-m)/2))):((c.contain||c.cover)&&(l=h=h||l,p=k=k||p),c.cover?(f(),b()):(b(),f())),B){if(w=c.pixelRatio,
1<w&&(v.style.width=r+"px",v.style.height=t+"px",r*=w,t*=w,v.getContext("2d").scale(w,w)),x=c.downsamplingRatio,0<x&&1>x&&m>r&&n>t)for(;m*x>r;)v.width=m*x,v.height=n*x,e.renderImageToCanvas(v,a,q,u,m,n,0,0,v.width,v.height),m=v.width,n=v.height,a=document.createElement("canvas"),a.width=m,a.height=n,e.renderImageToCanvas(a,v,0,0,m,n,0,0,m,n);return v.width=r,v.height=t,e.transformCoordinates(v,c),e.renderImageToCanvas(v,a,q,u,m,n,0,0,r,t)}return a.width=r,a.height=t,a};e.createObjectURL=function(b){return a?
a.createObjectURL(b):!1};e.revokeObjectURL=function(b){return a?a.revokeObjectURL(b):!1};e.readFile=function(a,c,b){if(window.FileReader){var f=new FileReader;if(f.onload=f.onerror=c,b=b||"readAsDataURL",f[b])return f[b](a),f}return!1};"function"==typeof define&&define.amd?define(function(){return e}):"object"==typeof module&&module.exports?module.exports=e:b.loadImage=e}(window);
(function(b){"function"==typeof define&&define.amd?define(["./load-image"],b):b("object"==typeof module&&module.exports?require("./load-image"):window.loadImage)})(function(b){var e=b.hasCanvasOption,a=b.transformCoordinates,d=b.getTransformedOptions;b.hasCanvasOption=function(a){return!!a.orientation||e.call(b,a)};b.transformCoordinates=function(c,d){a.call(b,c,d);var f=c.getContext("2d"),h=c.width,e=c.height,l=c.style.width,p=c.style.height,m=d.orientation;if(m&&!(8<m))switch(4<m&&(c.width=e,c.height=
h,c.style.width=p,c.style.height=l),m){case 2:f.translate(h,0);f.scale(-1,1);break;case 3:f.translate(h,e);f.rotate(Math.PI);break;case 4:f.translate(0,e);f.scale(1,-1);break;case 5:f.rotate(.5*Math.PI);f.scale(1,-1);break;case 6:f.rotate(.5*Math.PI);f.translate(0,-e);break;case 7:f.rotate(.5*Math.PI);f.translate(h,-e);f.scale(-1,1);break;case 8:f.rotate(-.5*Math.PI),f.translate(-h,0)}};b.getTransformedOptions=function(a,g){var f,h,e=d.call(b,a,g);f=e.orientation;if(!f||8<f||1===f)return e;f={};for(h in e)e.hasOwnProperty(h)&&
(f[h]=e[h]);switch(e.orientation){case 2:f.left=e.right;f.right=e.left;break;case 3:f.left=e.right;f.top=e.bottom;f.right=e.left;f.bottom=e.top;break;case 4:f.top=e.bottom;f.bottom=e.top;break;case 5:f.left=e.top;f.top=e.left;f.right=e.bottom;f.bottom=e.right;break;case 6:f.left=e.top;f.top=e.right;f.right=e.bottom;f.bottom=e.left;break;case 7:f.left=e.bottom;f.top=e.right;f.right=e.top;f.bottom=e.left;break;case 8:f.left=e.bottom,f.top=e.left,f.right=e.top,f.bottom=e.right}return 4<e.orientation&&
(f.maxWidth=e.maxHeight,f.maxHeight=e.maxWidth,f.minWidth=e.minHeight,f.minHeight=e.minWidth,f.sourceWidth=e.sourceHeight,f.sourceHeight=e.sourceWidth),f}});
(function(b){"function"==typeof define&&define.amd?define(["./load-image"],b):b("object"==typeof module&&module.exports?require("./load-image"):window.loadImage)})(function(b){b.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice)&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)};b.metaDataParsers={jpeg:{65505:[]}};b.parseMetaData=function(e,a,d){d=d||{};var c=this,g=d.maxMetaDataSize||262144,f={};window.DataView&&
e&&12<=e.size&&"image/jpeg"===e.type&&b.blobSlice&&b.readFile(b.blobSlice.call(e,0,g),function(g){if(g.target.error)return console.log(g.target.error),void a(f);var e,l,p,m;g=g.target.result;var n=new DataView(g),q=2,u=n.byteLength-4;p=q;if(65496===n.getUint16(0)){for(;u>q&&(e=n.getUint16(q),65504<=e&&65519>=e||65534===e);){if(l=n.getUint16(q+2)+2,q+l>n.byteLength){console.log("Invalid meta data: Invalid segment size.");break}if(p=b.metaDataParsers.jpeg[e])for(m=0;m<p.length;m+=1)p[m].call(c,n,q,
l,f,d);p=q+=l}!d.disableImageHead&&6<p&&(g.slice?f.imageHead=g.slice(0,p):f.imageHead=(new Uint8Array(g)).subarray(0,p))}else console.log("Invalid JPEG file: Missing JPEG marker.");a(f)},"readAsArrayBuffer")||a(f)}});
(function(b){"function"==typeof define&&define.amd?define(["./load-image","./load-image-meta"],b):"object"==typeof module&&module.exports?b(require("./load-image"),require("./load-image-meta")):b(window.loadImage)})(function(b){b.ExifMap=function(){return this};b.ExifMap.prototype.map={Orientation:274};b.ExifMap.prototype.get=function(b){return this[b]||this[this.map[b]]};b.getExifThumbnail=function(b,a,d){var c,g,f;if(!d||a+d>b.byteLength)return void console.log("Invalid Exif data: Invalid thumbnail data.");
c=[];for(g=0;d>g;g+=1)f=b.getUint8(a+g),c.push((16>f?"0":"")+f.toString(16));return"data:image/jpeg,%"+c.join("%")};b.exifTagTypes={1:{getValue:function(b,a){return b.getUint8(a)},size:1},2:{getValue:function(b,a){return String.fromCharCode(b.getUint8(a))},size:1,ascii:!0},3:{getValue:function(b,a,d){return b.getUint16(a,d)},size:2},4:{getValue:function(b,a,d){return b.getUint32(a,d)},size:4},5:{getValue:function(b,a,d){return b.getUint32(a,d)/b.getUint32(a+4,d)},size:8},9:{getValue:function(b,a,
d){return b.getInt32(a,d)},size:4},10:{getValue:function(b,a,d){return b.getInt32(a,d)/b.getInt32(a+4,d)},size:8}};b.exifTagTypes[7]=b.exifTagTypes[1];b.getExifValue=function(e,a,d,c,g,f){var h,k,l;c=b.exifTagTypes[c];if(!c)return void console.log("Invalid Exif data: Invalid tag type.");if(h=c.size*g,k=4<h?a+e.getUint32(d+8,f):d+8,k+h>e.byteLength)return void console.log("Invalid Exif data: Invalid data offset.");if(1===g)return c.getValue(e,k,f);a=[];for(d=0;g>d;d+=1)a[d]=c.getValue(e,k+d*c.size,
f);if(c.ascii){e="";for(d=0;d<a.length&&(l=a[d],"\x00"!==l);d+=1)e+=l;return e}return a};b.parseExifTag=function(e,a,d,c,g){var f=e.getUint16(d,c);g.exif[f]=b.getExifValue(e,a,d,e.getUint16(d+2,c),e.getUint32(d+4,c),c)};b.parseExifTags=function(b,a,d,c,g){var f,h,k;if(d+6>b.byteLength)return void console.log("Invalid Exif data: Invalid directory offset.");if(f=b.getUint16(d,c),h=d+2+12*f,h+4>b.byteLength)return void console.log("Invalid Exif data: Invalid directory size.");for(k=0;f>k;k+=1)this.parseExifTag(b,
a,d+2+12*k,c,g);return b.getUint32(h,c)};b.parseExifData=function(e,a,d,c,g){if(!g.disableExif){var f,h;d=a+10;if(1165519206===e.getUint32(a+4)){if(d+8>e.byteLength)return void console.log("Invalid Exif data: Invalid segment size.");if(0!==e.getUint16(a+8))return void console.log("Invalid Exif data: Missing byte alignment offset.");switch(e.getUint16(d)){case 18761:a=!0;break;case 19789:a=!1;break;default:return void console.log("Invalid Exif data: Invalid byte alignment marker.")}if(42!==e.getUint16(d+
2,a))return void console.log("Invalid Exif data: Missing TIFF marker.");f=e.getUint32(d+4,a);c.exif=new b.ExifMap;(f=b.parseExifTags(e,d,d+f,a,c))&&!g.disableExifThumbnail&&(h={exif:{}},b.parseExifTags(e,d,d+f,a,h),h.exif[513]&&(c.exif.Thumbnail=b.getExifThumbnail(e,d+h.exif[513],h.exif[514])));c.exif[34665]&&!g.disableExifSub&&b.parseExifTags(e,d,d+c.exif[34665],a,c);c.exif[34853]&&!g.disableExifGps&&b.parseExifTags(e,d,d+c.exif[34853],a,c)}}};b.metaDataParsers.jpeg[65505].push(b.parseExifData)});
(function(b){"function"==typeof define&&define.amd?define(["./load-image","./load-image-exif"],b):"object"==typeof module&&module.exports?b(require("./load-image"),require("./load-image-exif")):b(window.loadImage)})(function(b){b.ExifMap.prototype.tags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",
530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright",36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",
40962:"PixelXDimension",40963:"PixelYDimension",42240:"Gamma",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"PhotographicSensitivity",34856:"OECF",34864:"SensitivityType",34865:"StandardOutputSensitivity",
34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",
41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:"LensSpecification",42035:"LensMake",42036:"LensModel",
42037:"LensSerialNumber",0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",
26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"};b.ExifMap.prototype.stringValues={ExposureProgram:{0:"Undefined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",
1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",
7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",
71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},
SensingMethod:{1:"Undefined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",
4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},ComponentsConfiguration:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"},Orientation:{1:"top-left",2:"top-right",3:"bottom-right",4:"bottom-left",5:"left-top",6:"right-top",7:"right-bottom",8:"left-bottom"}};b.ExifMap.prototype.getText=function(b){var a=
this.get(b);switch(b){case "LightSource":case "Flash":case "MeteringMode":case "ExposureProgram":case "SensingMethod":case "SceneCaptureType":case "SceneType":case "CustomRendered":case "WhiteBalance":case "GainControl":case "Contrast":case "Saturation":case "Sharpness":case "SubjectDistanceRange":case "FileSource":case "Orientation":return this.stringValues[b][a];case "ExifVersion":case "FlashpixVersion":return String.fromCharCode(a[0],a[1],a[2],a[3]);case "ComponentsConfiguration":return this.stringValues[b][a[0]]+
this.stringValues[b][a[1]]+this.stringValues[b][a[2]]+this.stringValues[b][a[3]];case "GPSVersionID":return a[0]+"."+a[1]+"."+a[2]+"."+a[3]}return String(a)};(function(b){var a,d=b.tags;b=b.map;for(a in d)d.hasOwnProperty(a)&&(b[d[a]]=a)})(b.ExifMap.prototype);b.ExifMap.prototype.getAll=function(){var b,a,d={};for(b in this)this.hasOwnProperty(b)&&(a=this.tags[b],a&&(d[a]=this.getText(a)));return d}});
!function(b){var e=b.HTMLCanvasElement&&b.HTMLCanvasElement.prototype,a;if(a=b.Blob)try{a=!!new Blob}catch(k){a=!1}var d=a;if(a=d&&b.Uint8Array)try{a=100===(new Blob([new Uint8Array(100)])).size}catch(k){a=!1}var c=a,g=b.BlobBuilder||b.WebKitBlobBuilder||b.MozBlobBuilder||b.MSBlobBuilder,f=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,h=(d||g)&&b.atob&&b.ArrayBuffer&&b.Uint8Array&&function(a){var b,e,h,n,q;if(b=a.match(f),!b)throw Error("invalid data URI");e=b[2]?b[1]:"text/plain"+(b[3]||";charset=US-ASCII");
h=!!b[4];a=a.slice(b[0].length);h=h?atob(a):decodeURIComponent(a);a=new ArrayBuffer(h.length);b=new Uint8Array(a);for(n=0;n<h.length;n+=1)b[n]=h.charCodeAt(n);return d?new Blob([c?b:a],{type:e}):(q=new g,q.append(a),q.getBlob(e))};b.HTMLCanvasElement&&!e.toBlob&&(e.mozGetAsFile?e.toBlob=function(a,b,c){a(c&&e.toDataURL&&h?h(this.toDataURL(b,c)):this.mozGetAsFile("blob",b))}:e.toDataURL&&h&&(e.toBlob=function(a,b,c){a(h(this.toDataURL(b,c)))}));"function"==typeof define&&define.amd?define(function(){return h}):
"object"==typeof module&&module.exports?module.exports=h:b.dataURLtoBlob=h}(window);
(function(b){"function"===typeof define&&define.amd?define(["jquery"],b):"object"===typeof exports?b(require("jquery")):b(window.jQuery)})(function(b){var e=0;b.ajaxTransport("iframe",function(a){if(a.async){var d=a.initialIframeSrc||"javascript:false;",c,g,f;return{send:function(h,k){c=b('<form style="display:none;"></form>');c.attr("accept-charset",a.formAcceptCharset);f=/\?/.test(a.url)?"&":"?";"DELETE"===a.type?(a.url=a.url+f+"_method=DELETE",a.type="POST"):"PUT"===a.type?(a.url=a.url+f+"_method=PUT",
a.type="POST"):"PATCH"===a.type&&(a.url=a.url+f+"_method=PATCH",a.type="POST");e+=1;g=b('<iframe src="'+d+'" name="iframe-transport-'+e+'"></iframe>').bind("load",function(){var f,e=b.isArray(a.paramName)?a.paramName:[a.paramName];g.unbind("load").bind("load",function(){var a;try{if(a=g.contents(),!a.length||!a[0].firstChild)throw Error();}catch(f){a=void 0}k(200,"success",{iframe:a});b('<iframe src="'+d+'"></iframe>').appendTo(c);window.setTimeout(function(){c.remove()},0)});c.prop("target",g.prop("name")).prop("action",
a.url).prop("method",a.type);a.formData&&b.each(a.formData,function(a,d){b('<input type="hidden"/>').prop("name",d.name).val(d.value).appendTo(c)});a.fileInput&&a.fileInput.length&&"POST"===a.type&&(f=a.fileInput.clone(),a.fileInput.after(function(a){return f[a]}),a.paramName&&a.fileInput.each(function(c){b(this).prop("name",e[c]||a.paramName)}),c.append(a.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"),a.fileInput.removeAttr("form"));c.submit();f&&f.length&&
a.fileInput.each(function(a,c){var d=b(f[a]);b(c).prop("name",d.prop("name")).attr("form",d.attr("form"));d.replaceWith(c)})});c.append(g).appendTo(document.body)},abort:function(){g&&g.unbind("load").prop("src",d);c&&c.remove()}}}});b.ajaxSetup({converters:{"iframe text":function(a){return a&&b(a[0].body).text()},"iframe json":function(a){return a&&b.parseJSON(b(a[0].body).text())},"iframe html":function(a){return a&&b(a[0].body).html()},"iframe xml":function(a){return(a=a&&a[0])&&b.isXMLDoc(a)?
a:b.parseXML(a.XMLDocument&&a.XMLDocument.xml||b(a.body).html())},"iframe script":function(a){return a&&b.globalEval(b(a[0].body).text())}}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","jquery.ui.widget"],b):"object"===typeof exports?b(require("jquery"),require("./vendor/jquery.ui.widget")):b(window.jQuery)})(function(b){function e(a){var d="dragover"===a;return function(c){c.dataTransfer=c.originalEvent&&c.originalEvent.dataTransfer;var g=c.dataTransfer;g&&-1!==b.inArray("Files",g.types)&&!1!==this._trigger(a,b.Event(a,{delegatedEvent:c}))&&(c.preventDefault(),d&&(g.dropEffect="copy"))}}b.support.fileInput=!(/(Android (1\.[0156]|2\.[01]))|(Windows Phone (OS 7|8\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1\.0|2\.[05]|3\.0))/.test(window.navigator.userAgent)||
b('<input type="file">').prop("disabled"));b.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader);b.support.xhrFormDataFileUpload=!!window.FormData;b.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice);b.widget("blueimp.fileupload",{options:{dropZone:b(document),pasteZone:void 0,fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,limitMultiFileUploadSize:void 0,limitMultiFileUploadSizeOverhead:512,
sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(a,d){a=this.messages[a]||a.toString();d&&b.each(d,function(b,d){a=a.replace("{"+b+"}",d)});return a},formData:function(a){return a.serializeArray()},add:function(a,
d){if(a.isDefaultPrevented())return!1;(d.autoUpload||!1!==d.autoUpload&&b(this).fileupload("option","autoUpload"))&&d.process().done(function(){d.submit()})},processData:!1,contentType:!1,cache:!1,timeout:0},_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:b.support.blobSlice&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime();this.bitrate=
this.loaded=0;this.getBitrate=function(a,b,c){var g=a-this.timestamp;if(!this.bitrate||!c||g>c)this.bitrate=1E3/g*(b-this.loaded)*8,this.loaded=b,this.timestamp=a;return this.bitrate}},_isXHRUpload:function(a){return!a.forceIframeTransport&&(!a.multipart&&b.support.xhrFileUpload||b.support.xhrFormDataFileUpload)},_getFormData:function(a){var d;return"function"===b.type(a.formData)?a.formData(a.form):b.isArray(a.formData)?a.formData:"object"===b.type(a.formData)?(d=[],b.each(a.formData,function(a,
b){d.push({name:a,value:b})}),d):[]},_getTotal:function(a){var d=0;b.each(a,function(a,b){d+=b.size||1});return d},_initProgressObject:function(a){var d={loaded:0,total:0,bitrate:0};a._progress?b.extend(a._progress,d):a._progress=d},_initResponseObject:function(a){var b;if(a._response)for(b in a._response)a._response.hasOwnProperty(b)&&delete a._response[b];else a._response={}},_onProgress:function(a,d){if(a.lengthComputable){var c=Date.now?Date.now():(new Date).getTime(),g;d._time&&d.progressInterval&&
c-d._time<d.progressInterval&&a.loaded!==a.total||(d._time=c,g=Math.floor(a.loaded/a.total*(d.chunkSize||d._progress.total))+(d.uploadedBytes||0),this._progress.loaded+=g-d._progress.loaded,this._progress.bitrate=this._bitrateTimer.getBitrate(c,this._progress.loaded,d.bitrateInterval),d._progress.loaded=d.loaded=g,d._progress.bitrate=d.bitrate=d._bitrateTimer.getBitrate(c,g,d.bitrateInterval),this._trigger("progress",b.Event("progress",{delegatedEvent:a}),d),this._trigger("progressall",b.Event("progressall",
{delegatedEvent:a}),this._progress))}},_initProgressListener:function(a){var d=this,c=a.xhr?a.xhr():b.ajaxSettings.xhr();c.upload&&(b(c.upload).bind("progress",function(b){var c=b.originalEvent;b.lengthComputable=c.lengthComputable;b.loaded=c.loaded;b.total=c.total;d._onProgress(b,a)}),a.xhr=function(){return c})},_isInstanceOf:function(a,b){return Object.prototype.toString.call(b)==="[object "+a+"]"},_initXHRData:function(a){var d=this,c,g=a.files[0],f=a.multipart||!b.support.xhrFileUpload,e="array"===
b.type(a.paramName)?a.paramName[0]:a.paramName;a.headers=b.extend({},a.headers);a.contentRange&&(a.headers["Content-Range"]=a.contentRange);f&&!a.blob&&this._isInstanceOf("File",g)||(a.headers["Content-Disposition"]='attachment; filename="'+encodeURI(g.name)+'"');f?b.support.xhrFormDataFileUpload&&(a.postMessage?(c=this._getFormData(a),a.blob?c.push({name:e,value:a.blob}):b.each(a.files,function(d,f){c.push({name:"array"===b.type(a.paramName)&&a.paramName[d]||e,value:f})})):(d._isInstanceOf("FormData",
a.formData)?c=a.formData:(c=new FormData,b.each(this._getFormData(a),function(a,b){c.append(b.name,b.value)})),a.blob?c.append(e,a.blob,g.name):b.each(a.files,function(f,g){(d._isInstanceOf("File",g)||d._isInstanceOf("Blob",g))&&c.append("array"===b.type(a.paramName)&&a.paramName[f]||e,g,g.uploadName||g.name)})),a.data=c):(a.contentType=g.type||"application/octet-stream",a.data=a.blob||g);a.blob=null},_initIframeSettings:function(a){var d=b("<a></a>").prop("href",a.url).prop("host");a.dataType="iframe "+
(a.dataType||"");a.formData=this._getFormData(a);a.redirect&&d&&d!==location.host&&a.formData.push({name:a.redirectParamName||"redirect",value:a.redirect})},_initDataSettings:function(a){this._isXHRUpload(a)?(this._chunkedUpload(a,!0)||(a.data||this._initXHRData(a),this._initProgressListener(a)),a.postMessage&&(a.dataType="postmessage "+(a.dataType||""))):this._initIframeSettings(a)},_getParamName:function(a){var d=b(a.fileInput),c=a.paramName;c?b.isArray(c)||(c=[c]):(c=[],d.each(function(){for(var a=
b(this),d=a.prop("name")||"files[]",a=(a.prop("files")||[1]).length;a;)c.push(d),--a}),c.length||(c=[d.prop("name")||"files[]"]));return c},_initFormSettings:function(a){a.form&&a.form.length||(a.form=b(a.fileInput.prop("form")),a.form.length||(a.form=b(this.options.fileInput.prop("form"))));a.paramName=this._getParamName(a);a.url||(a.url=a.form.prop("action")||location.href);a.type=(a.type||"string"===b.type(a.form.prop("method"))&&a.form.prop("method")||"").toUpperCase();"POST"!==a.type&&"PUT"!==
a.type&&"PATCH"!==a.type&&(a.type="POST");a.formAcceptCharset||(a.formAcceptCharset=a.form.attr("accept-charset"))},_getAJAXSettings:function(a){a=b.extend({},this.options,a);this._initFormSettings(a);this._initDataSettings(a);return a},_getDeferredState:function(a){return a.state?a.state():a.isResolved()?"resolved":a.isRejected()?"rejected":"pending"},_enhancePromise:function(a){a.success=a.done;a.error=a.fail;a.complete=a.always;return a},_getXHRPromise:function(a,d,c){var g=b.Deferred(),f=g.promise();
d=d||this.options.context||f;!0===a?g.resolveWith(d,c):!1===a&&g.rejectWith(d,c);f.abort=g.promise;return this._enhancePromise(f)},_addConvenienceMethods:function(a,d){var c=this,g=function(a){return b.Deferred().resolveWith(c,a).promise()};d.process=function(a,e){if(a||e)d._processQueue=this._processQueue=(this._processQueue||g([this])).then(function(){return d.errorThrown?b.Deferred().rejectWith(c,[d]).promise():g(arguments)}).then(a,e);return this._processQueue||g([this])};d.submit=function(){"pending"!==
this.state()&&(d.jqXHR=this.jqXHR=!1!==c._trigger("submit",b.Event("submit",{delegatedEvent:a}),this)&&c._onSend(a,this));return this.jqXHR||c._getXHRPromise()};d.abort=function(){if(this.jqXHR)return this.jqXHR.abort();this.errorThrown="abort";c._trigger("fail",null,this);return c._getXHRPromise(!1)};d.state=function(){if(this.jqXHR)return c._getDeferredState(this.jqXHR);if(this._processQueue)return c._getDeferredState(this._processQueue)};d.processing=function(){return!this.jqXHR&&this._processQueue&&
"pending"===c._getDeferredState(this._processQueue)};d.progress=function(){return this._progress};d.response=function(){return this._response}},_getUploadedBytes:function(a){return(a=(a=(a=a.getResponseHeader("Range"))&&a.split("-"))&&1<a.length&&parseInt(a[1],10))&&a+1},_chunkedUpload:function(a,d){a.uploadedBytes=a.uploadedBytes||0;var c=this,g=a.files[0],f=g.size,e=a.uploadedBytes,k=a.maxChunkSize||f,l=this._blobSlice,p=b.Deferred(),m=p.promise(),n,q;if(!(this._isXHRUpload(a)&&l&&(e||k<f))||a.data)return!1;
if(d)return!0;if(e>=f)return g.error=a.i18n("uploadedBytes"),this._getXHRPromise(!1,a.context,[null,"error",g.error]);q=function(){var d=b.extend({},a),m=d._progress.loaded;d.blob=l.call(g,e,e+k,g.type);d.chunkSize=d.blob.size;d.contentRange="bytes "+e+"-"+(e+d.chunkSize-1)+"/"+f;c._initXHRData(d);c._initProgressListener(d);n=(!1!==c._trigger("chunksend",null,d)&&b.ajax(d)||c._getXHRPromise(!1,d.context)).done(function(g,k,l){e=c._getUploadedBytes(l)||e+d.chunkSize;m+d.chunkSize-d._progress.loaded&&
c._onProgress(b.Event("progress",{lengthComputable:!0,loaded:e-d.uploadedBytes,total:e-d.uploadedBytes}),d);a.uploadedBytes=d.uploadedBytes=e;d.result=g;d.textStatus=k;d.jqXHR=l;c._trigger("chunkdone",null,d);c._trigger("chunkalways",null,d);e<f?q():p.resolveWith(d.context,[g,k,l])}).fail(function(a,b,f){d.jqXHR=a;d.textStatus=b;d.errorThrown=f;c._trigger("chunkfail",null,d);c._trigger("chunkalways",null,d);p.rejectWith(d.context,[a,b,f])})};this._enhancePromise(m);m.abort=function(){return n.abort()};
q();return m},_beforeSend:function(a,b){0===this._active&&(this._trigger("start"),this._bitrateTimer=new this._BitrateTimer,this._progress.loaded=this._progress.total=0,this._progress.bitrate=0);this._initResponseObject(b);this._initProgressObject(b);b._progress.loaded=b.loaded=b.uploadedBytes||0;b._progress.total=b.total=this._getTotal(b.files)||1;b._progress.bitrate=b.bitrate=0;this._active+=1;this._progress.loaded+=b.loaded;this._progress.total+=b.total},_onDone:function(a,d,c,g){var f=g._progress.total,
e=g._response;g._progress.loaded<f&&this._onProgress(b.Event("progress",{lengthComputable:!0,loaded:f,total:f}),g);e.result=g.result=a;e.textStatus=g.textStatus=d;e.jqXHR=g.jqXHR=c;this._trigger("done",null,g)},_onFail:function(a,b,c,g){var f=g._response;g.recalculateProgress&&(this._progress.loaded-=g._progress.loaded,this._progress.total-=g._progress.total);f.jqXHR=g.jqXHR=a;f.textStatus=g.textStatus=b;f.errorThrown=g.errorThrown=c;this._trigger("fail",null,g)},_onAlways:function(a,b,c,g){this._trigger("always",
null,g)},_onSend:function(a,d){d.submit||this._addConvenienceMethods(a,d);var c=this,g,f,e,k,l=c._getAJAXSettings(d),p=function(){c._sending+=1;l._bitrateTimer=new c._BitrateTimer;return g=g||((f||!1===c._trigger("send",b.Event("send",{delegatedEvent:a}),l))&&c._getXHRPromise(!1,l.context,f)||c._chunkedUpload(l)||b.ajax(l)).done(function(a,b,d){c._onDone(a,b,d,l)}).fail(function(a,b,d){c._onFail(a,b,d,l)}).always(function(a,b,d){c._onAlways(a,b,d,l);--c._sending;--c._active;if(l.limitConcurrentUploads&&
l.limitConcurrentUploads>c._sending)for(a=c._slots.shift();a;){if("pending"===c._getDeferredState(a)){a.resolve();break}a=c._slots.shift()}0===c._active&&c._trigger("stop")})};this._beforeSend(a,l);return this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(1<this.options.limitConcurrentUploads?(e=b.Deferred(),this._slots.push(e),k=e.then(p)):k=this._sequence=this._sequence.then(p,p),k.abort=function(){f=[void 0,"abort","abort"];
return g?g.abort():(e&&e.rejectWith(l.context,f),p())},this._enhancePromise(k)):p()},_onAdd:function(a,d){var c=this,g=!0,f=b.extend({},this.options,d),e=d.files,k=e.length,l=f.limitMultiFileUploads,p=f.limitMultiFileUploadSize,m=f.limitMultiFileUploadSizeOverhead,n=0,q=this._getParamName(f),u,w,x=0;if(!k)return!1;p&&void 0===e[0].size&&(p=void 0);if((f.singleFileUploads||l||p)&&this._isXHRUpload(f))if(f.singleFileUploads||p||!l)if(!f.singleFileUploads&&p)for(w=[],u=[],f=0;f<k;f+=1){if(n+=e[f].size+
m,f+1===k||n+e[f+1].size+m>p||l&&f+1-x>=l)w.push(e.slice(x,f+1)),n=q.slice(x,f+1),n.length||(n=q),u.push(n),x=f+1,n=0}else u=q;else for(w=[],u=[],f=0;f<k;f+=l)w.push(e.slice(f,f+l)),n=q.slice(f,f+l),n.length||(n=q),u.push(n);else w=[e],u=[q];d.originalFiles=e;b.each(w||e,function(f,e){var h=b.extend({},d);h.files=w?e:[e];h.paramName=u[f];c._initResponseObject(h);c._initProgressObject(h);c._addConvenienceMethods(a,h);return g=c._trigger("add",b.Event("add",{delegatedEvent:a}),h)});return g},_replaceFileInput:function(a){var d=
a.fileInput,c=d.clone(!0),g=d.is(document.activeElement);a.fileInputClone=c;b("<form></form>").append(c)[0].reset();d.after(c).detach();g&&c.focus();b.cleanData(d.unbind("remove"));this.options.fileInput=this.options.fileInput.map(function(a,b){return b===d[0]?c[0]:b});d[0]===this.element[0]&&(this.element=c)},_handleFileTreeEntry:function(a,d){var c=this,g=b.Deferred(),f=function(b){b&&!b.entry&&(b.entry=a);g.resolve([b])},e=function(b){c._handleFileTreeEntries(b,d+a.name+"/").done(function(a){g.resolve(a)}).fail(f)},
k=function(){l.readEntries(function(a){a.length?(p=p.concat(a),k()):e(p)},f)},l,p=[];d=d||"";a.isFile?a._file?(a._file.relativePath=d,g.resolve(a._file)):a.file(function(a){a.relativePath=d;g.resolve(a)},f):a.isDirectory?(l=a.createReader(),k()):g.resolve([]);return g.promise()},_handleFileTreeEntries:function(a,d){var c=this;return b.when.apply(b,b.map(a,function(a){return c._handleFileTreeEntry(a,d)})).then(function(){return Array.prototype.concat.apply([],arguments)})},_getDroppedFiles:function(a){a=
a||{};var d=a.items;return d&&d.length&&(d[0].webkitGetAsEntry||d[0].getAsEntry)?this._handleFileTreeEntries(b.map(d,function(a){var b;if(a.webkitGetAsEntry){if(b=a.webkitGetAsEntry())b._file=a.getAsFile();return b}return a.getAsEntry()})):b.Deferred().resolve(b.makeArray(a.files)).promise()},_getSingleFileInputFiles:function(a){a=b(a);var d=a.prop("webkitEntries")||a.prop("entries");if(d&&d.length)return this._handleFileTreeEntries(d);d=b.makeArray(a.prop("files"));if(d.length)void 0===d[0].name&&
d[0].fileName&&b.each(d,function(a,b){b.name=b.fileName;b.size=b.fileSize});else{a=a.prop("value");if(!a)return b.Deferred().resolve([]).promise();d=[{name:a.replace(/^.*\\/,"")}]}return b.Deferred().resolve(d).promise()},_getFileInputFiles:function(a){return a instanceof b&&1!==a.length?b.when.apply(b,b.map(a,this._getSingleFileInputFiles)).then(function(){return Array.prototype.concat.apply([],arguments)}):this._getSingleFileInputFiles(a)},_onChange:function(a){var d=this,c={fileInput:b(a.target),
form:b(a.target.form)};this._getFileInputFiles(c.fileInput).always(function(e){c.files=e;d.options.replaceFileInput&&d._replaceFileInput(c);!1!==d._trigger("change",b.Event("change",{delegatedEvent:a}),c)&&d._onAdd(a,c)})},_onPaste:function(a){var d=a.originalEvent&&a.originalEvent.clipboardData&&a.originalEvent.clipboardData.items,c={files:[]};d&&d.length&&(b.each(d,function(a,b){var d=b.getAsFile&&b.getAsFile();d&&c.files.push(d)}),!1!==this._trigger("paste",b.Event("paste",{delegatedEvent:a}),
c)&&this._onAdd(a,c))},_onDrop:function(a){a.dataTransfer=a.originalEvent&&a.originalEvent.dataTransfer;var d=this,c=a.dataTransfer,e={};c&&c.files&&c.files.length&&(a.preventDefault(),this._getDroppedFiles(c).always(function(c){e.files=c;!1!==d._trigger("drop",b.Event("drop",{delegatedEvent:a}),e)&&d._onAdd(a,e)}))},_onDragOver:e("dragover"),_onDragEnter:e("dragenter"),_onDragLeave:e("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,
drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste}));b.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop");this._off(this.options.pasteZone,"paste");this._off(this.options.fileInput,"change")},_setOption:function(a,d){var c=-1!==b.inArray(a,this._specialOptions);c&&this._destroyEventHandlers();
this._super(a,d);c&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var a=this.options;void 0===a.fileInput?a.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):a.fileInput instanceof b||(a.fileInput=b(a.fileInput));a.dropZone instanceof b||(a.dropZone=b(a.dropZone));a.pasteZone instanceof b||(a.pasteZone=b(a.pasteZone))},_getRegExp:function(a){a=a.split("/");var b=a.pop();a.shift();return new RegExp(a.join("/"),
b)},_isRegExpOption:function(a,d){return"url"!==a&&"string"===b.type(d)&&/^\/.*\/[igm]{0,3}$/.test(d)},_initDataAttributes:function(){var a=this,d=this.options,c=this.element.data();b.each(this.element[0].attributes,function(b,f){var e=f.name.toLowerCase(),k;/^data-/.test(e)&&(e=e.slice(5).replace(/-[a-z]/g,function(a){return a.charAt(1).toUpperCase()}),k=c[e],a._isRegExpOption(e,k)&&(k=a._getRegExp(k)),d[e]=k)})},_create:function(){this._initDataAttributes();this._initSpecialOptions();this._slots=
[];this._sequence=this._getXHRPromise(!0);this._sending=this._active=0;this._initProgressObject(this);this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(a){var d=this;a&&!this.options.disabled&&(a.fileInput&&!a.files?this._getFileInputFiles(a.fileInput).always(function(b){a.files=b;d._onAdd(null,a)}):(a.files=b.makeArray(a.files),this._onAdd(null,a)))},send:function(a){if(a&&!this.options.disabled){if(a.fileInput&&!a.files){var d=
this,c=b.Deferred(),e=c.promise(),f,h;e.abort=function(){h=!0;if(f)return f.abort();c.reject(null,"abort","abort");return e};this._getFileInputFiles(a.fileInput).always(function(b){h||(b.length?(a.files=b,f=d._onSend(null,a),f.then(function(a,b,d){c.resolve(a,b,d)},function(a,b,d){c.reject(a,b,d)})):c.reject())});return this._enhancePromise(e)}a.files=b.makeArray(a.files);if(a.files.length)return this._onSend(null,a)}return this._getXHRPromise(!1,a&&a.context)}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","./jquery.fileupload"],b):"object"===typeof exports?b(require("jquery")):b(window.jQuery)})(function(b){var e=b.blueimp.fileupload.prototype.options.add;b.widget("blueimp.fileupload",b.blueimp.fileupload,{options:{processQueue:[],add:function(a,d){var c=b(this);d.process(function(){return c.fileupload("process",d)});e.call(this,a,d)}},processActions:{},_processFile:function(a,d){var c=this,e=b.Deferred().resolveWith(c,[a]).promise();
this._trigger("process",null,a);b.each(a.processQueue,function(a,h){var k=function(a){return d.errorThrown?b.Deferred().rejectWith(c,[d]).promise():c.processActions[h.action].call(c,a,h)};e=e.then(k,h.always&&k)});e.done(function(){c._trigger("processdone",null,a);c._trigger("processalways",null,a)}).fail(function(){c._trigger("processfail",null,a);c._trigger("processalways",null,a)});return e},_transformProcessQueue:function(a){var d=[];b.each(a.processQueue,function(){var c={},e=this.action,f=!0===
this.prefix?e:this.prefix;b.each(this,function(d,e){"string"===b.type(e)&&"@"===e.charAt(0)?c[d]=a[e.slice(1)||(f?f+d.charAt(0).toUpperCase()+d.slice(1):d)]:c[d]=e});d.push(c)});a.processQueue=d},processing:function(){return this._processing},process:function(a){var d=this,c=b.extend({},this.options,a);c.processQueue&&c.processQueue.length&&(this._transformProcessQueue(c),0===this._processing&&this._trigger("processstart"),b.each(a.files,function(e){var f=e?b.extend({},c):c,h=function(){return a.errorThrown?
b.Deferred().rejectWith(d,[a]).promise():d._processFile(f,a)};f.index=e;d._processing+=1;d._processingQueue=d._processingQueue.then(h,h).always(function(){--d._processing;0===d._processing&&d._trigger("processstop")})}));return this._processingQueue},_create:function(){this._super();this._processing=0;this._processingQueue=b.Deferred().resolveWith(this).promise()}})});
(function(b){"function"===typeof define&&define.amd?define("jquery load-image load-image-meta load-image-exif canvas-to-blob ./jquery.fileupload-process".split(" "),b):"object"===typeof exports?b(require("jquery"),require("blueimp-load-image/js/load-image"),require("blueimp-load-image/js/load-image-meta"),require("blueimp-load-image/js/load-image-exif"),require("blueimp-canvas-to-blob"),require("./jquery.fileupload-process")):b(window.jQuery,window.loadImage)})(function(b,e){b.blueimp.fileupload.prototype.options.processQueue.unshift({action:"loadImageMetaData",
disableImageHead:"@",disableExif:"@",disableExifThumbnail:"@",disableExifSub:"@",disableExifGps:"@",disabled:"@disableImageMetaDataLoad"},{action:"loadImage",prefix:!0,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"});b.widget("blueimp.fileupload",b.blueimp.fileupload,{options:{loadImageFileTypes:/^image\/(gif|jpeg|png|svg\+xml)$/,loadImageMaxFileSize:1E7,
imageMaxWidth:1920,imageMaxHeight:1080,imageOrientation:!1,imageCrop:!1,disableImageResize:!0,previewMaxWidth:80,previewMaxHeight:80,previewOrientation:!0,previewThumbnail:!0,previewCrop:!1,previewCanvas:!0},processActions:{loadImage:function(a,d){if(d.disabled)return a;var c=this,g=a.files[a.index],f=b.Deferred();return"number"===b.type(d.maxFileSize)&&g.size>d.maxFileSize||d.fileTypes&&!d.fileTypes.test(g.type)||!e(g,function(b){b.src&&(a.img=b);f.resolveWith(c,[a])},d)?a:f.promise()},resizeImage:function(a,
d){if(d.disabled||!a.canvas&&!a.img)return a;d=b.extend({canvas:!0},d);var c=this,g=b.Deferred(),f=d.canvas&&a.canvas||a.img,h=function(b){b&&(b.width!==f.width||b.height!==f.height||d.forceResize)&&(a[b.getContext?"canvas":"img"]=b);a.preview=b;g.resolveWith(c,[a])},k;if(a.exif){!0===d.orientation&&(d.orientation=a.exif.get("Orientation"));if(d.thumbnail&&(k=a.exif.get("Thumbnail")))return e(k,h,d),g.promise();a.orientation?delete d.orientation:a.orientation=d.orientation}return f?(h(e.scale(f,d)),
g.promise()):a},saveImage:function(a,d){if(!a.canvas||d.disabled)return a;var c=this,e=a.files[a.index],f=b.Deferred();if(a.canvas.toBlob)a.canvas.toBlob(function(b){b.name||(e.type===b.type?b.name=e.name:e.name&&(b.name=e.name.replace(/\.\w+$/,"."+b.type.substr(6))));e.type!==b.type&&delete a.imageHead;a.files[a.index]=b;f.resolveWith(c,[a])},d.type||e.type,d.quality);else return a;return f.promise()},loadImageMetaData:function(a,d){if(d.disabled)return a;var c=this,g=b.Deferred();e.parseMetaData(a.files[a.index],
function(d){b.extend(a,d);g.resolveWith(c,[a])},d);return g.promise()},saveImageMetaData:function(a,b){if(!(a.imageHead&&a.canvas&&a.canvas.toBlob)||b.disabled)return a;var c=a.files[a.index],e=new Blob([a.imageHead,this._blobSlice.call(c,20)],{type:c.type});e.name=c.name;a.files[a.index]=e;return a},setImage:function(a,b){a.preview&&!b.disabled&&(a.files[a.index][b.name||"preview"]=a.preview);return a},deleteImageReferences:function(a,b){b.disabled||(delete a.img,delete a.canvas,delete a.preview,
delete a.imageHead);return a}}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","load-image","./jquery.fileupload-process"],b):"object"===typeof exports?b(require("jquery"),require("load-image")):b(window.jQuery,window.loadImage)})(function(b,e){b.blueimp.fileupload.prototype.options.processQueue.unshift({action:"loadAudio",prefix:!0,fileTypes:"@",maxFileSize:"@",disabled:"@disableAudioPreview"},{action:"setAudio",name:"@audioPreviewName",disabled:"@disableAudioPreview"});b.widget("blueimp.fileupload",b.blueimp.fileupload,
{options:{loadAudioFileTypes:/^audio\/.*$/},_audioElement:document.createElement("audio"),processActions:{loadAudio:function(a,d){if(d.disabled)return a;var c=a.files[a.index],g;this._audioElement.canPlayType&&this._audioElement.canPlayType(c.type)&&("number"!==b.type(d.maxFileSize)||c.size<=d.maxFileSize)&&(!d.fileTypes||d.fileTypes.test(c.type))&&(c=e.createObjectURL(c))&&(g=this._audioElement.cloneNode(!1),g.src=c,g.controls=!0,a.audio=g);return a},setAudio:function(a,b){a.audio&&!b.disabled&&
(a.files[a.index][b.name||"preview"]=a.audio);return a}}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","load-image","./jquery.fileupload-process"],b):"object"===typeof exports?b(require("jquery"),require("load-image")):b(window.jQuery,window.loadImage)})(function(b,e){b.blueimp.fileupload.prototype.options.processQueue.unshift({action:"loadVideo",prefix:!0,fileTypes:"@",maxFileSize:"@",disabled:"@disableVideoPreview"},{action:"setVideo",name:"@videoPreviewName",disabled:"@disableVideoPreview"});b.widget("blueimp.fileupload",b.blueimp.fileupload,
{options:{loadVideoFileTypes:/^video\/.*$/},_videoElement:document.createElement("video"),processActions:{loadVideo:function(a,d){if(d.disabled)return a;var c=a.files[a.index],g;this._videoElement.canPlayType&&this._videoElement.canPlayType(c.type)&&("number"!==b.type(d.maxFileSize)||c.size<=d.maxFileSize)&&(!d.fileTypes||d.fileTypes.test(c.type))&&(c=e.createObjectURL(c))&&(g=this._videoElement.cloneNode(!1),g.src=c,g.controls=!0,a.video=g);return a},setVideo:function(a,b){a.video&&!b.disabled&&
(a.files[a.index][b.name||"preview"]=a.video);return a}}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","./jquery.fileupload-process"],b):"object"===typeof exports?b(require("jquery")):b(window.jQuery)})(function(b){b.blueimp.fileupload.prototype.options.processQueue.push({action:"validate",always:!0,acceptFileTypes:"@",maxFileSize:"@",minFileSize:"@",maxNumberOfFiles:"@",disabled:"@disableValidation"});b.widget("blueimp.fileupload",b.blueimp.fileupload,{options:{getNumberOfFiles:b.noop,messages:{maxNumberOfFiles:"Maximum number of files exceeded",
acceptFileTypes:"File type not allowed",maxFileSize:"File is too large",minFileSize:"File is too small"}},processActions:{validate:function(e,a){if(a.disabled)return e;var d=b.Deferred(),c=this.options,g=e.files[e.index],f;if(a.minFileSize||a.maxFileSize)f=g.size;"number"===b.type(a.maxNumberOfFiles)&&(c.getNumberOfFiles()||0)+e.files.length>a.maxNumberOfFiles?g.error=c.i18n("maxNumberOfFiles"):!a.acceptFileTypes||a.acceptFileTypes.test(g.type)||a.acceptFileTypes.test(g.name)?f>a.maxFileSize?g.error=
c.i18n("maxFileSize"):"number"===b.type(f)&&f<a.minFileSize?g.error=c.i18n("minFileSize"):delete g.error:g.error=c.i18n("acceptFileTypes");g.error||e.files.error?(e.files.error=!0,d.rejectWith(this,[e])):d.resolveWith(this,[e]);return d.promise()}}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","../jquery.fileupload"],b):"object"===typeof exports?b(require("jquery"),require("../jquery.fileupload")):b(window.jQuery)})(function(b){b.widget("blueimp.fileupload",b.blueimp.fileupload,{getUploadButton:function(){return b("<button/>").addClass("btn").prop("disabled",!0).text("Processing...").on("click",function(){var e=b(this),a=e.data();e.off("click").text("Abort").on("click",function(){e.remove();a.abort()});a.submit().always(function(){e.remove()})})},
initTheme:function(b){var a=this.element;b=b.toLowerCase();return a?("basic"==b?this._initBasicTheme(a):"basicplus"==b?this._initBasicPlusTheme(a):"basicplusui"!=b&&"jqueryui"!=b||this._initBasicPlusUITheme(a),a):null},_initBasicTheme:function(e){e.on("fileuploaddone",function(a,d){b.each(d.result.files,function(a,d){b("<p/>").text(d.name).appendTo("#files")})}).on("fileuploadprogressall",function(a,d){var c=parseInt(d.loaded/d.total*100,10);b("#progress .progress-bar").css("width",c+"%")}).prop("disabled",
!b.support.fileInput).parent().addClass(b.support.fileInput?void 0:"disabled")},_initBasicPlusTheme:function(e){e.on("fileuploadadd",function(a,d){var c=b(a.target).data("blueimp-fileupload").getUploadButton();d.context=b("<div/>").appendTo("#files");b.each(d.files,function(a,f){var e=b("<p/>").append(b("<span/>").text(f.name));a||e.append("<br>").append(c.clone(!0).data(d));e.appendTo(d.context)})}).on("fileuploadprocessalways",function(a,d){var c=d.index,e=d.files[c],f=b(d.context.children()[c]);
e.preview&&f.prepend("<br>").prepend(e.preview);e.error&&f.append("<br>").append(e.error);c+1===d.files.length&&d.context.find("button").text("Upload").prop("disabled",!!d.files.error)}).on("fileuploadprogressall",function(a,d){var c=parseInt(d.loaded/d.total*100,10);b("#progress .bar").css("width",c+"%")}).on("fileuploaddone",function(a,d){b.each(d.result.files,function(a,e){var f=b("<a>").attr("target","_blank").prop("href",e.url);b(d.context.children()[a]).wrap(f)})}).on("fileuploadfail",function(a,
d){b.each(d.result.files,function(a,e){var f=b("<span/>").text(e.error);b(d.context.children()[a]).append("<br>").append(f)})}).prop("disabled",!b.support.fileInput).parent().addClass(b.support.fileInput?void 0:"disabled")},_initBasicPlusUITheme:function(e){e.prop("disabled",!b.support.fileInput).parent().addClass(b.support.fileInput?void 0:"disabled")}})});
@@ -0,0 +1,141 @@
/* jQuery File Upload Plugin 9.12.3 Javascript bundle for Bootstrap themes. Plugin created by Sebastian Tschan. Bundle created by info@backload.org */
(function(b){"function"===typeof define&&define.amd?define(["jquery"],b):"object"===typeof exports?b(require("jquery")):b(jQuery)})(function(b){var e=0,a=Array.prototype.slice;b.cleanData=function(a){return function(d){var g,f,k;for(k=0;null!=(f=d[k]);k++)try{(g=b._data(f,"events"))&&g.remove&&b(f).triggerHandler("remove")}catch(e){}a(d)}}(b.cleanData);b.widget=function(a,d,g){var f,k,e,l,p={},m=a.split(".")[0];a=a.split(".")[1];f=m+"-"+a;g||(g=d,d=b.Widget);b.expr[":"][f.toLowerCase()]=function(a){return!!b.data(a,
f)};b[m]=b[m]||{};k=b[m][a];e=b[m][a]=function(a,c){if(!this._createWidget)return new e(a,c);arguments.length&&this._createWidget(a,c)};b.extend(e,k,{version:g.version,_proto:b.extend({},g),_childConstructors:[]});l=new d;l.options=b.widget.extend({},l.options);b.each(g,function(a,c){b.isFunction(c)?p[a]=function(){var b=function(){return d.prototype[a].apply(this,arguments)},g=function(c){return d.prototype[a].apply(this,c)};return function(){var a=this._super,d=this._superApply,f;this._super=b;
this._superApply=g;f=c.apply(this,arguments);this._super=a;this._superApply=d;return f}}():p[a]=c});e.prototype=b.widget.extend(l,{widgetEventPrefix:k?l.widgetEventPrefix||a:a},p,{constructor:e,namespace:m,widgetName:a,widgetFullName:f});k?(b.each(k._childConstructors,function(a,c){var d=c.prototype;b.widget(d.namespace+"."+d.widgetName,e,c._proto)}),delete k._childConstructors):d._childConstructors.push(e);b.widget.bridge(a,e);return e};b.widget.extend=function(c){for(var d=a.call(arguments,1),g=
0,f=d.length,k,e;g<f;g++)for(k in d[g])e=d[g][k],d[g].hasOwnProperty(k)&&void 0!==e&&(b.isPlainObject(e)?c[k]=b.isPlainObject(c[k])?b.widget.extend({},c[k],e):b.widget.extend({},e):c[k]=e);return c};b.widget.bridge=function(c,d){var g=d.prototype.widgetFullName||c;b.fn[c]=function(f){var k="string"===typeof f,e=a.call(arguments,1),l=this;k?this.each(function(){var a,d=b.data(this,g);if("instance"===f)return l=d,!1;if(!d)return b.error("cannot call methods on "+c+" prior to initialization; attempted to call method '"+
f+"'");if(!b.isFunction(d[f])||"_"===f.charAt(0))return b.error("no such method '"+f+"' for "+c+" widget instance");a=d[f].apply(d,e);if(a!==d&&void 0!==a)return l=a&&a.jquery?l.pushStack(a.get()):a,!1}):(e.length&&(f=b.widget.extend.apply(null,[f].concat(e))),this.each(function(){var a=b.data(this,g);a?(a.option(f||{}),a._init&&a._init()):b.data(this,g,new d(f,this))}));return l}};b.Widget=function(){};b.Widget._childConstructors=[];b.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",
options:{disabled:!1,create:null},_createWidget:function(a,d){d=b(d||this.defaultElement||this)[0];this.element=b(d);this.uuid=e++;this.eventNamespace="."+this.widgetName+this.uuid;this.bindings=b();this.hoverable=b();this.focusable=b();d!==this&&(b.data(d,this.widgetFullName,this),this._on(!0,this.element,{remove:function(a){a.target===d&&this.destroy()}}),this.document=b(d.style?d.ownerDocument:d.document||d),this.window=b(this.document[0].defaultView||this.document[0].parentWindow));this.options=
b.widget.extend({},this.options,this._getCreateOptions(),a);this._create();this._trigger("create",null,this._getCreateEventData());this._init()},_getCreateOptions:b.noop,_getCreateEventData:b.noop,_create:b.noop,_init:b.noop,destroy:function(){this._destroy();this.element.unbind(this.eventNamespace).removeData(this.widgetFullName).removeData(b.camelCase(this.widgetFullName));this.widget().unbind(this.eventNamespace).removeAttr("aria-disabled").removeClass(this.widgetFullName+"-disabled ui-state-disabled");
this.bindings.unbind(this.eventNamespace);this.hoverable.removeClass("ui-state-hover");this.focusable.removeClass("ui-state-focus")},_destroy:b.noop,widget:function(){return this.element},option:function(a,d){var g=a,f,k,e;if(0===arguments.length)return b.widget.extend({},this.options);if("string"===typeof a)if(g={},f=a.split("."),a=f.shift(),f.length){k=g[a]=b.widget.extend({},this.options[a]);for(e=0;e<f.length-1;e++)k[f[e]]=k[f[e]]||{},k=k[f[e]];a=f.pop();if(1===arguments.length)return void 0===
k[a]?null:k[a];k[a]=d}else{if(1===arguments.length)return void 0===this.options[a]?null:this.options[a];g[a]=d}this._setOptions(g);return this},_setOptions:function(a){for(var d in a)this._setOption(d,a[d]);return this},_setOption:function(a,d){this.options[a]=d;"disabled"===a&&(this.widget().toggleClass(this.widgetFullName+"-disabled",!!d),d&&(this.hoverable.removeClass("ui-state-hover"),this.focusable.removeClass("ui-state-focus")));return this},enable:function(){return this._setOptions({disabled:!1})},
disable:function(){return this._setOptions({disabled:!0})},_on:function(a,d,g){var f,e=this;"boolean"!==typeof a&&(g=d,d=a,a=!1);g?(d=f=b(d),this.bindings=this.bindings.add(d)):(g=d,d=this.element,f=this.widget());b.each(g,function(g,l){function p(){if(a||!0!==e.options.disabled&&!b(this).hasClass("ui-state-disabled"))return("string"===typeof l?e[l]:l).apply(e,arguments)}"string"!==typeof l&&(p.guid=l.guid=l.guid||p.guid||b.guid++);var m=g.match(/^([\w:-]*)\s*(.*)$/),n=m[1]+e.eventNamespace;(m=m[2])?
f.delegate(m,n,p):d.bind(n,p)})},_off:function(a,d){d=(d||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace;a.unbind(d).undelegate(d);this.bindings=b(this.bindings.not(a).get());this.focusable=b(this.focusable.not(a).get());this.hoverable=b(this.hoverable.not(a).get())},_delay:function(a,d){var b=this;return setTimeout(function(){return("string"===typeof a?b[a]:a).apply(b,arguments)},d||0)},_hoverable:function(a){this.hoverable=this.hoverable.add(a);this._on(a,{mouseenter:function(a){b(a.currentTarget).addClass("ui-state-hover")},
mouseleave:function(a){b(a.currentTarget).removeClass("ui-state-hover")}})},_focusable:function(a){this.focusable=this.focusable.add(a);this._on(a,{focusin:function(a){b(a.currentTarget).addClass("ui-state-focus")},focusout:function(a){b(a.currentTarget).removeClass("ui-state-focus")}})},_trigger:function(a,d,g){var f,e=this.options[a];g=g||{};d=b.Event(d);d.type=(a===this.widgetEventPrefix?a:this.widgetEventPrefix+a).toLowerCase();d.target=this.element[0];if(a=d.originalEvent)for(f in a)f in d||
(d[f]=a[f]);this.element.trigger(d,g);return!(b.isFunction(e)&&!1===e.apply(this.element[0],[d].concat(g))||d.isDefaultPrevented())}};b.each({show:"fadeIn",hide:"fadeOut"},function(a,d){b.Widget.prototype["_"+a]=function(g,f,e){"string"===typeof f&&(f={effect:f});var h,l=f?!0===f||"number"===typeof f?d:f.effect||d:a;f=f||{};"number"===typeof f&&(f={duration:f});h=!b.isEmptyObject(f);f.complete=e;f.delay&&g.delay(f.delay);if(h&&b.effects&&b.effects.effect[l])g[a](f);else if(l!==a&&g[l])g[l](f.duration,
f.easing,e);else g.queue(function(d){b(this)[a]();e&&e.call(g[0]);d()})}})});
!function(b){var e=function(a,c){var d=/[^\w\-\.:]/.test(a)?new Function(e.arg+",tmpl","var _e=tmpl.encode"+e.helper+",_s='"+a.replace(e.regexp,e.func)+"';return _s;"):e.cache[a]=e.cache[a]||e(e.load(a));return c?d(c,e):function(a){return d(a,e)}};e.cache={};e.load=function(a){return document.getElementById(a).innerHTML};e.regexp=/([\s'\\])(?!(?:[^{]|\{(?!%))*%\})|(?:\{%(=|#)([\s\S]+?)%\})|(\{%)|(%\})/g;e.func=function(a,c,d,b,f,e){return c?{"\n":"\\n","\r":"\\r","\t":"\\t"," ":" "}[c]||"\\"+c:d?
"="===d?"'+_e("+b+")+'":"'+("+b+"==null?'':"+b+")+'":f?"';":e?"_s+='":void 0};e.encReg=/[<>&"'\x00]/g;e.encMap={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;","'":"&#39;"};e.encode=function(a){return(null==a?"":""+a).replace(e.encReg,function(a){return e.encMap[a]||""})};e.arg="o";e.helper=",print=function(s,e){_s+=e?(s==null?'':s):_e(s);},include=function(s,d){_s+=tmpl(s,d);}";"function"==typeof define&&define.amd?define(function(){return e}):"object"==typeof module&&module.exports?module.exports=
e:b.tmpl=e}(this);
!function(b){var e=function(a,d,b){var f,k,h=document.createElement("img");if(h.onerror=d,h.onload=function(){!k||b&&b.noRevoke||e.revokeObjectURL(k);d&&d(e.scale(h,b))},e.isInstanceOf("Blob",a)||e.isInstanceOf("File",a))f=k=e.createObjectURL(a),h._type=a.type;else{if("string"!=typeof a)return!1;f=a;b&&b.crossOrigin&&(h.crossOrigin=b.crossOrigin)}return f?(h.src=f,h):e.readFile(a,function(a){var c=a.target;c&&c.result?h.src=c.result:d&&d(a)})},a=window.createObjectURL&&window||window.URL&&URL.revokeObjectURL&&
URL||window.webkitURL&&webkitURL;e.isInstanceOf=function(a,d){return Object.prototype.toString.call(d)==="[object "+a+"]"};e.transformCoordinates=function(){};e.getTransformedOptions=function(a,d){var b,f,e,h,l=d.aspectRatio;if(!l)return d;b={};for(f in d)d.hasOwnProperty(f)&&(b[f]=d[f]);return b.crop=!0,e=a.naturalWidth||a.width,h=a.naturalHeight||a.height,e/h>l?(b.maxWidth=h*l,b.maxHeight=h):(b.maxWidth=e,b.maxHeight=e/l),b};e.renderImageToCanvas=function(a,d,b,f,e,h,l,p,m,n){return a.getContext("2d").drawImage(d,
b,f,e,h,l,p,m,n),a};e.hasCanvasOption=function(a){return a.canvas||a.crop||!!a.aspectRatio};e.scale=function(a,d){function b(){var a=Math.max((l||r)/r,(p||t)/t);1<a&&(r*=a,t*=a)}function f(){var a=Math.min((k||r)/r,(h||t)/t);1>a&&(r*=a,t*=a)}d=d||{};var k,h,l,p,m,n,q,u,w,x,A,v=document.createElement("canvas"),B=a.getContext||e.hasCanvasOption(d)&&v.getContext,y=a.naturalWidth||a.width,z=a.naturalHeight||a.height,r=y,t=z;if(B&&(d=e.getTransformedOptions(a,d),q=d.left||0,u=d.top||0,d.sourceWidth?(m=
d.sourceWidth,void 0!==d.right&&void 0===d.left&&(q=y-m-d.right)):m=y-q-(d.right||0),d.sourceHeight?(n=d.sourceHeight,void 0!==d.bottom&&void 0===d.top&&(u=z-n-d.bottom)):n=z-u-(d.bottom||0),r=m,t=n),k=d.maxWidth,h=d.maxHeight,l=d.minWidth,p=d.minHeight,B&&k&&h&&d.crop?(r=k,t=h,A=m/n-k/h,0>A?(n=h*m/k,void 0===d.top&&void 0===d.bottom&&(u=(z-n)/2)):0<A&&(m=k*n/h,void 0===d.left&&void 0===d.right&&(q=(y-m)/2))):((d.contain||d.cover)&&(l=k=k||l,p=h=h||p),d.cover?(f(),b()):(b(),f())),B){if(w=d.pixelRatio,
1<w&&(v.style.width=r+"px",v.style.height=t+"px",r*=w,t*=w,v.getContext("2d").scale(w,w)),x=d.downsamplingRatio,0<x&&1>x&&m>r&&n>t)for(;m*x>r;)v.width=m*x,v.height=n*x,e.renderImageToCanvas(v,a,q,u,m,n,0,0,v.width,v.height),m=v.width,n=v.height,a=document.createElement("canvas"),a.width=m,a.height=n,e.renderImageToCanvas(a,v,0,0,m,n,0,0,m,n);return v.width=r,v.height=t,e.transformCoordinates(v,d),e.renderImageToCanvas(v,a,q,u,m,n,0,0,r,t)}return a.width=r,a.height=t,a};e.createObjectURL=function(c){return a?
a.createObjectURL(c):!1};e.revokeObjectURL=function(c){return a?a.revokeObjectURL(c):!1};e.readFile=function(a,d,b){if(window.FileReader){var f=new FileReader;if(f.onload=f.onerror=d,b=b||"readAsDataURL",f[b])return f[b](a),f}return!1};"function"==typeof define&&define.amd?define(function(){return e}):"object"==typeof module&&module.exports?module.exports=e:b.loadImage=e}(window);
(function(b){"function"==typeof define&&define.amd?define(["./load-image"],b):b("object"==typeof module&&module.exports?require("./load-image"):window.loadImage)})(function(b){var e=b.hasCanvasOption,a=b.transformCoordinates,c=b.getTransformedOptions;b.hasCanvasOption=function(a){return!!a.orientation||e.call(b,a)};b.transformCoordinates=function(d,c){a.call(b,d,c);var f=d.getContext("2d"),e=d.width,h=d.height,l=d.style.width,p=d.style.height,m=c.orientation;if(m&&!(8<m))switch(4<m&&(d.width=h,d.height=
e,d.style.width=p,d.style.height=l),m){case 2:f.translate(e,0);f.scale(-1,1);break;case 3:f.translate(e,h);f.rotate(Math.PI);break;case 4:f.translate(0,h);f.scale(1,-1);break;case 5:f.rotate(.5*Math.PI);f.scale(1,-1);break;case 6:f.rotate(.5*Math.PI);f.translate(0,-h);break;case 7:f.rotate(.5*Math.PI);f.translate(e,-h);f.scale(-1,1);break;case 8:f.rotate(-.5*Math.PI),f.translate(-e,0)}};b.getTransformedOptions=function(a,g){var f,e,h=c.call(b,a,g);f=h.orientation;if(!f||8<f||1===f)return h;f={};for(e in h)h.hasOwnProperty(e)&&
(f[e]=h[e]);switch(h.orientation){case 2:f.left=h.right;f.right=h.left;break;case 3:f.left=h.right;f.top=h.bottom;f.right=h.left;f.bottom=h.top;break;case 4:f.top=h.bottom;f.bottom=h.top;break;case 5:f.left=h.top;f.top=h.left;f.right=h.bottom;f.bottom=h.right;break;case 6:f.left=h.top;f.top=h.right;f.right=h.bottom;f.bottom=h.left;break;case 7:f.left=h.bottom;f.top=h.right;f.right=h.top;f.bottom=h.left;break;case 8:f.left=h.bottom,f.top=h.left,f.right=h.top,f.bottom=h.right}return 4<h.orientation&&
(f.maxWidth=h.maxHeight,f.maxHeight=h.maxWidth,f.minWidth=h.minHeight,f.minHeight=h.minWidth,f.sourceWidth=h.sourceHeight,f.sourceHeight=h.sourceWidth),f}});
(function(b){"function"==typeof define&&define.amd?define(["./load-image"],b):b("object"==typeof module&&module.exports?require("./load-image"):window.loadImage)})(function(b){b.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice)&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)};b.metaDataParsers={jpeg:{65505:[]}};b.parseMetaData=function(e,a,c){c=c||{};var d=this,g=c.maxMetaDataSize||262144,f={};window.DataView&&
e&&12<=e.size&&"image/jpeg"===e.type&&b.blobSlice&&b.readFile(b.blobSlice.call(e,0,g),function(g){if(g.target.error)return console.log(g.target.error),void a(f);var e,l,p,m;g=g.target.result;var n=new DataView(g),q=2,u=n.byteLength-4;p=q;if(65496===n.getUint16(0)){for(;u>q&&(e=n.getUint16(q),65504<=e&&65519>=e||65534===e);){if(l=n.getUint16(q+2)+2,q+l>n.byteLength){console.log("Invalid meta data: Invalid segment size.");break}if(p=b.metaDataParsers.jpeg[e])for(m=0;m<p.length;m+=1)p[m].call(d,n,q,
l,f,c);p=q+=l}!c.disableImageHead&&6<p&&(g.slice?f.imageHead=g.slice(0,p):f.imageHead=(new Uint8Array(g)).subarray(0,p))}else console.log("Invalid JPEG file: Missing JPEG marker.");a(f)},"readAsArrayBuffer")||a(f)}});
(function(b){"function"==typeof define&&define.amd?define(["./load-image","./load-image-meta"],b):"object"==typeof module&&module.exports?b(require("./load-image"),require("./load-image-meta")):b(window.loadImage)})(function(b){b.ExifMap=function(){return this};b.ExifMap.prototype.map={Orientation:274};b.ExifMap.prototype.get=function(b){return this[b]||this[this.map[b]]};b.getExifThumbnail=function(b,a,c){var d,g,f;if(!c||a+c>b.byteLength)return void console.log("Invalid Exif data: Invalid thumbnail data.");
d=[];for(g=0;c>g;g+=1)f=b.getUint8(a+g),d.push((16>f?"0":"")+f.toString(16));return"data:image/jpeg,%"+d.join("%")};b.exifTagTypes={1:{getValue:function(b,a){return b.getUint8(a)},size:1},2:{getValue:function(b,a){return String.fromCharCode(b.getUint8(a))},size:1,ascii:!0},3:{getValue:function(b,a,c){return b.getUint16(a,c)},size:2},4:{getValue:function(b,a,c){return b.getUint32(a,c)},size:4},5:{getValue:function(b,a,c){return b.getUint32(a,c)/b.getUint32(a+4,c)},size:8},9:{getValue:function(b,a,
c){return b.getInt32(a,c)},size:4},10:{getValue:function(b,a,c){return b.getInt32(a,c)/b.getInt32(a+4,c)},size:8}};b.exifTagTypes[7]=b.exifTagTypes[1];b.getExifValue=function(e,a,c,d,g,f){var k,h,l;d=b.exifTagTypes[d];if(!d)return void console.log("Invalid Exif data: Invalid tag type.");if(k=d.size*g,h=4<k?a+e.getUint32(c+8,f):c+8,h+k>e.byteLength)return void console.log("Invalid Exif data: Invalid data offset.");if(1===g)return d.getValue(e,h,f);a=[];for(c=0;g>c;c+=1)a[c]=d.getValue(e,h+c*d.size,
f);if(d.ascii){e="";for(c=0;c<a.length&&(l=a[c],"\x00"!==l);c+=1)e+=l;return e}return a};b.parseExifTag=function(e,a,c,d,g){var f=e.getUint16(c,d);g.exif[f]=b.getExifValue(e,a,c,e.getUint16(c+2,d),e.getUint32(c+4,d),d)};b.parseExifTags=function(b,a,c,d,g){var f,k,h;if(c+6>b.byteLength)return void console.log("Invalid Exif data: Invalid directory offset.");if(f=b.getUint16(c,d),k=c+2+12*f,k+4>b.byteLength)return void console.log("Invalid Exif data: Invalid directory size.");for(h=0;f>h;h+=1)this.parseExifTag(b,
a,c+2+12*h,d,g);return b.getUint32(k,d)};b.parseExifData=function(e,a,c,d,g){if(!g.disableExif){var f,k;c=a+10;if(1165519206===e.getUint32(a+4)){if(c+8>e.byteLength)return void console.log("Invalid Exif data: Invalid segment size.");if(0!==e.getUint16(a+8))return void console.log("Invalid Exif data: Missing byte alignment offset.");switch(e.getUint16(c)){case 18761:a=!0;break;case 19789:a=!1;break;default:return void console.log("Invalid Exif data: Invalid byte alignment marker.")}if(42!==e.getUint16(c+
2,a))return void console.log("Invalid Exif data: Missing TIFF marker.");f=e.getUint32(c+4,a);d.exif=new b.ExifMap;(f=b.parseExifTags(e,c,c+f,a,d))&&!g.disableExifThumbnail&&(k={exif:{}},b.parseExifTags(e,c,c+f,a,k),k.exif[513]&&(d.exif.Thumbnail=b.getExifThumbnail(e,c+k.exif[513],k.exif[514])));d.exif[34665]&&!g.disableExifSub&&b.parseExifTags(e,c,c+d.exif[34665],a,d);d.exif[34853]&&!g.disableExifGps&&b.parseExifTags(e,c,c+d.exif[34853],a,d)}}};b.metaDataParsers.jpeg[65505].push(b.parseExifData)});
(function(b){"function"==typeof define&&define.amd?define(["./load-image","./load-image-exif"],b):"object"==typeof module&&module.exports?b(require("./load-image"),require("./load-image-exif")):b(window.loadImage)})(function(b){b.ExifMap.prototype.tags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",
530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright",36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",
40962:"PixelXDimension",40963:"PixelYDimension",42240:"Gamma",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"PhotographicSensitivity",34856:"OECF",34864:"SensitivityType",34865:"StandardOutputSensitivity",
34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",
41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:"LensSpecification",42035:"LensMake",42036:"LensModel",
42037:"LensSerialNumber",0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",
26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"};b.ExifMap.prototype.stringValues={ExposureProgram:{0:"Undefined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",
1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",
7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",
71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},
SensingMethod:{1:"Undefined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",
4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},ComponentsConfiguration:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"},Orientation:{1:"top-left",2:"top-right",3:"bottom-right",4:"bottom-left",5:"left-top",6:"right-top",7:"right-bottom",8:"left-bottom"}};b.ExifMap.prototype.getText=function(b){var a=
this.get(b);switch(b){case "LightSource":case "Flash":case "MeteringMode":case "ExposureProgram":case "SensingMethod":case "SceneCaptureType":case "SceneType":case "CustomRendered":case "WhiteBalance":case "GainControl":case "Contrast":case "Saturation":case "Sharpness":case "SubjectDistanceRange":case "FileSource":case "Orientation":return this.stringValues[b][a];case "ExifVersion":case "FlashpixVersion":return String.fromCharCode(a[0],a[1],a[2],a[3]);case "ComponentsConfiguration":return this.stringValues[b][a[0]]+
this.stringValues[b][a[1]]+this.stringValues[b][a[2]]+this.stringValues[b][a[3]];case "GPSVersionID":return a[0]+"."+a[1]+"."+a[2]+"."+a[3]}return String(a)};(function(b){var a,c=b.tags;b=b.map;for(a in c)c.hasOwnProperty(a)&&(b[c[a]]=a)})(b.ExifMap.prototype);b.ExifMap.prototype.getAll=function(){var b,a,c={};for(b in this)this.hasOwnProperty(b)&&(a=this.tags[b],a&&(c[a]=this.getText(a)));return c}});
!function(b){var e=b.HTMLCanvasElement&&b.HTMLCanvasElement.prototype,a;if(a=b.Blob)try{a=!!new Blob}catch(h){a=!1}var c=a;if(a=c&&b.Uint8Array)try{a=100===(new Blob([new Uint8Array(100)])).size}catch(h){a=!1}var d=a,g=b.BlobBuilder||b.WebKitBlobBuilder||b.MozBlobBuilder||b.MSBlobBuilder,f=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,k=(c||g)&&b.atob&&b.ArrayBuffer&&b.Uint8Array&&function(a){var b,e,k,n,q;if(b=a.match(f),!b)throw Error("invalid data URI");e=b[2]?b[1]:"text/plain"+(b[3]||";charset=US-ASCII");
k=!!b[4];a=a.slice(b[0].length);k=k?atob(a):decodeURIComponent(a);a=new ArrayBuffer(k.length);b=new Uint8Array(a);for(n=0;n<k.length;n+=1)b[n]=k.charCodeAt(n);return c?new Blob([d?b:a],{type:e}):(q=new g,q.append(a),q.getBlob(e))};b.HTMLCanvasElement&&!e.toBlob&&(e.mozGetAsFile?e.toBlob=function(a,b,c){a(c&&e.toDataURL&&k?k(this.toDataURL(b,c)):this.mozGetAsFile("blob",b))}:e.toDataURL&&k&&(e.toBlob=function(a,b,c){a(k(this.toDataURL(b,c)))}));"function"==typeof define&&define.amd?define(function(){return k}):
"object"==typeof module&&module.exports?module.exports=k:b.dataURLtoBlob=k}(window);
(function(b){"function"===typeof define&&define.amd?define(["jquery"],b):"object"===typeof exports?b(require("jquery")):b(window.jQuery)})(function(b){var e=0;b.ajaxTransport("iframe",function(a){if(a.async){var c=a.initialIframeSrc||"javascript:false;",d,g,f;return{send:function(k,h){d=b('<form style="display:none;"></form>');d.attr("accept-charset",a.formAcceptCharset);f=/\?/.test(a.url)?"&":"?";"DELETE"===a.type?(a.url=a.url+f+"_method=DELETE",a.type="POST"):"PUT"===a.type?(a.url=a.url+f+"_method=PUT",
a.type="POST"):"PATCH"===a.type&&(a.url=a.url+f+"_method=PATCH",a.type="POST");e+=1;g=b('<iframe src="'+c+'" name="iframe-transport-'+e+'"></iframe>').bind("load",function(){var f,e=b.isArray(a.paramName)?a.paramName:[a.paramName];g.unbind("load").bind("load",function(){var a;try{if(a=g.contents(),!a.length||!a[0].firstChild)throw Error();}catch(f){a=void 0}h(200,"success",{iframe:a});b('<iframe src="'+c+'"></iframe>').appendTo(d);window.setTimeout(function(){d.remove()},0)});d.prop("target",g.prop("name")).prop("action",
a.url).prop("method",a.type);a.formData&&b.each(a.formData,function(a,c){b('<input type="hidden"/>').prop("name",c.name).val(c.value).appendTo(d)});a.fileInput&&a.fileInput.length&&"POST"===a.type&&(f=a.fileInput.clone(),a.fileInput.after(function(a){return f[a]}),a.paramName&&a.fileInput.each(function(c){b(this).prop("name",e[c]||a.paramName)}),d.append(a.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"),a.fileInput.removeAttr("form"));d.submit();f&&f.length&&
a.fileInput.each(function(a,c){var d=b(f[a]);b(c).prop("name",d.prop("name")).attr("form",d.attr("form"));d.replaceWith(c)})});d.append(g).appendTo(document.body)},abort:function(){g&&g.unbind("load").prop("src",c);d&&d.remove()}}}});b.ajaxSetup({converters:{"iframe text":function(a){return a&&b(a[0].body).text()},"iframe json":function(a){return a&&b.parseJSON(b(a[0].body).text())},"iframe html":function(a){return a&&b(a[0].body).html()},"iframe xml":function(a){return(a=a&&a[0])&&b.isXMLDoc(a)?
a:b.parseXML(a.XMLDocument&&a.XMLDocument.xml||b(a.body).html())},"iframe script":function(a){return a&&b.globalEval(b(a[0].body).text())}}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","jquery.ui.widget"],b):"object"===typeof exports?b(require("jquery"),require("./vendor/jquery.ui.widget")):b(window.jQuery)})(function(b){function e(a){var c="dragover"===a;return function(d){d.dataTransfer=d.originalEvent&&d.originalEvent.dataTransfer;var g=d.dataTransfer;g&&-1!==b.inArray("Files",g.types)&&!1!==this._trigger(a,b.Event(a,{delegatedEvent:d}))&&(d.preventDefault(),c&&(g.dropEffect="copy"))}}b.support.fileInput=!(/(Android (1\.[0156]|2\.[01]))|(Windows Phone (OS 7|8\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1\.0|2\.[05]|3\.0))/.test(window.navigator.userAgent)||
b('<input type="file">').prop("disabled"));b.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader);b.support.xhrFormDataFileUpload=!!window.FormData;b.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice);b.widget("blueimp.fileupload",{options:{dropZone:b(document),pasteZone:void 0,fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,limitMultiFileUploadSize:void 0,limitMultiFileUploadSizeOverhead:512,
sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(a,c){a=this.messages[a]||a.toString();c&&b.each(c,function(b,c){a=a.replace("{"+b+"}",c)});return a},formData:function(a){return a.serializeArray()},add:function(a,
c){if(a.isDefaultPrevented())return!1;(c.autoUpload||!1!==c.autoUpload&&b(this).fileupload("option","autoUpload"))&&c.process().done(function(){c.submit()})},processData:!1,contentType:!1,cache:!1,timeout:0},_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:b.support.blobSlice&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime();this.bitrate=
this.loaded=0;this.getBitrate=function(a,b,d){var g=a-this.timestamp;if(!this.bitrate||!d||g>d)this.bitrate=1E3/g*(b-this.loaded)*8,this.loaded=b,this.timestamp=a;return this.bitrate}},_isXHRUpload:function(a){return!a.forceIframeTransport&&(!a.multipart&&b.support.xhrFileUpload||b.support.xhrFormDataFileUpload)},_getFormData:function(a){var c;return"function"===b.type(a.formData)?a.formData(a.form):b.isArray(a.formData)?a.formData:"object"===b.type(a.formData)?(c=[],b.each(a.formData,function(a,
b){c.push({name:a,value:b})}),c):[]},_getTotal:function(a){var c=0;b.each(a,function(a,b){c+=b.size||1});return c},_initProgressObject:function(a){var c={loaded:0,total:0,bitrate:0};a._progress?b.extend(a._progress,c):a._progress=c},_initResponseObject:function(a){var b;if(a._response)for(b in a._response)a._response.hasOwnProperty(b)&&delete a._response[b];else a._response={}},_onProgress:function(a,c){if(a.lengthComputable){var d=Date.now?Date.now():(new Date).getTime(),g;c._time&&c.progressInterval&&
d-c._time<c.progressInterval&&a.loaded!==a.total||(c._time=d,g=Math.floor(a.loaded/a.total*(c.chunkSize||c._progress.total))+(c.uploadedBytes||0),this._progress.loaded+=g-c._progress.loaded,this._progress.bitrate=this._bitrateTimer.getBitrate(d,this._progress.loaded,c.bitrateInterval),c._progress.loaded=c.loaded=g,c._progress.bitrate=c.bitrate=c._bitrateTimer.getBitrate(d,g,c.bitrateInterval),this._trigger("progress",b.Event("progress",{delegatedEvent:a}),c),this._trigger("progressall",b.Event("progressall",
{delegatedEvent:a}),this._progress))}},_initProgressListener:function(a){var c=this,d=a.xhr?a.xhr():b.ajaxSettings.xhr();d.upload&&(b(d.upload).bind("progress",function(b){var d=b.originalEvent;b.lengthComputable=d.lengthComputable;b.loaded=d.loaded;b.total=d.total;c._onProgress(b,a)}),a.xhr=function(){return d})},_isInstanceOf:function(a,b){return Object.prototype.toString.call(b)==="[object "+a+"]"},_initXHRData:function(a){var c=this,d,g=a.files[0],f=a.multipart||!b.support.xhrFileUpload,e="array"===
b.type(a.paramName)?a.paramName[0]:a.paramName;a.headers=b.extend({},a.headers);a.contentRange&&(a.headers["Content-Range"]=a.contentRange);f&&!a.blob&&this._isInstanceOf("File",g)||(a.headers["Content-Disposition"]='attachment; filename="'+encodeURI(g.name)+'"');f?b.support.xhrFormDataFileUpload&&(a.postMessage?(d=this._getFormData(a),a.blob?d.push({name:e,value:a.blob}):b.each(a.files,function(c,f){d.push({name:"array"===b.type(a.paramName)&&a.paramName[c]||e,value:f})})):(c._isInstanceOf("FormData",
a.formData)?d=a.formData:(d=new FormData,b.each(this._getFormData(a),function(a,b){d.append(b.name,b.value)})),a.blob?d.append(e,a.blob,g.name):b.each(a.files,function(f,g){(c._isInstanceOf("File",g)||c._isInstanceOf("Blob",g))&&d.append("array"===b.type(a.paramName)&&a.paramName[f]||e,g,g.uploadName||g.name)})),a.data=d):(a.contentType=g.type||"application/octet-stream",a.data=a.blob||g);a.blob=null},_initIframeSettings:function(a){var c=b("<a></a>").prop("href",a.url).prop("host");a.dataType="iframe "+
(a.dataType||"");a.formData=this._getFormData(a);a.redirect&&c&&c!==location.host&&a.formData.push({name:a.redirectParamName||"redirect",value:a.redirect})},_initDataSettings:function(a){this._isXHRUpload(a)?(this._chunkedUpload(a,!0)||(a.data||this._initXHRData(a),this._initProgressListener(a)),a.postMessage&&(a.dataType="postmessage "+(a.dataType||""))):this._initIframeSettings(a)},_getParamName:function(a){var c=b(a.fileInput),d=a.paramName;d?b.isArray(d)||(d=[d]):(d=[],c.each(function(){for(var a=
b(this),c=a.prop("name")||"files[]",a=(a.prop("files")||[1]).length;a;)d.push(c),--a}),d.length||(d=[c.prop("name")||"files[]"]));return d},_initFormSettings:function(a){a.form&&a.form.length||(a.form=b(a.fileInput.prop("form")),a.form.length||(a.form=b(this.options.fileInput.prop("form"))));a.paramName=this._getParamName(a);a.url||(a.url=a.form.prop("action")||location.href);a.type=(a.type||"string"===b.type(a.form.prop("method"))&&a.form.prop("method")||"").toUpperCase();"POST"!==a.type&&"PUT"!==
a.type&&"PATCH"!==a.type&&(a.type="POST");a.formAcceptCharset||(a.formAcceptCharset=a.form.attr("accept-charset"))},_getAJAXSettings:function(a){a=b.extend({},this.options,a);this._initFormSettings(a);this._initDataSettings(a);return a},_getDeferredState:function(a){return a.state?a.state():a.isResolved()?"resolved":a.isRejected()?"rejected":"pending"},_enhancePromise:function(a){a.success=a.done;a.error=a.fail;a.complete=a.always;return a},_getXHRPromise:function(a,c,d){var g=b.Deferred(),f=g.promise();
c=c||this.options.context||f;!0===a?g.resolveWith(c,d):!1===a&&g.rejectWith(c,d);f.abort=g.promise;return this._enhancePromise(f)},_addConvenienceMethods:function(a,c){var d=this,g=function(a){return b.Deferred().resolveWith(d,a).promise()};c.process=function(a,e){if(a||e)c._processQueue=this._processQueue=(this._processQueue||g([this])).then(function(){return c.errorThrown?b.Deferred().rejectWith(d,[c]).promise():g(arguments)}).then(a,e);return this._processQueue||g([this])};c.submit=function(){"pending"!==
this.state()&&(c.jqXHR=this.jqXHR=!1!==d._trigger("submit",b.Event("submit",{delegatedEvent:a}),this)&&d._onSend(a,this));return this.jqXHR||d._getXHRPromise()};c.abort=function(){if(this.jqXHR)return this.jqXHR.abort();this.errorThrown="abort";d._trigger("fail",null,this);return d._getXHRPromise(!1)};c.state=function(){if(this.jqXHR)return d._getDeferredState(this.jqXHR);if(this._processQueue)return d._getDeferredState(this._processQueue)};c.processing=function(){return!this.jqXHR&&this._processQueue&&
"pending"===d._getDeferredState(this._processQueue)};c.progress=function(){return this._progress};c.response=function(){return this._response}},_getUploadedBytes:function(a){return(a=(a=(a=a.getResponseHeader("Range"))&&a.split("-"))&&1<a.length&&parseInt(a[1],10))&&a+1},_chunkedUpload:function(a,c){a.uploadedBytes=a.uploadedBytes||0;var d=this,g=a.files[0],f=g.size,e=a.uploadedBytes,h=a.maxChunkSize||f,l=this._blobSlice,p=b.Deferred(),m=p.promise(),n,q;if(!(this._isXHRUpload(a)&&l&&(e||h<f))||a.data)return!1;
if(c)return!0;if(e>=f)return g.error=a.i18n("uploadedBytes"),this._getXHRPromise(!1,a.context,[null,"error",g.error]);q=function(){var c=b.extend({},a),m=c._progress.loaded;c.blob=l.call(g,e,e+h,g.type);c.chunkSize=c.blob.size;c.contentRange="bytes "+e+"-"+(e+c.chunkSize-1)+"/"+f;d._initXHRData(c);d._initProgressListener(c);n=(!1!==d._trigger("chunksend",null,c)&&b.ajax(c)||d._getXHRPromise(!1,c.context)).done(function(g,h,l){e=d._getUploadedBytes(l)||e+c.chunkSize;m+c.chunkSize-c._progress.loaded&&
d._onProgress(b.Event("progress",{lengthComputable:!0,loaded:e-c.uploadedBytes,total:e-c.uploadedBytes}),c);a.uploadedBytes=c.uploadedBytes=e;c.result=g;c.textStatus=h;c.jqXHR=l;d._trigger("chunkdone",null,c);d._trigger("chunkalways",null,c);e<f?q():p.resolveWith(c.context,[g,h,l])}).fail(function(a,b,f){c.jqXHR=a;c.textStatus=b;c.errorThrown=f;d._trigger("chunkfail",null,c);d._trigger("chunkalways",null,c);p.rejectWith(c.context,[a,b,f])})};this._enhancePromise(m);m.abort=function(){return n.abort()};
q();return m},_beforeSend:function(a,b){0===this._active&&(this._trigger("start"),this._bitrateTimer=new this._BitrateTimer,this._progress.loaded=this._progress.total=0,this._progress.bitrate=0);this._initResponseObject(b);this._initProgressObject(b);b._progress.loaded=b.loaded=b.uploadedBytes||0;b._progress.total=b.total=this._getTotal(b.files)||1;b._progress.bitrate=b.bitrate=0;this._active+=1;this._progress.loaded+=b.loaded;this._progress.total+=b.total},_onDone:function(a,c,d,g){var f=g._progress.total,
e=g._response;g._progress.loaded<f&&this._onProgress(b.Event("progress",{lengthComputable:!0,loaded:f,total:f}),g);e.result=g.result=a;e.textStatus=g.textStatus=c;e.jqXHR=g.jqXHR=d;this._trigger("done",null,g)},_onFail:function(a,b,d,g){var f=g._response;g.recalculateProgress&&(this._progress.loaded-=g._progress.loaded,this._progress.total-=g._progress.total);f.jqXHR=g.jqXHR=a;f.textStatus=g.textStatus=b;f.errorThrown=g.errorThrown=d;this._trigger("fail",null,g)},_onAlways:function(a,b,d,g){this._trigger("always",
null,g)},_onSend:function(a,c){c.submit||this._addConvenienceMethods(a,c);var d=this,g,f,e,h,l=d._getAJAXSettings(c),p=function(){d._sending+=1;l._bitrateTimer=new d._BitrateTimer;return g=g||((f||!1===d._trigger("send",b.Event("send",{delegatedEvent:a}),l))&&d._getXHRPromise(!1,l.context,f)||d._chunkedUpload(l)||b.ajax(l)).done(function(a,b,c){d._onDone(a,b,c,l)}).fail(function(a,b,c){d._onFail(a,b,c,l)}).always(function(a,b,c){d._onAlways(a,b,c,l);--d._sending;--d._active;if(l.limitConcurrentUploads&&
l.limitConcurrentUploads>d._sending)for(a=d._slots.shift();a;){if("pending"===d._getDeferredState(a)){a.resolve();break}a=d._slots.shift()}0===d._active&&d._trigger("stop")})};this._beforeSend(a,l);return this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(1<this.options.limitConcurrentUploads?(e=b.Deferred(),this._slots.push(e),h=e.then(p)):h=this._sequence=this._sequence.then(p,p),h.abort=function(){f=[void 0,"abort","abort"];
return g?g.abort():(e&&e.rejectWith(l.context,f),p())},this._enhancePromise(h)):p()},_onAdd:function(a,c){var d=this,g=!0,f=b.extend({},this.options,c),e=c.files,h=e.length,l=f.limitMultiFileUploads,p=f.limitMultiFileUploadSize,m=f.limitMultiFileUploadSizeOverhead,n=0,q=this._getParamName(f),u,w,x=0;if(!h)return!1;p&&void 0===e[0].size&&(p=void 0);if((f.singleFileUploads||l||p)&&this._isXHRUpload(f))if(f.singleFileUploads||p||!l)if(!f.singleFileUploads&&p)for(w=[],u=[],f=0;f<h;f+=1){if(n+=e[f].size+
m,f+1===h||n+e[f+1].size+m>p||l&&f+1-x>=l)w.push(e.slice(x,f+1)),n=q.slice(x,f+1),n.length||(n=q),u.push(n),x=f+1,n=0}else u=q;else for(w=[],u=[],f=0;f<h;f+=l)w.push(e.slice(f,f+l)),n=q.slice(f,f+l),n.length||(n=q),u.push(n);else w=[e],u=[q];c.originalFiles=e;b.each(w||e,function(f,e){var k=b.extend({},c);k.files=w?e:[e];k.paramName=u[f];d._initResponseObject(k);d._initProgressObject(k);d._addConvenienceMethods(a,k);return g=d._trigger("add",b.Event("add",{delegatedEvent:a}),k)});return g},_replaceFileInput:function(a){var c=
a.fileInput,d=c.clone(!0),g=c.is(document.activeElement);a.fileInputClone=d;b("<form></form>").append(d)[0].reset();c.after(d).detach();g&&d.focus();b.cleanData(c.unbind("remove"));this.options.fileInput=this.options.fileInput.map(function(a,b){return b===c[0]?d[0]:b});c[0]===this.element[0]&&(this.element=d)},_handleFileTreeEntry:function(a,c){var d=this,g=b.Deferred(),f=function(b){b&&!b.entry&&(b.entry=a);g.resolve([b])},e=function(b){d._handleFileTreeEntries(b,c+a.name+"/").done(function(a){g.resolve(a)}).fail(f)},
h=function(){l.readEntries(function(a){a.length?(p=p.concat(a),h()):e(p)},f)},l,p=[];c=c||"";a.isFile?a._file?(a._file.relativePath=c,g.resolve(a._file)):a.file(function(a){a.relativePath=c;g.resolve(a)},f):a.isDirectory?(l=a.createReader(),h()):g.resolve([]);return g.promise()},_handleFileTreeEntries:function(a,c){var d=this;return b.when.apply(b,b.map(a,function(a){return d._handleFileTreeEntry(a,c)})).then(function(){return Array.prototype.concat.apply([],arguments)})},_getDroppedFiles:function(a){a=
a||{};var c=a.items;return c&&c.length&&(c[0].webkitGetAsEntry||c[0].getAsEntry)?this._handleFileTreeEntries(b.map(c,function(a){var b;if(a.webkitGetAsEntry){if(b=a.webkitGetAsEntry())b._file=a.getAsFile();return b}return a.getAsEntry()})):b.Deferred().resolve(b.makeArray(a.files)).promise()},_getSingleFileInputFiles:function(a){a=b(a);var c=a.prop("webkitEntries")||a.prop("entries");if(c&&c.length)return this._handleFileTreeEntries(c);c=b.makeArray(a.prop("files"));if(c.length)void 0===c[0].name&&
c[0].fileName&&b.each(c,function(a,b){b.name=b.fileName;b.size=b.fileSize});else{a=a.prop("value");if(!a)return b.Deferred().resolve([]).promise();c=[{name:a.replace(/^.*\\/,"")}]}return b.Deferred().resolve(c).promise()},_getFileInputFiles:function(a){return a instanceof b&&1!==a.length?b.when.apply(b,b.map(a,this._getSingleFileInputFiles)).then(function(){return Array.prototype.concat.apply([],arguments)}):this._getSingleFileInputFiles(a)},_onChange:function(a){var c=this,d={fileInput:b(a.target),
form:b(a.target.form)};this._getFileInputFiles(d.fileInput).always(function(g){d.files=g;c.options.replaceFileInput&&c._replaceFileInput(d);!1!==c._trigger("change",b.Event("change",{delegatedEvent:a}),d)&&c._onAdd(a,d)})},_onPaste:function(a){var c=a.originalEvent&&a.originalEvent.clipboardData&&a.originalEvent.clipboardData.items,d={files:[]};c&&c.length&&(b.each(c,function(a,b){var c=b.getAsFile&&b.getAsFile();c&&d.files.push(c)}),!1!==this._trigger("paste",b.Event("paste",{delegatedEvent:a}),
d)&&this._onAdd(a,d))},_onDrop:function(a){a.dataTransfer=a.originalEvent&&a.originalEvent.dataTransfer;var c=this,d=a.dataTransfer,g={};d&&d.files&&d.files.length&&(a.preventDefault(),this._getDroppedFiles(d).always(function(d){g.files=d;!1!==c._trigger("drop",b.Event("drop",{delegatedEvent:a}),g)&&c._onAdd(a,g)}))},_onDragOver:e("dragover"),_onDragEnter:e("dragenter"),_onDragLeave:e("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,
drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste}));b.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop");this._off(this.options.pasteZone,"paste");this._off(this.options.fileInput,"change")},_setOption:function(a,c){var d=-1!==b.inArray(a,this._specialOptions);d&&this._destroyEventHandlers();
this._super(a,c);d&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var a=this.options;void 0===a.fileInput?a.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):a.fileInput instanceof b||(a.fileInput=b(a.fileInput));a.dropZone instanceof b||(a.dropZone=b(a.dropZone));a.pasteZone instanceof b||(a.pasteZone=b(a.pasteZone))},_getRegExp:function(a){a=a.split("/");var b=a.pop();a.shift();return new RegExp(a.join("/"),
b)},_isRegExpOption:function(a,c){return"url"!==a&&"string"===b.type(c)&&/^\/.*\/[igm]{0,3}$/.test(c)},_initDataAttributes:function(){var a=this,c=this.options,d=this.element.data();b.each(this.element[0].attributes,function(b,f){var e=f.name.toLowerCase(),h;/^data-/.test(e)&&(e=e.slice(5).replace(/-[a-z]/g,function(a){return a.charAt(1).toUpperCase()}),h=d[e],a._isRegExpOption(e,h)&&(h=a._getRegExp(h)),c[e]=h)})},_create:function(){this._initDataAttributes();this._initSpecialOptions();this._slots=
[];this._sequence=this._getXHRPromise(!0);this._sending=this._active=0;this._initProgressObject(this);this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(a){var c=this;a&&!this.options.disabled&&(a.fileInput&&!a.files?this._getFileInputFiles(a.fileInput).always(function(b){a.files=b;c._onAdd(null,a)}):(a.files=b.makeArray(a.files),this._onAdd(null,a)))},send:function(a){if(a&&!this.options.disabled){if(a.fileInput&&!a.files){var c=
this,d=b.Deferred(),e=d.promise(),f,k;e.abort=function(){k=!0;if(f)return f.abort();d.reject(null,"abort","abort");return e};this._getFileInputFiles(a.fileInput).always(function(b){k||(b.length?(a.files=b,f=c._onSend(null,a),f.then(function(a,b,c){d.resolve(a,b,c)},function(a,b,c){d.reject(a,b,c)})):d.reject())});return this._enhancePromise(e)}a.files=b.makeArray(a.files);if(a.files.length)return this._onSend(null,a)}return this._getXHRPromise(!1,a&&a.context)}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","./jquery.fileupload"],b):"object"===typeof exports?b(require("jquery")):b(window.jQuery)})(function(b){var e=b.blueimp.fileupload.prototype.options.add;b.widget("blueimp.fileupload",b.blueimp.fileupload,{options:{processQueue:[],add:function(a,c){var d=b(this);c.process(function(){return d.fileupload("process",c)});e.call(this,a,c)}},processActions:{},_processFile:function(a,c){var d=this,e=b.Deferred().resolveWith(d,[a]).promise();
this._trigger("process",null,a);b.each(a.processQueue,function(a,k){var h=function(a){return c.errorThrown?b.Deferred().rejectWith(d,[c]).promise():d.processActions[k.action].call(d,a,k)};e=e.then(h,k.always&&h)});e.done(function(){d._trigger("processdone",null,a);d._trigger("processalways",null,a)}).fail(function(){d._trigger("processfail",null,a);d._trigger("processalways",null,a)});return e},_transformProcessQueue:function(a){var c=[];b.each(a.processQueue,function(){var d={},e=this.action,f=!0===
this.prefix?e:this.prefix;b.each(this,function(c,e){"string"===b.type(e)&&"@"===e.charAt(0)?d[c]=a[e.slice(1)||(f?f+c.charAt(0).toUpperCase()+c.slice(1):c)]:d[c]=e});c.push(d)});a.processQueue=c},processing:function(){return this._processing},process:function(a){var c=this,d=b.extend({},this.options,a);d.processQueue&&d.processQueue.length&&(this._transformProcessQueue(d),0===this._processing&&this._trigger("processstart"),b.each(a.files,function(e){var f=e?b.extend({},d):d,k=function(){return a.errorThrown?
b.Deferred().rejectWith(c,[a]).promise():c._processFile(f,a)};f.index=e;c._processing+=1;c._processingQueue=c._processingQueue.then(k,k).always(function(){--c._processing;0===c._processing&&c._trigger("processstop")})}));return this._processingQueue},_create:function(){this._super();this._processing=0;this._processingQueue=b.Deferred().resolveWith(this).promise()}})});
(function(b){"function"===typeof define&&define.amd?define("jquery load-image load-image-meta load-image-exif canvas-to-blob ./jquery.fileupload-process".split(" "),b):"object"===typeof exports?b(require("jquery"),require("blueimp-load-image/js/load-image"),require("blueimp-load-image/js/load-image-meta"),require("blueimp-load-image/js/load-image-exif"),require("blueimp-canvas-to-blob"),require("./jquery.fileupload-process")):b(window.jQuery,window.loadImage)})(function(b,e){b.blueimp.fileupload.prototype.options.processQueue.unshift({action:"loadImageMetaData",
disableImageHead:"@",disableExif:"@",disableExifThumbnail:"@",disableExifSub:"@",disableExifGps:"@",disabled:"@disableImageMetaDataLoad"},{action:"loadImage",prefix:!0,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"});b.widget("blueimp.fileupload",b.blueimp.fileupload,{options:{loadImageFileTypes:/^image\/(gif|jpeg|png|svg\+xml)$/,loadImageMaxFileSize:1E7,
imageMaxWidth:1920,imageMaxHeight:1080,imageOrientation:!1,imageCrop:!1,disableImageResize:!0,previewMaxWidth:80,previewMaxHeight:80,previewOrientation:!0,previewThumbnail:!0,previewCrop:!1,previewCanvas:!0},processActions:{loadImage:function(a,c){if(c.disabled)return a;var d=this,g=a.files[a.index],f=b.Deferred();return"number"===b.type(c.maxFileSize)&&g.size>c.maxFileSize||c.fileTypes&&!c.fileTypes.test(g.type)||!e(g,function(b){b.src&&(a.img=b);f.resolveWith(d,[a])},c)?a:f.promise()},resizeImage:function(a,
c){if(c.disabled||!a.canvas&&!a.img)return a;c=b.extend({canvas:!0},c);var d=this,g=b.Deferred(),f=c.canvas&&a.canvas||a.img,k=function(b){b&&(b.width!==f.width||b.height!==f.height||c.forceResize)&&(a[b.getContext?"canvas":"img"]=b);a.preview=b;g.resolveWith(d,[a])},h;if(a.exif){!0===c.orientation&&(c.orientation=a.exif.get("Orientation"));if(c.thumbnail&&(h=a.exif.get("Thumbnail")))return e(h,k,c),g.promise();a.orientation?delete c.orientation:a.orientation=c.orientation}return f?(k(e.scale(f,c)),
g.promise()):a},saveImage:function(a,c){if(!a.canvas||c.disabled)return a;var d=this,e=a.files[a.index],f=b.Deferred();if(a.canvas.toBlob)a.canvas.toBlob(function(b){b.name||(e.type===b.type?b.name=e.name:e.name&&(b.name=e.name.replace(/\.\w+$/,"."+b.type.substr(6))));e.type!==b.type&&delete a.imageHead;a.files[a.index]=b;f.resolveWith(d,[a])},c.type||e.type,c.quality);else return a;return f.promise()},loadImageMetaData:function(a,c){if(c.disabled)return a;var d=this,g=b.Deferred();e.parseMetaData(a.files[a.index],
function(c){b.extend(a,c);g.resolveWith(d,[a])},c);return g.promise()},saveImageMetaData:function(a,b){if(!(a.imageHead&&a.canvas&&a.canvas.toBlob)||b.disabled)return a;var d=a.files[a.index],e=new Blob([a.imageHead,this._blobSlice.call(d,20)],{type:d.type});e.name=d.name;a.files[a.index]=e;return a},setImage:function(a,b){a.preview&&!b.disabled&&(a.files[a.index][b.name||"preview"]=a.preview);return a},deleteImageReferences:function(a,b){b.disabled||(delete a.img,delete a.canvas,delete a.preview,
delete a.imageHead);return a}}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","load-image","./jquery.fileupload-process"],b):"object"===typeof exports?b(require("jquery"),require("load-image")):b(window.jQuery,window.loadImage)})(function(b,e){b.blueimp.fileupload.prototype.options.processQueue.unshift({action:"loadAudio",prefix:!0,fileTypes:"@",maxFileSize:"@",disabled:"@disableAudioPreview"},{action:"setAudio",name:"@audioPreviewName",disabled:"@disableAudioPreview"});b.widget("blueimp.fileupload",b.blueimp.fileupload,
{options:{loadAudioFileTypes:/^audio\/.*$/},_audioElement:document.createElement("audio"),processActions:{loadAudio:function(a,c){if(c.disabled)return a;var d=a.files[a.index],g;this._audioElement.canPlayType&&this._audioElement.canPlayType(d.type)&&("number"!==b.type(c.maxFileSize)||d.size<=c.maxFileSize)&&(!c.fileTypes||c.fileTypes.test(d.type))&&(d=e.createObjectURL(d))&&(g=this._audioElement.cloneNode(!1),g.src=d,g.controls=!0,a.audio=g);return a},setAudio:function(a,b){a.audio&&!b.disabled&&
(a.files[a.index][b.name||"preview"]=a.audio);return a}}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","load-image","./jquery.fileupload-process"],b):"object"===typeof exports?b(require("jquery"),require("load-image")):b(window.jQuery,window.loadImage)})(function(b,e){b.blueimp.fileupload.prototype.options.processQueue.unshift({action:"loadVideo",prefix:!0,fileTypes:"@",maxFileSize:"@",disabled:"@disableVideoPreview"},{action:"setVideo",name:"@videoPreviewName",disabled:"@disableVideoPreview"});b.widget("blueimp.fileupload",b.blueimp.fileupload,
{options:{loadVideoFileTypes:/^video\/.*$/},_videoElement:document.createElement("video"),processActions:{loadVideo:function(a,c){if(c.disabled)return a;var d=a.files[a.index],g;this._videoElement.canPlayType&&this._videoElement.canPlayType(d.type)&&("number"!==b.type(c.maxFileSize)||d.size<=c.maxFileSize)&&(!c.fileTypes||c.fileTypes.test(d.type))&&(d=e.createObjectURL(d))&&(g=this._videoElement.cloneNode(!1),g.src=d,g.controls=!0,a.video=g);return a},setVideo:function(a,b){a.video&&!b.disabled&&
(a.files[a.index][b.name||"preview"]=a.video);return a}}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","./jquery.fileupload-process"],b):"object"===typeof exports?b(require("jquery")):b(window.jQuery)})(function(b){b.blueimp.fileupload.prototype.options.processQueue.push({action:"validate",always:!0,acceptFileTypes:"@",maxFileSize:"@",minFileSize:"@",maxNumberOfFiles:"@",disabled:"@disableValidation"});b.widget("blueimp.fileupload",b.blueimp.fileupload,{options:{getNumberOfFiles:b.noop,messages:{maxNumberOfFiles:"Maximum number of files exceeded",
acceptFileTypes:"File type not allowed",maxFileSize:"File is too large",minFileSize:"File is too small"}},processActions:{validate:function(e,a){if(a.disabled)return e;var c=b.Deferred(),d=this.options,g=e.files[e.index],f;if(a.minFileSize||a.maxFileSize)f=g.size;"number"===b.type(a.maxNumberOfFiles)&&(d.getNumberOfFiles()||0)+e.files.length>a.maxNumberOfFiles?g.error=d.i18n("maxNumberOfFiles"):!a.acceptFileTypes||a.acceptFileTypes.test(g.type)||a.acceptFileTypes.test(g.name)?f>a.maxFileSize?g.error=
d.i18n("maxFileSize"):"number"===b.type(f)&&f<a.minFileSize?g.error=d.i18n("minFileSize"):delete g.error:g.error=d.i18n("acceptFileTypes");g.error||e.files.error?(e.files.error=!0,c.rejectWith(this,[e])):c.resolveWith(this,[e]);return c.promise()}}})});
(function(b){"function"===typeof define&&define.amd?define("jquery tmpl ./jquery.fileupload-image ./jquery.fileupload-audio ./jquery.fileupload-video ./jquery.fileupload-validate".split(" "),b):"object"===typeof exports?b(require("jquery"),require("tmpl")):b(window.jQuery,window.tmpl)})(function(b,e){b.blueimp.fileupload.prototype._specialOptions.push("filesContainer","uploadTemplateId","downloadTemplateId");b.widget("blueimp.fileupload",b.blueimp.fileupload,{options:{autoUpload:!1,uploadTemplateId:"template-upload",
downloadTemplateId:"template-download",filesContainer:void 0,prependFiles:!1,dataType:"json",messages:{unknownError:"Unknown error"},getNumberOfFiles:function(){return this.filesContainer.children().not(".processing").length},getFilesFromResponse:function(a){return a.result&&b.isArray(a.result.files)?a.result.files:[]},add:function(a,c){if(a.isDefaultPrevented())return!1;var d=b(this),e=d.data("blueimp-fileupload")||d.data("fileupload"),f=e.options;c.context=e._renderUpload(c.files).data("data",c).addClass("processing");
f.filesContainer[f.prependFiles?"prepend":"append"](c.context);e._forceReflow(c.context);e._transition(c.context);c.process(function(){return d.fileupload("process",c)}).always(function(){c.context.each(function(a){b(this).find(".size").text(e._formatFileSize(c.files[a].size))}).removeClass("processing");e._renderPreviews(c)}).done(function(){c.context.find(".start").prop("disabled",!1);!1!==e._trigger("added",a,c)&&(f.autoUpload||c.autoUpload)&&!1!==c.autoUpload&&c.submit()}).fail(function(){c.files.error&&
c.context.each(function(a){(a=c.files[a].error)&&b(this).find(".error").text(a)})})},send:function(a,c){if(a.isDefaultPrevented())return!1;var d=b(this).data("blueimp-fileupload")||b(this).data("fileupload");c.context&&c.dataType&&"iframe"===c.dataType.substr(0,6)&&c.context.find(".progress").addClass(!b.support.transition&&"progress-animated").attr("aria-valuenow",100).children().first().css("width","100%");return d._trigger("sent",a,c)},done:function(a,c){if(a.isDefaultPrevented())return!1;var d=
b(this).data("blueimp-fileupload")||b(this).data("fileupload"),e=(c.getFilesFromResponse||d.options.getFilesFromResponse)(c),f,k;c.context?c.context.each(function(h){var l=e[h]||{error:"Empty file upload result"};k=d._addFinishedDeferreds();d._transition(b(this)).done(function(){var e=b(this);f=d._renderDownload([l]).replaceAll(e);d._forceReflow(f);d._transition(f).done(function(){c.context=b(this);d._trigger("completed",a,c);d._trigger("finished",a,c);k.resolve()})})}):(f=d._renderDownload(e)[d.options.prependFiles?
"prependTo":"appendTo"](d.options.filesContainer),d._forceReflow(f),k=d._addFinishedDeferreds(),d._transition(f).done(function(){c.context=b(this);d._trigger("completed",a,c);d._trigger("finished",a,c);k.resolve()}))},fail:function(a,c){if(a.isDefaultPrevented())return!1;var d=b(this).data("blueimp-fileupload")||b(this).data("fileupload"),e,f;c.context?c.context.each(function(k){if("abort"!==c.errorThrown){var h=c.files[k];h.error=h.error||c.errorThrown||c.i18n("unknownError");f=d._addFinishedDeferreds();
d._transition(b(this)).done(function(){var k=b(this);e=d._renderDownload([h]).replaceAll(k);d._forceReflow(e);d._transition(e).done(function(){c.context=b(this);d._trigger("failed",a,c);d._trigger("finished",a,c);f.resolve()})})}else f=d._addFinishedDeferreds(),d._transition(b(this)).done(function(){b(this).remove();d._trigger("failed",a,c);d._trigger("finished",a,c);f.resolve()})}):"abort"!==c.errorThrown?(c.context=d._renderUpload(c.files)[d.options.prependFiles?"prependTo":"appendTo"](d.options.filesContainer).data("data",
c),d._forceReflow(c.context),f=d._addFinishedDeferreds(),d._transition(c.context).done(function(){c.context=b(this);d._trigger("failed",a,c);d._trigger("finished",a,c);f.resolve()})):(d._trigger("failed",a,c),d._trigger("finished",a,c),d._addFinishedDeferreds().resolve())},progress:function(a,c){if(a.isDefaultPrevented())return!1;var d=Math.floor(c.loaded/c.total*100);c.context&&c.context.each(function(){b(this).find(".progress").attr("aria-valuenow",d).children().first().css("width",d+"%")})},progressall:function(a,
c){if(a.isDefaultPrevented())return!1;var d=b(this),e=Math.floor(c.loaded/c.total*100),f=d.find(".fileupload-progress"),k=f.find(".progress-extended");k.length&&k.html((d.data("blueimp-fileupload")||d.data("fileupload"))._renderExtendedProgress(c));f.find(".progress").attr("aria-valuenow",e).children().first().css("width",e+"%")},start:function(a){if(a.isDefaultPrevented())return!1;var c=b(this).data("blueimp-fileupload")||b(this).data("fileupload");c._resetFinishedDeferreds();c._transition(b(this).find(".fileupload-progress")).done(function(){c._trigger("started",
a)})},stop:function(a){if(a.isDefaultPrevented())return!1;var c=b(this).data("blueimp-fileupload")||b(this).data("fileupload"),d=c._addFinishedDeferreds();b.when.apply(b,c._getFinishedDeferreds()).done(function(){c._trigger("stopped",a)});c._transition(b(this).find(".fileupload-progress")).done(function(){b(this).find(".progress").attr("aria-valuenow","0").children().first().css("width","0%");b(this).find(".progress-extended").html("&nbsp;");d.resolve()})},processstart:function(a){if(a.isDefaultPrevented())return!1;
b(this).addClass("fileupload-processing")},processstop:function(a){if(a.isDefaultPrevented())return!1;b(this).removeClass("fileupload-processing")},destroy:function(a,c){if(a.isDefaultPrevented())return!1;var d=b(this).data("blueimp-fileupload")||b(this).data("fileupload"),e=function(){d._transition(c.context).done(function(){b(this).remove();d._trigger("destroyed",a,c)})};c.url?(c.dataType=c.dataType||d.options.dataType,b.ajax(c).done(e).fail(function(){d._trigger("destroyfailed",a,c)})):e()}},_resetFinishedDeferreds:function(){this._finishedUploads=
[]},_addFinishedDeferreds:function(a){a||(a=b.Deferred());this._finishedUploads.push(a);return a},_getFinishedDeferreds:function(){return this._finishedUploads},_enableDragToDesktop:function(){var a=b(this),c=a.prop("href"),d=a.prop("download");a.bind("dragstart",function(a){try{a.originalEvent.dataTransfer.setData("DownloadURL",["application/octet-stream",d,c].join(":"))}catch(b){}})},_formatFileSize:function(a){return"number"!==typeof a?"":1E9<=a?(a/1E9).toFixed(2)+" GB":1E6<=a?(a/1E6).toFixed(2)+
" MB":(a/1E3).toFixed(2)+" KB"},_formatBitrate:function(a){return"number"!==typeof a?"":1E9<=a?(a/1E9).toFixed(2)+" Gbit/s":1E6<=a?(a/1E6).toFixed(2)+" Mbit/s":1E3<=a?(a/1E3).toFixed(2)+" kbit/s":a.toFixed(2)+" bit/s"},_formatTime:function(a){var b=new Date(1E3*a);a=Math.floor(a/86400);return(a?a+"d ":"")+("0"+b.getUTCHours()).slice(-2)+":"+("0"+b.getUTCMinutes()).slice(-2)+":"+("0"+b.getUTCSeconds()).slice(-2)},_formatPercentage:function(a){return(100*a).toFixed(2)+" %"},_renderExtendedProgress:function(a){return this._formatBitrate(a.bitrate)+
" | "+this._formatTime(8*(a.total-a.loaded)/a.bitrate)+" | "+this._formatPercentage(a.loaded/a.total)+" | "+this._formatFileSize(a.loaded)+" / "+this._formatFileSize(a.total)},_renderTemplate:function(a,c){if(!a)return b();var d=a({files:c,formatFileSize:this._formatFileSize,options:this.options});return d instanceof b?d:b(this.options.templatesContainer).html(d).children()},_renderPreviews:function(a){a.context.find(".preview").each(function(c,d){b(d).append(a.files[c].preview)})},_renderUpload:function(a){return this._renderTemplate(this.options.uploadTemplate,
a)},_renderDownload:function(a){return this._renderTemplate(this.options.downloadTemplate,a).find("a[download]").each(this._enableDragToDesktop).end()},_startHandler:function(a){a.preventDefault();a=b(a.currentTarget);var c=a.closest(".template-upload").data("data");a.prop("disabled",!0);c&&c.submit&&c.submit()},_cancelHandler:function(a){a.preventDefault();var c=b(a.currentTarget).closest(".template-upload,.template-download"),d=c.data("data")||{};d.context=d.context||c;d.abort?d.abort():(d.errorThrown=
"abort",this._trigger("fail",a,d))},_deleteHandler:function(a){a.preventDefault();var c=b(a.currentTarget);this._trigger("destroy",a,b.extend({context:c.closest(".template-download"),type:"DELETE"},c.data()))},_forceReflow:function(a){return b.support.transition&&a.length&&a[0].offsetWidth},_transition:function(a){var c=b.Deferred();b.support.transition&&a.hasClass("fade")&&a.is(":visible")?a.bind(b.support.transition.end,function(d){d.target===a[0]&&(a.unbind(b.support.transition.end),c.resolveWith(a))}).toggleClass("in"):
(a.toggleClass("in"),c.resolveWith(a));return c},_initButtonBarEventHandlers:function(){var a=this.element.find(".fileupload-buttonbar"),c=this.options.filesContainer;this._on(a.find(".start"),{click:function(a){a.preventDefault();c.find(".start").click()}});this._on(a.find(".cancel"),{click:function(a){a.preventDefault();c.find(".cancel").click()}});this._on(a.find(".delete"),{click:function(b){b.preventDefault();c.find(".toggle:checked").closest(".template-download").find(".delete").click();a.find(".toggle").prop("checked",
!1)}});this._on(a.find(".toggle"),{change:function(a){c.find(".toggle").prop("checked",b(a.currentTarget).is(":checked"))}})},_destroyButtonBarEventHandlers:function(){this._off(this.element.find(".fileupload-buttonbar").find(".start, .cancel, .delete"),"click");this._off(this.element.find(".fileupload-buttonbar .toggle"),"change.")},_initEventHandlers:function(){this._super();this._on(this.options.filesContainer,{"click .start":this._startHandler,"click .cancel":this._cancelHandler,"click .delete":this._deleteHandler});
this._initButtonBarEventHandlers()},_destroyEventHandlers:function(){this._destroyButtonBarEventHandlers();this._off(this.options.filesContainer,"click");this._super()},_enableFileInputButton:function(){this.element.find(".fileinput-button input").prop("disabled",!1).parent().removeClass("disabled")},_disableFileInputButton:function(){this.element.find(".fileinput-button input").prop("disabled",!0).parent().addClass("disabled")},_initTemplates:function(){var a=this.options;a.templatesContainer=this.document[0].createElement(a.filesContainer.prop("nodeName"));
e&&(a.uploadTemplateId&&(a.uploadTemplate=e(a.uploadTemplateId)),a.downloadTemplateId&&(a.downloadTemplate=e(a.downloadTemplateId)))},_initFilesContainer:function(){var a=this.options;void 0===a.filesContainer?a.filesContainer=this.element.find(".files"):a.filesContainer instanceof b||(a.filesContainer=b(a.filesContainer))},_initSpecialOptions:function(){this._super();this._initFilesContainer();this._initTemplates()},_create:function(){this._super();this._resetFinishedDeferreds();b.support.fileInput||
this._disableFileInputButton()},enable:function(){var a=!1;this.options.disabled&&(a=!0);this._super();a&&(this.element.find("input, button").prop("disabled",!1),this._enableFileInputButton())},disable:function(){this.options.disabled||(this.element.find("input, button").prop("disabled",!0),this._disableFileInputButton());this._super()}})});
(function(b){"function"===typeof define&&define.amd?define(["jquery","../jquery.fileupload"],b):"object"===typeof exports?b(require("jquery"),require("../jquery.fileupload")):b(window.jQuery)})(function(b){b.widget("blueimp.fileupload",b.blueimp.fileupload,{getUploadButton:function(){return b("<button/>").addClass("btn").prop("disabled",!0).text("Processing...").on("click",function(){var e=b(this),a=e.data();e.off("click").text("Abort").on("click",function(){e.remove();a.abort()});a.submit().always(function(){e.remove()})})},
initTheme:function(b){var a=this.element;b=b.toLowerCase();return a?("basic"==b?this._initBasicTheme(a):"basicplus"==b?this._initBasicPlusTheme(a):"basicplusui"!=b&&"jqueryui"!=b||this._initBasicPlusUITheme(a),a):null},_initBasicTheme:function(e){e.on("fileuploaddone",function(a,c){b.each(c.result.files,function(a,c){b("<p/>").text(c.name).appendTo("#files")})}).on("fileuploadprogressall",function(a,c){var d=parseInt(c.loaded/c.total*100,10);b("#progress .progress-bar").css("width",d+"%")}).prop("disabled",
!b.support.fileInput).parent().addClass(b.support.fileInput?void 0:"disabled")},_initBasicPlusTheme:function(e){e.on("fileuploadadd",function(a,c){var d=b(a.target).data("blueimp-fileupload").getUploadButton();c.context=b("<div/>").appendTo("#files");b.each(c.files,function(a,e){var k=b("<p/>").append(b("<span/>").text(e.name));a||k.append("<br>").append(d.clone(!0).data(c));k.appendTo(c.context)})}).on("fileuploadprocessalways",function(a,c){var d=c.index,e=c.files[d],f=b(c.context.children()[d]);
e.preview&&f.prepend("<br>").prepend(e.preview);e.error&&f.append("<br>").append(e.error);d+1===c.files.length&&c.context.find("button").text("Upload").prop("disabled",!!c.files.error)}).on("fileuploadprogressall",function(a,c){var d=parseInt(c.loaded/c.total*100,10);b("#progress .bar").css("width",d+"%")}).on("fileuploaddone",function(a,c){b.each(c.result.files,function(a,e){var f=b("<a>").attr("target","_blank").prop("href",e.url);b(c.context.children()[a]).wrap(f)})}).on("fileuploadfail",function(a,
c){b.each(c.result.files,function(a,e){var f=b("<span/>").text(e.error);b(c.context.children()[a]).append("<br>").append(f)})}).prop("disabled",!b.support.fileInput).parent().addClass(b.support.fileInput?void 0:"disabled")},_initBasicPlusUITheme:function(e){e.prop("disabled",!b.support.fileInput).parent().addClass(b.support.fileInput?void 0:"disabled")}})});
@@ -0,0 +1,126 @@
!function(c){var e=function(a,b){var d=/[^\w\-\.:]/.test(a)?new Function(e.arg+",tmpl","var _e=tmpl.encode"+e.helper+",_s='"+a.replace(e.regexp,e.func)+"';return _s;"):e.cache[a]=e.cache[a]||e(e.load(a));return b?d(b,e):function(a){return d(a,e)}};e.cache={};e.load=function(a){return document.getElementById(a).innerHTML};e.regexp=/([\s'\\])(?!(?:[^{]|\{(?!%))*%\})|(?:\{%(=|#)([\s\S]+?)%\})|(\{%)|(%\})/g;e.func=function(a,b,d,c,f,e){return b?{"\n":"\\n","\r":"\\r","\t":"\\t"," ":" "}[b]||"\\"+b:d?
"="===d?"'+_e("+c+")+'":"'+("+c+"==null?'':"+c+")+'":f?"';":e?"_s+='":void 0};e.encReg=/[<>&"'\x00]/g;e.encMap={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;","'":"&#39;"};e.encode=function(a){return(null==a?"":""+a).replace(e.encReg,function(a){return e.encMap[a]||""})};e.arg="o";e.helper=",print=function(s,e){_s+=e?(s==null?'':s):_e(s);},include=function(s,d){_s+=tmpl(s,d);}";"function"==typeof define&&define.amd?define(function(){return e}):"object"==typeof module&&module.exports?module.exports=
e:c.tmpl=e}(this);
!function(c){var e=function(a,d,c){var f,k,h=document.createElement("img");if(h.onerror=d,h.onload=function(){!k||c&&c.noRevoke||e.revokeObjectURL(k);d&&d(e.scale(h,c))},e.isInstanceOf("Blob",a)||e.isInstanceOf("File",a))f=k=e.createObjectURL(a),h._type=a.type;else{if("string"!=typeof a)return!1;f=a;c&&c.crossOrigin&&(h.crossOrigin=c.crossOrigin)}return f?(h.src=f,h):e.readFile(a,function(a){var b=a.target;b&&b.result?h.src=b.result:d&&d(a)})},a=window.createObjectURL&&window||window.URL&&URL.revokeObjectURL&&
URL||window.webkitURL&&webkitURL;e.isInstanceOf=function(a,d){return Object.prototype.toString.call(d)==="[object "+a+"]"};e.transformCoordinates=function(){};e.getTransformedOptions=function(a,d){var c,f,e,h,l=d.aspectRatio;if(!l)return d;c={};for(f in d)d.hasOwnProperty(f)&&(c[f]=d[f]);return c.crop=!0,e=a.naturalWidth||a.width,h=a.naturalHeight||a.height,e/h>l?(c.maxWidth=h*l,c.maxHeight=h):(c.maxWidth=e,c.maxHeight=e/l),c};e.renderImageToCanvas=function(a,d,c,f,e,h,l,p,n,m){return a.getContext("2d").drawImage(d,
c,f,e,h,l,p,n,m),a};e.hasCanvasOption=function(a){return a.canvas||a.crop||!!a.aspectRatio};e.scale=function(a,d){function c(){var a=Math.max((l||r)/r,(p||t)/t);1<a&&(r*=a,t*=a)}function f(){var a=Math.min((k||r)/r,(h||t)/t);1>a&&(r*=a,t*=a)}d=d||{};var k,h,l,p,n,m,q,u,w,x,A,v=document.createElement("canvas"),B=a.getContext||e.hasCanvasOption(d)&&v.getContext,y=a.naturalWidth||a.width,z=a.naturalHeight||a.height,r=y,t=z;if(B&&(d=e.getTransformedOptions(a,d),q=d.left||0,u=d.top||0,d.sourceWidth?(n=
d.sourceWidth,void 0!==d.right&&void 0===d.left&&(q=y-n-d.right)):n=y-q-(d.right||0),d.sourceHeight?(m=d.sourceHeight,void 0!==d.bottom&&void 0===d.top&&(u=z-m-d.bottom)):m=z-u-(d.bottom||0),r=n,t=m),k=d.maxWidth,h=d.maxHeight,l=d.minWidth,p=d.minHeight,B&&k&&h&&d.crop?(r=k,t=h,A=n/m-k/h,0>A?(m=h*n/k,void 0===d.top&&void 0===d.bottom&&(u=(z-m)/2)):0<A&&(n=k*m/h,void 0===d.left&&void 0===d.right&&(q=(y-n)/2))):((d.contain||d.cover)&&(l=k=k||l,p=h=h||p),d.cover?(f(),c()):(c(),f())),B){if(w=d.pixelRatio,
1<w&&(v.style.width=r+"px",v.style.height=t+"px",r*=w,t*=w,v.getContext("2d").scale(w,w)),x=d.downsamplingRatio,0<x&&1>x&&n>r&&m>t)for(;n*x>r;)v.width=n*x,v.height=m*x,e.renderImageToCanvas(v,a,q,u,n,m,0,0,v.width,v.height),n=v.width,m=v.height,a=document.createElement("canvas"),a.width=n,a.height=m,e.renderImageToCanvas(a,v,0,0,n,m,0,0,n,m);return v.width=r,v.height=t,e.transformCoordinates(v,d),e.renderImageToCanvas(v,a,q,u,n,m,0,0,r,t)}return a.width=r,a.height=t,a};e.createObjectURL=function(b){return a?
a.createObjectURL(b):!1};e.revokeObjectURL=function(b){return a?a.revokeObjectURL(b):!1};e.readFile=function(a,d,c){if(window.FileReader){var f=new FileReader;if(f.onload=f.onerror=d,c=c||"readAsDataURL",f[c])return f[c](a),f}return!1};"function"==typeof define&&define.amd?define(function(){return e}):"object"==typeof module&&module.exports?module.exports=e:c.loadImage=e}(window);
(function(c){"function"==typeof define&&define.amd?define(["./load-image"],c):c("object"==typeof module&&module.exports?require("./load-image"):window.loadImage)})(function(c){var e=c.hasCanvasOption,a=c.transformCoordinates,b=c.getTransformedOptions;c.hasCanvasOption=function(a){return!!a.orientation||e.call(c,a)};c.transformCoordinates=function(b,g){a.call(c,b,g);var f=b.getContext("2d"),e=b.width,h=b.height,l=b.style.width,p=b.style.height,n=g.orientation;if(n&&!(8<n))switch(4<n&&(b.width=h,b.height=
e,b.style.width=p,b.style.height=l),n){case 2:f.translate(e,0);f.scale(-1,1);break;case 3:f.translate(e,h);f.rotate(Math.PI);break;case 4:f.translate(0,h);f.scale(1,-1);break;case 5:f.rotate(.5*Math.PI);f.scale(1,-1);break;case 6:f.rotate(.5*Math.PI);f.translate(0,-h);break;case 7:f.rotate(.5*Math.PI);f.translate(e,-h);f.scale(-1,1);break;case 8:f.rotate(-.5*Math.PI),f.translate(-e,0)}};c.getTransformedOptions=function(a,g){var f,e,h=b.call(c,a,g);f=h.orientation;if(!f||8<f||1===f)return h;f={};for(e in h)h.hasOwnProperty(e)&&
(f[e]=h[e]);switch(h.orientation){case 2:f.left=h.right;f.right=h.left;break;case 3:f.left=h.right;f.top=h.bottom;f.right=h.left;f.bottom=h.top;break;case 4:f.top=h.bottom;f.bottom=h.top;break;case 5:f.left=h.top;f.top=h.left;f.right=h.bottom;f.bottom=h.right;break;case 6:f.left=h.top;f.top=h.right;f.right=h.bottom;f.bottom=h.left;break;case 7:f.left=h.bottom;f.top=h.right;f.right=h.top;f.bottom=h.left;break;case 8:f.left=h.bottom,f.top=h.left,f.right=h.top,f.bottom=h.right}return 4<h.orientation&&
(f.maxWidth=h.maxHeight,f.maxHeight=h.maxWidth,f.minWidth=h.minHeight,f.minHeight=h.minWidth,f.sourceWidth=h.sourceHeight,f.sourceHeight=h.sourceWidth),f}});
(function(c){"function"==typeof define&&define.amd?define(["./load-image"],c):c("object"==typeof module&&module.exports?require("./load-image"):window.loadImage)})(function(c){c.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice)&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)};c.metaDataParsers={jpeg:{65505:[]}};c.parseMetaData=function(e,a,b){b=b||{};var d=this,g=b.maxMetaDataSize||262144,f={};window.DataView&&
e&&12<=e.size&&"image/jpeg"===e.type&&c.blobSlice&&c.readFile(c.blobSlice.call(e,0,g),function(g){if(g.target.error)return console.log(g.target.error),void a(f);var e,l,p,n;g=g.target.result;var m=new DataView(g),q=2,u=m.byteLength-4;p=q;if(65496===m.getUint16(0)){for(;u>q&&(e=m.getUint16(q),65504<=e&&65519>=e||65534===e);){if(l=m.getUint16(q+2)+2,q+l>m.byteLength){console.log("Invalid meta data: Invalid segment size.");break}if(p=c.metaDataParsers.jpeg[e])for(n=0;n<p.length;n+=1)p[n].call(d,m,q,
l,f,b);p=q+=l}!b.disableImageHead&&6<p&&(g.slice?f.imageHead=g.slice(0,p):f.imageHead=(new Uint8Array(g)).subarray(0,p))}else console.log("Invalid JPEG file: Missing JPEG marker.");a(f)},"readAsArrayBuffer")||a(f)}});
(function(c){"function"==typeof define&&define.amd?define(["./load-image","./load-image-meta"],c):"object"==typeof module&&module.exports?c(require("./load-image"),require("./load-image-meta")):c(window.loadImage)})(function(c){c.ExifMap=function(){return this};c.ExifMap.prototype.map={Orientation:274};c.ExifMap.prototype.get=function(c){return this[c]||this[this.map[c]]};c.getExifThumbnail=function(c,a,b){var d,g,f;if(!b||a+b>c.byteLength)return void console.log("Invalid Exif data: Invalid thumbnail data.");
d=[];for(g=0;b>g;g+=1)f=c.getUint8(a+g),d.push((16>f?"0":"")+f.toString(16));return"data:image/jpeg,%"+d.join("%")};c.exifTagTypes={1:{getValue:function(c,a){return c.getUint8(a)},size:1},2:{getValue:function(c,a){return String.fromCharCode(c.getUint8(a))},size:1,ascii:!0},3:{getValue:function(c,a,b){return c.getUint16(a,b)},size:2},4:{getValue:function(c,a,b){return c.getUint32(a,b)},size:4},5:{getValue:function(c,a,b){return c.getUint32(a,b)/c.getUint32(a+4,b)},size:8},9:{getValue:function(c,a,
b){return c.getInt32(a,b)},size:4},10:{getValue:function(c,a,b){return c.getInt32(a,b)/c.getInt32(a+4,b)},size:8}};c.exifTagTypes[7]=c.exifTagTypes[1];c.getExifValue=function(e,a,b,d,g,f){var k,h,l;d=c.exifTagTypes[d];if(!d)return void console.log("Invalid Exif data: Invalid tag type.");if(k=d.size*g,h=4<k?a+e.getUint32(b+8,f):b+8,h+k>e.byteLength)return void console.log("Invalid Exif data: Invalid data offset.");if(1===g)return d.getValue(e,h,f);a=[];for(b=0;g>b;b+=1)a[b]=d.getValue(e,h+b*d.size,
f);if(d.ascii){e="";for(b=0;b<a.length&&(l=a[b],"\x00"!==l);b+=1)e+=l;return e}return a};c.parseExifTag=function(e,a,b,d,g){var f=e.getUint16(b,d);g.exif[f]=c.getExifValue(e,a,b,e.getUint16(b+2,d),e.getUint32(b+4,d),d)};c.parseExifTags=function(c,a,b,d,g){var f,k,h;if(b+6>c.byteLength)return void console.log("Invalid Exif data: Invalid directory offset.");if(f=c.getUint16(b,d),k=b+2+12*f,k+4>c.byteLength)return void console.log("Invalid Exif data: Invalid directory size.");for(h=0;f>h;h+=1)this.parseExifTag(c,
a,b+2+12*h,d,g);return c.getUint32(k,d)};c.parseExifData=function(e,a,b,d,g){if(!g.disableExif){var f,k;b=a+10;if(1165519206===e.getUint32(a+4)){if(b+8>e.byteLength)return void console.log("Invalid Exif data: Invalid segment size.");if(0!==e.getUint16(a+8))return void console.log("Invalid Exif data: Missing byte alignment offset.");switch(e.getUint16(b)){case 18761:a=!0;break;case 19789:a=!1;break;default:return void console.log("Invalid Exif data: Invalid byte alignment marker.")}if(42!==e.getUint16(b+
2,a))return void console.log("Invalid Exif data: Missing TIFF marker.");f=e.getUint32(b+4,a);d.exif=new c.ExifMap;(f=c.parseExifTags(e,b,b+f,a,d))&&!g.disableExifThumbnail&&(k={exif:{}},c.parseExifTags(e,b,b+f,a,k),k.exif[513]&&(d.exif.Thumbnail=c.getExifThumbnail(e,b+k.exif[513],k.exif[514])));d.exif[34665]&&!g.disableExifSub&&c.parseExifTags(e,b,b+d.exif[34665],a,d);d.exif[34853]&&!g.disableExifGps&&c.parseExifTags(e,b,b+d.exif[34853],a,d)}}};c.metaDataParsers.jpeg[65505].push(c.parseExifData)});
(function(c){"function"==typeof define&&define.amd?define(["./load-image","./load-image-exif"],c):"object"==typeof module&&module.exports?c(require("./load-image"),require("./load-image-exif")):c(window.loadImage)})(function(c){c.ExifMap.prototype.tags={256:"ImageWidth",257:"ImageHeight",34665:"ExifIFDPointer",34853:"GPSInfoIFDPointer",40965:"InteroperabilityIFDPointer",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",
530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright",36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",
40962:"PixelXDimension",40963:"PixelYDimension",42240:"Gamma",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"PhotographicSensitivity",34856:"OECF",34864:"SensitivityType",34865:"StandardOutputSensitivity",
34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",
41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:"LensSpecification",42035:"LensMake",42036:"LensModel",
42037:"LensSerialNumber",0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",
26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"};c.ExifMap.prototype.stringValues={ExposureProgram:{0:"Undefined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",
1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",
7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",
71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},
SensingMethod:{1:"Undefined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",
4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},ComponentsConfiguration:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"},Orientation:{1:"top-left",2:"top-right",3:"bottom-right",4:"bottom-left",5:"left-top",6:"right-top",7:"right-bottom",8:"left-bottom"}};c.ExifMap.prototype.getText=function(c){var a=
this.get(c);switch(c){case "LightSource":case "Flash":case "MeteringMode":case "ExposureProgram":case "SensingMethod":case "SceneCaptureType":case "SceneType":case "CustomRendered":case "WhiteBalance":case "GainControl":case "Contrast":case "Saturation":case "Sharpness":case "SubjectDistanceRange":case "FileSource":case "Orientation":return this.stringValues[c][a];case "ExifVersion":case "FlashpixVersion":return String.fromCharCode(a[0],a[1],a[2],a[3]);case "ComponentsConfiguration":return this.stringValues[c][a[0]]+
this.stringValues[c][a[1]]+this.stringValues[c][a[2]]+this.stringValues[c][a[3]];case "GPSVersionID":return a[0]+"."+a[1]+"."+a[2]+"."+a[3]}return String(a)};(function(c){var a,b=c.tags;c=c.map;for(a in b)b.hasOwnProperty(a)&&(c[b[a]]=a)})(c.ExifMap.prototype);c.ExifMap.prototype.getAll=function(){var c,a,b={};for(c in this)this.hasOwnProperty(c)&&(a=this.tags[c],a&&(b[a]=this.getText(a)));return b}});
!function(c){var e=c.HTMLCanvasElement&&c.HTMLCanvasElement.prototype,a;if(a=c.Blob)try{a=!!new Blob}catch(h){a=!1}var b=a;if(a=b&&c.Uint8Array)try{a=100===(new Blob([new Uint8Array(100)])).size}catch(h){a=!1}var d=a,g=c.BlobBuilder||c.WebKitBlobBuilder||c.MozBlobBuilder||c.MSBlobBuilder,f=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,k=(b||g)&&c.atob&&c.ArrayBuffer&&c.Uint8Array&&function(a){var c,e,k,m,q;if(c=a.match(f),!c)throw Error("invalid data URI");e=c[2]?c[1]:"text/plain"+(c[3]||";charset=US-ASCII");
k=!!c[4];a=a.slice(c[0].length);k=k?atob(a):decodeURIComponent(a);a=new ArrayBuffer(k.length);c=new Uint8Array(a);for(m=0;m<k.length;m+=1)c[m]=k.charCodeAt(m);return b?new Blob([d?c:a],{type:e}):(q=new g,q.append(a),q.getBlob(e))};c.HTMLCanvasElement&&!e.toBlob&&(e.mozGetAsFile?e.toBlob=function(a,b,c){a(c&&e.toDataURL&&k?k(this.toDataURL(b,c)):this.mozGetAsFile("blob",b))}:e.toDataURL&&k&&(e.toBlob=function(a,b,c){a(k(this.toDataURL(b,c)))}));"function"==typeof define&&define.amd?define(function(){return k}):
"object"==typeof module&&module.exports?module.exports=k:c.dataURLtoBlob=k}(window);
(function(c){"function"===typeof define&&define.amd?define(["jquery"],c):"object"===typeof exports?c(require("jquery")):c(window.jQuery)})(function(c){var e=0;c.ajaxTransport("iframe",function(a){if(a.async){var b=a.initialIframeSrc||"javascript:false;",d,g,f;return{send:function(k,h){d=c('<form style="display:none;"></form>');d.attr("accept-charset",a.formAcceptCharset);f=/\?/.test(a.url)?"&":"?";"DELETE"===a.type?(a.url=a.url+f+"_method=DELETE",a.type="POST"):"PUT"===a.type?(a.url=a.url+f+"_method=PUT",
a.type="POST"):"PATCH"===a.type&&(a.url=a.url+f+"_method=PATCH",a.type="POST");e+=1;g=c('<iframe src="'+b+'" name="iframe-transport-'+e+'"></iframe>').bind("load",function(){var f,e=c.isArray(a.paramName)?a.paramName:[a.paramName];g.unbind("load").bind("load",function(){var a;try{if(a=g.contents(),!a.length||!a[0].firstChild)throw Error();}catch(f){a=void 0}h(200,"success",{iframe:a});c('<iframe src="'+b+'"></iframe>').appendTo(d);window.setTimeout(function(){d.remove()},0)});d.prop("target",g.prop("name")).prop("action",
a.url).prop("method",a.type);a.formData&&c.each(a.formData,function(a,b){c('<input type="hidden"/>').prop("name",b.name).val(b.value).appendTo(d)});a.fileInput&&a.fileInput.length&&"POST"===a.type&&(f=a.fileInput.clone(),a.fileInput.after(function(a){return f[a]}),a.paramName&&a.fileInput.each(function(b){c(this).prop("name",e[b]||a.paramName)}),d.append(a.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"),a.fileInput.removeAttr("form"));d.submit();f&&f.length&&
a.fileInput.each(function(a,b){var d=c(f[a]);c(b).prop("name",d.prop("name")).attr("form",d.attr("form"));d.replaceWith(b)})});d.append(g).appendTo(document.body)},abort:function(){g&&g.unbind("load").prop("src",b);d&&d.remove()}}}});c.ajaxSetup({converters:{"iframe text":function(a){return a&&c(a[0].body).text()},"iframe json":function(a){return a&&c.parseJSON(c(a[0].body).text())},"iframe html":function(a){return a&&c(a[0].body).html()},"iframe xml":function(a){return(a=a&&a[0])&&c.isXMLDoc(a)?
a:c.parseXML(a.XMLDocument&&a.XMLDocument.xml||c(a.body).html())},"iframe script":function(a){return a&&c.globalEval(c(a[0].body).text())}}})});
(function(c){"function"===typeof define&&define.amd?define(["jquery","jquery.ui.widget"],c):"object"===typeof exports?c(require("jquery"),require("./vendor/jquery.ui.widget")):c(window.jQuery)})(function(c){function e(a){var b="dragover"===a;return function(d){d.dataTransfer=d.originalEvent&&d.originalEvent.dataTransfer;var g=d.dataTransfer;g&&-1!==c.inArray("Files",g.types)&&!1!==this._trigger(a,c.Event(a,{delegatedEvent:d}))&&(d.preventDefault(),b&&(g.dropEffect="copy"))}}c.support.fileInput=!(/(Android (1\.[0156]|2\.[01]))|(Windows Phone (OS 7|8\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)|(w(eb)?OSBrowser)|(webOS)|(Kindle\/(1\.0|2\.[05]|3\.0))/.test(window.navigator.userAgent)||
c('<input type="file">').prop("disabled"));c.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader);c.support.xhrFormDataFileUpload=!!window.FormData;c.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice);c.widget("blueimp.fileupload",{options:{dropZone:c(document),pasteZone:void 0,fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,limitMultiFileUploadSize:void 0,limitMultiFileUploadSizeOverhead:512,
sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(a,b){a=this.messages[a]||a.toString();b&&c.each(b,function(b,c){a=a.replace("{"+b+"}",c)});return a},formData:function(a){return a.serializeArray()},add:function(a,
b){if(a.isDefaultPrevented())return!1;(b.autoUpload||!1!==b.autoUpload&&c(this).fileupload("option","autoUpload"))&&b.process().done(function(){b.submit()})},processData:!1,contentType:!1,cache:!1,timeout:0},_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:c.support.blobSlice&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime();this.bitrate=
this.loaded=0;this.getBitrate=function(a,b,c){var g=a-this.timestamp;if(!this.bitrate||!c||g>c)this.bitrate=1E3/g*(b-this.loaded)*8,this.loaded=b,this.timestamp=a;return this.bitrate}},_isXHRUpload:function(a){return!a.forceIframeTransport&&(!a.multipart&&c.support.xhrFileUpload||c.support.xhrFormDataFileUpload)},_getFormData:function(a){var b;return"function"===c.type(a.formData)?a.formData(a.form):c.isArray(a.formData)?a.formData:"object"===c.type(a.formData)?(b=[],c.each(a.formData,function(a,
c){b.push({name:a,value:c})}),b):[]},_getTotal:function(a){var b=0;c.each(a,function(a,c){b+=c.size||1});return b},_initProgressObject:function(a){var b={loaded:0,total:0,bitrate:0};a._progress?c.extend(a._progress,b):a._progress=b},_initResponseObject:function(a){var b;if(a._response)for(b in a._response)a._response.hasOwnProperty(b)&&delete a._response[b];else a._response={}},_onProgress:function(a,b){if(a.lengthComputable){var d=Date.now?Date.now():(new Date).getTime(),g;b._time&&b.progressInterval&&
d-b._time<b.progressInterval&&a.loaded!==a.total||(b._time=d,g=Math.floor(a.loaded/a.total*(b.chunkSize||b._progress.total))+(b.uploadedBytes||0),this._progress.loaded+=g-b._progress.loaded,this._progress.bitrate=this._bitrateTimer.getBitrate(d,this._progress.loaded,b.bitrateInterval),b._progress.loaded=b.loaded=g,b._progress.bitrate=b.bitrate=b._bitrateTimer.getBitrate(d,g,b.bitrateInterval),this._trigger("progress",c.Event("progress",{delegatedEvent:a}),b),this._trigger("progressall",c.Event("progressall",
{delegatedEvent:a}),this._progress))}},_initProgressListener:function(a){var b=this,d=a.xhr?a.xhr():c.ajaxSettings.xhr();d.upload&&(c(d.upload).bind("progress",function(c){var d=c.originalEvent;c.lengthComputable=d.lengthComputable;c.loaded=d.loaded;c.total=d.total;b._onProgress(c,a)}),a.xhr=function(){return d})},_isInstanceOf:function(a,b){return Object.prototype.toString.call(b)==="[object "+a+"]"},_initXHRData:function(a){var b=this,d,g=a.files[0],f=a.multipart||!c.support.xhrFileUpload,e="array"===
c.type(a.paramName)?a.paramName[0]:a.paramName;a.headers=c.extend({},a.headers);a.contentRange&&(a.headers["Content-Range"]=a.contentRange);f&&!a.blob&&this._isInstanceOf("File",g)||(a.headers["Content-Disposition"]='attachment; filename="'+encodeURI(g.name)+'"');f?c.support.xhrFormDataFileUpload&&(a.postMessage?(d=this._getFormData(a),a.blob?d.push({name:e,value:a.blob}):c.each(a.files,function(b,f){d.push({name:"array"===c.type(a.paramName)&&a.paramName[b]||e,value:f})})):(b._isInstanceOf("FormData",
a.formData)?d=a.formData:(d=new FormData,c.each(this._getFormData(a),function(a,b){d.append(b.name,b.value)})),a.blob?d.append(e,a.blob,g.name):c.each(a.files,function(f,g){(b._isInstanceOf("File",g)||b._isInstanceOf("Blob",g))&&d.append("array"===c.type(a.paramName)&&a.paramName[f]||e,g,g.uploadName||g.name)})),a.data=d):(a.contentType=g.type||"application/octet-stream",a.data=a.blob||g);a.blob=null},_initIframeSettings:function(a){var b=c("<a></a>").prop("href",a.url).prop("host");a.dataType="iframe "+
(a.dataType||"");a.formData=this._getFormData(a);a.redirect&&b&&b!==location.host&&a.formData.push({name:a.redirectParamName||"redirect",value:a.redirect})},_initDataSettings:function(a){this._isXHRUpload(a)?(this._chunkedUpload(a,!0)||(a.data||this._initXHRData(a),this._initProgressListener(a)),a.postMessage&&(a.dataType="postmessage "+(a.dataType||""))):this._initIframeSettings(a)},_getParamName:function(a){var b=c(a.fileInput),d=a.paramName;d?c.isArray(d)||(d=[d]):(d=[],b.each(function(){for(var a=
c(this),b=a.prop("name")||"files[]",a=(a.prop("files")||[1]).length;a;)d.push(b),--a}),d.length||(d=[b.prop("name")||"files[]"]));return d},_initFormSettings:function(a){a.form&&a.form.length||(a.form=c(a.fileInput.prop("form")),a.form.length||(a.form=c(this.options.fileInput.prop("form"))));a.paramName=this._getParamName(a);a.url||(a.url=a.form.prop("action")||location.href);a.type=(a.type||"string"===c.type(a.form.prop("method"))&&a.form.prop("method")||"").toUpperCase();"POST"!==a.type&&"PUT"!==
a.type&&"PATCH"!==a.type&&(a.type="POST");a.formAcceptCharset||(a.formAcceptCharset=a.form.attr("accept-charset"))},_getAJAXSettings:function(a){a=c.extend({},this.options,a);this._initFormSettings(a);this._initDataSettings(a);return a},_getDeferredState:function(a){return a.state?a.state():a.isResolved()?"resolved":a.isRejected()?"rejected":"pending"},_enhancePromise:function(a){a.success=a.done;a.error=a.fail;a.complete=a.always;return a},_getXHRPromise:function(a,b,d){var g=c.Deferred(),f=g.promise();
b=b||this.options.context||f;!0===a?g.resolveWith(b,d):!1===a&&g.rejectWith(b,d);f.abort=g.promise;return this._enhancePromise(f)},_addConvenienceMethods:function(a,b){var d=this,g=function(a){return c.Deferred().resolveWith(d,a).promise()};b.process=function(a,e){if(a||e)b._processQueue=this._processQueue=(this._processQueue||g([this])).then(function(){return b.errorThrown?c.Deferred().rejectWith(d,[b]).promise():g(arguments)}).then(a,e);return this._processQueue||g([this])};b.submit=function(){"pending"!==
this.state()&&(b.jqXHR=this.jqXHR=!1!==d._trigger("submit",c.Event("submit",{delegatedEvent:a}),this)&&d._onSend(a,this));return this.jqXHR||d._getXHRPromise()};b.abort=function(){if(this.jqXHR)return this.jqXHR.abort();this.errorThrown="abort";d._trigger("fail",null,this);return d._getXHRPromise(!1)};b.state=function(){if(this.jqXHR)return d._getDeferredState(this.jqXHR);if(this._processQueue)return d._getDeferredState(this._processQueue)};b.processing=function(){return!this.jqXHR&&this._processQueue&&
"pending"===d._getDeferredState(this._processQueue)};b.progress=function(){return this._progress};b.response=function(){return this._response}},_getUploadedBytes:function(a){return(a=(a=(a=a.getResponseHeader("Range"))&&a.split("-"))&&1<a.length&&parseInt(a[1],10))&&a+1},_chunkedUpload:function(a,b){a.uploadedBytes=a.uploadedBytes||0;var d=this,g=a.files[0],f=g.size,e=a.uploadedBytes,h=a.maxChunkSize||f,l=this._blobSlice,p=c.Deferred(),n=p.promise(),m,q;if(!(this._isXHRUpload(a)&&l&&(e||h<f))||a.data)return!1;
if(b)return!0;if(e>=f)return g.error=a.i18n("uploadedBytes"),this._getXHRPromise(!1,a.context,[null,"error",g.error]);q=function(){var b=c.extend({},a),n=b._progress.loaded;b.blob=l.call(g,e,e+h,g.type);b.chunkSize=b.blob.size;b.contentRange="bytes "+e+"-"+(e+b.chunkSize-1)+"/"+f;d._initXHRData(b);d._initProgressListener(b);m=(!1!==d._trigger("chunksend",null,b)&&c.ajax(b)||d._getXHRPromise(!1,b.context)).done(function(g,h,l){e=d._getUploadedBytes(l)||e+b.chunkSize;n+b.chunkSize-b._progress.loaded&&
d._onProgress(c.Event("progress",{lengthComputable:!0,loaded:e-b.uploadedBytes,total:e-b.uploadedBytes}),b);a.uploadedBytes=b.uploadedBytes=e;b.result=g;b.textStatus=h;b.jqXHR=l;d._trigger("chunkdone",null,b);d._trigger("chunkalways",null,b);e<f?q():p.resolveWith(b.context,[g,h,l])}).fail(function(a,c,f){b.jqXHR=a;b.textStatus=c;b.errorThrown=f;d._trigger("chunkfail",null,b);d._trigger("chunkalways",null,b);p.rejectWith(b.context,[a,c,f])})};this._enhancePromise(n);n.abort=function(){return m.abort()};
q();return n},_beforeSend:function(a,b){0===this._active&&(this._trigger("start"),this._bitrateTimer=new this._BitrateTimer,this._progress.loaded=this._progress.total=0,this._progress.bitrate=0);this._initResponseObject(b);this._initProgressObject(b);b._progress.loaded=b.loaded=b.uploadedBytes||0;b._progress.total=b.total=this._getTotal(b.files)||1;b._progress.bitrate=b.bitrate=0;this._active+=1;this._progress.loaded+=b.loaded;this._progress.total+=b.total},_onDone:function(a,b,d,g){var f=g._progress.total,
e=g._response;g._progress.loaded<f&&this._onProgress(c.Event("progress",{lengthComputable:!0,loaded:f,total:f}),g);e.result=g.result=a;e.textStatus=g.textStatus=b;e.jqXHR=g.jqXHR=d;this._trigger("done",null,g)},_onFail:function(a,b,c,g){var f=g._response;g.recalculateProgress&&(this._progress.loaded-=g._progress.loaded,this._progress.total-=g._progress.total);f.jqXHR=g.jqXHR=a;f.textStatus=g.textStatus=b;f.errorThrown=g.errorThrown=c;this._trigger("fail",null,g)},_onAlways:function(a,b,c,g){this._trigger("always",
null,g)},_onSend:function(a,b){b.submit||this._addConvenienceMethods(a,b);var d=this,g,f,e,h,l=d._getAJAXSettings(b),p=function(){d._sending+=1;l._bitrateTimer=new d._BitrateTimer;return g=g||((f||!1===d._trigger("send",c.Event("send",{delegatedEvent:a}),l))&&d._getXHRPromise(!1,l.context,f)||d._chunkedUpload(l)||c.ajax(l)).done(function(a,b,c){d._onDone(a,b,c,l)}).fail(function(a,b,c){d._onFail(a,b,c,l)}).always(function(a,b,c){d._onAlways(a,b,c,l);--d._sending;--d._active;if(l.limitConcurrentUploads&&
l.limitConcurrentUploads>d._sending)for(a=d._slots.shift();a;){if("pending"===d._getDeferredState(a)){a.resolve();break}a=d._slots.shift()}0===d._active&&d._trigger("stop")})};this._beforeSend(a,l);return this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(1<this.options.limitConcurrentUploads?(e=c.Deferred(),this._slots.push(e),h=e.then(p)):h=this._sequence=this._sequence.then(p,p),h.abort=function(){f=[void 0,"abort","abort"];
return g?g.abort():(e&&e.rejectWith(l.context,f),p())},this._enhancePromise(h)):p()},_onAdd:function(a,b){var d=this,g=!0,f=c.extend({},this.options,b),e=b.files,h=e.length,l=f.limitMultiFileUploads,p=f.limitMultiFileUploadSize,n=f.limitMultiFileUploadSizeOverhead,m=0,q=this._getParamName(f),u,w,x=0;if(!h)return!1;p&&void 0===e[0].size&&(p=void 0);if((f.singleFileUploads||l||p)&&this._isXHRUpload(f))if(f.singleFileUploads||p||!l)if(!f.singleFileUploads&&p)for(w=[],u=[],f=0;f<h;f+=1){if(m+=e[f].size+
n,f+1===h||m+e[f+1].size+n>p||l&&f+1-x>=l)w.push(e.slice(x,f+1)),m=q.slice(x,f+1),m.length||(m=q),u.push(m),x=f+1,m=0}else u=q;else for(w=[],u=[],f=0;f<h;f+=l)w.push(e.slice(f,f+l)),m=q.slice(f,f+l),m.length||(m=q),u.push(m);else w=[e],u=[q];b.originalFiles=e;c.each(w||e,function(f,e){var h=c.extend({},b);h.files=w?e:[e];h.paramName=u[f];d._initResponseObject(h);d._initProgressObject(h);d._addConvenienceMethods(a,h);return g=d._trigger("add",c.Event("add",{delegatedEvent:a}),h)});return g},_replaceFileInput:function(a){var b=
a.fileInput,d=b.clone(!0),g=b.is(document.activeElement);a.fileInputClone=d;c("<form></form>").append(d)[0].reset();b.after(d).detach();g&&d.focus();c.cleanData(b.unbind("remove"));this.options.fileInput=this.options.fileInput.map(function(a,c){return c===b[0]?d[0]:c});b[0]===this.element[0]&&(this.element=d)},_handleFileTreeEntry:function(a,b){var d=this,g=c.Deferred(),f=function(b){b&&!b.entry&&(b.entry=a);g.resolve([b])},e=function(c){d._handleFileTreeEntries(c,b+a.name+"/").done(function(a){g.resolve(a)}).fail(f)},
h=function(){l.readEntries(function(a){a.length?(p=p.concat(a),h()):e(p)},f)},l,p=[];b=b||"";a.isFile?a._file?(a._file.relativePath=b,g.resolve(a._file)):a.file(function(a){a.relativePath=b;g.resolve(a)},f):a.isDirectory?(l=a.createReader(),h()):g.resolve([]);return g.promise()},_handleFileTreeEntries:function(a,b){var d=this;return c.when.apply(c,c.map(a,function(a){return d._handleFileTreeEntry(a,b)})).then(function(){return Array.prototype.concat.apply([],arguments)})},_getDroppedFiles:function(a){a=
a||{};var b=a.items;return b&&b.length&&(b[0].webkitGetAsEntry||b[0].getAsEntry)?this._handleFileTreeEntries(c.map(b,function(a){var b;if(a.webkitGetAsEntry){if(b=a.webkitGetAsEntry())b._file=a.getAsFile();return b}return a.getAsEntry()})):c.Deferred().resolve(c.makeArray(a.files)).promise()},_getSingleFileInputFiles:function(a){a=c(a);var b=a.prop("webkitEntries")||a.prop("entries");if(b&&b.length)return this._handleFileTreeEntries(b);b=c.makeArray(a.prop("files"));if(b.length)void 0===b[0].name&&
b[0].fileName&&c.each(b,function(a,b){b.name=b.fileName;b.size=b.fileSize});else{a=a.prop("value");if(!a)return c.Deferred().resolve([]).promise();b=[{name:a.replace(/^.*\\/,"")}]}return c.Deferred().resolve(b).promise()},_getFileInputFiles:function(a){return a instanceof c&&1!==a.length?c.when.apply(c,c.map(a,this._getSingleFileInputFiles)).then(function(){return Array.prototype.concat.apply([],arguments)}):this._getSingleFileInputFiles(a)},_onChange:function(a){var b=this,d={fileInput:c(a.target),
form:c(a.target.form)};this._getFileInputFiles(d.fileInput).always(function(e){d.files=e;b.options.replaceFileInput&&b._replaceFileInput(d);!1!==b._trigger("change",c.Event("change",{delegatedEvent:a}),d)&&b._onAdd(a,d)})},_onPaste:function(a){var b=a.originalEvent&&a.originalEvent.clipboardData&&a.originalEvent.clipboardData.items,d={files:[]};b&&b.length&&(c.each(b,function(a,b){var c=b.getAsFile&&b.getAsFile();c&&d.files.push(c)}),!1!==this._trigger("paste",c.Event("paste",{delegatedEvent:a}),
d)&&this._onAdd(a,d))},_onDrop:function(a){a.dataTransfer=a.originalEvent&&a.originalEvent.dataTransfer;var b=this,d=a.dataTransfer,e={};d&&d.files&&d.files.length&&(a.preventDefault(),this._getDroppedFiles(d).always(function(d){e.files=d;!1!==b._trigger("drop",c.Event("drop",{delegatedEvent:a}),e)&&b._onAdd(a,e)}))},_onDragOver:e("dragover"),_onDragEnter:e("dragenter"),_onDragLeave:e("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,
drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste}));c.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop");this._off(this.options.pasteZone,"paste");this._off(this.options.fileInput,"change")},_setOption:function(a,b){var d=-1!==c.inArray(a,this._specialOptions);d&&this._destroyEventHandlers();
this._super(a,b);d&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var a=this.options;void 0===a.fileInput?a.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):a.fileInput instanceof c||(a.fileInput=c(a.fileInput));a.dropZone instanceof c||(a.dropZone=c(a.dropZone));a.pasteZone instanceof c||(a.pasteZone=c(a.pasteZone))},_getRegExp:function(a){a=a.split("/");var b=a.pop();a.shift();return new RegExp(a.join("/"),
b)},_isRegExpOption:function(a,b){return"url"!==a&&"string"===c.type(b)&&/^\/.*\/[igm]{0,3}$/.test(b)},_initDataAttributes:function(){var a=this,b=this.options,d=this.element.data();c.each(this.element[0].attributes,function(c,f){var e=f.name.toLowerCase(),h;/^data-/.test(e)&&(e=e.slice(5).replace(/-[a-z]/g,function(a){return a.charAt(1).toUpperCase()}),h=d[e],a._isRegExpOption(e,h)&&(h=a._getRegExp(h)),b[e]=h)})},_create:function(){this._initDataAttributes();this._initSpecialOptions();this._slots=
[];this._sequence=this._getXHRPromise(!0);this._sending=this._active=0;this._initProgressObject(this);this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(a){var b=this;a&&!this.options.disabled&&(a.fileInput&&!a.files?this._getFileInputFiles(a.fileInput).always(function(c){a.files=c;b._onAdd(null,a)}):(a.files=c.makeArray(a.files),this._onAdd(null,a)))},send:function(a){if(a&&!this.options.disabled){if(a.fileInput&&!a.files){var b=
this,d=c.Deferred(),e=d.promise(),f,k;e.abort=function(){k=!0;if(f)return f.abort();d.reject(null,"abort","abort");return e};this._getFileInputFiles(a.fileInput).always(function(c){k||(c.length?(a.files=c,f=b._onSend(null,a),f.then(function(a,b,c){d.resolve(a,b,c)},function(a,b,c){d.reject(a,b,c)})):d.reject())});return this._enhancePromise(e)}a.files=c.makeArray(a.files);if(a.files.length)return this._onSend(null,a)}return this._getXHRPromise(!1,a&&a.context)}})});
(function(c){"function"===typeof define&&define.amd?define(["jquery","./jquery.fileupload"],c):"object"===typeof exports?c(require("jquery")):c(window.jQuery)})(function(c){var e=c.blueimp.fileupload.prototype.options.add;c.widget("blueimp.fileupload",c.blueimp.fileupload,{options:{processQueue:[],add:function(a,b){var d=c(this);b.process(function(){return d.fileupload("process",b)});e.call(this,a,b)}},processActions:{},_processFile:function(a,b){var d=this,e=c.Deferred().resolveWith(d,[a]).promise();
this._trigger("process",null,a);c.each(a.processQueue,function(a,k){var h=function(a){return b.errorThrown?c.Deferred().rejectWith(d,[b]).promise():d.processActions[k.action].call(d,a,k)};e=e.then(h,k.always&&h)});e.done(function(){d._trigger("processdone",null,a);d._trigger("processalways",null,a)}).fail(function(){d._trigger("processfail",null,a);d._trigger("processalways",null,a)});return e},_transformProcessQueue:function(a){var b=[];c.each(a.processQueue,function(){var d={},e=this.action,f=!0===
this.prefix?e:this.prefix;c.each(this,function(b,e){"string"===c.type(e)&&"@"===e.charAt(0)?d[b]=a[e.slice(1)||(f?f+b.charAt(0).toUpperCase()+b.slice(1):b)]:d[b]=e});b.push(d)});a.processQueue=b},processing:function(){return this._processing},process:function(a){var b=this,d=c.extend({},this.options,a);d.processQueue&&d.processQueue.length&&(this._transformProcessQueue(d),0===this._processing&&this._trigger("processstart"),c.each(a.files,function(e){var f=e?c.extend({},d):d,k=function(){return a.errorThrown?
c.Deferred().rejectWith(b,[a]).promise():b._processFile(f,a)};f.index=e;b._processing+=1;b._processingQueue=b._processingQueue.then(k,k).always(function(){--b._processing;0===b._processing&&b._trigger("processstop")})}));return this._processingQueue},_create:function(){this._super();this._processing=0;this._processingQueue=c.Deferred().resolveWith(this).promise()}})});
(function(c){"function"===typeof define&&define.amd?define("jquery load-image load-image-meta load-image-exif canvas-to-blob ./jquery.fileupload-process".split(" "),c):"object"===typeof exports?c(require("jquery"),require("blueimp-load-image/js/load-image"),require("blueimp-load-image/js/load-image-meta"),require("blueimp-load-image/js/load-image-exif"),require("blueimp-canvas-to-blob"),require("./jquery.fileupload-process")):c(window.jQuery,window.loadImage)})(function(c,e){c.blueimp.fileupload.prototype.options.processQueue.unshift({action:"loadImageMetaData",
disableImageHead:"@",disableExif:"@",disableExifThumbnail:"@",disableExifSub:"@",disableExifGps:"@",disabled:"@disableImageMetaDataLoad"},{action:"loadImage",prefix:!0,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"});c.widget("blueimp.fileupload",c.blueimp.fileupload,{options:{loadImageFileTypes:/^image\/(gif|jpeg|png|svg\+xml)$/,loadImageMaxFileSize:1E7,
imageMaxWidth:1920,imageMaxHeight:1080,imageOrientation:!1,imageCrop:!1,disableImageResize:!0,previewMaxWidth:80,previewMaxHeight:80,previewOrientation:!0,previewThumbnail:!0,previewCrop:!1,previewCanvas:!0},processActions:{loadImage:function(a,b){if(b.disabled)return a;var d=this,g=a.files[a.index],f=c.Deferred();return"number"===c.type(b.maxFileSize)&&g.size>b.maxFileSize||b.fileTypes&&!b.fileTypes.test(g.type)||!e(g,function(b){b.src&&(a.img=b);f.resolveWith(d,[a])},b)?a:f.promise()},resizeImage:function(a,
b){if(b.disabled||!a.canvas&&!a.img)return a;b=c.extend({canvas:!0},b);var d=this,g=c.Deferred(),f=b.canvas&&a.canvas||a.img,k=function(c){c&&(c.width!==f.width||c.height!==f.height||b.forceResize)&&(a[c.getContext?"canvas":"img"]=c);a.preview=c;g.resolveWith(d,[a])},h;if(a.exif){!0===b.orientation&&(b.orientation=a.exif.get("Orientation"));if(b.thumbnail&&(h=a.exif.get("Thumbnail")))return e(h,k,b),g.promise();a.orientation?delete b.orientation:a.orientation=b.orientation}return f?(k(e.scale(f,b)),
g.promise()):a},saveImage:function(a,b){if(!a.canvas||b.disabled)return a;var d=this,e=a.files[a.index],f=c.Deferred();if(a.canvas.toBlob)a.canvas.toBlob(function(b){b.name||(e.type===b.type?b.name=e.name:e.name&&(b.name=e.name.replace(/\.\w+$/,"."+b.type.substr(6))));e.type!==b.type&&delete a.imageHead;a.files[a.index]=b;f.resolveWith(d,[a])},b.type||e.type,b.quality);else return a;return f.promise()},loadImageMetaData:function(a,b){if(b.disabled)return a;var d=this,g=c.Deferred();e.parseMetaData(a.files[a.index],
function(b){c.extend(a,b);g.resolveWith(d,[a])},b);return g.promise()},saveImageMetaData:function(a,b){if(!(a.imageHead&&a.canvas&&a.canvas.toBlob)||b.disabled)return a;var c=a.files[a.index],e=new Blob([a.imageHead,this._blobSlice.call(c,20)],{type:c.type});e.name=c.name;a.files[a.index]=e;return a},setImage:function(a,b){a.preview&&!b.disabled&&(a.files[a.index][b.name||"preview"]=a.preview);return a},deleteImageReferences:function(a,b){b.disabled||(delete a.img,delete a.canvas,delete a.preview,
delete a.imageHead);return a}}})});
(function(c){"function"===typeof define&&define.amd?define(["jquery","load-image","./jquery.fileupload-process"],c):"object"===typeof exports?c(require("jquery"),require("load-image")):c(window.jQuery,window.loadImage)})(function(c,e){c.blueimp.fileupload.prototype.options.processQueue.unshift({action:"loadAudio",prefix:!0,fileTypes:"@",maxFileSize:"@",disabled:"@disableAudioPreview"},{action:"setAudio",name:"@audioPreviewName",disabled:"@disableAudioPreview"});c.widget("blueimp.fileupload",c.blueimp.fileupload,
{options:{loadAudioFileTypes:/^audio\/.*$/},_audioElement:document.createElement("audio"),processActions:{loadAudio:function(a,b){if(b.disabled)return a;var d=a.files[a.index],g;this._audioElement.canPlayType&&this._audioElement.canPlayType(d.type)&&("number"!==c.type(b.maxFileSize)||d.size<=b.maxFileSize)&&(!b.fileTypes||b.fileTypes.test(d.type))&&(d=e.createObjectURL(d))&&(g=this._audioElement.cloneNode(!1),g.src=d,g.controls=!0,a.audio=g);return a},setAudio:function(a,b){a.audio&&!b.disabled&&
(a.files[a.index][b.name||"preview"]=a.audio);return a}}})});
(function(c){"function"===typeof define&&define.amd?define(["jquery","load-image","./jquery.fileupload-process"],c):"object"===typeof exports?c(require("jquery"),require("load-image")):c(window.jQuery,window.loadImage)})(function(c,e){c.blueimp.fileupload.prototype.options.processQueue.unshift({action:"loadVideo",prefix:!0,fileTypes:"@",maxFileSize:"@",disabled:"@disableVideoPreview"},{action:"setVideo",name:"@videoPreviewName",disabled:"@disableVideoPreview"});c.widget("blueimp.fileupload",c.blueimp.fileupload,
{options:{loadVideoFileTypes:/^video\/.*$/},_videoElement:document.createElement("video"),processActions:{loadVideo:function(a,b){if(b.disabled)return a;var d=a.files[a.index],g;this._videoElement.canPlayType&&this._videoElement.canPlayType(d.type)&&("number"!==c.type(b.maxFileSize)||d.size<=b.maxFileSize)&&(!b.fileTypes||b.fileTypes.test(d.type))&&(d=e.createObjectURL(d))&&(g=this._videoElement.cloneNode(!1),g.src=d,g.controls=!0,a.video=g);return a},setVideo:function(a,b){a.video&&!b.disabled&&
(a.files[a.index][b.name||"preview"]=a.video);return a}}})});
(function(c){"function"===typeof define&&define.amd?define(["jquery","./jquery.fileupload-process"],c):"object"===typeof exports?c(require("jquery")):c(window.jQuery)})(function(c){c.blueimp.fileupload.prototype.options.processQueue.push({action:"validate",always:!0,acceptFileTypes:"@",maxFileSize:"@",minFileSize:"@",maxNumberOfFiles:"@",disabled:"@disableValidation"});c.widget("blueimp.fileupload",c.blueimp.fileupload,{options:{getNumberOfFiles:c.noop,messages:{maxNumberOfFiles:"Maximum number of files exceeded",
acceptFileTypes:"File type not allowed",maxFileSize:"File is too large",minFileSize:"File is too small"}},processActions:{validate:function(e,a){if(a.disabled)return e;var b=c.Deferred(),d=this.options,g=e.files[e.index],f;if(a.minFileSize||a.maxFileSize)f=g.size;"number"===c.type(a.maxNumberOfFiles)&&(d.getNumberOfFiles()||0)+e.files.length>a.maxNumberOfFiles?g.error=d.i18n("maxNumberOfFiles"):!a.acceptFileTypes||a.acceptFileTypes.test(g.type)||a.acceptFileTypes.test(g.name)?f>a.maxFileSize?g.error=
d.i18n("maxFileSize"):"number"===c.type(f)&&f<a.minFileSize?g.error=d.i18n("minFileSize"):delete g.error:g.error=d.i18n("acceptFileTypes");g.error||e.files.error?(e.files.error=!0,b.rejectWith(this,[e])):b.resolveWith(this,[e]);return b.promise()}}})});
(function(c){"function"===typeof define&&define.amd?define("jquery tmpl ./jquery.fileupload-image ./jquery.fileupload-audio ./jquery.fileupload-video ./jquery.fileupload-validate".split(" "),c):"object"===typeof exports?c(require("jquery"),require("tmpl")):c(window.jQuery,window.tmpl)})(function(c,e){c.blueimp.fileupload.prototype._specialOptions.push("filesContainer","uploadTemplateId","downloadTemplateId");c.widget("blueimp.fileupload",c.blueimp.fileupload,{options:{autoUpload:!1,uploadTemplateId:"template-upload",
downloadTemplateId:"template-download",filesContainer:void 0,prependFiles:!1,dataType:"json",messages:{unknownError:"Unknown error"},getNumberOfFiles:function(){return this.filesContainer.children().not(".processing").length},getFilesFromResponse:function(a){return a.result&&c.isArray(a.result.files)?a.result.files:[]},add:function(a,b){if(a.isDefaultPrevented())return!1;var d=c(this),e=d.data("blueimp-fileupload")||d.data("fileupload"),f=e.options;b.context=e._renderUpload(b.files).data("data",b).addClass("processing");
f.filesContainer[f.prependFiles?"prepend":"append"](b.context);e._forceReflow(b.context);e._transition(b.context);b.process(function(){return d.fileupload("process",b)}).always(function(){b.context.each(function(a){c(this).find(".size").text(e._formatFileSize(b.files[a].size))}).removeClass("processing");e._renderPreviews(b)}).done(function(){b.context.find(".start").prop("disabled",!1);!1!==e._trigger("added",a,b)&&(f.autoUpload||b.autoUpload)&&!1!==b.autoUpload&&b.submit()}).fail(function(){b.files.error&&
b.context.each(function(a){(a=b.files[a].error)&&c(this).find(".error").text(a)})})},send:function(a,b){if(a.isDefaultPrevented())return!1;var d=c(this).data("blueimp-fileupload")||c(this).data("fileupload");b.context&&b.dataType&&"iframe"===b.dataType.substr(0,6)&&b.context.find(".progress").addClass(!c.support.transition&&"progress-animated").attr("aria-valuenow",100).children().first().css("width","100%");return d._trigger("sent",a,b)},done:function(a,b){if(a.isDefaultPrevented())return!1;var d=
c(this).data("blueimp-fileupload")||c(this).data("fileupload"),e=(b.getFilesFromResponse||d.options.getFilesFromResponse)(b),f,k;b.context?b.context.each(function(h){var l=e[h]||{error:"Empty file upload result"};k=d._addFinishedDeferreds();d._transition(c(this)).done(function(){var e=c(this);f=d._renderDownload([l]).replaceAll(e);d._forceReflow(f);d._transition(f).done(function(){b.context=c(this);d._trigger("completed",a,b);d._trigger("finished",a,b);k.resolve()})})}):(f=d._renderDownload(e)[d.options.prependFiles?
"prependTo":"appendTo"](d.options.filesContainer),d._forceReflow(f),k=d._addFinishedDeferreds(),d._transition(f).done(function(){b.context=c(this);d._trigger("completed",a,b);d._trigger("finished",a,b);k.resolve()}))},fail:function(a,b){if(a.isDefaultPrevented())return!1;var d=c(this).data("blueimp-fileupload")||c(this).data("fileupload"),e,f;b.context?b.context.each(function(k){if("abort"!==b.errorThrown){var h=b.files[k];h.error=h.error||b.errorThrown||b.i18n("unknownError");f=d._addFinishedDeferreds();
d._transition(c(this)).done(function(){var k=c(this);e=d._renderDownload([h]).replaceAll(k);d._forceReflow(e);d._transition(e).done(function(){b.context=c(this);d._trigger("failed",a,b);d._trigger("finished",a,b);f.resolve()})})}else f=d._addFinishedDeferreds(),d._transition(c(this)).done(function(){c(this).remove();d._trigger("failed",a,b);d._trigger("finished",a,b);f.resolve()})}):"abort"!==b.errorThrown?(b.context=d._renderUpload(b.files)[d.options.prependFiles?"prependTo":"appendTo"](d.options.filesContainer).data("data",
b),d._forceReflow(b.context),f=d._addFinishedDeferreds(),d._transition(b.context).done(function(){b.context=c(this);d._trigger("failed",a,b);d._trigger("finished",a,b);f.resolve()})):(d._trigger("failed",a,b),d._trigger("finished",a,b),d._addFinishedDeferreds().resolve())},progress:function(a,b){if(a.isDefaultPrevented())return!1;var d=Math.floor(b.loaded/b.total*100);b.context&&b.context.each(function(){c(this).find(".progress").attr("aria-valuenow",d).children().first().css("width",d+"%")})},progressall:function(a,
b){if(a.isDefaultPrevented())return!1;var d=c(this),e=Math.floor(b.loaded/b.total*100),f=d.find(".fileupload-progress"),k=f.find(".progress-extended");k.length&&k.html((d.data("blueimp-fileupload")||d.data("fileupload"))._renderExtendedProgress(b));f.find(".progress").attr("aria-valuenow",e).children().first().css("width",e+"%")},start:function(a){if(a.isDefaultPrevented())return!1;var b=c(this).data("blueimp-fileupload")||c(this).data("fileupload");b._resetFinishedDeferreds();b._transition(c(this).find(".fileupload-progress")).done(function(){b._trigger("started",
a)})},stop:function(a){if(a.isDefaultPrevented())return!1;var b=c(this).data("blueimp-fileupload")||c(this).data("fileupload"),d=b._addFinishedDeferreds();c.when.apply(c,b._getFinishedDeferreds()).done(function(){b._trigger("stopped",a)});b._transition(c(this).find(".fileupload-progress")).done(function(){c(this).find(".progress").attr("aria-valuenow","0").children().first().css("width","0%");c(this).find(".progress-extended").html("&nbsp;");d.resolve()})},processstart:function(a){if(a.isDefaultPrevented())return!1;
c(this).addClass("fileupload-processing")},processstop:function(a){if(a.isDefaultPrevented())return!1;c(this).removeClass("fileupload-processing")},destroy:function(a,b){if(a.isDefaultPrevented())return!1;var d=c(this).data("blueimp-fileupload")||c(this).data("fileupload"),e=function(){d._transition(b.context).done(function(){c(this).remove();d._trigger("destroyed",a,b)})};b.url?(b.dataType=b.dataType||d.options.dataType,c.ajax(b).done(e).fail(function(){d._trigger("destroyfailed",a,b)})):e()}},_resetFinishedDeferreds:function(){this._finishedUploads=
[]},_addFinishedDeferreds:function(a){a||(a=c.Deferred());this._finishedUploads.push(a);return a},_getFinishedDeferreds:function(){return this._finishedUploads},_enableDragToDesktop:function(){var a=c(this),b=a.prop("href"),d=a.prop("download");a.bind("dragstart",function(a){try{a.originalEvent.dataTransfer.setData("DownloadURL",["application/octet-stream",d,b].join(":"))}catch(c){}})},_formatFileSize:function(a){return"number"!==typeof a?"":1E9<=a?(a/1E9).toFixed(2)+" GB":1E6<=a?(a/1E6).toFixed(2)+
" MB":(a/1E3).toFixed(2)+" KB"},_formatBitrate:function(a){return"number"!==typeof a?"":1E9<=a?(a/1E9).toFixed(2)+" Gbit/s":1E6<=a?(a/1E6).toFixed(2)+" Mbit/s":1E3<=a?(a/1E3).toFixed(2)+" kbit/s":a.toFixed(2)+" bit/s"},_formatTime:function(a){var b=new Date(1E3*a);a=Math.floor(a/86400);return(a?a+"d ":"")+("0"+b.getUTCHours()).slice(-2)+":"+("0"+b.getUTCMinutes()).slice(-2)+":"+("0"+b.getUTCSeconds()).slice(-2)},_formatPercentage:function(a){return(100*a).toFixed(2)+" %"},_renderExtendedProgress:function(a){return this._formatBitrate(a.bitrate)+
" | "+this._formatTime(8*(a.total-a.loaded)/a.bitrate)+" | "+this._formatPercentage(a.loaded/a.total)+" | "+this._formatFileSize(a.loaded)+" / "+this._formatFileSize(a.total)},_renderTemplate:function(a,b){if(!a)return c();var d=a({files:b,formatFileSize:this._formatFileSize,options:this.options});return d instanceof c?d:c(this.options.templatesContainer).html(d).children()},_renderPreviews:function(a){a.context.find(".preview").each(function(b,d){c(d).append(a.files[b].preview)})},_renderUpload:function(a){return this._renderTemplate(this.options.uploadTemplate,
a)},_renderDownload:function(a){return this._renderTemplate(this.options.downloadTemplate,a).find("a[download]").each(this._enableDragToDesktop).end()},_startHandler:function(a){a.preventDefault();a=c(a.currentTarget);var b=a.closest(".template-upload").data("data");a.prop("disabled",!0);b&&b.submit&&b.submit()},_cancelHandler:function(a){a.preventDefault();var b=c(a.currentTarget).closest(".template-upload,.template-download"),d=b.data("data")||{};d.context=d.context||b;d.abort?d.abort():(d.errorThrown=
"abort",this._trigger("fail",a,d))},_deleteHandler:function(a){a.preventDefault();var b=c(a.currentTarget);this._trigger("destroy",a,c.extend({context:b.closest(".template-download"),type:"DELETE"},b.data()))},_forceReflow:function(a){return c.support.transition&&a.length&&a[0].offsetWidth},_transition:function(a){var b=c.Deferred();c.support.transition&&a.hasClass("fade")&&a.is(":visible")?a.bind(c.support.transition.end,function(d){d.target===a[0]&&(a.unbind(c.support.transition.end),b.resolveWith(a))}).toggleClass("in"):
(a.toggleClass("in"),b.resolveWith(a));return b},_initButtonBarEventHandlers:function(){var a=this.element.find(".fileupload-buttonbar"),b=this.options.filesContainer;this._on(a.find(".start"),{click:function(a){a.preventDefault();b.find(".start").click()}});this._on(a.find(".cancel"),{click:function(a){a.preventDefault();b.find(".cancel").click()}});this._on(a.find(".delete"),{click:function(c){c.preventDefault();b.find(".toggle:checked").closest(".template-download").find(".delete").click();a.find(".toggle").prop("checked",
!1)}});this._on(a.find(".toggle"),{change:function(a){b.find(".toggle").prop("checked",c(a.currentTarget).is(":checked"))}})},_destroyButtonBarEventHandlers:function(){this._off(this.element.find(".fileupload-buttonbar").find(".start, .cancel, .delete"),"click");this._off(this.element.find(".fileupload-buttonbar .toggle"),"change.")},_initEventHandlers:function(){this._super();this._on(this.options.filesContainer,{"click .start":this._startHandler,"click .cancel":this._cancelHandler,"click .delete":this._deleteHandler});
this._initButtonBarEventHandlers()},_destroyEventHandlers:function(){this._destroyButtonBarEventHandlers();this._off(this.options.filesContainer,"click");this._super()},_enableFileInputButton:function(){this.element.find(".fileinput-button input").prop("disabled",!1).parent().removeClass("disabled")},_disableFileInputButton:function(){this.element.find(".fileinput-button input").prop("disabled",!0).parent().addClass("disabled")},_initTemplates:function(){var a=this.options;a.templatesContainer=this.document[0].createElement(a.filesContainer.prop("nodeName"));
e&&(a.uploadTemplateId&&(a.uploadTemplate=e(a.uploadTemplateId)),a.downloadTemplateId&&(a.downloadTemplate=e(a.downloadTemplateId)))},_initFilesContainer:function(){var a=this.options;void 0===a.filesContainer?a.filesContainer=this.element.find(".files"):a.filesContainer instanceof c||(a.filesContainer=c(a.filesContainer))},_initSpecialOptions:function(){this._super();this._initFilesContainer();this._initTemplates()},_create:function(){this._super();this._resetFinishedDeferreds();c.support.fileInput||
this._disableFileInputButton()},enable:function(){var a=!1;this.options.disabled&&(a=!0);this._super();a&&(this.element.find("input, button").prop("disabled",!1),this._enableFileInputButton())},disable:function(){this.options.disabled||(this.element.find("input, button").prop("disabled",!0),this._disableFileInputButton());this._super()}})});
(function(c){"function"===typeof define&&define.amd?define(["jquery","./jquery.fileupload-ui"],c):"object"===typeof exports?c(require("jquery")):c(window.jQuery)})(function(c){c.widget("blueimp.fileupload",c.blueimp.fileupload,{options:{processdone:function(c,a){a.context.find(".start").button("enable")},progress:function(c,a){a.context&&a.context.find(".progress").progressbar("option","value",parseInt(a.loaded/a.total*100,10))},progressall:function(e,a){var b=c(this);b.find(".fileupload-progress").find(".progress").progressbar("option",
"value",parseInt(a.loaded/a.total*100,10)).end().find(".progress-extended").each(function(){c(this).html((b.data("blueimp-fileupload")||b.data("fileupload"))._renderExtendedProgress(a))})}},_renderUpload:function(e,a){var b=this._super(e,a),d=480<c(window).width();b.find(".progress").empty().progressbar();b.find(".start").button({icons:{primary:"ui-icon-circle-arrow-e"},text:d});b.find(".cancel").button({icons:{primary:"ui-icon-cancel"},text:d});b.hasClass("fade")&&b.hide();return b},_renderDownload:function(e,
a){var b=this._super(e,a),d=480<c(window).width();b.find(".delete").button({icons:{primary:"ui-icon-trash"},text:d});b.hasClass("fade")&&b.hide();return b},_startHandler:function(e){c(e.currentTarget).button("disable");this._super(e)},_transition:function(e){var a=c.Deferred();e.hasClass("fade")?e.fadeToggle(this.options.transitionDuration,this.options.transitionEasing,function(){a.resolveWith(e)}):a.resolveWith(e);return a},_create:function(){this._super();this.element.find(".fileupload-buttonbar").find(".fileinput-button").each(function(){var e=
c(this).find("input:file").detach();c(this).button({icons:{primary:"ui-icon-plusthick"}}).append(e)}).end().find(".start").button({icons:{primary:"ui-icon-circle-arrow-e"}}).end().find(".cancel").button({icons:{primary:"ui-icon-cancel"}}).end().find(".delete").button({icons:{primary:"ui-icon-trash"}}).end().find(".progress").progressbar()},_destroy:function(){this.element.find(".fileupload-buttonbar").find(".fileinput-button").each(function(){var e=c(this).find("input:file").detach();c(this).button("destroy").append(e)}).end().find(".start").button("destroy").end().find(".cancel").button("destroy").end().find(".delete").button("destroy").end().find(".progress").progressbar("destroy");
this._super()}})});
@@ -0,0 +1,4 @@
This folder contains jQuery File Upload Plugin theme based bundles
that can be used with the corresponding ui themes.
Note: All themes share the same style bundle: jquenry.fileupload.bundle.min.css
@@ -0,0 +1,75 @@
<!DOCTYPE HTML>
<!--
/*
* jQuery File Upload Plugin postMessage API
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
-->
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery File Upload Plugin postMessage API</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
</head>
<body>
<script>
/*jslint unparam: true, regexp: true */
/*global $, Blob, FormData, location */
'use strict';
var origin = /^http:\/\/example.org/,
target = new RegExp('^(http(s)?:)?\\/\\/' + location.host + '\\/');
$(window).on('message', function (e) {
e = e.originalEvent;
var s = e.data,
xhr = $.ajaxSettings.xhr(),
f;
if (!origin.test(e.origin)) {
throw new Error('Origin "' + e.origin + '" does not match ' + origin);
}
if (!target.test(e.data.url)) {
throw new Error('Target "' + e.data.url + '" does not match ' + target);
}
$(xhr.upload).on('progress', function (ev) {
ev = ev.originalEvent;
e.source.postMessage({
id: s.id,
type: ev.type,
timeStamp: ev.timeStamp,
lengthComputable: ev.lengthComputable,
loaded: ev.loaded,
total: ev.total
}, e.origin);
});
s.xhr = function () {
return xhr;
};
if (!(s.data instanceof Blob)) {
f = new FormData();
$.each(s.data, function (i, v) {
f.append(v.name, v.value);
});
s.data = f;
}
$.ajax(s).always(function (result, statusText, jqXHR) {
if (!jqXHR.done) {
jqXHR = result;
result = null;
}
e.source.postMessage({
id: s.id,
status: jqXHR.status,
statusText: statusText,
result: result,
headers: jqXHR.getAllResponseHeaders()
}, e.origin);
});
});
</script>
</body>
</html>
@@ -0,0 +1,24 @@
<!DOCTYPE HTML>
<!--
/*
* jQuery Iframe Transport Plugin Redirect Page
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
-->
<html lang="en">
<head>
<meta charset="utf-8">
<title>jQuery Iframe Transport Plugin Redirect Page</title>
</head>
<body>
<script>
document.body.innerText=document.body.textContent=decodeURIComponent(window.location.search.slice(1));
</script>
</body>
</html>
@@ -0,0 +1,22 @@
@charset "UTF-8";
/*
* jQuery File Upload Plugin NoScript CSS
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
.fileinput-button input {
position: static;
opacity: 1;
filter: none;
font-size: inherit;
direction: inherit;
}
.fileinput-button span {
display: none;
}
@@ -0,0 +1,17 @@
@charset "UTF-8";
/*
* jQuery File Upload UI Plugin NoScript CSS
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2012, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
.fileinput-button i,
.fileupload-buttonbar .delete,
.fileupload-buttonbar .toggle {
display: none;
}
@@ -0,0 +1,57 @@
@charset "UTF-8";
/*
* jQuery File Upload UI Plugin CSS
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
.fileupload-buttonbar .btn,
.fileupload-buttonbar .toggle {
margin-bottom: 5px;
}
.progress-animated .progress-bar,
.progress-animated .bar {
background: url("../img/progressbar.gif") !important;
filter: none;
}
.fileupload-process {
float: right;
display: none;
}
.fileupload-processing .fileupload-process,
.files .processing .preview {
display: block;
width: 32px;
height: 32px;
background: url("../img/loading.gif") center no-repeat;
background-size: contain;
}
.files audio,
.files video {
max-width: 300px;
}
@media (max-width: 767px) {
.fileupload-buttonbar .toggle,
.files .toggle,
.files .btn span {
display: none;
}
.files .name {
width: 80px;
word-wrap: break-word;
}
.files audio,
.files video {
max-width: 80px;
}
.files img,
.files canvas {
max-width: 100%;
}
}
@@ -0,0 +1,37 @@
@charset "UTF-8";
/*
* jQuery File Upload Plugin CSS
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
.fileinput-button {
position: relative;
overflow: hidden;
display: inline-block;
}
.fileinput-button input {
position: absolute;
top: 0;
right: 0;
margin: 0;
opacity: 0;
-ms-filter: 'alpha(opacity=0)';
font-size: 200px !important;
direction: ltr;
cursor: pointer;
}
/* Fixes for IE < 8 */
@media screen\9 {
.fileinput-button input {
filter: alpha(opacity=0);
font-size: 100%;
height: 100%;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

@@ -0,0 +1,120 @@
/*
* jQuery postMessage Transport Plugin
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* global define, require, window, document */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(require('jquery'));
} else {
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
'use strict';
var counter = 0,
names = [
'accepts',
'cache',
'contents',
'contentType',
'crossDomain',
'data',
'dataType',
'headers',
'ifModified',
'mimeType',
'password',
'processData',
'timeout',
'traditional',
'type',
'url',
'username'
],
convert = function (p) {
return p;
};
$.ajaxSetup({
converters: {
'postmessage text': convert,
'postmessage json': convert,
'postmessage html': convert
}
});
$.ajaxTransport('postmessage', function (options) {
if (options.postMessage && window.postMessage) {
var iframe,
loc = $('<a>').prop('href', options.postMessage)[0],
target = loc.protocol + '//' + loc.host,
xhrUpload = options.xhr().upload;
return {
send: function (_, completeCallback) {
counter += 1;
var message = {
id: 'postmessage-transport-' + counter
},
eventName = 'message.' + message.id;
iframe = $(
'<iframe style="display:none;" src="' +
options.postMessage + '" name="' +
message.id + '"></iframe>'
).bind('load', function () {
$.each(names, function (i, name) {
message[name] = options[name];
});
message.dataType = message.dataType.replace('postmessage ', '');
$(window).bind(eventName, function (e) {
e = e.originalEvent;
var data = e.data,
ev;
if (e.origin === target && data.id === message.id) {
if (data.type === 'progress') {
ev = document.createEvent('Event');
ev.initEvent(data.type, false, true);
$.extend(ev, data);
xhrUpload.dispatchEvent(ev);
} else {
completeCallback(
data.status,
data.statusText,
{postmessage: data.result},
data.headers
);
iframe.remove();
$(window).unbind(eventName);
}
}
});
iframe[0].contentWindow.postMessage(
message,
target
);
}).appendTo(document.body);
},
abort: function () {
if (iframe) {
iframe.remove();
}
}
};
}
});
}));
@@ -0,0 +1,89 @@
/*
* jQuery XDomainRequest Transport Plugin
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*
* Based on Julian Aubourg's ajaxHooks xdr.js:
* https://github.com/jaubourg/ajaxHooks/
*/
/* global define, require, window, XDomainRequest */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(require('jquery'));
} else {
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
'use strict';
if (window.XDomainRequest && !$.support.cors) {
$.ajaxTransport(function (s) {
if (s.crossDomain && s.async) {
if (s.timeout) {
s.xdrTimeout = s.timeout;
delete s.timeout;
}
var xdr;
return {
send: function (headers, completeCallback) {
var addParamChar = /\?/.test(s.url) ? '&' : '?';
function callback(status, statusText, responses, responseHeaders) {
xdr.onload = xdr.onerror = xdr.ontimeout = $.noop;
xdr = null;
completeCallback(status, statusText, responses, responseHeaders);
}
xdr = new XDomainRequest();
// XDomainRequest only supports GET and POST:
if (s.type === 'DELETE') {
s.url = s.url + addParamChar + '_method=DELETE';
s.type = 'POST';
} else if (s.type === 'PUT') {
s.url = s.url + addParamChar + '_method=PUT';
s.type = 'POST';
} else if (s.type === 'PATCH') {
s.url = s.url + addParamChar + '_method=PATCH';
s.type = 'POST';
}
xdr.open(s.type, s.url);
xdr.onload = function () {
callback(
200,
'OK',
{text: xdr.responseText},
'Content-Type: ' + xdr.contentType
);
};
xdr.onerror = function () {
callback(404, 'Not Found');
};
if (s.xdrTimeout) {
xdr.ontimeout = function () {
callback(0, 'timeout');
};
xdr.timeout = s.xdrTimeout;
}
xdr.send((s.hasContent && s.data) || null);
},
abort: function () {
if (xdr) {
xdr.onerror = $.noop();
xdr.abort();
}
}
};
}
});
}
}));
@@ -0,0 +1,425 @@
/*
* jQuery File Upload AngularJS Plugin
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, angular */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'angular',
'./jquery.fileupload-image',
'./jquery.fileupload-audio',
'./jquery.fileupload-video',
'./jquery.fileupload-validate'
], factory);
} else {
factory();
}
}(function () {
'use strict';
angular.module('blueimp.fileupload', [])
// The fileUpload service provides configuration options
// for the fileUpload directive and default handlers for
// File Upload events:
.provider('fileUpload', function () {
var scopeEvalAsync = function (expression) {
var scope = angular.element(this)
.fileupload('option', 'scope');
// Schedule a new $digest cycle if not already inside of one
// and evaluate the given expression:
scope.$evalAsync(expression);
},
addFileMethods = function (scope, data) {
var files = data.files,
file = files[0];
angular.forEach(files, function (file, index) {
file._index = index;
file.$state = function () {
return data.state();
};
file.$processing = function () {
return data.processing();
};
file.$progress = function () {
return data.progress();
};
file.$response = function () {
return data.response();
};
});
file.$submit = function () {
if (!file.error) {
return data.submit();
}
};
file.$cancel = function () {
return data.abort();
};
},
$config;
$config = this.defaults = {
handleResponse: function (e, data) {
var files = data.result && data.result.files;
if (files) {
data.scope.replace(data.files, files);
} else if (data.errorThrown ||
data.textStatus === 'error') {
data.files[0].error = data.errorThrown ||
data.textStatus;
}
},
add: function (e, data) {
if (e.isDefaultPrevented()) {
return false;
}
var scope = data.scope,
filesCopy = [];
angular.forEach(data.files, function (file) {
filesCopy.push(file);
});
scope.$parent.$applyAsync(function () {
addFileMethods(scope, data);
var method = scope.option('prependFiles') ?
'unshift' : 'push';
Array.prototype[method].apply(scope.queue, data.files);
});
data.process(function () {
return scope.process(data);
}).always(function () {
scope.$parent.$applyAsync(function () {
addFileMethods(scope, data);
scope.replace(filesCopy, data.files);
});
}).then(function () {
if ((scope.option('autoUpload') ||
data.autoUpload) &&
data.autoUpload !== false) {
data.submit();
}
});
},
done: function (e, data) {
if (e.isDefaultPrevented()) {
return false;
}
var that = this;
data.scope.$apply(function () {
data.handleResponse.call(that, e, data);
});
},
fail: function (e, data) {
if (e.isDefaultPrevented()) {
return false;
}
var that = this,
scope = data.scope;
if (data.errorThrown === 'abort') {
scope.clear(data.files);
return;
}
scope.$apply(function () {
data.handleResponse.call(that, e, data);
});
},
stop: scopeEvalAsync,
processstart: scopeEvalAsync,
processstop: scopeEvalAsync,
getNumberOfFiles: function () {
var scope = this.scope;
return scope.queue.length - scope.processing();
},
dataType: 'json',
autoUpload: false
};
this.$get = [
function () {
return {
defaults: $config
};
}
];
})
// Format byte numbers to readable presentations:
.provider('formatFileSizeFilter', function () {
var $config = {
// Byte units following the IEC format
// http://en.wikipedia.org/wiki/Kilobyte
units: [
{size: 1000000000, suffix: ' GB'},
{size: 1000000, suffix: ' MB'},
{size: 1000, suffix: ' KB'}
]
};
this.defaults = $config;
this.$get = function () {
return function (bytes) {
if (!angular.isNumber(bytes)) {
return '';
}
var unit = true,
i = 0,
prefix,
suffix;
while (unit) {
unit = $config.units[i];
prefix = unit.prefix || '';
suffix = unit.suffix || '';
if (i === $config.units.length - 1 || bytes >= unit.size) {
return prefix + (bytes / unit.size).toFixed(2) + suffix;
}
i += 1;
}
};
};
})
// The FileUploadController initializes the fileupload widget and
// provides scope methods to control the File Upload functionality:
.controller('FileUploadController', [
'$scope', '$element', '$attrs', '$window', 'fileUpload',
function ($scope, $element, $attrs, $window, fileUpload) {
var uploadMethods = {
progress: function () {
return $element.fileupload('progress');
},
active: function () {
return $element.fileupload('active');
},
option: function (option, data) {
if (arguments.length === 1) {
return $element.fileupload('option', option);
}
$element.fileupload('option', option, data);
},
add: function (data) {
return $element.fileupload('add', data);
},
send: function (data) {
return $element.fileupload('send', data);
},
process: function (data) {
return $element.fileupload('process', data);
},
processing: function (data) {
return $element.fileupload('processing', data);
}
};
$scope.disabled = !$window.jQuery.support.fileInput;
$scope.queue = $scope.queue || [];
$scope.clear = function (files) {
var queue = this.queue,
i = queue.length,
file = files,
length = 1;
if (angular.isArray(files)) {
file = files[0];
length = files.length;
}
while (i) {
i -= 1;
if (queue[i] === file) {
return queue.splice(i, length);
}
}
};
$scope.replace = function (oldFiles, newFiles) {
var queue = this.queue,
file = oldFiles[0],
i,
j;
for (i = 0; i < queue.length; i += 1) {
if (queue[i] === file) {
for (j = 0; j < newFiles.length; j += 1) {
queue[i + j] = newFiles[j];
}
return;
}
}
};
$scope.applyOnQueue = function (method) {
var list = this.queue.slice(0),
i,
file;
for (i = 0; i < list.length; i += 1) {
file = list[i];
if (file[method]) {
file[method]();
}
}
};
$scope.submit = function () {
this.applyOnQueue('$submit');
};
$scope.cancel = function () {
this.applyOnQueue('$cancel');
};
// Add upload methods to the scope:
angular.extend($scope, uploadMethods);
// The fileupload widget will initialize with
// the options provided via "data-"-parameters,
// as well as those given via options object:
$element.fileupload(angular.extend(
{scope: $scope},
fileUpload.defaults
)).on('fileuploadadd', function (e, data) {
data.scope = $scope;
}).on('fileuploadfail', function (e, data) {
if (data.errorThrown === 'abort') {
return;
}
if (data.dataType &&
data.dataType.indexOf('json') === data.dataType.length - 4) {
try {
data.result = angular.fromJson(data.jqXHR.responseText);
} catch (ignore) {}
}
}).on([
'fileuploadadd',
'fileuploadsubmit',
'fileuploadsend',
'fileuploaddone',
'fileuploadfail',
'fileuploadalways',
'fileuploadprogress',
'fileuploadprogressall',
'fileuploadstart',
'fileuploadstop',
'fileuploadchange',
'fileuploadpaste',
'fileuploaddrop',
'fileuploaddragover',
'fileuploadchunksend',
'fileuploadchunkdone',
'fileuploadchunkfail',
'fileuploadchunkalways',
'fileuploadprocessstart',
'fileuploadprocess',
'fileuploadprocessdone',
'fileuploadprocessfail',
'fileuploadprocessalways',
'fileuploadprocessstop'
].join(' '), function (e, data) {
$scope.$parent.$applyAsync(function () {
if ($scope.$emit(e.type, data).defaultPrevented) {
e.preventDefault();
}
});
}).on('remove', function () {
// Remove upload methods from the scope,
// when the widget is removed:
var method;
for (method in uploadMethods) {
if (uploadMethods.hasOwnProperty(method)) {
delete $scope[method];
}
}
});
// Observe option changes:
$scope.$watch(
$attrs.fileUpload,
function (newOptions) {
if (newOptions) {
$element.fileupload('option', newOptions);
}
}
);
}
])
// Provide File Upload progress feedback:
.controller('FileUploadProgressController', [
'$scope', '$attrs', '$parse',
function ($scope, $attrs, $parse) {
var fn = $parse($attrs.fileUploadProgress),
update = function () {
var progress = fn($scope);
if (!progress || !progress.total) {
return;
}
$scope.num = Math.floor(
progress.loaded / progress.total * 100
);
};
update();
$scope.$watch(
$attrs.fileUploadProgress + '.loaded',
function (newValue, oldValue) {
if (newValue !== oldValue) {
update();
}
}
);
}
])
// Display File Upload previews:
.controller('FileUploadPreviewController', [
'$scope', '$element', '$attrs',
function ($scope, $element, $attrs) {
$scope.$watch(
$attrs.fileUploadPreview + '.preview',
function (preview) {
$element.empty();
if (preview) {
$element.append(preview);
}
}
);
}
])
.directive('fileUpload', function () {
return {
controller: 'FileUploadController',
scope: true
};
})
.directive('fileUploadProgress', function () {
return {
controller: 'FileUploadProgressController',
scope: true
};
})
.directive('fileUploadPreview', function () {
return {
controller: 'FileUploadPreviewController'
};
})
// Enhance the HTML5 download attribute to
// allow drag&drop of files to the desktop:
.directive('download', function () {
return function (scope, elm) {
elm.on('dragstart', function (e) {
try {
e.originalEvent.dataTransfer.setData(
'DownloadURL',
[
'application/octet-stream',
elm.prop('download'),
elm.prop('href')
].join(':')
);
} catch (ignore) {}
});
};
});
}));
@@ -0,0 +1,112 @@
/*
* jQuery File Upload Audio Preview Plugin
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, require, window, document */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'load-image',
'./jquery.fileupload-process'
], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(
require('jquery'),
require('load-image')
);
} else {
// Browser globals:
factory(
window.jQuery,
window.loadImage
);
}
}(function ($, loadImage) {
'use strict';
// Prepend to the default processQueue:
$.blueimp.fileupload.prototype.options.processQueue.unshift(
{
action: 'loadAudio',
// Use the action as prefix for the "@" options:
prefix: true,
fileTypes: '@',
maxFileSize: '@',
disabled: '@disableAudioPreview'
},
{
action: 'setAudio',
name: '@audioPreviewName',
disabled: '@disableAudioPreview'
}
);
// The File Upload Audio Preview plugin extends the fileupload widget
// with audio preview functionality:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
// The regular expression for the types of audio files to load,
// matched against the file type:
loadAudioFileTypes: /^audio\/.*$/
},
_audioElement: document.createElement('audio'),
processActions: {
// Loads the audio file given via data.files and data.index
// as audio element if the browser supports playing it.
// Accepts the options fileTypes (regular expression)
// and maxFileSize (integer) to limit the files to load:
loadAudio: function (data, options) {
if (options.disabled) {
return data;
}
var file = data.files[data.index],
url,
audio;
if (this._audioElement.canPlayType &&
this._audioElement.canPlayType(file.type) &&
($.type(options.maxFileSize) !== 'number' ||
file.size <= options.maxFileSize) &&
(!options.fileTypes ||
options.fileTypes.test(file.type))) {
url = loadImage.createObjectURL(file);
if (url) {
audio = this._audioElement.cloneNode(false);
audio.src = url;
audio.controls = true;
data.audio = audio;
return data;
}
}
return data;
},
// Sets the audio element as a property of the file object:
setAudio: function (data, options) {
if (data.audio && !options.disabled) {
data.files[data.index][options.name || 'preview'] = data.audio;
}
return data;
}
}
});
}));
@@ -0,0 +1,324 @@
/*
* jQuery File Upload Image Preview & Resize Plugin
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, require, window, Blob */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'load-image',
'load-image-meta',
'load-image-exif',
'canvas-to-blob',
'./jquery.fileupload-process'
], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(
require('jquery'),
require('blueimp-load-image/js/load-image'),
require('blueimp-load-image/js/load-image-meta'),
require('blueimp-load-image/js/load-image-exif'),
require('blueimp-canvas-to-blob'),
require('./jquery.fileupload-process')
);
} else {
// Browser globals:
factory(
window.jQuery,
window.loadImage
);
}
}(function ($, loadImage) {
'use strict';
// Prepend to the default processQueue:
$.blueimp.fileupload.prototype.options.processQueue.unshift(
{
action: 'loadImageMetaData',
disableImageHead: '@',
disableExif: '@',
disableExifThumbnail: '@',
disableExifSub: '@',
disableExifGps: '@',
disabled: '@disableImageMetaDataLoad'
},
{
action: 'loadImage',
// Use the action as prefix for the "@" options:
prefix: true,
fileTypes: '@',
maxFileSize: '@',
noRevoke: '@',
disabled: '@disableImageLoad'
},
{
action: 'resizeImage',
// Use "image" as prefix for the "@" options:
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',
// Use "preview" as prefix for the "@" options:
prefix: 'preview',
maxWidth: '@',
maxHeight: '@',
minWidth: '@',
minHeight: '@',
crop: '@',
orientation: '@',
thumbnail: '@',
canvas: '@',
disabled: '@disableImagePreview'
},
{
action: 'setImage',
name: '@imagePreviewName',
disabled: '@disableImagePreview'
},
{
action: 'deleteImageReferences',
disabled: '@disableImageReferencesDeletion'
}
);
// The File Upload Resize plugin extends the fileupload widget
// with image resize functionality:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
// The regular expression for the types of images to load:
// matched against the file type:
loadImageFileTypes: /^image\/(gif|jpeg|png|svg\+xml)$/,
// The maximum file size of images to load:
loadImageMaxFileSize: 10000000, // 10MB
// The maximum width of resized images:
imageMaxWidth: 1920,
// The maximum height of resized images:
imageMaxHeight: 1080,
// Defines the image orientation (1-8) or takes the orientation
// value from Exif data if set to true:
imageOrientation: false,
// Define if resized images should be cropped or only scaled:
imageCrop: false,
// Disable the resize image functionality by default:
disableImageResize: true,
// The maximum width of the preview images:
previewMaxWidth: 80,
// The maximum height of the preview images:
previewMaxHeight: 80,
// Defines the preview orientation (1-8) or takes the orientation
// value from Exif data if set to true:
previewOrientation: true,
// Create the preview using the Exif data thumbnail:
previewThumbnail: true,
// Define if preview images should be cropped or only scaled:
previewCrop: false,
// Define if preview images should be resized as canvas elements:
previewCanvas: true
},
processActions: {
// Loads the image given via data.files and data.index
// as img element, if the browser supports the File API.
// Accepts the options fileTypes (regular expression)
// and maxFileSize (integer) to limit the files to load:
loadImage: function (data, options) {
if (options.disabled) {
return data;
}
var that = this,
file = data.files[data.index],
dfd = $.Deferred();
if (($.type(options.maxFileSize) === 'number' &&
file.size > options.maxFileSize) ||
(options.fileTypes &&
!options.fileTypes.test(file.type)) ||
!loadImage(
file,
function (img) {
if (img.src) {
data.img = img;
}
dfd.resolveWith(that, [data]);
},
options
)) {
return data;
}
return dfd.promise();
},
// Resizes the image given as data.canvas or data.img
// and updates data.canvas or data.img with the resized image.
// Also stores the resized image as preview property.
// Accepts the options maxWidth, maxHeight, minWidth,
// minHeight, canvas and crop:
resizeImage: function (data, options) {
if (options.disabled || !(data.canvas || data.img)) {
return data;
}
options = $.extend({canvas: true}, options);
var that = this,
dfd = $.Deferred(),
img = (options.canvas && data.canvas) || data.img,
resolve = function (newImg) {
if (newImg && (newImg.width !== img.width ||
newImg.height !== img.height ||
options.forceResize)) {
data[newImg.getContext ? 'canvas' : 'img'] = newImg;
}
data.preview = newImg;
dfd.resolveWith(that, [data]);
},
thumbnail;
if (data.exif) {
if (options.orientation === true) {
options.orientation = data.exif.get('Orientation');
}
if (options.thumbnail) {
thumbnail = data.exif.get('Thumbnail');
if (thumbnail) {
loadImage(thumbnail, resolve, options);
return dfd.promise();
}
}
// Prevent orienting the same image twice:
if (data.orientation) {
delete options.orientation;
} else {
data.orientation = options.orientation;
}
}
if (img) {
resolve(loadImage.scale(img, options));
return dfd.promise();
}
return data;
},
// Saves the processed image given as data.canvas
// inplace at data.index of data.files:
saveImage: function (data, options) {
if (!data.canvas || options.disabled) {
return data;
}
var that = this,
file = data.files[data.index],
dfd = $.Deferred();
if (data.canvas.toBlob) {
data.canvas.toBlob(
function (blob) {
if (!blob.name) {
if (file.type === blob.type) {
blob.name = file.name;
} else if (file.name) {
blob.name = file.name.replace(
/\.\w+$/,
'.' + blob.type.substr(6)
);
}
}
// Don't restore invalid meta data:
if (file.type !== blob.type) {
delete data.imageHead;
}
// Store the created blob at the position
// of the original file in the files list:
data.files[data.index] = blob;
dfd.resolveWith(that, [data]);
},
options.type || file.type,
options.quality
);
} else {
return data;
}
return dfd.promise();
},
loadImageMetaData: function (data, options) {
if (options.disabled) {
return data;
}
var that = this,
dfd = $.Deferred();
loadImage.parseMetaData(data.files[data.index], function (result) {
$.extend(data, result);
dfd.resolveWith(that, [data]);
}, options);
return dfd.promise();
},
saveImageMetaData: function (data, options) {
if (!(data.imageHead && data.canvas &&
data.canvas.toBlob && !options.disabled)) {
return data;
}
var file = data.files[data.index],
blob = new Blob([
data.imageHead,
// Resized images always have a head size of 20 bytes,
// including the JPEG marker and a minimal JFIF header:
this._blobSlice.call(file, 20)
], {type: file.type});
blob.name = file.name;
data.files[data.index] = blob;
return data;
},
// Sets the resized version of the image as a property of the
// file object, must be called after "saveImage":
setImage: function (data, options) {
if (data.preview && !options.disabled) {
data.files[data.index][options.name || 'preview'] = data.preview;
}
return data;
},
deleteImageReferences: function (data, options) {
if (!options.disabled) {
delete data.img;
delete data.canvas;
delete data.preview;
delete data.imageHead;
}
return data;
}
}
});
}));
@@ -0,0 +1,155 @@
/*
* jQuery File Upload jQuery UI Plugin
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, require, window */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['jquery', './jquery.fileupload-ui'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(require('jquery'));
} else {
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
'use strict';
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
processdone: function (e, data) {
data.context.find('.start').button('enable');
},
progress: function (e, data) {
if (data.context) {
data.context.find('.progress').progressbar(
'option',
'value',
parseInt(data.loaded / data.total * 100, 10)
);
}
},
progressall: function (e, data) {
var $this = $(this);
$this.find('.fileupload-progress')
.find('.progress').progressbar(
'option',
'value',
parseInt(data.loaded / data.total * 100, 10)
).end()
.find('.progress-extended').each(function () {
$(this).html(
($this.data('blueimp-fileupload') ||
$this.data('fileupload'))
._renderExtendedProgress(data)
);
});
}
},
_renderUpload: function (func, files) {
var node = this._super(func, files),
showIconText = $(window).width() > 480;
node.find('.progress').empty().progressbar();
node.find('.start').button({
icons: {primary: 'ui-icon-circle-arrow-e'},
text: showIconText
});
node.find('.cancel').button({
icons: {primary: 'ui-icon-cancel'},
text: showIconText
});
if (node.hasClass('fade')) {
node.hide();
}
return node;
},
_renderDownload: function (func, files) {
var node = this._super(func, files),
showIconText = $(window).width() > 480;
node.find('.delete').button({
icons: {primary: 'ui-icon-trash'},
text: showIconText
});
if (node.hasClass('fade')) {
node.hide();
}
return node;
},
_startHandler: function (e) {
$(e.currentTarget).button('disable');
this._super(e);
},
_transition: function (node) {
var deferred = $.Deferred();
if (node.hasClass('fade')) {
node.fadeToggle(
this.options.transitionDuration,
this.options.transitionEasing,
function () {
deferred.resolveWith(node);
}
);
} else {
deferred.resolveWith(node);
}
return deferred;
},
_create: function () {
this._super();
this.element
.find('.fileupload-buttonbar')
.find('.fileinput-button').each(function () {
var input = $(this).find('input:file').detach();
$(this)
.button({icons: {primary: 'ui-icon-plusthick'}})
.append(input);
})
.end().find('.start')
.button({icons: {primary: 'ui-icon-circle-arrow-e'}})
.end().find('.cancel')
.button({icons: {primary: 'ui-icon-cancel'}})
.end().find('.delete')
.button({icons: {primary: 'ui-icon-trash'}})
.end().find('.progress').progressbar();
},
_destroy: function () {
this.element
.find('.fileupload-buttonbar')
.find('.fileinput-button').each(function () {
var input = $(this).find('input:file').detach();
$(this)
.button('destroy')
.append(input);
})
.end().find('.start')
.button('destroy')
.end().find('.cancel')
.button('destroy')
.end().find('.delete')
.button('destroy')
.end().find('.progress').progressbar('destroy');
this._super();
}
});
}));
@@ -0,0 +1,175 @@
/*
* jQuery File Upload Processing Plugin
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2012, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, require, window */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'./jquery.fileupload'
], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(require('jquery'));
} else {
// Browser globals:
factory(
window.jQuery
);
}
}(function ($) {
'use strict';
var originalAdd = $.blueimp.fileupload.prototype.options.add;
// The File Upload Processing plugin extends the fileupload widget
// with file processing functionality:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
// The list of processing actions:
processQueue: [
/*
{
action: 'log',
type: 'debug'
}
*/
],
add: function (e, data) {
var $this = $(this);
data.process(function () {
return $this.fileupload('process', data);
});
originalAdd.call(this, e, data);
}
},
processActions: {
/*
log: function (data, options) {
console[options.type](
'Processing "' + data.files[data.index].name + '"'
);
}
*/
},
_processFile: function (data, originalData) {
var that = this,
dfd = $.Deferred().resolveWith(that, [data]),
chain = dfd.promise();
this._trigger('process', null, data);
$.each(data.processQueue, function (i, settings) {
var func = function (data) {
if (originalData.errorThrown) {
return $.Deferred()
.rejectWith(that, [originalData]).promise();
}
return that.processActions[settings.action].call(
that,
data,
settings
);
};
chain = chain.then(func, settings.always && func);
});
chain
.done(function () {
that._trigger('processdone', null, data);
that._trigger('processalways', null, data);
})
.fail(function () {
that._trigger('processfail', null, data);
that._trigger('processalways', null, data);
});
return chain;
},
// Replaces the settings of each processQueue item that
// are strings starting with an "@", using the remaining
// substring as key for the option map,
// e.g. "@autoUpload" is replaced with options.autoUpload:
_transformProcessQueue: function (options) {
var processQueue = [];
$.each(options.processQueue, function () {
var settings = {},
action = this.action,
prefix = this.prefix === true ? action : this.prefix;
$.each(this, function (key, value) {
if ($.type(value) === 'string' &&
value.charAt(0) === '@') {
settings[key] = options[
value.slice(1) || (prefix ? prefix +
key.charAt(0).toUpperCase() + key.slice(1) : key)
];
} else {
settings[key] = value;
}
});
processQueue.push(settings);
});
options.processQueue = processQueue;
},
// Returns the number of files currently in the processsing queue:
processing: function () {
return this._processing;
},
// Processes the files given as files property of the data parameter,
// returns a Promise object that allows to bind callbacks:
process: function (data) {
var that = this,
options = $.extend({}, this.options, data);
if (options.processQueue && options.processQueue.length) {
this._transformProcessQueue(options);
if (this._processing === 0) {
this._trigger('processstart');
}
$.each(data.files, function (index) {
var opts = index ? $.extend({}, options) : options,
func = function () {
if (data.errorThrown) {
return $.Deferred()
.rejectWith(that, [data]).promise();
}
return that._processFile(opts, data);
};
opts.index = index;
that._processing += 1;
that._processingQueue = that._processingQueue.then(func, func)
.always(function () {
that._processing -= 1;
if (that._processing === 0) {
that._trigger('processstop');
}
});
});
}
return this._processingQueue;
},
_create: function () {
this._super();
this._processing = 0;
this._processingQueue = $.Deferred().resolveWith(this)
.promise();
}
});
}));
@@ -0,0 +1,710 @@
/*
* jQuery File Upload User Interface Plugin
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, require, window */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'tmpl',
'./jquery.fileupload-image',
'./jquery.fileupload-audio',
'./jquery.fileupload-video',
'./jquery.fileupload-validate'
], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(
require('jquery'),
require('tmpl')
);
} else {
// Browser globals:
factory(
window.jQuery,
window.tmpl
);
}
}(function ($, tmpl) {
'use strict';
$.blueimp.fileupload.prototype._specialOptions.push(
'filesContainer',
'uploadTemplateId',
'downloadTemplateId'
);
// The UI version extends the file upload widget
// and adds complete user interface interaction:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
// By default, files added to the widget are uploaded as soon
// as the user clicks on the start buttons. To enable automatic
// uploads, set the following option to true:
autoUpload: false,
// The ID of the upload template:
uploadTemplateId: 'template-upload',
// The ID of the download template:
downloadTemplateId: 'template-download',
// The container for the list of files. If undefined, it is set to
// an element with class "files" inside of the widget element:
filesContainer: undefined,
// By default, files are appended to the files container.
// Set the following option to true, to prepend files instead:
prependFiles: false,
// The expected data type of the upload response, sets the dataType
// option of the $.ajax upload requests:
dataType: 'json',
// Error and info messages:
messages: {
unknownError: 'Unknown error'
},
// Function returning the current number of files,
// used by the maxNumberOfFiles validation:
getNumberOfFiles: function () {
return this.filesContainer.children()
.not('.processing').length;
},
// Callback to retrieve the list of files from the server response:
getFilesFromResponse: function (data) {
if (data.result && $.isArray(data.result.files)) {
return data.result.files;
}
return [];
},
// The add callback is invoked as soon as files are added to the fileupload
// widget (via file input selection, drag & drop or add API call).
// See the basic file upload widget for more information:
add: function (e, data) {
if (e.isDefaultPrevented()) {
return false;
}
var $this = $(this),
that = $this.data('blueimp-fileupload') ||
$this.data('fileupload'),
options = that.options;
data.context = that._renderUpload(data.files)
.data('data', data)
.addClass('processing');
options.filesContainer[
options.prependFiles ? 'prepend' : 'append'
](data.context);
that._forceReflow(data.context);
that._transition(data.context);
data.process(function () {
return $this.fileupload('process', data);
}).always(function () {
data.context.each(function (index) {
$(this).find('.size').text(
that._formatFileSize(data.files[index].size)
);
}).removeClass('processing');
that._renderPreviews(data);
}).done(function () {
data.context.find('.start').prop('disabled', false);
if ((that._trigger('added', e, data) !== false) &&
(options.autoUpload || data.autoUpload) &&
data.autoUpload !== false) {
data.submit();
}
}).fail(function () {
if (data.files.error) {
data.context.each(function (index) {
var error = data.files[index].error;
if (error) {
$(this).find('.error').text(error);
}
});
}
});
},
// Callback for the start of each file upload request:
send: function (e, data) {
if (e.isDefaultPrevented()) {
return false;
}
var that = $(this).data('blueimp-fileupload') ||
$(this).data('fileupload');
if (data.context && data.dataType &&
data.dataType.substr(0, 6) === 'iframe') {
// Iframe Transport does not support progress events.
// In lack of an indeterminate progress bar, we set
// the progress to 100%, showing the full animated bar:
data.context
.find('.progress').addClass(
!$.support.transition && 'progress-animated'
)
.attr('aria-valuenow', 100)
.children().first().css(
'width',
'100%'
);
}
return that._trigger('sent', e, data);
},
// Callback for successful uploads:
done: function (e, data) {
if (e.isDefaultPrevented()) {
return false;
}
var that = $(this).data('blueimp-fileupload') ||
$(this).data('fileupload'),
getFilesFromResponse = data.getFilesFromResponse ||
that.options.getFilesFromResponse,
files = getFilesFromResponse(data),
template,
deferred;
if (data.context) {
data.context.each(function (index) {
var file = files[index] ||
{error: 'Empty file upload result'};
deferred = that._addFinishedDeferreds();
that._transition($(this)).done(
function () {
var node = $(this);
template = that._renderDownload([file])
.replaceAll(node);
that._forceReflow(template);
that._transition(template).done(
function () {
data.context = $(this);
that._trigger('completed', e, data);
that._trigger('finished', e, data);
deferred.resolve();
}
);
}
);
});
} else {
template = that._renderDownload(files)[
that.options.prependFiles ? 'prependTo' : 'appendTo'
](that.options.filesContainer);
that._forceReflow(template);
deferred = that._addFinishedDeferreds();
that._transition(template).done(
function () {
data.context = $(this);
that._trigger('completed', e, data);
that._trigger('finished', e, data);
deferred.resolve();
}
);
}
},
// Callback for failed (abort or error) uploads:
fail: function (e, data) {
if (e.isDefaultPrevented()) {
return false;
}
var that = $(this).data('blueimp-fileupload') ||
$(this).data('fileupload'),
template,
deferred;
if (data.context) {
data.context.each(function (index) {
if (data.errorThrown !== 'abort') {
var file = data.files[index];
file.error = file.error || data.errorThrown ||
data.i18n('unknownError');
deferred = that._addFinishedDeferreds();
that._transition($(this)).done(
function () {
var node = $(this);
template = that._renderDownload([file])
.replaceAll(node);
that._forceReflow(template);
that._transition(template).done(
function () {
data.context = $(this);
that._trigger('failed', e, data);
that._trigger('finished', e, data);
deferred.resolve();
}
);
}
);
} else {
deferred = that._addFinishedDeferreds();
that._transition($(this)).done(
function () {
$(this).remove();
that._trigger('failed', e, data);
that._trigger('finished', e, data);
deferred.resolve();
}
);
}
});
} else if (data.errorThrown !== 'abort') {
data.context = that._renderUpload(data.files)[
that.options.prependFiles ? 'prependTo' : 'appendTo'
](that.options.filesContainer)
.data('data', data);
that._forceReflow(data.context);
deferred = that._addFinishedDeferreds();
that._transition(data.context).done(
function () {
data.context = $(this);
that._trigger('failed', e, data);
that._trigger('finished', e, data);
deferred.resolve();
}
);
} else {
that._trigger('failed', e, data);
that._trigger('finished', e, data);
that._addFinishedDeferreds().resolve();
}
},
// Callback for upload progress events:
progress: function (e, data) {
if (e.isDefaultPrevented()) {
return false;
}
var progress = Math.floor(data.loaded / data.total * 100);
if (data.context) {
data.context.each(function () {
$(this).find('.progress')
.attr('aria-valuenow', progress)
.children().first().css(
'width',
progress + '%'
);
});
}
},
// Callback for global upload progress events:
progressall: function (e, data) {
if (e.isDefaultPrevented()) {
return false;
}
var $this = $(this),
progress = Math.floor(data.loaded / data.total * 100),
globalProgressNode = $this.find('.fileupload-progress'),
extendedProgressNode = globalProgressNode
.find('.progress-extended');
if (extendedProgressNode.length) {
extendedProgressNode.html(
($this.data('blueimp-fileupload') || $this.data('fileupload'))
._renderExtendedProgress(data)
);
}
globalProgressNode
.find('.progress')
.attr('aria-valuenow', progress)
.children().first().css(
'width',
progress + '%'
);
},
// Callback for uploads start, equivalent to the global ajaxStart event:
start: function (e) {
if (e.isDefaultPrevented()) {
return false;
}
var that = $(this).data('blueimp-fileupload') ||
$(this).data('fileupload');
that._resetFinishedDeferreds();
that._transition($(this).find('.fileupload-progress')).done(
function () {
that._trigger('started', e);
}
);
},
// Callback for uploads stop, equivalent to the global ajaxStop event:
stop: function (e) {
if (e.isDefaultPrevented()) {
return false;
}
var that = $(this).data('blueimp-fileupload') ||
$(this).data('fileupload'),
deferred = that._addFinishedDeferreds();
$.when.apply($, that._getFinishedDeferreds())
.done(function () {
that._trigger('stopped', e);
});
that._transition($(this).find('.fileupload-progress')).done(
function () {
$(this).find('.progress')
.attr('aria-valuenow', '0')
.children().first().css('width', '0%');
$(this).find('.progress-extended').html('&nbsp;');
deferred.resolve();
}
);
},
processstart: function (e) {
if (e.isDefaultPrevented()) {
return false;
}
$(this).addClass('fileupload-processing');
},
processstop: function (e) {
if (e.isDefaultPrevented()) {
return false;
}
$(this).removeClass('fileupload-processing');
},
// Callback for file deletion:
destroy: function (e, data) {
if (e.isDefaultPrevented()) {
return false;
}
var that = $(this).data('blueimp-fileupload') ||
$(this).data('fileupload'),
removeNode = function () {
that._transition(data.context).done(
function () {
$(this).remove();
that._trigger('destroyed', e, data);
}
);
};
if (data.url) {
data.dataType = data.dataType || that.options.dataType;
$.ajax(data).done(removeNode).fail(function () {
that._trigger('destroyfailed', e, data);
});
} else {
removeNode();
}
}
},
_resetFinishedDeferreds: function () {
this._finishedUploads = [];
},
_addFinishedDeferreds: function (deferred) {
if (!deferred) {
deferred = $.Deferred();
}
this._finishedUploads.push(deferred);
return deferred;
},
_getFinishedDeferreds: function () {
return this._finishedUploads;
},
// Link handler, that allows to download files
// by drag & drop of the links to the desktop:
_enableDragToDesktop: function () {
var link = $(this),
url = link.prop('href'),
name = link.prop('download'),
type = 'application/octet-stream';
link.bind('dragstart', function (e) {
try {
e.originalEvent.dataTransfer.setData(
'DownloadURL',
[type, name, url].join(':')
);
} catch (ignore) {}
});
},
_formatFileSize: function (bytes) {
if (typeof bytes !== 'number') {
return '';
}
if (bytes >= 1000000000) {
return (bytes / 1000000000).toFixed(2) + ' GB';
}
if (bytes >= 1000000) {
return (bytes / 1000000).toFixed(2) + ' MB';
}
return (bytes / 1000).toFixed(2) + ' KB';
},
_formatBitrate: function (bits) {
if (typeof bits !== 'number') {
return '';
}
if (bits >= 1000000000) {
return (bits / 1000000000).toFixed(2) + ' Gbit/s';
}
if (bits >= 1000000) {
return (bits / 1000000).toFixed(2) + ' Mbit/s';
}
if (bits >= 1000) {
return (bits / 1000).toFixed(2) + ' kbit/s';
}
return bits.toFixed(2) + ' bit/s';
},
_formatTime: function (seconds) {
var date = new Date(seconds * 1000),
days = Math.floor(seconds / 86400);
days = days ? days + 'd ' : '';
return days +
('0' + date.getUTCHours()).slice(-2) + ':' +
('0' + date.getUTCMinutes()).slice(-2) + ':' +
('0' + date.getUTCSeconds()).slice(-2);
},
_formatPercentage: function (floatValue) {
return (floatValue * 100).toFixed(2) + ' %';
},
_renderExtendedProgress: function (data) {
return this._formatBitrate(data.bitrate) + ' | ' +
this._formatTime(
(data.total - data.loaded) * 8 / data.bitrate
) + ' | ' +
this._formatPercentage(
data.loaded / data.total
) + ' | ' +
this._formatFileSize(data.loaded) + ' / ' +
this._formatFileSize(data.total);
},
_renderTemplate: function (func, files) {
if (!func) {
return $();
}
var result = func({
files: files,
formatFileSize: this._formatFileSize,
options: this.options
});
if (result instanceof $) {
return result;
}
return $(this.options.templatesContainer).html(result).children();
},
_renderPreviews: function (data) {
data.context.find('.preview').each(function (index, elm) {
$(elm).append(data.files[index].preview);
});
},
_renderUpload: function (files) {
return this._renderTemplate(
this.options.uploadTemplate,
files
);
},
_renderDownload: function (files) {
return this._renderTemplate(
this.options.downloadTemplate,
files
).find('a[download]').each(this._enableDragToDesktop).end();
},
_startHandler: function (e) {
e.preventDefault();
var button = $(e.currentTarget),
template = button.closest('.template-upload'),
data = template.data('data');
button.prop('disabled', true);
if (data && data.submit) {
data.submit();
}
},
_cancelHandler: function (e) {
e.preventDefault();
var template = $(e.currentTarget)
.closest('.template-upload,.template-download'),
data = template.data('data') || {};
data.context = data.context || template;
if (data.abort) {
data.abort();
} else {
data.errorThrown = 'abort';
this._trigger('fail', e, data);
}
},
_deleteHandler: function (e) {
e.preventDefault();
var button = $(e.currentTarget);
this._trigger('destroy', e, $.extend({
context: button.closest('.template-download'),
type: 'DELETE'
}, button.data()));
},
_forceReflow: function (node) {
return $.support.transition && node.length &&
node[0].offsetWidth;
},
_transition: function (node) {
var dfd = $.Deferred();
if ($.support.transition && node.hasClass('fade') && node.is(':visible')) {
node.bind(
$.support.transition.end,
function (e) {
// Make sure we don't respond to other transitions events
// in the container element, e.g. from button elements:
if (e.target === node[0]) {
node.unbind($.support.transition.end);
dfd.resolveWith(node);
}
}
).toggleClass('in');
} else {
node.toggleClass('in');
dfd.resolveWith(node);
}
return dfd;
},
_initButtonBarEventHandlers: function () {
var fileUploadButtonBar = this.element.find('.fileupload-buttonbar'),
filesList = this.options.filesContainer;
this._on(fileUploadButtonBar.find('.start'), {
click: function (e) {
e.preventDefault();
filesList.find('.start').click();
}
});
this._on(fileUploadButtonBar.find('.cancel'), {
click: function (e) {
e.preventDefault();
filesList.find('.cancel').click();
}
});
this._on(fileUploadButtonBar.find('.delete'), {
click: function (e) {
e.preventDefault();
filesList.find('.toggle:checked')
.closest('.template-download')
.find('.delete').click();
fileUploadButtonBar.find('.toggle')
.prop('checked', false);
}
});
this._on(fileUploadButtonBar.find('.toggle'), {
change: function (e) {
filesList.find('.toggle').prop(
'checked',
$(e.currentTarget).is(':checked')
);
}
});
},
_destroyButtonBarEventHandlers: function () {
this._off(
this.element.find('.fileupload-buttonbar')
.find('.start, .cancel, .delete'),
'click'
);
this._off(
this.element.find('.fileupload-buttonbar .toggle'),
'change.'
);
},
_initEventHandlers: function () {
this._super();
this._on(this.options.filesContainer, {
'click .start': this._startHandler,
'click .cancel': this._cancelHandler,
'click .delete': this._deleteHandler
});
this._initButtonBarEventHandlers();
},
_destroyEventHandlers: function () {
this._destroyButtonBarEventHandlers();
this._off(this.options.filesContainer, 'click');
this._super();
},
_enableFileInputButton: function () {
this.element.find('.fileinput-button input')
.prop('disabled', false)
.parent().removeClass('disabled');
},
_disableFileInputButton: function () {
this.element.find('.fileinput-button input')
.prop('disabled', true)
.parent().addClass('disabled');
},
_initTemplates: function () {
var options = this.options;
options.templatesContainer = this.document[0].createElement(
options.filesContainer.prop('nodeName')
);
if (tmpl) {
if (options.uploadTemplateId) {
options.uploadTemplate = tmpl(options.uploadTemplateId);
}
if (options.downloadTemplateId) {
options.downloadTemplate = tmpl(options.downloadTemplateId);
}
}
},
_initFilesContainer: function () {
var options = this.options;
if (options.filesContainer === undefined) {
options.filesContainer = this.element.find('.files');
} else if (!(options.filesContainer instanceof $)) {
options.filesContainer = $(options.filesContainer);
}
},
_initSpecialOptions: function () {
this._super();
this._initFilesContainer();
this._initTemplates();
},
_create: function () {
this._super();
this._resetFinishedDeferreds();
if (!$.support.fileInput) {
this._disableFileInputButton();
}
},
enable: function () {
var wasDisabled = false;
if (this.options.disabled) {
wasDisabled = true;
}
this._super();
if (wasDisabled) {
this.element.find('input, button').prop('disabled', false);
this._enableFileInputButton();
}
},
disable: function () {
if (!this.options.disabled) {
this.element.find('input, button').prop('disabled', true);
this._disableFileInputButton();
}
this._super();
}
});
}));
@@ -0,0 +1,122 @@
/*
* jQuery File Upload Validation Plugin
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* global define, require, window */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'./jquery.fileupload-process'
], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(require('jquery'));
} else {
// Browser globals:
factory(
window.jQuery
);
}
}(function ($) {
'use strict';
// Append to the default processQueue:
$.blueimp.fileupload.prototype.options.processQueue.push(
{
action: 'validate',
// Always trigger this action,
// even if the previous action was rejected:
always: true,
// Options taken from the global options map:
acceptFileTypes: '@',
maxFileSize: '@',
minFileSize: '@',
maxNumberOfFiles: '@',
disabled: '@disableValidation'
}
);
// The File Upload Validation plugin extends the fileupload widget
// with file validation functionality:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
/*
// The regular expression for allowed file types, matches
// against either file type or file name:
acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
// The maximum allowed file size in bytes:
maxFileSize: 10000000, // 10 MB
// The minimum allowed file size in bytes:
minFileSize: undefined, // No minimal file size
// The limit of files to be uploaded:
maxNumberOfFiles: 10,
*/
// Function returning the current number of files,
// has to be overriden for maxNumberOfFiles validation:
getNumberOfFiles: $.noop,
// Error and info messages:
messages: {
maxNumberOfFiles: 'Maximum number of files exceeded',
acceptFileTypes: 'File type not allowed',
maxFileSize: 'File is too large',
minFileSize: 'File is too small'
}
},
processActions: {
validate: function (data, options) {
if (options.disabled) {
return data;
}
var dfd = $.Deferred(),
settings = this.options,
file = data.files[data.index],
fileSize;
if (options.minFileSize || options.maxFileSize) {
fileSize = file.size;
}
if ($.type(options.maxNumberOfFiles) === 'number' &&
(settings.getNumberOfFiles() || 0) + data.files.length >
options.maxNumberOfFiles) {
file.error = settings.i18n('maxNumberOfFiles');
} else if (options.acceptFileTypes &&
!(options.acceptFileTypes.test(file.type) ||
options.acceptFileTypes.test(file.name))) {
file.error = settings.i18n('acceptFileTypes');
} else if (fileSize > options.maxFileSize) {
file.error = settings.i18n('maxFileSize');
} else if ($.type(fileSize) === 'number' &&
fileSize < options.minFileSize) {
file.error = settings.i18n('minFileSize');
} else {
delete file.error;
}
if (file.error || data.files.error) {
data.files.error = true;
dfd.rejectWith(this, [data]);
} else {
dfd.resolveWith(this, [data]);
}
return dfd.promise();
}
}
});
}));
@@ -0,0 +1,112 @@
/*
* jQuery File Upload Video Preview Plugin
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, require, window, document */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'load-image',
'./jquery.fileupload-process'
], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(
require('jquery'),
require('load-image')
);
} else {
// Browser globals:
factory(
window.jQuery,
window.loadImage
);
}
}(function ($, loadImage) {
'use strict';
// Prepend to the default processQueue:
$.blueimp.fileupload.prototype.options.processQueue.unshift(
{
action: 'loadVideo',
// Use the action as prefix for the "@" options:
prefix: true,
fileTypes: '@',
maxFileSize: '@',
disabled: '@disableVideoPreview'
},
{
action: 'setVideo',
name: '@videoPreviewName',
disabled: '@disableVideoPreview'
}
);
// The File Upload Video Preview plugin extends the fileupload widget
// with video preview functionality:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
options: {
// The regular expression for the types of video files to load,
// matched against the file type:
loadVideoFileTypes: /^video\/.*$/
},
_videoElement: document.createElement('video'),
processActions: {
// Loads the video file given via data.files and data.index
// as video element if the browser supports playing it.
// Accepts the options fileTypes (regular expression)
// and maxFileSize (integer) to limit the files to load:
loadVideo: function (data, options) {
if (options.disabled) {
return data;
}
var file = data.files[data.index],
url,
video;
if (this._videoElement.canPlayType &&
this._videoElement.canPlayType(file.type) &&
($.type(options.maxFileSize) !== 'number' ||
file.size <= options.maxFileSize) &&
(!options.fileTypes ||
options.fileTypes.test(file.type))) {
url = loadImage.createObjectURL(file);
if (url) {
video = this._videoElement.cloneNode(false);
video.src = url;
video.controls = true;
data.video = video;
return data;
}
}
return data;
},
// Sets the video element as a property of the file object:
setVideo: function (data, options) {
if (data.video && !options.disabled) {
data.files[data.index][options.name || 'preview'] = data.video;
}
return data;
}
}
});
}));
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,217 @@
/*
* jQuery Iframe Transport Plugin
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* global define, require, window, document */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['jquery'], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(require('jquery'));
} else {
// Browser globals:
factory(window.jQuery);
}
}(function ($) {
'use strict';
// Helper variable to create unique names for the transport iframes:
var counter = 0;
// The iframe transport accepts four additional options:
// options.fileInput: a jQuery collection of file input fields
// options.paramName: the parameter name for the file form data,
// overrides the name property of the file input field(s),
// can be a string or an array of strings.
// options.formData: an array of objects with name and value properties,
// equivalent to the return data of .serializeArray(), e.g.:
// [{name: 'a', value: 1}, {name: 'b', value: 2}]
// options.initialIframeSrc: the URL of the initial iframe src,
// by default set to "javascript:false;"
$.ajaxTransport('iframe', function (options) {
if (options.async) {
// javascript:false as initial iframe src
// prevents warning popups on HTTPS in IE6:
/*jshint scripturl: true */
var initialIframeSrc = options.initialIframeSrc || 'javascript:false;',
/*jshint scripturl: false */
form,
iframe,
addParamChar;
return {
send: function (_, completeCallback) {
form = $('<form style="display:none;"></form>');
form.attr('accept-charset', options.formAcceptCharset);
addParamChar = /\?/.test(options.url) ? '&' : '?';
// XDomainRequest only supports GET and POST:
if (options.type === 'DELETE') {
options.url = options.url + addParamChar + '_method=DELETE';
options.type = 'POST';
} else if (options.type === 'PUT') {
options.url = options.url + addParamChar + '_method=PUT';
options.type = 'POST';
} else if (options.type === 'PATCH') {
options.url = options.url + addParamChar + '_method=PATCH';
options.type = 'POST';
}
// IE versions below IE8 cannot set the name property of
// elements that have already been added to the DOM,
// so we set the name along with the iframe HTML markup:
counter += 1;
iframe = $(
'<iframe src="' + initialIframeSrc +
'" name="iframe-transport-' + counter + '"></iframe>'
).bind('load', function () {
var fileInputClones,
paramNames = $.isArray(options.paramName) ?
options.paramName : [options.paramName];
iframe
.unbind('load')
.bind('load', function () {
var response;
// Wrap in a try/catch block to catch exceptions thrown
// when trying to access cross-domain iframe contents:
try {
response = iframe.contents();
// Google Chrome and Firefox do not throw an
// exception when calling iframe.contents() on
// cross-domain requests, so we unify the response:
if (!response.length || !response[0].firstChild) {
throw new Error();
}
} catch (e) {
response = undefined;
}
// The complete callback returns the
// iframe content document as response object:
completeCallback(
200,
'success',
{'iframe': response}
);
// Fix for IE endless progress bar activity bug
// (happens on form submits to iframe targets):
$('<iframe src="' + initialIframeSrc + '"></iframe>')
.appendTo(form);
window.setTimeout(function () {
// Removing the form in a setTimeout call
// allows Chrome's developer tools to display
// the response result
form.remove();
}, 0);
});
form
.prop('target', iframe.prop('name'))
.prop('action', options.url)
.prop('method', options.type);
if (options.formData) {
$.each(options.formData, function (index, field) {
$('<input type="hidden"/>')
.prop('name', field.name)
.val(field.value)
.appendTo(form);
});
}
if (options.fileInput && options.fileInput.length &&
options.type === 'POST') {
fileInputClones = options.fileInput.clone();
// Insert a clone for each file input field:
options.fileInput.after(function (index) {
return fileInputClones[index];
});
if (options.paramName) {
options.fileInput.each(function (index) {
$(this).prop(
'name',
paramNames[index] || options.paramName
);
});
}
// Appending the file input fields to the hidden form
// removes them from their original location:
form
.append(options.fileInput)
.prop('enctype', 'multipart/form-data')
// enctype must be set as encoding for IE:
.prop('encoding', 'multipart/form-data');
// Remove the HTML5 form attribute from the input(s):
options.fileInput.removeAttr('form');
}
form.submit();
// Insert the file input fields at their original location
// by replacing the clones with the originals:
if (fileInputClones && fileInputClones.length) {
options.fileInput.each(function (index, input) {
var clone = $(fileInputClones[index]);
// Restore the original name and form properties:
$(input)
.prop('name', clone.prop('name'))
.attr('form', clone.attr('form'));
clone.replaceWith(input);
});
}
});
form.append(iframe).appendTo(document.body);
},
abort: function () {
if (iframe) {
// javascript:false as iframe src aborts the request
// and prevents warning popups on HTTPS in IE6.
// concat is used to avoid the "Script URL" JSLint error:
iframe
.unbind('load')
.prop('src', initialIframeSrc);
}
if (form) {
form.remove();
}
}
};
}
});
// The iframe transport returns the iframe content document as response.
// The following adds converters from iframe to text, json, html, xml
// and script.
// Please note that the Content-Type for JSON responses has to be text/plain
// or text/html, if the browser doesn't include application/json in the
// Accept header, else IE will show a download dialog.
// The Content-Type for XML responses on the other hand has to be always
// application/xml or text/xml, so IE properly parses the XML response.
// See also
// https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation
$.ajaxSetup({
converters: {
'iframe text': function (iframe) {
return iframe && $(iframe[0].body).text();
},
'iframe json': function (iframe) {
return iframe && $.parseJSON($(iframe[0].body).text());
},
'iframe html': function (iframe) {
return iframe && $(iframe[0].body).html();
},
'iframe xml': function (iframe) {
var xmlDoc = iframe && iframe[0];
return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc :
$.parseXML((xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) ||
$(xmlDoc.body).html());
},
'iframe script': function (iframe) {
return iframe && $.globalEval($(iframe[0].body).text());
}
}
});
}));
@@ -0,0 +1,176 @@
/*
* jQuery File Upload User Interface Plugin 9.6.1
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2010, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* jshint nomen:false */
/* global define, require, window */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'jquery',
'../jquery.fileupload'
], factory);
} else if (typeof exports === 'object') {
// Node/CommonJS:
factory(
require('jquery'),
require('../jquery.fileupload')
);
} else {
// Browser globals:
factory(
window.jQuery
);
}
}(function ($) {
'use strict';
// The UI version extends the file upload widget
// and adds complete user interface interaction:
$.widget('blueimp.fileupload', $.blueimp.fileupload, {
getUploadButton: function() {
var uploadButton = $('<button/>')
.addClass('btn')
.prop('disabled', true)
.text('Processing...')
.on('click', function () {
var $this = $(this),
data = $this.data();
$this
.off('click')
.text('Abort')
.on('click', function () {
$this.remove();
data.abort();
});
data.submit().always(function () {
$this.remove();
});
});
return uploadButton;
},
// Bind event handler to the client plugin events
initTheme: function (theme) {
var $this = this.element;
var low = theme.toLowerCase();
if ($this) {
if (low == "basic")
this._initBasicTheme($this);
else if (low == "basicplus")
this._initBasicPlusTheme($this);
else if ((low == "basicplusui") || (low == "jqueryui"))
this._initBasicPlusUITheme($this);
return $this;
}
return null;
},
// Bind event handlers in Basic Plus Theme
_initBasicTheme: function($this) {
$this.on('fileuploaddone', function (e, data) {
$.each(data.result.files, function (index, file) {
$('<p/>').text(file.name).appendTo('#files');
});
})
.on('fileuploadprogressall', function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
$('#progress .progress-bar').css(
'width',
progress + '%'
);
})
.prop('disabled', !$.support.fileInput)
.parent().addClass($.support.fileInput ? undefined : 'disabled')
},
// Bind event handlers in Basic Plus Theme
_initBasicPlusTheme: function($this) {
$this.on('fileuploadadd', function (e, data) {
var $widget = $(e.target).data('blueimp-fileupload');
var uploadButton = $widget.getUploadButton();
data.context = $('<div/>').appendTo('#files');
$.each(data.files, function (index, file) {
var node = $('<p/>')
.append($('<span/>').text(file.name));
if (!index) {
node
.append('<br>')
.append(uploadButton.clone(true).data(data));
}
node.appendTo(data.context);
});
})
.on('fileuploadprocessalways', function (e, data) {
var index = data.index,
file = data.files[index],
node = $(data.context.children()[index]);
if (file.preview) {
node
.prepend('<br>')
.prepend(file.preview);
}
if (file.error) {
node
.append('<br>')
.append(file.error);
}
if (index + 1 === data.files.length) {
data.context.find('button')
.text('Upload')
.prop('disabled', !!data.files.error);
}
})
.on('fileuploadprogressall', function (e, data) {
var progress = parseInt(data.loaded / data.total * 100, 10);
$('#progress .bar').css(
'width',
progress + '%'
);
})
.on('fileuploaddone', function (e, data) {
$.each(data.result.files, function (index, file) {
var link = $('<a>')
.attr('target', '_blank')
.prop('href', file.url);
$(data.context.children()[index])
.wrap(link);
});
})
.on('fileuploadfail', function (e, data) {
$.each(data.result.files, function (index, file) {
var error = $('<span/>').text(file.error);
$(data.context.children()[index])
.append('<br>')
.append(error);
});
})
.prop('disabled', !$.support.fileInput)
.parent().addClass($.support.fileInput ? undefined : 'disabled');
},
// Bind event handlers in Basic Plus UI theme
_initBasicPlusUITheme: function($this) {
$this
.prop('disabled', !$.support.fileInput)
.parent().addClass($.support.fileInput ? undefined : 'disabled')
},
})
}))
@@ -0,0 +1,572 @@
/*! jQuery UI - v1.11.4+CommonJS - 2015-08-28
* http://jqueryui.com
* Includes: widget.js
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
(function( factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
define([ "jquery" ], factory );
} else if ( typeof exports === "object" ) {
// Node/CommonJS
factory( require( "jquery" ) );
} else {
// Browser globals
factory( jQuery );
}
}(function( $ ) {
/*!
* jQuery UI Widget 1.11.4
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/jQuery.widget/
*/
var widget_uuid = 0,
widget_slice = Array.prototype.slice;
$.cleanData = (function( orig ) {
return function( elems ) {
var events, elem, i;
for ( i = 0; (elem = elems[i]) != null; i++ ) {
try {
// Only trigger remove when necessary to save time
events = $._data( elem, "events" );
if ( events && events.remove ) {
$( elem ).triggerHandler( "remove" );
}
// http://bugs.jquery.com/ticket/8235
} catch ( e ) {}
}
orig( elems );
};
})( $.cleanData );
$.widget = function( name, base, prototype ) {
var fullName, existingConstructor, constructor, basePrototype,
// proxiedPrototype allows the provided prototype to remain unmodified
// so that it can be used as a mixin for multiple widgets (#8876)
proxiedPrototype = {},
namespace = name.split( "." )[ 0 ];
name = name.split( "." )[ 1 ];
fullName = namespace + "-" + name;
if ( !prototype ) {
prototype = base;
base = $.Widget;
}
// create selector for plugin
$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
return !!$.data( elem, fullName );
};
$[ namespace ] = $[ namespace ] || {};
existingConstructor = $[ namespace ][ name ];
constructor = $[ namespace ][ name ] = function( options, element ) {
// allow instantiation without "new" keyword
if ( !this._createWidget ) {
return new constructor( options, element );
}
// allow instantiation without initializing for simple inheritance
// must use "new" keyword (the code above always passes args)
if ( arguments.length ) {
this._createWidget( options, element );
}
};
// extend with the existing constructor to carry over any static properties
$.extend( constructor, existingConstructor, {
version: prototype.version,
// copy the object used to create the prototype in case we need to
// redefine the widget later
_proto: $.extend( {}, prototype ),
// track widgets that inherit from this widget in case this widget is
// redefined after a widget inherits from it
_childConstructors: []
});
basePrototype = new base();
// we need to make the options hash a property directly on the new instance
// otherwise we'll modify the options hash on the prototype that we're
// inheriting from
basePrototype.options = $.widget.extend( {}, basePrototype.options );
$.each( prototype, function( prop, value ) {
if ( !$.isFunction( value ) ) {
proxiedPrototype[ prop ] = value;
return;
}
proxiedPrototype[ prop ] = (function() {
var _super = function() {
return base.prototype[ prop ].apply( this, arguments );
},
_superApply = function( args ) {
return base.prototype[ prop ].apply( this, args );
};
return function() {
var __super = this._super,
__superApply = this._superApply,
returnValue;
this._super = _super;
this._superApply = _superApply;
returnValue = value.apply( this, arguments );
this._super = __super;
this._superApply = __superApply;
return returnValue;
};
})();
});
constructor.prototype = $.widget.extend( basePrototype, {
// TODO: remove support for widgetEventPrefix
// always use the name + a colon as the prefix, e.g., draggable:start
// don't prefix for widgets that aren't DOM-based
widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
}, proxiedPrototype, {
constructor: constructor,
namespace: namespace,
widgetName: name,
widgetFullName: fullName
});
// If this widget is being redefined then we need to find all widgets that
// are inheriting from it and redefine all of them so that they inherit from
// the new version of this widget. We're essentially trying to replace one
// level in the prototype chain.
if ( existingConstructor ) {
$.each( existingConstructor._childConstructors, function( i, child ) {
var childPrototype = child.prototype;
// redefine the child widget using the same prototype that was
// originally used, but inherit from the new version of the base
$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
});
// remove the list of existing child constructors from the old constructor
// so the old child constructors can be garbage collected
delete existingConstructor._childConstructors;
} else {
base._childConstructors.push( constructor );
}
$.widget.bridge( name, constructor );
return constructor;
};
$.widget.extend = function( target ) {
var input = widget_slice.call( arguments, 1 ),
inputIndex = 0,
inputLength = input.length,
key,
value;
for ( ; inputIndex < inputLength; inputIndex++ ) {
for ( key in input[ inputIndex ] ) {
value = input[ inputIndex ][ key ];
if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
// Clone objects
if ( $.isPlainObject( value ) ) {
target[ key ] = $.isPlainObject( target[ key ] ) ?
$.widget.extend( {}, target[ key ], value ) :
// Don't extend strings, arrays, etc. with objects
$.widget.extend( {}, value );
// Copy everything else by reference
} else {
target[ key ] = value;
}
}
}
}
return target;
};
$.widget.bridge = function( name, object ) {
var fullName = object.prototype.widgetFullName || name;
$.fn[ name ] = function( options ) {
var isMethodCall = typeof options === "string",
args = widget_slice.call( arguments, 1 ),
returnValue = this;
if ( isMethodCall ) {
this.each(function() {
var methodValue,
instance = $.data( this, fullName );
if ( options === "instance" ) {
returnValue = instance;
return false;
}
if ( !instance ) {
return $.error( "cannot call methods on " + name + " prior to initialization; " +
"attempted to call method '" + options + "'" );
}
if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
return $.error( "no such method '" + options + "' for " + name + " widget instance" );
}
methodValue = instance[ options ].apply( instance, args );
if ( methodValue !== instance && methodValue !== undefined ) {
returnValue = methodValue && methodValue.jquery ?
returnValue.pushStack( methodValue.get() ) :
methodValue;
return false;
}
});
} else {
// Allow multiple hashes to be passed on init
if ( args.length ) {
options = $.widget.extend.apply( null, [ options ].concat(args) );
}
this.each(function() {
var instance = $.data( this, fullName );
if ( instance ) {
instance.option( options || {} );
if ( instance._init ) {
instance._init();
}
} else {
$.data( this, fullName, new object( options, this ) );
}
});
}
return returnValue;
};
};
$.Widget = function( /* options, element */ ) {};
$.Widget._childConstructors = [];
$.Widget.prototype = {
widgetName: "widget",
widgetEventPrefix: "",
defaultElement: "<div>",
options: {
disabled: false,
// callbacks
create: null
},
_createWidget: function( options, element ) {
element = $( element || this.defaultElement || this )[ 0 ];
this.element = $( element );
this.uuid = widget_uuid++;
this.eventNamespace = "." + this.widgetName + this.uuid;
this.bindings = $();
this.hoverable = $();
this.focusable = $();
if ( element !== this ) {
$.data( element, this.widgetFullName, this );
this._on( true, this.element, {
remove: function( event ) {
if ( event.target === element ) {
this.destroy();
}
}
});
this.document = $( element.style ?
// element within the document
element.ownerDocument :
// element is window or document
element.document || element );
this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
}
this.options = $.widget.extend( {},
this.options,
this._getCreateOptions(),
options );
this._create();
this._trigger( "create", null, this._getCreateEventData() );
this._init();
},
_getCreateOptions: $.noop,
_getCreateEventData: $.noop,
_create: $.noop,
_init: $.noop,
destroy: function() {
this._destroy();
// we can probably remove the unbind calls in 2.0
// all event bindings should go through this._on()
this.element
.unbind( this.eventNamespace )
.removeData( this.widgetFullName )
// support: jquery <1.6.3
// http://bugs.jquery.com/ticket/9413
.removeData( $.camelCase( this.widgetFullName ) );
this.widget()
.unbind( this.eventNamespace )
.removeAttr( "aria-disabled" )
.removeClass(
this.widgetFullName + "-disabled " +
"ui-state-disabled" );
// clean up events and states
this.bindings.unbind( this.eventNamespace );
this.hoverable.removeClass( "ui-state-hover" );
this.focusable.removeClass( "ui-state-focus" );
},
_destroy: $.noop,
widget: function() {
return this.element;
},
option: function( key, value ) {
var options = key,
parts,
curOption,
i;
if ( arguments.length === 0 ) {
// don't return a reference to the internal hash
return $.widget.extend( {}, this.options );
}
if ( typeof key === "string" ) {
// handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
options = {};
parts = key.split( "." );
key = parts.shift();
if ( parts.length ) {
curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
for ( i = 0; i < parts.length - 1; i++ ) {
curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
curOption = curOption[ parts[ i ] ];
}
key = parts.pop();
if ( arguments.length === 1 ) {
return curOption[ key ] === undefined ? null : curOption[ key ];
}
curOption[ key ] = value;
} else {
if ( arguments.length === 1 ) {
return this.options[ key ] === undefined ? null : this.options[ key ];
}
options[ key ] = value;
}
}
this._setOptions( options );
return this;
},
_setOptions: function( options ) {
var key;
for ( key in options ) {
this._setOption( key, options[ key ] );
}
return this;
},
_setOption: function( key, value ) {
this.options[ key ] = value;
if ( key === "disabled" ) {
this.widget()
.toggleClass( this.widgetFullName + "-disabled", !!value );
// If the widget is becoming disabled, then nothing is interactive
if ( value ) {
this.hoverable.removeClass( "ui-state-hover" );
this.focusable.removeClass( "ui-state-focus" );
}
}
return this;
},
enable: function() {
return this._setOptions({ disabled: false });
},
disable: function() {
return this._setOptions({ disabled: true });
},
_on: function( suppressDisabledCheck, element, handlers ) {
var delegateElement,
instance = this;
// no suppressDisabledCheck flag, shuffle arguments
if ( typeof suppressDisabledCheck !== "boolean" ) {
handlers = element;
element = suppressDisabledCheck;
suppressDisabledCheck = false;
}
// no element argument, shuffle and use this.element
if ( !handlers ) {
handlers = element;
element = this.element;
delegateElement = this.widget();
} else {
element = delegateElement = $( element );
this.bindings = this.bindings.add( element );
}
$.each( handlers, function( event, handler ) {
function handlerProxy() {
// allow widgets to customize the disabled handling
// - disabled as an array instead of boolean
// - disabled class as method for disabling individual parts
if ( !suppressDisabledCheck &&
( instance.options.disabled === true ||
$( this ).hasClass( "ui-state-disabled" ) ) ) {
return;
}
return ( typeof handler === "string" ? instance[ handler ] : handler )
.apply( instance, arguments );
}
// copy the guid so direct unbinding works
if ( typeof handler !== "string" ) {
handlerProxy.guid = handler.guid =
handler.guid || handlerProxy.guid || $.guid++;
}
var match = event.match( /^([\w:-]*)\s*(.*)$/ ),
eventName = match[1] + instance.eventNamespace,
selector = match[2];
if ( selector ) {
delegateElement.delegate( selector, eventName, handlerProxy );
} else {
element.bind( eventName, handlerProxy );
}
});
},
_off: function( element, eventName ) {
eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) +
this.eventNamespace;
element.unbind( eventName ).undelegate( eventName );
// Clear the stack to avoid memory leaks (#10056)
this.bindings = $( this.bindings.not( element ).get() );
this.focusable = $( this.focusable.not( element ).get() );
this.hoverable = $( this.hoverable.not( element ).get() );
},
_delay: function( handler, delay ) {
function handlerProxy() {
return ( typeof handler === "string" ? instance[ handler ] : handler )
.apply( instance, arguments );
}
var instance = this;
return setTimeout( handlerProxy, delay || 0 );
},
_hoverable: function( element ) {
this.hoverable = this.hoverable.add( element );
this._on( element, {
mouseenter: function( event ) {
$( event.currentTarget ).addClass( "ui-state-hover" );
},
mouseleave: function( event ) {
$( event.currentTarget ).removeClass( "ui-state-hover" );
}
});
},
_focusable: function( element ) {
this.focusable = this.focusable.add( element );
this._on( element, {
focusin: function( event ) {
$( event.currentTarget ).addClass( "ui-state-focus" );
},
focusout: function( event ) {
$( event.currentTarget ).removeClass( "ui-state-focus" );
}
});
},
_trigger: function( type, event, data ) {
var prop, orig,
callback = this.options[ type ];
data = data || {};
event = $.Event( event );
event.type = ( type === this.widgetEventPrefix ?
type :
this.widgetEventPrefix + type ).toLowerCase();
// the original event may come from any element
// so we need to reset the target on the new event
event.target = this.element[ 0 ];
// copy original event properties over to the new event
orig = event.originalEvent;
if ( orig ) {
for ( prop in orig ) {
if ( !( prop in event ) ) {
event[ prop ] = orig[ prop ];
}
}
}
this.element.trigger( event, data );
return !( $.isFunction( callback ) &&
callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
event.isDefaultPrevented() );
}
};
$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
if ( typeof options === "string" ) {
options = { effect: options };
}
var hasOptions,
effectName = !options ?
method :
options === true || typeof options === "number" ?
defaultEffect :
options.effect || defaultEffect;
options = options || {};
if ( typeof options === "number" ) {
options = { duration: options };
}
hasOptions = !$.isEmptyObject( options );
options.complete = callback;
if ( options.delay ) {
element.delay( options.delay );
}
if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
element[ method ]( options );
} else if ( effectName !== method && element[ effectName ] ) {
element[ effectName ]( options.duration, options.easing, callback );
} else {
element.queue(function( next ) {
$( this )[ method ]();
if ( callback ) {
callback.call( element[ 0 ] );
}
next();
});
}
};
});
var widget = $.widget;
}));
@@ -0,0 +1,51 @@
{
"name": "blueimp-file-upload",
"version": "9.12.3",
"title": "jQuery File Upload",
"description": "File Upload widget with multiple file selection, drag&amp;drop support, progress bar, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (Google App Engine, PHP, Python, Ruby on Rails, Java, etc.) that supports standard HTML form file uploads.",
"keywords": [
"jquery",
"file",
"upload",
"widget",
"multiple",
"selection",
"drag",
"drop",
"progress",
"preview",
"cross-domain",
"cross-site",
"chunk",
"resume",
"gae",
"go",
"python",
"php",
"bootstrap"
],
"homepage": "https://github.com/blueimp/jQuery-File-Upload",
"author": {
"name": "Sebastian Tschan",
"url": "https://blueimp.net"
},
"maintainers": [
{
"name": "Sebastian Tschan",
"url": "https://blueimp.net"
}
],
"repository": {
"type": "git",
"url": "git://github.com/blueimp/jQuery-File-Upload.git"
},
"bugs": "https://github.com/blueimp/jQuery-File-Upload/issues",
"license": "MIT",
"main": "js/jquery.fileupload.js",
"devDependencies": {
"bower-json": "0.6.0",
"grunt": "0.4.5",
"grunt-bump-build-git": "1.1.2",
"grunt-contrib-jshint": "0.11.2"
}
}
@@ -0,0 +1,71 @@
@charset "UTF-8";
/*
* blueimp Gallery Indicator CSS
* https://github.com/blueimp/Gallery
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
.blueimp-gallery > .indicator {
position: absolute;
top: auto;
right: 15px;
bottom: 15px;
left: 15px;
margin: 0 40px;
padding: 0;
list-style: none;
text-align: center;
line-height: 10px;
display: none;
}
.blueimp-gallery > .indicator > li {
display: inline-block;
width: 9px;
height: 9px;
margin: 6px 3px 0 3px;
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
border: 1px solid transparent;
background: #ccc;
background: rgba(255, 255, 255, 0.25) center no-repeat;
border-radius: 5px;
box-shadow: 0 0 2px #000;
opacity: 0.5;
cursor: pointer;
}
.blueimp-gallery > .indicator > li:hover,
.blueimp-gallery > .indicator > .active {
background-color: #fff;
border-color: #fff;
opacity: 1;
}
.blueimp-gallery-controls > .indicator {
display: block;
/* Fix z-index issues (controls behind slide element) on Android: */
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
-o-transform: translateZ(0);
transform: translateZ(0);
}
.blueimp-gallery-single > .indicator {
display: none;
}
.blueimp-gallery > .indicator {
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
/* IE7 fixes */
*+html .blueimp-gallery > .indicator > li {
display: inline;
}
@@ -0,0 +1,87 @@
@charset "UTF-8";
/*
* blueimp Gallery Video Factory CSS
* https://github.com/blueimp/Gallery
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
.blueimp-gallery > .slides > .slide > .video-content > img {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
margin: auto;
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
/* Prevent artifacts in Mozilla Firefox: */
-moz-backface-visibility: hidden;
}
.blueimp-gallery > .slides > .slide > .video-content > video {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
.blueimp-gallery > .slides > .slide > .video-content > iframe {
position: absolute;
top: 100%;
left: 0;
width: 100%;
height: 100%;
border: none;
}
.blueimp-gallery > .slides > .slide > .video-playing > iframe {
top: 0;
}
.blueimp-gallery > .slides > .slide > .video-content > a {
position: absolute;
top: 50%;
right: 0;
left: 0;
margin: -64px auto 0;
width: 128px;
height: 128px;
background: url(../img/video-play.png) center no-repeat;
opacity: 0.8;
cursor: pointer;
}
.blueimp-gallery > .slides > .slide > .video-content > a:hover {
opacity: 1;
}
.blueimp-gallery > .slides > .slide > .video-playing > a,
.blueimp-gallery > .slides > .slide > .video-playing > img {
display: none;
}
.blueimp-gallery > .slides > .slide > .video-content > video {
display: none;
}
.blueimp-gallery > .slides > .slide > .video-playing > video {
display: block;
}
.blueimp-gallery > .slides > .slide > .video-loading > a {
background: url(../img/loading.gif) center no-repeat;
background-size: 64px 64px;
}
/* Replace PNGs with SVGs for capable browsers (excluding IE<9) */
body:last-child .blueimp-gallery > .slides > .slide > .video-content:not(.video-loading) > a {
background-image: url(../img/video-play.svg);
}
/* IE7 fixes */
*+html .blueimp-gallery > .slides > .slide > .video-content {
height: 100%;
}
*+html .blueimp-gallery > .slides > .slide > .video-content > a {
left: 50%;
margin-left: -64px;
}
@@ -0,0 +1,226 @@
@charset "UTF-8";
/*
* blueimp Gallery CSS
* https://github.com/blueimp/Gallery
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
.blueimp-gallery,
.blueimp-gallery > .slides > .slide > .slide-content {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
/* Prevent artifacts in Mozilla Firefox: */
-moz-backface-visibility: hidden;
}
.blueimp-gallery > .slides > .slide > .slide-content {
margin: auto;
width: auto;
height: auto;
max-width: 100%;
max-height: 100%;
opacity: 1;
}
.blueimp-gallery {
position: fixed;
z-index: 999999;
overflow: hidden;
background: #000;
background: rgba(0, 0, 0, 0.9);
opacity: 0;
display: none;
direction: ltr;
-ms-touch-action: none;
touch-action: none;
}
.blueimp-gallery-carousel {
position: relative;
z-index: auto;
margin: 1em auto;
/* Set the carousel width/height ratio to 16/9: */
padding-bottom: 56.25%;
box-shadow: 0 0 10px #000;
-ms-touch-action: pan-y;
touch-action: pan-y;
}
.blueimp-gallery-display {
display: block;
opacity: 1;
}
.blueimp-gallery > .slides {
position: relative;
height: 100%;
overflow: hidden;
}
.blueimp-gallery-carousel > .slides {
position: absolute;
}
.blueimp-gallery > .slides > .slide {
position: relative;
float: left;
height: 100%;
text-align: center;
-webkit-transition-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1.000);
-moz-transition-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1.000);
-ms-transition-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1.000);
-o-transition-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1.000);
transition-timing-function: cubic-bezier(0.645, 0.045, 0.355, 1.000);
}
.blueimp-gallery,
.blueimp-gallery > .slides > .slide > .slide-content {
-webkit-transition: opacity 0.5s linear;
-moz-transition: opacity 0.5s linear;
-ms-transition: opacity 0.5s linear;
-o-transition: opacity 0.5s linear;
transition: opacity 0.5s linear;
}
.blueimp-gallery > .slides > .slide-loading {
background: url(../img/loading.gif) center no-repeat;
background-size: 64px 64px;
}
.blueimp-gallery > .slides > .slide-loading > .slide-content {
opacity: 0;
}
.blueimp-gallery > .slides > .slide-error {
background: url(../img/error.png) center no-repeat;
}
.blueimp-gallery > .slides > .slide-error > .slide-content {
display: none;
}
.blueimp-gallery > .prev,
.blueimp-gallery > .next {
position: absolute;
top: 50%;
left: 15px;
width: 40px;
height: 40px;
margin-top: -23px;
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 60px;
font-weight: 100;
line-height: 30px;
color: #fff;
text-decoration: none;
text-shadow: 0 0 2px #000;
text-align: center;
background: #222;
background: rgba(0, 0, 0, 0.5);
-webkit-box-sizing: content-box;
-moz-box-sizing: content-box;
box-sizing: content-box;
border: 3px solid #fff;
-webkit-border-radius: 23px;
-moz-border-radius: 23px;
border-radius: 23px;
opacity: 0.5;
cursor: pointer;
display: none;
}
.blueimp-gallery > .next {
left: auto;
right: 15px;
}
.blueimp-gallery > .close,
.blueimp-gallery > .title {
position: absolute;
top: 15px;
left: 15px;
margin: 0 40px 0 0;
font-size: 20px;
line-height: 30px;
color: #fff;
text-shadow: 0 0 2px #000;
opacity: 0.8;
display: none;
}
.blueimp-gallery > .close {
padding: 15px;
right: 15px;
left: auto;
margin: -15px;
font-size: 30px;
text-decoration: none;
cursor: pointer;
}
.blueimp-gallery > .play-pause {
position: absolute;
right: 15px;
bottom: 15px;
width: 15px;
height: 15px;
background: url(../img/play-pause.png) 0 0 no-repeat;
cursor: pointer;
opacity: 0.5;
display: none;
}
.blueimp-gallery-playing > .play-pause {
background-position: -15px 0;
}
.blueimp-gallery > .prev:hover,
.blueimp-gallery > .next:hover,
.blueimp-gallery > .close:hover,
.blueimp-gallery > .title:hover,
.blueimp-gallery > .play-pause:hover {
color: #fff;
opacity: 1;
}
.blueimp-gallery-controls > .prev,
.blueimp-gallery-controls > .next,
.blueimp-gallery-controls > .close,
.blueimp-gallery-controls > .title,
.blueimp-gallery-controls > .play-pause {
display: block;
/* Fix z-index issues (controls behind slide element) on Android: */
-webkit-transform: translateZ(0);
-moz-transform: translateZ(0);
-ms-transform: translateZ(0);
-o-transform: translateZ(0);
transform: translateZ(0);
}
.blueimp-gallery-single > .prev,
.blueimp-gallery-left > .prev,
.blueimp-gallery-single > .next,
.blueimp-gallery-right > .next,
.blueimp-gallery-single > .play-pause {
display: none;
}
.blueimp-gallery > .slides > .slide > .slide-content,
.blueimp-gallery > .prev,
.blueimp-gallery > .next,
.blueimp-gallery > .close,
.blueimp-gallery > .play-pause {
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
/* Replace PNGs with SVGs for capable browsers (excluding IE<9) */
body:last-child .blueimp-gallery > .slides > .slide-error {
background-image: url(../img/error.svg);
}
body:last-child .blueimp-gallery > .play-pause {
width: 20px;
height: 20px;
background-size: 40px 20px;
background-image: url(../img/play-pause.svg);
}
body:last-child .blueimp-gallery-playing > .play-pause {
background-position: -20px 0;
}
/* IE7 fixes */
*+html .blueimp-gallery > .slides > .slide {
min-height: 300px;
}
*+html .blueimp-gallery > .slides > .slide > .slide-content {
position: relative;
}
@@ -0,0 +1,3 @@
@import (inline) 'blueimp-gallery.css';
@import (inline) 'blueimp-gallery-indicator.css';
@import (inline) 'blueimp-gallery-video.css';
File diff suppressed because one or more lines are too long
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
<circle cx="32" cy="32" r="25" stroke="red" stroke-width="7" fill="black" fill-opacity="0.2"/>
<rect x="28" y="7" width="8" height="50" fill="red" transform="rotate(45, 32, 32)"/>
</svg>

After

Width:  |  Height:  |  Size: 306 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 606 B

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="30" height="15">
<polygon points="2,1 2,14 13,7" stroke="black" stroke-width="1" fill="white"/>
<rect x="17" y="2" width="4" height="11" stroke="black" stroke-width="1" fill="white"/>
<rect x="24" y="2" width="4" height="11" stroke="black" stroke-width="1" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 382 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="64" height="64">
<circle cx="32" cy="32" r="25" stroke="white" stroke-width="7" fill="black" fill-opacity="0.2"/>
<polygon points="26,22 26,42 43,32" fill="white"/>
</svg>

After

Width:  |  Height:  |  Size: 274 B

@@ -0,0 +1,89 @@
/*
* blueimp Gallery Fullscreen JS
* https://github.com/blueimp/Gallery
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* global define, window, document */
;(function (factory) {
'use strict'
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'./blueimp-helper',
'./blueimp-gallery'
], factory)
} else {
// Browser globals:
factory(
window.blueimp.helper || window.jQuery,
window.blueimp.Gallery
)
}
}(function ($, Gallery) {
'use strict'
$.extend(Gallery.prototype.options, {
// Defines if the gallery should open in fullscreen mode:
fullScreen: false
})
var initialize = Gallery.prototype.initialize
var close = Gallery.prototype.close
$.extend(Gallery.prototype, {
getFullScreenElement: function () {
return document.fullscreenElement ||
document.webkitFullscreenElement ||
document.mozFullScreenElement ||
document.msFullscreenElement
},
requestFullScreen: function (element) {
if (element.requestFullscreen) {
element.requestFullscreen()
} else if (element.webkitRequestFullscreen) {
element.webkitRequestFullscreen()
} else if (element.mozRequestFullScreen) {
element.mozRequestFullScreen()
} else if (element.msRequestFullscreen) {
element.msRequestFullscreen()
}
},
exitFullScreen: function () {
if (document.exitFullscreen) {
document.exitFullscreen()
} else if (document.webkitCancelFullScreen) {
document.webkitCancelFullScreen()
} else if (document.mozCancelFullScreen) {
document.mozCancelFullScreen()
} else if (document.msExitFullscreen) {
document.msExitFullscreen()
}
},
initialize: function () {
initialize.call(this)
if (this.options.fullScreen && !this.getFullScreenElement()) {
this.requestFullScreen(this.container[0])
}
},
close: function () {
if (this.getFullScreenElement() === this.container[0]) {
this.exitFullScreen()
}
close.call(this)
}
})
return Gallery
}))
@@ -0,0 +1,155 @@
/*
* blueimp Gallery Indicator JS
* https://github.com/blueimp/Gallery
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* global define, window, document */
;(function (factory) {
'use strict'
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'./blueimp-helper',
'./blueimp-gallery'
], factory)
} else {
// Browser globals:
factory(
window.blueimp.helper || window.jQuery,
window.blueimp.Gallery
)
}
}(function ($, Gallery) {
'use strict'
$.extend(Gallery.prototype.options, {
// The tag name, Id, element or querySelector of the indicator container:
indicatorContainer: 'ol',
// The class for the active indicator:
activeIndicatorClass: 'active',
// The list object property (or data attribute) with the thumbnail URL,
// used as alternative to a thumbnail child element:
thumbnailProperty: 'thumbnail',
// Defines if the gallery indicators should display a thumbnail:
thumbnailIndicators: true
})
var initSlides = Gallery.prototype.initSlides
var addSlide = Gallery.prototype.addSlide
var resetSlides = Gallery.prototype.resetSlides
var handleClick = Gallery.prototype.handleClick
var handleSlide = Gallery.prototype.handleSlide
var handleClose = Gallery.prototype.handleClose
$.extend(Gallery.prototype, {
createIndicator: function (obj) {
var indicator = this.indicatorPrototype.cloneNode(false)
var title = this.getItemProperty(obj, this.options.titleProperty)
var thumbnailProperty = this.options.thumbnailProperty
var thumbnailUrl
var thumbnail
if (this.options.thumbnailIndicators) {
if (thumbnailProperty) {
thumbnailUrl = this.getItemProperty(obj, thumbnailProperty)
}
if (thumbnailUrl === undefined) {
thumbnail = obj.getElementsByTagName && $(obj).find('img')[0]
if (thumbnail) {
thumbnailUrl = thumbnail.src
}
}
if (thumbnailUrl) {
indicator.style.backgroundImage = 'url("' + thumbnailUrl + '")'
}
}
if (title) {
indicator.title = title
}
return indicator
},
addIndicator: function (index) {
if (this.indicatorContainer.length) {
var indicator = this.createIndicator(this.list[index])
indicator.setAttribute('data-index', index)
this.indicatorContainer[0].appendChild(indicator)
this.indicators.push(indicator)
}
},
setActiveIndicator: function (index) {
if (this.indicators) {
if (this.activeIndicator) {
this.activeIndicator
.removeClass(this.options.activeIndicatorClass)
}
this.activeIndicator = $(this.indicators[index])
this.activeIndicator
.addClass(this.options.activeIndicatorClass)
}
},
initSlides: function (reload) {
if (!reload) {
this.indicatorContainer = this.container.find(
this.options.indicatorContainer
)
if (this.indicatorContainer.length) {
this.indicatorPrototype = document.createElement('li')
this.indicators = this.indicatorContainer[0].children
}
}
initSlides.call(this, reload)
},
addSlide: function (index) {
addSlide.call(this, index)
this.addIndicator(index)
},
resetSlides: function () {
resetSlides.call(this)
this.indicatorContainer.empty()
this.indicators = []
},
handleClick: function (event) {
var target = event.target || event.srcElement
var parent = target.parentNode
if (parent === this.indicatorContainer[0]) {
// Click on indicator element
this.preventDefault(event)
this.slide(this.getNodeIndex(target))
} else if (parent.parentNode === this.indicatorContainer[0]) {
// Click on indicator child element
this.preventDefault(event)
this.slide(this.getNodeIndex(parent))
} else {
return handleClick.call(this, event)
}
},
handleSlide: function (index) {
handleSlide.call(this, index)
this.setActiveIndicator(index)
},
handleClose: function () {
if (this.activeIndicator) {
this.activeIndicator
.removeClass(this.options.activeIndicatorClass)
}
handleClose.call(this)
}
})
return Gallery
}))
@@ -0,0 +1,170 @@
/*
* blueimp Gallery Video Factory JS
* https://github.com/blueimp/Gallery
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* global define, window, document */
;(function (factory) {
'use strict'
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'./blueimp-helper',
'./blueimp-gallery'
], factory)
} else {
// Browser globals:
factory(
window.blueimp.helper || window.jQuery,
window.blueimp.Gallery
)
}
}(function ($, Gallery) {
'use strict'
$.extend(Gallery.prototype.options, {
// The class for video content elements:
videoContentClass: 'video-content',
// The class for video when it is loading:
videoLoadingClass: 'video-loading',
// The class for video when it is playing:
videoPlayingClass: 'video-playing',
// The list object property (or data attribute) for the video poster URL:
videoPosterProperty: 'poster',
// The list object property (or data attribute) for the video sources array:
videoSourcesProperty: 'sources'
})
var handleSlide = Gallery.prototype.handleSlide
$.extend(Gallery.prototype, {
handleSlide: function (index) {
handleSlide.call(this, index)
if (this.playingVideo) {
this.playingVideo.pause()
}
},
videoFactory: function (obj, callback, videoInterface) {
var that = this
var options = this.options
var videoContainerNode = this.elementPrototype.cloneNode(false)
var videoContainer = $(videoContainerNode)
var errorArgs = [{
type: 'error',
target: videoContainerNode
}]
var video = videoInterface || document.createElement('video')
var url = this.getItemProperty(obj, options.urlProperty)
var type = this.getItemProperty(obj, options.typeProperty)
var title = this.getItemProperty(obj, options.titleProperty)
var posterUrl = this.getItemProperty(obj, options.videoPosterProperty)
var posterImage
var sources = this.getItemProperty(
obj,
options.videoSourcesProperty
)
var source
var playMediaControl
var isLoading
var hasControls
videoContainer.addClass(options.videoContentClass)
if (title) {
videoContainerNode.title = title
}
if (video.canPlayType) {
if (url && type && video.canPlayType(type)) {
video.src = url
} else {
while (sources && sources.length) {
source = sources.shift()
url = this.getItemProperty(source, options.urlProperty)
type = this.getItemProperty(source, options.typeProperty)
if (url && type && video.canPlayType(type)) {
video.src = url
break
}
}
}
}
if (posterUrl) {
video.poster = posterUrl
posterImage = this.imagePrototype.cloneNode(false)
$(posterImage).addClass(options.toggleClass)
posterImage.src = posterUrl
posterImage.draggable = false
videoContainerNode.appendChild(posterImage)
}
playMediaControl = document.createElement('a')
playMediaControl.setAttribute('target', '_blank')
if (!videoInterface) {
playMediaControl.setAttribute('download', title)
}
playMediaControl.href = url
if (video.src) {
video.controls = true
;(videoInterface || $(video))
.on('error', function () {
that.setTimeout(callback, errorArgs)
})
.on('pause', function () {
isLoading = false
videoContainer
.removeClass(that.options.videoLoadingClass)
.removeClass(that.options.videoPlayingClass)
if (hasControls) {
that.container.addClass(that.options.controlsClass)
}
delete that.playingVideo
if (that.interval) {
that.play()
}
})
.on('playing', function () {
isLoading = false
videoContainer
.removeClass(that.options.videoLoadingClass)
.addClass(that.options.videoPlayingClass)
if (that.container.hasClass(that.options.controlsClass)) {
hasControls = true
that.container.removeClass(that.options.controlsClass)
} else {
hasControls = false
}
})
.on('play', function () {
window.clearTimeout(that.timeout)
isLoading = true
videoContainer.addClass(that.options.videoLoadingClass)
that.playingVideo = video
})
$(playMediaControl).on('click', function (event) {
that.preventDefault(event)
if (isLoading) {
video.pause()
} else {
video.play()
}
})
videoContainerNode.appendChild(
(videoInterface && videoInterface.element) || video
)
}
videoContainerNode.appendChild(playMediaControl)
this.setTimeout(callback, [{
type: 'load',
target: videoContainerNode
}])
return videoContainerNode
}
})
return Gallery
}))
@@ -0,0 +1,213 @@
/*
* blueimp Gallery Vimeo Video Factory JS
* https://github.com/blueimp/Gallery
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* global define, window, document, $f */
;(function (factory) {
'use strict'
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'./blueimp-helper',
'./blueimp-gallery-video'
], factory)
} else {
// Browser globals:
factory(
window.blueimp.helper || window.jQuery,
window.blueimp.Gallery
)
}
}(function ($, Gallery) {
'use strict'
if (!window.postMessage) {
return Gallery
}
$.extend(Gallery.prototype.options, {
// The list object property (or data attribute) with the Vimeo video id:
vimeoVideoIdProperty: 'vimeo',
// The URL for the Vimeo video player, can be extended with custom parameters:
// https://developer.vimeo.com/player/embedding
vimeoPlayerUrl: '//player.vimeo.com/video/VIDEO_ID?api=1&player_id=PLAYER_ID',
// The prefix for the Vimeo video player ID:
vimeoPlayerIdPrefix: 'vimeo-player-',
// Require a click on the native Vimeo player for the initial playback:
vimeoClickToPlay: true
})
var textFactory = Gallery.prototype.textFactory ||
Gallery.prototype.imageFactory
var VimeoPlayer = function (url, videoId, playerId, clickToPlay) {
this.url = url
this.videoId = videoId
this.playerId = playerId
this.clickToPlay = clickToPlay
this.element = document.createElement('div')
this.listeners = {}
}
var counter = 0
$.extend(VimeoPlayer.prototype, {
canPlayType: function () {
return true
},
on: function (type, func) {
this.listeners[type] = func
return this
},
loadAPI: function () {
var that = this
var apiUrl = '//f.vimeocdn.com/js/froogaloop2.min.js'
var scriptTags = document.getElementsByTagName('script')
var i = scriptTags.length
var scriptTag
var called
function callback () {
if (!called && that.playOnReady) {
that.play()
}
called = true
}
while (i) {
i -= 1
if (scriptTags[i].src === apiUrl) {
scriptTag = scriptTags[i]
break
}
}
if (!scriptTag) {
scriptTag = document.createElement('script')
scriptTag.src = apiUrl
}
$(scriptTag).on('load', callback)
scriptTags[0].parentNode.insertBefore(scriptTag, scriptTags[0])
// Fix for cached scripts on IE 8:
if (/loaded|complete/.test(scriptTag.readyState)) {
callback()
}
},
onReady: function () {
var that = this
this.ready = true
this.player.addEvent('play', function () {
that.hasPlayed = true
that.onPlaying()
})
this.player.addEvent('pause', function () {
that.onPause()
})
this.player.addEvent('finish', function () {
that.onPause()
})
if (this.playOnReady) {
this.play()
}
},
onPlaying: function () {
if (this.playStatus < 2) {
this.listeners.playing()
this.playStatus = 2
}
},
onPause: function () {
this.listeners.pause()
delete this.playStatus
},
insertIframe: function () {
var iframe = document.createElement('iframe')
iframe.src = this.url
.replace('VIDEO_ID', this.videoId)
.replace('PLAYER_ID', this.playerId)
iframe.id = this.playerId
this.element.parentNode.replaceChild(iframe, this.element)
this.element = iframe
},
play: function () {
var that = this
if (!this.playStatus) {
this.listeners.play()
this.playStatus = 1
}
if (this.ready) {
if (!this.hasPlayed && (this.clickToPlay || (window.navigator &&
/iP(hone|od|ad)/.test(window.navigator.platform)))) {
// Manually trigger the playing callback if clickToPlay
// is enabled and to workaround a limitation in iOS,
// which requires synchronous user interaction to start
// the video playback:
this.onPlaying()
} else {
this.player.api('play')
}
} else {
this.playOnReady = true
if (!window.$f) {
this.loadAPI()
} else if (!this.player) {
this.insertIframe()
this.player = $f(this.element)
this.player.addEvent('ready', function () {
that.onReady()
})
}
}
},
pause: function () {
if (this.ready) {
this.player.api('pause')
} else if (this.playStatus) {
delete this.playOnReady
this.listeners.pause()
delete this.playStatus
}
}
})
$.extend(Gallery.prototype, {
VimeoPlayer: VimeoPlayer,
textFactory: function (obj, callback) {
var options = this.options
var videoId = this.getItemProperty(obj, options.vimeoVideoIdProperty)
if (videoId) {
if (this.getItemProperty(obj, options.urlProperty) === undefined) {
obj[options.urlProperty] = '//vimeo.com/' + videoId
}
counter += 1
return this.videoFactory(
obj,
callback,
new VimeoPlayer(
options.vimeoPlayerUrl,
videoId,
options.vimeoPlayerIdPrefix + counter,
options.vimeoClickToPlay
)
)
}
return textFactory.call(this, obj, callback)
}
})
return Gallery
}))
@@ -0,0 +1,228 @@
/*
* blueimp Gallery YouTube Video Factory JS
* https://github.com/blueimp/Gallery
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* global define, window, document, YT */
;(function (factory) {
'use strict'
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define([
'./blueimp-helper',
'./blueimp-gallery-video'
], factory)
} else {
// Browser globals:
factory(
window.blueimp.helper || window.jQuery,
window.blueimp.Gallery
)
}
}(function ($, Gallery) {
'use strict'
if (!window.postMessage) {
return Gallery
}
$.extend(Gallery.prototype.options, {
// The list object property (or data attribute) with the YouTube video id:
youTubeVideoIdProperty: 'youtube',
// Optional object with parameters passed to the YouTube video player:
// https://developers.google.com/youtube/player_parameters
youTubePlayerVars: {
wmode: 'transparent'
},
// Require a click on the native YouTube player for the initial playback:
youTubeClickToPlay: true
})
var textFactory = Gallery.prototype.textFactory ||
Gallery.prototype.imageFactory
var YouTubePlayer = function (videoId, playerVars, clickToPlay) {
this.videoId = videoId
this.playerVars = playerVars
this.clickToPlay = clickToPlay
this.element = document.createElement('div')
this.listeners = {}
}
$.extend(YouTubePlayer.prototype, {
canPlayType: function () {
return true
},
on: function (type, func) {
this.listeners[type] = func
return this
},
loadAPI: function () {
var that = this
var onYouTubeIframeAPIReady = window.onYouTubeIframeAPIReady
var apiUrl = '//www.youtube.com/iframe_api'
var scriptTags = document.getElementsByTagName('script')
var i = scriptTags.length
var scriptTag
window.onYouTubeIframeAPIReady = function () {
if (onYouTubeIframeAPIReady) {
onYouTubeIframeAPIReady.apply(this)
}
if (that.playOnReady) {
that.play()
}
}
while (i) {
i -= 1
if (scriptTags[i].src === apiUrl) {
return
}
}
scriptTag = document.createElement('script')
scriptTag.src = apiUrl
scriptTags[0].parentNode.insertBefore(scriptTag, scriptTags[0])
},
onReady: function () {
this.ready = true
if (this.playOnReady) {
this.play()
}
},
onPlaying: function () {
if (this.playStatus < 2) {
this.listeners.playing()
this.playStatus = 2
}
},
onPause: function () {
Gallery.prototype.setTimeout.call(
this,
this.checkSeek,
null,
2000
)
},
checkSeek: function () {
if (this.stateChange === YT.PlayerState.PAUSED ||
this.stateChange === YT.PlayerState.ENDED) {
// check if current state change is actually paused
this.listeners.pause()
delete this.playStatus
}
},
onStateChange: function (event) {
switch (event.data) {
case YT.PlayerState.PLAYING:
this.hasPlayed = true
this.onPlaying()
break
case YT.PlayerState.PAUSED:
case YT.PlayerState.ENDED:
this.onPause()
break
}
// Save most recent state change to this.stateChange
this.stateChange = event.data
},
onError: function (event) {
this.listeners.error(event)
},
play: function () {
var that = this
if (!this.playStatus) {
this.listeners.play()
this.playStatus = 1
}
if (this.ready) {
if (!this.hasPlayed && (this.clickToPlay || (window.navigator &&
/iP(hone|od|ad)/.test(window.navigator.platform)))) {
// Manually trigger the playing callback if clickToPlay
// is enabled and to workaround a limitation in iOS,
// which requires synchronous user interaction to start
// the video playback:
this.onPlaying()
} else {
this.player.playVideo()
}
} else {
this.playOnReady = true
if (!(window.YT && YT.Player)) {
this.loadAPI()
} else if (!this.player) {
this.player = new YT.Player(this.element, {
videoId: this.videoId,
playerVars: this.playerVars,
events: {
onReady: function () {
that.onReady()
},
onStateChange: function (event) {
that.onStateChange(event)
},
onError: function (event) {
that.onError(event)
}
}
})
}
}
},
pause: function () {
if (this.ready) {
this.player.pauseVideo()
} else if (this.playStatus) {
delete this.playOnReady
this.listeners.pause()
delete this.playStatus
}
}
})
$.extend(Gallery.prototype, {
YouTubePlayer: YouTubePlayer,
textFactory: function (obj, callback) {
var options = this.options
var videoId = this.getItemProperty(obj, options.youTubeVideoIdProperty)
if (videoId) {
if (this.getItemProperty(obj, options.urlProperty) === undefined) {
obj[options.urlProperty] = '//www.youtube.com/watch?v=' + videoId
}
if (this.getItemProperty(obj, options.videoPosterProperty) === undefined) {
obj[options.videoPosterProperty] = '//img.youtube.com/vi/' + videoId +
'/maxresdefault.jpg'
}
return this.videoFactory(
obj,
callback,
new YouTubePlayer(
videoId,
options.youTubePlayerVars,
options.youTubeClickToPlay
)
)
}
return textFactory.call(this, obj, callback)
}
})
return Gallery
}))
File diff suppressed because it is too large Load Diff
File diff suppressed because one or more lines are too long
@@ -0,0 +1,190 @@
/*
* blueimp helper JS
* https://github.com/blueimp/Gallery
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* global define, window, document */
;(function () {
'use strict'
function extend (obj1, obj2) {
var prop
for (prop in obj2) {
if (obj2.hasOwnProperty(prop)) {
obj1[prop] = obj2[prop]
}
}
return obj1
}
function Helper (query) {
if (!this || this.find !== Helper.prototype.find) {
// Called as function instead of as constructor,
// so we simply return a new instance:
return new Helper(query)
}
this.length = 0
if (query) {
if (typeof query === 'string') {
query = this.find(query)
}
if (query.nodeType || query === query.window) {
// Single HTML element
this.length = 1
this[0] = query
} else {
// HTML element collection
var i = query.length
this.length = i
while (i) {
i -= 1
this[i] = query[i]
}
}
}
}
Helper.extend = extend
Helper.contains = function (container, element) {
do {
element = element.parentNode
if (element === container) {
return true
}
} while (element)
return false
}
Helper.parseJSON = function (string) {
return window.JSON && JSON.parse(string)
}
extend(Helper.prototype, {
find: function (query) {
var container = this[0] || document
if (typeof query === 'string') {
if (container.querySelectorAll) {
query = container.querySelectorAll(query)
} else if (query.charAt(0) === '#') {
query = container.getElementById(query.slice(1))
} else {
query = container.getElementsByTagName(query)
}
}
return new Helper(query)
},
hasClass: function (className) {
if (!this[0]) {
return false
}
return new RegExp('(^|\\s+)' + className +
'(\\s+|$)').test(this[0].className)
},
addClass: function (className) {
var i = this.length
var element
while (i) {
i -= 1
element = this[i]
if (!element.className) {
element.className = className
return this
}
if (this.hasClass(className)) {
return this
}
element.className += ' ' + className
}
return this
},
removeClass: function (className) {
var regexp = new RegExp('(^|\\s+)' + className + '(\\s+|$)')
var i = this.length
var element
while (i) {
i -= 1
element = this[i]
element.className = element.className.replace(regexp, ' ')
}
return this
},
on: function (eventName, handler) {
var eventNames = eventName.split(/\s+/)
var i
var element
while (eventNames.length) {
eventName = eventNames.shift()
i = this.length
while (i) {
i -= 1
element = this[i]
if (element.addEventListener) {
element.addEventListener(eventName, handler, false)
} else if (element.attachEvent) {
element.attachEvent('on' + eventName, handler)
}
}
}
return this
},
off: function (eventName, handler) {
var eventNames = eventName.split(/\s+/)
var i
var element
while (eventNames.length) {
eventName = eventNames.shift()
i = this.length
while (i) {
i -= 1
element = this[i]
if (element.removeEventListener) {
element.removeEventListener(eventName, handler, false)
} else if (element.detachEvent) {
element.detachEvent('on' + eventName, handler)
}
}
}
return this
},
empty: function () {
var i = this.length
var element
while (i) {
i -= 1
element = this[i]
while (element.hasChildNodes()) {
element.removeChild(element.lastChild)
}
}
return this
},
first: function () {
return new Helper(this[0])
}
})
if (typeof define === 'function' && define.amd) {
define(function () {
return Helper
})
} else {
window.blueimp = window.blueimp || {}
window.blueimp.helper = Helper
}
}())
@@ -0,0 +1,83 @@
/*
* blueimp Gallery jQuery plugin
* https://github.com/blueimp/Gallery
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/* global define, window, document */
;(function (factory) {
'use strict'
if (typeof define === 'function' && define.amd) {
define([
'jquery',
'./blueimp-gallery'
], factory)
} else {
factory(
window.jQuery,
window.blueimp.Gallery
)
}
}(function ($, Gallery) {
'use strict'
// Global click handler to open links with data-gallery attribute
// in the Gallery lightbox:
$(document).on('click', '[data-gallery]', function (event) {
// Get the container id from the data-gallery attribute:
var id = $(this).data('gallery')
var widget = $(id)
var container = (widget.length && widget) ||
$(Gallery.prototype.options.container)
var callbacks = {
onopen: function () {
container
.data('gallery', this)
.trigger('open')
},
onopened: function () {
container.trigger('opened')
},
onslide: function () {
container.trigger('slide', arguments)
},
onslideend: function () {
container.trigger('slideend', arguments)
},
onslidecomplete: function () {
container.trigger('slidecomplete', arguments)
},
onclose: function () {
container.trigger('close')
},
onclosed: function () {
container
.trigger('closed')
.removeData('gallery')
}
}
var options = $.extend(
// Retrieve custom options from data-attributes
// on the Gallery widget:
container.data(),
{
container: container[0],
index: this,
event: event
},
callbacks
)
// Select all links with the same data-gallery attribute:
var links = $('[data-gallery="' + id + '"]')
if (options.filter) {
links = links.filter(options.filter)
}
return new Gallery(links, options)
})
}))
File diff suppressed because one or more lines are too long
@@ -0,0 +1,52 @@
{
"name": "blueimp-gallery",
"version": "2.20.0",
"title": "blueimp Gallery",
"description": "blueimp Gallery is a touch-enabled, responsive and customizable image and video gallery, carousel and lightbox, optimized for both mobile and desktop web browsers. It features swipe, mouse and keyboard navigation, transition effects, slideshow functionality, fullscreen support and on-demand content loading and can be extended to display additional content types.",
"keywords": [
"image",
"video",
"gallery",
"carousel",
"lightbox",
"mobile",
"desktop",
"touch",
"responsive",
"swipe",
"mouse",
"keyboard",
"navigation",
"transition",
"effects",
"slideshow",
"fullscreen"
],
"homepage": "https://github.com/blueimp/Gallery",
"author": {
"name": "Sebastian Tschan",
"url": "https://blueimp.net"
},
"repository": {
"type": "git",
"url": "git://github.com/blueimp/Gallery.git"
},
"license": "MIT",
"devDependencies": {
"less": "2.5.3",
"less-plugin-clean-css": "1.5.1",
"standard": "6.0.7",
"uglify-js": "2.6.1"
},
"scripts": {
"test": "standard js/*.js",
"build:js": "cd js && uglifyjs blueimp-helper.js blueimp-gallery.js blueimp-gallery-fullscreen.js blueimp-gallery-indicator.js blueimp-gallery-video.js blueimp-gallery-vimeo.js blueimp-gallery-youtube.js -c -m -o blueimp-gallery.min.js --source-map blueimp-gallery.min.js.map",
"build:jquery": "cd js && uglifyjs blueimp-gallery.js blueimp-gallery-fullscreen.js blueimp-gallery-indicator.js blueimp-gallery-video.js blueimp-gallery-vimeo.js blueimp-gallery-youtube.js jquery.blueimp-gallery.js -c -m -o jquery.blueimp-gallery.min.js --source-map jquery.blueimp-gallery.min.js.map",
"build:less": "cd css && lessc --clean-css --source-map blueimp-gallery.less blueimp-gallery.min.css",
"build": "npm run build:js && npm run build:jquery && npm run build:less",
"preversion": "npm test",
"version": "npm run build && git add -A js",
"postversion": "git push --tags origin master master:gh-pages && npm publish"
},
"main": "js/blueimp-gallery.js"
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

@@ -0,0 +1,165 @@
/* jquery.Jcrop.css v0.9.12 - MIT License */
/*
The outer-most container in a typical Jcrop instance
If you are having difficulty with formatting related to styles
on a parent element, place any fixes here or in a like selector
You can also style this element if you want to add a border, etc
A better method for styling can be seen below with .jcrop-light
(Add a class to the holder and style elements for that extended class)
*/
.jcrop-holder {
direction: ltr;
text-align: left;
}
/* Selection Border */
.jcrop-vline,
.jcrop-hline {
background: #ffffff url("Jcrop.gif");
font-size: 0;
position: absolute;
}
.jcrop-vline {
height: 100%;
width: 1px !important;
}
.jcrop-vline.right {
right: 0;
}
.jcrop-hline {
height: 1px !important;
width: 100%;
}
.jcrop-hline.bottom {
bottom: 0;
}
/* Invisible click targets */
.jcrop-tracker {
height: 100%;
width: 100%;
/* "turn off" link highlight */
-webkit-tap-highlight-color: transparent;
/* disable callout, image save panel */
-webkit-touch-callout: none;
/* disable cut copy paste */
-webkit-user-select: none;
}
/* Selection Handles */
.jcrop-handle {
background-color: #333333;
border: 1px #eeeeee solid;
width: 7px;
height: 7px;
font-size: 1px;
}
.jcrop-handle.ord-n {
left: 50%;
margin-left: -4px;
margin-top: -4px;
top: 0;
}
.jcrop-handle.ord-s {
bottom: 0;
left: 50%;
margin-bottom: -4px;
margin-left: -4px;
}
.jcrop-handle.ord-e {
margin-right: -4px;
margin-top: -4px;
right: 0;
top: 50%;
}
.jcrop-handle.ord-w {
left: 0;
margin-left: -4px;
margin-top: -4px;
top: 50%;
}
.jcrop-handle.ord-nw {
left: 0;
margin-left: -4px;
margin-top: -4px;
top: 0;
}
.jcrop-handle.ord-ne {
margin-right: -4px;
margin-top: -4px;
right: 0;
top: 0;
}
.jcrop-handle.ord-se {
bottom: 0;
margin-bottom: -4px;
margin-right: -4px;
right: 0;
}
.jcrop-handle.ord-sw {
bottom: 0;
left: 0;
margin-bottom: -4px;
margin-left: -4px;
}
/* Dragbars */
.jcrop-dragbar.ord-n,
.jcrop-dragbar.ord-s {
height: 7px;
width: 100%;
}
.jcrop-dragbar.ord-e,
.jcrop-dragbar.ord-w {
height: 100%;
width: 7px;
}
.jcrop-dragbar.ord-n {
margin-top: -4px;
}
.jcrop-dragbar.ord-s {
bottom: 0;
margin-bottom: -4px;
}
.jcrop-dragbar.ord-e {
margin-right: -4px;
right: 0;
}
.jcrop-dragbar.ord-w {
margin-left: -4px;
}
/* The "jcrop-light" class/extension */
.jcrop-light .jcrop-vline,
.jcrop-light .jcrop-hline {
background: #ffffff;
filter: alpha(opacity=70) !important;
opacity: .70!important;
}
.jcrop-light .jcrop-handle {
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
background-color: #000000;
border-color: #ffffff;
border-radius: 3px;
}
/* The "jcrop-dark" class/extension */
.jcrop-dark .jcrop-vline,
.jcrop-dark .jcrop-hline {
background: #000000;
filter: alpha(opacity=70) !important;
opacity: 0.7 !important;
}
.jcrop-dark .jcrop-handle {
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
background-color: #ffffff;
border-color: #000000;
border-radius: 3px;
}
/* Simple macro to turn off the antlines */
.solid-line .jcrop-vline,
.solid-line .jcrop-hline {
background: #ffffff;
}
/* Fix for twitter bootstrap et al. */
.jcrop-holder img,
img.jcrop-preview {
max-width: none;
}
@@ -0,0 +1,384 @@
/*
* JavaScript Load Image Exif Map
* https://github.com/blueimp/JavaScript-Load-Image
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Exif tags mapping based on
* https://github.com/jseidelin/exif-js
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/*global define, module, require, window */
;(function (factory) {
'use strict'
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['./load-image', './load-image-exif'], factory)
} else if (typeof module === 'object' && module.exports) {
factory(require('./load-image'), require('./load-image-exif'))
} else {
// Browser globals:
factory(window.loadImage)
}
}(function (loadImage) {
'use strict'
loadImage.ExifMap.prototype.tags = {
// =================
// TIFF tags (IFD0):
// =================
0x0100: 'ImageWidth',
0x0101: 'ImageHeight',
0x8769: 'ExifIFDPointer',
0x8825: 'GPSInfoIFDPointer',
0xA005: 'InteroperabilityIFDPointer',
0x0102: 'BitsPerSample',
0x0103: 'Compression',
0x0106: 'PhotometricInterpretation',
0x0112: 'Orientation',
0x0115: 'SamplesPerPixel',
0x011C: 'PlanarConfiguration',
0x0212: 'YCbCrSubSampling',
0x0213: 'YCbCrPositioning',
0x011A: 'XResolution',
0x011B: 'YResolution',
0x0128: 'ResolutionUnit',
0x0111: 'StripOffsets',
0x0116: 'RowsPerStrip',
0x0117: 'StripByteCounts',
0x0201: 'JPEGInterchangeFormat',
0x0202: 'JPEGInterchangeFormatLength',
0x012D: 'TransferFunction',
0x013E: 'WhitePoint',
0x013F: 'PrimaryChromaticities',
0x0211: 'YCbCrCoefficients',
0x0214: 'ReferenceBlackWhite',
0x0132: 'DateTime',
0x010E: 'ImageDescription',
0x010F: 'Make',
0x0110: 'Model',
0x0131: 'Software',
0x013B: 'Artist',
0x8298: 'Copyright',
// ==================
// Exif Sub IFD tags:
// ==================
0x9000: 'ExifVersion', // EXIF version
0xA000: 'FlashpixVersion', // Flashpix format version
0xA001: 'ColorSpace', // Color space information tag
0xA002: 'PixelXDimension', // Valid width of meaningful image
0xA003: 'PixelYDimension', // Valid height of meaningful image
0xA500: 'Gamma',
0x9101: 'ComponentsConfiguration', // Information about channels
0x9102: 'CompressedBitsPerPixel', // Compressed bits per pixel
0x927C: 'MakerNote', // Any desired information written by the manufacturer
0x9286: 'UserComment', // Comments by user
0xA004: 'RelatedSoundFile', // Name of related sound file
0x9003: 'DateTimeOriginal', // Date and time when the original image was generated
0x9004: 'DateTimeDigitized', // Date and time when the image was stored digitally
0x9290: 'SubSecTime', // Fractions of seconds for DateTime
0x9291: 'SubSecTimeOriginal', // Fractions of seconds for DateTimeOriginal
0x9292: 'SubSecTimeDigitized', // Fractions of seconds for DateTimeDigitized
0x829A: 'ExposureTime', // Exposure time (in seconds)
0x829D: 'FNumber',
0x8822: 'ExposureProgram', // Exposure program
0x8824: 'SpectralSensitivity', // Spectral sensitivity
0x8827: 'PhotographicSensitivity', // EXIF 2.3, ISOSpeedRatings in EXIF 2.2
0x8828: 'OECF', // Optoelectric conversion factor
0x8830: 'SensitivityType',
0x8831: 'StandardOutputSensitivity',
0x8832: 'RecommendedExposureIndex',
0x8833: 'ISOSpeed',
0x8834: 'ISOSpeedLatitudeyyy',
0x8835: 'ISOSpeedLatitudezzz',
0x9201: 'ShutterSpeedValue', // Shutter speed
0x9202: 'ApertureValue', // Lens aperture
0x9203: 'BrightnessValue', // Value of brightness
0x9204: 'ExposureBias', // Exposure bias
0x9205: 'MaxApertureValue', // Smallest F number of lens
0x9206: 'SubjectDistance', // Distance to subject in meters
0x9207: 'MeteringMode', // Metering mode
0x9208: 'LightSource', // Kind of light source
0x9209: 'Flash', // Flash status
0x9214: 'SubjectArea', // Location and area of main subject
0x920A: 'FocalLength', // Focal length of the lens in mm
0xA20B: 'FlashEnergy', // Strobe energy in BCPS
0xA20C: 'SpatialFrequencyResponse',
0xA20E: 'FocalPlaneXResolution', // Number of pixels in width direction per FPRUnit
0xA20F: 'FocalPlaneYResolution', // Number of pixels in height direction per FPRUnit
0xA210: 'FocalPlaneResolutionUnit', // Unit for measuring the focal plane resolution
0xA214: 'SubjectLocation', // Location of subject in image
0xA215: 'ExposureIndex', // Exposure index selected on camera
0xA217: 'SensingMethod', // Image sensor type
0xA300: 'FileSource', // Image source (3 == DSC)
0xA301: 'SceneType', // Scene type (1 == directly photographed)
0xA302: 'CFAPattern', // Color filter array geometric pattern
0xA401: 'CustomRendered', // Special processing
0xA402: 'ExposureMode', // Exposure mode
0xA403: 'WhiteBalance', // 1 = auto white balance, 2 = manual
0xA404: 'DigitalZoomRatio', // Digital zoom ratio
0xA405: 'FocalLengthIn35mmFilm',
0xA406: 'SceneCaptureType', // Type of scene
0xA407: 'GainControl', // Degree of overall image gain adjustment
0xA408: 'Contrast', // Direction of contrast processing applied by camera
0xA409: 'Saturation', // Direction of saturation processing applied by camera
0xA40A: 'Sharpness', // Direction of sharpness processing applied by camera
0xA40B: 'DeviceSettingDescription',
0xA40C: 'SubjectDistanceRange', // Distance to subject
0xA420: 'ImageUniqueID', // Identifier assigned uniquely to each image
0xA430: 'CameraOwnerName',
0xA431: 'BodySerialNumber',
0xA432: 'LensSpecification',
0xA433: 'LensMake',
0xA434: 'LensModel',
0xA435: 'LensSerialNumber',
// ==============
// GPS Info tags:
// ==============
0x0000: 'GPSVersionID',
0x0001: 'GPSLatitudeRef',
0x0002: 'GPSLatitude',
0x0003: 'GPSLongitudeRef',
0x0004: 'GPSLongitude',
0x0005: 'GPSAltitudeRef',
0x0006: 'GPSAltitude',
0x0007: 'GPSTimeStamp',
0x0008: 'GPSSatellites',
0x0009: 'GPSStatus',
0x000A: 'GPSMeasureMode',
0x000B: 'GPSDOP',
0x000C: 'GPSSpeedRef',
0x000D: 'GPSSpeed',
0x000E: 'GPSTrackRef',
0x000F: 'GPSTrack',
0x0010: 'GPSImgDirectionRef',
0x0011: 'GPSImgDirection',
0x0012: 'GPSMapDatum',
0x0013: 'GPSDestLatitudeRef',
0x0014: 'GPSDestLatitude',
0x0015: 'GPSDestLongitudeRef',
0x0016: 'GPSDestLongitude',
0x0017: 'GPSDestBearingRef',
0x0018: 'GPSDestBearing',
0x0019: 'GPSDestDistanceRef',
0x001A: 'GPSDestDistance',
0x001B: 'GPSProcessingMethod',
0x001C: 'GPSAreaInformation',
0x001D: 'GPSDateStamp',
0x001E: 'GPSDifferential',
0x001F: 'GPSHPositioningError'
}
loadImage.ExifMap.prototype.stringValues = {
ExposureProgram: {
0: 'Undefined',
1: 'Manual',
2: 'Normal program',
3: 'Aperture priority',
4: 'Shutter priority',
5: 'Creative program',
6: 'Action program',
7: 'Portrait mode',
8: 'Landscape mode'
},
MeteringMode: {
0: 'Unknown',
1: 'Average',
2: 'CenterWeightedAverage',
3: 'Spot',
4: 'MultiSpot',
5: 'Pattern',
6: 'Partial',
255: 'Other'
},
LightSource: {
0: 'Unknown',
1: 'Daylight',
2: 'Fluorescent',
3: 'Tungsten (incandescent light)',
4: 'Flash',
9: 'Fine weather',
10: 'Cloudy weather',
11: 'Shade',
12: 'Daylight fluorescent (D 5700 - 7100K)',
13: 'Day white fluorescent (N 4600 - 5400K)',
14: 'Cool white fluorescent (W 3900 - 4500K)',
15: 'White fluorescent (WW 3200 - 3700K)',
17: 'Standard light A',
18: 'Standard light B',
19: 'Standard light C',
20: 'D55',
21: 'D65',
22: 'D75',
23: 'D50',
24: 'ISO studio tungsten',
255: 'Other'
},
Flash: {
0x0000: 'Flash did not fire',
0x0001: 'Flash fired',
0x0005: 'Strobe return light not detected',
0x0007: 'Strobe return light detected',
0x0009: 'Flash fired, compulsory flash mode',
0x000D: 'Flash fired, compulsory flash mode, return light not detected',
0x000F: 'Flash fired, compulsory flash mode, return light detected',
0x0010: 'Flash did not fire, compulsory flash mode',
0x0018: 'Flash did not fire, auto mode',
0x0019: 'Flash fired, auto mode',
0x001D: 'Flash fired, auto mode, return light not detected',
0x001F: 'Flash fired, auto mode, return light detected',
0x0020: 'No flash function',
0x0041: 'Flash fired, red-eye reduction mode',
0x0045: 'Flash fired, red-eye reduction mode, return light not detected',
0x0047: 'Flash fired, red-eye reduction mode, return light detected',
0x0049: 'Flash fired, compulsory flash mode, red-eye reduction mode',
0x004D: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected',
0x004F: 'Flash fired, compulsory flash mode, red-eye reduction mode, return light detected',
0x0059: 'Flash fired, auto mode, red-eye reduction mode',
0x005D: 'Flash fired, auto mode, return light not detected, red-eye reduction mode',
0x005F: 'Flash fired, auto mode, return light detected, red-eye reduction mode'
},
SensingMethod: {
1: 'Undefined',
2: 'One-chip color area sensor',
3: 'Two-chip color area sensor',
4: 'Three-chip color area sensor',
5: 'Color sequential area sensor',
7: 'Trilinear sensor',
8: 'Color sequential linear sensor'
},
SceneCaptureType: {
0: 'Standard',
1: 'Landscape',
2: 'Portrait',
3: 'Night scene'
},
SceneType: {
1: 'Directly photographed'
},
CustomRendered: {
0: 'Normal process',
1: 'Custom process'
},
WhiteBalance: {
0: 'Auto white balance',
1: 'Manual white balance'
},
GainControl: {
0: 'None',
1: 'Low gain up',
2: 'High gain up',
3: 'Low gain down',
4: 'High gain down'
},
Contrast: {
0: 'Normal',
1: 'Soft',
2: 'Hard'
},
Saturation: {
0: 'Normal',
1: 'Low saturation',
2: 'High saturation'
},
Sharpness: {
0: 'Normal',
1: 'Soft',
2: 'Hard'
},
SubjectDistanceRange: {
0: 'Unknown',
1: 'Macro',
2: 'Close view',
3: 'Distant view'
},
FileSource: {
3: 'DSC'
},
ComponentsConfiguration: {
0: '',
1: 'Y',
2: 'Cb',
3: 'Cr',
4: 'R',
5: 'G',
6: 'B'
},
Orientation: {
1: 'top-left',
2: 'top-right',
3: 'bottom-right',
4: 'bottom-left',
5: 'left-top',
6: 'right-top',
7: 'right-bottom',
8: 'left-bottom'
}
}
loadImage.ExifMap.prototype.getText = function (id) {
var value = this.get(id)
switch (id) {
case 'LightSource':
case 'Flash':
case 'MeteringMode':
case 'ExposureProgram':
case 'SensingMethod':
case 'SceneCaptureType':
case 'SceneType':
case 'CustomRendered':
case 'WhiteBalance':
case 'GainControl':
case 'Contrast':
case 'Saturation':
case 'Sharpness':
case 'SubjectDistanceRange':
case 'FileSource':
case 'Orientation':
return this.stringValues[id][value]
case 'ExifVersion':
case 'FlashpixVersion':
return String.fromCharCode(value[0], value[1], value[2], value[3])
case 'ComponentsConfiguration':
return this.stringValues[id][value[0]] +
this.stringValues[id][value[1]] +
this.stringValues[id][value[2]] +
this.stringValues[id][value[3]]
case 'GPSVersionID':
return value[0] + '.' + value[1] + '.' + value[2] + '.' + value[3]
}
return String(value)
}
;(function (exifMapPrototype) {
var tags = exifMapPrototype.tags
var map = exifMapPrototype.map
var prop
// Map the tag names to tags:
for (prop in tags) {
if (tags.hasOwnProperty(prop)) {
map[tags[prop]] = prop
}
}
}(loadImage.ExifMap.prototype))
loadImage.ExifMap.prototype.getAll = function () {
var map = {}
var prop
var id
for (prop in this) {
if (this.hasOwnProperty(prop)) {
id = this.tags[prop]
if (id) {
map[id] = this.getText(id)
}
}
}
return map
}
}))
@@ -0,0 +1,300 @@
/*
* JavaScript Load Image Exif Parser
* https://github.com/blueimp/JavaScript-Load-Image
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/*global define, module, require, window, console */
;(function (factory) {
'use strict'
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['./load-image', './load-image-meta'], factory)
} else if (typeof module === 'object' && module.exports) {
factory(require('./load-image'), require('./load-image-meta'))
} else {
// Browser globals:
factory(window.loadImage)
}
}(function (loadImage) {
'use strict'
loadImage.ExifMap = function () {
return this
}
loadImage.ExifMap.prototype.map = {
'Orientation': 0x0112
}
loadImage.ExifMap.prototype.get = function (id) {
return this[id] || this[this.map[id]]
}
loadImage.getExifThumbnail = function (dataView, offset, length) {
var hexData,
i,
b
if (!length || offset + length > dataView.byteLength) {
console.log('Invalid Exif data: Invalid thumbnail data.')
return
}
hexData = []
for (i = 0; i < length; i += 1) {
b = dataView.getUint8(offset + i)
hexData.push((b < 16 ? '0' : '') + b.toString(16))
}
return 'data:image/jpeg,%' + hexData.join('%')
}
loadImage.exifTagTypes = {
// byte, 8-bit unsigned int:
1: {
getValue: function (dataView, dataOffset) {
return dataView.getUint8(dataOffset)
},
size: 1
},
// ascii, 8-bit byte:
2: {
getValue: function (dataView, dataOffset) {
return String.fromCharCode(dataView.getUint8(dataOffset))
},
size: 1,
ascii: true
},
// short, 16 bit int:
3: {
getValue: function (dataView, dataOffset, littleEndian) {
return dataView.getUint16(dataOffset, littleEndian)
},
size: 2
},
// long, 32 bit int:
4: {
getValue: function (dataView, dataOffset, littleEndian) {
return dataView.getUint32(dataOffset, littleEndian)
},
size: 4
},
// rational = two long values, first is numerator, second is denominator:
5: {
getValue: function (dataView, dataOffset, littleEndian) {
return dataView.getUint32(dataOffset, littleEndian) /
dataView.getUint32(dataOffset + 4, littleEndian)
},
size: 8
},
// slong, 32 bit signed int:
9: {
getValue: function (dataView, dataOffset, littleEndian) {
return dataView.getInt32(dataOffset, littleEndian)
},
size: 4
},
// srational, two slongs, first is numerator, second is denominator:
10: {
getValue: function (dataView, dataOffset, littleEndian) {
return dataView.getInt32(dataOffset, littleEndian) /
dataView.getInt32(dataOffset + 4, littleEndian)
},
size: 8
}
}
// undefined, 8-bit byte, value depending on field:
loadImage.exifTagTypes[7] = loadImage.exifTagTypes[1]
loadImage.getExifValue = function (dataView, tiffOffset, offset, type, length, littleEndian) {
var tagType = loadImage.exifTagTypes[type]
var tagSize
var dataOffset
var values
var i
var str
var c
if (!tagType) {
console.log('Invalid Exif data: Invalid tag type.')
return
}
tagSize = tagType.size * length
// Determine if the value is contained in the dataOffset bytes,
// or if the value at the dataOffset is a pointer to the actual data:
dataOffset = tagSize > 4
? tiffOffset + dataView.getUint32(offset + 8, littleEndian)
: (offset + 8)
if (dataOffset + tagSize > dataView.byteLength) {
console.log('Invalid Exif data: Invalid data offset.')
return
}
if (length === 1) {
return tagType.getValue(dataView, dataOffset, littleEndian)
}
values = []
for (i = 0; i < length; i += 1) {
values[i] = tagType.getValue(dataView, dataOffset + i * tagType.size, littleEndian)
}
if (tagType.ascii) {
str = ''
// Concatenate the chars:
for (i = 0; i < values.length; i += 1) {
c = values[i]
// Ignore the terminating NULL byte(s):
if (c === '\u0000') {
break
}
str += c
}
return str
}
return values
}
loadImage.parseExifTag = function (dataView, tiffOffset, offset, littleEndian, data) {
var tag = dataView.getUint16(offset, littleEndian)
data.exif[tag] = loadImage.getExifValue(
dataView,
tiffOffset,
offset,
dataView.getUint16(offset + 2, littleEndian), // tag type
dataView.getUint32(offset + 4, littleEndian), // tag length
littleEndian
)
}
loadImage.parseExifTags = function (dataView, tiffOffset, dirOffset, littleEndian, data) {
var tagsNumber,
dirEndOffset,
i
if (dirOffset + 6 > dataView.byteLength) {
console.log('Invalid Exif data: Invalid directory offset.')
return
}
tagsNumber = dataView.getUint16(dirOffset, littleEndian)
dirEndOffset = dirOffset + 2 + 12 * tagsNumber
if (dirEndOffset + 4 > dataView.byteLength) {
console.log('Invalid Exif data: Invalid directory size.')
return
}
for (i = 0; i < tagsNumber; i += 1) {
this.parseExifTag(
dataView,
tiffOffset,
dirOffset + 2 + 12 * i, // tag offset
littleEndian,
data
)
}
// Return the offset to the next directory:
return dataView.getUint32(dirEndOffset, littleEndian)
}
loadImage.parseExifData = function (dataView, offset, length, data, options) {
if (options.disableExif) {
return
}
var tiffOffset = offset + 10
var littleEndian
var dirOffset
var thumbnailData
// Check for the ASCII code for "Exif" (0x45786966):
if (dataView.getUint32(offset + 4) !== 0x45786966) {
// No Exif data, might be XMP data instead
return
}
if (tiffOffset + 8 > dataView.byteLength) {
console.log('Invalid Exif data: Invalid segment size.')
return
}
// Check for the two null bytes:
if (dataView.getUint16(offset + 8) !== 0x0000) {
console.log('Invalid Exif data: Missing byte alignment offset.')
return
}
// Check the byte alignment:
switch (dataView.getUint16(tiffOffset)) {
case 0x4949:
littleEndian = true
break
case 0x4D4D:
littleEndian = false
break
default:
console.log('Invalid Exif data: Invalid byte alignment marker.')
return
}
// Check for the TIFF tag marker (0x002A):
if (dataView.getUint16(tiffOffset + 2, littleEndian) !== 0x002A) {
console.log('Invalid Exif data: Missing TIFF marker.')
return
}
// Retrieve the directory offset bytes, usually 0x00000008 or 8 decimal:
dirOffset = dataView.getUint32(tiffOffset + 4, littleEndian)
// Create the exif object to store the tags:
data.exif = new loadImage.ExifMap()
// Parse the tags of the main image directory and retrieve the
// offset to the next directory, usually the thumbnail directory:
dirOffset = loadImage.parseExifTags(
dataView,
tiffOffset,
tiffOffset + dirOffset,
littleEndian,
data
)
if (dirOffset && !options.disableExifThumbnail) {
thumbnailData = {exif: {}}
dirOffset = loadImage.parseExifTags(
dataView,
tiffOffset,
tiffOffset + dirOffset,
littleEndian,
thumbnailData
)
// Check for JPEG Thumbnail offset:
if (thumbnailData.exif[0x0201]) {
data.exif.Thumbnail = loadImage.getExifThumbnail(
dataView,
tiffOffset + thumbnailData.exif[0x0201],
thumbnailData.exif[0x0202] // Thumbnail data length
)
}
}
// Check for Exif Sub IFD Pointer:
if (data.exif[0x8769] && !options.disableExifSub) {
loadImage.parseExifTags(
dataView,
tiffOffset,
tiffOffset + data.exif[0x8769], // directory offset
littleEndian,
data
)
}
// Check for GPS Info IFD Pointer:
if (data.exif[0x8825] && !options.disableExifGps) {
loadImage.parseExifTags(
dataView,
tiffOffset,
tiffOffset + data.exif[0x8825], // directory offset
littleEndian,
data
)
}
}
// Registers the Exif parser for the APP1 JPEG meta data segment:
loadImage.metaDataParsers.jpeg[0xffe1].push(loadImage.parseExifData)
// Adds the following properties to the parseMetaData callback data:
// * exif: The exif tags, parsed by the parseExifData method
// Adds the following options to the parseMetaData method:
// * disableExif: Disables Exif parsing.
// * disableExifThumbnail: Disables parsing of the Exif Thumbnail.
// * disableExifSub: Disables parsing of the Exif Sub IFD.
// * disableExifGps: Disables parsing of the Exif GPS Info IFD.
}))
@@ -0,0 +1,181 @@
/*
* JavaScript Load Image iOS scaling fixes 1.0.3
* https://github.com/blueimp/JavaScript-Load-Image
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* iOS image scaling fixes based on
* https://github.com/stomita/ios-imagefile-megapixel
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/*jslint nomen: true, bitwise: true */
/*global define, window, document */
(function (factory) {
'use strict';
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['load-image'], factory);
} else {
// Browser globals:
factory(window.loadImage);
}
}(function (loadImage) {
'use strict';
// Only apply fixes on the iOS platform:
if (!window.navigator || !window.navigator.platform ||
!(/iP(hone|od|ad)/).test(window.navigator.platform)) {
return;
}
var originalRenderMethod = loadImage.renderImageToCanvas;
// Detects subsampling in JPEG images:
loadImage.detectSubsampling = function (img) {
var canvas,
context;
if (img.width * img.height > 1024 * 1024) { // only consider mexapixel images
canvas = document.createElement('canvas');
canvas.width = canvas.height = 1;
context = canvas.getContext('2d');
context.drawImage(img, -img.width + 1, 0);
// subsampled image becomes half smaller in rendering size.
// check alpha channel value to confirm image is covering edge pixel or not.
// if alpha value is 0 image is not covering, hence subsampled.
return context.getImageData(0, 0, 1, 1).data[3] === 0;
}
return false;
};
// Detects vertical squash in JPEG images:
loadImage.detectVerticalSquash = function (img, subsampled) {
var naturalHeight = img.naturalHeight || img.height,
canvas = document.createElement('canvas'),
context = canvas.getContext('2d'),
data,
sy,
ey,
py,
alpha;
if (subsampled) {
naturalHeight /= 2;
}
canvas.width = 1;
canvas.height = naturalHeight;
context.drawImage(img, 0, 0);
data = context.getImageData(0, 0, 1, naturalHeight).data;
// search image edge pixel position in case it is squashed vertically:
sy = 0;
ey = naturalHeight;
py = naturalHeight;
while (py > sy) {
alpha = data[(py - 1) * 4 + 3];
if (alpha === 0) {
ey = py;
} else {
sy = py;
}
py = (ey + sy) >> 1;
}
return (py / naturalHeight) || 1;
};
// Renders image to canvas while working around iOS image scaling bugs:
// https://github.com/blueimp/JavaScript-Load-Image/issues/13
loadImage.renderImageToCanvas = function (
canvas,
img,
sourceX,
sourceY,
sourceWidth,
sourceHeight,
destX,
destY,
destWidth,
destHeight
) {
if (img._type === 'image/jpeg') {
var context = canvas.getContext('2d'),
tmpCanvas = document.createElement('canvas'),
tileSize = 1024,
tmpContext = tmpCanvas.getContext('2d'),
subsampled,
vertSquashRatio,
tileX,
tileY;
tmpCanvas.width = tileSize;
tmpCanvas.height = tileSize;
context.save();
subsampled = loadImage.detectSubsampling(img);
if (subsampled) {
sourceX /= 2;
sourceY /= 2;
sourceWidth /= 2;
sourceHeight /= 2;
}
vertSquashRatio = loadImage.detectVerticalSquash(img, subsampled);
if (subsampled || vertSquashRatio !== 1) {
sourceY *= vertSquashRatio;
destWidth = Math.ceil(tileSize * destWidth / sourceWidth);
destHeight = Math.ceil(
tileSize * destHeight / sourceHeight / vertSquashRatio
);
destY = 0;
tileY = 0;
while (tileY < sourceHeight) {
destX = 0;
tileX = 0;
while (tileX < sourceWidth) {
tmpContext.clearRect(0, 0, tileSize, tileSize);
tmpContext.drawImage(
img,
sourceX,
sourceY,
sourceWidth,
sourceHeight,
-tileX,
-tileY,
sourceWidth,
sourceHeight
);
context.drawImage(
tmpCanvas,
0,
0,
tileSize,
tileSize,
destX,
destY,
destWidth,
destHeight
);
tileX += tileSize;
destX += destWidth;
}
tileY += tileSize;
destY += destHeight;
}
context.restore();
return canvas;
}
}
return originalRenderMethod(
canvas,
img,
sourceX,
sourceY,
sourceWidth,
sourceHeight,
destX,
destY,
destWidth,
destHeight
);
};
}));
@@ -0,0 +1,143 @@
/*
* JavaScript Load Image Meta
* https://github.com/blueimp/JavaScript-Load-Image
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Image meta data handling implementation
* based on the help and contribution of
* Achim Stöhr.
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/*global define, module, require, window, DataView, Blob, Uint8Array, console */
;(function (factory) {
'use strict'
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['./load-image'], factory)
} else if (typeof module === 'object' && module.exports) {
factory(require('./load-image'))
} else {
// Browser globals:
factory(window.loadImage)
}
}(function (loadImage) {
'use strict'
var hasblobSlice = window.Blob && (Blob.prototype.slice ||
Blob.prototype.webkitSlice || Blob.prototype.mozSlice)
loadImage.blobSlice = hasblobSlice && function () {
var slice = this.slice || this.webkitSlice || this.mozSlice
return slice.apply(this, arguments)
}
loadImage.metaDataParsers = {
jpeg: {
0xffe1: [] // APP1 marker
}
}
// Parses image meta data and calls the callback with an object argument
// with the following properties:
// * imageHead: The complete image head as ArrayBuffer (Uint8Array for IE10)
// The options arguments accepts an object and supports the following properties:
// * maxMetaDataSize: Defines the maximum number of bytes to parse.
// * disableImageHead: Disables creating the imageHead property.
loadImage.parseMetaData = function (file, callback, options) {
options = options || {}
var that = this
// 256 KiB should contain all EXIF/ICC/IPTC segments:
var maxMetaDataSize = options.maxMetaDataSize || 262144
var data = {}
var noMetaData = !(window.DataView && file && file.size >= 12 &&
file.type === 'image/jpeg' && loadImage.blobSlice)
if (noMetaData || !loadImage.readFile(
loadImage.blobSlice.call(file, 0, maxMetaDataSize),
function (e) {
if (e.target.error) {
// FileReader error
console.log(e.target.error)
callback(data)
return
}
// Note on endianness:
// Since the marker and length bytes in JPEG files are always
// stored in big endian order, we can leave the endian parameter
// of the DataView methods undefined, defaulting to big endian.
var buffer = e.target.result
var dataView = new DataView(buffer)
var offset = 2
var maxOffset = dataView.byteLength - 4
var headLength = offset
var markerBytes
var markerLength
var parsers
var i
// Check for the JPEG marker (0xffd8):
if (dataView.getUint16(0) === 0xffd8) {
while (offset < maxOffset) {
markerBytes = dataView.getUint16(offset)
// Search for APPn (0xffeN) and COM (0xfffe) markers,
// which contain application-specific meta-data like
// Exif, ICC and IPTC data and text comments:
if ((markerBytes >= 0xffe0 && markerBytes <= 0xffef) ||
markerBytes === 0xfffe) {
// The marker bytes (2) are always followed by
// the length bytes (2), indicating the length of the
// marker segment, which includes the length bytes,
// but not the marker bytes, so we add 2:
markerLength = dataView.getUint16(offset + 2) + 2
if (offset + markerLength > dataView.byteLength) {
console.log('Invalid meta data: Invalid segment size.')
break
}
parsers = loadImage.metaDataParsers.jpeg[markerBytes]
if (parsers) {
for (i = 0; i < parsers.length; i += 1) {
parsers[i].call(
that,
dataView,
offset,
markerLength,
data,
options
)
}
}
offset += markerLength
headLength = offset
} else {
// Not an APPn or COM marker, probably safe to
// assume that this is the end of the meta data
break
}
}
// Meta length must be longer than JPEG marker (2)
// plus APPn marker (2), followed by length bytes (2):
if (!options.disableImageHead && headLength > 6) {
if (buffer.slice) {
data.imageHead = buffer.slice(0, headLength)
} else {
// Workaround for IE10, which does not yet
// support ArrayBuffer.slice:
data.imageHead = new Uint8Array(buffer)
.subarray(0, headLength)
}
}
} else {
console.log('Invalid JPEG file: Missing JPEG marker.')
}
callback(data)
},
'readAsArrayBuffer'
)) {
callback(data)
}
}
}))
@@ -0,0 +1,171 @@
/*
* JavaScript Load Image Orientation
* https://github.com/blueimp/JavaScript-Load-Image
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/*global define, module, require, window */
;(function (factory) {
'use strict'
if (typeof define === 'function' && define.amd) {
// Register as an anonymous AMD module:
define(['./load-image'], factory)
} else if (typeof module === 'object' && module.exports) {
factory(require('./load-image'))
} else {
// Browser globals:
factory(window.loadImage)
}
}(function (loadImage) {
'use strict'
var originalHasCanvasOption = loadImage.hasCanvasOption
var originalTransformCoordinates = loadImage.transformCoordinates
var originalGetTransformedOptions = loadImage.getTransformedOptions
// This method is used to determine if the target image
// should be a canvas element:
loadImage.hasCanvasOption = function (options) {
return !!options.orientation ||
originalHasCanvasOption.call(loadImage, options)
}
// Transform image orientation based on
// the given EXIF orientation option:
loadImage.transformCoordinates = function (canvas, options) {
originalTransformCoordinates.call(loadImage, canvas, options)
var ctx = canvas.getContext('2d')
var width = canvas.width
var height = canvas.height
var styleWidth = canvas.style.width
var styleHeight = canvas.style.height
var orientation = options.orientation
if (!orientation || orientation > 8) {
return
}
if (orientation > 4) {
canvas.width = height
canvas.height = width
canvas.style.width = styleHeight
canvas.style.height = styleWidth
}
switch (orientation) {
case 2:
// horizontal flip
ctx.translate(width, 0)
ctx.scale(-1, 1)
break
case 3:
// 180° rotate left
ctx.translate(width, height)
ctx.rotate(Math.PI)
break
case 4:
// vertical flip
ctx.translate(0, height)
ctx.scale(1, -1)
break
case 5:
// vertical flip + 90 rotate right
ctx.rotate(0.5 * Math.PI)
ctx.scale(1, -1)
break
case 6:
// 90° rotate right
ctx.rotate(0.5 * Math.PI)
ctx.translate(0, -height)
break
case 7:
// horizontal flip + 90 rotate right
ctx.rotate(0.5 * Math.PI)
ctx.translate(width, -height)
ctx.scale(-1, 1)
break
case 8:
// 90° rotate left
ctx.rotate(-0.5 * Math.PI)
ctx.translate(-width, 0)
break
}
}
// Transforms coordinate and dimension options
// based on the given orientation option:
loadImage.getTransformedOptions = function (img, opts) {
var options = originalGetTransformedOptions.call(loadImage, img, opts)
var orientation = options.orientation
var newOptions
var i
if (!orientation || orientation > 8 || orientation === 1) {
return options
}
newOptions = {}
for (i in options) {
if (options.hasOwnProperty(i)) {
newOptions[i] = options[i]
}
}
switch (options.orientation) {
case 2:
// horizontal flip
newOptions.left = options.right
newOptions.right = options.left
break
case 3:
// 180° rotate left
newOptions.left = options.right
newOptions.top = options.bottom
newOptions.right = options.left
newOptions.bottom = options.top
break
case 4:
// vertical flip
newOptions.top = options.bottom
newOptions.bottom = options.top
break
case 5:
// vertical flip + 90 rotate right
newOptions.left = options.top
newOptions.top = options.left
newOptions.right = options.bottom
newOptions.bottom = options.right
break
case 6:
// 90° rotate right
newOptions.left = options.top
newOptions.top = options.right
newOptions.right = options.bottom
newOptions.bottom = options.left
break
case 7:
// horizontal flip + 90 rotate right
newOptions.left = options.bottom
newOptions.top = options.right
newOptions.right = options.top
newOptions.bottom = options.left
break
case 8:
// 90° rotate left
newOptions.left = options.bottom
newOptions.top = options.left
newOptions.right = options.top
newOptions.bottom = options.right
break
}
if (options.orientation > 4) {
newOptions.maxWidth = options.maxHeight
newOptions.maxHeight = options.maxWidth
newOptions.minWidth = options.minHeight
newOptions.minHeight = options.minWidth
newOptions.sourceWidth = options.sourceHeight
newOptions.sourceHeight = options.sourceWidth
}
return newOptions
}
}))
File diff suppressed because one or more lines are too long
@@ -0,0 +1,348 @@
/*
* JavaScript Load Image
* https://github.com/blueimp/JavaScript-Load-Image
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
/*global define, module, window, document, URL, webkitURL, FileReader */
;(function ($) {
'use strict'
// Loads an image for a given File object.
// Invokes the callback with an img or optional canvas
// element (if supported by the browser) as parameter:
var loadImage = function (file, callback, options) {
var img = document.createElement('img')
var url
var oUrl
img.onerror = callback
img.onload = function () {
if (oUrl && !(options && options.noRevoke)) {
loadImage.revokeObjectURL(oUrl)
}
if (callback) {
callback(loadImage.scale(img, options))
}
}
if (loadImage.isInstanceOf('Blob', file) ||
// Files are also Blob instances, but some browsers
// (Firefox 3.6) support the File API but not Blobs:
loadImage.isInstanceOf('File', file)) {
url = oUrl = loadImage.createObjectURL(file)
// Store the file type for resize processing:
img._type = file.type
} else if (typeof file === 'string') {
url = file
if (options && options.crossOrigin) {
img.crossOrigin = options.crossOrigin
}
} else {
return false
}
if (url) {
img.src = url
return img
}
return loadImage.readFile(file, function (e) {
var target = e.target
if (target && target.result) {
img.src = target.result
} else {
if (callback) {
callback(e)
}
}
})
}
// The check for URL.revokeObjectURL fixes an issue with Opera 12,
// which provides URL.createObjectURL but doesn't properly implement it:
var urlAPI = (window.createObjectURL && window) ||
(window.URL && URL.revokeObjectURL && URL) ||
(window.webkitURL && webkitURL)
loadImage.isInstanceOf = function (type, obj) {
// Cross-frame instanceof check
return Object.prototype.toString.call(obj) === '[object ' + type + ']'
}
// Transform image coordinates, allows to override e.g.
// the canvas orientation based on the orientation option,
// gets canvas, options passed as arguments:
loadImage.transformCoordinates = function () {
return
}
// Returns transformed options, allows to override e.g.
// maxWidth, maxHeight and crop options based on the aspectRatio.
// gets img, options passed as arguments:
loadImage.getTransformedOptions = function (img, options) {
var aspectRatio = options.aspectRatio
var newOptions
var i
var width
var height
if (!aspectRatio) {
return options
}
newOptions = {}
for (i in options) {
if (options.hasOwnProperty(i)) {
newOptions[i] = options[i]
}
}
newOptions.crop = true
width = img.naturalWidth || img.width
height = img.naturalHeight || img.height
if (width / height > aspectRatio) {
newOptions.maxWidth = height * aspectRatio
newOptions.maxHeight = height
} else {
newOptions.maxWidth = width
newOptions.maxHeight = width / aspectRatio
}
return newOptions
}
// Canvas render method, allows to implement a different rendering algorithm:
loadImage.renderImageToCanvas = function (
canvas,
img,
sourceX,
sourceY,
sourceWidth,
sourceHeight,
destX,
destY,
destWidth,
destHeight
) {
canvas.getContext('2d').drawImage(
img,
sourceX,
sourceY,
sourceWidth,
sourceHeight,
destX,
destY,
destWidth,
destHeight
)
return canvas
}
// This method is used to determine if the target image
// should be a canvas element:
loadImage.hasCanvasOption = function (options) {
return options.canvas || options.crop || !!options.aspectRatio
}
// Scales and/or crops the given image (img or canvas HTML element)
// using the given options.
// Returns a canvas object if the browser supports canvas
// and the hasCanvasOption method returns true or a canvas
// object is passed as image, else the scaled image:
loadImage.scale = function (img, options) {
options = options || {}
var canvas = document.createElement('canvas')
var useCanvas = img.getContext ||
(loadImage.hasCanvasOption(options) && canvas.getContext)
var width = img.naturalWidth || img.width
var height = img.naturalHeight || img.height
var destWidth = width
var destHeight = height
var maxWidth
var maxHeight
var minWidth
var minHeight
var sourceWidth
var sourceHeight
var sourceX
var sourceY
var pixelRatio
var downsamplingRatio
var tmp
function scaleUp () {
var scale = Math.max(
(minWidth || destWidth) / destWidth,
(minHeight || destHeight) / destHeight
)
if (scale > 1) {
destWidth *= scale
destHeight *= scale
}
}
function scaleDown () {
var scale = Math.min(
(maxWidth || destWidth) / destWidth,
(maxHeight || destHeight) / destHeight
)
if (scale < 1) {
destWidth *= scale
destHeight *= scale
}
}
if (useCanvas) {
options = loadImage.getTransformedOptions(img, options)
sourceX = options.left || 0
sourceY = options.top || 0
if (options.sourceWidth) {
sourceWidth = options.sourceWidth
if (options.right !== undefined && options.left === undefined) {
sourceX = width - sourceWidth - options.right
}
} else {
sourceWidth = width - sourceX - (options.right || 0)
}
if (options.sourceHeight) {
sourceHeight = options.sourceHeight
if (options.bottom !== undefined && options.top === undefined) {
sourceY = height - sourceHeight - options.bottom
}
} else {
sourceHeight = height - sourceY - (options.bottom || 0)
}
destWidth = sourceWidth
destHeight = sourceHeight
}
maxWidth = options.maxWidth
maxHeight = options.maxHeight
minWidth = options.minWidth
minHeight = options.minHeight
if (useCanvas && maxWidth && maxHeight && options.crop) {
destWidth = maxWidth
destHeight = maxHeight
tmp = sourceWidth / sourceHeight - maxWidth / maxHeight
if (tmp < 0) {
sourceHeight = maxHeight * sourceWidth / maxWidth
if (options.top === undefined && options.bottom === undefined) {
sourceY = (height - sourceHeight) / 2
}
} else if (tmp > 0) {
sourceWidth = maxWidth * sourceHeight / maxHeight
if (options.left === undefined && options.right === undefined) {
sourceX = (width - sourceWidth) / 2
}
}
} else {
if (options.contain || options.cover) {
minWidth = maxWidth = maxWidth || minWidth
minHeight = maxHeight = maxHeight || minHeight
}
if (options.cover) {
scaleDown()
scaleUp()
} else {
scaleUp()
scaleDown()
}
}
if (useCanvas) {
pixelRatio = options.pixelRatio
if (pixelRatio > 1) {
canvas.style.width = destWidth + 'px'
canvas.style.height = destHeight + 'px'
destWidth *= pixelRatio
destHeight *= pixelRatio
canvas.getContext('2d').scale(pixelRatio, pixelRatio)
}
downsamplingRatio = options.downsamplingRatio
if (downsamplingRatio > 0 && downsamplingRatio < 1 &&
destWidth < sourceWidth && destHeight < sourceHeight) {
while (sourceWidth * downsamplingRatio > destWidth) {
canvas.width = sourceWidth * downsamplingRatio
canvas.height = sourceHeight * downsamplingRatio
loadImage.renderImageToCanvas(
canvas,
img,
sourceX,
sourceY,
sourceWidth,
sourceHeight,
0,
0,
canvas.width,
canvas.height
)
sourceWidth = canvas.width
sourceHeight = canvas.height
img = document.createElement('canvas')
img.width = sourceWidth
img.height = sourceHeight
loadImage.renderImageToCanvas(
img,
canvas,
0,
0,
sourceWidth,
sourceHeight,
0,
0,
sourceWidth,
sourceHeight
)
}
}
canvas.width = destWidth
canvas.height = destHeight
loadImage.transformCoordinates(
canvas,
options
)
return loadImage.renderImageToCanvas(
canvas,
img,
sourceX,
sourceY,
sourceWidth,
sourceHeight,
0,
0,
destWidth,
destHeight
)
}
img.width = destWidth
img.height = destHeight
return img
}
loadImage.createObjectURL = function (file) {
return urlAPI ? urlAPI.createObjectURL(file) : false
}
loadImage.revokeObjectURL = function (url) {
return urlAPI ? urlAPI.revokeObjectURL(url) : false
}
// Loads a given File object via FileReader interface,
// invokes the callback with the event object (load or error).
// The result can be read via event.target.result:
loadImage.readFile = function (file, callback, method) {
if (window.FileReader) {
var fileReader = new FileReader()
fileReader.onload = fileReader.onerror = callback
method = method || 'readAsDataURL'
if (fileReader[method]) {
fileReader[method](file)
return fileReader
}
}
return false
}
if (typeof define === 'function' && define.amd) {
define(function () {
return loadImage
})
} else if (typeof module === 'object' && module.exports) {
module.exports = loadImage
} else {
$.loadImage = loadImage
}
}(window))
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,46 @@
{
"name": "blueimp-load-image",
"version": "2.6.1",
"main": "index.js",
"title": "JavaScript Load Image",
"description": "JavaScript Load Image is a library to load images provided as File or Blob objects or via URL. It returns an optionally scaled and/or cropped HTML img or canvas element. It also provides a method to parse image meta data to extract Exif tags and thumbnails and to restore the complete image header after resizing.",
"keywords": [
"javascript",
"load",
"loading",
"image",
"file",
"blob",
"url",
"scale",
"crop",
"img",
"canvas",
"meta",
"exif",
"thumbnail",
"resizing"
],
"homepage": "https://github.com/blueimp/JavaScript-Load-Image",
"author": {
"name": "Sebastian Tschan",
"url": "https://blueimp.net"
},
"repository": {
"type": "git",
"url": "git://github.com/blueimp/JavaScript-Load-Image.git"
},
"devDependencies": {
"mocha-phantomjs": "4.0.1",
"standard": "6.0.7",
"uglify-js": "2.6.1"
},
"scripts": {
"test": "standard *.js js/*.js test/*.js && mocha-phantomjs test/index.html",
"build": "cd js && uglifyjs load-image.js load-image-orientation.js load-image-meta.js load-image-exif.js load-image-exif-map.js -c -m -o load-image.all.min.js --source-map load-image.all.min.js.map",
"preversion": "npm test",
"version": "npm run build && git add -A js",
"postversion": "git push --tags origin master master:gh-pages && npm publish"
},
"license": "MIT"
}
@@ -0,0 +1,86 @@
/*
* JavaScript Templates
* https://github.com/blueimp/JavaScript-Templates
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*
* Inspired by John Resig's JavaScript Micro-Templating:
* http://ejohn.org/blog/javascript-micro-templating/
*/
/*global document, define, module */
;(function ($) {
'use strict'
var tmpl = function (str, data) {
var f = !/[^\w\-\.:]/.test(str)
? tmpl.cache[str] = tmpl.cache[str] || tmpl(tmpl.load(str))
: new Function(// eslint-disable-line no-new-func
tmpl.arg + ',tmpl',
'var _e=tmpl.encode' + tmpl.helper + ",_s='" +
str.replace(tmpl.regexp, tmpl.func) + "';return _s;"
)
return data ? f(data, tmpl) : function (data) {
return f(data, tmpl)
}
}
tmpl.cache = {}
tmpl.load = function (id) {
return document.getElementById(id).innerHTML
}
tmpl.regexp = /([\s'\\])(?!(?:[^{]|\{(?!%))*%\})|(?:\{%(=|#)([\s\S]+?)%\})|(\{%)|(%\})/g
tmpl.func = function (s, p1, p2, p3, p4, p5) {
if (p1) { // whitespace, quote and backspace in HTML context
return {
'\n': '\\n',
'\r': '\\r',
'\t': '\\t',
' ': ' '
}[p1] || '\\' + p1
}
if (p2) { // interpolation: {%=prop%}, or unescaped: {%#prop%}
if (p2 === '=') {
return "'+_e(" + p3 + ")+'"
}
return "'+(" + p3 + "==null?'':" + p3 + ")+'"
}
if (p4) { // evaluation start tag: {%
return "';"
}
if (p5) { // evaluation end tag: %}
return "_s+='"
}
}
tmpl.encReg = /[<>&"'\x00]/g
tmpl.encMap = {
'<': '&lt;',
'>': '&gt;',
'&': '&amp;',
'"': '&quot;',
"'": '&#39;'
}
tmpl.encode = function (s) {
return (s == null ? '' : '' + s).replace(
tmpl.encReg,
function (c) {
return tmpl.encMap[c] || ''
}
)
}
tmpl.arg = 'o'
tmpl.helper = ",print=function(s,e){_s+=e?(s==null?'':s):_e(s);}" +
',include=function(s,d){_s+=tmpl(s,d);}'
if (typeof define === 'function' && define.amd) {
define(function () {
return tmpl
})
} else if (typeof module === 'object' && module.exports) {
module.exports = tmpl
} else {
$.tmpl = tmpl
}
}(this))
@@ -0,0 +1,2 @@
!function(e){"use strict";var n=function(e,t){var r=/[^\w\-\.:]/.test(e)?new Function(n.arg+",tmpl","var _e=tmpl.encode"+n.helper+",_s='"+e.replace(n.regexp,n.func)+"';return _s;"):n.cache[e]=n.cache[e]||n(n.load(e));return t?r(t,n):function(e){return r(e,n)}};n.cache={},n.load=function(e){return document.getElementById(e).innerHTML},n.regexp=/([\s'\\])(?!(?:[^{]|\{(?!%))*%\})|(?:\{%(=|#)([\s\S]+?)%\})|(\{%)|(%\})/g,n.func=function(e,n,t,r,c,u){return n?{"\n":"\\n","\r":"\\r"," ":"\\t"," ":" "}[n]||"\\"+n:t?"="===t?"'+_e("+r+")+'":"'+("+r+"==null?'':"+r+")+'":c?"';":u?"_s+='":void 0},n.encReg=/[<>&"'\x00]/g,n.encMap={"<":"&lt;",">":"&gt;","&":"&amp;",'"':"&quot;","'":"&#39;"},n.encode=function(e){return(null==e?"":""+e).replace(n.encReg,function(e){return n.encMap[e]||""})},n.arg="o",n.helper=",print=function(s,e){_s+=e?(s==null?'':s):_e(s);},include=function(s,d){_s+=tmpl(s,d);}","function"==typeof define&&define.amd?define(function(){return n}):"object"==typeof module&&module.exports?module.exports=n:e.tmpl=n}(this);
//# sourceMappingURL=tmpl.min.js.map
@@ -0,0 +1,38 @@
{
"name": "blueimp-tmpl",
"version": "3.4.0",
"title": "JavaScript Templates",
"description": "1KB lightweight, fast & powerful JavaScript templating engine with zero dependencies. Compatible with server-side environments like Node.js, module loaders like RequireJS, Browserify or webpack and all web browsers.",
"keywords": [
"javascript",
"templates",
"templating"
],
"homepage": "https://github.com/blueimp/JavaScript-Templates",
"author": {
"name": "Sebastian Tschan",
"url": "https://blueimp.net"
},
"repository": {
"type": "git",
"url": "git://github.com/blueimp/JavaScript-Templates.git"
},
"license": "MIT",
"devDependencies": {
"expect.js": "0.3.1",
"mocha": "2.3.4",
"standard": "6.0.7",
"uglify-js": "2.6.1"
},
"scripts": {
"test": "standard js/*.js test/*.js && mocha",
"build": "cd js && uglifyjs tmpl.js -c -m -o tmpl.min.js --source-map tmpl.min.js.map",
"preversion": "npm test",
"version": "npm run build && git add -A js",
"postversion": "git push --tags origin master master:gh-pages && npm publish"
},
"bin": {
"tmpl.js": "js/compile.js"
},
"main": "js/tmpl.js"
}