1 line
853 KiB
XML
1 line
853 KiB
XML
{"version":3,"sources":["webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/cancel/Cancel.js","webpack:///./node_modules/cos-js-sdk-v5/src/util.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/utils.js","webpack:///./node_modules/vod-js-sdk-v6/lib/src/tc_vod.js","webpack:///./node_modules/cos-js-sdk-v5/src/event.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/core/settle.js","webpack:///./node_modules/cos-js-sdk-v5/src/session.js","webpack:///./node_modules/cos-js-sdk-v5/lib/xml2json.js","webpack:///./src/components/NavBottom.vue","webpack:///./src/components/NavBottom.vue?941b","webpack:///./src/components/NavBottom.vue?fb04","webpack:///./node_modules/core-js/internals/string-repeat.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/cancel/isCancel.js","webpack:///./node_modules/cos-js-sdk-v5/src/cos.js","webpack:///./node_modules/cos-js-sdk-v5/src/advance.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/axios.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/defaults.js","webpack:///./node_modules/uuid/lib/bytesToUuid.js","webpack:///./node_modules/xmldom/dom-parser.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/core/createError.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/helpers/cookies.js","webpack:///./node_modules/cos-js-sdk-v5/index.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/helpers/normalizeHeaderName.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/cancel/CancelToken.js","webpack:///(webpack)/buildin/amd-options.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/is-buffer/index.js","webpack:///./node_modules/core-js/internals/this-number-value.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/helpers/buildURL.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/helpers/isURLSameOrigin.js","webpack:///./src/utils/vod.ts","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/core/transformData.js","webpack:///./node_modules/vod-js-sdk-v6/lib/src/vod_reporter.js","webpack:///./node_modules/js-sha1/src/sha1.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/helpers/isAbsoluteURL.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/helpers/bind.js","webpack:///./node_modules/xmldom/dom.js","webpack:///./node_modules/cos-js-sdk-v5/lib/md5.js","webpack:///./node_modules/cos-js-sdk-v5/src/base.js","webpack:///./node_modules/cos-js-sdk-v5/lib/json2xml.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/core/enhanceError.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/core/dispatchRequest.js","webpack:///./node_modules/cos-js-sdk-v5/src/async.js","webpack:///./src/components/NavBottom.vue?4087","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/helpers/spread.js","webpack:///./node_modules/@ant-design/icons-svg/es/asn/PlaySquareOutlined.js","webpack:///./node_modules/@ant-design/icons-vue/es/icons/PlaySquareOutlined.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/index.js","webpack:///./node_modules/cos-js-sdk-v5/lib/request.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/adapters/xhr.js","webpack:///./node_modules/vod-js-sdk-v6/lib/src/uploader.js","webpack:///./node_modules/@ant-design/icons-vue/es/insert-css.js","webpack:///./node_modules/@ant-design/icons-vue/es/utils.js","webpack:///./node_modules/@ant-design/icons-vue/es/components/IconBase.js","webpack:///./node_modules/@ant-design/icons-vue/es/components/twoTonePrimaryColor.js","webpack:///./node_modules/@ant-design/icons-vue/es/components/AntdIcon.js","webpack:///./node_modules/core-js/modules/es.number.to-fixed.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/core/InterceptorManager.js","webpack:///./node_modules/uuid/v4.js","webpack:///./node_modules/vod-js-sdk-v6/lib/src/util.js","webpack:///./node_modules/xmldom/sax.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/core/Axios.js","webpack:///./node_modules/cos-js-sdk-v5/lib/crypto.js","webpack:///./node_modules/uuid/lib/rng-browser.js","webpack:///./node_modules/cos-js-sdk-v5/src/task.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/helpers/parseHeaders.js","webpack:///./node_modules/vod-js-sdk-v6/node_modules/axios/lib/helpers/combineURLs.js","webpack:///./node_modules/events/events.js"],"names":["Cancel","message","this","prototype","toString","__CANCEL__","module","exports","md5","CryptoJS","xml2json","json2xml","camSafeUrlEncode","str","encodeURIComponent","replace","getAuth","opt","pathname","SecretId","SecretKey","KeyTime","method","Method","toLowerCase","queryParams","clone","Query","params","headers","Headers","Key","UseRawKey","Pathname","indexOf","console","error","getObjectKeys","obj","list","key","hasOwnProperty","push","sort","a","b","obj2str","i","val","keyList","length","undefined","join","now","Math","round","getSkewTime","SystemClockOffset","exp","Expires","expires","qSignAlgorithm","qAk","qSignTime","qKeyTime","qHeaderList","qUrlParamList","signKey","HmacSHA1","formatString","stringToSign","SHA1","qSignature","authorization","noop","clearKey","retObj","readAsBinaryString","blob","callback","readFun","fr","FileReader","onload","result","readAsArrayBuffer","fileData","binary","reader","e","bytes","Uint8Array","byteLength","String","fromCharCode","call","fileSliceNeedCopy","compareVersion","split","parseInt","check","ua","ChromeVersion","match","QBCoreVersion","QQBrowserVersion","need","navigator","userAgent","fileSlice","file","start","end","isUseToUpload","slice","mozSlice","webkitSlice","Blob","getBodyMd5","UploadCheckContentMd5","Body","onProgress","util","getFileMd5","err","md5ChunkSize","size","loaded","md5ctx","getCtx","next","hash","digest","min","chunk","content","update","total","percent","map","v","extend","target","source","each","isArray","arr","Array","isInArray","item","flag","makeArray","fn","o","filter","iaArr","binaryBase64","len","char","res","btoa","uuid","S4","random","substring","hasMissingParams","apiName","Bucket","Region","formatParams","headerMap","paramKey","headerKey","apiWrapper","apiFn","formatResult","VersionId","DeleteMarker","_callback","data","missingResult","test","options","CompatibilityMode","warn","AppId","substr","throttleOnProgress","time1","timer","self","size0","size1","time0","Date","speed","max","info","immediately","clearTimeout","setTimeout","ProgressInterval","getFileSize","api","type","ContentLength","offset","isBrowser","bind","isBuffer","Object","isArrayBuffer","isFormData","FormData","isArrayBufferView","ArrayBuffer","isView","buffer","isString","isNumber","isUndefined","isObject","isDate","isFile","isBlob","isFunction","isStream","pipe","isURLSearchParams","URLSearchParams","trim","isStandardBrowserEnv","product","window","document","forEach","l","merge","assignValue","arguments","thisArg","__assign","assign","t","s","n","p","apply","defineProperty","value","uploader_1","vod_reporter_1","TcVod","allowReport","enableResume","getSignature","appId","reportId","upload","uploaderParams","uploader","default","initReporter","VodReporter","initEvent","cos","listeners","getList","action","on","off","splice","emit","cb","EventProxy","init","createError","resolve","reject","response","validateStatus","config","status","request","cache","cacheKey","JSON","parse","localStorage","getItem","changed","mtime","setItem","stringify","save","mod","using","setUsing","removeUsing","getFileId","ChunkSize","name","lastModifiedDate","getUploadIdList","saveUploadId","UploadId","limit","unshift","removeUploadId","DOMParser","xmlToJSON","version","mergeCDATA","normalize","stripElemPrefix","prefixMatch","RegExp","grokType","sValue","isFinite","parseFloat","parseString","xmlString","xml","stringToXML","getElementsByTagName","parseXML","oXMLParent","vResult","nLength","sCollectedTxt","childNum","childNodes","oNode","sProp","vContent","nItem","nodeType","nodeValue","nodeName","constructor","keys","xmlToString","xmlDoc","XMLSerializer","serializeToString","parser","parseFromString","ActiveXObject","async","loadXML","class","style","color","navArray","index","navto","route","nowroute","lan","$t","props","setup","routes","path","url","router","render","__scopeId","toInteger","requireObjectCoercible","repeat","count","Infinity","RangeError","event","task","base","advance","defaultOptions","XCosSecurityToken","ChunkRetryTimes","FileParallelLimit","ChunkParallelLimit","SliceSize","CopyChunkParallelLimit","CopyChunkSize","CopySliceSize","MaxPartNumber","UploadQueueSize","Domain","ServiceDomain","Protocol","ForcePathStyle","Timeout","CorrectClockSkew","UploadAddMetaMd5","UploadIdCacheLimit","COS","getAuthorization","session","Async","sliceUploadFile","FileSize","ep","TaskId","AsyncLimit","StorageClass","ServerSideEncryption","onHashProgress","_isRunningTask","UploadCompleteData","UploadData","uploadSliceComplete","SliceList","uploadSliceList","_params","getUploadIdAndPartList","PartList","SIZE","AutoChunkSize","SkipTask","putObject","ETagMap","SliceCount","ceil","FinishSize","getChunkETag","PartNumber","ETag","Size","chunkItem","isAvailableUploadList","PartCount","PartSliceSize","Part","errData","Uploaded","ContentType","multipartInit","Message","UploadIdList","reverse","eachLimit","asyncCallback","wholeMultipartListPart","PartListData","isAvailable","AvailableUploadData","RemoteUploadIdList","LocalUploadIdList","wholeMultipartList","UploadList","toUpperCase","UploadID","sendParams","Prefix","multipartList","Upload","IsTruncated","KeyMarker","NextKeyMarker","UploadIdMarker","NextUploadIdMarker","multipartListPart","PartNumberMarker","NextPartNumberMarker","ChunkParallel","needUploadSlices","SliceItem","currentSize","preAddSize","uploadSliceItem","FileBody","PartItem","retry","tryCallback","multipartUpload","Parts","multipartComplete","abortUploadTask","Level","AbortArray","abortUploadTaskArray","resultList","AbortItem","eachIndex","KeyNotMatch","multipartAbort","successList","errorList","uploadFiles","TotalSize","TotalFinish","onTotalProgress","unFinishCount","files","_onTotalFileFinish","onFileFinish","onTotalFileFinish","Index","taskList","fileParams","fileInfo","k","_onTaskReady","onTaskReady","tid","PreAddSize","_onProgress","_onFileFinish","_addTasks","sliceCopyFile","CopySource","m","SourceBucket","SourceRegion","SourceKey","decodeURIComponent","CopySourceRange","copySliceItem","SourceHeaders","TargetHeader","ChunkCount","partNumber","restoreHeader","headObject","statusCode","ErrorStatus","putObjectCopy","resHeaders","metaPrefix","uploadPartCopy","API_MAP","transferToTaskMethod","utils","Axios","defaults","createInstance","defaultConfig","context","instance","axios","create","instanceConfig","CancelToken","isCancel","all","promises","Promise","spread","normalizeHeaderName","DEFAULT_CONTENT_TYPE","setContentTypeIfUnset","getDefaultAdapter","adapter","XMLHttpRequest","process","transformRequest","transformResponse","timeout","xsrfCookieName","xsrfHeaderName","maxContentLength","common","byteToHex","bytesToUuid","buf","bth","locator","buildErrorHandler","errorImpl","domBuilder","DOMHandler","errorHandler","isCallback","Function","build","msg","_locator","cdata","position","node","lineNumber","columnNumber","systemId","_toString","chars","java","lang","appendElement","hander","currentElement","appendChild","doc","mimeType","sax","XMLReader","defaultNSMap","xmlns","entityMap","setDocumentLocator","nbsp","copy","startDocument","DOMImplementation","createDocument","documentURI","startElement","namespaceURI","localName","qName","attrs","el","createElementNS","getURI","getValue","attr","getQName","createAttributeNS","getLocator","setAttributeNode","endElement","current","tagName","parentNode","startPrefixMapping","prefix","uri","endPrefixMapping","processingInstruction","ins","createProcessingInstruction","ignorableWhitespace","ch","characters","charNode","createCDATASection","createTextNode","skippedEntity","endDocument","comment","comm","createComment","startCDATA","endCDATA","startDTD","publicId","impl","implementation","createDocumentType","dt","warning","fatalError","enhanceError","code","Error","write","domain","secure","cookie","toGMTString","read","remove","normalizedName","executor","TypeError","resolvePromise","promise","token","reason","throwIfRequested","cancel","c","__webpack_amd_options__","classof","encode","paramsSerializer","serializedParams","parts","toISOString","originURL","msie","urlParsingNode","createElement","resolveURL","href","setAttribute","protocol","host","search","hostname","port","charAt","location","requestURL","parsed","uploadflie","then","tcVod","mediaFile","done","fns","VodReportEvent","ReqType","pkg","util_1","baseReportData","platform","device","reportUrl","report_apply","onApply","report_cos_upload","onCosUpload","report_commit","onCommit","report_done","onDone","reportObj","videoFile","fileSize","fileName","fileType","vodSessionKey","reqKey","customReportData","reqType","errCode","vodErrCode","errMsg","reqTimeCost","Number","requestStartTime","reqTime","cosRegion","storageRegionV5","report","isTest","cos_upload","cosErrCode","Code","commit","fileId","reportData","send","isDev","log","vodAxios","post","root","NODE_JS","JS_SHA1_NO_NODE_JS","versions","global","COMMON_JS","JS_SHA1_NO_COMMON_JS","AMD","HEX_CHARS","EXTRA","SHIFT","OUTPUT_TYPES","blocks","createOutputMethod","outputType","Sha1","createMethod","nodeWrap","crypto","eval","Buffer","nodeMethod","createHash","sharedMemory","h0","h1","h2","h3","h4","block","hBytes","finalized","hashed","first","notString","charCodeAt","lastByteIndex","finalize","f","j","d","hex","array","arrayBuffer","dataView","DataView","setUint32","sha1","args","src","dest","_extends","Class","Super","pt","ppt","__proto__","htmlns","NodeType","ELEMENT_NODE","ATTRIBUTE_NODE","TEXT_NODE","CDATA_SECTION_NODE","ENTITY_REFERENCE_NODE","ENTITY_NODE","PROCESSING_INSTRUCTION_NODE","COMMENT_NODE","DOCUMENT_NODE","DOCUMENT_TYPE_NODE","DOCUMENT_FRAGMENT_NODE","NOTATION_NODE","ExceptionCode","ExceptionMessage","HIERARCHY_REQUEST_ERR","INDEX_SIZE_ERR","DOMSTRING_SIZE_ERR","NOT_FOUND_ERR","WRONG_DOCUMENT_ERR","INVALID_CHARACTER_ERR","NO_DATA_ALLOWED_ERR","NO_MODIFICATION_ALLOWED_ERR","INUSE_ATTRIBUTE_ERR","NOT_SUPPORTED_ERR","INVALID_STATE_ERR","SYNTAX_ERR","INVALID_MODIFICATION_ERR","NAMESPACE_ERR","INVALID_ACCESS_ERR","DOMException","captureStackTrace","NodeList","LiveNodeList","refresh","_node","_refresh","_updateLiveList","inc","_inc","ownerDocument","ls","__set__","NamedNodeMap","_findNodeIndex","_addNamedNode","newAttr","oldAttr","ownerElement","_onRemoveAttribute","_onAddAttribute","_removeNamedNode","lastIndex","features","_features","feature","Node","_xmlEncoder","_visitNode","firstChild","nextSibling","Document","ns","_nsMap","_onUpdateChild","newChild","cs","child","_removeChild","previous","previousSibling","lastChild","_insertBefore","nextChild","cp","removeChild","newFirst","newLast","pre","_appendSingleChild","Element","Attr","CharacterData","Text","Comment","CDATASection","DocumentType","Notation","Entity","EntityReference","DocumentFragment","ProcessingInstruction","nodeSerializeToString","isHtml","nodeFilter","refNode","documentElement","lookupPrefix","visibleNamespaces","namespace","needNamespaceDefine","isHTML","attributes","pubid","sysid","sub","internalSubset","importNode","deep","node2","cloneNode","attrs2","_ownerElement","object","getNamedItem","setNamedItem","setNamedItemNS","getNamedItemNS","removeNamedItem","removeNamedItemNS","hasFeature","qualifiedName","doctype","insertBefore","refChild","replaceChild","oldChild","hasChildNodes","appendData","isSupported","hasAttributes","lookupNamespaceURI","isDefaultNamespace","importedNode","getElementById","id","rtv","getAttribute","createDocumentFragment","createAttribute","specified","createEntityReference","pl","hasAttribute","getAttributeNode","removeAttribute","removeAttributeNode","setAttributeNodeNS","removeAttributeNS","old","getAttributeNodeNS","hasAttributeNS","getAttributeNS","setAttributeNS","getElementsByTagNameNS","substringData","text","insertData","replaceData","deleteData","splitText","newText","newNode","getTextContent","get","$$length","set","md5cycle","x","ff","gg","hh","ii","add32","cmn","q","md5blk","md5blks","hex_chr","rhex","ctx","isBinStr","unescape","tail","state","y","lsw","msw","REQUEST","getService","region","submitRequest","Action","buckets","ListAllMyBucketsResult","Buckets","owner","Owner","putBucket","getUrl","bucket","isLocation","Location","headBucket","getBucket","reqParams","ResourceKey","qs","ListBucketResult","Contents","CommonPrefixes","deleteBucket","putBucketAcl","AccessControlPolicy","Grants","Grant","AccessControlList","uniqGrant","body","getBucketAcl","decodeAcl","ACL","putBucketCors","CORSConfiguration","CORSRules","rule","sKey","CORSRule","getBucketCors","deleteBucketCors","getBucketLocation","putBucketPolicy","Policy","PolicyStr","json","getBucketPolicy","rawBody","deleteBucketPolicy","putBucketTagging","Tagging","Tags","TagSet","Tag","getBucketTagging","deleteBucketTagging","putBucketLifecycle","LifecycleConfiguration","Rules","Rule","getBucketLifecycle","deleteBucketLifecycle","putBucketVersioning","VersioningConfiguration","getBucketVersioning","putBucketReplication","ReplicationConfiguration","getBucketReplication","deleteBucketReplication","putBucketWebsite","WebsiteConfiguration","RoutingRules","RoutingRule","getBucketWebsite","deleteBucketWebsite","NotModified","etag","listObjectVersions","ListVersionsResult","DeleteMarkers","Versions","Version","getObject","needCalcMd5","deleteObject","BucketNotFound","getObjectAcl","putObjectAcl","optionsObject","OptionsForbidden","AccessControlAllowOrigin","AccessControlAllowMethods","AccessControlAllowHeaders","AccessControlExposeHeaders","AccessControlMaxAge","Scope","CopyObjectResult","uploadId","CopyPartResult","deleteMultipleObject","Objects","Quiet","Delete","DeleteResult","Deleted","Errors","restoreObject","RestoreRequest","InitiateMultipartUploadResult","CompleteMultipartUpload","CompleteMultipartUploadResult","ListMultipartUploadsResult","ListPartsResult","getObjectUrl","Sign","Url","AuthData","getAuthorizationAsync","signUrl","Authorization","ClientIP","ClientUA","Token","GrantFullControl","GrantWrite","GrantRead","GrantReadAcp","GrantWriteAcp","GrantMap","PublicAcl","READ","WRITE","FULL_CONTROL","Grantee","ID","URI","Permission","exist","longBucket","shortBucket","lastIndexOf","formatAllow","auth","atob","KeyName","StsData","ScopeKey","_StsCache","compareTime","StartTime","ExpiredTime","ScopeLimit","calcAuthByTmpKey","TmpSecretId","TmpSecretKey","getSTS","allowRetry","isTimeError","serverDate","date","ServerTime","errorCode","errorMessage","serverTime","abs","versionId","tryTimes","oldClockOffset","_submitRequest","contentLength","sender","hasReturned","killTask","jsonRes","statusSuccess","floor","abort","warnOldApi","proto","suffix","oldName","warned","element_start_char","element_non_start_char","element_replace","not_safe_in_xml","objKeys","process_to_xml","node_data","makeNode","level","hasSubNodes","indent_value","indent","prettyPrint","removeIllegalNameCharacters","node_descriptor","ret","toJSON","nodes","escape","esc","xml_header","standalone","xmlHeader","xmlheader","docType","transformData","isAbsoluteURL","combineURLs","throwIfCancellationRequested","cancelToken","baseURL","iterator","completed","started","running","replenish","times","_objectSpread","ownKeys","getOwnPropertySymbols","concat","sym","getOwnPropertyDescriptor","enumerable","_defineProperty","configurable","writable","AntdIcon","displayName","inheritAttrs","$","deletedIds","class2type","hasOwn","support","jQuery","selector","rtrim","rmsPrefix","rdashAlpha","fcamelCase","letter","isArraylike","isWindow","jquery","toArray","num","pushStack","elems","prevObject","elem","eq","last","copyIsArray","isPlainObject","expando","isReady","isNumeric","isEmptyObject","ownLast","globalEval","execScript","camelCase","string","results","inArray","second","grep","invert","callbackInverse","matches","callbackExpect","arg","guid","proxy","tmp","rootjQuery","rquickExpr","exec","find","parseHTML","rsingleTag","ready","readyList","rnotwhite","optionsCache","createOptions","_","detach","addEventListener","removeEventListener","detachEvent","readyState","Callbacks","firing","memory","fired","firingLength","firingIndex","firingStart","stack","once","fire","stopOnFalse","shift","disable","add","unique","has","empty","disabled","lock","locked","fireWith","Deferred","func","tuples","always","deferred","fail","newDefer","tuple","returned","progress","notify","stateString","when","subordinate","progressValues","progressContexts","resolveContexts","resolveValues","remaining","updateFunc","contexts","values","notifyWith","resolveWith","readyWait","holdReady","hold","wait","triggerHandler","attachEvent","top","frameElement","doScroll","doScrollCheck","strundefined","inlineBlockNeedsLayout","div","container","cssText","zoom","offsetWidth","deleteExpando","acceptData","noData","rbrace","rmultiDash","dataAttr","parseJSON","isEmptyDataObject","internalData","pvt","thisCache","internalKey","isNode","pop","internalRemoveData","cleanData","hasData","removeData","_data","_removeData","queue","dequeue","startLength","hooks","_queueHooks","stop","setter","clearQueue","defer","elements","types","handler","events","handleObjIn","special","eventHandle","handleObj","handlers","namespaces","origType","elemData","handle","triggered","dispatch","rtypenamespace","delegateType","bindType","needsContext","expr","delegateCount","mappedTypes","origCount","teardown","removeEvent","trigger","onlyHandlers","ontype","cur","bubbleType","eventPath","rfocusMorph","Event","isTrigger","namespace_re","noBubble","defaultView","parentWindow","isPropagationStopped","preventDefault","isDefaultPrevented","_default","fix","matched","handlerQueue","delegateTarget","preDispatch","currentTarget","isImmediatePropagationStopped","stopPropagation","postDispatch","sel","button","prop","originalEvent","fixHook","fixHooks","rmouseEvent","mouseHooks","rkeyEvent","keyHooks","srcElement","metaKey","original","which","charCode","keyCode","eventDoc","fromElement","pageX","clientX","scrollLeft","clientLeft","pageY","clientY","scrollTop","clientTop","relatedTarget","toElement","load","focus","safeActiveElement","blur","click","beforeunload","returnValue","simulate","bubble","isSimulated","defaultPrevented","returnTrue","returnFalse","timeStamp","rformElems","cancelBubble","stopImmediatePropagation","submitBubbles","submit","form","_submit_bubble","changeBubbles","change","propertyName","_just_changed","focusinBubbles","orig","attaches","one","origFn","delay","time","fx","speeds","nonce","rquery","rvalidtokens","requireNonComma","depth","comma","open","close","ajaxLocParts","ajaxLocation","rhash","rts","rheaders","rlocalProtocol","rnoContent","rprotocol","rurl","prefilters","transports","allTypes","addToPrefiltersOrTransports","structure","dataTypeExpression","dataType","dataTypes","inspectPrefiltersOrTransports","originalOptions","jqXHR","inspected","seekingTransport","inspect","selected","prefilterOrFactory","dataTypeOrTransport","ajaxExtend","flatOptions","ajaxSettings","ajaxHandleResponses","responses","firstDataType","ct","finalDataType","contents","getResponseHeader","converters","ajaxConvert","isSuccess","conv2","conv","prev","responseFields","dataFilter","active","lastModified","isLocal","processData","contentType","accepts","html","ajaxSetup","settings","ajaxPrefilter","ajaxTransport","ajax","cacheURL","responseHeadersString","timeoutTimer","fireGlobals","transport","responseHeaders","callbackContext","globalEventContext","completeDeferred","requestHeaders","requestHeadersNames","strAbort","getAllResponseHeaders","setRequestHeader","lname","overrideMimeType","statusText","finalText","complete","success","crossDomain","param","traditional","hasContent","ifModified","beforeSend","nativeStatusText","modified","rejectWith","getJSON","getScript","_evalUrl","r20","rbracket","rCRLF","rsubmitterTypes","rsubmittable","buildParams","serialize","serializeArray","is","checked","rcheckableType","xhr","createStandardXHR","createActiveXHR","xhrId","xhrCallbacks","xhrSupported","cors","username","password","xhrFields","onprogress","isAbort","onreadystatechange","responseText","script","head","scriptCharset","charset","oldCallbacks","rjsonp","jsonp","jsonpCallback","originalSettings","callbackName","overwritten","responseContainer","jsonProp","keepScripts","scripts","buildFragment","stringifyPrimitive","queryStringify","sep","ks","Boolean","qsStr","getResponse","statusMessage","settle","buildURL","parseHeaders","isURLSameOrigin","requestData","responseURL","responseData","responseType","onerror","ontimeout","cookies","xsrfValue","withCredentials","onDownloadProgress","onUploadProgress","__extends","extendStatics","setPrototypeOf","__","__awaiter","_arguments","P","generator","adopt","fulfilled","step","rejected","__generator","g","label","sent","trys","ops","verb","Symbol","op","UploaderEvent","events_1","axios_1","uuidv4","interceptors","use","isNaN","Uploader","_super","_this","sessionName","applyRequestTimeout","applyRequestRetryCount","commitRequestTimeout","commitRequestRetryCount","retryDelay","validateInitParams","videoName","mediaName","coverFile","cosAuthTime","genFileInfo","setStorage","cname","getStorage","delStorage","removeItem","lastDotIndex","videoInfo","coverName","coverLastDotIndex","coverInfo","applyUploadUGC","retryCount","whenError","_a","HOST","MAIN","BACKUP","signature","e_1","applyResult","applyData","vodSessionKey_1","videoType","videoSize","coverType","coverSize","uploadToCos","cosParam","uploadCosParams","cosVideoParam","cosCoverParam","uploadPromises","storageBucket","storageAppId","currentTimeStamp","safeExpireTime","getUnix","tempCertificate","expiredTime","timestamp","secretId","secretKey","video","storagePath","video_progress","media_progress","onUpload","video_upload","media_upload","taskId","cover","cover_progress","cover_upload","uploadCosParam","commitUploadUGC","e_2","commitResult","donePromise","_start","doneResult","catch","CLIENT_ERROR_CODE","UPLOAD_FAIL","cancelTask","EventEmitter","containers","styleElements","usage","createStyleElement","styleElement","insertCss","css","prepend","querySelector","containerId","styleSheet","textContent","valid","isIconDefinition","theme","icon","generate","rootProps","tag","children","getSecondaryColor","primaryColor","normalizeTwoToneColors","twoToneColor","iconStyles","cssInjectedFlag","styleStr","_objectWithoutProperties","excluded","_objectWithoutPropertiesLoose","sourceSymbolKeys","propertyIsEnumerable","sourceKeys","twoToneColorPalette","secondaryColor","calculated","setTwoToneColors","_ref","getTwoToneColors","_props$context$attrs","restProps","colors","width","height","fill","_slicedToArray","_arrayWithHoles","_iterableToArrayLimit","_unsupportedIterableToArray","_nonIterableRest","minLen","_arrayLikeToArray","from","arr2","_arr","_n","_d","_e","_s","_i","setTwoToneColor","_normalizeTwoToneColo","_normalizeTwoToneColo2","getTwoToneColor","_classObj","cls","spin","rotate","tabindex","onClick","classObj","anticon","svgClassString","iconTabIndex","svgStyle","msTransform","transform","thisNumberValue","fails","nativeToFixed","toFixed","pow","acc","x2","FORCED","forced","fractionDigits","z","number","fractDigits","sign","multiply","c2","divide","dataToString","InterceptorManager","eject","h","rng","v4","rnds","ms","nameStartChar","nameChar","tagNamePattern","S_TAG","S_ATTR","S_ATTR_SPACE","S_EQ","S_ATTR_NOQUOT_VALUE","S_ATTR_END","S_TAG_SPACE","S_TAG_CLOSE","defaultNSMapCopy","fixedFromCharCode","surrogate1","surrogate2","entityReplacer","appendText","xt","lineEnd","linePattern","lineStart","parseStack","currentNSMap","closeMap","tagStart","localNSMap","endMatch","endIgnoreCaseMach","parseInstruction","parseDCC","ElementAttributes","parseElementStartPart","closed","fixSelfClosed","locator2","copyLocator","parseHtmlSpecialContent","attrName","setTagName","nsp","nsPrefix","_copy","elStartEnd","elEndStart","pos","matchs","lastMatch","endDTD","_set_proto_","thiz","parent","reg","getLocalName","dispatchRequest","chain","interceptor","lib","Base","mixIn","$super","WordArray","words","sigBytes","clamp","enc","Hex","Latin1","Utf8","r","BufferedBlockAlgorithm","reset","_nDataBytes","_append","_process","blockSize","_minBufferSize","_doProcessBlock","Hasher","cfg","_doReset","_doFinalize","_createHelper","_createHmacHelper","HMAC","algo","_hash","_hasher","_oKey","_iKey","C","C_lib","C_enc","Base64","wordArray","_map","base64Chars","byte1","byte2","byte3","triplet","paddingChar","base64Str","base64StrLength","paddingIndex","nBytes","bits1","bits2","getRandomValues","msCrypto","rnds8","originApiMap","apiMap","_addTask","initTask","tasks","uploadingFileCount","nextUploadIndex","formatTask","FilePath","hashPercent","_custom","emitListUpdate","isActive","startNextTask","onTaskStart","apiParams","switchToState","waiting","toState","isTaskReadyWarning","ignoreAddEvent","TaskReady","getTaskList","pauseTask","restartTask","isUploadRunning","ignoreDuplicateOf","line","relativeURL","ReflectOwnKeys","R","Reflect","ReflectApply","receiver","ProcessEmitWarning","getOwnPropertyNames","NumberIsNaN","_events","_eventsCount","_maxListeners","defaultMaxListeners","checkListener","listener","_getMaxListeners","that","_addListener","existing","newListener","w","emitter","onceWrapper","removeListener","wrapFn","_onceWrap","wrapped","_listeners","unwrap","evlistener","unwrapListeners","arrayClone","listenerCount","spliceOne","eventListener","errorListener","getPrototypeOf","setMaxListeners","getMaxListeners","doError","er","addListener","prependListener","prependOnceListener","originalListener","removeAllListeners","rawListeners","eventNames"],"mappings":"kHAQA,SAASA,EAAOC,GACdC,KAAKD,QAAUA,EAGjBD,EAAOG,UAAUC,SAAW,WAC1B,MAAO,UAAYF,KAAKD,QAAU,KAAOC,KAAKD,QAAU,KAG1DD,EAAOG,UAAUE,YAAa,EAE9BC,EAAOC,QAAUP,G,oCChBjB,IAAIQ,EAAM,EAAQ,QACdC,EAAW,EAAQ,QACnBC,EAAW,EAAQ,QACnBC,EAAW,EAAQ,QAEvB,SAASC,EAAiBC,GACtB,OAAOC,mBAAmBD,GACrBE,QAAQ,KAAM,OACdA,QAAQ,KAAM,OACdA,QAAQ,MAAO,OACfA,QAAQ,MAAO,OACfA,QAAQ,MAAO,OAIxB,IAAIC,EAAU,SAAUC,GACpBA,EAAMA,GAAO,GAEb,IAQIC,EARAC,EAAWF,EAAIE,SACfC,EAAYH,EAAIG,UAChBC,EAAUJ,EAAII,QACdC,GAAUL,EAAIK,QAAUL,EAAIM,QAAU,OAAOC,cAC7CC,EAAcC,EAAMT,EAAIU,OAASV,EAAIW,QAAU,IAC/CC,EAAUH,EAAMT,EAAIa,SAAWb,EAAIY,SAAW,IAE9CE,EAAMd,EAAIc,KAAO,GASrB,GAPId,EAAIe,UACJd,EAAWD,EAAIgB,UAAYhB,EAAIC,UAAY,IAAMa,GAEjDb,EAAWD,EAAIgB,UAAYhB,EAAIC,UAAYa,EACjB,IAA1Bb,EAASgB,QAAQ,OAAehB,EAAW,IAAMA,KAGhDC,EAAU,OAAOgB,QAAQC,MAAM,0BACpC,IAAKhB,EAAW,OAAOe,QAAQC,MAAM,2BAErC,IAAIC,EAAgB,SAAUC,GAC1B,IAAIC,EAAO,GACX,IAAK,IAAIC,K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zC,EAAI,EAAGA,EAAIsS,EAAKnS,SAAUH,EAC7BP,EAAM6S,EAAKtS,GACC,mBAARP,GACJtC,KAAK+/D,mBAAmBz9D,GAK1B,OAHAtC,KAAK+/D,mBAAmB,kBACxB//D,KAAK29D,QAAU3wD,OAAO6U,OAAO,MAC7B7hB,KAAK49D,aAAe,EACb59D,KAKT,GAFAwQ,EAAYgmC,EAAO9pC,GAEM,oBAAd8D,EACTxQ,KAAKy+D,eAAe/xD,EAAM8D,QACrB,QAAkBvN,IAAduN,EAET,IAAK3N,EAAI2N,EAAUxN,OAAS,EAAGH,GAAK,EAAGA,IACrC7C,KAAKy+D,eAAe/xD,EAAM8D,EAAU3N,IAIxC,OAAO7C,MAoBbiuD,EAAahuD,UAAUuQ,UAAY,SAAmB9D,GACpD,OAAOmyD,EAAW7+D,KAAM0M,GAAM,IAGhCuhD,EAAahuD,UAAU+/D,aAAe,SAAsBtzD,GAC1D,OAAOmyD,EAAW7+D,KAAM0M,GAAM,IAGhCuhD,EAAaiR,cAAgB,SAASX,EAAS7xD,GAC7C,MAAqC,oBAA1B6xD,EAAQW,cACVX,EAAQW,cAAcxyD,GAEtBwyD,EAAcr5D,KAAK04D,EAAS7xD,IAIvCuhD,EAAahuD,UAAUi/D,cAAgBA,EAiBvCjR,EAAahuD,UAAUggE,WAAa,WAClC,OAAOjgE,KAAK49D,aAAe,EAAIT,EAAen9D,KAAK29D,SAAW","file":"js/chunk-520d8a08.76e69e99.js","sourcesContent":["'use strict';\n\n/**\n * A `Cancel` is an object that is thrown when an operation is canceled.\n *\n * @class\n * @param {string=} message The message.\n */\nfunction Cancel(message) {\n this.message = message;\n}\n\nCancel.prototype.toString = function toString() {\n return 'Cancel' + (this.message ? ': ' + this.message : '');\n};\n\nCancel.prototype.__CANCEL__ = true;\n\nmodule.exports = Cancel;\n","'use strict';\r\n\r\nvar md5 = require('../lib/md5');\r\nvar CryptoJS = require('../lib/crypto');\r\nvar xml2json = require('../lib/xml2json');\r\nvar json2xml = require('../lib/json2xml');\r\n\r\nfunction camSafeUrlEncode(str) {\r\n return encodeURIComponent(str)\r\n .replace(/!/g, '%21')\r\n .replace(/'/g, '%27')\r\n .replace(/\\(/g, '%28')\r\n .replace(/\\)/g, '%29')\r\n .replace(/\\*/g, '%2A');\r\n}\r\n\r\n//测试用的key后面可以去掉\r\nvar getAuth = function (opt) {\r\n opt = opt || {};\r\n\r\n var SecretId = opt.SecretId;\r\n var SecretKey = opt.SecretKey;\r\n var KeyTime = opt.KeyTime;\r\n var method = (opt.method || opt.Method || 'get').toLowerCase();\r\n var queryParams = clone(opt.Query || opt.params || {});\r\n var headers = clone(opt.Headers || opt.headers || {});\r\n\r\n var Key = opt.Key || '';\r\n var pathname;\r\n if (opt.UseRawKey) {\r\n pathname = opt.Pathname || opt.pathname || '/' + Key;\r\n } else {\r\n pathname = opt.Pathname || opt.pathname || Key;\r\n pathname.indexOf('/') !== 0 && (pathname = '/' + pathname);\r\n }\r\n\r\n if (!SecretId) return console.error('missing param SecretId');\r\n if (!SecretKey) return console.error('missing param SecretKey');\r\n\r\n var getObjectKeys = function (obj) {\r\n var list = [];\r\n for (var key in obj) {\r\n if (obj.hasOwnProperty(key)) {\r\n list.push(key);\r\n }\r\n }\r\n return list.sort(function (a, b) {\r\n a = a.toLowerCase();\r\n b = b.toLowerCase();\r\n return a === b ? 0 : (a > b ? 1 : -1);\r\n });\r\n };\r\n\r\n var obj2str = function (obj) {\r\n var i, key, val;\r\n var list = [];\r\n var keyList = getObjectKeys(obj);\r\n for (i = 0; i < keyList.length; i++) {\r\n key = keyList[i];\r\n val = (obj[key] === undefined || obj[key] === null) ? '' : ('' + obj[key]);\r\n key = key.toLowerCase();\r\n key = camSafeUrlEncode(key);\r\n val = camSafeUrlEncode(val) || '';\r\n list.push(key + '=' + val)\r\n }\r\n return list.join('&');\r\n };\r\n\r\n // 签名有效起止时间\r\n var now = Math.round(getSkewTime(opt.SystemClockOffset) / 1000) - 1;\r\n var exp = now;\r\n\r\n var Expires = opt.Expires || opt.expires;\r\n if (Expires === undefined) {\r\n exp += 900; // 签名过期时间为当前 + 900s\r\n } else {\r\n exp += (Expires * 1) || 0;\r\n }\r\n\r\n // 要用到的 Authorization 参数列表\r\n var qSignAlgorithm = 'sha1';\r\n var qAk = SecretId;\r\n var qSignTime = KeyTime || now + ';' + exp;\r\n var qKeyTime = KeyTime || now + ';' + exp;\r\n var qHeaderList = getObjectKeys(headers).join(';').toLowerCase();\r\n var qUrlParamList = getObjectKeys(queryParams).join(';').toLowerCase();\r\n\r\n // 签名算法说明文档:https://www.qcloud.com/document/product/436/7778\r\n // 步骤一:计算 SignKey\r\n var signKey = CryptoJS.HmacSHA1(qKeyTime, SecretKey).toString();\r\n\r\n // 步骤二:构成 FormatString\r\n var formatString = [method, pathname, obj2str(queryParams), obj2str(headers), ''].join('\\n');\r\n\r\n // 步骤三:计算 StringToSign\r\n var stringToSign = ['sha1', qSignTime, CryptoJS.SHA1(formatString).toString(), ''].join('\\n');\r\n\r\n // 步骤四:计算 Signature\r\n var qSignature = CryptoJS.HmacSHA1(stringToSign, signKey).toString();\r\n\r\n // 步骤五:构造 Authorization\r\n var authorization = [\r\n 'q-sign-algorithm=' + qSignAlgorithm,\r\n 'q-ak=' + qAk,\r\n 'q-sign-time=' + qSignTime,\r\n 'q-key-time=' + qKeyTime,\r\n 'q-header-list=' + qHeaderList,\r\n 'q-url-param-list=' + qUrlParamList,\r\n 'q-signature=' + qSignature\r\n ].join('&');\r\n\r\n return authorization;\r\n\r\n};\r\n\r\nvar noop = function () {\r\n\r\n};\r\n\r\n// 清除对象里值为的 undefined 或 null 的属性\r\nvar clearKey = function (obj) {\r\n var retObj = {};\r\n for (var key in obj) {\r\n if (obj.hasOwnProperty(key) && obj[key] !== undefined && obj[key] !== null) {\r\n retObj[key] = obj[key];\r\n }\r\n }\r\n return retObj;\r\n};\r\n\r\nvar readAsBinaryString = function (blob, callback) {\r\n var readFun;\r\n var fr = new FileReader();\r\n if (FileReader.prototype.readAsBinaryString) {\r\n readFun = FileReader.prototype.readAsBinaryString;\r\n fr.onload = function () {\r\n callback(this.result);\r\n };\r\n } else if (FileReader.prototype.readAsArrayBuffer) { // 在 ie11 添加 readAsBinaryString 兼容\r\n readFun = function (fileData) {\r\n var binary = \"\";\r\n var pt = this;\r\n var reader = new FileReader();\r\n reader.onload = function (e) {\r\n var bytes = new Uint8Array(reader.result);\r\n var length = bytes.byteLength;\r\n for (var i = 0; i < length; i++) {\r\n binary += String.fromCharCode(bytes[i]);\r\n }\r\n callback(binary);\r\n };\r\n reader.readAsArrayBuffer(fileData);\r\n };\r\n } else {\r\n console.error('FileReader not support readAsBinaryString');\r\n }\r\n readFun.call(fr, blob);\r\n};\r\n\r\nvar fileSliceNeedCopy = (function () {\r\n var compareVersion = function(a, b) {\r\n a = a.split('.');\r\n b = b.split('.');\r\n for (var i = 0; i < b.length; i++) {\r\n if (a[i] !== b[i]) {\r\n return parseInt(a[i]) > parseInt(b[i]) ? 1 : -1;\r\n }\r\n }\r\n return 0;\r\n };\r\n var check = function (ua) {\r\n var ChromeVersion = (ua.match(/Chrome\\/([.\\d]+)/) || [])[1];\r\n var QBCoreVersion = (ua.match(/QBCore\\/([.\\d]+)/) || [])[1];\r\n var QQBrowserVersion = (ua.match(/QQBrowser\\/([.\\d]+)/) || [])[1];\r\n var need = ChromeVersion && compareVersion(ChromeVersion, '53.0.2785.116') < 0\r\n && QBCoreVersion && compareVersion(QBCoreVersion, '3.53.991.400') < 0\r\n && QQBrowserVersion && compareVersion(QQBrowserVersion, '9.0.2524.400') <= 0 || false;\r\n return need;\r\n };\r\n return check(navigator && navigator.userAgent);\r\n})();\r\n\r\n// 获取文件分片\r\nvar fileSlice = function (file, start, end, isUseToUpload, callback) {\r\n var blob;\r\n if (file.slice) {\r\n blob = file.slice(start, end);\r\n } else if (file.mozSlice) {\r\n blob = file.mozSlice(start, end);\r\n } else if (file.webkitSlice) {\r\n blob = file.webkitSlice(start, end);\r\n }\r\n if (isUseToUpload && fileSliceNeedCopy) {\r\n var reader = new FileReader();\r\n reader.onload = function (e) {\r\n blob = null;\r\n callback(new Blob([reader.result]));\r\n };\r\n reader.readAsArrayBuffer(blob);\r\n } else {\r\n callback(blob);\r\n }\r\n};\r\n\r\n// 获取文件内容的 MD5\r\nvar getBodyMd5 = function (UploadCheckContentMd5, Body, callback, onProgress) {\r\n callback = callback || noop;\r\n if (UploadCheckContentMd5) {\r\n if (typeof Body === 'string') {\r\n callback(util.md5(Body, true));\r\n } else if (Blob && Body instanceof Blob) {\r\n util.getFileMd5(Body, function (err, md5) {\r\n callback(md5);\r\n }, onProgress);\r\n } else {\r\n callback();\r\n }\r\n } else {\r\n callback();\r\n }\r\n};\r\n\r\n// 获取文件 md5 值\r\nvar md5ChunkSize = 1024 * 1024;\r\nvar getFileMd5 = function (blob, callback, onProgress) {\r\n var size = blob.size;\r\n var loaded = 0;\r\n var md5ctx = md5.getCtx();\r\n var next = function (start) {\r\n if (start >= size) {\r\n var hash = md5ctx.digest('hex');\r\n callback(null, hash);\r\n return;\r\n }\r\n var end = Math.min(size, start + md5ChunkSize);\r\n util.fileSlice(blob, start, end, false, function (chunk) {\r\n readAsBinaryString(chunk, function (content) {\r\n chunk = null;\r\n md5ctx = md5ctx.update(content, true);\r\n loaded += content.length;\r\n content = null;\r\n if (onProgress) onProgress({loaded: loaded, total: size, percent: Math.round(loaded / size * 10000) / 10000});\r\n next(start + md5ChunkSize);\r\n });\r\n });\r\n };\r\n next(0);\r\n};\r\n\r\nfunction clone(obj) {\r\n return map(obj, function (v) {\r\n return typeof v === 'object' ? clone(v) : v;\r\n });\r\n}\r\n\r\nfunction extend(target, source) {\r\n each(source, function (val, key) {\r\n target[key] = source[key];\r\n });\r\n return target;\r\n}\r\n\r\nfunction isArray(arr) {\r\n return arr instanceof Array;\r\n}\r\n\r\nfunction isInArray(arr, item) {\r\n var flag = false;\r\n for (var i = 0; i < arr.length; i++) {\r\n if (item === arr[i]) {\r\n flag = true;\r\n break;\r\n }\r\n }\r\n return flag;\r\n}\r\n\r\nfunction makeArray(arr) {\r\n return isArray(arr) ? arr : [arr];\r\n}\r\n\r\nfunction each(obj, fn) {\r\n for (var i in obj) {\r\n if (obj.hasOwnProperty(i)) {\r\n fn(obj[i], i);\r\n }\r\n }\r\n}\r\n\r\nfunction map(obj, fn) {\r\n var o = isArray(obj) ? [] : {};\r\n for (var i in obj) {\r\n if (obj.hasOwnProperty(i)) {\r\n o[i] = fn(obj[i], i);\r\n }\r\n }\r\n return o;\r\n}\r\n\r\nfunction filter(obj, fn) {\r\n var iaArr = isArray(obj);\r\n var o = iaArr ? [] : {};\r\n for (var i in obj) {\r\n if (obj.hasOwnProperty(i)) {\r\n if (fn(obj[i], i)) {\r\n if (iaArr) {\r\n o.push(obj[i]);\r\n } else {\r\n o[i] = obj[i];\r\n }\r\n }\r\n }\r\n }\r\n return o;\r\n}\r\n\r\nvar binaryBase64 = function (str) {\r\n var i, len, char, res = '';\r\n for (i = 0, len = str.length / 2; i < len; i++) {\r\n char = parseInt(str[i * 2] + str[i * 2 + 1], 16);\r\n res += String.fromCharCode(char);\r\n }\r\n return btoa(res);\r\n};\r\nvar uuid = function () {\r\n var S4 = function () {\r\n return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1);\r\n };\r\n return (S4() + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + \"-\" + S4() + S4() + S4());\r\n};\r\n\r\nvar hasMissingParams = function (apiName, params) {\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n if (apiName.indexOf('Bucket') > -1 || apiName === 'deleteMultipleObject' || apiName === 'multipartList' || apiName === 'listObjectVersions') {\r\n if (!Bucket) return 'Bucket';\r\n if (!Region) return 'Region';\r\n } else if (apiName.indexOf('Object') > -1 || apiName.indexOf('multipart') > -1 || apiName === 'sliceUploadFile' || apiName === 'abortUploadTask') {\r\n if (!Bucket) return 'Bucket';\r\n if (!Region) return 'Region';\r\n if (!Key) return 'Key';\r\n }\r\n return false;\r\n};\r\n\r\nvar formatParams = function (apiName, params) {\r\n\r\n // 复制参数对象\r\n params = extend({}, params);\r\n\r\n // 统一处理 Headers\r\n if (apiName !== 'getAuth' && apiName !== 'getV4Auth' && apiName !== 'getObjectUrl') {\r\n var Headers = params.Headers || {};\r\n if (params && typeof params === 'object') {\r\n (function () {\r\n for (var key in params) {\r\n if (params.hasOwnProperty(key) && key.indexOf('x-cos-') > -1) {\r\n Headers[key] = params[key];\r\n }\r\n }\r\n })();\r\n\r\n var headerMap = {\r\n // params headers\r\n 'x-cos-mfa': 'MFA',\r\n 'Content-MD5': 'ContentMD5',\r\n 'Content-Length': 'ContentLength',\r\n 'Content-Type': 'ContentType',\r\n 'Expect': 'Expect',\r\n 'Expires': 'Expires',\r\n 'Cache-Control': 'CacheControl',\r\n 'Content-Disposition': 'ContentDisposition',\r\n 'Content-Encoding': 'ContentEncoding',\r\n 'Range': 'Range',\r\n 'If-Modified-Since': 'IfModifiedSince',\r\n 'If-Unmodified-Since': 'IfUnmodifiedSince',\r\n 'If-Match': 'IfMatch',\r\n 'If-None-Match': 'IfNoneMatch',\r\n 'x-cos-copy-source': 'CopySource',\r\n 'x-cos-copy-source-Range': 'CopySourceRange',\r\n 'x-cos-metadata-directive': 'MetadataDirective',\r\n 'x-cos-copy-source-If-Modified-Since': 'CopySourceIfModifiedSince',\r\n 'x-cos-copy-source-If-Unmodified-Since': 'CopySourceIfUnmodifiedSince',\r\n 'x-cos-copy-source-If-Match': 'CopySourceIfMatch',\r\n 'x-cos-copy-source-If-None-Match': 'CopySourceIfNoneMatch',\r\n 'x-cos-acl': 'ACL',\r\n 'x-cos-grant-read': 'GrantRead',\r\n 'x-cos-grant-write': 'GrantWrite',\r\n 'x-cos-grant-full-control': 'GrantFullControl',\r\n 'x-cos-grant-read-acp': 'GrantReadAcp',\r\n 'x-cos-grant-write-acp': 'GrantWriteAcp',\r\n 'x-cos-storage-class': 'StorageClass',\r\n // SSE-C\r\n 'x-cos-server-side-encryption-customer-algorithm': 'SSECustomerAlgorithm',\r\n 'x-cos-server-side-encryption-customer-key': 'SSECustomerKey',\r\n 'x-cos-server-side-encryption-customer-key-MD5': 'SSECustomerKeyMD5',\r\n // SSE-COS、SSE-KMS\r\n 'x-cos-server-side-encryption': 'ServerSideEncryption',\r\n 'x-cos-server-side-encryption-cos-kms-key-id': 'SSEKMSKeyId',\r\n 'x-cos-server-side-encryption-context': 'SSEContext',\r\n };\r\n util.each(headerMap, function (paramKey, headerKey) {\r\n if (params[paramKey] !== undefined) {\r\n Headers[headerKey] = params[paramKey];\r\n }\r\n });\r\n\r\n params.Headers = clearKey(Headers);\r\n }\r\n }\r\n\r\n return params;\r\n};\r\n\r\nvar apiWrapper = function (apiName, apiFn) {\r\n return function (params, callback) {\r\n\r\n // 处理参数\r\n if (typeof params === 'function') {\r\n callback = params;\r\n params = {};\r\n }\r\n\r\n // 整理参数格式\r\n params = formatParams(apiName, params);\r\n\r\n // 代理回调函数\r\n var formatResult = function (result) {\r\n if (result && result.headers) {\r\n result.headers['x-cos-version-id'] && (result.VersionId = result.headers['x-cos-version-id']);\r\n result.headers['x-cos-delete-marker'] && (result.DeleteMarker = result.headers['x-cos-delete-marker']);\r\n }\r\n return result;\r\n };\r\n var _callback = function (err, data) {\r\n callback && callback(formatResult(err), formatResult(data));\r\n };\r\n\r\n if (apiName !== 'getService' && apiName !== 'abortUploadTask') {\r\n // 判断参数是否完整\r\n var missingResult;\r\n if (missingResult = hasMissingParams(apiName, params)) {\r\n _callback({error: 'missing param ' + missingResult});\r\n return;\r\n }\r\n // 判断 region 格式\r\n if (params.Region) {\r\n if (params.Region.indexOf('cos.') > -1) {\r\n _callback({error: 'param Region should not be start with \"cos.\"'});\r\n return;\r\n } else if (!/^([a-z\\d-]+)$/.test(params.Region)) {\r\n _callback({error: 'Region format error.'});\r\n return;\r\n }\r\n // 判断 region 格式\r\n if (!this.options.CompatibilityMode && params.Region.indexOf('-') === -1 && params.Region !== 'yfb' && params.Region !== 'default') {\r\n console.warn('warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224');\r\n }\r\n }\r\n // 兼容不带 AppId 的 Bucket\r\n if (params.Bucket) {\r\n if (!/^([a-z\\d-]+)-(\\d+)$/.test(params.Bucket)) {\r\n if (params.AppId) {\r\n params.Bucket = params.Bucket + '-' + params.AppId;\r\n } else if (this.options.AppId) {\r\n params.Bucket = params.Bucket + '-' + this.options.AppId;\r\n } else {\r\n _callback({error: 'Bucket should format as \"test-1250000000\".'});\r\n return;\r\n }\r\n }\r\n if (params.AppId) {\r\n console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:\"test-1250000000\" ).');\r\n delete params.AppId;\r\n }\r\n }\r\n // 如果 Key 是 / 开头,强制去掉第一个 /\r\n if (!this.options.UseRawKey && params.Key && params.Key.substr(0, 1) === '/') {\r\n params.Key = params.Key.substr(1);\r\n }\r\n }\r\n var res = apiFn.call(this, params, _callback);\r\n if (apiName === 'getAuth' || apiName === 'getObjectUrl') {\r\n return res;\r\n }\r\n }\r\n};\r\n\r\nvar throttleOnProgress = function (total, onProgress) {\r\n var self = this;\r\n var size0 = 0;\r\n var size1 = 0;\r\n var time0 = Date.now();\r\n var time1;\r\n var timer;\r\n\r\n function update() {\r\n timer = 0;\r\n if (onProgress && (typeof onProgress === 'function')) {\r\n time1 = Date.now();\r\n var speed = Math.max(0, Math.round((size1 - size0) / ((time1 - time0) / 1000) * 100) / 100);\r\n var percent;\r\n if (size1 === 0 && total === 0) {\r\n percent = 1;\r\n } else {\r\n percent = Math.round(size1 / total * 100) / 100 || 0;\r\n }\r\n time0 = time1;\r\n size0 = size1;\r\n try {\r\n onProgress({loaded: size1, total: total, speed: speed, percent: percent});\r\n } catch (e) {\r\n }\r\n }\r\n }\r\n\r\n return function (info, immediately) {\r\n if (info) {\r\n size1 = info.loaded;\r\n total = info.total;\r\n }\r\n if (immediately) {\r\n clearTimeout(timer);\r\n update();\r\n } else {\r\n if (timer) return;\r\n timer = setTimeout(update, self.options.ProgressInterval);\r\n }\r\n };\r\n};\r\n\r\nvar getFileSize = function (api, params, callback) {\r\n var size;\r\n if (typeof params.Body === 'string') {\r\n params.Body = new Blob([params.Body], {type: 'text/plain'});\r\n }\r\n if ((params.Body && (params.Body instanceof Blob || params.Body.toString() === '[object File]' || params.Body.toString() === '[object Blob]'))) {\r\n size = params.Body.size;\r\n } else {\r\n callback({error: 'params body format error, Only allow File|Blob|String.'});\r\n return;\r\n }\r\n params.ContentLength = size;\r\n callback(null, size);\r\n};\r\n\r\n// 获取调正的时间戳\r\nvar getSkewTime = function (offset) {\r\n return Date.now() + (offset || 0);\r\n};\r\n\r\nvar util = {\r\n noop: noop,\r\n formatParams: formatParams,\r\n apiWrapper: apiWrapper,\r\n xml2json: xml2json,\r\n json2xml: json2xml,\r\n md5: md5,\r\n clearKey: clearKey,\r\n fileSlice: fileSlice,\r\n getBodyMd5: getBodyMd5,\r\n getFileMd5: getFileMd5,\r\n binaryBase64: binaryBase64,\r\n extend: extend,\r\n isArray: isArray,\r\n isInArray: isInArray,\r\n makeArray: makeArray,\r\n each: each,\r\n map: map,\r\n filter: filter,\r\n clone: clone,\r\n uuid: uuid,\r\n camSafeUrlEncode: camSafeUrlEncode,\r\n throttleOnProgress: throttleOnProgress,\r\n getFileSize: getFileSize,\r\n getSkewTime: getSkewTime,\r\n getAuth: getAuth,\r\n isBrowser: true,\r\n};\r\n\r\nmodule.exports = util;\r\n","'use strict';\n\nvar bind = require('./helpers/bind');\nvar isBuffer = require('is-buffer');\n\n/*global toString:true*/\n\n// utils is a library of generic helper functions non-specific to axios\n\nvar toString = Object.prototype.toString;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Array, otherwise false\n */\nfunction isArray(val) {\n return toString.call(val) === '[object Array]';\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nfunction isArrayBuffer(val) {\n return toString.call(val) === '[object ArrayBuffer]';\n}\n\n/**\n * Determine if a value is a FormData\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nfunction isFormData(val) {\n return (typeof FormData !== 'undefined') && (val instanceof FormData);\n}\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n var result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (val.buffer instanceof ArrayBuffer);\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a String, otherwise false\n */\nfunction isString(val) {\n return typeof val === 'string';\n}\n\n/**\n * Determine if a value is a Number\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Number, otherwise false\n */\nfunction isNumber(val) {\n return typeof val === 'number';\n}\n\n/**\n * Determine if a value is undefined\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nfunction isUndefined(val) {\n return typeof val === 'undefined';\n}\n\n/**\n * Determine if a value is an Object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is an Object, otherwise false\n */\nfunction isObject(val) {\n return val !== null && typeof val === 'object';\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Date, otherwise false\n */\nfunction isDate(val) {\n return toString.call(val) === '[object Date]';\n}\n\n/**\n * Determine if a value is a File\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a File, otherwise false\n */\nfunction isFile(val) {\n return toString.call(val) === '[object File]';\n}\n\n/**\n * Determine if a value is a Blob\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nfunction isBlob(val) {\n return toString.call(val) === '[object Blob]';\n}\n\n/**\n * Determine if a value is a Function\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nfunction isFunction(val) {\n return toString.call(val) === '[object Function]';\n}\n\n/**\n * Determine if a value is a Stream\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nfunction isStream(val) {\n return isObject(val) && isFunction(val.pipe);\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {Object} val The value to test\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nfunction isURLSearchParams(val) {\n return typeof URLSearchParams !== 'undefined' && val instanceof URLSearchParams;\n}\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n * @returns {String} The String freed of excess whitespace\n */\nfunction trim(str) {\n return str.replace(/^\\s*/, '').replace(/\\s*$/, '');\n}\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n */\nfunction isStandardBrowserEnv() {\n if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {\n return false;\n }\n return (\n typeof window !== 'undefined' &&\n typeof document !== 'undefined'\n );\n}\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n */\nfunction forEach(obj, fn) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (var i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n for (var key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n fn.call(null, obj[key], key, obj);\n }\n }\n }\n}\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n var result = {};\n function assignValue(val, key) {\n if (typeof result[key] === 'object' && typeof val === 'object') {\n result[key] = merge(result[key], val);\n } else {\n result[key] = val;\n }\n }\n\n for (var i = 0, l = arguments.length; i < l; i++) {\n forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n * @return {Object} The resulting value of object a\n */\nfunction extend(a, b, thisArg) {\n forEach(b, function assignValue(val, key) {\n if (thisArg && typeof val === 'function') {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n });\n return a;\n}\n\nmodule.exports = {\n isArray: isArray,\n isArrayBuffer: isArrayBuffer,\n isBuffer: isBuffer,\n isFormData: isFormData,\n isArrayBufferView: isArrayBufferView,\n isString: isString,\n isNumber: isNumber,\n isObject: isObject,\n isUndefined: isUndefined,\n isDate: isDate,\n isFile: isFile,\n isBlob: isBlob,\n isFunction: isFunction,\n isStream: isStream,\n isURLSearchParams: isURLSearchParams,\n isStandardBrowserEnv: isStandardBrowserEnv,\n forEach: forEach,\n merge: merge,\n extend: extend,\n trim: trim\n};\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar uploader_1 = require(\"./uploader\");\nvar vod_reporter_1 = require(\"./vod_reporter\");\nvar TcVod = /** @class */ (function () {\n function TcVod(params) {\n this.allowReport = true; // report sdk status to tencent cloud\n this.enableResume = true; // resume uploading from break point\n this.getSignature = params.getSignature;\n if (params.allowReport !== void 0) {\n this.allowReport = params.allowReport;\n }\n if (params.enableResume !== void 0) {\n this.enableResume = params.enableResume;\n }\n this.appId = params.appId;\n this.reportId = params.reportId;\n }\n TcVod.prototype.upload = function (params) {\n var uploaderParams = __assign({ getSignature: this.getSignature, appId: this.appId, reportId: this.reportId, enableResume: this.enableResume }, params);\n var uploader = new uploader_1.default(uploaderParams);\n if (this.allowReport) {\n this.initReporter(uploader);\n }\n uploader.start();\n return uploader;\n };\n // report to official report system\n TcVod.prototype.initReporter = function (uploader) {\n new vod_reporter_1.VodReporter(uploader);\n };\n return TcVod;\n}());\nexports.default = TcVod;\n//# sourceMappingURL=tc_vod.js.map","var initEvent = function (cos) {\r\n var listeners = {};\r\n var getList = function (action) {\r\n !listeners[action] && (listeners[action] = []);\r\n return listeners[action];\r\n };\r\n cos.on = function (action, callback) {\r\n if (action === 'task-list-update') {\r\n console.warn('warning: Event \"' + action + '\" has been deprecated. Please use \"list-update\" instead.');\r\n }\r\n getList(action).push(callback);\r\n };\r\n cos.off = function (action, callback) {\r\n var list = getList(action);\r\n for (var i = list.length - 1; i >= 0; i--) {\r\n callback === list[i] && list.splice(i, 1);\r\n }\r\n };\r\n cos.emit = function (action, data) {\r\n var list = getList(action).map(function (cb) {\r\n return cb;\r\n });\r\n for (var i = 0; i < list.length; i++) {\r\n list[i](data);\r\n }\r\n };\r\n};\r\n\r\nvar EventProxy = function () {\r\n initEvent(this);\r\n};\r\n\r\nmodule.exports.init = initEvent;\r\nmodule.exports.EventProxy = EventProxy;","'use strict';\n\nvar createError = require('./createError');\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n */\nmodule.exports = function settle(resolve, reject, response) {\n var validateStatus = response.config.validateStatus;\n // Note: status is not exposed by XDomainRequest\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(createError(\n 'Request failed with status code ' + response.status,\n response.config,\n null,\n response.request,\n response\n ));\n }\n};\n","var util = require('./util');\r\n\r\n// 按照文件特征值,缓存 UploadId\r\nvar cacheKey = 'cos_sdk_upload_cache';\r\nvar expires = 30 * 24 * 3600;\r\nvar cache;\r\nvar timer;\r\n\r\nvar init = function () {\r\n if (cache) return;\r\n cache = JSON.parse(localStorage.getItem(cacheKey) || '[]') || [];\r\n // 清理太老旧的数据\r\n var changed = false;\r\n var now = Math.round(Date.now() / 1000);\r\n for (var i = cache.length - 1; i >= 0; i--) {\r\n var mtime = cache[i][2];\r\n if (!mtime || mtime + expires < now) {\r\n cache.splice(i, 1);\r\n changed = true;\r\n }\r\n }\r\n changed && localStorage.setItem(cacheKey, JSON.stringify(cache));\r\n};\r\n\r\n// 把缓存存到本地\r\nvar save = function () {\r\n if (timer) return;\r\n timer = setTimeout(function () {\r\n localStorage.setItem(cacheKey, JSON.stringify(cache));\r\n timer = null;\r\n }, 400);\r\n};\r\n\r\nvar mod = {\r\n using: {},\r\n // 标记 UploadId 正在使用\r\n setUsing: function (uuid) {\r\n mod.using[uuid] = true;\r\n },\r\n // 标记 UploadId 已经没在使用\r\n removeUsing: function (uuid) {\r\n delete mod.using[uuid];\r\n },\r\n // 用上传参数生成哈希值\r\n getFileId: function (file, ChunkSize, Bucket, Key) {\r\n if (file.name && file.size && file.lastModifiedDate && ChunkSize) {\r\n return util.md5([file.name, file.size, file.lastModifiedDate, ChunkSize, Bucket, Key].join('::'));\r\n } else {\r\n return null;\r\n }\r\n },\r\n // 获取文件对应的 UploadId 列表\r\n getUploadIdList: function (uuid) {\r\n if (!uuid) return null;\r\n init();\r\n var list = [];\r\n for (var i = 0; i < cache.length; i++) {\r\n if (cache[i][0] === uuid)\r\n list.push(cache[i][1]);\r\n }\r\n return list.length ? list : null;\r\n },\r\n // 缓存 UploadId\r\n saveUploadId: function (uuid, UploadId, limit) {\r\n init();\r\n if (!uuid) return;\r\n // 清理没用的 UploadId\r\n for (var i = cache.length - 1; i >= 0; i--) {\r\n var item = cache[i];\r\n if (item[0] === uuid && item[1] === UploadId) {\r\n cache.splice(i, 1);\r\n }\r\n }\r\n cache.unshift([uuid, UploadId, Math.round(Date.now() / 1000)]);\r\n if (cache.length > limit) cache.splice(limit);\r\n save();\r\n },\r\n // UploadId 已用完,移除掉\r\n removeUploadId: function (UploadId) {\r\n init();\r\n delete mod.using[UploadId];\r\n for (var i = cache.length - 1; i >= 0; i--) {\r\n if (cache[i][1] === UploadId) cache.splice(i, 1)\r\n }\r\n save();\r\n },\r\n};\r\n\r\nmodule.exports = mod;\r\n","/* Copyright 2015 William Summers, MetaTribal LLC\r\n * adapted from https://developer.mozilla.org/en-US/docs/JXON\r\n *\r\n * Licensed under the MIT License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n *\r\n * https://opensource.org/licenses/MIT\r\n *\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\n/**\r\n * @author William Summers\r\n * https://github.com/metatribal/xmlToJSON\r\n */\r\nvar DOMParser = require('xmldom').DOMParser;\r\n\r\nvar xmlToJSON = (function () {\r\n\r\n this.version = \"1.3.5\";\r\n\r\n var options = { // set up the default options\r\n mergeCDATA: true, // extract cdata and merge with text\r\n normalize: true, // collapse multiple spaces to single space\r\n stripElemPrefix: true, // for elements of same name in diff namespaces, you can enable namespaces and access the nskey property\r\n };\r\n\r\n var prefixMatch = new RegExp(/(?!xmlns)^.*:/);\r\n var trimMatch = new RegExp(/^\\s+|\\s+$/g);\r\n\r\n this.grokType = function (sValue) {\r\n if (/^\\s*$/.test(sValue)) {\r\n return null;\r\n }\r\n if (/^(?:true|false)$/i.test(sValue)) {\r\n return sValue.toLowerCase() === \"true\";\r\n }\r\n if (isFinite(sValue)) {\r\n return parseFloat(sValue);\r\n }\r\n return sValue;\r\n };\r\n\r\n this.parseString = function (xmlString, opt) {\r\n if (xmlString) {\r\n var xml = this.stringToXML(xmlString);\r\n if (xml.getElementsByTagName('parsererror').length) {\r\n return null;\r\n } else {\r\n return this.parseXML(xml, opt);\r\n }\r\n } else {\r\n return null;\r\n }\r\n };\r\n\r\n this.parseXML = function (oXMLParent, opt) {\r\n\r\n // initialize options\r\n for (var key in opt) {\r\n options[key] = opt[key];\r\n }\r\n\r\n var vResult = {},\r\n nLength = 0,\r\n sCollectedTxt = \"\";\r\n\r\n // iterate over the children\r\n var childNum = oXMLParent.childNodes.length;\r\n if (childNum) {\r\n for (var oNode, sProp, vContent, nItem = 0; nItem < oXMLParent.childNodes.length; nItem++) {\r\n oNode = oXMLParent.childNodes.item(nItem);\r\n\r\n if (oNode.nodeType === 4) {\r\n if (options.mergeCDATA) {\r\n sCollectedTxt += oNode.nodeValue;\r\n }\r\n } /* nodeType is \"CDATASection\" (4) */\r\n else if (oNode.nodeType === 3) {\r\n sCollectedTxt += oNode.nodeValue;\r\n } /* nodeType is \"Text\" (3) */\r\n else if (oNode.nodeType === 1) { /* nodeType is \"Element\" (1) */\r\n\r\n if (nLength === 0) {\r\n vResult = {};\r\n }\r\n\r\n // using nodeName to support browser (IE) implementation with no 'localName' property\r\n if (options.stripElemPrefix) {\r\n sProp = oNode.nodeName.replace(prefixMatch, '');\r\n } else {\r\n sProp = oNode.nodeName;\r\n }\r\n\r\n vContent = xmlToJSON.parseXML(oNode);\r\n\r\n if (vResult.hasOwnProperty(sProp)) {\r\n if (vResult[sProp].constructor !== Array) {\r\n vResult[sProp] = [vResult[sProp]];\r\n }\r\n vResult[sProp].push(vContent);\r\n\r\n } else {\r\n vResult[sProp] = vContent;\r\n nLength++;\r\n }\r\n }\r\n }\r\n }\r\n\r\n if (!Object.keys(vResult).length) {\r\n // vResult = sCollectedTxt.replace(trimMatch, '') || ''; // by carsonxu 修复 getBucket返回的 Key 是 \" /\" 这种场景\r\n vResult = sCollectedTxt || '';\r\n }\r\n\r\n return vResult;\r\n };\r\n\r\n // Convert xmlDocument to a string\r\n // Returns null on failure\r\n this.xmlToString = function (xmlDoc) {\r\n try {\r\n var xmlString = xmlDoc.xml ? xmlDoc.xml : (new XMLSerializer()).serializeToString(xmlDoc);\r\n return xmlString;\r\n } catch (err) {\r\n return null;\r\n }\r\n };\r\n\r\n // Convert a string to XML Node Structure\r\n // Returns null on failure\r\n this.stringToXML = function (xmlString) {\r\n try {\r\n var xmlDoc = null;\r\n\r\n if (window.DOMParser) {\r\n\r\n var parser = new DOMParser();\r\n xmlDoc = parser.parseFromString(xmlString, \"text/xml\");\r\n\r\n return xmlDoc;\r\n } else {\r\n xmlDoc = new ActiveXObject(\"Microsoft.XMLDOM\");\r\n xmlDoc.async = false;\r\n xmlDoc.loadXML(xmlString);\r\n\r\n return xmlDoc;\r\n }\r\n } catch (e) {\r\n return null;\r\n }\r\n };\r\n\r\n return this;\r\n\r\n}).call({});\r\n\r\nvar xml2json = function (xmlString) {\r\n return xmlToJSON.parseString(xmlString);\r\n};\r\n\r\nmodule.exports = xml2json;\r\n","<template>\r\n <div class=\"nav-bottom\">\r\n <div class=\"nav-container\" :style=\"color\">\r\n <div v-for=\"(item, index) in navArray\" :key=\"index\" class=\"nav-item\" @click=\"navto(item.route)\">\r\n <div :class=\"item.route==nowroute?'active':''\">{{lan.$t(item.name) }}</div> \r\n </div>\r\n </div>\r\n <div class=\"copyright\" :style=\"color\">{{lan.$t(\"banquan\")}}</div>\r\n </div>\r\n</template>\r\n\r\n<script lang=\"ts\">\r\nimport router from '@/router';\r\nimport { useI18n } from '@/utils/i18n';\r\nimport { defineComponent, onMounted, ref } from 'vue';\r\nimport { useRoute } from 'vue-router';\r\n\r\nexport default defineComponent({\r\n props:{\r\n color: Object\r\n }, \r\n setup(){\r\n const lan: any = useI18n();\r\n interface Nav{\r\n name: string;\r\n route: string;\r\n }\r\n \r\n const routes=useRoute()\r\n const nowroute=ref<string>(routes.path)\r\n console.log(routes.path)\r\n const navArray: Array<Nav> = [\r\n {\r\n name: 'zhiboguanli',\r\n route: \"/regime/live\"\r\n },\r\n {\r\n name: 'shipinguanli',\r\n route: \"/regime/video\"\r\n },\r\n {\r\n name: 'dingyuezheguanli',\r\n route: \"/regime/subscriber\"\r\n },\r\n {\r\n name: 'gerenzhongxin',\r\n route: \"/mine/archives\"\r\n }\r\n ]\r\n // const navArray: Array<Nav> = [\r\n // {\r\n // name: \"直播管理\",\r\n // route: \"/regime/live\"\r\n // },\r\n // {\r\n // name: \"视频管理\",\r\n // route: \"/regime/video\"\r\n // },\r\n // {\r\n // name: \"订阅者管理\",\r\n // route: \"/regime/subscriber\"\r\n // },\r\n // {\r\n // name: \"个人中心\",\r\n // route: \"/mine/archives\"\r\n // }\r\n // ]\r\n function navto(url: string){\r\n nowroute.value=url\r\n router.push(url)\r\n \r\n }\r\n \r\n\r\n return {\r\n navArray,\r\n navto,\r\n nowroute,\r\n lan\r\n }\r\n }\r\n})\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n.nav-bottom {\r\n width: 100%;\r\n display: flex;\r\n flex-direction: column;\r\n justify-content: center;\r\n align-items: center;\r\n .nav-container {\r\n display: flex;\r\n align-items: center;\r\n margin-bottom: 10px;\r\n font-size: 10px;\r\n font-weight: 500;\r\n color: #404040;\r\n .nav-item {\r\n padding: 0 14px;\r\n position: relative;\r\n cursor: pointer;\r\n &:not(:last-child)::after {\r\n content: \"\";\r\n position: absolute;\r\n right: 0px;\r\n top: 50%;\r\n width: 1px;\r\n height: 10px;\r\n background: #404040;\r\n transform: translate(0, -50%);\r\n }\r\n }\r\n\r\n .nav-item:hover{\r\n color: #06C7AE;\r\n }\r\n .active{\r\n color: #06C7AE;\r\n }\r\n }\r\n .copyright {\r\n font-size: 9px;\r\n font-weight: 500;\r\n color: #808080;\r\n }\r\n}\r\n</style>","\r\nimport router from '@/router';\r\nimport { useI18n } from '@/utils/i18n';\r\nimport { defineComponent, onMounted, ref } from 'vue';\r\nimport { useRoute } from 'vue-router';\r\n\r\nexport default defineComponent({\r\n props:{\r\n color: Object\r\n }, \r\n setup(){\r\n const lan: any = useI18n();\r\n interface Nav{\r\n name: string;\r\n route: string;\r\n }\r\n \r\n const routes=useRoute()\r\n const nowroute=ref<string>(routes.path)\r\n console.log(routes.path)\r\n const navArray: Array<Nav> = [\r\n {\r\n name: 'zhiboguanli',\r\n route: \"/regime/live\"\r\n },\r\n {\r\n name: 'shipinguanli',\r\n route: \"/regime/video\"\r\n },\r\n {\r\n name: 'dingyuezheguanli',\r\n route: \"/regime/subscriber\"\r\n },\r\n {\r\n name: 'gerenzhongxin',\r\n route: \"/mine/archives\"\r\n }\r\n ]\r\n // const navArray: Array<Nav> = [\r\n // {\r\n // name: \"直播管理\",\r\n // route: \"/regime/live\"\r\n // },\r\n // {\r\n // name: \"视频管理\",\r\n // route: \"/regime/video\"\r\n // },\r\n // {\r\n // name: \"订阅者管理\",\r\n // route: \"/regime/subscriber\"\r\n // },\r\n // {\r\n // name: \"个人中心\",\r\n // route: \"/mine/archives\"\r\n // }\r\n // ]\r\n function navto(url: string){\r\n nowroute.value=url\r\n router.push(url)\r\n \r\n }\r\n \r\n\r\n return {\r\n navArray,\r\n navto,\r\n nowroute,\r\n lan\r\n }\r\n }\r\n})\r\n","import { render } from \"./NavBottom.vue?vue&type=template&id=6dd528d6&scoped=true&bindings={}\"\nimport script from \"./NavBottom.vue?vue&type=script&lang=ts\"\nexport * from \"./NavBottom.vue?vue&type=script&lang=ts\"\n\nimport \"./NavBottom.vue?vue&type=style&index=0&id=6dd528d6&lang=scss&scoped=true\"\nscript.render = render\nscript.__scopeId = \"data-v-6dd528d6\"\n\nexport default script","'use strict';\nvar toInteger = require('../internals/to-integer');\nvar requireObjectCoercible = require('../internals/require-object-coercible');\n\n// `String.prototype.repeat` method implementation\n// https://tc39.github.io/ecma262/#sec-string.prototype.repeat\nmodule.exports = ''.repeat || function repeat(count) {\n var str = String(requireObjectCoercible(this));\n var result = '';\n var n = toInteger(count);\n if (n < 0 || n == Infinity) throw RangeError('Wrong number of repetitions');\n for (;n > 0; (n >>>= 1) && (str += str)) if (n & 1) result += str;\n return result;\n};\n","'use strict';\n\nmodule.exports = function isCancel(value) {\n return !!(value && value.__CANCEL__);\n};\n","'use strict';\r\n\r\nvar util = require('./util');\r\nvar event = require('./event');\r\nvar task = require('./task');\r\nvar base = require('./base');\r\nvar advance = require('./advance');\r\n\r\nvar defaultOptions = {\r\n AppId: '', // AppId 已废弃,请拼接到 Bucket 后传入,例如:test-1250000000\r\n SecretId: '',\r\n SecretKey: '',\r\n XCosSecurityToken: '', // 使用临时密钥需要注意自行刷新 Token\r\n ChunkRetryTimes: 2,\r\n FileParallelLimit: 3,\r\n ChunkParallelLimit: 3,\r\n ChunkSize: 1024 * 1024,\r\n SliceSize: 1024 * 1024,\r\n CopyChunkParallelLimit: 20,\r\n CopyChunkSize: 1024 * 1024 * 10,\r\n CopySliceSize: 1024 * 1024 * 10,\r\n MaxPartNumber: 10000,\r\n ProgressInterval: 1000,\r\n UploadQueueSize: 10000,\r\n Domain: '',\r\n ServiceDomain: '',\r\n Protocol: '',\r\n CompatibilityMode: false,\r\n ForcePathStyle: false,\r\n UseRawKey: false,\r\n Timeout: 0, // 单位毫秒,0 代表不设置超时时间\r\n CorrectClockSkew: true,\r\n SystemClockOffset: 0, // 单位毫秒,ms\r\n UploadCheckContentMd5: false,\r\n UploadAddMetaMd5: false,\r\n UploadIdCacheLimit: 50,\r\n};\r\n\r\n// 对外暴露的类\r\nvar COS = function (options) {\r\n this.options = util.extend(util.clone(defaultOptions), options || {});\r\n this.options.FileParallelLimit = Math.max(1, this.options.FileParallelLimit);\r\n this.options.ChunkParallelLimit = Math.max(1, this.options.ChunkParallelLimit);\r\n this.options.ChunkRetryTimes = Math.max(0, this.options.ChunkRetryTimes);\r\n this.options.ChunkSize = Math.max(1024 * 1024, this.options.ChunkSize);\r\n this.options.CopyChunkParallelLimit = Math.max(1, this.options.CopyChunkParallelLimit);\r\n this.options.CopyChunkSize = Math.max(1024 * 1024, this.options.CopyChunkSize);\r\n this.options.CopySliceSize = Math.max(0, this.options.CopySliceSize);\r\n this.options.MaxPartNumber = Math.max(1024, Math.min(10000, this.options.MaxPartNumber));\r\n this.options.Timeout = Math.max(0, this.options.Timeout);\r\n if (this.options.AppId) {\r\n console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: \"test-1250000000\").');\r\n }\r\n event.init(this);\r\n task.init(this);\r\n};\r\n\r\nbase.init(COS, task);\r\nadvance.init(COS, task);\r\n\r\nCOS.getAuthorization = util.getAuth;\r\nCOS.version = '0.5.27';\r\n\r\nmodule.exports = COS;\r\n","var session = require('./session');\r\nvar Async = require('./async');\r\nvar EventProxy = require('./event').EventProxy;\r\nvar util = require('./util');\r\n\r\n// 文件分块上传全过程,暴露的分块上传接口\r\nfunction sliceUploadFile(params, callback) {\r\n var self = this;\r\n var ep = new EventProxy();\r\n var TaskId = params.TaskId;\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n var Body = params.Body;\r\n var ChunkSize = params.ChunkSize || params.SliceSize || self.options.ChunkSize;\r\n var AsyncLimit = params.AsyncLimit;\r\n var StorageClass = params.StorageClass || 'Standard';\r\n var ServerSideEncryption = params.ServerSideEncryption;\r\n var FileSize;\r\n\r\n var onProgress;\r\n var onHashProgress = params.onHashProgress;\r\n\r\n // 上传过程中出现错误,返回错误\r\n ep.on('error', function (err) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n return callback(err);\r\n });\r\n\r\n // 上传分块完成,开始 uploadSliceComplete 操作\r\n ep.on('upload_complete', function (UploadCompleteData) {\r\n callback(null, UploadCompleteData);\r\n });\r\n\r\n // 上传分块完成,开始 uploadSliceComplete 操作\r\n ep.on('upload_slice_complete', function (UploadData) {\r\n uploadSliceComplete.call(self, {\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n UploadId: UploadData.UploadId,\r\n SliceList: UploadData.SliceList,\r\n }, function (err, data) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n session.removeUsing(UploadData.UploadId);\r\n if (err) {\r\n onProgress(null, true);\r\n return ep.emit('error', err);\r\n }\r\n session.removeUploadId(UploadData.UploadId);\r\n onProgress({loaded: FileSize, total: FileSize}, true);\r\n ep.emit('upload_complete', data);\r\n });\r\n });\r\n\r\n // 获取 UploadId 完成,开始上传每个分片\r\n ep.on('get_upload_data_finish', function (UploadData) {\r\n\r\n // 处理 UploadId 缓存\r\n var uuid = session.getFileId(Body, params.ChunkSize, Bucket, Key);\r\n uuid && session.saveUploadId(uuid, UploadData.UploadId, self.options.UploadIdCacheLimit); // 缓存 UploadId\r\n session.setUsing(UploadData.UploadId); // 标记 UploadId 为正在使用\r\n\r\n // 获取 UploadId\r\n onProgress(null, true); // 任务状态开始 uploading\r\n uploadSliceList.call(self, {\r\n TaskId: TaskId,\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n Body: Body,\r\n FileSize: FileSize,\r\n SliceSize: ChunkSize,\r\n AsyncLimit: AsyncLimit,\r\n ServerSideEncryption: ServerSideEncryption,\r\n UploadData: UploadData,\r\n onProgress: onProgress\r\n }, function (err, data) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (err) {\r\n onProgress(null, true);\r\n return ep.emit('error', err);\r\n }\r\n ep.emit('upload_slice_complete', data);\r\n });\r\n });\r\n\r\n // 开始获取文件 UploadId,里面会视情况计算 ETag,并比对,保证文件一致性,也优化上传\r\n ep.on('get_file_size_finish', function () {\r\n\r\n onProgress = util.throttleOnProgress.call(self, FileSize, params.onProgress);\r\n\r\n if (params.UploadData.UploadId) {\r\n ep.emit('get_upload_data_finish', params.UploadData);\r\n } else {\r\n var _params = util.extend({\r\n TaskId: TaskId,\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n Headers: params.Headers,\r\n StorageClass: StorageClass,\r\n Body: Body,\r\n FileSize: FileSize,\r\n SliceSize: ChunkSize,\r\n onHashProgress: onHashProgress,\r\n }, params);\r\n getUploadIdAndPartList.call(self, _params, function (err, UploadData) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (err) return ep.emit('error', err);\r\n params.UploadData.UploadId = UploadData.UploadId;\r\n params.UploadData.PartList = UploadData.PartList;\r\n ep.emit('get_upload_data_finish', params.UploadData);\r\n });\r\n }\r\n });\r\n\r\n // 获取上传文件大小\r\n FileSize = params.ContentLength;\r\n delete params.ContentLength;\r\n !params.Headers && (params.Headers = {});\r\n util.each(params.Headers, function (item, key) {\r\n if (key.toLowerCase() === 'content-length') {\r\n delete params.Headers[key];\r\n }\r\n });\r\n\r\n // 控制分片大小\r\n (function () {\r\n var SIZE = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 1024 * 2, 1024 * 4, 1024 * 5];\r\n var AutoChunkSize = 1024 * 1024;\r\n for (var i = 0; i < SIZE.length; i++) {\r\n AutoChunkSize = SIZE[i] * 1024 * 1024;\r\n if (FileSize / AutoChunkSize <= self.options.MaxPartNumber) break;\r\n }\r\n params.ChunkSize = params.SliceSize = ChunkSize = Math.max(ChunkSize, AutoChunkSize);\r\n })();\r\n\r\n // 开始上传\r\n if (FileSize === 0) {\r\n params.Body = '';\r\n params.ContentLength = 0;\r\n params.SkipTask = true;\r\n self.putObject(params, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n callback(null, data);\r\n });\r\n } else {\r\n ep.emit('get_file_size_finish');\r\n }\r\n\r\n}\r\n\r\n// 获取上传任务的 UploadId\r\nfunction getUploadIdAndPartList(params, callback) {\r\n var TaskId = params.TaskId;\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n var StorageClass = params.StorageClass;\r\n var self = this;\r\n\r\n // 计算 ETag\r\n var ETagMap = {};\r\n var FileSize = params.FileSize;\r\n var SliceSize = params.SliceSize;\r\n var SliceCount = Math.ceil(FileSize / SliceSize);\r\n var FinishSliceCount = 0;\r\n var FinishSize = 0;\r\n var onHashProgress = util.throttleOnProgress.call(self, FileSize, params.onHashProgress);\r\n var getChunkETag = function (PartNumber, callback) {\r\n var start = SliceSize * (PartNumber - 1);\r\n var end = Math.min(start + SliceSize, FileSize);\r\n var ChunkSize = end - start;\r\n\r\n if (ETagMap[PartNumber]) {\r\n callback(null, {\r\n PartNumber: PartNumber,\r\n ETag: ETagMap[PartNumber],\r\n Size: ChunkSize\r\n });\r\n } else {\r\n util.fileSlice(params.Body, start, end, false, function (chunkItem) {\r\n util.getFileMd5(chunkItem, function (err, md5) {\r\n if (err) return callback(err);\r\n var ETag = '\"' + md5 + '\"';\r\n ETagMap[PartNumber] = ETag;\r\n FinishSliceCount += 1;\r\n FinishSize += ChunkSize;\r\n callback(err, {\r\n PartNumber: PartNumber,\r\n ETag: ETag,\r\n Size: ChunkSize\r\n });\r\n onHashProgress({loaded: FinishSize, total: FileSize});\r\n });\r\n });\r\n }\r\n };\r\n\r\n // 通过和文件的 md5 对比,判断 UploadId 是否可用\r\n var isAvailableUploadList = function (PartList, callback) {\r\n var PartCount = PartList.length;\r\n // 如果没有分片,通过\r\n if (PartCount === 0) {\r\n return callback(null, true);\r\n }\r\n // 检查分片数量\r\n if (PartCount > SliceCount) {\r\n return callback(null, false);\r\n }\r\n // 检查分片大小\r\n if (PartCount > 1) {\r\n var PartSliceSize = Math.max(PartList[0].Size, PartList[1].Size);\r\n if (PartSliceSize !== SliceSize) {\r\n return callback(null, false);\r\n }\r\n }\r\n // 逐个分片计算并检查 ETag 是否一致\r\n var next = function (index) {\r\n if (index < PartCount) {\r\n var Part = PartList[index];\r\n getChunkETag(Part.PartNumber, function (err, chunk) {\r\n if (chunk && chunk.ETag === Part.ETag && chunk.Size === Part.Size) {\r\n next(index + 1);\r\n } else {\r\n callback(null, false);\r\n }\r\n });\r\n } else {\r\n callback(null, true);\r\n }\r\n };\r\n next(0);\r\n };\r\n\r\n var ep = new EventProxy();\r\n ep.on('error', function (errData) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n return callback(errData);\r\n });\r\n\r\n // 存在 UploadId\r\n ep.on('upload_id_available', function (UploadData) {\r\n // 转换成 map\r\n var map = {};\r\n var list = [];\r\n util.each(UploadData.PartList, function (item) {\r\n map[item.PartNumber] = item;\r\n });\r\n for (var PartNumber = 1; PartNumber <= SliceCount; PartNumber++) {\r\n var item = map[PartNumber];\r\n if (item) {\r\n item.PartNumber = PartNumber;\r\n item.Uploaded = true;\r\n } else {\r\n item = {\r\n PartNumber: PartNumber,\r\n ETag: null,\r\n Uploaded: false\r\n };\r\n }\r\n list.push(item);\r\n }\r\n UploadData.PartList = list;\r\n callback(null, UploadData);\r\n });\r\n\r\n // 不存在 UploadId, 初始化生成 UploadId\r\n ep.on('no_available_upload_id', function () {\r\n if (!self._isRunningTask(TaskId)) return;\r\n var _params = util.extend({\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n Headers: util.clone(params.Headers),\r\n StorageClass: StorageClass,\r\n Body: params.Body,\r\n }, params);\r\n // 获取 File 或 Blob 的 type 属性,如果有,作为文件 Content-Type\r\n var ContentType = params.Headers['Content-Type'] || (params.Body && params.Body.type);\r\n if (ContentType) {\r\n _params.Headers['Content-Type'] = ContentType;\r\n }\r\n self.multipartInit(_params, function (err, data) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (err) return ep.emit('error', err);\r\n var UploadId = data.UploadId;\r\n if (!UploadId) {\r\n return callback({Message: 'no upload id'});\r\n }\r\n ep.emit('upload_id_available', {UploadId: UploadId, PartList: []});\r\n });\r\n });\r\n\r\n // 如果已存在 UploadId,找一个可以用的 UploadId\r\n ep.on('has_and_check_upload_id', function (UploadIdList) {\r\n // 串行地,找一个内容一致的 UploadId\r\n UploadIdList = UploadIdList.reverse();\r\n Async.eachLimit(UploadIdList, 1, function (UploadId, asyncCallback) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n // 如果正在上传,跳过\r\n if (session.using[UploadId]) {\r\n asyncCallback(); // 检查下一个 UploadId\r\n return;\r\n }\r\n // 判断 UploadId 是否可用\r\n wholeMultipartListPart.call(self, {\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n UploadId: UploadId,\r\n }, function (err, PartListData) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (err) {\r\n session.removeUsing(UploadId);\r\n return ep.emit('error', err);\r\n }\r\n var PartList = PartListData.PartList;\r\n PartList.forEach(function (item) {\r\n item.PartNumber *= 1;\r\n item.Size *= 1;\r\n item.ETag = item.ETag || '';\r\n });\r\n isAvailableUploadList(PartList, function (err, isAvailable) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (err) return ep.emit('error', err);\r\n if (isAvailable) {\r\n asyncCallback({\r\n UploadId: UploadId,\r\n PartList: PartList\r\n }); // 马上结束\r\n } else {\r\n asyncCallback(); // 检查下一个 UploadId\r\n }\r\n });\r\n });\r\n }, function (AvailableUploadData) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n onHashProgress(null, true);\r\n if (AvailableUploadData && AvailableUploadData.UploadId) {\r\n ep.emit('upload_id_available', AvailableUploadData);\r\n } else {\r\n ep.emit('no_available_upload_id');\r\n }\r\n });\r\n });\r\n\r\n // 在本地缓存找可用的 UploadId\r\n ep.on('seek_local_avail_upload_id', function (RemoteUploadIdList) {\r\n // 在本地找可用的 UploadId\r\n var uuid = session.getFileId(params.Body, params.ChunkSize, Bucket, Key);\r\n var LocalUploadIdList = session.getUploadIdList(uuid);\r\n if (!uuid || !LocalUploadIdList) {\r\n ep.emit('has_and_check_upload_id', RemoteUploadIdList);\r\n return;\r\n }\r\n var next = function (index) {\r\n // 如果本地找不到可用 UploadId,再一个个遍历校验远端\r\n if (index >= LocalUploadIdList.length) {\r\n ep.emit('has_and_check_upload_id', RemoteUploadIdList);\r\n return;\r\n }\r\n var UploadId = LocalUploadIdList[index];\r\n // 如果不在远端 UploadId 列表里,跳过并删除\r\n if (!util.isInArray(RemoteUploadIdList, UploadId)) {\r\n session.removeUploadId(UploadId);\r\n next(index + 1);\r\n return;\r\n }\r\n // 如果正在上传,跳过\r\n if (session.using[UploadId]) {\r\n next(index + 1);\r\n return;\r\n }\r\n // 判断 UploadId 是否存在线上\r\n wholeMultipartListPart.call(self, {\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n UploadId: UploadId,\r\n }, function (err, PartListData) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (err) {\r\n // 如果 UploadId 获取会出错,跳过并删除\r\n session.removeUploadId(UploadId);\r\n next(index + 1);\r\n } else {\r\n // 找到可用 UploadId\r\n ep.emit('upload_id_available', {\r\n UploadId: UploadId,\r\n PartList: PartListData.PartList,\r\n });\r\n }\r\n });\r\n };\r\n next(0);\r\n });\r\n\r\n // 获取线上 UploadId 列表\r\n ep.on('get_remote_upload_id_list', function (RemoteUploadIdList) {\r\n // 获取符合条件的 UploadId 列表,因为同一个文件可以有多个上传任务。\r\n wholeMultipartList.call(self, {\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n }, function (err, data) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (err) {\r\n return ep.emit('error', err);\r\n }\r\n // 整理远端 UploadId 列表\r\n var RemoteUploadIdList = util.filter(data.UploadList, function (item) {\r\n return item.Key === Key && (!StorageClass || item.StorageClass.toUpperCase() === StorageClass.toUpperCase());\r\n }).reverse().map(function (item) {\r\n return item.UploadId || item.UploadID;\r\n });\r\n if (RemoteUploadIdList.length) {\r\n ep.emit('seek_local_avail_upload_id', RemoteUploadIdList);\r\n } else {\r\n // 远端没有 UploadId,清理缓存的 UploadId\r\n var uuid = session.getFileId(params.Body, params.ChunkSize, Bucket, Key), LocalUploadIdList;\r\n if (uuid && (LocalUploadIdList = session.getUploadIdList(uuid))) {\r\n util.each(LocalUploadIdList, function (UploadId) {\r\n session.removeUploadId(UploadId);\r\n });\r\n }\r\n ep.emit('no_available_upload_id');\r\n }\r\n });\r\n });\r\n\r\n // 开始找可用 UploadId\r\n ep.emit('get_remote_upload_id_list');\r\n\r\n}\r\n\r\n// 获取符合条件的全部上传任务 (条件包括 Bucket, Region, Prefix)\r\nfunction wholeMultipartList(params, callback) {\r\n var self = this;\r\n var UploadList = [];\r\n var sendParams = {\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Prefix: params.Key\r\n };\r\n var next = function () {\r\n self.multipartList(sendParams, function (err, data) {\r\n if (err) return callback(err);\r\n UploadList.push.apply(UploadList, data.Upload || []);\r\n if (data.IsTruncated === 'true') { // 列表不完整\r\n sendParams.KeyMarker = data.NextKeyMarker;\r\n sendParams.UploadIdMarker = data.NextUploadIdMarker;\r\n next();\r\n } else {\r\n callback(null, {UploadList: UploadList});\r\n }\r\n });\r\n };\r\n next();\r\n}\r\n\r\n// 获取指定上传任务的分块列表\r\nfunction wholeMultipartListPart(params, callback) {\r\n var self = this;\r\n var PartList = [];\r\n var sendParams = {\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n UploadId: params.UploadId\r\n };\r\n var next = function () {\r\n self.multipartListPart(sendParams, function (err, data) {\r\n if (err) return callback(err);\r\n PartList.push.apply(PartList, data.Part || []);\r\n if (data.IsTruncated === 'true') { // 列表不完整\r\n sendParams.PartNumberMarker = data.NextPartNumberMarker;\r\n next();\r\n } else {\r\n callback(null, {PartList: PartList});\r\n }\r\n });\r\n };\r\n next();\r\n}\r\n\r\n// 上传文件分块,包括\r\n/*\r\n UploadId (上传任务编号)\r\n AsyncLimit (并发量),\r\n SliceList (上传的分块数组),\r\n FilePath (本地文件的位置),\r\n SliceSize (文件分块大小)\r\n FileSize (文件大小)\r\n onProgress (上传成功之后的回调函数)\r\n */\r\nfunction uploadSliceList(params, cb) {\r\n var self = this;\r\n var TaskId = params.TaskId;\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n var UploadData = params.UploadData;\r\n var FileSize = params.FileSize;\r\n var SliceSize = params.SliceSize;\r\n var ChunkParallel = Math.min(params.AsyncLimit || self.options.ChunkParallelLimit || 1, 256);\r\n var Body = params.Body;\r\n var SliceCount = Math.ceil(FileSize / SliceSize);\r\n var FinishSize = 0;\r\n var ServerSideEncryption = params.ServerSideEncryption;\r\n var needUploadSlices = util.filter(UploadData.PartList, function (SliceItem) {\r\n if (SliceItem['Uploaded']) {\r\n FinishSize += SliceItem['PartNumber'] >= SliceCount ? (FileSize % SliceSize || SliceSize) : SliceSize;\r\n }\r\n return !SliceItem['Uploaded'];\r\n });\r\n var onProgress = params.onProgress;\r\n\r\n Async.eachLimit(needUploadSlices, ChunkParallel, function (SliceItem, asyncCallback) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n var PartNumber = SliceItem['PartNumber'];\r\n var currentSize = Math.min(FileSize, SliceItem['PartNumber'] * SliceSize) - (SliceItem['PartNumber'] - 1) * SliceSize;\r\n var preAddSize = 0;\r\n uploadSliceItem.call(self, {\r\n TaskId: TaskId,\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n SliceSize: SliceSize,\r\n FileSize: FileSize,\r\n PartNumber: PartNumber,\r\n ServerSideEncryption: ServerSideEncryption,\r\n Body: Body,\r\n UploadData: UploadData,\r\n onProgress: function (data) {\r\n FinishSize += data.loaded - preAddSize;\r\n preAddSize = data.loaded;\r\n onProgress({loaded: FinishSize, total: FileSize});\r\n },\r\n }, function (err, data) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (util.isBrowser && !err && !data.ETag) {\r\n err = 'get ETag error, please add \"ETag\" to CORS ExposeHeader setting.';\r\n }\r\n if (err) {\r\n FinishSize -= preAddSize;\r\n } else {\r\n FinishSize += currentSize - preAddSize;\r\n SliceItem.ETag = data.ETag;\r\n }\r\n asyncCallback(err || null, data);\r\n });\r\n }, function (err) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (err) return cb(err);\r\n cb(null, {\r\n UploadId: UploadData.UploadId,\r\n SliceList: UploadData.PartList\r\n });\r\n });\r\n}\r\n\r\n// 上传指定分片\r\nfunction uploadSliceItem(params, callback) {\r\n var self = this;\r\n var TaskId = params.TaskId;\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n var FileSize = params.FileSize;\r\n var FileBody = params.Body;\r\n var PartNumber = params.PartNumber * 1;\r\n var SliceSize = params.SliceSize;\r\n var ServerSideEncryption = params.ServerSideEncryption;\r\n var UploadData = params.UploadData;\r\n var ChunkRetryTimes = self.options.ChunkRetryTimes + 1;\r\n\r\n var start = SliceSize * (PartNumber - 1);\r\n\r\n var ContentLength = SliceSize;\r\n\r\n var end = start + SliceSize;\r\n\r\n if (end > FileSize) {\r\n end = FileSize;\r\n ContentLength = end - start;\r\n }\r\n\r\n var PartItem = UploadData.PartList[PartNumber - 1];\r\n Async.retry(ChunkRetryTimes, function (tryCallback) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n util.fileSlice(FileBody, start, end, true, function (Body) {\r\n self.multipartUpload({\r\n TaskId: TaskId,\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n ContentLength: ContentLength,\r\n PartNumber: PartNumber,\r\n UploadId: UploadData.UploadId,\r\n ServerSideEncryption: ServerSideEncryption,\r\n Body: Body,\r\n onProgress: params.onProgress,\r\n }, function (err, data) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n if (err) {\r\n return tryCallback(err);\r\n } else {\r\n PartItem.Uploaded = true;\r\n return tryCallback(null, data);\r\n }\r\n });\r\n });\r\n }, function (err, data) {\r\n if (!self._isRunningTask(TaskId)) return;\r\n return callback(err, data);\r\n });\r\n}\r\n\r\n\r\n// 完成分块上传\r\nfunction uploadSliceComplete(params, callback) {\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n var UploadId = params.UploadId;\r\n var SliceList = params.SliceList;\r\n var self = this;\r\n var ChunkRetryTimes = this.options.ChunkRetryTimes + 1;\r\n var Parts = SliceList.map(function (item) {\r\n return {\r\n PartNumber: item.PartNumber,\r\n ETag: item.ETag\r\n };\r\n });\r\n // 完成上传的请求也做重试\r\n Async.retry(ChunkRetryTimes, function (tryCallback) {\r\n self.multipartComplete({\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n UploadId: UploadId,\r\n Parts: Parts\r\n }, tryCallback);\r\n }, function (err, data) {\r\n callback(err, data);\r\n });\r\n}\r\n\r\n// 抛弃分块上传任务\r\n/*\r\n AsyncLimit (抛弃上传任务的并发量),\r\n UploadId (上传任务的编号,当 Level 为 task 时候需要)\r\n Level (抛弃分块上传任务的级别,task : 抛弃指定的上传任务,file : 抛弃指定的文件对应的上传任务,其他值 :抛弃指定Bucket 的全部上传任务)\r\n */\r\nfunction abortUploadTask(params, callback) {\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n var UploadId = params.UploadId;\r\n var Level = params.Level || 'task';\r\n var AsyncLimit = params.AsyncLimit;\r\n var self = this;\r\n\r\n var ep = new EventProxy();\r\n\r\n ep.on('error', function (errData) {\r\n return callback(errData);\r\n });\r\n\r\n // 已经获取到需要抛弃的任务列表\r\n ep.on('get_abort_array', function (AbortArray) {\r\n abortUploadTaskArray.call(self, {\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n Headers: params.Headers,\r\n AsyncLimit: AsyncLimit,\r\n AbortArray: AbortArray\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n callback(null, data);\r\n });\r\n });\r\n\r\n if (Level === 'bucket') {\r\n // Bucket 级别的任务抛弃,抛弃该 Bucket 下的全部上传任务\r\n wholeMultipartList.call(self, {\r\n Bucket: Bucket,\r\n Region: Region\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n ep.emit('get_abort_array', data.UploadList || []);\r\n });\r\n } else if (Level === 'file') {\r\n // 文件级别的任务抛弃,抛弃该文件的全部上传任务\r\n if (!Key) return callback({error: 'abort_upload_task_no_key'});\r\n wholeMultipartList.call(self, {\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n ep.emit('get_abort_array', data.UploadList || []);\r\n });\r\n } else if (Level === 'task') {\r\n // 单个任务级别的任务抛弃,抛弃指定 UploadId 的上传任务\r\n if (!UploadId) return callback({error: 'abort_upload_task_no_id'});\r\n if (!Key) return callback({error: 'abort_upload_task_no_key'});\r\n ep.emit('get_abort_array', [{\r\n Key: Key,\r\n UploadId: UploadId\r\n }]);\r\n } else {\r\n return callback({error: 'abort_unknown_level'});\r\n }\r\n}\r\n\r\n// 批量抛弃分块上传任务\r\nfunction abortUploadTaskArray(params, callback) {\r\n\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n var AbortArray = params.AbortArray;\r\n var AsyncLimit = params.AsyncLimit || 1;\r\n var self = this;\r\n\r\n var index = 0;\r\n var resultList = new Array(AbortArray.length);\r\n Async.eachLimit(AbortArray, AsyncLimit, function (AbortItem, callback) {\r\n var eachIndex = index;\r\n if (Key && Key !== AbortItem.Key) {\r\n resultList[eachIndex] = {error: {KeyNotMatch: true}};\r\n callback(null);\r\n return;\r\n }\r\n var UploadId = AbortItem.UploadId || AbortItem.UploadID;\r\n\r\n self.multipartAbort({\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: AbortItem.Key,\r\n Headers: params.Headers,\r\n UploadId: UploadId\r\n }, function (err, data) {\r\n var task = {\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: AbortItem.Key,\r\n UploadId: UploadId\r\n };\r\n resultList[eachIndex] = {error: err, task: task};\r\n callback(null);\r\n });\r\n index++;\r\n\r\n }, function (err) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n\r\n var successList = [];\r\n var errorList = [];\r\n\r\n for (var i = 0, len = resultList.length; i < len; i++) {\r\n var item = resultList[i];\r\n if (item['task']) {\r\n if (item['error']) {\r\n errorList.push(item['task']);\r\n } else {\r\n successList.push(item['task']);\r\n }\r\n }\r\n }\r\n\r\n return callback(null, {\r\n successList: successList,\r\n errorList: errorList\r\n });\r\n });\r\n}\r\n\r\n\r\n// 批量上传文件\r\nfunction uploadFiles(params, callback) {\r\n var self = this;\r\n\r\n // 判断多大的文件使用分片上传\r\n var SliceSize = params.SliceSize === undefined ? self.options.SliceSize : params.SliceSize;\r\n\r\n // 汇总返回进度\r\n var TotalSize = 0;\r\n var TotalFinish = 0;\r\n var onTotalProgress = util.throttleOnProgress.call(self, TotalFinish, params.onProgress);\r\n\r\n // 汇总返回回调\r\n var unFinishCount = params.files.length;\r\n var _onTotalFileFinish = params.onFileFinish;\r\n var resultList = Array(unFinishCount);\r\n var onTotalFileFinish = function (err, data, options) {\r\n onTotalProgress(null, true);\r\n _onTotalFileFinish && _onTotalFileFinish(err, data, options);\r\n resultList[options.Index] = {\r\n options: options,\r\n error: err,\r\n data: data\r\n };\r\n if (--unFinishCount <= 0 && callback) {\r\n callback(null, {\r\n files: resultList,\r\n });\r\n }\r\n };\r\n\r\n // 开始处理每个文件\r\n var taskList = [];\r\n util.each(params.files, function (fileParams, index) {\r\n (function () { // 对齐 nodejs 缩进\r\n\r\n var Body = fileParams.Body;\r\n var FileSize = Body.size || Body.length || 0;\r\n var fileInfo = {Index: index, TaskId: ''};\r\n\r\n // 更新文件总大小\r\n TotalSize += FileSize;\r\n\r\n // 整理 option,用于返回给回调\r\n util.each(fileParams, function (v, k) {\r\n if (typeof v !== 'object' && typeof v !== 'function') {\r\n fileInfo[k] = v;\r\n }\r\n });\r\n\r\n // 处理单个文件 TaskReady\r\n var _onTaskReady = fileParams.onTaskReady;\r\n var onTaskReady = function (tid) {\r\n fileInfo.TaskId = tid;\r\n _onTaskReady && _onTaskReady(tid);\r\n };\r\n fileParams.onTaskReady = onTaskReady;\r\n\r\n // 处理单个文件进度\r\n var PreAddSize = 0;\r\n var _onProgress = fileParams.onProgress;\r\n var onProgress = function (info) {\r\n TotalFinish = TotalFinish - PreAddSize + info.loaded;\r\n PreAddSize = info.loaded;\r\n _onProgress && _onProgress(info);\r\n onTotalProgress({loaded: TotalFinish, total: TotalSize});\r\n };\r\n fileParams.onProgress = onProgress;\r\n\r\n // 处理单个文件完成\r\n var _onFileFinish = fileParams.onFileFinish;\r\n var onFileFinish = function (err, data) {\r\n _onFileFinish && _onFileFinish(err, data);\r\n onTotalFileFinish && onTotalFileFinish(err, data, fileInfo);\r\n };\r\n\r\n // 添加上传任务\r\n var api = FileSize >= SliceSize ? 'sliceUploadFile' : 'putObject';\r\n taskList.push({\r\n api: api,\r\n params: fileParams,\r\n callback: onFileFinish,\r\n });\r\n })();\r\n });\r\n self._addTasks(taskList);\r\n}\r\n\r\n// 分片复制文件\r\nfunction sliceCopyFile(params, callback) {\r\n var ep = new EventProxy();\r\n\r\n var self = this;\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n var CopySource = params.CopySource;\r\n var m = CopySource.match(/^([^.]+-\\d+)\\.cos(v6)?\\.([^.]+)\\.[^/]+\\/(.+)$/);\r\n if (!m) {\r\n callback({error: 'CopySource format error'});\r\n return;\r\n }\r\n\r\n var SourceBucket = m[1];\r\n var SourceRegion = m[3];\r\n var SourceKey = decodeURIComponent(m[4]);\r\n var CopySliceSize = params.CopySliceSize === undefined ? self.options.CopySliceSize : params.CopySliceSize;\r\n CopySliceSize = Math.max(0, CopySliceSize);\r\n\r\n var ChunkSize = params.CopyChunkSize || this.options.CopyChunkSize;\r\n var ChunkParallel = this.options.CopyChunkParallelLimit;\r\n\r\n var FinishSize = 0;\r\n var FileSize;\r\n var onProgress;\r\n\r\n // 分片复制完成,开始 multipartComplete 操作\r\n ep.on('copy_slice_complete', function (UploadData) {\r\n self.multipartComplete({\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n UploadId: UploadData.UploadId,\r\n Parts: UploadData.PartList,\r\n },function (err, data) {\r\n if (err) {\r\n onProgress(null, true);\r\n return callback(err);\r\n }\r\n onProgress({loaded: FileSize, total: FileSize}, true);\r\n callback(null, data);\r\n });\r\n });\r\n\r\n ep.on('get_copy_data_finish',function (UploadData) {\r\n Async.eachLimit(UploadData.PartList, ChunkParallel, function (SliceItem, asyncCallback) {\r\n var PartNumber = SliceItem.PartNumber;\r\n var CopySourceRange = SliceItem.CopySourceRange;\r\n var currentSize = SliceItem.end - SliceItem.start;\r\n var preAddSize = 0;\r\n\r\n copySliceItem.call(self, {\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n CopySource: CopySource,\r\n UploadId: UploadData.UploadId,\r\n PartNumber: PartNumber,\r\n CopySourceRange: CopySourceRange,\r\n onProgress: function (data) {\r\n FinishSize += data.loaded - preAddSize;\r\n preAddSize = data.loaded;\r\n onProgress({loaded: FinishSize, total: FileSize});\r\n }\r\n },function (err,data) {\r\n if (err) {\r\n return asyncCallback(err);\r\n }\r\n onProgress({loaded: FinishSize, total: FileSize});\r\n\r\n FinishSize += currentSize - preAddSize;\r\n SliceItem.ETag = data.ETag;\r\n asyncCallback(err || null, data);\r\n });\r\n }, function (err) {\r\n if (err) {\r\n onProgress(null, true);\r\n return callback(err);\r\n }\r\n\r\n ep.emit('copy_slice_complete', UploadData);\r\n });\r\n });\r\n\r\n ep.on('get_file_size_finish', function (SourceHeaders) {\r\n // 控制分片大小\r\n (function () {\r\n var SIZE = [1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 1024 * 2, 1024 * 4, 1024 * 5];\r\n var AutoChunkSize = 1024 * 1024;\r\n for (var i = 0; i < SIZE.length; i++) {\r\n AutoChunkSize = SIZE[i] * 1024 * 1024;\r\n if (FileSize / AutoChunkSize <= self.options.MaxPartNumber) break;\r\n }\r\n params.ChunkSize = ChunkSize = Math.max(ChunkSize, AutoChunkSize);\r\n\r\n var ChunkCount = Math.ceil(FileSize / ChunkSize);\r\n\r\n var list = [];\r\n for (var partNumber = 1; partNumber <= ChunkCount; partNumber++) {\r\n var start = (partNumber - 1) * ChunkSize;\r\n var end = partNumber * ChunkSize < FileSize ? (partNumber * ChunkSize - 1) : FileSize - 1;\r\n var item = {\r\n PartNumber: partNumber,\r\n start: start,\r\n end: end,\r\n CopySourceRange: \"bytes=\" + start + \"-\" + end,\r\n };\r\n list.push(item);\r\n }\r\n params.PartList = list;\r\n })();\r\n\r\n var TargetHeader;\r\n if (params.Headers['x-cos-metadata-directive'] === 'Replaced') {\r\n TargetHeader = params.Headers;\r\n } else {\r\n TargetHeader = SourceHeaders;\r\n }\r\n TargetHeader['x-cos-storage-class'] = params.Headers['x-cos-storage-class'] || SourceHeaders['x-cos-storage-class'];\r\n TargetHeader = util.clearKey(TargetHeader);\r\n /**\r\n * 对于归档存储的对象,如果未恢复副本,则不允许 Copy\r\n */\r\n if (SourceHeaders['x-cos-storage-class'] === 'ARCHIVE') {\r\n var restoreHeader = SourceHeaders['x-cos-restore'];\r\n if (!restoreHeader || restoreHeader === 'ongoing-request=\"true\"') {\r\n callback({ error: 'Unrestored archive object is not allowed to be copied' });\r\n return;\r\n }\r\n }\r\n /**\r\n * 去除一些无用的头部,规避 multipartInit 出错\r\n * 这些头部通常是在 putObjectCopy 时才使用\r\n */\r\n delete TargetHeader['x-cos-copy-source'];\r\n delete TargetHeader['x-cos-metadata-directive'];\r\n delete TargetHeader['x-cos-copy-source-If-Modified-Since'];\r\n delete TargetHeader['x-cos-copy-source-If-Unmodified-Since'];\r\n delete TargetHeader['x-cos-copy-source-If-Match'];\r\n delete TargetHeader['x-cos-copy-source-If-None-Match'];\r\n self.multipartInit({\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n Headers: TargetHeader,\r\n },function (err,data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n params.UploadId = data.UploadId;\r\n ep.emit('get_copy_data_finish', params);\r\n });\r\n });\r\n\r\n // 获取远端复制源文件的大小\r\n self.headObject({\r\n Bucket: SourceBucket,\r\n Region: SourceRegion,\r\n Key: SourceKey,\r\n },function(err, data) {\r\n if (err) {\r\n if (err.statusCode && err.statusCode === 404) {\r\n callback({ErrorStatus: SourceKey + ' Not Exist'});\r\n } else {\r\n callback(err);\r\n }\r\n return;\r\n }\r\n\r\n FileSize = params.FileSize = data.headers['content-length'];\r\n if (FileSize === undefined || !FileSize) {\r\n callback({error: 'get Content-Length error, please add \"Content-Length\" to CORS ExposeHeader setting.'});\r\n return;\r\n }\r\n\r\n onProgress = util.throttleOnProgress.call(self, FileSize, params.onProgress);\r\n\r\n // 开始上传\r\n if (FileSize <= CopySliceSize) {\r\n if (!params.Headers['x-cos-metadata-directive']) {\r\n params.Headers['x-cos-metadata-directive'] = 'Copy';\r\n }\r\n self.putObjectCopy(params, function (err, data) {\r\n if (err) {\r\n onProgress(null, true);\r\n return callback(err);\r\n }\r\n onProgress({loaded: FileSize, total: FileSize}, true);\r\n callback(err, data);\r\n });\r\n } else {\r\n var resHeaders = data.headers;\r\n var SourceHeaders = {\r\n 'Cache-Control': resHeaders['cache-control'],\r\n 'Content-Disposition': resHeaders['content-disposition'],\r\n 'Content-Encoding': resHeaders['content-encoding'],\r\n 'Content-Type': resHeaders['content-type'],\r\n 'Expires': resHeaders['expires'],\r\n 'x-cos-storage-class': resHeaders['x-cos-storage-class'],\r\n };\r\n util.each(resHeaders, function (v, k) {\r\n var metaPrefix = 'x-cos-meta-';\r\n if (k.indexOf(metaPrefix) === 0 && k.length > metaPrefix.length) {\r\n SourceHeaders[k] = v;\r\n }\r\n });\r\n ep.emit('get_file_size_finish', SourceHeaders);\r\n }\r\n });\r\n}\r\n\r\n// 复制指定分片\r\nfunction copySliceItem(params, callback) {\r\n var TaskId = params.TaskId;\r\n var Bucket = params.Bucket;\r\n var Region = params.Region;\r\n var Key = params.Key;\r\n var CopySource = params.CopySource;\r\n var UploadId = params.UploadId;\r\n var PartNumber = params.PartNumber * 1;\r\n var CopySourceRange = params.CopySourceRange;\r\n\r\n var ChunkRetryTimes = this.options.ChunkRetryTimes + 1;\r\n var self = this;\r\n\r\n Async.retry(ChunkRetryTimes, function (tryCallback) {\r\n self.uploadPartCopy({\r\n TaskId: TaskId,\r\n Bucket: Bucket,\r\n Region: Region,\r\n Key: Key,\r\n CopySource: CopySource,\r\n UploadId: UploadId,\r\n PartNumber:PartNumber,\r\n CopySourceRange:CopySourceRange,\r\n onProgress:params.onProgress,\r\n },function (err,data) {\r\n tryCallback(err || null, data);\r\n })\r\n }, function (err, data) {\r\n return callback(err, data);\r\n });\r\n}\r\n\r\n\r\nvar API_MAP = {\r\n sliceUploadFile: sliceUploadFile,\r\n abortUploadTask: abortUploadTask,\r\n uploadFiles: uploadFiles,\r\n sliceCopyFile: sliceCopyFile,\r\n};\r\n\r\nmodule.exports.init = function (COS, task) {\r\n task.transferToTaskMethod(API_MAP, 'sliceUploadFile');\r\n util.each(API_MAP, function (fn, apiName) {\r\n COS.prototype[apiName] = util.apiWrapper(apiName, fn);\r\n });\r\n};\r\n","'use strict';\n\nvar utils = require('./utils');\nvar bind = require('./helpers/bind');\nvar Axios = require('./core/Axios');\nvar defaults = require('./defaults');\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n * @return {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n var context = new Axios(defaultConfig);\n var instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context);\n\n // Copy context to instance\n utils.extend(instance, context);\n\n return instance;\n}\n\n// Create the default instance to be exported\nvar axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Factory for creating new instances\naxios.create = function create(instanceConfig) {\n return createInstance(utils.merge(defaults, instanceConfig));\n};\n\n// Expose Cancel & CancelToken\naxios.Cancel = require('./cancel/Cancel');\naxios.CancelToken = require('./cancel/CancelToken');\naxios.isCancel = require('./cancel/isCancel');\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\naxios.spread = require('./helpers/spread');\n\nmodule.exports = axios;\n\n// Allow use of default import syntax in TypeScript\nmodule.exports.default = axios;\n","'use strict';\n\nvar utils = require('./utils');\nvar normalizeHeaderName = require('./helpers/normalizeHeaderName');\n\nvar DEFAULT_CONTENT_TYPE = {\n 'Content-Type': 'application/x-www-form-urlencoded'\n};\n\nfunction setContentTypeIfUnset(headers, value) {\n if (!utils.isUndefined(headers) && utils.isUndefined(headers['Content-Type'])) {\n headers['Content-Type'] = value;\n }\n}\n\nfunction getDefaultAdapter() {\n var adapter;\n if (typeof XMLHttpRequest !== 'undefined') {\n // For browsers use XHR adapter\n adapter = require('./adapters/xhr');\n } else if (typeof process !== 'undefined') {\n // For node use HTTP adapter\n adapter = require('./adapters/http');\n }\n return adapter;\n}\n\nvar defaults = {\n adapter: getDefaultAdapter(),\n\n transformRequest: [function transformRequest(data, headers) {\n normalizeHeaderName(headers, 'Content-Type');\n if (utils.isFormData(data) ||\n utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n setContentTypeIfUnset(headers, 'application/x-www-form-urlencoded;charset=utf-8');\n return data.toString();\n }\n if (utils.isObject(data)) {\n setContentTypeIfUnset(headers, 'application/json;charset=utf-8');\n return JSON.stringify(data);\n }\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n /*eslint no-param-reassign:0*/\n if (typeof data === 'string') {\n try {\n data = JSON.parse(data);\n } catch (e) { /* Ignore */ }\n }\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n }\n};\n\ndefaults.headers = {\n common: {\n 'Accept': 'application/json, text/plain, */*'\n }\n};\n\nutils.forEach(['delete', 'get', 'head'], function forEachMethodNoData(method) {\n defaults.headers[method] = {};\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n defaults.headers[method] = utils.merge(DEFAULT_CONTENT_TYPE);\n});\n\nmodule.exports = defaults;\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","function DOMParser(options){\r\n\tthis.options = options ||{locator:{}};\r\n\t\r\n}\r\nDOMParser.prototype.parseFromString = function(source,mimeType){\r\n\tvar options = this.options;\r\n\tvar sax = new XMLReader();\r\n\tvar domBuilder = options.domBuilder || new DOMHandler();//contentHandler and LexicalHandler\r\n\tvar errorHandler = options.errorHandler;\r\n\tvar locator = options.locator;\r\n\tvar defaultNSMap = options.xmlns||{};\r\n\tvar entityMap = {'lt':'<','gt':'>','amp':'&','quot':'\"','apos':\"'\"}\r\n\tif(locator){\r\n\t\tdomBuilder.setDocumentLocator(locator)\r\n\t}\r\n\t\r\n\tsax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator);\r\n\tsax.domBuilder = options.domBuilder || domBuilder;\r\n\tif(/\\/x?html?$/.test(mimeType)){\r\n\t\tentityMap.nbsp = '\\xa0';\r\n\t\tentityMap.copy = '\\xa9';\r\n\t\tdefaultNSMap['']= 'http://www.w3.org/1999/xhtml';\r\n\t}\r\n\tdefaultNSMap.xml = defaultNSMap.xml || 'http://www.w3.org/XML/1998/namespace';\r\n\tif(source){\r\n\t\tsax.parse(source,defaultNSMap,entityMap);\r\n\t}else{\r\n\t\tsax.errorHandler.error(\"invalid doc source\");\r\n\t}\r\n\treturn domBuilder.doc;\r\n}\r\nfunction buildErrorHandler(errorImpl,domBuilder,locator){\r\n\tif(!errorImpl){\r\n\t\tif(domBuilder instanceof DOMHandler){\r\n\t\t\treturn domBuilder;\r\n\t\t}\r\n\t\terrorImpl = domBuilder ;\r\n\t}\r\n\tvar errorHandler = {}\r\n\tvar isCallback = errorImpl instanceof Function;\r\n\tlocator = locator||{}\r\n\tfunction build(key){\r\n\t\tvar fn = errorImpl[key];\r\n\t\tif(!fn && isCallback){\r\n\t\t\tfn = errorImpl.length == 2?function(msg){errorImpl(key,msg)}:errorImpl;\r\n\t\t}\r\n\t\terrorHandler[key] = fn && function(msg){\r\n\t\t\tfn('[xmldom '+key+']\\t'+msg+_locator(locator));\r\n\t\t}||function(){};\r\n\t}\r\n\tbuild('warning');\r\n\tbuild('error');\r\n\tbuild('fatalError');\r\n\treturn errorHandler;\r\n}\r\n\r\n//console.log('#\\n\\n\\n\\n\\n\\n\\n####')\r\n/**\r\n * +ContentHandler+ErrorHandler\r\n * +LexicalHandler+EntityResolver2\r\n * -DeclHandler-DTDHandler \r\n * \r\n * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler\r\n * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2\r\n * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html\r\n */\r\nfunction DOMHandler() {\r\n this.cdata = false;\r\n}\r\nfunction position(locator,node){\r\n\tnode.lineNumber = locator.lineNumber;\r\n\tnode.columnNumber = locator.columnNumber;\r\n}\r\n/**\r\n * @see org.xml.sax.ContentHandler#startDocument\r\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html\r\n */ \r\nDOMHandler.prototype = {\r\n\tstartDocument : function() {\r\n \tthis.doc = new DOMImplementation().createDocument(null, null, null);\r\n \tif (this.locator) {\r\n \tthis.doc.documentURI = this.locator.systemId;\r\n \t}\r\n\t},\r\n\tstartElement:function(namespaceURI, localName, qName, attrs) {\r\n\t\tvar doc = this.doc;\r\n\t var el = doc.createElementNS(namespaceURI, qName||localName);\r\n\t var len = attrs.length;\r\n\t appendElement(this, el);\r\n\t this.currentElement = el;\r\n\t \r\n\t\tthis.locator && position(this.locator,el)\r\n\t for (var i = 0 ; i < len; i++) {\r\n\t var namespaceURI = attrs.getURI(i);\r\n\t var value = attrs.getValue(i);\r\n\t var qName = attrs.getQName(i);\r\n\t\t\tvar attr = doc.createAttributeNS(namespaceURI, qName);\r\n\t\t\tthis.locator &&position(attrs.getLocator(i),attr);\r\n\t\t\tattr.value = attr.nodeValue = value;\r\n\t\t\tel.setAttributeNode(attr)\r\n\t }\r\n\t},\r\n\tendElement:function(namespaceURI, localName, qName) {\r\n\t\tvar current = this.currentElement\r\n\t\tvar tagName = current.tagName;\r\n\t\tthis.currentElement = current.parentNode;\r\n\t},\r\n\tstartPrefixMapping:function(prefix, uri) {\r\n\t},\r\n\tendPrefixMapping:function(prefix) {\r\n\t},\r\n\tprocessingInstruction:function(target, data) {\r\n\t var ins = this.doc.createProcessingInstruction(target, data);\r\n\t this.locator && position(this.locator,ins)\r\n\t appendElement(this, ins);\r\n\t},\r\n\tignorableWhitespace:function(ch, start, length) {\r\n\t},\r\n\tcharacters:function(chars, start, length) {\r\n\t\tchars = _toString.apply(this,arguments)\r\n\t\t//console.log(chars)\r\n\t\tif(chars){\r\n\t\t\tif (this.cdata) {\r\n\t\t\t\tvar charNode = this.doc.createCDATASection(chars);\r\n\t\t\t} else {\r\n\t\t\t\tvar charNode = this.doc.createTextNode(chars);\r\n\t\t\t}\r\n\t\t\tif(this.currentElement){\r\n\t\t\t\tthis.currentElement.appendChild(charNode);\r\n\t\t\t}else if(/^\\s*$/.test(chars)){\r\n\t\t\t\tthis.doc.appendChild(charNode);\r\n\t\t\t\t//process xml\r\n\t\t\t}\r\n\t\t\tthis.locator && position(this.locator,charNode)\r\n\t\t}\r\n\t},\r\n\tskippedEntity:function(name) {\r\n\t},\r\n\tendDocument:function() {\r\n\t\tthis.doc.normalize();\r\n\t},\r\n\tsetDocumentLocator:function (locator) {\r\n\t if(this.locator = locator){// && !('lineNumber' in locator)){\r\n\t \tlocator.lineNumber = 0;\r\n\t }\r\n\t},\r\n\t//LexicalHandler\r\n\tcomment:function(chars, start, length) {\r\n\t\tchars = _toString.apply(this,arguments)\r\n\t var comm = this.doc.createComment(chars);\r\n\t this.locator && position(this.locator,comm)\r\n\t appendElement(this, comm);\r\n\t},\r\n\t\r\n\tstartCDATA:function() {\r\n\t //used in characters() methods\r\n\t this.cdata = true;\r\n\t},\r\n\tendCDATA:function() {\r\n\t this.cdata = false;\r\n\t},\r\n\t\r\n\tstartDTD:function(name, publicId, systemId) {\r\n\t\tvar impl = this.doc.implementation;\r\n\t if (impl && impl.createDocumentType) {\r\n\t var dt = impl.createDocumentType(name, publicId, systemId);\r\n\t this.locator && position(this.locator,dt)\r\n\t appendElement(this, dt);\r\n\t }\r\n\t},\r\n\t/**\r\n\t * @see org.xml.sax.ErrorHandler\r\n\t * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html\r\n\t */\r\n\twarning:function(error) {\r\n\t\tconsole.warn('[xmldom warning]\\t'+error,_locator(this.locator));\r\n\t},\r\n\terror:function(error) {\r\n\t\tconsole.error('[xmldom error]\\t'+error,_locator(this.locator));\r\n\t},\r\n\tfatalError:function(error) {\r\n\t\tconsole.error('[xmldom fatalError]\\t'+error,_locator(this.locator));\r\n\t throw error;\r\n\t}\r\n}\r\nfunction _locator(l){\r\n\tif(l){\r\n\t\treturn '\\n@'+(l.systemId ||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']'\r\n\t}\r\n}\r\nfunction _toString(chars,start,length){\r\n\tif(typeof chars == 'string'){\r\n\t\treturn chars.substr(start,length)\r\n\t}else{//java sax connect width xmldom on rhino(what about: \"? && !(chars instanceof String)\")\r\n\t\tif(chars.length >= start+length || start){\r\n\t\t\treturn new java.lang.String(chars,start,length)+'';\r\n\t\t}\r\n\t\treturn chars;\r\n\t}\r\n}\r\n\r\n/*\r\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html\r\n * used method of org.xml.sax.ext.LexicalHandler:\r\n * #comment(chars, start, length)\r\n * #startCDATA()\r\n * #endCDATA()\r\n * #startDTD(name, publicId, systemId)\r\n *\r\n *\r\n * IGNORED method of org.xml.sax.ext.LexicalHandler:\r\n * #endDTD()\r\n * #startEntity(name)\r\n * #endEntity(name)\r\n *\r\n *\r\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html\r\n * IGNORED method of org.xml.sax.ext.DeclHandler\r\n * \t#attributeDecl(eName, aName, type, mode, value)\r\n * #elementDecl(name, model)\r\n * #externalEntityDecl(name, publicId, systemId)\r\n * #internalEntityDecl(name, value)\r\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html\r\n * IGNORED method of org.xml.sax.EntityResolver2\r\n * #resolveEntity(String name,String publicId,String baseURI,String systemId)\r\n * #resolveEntity(publicId, systemId)\r\n * #getExternalSubset(name, baseURI)\r\n * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html\r\n * IGNORED method of org.xml.sax.DTDHandler\r\n * #notationDecl(name, publicId, systemId) {};\r\n * #unparsedEntityDecl(name, publicId, systemId, notationName) {};\r\n */\r\n\"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl\".replace(/\\w+/g,function(key){\r\n\tDOMHandler.prototype[key] = function(){return null}\r\n})\r\n\r\n/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */\r\nfunction appendElement (hander,node) {\r\n if (!hander.currentElement) {\r\n hander.doc.appendChild(node);\r\n } else {\r\n hander.currentElement.appendChild(node);\r\n }\r\n}//appendChild and setAttributeNS are preformance key\r\n\r\n//if(typeof require == 'function'){\r\n\tvar XMLReader = require('./sax').XMLReader;\r\n\tvar DOMImplementation = exports.DOMImplementation = require('./dom').DOMImplementation;\r\n\texports.XMLSerializer = require('./dom').XMLSerializer ;\r\n\texports.DOMParser = DOMParser;\r\n//}\r\n","'use strict';\n\nvar enhanceError = require('./enhanceError');\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The created error.\n */\nmodule.exports = function createError(message, config, code, request, response) {\n var error = new Error(message);\n return enhanceError(error, config, code, request, response);\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs support document.cookie\n (function standardBrowserEnv() {\n return {\n write: function write(name, value, expires, path, domain, secure) {\n var cookie = [];\n cookie.push(name + '=' + encodeURIComponent(value));\n\n if (utils.isNumber(expires)) {\n cookie.push('expires=' + new Date(expires).toGMTString());\n }\n\n if (utils.isString(path)) {\n cookie.push('path=' + path);\n }\n\n if (utils.isString(domain)) {\n cookie.push('domain=' + domain);\n }\n\n if (secure === true) {\n cookie.push('secure');\n }\n\n document.cookie = cookie.join('; ');\n },\n\n read: function read(name) {\n var match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove: function remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n };\n })() :\n\n // Non standard browser env (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return {\n write: function write() {},\n read: function read() { return null; },\n remove: function remove() {}\n };\n })()\n);\n","var COS = require('./src/cos');\r\nmodule.exports = COS;","'use strict';\n\nvar utils = require('../utils');\n\nmodule.exports = function normalizeHeaderName(headers, normalizedName) {\n utils.forEach(headers, function processHeader(value, name) {\n if (name !== normalizedName && name.toUpperCase() === normalizedName.toUpperCase()) {\n headers[normalizedName] = value;\n delete headers[name];\n }\n });\n};\n","'use strict';\n\nvar Cancel = require('./Cancel');\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @class\n * @param {Function} executor The executor function.\n */\nfunction CancelToken(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n var resolvePromise;\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n var token = this;\n executor(function cancel(message) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new Cancel(message);\n resolvePromise(token.reason);\n });\n}\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nCancelToken.prototype.throwIfRequested = function throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n};\n\n/**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\nCancelToken.source = function source() {\n var cancel;\n var token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token: token,\n cancel: cancel\n };\n};\n\nmodule.exports = CancelToken;\n","/* globals __webpack_amd_options__ */\nmodule.exports = __webpack_amd_options__;\n","/*!\n * Determine if an object is a Buffer\n *\n * @author Feross Aboukhadijeh <https://feross.org>\n * @license MIT\n */\n\nmodule.exports = function isBuffer (obj) {\n return obj != null && obj.constructor != null &&\n typeof obj.constructor.isBuffer === 'function' && obj.constructor.isBuffer(obj)\n}\n","var classof = require('../internals/classof-raw');\n\n// `thisNumberValue` abstract operation\n// https://tc39.github.io/ecma262/#sec-thisnumbervalue\nmodule.exports = function (value) {\n if (typeof value != 'number' && classof(value) != 'Number') {\n throw TypeError('Incorrect invocation');\n }\n return +value;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%40/gi, '@').\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @returns {string} The formatted url\n */\nmodule.exports = function buildURL(url, params, paramsSerializer) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n\n var serializedParams;\n if (paramsSerializer) {\n serializedParams = paramsSerializer(params);\n } else if (utils.isURLSearchParams(params)) {\n serializedParams = params.toString();\n } else {\n var parts = [];\n\n utils.forEach(params, function serialize(val, key) {\n if (val === null || typeof val === 'undefined') {\n return;\n }\n\n if (utils.isArray(val)) {\n key = key + '[]';\n } else {\n val = [val];\n }\n\n utils.forEach(val, function parseValue(v) {\n if (utils.isDate(v)) {\n v = v.toISOString();\n } else if (utils.isObject(v)) {\n v = JSON.stringify(v);\n }\n parts.push(encode(key) + '=' + encode(v));\n });\n });\n\n serializedParams = parts.join('&');\n }\n\n if (serializedParams) {\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n};\n","'use strict';\n\nvar utils = require('./../utils');\n\nmodule.exports = (\n utils.isStandardBrowserEnv() ?\n\n // Standard browser envs have full support of the APIs needed to test\n // whether the request URL is of the same origin as current location.\n (function standardBrowserEnv() {\n var msie = /(msie|trident)/i.test(navigator.userAgent);\n var urlParsingNode = document.createElement('a');\n var originURL;\n\n /**\n * Parse a URL to discover it's components\n *\n * @param {String} url The URL to be parsed\n * @returns {Object}\n */\n function resolveURL(url) {\n var href = url;\n\n if (msie) {\n // IE needs attribute set twice to normalize properties\n urlParsingNode.setAttribute('href', href);\n href = urlParsingNode.href;\n }\n\n urlParsingNode.setAttribute('href', href);\n\n // urlParsingNode provides the UrlUtils interface - http://url.spec.whatwg.org/#urlutils\n return {\n href: urlParsingNode.href,\n protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, '') : '',\n host: urlParsingNode.host,\n search: urlParsingNode.search ? urlParsingNode.search.replace(/^\\?/, '') : '',\n hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, '') : '',\n hostname: urlParsingNode.hostname,\n port: urlParsingNode.port,\n pathname: (urlParsingNode.pathname.charAt(0) === '/') ?\n urlParsingNode.pathname :\n '/' + urlParsingNode.pathname\n };\n }\n\n originURL = resolveURL(window.location.href);\n\n /**\n * Determine if a URL shares the same origin as the current location\n *\n * @param {String} requestURL The URL to test\n * @returns {boolean} True if URL shares the same origin, otherwise false\n */\n return function isURLSameOrigin(requestURL) {\n var parsed = (utils.isString(requestURL)) ? resolveURL(requestURL) : requestURL;\n return (parsed.protocol === originURL.protocol &&\n parsed.host === originURL.host);\n };\n })() :\n\n // Non standard browser envs (web workers, react-native) lack needed support.\n (function nonStandardBrowserEnv() {\n return function isURLSameOrigin() {\n return true;\n };\n })()\n);\n","import { get } from '@/api/base'\r\nimport TcVod from \"vod-js-sdk-v6\"\r\n\r\ninterface OnFunctio {\r\n (info: unknown): unknown;\r\n}\r\n\r\ninterface UploaderDone {\r\n fileId: number;\r\n video: {\r\n url: string;\r\n verify_content: string;\r\n };\r\n}\r\n\r\nexport async function uploadflie(file: File,on?: OnFunctio): Promise<UploaderDone> {\r\n const getSignature = () => {\r\n return new Promise<string>((res) => {\r\n get<string>('signature').then((data) => {\r\n console.log(data)\r\n res(data.data)\r\n })\r\n })\r\n } \r\n // const res = await get<string>('signature');\r\n // console.log(res.data)\r\n const tcVod = new TcVod({\r\n getSignature: getSignature\r\n })\r\n const uploader = tcVod.upload({\r\n mediaFile: file\r\n })\r\n if(on != undefined){\r\n uploader.on('media_progress', (info) => {\r\n on(info)\r\n })\r\n }\r\n const data = uploader.done();\r\n return data;\r\n\r\n}","'use strict';\n\nvar utils = require('./../utils');\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Object|String} data The data to be transformed\n * @param {Array} headers The headers for the request or response\n * @param {Array|Function} fns A single function or Array of functions\n * @returns {*} The resulting transformed data\n */\nmodule.exports = function transformData(data, headers, fns) {\n /*eslint no-param-reassign:0*/\n utils.forEach(fns, function transform(fn) {\n data = fn(data, headers);\n });\n\n return data;\n};\n","\"use strict\";\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.VodReporter = exports.VodReportEvent = void 0;\nvar uploader_1 = require(\"./uploader\");\nvar pkg = require(\"../package.json\");\nvar util_1 = require(\"./util\");\nvar VodReportEvent;\n(function (VodReportEvent) {\n VodReportEvent[\"report_apply\"] = \"report_apply\";\n VodReportEvent[\"report_cos_upload\"] = \"report_cos_upload\";\n VodReportEvent[\"report_commit\"] = \"report_commit\";\n VodReportEvent[\"report_done\"] = \"report_done\";\n})(VodReportEvent = exports.VodReportEvent || (exports.VodReportEvent = {}));\nvar ReqType;\n(function (ReqType) {\n ReqType[ReqType[\"apply\"] = 10001] = \"apply\";\n ReqType[ReqType[\"cos_upload\"] = 20001] = \"cos_upload\";\n ReqType[ReqType[\"commit\"] = 10002] = \"commit\";\n ReqType[ReqType[\"done\"] = 40001] = \"done\";\n})(ReqType || (ReqType = {}));\nvar VodReporter = /** @class */ (function () {\n function VodReporter(uploader, options) {\n // only partial data when created\n this.baseReportData = {\n version: pkg.version,\n platform: 3000,\n device: navigator.userAgent\n };\n this.reportUrl = \"https://vodreport.qcloud.com/ugcupload_new\";\n this.uploader = uploader;\n this.options = options;\n this.init();\n }\n VodReporter.prototype.init = function () {\n this.uploader.on(VodReportEvent.report_apply, this.onApply.bind(this));\n this.uploader.on(VodReportEvent.report_cos_upload, this.onCosUpload.bind(this));\n this.uploader.on(VodReportEvent.report_commit, this.onCommit.bind(this));\n this.uploader.on(VodReportEvent.report_done, this.onDone.bind(this));\n };\n // ApplyUploadUGC\n VodReporter.prototype.onApply = function (reportObj) {\n try {\n var uploader = this.uploader;\n if (!uploader.videoFile) {\n return;\n }\n Object.assign(this.baseReportData, {\n appId: uploader.appId,\n fileSize: uploader.videoFile.size,\n fileName: uploader.videoFile.name,\n fileType: uploader.videoFile.type,\n vodSessionKey: uploader.vodSessionKey,\n reqKey: uploader.reqKey,\n reportId: uploader.reportId\n });\n var customReportData = {\n reqType: ReqType.apply,\n errCode: 0,\n vodErrCode: 0,\n errMsg: \"\",\n reqTimeCost: Number(new Date()) - Number(reportObj.requestStartTime),\n reqTime: Number(reportObj.requestStartTime)\n };\n if (reportObj.err) {\n customReportData.errCode = 1;\n customReportData.vodErrCode = reportObj.err.code;\n customReportData.errMsg = reportObj.err.message;\n }\n if (reportObj.data) {\n this.baseReportData.cosRegion = reportObj.data.storageRegionV5;\n }\n this.report(customReportData);\n }\n catch (e) {\n console.error(\"onApply\", e);\n if (util_1.default.isTest) {\n throw e;\n }\n }\n };\n // upload to cos\n VodReporter.prototype.onCosUpload = function (reportObj) {\n try {\n var customReportData = {\n reqType: ReqType.cos_upload,\n errCode: 0,\n cosErrCode: \"\",\n errMsg: \"\",\n reqTimeCost: Number(new Date()) - Number(reportObj.requestStartTime),\n reqTime: Number(reportObj.requestStartTime)\n };\n if (reportObj.err) {\n customReportData.errCode = 1;\n customReportData.cosErrCode = reportObj.err.error\n ? reportObj.err.error.Code\n : reportObj.err;\n if (reportObj.err && reportObj.err.error === \"error\") {\n customReportData.cosErrCode = \"cors error\";\n }\n customReportData.errMsg = JSON.stringify(reportObj.err);\n }\n this.report(customReportData);\n }\n catch (e) {\n console.error(\"onCosUpload\", e);\n if (util_1.default.isTest) {\n throw e;\n }\n }\n };\n // CommitUploadUGC\n VodReporter.prototype.onCommit = function (reportObj) {\n try {\n var customReportData = {\n reqType: ReqType.commit,\n errCode: 0,\n vodErrCode: 0,\n errMsg: \"\",\n reqTimeCost: Number(new Date()) - Number(reportObj.requestStartTime),\n reqTime: Number(reportObj.requestStartTime)\n };\n if (reportObj.err) {\n customReportData.errCode = 1;\n customReportData.vodErrCode = reportObj.err.code;\n customReportData.errMsg = reportObj.err.message;\n }\n if (reportObj.data) {\n this.baseReportData.fileId = reportObj.data.fileId;\n }\n this.report(customReportData);\n }\n catch (e) {\n console.error(\"onCommit\", e);\n if (util_1.default.isTest) {\n throw e;\n }\n }\n };\n VodReporter.prototype.onDone = function (reportObj) {\n try {\n var customReportData = {\n reqType: ReqType.done,\n errCode: reportObj.err && reportObj.err.code,\n reqTimeCost: Number(new Date()) - Number(reportObj.requestStartTime),\n reqTime: Number(reportObj.requestStartTime)\n };\n this.report(customReportData);\n }\n catch (e) {\n console.error(\"onDone\", e);\n if (util_1.default.isTest) {\n throw e;\n }\n }\n };\n VodReporter.prototype.report = function (reportData) {\n reportData = __assign(__assign({}, this.baseReportData), reportData);\n this.send(reportData);\n };\n VodReporter.prototype.send = function (reportData) {\n if (util_1.default.isDev || util_1.default.isTest) {\n console.log(\"send reportData\", reportData);\n return;\n }\n uploader_1.vodAxios.post(this.reportUrl, reportData);\n };\n return VodReporter;\n}());\nexports.VodReporter = VodReporter;\n//# sourceMappingURL=vod_reporter.js.map","/*\n * [js-sha1]{@link https://github.com/emn178/js-sha1}\n *\n * @version 0.6.0\n * @author Chen, Yi-Cyuan [emn178@gmail.com]\n * @copyright Chen, Yi-Cyuan 2014-2017\n * @license MIT\n */\n/*jslint bitwise: true */\n(function() {\n 'use strict';\n\n var root = typeof window === 'object' ? window : {};\n var NODE_JS = !root.JS_SHA1_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node;\n if (NODE_JS) {\n root = global;\n }\n var COMMON_JS = !root.JS_SHA1_NO_COMMON_JS && typeof module === 'object' && module.exports;\n var AMD = typeof define === 'function' && define.amd;\n var HEX_CHARS = '0123456789abcdef'.split('');\n var EXTRA = [-2147483648, 8388608, 32768, 128];\n var SHIFT = [24, 16, 8, 0];\n var OUTPUT_TYPES = ['hex', 'array', 'digest', 'arrayBuffer'];\n\n var blocks = [];\n\n var createOutputMethod = function (outputType) {\n return function (message) {\n return new Sha1(true).update(message)[outputType]();\n };\n };\n\n var createMethod = function () {\n var method = createOutputMethod('hex');\n if (NODE_JS) {\n method = nodeWrap(method);\n }\n method.create = function () {\n return new Sha1();\n };\n method.update = function (message) {\n return method.create().update(message);\n };\n for (var i = 0; i < OUTPUT_TYPES.length; ++i) {\n var type = OUTPUT_TYPES[i];\n method[type] = createOutputMethod(type);\n }\n return method;\n };\n\n var nodeWrap = function (method) {\n var crypto = eval(\"require('crypto')\");\n var Buffer = eval(\"require('buffer').Buffer\");\n var nodeMethod = function (message) {\n if (typeof message === 'string') {\n return crypto.createHash('sha1').update(message, 'utf8').digest('hex');\n } else if (message.constructor === ArrayBuffer) {\n message = new Uint8Array(message);\n } else if (message.length === undefined) {\n return method(message);\n }\n return crypto.createHash('sha1').update(new Buffer(message)).digest('hex');\n };\n return nodeMethod;\n };\n\n function Sha1(sharedMemory) {\n if (sharedMemory) {\n blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n this.blocks = blocks;\n } else {\n this.blocks = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n }\n\n this.h0 = 0x67452301;\n this.h1 = 0xEFCDAB89;\n this.h2 = 0x98BADCFE;\n this.h3 = 0x10325476;\n this.h4 = 0xC3D2E1F0;\n\n this.block = this.start = this.bytes = this.hBytes = 0;\n this.finalized = this.hashed = false;\n this.first = true;\n }\n\n Sha1.prototype.update = function (message) {\n if (this.finalized) {\n return;\n }\n var notString = typeof(message) !== 'string';\n if (notString && message.constructor === root.ArrayBuffer) {\n message = new Uint8Array(message);\n }\n var code, index = 0, i, length = message.length || 0, blocks = this.blocks;\n\n while (index < length) {\n if (this.hashed) {\n this.hashed = false;\n blocks[0] = this.block;\n blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n }\n\n if(notString) {\n for (i = this.start; index < length && i < 64; ++index) {\n blocks[i >> 2] |= message[index] << SHIFT[i++ & 3];\n }\n } else {\n for (i = this.start; index < length && i < 64; ++index) {\n code = message.charCodeAt(index);\n if (code < 0x80) {\n blocks[i >> 2] |= code << SHIFT[i++ & 3];\n } else if (code < 0x800) {\n blocks[i >> 2] |= (0xc0 | (code >> 6)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else if (code < 0xd800 || code >= 0xe000) {\n blocks[i >> 2] |= (0xe0 | (code >> 12)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n } else {\n code = 0x10000 + (((code & 0x3ff) << 10) | (message.charCodeAt(++index) & 0x3ff));\n blocks[i >> 2] |= (0xf0 | (code >> 18)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 12) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | ((code >> 6) & 0x3f)) << SHIFT[i++ & 3];\n blocks[i >> 2] |= (0x80 | (code & 0x3f)) << SHIFT[i++ & 3];\n }\n }\n }\n\n this.lastByteIndex = i;\n this.bytes += i - this.start;\n if (i >= 64) {\n this.block = blocks[16];\n this.start = i - 64;\n this.hash();\n this.hashed = true;\n } else {\n this.start = i;\n }\n }\n if (this.bytes > 4294967295) {\n this.hBytes += this.bytes / 4294967296 << 0;\n this.bytes = this.bytes % 4294967296;\n }\n return this;\n };\n\n Sha1.prototype.finalize = function () {\n if (this.finalized) {\n return;\n }\n this.finalized = true;\n var blocks = this.blocks, i = this.lastByteIndex;\n blocks[16] = this.block;\n blocks[i >> 2] |= EXTRA[i & 3];\n this.block = blocks[16];\n if (i >= 56) {\n if (!this.hashed) {\n this.hash();\n }\n blocks[0] = this.block;\n blocks[16] = blocks[1] = blocks[2] = blocks[3] =\n blocks[4] = blocks[5] = blocks[6] = blocks[7] =\n blocks[8] = blocks[9] = blocks[10] = blocks[11] =\n blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0;\n }\n blocks[14] = this.hBytes << 3 | this.bytes >>> 29;\n blocks[15] = this.bytes << 3;\n this.hash();\n };\n\n Sha1.prototype.hash = function () {\n var a = this.h0, b = this.h1, c = this.h2, d = this.h3, e = this.h4;\n var f, j, t, blocks = this.blocks;\n\n for(j = 16; j < 80; ++j) {\n t = blocks[j - 3] ^ blocks[j - 8] ^ blocks[j - 14] ^ blocks[j - 16];\n blocks[j] = (t << 1) | (t >>> 31);\n }\n\n for(j = 0; j < 20; j += 5) {\n f = (b & c) | ((~b) & d);\n t = (a << 5) | (a >>> 27);\n e = t + f + e + 1518500249 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = (a & b) | ((~a) & c);\n t = (e << 5) | (e >>> 27);\n d = t + f + d + 1518500249 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = (e & a) | ((~e) & b);\n t = (d << 5) | (d >>> 27);\n c = t + f + c + 1518500249 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = (d & e) | ((~d) & a);\n t = (c << 5) | (c >>> 27);\n b = t + f + b + 1518500249 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = (c & d) | ((~c) & e);\n t = (b << 5) | (b >>> 27);\n a = t + f + a + 1518500249 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n for(; j < 40; j += 5) {\n f = b ^ c ^ d;\n t = (a << 5) | (a >>> 27);\n e = t + f + e + 1859775393 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = a ^ b ^ c;\n t = (e << 5) | (e >>> 27);\n d = t + f + d + 1859775393 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = e ^ a ^ b;\n t = (d << 5) | (d >>> 27);\n c = t + f + c + 1859775393 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = d ^ e ^ a;\n t = (c << 5) | (c >>> 27);\n b = t + f + b + 1859775393 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = c ^ d ^ e;\n t = (b << 5) | (b >>> 27);\n a = t + f + a + 1859775393 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n for(; j < 60; j += 5) {\n f = (b & c) | (b & d) | (c & d);\n t = (a << 5) | (a >>> 27);\n e = t + f + e - 1894007588 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = (a & b) | (a & c) | (b & c);\n t = (e << 5) | (e >>> 27);\n d = t + f + d - 1894007588 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = (e & a) | (e & b) | (a & b);\n t = (d << 5) | (d >>> 27);\n c = t + f + c - 1894007588 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = (d & e) | (d & a) | (e & a);\n t = (c << 5) | (c >>> 27);\n b = t + f + b - 1894007588 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = (c & d) | (c & e) | (d & e);\n t = (b << 5) | (b >>> 27);\n a = t + f + a - 1894007588 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n for(; j < 80; j += 5) {\n f = b ^ c ^ d;\n t = (a << 5) | (a >>> 27);\n e = t + f + e - 899497514 + blocks[j] << 0;\n b = (b << 30) | (b >>> 2);\n\n f = a ^ b ^ c;\n t = (e << 5) | (e >>> 27);\n d = t + f + d - 899497514 + blocks[j + 1] << 0;\n a = (a << 30) | (a >>> 2);\n\n f = e ^ a ^ b;\n t = (d << 5) | (d >>> 27);\n c = t + f + c - 899497514 + blocks[j + 2] << 0;\n e = (e << 30) | (e >>> 2);\n\n f = d ^ e ^ a;\n t = (c << 5) | (c >>> 27);\n b = t + f + b - 899497514 + blocks[j + 3] << 0;\n d = (d << 30) | (d >>> 2);\n\n f = c ^ d ^ e;\n t = (b << 5) | (b >>> 27);\n a = t + f + a - 899497514 + blocks[j + 4] << 0;\n c = (c << 30) | (c >>> 2);\n }\n\n this.h0 = this.h0 + a << 0;\n this.h1 = this.h1 + b << 0;\n this.h2 = this.h2 + c << 0;\n this.h3 = this.h3 + d << 0;\n this.h4 = this.h4 + e << 0;\n };\n\n Sha1.prototype.hex = function () {\n this.finalize();\n\n var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4;\n\n return HEX_CHARS[(h0 >> 28) & 0x0F] + HEX_CHARS[(h0 >> 24) & 0x0F] +\n HEX_CHARS[(h0 >> 20) & 0x0F] + HEX_CHARS[(h0 >> 16) & 0x0F] +\n HEX_CHARS[(h0 >> 12) & 0x0F] + HEX_CHARS[(h0 >> 8) & 0x0F] +\n HEX_CHARS[(h0 >> 4) & 0x0F] + HEX_CHARS[h0 & 0x0F] +\n HEX_CHARS[(h1 >> 28) & 0x0F] + HEX_CHARS[(h1 >> 24) & 0x0F] +\n HEX_CHARS[(h1 >> 20) & 0x0F] + HEX_CHARS[(h1 >> 16) & 0x0F] +\n HEX_CHARS[(h1 >> 12) & 0x0F] + HEX_CHARS[(h1 >> 8) & 0x0F] +\n HEX_CHARS[(h1 >> 4) & 0x0F] + HEX_CHARS[h1 & 0x0F] +\n HEX_CHARS[(h2 >> 28) & 0x0F] + HEX_CHARS[(h2 >> 24) & 0x0F] +\n HEX_CHARS[(h2 >> 20) & 0x0F] + HEX_CHARS[(h2 >> 16) & 0x0F] +\n HEX_CHARS[(h2 >> 12) & 0x0F] + HEX_CHARS[(h2 >> 8) & 0x0F] +\n HEX_CHARS[(h2 >> 4) & 0x0F] + HEX_CHARS[h2 & 0x0F] +\n HEX_CHARS[(h3 >> 28) & 0x0F] + HEX_CHARS[(h3 >> 24) & 0x0F] +\n HEX_CHARS[(h3 >> 20) & 0x0F] + HEX_CHARS[(h3 >> 16) & 0x0F] +\n HEX_CHARS[(h3 >> 12) & 0x0F] + HEX_CHARS[(h3 >> 8) & 0x0F] +\n HEX_CHARS[(h3 >> 4) & 0x0F] + HEX_CHARS[h3 & 0x0F] +\n HEX_CHARS[(h4 >> 28) & 0x0F] + HEX_CHARS[(h4 >> 24) & 0x0F] +\n HEX_CHARS[(h4 >> 20) & 0x0F] + HEX_CHARS[(h4 >> 16) & 0x0F] +\n HEX_CHARS[(h4 >> 12) & 0x0F] + HEX_CHARS[(h4 >> 8) & 0x0F] +\n HEX_CHARS[(h4 >> 4) & 0x0F] + HEX_CHARS[h4 & 0x0F];\n };\n\n Sha1.prototype.toString = Sha1.prototype.hex;\n\n Sha1.prototype.digest = function () {\n this.finalize();\n\n var h0 = this.h0, h1 = this.h1, h2 = this.h2, h3 = this.h3, h4 = this.h4;\n\n return [\n (h0 >> 24) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 8) & 0xFF, h0 & 0xFF,\n (h1 >> 24) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 8) & 0xFF, h1 & 0xFF,\n (h2 >> 24) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 8) & 0xFF, h2 & 0xFF,\n (h3 >> 24) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 8) & 0xFF, h3 & 0xFF,\n (h4 >> 24) & 0xFF, (h4 >> 16) & 0xFF, (h4 >> 8) & 0xFF, h4 & 0xFF\n ];\n };\n\n Sha1.prototype.array = Sha1.prototype.digest;\n\n Sha1.prototype.arrayBuffer = function () {\n this.finalize();\n\n var buffer = new ArrayBuffer(20);\n var dataView = new DataView(buffer);\n dataView.setUint32(0, this.h0);\n dataView.setUint32(4, this.h1);\n dataView.setUint32(8, this.h2);\n dataView.setUint32(12, this.h3);\n dataView.setUint32(16, this.h4);\n return buffer;\n };\n\n var exports = createMethod();\n\n if (COMMON_JS) {\n module.exports = exports;\n } else {\n root.sha1 = exports;\n if (AMD) {\n define(function () {\n return exports;\n });\n }\n }\n})();\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nmodule.exports = function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"<scheme>://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d\\+\\-\\.]*:)?\\/\\//i.test(url);\n};\n","'use strict';\n\nmodule.exports = function bind(fn, thisArg) {\n return function wrap() {\n var args = new Array(arguments.length);\n for (var i = 0; i < args.length; i++) {\n args[i] = arguments[i];\n }\n return fn.apply(thisArg, args);\n };\n};\n","/*\n * DOM Level 2\n * Object DOMException\n * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html\n */\n\nfunction copy(src,dest){\n\tfor(var p in src){\n\t\tdest[p] = src[p];\n\t}\n}\n/**\n^\\w+\\.prototype\\.([_\\w]+)\\s*=\\s*((?:.*\\{\\s*?[\\r\\n][\\s\\S]*?^})|\\S.*?(?=[;\\r\\n]));?\n^\\w+\\.prototype\\.([_\\w]+)\\s*=\\s*(\\S.*?(?=[;\\r\\n]));?\n */\nfunction _extends(Class,Super){\n\tvar pt = Class.prototype;\n\tif(Object.create){\n\t\tvar ppt = Object.create(Super.prototype)\n\t\tpt.__proto__ = ppt;\n\t}\n\tif(!(pt instanceof Super)){\n\t\tfunction t(){};\n\t\tt.prototype = Super.prototype;\n\t\tt = new t();\n\t\tcopy(pt,t);\n\t\tClass.prototype = pt = t;\n\t}\n\tif(pt.constructor != Class){\n\t\tif(typeof Class != 'function'){\n\t\t\tconsole.error(\"unknow Class:\"+Class)\n\t\t}\n\t\tpt.constructor = Class\n\t}\n}\nvar htmlns = 'http://www.w3.org/1999/xhtml' ;\n// Node Types\nvar NodeType = {}\nvar ELEMENT_NODE = NodeType.ELEMENT_NODE = 1;\nvar ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2;\nvar TEXT_NODE = NodeType.TEXT_NODE = 3;\nvar CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4;\nvar ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5;\nvar ENTITY_NODE = NodeType.ENTITY_NODE = 6;\nvar PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7;\nvar COMMENT_NODE = NodeType.COMMENT_NODE = 8;\nvar DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9;\nvar DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10;\nvar DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11;\nvar NOTATION_NODE = NodeType.NOTATION_NODE = 12;\n\n// ExceptionCode\nvar ExceptionCode = {}\nvar ExceptionMessage = {};\nvar INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = ((ExceptionMessage[1]=\"Index size error\"),1);\nvar DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]=\"DOMString size error\"),2);\nvar HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]=\"Hierarchy request error\"),3);\nvar WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]=\"Wrong document\"),4);\nvar INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]=\"Invalid character\"),5);\nvar NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]=\"No data allowed\"),6);\nvar NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]=\"No modification allowed\"),7);\nvar NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]=\"Not found\"),8);\nvar NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]=\"Not supported\"),9);\nvar INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]=\"Attribute in use\"),10);\n//level2\nvar INVALID_STATE_ERR \t= ExceptionCode.INVALID_STATE_ERR \t= ((ExceptionMessage[11]=\"Invalid state\"),11);\nvar SYNTAX_ERR \t= ExceptionCode.SYNTAX_ERR \t= ((ExceptionMessage[12]=\"Syntax error\"),12);\nvar INVALID_MODIFICATION_ERR \t= ExceptionCode.INVALID_MODIFICATION_ERR \t= ((ExceptionMessage[13]=\"Invalid modification\"),13);\nvar NAMESPACE_ERR \t= ExceptionCode.NAMESPACE_ERR \t= ((ExceptionMessage[14]=\"Invalid namespace\"),14);\nvar INVALID_ACCESS_ERR \t= ExceptionCode.INVALID_ACCESS_ERR \t= ((ExceptionMessage[15]=\"Invalid access\"),15);\n\n\nfunction DOMException(code, message) {\n\tif(message instanceof Error){\n\t\tvar error = message;\n\t}else{\n\t\terror = this;\n\t\tError.call(this, ExceptionMessage[code]);\n\t\tthis.message = ExceptionMessage[code];\n\t\tif(Error.captureStackTrace) Error.captureStackTrace(this, DOMException);\n\t}\n\terror.code = code;\n\tif(message) this.message = this.message + \": \" + message;\n\treturn error;\n};\nDOMException.prototype = Error.prototype;\ncopy(ExceptionCode,DOMException)\n/**\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177\n * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live.\n * The items in the NodeList are accessible via an integral index, starting from 0.\n */\nfunction NodeList() {\n};\nNodeList.prototype = {\n\t/**\n\t * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.\n\t * @standard level1\n\t */\n\tlength:0, \n\t/**\n\t * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.\n\t * @standard level1\n\t * @param index unsigned long \n\t * Index into the collection.\n\t * @return Node\n\t * \tThe node at the indexth position in the NodeList, or null if that is not a valid index. \n\t */\n\titem: function(index) {\n\t\treturn this[index] || null;\n\t},\n\ttoString:function(isHTML,nodeFilter){\n\t\tfor(var buf = [], i = 0;i<this.length;i++){\n\t\t\tserializeToString(this[i],buf,isHTML,nodeFilter);\n\t\t}\n\t\treturn buf.join('');\n\t}\n};\nfunction LiveNodeList(node,refresh){\n\tthis._node = node;\n\tthis._refresh = refresh\n\t_updateLiveList(this);\n}\nfunction _updateLiveList(list){\n\tvar inc = list._node._inc || list._node.ownerDocument._inc;\n\tif(list._inc != inc){\n\t\tvar ls = list._refresh(list._node);\n\t\t//console.log(ls.length)\n\t\t__set__(list,'length',ls.length);\n\t\tcopy(ls,list);\n\t\tlist._inc = inc;\n\t}\n}\nLiveNodeList.prototype.item = function(i){\n\t_updateLiveList(this);\n\treturn this[i];\n}\n\n_extends(LiveNodeList,NodeList);\n/**\n * \n * Objects implementing the NamedNodeMap interface are used to represent collections of nodes that can be accessed by name. Note that NamedNodeMap does not inherit from NodeList; NamedNodeMaps are not maintained in any particular order. Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index, but this is simply to allow convenient enumeration of the contents of a NamedNodeMap, and does not imply that the DOM specifies an order to these Nodes.\n * NamedNodeMap objects in the DOM are live.\n * used for attributes or DocumentType entities \n */\nfunction NamedNodeMap() {\n};\n\nfunction _findNodeIndex(list,node){\n\tvar i = list.length;\n\twhile(i--){\n\t\tif(list[i] === node){return i}\n\t}\n}\n\nfunction _addNamedNode(el,list,newAttr,oldAttr){\n\tif(oldAttr){\n\t\tlist[_findNodeIndex(list,oldAttr)] = newAttr;\n\t}else{\n\t\tlist[list.length++] = newAttr;\n\t}\n\tif(el){\n\t\tnewAttr.ownerElement = el;\n\t\tvar doc = el.ownerDocument;\n\t\tif(doc){\n\t\t\toldAttr && _onRemoveAttribute(doc,el,oldAttr);\n\t\t\t_onAddAttribute(doc,el,newAttr);\n\t\t}\n\t}\n}\nfunction _removeNamedNode(el,list,attr){\n\t//console.log('remove attr:'+attr)\n\tvar i = _findNodeIndex(list,attr);\n\tif(i>=0){\n\t\tvar lastIndex = list.length-1\n\t\twhile(i<lastIndex){\n\t\t\tlist[i] = list[++i]\n\t\t}\n\t\tlist.length = lastIndex;\n\t\tif(el){\n\t\t\tvar doc = el.ownerDocument;\n\t\t\tif(doc){\n\t\t\t\t_onRemoveAttribute(doc,el,attr);\n\t\t\t\tattr.ownerElement = null;\n\t\t\t}\n\t\t}\n\t}else{\n\t\tthrow DOMException(NOT_FOUND_ERR,new Error(el.tagName+'@'+attr))\n\t}\n}\nNamedNodeMap.prototype = {\n\tlength:0,\n\titem:NodeList.prototype.item,\n\tgetNamedItem: function(key) {\n//\t\tif(key.indexOf(':')>0 || key == 'xmlns'){\n//\t\t\treturn null;\n//\t\t}\n\t\t//console.log()\n\t\tvar i = this.length;\n\t\twhile(i--){\n\t\t\tvar attr = this[i];\n\t\t\t//console.log(attr.nodeName,key)\n\t\t\tif(attr.nodeName == key){\n\t\t\t\treturn attr;\n\t\t\t}\n\t\t}\n\t},\n\tsetNamedItem: function(attr) {\n\t\tvar el = attr.ownerElement;\n\t\tif(el && el!=this._ownerElement){\n\t\t\tthrow new DOMException(INUSE_ATTRIBUTE_ERR);\n\t\t}\n\t\tvar oldAttr = this.getNamedItem(attr.nodeName);\n\t\t_addNamedNode(this._ownerElement,this,attr,oldAttr);\n\t\treturn oldAttr;\n\t},\n\t/* returns Node */\n\tsetNamedItemNS: function(attr) {// raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR\n\t\tvar el = attr.ownerElement, oldAttr;\n\t\tif(el && el!=this._ownerElement){\n\t\t\tthrow new DOMException(INUSE_ATTRIBUTE_ERR);\n\t\t}\n\t\toldAttr = this.getNamedItemNS(attr.namespaceURI,attr.localName);\n\t\t_addNamedNode(this._ownerElement,this,attr,oldAttr);\n\t\treturn oldAttr;\n\t},\n\n\t/* returns Node */\n\tremoveNamedItem: function(key) {\n\t\tvar attr = this.getNamedItem(key);\n\t\t_removeNamedNode(this._ownerElement,this,attr);\n\t\treturn attr;\n\t\t\n\t\t\n\t},// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR\n\t\n\t//for level2\n\tremoveNamedItemNS:function(namespaceURI,localName){\n\t\tvar attr = this.getNamedItemNS(namespaceURI,localName);\n\t\t_removeNamedNode(this._ownerElement,this,attr);\n\t\treturn attr;\n\t},\n\tgetNamedItemNS: function(namespaceURI, localName) {\n\t\tvar i = this.length;\n\t\twhile(i--){\n\t\t\tvar node = this[i];\n\t\t\tif(node.localName == localName && node.namespaceURI == namespaceURI){\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n};\n/**\n * @see http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490\n */\nfunction DOMImplementation(/* Object */ features) {\n\tthis._features = {};\n\tif (features) {\n\t\tfor (var feature in features) {\n\t\t\t this._features = features[feature];\n\t\t}\n\t}\n};\n\nDOMImplementation.prototype = {\n\thasFeature: function(/* string */ feature, /* string */ version) {\n\t\tvar versions = this._features[feature.toLowerCase()];\n\t\tif (versions && (!version || version in versions)) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t},\n\t// Introduced in DOM Level 2:\n\tcreateDocument:function(namespaceURI, qualifiedName, doctype){// raises:INVALID_CHARACTER_ERR,NAMESPACE_ERR,WRONG_DOCUMENT_ERR\n\t\tvar doc = new Document();\n\t\tdoc.implementation = this;\n\t\tdoc.childNodes = new NodeList();\n\t\tdoc.doctype = doctype;\n\t\tif(doctype){\n\t\t\tdoc.appendChild(doctype);\n\t\t}\n\t\tif(qualifiedName){\n\t\t\tvar root = doc.createElementNS(namespaceURI,qualifiedName);\n\t\t\tdoc.appendChild(root);\n\t\t}\n\t\treturn doc;\n\t},\n\t// Introduced in DOM Level 2:\n\tcreateDocumentType:function(qualifiedName, publicId, systemId){// raises:INVALID_CHARACTER_ERR,NAMESPACE_ERR\n\t\tvar node = new DocumentType();\n\t\tnode.name = qualifiedName;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.publicId = publicId;\n\t\tnode.systemId = systemId;\n\t\t// Introduced in DOM Level 2:\n\t\t//readonly attribute DOMString internalSubset;\n\t\t\n\t\t//TODO:..\n\t\t// readonly attribute NamedNodeMap entities;\n\t\t// readonly attribute NamedNodeMap notations;\n\t\treturn node;\n\t}\n};\n\n\n/**\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247\n */\n\nfunction Node() {\n};\n\nNode.prototype = {\n\tfirstChild : null,\n\tlastChild : null,\n\tpreviousSibling : null,\n\tnextSibling : null,\n\tattributes : null,\n\tparentNode : null,\n\tchildNodes : null,\n\townerDocument : null,\n\tnodeValue : null,\n\tnamespaceURI : null,\n\tprefix : null,\n\tlocalName : null,\n\t// Modified in DOM Level 2:\n\tinsertBefore:function(newChild, refChild){//raises \n\t\treturn _insertBefore(this,newChild,refChild);\n\t},\n\treplaceChild:function(newChild, oldChild){//raises \n\t\tthis.insertBefore(newChild,oldChild);\n\t\tif(oldChild){\n\t\t\tthis.removeChild(oldChild);\n\t\t}\n\t},\n\tremoveChild:function(oldChild){\n\t\treturn _removeChild(this,oldChild);\n\t},\n\tappendChild:function(newChild){\n\t\treturn this.insertBefore(newChild,null);\n\t},\n\thasChildNodes:function(){\n\t\treturn this.firstChild != null;\n\t},\n\tcloneNode:function(deep){\n\t\treturn cloneNode(this.ownerDocument||this,this,deep);\n\t},\n\t// Modified in DOM Level 2:\n\tnormalize:function(){\n\t\tvar child = this.firstChild;\n\t\twhile(child){\n\t\t\tvar next = child.nextSibling;\n\t\t\tif(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){\n\t\t\t\tthis.removeChild(next);\n\t\t\t\tchild.appendData(next.data);\n\t\t\t}else{\n\t\t\t\tchild.normalize();\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t}\n\t},\n \t// Introduced in DOM Level 2:\n\tisSupported:function(feature, version){\n\t\treturn this.ownerDocument.implementation.hasFeature(feature,version);\n\t},\n // Introduced in DOM Level 2:\n hasAttributes:function(){\n \treturn this.attributes.length>0;\n },\n lookupPrefix:function(namespaceURI){\n \tvar el = this;\n \twhile(el){\n \t\tvar map = el._nsMap;\n \t\t//console.dir(map)\n \t\tif(map){\n \t\t\tfor(var n in map){\n \t\t\t\tif(map[n] == namespaceURI){\n \t\t\t\t\treturn n;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tel = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;\n \t}\n \treturn null;\n },\n // Introduced in DOM Level 3:\n lookupNamespaceURI:function(prefix){\n \tvar el = this;\n \twhile(el){\n \t\tvar map = el._nsMap;\n \t\t//console.dir(map)\n \t\tif(map){\n \t\t\tif(prefix in map){\n \t\t\t\treturn map[prefix] ;\n \t\t\t}\n \t\t}\n \t\tel = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;\n \t}\n \treturn null;\n },\n // Introduced in DOM Level 3:\n isDefaultNamespace:function(namespaceURI){\n \tvar prefix = this.lookupPrefix(namespaceURI);\n \treturn prefix == null;\n }\n};\n\n\nfunction _xmlEncoder(c){\n\treturn c == '<' && '<' ||\n c == '>' && '>' ||\n c == '&' && '&' ||\n c == '\"' && '"' ||\n '&#'+c.charCodeAt()+';'\n}\n\n\ncopy(NodeType,Node);\ncopy(NodeType,Node.prototype);\n\n/**\n * @param callback return true for continue,false for break\n * @return boolean true: break visit;\n */\nfunction _visitNode(node,callback){\n\tif(callback(node)){\n\t\treturn true;\n\t}\n\tif(node = node.firstChild){\n\t\tdo{\n\t\t\tif(_visitNode(node,callback)){return true}\n }while(node=node.nextSibling)\n }\n}\n\n\n\nfunction Document(){\n}\nfunction _onAddAttribute(doc,el,newAttr){\n\tdoc && doc._inc++;\n\tvar ns = newAttr.namespaceURI ;\n\tif(ns == 'http://www.w3.org/2000/xmlns/'){\n\t\t//update namespace\n\t\tel._nsMap[newAttr.prefix?newAttr.localName:''] = newAttr.value\n\t}\n}\nfunction _onRemoveAttribute(doc,el,newAttr,remove){\n\tdoc && doc._inc++;\n\tvar ns = newAttr.namespaceURI ;\n\tif(ns == 'http://www.w3.org/2000/xmlns/'){\n\t\t//update namespace\n\t\tdelete el._nsMap[newAttr.prefix?newAttr.localName:'']\n\t}\n}\nfunction _onUpdateChild(doc,el,newChild){\n\tif(doc && doc._inc){\n\t\tdoc._inc++;\n\t\t//update childNodes\n\t\tvar cs = el.childNodes;\n\t\tif(newChild){\n\t\t\tcs[cs.length++] = newChild;\n\t\t}else{\n\t\t\t//console.log(1)\n\t\t\tvar child = el.firstChild;\n\t\t\tvar i = 0;\n\t\t\twhile(child){\n\t\t\t\tcs[i++] = child;\n\t\t\t\tchild =child.nextSibling;\n\t\t\t}\n\t\t\tcs.length = i;\n\t\t}\n\t}\n}\n\n/**\n * attributes;\n * children;\n * \n * writeable properties:\n * nodeValue,Attr:value,CharacterData:data\n * prefix\n */\nfunction _removeChild(parentNode,child){\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif(previous){\n\t\tprevious.nextSibling = next;\n\t}else{\n\t\tparentNode.firstChild = next\n\t}\n\tif(next){\n\t\tnext.previousSibling = previous;\n\t}else{\n\t\tparentNode.lastChild = previous;\n\t}\n\t_onUpdateChild(parentNode.ownerDocument,parentNode);\n\treturn child;\n}\n/**\n * preformance key(refChild == null)\n */\nfunction _insertBefore(parentNode,newChild,nextChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tcp.removeChild(newChild);//remove and update\n\t}\n\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = newChild.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn newChild;\n\t\t}\n\t\tvar newLast = newChild.lastChild;\n\t}else{\n\t\tnewFirst = newLast = newChild;\n\t}\n\tvar pre = nextChild ? nextChild.previousSibling : parentNode.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = nextChild;\n\t\n\t\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparentNode.firstChild = newFirst;\n\t}\n\tif(nextChild == null){\n\t\tparentNode.lastChild = newLast;\n\t}else{\n\t\tnextChild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parentNode;\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parentNode.ownerDocument||parentNode,parentNode);\n\t//console.log(parentNode.lastChild.nextSibling == null)\n\tif (newChild.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnewChild.firstChild = newChild.lastChild = null;\n\t}\n\treturn newChild;\n}\nfunction _appendSingleChild(parentNode,newChild){\n\tvar cp = newChild.parentNode;\n\tif(cp){\n\t\tvar pre = parentNode.lastChild;\n\t\tcp.removeChild(newChild);//remove and update\n\t\tvar pre = parentNode.lastChild;\n\t}\n\tvar pre = parentNode.lastChild;\n\tnewChild.parentNode = parentNode;\n\tnewChild.previousSibling = pre;\n\tnewChild.nextSibling = null;\n\tif(pre){\n\t\tpre.nextSibling = newChild;\n\t}else{\n\t\tparentNode.firstChild = newChild;\n\t}\n\tparentNode.lastChild = newChild;\n\t_onUpdateChild(parentNode.ownerDocument,parentNode,newChild);\n\treturn newChild;\n\t//console.log(\"__aa\",parentNode.lastChild.nextSibling == null)\n}\nDocument.prototype = {\n\t//implementation : null,\n\tnodeName : '#document',\n\tnodeType : DOCUMENT_NODE,\n\tdoctype : null,\n\tdocumentElement : null,\n\t_inc : 1,\n\t\n\tinsertBefore : function(newChild, refChild){//raises \n\t\tif(newChild.nodeType == DOCUMENT_FRAGMENT_NODE){\n\t\t\tvar child = newChild.firstChild;\n\t\t\twhile(child){\n\t\t\t\tvar next = child.nextSibling;\n\t\t\t\tthis.insertBefore(child,refChild);\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t\treturn newChild;\n\t\t}\n\t\tif(this.documentElement == null && newChild.nodeType == ELEMENT_NODE){\n\t\t\tthis.documentElement = newChild;\n\t\t}\n\t\t\n\t\treturn _insertBefore(this,newChild,refChild),(newChild.ownerDocument = this),newChild;\n\t},\n\tremoveChild : function(oldChild){\n\t\tif(this.documentElement == oldChild){\n\t\t\tthis.documentElement = null;\n\t\t}\n\t\treturn _removeChild(this,oldChild);\n\t},\n\t// Introduced in DOM Level 2:\n\timportNode : function(importedNode,deep){\n\t\treturn importNode(this,importedNode,deep);\n\t},\n\t// Introduced in DOM Level 2:\n\tgetElementById :\tfunction(id){\n\t\tvar rtv = null;\n\t\t_visitNode(this.documentElement,function(node){\n\t\t\tif(node.nodeType == ELEMENT_NODE){\n\t\t\t\tif(node.getAttribute('id') == id){\n\t\t\t\t\trtv = node;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\treturn rtv;\n\t},\n\t\n\t//document factory method:\n\tcreateElement :\tfunction(tagName){\n\t\tvar node = new Element();\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = tagName;\n\t\tnode.tagName = tagName;\n\t\tnode.childNodes = new NodeList();\n\t\tvar attrs\t= node.attributes = new NamedNodeMap();\n\t\tattrs._ownerElement = node;\n\t\treturn node;\n\t},\n\tcreateDocumentFragment :\tfunction(){\n\t\tvar node = new DocumentFragment();\n\t\tnode.ownerDocument = this;\n\t\tnode.childNodes = new NodeList();\n\t\treturn node;\n\t},\n\tcreateTextNode :\tfunction(data){\n\t\tvar node = new Text();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateComment :\tfunction(data){\n\t\tvar node = new Comment();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateCDATASection :\tfunction(data){\n\t\tvar node = new CDATASection();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateProcessingInstruction :\tfunction(target,data){\n\t\tvar node = new ProcessingInstruction();\n\t\tnode.ownerDocument = this;\n\t\tnode.tagName = node.target = target;\n\t\tnode.nodeValue= node.data = data;\n\t\treturn node;\n\t},\n\tcreateAttribute :\tfunction(name){\n\t\tvar node = new Attr();\n\t\tnode.ownerDocument\t= this;\n\t\tnode.name = name;\n\t\tnode.nodeName\t= name;\n\t\tnode.localName = name;\n\t\tnode.specified = true;\n\t\treturn node;\n\t},\n\tcreateEntityReference :\tfunction(name){\n\t\tvar node = new EntityReference();\n\t\tnode.ownerDocument\t= this;\n\t\tnode.nodeName\t= name;\n\t\treturn node;\n\t},\n\t// Introduced in DOM Level 2:\n\tcreateElementNS :\tfunction(namespaceURI,qualifiedName){\n\t\tvar node = new Element();\n\t\tvar pl = qualifiedName.split(':');\n\t\tvar attrs\t= node.attributes = new NamedNodeMap();\n\t\tnode.childNodes = new NodeList();\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.tagName = qualifiedName;\n\t\tnode.namespaceURI = namespaceURI;\n\t\tif(pl.length == 2){\n\t\t\tnode.prefix = pl[0];\n\t\t\tnode.localName = pl[1];\n\t\t}else{\n\t\t\t//el.prefix = null;\n\t\t\tnode.localName = qualifiedName;\n\t\t}\n\t\tattrs._ownerElement = node;\n\t\treturn node;\n\t},\n\t// Introduced in DOM Level 2:\n\tcreateAttributeNS :\tfunction(namespaceURI,qualifiedName){\n\t\tvar node = new Attr();\n\t\tvar pl = qualifiedName.split(':');\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.name = qualifiedName;\n\t\tnode.namespaceURI = namespaceURI;\n\t\tnode.specified = true;\n\t\tif(pl.length == 2){\n\t\t\tnode.prefix = pl[0];\n\t\t\tnode.localName = pl[1];\n\t\t}else{\n\t\t\t//el.prefix = null;\n\t\t\tnode.localName = qualifiedName;\n\t\t}\n\t\treturn node;\n\t}\n};\n_extends(Document,Node);\n\n\nfunction Element() {\n\tthis._nsMap = {};\n};\nElement.prototype = {\n\tnodeType : ELEMENT_NODE,\n\thasAttribute : function(name){\n\t\treturn this.getAttributeNode(name)!=null;\n\t},\n\tgetAttribute : function(name){\n\t\tvar attr = this.getAttributeNode(name);\n\t\treturn attr && attr.value || '';\n\t},\n\tgetAttributeNode : function(name){\n\t\treturn this.attributes.getNamedItem(name);\n\t},\n\tsetAttribute : function(name, value){\n\t\tvar attr = this.ownerDocument.createAttribute(name);\n\t\tattr.value = attr.nodeValue = \"\" + value;\n\t\tthis.setAttributeNode(attr)\n\t},\n\tremoveAttribute : function(name){\n\t\tvar attr = this.getAttributeNode(name)\n\t\tattr && this.removeAttributeNode(attr);\n\t},\n\t\n\t//four real opeartion method\n\tappendChild:function(newChild){\n\t\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\t\treturn this.insertBefore(newChild,null);\n\t\t}else{\n\t\t\treturn _appendSingleChild(this,newChild);\n\t\t}\n\t},\n\tsetAttributeNode : function(newAttr){\n\t\treturn this.attributes.setNamedItem(newAttr);\n\t},\n\tsetAttributeNodeNS : function(newAttr){\n\t\treturn this.attributes.setNamedItemNS(newAttr);\n\t},\n\tremoveAttributeNode : function(oldAttr){\n\t\t//console.log(this == oldAttr.ownerElement)\n\t\treturn this.attributes.removeNamedItem(oldAttr.nodeName);\n\t},\n\t//get real attribute name,and remove it by removeAttributeNode\n\tremoveAttributeNS : function(namespaceURI, localName){\n\t\tvar old = this.getAttributeNodeNS(namespaceURI, localName);\n\t\told && this.removeAttributeNode(old);\n\t},\n\t\n\thasAttributeNS : function(namespaceURI, localName){\n\t\treturn this.getAttributeNodeNS(namespaceURI, localName)!=null;\n\t},\n\tgetAttributeNS : function(namespaceURI, localName){\n\t\tvar attr = this.getAttributeNodeNS(namespaceURI, localName);\n\t\treturn attr && attr.value || '';\n\t},\n\tsetAttributeNS : function(namespaceURI, qualifiedName, value){\n\t\tvar attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);\n\t\tattr.value = attr.nodeValue = \"\" + value;\n\t\tthis.setAttributeNode(attr)\n\t},\n\tgetAttributeNodeNS : function(namespaceURI, localName){\n\t\treturn this.attributes.getNamedItemNS(namespaceURI, localName);\n\t},\n\t\n\tgetElementsByTagName : function(tagName){\n\t\treturn new LiveNodeList(this,function(base){\n\t\t\tvar ls = [];\n\t\t\t_visitNode(base,function(node){\n\t\t\t\tif(node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)){\n\t\t\t\t\tls.push(node);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ls;\n\t\t});\n\t},\n\tgetElementsByTagNameNS : function(namespaceURI, localName){\n\t\treturn new LiveNodeList(this,function(base){\n\t\t\tvar ls = [];\n\t\t\t_visitNode(base,function(node){\n\t\t\t\tif(node !== base && node.nodeType === ELEMENT_NODE && (namespaceURI === '*' || node.namespaceURI === namespaceURI) && (localName === '*' || node.localName == localName)){\n\t\t\t\t\tls.push(node);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ls;\n\t\t\t\n\t\t});\n\t}\n};\nDocument.prototype.getElementsByTagName = Element.prototype.getElementsByTagName;\nDocument.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS;\n\n\n_extends(Element,Node);\nfunction Attr() {\n};\nAttr.prototype.nodeType = ATTRIBUTE_NODE;\n_extends(Attr,Node);\n\n\nfunction CharacterData() {\n};\nCharacterData.prototype = {\n\tdata : '',\n\tsubstringData : function(offset, count) {\n\t\treturn this.data.substring(offset, offset+count);\n\t},\n\tappendData: function(text) {\n\t\ttext = this.data+text;\n\t\tthis.nodeValue = this.data = text;\n\t\tthis.length = text.length;\n\t},\n\tinsertData: function(offset,text) {\n\t\tthis.replaceData(offset,0,text);\n\t\n\t},\n\tappendChild:function(newChild){\n\t\tthrow new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])\n\t},\n\tdeleteData: function(offset, count) {\n\t\tthis.replaceData(offset,count,\"\");\n\t},\n\treplaceData: function(offset, count, text) {\n\t\tvar start = this.data.substring(0,offset);\n\t\tvar end = this.data.substring(offset+count);\n\t\ttext = start + text + end;\n\t\tthis.nodeValue = this.data = text;\n\t\tthis.length = text.length;\n\t}\n}\n_extends(CharacterData,Node);\nfunction Text() {\n};\nText.prototype = {\n\tnodeName : \"#text\",\n\tnodeType : TEXT_NODE,\n\tsplitText : function(offset) {\n\t\tvar text = this.data;\n\t\tvar newText = text.substring(offset);\n\t\ttext = text.substring(0, offset);\n\t\tthis.data = this.nodeValue = text;\n\t\tthis.length = text.length;\n\t\tvar newNode = this.ownerDocument.createTextNode(newText);\n\t\tif(this.parentNode){\n\t\t\tthis.parentNode.insertBefore(newNode, this.nextSibling);\n\t\t}\n\t\treturn newNode;\n\t}\n}\n_extends(Text,CharacterData);\nfunction Comment() {\n};\nComment.prototype = {\n\tnodeName : \"#comment\",\n\tnodeType : COMMENT_NODE\n}\n_extends(Comment,CharacterData);\n\nfunction CDATASection() {\n};\nCDATASection.prototype = {\n\tnodeName : \"#cdata-section\",\n\tnodeType : CDATA_SECTION_NODE\n}\n_extends(CDATASection,CharacterData);\n\n\nfunction DocumentType() {\n};\nDocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;\n_extends(DocumentType,Node);\n\nfunction Notation() {\n};\nNotation.prototype.nodeType = NOTATION_NODE;\n_extends(Notation,Node);\n\nfunction Entity() {\n};\nEntity.prototype.nodeType = ENTITY_NODE;\n_extends(Entity,Node);\n\nfunction EntityReference() {\n};\nEntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;\n_extends(EntityReference,Node);\n\nfunction DocumentFragment() {\n};\nDocumentFragment.prototype.nodeName =\t\"#document-fragment\";\nDocumentFragment.prototype.nodeType =\tDOCUMENT_FRAGMENT_NODE;\n_extends(DocumentFragment,Node);\n\n\nfunction ProcessingInstruction() {\n}\nProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;\n_extends(ProcessingInstruction,Node);\nfunction XMLSerializer(){}\nXMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){\n\treturn nodeSerializeToString.call(node,isHtml,nodeFilter);\n}\nNode.prototype.toString = nodeSerializeToString;\nfunction nodeSerializeToString(isHtml,nodeFilter){\n\tvar buf = [];\n\tvar refNode = this.nodeType == 9?this.documentElement:this;\n\tvar prefix = refNode.prefix;\n\tvar uri = refNode.namespaceURI;\n\t\n\tif(uri && prefix == null){\n\t\t//console.log(prefix)\n\t\tvar prefix = refNode.lookupPrefix(uri);\n\t\tif(prefix == null){\n\t\t\t//isHTML = true;\n\t\t\tvar visibleNamespaces=[\n\t\t\t{namespace:uri,prefix:null}\n\t\t\t//{namespace:uri,prefix:''}\n\t\t\t]\n\t\t}\n\t}\n\tserializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);\n\t//console.log('###',this.nodeType,uri,prefix,buf.join(''))\n\treturn buf.join('');\n}\nfunction needNamespaceDefine(node,isHTML, visibleNamespaces) {\n\tvar prefix = node.prefix||'';\n\tvar uri = node.namespaceURI;\n\tif (!prefix && !uri){\n\t\treturn false;\n\t}\n\tif (prefix === \"xml\" && uri === \"http://www.w3.org/XML/1998/namespace\" \n\t\t|| uri == 'http://www.w3.org/2000/xmlns/'){\n\t\treturn false;\n\t}\n\t\n\tvar i = visibleNamespaces.length \n\t//console.log('@@@@',node.tagName,prefix,uri,visibleNamespaces)\n\twhile (i--) {\n\t\tvar ns = visibleNamespaces[i];\n\t\t// get namespace prefix\n\t\t//console.log(node.nodeType,node.tagName,ns.prefix,prefix)\n\t\tif (ns.prefix == prefix){\n\t\t\treturn ns.namespace != uri;\n\t\t}\n\t}\n\t//console.log(isHTML,uri,prefix=='')\n\t//if(isHTML && prefix ==null && uri == 'http://www.w3.org/1999/xhtml'){\n\t//\treturn false;\n\t//}\n\t//node.flag = '11111'\n\t//console.error(3,true,node.flag,node.prefix,node.namespaceURI)\n\treturn true;\n}\nfunction serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){\n\tif(nodeFilter){\n\t\tnode = nodeFilter(node);\n\t\tif(node){\n\t\t\tif(typeof node == 'string'){\n\t\t\t\tbuf.push(node);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}else{\n\t\t\treturn;\n\t\t}\n\t\t//buf.sort.apply(attrs, attributeSorter);\n\t}\n\tswitch(node.nodeType){\n\tcase ELEMENT_NODE:\n\t\tif (!visibleNamespaces) visibleNamespaces = [];\n\t\tvar startVisibleNamespaces = visibleNamespaces.length;\n\t\tvar attrs = node.attributes;\n\t\tvar len = attrs.length;\n\t\tvar child = node.firstChild;\n\t\tvar nodeName = node.tagName;\n\t\t\n\t\tisHTML = (htmlns === node.namespaceURI) ||isHTML \n\t\tbuf.push('<',nodeName);\n\t\t\n\t\t\n\t\t\n\t\tfor(var i=0;i<len;i++){\n\t\t\t// add namespaces for attributes\n\t\t\tvar attr = attrs.item(i);\n\t\t\tif (attr.prefix == 'xmlns') {\n\t\t\t\tvisibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });\n\t\t\t}else if(attr.nodeName == 'xmlns'){\n\t\t\t\tvisibleNamespaces.push({ prefix: '', namespace: attr.value });\n\t\t\t}\n\t\t}\n\t\tfor(var i=0;i<len;i++){\n\t\t\tvar attr = attrs.item(i);\n\t\t\tif (needNamespaceDefine(attr,isHTML, visibleNamespaces)) {\n\t\t\t\tvar prefix = attr.prefix||'';\n\t\t\t\tvar uri = attr.namespaceURI;\n\t\t\t\tvar ns = prefix ? ' xmlns:' + prefix : \" xmlns\";\n\t\t\t\tbuf.push(ns, '=\"' , uri , '\"');\n\t\t\t\tvisibleNamespaces.push({ prefix: prefix, namespace:uri });\n\t\t\t}\n\t\t\tserializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);\n\t\t}\n\t\t// add namespace for current node\t\t\n\t\tif (needNamespaceDefine(node,isHTML, visibleNamespaces)) {\n\t\t\tvar prefix = node.prefix||'';\n\t\t\tvar uri = node.namespaceURI;\n\t\t\tvar ns = prefix ? ' xmlns:' + prefix : \" xmlns\";\n\t\t\tbuf.push(ns, '=\"' , uri , '\"');\n\t\t\tvisibleNamespaces.push({ prefix: prefix, namespace:uri });\n\t\t}\n\t\t\n\t\tif(child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){\n\t\t\tbuf.push('>');\n\t\t\t//if is cdata child node\n\t\t\tif(isHTML && /^script$/i.test(nodeName)){\n\t\t\t\twhile(child){\n\t\t\t\t\tif(child.data){\n\t\t\t\t\t\tbuf.push(child.data);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tserializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces);\n\t\t\t\t\t}\n\t\t\t\t\tchild = child.nextSibling;\n\t\t\t\t}\n\t\t\t}else\n\t\t\t{\n\t\t\t\twhile(child){\n\t\t\t\t\tserializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces);\n\t\t\t\t\tchild = child.nextSibling;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuf.push('</',nodeName,'>');\n\t\t}else{\n\t\t\tbuf.push('/>');\n\t\t}\n\t\t// remove added visible namespaces\n\t\t//visibleNamespaces.length = startVisibleNamespaces;\n\t\treturn;\n\tcase DOCUMENT_NODE:\n\tcase DOCUMENT_FRAGMENT_NODE:\n\t\tvar child = node.firstChild;\n\t\twhile(child){\n\t\t\tserializeToString(child,buf,isHTML,nodeFilter,visibleNamespaces);\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t\treturn;\n\tcase ATTRIBUTE_NODE:\n\t\treturn buf.push(' ',node.name,'=\"',node.value.replace(/[<&\"]/g,_xmlEncoder),'\"');\n\tcase TEXT_NODE:\n\t\treturn buf.push(node.data.replace(/[<&]/g,_xmlEncoder));\n\tcase CDATA_SECTION_NODE:\n\t\treturn buf.push( '<![CDATA[',node.data,']]>');\n\tcase COMMENT_NODE:\n\t\treturn buf.push( \"<!--\",node.data,\"-->\");\n\tcase DOCUMENT_TYPE_NODE:\n\t\tvar pubid = node.publicId;\n\t\tvar sysid = node.systemId;\n\t\tbuf.push('<!DOCTYPE ',node.name);\n\t\tif(pubid){\n\t\t\tbuf.push(' PUBLIC \"',pubid);\n\t\t\tif (sysid && sysid!='.') {\n\t\t\t\tbuf.push( '\" \"',sysid);\n\t\t\t}\n\t\t\tbuf.push('\">');\n\t\t}else if(sysid && sysid!='.'){\n\t\t\tbuf.push(' SYSTEM \"',sysid,'\">');\n\t\t}else{\n\t\t\tvar sub = node.internalSubset;\n\t\t\tif(sub){\n\t\t\t\tbuf.push(\" [\",sub,\"]\");\n\t\t\t}\n\t\t\tbuf.push(\">\");\n\t\t}\n\t\treturn;\n\tcase PROCESSING_INSTRUCTION_NODE:\n\t\treturn buf.push( \"<?\",node.target,\" \",node.data,\"?>\");\n\tcase ENTITY_REFERENCE_NODE:\n\t\treturn buf.push( '&',node.nodeName,';');\n\t//case ENTITY_NODE:\n\t//case NOTATION_NODE:\n\tdefault:\n\t\tbuf.push('??',node.nodeName);\n\t}\n}\nfunction importNode(doc,node,deep){\n\tvar node2;\n\tswitch (node.nodeType) {\n\tcase ELEMENT_NODE:\n\t\tnode2 = node.cloneNode(false);\n\t\tnode2.ownerDocument = doc;\n\t\t//var attrs = node2.attributes;\n\t\t//var len = attrs.length;\n\t\t//for(var i=0;i<len;i++){\n\t\t\t//node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep));\n\t\t//}\n\tcase DOCUMENT_FRAGMENT_NODE:\n\t\tbreak;\n\tcase ATTRIBUTE_NODE:\n\t\tdeep = true;\n\t\tbreak;\n\t//case ENTITY_REFERENCE_NODE:\n\t//case PROCESSING_INSTRUCTION_NODE:\n\t////case TEXT_NODE:\n\t//case CDATA_SECTION_NODE:\n\t//case COMMENT_NODE:\n\t//\tdeep = false;\n\t//\tbreak;\n\t//case DOCUMENT_NODE:\n\t//case DOCUMENT_TYPE_NODE:\n\t//cannot be imported.\n\t//case ENTITY_NODE:\n\t//case NOTATION_NODE:\n\t//can not hit in level3\n\t//default:throw e;\n\t}\n\tif(!node2){\n\t\tnode2 = node.cloneNode(false);//false\n\t}\n\tnode2.ownerDocument = doc;\n\tnode2.parentNode = null;\n\tif(deep){\n\t\tvar child = node.firstChild;\n\t\twhile(child){\n\t\t\tnode2.appendChild(importNode(doc,child,deep));\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t}\n\treturn node2;\n}\n//\n//var _relationMap = {firstChild:1,lastChild:1,previousSibling:1,nextSibling:1,\n//\t\t\t\t\tattributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,};\nfunction cloneNode(doc,node,deep){\n\tvar node2 = new node.constructor();\n\tfor(var n in node){\n\t\tvar v = node[n];\n\t\tif(typeof v != 'object' ){\n\t\t\tif(v != node2[n]){\n\t\t\t\tnode2[n] = v;\n\t\t\t}\n\t\t}\n\t}\n\tif(node.childNodes){\n\t\tnode2.childNodes = new NodeList();\n\t}\n\tnode2.ownerDocument = doc;\n\tswitch (node2.nodeType) {\n\tcase ELEMENT_NODE:\n\t\tvar attrs\t= node.attributes;\n\t\tvar attrs2\t= node2.attributes = new NamedNodeMap();\n\t\tvar len = attrs.length\n\t\tattrs2._ownerElement = node2;\n\t\tfor(var i=0;i<len;i++){\n\t\t\tnode2.setAttributeNode(cloneNode(doc,attrs.item(i),true));\n\t\t}\n\t\tbreak;;\n\tcase ATTRIBUTE_NODE:\n\t\tdeep = true;\n\t}\n\tif(deep){\n\t\tvar child = node.firstChild;\n\t\twhile(child){\n\t\t\tnode2.appendChild(cloneNode(doc,child,deep));\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t}\n\treturn node2;\n}\n\nfunction __set__(object,key,value){\n\tobject[key] = value\n}\n//do dynamic\ntry{\n\tif(Object.defineProperty){\n\t\tObject.defineProperty(LiveNodeList.prototype,'length',{\n\t\t\tget:function(){\n\t\t\t\t_updateLiveList(this);\n\t\t\t\treturn this.$$length;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(Node.prototype,'textContent',{\n\t\t\tget:function(){\n\t\t\t\treturn getTextContent(this);\n\t\t\t},\n\t\t\tset:function(data){\n\t\t\t\tswitch(this.nodeType){\n\t\t\t\tcase ELEMENT_NODE:\n\t\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\t\t\twhile(this.firstChild){\n\t\t\t\t\t\tthis.removeChild(this.firstChild);\n\t\t\t\t\t}\n\t\t\t\t\tif(data || String(data)){\n\t\t\t\t\t\tthis.appendChild(this.ownerDocument.createTextNode(data));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t//TODO:\n\t\t\t\t\tthis.data = data;\n\t\t\t\t\tthis.value = data;\n\t\t\t\t\tthis.nodeValue = data;\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\t\n\t\tfunction getTextContent(node){\n\t\t\tswitch(node.nodeType){\n\t\t\tcase ELEMENT_NODE:\n\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\t\tvar buf = [];\n\t\t\t\tnode = node.firstChild;\n\t\t\t\twhile(node){\n\t\t\t\t\tif(node.nodeType!==7 && node.nodeType !==8){\n\t\t\t\t\t\tbuf.push(getTextContent(node));\n\t\t\t\t\t}\n\t\t\t\t\tnode = node.nextSibling;\n\t\t\t\t}\n\t\t\t\treturn buf.join('');\n\t\t\tdefault:\n\t\t\t\treturn node.nodeValue;\n\t\t\t}\n\t\t}\n\t\t__set__ = function(object,key,value){\n\t\t\t//console.log(value)\n\t\t\tobject['$$'+key] = value\n\t\t}\n\t}\n}catch(e){//ie8\n}\n\n//if(typeof require == 'function'){\n\texports.DOMImplementation = DOMImplementation;\n\texports.XMLSerializer = XMLSerializer;\n//}\n","/**\r\n * http://www.myersdaily.org/joseph/javascript/md5-text.html\r\n * http://pajhome.org.uk/crypt/md5\r\n * https://github.com/wbond/md5-js\r\n */\r\nfunction md5cycle(x, k) {\r\n var a = x[0], b = x[1], c = x[2], d = x[3];\r\n\r\n a = ff(a, b, c, d, k[0], 7, -680876936);\r\n d = ff(d, a, b, c, k[1], 12, -389564586);\r\n c = ff(c, d, a, b, k[2], 17, 606105819);\r\n b = ff(b, c, d, a, k[3], 22, -1044525330);\r\n a = ff(a, b, c, d, k[4], 7, -176418897);\r\n d = ff(d, a, b, c, k[5], 12, 1200080426);\r\n c = ff(c, d, a, b, k[6], 17, -1473231341);\r\n b = ff(b, c, d, a, k[7], 22, -45705983);\r\n a = ff(a, b, c, d, k[8], 7, 1770035416);\r\n d = ff(d, a, b, c, k[9], 12, -1958414417);\r\n c = ff(c, d, a, b, k[10], 17, -42063);\r\n b = ff(b, c, d, a, k[11], 22, -1990404162);\r\n a = ff(a, b, c, d, k[12], 7, 1804603682);\r\n d = ff(d, a, b, c, k[13], 12, -40341101);\r\n c = ff(c, d, a, b, k[14], 17, -1502002290);\r\n b = ff(b, c, d, a, k[15], 22, 1236535329);\r\n\r\n a = gg(a, b, c, d, k[1], 5, -165796510);\r\n d = gg(d, a, b, c, k[6], 9, -1069501632);\r\n c = gg(c, d, a, b, k[11], 14, 643717713);\r\n b = gg(b, c, d, a, k[0], 20, -373897302);\r\n a = gg(a, b, c, d, k[5], 5, -701558691);\r\n d = gg(d, a, b, c, k[10], 9, 38016083);\r\n c = gg(c, d, a, b, k[15], 14, -660478335);\r\n b = gg(b, c, d, a, k[4], 20, -405537848);\r\n a = gg(a, b, c, d, k[9], 5, 568446438);\r\n d = gg(d, a, b, c, k[14], 9, -1019803690);\r\n c = gg(c, d, a, b, k[3], 14, -187363961);\r\n b = gg(b, c, d, a, k[8], 20, 1163531501);\r\n a = gg(a, b, c, d, k[13], 5, -1444681467);\r\n d = gg(d, a, b, c, k[2], 9, -51403784);\r\n c = gg(c, d, a, b, k[7], 14, 1735328473);\r\n b = gg(b, c, d, a, k[12], 20, -1926607734);\r\n\r\n a = hh(a, b, c, d, k[5], 4, -378558);\r\n d = hh(d, a, b, c, k[8], 11, -2022574463);\r\n c = hh(c, d, a, b, k[11], 16, 1839030562);\r\n b = hh(b, c, d, a, k[14], 23, -35309556);\r\n a = hh(a, b, c, d, k[1], 4, -1530992060);\r\n d = hh(d, a, b, c, k[4], 11, 1272893353);\r\n c = hh(c, d, a, b, k[7], 16, -155497632);\r\n b = hh(b, c, d, a, k[10], 23, -1094730640);\r\n a = hh(a, b, c, d, k[13], 4, 681279174);\r\n d = hh(d, a, b, c, k[0], 11, -358537222);\r\n c = hh(c, d, a, b, k[3], 16, -722521979);\r\n b = hh(b, c, d, a, k[6], 23, 76029189);\r\n a = hh(a, b, c, d, k[9], 4, -640364487);\r\n d = hh(d, a, b, c, k[12], 11, -421815835);\r\n c = hh(c, d, a, b, k[15], 16, 530742520);\r\n b = hh(b, c, d, a, k[2], 23, -995338651);\r\n\r\n a = ii(a, b, c, d, k[0], 6, -198630844);\r\n d = ii(d, a, b, c, k[7], 10, 1126891415);\r\n c = ii(c, d, a, b, k[14], 15, -1416354905);\r\n b = ii(b, c, d, a, k[5], 21, -57434055);\r\n a = ii(a, b, c, d, k[12], 6, 1700485571);\r\n d = ii(d, a, b, c, k[3], 10, -1894986606);\r\n c = ii(c, d, a, b, k[10], 15, -1051523);\r\n b = ii(b, c, d, a, k[1], 21, -2054922799);\r\n a = ii(a, b, c, d, k[8], 6, 1873313359);\r\n d = ii(d, a, b, c, k[15], 10, -30611744);\r\n c = ii(c, d, a, b, k[6], 15, -1560198380);\r\n b = ii(b, c, d, a, k[13], 21, 1309151649);\r\n a = ii(a, b, c, d, k[4], 6, -145523070);\r\n d = ii(d, a, b, c, k[11], 10, -1120210379);\r\n c = ii(c, d, a, b, k[2], 15, 718787259);\r\n b = ii(b, c, d, a, k[9], 21, -343485551);\r\n\r\n x[0] = add32(a, x[0]);\r\n x[1] = add32(b, x[1]);\r\n x[2] = add32(c, x[2]);\r\n x[3] = add32(d, x[3]);\r\n}\r\n\r\nfunction cmn(q, a, b, x, s, t) {\r\n a = add32(add32(a, q), add32(x, t));\r\n return add32((a << s) | (a >>> (32 - s)), b);\r\n}\r\n\r\nfunction ff(a, b, c, d, x, s, t) {\r\n return cmn((b & c) | ((~b) & d), a, b, x, s, t);\r\n}\r\n\r\nfunction gg(a, b, c, d, x, s, t) {\r\n return cmn((b & d) | (c & (~d)), a, b, x, s, t);\r\n}\r\n\r\nfunction hh(a, b, c, d, x, s, t) {\r\n return cmn(b ^ c ^ d, a, b, x, s, t);\r\n}\r\n\r\nfunction ii(a, b, c, d, x, s, t) {\r\n return cmn(c ^ (b | (~d)), a, b, x, s, t);\r\n}\r\n\r\nfunction md5blk(s) { /* I figured global was faster. */\r\n var md5blks = [], i; /* Andy King said do it this way. */\r\n for (i = 0; i < 64; i += 4) {\r\n md5blks[i >> 2] = s.charCodeAt(i) +\r\n (s.charCodeAt(i + 1) << 8) +\r\n (s.charCodeAt(i + 2) << 16) +\r\n (s.charCodeAt(i + 3) << 24);\r\n }\r\n return md5blks;\r\n}\r\n\r\nvar hex_chr = '0123456789abcdef'.split('');\r\n\r\nfunction rhex(n) {\r\n var s = '', j = 0;\r\n for (; j < 4; j++)\r\n s += hex_chr[(n >> (j * 8 + 4)) & 0x0F] +\r\n hex_chr[(n >> (j * 8)) & 0x0F];\r\n return s;\r\n}\r\n\r\nfunction hex(x) {\r\n for (var i = 0; i < x.length; i++)\r\n x[i] = rhex(x[i]);\r\n return x.join('');\r\n}\r\n\r\nvar add32 = function (a, b) {\r\n return (a + b) & 0xFFFFFFFF;\r\n}\r\n\r\nfunction getCtx() {\r\n var ctx = {};\r\n ctx.state = [1732584193, -271733879, -1732584194, 271733878];\r\n ctx.tail = '';\r\n ctx.size = 0;\r\n ctx.update = function (s, isBinStr) {\r\n if (!isBinStr) s = unescape(encodeURIComponent(s));\r\n ctx.size += s.length;\r\n s = ctx.tail + s;\r\n var i, state = ctx.state;\r\n for (i = 64; i <= s.length; i += 64) {\r\n md5cycle(state, md5blk(s.substring(i - 64, i)));\r\n }\r\n ctx.tail = s.substring(i - 64);\r\n return ctx;\r\n };\r\n ctx.digest = function (encode) {\r\n var i,\r\n n = ctx.size,\r\n state = ctx.state,\r\n s = ctx.tail,\r\n tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\r\n for (i = 0; i < s.length; i++)\r\n tail[i >> 2] |= s.charCodeAt(i) << ((i % 4) << 3);\r\n tail[i >> 2] |= 0x80 << ((i % 4) << 3);\r\n if (i > 55) {\r\n md5cycle(state, tail);\r\n for (i = 0; i < 16; i++) tail[i] = 0;\r\n }\r\n tail[14] = n * 8;\r\n md5cycle(state, tail);\r\n return hex(state);\r\n };\r\n return ctx;\r\n}\r\n\r\nvar md5 = function (s, isBinStr) {\r\n return getCtx().update(s, isBinStr).digest('hex');\r\n}\r\n\r\nif (md5('hello') !== '5d41402abc4b2a76b9719d911017c592') {\r\n add32 = function (x, y) {\r\n var lsw = (x & 0xFFFF) + (y & 0xFFFF),\r\n msw = (x >> 16) + (y >> 16) + (lsw >> 16);\r\n return (msw << 16) | (lsw & 0xFFFF);\r\n }\r\n}\r\n\r\nmd5.getCtx = getCtx;\r\nmodule.exports = md5;\r\n","var REQUEST = require('../lib/request');\r\nvar util = require('./util');\r\n\r\n\r\n// Bucket 相关\r\n\r\n/**\r\n * 获取用户的 bucket 列表\r\n * @param {Object} params 回调函数,必须,下面为参数列表\r\n * 无特殊参数\r\n * @param {Function} callback 回调函数,必须\r\n */\r\nfunction getService(params, callback) {\r\n\r\n if (typeof params === 'function') {\r\n callback = params;\r\n params = {};\r\n }\r\n var protocol = this.options.Protocol || (util.isBrowser && location.protocol === 'http:' ? 'http:' : 'https:');\r\n var domain = this.options.ServiceDomain;\r\n var region = params.Region;\r\n if (domain) {\r\n domain = domain.replace(/\\{Region\\}/ig, region || '').replace(/\\{.*?\\}/ig, '');\r\n if (!/^[a-zA-Z]+:\\/\\//.test(domain)) {\r\n domain = protocol + '//' + domain;\r\n }\r\n if (domain.slice(-1) === '/') {\r\n domain = domain.slice(0, -1);\r\n }\r\n } else if(region){\r\n domain = protocol + '//cos.'+ region + '.myqcloud.com';\r\n } else {\r\n domain = protocol + '//service.cos.myqcloud.com';\r\n }\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetService',\r\n url: domain,\r\n method: 'GET',\r\n headers: params.Headers,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var buckets = (data && data.ListAllMyBucketsResult && data.ListAllMyBucketsResult.Buckets\r\n && data.ListAllMyBucketsResult.Buckets.Bucket) || [];\r\n buckets = util.isArray(buckets) ? buckets : [buckets];\r\n var owner = (data && data.ListAllMyBucketsResult && data.ListAllMyBucketsResult.Owner) || {};\r\n callback(null, {\r\n Buckets: buckets,\r\n Owner: owner,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 创建 Bucket,并初始化访问权限\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.ACL 用户自定义文件权限,可以设置:private,public-read;默认值:private,非必须\r\n * @param {String} params.GrantRead 赋予被授权者读的权限,格式x-cos-grant-read: uin=\" \",uin=\" \",非必须\r\n * @param {String} params.GrantWrite 赋予被授权者写的权限,格式x-cos-grant-write: uin=\" \",uin=\" \",非必须\r\n * @param {String} params.GrantFullControl 赋予被授权者读写权限,格式x-cos-grant-full-control: uin=\" \",uin=\" \",非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {String} data.Location 操作地址\r\n */\r\nfunction putBucket(params, callback) {\r\n\r\n var self = this;\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutBucket',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var url = getUrl({\r\n protocol: self.options.Protocol,\r\n domain: self.options.Domain,\r\n bucket: params.Bucket,\r\n region: params.Region,\r\n isLocation: true,\r\n });\r\n callback(null, {\r\n Location: url,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 查看是否存在该Bucket,是否有权限访问\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {Boolean} data.BucketExist Bucket是否存在\r\n * @return {Boolean} data.BucketAuth 是否有 Bucket 的访问权限\r\n */\r\nfunction headBucket(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:HeadBucket',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n method: 'HEAD',\r\n }, function (err, data) {\r\n callback(err, data);\r\n });\r\n}\r\n\r\n/**\r\n * 获取 Bucket 下的 object 列表\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Prefix 前缀匹配,用来规定返回的文件前缀地址,非必须\r\n * @param {String} params.Delimiter 定界符为一个符号,如果有Prefix,则将Prefix到delimiter之间的相同路径归为一类,非必须\r\n * @param {String} params.Marker 默认以UTF-8二进制顺序列出条目,所有列出条目从marker开始,非必须\r\n * @param {String} params.MaxKeys 单次返回最大的条目数量,默认1000,非必须\r\n * @param {String} params.EncodingType 规定返回值的编码方式,非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {Object} data.ListBucketResult 返回的 object 列表信息\r\n */\r\nfunction getBucket(params, callback) {\r\n var reqParams = {};\r\n reqParams['prefix'] = params['Prefix'] || '';\r\n reqParams['delimiter'] = params['Delimiter'];\r\n reqParams['marker'] = params['Marker'];\r\n reqParams['max-keys'] = params['MaxKeys'];\r\n reqParams['encoding-type'] = params['EncodingType'];\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucket',\r\n ResourceKey: reqParams['prefix'],\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n qs: reqParams,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var ListBucketResult = data.ListBucketResult || {};\r\n var Contents = ListBucketResult.Contents || [];\r\n var CommonPrefixes = ListBucketResult.CommonPrefixes || [];\r\n\r\n Contents = util.isArray(Contents) ? Contents : [Contents];\r\n CommonPrefixes = util.isArray(CommonPrefixes) ? CommonPrefixes : [CommonPrefixes];\r\n\r\n var result = util.clone(ListBucketResult);\r\n util.extend(result, {\r\n Contents: Contents,\r\n CommonPrefixes: CommonPrefixes,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n\r\n callback(null, result);\r\n });\r\n}\r\n\r\n/**\r\n * 删除 Bucket\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {String} data.Location 操作地址\r\n */\r\nfunction deleteBucket(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:DeleteBucket',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n method: 'DELETE',\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 设置 Bucket 的 权限列表\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.ACL 用户自定义文件权限,可以设置:private,public-read;默认值:private,非必须\r\n * @param {String} params.GrantRead 赋予被授权者读的权限,格式x-cos-grant-read: uin=\" \",uin=\" \",非必须\r\n * @param {String} params.GrantWrite 赋予被授权者写的权限,格式x-cos-grant-write: uin=\" \",uin=\" \",非必须\r\n * @param {String} params.GrantFullControl 赋予被授权者读写权限,格式x-cos-grant-full-control: uin=\" \",uin=\" \",非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction putBucketAcl(params, callback) {\r\n var headers = params.Headers;\r\n\r\n var xml = '';\r\n if (params['AccessControlPolicy']) {\r\n var AccessControlPolicy = util.clone(params['AccessControlPolicy'] || {});\r\n var Grants = AccessControlPolicy.Grants || AccessControlPolicy.Grant;\r\n Grants = util.isArray(Grants) ? Grants : [Grants];\r\n delete AccessControlPolicy.Grant;\r\n delete AccessControlPolicy.Grants;\r\n AccessControlPolicy.AccessControlList = {Grant: Grants};\r\n xml = util.json2xml({AccessControlPolicy: AccessControlPolicy});\r\n\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n }\r\n\r\n // Grant Header 去重\r\n util.each(headers, function (val, key) {\r\n if (key.indexOf('x-cos-grant-') === 0) {\r\n headers[key] = uniqGrant(headers[key]);\r\n }\r\n });\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutBucketACL',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: headers,\r\n action: 'acl',\r\n body: xml,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 获取 Bucket 的 权限列表\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {Object} data.AccessControlPolicy 访问权限信息\r\n */\r\nfunction getBucketAcl(params, callback) {\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketACL',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'acl',\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var AccessControlPolicy = data.AccessControlPolicy || {};\r\n var Owner = AccessControlPolicy.Owner || {};\r\n var Grant = AccessControlPolicy.AccessControlList.Grant || [];\r\n Grant = util.isArray(Grant) ? Grant : [Grant];\r\n var result = decodeAcl(AccessControlPolicy);\r\n if (data.headers && data.headers['x-cos-acl']) {\r\n result.ACL = data.headers['x-cos-acl'];\r\n }\r\n result = util.extend(result, {\r\n Owner: Owner,\r\n Grants: Grant,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n callback(null, result);\r\n });\r\n}\r\n\r\n/**\r\n * 设置 Bucket 的 跨域设置\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Object} params.CORSConfiguration 相关的跨域设置,必须\r\n * @param {Array} params.CORSConfiguration.CORSRules 对应的跨域规则\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction putBucketCors(params, callback) {\r\n\r\n var CORSConfiguration = params['CORSConfiguration'] || {};\r\n var CORSRules = CORSConfiguration['CORSRules'] || params['CORSRules'] || [];\r\n CORSRules = util.clone(util.isArray(CORSRules) ? CORSRules : [CORSRules]);\r\n util.each(CORSRules, function (rule) {\r\n util.each(['AllowedOrigin', 'AllowedHeader', 'AllowedMethod', 'ExposeHeader'], function (key, k) {\r\n var sKey = key + 's';\r\n var val = rule[sKey] || rule[key] || [];\r\n delete rule[sKey];\r\n rule[key] = util.isArray(val) ? val : [val];\r\n });\r\n });\r\n\r\n var xml = util.json2xml({CORSConfiguration: {CORSRule: CORSRules}});\r\n\r\n var headers = params.Headers;\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutBucketCORS',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n body: xml,\r\n action: 'cors',\r\n headers: headers,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 获取 Bucket 的 跨域设置\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {Object} data.CORSRules Bucket的跨域设置\r\n */\r\nfunction getBucketCors(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketCORS',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'cors',\r\n }, function (err, data) {\r\n if (err) {\r\n if (err.statusCode === 404 && err.error && err.error.Code === 'NoSuchCORSConfiguration') {\r\n var result = {\r\n CORSRules: [],\r\n statusCode: err.statusCode,\r\n };\r\n err.headers && (result.headers = err.headers);\r\n callback(null, result);\r\n } else {\r\n callback(err);\r\n }\r\n return;\r\n }\r\n var CORSConfiguration = data.CORSConfiguration || {};\r\n var CORSRules = CORSConfiguration.CORSRules || CORSConfiguration.CORSRule || [];\r\n CORSRules = util.clone(util.isArray(CORSRules) ? CORSRules : [CORSRules]);\r\n\r\n util.each(CORSRules, function (rule) {\r\n util.each(['AllowedOrigin', 'AllowedHeader', 'AllowedMethod', 'ExposeHeader'], function (key, j) {\r\n var sKey = key + 's';\r\n var val = rule[sKey] || rule[key] || [];\r\n delete rule[key];\r\n rule[sKey] = util.isArray(val) ? val : [val];\r\n });\r\n });\r\n\r\n callback(null, {\r\n CORSRules: CORSRules,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 删除 Bucket 的 跨域设置\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction deleteBucketCors(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:DeleteBucketCORS',\r\n method: 'DELETE',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'cors',\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode || err.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 获取 Bucket 的 地域信息\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回数据,包含地域信息 LocationConstraint\r\n */\r\nfunction getBucketLocation(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketLocation',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'location',\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n callback(null, data);\r\n });\r\n}\r\n\r\nfunction putBucketPolicy(params, callback) {\r\n var Policy = params['Policy'];\r\n var PolicyStr = Policy;\r\n try {\r\n if (typeof Policy === 'string') {\r\n Policy = JSON.parse(PolicyStr);\r\n } else {\r\n PolicyStr = JSON.stringify(Policy);\r\n }\r\n } catch (e) {\r\n callback({error: 'Policy format error'});\r\n }\r\n\r\n var headers = params.Headers;\r\n headers['Content-Type'] = 'application/json';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(PolicyStr));\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutBucketPolicy',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n action: 'policy',\r\n body: util.isBrowser ? PolicyStr : Policy,\r\n headers: headers,\r\n json: true,\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 获取 Bucket 的读取权限策略\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回数据\r\n */\r\nfunction getBucketPolicy(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketPolicy',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'policy',\r\n rawBody: true,\r\n }, function (err, data) {\r\n if (err) {\r\n if (err.statusCode && err.statusCode === 403) {\r\n return callback({ErrorStatus: 'Access Denied'});\r\n }\r\n if (err.statusCode && err.statusCode === 405) {\r\n return callback({ErrorStatus: 'Method Not Allowed'});\r\n }\r\n if (err.statusCode && err.statusCode === 404) {\r\n return callback({ErrorStatus: 'Policy Not Found'});\r\n }\r\n return callback(err);\r\n }\r\n var Policy = {};\r\n try {\r\n Policy = JSON.parse(data.body);\r\n } catch (e) {\r\n }\r\n callback(null, {\r\n Policy: Policy,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 删除 Bucket 的 跨域设置\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction deleteBucketPolicy(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:DeleteBucketPolicy',\r\n method: 'DELETE',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'policy',\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode || err.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 设置 Bucket 的标签\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Array} params.TagSet 标签设置,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回数据\r\n */\r\nfunction putBucketTagging(params, callback) {\r\n\r\n var Tagging = params['Tagging'] || {};\r\n var Tags = Tagging.TagSet || Tagging.Tags || params['Tags'] || [];\r\n Tags = util.clone(util.isArray(Tags) ? Tags : [Tags]);\r\n var xml = util.json2xml({Tagging: {TagSet: {Tag: Tags}}});\r\n\r\n var headers = params.Headers;\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutBucketTagging',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n body: xml,\r\n action: 'tagging',\r\n headers: headers,\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 获取 Bucket 的标签设置\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回数据\r\n */\r\nfunction getBucketTagging(params, callback) {\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketTagging',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'tagging',\r\n }, function (err, data) {\r\n if (err) {\r\n if (err.statusCode === 404 && err.error && (err.error === \"Not Found\" || err.error.Code === 'NoSuchTagSet')) {\r\n var result = {\r\n Tags: [],\r\n statusCode: err.statusCode,\r\n };\r\n err.headers && (result.headers = err.headers);\r\n callback(null, result);\r\n } else {\r\n callback(err);\r\n }\r\n return;\r\n }\r\n var Tags = [];\r\n try {\r\n Tags = data.Tagging.TagSet.Tag || [];\r\n } catch (e) {\r\n }\r\n Tags = util.clone(util.isArray(Tags) ? Tags : [Tags]);\r\n callback(null, {\r\n Tags: Tags,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 删除 Bucket 的 标签设置\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction deleteBucketTagging(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:DeleteBucketTagging',\r\n method: 'DELETE',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'tagging',\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\nfunction putBucketLifecycle(params, callback) {\r\n\r\n var LifecycleConfiguration = params['LifecycleConfiguration'] || {};\r\n var Rules = LifecycleConfiguration.Rules || params.Rules || [];\r\n Rules = util.clone(Rules);\r\n var xml = util.json2xml({LifecycleConfiguration: {Rule: Rules}});\r\n\r\n var headers = params.Headers;\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutBucketLifecycle',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n body: xml,\r\n action: 'lifecycle',\r\n headers: headers,\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\nfunction getBucketLifecycle(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketLifecycle',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'lifecycle',\r\n }, function (err, data) {\r\n if (err) {\r\n if (err.statusCode === 404 && err.error && err.error.Code === 'NoSuchLifecycleConfiguration') {\r\n var result = {\r\n Rules: [],\r\n statusCode: err.statusCode,\r\n };\r\n err.headers && (result.headers = err.headers);\r\n callback(null, result);\r\n } else {\r\n callback(err);\r\n }\r\n return;\r\n }\r\n var Rules = [];\r\n try {\r\n Rules = data.LifecycleConfiguration.Rule || [];\r\n } catch (e) {\r\n }\r\n Rules = util.clone(util.isArray(Rules) ? Rules : [Rules]);\r\n callback(null, {\r\n Rules: Rules,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\nfunction deleteBucketLifecycle(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:DeleteBucketLifecycle',\r\n method: 'DELETE',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'lifecycle',\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\nfunction putBucketVersioning(params, callback) {\r\n\r\n if (!params['VersioningConfiguration']) {\r\n callback({error: 'missing param VersioningConfiguration'});\r\n return;\r\n }\r\n var VersioningConfiguration = params['VersioningConfiguration'] || {};\r\n var xml = util.json2xml({VersioningConfiguration: VersioningConfiguration});\r\n\r\n var headers = params.Headers;\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutBucketVersioning',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n body: xml,\r\n action: 'versioning',\r\n headers: headers,\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\nfunction getBucketVersioning(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketVersioning',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'versioning',\r\n }, function (err, data) {\r\n if (!err) {\r\n !data.VersioningConfiguration && (data.VersioningConfiguration = {});\r\n }\r\n callback(err, data);\r\n });\r\n}\r\n\r\nfunction putBucketReplication(params, callback) {\r\n var ReplicationConfiguration = util.clone(params.ReplicationConfiguration);\r\n var xml = util.json2xml({ReplicationConfiguration: ReplicationConfiguration});\r\n xml = xml.replace(/<(\\/?)Rules>/ig, '<$1Rule>');\r\n xml = xml.replace(/<(\\/?)Tags>/ig, '<$1Tag>');\r\n\r\n var headers = params.Headers;\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutBucketReplication',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n body: xml,\r\n action: 'replication',\r\n headers: headers,\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\nfunction getBucketReplication(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketReplication',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'replication',\r\n }, function (err, data) {\r\n if (err) {\r\n if (err.statusCode === 404 && err.error && (err.error === 'Not Found' || err.error.Code === 'ReplicationConfigurationnotFoundError')) {\r\n var result = {\r\n ReplicationConfiguration: {Rules: []},\r\n statusCode: err.statusCode,\r\n };\r\n err.headers && (result.headers = err.headers);\r\n callback(null, result);\r\n } else {\r\n callback(err);\r\n }\r\n return;\r\n }\r\n if (!err) {\r\n !data.ReplicationConfiguration && (data.ReplicationConfiguration = {});\r\n }\r\n if (data.ReplicationConfiguration.Rule) {\r\n data.ReplicationConfiguration.Rules = data.ReplicationConfiguration.Rule;\r\n delete data.ReplicationConfiguration.Rule;\r\n }\r\n callback(err, data);\r\n });\r\n}\r\n\r\nfunction deleteBucketReplication(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:DeleteBucketReplication',\r\n method: 'DELETE',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'replication',\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 设置 Bucket 静态网站配置信息\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Object} params.WebsiteConfiguration 地域名称,必须\r\n * @param {Object} WebsiteConfiguration.IndexDocument 索引文档,必须\r\n * @param {Object} WebsiteConfiguration.ErrorDocument 错误文档,非必须\r\n * @param {Object} WebsiteConfiguration.RedirectAllRequestsTo 重定向所有请求,非必须\r\n * @param {Array} params.RoutingRules 重定向规则,非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回数据\r\n */\r\nfunction putBucketWebsite(params, callback) {\r\n\r\n if (!params['WebsiteConfiguration']) {\r\n callback({ error: 'missing param WebsiteConfiguration' });\r\n return;\r\n }\r\n\r\n var WebsiteConfiguration = util.clone(params['WebsiteConfiguration'] || {});\r\n var RoutingRules = WebsiteConfiguration['RoutingRules'] || WebsiteConfiguration['RoutingRule'] || [];\r\n RoutingRules = util.isArray(RoutingRules) ? RoutingRules : [RoutingRules];\r\n delete WebsiteConfiguration.RoutingRule;\r\n delete WebsiteConfiguration.RoutingRules;\r\n RoutingRules.length > 0 && (WebsiteConfiguration.RoutingRules = { RoutingRule: RoutingRules });\r\n var xml = util.json2xml({ WebsiteConfiguration: WebsiteConfiguration });\r\n\r\n var headers = params.Headers;\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutBucketWebsite',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n body: xml,\r\n action: 'website',\r\n headers: headers,\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 获取 Bucket 的静态网站配置信息\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回数据\r\n */\r\nfunction getBucketWebsite(params, callback) {\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketWebsite',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n headers: params.Headers,\r\n action: 'website',\r\n }, function (err, data) {\r\n if (err) {\r\n if(err.statusCode === 404 && err.error.Code === 'NoSuchWebsiteConfiguration'){\r\n var result = {\r\n WebsiteConfiguration: {},\r\n statusCode: err.statusCode,\r\n };\r\n err.headers && (result.headers = err.headers);\r\n callback(null, result);\r\n } else {\r\n callback(err);\r\n }\r\n return;\r\n }\r\n\r\n var WebsiteConfiguration = data.WebsiteConfiguration || {};\r\n if (WebsiteConfiguration['RoutingRules']) {\r\n var RoutingRules = util.clone(WebsiteConfiguration['RoutingRules'].RoutingRule || []);\r\n RoutingRules = util.makeArray(RoutingRules);\r\n WebsiteConfiguration.RoutingRules = RoutingRules;\r\n }\r\n\r\n callback(null, {\r\n WebsiteConfiguration: WebsiteConfiguration,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 删除 Bucket 的静态网站配置\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回数据\r\n */\r\nfunction deleteBucketWebsite(params, callback) {\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:DeleteBucketWebsite',\r\n method: 'DELETE',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n action: 'website',\r\n }, function (err, data) {\r\n if (err && err.statusCode === 204) {\r\n return callback(null, {statusCode: err.statusCode});\r\n } else if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n// Object 相关\r\n\r\n/**\r\n * 取回对应Object的元数据,Head的权限与Get的权限一致\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key 文件名称,必须\r\n * @param {String} params.IfModifiedSince 当Object在指定时间后被修改,则返回对应Object元信息,否则返回304,非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 为指定 object 的元数据,如果设置了 IfModifiedSince ,且文件未修改,则返回一个对象,NotModified 属性为 true\r\n * @return {Boolean} data.NotModified 是否在 IfModifiedSince 时间点之后未修改该 object,则为 true\r\n */\r\nfunction headObject(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:HeadObject',\r\n method: 'HEAD',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n VersionId: params.VersionId,\r\n headers: params.Headers,\r\n }, function (err, data) {\r\n if (err) {\r\n var statusCode = err.statusCode;\r\n if (params.Headers['If-Modified-Since'] && statusCode && statusCode === 304) {\r\n return callback(null, {\r\n NotModified: true,\r\n statusCode: statusCode,\r\n });\r\n }\r\n return callback(err);\r\n }\r\n if (data.headers && data.headers.etag) {\r\n data.ETag = data.headers && data.headers.etag;\r\n }\r\n callback(null, data);\r\n });\r\n}\r\n\r\n\r\nfunction listObjectVersions(params, callback) {\r\n var reqParams = {};\r\n reqParams['prefix'] = params['Prefix'] || '';\r\n reqParams['delimiter'] = params['Delimiter'];\r\n reqParams['key-marker'] = params['KeyMarker'];\r\n reqParams['version-id-marker'] = params['VersionIdMarker'];\r\n reqParams['max-keys'] = params['MaxKeys'];\r\n reqParams['encoding-type'] = params['EncodingType'];\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetBucketObjectVersions',\r\n ResourceKey: reqParams['prefix'],\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n qs: reqParams,\r\n action: 'versions',\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var ListVersionsResult = data.ListVersionsResult || {};\r\n var DeleteMarkers = ListVersionsResult.DeleteMarker || [];\r\n DeleteMarkers = util.isArray(DeleteMarkers) ? DeleteMarkers : [DeleteMarkers];\r\n var Versions = ListVersionsResult.Version || [];\r\n Versions = util.isArray(Versions) ? Versions : [Versions];\r\n\r\n var result = util.clone(ListVersionsResult);\r\n delete result.DeleteMarker;\r\n delete result.Version;\r\n util.extend(result, {\r\n DeleteMarkers: DeleteMarkers,\r\n Versions: Versions,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n\r\n callback(null, result);\r\n });\r\n}\r\n\r\n/**\r\n * 下载 object\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key 文件名称,必须\r\n * @param {WriteStream} params.Output 文件写入流,非必须\r\n * @param {String} params.IfModifiedSince 当Object在指定时间后被修改,则返回对应Object元信息,否则返回304,非必须\r\n * @param {String} params.IfUnmodifiedSince 如果文件修改时间早于或等于指定时间,才返回文件内容。否则返回 412 (precondition failed),非必须\r\n * @param {String} params.IfMatch 当 ETag 与指定的内容一致,才返回文件。否则返回 412 (precondition failed),非必须\r\n * @param {String} params.IfNoneMatch 当 ETag 与指定的内容不一致,才返回文件。否则返回304 (not modified),非必须\r\n * @param {String} params.ResponseContentType 设置返回头部中的 Content-Type 参数,非必须\r\n * @param {String} params.ResponseContentLanguage 设置返回头部中的 Content-Language 参数,非必须\r\n * @param {String} params.ResponseExpires 设置返回头部中的 Content-Expires 参数,非必须\r\n * @param {String} params.ResponseCacheControl 设置返回头部中的 Cache-Control 参数,非必须\r\n * @param {String} params.ResponseContentDisposition 设置返回头部中的 Content-Disposition 参数,非必须\r\n * @param {String} params.ResponseContentEncoding 设置返回头部中的 Content-Encoding 参数,非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @param {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @param {Object} data 为对应的 object 数据,包括 body 和 headers\r\n */\r\nfunction getObject(params, callback) {\r\n var reqParams = {};\r\n\r\n reqParams['response-content-type'] = params['ResponseContentType'];\r\n reqParams['response-content-language'] = params['ResponseContentLanguage'];\r\n reqParams['response-expires'] = params['ResponseExpires'];\r\n reqParams['response-cache-control'] = params['ResponseCacheControl'];\r\n reqParams['response-content-disposition'] = params['ResponseContentDisposition'];\r\n reqParams['response-content-encoding'] = params['ResponseContentEncoding'];\r\n\r\n // 如果用户自己传入了 output\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetObject',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n VersionId: params.VersionId,\r\n headers: params.Headers,\r\n qs: reqParams,\r\n rawBody: true,\r\n }, function (err, data) {\r\n if (err) {\r\n var statusCode = err.statusCode;\r\n if (params.Headers['If-Modified-Since'] && statusCode && statusCode === 304) {\r\n return callback(null, {\r\n NotModified: true\r\n });\r\n }\r\n return callback(err);\r\n }\r\n var result = {};\r\n result.Body = data.body;\r\n if (data.headers && data.headers.etag) {\r\n result.ETag = data.headers && data.headers.etag;\r\n }\r\n util.extend(result, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n callback(null, result);\r\n });\r\n\r\n}\r\n\r\n/**\r\n * 上传 object\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key 文件名称,必须\r\n * @param {File || Blob || String} params.Body 上传文件对象或字符串,必须\r\n * @param {String} params.CacheControl RFC 2616 中定义的缓存策略,将作为 Object 元数据保存,非必须\r\n * @param {String} params.ContentDisposition RFC 2616 中定义的文件名称,将作为 Object 元数据保存,非必须\r\n * @param {String} params.ContentEncoding RFC 2616 中定义的编码格式,将作为 Object 元数据保存,非必须\r\n * @param {String} params.ContentLength RFC 2616 中定义的 HTTP 请求内容长度(字节),必须\r\n * @param {String} params.ContentType RFC 2616 中定义的内容类型(MIME),将作为 Object 元数据保存,非必须\r\n * @param {String} params.Expect 当使用 Expect: 100-continue 时,在收到服务端确认后,才会发送请求内容,非必须\r\n * @param {String} params.Expires RFC 2616 中定义的过期时间,将作为 Object 元数据保存,非必须\r\n * @param {String} params.ACL 允许用户自定义文件权限,有效值:private | public-read,非必须\r\n * @param {String} params.GrantRead 赋予被授权者读取对象的权限,格式:id=\"[OwnerUin]\",可使用半角逗号(,)分隔多组被授权者,非必须\r\n * @param {String} params.GrantReadAcp 赋予被授权者读取对象的访问控制列表(ACL)的权限,格式:id=\"[OwnerUin]\",可使用半角逗号(,)分隔多组被授权者,非必须\r\n * @param {String} params.GrantWriteAcp 赋予被授权者写入对象的访问控制列表(ACL)的权限,格式:id=\"[OwnerUin]\",可使用半角逗号(,)分隔多组被授权者,非必须\r\n * @param {String} params.GrantFullControl 赋予被授权者操作对象的所有权限,格式:id=\"[OwnerUin]\",可使用半角逗号(,)分隔多组被授权者,非必须\r\n * @param {String} params.StorageClass 设置对象的存储级别,枚举值:STANDARD、STANDARD_IA、ARCHIVE,默认值:STANDARD,非必须\r\n * @param {String} params.x-cos-meta-* 允许用户自定义的头部信息,将作为对象的元数据保存。大小限制2KB,非必须\r\n * @param {String} params.ContentSha1 RFC 3174 中定义的 160-bit 内容 SHA-1 算法校验,非必须\r\n * @param {String} params.ServerSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: \"AES256\",非必须\r\n * @param {Function} params.onProgress 上传进度回调函数\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 为对应的 object 数据\r\n * @return {String} data.ETag 为对应上传文件的 ETag 值\r\n */\r\nfunction putObject(params, callback) {\r\n var self = this;\r\n var FileSize = params.ContentLength;\r\n var onProgress = util.throttleOnProgress.call(self, FileSize, params.onProgress);\r\n\r\n // 特殊处理 Cache-Control\r\n var headers = params.Headers;\r\n !headers['Cache-Control'] && (headers['Cache-Control'] = '');\r\n\r\n // 获取 File 或 Blob 的 type 属性,如果有,作为文件 Content-Type\r\n var ContentType = headers['Content-Type'] || (params.Body && params.Body.type);\r\n !headers['Content-Type'] && ContentType && (headers['Content-Type'] = ContentType);\r\n\r\n var needCalcMd5 = params.UploadAddMetaMd5 || self.options.UploadAddMetaMd5 || self.options.UploadCheckContentMd5;\r\n util.getBodyMd5(needCalcMd5, params.Body, function (md5) {\r\n if (md5) {\r\n if (self.options.UploadCheckContentMd5) params.Headers['Content-MD5'] = util.binaryBase64(md5);\r\n if (params.UploadAddMetaMd5 || self.options.UploadAddMetaMd5) params.Headers['x-cos-meta-md5'] = md5;\r\n }\r\n\r\n if (params.ContentLength !== undefined) {\r\n params.Headers['Content-Length'] = params.ContentLength;\r\n }\r\n onProgress(null, true); // 任务状态开始 uploading\r\n submitRequest.call(self, {\r\n Action: 'name/cos:PutObject',\r\n TaskId: params.TaskId,\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n headers: params.Headers,\r\n body: params.Body,\r\n onProgress: onProgress,\r\n }, function (err, data) {\r\n if (err) {\r\n onProgress(null, true);\r\n return callback(err);\r\n }\r\n onProgress({loaded: FileSize, total: FileSize}, true);\r\n if (data) {\r\n var url = getUrl({\r\n ForcePathStyle: self.options.ForcePathStyle,\r\n protocol: self.options.Protocol,\r\n domain: self.options.Domain,\r\n bucket: params.Bucket,\r\n region: params.Region,\r\n object: params.Key,\r\n });\r\n url = url.substr(url.indexOf('://') + 3);\r\n var result = {\r\n Location: url,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n };\r\n if (data.headers && data.headers.etag) {\r\n result.ETag = data.headers.etag;\r\n }\r\n return callback(null, result);\r\n }\r\n callback(null, data);\r\n });\r\n }, params.onHashProgress);\r\n}\r\n\r\n/**\r\n * 删除 object\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @param {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @param {Object} data 删除操作成功之后返回的数据\r\n */\r\nfunction deleteObject(params, callback) {\r\n submitRequest.call(this, {\r\n Action: 'name/cos:DeleteObject',\r\n method: 'DELETE',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n headers: params.Headers,\r\n VersionId: params.VersionId,\r\n }, function (err, data) {\r\n if (err) {\r\n var statusCode = err.statusCode;\r\n if (statusCode && statusCode === 204) {\r\n return callback(null, {statusCode: statusCode});\r\n } else if (statusCode && statusCode === 404) {\r\n return callback(null, {BucketNotFound: true, statusCode: statusCode,});\r\n } else {\r\n return callback(err);\r\n }\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 获取 object 的 权限列表\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {Object} data.AccessControlPolicy 权限列表\r\n */\r\nfunction getObjectAcl(params, callback) {\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:GetObjectACL',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n headers: params.Headers,\r\n action: 'acl',\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var AccessControlPolicy = data.AccessControlPolicy || {};\r\n var Owner = AccessControlPolicy.Owner || {};\r\n var Grant = AccessControlPolicy.AccessControlList && AccessControlPolicy.AccessControlList.Grant || [];\r\n Grant = util.isArray(Grant) ? Grant : [Grant];\r\n var result = decodeAcl(AccessControlPolicy);\r\n if (data.headers && data.headers['x-cos-acl']) {\r\n result.ACL = data.headers['x-cos-acl'];\r\n }\r\n result = util.extend(result, {\r\n Owner: Owner,\r\n Grants: Grant,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n callback(null, result);\r\n });\r\n}\r\n\r\n/**\r\n * 设置 object 的 权限列表\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction putObjectAcl(params, callback) {\r\n var headers = params.Headers;\r\n\r\n var xml = '';\r\n if (params['AccessControlPolicy']) {\r\n var AccessControlPolicy = util.clone(params['AccessControlPolicy'] || {});\r\n var Grants = AccessControlPolicy.Grants || AccessControlPolicy.Grant;\r\n Grants = util.isArray(Grants) ? Grants : [Grants];\r\n delete AccessControlPolicy.Grant;\r\n delete AccessControlPolicy.Grants;\r\n AccessControlPolicy.AccessControlList = {Grant: Grants};\r\n xml = util.json2xml({AccessControlPolicy: AccessControlPolicy});\r\n\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n }\r\n\r\n // Grant Header 去重\r\n util.each(headers, function (val, key) {\r\n if (key.indexOf('x-cos-grant-') === 0) {\r\n headers[key] = uniqGrant(headers[key]);\r\n }\r\n });\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:PutObjectACL',\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n action: 'acl',\r\n headers: headers,\r\n body: xml,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * Options Object请求实现跨域访问的预请求。即发出一个 OPTIONS 请求给服务器以确认是否可以进行跨域操作。\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction optionsObject(params, callback) {\r\n\r\n var headers = params.Headers;\r\n headers['Origin'] = params['Origin'];\r\n headers['Access-Control-Request-Method'] = params['AccessControlRequestMethod'];\r\n headers['Access-Control-Request-Headers'] = params['AccessControlRequestHeaders'];\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:OptionsObject',\r\n method: 'OPTIONS',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n headers: headers,\r\n }, function (err, data) {\r\n if (err) {\r\n if (err.statusCode && err.statusCode === 403) {\r\n return callback(null, {\r\n OptionsForbidden: true,\r\n statusCode: err.statusCode\r\n });\r\n }\r\n return callback(err);\r\n }\r\n\r\n var headers = data.headers || {};\r\n callback(null, {\r\n AccessControlAllowOrigin: headers['access-control-allow-origin'],\r\n AccessControlAllowMethods: headers['access-control-allow-methods'],\r\n AccessControlAllowHeaders: headers['access-control-allow-headers'],\r\n AccessControlExposeHeaders: headers['access-control-expose-headers'],\r\n AccessControlMaxAge: headers['access-control-max-age'],\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * @param {Object} 参数列表\r\n * @param {String} Bucket Bucket 名称\r\n * @param {String} Region 地域名称\r\n * @param {String} Key 文件名称\r\n * @param {String} CopySource 源文件URL绝对路径,可以通过versionid子资源指定历史版本\r\n * @param {String} ACL 允许用户自定义文件权限。有效值:private,public-read默认值:private。\r\n * @param {String} GrantRead 赋予被授权者读的权限,格式 x-cos-grant-read: uin=\" \",uin=\" \",当需要给子账户授权时,uin=\"RootAcountID/SubAccountID\",当需要给根账户授权时,uin=\"RootAcountID\"。\r\n * @param {String} GrantWrite 赋予被授权者写的权限,格式 x-cos-grant-write: uin=\" \",uin=\" \",当需要给子账户授权时,uin=\"RootAcountID/SubAccountID\",当需要给根账户授权时,uin=\"RootAcountID\"。\r\n * @param {String} GrantFullControl 赋予被授权者读写权限,格式 x-cos-grant-full-control: uin=\" \",uin=\" \",当需要给子账户授权时,uin=\"RootAcountID/SubAccountID\",当需要给根账户授权时,uin=\"RootAcountID\"。\r\n * @param {String} MetadataDirective 是否拷贝元数据,枚举值:Copy, Replaced,默认值Copy。假如标记为Copy,忽略Header中的用户元数据信息直接复制;假如标记为Replaced,按Header信息修改元数据。当目标路径和原路径一致,即用户试图修改元数据时,必须为Replaced\r\n * @param {String} CopySourceIfModifiedSince 当Object在指定时间后被修改,则执行操作,否则返回412。可与x-cos-copy-source-If-None-Match一起使用,与其他条件联合使用返回冲突。\r\n * @param {String} CopySourceIfUnmodifiedSince 当Object在指定时间后未被修改,则执行操作,否则返回412。可与x-cos-copy-source-If-Match一起使用,与其他条件联合使用返回冲突。\r\n * @param {String} CopySourceIfMatch 当Object的Etag和给定一致时,则执行操作,否则返回412。可与x-cos-copy-source-If-Unmodified-Since一起使用,与其他条件联合使用返回冲突。\r\n * @param {String} CopySourceIfNoneMatch 当Object的Etag和给定不一致时,则执行操作,否则返回412。可与x-cos-copy-source-If-Modified-Since一起使用,与其他条件联合使用返回冲突。\r\n * @param {String} StorageClass 存储级别,枚举值:存储级别,枚举值:Standard, Standard_IA,Archive;默认值:Standard\r\n * @param {String} CacheControl 指定所有缓存机制在整个请求/响应链中必须服从的指令。\r\n * @param {String} ContentDisposition MIME 协议的扩展,MIME 协议指示 MIME 用户代理如何显示附加的文件\r\n * @param {String} ContentEncoding HTTP 中用来对「采用何种编码格式传输正文」进行协定的一对头部字段\r\n * @param {String} ContentLength 设置响应消息的实体内容的大小,单位为字节\r\n * @param {String} ContentType RFC 2616 中定义的 HTTP 请求内容类型(MIME),例如text/plain\r\n * @param {String} Expect 请求的特定的服务器行为\r\n * @param {String} Expires 响应过期的日期和时间\r\n * @param {String} params.ServerSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: \"AES256\",非必须\r\n * @param {String} ContentLanguage 指定内容语言\r\n * @param {String} x-cos-meta-* 允许用户自定义的头部信息,将作为 Object 元数据返回。大小限制2K。\r\n */\r\nfunction putObjectCopy(params, callback) {\r\n\r\n // 特殊处理 Cache-Control\r\n var headers = params.Headers;\r\n !headers['Cache-Control'] && (headers['Cache-Control'] = '');\r\n\r\n var CopySource = params.CopySource || '';\r\n var m = CopySource.match(/^([^.]+-\\d+)\\.cos(v6)?\\.([^.]+)\\.[^/]+\\/(.+)$/);\r\n if (!m) {\r\n callback({error: 'CopySource format error'});\r\n return;\r\n }\r\n\r\n var SourceBucket = m[1];\r\n var SourceRegion = m[3];\r\n var SourceKey = decodeURIComponent(m[4]);\r\n\r\n submitRequest.call(this, {\r\n Scope: [{\r\n action: 'name/cos:GetObject',\r\n bucket: SourceBucket,\r\n region: SourceRegion,\r\n prefix: SourceKey,\r\n }, {\r\n action: 'name/cos:PutObject',\r\n bucket: params.Bucket,\r\n region: params.Region,\r\n prefix: params.Key,\r\n }],\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n VersionId: params.VersionId,\r\n headers: params.Headers,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var result = util.clone(data.CopyObjectResult || {});\r\n util.extend(result, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n callback(null, result);\r\n });\r\n}\r\n\r\nfunction uploadPartCopy(params, callback) {\r\n\r\n var CopySource = params.CopySource || '';\r\n var m = CopySource.match(/^([^.]+-\\d+)\\.cos(v6)?\\.([^.]+)\\.[^/]+\\/(.+)$/);\r\n if (!m) {\r\n callback({error: 'CopySource format error'});\r\n return;\r\n }\r\n\r\n var SourceBucket = m[1];\r\n var SourceRegion = m[3];\r\n var SourceKey = decodeURIComponent(m[4]);\r\n\r\n submitRequest.call(this, {\r\n Scope: [{\r\n action: 'name/cos:GetObject',\r\n bucket: SourceBucket,\r\n region: SourceRegion,\r\n prefix: SourceKey,\r\n }, {\r\n action: 'name/cos:PutObject',\r\n bucket: params.Bucket,\r\n region: params.Region,\r\n prefix: params.Key,\r\n }],\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n VersionId: params.VersionId,\r\n qs: {\r\n partNumber: params['PartNumber'],\r\n uploadId: params['UploadId'],\r\n },\r\n headers: params.Headers,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var result = util.clone(data.CopyPartResult || {});\r\n util.extend(result, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n callback(null, result);\r\n });\r\n}\r\n\r\nfunction deleteMultipleObject(params, callback) {\r\n var Objects = params.Objects || [];\r\n var Quiet = params.Quiet;\r\n Objects = util.isArray(Objects) ? Objects : [Objects];\r\n\r\n var xml = util.json2xml({Delete: {Object: Objects, Quiet: Quiet || false}});\r\n\r\n var headers = params.Headers;\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n\r\n var Scope = util.map(Objects, function (v) {\r\n return {\r\n action: 'name/cos:DeleteObject',\r\n bucket: params.Bucket,\r\n region: params.Region,\r\n prefix: v.Key,\r\n };\r\n });\r\n\r\n submitRequest.call(this, {\r\n Scope: Scope,\r\n method: 'POST',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n body: xml,\r\n action: 'delete',\r\n headers: headers,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var DeleteResult = data.DeleteResult || {};\r\n var Deleted = DeleteResult.Deleted || [];\r\n var Errors = DeleteResult.Error || [];\r\n\r\n Deleted = util.isArray(Deleted) ? Deleted : [Deleted];\r\n Errors = util.isArray(Errors) ? Errors : [Errors];\r\n\r\n var result = util.clone(DeleteResult);\r\n util.extend(result, {\r\n Error: Errors,\r\n Deleted: Deleted,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n callback(null, result);\r\n });\r\n}\r\n\r\nfunction restoreObject(params, callback) {\r\n var headers = params.Headers;\r\n if (!params['RestoreRequest']) {\r\n callback({error: 'missing param RestoreRequest'});\r\n return;\r\n }\r\n\r\n var RestoreRequest = params.RestoreRequest || {};\r\n var xml = util.json2xml({RestoreRequest: RestoreRequest});\r\n\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:RestoreObject',\r\n method: 'POST',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n VersionId: params.VersionId,\r\n body: xml,\r\n action: 'restore',\r\n headers: headers,\r\n }, function (err, data) {\r\n callback(err, data);\r\n });\r\n}\r\n\r\n\r\n// 分块上传\r\n\r\n\r\n/**\r\n * 初始化分块上传\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {String} params.UploadId object名称,必须\r\n * @param {String} params.CacheControl RFC 2616 中定义的缓存策略,将作为 Object 元数据保存,非必须\r\n * @param {String} params.ContentDisposition RFC 2616 中定义的文件名称,将作为 Object 元数据保存 ,非必须\r\n * @param {String} params.ContentEncoding RFC 2616 中定义的编码格式,将作为 Object 元数据保存,非必须\r\n * @param {String} params.ContentType RFC 2616 中定义的内容类型(MIME),将作为 Object 元数据保存,非必须\r\n * @param {String} params.Expires RFC 2616 中定义的过期时间,将作为 Object 元数据保存,非必须\r\n * @param {String} params.ACL 允许用户自定义文件权限,非必须\r\n * @param {String} params.GrantRead 赋予被授权者读的权限 ,非必须\r\n * @param {String} params.GrantWrite 赋予被授权者写的权限 ,非必须\r\n * @param {String} params.GrantFullControl 赋予被授权者读写权限 ,非必须\r\n * @param {String} params.StorageClass 设置Object的存储级别,枚举值:Standard,Standard_IA,Archive,非必须\r\n * @param {String} params.ServerSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: \"AES256\",非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction multipartInit(params, callback) {\r\n\r\n var self = this;\r\n // 特殊处理 Cache-Control\r\n var headers = params.Headers;\r\n !headers['Cache-Control'] && (headers['Cache-Control'] = '');\r\n util.getBodyMd5(params.Body && (params.UploadAddMetaMd5 || self.options.UploadAddMetaMd5), params.Body, function (md5) {\r\n if (md5) params.Headers['x-cos-meta-md5'] = md5;\r\n submitRequest.call(self, {\r\n Action: 'name/cos:InitiateMultipartUpload',\r\n method: 'POST',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n action: 'uploads',\r\n headers: params.Headers,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n data = util.clone(data || {});\r\n if (data && data.InitiateMultipartUploadResult) {\r\n return callback(null, util.extend(data.InitiateMultipartUploadResult, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n }));\r\n }\r\n callback(null, data);\r\n });\r\n }, params.onHashProgress);\r\n}\r\n\r\n/**\r\n * 分块上传\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {File || Blob || String} params.Body 上传文件对象或字符串\r\n * @param {String} params.ContentLength RFC 2616 中定义的 HTTP 请求内容长度(字节),非必须\r\n * @param {String} params.Expect 当使用 Expect: 100-continue 时,在收到服务端确认后,才会发送请求内容,非必须\r\n * @param {String} params.ServerSideEncryption 支持按照指定的加密算法进行服务端数据加密,格式 x-cos-server-side-encryption: \"AES256\",非必须\r\n * @param {String} params.ContentSha1 RFC 3174 中定义的 160-bit 内容 SHA-1 算法校验值,非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {Object} data.ETag 返回的文件分块 sha1 值\r\n */\r\nfunction multipartUpload(params, callback) {\r\n\r\n var self = this;\r\n util.getFileSize('multipartUpload', params, function () {\r\n util.getBodyMd5(self.options.UploadCheckContentMd5, params.Body, function (md5) {\r\n if (md5) params.Headers['Content-MD5'] = util.binaryBase64(md5);\r\n submitRequest.call(self, {\r\n Action: 'name/cos:UploadPart',\r\n TaskId: params.TaskId,\r\n method: 'PUT',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n qs: {\r\n partNumber: params['PartNumber'],\r\n uploadId: params['UploadId'],\r\n },\r\n headers: params.Headers,\r\n onProgress: params.onProgress,\r\n body: params.Body || null\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n data['headers'] = data['headers'] || {};\r\n callback(null, {\r\n ETag: data['headers']['etag'] || '',\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n });\r\n });\r\n\r\n}\r\n\r\n/**\r\n * 完成分块上传\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {Array} params.Parts 分块信息列表,必须\r\n * @param {String} params.Parts[i].PartNumber 块编号,必须\r\n * @param {String} params.Parts[i].ETag 分块的 sha1 校验值\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {Object} data.CompleteMultipartUpload 完成分块上传后的文件信息,包括Location, Bucket, Key 和 ETag\r\n */\r\nfunction multipartComplete(params, callback) {\r\n var self = this;\r\n\r\n var UploadId = params.UploadId;\r\n\r\n var Parts = params['Parts'];\r\n\r\n for (var i = 0, len = Parts.length; i < len; i++) {\r\n if (Parts[i]['ETag'].indexOf('\"') === 0) {\r\n continue;\r\n }\r\n Parts[i]['ETag'] = '\"' + Parts[i]['ETag'] + '\"';\r\n }\r\n\r\n var xml = util.json2xml({CompleteMultipartUpload: {Part: Parts}});\r\n\r\n var headers = params.Headers;\r\n headers['Content-Type'] = 'application/xml';\r\n headers['Content-MD5'] = util.binaryBase64(util.md5(xml));\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:CompleteMultipartUpload',\r\n method: 'POST',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n qs: {\r\n uploadId: UploadId\r\n },\r\n body: xml,\r\n headers: headers,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var url = getUrl({\r\n ForcePathStyle: self.options.ForcePathStyle,\r\n protocol: self.options.Protocol,\r\n domain: self.options.Domain,\r\n bucket: params.Bucket,\r\n region: params.Region,\r\n object: params.Key,\r\n isLocation: true,\r\n });\r\n var CompleteMultipartUploadResult = data.CompleteMultipartUploadResult || {};\r\n var result = util.extend(CompleteMultipartUploadResult, {\r\n Location: url,\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n callback(null, result);\r\n });\r\n}\r\n\r\n/**\r\n * 分块上传任务列表查询\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Delimiter 定界符为一个符号,如果有Prefix,则将Prefix到delimiter之间的相同路径归为一类,定义为Common Prefix,然后列出所有Common Prefix。如果没有Prefix,则从路径起点开始,非必须\r\n * @param {String} params.EncodingType 规定返回值的编码方式,非必须\r\n * @param {String} params.Prefix 前缀匹配,用来规定返回的文件前缀地址,非必须\r\n * @param {String} params.MaxUploads 单次返回最大的条目数量,默认1000,非必须\r\n * @param {String} params.KeyMarker 与upload-id-marker一起使用 </Br>当upload-id-marker未被指定时,ObjectName字母顺序大于key-marker的条目将被列出 </Br>当upload-id-marker被指定时,ObjectName字母顺序大于key-marker的条目被列出,ObjectName字母顺序等于key-marker同时UploadId大于upload-id-marker的条目将被列出,非必须\r\n * @param {String} params.UploadIdMarker 与key-marker一起使用 </Br>当key-marker未被指定时,upload-id-marker将被忽略 </Br>当key-marker被指定时,ObjectName字母顺序大于key-marker的条目被列出,ObjectName字母顺序等于key-marker同时UploadId大于upload-id-marker的条目将被列出,非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {Object} data.ListMultipartUploadsResult 分块上传任务信息\r\n */\r\nfunction multipartList(params, callback) {\r\n var reqParams = {};\r\n\r\n reqParams['delimiter'] = params['Delimiter'];\r\n reqParams['encoding-type'] = params['EncodingType'];\r\n reqParams['prefix'] = params['Prefix'] || '';\r\n\r\n reqParams['max-uploads'] = params['MaxUploads'];\r\n\r\n reqParams['key-marker'] = params['KeyMarker'];\r\n reqParams['upload-id-marker'] = params['UploadIdMarker'];\r\n\r\n reqParams = util.clearKey(reqParams);\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:ListMultipartUploads',\r\n ResourceKey: reqParams['prefix'],\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n headers: params.Headers,\r\n qs: reqParams,\r\n action: 'uploads',\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n\r\n if (data && data.ListMultipartUploadsResult) {\r\n var Upload = data.ListMultipartUploadsResult.Upload || [];\r\n\r\n var CommonPrefixes = data.ListMultipartUploadsResult.CommonPrefixes || [];\r\n\r\n CommonPrefixes = util.isArray(CommonPrefixes) ? CommonPrefixes : [CommonPrefixes];\r\n Upload = util.isArray(Upload) ? Upload : [Upload];\r\n\r\n data.ListMultipartUploadsResult.Upload = Upload;\r\n data.ListMultipartUploadsResult.CommonPrefixes = CommonPrefixes;\r\n }\r\n var result = util.clone(data.ListMultipartUploadsResult || {});\r\n util.extend(result, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n callback(null, result);\r\n });\r\n}\r\n\r\n/**\r\n * 上传的分块列表查询\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {String} params.UploadId 标示本次分块上传的ID,必须\r\n * @param {String} params.EncodingType 规定返回值的编码方式,非必须\r\n * @param {String} params.MaxParts 单次返回最大的条目数量,默认1000,非必须\r\n * @param {String} params.PartNumberMarker 默认以UTF-8二进制顺序列出条目,所有列出条目从marker开始,非必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n * @return {Object} data.ListMultipartUploadsResult 分块信息\r\n */\r\nfunction multipartListPart(params, callback) {\r\n var reqParams = {};\r\n\r\n reqParams['uploadId'] = params['UploadId'];\r\n reqParams['encoding-type'] = params['EncodingType'];\r\n reqParams['max-parts'] = params['MaxParts'];\r\n reqParams['part-number-marker'] = params['PartNumberMarker'];\r\n\r\n submitRequest.call(this, {\r\n Action: 'name/cos:ListParts',\r\n method: 'GET',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n headers: params.Headers,\r\n qs: reqParams,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n var ListPartsResult = data.ListPartsResult || {};\r\n var Part = ListPartsResult.Part || [];\r\n Part = util.isArray(Part) ? Part : [Part];\r\n\r\n ListPartsResult.Part = Part;\r\n var result = util.clone(ListPartsResult);\r\n util.extend(result, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n callback(null, result);\r\n });\r\n}\r\n\r\n/**\r\n * 抛弃分块上传\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {String} params.UploadId 标示本次分块上传的ID,必须\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction multipartAbort(params, callback) {\r\n var reqParams = {};\r\n\r\n reqParams['uploadId'] = params['UploadId'];\r\n submitRequest.call(this, {\r\n Action: 'name/cos:AbortMultipartUpload',\r\n method: 'DELETE',\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n headers: params.Headers,\r\n qs: reqParams,\r\n }, function (err, data) {\r\n if (err) {\r\n return callback(err);\r\n }\r\n callback(null, {\r\n statusCode: data.statusCode,\r\n headers: data.headers,\r\n });\r\n });\r\n}\r\n\r\n/**\r\n * 获取签名\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Method 请求方法,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {String} params.Expires 名超时时间,单位秒,可选\r\n * @return {String} data 返回签名字符串\r\n */\r\nfunction getAuth(params) {\r\n var self = this;\r\n return util.getAuth({\r\n SecretId: params.SecretId || this.options.SecretId || '',\r\n SecretKey: params.SecretKey || this.options.SecretKey || '',\r\n Method: params.Method,\r\n Key: params.Key,\r\n Query: params.Query,\r\n Headers: params.Headers,\r\n Expires: params.Expires,\r\n UseRawKey: self.options.UseRawKey,\r\n SystemClockOffset: self.options.SystemClockOffset,\r\n });\r\n}\r\n\r\n/**\r\n * 获取文件下载链接\r\n * @param {Object} params 参数对象,必须\r\n * @param {String} params.Bucket Bucket名称,必须\r\n * @param {String} params.Region 地域名称,必须\r\n * @param {String} params.Key object名称,必须\r\n * @param {String} params.Method 请求的方法,可选\r\n * @param {String} params.Expires 签名超时时间,单位秒,可选\r\n * @param {Function} callback 回调函数,必须\r\n * @return {Object} err 请求失败的错误,如果请求成功,则为空。https://cloud.tencent.com/document/product/436/7730\r\n * @return {Object} data 返回的数据\r\n */\r\nfunction getObjectUrl(params, callback) {\r\n var self = this;\r\n var url = getUrl({\r\n ForcePathStyle: self.options.ForcePathStyle,\r\n protocol: params.Protocol || self.options.Protocol,\r\n domain: self.options.Domain,\r\n bucket: params.Bucket,\r\n region: params.Region,\r\n object: params.Key,\r\n });\r\n if (params.Sign !== undefined && !params.Sign) {\r\n callback(null, {Url: url});\r\n return url;\r\n }\r\n var AuthData = getAuthorizationAsync.call(this, {\r\n Action: ((params.Method || '').toUpperCase() === 'PUT' ? 'name/cos:PutObject' : 'name/cos:GetObject'),\r\n Bucket: params.Bucket || '',\r\n Region: params.Region || '',\r\n Method: params.Method || 'get',\r\n Key: params.Key,\r\n Expires: params.Expires,\r\n }, function (err, AuthData) {\r\n if (!callback) return;\r\n if (err) {\r\n callback(err);\r\n return;\r\n }\r\n var signUrl = url;\r\n signUrl += '?' + (AuthData.Authorization.indexOf('q-signature') > -1 ?\r\n AuthData.Authorization : 'sign=' + encodeURIComponent(AuthData.Authorization));\r\n AuthData.XCosSecurityToken && (signUrl += '&x-cos-security-token=' + AuthData.XCosSecurityToken);\r\n AuthData.ClientIP && (signUrl += '&clientIP=' + AuthData.ClientIP);\r\n AuthData.ClientUA && (signUrl += '&clientUA=' + AuthData.ClientUA);\r\n AuthData.Token && (signUrl += '&token=' + AuthData.Token);\r\n setTimeout(function () {\r\n callback(null, {Url: signUrl});\r\n });\r\n });\r\n if (AuthData) {\r\n return url + '?' + AuthData.Authorization +\r\n (AuthData.XCosSecurityToken ? '&x-cos-security-token=' + AuthData.XCosSecurityToken : '');\r\n } else {\r\n return url;\r\n }\r\n}\r\n\r\n\r\n/**\r\n * 私有方法\r\n */\r\nfunction decodeAcl(AccessControlPolicy) {\r\n var result = {\r\n GrantFullControl: [],\r\n GrantWrite: [],\r\n GrantRead: [],\r\n GrantReadAcp: [],\r\n GrantWriteAcp: [],\r\n ACL: '',\r\n };\r\n var GrantMap = {\r\n 'FULL_CONTROL': 'GrantFullControl',\r\n 'WRITE': 'GrantWrite',\r\n 'READ': 'GrantRead',\r\n 'READ_ACP': 'GrantReadAcp',\r\n 'WRITE_ACP': 'GrantWriteAcp',\r\n };\r\n var AccessControlList = AccessControlPolicy && AccessControlPolicy.AccessControlList || {};\r\n var Grant = AccessControlList.Grant;\r\n if (Grant) {\r\n Grant = util.isArray(Grant) ? Grant : [Grant];\r\n }\r\n var PublicAcl = {READ: 0, WRITE: 0, FULL_CONTROL: 0};\r\n Grant && Grant.length && util.each(Grant, function (item) {\r\n if (item.Grantee.ID === 'qcs::cam::anyone:anyone' || item.Grantee.URI === 'http://cam.qcloud.com/groups/global/AllUsers') {\r\n PublicAcl[item.Permission] = 1;\r\n } else if (item.Grantee.ID !== AccessControlPolicy.Owner.ID) {\r\n result[GrantMap[item.Permission]].push('id=\"' + item.Grantee.ID + '\"');\r\n }\r\n });\r\n if (PublicAcl.FULL_CONTROL || (PublicAcl.WRITE && PublicAcl.READ)) {\r\n result.ACL = 'public-read-write';\r\n } else if (PublicAcl.READ) {\r\n result.ACL = 'public-read';\r\n } else {\r\n result.ACL = 'private';\r\n }\r\n util.each(GrantMap, function (item) {\r\n result[item] = uniqGrant(result[item].join(','));\r\n });\r\n return result;\r\n}\r\n\r\n// Grant 去重\r\nfunction uniqGrant(str) {\r\n var arr = str.split(',');\r\n var exist = {};\r\n var i, item;\r\n for (i = 0; i < arr.length; ) {\r\n item = arr[i].trim();\r\n if (exist[item]) {\r\n arr.splice(i, 1);\r\n } else {\r\n exist[item] = true;\r\n arr[i] = item;\r\n i++;\r\n }\r\n }\r\n return arr.join(',');\r\n}\r\n\r\n// 生成操作 url\r\nfunction getUrl(params) {\r\n var longBucket = params.bucket;\r\n var shortBucket = longBucket.substr(0, longBucket.lastIndexOf('-'));\r\n var appId = longBucket.substr(longBucket.lastIndexOf('-') + 1);\r\n var domain = params.domain;\r\n var region = params.region;\r\n var object = params.object;\r\n var protocol = params.protocol || (util.isBrowser && location.protocol === 'http:' ? 'http:' : 'https:');\r\n if (!domain) {\r\n if (['cn-south', 'cn-south-2', 'cn-north', 'cn-east', 'cn-southwest', 'sg'].indexOf(region) > -1) {\r\n domain = '{Region}.myqcloud.com';\r\n } else {\r\n domain = 'cos.{Region}.myqcloud.com';\r\n }\r\n if (!params.ForcePathStyle) {\r\n domain = '{Bucket}.' + domain;\r\n }\r\n }\r\n domain = domain.replace(/\\{\\{AppId\\}\\}/ig, appId)\r\n .replace(/\\{\\{Bucket\\}\\}/ig, shortBucket)\r\n .replace(/\\{\\{Region\\}\\}/ig, region)\r\n .replace(/\\{\\{.*?\\}\\}/ig, '');\r\n domain = domain.replace(/\\{AppId\\}/ig, appId)\r\n .replace(/\\{BucketName\\}/ig, shortBucket)\r\n .replace(/\\{Bucket\\}/ig, longBucket)\r\n .replace(/\\{Region\\}/ig, region)\r\n .replace(/\\{.*?\\}/ig, '');\r\n if (!/^[a-zA-Z]+:\\/\\//.test(domain)) {\r\n domain = protocol + '//' + domain;\r\n }\r\n\r\n // 去掉域名最后的斜杆\r\n if (domain.slice(-1) === '/') {\r\n domain = domain.slice(0, -1);\r\n }\r\n var url = domain;\r\n\r\n if (params.ForcePathStyle) {\r\n url += '/' + longBucket;\r\n }\r\n url += '/';\r\n if (object) {\r\n url += util.camSafeUrlEncode(object).replace(/%2F/g, '/');\r\n }\r\n\r\n if (params.isLocation) {\r\n url = url.replace(/^https?:\\/\\//, '');\r\n }\r\n return url;\r\n}\r\n\r\n// 异步获取签名\r\nfunction getAuthorizationAsync(params, callback) {\r\n\r\n var headers = util.clone(params.Headers);\r\n delete headers['Content-Type'];\r\n delete headers['Cache-Control'];\r\n util.each(headers, function (v, k) {\r\n v === '' && delete headers[k];\r\n });\r\n\r\n var cb = function (AuthData) {\r\n\r\n // 检查签名格式\r\n var formatAllow = false;\r\n var auth = AuthData.Authorization;\r\n if (auth) {\r\n if (auth.indexOf(' ') > -1) {\r\n formatAllow = false;\r\n } else if (auth.indexOf('q-sign-algorithm=') > -1 &&\r\n auth.indexOf('q-ak=') > -1 &&\r\n auth.indexOf('q-sign-time=') > -1 &&\r\n auth.indexOf('q-key-time=') > -1 &&\r\n auth.indexOf('q-url-param-list=') > -1) {\r\n formatAllow = true;\r\n } else {\r\n try {\r\n auth = atob(auth);\r\n if (auth.indexOf('a=') > -1 &&\r\n auth.indexOf('k=') > -1 &&\r\n auth.indexOf('t=') > -1 &&\r\n auth.indexOf('r=') > -1 &&\r\n auth.indexOf('b=') > -1) {\r\n formatAllow = true;\r\n }\r\n } catch (e) {}\r\n }\r\n }\r\n if (formatAllow) {\r\n callback && callback(null, AuthData);\r\n } else {\r\n callback && callback('authorization error');\r\n }\r\n };\r\n\r\n var self = this;\r\n var Bucket = params.Bucket || '';\r\n var Region = params.Region || '';\r\n\r\n // PathName\r\n var KeyName = params.Key || '';\r\n if (self.options.ForcePathStyle && Bucket) {\r\n KeyName = Bucket + '/' + KeyName;\r\n }\r\n var Pathname = '/' + KeyName;\r\n\r\n // Action、ResourceKey\r\n var StsData = {};\r\n var Scope = params.Scope;\r\n if (!Scope) {\r\n var Action = params.Action || '';\r\n var ResourceKey = params.ResourceKey || params.Key || '';\r\n Scope = params.Scope || [{\r\n action: Action,\r\n bucket: Bucket,\r\n region: Region,\r\n prefix: ResourceKey,\r\n }];\r\n }\r\n var ScopeKey = util.md5(JSON.stringify(Scope));\r\n\r\n // STS\r\n self._StsCache = self._StsCache ||[];\r\n (function () {\r\n var i, AuthData;\r\n for (i = self._StsCache.length - 1; i >= 0; i--) {\r\n AuthData = self._StsCache[i];\r\n var compareTime = Math.round(util.getSkewTime(self.options.SystemClockOffset) / 1000) + 30;\r\n if (AuthData.StartTime && compareTime < AuthData.StartTime || compareTime >= AuthData.ExpiredTime) {\r\n self._StsCache.splice(i, 1);\r\n continue;\r\n }\r\n if (!AuthData.ScopeLimit || AuthData.ScopeLimit && AuthData.ScopeKey === ScopeKey) {\r\n StsData = AuthData;\r\n break;\r\n }\r\n }\r\n })();\r\n\r\n var calcAuthByTmpKey = function () {\r\n var KeyTime = StsData.StartTime && StsData.ExpiredTime ? StsData.StartTime + ';' + StsData.ExpiredTime : '';\r\n var Authorization = util.getAuth({\r\n SecretId: StsData.TmpSecretId,\r\n SecretKey: StsData.TmpSecretKey,\r\n Method: params.Method,\r\n Pathname: Pathname,\r\n Query: params.Query,\r\n Headers: headers,\r\n Expires: params.Expires,\r\n UseRawKey: self.options.UseRawKey,\r\n SystemClockOffset: self.options.SystemClockOffset,\r\n KeyTime: KeyTime\r\n });\r\n var AuthData = {\r\n Authorization: Authorization,\r\n XCosSecurityToken: StsData.XCosSecurityToken || '',\r\n Token: StsData.Token || '',\r\n ClientIP: StsData.ClientIP || '',\r\n ClientUA: StsData.ClientUA || '',\r\n };\r\n cb(AuthData);\r\n };\r\n\r\n // 先判断是否有临时密钥\r\n if (StsData.ExpiredTime && StsData.ExpiredTime - (util.getSkewTime(self.options.SystemClockOffset) / 1000) > 60) { // 如果缓存的临时密钥有效,并还有超过60秒有效期就直接使用\r\n calcAuthByTmpKey();\r\n } else if (self.options.getAuthorization) { // 外部计算签名或获取临时密钥\r\n self.options.getAuthorization.call(self, {\r\n Bucket: Bucket,\r\n Region: Region,\r\n Method: params.Method,\r\n Key: KeyName,\r\n Pathname: Pathname,\r\n Query: params.Query,\r\n Headers: headers,\r\n Scope: Scope,\r\n }, function (AuthData) {\r\n if (typeof AuthData === 'string') {\r\n AuthData = {Authorization: AuthData};\r\n }\r\n if (AuthData.TmpSecretId &&\r\n AuthData.TmpSecretKey &&\r\n AuthData.XCosSecurityToken &&\r\n AuthData.ExpiredTime) {\r\n StsData = AuthData || {};\r\n StsData.Scope = Scope;\r\n StsData.ScopeKey = ScopeKey;\r\n self._StsCache.push(StsData);\r\n calcAuthByTmpKey();\r\n } else {\r\n cb(AuthData);\r\n }\r\n });\r\n } else if (self.options.getSTS) { // 外部获取临时密钥\r\n self.options.getSTS.call(self, {\r\n Bucket: Bucket,\r\n Region: Region,\r\n }, function (data) {\r\n StsData = data || {};\r\n StsData.Scope = Scope;\r\n StsData.ScopeKey = ScopeKey;\r\n StsData.TmpSecretId = StsData.SecretId;\r\n StsData.TmpSecretKey = StsData.SecretKey;\r\n self._StsCache.push(StsData);\r\n calcAuthByTmpKey();\r\n });\r\n } else { // 内部计算获取签名\r\n return (function () {\r\n var Authorization = util.getAuth({\r\n SecretId: params.SecretId || self.options.SecretId,\r\n SecretKey: params.SecretKey || self.options.SecretKey,\r\n Method: params.Method,\r\n Pathname: Pathname,\r\n Query: params.Query,\r\n Headers: headers,\r\n Expires: params.Expires,\r\n UseRawKey: self.options.UseRawKey,\r\n SystemClockOffset: self.options.SystemClockOffset,\r\n });\r\n var AuthData = {\r\n Authorization: Authorization,\r\n XCosSecurityToken: self.options.XCosSecurityToken,\r\n };\r\n cb(AuthData);\r\n return AuthData;\r\n })();\r\n }\r\n return '';\r\n}\r\n\r\n// 调整时间偏差\r\nfunction allowRetry(err) {\r\n var allowRetry = false;\r\n var isTimeError = false;\r\n var serverDate = (err.headers && (err.headers.date || err.headers.Date)) || (err.error && err.error.ServerTime);\r\n try {\r\n var errorCode = err.error.Code;\r\n var errorMessage = err.error.Message;\r\n if (errorCode === 'RequestTimeTooSkewed' ||\r\n (errorCode === 'AccessDenied' && errorMessage === 'Request has expired')) {\r\n isTimeError = true;\r\n }\r\n } catch (e) {\r\n }\r\n if (err) {\r\n if (isTimeError && serverDate) {\r\n var serverTime = Date.parse(serverDate);\r\n if (this.options.CorrectClockSkew && Math.abs(util.getSkewTime(this.options.SystemClockOffset) - serverTime) >= 30000) {\r\n console.error('error: Local time is too skewed.');\r\n this.options.SystemClockOffset = serverTime - Date.now();\r\n allowRetry = true;\r\n }\r\n } else if (Math.round(err.statusCode / 100) === 5) {\r\n allowRetry = true;\r\n }\r\n }\r\n return allowRetry;\r\n}\r\n\r\n// 获取签名并发起请求\r\nfunction submitRequest(params, callback) {\r\n var self = this;\r\n\r\n // 处理 headers\r\n !params.headers && (params.headers = {});\r\n\r\n // 处理 query\r\n !params.qs && (params.qs = {});\r\n params.VersionId && (params.qs.versionId = params.VersionId);\r\n params.qs = util.clearKey(params.qs);\r\n\r\n // 清理 undefined 和 null 字段\r\n params.headers && (params.headers = util.clearKey(params.headers));\r\n params.qs && (params.qs = util.clearKey(params.qs));\r\n\r\n var Query = util.clone(params.qs);\r\n params.action && (Query[params.action] = '');\r\n\r\n var next = function (tryTimes) {\r\n var oldClockOffset = self.options.SystemClockOffset;\r\n getAuthorizationAsync.call(self, {\r\n Bucket: params.Bucket || '',\r\n Region: params.Region || '',\r\n Method: params.method,\r\n Key: params.Key,\r\n Query: Query,\r\n Headers: params.headers,\r\n Action: params.Action,\r\n ResourceKey: params.ResourceKey,\r\n Scope: params.Scope,\r\n }, function (err, AuthData) {\r\n if (err) {\r\n callback(err);\r\n return;\r\n }\r\n params.AuthData = AuthData;\r\n _submitRequest.call(self, params, function (err, data) {\r\n if (err && tryTimes < 2 && (oldClockOffset !== self.options.SystemClockOffset || allowRetry.call(self, err))) {\r\n if (params.headers) {\r\n delete params.headers.Authorization;\r\n delete params.headers['token'];\r\n delete params.headers['clientIP'];\r\n delete params.headers['clientUA'];\r\n delete params.headers['x-cos-security-token'];\r\n }\r\n next(tryTimes + 1);\r\n } else {\r\n callback(err, data);\r\n }\r\n });\r\n });\r\n };\r\n next(1);\r\n\r\n}\r\n\r\n// 发起请求\r\nfunction _submitRequest(params, callback) {\r\n var self = this;\r\n var TaskId = params.TaskId;\r\n if (TaskId && !self._isRunningTask(TaskId)) return;\r\n\r\n var bucket = params.Bucket;\r\n var region = params.Region;\r\n var object = params.Key;\r\n var method = params.method || 'GET';\r\n var url = params.url;\r\n var body = params.body;\r\n var json = params.json;\r\n var rawBody = params.rawBody;\r\n\r\n // url\r\n url = url || getUrl({\r\n ForcePathStyle: self.options.ForcePathStyle,\r\n protocol: self.options.Protocol,\r\n domain: self.options.Domain,\r\n bucket: bucket,\r\n region: region,\r\n object: object,\r\n });\r\n if (params.action) {\r\n url = url + '?' + params.action;\r\n }\r\n\r\n var opt = {\r\n method: method,\r\n url: url,\r\n headers: params.headers,\r\n qs: params.qs,\r\n body: body,\r\n json: json,\r\n };\r\n\r\n // 获取签名\r\n opt.headers.Authorization = params.AuthData.Authorization;\r\n params.AuthData.Token && (opt.headers['token'] = params.AuthData.Token);\r\n params.AuthData.ClientIP && (opt.headers['clientIP'] = params.AuthData.ClientIP);\r\n params.AuthData.ClientUA && (opt.headers['clientUA'] = params.AuthData.ClientUA);\r\n params.AuthData.XCosSecurityToken && (opt.headers['x-cos-security-token'] = params.AuthData.XCosSecurityToken);\r\n\r\n // 清理 undefined 和 null 字段\r\n opt.headers && (opt.headers = util.clearKey(opt.headers));\r\n opt = util.clearKey(opt);\r\n\r\n // progress\r\n if (params.onProgress && typeof params.onProgress === 'function') {\r\n var contentLength = body && (body.size || body.length) || 0;\r\n opt.onProgress = function (e) {\r\n if (TaskId && !self._isRunningTask(TaskId)) return;\r\n var loaded = e ? e.loaded : 0;\r\n params.onProgress({loaded: loaded, total: contentLength});\r\n };\r\n }\r\n if (this.options.Timeout) {\r\n opt.timeout = this.options.Timeout;\r\n }\r\n\r\n self.emit('before-send', opt);\r\n var sender = REQUEST(opt, function (err, response, body) {\r\n if (err === 'abort') return;\r\n\r\n // 返回内容添加 状态码 和 headers\r\n var hasReturned;\r\n var cb = function (err, data) {\r\n TaskId && self.off('inner-kill-task', killTask);\r\n if (hasReturned) return;\r\n hasReturned = true;\r\n var attrs = {};\r\n response && response.statusCode && (attrs.statusCode = response.statusCode);\r\n response && response.headers && (attrs.headers = response.headers);\r\n\r\n if (err) {\r\n err = util.extend(err || {}, attrs);\r\n callback(err, null);\r\n } else {\r\n data = util.extend(data || {}, attrs);\r\n callback(null, data);\r\n }\r\n sender = null;\r\n };\r\n\r\n // 请求错误,发生网络错误\r\n if (err) {\r\n cb({error: err});\r\n return;\r\n }\r\n\r\n var jsonRes;\r\n\r\n // 不对 body 进行转换,body 直接挂载返回\r\n if(rawBody) {\r\n jsonRes = {};\r\n jsonRes.body = body;\r\n } else {\r\n try {\r\n jsonRes = body && body.indexOf('<') > -1 && body.indexOf('>') > -1 && util.xml2json(body) || {};\r\n } catch (e) {\r\n jsonRes = body || {};\r\n }\r\n }\r\n\r\n // 请求返回码不为 200\r\n var statusCode = response.statusCode;\r\n var statusSuccess = Math.floor(statusCode / 100) === 2; // 200 202 204 206\r\n if (!statusSuccess) {\r\n cb({error: jsonRes.Error || jsonRes});\r\n return;\r\n }\r\n\r\n\r\n if (jsonRes.Error) {\r\n cb({error: jsonRes.Error});\r\n return;\r\n }\r\n cb(null, jsonRes);\r\n });\r\n\r\n // kill task\r\n var killTask = function (data) {\r\n if (data.TaskId === TaskId) {\r\n sender && sender.abort && sender.abort();\r\n self.off('inner-kill-task', killTask);\r\n }\r\n };\r\n TaskId && self.on('inner-kill-task', killTask);\r\n\r\n}\r\n\r\n\r\nvar API_MAP = {\r\n // Bucket 相关方法\r\n getService: getService, // Bucket\r\n putBucket: putBucket,\r\n headBucket: headBucket, // Bucket\r\n getBucket: getBucket,\r\n deleteBucket: deleteBucket,\r\n putBucketAcl: putBucketAcl, // BucketACL\r\n getBucketAcl: getBucketAcl,\r\n putBucketCors: putBucketCors, // BucketCors\r\n getBucketCors: getBucketCors,\r\n deleteBucketCors: deleteBucketCors,\r\n getBucketLocation: getBucketLocation, // BucketLocation\r\n getBucketPolicy: getBucketPolicy, // BucketPolicy\r\n putBucketPolicy: putBucketPolicy,\r\n deleteBucketPolicy: deleteBucketPolicy,\r\n putBucketTagging: putBucketTagging, // BucketTagging\r\n getBucketTagging: getBucketTagging,\r\n deleteBucketTagging: deleteBucketTagging,\r\n putBucketLifecycle: putBucketLifecycle, // BucketLifecycle\r\n getBucketLifecycle: getBucketLifecycle,\r\n deleteBucketLifecycle: deleteBucketLifecycle,\r\n putBucketVersioning: putBucketVersioning, // BucketVersioning\r\n getBucketVersioning: getBucketVersioning,\r\n putBucketReplication: putBucketReplication, // BucketReplication\r\n getBucketReplication: getBucketReplication,\r\n deleteBucketReplication: deleteBucketReplication,\r\n putBucketWebsite: putBucketWebsite, // BucketWebsite\r\n getBucketWebsite: getBucketWebsite,\r\n deleteBucketWebsite: deleteBucketWebsite,\r\n\r\n // Object 相关方法\r\n getObject: getObject,\r\n headObject: headObject,\r\n listObjectVersions: listObjectVersions,\r\n putObject: putObject,\r\n deleteObject: deleteObject,\r\n getObjectAcl: getObjectAcl,\r\n putObjectAcl: putObjectAcl,\r\n optionsObject: optionsObject,\r\n putObjectCopy: putObjectCopy,\r\n deleteMultipleObject: deleteMultipleObject,\r\n restoreObject: restoreObject,\r\n\r\n // 分块上传相关方法\r\n uploadPartCopy: uploadPartCopy,\r\n multipartInit: multipartInit,\r\n multipartUpload: multipartUpload,\r\n multipartComplete: multipartComplete,\r\n multipartList: multipartList,\r\n multipartListPart: multipartListPart,\r\n multipartAbort: multipartAbort,\r\n\r\n // 工具方法\r\n getObjectUrl: getObjectUrl,\r\n getAuth: getAuth,\r\n};\r\n\r\nfunction warnOldApi(apiName, fn, proto) {\r\n util.each(['Cors', 'Acl'], function (suffix) {\r\n if (apiName.slice(-suffix.length) === suffix) {\r\n var oldName = apiName.slice(0, -suffix.length) + suffix.toUpperCase();\r\n var apiFn = util.apiWrapper(apiName, fn);\r\n var warned = false;\r\n proto[oldName] = function () {\r\n !warned && console.warn('warning: cos.' + oldName + ' has been deprecated. Please Use cos.' + apiName + ' instead.');\r\n warned = true;\r\n apiFn.apply(this, arguments);\r\n };\r\n }\r\n });\r\n}\r\n\r\nmodule.exports.init = function (COS, task) {\r\n task.transferToTaskMethod(API_MAP, 'putObject');\r\n util.each(API_MAP, function (fn, apiName) {\r\n COS.prototype[apiName] = util.apiWrapper(apiName, fn);\r\n warnOldApi(apiName, fn, COS.prototype);\r\n });\r\n};\r\n","//copyright Ryan Day 2010 <http://ryanday.org>, Joscha Feth 2013 <http://www.feth.com> [MIT Licensed]\r\n\r\nvar element_start_char =\r\n \"a-zA-Z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u00FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FFF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\";\r\nvar element_non_start_char = \"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F\\u2040\";\r\nvar element_replace = new RegExp(\"^([^\" + element_start_char + \"])|^((x|X)(m|M)(l|L))|([^\" + element_start_char + element_non_start_char + \"])\", \"g\");\r\nvar not_safe_in_xml = /[^\\x09\\x0A\\x0D\\x20-\\xFF\\x85\\xA0-\\uD7FF\\uE000-\\uFDCF\\uFDE0-\\uFFFD]/gm;\r\n\r\nvar objKeys = function (obj) {\r\n var l = [];\r\n if (obj instanceof Object) {\r\n for (var k in obj) {\r\n if (obj.hasOwnProperty(k)) {\r\n l.push(k);\r\n }\r\n }\r\n }\r\n return l;\r\n};\r\nvar process_to_xml = function (node_data, options) {\r\n\r\n var makeNode = function (name, content, attributes, level, hasSubNodes) {\r\n var indent_value = options.indent !== undefined ? options.indent : \"\\t\";\r\n var indent = options.prettyPrint ? '\\n' + new Array(level).join(indent_value) : '';\r\n if (options.removeIllegalNameCharacters) {\r\n name = name.replace(element_replace, '_');\r\n }\r\n\r\n var node = [indent, '<', name, (attributes || '')];\r\n if (content && content.length > 0) {\r\n node.push('>')\r\n node.push(content);\r\n hasSubNodes && node.push(indent);\r\n node.push('</');\r\n node.push(name);\r\n node.push('>');\r\n } else {\r\n node.push('/>');\r\n }\r\n return node.join('');\r\n };\r\n\r\n return (function fn(node_data, node_descriptor, level) {\r\n var type = typeof node_data;\r\n if ((Array.isArray) ? Array.isArray(node_data) : node_data instanceof Array) {\r\n type = 'array';\r\n } else if (node_data instanceof Date) {\r\n type = 'date';\r\n }\r\n\r\n switch (type) {\r\n //if value is an array create child nodes from values\r\n case 'array':\r\n var ret = [];\r\n node_data.map(function (v) {\r\n ret.push(fn(v, 1, level + 1));\r\n //entries that are values of an array are the only ones that can be special node descriptors\r\n });\r\n options.prettyPrint && ret.push('\\n');\r\n return ret.join('');\r\n break;\r\n\r\n case 'date':\r\n // cast dates to ISO 8601 date (soap likes it)\r\n return node_data.toJSON ? node_data.toJSON() : node_data + '';\r\n break;\r\n\r\n case 'object':\r\n var nodes = [];\r\n for (var name in node_data) {\r\n if (node_data.hasOwnProperty(name)) {\r\n if (node_data[name] instanceof Array) {\r\n for (var j = 0; j < node_data[name].length; j++) {\r\n if (node_data[name].hasOwnProperty(j)) {\r\n nodes.push(makeNode(name, fn(node_data[name][j], 0, level + 1), null, level + 1, objKeys(node_data[name][j]).length));\r\n }\r\n }\r\n } else {\r\n nodes.push(makeNode(name, fn(node_data[name], 0, level + 1), null, level + 1));\r\n }\r\n }\r\n }\r\n options.prettyPrint && nodes.length > 0 && nodes.push('\\n');\r\n return nodes.join('');\r\n break;\r\n\r\n case 'function':\r\n return node_data();\r\n break;\r\n\r\n default:\r\n return options.escape ? esc(node_data) : '' + node_data;\r\n }\r\n\r\n }(node_data, 0, 0))\r\n};\r\n\r\n\r\nvar xml_header = function (standalone) {\r\n var ret = ['<?xml version=\"1.0\" encoding=\"UTF-8\"'];\r\n\r\n if (standalone) {\r\n ret.push(' standalone=\"yes\"');\r\n }\r\n ret.push('?>');\r\n\r\n return ret.join('');\r\n};\r\n\r\nfunction esc(str) {\r\n return ('' + str).replace(/&/g, '&')\r\n .replace(/</g, '<')\r\n .replace(/>/g, '>')\r\n .replace(/'/g, ''')\r\n .replace(/\"/g, '"')\r\n .replace(not_safe_in_xml, '');\r\n}\r\n\r\nmodule.exports = function (obj, options) {\r\n if (!options) {\r\n options = {\r\n xmlHeader: {\r\n standalone: true\r\n },\r\n prettyPrint: true,\r\n indent: \" \",\r\n escape: true,\r\n };\r\n }\r\n\r\n if (typeof obj == 'string') {\r\n try {\r\n obj = JSON.parse(obj.toString());\r\n } catch (e) {\r\n return false;\r\n }\r\n }\r\n\r\n var xmlheader = '';\r\n var docType = '';\r\n if (options) {\r\n if (typeof options == 'object') {\r\n // our config is an object\r\n\r\n if (options.xmlHeader) {\r\n // the user wants an xml header\r\n xmlheader = xml_header(!!options.xmlHeader.standalone);\r\n }\r\n\r\n if (typeof options.docType != 'undefined') {\r\n docType = '<!DOCTYPE ' + options.docType + '>'\r\n }\r\n } else {\r\n // our config is a boolean value, so just add xml header\r\n xmlheader = xml_header();\r\n }\r\n }\r\n options = options || {}\r\n\r\n var ret = [\r\n xmlheader,\r\n (options.prettyPrint && docType ? '\\n' : ''),\r\n docType,\r\n process_to_xml(obj, options)\r\n ];\r\n return ret.join('').replace(/\\n{2,}/g, '\\n').replace(/\\s+$/g, '');\r\n};","'use strict';\n\n/**\n * Update an Error with the specified config, error code, and response.\n *\n * @param {Error} error The error to update.\n * @param {Object} config The config.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n * @returns {Error} The error.\n */\nmodule.exports = function enhanceError(error, config, code, request, response) {\n error.config = config;\n if (code) {\n error.code = code;\n }\n error.request = request;\n error.response = response;\n return error;\n};\n","'use strict';\n\nvar utils = require('./../utils');\nvar transformData = require('./transformData');\nvar isCancel = require('../cancel/isCancel');\nvar defaults = require('../defaults');\nvar isAbsoluteURL = require('./../helpers/isAbsoluteURL');\nvar combineURLs = require('./../helpers/combineURLs');\n\n/**\n * Throws a `Cancel` if cancellation has been requested.\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n * @returns {Promise} The Promise to be fulfilled\n */\nmodule.exports = function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n // Support baseURL config\n if (config.baseURL && !isAbsoluteURL(config.url)) {\n config.url = combineURLs(config.baseURL, config.url);\n }\n\n // Ensure headers exist\n config.headers = config.headers || {};\n\n // Transform request data\n config.data = transformData(\n config.data,\n config.headers,\n config.transformRequest\n );\n\n // Flatten headers\n config.headers = utils.merge(\n config.headers.common || {},\n config.headers[config.method] || {},\n config.headers || {}\n );\n\n utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n function cleanHeaderConfig(method) {\n delete config.headers[method];\n }\n );\n\n var adapter = config.adapter || defaults.adapter;\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData(\n response.data,\n response.headers,\n config.transformResponse\n );\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData(\n reason.response.data,\n reason.response.headers,\n config.transformResponse\n );\n }\n }\n\n return Promise.reject(reason);\n });\n};\n","var eachLimit = function (arr, limit, iterator, callback) {\r\n callback = callback || function () {};\r\n if (!arr.length || limit <= 0) {\r\n return callback();\r\n }\r\n\r\n var completed = 0;\r\n var started = 0;\r\n var running = 0;\r\n\r\n (function replenish () {\r\n if (completed >= arr.length) {\r\n return callback();\r\n }\r\n\r\n while (running < limit && started < arr.length) {\r\n started += 1;\r\n running += 1;\r\n iterator(arr[started - 1], function (err) {\r\n\r\n if (err) {\r\n callback(err);\r\n callback = function () {};\r\n } else {\r\n completed += 1;\r\n running -= 1;\r\n if (completed >= arr.length) {\r\n callback();\r\n } else {\r\n replenish();\r\n }\r\n }\r\n });\r\n }\r\n })();\r\n};\r\n\r\nvar retry = function (times, iterator, callback) {\r\n var next = function (index) {\r\n iterator(function (err, data) {\r\n if (err && index < times) {\r\n next(index + 1);\r\n } else {\r\n callback(err, data);\r\n }\r\n });\r\n };\r\n if (times < 1) {\r\n callback();\r\n } else {\r\n next(1);\r\n }\r\n};\r\n\r\nvar async = {\r\n eachLimit: eachLimit,\r\n retry: retry\r\n};\r\n\r\nmodule.exports = async;","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-2!../../node_modules/sass-loader/dist/cjs.js??ref--8-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../node_modules/vue-loader-v16/dist/index.js??ref--0-1!./NavBottom.vue?vue&type=style&index=0&id=6dd528d6&lang=scss&scoped=true\"","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n * @returns {Function}\n */\nmodule.exports = function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n};\n","// This icon file is generated automatically.\nvar PlaySquareOutlined = { \"icon\": { \"tag\": \"svg\", \"attrs\": { \"viewBox\": \"64 64 896 896\", \"focusable\": \"false\" }, \"children\": [{ \"tag\": \"path\", \"attrs\": { \"d\": \"M442.3 677.6l199.4-156.7a11.3 11.3 0 000-17.7L442.3 346.4c-7.4-5.8-18.3-.6-18.3 8.8v313.5c0 9.4 10.9 14.7 18.3 8.9z\" } }, { \"tag\": \"path\", \"attrs\": { \"d\": \"M880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z\" } }] }, \"name\": \"play-square\", \"theme\": \"outlined\" };\nexport default PlaySquareOutlined;\n","import * as _vue from \"vue\";\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\n// GENERATE BY ./scripts/generate.ts\n// DON NOT EDIT IT MANUALLY\nimport PlaySquareOutlinedSvg from \"@ant-design/icons-svg/es/asn/PlaySquareOutlined\";\nimport AntdIcon from '../components/AntdIcon';\n\nvar PlaySquareOutlined = function PlaySquareOutlined(props, context) {\n var p = _objectSpread({}, props, context.attrs);\n\n return _vue.createVNode(AntdIcon, _vue.mergeProps(p, {\n \"icon\": PlaySquareOutlinedSvg\n }), null);\n};\n\nPlaySquareOutlined.displayName = 'PlaySquareOutlined';\nPlaySquareOutlined.inheritAttrs = false;\nexport default PlaySquareOutlined;","module.exports = require('./lib/axios');","var $ = (function () {\r\n var deletedIds = [];\r\n\r\n var slice = deletedIds.slice;\r\n\r\n var concat = deletedIds.concat;\r\n\r\n var push = deletedIds.push;\r\n\r\n var indexOf = deletedIds.indexOf;\r\n\r\n var class2type = {};\r\n\r\n var toString = class2type.toString;\r\n\r\n var hasOwn = class2type.hasOwnProperty;\r\n\r\n var support = {};\r\n\r\n\r\n var\r\n version = \"1.11.1 -css,-css/addGetHookIf,-css/curCSS,-css/defaultDisplay,-css/hiddenVisibleSelectors,-css/support,-css/swap,-css/var/cssExpand,-css/var/isHidden,-css/var/rmargin,-css/var/rnumnonpx,-effects,-effects/Tween,-effects/animatedSelector,-effects/support,-dimensions,-offset,-deprecated,-event-alias,-wrap\",\r\n\r\n // Define a local copy of jQuery\r\n jQuery = function (selector, context) {\r\n // The jQuery object is actually just the init constructor 'enhanced'\r\n // Need init if jQuery is called (just allow error to be thrown if not included)\r\n return new jQuery.fn.init(selector, context);\r\n },\r\n\r\n // Support: Android<4.1, IE<9\r\n // Make sure we trim BOM and NBSP\r\n rtrim = /^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g,\r\n\r\n // Matches dashed string for camelizing\r\n rmsPrefix = /^-ms-/,\r\n rdashAlpha = /-([\\da-z])/gi,\r\n\r\n // Used by jQuery.camelCase as callback to replace()\r\n fcamelCase = function (all, letter) {\r\n return letter.toUpperCase();\r\n };\r\n\r\n jQuery.fn = jQuery.prototype = {\r\n // The current version of jQuery being used\r\n jquery: version,\r\n\r\n constructor: jQuery,\r\n\r\n // Start with an empty selector\r\n selector: \"\",\r\n\r\n // The default length of a jQuery object is 0\r\n length: 0,\r\n\r\n toArray: function () {\r\n return slice.call(this);\r\n },\r\n\r\n // Get the Nth element in the matched element set OR\r\n // Get the whole matched element set as a clean array\r\n get: function (num) {\r\n return num != null ?\r\n\r\n // Return just the one element from the set\r\n ( num < 0 ? this[num + this.length] : this[num] ) :\r\n\r\n // Return all the elements in a clean array\r\n slice.call(this);\r\n },\r\n\r\n // Take an array of elements and push it onto the stack\r\n // (returning the new matched element set)\r\n pushStack: function (elems) {\r\n\r\n // Build a new jQuery matched element set\r\n var ret = jQuery.merge(this.constructor(), elems);\r\n\r\n // Add the old object onto the stack (as a reference)\r\n ret.prevObject = this;\r\n ret.context = this.context;\r\n\r\n // Return the newly-formed element set\r\n return ret;\r\n },\r\n\r\n // Execute a callback for every element in the matched set.\r\n // (You can seed the arguments with an array of args, but this is\r\n // only used internally.)\r\n each: function (callback, args) {\r\n return jQuery.each(this, callback, args);\r\n },\r\n\r\n map: function (callback) {\r\n return this.pushStack(jQuery.map(this, function (elem, i) {\r\n return callback.call(elem, i, elem);\r\n }));\r\n },\r\n\r\n slice: function () {\r\n return this.pushStack(slice.apply(this, arguments));\r\n },\r\n\r\n first: function () {\r\n return this.eq(0);\r\n },\r\n\r\n last: function () {\r\n return this.eq(-1);\r\n },\r\n\r\n eq: function (i) {\r\n var len = this.length,\r\n j = +i + ( i < 0 ? len : 0 );\r\n return this.pushStack(j >= 0 && j < len ? [this[j]] : []);\r\n },\r\n\r\n end: function () {\r\n return this.prevObject || this.constructor(null);\r\n },\r\n\r\n // For internal use only.\r\n // Behaves like an Array's method, not like a jQuery method.\r\n push: push,\r\n sort: deletedIds.sort,\r\n splice: deletedIds.splice\r\n };\r\n\r\n jQuery.extend = jQuery.fn.extend = function () {\r\n var src, copyIsArray, copy, name, options, clone,\r\n target = arguments[0] || {},\r\n i = 1,\r\n length = arguments.length,\r\n deep = false;\r\n\r\n // Handle a deep copy situation\r\n if (typeof target === \"boolean\") {\r\n deep = target;\r\n\r\n // skip the boolean and the target\r\n target = arguments[i] || {};\r\n i++;\r\n }\r\n\r\n // Handle case when target is a string or something (possible in deep copy)\r\n if (typeof target !== \"object\" && !jQuery.isFunction(target)) {\r\n target = {};\r\n }\r\n\r\n // extend jQuery itself if only one argument is passed\r\n if (i === length) {\r\n target = this;\r\n i--;\r\n }\r\n\r\n for (; i < length; i++) {\r\n // Only deal with non-null/undefined values\r\n if ((options = arguments[i]) != null) {\r\n // Extend the base object\r\n for (name in options) {\r\n src = target[name];\r\n copy = options[name];\r\n\r\n // Prevent never-ending loop\r\n if (target === copy) {\r\n continue;\r\n }\r\n\r\n // Recurse if we're merging plain objects or arrays\r\n if (deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) )) {\r\n if (copyIsArray) {\r\n copyIsArray = false;\r\n clone = src && jQuery.isArray(src) ? src : [];\r\n\r\n } else {\r\n clone = src && jQuery.isPlainObject(src) ? src : {};\r\n }\r\n\r\n // Never move original objects, clone them\r\n target[name] = jQuery.extend(deep, clone, copy);\r\n\r\n // Don't bring in undefined values\r\n } else if (copy !== undefined) {\r\n target[name] = copy;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Return the modified object\r\n return target;\r\n };\r\n\r\n jQuery.extend({\r\n // Unique for each copy of jQuery on the page\r\n expando: \"jQuery\" + ( version + Math.random() ).replace(/\\D/g, \"\"),\r\n\r\n // Assume jQuery is ready without the ready module\r\n isReady: true,\r\n\r\n error: function (msg) {\r\n throw new Error(msg);\r\n },\r\n\r\n noop: function () {\r\n },\r\n\r\n // See test/unit/core.js for details concerning isFunction.\r\n // Since version 1.3, DOM methods and functions like alert\r\n // aren't supported. They return false on IE (#2968).\r\n isFunction: function (obj) {\r\n return jQuery.type(obj) === \"function\";\r\n },\r\n\r\n isArray: Array.isArray || function (obj) {\r\n return jQuery.type(obj) === \"array\";\r\n },\r\n\r\n isWindow: function (obj) {\r\n /* jshint eqeqeq: false */\r\n return obj != null && obj == obj.window;\r\n },\r\n\r\n isNumeric: function (obj) {\r\n // parseFloat NaNs numeric-cast false positives (null|true|false|\"\")\r\n // ...but misinterprets leading-number strings, particularly hex literals (\"0x...\")\r\n // subtraction forces infinities to NaN\r\n return !jQuery.isArray(obj) && obj - parseFloat(obj) >= 0;\r\n },\r\n\r\n isEmptyObject: function (obj) {\r\n var name;\r\n for (name in obj) {\r\n return false;\r\n }\r\n return true;\r\n },\r\n\r\n isPlainObject: function (obj) {\r\n var key;\r\n\r\n // Must be an Object.\r\n // Because of IE, we also have to check the presence of the constructor property.\r\n // Make sure that DOM nodes and window objects don't pass through, as well\r\n if (!obj || jQuery.type(obj) !== \"object\" || obj.nodeType || jQuery.isWindow(obj)) {\r\n return false;\r\n }\r\n\r\n try {\r\n // Not own constructor property must be Object\r\n if (obj.constructor &&\r\n !hasOwn.call(obj, \"constructor\") &&\r\n !hasOwn.call(obj.constructor.prototype, \"isPrototypeOf\")) {\r\n return false;\r\n }\r\n } catch (e) {\r\n // IE8,9 Will throw exceptions on certain host objects #9897\r\n return false;\r\n }\r\n\r\n // Support: IE<9\r\n // Handle iteration over inherited properties before own properties.\r\n if (support.ownLast) {\r\n for (key in obj) {\r\n return hasOwn.call(obj, key);\r\n }\r\n }\r\n\r\n // Own properties are enumerated firstly, so to speed up,\r\n // if last one is own, then all properties are own.\r\n for (key in obj) {\r\n }\r\n\r\n return key === undefined || hasOwn.call(obj, key);\r\n },\r\n\r\n type: function (obj) {\r\n if (obj == null) {\r\n return obj + \"\";\r\n }\r\n return typeof obj === \"object\" || typeof obj === \"function\" ?\r\n class2type[toString.call(obj)] || \"object\" :\r\n typeof obj;\r\n },\r\n\r\n // Evaluates a script in a global context\r\n // Workarounds based on findings by Jim Driscoll\r\n // http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context\r\n globalEval: function (data) {\r\n if (data && jQuery.trim(data)) {\r\n // We use execScript on Internet Explorer\r\n // We use an anonymous function so that context is window\r\n // rather than jQuery in Firefox\r\n ( window.execScript || function (data) {\r\n window[\"eval\"].call(window, data);\r\n } )(data);\r\n }\r\n },\r\n\r\n // Convert dashed to camelCase; used by the css and data modules\r\n // Microsoft forgot to hump their vendor prefix (#9572)\r\n camelCase: function (string) {\r\n return string.replace(rmsPrefix, \"ms-\").replace(rdashAlpha, fcamelCase);\r\n },\r\n\r\n nodeName: function (elem, name) {\r\n return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();\r\n },\r\n\r\n // args is for internal usage only\r\n each: function (obj, callback, args) {\r\n var value,\r\n i = 0,\r\n length = obj.length,\r\n isArray = isArraylike(obj);\r\n\r\n if (args) {\r\n if (isArray) {\r\n for (; i < length; i++) {\r\n value = callback.apply(obj[i], args);\r\n\r\n if (value === false) {\r\n break;\r\n }\r\n }\r\n } else {\r\n for (i in obj) {\r\n value = callback.apply(obj[i], args);\r\n\r\n if (value === false) {\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // A special, fast, case for the most common use of each\r\n } else {\r\n if (isArray) {\r\n for (; i < length; i++) {\r\n value = callback.call(obj[i], i, obj[i]);\r\n\r\n if (value === false) {\r\n break;\r\n }\r\n }\r\n } else {\r\n for (i in obj) {\r\n value = callback.call(obj[i], i, obj[i]);\r\n\r\n if (value === false) {\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return obj;\r\n },\r\n\r\n // Support: Android<4.1, IE<9\r\n trim: function (text) {\r\n return text == null ?\r\n \"\" :\r\n ( text + \"\" ).replace(rtrim, \"\");\r\n },\r\n\r\n // results is for internal usage only\r\n makeArray: function (arr, results) {\r\n var ret = results || [];\r\n\r\n if (arr != null) {\r\n if (isArraylike(Object(arr))) {\r\n jQuery.merge(ret,\r\n typeof arr === \"string\" ?\r\n [arr] : arr\r\n );\r\n } else {\r\n push.call(ret, arr);\r\n }\r\n }\r\n\r\n return ret;\r\n },\r\n\r\n inArray: function (elem, arr, i) {\r\n var len;\r\n\r\n if (arr) {\r\n if (indexOf) {\r\n return indexOf.call(arr, elem, i);\r\n }\r\n\r\n len = arr.length;\r\n i = i ? i < 0 ? Math.max(0, len + i) : i : 0;\r\n\r\n for (; i < len; i++) {\r\n // Skip accessing in sparse arrays\r\n if (i in arr && arr[i] === elem) {\r\n return i;\r\n }\r\n }\r\n }\r\n\r\n return -1;\r\n },\r\n\r\n merge: function (first, second) {\r\n var len = +second.length,\r\n j = 0,\r\n i = first.length;\r\n\r\n while (j < len) {\r\n first[i++] = second[j++];\r\n }\r\n\r\n // Support: IE<9\r\n // Workaround casting of .length to NaN on otherwise arraylike objects (e.g., NodeLists)\r\n if (len !== len) {\r\n while (second[j] !== undefined) {\r\n first[i++] = second[j++];\r\n }\r\n }\r\n\r\n first.length = i;\r\n\r\n return first;\r\n },\r\n\r\n grep: function (elems, callback, invert) {\r\n var callbackInverse,\r\n matches = [],\r\n i = 0,\r\n length = elems.length,\r\n callbackExpect = !invert;\r\n\r\n // Go through the array, only saving the items\r\n // that pass the validator function\r\n for (; i < length; i++) {\r\n callbackInverse = !callback(elems[i], i);\r\n if (callbackInverse !== callbackExpect) {\r\n matches.push(elems[i]);\r\n }\r\n }\r\n\r\n return matches;\r\n },\r\n\r\n // arg is for internal usage only\r\n map: function (elems, callback, arg) {\r\n var value,\r\n i = 0,\r\n length = elems.length,\r\n isArray = isArraylike(elems),\r\n ret = [];\r\n\r\n // Go through the array, translating each of the items to their new values\r\n if (isArray) {\r\n for (; i < length; i++) {\r\n value = callback(elems[i], i, arg);\r\n\r\n if (value != null) {\r\n ret.push(value);\r\n }\r\n }\r\n\r\n // Go through every key on the object,\r\n } else {\r\n for (i in elems) {\r\n value = callback(elems[i], i, arg);\r\n\r\n if (value != null) {\r\n ret.push(value);\r\n }\r\n }\r\n }\r\n\r\n // Flatten any nested arrays\r\n return concat.apply([], ret);\r\n },\r\n\r\n // A global GUID counter for objects\r\n guid: 1,\r\n\r\n // Bind a function to a context, optionally partially applying any\r\n // arguments.\r\n proxy: function (fn, context) {\r\n var args, proxy, tmp;\r\n\r\n if (typeof context === \"string\") {\r\n tmp = fn[context];\r\n context = fn;\r\n fn = tmp;\r\n }\r\n\r\n // Quick check to determine if target is callable, in the spec\r\n // this throws a TypeError, but we will just return undefined.\r\n if (!jQuery.isFunction(fn)) {\r\n return undefined;\r\n }\r\n\r\n // Simulated bind\r\n args = slice.call(arguments, 2);\r\n proxy = function () {\r\n return fn.apply(context || this, args.concat(slice.call(arguments)));\r\n };\r\n\r\n // Set the guid of unique handler to the same of original handler, so it can be removed\r\n proxy.guid = fn.guid = fn.guid || jQuery.guid++;\r\n\r\n return proxy;\r\n },\r\n\r\n now: function () {\r\n return +( new Date() );\r\n },\r\n\r\n // jQuery.support is not used in Core but other projects attach their\r\n // properties to it so it needs to exist.\r\n support: support\r\n });\r\n\r\n// Populate the class2type map\r\n jQuery.each(\"Boolean Number String Function Array Date RegExp Object Error\".split(\" \"), function (i, name) {\r\n class2type[\"[object \" + name + \"]\"] = name.toLowerCase();\r\n });\r\n\r\n function isArraylike(obj) {\r\n var length = obj.length,\r\n type = jQuery.type(obj);\r\n\r\n if (type === \"function\" || jQuery.isWindow(obj)) {\r\n return false;\r\n }\r\n\r\n if (obj.nodeType === 1 && length) {\r\n return true;\r\n }\r\n\r\n return type === \"array\" || length === 0 ||\r\n typeof length === \"number\" && length > 0 && ( length - 1 ) in obj;\r\n }\r\n\r\n\r\n// Initialize a jQuery object\r\n\r\n\r\n// A central reference to the root jQuery(document)\r\n var rootjQuery,\r\n\r\n // Use the correct document accordingly with window argument (sandbox)\r\n document = window.document,\r\n\r\n // A simple way to check for HTML strings\r\n // Prioritize #id over <tag> to avoid XSS via location.hash (#9521)\r\n // Strict HTML recognition (#11290: must start with <)\r\n rquickExpr = /^(?:\\s*(<[\\w\\W]+>)[^>]*|#([\\w-]*))$/,\r\n\r\n init = jQuery.fn.init = function (selector, context) {\r\n var match, elem;\r\n\r\n // HANDLE: $(\"\"), $(null), $(undefined), $(false)\r\n if (!selector) {\r\n return this;\r\n }\r\n\r\n // Handle HTML strings\r\n if (typeof selector === \"string\") {\r\n if (selector.charAt(0) === \"<\" && selector.charAt(selector.length - 1) === \">\" && selector.length >= 3) {\r\n // Assume that strings that start and end with <> are HTML and skip the regex check\r\n match = [null, selector, null];\r\n\r\n } else {\r\n match = rquickExpr.exec(selector);\r\n }\r\n\r\n // Match html or make sure no context is specified for #id\r\n if (match && (match[1] || !context)) {\r\n\r\n // HANDLE: $(html) -> $(array)\r\n if (match[1]) {\r\n context = context instanceof jQuery ? context[0] : context;\r\n\r\n // scripts is true for back-compat\r\n // Intentionally let the error be thrown if parseHTML is not present\r\n jQuery.merge(this, jQuery.parseHTML(\r\n match[1],\r\n context && context.nodeType ? context.ownerDocument || context : document,\r\n true\r\n ));\r\n\r\n // HANDLE: $(html, props)\r\n if (rsingleTag.test(match[1]) && jQuery.isPlainObject(context)) {\r\n for (match in context) {\r\n // Properties of context are called as methods if possible\r\n if (jQuery.isFunction(this[match])) {\r\n this[match](context[match]);\r\n\r\n // ...and otherwise set as attributes\r\n } else {\r\n this.attr(match, context[match]);\r\n }\r\n }\r\n }\r\n\r\n return this;\r\n\r\n // HANDLE: $(#id)\r\n } else {\r\n elem = document.getElementById(match[2]);\r\n\r\n // Check parentNode to catch when Blackberry 4.6 returns\r\n // nodes that are no longer in the document #6963\r\n if (elem && elem.parentNode) {\r\n // Handle the case where IE and Opera return items\r\n // by name instead of ID\r\n if (elem.id !== match[2]) {\r\n return rootjQuery.find(selector);\r\n }\r\n\r\n // Otherwise, we inject the element directly into the jQuery object\r\n this.length = 1;\r\n this[0] = elem;\r\n }\r\n\r\n this.context = document;\r\n this.selector = selector;\r\n return this;\r\n }\r\n\r\n // HANDLE: $(expr, $(...))\r\n } else if (!context || context.jquery) {\r\n return ( context || rootjQuery ).find(selector);\r\n\r\n // HANDLE: $(expr, context)\r\n // (which is just equivalent to: $(context).find(expr)\r\n } else {\r\n return this.constructor(context).find(selector);\r\n }\r\n\r\n // HANDLE: $(DOMElement)\r\n } else if (selector.nodeType) {\r\n this.context = this[0] = selector;\r\n this.length = 1;\r\n return this;\r\n\r\n // HANDLE: $(function)\r\n // Shortcut for document ready\r\n } else if (jQuery.isFunction(selector)) {\r\n return typeof rootjQuery.ready !== \"undefined\" ?\r\n rootjQuery.ready(selector) :\r\n // Execute immediately if ready is not present\r\n selector(jQuery);\r\n }\r\n\r\n if (selector.selector !== undefined) {\r\n this.selector = selector.selector;\r\n this.context = selector.context;\r\n }\r\n\r\n return jQuery.makeArray(selector, this);\r\n };\r\n\r\n// Give the init function the jQuery prototype for later instantiation\r\n init.prototype = jQuery.fn;\r\n\r\n// Initialize central reference\r\n rootjQuery = jQuery(document);\r\n\r\n\r\n var rnotwhite = (/\\S+/g);\r\n\r\n// String to Object options format cache\r\n var optionsCache = {};\r\n\r\n// Convert String-formatted options into Object-formatted ones and store in cache\r\n function createOptions(options) {\r\n var object = optionsCache[options] = {};\r\n jQuery.each(options.match(rnotwhite) || [], function (_, flag) {\r\n object[flag] = true;\r\n });\r\n return object;\r\n }\r\n\r\n /*\r\n * Create a callback list using the following parameters:\r\n *\r\n *\toptions: an optional list of space-separated options that will change how\r\n *\t\t\tthe callback list behaves or a more traditional option object\r\n *\r\n * By default a callback list will act like an event callback list and can be\r\n * \"fired\" multiple times.\r\n *\r\n * Possible options:\r\n *\r\n *\tonce:\t\t\twill ensure the callback list can only be fired once (like a Deferred)\r\n *\r\n *\tmemory:\t\t\twill keep track of previous values and will call any callback added\r\n *\t\t\t\t\tafter the list has been fired right away with the latest \"memorized\"\r\n *\t\t\t\t\tvalues (like a Deferred)\r\n *\r\n *\tunique:\t\t\twill ensure a callback can only be added once (no duplicate in the list)\r\n *\r\n *\tstopOnFalse:\tinterrupt callings when a callback returns false\r\n *\r\n */\r\n jQuery.Callbacks = function (options) {\r\n\r\n // Convert options from String-formatted to Object-formatted if needed\r\n // (we check in cache first)\r\n options = typeof options === \"string\" ?\r\n ( optionsCache[options] || createOptions(options) ) :\r\n jQuery.extend({}, options);\r\n\r\n var // Flag to know if list is currently firing\r\n firing,\r\n // Last fire value (for non-forgettable lists)\r\n memory,\r\n // Flag to know if list was already fired\r\n fired,\r\n // End of the loop when firing\r\n firingLength,\r\n // Index of currently firing callback (modified by remove if needed)\r\n firingIndex,\r\n // First callback to fire (used internally by add and fireWith)\r\n firingStart,\r\n // Actual callback list\r\n list = [],\r\n // Stack of fire calls for repeatable lists\r\n stack = !options.once && [],\r\n // Fire callbacks\r\n fire = function (data) {\r\n memory = options.memory && data;\r\n fired = true;\r\n firingIndex = firingStart || 0;\r\n firingStart = 0;\r\n firingLength = list.length;\r\n firing = true;\r\n for (; list && firingIndex < firingLength; firingIndex++) {\r\n if (list[firingIndex].apply(data[0], data[1]) === false && options.stopOnFalse) {\r\n memory = false; // To prevent further calls using add\r\n break;\r\n }\r\n }\r\n firing = false;\r\n if (list) {\r\n if (stack) {\r\n if (stack.length) {\r\n fire(stack.shift());\r\n }\r\n } else if (memory) {\r\n list = [];\r\n } else {\r\n self.disable();\r\n }\r\n }\r\n },\r\n // Actual Callbacks object\r\n self = {\r\n // Add a callback or a collection of callbacks to the list\r\n add: function () {\r\n if (list) {\r\n // First, we save the current length\r\n var start = list.length;\r\n (function add(args) {\r\n jQuery.each(args, function (_, arg) {\r\n var type = jQuery.type(arg);\r\n if (type === \"function\") {\r\n if (!options.unique || !self.has(arg)) {\r\n list.push(arg);\r\n }\r\n } else if (arg && arg.length && type !== \"string\") {\r\n // Inspect recursively\r\n add(arg);\r\n }\r\n });\r\n })(arguments);\r\n // Do we need to add the callbacks to the\r\n // current firing batch?\r\n if (firing) {\r\n firingLength = list.length;\r\n // With memory, if we're not firing then\r\n // we should call right away\r\n } else if (memory) {\r\n firingStart = start;\r\n fire(memory);\r\n }\r\n }\r\n return this;\r\n },\r\n // Remove a callback from the list\r\n remove: function () {\r\n if (list) {\r\n jQuery.each(arguments, function (_, arg) {\r\n var index;\r\n while (( index = jQuery.inArray(arg, list, index) ) > -1) {\r\n list.splice(index, 1);\r\n // Handle firing indexes\r\n if (firing) {\r\n if (index <= firingLength) {\r\n firingLength--;\r\n }\r\n if (index <= firingIndex) {\r\n firingIndex--;\r\n }\r\n }\r\n }\r\n });\r\n }\r\n return this;\r\n },\r\n // Check if a given callback is in the list.\r\n // If no argument is given, return whether or not list has callbacks attached.\r\n has: function (fn) {\r\n return fn ? jQuery.inArray(fn, list) > -1 : !!( list && list.length );\r\n },\r\n // Remove all callbacks from the list\r\n empty: function () {\r\n list = [];\r\n firingLength = 0;\r\n return this;\r\n },\r\n // Have the list do nothing anymore\r\n disable: function () {\r\n list = stack = memory = undefined;\r\n return this;\r\n },\r\n // Is it disabled?\r\n disabled: function () {\r\n return !list;\r\n },\r\n // Lock the list in its current state\r\n lock: function () {\r\n stack = undefined;\r\n if (!memory) {\r\n self.disable();\r\n }\r\n return this;\r\n },\r\n // Is it locked?\r\n locked: function () {\r\n return !stack;\r\n },\r\n // Call all callbacks with the given context and arguments\r\n fireWith: function (context, args) {\r\n if (list && ( !fired || stack )) {\r\n args = args || [];\r\n args = [context, args.slice ? args.slice() : args];\r\n if (firing) {\r\n stack.push(args);\r\n } else {\r\n fire(args);\r\n }\r\n }\r\n return this;\r\n },\r\n // Call all the callbacks with the given arguments\r\n fire: function () {\r\n self.fireWith(this, arguments);\r\n return this;\r\n },\r\n // To know if the callbacks have already been called at least once\r\n fired: function () {\r\n return !!fired;\r\n }\r\n };\r\n\r\n return self;\r\n };\r\n\r\n\r\n jQuery.extend({\r\n\r\n Deferred: function (func) {\r\n var tuples = [\r\n // action, add listener, listener list, final state\r\n [\"resolve\", \"done\", jQuery.Callbacks(\"once memory\"), \"resolved\"],\r\n [\"reject\", \"fail\", jQuery.Callbacks(\"once memory\"), \"rejected\"],\r\n [\"notify\", \"progress\", jQuery.Callbacks(\"memory\")]\r\n ],\r\n state = \"pending\",\r\n promise = {\r\n state: function () {\r\n return state;\r\n },\r\n always: function () {\r\n deferred.done(arguments).fail(arguments);\r\n return this;\r\n },\r\n then: function (/* fnDone, fnFail, fnProgress */) {\r\n var fns = arguments;\r\n return jQuery.Deferred(function (newDefer) {\r\n jQuery.each(tuples, function (i, tuple) {\r\n var fn = jQuery.isFunction(fns[i]) && fns[i];\r\n // deferred[ done | fail | progress ] for forwarding actions to newDefer\r\n deferred[tuple[1]](function () {\r\n var returned = fn && fn.apply(this, arguments);\r\n if (returned && jQuery.isFunction(returned.promise)) {\r\n returned.promise()\r\n .done(newDefer.resolve)\r\n .fail(newDefer.reject)\r\n .progress(newDefer.notify);\r\n } else {\r\n newDefer[tuple[0] + \"With\"](this === promise ? newDefer.promise() : this, fn ? [returned] : arguments);\r\n }\r\n });\r\n });\r\n fns = null;\r\n }).promise();\r\n },\r\n // Get a promise for this deferred\r\n // If obj is provided, the promise aspect is added to the object\r\n promise: function (obj) {\r\n return obj != null ? jQuery.extend(obj, promise) : promise;\r\n }\r\n },\r\n deferred = {};\r\n\r\n // Keep pipe for back-compat\r\n promise.pipe = promise.then;\r\n\r\n // Add list-specific methods\r\n jQuery.each(tuples, function (i, tuple) {\r\n var list = tuple[2],\r\n stateString = tuple[3];\r\n\r\n // promise[ done | fail | progress ] = list.add\r\n promise[tuple[1]] = list.add;\r\n\r\n // Handle state\r\n if (stateString) {\r\n list.add(function () {\r\n // state = [ resolved | rejected ]\r\n state = stateString;\r\n\r\n // [ reject_list | resolve_list ].disable; progress_list.lock\r\n }, tuples[i ^ 1][2].disable, tuples[2][2].lock);\r\n }\r\n\r\n // deferred[ resolve | reject | notify ]\r\n deferred[tuple[0]] = function () {\r\n deferred[tuple[0] + \"With\"](this === deferred ? promise : this, arguments);\r\n return this;\r\n };\r\n deferred[tuple[0] + \"With\"] = list.fireWith;\r\n });\r\n\r\n // Make the deferred a promise\r\n promise.promise(deferred);\r\n\r\n // Call given func if any\r\n if (func) {\r\n func.call(deferred, deferred);\r\n }\r\n\r\n // All done!\r\n return deferred;\r\n },\r\n\r\n // Deferred helper\r\n when: function (subordinate /* , ..., subordinateN */) {\r\n var i = 0,\r\n resolveValues = slice.call(arguments),\r\n length = resolveValues.length,\r\n\r\n // the count of uncompleted subordinates\r\n remaining = length !== 1 || ( subordinate && jQuery.isFunction(subordinate.promise) ) ? length : 0,\r\n\r\n // the master Deferred. If resolveValues consist of only a single Deferred, just use that.\r\n deferred = remaining === 1 ? subordinate : jQuery.Deferred(),\r\n\r\n // Update function for both resolve and progress values\r\n updateFunc = function (i, contexts, values) {\r\n return function (value) {\r\n contexts[i] = this;\r\n values[i] = arguments.length > 1 ? slice.call(arguments) : value;\r\n if (values === progressValues) {\r\n deferred.notifyWith(contexts, values);\r\n\r\n } else if (!(--remaining)) {\r\n deferred.resolveWith(contexts, values);\r\n }\r\n };\r\n },\r\n\r\n progressValues, progressContexts, resolveContexts;\r\n\r\n // add listeners to Deferred subordinates; treat others as resolved\r\n if (length > 1) {\r\n progressValues = new Array(length);\r\n progressContexts = new Array(length);\r\n resolveContexts = new Array(length);\r\n for (; i < length; i++) {\r\n if (resolveValues[i] && jQuery.isFunction(resolveValues[i].promise)) {\r\n resolveValues[i].promise()\r\n .done(updateFunc(i, resolveContexts, resolveValues))\r\n .fail(deferred.reject)\r\n .progress(updateFunc(i, progressContexts, progressValues));\r\n } else {\r\n --remaining;\r\n }\r\n }\r\n }\r\n\r\n // if we're not waiting on anything, resolve the master\r\n if (!remaining) {\r\n deferred.resolveWith(resolveContexts, resolveValues);\r\n }\r\n\r\n return deferred.promise();\r\n }\r\n });\r\n\r\n\r\n// The deferred used on DOM ready\r\n var readyList;\r\n\r\n jQuery.fn.ready = function (fn) {\r\n // Add the callback\r\n jQuery.ready.promise().done(fn);\r\n\r\n return this;\r\n };\r\n\r\n jQuery.extend({\r\n // Is the DOM ready to be used? Set to true once it occurs.\r\n isReady: false,\r\n\r\n // A counter to track how many items to wait for before\r\n // the ready event fires. See #6781\r\n readyWait: 1,\r\n\r\n // Hold (or release) the ready event\r\n holdReady: function (hold) {\r\n if (hold) {\r\n jQuery.readyWait++;\r\n } else {\r\n jQuery.ready(true);\r\n }\r\n },\r\n\r\n // Handle when the DOM is ready\r\n ready: function (wait) {\r\n\r\n // Abort if there are pending holds or we're already ready\r\n if (wait === true ? --jQuery.readyWait : jQuery.isReady) {\r\n return;\r\n }\r\n\r\n // Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).\r\n if (!document.body) {\r\n return setTimeout(jQuery.ready);\r\n }\r\n\r\n // Remember that the DOM is ready\r\n jQuery.isReady = true;\r\n\r\n // If a normal DOM Ready event fired, decrement, and wait if need be\r\n if (wait !== true && --jQuery.readyWait > 0) {\r\n return;\r\n }\r\n\r\n // If there are functions bound, to execute\r\n readyList.resolveWith(document, [jQuery]);\r\n\r\n // Trigger any bound ready events\r\n if (jQuery.fn.triggerHandler) {\r\n jQuery(document).triggerHandler(\"ready\");\r\n jQuery(document).off(\"ready\");\r\n }\r\n }\r\n });\r\n\r\n /**\r\n * Clean-up method for dom ready events\r\n */\r\n function detach() {\r\n if (document.addEventListener) {\r\n document.removeEventListener(\"DOMContentLoaded\", completed, false);\r\n window.removeEventListener(\"load\", completed, false);\r\n\r\n } else {\r\n document.detachEvent(\"onreadystatechange\", completed);\r\n window.detachEvent(\"onload\", completed);\r\n }\r\n }\r\n\r\n /**\r\n * The ready event handler and self cleanup method\r\n */\r\n function completed() {\r\n // readyState === \"complete\" is good enough for us to call the dom ready in oldIE\r\n if (document.addEventListener || event.type === \"load\" || document.readyState === \"complete\") {\r\n detach();\r\n jQuery.ready();\r\n }\r\n }\r\n\r\n jQuery.ready.promise = function (obj) {\r\n if (!readyList) {\r\n\r\n readyList = jQuery.Deferred();\r\n\r\n // Catch cases where $(document).ready() is called after the browser event has already occurred.\r\n // we once tried to use readyState \"interactive\" here, but it caused issues like the one\r\n // discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15\r\n if (document.readyState === \"complete\") {\r\n // Handle it asynchronously to allow scripts the opportunity to delay ready\r\n setTimeout(jQuery.ready);\r\n\r\n // Standards-based browsers support DOMContentLoaded\r\n } else if (document.addEventListener) {\r\n // Use the handy event callback\r\n document.addEventListener(\"DOMContentLoaded\", completed, false);\r\n\r\n // A fallback to window.onload, that will always work\r\n window.addEventListener(\"load\", completed, false);\r\n\r\n // If IE event model is used\r\n } else {\r\n // Ensure firing before onload, maybe late but safe also for iframes\r\n document.attachEvent(\"onreadystatechange\", completed);\r\n\r\n // A fallback to window.onload, that will always work\r\n window.attachEvent(\"onload\", completed);\r\n\r\n // If IE and not a frame\r\n // continually check to see if the document is ready\r\n var top = false;\r\n\r\n try {\r\n top = window.frameElement == null && document.documentElement;\r\n } catch (e) {\r\n }\r\n\r\n if (top && top.doScroll) {\r\n (function doScrollCheck() {\r\n if (!jQuery.isReady) {\r\n\r\n try {\r\n // Use the trick by Diego Perini\r\n // http://javascript.nwbox.com/IEContentLoaded/\r\n top.doScroll(\"left\");\r\n } catch (e) {\r\n return setTimeout(doScrollCheck, 50);\r\n }\r\n\r\n // detach all dom ready events\r\n detach();\r\n\r\n // and execute any waiting functions\r\n jQuery.ready();\r\n }\r\n })();\r\n }\r\n }\r\n }\r\n return readyList.promise(obj);\r\n };\r\n\r\n\r\n var strundefined = typeof undefined;\r\n\r\n\r\n// Support: IE<9\r\n// Iteration over object's inherited properties before its own\r\n var i;\r\n for (i in jQuery(support)) {\r\n break;\r\n }\r\n support.ownLast = i !== \"0\";\r\n\r\n// Note: most support tests are defined in their respective modules.\r\n// false until the test is run\r\n support.inlineBlockNeedsLayout = false;\r\n\r\n\r\n// Execute ASAP in case we need to set body.style.zoom\r\n jQuery(function () {\r\n // Minified: var a,b,c,d\r\n var val, div, body, container;\r\n\r\n body = document.getElementsByTagName(\"body\")[0];\r\n if (!body || !body.style) {\r\n // Return for frameset docs that don't have a body\r\n return;\r\n }\r\n\r\n // Setup\r\n div = document.createElement(\"div\");\r\n container = document.createElement(\"div\");\r\n container.style.cssText = \"position:absolute;border:0;width:0;height:0;top:0;left:-9999px\";\r\n body.appendChild(container).appendChild(div);\r\n\r\n if (typeof div.style.zoom !== strundefined) {\r\n // Support: IE<8\r\n // Check if natively block-level elements act like inline-block\r\n // elements when setting their display to 'inline' and giving\r\n // them layout\r\n div.style.cssText = \"display:inline;margin:0;border:0;padding:1px;width:1px;zoom:1\";\r\n\r\n support.inlineBlockNeedsLayout = val = div.offsetWidth === 3;\r\n if (val) {\r\n // Prevent IE 6 from affecting layout for positioned elements #11048\r\n // Prevent IE from shrinking the body in IE 7 mode #12869\r\n // Support: IE<8\r\n body.style.zoom = 1;\r\n }\r\n }\r\n\r\n body.removeChild(container);\r\n });\r\n\r\n\r\n (function () {\r\n var div = document.createElement(\"div\");\r\n\r\n // Execute the test only if not already executed in another module.\r\n if (support.deleteExpando == null) {\r\n // Support: IE<9\r\n support.deleteExpando = true;\r\n try {\r\n delete div.test;\r\n } catch (e) {\r\n support.deleteExpando = false;\r\n }\r\n }\r\n\r\n // Null elements to avoid leaks in IE.\r\n div = null;\r\n })();\r\n\r\n\r\n /**\r\n * Determines whether an object can have data\r\n */\r\n jQuery.acceptData = function (elem) {\r\n var noData = jQuery.noData[(elem.nodeName + \" \").toLowerCase()],\r\n nodeType = +elem.nodeType || 1;\r\n\r\n // Do not set data on non-element DOM nodes because it will not be cleared (#8335).\r\n return nodeType !== 1 && nodeType !== 9 ?\r\n false :\r\n\r\n // Nodes accept data unless otherwise specified; rejection can be conditional\r\n !noData || noData !== true && elem.getAttribute(\"classid\") === noData;\r\n };\r\n\r\n\r\n var rbrace = /^(?:\\{[\\w\\W]*\\}|\\[[\\w\\W]*\\])$/,\r\n rmultiDash = /([A-Z])/g;\r\n\r\n function dataAttr(elem, key, data) {\r\n // If nothing was found internally, try to fetch any\r\n // data from the HTML5 data-* attribute\r\n if (data === undefined && elem.nodeType === 1) {\r\n\r\n var name = \"data-\" + key.replace(rmultiDash, \"-$1\").toLowerCase();\r\n\r\n data = elem.getAttribute(name);\r\n\r\n if (typeof data === \"string\") {\r\n try {\r\n data = data === \"true\" ? true :\r\n data === \"false\" ? false :\r\n data === \"null\" ? null :\r\n // Only convert to a number if it doesn't change the string\r\n +data + \"\" === data ? +data :\r\n rbrace.test(data) ? jQuery.parseJSON(data) :\r\n data;\r\n } catch (e) {\r\n }\r\n\r\n // Make sure we set the data so it isn't changed later\r\n jQuery.data(elem, key, data);\r\n\r\n } else {\r\n data = undefined;\r\n }\r\n }\r\n\r\n return data;\r\n }\r\n\r\n// checks a cache object for emptiness\r\n function isEmptyDataObject(obj) {\r\n var name;\r\n for (name in obj) {\r\n\r\n // if the public data object is empty, the private is still empty\r\n if (name === \"data\" && jQuery.isEmptyObject(obj[name])) {\r\n continue;\r\n }\r\n if (name !== \"toJSON\") {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }\r\n\r\n function internalData(elem, name, data, pvt /* Internal Use Only */) {\r\n if (!jQuery.acceptData(elem)) {\r\n return;\r\n }\r\n\r\n var ret, thisCache,\r\n internalKey = jQuery.expando,\r\n\r\n // We have to handle DOM nodes and JS objects differently because IE6-7\r\n // can't GC object references properly across the DOM-JS boundary\r\n isNode = elem.nodeType,\r\n\r\n // Only DOM nodes need the global jQuery cache; JS object data is\r\n // attached directly to the object so GC can occur automatically\r\n cache = isNode ? jQuery.cache : elem,\r\n\r\n // Only defining an ID for JS objects if its cache already exists allows\r\n // the code to shortcut on the same path as a DOM node with no cache\r\n id = isNode ? elem[internalKey] : elem[internalKey] && internalKey;\r\n\r\n // Avoid doing any more work than we need to when trying to get data on an\r\n // object that has no data at all\r\n if ((!id || !cache[id] || (!pvt && !cache[id].data)) && data === undefined && typeof name === \"string\") {\r\n return;\r\n }\r\n\r\n if (!id) {\r\n // Only DOM nodes need a new unique ID for each element since their data\r\n // ends up in the global cache\r\n if (isNode) {\r\n id = elem[internalKey] = deletedIds.pop() || jQuery.guid++;\r\n } else {\r\n id = internalKey;\r\n }\r\n }\r\n\r\n if (!cache[id]) {\r\n // Avoid exposing jQuery metadata on plain JS objects when the object\r\n // is serialized using JSON.stringify\r\n cache[id] = isNode ? {} : {toJSON: jQuery.noop};\r\n }\r\n\r\n // An object can be passed to jQuery.data instead of a key/value pair; this gets\r\n // shallow copied over onto the existing cache\r\n if (typeof name === \"object\" || typeof name === \"function\") {\r\n if (pvt) {\r\n cache[id] = jQuery.extend(cache[id], name);\r\n } else {\r\n cache[id].data = jQuery.extend(cache[id].data, name);\r\n }\r\n }\r\n\r\n thisCache = cache[id];\r\n\r\n // jQuery data() is stored in a separate object inside the object's internal data\r\n // cache in order to avoid key collisions between internal data and user-defined\r\n // data.\r\n if (!pvt) {\r\n if (!thisCache.data) {\r\n thisCache.data = {};\r\n }\r\n\r\n thisCache = thisCache.data;\r\n }\r\n\r\n if (data !== undefined) {\r\n thisCache[jQuery.camelCase(name)] = data;\r\n }\r\n\r\n // Check for both converted-to-camel and non-converted data property names\r\n // If a data property was specified\r\n if (typeof name === \"string\") {\r\n\r\n // First Try to find as-is property data\r\n ret = thisCache[name];\r\n\r\n // Test for null|undefined property data\r\n if (ret == null) {\r\n\r\n // Try to find the camelCased property\r\n ret = thisCache[jQuery.camelCase(name)];\r\n }\r\n } else {\r\n ret = thisCache;\r\n }\r\n\r\n return ret;\r\n }\r\n\r\n function internalRemoveData(elem, name, pvt) {\r\n if (!jQuery.acceptData(elem)) {\r\n return;\r\n }\r\n\r\n var thisCache, i,\r\n isNode = elem.nodeType,\r\n\r\n // See jQuery.data for more information\r\n cache = isNode ? jQuery.cache : elem,\r\n id = isNode ? elem[jQuery.expando] : jQuery.expando;\r\n\r\n // If there is already no cache entry for this object, there is no\r\n // purpose in continuing\r\n if (!cache[id]) {\r\n return;\r\n }\r\n\r\n if (name) {\r\n\r\n thisCache = pvt ? cache[id] : cache[id].data;\r\n\r\n if (thisCache) {\r\n\r\n // Support array or space separated string names for data keys\r\n if (!jQuery.isArray(name)) {\r\n\r\n // try the string as a key before any manipulation\r\n if (name in thisCache) {\r\n name = [name];\r\n } else {\r\n\r\n // split the camel cased version by spaces unless a key with the spaces exists\r\n name = jQuery.camelCase(name);\r\n if (name in thisCache) {\r\n name = [name];\r\n } else {\r\n name = name.split(\" \");\r\n }\r\n }\r\n } else {\r\n // If \"name\" is an array of keys...\r\n // When data is initially created, via (\"key\", \"val\") signature,\r\n // keys will be converted to camelCase.\r\n // Since there is no way to tell _how_ a key was added, remove\r\n // both plain key and camelCase key. #12786\r\n // This will only penalize the array argument path.\r\n name = name.concat(jQuery.map(name, jQuery.camelCase));\r\n }\r\n\r\n i = name.length;\r\n while (i--) {\r\n delete thisCache[name[i]];\r\n }\r\n\r\n // If there is no data left in the cache, we want to continue\r\n // and let the cache object itself get destroyed\r\n if (pvt ? !isEmptyDataObject(thisCache) : !jQuery.isEmptyObject(thisCache)) {\r\n return;\r\n }\r\n }\r\n }\r\n\r\n // See jQuery.data for more information\r\n if (!pvt) {\r\n delete cache[id].data;\r\n\r\n // Don't destroy the parent cache unless the internal data object\r\n // had been the only thing left in it\r\n if (!isEmptyDataObject(cache[id])) {\r\n return;\r\n }\r\n }\r\n\r\n // Destroy the cache\r\n if (isNode) {\r\n jQuery.cleanData([elem], true);\r\n\r\n // Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)\r\n /* jshint eqeqeq: false */\r\n } else if (support.deleteExpando || cache != cache.window) {\r\n /* jshint eqeqeq: true */\r\n delete cache[id];\r\n\r\n // When all else fails, null\r\n } else {\r\n cache[id] = null;\r\n }\r\n }\r\n\r\n jQuery.extend({\r\n cache: {},\r\n\r\n // The following elements (space-suffixed to avoid Object.prototype collisions)\r\n // throw uncatchable exceptions if you attempt to set expando properties\r\n noData: {\r\n \"applet \": true,\r\n \"embed \": true,\r\n // ...but Flash objects (which have this classid) *can* handle expandos\r\n \"object \": \"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\"\r\n },\r\n\r\n hasData: function (elem) {\r\n elem = elem.nodeType ? jQuery.cache[elem[jQuery.expando]] : elem[jQuery.expando];\r\n return !!elem && !isEmptyDataObject(elem);\r\n },\r\n\r\n data: function (elem, name, data) {\r\n return internalData(elem, name, data);\r\n },\r\n\r\n removeData: function (elem, name) {\r\n return internalRemoveData(elem, name);\r\n },\r\n\r\n // For internal use only.\r\n _data: function (elem, name, data) {\r\n return internalData(elem, name, data, true);\r\n },\r\n\r\n _removeData: function (elem, name) {\r\n return internalRemoveData(elem, name, true);\r\n }\r\n });\r\n\r\n jQuery.fn.extend({\r\n data: function (key, value) {\r\n var i, name, data,\r\n elem = this[0],\r\n attrs = elem && elem.attributes;\r\n\r\n // Special expections of .data basically thwart jQuery.access,\r\n // so implement the relevant behavior ourselves\r\n\r\n // Gets all values\r\n if (key === undefined) {\r\n if (this.length) {\r\n data = jQuery.data(elem);\r\n\r\n if (elem.nodeType === 1 && !jQuery._data(elem, \"parsedAttrs\")) {\r\n i = attrs.length;\r\n while (i--) {\r\n\r\n // Support: IE11+\r\n // The attrs elements can be null (#14894)\r\n if (attrs[i]) {\r\n name = attrs[i].name;\r\n if (name.indexOf(\"data-\") === 0) {\r\n name = jQuery.camelCase(name.slice(5));\r\n dataAttr(elem, name, data[name]);\r\n }\r\n }\r\n }\r\n jQuery._data(elem, \"parsedAttrs\", true);\r\n }\r\n }\r\n\r\n return data;\r\n }\r\n\r\n // Sets multiple values\r\n if (typeof key === \"object\") {\r\n return this.each(function () {\r\n jQuery.data(this, key);\r\n });\r\n }\r\n\r\n return arguments.length > 1 ?\r\n\r\n // Sets one value\r\n this.each(function () {\r\n jQuery.data(this, key, value);\r\n }) :\r\n\r\n // Gets one value\r\n // Try to fetch any internally stored data first\r\n elem ? dataAttr(elem, key, jQuery.data(elem, key)) : undefined;\r\n },\r\n\r\n removeData: function (key) {\r\n return this.each(function () {\r\n jQuery.removeData(this, key);\r\n });\r\n }\r\n });\r\n\r\n\r\n jQuery.extend({\r\n queue: function (elem, type, data) {\r\n var queue;\r\n\r\n if (elem) {\r\n type = ( type || \"fx\" ) + \"queue\";\r\n queue = jQuery._data(elem, type);\r\n\r\n // Speed up dequeue by getting out quickly if this is just a lookup\r\n if (data) {\r\n if (!queue || jQuery.isArray(data)) {\r\n queue = jQuery._data(elem, type, jQuery.makeArray(data));\r\n } else {\r\n queue.push(data);\r\n }\r\n }\r\n return queue || [];\r\n }\r\n },\r\n\r\n dequeue: function (elem, type) {\r\n type = type || \"fx\";\r\n\r\n var queue = jQuery.queue(elem, type),\r\n startLength = queue.length,\r\n fn = queue.shift(),\r\n hooks = jQuery._queueHooks(elem, type),\r\n next = function () {\r\n jQuery.dequeue(elem, type);\r\n };\r\n\r\n // If the fx queue is dequeued, always remove the progress sentinel\r\n if (fn === \"inprogress\") {\r\n fn = queue.shift();\r\n startLength--;\r\n }\r\n\r\n if (fn) {\r\n\r\n // Add a progress sentinel to prevent the fx queue from being\r\n // automatically dequeued\r\n if (type === \"fx\") {\r\n queue.unshift(\"inprogress\");\r\n }\r\n\r\n // clear up the last queue stop function\r\n delete hooks.stop;\r\n fn.call(elem, next, hooks);\r\n }\r\n\r\n if (!startLength && hooks) {\r\n hooks.empty.fire();\r\n }\r\n },\r\n\r\n // not intended for public consumption - generates a queueHooks object, or returns the current one\r\n _queueHooks: function (elem, type) {\r\n var key = type + \"queueHooks\";\r\n return jQuery._data(elem, key) || jQuery._data(elem, key, {\r\n empty: jQuery.Callbacks(\"once memory\").add(function () {\r\n jQuery._removeData(elem, type + \"queue\");\r\n jQuery._removeData(elem, key);\r\n })\r\n });\r\n }\r\n });\r\n\r\n jQuery.fn.extend({\r\n queue: function (type, data) {\r\n var setter = 2;\r\n\r\n if (typeof type !== \"string\") {\r\n data = type;\r\n type = \"fx\";\r\n setter--;\r\n }\r\n\r\n if (arguments.length < setter) {\r\n return jQuery.queue(this[0], type);\r\n }\r\n\r\n return data === undefined ?\r\n this :\r\n this.each(function () {\r\n var queue = jQuery.queue(this, type, data);\r\n\r\n // ensure a hooks for this queue\r\n jQuery._queueHooks(this, type);\r\n\r\n if (type === \"fx\" && queue[0] !== \"inprogress\") {\r\n jQuery.dequeue(this, type);\r\n }\r\n });\r\n },\r\n dequeue: function (type) {\r\n return this.each(function () {\r\n jQuery.dequeue(this, type);\r\n });\r\n },\r\n clearQueue: function (type) {\r\n return this.queue(type || \"fx\", []);\r\n },\r\n // Get a promise resolved when queues of a certain type\r\n // are emptied (fx is the type by default)\r\n promise: function (type, obj) {\r\n var tmp,\r\n count = 1,\r\n defer = jQuery.Deferred(),\r\n elements = this,\r\n i = this.length,\r\n resolve = function () {\r\n if (!( --count )) {\r\n defer.resolveWith(elements, [elements]);\r\n }\r\n };\r\n\r\n if (typeof type !== \"string\") {\r\n obj = type;\r\n type = undefined;\r\n }\r\n type = type || \"fx\";\r\n\r\n while (i--) {\r\n tmp = jQuery._data(elements[i], type + \"queueHooks\");\r\n if (tmp && tmp.empty) {\r\n count++;\r\n tmp.empty.add(resolve);\r\n }\r\n }\r\n resolve();\r\n return defer.promise(obj);\r\n }\r\n });\r\n\r\n\r\n /*\r\n * Helper functions for managing events -- not part of the public interface.\r\n * Props to Dean Edwards' addEvent library for many of the ideas.\r\n */\r\n jQuery.event = {\r\n\r\n global: {},\r\n\r\n add: function (elem, types, handler, data, selector) {\r\n var tmp, events, t, handleObjIn,\r\n special, eventHandle, handleObj,\r\n handlers, type, namespaces, origType,\r\n elemData = jQuery._data(elem);\r\n\r\n // Don't attach events to noData or text/comment nodes (but allow plain objects)\r\n if (!elemData) {\r\n return;\r\n }\r\n\r\n // Caller can pass in an object of custom data in lieu of the handler\r\n if (handler.handler) {\r\n handleObjIn = handler;\r\n handler = handleObjIn.handler;\r\n selector = handleObjIn.selector;\r\n }\r\n\r\n // Make sure that the handler has a unique ID, used to find/remove it later\r\n if (!handler.guid) {\r\n handler.guid = jQuery.guid++;\r\n }\r\n\r\n // Init the element's event structure and main handler, if this is the first\r\n if (!(events = elemData.events)) {\r\n events = elemData.events = {};\r\n }\r\n if (!(eventHandle = elemData.handle)) {\r\n eventHandle = elemData.handle = function (e) {\r\n // Discard the second event of a jQuery.event.trigger() and\r\n // when an event is called after a page has unloaded\r\n return typeof jQuery !== strundefined && (!e || jQuery.event.triggered !== e.type) ?\r\n jQuery.event.dispatch.apply(eventHandle.elem, arguments) :\r\n undefined;\r\n };\r\n // Add elem as a property of the handle fn to prevent a memory leak with IE non-native events\r\n eventHandle.elem = elem;\r\n }\r\n\r\n // Handle multiple events separated by a space\r\n types = ( types || \"\" ).match(rnotwhite) || [\"\"];\r\n t = types.length;\r\n while (t--) {\r\n tmp = rtypenamespace.exec(types[t]) || [];\r\n type = origType = tmp[1];\r\n namespaces = ( tmp[2] || \"\" ).split(\".\").sort();\r\n\r\n // There *must* be a type, no attaching namespace-only handlers\r\n if (!type) {\r\n continue;\r\n }\r\n\r\n // If event changes its type, use the special event handlers for the changed type\r\n special = jQuery.event.special[type] || {};\r\n\r\n // If selector defined, determine special event api type, otherwise given type\r\n type = ( selector ? special.delegateType : special.bindType ) || type;\r\n\r\n // Update special based on newly reset type\r\n special = jQuery.event.special[type] || {};\r\n\r\n // handleObj is passed to all event handlers\r\n handleObj = jQuery.extend({\r\n type: type,\r\n origType: origType,\r\n data: data,\r\n handler: handler,\r\n guid: handler.guid,\r\n selector: selector,\r\n needsContext: selector && jQuery.expr.match.needsContext.test(selector),\r\n namespace: namespaces.join(\".\")\r\n }, handleObjIn);\r\n\r\n // Init the event handler queue if we're the first\r\n if (!(handlers = events[type])) {\r\n handlers = events[type] = [];\r\n handlers.delegateCount = 0;\r\n\r\n // Only use addEventListener/attachEvent if the special events handler returns false\r\n if (!special.setup || special.setup.call(elem, data, namespaces, eventHandle) === false) {\r\n // Bind the global event handler to the element\r\n if (elem.addEventListener) {\r\n elem.addEventListener(type, eventHandle, false);\r\n\r\n } else if (elem.attachEvent) {\r\n elem.attachEvent(\"on\" + type, eventHandle);\r\n }\r\n }\r\n }\r\n\r\n if (special.add) {\r\n special.add.call(elem, handleObj);\r\n\r\n if (!handleObj.handler.guid) {\r\n handleObj.handler.guid = handler.guid;\r\n }\r\n }\r\n\r\n // Add to the element's handler list, delegates in front\r\n if (selector) {\r\n handlers.splice(handlers.delegateCount++, 0, handleObj);\r\n } else {\r\n handlers.push(handleObj);\r\n }\r\n\r\n // Keep track of which events have ever been used, for event optimization\r\n jQuery.event.global[type] = true;\r\n }\r\n\r\n // Nullify elem to prevent memory leaks in IE\r\n elem = null;\r\n },\r\n\r\n // Detach an event or set of events from an element\r\n remove: function (elem, types, handler, selector, mappedTypes) {\r\n var j, handleObj, tmp,\r\n origCount, t, events,\r\n special, handlers, type,\r\n namespaces, origType,\r\n elemData = jQuery.hasData(elem) && jQuery._data(elem);\r\n\r\n if (!elemData || !(events = elemData.events)) {\r\n return;\r\n }\r\n\r\n // Once for each type.namespace in types; type may be omitted\r\n types = ( types || \"\" ).match(rnotwhite) || [\"\"];\r\n t = types.length;\r\n while (t--) {\r\n tmp = rtypenamespace.exec(types[t]) || [];\r\n type = origType = tmp[1];\r\n namespaces = ( tmp[2] || \"\" ).split(\".\").sort();\r\n\r\n // Unbind all events (on this namespace, if provided) for the element\r\n if (!type) {\r\n for (type in events) {\r\n jQuery.event.remove(elem, type + types[t], handler, selector, true);\r\n }\r\n continue;\r\n }\r\n\r\n special = jQuery.event.special[type] || {};\r\n type = ( selector ? special.delegateType : special.bindType ) || type;\r\n handlers = events[type] || [];\r\n tmp = tmp[2] && new RegExp(\"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\");\r\n\r\n // Remove matching events\r\n origCount = j = handlers.length;\r\n while (j--) {\r\n handleObj = handlers[j];\r\n\r\n if (( mappedTypes || origType === handleObj.origType ) &&\r\n ( !handler || handler.guid === handleObj.guid ) &&\r\n ( !tmp || tmp.test(handleObj.namespace) ) &&\r\n ( !selector || selector === handleObj.selector || selector === \"**\" && handleObj.selector )) {\r\n handlers.splice(j, 1);\r\n\r\n if (handleObj.selector) {\r\n handlers.delegateCount--;\r\n }\r\n if (special.remove) {\r\n special.remove.call(elem, handleObj);\r\n }\r\n }\r\n }\r\n\r\n // Remove generic event handler if we removed something and no more handlers exist\r\n // (avoids potential for endless recursion during removal of special event handlers)\r\n if (origCount && !handlers.length) {\r\n if (!special.teardown || special.teardown.call(elem, namespaces, elemData.handle) === false) {\r\n jQuery.removeEvent(elem, type, elemData.handle);\r\n }\r\n\r\n delete events[type];\r\n }\r\n }\r\n\r\n // Remove the expando if it's no longer used\r\n if (jQuery.isEmptyObject(events)) {\r\n delete elemData.handle;\r\n\r\n // removeData also checks for emptiness and clears the expando if empty\r\n // so use it instead of delete\r\n jQuery._removeData(elem, \"events\");\r\n }\r\n },\r\n\r\n trigger: function (event, data, elem, onlyHandlers) {\r\n var handle, ontype, cur,\r\n bubbleType, special, tmp, i,\r\n eventPath = [elem || document],\r\n type = hasOwn.call(event, \"type\") ? event.type : event,\r\n namespaces = hasOwn.call(event, \"namespace\") ? event.namespace.split(\".\") : [];\r\n\r\n cur = tmp = elem = elem || document;\r\n\r\n // Don't do events on text and comment nodes\r\n if (elem.nodeType === 3 || elem.nodeType === 8) {\r\n return;\r\n }\r\n\r\n // focus/blur morphs to focusin/out; ensure we're not firing them right now\r\n if (rfocusMorph.test(type + jQuery.event.triggered)) {\r\n return;\r\n }\r\n\r\n if (type.indexOf(\".\") >= 0) {\r\n // Namespaced trigger; create a regexp to match event type in handle()\r\n namespaces = type.split(\".\");\r\n type = namespaces.shift();\r\n namespaces.sort();\r\n }\r\n ontype = type.indexOf(\":\") < 0 && \"on\" + type;\r\n\r\n // Caller can pass in a jQuery.Event object, Object, or just an event type string\r\n event = event[jQuery.expando] ?\r\n event :\r\n new jQuery.Event(type, typeof event === \"object\" && event);\r\n\r\n // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true)\r\n event.isTrigger = onlyHandlers ? 2 : 3;\r\n event.namespace = namespaces.join(\".\");\r\n event.namespace_re = event.namespace ?\r\n new RegExp(\"(^|\\\\.)\" + namespaces.join(\"\\\\.(?:.*\\\\.|)\") + \"(\\\\.|$)\") :\r\n null;\r\n\r\n // Clean up the event in case it is being reused\r\n event.result = undefined;\r\n if (!event.target) {\r\n event.target = elem;\r\n }\r\n\r\n // Clone any incoming data and prepend the event, creating the handler arg list\r\n data = data == null ?\r\n [event] :\r\n jQuery.makeArray(data, [event]);\r\n\r\n // Allow special events to draw outside the lines\r\n special = jQuery.event.special[type] || {};\r\n if (!onlyHandlers && special.trigger && special.trigger.apply(elem, data) === false) {\r\n return;\r\n }\r\n\r\n // Determine event propagation path in advance, per W3C events spec (#9951)\r\n // Bubble up to document, then to window; watch for a global ownerDocument var (#9724)\r\n if (!onlyHandlers && !special.noBubble && !jQuery.isWindow(elem)) {\r\n\r\n bubbleType = special.delegateType || type;\r\n if (!rfocusMorph.test(bubbleType + type)) {\r\n cur = cur.parentNode;\r\n }\r\n for (; cur; cur = cur.parentNode) {\r\n eventPath.push(cur);\r\n tmp = cur;\r\n }\r\n\r\n // Only add window if we got to document (e.g., not plain obj or detached DOM)\r\n if (tmp === (elem.ownerDocument || document)) {\r\n eventPath.push(tmp.defaultView || tmp.parentWindow || window);\r\n }\r\n }\r\n\r\n // Fire handlers on the event path\r\n i = 0;\r\n while ((cur = eventPath[i++]) && !event.isPropagationStopped()) {\r\n\r\n event.type = i > 1 ?\r\n bubbleType :\r\n special.bindType || type;\r\n\r\n // jQuery handler\r\n handle = ( jQuery._data(cur, \"events\") || {} )[event.type] && jQuery._data(cur, \"handle\");\r\n if (handle) {\r\n handle.apply(cur, data);\r\n }\r\n\r\n // Native handler\r\n handle = ontype && cur[ontype];\r\n if (handle && handle.apply && jQuery.acceptData(cur)) {\r\n event.result = handle.apply(cur, data);\r\n if (event.result === false) {\r\n event.preventDefault();\r\n }\r\n }\r\n }\r\n event.type = type;\r\n\r\n // If nobody prevented the default action, do it now\r\n if (!onlyHandlers && !event.isDefaultPrevented()) {\r\n\r\n if ((!special._default || special._default.apply(eventPath.pop(), data) === false) &&\r\n jQuery.acceptData(elem)) {\r\n\r\n // Call a native DOM method on the target with the same name name as the event.\r\n // Can't use an .isFunction() check here because IE6/7 fails that test.\r\n // Don't do default actions on window, that's where global variables be (#6170)\r\n if (ontype && elem[type] && !jQuery.isWindow(elem)) {\r\n\r\n // Don't re-trigger an onFOO event when we call its FOO() method\r\n tmp = elem[ontype];\r\n\r\n if (tmp) {\r\n elem[ontype] = null;\r\n }\r\n\r\n // Prevent re-triggering of the same event, since we already bubbled it above\r\n jQuery.event.triggered = type;\r\n try {\r\n elem[type]();\r\n } catch (e) {\r\n // IE<9 dies on focus/blur to hidden element (#1486,#12518)\r\n // only reproducible on winXP IE8 native, not IE9 in IE8 mode\r\n }\r\n jQuery.event.triggered = undefined;\r\n\r\n if (tmp) {\r\n elem[ontype] = tmp;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return event.result;\r\n },\r\n\r\n dispatch: function (event) {\r\n\r\n // Make a writable jQuery.Event from the native event object\r\n event = jQuery.event.fix(event);\r\n\r\n var i, ret, handleObj, matched, j,\r\n handlerQueue = [],\r\n args = slice.call(arguments),\r\n handlers = ( jQuery._data(this, \"events\") || {} )[event.type] || [],\r\n special = jQuery.event.special[event.type] || {};\r\n\r\n // Use the fix-ed jQuery.Event rather than the (read-only) native event\r\n args[0] = event;\r\n event.delegateTarget = this;\r\n\r\n // Call the preDispatch hook for the mapped type, and let it bail if desired\r\n if (special.preDispatch && special.preDispatch.call(this, event) === false) {\r\n return;\r\n }\r\n\r\n // Determine handlers\r\n handlerQueue = jQuery.event.handlers.call(this, event, handlers);\r\n\r\n // Run delegates first; they may want to stop propagation beneath us\r\n i = 0;\r\n while ((matched = handlerQueue[i++]) && !event.isPropagationStopped()) {\r\n event.currentTarget = matched.elem;\r\n\r\n j = 0;\r\n while ((handleObj = matched.handlers[j++]) && !event.isImmediatePropagationStopped()) {\r\n\r\n // Triggered event must either 1) have no namespace, or\r\n // 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).\r\n if (!event.namespace_re || event.namespace_re.test(handleObj.namespace)) {\r\n\r\n event.handleObj = handleObj;\r\n event.data = handleObj.data;\r\n\r\n ret = ( (jQuery.event.special[handleObj.origType] || {}).handle || handleObj.handler )\r\n .apply(matched.elem, args);\r\n\r\n if (ret !== undefined) {\r\n if ((event.result = ret) === false) {\r\n event.preventDefault();\r\n event.stopPropagation();\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Call the postDispatch hook for the mapped type\r\n if (special.postDispatch) {\r\n special.postDispatch.call(this, event);\r\n }\r\n\r\n return event.result;\r\n },\r\n\r\n handlers: function (event, handlers) {\r\n var sel, handleObj, matches, i,\r\n handlerQueue = [],\r\n delegateCount = handlers.delegateCount,\r\n cur = event.target;\r\n\r\n // Find delegate handlers\r\n // Black-hole SVG <use> instance trees (#13180)\r\n // Avoid non-left-click bubbling in Firefox (#3861)\r\n if (delegateCount && cur.nodeType && (!event.button || event.type !== \"click\")) {\r\n\r\n /* jshint eqeqeq: false */\r\n for (; cur != this; cur = cur.parentNode || this) {\r\n /* jshint eqeqeq: true */\r\n\r\n // Don't check non-elements (#13208)\r\n // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764)\r\n if (cur.nodeType === 1 && (cur.disabled !== true || event.type !== \"click\")) {\r\n matches = [];\r\n for (i = 0; i < delegateCount; i++) {\r\n handleObj = handlers[i];\r\n\r\n // Don't conflict with Object.prototype properties (#13203)\r\n sel = handleObj.selector + \" \";\r\n\r\n if (matches[sel] === undefined) {\r\n matches[sel] = handleObj.needsContext ?\r\n jQuery(sel, this).index(cur) >= 0 :\r\n jQuery.find(sel, this, null, [cur]).length;\r\n }\r\n if (matches[sel]) {\r\n matches.push(handleObj);\r\n }\r\n }\r\n if (matches.length) {\r\n handlerQueue.push({elem: cur, handlers: matches});\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Add the remaining (directly-bound) handlers\r\n if (delegateCount < handlers.length) {\r\n handlerQueue.push({elem: this, handlers: handlers.slice(delegateCount)});\r\n }\r\n\r\n return handlerQueue;\r\n },\r\n\r\n fix: function (event) {\r\n if (event[jQuery.expando]) {\r\n return event;\r\n }\r\n\r\n // Create a writable copy of the event object and normalize some properties\r\n var i, prop, copy,\r\n type = event.type,\r\n originalEvent = event,\r\n fixHook = this.fixHooks[type];\r\n\r\n if (!fixHook) {\r\n this.fixHooks[type] = fixHook =\r\n rmouseEvent.test(type) ? this.mouseHooks :\r\n rkeyEvent.test(type) ? this.keyHooks :\r\n {};\r\n }\r\n copy = fixHook.props ? this.props.concat(fixHook.props) : this.props;\r\n\r\n event = new jQuery.Event(originalEvent);\r\n\r\n i = copy.length;\r\n while (i--) {\r\n prop = copy[i];\r\n event[prop] = originalEvent[prop];\r\n }\r\n\r\n // Support: IE<9\r\n // Fix target property (#1925)\r\n if (!event.target) {\r\n event.target = originalEvent.srcElement || document;\r\n }\r\n\r\n // Support: Chrome 23+, Safari?\r\n // Target should not be a text node (#504, #13143)\r\n if (event.target.nodeType === 3) {\r\n event.target = event.target.parentNode;\r\n }\r\n\r\n // Support: IE<9\r\n // For mouse/key events, metaKey==false if it's undefined (#3368, #11328)\r\n event.metaKey = !!event.metaKey;\r\n\r\n return fixHook.filter ? fixHook.filter(event, originalEvent) : event;\r\n },\r\n\r\n // Includes some event props shared by KeyEvent and MouseEvent\r\n props: \"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which\".split(\" \"),\r\n\r\n fixHooks: {},\r\n\r\n keyHooks: {\r\n props: \"char charCode key keyCode\".split(\" \"),\r\n filter: function (event, original) {\r\n\r\n // Add which for key events\r\n if (event.which == null) {\r\n event.which = original.charCode != null ? original.charCode : original.keyCode;\r\n }\r\n\r\n return event;\r\n }\r\n },\r\n\r\n mouseHooks: {\r\n props: \"button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement\".split(\" \"),\r\n filter: function (event, original) {\r\n var body, eventDoc, doc,\r\n button = original.button,\r\n fromElement = original.fromElement;\r\n\r\n // Calculate pageX/Y if missing and clientX/Y available\r\n if (event.pageX == null && original.clientX != null) {\r\n eventDoc = event.target.ownerDocument || document;\r\n doc = eventDoc.documentElement;\r\n body = eventDoc.body;\r\n\r\n event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );\r\n event.pageY = original.clientY + ( doc && doc.scrollTop || body && body.scrollTop || 0 ) - ( doc && doc.clientTop || body && body.clientTop || 0 );\r\n }\r\n\r\n // Add relatedTarget, if necessary\r\n if (!event.relatedTarget && fromElement) {\r\n event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;\r\n }\r\n\r\n // Add which for click: 1 === left; 2 === middle; 3 === right\r\n // Note: button is not normalized, so don't use it\r\n if (!event.which && button !== undefined) {\r\n event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );\r\n }\r\n\r\n return event;\r\n }\r\n },\r\n\r\n special: {\r\n load: {\r\n // Prevent triggered image.load events from bubbling to window.load\r\n noBubble: true\r\n },\r\n focus: {\r\n // Fire native event if possible so blur/focus sequence is correct\r\n trigger: function () {\r\n if (this !== safeActiveElement() && this.focus) {\r\n try {\r\n this.focus();\r\n return false;\r\n } catch (e) {\r\n // Support: IE<9\r\n // If we error on focus to hidden element (#1486, #12518),\r\n // let .trigger() run the handlers\r\n }\r\n }\r\n },\r\n delegateType: \"focusin\"\r\n },\r\n blur: {\r\n trigger: function () {\r\n if (this === safeActiveElement() && this.blur) {\r\n this.blur();\r\n return false;\r\n }\r\n },\r\n delegateType: \"focusout\"\r\n },\r\n click: {\r\n // For checkbox, fire native event so checked state will be right\r\n trigger: function () {\r\n if (jQuery.nodeName(this, \"input\") && this.type === \"checkbox\" && this.click) {\r\n this.click();\r\n return false;\r\n }\r\n },\r\n\r\n // For cross-browser consistency, don't fire native .click() on links\r\n _default: function (event) {\r\n return jQuery.nodeName(event.target, \"a\");\r\n }\r\n },\r\n\r\n beforeunload: {\r\n postDispatch: function (event) {\r\n\r\n // Support: Firefox 20+\r\n // Firefox doesn't alert if the returnValue field is not set.\r\n if (event.result !== undefined && event.originalEvent) {\r\n event.originalEvent.returnValue = event.result;\r\n }\r\n }\r\n }\r\n },\r\n\r\n simulate: function (type, elem, event, bubble) {\r\n // Piggyback on a donor event to simulate a different one.\r\n // Fake originalEvent to avoid donor's stopPropagation, but if the\r\n // simulated event prevents default then we do the same on the donor.\r\n var e = jQuery.extend(\r\n new jQuery.Event(),\r\n event,\r\n {\r\n type: type,\r\n isSimulated: true,\r\n originalEvent: {}\r\n }\r\n );\r\n if (bubble) {\r\n jQuery.event.trigger(e, null, elem);\r\n } else {\r\n jQuery.event.dispatch.call(elem, e);\r\n }\r\n if (e.isDefaultPrevented()) {\r\n event.preventDefault();\r\n }\r\n }\r\n };\r\n\r\n jQuery.removeEvent = document.removeEventListener ?\r\n function (elem, type, handle) {\r\n if (elem.removeEventListener) {\r\n elem.removeEventListener(type, handle, false);\r\n }\r\n } :\r\n function (elem, type, handle) {\r\n var name = \"on\" + type;\r\n\r\n if (elem.detachEvent) {\r\n\r\n // #8545, #7054, preventing memory leaks for custom events in IE6-8\r\n // detachEvent needed property on element, by name of that event, to properly expose it to GC\r\n if (typeof elem[name] === strundefined) {\r\n elem[name] = null;\r\n }\r\n\r\n elem.detachEvent(name, handle);\r\n }\r\n };\r\n\r\n jQuery.Event = function (src, props) {\r\n // Allow instantiation without the 'new' keyword\r\n if (!(this instanceof jQuery.Event)) {\r\n return new jQuery.Event(src, props);\r\n }\r\n\r\n // Event object\r\n if (src && src.type) {\r\n this.originalEvent = src;\r\n this.type = src.type;\r\n\r\n // Events bubbling up the document may have been marked as prevented\r\n // by a handler lower down the tree; reflect the correct value.\r\n this.isDefaultPrevented = src.defaultPrevented ||\r\n src.defaultPrevented === undefined &&\r\n // Support: IE < 9, Android < 4.0\r\n src.returnValue === false ?\r\n returnTrue :\r\n returnFalse;\r\n\r\n // Event type\r\n } else {\r\n this.type = src;\r\n }\r\n\r\n // Put explicitly provided properties onto the event object\r\n if (props) {\r\n jQuery.extend(this, props);\r\n }\r\n\r\n // Create a timestamp if incoming event doesn't have one\r\n this.timeStamp = src && src.timeStamp || jQuery.now();\r\n\r\n // Mark it as fixed\r\n this[jQuery.expando] = true;\r\n };\r\n\r\n var rformElems = /^(?:input|select|textarea)$/i,\r\n rkeyEvent = /^key/,\r\n rmouseEvent = /^(?:mouse|pointer|contextmenu)|click/,\r\n rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,\r\n rtypenamespace = /^([^.]*)(?:\\.(.+)|)$/;\r\n\r\n function returnTrue() {\r\n return true;\r\n }\r\n\r\n function returnFalse() {\r\n return false;\r\n }\r\n\r\n// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding\r\n// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html\r\n jQuery.Event.prototype = {\r\n isDefaultPrevented: returnFalse,\r\n isPropagationStopped: returnFalse,\r\n isImmediatePropagationStopped: returnFalse,\r\n\r\n preventDefault: function () {\r\n var e = this.originalEvent;\r\n\r\n this.isDefaultPrevented = returnTrue;\r\n if (!e) {\r\n return;\r\n }\r\n\r\n // If preventDefault exists, run it on the original event\r\n if (e.preventDefault) {\r\n e.preventDefault();\r\n\r\n // Support: IE\r\n // Otherwise set the returnValue property of the original event to false\r\n } else {\r\n e.returnValue = false;\r\n }\r\n },\r\n stopPropagation: function () {\r\n var e = this.originalEvent;\r\n\r\n this.isPropagationStopped = returnTrue;\r\n if (!e) {\r\n return;\r\n }\r\n // If stopPropagation exists, run it on the original event\r\n if (e.stopPropagation) {\r\n e.stopPropagation();\r\n }\r\n\r\n // Support: IE\r\n // Set the cancelBubble property of the original event to true\r\n e.cancelBubble = true;\r\n },\r\n stopImmediatePropagation: function () {\r\n var e = this.originalEvent;\r\n\r\n this.isImmediatePropagationStopped = returnTrue;\r\n\r\n if (e && e.stopImmediatePropagation) {\r\n e.stopImmediatePropagation();\r\n }\r\n\r\n this.stopPropagation();\r\n }\r\n };\r\n\r\n\r\n// IE submit delegation\r\n if (!support.submitBubbles) {\r\n\r\n jQuery.event.special.submit = {\r\n setup: function () {\r\n // Only need this for delegated form submit events\r\n if (jQuery.nodeName(this, \"form\")) {\r\n return false;\r\n }\r\n\r\n // Lazy-add a submit handler when a descendant form may potentially be submitted\r\n jQuery.event.add(this, \"click._submit keypress._submit\", function (e) {\r\n // Node name check avoids a VML-related crash in IE (#9807)\r\n var elem = e.target,\r\n form = jQuery.nodeName(elem, \"input\") || jQuery.nodeName(elem, \"button\") ? elem.form : undefined;\r\n if (form && !jQuery._data(form, \"submitBubbles\")) {\r\n jQuery.event.add(form, \"submit._submit\", function (event) {\r\n event._submit_bubble = true;\r\n });\r\n jQuery._data(form, \"submitBubbles\", true);\r\n }\r\n });\r\n // return undefined since we don't need an event listener\r\n },\r\n\r\n postDispatch: function (event) {\r\n // If form was submitted by the user, bubble the event up the tree\r\n if (event._submit_bubble) {\r\n delete event._submit_bubble;\r\n if (this.parentNode && !event.isTrigger) {\r\n jQuery.event.simulate(\"submit\", this.parentNode, event, true);\r\n }\r\n }\r\n },\r\n\r\n teardown: function () {\r\n // Only need this for delegated form submit events\r\n if (jQuery.nodeName(this, \"form\")) {\r\n return false;\r\n }\r\n\r\n // Remove delegated handlers; cleanData eventually reaps submit handlers attached above\r\n jQuery.event.remove(this, \"._submit\");\r\n }\r\n };\r\n }\r\n\r\n// IE change delegation and checkbox/radio fix\r\n if (!support.changeBubbles) {\r\n\r\n jQuery.event.special.change = {\r\n\r\n setup: function () {\r\n\r\n if (rformElems.test(this.nodeName)) {\r\n // IE doesn't fire change on a check/radio until blur; trigger it on click\r\n // after a propertychange. Eat the blur-change in special.change.handle.\r\n // This still fires onchange a second time for check/radio after blur.\r\n if (this.type === \"checkbox\" || this.type === \"radio\") {\r\n jQuery.event.add(this, \"propertychange._change\", function (event) {\r\n if (event.originalEvent.propertyName === \"checked\") {\r\n this._just_changed = true;\r\n }\r\n });\r\n jQuery.event.add(this, \"click._change\", function (event) {\r\n if (this._just_changed && !event.isTrigger) {\r\n this._just_changed = false;\r\n }\r\n // Allow triggered, simulated change events (#11500)\r\n jQuery.event.simulate(\"change\", this, event, true);\r\n });\r\n }\r\n return false;\r\n }\r\n // Delegated event; lazy-add a change handler on descendant inputs\r\n jQuery.event.add(this, \"beforeactivate._change\", function (e) {\r\n var elem = e.target;\r\n\r\n if (rformElems.test(elem.nodeName) && !jQuery._data(elem, \"changeBubbles\")) {\r\n jQuery.event.add(elem, \"change._change\", function (event) {\r\n if (this.parentNode && !event.isSimulated && !event.isTrigger) {\r\n jQuery.event.simulate(\"change\", this.parentNode, event, true);\r\n }\r\n });\r\n jQuery._data(elem, \"changeBubbles\", true);\r\n }\r\n });\r\n },\r\n\r\n handle: function (event) {\r\n var elem = event.target;\r\n\r\n // Swallow native change events from checkbox/radio, we already triggered them above\r\n if (this !== elem || event.isSimulated || event.isTrigger || (elem.type !== \"radio\" && elem.type !== \"checkbox\")) {\r\n return event.handleObj.handler.apply(this, arguments);\r\n }\r\n },\r\n\r\n teardown: function () {\r\n jQuery.event.remove(this, \"._change\");\r\n\r\n return !rformElems.test(this.nodeName);\r\n }\r\n };\r\n }\r\n\r\n// Create \"bubbling\" focus and blur events\r\n if (!support.focusinBubbles) {\r\n jQuery.each({focus: \"focusin\", blur: \"focusout\"}, function (orig, fix) {\r\n\r\n // Attach a single capturing handler on the document while someone wants focusin/focusout\r\n var handler = function (event) {\r\n jQuery.event.simulate(fix, event.target, jQuery.event.fix(event), true);\r\n };\r\n\r\n jQuery.event.special[fix] = {\r\n setup: function () {\r\n var doc = this.ownerDocument || this,\r\n attaches = jQuery._data(doc, fix);\r\n\r\n if (!attaches) {\r\n doc.addEventListener(orig, handler, true);\r\n }\r\n jQuery._data(doc, fix, ( attaches || 0 ) + 1);\r\n },\r\n teardown: function () {\r\n var doc = this.ownerDocument || this,\r\n attaches = jQuery._data(doc, fix) - 1;\r\n\r\n if (!attaches) {\r\n doc.removeEventListener(orig, handler, true);\r\n jQuery._removeData(doc, fix);\r\n } else {\r\n jQuery._data(doc, fix, attaches);\r\n }\r\n }\r\n };\r\n });\r\n }\r\n\r\n jQuery.fn.extend({\r\n\r\n on: function (types, selector, data, fn, /*INTERNAL*/ one) {\r\n var type, origFn;\r\n\r\n // Types can be a map of types/handlers\r\n if (typeof types === \"object\") {\r\n // ( types-Object, selector, data )\r\n if (typeof selector !== \"string\") {\r\n // ( types-Object, data )\r\n data = data || selector;\r\n selector = undefined;\r\n }\r\n for (type in types) {\r\n this.on(type, selector, data, types[type], one);\r\n }\r\n return this;\r\n }\r\n\r\n if (data == null && fn == null) {\r\n // ( types, fn )\r\n fn = selector;\r\n data = selector = undefined;\r\n } else if (fn == null) {\r\n if (typeof selector === \"string\") {\r\n // ( types, selector, fn )\r\n fn = data;\r\n data = undefined;\r\n } else {\r\n // ( types, data, fn )\r\n fn = data;\r\n data = selector;\r\n selector = undefined;\r\n }\r\n }\r\n if (fn === false) {\r\n fn = returnFalse;\r\n } else if (!fn) {\r\n return this;\r\n }\r\n\r\n if (one === 1) {\r\n origFn = fn;\r\n fn = function (event) {\r\n // Can use an empty set, since event contains the info\r\n jQuery().off(event);\r\n return origFn.apply(this, arguments);\r\n };\r\n // Use same guid so caller can remove using origFn\r\n fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );\r\n }\r\n return this.each(function () {\r\n jQuery.event.add(this, types, fn, data, selector);\r\n });\r\n },\r\n one: function (types, selector, data, fn) {\r\n return this.on(types, selector, data, fn, 1);\r\n },\r\n off: function (types, selector, fn) {\r\n var handleObj, type;\r\n if (types && types.preventDefault && types.handleObj) {\r\n // ( event ) dispatched jQuery.Event\r\n handleObj = types.handleObj;\r\n jQuery(types.delegateTarget).off(\r\n handleObj.namespace ? handleObj.origType + \".\" + handleObj.namespace : handleObj.origType,\r\n handleObj.selector,\r\n handleObj.handler\r\n );\r\n return this;\r\n }\r\n if (typeof types === \"object\") {\r\n // ( types-object [, selector] )\r\n for (type in types) {\r\n this.off(type, selector, types[type]);\r\n }\r\n return this;\r\n }\r\n if (selector === false || typeof selector === \"function\") {\r\n // ( types [, fn] )\r\n fn = selector;\r\n selector = undefined;\r\n }\r\n if (fn === false) {\r\n fn = returnFalse;\r\n }\r\n return this.each(function () {\r\n jQuery.event.remove(this, types, fn, selector);\r\n });\r\n },\r\n\r\n trigger: function (type, data) {\r\n return this.each(function () {\r\n jQuery.event.trigger(type, data, this);\r\n });\r\n },\r\n triggerHandler: function (type, data) {\r\n var elem = this[0];\r\n if (elem) {\r\n return jQuery.event.trigger(type, data, elem, true);\r\n }\r\n }\r\n });\r\n\r\n\r\n// Based off of the plugin by Clint Helfers, with permission.\r\n// http://blindsignals.com/index.php/2009/07/jquery-delay/\r\n jQuery.fn.delay = function (time, type) {\r\n time = jQuery.fx ? jQuery.fx.speeds[time] || time : time;\r\n type = type || \"fx\";\r\n\r\n return this.queue(type, function (next, hooks) {\r\n var timeout = setTimeout(next, time);\r\n hooks.stop = function () {\r\n clearTimeout(timeout);\r\n };\r\n });\r\n };\r\n\r\n\r\n var nonce = jQuery.now();\r\n\r\n var rquery = (/\\?/);\r\n\r\n\r\n var rvalidtokens = /(,)|(\\[|{)|(}|])|\"(?:[^\"\\\\\\r\\n]|\\\\[\"\\\\\\/bfnrt]|\\\\u[\\da-fA-F]{4})*\"\\s*:?|true|false|null|-?(?!0\\d)\\d+(?:\\.\\d+|)(?:[eE][+-]?\\d+|)/g;\r\n\r\n jQuery.parseJSON = function (data) {\r\n // Attempt to parse using the native JSON parser first\r\n if (window.JSON && window.JSON.parse) {\r\n // Support: Android 2.3\r\n // Workaround failure to string-cast null input\r\n return window.JSON.parse(data + \"\");\r\n }\r\n\r\n var requireNonComma,\r\n depth = null,\r\n str = jQuery.trim(data + \"\");\r\n\r\n // Guard against invalid (and possibly dangerous) input by ensuring that nothing remains\r\n // after removing valid tokens\r\n return str && !jQuery.trim(str.replace(rvalidtokens, function (token, comma, open, close) {\r\n\r\n // Force termination if we see a misplaced comma\r\n if (requireNonComma && comma) {\r\n depth = 0;\r\n }\r\n\r\n // Perform no more replacements after returning to outermost depth\r\n if (depth === 0) {\r\n return token;\r\n }\r\n\r\n // Commas must not follow \"[\", \"{\", or \",\"\r\n requireNonComma = open || comma;\r\n\r\n // Determine new depth\r\n // array/object open (\"[\" or \"{\"): depth += true - false (increment)\r\n // array/object close (\"]\" or \"}\"): depth += false - true (decrement)\r\n // other cases (\",\" or primitive): depth += true - true (numeric cast)\r\n depth += !close - !open;\r\n\r\n // Remove this token\r\n return \"\";\r\n })) ?\r\n ( Function(\"return \" + str) )() :\r\n jQuery.error(\"Invalid JSON: \" + data);\r\n };\r\n\r\n\r\n// Cross-browser xml parsing\r\n jQuery.parseXML = function (data) {\r\n var xml, tmp;\r\n if (!data || typeof data !== \"string\") {\r\n return null;\r\n }\r\n try {\r\n if (window.DOMParser) { // Standard\r\n tmp = new DOMParser();\r\n xml = tmp.parseFromString(data, \"text/xml\");\r\n } else { // IE\r\n xml = new ActiveXObject(\"Microsoft.XMLDOM\");\r\n xml.async = \"false\";\r\n xml.loadXML(data);\r\n }\r\n } catch (e) {\r\n xml = undefined;\r\n }\r\n if (!xml || !xml.documentElement || xml.getElementsByTagName(\"parsererror\").length) {\r\n jQuery.error(\"Invalid XML: \" + data);\r\n }\r\n return xml;\r\n };\r\n\r\n\r\n var\r\n // Document location\r\n ajaxLocParts,\r\n ajaxLocation,\r\n\r\n rhash = /#.*$/,\r\n rts = /([?&])_=[^&]*/,\r\n rheaders = /^(.*?):[ \\t]*([^\\r\\n]*)\\r?$/mg, // IE leaves an \\r character at EOL\r\n // #7653, #8125, #8152: local protocol detection\r\n rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/,\r\n rnoContent = /^(?:GET|HEAD)$/,\r\n rprotocol = /^\\/\\//,\r\n rurl = /^([\\w.+-]+:)(?:\\/\\/(?:[^\\/?#]*@|)([^\\/?#:]*)(?::(\\d+)|)|)/,\r\n\r\n /* Prefilters\r\n * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)\r\n * 2) These are called:\r\n * - BEFORE asking for a transport\r\n * - AFTER param serialization (s.data is a string if s.processData is true)\r\n * 3) key is the dataType\r\n * 4) the catchall symbol \"*\" can be used\r\n * 5) execution will start with transport dataType and THEN continue down to \"*\" if needed\r\n */\r\n prefilters = {},\r\n\r\n /* Transports bindings\r\n * 1) key is the dataType\r\n * 2) the catchall symbol \"*\" can be used\r\n * 3) selection will start with transport dataType and THEN go to \"*\" if needed\r\n */\r\n transports = {},\r\n\r\n // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression\r\n allTypes = \"*/\".concat(\"*\");\r\n\r\n// #8138, IE may throw an exception when accessing\r\n// a field from window.location if document.domain has been set\r\n try {\r\n ajaxLocation = location.href;\r\n } catch (e) {\r\n // Use the href attribute of an A element\r\n // since IE will modify it given document.location\r\n ajaxLocation = document.createElement(\"a\");\r\n ajaxLocation.href = \"\";\r\n ajaxLocation = ajaxLocation.href;\r\n }\r\n\r\n// Segment location into parts\r\n ajaxLocParts = rurl.exec(ajaxLocation.toLowerCase()) || [];\r\n\r\n// Base \"constructor\" for jQuery.ajaxPrefilter and jQuery.ajaxTransport\r\n function addToPrefiltersOrTransports(structure) {\r\n\r\n // dataTypeExpression is optional and defaults to \"*\"\r\n return function (dataTypeExpression, func) {\r\n\r\n if (typeof dataTypeExpression !== \"string\") {\r\n func = dataTypeExpression;\r\n dataTypeExpression = \"*\";\r\n }\r\n\r\n var dataType,\r\n i = 0,\r\n dataTypes = dataTypeExpression.toLowerCase().match(rnotwhite) || [];\r\n\r\n if (jQuery.isFunction(func)) {\r\n // For each dataType in the dataTypeExpression\r\n while ((dataType = dataTypes[i++])) {\r\n // Prepend if requested\r\n if (dataType.charAt(0) === \"+\") {\r\n dataType = dataType.slice(1) || \"*\";\r\n (structure[dataType] = structure[dataType] || []).unshift(func);\r\n\r\n // Otherwise append\r\n } else {\r\n (structure[dataType] = structure[dataType] || []).push(func);\r\n }\r\n }\r\n }\r\n };\r\n }\r\n\r\n// Base inspection function for prefilters and transports\r\n function inspectPrefiltersOrTransports(structure, options, originalOptions, jqXHR) {\r\n\r\n var inspected = {},\r\n seekingTransport = ( structure === transports );\r\n\r\n function inspect(dataType) {\r\n var selected;\r\n inspected[dataType] = true;\r\n jQuery.each(structure[dataType] || [], function (_, prefilterOrFactory) {\r\n var dataTypeOrTransport = prefilterOrFactory(options, originalOptions, jqXHR);\r\n if (typeof dataTypeOrTransport === \"string\" && !seekingTransport && !inspected[dataTypeOrTransport]) {\r\n options.dataTypes.unshift(dataTypeOrTransport);\r\n inspect(dataTypeOrTransport);\r\n return false;\r\n } else if (seekingTransport) {\r\n return !( selected = dataTypeOrTransport );\r\n }\r\n });\r\n return selected;\r\n }\r\n\r\n return inspect(options.dataTypes[0]) || !inspected[\"*\"] && inspect(\"*\");\r\n }\r\n\r\n// A special extend for ajax options\r\n// that takes \"flat\" options (not to be deep extended)\r\n// Fixes #9887\r\n function ajaxExtend(target, src) {\r\n var deep, key,\r\n flatOptions = jQuery.ajaxSettings.flatOptions || {};\r\n\r\n for (key in src) {\r\n if (src[key] !== undefined) {\r\n ( flatOptions[key] ? target : ( deep || (deep = {}) ) )[key] = src[key];\r\n }\r\n }\r\n if (deep) {\r\n jQuery.extend(true, target, deep);\r\n }\r\n\r\n return target;\r\n }\r\n\r\n /* Handles responses to an ajax request:\r\n * - finds the right dataType (mediates between content-type and expected dataType)\r\n * - returns the corresponding response\r\n */\r\n function ajaxHandleResponses(s, jqXHR, responses) {\r\n var firstDataType, ct, finalDataType, type,\r\n contents = s.contents,\r\n dataTypes = s.dataTypes;\r\n\r\n // Remove auto dataType and get content-type in the process\r\n while (dataTypes[0] === \"*\") {\r\n dataTypes.shift();\r\n if (ct === undefined) {\r\n ct = s.mimeType || jqXHR.getResponseHeader(\"Content-Type\");\r\n }\r\n }\r\n\r\n // Check if we're dealing with a known content-type\r\n if (ct) {\r\n for (type in contents) {\r\n if (contents[type] && contents[type].test(ct)) {\r\n dataTypes.unshift(type);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n // Check to see if we have a response for the expected dataType\r\n if (dataTypes[0] in responses) {\r\n finalDataType = dataTypes[0];\r\n } else {\r\n // Try convertible dataTypes\r\n for (type in responses) {\r\n if (!dataTypes[0] || s.converters[type + \" \" + dataTypes[0]]) {\r\n finalDataType = type;\r\n break;\r\n }\r\n if (!firstDataType) {\r\n firstDataType = type;\r\n }\r\n }\r\n // Or just use first one\r\n finalDataType = finalDataType || firstDataType;\r\n }\r\n\r\n // If we found a dataType\r\n // We add the dataType to the list if needed\r\n // and return the corresponding response\r\n if (finalDataType) {\r\n if (finalDataType !== dataTypes[0]) {\r\n dataTypes.unshift(finalDataType);\r\n }\r\n return responses[finalDataType];\r\n }\r\n }\r\n\r\n /* Chain conversions given the request and the original response\r\n * Also sets the responseXXX fields on the jqXHR instance\r\n */\r\n function ajaxConvert(s, response, jqXHR, isSuccess) {\r\n var conv2, current, conv, tmp, prev,\r\n converters = {},\r\n // Work with a copy of dataTypes in case we need to modify it for conversion\r\n dataTypes = s.dataTypes.slice();\r\n\r\n // Create converters map with lowercased keys\r\n if (dataTypes[1]) {\r\n for (conv in s.converters) {\r\n converters[conv.toLowerCase()] = s.converters[conv];\r\n }\r\n }\r\n\r\n current = dataTypes.shift();\r\n\r\n // Convert to each sequential dataType\r\n while (current) {\r\n\r\n if (s.responseFields[current]) {\r\n jqXHR[s.responseFields[current]] = response;\r\n }\r\n\r\n // Apply the dataFilter if provided\r\n if (!prev && isSuccess && s.dataFilter) {\r\n response = s.dataFilter(response, s.dataType);\r\n }\r\n\r\n prev = current;\r\n current = dataTypes.shift();\r\n\r\n if (current) {\r\n\r\n // There's only work to do if current dataType is non-auto\r\n if (current === \"*\") {\r\n\r\n current = prev;\r\n\r\n // Convert response if prev dataType is non-auto and differs from current\r\n } else if (prev !== \"*\" && prev !== current) {\r\n\r\n // Seek a direct converter\r\n conv = converters[prev + \" \" + current] || converters[\"* \" + current];\r\n\r\n // If none found, seek a pair\r\n if (!conv) {\r\n for (conv2 in converters) {\r\n\r\n // If conv2 outputs current\r\n tmp = conv2.split(\" \");\r\n if (tmp[1] === current) {\r\n\r\n // If prev can be converted to accepted input\r\n conv = converters[prev + \" \" + tmp[0]] ||\r\n converters[\"* \" + tmp[0]];\r\n if (conv) {\r\n // Condense equivalence converters\r\n if (conv === true) {\r\n conv = converters[conv2];\r\n\r\n // Otherwise, insert the intermediate dataType\r\n } else if (converters[conv2] !== true) {\r\n current = tmp[0];\r\n dataTypes.unshift(tmp[1]);\r\n }\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Apply converter (if not an equivalence)\r\n if (conv !== true) {\r\n\r\n // Unless errors are allowed to bubble, catch and return them\r\n if (conv && s[\"throws\"]) {\r\n response = conv(response);\r\n } else {\r\n try {\r\n response = conv(response);\r\n } catch (e) {\r\n return {\r\n state: \"parsererror\",\r\n error: conv ? e : \"No conversion from \" + prev + \" to \" + current\r\n };\r\n }\r\n }\r\n }\r\n }\r\n }\r\n }\r\n\r\n return {state: \"success\", data: response};\r\n }\r\n\r\n jQuery.extend({\r\n\r\n // Counter for holding the number of active queries\r\n active: 0,\r\n\r\n // Last-Modified header cache for next request\r\n lastModified: {},\r\n etag: {},\r\n\r\n ajaxSettings: {\r\n url: ajaxLocation,\r\n type: \"GET\",\r\n isLocal: rlocalProtocol.test(ajaxLocParts[1]),\r\n global: true,\r\n processData: true,\r\n async: true,\r\n contentType: \"application/x-www-form-urlencoded; charset=UTF-8\",\r\n /*\r\n timeout: 0,\r\n data: null,\r\n dataType: null,\r\n username: null,\r\n password: null,\r\n cache: null,\r\n throws: false,\r\n traditional: false,\r\n headers: {},\r\n */\r\n\r\n accepts: {\r\n \"*\": allTypes,\r\n text: \"text/plain\",\r\n html: \"text/html\",\r\n xml: \"application/xml, text/xml\",\r\n json: \"application/json, text/javascript\"\r\n },\r\n\r\n contents: {\r\n xml: /xml/,\r\n html: /html/,\r\n json: /json/\r\n },\r\n\r\n responseFields: {\r\n xml: \"responseXML\",\r\n text: \"responseText\",\r\n json: \"responseJSON\"\r\n },\r\n\r\n // Data converters\r\n // Keys separate source (or catchall \"*\") and destination types with a single space\r\n converters: {\r\n\r\n // Convert anything to text\r\n \"* text\": String,\r\n\r\n // Text to html (true = no transformation)\r\n \"text html\": true,\r\n\r\n // Evaluate text as a json expression\r\n \"text json\": jQuery.parseJSON,\r\n\r\n // Parse text as xml\r\n \"text xml\": jQuery.parseXML\r\n },\r\n\r\n // For options that shouldn't be deep extended:\r\n // you can add your own custom options here if\r\n // and when you create one that shouldn't be\r\n // deep extended (see ajaxExtend)\r\n flatOptions: {\r\n url: true,\r\n context: true\r\n }\r\n },\r\n\r\n // Creates a full fledged settings object into target\r\n // with both ajaxSettings and settings fields.\r\n // If target is omitted, writes into ajaxSettings.\r\n ajaxSetup: function (target, settings) {\r\n return settings ?\r\n\r\n // Building a settings object\r\n ajaxExtend(ajaxExtend(target, jQuery.ajaxSettings), settings) :\r\n\r\n // Extending ajaxSettings\r\n ajaxExtend(jQuery.ajaxSettings, target);\r\n },\r\n\r\n ajaxPrefilter: addToPrefiltersOrTransports(prefilters),\r\n ajaxTransport: addToPrefiltersOrTransports(transports),\r\n\r\n // Main method\r\n ajax: function (url, options) {\r\n\r\n // If url is an object, simulate pre-1.5 signature\r\n if (typeof url === \"object\") {\r\n options = url;\r\n url = undefined;\r\n }\r\n\r\n // Force options to be an object\r\n options = options || {};\r\n\r\n var // Cross-domain detection vars\r\n parts,\r\n // Loop variable\r\n i,\r\n // URL without anti-cache param\r\n cacheURL,\r\n // Response headers as string\r\n responseHeadersString,\r\n // timeout handle\r\n timeoutTimer,\r\n\r\n // To know if global events are to be dispatched\r\n fireGlobals,\r\n\r\n transport,\r\n // Response headers\r\n responseHeaders,\r\n // Create the final options object\r\n s = jQuery.ajaxSetup({}, options),\r\n // Callbacks context\r\n callbackContext = s.context || s,\r\n // Context for global events is callbackContext if it is a DOM node or jQuery collection\r\n globalEventContext = s.context && ( callbackContext.nodeType || callbackContext.jquery ) ?\r\n jQuery(callbackContext) :\r\n jQuery.event,\r\n // Deferreds\r\n deferred = jQuery.Deferred(),\r\n completeDeferred = jQuery.Callbacks(\"once memory\"),\r\n // Status-dependent callbacks\r\n statusCode = s.statusCode || {},\r\n // Headers (they are sent all at once)\r\n requestHeaders = {},\r\n requestHeadersNames = {},\r\n // The jqXHR state\r\n state = 0,\r\n // Default abort message\r\n strAbort = \"canceled\",\r\n // Fake xhr\r\n jqXHR = {\r\n readyState: 0,\r\n\r\n // Builds headers hashtable if needed\r\n getResponseHeader: function (key) {\r\n var match;\r\n if (state === 2) {\r\n if (!responseHeaders) {\r\n responseHeaders = {};\r\n while ((match = rheaders.exec(responseHeadersString))) {\r\n responseHeaders[match[1].toLowerCase()] = match[2];\r\n }\r\n }\r\n match = responseHeaders[key.toLowerCase()];\r\n }\r\n return match == null ? null : match;\r\n },\r\n\r\n // Raw string\r\n getAllResponseHeaders: function () {\r\n return state === 2 ? responseHeadersString : null;\r\n },\r\n\r\n // Caches the header\r\n setRequestHeader: function (name, value) {\r\n var lname = name.toLowerCase();\r\n if (!state) {\r\n name = requestHeadersNames[lname] = requestHeadersNames[lname] || name;\r\n requestHeaders[name] = value;\r\n }\r\n return this;\r\n },\r\n\r\n // Overrides response content-type header\r\n overrideMimeType: function (type) {\r\n if (!state) {\r\n s.mimeType = type;\r\n }\r\n return this;\r\n },\r\n\r\n // Status-dependent callbacks\r\n statusCode: function (map) {\r\n var code;\r\n if (map) {\r\n if (state < 2) {\r\n for (code in map) {\r\n // Lazy-add the new callback in a way that preserves old ones\r\n statusCode[code] = [statusCode[code], map[code]];\r\n }\r\n } else {\r\n // Execute the appropriate callbacks\r\n jqXHR.always(map[jqXHR.status]);\r\n }\r\n }\r\n return this;\r\n },\r\n\r\n // Cancel the request\r\n abort: function (statusText) {\r\n var finalText = statusText || strAbort;\r\n if (transport) {\r\n transport.abort(finalText);\r\n }\r\n done(0, finalText);\r\n return this;\r\n }\r\n };\r\n\r\n // Attach deferreds\r\n deferred.promise(jqXHR).complete = completeDeferred.add;\r\n jqXHR.success = jqXHR.done;\r\n jqXHR.error = jqXHR.fail;\r\n\r\n // Remove hash character (#7531: and string promotion)\r\n // Add protocol if not provided (#5866: IE7 issue with protocol-less urls)\r\n // Handle falsy url in the settings object (#10093: consistency with old signature)\r\n // We also use the url parameter if available\r\n s.url = ( ( url || s.url || ajaxLocation ) + \"\" ).replace(rhash, \"\").replace(rprotocol, ajaxLocParts[1] + \"//\");\r\n\r\n // Alias method option to type as per ticket #12004\r\n s.type = options.method || options.type || s.method || s.type;\r\n\r\n // Extract dataTypes list\r\n s.dataTypes = jQuery.trim(s.dataType || \"*\").toLowerCase().match(rnotwhite) || [\"\"];\r\n\r\n // A cross-domain request is in order when we have a protocol:host:port mismatch\r\n if (s.crossDomain == null) {\r\n parts = rurl.exec(s.url.toLowerCase());\r\n s.crossDomain = !!( parts &&\r\n ( parts[1] !== ajaxLocParts[1] || parts[2] !== ajaxLocParts[2] ||\r\n ( parts[3] || ( parts[1] === \"http:\" ? \"80\" : \"443\" ) ) !==\r\n ( ajaxLocParts[3] || ( ajaxLocParts[1] === \"http:\" ? \"80\" : \"443\" ) ) )\r\n );\r\n }\r\n\r\n // Convert data if not already a string\r\n if (s.data && s.processData && typeof s.data !== \"string\") {\r\n s.data = jQuery.param(s.data, s.traditional);\r\n }\r\n\r\n // Apply prefilters\r\n inspectPrefiltersOrTransports(prefilters, s, options, jqXHR);\r\n\r\n // If request was aborted inside a prefilter, stop there\r\n if (state === 2) {\r\n return jqXHR;\r\n }\r\n\r\n // We can fire global events as of now if asked to\r\n fireGlobals = s.global;\r\n\r\n // Watch for a new set of requests\r\n if (fireGlobals && jQuery.active++ === 0) {\r\n jQuery.event.trigger(\"ajaxStart\");\r\n }\r\n\r\n // Uppercase the type\r\n s.type = s.type.toUpperCase();\r\n\r\n // Determine if request has content\r\n s.hasContent = !rnoContent.test(s.type);\r\n\r\n // Save the URL in case we're toying with the If-Modified-Since\r\n // and/or If-None-Match header later on\r\n cacheURL = s.url;\r\n\r\n // More options handling for requests with no content\r\n if (!s.hasContent) {\r\n\r\n // If data is available, append data to url\r\n if (s.data) {\r\n cacheURL = ( s.url += ( rquery.test(cacheURL) ? \"&\" : \"?\" ) + s.data );\r\n // #9682: remove data so that it's not used in an eventual retry\r\n delete s.data;\r\n }\r\n\r\n // Add anti-cache in url if needed\r\n if (s.cache === false) {\r\n s.url = rts.test(cacheURL) ?\r\n\r\n // If there is already a '_' parameter, set its value\r\n cacheURL.replace(rts, \"$1_=\" + nonce++) :\r\n\r\n // Otherwise add one to the end\r\n cacheURL + ( rquery.test(cacheURL) ? \"&\" : \"?\" ) + \"_=\" + nonce++;\r\n }\r\n }\r\n\r\n // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\r\n if (s.ifModified) {\r\n if (jQuery.lastModified[cacheURL]) {\r\n jqXHR.setRequestHeader(\"If-Modified-Since\", jQuery.lastModified[cacheURL]);\r\n }\r\n if (jQuery.etag[cacheURL]) {\r\n jqXHR.setRequestHeader(\"If-None-Match\", jQuery.etag[cacheURL]);\r\n }\r\n }\r\n\r\n // Set the correct header, if data is being sent\r\n if (s.data && s.hasContent && s.contentType !== false || options.contentType) {\r\n jqXHR.setRequestHeader(\"Content-Type\", s.contentType);\r\n }\r\n\r\n // Set the Accepts header for the server, depending on the dataType\r\n // jqXHR.setRequestHeader(\r\n // \"Accept\",\r\n // s.dataTypes[0] && s.accepts[s.dataTypes[0]] ?\r\n // s.accepts[s.dataTypes[0]] + ( s.dataTypes[0] !== \"*\" ? \", \" + allTypes + \"; q=0.01\" : \"\" ) :\r\n // s.accepts[\"*\"]\r\n // );\r\n\r\n // Check for headers option\r\n for (i in s.headers) {\r\n jqXHR.setRequestHeader(i, s.headers[i]);\r\n }\r\n\r\n // Allow custom headers/mimetypes and early abort\r\n if (s.beforeSend && ( s.beforeSend.call(callbackContext, jqXHR, s) === false || state === 2 )) {\r\n // Abort if not done already and return\r\n return jqXHR.abort();\r\n }\r\n\r\n // aborting is no longer a cancellation\r\n strAbort = \"abort\";\r\n\r\n // Install callbacks on deferreds\r\n for (i in {success: 1, error: 1, complete: 1}) {\r\n jqXHR[i](s[i]);\r\n }\r\n\r\n // Get transport\r\n transport = inspectPrefiltersOrTransports(transports, s, options, jqXHR);\r\n\r\n // If no transport, we auto-abort\r\n if (!transport) {\r\n done(-1, \"No Transport\");\r\n } else {\r\n jqXHR.readyState = 1;\r\n\r\n // Send global event\r\n if (fireGlobals) {\r\n globalEventContext.trigger(\"ajaxSend\", [jqXHR, s]);\r\n }\r\n // Timeout\r\n if (s.async && s.timeout > 0) {\r\n timeoutTimer = setTimeout(function () {\r\n jqXHR.abort(\"timeout\");\r\n }, s.timeout);\r\n }\r\n\r\n try {\r\n state = 1;\r\n transport.send(requestHeaders, done);\r\n } catch (e) {\r\n // Propagate exception as error if not done\r\n if (state < 2) {\r\n done(-1, e);\r\n // Simply rethrow otherwise\r\n } else {\r\n throw e;\r\n }\r\n }\r\n }\r\n\r\n // Callback for when everything is done\r\n function done(status, nativeStatusText, responses, headers) {\r\n var isSuccess, success, error, response, modified,\r\n statusText = nativeStatusText;\r\n\r\n // Called once\r\n if (state === 2) {\r\n return;\r\n }\r\n\r\n // State is \"done\" now\r\n state = 2;\r\n\r\n // Clear timeout if it exists\r\n if (timeoutTimer) {\r\n clearTimeout(timeoutTimer);\r\n }\r\n\r\n // Dereference transport for early garbage collection\r\n // (no matter how long the jqXHR object will be used)\r\n transport = undefined;\r\n\r\n // Cache response headers\r\n responseHeadersString = headers || \"\";\r\n\r\n // Set readyState\r\n jqXHR.readyState = status > 0 ? 4 : 0;\r\n\r\n // Determine if successful\r\n isSuccess = status >= 200 && status < 300 || status === 304;\r\n\r\n // Get response data\r\n if (responses) {\r\n response = ajaxHandleResponses(s, jqXHR, responses);\r\n }\r\n\r\n // Convert no matter what (that way responseXXX fields are always set)\r\n response = ajaxConvert(s, response, jqXHR, isSuccess);\r\n\r\n // If successful, handle type chaining\r\n if (isSuccess) {\r\n\r\n // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.\r\n if (s.ifModified) {\r\n modified = jqXHR.getResponseHeader(\"Last-Modified\");\r\n if (modified) {\r\n jQuery.lastModified[cacheURL] = modified;\r\n }\r\n modified = jqXHR.getResponseHeader(\"etag\");\r\n if (modified) {\r\n jQuery.etag[cacheURL] = modified;\r\n }\r\n }\r\n\r\n // if no content\r\n if (status === 204 || s.type === \"HEAD\") {\r\n statusText = \"nocontent\";\r\n\r\n // if not modified\r\n } else if (status === 304) {\r\n statusText = \"notmodified\";\r\n\r\n // If we have data, let's convert it\r\n } else {\r\n statusText = response.state;\r\n success = response.data;\r\n error = response.error;\r\n isSuccess = !error;\r\n }\r\n } else {\r\n // We extract error from statusText\r\n // then normalize statusText and status for non-aborts\r\n error = statusText;\r\n if (status || !statusText) {\r\n statusText = \"error\";\r\n if (status < 0) {\r\n status = 0;\r\n }\r\n }\r\n }\r\n\r\n // Set data for the fake xhr object\r\n jqXHR.status = status;\r\n jqXHR.statusText = ( nativeStatusText || statusText ) + \"\";\r\n\r\n // Success/Error\r\n if (isSuccess) {\r\n deferred.resolveWith(callbackContext, [success, statusText, jqXHR]);\r\n } else {\r\n deferred.rejectWith(callbackContext, [jqXHR, statusText, error]);\r\n }\r\n\r\n // Status-dependent callbacks\r\n jqXHR.statusCode(statusCode);\r\n statusCode = undefined;\r\n\r\n if (fireGlobals) {\r\n globalEventContext.trigger(isSuccess ? \"ajaxSuccess\" : \"ajaxError\",\r\n [jqXHR, s, isSuccess ? success : error]);\r\n }\r\n\r\n // Complete\r\n completeDeferred.fireWith(callbackContext, [jqXHR, statusText]);\r\n\r\n if (fireGlobals) {\r\n globalEventContext.trigger(\"ajaxComplete\", [jqXHR, s]);\r\n // Handle the global AJAX counter\r\n if (!( --jQuery.active )) {\r\n jQuery.event.trigger(\"ajaxStop\");\r\n }\r\n }\r\n }\r\n\r\n return jqXHR;\r\n },\r\n\r\n getJSON: function (url, data, callback) {\r\n return jQuery.get(url, data, callback, \"json\");\r\n },\r\n\r\n getScript: function (url, callback) {\r\n return jQuery.get(url, undefined, callback, \"script\");\r\n }\r\n });\r\n\r\n jQuery.each([\"get\", \"post\"], function (i, method) {\r\n jQuery[method] = function (url, data, callback, type) {\r\n // shift arguments if data argument was omitted\r\n if (jQuery.isFunction(data)) {\r\n type = type || callback;\r\n callback = data;\r\n data = undefined;\r\n }\r\n\r\n return jQuery.ajax({\r\n url: url,\r\n type: method,\r\n dataType: type,\r\n data: data,\r\n success: callback\r\n });\r\n };\r\n });\r\n\r\n// Attach a bunch of functions for handling common AJAX events\r\n jQuery.each([\"ajaxStart\", \"ajaxStop\", \"ajaxComplete\", \"ajaxError\", \"ajaxSuccess\", \"ajaxSend\"], function (i, type) {\r\n jQuery.fn[type] = function (fn) {\r\n return this.on(type, fn);\r\n };\r\n });\r\n\r\n\r\n jQuery._evalUrl = function (url) {\r\n return jQuery.ajax({\r\n url: url,\r\n type: \"GET\",\r\n dataType: \"script\",\r\n async: false,\r\n global: false,\r\n \"throws\": true\r\n });\r\n };\r\n\r\n\r\n var r20 = /%20/g,\r\n rbracket = /\\[\\]$/,\r\n rCRLF = /\\r?\\n/g,\r\n rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,\r\n rsubmittable = /^(?:input|select|textarea|keygen)/i;\r\n\r\n function buildParams(prefix, obj, traditional, add) {\r\n var name;\r\n\r\n if (jQuery.isArray(obj)) {\r\n // Serialize array item.\r\n jQuery.each(obj, function (i, v) {\r\n if (traditional || rbracket.test(prefix)) {\r\n // Treat each array item as a scalar.\r\n add(prefix, v);\r\n\r\n } else {\r\n // Item is non-scalar (array or object), encode its numeric index.\r\n buildParams(prefix + \"[\" + ( typeof v === \"object\" ? i : \"\" ) + \"]\", v, traditional, add);\r\n }\r\n });\r\n\r\n } else if (!traditional && jQuery.type(obj) === \"object\") {\r\n // Serialize object item.\r\n for (name in obj) {\r\n buildParams(prefix + \"[\" + name + \"]\", obj[name], traditional, add);\r\n }\r\n\r\n } else {\r\n // Serialize scalar item.\r\n add(prefix, obj);\r\n }\r\n }\r\n\r\n// Serialize an array of form elements or a set of\r\n// key/values into a query string\r\n jQuery.param = function (a, traditional) {\r\n var prefix,\r\n s = [],\r\n add = function (key, value) {\r\n // If value is a function, invoke it and return its value\r\n value = jQuery.isFunction(value) ? value() : ( value == null ? \"\" : value );\r\n s[s.length] = encodeURIComponent(key) + \"=\" + encodeURIComponent(value);\r\n };\r\n\r\n // Set traditional to true for jQuery <= 1.3.2 behavior.\r\n if (traditional === undefined) {\r\n traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;\r\n }\r\n\r\n // If an array was passed in, assume that it is an array of form elements.\r\n if (jQuery.isArray(a) || ( a.jquery && !jQuery.isPlainObject(a) )) {\r\n // Serialize the form elements\r\n jQuery.each(a, function () {\r\n add(this.name, this.value);\r\n });\r\n\r\n } else {\r\n // If traditional, encode the \"old\" way (the way 1.3.2 or older\r\n // did it), otherwise encode params recursively.\r\n for (prefix in a) {\r\n buildParams(prefix, a[prefix], traditional, add);\r\n }\r\n }\r\n\r\n // Return the resulting serialization\r\n return s.join(\"&\").replace(r20, \"+\");\r\n };\r\n\r\n jQuery.fn.extend({\r\n serialize: function () {\r\n return jQuery.param(this.serializeArray());\r\n },\r\n serializeArray: function () {\r\n return this.map(function () {\r\n // Can add propHook for \"elements\" to filter or add form elements\r\n var elements = jQuery.prop(this, \"elements\");\r\n return elements ? jQuery.makeArray(elements) : this;\r\n })\r\n .filter(function () {\r\n var type = this.type;\r\n // Use .is(\":disabled\") so that fieldset[disabled] works\r\n return this.name && !jQuery(this).is(\":disabled\") &&\r\n rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) &&\r\n ( this.checked || !rcheckableType.test(type) );\r\n })\r\n .map(function (i, elem) {\r\n var val = jQuery(this).val();\r\n\r\n return val == null ?\r\n null :\r\n jQuery.isArray(val) ?\r\n jQuery.map(val, function (val) {\r\n return {name: elem.name, value: val.replace(rCRLF, \"\\r\\n\")};\r\n }) :\r\n {name: elem.name, value: val.replace(rCRLF, \"\\r\\n\")};\r\n }).get();\r\n }\r\n });\r\n\r\n\r\n// Create the request object\r\n// (This is still attached to ajaxSettings for backward compatibility)\r\n jQuery.ajaxSettings.xhr = window.ActiveXObject !== undefined ?\r\n // Support: IE6+\r\n function () {\r\n\r\n // XHR cannot access local files, always use ActiveX for that case\r\n return !this.isLocal &&\r\n\r\n // Support: IE7-8\r\n // oldIE XHR does not support non-RFC2616 methods (#13240)\r\n // See http://msdn.microsoft.com/en-us/library/ie/ms536648(v=vs.85).aspx\r\n // and http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9\r\n // Although this check for six methods instead of eight\r\n // since IE also does not support \"trace\" and \"connect\"\r\n /^(get|post|head|put|delete|options)$/i.test(this.type) &&\r\n\r\n createStandardXHR() || createActiveXHR();\r\n } :\r\n // For all other browsers, use the standard XMLHttpRequest object\r\n createStandardXHR;\r\n\r\n var xhrId = 0,\r\n xhrCallbacks = {},\r\n xhrSupported = jQuery.ajaxSettings.xhr();\r\n\r\n// Support: IE<10\r\n// Open requests must be manually aborted on unload (#5280)\r\n if (window.ActiveXObject) {\r\n jQuery(window).on(\"unload\", function () {\r\n for (var key in xhrCallbacks) {\r\n xhrCallbacks[key](undefined, true);\r\n }\r\n });\r\n }\r\n\r\n// Determine support properties\r\n support.cors = !!xhrSupported && ( \"withCredentials\" in xhrSupported );\r\n xhrSupported = support.ajax = !!xhrSupported;\r\n\r\n// Create transport if the browser can provide an xhr\r\n if (xhrSupported) {\r\n\r\n jQuery.ajaxTransport(function (options) {\r\n // Cross domain only allowed if supported through XMLHttpRequest\r\n if (!options.crossDomain || support.cors) {\r\n\r\n var callback;\r\n\r\n return {\r\n send: function (headers, complete) {\r\n var i,\r\n xhr = options.xhr(),\r\n id = ++xhrId;\r\n\r\n // Open the socket\r\n xhr.open(options.type, options.url, options.async, options.username, options.password);\r\n\r\n // Apply custom fields if provided\r\n if (options.xhrFields) {\r\n for (i in options.xhrFields) {\r\n xhr[i] = options.xhrFields[i];\r\n }\r\n }\r\n\r\n // Override mime type if needed\r\n if (options.mimeType && xhr.overrideMimeType) {\r\n xhr.overrideMimeType(options.mimeType);\r\n }\r\n\r\n // X-Requested-With header\r\n // For cross-domain requests, seeing as conditions for a preflight are\r\n // akin to a jigsaw puzzle, we simply never set it to be sure.\r\n // (it can always be set on a per-request basis or even using ajaxSetup)\r\n // For same-domain requests, won't change header if already provided.\r\n if (!options.crossDomain && !headers[\"X-Requested-With\"]) {\r\n headers[\"X-Requested-With\"] = \"XMLHttpRequest\";\r\n }\r\n\r\n // Set headers\r\n for (i in headers) {\r\n // Support: IE<9\r\n // IE's ActiveXObject throws a 'Type Mismatch' exception when setting\r\n // request header to a null-value.\r\n //\r\n // To keep consistent with other XHR implementations, cast the value\r\n // to string and ignore `undefined`.\r\n if (headers[i] !== undefined) {\r\n xhr.setRequestHeader(i, headers[i] + \"\");\r\n }\r\n }\r\n\r\n if (xhr.upload && options.progress) {\r\n xhr.upload.onprogress = options.progress;\r\n }\r\n\r\n // Do send the request\r\n // This may raise an exception which is actually\r\n // handled in jQuery.ajax (so no try/catch here)\r\n xhr.send(( options.hasContent && (options.body || options.data)) || null);\r\n\r\n // Listener\r\n callback = function (_, isAbort) {\r\n var status, statusText, responses;\r\n\r\n // Was never called and is aborted or complete\r\n if (callback && ( isAbort || xhr.readyState === 4 )) {\r\n // Clean up\r\n delete xhrCallbacks[id];\r\n callback = undefined;\r\n xhr.onreadystatechange = jQuery.noop;\r\n\r\n // Abort manually if needed\r\n if (isAbort) {\r\n if (xhr.readyState !== 4) {\r\n xhr.abort();\r\n }\r\n } else {\r\n responses = {};\r\n status = xhr.status;\r\n\r\n // Support: IE<10\r\n // Accessing binary-data responseText throws an exception\r\n // (#11426)\r\n if (typeof xhr.responseText === \"string\") {\r\n responses.text = xhr.responseText;\r\n }\r\n\r\n // Firefox throws an exception when accessing\r\n // statusText for faulty cross-domain requests\r\n try {\r\n statusText = xhr.statusText;\r\n } catch (e) {\r\n // We normalize with Webkit giving an empty statusText\r\n statusText = \"\";\r\n }\r\n\r\n // Filter status for non standard behaviors\r\n\r\n // If the request is local and we have data: assume a success\r\n // (success with no data won't get notified, that's the best we\r\n // can do given current implementations)\r\n if (!status && options.isLocal && !options.crossDomain) {\r\n status = responses.text ? 200 : 404;\r\n // IE - #1450: sometimes returns 1223 when it should be 204\r\n } else if (status === 1223) {\r\n status = 204;\r\n }\r\n }\r\n }\r\n\r\n // Call complete if needed\r\n if (responses) {\r\n complete(status, statusText, responses, xhr.getAllResponseHeaders());\r\n }\r\n };\r\n\r\n if (!options.async) {\r\n // if we're in sync mode we fire the callback\r\n callback();\r\n } else if (xhr.readyState === 4) {\r\n // (IE6 & IE7) if it's in cache and has been\r\n // retrieved directly we need to fire the callback\r\n setTimeout(callback);\r\n } else {\r\n // Add to the list of active xhr callbacks\r\n xhr.onreadystatechange = xhrCallbacks[id] = callback;\r\n }\r\n },\r\n\r\n abort: function () {\r\n if (callback) {\r\n callback(undefined, true);\r\n }\r\n }\r\n };\r\n }\r\n });\r\n }\r\n\r\n// Functions to create xhrs\r\n function createStandardXHR() {\r\n try {\r\n return new window.XMLHttpRequest();\r\n } catch (e) {\r\n }\r\n }\r\n\r\n function createActiveXHR() {\r\n try {\r\n return new window.ActiveXObject(\"Microsoft.XMLHTTP\");\r\n } catch (e) {\r\n }\r\n }\r\n\r\n\r\n// Install script dataType\r\n jQuery.ajaxSetup({\r\n accepts: {\r\n script: \"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript\"\r\n },\r\n contents: {\r\n script: /(?:java|ecma)script/\r\n },\r\n converters: {\r\n \"text script\": function (text) {\r\n jQuery.globalEval(text);\r\n return text;\r\n }\r\n }\r\n });\r\n\r\n// Handle cache's special case and global\r\n jQuery.ajaxPrefilter(\"script\", function (s) {\r\n if (s.cache === undefined) {\r\n s.cache = false;\r\n }\r\n if (s.crossDomain) {\r\n s.type = \"GET\";\r\n s.global = false;\r\n }\r\n });\r\n\r\n// Bind script tag hack transport\r\n jQuery.ajaxTransport(\"script\", function (s) {\r\n\r\n // This transport only deals with cross domain requests\r\n if (s.crossDomain) {\r\n\r\n var script,\r\n head = document.head || jQuery(\"head\")[0] || document.documentElement;\r\n\r\n return {\r\n\r\n send: function (_, callback) {\r\n\r\n script = document.createElement(\"script\");\r\n\r\n script.async = true;\r\n\r\n if (s.scriptCharset) {\r\n script.charset = s.scriptCharset;\r\n }\r\n\r\n script.src = s.url;\r\n\r\n // Attach handlers for all browsers\r\n script.onload = script.onreadystatechange = function (_, isAbort) {\r\n\r\n if (isAbort || !script.readyState || /loaded|complete/.test(script.readyState)) {\r\n\r\n // Handle memory leak in IE\r\n script.onload = script.onreadystatechange = null;\r\n\r\n // Remove the script\r\n if (script.parentNode) {\r\n script.parentNode.removeChild(script);\r\n }\r\n\r\n // Dereference the script\r\n script = null;\r\n\r\n // Callback if not abort\r\n if (!isAbort) {\r\n callback(200, \"success\");\r\n }\r\n }\r\n };\r\n\r\n // Circumvent IE6 bugs with base elements (#2709 and #4378) by prepending\r\n // Use native DOM manipulation to avoid our domManip AJAX trickery\r\n head.insertBefore(script, head.firstChild);\r\n },\r\n\r\n abort: function () {\r\n if (script) {\r\n script.onload(undefined, true);\r\n }\r\n }\r\n };\r\n }\r\n });\r\n\r\n\r\n var oldCallbacks = [],\r\n rjsonp = /(=)\\?(?=&|$)|\\?\\?/;\r\n\r\n// Default jsonp settings\r\n jQuery.ajaxSetup({\r\n jsonp: \"callback\",\r\n jsonpCallback: function () {\r\n var callback = oldCallbacks.pop() || ( jQuery.expando + \"_\" + ( nonce++ ) );\r\n this[callback] = true;\r\n return callback;\r\n }\r\n });\r\n\r\n// Detect, normalize options and install callbacks for jsonp requests\r\n jQuery.ajaxPrefilter(\"json jsonp\", function (s, originalSettings, jqXHR) {\r\n\r\n var callbackName, overwritten, responseContainer,\r\n jsonProp = s.jsonp !== false && ( rjsonp.test(s.url) ?\r\n \"url\" :\r\n typeof s.data === \"string\" && !( s.contentType || \"\" ).indexOf(\"application/x-www-form-urlencoded\") && rjsonp.test(s.data) && \"data\"\r\n );\r\n\r\n // Handle iff the expected data type is \"jsonp\" or we have a parameter to set\r\n if (jsonProp || s.dataTypes[0] === \"jsonp\") {\r\n\r\n // Get callback name, remembering preexisting value associated with it\r\n callbackName = s.jsonpCallback = jQuery.isFunction(s.jsonpCallback) ?\r\n s.jsonpCallback() :\r\n s.jsonpCallback;\r\n\r\n // Insert callback into url or form data\r\n if (jsonProp) {\r\n s[jsonProp] = s[jsonProp].replace(rjsonp, \"$1\" + callbackName);\r\n } else if (s.jsonp !== false) {\r\n s.url += ( rquery.test(s.url) ? \"&\" : \"?\" ) + s.jsonp + \"=\" + callbackName;\r\n }\r\n\r\n // Use data converter to retrieve json after script execution\r\n s.converters[\"script json\"] = function () {\r\n if (!responseContainer) {\r\n jQuery.error(callbackName + \" was not called\");\r\n }\r\n return responseContainer[0];\r\n };\r\n\r\n // force json dataType\r\n s.dataTypes[0] = \"json\";\r\n\r\n // Install callback\r\n overwritten = window[callbackName];\r\n window[callbackName] = function () {\r\n responseContainer = arguments;\r\n };\r\n\r\n // Clean-up function (fires after converters)\r\n jqXHR.always(function () {\r\n // Restore preexisting value\r\n window[callbackName] = overwritten;\r\n\r\n // Save back as free\r\n if (s[callbackName]) {\r\n // make sure that re-using the options doesn't screw things around\r\n s.jsonpCallback = originalSettings.jsonpCallback;\r\n\r\n // save the callback name for future use\r\n oldCallbacks.push(callbackName);\r\n }\r\n\r\n // Call if it was a function and we have a response\r\n if (responseContainer && jQuery.isFunction(overwritten)) {\r\n overwritten(responseContainer[0]);\r\n }\r\n\r\n responseContainer = overwritten = undefined;\r\n });\r\n\r\n // Delegate to script\r\n return \"script\";\r\n }\r\n });\r\n\r\n// data: string of html\r\n// context (optional): If specified, the fragment will be created in this context, defaults to document\r\n// keepScripts (optional): If true, will include scripts passed in the html string\r\n jQuery.parseHTML = function (data, context, keepScripts) {\r\n if (!data || typeof data !== \"string\") {\r\n return null;\r\n }\r\n if (typeof context === \"boolean\") {\r\n keepScripts = context;\r\n context = false;\r\n }\r\n context = context || document;\r\n\r\n var parsed = rsingleTag.exec(data),\r\n scripts = !keepScripts && [];\r\n\r\n // Single tag\r\n if (parsed) {\r\n return [context.createElement(parsed[1])];\r\n }\r\n\r\n parsed = jQuery.buildFragment([data], context, scripts);\r\n\r\n if (scripts && scripts.length) {\r\n jQuery(scripts).remove();\r\n }\r\n\r\n return jQuery.merge([], parsed.childNodes);\r\n };\r\n\r\n return jQuery;\r\n\r\n})();\r\n\r\nvar stringifyPrimitive = function(v) {\r\n switch (typeof v) {\r\n case 'string':\r\n return v;\r\n case 'boolean':\r\n return v ? 'true' : 'false';\r\n case 'number':\r\n return isFinite(v) ? v : '';\r\n default:\r\n return '';\r\n }\r\n};\r\n\r\nvar queryStringify = function(obj, sep, eq, name) {\r\n sep = sep || '&';\r\n eq = eq || '=';\r\n if (obj === null) {\r\n obj = undefined;\r\n }\r\n if (typeof obj === 'object') {\r\n return Object.keys(obj).map(function(k) {\r\n var ks = encodeURIComponent(stringifyPrimitive(k)) + eq;\r\n if (Array.isArray(obj[k])) {\r\n return obj[k].map(function(v) {\r\n return ks + encodeURIComponent(stringifyPrimitive(v));\r\n }).join(sep);\r\n } else {\r\n return ks + encodeURIComponent(stringifyPrimitive(obj[k]));\r\n }\r\n }).filter(Boolean).join(sep);\r\n\r\n }\r\n if (!name) return '';\r\n return encodeURIComponent(stringifyPrimitive(name)) + eq +\r\n encodeURIComponent(stringifyPrimitive(obj));\r\n};\r\n\r\nvar request = function (options, callback) {\r\n\r\n options = $.extend(true, {headers: {}, qs: {}}, options);\r\n\r\n // method\r\n options.type = options.method;\r\n delete options.method;\r\n\r\n // progress\r\n if (options.onProgress) {\r\n options.progress = options.onProgress;\r\n delete options.onProgress;\r\n }\r\n\r\n // qs\r\n if (options.qs) {\r\n var qsStr = queryStringify(options.qs);\r\n if (qsStr) {\r\n options.url += (options.url.indexOf('?') === -1 ? '?' : '&') + qsStr;\r\n }\r\n delete options.qs;\r\n }\r\n\r\n // json\r\n if (options.json) {\r\n options.data = options.body;\r\n delete options.json;\r\n delete options.body;\r\n !options.headers && (options.headers = {});\r\n options.headers['Content-Type'] = 'application/json';\r\n }\r\n\r\n // body\r\n if (options.body) {\r\n if (!(options.body instanceof Blob || options.body.toString() === '[object File]' || options.body.toString() === '[object Blob]')) {\r\n options.data = options.body;\r\n delete options.body;\r\n }\r\n }\r\n\r\n // headers\r\n if (options.headers) {\r\n var headers = options.headers;\r\n delete options.headers;\r\n options.beforeSend = function (xhr) {\r\n for (var key in headers) {\r\n if (headers.hasOwnProperty(key) &&\r\n key.toLowerCase() !== 'content-length' &&\r\n key.toLowerCase() !== 'user-agent' &&\r\n key.toLowerCase() !== 'origin' &&\r\n key.toLowerCase() !== 'host') {\r\n xhr.setRequestHeader(key, headers[key]);\r\n }\r\n }\r\n };\r\n }\r\n\r\n var getResponse = function (xhr) {\r\n var headers = {};\r\n xhr.getAllResponseHeaders().trim().split('\\n').forEach(function (item) {\r\n if (item) {\r\n var index = item.indexOf(':');\r\n var key = item.substr(0, index).trim().toLowerCase();\r\n var val = item.substr(index + 1).trim();\r\n headers[key] = val;\r\n }\r\n });\r\n return {\r\n statusCode: xhr.status,\r\n statusMessage: xhr.statusText,\r\n headers: headers\r\n };\r\n };\r\n\r\n // callback\r\n options.success = function (data, state, xhr) {\r\n callback(null, getResponse(xhr), data);\r\n };\r\n options.error = function (xhr) {\r\n if (xhr.responseText) {\r\n callback(null, getResponse(xhr), xhr.responseText);\r\n } else {\r\n callback(xhr.statusText, getResponse(xhr), xhr.responseText);\r\n }\r\n };\r\n\r\n options.dataType = 'text';\r\n\r\n // send\r\n return $.ajax(options);\r\n\r\n};\r\n\r\nmodule.exports = request;\r\n","'use strict';\n\nvar utils = require('./../utils');\nvar settle = require('./../core/settle');\nvar buildURL = require('./../helpers/buildURL');\nvar parseHeaders = require('./../helpers/parseHeaders');\nvar isURLSameOrigin = require('./../helpers/isURLSameOrigin');\nvar createError = require('../core/createError');\n\nmodule.exports = function xhrAdapter(config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n var requestData = config.data;\n var requestHeaders = config.headers;\n\n if (utils.isFormData(requestData)) {\n delete requestHeaders['Content-Type']; // Let the browser set it\n }\n\n var request = new XMLHttpRequest();\n\n // HTTP basic authentication\n if (config.auth) {\n var username = config.auth.username || '';\n var password = config.auth.password || '';\n requestHeaders.Authorization = 'Basic ' + btoa(username + ':' + password);\n }\n\n request.open(config.method.toUpperCase(), buildURL(config.url, config.params, config.paramsSerializer), true);\n\n // Set the request timeout in MS\n request.timeout = config.timeout;\n\n // Listen for ready state\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n\n // Prepare the response\n var responseHeaders = 'getAllResponseHeaders' in request ? parseHeaders(request.getAllResponseHeaders()) : null;\n var responseData = !config.responseType || config.responseType === 'text' ? request.responseText : request.response;\n var response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config: config,\n request: request\n };\n\n settle(resolve, reject, response);\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(createError('Network Error', config, null, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n reject(createError('timeout of ' + config.timeout + 'ms exceeded', config, 'ECONNABORTED',\n request));\n\n // Clean up request\n request = null;\n };\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n if (utils.isStandardBrowserEnv()) {\n var cookies = require('./../helpers/cookies');\n\n // Add xsrf header\n var xsrfValue = (config.withCredentials || isURLSameOrigin(config.url)) && config.xsrfCookieName ?\n cookies.read(config.xsrfCookieName) :\n undefined;\n\n if (xsrfValue) {\n requestHeaders[config.xsrfHeaderName] = xsrfValue;\n }\n }\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders, function setRequestHeader(val, key) {\n if (typeof requestData === 'undefined' && key.toLowerCase() === 'content-type') {\n // Remove Content-Type if data is undefined\n delete requestHeaders[key];\n } else {\n // Otherwise add header to the request\n request.setRequestHeader(key, val);\n }\n });\n }\n\n // Add withCredentials to request if needed\n if (config.withCredentials) {\n request.withCredentials = true;\n }\n\n // Add responseType to request if needed\n if (config.responseType) {\n try {\n request.responseType = config.responseType;\n } catch (e) {\n // Expected DOMException thrown by browsers not compatible XMLHttpRequest Level 2.\n // But, this can be suppressed for 'json' type as it can be parsed by default 'transformResponse' function.\n if (config.responseType !== 'json') {\n throw e;\n }\n }\n }\n\n // Handle progress if needed\n if (typeof config.onDownloadProgress === 'function') {\n request.addEventListener('progress', config.onDownloadProgress);\n }\n\n // Not all browsers support upload events\n if (typeof config.onUploadProgress === 'function' && request.upload) {\n request.upload.addEventListener('progress', config.onUploadProgress);\n }\n\n if (config.cancelToken) {\n // Handle cancellation\n config.cancelToken.promise.then(function onCanceled(cancel) {\n if (!request) {\n return;\n }\n\n request.abort();\n reject(cancel);\n // Clean up request\n request = null;\n });\n }\n\n if (requestData === undefined) {\n requestData = null;\n }\n\n // Send the request\n request.send(requestData);\n });\n};\n","\"use strict\";\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.UploaderEvent = exports.vodAxios = void 0;\nvar sha1 = require(\"js-sha1\");\nvar COS = require(\"cos-js-sdk-v5\");\nvar events_1 = require(\"events\");\nvar axios_1 = require(\"axios\");\nvar util_1 = require(\"./util\");\nvar vod_reporter_1 = require(\"./vod_reporter\");\nvar uuidv4 = require(\"uuid/v4\");\nexports.vodAxios = axios_1.default.create();\nexports.vodAxios.interceptors.response.use(function (response) {\n return response;\n}, function (error) {\n if (isNaN(error.code)) {\n error.code = 500;\n }\n return Promise.reject(error);\n});\nvar UploaderEvent;\n(function (UploaderEvent) {\n UploaderEvent[\"video_progress\"] = \"video_progress\";\n UploaderEvent[\"media_progress\"] = \"media_progress\";\n UploaderEvent[\"video_upload\"] = \"video_upload\";\n UploaderEvent[\"media_upload\"] = \"media_upload\";\n UploaderEvent[\"cover_progress\"] = \"cover_progress\";\n UploaderEvent[\"cover_upload\"] = \"cover_upload\";\n})(UploaderEvent = exports.UploaderEvent || (exports.UploaderEvent = {}));\nvar Uploader = /** @class */ (function (_super) {\n __extends(Uploader, _super);\n function Uploader(params) {\n var _this = _super.call(this) || this;\n _this.sessionName = \"\";\n _this.vodSessionKey = \"\";\n _this.appId = 0;\n _this.reqKey = uuidv4();\n _this.reportId = \"\";\n // resume from break point\n _this.enableResume = true;\n // apply 请求的超时时间\n _this.applyRequestTimeout = 5000;\n _this.applyRequestRetryCount = 3;\n // commit 请求的超时时间\n _this.commitRequestTimeout = 5000;\n _this.commitRequestRetryCount = 3;\n // 重试请求的等待时间\n _this.retryDelay = 1000;\n _this.validateInitParams(params);\n _this.videoFile = params.mediaFile || params.videoFile;\n _this.getSignature = params.getSignature;\n _this.enableResume = params.enableResume;\n _this.videoName = params.mediaName || params.videoName;\n _this.coverFile = params.coverFile;\n _this.fileId = params.fileId;\n _this.applyRequestTimeout =\n params.applyRequestTimeout || _this.applyRequestTimeout;\n _this.commitRequestTimeout =\n params.commitRequestTimeout || _this.commitRequestTimeout;\n _this.retryDelay = params.retryDelay || _this.retryDelay;\n // custom report metrics\n _this.appId = params.appId || _this.appId;\n _this.reportId = params.reportId || _this.reportId;\n _this.cosAuthTime = 0;\n _this.genFileInfo();\n return _this;\n }\n // set storage\n Uploader.prototype.setStorage = function (name, value) {\n if (!name) {\n return;\n }\n var cname = \"webugc_\" + sha1(name);\n try {\n localStorage.setItem(cname, value);\n }\n catch (e) { }\n };\n // get storage\n Uploader.prototype.getStorage = function (name) {\n if (!name) {\n return;\n }\n var cname = \"webugc_\" + sha1(name);\n var result = null;\n try {\n result = localStorage.getItem(cname);\n }\n catch (e) { }\n return result;\n };\n // delete storage\n Uploader.prototype.delStorage = function (name) {\n if (!name) {\n return;\n }\n var cname = \"webugc_\" + sha1(name);\n try {\n localStorage.removeItem(cname);\n }\n catch (e) { }\n };\n // validate init params\n Uploader.prototype.validateInitParams = function (params) {\n if (!util_1.default.isFunction(params.getSignature)) {\n throw new Error(\"getSignature must be a function\");\n }\n if (params.videoFile && !util_1.default.isFile(params.videoFile)) {\n throw new Error(\"videoFile must be a File\");\n }\n };\n Uploader.prototype.genFileInfo = function () {\n // video file info\n var videoFile = this.videoFile;\n if (videoFile) {\n var lastDotIndex = videoFile.name.lastIndexOf(\".\");\n var videoName = \"\";\n // if specified, use it.\n if (this.videoName) {\n if (!util_1.default.isString(this.videoName)) {\n throw new Error(\"mediaName must be a string\");\n }\n else if (/[:*?<>\\\"\\\\/|]/g.test(this.videoName)) {\n throw new Error('Cant use these chars in filename: \\\\ / : * ? \" < > |');\n }\n else {\n videoName = this.videoName;\n }\n }\n else {\n // else use the meta info of file\n videoName = videoFile.name.substring(0, lastDotIndex);\n }\n this.videoInfo = {\n name: videoName,\n type: videoFile.name.substring(lastDotIndex + 1).toLowerCase(),\n size: videoFile.size\n };\n this.sessionName += videoFile.name + \"_\" + videoFile.size + \";\";\n }\n // cover file info\n var coverFile = this.coverFile;\n if (coverFile) {\n var coverName = coverFile.name;\n var coverLastDotIndex = coverName.lastIndexOf(\".\");\n this.coverInfo = {\n name: coverName.substring(0, coverLastDotIndex),\n type: coverName.substring(coverLastDotIndex + 1).toLowerCase(),\n size: coverFile.size\n };\n this.sessionName += coverFile.name + \"_\" + coverFile.size + \";\";\n }\n };\n Uploader.prototype.applyUploadUGC = function (retryCount) {\n if (retryCount === void 0) { retryCount = 0; }\n return __awaiter(this, void 0, void 0, function () {\n function whenError(err) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (err.code === 500) {\n Uploader.host = Uploader.host === util_1.HOST.MAIN ? util_1.HOST.BACKUP : util_1.HOST.MAIN;\n }\n self.emit(vod_reporter_1.VodReportEvent.report_apply, {\n err: err,\n requestStartTime: requestStartTime\n });\n self.delStorage(self.sessionName);\n if (self.applyRequestRetryCount == retryCount) {\n if (err) {\n throw err;\n }\n throw new Error(\"apply upload failed\");\n }\n return [4 /*yield*/, util_1.default.delay(self.retryDelay)];\n case 1:\n _a.sent();\n return [2 /*return*/, self.applyUploadUGC(retryCount + 1)];\n }\n });\n });\n }\n var self, signature, sendParams, videoInfo, coverInfo, vodSessionKey, requestStartTime, response, e_1, applyResult, applyData, vodSessionKey_1, err;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n self = this;\n return [4 /*yield*/, this.getSignature()];\n case 1:\n signature = _a.sent();\n videoInfo = this.videoInfo;\n coverInfo = this.coverInfo;\n vodSessionKey = this.vodSessionKey ||\n (this.enableResume && this.getStorage(this.sessionName));\n // resume from break point\n if (vodSessionKey) {\n sendParams = {\n signature: signature,\n vodSessionKey: vodSessionKey\n };\n }\n else if (videoInfo) {\n sendParams = {\n signature: signature,\n videoName: videoInfo.name,\n videoType: videoInfo.type,\n videoSize: videoInfo.size\n };\n if (coverInfo) {\n // upload video together with cover\n sendParams.coverName = coverInfo.name;\n sendParams.coverType = coverInfo.type;\n sendParams.coverSize = coverInfo.size;\n }\n }\n else if (this.fileId && coverInfo) {\n // alter cover\n sendParams = {\n signature: signature,\n fileId: this.fileId,\n coverName: coverInfo.name,\n coverType: coverInfo.type,\n coverSize: coverInfo.size\n };\n }\n else {\n throw \"Wrong params, please check and try again\";\n }\n requestStartTime = new Date();\n _a.label = 2;\n case 2:\n _a.trys.push([2, 4, , 5]);\n return [4 /*yield*/, exports.vodAxios.post(\"https://\" + Uploader.host + \"/v3/index.php?Action=ApplyUploadUGC\", sendParams, {\n timeout: this.applyRequestTimeout,\n withCredentials: false\n })];\n case 3:\n response = _a.sent();\n return [3 /*break*/, 5];\n case 4:\n e_1 = _a.sent();\n return [2 /*return*/, whenError(e_1)];\n case 5:\n applyResult = response.data;\n // all err code https://user-images.githubusercontent.com/1147375/51222454-bf6ef280-1978-11e9-8e33-1b0fdb2fe200.png\n if (applyResult.code == 0) {\n applyData = applyResult.data;\n vodSessionKey_1 = applyData.vodSessionKey;\n this.setStorage(this.sessionName, vodSessionKey_1);\n this.vodSessionKey = vodSessionKey_1;\n this.appId = applyData.appId;\n this.emit(vod_reporter_1.VodReportEvent.report_apply, {\n data: applyData,\n requestStartTime: requestStartTime\n });\n return [2 /*return*/, applyData];\n }\n else {\n err = new Error(applyResult.message);\n err.code = applyResult.code;\n return [2 /*return*/, whenError(err)];\n }\n return [2 /*return*/];\n }\n });\n });\n };\n Uploader.prototype.uploadToCos = function (applyData) {\n return __awaiter(this, void 0, void 0, function () {\n var self, cosParam, cos, uploadCosParams, cosVideoParam, cosCoverParam, requestStartTime, uploadPromises;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n self = this;\n cosParam = {\n bucket: applyData.storageBucket + \"-\" + applyData.storageAppId,\n region: applyData.storageRegionV5\n };\n cos = new COS({\n getAuthorization: function (options, callback) {\n return __awaiter(this, void 0, void 0, function () {\n var currentTimeStamp, safeExpireTime;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n currentTimeStamp = util_1.default.getUnix();\n safeExpireTime = (applyData.tempCertificate.expiredTime - applyData.timestamp) * 0.9;\n if (!(self.cosAuthTime === 0)) return [3 /*break*/, 1];\n self.cosAuthTime = currentTimeStamp;\n return [3 /*break*/, 3];\n case 1:\n if (!(self.cosAuthTime &&\n currentTimeStamp - self.cosAuthTime >= safeExpireTime)) return [3 /*break*/, 3];\n return [4 /*yield*/, self.applyUploadUGC()];\n case 2:\n applyData = _a.sent();\n self.cosAuthTime = util_1.default.getUnix();\n _a.label = 3;\n case 3:\n callback({\n TmpSecretId: applyData.tempCertificate.secretId,\n TmpSecretKey: applyData.tempCertificate.secretKey,\n XCosSecurityToken: applyData.tempCertificate.token,\n StartTime: applyData.timestamp,\n ExpiredTime: applyData.tempCertificate.expiredTime\n });\n return [2 /*return*/];\n }\n });\n });\n }\n });\n this.cos = cos;\n uploadCosParams = [];\n if (this.videoFile) {\n cosVideoParam = __assign(__assign({}, cosParam), { file: this.videoFile, key: applyData.video.storagePath, onProgress: function (data) {\n self.emit(UploaderEvent.video_progress, data);\n self.emit(UploaderEvent.media_progress, data);\n }, onUpload: function (data) {\n self.emit(UploaderEvent.video_upload, data);\n self.emit(UploaderEvent.media_upload, data);\n }, onTaskReady: function (taskId) {\n self.taskId = taskId;\n } });\n uploadCosParams.push(cosVideoParam);\n }\n if (this.coverFile) {\n cosCoverParam = __assign(__assign({}, cosParam), { file: this.coverFile, key: applyData.cover.storagePath, onProgress: function (data) {\n self.emit(UploaderEvent.cover_progress, data);\n }, onUpload: function (data) {\n self.emit(UploaderEvent.cover_upload, data);\n }, onTaskReady: util_1.default.noop });\n uploadCosParams.push(cosCoverParam);\n }\n requestStartTime = new Date();\n uploadPromises = uploadCosParams.map(function (uploadCosParam) {\n return new Promise(function (resolve, reject) {\n cos.sliceUploadFile({\n Bucket: uploadCosParam.bucket,\n Region: uploadCosParam.region,\n Key: uploadCosParam.key,\n Body: uploadCosParam.file,\n onTaskReady: uploadCosParam.onTaskReady,\n onProgress: uploadCosParam.onProgress\n }, function (err, data) {\n // only report video file\n if (uploadCosParam.file === self.videoFile) {\n self.emit(vod_reporter_1.VodReportEvent.report_cos_upload, {\n err: err,\n requestStartTime: requestStartTime\n });\n }\n if (!err) {\n uploadCosParam.onUpload(data);\n return resolve();\n }\n self.delStorage(self.sessionName);\n if (JSON.stringify(err) === '{\"error\":\"error\",\"headers\":{}}') {\n return reject(new Error(\"cors error\"));\n }\n reject(err);\n });\n });\n });\n return [4 /*yield*/, Promise.all(uploadPromises)];\n case 1: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Uploader.prototype.commitUploadUGC = function (retryCount) {\n if (retryCount === void 0) { retryCount = 0; }\n return __awaiter(this, void 0, void 0, function () {\n function whenError(err) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (err.code === 500) {\n Uploader.host = Uploader.host === util_1.HOST.MAIN ? util_1.HOST.BACKUP : util_1.HOST.MAIN;\n }\n self.emit(vod_reporter_1.VodReportEvent.report_commit, {\n err: err,\n requestStartTime: requestStartTime\n });\n if (self.commitRequestRetryCount == retryCount) {\n if (err) {\n throw err;\n }\n throw new Error(\"commit upload failed\");\n }\n return [4 /*yield*/, util_1.default.delay(self.retryDelay)];\n case 1:\n _a.sent();\n return [2 /*return*/, self.commitUploadUGC(retryCount + 1)];\n }\n });\n });\n }\n var self, signature, vodSessionKey, requestStartTime, response, e_2, commitResult, err;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n self = this;\n return [4 /*yield*/, this.getSignature()];\n case 1:\n signature = _a.sent();\n this.delStorage(this.sessionName);\n vodSessionKey = this.vodSessionKey;\n requestStartTime = new Date();\n _a.label = 2;\n case 2:\n _a.trys.push([2, 4, , 5]);\n return [4 /*yield*/, exports.vodAxios.post(\"https://\" + Uploader.host + \"/v3/index.php?Action=CommitUploadUGC\", {\n signature: signature,\n vodSessionKey: vodSessionKey\n }, {\n timeout: this.commitRequestTimeout,\n withCredentials: false\n })];\n case 3:\n response = _a.sent();\n return [3 /*break*/, 5];\n case 4:\n e_2 = _a.sent();\n return [2 /*return*/, whenError(e_2)];\n case 5:\n commitResult = response.data;\n if (commitResult.code == 0) {\n this.emit(vod_reporter_1.VodReportEvent.report_commit, {\n data: commitResult.data,\n requestStartTime: requestStartTime\n });\n return [2 /*return*/, commitResult.data];\n }\n else {\n err = new Error(commitResult.message);\n err.code = commitResult.code;\n return [2 /*return*/, whenError(err)];\n }\n return [2 /*return*/];\n }\n });\n });\n };\n Uploader.prototype.start = function () {\n var _this = this;\n var requestStartTime = new Date();\n this.donePromise = this._start()\n .then(function (doneResult) {\n _this.emit(vod_reporter_1.VodReportEvent.report_done, {\n err: { code: 0 },\n requestStartTime: requestStartTime\n });\n return doneResult;\n })\n .catch(function (err) {\n _this.emit(vod_reporter_1.VodReportEvent.report_done, {\n err: {\n code: (err && err.code) || util_1.default.CLIENT_ERROR_CODE.UPLOAD_FAIL\n },\n requestStartTime: requestStartTime\n });\n throw err;\n });\n };\n Uploader.prototype._start = function () {\n return __awaiter(this, void 0, void 0, function () {\n var applyData;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.applyUploadUGC()];\n case 1:\n applyData = _a.sent();\n return [4 /*yield*/, this.uploadToCos(applyData)];\n case 2:\n _a.sent();\n return [4 /*yield*/, this.commitUploadUGC()];\n case 3: return [2 /*return*/, _a.sent()];\n }\n });\n });\n };\n Uploader.prototype.done = function () {\n return this.donePromise;\n };\n Uploader.prototype.cancel = function () {\n this.cos.cancelTask(this.taskId);\n };\n // domain\n Uploader.host = util_1.HOST.MAIN;\n return Uploader;\n}(events_1.EventEmitter));\nexports.default = Uploader;\n//# sourceMappingURL=uploader.js.map","// https://github.com/substack/insert-css\nvar containers = []; // will store container HTMLElement references\n\nvar styleElements = []; // will store {prepend: HTMLElement, append: HTMLElement}\n\nvar usage = 'insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).';\n\nfunction createStyleElement() {\n var styleElement = document.createElement('style');\n styleElement.setAttribute('type', 'text/css');\n return styleElement;\n}\n\nfunction insertCss(css, options) {\n options = options || {};\n\n if (css === undefined) {\n throw new Error(usage);\n }\n\n var position = options.prepend === true ? 'prepend' : 'append';\n var container = options.container !== undefined ? options.container : document.querySelector('head');\n var containerId = containers.indexOf(container); // first time we see this container, create the necessary entries\n\n if (containerId === -1) {\n containerId = containers.push(container) - 1;\n styleElements[containerId] = {};\n } // try to get the correponding container + position styleElement, create it otherwise\n\n\n var styleElement;\n\n if (styleElements[containerId] !== undefined && styleElements[containerId][position] !== undefined) {\n styleElement = styleElements[containerId][position];\n } else {\n styleElement = styleElements[containerId][position] = createStyleElement();\n\n if (position === 'prepend') {\n container.insertBefore(styleElement, container.childNodes[0]);\n } else {\n container.appendChild(styleElement);\n }\n } // strip potential UTF-8 BOM if css was read from a file\n\n\n if (css.charCodeAt(0) === 0xfeff) {\n css = css.substr(1, css.length);\n } // actually add the stylesheet\n\n\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText += css;\n } else {\n styleElement.textContent += css;\n }\n\n return styleElement;\n}\n\nexport default insertCss;","function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { nextTick, h } from 'vue';\nimport { generate as generateColor } from '@ant-design/colors';\nimport insertCss from './insert-css';\nexport function warn(valid, message) {\n // Support uglify\n if (process.env.NODE_ENV !== 'production' && !valid && console !== undefined) {\n console.error(\"Warning: \".concat(message));\n }\n}\nexport function warning(valid, message) {\n warn(valid, \"[@ant-design/icons-vue] \".concat(message));\n}\nexport function isIconDefinition(target) {\n return typeof target === 'object' && typeof target.name === 'string' && typeof target.theme === 'string' && (typeof target.icon === 'object' || typeof target.icon === 'function');\n}\nexport function normalizeAttrs() {\n var attrs = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n return Object.keys(attrs).reduce(function (acc, key) {\n var val = attrs[key];\n\n switch (key) {\n case 'class':\n acc.className = val;\n delete acc[\"class\"];\n break;\n\n default:\n acc[key] = val;\n }\n\n return acc;\n }, {});\n}\nexport function generate(node, key, rootProps) {\n if (!rootProps) {\n return h(node.tag, _objectSpread({\n key: key\n }, node.attrs), (node.children || []).map(function (child, index) {\n return generate(child, \"\".concat(key, \"-\").concat(node.tag, \"-\").concat(index));\n }));\n }\n\n return h(node.tag, _objectSpread({\n key: key\n }, rootProps, node.attrs), (node.children || []).map(function (child, index) {\n return generate(child, \"\".concat(key, \"-\").concat(node.tag, \"-\").concat(index));\n }));\n}\nexport function getSecondaryColor(primaryColor) {\n // choose the second color\n return generateColor(primaryColor)[0];\n}\nexport function normalizeTwoToneColors(twoToneColor) {\n if (!twoToneColor) {\n return [];\n }\n\n return Array.isArray(twoToneColor) ? twoToneColor : [twoToneColor];\n} // These props make sure that the SVG behaviours like general text.\n// Reference: https://blog.prototypr.io/align-svg-icons-to-text-and-say-goodbye-to-font-icons-d44b3d7b26b4\n\nexport var svgBaseProps = {\n width: '1em',\n height: '1em',\n fill: 'currentColor',\n 'aria-hidden': 'true',\n focusable: 'false'\n};\nexport var iconStyles = \"\\n.anticon {\\n display: inline-block;\\n color: inherit;\\n font-style: normal;\\n line-height: 0;\\n text-align: center;\\n text-transform: none;\\n vertical-align: -0.125em;\\n text-rendering: optimizeLegibility;\\n -webkit-font-smoothing: antialiased;\\n -moz-osx-font-smoothing: grayscale;\\n}\\n\\n.anticon > * {\\n line-height: 1;\\n}\\n\\n.anticon svg {\\n display: inline-block;\\n}\\n\\n.anticon::before {\\n display: none;\\n}\\n\\n.anticon .anticon-icon {\\n display: block;\\n}\\n\\n.anticon[tabindex] {\\n cursor: pointer;\\n}\\n\\n.anticon-spin::before,\\n.anticon-spin {\\n display: inline-block;\\n -webkit-animation: loadingCircle 1s infinite linear;\\n animation: loadingCircle 1s infinite linear;\\n}\\n\\n@-webkit-keyframes loadingCircle {\\n 100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg);\\n }\\n}\\n\\n@keyframes loadingCircle {\\n 100% {\\n -webkit-transform: rotate(360deg);\\n transform: rotate(360deg);\\n }\\n}\\n\";\nvar cssInjectedFlag = false;\nexport var useInsertStyles = function useInsertStyles() {\n var styleStr = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : iconStyles;\n nextTick(function () {\n if (!cssInjectedFlag) {\n insertCss(styleStr, {\n prepend: true\n });\n cssInjectedFlag = true;\n }\n });\n};","function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { generate, getSecondaryColor, isIconDefinition, warning, useInsertStyles } from '../utils';\nvar twoToneColorPalette = {\n primaryColor: '#333',\n secondaryColor: '#E6E6E6',\n calculated: false\n};\n\nfunction setTwoToneColors(_ref) {\n var primaryColor = _ref.primaryColor,\n secondaryColor = _ref.secondaryColor;\n twoToneColorPalette.primaryColor = primaryColor;\n twoToneColorPalette.secondaryColor = secondaryColor || getSecondaryColor(primaryColor);\n twoToneColorPalette.calculated = !!secondaryColor;\n}\n\nfunction getTwoToneColors() {\n return _objectSpread({}, twoToneColorPalette);\n}\n\nvar IconBase = function IconBase(props, context) {\n var _props$context$attrs = _objectSpread({}, props, context.attrs),\n icon = _props$context$attrs.icon,\n primaryColor = _props$context$attrs.primaryColor,\n secondaryColor = _props$context$attrs.secondaryColor,\n restProps = _objectWithoutProperties(_props$context$attrs, [\"icon\", \"primaryColor\", \"secondaryColor\"]);\n\n var colors = twoToneColorPalette;\n\n if (primaryColor) {\n colors = {\n primaryColor: primaryColor,\n secondaryColor: secondaryColor || getSecondaryColor(primaryColor)\n };\n }\n\n useInsertStyles();\n warning(isIconDefinition(icon), \"icon should be icon definiton, but got \".concat(icon));\n\n if (!isIconDefinition(icon)) {\n return null;\n }\n\n var target = icon;\n\n if (target && typeof target.icon === 'function') {\n target = _objectSpread({}, target, {\n icon: target.icon(colors.primaryColor, colors.secondaryColor)\n });\n }\n\n return generate(target.icon, \"svg-\".concat(target.name), _objectSpread({}, restProps, {\n 'data-icon': target.name,\n width: '1em',\n height: '1em',\n fill: 'currentColor',\n 'aria-hidden': 'true'\n })); // },\n};\n\nIconBase.inheritAttrs = false;\nIconBase.getTwoToneColors = getTwoToneColors;\nIconBase.setTwoToneColors = setTwoToneColors;\nexport default IconBase;","function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nimport VueIcon from './IconBase';\nimport { normalizeTwoToneColors } from '../utils';\nexport function setTwoToneColor(twoToneColor) {\n var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),\n _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2),\n primaryColor = _normalizeTwoToneColo2[0],\n secondaryColor = _normalizeTwoToneColo2[1];\n\n return VueIcon.setTwoToneColors({\n primaryColor: primaryColor,\n secondaryColor: secondaryColor\n });\n}\nexport function getTwoToneColor() {\n var colors = VueIcon.getTwoToneColors();\n\n if (!colors.calculated) {\n return colors.primaryColor;\n }\n\n return [colors.primaryColor, colors.secondaryColor];\n}","import * as _vue from \"vue\";\n\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { if (typeof Symbol === \"undefined\" || !(Symbol.iterator in Object(arr))) return; var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? Object(arguments[i]) : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }\n\nfunction _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }\n\nimport VueIcon from './IconBase';\nimport { getTwoToneColor, setTwoToneColor } from './twoTonePrimaryColor';\nimport { normalizeTwoToneColors } from '../utils'; // Initial setting\n\nsetTwoToneColor('#1890ff');\n\nvar Icon = function Icon(props, context) {\n var _classObj;\n\n var _props$context$attrs = _objectSpread({}, props, context.attrs),\n cls = _props$context$attrs[\"class\"],\n icon = _props$context$attrs.icon,\n spin = _props$context$attrs.spin,\n rotate = _props$context$attrs.rotate,\n tabindex = _props$context$attrs.tabindex,\n twoToneColor = _props$context$attrs.twoToneColor,\n onClick = _props$context$attrs.onClick,\n restProps = _objectWithoutProperties(_props$context$attrs, [\"class\", \"icon\", \"spin\", \"rotate\", \"tabindex\", \"twoToneColor\", \"onClick\"]);\n\n var classObj = (_classObj = {\n anticon: true\n }, _defineProperty(_classObj, \"anticon-\".concat(icon.name), Boolean(icon.name)), _defineProperty(_classObj, cls, cls), _classObj);\n var svgClassString = !!spin || icon.name === 'loading' ? 'anticon-spin' : '';\n var iconTabIndex = tabindex;\n\n if (iconTabIndex === undefined && onClick) {\n iconTabIndex = -1;\n restProps.tabindex = iconTabIndex;\n }\n\n var svgStyle = rotate ? {\n msTransform: \"rotate(\".concat(rotate, \"deg)\"),\n transform: \"rotate(\".concat(rotate, \"deg)\")\n } : undefined;\n\n var _normalizeTwoToneColo = normalizeTwoToneColors(twoToneColor),\n _normalizeTwoToneColo2 = _slicedToArray(_normalizeTwoToneColo, 2),\n primaryColor = _normalizeTwoToneColo2[0],\n secondaryColor = _normalizeTwoToneColo2[1];\n\n return _vue.createVNode(\"span\", _vue.mergeProps(restProps, {\n \"role\": \"img\",\n \"aria-label\": icon.name,\n \"onClick\": onClick,\n \"class\": classObj\n }), [_vue.createVNode(VueIcon, {\n \"class\": svgClassString,\n \"icon\": icon,\n \"primaryColor\": primaryColor,\n \"secondaryColor\": secondaryColor,\n \"style\": svgStyle\n }, null)]);\n};\n\nIcon.displayName = 'AntdIcon';\nIcon.inheritAttrs = false;\nIcon.getTwoToneColor = getTwoToneColor;\nIcon.setTwoToneColor = setTwoToneColor;\nexport default Icon;","'use strict';\nvar $ = require('../internals/export');\nvar toInteger = require('../internals/to-integer');\nvar thisNumberValue = require('../internals/this-number-value');\nvar repeat = require('../internals/string-repeat');\nvar fails = require('../internals/fails');\n\nvar nativeToFixed = 1.0.toFixed;\nvar floor = Math.floor;\n\nvar pow = function (x, n, acc) {\n return n === 0 ? acc : n % 2 === 1 ? pow(x, n - 1, acc * x) : pow(x * x, n / 2, acc);\n};\n\nvar log = function (x) {\n var n = 0;\n var x2 = x;\n while (x2 >= 4096) {\n n += 12;\n x2 /= 4096;\n }\n while (x2 >= 2) {\n n += 1;\n x2 /= 2;\n } return n;\n};\n\nvar FORCED = nativeToFixed && (\n 0.00008.toFixed(3) !== '0.000' ||\n 0.9.toFixed(0) !== '1' ||\n 1.255.toFixed(2) !== '1.25' ||\n 1000000000000000128.0.toFixed(0) !== '1000000000000000128'\n) || !fails(function () {\n // V8 ~ Android 4.3-\n nativeToFixed.call({});\n});\n\n// `Number.prototype.toFixed` method\n// https://tc39.github.io/ecma262/#sec-number.prototype.tofixed\n$({ target: 'Number', proto: true, forced: FORCED }, {\n // eslint-disable-next-line max-statements\n toFixed: function toFixed(fractionDigits) {\n var number = thisNumberValue(this);\n var fractDigits = toInteger(fractionDigits);\n var data = [0, 0, 0, 0, 0, 0];\n var sign = '';\n var result = '0';\n var e, z, j, k;\n\n var multiply = function (n, c) {\n var index = -1;\n var c2 = c;\n while (++index < 6) {\n c2 += n * data[index];\n data[index] = c2 % 1e7;\n c2 = floor(c2 / 1e7);\n }\n };\n\n var divide = function (n) {\n var index = 6;\n var c = 0;\n while (--index >= 0) {\n c += data[index];\n data[index] = floor(c / n);\n c = (c % n) * 1e7;\n }\n };\n\n var dataToString = function () {\n var index = 6;\n var s = '';\n while (--index >= 0) {\n if (s !== '' || index === 0 || data[index] !== 0) {\n var t = String(data[index]);\n s = s === '' ? t : s + repeat.call('0', 7 - t.length) + t;\n }\n } return s;\n };\n\n if (fractDigits < 0 || fractDigits > 20) throw RangeError('Incorrect fraction digits');\n // eslint-disable-next-line no-self-compare\n if (number != number) return 'NaN';\n if (number <= -1e21 || number >= 1e21) return String(number);\n if (number < 0) {\n sign = '-';\n number = -number;\n }\n if (number > 1e-21) {\n e = log(number * pow(2, 69, 1)) - 69;\n z = e < 0 ? number * pow(2, -e, 1) : number / pow(2, e, 1);\n z *= 0x10000000000000;\n e = 52 - e;\n if (e > 0) {\n multiply(0, z);\n j = fractDigits;\n while (j >= 7) {\n multiply(1e7, 0);\n j -= 7;\n }\n multiply(pow(10, j, 1), 0);\n j = e - 1;\n while (j >= 23) {\n divide(1 << 23);\n j -= 23;\n }\n divide(1 << j);\n multiply(1, 1);\n divide(2);\n result = dataToString();\n } else {\n multiply(0, z);\n multiply(1 << -e, 0);\n result = dataToString() + repeat.call('0', fractDigits);\n }\n }\n if (fractDigits > 0) {\n k = result.length;\n result = sign + (k <= fractDigits\n ? '0.' + repeat.call('0', fractDigits - k) + result\n : result.slice(0, k - fractDigits) + '.' + result.slice(k - fractDigits));\n } else {\n result = sign + result;\n } return result;\n }\n});\n","'use strict';\n\nvar utils = require('./../utils');\n\nfunction InterceptorManager() {\n this.handlers = [];\n}\n\n/**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\nInterceptorManager.prototype.use = function use(fulfilled, rejected) {\n this.handlers.push({\n fulfilled: fulfilled,\n rejected: rejected\n });\n return this.handlers.length - 1;\n};\n\n/**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n */\nInterceptorManager.prototype.eject = function eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n};\n\n/**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n */\nInterceptorManager.prototype.forEach = function forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n};\n\nmodule.exports = InterceptorManager;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.HOST = void 0;\nfunction isFile(v) {\n return Object.prototype.toString.call(v) == \"[object File]\";\n}\nfunction isFunction(v) {\n return typeof v === \"function\";\n}\nfunction isString(v) {\n return typeof v === \"string\";\n}\n// eslint-disable-next-line @typescript-eslint/explicit-function-return-type\nfunction noop() { }\nfunction delay(ms) {\n return new Promise(function (resolve) {\n setTimeout(function () {\n resolve();\n }, ms);\n });\n}\nfunction getUnix() {\n return Math.floor(Date.now() / 1000);\n}\nvar CLIENT_ERROR_CODE;\n(function (CLIENT_ERROR_CODE) {\n CLIENT_ERROR_CODE[CLIENT_ERROR_CODE[\"UPLOAD_FAIL\"] = 1] = \"UPLOAD_FAIL\";\n})(CLIENT_ERROR_CODE || (CLIENT_ERROR_CODE = {}));\nvar HOST;\n(function (HOST) {\n HOST[\"MAIN\"] = \"vod2.qcloud.com\";\n HOST[\"BACKUP\"] = \"vod2.dnsv1.com\";\n})(HOST = exports.HOST || (exports.HOST = {}));\nexports.default = {\n isFile: isFile,\n isFunction: isFunction,\n isString: isString,\n noop: noop,\n delay: delay,\n getUnix: getUnix,\n isTest: process.env.NODE_ENV === \"test\",\n isDev: process.env.NODE_ENV === \"development\",\n CLIENT_ERROR_CODE: CLIENT_ERROR_CODE\n};\n//# sourceMappingURL=util.js.map","//[4] \tNameStartChar\t ::= \t\":\" | [A-Z] | \"_\" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\r\n//[4a] \tNameChar\t ::= \tNameStartChar | \"-\" | \".\" | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]\r\n//[5] \tName\t ::= \tNameStartChar (NameChar)*\r\nvar nameStartChar = /[A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]///\\u10000-\\uEFFFF\r\nvar nameChar = new RegExp(\"[\\\\-\\\\.0-9\"+nameStartChar.source.slice(1,-1)+\"\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]\");\r\nvar tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\\:'+nameStartChar.source+nameChar.source+'*)?$');\r\n//var tagNamePattern = /^[a-zA-Z_][\\w\\-\\.]*(?:\\:[a-zA-Z_][\\w\\-\\.]*)?$/\r\n//var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')\r\n\r\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\r\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\r\nvar S_TAG = 0;//tag name offerring\r\nvar S_ATTR = 1;//attr name offerring \r\nvar S_ATTR_SPACE=2;//attr name end and space offer\r\nvar S_EQ = 3;//=space?\r\nvar S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only)\r\nvar S_ATTR_END = 5;//attr value end and no space(quot end)\r\nvar S_TAG_SPACE = 6;//(attr value end || tag end ) && (space offer)\r\nvar S_TAG_CLOSE = 7;//closed el<el />\r\n\r\nfunction XMLReader(){\r\n\t\r\n}\r\n\r\nXMLReader.prototype = {\r\n\tparse:function(source,defaultNSMap,entityMap){\r\n\t\tvar domBuilder = this.domBuilder;\r\n\t\tdomBuilder.startDocument();\r\n\t\t_copy(defaultNSMap ,defaultNSMap = {})\r\n\t\tparse(source,defaultNSMap,entityMap,\r\n\t\t\t\tdomBuilder,this.errorHandler);\r\n\t\tdomBuilder.endDocument();\r\n\t}\r\n}\r\nfunction parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){\r\n\tfunction fixedFromCharCode(code) {\r\n\t\t// String.prototype.fromCharCode does not supports\r\n\t\t// > 2 bytes unicode chars directly\r\n\t\tif (code > 0xffff) {\r\n\t\t\tcode -= 0x10000;\r\n\t\t\tvar surrogate1 = 0xd800 + (code >> 10)\r\n\t\t\t\t, surrogate2 = 0xdc00 + (code & 0x3ff);\r\n\r\n\t\t\treturn String.fromCharCode(surrogate1, surrogate2);\r\n\t\t} else {\r\n\t\t\treturn String.fromCharCode(code);\r\n\t\t}\r\n\t}\r\n\tfunction entityReplacer(a){\r\n\t\tvar k = a.slice(1,-1);\r\n\t\tif(k in entityMap){\r\n\t\t\treturn entityMap[k]; \r\n\t\t}else if(k.charAt(0) === '#'){\r\n\t\t\treturn fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))\r\n\t\t}else{\r\n\t\t\terrorHandler.error('entity not found:'+a);\r\n\t\t\treturn a;\r\n\t\t}\r\n\t}\r\n\tfunction appendText(end){//has some bugs\r\n\t\tif(end>start){\r\n\t\t\tvar xt = source.substring(start,end).replace(/&#?\\w+;/g,entityReplacer);\r\n\t\t\tlocator&&position(start);\r\n\t\t\tdomBuilder.characters(xt,0,end-start);\r\n\t\t\tstart = end\r\n\t\t}\r\n\t}\r\n\tfunction position(p,m){\r\n\t\twhile(p>=lineEnd && (m = linePattern.exec(source))){\r\n\t\t\tlineStart = m.index;\r\n\t\t\tlineEnd = lineStart + m[0].length;\r\n\t\t\tlocator.lineNumber++;\r\n\t\t\t//console.log('line++:',locator,startPos,endPos)\r\n\t\t}\r\n\t\tlocator.columnNumber = p-lineStart+1;\r\n\t}\r\n\tvar lineStart = 0;\r\n\tvar lineEnd = 0;\r\n\tvar linePattern = /.*(?:\\r\\n?|\\n)|.*$/g\r\n\tvar locator = domBuilder.locator;\r\n\t\r\n\tvar parseStack = [{currentNSMap:defaultNSMapCopy}]\r\n\tvar closeMap = {};\r\n\tvar start = 0;\r\n\twhile(true){\r\n\t\ttry{\r\n\t\t\tvar tagStart = source.indexOf('<',start);\r\n\t\t\tif(tagStart<0){\r\n\t\t\t\tif(!source.substr(start).match(/^\\s*$/)){\r\n\t\t\t\t\tvar doc = domBuilder.doc;\r\n\t \t\t\tvar text = doc.createTextNode(source.substr(start));\r\n\t \t\t\tdoc.appendChild(text);\r\n\t \t\t\tdomBuilder.currentElement = text;\r\n\t\t\t\t}\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif(tagStart>start){\r\n\t\t\t\tappendText(tagStart);\r\n\t\t\t}\r\n\t\t\tswitch(source.charAt(tagStart+1)){\r\n\t\t\tcase '/':\r\n\t\t\t\tvar end = source.indexOf('>',tagStart+3);\r\n\t\t\t\tvar tagName = source.substring(tagStart+2,end);\r\n\t\t\t\tvar config = parseStack.pop();\r\n\t\t\t\tif(end<0){\r\n\t\t\t\t\t\r\n\t \t\ttagName = source.substring(tagStart+2).replace(/[\\s<].*/,'');\r\n\t \t\t//console.error('#@@@@@@'+tagName)\r\n\t \t\terrorHandler.error(\"end tag name: \"+tagName+' is not complete:'+config.tagName);\r\n\t \t\tend = tagStart+1+tagName.length;\r\n\t \t}else if(tagName.match(/\\s</)){\r\n\t \t\ttagName = tagName.replace(/[\\s<].*/,'');\r\n\t \t\terrorHandler.error(\"end tag name: \"+tagName+' maybe not complete');\r\n\t \t\tend = tagStart+1+tagName.length;\r\n\t\t\t\t}\r\n\t\t\t\t//console.error(parseStack.length,parseStack)\r\n\t\t\t\t//console.error(config);\r\n\t\t\t\tvar localNSMap = config.localNSMap;\r\n\t\t\t\tvar endMatch = config.tagName == tagName;\r\n\t\t\t\tvar endIgnoreCaseMach = endMatch || config.tagName&&config.tagName.toLowerCase() == tagName.toLowerCase()\r\n\t\t if(endIgnoreCaseMach){\r\n\t\t \tdomBuilder.endElement(config.uri,config.localName,tagName);\r\n\t\t\t\t\tif(localNSMap){\r\n\t\t\t\t\t\tfor(var prefix in localNSMap){\r\n\t\t\t\t\t\t\tdomBuilder.endPrefixMapping(prefix) ;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif(!endMatch){\r\n\t\t \terrorHandler.fatalError(\"end tag name: \"+tagName+' is not match the current start tagName:'+config.tagName );\r\n\t\t\t\t\t}\r\n\t\t }else{\r\n\t\t \tparseStack.push(config)\r\n\t\t }\r\n\t\t\t\t\r\n\t\t\t\tend++;\r\n\t\t\t\tbreak;\r\n\t\t\t\t// end elment\r\n\t\t\tcase '?':// <?...?>\r\n\t\t\t\tlocator&&position(tagStart);\r\n\t\t\t\tend = parseInstruction(source,tagStart,domBuilder);\r\n\t\t\t\tbreak;\r\n\t\t\tcase '!':// <!doctype,<![CDATA,<!--\r\n\t\t\t\tlocator&&position(tagStart);\r\n\t\t\t\tend = parseDCC(source,tagStart,domBuilder,errorHandler);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tlocator&&position(tagStart);\r\n\t\t\t\tvar el = new ElementAttributes();\r\n\t\t\t\tvar currentNSMap = parseStack[parseStack.length-1].currentNSMap;\r\n\t\t\t\t//elStartEnd\r\n\t\t\t\tvar end = parseElementStartPart(source,tagStart,el,currentNSMap,entityReplacer,errorHandler);\r\n\t\t\t\tvar len = el.length;\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(!el.closed && fixSelfClosed(source,end,el.tagName,closeMap)){\r\n\t\t\t\t\tel.closed = true;\r\n\t\t\t\t\tif(!entityMap.nbsp){\r\n\t\t\t\t\t\terrorHandler.warning('unclosed xml attribute');\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(locator && len){\r\n\t\t\t\t\tvar locator2 = copyLocator(locator,{});\r\n\t\t\t\t\t//try{//attribute position fixed\r\n\t\t\t\t\tfor(var i = 0;i<len;i++){\r\n\t\t\t\t\t\tvar a = el[i];\r\n\t\t\t\t\t\tposition(a.offset);\r\n\t\t\t\t\t\ta.locator = copyLocator(locator,{});\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//}catch(e){console.error('@@@@@'+e)}\r\n\t\t\t\t\tdomBuilder.locator = locator2\r\n\t\t\t\t\tif(appendElement(el,domBuilder,currentNSMap)){\r\n\t\t\t\t\t\tparseStack.push(el)\r\n\t\t\t\t\t}\r\n\t\t\t\t\tdomBuilder.locator = locator;\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(appendElement(el,domBuilder,currentNSMap)){\r\n\t\t\t\t\t\tparseStack.push(el)\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tif(el.uri === 'http://www.w3.org/1999/xhtml' && !el.closed){\r\n\t\t\t\t\tend = parseHtmlSpecialContent(source,end,el.tagName,entityReplacer,domBuilder)\r\n\t\t\t\t}else{\r\n\t\t\t\t\tend++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}catch(e){\r\n\t\t\terrorHandler.error('element parse error: '+e)\r\n\t\t\t//errorHandler.error('element parse error: '+e);\r\n\t\t\tend = -1;\r\n\t\t\t//throw e;\r\n\t\t}\r\n\t\tif(end>start){\r\n\t\t\tstart = end;\r\n\t\t}else{\r\n\t\t\t//TODO: 这里有可能sax回退,有位置错误风险\r\n\t\t\tappendText(Math.max(tagStart,start)+1);\r\n\t\t}\r\n\t}\r\n}\r\nfunction copyLocator(f,t){\r\n\tt.lineNumber = f.lineNumber;\r\n\tt.columnNumber = f.columnNumber;\r\n\treturn t;\r\n}\r\n\r\n/**\r\n * @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack);\r\n * @return end of the elementStartPart(end of elementEndPart for selfClosed el)\r\n */\r\nfunction parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){\r\n\tvar attrName;\r\n\tvar value;\r\n\tvar p = ++start;\r\n\tvar s = S_TAG;//status\r\n\twhile(true){\r\n\t\tvar c = source.charAt(p);\r\n\t\tswitch(c){\r\n\t\tcase '=':\r\n\t\t\tif(s === S_ATTR){//attrName\r\n\t\t\t\tattrName = source.slice(start,p);\r\n\t\t\t\ts = S_EQ;\r\n\t\t\t}else if(s === S_ATTR_SPACE){\r\n\t\t\t\ts = S_EQ;\r\n\t\t\t}else{\r\n\t\t\t\t//fatalError: equal must after attrName or space after attrName\r\n\t\t\t\tthrow new Error('attribute equal must after attrName');\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase '\\'':\r\n\t\tcase '\"':\r\n\t\t\tif(s === S_EQ || s === S_ATTR //|| s == S_ATTR_SPACE\r\n\t\t\t\t){//equal\r\n\t\t\t\tif(s === S_ATTR){\r\n\t\t\t\t\terrorHandler.warning('attribute value must after \"=\"')\r\n\t\t\t\t\tattrName = source.slice(start,p)\r\n\t\t\t\t}\r\n\t\t\t\tstart = p+1;\r\n\t\t\t\tp = source.indexOf(c,start)\r\n\t\t\t\tif(p>0){\r\n\t\t\t\t\tvalue = source.slice(start,p).replace(/&#?\\w+;/g,entityReplacer);\r\n\t\t\t\t\tel.add(attrName,value,start-1);\r\n\t\t\t\t\ts = S_ATTR_END;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//fatalError: no end quot match\r\n\t\t\t\t\tthrow new Error('attribute value no end \\''+c+'\\' match');\r\n\t\t\t\t}\r\n\t\t\t}else if(s == S_ATTR_NOQUOT_VALUE){\r\n\t\t\t\tvalue = source.slice(start,p).replace(/&#?\\w+;/g,entityReplacer);\r\n\t\t\t\t//console.log(attrName,value,start,p)\r\n\t\t\t\tel.add(attrName,value,start);\r\n\t\t\t\t//console.dir(el)\r\n\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed start quot('+c+')!!');\r\n\t\t\t\tstart = p+1;\r\n\t\t\t\ts = S_ATTR_END\r\n\t\t\t}else{\r\n\t\t\t\t//fatalError: no equal before\r\n\t\t\t\tthrow new Error('attribute value must after \"=\"');\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase '/':\r\n\t\t\tswitch(s){\r\n\t\t\tcase S_TAG:\r\n\t\t\t\tel.setTagName(source.slice(start,p));\r\n\t\t\tcase S_ATTR_END:\r\n\t\t\tcase S_TAG_SPACE:\r\n\t\t\tcase S_TAG_CLOSE:\r\n\t\t\t\ts =S_TAG_CLOSE;\r\n\t\t\t\tel.closed = true;\r\n\t\t\tcase S_ATTR_NOQUOT_VALUE:\r\n\t\t\tcase S_ATTR:\r\n\t\t\tcase S_ATTR_SPACE:\r\n\t\t\t\tbreak;\r\n\t\t\t//case S_EQ:\r\n\t\t\tdefault:\r\n\t\t\t\tthrow new Error(\"attribute invalid close char('/')\")\r\n\t\t\t}\r\n\t\t\tbreak;\r\n\t\tcase ''://end document\r\n\t\t\t//throw new Error('unexpected end of input')\r\n\t\t\terrorHandler.error('unexpected end of input');\r\n\t\t\tif(s == S_TAG){\r\n\t\t\t\tel.setTagName(source.slice(start,p));\r\n\t\t\t}\r\n\t\t\treturn p;\r\n\t\tcase '>':\r\n\t\t\tswitch(s){\r\n\t\t\tcase S_TAG:\r\n\t\t\t\tel.setTagName(source.slice(start,p));\r\n\t\t\tcase S_ATTR_END:\r\n\t\t\tcase S_TAG_SPACE:\r\n\t\t\tcase S_TAG_CLOSE:\r\n\t\t\t\tbreak;//normal\r\n\t\t\tcase S_ATTR_NOQUOT_VALUE://Compatible state\r\n\t\t\tcase S_ATTR:\r\n\t\t\t\tvalue = source.slice(start,p);\r\n\t\t\t\tif(value.slice(-1) === '/'){\r\n\t\t\t\t\tel.closed = true;\r\n\t\t\t\t\tvalue = value.slice(0,-1)\r\n\t\t\t\t}\r\n\t\t\tcase S_ATTR_SPACE:\r\n\t\t\t\tif(s === S_ATTR_SPACE){\r\n\t\t\t\t\tvalue = attrName;\r\n\t\t\t\t}\r\n\t\t\t\tif(s == S_ATTR_NOQUOT_VALUE){\r\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!!');\r\n\t\t\t\t\tel.add(attrName,value.replace(/&#?\\w+;/g,entityReplacer),start)\r\n\t\t\t\t}else{\r\n\t\t\t\t\tif(currentNSMap[''] !== 'http://www.w3.org/1999/xhtml' || !value.match(/^(?:disabled|checked|selected)$/i)){\r\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed value!! \"'+value+'\" instead!!')\r\n\t\t\t\t\t}\r\n\t\t\t\t\tel.add(value,value,start)\r\n\t\t\t\t}\r\n\t\t\t\tbreak;\r\n\t\t\tcase S_EQ:\r\n\t\t\t\tthrow new Error('attribute value missed!!');\r\n\t\t\t}\r\n//\t\t\tconsole.log(tagName,tagNamePattern,tagNamePattern.test(tagName))\r\n\t\t\treturn p;\r\n\t\t/*xml space '\\x20' | #x9 | #xD | #xA; */\r\n\t\tcase '\\u0080':\r\n\t\t\tc = ' ';\r\n\t\tdefault:\r\n\t\t\tif(c<= ' '){//space\r\n\t\t\t\tswitch(s){\r\n\t\t\t\tcase S_TAG:\r\n\t\t\t\t\tel.setTagName(source.slice(start,p));//tagName\r\n\t\t\t\t\ts = S_TAG_SPACE;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase S_ATTR:\r\n\t\t\t\t\tattrName = source.slice(start,p)\r\n\t\t\t\t\ts = S_ATTR_SPACE;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase S_ATTR_NOQUOT_VALUE:\r\n\t\t\t\t\tvar value = source.slice(start,p).replace(/&#?\\w+;/g,entityReplacer);\r\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!!');\r\n\t\t\t\t\tel.add(attrName,value,start)\r\n\t\t\t\tcase S_ATTR_END:\r\n\t\t\t\t\ts = S_TAG_SPACE;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t//case S_TAG_SPACE:\r\n\t\t\t\t//case S_EQ:\r\n\t\t\t\t//case S_ATTR_SPACE:\r\n\t\t\t\t//\tvoid();break;\r\n\t\t\t\t//case S_TAG_CLOSE:\r\n\t\t\t\t\t//ignore warning\r\n\t\t\t\t}\r\n\t\t\t}else{//not space\r\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\r\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\r\n\t\t\t\tswitch(s){\r\n\t\t\t\t//case S_TAG:void();break;\r\n\t\t\t\t//case S_ATTR:void();break;\r\n\t\t\t\t//case S_ATTR_NOQUOT_VALUE:void();break;\r\n\t\t\t\tcase S_ATTR_SPACE:\r\n\t\t\t\t\tvar tagName = el.tagName;\r\n\t\t\t\t\tif(currentNSMap[''] !== 'http://www.w3.org/1999/xhtml' || !attrName.match(/^(?:disabled|checked|selected)$/i)){\r\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed value!! \"'+attrName+'\" instead2!!')\r\n\t\t\t\t\t}\r\n\t\t\t\t\tel.add(attrName,attrName,start);\r\n\t\t\t\t\tstart = p;\r\n\t\t\t\t\ts = S_ATTR;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase S_ATTR_END:\r\n\t\t\t\t\terrorHandler.warning('attribute space is required\"'+attrName+'\"!!')\r\n\t\t\t\tcase S_TAG_SPACE:\r\n\t\t\t\t\ts = S_ATTR;\r\n\t\t\t\t\tstart = p;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase S_EQ:\r\n\t\t\t\t\ts = S_ATTR_NOQUOT_VALUE;\r\n\t\t\t\t\tstart = p;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase S_TAG_CLOSE:\r\n\t\t\t\t\tthrow new Error(\"elements closed character '/' and '>' must be connected to\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}//end outer switch\r\n\t\t//console.log('p++',p)\r\n\t\tp++;\r\n\t}\r\n}\r\n/**\r\n * @return true if has new namespace define\r\n */\r\nfunction appendElement(el,domBuilder,currentNSMap){\r\n\tvar tagName = el.tagName;\r\n\tvar localNSMap = null;\r\n\t//var currentNSMap = parseStack[parseStack.length-1].currentNSMap;\r\n\tvar i = el.length;\r\n\twhile(i--){\r\n\t\tvar a = el[i];\r\n\t\tvar qName = a.qName;\r\n\t\tvar value = a.value;\r\n\t\tvar nsp = qName.indexOf(':');\r\n\t\tif(nsp>0){\r\n\t\t\tvar prefix = a.prefix = qName.slice(0,nsp);\r\n\t\t\tvar localName = qName.slice(nsp+1);\r\n\t\t\tvar nsPrefix = prefix === 'xmlns' && localName\r\n\t\t}else{\r\n\t\t\tlocalName = qName;\r\n\t\t\tprefix = null\r\n\t\t\tnsPrefix = qName === 'xmlns' && ''\r\n\t\t}\r\n\t\t//can not set prefix,because prefix !== ''\r\n\t\ta.localName = localName ;\r\n\t\t//prefix == null for no ns prefix attribute \r\n\t\tif(nsPrefix !== false){//hack!!\r\n\t\t\tif(localNSMap == null){\r\n\t\t\t\tlocalNSMap = {}\r\n\t\t\t\t//console.log(currentNSMap,0)\r\n\t\t\t\t_copy(currentNSMap,currentNSMap={})\r\n\t\t\t\t//console.log(currentNSMap,1)\r\n\t\t\t}\r\n\t\t\tcurrentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;\r\n\t\t\ta.uri = 'http://www.w3.org/2000/xmlns/'\r\n\t\t\tdomBuilder.startPrefixMapping(nsPrefix, value) \r\n\t\t}\r\n\t}\r\n\tvar i = el.length;\r\n\twhile(i--){\r\n\t\ta = el[i];\r\n\t\tvar prefix = a.prefix;\r\n\t\tif(prefix){//no prefix attribute has no namespace\r\n\t\t\tif(prefix === 'xml'){\r\n\t\t\t\ta.uri = 'http://www.w3.org/XML/1998/namespace';\r\n\t\t\t}if(prefix !== 'xmlns'){\r\n\t\t\t\ta.uri = currentNSMap[prefix || '']\r\n\t\t\t\t\r\n\t\t\t\t//{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\tvar nsp = tagName.indexOf(':');\r\n\tif(nsp>0){\r\n\t\tprefix = el.prefix = tagName.slice(0,nsp);\r\n\t\tlocalName = el.localName = tagName.slice(nsp+1);\r\n\t}else{\r\n\t\tprefix = null;//important!!\r\n\t\tlocalName = el.localName = tagName;\r\n\t}\r\n\t//no prefix element has default namespace\r\n\tvar ns = el.uri = currentNSMap[prefix || ''];\r\n\tdomBuilder.startElement(ns,localName,tagName,el);\r\n\t//endPrefixMapping and startPrefixMapping have not any help for dom builder\r\n\t//localNSMap = null\r\n\tif(el.closed){\r\n\t\tdomBuilder.endElement(ns,localName,tagName);\r\n\t\tif(localNSMap){\r\n\t\t\tfor(prefix in localNSMap){\r\n\t\t\t\tdomBuilder.endPrefixMapping(prefix) \r\n\t\t\t}\r\n\t\t}\r\n\t}else{\r\n\t\tel.currentNSMap = currentNSMap;\r\n\t\tel.localNSMap = localNSMap;\r\n\t\t//parseStack.push(el);\r\n\t\treturn true;\r\n\t}\r\n}\r\nfunction parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){\r\n\tif(/^(?:script|textarea)$/i.test(tagName)){\r\n\t\tvar elEndStart = source.indexOf('</'+tagName+'>',elStartEnd);\r\n\t\tvar text = source.substring(elStartEnd+1,elEndStart);\r\n\t\tif(/[&<]/.test(text)){\r\n\t\t\tif(/^script$/i.test(tagName)){\r\n\t\t\t\t//if(!/\\]\\]>/.test(text)){\r\n\t\t\t\t\t//lexHandler.startCDATA();\r\n\t\t\t\t\tdomBuilder.characters(text,0,text.length);\r\n\t\t\t\t\t//lexHandler.endCDATA();\r\n\t\t\t\t\treturn elEndStart;\r\n\t\t\t\t//}\r\n\t\t\t}//}else{//text area\r\n\t\t\t\ttext = text.replace(/&#?\\w+;/g,entityReplacer);\r\n\t\t\t\tdomBuilder.characters(text,0,text.length);\r\n\t\t\t\treturn elEndStart;\r\n\t\t\t//}\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\treturn elStartEnd+1;\r\n}\r\nfunction fixSelfClosed(source,elStartEnd,tagName,closeMap){\r\n\t//if(tagName in closeMap){\r\n\tvar pos = closeMap[tagName];\r\n\tif(pos == null){\r\n\t\t//console.log(tagName)\r\n\t\tpos = source.lastIndexOf('</'+tagName+'>')\r\n\t\tif(pos<elStartEnd){//忘记闭合\r\n\t\t\tpos = source.lastIndexOf('</'+tagName)\r\n\t\t}\r\n\t\tcloseMap[tagName] =pos\r\n\t}\r\n\treturn pos<elStartEnd;\r\n\t//} \r\n}\r\nfunction _copy(source,target){\r\n\tfor(var n in source){target[n] = source[n]}\r\n}\r\nfunction parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'\r\n\tvar next= source.charAt(start+2)\r\n\tswitch(next){\r\n\tcase '-':\r\n\t\tif(source.charAt(start + 3) === '-'){\r\n\t\t\tvar end = source.indexOf('-->',start+4);\r\n\t\t\t//append comment source.substring(4,end)//<!--\r\n\t\t\tif(end>start){\r\n\t\t\t\tdomBuilder.comment(source,start+4,end-start-4);\r\n\t\t\t\treturn end+3;\r\n\t\t\t}else{\r\n\t\t\t\terrorHandler.error(\"Unclosed comment\");\r\n\t\t\t\treturn -1;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t//error\r\n\t\t\treturn -1;\r\n\t\t}\r\n\tdefault:\r\n\t\tif(source.substr(start+3,6) == 'CDATA['){\r\n\t\t\tvar end = source.indexOf(']]>',start+9);\r\n\t\t\tdomBuilder.startCDATA();\r\n\t\t\tdomBuilder.characters(source,start+9,end-start-9);\r\n\t\t\tdomBuilder.endCDATA() \r\n\t\t\treturn end+3;\r\n\t\t}\r\n\t\t//<!DOCTYPE\r\n\t\t//startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId) \r\n\t\tvar matchs = split(source,start);\r\n\t\tvar len = matchs.length;\r\n\t\tif(len>1 && /!doctype/i.test(matchs[0][0])){\r\n\t\t\tvar name = matchs[1][0];\r\n\t\t\tvar pubid = len>3 && /^public$/i.test(matchs[2][0]) && matchs[3][0]\r\n\t\t\tvar sysid = len>4 && matchs[4][0];\r\n\t\t\tvar lastMatch = matchs[len-1]\r\n\t\t\tdomBuilder.startDTD(name,pubid && pubid.replace(/^(['\"])(.*?)\\1$/,'$2'),\r\n\t\t\t\t\tsysid && sysid.replace(/^(['\"])(.*?)\\1$/,'$2'));\r\n\t\t\tdomBuilder.endDTD();\r\n\t\t\t\r\n\t\t\treturn lastMatch.index+lastMatch[0].length\r\n\t\t}\r\n\t}\r\n\treturn -1;\r\n}\r\n\r\n\r\n\r\nfunction parseInstruction(source,start,domBuilder){\r\n\tvar end = source.indexOf('?>',start);\r\n\tif(end){\r\n\t\tvar match = source.substring(start,end).match(/^<\\?(\\S*)\\s*([\\s\\S]*?)\\s*$/);\r\n\t\tif(match){\r\n\t\t\tvar len = match[0].length;\r\n\t\t\tdomBuilder.processingInstruction(match[1], match[2]) ;\r\n\t\t\treturn end+2;\r\n\t\t}else{//error\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t}\r\n\treturn -1;\r\n}\r\n\r\n/**\r\n * @param source\r\n */\r\nfunction ElementAttributes(source){\r\n\t\r\n}\r\nElementAttributes.prototype = {\r\n\tsetTagName:function(tagName){\r\n\t\tif(!tagNamePattern.test(tagName)){\r\n\t\t\tthrow new Error('invalid tagName:'+tagName)\r\n\t\t}\r\n\t\tthis.tagName = tagName\r\n\t},\r\n\tadd:function(qName,value,offset){\r\n\t\tif(!tagNamePattern.test(qName)){\r\n\t\t\tthrow new Error('invalid attribute:'+qName)\r\n\t\t}\r\n\t\tthis[this.length++] = {qName:qName,value:value,offset:offset}\r\n\t},\r\n\tlength:0,\r\n\tgetLocalName:function(i){return this[i].localName},\r\n\tgetLocator:function(i){return this[i].locator},\r\n\tgetQName:function(i){return this[i].qName},\r\n\tgetURI:function(i){return this[i].uri},\r\n\tgetValue:function(i){return this[i].value}\r\n//\t,getIndex:function(uri, localName)){\r\n//\t\tif(localName){\r\n//\t\t\t\r\n//\t\t}else{\r\n//\t\t\tvar qName = uri\r\n//\t\t}\r\n//\t},\r\n//\tgetValue:function(){return this.getValue(this.getIndex.apply(this,arguments))},\r\n//\tgetType:function(uri,localName){}\r\n//\tgetType:function(i){},\r\n}\r\n\r\n\r\n\r\n\r\nfunction _set_proto_(thiz,parent){\r\n\tthiz.__proto__ = parent;\r\n\treturn thiz;\r\n}\r\nif(!(_set_proto_({},_set_proto_.prototype) instanceof _set_proto_)){\r\n\t_set_proto_ = function(thiz,parent){\r\n\t\tfunction p(){};\r\n\t\tp.prototype = parent;\r\n\t\tp = new p();\r\n\t\tfor(parent in thiz){\r\n\t\t\tp[parent] = thiz[parent];\r\n\t\t}\r\n\t\treturn p;\r\n\t}\r\n}\r\n\r\nfunction split(source,start){\r\n\tvar match;\r\n\tvar buf = [];\r\n\tvar reg = /'[^']+'|\"[^\"]+\"|[^\\s<>\\/=]+=?|(\\/?\\s*>|<)/g;\r\n\treg.lastIndex = start;\r\n\treg.exec(source);//skip <\r\n\twhile(match = reg.exec(source)){\r\n\t\tbuf.push(match);\r\n\t\tif(match[1])return buf;\r\n\t}\r\n}\r\n\r\nexports.XMLReader = XMLReader;\r\n\r\n","'use strict';\n\nvar defaults = require('./../defaults');\nvar utils = require('./../utils');\nvar InterceptorManager = require('./InterceptorManager');\nvar dispatchRequest = require('./dispatchRequest');\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n */\nfunction Axios(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n}\n\n/**\n * Dispatch a request\n *\n * @param {Object} config The config specific for this request (merged with this.defaults)\n */\nAxios.prototype.request = function request(config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof config === 'string') {\n config = utils.merge({\n url: arguments[0]\n }, arguments[1]);\n }\n\n config = utils.merge(defaults, {method: 'get'}, this.defaults, config);\n config.method = config.method.toLowerCase();\n\n // Hook up interceptors middleware\n var chain = [dispatchRequest, undefined];\n var promise = Promise.resolve(config);\n\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n chain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n chain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n while (chain.length) {\n promise = promise.then(chain.shift(), chain.shift());\n }\n\n return promise;\n};\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, data, config) {\n return this.request(utils.merge(config || {}, {\n method: method,\n url: url,\n data: data\n }));\n };\n});\n\nmodule.exports = Axios;\n","/*\r\n CryptoJS v3.1.2\r\n code.google.com/p/crypto-js\r\n (c) 2009-2013 by Jeff Mott. All rights reserved.\r\n code.google.com/p/crypto-js/wiki/License\r\n */\r\nvar CryptoJS=CryptoJS||function(g,l){var e={},d=e.lib={},m=function(){},k=d.Base={extend:function(a){m.prototype=this;var c=new m;a&&c.mixIn(a);c.hasOwnProperty(\"init\")||(c.init=function(){c.$super.init.apply(this,arguments)});c.init.prototype=c;c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty(\"toString\")&&(this.toString=a.toString)},clone:function(){return this.init.prototype.extend(this)}},\r\n p=d.WordArray=k.extend({init:function(a,c){a=this.words=a||[];this.sigBytes=c!=l?c:4*a.length},toString:function(a){return(a||n).stringify(this)},concat:function(a){var c=this.words,q=a.words,f=this.sigBytes;a=a.sigBytes;this.clamp();if(f%4)for(var b=0;b<a;b++)c[f+b>>>2]|=(q[b>>>2]>>>24-8*(b%4)&255)<<24-8*((f+b)%4);else if(65535<q.length)for(b=0;b<a;b+=4)c[f+b>>>2]=q[b>>>2];else c.push.apply(c,q);this.sigBytes+=a;return this},clamp:function(){var a=this.words,c=this.sigBytes;a[c>>>2]&=4294967295<<\r\n 32-8*(c%4);a.length=g.ceil(c/4)},clone:function(){var a=k.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var c=[],b=0;b<a;b+=4)c.push(4294967296*g.random()|0);return new p.init(c,a)}}),b=e.enc={},n=b.Hex={stringify:function(a){var c=a.words;a=a.sigBytes;for(var b=[],f=0;f<a;f++){var d=c[f>>>2]>>>24-8*(f%4)&255;b.push((d>>>4).toString(16));b.push((d&15).toString(16))}return b.join(\"\")},parse:function(a){for(var c=a.length,b=[],f=0;f<c;f+=2)b[f>>>3]|=parseInt(a.substr(f,\r\n 2),16)<<24-4*(f%8);return new p.init(b,c/2)}},j=b.Latin1={stringify:function(a){var c=a.words;a=a.sigBytes;for(var b=[],f=0;f<a;f++)b.push(String.fromCharCode(c[f>>>2]>>>24-8*(f%4)&255));return b.join(\"\")},parse:function(a){for(var c=a.length,b=[],f=0;f<c;f++)b[f>>>2]|=(a.charCodeAt(f)&255)<<24-8*(f%4);return new p.init(b,c)}},h=b.Utf8={stringify:function(a){try{return decodeURIComponent(escape(j.stringify(a)))}catch(c){throw Error(\"Malformed UTF-8 data\");}},parse:function(a){return j.parse(unescape(encodeURIComponent(a)))}},\r\n r=d.BufferedBlockAlgorithm=k.extend({reset:function(){this._data=new p.init;this._nDataBytes=0},_append:function(a){\"string\"==typeof a&&(a=h.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var c=this._data,b=c.words,f=c.sigBytes,d=this.blockSize,e=f/(4*d),e=a?g.ceil(e):g.max((e|0)-this._minBufferSize,0);a=e*d;f=g.min(4*a,f);if(a){for(var k=0;k<a;k+=d)this._doProcessBlock(b,k);k=b.splice(0,a);c.sigBytes-=f}return new p.init(k,f)},clone:function(){var a=k.clone.call(this);\r\n a._data=this._data.clone();return a},_minBufferSize:0});d.Hasher=r.extend({cfg:k.extend(),init:function(a){this.cfg=this.cfg.extend(a);this.reset()},reset:function(){r.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);return this._doFinalize()},blockSize:16,_createHelper:function(a){return function(b,d){return(new a.init(d)).finalize(b)}},_createHmacHelper:function(a){return function(b,d){return(new s.HMAC.init(a,\r\n d)).finalize(b)}}});var s=e.algo={};return e}(Math);\r\n(function(){var g=CryptoJS,l=g.lib,e=l.WordArray,d=l.Hasher,m=[],l=g.algo.SHA1=d.extend({_doReset:function(){this._hash=new e.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(d,e){for(var b=this._hash.words,n=b[0],j=b[1],h=b[2],g=b[3],l=b[4],a=0;80>a;a++){if(16>a)m[a]=d[e+a]|0;else{var c=m[a-3]^m[a-8]^m[a-14]^m[a-16];m[a]=c<<1|c>>>31}c=(n<<5|n>>>27)+l+m[a];c=20>a?c+((j&h|~j&g)+1518500249):40>a?c+((j^h^g)+1859775393):60>a?c+((j&h|j&g|h&g)-1894007588):c+((j^h^\r\ng)-899497514);l=g;g=h;h=j<<30|j>>>2;j=n;n=c}b[0]=b[0]+n|0;b[1]=b[1]+j|0;b[2]=b[2]+h|0;b[3]=b[3]+g|0;b[4]=b[4]+l|0},_doFinalize:function(){var d=this._data,e=d.words,b=8*this._nDataBytes,g=8*d.sigBytes;e[g>>>5]|=128<<24-g%32;e[(g+64>>>9<<4)+14]=Math.floor(b/4294967296);e[(g+64>>>9<<4)+15]=b;d.sigBytes=4*e.length;this._process();return this._hash},clone:function(){var e=d.clone.call(this);e._hash=this._hash.clone();return e}});g.SHA1=d._createHelper(l);g.HmacSHA1=d._createHmacHelper(l)})();\r\n(function(){var g=CryptoJS,l=g.enc.Utf8;g.algo.HMAC=g.lib.Base.extend({init:function(e,d){e=this._hasher=new e.init;\"string\"==typeof d&&(d=l.parse(d));var g=e.blockSize,k=4*g;d.sigBytes>k&&(d=e.finalize(d));d.clamp();for(var p=this._oKey=d.clone(),b=this._iKey=d.clone(),n=p.words,j=b.words,h=0;h<g;h++)n[h]^=1549556828,j[h]^=909522486;p.sigBytes=b.sigBytes=k;this.reset()},reset:function(){var e=this._hasher;e.reset();e.update(this._iKey)},update:function(e){this._hasher.update(e);return this},finalize:function(e){var d=\r\n this._hasher;e=d.finalize(e);d.reset();return d.finalize(this._oKey.clone().concat(e))}})})();\r\n\r\n\r\n(function () {\r\n // Shortcuts\r\n var C = CryptoJS;\r\n var C_lib = C.lib;\r\n var WordArray = C_lib.WordArray;\r\n var C_enc = C.enc;\r\n\r\n /**\r\n * Base64 encoding strategy.\r\n */\r\n var Base64 = C_enc.Base64 = {\r\n /**\r\n * Converts a word array to a Base64 string.\r\n *\r\n * @param {WordArray} wordArray The word array.\r\n *\r\n * @return {string} The Base64 string.\r\n *\r\n * @static\r\n *\r\n * @example\r\n *\r\n * var base64String = CryptoJS.enc.Base64.stringify(wordArray);\r\n */\r\n stringify: function (wordArray) {\r\n // Shortcuts\r\n var words = wordArray.words;\r\n var sigBytes = wordArray.sigBytes;\r\n var map = this._map;\r\n\r\n // Clamp excess bits\r\n wordArray.clamp();\r\n\r\n // Convert\r\n var base64Chars = [];\r\n for (var i = 0; i < sigBytes; i += 3) {\r\n var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;\r\n var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;\r\n var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;\r\n\r\n var triplet = (byte1 << 16) | (byte2 << 8) | byte3;\r\n\r\n for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {\r\n base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));\r\n }\r\n }\r\n\r\n // Add padding\r\n var paddingChar = map.charAt(64);\r\n if (paddingChar) {\r\n while (base64Chars.length % 4) {\r\n base64Chars.push(paddingChar);\r\n }\r\n }\r\n\r\n return base64Chars.join('');\r\n },\r\n\r\n /**\r\n * Converts a Base64 string to a word array.\r\n *\r\n * @param {string} base64Str The Base64 string.\r\n *\r\n * @return {WordArray} The word array.\r\n *\r\n * @static\r\n *\r\n * @example\r\n *\r\n * var wordArray = CryptoJS.enc.Base64.parse(base64String);\r\n */\r\n parse: function (base64Str) {\r\n // Shortcuts\r\n var base64StrLength = base64Str.length;\r\n var map = this._map;\r\n\r\n // Ignore padding\r\n var paddingChar = map.charAt(64);\r\n if (paddingChar) {\r\n var paddingIndex = base64Str.indexOf(paddingChar);\r\n if (paddingIndex != -1) {\r\n base64StrLength = paddingIndex;\r\n }\r\n }\r\n\r\n // Convert\r\n var words = [];\r\n var nBytes = 0;\r\n for (var i = 0; i < base64StrLength; i++) {\r\n if (i % 4) {\r\n var bits1 = map.indexOf(base64Str.charAt(i - 1)) << ((i % 4) * 2);\r\n var bits2 = map.indexOf(base64Str.charAt(i)) >>> (6 - (i % 4) * 2);\r\n words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8);\r\n nBytes++;\r\n }\r\n }\r\n\r\n return WordArray.create(words, nBytes);\r\n },\r\n\r\n _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\r\n };\r\n}());\r\n\r\nif(typeof module === 'object'){\r\n module.exports = CryptoJS;\r\n}else{\r\n window.CryptoJS = CryptoJS;\r\n}\r\n","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","var session = require('./session');\r\nvar util = require('./util');\r\n\r\nvar originApiMap = {};\r\nvar transferToTaskMethod = function (apiMap, apiName) {\r\n originApiMap[apiName] = apiMap[apiName];\r\n apiMap[apiName] = function (params, callback) {\r\n if (params.SkipTask) {\r\n originApiMap[apiName].call(this, params, callback);\r\n } else {\r\n this._addTask(apiName, params, callback);\r\n }\r\n };\r\n};\r\n\r\nvar initTask = function (cos) {\r\n\r\n var queue = [];\r\n var tasks = {};\r\n var uploadingFileCount = 0;\r\n var nextUploadIndex = 0;\r\n\r\n // 接口返回简略的任务信息\r\n var formatTask = function (task) {\r\n var t = {\r\n id: task.id,\r\n Bucket: task.Bucket,\r\n Region: task.Region,\r\n Key: task.Key,\r\n FilePath: task.FilePath,\r\n state: task.state,\r\n loaded: task.loaded,\r\n size: task.size,\r\n speed: task.speed,\r\n percent: task.percent,\r\n hashPercent: task.hashPercent,\r\n error: task.error,\r\n };\r\n if (task.FilePath) t.FilePath = task.FilePath;\r\n if (task._custom) t._custom = task._custom;\r\n return t;\r\n };\r\n\r\n var emitListUpdate = (function () {\r\n var timer;\r\n var emit = function () {\r\n timer = 0;\r\n cos.emit('task-list-update', {list: util.map(queue, formatTask)});\r\n cos.emit('list-update', {list: util.map(queue, formatTask)});\r\n };\r\n return function () {\r\n if (!timer) timer = setTimeout(emit);\r\n }\r\n })();\r\n\r\n var clearQueue = function () {\r\n if (queue.length <= cos.options.UploadQueueSize) return;\r\n for (var i = 0;\r\n i < nextUploadIndex && // 小于当前操作的 index 才清理\r\n i < queue.length && // 大于队列才清理\r\n queue.length > cos.options.UploadQueueSize // 如果还太多,才继续清理\r\n ;) {\r\n var isActive = queue[i].state === 'waiting' || queue[i].state === 'checking' || queue[i].state === 'uploading';\r\n if (!queue[i] || !isActive) {\r\n tasks[queue[i].id] && (delete tasks[queue[i].id]);\r\n queue.splice(i, 1);\r\n nextUploadIndex--;\r\n } else {\r\n i++;\r\n }\r\n }\r\n emitListUpdate();\r\n };\r\n\r\n var startNextTask = function () {\r\n // 检查是否允许增加执行进程\r\n if (uploadingFileCount >= cos.options.FileParallelLimit) return;\r\n // 跳过不可执行的任务\r\n while (queue[nextUploadIndex] && queue[nextUploadIndex].state !== 'waiting') nextUploadIndex++;\r\n // 检查是否已遍历结束\r\n if (nextUploadIndex >= queue.length) return;\r\n // 上传该遍历到的任务\r\n var task = queue[nextUploadIndex];\r\n nextUploadIndex++;\r\n uploadingFileCount++;\r\n task.state = 'checking';\r\n task.params.onTaskStart && task.params.onTaskStart(formatTask(task));\r\n !task.params.UploadData && (task.params.UploadData = {});\r\n var apiParams = util.formatParams(task.api, task.params);\r\n originApiMap[task.api].call(cos, apiParams, function (err, data) {\r\n if (!cos._isRunningTask(task.id)) return;\r\n if (task.state === 'checking' || task.state === 'uploading') {\r\n task.state = err ? 'error' : 'success';\r\n err && (task.error = err);\r\n uploadingFileCount--;\r\n emitListUpdate();\r\n startNextTask();\r\n task.callback && task.callback(err, data);\r\n if (task.state === 'success') {\r\n if (task.params) {\r\n delete task.params.UploadData;\r\n delete task.params.Body;\r\n delete task.params;\r\n }\r\n delete task.callback;\r\n }\r\n }\r\n clearQueue();\r\n });\r\n emitListUpdate();\r\n // 异步执行下一个任务\r\n setTimeout(startNextTask);\r\n };\r\n\r\n var killTask = function (id, switchToState) {\r\n var task = tasks[id];\r\n if (!task) return;\r\n var waiting = task && task.state === 'waiting';\r\n var running = task && (task.state === 'checking' || task.state === 'uploading');\r\n if (switchToState === 'canceled' && task.state !== 'canceled' ||\r\n switchToState === 'paused' && waiting ||\r\n switchToState === 'paused' && running) {\r\n if (switchToState === 'paused' && task.params.Body && typeof task.params.Body.pipe === 'function') {\r\n console.error('stream not support pause');\r\n return;\r\n }\r\n task.state = switchToState;\r\n cos.emit('inner-kill-task', {TaskId: id, toState: switchToState});\r\n try {\r\n var UploadId = task && task.params && task.params.UploadData.UploadId\r\n } catch(e) {}\r\n if (switchToState === 'canceled' && UploadId) session.removeUsing(UploadId)\r\n emitListUpdate();\r\n if (running) {\r\n uploadingFileCount--;\r\n startNextTask();\r\n }\r\n if (switchToState === 'canceled') {\r\n if (task.params) {\r\n delete task.params.UploadData;\r\n delete task.params.Body;\r\n delete task.params;\r\n }\r\n delete task.callback;\r\n }\r\n }\r\n clearQueue();\r\n };\r\n\r\n cos._addTasks = function (taskList) {\r\n util.each(taskList, function (task) {\r\n cos._addTask(task.api, task.params, task.callback, true);\r\n });\r\n emitListUpdate();\r\n };\r\n\r\n var isTaskReadyWarning = true;\r\n cos._addTask = function (api, params, callback, ignoreAddEvent) {\r\n\r\n // 复制参数对象\r\n params = util.formatParams(api, params);\r\n\r\n // 生成 id\r\n var id = util.uuid();\r\n params.TaskId = id;\r\n params.onTaskReady && params.onTaskReady(id);\r\n if (params.TaskReady) {\r\n params.TaskReady(id);\r\n isTaskReadyWarning && console.warn('warning: Param \"TaskReady\" has been deprecated. Please use \"onTaskReady\" instead.');\r\n isTaskReadyWarning = false;\r\n }\r\n\r\n var task = {\r\n // env\r\n params: params,\r\n callback: callback,\r\n api: api,\r\n index: queue.length,\r\n // task\r\n id: id,\r\n Bucket: params.Bucket,\r\n Region: params.Region,\r\n Key: params.Key,\r\n FilePath: params.FilePath || '',\r\n state: 'waiting',\r\n loaded: 0,\r\n size: 0,\r\n speed: 0,\r\n percent: 0,\r\n hashPercent: 0,\r\n error: null,\r\n _custom: params._custom,\r\n };\r\n var onHashProgress = params.onHashProgress;\r\n params.onHashProgress = function (info) {\r\n if (!cos._isRunningTask(task.id)) return;\r\n task.hashPercent = info.percent;\r\n onHashProgress && onHashProgress(info);\r\n emitListUpdate();\r\n };\r\n var onProgress = params.onProgress;\r\n params.onProgress = function (info) {\r\n if (!cos._isRunningTask(task.id)) return;\r\n task.state === 'checking' && (task.state = 'uploading');\r\n task.loaded = info.loaded;\r\n task.speed = info.speed;\r\n task.percent = info.percent;\r\n onProgress && onProgress(info);\r\n emitListUpdate();\r\n };\r\n\r\n // 异步获取 filesize\r\n util.getFileSize(api, params, function (err, size) {\r\n // 开始处理上传\r\n if (err) { // 如果获取大小出错,不加入队列\r\n callback(err);\r\n return;\r\n }\r\n // 获取完文件大小再把任务加入队列\r\n tasks[id] = task;\r\n queue.push(task);\r\n task.size = size;\r\n !ignoreAddEvent && emitListUpdate();\r\n startNextTask();\r\n clearQueue();\r\n });\r\n return id;\r\n };\r\n cos._isRunningTask = function (id) {\r\n var task = tasks[id];\r\n return !!(task && (task.state === 'checking' || task.state === 'uploading'));\r\n };\r\n cos.getTaskList = function () {\r\n return util.map(queue, formatTask);\r\n };\r\n cos.cancelTask = function (id) {\r\n killTask(id, 'canceled');\r\n };\r\n cos.pauseTask = function (id) {\r\n killTask(id, 'paused');\r\n };\r\n cos.restartTask = function (id) {\r\n var task = tasks[id];\r\n if (task && (task.state === 'paused' || task.state === 'error')) {\r\n task.state = 'waiting';\r\n emitListUpdate();\r\n nextUploadIndex = Math.min(nextUploadIndex, task.index);\r\n startNextTask();\r\n }\r\n };\r\n cos.isUploadRunning = function () {\r\n return uploadingFileCount || nextUploadIndex < queue.length;\r\n };\r\n\r\n};\r\n\r\nmodule.exports.transferToTaskMethod = transferToTaskMethod;\r\nmodule.exports.init = initTask;\r\n","'use strict';\n\nvar utils = require('./../utils');\n\n// Headers whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nvar ignoreDuplicateOf = [\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n];\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} headers Headers needing to be parsed\n * @returns {Object} Headers parsed into an object\n */\nmodule.exports = function parseHeaders(headers) {\n var parsed = {};\n var key;\n var val;\n var i;\n\n if (!headers) { return parsed; }\n\n utils.forEach(headers.split('\\n'), function parser(line) {\n i = line.indexOf(':');\n key = utils.trim(line.substr(0, i)).toLowerCase();\n val = utils.trim(line.substr(i + 1));\n\n if (key) {\n if (parsed[key] && ignoreDuplicateOf.indexOf(key) >= 0) {\n return;\n }\n if (key === 'set-cookie') {\n parsed[key] = (parsed[key] ? parsed[key] : []).concat([val]);\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n }\n });\n\n return parsed;\n};\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n * @returns {string} The combined URL\n */\nmodule.exports = function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/+$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n};\n","// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n'use strict';\n\nvar R = typeof Reflect === 'object' ? Reflect : null\nvar ReflectApply = R && typeof R.apply === 'function'\n ? R.apply\n : function ReflectApply(target, receiver, args) {\n return Function.prototype.apply.call(target, receiver, args);\n }\n\nvar ReflectOwnKeys\nif (R && typeof R.ownKeys === 'function') {\n ReflectOwnKeys = R.ownKeys\n} else if (Object.getOwnPropertySymbols) {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target)\n .concat(Object.getOwnPropertySymbols(target));\n };\n} else {\n ReflectOwnKeys = function ReflectOwnKeys(target) {\n return Object.getOwnPropertyNames(target);\n };\n}\n\nfunction ProcessEmitWarning(warning) {\n if (console && console.warn) console.warn(warning);\n}\n\nvar NumberIsNaN = Number.isNaN || function NumberIsNaN(value) {\n return value !== value;\n}\n\nfunction EventEmitter() {\n EventEmitter.init.call(this);\n}\nmodule.exports = EventEmitter;\nmodule.exports.once = once;\n\n// Backwards-compat with node 0.10.x\nEventEmitter.EventEmitter = EventEmitter;\n\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._eventsCount = 0;\nEventEmitter.prototype._maxListeners = undefined;\n\n// By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\nvar defaultMaxListeners = 10;\n\nfunction checkListener(listener) {\n if (typeof listener !== 'function') {\n throw new TypeError('The \"listener\" argument must be of type Function. Received type ' + typeof listener);\n }\n}\n\nObject.defineProperty(EventEmitter, 'defaultMaxListeners', {\n enumerable: true,\n get: function() {\n return defaultMaxListeners;\n },\n set: function(arg) {\n if (typeof arg !== 'number' || arg < 0 || NumberIsNaN(arg)) {\n throw new RangeError('The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received ' + arg + '.');\n }\n defaultMaxListeners = arg;\n }\n});\n\nEventEmitter.init = function() {\n\n if (this._events === undefined ||\n this._events === Object.getPrototypeOf(this)._events) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n }\n\n this._maxListeners = this._maxListeners || undefined;\n};\n\n// Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\nEventEmitter.prototype.setMaxListeners = function setMaxListeners(n) {\n if (typeof n !== 'number' || n < 0 || NumberIsNaN(n)) {\n throw new RangeError('The value of \"n\" is out of range. It must be a non-negative number. Received ' + n + '.');\n }\n this._maxListeners = n;\n return this;\n};\n\nfunction _getMaxListeners(that) {\n if (that._maxListeners === undefined)\n return EventEmitter.defaultMaxListeners;\n return that._maxListeners;\n}\n\nEventEmitter.prototype.getMaxListeners = function getMaxListeners() {\n return _getMaxListeners(this);\n};\n\nEventEmitter.prototype.emit = function emit(type) {\n var args = [];\n for (var i = 1; i < arguments.length; i++) args.push(arguments[i]);\n var doError = (type === 'error');\n\n var events = this._events;\n if (events !== undefined)\n doError = (doError && events.error === undefined);\n else if (!doError)\n return false;\n\n // If there is no 'error' event listener then throw.\n if (doError) {\n var er;\n if (args.length > 0)\n er = args[0];\n if (er instanceof Error) {\n // Note: The comments on the `throw` lines are intentional, they show\n // up in Node's output if this results in an unhandled exception.\n throw er; // Unhandled 'error' event\n }\n // At least give some kind of context to the user\n var err = new Error('Unhandled error.' + (er ? ' (' + er.message + ')' : ''));\n err.context = er;\n throw err; // Unhandled 'error' event\n }\n\n var handler = events[type];\n\n if (handler === undefined)\n return false;\n\n if (typeof handler === 'function') {\n ReflectApply(handler, this, args);\n } else {\n var len = handler.length;\n var listeners = arrayClone(handler, len);\n for (var i = 0; i < len; ++i)\n ReflectApply(listeners[i], this, args);\n }\n\n return true;\n};\n\nfunction _addListener(target, type, listener, prepend) {\n var m;\n var events;\n var existing;\n\n checkListener(listener);\n\n events = target._events;\n if (events === undefined) {\n events = target._events = Object.create(null);\n target._eventsCount = 0;\n } else {\n // To avoid recursion in the case that type === \"newListener\"! Before\n // adding it to the listeners, first emit \"newListener\".\n if (events.newListener !== undefined) {\n target.emit('newListener', type,\n listener.listener ? listener.listener : listener);\n\n // Re-assign `events` because a newListener handler could have caused the\n // this._events to be assigned to a new object\n events = target._events;\n }\n existing = events[type];\n }\n\n if (existing === undefined) {\n // Optimize the case of one listener. Don't need the extra array object.\n existing = events[type] = listener;\n ++target._eventsCount;\n } else {\n if (typeof existing === 'function') {\n // Adding the second element, need to change to array.\n existing = events[type] =\n prepend ? [listener, existing] : [existing, listener];\n // If we've already got an array, just append.\n } else if (prepend) {\n existing.unshift(listener);\n } else {\n existing.push(listener);\n }\n\n // Check for listener leak\n m = _getMaxListeners(target);\n if (m > 0 && existing.length > m && !existing.warned) {\n existing.warned = true;\n // No error code for this since it is a Warning\n // eslint-disable-next-line no-restricted-syntax\n var w = new Error('Possible EventEmitter memory leak detected. ' +\n existing.length + ' ' + String(type) + ' listeners ' +\n 'added. Use emitter.setMaxListeners() to ' +\n 'increase limit');\n w.name = 'MaxListenersExceededWarning';\n w.emitter = target;\n w.type = type;\n w.count = existing.length;\n ProcessEmitWarning(w);\n }\n }\n\n return target;\n}\n\nEventEmitter.prototype.addListener = function addListener(type, listener) {\n return _addListener(this, type, listener, false);\n};\n\nEventEmitter.prototype.on = EventEmitter.prototype.addListener;\n\nEventEmitter.prototype.prependListener =\n function prependListener(type, listener) {\n return _addListener(this, type, listener, true);\n };\n\nfunction onceWrapper() {\n if (!this.fired) {\n this.target.removeListener(this.type, this.wrapFn);\n this.fired = true;\n if (arguments.length === 0)\n return this.listener.call(this.target);\n return this.listener.apply(this.target, arguments);\n }\n}\n\nfunction _onceWrap(target, type, listener) {\n var state = { fired: false, wrapFn: undefined, target: target, type: type, listener: listener };\n var wrapped = onceWrapper.bind(state);\n wrapped.listener = listener;\n state.wrapFn = wrapped;\n return wrapped;\n}\n\nEventEmitter.prototype.once = function once(type, listener) {\n checkListener(listener);\n this.on(type, _onceWrap(this, type, listener));\n return this;\n};\n\nEventEmitter.prototype.prependOnceListener =\n function prependOnceListener(type, listener) {\n checkListener(listener);\n this.prependListener(type, _onceWrap(this, type, listener));\n return this;\n };\n\n// Emits a 'removeListener' event if and only if the listener was removed.\nEventEmitter.prototype.removeListener =\n function removeListener(type, listener) {\n var list, events, position, i, originalListener;\n\n checkListener(listener);\n\n events = this._events;\n if (events === undefined)\n return this;\n\n list = events[type];\n if (list === undefined)\n return this;\n\n if (list === listener || list.listener === listener) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else {\n delete events[type];\n if (events.removeListener)\n this.emit('removeListener', type, list.listener || listener);\n }\n } else if (typeof list !== 'function') {\n position = -1;\n\n for (i = list.length - 1; i >= 0; i--) {\n if (list[i] === listener || list[i].listener === listener) {\n originalListener = list[i].listener;\n position = i;\n break;\n }\n }\n\n if (position < 0)\n return this;\n\n if (position === 0)\n list.shift();\n else {\n spliceOne(list, position);\n }\n\n if (list.length === 1)\n events[type] = list[0];\n\n if (events.removeListener !== undefined)\n this.emit('removeListener', type, originalListener || listener);\n }\n\n return this;\n };\n\nEventEmitter.prototype.off = EventEmitter.prototype.removeListener;\n\nEventEmitter.prototype.removeAllListeners =\n function removeAllListeners(type) {\n var listeners, events, i;\n\n events = this._events;\n if (events === undefined)\n return this;\n\n // not listening for removeListener, no need to emit\n if (events.removeListener === undefined) {\n if (arguments.length === 0) {\n this._events = Object.create(null);\n this._eventsCount = 0;\n } else if (events[type] !== undefined) {\n if (--this._eventsCount === 0)\n this._events = Object.create(null);\n else\n delete events[type];\n }\n return this;\n }\n\n // emit removeListener for all listeners on all events\n if (arguments.length === 0) {\n var keys = Object.keys(events);\n var key;\n for (i = 0; i < keys.length; ++i) {\n key = keys[i];\n if (key === 'removeListener') continue;\n this.removeAllListeners(key);\n }\n this.removeAllListeners('removeListener');\n this._events = Object.create(null);\n this._eventsCount = 0;\n return this;\n }\n\n listeners = events[type];\n\n if (typeof listeners === 'function') {\n this.removeListener(type, listeners);\n } else if (listeners !== undefined) {\n // LIFO order\n for (i = listeners.length - 1; i >= 0; i--) {\n this.removeListener(type, listeners[i]);\n }\n }\n\n return this;\n };\n\nfunction _listeners(target, type, unwrap) {\n var events = target._events;\n\n if (events === undefined)\n return [];\n\n var evlistener = events[type];\n if (evlistener === undefined)\n return [];\n\n if (typeof evlistener === 'function')\n return unwrap ? [evlistener.listener || evlistener] : [evlistener];\n\n return unwrap ?\n unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);\n}\n\nEventEmitter.prototype.listeners = function listeners(type) {\n return _listeners(this, type, true);\n};\n\nEventEmitter.prototype.rawListeners = function rawListeners(type) {\n return _listeners(this, type, false);\n};\n\nEventEmitter.listenerCount = function(emitter, type) {\n if (typeof emitter.listenerCount === 'function') {\n return emitter.listenerCount(type);\n } else {\n return listenerCount.call(emitter, type);\n }\n};\n\nEventEmitter.prototype.listenerCount = listenerCount;\nfunction listenerCount(type) {\n var events = this._events;\n\n if (events !== undefined) {\n var evlistener = events[type];\n\n if (typeof evlistener === 'function') {\n return 1;\n } else if (evlistener !== undefined) {\n return evlistener.length;\n }\n }\n\n return 0;\n}\n\nEventEmitter.prototype.eventNames = function eventNames() {\n return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];\n};\n\nfunction arrayClone(arr, n) {\n var copy = new Array(n);\n for (var i = 0; i < n; ++i)\n copy[i] = arr[i];\n return copy;\n}\n\nfunction spliceOne(list, index) {\n for (; index + 1 < list.length; index++)\n list[index] = list[index + 1];\n list.pop();\n}\n\nfunction unwrapListeners(arr) {\n var ret = new Array(arr.length);\n for (var i = 0; i < ret.length; ++i) {\n ret[i] = arr[i].listener || arr[i];\n }\n return ret;\n}\n\nfunction once(emitter, name) {\n return new Promise(function (resolve, reject) {\n function eventListener() {\n if (errorListener !== undefined) {\n emitter.removeListener('error', errorListener);\n }\n resolve([].slice.call(arguments));\n };\n var errorListener;\n\n // Adding an error listener is not optional because\n // if an error is thrown on an event emitter we cannot\n // guarantee that the actual event we are waiting will\n // be fired. The result could be a silent way to create\n // memory or file descriptor leaks, which is something\n // we should avoid.\n if (name !== 'error') {\n errorListener = function errorListener(err) {\n emitter.removeListener(name, eventListener);\n reject(err);\n };\n\n emitter.once('error', errorListener);\n }\n\n emitter.once(name, eventListener);\n });\n}\n"],"sourceRoot":""} |