From 7f82db218a2d6389338e4530a57cb1f3ac475cb5 Mon Sep 17 00:00:00 2001 From: carsonxu Date: Thu, 17 Dec 2020 18:52:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E6=AD=A3=20Location=20=E6=A0=BC?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/cos-js-sdk-v5.js | 2 +- dist/cos-js-sdk-v5.min.js | 2 +- src/base.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/cos-js-sdk-v5.js b/dist/cos-js-sdk-v5.js index 8cf657b..f5fe6d0 100644 --- a/dist/cos-js-sdk-v5.js +++ b/dist/cos-js-sdk-v5.js @@ -7367,7 +7367,7 @@ function multipartComplete(params, callback) { res.UploadResult = { OriginalInfo: { Key: res.Key, - Location: res.Location, + Location: url, ETag: res.ETag, ImageInfo: res.ImageInfo }, diff --git a/dist/cos-js-sdk-v5.min.js b/dist/cos-js-sdk-v5.min.js index b38a203..974ed47 100644 --- a/dist/cos-js-sdk-v5.min.js +++ b/dist/cos-js-sdk-v5.min.js @@ -1 +1 @@ -!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.COS=t():e.COS=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(o){if(n[o])return n[o].exports;var r=n[o]={i:o,l:!1,exports:{}};return e[o].call(r.exports,r,r.exports,t),r.l=!0,r.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,o){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:o})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/dist/",t(t.s=5)}([function(e,t,n){"use strict";(function(t){function o(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function r(e){return d(e,function(e){return"object"==typeof e&&null!==e?r(e):e})}function i(e,t,n){return e&&t in e?e[t]:n}function a(e,t){return l(t,function(n,o){e[o]=t[o]}),e}function s(e){return e instanceof Array}function c(e,t){for(var n=!1,o=0;ot?1:-1})},f=function(e){var t,n,r,i=[],a=d(e);for(t=0;tparseInt(t[n])?1:-1;return 0};return function(t){var n=(t.match(/Chrome\/([.\d]+)/)||[])[1],o=(t.match(/QBCore\/([.\d]+)/)||[])[1],r=(t.match(/QQBrowser\/([.\d]+)/)||[])[1];return n&&e(n,"53.0.2785.116")<0&&o&&e(o,"3.53.991.400")<0&&r&&e(r,"9.0.2524.400")<=0||!1}(navigator&&navigator.userAgent)}(),S=function(e,t,n,o,r){var i;if(e.slice?i=e.slice(t,n):e.mozSlice?i=e.mozSlice(t,n):e.webkitSlice&&(i=e.webkitSlice(t,n)),o&&R){var a=new FileReader;a.onload=function(e){i=null,r(new Blob([a.result]))},a.readAsArrayBuffer(i)}else r(i)},A=function(e,t,n,o){n=n||C,e?"string"==typeof t?n(D.md5(t,!0)):Blob&&t instanceof Blob?D.getFileMd5(t,function(e,t){n(t)},o):n():n()},b=function(e,t,n){var o=e.size,r=0,i=h.getCtx(),a=function(s){if(s>=o){var c=i.digest("hex");return void t(null,c)}var u=Math.min(o,s+1048576);D.fileSlice(e,s,u,!1,function(e){k(e,function(t){e=null,i=i.update(t,!0),r+=t.length,t=null,n&&n({loaded:r,total:o,percent:Math.round(r/o*1e4)/1e4}),a(s+1048576)})})};a(0)},B=function(e){var t,n,o,r="";for(t=0,n=e.length/2;t-1||"deleteMultipleObject"===e||"multipartList"===e||"listObjectVersions"===e){if(!n)return"Bucket";if(!o)return"Region"}else if(e.indexOf("Object")>-1||e.indexOf("multipart")>-1||"sliceUploadFile"===e||"abortUploadTask"===e){if(!n)return"Bucket";if(!o)return"Region";if(!r)return"Key"}return!1},E=function(e,t){if(t=a({},t),"getAuth"!==e&&"getV4Auth"!==e&&"getObjectUrl"!==e){var n=t.Headers||{};if(t&&"object"==typeof t){!function(){for(var e in t)t.hasOwnProperty(e)&&e.indexOf("x-cos-")>-1&&(n[e]=t[e])}();var o={"x-cos-mfa":"MFA","Content-MD5":"ContentMD5","Content-Length":"ContentLength","Content-Type":"ContentType",Expect:"Expect",Expires:"Expires","Cache-Control":"CacheControl","Content-Disposition":"ContentDisposition","Content-Encoding":"ContentEncoding",Range:"Range","If-Modified-Since":"IfModifiedSince","If-Unmodified-Since":"IfUnmodifiedSince","If-Match":"IfMatch","If-None-Match":"IfNoneMatch","x-cos-copy-source":"CopySource","x-cos-copy-source-Range":"CopySourceRange","x-cos-metadata-directive":"MetadataDirective","x-cos-copy-source-If-Modified-Since":"CopySourceIfModifiedSince","x-cos-copy-source-If-Unmodified-Since":"CopySourceIfUnmodifiedSince","x-cos-copy-source-If-Match":"CopySourceIfMatch","x-cos-copy-source-If-None-Match":"CopySourceIfNoneMatch","x-cos-acl":"ACL","x-cos-grant-read":"GrantRead","x-cos-grant-write":"GrantWrite","x-cos-grant-full-control":"GrantFullControl","x-cos-grant-read-acp":"GrantReadAcp","x-cos-grant-write-acp":"GrantWriteAcp","x-cos-storage-class":"StorageClass","x-cos-server-side-encryption-customer-algorithm":"SSECustomerAlgorithm","x-cos-server-side-encryption-customer-key":"SSECustomerKey","x-cos-server-side-encryption-customer-key-MD5":"SSECustomerKeyMD5","x-cos-server-side-encryption":"ServerSideEncryption","x-cos-server-side-encryption-cos-kms-key-id":"SSEKMSKeyId","x-cos-server-side-encryption-context":"SSEContext"};D.each(o,function(e,o){void 0!==t[e]&&(n[o]=t[e])}),t.Headers=v(n)}}return t},_=function(e,n){return function(o,r){var i=this;"function"==typeof o&&(r=o,o={}),o=E(e,o);var a=function(e){return e&&e.headers&&(e.headers["x-cos-version-id"]&&(e.VersionId=e.headers["x-cos-version-id"]),e.headers["x-cos-delete-marker"]&&(e.DeleteMarker=e.headers["x-cos-delete-marker"])),e},s=function(e,t){r&&r(a(e),a(t))},c=function(){if("getService"!==e&&"abortUploadTask"!==e){var t=x(e,o);if(t)return"missing param "+t;if(o.Region){if(o.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(o.Region))return"Region format error.";i.options.CompatibilityMode||-1!==o.Region.indexOf("-")||"yfb"===o.Region||"default"===o.Region||console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(o.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(o.Bucket))if(o.AppId)o.Bucket=o.Bucket+"-"+o.AppId;else{if(!i.options.AppId)return'Bucket should format as "test-1250000000".';o.Bucket=o.Bucket+"-"+i.options.AppId}o.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete o.AppId)}!i.options.UseRawKey&&o.Key&&"/"===o.Key.substr(0,1)&&(o.Key=o.Key.substr(1))}}(),u="getAuth"===e||"getObjectUrl"===e,l=t.Promise;if(!u&&l&&!r)return new l(function(e,t){if(r=function(n,o){n?t(n):e(o)},c)return s({error:c});n.call(i,o,s)});if(c)return s({error:c});var d=n.call(i,o,s);return u?d:void 0}},w=function(e,t){function n(){if(r=0,t&&"function"==typeof t){o=Date.now();var n,i=Math.max(0,Math.round((s-a)/((o-c)/1e3)*100)/100)||0;n=0===s&&0===e?1:Math.floor(s/e*100)/100||0,c=o,a=s;try{t({loaded:s,total:e,speed:i,percent:n})}catch(e){}}}var o,r,i=this,a=0,s=0,c=Date.now();return function(t,o){if(t&&(s=t.loaded,e=t.total),o)clearTimeout(r),n();else{if(r)return;r=setTimeout(n,i.options.ProgressInterval)}}},I=function(e,t,n){var o;if("string"==typeof t.Body?t.Body=new Blob([t.Body],{type:"text/plain"}):t.Body instanceof ArrayBuffer&&(t.Body=new Blob([t.Body])),!t.Body||!(t.Body instanceof Blob||"[object File]"===t.Body.toString()||"[object Blob]"===t.Body.toString()))return void n({error:"params body format error, Only allow File|Blob|String."});o=t.Body.size,t.ContentLength=o,n(null,o)},O=function(e){return Date.now()+(e||0)},D={noop:C,formatParams:E,apiWrapper:_,xml2json:g,json2xml:m,md5:h,clearKey:v,fileSlice:S,getBodyMd5:A,getFileMd5:b,binaryBase64:B,extend:a,isArray:s,isInArray:c,makeArray:u,each:l,map:d,filter:f,clone:r,attr:i,uuid:T,camSafeUrlEncode:o,throttleOnProgress:w,getFileSize:I,getSkewTime:O,getAuth:y,isBrowser:!0};e.exports=D}).call(t,n(1))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){function n(e,t){for(var n in e)t[n]=e[n]}function o(e,t){function o(){}var r=e.prototype;if(Object.create){var i=Object.create(t.prototype);r.__proto__=i}r instanceof t||(o.prototype=t.prototype,o=new o,n(r,o),e.prototype=r=o),r.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),r.constructor=e)}function r(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,re[e]),this.message=re[e],Error.captureStackTrace&&Error.captureStackTrace(this,r);return n.code=e,t&&(this.message=this.message+": "+t),n}function i(){}function a(e,t){this._node=e,this._refresh=t,s(this)}function s(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var o=e._refresh(e._node);K(e,"length",o.length),n(o,e),e._inc=t}}function c(){}function u(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function l(e,t,n,o){if(o?t[u(t,o)]=n:t[t.length++]=n,e){n.ownerElement=e;var r=e.ownerDocument;r&&(o&&C(r,e,o),y(r,e,n))}}function d(e,t,n){var o=u(t,n);if(!(o>=0))throw r(ae,new Error(e.tagName+"@"+n));for(var i=t.length-1;o"==e&&">"||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function g(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(g(e,t))return!0}while(e=e.nextSibling)}function m(){}function y(e,t,n){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&(t._nsMap[n.prefix?n.localName:""]=n.value)}function C(e,t,n,o){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete t._nsMap[n.prefix?n.localName:""]}function v(e,t,n){if(e&&e._inc){e._inc++;var o=t.childNodes;if(n)o[o.length++]=n;else{for(var r=t.firstChild,i=0;r;)o[i++]=r,r=r.nextSibling;o.length=i}}}function k(e,t){var n=t.previousSibling,o=t.nextSibling;return n?n.nextSibling=o:e.firstChild=o,o?o.previousSibling=n:e.lastChild=n,v(e.ownerDocument,e),t}function R(e,t,n){var o=t.parentNode;if(o&&o.removeChild(t),t.nodeType===te){var r=t.firstChild;if(null==r)return t;var i=t.lastChild}else r=i=t;var a=n?n.previousSibling:e.lastChild;r.previousSibling=a,i.nextSibling=n,a?a.nextSibling=r:e.firstChild=r,null==n?e.lastChild=i:n.previousSibling=i;do{r.parentNode=e}while(r!==i&&(r=r.nextSibling));return v(e.ownerDocument||e,e),t.nodeType==te&&(t.firstChild=t.lastChild=null),t}function S(e,t){var n=t.parentNode;if(n){var o=e.lastChild;n.removeChild(t);var o=e.lastChild}var o=e.lastChild;return t.parentNode=e,t.previousSibling=o,t.nextSibling=null,o?o.nextSibling=t:e.firstChild=t,e.lastChild=t,v(e.ownerDocument,e,t),t}function A(){this._nsMap={}}function b(){}function B(){}function T(){}function x(){}function E(){}function _(){}function w(){}function I(){}function O(){}function D(){}function N(){}function P(){}function M(e,t){var n=[],o=9==this.nodeType?this.documentElement:this,r=o.prefix,i=o.namespaceURI;if(i&&null==r){var r=o.lookupPrefix(i);if(null==r)var a=[{namespace:i,prefix:null}]}return H(this,n,e,t,a),n.join("")}function U(e,t,n){var o=e.prefix||"",r=e.namespaceURI;if(!o&&!r)return!1;if("xml"===o&&"http://www.w3.org/XML/1998/namespace"===r||"http://www.w3.org/2000/xmlns/"==r)return!1;for(var i=n.length;i--;){var a=n[i];if(a.prefix==o)return a.namespace!=r}return!0}function H(e,t,n,o,r){if(o){if(!(e=o(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case q:r||(r=[]);var i=(r.length,e.attributes),a=i.length,s=e.firstChild,c=e.tagName;n=z===e.namespaceURI||n,t.push("<",c);for(var u=0;u"),n&&/^script$/i.test(c))for(;s;)s.data?t.push(s.data):H(s,t,n,o,r),s=s.nextSibling;else for(;s;)H(s,t,n,o,r),s=s.nextSibling;t.push("")}else t.push("/>");return;case Z:case te:for(var s=e.firstChild;s;)H(s,t,n,o,r),s=s.nextSibling;return;case X:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,p),'"');case V:return t.push(e.data.replace(/[<&]/g,p));case W:return t.push("");case Y:return t.push("\x3c!--",e.data,"--\x3e");case ee:var g=e.publicId,m=e.systemId;if(t.push("');else if(m&&"."!=m)t.push(' SYSTEM "',m,'">');else{var y=e.internalSubset;y&&t.push(" [",y,"]"),t.push(">")}return;case J:return t.push("");case $:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function L(e,t,n){var o;switch(t.nodeType){case q:o=t.cloneNode(!1),o.ownerDocument=e;case te:break;case X:n=!0}if(o||(o=t.cloneNode(!1)),o.ownerDocument=e,o.parentNode=null,n)for(var r=t.firstChild;r;)o.appendChild(L(e,r,n)),r=r.nextSibling;return o}function F(e,t,n){var o=new t.constructor;for(var r in t){var a=t[r];"object"!=typeof a&&a!=o[r]&&(o[r]=a)}switch(t.childNodes&&(o.childNodes=new i),o.ownerDocument=e,o.nodeType){case q:var s=t.attributes,u=o.attributes=new c,l=s.length;u._ownerElement=o;for(var d=0;d0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var o in n)if(n[o]==e)return o;t=t.nodeType==X?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==X?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},n(G,h),n(G,h.prototype),m.prototype={nodeName:"#document",nodeType:Z,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==te){for(var n=e.firstChild;n;){var o=n.nextSibling;this.insertBefore(n,t),n=o}return e}return null==this.documentElement&&e.nodeType==q&&(this.documentElement=e),R(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),k(this,e)},importNode:function(e,t){return L(this,e,t)},getElementById:function(e){var t=null;return g(this.documentElement,function(n){if(n.nodeType==q&&n.getAttribute("id")==e)return t=n,!0}),t},createElement:function(e){var t=new A;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new i,(t.attributes=new c)._ownerElement=t,t},createDocumentFragment:function(){var e=new D;return e.ownerDocument=this,e.childNodes=new i,e},createTextNode:function(e){var t=new T;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new x;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new E;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new N;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new b;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new O;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new A,o=t.split(":"),r=n.attributes=new c;return n.childNodes=new i,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==o.length?(n.prefix=o[0],n.localName=o[1]):n.localName=t,r._ownerElement=n,n},createAttributeNS:function(e,t){var n=new b,o=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==o.length?(n.prefix=o[0],n.localName=o[1]):n.localName=t,n}},o(m,h),A.prototype={nodeType:q,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===te?this.insertBefore(e,null):S(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var o=this.ownerDocument.createAttributeNS(e,t);o.value=o.nodeValue=""+n,this.setAttributeNode(o)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new a(this,function(t){var n=[];return g(t,function(o){o===t||o.nodeType!=q||"*"!==e&&o.tagName!=e||n.push(o)}),n})},getElementsByTagNameNS:function(e,t){return new a(this,function(n){var o=[];return g(n,function(r){r===n||r.nodeType!==q||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||o.push(r)}),o})}},m.prototype.getElementsByTagName=A.prototype.getElementsByTagName,m.prototype.getElementsByTagNameNS=A.prototype.getElementsByTagNameNS,o(A,h),b.prototype.nodeType=X,o(b,h),B.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(re[ie])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},o(B,h),T.prototype={nodeName:"#text",nodeType:V,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var o=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(o,this.nextSibling),o}},o(T,B),x.prototype={nodeName:"#comment",nodeType:Y},o(x,B),E.prototype={nodeName:"#cdata-section",nodeType:W},o(E,B),_.prototype.nodeType=ee,o(_,h),w.prototype.nodeType=ne,o(w,h),I.prototype.nodeType=Q,o(I,h),O.prototype.nodeType=$,o(O,h),D.prototype.nodeName="#document-fragment",D.prototype.nodeType=te,o(D,h),N.prototype.nodeType=J,o(N,h),P.prototype.serializeToString=function(e,t,n){return M.call(e,t,n)},h.prototype.toString=M;try{Object.defineProperty&&(Object.defineProperty(a.prototype,"length",{get:function(){return s(this),this.$$length}}),Object.defineProperty(h.prototype,"textContent",{get:function(){return j(this)},set:function(e){switch(this.nodeType){case q:case te:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),K=function(e,t,n){e["$$"+t]=n})}catch(e){}t.DOMImplementation=f,t.XMLSerializer=P},function(e,t){var n=function(e){var t={},n=function(e){return!t[e]&&(t[e]=[]),t[e]};e.on=function(e,t){"task-list-update"===e&&console.warn('warning: Event "'+e+'" has been deprecated. Please use "list-update" instead.'),n(e).push(t)},e.off=function(e,t){for(var o=n(e),r=o.length-1;r>=0;r--)t===o[r]&&o.splice(r,1)},e.emit=function(e,t){for(var o=n(e).map(function(e){return e}),r=0;r=0;n--){var r=o[n][2];(!r||r+2592e3=0;r--){var i=o[r];i[0]===e&&i[1]===t&&o.splice(r,1)}o.unshift([e,t,Math.round(Date.now()/1e3)]),o.length>n&&o.splice(n),u()}},removeUploadId:function(e){c(),delete l.using[e];for(var t=o.length-1;t>=0;t--)o[t][1]===e&&o.splice(t,1);u()}};e.exports=l},function(e,t,n){var o=n(6);e.exports=o},function(e,t,n){"use strict";var o=n(0),r=n(3),i=n(15),a=n(16),s=n(18),c={AppId:"",SecretId:"",SecretKey:"",XCosSecurityToken:"",ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1048576,SliceSize:1048576,CopyChunkParallelLimit:20,CopyChunkSize:10485760,CopySliceSize:10485760,MaxPartNumber:1e4,ProgressInterval:1e3,UploadQueueSize:1e4,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,UseRawKey:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadAddMetaMd5:!1,UploadIdCacheLimit:50},u=function(e){this.options=o.extend(o.clone(c),e||{}),this.options.FileParallelLimit=Math.max(1,this.options.FileParallelLimit),this.options.ChunkParallelLimit=Math.max(1,this.options.ChunkParallelLimit),this.options.ChunkRetryTimes=Math.max(0,this.options.ChunkRetryTimes),this.options.ChunkSize=Math.max(1048576,this.options.ChunkSize),this.options.CopyChunkParallelLimit=Math.max(1,this.options.CopyChunkParallelLimit),this.options.CopyChunkSize=Math.max(1048576,this.options.CopyChunkSize),this.options.CopySliceSize=Math.max(0,this.options.CopySliceSize),this.options.MaxPartNumber=Math.max(1024,Math.min(1e4,this.options.MaxPartNumber)),this.options.Timeout=Math.max(0,this.options.Timeout),this.options.AppId&&console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000").'),r.init(this),i.init(this)};a.init(u,i),s.init(u,i),u.getAuthorization=o.getAuth,u.version="1.1.5",e.exports=u},function(module,exports,__webpack_require__){(function(process,global){var __WEBPACK_AMD_DEFINE_RESULT__;!function(){"use strict";function Md5(e){if(e)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD=__webpack_require__(9),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e){return function(t,n){return new Md5(!0).update(t,n)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.getCtx=e.create=function(){return new Md5},e.update=function(t){return e.create().update(t)};for(var t=0;t>2]|=e[a]<>6,u[i++]=128|63&r):r<55296||r>=57344?(u[i++]=224|r>>12,u[i++]=128|r>>6&63,u[i++]=128|63&r):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++a)),u[i++]=240|r>>18,u[i++]=128|r>>12&63,u[i++]=128|r>>6&63,u[i++]=128|63&r);else for(i=this.start;a>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(c[i>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=64?(this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=EXTRA[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var e,t,n,o,r,i,a=this.blocks;this.first?(e=a[0]-680876937,e=(e<<7|e>>>25)-271733879<<0,o=(-1732584194^2004318071&e)+a[1]-117830708,o=(o<<12|o>>>20)+e<<0,n=(-271733879^o&(-271733879^e))+a[2]-1126478375,n=(n<<17|n>>>15)+o<<0,t=(e^n&(o^e))+a[3]-1316259209,t=(t<<22|t>>>10)+n<<0):(e=this.h0,t=this.h1,n=this.h2,o=this.h3,e+=(o^t&(n^o))+a[0]-680876936,e=(e<<7|e>>>25)+t<<0,o+=(n^e&(t^n))+a[1]-389564586,o=(o<<12|o>>>20)+e<<0,n+=(t^o&(e^t))+a[2]+606105819,n=(n<<17|n>>>15)+o<<0,t+=(e^n&(o^e))+a[3]-1044525330,t=(t<<22|t>>>10)+n<<0),e+=(o^t&(n^o))+a[4]-176418897,e=(e<<7|e>>>25)+t<<0,o+=(n^e&(t^n))+a[5]+1200080426,o=(o<<12|o>>>20)+e<<0,n+=(t^o&(e^t))+a[6]-1473231341,n=(n<<17|n>>>15)+o<<0,t+=(e^n&(o^e))+a[7]-45705983,t=(t<<22|t>>>10)+n<<0,e+=(o^t&(n^o))+a[8]+1770035416,e=(e<<7|e>>>25)+t<<0,o+=(n^e&(t^n))+a[9]-1958414417,o=(o<<12|o>>>20)+e<<0,n+=(t^o&(e^t))+a[10]-42063,n=(n<<17|n>>>15)+o<<0,t+=(e^n&(o^e))+a[11]-1990404162,t=(t<<22|t>>>10)+n<<0,e+=(o^t&(n^o))+a[12]+1804603682,e=(e<<7|e>>>25)+t<<0,o+=(n^e&(t^n))+a[13]-40341101,o=(o<<12|o>>>20)+e<<0,n+=(t^o&(e^t))+a[14]-1502002290,n=(n<<17|n>>>15)+o<<0,t+=(e^n&(o^e))+a[15]+1236535329,t=(t<<22|t>>>10)+n<<0,e+=(n^o&(t^n))+a[1]-165796510,e=(e<<5|e>>>27)+t<<0,o+=(t^n&(e^t))+a[6]-1069501632,o=(o<<9|o>>>23)+e<<0,n+=(e^t&(o^e))+a[11]+643717713,n=(n<<14|n>>>18)+o<<0,t+=(o^e&(n^o))+a[0]-373897302,t=(t<<20|t>>>12)+n<<0,e+=(n^o&(t^n))+a[5]-701558691,e=(e<<5|e>>>27)+t<<0,o+=(t^n&(e^t))+a[10]+38016083,o=(o<<9|o>>>23)+e<<0,n+=(e^t&(o^e))+a[15]-660478335,n=(n<<14|n>>>18)+o<<0,t+=(o^e&(n^o))+a[4]-405537848,t=(t<<20|t>>>12)+n<<0,e+=(n^o&(t^n))+a[9]+568446438,e=(e<<5|e>>>27)+t<<0,o+=(t^n&(e^t))+a[14]-1019803690,o=(o<<9|o>>>23)+e<<0,n+=(e^t&(o^e))+a[3]-187363961,n=(n<<14|n>>>18)+o<<0,t+=(o^e&(n^o))+a[8]+1163531501,t=(t<<20|t>>>12)+n<<0,e+=(n^o&(t^n))+a[13]-1444681467,e=(e<<5|e>>>27)+t<<0,o+=(t^n&(e^t))+a[2]-51403784,o=(o<<9|o>>>23)+e<<0,n+=(e^t&(o^e))+a[7]+1735328473,n=(n<<14|n>>>18)+o<<0,t+=(o^e&(n^o))+a[12]-1926607734,t=(t<<20|t>>>12)+n<<0,r=t^n,e+=(r^o)+a[5]-378558,e=(e<<4|e>>>28)+t<<0,o+=(r^e)+a[8]-2022574463,o=(o<<11|o>>>21)+e<<0,i=o^e,n+=(i^t)+a[11]+1839030562,n=(n<<16|n>>>16)+o<<0,t+=(i^n)+a[14]-35309556,t=(t<<23|t>>>9)+n<<0,r=t^n,e+=(r^o)+a[1]-1530992060,e=(e<<4|e>>>28)+t<<0,o+=(r^e)+a[4]+1272893353,o=(o<<11|o>>>21)+e<<0,i=o^e,n+=(i^t)+a[7]-155497632,n=(n<<16|n>>>16)+o<<0,t+=(i^n)+a[10]-1094730640,t=(t<<23|t>>>9)+n<<0,r=t^n,e+=(r^o)+a[13]+681279174,e=(e<<4|e>>>28)+t<<0,o+=(r^e)+a[0]-358537222,o=(o<<11|o>>>21)+e<<0,i=o^e,n+=(i^t)+a[3]-722521979,n=(n<<16|n>>>16)+o<<0,t+=(i^n)+a[6]+76029189,t=(t<<23|t>>>9)+n<<0,r=t^n,e+=(r^o)+a[9]-640364487,e=(e<<4|e>>>28)+t<<0,o+=(r^e)+a[12]-421815835,o=(o<<11|o>>>21)+e<<0,i=o^e,n+=(i^t)+a[15]+530742520,n=(n<<16|n>>>16)+o<<0,t+=(i^n)+a[2]-995338651,t=(t<<23|t>>>9)+n<<0,e+=(n^(t|~o))+a[0]-198630844,e=(e<<6|e>>>26)+t<<0,o+=(t^(e|~n))+a[7]+1126891415,o=(o<<10|o>>>22)+e<<0,n+=(e^(o|~t))+a[14]-1416354905,n=(n<<15|n>>>17)+o<<0,t+=(o^(n|~e))+a[5]-57434055,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~o))+a[12]+1700485571,e=(e<<6|e>>>26)+t<<0,o+=(t^(e|~n))+a[3]-1894986606,o=(o<<10|o>>>22)+e<<0,n+=(e^(o|~t))+a[10]-1051523,n=(n<<15|n>>>17)+o<<0,t+=(o^(n|~e))+a[1]-2054922799,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~o))+a[8]+1873313359,e=(e<<6|e>>>26)+t<<0,o+=(t^(e|~n))+a[15]-30611744,o=(o<<10|o>>>22)+e<<0,n+=(e^(o|~t))+a[6]-1560198380,n=(n<<15|n>>>17)+o<<0,t+=(o^(n|~e))+a[13]+1309151649,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~o))+a[4]-145523070,e=(e<<6|e>>>26)+t<<0,o+=(t^(e|~n))+a[11]-1120210379,o=(o<<10|o>>>22)+e<<0,n+=(e^(o|~t))+a[2]+718787259,n=(n<<15|n>>>17)+o<<0,t+=(o^(n|~e))+a[9]-343485551,t=(t<<21|t>>>11)+n<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=n-1732584194<<0,this.h3=o+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+o<<0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,o=this.h3;return HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(e){if("hex"===e)return this.hex();this.finalize();var t=this.h0,n=this.h1,o=this.h2,r=this.h3;return[255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&o,o>>8&255,o>>16&255,o>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var e,t,n,o="",r=this.array(),i=0;i<15;)e=r[i++],t=r[i++],n=r[i++],o+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[63&(e<<4|t>>>4)]+BASE64_ENCODE_CHAR[63&(t<<2|n>>>6)]+BASE64_ENCODE_CHAR[63&n];return e=r[i],o+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+"=="};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}()}).call(exports,__webpack_require__(8),__webpack_require__(1))},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function r(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function i(e){if(d===clearTimeout)return clearTimeout(e);if((d===o||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function a(){g&&h&&(g=!1,h.length?p=h.concat(p):m=-1,p.length&&s())}function s(){if(!g){var e=r(a);g=!0;for(var t=p.length;t;){for(h=p,p=[];++m1)for(var n=1;n>>2]|=(n[r>>>2]>>>24-r%4*8&255)<<24-(o+r)%4*8;else if(65535>>2]=n[r>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],o=0;o>>2]>>>24-o%4*8&255;n.push((r>>>4).toString(16)),n.push((15&r).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o>>3]|=parseInt(e.substr(o,2),16)<<24-o%8*4;return new a.init(n,t/2)}},u=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],o=0;o>>2]>>>24-o%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o>>2]|=(255&e.charCodeAt(o))<<24-o%4*8;return new a.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=o.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,o=n.words,r=n.sigBytes,i=this.blockSize,s=r/(4*i),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*i,r=e.min(4*t,r),t){for(var c=0;cu;u++){if(16>u)i[u]=0|e[t+u];else{var l=i[u-3]^i[u-8]^i[u-14]^i[u-16];i[u]=l<<1|l>>>31}l=(o<<5|o>>>27)+c+i[u],l=20>u?l+(1518500249+(r&a|~r&s)):40>u?l+(1859775393+(r^a^s)):60>u?l+((r&a|r&s|a&s)-1894007588):l+((r^a^s)-899497514),c=s,s=a,a=r<<30|r>>>2,r=o,o=l}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;return t[o>>>5]|=128<<24-o%32,t[14+(o+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(o+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=r._createHelper(t),e.HmacSHA1=r._createHmacHelper(t)}(),function(){var e=o,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var o=e.blockSize,r=4*o;n.sigBytes>r&&(n=e.finalize(n)),n.clamp();for(var i=this._oKey=n.clone(),a=this._iKey=n.clone(),s=i.words,c=a.words,u=0;u>>2]>>>24-i%4*8&255,s=t[i+1>>>2]>>>24-(i+1)%4*8&255,c=t[i+2>>>2]>>>24-(i+2)%4*8&255,u=a<<16|s<<8|c,l=0;l<4&&i+.75*l>>6*(3-l)&63));var d=o.charAt(64);if(d)for(;r.length%4;)r.push(d);return r.join("")},parse:function(e){var t=e.length,o=this._map,r=o.charAt(64);if(r){var i=e.indexOf(r);-1!=i&&(t=i)}for(var a=[],s=0,c=0;c>>6-c%4*2;a[s>>>2]|=(u|l)<<24-s%4*8,s++}return n.create(a,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.exports=o},function(e,t,n){var o=n(12).DOMParser,r=function(){this.version="1.3.5";var e={mergeCDATA:!0,normalize:!0,stripElemPrefix:!0},t=new RegExp(/(?!xmlns)^.*:/);new RegExp(/^\s+|\s+$/g);return this.grokType=function(e){return/^\s*$/.test(e)?null:/^(?:true|false)$/i.test(e)?"true"===e.toLowerCase():isFinite(e)?parseFloat(e):e},this.parseString=function(e,t){if(e){var n=this.stringToXML(e);return n.getElementsByTagName("parsererror").length?null:this.parseXML(n,t)}return null},this.parseXML=function(n,o){for(var i in o)e[i]=o[i];var a={},s=0,c="";if(n.childNodes.length)for(var u,l,d,f=0;f=t+n||t?new java.lang.String(e,t,n)+"":e}function u(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}o.prototype.parseFromString=function(e,t){var n=this.options,o=new l,a=n.domBuilder||new i,s=n.errorHandler,c=n.locator,u=n.xmlns||{},d={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return c&&a.setDocumentLocator(c),o.errorHandler=r(s,a,c),o.domBuilder=n.domBuilder||a,/\/x?html?$/.test(t)&&(d.nbsp="\xa0",d.copy="\xa9",u[""]="http://www.w3.org/1999/xhtml"),u.xml=u.xml||"http://www.w3.org/XML/1998/namespace",e?o.parse(e,u,d):o.errorHandler.error("invalid doc source"),a.doc},i.prototype={startDocument:function(){this.doc=(new d).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,o){var r=this.doc,i=r.createElementNS(e,n||t),s=o.length;u(this,i),this.currentElement=i,this.locator&&a(this.locator,i);for(var c=0;c65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function p(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?h(parseInt(t.substr(1).replace("x","0x"))):(u.error("entity not found:"+e),e)}function g(t){if(t>A){var n=e.substring(A,t).replace(/&#?\w+;/g,p);k&&m(A),o.characters(n,0,t-A),A=t}}function m(t,n){for(;t>=C&&(n=v.exec(e));)y=n.index,C=y+n[0].length,k.lineNumber++;k.columnNumber=t-y+1}for(var y=0,C=0,v=/.*(?:\r\n?|\n)|.*$/g,k=o.locator,R=[{currentNSMap:t}],S={},A=0;;){try{var b=e.indexOf("<",A);if(b<0){if(!e.substr(A).match(/^\s*$/)){var B=o.doc,T=B.createTextNode(e.substr(A));B.appendChild(T),o.currentElement=T}return}switch(b>A&&g(b),e.charAt(b+1)){case"/":var x=e.indexOf(">",b+3),E=e.substring(b+2,x),_=R.pop();x<0?(E=e.substring(b+2).replace(/[\s<].*/,""),u.error("end tag name: "+E+" is not complete:"+_.tagName),x=b+1+E.length):E.match(/\sA?A=x:g(Math.max(b,A)+1)}}function r(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function i(e,t,n,o,r,i){for(var a,s,c=++t,u=C;;){var l=e.charAt(c);switch(l){case"=":if(u===v)a=e.slice(t,c),u=R;else{if(u!==k)throw new Error("attribute equal must after attrName");u=R}break;case"'":case'"':if(u===R||u===v){if(u===v&&(i.warning('attribute value must after "="'),a=e.slice(t,c)),t=c+1,!((c=e.indexOf(l,t))>0))throw new Error("attribute value no end '"+l+"' match");s=e.slice(t,c).replace(/&#?\w+;/g,r),n.add(a,s,t-1),u=A}else{if(u!=S)throw new Error('attribute value must after "="');s=e.slice(t,c).replace(/&#?\w+;/g,r),n.add(a,s,t),i.warning('attribute "'+a+'" missed start quot('+l+")!!"),t=c+1,u=A}break;case"/":switch(u){case C:n.setTagName(e.slice(t,c));case A:case b:case B:u=B,n.closed=!0;case S:case v:case k:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),u==C&&n.setTagName(e.slice(t,c)),c;case">":switch(u){case C:n.setTagName(e.slice(t,c));case A:case b:case B:break;case S:case v:s=e.slice(t,c),"/"===s.slice(-1)&&(n.closed=!0,s=s.slice(0,-1));case k:u===k&&(s=a),u==S?(i.warning('attribute "'+s+'" missed quot(")!!'),n.add(a,s.replace(/&#?\w+;/g,r),t)):("http://www.w3.org/1999/xhtml"===o[""]&&s.match(/^(?:disabled|checked|selected)$/i)||i.warning('attribute "'+s+'" missed value!! "'+s+'" instead!!'),n.add(s,s,t));break;case R:throw new Error("attribute value missed!!")}return c;case"\x80":l=" ";default:if(l<=" ")switch(u){case C:n.setTagName(e.slice(t,c)),u=b;break;case v:a=e.slice(t,c),u=k;break;case S:var s=e.slice(t,c).replace(/&#?\w+;/g,r);i.warning('attribute "'+s+'" missed quot(")!!'),n.add(a,s,t);case A:u=b}else switch(u){case k:n.tagName;"http://www.w3.org/1999/xhtml"===o[""]&&a.match(/^(?:disabled|checked|selected)$/i)||i.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),n.add(a,a,t),t=c,u=v;break;case A:i.warning('attribute space is required"'+a+'"!!');case b:u=v,t=c;break;case R:u=S,t=c;break;case B:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function a(e,t,n){for(var o=e.tagName,r=null,i=e.length;i--;){var a=e[i],s=a.qName,c=a.value,l=s.indexOf(":");if(l>0)var d=a.prefix=s.slice(0,l),f=s.slice(l+1),h="xmlns"===d&&f;else f=s,d=null,h="xmlns"===s&&"";a.localName=f,!1!==h&&(null==r&&(r={},u(n,n={})),n[h]=r[h]=c,a.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(h,c))}for(var i=e.length;i--;){a=e[i];var d=a.prefix;d&&("xml"===d&&(a.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==d&&(a.uri=n[d||""]))}var l=o.indexOf(":");l>0?(d=e.prefix=o.slice(0,l),f=e.localName=o.slice(l+1)):(d=null,f=e.localName=o);var p=e.uri=n[d||""];if(t.startElement(p,f,o,e),!e.closed)return e.currentNSMap=n,e.localNSMap=r,!0;if(t.endElement(p,f,o),r)for(d in r)t.endPrefixMapping(d)}function s(e,t,n,o,r){if(/^(?:script|textarea)$/i.test(n)){var i=e.indexOf("",t),a=e.substring(t+1,i);if(/[&<]/.test(a))return/^script$/i.test(n)?(r.characters(a,0,a.length),i):(a=a.replace(/&#?\w+;/g,o),r.characters(a,0,a.length),i)}return t+1}function c(e,t,n,o){var r=o[n];return null==r&&(r=e.lastIndexOf(""),rt?(n.comment(e,t+4,r-t-4),r+3):(o.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==e.substr(t+3,6)){var r=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,r-t-9),n.endCDATA(),r+3}var i=p(e,t),a=i.length;if(a>1&&/!doctype/i.test(i[0][0])){var s=i[1][0],c=a>3&&/^public$/i.test(i[2][0])&&i[3][0],u=a>4&&i[4][0],l=i[a-1];return n.startDTD(s,c&&c.replace(/^(['"])(.*?)\1$/,"$2"),u&&u.replace(/^(['"])(.*?)\1$/,"$2")),n.endDTD(),l.index+l[0].length}}return-1}function d(e,t,n){var o=e.indexOf("?>",t);if(o){var r=e.substring(t,o).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(r){r[0].length;return n.processingInstruction(r[1],r[2]),o+2}return-1}return-1}function f(e){}function h(e,t){return e.__proto__=t,e}function p(e,t){var n,o=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=t,r.exec(e);n=r.exec(e);)if(o.push(n),n[1])return o}var g=/[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]/,m=new RegExp("[\\-\\.0-9"+g.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),y=new RegExp("^"+g.source+m.source+"*(?::"+g.source+m.source+"*)?$"),C=0,v=1,k=2,R=3,S=4,A=5,b=6,B=7;n.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),u(t,t={}),o(e,t,n,r,this.errorHandler),r.endDocument()}},f.prototype={setTagName:function(e){if(!y.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},add:function(e,t,n){if(!y.test(e))throw new Error("invalid attribute:"+e);this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},h({},h.prototype)instanceof h||(h=function(e,t){function n(){}n.prototype=t,n=new n;for(t in e)n[t]=e[t];return n}),t.XMLReader=n},function(e,t){function n(e){return(""+e).replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(r,"")}var o=new RegExp("^([^a-zA-Z_\xc0-\xd6\xd8-\xf6\xf8-\xff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fff\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd])|^((x|X)(m|M)(l|L))|([^a-zA-Z_\xc0-\xd6\xd8-\xf6\xf8-\xff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fff\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd-.0-9\xb7\u0300-\u036f\u203f\u2040])","g"),r=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,i=function(e){var t=[];if(e instanceof Object)for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t},a=function(e,t){var r=function(e,n,r,i,a){var s=void 0!==t.indent?t.indent:"\t",c=t.prettyPrint?"\n"+new Array(i).join(s):"";t.removeIllegalNameCharacters&&(e=e.replace(o,"_"));var u=[c,"<",e,r||""];return n&&n.length>0?(u.push(">"),u.push(n),a&&u.push(c),u.push("")):u.push("/>"),u.join("")};return function e(o,a,s){var c=typeof o;switch((Array.isArray?Array.isArray(o):o instanceof Array)?c="array":o instanceof Date&&(c="date"),c){case"array":var u=[];return o.map(function(t){u.push(e(t,1,s+1))}),t.prettyPrint&&u.push("\n"),u.join("");case"date":return o.toJSON?o.toJSON():o+"";case"object":var l=[];for(var d in o)if(o.hasOwnProperty(d))if(o[d]instanceof Array)for(var f=0;f0&&l.push("\n"),l.join("");case"function":return o();default:return t.escape?n(o):""+o}}(e,0,0)},s=function(e){var t=['"),t.join("")};e.exports=function(e,t){if(t||(t={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" ",escape:!0}),"string"==typeof e)try{e=JSON.parse(e.toString())}catch(e){return!1}var n="",o="";return t&&("object"==typeof t?(t.xmlHeader&&(n=s(!!t.xmlHeader.standalone)),void 0!==t.docType&&(o="")):n=s()),t=t||{},[n,t.prettyPrint&&o?"\n":"",o,a(e,t)].join("").replace(/\n{2,}/g,"\n").replace(/\s+$/g,"")}},function(e,t,n){var o=n(4),r=n(0),i={},a=function(e,t){i[t]=e[t],e[t]=function(e,n){e.SkipTask?i[t].call(this,e,n):this._addTask(t,e,n)}},s=function(e){var t=[],n={},a=0,s=0,c=function(e){var t={id:e.id,Bucket:e.Bucket,Region:e.Region,Key:e.Key,FilePath:e.FilePath,state:e.state,loaded:e.loaded,size:e.size,speed:e.speed,percent:e.percent,hashPercent:e.hashPercent,error:e.error};return e.FilePath&&(t.FilePath=e.FilePath),e._custom&&(t._custom=e._custom),t},u=function(){var n,o=function(){n=0,e.emit("task-list-update",{list:r.map(t,c)}),e.emit("list-update",{list:r.map(t,c)})};return function(){n||(n=setTimeout(o))}}(),l=function(){if(!(t.length<=e.options.UploadQueueSize)){for(var o=0;oe.options.UploadQueueSize;){var r="waiting"===t[o].state||"checking"===t[o].state||"uploading"===t[o].state;t[o]&&r?o++:(n[t[o].id]&&delete n[t[o].id],t.splice(o,1),s--)}u()}},d=function(){if(!(a>=e.options.FileParallelLimit)){for(;t[s]&&"waiting"!==t[s].state;)s++;if(!(s>=t.length)){var n=t[s];s++,a++,n.state="checking",n.params.onTaskStart&&n.params.onTaskStart(c(n)),!n.params.UploadData&&(n.params.UploadData={});var o=r.formatParams(n.api,n.params);i[n.api].call(e,o,function(t,o){e._isRunningTask(n.id)&&("checking"!==n.state&&"uploading"!==n.state||(n.state=t?"error":"success",t&&(n.error=t),a--,u(),d(),n.callback&&n.callback(t,o),"success"===n.state&&(n.params&&(delete n.params.UploadData,delete n.params.Body,delete n.params),delete n.callback)),l())}),u(),setTimeout(d)}}},f=function(t,r){var i=n[t];if(i){var s=i&&"waiting"===i.state,c=i&&("checking"===i.state||"uploading"===i.state);if("canceled"===r&&"canceled"!==i.state||"paused"===r&&s||"paused"===r&&c){if("paused"===r&&i.params.Body&&"function"==typeof i.params.Body.pipe)return void console.error("stream not support pause");i.state=r,e.emit("inner-kill-task",{TaskId:t,toState:r});try{var f=i&&i.params&&i.params.UploadData.UploadId}catch(e){}"canceled"===r&&f&&o.removeUsing(f),u(),c&&(a--,d()),"canceled"===r&&(i.params&&(delete i.params.UploadData,delete i.params.Body,delete i.params),delete i.callback)}l()}};e._addTasks=function(t){r.each(t,function(t){e._addTask(t.api,t.params,t.callback,!0)}),u()};var h=!0;e._addTask=function(o,i,a,s){i=r.formatParams(o,i);var c=r.uuid();i.TaskId=c,i.onTaskReady&&i.onTaskReady(c),i.TaskReady&&(i.TaskReady(c),h&&console.warn('warning: Param "TaskReady" has been deprecated. Please use "onTaskReady" instead.'),h=!1);var f={params:i,callback:a,api:o,index:t.length,id:c,Bucket:i.Bucket,Region:i.Region,Key:i.Key,FilePath:i.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null,_custom:i._custom},p=i.onHashProgress;i.onHashProgress=function(t){e._isRunningTask(f.id)&&(f.hashPercent=t.percent,p&&p(t),u())};var g=i.onProgress;return i.onProgress=function(t){e._isRunningTask(f.id)&&("checking"===f.state&&(f.state="uploading"),f.loaded=t.loaded,f.speed=t.speed,f.percent=t.percent,g&&g(t),u())},r.getFileSize(o,i,function(e,o){if(e)return void a(e);n[c]=f,t.push(f),f.size=o,!s&&u(),d(),l()}),c},e._isRunningTask=function(e){var t=n[e];return!(!t||"checking"!==t.state&&"uploading"!==t.state)},e.getTaskList=function(){return r.map(t,c)},e.cancelTask=function(e){f(e,"canceled")},e.pauseTask=function(e){f(e,"paused")},e.restartTask=function(e){var t=n[e];!t||"paused"!==t.state&&"error"!==t.state||(t.state="waiting",u(),s=Math.min(s,t.index),d())},e.isUploadRunning=function(){return a||s/gi,"<$1Rule>"),o=o.replace(/<(\/?)Tags>/gi,"<$1Tag>");var r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=Te.binaryBase64(Te.md5(o)),Se.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"replication",headers:r},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function T(e,t){Se.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"ReplicationConfigurationnotFoundError"!==e.error.Code)t(e);else{var o={ReplicationConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else e||!n.ReplicationConfiguration&&(n.ReplicationConfiguration={}),n.ReplicationConfiguration.Rule&&(n.ReplicationConfiguration.Rules=n.ReplicationConfiguration.Rule,delete n.ReplicationConfiguration.Rule),t(e,n)})}function x(e,t){Se.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function E(e,t){if(!e.WebsiteConfiguration)return void t({error:"missing param WebsiteConfiguration"});var n=Te.clone(e.WebsiteConfiguration||{}),o=n.RoutingRules||n.RoutingRule||[];o=Te.isArray(o)?o:[o],delete n.RoutingRule,delete n.RoutingRules,o.length&&(n.RoutingRules={RoutingRule:o});var r=Te.json2xml({WebsiteConfiguration:n}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=Te.binaryBase64(Te.md5(r)),Se.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"website",headers:i},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function _(e,t){Se.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website"},function(e,n){if(e)if(404===e.statusCode&&"NoSuchWebsiteConfiguration"===e.error.Code){var o={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else t(e);else{var r=n.WebsiteConfiguration||{};if(r.RoutingRules){var i=Te.clone(r.RoutingRules.RoutingRule||[]);i=Te.makeArray(i),r.RoutingRules=i}t(null,{WebsiteConfiguration:r,statusCode:n.statusCode,headers:n.headers})}})}function w(e,t){Se.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function I(e,t){if(!e.RefererConfiguration)return void t({error:"missing param RefererConfiguration"});var n=Te.clone(e.RefererConfiguration||{}),o=n.DomainList||{},r=o.Domains||o.Domain||[];r=Te.isArray(r)?r:[r],r.length&&(n.DomainList={Domain:r});var i=Te.json2xml({RefererConfiguration:n}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=Te.binaryBase64(Te.md5(i)),Se.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"referer",headers:a},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function O(e,t){Se.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer"},function(e,n){if(e)if(404===e.statusCode&&"NoSuchRefererConfiguration"===e.error.Code){var o={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else t(e);else{var r=n.RefererConfiguration||{};if(r.DomainList){var i=Te.clone(r.DomainList.Domain||[]);i=Te.makeArray(i),r.DomainList={Domains:i}}t(null,{RefererConfiguration:r,statusCode:n.statusCode,headers:n.headers})}})}function D(e,t){var n=e.DomainConfiguration||{},o=n.DomainRule||e.DomainRule||[];o=Te.clone(o);var r=Te.json2xml({DomainConfiguration:{DomainRule:o}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=Te.binaryBase64(Te.md5(r)),Se.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"domain",headers:i},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function N(e,t){Se.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(e,n){if(e)return t(e);var o=[];try{o=n.DomainConfiguration.DomainRule||[]}catch(e){}o=Te.clone(Te.isArray(o)?o:[o]),t(null,{DomainRule:o,statusCode:n.statusCode,headers:n.headers})})}function P(e,t){Se.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function M(e,t){var n=e.OriginConfiguration||{},o=n.OriginRule||e.OriginRule||[];o=Te.clone(o);var r=Te.json2xml({OriginConfiguration:{OriginRule:o}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=Te.binaryBase64(Te.md5(r)),Se.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"origin",headers:i},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function U(e,t){Se.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(e,n){if(e)return t(e);var o=[];try{o=n.OriginConfiguration.OriginRule||[]}catch(e){}o=Te.clone(Te.isArray(o)?o:[o]),t(null,{OriginRule:o,statusCode:n.statusCode,headers:n.headers})})}function H(e,t){Se.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function L(e,t){var n=Te.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(n)),Se.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"logging",headers:o},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function F(e,t){Se.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging"},function(e,n){if(e)return t(e);t(null,{BucketLoggingStatus:n.BucketLoggingStatus,statusCode:n.statusCode,headers:n.headers})})}function K(e,t){var n=Te.clone(e.InventoryConfiguration);if(n.OptionalFields){var o=n.OptionalFields||[];n.OptionalFields={Field:o}}if(n.Destination&&n.Destination.COSBucketDestination&&n.Destination.COSBucketDestination.Encryption){var r=n.Destination.COSBucketDestination.Encryption;Object.keys(r).indexOf("SSECOS")>-1&&(r["SSE-COS"]=r.SSECOS,delete r.SSECOS)}var i=Te.json2xml({InventoryConfiguration:n}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=Te.binaryBase64(Te.md5(i)),Se.call(this,{Action:"name/cos:PutBucketInventory",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"inventory",qs:{id:e.Id},headers:a},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function j(e,t){Se.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(e,n){if(e)return t(e);var o=n.InventoryConfiguration;if(o&&o.OptionalFields&&o.OptionalFields.Field){var r=o.OptionalFields.Field;Te.isArray(r)||(r=[r]),o.OptionalFields=r}if(o.Destination&&o.Destination.COSBucketDestination&&o.Destination.COSBucketDestination.Encryption){var i=o.Destination.COSBucketDestination.Encryption;Object.keys(i).indexOf("SSE-COS")>-1&&(i.SSECOS=i["SSE-COS"],delete i["SSE-COS"])}t(null,{InventoryConfiguration:o,statusCode:n.statusCode,headers:n.headers})})}function z(e,t){Se.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{"continuation-token":e.ContinuationToken}},function(e,n){if(e)return t(e);var o=n.ListInventoryConfigurationResult,r=o.InventoryConfiguration||[];r=Te.isArray(r)?r:[r],delete o.InventoryConfiguration,Te.each(r,function(e){if(e&&e.OptionalFields&&e.OptionalFields.Field){var t=e.OptionalFields.Field;Te.isArray(t)||(t=[t]),e.OptionalFields=t}if(e.Destination&&e.Destination.COSBucketDestination&&e.Destination.COSBucketDestination.Encryption){var n=e.Destination.COSBucketDestination.Encryption;Object.keys(n).indexOf("SSE-COS")>-1&&(n.SSECOS=n["SSE-COS"],delete n["SSE-COS"])}}),o.InventoryConfigurations=r,Te.extend(o,{statusCode:n.statusCode,headers:n.headers}),t(null,o)})}function G(e,t){Se.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function q(e,t){if(!e.AccelerateConfiguration)return void t({error:"missing param AccelerateConfiguration"});var n={AccelerateConfiguration:e.AccelerateConfiguration||{}},o=Te.json2xml(n),r={};r["Content-Type"]="application/xml",r["Content-MD5"]=Te.binaryBase64(Te.md5(o)),Se.call(this,{Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"accelerate",headers:r},function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})})}function X(e,t){Se.call(this,{Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate"},function(e,n){e||!n.AccelerateConfiguration&&(n.AccelerateConfiguration={}),t(e,n)})}function V(e,t){Se.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(n,o){if(n){var r=n.statusCode;return e.Headers["If-Modified-Since"]&&r&&304===r?t(null,{NotModified:!0,statusCode:r}):t(n)}o.ETag=Te.attr(o.headers,"etag",""),t(null,o)})}function W(e,t){var n={};n.prefix=e.Prefix||"",n.delimiter=e.Delimiter,n["key-marker"]=e.KeyMarker,n["version-id-marker"]=e.VersionIdMarker,n["max-keys"]=e.MaxKeys,n["encoding-type"]=e.EncodingType,Se.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,action:"versions"},function(e,n){if(e)return t(e);var o=n.ListVersionsResult||{},r=o.DeleteMarker||[];r=Te.isArray(r)?r:[r];var i=o.Version||[];i=Te.isArray(i)?i:[i];var a=Te.clone(o);delete a.DeleteMarker,delete a.Version,Te.extend(a,{DeleteMarkers:r,Versions:i,statusCode:n.statusCode,headers:n.headers}),t(null,a)})}function $(e,t){var n=e.Query||{};n["response-content-type"]=e.ResponseContentType,n["response-content-language"]=e.ResponseContentLanguage,n["response-expires"]=e.ResponseExpires,n["response-cache-control"]=e.ResponseCacheControl,n["response-content-disposition"]=e.ResponseContentDisposition,n["response-content-encoding"]=e.ResponseContentEncoding,Se.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,DataType:e.DataType,headers:e.Headers,qs:n,rawBody:!0},function(n,o){if(n){var r=n.statusCode;return e.Headers["If-Modified-Since"]&&r&&304===r?t(null,{NotModified:!0}):t(n)}t(null,{Body:o.body,ETag:Te.attr(o.headers,"etag",""),statusCode:o.statusCode,headers:o.headers})})}function Q(e,t){var n=this,o=e.ContentLength,r=Te.throttleOnProgress.call(n,o,e.onProgress),i=e.Headers;i["Cache-Control"]||i["cache-control"]||(i["Cache-Control"]=""),i["Content-Type"]||i["content-type"]||(i["Content-Type"]=e.Body&&e.Body.type||"");var a=e.UploadAddMetaMd5||n.options.UploadAddMetaMd5||n.options.UploadCheckContentMd5;Te.getBodyMd5(a,e.Body,function(a){a&&(n.options.UploadCheckContentMd5&&(i["Content-MD5"]=Te.binaryBase64(a)),(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5)&&(i["x-cos-meta-md5"]=a)),void 0!==e.ContentLength&&(i["Content-Length"]=e.ContentLength),r(null,!0),Se.call(n,{Action:"name/cos:PutObject",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:e.Query,body:e.Body,onProgress:r},function(i,a){if(i)return r(null,!0),t(i);r({loaded:o,total:o},!0);var s=ve({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key});s=s.substr(s.indexOf("://")+3),a.Location=s,a.ETag=Te.attr(a.headers,"etag",""),t(null,a)})},e.onHashProgress)}function J(e,t){Se.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,VersionId:e.VersionId},function(e,n){if(e){var o=e.statusCode;return o&&204===o?t(null,{statusCode:o}):o&&404===o?t(null,{BucketNotFound:!0,statusCode:o}):t(e)}t(null,{statusCode:n.statusCode,headers:n.headers})})}function Y(e,t){Se.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"acl"},function(e,n){if(e)return t(e);var o=n.AccessControlPolicy||{},r=o.Owner||{},i=o.AccessControlList&&o.AccessControlList.Grant||[];i=Te.isArray(i)?i:[i];var a=ye(o);n.headers&&n.headers["x-cos-acl"]&&(a.ACL=n.headers["x-cos-acl"]),a=Te.extend(a,{Owner:r,Grants:i,statusCode:n.statusCode,headers:n.headers}),t(null,a)})}function Z(e,t){var n=e.Headers,o="";if(e.AccessControlPolicy){var r=Te.clone(e.AccessControlPolicy||{}),i=r.Grants||r.Grant;i=Te.isArray(i)?i:[i],delete r.Grant,delete r.Grants,r.AccessControlList={Grant:i},o=Te.json2xml({AccessControlPolicy:r}),n["Content-Type"]="application/xml",n["Content-MD5"]=Te.binaryBase64(Te.md5(o))}Te.each(n,function(e,t){0===t.indexOf("x-cos-grant-")&&(n[t]=Ce(n[t]))}),Se.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:n,body:o},function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})})}function ee(e,t){var n=e.Headers;n.Origin=e.Origin,n["Access-Control-Request-Method"]=e.AccessControlRequestMethod,n["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,Se.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:n},function(e,n){if(e)return e.statusCode&&403===e.statusCode?t(null,{OptionsForbidden:!0,statusCode:e.statusCode}):t(e);var o=n.headers||{};t(null,{AccessControlAllowOrigin:o["access-control-allow-origin"],AccessControlAllowMethods:o["access-control-allow-methods"],AccessControlAllowHeaders:o["access-control-allow-headers"],AccessControlExposeHeaders:o["access-control-expose-headers"],AccessControlMaxAge:o["access-control-max-age"],statusCode:n.statusCode,headers:n.headers})})}function te(e,t){var n=e.Headers;!n["Cache-Control"]&&n["cache-control"]&&(n["Cache-Control"]="");var o=e.CopySource||"",r=o.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^\/]+\/(.+)$/);if(!r)return void t({error:"CopySource format error"});var i=r[1],a=r[3],s=decodeURIComponent(r[4]);Se.call(this,{Interface:"PutObjectCopy",Scope:[{action:"name/cos:GetObject",bucket:i,region:a,prefix:s},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(e,n){if(e)return t(e);var o=Te.clone(n.CopyObjectResult||{});Te.extend(o,{statusCode:n.statusCode,headers:n.headers}),t(null,o)})}function ne(e,t){var n=e.CopySource||"",o=n.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^\/]+\/(.+)$/);if(!o)return void t({error:"CopySource format error"});var r=o[1],i=o[3],a=decodeURIComponent(o[4]);Se.call(this,{Interface:"UploadPartCopy",Scope:[{action:"name/cos:GetObject",bucket:r,region:i,prefix:a},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers},function(e,n){if(e)return t(e);var o=Te.clone(n.CopyPartResult||{});Te.extend(o,{statusCode:n.statusCode,headers:n.headers}),t(null,o)})}function oe(e,t){var n=e.Objects||[],o=e.Quiet;n=Te.isArray(n)?n:[n];var r=Te.json2xml({Delete:{Object:n,Quiet:o||!1}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=Te.binaryBase64(Te.md5(r));var a=Te.map(n,function(t){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:t.Key}});Se.call(this,{Interface:"DeleteMultipleObjects",Scope:a,method:"POST",Bucket:e.Bucket,Region:e.Region,body:r,action:"delete",headers:i},function(e,n){if(e)return t(e);var o=n.DeleteResult||{},r=o.Deleted||[],i=o.Error||[];r=Te.isArray(r)?r:[r],i=Te.isArray(i)?i:[i];var a=Te.clone(o);Te.extend(a,{Error:i,Deleted:r,statusCode:n.statusCode,headers:n.headers}),t(null,a)})}function re(e,t){var n=e.Headers;if(!e.RestoreRequest)return void t({error:"missing param RestoreRequest"});var o=e.RestoreRequest||{},r=Te.json2xml({RestoreRequest:o});n["Content-Type"]="application/xml",n["Content-MD5"]=Te.binaryBase64(Te.md5(r)),Se.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:r,action:"restore",headers:n},function(e,n){t(e,n)})}function ie(e,t){var n=e.Tagging||{},o=n.TagSet||n.Tags||e.Tags||[];o=Te.clone(Te.isArray(o)?o:[o]);var r=Te.json2xml({Tagging:{TagSet:{Tag:o}}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=Te.binaryBase64(Te.md5(r)),Se.call(this,{Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:r,action:"tagging",headers:i,VersionId:e.VersionId},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function ae(e,t){Se.call(this,{Action:"name/cos:GetObjectTagging",method:"GET",Key:e.Key,Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",VersionId:e.VersionId},function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"NoSuchTagSet"!==e.error.Code)t(e);else{var o={Tags:[],statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else{var r=[];try{r=n.Tagging.TagSet.Tag||[]}catch(e){}r=Te.clone(Te.isArray(r)?r:[r]),t(null,{Tags:r,statusCode:n.statusCode,headers:n.headers})}})}function se(e,t){Se.call(this,{Action:"name/cos:DeleteObjectTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"tagging",VersionId:e.VersionId},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function ce(e,t){if(!e.SelectType)return t({error:"missing param SelectType"});var n=e.SelectRequest||{},o=Te.json2xml({SelectRequest:n}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=Te.binaryBase64(Te.md5(o)),Se.call(this,{Interface:"SelectObjectContent",Action:"name/cos:GetObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"select",qs:{"select-type":e.SelectType},VersionId:e.VersionId,body:o,rawBody:!0},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers,Body:n.body})})}function ue(e,t){var n=this,o=e.Headers;o["Cache-Control"]||o["cache-control"]||(o["Cache-Control"]=""),o["Content-Type"]||o["content-type"]||(o["Content-Type"]=e.Body&&e.Body.type||""),Te.getBodyMd5(e.Body&&(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5),e.Body,function(o){o&&(e.Headers["x-cos-meta-md5"]=o),Se.call(n,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query},function(e,n){return e?t(e):(n=Te.clone(n||{}))&&n.InitiateMultipartUploadResult?t(null,Te.extend(n.InitiateMultipartUploadResult,{statusCode:n.statusCode,headers:n.headers})):void t(null,n)})},e.onHashProgress)}function le(e,t){var n=this;Te.getFileSize("multipartUpload",e,function(){Te.getBodyMd5(n.options.UploadCheckContentMd5,e.Body,function(o){o&&(e.Headers["Content-MD5"]=Te.binaryBase64(o)),Se.call(n,{Action:"name/cos:UploadPart",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,onProgress:e.onProgress,body:e.Body||null},function(e,n){if(e)return t(e);t(null,{ETag:Te.attr(n.headers,"etag",""),statusCode:n.statusCode,headers:n.headers})})})})}function de(e,t){for(var n=this,o=e.UploadId,r=e.Parts,i=0,a=r.length;i-1?n.Authorization:"sign="+encodeURIComponent(n.Authorization)),n.XCosSecurityToken&&(r+="&x-cos-security-token="+n.XCosSecurityToken),n.ClientIP&&(r+="&clientIP="+n.ClientIP),n.ClientUA&&(r+="&clientUA="+n.ClientUA),n.Token&&(r+="&token="+n.Token),setTimeout(function(){t(null,{Url:r})})}});return r?o+"?"+r.Authorization+(r.XCosSecurityToken?"&x-cos-security-token="+r.XCosSecurityToken:""):o}function ye(e){var t={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},n={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},o=e&&e.AccessControlList||{},r=o.Grant;r&&(r=Te.isArray(r)?r:[r]);var i={READ:0,WRITE:0,FULL_CONTROL:0};return r&&r.length&&Te.each(r,function(o){"qcs::cam::anyone:anyone"===o.Grantee.ID||"http://cam.qcloud.com/groups/global/AllUsers"===o.Grantee.URI?i[o.Permission]=1:o.Grantee.ID!==e.Owner.ID&&t[n[o.Permission]].push('id="'+o.Grantee.ID+'"')}),i.FULL_CONTROL||i.WRITE&&i.READ?t.ACL="public-read-write":i.READ?t.ACL="public-read":t.ACL="private",Te.each(n,function(e){t[e]=Ce(t[e].join(","))}),t}function Ce(e){var t,n,o=e.split(","),r={};for(t=0;t-1?"{Region}.myqcloud.com":"cos.{Region}.myqcloud.com",e.ForcePathStyle||(r="{Bucket}."+r)),r=r.replace(/\{\{AppId\}\}/gi,o).replace(/\{\{Bucket\}\}/gi,n).replace(/\{\{Region\}\}/gi,i).replace(/\{\{.*?\}\}/gi,""),r=r.replace(/\{AppId\}/gi,o).replace(/\{BucketName\}/gi,n).replace(/\{Bucket\}/gi,t).replace(/\{Region\}/gi,i).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(r)||(r=s+"//"+r),"/"===r.slice(-1)&&(r=r.slice(0,-1));var c=r;return e.ForcePathStyle&&(c+="/"+t),c+="/",a&&(c+=Te.camSafeUrlEncode(a).replace(/%2F/g,"/")),e.isLocation&&(c=c.replace(/^https?:\/\//,"")),c}function ke(e,t){var n=Te.clone(e.Headers);delete n["Content-Type"],delete n["Cache-Control"],Te.each(n,function(e,t){""===e&&delete n[t]});var o=function(e){var n=!1,o=e.Authorization;if(o)if(o.indexOf(" ")>-1)n=!1;else if(o.indexOf("q-sign-algorithm=")>-1&&o.indexOf("q-ak=")>-1&&o.indexOf("q-sign-time=")>-1&&o.indexOf("q-key-time=")>-1&&o.indexOf("q-url-param-list=")>-1)n=!0;else try{o=atob(o),o.indexOf("a=")>-1&&o.indexOf("k=")>-1&&o.indexOf("t=")>-1&&o.indexOf("r=")>-1&&o.indexOf("b=")>-1&&(n=!0)}catch(e){}n?t&&t(null,e):t&&t("authorization error")},r=this,i=e.Bucket||"",a=e.Region||"",s=e.Key||"";r.options.ForcePathStyle&&i&&(s=i+"/"+s);var c="/"+s,u={},l=e.Scope;if(!l){var d=e.Action||"",f=e.ResourceKey||e.Key||"";l=e.Scope||[{action:d,bucket:i,region:a,prefix:f}]}var h=Te.md5(JSON.stringify(l));r._StsCache=r._StsCache||[],function(){var e,t;for(e=r._StsCache.length-1;e>=0;e--){t=r._StsCache[e];var n=Math.round(Te.getSkewTime(r.options.SystemClockOffset)/1e3)+30;if(t.StartTime&&n=t.ExpiredTime)r._StsCache.splice(e,1);else if(!t.ScopeLimit||t.ScopeLimit&&t.ScopeKey===h){u=t;break}}}();var p=function(){var t=u.StartTime&&u.ExpiredTime?u.StartTime+";"+u.ExpiredTime:"",i=Te.getAuth({SecretId:u.TmpSecretId,SecretKey:u.TmpSecretKey,Method:e.Method,Pathname:c,Query:e.Query,Headers:n,Expires:e.Expires,UseRawKey:r.options.UseRawKey,SystemClockOffset:r.options.SystemClockOffset,KeyTime:t}),a={Authorization:i,XCosSecurityToken:u.XCosSecurityToken||"",Token:u.Token||"",ClientIP:u.ClientIP||"",ClientUA:u.ClientUA||""};o(a)};if(u.ExpiredTime&&u.ExpiredTime-Te.getSkewTime(r.options.SystemClockOffset)/1e3>60)p();else if(r.options.getAuthorization)r.options.getAuthorization.call(r,{Bucket:i,Region:a,Method:e.Method,Key:s,Pathname:c,Query:e.Query,Headers:n,Scope:l,SystemClockOffset:r.options.SystemClockOffset},function(e){"string"==typeof e&&(e={Authorization:e}),e.TmpSecretId&&e.TmpSecretKey&&e.XCosSecurityToken&&e.ExpiredTime?(u=e||{},u.Scope=l,u.ScopeKey=h,r._StsCache.push(u),p()):o(e)});else{if(!r.options.getSTS)return function(){var t=Te.getAuth({SecretId:e.SecretId||r.options.SecretId,SecretKey:e.SecretKey||r.options.SecretKey,Method:e.Method,Pathname:c,Query:e.Query,Headers:n,Expires:e.Expires,UseRawKey:r.options.UseRawKey,SystemClockOffset:r.options.SystemClockOffset}),i={Authorization:t,XCosSecurityToken:r.options.XCosSecurityToken};return o(i),i}();r.options.getSTS.call(r,{Bucket:i,Region:a},function(e){u=e||{},u.Scope=l,u.ScopeKey=h,u.TmpSecretId=u.SecretId,u.TmpSecretKey=u.SecretKey,r._StsCache.push(u),p()})}return""}function Re(e){var t=!1,n=!1,o=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var r=e.error.Code,i=e.error.Message;("RequestTimeTooSkewed"===r||"AccessDenied"===r&&"Request has expired"===i)&&(n=!0)}catch(e){}if(e)if(n&&o){var a=Date.parse(o);this.options.CorrectClockSkew&&Math.abs(Te.getSkewTime(this.options.SystemClockOffset)-a)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=a-Date.now(),t=!0)}else 5===Math.floor(e.statusCode/100)&&(t=!0);return t}function Se(e,t){var n=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=Te.clearKey(e.qs),e.headers&&(e.headers=Te.clearKey(e.headers)),e.qs&&(e.qs=Te.clearKey(e.qs));var o=Te.clone(e.qs);e.action&&(o[e.action]="");var r=function(i){var a=n.options.SystemClockOffset;ke.call(n,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:o,Headers:e.headers,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope},function(o,s){if(o)return void t(o);e.AuthData=s,Ae.call(n,e,function(o,s){o&&i<2&&(a!==n.options.SystemClockOffset||Re.call(n,o))?(e.headers&&(delete e.headers.Authorization,delete e.headers.token,delete e.headers.clientIP,delete e.headers.clientUA,delete e.headers["x-cos-security-token"]),r(i+1)):t(o,s)})})};r(1)}function Ae(e,t){var n=this,o=e.TaskId;if(!o||n._isRunningTask(o)){var r=e.Bucket,i=e.Region,a=e.Key,s=e.method||"GET",c=e.url,u=e.body,l=e.rawBody;c=c||ve({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:r,region:i,object:a}),e.action&&(c=c+"?"+e.action);var d={method:s,url:c,headers:e.headers,qs:e.qs,body:u};if(d.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(d.headers.token=e.AuthData.Token),e.AuthData.ClientIP&&(d.headers.clientIP=e.AuthData.ClientIP),e.AuthData.ClientUA&&(d.headers.clientUA=e.AuthData.ClientUA),e.AuthData.XCosSecurityToken&&(d.headers["x-cos-security-token"]=e.AuthData.XCosSecurityToken),d.headers&&(d.headers=Te.clearKey(d.headers)),d=Te.clearKey(d),e.onProgress&&"function"==typeof e.onProgress){var f=u&&(u.size||u.length)||0;d.onProgress=function(t){if(!o||n._isRunningTask(o)){var r=t?t.loaded:0;e.onProgress({loaded:r,total:f})}}}e.DataType&&(d.dataType=e.DataType),this.options.Timeout&&(d.timeout=this.options.Timeout),e.Interface?d.cosInterface=e.Interface:e.Action&&(d.cosInterface=e.Action.replace(/^name\/cos:/,"")),n.options.ForcePathStyle&&(d.pathStyle=n.options.ForcePathStyle),n.emit("before-send",d);var h=(n.options.Request||Be)(d,function(e){if("abort"!==e.error){n.emit("after-receive",e);var r,i={statusCode:e.statusCode,statusMessage:e.statusMessage,headers:e.headers},a=e.error,s=e.body,c=function(e,a){if(o&&n.off("inner-kill-task",p),!r){r=!0;var s={};i&&i.statusCode&&(s.statusCode=i.statusCode),i&&i.headers&&(s.headers=i.headers),e?(e=Te.extend(e||{},s),t(e,null)):(a=Te.extend(a||{},s),t(null,a)),h=null}};if(a)return void c({error:a});var u;if(l)u={},u.body=s;else try{u=s&&s.indexOf("<")>-1&&s.indexOf(">")>-1&&Te.xml2json(s)||{}}catch(e){u=s||{}}var d=i.statusCode;return 2===Math.floor(d/100)?u.Error?void c({error:u.Error}):void c(null,u):void c({error:u.Error||u})}}),p=function(e){e.TaskId===o&&(h&&h.abort&&h.abort(),n.off("inner-kill-task",p))};o&&n.on("inner-kill-task",p)}}function be(e,t,n){Te.each(["Cors","Acl"],function(o){if(e.slice(-o.length)===o){var r=e.slice(0,-o.length)+o.toUpperCase(),i=Te.apiWrapper(e,t),a=!1;n[r]=function(){!a&&console.warn("warning: cos."+r+" has been deprecated. Please Use cos."+e+" instead."),a=!0,i.apply(this,arguments)}}})}var Be=n(17),Te=n(0),xe={getService:o,putBucket:r,headBucket:i,getBucket:a,deleteBucket:s,putBucketAcl:c,getBucketAcl:u,putBucketCors:l,getBucketCors:d,deleteBucketCors:f,getBucketLocation:h,getBucketPolicy:g,putBucketPolicy:p,deleteBucketPolicy:m,putBucketTagging:y,getBucketTagging:C,deleteBucketTagging:v,putBucketLifecycle:k,getBucketLifecycle:R,deleteBucketLifecycle:S,putBucketVersioning:A,getBucketVersioning:b,putBucketReplication:B,getBucketReplication:T,deleteBucketReplication:x,putBucketWebsite:E,getBucketWebsite:_,deleteBucketWebsite:w,putBucketReferer:I,getBucketReferer:O,putBucketDomain:D,getBucketDomain:N,deleteBucketDomain:P,putBucketOrigin:M,getBucketOrigin:U,deleteBucketOrigin:H,putBucketLogging:L,getBucketLogging:F,putBucketInventory:K,getBucketInventory:j,listBucketInventory:z,deleteBucketInventory:G,putBucketAccelerate:q,getBucketAccelerate:X,getObject:$,headObject:V,listObjectVersions:W,putObject:Q,deleteObject:J,getObjectAcl:Y,putObjectAcl:Z,optionsObject:ee,putObjectCopy:te,deleteMultipleObject:oe,restoreObject:re,putObjectTagging:ie,getObjectTagging:ae,deleteObjectTagging:se,selectObjectContent:ce,uploadPartCopy:ne,multipartInit:ue,multipartUpload:le,multipartComplete:de,multipartList:fe,multipartListPart:he,multipartAbort:pe,getObjectUrl:me,getAuth:ge};e.exports.init=function(e,t){t.transferToTaskMethod(xe,"putObject"),Te.each(xe,function(t,n){e.prototype[n]=Te.apiWrapper(n,t),be(n,t,e.prototype)})}},function(e,t){var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},o=function(e,t,o,r){return t=t||"&",o=o||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(r){var i=encodeURIComponent(n(r))+o;return Array.isArray(e[r])?e[r].map(function(e){return i+encodeURIComponent(n(e))}).join(t):i+encodeURIComponent(n(e[r]))}).filter(Boolean).join(t):r?encodeURIComponent(n(r))+o+encodeURIComponent(n(e)):""},r=function(e,t,n){var o={};return t.getAllResponseHeaders().trim().split("\n").forEach(function(e){if(e){var t=e.indexOf(":"),n=e.substr(0,t).trim().toLowerCase(),r=e.substr(t+1).trim();o[n]=r}}),{error:e,statusCode:t.status,statusMessage:t.statusText,headers:o,body:n}},i=function(e,t){return t||"text"!==t?e.response:e.responseText},a=function(e,t){var n=(e.method||"GET").toUpperCase(),a=e.url;if(e.qs){var s=o(e.qs);s&&(a+=(-1===a.indexOf("?")?"?":"&")+s)}var c=new XMLHttpRequest;c.open(n,a,!0),c.responseType=e.dataType||"text";var u=e.headers;if(u)for(var l in u)u.hasOwnProperty(l)&&"content-length"!==l.toLowerCase()&&"user-agent"!==l.toLowerCase()&&"origin"!==l.toLowerCase()&&"host"!==l.toLowerCase()&&c.setRequestHeader(l,u[l]);return e.onProgress&&c.upload&&(c.upload.onprogress=e.onProgress),c.onload=function(){t(r(null,c,i(c,e.dataType)))},c.onerror=function(n){var o=i(c,e.dataType);if(o)t(r(null,c,o));else{var a=c.statusText;a||0!==c.status||(a="CORS blocked or network error"),t(r(a,c,o))}},c.send(e.body||""),c};e.exports=a},function(e,t,n){function o(e,t){var n,o,i=this,a=new y,c=e.TaskId,l=e.Bucket,d=e.Region,f=e.Key,h=e.Body,p=e.ChunkSize||e.SliceSize||i.options.ChunkSize,m=e.AsyncLimit,v=e.StorageClass,k=e.ServerSideEncryption,R=e.onHashProgress;a.on("error",function(e){if(i._isRunningTask(c))return t(e)}),a.on("upload_complete",function(e){t(null,e)}),a.on("upload_slice_complete",function(t){var r={};C.each(e.Headers,function(e,t){var n=t.toLowerCase();0!==n.indexOf("x-cos-meta-")&&"pic-operations"!==n||(r[t]=e)}),u.call(i,{Bucket:l,Region:d,Key:f,UploadId:t.UploadId,SliceList:t.SliceList,Headers:r},function(e,r){if(i._isRunningTask(c)){if(g.removeUsing(t.UploadId),e)return o(null,!0),a.emit("error",e);g.removeUploadId(t.UploadId),o({loaded:n,total:n},!0),a.emit("upload_complete",r)}})}),a.on("get_upload_data_finish",function(t){var r=g.getFileId(h,e.ChunkSize,l,f);r&&g.saveUploadId(r,t.UploadId,i.options.UploadIdCacheLimit),g.setUsing(t.UploadId),o(null,!0),s.call(i,{TaskId:c,Bucket:l,Region:d,Key:f,Body:h,FileSize:n,SliceSize:p,AsyncLimit:m,ServerSideEncryption:k,UploadData:t,onProgress:o},function(e,t){if(i._isRunningTask(c))return e?(o(null,!0),a.emit("error",e)):void a.emit("upload_slice_complete",t)})}),a.on("get_file_size_finish",function(){if(o=C.throttleOnProgress.call(i,n,e.onProgress),e.UploadData.UploadId)a.emit("get_upload_data_finish",e.UploadData);else{var t=C.extend({TaskId:c,Bucket:l,Region:d,Key:f,Headers:e.Headers,StorageClass:v,Body:h,FileSize:n,SliceSize:p,onHashProgress:R},e);r.call(i,t,function(t,n){if(i._isRunningTask(c)){if(t)return a.emit("error",t);e.UploadData.UploadId=n.UploadId,e.UploadData.PartList=n.PartList,a.emit("get_upload_data_finish",e.UploadData)}})}}),n=e.ContentLength,delete e.ContentLength,!e.Headers&&(e.Headers={}),C.each(e.Headers,function(t,n){"content-length"===n.toLowerCase()&&delete e.Headers[n]}),function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],o=1048576,r=0;rh)return t(null,!1);if(n>1){if(Math.max(e[0].Size,e[1].Size)!==f)return t(null,!1)}var o=function(r){if(r=c.length)return void A.emit("has_and_check_upload_id",t);var i=c[e];return C.isInArray(t,i)?g.using[i]?void l(e+1):void a.call(u,{Bucket:o,Region:r,Key:s,UploadId:i},function(t,o){u._isRunningTask(n)&&(t?(g.removeUploadId(i),l(e+1)):A.emit("upload_id_available",{UploadId:i,PartList:o.PartList}))}):(g.removeUploadId(i),void l(e+1))};l(0)}),A.on("get_remote_upload_id_list",function(){i.call(u,{Bucket:o,Region:r,Key:s},function(t,r){if(u._isRunningTask(n)){if(t)return A.emit("error",t);var i=C.filter(r.UploadList,function(e){return e.Key===s&&(!c||e.StorageClass.toUpperCase()===c.toUpperCase())}).reverse().map(function(e){return e.UploadId||e.UploadID});if(i.length)A.emit("seek_local_avail_upload_id",i);else{var a,l=g.getFileId(e.Body,e.ChunkSize,o,s);l&&(a=g.getUploadIdList(l))&&C.each(a,function(e){g.removeUploadId(e)}),A.emit("no_available_upload_id")}}})}),A.emit("get_remote_upload_id_list")}function i(e,t){var n=this,o=[],r={Bucket:e.Bucket,Region:e.Region,Prefix:e.Key},i=function(){n.multipartList(r,function(e,n){if(e)return t(e);o.push.apply(o,n.Upload||[]),"true"===n.IsTruncated?(r.KeyMarker=n.NextKeyMarker,r.UploadIdMarker=n.NextUploadIdMarker,i()):t(null,{UploadList:o})})};i()}function a(e,t){var n=this,o=[],r={Bucket:e.Bucket,Region:e.Region,Key:e.Key,UploadId:e.UploadId},i=function(){n.multipartListPart(r,function(e,n){if(e)return t(e);o.push.apply(o,n.Part||[]),"true"===n.IsTruncated?(r.PartNumberMarker=n.NextPartNumberMarker,i()):t(null,{PartList:o})})};i()}function s(e,t){var n=this,o=e.TaskId,r=e.Bucket,i=e.Region,a=e.Key,s=e.UploadData,u=e.FileSize,l=e.SliceSize,d=Math.min(e.AsyncLimit||n.options.ChunkParallelLimit||1,256),f=e.Body,h=Math.ceil(u/l),p=0,g=e.ServerSideEncryption,y=C.filter(s.PartList,function(e){return e.Uploaded&&(p+=e.PartNumber>=h?u%l||l:l),!e.Uploaded}),v=e.onProgress;m.eachLimit(y,d,function(e,t){if(n._isRunningTask(o)){var d=e.PartNumber,h=Math.min(u,e.PartNumber*l)-(e.PartNumber-1)*l,m=0;c.call(n,{TaskId:o,Bucket:r,Region:i,Key:a,SliceSize:l,FileSize:u,PartNumber:d,ServerSideEncryption:g,Body:f,UploadData:s,onProgress:function(e){p+=e.loaded-m,m=e.loaded,v({loaded:p,total:u})}},function(r,i){n._isRunningTask(o)&&(r||i.ETag||(r='get ETag error, please add "ETag" to CORS ExposeHeader setting.'),r?p-=m:(p+=h-m,e.ETag=i.ETag),v({loaded:p,total:u}),t(r||null,i))})}},function(e){if(n._isRunningTask(o))return e?t(e):void t(null,{UploadId:s.UploadId,SliceList:s.PartList})})}function c(e,t){var n=this,o=e.TaskId,r=e.Bucket,i=e.Region,a=e.Key,s=e.FileSize,c=e.Body,u=1*e.PartNumber,l=e.SliceSize,d=e.ServerSideEncryption,f=e.UploadData,h=n.options.ChunkRetryTimes+1,p=l*(u-1),g=l,y=p+l;y>s&&(y=s,g=y-p);var v=f.PartList[u-1];m.retry(h,function(t){n._isRunningTask(o)&&C.fileSlice(c,p,y,!0,function(s){n.multipartUpload({TaskId:o,Bucket:r,Region:i,Key:a,ContentLength:g,PartNumber:u,UploadId:f.UploadId,ServerSideEncryption:d,Body:s,onProgress:e.onProgress},function(e,r){if(n._isRunningTask(o))return e?t(e):(v.Uploaded=!0,t(null,r))})})},function(e,r){if(n._isRunningTask(o))return t(e,r)})}function u(e,t){var n=e.Bucket,o=e.Region,r=e.Key,i=e.UploadId,a=e.SliceList,s=this,c=this.options.ChunkRetryTimes+1,u=e.Headers,l=a.map(function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}});m.retry(c,function(e){s.multipartComplete({Bucket:n,Region:o,Key:r,UploadId:i,Parts:l,Headers:u},e)},function(e,n){t(e,n)})}function l(e,t){var n=e.Bucket,o=e.Region,r=e.Key,a=e.UploadId,s=e.Level||"task",c=e.AsyncLimit,u=this,l=new y;if(l.on("error",function(e){return t(e)}),l.on("get_abort_array",function(i){d.call(u,{Bucket:n,Region:o,Key:r,Headers:e.Headers,AsyncLimit:c,AbortArray:i},function(e,n){if(e)return t(e);t(null,n)})}),"bucket"===s)i.call(u,{Bucket:n,Region:o},function(e,n){if(e)return t(e);l.emit("get_abort_array",n.UploadList||[])});else if("file"===s){if(!r)return t({error:"abort_upload_task_no_key"});i.call(u,{Bucket:n,Region:o,Key:r},function(e,n){if(e)return t(e);l.emit("get_abort_array",n.UploadList||[])})}else{if("task"!==s)return t({error:"abort_unknown_level"});if(!a)return t({error:"abort_upload_task_no_id"});if(!r)return t({error:"abort_upload_task_no_key"});l.emit("get_abort_array",[{Key:r,UploadId:a}])}}function d(e,t){var n=e.Bucket,o=e.Region,r=e.Key,i=e.AbortArray,a=e.AsyncLimit||1,s=this,c=0,u=new Array(i.length);m.eachLimit(i,a,function(t,i){var a=c;if(r&&r!==t.Key)return u[a]={error:{KeyNotMatch:!0}},void i(null);var l=t.UploadId||t.UploadID;s.multipartAbort({Bucket:n,Region:o,Key:t.Key,Headers:e.Headers,UploadId:l},function(e){var r={Bucket:n,Region:o,Key:t.Key,UploadId:l};u[a]={error:e,task:r},i(null)}),c++},function(e){if(e)return t(e);for(var n=[],o=[],r=0,i=u.length;r=o?"sliceUploadFile":"putObject";d.push({api:v,params:e,callback:y})}()}),n._addTasks(d)}function h(e,t){var n=new y,o=this,r=e.Bucket,i=e.Region,a=e.Key,s=e.CopySource,c=s.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^\/]+\/(.+)$/);if(!c)return void t({error:"CopySource format error"});var u=c[1],l=c[3],d=decodeURIComponent(c[4]),f=void 0===e.CopySliceSize?o.options.CopySliceSize:e.CopySliceSize;f=Math.max(0,f);var h,g,v=e.CopyChunkSize||this.options.CopyChunkSize,k=this.options.CopyChunkParallelLimit,R=0;n.on("copy_slice_complete",function(n){var s={};C.each(e.Headers,function(e,t){0===t.toLowerCase().indexOf("x-cos-meta-")&&(s[t]=e)}),o.multipartComplete({Bucket:r,Region:i,Key:a,UploadId:n.UploadId,Parts:n.PartList},function(e,n){if(e)return g(null,!0),t(e);g({loaded:h,total:h},!0),t(null,n)})}),n.on("get_copy_data_finish",function(e){m.eachLimit(e.PartList,k,function(t,n){var c=t.PartNumber,u=t.CopySourceRange,l=t.end-t.start,d=0;p.call(o,{Bucket:r,Region:i,Key:a,CopySource:s,UploadId:e.UploadId,PartNumber:c,CopySourceRange:u,onProgress:function(e){R+=e.loaded-d,d=e.loaded,g({loaded:R,total:h})}},function(e,o){if(e)return n(e);g({loaded:R,total:h}),R+=l-d,t.ETag=o.ETag,n(e||null,o)})},function(o){if(o)return g(null,!0),t(o);n.emit("copy_slice_complete",e)})}),n.on("get_file_size_finish",function(s){!function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],n=1048576,r=0;r"x-cos-meta-".length&&(s[t]=e)}),n.emit("get_file_size_finish",s)}})}function p(e,t){var n=e.TaskId,o=e.Bucket,r=e.Region,i=e.Key,a=e.CopySource,s=e.UploadId,c=1*e.PartNumber,u=e.CopySourceRange,l=this.options.ChunkRetryTimes+1,d=this;m.retry(l,function(t){d.uploadPartCopy({TaskId:n,Bucket:o,Region:r,Key:i,CopySource:a,UploadId:s,PartNumber:c,CopySourceRange:u,onProgress:e.onProgress},function(e,n){t(e||null,n)})},function(e,n){return t(e,n)})}var g=n(4),m=n(19),y=n(3).EventProxy,C=n(0),v={sliceUploadFile:o,abortUploadTask:l,uploadFiles:f,sliceCopyFile:h};e.exports.init=function(e,t){t.transferToTaskMethod(v,"sliceUploadFile"),C.each(v,function(t,n){e.prototype[n]=C.apiWrapper(n,t)})}},function(e,t){var n=function(e,t,n,o){if(o=o||function(){},!e.length||t<=0)return o();var r=0,i=0,a=0;!function s(){if(r>=e.length)return o();for(;a=e.length?o():s())})}()},o=function(e,t,n){var o=function(r){t(function(t,i){t&&rt?1:-1})},f=function(e){var t,n,r,i=[],a=d(e);for(t=0;tparseInt(t[n])?1:-1;return 0};return function(t){var n=(t.match(/Chrome\/([.\d]+)/)||[])[1],o=(t.match(/QBCore\/([.\d]+)/)||[])[1],r=(t.match(/QQBrowser\/([.\d]+)/)||[])[1];return n&&e(n,"53.0.2785.116")<0&&o&&e(o,"3.53.991.400")<0&&r&&e(r,"9.0.2524.400")<=0||!1}(navigator&&navigator.userAgent)}(),S=function(e,t,n,o,r){var i;if(e.slice?i=e.slice(t,n):e.mozSlice?i=e.mozSlice(t,n):e.webkitSlice&&(i=e.webkitSlice(t,n)),o&&R){var a=new FileReader;a.onload=function(e){i=null,r(new Blob([a.result]))},a.readAsArrayBuffer(i)}else r(i)},A=function(e,t,n,o){n=n||C,e?"string"==typeof t?n(D.md5(t,!0)):Blob&&t instanceof Blob?D.getFileMd5(t,function(e,t){n(t)},o):n():n()},b=function(e,t,n){var o=e.size,r=0,i=h.getCtx(),a=function(s){if(s>=o){var c=i.digest("hex");return void t(null,c)}var u=Math.min(o,s+1048576);D.fileSlice(e,s,u,!1,function(e){k(e,function(t){e=null,i=i.update(t,!0),r+=t.length,t=null,n&&n({loaded:r,total:o,percent:Math.round(r/o*1e4)/1e4}),a(s+1048576)})})};a(0)},B=function(e){var t,n,o,r="";for(t=0,n=e.length/2;t-1||"deleteMultipleObject"===e||"multipartList"===e||"listObjectVersions"===e){if(!n)return"Bucket";if(!o)return"Region"}else if(e.indexOf("Object")>-1||e.indexOf("multipart")>-1||"sliceUploadFile"===e||"abortUploadTask"===e){if(!n)return"Bucket";if(!o)return"Region";if(!r)return"Key"}return!1},E=function(e,t){if(t=a({},t),"getAuth"!==e&&"getV4Auth"!==e&&"getObjectUrl"!==e){var n=t.Headers||{};if(t&&"object"==typeof t){!function(){for(var e in t)t.hasOwnProperty(e)&&e.indexOf("x-cos-")>-1&&(n[e]=t[e])}();var o={"x-cos-mfa":"MFA","Content-MD5":"ContentMD5","Content-Length":"ContentLength","Content-Type":"ContentType",Expect:"Expect",Expires:"Expires","Cache-Control":"CacheControl","Content-Disposition":"ContentDisposition","Content-Encoding":"ContentEncoding",Range:"Range","If-Modified-Since":"IfModifiedSince","If-Unmodified-Since":"IfUnmodifiedSince","If-Match":"IfMatch","If-None-Match":"IfNoneMatch","x-cos-copy-source":"CopySource","x-cos-copy-source-Range":"CopySourceRange","x-cos-metadata-directive":"MetadataDirective","x-cos-copy-source-If-Modified-Since":"CopySourceIfModifiedSince","x-cos-copy-source-If-Unmodified-Since":"CopySourceIfUnmodifiedSince","x-cos-copy-source-If-Match":"CopySourceIfMatch","x-cos-copy-source-If-None-Match":"CopySourceIfNoneMatch","x-cos-acl":"ACL","x-cos-grant-read":"GrantRead","x-cos-grant-write":"GrantWrite","x-cos-grant-full-control":"GrantFullControl","x-cos-grant-read-acp":"GrantReadAcp","x-cos-grant-write-acp":"GrantWriteAcp","x-cos-storage-class":"StorageClass","x-cos-server-side-encryption-customer-algorithm":"SSECustomerAlgorithm","x-cos-server-side-encryption-customer-key":"SSECustomerKey","x-cos-server-side-encryption-customer-key-MD5":"SSECustomerKeyMD5","x-cos-server-side-encryption":"ServerSideEncryption","x-cos-server-side-encryption-cos-kms-key-id":"SSEKMSKeyId","x-cos-server-side-encryption-context":"SSEContext"};D.each(o,function(e,o){void 0!==t[e]&&(n[o]=t[e])}),t.Headers=v(n)}}return t},_=function(e,n){return function(o,r){var i=this;"function"==typeof o&&(r=o,o={}),o=E(e,o);var a=function(e){return e&&e.headers&&(e.headers["x-cos-version-id"]&&(e.VersionId=e.headers["x-cos-version-id"]),e.headers["x-cos-delete-marker"]&&(e.DeleteMarker=e.headers["x-cos-delete-marker"])),e},s=function(e,t){r&&r(a(e),a(t))},c=function(){if("getService"!==e&&"abortUploadTask"!==e){var t=x(e,o);if(t)return"missing param "+t;if(o.Region){if(o.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(o.Region))return"Region format error.";i.options.CompatibilityMode||-1!==o.Region.indexOf("-")||"yfb"===o.Region||"default"===o.Region||console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(o.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(o.Bucket))if(o.AppId)o.Bucket=o.Bucket+"-"+o.AppId;else{if(!i.options.AppId)return'Bucket should format as "test-1250000000".';o.Bucket=o.Bucket+"-"+i.options.AppId}o.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete o.AppId)}!i.options.UseRawKey&&o.Key&&"/"===o.Key.substr(0,1)&&(o.Key=o.Key.substr(1))}}(),u="getAuth"===e||"getObjectUrl"===e,l=t.Promise;if(!u&&l&&!r)return new l(function(e,t){if(r=function(n,o){n?t(n):e(o)},c)return s({error:c});n.call(i,o,s)});if(c)return s({error:c});var d=n.call(i,o,s);return u?d:void 0}},w=function(e,t){function n(){if(r=0,t&&"function"==typeof t){o=Date.now();var n,i=Math.max(0,Math.round((s-a)/((o-c)/1e3)*100)/100)||0;n=0===s&&0===e?1:Math.floor(s/e*100)/100||0,c=o,a=s;try{t({loaded:s,total:e,speed:i,percent:n})}catch(e){}}}var o,r,i=this,a=0,s=0,c=Date.now();return function(t,o){if(t&&(s=t.loaded,e=t.total),o)clearTimeout(r),n();else{if(r)return;r=setTimeout(n,i.options.ProgressInterval)}}},I=function(e,t,n){var o;if("string"==typeof t.Body?t.Body=new Blob([t.Body],{type:"text/plain"}):t.Body instanceof ArrayBuffer&&(t.Body=new Blob([t.Body])),!t.Body||!(t.Body instanceof Blob||"[object File]"===t.Body.toString()||"[object Blob]"===t.Body.toString()))return void n({error:"params body format error, Only allow File|Blob|String."});o=t.Body.size,t.ContentLength=o,n(null,o)},O=function(e){return Date.now()+(e||0)},D={noop:C,formatParams:E,apiWrapper:_,xml2json:g,json2xml:m,md5:h,clearKey:v,fileSlice:S,getBodyMd5:A,getFileMd5:b,binaryBase64:B,extend:a,isArray:s,isInArray:c,makeArray:u,each:l,map:d,filter:f,clone:r,attr:i,uuid:T,camSafeUrlEncode:o,throttleOnProgress:w,getFileSize:I,getSkewTime:O,getAuth:y,isBrowser:!0};e.exports=D}).call(t,n(1))},function(e,t){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t){function n(e,t){for(var n in e)t[n]=e[n]}function o(e,t){function o(){}var r=e.prototype;if(Object.create){var i=Object.create(t.prototype);r.__proto__=i}r instanceof t||(o.prototype=t.prototype,o=new o,n(r,o),e.prototype=r=o),r.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),r.constructor=e)}function r(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,re[e]),this.message=re[e],Error.captureStackTrace&&Error.captureStackTrace(this,r);return n.code=e,t&&(this.message=this.message+": "+t),n}function i(){}function a(e,t){this._node=e,this._refresh=t,s(this)}function s(e){var t=e._node._inc||e._node.ownerDocument._inc;if(e._inc!=t){var o=e._refresh(e._node);K(e,"length",o.length),n(o,e),e._inc=t}}function c(){}function u(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function l(e,t,n,o){if(o?t[u(t,o)]=n:t[t.length++]=n,e){n.ownerElement=e;var r=e.ownerDocument;r&&(o&&C(r,e,o),y(r,e,n))}}function d(e,t,n){var o=u(t,n);if(!(o>=0))throw r(ae,new Error(e.tagName+"@"+n));for(var i=t.length-1;o"==e&&">"||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function g(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(g(e,t))return!0}while(e=e.nextSibling)}function m(){}function y(e,t,n){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&(t._nsMap[n.prefix?n.localName:""]=n.value)}function C(e,t,n,o){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete t._nsMap[n.prefix?n.localName:""]}function v(e,t,n){if(e&&e._inc){e._inc++;var o=t.childNodes;if(n)o[o.length++]=n;else{for(var r=t.firstChild,i=0;r;)o[i++]=r,r=r.nextSibling;o.length=i}}}function k(e,t){var n=t.previousSibling,o=t.nextSibling;return n?n.nextSibling=o:e.firstChild=o,o?o.previousSibling=n:e.lastChild=n,v(e.ownerDocument,e),t}function R(e,t,n){var o=t.parentNode;if(o&&o.removeChild(t),t.nodeType===te){var r=t.firstChild;if(null==r)return t;var i=t.lastChild}else r=i=t;var a=n?n.previousSibling:e.lastChild;r.previousSibling=a,i.nextSibling=n,a?a.nextSibling=r:e.firstChild=r,null==n?e.lastChild=i:n.previousSibling=i;do{r.parentNode=e}while(r!==i&&(r=r.nextSibling));return v(e.ownerDocument||e,e),t.nodeType==te&&(t.firstChild=t.lastChild=null),t}function S(e,t){var n=t.parentNode;if(n){var o=e.lastChild;n.removeChild(t);var o=e.lastChild}var o=e.lastChild;return t.parentNode=e,t.previousSibling=o,t.nextSibling=null,o?o.nextSibling=t:e.firstChild=t,e.lastChild=t,v(e.ownerDocument,e,t),t}function A(){this._nsMap={}}function b(){}function B(){}function T(){}function x(){}function E(){}function _(){}function w(){}function I(){}function O(){}function D(){}function N(){}function P(){}function M(e,t){var n=[],o=9==this.nodeType?this.documentElement:this,r=o.prefix,i=o.namespaceURI;if(i&&null==r){var r=o.lookupPrefix(i);if(null==r)var a=[{namespace:i,prefix:null}]}return H(this,n,e,t,a),n.join("")}function U(e,t,n){var o=e.prefix||"",r=e.namespaceURI;if(!o&&!r)return!1;if("xml"===o&&"http://www.w3.org/XML/1998/namespace"===r||"http://www.w3.org/2000/xmlns/"==r)return!1;for(var i=n.length;i--;){var a=n[i];if(a.prefix==o)return a.namespace!=r}return!0}function H(e,t,n,o,r){if(o){if(!(e=o(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case q:r||(r=[]);var i=(r.length,e.attributes),a=i.length,s=e.firstChild,c=e.tagName;n=z===e.namespaceURI||n,t.push("<",c);for(var u=0;u"),n&&/^script$/i.test(c))for(;s;)s.data?t.push(s.data):H(s,t,n,o,r),s=s.nextSibling;else for(;s;)H(s,t,n,o,r),s=s.nextSibling;t.push("")}else t.push("/>");return;case Z:case te:for(var s=e.firstChild;s;)H(s,t,n,o,r),s=s.nextSibling;return;case X:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,p),'"');case V:return t.push(e.data.replace(/[<&]/g,p));case W:return t.push("");case Y:return t.push("\x3c!--",e.data,"--\x3e");case ee:var g=e.publicId,m=e.systemId;if(t.push("');else if(m&&"."!=m)t.push(' SYSTEM "',m,'">');else{var y=e.internalSubset;y&&t.push(" [",y,"]"),t.push(">")}return;case J:return t.push("");case $:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function L(e,t,n){var o;switch(t.nodeType){case q:o=t.cloneNode(!1),o.ownerDocument=e;case te:break;case X:n=!0}if(o||(o=t.cloneNode(!1)),o.ownerDocument=e,o.parentNode=null,n)for(var r=t.firstChild;r;)o.appendChild(L(e,r,n)),r=r.nextSibling;return o}function F(e,t,n){var o=new t.constructor;for(var r in t){var a=t[r];"object"!=typeof a&&a!=o[r]&&(o[r]=a)}switch(t.childNodes&&(o.childNodes=new i),o.ownerDocument=e,o.nodeType){case q:var s=t.attributes,u=o.attributes=new c,l=s.length;u._ownerElement=o;for(var d=0;d0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var o in n)if(n[o]==e)return o;t=t.nodeType==X?t.ownerDocument:t.parentNode}return null},lookupNamespaceURI:function(e){for(var t=this;t;){var n=t._nsMap;if(n&&e in n)return n[e];t=t.nodeType==X?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},n(G,h),n(G,h.prototype),m.prototype={nodeName:"#document",nodeType:Z,doctype:null,documentElement:null,_inc:1,insertBefore:function(e,t){if(e.nodeType==te){for(var n=e.firstChild;n;){var o=n.nextSibling;this.insertBefore(n,t),n=o}return e}return null==this.documentElement&&e.nodeType==q&&(this.documentElement=e),R(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),k(this,e)},importNode:function(e,t){return L(this,e,t)},getElementById:function(e){var t=null;return g(this.documentElement,function(n){if(n.nodeType==q&&n.getAttribute("id")==e)return t=n,!0}),t},createElement:function(e){var t=new A;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new i,(t.attributes=new c)._ownerElement=t,t},createDocumentFragment:function(){var e=new D;return e.ownerDocument=this,e.childNodes=new i,e},createTextNode:function(e){var t=new T;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new x;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new E;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new N;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new b;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new O;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new A,o=t.split(":"),r=n.attributes=new c;return n.childNodes=new i,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==o.length?(n.prefix=o[0],n.localName=o[1]):n.localName=t,r._ownerElement=n,n},createAttributeNS:function(e,t){var n=new b,o=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==o.length?(n.prefix=o[0],n.localName=o[1]):n.localName=t,n}},o(m,h),A.prototype={nodeType:q,hasAttribute:function(e){return null!=this.getAttributeNode(e)},getAttribute:function(e){var t=this.getAttributeNode(e);return t&&t.value||""},getAttributeNode:function(e){return this.attributes.getNamedItem(e)},setAttribute:function(e,t){var n=this.ownerDocument.createAttribute(e);n.value=n.nodeValue=""+t,this.setAttributeNode(n)},removeAttribute:function(e){var t=this.getAttributeNode(e);t&&this.removeAttributeNode(t)},appendChild:function(e){return e.nodeType===te?this.insertBefore(e,null):S(this,e)},setAttributeNode:function(e){return this.attributes.setNamedItem(e)},setAttributeNodeNS:function(e){return this.attributes.setNamedItemNS(e)},removeAttributeNode:function(e){return this.attributes.removeNamedItem(e.nodeName)},removeAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);n&&this.removeAttributeNode(n)},hasAttributeNS:function(e,t){return null!=this.getAttributeNodeNS(e,t)},getAttributeNS:function(e,t){var n=this.getAttributeNodeNS(e,t);return n&&n.value||""},setAttributeNS:function(e,t,n){var o=this.ownerDocument.createAttributeNS(e,t);o.value=o.nodeValue=""+n,this.setAttributeNode(o)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new a(this,function(t){var n=[];return g(t,function(o){o===t||o.nodeType!=q||"*"!==e&&o.tagName!=e||n.push(o)}),n})},getElementsByTagNameNS:function(e,t){return new a(this,function(n){var o=[];return g(n,function(r){r===n||r.nodeType!==q||"*"!==e&&r.namespaceURI!==e||"*"!==t&&r.localName!=t||o.push(r)}),o})}},m.prototype.getElementsByTagName=A.prototype.getElementsByTagName,m.prototype.getElementsByTagNameNS=A.prototype.getElementsByTagNameNS,o(A,h),b.prototype.nodeType=X,o(b,h),B.prototype={data:"",substringData:function(e,t){return this.data.substring(e,e+t)},appendData:function(e){e=this.data+e,this.nodeValue=this.data=e,this.length=e.length},insertData:function(e,t){this.replaceData(e,0,t)},appendChild:function(e){throw new Error(re[ie])},deleteData:function(e,t){this.replaceData(e,t,"")},replaceData:function(e,t,n){n=this.data.substring(0,e)+n+this.data.substring(e+t),this.nodeValue=this.data=n,this.length=n.length}},o(B,h),T.prototype={nodeName:"#text",nodeType:V,splitText:function(e){var t=this.data,n=t.substring(e);t=t.substring(0,e),this.data=this.nodeValue=t,this.length=t.length;var o=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(o,this.nextSibling),o}},o(T,B),x.prototype={nodeName:"#comment",nodeType:Y},o(x,B),E.prototype={nodeName:"#cdata-section",nodeType:W},o(E,B),_.prototype.nodeType=ee,o(_,h),w.prototype.nodeType=ne,o(w,h),I.prototype.nodeType=Q,o(I,h),O.prototype.nodeType=$,o(O,h),D.prototype.nodeName="#document-fragment",D.prototype.nodeType=te,o(D,h),N.prototype.nodeType=J,o(N,h),P.prototype.serializeToString=function(e,t,n){return M.call(e,t,n)},h.prototype.toString=M;try{Object.defineProperty&&(Object.defineProperty(a.prototype,"length",{get:function(){return s(this),this.$$length}}),Object.defineProperty(h.prototype,"textContent",{get:function(){return j(this)},set:function(e){switch(this.nodeType){case q:case te:for(;this.firstChild;)this.removeChild(this.firstChild);(e||String(e))&&this.appendChild(this.ownerDocument.createTextNode(e));break;default:this.data=e,this.value=e,this.nodeValue=e}}}),K=function(e,t,n){e["$$"+t]=n})}catch(e){}t.DOMImplementation=f,t.XMLSerializer=P},function(e,t){var n=function(e){var t={},n=function(e){return!t[e]&&(t[e]=[]),t[e]};e.on=function(e,t){"task-list-update"===e&&console.warn('warning: Event "'+e+'" has been deprecated. Please use "list-update" instead.'),n(e).push(t)},e.off=function(e,t){for(var o=n(e),r=o.length-1;r>=0;r--)t===o[r]&&o.splice(r,1)},e.emit=function(e,t){for(var o=n(e).map(function(e){return e}),r=0;r=0;n--){var r=o[n][2];(!r||r+2592e3=0;r--){var i=o[r];i[0]===e&&i[1]===t&&o.splice(r,1)}o.unshift([e,t,Math.round(Date.now()/1e3)]),o.length>n&&o.splice(n),u()}},removeUploadId:function(e){c(),delete l.using[e];for(var t=o.length-1;t>=0;t--)o[t][1]===e&&o.splice(t,1);u()}};e.exports=l},function(e,t,n){var o=n(6);e.exports=o},function(e,t,n){"use strict";var o=n(0),r=n(3),i=n(15),a=n(16),s=n(18),c={AppId:"",SecretId:"",SecretKey:"",XCosSecurityToken:"",ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1048576,SliceSize:1048576,CopyChunkParallelLimit:20,CopyChunkSize:10485760,CopySliceSize:10485760,MaxPartNumber:1e4,ProgressInterval:1e3,UploadQueueSize:1e4,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,UseRawKey:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadAddMetaMd5:!1,UploadIdCacheLimit:50},u=function(e){this.options=o.extend(o.clone(c),e||{}),this.options.FileParallelLimit=Math.max(1,this.options.FileParallelLimit),this.options.ChunkParallelLimit=Math.max(1,this.options.ChunkParallelLimit),this.options.ChunkRetryTimes=Math.max(0,this.options.ChunkRetryTimes),this.options.ChunkSize=Math.max(1048576,this.options.ChunkSize),this.options.CopyChunkParallelLimit=Math.max(1,this.options.CopyChunkParallelLimit),this.options.CopyChunkSize=Math.max(1048576,this.options.CopyChunkSize),this.options.CopySliceSize=Math.max(0,this.options.CopySliceSize),this.options.MaxPartNumber=Math.max(1024,Math.min(1e4,this.options.MaxPartNumber)),this.options.Timeout=Math.max(0,this.options.Timeout),this.options.AppId&&console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000").'),r.init(this),i.init(this)};a.init(u,i),s.init(u,i),u.getAuthorization=o.getAuth,u.version="1.1.5",e.exports=u},function(module,exports,__webpack_require__){(function(process,global){var __WEBPACK_AMD_DEFINE_RESULT__;!function(){"use strict";function Md5(e){if(e)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=global:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&"object"==typeof module&&module.exports,AMD=__webpack_require__(9),ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e){return function(t,n){return new Md5(!0).update(t,n)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.getCtx=e.create=function(){return new Md5},e.update=function(t){return e.create().update(t)};for(var t=0;t>2]|=e[a]<>6,u[i++]=128|63&r):r<55296||r>=57344?(u[i++]=224|r>>12,u[i++]=128|r>>6&63,u[i++]=128|63&r):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++a)),u[i++]=240|r>>18,u[i++]=128|r>>12&63,u[i++]=128|r>>6&63,u[i++]=128|63&r);else for(i=this.start;a>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(c[i>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=64?(this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=EXTRA[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var e,t,n,o,r,i,a=this.blocks;this.first?(e=a[0]-680876937,e=(e<<7|e>>>25)-271733879<<0,o=(-1732584194^2004318071&e)+a[1]-117830708,o=(o<<12|o>>>20)+e<<0,n=(-271733879^o&(-271733879^e))+a[2]-1126478375,n=(n<<17|n>>>15)+o<<0,t=(e^n&(o^e))+a[3]-1316259209,t=(t<<22|t>>>10)+n<<0):(e=this.h0,t=this.h1,n=this.h2,o=this.h3,e+=(o^t&(n^o))+a[0]-680876936,e=(e<<7|e>>>25)+t<<0,o+=(n^e&(t^n))+a[1]-389564586,o=(o<<12|o>>>20)+e<<0,n+=(t^o&(e^t))+a[2]+606105819,n=(n<<17|n>>>15)+o<<0,t+=(e^n&(o^e))+a[3]-1044525330,t=(t<<22|t>>>10)+n<<0),e+=(o^t&(n^o))+a[4]-176418897,e=(e<<7|e>>>25)+t<<0,o+=(n^e&(t^n))+a[5]+1200080426,o=(o<<12|o>>>20)+e<<0,n+=(t^o&(e^t))+a[6]-1473231341,n=(n<<17|n>>>15)+o<<0,t+=(e^n&(o^e))+a[7]-45705983,t=(t<<22|t>>>10)+n<<0,e+=(o^t&(n^o))+a[8]+1770035416,e=(e<<7|e>>>25)+t<<0,o+=(n^e&(t^n))+a[9]-1958414417,o=(o<<12|o>>>20)+e<<0,n+=(t^o&(e^t))+a[10]-42063,n=(n<<17|n>>>15)+o<<0,t+=(e^n&(o^e))+a[11]-1990404162,t=(t<<22|t>>>10)+n<<0,e+=(o^t&(n^o))+a[12]+1804603682,e=(e<<7|e>>>25)+t<<0,o+=(n^e&(t^n))+a[13]-40341101,o=(o<<12|o>>>20)+e<<0,n+=(t^o&(e^t))+a[14]-1502002290,n=(n<<17|n>>>15)+o<<0,t+=(e^n&(o^e))+a[15]+1236535329,t=(t<<22|t>>>10)+n<<0,e+=(n^o&(t^n))+a[1]-165796510,e=(e<<5|e>>>27)+t<<0,o+=(t^n&(e^t))+a[6]-1069501632,o=(o<<9|o>>>23)+e<<0,n+=(e^t&(o^e))+a[11]+643717713,n=(n<<14|n>>>18)+o<<0,t+=(o^e&(n^o))+a[0]-373897302,t=(t<<20|t>>>12)+n<<0,e+=(n^o&(t^n))+a[5]-701558691,e=(e<<5|e>>>27)+t<<0,o+=(t^n&(e^t))+a[10]+38016083,o=(o<<9|o>>>23)+e<<0,n+=(e^t&(o^e))+a[15]-660478335,n=(n<<14|n>>>18)+o<<0,t+=(o^e&(n^o))+a[4]-405537848,t=(t<<20|t>>>12)+n<<0,e+=(n^o&(t^n))+a[9]+568446438,e=(e<<5|e>>>27)+t<<0,o+=(t^n&(e^t))+a[14]-1019803690,o=(o<<9|o>>>23)+e<<0,n+=(e^t&(o^e))+a[3]-187363961,n=(n<<14|n>>>18)+o<<0,t+=(o^e&(n^o))+a[8]+1163531501,t=(t<<20|t>>>12)+n<<0,e+=(n^o&(t^n))+a[13]-1444681467,e=(e<<5|e>>>27)+t<<0,o+=(t^n&(e^t))+a[2]-51403784,o=(o<<9|o>>>23)+e<<0,n+=(e^t&(o^e))+a[7]+1735328473,n=(n<<14|n>>>18)+o<<0,t+=(o^e&(n^o))+a[12]-1926607734,t=(t<<20|t>>>12)+n<<0,r=t^n,e+=(r^o)+a[5]-378558,e=(e<<4|e>>>28)+t<<0,o+=(r^e)+a[8]-2022574463,o=(o<<11|o>>>21)+e<<0,i=o^e,n+=(i^t)+a[11]+1839030562,n=(n<<16|n>>>16)+o<<0,t+=(i^n)+a[14]-35309556,t=(t<<23|t>>>9)+n<<0,r=t^n,e+=(r^o)+a[1]-1530992060,e=(e<<4|e>>>28)+t<<0,o+=(r^e)+a[4]+1272893353,o=(o<<11|o>>>21)+e<<0,i=o^e,n+=(i^t)+a[7]-155497632,n=(n<<16|n>>>16)+o<<0,t+=(i^n)+a[10]-1094730640,t=(t<<23|t>>>9)+n<<0,r=t^n,e+=(r^o)+a[13]+681279174,e=(e<<4|e>>>28)+t<<0,o+=(r^e)+a[0]-358537222,o=(o<<11|o>>>21)+e<<0,i=o^e,n+=(i^t)+a[3]-722521979,n=(n<<16|n>>>16)+o<<0,t+=(i^n)+a[6]+76029189,t=(t<<23|t>>>9)+n<<0,r=t^n,e+=(r^o)+a[9]-640364487,e=(e<<4|e>>>28)+t<<0,o+=(r^e)+a[12]-421815835,o=(o<<11|o>>>21)+e<<0,i=o^e,n+=(i^t)+a[15]+530742520,n=(n<<16|n>>>16)+o<<0,t+=(i^n)+a[2]-995338651,t=(t<<23|t>>>9)+n<<0,e+=(n^(t|~o))+a[0]-198630844,e=(e<<6|e>>>26)+t<<0,o+=(t^(e|~n))+a[7]+1126891415,o=(o<<10|o>>>22)+e<<0,n+=(e^(o|~t))+a[14]-1416354905,n=(n<<15|n>>>17)+o<<0,t+=(o^(n|~e))+a[5]-57434055,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~o))+a[12]+1700485571,e=(e<<6|e>>>26)+t<<0,o+=(t^(e|~n))+a[3]-1894986606,o=(o<<10|o>>>22)+e<<0,n+=(e^(o|~t))+a[10]-1051523,n=(n<<15|n>>>17)+o<<0,t+=(o^(n|~e))+a[1]-2054922799,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~o))+a[8]+1873313359,e=(e<<6|e>>>26)+t<<0,o+=(t^(e|~n))+a[15]-30611744,o=(o<<10|o>>>22)+e<<0,n+=(e^(o|~t))+a[6]-1560198380,n=(n<<15|n>>>17)+o<<0,t+=(o^(n|~e))+a[13]+1309151649,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~o))+a[4]-145523070,e=(e<<6|e>>>26)+t<<0,o+=(t^(e|~n))+a[11]-1120210379,o=(o<<10|o>>>22)+e<<0,n+=(e^(o|~t))+a[2]+718787259,n=(n<<15|n>>>17)+o<<0,t+=(o^(n|~e))+a[9]-343485551,t=(t<<21|t>>>11)+n<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=n-1732584194<<0,this.h3=o+271733878<<0,this.first=!1):(this.h0=this.h0+e<<0,this.h1=this.h1+t<<0,this.h2=this.h2+n<<0,this.h3=this.h3+o<<0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,o=this.h3;return HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(e){if("hex"===e)return this.hex();this.finalize();var t=this.h0,n=this.h1,o=this.h2,r=this.h3;return[255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&o,o>>8&255,o>>16&255,o>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var e,t,n,o="",r=this.array(),i=0;i<15;)e=r[i++],t=r[i++],n=r[i++],o+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[63&(e<<4|t>>>4)]+BASE64_ENCODE_CHAR[63&(t<<2|n>>>6)]+BASE64_ENCODE_CHAR[63&n];return e=r[i],o+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+"=="};var exports=createMethod();COMMON_JS?module.exports=exports:(root.md5=exports,AMD&&void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=function(){return exports}.call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}()}).call(exports,__webpack_require__(8),__webpack_require__(1))},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function r(e){if(l===setTimeout)return setTimeout(e,0);if((l===n||!l)&&setTimeout)return l=setTimeout,setTimeout(e,0);try{return l(e,0)}catch(t){try{return l.call(null,e,0)}catch(t){return l.call(this,e,0)}}}function i(e){if(d===clearTimeout)return clearTimeout(e);if((d===o||!d)&&clearTimeout)return d=clearTimeout,clearTimeout(e);try{return d(e)}catch(t){try{return d.call(null,e)}catch(t){return d.call(this,e)}}}function a(){g&&h&&(g=!1,h.length?p=h.concat(p):m=-1,p.length&&s())}function s(){if(!g){var e=r(a);g=!0;for(var t=p.length;t;){for(h=p,p=[];++m1)for(var n=1;n>>2]|=(n[r>>>2]>>>24-r%4*8&255)<<24-(o+r)%4*8;else if(65535>>2]=n[r>>>2];else t.push.apply(t,n);return this.sigBytes+=e,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],o=0;o>>2]>>>24-o%4*8&255;n.push((r>>>4).toString(16)),n.push((15&r).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o>>3]|=parseInt(e.substr(o,2),16)<<24-o%8*4;return new a.init(n,t/2)}},u=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],o=0;o>>2]>>>24-o%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],o=0;o>>2]|=(255&e.charCodeAt(o))<<24-o%4*8;return new a.init(n,t)}},l=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=o.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=new a.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,o=n.words,r=n.sigBytes,i=this.blockSize,s=r/(4*i),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*i,r=e.min(4*t,r),t){for(var c=0;cu;u++){if(16>u)i[u]=0|e[t+u];else{var l=i[u-3]^i[u-8]^i[u-14]^i[u-16];i[u]=l<<1|l>>>31}l=(o<<5|o>>>27)+c+i[u],l=20>u?l+(1518500249+(r&a|~r&s)):40>u?l+(1859775393+(r^a^s)):60>u?l+((r&a|r&s|a&s)-1894007588):l+((r^a^s)-899497514),c=s,s=a,a=r<<30|r>>>2,r=o,o=l}n[0]=n[0]+o|0,n[1]=n[1]+r|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,o=8*e.sigBytes;return t[o>>>5]|=128<<24-o%32,t[14+(o+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(o+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=r._createHelper(t),e.HmacSHA1=r._createHmacHelper(t)}(),function(){var e=o,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,n){e=this._hasher=new e.init,"string"==typeof n&&(n=t.parse(n));var o=e.blockSize,r=4*o;n.sigBytes>r&&(n=e.finalize(n)),n.clamp();for(var i=this._oKey=n.clone(),a=this._iKey=n.clone(),s=i.words,c=a.words,u=0;u>>2]>>>24-i%4*8&255,s=t[i+1>>>2]>>>24-(i+1)%4*8&255,c=t[i+2>>>2]>>>24-(i+2)%4*8&255,u=a<<16|s<<8|c,l=0;l<4&&i+.75*l>>6*(3-l)&63));var d=o.charAt(64);if(d)for(;r.length%4;)r.push(d);return r.join("")},parse:function(e){var t=e.length,o=this._map,r=o.charAt(64);if(r){var i=e.indexOf(r);-1!=i&&(t=i)}for(var a=[],s=0,c=0;c>>6-c%4*2;a[s>>>2]|=(u|l)<<24-s%4*8,s++}return n.create(a,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.exports=o},function(e,t,n){var o=n(12).DOMParser,r=function(){this.version="1.3.5";var e={mergeCDATA:!0,normalize:!0,stripElemPrefix:!0},t=new RegExp(/(?!xmlns)^.*:/);new RegExp(/^\s+|\s+$/g);return this.grokType=function(e){return/^\s*$/.test(e)?null:/^(?:true|false)$/i.test(e)?"true"===e.toLowerCase():isFinite(e)?parseFloat(e):e},this.parseString=function(e,t){if(e){var n=this.stringToXML(e);return n.getElementsByTagName("parsererror").length?null:this.parseXML(n,t)}return null},this.parseXML=function(n,o){for(var i in o)e[i]=o[i];var a={},s=0,c="";if(n.childNodes.length)for(var u,l,d,f=0;f=t+n||t?new java.lang.String(e,t,n)+"":e}function u(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}o.prototype.parseFromString=function(e,t){var n=this.options,o=new l,a=n.domBuilder||new i,s=n.errorHandler,c=n.locator,u=n.xmlns||{},d={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return c&&a.setDocumentLocator(c),o.errorHandler=r(s,a,c),o.domBuilder=n.domBuilder||a,/\/x?html?$/.test(t)&&(d.nbsp="\xa0",d.copy="\xa9",u[""]="http://www.w3.org/1999/xhtml"),u.xml=u.xml||"http://www.w3.org/XML/1998/namespace",e?o.parse(e,u,d):o.errorHandler.error("invalid doc source"),a.doc},i.prototype={startDocument:function(){this.doc=(new d).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,o){var r=this.doc,i=r.createElementNS(e,n||t),s=o.length;u(this,i),this.currentElement=i,this.locator&&a(this.locator,i);for(var c=0;c65535){e-=65536;var t=55296+(e>>10),n=56320+(1023&e);return String.fromCharCode(t,n)}return String.fromCharCode(e)}function p(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?h(parseInt(t.substr(1).replace("x","0x"))):(u.error("entity not found:"+e),e)}function g(t){if(t>A){var n=e.substring(A,t).replace(/&#?\w+;/g,p);k&&m(A),o.characters(n,0,t-A),A=t}}function m(t,n){for(;t>=C&&(n=v.exec(e));)y=n.index,C=y+n[0].length,k.lineNumber++;k.columnNumber=t-y+1}for(var y=0,C=0,v=/.*(?:\r\n?|\n)|.*$/g,k=o.locator,R=[{currentNSMap:t}],S={},A=0;;){try{var b=e.indexOf("<",A);if(b<0){if(!e.substr(A).match(/^\s*$/)){var B=o.doc,T=B.createTextNode(e.substr(A));B.appendChild(T),o.currentElement=T}return}switch(b>A&&g(b),e.charAt(b+1)){case"/":var x=e.indexOf(">",b+3),E=e.substring(b+2,x),_=R.pop();x<0?(E=e.substring(b+2).replace(/[\s<].*/,""),u.error("end tag name: "+E+" is not complete:"+_.tagName),x=b+1+E.length):E.match(/\sA?A=x:g(Math.max(b,A)+1)}}function r(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function i(e,t,n,o,r,i){for(var a,s,c=++t,u=C;;){var l=e.charAt(c);switch(l){case"=":if(u===v)a=e.slice(t,c),u=R;else{if(u!==k)throw new Error("attribute equal must after attrName");u=R}break;case"'":case'"':if(u===R||u===v){if(u===v&&(i.warning('attribute value must after "="'),a=e.slice(t,c)),t=c+1,!((c=e.indexOf(l,t))>0))throw new Error("attribute value no end '"+l+"' match");s=e.slice(t,c).replace(/&#?\w+;/g,r),n.add(a,s,t-1),u=A}else{if(u!=S)throw new Error('attribute value must after "="');s=e.slice(t,c).replace(/&#?\w+;/g,r),n.add(a,s,t),i.warning('attribute "'+a+'" missed start quot('+l+")!!"),t=c+1,u=A}break;case"/":switch(u){case C:n.setTagName(e.slice(t,c));case A:case b:case B:u=B,n.closed=!0;case S:case v:case k:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return i.error("unexpected end of input"),u==C&&n.setTagName(e.slice(t,c)),c;case">":switch(u){case C:n.setTagName(e.slice(t,c));case A:case b:case B:break;case S:case v:s=e.slice(t,c),"/"===s.slice(-1)&&(n.closed=!0,s=s.slice(0,-1));case k:u===k&&(s=a),u==S?(i.warning('attribute "'+s+'" missed quot(")!!'),n.add(a,s.replace(/&#?\w+;/g,r),t)):("http://www.w3.org/1999/xhtml"===o[""]&&s.match(/^(?:disabled|checked|selected)$/i)||i.warning('attribute "'+s+'" missed value!! "'+s+'" instead!!'),n.add(s,s,t));break;case R:throw new Error("attribute value missed!!")}return c;case"\x80":l=" ";default:if(l<=" ")switch(u){case C:n.setTagName(e.slice(t,c)),u=b;break;case v:a=e.slice(t,c),u=k;break;case S:var s=e.slice(t,c).replace(/&#?\w+;/g,r);i.warning('attribute "'+s+'" missed quot(")!!'),n.add(a,s,t);case A:u=b}else switch(u){case k:n.tagName;"http://www.w3.org/1999/xhtml"===o[""]&&a.match(/^(?:disabled|checked|selected)$/i)||i.warning('attribute "'+a+'" missed value!! "'+a+'" instead2!!'),n.add(a,a,t),t=c,u=v;break;case A:i.warning('attribute space is required"'+a+'"!!');case b:u=v,t=c;break;case R:u=S,t=c;break;case B:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function a(e,t,n){for(var o=e.tagName,r=null,i=e.length;i--;){var a=e[i],s=a.qName,c=a.value,l=s.indexOf(":");if(l>0)var d=a.prefix=s.slice(0,l),f=s.slice(l+1),h="xmlns"===d&&f;else f=s,d=null,h="xmlns"===s&&"";a.localName=f,!1!==h&&(null==r&&(r={},u(n,n={})),n[h]=r[h]=c,a.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(h,c))}for(var i=e.length;i--;){a=e[i];var d=a.prefix;d&&("xml"===d&&(a.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==d&&(a.uri=n[d||""]))}var l=o.indexOf(":");l>0?(d=e.prefix=o.slice(0,l),f=e.localName=o.slice(l+1)):(d=null,f=e.localName=o);var p=e.uri=n[d||""];if(t.startElement(p,f,o,e),!e.closed)return e.currentNSMap=n,e.localNSMap=r,!0;if(t.endElement(p,f,o),r)for(d in r)t.endPrefixMapping(d)}function s(e,t,n,o,r){if(/^(?:script|textarea)$/i.test(n)){var i=e.indexOf("",t),a=e.substring(t+1,i);if(/[&<]/.test(a))return/^script$/i.test(n)?(r.characters(a,0,a.length),i):(a=a.replace(/&#?\w+;/g,o),r.characters(a,0,a.length),i)}return t+1}function c(e,t,n,o){var r=o[n];return null==r&&(r=e.lastIndexOf(""),rt?(n.comment(e,t+4,r-t-4),r+3):(o.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==e.substr(t+3,6)){var r=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,r-t-9),n.endCDATA(),r+3}var i=p(e,t),a=i.length;if(a>1&&/!doctype/i.test(i[0][0])){var s=i[1][0],c=a>3&&/^public$/i.test(i[2][0])&&i[3][0],u=a>4&&i[4][0],l=i[a-1];return n.startDTD(s,c&&c.replace(/^(['"])(.*?)\1$/,"$2"),u&&u.replace(/^(['"])(.*?)\1$/,"$2")),n.endDTD(),l.index+l[0].length}}return-1}function d(e,t,n){var o=e.indexOf("?>",t);if(o){var r=e.substring(t,o).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(r){r[0].length;return n.processingInstruction(r[1],r[2]),o+2}return-1}return-1}function f(e){}function h(e,t){return e.__proto__=t,e}function p(e,t){var n,o=[],r=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(r.lastIndex=t,r.exec(e);n=r.exec(e);)if(o.push(n),n[1])return o}var g=/[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]/,m=new RegExp("[\\-\\.0-9"+g.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),y=new RegExp("^"+g.source+m.source+"*(?::"+g.source+m.source+"*)?$"),C=0,v=1,k=2,R=3,S=4,A=5,b=6,B=7;n.prototype={parse:function(e,t,n){var r=this.domBuilder;r.startDocument(),u(t,t={}),o(e,t,n,r,this.errorHandler),r.endDocument()}},f.prototype={setTagName:function(e){if(!y.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},add:function(e,t,n){if(!y.test(e))throw new Error("invalid attribute:"+e);this[this.length++]={qName:e,value:t,offset:n}},length:0,getLocalName:function(e){return this[e].localName},getLocator:function(e){return this[e].locator},getQName:function(e){return this[e].qName},getURI:function(e){return this[e].uri},getValue:function(e){return this[e].value}},h({},h.prototype)instanceof h||(h=function(e,t){function n(){}n.prototype=t,n=new n;for(t in e)n[t]=e[t];return n}),t.XMLReader=n},function(e,t){function n(e){return(""+e).replace(/&/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""").replace(r,"")}var o=new RegExp("^([^a-zA-Z_\xc0-\xd6\xd8-\xf6\xf8-\xff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fff\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd])|^((x|X)(m|M)(l|L))|([^a-zA-Z_\xc0-\xd6\xd8-\xf6\xf8-\xff\u0370-\u037d\u037f-\u1fff\u200c-\u200d\u2070-\u218f\u2c00-\u2fff\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd-.0-9\xb7\u0300-\u036f\u203f\u2040])","g"),r=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,i=function(e){var t=[];if(e instanceof Object)for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t},a=function(e,t){var r=function(e,n,r,i,a){var s=void 0!==t.indent?t.indent:"\t",c=t.prettyPrint?"\n"+new Array(i).join(s):"";t.removeIllegalNameCharacters&&(e=e.replace(o,"_"));var u=[c,"<",e,r||""];return n&&n.length>0?(u.push(">"),u.push(n),a&&u.push(c),u.push("")):u.push("/>"),u.join("")};return function e(o,a,s){var c=typeof o;switch((Array.isArray?Array.isArray(o):o instanceof Array)?c="array":o instanceof Date&&(c="date"),c){case"array":var u=[];return o.map(function(t){u.push(e(t,1,s+1))}),t.prettyPrint&&u.push("\n"),u.join("");case"date":return o.toJSON?o.toJSON():o+"";case"object":var l=[];for(var d in o)if(o.hasOwnProperty(d))if(o[d]instanceof Array)for(var f=0;f0&&l.push("\n"),l.join("");case"function":return o();default:return t.escape?n(o):""+o}}(e,0,0)},s=function(e){var t=['"),t.join("")};e.exports=function(e,t){if(t||(t={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" ",escape:!0}),"string"==typeof e)try{e=JSON.parse(e.toString())}catch(e){return!1}var n="",o="";return t&&("object"==typeof t?(t.xmlHeader&&(n=s(!!t.xmlHeader.standalone)),void 0!==t.docType&&(o="")):n=s()),t=t||{},[n,t.prettyPrint&&o?"\n":"",o,a(e,t)].join("").replace(/\n{2,}/g,"\n").replace(/\s+$/g,"")}},function(e,t,n){var o=n(4),r=n(0),i={},a=function(e,t){i[t]=e[t],e[t]=function(e,n){e.SkipTask?i[t].call(this,e,n):this._addTask(t,e,n)}},s=function(e){var t=[],n={},a=0,s=0,c=function(e){var t={id:e.id,Bucket:e.Bucket,Region:e.Region,Key:e.Key,FilePath:e.FilePath,state:e.state,loaded:e.loaded,size:e.size,speed:e.speed,percent:e.percent,hashPercent:e.hashPercent,error:e.error};return e.FilePath&&(t.FilePath=e.FilePath),e._custom&&(t._custom=e._custom),t},u=function(){var n,o=function(){n=0,e.emit("task-list-update",{list:r.map(t,c)}),e.emit("list-update",{list:r.map(t,c)})};return function(){n||(n=setTimeout(o))}}(),l=function(){if(!(t.length<=e.options.UploadQueueSize)){for(var o=0;oe.options.UploadQueueSize;){var r="waiting"===t[o].state||"checking"===t[o].state||"uploading"===t[o].state;t[o]&&r?o++:(n[t[o].id]&&delete n[t[o].id],t.splice(o,1),s--)}u()}},d=function(){if(!(a>=e.options.FileParallelLimit)){for(;t[s]&&"waiting"!==t[s].state;)s++;if(!(s>=t.length)){var n=t[s];s++,a++,n.state="checking",n.params.onTaskStart&&n.params.onTaskStart(c(n)),!n.params.UploadData&&(n.params.UploadData={});var o=r.formatParams(n.api,n.params);i[n.api].call(e,o,function(t,o){e._isRunningTask(n.id)&&("checking"!==n.state&&"uploading"!==n.state||(n.state=t?"error":"success",t&&(n.error=t),a--,u(),d(),n.callback&&n.callback(t,o),"success"===n.state&&(n.params&&(delete n.params.UploadData,delete n.params.Body,delete n.params),delete n.callback)),l())}),u(),setTimeout(d)}}},f=function(t,r){var i=n[t];if(i){var s=i&&"waiting"===i.state,c=i&&("checking"===i.state||"uploading"===i.state);if("canceled"===r&&"canceled"!==i.state||"paused"===r&&s||"paused"===r&&c){if("paused"===r&&i.params.Body&&"function"==typeof i.params.Body.pipe)return void console.error("stream not support pause");i.state=r,e.emit("inner-kill-task",{TaskId:t,toState:r});try{var f=i&&i.params&&i.params.UploadData.UploadId}catch(e){}"canceled"===r&&f&&o.removeUsing(f),u(),c&&(a--,d()),"canceled"===r&&(i.params&&(delete i.params.UploadData,delete i.params.Body,delete i.params),delete i.callback)}l()}};e._addTasks=function(t){r.each(t,function(t){e._addTask(t.api,t.params,t.callback,!0)}),u()};var h=!0;e._addTask=function(o,i,a,s){i=r.formatParams(o,i);var c=r.uuid();i.TaskId=c,i.onTaskReady&&i.onTaskReady(c),i.TaskReady&&(i.TaskReady(c),h&&console.warn('warning: Param "TaskReady" has been deprecated. Please use "onTaskReady" instead.'),h=!1);var f={params:i,callback:a,api:o,index:t.length,id:c,Bucket:i.Bucket,Region:i.Region,Key:i.Key,FilePath:i.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null,_custom:i._custom},p=i.onHashProgress;i.onHashProgress=function(t){e._isRunningTask(f.id)&&(f.hashPercent=t.percent,p&&p(t),u())};var g=i.onProgress;return i.onProgress=function(t){e._isRunningTask(f.id)&&("checking"===f.state&&(f.state="uploading"),f.loaded=t.loaded,f.speed=t.speed,f.percent=t.percent,g&&g(t),u())},r.getFileSize(o,i,function(e,o){if(e)return void a(e);n[c]=f,t.push(f),f.size=o,!s&&u(),d(),l()}),c},e._isRunningTask=function(e){var t=n[e];return!(!t||"checking"!==t.state&&"uploading"!==t.state)},e.getTaskList=function(){return r.map(t,c)},e.cancelTask=function(e){f(e,"canceled")},e.pauseTask=function(e){f(e,"paused")},e.restartTask=function(e){var t=n[e];!t||"paused"!==t.state&&"error"!==t.state||(t.state="waiting",u(),s=Math.min(s,t.index),d())},e.isUploadRunning=function(){return a||s/gi,"<$1Rule>"),o=o.replace(/<(\/?)Tags>/gi,"<$1Tag>");var r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=Te.binaryBase64(Te.md5(o)),Se.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"replication",headers:r},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function T(e,t){Se.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"ReplicationConfigurationnotFoundError"!==e.error.Code)t(e);else{var o={ReplicationConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else e||!n.ReplicationConfiguration&&(n.ReplicationConfiguration={}),n.ReplicationConfiguration.Rule&&(n.ReplicationConfiguration.Rules=n.ReplicationConfiguration.Rule,delete n.ReplicationConfiguration.Rule),t(e,n)})}function x(e,t){Se.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function E(e,t){if(!e.WebsiteConfiguration)return void t({error:"missing param WebsiteConfiguration"});var n=Te.clone(e.WebsiteConfiguration||{}),o=n.RoutingRules||n.RoutingRule||[];o=Te.isArray(o)?o:[o],delete n.RoutingRule,delete n.RoutingRules,o.length&&(n.RoutingRules={RoutingRule:o});var r=Te.json2xml({WebsiteConfiguration:n}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=Te.binaryBase64(Te.md5(r)),Se.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"website",headers:i},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function _(e,t){Se.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website"},function(e,n){if(e)if(404===e.statusCode&&"NoSuchWebsiteConfiguration"===e.error.Code){var o={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else t(e);else{var r=n.WebsiteConfiguration||{};if(r.RoutingRules){var i=Te.clone(r.RoutingRules.RoutingRule||[]);i=Te.makeArray(i),r.RoutingRules=i}t(null,{WebsiteConfiguration:r,statusCode:n.statusCode,headers:n.headers})}})}function w(e,t){Se.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function I(e,t){if(!e.RefererConfiguration)return void t({error:"missing param RefererConfiguration"});var n=Te.clone(e.RefererConfiguration||{}),o=n.DomainList||{},r=o.Domains||o.Domain||[];r=Te.isArray(r)?r:[r],r.length&&(n.DomainList={Domain:r});var i=Te.json2xml({RefererConfiguration:n}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=Te.binaryBase64(Te.md5(i)),Se.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"referer",headers:a},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function O(e,t){Se.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer"},function(e,n){if(e)if(404===e.statusCode&&"NoSuchRefererConfiguration"===e.error.Code){var o={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else t(e);else{var r=n.RefererConfiguration||{};if(r.DomainList){var i=Te.clone(r.DomainList.Domain||[]);i=Te.makeArray(i),r.DomainList={Domains:i}}t(null,{RefererConfiguration:r,statusCode:n.statusCode,headers:n.headers})}})}function D(e,t){var n=e.DomainConfiguration||{},o=n.DomainRule||e.DomainRule||[];o=Te.clone(o);var r=Te.json2xml({DomainConfiguration:{DomainRule:o}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=Te.binaryBase64(Te.md5(r)),Se.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"domain",headers:i},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function N(e,t){Se.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(e,n){if(e)return t(e);var o=[];try{o=n.DomainConfiguration.DomainRule||[]}catch(e){}o=Te.clone(Te.isArray(o)?o:[o]),t(null,{DomainRule:o,statusCode:n.statusCode,headers:n.headers})})}function P(e,t){Se.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function M(e,t){var n=e.OriginConfiguration||{},o=n.OriginRule||e.OriginRule||[];o=Te.clone(o);var r=Te.json2xml({OriginConfiguration:{OriginRule:o}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=Te.binaryBase64(Te.md5(r)),Se.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"origin",headers:i},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function U(e,t){Se.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(e,n){if(e)return t(e);var o=[];try{o=n.OriginConfiguration.OriginRule||[]}catch(e){}o=Te.clone(Te.isArray(o)?o:[o]),t(null,{OriginRule:o,statusCode:n.statusCode,headers:n.headers})})}function H(e,t){Se.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin"},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function L(e,t){var n=Te.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=Te.binaryBase64(Te.md5(n)),Se.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"logging",headers:o},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function F(e,t){Se.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging"},function(e,n){if(e)return t(e);t(null,{BucketLoggingStatus:n.BucketLoggingStatus,statusCode:n.statusCode,headers:n.headers})})}function K(e,t){var n=Te.clone(e.InventoryConfiguration);if(n.OptionalFields){var o=n.OptionalFields||[];n.OptionalFields={Field:o}}if(n.Destination&&n.Destination.COSBucketDestination&&n.Destination.COSBucketDestination.Encryption){var r=n.Destination.COSBucketDestination.Encryption;Object.keys(r).indexOf("SSECOS")>-1&&(r["SSE-COS"]=r.SSECOS,delete r.SSECOS)}var i=Te.json2xml({InventoryConfiguration:n}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=Te.binaryBase64(Te.md5(i)),Se.call(this,{Action:"name/cos:PutBucketInventory",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"inventory",qs:{id:e.Id},headers:a},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function j(e,t){Se.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(e,n){if(e)return t(e);var o=n.InventoryConfiguration;if(o&&o.OptionalFields&&o.OptionalFields.Field){var r=o.OptionalFields.Field;Te.isArray(r)||(r=[r]),o.OptionalFields=r}if(o.Destination&&o.Destination.COSBucketDestination&&o.Destination.COSBucketDestination.Encryption){var i=o.Destination.COSBucketDestination.Encryption;Object.keys(i).indexOf("SSE-COS")>-1&&(i.SSECOS=i["SSE-COS"],delete i["SSE-COS"])}t(null,{InventoryConfiguration:o,statusCode:n.statusCode,headers:n.headers})})}function z(e,t){Se.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{"continuation-token":e.ContinuationToken}},function(e,n){if(e)return t(e);var o=n.ListInventoryConfigurationResult,r=o.InventoryConfiguration||[];r=Te.isArray(r)?r:[r],delete o.InventoryConfiguration,Te.each(r,function(e){if(e&&e.OptionalFields&&e.OptionalFields.Field){var t=e.OptionalFields.Field;Te.isArray(t)||(t=[t]),e.OptionalFields=t}if(e.Destination&&e.Destination.COSBucketDestination&&e.Destination.COSBucketDestination.Encryption){var n=e.Destination.COSBucketDestination.Encryption;Object.keys(n).indexOf("SSE-COS")>-1&&(n.SSECOS=n["SSE-COS"],delete n["SSE-COS"])}}),o.InventoryConfigurations=r,Te.extend(o,{statusCode:n.statusCode,headers:n.headers}),t(null,o)})}function G(e,t){Se.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e.Id}},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function q(e,t){if(!e.AccelerateConfiguration)return void t({error:"missing param AccelerateConfiguration"});var n={AccelerateConfiguration:e.AccelerateConfiguration||{}},o=Te.json2xml(n),r={};r["Content-Type"]="application/xml",r["Content-MD5"]=Te.binaryBase64(Te.md5(o)),Se.call(this,{Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"accelerate",headers:r},function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})})}function X(e,t){Se.call(this,{Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate"},function(e,n){e||!n.AccelerateConfiguration&&(n.AccelerateConfiguration={}),t(e,n)})}function V(e,t){Se.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(n,o){if(n){var r=n.statusCode;return e.Headers["If-Modified-Since"]&&r&&304===r?t(null,{NotModified:!0,statusCode:r}):t(n)}o.ETag=Te.attr(o.headers,"etag",""),t(null,o)})}function W(e,t){var n={};n.prefix=e.Prefix||"",n.delimiter=e.Delimiter,n["key-marker"]=e.KeyMarker,n["version-id-marker"]=e.VersionIdMarker,n["max-keys"]=e.MaxKeys,n["encoding-type"]=e.EncodingType,Se.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:n.prefix,method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:n,action:"versions"},function(e,n){if(e)return t(e);var o=n.ListVersionsResult||{},r=o.DeleteMarker||[];r=Te.isArray(r)?r:[r];var i=o.Version||[];i=Te.isArray(i)?i:[i];var a=Te.clone(o);delete a.DeleteMarker,delete a.Version,Te.extend(a,{DeleteMarkers:r,Versions:i,statusCode:n.statusCode,headers:n.headers}),t(null,a)})}function $(e,t){var n=e.Query||{};n["response-content-type"]=e.ResponseContentType,n["response-content-language"]=e.ResponseContentLanguage,n["response-expires"]=e.ResponseExpires,n["response-cache-control"]=e.ResponseCacheControl,n["response-content-disposition"]=e.ResponseContentDisposition,n["response-content-encoding"]=e.ResponseContentEncoding,Se.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,DataType:e.DataType,headers:e.Headers,qs:n,rawBody:!0},function(n,o){if(n){var r=n.statusCode;return e.Headers["If-Modified-Since"]&&r&&304===r?t(null,{NotModified:!0}):t(n)}t(null,{Body:o.body,ETag:Te.attr(o.headers,"etag",""),statusCode:o.statusCode,headers:o.headers})})}function Q(e,t){var n=this,o=e.ContentLength,r=Te.throttleOnProgress.call(n,o,e.onProgress),i=e.Headers;i["Cache-Control"]||i["cache-control"]||(i["Cache-Control"]=""),i["Content-Type"]||i["content-type"]||(i["Content-Type"]=e.Body&&e.Body.type||"");var a=e.UploadAddMetaMd5||n.options.UploadAddMetaMd5||n.options.UploadCheckContentMd5;Te.getBodyMd5(a,e.Body,function(a){a&&(n.options.UploadCheckContentMd5&&(i["Content-MD5"]=Te.binaryBase64(a)),(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5)&&(i["x-cos-meta-md5"]=a)),void 0!==e.ContentLength&&(i["Content-Length"]=e.ContentLength),r(null,!0),Se.call(n,{Action:"name/cos:PutObject",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:e.Query,body:e.Body,onProgress:r},function(i,a){if(i)return r(null,!0),t(i);r({loaded:o,total:o},!0);var s=ve({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key});s=s.substr(s.indexOf("://")+3),a.Location=s,a.ETag=Te.attr(a.headers,"etag",""),t(null,a)})},e.onHashProgress)}function J(e,t){Se.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,VersionId:e.VersionId},function(e,n){if(e){var o=e.statusCode;return o&&204===o?t(null,{statusCode:o}):o&&404===o?t(null,{BucketNotFound:!0,statusCode:o}):t(e)}t(null,{statusCode:n.statusCode,headers:n.headers})})}function Y(e,t){Se.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"acl"},function(e,n){if(e)return t(e);var o=n.AccessControlPolicy||{},r=o.Owner||{},i=o.AccessControlList&&o.AccessControlList.Grant||[];i=Te.isArray(i)?i:[i];var a=ye(o);n.headers&&n.headers["x-cos-acl"]&&(a.ACL=n.headers["x-cos-acl"]),a=Te.extend(a,{Owner:r,Grants:i,statusCode:n.statusCode,headers:n.headers}),t(null,a)})}function Z(e,t){var n=e.Headers,o="";if(e.AccessControlPolicy){var r=Te.clone(e.AccessControlPolicy||{}),i=r.Grants||r.Grant;i=Te.isArray(i)?i:[i],delete r.Grant,delete r.Grants,r.AccessControlList={Grant:i},o=Te.json2xml({AccessControlPolicy:r}),n["Content-Type"]="application/xml",n["Content-MD5"]=Te.binaryBase64(Te.md5(o))}Te.each(n,function(e,t){0===t.indexOf("x-cos-grant-")&&(n[t]=Ce(n[t]))}),Se.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:n,body:o},function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})})}function ee(e,t){var n=e.Headers;n.Origin=e.Origin,n["Access-Control-Request-Method"]=e.AccessControlRequestMethod,n["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,Se.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:n},function(e,n){if(e)return e.statusCode&&403===e.statusCode?t(null,{OptionsForbidden:!0,statusCode:e.statusCode}):t(e);var o=n.headers||{};t(null,{AccessControlAllowOrigin:o["access-control-allow-origin"],AccessControlAllowMethods:o["access-control-allow-methods"],AccessControlAllowHeaders:o["access-control-allow-headers"],AccessControlExposeHeaders:o["access-control-expose-headers"],AccessControlMaxAge:o["access-control-max-age"],statusCode:n.statusCode,headers:n.headers})})}function te(e,t){var n=e.Headers;!n["Cache-Control"]&&n["cache-control"]&&(n["Cache-Control"]="");var o=e.CopySource||"",r=o.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^\/]+\/(.+)$/);if(!r)return void t({error:"CopySource format error"});var i=r[1],a=r[3],s=decodeURIComponent(r[4]);Se.call(this,{Interface:"PutObjectCopy",Scope:[{action:"name/cos:GetObject",bucket:i,region:a,prefix:s},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers},function(e,n){if(e)return t(e);var o=Te.clone(n.CopyObjectResult||{});Te.extend(o,{statusCode:n.statusCode,headers:n.headers}),t(null,o)})}function ne(e,t){var n=e.CopySource||"",o=n.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^\/]+\/(.+)$/);if(!o)return void t({error:"CopySource format error"});var r=o[1],i=o[3],a=decodeURIComponent(o[4]);Se.call(this,{Interface:"UploadPartCopy",Scope:[{action:"name/cos:GetObject",bucket:r,region:i,prefix:a},{action:"name/cos:PutObject",bucket:e.Bucket,region:e.Region,prefix:e.Key}],method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers},function(e,n){if(e)return t(e);var o=Te.clone(n.CopyPartResult||{});Te.extend(o,{statusCode:n.statusCode,headers:n.headers}),t(null,o)})}function oe(e,t){var n=e.Objects||[],o=e.Quiet;n=Te.isArray(n)?n:[n];var r=Te.json2xml({Delete:{Object:n,Quiet:o||!1}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=Te.binaryBase64(Te.md5(r));var a=Te.map(n,function(t){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:t.Key}});Se.call(this,{Interface:"DeleteMultipleObjects",Scope:a,method:"POST",Bucket:e.Bucket,Region:e.Region,body:r,action:"delete",headers:i},function(e,n){if(e)return t(e);var o=n.DeleteResult||{},r=o.Deleted||[],i=o.Error||[];r=Te.isArray(r)?r:[r],i=Te.isArray(i)?i:[i];var a=Te.clone(o);Te.extend(a,{Error:i,Deleted:r,statusCode:n.statusCode,headers:n.headers}),t(null,a)})}function re(e,t){var n=e.Headers;if(!e.RestoreRequest)return void t({error:"missing param RestoreRequest"});var o=e.RestoreRequest||{},r=Te.json2xml({RestoreRequest:o});n["Content-Type"]="application/xml",n["Content-MD5"]=Te.binaryBase64(Te.md5(r)),Se.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:r,action:"restore",headers:n},function(e,n){t(e,n)})}function ie(e,t){var n=e.Tagging||{},o=n.TagSet||n.Tags||e.Tags||[];o=Te.clone(Te.isArray(o)?o:[o]);var r=Te.json2xml({Tagging:{TagSet:{Tag:o}}}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=Te.binaryBase64(Te.md5(r)),Se.call(this,{Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:r,action:"tagging",headers:i,VersionId:e.VersionId},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function ae(e,t){Se.call(this,{Action:"name/cos:GetObjectTagging",method:"GET",Key:e.Key,Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",VersionId:e.VersionId},function(e,n){if(e)if(404!==e.statusCode||!e.error||"Not Found"!==e.error&&"NoSuchTagSet"!==e.error.Code)t(e);else{var o={Tags:[],statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else{var r=[];try{r=n.Tagging.TagSet.Tag||[]}catch(e){}r=Te.clone(Te.isArray(r)?r:[r]),t(null,{Tags:r,statusCode:n.statusCode,headers:n.headers})}})}function se(e,t){Se.call(this,{Action:"name/cos:DeleteObjectTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"tagging",VersionId:e.VersionId},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers})})}function ce(e,t){if(!e.SelectType)return t({error:"missing param SelectType"});var n=e.SelectRequest||{},o=Te.json2xml({SelectRequest:n}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=Te.binaryBase64(Te.md5(o)),Se.call(this,{Interface:"SelectObjectContent",Action:"name/cos:GetObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"select",qs:{"select-type":e.SelectType},VersionId:e.VersionId,body:o,rawBody:!0},function(e,n){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:n.statusCode,headers:n.headers,Body:n.body})})}function ue(e,t){var n=this,o=e.Headers;o["Cache-Control"]||o["cache-control"]||(o["Cache-Control"]=""),o["Content-Type"]||o["content-type"]||(o["Content-Type"]=e.Body&&e.Body.type||""),Te.getBodyMd5(e.Body&&(e.UploadAddMetaMd5||n.options.UploadAddMetaMd5),e.Body,function(o){o&&(e.Headers["x-cos-meta-md5"]=o),Se.call(n,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query},function(e,n){return e?t(e):(n=Te.clone(n||{}))&&n.InitiateMultipartUploadResult?t(null,Te.extend(n.InitiateMultipartUploadResult,{statusCode:n.statusCode,headers:n.headers})):void t(null,n)})},e.onHashProgress)}function le(e,t){var n=this;Te.getFileSize("multipartUpload",e,function(){Te.getBodyMd5(n.options.UploadCheckContentMd5,e.Body,function(o){o&&(e.Headers["Content-MD5"]=Te.binaryBase64(o)),Se.call(n,{Action:"name/cos:UploadPart",TaskId:e.TaskId,method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{partNumber:e.PartNumber,uploadId:e.UploadId},headers:e.Headers,onProgress:e.onProgress,body:e.Body||null},function(e,n){if(e)return t(e);t(null,{ETag:Te.attr(n.headers,"etag",""),statusCode:n.statusCode,headers:n.headers})})})})}function de(e,t){for(var n=this,o=e.UploadId,r=e.Parts,i=0,a=r.length;i-1?n.Authorization:"sign="+encodeURIComponent(n.Authorization)),n.XCosSecurityToken&&(r+="&x-cos-security-token="+n.XCosSecurityToken),n.ClientIP&&(r+="&clientIP="+n.ClientIP),n.ClientUA&&(r+="&clientUA="+n.ClientUA),n.Token&&(r+="&token="+n.Token),setTimeout(function(){t(null,{Url:r})})}});return r?o+"?"+r.Authorization+(r.XCosSecurityToken?"&x-cos-security-token="+r.XCosSecurityToken:""):o}function ye(e){var t={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},n={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},o=e&&e.AccessControlList||{},r=o.Grant;r&&(r=Te.isArray(r)?r:[r]);var i={READ:0,WRITE:0,FULL_CONTROL:0};return r&&r.length&&Te.each(r,function(o){"qcs::cam::anyone:anyone"===o.Grantee.ID||"http://cam.qcloud.com/groups/global/AllUsers"===o.Grantee.URI?i[o.Permission]=1:o.Grantee.ID!==e.Owner.ID&&t[n[o.Permission]].push('id="'+o.Grantee.ID+'"')}),i.FULL_CONTROL||i.WRITE&&i.READ?t.ACL="public-read-write":i.READ?t.ACL="public-read":t.ACL="private",Te.each(n,function(e){t[e]=Ce(t[e].join(","))}),t}function Ce(e){var t,n,o=e.split(","),r={};for(t=0;t-1?"{Region}.myqcloud.com":"cos.{Region}.myqcloud.com",e.ForcePathStyle||(r="{Bucket}."+r)),r=r.replace(/\{\{AppId\}\}/gi,o).replace(/\{\{Bucket\}\}/gi,n).replace(/\{\{Region\}\}/gi,i).replace(/\{\{.*?\}\}/gi,""),r=r.replace(/\{AppId\}/gi,o).replace(/\{BucketName\}/gi,n).replace(/\{Bucket\}/gi,t).replace(/\{Region\}/gi,i).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(r)||(r=s+"//"+r),"/"===r.slice(-1)&&(r=r.slice(0,-1));var c=r;return e.ForcePathStyle&&(c+="/"+t),c+="/",a&&(c+=Te.camSafeUrlEncode(a).replace(/%2F/g,"/")),e.isLocation&&(c=c.replace(/^https?:\/\//,"")),c}function ke(e,t){var n=Te.clone(e.Headers);delete n["Content-Type"],delete n["Cache-Control"],Te.each(n,function(e,t){""===e&&delete n[t]});var o=function(e){var n=!1,o=e.Authorization;if(o)if(o.indexOf(" ")>-1)n=!1;else if(o.indexOf("q-sign-algorithm=")>-1&&o.indexOf("q-ak=")>-1&&o.indexOf("q-sign-time=")>-1&&o.indexOf("q-key-time=")>-1&&o.indexOf("q-url-param-list=")>-1)n=!0;else try{o=atob(o),o.indexOf("a=")>-1&&o.indexOf("k=")>-1&&o.indexOf("t=")>-1&&o.indexOf("r=")>-1&&o.indexOf("b=")>-1&&(n=!0)}catch(e){}n?t&&t(null,e):t&&t("authorization error")},r=this,i=e.Bucket||"",a=e.Region||"",s=e.Key||"";r.options.ForcePathStyle&&i&&(s=i+"/"+s);var c="/"+s,u={},l=e.Scope;if(!l){var d=e.Action||"",f=e.ResourceKey||e.Key||"";l=e.Scope||[{action:d,bucket:i,region:a,prefix:f}]}var h=Te.md5(JSON.stringify(l));r._StsCache=r._StsCache||[],function(){var e,t;for(e=r._StsCache.length-1;e>=0;e--){t=r._StsCache[e];var n=Math.round(Te.getSkewTime(r.options.SystemClockOffset)/1e3)+30;if(t.StartTime&&n=t.ExpiredTime)r._StsCache.splice(e,1);else if(!t.ScopeLimit||t.ScopeLimit&&t.ScopeKey===h){u=t;break}}}();var p=function(){var t=u.StartTime&&u.ExpiredTime?u.StartTime+";"+u.ExpiredTime:"",i=Te.getAuth({SecretId:u.TmpSecretId,SecretKey:u.TmpSecretKey,Method:e.Method,Pathname:c,Query:e.Query,Headers:n,Expires:e.Expires,UseRawKey:r.options.UseRawKey,SystemClockOffset:r.options.SystemClockOffset,KeyTime:t}),a={Authorization:i,XCosSecurityToken:u.XCosSecurityToken||"",Token:u.Token||"",ClientIP:u.ClientIP||"",ClientUA:u.ClientUA||""};o(a)};if(u.ExpiredTime&&u.ExpiredTime-Te.getSkewTime(r.options.SystemClockOffset)/1e3>60)p();else if(r.options.getAuthorization)r.options.getAuthorization.call(r,{Bucket:i,Region:a,Method:e.Method,Key:s,Pathname:c,Query:e.Query,Headers:n,Scope:l,SystemClockOffset:r.options.SystemClockOffset},function(e){"string"==typeof e&&(e={Authorization:e}),e.TmpSecretId&&e.TmpSecretKey&&e.XCosSecurityToken&&e.ExpiredTime?(u=e||{},u.Scope=l,u.ScopeKey=h,r._StsCache.push(u),p()):o(e)});else{if(!r.options.getSTS)return function(){var t=Te.getAuth({SecretId:e.SecretId||r.options.SecretId,SecretKey:e.SecretKey||r.options.SecretKey,Method:e.Method,Pathname:c,Query:e.Query,Headers:n,Expires:e.Expires,UseRawKey:r.options.UseRawKey,SystemClockOffset:r.options.SystemClockOffset}),i={Authorization:t,XCosSecurityToken:r.options.XCosSecurityToken};return o(i),i}();r.options.getSTS.call(r,{Bucket:i,Region:a},function(e){u=e||{},u.Scope=l,u.ScopeKey=h,u.TmpSecretId=u.SecretId,u.TmpSecretKey=u.SecretKey,r._StsCache.push(u),p()})}return""}function Re(e){var t=!1,n=!1,o=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var r=e.error.Code,i=e.error.Message;("RequestTimeTooSkewed"===r||"AccessDenied"===r&&"Request has expired"===i)&&(n=!0)}catch(e){}if(e)if(n&&o){var a=Date.parse(o);this.options.CorrectClockSkew&&Math.abs(Te.getSkewTime(this.options.SystemClockOffset)-a)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=a-Date.now(),t=!0)}else 5===Math.floor(e.statusCode/100)&&(t=!0);return t}function Se(e,t){var n=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=Te.clearKey(e.qs),e.headers&&(e.headers=Te.clearKey(e.headers)),e.qs&&(e.qs=Te.clearKey(e.qs));var o=Te.clone(e.qs);e.action&&(o[e.action]="");var r=function(i){var a=n.options.SystemClockOffset;ke.call(n,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:o,Headers:e.headers,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope},function(o,s){if(o)return void t(o);e.AuthData=s,Ae.call(n,e,function(o,s){o&&i<2&&(a!==n.options.SystemClockOffset||Re.call(n,o))?(e.headers&&(delete e.headers.Authorization,delete e.headers.token,delete e.headers.clientIP,delete e.headers.clientUA,delete e.headers["x-cos-security-token"]),r(i+1)):t(o,s)})})};r(1)}function Ae(e,t){var n=this,o=e.TaskId;if(!o||n._isRunningTask(o)){var r=e.Bucket,i=e.Region,a=e.Key,s=e.method||"GET",c=e.url,u=e.body,l=e.rawBody;c=c||ve({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:r,region:i,object:a}),e.action&&(c=c+"?"+e.action);var d={method:s,url:c,headers:e.headers,qs:e.qs,body:u};if(d.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(d.headers.token=e.AuthData.Token),e.AuthData.ClientIP&&(d.headers.clientIP=e.AuthData.ClientIP),e.AuthData.ClientUA&&(d.headers.clientUA=e.AuthData.ClientUA),e.AuthData.XCosSecurityToken&&(d.headers["x-cos-security-token"]=e.AuthData.XCosSecurityToken),d.headers&&(d.headers=Te.clearKey(d.headers)),d=Te.clearKey(d),e.onProgress&&"function"==typeof e.onProgress){var f=u&&(u.size||u.length)||0;d.onProgress=function(t){if(!o||n._isRunningTask(o)){var r=t?t.loaded:0;e.onProgress({loaded:r,total:f})}}}e.DataType&&(d.dataType=e.DataType),this.options.Timeout&&(d.timeout=this.options.Timeout),e.Interface?d.cosInterface=e.Interface:e.Action&&(d.cosInterface=e.Action.replace(/^name\/cos:/,"")),n.options.ForcePathStyle&&(d.pathStyle=n.options.ForcePathStyle),n.emit("before-send",d);var h=(n.options.Request||Be)(d,function(e){if("abort"!==e.error){n.emit("after-receive",e);var r,i={statusCode:e.statusCode,statusMessage:e.statusMessage,headers:e.headers},a=e.error,s=e.body,c=function(e,a){if(o&&n.off("inner-kill-task",p),!r){r=!0;var s={};i&&i.statusCode&&(s.statusCode=i.statusCode),i&&i.headers&&(s.headers=i.headers),e?(e=Te.extend(e||{},s),t(e,null)):(a=Te.extend(a||{},s),t(null,a)),h=null}};if(a)return void c({error:a});var u;if(l)u={},u.body=s;else try{u=s&&s.indexOf("<")>-1&&s.indexOf(">")>-1&&Te.xml2json(s)||{}}catch(e){u=s||{}}var d=i.statusCode;return 2===Math.floor(d/100)?u.Error?void c({error:u.Error}):void c(null,u):void c({error:u.Error||u})}}),p=function(e){e.TaskId===o&&(h&&h.abort&&h.abort(),n.off("inner-kill-task",p))};o&&n.on("inner-kill-task",p)}}function be(e,t,n){Te.each(["Cors","Acl"],function(o){if(e.slice(-o.length)===o){var r=e.slice(0,-o.length)+o.toUpperCase(),i=Te.apiWrapper(e,t),a=!1;n[r]=function(){!a&&console.warn("warning: cos."+r+" has been deprecated. Please Use cos."+e+" instead."),a=!0,i.apply(this,arguments)}}})}var Be=n(17),Te=n(0),xe={getService:o,putBucket:r,headBucket:i,getBucket:a,deleteBucket:s,putBucketAcl:c,getBucketAcl:u,putBucketCors:l,getBucketCors:d,deleteBucketCors:f,getBucketLocation:h,getBucketPolicy:g,putBucketPolicy:p,deleteBucketPolicy:m,putBucketTagging:y,getBucketTagging:C,deleteBucketTagging:v,putBucketLifecycle:k,getBucketLifecycle:R,deleteBucketLifecycle:S,putBucketVersioning:A,getBucketVersioning:b,putBucketReplication:B,getBucketReplication:T,deleteBucketReplication:x,putBucketWebsite:E,getBucketWebsite:_,deleteBucketWebsite:w,putBucketReferer:I,getBucketReferer:O,putBucketDomain:D,getBucketDomain:N,deleteBucketDomain:P,putBucketOrigin:M,getBucketOrigin:U,deleteBucketOrigin:H,putBucketLogging:L,getBucketLogging:F,putBucketInventory:K,getBucketInventory:j,listBucketInventory:z,deleteBucketInventory:G,putBucketAccelerate:q,getBucketAccelerate:X,getObject:$,headObject:V,listObjectVersions:W,putObject:Q,deleteObject:J,getObjectAcl:Y,putObjectAcl:Z,optionsObject:ee,putObjectCopy:te,deleteMultipleObject:oe,restoreObject:re,putObjectTagging:ie,getObjectTagging:ae,deleteObjectTagging:se,selectObjectContent:ce,uploadPartCopy:ne,multipartInit:ue,multipartUpload:le,multipartComplete:de,multipartList:fe,multipartListPart:he,multipartAbort:pe,getObjectUrl:me,getAuth:ge};e.exports.init=function(e,t){t.transferToTaskMethod(xe,"putObject"),Te.each(xe,function(t,n){e.prototype[n]=Te.apiWrapper(n,t),be(n,t,e.prototype)})}},function(e,t){var n=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},o=function(e,t,o,r){return t=t||"&",o=o||"=",null===e&&(e=void 0),"object"==typeof e?Object.keys(e).map(function(r){var i=encodeURIComponent(n(r))+o;return Array.isArray(e[r])?e[r].map(function(e){return i+encodeURIComponent(n(e))}).join(t):i+encodeURIComponent(n(e[r]))}).filter(Boolean).join(t):r?encodeURIComponent(n(r))+o+encodeURIComponent(n(e)):""},r=function(e,t,n){var o={};return t.getAllResponseHeaders().trim().split("\n").forEach(function(e){if(e){var t=e.indexOf(":"),n=e.substr(0,t).trim().toLowerCase(),r=e.substr(t+1).trim();o[n]=r}}),{error:e,statusCode:t.status,statusMessage:t.statusText,headers:o,body:n}},i=function(e,t){return t||"text"!==t?e.response:e.responseText},a=function(e,t){var n=(e.method||"GET").toUpperCase(),a=e.url;if(e.qs){var s=o(e.qs);s&&(a+=(-1===a.indexOf("?")?"?":"&")+s)}var c=new XMLHttpRequest;c.open(n,a,!0),c.responseType=e.dataType||"text";var u=e.headers;if(u)for(var l in u)u.hasOwnProperty(l)&&"content-length"!==l.toLowerCase()&&"user-agent"!==l.toLowerCase()&&"origin"!==l.toLowerCase()&&"host"!==l.toLowerCase()&&c.setRequestHeader(l,u[l]);return e.onProgress&&c.upload&&(c.upload.onprogress=e.onProgress),c.onload=function(){t(r(null,c,i(c,e.dataType)))},c.onerror=function(n){var o=i(c,e.dataType);if(o)t(r(null,c,o));else{var a=c.statusText;a||0!==c.status||(a="CORS blocked or network error"),t(r(a,c,o))}},c.send(e.body||""),c};e.exports=a},function(e,t,n){function o(e,t){var n,o,i=this,a=new y,c=e.TaskId,l=e.Bucket,d=e.Region,f=e.Key,h=e.Body,p=e.ChunkSize||e.SliceSize||i.options.ChunkSize,m=e.AsyncLimit,v=e.StorageClass,k=e.ServerSideEncryption,R=e.onHashProgress;a.on("error",function(e){if(i._isRunningTask(c))return t(e)}),a.on("upload_complete",function(e){t(null,e)}),a.on("upload_slice_complete",function(t){var r={};C.each(e.Headers,function(e,t){var n=t.toLowerCase();0!==n.indexOf("x-cos-meta-")&&"pic-operations"!==n||(r[t]=e)}),u.call(i,{Bucket:l,Region:d,Key:f,UploadId:t.UploadId,SliceList:t.SliceList,Headers:r},function(e,r){if(i._isRunningTask(c)){if(g.removeUsing(t.UploadId),e)return o(null,!0),a.emit("error",e);g.removeUploadId(t.UploadId),o({loaded:n,total:n},!0),a.emit("upload_complete",r)}})}),a.on("get_upload_data_finish",function(t){var r=g.getFileId(h,e.ChunkSize,l,f);r&&g.saveUploadId(r,t.UploadId,i.options.UploadIdCacheLimit),g.setUsing(t.UploadId),o(null,!0),s.call(i,{TaskId:c,Bucket:l,Region:d,Key:f,Body:h,FileSize:n,SliceSize:p,AsyncLimit:m,ServerSideEncryption:k,UploadData:t,onProgress:o},function(e,t){if(i._isRunningTask(c))return e?(o(null,!0),a.emit("error",e)):void a.emit("upload_slice_complete",t)})}),a.on("get_file_size_finish",function(){if(o=C.throttleOnProgress.call(i,n,e.onProgress),e.UploadData.UploadId)a.emit("get_upload_data_finish",e.UploadData);else{var t=C.extend({TaskId:c,Bucket:l,Region:d,Key:f,Headers:e.Headers,StorageClass:v,Body:h,FileSize:n,SliceSize:p,onHashProgress:R},e);r.call(i,t,function(t,n){if(i._isRunningTask(c)){if(t)return a.emit("error",t);e.UploadData.UploadId=n.UploadId,e.UploadData.PartList=n.PartList,a.emit("get_upload_data_finish",e.UploadData)}})}}),n=e.ContentLength,delete e.ContentLength,!e.Headers&&(e.Headers={}),C.each(e.Headers,function(t,n){"content-length"===n.toLowerCase()&&delete e.Headers[n]}),function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],o=1048576,r=0;rh)return t(null,!1);if(n>1){if(Math.max(e[0].Size,e[1].Size)!==f)return t(null,!1)}var o=function(r){if(r=c.length)return void A.emit("has_and_check_upload_id",t);var i=c[e];return C.isInArray(t,i)?g.using[i]?void l(e+1):void a.call(u,{Bucket:o,Region:r,Key:s,UploadId:i},function(t,o){u._isRunningTask(n)&&(t?(g.removeUploadId(i),l(e+1)):A.emit("upload_id_available",{UploadId:i,PartList:o.PartList}))}):(g.removeUploadId(i),void l(e+1))};l(0)}),A.on("get_remote_upload_id_list",function(){i.call(u,{Bucket:o,Region:r,Key:s},function(t,r){if(u._isRunningTask(n)){if(t)return A.emit("error",t);var i=C.filter(r.UploadList,function(e){return e.Key===s&&(!c||e.StorageClass.toUpperCase()===c.toUpperCase())}).reverse().map(function(e){return e.UploadId||e.UploadID});if(i.length)A.emit("seek_local_avail_upload_id",i);else{var a,l=g.getFileId(e.Body,e.ChunkSize,o,s);l&&(a=g.getUploadIdList(l))&&C.each(a,function(e){g.removeUploadId(e)}),A.emit("no_available_upload_id")}}})}),A.emit("get_remote_upload_id_list")}function i(e,t){var n=this,o=[],r={Bucket:e.Bucket,Region:e.Region,Prefix:e.Key},i=function(){n.multipartList(r,function(e,n){if(e)return t(e);o.push.apply(o,n.Upload||[]),"true"===n.IsTruncated?(r.KeyMarker=n.NextKeyMarker,r.UploadIdMarker=n.NextUploadIdMarker,i()):t(null,{UploadList:o})})};i()}function a(e,t){var n=this,o=[],r={Bucket:e.Bucket,Region:e.Region,Key:e.Key,UploadId:e.UploadId},i=function(){n.multipartListPart(r,function(e,n){if(e)return t(e);o.push.apply(o,n.Part||[]),"true"===n.IsTruncated?(r.PartNumberMarker=n.NextPartNumberMarker,i()):t(null,{PartList:o})})};i()}function s(e,t){var n=this,o=e.TaskId,r=e.Bucket,i=e.Region,a=e.Key,s=e.UploadData,u=e.FileSize,l=e.SliceSize,d=Math.min(e.AsyncLimit||n.options.ChunkParallelLimit||1,256),f=e.Body,h=Math.ceil(u/l),p=0,g=e.ServerSideEncryption,y=C.filter(s.PartList,function(e){return e.Uploaded&&(p+=e.PartNumber>=h?u%l||l:l),!e.Uploaded}),v=e.onProgress;m.eachLimit(y,d,function(e,t){if(n._isRunningTask(o)){var d=e.PartNumber,h=Math.min(u,e.PartNumber*l)-(e.PartNumber-1)*l,m=0;c.call(n,{TaskId:o,Bucket:r,Region:i,Key:a,SliceSize:l,FileSize:u,PartNumber:d,ServerSideEncryption:g,Body:f,UploadData:s,onProgress:function(e){p+=e.loaded-m,m=e.loaded,v({loaded:p,total:u})}},function(r,i){n._isRunningTask(o)&&(r||i.ETag||(r='get ETag error, please add "ETag" to CORS ExposeHeader setting.'),r?p-=m:(p+=h-m,e.ETag=i.ETag),v({loaded:p,total:u}),t(r||null,i))})}},function(e){if(n._isRunningTask(o))return e?t(e):void t(null,{UploadId:s.UploadId,SliceList:s.PartList})})}function c(e,t){var n=this,o=e.TaskId,r=e.Bucket,i=e.Region,a=e.Key,s=e.FileSize,c=e.Body,u=1*e.PartNumber,l=e.SliceSize,d=e.ServerSideEncryption,f=e.UploadData,h=n.options.ChunkRetryTimes+1,p=l*(u-1),g=l,y=p+l;y>s&&(y=s,g=y-p);var v=f.PartList[u-1];m.retry(h,function(t){n._isRunningTask(o)&&C.fileSlice(c,p,y,!0,function(s){n.multipartUpload({TaskId:o,Bucket:r,Region:i,Key:a,ContentLength:g,PartNumber:u,UploadId:f.UploadId,ServerSideEncryption:d,Body:s,onProgress:e.onProgress},function(e,r){if(n._isRunningTask(o))return e?t(e):(v.Uploaded=!0,t(null,r))})})},function(e,r){if(n._isRunningTask(o))return t(e,r)})}function u(e,t){var n=e.Bucket,o=e.Region,r=e.Key,i=e.UploadId,a=e.SliceList,s=this,c=this.options.ChunkRetryTimes+1,u=e.Headers,l=a.map(function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}});m.retry(c,function(e){s.multipartComplete({Bucket:n,Region:o,Key:r,UploadId:i,Parts:l,Headers:u},e)},function(e,n){t(e,n)})}function l(e,t){var n=e.Bucket,o=e.Region,r=e.Key,a=e.UploadId,s=e.Level||"task",c=e.AsyncLimit,u=this,l=new y;if(l.on("error",function(e){return t(e)}),l.on("get_abort_array",function(i){d.call(u,{Bucket:n,Region:o,Key:r,Headers:e.Headers,AsyncLimit:c,AbortArray:i},function(e,n){if(e)return t(e);t(null,n)})}),"bucket"===s)i.call(u,{Bucket:n,Region:o},function(e,n){if(e)return t(e);l.emit("get_abort_array",n.UploadList||[])});else if("file"===s){if(!r)return t({error:"abort_upload_task_no_key"});i.call(u,{Bucket:n,Region:o,Key:r},function(e,n){if(e)return t(e);l.emit("get_abort_array",n.UploadList||[])})}else{if("task"!==s)return t({error:"abort_unknown_level"});if(!a)return t({error:"abort_upload_task_no_id"});if(!r)return t({error:"abort_upload_task_no_key"});l.emit("get_abort_array",[{Key:r,UploadId:a}])}}function d(e,t){var n=e.Bucket,o=e.Region,r=e.Key,i=e.AbortArray,a=e.AsyncLimit||1,s=this,c=0,u=new Array(i.length);m.eachLimit(i,a,function(t,i){var a=c;if(r&&r!==t.Key)return u[a]={error:{KeyNotMatch:!0}},void i(null);var l=t.UploadId||t.UploadID;s.multipartAbort({Bucket:n,Region:o,Key:t.Key,Headers:e.Headers,UploadId:l},function(e){var r={Bucket:n,Region:o,Key:t.Key,UploadId:l};u[a]={error:e,task:r},i(null)}),c++},function(e){if(e)return t(e);for(var n=[],o=[],r=0,i=u.length;r=o?"sliceUploadFile":"putObject";d.push({api:v,params:e,callback:y})}()}),n._addTasks(d)}function h(e,t){var n=new y,o=this,r=e.Bucket,i=e.Region,a=e.Key,s=e.CopySource,c=s.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^\/]+\/(.+)$/);if(!c)return void t({error:"CopySource format error"});var u=c[1],l=c[3],d=decodeURIComponent(c[4]),f=void 0===e.CopySliceSize?o.options.CopySliceSize:e.CopySliceSize;f=Math.max(0,f);var h,g,v=e.CopyChunkSize||this.options.CopyChunkSize,k=this.options.CopyChunkParallelLimit,R=0;n.on("copy_slice_complete",function(n){var s={};C.each(e.Headers,function(e,t){0===t.toLowerCase().indexOf("x-cos-meta-")&&(s[t]=e)}),o.multipartComplete({Bucket:r,Region:i,Key:a,UploadId:n.UploadId,Parts:n.PartList},function(e,n){if(e)return g(null,!0),t(e);g({loaded:h,total:h},!0),t(null,n)})}),n.on("get_copy_data_finish",function(e){m.eachLimit(e.PartList,k,function(t,n){var c=t.PartNumber,u=t.CopySourceRange,l=t.end-t.start,d=0;p.call(o,{Bucket:r,Region:i,Key:a,CopySource:s,UploadId:e.UploadId,PartNumber:c,CopySourceRange:u,onProgress:function(e){R+=e.loaded-d,d=e.loaded,g({loaded:R,total:h})}},function(e,o){if(e)return n(e);g({loaded:R,total:h}),R+=l-d,t.ETag=o.ETag,n(e||null,o)})},function(o){if(o)return g(null,!0),t(o);n.emit("copy_slice_complete",e)})}),n.on("get_file_size_finish",function(s){!function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],n=1048576,r=0;r"x-cos-meta-".length&&(s[t]=e)}),n.emit("get_file_size_finish",s)}})}function p(e,t){var n=e.TaskId,o=e.Bucket,r=e.Region,i=e.Key,a=e.CopySource,s=e.UploadId,c=1*e.PartNumber,u=e.CopySourceRange,l=this.options.ChunkRetryTimes+1,d=this;m.retry(l,function(t){d.uploadPartCopy({TaskId:n,Bucket:o,Region:r,Key:i,CopySource:a,UploadId:s,PartNumber:c,CopySourceRange:u,onProgress:e.onProgress},function(e,n){t(e||null,n)})},function(e,n){return t(e,n)})}var g=n(4),m=n(19),y=n(3).EventProxy,C=n(0),v={sliceUploadFile:o,abortUploadTask:l,uploadFiles:f,sliceCopyFile:h};e.exports.init=function(e,t){t.transferToTaskMethod(v,"sliceUploadFile"),C.each(v,function(t,n){e.prototype[n]=C.apiWrapper(n,t)})}},function(e,t){var n=function(e,t,n,o){if(o=o||function(){},!e.length||t<=0)return o();var r=0,i=0,a=0;!function s(){if(r>=e.length)return o();for(;a=e.length?o():s())})}()},o=function(e,t,n){var o=function(r){t(function(t,i){t&&r