YUI.add("file-flash",function(t,e){var a=function(e){a.superclass.constructor.apply(this,arguments)};t.extend(a,t.Base,{initializer:function(e){this.get("id")||this._set("id",t.guid("file"))},_swfEventHandler:function(e){if(e.id===this.get("id"))switch(e.type){case"uploadstart":this.fire("uploadstart",{uploader:this.get("uploader")});break;case"uploadprogress":this.fire("uploadprogress",{originEvent:e,bytesLoaded:e.bytesLoaded,bytesTotal:e.bytesTotal,percentLoaded:Math.min(100,Math.round(1e4*e.bytesLoaded/e.bytesTotal)/100)}),this._set("bytesUploaded",e.bytesLoaded);break;case"uploadcomplete":this.fire("uploadfinished",{originEvent:e});break;case"uploadcompletedata":this.fire("uploadcomplete",{originEvent:e,data:e.data});break;case"uploadcancel":this.fire("uploadcancel",{originEvent:e});break;case"uploaderror":this.fire("uploaderror",{originEvent:e,status:e.status,statusText:e.message,source:e.source})}},startUpload:function(e,t,a){var i,l;this.get("uploader")&&(i=this.get("uploader"),a=a||"Filedata",l=this.get("id"),t=t||null,this._set("bytesUploaded",0),i.on("uploadstart",this._swfEventHandler,this),i.on("uploadprogress",this._swfEventHandler,this),i.on("uploadcomplete",this._swfEventHandler,this),i.on("uploadcompletedata",this._swfEventHandler,this),i.on("uploaderror",this._swfEventHandler,this),i.callSWF("upload",[l,e,t,a]))},cancelUpload:function(){this.get("uploader")&&(this.get("uploader").callSWF("cancel",[this.get("id")]),this.fire("uploadcancel"))}},{NAME:"file",TYPE:"flash",ATTRS:{id:{writeOnce:"initOnly",value:null},size:{writeOnce:"initOnly",value:0},name:{writeOnce:"initOnly",value:null},dateCreated:{writeOnce:"initOnly",value:null},dateModified:{writeOnce:"initOnly",value:null},bytesUploaded:{readOnly:!0,value:0},type:{writeOnce:"initOnly",value:null},uploader:{writeOnce:"initOnly",value:null}}}),t.FileFlash=a},"patched-v3.18.4",{requires:["base"]});