if (typeof __coverage__ === 'undefined') { __coverage__ = {}; }
if (!__coverage__['build/uploader-queue/uploader-queue.js']) {
   __coverage__['build/uploader-queue/uploader-queue.js'] = {"path":"build/uploader-queue/uploader-queue.js","s":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0,"26":0,"27":0,"28":0,"29":0,"30":0,"31":0,"32":0,"33":0,"34":0,"35":0,"36":0,"37":0,"38":0,"39":0,"40":0,"41":0,"42":0,"43":0,"44":0,"45":0,"46":0,"47":0,"48":0,"49":0,"50":0,"51":0,"52":0,"53":0,"54":0,"55":0,"56":0,"57":0,"58":0,"59":0,"60":0,"61":0,"62":0,"63":0,"64":0,"65":0,"66":0,"67":0,"68":0,"69":0,"70":0,"71":0,"72":0,"73":0,"74":0,"75":0,"76":0,"77":0,"78":0,"79":0,"80":0,"81":0,"82":0,"83":0,"84":0,"85":0,"86":0,"87":0,"88":0,"89":0,"90":0,"91":0,"92":0,"93":0,"94":0,"95":0,"96":0,"97":0,"98":0,"99":0,"100":0,"101":0,"102":0,"103":0,"104":0,"105":0,"106":0,"107":0,"108":0,"109":0,"110":0,"111":0,"112":0,"113":0,"114":0,"115":0,"116":0,"117":0,"118":0,"119":0,"120":0,"121":0,"122":0,"123":0,"124":0,"125":0,"126":0,"127":0,"128":0,"129":0,"130":0,"131":0,"132":0,"133":0,"134":0,"135":0,"136":0,"137":0,"138":0,"139":0,"140":0,"141":0},"b":{"1":[0,0],"2":[0,0],"3":[0,0],"4":[0,0],"5":[0,0],"6":[0,0],"7":[0,0],"8":[0,0],"9":[0,0],"10":[0,0],"11":[0,0],"12":[0,0],"13":[0,0],"14":[0,0],"15":[0,0],"16":[0,0],"17":[0,0],"18":[0,0],"19":[0,0],"20":[0,0],"21":[0,0],"22":[0,0,0,0]},"f":{"1":0,"2":0,"3":0,"4":0,"5":0,"6":0,"7":0,"8":0,"9":0,"10":0,"11":0,"12":0,"13":0,"14":0,"15":0,"16":0,"17":0,"18":0,"19":0,"20":0,"21":0,"22":0,"23":0,"24":0,"25":0},"fnMap":{"1":{"name":"(anonymous_1)","line":1,"loc":{"start":{"line":1,"column":26},"end":{"line":1,"column":45}}},"2":{"name":"(anonymous_2)","line":28,"loc":{"start":{"line":28,"column":24},"end":{"line":28,"column":36}}},"3":{"name":"(anonymous_3)","line":58,"loc":{"start":{"line":58,"column":22},"end":{"line":58,"column":37}}},"4":{"name":"(anonymous_4)","line":69,"loc":{"start":{"line":69,"column":30},"end":{"line":69,"column":47}}},"5":{"name":"(anonymous_5)","line":84,"loc":{"start":{"line":84,"column":30},"end":{"line":84,"column":47}}},"6":{"name":"(anonymous_6)","line":128,"loc":{"start":{"line":128,"column":25},"end":{"line":128,"column":37}}},"7":{"name":"(anonymous_7)","line":158,"loc":{"start":{"line":158,"column":26},"end":{"line":158,"column":42}}},"8":{"name":"(anonymous_8)","line":169,"loc":{"start":{"line":169,"column":28},"end":{"line":169,"column":44}}},"9":{"name":"(anonymous_9)","line":179,"loc":{"start":{"line":179,"column":28},"end":{"line":179,"column":44}}},"10":{"name":"(anonymous_10)","line":194,"loc":{"start":{"line":194,"column":33},"end":{"line":194,"column":50}}},"11":{"name":"(anonymous_11)","line":212,"loc":{"start":{"line":212,"column":50},"end":{"line":212,"column":67}}},"12":{"name":"(anonymous_12)","line":239,"loc":{"start":{"line":239,"column":31},"end":{"line":239,"column":48}}},"13":{"name":"(anonymous_13)","line":257,"loc":{"start":{"line":257,"column":33},"end":{"line":257,"column":50}}},"14":{"name":"(anonymous_14)","line":269,"loc":{"start":{"line":269,"column":49},"end":{"line":269,"column":66}}},"15":{"name":"(anonymous_15)","line":285,"loc":{"start":{"line":285,"column":21},"end":{"line":285,"column":32}}},"16":{"name":"(anonymous_16)","line":307,"loc":{"start":{"line":307,"column":21},"end":{"line":307,"column":33}}},"17":{"name":"(anonymous_17)","line":316,"loc":{"start":{"line":316,"column":23},"end":{"line":316,"column":35}}},"18":{"name":"(anonymous_18)","line":331,"loc":{"start":{"line":331,"column":24},"end":{"line":331,"column":40}}},"19":{"name":"(anonymous_19)","line":349,"loc":{"start":{"line":349,"column":23},"end":{"line":349,"column":39}}},"20":{"name":"(anonymous_20)","line":360,"loc":{"start":{"line":360,"column":26},"end":{"line":360,"column":42}}},"21":{"name":"(anonymous_21)","line":373,"loc":{"start":{"line":373,"column":22},"end":{"line":373,"column":38}}},"22":{"name":"(anonymous_22)","line":506,"loc":{"start":{"line":506,"column":26},"end":{"line":506,"column":47}}},"23":{"name":"(anonymous_23)","line":525,"loc":{"start":{"line":525,"column":26},"end":{"line":525,"column":47}}},"24":{"name":"(anonymous_24)","line":561,"loc":{"start":{"line":561,"column":23},"end":{"line":561,"column":38}}},"25":{"name":"(anonymous_25)","line":563,"loc":{"start":{"line":563,"column":42},"end":{"line":563,"column":59}}}},"statementMap":{"1":{"start":{"line":1,"column":0},"end":{"line":655,"column":40}},"2":{"start":{"line":11,"column":4},"end":{"line":19,"column":19}},"3":{"start":{"line":28,"column":4},"end":{"line":38,"column":6}},"4":{"start":{"line":29,"column":8},"end":{"line":29,"column":30}},"5":{"start":{"line":30,"column":8},"end":{"line":30,"column":32}},"6":{"start":{"line":31,"column":8},"end":{"line":31,"column":33}},"7":{"start":{"line":32,"column":8},"end":{"line":32,"column":44}},"8":{"start":{"line":33,"column":8},"end":{"line":33,"column":31}},"9":{"start":{"line":34,"column":8},"end":{"line":34,"column":36}},"10":{"start":{"line":35,"column":8},"end":{"line":35,"column":28}},"11":{"start":{"line":37,"column":8},"end":{"line":37,"column":68}},"12":{"start":{"line":41,"column":4},"end":{"line":649,"column":7}},"13":{"start":{"line":70,"column":11},"end":{"line":70,"column":36}},"14":{"start":{"line":71,"column":11},"end":{"line":71,"column":44}},"15":{"start":{"line":72,"column":11},"end":{"line":72,"column":44}},"16":{"start":{"line":74,"column":11},"end":{"line":74,"column":50}},"17":{"start":{"line":85,"column":11},"end":{"line":85,"column":53}},"18":{"start":{"line":86,"column":11},"end":{"line":86,"column":36}},"19":{"start":{"line":87,"column":11},"end":{"line":87,"column":44}},"20":{"start":{"line":88,"column":11},"end":{"line":88,"column":44}},"21":{"start":{"line":90,"column":11},"end":{"line":90,"column":35}},"22":{"start":{"line":91,"column":11},"end":{"line":91,"column":60}},"23":{"start":{"line":92,"column":11},"end":{"line":92,"column":48}},"24":{"start":{"line":94,"column":11},"end":{"line":94,"column":39}},"25":{"start":{"line":96,"column":11},"end":{"line":117,"column":12}},"26":{"start":{"line":97,"column":13},"end":{"line":97,"column":32}},"27":{"start":{"line":100,"column":16},"end":{"line":117,"column":12}},"28":{"start":{"line":101,"column":12},"end":{"line":102,"column":58}},"29":{"start":{"line":103,"column":12},"end":{"line":106,"column":13}},"30":{"start":{"line":104,"column":15},"end":{"line":104,"column":56}},"31":{"start":{"line":105,"column":15},"end":{"line":105,"column":48}},"32":{"start":{"line":107,"column":15},"end":{"line":107,"column":37}},"33":{"start":{"line":109,"column":16},"end":{"line":117,"column":12}},"34":{"start":{"line":110,"column":12},"end":{"line":111,"column":58}},"35":{"start":{"line":112,"column":12},"end":{"line":115,"column":13}},"36":{"start":{"line":113,"column":15},"end":{"line":113,"column":56}},"37":{"start":{"line":114,"column":15},"end":{"line":114,"column":51}},"38":{"start":{"line":116,"column":14},"end":{"line":116,"column":36}},"39":{"start":{"line":119,"column":11},"end":{"line":119,"column":50}},"40":{"start":{"line":129,"column":10},"end":{"line":149,"column":11}},"41":{"start":{"line":130,"column":12},"end":{"line":133,"column":100}},"42":{"start":{"line":135,"column":15},"end":{"line":135,"column":58}},"43":{"start":{"line":137,"column":15},"end":{"line":137,"column":77}},"44":{"start":{"line":138,"column":15},"end":{"line":138,"column":83}},"45":{"start":{"line":139,"column":15},"end":{"line":139,"column":83}},"46":{"start":{"line":140,"column":15},"end":{"line":140,"column":77}},"47":{"start":{"line":141,"column":15},"end":{"line":141,"column":79}},"48":{"start":{"line":143,"column":15},"end":{"line":143,"column":72}},"49":{"start":{"line":144,"column":15},"end":{"line":144,"column":82}},"50":{"start":{"line":146,"column":15},"end":{"line":146,"column":105}},"51":{"start":{"line":148,"column":15},"end":{"line":148,"column":49}},"52":{"start":{"line":159,"column":10},"end":{"line":159,"column":36}},"53":{"start":{"line":160,"column":10},"end":{"line":160,"column":51}},"54":{"start":{"line":170,"column":10},"end":{"line":172,"column":11}},"55":{"start":{"line":171,"column":12},"end":{"line":171,"column":37}},"56":{"start":{"line":173,"column":10},"end":{"line":173,"column":51}},"57":{"start":{"line":174,"column":10},"end":{"line":174,"column":52}},"58":{"start":{"line":176,"column":10},"end":{"line":176,"column":39}},"59":{"start":{"line":180,"column":10},"end":{"line":180,"column":63}},"60":{"start":{"line":181,"column":10},"end":{"line":181,"column":69}},"61":{"start":{"line":182,"column":10},"end":{"line":182,"column":69}},"62":{"start":{"line":183,"column":10},"end":{"line":183,"column":63}},"63":{"start":{"line":184,"column":10},"end":{"line":184,"column":65}},"64":{"start":{"line":196,"column":11},"end":{"line":196,"column":48}},"65":{"start":{"line":198,"column":11},"end":{"line":198,"column":63}},"66":{"start":{"line":199,"column":11},"end":{"line":199,"column":73}},"67":{"start":{"line":202,"column":11},"end":{"line":204,"column":12}},"68":{"start":{"line":203,"column":15},"end":{"line":203,"column":37}},"69":{"start":{"line":206,"column":11},"end":{"line":206,"column":36}},"70":{"start":{"line":207,"column":11},"end":{"line":207,"column":44}},"71":{"start":{"line":208,"column":11},"end":{"line":208,"column":44}},"72":{"start":{"line":210,"column":11},"end":{"line":210,"column":55}},"73":{"start":{"line":212,"column":11},"end":{"line":214,"column":14}},"74":{"start":{"line":213,"column":14},"end":{"line":213,"column":37}},"75":{"start":{"line":216,"column":11},"end":{"line":216,"column":100}},"76":{"start":{"line":218,"column":11},"end":{"line":220,"column":76}},"77":{"start":{"line":222,"column":11},"end":{"line":222,"column":53}},"78":{"start":{"line":224,"column":11},"end":{"line":227,"column":12}},"79":{"start":{"line":225,"column":15},"end":{"line":225,"column":47}},"80":{"start":{"line":226,"column":15},"end":{"line":226,"column":58}},"81":{"start":{"line":241,"column":10},"end":{"line":241,"column":35}},"82":{"start":{"line":242,"column":10},"end":{"line":242,"column":43}},"83":{"start":{"line":243,"column":10},"end":{"line":243,"column":43}},"84":{"start":{"line":245,"column":10},"end":{"line":245,"column":49}},"85":{"start":{"line":259,"column":10},"end":{"line":259,"column":85}},"86":{"start":{"line":261,"column":10},"end":{"line":261,"column":35}},"87":{"start":{"line":262,"column":10},"end":{"line":262,"column":43}},"88":{"start":{"line":263,"column":10},"end":{"line":263,"column":43}},"89":{"start":{"line":265,"column":10},"end":{"line":265,"column":52}},"90":{"start":{"line":267,"column":10},"end":{"line":267,"column":54}},"91":{"start":{"line":269,"column":10},"end":{"line":271,"column":13}},"92":{"start":{"line":270,"column":13},"end":{"line":270,"column":36}},"93":{"start":{"line":273,"column":10},"end":{"line":273,"column":99}},"94":{"start":{"line":275,"column":10},"end":{"line":277,"column":75}},"95":{"start":{"line":287,"column":11},"end":{"line":287,"column":60}},"96":{"start":{"line":288,"column":11},"end":{"line":288,"column":36}},"97":{"start":{"line":289,"column":11},"end":{"line":289,"column":47}},"98":{"start":{"line":290,"column":11},"end":{"line":290,"column":34}},"99":{"start":{"line":291,"column":11},"end":{"line":291,"column":39}},"100":{"start":{"line":293,"column":11},"end":{"line":293,"column":56}},"101":{"start":{"line":295,"column":11},"end":{"line":297,"column":12}},"102":{"start":{"line":296,"column":16},"end":{"line":296,"column":38}},"103":{"start":{"line":308,"column":12},"end":{"line":308,"column":55}},"104":{"start":{"line":317,"column":12},"end":{"line":317,"column":57}},"105":{"start":{"line":318,"column":12},"end":{"line":320,"column":13}},"106":{"start":{"line":319,"column":15},"end":{"line":319,"column":37}},"107":{"start":{"line":332,"column":12},"end":{"line":332,"column":36}},"108":{"start":{"line":333,"column":12},"end":{"line":338,"column":13}},"109":{"start":{"line":334,"column":14},"end":{"line":334,"column":34}},"110":{"start":{"line":335,"column":14},"end":{"line":335,"column":43}},"111":{"start":{"line":336,"column":14},"end":{"line":336,"column":39}},"112":{"start":{"line":337,"column":14},"end":{"line":337,"column":36}},"113":{"start":{"line":350,"column":12},"end":{"line":350,"column":43}},"114":{"start":{"line":361,"column":12},"end":{"line":361,"column":40}},"115":{"start":{"line":375,"column":10},"end":{"line":404,"column":11}},"116":{"start":{"line":376,"column":12},"end":{"line":376,"column":36}},"117":{"start":{"line":377,"column":12},"end":{"line":391,"column":13}},"118":{"start":{"line":378,"column":14},"end":{"line":378,"column":51}},"119":{"start":{"line":379,"column":14},"end":{"line":379,"column":60}},"120":{"start":{"line":380,"column":14},"end":{"line":382,"column":15}},"121":{"start":{"line":381,"column":16},"end":{"line":381,"column":38}},"122":{"start":{"line":385,"column":14},"end":{"line":390,"column":15}},"123":{"start":{"line":386,"column":16},"end":{"line":389,"column":17}},"124":{"start":{"line":387,"column":18},"end":{"line":387,"column":48}},"125":{"start":{"line":388,"column":18},"end":{"line":388,"column":24}},"126":{"start":{"line":394,"column":12},"end":{"line":397,"column":13}},"127":{"start":{"line":395,"column":14},"end":{"line":395,"column":52}},"128":{"start":{"line":396,"column":14},"end":{"line":396,"column":61}},"129":{"start":{"line":399,"column":12},"end":{"line":399,"column":48}},"130":{"start":{"line":400,"column":12},"end":{"line":400,"column":35}},"131":{"start":{"line":401,"column":12},"end":{"line":401,"column":40}},"132":{"start":{"line":402,"column":12},"end":{"line":402,"column":45}},"133":{"start":{"line":403,"column":12},"end":{"line":403,"column":55}},"134":{"start":{"line":507,"column":19},"end":{"line":507,"column":49}},"135":{"start":{"line":526,"column":19},"end":{"line":526,"column":166}},"136":{"start":{"line":562,"column":19},"end":{"line":562,"column":38}},"137":{"start":{"line":563,"column":19},"end":{"line":565,"column":28}},"138":{"start":{"line":564,"column":23},"end":{"line":564,"column":60}},"139":{"start":{"line":567,"column":19},"end":{"line":567,"column":30}},"140":{"start":{"line":652,"column":4},"end":{"line":652,"column":28}},"141":{"start":{"line":653,"column":4},"end":{"line":653,"column":37}}},"branchMap":{"1":{"line":96,"type":"if","locations":[{"start":{"line":96,"column":11},"end":{"line":96,"column":11}},{"start":{"line":96,"column":11},"end":{"line":96,"column":11}}]},"2":{"line":100,"type":"if","locations":[{"start":{"line":100,"column":16},"end":{"line":100,"column":16}},{"start":{"line":100,"column":16},"end":{"line":100,"column":16}}]},"3":{"line":102,"type":"binary-expr","locations":[{"start":{"line":102,"column":26},"end":{"line":102,"column":52}},{"start":{"line":102,"column":56},"end":{"line":102,"column":57}}]},"4":{"line":103,"type":"if","locations":[{"start":{"line":103,"column":12},"end":{"line":103,"column":12}},{"start":{"line":103,"column":12},"end":{"line":103,"column":12}}]},"5":{"line":109,"type":"if","locations":[{"start":{"line":109,"column":16},"end":{"line":109,"column":16}},{"start":{"line":109,"column":16},"end":{"line":109,"column":16}}]},"6":{"line":111,"type":"binary-expr","locations":[{"start":{"line":111,"column":26},"end":{"line":111,"column":52}},{"start":{"line":111,"column":56},"end":{"line":111,"column":57}}]},"7":{"line":112,"type":"if","locations":[{"start":{"line":112,"column":12},"end":{"line":112,"column":12}},{"start":{"line":112,"column":12},"end":{"line":112,"column":12}}]},"8":{"line":129,"type":"if","locations":[{"start":{"line":129,"column":10},"end":{"line":129,"column":10}},{"start":{"line":129,"column":10},"end":{"line":129,"column":10}}]},"9":{"line":133,"type":"cond-expr","locations":[{"start":{"line":133,"column":68},"end":{"line":133,"column":86}},{"start":{"line":133,"column":89},"end":{"line":133,"column":99}}]},"10":{"line":170,"type":"if","locations":[{"start":{"line":170,"column":10},"end":{"line":170,"column":10}},{"start":{"line":170,"column":10},"end":{"line":170,"column":10}}]},"11":{"line":202,"type":"if","locations":[{"start":{"line":202,"column":11},"end":{"line":202,"column":11}},{"start":{"line":202,"column":11},"end":{"line":202,"column":11}}]},"12":{"line":202,"type":"binary-expr","locations":[{"start":{"line":202,"column":15},"end":{"line":202,"column":42}},{"start":{"line":202,"column":46},"end":{"line":202,"column":92}}]},"13":{"line":224,"type":"if","locations":[{"start":{"line":224,"column":11},"end":{"line":224,"column":11}},{"start":{"line":224,"column":11},"end":{"line":224,"column":11}}]},"14":{"line":224,"type":"binary-expr","locations":[{"start":{"line":224,"column":15},"end":{"line":224,"column":44}},{"start":{"line":224,"column":48},"end":{"line":224,"column":73}}]},"15":{"line":295,"type":"binary-expr","locations":[{"start":{"line":295,"column":18},"end":{"line":295,"column":63}},{"start":{"line":295,"column":67},"end":{"line":295,"column":94}}]},"16":{"line":333,"type":"if","locations":[{"start":{"line":333,"column":12},"end":{"line":333,"column":12}},{"start":{"line":333,"column":12},"end":{"line":333,"column":12}}]},"17":{"line":375,"type":"if","locations":[{"start":{"line":375,"column":10},"end":{"line":375,"column":10}},{"start":{"line":375,"column":10},"end":{"line":375,"column":10}}]},"18":{"line":377,"type":"if","locations":[{"start":{"line":377,"column":12},"end":{"line":377,"column":12}},{"start":{"line":377,"column":12},"end":{"line":377,"column":12}}]},"19":{"line":380,"type":"if","locations":[{"start":{"line":380,"column":14},"end":{"line":380,"column":14}},{"start":{"line":380,"column":14},"end":{"line":380,"column":14}}]},"20":{"line":386,"type":"if","locations":[{"start":{"line":386,"column":16},"end":{"line":386,"column":16}},{"start":{"line":386,"column":16},"end":{"line":386,"column":16}}]},"21":{"line":507,"type":"binary-expr","locations":[{"start":{"line":507,"column":27},"end":{"line":507,"column":35}},{"start":{"line":507,"column":39},"end":{"line":507,"column":47}}]},"22":{"line":526,"type":"binary-expr","locations":[{"start":{"line":526,"column":27},"end":{"line":526,"column":57}},{"start":{"line":526,"column":61},"end":{"line":526,"column":87}},{"start":{"line":526,"column":91},"end":{"line":526,"column":125}},{"start":{"line":526,"column":129},"end":{"line":526,"column":164}}]}},"code":["(function () { FOO.add('uploader-queue', function (F, NAME) {","","","    /**","     * The class manages a queue of files that should be uploaded to the server.","     * It initializes the required number of uploads, tracks them as they progress,","     * and automatically advances to the next upload when a preceding one has completed.","     * @module uploader-queue","     */     ","","    var Lang = Y.Lang,","        Bind = Y.bind,","        Win = Y.config.win,","        queuedFiles,","        numberOfUploads,        ","        currentUploadedByteValues,","        currentFiles,","        totalBytesUploaded,","        totalBytes;","","    /**","     * This class manages a queue of files to be uploaded to the server.","     * @class Uploader.Queue","     * @extends Base","     * @constructor","     * @param {Object} config Configuration object","     */","    var UploaderQueue = function(o) {","        this.queuedFiles = [];","        this.uploadRetries = {};","        this.numberOfUploads = 0;","        this.currentUploadedByteValues = {};","        this.currentFiles = {};","        this.totalBytesUploaded = 0;","        this.totalBytes = 0;      ","  ","        UploaderQueue.superclass.constructor.apply(this, arguments);","    };","","","    Y.extend(UploaderQueue, Y.Base, {","","       /**","        * Stored value of the current queue state","        * @property _currentState","        * @type {String}","        * @protected","        * @default UploaderQueue.STOPPED","        */","        _currentState: UploaderQueue.STOPPED,","","       /**","        * Construction logic executed during UploaderQueue instantiation.","        *","        * @method initializer","        * @protected","        */","        initializer : function (cfg) {","","        },","","       /**","        * Handles and retransmits upload start event.","        * ","        * @method _uploadStartHandler","        * @param event The event dispatched during the upload process.","        * @private","        */","        _uploadStartHandler : function (event) {","           var updatedEvent = event;","           updatedEvent.file = event.target;","           updatedEvent.originEvent = event;","           ","           this.fire(\"uploadstart\", updatedEvent);          ","        },","","       /**","        * Handles and retransmits upload error event.","        * ","        * @method _uploadErrorHandler","        * @param event The event dispatched during the upload process.","        * @private","        */","        _uploadErrorHandler : function (event) {","           var errorAction = this.get(\"errorAction\");","           var updatedEvent = event;","           updatedEvent.file = event.target;","           updatedEvent.originEvent = event;","","           this.numberOfUploads-=1;","           delete this.currentFiles[event.target.get(\"id\")];","           this._detachFileEvents(event.target);","","           event.target.cancelUpload();","","           if (errorAction === UploaderQueue.STOP) {","             this.pauseUpload();","           }","","           else if (errorAction === UploaderQueue.RESTART_ASAP) {","            var fileid = event.target.get(\"id\"),","                retries = this.uploadRetries[fileid] || 0;","            if (retries < this.get(\"retryCount\")) {","               this.uploadRetries[fileid] = retries + 1;","               this.addToQueueTop(event.target);","            }","               this._startNextFile();","           }","           else if (errorAction === UploaderQueue.RESTART_AFTER) {","            var fileid = event.target.get(\"id\"),","                retries = this.uploadRetries[fileid] || 0;","            if (retries < this.get(\"retryCount\")) {","               this.uploadRetries[fileid] = retries + 1;","               this.addToQueueBottom(event.target);","            }","              this._startNextFile();","           }","","           this.fire(\"uploaderror\", updatedEvent);  ","        },","","       /**","        * Launches the upload of the next file in the queue.","        * ","        * @method _startNextFile","        * @private","        */","        _startNextFile : function () {","          if (this.queuedFiles.length > 0) {","            var currentFile = this.queuedFiles.shift(),","               fileId = currentFile.get(\"id\"),","               parameters = this.get(\"perFileParameters\"),","               fileParameters = parameters.hasOwnProperty(fileId) ? parameters[fileId] : parameters;","","               this.currentUploadedByteValues[fileId] = 0;","","               currentFile.on(\"uploadstart\", this._uploadStartHandler, this);","               currentFile.on(\"uploadprogress\", this._uploadProgressHandler, this);","               currentFile.on(\"uploadcomplete\", this._uploadCompleteHandler, this);","               currentFile.on(\"uploaderror\", this._uploadErrorHandler, this);","               currentFile.on(\"uploadcancel\", this._uploadCancelHandler, this);","","               currentFile.set(\"xhrHeaders\", this.get(\"uploadHeaders\"));","               currentFile.set(\"xhrWithCredentials\", this.get(\"withCredentials\"));","","               currentFile.startUpload(this.get(\"uploadURL\"), fileParameters, this.get(\"fileFieldName\"));","","               this._registerUpload(currentFile);","          }","        },","","       /**","        * Register a new upload process.","        * ","        * @method _registerUpload","        * @private","        */","        _registerUpload : function (file) {","          this.numberOfUploads += 1;","          this.currentFiles[file.get(\"id\")] = file;","        },","","       /**","        * Unregisters a new upload process.","        * ","        * @method _unregisterUpload","        * @private","        */","        _unregisterUpload : function (file) {","          if (this.numberOfUploads > 0) {","            this.numberOfUploads -=1;","          }","          delete this.currentFiles[file.get(\"id\")];","          delete this.uploadRetries[file.get(\"id\")];","","          this._detachFileEvents(file);","        },","","        _detachFileEvents : function (file) {","          file.detach(\"uploadstart\", this._uploadStartHandler);","          file.detach(\"uploadprogress\", this._uploadProgressHandler);","          file.detach(\"uploadcomplete\", this._uploadCompleteHandler);","          file.detach(\"uploaderror\", this._uploadErrorHandler);","          file.detach(\"uploadcancel\", this._uploadCancelHandler);","        },","","       /**","        * Handles and retransmits upload complete event.","        * ","        * @method _uploadCompleteHandler","        * @param event The event dispatched during the upload process.","        * @private","        */","        _uploadCompleteHandler : function (event) {","","           this._unregisterUpload(event.target);","","           this.totalBytesUploaded += event.target.get(\"size\");","           delete this.currentUploadedByteValues[event.target.get(\"id\")];","","","           if (this.queuedFiles.length > 0 && this._currentState === UploaderQueue.UPLOADING) {","               this._startNextFile();","           }","           ","           var updatedEvent = event;","           updatedEvent.file = event.target;","           updatedEvent.originEvent = event;","","           var uploadedTotal = this.totalBytesUploaded;","","           Y.each(this.currentUploadedByteValues, function (value) {","              uploadedTotal += value; ","           });","           ","           var percentLoaded = Math.min(100, Math.round(10000*uploadedTotal/this.totalBytes) / 100); ","           ","           this.fire(\"totaluploadprogress\", {bytesLoaded: uploadedTotal, ","                                             bytesTotal: this.totalBytes,","                                             percentLoaded: percentLoaded});","","           this.fire(\"uploadcomplete\", updatedEvent);","","           if (this.queuedFiles.length === 0 && this.numberOfUploads <= 0) {","               this.fire(\"alluploadscomplete\");","               this._currentState = UploaderQueue.STOPPED;","           }","","","        },","","       /**","        * Handles and retransmits upload cancel event.","        * ","        * @method _uploadCancelHandler","        * @param event The event dispatched during the upload process.","        * @private","        */","        _uploadCancelHandler : function (event) {","          ","          var updatedEvent = event;","          updatedEvent.originEvent = event;","          updatedEvent.file = event.target;","","          this.fire(\"uploadcacel\", updatedEvent);","        },","","","","       /**","        * Handles and retransmits upload progress event.","        * ","        * @method _uploadProgressHandler","        * @param event The event dispatched during the upload process.","        * @private","        */","        _uploadProgressHandler : function (event) {","          ","          this.currentUploadedByteValues[event.target.get(\"id\")] = event.bytesLoaded;","          ","          var updatedEvent = event;","          updatedEvent.originEvent = event;","          updatedEvent.file = event.target;","","          this.fire(\"uploadprogress\", updatedEvent);","          ","          var uploadedTotal = this.totalBytesUploaded;","","          Y.each(this.currentUploadedByteValues, function (value) {","             uploadedTotal += value; ","          });","          ","          var percentLoaded = Math.min(100, Math.round(10000*uploadedTotal/this.totalBytes) / 100);","","          this.fire(\"totaluploadprogress\", {bytesLoaded: uploadedTotal, ","                                            bytesTotal: this.totalBytes,","                                            percentLoaded: percentLoaded});","        },","","       /**","        * Starts uploading the queued up file list.","        * ","        * @method startUpload","        */","        startUpload: function() {","           ","           this.queuedFiles = this.get(\"fileList\").slice(0);","           this.numberOfUploads = 0;","           this.currentUploadedByteValues = {};","           this.currentFiles = {};","           this.totalBytesUploaded = 0;","           ","           this._currentState = UploaderQueue.UPLOADING;","","           while (this.numberOfUploads < this.get(\"simUploads\") && this.queuedFiles.length > 0) {","                this._startNextFile();","           }","        },","","       /**","        * Pauses the upload process. The ongoing file uploads","        * will complete after this method is called, but no","        * new ones will be launched.","        * ","        * @method pauseUpload","        */","        pauseUpload: function () {","            this._currentState = UploaderQueue.STOPPED;","        },","","       /**","        * Restarts a paused upload process.","        * ","        * @method restartUpload","        */","        restartUpload: function () {","            this._currentState = UploaderQueue.UPLOADING;","            while (this.numberOfUploads < this.get(\"simUploads\")) {","               this._startNextFile();","            }","        },","","       /**","        * If a particular file is stuck in an ongoing upload without","        * any progress events, this method allows to force its reupload","        * by cancelling its upload and immediately relaunching it.","        * ","        * @method forceReupload","        * @param file {Y.File} The file to force reupload on.","        */","        forceReupload : function (file) {","            var id = file.get(\"id\");","            if (this.currentFiles.hasOwnProperty(id)) {","              file.cancelUpload();","              this._unregisterUpload(file);","              this.addToQueueTop(file);","              this._startNextFile();","            }","        },","","       /**","        * Add a new file to the top of the queue (the upload will be","        * launched as soon as the current number of uploading files","        * drops below the maximum permissible value).","        * ","        * @method addToQueueTop","        * @param file {Y.File} The file to add to the top of the queue.","        */","        addToQueueTop: function (file) {","            this.queuedFiles.unshift(file);","        },","","       /**","        * Add a new file to the bottom of the queue (the upload will be","        * launched after all the other queued files are uploaded.)","        * ","        * @method addToQueueBottom","        * @param file {Y.File} The file to add to the bottom of the queue.","        */","        addToQueueBottom: function (file) {","            this.queuedFiles.push(file);","        },","","       /**","        * Cancels a specific file's upload. If no argument is passed,","        * all ongoing uploads are cancelled and the upload process is","        * stopped.","        * ","        * @method cancelUpload","        * @param file {Y.File} An optional parameter - the file whose upload","        * should be cancelled.","        */","        cancelUpload: function (file) {","","          if (file) {","            var id = file.get(\"id\");","            if (this.currentFiles[id]) {","              this.currentFiles[id].cancelUpload();","              this._unregisterUpload(this.currentFiles[id]);","              if (this._currentState === UploaderQueue.UPLOADING) {","                this._startNextFile();","              }","            }","            else {","              for (var i = 0, len = this.queuedFiles.length; i < len; i++) {","                if (this.queuedFiles[i].get(\"id\") === id) {","                  this.queuedFiles.splice(i, 1);","                  break;","                }","              }","            }","          }","          else {","            for (var fid in this.currentFiles) {","              this.currentFiles[fid].cancelUpload();","              this._unregisterUpload(this.currentFiles[fid]);","            }","","            this.currentUploadedByteValues = {};","            this.currentFiles = {};","            this.totalBytesUploaded = 0;","            this.fire(\"alluploadscancelled\");","            this._currentState = UploaderQueue.STOPPED;","          }","        }","    }, ","","    {","      /** ","       * Static constant for the value of the `errorAction` attribute:","       * prescribes the queue to continue uploading files in case of ","       * an error.","       * @property CONTINUE","       * @readOnly","       * @type {String}","       * @static","       */","        CONTINUE: \"continue\",","","      /** ","       * Static constant for the value of the `errorAction` attribute:","       * prescribes the queue to stop uploading files in case of ","       * an error.","       * @property STOP","       * @readOnly","       * @type {String}","       * @static","       */","        STOP: \"stop\",","","      /** ","       * Static constant for the value of the `errorAction` attribute:","       * prescribes the queue to restart a file upload immediately in case of ","       * an error.","       * @property RESTART_ASAP","       * @readOnly","       * @type {String}","       * @static","       */","        RESTART_ASAP: \"restartasap\",","","      /** ","       * Static constant for the value of the `errorAction` attribute:","       * prescribes the queue to restart an errored out file upload after ","       * other files have finished uploading.","       * @property RESTART_AFTER","       * @readOnly","       * @type {String}","       * @static","       */","        RESTART_AFTER: \"restartafter\",","","      /** ","       * Static constant for the value of the `_currentState` property:","       * implies that the queue is currently not uploading files.","       * @property STOPPED","       * @readOnly","       * @type {String}","       * @static","       */","        STOPPED: \"stopped\",","","      /** ","       * Static constant for the value of the `_currentState` property:","       * implies that the queue is currently uploading files.","       * @property UPLOADING","       * @readOnly","       * @type {String}","       * @static","       */","        UPLOADING: \"uploading\",","","       /**","        * The identity of the class.","        *","        * @property NAME","        * @type String","        * @default 'uploaderqueue'","        * @readOnly","        * @protected","        * @static","        */","        NAME: 'uploaderqueue',","","       /**","        * Static property used to define the default attribute configuration of","        * the class.","        *","        * @property ATTRS","        * @type {Object}","        * @protected","        * @static","        */","        ATTRS: {","       ","          /**","           * Maximum number of simultaneous uploads; must be in the","           * range between 1 and 5. The value of `2` is default. It","           * is recommended that this value does not exceed 3.","           * @property simUploads","           * @type Number","           * @default 2","           */","           simUploads: {","               value: 2,","               validator: function (val, name) {","                   return (val >= 1 && val <= 5);","               }","           },","   ","          /**","           * The action to take in case of error. The valid values for this attribute are: ","           * `Y.Uploader.Queue.CONTINUE` (the upload process should continue on other files, ","           * ignoring the error), `Y.Uploader.Queue.STOP` (the upload process ","           * should stop completely), `Y.Uploader.Queue.RESTART_ASAP` (the upload ","           * should restart immediately on the errored out file and continue as planned), or","           * Y.Uploader.Queue.RESTART_AFTER (the upload of the errored out file should restart","           * after all other files have uploaded)","           * @property errorAction","           * @type String","           * @default Y.Uploader.Queue.CONTINUE","           */","           errorAction: {","               value: \"continue\",","               validator: function (val, name) {","                   return (val === UploaderQueue.CONTINUE || val === UploaderQueue.STOP || val === UploaderQueue.RESTART_ASAP || val === UploaderQueue.RESTART_AFTER);","               }","           },","","          /**","           * The total number of bytes that has been uploaded.","           * @property bytesUploaded","           * @type Number","           */   ","           bytesUploaded: {","               readOnly: true,","               value: 0","           },","   ","          /**","           * The total number of bytes in the queue.","           * @property bytesTotal","           * @type Number","           */ ","           bytesTotal: {","               readOnly: true,","               value: 0","           },","","          /**","           * The queue file list. This file list should only be modified","           * before the upload has been started; modifying it after starting","           * the upload has no effect, and `addToQueueTop` or `addToQueueBottom` methods","           * should be used instead.","           * @property fileList","           * @type Number","           */    ","           fileList: {","               value: [],","               lazyAdd: false,","               setter: function (val) {","                   var newValue = val;","                   Y.Array.each(newValue, function (value) {","                       this.totalBytes += value.get(\"size\");","                   }, this);","    ","                   return val;","               }   ","           },","","          /**","           * A String specifying what should be the POST field name for the file","           * content in the upload request.","           *","           * @attribute fileFieldName","           * @type {String}","           * @default Filedata","           */   ","           fileFieldName: {","              value: \"Filedata\"","           },","","          /**","           * The URL to POST the file upload requests to.","           *","           * @attribute uploadURL","           * @type {String}","           * @default \"\"","           */  ","           uploadURL: {","             value: \"\"","           },","","          /**","           * Additional HTTP headers that should be included","           * in the upload request. Due to Flash Player security","           * restrictions, this attribute is only honored in the","           * HTML5 Uploader.","           *","           * @attribute uploadHeaders","           * @type {Object}","           * @default {}","           */  ","           uploadHeaders: {","             value: {}","           },","","          /**","           * A Boolean that specifies whether the file should be","           * uploaded with the appropriate user credentials for the","           * domain. Due to Flash Player security restrictions, this","           * attribute is only honored in the HTML5 Uploader.","           *","           * @attribute withCredentials","           * @type {Boolean}","           * @default true","           */  ","           withCredentials: {","             value: true","           },","","","          /**","           * An object, keyed by `fileId`, containing sets of key-value pairs","           * that should be passed as POST variables along with each corresponding","           * file.","           *","           * @attribute perFileParameters","           * @type {Object}","           * @default {}","           */   ","           perFileParameters: {","             value: {}","           },","","          /**","           * The number of times to try re-uploading a file that failed to upload before","           * cancelling its upload.","           *","           * @attribute retryCount","           * @type {Number}","           * @default 3","           */ ","           retryCount: {","             value: 3","           }","","        }","    });","","","    Y.namespace('Uploader');","    Y.Uploader.Queue = UploaderQueue;","","}, '@VERSION@', {\"requires\": [\"base\"]});","","}());"]};
}
var __cov_ysLsk6pQukBrKo7OzSUJoQ = __coverage__['build/uploader-queue/uploader-queue.js'];
__cov_ysLsk6pQukBrKo7OzSUJoQ.s['1']++;FOO.add('uploader-queue',function(F,NAME){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['1']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['2']++;var Lang=Y.Lang,Bind=Y.bind,Win=Y.config.win,queuedFiles,numberOfUploads,currentUploadedByteValues,currentFiles,totalBytesUploaded,totalBytes;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['3']++;var UploaderQueue=function(o){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['2']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['4']++;this.queuedFiles=[];__cov_ysLsk6pQukBrKo7OzSUJoQ.s['5']++;this.uploadRetries={};__cov_ysLsk6pQukBrKo7OzSUJoQ.s['6']++;this.numberOfUploads=0;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['7']++;this.currentUploadedByteValues={};__cov_ysLsk6pQukBrKo7OzSUJoQ.s['8']++;this.currentFiles={};__cov_ysLsk6pQukBrKo7OzSUJoQ.s['9']++;this.totalBytesUploaded=0;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['10']++;this.totalBytes=0;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['11']++;UploaderQueue.superclass.constructor.apply(this,arguments);};__cov_ysLsk6pQukBrKo7OzSUJoQ.s['12']++;Y.extend(UploaderQueue,Y.Base,{_currentState:UploaderQueue.STOPPED,initializer:function(cfg){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['3']++;},_uploadStartHandler:function(event){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['4']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['13']++;var updatedEvent=event;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['14']++;updatedEvent.file=event.target;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['15']++;updatedEvent.originEvent=event;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['16']++;this.fire('uploadstart',updatedEvent);},_uploadErrorHandler:function(event){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['5']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['17']++;var errorAction=this.get('errorAction');__cov_ysLsk6pQukBrKo7OzSUJoQ.s['18']++;var updatedEvent=event;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['19']++;updatedEvent.file=event.target;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['20']++;updatedEvent.originEvent=event;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['21']++;this.numberOfUploads-=1;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['22']++;delete this.currentFiles[event.target.get('id')];__cov_ysLsk6pQukBrKo7OzSUJoQ.s['23']++;this._detachFileEvents(event.target);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['24']++;event.target.cancelUpload();__cov_ysLsk6pQukBrKo7OzSUJoQ.s['25']++;if(errorAction===UploaderQueue.STOP){__cov_ysLsk6pQukBrKo7OzSUJoQ.b['1'][0]++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['26']++;this.pauseUpload();}else{__cov_ysLsk6pQukBrKo7OzSUJoQ.b['1'][1]++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['27']++;if(errorAction===UploaderQueue.RESTART_ASAP){__cov_ysLsk6pQukBrKo7OzSUJoQ.b['2'][0]++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['28']++;var fileid=event.target.get('id'),retries=(__cov_ysLsk6pQukBrKo7OzSUJoQ.b['3'][0]++,this.uploadRetries[fileid])||(__cov_ysLsk6pQukBrKo7OzSUJoQ.b['3'][1]++,0);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['29']++;if(retries<this.get('retryCount')){__cov_ysLsk6pQukBrKo7OzSUJoQ.b['4'][0]++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['30']++;this.uploadRetries[fileid]=retries+1;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['31']++;this.addToQueueTop(event.target);}else{__cov_ysLsk6pQukBrKo7OzSUJoQ.b['4'][1]++;}__cov_ysLsk6pQukBrKo7OzSUJoQ.s['32']++;this._startNextFile();}else{__cov_ysLsk6pQukBrKo7OzSUJoQ.b['2'][1]++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['33']++;if(errorAction===UploaderQueue.RESTART_AFTER){__cov_ysLsk6pQukBrKo7OzSUJoQ.b['5'][0]++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['34']++;var fileid=event.target.get('id'),retries=(__cov_ysLsk6pQukBrKo7OzSUJoQ.b['6'][0]++,this.uploadRetries[fileid])||(__cov_ysLsk6pQukBrKo7OzSUJoQ.b['6'][1]++,0);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['35']++;if(retries<this.get('retryCount')){__cov_ysLsk6pQukBrKo7OzSUJoQ.b['7'][0]++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['36']++;this.uploadRetries[fileid]=retries+1;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['37']++;this.addToQueueBottom(event.target);}else{__cov_ysLsk6pQukBrKo7OzSUJoQ.b['7'][1]++;}__cov_ysLsk6pQukBrKo7OzSUJoQ.s['38']++;this._startNextFile();}else{__cov_ysLsk6pQukBrKo7OzSUJoQ.b['5'][1]++;}}}__cov_ysLsk6pQukBrKo7OzSUJoQ.s['39']++;this.fire('uploaderror',updatedEvent);},_startNextFile:function(){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['6']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['40']++;if(this.queuedFiles.length>0){__cov_ysLsk6pQukBrKo7OzSUJoQ.b['8'][0]++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['41']++;var currentFile=this.queuedFiles.shift(),fileId=currentFile.get('id'),parameters=this.get('perFileParameters'),fileParameters=parameters.hasOwnProperty(fileId)?(__cov_ysLsk6pQukBrKo7OzSUJoQ.b['9'][0]++,parameters[fileId]):(__cov_ysLsk6pQukBrKo7OzSUJoQ.b['9'][1]++,parameters);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['42']++;this.currentUploadedByteValues[fileId]=0;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['43']++;currentFile.on('uploadstart',this._uploadStartHandler,this);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['44']++;currentFile.on('uploadprogress',this._uploadProgressHandler,this);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['45']++;currentFile.on('uploadcomplete',this._uploadCompleteHandler,this);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['46']++;currentFile.on('uploaderror',this._uploadErrorHandler,this);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['47']++;currentFile.on('uploadcancel',this._uploadCancelHandler,this);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['48']++;currentFile.set('xhrHeaders',this.get('uploadHeaders'));__cov_ysLsk6pQukBrKo7OzSUJoQ.s['49']++;currentFile.set('xhrWithCredentials',this.get('withCredentials'));__cov_ysLsk6pQukBrKo7OzSUJoQ.s['50']++;currentFile.startUpload(this.get('uploadURL'),fileParameters,this.get('fileFieldName'));__cov_ysLsk6pQukBrKo7OzSUJoQ.s['51']++;this._registerUpload(currentFile);}else{__cov_ysLsk6pQukBrKo7OzSUJoQ.b['8'][1]++;}},_registerUpload:function(file){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['7']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['52']++;this.numberOfUploads+=1;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['53']++;this.currentFiles[file.get('id')]=file;},_unregisterUpload:function(file){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['8']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['54']++;if(this.numberOfUploads>0){__cov_ysLsk6pQukBrKo7OzSUJoQ.b['10'][0]++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['55']++;this.numberOfUploads-=1;}else{__cov_ysLsk6pQukBrKo7OzSUJoQ.b['10'][1]++;}__cov_ysLsk6pQukBrKo7OzSUJoQ.s['56']++;delete this.currentFiles[file.get('id')];__cov_ysLsk6pQukBrKo7OzSUJoQ.s['57']++;delete this.uploadRetries[file.get('id')];__cov_ysLsk6pQukBrKo7OzSUJoQ.s['58']++;this._detachFileEvents(file);},_detachFileEvents:function(file){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['9']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['59']++;file.detach('uploadstart',this._uploadStartHandler);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['60']++;file.detach('uploadprogress',this._uploadProgressHandler);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['61']++;file.detach('uploadcomplete',this._uploadCompleteHandler);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['62']++;file.detach('uploaderror',this._uploadErrorHandler);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['63']++;file.detach('uploadcancel',this._uploadCancelHandler);},_uploadCompleteHandler:function(event){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['10']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['64']++;this._unregisterUpload(event.target);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['65']++;this.totalBytesUploaded+=event.target.get('size');__cov_ysLsk6pQukBrKo7OzSUJoQ.s['66']++;delete this.currentUploadedByteValues[event.target.get('id')];__cov_ysLsk6pQukBrKo7OzSUJoQ.s['67']++;if((__cov_ysLsk6pQukBrKo7OzSUJoQ.b['12'][0]++,this.queuedFiles.length>0)&&(__cov_ysLsk6pQukBrKo7OzSUJoQ.b['12'][1]++,this._currentState===UploaderQueue.UPLOADING)){__cov_ysLsk6pQukBrKo7OzSUJoQ.b['11'][0]++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['68']++;this._startNextFile();}else{__cov_ysLsk6pQukBrKo7OzSUJoQ.b['11'][1]++;}__cov_ysLsk6pQukBrKo7OzSUJoQ.s['69']++;var updatedEvent=event;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['70']++;updatedEvent.file=event.target;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['71']++;updatedEvent.originEvent=event;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['72']++;var uploadedTotal=this.totalBytesUploaded;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['73']++;Y.each(this.currentUploadedByteValues,function(value){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['11']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['74']++;uploadedTotal+=value;});__cov_ysLsk6pQukBrKo7OzSUJoQ.s['75']++;var percentLoaded=Math.min(100,Math.round(10000*uploadedTotal/this.totalBytes)/100);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['76']++;this.fire('totaluploadprogress',{bytesLoaded:uploadedTotal,bytesTotal:this.totalBytes,percentLoaded:percentLoaded});__cov_ysLsk6pQukBrKo7OzSUJoQ.s['77']++;this.fire('uploadcomplete',updatedEvent);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['78']++;if((__cov_ysLsk6pQukBrKo7OzSUJoQ.b['14'][0]++,this.queuedFiles.length===0)&&(__cov_ysLsk6pQukBrKo7OzSUJoQ.b['14'][1]++,this.numberOfUploads<=0)){__cov_ysLsk6pQukBrKo7OzSUJoQ.b['13'][0]++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['79']++;this.fire('alluploadscomplete');__cov_ysLsk6pQukBrKo7OzSUJoQ.s['80']++;this._currentState=UploaderQueue.STOPPED;}else{__cov_ysLsk6pQukBrKo7OzSUJoQ.b['13'][1]++;}},_uploadCancelHandler:function(event){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['12']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['81']++;var updatedEvent=event;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['82']++;updatedEvent.originEvent=event;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['83']++;updatedEvent.file=event.target;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['84']++;this.fire('uploadcacel',updatedEvent);},_uploadProgressHandler:function(event){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['13']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['85']++;this.currentUploadedByteValues[event.target.get('id')]=event.bytesLoaded;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['86']++;var updatedEvent=event;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['87']++;updatedEvent.originEvent=event;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['88']++;updatedEvent.file=event.target;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['89']++;this.fire('uploadprogress',updatedEvent);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['90']++;var uploadedTotal=this.totalBytesUploaded;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['91']++;Y.each(this.currentUploadedByteValues,function(value){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['14']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['92']++;uploadedTotal+=value;});__cov_ysLsk6pQukBrKo7OzSUJoQ.s['93']++;var percentLoaded=Math.min(100,Math.round(10000*uploadedTotal/this.totalBytes)/100);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['94']++;this.fire('totaluploadprogress',{bytesLoaded:uploadedTotal,bytesTotal:this.totalBytes,percentLoaded:percentLoaded});},startUpload:function(){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['15']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['95']++;this.queuedFiles=this.get('fileList').slice(0);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['96']++;this.numberOfUploads=0;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['97']++;this.currentUploadedByteValues={};__cov_ysLsk6pQukBrKo7OzSUJoQ.s['98']++;this.currentFiles={};__cov_ysLsk6pQukBrKo7OzSUJoQ.s['99']++;this.totalBytesUploaded=0;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['100']++;this._currentState=UploaderQueue.UPLOADING;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['101']++;while((__cov_ysLsk6pQukBrKo7OzSUJoQ.b['15'][0]++,this.numberOfUploads<this.get('simUploads'))&&(__cov_ysLsk6pQukBrKo7OzSUJoQ.b['15'][1]++,this.queuedFiles.length>0)){__cov_ysLsk6pQukBrKo7OzSUJoQ.s['102']++;this._startNextFile();}},pauseUpload:function(){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['16']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['103']++;this._currentState=UploaderQueue.STOPPED;},restartUpload:function(){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['17']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['104']++;this._currentState=UploaderQueue.UPLOADING;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['105']++;while(this.numberOfUploads<this.get('simUploads')){__cov_ysLsk6pQukBrKo7OzSUJoQ.s['106']++;this._startNextFile();}},forceReupload:function(file){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['18']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['107']++;var id=file.get('id');__cov_ysLsk6pQukBrKo7OzSUJoQ.s['108']++;if(this.currentFiles.hasOwnProperty(id)){__cov_ysLsk6pQukBrKo7OzSUJoQ.b['16'][0]++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['109']++;file.cancelUpload();__cov_ysLsk6pQukBrKo7OzSUJoQ.s['110']++;this._unregisterUpload(file);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['111']++;this.addToQueueTop(file);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['112']++;this._startNextFile();}else{__cov_ysLsk6pQukBrKo7OzSUJoQ.b['16'][1]++;}},addToQueueTop:function(file){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['19']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['113']++;this.queuedFiles.unshift(file);},addToQueueBottom:function(file){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['20']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['114']++;this.queuedFiles.push(file);},cancelUpload:function(file){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['21']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['115']++;if(file){__cov_ysLsk6pQukBrKo7OzSUJoQ.b['17'][0]++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['116']++;var id=file.get('id');__cov_ysLsk6pQukBrKo7OzSUJoQ.s['117']++;if(this.currentFiles[id]){__cov_ysLsk6pQukBrKo7OzSUJoQ.b['18'][0]++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['118']++;this.currentFiles[id].cancelUpload();__cov_ysLsk6pQukBrKo7OzSUJoQ.s['119']++;this._unregisterUpload(this.currentFiles[id]);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['120']++;if(this._currentState===UploaderQueue.UPLOADING){__cov_ysLsk6pQukBrKo7OzSUJoQ.b['19'][0]++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['121']++;this._startNextFile();}else{__cov_ysLsk6pQukBrKo7OzSUJoQ.b['19'][1]++;}}else{__cov_ysLsk6pQukBrKo7OzSUJoQ.b['18'][1]++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['122']++;for(var i=0,len=this.queuedFiles.length;i<len;i++){__cov_ysLsk6pQukBrKo7OzSUJoQ.s['123']++;if(this.queuedFiles[i].get('id')===id){__cov_ysLsk6pQukBrKo7OzSUJoQ.b['20'][0]++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['124']++;this.queuedFiles.splice(i,1);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['125']++;break;}else{__cov_ysLsk6pQukBrKo7OzSUJoQ.b['20'][1]++;}}}}else{__cov_ysLsk6pQukBrKo7OzSUJoQ.b['17'][1]++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['126']++;for(var fid in this.currentFiles){__cov_ysLsk6pQukBrKo7OzSUJoQ.s['127']++;this.currentFiles[fid].cancelUpload();__cov_ysLsk6pQukBrKo7OzSUJoQ.s['128']++;this._unregisterUpload(this.currentFiles[fid]);}__cov_ysLsk6pQukBrKo7OzSUJoQ.s['129']++;this.currentUploadedByteValues={};__cov_ysLsk6pQukBrKo7OzSUJoQ.s['130']++;this.currentFiles={};__cov_ysLsk6pQukBrKo7OzSUJoQ.s['131']++;this.totalBytesUploaded=0;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['132']++;this.fire('alluploadscancelled');__cov_ysLsk6pQukBrKo7OzSUJoQ.s['133']++;this._currentState=UploaderQueue.STOPPED;}}},{CONTINUE:'continue',STOP:'stop',RESTART_ASAP:'restartasap',RESTART_AFTER:'restartafter',STOPPED:'stopped',UPLOADING:'uploading',NAME:'uploaderqueue',ATTRS:{simUploads:{value:2,validator:function(val,name){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['22']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['134']++;return(__cov_ysLsk6pQukBrKo7OzSUJoQ.b['21'][0]++,val>=1)&&(__cov_ysLsk6pQukBrKo7OzSUJoQ.b['21'][1]++,val<=5);}},errorAction:{value:'continue',validator:function(val,name){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['23']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['135']++;return(__cov_ysLsk6pQukBrKo7OzSUJoQ.b['22'][0]++,val===UploaderQueue.CONTINUE)||(__cov_ysLsk6pQukBrKo7OzSUJoQ.b['22'][1]++,val===UploaderQueue.STOP)||(__cov_ysLsk6pQukBrKo7OzSUJoQ.b['22'][2]++,val===UploaderQueue.RESTART_ASAP)||(__cov_ysLsk6pQukBrKo7OzSUJoQ.b['22'][3]++,val===UploaderQueue.RESTART_AFTER);}},bytesUploaded:{readOnly:true,value:0},bytesTotal:{readOnly:true,value:0},fileList:{value:[],lazyAdd:false,setter:function(val){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['24']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['136']++;var newValue=val;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['137']++;Y.Array.each(newValue,function(value){__cov_ysLsk6pQukBrKo7OzSUJoQ.f['25']++;__cov_ysLsk6pQukBrKo7OzSUJoQ.s['138']++;this.totalBytes+=value.get('size');},this);__cov_ysLsk6pQukBrKo7OzSUJoQ.s['139']++;return val;}},fileFieldName:{value:'Filedata'},uploadURL:{value:''},uploadHeaders:{value:{}},withCredentials:{value:true},perFileParameters:{value:{}},retryCount:{value:3}}});__cov_ysLsk6pQukBrKo7OzSUJoQ.s['140']++;Y.namespace('Uploader');__cov_ysLsk6pQukBrKo7OzSUJoQ.s['141']++;Y.Uploader.Queue=UploaderQueue;},'@VERSION@',{'requires':['base']});
