text: !function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(window.jQuery)}(function(d){d.ui=d.ui||{},d.ui.version="1.12.1",d.expr.pseudos||(d.expr.pseudos=d.expr[":"]),d.uniqueSort||(d.uniqueSort=d.unique);var r,i=0,a=Array.prototype.hasOwnProperty,s=Array.prototype.slice;d.cleanData=(r=d.cleanData,function(e){for(var t,i,n=0;null!=(i=e[n]);n++)(t=d._data(i,"events"))&&t.remove&&d(i).triggerHandler("remove");r(e)}),d.widget=function(e,i,t){var n,r,o,a={},s=e.split(".")[0],l=s+"-"+(e=e.split(".")[1]);return t||(t=i,i=d.Widget),d.isArray(t)&&(t=d.extend.apply(null,[{}].concat(t))),d.expr.pseudos[l.toLowerCase()]=function(e){return!!d.data(e,l)},d[s]=d[s]||{},n=d[s][e],r=d[s][e]=function(e,t){if(!this._createWidget)return new r(e,t);arguments.length&&this._createWidget(e,t)},d.extend(r,n,{version:t.version,_proto:d.extend({},t),_childConstructors:[]}),(o=new i).options=d.widget.extend({},o.options),d.each(t,function(t,n){function r(){return i.prototype[t].apply(this,arguments)}function o(e){return i.prototype[t].apply(this,e)}d.isFunction(n)?a[t]=function(){var e,t=this._super,i=this._superApply;return this._super=r,this._superApply=o,e=n.apply(this,arguments),this._super=t,this._superApply=i,e}:a[t]=n}),r.prototype=d.widget.extend(o,{widgetEventPrefix:n&&o.widgetEventPrefix||e},a,{constructor:r,namespace:s,widgetName:e,widgetFullName:l}),n?(d.each(n._childConstructors,function(e,t){var i=t.prototype;d.widget(i.namespace+"."+i.widgetName,r,t._proto)}),delete n._childConstructors):i._childConstructors.push(r),d.widget.bridge(e,r),r},d.widget.extend=function(e){for(var t,i,n=s.call(arguments,1),r=0,o=n.length;r<o;r++)for(t in n[r])i=n[r][t],a.call(n[r],t)&&void 0!==i&&(d.isPlainObject(i)?e[t]=d.isPlainObject(e[t])?d.widget.extend({},e[t],i):d.widget.extend({},i):e[t]=i);return e},d.widget.bridge=function(o,t){var a=t.prototype.widgetFullName||o;d.fn[o]=function(i){var e="string"==typeof i,n=s.call(arguments,1),r=this;return e?this.length||"instance"!==i?this.each(function(){var e,t=d.data(this,a);return"instance"===i?(r=t,!1):t?d.isFunction(t[i])&&"_"!==i.charAt(0)?(e=t[i].apply(t,n))!==t&&void 0!==e?(r=e&&e.jquery?r.pushStack(e.get()):e,!1):void 0:d.error("no such method '"+i+"' for "+o+" widget instance"):d.error("cannot call methods on "+o+" prior to initialization; attempted to call method '"+i+"'")}):r=void 0:(n.length&&(i=d.widget.extend.apply(null,[i].concat(n))),this.each(function(){var e=d.data(this,a);e?(e.option(i||{}),e._init&&e._init()):d.data(this,a,new t(i,this))})),r}},d.Widget=function(){},d.Widget._childConstructors=[],d.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",defaultElement:"<div>",options:{classes:{},disabled:!1,create:null},_createWidget:function(e,t){t=d(t||this.defaultElement||this)[0],this.element=d(t),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=d(),this.hoverable=d(),this.focusable=d(),this.classesElementLookup={},t!==this&&(d.data(t,this.widgetFullName,this),this._on(!0,this.element,{remove:function(e){e.target===t&&this.destroy()}}),this.document=d(t.style?t.ownerDocument:t.document||t),this.window=d(this.document[0].defaultView||this.document[0].parentWindow)),this.options=d.widget.extend({},this.options,this._getCreateOptions(),e),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:d.noop,_create:d.noop,_init:d.noop,destroy:function(){var i=this;this._destroy(),d.each(this.classesElementLookup,function(e,t){i._removeClass(t,e)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:d.noop,widget:function(){return this.element},option:function(e,t){var i,n,r,o=e;if(0===arguments.length)return d.widget.extend({},this.options);if("string"==typeof e)if(o={},e=(i=e.split(".")).shift(),i.length){for(n=o[e]=d.widget.extend({},this.options[e]),r=0;r<i.length-1;r++)n[i[r]]=n[i[r]]||{},n=n[i[r]];if(e=i.pop(),1===arguments.length)return void 0===n[e]?null:n[e];n[e]=t}else{if(1===arguments.length)return void 0===this.options[e]?null:this.options[e];o[e]=t}return this._setOptions(o),this},_setOptions:function(e){for(var t in e)this._setOption(t,e[t]);return this},_setOption:function(e,t){return"classes"===e&&this._setOptionClasses(t),this.options[e]=t,"disabled"===e&&this._setOptionDisabled(t),this},_setOptionClasses:function(e){var t,i,n;for(t in e)n=this.classesElementLookup[t],e[t]!==this.options.classes[t]&&n&&n.length&&(i=d(n.get()),this._removeClass(n,t),i.addClass(this._classes({element:i,keys:t,classes:e,add:!0})))},_setOptionDisabled:function(e){this._toggleClass(this.widget(),this.widgetFullName+"-disabled",null,!!e),e&&(this._removeClass(this.hoverable,null,"ui-state-hover"),this._removeClass(this.focusable,null,"ui-state-focus"))},enable:function(){return this._setOptions({disabled:!1})},disable:function(){return this._setOptions({disabled:!0})},_classes:function(r){var o=[],a=this;function e(e,t){for(var i,n=0;n<e.length;n++)i=a.classesElementLookup[e[n]]||d(),i=r.add?(r.element.each(function(e,t){d.map(a.classesElementLookup,function(e){return e}).some(function(e){return e.is(t)})||a._on(d(t),{remove:"_untrackClassesElement"})}),d(d.uniqueSort(i.get().concat(r.element.get())))):d(i.not(r.element).get()),a.classesElementLookup[e[n]]=i,o.push(e[n]),t&&r.classes[e[n]]&&o.push(r.classes[e[n]])}return(r=d.extend({element:this.element,classes:this.options.classes||{}},r)).keys&&e(r.keys.match(/\S+/g)||[],!0),r.extra&&e(r.extra.match(/\S+/g)||[]),o.join(" ")},_untrackClassesElement:function(i){var n=this;d.each(n.classesElementLookup,function(e,t){-1!==d.inArray(i.target,t)&&(n.classesElementLookup[e]=d(t.not(i.target).get()))}),this._off(d(i.target))},_removeClass:function(e,t,i){return this._toggleClass(e,t,i,!1)},_addClass:function(e,t,i){return this._toggleClass(e,t,i,!0)},_toggleClass:function(e,t,i,n){var r="string"==typeof e||null===e,i={extra:r?t:i,keys:r?e:t,element:r?this.element:e,add:n="boolean"==typeof n?n:i};return i.element.toggleClass(this._classes(i),n),this},_on:function(r,o,e){var a,s=this;"boolean"!=typeof r&&(e=o,o=r,r=!1),e?(o=a=d(o),this.bindings=this.bindings.add(o)):(e=o,o=this.element,a=this.widget()),d.each(e,function(e,t){function i(){if(r||!0!==s.options.disabled&&!d(this).hasClass("ui-state-disabled"))return("string"==typeof t?s[t]:t).apply(s,arguments)}"string"!=typeof t&&(i.guid=t.guid=t.guid||i.guid||d.guid++);var n=e.match(/^([\w:-]*)\s*(.*)$/),e=n[1]+s.eventNamespace,n=n[2];n?a.on(e,n,i):o.on(e,i)})},_off:function(e,t){t=(t||"").split(" ").join(this.eventNamespace+" ")+this.eventNamespace,e.off(t),this.bindings=d(this.bindings.not(e).get()),this.focusable=d(this.focusable.not(e).get()),this.hoverable=d(this.hoverable.not(e).get())},_delay:function(e,t){var i=this;return setTimeout(function(){return("string"==typeof e?i[e]:e).apply(i,arguments)},t||0)},_hoverable:function(e){this.hoverable=this.hoverable.add(e),this._on(e,{mouseenter:function(e){this._addClass(d(e.currentTarget),null,"ui-state-hover")},mouseleave:function(e){this._removeClass(d(e.currentTarget),null,"ui-state-hover")}})},_focusable:function(e){this.focusable=this.focusable.add(e),this._on(e,{focusin:function(e){this._addClass(d(e.currentTarget),null,"ui-state-focus")},focusout:function(e){this._removeClass(d(e.currentTarget),null,"ui-state-focus")}})},_trigger:function(e,t,i){var n,r,o=this.options[e];if(i=i||{},(t=d.Event(t)).type=(e===this.widgetEventPrefix?e:this.widgetEventPrefix+e).toLowerCase(),t.target=this.element[0],r=t.originalEvent)for(n in r)n in t||(t[n]=r[n]);return this.element.trigger(t,i),!(d.isFunction(o)&&!1===o.apply(this.element[0],[t].concat(i))||t.isDefaultPrevented())}},d.each({show:"fadeIn",hide:"fadeOut"},function(o,a){d.Widget.prototype["_"+o]=function(t,e,i){var n=(e="string"==typeof e?{effect:e}:e)?!0!==e&&"number"!=typeof e&&e.effect||a:o,r=!d.isEmptyObject(e="number"==typeof(e=e||{})?{duration:e}:e);e.complete=i,e.delay&&t.delay(e.delay),r&&d.effects&&d.effects.effect[n]?t[o](e):n!==o&&t[n]?t[n](e.duration,e.easing,i):t.queue(function(e){d(this)[o](),i&&i.call(t[0]),e()})}})}),function(e){"use strict";var n=function(e,t){var i=/[^\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?i(t,n):function(e){return i(e,n)}};n.cache={},n.load=function(e){return document.getElementById(e).innerHTML},n.regexp=/([\s'\\])(?!(?:[^{]|\{(?!%))*%\})|(?:\{%(=|#)([\s\S]+?)%\})|(\{%)|(%\})/g,n.func=function(e,t,i,n,r,o){return t?{"\n":"\\n","\r":"\\r","\t":"\\t"," ":" "}[t]||"\\"+t:i?"="===i?"'+_e("+n+")+'":"'+("+n+"==null?'':"+n+")+'":r?"';":o?"_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),function(l){"use strict";var t=l.URL||l.webkitURL;function d(e){return!!t&&t.createObjectURL(e)}function i(e){return!!t&&t.revokeObjectURL(e)}function u(e,t){!e||"blob:"!==e.slice(0,5)||t&&t.noRevoke||i(e)}function c(e,t,i,n){if(!l.FileReader)return!1;var r=new FileReader;r.onload=function(){t.call(r,this.result)},i&&(r.onabort=r.onerror=function(){i.call(r,this.error)});n=r[n||"readAsDataURL"];return n?(n.call(r,e),r):void 0}function f(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"}function p(a,e,s){function t(i,n){var r,o=document.createElement("img");function t(e,t){i!==n?e instanceof Error?n(e):((t=t||{}).image=e,i(t)):i&&i(e,t)}function e(e,t){t&&l.console&&console.log(t),e&&f("Blob",e)?r=d(a=e):(r=a,s&&s.crossOrigin&&(o.crossOrigin=s.crossOrigin)),o.src=r}return o.onerror=function(e){u(r,s),n&&n.call(o,e)},o.onload=function(){u(r,s);var e={originalWidth:o.naturalWidth||o.width,originalHeight:o.naturalHeight||o.height};try{p.transform(o,s,t,a,e)}catch(e){n&&n(e)}},"string"==typeof a?(p.requiresMetaData(s)?p.fetchBlob(a,e,s):e(),o):f("Blob",a)||f("File",a)?(r=d(a))?(o.src=r,o):c(a,function(e){o.src=e},n):void 0}return l.Promise&&"function"!=typeof e?(s=e,new Promise(t)):t(e,e)}p.requiresMetaData=function(e){return e&&e.meta},p.fetchBlob=function(e,t){t()},p.transform=function(e,t,i,n,r){i(e,r)},p.global=l,p.readFile=c,p.isInstanceOf=f,p.createObjectURL=d,p.revokeObjectURL=i,"function"==typeof define&&define.amd?define(function(){return p}):"object"==typeof module&&module.exports?module.exports=p:l.loadImage=p}("undefined"!=typeof window&&window||this),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image"],e):"object"==typeof module&&module.exports?e(require("./load-image")):e(window.loadImage)}(function(w){"use strict";var o=w.transform;w.createCanvas=function(e,t,i){if(i&&w.global.OffscreenCanvas)return new OffscreenCanvas(e,t);i=document.createElement("canvas");return i.width=e,i.height=t,i},w.transform=function(e,t,i,n,r){o.call(w,w.scale(e,t,r),t,i,n,r)},w.transformCoordinates=function(){},w.getTransformedOptions=function(e,t){var i,n,r,o=t.aspectRatio;if(!o)return t;for(n in i={},t)Object.prototype.hasOwnProperty.call(t,n)&&(i[n]=t[n]);return i.crop=!0,o<(r=e.naturalWidth||e.width)/(e=e.naturalHeight||e.height)?(i.maxWidth=e*o,i.maxHeight=e):(i.maxWidth=r,i.maxHeight=r/o),i},w.drawImage=function(e,t,i,n,r,o,a,s,l){t=t.getContext("2d");return!1===l.imageSmoothingEnabled?(t.msImageSmoothingEnabled=!1,t.imageSmoothingEnabled=!1):l.imageSmoothingQuality&&(t.imageSmoothingQuality=l.imageSmoothingQuality),t.drawImage(e,i,n,r,o,0,0,a,s),t},w.requiresCanvas=function(e){return e.canvas||e.crop||!!e.aspectRatio},w.scale=function(e,t,i){t=t||{},i=i||{};var n,r,o,a,s,l,d,u,c,f,p,h=e.getContext||w.requiresCanvas(t)&&!!w.global.HTMLCanvasElement,g=e.naturalWidth||e.width,m=e.naturalHeight||e.height,v=g,b=m;function _(){var e=Math.max((o||v)/v,(a||b)/b);1<e&&(v*=e,b*=e)}function y(){var e=Math.min((n||v)/v,(r||b)/b);e<1&&(v*=e,b*=e)}if(h&&(d=(t=w.getTransformedOptions(e,t,i)).left||0,u=t.top||0,t.sourceWidth?(s=t.sourceWidth,void 0!==t.right&&void 0===t.left&&(d=g-s-t.right)):s=g-d-(t.right||0),t.sourceHeight?(l=t.sourceHeight,void 0!==t.bottom&&void 0===t.top&&(u=m-l-t.bottom)):l=m-u-(t.bottom||0),v=s,b=l),n=t.maxWidth,r=t.maxHeight,o=t.minWidth,a=t.minHeight,h&&n&&r&&t.crop?(f=s/l-(v=n)/(b=r))<0?(l=r*s/n,void 0===t.top&&void 0===t.bottom&&(u=(m-l)/2)):0<f&&(s=n*l/r,void 0===t.left&&void 0===t.right&&(d=(g-s)/2)):((t.contain||t.cover)&&(o=n=n||o,a=r=r||a),t.cover?(y(),_()):(_(),y())),h){if(1<(h=t.pixelRatio)&&(!e.style.width||Math.floor(parseFloat(e.style.width,10))!==Math.floor(g/h))&&(v*=h,b*=h),w.orientationCropBug&&!e.getContext&&(d||u||s!==g||l!==m)&&(f=e,e=w.createCanvas(g,m,!0),w.drawImage(f,e,0,0,g,m,g,m,t)),0<(c=t.downsamplingRatio)&&c<1&&v<s&&b<l)for(;v<s*c;)p=w.createCanvas(s*c,l*c,!0),w.drawImage(e,p,d,u,s,l,p.width,p.height,t),u=d=0,s=p.width,l=p.height,e=p;return p=w.createCanvas(v,b),w.transformCoordinates(p,t,i),1<h&&(p.style.width=p.width/h+"px"),w.drawImage(e,p,d,u,s,l,v,b,t).setTransform(1,0,0,1,0,0),p}return e.width=v,e.height=b,e}}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image"],e):"object"==typeof module&&module.exports?e(require("./load-image")):e(window.loadImage)}(function(a){"use strict";var s=a.global,l=a.transform,n=s.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice),h=s.ArrayBuffer&&ArrayBuffer.prototype.slice||function(e,t){t=t||this.byteLength-e;e=new Uint8Array(this,e,t),t=new Uint8Array(t);return t.set(e),t.buffer},g={jpeg:{65505:[],65517:[]}};function d(t,e,c,f){var p=this;function i(d,u){if(!(s.DataView&&n&&t&&12<=t.size&&"image/jpeg"===t.type))return d(f);var e=c.maxMetaDataSize||262144;a.readFile(n.call(t,0,e),function(e){var t=new DataView(e);if(65496!==t.getUint16(0))return u(new Error("Invalid JPEG file: Missing JPEG marker."));for(var i,n,r,o,a=2,s=t.byteLength-4,l=a;a<s&&(65504<=(i=t.getUint16(a))&&i<=65519||65534===i);){if(a+(n=t.getUint16(a+2)+2)>t.byteLength){console.log("Invalid JPEG metadata: Invalid segment size.");break}if((r=g.jpeg[i])&&!c.disableMetaDataParsers)for(o=0;o<r.length;o+=1)r[o].call(p,t,a,n,f,c);l=a+=n}!c.disableImageHead&&6<l&&(f.imageHead=h.call(e,0,l)),d(f)},u,"readAsArrayBuffer")||d(f)}return c=c||{},s.Promise&&"function"!=typeof e?(f=c=e||{},new Promise(i)):(f=f||{},i(e,e))}function r(e,t,i){return e&&t&&i?new Blob([i,n.call(e,t.byteLength)],{type:"image/jpeg"}):null}a.transform=function(t,i,n,r,o){a.requiresMetaData(i)?d(r,function(e){e!==o&&(s.console&&console.log(e),e=o),l.call(a,t,i,n,r,e)},i,o=o||{}):l.apply(a,arguments)},a.blobSlice=n,a.bufferSlice=h,a.replaceHead=function(t,i,n){var e={maxMetaDataSize:256,disableMetaDataParsers:!0};if(!n&&s.Promise)return d(t,e).then(function(e){return r(t,e.imageHead,i)});d(t,function(e){n(r(t,e.imageHead,i))},e)},a.parseMetaData=d,a.metaDataParsers=g}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image"],e):"object"==typeof module&&module.exports?e(require("./load-image")):e(window.loadImage)}(function(e){"use strict";var o=e.global;o.fetch&&o.Request&&o.Response&&o.Response.prototype.blob?e.fetchBlob=function(e,t,i){function n(e){return e.blob()}if(o.Promise&&"function"!=typeof t)return fetch(new Request(e,t)).then(n);fetch(new Request(e,i)).then(n).then(t).catch(function(e){t(null,e)})}:o.XMLHttpRequest&&""===(new XMLHttpRequest).responseType&&(e.fetchBlob=function(e,t,r){function i(t,i){r=r||{};var n=new XMLHttpRequest;n.open(r.method||"GET",e),r.headers&&Object.keys(r.headers).forEach(function(e){n.setRequestHeader(e,r.headers[e])}),n.withCredentials="include"===r.credentials,n.responseType="blob",n.onload=function(){t(n.response)},n.onerror=n.onabort=n.ontimeout=function(e){t===i?i(null,e):i(e)},n.send(r.body)}return o.Promise&&"function"!=typeof t?(r=t,new Promise(i)):i(t,t)})}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image","./load-image-scale","./load-image-meta"],e):"object"==typeof module&&module.exports?e(require("./load-image"),require("./load-image-scale"),require("./load-image-meta")):e(window.loadImage)}(function(u){"use strict";var t,i,o=u.transform,n=u.requiresCanvas,r=u.requiresMetaData,l=u.transformCoordinates,c=u.getTransformedOptions;function a(e,t){e=e&&e.orientation;return!0===e&&!u.orientation||1===e&&u.orientation||(!t||u.orientation)&&1<e&&e<9}function f(e,t){return e!==t&&(1===e&&1<t&&t<9||1<e&&e<9)}function p(e,t){if(1<t&&t<9)switch(e){case 2:case 4:return 4<t;case 5:case 7:return t%2==0;case 6:case 8:return 2===t||4===t||5===t||7===t}}(t=u).global.document&&((i=document.createElement("img")).onload=function(){var e;t.orientation=2===i.width&&3===i.height,t.orientation&&((e=t.createCanvas(1,1,!0).getContext("2d")).drawImage(i,1,1,1,1,0,0,1,1),t.orientationCropBug="255,255,255,255"!==e.getImageData(0,0,1,1).data.toString())},i.src="data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAIAAwMBEQACEQEDEQH/xABRAAEAAAAAAAAAAAAAAAAAAAAKEAEBAQADAQEAAAAAAAAAAAAGBQQDCAkCBwEBAAAAAAAAAAAAAAAAAAAAABEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMRAD8AG8T9NfSMEVMhQvoP3fFiRZ+MTHDifa/95OFSZU5OzRzxkyejv8ciEfhSceSXGjS8eSdLnZc2HDm4M3BxcXwH/9k="),u.requiresCanvas=function(e){return a(e)||n.call(u,e)},u.requiresMetaData=function(e){return a(e,!0)||r.call(u,e)},u.transform=function(e,t,r,i,n){o.call(u,e,t,function(e,t){var i,n;!t||4<(n=u.orientation&&t.exif&&t.exif.get("Orientation"))&&n<9&&(i=t.originalWidth,n=t.originalHeight,t.originalWidth=n,t.originalHeight=i),r(e,t)},i,n)},u.getTransformedOptions=function(e,t,i){var n=c.call(u,e,t),e=i.exif&&i.exif.get("Orientation"),t=n.orientation,i=u.orientation&&e;if(!f(t=!0===t?e:t,i))return n;var r,o=n.top,a=n.right,s=n.bottom,l=n.left,d={};for(r in n)Object.prototype.hasOwnProperty.call(n,r)&&(d[r]=n[r]);if((4<(d.orientation=t)&&!(4<i)||t<5&&4<i)&&(d.maxWidth=n.maxHeight,d.maxHeight=n.maxWidth,d.minWidth=n.minHeight,d.minHeight=n.minWidth,d.sourceWidth=n.sourceHeight,d.sourceHeight=n.sourceWidth),1<i){switch(i){case 2:a=n.left,l=n.right;break;case 3:o=n.bottom,a=n.left,s=n.top,l=n.right;break;case 4:o=n.bottom,s=n.top;break;case 5:o=n.left,a=n.bottom,s=n.right,l=n.top;break;case 6:o=n.left,a=n.top,s=n.right,l=n.bottom;break;case 7:o=n.right,a=n.top,s=n.left,l=n.bottom;break;case 8:o=n.right,a=n.bottom,s=n.left,l=n.top}p(t,i)&&(e=o,i=a,o=s,a=l,s=e,l=i)}switch(d.top=o,d.right=a,d.bottom=s,d.left=l,t){case 2:d.right=l,d.left=a;break;case 3:d.top=s,d.right=l,d.bottom=o,d.left=a;break;case 4:d.top=s,d.bottom=o;break;case 5:d.top=l,d.right=s,d.bottom=a,d.left=o;break;case 6:d.top=a,d.right=s,d.bottom=l,d.left=o;break;case 7:d.top=a,d.right=o,d.bottom=l,d.left=s;break;case 8:d.top=l,d.right=o,d.bottom=a,d.left=s}return d},u.transformCoordinates=function(e,t,i){l.call(u,e,t,i);t=t.orientation,i=u.orientation&&i.exif&&i.exif.get("Orientation");if(f(t,i)){var n=e.getContext("2d"),r=e.width,o=e.height,a=r,s=o;switch((4<t&&!(4<i)||t<5&&4<i)&&(e.width=o,e.height=r),4<t&&(a=o,s=r),i){case 2:n.translate(a,0),n.scale(-1,1);break;case 3:n.translate(a,s),n.rotate(Math.PI);break;case 4:n.translate(0,s),n.scale(1,-1);break;case 5:n.rotate(-.5*Math.PI),n.scale(-1,1);break;case 6:n.rotate(-.5*Math.PI),n.translate(-a,0);break;case 7:n.rotate(-.5*Math.PI),n.translate(-a,s),n.scale(1,-1);break;case 8:n.rotate(.5*Math.PI),n.translate(0,-s)}switch(p(t,i)&&(n.translate(a,s),n.rotate(Math.PI)),t){case 2:n.translate(r,0),n.scale(-1,1);break;case 3:n.translate(r,o),n.rotate(Math.PI);break;case 4:n.translate(0,o),n.scale(1,-1);break;case 5:n.rotate(.5*Math.PI),n.scale(1,-1);break;case 6:n.rotate(.5*Math.PI),n.translate(0,-o);break;case 7:n.rotate(.5*Math.PI),n.translate(r,-o),n.scale(-1,1);break;case 8:n.rotate(-.5*Math.PI),n.translate(-r,0)}}}}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image","./load-image-meta"],e):"object"==typeof module&&module.exports?e(require("./load-image"),require("./load-image-meta")):e(window.loadImage)}(function(r){"use strict";function h(e){e&&(Object.defineProperty(this,"map",{value:this.ifds[e].map}),Object.defineProperty(this,"tags",{value:this.tags&&this.tags[e]||{}}))}h.prototype.ifds={ifd1:{name:"Thumbnail",map:h.prototype.map={Orientation:274,Thumbnail:"ifd1",Blob:513,Exif:34665,GPSInfo:34853,Interoperability:40965}},34665:{name:"Exif",map:{}},34853:{name:"GPSInfo",map:{}},40965:{name:"Interoperability",map:{}}},h.prototype.get=function(e){return this[e]||this[this.map[e]]};var g={1:{getValue:function(e,t){return e.getUint8(t)},size:1},2:{getValue:function(e,t){return String.fromCharCode(e.getUint8(t))},size:1,ascii:!0},3:{getValue:function(e,t,i){return e.getUint16(t,i)},size:2},4:{getValue:function(e,t,i){return e.getUint32(t,i)},size:4},5:{getValue:function(e,t,i){return e.getUint32(t,i)/e.getUint32(t+4,i)},size:8},9:{getValue:function(e,t,i){return e.getInt32(t,i)},size:4},10:{getValue:function(e,t,i){return e.getInt32(t,i)/e.getInt32(t+4,i)},size:8}};function m(e,t,i){return(!e||e[i])&&(!t||!0!==t[i])}function v(e,t,i,n,r,o,a,s){var l,d,u,c,f,p;if(i+6>e.byteLength)console.log("Invalid Exif data: Invalid directory offset.");else{if(!((d=i+2+12*(l=e.getUint16(i,n)))+4>e.byteLength)){for(u=0;u<l;u+=1)m(a,s,f=e.getUint16(c=i+2+12*u,n))&&(p=function(e,t,i,n,r,o){var a,s,l,d,u,c=g[n];if(c){if(!((a=4<(n=c.size*r)?t+e.getUint32(i+8,o):i+8)+n>e.byteLength)){if(1===r)return c.getValue(e,a,o);for(s=[],l=0;l<r;l+=1)s[l]=c.getValue(e,a+l*c.size,o);if(c.ascii){for(d="",l=0;l<s.length&&"\0"!==(u=s[l]);l+=1)d+=u;return d}return s}console.log("Invalid Exif data: Invalid data offset.")}else console.log("Invalid Exif data: Invalid tag type.")}(e,t,c,e.getUint16(c+2,n),e.getUint32(c+4,n),n),r[f]=p,o&&(o[f]=c));return e.getUint32(d,n)}console.log("Invalid Exif data: Invalid directory size.")}}g[7]=g[1],r.parseExifData=function(l,e,t,d,i){if(!i.disableExif){var u,c=i.includeExifTags,f=i.excludeExifTags||{34665:{37500:!0}},p=e+10;if(1165519206===l.getUint32(e+4))if(p+8>l.byteLength)console.log("Invalid Exif data: Invalid segment size.");else if(0===l.getUint16(e+8)){switch(l.getUint16(p)){case 18761:u=!0;break;case 19789:u=!1;break;default:return void console.log("Invalid Exif data: Invalid byte alignment marker.")}42===l.getUint16(p+2,u)?(e=l.getUint32(p+4,u),d.exif=new h,i.disableExifOffsets||(d.exifOffsets=new h,d.exifTiffOffset=p,d.exifLittleEndian=u),(e=v(l,p,p+e,u,d.exif,d.exifOffsets,c,f))&&m(c,f,"ifd1")&&(d.exif.ifd1=e,d.exifOffsets&&(d.exifOffsets.ifd1=p+e)),Object.keys(d.exif.ifds).forEach(function(e){var t,i=e,n=l,r=p,o=u,a=c,s=f;(e=(t=d).exif[i])&&(t.exif[i]=new h(i),t.exifOffsets&&(t.exifOffsets[i]=new h(i)),v(n,r,r+e,o,t.exif[i],t.exifOffsets&&t.exifOffsets[i],a&&a[i],s&&s[i]))}),(e=d.exif.ifd1)&&e[513]&&(e[513]=function(e,t){if(t){if(!(e+t>l.byteLength))return new Blob([r.bufferSlice.call(l.buffer,e,e+t)],{type:"image/jpeg"});console.log("Invalid Exif data: Invalid thumbnail data.")}}(p+e[513],e[514]))):console.log("Invalid Exif data: Missing TIFF marker.")}else console.log("Invalid Exif data: Missing byte alignment offset.")}},r.metaDataParsers.jpeg[65505].push(r.parseExifData),r.exifWriters={274:function(e,t,i){var n=t.exifOffsets[274];return n&&new DataView(e,n+8,2).setUint16(0,i,t.exifLittleEndian),e}},r.writeExifData=function(e,t,i,n){return r.exifWriters[t.exif.map[i]](e,t,n)},r.ExifMap=h}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image","./load-image-exif"],e):"object"==typeof module&&module.exports?e(require("./load-image"),require("./load-image-exif")):e(window.loadImage)}(function(e){"use strict";var r=e.ExifMap.prototype;r.tags={256:"ImageWidth",257:"ImageHeight",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",34665:{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",36880:"OffsetTime",36881:"OffsetTimeOriginal",36882:"OffsetTimeDigitized",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"},34853:{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"},40965:{1:"InteroperabilityIndex"}},r.tags.ifd1=r.tags,r.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:"Original",2:"Horizontal flip",3:"Rotate 180° CCW",4:"Vertical flip",5:"Vertical flip + Rotate 90° CW",6:"Rotate 90° CW",7:"Horizontal flip + Rotate 90° CW",8:"Rotate 90° CCW"}},r.getText=function(e){var t=this.get(e);switch(e){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[e][t];case"ExifVersion":case"FlashpixVersion":return t?String.fromCharCode(t[0],t[1],t[2],t[3]):void 0;case"ComponentsConfiguration":return t?this.stringValues[e][t[0]]+this.stringValues[e][t[1]]+this.stringValues[e][t[2]]+this.stringValues[e][t[3]]:void 0;case"GPSVersionID":return t?t[0]+"."+t[1]+"."+t[2]+"."+t[3]:void 0}return String(t)},r.getAll=function(){var e,t,i={};for(e in this)Object.prototype.hasOwnProperty.call(this,e)&&((t=this[e])&&t.getAll?i[this.ifds[e].name]=t.getAll():(t=this.tags[e])&&(i[t]=this.getText(t)));return i},r.getName=function(e){var t=this.tags[e];return"object"==typeof t?this.ifds[e].name:t},function(){var e,t,i,n=r.tags;for(e in n)if(Object.prototype.hasOwnProperty.call(n,e))if(t=r.ifds[e])for(e in i=n[e])Object.prototype.hasOwnProperty.call(i,e)&&(t.map[i[e]]=Number(e));else r.map[n[e]]=Number(e)}()}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image","./load-image-meta"],e):"object"==typeof module&&module.exports?e(require("./load-image"),require("./load-image-meta")):e(window.loadImage)}(function(e){"use strict";function l(){}function d(e,t,i,n,r,o){for(var a,s,l,d,u,c,f,p=t+i,h=t;h<p;)28===e.getUint8(h)&&2===e.getUint8(h+1)&&(s=e.getUint8(h+2),r&&!r[s]||o&&o[s]||(a=e.getInt16(h+3),l=s,d=n.iptc,u=e,c=h+5,f=a,l="binary"===d.types[l]?new Blob([u.buffer.slice(c,c+f)]):"Uint16"===d.types[l]?u.getUint16(c):function(e){for(var t="",i=c+f,n=c;n<i;n+=1)t+=String.fromCharCode(e.getUint8(n));return t}(u),n.iptc[s]=(u=l,void 0===(l=n.iptc[s])?u:l instanceof Array?(l.push(u),l):[l,u]),n.iptcOffsets&&(n.iptcOffsets[s]=h))),h+=1}l.prototype.map={ObjectName:5},l.prototype.types={0:"Uint16",200:"Uint16",201:"Uint16",202:"binary"},l.prototype.get=function(e){return this[e]||this[this.map[e]]},e.parseIptcData=function(e,t,i,n,r){if(!r.disableIptc)for(var o=t+i;t+8<o;){if(943868237===(s=e).getUint32(a=t)&&1028===s.getUint16(a+4)){var a=(s=void 0,(s=e.getUint8(t+7))%2!=0&&(s+=1),s=0===s?4:s),s=t+8+a;if(o<s){console.log("Invalid IPTC data: Invalid segment offset.");break}a=e.getUint16(t+6+a);if(o<t+a){console.log("Invalid IPTC data: Invalid segment size.");break}return n.iptc=new l,r.disableIptcOffsets||(n.iptcOffsets=new l),void d(e,s,a,n,r.includeIptcTags,r.excludeIptcTags||{202:!0})}t+=1}},e.metaDataParsers.jpeg[65517].push(e.parseIptcData),e.IptcMap=l}),function(e){"use strict";"function"==typeof define&&define.amd?define(["./load-image","./load-image-iptc"],e):"object"==typeof module&&module.exports?e(require("./load-image"),require("./load-image-iptc")):e(window.loadImage)}(function(e){"use strict";var n=e.IptcMap.prototype;n.tags={0:"ApplicationRecordVersion",3:"ObjectTypeReference",4:"ObjectAttributeReference",5:"ObjectName",7:"EditStatus",8:"EditorialUpdate",10:"Urgency",12:"SubjectReference",15:"Category",20:"SupplementalCategories",22:"FixtureIdentifier",25:"Keywords",26:"ContentLocationCode",27:"ContentLocationName",30:"ReleaseDate",35:"ReleaseTime",37:"ExpirationDate",38:"ExpirationTime",40:"SpecialInstructions",42:"ActionAdvised",45:"ReferenceService",47:"ReferenceDate",50:"ReferenceNumber",55:"DateCreated",60:"TimeCreated",62:"DigitalCreationDate",63:"DigitalCreationTime",65:"OriginatingProgram",70:"ProgramVersion",75:"ObjectCycle",80:"Byline",85:"BylineTitle",90:"City",92:"Sublocation",95:"State",100:"CountryCode",101:"Country",103:"OriginalTransmissionReference",105:"Headline",110:"Credit",115:"Source",116:"CopyrightNotice",118:"Contact",120:"Caption",121:"LocalCaption",122:"Writer",125:"RasterizedCaption",130:"ImageType",131:"ImageOrientation",135:"LanguageIdentifier",150:"AudioType",151:"AudioSamplingRate",152:"AudioSamplingResolution",153:"AudioDuration",154:"AudioOutcue",184:"JobID",185:"MasterDocumentID",186:"ShortDocumentID",187:"UniqueDocumentID",188:"OwnerID",200:"ObjectPreviewFileFormat",201:"ObjectPreviewFileVersion",202:"ObjectPreviewData",221:"Prefs",225:"ClassifyState",228:"SimilarityIndex",230:"DocumentNotes",231:"DocumentHistory",232:"ExifCameraInfo",255:"CatalogSets"},n.stringValues={10:{0:"0 (reserved)",1:"1 (most urgent)",2:"2",3:"3",4:"4",5:"5 (normal urgency)",6:"6",7:"7",8:"8 (least urgent)",9:"9 (user-defined priority)"},75:{a:"Morning",b:"Both Morning and Evening",p:"Evening"},131:{L:"Landscape",P:"Portrait",S:"Square"}},n.getText=function(e){var t=this.get(e),e=this.map[e],e=this.stringValues[e];return e?e[t]:String(t)},n.getAll=function(){var e,t,i={};for(e in this)Object.prototype.hasOwnProperty.call(this,e)&&(t=this.tags[e])&&(i[t]=this.getText(t));return i},n.getName=function(e){return this.tags[e]},function(){var e,t=n.tags,i=n.map||{};for(e in t)Object.prototype.hasOwnProperty.call(t,e)&&(i[t[e]]=Number(e))}()}),function(e){"use strict";var r=e.HTMLCanvasElement&&e.HTMLCanvasElement.prototype,s=e.Blob&&function(){try{return Boolean(new Blob)}catch(e){return!1}}(),l=s&&e.Uint8Array&&function(){try{return 100===new Blob([new Uint8Array(100)]).size}catch(e){return!1}}(),d=e.BlobBuilder||e.WebKitBlobBuilder||e.MozBlobBuilder||e.MSBlobBuilder,u=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,o=(s||d)&&e.atob&&e.ArrayBuffer&&e.Uint8Array&&function(e){var t,i,n,r,o,a=e.match(u);if(!a)throw new Error("invalid data URI");for(t=a[2]?a[1]:"text/plain"+(a[3]||";charset=US-ASCII"),n=!!a[4],a=e.slice(a[0].length),i=(n?atob:decodeURIComponent)(a),n=new ArrayBuffer(i.length),r=new Uint8Array(n),o=0;o<i.length;o+=1)r[o]=i.charCodeAt(o);return s?new Blob([l?r:n],{type:t}):((a=new d).append(n),a.getBlob(t))};e.HTMLCanvasElement&&!r.toBlob&&(r.mozGetAsFile?r.toBlob=function(e,t,i){var n=this;setTimeout(function(){i&&r.toDataURL&&o?e(o(n.toDataURL(t,i))):e(n.mozGetAsFile("blob",t))})}:r.toDataURL&&o&&(r.msToBlob?r.toBlob=function(e,t,i){var n=this;setTimeout(function(){(t&&"image/png"!==t||i)&&r.toDataURL&&o?e(o(n.toDataURL(t,i))):e(n.msToBlob(t))})}:r.toBlob=function(e,t,i){var n=this;setTimeout(function(){e(o(n.toDataURL(t,i)))})})),"function"==typeof define&&define.amd?define(function(){return o}):"object"==typeof module&&module.exports?module.exports=o:e.dataURLtoBlob=o}(window),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?e(require("jquery")):e(window.jQuery)}(function(l){"use strict";var i=0,t=l,n="parseJSON";"JSON"in window&&"parse"in JSON&&(t=JSON,n="parse"),l.ajaxTransport("iframe",function(r){if(r.async){var o,a,t,s=r.initialIframeSrc||"javascript:false;";return{send:function(e,n){(o=l('<form style="display:none;"></form>')).attr("accept-charset",r.formAcceptCharset),t=/\?/.test(r.url)?"&":"?","DELETE"===r.type?(r.url=r.url+t+"_method=DELETE",r.type="POST"):"PUT"===r.type?(r.url=r.url+t+"_method=PUT",r.type="POST"):"PATCH"===r.type&&(r.url=r.url+t+"_method=PATCH",r.type="POST"),a=l('<iframe src="'+s+'" name="iframe-transport-'+(i+=1)+'"></iframe>').on("load",function(){var i,t=l.isArray(r.paramName)?r.paramName:[r.paramName];a.off("load").on("load",function(){var t;try{if(!(t=a.contents()).length||!t[0].firstChild)throw new Error}catch(e){t=void 0}n(200,"success",{iframe:t}),l('<iframe src="'+s+'"></iframe>').appendTo(o),window.setTimeout(function(){o.remove()},0)}),o.prop("target",a.prop("name")).prop("action",r.url).prop("method",r.type),r.formData&&l.each(r.formData,function(e,t){l('<input type="hidden"/>').prop("name",t.name).val(t.value).appendTo(o)}),r.fileInput&&r.fileInput.length&&"POST"===r.type&&(i=r.fileInput.clone(),r.fileInput.after(function(e){return i[e]}),r.paramName&&r.fileInput.each(function(e){l(this).prop("name",t[e]||r.paramName)}),o.append(r.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"),r.fileInput.removeAttr("form")),window.setTimeout(function(){o.submit(),i&&i.length&&r.fileInput.each(function(e,t){e=l(i[e]);l(t).prop("name",e.prop("name")).attr("form",e.attr("form")),e.replaceWith(t)})},0)}),o.append(a).appendTo(document.body)},abort:function(){a&&a.off("load").prop("src",s),o&&o.remove()}}}}),l.ajaxSetup({converters:{"iframe text":function(e){return e&&l(e[0].body).text()},"iframe json":function(e){return e&&t[n](l(e[0].body).text())},"iframe html":function(e){return e&&l(e[0].body).html()},"iframe xml":function(e){e=e&&e[0];return e&&l.isXMLDoc(e)?e:l.parseXML(e.XMLDocument&&e.XMLDocument.xml||l(e.body).html())},"iframe script":function(e){return e&&l.globalEval(l(e[0].body).text())}}})}),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","jquery-ui/ui/widget"],e):"object"==typeof exports?e(require("jquery"),require("./vendor/jquery.ui.widget")):e(window.jQuery)}(function(v){"use strict";function e(i){var n="dragover"===i;return function(e){e.dataTransfer=e.originalEvent&&e.originalEvent.dataTransfer;var t=e.dataTransfer;t&&-1!==v.inArray("Files",t.types)&&!1!==this._trigger(i,v.Event(i,{delegatedEvent:e}))&&(e.preventDefault(),n&&(t.dropEffect="copy"))}}var t;v.support.fileInput=!(new RegExp("(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)||v('<input type="file"/>').prop("disabled")),v.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader),v.support.xhrFormDataFileUpload=!!window.FormData,v.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice),v.widget("blueimp.yafFileUpload",{options:{dropZone:v(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,uniqueFilenames:void 0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(i,e){return i=this.messages[i]||i.toString(),e&&v.each(e,function(e,t){i=i.replace("{"+e+"}",t)}),i},formData:function(e){return e.serializeArray()},add:function(e,t){if(e.isDefaultPrevented())return!1;(t.autoUpload||!1!==t.autoUpload&&v(this).fileupload("option","autoUpload"))&&t.process().done(function(){t.submit()})},processData:!1,contentType:!1,cache:!1,timeout:0},_promisePipe:(t=v.fn.jquery.split("."),1<Number(t[0])||7<Number(t[1])?"then":"pipe"),_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:v.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.loaded=0,this.bitrate=0,this.getBitrate=function(e,t,i){var n=e-this.timestamp;return this.bitrate&&i&&!(i<n)||(this.bitrate=(t-this.loaded)*(1e3/n)*8,this.loaded=t,this.timestamp=e),this.bitrate}},_isXHRUpload:function(e){return!e.forceIframeTransport&&(!e.multipart&&v.support.xhrFileUpload||v.support.xhrFormDataFileUpload)},_getFormData:function(e){var i;return"function"===v.type(e.formData)?e.formData(e.form):v.isArray(e.formData)?e.formData:"object"===v.type(e.formData)?(i=[],v.each(e.formData,function(e,t){i.push({name:e,value:t})}),i):[]},_getTotal:function(e){var i=0;return v.each(e,function(e,t){i+=t.size||1}),i},_initProgressObject:function(e){var t={loaded:0,total:0,bitrate:0};e._progress?v.extend(e._progress,t):e._progress=t},_initResponseObject:function(e){if(e._response)for(var t in e._response)Object.prototype.hasOwnProperty.call(e._response,t)&&delete e._response[t];else e._response={}},_onProgress:function(e,t){var i,n;e.lengthComputable&&(i=Date.now?Date.now():(new Date).getTime(),t._time&&t.progressInterval&&i-t._time<t.progressInterval&&e.loaded!==e.total||(t._time=i,n=Math.floor(e.loaded/e.total*(t.chunkSize||t._progress.total))+(t.uploadedBytes||0),this._progress.loaded+=n-t._progress.loaded,this._progress.bitrate=this._bitrateTimer.getBitrate(i,this._progress.loaded,t.bitrateInterval),t._progress.loaded=t.loaded=n,t._progress.bitrate=t.bitrate=t._bitrateTimer.getBitrate(i,n,t.bitrateInterval),this._trigger("progress",v.Event("progress",{delegatedEvent:e}),t),this._trigger("progressall",v.Event("progressall",{delegatedEvent:e}),this._progress)))},_initProgressListener:function(i){var n=this,e=(i.xhr?i:v.ajaxSettings).xhr();e.upload&&(v(e.upload).on("progress",function(e){var t=e.originalEvent;e.lengthComputable=t.lengthComputable,e.loaded=t.loaded,e.total=t.total,n._onProgress(e,i)}),i.xhr=function(){return e})},_deinitProgressListener:function(e){e=(e.xhr?e:v.ajaxSettings).xhr();e.upload&&v(e.upload).off("progress")},_isInstanceOf:function(e,t){return Object.prototype.toString.call(t)==="[object "+e+"]"},_getUniqueFilename:function(e,t){return t[e=String(e)]?(e=e.replace(/(?: \(([\d]+)\))?(\.[^.]+)?$/,function(e,t,i){return" ("+(t?Number(t)+1:1)+")"+(i||"")}),this._getUniqueFilename(e,t)):(t[e]=!0,e)},_initXHRData:function(n){var r,o=this,e=n.files[0],t=n.multipart||!v.support.xhrFileUpload,a="array"===v.type(n.paramName)?n.paramName[0]:n.paramName;n.headers=v.extend({},n.headers),n.contentRange&&(n.headers["Content-Range"]=n.contentRange),t&&!n.blob&&this._isInstanceOf("File",e)||(n.headers["Content-Disposition"]='attachment; filename="'+encodeURI(e.uploadName||e.name)+'"'),t?v.support.xhrFormDataFileUpload&&(n.postMessage?(r=this._getFormData(n),n.blob?r.push({name:a,value:n.blob}):v.each(n.files,function(e,t){r.push({name:"array"===v.type(n.paramName)&&n.paramName[e]||a,value:t})})):(o._isInstanceOf("FormData",n.formData)?r=n.formData:(r=new FormData,v.each(this._getFormData(n),function(e,t){r.append(t.name,t.value)})),n.blob?r.append(a,n.blob,e.uploadName||e.name):v.each(n.files,function(e,t){var i;(o._isInstanceOf("File",t)||o._isInstanceOf("Blob",t))&&(i=t.uploadName||t.name,n.uniqueFilenames&&(i=o._getUniqueFilename(i,n.uniqueFilenames)),r.append("array"===v.type(n.paramName)&&n.paramName[e]||a,t,i))})),n.data=r):(n.contentType=e.type||"application/octet-stream",n.data=n.blob||e),n.blob=null},_initIframeSettings:function(e){var t=v("<a></a>").prop("href",e.url).prop("host");e.dataType="iframe "+(e.dataType||""),e.formData=this._getFormData(e),e.redirect&&t&&t!==location.host&&e.formData.push({name:e.redirectParamName||"redirect",value:e.redirect})},_initDataSettings:function(e){this._isXHRUpload(e)?(this._chunkedUpload(e,!0)||(e.data||this._initXHRData(e),this._initProgressListener(e)),e.postMessage&&(e.dataType="postmessage "+(e.dataType||""))):this._initIframeSettings(e)},_getParamName:function(e){var t=v(e.fileInput),n=e.paramName;return n?v.isArray(n)||(n=[n]):(n=[],t.each(function(){for(var e=v(this),t=e.prop("name")||"files[]",i=(e.prop("files")||[1]).length;i;)n.push(t),--i}),n.length||(n=[t.prop("name")||"files[]"])),n},_initFormSettings:function(e){e.form&&e.form.length||(e.form=v(e.fileInput.prop("form")),e.form.length||(e.form=v(this.options.fileInput.prop("form")))),e.paramName=this._getParamName(e),e.url||(e.url=e.form.prop("action")||location.href),e.type=(e.type||"string"===v.type(e.form.prop("method"))&&e.form.prop("method")||"").toUpperCase(),"POST"!==e.type&&"PUT"!==e.type&&"PATCH"!==e.type&&(e.type="POST"),e.formAcceptCharset||(e.formAcceptCharset=e.form.attr("accept-charset"))},_getAJAXSettings:function(e){e=v.extend({},this.options,e);return this._initFormSettings(e),this._initDataSettings(e),e},_getDeferredState:function(e){return e.state?e.state():e.isResolved()?"resolved":e.isRejected()?"rejected":"pending"},_enhancePromise:function(e){return e.success=e.done,e.error=e.fail,e.complete=e.always,e},_getXHRPromise:function(e,t,i){var n=v.Deferred(),r=n.promise();return t=t||this.options.context||r,!0===e?n.resolveWith(t,i):!1===e&&n.rejectWith(t,i),r.abort=n.promise,this._enhancePromise(r)},_addConvenienceMethods:function(e,i){function n(e){return v.Deferred().resolveWith(r,e).promise()}var r=this;i.process=function(e,t){return(e||t)&&(i._processQueue=this._processQueue=(this._processQueue||n([this]))[r._promisePipe](function(){return i.errorThrown?v.Deferred().rejectWith(r,[i]).promise():n(arguments)})[r._promisePipe](e,t)),this._processQueue||n([this])},i.submit=function(){return"pending"!==this.state()&&(i.jqXHR=this.jqXHR=!1!==r._trigger("submit",v.Event("submit",{delegatedEvent:e}),this)&&r._onSend(e,this)),this.jqXHR||r._getXHRPromise()},i.abort=function(){return this.jqXHR?this.jqXHR.abort():(this.errorThrown="abort",r._trigger("fail",null,this),r._getXHRPromise(!1))},i.state=function(){return this.jqXHR?r._getDeferredState(this.jqXHR):this._processQueue?r._getDeferredState(this._processQueue):void 0},i.processing=function(){return!this.jqXHR&&this._processQueue&&"pending"===r._getDeferredState(this._processQueue)},i.progress=function(){return this._progress},i.response=function(){return this._response}},_getUploadedBytes:function(e){e=e.getResponseHeader("Range"),e=e&&e.split("-"),e=e&&1<e.length&&parseInt(e[1],10);return e&&e+1},_chunkedUpload:function(o,e){o.uploadedBytes=o.uploadedBytes||0;var t,a,s=this,i=o.files[0],l=i.size,d=o.uploadedBytes,u=o.maxChunkSize||l,c=this._blobSlice,f=v.Deferred(),n=f.promise();return!(!(this._isXHRUpload(o)&&c&&(d||("function"===v.type(u)?u(o):u)<l))||o.data)&&(!!e||(l<=d?(i.error=o.i18n("uploadedBytes"),this._getXHRPromise(!1,o.context,[null,"error",i.error])):(a=function(){var n=v.extend({},o),r=n._progress.loaded;n.blob=c.call(i,d,d+("function"===v.type(u)?u(n):u),i.type),n.chunkSize=n.blob.size,n.contentRange="bytes "+d+"-"+(d+n.chunkSize-1)+"/"+l,s._trigger("chunkbeforesend",null,n),s._initXHRData(n),s._initProgressListener(n),t=(!1!==s._trigger("chunksend",null,n)&&v.ajax(n)||s._getXHRPromise(!1,n.context)).done(function(e,t,i){d=s._getUploadedBytes(i)||d+n.chunkSize,r+n.chunkSize-n._progress.loaded&&s._onProgress(v.Event("progress",{lengthComputable:!0,loaded:d-n.uploadedBytes,total:d-n.uploadedBytes}),n),o.uploadedBytes=n.uploadedBytes=d,n.result=e,n.textStatus=t,n.jqXHR=i,s._trigger("chunkdone",null,n),s._trigger("chunkalways",null,n),d<l?a():f.resolveWith(n.context,[e,t,i])}).fail(function(e,t,i){n.jqXHR=e,n.textStatus=t,n.errorThrown=i,s._trigger("chunkfail",null,n),s._trigger("chunkalways",null,n),f.rejectWith(n.context,[e,t,i])}).always(function(){s._deinitProgressListener(n)})},this._enhancePromise(n),n.abort=function(){return t.abort()},a(),n)))},_beforeSend:function(e,t){0===this._active&&(this._trigger("start"),this._bitrateTimer=new this._BitrateTimer,this._progress.loaded=this._progress.total=0,this._progress.bitrate=0),this._initResponseObject(t),this._initProgressObject(t),t._progress.loaded=t.loaded=t.uploadedBytes||0,t._progress.total=t.total=this._getTotal(t.files)||1,t._progress.bitrate=t.bitrate=0,this._active+=1,this._progress.loaded+=t.loaded,this._progress.total+=t.total},_onDone:function(e,t,i,n){var r=n._progress.total,o=n._response;n._progress.loaded<r&&this._onProgress(v.Event("progress",{lengthComputable:!0,loaded:r,total:r}),n),o.result=n.result=e,o.textStatus=n.textStatus=t,o.jqXHR=n.jqXHR=i,this._trigger("done",null,n)},_onFail:function(e,t,i,n){var r=n._response;n.recalculateProgress&&(this._progress.loaded-=n._progress.loaded,this._progress.total-=n._progress.total),r.jqXHR=n.jqXHR=e,r.textStatus=n.textStatus=t,r.errorThrown=n.errorThrown=i,this._trigger("fail",null,n)},_onAlways:function(e,t,i,n){this._trigger("always",null,n)},_onSend:function(e,t){t.submit||this._addConvenienceMethods(e,t);function i(){return a._sending+=1,s._bitrateTimer=new a._BitrateTimer,n=n||((r||!1===a._trigger("send",v.Event("send",{delegatedEvent:e}),s))&&a._getXHRPromise(!1,s.context,r)||a._chunkedUpload(s)||v.ajax(s)).done(function(e,t,i){a._onDone(e,t,i,s)}).fail(function(e,t,i){a._onFail(e,t,i,s)}).always(function(e,t,i){if(a._deinitProgressListener(s),a._onAlways(e,t,i,s),--a._sending,--a._active,s.limitConcurrentUploads&&s.limitConcurrentUploads>a._sending)for(var n=a._slots.shift();n;){if("pending"===a._getDeferredState(n)){n.resolve();break}n=a._slots.shift()}0===a._active&&a._trigger("stop")})}var n,r,o,a=this,s=a._getAJAXSettings(t);return this._beforeSend(e,s),this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?((t=1<this.options.limitConcurrentUploads?(o=v.Deferred(),this._slots.push(o),o[a._promisePipe](i)):(this._sequence=this._sequence[a._promisePipe](i,i),this._sequence)).abort=function(){return r=[void 0,"abort","abort"],n?n.abort():(o&&o.rejectWith(s.context,r),i())},this._enhancePromise(t)):i()},_onAdd:function(n,r){var o,e,a,t,s=this,l=!0,i=v.extend({},this.options,r),d=r.files,u=d.length,c=i.limitMultiFileUploads,f=i.limitMultiFileUploadSize,p=i.limitMultiFileUploadSizeOverhead,h=0,g=this._getParamName(i),m=0;if(!u)return!1;if(f&&void 0===d[0].size&&(f=void 0),(i.singleFileUploads||c||f)&&this._isXHRUpload(i))if(i.singleFileUploads||f||!c)if(!i.singleFileUploads&&f)for(a=[],o=[],t=0;t<u;t+=1)h+=d[t].size+p,(t+1===u||h+d[t+1].size+p>f||c&&c<=t+1-m)&&(a.push(d.slice(m,t+1)),(e=g.slice(m,t+1)).length||(e=g),o.push(e),m=t+1,h=0);else o=g;else for(a=[],o=[],t=0;t<u;t+=c)a.push(d.slice(t,t+c)),(e=g.slice(t,t+c)).length||(e=g),o.push(e);else a=[d],o=[g];return r.originalFiles=d,v.each(a||d,function(e,t){var i=v.extend({},r);return i.files=a?t:[t],i.paramName=o[e],s._initResponseObject(i),s._initProgressObject(i),s._addConvenienceMethods(n,i),l=s._trigger("add",v.Event("add",{delegatedEvent:n}),i)}),l},_replaceFileInput:function(e){var i=e.fileInput,n=i.clone(!0),t=i.is(document.activeElement);e.fileInputClone=n,v("<form></form>").append(n)[0].reset(),i.after(n).detach(),t&&n.trigger("focus"),v.cleanData(i.off("remove")),this.options.fileInput=this.options.fileInput.map(function(e,t){return t===i[0]?n[0]:t}),i[0]===this.element[0]&&(this.element=n)},_handleFileTreeEntry:function(t,i){function n(e){e&&!e.entry&&(e.entry=t),o.resolve([e])}var e,r=this,o=v.Deferred(),a=[],s=function(){e.readEntries(function(e){e.length?(a=a.concat(e),s()):(e=a,r._handleFileTreeEntries(e,i+t.name+"/").done(function(e){o.resolve(e)}).fail(n))},n)};return i=i||"",t.isFile?t._file?(t._file.relativePath=i,o.resolve(t._file)):t.file(function(e){e.relativePath=i,o.resolve(e)},n):t.isDirectory?(e=t.createReader(),s()):o.resolve([]),o.promise()},_handleFileTreeEntries:function(e,t){var i=this;return v.when.apply(v,v.map(e,function(e){return i._handleFileTreeEntry(e,t)}))[this._promisePipe](function(){return Array.prototype.concat.apply([],arguments)})},_getDroppedFiles:function(e){var t=(e=e||{}).items;return t&&t.length&&(t[0].webkitGetAsEntry||t[0].getAsEntry)?this._handleFileTreeEntries(v.map(t,function(e){var t;return e.webkitGetAsEntry?((t=e.webkitGetAsEntry())&&(t._file=e.getAsFile()),t):e.getAsEntry()})):v.Deferred().resolve(v.makeArray(e.files)).promise()},_getSingleFileInputFiles:function(e){var t=(e=v(e)).prop("webkitEntries")||e.prop("entries");if(t&&t.length)return this._handleFileTreeEntries(t);if((t=v.makeArray(e.prop("files"))).length)void 0===t[0].name&&t[0].fileName&&v.each(t,function(e,t){t.name=t.fileName,t.size=t.fileSize});else{if(!(e=e.prop("value")))return v.Deferred().resolve([]).promise();t=[{name:e.replace(/^.*\\/,"")}]}return v.Deferred().resolve(t).promise()},_getFileInputFiles:function(e){return e instanceof v&&1!==e.length?v.when.apply(v,v.map(e,this._getSingleFileInputFiles))[this._promisePipe](function(){return Array.prototype.concat.apply([],arguments)}):this._getSingleFileInputFiles(e)},_onChange:function(t){var i=this,n={fileInput:v(t.target),form:v(t.target.form)};this._getFileInputFiles(n.fileInput).always(function(e){n.files=e,i.options.replaceFileInput&&i._replaceFileInput(n),!1!==i._trigger("change",v.Event("change",{delegatedEvent:t}),n)&&i._onAdd(t,n)})},_onPaste:function(e){var t=e.originalEvent&&e.originalEvent.clipboardData&&e.originalEvent.clipboardData.items,i={files:[]};t&&t.length&&(v.each(t,function(e,t){t=t.getAsFile&&t.getAsFile();t&&i.files.push(t)}),!1!==this._trigger("paste",v.Event("paste",{delegatedEvent:e}),i)&&this._onAdd(e,i))},_onDrop:function(t){t.dataTransfer=t.originalEvent&&t.originalEvent.dataTransfer;var i=this,e=t.dataTransfer,n={};e&&e.files&&e.files.length&&(t.preventDefault(),this._getDroppedFiles(e).always(function(e){n.files=e,!1!==i._trigger("drop",v.Event("drop",{delegatedEvent:t}),n)&&i._onAdd(t,n)}))},_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})),v.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")},_destroy:function(){this._destroyEventHandlers()},_setOption:function(e,t){var i=-1!==v.inArray(e,this._specialOptions);i&&this._destroyEventHandlers(),this._super(e,t),i&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var e=this.options;void 0===e.fileInput?e.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):e.fileInput instanceof v||(e.fileInput=v(e.fileInput)),e.dropZone instanceof v||(e.dropZone=v(e.dropZone)),e.pasteZone instanceof v||(e.pasteZone=v(e.pasteZone))},_getRegExp:function(e){var t=e.split("/"),e=t.pop();return t.shift(),new RegExp(t.join("/"),e)},_isRegExpOption:function(e,t){return"url"!==e&&"string"===v.type(t)&&/^\/.*\/[igm]{0,3}$/.test(t)},_initDataAttributes:function(){var n=this,r=this.options,o=this.element.data();v.each(this.element[0].attributes,function(e,t){var i=t.name.toLowerCase();/^data-/.test(i)&&(i=i.slice(5).replace(/-[a-z]/g,function(e){return e.charAt(1).toUpperCase()}),t=o[i],n._isRegExpOption(i,t)&&(t=n._getRegExp(t)),r[i]=t)})},_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(t){var i=this;t&&!this.options.disabled&&(t.fileInput&&!t.files?this._getFileInputFiles(t.fileInput).always(function(e){t.files=e,i._onAdd(null,t)}):(t.files=v.makeArray(t.files),this._onAdd(null,t)))},send:function(t){if(t&&!this.options.disabled){if(t.fileInput&&!t.files){var i,n,r=this,o=v.Deferred(),e=o.promise();return e.abort=function(){return n=!0,i?i.abort():(o.reject(null,"abort","abort"),e)},this._getFileInputFiles(t.fileInput).always(function(e){n||(e.length?(t.files=e,(i=r._onSend(null,t)).then(function(e,t,i){o.resolve(e,t,i)},function(e,t,i){o.reject(e,t,i)})):o.reject())}),this._enhancePromise(e)}if(t.files=v.makeArray(t.files),t.files.length)return this._onSend(null,t)}return this._getXHRPromise(!1,t&&t.context)}})}),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./jquery.fileupload"],e):"object"==typeof exports?e(require("jquery"),require("./jquery.fileupload")):e(window.jQuery)}(function(a){"use strict";var n=a.blueimp.yafFileUpload.prototype.options.add;a.widget("blueimp.yafFileUpload",a.blueimp.yafFileUpload,{options:{processQueue:[],add:function(e,t){var i=a(this);t.process(function(){return i.yafFileUpload("process",t)}),n.call(this,e,t)}},processActions:{},_processFile:function(e,n){var r=this,o=a.Deferred().resolveWith(r,[e]).promise();return this._trigger("process",null,e),a.each(e.processQueue,function(e,t){function i(e){return n.errorThrown?a.Deferred().rejectWith(r,[n]).promise():r.processActions[t.action].call(r,e,t)}o=o[r._promisePipe](i,t.always&&i)}),o.done(function(){r._trigger("processdone",null,e),r._trigger("processalways",null,e)}).fail(function(){r._trigger("processfail",null,e),r._trigger("processalways",null,e)}),o},_transformProcessQueue:function(r){var t=[];a.each(r.processQueue,function(){var i={},e=this.action,n=!0===this.prefix?e:this.prefix;a.each(this,function(e,t){"string"===a.type(t)&&"@"===t.charAt(0)?i[e]=r[t.slice(1)||(n?n+e.charAt(0).toUpperCase()+e.slice(1):e)]:i[e]=t}),t.push(i)}),r.processQueue=t},processing:function(){return this._processing},process:function(n){var r=this,o=a.extend({},this.options,n);return o.processQueue&&o.processQueue.length&&(this._transformProcessQueue(o),0===this._processing&&this._trigger("processstart"),a.each(n.files,function(e){function t(){return n.errorThrown?a.Deferred().rejectWith(r,[n]).promise():r._processFile(i,n)}var i=e?a.extend({},o):o;i.index=e,r._processing+=1,r._processingQueue=r._processingQueue[r._promisePipe](t,t).always(function(){--r._processing,0===r._processing&&r._trigger("processstop")})})),this._processingQueue},_create:function(){this._super(),this._processing=0,this._processingQueue=a.Deferred().resolveWith(this).promise()}})}),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","load-image","load-image-meta","load-image-scale","load-image-exif","load-image-orientation","canvas-to-blob","./jquery.fileupload-process"],e):"object"==typeof exports?e(require("jquery"),require("blueimp-load-image/js/load-image"),require("blueimp-load-image/js/load-image-meta"),require("blueimp-load-image/js/load-image-scale"),require("blueimp-load-image/js/load-image-exif"),require("blueimp-load-image/js/load-image-orientation"),require("blueimp-canvas-to-blob"),require("./jquery.fileupload-process")):e(window.jQuery,window.loadImage)}(function(s,l){"use strict";s.blueimp.yafFileUpload.prototype.options.processQueue.unshift({action:"loadImageMetaData",maxMetaDataSize:"@",disableImageHead:"@",disableMetaDataParsers:"@",disableExif:"@",disableExifOffsets:"@",includeExifTags:"@",excludeExifTags:"@",disableIptc:"@",disableIptcOffsets:"@",includeIptcTags:"@",excludeIptcTags:"@",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"}),s.widget("blueimp.yafFileUpload",s.blueimp.yafFileUpload,{options:{loadImageFileTypes:/^image\/(gif|jpeg|png|svg\+xml)$/,loadImageMaxFileSize:1e7,imageMaxWidth:1920,imageMaxHeight:1080,imageOrientation:!0,imageCrop:!1,disableImageResize:!0,previewMaxWidth:80,previewMaxHeight:80,previewOrientation:!0,previewThumbnail:!0,previewCrop:!1,previewCanvas:!0},processActions:{loadImage:function(t,e){if(e.disabled)return t;var i=this,n=t.files[t.index],r=s.Deferred();return"number"===s.type(e.maxFileSize)&&n.size>e.maxFileSize||e.fileTypes&&!e.fileTypes.test(n.type)||!l(n,function(e){e.src&&(t.img=e),r.resolveWith(i,[t])},e)?t:r.promise()},resizeImage:function(t,i){if(i.disabled||!t.canvas&&!t.img)return t;i=s.extend({canvas:!0},i);function e(e){e&&(e.width!==a.width||e.height!==a.height||i.forceResize)&&(t[e.getContext?"canvas":"img"]=e),t.preview=e,o.resolveWith(r,[t])}var n,r=this,o=s.Deferred(),a=i.canvas&&t.canvas||t.img;return t.exif&&i.thumbnail&&(n=(n=t.exif.get("Thumbnail"))&&n.get("Blob"))?(i.orientation=t.exif.get("Orientation"),l(n,e,i),o.promise()):(t.orientation?delete i.orientation:t.orientation=i.orientation||l.orientation,a?(e(l.scale(a,i,t)),o.promise()):t)},saveImage:function(t,e){if(!t.canvas||e.disabled)return t;var i=this,n=t.files[t.index],r=s.Deferred();return t.canvas.toBlob?(t.canvas.toBlob(function(e){e.name||(n.type===e.type?e.name=n.name:n.name&&(e.name=n.name.replace(/\.\w+$/,"."+e.type.substr(6)))),n.type!==e.type&&delete t.imageHead,t.files[t.index]=e,r.resolveWith(i,[t])},e.type||n.type,e.quality),r.promise()):t},loadImageMetaData:function(t,e){if(e.disabled)return t;var i=this,n=s.Deferred();return l.parseMetaData(t.files[t.index],function(e){s.extend(t,e),n.resolveWith(i,[t])},e),n.promise()},saveImageMetaData:function(t,e){if(!(t.imageHead&&t.canvas&&t.canvas.toBlob)||e.disabled)return t;var i=this,n=t.files[t.index],r=s.Deferred();return!0===t.orientation&&t.exifOffsets&&l.writeExifData(t.imageHead,t,"Orientation",1),l.replaceHead(n,t.imageHead,function(e){e.name=n.name,t.files[t.index]=e,r.resolveWith(i,[t])}),r.promise()},setImage:function(e,t){return e.preview&&!t.disabled&&(e.files[e.index][t.name||"preview"]=e.preview),e},deleteImageReferences:function(e,t){return t.disabled||(delete e.img,delete e.canvas,delete e.preview,delete e.imageHead),e}}})}),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./jquery.fileupload-process"],e):"object"==typeof exports?e(require("jquery"),require("./jquery.fileupload-process")):e(window.jQuery)}(function(a){"use strict";a.blueimp.yafFileUpload.prototype.options.processQueue.push({action:"validate",always:!0,acceptFileTypes:"@",maxFileSize:"@",minFileSize:"@",maxNumberOfFiles:"@",disabled:"@disableValidation"}),a.widget("blueimp.yafFileUpload",a.blueimp.yafFileUpload,{options:{getNumberOfFiles:a.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,t){if(t.disabled)return e;var i,n=a.Deferred(),r=this.options,o=e.files[e.index];return(t.minFileSize||t.maxFileSize)&&(i=o.size),"number"===a.type(t.maxNumberOfFiles)&&(r.getNumberOfFiles()||0)+e.files.length>t.maxNumberOfFiles?o.error=r.i18n("maxNumberOfFiles"):!t.acceptFileTypes||t.acceptFileTypes.test(o.type)||t.acceptFileTypes.test(o.name)?i>t.maxFileSize?o.error=r.i18n("maxFileSize"):"number"===a.type(i)&&i<t.minFileSize?o.error=r.i18n("minFileSize"):delete o.error:o.error=r.i18n("acceptFileTypes"),o.error||e.files.error?(e.files.error=!0,n.rejectWith(this,[e])):n.resolveWith(this,[e]),n.promise()}}})}),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","blueimp-tmpl","./jquery.fileupload-image","./jquery.fileupload-audio","./jquery.fileupload-video","./jquery.fileupload-validate"],e):"object"==typeof exports?e(require("jquery"),require("blueimp-tmpl"),require("./jquery.fileupload-image"),require("./jquery.fileupload-audio"),require("./jquery.fileupload-video"),require("./jquery.fileupload-validate")):e(window.jQuery,window.tmpl)}(function(l,t){"use strict";l.blueimp.yafFileUpload.prototype._specialOptions.push("filesContainer","uploadTemplateId","downloadTemplateId"),l.widget("blueimp.yafFileUpload",l.blueimp.yafFileUpload,{options:{autoUpload:!1,showElementClass:"in",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(e){return e.result&&l.isArray(e.result.files)?e.result.files:[]},add:function(e,t){if(e.isDefaultPrevented())return!1;var i=l(this),n=i.data("blueimp-yafFileUpload")||i.data("fileupload"),r=n.options;t.context=n._renderUpload(t.files).data("data",t).addClass("processing"),r.filesContainer[r.prependFiles?"prepend":"append"](t.context),n._forceReflow(t.context),n._transition(t.context),t.process(function(){return i.yafFileUpload("process",t)}).always(function(){t.context.each(function(e){l(this).find(".size").text(n._formatFileSize(t.files[e].size))}).removeClass("processing"),n._renderPreviews(t)}).done(function(){t.context.find(".edit,.start").prop("disabled",!1),!1!==n._trigger("added",e,t)&&(r.autoUpload||t.autoUpload)&&!1!==t.autoUpload&&t.submit()}).fail(function(){t.files.error&&t.context.each(function(e){e=t.files[e].error;e&&l(this).find(".error").text(e)})})},send:function(e,t){if(e.isDefaultPrevented())return!1;var i=l(this).data("blueimp-yafFileUpload")||l(this).data("fileupload");return t.context&&t.dataType&&"iframe"===t.dataType.substr(0,6)&&t.context.find(".progress").addClass(!l.support.transition&&"progress-animated").attr("aria-valuenow",100).children().first().css("width","100%"),i._trigger("sent",e,t)},done:function(i,n){if(i.isDefaultPrevented())return!1;var r,o,a=l(this).data("blueimp-yafFileUpload")||l(this).data("fileupload"),s=(n.getFilesFromResponse||a.options.getFilesFromResponse)(n);n.context?n.context.each(function(e){var t=s[e]||{error:"Empty file upload result"};o=a._addFinishedDeferreds(),a._transition(l(this)).done(function(){var e=l(this);r=a._renderDownload([t]).replaceAll(e),a._forceReflow(r),a._transition(r).done(function(){n.context=l(this),a._trigger("completed",i,n),a._trigger("finished",i,n),o.resolve()})})}):(r=a._renderDownload(s)[a.options.prependFiles?"prependTo":"appendTo"](a.options.filesContainer),a._forceReflow(r),o=a._addFinishedDeferreds(),a._transition(r).done(function(){n.context=l(this),a._trigger("completed",i,n),a._trigger("finished",i,n),o.resolve()}))},fail:function(i,n){if(i.isDefaultPrevented())return!1;var r,o,a=l(this).data("blueimp-yafFileUpload")||l(this).data("fileupload");n.context?n.context.each(function(e){var t;"abort"!==n.errorThrown?((t=n.files[e]).error=t.error||n.errorThrown||n.i18n("unknownError"),o=a._addFinishedDeferreds(),a._transition(l(this)).done(function(){var e=l(this);r=a._renderDownload([t]).replaceAll(e),a._forceReflow(r),a._transition(r).done(function(){n.context=l(this),a._trigger("failed",i,n),a._trigger("finished",i,n),o.resolve()})})):(o=a._addFinishedDeferreds(),a._transition(l(this)).done(function(){l(this).remove(),a._trigger("failed",i,n),a._trigger("finished",i,n),o.resolve()}))}):"abort"!==n.errorThrown?(n.context=a._renderUpload(n.files)[a.options.prependFiles?"prependTo":"appendTo"](a.options.filesContainer).data("data",n),a._forceReflow(n.context),o=a._addFinishedDeferreds(),a._transition(n.context).done(function(){n.context=l(this),a._trigger("failed",i,n),a._trigger("finished",i,n),o.resolve()})):(a._trigger("failed",i,n),a._trigger("finished",i,n),a._addFinishedDeferreds().resolve())},progress:function(e,t){if(e.isDefaultPrevented())return!1;var i=Math.floor(t.loaded/t.total*100);t.context&&t.context.each(function(){l(this).find(".progress").attr("aria-valuenow",i).children().first().css("width",i+"%")})},progressall:function(e,t){if(e.isDefaultPrevented())return!1;var i=l(this),n=Math.floor(t.loaded/t.total*100),r=i.find(".fileupload-progress"),e=r.find(".progress-extended");e.length&&e.html((i.data("blueimp-yafFileUpload")||i.data("fileupload"))._renderExtendedProgress(t)),r.find(".progress").attr("aria-valuenow",n).children().first().css("width",n+"%")},start:function(e){if(e.isDefaultPrevented())return!1;var t=l(this).data("blueimp-yafFileUpload")||l(this).data("fileupload");t._resetFinishedDeferreds(),t._transition(l(this).find(".fileupload-progress")).done(function(){t._trigger("started",e)})},stop:function(e){if(e.isDefaultPrevented())return!1;var t=l(this).data("blueimp-yafFileUpload")||l(this).data("fileupload"),i=t._addFinishedDeferreds();l.when.apply(l,t._getFinishedDeferreds()).done(function(){t._trigger("stopped",e)}),t._transition(l(this).find(".fileupload-progress")).done(function(){l(this).find(".progress").attr("aria-valuenow","0").children().first().css("width","0%"),l(this).find(".progress-extended").html("&nbsp;"),i.resolve()})},processstart:function(e){if(e.isDefaultPrevented())return!1;l(this).addClass("fileupload-processing")},processstop:function(e){if(e.isDefaultPrevented())return!1;l(this).removeClass("fileupload-processing")},destroy:function(e,t){if(e.isDefaultPrevented())return!1;function i(){n._transition(t.context).done(function(){l(this).remove(),n._trigger("destroyed",e,t)})}var n=l(this).data("blueimp-yafFileUpload")||l(this).data("fileupload");t.url?(t.dataType=t.dataType||n.options.dataType,l.ajax(t).done(i).fail(function(){n._trigger("destroyfailed",e,t)})):i()}},_resetFinishedDeferreds:function(){this._finishedUploads=[]},_addFinishedDeferreds:function(e){e=e||l.Deferred();return this._finishedUploads.push(e),e},_getFinishedDeferreds:function(){return this._finishedUploads},_enableDragToDesktop:function(){var e=l(this),t=e.prop("href"),i=e.prop("download"),n="application/octet-stream";e.on("dragstart",function(e){try{e.originalEvent.dataTransfer.setData("DownloadURL",[n,i,t].join(":"))}catch(e){}})},_formatFileSize:function(e){return"number"!=typeof e?"":1e9<=e?(e/1e9).toFixed(2)+" GB":1e6<=e?(e/1e6).toFixed(2)+" MB":(e/1e3).toFixed(2)+" KB"},_formatBitrate:function(e){return"number"!=typeof e?"":1e9<=e?(e/1e9).toFixed(2)+" Gbit/s":1e6<=e?(e/1e6).toFixed(2)+" Mbit/s":1e3<=e?(e/1e3).toFixed(2)+" kbit/s":e.toFixed(2)+" bit/s"},_formatTime:function(e){var t=new Date(1e3*e),e=Math.floor(e/86400);return(e=e?e+"d ":"")+("0"+t.getUTCHours()).slice(-2)+":"+("0"+t.getUTCMinutes()).slice(-2)+":"+("0"+t.getUTCSeconds()).slice(-2)},_formatPercentage:function(e){return(100*e).toFixed(2)+" %"},_renderExtendedProgress:function(e){return this._formatBitrate(e.bitrate)+" | "+this._formatTime(8*(e.total-e.loaded)/e.bitrate)+" | "+this._formatPercentage(e.loaded/e.total)+" | "+this._formatFileSize(e.loaded)+" / "+this._formatFileSize(e.total)},_renderTemplate:function(e,t){if(!e)return l();t=e({files:t,formatFileSize:this._formatFileSize,options:this.options});return t instanceof l?t:l(this.options.templatesContainer).html(t).children()},_renderPreviews:function(i){i.context.find(".preview").each(function(e,t){l(t).empty().append(i.files[e].preview)})},_renderUpload:function(e){return this._renderTemplate(this.options.uploadTemplate,e)},_renderDownload:function(e){return this._renderTemplate(this.options.downloadTemplate,e).find("a[download]").each(this._enableDragToDesktop).end()},_editHandler:function(e){var t,i,n,r;e.preventDefault(),this.options.edit&&(t=this,e=l(e.currentTarget),i=e.closest(".template-upload"),n=i.data("data"),r=e.data().index,this.options.edit(n.files[r]).then(function(e){e&&(n.files[r]=e,n.context.addClass("processing"),i.find(".edit,.start").prop("disabled",!0),l(t.element).fileupload("process",n).always(function(){i.find(".size").text(t._formatFileSize(n.files[r].size)),n.context.removeClass("processing"),t._renderPreviews(n)}).done(function(){i.find(".edit,.start").prop("disabled",!1)}).fail(function(){i.find(".edit").prop("disabled",!1);var e=n.files[r].error;e&&i.find(".error").text(e)}))}))},_startHandler:function(e){e.preventDefault();var t=l(e.currentTarget),e=t.closest(".template-upload").data("data");t.prop("disabled",!0),e&&e.submit&&e.submit()},_cancelHandler:function(e){e.preventDefault();var t=l(e.currentTarget).closest(".template-upload,.template-download"),i=t.data("data")||{};i.context=i.context||t,i.abort?i.abort():(i.errorThrown="abort",this._trigger("fail",e,i))},_deleteHandler:function(e){e.preventDefault();var t=l(e.currentTarget);this._trigger("destroy",e,l.extend({context:t.closest(".template-download"),type:"DELETE"},t.data()))},_forceReflow:function(e){return l.support.transition&&e.length&&e[0].offsetWidth},_transition:function(t){var i,n=l.Deferred();return l.support.transition&&t.hasClass("fade")&&t.is(":visible")?(i=function(e){e.target===t[0]&&(t.off(l.support.transition.end,i),n.resolveWith(t))},t.on(l.support.transition.end,i).toggleClass(this.options.showElementClass)):(t.toggleClass(this.options.showElementClass),n.resolveWith(t)),n},_initButtonBarEventHandlers:function(){var t=this.element.find(".fileupload-buttonbar"),i=this.options.filesContainer;this._on(t.find(".start"),{click:function(e){e.preventDefault(),i.find(".start").trigger("click")}}),this._on(t.find(".cancel"),{click:function(e){e.preventDefault(),i.find(".cancel").trigger("click")}}),this._on(t.find(".delete"),{click:function(e){e.preventDefault(),i.find(".toggle:checked").closest(".template-download").find(".delete").trigger("click"),t.find(".toggle").prop("checked",!1)}}),this._on(t.find(".toggle"),{change:function(e){i.find(".toggle").prop("checked",l(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 .edit":this._editHandler,"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 e=this.options;e.templatesContainer=this.document[0].createElement(e.filesContainer.prop("nodeName")),t&&(e.uploadTemplateId&&(e.uploadTemplate=t(e.uploadTemplateId)),e.downloadTemplateId&&(e.downloadTemplate=t(e.downloadTemplateId)))},_initFilesContainer:function(){var e=this.options;void 0===e.filesContainer?e.filesContainer=this.element.find(".files"):e.filesContainer instanceof l||(e.filesContainer=l(e.filesContainer))},_initSpecialOptions:function(){this._super(),this._initFilesContainer(),this._initTemplates()},_create:function(){this._super(),this._resetFinishedDeferreds(),l.support.fileInput||this._disableFileInputButton()},enable:function(){var e=!1;this.options.disabled&&(e=!0),this._super(),e&&(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()}})});