PageSourceSearch

https://www.hilfswerk.at/typo3conf/ext/theme/Resources/Public/Js/Js-Merged/media_upload.min.js?1716982309

js hilfswerk.at collected 2026-10-02 06:21:05 UTC 141,484 bytes, 1 lines download raw bytes

1!function(global){var qq=function(o){"use strict";return{hide:function(){return o.style.display="none",this},attach:function(e,t){return o.addEventListener?o.addEventListener(e,t,!1):o.attachEvent&&o.attachEvent("on"+e,t),function(){qq(o).detach(e,t)}},detach:function(e,t){return o.removeEventListener?o.removeEventListener(e,t,!1):o.attachEvent&&o.detachEvent("on"+e,t),this},contains:function(e){return!!e&&(o===e||(o.contains?o.contains(e):!!(8&e.compareDocumentPosition(o))))},insertBefore:function(e){return e.parentNode.insertBefore(o,e),this},remove:function(){return o.parentNode.removeChild(o),this},css:function(e){if(null==o.style)throw new qq.Error("Can't apply style to node as it is not on the HTMLElement prototype chain!");return null!=e.opacity&&"string"!=typeof o.style.opacity&&void 0!==o.filters&&(e.filter="alpha(opacity="+Math.round(100*e.opacity)+")"),qq.extend(o.style,e),this},hasClass:function(e,t){e=new RegExp("(^| )"+e+"( |$)");return e.test(o.className)||!(!t||!e.test(o.parentNode.className))},addClass:function(e){return qq(o).hasClass(e)||(o.className+=" "+e),this},removeClass:function(e){e=new RegExp("(^| )"+e+"( |$)");return o.className=o.className.replace(e," ").replace(/^\s+|\s+$/g,""),this},getByClass:function(n,e){var t,i=[];return e&&o.querySelector?o.querySelector("."+n):o.querySelectorAll?o.querySelectorAll("."+n):(t=o.getElementsByTagName("*"),qq.each(t,function(e,t){qq(t).hasClass(n)&&i.push(t)}),e?i[0]:i)},getFirstByClass:function(e){return qq(o).getByClass(e,!0)},children:function(){for(var e=[],t=o.firstChild;t;)1===t.nodeType&&e.push(t),t=t.nextSibling;return e},setText:function(e){return o.innerText=e,o.textContent=e,this},clearText:function(){return qq(o).setText("")},hasAttribute:function(e){return o.hasAttribute?!!o.hasAttribute(e)&&null==/^false$/i.exec(o.getAttribute(e)):void 0!==(e=o[e])&&null==/^false$/i.exec(e)}}};!function(){"use strict";qq.canvasToBlob=function(e,t,n){return qq.dataUriToBlob(e.toDataURL(t,n))},qq.dataUriToBlob=function(e){var t=(0<=e.split(",")[0].indexOf("base64")?atob:decodeURI)(e.split(",")[1]),e=e.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(t.length),i=new Uint8Array(n);return qq.each(t,function(e,t){i[e]=t.charCodeAt(0)}),t=n,n=e,(e=(e=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder)&&new e)?(e.append(t),e.getBlob(n)):new Blob([t],{type:n})},qq.log=function(e,t){window.console&&(t&&"info"!==t?window.console[t]?window.console[t](e):window.console.log("<"+t+"> "+e):window.console.log(e))},qq.isObject=function(e){return e&&!e.nodeType&&"[object Object]"===Object.prototype.toString.call(e)},qq.isFunction=function(e){return"function"==typeof e},qq.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)||e&&window.ArrayBuffer&&e.buffer&&e.buffer.constructor===ArrayBuffer},qq.isItemList=function(e){return"[object DataTransferItemList]"===Object.prototype.toString.call(e)},qq.isNodeList=function(e){return"[object NodeList]"===Object.prototype.toString.call(e)||e.item&&e.namedItem},qq.isString=function(e){return"[object String]"===Object.prototype.toString.call(e)},qq.trimStr=function(e){return String.prototype.trim?e.trim():e.replace(/^\s+|\s+$/g,"")},qq.format=function(e){var t=Array.prototype.slice.call(arguments,1),o=e,a=o.indexOf("{}");return qq.each(t,function(e,t){var n=o.substring(0,a),i=o.substring(a+2);if((a=(o=n+t+i).indexOf("{}",a+t.length))<0)return!1}),o},qq.isFile=function(e){return window.File&&"[object File]"===Object.prototype.toString.call(e)},qq.isFileList=function(e){return window.FileList&&"[object FileList]"===Object.prototype.toString.call(e)},qq.isFileOrInput=function(e){return qq.isFile(e)||qq.isInput(e)},qq.isInput=function(e,t){function n(e){return e=e.toLowerCase(),t?"file"!==e:"file"===e}return!!(window.HTMLInputElement&&"[object HTMLInputElement]"===Object.prototype.toString.call(e)&&e.type&&n(e.type))||!!(e.tagName&&"input"===e.tagName.toLowerCase()&&e.type&&n(e.type))},qq.isBlob=function(e){if(window.Blob&&"[object Blob]"===Object.prototype.toString.call(e))return!0},qq.isXhrUploadSupported=function(){var e=document.createElement("input");return e.type="file",void 0!==e.multiple&&"undefined"!=typeof File&&"undefined"!=typeof FormData&&void 0!==qq.createXhrInstance().upload},qq.createXhrInstance=function(){if(window.XMLHttpRequest)return new XMLHttpRequest;try{return new ActiveXObject("MSXML2.XMLHTTP.3.0")}catch(e){return qq.log("Neither XHR or ActiveX are supported!","error"),null}},qq.isFolderDropSupported=function(e){return e.items&&0<e.items.length&&e.items[0].webkitGetAsEntry},qq.isFileChunkingSupported=function(){return!qq.androidStock()&&qq.isXhrUploadSupported()&&(void 0!==File.prototype.slice||void 0!==File.prototype.webkitSlice||void 0!==File.prototype.mozSlice)}
1,qq.sliceBlob=function(e,t,n){return(e.slice||e.mozSlice||e.webkitSlice).call(e,t,n)},qq.arrayBufferToHex=function(e){var n="",e=new Uint8Array(e);return qq.each(e,function(e,t){t=t.toString(16);t.length<2&&(t="0"+t),n+=t}),n},qq.readBlobToHex=function(e,t,n){var e=qq.sliceBlob(e,t,t+n),i=new FileReader,o=new qq.Promise;return i.onload=function(){o.success(qq.arrayBufferToHex(i.result))},i.onerror=o.failure,i.readAsArrayBuffer(e),o},qq.extend=function(n,e,i){return qq.each(e,function(e,t){i&&qq.isObject(t)?(void 0===n[e]&&(n[e]={}),qq.extend(n[e],t,!0)):n[e]=t}),n},qq.override=function(n,e){var i={},e=e(i);return qq.each(e,function(e,t){void 0!==n[e]&&(i[e]=n[e]),n[e]=t}),n},qq.indexOf=function(e,t,n){if(e.indexOf)return e.indexOf(t,n);var i=e.length;for((n=n||0)<0&&(n+=i);n<i;n+=1)if(e.hasOwnProperty(n)&&e[n]===t)return n;return-1},qq.getUniqueId=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)})},qq.ie=function(){return-1!==navigator.userAgent.indexOf("MSIE")||-1!==navigator.userAgent.indexOf("Trident")},qq.ie7=function(){return-1!==navigator.userAgent.indexOf("MSIE 7")},qq.ie8=function(){return-1!==navigator.userAgent.indexOf("MSIE 8")},qq.ie10=function(){return-1!==navigator.userAgent.indexOf("MSIE 10")},qq.ie11=function(){return qq.ie()&&-1!==navigator.userAgent.indexOf("rv:11")},qq.edge=function(){return 0<=navigator.userAgent.indexOf("Edge")},qq.safari=function(){return void 0!==navigator.vendor&&-1!==navigator.vendor.indexOf("Apple")},qq.chrome=function(){return void 0!==navigator.vendor&&-1!==navigator.vendor.indexOf("Google")},qq.opera=function(){return void 0!==navigator.vendor&&-1!==navigator.vendor.indexOf("Opera")},qq.firefox=function(){return!qq.edge()&&!qq.ie11()&&-1!==navigator.userAgent.indexOf("Mozilla")&&void 0!==navigator.vendor&&""===navigator.vendor},qq.windows=function(){return"Win32"===navigator.platform},qq.android=function(){return-1!==navigator.userAgent.toLowerCase().indexOf("android")},qq.androidStock=function(){return qq.android()&&navigator.userAgent.toLowerCase().indexOf("chrome")<0},qq.ios6=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf(" OS 6_")},qq.ios7=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf(" OS 7_")},qq.ios8=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf(" OS 8_")},qq.ios800=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf(" OS 8_0 ")},qq.ios=function(){return-1!==navigator.userAgent.indexOf("iPad")||-1!==navigator.userAgent.indexOf("iPod")||-1!==navigator.userAgent.indexOf("iPhone")},qq.iosChrome=function(){return qq.ios()&&-1!==navigator.userAgent.indexOf("CriOS")},qq.iosSafari=function(){return qq.ios()&&!qq.iosChrome()&&-1!==navigator.userAgent.indexOf("Safari")},qq.iosSafariWebView=function(){return qq.ios()&&!qq.iosChrome()&&!qq.iosSafari()},qq.preventDefault=function(e){e.preventDefault?e.preventDefault():e.returnValue=!1},qq.toElement=function(){var t=document.createElement("div");return function(e){t.innerHTML=e;e=t.firstChild;return t.removeChild(e),e}}(),qq.each=function(e,t){if(e)if(window.Storage&&e.constructor===window.Storage)for(n=0;n<e.length&&!1!==t(e.key(n),e.getItem(e.key(n)));n++);else if(qq.isArray(e)||qq.isItemList(e)||qq.isNodeList(e))for(n=0;n<e.length&&!1!==t(n,e[n]);n++);else if(qq.isString(e))for(n=0;n<e.length&&!1!==t(n,e.charAt(n));n++);else for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&!1===t(n,e[n]))break},qq.bind=function(t,n){var i;if(qq.isFunction(t))return i=Array.prototype.slice.call(arguments,2),function(){var e=qq.extend([],i);return arguments.length&&(e=e.concat(Array.prototype.slice.call(arguments))),t.apply(n,e)};throw new Error("first parameter must be a function!")},qq.obj2url=function(e,i,t){function n(e,t){var n=i?/\[\]$/.test(i)?i:i+"["+t+"]":t;"undefined"!==n&&"undefined"!==t&&o.push("object"==typeof e?qq.obj2url(e,n,!0):"[object Function]"===Object.prototype.toString.call(e)?encodeURIComponent(n)+"="+encodeURIComponent(e()):encodeURIComponent(n)+"="+encodeURIComponent(e))}var o=[],a="&";return!t&&i?(a=/\?/.test(i)?/\?$/.test(i)?"":"&":"?",o.push(i),o.push(qq.obj2url(e))):"[object Array]"===Object.prototype.toString.call(e)&&void 0!==e?qq.each(e,function(e,t){n(t,e)}):null!=e&&"object"==typeof e?qq.each(e,function(e,t){n(t,e)}):o.push(encodeURIComponent(i)+"="+encodeURIComponent(e)),i?o.join(a):o.join(a).replace(/^&/,"").replace(/%20/g,"+")},qq.obj2FormData=function(e,n,i){return n=n||new FormData,qq.each(e,function(e,t){e=i?i+"["+e+"]":e,qq.isObject(t)?qq.obj2FormData(t,n,e):qq.isFunction(t)?n.append(e,t()):n.append(e,t)}),n},qq.obj2Inputs=function(e,n){var i;return n=n||document.createElement("form"),qq.obj2FormData(e,{append:function(e,t){(i=document.createElement("input")).setAttribute("name",e),i.setAttribute("value",t),n.appendChild(i)}}),n}
1,qq.parseJson=function(json){return window.JSON&&qq.isFunction(JSON.parse)?JSON.parse(json):eval("("+json+")")},qq.getExtension=function(e){var t=e.lastIndexOf(".")+1;if(0<t)return e.substr(t,e.length-t)},qq.getFilename=function(e){return qq.isInput(e)?e.value.replace(/.*(\/|\\)/,""):qq.isFile(e)&&null!==e.fileName&&void 0!==e.fileName?e.fileName:e.name},qq.DisposeSupport=function(){var t=[];return{dispose:function(){for(var e;(e=t.shift())&&e(),e;);},attach:function(){this.addDisposer(qq(arguments[0]).attach.apply(this,Array.prototype.slice.call(arguments,1)))},addDisposer:function(e){t.push(e)}}}}(),!function(){"use strict";qq.Error=function(e){this.message="[Fine Uploader "+qq.version+"] "+e},qq.Error.prototype=new Error}(),qq.version="5.10.1",qq.supportedFeatures=function(){"use strict";var e,t,n,i,o,a,r,s,l,u,c,d,p,h,q;function f(){return!!window.XMLHttpRequest&&void 0!==qq.createXhrInstance().withCredentials}function m(){return void 0!==window.XDomainRequest}return e=function(){var e,t=!0;try{(e=document.createElement("input")).type="file",qq(e).hide(),e.disabled&&(t=!1)}catch(e){t=!1}return t}(),t=(n=e&&qq.isXhrUploadSupported())&&!qq.androidStock(),i=(q=n&&(("draggable"in(q=document.createElement("span"))||"ondragstart"in q&&"ondrop"in q)&&!qq.android()&&!qq.ios()))&&(qq.chrome()||qq.opera())&&void 0!==navigator.userAgent.match(/Chrome\/[2][1-9]|Chrome\/[3-9][0-9]/),o=n&&qq.isFileChunkingSupported(),a=n&&o&&function(){try{return!!window.localStorage&&qq.isFunction(window.localStorage.setItem)}catch(e){return!1}}(),r=n&&(qq.chrome()||qq.opera())&&void 0!==navigator.userAgent.match(/Chrome\/[1][4-9]|Chrome\/[2-9][0-9]/),s=e&&(void 0!==window.postMessage||n),u=f(),l=m(),c=!!f()||m(),d=void 0!==document.createElement("input").webkitdirectory,p=n&&void 0!==window.FileReader,h=!!n&&!qq.androidStock()&&!qq.iosChrome(),{ajaxUploading:n,blobUploading:t,canDetermineSize:n,chunking:o,deleteFileCors:c,deleteFileCorsXdr:l,deleteFileCorsXhr:u,dialogElement:!!window.HTMLDialogElement,fileDrop:q,folderDrop:i,folderSelection:d,imagePreviews:p,imageValidation:p,itemSizeValidation:n,pause:o,progressBar:h,resume:a,scaling:p&&t,tiffPreviews:qq.safari(),unlimitedScaledImageSize:!qq.ios(),uploading:e,uploadCors:s,uploadCustomHeaders:n,uploadNonMultipart:n,uploadViaPaste:r}}(),qq.isGenericPromise=function(e){"use strict";return!!(e&&e.then&&qq.isFunction(e.then))},qq.Promise=function(){"use strict";var n,i,o=[],a=[],t=[],r=0;qq.extend(this,{then:function(e,t){return 0===r?(e&&o.push(e),t&&a.push(t)):-1===r?t&&t.apply(null,i):e&&e.apply(null,n),this},done:function(e){return 0===r?t.push(e):e.apply(null,void 0===i?n:i),this},success:function(){return r=1,n=arguments,o.length&&qq.each(o,function(e,t){t.apply(null,n)}),t.length&&qq.each(t,function(e,t){t.apply(null,n)}),this},failure:function(){return r=-1,i=arguments,a.length&&qq.each(a,function(e,t){t.apply(null,i)}),t.length&&qq.each(t,function(e,t){t.apply(null,i)}),this}})},qq.BlobProxy=function(e,t){"use strict";qq.extend(this,{referenceBlob:e,create:function(){return t(e)}})},qq.UploadButton=function(e){"use strict";var t,n,i=this,o=new qq.DisposeSupport,a={acceptFiles:null,element:null,focusClass:"qq-upload-button-focus",folders:!1,hoverClass:"qq-upload-button-hover",ios8BrowserCrashWorkaround:!1,multiple:!1,name:"qqfile",required:"true",onChange:function(e){},title:null};function r(){var e=document.createElement("input");return e.setAttribute(qq.UploadButton.BUTTON_ID_ATTR_NAME,n),e.setAttribute("title",a.title),i.setMultiple(a.multiple,e),a.folders&&qq.supportedFeatures.folderSelection&&e.setAttribute("webkitdirectory",""),a.acceptFiles&&e.setAttribute("accept",a.acceptFiles),e.setAttribute("type","file"),e.setAttribute("name",a.name),qq(e).css({position:"absolute",right:0,top:0,fontFamily:"Arial",fontSize:qq.ie()&&!qq.ie8()?"3500px":"118px",margin:0,padding:0,cursor:"pointer",opacity:0}),qq.ie7()||qq(e).css({height:"100%"}),a.element.appendChild(e),o.attach(e,"change",function(){a.onChange(e)}),o.attach(e,"mouseover",function(){qq(a.element).addClass(a.hoverClass)}),o.attach(e,"mouseout",function(){qq(a.element).removeClass(a.hoverClass)}),o.attach(e,"focus",function(){qq(a.element).addClass(a.focusClass)}),o.attach(e,"blur",function(){qq(a.element).removeClass(a.focusClass)}),e}qq.extend(a,e),n=qq.getUniqueId(),qq(a.element).css({position:"relative",overflow:"hidden",direction:"ltr"}),qq.extend(this,{getInput:function(){return t},getButtonId:function(){return n},setMultiple:function(e,t){t=t||this.getInput();a.ios8BrowserCrashWorkaround&&qq.ios8()&&(qq.iosChrome()||qq.iosSafariWebView())||e?t.setAttribute("multiple",""):t.removeAttribute("multiple")},setAcceptFiles:function(e){e!==a.acceptFiles&&t.setAttribute("accept",e)},reset:function(){t.parentNode&&qq(t).remove(),qq(a.element).removeClass(a.focusClass),t=null,t=r()}}),t=r()},qq.UploadButton.BUTTON_ID_ATTR_NAME="qq-button-id",qq.UploadData=function(o){"use strict";var a=[],r={},s={},i={},l={};qq.extend(this,{addFile:function(e){var t=e.status||qq.status.SUBMITTING,n=a.push({name:e.name,originalName:e.name,uuid:e.uuid,size:null==e.size?-1:e.size,status:t})-1;return e.batchId&&(a[n].batchId=e.batchId,void 0===l[e.batchId]&&(l[e.batchId]=[]),l[e.batchId].push(n)),e.proxyGroupId&&(a[n].proxyGroupId=e.proxyGroupId,void 0===i[e.proxyGroupId]&&(i[e.proxyGroupId]=[]),i[e.proxyGroupId].push(n)),a[n].id=n,r[e.uuid]=n,void 0===s[t]&&(s[t]=[]),s[t].push(n),o.onStatusChange(n,null,t),n},retrieve:function(e){return qq.isObject(e)&&a.length?void 0!==e.id?(t=e.id,qq.isArray(t)?(o=[],qq.each(t,function(e,t){o.push(a[t])}),o):a[t]):void 0!==e.uuid?(t=e.uuid,qq.isArray(t)?(i=[],qq.each(t,function(e,t){i.push(a[r[t]])}),i):a[r[t]]):e.status?(e=e.status,n=[],e=[].concat(e),qq.each(e,function(e,t){t=s[t];void 0!==t&&qq.each(t,function(e,t){n.push(a[t])})}),n):void 0:qq.extend([],a,!0);var n,i,t,o},reset:function(){a=[],r={},s={},l={}},setStatus:function(e,t){var n=a[e].status,i=qq.indexOf(s[n],e);s[n].splice(i,1),a[e].status=t,void 0===s[t]&&(s[t]=[]),s[t].push(e),o.onStatusChange(e,n,t)},uuidChanged:function(e,t){var n=a[e].uuid;a[e].uuid=t,r[t]=e,delete r[n]},updateName:function(e,t){a[e].name=t},updateSize:function(e,t){a[e].size=t},setParentId:function(e,t){a[e].parentId=t},getIdsInProxyGroup:function(e){e=a[e].proxyGroupId;return e?i[e]:[]},getIdsInBatch:function(e){e=a[e].batchId;return l[e]}})},qq.status={SUBMITTING:"submitting",SUBMITTED:"submitted",REJECTED:"rejected",QUEUED:"queued",CANCELED:"canceled",PAUSED:"paused",UPLOADING:"uploading",UPLOAD_RETRYING:"retrying upload",UPLOAD_SUCCESSFUL:"upload successful",UPLOAD_FAILED:"upload failed",DELETE_FAILED:"delete failed",DELETING:"deleting",DELET
1ED:"deleted"},!function(){"use strict";qq.basePublicApi={addBlobs:function(e,t,n){this.addFiles(e,t,n)},addInitialFiles:function(e){var n=this;qq.each(e,function(e,t){n._addCannedFile(t)})},addFiles:function(e,t,n){this._maybeHandleIos8SafariWorkaround();var i=0===this._storedIds.length?qq.getUniqueId():this._currentBatchId,o=qq.bind(function(e){this._handleNewFile({blob:e,name:this._options.blobs.defaultName},i,c)},this),a=qq.bind(function(e){this._handleNewFile(e,i,c)},this),r=qq.bind(function(e){e=qq.canvasToBlob(e);this._handleNewFile({blob:e,name:this._options.blobs.defaultName+".png"},i,c)},this),s=qq.bind(function(e){var t=e.quality&&e.quality/100,t=qq.canvasToBlob(e.canvas,e.type,t);this._handleNewFile({blob:t,name:e.name},i,c)},this),l=qq.bind(function(e){var t,n;qq.isInput(e)&&qq.supportedFeatures.ajaxUploading?(t=Array.prototype.slice.call(e.files),n=this,qq.each(t,function(e,t){n._handleNewFile(t,i,c)})):this._handleNewFile(e,i,c)},this),u=this,c=[];this._currentBatchId=i,e&&(qq.isFileList(e)&&(e=Array.prototype.slice.call(e)),e=[].concat(e),qq.each(e,function(e,t){qq.isFileOrInput(t)?l(t):qq.isBlob(t)?o(t):qq.isObject(t)?t.blob&&t.name?a(t):t.canvas&&t.name&&s(t):t.tagName&&"canvas"===t.tagName.toLowerCase()?r(t):u.log(t+" is not a valid file container!  Ignoring!","warn")}),this.log("Received "+c.length+" files."),this._prepareItemsForUpload(c,t,n))},cancel:function(e){this._handler.cancel(e)},cancelAll:function(){var e=[],n=this;qq.extend(e,this._storedIds),qq.each(e,function(e,t){n.cancel(t)}),this._handler.cancelAll()},clearStoredFiles:function(){this._storedIds=[]},continueUpload:function(e){var t=this._uploadData.retrieve({id:e});if(qq.supportedFeatures.pause&&this._options.chunking.enabled){if(t.status===qq.status.PAUSED)return this.log(qq.format("Paused file ID {} ({}) will be continued.  Not paused.",e,this.getName(e))),this._uploadFile(e),!0;this.log(qq.format("Ignoring continue for file ID {} ({}).  Not paused.",e,this.getName(e)),"error")}return!1},deleteFile:function(e){return this._onSubmitDelete(e)},doesExist:function(e){return this._handler.isValid(e)},drawThumbnail:function(e,t,n,i,o){var a,r=new qq.Promise;return this._imageGenerator?(a=this._thumbnailUrls[e],o={customResizeFunction:o,maxSize:0<n?n:null,scale:0<n},null==(a=!i&&qq.supportedFeatures.imagePreviews?this.getFile(e):a)?r.failure({container:t,error:"File or URL not found."}):this._imageGenerator.generate(a,t,o).then(function(e){r.success(e)},function(e,t){r.failure({container:e,error:t||"Problem generating thumbnail"})})):r.failure({container:t,error:"Missing image generator module"}),r},getButton:function(e){return this._getButton(this._buttonIdsForFileIds[e])},getEndpoint:function(e){return this._endpointStore.get(e)},getFile:function(e){return this._handler.getFile(e)||null},getInProgress:function(){return this._uploadData.retrieve({status:[qq.status.UPLOADING,qq.status.UPLOAD_RETRYING,qq.status.QUEUED]}).length},getName:function(e){return this._uploadData.retrieve({id:e}).name},getParentId:function(e){var e=this.getUploads({id:e}),t=null;return t=e&&void 0!==e.parentId?e.parentId:t},getResumableFilesData:function(){return this._handler.getResumableFilesData()},getSize:function(e){return this._uploadData.retrieve({id:e}).size},getNetUploads:function(){return this._netUploaded},getRemainingAllowedItems:function(){var e=this._currentItemLimit;return 0<e?e-this._netUploadedOrQueued:null},getUploads:function(e){return this._uploadData.retrieve(e)},getUuid:function(e){return this._uploadData.retrieve({id:e}).uuid},log:function(e,t){!this._options.debug||t&&"info"!==t?t&&"info"!==t&&qq.log("[Fine Uploader "+qq.version+"] "+e,t):qq.log("[Fine Uploader "+qq.version+"] "+e)},pauseUpload:function(e){var t=this._uploadData.retrieve({id:e});if(qq.supportedFeatures.pause&&this._options.chunking.enabled)if(0<=qq.indexOf([qq.status.UPLOADING,qq.status.UPLOAD_RETRYING],t.status)){if(this._handler.pause(e))return this._uploadData.setStatus(e,qq.status.PAUSED),!0;this.log(qq.format("Unable to pause file ID {} ({}).",e,this.getName(e)),"error")}else this.log(qq.format("Ignoring pause for file ID {} ({}).  Not in progress.",e,this.getName(e)),"error");return!1},reset:function(){this.log("Resetting uploader..."),this._handler.reset(),this._storedIds=[],this._autoRetries=[],this._retryTimeouts=[],this._preventRetries=[],this._thumbnailUrls=[],qq.each(this._buttons,function(e,t){t.reset()}),this._paramsStore.reset(),this._endpointStore.reset(),this._netUploadedOrQueued=0,this._netUploaded=0,this._uploadData.reset(),this._buttonIdsForFileIds=[],this._pasteHandler&&this._pasteHandler.reset(),this._options.session.refreshOnReset&&this._refreshSessionData(),this._succeededSinceLastAllComplete=[],this._failedSinceLastAllComplete=[],this._totalProgress&&this._totalProgress.reset()},retry:function(e){return this._manualRetry(e)},scaleImage:function(e,t){var n=this;return qq.Scaler.prototype.scaleImage(e,t,{log:qq.bind(n.log,n),getFile:qq.bind(n.getFile,n),uploadData:n._uploadData})},setCustomHeaders:function(e,t){this._customHeadersStore.set(e,t)},setDeleteFileCustomHeaders:function(e,t){this._deleteFileCustomHeadersStore.set(e,t)},setDeleteFileEndpoint:function(e,t){this._deleteFileEndpointStore.set(e,t)}
1,setDeleteFileParams:function(e,t){this._deleteFileParamsStore.set(e,t)},setEndpoint:function(e,t){this._endpointStore.set(e,t)},setForm:function(e){this._updateFormSupportAndParams(e)},setItemLimit:function(e){this._currentItemLimit=e},setName:function(e,t){this._uploadData.updateName(e,t)},setParams:function(e,t){this._paramsStore.set(e,t)},setUuid:function(e,t){return this._uploadData.uuidChanged(e,t)},uploadStoredFiles:function(){0===this._storedIds.length?this._itemError("noFilesError"):this._uploadStoredFiles()}},qq.basePrivateApi={_addCannedFile:function(e){var t=this._uploadData.addFile({uuid:e.uuid,name:e.name,size:e.size,status:qq.status.UPLOAD_SUCCESSFUL});return e.deleteFileEndpoint&&this.setDeleteFileEndpoint(e.deleteFileEndpoint,t),e.deleteFileParams&&this.setDeleteFileParams(e.deleteFileParams,t),e.thumbnailUrl&&(this._thumbnailUrls[t]=e.thumbnailUrl),this._netUploaded++,this._netUploadedOrQueued++,t},_annotateWithButtonId:function(e,t){qq.isFile(e)&&(e.qqButtonId=this._getButtonId(t))},_batchError:function(e){this._options.callbacks.onError(null,null,e,void 0)},_createDeleteHandler:function(){var i=this;return new qq.DeleteFileAjaxRequester({method:this._options.deleteFile.method.toUpperCase(),maxConnections:this._options.maxConnections,uuidParamName:this._options.request.uuidName,customHeaders:this._deleteFileCustomHeadersStore,paramsStore:this._deleteFileParamsStore,endpointStore:this._deleteFileEndpointStore,cors:this._options.cors,log:qq.bind(i.log,i),onDelete:function(e){i._onDelete(e),i._options.callbacks.onDelete(e)},onDeleteComplete:function(e,t,n){i._onDeleteComplete(e,t,n),i._options.callbacks.onDeleteComplete(e,t,n)}})},_createPasteHandler:function(){var t=this;return new qq.PasteSupport({targetElement:this._options.paste.targetElement,callbacks:{log:qq.bind(t.log,t),pasteReceived:function(e){t._handleCheckedCallback({name:"onPasteReceived",callback:qq.bind(t._options.callbacks.onPasteReceived,t,e),onSuccess:qq.bind(t._handlePasteSuccess,t,e),identifier:"pasted image"})}}})},_createStore:function(e,t){function n(e){return qq.isObject(e)?qq.extend({},e):e}function i(e,t){s&&qq.isObject(t)&&qq.extend(t,qq.isFunction(s)?s():s),r[e]&&qq.extend(t,r[e])}var o={},a=e,r={},s=t;return{set:function(e,t){null==t?(o={},a=n(e)):o[t]=n(e)},get:function(e){var t=null!=e&&o[e]?o[e]:n(a);return i(e,t),n(t)},addReadOnly:function(e,t){qq.isObject(o)&&(null===e?qq.isFunction(t)?s=t:(s=s||{},qq.extend(s,t)):(r[e]=r[e]||{},qq.extend(r[e],t)))},remove:function(e){return delete o[e]},reset:function(){o={},r={},a=e}}},_createUploadDataTracker:function(){var i=this;return new qq.UploadData({getName:function(e){return i.getName(e)},getUuid:function(e){return i.getUuid(e)},getSize:function(e){return i.getSize(e)},onStatusChange:function(e,t,n){i._onUploadStatusChange(e,t,n),i._options.callbacks.onStatusChange(e,t,n),i._maybeAllComplete(e,n),i._totalProgress&&setTimeout(function(){i._totalProgress.onStatusChange(e,t,n)},0)}})},_createUploadButton:function(e){var t,n=this,i=e.accept||this._options.validation.acceptFiles,o=e.allowedExtensions||this._options.validation.allowedExtensions;return t=new qq.UploadButton({acceptFiles:i,element:e.element,focusClass:this._options.classes.buttonFocus,folders:e.folders,hoverClass:this._options.classes.buttonHover,ios8BrowserCrashWorkaround:this._options.workarounds.ios8BrowserCrash,multiple:!(!qq.supportedFeatures.ajaxUploading||n._options.workarounds.iosEmptyVideos&&qq.ios()&&!qq.ios6()&&n._isAllowedExtension(o,".mov"))&&(void 0===e.multiple?n._options:e).multiple,name:this._options.request.inputName,onChange:function(e){n._onInputChange(e)},title:null==e.title?this._options.text.fileInputTitle:e.title}),this._disposeSupport.addDisposer(function(){t.dispose()}),n._buttons.push(t),t},_createUploadHandler:function(e,t){var a=this,r={},n={debug:this._options.debug,maxConnections:this._options.maxConnections,cors:this._options.cors,paramsStore:this._paramsStore,endpointStore:this._endpointStore,chunking:this._options.chunking,resume:this._options.resume,blobs:this._options.blobs,log:qq.bind(a.log,a),preventRetryParam:this._options.retry.preventRetryResponseProperty,onProgress:function(e,t,n,i){n<0||i<0||(r[e]&&r[e].loaded===n&&r[e].total===i||(a._onProgress(e,t,n,i),a._options.callbacks.onProgress(e,t,n,i)),r[e]={loaded:n,total:i})},onComplete:function(e,t,n,i){delete r[e];var o=a.getUploads({id:e}).status;o!==qq.status.UPLOAD_SUCCESSFUL&&o!==qq.status.UPLOAD_FAILED&&((o=a._onComplete(e,t,n,i))instanceof qq.Promise?o.done(function(){a._options.callbacks.onComplete(e,t,n,i)}):a._options.callbacks.onComplete(e,t,n,i))},onCancel:function(e,t,n){var i=new qq.Promise;return a._handleCheckedCallback({name:"onCancel",callback:qq.bind(a._options.callbacks.onCancel,a,e,t),onFailure:i.failure,onSuccess:function(){n.then(function(){a._onCancel(e,t)}),i.success()},identifier:e}),i},onUploadPrep:qq.bind(this._onUploadPrep,this),onUpload:function(e,t){a._onUpload(e,t),a._options.callbacks.onUpload(e,t)},onUploadChunk:function(e,t,n){a._onUploadChunk(e,n),a._options.callbacks.onUploadChunk(e,t,n)},onUploadChunkSuccess:function(e,t,n,i){a._options.callbacks.onUploadChunkSuccess.apply(a,arguments)},onResume:function(e,t,n){return a._options.callbacks.onResume(e,t,n)},onAutoRetry:function(e,t,n,i){return a._onAutoRetry.apply(a,arguments)},onUuidChanged:function(e,t){a.log("Server requested UUID change from '"+a.getUuid(e)+"' to '"+t+"'"),a.setUuid(e,t)},getName:qq.bind(a.getName,a),getUuid:qq.bind(a.getUuid,a),getSize:qq.bind(a.getSize,a),setSize:qq.bind(a._setSize,a),getDataByUuid:function(e){return a.getUploads({uuid:e})},isQueued:function(e){e=a.getUploads({id:e}).status;return e===qq.status.QUEUED||e===qq.status.SUBMITTED||e===qq.status.UPLOAD_RETRYING||e===qq.status.PAUSED},getIdsInProxyGroup:a._uploadData.getIdsInProxyGroup,getIdsInBatch:a._uploadData.getIdsInBatch};return qq.each(this._options.request,function(e,t){n[e]=t}),n.customHeaders=this._customHeadersStore,e&&qq.each(e,function(e,t){n[e]=t}),new qq.UploadHandlerController(n,t)},_fileOrBlobRejected:function(e){this._netUploadedOrQueued--,this._uploadData.setStatus(e,qq.status.REJECTED)},_formatSize:function(e){for(var t=-1;t++,999<(e/=1e3););return Math.max(e,.1).toFixed(1)+this._options.text.sizeSymbols[t]},_generateExtraButtonSpecs:function(){var a=this;this._extraButtonSpecs={},qq.each(this._options.extraButtons,function(e,t){var n=t.multiple,i=qq.extend({},a._options.validation,!0),o=qq.extend({},t);void 0===n&&(n=a._options.multiple),o.validation&&qq.extend(i,t.validation,!0),qq.extend(o,{multiple:n,validation:i},!0),a._initExtraButton(o)})},_getButton:function(e){var t=this._extraButtonSpecs[e];return t?t.element:e===this._defaultButtonId?this._options.button:void 0},_getButtonId:function(e){var n;if((e=e instanceof qq.BlobProxy?e.referenceBlob:e)&&!qq.isBlob(e))return qq.isFile(e)?e.qqButtonId:"input"===e.tagName.toLowerCase()&&"file"===e.type.toLowerCase()?e.getAttribute(qq.UploadButton.BUTTON_ID_ATTR_NAME):(e=e.getElementsByTagName("input"),qq.each(e,function(e,t){if("file"===t.getAttribute("type"))return n=t,!1}),n?n.getAttribute(qq.UploadButton.BUTTON_ID_ATTR_NAME):void 0)},_getNotFinished:function(){return this._uploadData.retrieve({status:[qq.
1status.UPLOADING,qq.status.UPLOAD_RETRYING,qq.status.QUEUED,qq.status.SUBMITTING,qq.status.SUBMITTED,qq.status.PAUSED]}).length},_getValidationBase:function(e){e=this._extraButtonSpecs[e];return(e||this._options).validation},_getValidationDescriptor:function(e){return e.file instanceof qq.BlobProxy?{name:qq.getFilename(e.file.referenceBlob),size:e.file.referenceBlob.size}:{name:this.getUploads({id:e.id}).name,size:this.getUploads({id:e.id}).size}},_getValidationDescriptors:function(e){var n=this,i=[];return qq.each(e,function(e,t){i.push(n._getValidationDescriptor(t))}),i},_handleCameraAccess:function(){var e,t,n,i;this._options.camera.ios&&qq.ios()&&(e="image/*;capture=camera",t=this._options.camera.button,n=t?this._getButtonId(t):this._defaultButtonId,i=this._options,(i=n&&n!==this._defaultButtonId?this._extraButtonSpecs[n]:i).multiple=!1,null===i.validation.acceptFiles?i.validation.acceptFiles=e:i.validation.acceptFiles+=","+e,qq.each(this._buttons,function(e,t){if(t.getButtonId()===n)return t.setMultiple(i.multiple),t.setAcceptFiles(i.acceptFiles),!1}))},_handleCheckedCallback:function(t){var n=this,e=t.callback();return qq.isGenericPromise(e)?(this.log(t.name+" - waiting for "+t.name+" promise to be fulfilled for "+t.identifier),e.then(function(e){n.log(t.name+" promise success for "+t.identifier),t.onSuccess(e)},function(){t.onFailure?(n.log(t.name+" promise failure for "+t.identifier),t.onFailure()):n.log(t.name+" promise failure for "+t.identifier)})):(!1!==e?t.onSuccess(e):t.onFailure?(this.log(t.name+" - return value was 'false' for "+t.i
1dentifier+".  Invoking failure callback."),t.onFailure()):this.log(t.name+" - return value was 'false' for "+t.identifier+".  Will not proceed."),e)},_handleNewFile:function(e,t,n){var i=this,o=qq.getUniqueId(),a=-1,r=qq.getFilename(e),e=e.blob||e;(this._customNewFileHandler||qq.bind(i._handleNewFileGeneric,i))(e,r,o,a=!qq.isInput(e)&&0<=e.size?e.size:a,n,t,this._options.request.uuidName,{uploadData:i._uploadData,paramsStore:i._paramsStore,addFileToHandler:function(e,t){i._handler.add(e,t),i._netUploadedOrQueued++,i._trackButton(e)}})},_handleNewFileGeneric:function(e,t,n,i,o,a){n=this._uploadData.addFile({uuid:n,name:t,size:i,batchId:a});this._handler.add(n,e),this._trackButton(n),this._netUploadedOrQueued++,o.push({id:n,file:e})},_handlePasteSuccess:function(e,t){var n=e.type.split("/")[1];null==t&&(t=this._options.paste.defaultName),this.addFiles({name:t+="."+n,blob:e})},_initExtraButton:function(e){var t=this._createUploadButton({accept:e.validation.acceptFiles,allowedExtensions:e.validation.allowedExtensions,element:e.element,folders:e.folders,multiple:e.multiple,title:e.fileInputTitle});this._extraButtonSpecs[t.getButtonId()]=e},_initFormSupportAndParams:function(){this._formSupport=qq.FormSupport&&new qq.FormSupport(this._options.form,qq.bind(this.uploadStoredFiles,this),qq.bind(this.log,this)),this._formSupport&&this._formSupport.attachedToForm?(this._paramsStore=this._createStore(this._options.request.params,this._formSupport.getFormInputsAsObject),this._options.autoUpload=this._formSupport.newAutoUpload,this._formSupport.newEndpoint&&(this._options.request.endpoint=this._formSupport.newEndpoint)):this._paramsStore=this._createStore(this._options.request.params)},_isDeletePossible:function(){return!(!qq.DeleteFileAjaxRequester||!this._options.deleteFile.enabled)&&(!this._options.cors.expected||(!!qq.supportedFeatures.deleteFileCorsXhr||!(!qq.supportedFeatures.deleteFileCorsXdr||!this._options.cors.allowXdr)))},_isAllowedExtension:function(e,n){var i=!1;return!e.length||(qq.each(e,function(e,t){if(qq.isString(t)){t=new RegExp("\\."+t+"$","i");if(null!=n.match(t))return!(i=!0)}}),i)},_itemError:function(e,t,n){var i=this._options.messages[e],o=[],a=[].concat(t),e=a[0],t=this._getButtonId(n),n=this._getValidationBase(t);function r(e,t){i=i.replace(e,t)}return qq.each(n.allowedExtensions,function(e,t){qq.isString(t)&&o.push(t)}),t=o.join(", ").toLowerCase(),r("{file}",this._options.formatFileName(e)),r("{extensions}",t),r("{sizeLimit}",this._formatSize(n.sizeLimit)),r("{minSizeLimit}",this._formatSize(n.minSizeLimit)),null!==(t=i.match(/(\{\w+\})/g))&&qq.each(t,function(e,t){r(t,a[e])}),this._options.callbacks.onError(null,e,i,void 0),i},_manualRetry:function(e,t){if(this._onBeforeManualRetry(e))return this._netUploadedOrQueued++,this._uploadData.setStatus(e,qq.status.UPLOAD_RETRYING),t?t(e):this._handler.retry(e),!0},_maybeAllComplete:function(e,t){var n=this,i=this._getNotFinished();t===qq.status.UPLOAD_SUCCESSFUL?this._succeededSinceLastAllComplete.push(e):t===qq.status.UPLOAD_FAILED&&this._failedSinceLastAllComplete.push(e),0===i&&(this._succeededSinceLastAllComplete.length||this._failedSinceLastAllComplete.length)&&setTimeout(function(){n._onAllComplete(n._succeededSinceLastAllComplete,n._failedSinceLastAllComplete)},0)},_maybeHandleIos8SafariWorkaround:function(){var e=this;if(this._options.workarounds.ios8SafariUploads&&qq.ios800()&&qq.iosSafari())throw setTimeout(function(){window.alert(e._options.messages.unsupportedBrowserIos8Safari)},0),new qq.Error(this._options.messages.unsupportedBrowserIos8Safari)},_maybeParseAndSendUploadError:function(e,t,n,i){n.success||(i&&200!==i.status&&!n.error?this._options.callbacks.onError(e,t,"XHR returned response code "+i.status,i):(n=n.error||this._options.text.defaultResponseError,this._options.callbacks.onError(e,t,n,i)))},_maybeProcessNextItemAfterOnValidateCallback:function(e,n,i,o,a){var r=this;if(n.length>i)if(e||!this._options.validation.stopOnFirstInvalidFile)setTimeout(function(){var e=r._getValidationDescriptor(n[i]),t=r._getButtonId(n[i].file),t=r._getButton(t);r._handleCheckedCallback({name:"onValidate",callback:qq.bind(r._options.callbacks.onValidate,r,e,t),onSuccess:qq.bind(r._onValidateCallbackSuccess,r,n,i,o,a),onFailure:qq.bind(r._onValidateCallbackFailure,r,n,i,o,a),identifier:"Item '"+e.n
1ame+"', size: "+e.size})},0);else if(!e)for(;i<n.length;i++)r._fileOrBlobRejected(n[i].id)},_onAllComplete:function(e,t){this._totalProgress&&this._totalProgress.onAllComplete(e,t,this._preventRetries),this._options.callbacks.onAllComplete(qq.extend([],e),qq.extend([],t)),this._succeededSinceLastAllComplete=[],this._failedSinceLastAllComplete=[]},_onAutoRetry:function(e,t,n,i,o){var a=this;if(a._preventRetries[e]=n[a._options.retry.preventRetryResponseProperty],a._shouldAutoRetry(e,t,n))return a._maybeParseAndSendUploadError.apply(a,arguments),a._options.callbacks.onAutoRetry(e,t,a._autoRetries[e]),a._onBeforeAutoRetry(e,t),a._retryTimeouts[e]=setTimeout(function(){a.log("Retrying "+t+"..."),a._uploadData.setStatus(e,qq.status.UPLOAD_RETRYING),o?o(e):a._handler.retry(e)},1e3*a._options.retry.autoAttemptDelay),!0},_onBeforeAutoRetry:function(e,t){this.log("Waiting "+this._options.retry.autoAttemptDelay+" seconds before retrying "+t+"...")},_onBeforeManualRetry:function(e){var t,n=this._currentItemLimit;return this._preventRetries[e]?(this.log("Retries are forbidden for id "+e,"warn"),!1):this._handler.isValid(e)?(t=this.getName(e),!1!==this._options.callbacks.onManualRetry(e,t)&&(0<n&&this._netUploadedOrQueued+1>n?(this._itemError("retryFailTooManyItems"),!1):(this.log("Retrying upload for '"+t+"' (id: "+e+")..."),!0))):(this.log("'"+e+"' is not a valid file ID","error"),!1)},_onCancel:function(e,t){this._netUploadedOrQueued--,clearTimeout(this._retryTimeouts[e]);var n=qq.indexOf(this._storedIds,e);!this._options.autoUpload&&0<=n&&this._storedIds.splice(n,1),this._uploadData.setStatus(e,qq.status.CANCELED)},_onComplete:function(e,t,n,i){return n.success?(n.thumbnailUrl&&(this._thumbnailUrls[e]=n.thumbnailUrl),this._netUploaded++,this._uploadData.setStatus(e,qq.status.UPLOAD_SUCCESSFUL)):(this._netUploadedOrQueued--,this._uploadData.setStatus(e,qq.status.UPLOAD_FAILED),!0===n[this._options.retry.preventRetryResponseProperty]&&(this._preventRetries[e]=!0)),this._maybeParseAndSendUploadError(e,t,n,i),!!n.success},_onDelete:function(e){this._uploadData.setStatus(e,qq.status.DELETING)},_onDeleteComplete:function(e,t,n){var i=this.getName(e);n?(this._uploadData.setStatus(e,qq.status.DELETE_FAILED),this.log("Delete request for '"+i+"' has failed.","error"),void 0===t.withCredentials?this._options.callbacks.onError(e,i,"Delete request failed",t):this._options.callbacks.onError(e,i,"Delete request failed with response code "+t.status,t)):(this._netUploadedOrQueued--,this._netUploaded--,this._handler.expunge(e),this._uploadData.setStatus(e,qq.status.DELETED),this.log("Delete request for '"+i+"' has succeeded."))},_onInputChange:function(e){var t;if(qq.supportedFeatures.ajaxUploading){for(t=0;t<e.files.length;t++)this._annotateWithButtonId(e.files[t],e);this.addFiles(e.files)}else 0<e.value.length&&this.addFiles(e);qq.each(this._buttons,function(e,t){t.reset()})},_onProgress:function(e,t,n,i){this._totalProgress&&this._totalProgress.onIndividualProgress(e,n,i)},_onSubmit:function(e,t){},_onSubmitCallbackSuccess:function(e,t){this._onSubmit.apply(this,arguments),this._uploadData.setStatus(e,qq.status.SUBMITTED),this._onSubmitted.apply(this,arguments),this._options.autoUpload?(this._options.callbacks.onSubmitted.apply(this,arguments),this._uploadFile(e)):(this._storeForLater(e),this._options.callbacks.onSubmitted.apply(this,arguments))},_onSubmitDelete:function(e,t,n){var i,o=this.getUuid(e);return t&&(i=qq.bind(t,this,e,o,n)),this._isDeletePossible()?(this._handleCheckedCallback({name:"onSubmitDelete",callback:qq.bind(this._options.callbacks.onSubmitDelete,this,e),onSuccess:i||qq.bind(this._deleteHandler.sendDelete,this,e,o,n),identifier:e}),!0):(this.log("Delete request ignored for ID "+e+", delete feature is disabled or request not possible due to CORS on a user agent that does not support pre-flighting.","warn"),!1)},_onSubmitted:function(e){},_onTotalProgress:function(e,t){this._options.callbacks.onTotalProgress(e,t)},_onUploadPrep:function(e){},_onUpload:function(e,t){this._uploadData.setStatus(e,qq.status.UPLOADING)},_onUploadChunk:function(e,t){},_onUploadStatusChange:function(e,t,n){n===qq.status.PAUSED&&clearTimeout(this._retryTimeouts[e])},_onValidateBatchCallbackFailure:function(e){var n=this;qq.each(e,function(e,t){n._fileOrBlobRejected(t.id)})},_onValidateBatchCallbackSuccess:function(e,t,n,i,o){var a=this._currentItemLimit,r=this._netUploadedOrQueued;0===a||r<=a?0<t.length?this._handleCheckedCallback({name:"onValidate",callback:qq.bind(this._options.callbacks.onValidate,this,e[0],o),onSuccess:qq.bind(this._onValidateCallbackSuccess,this,t,0,n,i),onFailure:qq.bind(this._onValidateCallbackFailure,this,t,0,n,i),identifier:"Item '"+t[0].file.name+"', size: "+t[0].file.size}):this._itemError("noFilesError"):(this._onValidateBatchCallbackFailure(t),e=this._options.messages.tooManyItemsError.replace(/\{netItems\}/g,r).replace(/\{itemLimit\}/g,a),this._batchError(e))},_onValidateCallbackFailure:function(e,t,n,i){var o=t+1;this._fileOrBlobRejected(e[t].id,e[t].file.name),this._maybeProcessNextItemAfterOnValidateCallback(!1,e,o,n,i)},_onValidateCallbackSuccess:function(e,t,n,i){var o=this,a=t+1,r=this._getValidationDescriptor(e[t]);
1this._validateFileOrBlobData(e[t],r).then(function(){o._upload(e[t].id,n,i),o._maybeProcessNextItemAfterOnValidateCallback(!0,e,a,n,i)},function(){o._maybeProcessNextItemAfterOnValidateCallback(!1,e,a,n,i)})},_prepareItemsForUpload:function(e,t,n){var i,o;0===e.length?this._itemError("noFilesError"):(i=this._getValidationDescriptors(e),o=this._getButtonId(e[0].file),o=this._getButton(o),this._handleCheckedCallback({name:"onValidateBatch",callback:qq.bind(this._options.callbacks.onValidateBatch,this,i,o),onSuccess:qq.bind(this._onValidateBatchCallbackSuccess,this,i,e,t,n,o),onFailure:qq.bind(this._onValidateBatchCallbackFailure,this,e),identifier:"batch validation"}))},_preventLeaveInProgress:function(){var t=this;this._disposeSupport.attach(window,"beforeunload",function(e){if(t.getInProgress())return(e=e||window.event).returnValue=t._options.messages.onLeave,t._options.messages.onLeave})},_refreshSessionData:function(){var n=this,e=this._options.session;qq.Session&&null!=this._options.session.endpoint&&(this._session||(qq.extend(e,{cors:this._options.cors}),e.log=qq.bind(this.log,this),e.addFileRecord=qq.bind(this._addCannedFile,this),this._session=new qq.Session(e)),setTimeout(function(){n._session.refresh().then(function(e,t){n._sessionRequestComplete(),n._options.callbacks.onSessionRequestComplete(e,!0,t)},function(e,t){n._options.callbacks.onSessionRequestComplete(e,!1,t)})},0))},_sessionRequestComplete:function(){},_setSize:function(e,t){this._uploadData.updateSize(e,t),this._totalProgress&&this._totalProgress.onNewSize(e)},_shouldAutoRetry:function(e,t,n){var i=this._uploadData.retrieve({id:e});return!!(!this._preventRetries[e]&&this._options.retry.enableAuto&&i.status!==qq.status.PAUSED&&(void 0===this._autoRetries[e]&&(this._autoRetries[e]=0),this._autoRetries[e]<this._options.retry.maxAutoAttempts))&&(this._autoRetries[e]+=1,!0)},_storeForLater:function(e){this._storedIds.push(e)},_trackButton:function(e){var t=qq.supportedFeatures.ajaxUploading?this._handler.getFile(e).qqButtonId:this._getButtonId(this._handler.getInput(e));t&&(this._buttonIdsForFileIds[e]=t)},_updateFormSupportAndParams:function(e){this._options.form.element=e,this._formSupport=qq.FormSupport&&new qq.FormSupport(this._options.form,qq.bind(this.uploadStoredFiles,this),qq.bind(this.log,this)),this._formSupport&&this._formSupport.attachedToForm&&(this._paramsStore.addReadOnly(null,this._formSupport.getFormInputsAsObject),this._options.autoUpload=this._formSupport.newAutoUpload,this._formSupport.newEndpoint&&this.setEndpoint(this._formSupport.newEndpoint))},_upload:function(e,t,n){var i=this.getName(e);t&&this.setParams(t,e),n&&this.setEndpoint(n,e),this._handleCheckedCallback({name:"onSubmit",callback:qq.bind(this._options.callbacks.onSubmit,this,e,i),onSuccess:qq.bind(this._onSubmitCallbackSuccess,this,e,i),onFailure:qq.bind(this._fileOrBlobRejected,this,e,i),identifier:e})},_uploadFile:function(e){this._handler.upload(e)||this._uploadData.setStatus(e,qq.status.QUEUED)},_uploadStoredFiles:function(){for(var e,t,n=this;this._storedIds.length;)e=this._storedIds.shift(),this._uploadFile(e);(t=this.getUploads({status:qq.status.SUBMITTING}).length)&&(qq.log("Still waiting for "+t+" files to clear submit queue. Will re-parse stored IDs array shortly."),setTimeout(function(){n._uploadStoredFiles()},1e3))},_validateFileOrBlobData:function(e,t){var n=this,i=e.file instanceof qq.BlobProxy?e.file.referenceBlob:e.file,o=t.name,t=t.size,a=this._getButtonId(e.file),a=this._getValidationBase(a),r=new qq.Promise;return r.then(function(){},function(){n._fileOrBlobRejected(e.id,o)}),qq.isFileOrInput(i)&&!this._isAllowedExtension(a.allowedExtensions,o)?(this._itemError("typeError",o,i),r.failure()):0===t?(this._itemError("emptyError",o,i),r.failure()):0<t&&a.sizeLimit&&t>a.sizeLimit?(this._itemError("sizeError",o,i),r.failure()):0<t&&t<a.minSizeLimit?(this._itemError("minSizeError",o,i),r.failure()):(qq.ImageValidation&&qq.supportedFeatures.imagePreviews&&qq.isFile(i)?new qq.ImageValidation(i,qq.bind(n.log,n)).validate(a.image).then(r.success,function(e){n._itemError(e+"ImageError",o,i),r.failure()}):r.success(),r)},_wrapCallbacks:function(){var n,i=this,o=function(t,n,e){try{return n.apply(i,e)}catch(e){n=e.message||e.toString(),i.log("Caught exception in '"+t+"' callback - "+n,"error")}};for(n in this._options.callbacks)!function(){var e=n,t=i._options.callbacks[e];i._options.callbacks[e]=function(){return o(e,t,arguments)}}()}}}(),!function(){"use strict";qq.FineUploaderBasic=function(e){var t=this;this._options={debug:!1,button:null,multiple:!0,maxConnections:3,disableCancelForFormUploads:!1,autoUpload:!0,request:{customHeaders:{},endpoint:"/server/upload",filenameParam:"qqfilename",forceMultipart:!0,inputName:"qqfile",method:"POST",params:{},paramsInBody:!1,totalFileSizeName:"qqtotalfilesize",uuidName:"qquuid"},validation:{allowedExtensions:[],sizeLimit:0,minSizeLimit:0,itemLimit:0,stopOnFirstInvalidFile:!0,acceptFiles:null,image:{maxHeight:0,maxWidth:0,minHeight:0,minWidth:0}},callbacks:{onSubmit:function(e,t){},onSubmitted:function(e,t){},onComplete:function(e,t,n,i){},onAllComplete:function(e,t){},onCancel:function(e,t){},onUpload:function(e,t){},onUploadChunk:function(e,t,n){},onUploadChunkSuccess:function(e,t,n,i){},onResume:function(e,t,n){},onProgress:function(e,t,n,i){},onTotalProgress:function(e,t){},onError:function(e,t,n,i){},onAutoRetry:function(e,t,n){},onManualRetry:function(e,t){},onValidateBatch:function(e){},onValidate:function(e){},onSubmitDelete:function(e){},onDelete:function(e){},onDeleteComplete:function(e,t,n){},onPasteReceived:function(e){},onStatusChange:function(e,t,n){},onSessionRequestComplete:function(e,t,n){}},messages:{typeError:"{file}
1 has an invalid extension. Valid extension(s): {extensions}.",sizeError:"{file} is too large, maximum file size is {sizeLimit}.",minSizeError:"{file} is too small, minimum file size is {minSizeLimit}.",emptyError:"{file} is empty, please select files again without it.",noFilesError:"No files to upload.",tooManyItemsError:"Too many items ({netItems}) would be uploaded.  Item limit is {itemLimit}.",maxHeightImageError:"Image is too tall.",maxWidthImageError:"Image is too wide.",minHeightImageError:"Image is not tall enough.",minWidthImageError:"Image is not wide enough.",retryFailTooManyItems:"Retry failed - you have reached your file limit.",onLeave:"The files are being uploaded, if you leave now the upload will be canceled.",unsupportedBrowserIos8Safari:"Unrecoverable error - this browser does not permit file uploading of any kind due to serious bugs in iOS8 Safari.  Please use iOS8 Chrome until Apple fixes these issues."},retry:{enableAuto:!1,maxAutoAttempts:3,autoAttemptDelay:5,preventRetryResponseProperty:"preventRetry"},classes:{buttonHover:"qq-upload-button-hover",buttonFocus:"qq-upload-button-focus"},chunking:{enabled:!1,concurrent:{enabled:!1},mandatory:!1,paramNames:{partIndex:"qqpartindex",partByteOffset:"qqpartbyteoffset",chunkSize:"qqchunksize",totalFileSize:"qqtotalfilesize",totalParts:"qqtotalparts"},partSize:2e6,success:{endpoint:null}},resume:{enabled:!1,recordsExpireIn:7,paramNames:{resuming:"qqresume"}},formatFileName:function(e){return e},text:{defaultResponseError:"Upload failure reason unknown",fileInputTitle:"file input",sizeSymbols:["kB","MB","GB","TB","PB","EB"]},deleteFile:{enabled:!1,method:"DELETE",endpoint:"/server/upload",customHeaders:{},params:{}},cors:{expected:!1,sendCredentials:!1,allowXdr:!1},blobs:{defaultName:"misc_data"},paste:{targetElement:null,defaultName:"pasted_image"},camera:{ios:!1,button:null},extraButtons:[],session:{endpoint:null,params:{},customHeaders:{},refreshOnReset:!0},form:{element:"qq-form",autoUpload:!1,interceptSubmit:!0},scaling:{customResizer:null,sendOriginal:!0,orient:!0,defaultType:null,defaultQuality:80,failureText:"Failed to scale",includeExif:!1,sizes:[]},workarounds:{iosEmptyVideos:!0,ios8SafariUploads:!0,ios8BrowserCrash:!1}},qq.extend(this._options,e,!0),this._buttons=[],this._extraButtonSpecs={},this._buttonIdsForFileIds=[],this._wrapCallbacks(),this._disposeSupport=new qq.DisposeSupport,this._storedIds=[],this._autoRetries=[],this._retryTimeouts=[],this._preventRetries=[],this._thumbnailUrls=[],this._netUploadedOrQueued=0,this._netUploaded=0,this._uploadData=this._createUploadDataTracker(),this._initFormSupportAndParams(),this._customHeadersStore=this._createStore(this._options.request.customHeaders),this._deleteFileCustomHeadersStore=this._createStore(this._options.deleteFile.customHeaders),this._deleteFileParamsStore=this._createStore(this._options.deleteFile.params),this._endpointStore=this._createStore(this._options.request.endpoint),this._deleteFileEndpointStore=this._createStore(this._options.deleteFile.endpoint),this._handler=this._createUploadHandler(),this._deleteHandler=qq.DeleteFileAjaxRequester&&this._createDeleteHandler(),this._options.button&&(this._defaultButtonId=this._createUploadButton({element:this._options.button,title:this._options.text.fileInputTitle}).getButtonId()),this._generateExtraButtonSpecs(),this._handleCameraAccess(),this._options.paste.targetElement&&(qq.PasteSupport?this._pasteHandler=this._createPasteHandler():this.log("Paste support module not found","error")),this._preventLeaveInProgress(),this._imageGenerator=qq.ImageGenerator&&new qq.ImageGenerator(qq.bind(this.log,this)),this._refreshSessionData(),this._succeededSinceLastAllComplete=[],this._failedSinceLastAllComplete=[],this._scaler=qq.Scaler&&new qq.Scaler(this._options.scaling,qq.bind(this.log,this))||{},this._scaler.enabled&&(this._customNewFileHandler=qq.bind(this._scaler.handleNewFile,this._scaler)),qq.TotalProgress&&qq.supportedFeatures.progressBar&&(this._totalProgress=new qq.TotalProgress(qq.bind(this._onTotalProgress,this),function(e){e=t._uploadData.retrieve({id:e});return e&&e.size||0})),this._currentItemLimit=this._options.validation.itemLimit},qq.FineUploaderBasic.prototype=qq.basePublicApi,qq.extend(qq.FineUploaderBasic.prototype,qq.basePrivateApi)}(),qq.AjaxRequester=function(e){"use strict";var g,_,q=[],b={},v={acceptHeader:null,validMethods:["PATCH","POST","PUT"],method:"POST",contentType:"application/x-www-form-urlencoded",maxConnections:3,customHeaders:{},endpointStore:{},paramsStore:{},mandatedParams:{},allowXRequestedWithAndCacheControl:!0,successfulResponseCodes:{DELETE:[200,202,204],PATCH:[200,201,202,203,204],POST:[200,201,202,203,204],PUT:[200,201,202,203,204],GET:[200]},cors:{expected:!1,sendCredentials:!1},log:function(e,t){},onSend:function(e){},onComplete:function(e,t,n){},onProgress:null};if(qq.extend(v,e),g=v.log,qq.indexOf(v.validMethods,v.method)<0)throw new Error("'"+v.method+"' is not a supported method for this type of request!");function y(e){return v.cors.expected&&void 0===e.withCredentials}function S(e,t){var n,i=b[e].xhr;
1return i||(i=t||(v.cors.expected?((window.XMLHttpRequest||window.ActiveXObject)&&void 0===(n=qq.createXhrInstance()).withCredentials&&((n=new XDomainRequest).onload=function(){},n.onerror=function(){},n.ontimeout=function(){},n.onprogress=function(){}),n):qq.createXhrInstance()),b[e].xhr=i),i}function a(e){var t=qq.indexOf(q,e),n=v.maxConnections;delete b[e],q.splice(t,1),q.length>=n&&t<n&&f(q[n-1])}function w(e,t){var n,i=S(e),o=v.method,t=!0===t;a(e),t?g(o+" request for "+e+" has failed","error"):y(i)||(n=i.status,0<=qq.indexOf(v.successfulResponseCodes[v.method],n))||(t=!0,g(o+" request for "+e+" has failed - response code "+i.status,"error")),v.onComplete(e,i,t)}function f(e,t){var n,i,o,a,r,s,l,u,c,d,p,h,t=S(e,t),q=v.method,f=(m=b[f=e].additionalParams,l=v.mandatedParams,v.paramsStore.get&&(n=v.paramsStore.get(f)),m&&qq.each(m,function(e,t){(n=n||{})[e]=t}),l&&qq.each(l,function(e,t){(n=n||{})[e]=t}),n),m=b[e].payload;return v.onSend(e),l=function(e,t,n){var i=v.endpointStore.get(e),e=b[e].addToPath;null!=e&&(i+="/"+e);_&&t&&(i=qq.obj2url(t,i));n&&(i=qq.obj2url(n,i));return i}(e,f,b[e].additionalQueryParams),y(t)?(t.onload=(a=e,function(){w(a)}),t.onerror=(o=e,function(){w(o,!0)})):t.onreadystatechange=(i=e,function(){4===S(i).readyState&&w(i)}),r=e,(s=v.onProgress)&&(S(r).upload.onprogress=function(e){e.lengthComputable&&s(r,e.loaded,e.total)}),t.open(q,l,!0),v.cors.expected&&v.cors.sendCredentials&&!y(t)&&(t.withCredentials=!0),u=S(l=e),c=v.customHeaders,d=b[l].additionalHeaders||{},p=v.method,h={},y(u)||(v.acceptHeader&&u.setRequestHeader("Accept",v.acceptHeader),!v.allowXRequestedWithAndCacheControl||v.cors.expected&&0<=qq.indexOf(["GET","POST","HEAD"],v.method)&&!function(){var n=!1;return qq.each(n,function(e,t){if(qq.indexOf(["Accept","Accept-Language","Content-Language","Content-Type"],t)<0)return!(n=!0)}),n}()||(u.setRequestHeader("X-Requested-With","XMLHttpRequest"),u.setRequestHeader("Cache-Control","no-cache")),!v.contentType||"POST"!==p&&"PUT"!==p||u.setRequestHeader("Content-Type",v.contentType),qq.extend(h,qq.isFunction(c)?c(l):c),qq.extend(h,d),qq.each(h,function(e,t){u.setRequestHeader(e,t)})),g("Sending "+q+" request for "+e),m?t.send(m):_||!f?t.send():f&&v.contentType&&0<=v.contentType.toLowerCase().indexOf("application/x-www-form-urlencoded")?t.send(qq.obj2url(f,"")):f&&v.contentType&&0<=v.contentType.toLowerCase().indexOf("application/json")?t.send(JSON.stringify(f)):t.send(f),t}_="GET"===v.method||"DELETE"===v.method,qq.extend(this,{initTransport:function(s){var l,u,c,d,p,h;return{withPath:function(e){return l=e,this},withParams:function(e){return u=e,this},withQueryParams:function(e){return h=e,this},withHeaders:function(e){return c=e,this},withPayload:function(e){return d=e,this},withCacheBuster:function(){return p=!0,this},send:function(e){p&&0<=qq.indexOf(["GET","DELETE"],v.method)&&(u.qqtimestamp=(new Date).getTime());var t=s,n=l,i=u,o=h,a=c,r=d;if(b[t]={addToPath:n,additionalParams:i,additionalQueryParams:o,additionalHeaders:a,payload:r},q.push(t)<=v.maxConnections)return f(t,e)}}},canceled:function(e){a(e)}})},qq.UploadHandler=function(e){"use strict";var e=e.proxy,i={},o=e.onCancel,a=e.getName;qq.extend(this,{add:function(e,t){i[e]=t,i[e].temp={}},cancel:function(e){var t=this,n=new qq.Promise;o(e,a(e),n).then(function(){t.isValid(e)&&(i[e].canceled=!0,t.expunge(e)),n.success()})},expunge:function(e){delete i[e]},getThirdPartyFileId:function(e){return i[e].key},isValid:function(e){return void 0!==i[e]},reset:function(){i={}},_getFileState:function(e){return i[e]},_setThirdPartyFileId:function(e,t){i[e].key=t},_wasCanceled:function(e){return!!i[e].canceled}})},qq.UploadHandlerController=function(e,n){"use strict";var i,s,l,o=this,a=!1,u=!1,c={paramsStore:{},maxConnections:3,chunking:{enabled:!1,multiple:{enabled:!1}},log:function(e,t){},onProgress:function(e,t,n,i){},onComplete:function(e,t,n,i){},onCancel:function(e,t){},onUploadPrep:function(e){},onUpload:function(e,t){},onUploadChunk:function(e,t,n){},onUploadChunkSuccess:function(e,t,n,i){},onAutoRetry:function(e,t,n,i){},onResume:function(e,t,n){},onUuidChanged:function(e,t){},getName:function(e){},setSize:function(e,t){},isQueued:function(e){},getIdsInProxyGroup:function(e){},getIdsInBatch:function(e){}},d={done:function(e,t,n,i){var o=l._getChunkData(e,t);l._getFileState(e).attemptingResume=!1,delete l._getFileState(e).temp.chunkProgress[t],l._getFileState(e).loaded+=o.size,c.onUploadChunkSuccess(e,l._getChunkDataForCallback(o),n,i)},finalize:function(n){var i=c.getSize(n),o=c.getName(n);s("All chunks have been uploaded for "+n+" - finalizing...."),l.finalizeChunks(n).then(function(e,t){s("Finalize successful for "+n);e=h.normalizeResponse(e,!0);c.onProgress(n,o,i,i),l._maybeDeletePersistedChunkData(n),h.cleanup(n,e,t)},function(e,t){e=h.normalizeResponse(e,!1);s("Problem finalizing chunks for file ID "+n+" - "+e.error,"error"),e.reset&&d.reset(n),c.onAutoRetry(n,o,e,t)||h.cleanup(n,e,t)})},hasMoreParts:function(e){return!!l._getFileState(e).chunking.remaining.length},nextPart:function(e){var t=l._getFileState(e).chunking.remaining.shift();return t=t>=l._getTotalChunks(e)?null:t},reset:function(e){s("Server or callback has ordered chunking effort to be restarted on next attempt for item ID "+e,"error"),l._maybeDeletePersistedChunkData(e),l.reevaluateChunking(e),l._getFileState(e).loaded=0},sendNext:function(o){var e=c.getSize(o),i=c.getName(o),a=d.nextPart(o),t=l._getChunkData(o,a),n=l._getFileState(
1o).attemptingResume,r=l._getFileState(o).chunking.inProgress||[];null==l._getFileState(o).loaded&&(l._getFileState(o).loaded=0),n&&!1===c.onResume(o,i,t)&&(d.reset(o),a=d.nextPart(o),t=l._getChunkData(o,a),n=!1),null==a&&0===r.length?d.finalize(o):(s(qq.format("Sending chunked upload request for item {}.{}, bytes {}-{} of {}.",o,a,t.start+1,t.end,e)),c.onUploadChunk(o,i,l._getChunkDataForCallback(t)),r.push(a),l._getFileState(o).chunking.inProgress=r,u&&p.open(o,a),u&&p.available()&&l._getFileState(o).chunking.remaining.length&&d.sendNext(o),l.uploadChunk(o,a,n).then(function(e,t){s("Chunked upload request succeeded for "+o+", chunk "+a),l.clearCachedChunk(o,a);var n=l._getFileState(o).chunking.inProgress||[],e=h.normalizeResponse(e,!0),i=qq.indexOf(n,a);s(qq.format("Chunk {} for file {} uploaded successfully.",a,o)),d.done(o,a,e,t),0<=i&&n.splice(i,1),l._maybePersistChunkedState(o),d.hasMoreParts(o)||0!==n.length?d.hasMoreParts(o)?d.sendNext(o):s(qq.format("File ID {} has no more chunks to send and these chunk indexes are still marked as in-progress: {}",o,JSON.stringify(n))):d.finalize(o)},function(e,t){s("Chunked upload request failed for "+o+", chunk "+a),l.clearCachedChunk(o,a);var n,e=h.normalizeResponse(e,!1);e.reset?d.reset(o):0<=(n=qq.indexOf(l._getFileState(o).chunking.inProgress,a))&&(l._getFileState(o).chunking.inProgress.splice(n,1),l._getFileState(o).chunking.remaining.unshift(a)),l._getFileState(o).temp.ignoreFailure||(u&&(l._getFileState(o).temp.ignoreFailure=!0,s(qq.format("Going to attempt to abort these chunks: {}. These are currently in-progress: {}.",JSON.stringify(Object.keys(l._getXhrs(o))),JSON.stringify(l._getFileState(o).chunking.inProgress))),qq.each(l._getXhrs(o),function(e,t){s(qq.format("Attempting to abort file {}.{}. XHR readyState {}. ",o,e,t.readyState)),t.abort(),t._cancelled=!0}),l.moveInProgressToRemaining(o),p.free(o,!0)),c.onAutoRetry(o,i,e,t)||h.cleanup(o,e,t))}).done(function(){l.clearXhr(o,a)}))}},p={_open:[],_openChunks:{},_waiting:[],available:function(){var e=c.maxConnections,n=0,i=0;return qq.each(p._openChunks,function(e,t){n++,i+=t.length}),e-(p._open.length-n+i)},free:function(e,t){var t=!t,n=qq.indexOf(p._waiting,e),i=qq.indexOf(p._open,e);delete p._openChunks[e],h.getProxyOrBlob(e)instanceof qq.BlobProxy&&(s("Generated blob upload has ended for "+e+", disposing generated blob."),delete l._getFileState(e).file),0<=n?p._waiting.splice(n,1):t&&0<=i&&(p._open.splice(i,1),0<=(e=p._waiting.shift())&&(p._open.push(e),h.start(e)))},getWaitingOrConnected:function(){var n=[];return qq.each(p._openChunks,function(e,t){t&&t.length&&n.push(parseInt(e))}),qq.each(p._open,function(e,t){p._openChunks[t]||n.push(parseInt(t))}),n=n.concat(p._waiting)},isUsingConnection:function(e){return 0<=qq.indexOf(p._open,e)},open:function(e,t){return null==t&&p._waiting.push(e),!!p.available()&&(null==t?(p._waiting.pop(),p._open.push(e)):((n=p._openChunks[e]||[]).push(t),p._openChunks[e]=n),!0);var n},reset:function(){p._waiting=[],p._open=[]}},r=function(i,o){l._getFileState(i).loaded=0,s("Sending simple upload request for "+i),l.uploadFile(i).then(function(e,t){s("Simple upload request succeeded for "+i);var e=h.normalizeResponse(e,!0),n=c.getSize(i);c.onProgress(i,o,n,n),h.maybeNewUuid(i,e),h.cleanup(i,e,t)},function(e,t){s("Simple upload request failed for "+i);e=h.normalizeResponse(e,!1);c.onAutoRetry(i,o,e,t)||h.cleanup(i,e,t)})},h={cancel:function(e){s("Cancelling "+e),c.paramsStore.remove(e),p.free(e)},cleanup:function(e,t,n){var i=c.getName(e);c.onComplete(e,i,t,n),l._getFileState(e)&&l._clearXhrs&&l._clearXhrs(e),p.free(e)},getProxyOrBlob:function(e){return l.getProxy&&l.getProxy(e)||l.getFile&&l.getFile(e)},initHandler:function(){var e=n?qq[n]:qq.traditional,t=qq.supportedFeatures.ajaxUploading?"Xhr":"Form";(l=new e[t+"UploadHandler"](c,{getDataByUuid:c.getDataByUuid,getName:c.getName,getSize:c.getSize,getUuid:c.getUuid,log:s,onCancel:c.onCancel,onProgress:c.onProgress,onUuidChanged:c.onUuidChanged}))._removeExpiredChunkingRecords&&l._removeExpiredChunkingRecords()},isDeferredEligibleForUpload:function(e){return c.isQueued(e)},maybeDefer:function(n,e){return e&&!l.getFile(n)&&e instanceof qq.BlobProxy?(c.onUploadPrep(n),s("Attempting to generate a blob on-demand for "+n),e.create().then(function(e){s("Generated an on-demand blob for "+n),l.updateBlob(n,e),
1c.setSize(n,e.size),l.reevaluateChunking(n),h.maybeSendDeferredFiles(n)},function(e){var t={};e&&(t.error=e),s(qq.format("Failed to generate blob for ID {}.  Error message: {}.",n,e),"error"),c.onComplete(n,c.getName(n),qq.extend(t,i),null),h.maybeSendDeferredFiles(n),p.free(n)}),!1):h.maybeSendDeferredFiles(n)},maybeSendDeferredFiles:function(n){var e=c.getIdsInProxyGroup(n),i=!1;return e&&e.length?(s("Maybe ready to upload proxy group file "+n),qq.each(e,function(e,t){if(h.isDeferredEligibleForUpload(t)&&l.getFile(t))i=t===n,h.now(t);else if(h.isDeferredEligibleForUpload(t))return!1})):(i=!0,h.now(n)),i},maybeNewUuid:function(e,t){void 0!==t.newUuid&&c.onUuidChanged(e,t.newUuid)},normalizeResponse:function(e,t){var n=e;return qq.isObject(e)||(n={},qq.isString(e)&&!t&&(n.error=e)),n.success=t,n},now:function(e){var t=c.getName(e);if(!o.isValid(e))throw new qq.Error(e+" is not a valid file ID to upload!");c.onUpload(e,t),a&&l._shouldChunkThisFile(e)?d.sendNext(e):r(e,t)},start:function(e){var t=h.getProxyOrBlob(e);return t?h.maybeDefer(e,t):(h.now(e),!0)}};qq.extend(this,{add:function(e,t){l.add.apply(this,arguments)},upload:function(e){return!!p.open(e)&&h.start(e)},retry:function(e){return u&&(l._getFileState(e).temp.ignoreFailure=!1),p.isUsingConnection(e)?h.start(e):o.upload(e)},cancel:function(e){var t=l.cancel(e);qq.isGenericPromise(t)?t.then(function(){h.cancel(e)}):!1!==t&&h.cancel(e)},cancelAll:function(){var e,t=p.getWaitingOrConnected();if(t.length)for(e=t.length-1;0<=e;e--)o.cancel(t[e]);p.reset()},getFile:function(e){return l.getProxy&&l.getProxy(e)?l.getProxy(e).referenceBlob:l.getFile&&l.getFile(e)},isProxied:function(e){return!(!l.getProxy||!l.getProxy(e))},getInput:function(e){if(l.getInput)return l.getInput(e)},reset:function(){s("Resetting upload handler"),o.cancelAll(),p.reset(),l.reset()},expunge:function(e){if(o.isValid(e))return l.expunge(e)},isValid:function(e){return l.isValid(e)},getResumableFilesData:function(){return l.getResumableFilesData?l.getResumableFilesData():[]},getThirdPartyFileId:function(e){if(o.isValid(e))return l.getThirdPartyFileId(e)},pause:function(e){return!!(o.isResumable(e)&&l.pause&&o.isValid(e)&&l.pause(e))&&(p.free(e),l.moveInProgressToRemaining(e),!0)},isResumable:function(e){return!!l.isResumable&&l.isResumable(e)}}),qq.extend(c,e),s=c.log,a=c.chunking.enabled&&qq.supportedFeatures.chunking,u=a&&c.chunking.concurrent.enabled,(e={})[c.preventRetryParam]=!0,i=e,h.initHandler()},qq.FormUploadHandler=function(e){"use strict";var t=e.options,l=this,n=e.proxy,i=qq.getUniqueId(),u={},c={},d={},p=t.isCors,o=t.inputName,h=n.getUuid,q=n.log,f=new qq.WindowReceiveMessage({log:q});function m(e){return e.split("_")[0]}qq.extend(this,new qq.UploadHandler(e)),qq.override(this,function(n){return{add:function(e,t){n.add(e,{input
1:t}),t.setAttribute("name",o),t.parentNode&&qq(t).remove()},expunge:function(e){var t;delete c[t=e],p&&(clearTimeout(d[t]),delete d[t],f.stopReceivingMessages(t)),(t=document.getElementById(l._getIframeName(t)))&&(t.setAttribute("src","javascript:false;"),qq(t).remove()),n.expunge(e)},isValid:function(e){return n.isValid(e)&&void 0!==l._getFileState(e).input}}}),qq.extend(this,{getInput:function(e){return l._getFileState(e).input},_attachLoadEvent:function(e,t){var n,i,o,a,r,s;p?(o=t,a=(i=e).id,r=m(a),s=h(r),u[s]=o,c[r]=qq(i).attach("load",function(){l.getInput(r)&&(q("Received iframe load event for CORS upload request (iframe name "+a+")"),d[a]=setTimeout(function(){var e="No valid message received from loaded iframe for iframe name "+a;q(e,"error"),o({error:e})},1e3))}),f.receiveMessage(a,function(e){q("Received the following window message: '"+e+"'");m(a);var t,n=l._parseJsonResponse(e),i=n.uuid;i&&u[i]?(q("Handling response for iframe name "+a),clearTimeout(d[a]),delete d[a],l._detachLoadEvent(a),t=u[i],delete u[i],f.stopReceivingMessages(a),t(n)):i||q("'"+e+"' does not contain a UUID - ignoring.")})):c[e.id]=qq(e).attach("load",function(){if(q("Received response for "+e.id),e.parentNode){try{if(e.contentDocument&&e.contentDocument.body&&"false"==e.contentDocument.body.innerHTML)return}catch(e){q("Error when attempting to access iframe during handling of upload response ("+e.message+")","error"),n={success:!1}}t(n)}})},_createIframe:function(e){var t,e=l._getIframeName(e);return e=e,(t=qq.toElement("<iframe src='javascript:false;' name='"+e+"' />")).setAttribute("id",e),t.style.display="none",document.body.appendChild(t),t},_detachLoadEvent:function(e){void 0!==c[e]&&(c[e](),delete c[e])},_getIframeName:function(e){return e+"_"+i},_initFormForUpload:function(e){var t=e.method,n=e.endpoint,i=e.params,o=e.paramsInBody,e=e.targetName,t=qq.toElement("<form method='"+t+"' enctype='multipart/form-data'></form>"),a=n;return o?qq.obj2Inputs(i,t):a=qq.obj2url(i,n),t.setAttribute("action",a),t.setAttribute("target",e),t.style.display="none",document.body.appendChild(t),t},_parseJsonResponse:function(e){var t={};try{t=qq.parseJson(e)}catch(e){q("Error when attempting to parse iframe upload response ("+e.message+")","error")}return t}})},qq.XhrUploadHandler=function(e){"use strict";var c=this,o=e.options.namespace,t=e.proxy,r=e.options.chunking,i=e.options.resume,n=r&&e.options.chunking.enabled&&qq.supportedFeatures.chunking,a=i&&e.options.resume.enabled&&n&&qq.supportedFeatures.resume,d=t.getName,p=t.getSize,s=t.getUuid,l=t.getEndpoint,u=t.getDataByUuid,h=t.onUuidChanged,q=t.onProgress,f=t.log;function m(n){qq.each(c._getXhrs(n),function(e,t){e=c._getAjaxRequester(n,e);t.onreadystatechange=null,t.upload.onprogress=null,t.abort(),e&&e.canceled&&e.canceled(n)})}qq.extend(this,new qq.UploadHandler(e)),qq.override(this,function(n){return{add:function(e,t){if(qq.isFile(t)||qq.isBlob(t))n.add(e,{file:t});else{if(!(t instanceof qq.BlobProxy))throw new Error("Passed obj is not a File, Blob, or proxy");n.add(e,{proxy:t})}c._initTempState(e),a&&c._maybePrepareForResume(e)},expunge:function(e){m(e),c._maybeDeletePersistedChunkData(e),c._clearXhrs(e),n.expunge(e)}}}),qq.extend(this,{clearCachedChunk:function(e,t){delete c._getFileState(e).temp.cachedChunks[t]},clearXhr:function(e,t){e=c._getFileState(e).temp;e.xhrs&&delete e.xhrs[t],e.ajaxRequesters&&delete e.ajaxRequesters[t]},finalizeChunks:function(e,t){var n=c._getTotalChunks(e)-1,e=c._getXhr(e,n);return t?(new qq.Promise).success(t(e),e):(new qq.Promise).success({},e)},getFile:function(e){return c.isValid(e)&&c._getFileState(e).file},getProxy:function(e){return c.isValid(e)&&c._getFileState(e).proxy},getResumableFilesData:function(){var i=[];return c._iterateResumeRecords(function(e,t){c.moveInProgressToRemaining(null,t.chunking.inProgress,t.chunking.remaining);var n={name:t.name,remaining:t.chunking.remaining,size:t.size,uuid:t.uuid};t.key&&(n.key=t.key),i.push(n)}),i},isResumable:function(e){return!!r&&c.isValid(e)&&!c._getFileState(e).notResumable},moveInProgressToRemaining:function(e,t,n){var t=t||c._getFileState(e).chunking.inProgress,i=n||c._getFileState(e).chunking.remaining;t&&(f(qq.format("Moving these chunks from in-progress {}, to remaining.",JSON.stringify(t))),t.reverse(),qq.each(t,function(e,t){i.unshift(t)}),t.length=0)},pause:function(e){if(c.isValid(e))return f(qq.format("Aborting XHR upload for {} '{}' due to pause instruction.",e,d(e))),c._getFileState(e).paused=!0,m(e),!0},reevaluateChunking:function(e){if(r&&c.isValid(e)){var t,n,i=c._getFileState(e);if(delete i.chunking,i.chunking={},1<(t=c._getTotalChunks(e))||r.mandatory){for(i.chunking.enabled=!0,i.chunking.parts=t,i.chunking.remaining=[],n=0;n<t;n++)i.chunking.remaining.push(n);c._initTempState(e)}else i.chunking.enabled=!1}},updateBlob:function(e,t){c.isValid(e)&&(c._getFileState(e).file=t)},_clearXhrs:function(e){var t=c._getFileState(e).temp;qq.each(t.ajaxRequesters,function(e){delete t.ajaxRequesters[e]}),qq.each(t.xhrs,function(e){delete t.xhrs[e]})},_createXhr:function(e,t){return c._registerXhr(e,t,qq.createXhrInstance())},_getAjaxRequester:function(e,t){t=null==t?-1:t;return c._getFileState(e).temp.ajaxRequesters[t]},_getChunkData:function(e,t){var n=r.partSize,i=p(e),o=c.getFile(e),a=n*t,i=i<=a+n?i:a+n,n=c._getTotalChunks(e),e=this._getFileState(e).temp.cachedChunks,o=e[t]||qq.sliceBlob(o,a,i);return{part:t,start:a,end:i,count:n,blob:e[t]=o,size:i-a}},_getChunkDataForCallback:function(e){return{partIndex:e.part,startByte:e.start+1,endByte:e.end,totalParts:e.count}},_getLocalStorageId:function(e){var t=d(e),n=p(e),i=r.partSize,e=l(e);return qq.format("qq{}resume{}-{}-{}-{}-{}",o,"5.0",t,n,i,e)},_getMimeType:function(e){return c.getFile(e).type},_getPersistableData:function(e){return c._getFileState(e).chunking},_getTotalChunks:function(e){var t;if(r)return e=p(e),t=r.partSize,Math.ceil(e/t)},_getXhr:function(e,t){t=null==t?-1:t;return c._getFileState(e).temp.xhrs[t]},_getXhrs:function(e){return c._getFileState(e).temp.xhrs},_iterateResumeRecords:function(n){a&&qq.each(localStorage,function(e,t){0===e.indexOf(qq.format("qq{}resume",o))&&(t=JSON.parse(t),n(e,t))})},_initTempState:function(e){c._getFileState(e).temp={ajaxRequesters:{},chunkProgress:{},xhrs:{},cachedChunks:{}}},_markNotResumable:function(e){c._getFileState(e).notResumable=!0},_maybeDeletePersistedChunkData:function(e){return!!(a&&c.isResumable(e)&&(e=c._getLocalStorageId(e))&&localStorage.getItem(e))&&(localStorage.removeItem(e),!0)},_maybePrepareForResume:function(e){var t,n=c._getFileState(e);a&&void 0===n.key&&(t=c._getLocalStorageId(e),(t=localStorage.getItem(t))&&(t=JSON.parse(t),u(t.uuid)?c._markNotResumable(e):(f(qq.format("Identified file with ID {} and name of {} as resumable.",e,d(e))),h(e,t.uuid),n.key=t.key,n.chunking=t.chunking,n.loaded=t.loaded,n.attemptingResume=!0,c.moveInProgressToRemaining(e))))},_maybePersistChunkedState:function(t){var e,n=c._getFileState(t);if(a&&c.isResumable(t)){e=c._getLocalStorageId(t),n={name:d(t),size:p(t),uuid:s(t),key:n.key,chunking:n.chunking,loaded:n.loaded,lastUpdated:Date.now()};try{localStorage.setItem(e,JSON.stringify(n))}catch(e){f(qq.format("Unable to save resume data for '{}' due to error: '{}'.",t,e.toString()),"warn")}}},_registerProgressHandler:function(r,s,l){var e=c._getXhr(r,s),u=d(r),t={simple:function(e,t){var n=p(r);q(r,u,e===t?n:n<=e?n-1:e,n)},chunked:function(e,t){var n=c._getFileState(r).temp.chunkProgress,i=c._getFileState(r).loaded,o=p(r),a=i;n[s]=e-(t-l),qq.each(n,function(e,t){a+=t}),q(r,u,a,o)}};e.upload.onprogress=function(e){e.lengthComputable&&t[null==l?"simple":"chunked"](e.loaded,e.total)}},_registerXhr:function(e,t,n,i){t=null==t?-1:t,e=c._getFileState(e).temp;return e.xhrs=e.xhrs||{},e.ajaxRequesters=e.ajaxRequesters||{},e.xhrs[t]=n,i&&(e.ajaxRequesters[t]=i),n},_removeExpiredChunkingRecords:function(){var n=i.recordsExpireIn;c._iterateResumeRecords(function(e,t){t=new Date(t.lastUpdated);t.setDate(t.getDate()+n),t.getTime()<=Date.now()&&(f("Removing expired resume record with key "+e),localStorage.removeItem(e))})},_shouldChunkThisFile:function(e){var t=c._getFileState(e);return t.chunking||c.reevaluateChunking(e),t.chunking.enabled}})},qq.WindowReceiveMessage=function(e){"use strict";var n={};qq.extend({log:function(e,t){}},e),qq.extend(this,{receiveMessage:function(e,t){window.postMessage?n[e]=qq(window).attach("message",function(e){t(e.data)}):log("iframe message passing not supported in this browser!","error")},stopReceivingMessages:function(e){window.postMessage&&(e=n[e])&&e()}})},!function(){"use strict";qq.uiPublicApi={addInitialFiles:function(e){this._parent.prototype.addInitialFiles.apply(this,arguments),this._templating.addCacheToDom()},clearStoredFiles:function(){this._parent.prototype.clearStoredFiles.apply(this,arguments),this._templating.clearFiles()},addExtraDropzone:function(e){this._dnd&&this._dnd.setupExtraDropzone(e)},removeExtraDropzone:function(e){if(this._dnd)return this._dnd.removeDropzone(e)},getItemByFileId:function(e){if(!this._templating.isHiddenForever(e))return this._templating.getFileContainer(e)},reset:function(){this._parent.prototype.reset.apply(this,arguments),this._templating.reset(),!this._options.button&&this._templating.getButton()&&(this._defaultButtonId=this._createUploadButton({element:this._templating.getButton(),title:this._options.text.fileInputTitle}).getButtonId()),this._dnd&&(this._dnd.dispose(),this._dnd=this._setupDragAndDrop()),this._totalFilesInBatch=0,this._filesInBatchAddedToUi=0,this._setupClickAndEditEventHandlers()},setName:function(e,t){t=this._options.formatFileName(t);this._parent.prototype.setName.apply(this,arguments),this._templating.updateFilename(e,t)},pauseUpload:function(e){var t=this._parent.prototype.pauseUpload.apply(this,arguments);return t&&this._templating.uploadPaused(e),t},continueUpload:function(e){var t=this._parent.prototype.continueUpload.apply(this,arguments);return t&&this._templating.uploadContinued(e),t},getId:function(e){return this._templating.getFileId(e)},getDropTarget:function(e){return this.getFile(e).qqDropTarget}},qq.uiPrivateApi={_getButton:function(e){var t=this._parent.prototype._getButton.apply(this,arguments);return t||e===this._defaultButtonId&&(t=this._templating.getButton()),t},_removeFileItem:function(e){this._templating.removeFile(e)},_setupClickAndEditEventHandlers:function(){this._fileButtonsClickHandler=qq.FileButtonsClickHandler&&this._bindFileButtonsClickEvent(),this._focusinEventSupported=!qq.firefox(),this._isEditFilenameEnabled()&&(this._filenameClickHandler=this._bindFilenameClickEvent(),this._filenameInputFocusInHandler=this._bindFilenameInputFocusInEvent(),this._filenameInputFocusHandler=this._bindFilenameInputFocusEvent())},_setupDragAndDrop:function(){var i=this,e=this._options.dragAndDrop.extraDropzones,t=this._templating,
1n=t.getDropZone();return n&&e.push(n),new qq.DragAndDrop({dropZoneElements:e,allowMultipleItems:this._options.multiple,classes:{dropActive:this._options.classes.dropActive},callbacks:{processingDroppedFiles:function(){t.showDropProcessing()},processingDroppedFilesComplete:function(e,n){t.hideDropProcessing(),qq.each(e,function(e,t){t.qqDropTarget=n}),e.length&&i.addFiles(e,null,null)},dropError:function(e,t){i._itemError(e,t)},dropLog:function(e,t){i.log(e,t)}}})},_bindFileButtonsClickEvent:function(){var n=this;return new qq.FileButtonsClickHandler({templating:this._templating,log:function(e,t){n.log(e,t)},onDeleteFile:function(e){n.deleteFile(e)},onCancel:function(e){n.cancel(e)},onRetry:function(e){n.retry(e)},onPause:function(e){n.pauseUpload(e)},onContinue:function(e){n.continueUpload(e)},onGetName:function(e){return n.getName(e)}})},_isEditFilenameEnabled:function(){return this._templating.isEditFilenamePossible()&&!this._options.autoUpload&&qq.FilenameClickHandler&&qq.FilenameInputFocusHandler&&qq.FilenameInputFocusHandler},_filenameEditHandler:function(){var n=this,o=this._templating;return{templating:o,log:function(e,t){n.log(e,t)},onGetUploadStatus:function(e){return n.getUploads({id:e}).status},onGetName:function(e){return n.getName(e)},onSetName:function(e,t){n.setName(e,t)},onEditingStatusChange:function(e,t){var n=qq(o.getEditInput(e)),i=qq(o.getFileContainer(e));t?(n.addClass("qq-editing"),o.hideFilename(e),o.hideEditIcon(e)):(n.removeClass("qq-editing"),o.showFilename(e),o.showEditIcon(e)),i.addClass("qq-temp").removeClass("qq-temp")}}},_onUploadStatusChange:function(e,t,n){this._parent.prototype._onUploadStatusChange.apply(this,arguments),this._isEditFilenameEnabled()&&this._templating.getFileContainer(e)&&n!==qq.status.SUBMITTED&&(this._templating.markFilenameEditable(e),this._templating.hideEditIcon(e)),n===qq.status.UPLOAD_RETRYING?(this._templating.hideRetry(e),this._templating.setStatusText(e),qq(this._templating.getFileContainer(e)).removeClass(this._classes.retrying)):n===qq.status.UPLOAD_FAILED&&this._templating.hidePause(e)},_bindFilenameInputFocusInEvent:function(){var e=qq.extend({},this._filenameEditHandler());return new qq.FilenameInputFocusInHandler(e)},_bindFilenameInputFocusEvent:function(){var e=qq.extend({},this._filenameEditHandler());return new qq.FilenameInputFocusHandler(e)},_bindFilenameClickEvent:function(){var e=qq.extend({},this._filenameEditHandler());return new qq.FilenameClickHandler(e)},_storeForLater:function(e){this._parent.prototype._storeForLater.apply(this,arguments),this._templating.hideSpinner(e)},_onAllComplete:function(e,t){this._parent.prototype._onAllComplete.apply(this,arguments),this._templating.resetTotalProgress()},_onSubmit:function(e,t){var n=this.getFile(e);n&&n.qqPath&&this._options.dragAndDrop.reportDirectoryPaths&&this._paramsStore.addReadOnly(e,{qqpath:n.qqPath}),this._parent.prototype._onSubmit.apply(this,arguments),this._addToList(e,t)},_onSubmitted:function(e){this._isEditFilenameEnabled()&&(this._templating.markFilenameEditable(e),this._templating.showEditIcon(e),this._focusinEventSupported||this._filenameInputFocusHandler.addHandler(this._templating.getEditInput(e)))},_onProgress:function(e,t,n,i){this._parent.prototype._onProgress.apply(this,arguments),this._templating.updateProgress(e,n,i),100===Math.round(n/i*100)?(this._templating.hideCancel(e),this._templating.hidePause(e),this._templating.hideProgress(e),this._templating.setStatusText(e,this._options.text.waitingForResponse),this._displayFileSize(e)):this._displayFileSize(e,n,i)},_onTotalProgress:function(e,t){this._parent.prototype._onTotalProgress.apply(this,arguments),this._templating.updateTotalProgress(e,t)},_onComplete:function(t,e,n,i){var o=this._parent.prototype._onComplete.apply(this,arguments),a=this._templating,r=a.getFileContainer(t),s=this;function l(e){r&&(a.setStatusText(t),qq(r).removeClass(s._classes.retrying),a.hideProgress(t),s.getUploads({id:t}).status!==qq.status.UPLOAD_FAILED&&a.hideCancel(t),a.hideSpinner(t),e.success?s._markFileAsSuccessful(t):(qq(r).addClass(s._classes.fail),a.showCancel(t),a.isRetryPossible()&&!s._preventRetries[t]&&(qq(r).addClass(s._classes.retryable),a.showRetry(t)),s._controlFailureTextDisplay(t,e)))}return o instanceof qq.Promise?o.done(function(e){l(e)}):l(n),o},_markFileAsSuccessful:function(e){var t=this._templating;this._isDeletePossible()&&t.showDeleteButton(e),qq(t.getFileContainer(e)).addClass(this._classes.success),this._maybeUpdateThumbnail(e)},_onUploadPrep:function(e){this._parent.prototype._onUploadPrep.apply(this,arguments),this._templating.showSpinner(e)},_onUpload:function(e,t){var n=this._parent.prototype._onUpload.apply(this,arguments);return this._templating.showSpinner(e),n},_onUploadChunk:function(e,t){this._parent.prototype._onUploadChunk.apply(this,arguments),0<t.partIndex&&this._handler.isResumable(e)&&this._templating.allowPause(e)},_onCancel:function(e,t){this._parent.prototype._onCancel.apply(this,arguments),this._removeFileItem(e),0===this._getNotFinished()&&this._templating.resetTotalProgress()},_onBeforeAutoRetry:function(e){var t,n;this._parent.prototype._onBeforeAutoRetry.apply(this,arguments),this._showCancelLink(e),this._options.retry.showAutoRetryNote&&(n=this._autoRetries[e],t=this._options.retry.maxAutoAttempts,n=(n=this._options.retry.autoRetryNote.replace(/\{retryNum\}/g,n)).replace(/\{maxAuto\}/g,t),this._templating.setStatusText(e,n),qq(this._templating.getFileContainer(e)).addClass(this._classes.retrying))},_onBeforeManualRetry:function(e){return this._parent.prototype._onBeforeManualRetry.apply(this,arguments)?(this._templating.resetProgress(e),qq(this._templating.getFileContainer(e)).removeClass(this._classes.fail),this._templating.setStatusText(e),this._templating.showSpinner(e),this._showCancelLink(e),!0):(qq(this._templating.getFileContainer(e)).addClass(this._classes.retryable),this._templating.showRetry(e),!1)},_onSubmitDelete:function(e){var t=qq.bind(this._onSubmitDeleteSuccess,this);this._parent.prototype._onSubmitDelete.call(this,e,t)},_onSubmitDeleteSuccess:function(e,t,n){(this._options.deleteFile.forceConfirm?this._showDeleteConfirm:this._sendDeleteRequest).apply(this,arguments)},_onDeleteComplete:function(e,t,n){this._parent.prototype._onDeleteComplete.apply(this,arguments),this._templating.hideSpinner(e),n?(this._templating.setStatusText(e,this._options.deleteFile.deletingFailedText),this._templating.showDeleteButton(e)):this._removeFileItem(e)},_sendDeleteRequest:function(e,t,n){this._templating.hideDeleteButton(e),this._templating.showSpinner(e),this._templating.setStatusText(e,this._options.deleteFile.deletingStatusText),this._deleteHandler.sendDelete.apply(this,arguments)},_showDeleteConfirm:function(e,t,n){var i=this.getName(e),i=this._options.deleteFile.confirmMessage.replace(/\{filename\}/g,i),o=(this.getUuid(e),arguments),a=this,e=this._options.showConfirm(i);qq.isGenericPromise(e)?e.then(function(){a._sendDeleteRequest.apply(a,o)}):!1!==e&&a._sendDeleteRequest.apply(a,o)},_addToList:function(e,t,n){var i,o=0,a=this._handler.isProxied(e)&&this._options.scaling.hideScaled;this._options.display.prependFiles&&(i={index:o=1<this._totalFilesInBatch&&0<this._filesInBatchAddedToUi?this._filesInBatchAddedToUi-1:o}),n||(this._options.disableCancelForFormUploads&&!qq.supportedFeatures.ajaxUploading&&this._templating.disableCancel(),this._options.multiple||(o=this.getUploads({id:e}),this._handledProxyGroup=this._handledProxyGroup||o.proxyGroupId,o.proxyGroupId===this._handledProxyGroup&&o.proxyGroupId||(this._handler.cancelAll(),this._clearList(),this._handledProxyGroup=null))),n?(this._templating.addFileToCache(e,this._options.formatFileName(t),i,a),this._templating.updateThumbnail(e,this._thumbnailUrls[e],!0,this._options.thumbnails.customResizer)):(this._templating.addFile(e,this._options.formatFileName(t),i,a),this._templating.generatePreview(e,this.getFile(e),this._options.thumbnails.customResizer)),this._filesInBatchAddedToUi+=1,(n||this._options.display.fileSizeOnSubmit&&qq.supportedFeatures.ajaxUploading)&&this._displayFileSize(e)},_clearList:function(){this._templating.clearFiles(),this.clearStoredFiles()},_displayFileSize:function(e,t,n){var i=this.getSize(e),o=this._formatSize(i);0<=i&&(void 0!==t&&void 0!==n&&(o=this._formatProgress(t,n)),this._templating.updateSize(e,o))},_formatProgress:function(e,t){var n=this._options.text.formatProgress;function i(e,t){n=n.replace(e,t)}return i("{percent}",Math.round(e/t*100)),i("{total_size}",this._formatSize(t)),n},_controlFailureTextDisplay:function(e,t){var n=this._options.failedUploadTextDisplay.mode,i=this._options.failedUploadTextDisplay.responseProperty;"custom"===n?(t=(t=t[i])||this._options.text.failUpload,this._templating.setStatusText(e,t),this._options.failedUploadTextDisplay.enableTooltip&&this._showTooltip(e,t)):"default"===n?this._templating.setStatusText(e,this._options.text.failUpload):"none"!==n&&this.log("failedUploadTextDisplay.mode value of '"+n+"' is not val
1id","warn")},_showTooltip:function(e,t){this._templating.getFileContainer(e).title=t},_showCancelLink:function(e){this._options.disableCancelForFormUploads&&!qq.supportedFeatures.ajaxUploading||this._templating.showCancel(e)},_itemError:function(e,t,n){var i=this._parent.prototype._itemError.apply(this,arguments);this._options.showMessage(i)},_batchError:function(e){this._parent.prototype._batchError.apply(this,arguments),this._options.showMessage(e)},_setupPastePrompt:function(){var n=this;this._options.callbacks.onPasteReceived=function(){var e=n._options.paste.namePromptMessage,t=n._options.paste.defaultName;return n._options.showPrompt(e,t)}},_fileOrBlobRejected:function(e,t){--this._totalFilesInBatch,this._parent.prototype._fileOrBlobRejected.apply(this,arguments)},_prepareItemsForUpload:function(e,t,n){this._totalFilesInBatch=e.length,this._filesInBatchAddedToUi=0,this._parent.prototype._prepareItemsForUpload.apply(this,arguments)},_maybeUpdateThumbnail:function(e){var t=this._thumbnailUrls[e];this.getUploads({id:e}).status===qq.status.DELETED||!t&&!this._options.thumbnails.placeholders.waitUntilResponse&&qq.supportedFeatures.imagePreviews||this._templating.updateThumbnail(e,t,this._options.thumbnails.customResizer)},_addCannedFile:function(e){var t=this._parent.prototype._addCannedFile.apply(this,arguments);return this._addToList(t,this.getName(t),!0),this._templating.hideSpinner(t),this._templating.hideCancel(t),this._markFileAsSuccessful(t),t},_setSize:function(e,t){this._parent.prototype._setSize.apply(this,arguments),this._templating.updateSize(e,this._formatSize(t))},_sessionRequestComplete:function(){this._templating.addCacheToDom(),this._parent.prototype._sessionRequestComplete.apply(this,arguments)}}}(),qq.FineUploader=function(e,t){"use strict";var n=this;this._parent=(t?qq[t]:qq).FineUploaderBasic,this._parent.apply(this,arguments),qq.extend(this._options,{element:null,button:null,listElement:null,dragAndDrop:{extraDropzones:[],reportDirectoryPaths:!1},text:{formatProgress:"{percent}% of {total_size}",failUpload:"Upload failed",waitingForResponse:"Processing...",paused:"Paused"},template:"qq-template",classes:{retrying:"qq-upload-retrying",retryable:"qq-upload-retryable",success:"qq-upload-success",fail:"qq-upload-fail",editable:"qq-editable",hide:"qq-hide",dropActive:"qq-upload-drop-area-active"},failedUploadTextDisplay:{mode:"default",responseProperty:"error",enableTooltip:!0},messages:{tooManyFilesError:"You may only drop one file",unsupportedBrowser:"Unrecoverable error - this browser does not permit file uploading of any kind."},retry:{showAutoRetryNote:!0,autoRetryNote:"Retrying {retryNum}/{maxAuto}..."},deleteFile:{forceConfirm:!1,confirmMessage:"Are you sure you want to delete {filename}?",deletingStatusText:"Deleting...",deletingFailedText:"Delete failed"},display:{fileSizeOnSubmit:!1,prependFiles:!1},paste:{promptForName:!1,namePromptMessage:"Please name this image"},thumbnails:{customResizer:null,maxCount:0,placeholders:{waitUntilResponse:!1,notAvailablePath:null,waitingPath:null},timeBetweenThumbs:750},scaling:{hideScaled:!1},showMessage:function(e){if(n._templating.hasDialog("alert"))return n._templating.showDialog("alert",e);setTimeout(function(){window.alert(e)},0)},showConfirm:function(e){return n._templating.hasDialog("confirm")?n._templating.showDialog("confirm",e):window.confirm(e)},showPrompt:function(e,t){return n._templating.hasDialog("prompt")?n._templating.showDialog("prompt",e,t):window.prompt(e,t)}},!0),qq.extend(this._options,e,!0),this._templating=new qq.Templating({log:qq.bind(this.log,this),templateIdOrEl:this._options.template,containerEl:this._options.element,fileContainerEl:this._options.listElement,button:this._options.button,imageGenerator:this._imageGenerator,classes:{hide:this._options.classes.hide,editable:this._options.classes.editable},limits:{maxThumbs:this._options.thumbnails.maxCount,timeBetweenThumbs:this._options.thumbnails.timeBetweenThumbs},placeholders:{waitUntilUpdate:this._options.thumbnails.placeholders.waitUntilResponse,thumbnailNotAvailable:this._options.thumbnails.placeholders.notAvailablePath,waitingForThumbnail:this._options.thumbnails.placeholders.waitingPath},text:this._options.text}),this._options.workarounds.ios8SafariUploads&&qq.ios800()&&qq.iosSafari()?this._templating.renderFailure(this._options.messages.unsupportedBrowserIos8Safari):!qq.supportedFeatures.uploading||this._options.cors.expected&&!qq.supportedFeatures.uploadCors?this._templating.renderFailure(this._options.messages.unsupportedBrowser):(this._wrapCallbacks(),this._templating.render(),this._classes=this._options.classes,!this._options.button&&this._templating.getButton()&&(this._defaultButtonId=this._createUploadButton({element:this._templating.getButton(),title:this._options.text.fileInputTitle}).getButtonId()),this._setupClickAndEditEventHandlers(),qq.DragAndDrop&&qq.supportedFeatures.fileDrop&&(this._dnd=this._setupDragAndDrop()),this._options.paste.targetElement&&this._options.paste.promptForName&&(qq.PasteSupport?this._setupPastePrompt():this.log("Paste support module not found.","error")),this._totalFilesInBatch=0,this._filesInBatchAddedToUi=0)},qq.extend(qq.FineUploader.prototype,qq.basePublicApi),qq.extend(qq.FineUploader.prototype,qq.basePrivateApi),qq.extend(qq.FineUploader.prototype,qq.uiPublicApi),qq.extend(qq.FineUploader.prototype,qq.uiPrivateApi),qq.Templating=function(e){"use strict";function B(e){return T(P(e),F.cancel)}function c(e){return T(P(e),F.continueButton)}function N(e){return T(f,F[e+"Dialog"])}function d(e){return T(P(e),F.deleteButton)}function t(){return T(f,F.dropProcessing)}function L(e){return T(P(e),F.editNameIcon)}function n(e){return T(P(e),F.file)}function p(e){return T(P(e),F.pause)}function h(e){return T(P(e),F.retry)}function O(e){return T(P(e),F.size)}function i(e){return T(P(e),F.spinner)}function H(e,t){var n=D(e),e=null==e?F.totalProgressBar:F.progressBar;(n=n&&!qq(n).hasClass(e)?qq(n).getFirstByClass(e):n)&&(qq(n).css({width:t+"%"}),n.setAttribute("aria-valuenow",t))}var o,z,M,q,f,m,a,r,s,l,g="qq-file-id",j="qq-file-id-",G="qq-max-size",V="qq-server-scale",X="qq-hide-dropzone",_="qq-drop-area-text",W="qq-in-progress",Q="qq-hidden-forever",b={content:document.createDocumentFragment(),map:{}},Y=!1,u=0,v=!1,y=[],S=-1,w={log:null,limits:{maxThumbs:0,timeBetweenThumbs:750},templateIdOrEl:"qq-template",containerEl:null,fileContainerEl:null,button:null,imageGenerator:null,classes:{hide:"qq-hide",editable:"qq-editable"}
1,placeholders:{waitUntilUpdate:!1,thumbnailNotAvailable:null,waitingForThumbnail:null},text:{paused:"Paused"}},F={button:"qq-upload-button-selector",alertDialog:"qq-alert-dialog-selector",dialogCancelButton:"qq-cancel-button-selector",confirmDialog:"qq-confirm-dialog-selector",dialogMessage:"qq-dialog-message-selector",dialogOkButton:"qq-ok-button-selector",promptDialog:"qq-prompt-dialog-selector",uploader:"qq-uploader-selector",drop:"qq-upload-drop-area-selector",list:"qq-upload-list-selector",progressBarContainer:"qq-progress-bar-container-selector",progressBar:"qq-progress-bar-selector",totalProgressBarContainer:"qq-total-progress-bar-container-selector",totalProgressBar:"qq-total-progress-bar-selector",file:"qq-upload-file-selector",spinner:"qq-upload-spinner-selector",size:"qq-upload-size-selector",cancel:"qq-upload-cancel-selector",pause:"qq-upload-pause-selector",continueButton:"qq-upload-continue-selector",deleteButton:"qq-upload-delete-selector",retry:"qq-upload-retry-selector",statusText:"qq-upload-status-text-selector",editFilenameInput:"qq-edit-filename-selector",editNameIcon:"qq-edit-filename-icon-selector",dropText:"qq-upload-drop-area-text-selector",dropProcessing:"qq-drop-processing-selector",dropProcessingSpinner:"qq-drop-processing-spinner-selector",thumbnail:"qq-thumbnail-selector"},x={},C=new qq.Promise,I=new qq.Promise,J=function(t){var n=new qq.Promise;return I.then(function(e){K(e,t),t.src?n.success():(t.src=e.src,t.onload=function(){t.onload=null,R(t),n.success()})},function(){k(t),n.success()}),n},Z=function(e,t,n){var i=U(e);return o("Generating new thumbnail for "+e),t.qqThumbnailId=e,w.imageGenerator.generate(t,i,n).then(function(){u++,R(i),x[e].success()},function(){x[e].failure(),w.placeholders.waitUntilUpdate||A(e,i)})},E=function(){var e;y.length?(v=!0,((e=y.shift()).update?ee:$)(e)):v=!1},P=function(e){return b.map[e]||qq(m).getFirstByClass(j+e)},D=function(e){return null==e?T(f,F.totalProgressBarContainer)||T(f,F.totalProgressBar):T(P(e),F.progressBarContainer)||T(P(e),F.progressBar)},T=function(e,t){return e&&qq(e).getFirstByClass(t)},U=function(e){return a&&T(P(e),F.thumbnail)},k=function(e){e&&qq(e).addClass(w.classes.hide)},K=function(e,t){var n=e.style.maxWidth,e=e.style.maxHeight;e&&n&&!t.style.maxWidth&&!t.style.maxHeight&&qq(t).css({maxWidth:n,maxHeight:e})},A=function(e,t){var n=x[e]||(new qq.Promise).failure(),i=new qq.Promise;return C.then(function(e){n.then(function(){i.success()},function(){K(e,t),t.onload=function(){t.onload=null,i.success()},t.src=e.src,R(t)})}),i},$=function(e){var t=e.id,n=e.optFileOrBlob,i=n&&n.qqThumbnailId,o=U(t),a={customResizeFunction:e.customResizeFunction,maxSize:S,orient:!0,scale:!0};qq.supportedFeatures.imagePreviews?o?w.limits.maxThumbs&&w.limits.maxThumbs<=u?(A(t,o),E()):J(o).done(function(){x[t]=new qq.Promise,x[t].done(function(){setTimeout(E,w.limits.timeBetweenThumbs)}),null!=i?te(t,i):Z(t,n,a)}):E():o&&(J(o),E())},ee=function(e){var t=e.id,n=e.thumbnailUrl,i=e.showWaitingImg,o=U(t),e={customResizeFunction:e.customResizeFunction,scale:r,maxSize:S};if(o)if(n){if(!(w.limits.maxThumbs&&w.limits.maxThumbs<=u))return i&&J(o),w.imageGenerator.generate(n,o,e).then(function(){R(o),u++,setTimeout(E,w.limits.timeBetweenThumbs)},function(){A(t,o),setTimeout(E,w.limits.timeBetweenThumbs)});A(t,o),E()}else A(t,o),E()},R=function(e){e&&qq(e).removeClass(w.classes.hide)},te=function(e,t){var n=U(e),i=U(t);o(qq.format("ID {} is the same file as ID {}.  Will use generated thumbnail from ID {} instead.",e,t,t)),x[t].then(function(){u++,x[e].success(),o(qq.format("Now using previously generated thumbnail created for ID {} on ID {}.",t,e)),n.src=i.src,R(n)},function(){x[e].failure(),w.placeholders.waitUntilUpdate||A(e,n)})};qq.extend(w,e),o=w.log,qq.supportedFeatures.imagePreviews||(w.limits.timeBetweenThumbs=0,w.limits.maxThumbs=0),f=w.containerEl,a=void 0!==w.imageGenerator,q=function(){var e,t,n,i;if(o("Parsing template"),null==w.templateIdOrEl)throw new Error("You MUST specify either a template element or ID!");if(qq.isString(w.templateIdOrEl)){if(null===(i=document.getElementById(w.templateIdOrEl)))throw new Error(qq.format("Cannot find template script at ID '{}'!",w.templateIdOrEl));i=i.innerHTML}else{if(void 0===w.templateIdOrEl.innerHTML)throw new Error("You have specified an invali
1d value for the template option!  It must be an ID or an Element.");i=w.templateIdOrEl.innerHTML}if(i=qq.trimStr(i),(e=document.createElement("div")).appendChild(qq.toElement(i)),i=qq(e).getFirstByClass(F.uploader),w.button&&(t=qq(e).getFirstByClass(F.button))&&qq(t).remove(),qq.DragAndDrop&&qq.supportedFeatures.fileDrop||(t=qq(e).getFirstByClass(F.dropProcessing))&&qq(t).remove(),(t=qq(e).getFirstByClass(F.drop))&&!qq.DragAndDrop&&(o("DnD module unavailable.","info"),qq(t).remove()),qq.supportedFeatures.fileDrop?qq(i).hasAttribute(_)&&t&&(n=qq(t).getFirstByClass(F.dropText))&&qq(n).remove():(i.removeAttribute(_),t&&qq(t).hasAttribute(X)&&qq(t).css({display:"none"})),n=qq(e).getFirstByClass(F.thumbnail),a?n&&(S=0<(S=parseInt(n.getAttribute(G)))?S:null,r=qq(n).hasAttribute(V)):n&&qq(n).remove(),a=a&&n,z=0<qq(e).getByClass(F.editFilenameInput).length,M=0<qq(e).getByClass(F.retry).length,null==(i=qq(e).getFirstByClass(F.list)))throw new Error("Could not find the file list container in the template!");return t=i.innerHTML,i.innerHTML="",e.getElementsByTagName("DIALOG").length&&document.createElement("dialog"),o("Template parsing complete"),{template:qq.trimStr(e.innerHTML),fileTemplate:qq.trimStr(t)}}(),s=w.placeholders.thumbnailNotAvailable,l=w.placeholders.waitingForThumbnail,e={maxSize:S,scale:r},a&&(s?w.imageGenerator.generate(s,new Image,e).then(function(e){C.success(e)},function(){C.failure(),o("Problem loading 'not available' placeholder image at "+s,"error")}):C.failure(),l?w.imageGenerator.generate(l,new Image,e).then(function(e){I.success(e)},function(){I.failure(),o("Problem loading 'waiting for thumbnail' placeholder image at "+l,"error")}):I.failure()),qq.extend(this,{render:function(){o("Rendering template in DOM."),u=0,f.innerHTML=q.template,k(t()),this.hideTotalProgress(),m=w.fileContainerEl||T(f,F.list),o("Template rendering complete")},renderFailure:function(e){e=qq.toElement(e);f.innerHTML="",f.appendChild(e)},reset:function(){this.render()},clearFiles:function(){m.innerHTML=""},disableCancel:function(){Y=!0},addFile:function(e,t,n,i,o){var a,r=qq.toElement(q.fileTemplate),s=T(r,F.file),l=T(f,F.uploader),u=o?b.content:m;o&&(b.map[e]=r),qq(r).addClass(j+e),l.removeAttribute(_),s&&(qq(s).setText(t),s.setAttribute("title",t)),r.setAttribute(g,e),n?(o=r,l=n.index,t=(s=u).firstChild,0<l&&(t=qq(s).children()[l].nextSibling),s.insertBefore(o,t)):u.appendChild(r),i?(r.style.display="none",qq(r).addClass(Q)):(k(D(e)),k(O(e)),k(d(e)),k(h(e)),k(p(e)),k(c(e)),Y&&this.hideCancel(e),(a=U(e))&&!a.src&&I.then(function(e){a.src=e.src,e.style.maxHeight&&e.style.maxWidth&&qq(a).css({maxHeight:e.style.maxHeight,maxWidth:e.style.maxWidth}),R(a)}))},addFileToCache:function(e,t,n,i){this.addFile(e,t,n,i,!0)},addCacheToDom:function(){m.appendChild(b.content),b.content=document.createDocumentFragment(),b.map={}},removeFile:function(e){qq(P(e)).remove()},getFileId:function(e){var t=e;if(t){for(;null==t.getAttribute(g);)t=t.parentNode;return parseInt(t.getAttribute(g))}},getFileList:function(){return m},markFilenameEditable:function(e){e=n(e);e&&qq(e).addClass(w.classes.editable)},updateFilename:function(e,t){e=n(e);e&&(qq(e).setText(t),e.setAttribute("title",t))},hideFilename:function(e){k(n(e))},showFilename:function(e){R(n(e))},isFileName:function(e){return qq(e).hasClass(F.file)},getButton:function(){return w.button||T(f,F.button)},hideDropProcessing:function(){k(t())},showDropProcessing:function(){R(t())},getDropZone:function(){return T(f,F.drop)},isEditFilenamePossible:function(){return z},hideRetry:function(e){k(h(e))},isRetryPossible:function(){return M},showRetry:function(e){R(h(e))},getFileContainer:function(e){return P(e)},showEditIcon:function(e){e=L(e);e&&qq(e).addClass(w.classes.editable)},isHiddenForever:function(e){return qq(P(e)).hasClass(Q)},hideEditIcon:function(e){e=L(e);e&&qq(e).removeClass(w.classes.editable)},isEditIcon:function(e){return qq(e).hasClass(F.editNameIcon,!0)},getEditInput:function(e){return T(P(e),F.editFilenameInput)},isEditInput:function(e){return qq(e).hasClass(F.editFilenameInput,!0)},updateProgress:function(e,t,n){var i=D(e);i&&0<n&&((100===(t=Math.round(t/n*100))?k:R)(i),H(e,t))},updateTotalProgress:function(e,t){this.updateProgress(null,e,t)},hideProgress:function(e){e=D(e);e&&k(e)},hideTotalProgress:function(){this.hideProgress()},resetProgress:function(e){H(e,0),this.hideTotalProgress(e)},resetTotalProgress:function(){this.resetProgress()},showCancel:function(e){Y||(e=B(e))&&qq(e).removeClass(w.classes.hide)},hideCancel:function(e){k(B(e))},isCancel:function(e){return qq(e).hasClass(F.cancel,!0)},allowPause:function(e){R(p(e)),k(c(e))},uploadPaused:function(e){this.setStatusText(e,w.text.paused),this.allowContinueButton(e),k(i(e))},hidePause:function(e){k(p(e))},isPause:function(e){return qq(e).hasClass(F.pause,!0)},isContinueButton:function(e){return qq(e).hasClass(F.continueButton,!0)}
1,allowContinueButton:function(e){R(c(e)),k(p(e))},uploadContinued:function(e){this.setStatusText(e,""),this.allowPause(e),R(i(e))},showDeleteButton:function(e){R(d(e))},hideDeleteButton:function(e){k(d(e))},isDeleteButton:function(e){return qq(e).hasClass(F.deleteButton,!0)},isRetry:function(e){return qq(e).hasClass(F.retry,!0)},updateSize:function(e,t){e=O(e);e&&(R(e),qq(e).setText(t))},setStatusText:function(e,t){e=T(P(e),F.statusText);e&&(null==t?qq(e).clearText():qq(e).setText(t))},hideSpinner:function(e){qq(P(e)).removeClass(W),k(i(e))},showSpinner:function(e){qq(P(e)).addClass(W),R(i(e))},generatePreview:function(e,t,n){this.isHiddenForever(e)||(y.push({id:e,customResizeFunction:n,optFileOrBlob:t}),v||E())},updateThumbnail:function(e,t,n,i){this.isHiddenForever(e)||(y.push({customResizeFunction:i,update:!0,id:e,thumbnailUrl:t,showWaitingImg:n}),v||E())},hasDialog:function(e){return qq.supportedFeatures.dialogElement&&!!N(e)},showDialog:function(e,t,n){var i=N(e),e=T(i,F.dialogMessage),o=i.getElementsByTagName("INPUT")[0],a=T(i,F.dialogCancelButton),r=T(i,F.dialogOkButton),s=new qq.Promise,l=function(){a.removeEventListener("click",u),r&&r.removeEventListener("click",c),s.failure()},u=function(){a.removeEventListener("click",u),i.close()},c=function(){i.removeEventListener("close",l),r.removeEventListener("click",c),i.close(),s.success(o&&o.value)};return i.addEventListener("close",l),a.addEventListener("click",u),r&&r.addEventListener("click",c),o&&(o.value=n),e.textContent=t,i.showModal(),s}})},qq.traditional=qq.traditional||{},qq.traditional.FormUploadHandler=function(c,e){"use strict";var d=this,p=e.getName,h=e.getUuid,q=e.log;this.uploadFile=function(t){var e,n,i,o,a,r,s=d.getInput(t),l=d._createIframe(t),u=new qq.Promise;return e=t,n=l,i=c.paramsStore.get(e),o="get"===c.method.toLowerCase()?"GET":"POST",a=c.endpointStore.get(e),r=p(e),i[c.uuidName]=h(e),i[c.filenameParam]=r,(e=d._initFormForUpload({method:o,endpoint:a,params:i,paramsInBody:c.paramsInBody,targetName:n.name})).appendChild(s),d._attachLoadEvent(l,function(e){q("iframe loaded");e=e||function(e){var t,n,i;try{i=(n=e.contentDocument||e.contentWindow.document).body.innerHTML,q("converting iframe's innerHTML to JSON"),q("innerHTML = "+i),i&&i.match(/^<pre/i)&&(i=n.body.firstChild.firstChild.nodeValue),t=d._parseJsonResponse(i)}catch(e){q("Error when attempting to parse form upload response ("+e.message+")","error"),t={success:!1}}return t}(l);d._detachLoadEvent(t),c.cors.expected||qq(l).remove(),e.success?u.success(e):u.failure(e)}),q("Sending upload request for "+t),e.submit(),qq(e).remove(),u},qq.extend(this,new qq.FormUploadHandler({options:{isCors:c.cors.expected,inputName:c.inputName},proxy:{onCancel:c.onCancel,getName:p,getUuid:h,log:q}}))},qq.traditional=qq.traditional||{},qq.traditional.XhrUploadHandler=function(c,e){"use strict";function d(t,n){var i=new qq.Promise;return n.onreadystatechange=function(){var e;4===n.readyState&&((e=r(t,n)).success?i.success(e.response,n):i.failure(e.response,n))},i}function p(e,t,n,i){var o=new FormData,a=c.method,r=c.endpointStore.get(i),s=f(i),l=m(i);return e[c.uuidName]=u(i),e[c.filenameParam]=s,g&&(e[c.totalFileSizeName]=l),c.paramsInBody||(g||(e[c.inputName]=s),r=qq.obj2url(e,r)),t.open(a,r,!0),c.cors.expected&&c.cors.sendCredentials&&(t.withCredentials=!0),g?(c.paramsInBody&&qq.obj2FormData(e,o),o.append(c.inputName,n),o):n}function h(e,n){var t=c.customHeaders.get(e),e=q.getFile(e);n.setRequestHeader("Accept","application/json"),n.setRequestHeader("X-Requested-With","XMLHttpRequest"),n.setRequestHeader("Cache-Control","no-cache"),g||(n.setRequestHeader("Content-Type","application/octet-stream"),n.setRequestHeader("X-Mime-Type",e.type)),qq.each(t,function(e,t){n.setRequestHeader(e,t)})}var q=this,f=e.getName,m=e.getSize,u=e.getUuid,i=e.log,g=c.forceMultipart||c.paramsInBody,o=new qq.traditional.AllChunksDoneAjaxRequester({cors:c.cors,endpoint:c.chunking.success.endpoint,log:i}),a=function(e){var t=c.paramsStore.get(e),n=f(e),i=m(e);return t[c.uuidName]=u(e),t[c.filenameParam]=n,t[c.totalFileSizeName]=i,t[c.chunking.paramNames.totalParts]=q._getTotalChunks(e),t},n=function(e,t){return qq.indexOf([200,201,202,203,204],e.status)<0||!t.success||t.reset},r=function(e,t){return i("xhr - server response received for "+e),i("responseText = "+t.responseText),e=s(!0,t),{success:!n(t,e),response:e}},s=function(t,e){var n={};try{i(qq.format("Received response status {} with body: {}",e.status,e.responseText)),n=qq.parseJson(e.responseText)}catch(e){t&&i("Error when attempting to parse xhr response text ("+e.message+")","error")}return n};qq.extend(this,{uploadChunk:function(e,t,n){var i,o,a,r,s=q._getChunkData(e,t),l=q._createXhr(e,t),u=(m(e),d(e,l));return q._registerProgressHandler(e,t,s.size),t=c.paramsStore.get(e),o=t,a=s,r=m(i=e),i=f(i),o[c.chunking.paramNames.partIndex]=a.part,o[c.chunking.paramNames.partByteOffset]=a.start,o[c.chunking.paramNames.chunkSize]=a.size,o[c.chunking.paramNames.totalParts]=a.count,o[c.totalFileSizeName]=r,g&&(o[c.filenameParam]=i),n&&(t[c.resume.paramNames.resuming]=!0),a=p(t,l,s.blob,e),h(e,l),l.send(a),u},uploadFile:function(e){var t,n,i=q.getFile(e),o=q._createXhr(e);return q._registerProgressHandler(e),t=d(e,o),n=c.paramsStore.get(e),n=p(n,o,i,e),h(e,o),o.send(n),t}}),qq.extend(this,new qq.XhrUploadHandler({options:qq.extend({namespace:"traditional"},c),proxy:qq.extend({getEndpoint:c.endpointStore.get},e)})),qq.override(this,function(i){return{finalizeChunks:function(e){return c.chunking.success.endpoint?(t=e,n=new qq.Promise,o.complete(t,q._createXhr(t),a(t),c.customHeaders.get(t)).then(function(e){n.success(s(!1,e),e)},function(e){n.failure(s(!1,e),e)}),n):i.finalizeChunks(e,qq.bind(s,this,!0));var t,n}}})},qq.traditional.AllChunksDoneAjaxRequester=function(e){"use strict";var a,r={cors:{allowXdr:!1,expected:!1,sendCredentials:!1},endpoint:null,log:function(e,t){}},s={},t={get:function(e){return r.endpoint}};qq.extend(r,e),a=qq.extend(this,new qq.AjaxRequester({acceptHeader:"application/json",validMethods:["POST"],method:"POST",endpointStore:t,allowXRequestedWithAndCacheControl:!1,cors:r.cors,log:r.log,onComplete:function(e,t,n){var i=s[e];delete s[e],n?i.failure(t):i.success(t)}})),qq.extend(this,{complete:function(e,t,n,i){var o=new qq.Promise;return r.log("Submitting All Chunks Done request for "+e),s[e]=o,a.initTransport(e).withParams(n).withHeaders(i).send(t),o}})},qq.PasteSupport=function(e){"use strict";var i,t;i={targetElement:null,callbacks:{log:function(e,t){},pasteReceived:function(e){}}},qq.extend(i,e),t=qq(i.targetElement).attach("paste",function(e){e=e.clipboardData;e&&qq.each(e.items,function(e,t){var n;(n=t).type&&0===n.type.indexOf("image/")&&(n=t.getAsFile(),i.callbacks.pasteReceived(n))})}),qq.extend(this,{reset:function(){t&&t()}})},qq.DragAndDrop=function(e){"use strict";var r,o,n="qq-hidezones",s="qq-hide-dropzone",i=[],l=[],u=new qq.DisposeSupport;function c(i){var o=new qq.Promise;return i.isFile?i.file(function(e){var t=i.name,n=i.fullPath,t=n.indexOf(t);"/"===(n=n.substr(0,t)).charAt(0)&&(n=n.substr(1)),e.qqPath=n,l.push(e),o.success()},function(e){r.callbacks.dropLog("Problem parsing '"+i.fullPath+"'.  FileError code "+e.code+".","error"),o.failure()}):i.isDirectory&&function n(i,e,o,t){var a=t||new qq.Promise,r=e||i.createReader();r.readEntries(function(e){var t=o?o.concat(e):e;e.length?setTimeout(function(){n(i,r,t,a)},0):a.success(t)},a.failure);return a}(i).then(function(e){var n=e.length;qq.each(e,function(e,t){c(t).done(function(){0===--n&&o.success()})}),e.length||o.success()},function(e){r.callbacks.dropLog("Problem parsing '"+i.fullPath+"'.  FileError code "+e.code+".","error"),o.failure()}),o}function a(t){var a=new qq.UploadDropZone({HIDE_ZONES_EVENT_NAME:n,element:t,onEnter:function(e){qq(t).addClass(r.classes.dropActive),e.stopPropagation()},onLeaveNotDescendants:function(e){qq(t).removeClass(r.classes.dropActive)},onDrop:function(e){var t,i,o;e=e.dataTransfer,t=a,i=[],o=new qq.Promise,r.callbacks.processingDroppedFiles(),t.dropDisabled(!0),1<e.files.length&&!r.allowMultipleItems?(r.callbacks.processingDroppedFilesComplete([]),r.callbacks.dropError("tooManyFilesError",""),t.dropDisabled(!1),o.failure()):(l=[],qq.is
1FolderDropSupported(e)?qq.each(e.items,function(e,t){var n=t.webkitGetAsEntry();n&&(n.isFile?l.push(t.getAsFile()):i.push(c(n).done(function(){i.pop(),0===i.length&&o.success()})))}):l=e.files,0===i.length&&o.success()),o.then(function(){var e,t,n;e=l,t=a,n=Array.prototype.slice.call(e),r.callbacks.dropLog("Grabbed "+e.length+" dropped files."),t.dropDisabled(!1),r.callbacks.processingDroppedFilesComplete(n,t.getElement())},function(){r.callbacks.dropLog("Drop event DataTransfer parsing failed.  No files will be uploaded.","error")})}});return u.addDisposer(function(){a.dispose()}),qq(t).hasAttribute(s)&&qq(t).hide(),i.push(a),a}function t(){setTimeout(function(){qq.each(o,function(e,t){qq(t).hasAttribute(s)&&qq(t).hide(),qq(t).removeClass(r.classes.dropActive)})},10)}r={dropZoneElements:[],allowMultipleItems:!0,classes:{dropActive:null},callbacks:new qq.DragAndDrop.callbacks},qq.extend(r,e,!0),o=r.dropZoneElements,qq.each(o,function(e,t){var i=a(t);o.length&&qq.supportedFeatures.fileDrop&&u.attach(document,"dragenter",function(e){var n;!i.dropDisabled()&&(qq.each(e.dataTransfer.types,function(e,t){if("Files"===t)return!(n=!0)}),n)&&qq.each(o,function(e,t){t instanceof HTMLElement&&qq(t).hasAttribute(s)&&qq(t).css({display:"block"})})})}),u.attach(document,"dragleave",function(e){e=e,(qq.firefox()?!e.relatedTarget:qq.safari()?e.x<0||e.y<0:0===e.x&&0===e.y)&&t()}),u.attach(qq(document).children()[0],"mouseenter",function(e){t()}),u.attach(document,"drop",function(e){e.preventDefault(),t()}),u.attach(document,n,t),qq.extend(this,{setupExtraDropzone:function(e){r.dropZoneElements.push(e),a(e)},removeDropzone:function(e){var t,n=r.dropZoneElements;for(t in n)if(n[t]===e)return n.splice(t,1)},dispose:function(){u.dispose(),qq.each(i,function(e,t){t.dispose()})}})},qq.DragAndDrop.callbacks=function(){"use strict";return{processingDroppedFiles:function(){},processingDroppedFilesComplete:function(e,t){},dropError:function(e,t){qq.log("Drag & drop error code '"+e+" with these specifics: '"+t+"'","error")},dropLog:function(e,t){qq.log(e,t)}}},qq.UploadDropZone=function(e){"use strict";var i,t,n,o,a=new qq.DisposeSupport;function r(e){var t,n;if(qq.supportedFeatures.fileDrop)return e=e.dataTransfer,t=qq.safari(),n=!(!qq.ie()||!qq.supportedFeatures.fileDrop)||"none"!==e.effectAllowed,e&&n&&(e.files||!t&&e.types.contains&&e.types.contains("Files"))}function s(e){return n=void 0!==e?e:n}i={element:null,onEnter:function(e){},onLeave:function(e){},onLeaveNotDescendants:function(e){},onDrop:function(e){}},qq.extend(i,e),t=i.element,o||(a.attach(document,"dragover",function(e){e.preventDefault()}),o=!0),a.attach(t,"dragover",function(e){var t;r(e)&&(t=qq.ie()&&qq.supportedFeatures.fileDrop?null:e.dataTransfer.effectAllowed,e.dataTransfer.dropEffect="move"===t||"linkMove"===t?"move":"copy",e.stopPropagation(),e.preventDefault())}),a.attach(t,"dragenter",function(e){s()||r(e)&&i.onEnter(e)}),a.attach(t,"dragleave",function(e){var t;r(e)&&(i.onLeave(e),t=document.elementFromPoint(e.clientX,e.clientY),qq(this).contains(t)||i.onLeaveNotDescendants(e))}),a.attach(t,"drop",function(e){if(!s()&&r(e)){var t;function n(){(t=document.createEvent("Event")).initEvent(i.HIDE_ZONES_EVENT_NAME,!0,!0)}if(e.preventDefault(),e.stopPropagation(),i.onDrop(e),window.CustomEvent)try{t=new CustomEvent(i.HIDE_ZONES_EVENT_NAME)}catch(e){n()}else n();document.dispatchEvent(t)}}),qq.extend(this,{dropDisabled:s,dispose:function(){a.dispose()},getElement:function(){return t}})},qq.DeleteFileAjaxRequester=function(e){"use strict";var i,o={method:"DELETE",uuidParamName:"qquuid",endpointStore:{},maxConnections:3,customHeaders:function(e){return{}},paramsStore:{},cors:{expected:!1,sendCredentials:!1},log:function(e,t){},onDelete:function(e){},onDeleteComplete:function(e,t,n){}};qq.extend(o,e),i=qq.extend(this,new qq.AjaxRequester({acceptHeader:"application/json",validMethods:["POST","DELETE"],method:o.method,endpointStore:o.endpointStore,paramsStore:o.paramsStore,mandatedParams:"POST"===o.method.toUpperCase()?{_method:"DELETE"}:{},maxConnections:o.maxConnections,customHeaders:function(e){return o.customHeaders.get(e)},log:o.log,onSend:o.onDelete,onComplete:o.onDeleteComplete,cors:o.cors})),qq.extend(this,{sendDelete:function(e,t,n){n=n||{};o.log("Submitting delete file request for "+e),"DELETE"===o.method?i.initTransport(e).withPath(t).withParams(n).send():(n[o.uuidParamName]=t,i.initTransport(e).withParams(n).send())}})},!function(){function g(e,t,n,i,o){var a,r,s,l,u,c,d,p=e.naturalWi
1dth,h=e.naturalHeight,q=i.width,f=i.height,m=n.getContext("2d"),g=new qq.Promise;if(m.save(),i.resize)return t={blob:t,canvas:n,image:e,imageHeight:h,imageWidth:p,orientation:i.orientation,resize:i.resize,targetHeight:f,targetWidth:q},a=t.blob,r=t.image,_=t.imageHeight,s=t.imageWidth,b=t.orientation,l=new qq.Promise,C=t.resize,u=document.createElement("canvas"),v=u.getContext("2d"),c=t.canvas,d=t.targetHeight,t=t.targetWidth,T(u,s,_,b),c.height=d,c.width=t,v.drawImage(r,0,0),C({blob:a,height:d,image:r,sourceCanvas:u,targetCanvas:c,width:t}).then(function(){c.qqImageRendered&&c.qqImageRendered(),l.success()},l.failure),l;if(qq.supportedFeatures.unlimitedScaledImageSize||(s=function(e){var t=5241e3;if(!qq.ios())throw new qq.Error("Downsampled dimensions can only be reliably calculated for iOS!");if(e.origHeight*e.origWidth>t)return{newHeight:Math.round(Math.sqrt(t*(e.origHeight/e.origWidth))),newWidth:Math.round(Math.sqrt(t*(e.origWidth/e.origHeight)))}}({origWidth:q,origHeight:f}))&&(qq.log(qq.format("Had to reduce dimensions due to device limitations from {}w / {}h to {}w / {}h",q,f,s.newWidth,s.newHeight),"warn"),q=s.newWidth,f=s.newHeight),T(n,q,f,i.orientation),qq.ios()){b=(_=e).naturalWidth,v=_.naturalHeight,C=document.createElement("canvas"),1048576<b*v&&(C.width=C.height=1,(v=C.getContext("2d")).drawImage(_,1-b,0),0===v.getImageData(0,0,1,1).data[3])&&(p/=2,h/=2);var _,b,v,y,S,w,F=1024,x=document.createElement("canvas"),C=o?function(e,t){var n,i=document.createElement("canvas"),o=0,a=t,r=t;for(i.width=1,i.height=t,(i=i.getContext("2d")).drawImage(e,0,0),n=i.getImageData(0,0,1,t).data;o<r;)0===n[4*(r-1)+3]?a=r:o=r,r=a+o>>1;return 0==(e=r/t)?1:e}(e,h):1,I=Math.ceil(F*q/p),E=Math.ceil(F*f/h/C),P=0,D=0;for(x.width=x.height=F,y=x.getContext("2d");P<h;){for(w=S=0;S<p;)y.clearRect(0,0,F,F),y.drawImage(e,-S,-P),m.drawImage(x,0,0,F,F,w,D,I,E),S+=F,w+=I;P+=F,D+=E}m.restore()}else m.drawImage(e,0,0,q,f);return n.qqImageRendered&&n.qqImageRendered(),g.success(),g}function T(e,t,n,i){switch(i){case 5:case 6:case 7:case 8:e.width=n,e.height=t;break;default:e.width=t,e.height=n}var o=e.getContext("2d");switch(i){case 2:o.translate(t,0),o.scale(-1,1);break;case 3:o.translate(t,n),o.rotate(Math.PI);break;case 4:o.translate(0,n),o.scale(1,-1);break;case 5:o.rotate(.5*Math.PI),o.scale(1,-1);break;case 6:o.rotate(.5*Math.PI),o.translate(0,-n);break;case 7:o.rotate(.5*Math.PI),o.translate(t,-n),o.scale(-1,1);break;case 8:o.rotate(-.5*Math.PI),o.translate(-t,0)}}function e(e,t){var i=this;if(window.Blob&&e instanceof Blob){var n=new Image,o=window.URL&&window.URL.createObjectURL?window.URL:window.webkitURL&&window.webkitURL.createObjectURL?window.webkitURL:null;if(!o)throw Error("No createObjectURL function found to create blob url");n.src=o.createObjectURL(e),i.blob=e,e=n}e.naturalWidth||e.naturalHeight||(e.onload=function(){var n=i.imageLoadListeners;
1n&&(i.imageLoadListeners=null,setTimeout(function(){for(var e=0,t=n.length;e<t;e++)n[e]()},0))},e.onerror=t,this.imageLoadListeners=[]),this.srcImage=e}e.prototype.render=function(t,e){e=e||{};var n,i,o,a,r,s,l=this,u=this.srcImage.naturalWidth,c=this.srcImage.naturalHeight,d=e.width,p=e.height,h=e.maxWidth,q=e.maxHeight,f=!this.blob||"image/jpeg"===this.blob.type,m=t.tagName.toLowerCase();this.imageLoadListeners?this.imageLoadListeners.push(function(){l.render(t,e)}):(d&&!p?p=c*d/u<<0:p&&!d?d=u*p/c<<0:(d=u,p=c),h&&h<d&&(p=c*(d=h)/u<<0),q&&q<p&&(d=u*(p=q)/c<<0),n={width:d,height:p},qq.each(e,function(e,t){n[e]=t}),"img"===m?(s=t.src,h=l.srcImage,u=l.blob,i=n,q=f,o=document.createElement("canvas"),a=i.mime||"image/jpeg",r=new qq.Promise,g(h,u,o,i,q).then(function(){r.success(o.toDataURL(a,i.quality||.8))}),r.then(function(e){t.src=e,s===t.src&&t.onload()})):"canvas"===m&&g(this.srcImage,this.blob,t,n,f),"function"==typeof this.onrender&&this.onrender(t))},qq.MegaPixImage=e}(),qq.ImageGenerator=function(c){"use strict";function s(e){return"img"===e.tagName.toLowerCase()}function l(e){return"canvas"===e.tagName.toLowerCase()}function u(e){var t,n=document.createElement("a");return n.href=e,e=n.protocol,t=n.port,n=n.hostname,e.toLowerCase()!==window.location.protocol.toLowerCase()||(n.toLowerCase()!==window.location.hostname.toLowerCase()||t!==window.location.port&&!qq.ie())}function d(e,t){var n,i,o,a,r=s(e)||l(e);return s(e)?(a=t,(o=e).onload=function(){o.onload=null,o.onerror=null,a.success(o)},o.onerror=function(){o.onload=null,o.onerror=null,c("Problem drawing thumbnail!","error"),a.failure(o,"Problem drawing thumbnail!")}):l(e)?(i=t,(n=e).qqImageRendered=function(){i.success(n)}):(t.failure(e),c(qq.format("Element container of type {} is not supported!",e.tagName),"error")),r}function a(e,t,n,i,o){var a=new Image,r=new qq.Promise;d(a,r),u(e)&&(a.crossOrigin="anonymous"),a.src=e,r.then(function(){d(t,n),new qq.MegaPixImage(a).render(t,{maxWidth:i,maxHeight:i,mime:function(e){switch(e=(e=e.split("/"))[e.length-1].split("?")[0],e=(e=qq.getExtension(e))&&e.toLowerCase()){case"jpeg":case"jpg":return"image/jpeg";case"png":return"image/png";case"bmp":return"image/bmp";case"gif":return"image/gif";case"tiff":case"tif":return"image/tiff"}}(e),resize:o})},n.failure)}function r(e,t,n,i){d(t,n),qq(t).css({maxWidth:i+"px",maxHeight:i+"px"}),t.src=e}function p(e,t,n){var i=new qq.Promise,o=n.scale,n=o?n.maxSize:null;return o&&s(t)?(!(o=document.createElement("canvas")).getContext||!o.getContext("2d")||u(e)&&void 0===(new Image).crossOrigin?r:a)(e,t,i,n):l(t)?a(e,t,i,n):d(t,i)&&(t.src=e),i}qq.extend(this,{generate:function(e,t,n){return qq.isString(e)?(c("Attempting to update thumbnail based on server response."),p(e,t,n||{})):(c("Attempting to draw client-side image preview."),o=e,a=t,r=n||{},s=new qq.Promise,e=new qq.Identify(o,c),l=r.maxSize,u=null==r.orient||r.orient,e.isPreviewable().then(function(t){var e={parse:function(){return(new qq.Promise).success()}},e=u?new qq.Exif(o,c):e,n=new qq.MegaPixImage(o,i);d(a,s)&&e.parse().then(function(e){e=e&&e.Orientation;n.render(a,{maxWidth:l,maxHeight:l,orientation:e,mime:t,resize:r.customResizeFunction})},function(e){c(qq.format("EXIF data could not be parsed ({}).  Assuming orientation = 1.",e)),n.render(a,{maxWidth:l,maxHeight:l,mime:t,resize:r.customResizeFunction})})},function(){c("Not previewable"),s.failure(a,"Not previewable")}),s);function i(){a.onerror=null,a.onload=null,c("Could not render preview, file may be too large!","error"),s.failure(a,"Browser cannot render image!")}var o,a,r,s,l,u}})},qq.Exif=function(r,u){"use strict";var c=[274],d={274:{name:"Orientation",bytes:2}};function p(e){for(var t=0,n=0;0<e.length;)t+=parseInt(e.substring(0,2),16)*Math.pow(2,n),e=e.substring(2,e.length),n+=8;return t}function e(){var t=new qq.Promise;return qq.readBlobToHex(r,0,6).then(function(e){0!==e.indexOf("ffd8")?t.failure("Not a valid JPEG!"):function n(e,t){var i=e,o=t;return void 0===i&&(i=2,o=new qq.Promise),qq.readBlobToHex(r,i,4).then(function(e){var t=/^ffe([0-9])/.exec(e);t?"1"!==t[1]?(t=parseInt(e.slice(4,8),16),n(i+t+2,o)):o.success(i):o.failure("No EXIF header to be found!")}),o}().then(function(e){t.success(e)},function(e){t.failure(e)})}),t}qq.extend(this,{parse:function(){function a(e){u(qq.format("EXIF header parse failed: '{}' ",e)),l.failure(e)}var l=new qq.Promise;return e().then(function(o){var e,t;u(qq.format("Moving forward with EXIF header parsing for '{}'",void 0===r.name?"blob":r.name)),e=o,t=new qq.Promise,qq.readBlobToHex(r,e+10,2).then(function(e){t.success("4949"===e)}),t.then(function(t){var e,n,i;u(qq.format("EXIF Byte order is {} endian",t?"little":"big")),e=o,n=t,i=new qq.Promise,qq.readBlobToHex(r,e+18,2).then(function(e){if(n)return i.success(p(e));i.success(parseInt(e,16))}),i.then(function(e){u(qq.format("Found {} APP1 directory entries",e)),qq.readBlobToHex(r,o+20,12*e).then(function(e){var a,r,s,e=function(e){for(var t=[],n=0;n+24<=e.length;)t.push(e.slice(n,n+24)),n+=24;return t}(e),e=(a=t,e=e,r=qq.extend([],c),s={},qq.each(e,function(e,t){var n,i=t.slice(0,4),i=a?p(i):parseInt(i,16),o=r.indexOf(i);if(0<=o&&(n=d[i].name,i=d[i].bytes,t=t.slice(16,16+2*i),s[n]=a?p(t):parseInt(t,16),r.splice(o,1)),0===r.length)return!1}),s);u("Successfully parsed some EXIF tags"),l.success(e)},a)},a)},a)},a),l}})},qq.Identify=function(o,s){"use strict";qq.extend(this,{isPreviewable:function(){var e=this,a=new qq.Promise,r=!1,t=void 0===o.name?"blob":o.name;return s(qq.format("Attempting to determine if {} can be rendered in this browser",t)),s("First pass: check type attribute of blob object."),this.isPreviewableSync()?(s("Second pass: check for magic bytes in file header."),qq.readBlobToHex(o,0,4).then(function(o){qq.each(e.PREVIEWABLE_MIME_TYPES,function(e,t){if(n=o,i=!1,t=[].concat(t=t),qq.each(t,function(e,t){if(0===n.indexOf(t))return!(i=!0)}),i)return"image/tiff"===e&&!qq.supportedFeatures.tiffPreviews||(r=!0,a.success(e)),!1;var n,i}),s(qq.format("'{}' is {} able to be rendered in this browser",t,r?"":"NOT")),r||a.failure()},function(){s("Error reading file w/ name '"+t+"'.  Not able to be rendered in this browser."),a.failure()})):a.failure(),a},isPreviewableSync:function(){var e=o.type,t=0<=qq.indexOf(Object.keys(this.PREVIEWABLE_MIME_TYPES),e),n=!1,i=void 0===o.name?"blob":o.name;return(n=t?"image/tiff"!==e||qq.supportedFeatures.tiffPreviews:n)||s(i+" is not previewable in this browser per the blob's type attr"),n}})},qq.Identify.prototype.PREVIEWABLE_MIME_TYPES={"image/jpeg":"ffd8ff","image/gif":"474946","image/png":"89504e","image/bmp":"424d","image/tiff":["49492a00","4d4d002a"]},qq.ImageValidation=function(a,r){"use strict";this.validate=function(t){var n,i,o=new qq.Promise;return r("Attempting to validate image."),i=!1,qq.each(t,function(e,t){if(0<t)return!(i=!0)}),i?(n=new qq.Promise,new qq.Identify(a,r).isPreviewable().then(function(){var e=new Image,t=window.URL&&window.URL.createObjectURL?window.URL:window.webkitURL&&window.webkitURL.createObjectURL?window.webkitURL:null;t?(e.onerror=function(){r("Cannot determine dimensions for image.  May be too large.","error"),n.failure()},e.onload=function(){n.success({width:this.width,height:this.height})},e.src=t.createObjectURL(a)):(r("No createObjectURL function available to generate image URL!","error"),n.failure())},n.failure),n.then(function(e){a=e,qq.each(t,function(e,t){if(0<t){var n=/(max|min)(Width|Height)/.exec(e),i=n[2].charAt(0).toLowerCase()+n[2].slice(1),o=a[i];switch(n[1]){case"min":if(o<t)return r=e,!1;break;case"max":if(t<o)return r=e,!1}}});var a,r,e=r;e?o.failure(e):o.success()},o.success)):o.success(),o}},qq.Session=function(e){"use strict";var a={endpoint:null,params:{},customHeaders:{},cors:{},addFileRecord:function(e){},log:function(e,t){}};function o(e,t,n,i){var o=!1;(t=t&&function(e){if(qq.isArray(e))return!0;a.log("Session response is not an array.","error")}(e))&&qq.each(e,function(e,t){if(null==t.uuid)o=!0,a.log(qq.format("Session response item {} did not include a valid UUID - ignoring.",e),"error");else if(null==t.name)o=!0,a.log(qq.format("Session response item {} did not include a valid name - ignoring.",e),"error");else try{return a.addFileRecord(t),!0}catch(e){o=!0,a.log(e.message,"error")}return!1}),i[t&&!o?"success":"failure"](e,n)}qq.extend(a,e,!0),this.refresh=function(){var i=new qq.Promise,e=qq.extend({},a);return new qq.SessionAjaxRequester(qq.extend(e,{onComplete:function(e,t,n){o(e,t,n,i)}})).queryServer(),i}},qq.SessionAjaxRequester=function(e){"use strict";var t,o={endpoint:null,customHeaders:{},params:{},cors:{expected:!1,sendCredentials:!1},onComplete:function(e,t,n){},log:function(e,t){}};qq.extend(o,e),t=qq.extend(this,new qq.AjaxRequester({acceptHeader:"application/json",validMethods:["GET"],method:"GET",endpointStore:{get:function(){return o.endpoint}},customHeaders:o.customHeaders,log:o.log,onComplete:function(e,t,n){var i=null;if(null!=t.responseText)try{i=qq.parseJson(t.responseText)}catch(e){o.log("Problem parsing session response: "+e.message,"error"),n=!0}o.onComplete(i,!n,t)},cors:o.cors})),qq.extend(this,{queryServer:function(){var e=qq.extend({},o.params);o.log("Session query request."),t.initTransport("sessionRefresh").withParams(e).withCacheBuster().send()}})},qq.FormSupport=function(e,t,n){"use strict";var i,o,a,r=this,s=e.interceptSubmit,l=e.element,e=e.autoUpload;function u(e,t){if(!e.checkValidity||e.checkValidity())return 1;
1n("Form did not pass validation checks - will not upload.","error"),t()}qq.extend(this,{newEndpoint:null,newAutoUpload:e,attachedToForm:!1,getFormInputsAsObject:function(){return null==l?null:r._form2Obj(l)}}),(e=(e=l)&&(qq.isString(e)?document.getElementById(e):e))&&(n("Attaching to form element."),(a=e).getAttribute("action")&&(r.newEndpoint=a.getAttribute("action")),s&&(o=(i=e).submit,qq(i).attach("submit",function(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1,u(i,o)&&t()}),i.submit=function(){u(i,o)&&t()})),l=e,this.attachedToForm=!!l},qq.extend(qq.FormSupport.prototype,{_form2Obj:function(e){"use strict";function o(e){return t=e.type,0<=qq.indexOf(["checkbox","radio"],t.toLowerCase())&&!e.checked||e.disabled&&"hidden"!==e.type.toLowerCase();var t}var a={};return qq.each(e.elements,function(e,t){var n,i;(qq.isInput(t,!0)||"textarea"===t.tagName.toLowerCase())&&(i=t.type,qq.indexOf(["button","image","reset","submit"],i.toLowerCase())<0)&&!o(t)?a[t.name]=t.value:"select"!==t.tagName.toLowerCase()||o(t)||(n=null,qq.each(qq(t).children(),function(e,t){if("option"===t.tagName.toLowerCase()&&t.selected)return n=t.value,!1}),null!==(i=n)&&(a[t.name]=i))}),a}}),qq.Scaler=function(e,s){"use strict";var l=e.customResizer,n=e.sendOriginal,u=e.orient,c=e.defaultType,d=e.defaultQuality/100,p=e.failureText,h=e.includeExif,q=this._getSortedSizes(e.sizes);qq.extend(this,{enabled:qq.supportedFeatures.scaling&&0<q.length,getFileRecords:function(e,i,t){var o=this,a=[],r=t.blob||t;return new qq.Identify(r,s).isPreviewableSync()?(qq.each(q,function(e,t){var n=o._determineOutputType({defaultType:c,requestedType:t.type,refType:r.type});a.push({uuid:qq.getUniqueId(),name:o._getName(i,{name:t.name,type:n,refType:r.type}),blob:new qq.BlobProxy(r,qq.bind(o._generateScaledImage,o,{customResizeFunction:l,maxSize:t.maxSize,orient:u,type:n,quality:d,failedText:p,includeExif:h,log:s}))})}),a.push({uuid:e,name:i,size:r.size,blob:n?r:null})):a.push({uuid:e,name:i,size:r.size,blob:r}),a},handleNewFile:function(e,t,n,i,o,a,r,s){e.qqButtonId||e.blob&&e.blob.qqButtonId;var l=[],u=null,c=s.addFileToHandler,d=s.uploadData,p=s.paramsStore,h=qq.getUniqueId();qq.each(this.getFileRecords(n,t,e),function(e,t){var n=t.size;t.blob instanceof qq.BlobProxy&&(n=-1),n=d.addFile({uuid:t.uuid,name:t.name,size:n,batchId:a,proxyGroupId:h}),t.blob instanceof qq.BlobProxy?l.push(n):u=n,t.blob?(c(n,t.blob),o.push({id:n,file:t.blob})):d.setStatus(n,qq.status.REJECTED)}),null!==u&&(qq.each(l,function(e,t){var n={qqparentuuid:d.retrieve({id:u}).uuid,qqparentsize:d.retrieve({id:u}).size};n[r]=d.retrieve({id:t}).uuid,d.setParentId(t,u),p.addReadOnly(t,n)}),l.length&&((s={})[r]=d.retrieve({id:u}).uuid,p.addReadOnly(u,s)))}})},qq.extend(qq.Scaler.prototype,{scaleImage:function(t,e,n){"use strict";if(!qq.supportedFeatures.scaling)throw new qq.Error("Scaling is not supported in this browser!");var i=new qq.Promise,o=n.log,a=n.getFile(t),n=n.uploadData.retrieve({id:t}),r=n&&n.name,s=n&&n.uuid,n={customResizer:e.customResizer,sendOriginal:!1,orient:e.orient,defaultType:e.type||null,defaultQuality:e.quality,failedToScaleText:"Unable to scale",sizes:[{name:"",maxSize:e.maxSize}]},l=new qq.Scaler(n,o);return qq.Scaler&&qq.supportedFeatures.imagePreviews&&a?qq.bind(function(){var e=l.getFileRecords(s,r,a)[0];e&&e.blob instanceof qq.BlobProxy?e.blob.create().then(i.success,i.failure):(o(t+" is not a scalable image!","error"),i.failure())},this)():(i.failure(),o("Could not generate requested scaled image for "+t+".  Scaling is either not possible in this browser, or the file could not be located.","error")),i},_determineOutputType:function(e){"use strict";var t=e.requestedType,n=e.defaultType,e=e.refType;return n||t?t&&0<=qq.indexOf(Object.keys(qq.Identify.prototype.PREVIEWABLE_MIME_TYPES),t)&&("image/tiff"!==t||qq.supportedFeatures.tiffPreviews)?t:n:"image/jpeg"!==e?"image/png":e},_getName:function(e,t){"use strict";var n=e.lastIndexOf("."),i=t.type||"image/png",o=t.refType,a="",r=qq.getExtension(e),s="";return t.name&&t.name.trim().length&&(s=" ("+t.name+")"),0<=n?(a=e.substr(0,n),a+=s+"."+(r=o!==i?i.split("/")[1]:r)):a=e+s,a},_getSortedSizes:function(e){"use strict";return(e=qq.extend([],e)).sort(function(e,t){return e.maxSize>t.maxSize?1:e.maxSize<t.maxSize?-1:0})},_generateScaledImage:function(e,i){"use strict";var o=this,t=e.customResizeFunction,a=e.log,n=e.maxSize,r=e.orient,s=e.type,l=e.quality,u=e.failedText,c=e.includeExif&&"image/jpeg"===i.type&&"image/jpeg"===s,d=new qq.Promise,e=new qq.ImageGenerator(a),p=document.createElement("canvas");return a("Attempting to generate scaled version for "+i.name),e.generate(i,p,{maxSize:n,orient:r,customResizeFunction:t}).then(function(){function t(){a("Success generating scaled version for "+i.name);var e=qq.dataUriToBlob(n);d.success(e)}var n=p.toDataURL(s,l);c?o._insertExifHeader(i,n,a).then(function(e){n=e,t()},function(){a("Problem inserting EXIF header into scaled image.  Using scaled image w/out EXIF data.","error"),t()}):t()},function(){a("Failed attempt to generate scaled version for "+i.name,"error"),d.failure(u)}),d},_insertExifHeader:function(e,t,n){"use strict";var i,o=new FileReader,a=new qq.Promise;return o.onload=function(){i=o.result,a.success(qq.ExifRestorer.restore(i,t))},o.onerror=function(){n("Problem reading "+e.name+" during attempt to transfer EXIF data to scaled version.","error"),a.failure()},o.readAsDataURL(e),a},_dataUriToBlob:function(e){"use strict";
1var t=(0<=e.split(",")[0].indexOf("base64")?atob:decodeURI)(e.split(",")[1]),e=e.split(",")[0].split(":")[1].split(";")[0],n=new ArrayBuffer(t.length),i=new Uint8Array(n);return qq.each(t,function(e,t){i[e]=t.charCodeAt(0)}),this._createBlob(n,e)},_createBlob:function(e,t){"use strict";var n=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,n=n&&new n;return n?(n.append(e),n.getBlob(t)):new Blob([e],{type:t})}}),qq.ExifRestorer=function(){var e={KEY_STR:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",encode64:function(e){for(var t,n,i,o,a="",r="",s="",l=0;n=(t=e[l++])>>2,i=(3&t)<<4|(t=e[l++])>>4,o=(15&t)<<2|(r=e[l++])>>6,s=63&r,isNaN(t)?o=s=64:isNaN(r)&&(s=64),a=a+this.KEY_STR.charAt(n)+this.KEY_STR.charAt(i)+this.KEY_STR.charAt(o)+this.KEY_STR.charAt(s),o=s=r="",l<e.length;);return a},restore:function(e,t){var n="data:image/jpeg;base64,";if(!e.match(n))return t;e=this.decode64(e.replace(n,"")),e=this.slice2Segments(e),t=this.exifManipulation(t,e);return n+this.encode64(t)},exifManipulation:function(e,t){t=this.getExifArray(t),e=this.insertExif(e,t);return new Uint8Array(e)},getExifArray:function(e){for(var t,n=0;n<e.length;n++)if(255==(t=e[n])[0]&225==t[1])return t;return[]},insertExif:function(e,t){var e=e.replace("data:image/jpeg;base64,",""),e=this.decode64(e),n=e.indexOf(255,3),i=e.slice(0,n),e=e.slice(n);return i.concat(t).concat(e)},slice2Segments:function(e){for(var t,n,i=0,o=[];!(255==e[i]&218==e[i+1])&&(255==e[i]&216==e[i+1]?i+=2:(t=i+(256*e[i+2]+e[i+3])+2,n=e.slice(i,t),o.push(n),i=t),!(i>e.length)););return o},decode64:function(e){var t,n,i,o,a,r="",s=0,l=[];if(/[^A-Za-z0-9\+\/\=]/g.exec(e))throw new Error("There were invalid base64 characters in the input text.  Valid base64 characters are A-Z, a-z, 0-9, '+', '/',and '='");for(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");n=this.KEY_STR.indexOf(e.charAt(s++)),t=(15&(i=this.KEY_STR.indexOf(e.charAt(s++))))<<4|(o=this.KEY_STR.indexOf(e.charAt(s++)))>>2,r=(3&o)<<6|(a=this.KEY_STR.indexOf(e.charAt(s++))),l.push(n<<2|i>>4),64!=o&&l.push(t),64!=a&&l.push(r),t=r="",s<e.length;);return l}};return e}(),qq.TotalProgress=function(n,i){"use strict";function o(e){var t=i(e);0<t&&(a(e,0,t),r[e]={loaded:0,total:t})}function a(e,t,n){var i=r[e]?r[e].loaded:0,e=r[e]?r[e].total:0;-1===t&&-1===n?(s-=i,l-=e):(t&&(s+=t-i),n&&(l+=n-e)),d(s,l)}var r={},s=0,l=0,u=-1,c=-1,d=function(e,t){e===u&&t===c||n(e,t),u=e,c=t};qq.extend(this,{onAllComplete:function(e,t,n){var i,o;0!==t.length&&(i=n,o=!0,qq.each(t,function(e,t){if(0<=qq.indexOf(i,t))return o=!1}),!o)||(d(l,l),this.reset())},onStatusChange:function(e,t,n){var i;n===qq.status.CANCELED||n===qq.status.REJECTED?(a(i=e,-1,-1),delete r[i]):n===qq.status.SUBMITTING&&o(e)},onIndividualProgress:function(e,t,n){a(e,t,n),r[e]={loaded:t,total:n}},onNewSize:function(e){o(e)},reset:function(){r={},l=s=0}})},qq.UiEventHandler=function(e,t){"use strict";var n=new qq.DisposeSupport,i={eventType:"click",attachTo:null,onHandled:function(e,t){}};function o(e){n.attach(e,i.eventType,function(e){var t=(e=e||window.event).target||e.srcElement;i.onHandled(t,e)})}qq.extend(this,{addHandler:function(e){o(e)},dispose:function(){n.dispose()}}),qq.extend(t,{getFileIdFromItem:function(e){return e.qqFileId},getDisposeSupport:function(){return n}}),qq.extend(i,e),i.attachTo&&o(i.attachTo)},qq.FileButtonsClickHandler=function(e){"use strict";var o={templating:null,log:function(e,t){},onDeleteFile:function(e){},onCancel:function(e){},onRetry:function(e){},onPause:function(e){},onContinue:function(e){},onGetName:function(e){}},t={cancel:function(e){o.onCancel(e)},retry:function(e){o.onRetry(e)},deleteButton:function(e){o.onDeleteFile(e)},pause:function(e){o.onPause(e)},continueButton:function(e){o.onContinue(e)}};qq.extend(o,e),o.eventType="click",o.onHandled=function(n,i){qq.each(t,function(e,t){var e=e.charAt(0).toUpperCase()+e.slice(1);if(o.templating["is"+e](n))return e=o.templating.getFileId(n),qq.preventDefault(i),o.log(qq.format("Detected valid file button click event on file '{}', ID: {}.",o.onGetName(e),e)),t(e),!1})},o.attachTo=o.templating.getFileList(),qq.extend(this,new qq.UiEventHandler(o,{}))},qq.FilenameClickHandler=function(e){"use strict";var i={},o={templating:null,log:function(e,t){},classes:{file:"qq-upload-file",editNameIcon:"qq-edit-filename-icon"},onGetUploadStatus:function(e){},onGetName:function(e){}};qq.extend(o,e),o.eventType="click",o.onHandled=function(e,t){var n;(o.templating.isFileName(e)||o.templating.isEditIcon(e))&&(n=o.templating.getFileId(e),o.onGetUploadStatus(n)===qq.status.SUBMITTED&&(o.log(qq.format("Detected valid filename click event on file '{}', ID: {}.",o.onGetName(n),n)),qq.preventDefault(t),i.handleFilenameEdit(n,e,!0)))},qq.extend(this,new qq.FilenameEditHandler(o,i))},qq.FilenameInputFocusInHandler=function(e,i){"use strict";var o={templating:null,onGetUploadStatus:function(e){},log:function(e,t){}};i=i||{},o.eventType="focusin",o.onHandled=function(e,t){var n;o.templating.isEditInput(e)&&(n=o.templating.getFileId(e),o.onGetUploadStatus(n)===qq.status.SUBMITTED&&(o.log(qq.format("Detected valid filename input focus event on file '{}', ID: {}.",o.onGetName(n),n)),i.handleFilenameEdit(n,e)))},qq.extend(o,e),qq.extend(this,new qq.FilenameEditHandler(o,i))},qq.FilenameInputFocusHandler=function(e){"use strict";e.eventType="focus",e.attachTo=null,qq.extend(this,new qq.FilenameInputFocusInHandler(e,{}))},qq.FilenameEditHandler=function(e,c){"use strict";var d={templating:null,log:function(e,t){}
1,onGetUploadStatus:function(e){},onGetName:function(e){},onSetName:function(e,t){},onEditingStatusChange:function(e,t){}};function p(e,t){var n,e=e.value;void 0!==e&&0<qq.trimStr(e).length&&(n=t,n=d.onGetName(t),n=qq.getExtension(n),d.onSetName(t,e=void 0!==n?e+"."+n:e)),d.onEditingStatusChange(t,!1)}qq.extend(d,e),d.attachTo=d.templating.getFileList(),qq.extend(this,new qq.UiEventHandler(d,c)),qq.extend(c,{handleFilenameEdit:function(e,t,n){var i,o,a,r,s,l,u=d.templating.getEditInput(e);d.onEditingStatusChange(e,!0),u.value=(i=e,i=0<(o=(i=d.onGetName(i)).lastIndexOf("."))?i.substr(0,o):i),n&&u.focus(),a=u,r=e,c.getDisposeSupport().attach(a,"blur",function(){p(a,r)}),s=u,l=e,c.getDisposeSupport().attach(s,"keyup",function(e){13===(e.keyCode||e.which)&&p(s,l)})}})},!function(s){"use strict";var l,o=["uploaderType","endpointType"];function r(e){var t,n,r,e=c(e||{}),i=(t=e,i=a("uploaderType"),n=a("endpointType"),i?(i=i.charAt(0).toUpperCase()+i.slice(1).toLowerCase(),new(n?qq[n]:qq)["FineUploader"+i](t)):new(n?qq[n]:qq).FineUploader(t));return u(i),n=i,r=e.callbacks={},s.each(n._options.callbacks,function(e,i){var o,a=/^on(\w+)/.exec(e)[1];a=a.substring(0,1).toLowerCase()+a.substring(1),o=l,r[e]=function(){var e,t=Array.prototype.slice.call(arguments),n=[];s.each(t,function(e,t){n.push(d(t))}),t=i.apply(this,t);try{e=o.triggerHandler(a,n)}catch(e){qq.log("Caught error in Fine Uploader jQuery event handler: "+e.message,"error")}return null!=t?t:e}}),n._options.callbacks=r,l}function n(e,t){var n=l.data("fineuploader");if(!t)return void 0===n?null:n[e];(n=void 0===n?{}:n)[e]=t,l.data("fineuploader",n)}function u(e){return n("uploader",e)}function a(e,t){return n(e,t)}function c(e,t){var i,n=void 0===t?"basic"!==e.uploaderType?{element:l[0]}:{}:t;if(s.each(e,function(e,t){0<=s.inArray(e,o)?a(e,t):t instanceof s?n[e]=t[0]:s.isPlainObject(t)?(n[e]={},c(t,n[e])):s.isArray(t)?(i=[],s.each(t,function(e,t){var n={};t instanceof s?s.merge(i,t):s.isPlainObject(t)?(c(t,n),i.push(n)):i.push(t)}),n[e]=i):n[e]=t}),void 0===t)return n}function d(e){var t=e;return t=null==e||"object"!=typeof e||1!==e.nodeType&&9!==e.nodeType||!e.cloneNode?t:s(e)}s.fn.fineUploader=function(n){var i=this,o=arguments,a=[];return this.each(function(e,t){if(l=s(t),u()&&(t=n,"string"===s.type(t)&&!t.match(/^_/)&&void 0!==u()[t])){if(a.push(function(e){var t=[];return c(Array.prototype.slice.call(arguments,1),t),d(u()[e].apply(u(),t))}.apply(i,o)),1===i.length)return!1}else"object"!=typeof n&&n?s.error("Method "+n+" does not exist on jQuery.fineUploader"):r.apply(i,o)}),1===a.length?a[0]:1<a.length?a:this}}(jQuery),!function(r){"use strict";var s,i="fineUploaderDnd";function l(e){(e=e||{}).dropZoneElements=[s];var o,e=c(e);return o=e.callbacks={},r.each(new qq.DragAndDrop.callbacks,function(e,t){var n=e,i=s;o[e]=function(){var e=Array.prototype.slice.call(arguments);return i.triggerHandler(n,e)}}),u(new qq.DragAndDrop(e)),s}function u(e){var t="dndInstance",n=s.data(i);if(!e)return void 0===n?null:n[t];(n=void 0===n?{}:n)[t]=e,s.data(i,n)}function c(e,t){var n,i=void 0===t?{}:t;if(r.each(e,function(e,t){t instanceof r?i[e]=t[0]:r.isPlainObject(t)?(i[e]={},c(t,i[e])):r.isArray(t)?(n=[],r.each(t,function(e,t){t instanceof r?r.merge(n,t):n.push(t)}),i[e]=n):i[e]=t}),void 0===t)return i}r.fn.fineUploaderDnd=function(n){var i=this,o=arguments,a=[];return this.each(function(e,t){if(s=r(t),u()&&(t=n,"string"===r.type(t)&&"dispose"===t&&void 0!==u()[t])){if(a.push(function(e){var t=[];return c(Array.prototype.slice.call(arguments,1),t),u()[e].apply(u(),t)}.apply(i,o)),1===i.length)return!1}else"object"!=typeof n&&n?r.error("Method "+n+" does not exist in Fine Uploader's DnD module."):l.apply(i,o)}),1===a.length?a[0]:1<a.length?a:this}}(jQuery),"function"==typeof define&&define.amd?define(function(){return qq}):"undefined"!=typeof module&&module.exports?module.exports=qq:global.qq=qq}(window),!function(r){r(function(){function e(){var e=window.location.pathname;return/index.php/.test(window.location.pathname)&&(e+=window.location.search),e=e.endsWith("/")?e.substr(0,e.length-1):e}if("object"==typeof MediaUpload)for(var t=0;t<MediaUpload.instances.length;t++){var n=MediaUpload.instances[t],i=n.settings;r("#jquery-wrapped-fine-uploader-"+n.id).fineUploader({multiple:1<i.maximumItems,debug:!1,template:"media-upload-template-"+i.uniqueId,classes:{success:"alert success",fail:"alert error"},validation:{allowedExtensions:i.allowedExtensions,itemLimit:i.maximumItems,sizeLimit:i.maximumSize},messages:i.messages,showMessage:function(e){alert(e)},deleteFile:{enabled:!0,method:"POST",endpoint:e(),params:{type:1386871774}},request:{endpoint:e()}}).on("deleteComplete",{_settings:i},function(e){var n=[];r("#qq-upload-list-"+e.data._settings.uniqueId).find("li.success").find(".view-btn").each(function(e,t){t=r(t).attr("href").replace(/.*\//,"");n.push(t)}),r("#uploaded-files-"+e.data._settings.property).val(n.join(",")),0<r(".validation-file").length&&(r(".validation-file").val(n.join(",")).attr("value",n.join(",")).removeClass("parsley-succes").addClass("parsley-error"),r(".upload-error-container").css("display","block"))}).on("submit",{_settings:i},function(e){var t={};t["tx_mediaupload_pi1[storageIdentifier]"]=e.data._settings.storage,t.type="1386871773",r(this).fineUploader("setParams",t)}).on("complete",{_settings:i},function(e,t,n,i){var o,a=e.data._settings.uniqueId,e=e.data._settings.property,t=r(this).fineUploader("getItemByFileId",t).find(".view-btn");i.success&&(t.removeClass("hide"),t.attr("href",i.viewUrl),o=[],r("#qq-upload-list-"+a).find("li.success").find(".view-btn").each(function(e,t){t=r(t).attr("href").replace("/typo3temp/MediaUpload/","");o.push(t)}),r("#uploaded-files-"+e).val(o.join(",")),0<r(".validation-file").length&&(r(".validation-file").val(o.join(",")).attr("value",o.join(",")).removeClass("parsley-error").addClass("parsley-succes"),r(".upload-error-container").css("display","none")))})}})}(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.