!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(i){if(n[i])return n[i].exports;var a=n[i]={i:i,l:!1,exports:{}};return e[i].call(a.exports,a,a.exports,t),a.l=!0,a.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,i){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:i})},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="D:\\code\\cos-wx-sdk-v5\\demo\\lib",t(t.s=6)}([function(e,t,n){"use strict";(function(t){function i(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function a(e){return u(e,function(e){return"object"==typeof e?a(e):e})}function o(e,t,n){return e&&t in e?e[t]:n}function r(e,t){return p(t,function(n,i){e[i]=t[i]}),e}function s(e){return e instanceof Array}function c(e,t){for(var n=!1,i=0;it?1:-1})},d=function(e){var t,n,a,o=[],r=u(e);for(t=0;t-1||"deleteMultipleObject"===e||"multipartList"===e||"listObjectVersions"===e){if(!n)return"Bucket";if(!i)return"Region"}else if(e.indexOf("Object")>-1||e.indexOf("multipart")>-1||"sliceUploadFile"===e||"abortUploadTask"===e){if(!n)return"Bucket";if(!i)return"Region";if(!a)return"Key"}return!1},E=function(e,t){if(t=r({},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 i={"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"};j.each(i,function(e,i){void 0!==t[e]&&(n[i]=t[e])}),t.Headers=b(n)}}return t},B=function(e,n){return function(i,a){var o=this;"function"==typeof i&&(a=i,i={}),i=E(e,i);var r=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){a&&a(r(e),r(t))},c=function(){if("getService"!==e&&"abortUploadTask"!==e){var t=T(e,i);if(t)return"missing param "+t;if(i.Region){if(i.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(i.Region))return"Region format error.";o.options.CompatibilityMode||-1!==i.Region.indexOf("-")||"yfb"===i.Region||"default"===i.Region||console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(i.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(i.Bucket))if(i.AppId)i.Bucket=i.Bucket+"-"+i.AppId;else{if(!o.options.AppId)return'Bucket should format as "test-1250000000".';i.Bucket=i.Bucket+"-"+o.options.AppId}i.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete i.AppId)}i.Key&&"/"===i.Key.substr(0,1)&&(i.Key=i.Key.substr(1))}}(),l="getAuth"===e||"getObjectUrl"===e,p=t.Promise;if(!l&&p&&!a)return new p(function(e,t){if(a=function(n,i){n?t(n):e(i)},c)return s({error:c});n.call(o,i,s)});if(c)return s({error:c});var u=n.call(o,i,s);return l?u:void 0}},O=function(e,t){function n(){if(a=0,t&&"function"==typeof t){i=Date.now();var n,o=Math.max(0,Math.round((s-r)/((i-c)/1e3)*100)/100)||0;n=0===s&&0===e?1:Math.floor(s/e*100)/100||0,c=i,r=s;try{t({loaded:s,total:e,speed:o,percent:n})}catch(e){}}}var i,a,o=this,r=0,s=0,c=Date.now();return function(t,i){if(t&&(s=t.loaded,e=t.total),i)clearTimeout(a),n();else{if(a)return;a=setTimeout(n,o.options.ProgressInterval)}}},D=function(e,t,n){"postObject"===e?n():"putObject"===e?void 0!==t.Body?(t.ContentLength=t.Body.byteLength,n(null,t.ContentLength)):n({error:"missing param Body"}):t.FilePath?y.stat({path:t.FilePath,success:function(e){var i=e.stats;t.FileStat=i,t.FileStat.FilePath=t.FilePath;var a=i.isDirectory()?0:i.size;t.ContentLength=a=a||0,n(null,a)},fail:function(e){n(e)}}):n({error:"missing param FilePath"})},N=function(e){return Date.now()+(e||0)},I=function(e,t){e=e.split("."),t=t.split(".");for(var n=Math.max(e.length,t.length);e.lengtho)return 1;if(a=0,n=!t&&"devtools"===e.platform;return function(){return n&&console.warn("\u5f53\u524d\u5c0f\u7a0b\u5e8f\u7248\u672c\u5c0f\u4e8e 2.10.0\uff0c\u4e0d\u652f\u6301\u5206\u7247\u4e0a\u4f20\uff0c\u8bf7\u66f4\u65b0\u8f6f\u4ef6\u3002"),n=!1,t}}(),j={noop:k,formatParams:E,apiWrapper:B,xml2json:h,json2xml:g,md5:m,clearKey:b,fileSlice:S,getBodyMd5:R,getFileMd5:w,binaryBase64:_,extend:r,isArray:s,isInArray:c,makeArray:l,each:p,map:u,filter:d,clone:a,attr:o,uuid:A,camSafeUrlEncode:i,throttleOnProgress:O,getFileSize:D,getSkewTime:N,getAuth:C,compareVersion:I,canFileSlice:P};e.exports=j}).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 i(e,t){function i(){}var a=e.prototype;if(Object.create){var o=Object.create(t.prototype);a.__proto__=o}a instanceof t||(i.prototype=t.prototype,i=new i,n(a,i),e.prototype=a=i),a.constructor!=e&&("function"!=typeof e&&console.error("unknow Class:"+e),a.constructor=e)}function a(e,t){if(t instanceof Error)var n=t;else n=this,Error.call(this,ae[e]),this.message=ae[e],Error.captureStackTrace&&Error.captureStackTrace(this,a);return n.code=e,t&&(this.message=this.message+": "+t),n}function o(){}function r(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 i=e._refresh(e._node);L(e,"length",i.length),n(i,e),e._inc=t}}function c(){}function l(e,t){for(var n=e.length;n--;)if(e[n]===t)return n}function p(e,t,n,i){if(i?t[l(t,i)]=n:t[t.length++]=n,e){n.ownerElement=e;var a=e.ownerDocument;a&&(i&&x(a,e,i),v(a,e,n))}}function u(e,t,n){var i=l(t,n);if(!(i>=0))throw a(re,new Error(e.tagName+"@"+n));for(var o=t.length-1;i"==e&&">"||"&"==e&&"&"||'"'==e&&"""||"&#"+e.charCodeAt()+";"}function h(e,t){if(t(e))return!0;if(e=e.firstChild)do{if(h(e,t))return!0}while(e=e.nextSibling)}function g(){}function v(e,t,n){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&(t._nsMap[n.prefix?n.localName:""]=n.value)}function x(e,t,n,i){e&&e._inc++,"http://www.w3.org/2000/xmlns/"==n.namespaceURI&&delete t._nsMap[n.prefix?n.localName:""]}function y(e,t,n){if(e&&e._inc){e._inc++;var i=t.childNodes;if(n)i[i.length++]=n;else{for(var a=t.firstChild,o=0;a;)i[o++]=a,a=a.nextSibling;i.length=o}}}function C(e,t){var n=t.previousSibling,i=t.nextSibling;return n?n.nextSibling=i:e.firstChild=i,i?i.previousSibling=n:e.lastChild=n,y(e.ownerDocument,e),t}function k(e,t,n){var i=t.parentNode;if(i&&i.removeChild(t),t.nodeType===te){var a=t.firstChild;if(null==a)return t;var o=t.lastChild}else a=o=t;var r=n?n.previousSibling:e.lastChild;a.previousSibling=r,o.nextSibling=n,r?r.nextSibling=a:e.firstChild=a,null==n?e.lastChild=o:n.previousSibling=o;do{a.parentNode=e}while(a!==o&&(a=a.nextSibling));return y(e.ownerDocument||e,e),t.nodeType==te&&(t.firstChild=t.lastChild=null),t}function b(e,t){var n=t.parentNode;if(n){var i=e.lastChild;n.removeChild(t);var i=e.lastChild}var i=e.lastChild;return t.parentNode=e,t.previousSibling=i,t.nextSibling=null,i?i.nextSibling=t:e.firstChild=t,e.lastChild=t,y(e.ownerDocument,e,t),t}function S(){this._nsMap={}}function R(){}function w(){}function _(){}function A(){}function T(){}function E(){}function B(){}function O(){}function D(){}function N(){}function I(){}function P(){}function j(e,t){var n=[],i=9==this.nodeType?this.documentElement:this,a=i.prefix,o=i.namespaceURI;if(o&&null==a){var a=i.lookupPrefix(o);if(null==a)var r=[{namespace:o,prefix:null}]}return U(this,n,e,t,r),n.join("")}function M(e,t,n){var i=e.prefix||"",a=e.namespaceURI;if(!i&&!a)return!1;if("xml"===i&&"http://www.w3.org/XML/1998/namespace"===a||"http://www.w3.org/2000/xmlns/"==a)return!1;for(var o=n.length;o--;){var r=n[o];if(r.prefix==i)return r.namespace!=a}return!0}function U(e,t,n,i,a){if(i){if(!(e=i(e)))return;if("string"==typeof e)return void t.push(e)}switch(e.nodeType){case G:a||(a=[]);var o=(a.length,e.attributes),r=o.length,s=e.firstChild,c=e.tagName;n=K===e.namespaceURI||n,t.push("<",c);for(var l=0;l"),n&&/^script$/i.test(c))for(;s;)s.data?t.push(s.data):U(s,t,n,i,a),s=s.nextSibling;else for(;s;)U(s,t,n,i,a),s=s.nextSibling;t.push("")}else t.push("/>");return;case Z:case te:for(var s=e.firstChild;s;)U(s,t,n,i,a),s=s.nextSibling;return;case V:return t.push(" ",e.name,'="',e.value.replace(/[<&"]/g,f),'"');case X:return t.push(e.data.replace(/[<&]/g,f));case W:return t.push("");case Y:return t.push("\x3c!--",e.data,"--\x3e");case ee:var h=e.publicId,g=e.systemId;if(t.push("');else if(g&&"."!=g)t.push(' SYSTEM "',g,'">');else{var v=e.internalSubset;v&&t.push(" [",v,"]"),t.push(">")}return;case J:return t.push("");case $:return t.push("&",e.nodeName,";");default:t.push("??",e.nodeName)}}function F(e,t,n){var i;switch(t.nodeType){case G:i=t.cloneNode(!1),i.ownerDocument=e;case te:break;case V:n=!0}if(i||(i=t.cloneNode(!1)),i.ownerDocument=e,i.parentNode=null,n)for(var a=t.firstChild;a;)i.appendChild(F(e,a,n)),a=a.nextSibling;return i}function H(e,t,n){var i=new t.constructor;for(var a in t){var r=t[a];"object"!=typeof r&&r!=i[a]&&(i[a]=r)}switch(t.childNodes&&(i.childNodes=new o),i.ownerDocument=e,i.nodeType){case G:var s=t.attributes,l=i.attributes=new c,p=s.length;l._ownerElement=i;for(var u=0;u0},lookupPrefix:function(e){for(var t=this;t;){var n=t._nsMap;if(n)for(var i in n)if(n[i]==e)return i;t=t.nodeType==V?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==V?t.ownerDocument:t.parentNode}return null},isDefaultNamespace:function(e){return null==this.lookupPrefix(e)}},n(q,m),n(q,m.prototype),g.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 i=n.nextSibling;this.insertBefore(n,t),n=i}return e}return null==this.documentElement&&e.nodeType==G&&(this.documentElement=e),k(this,e,t),e.ownerDocument=this,e},removeChild:function(e){return this.documentElement==e&&(this.documentElement=null),C(this,e)},importNode:function(e,t){return F(this,e,t)},getElementById:function(e){var t=null;return h(this.documentElement,function(n){if(n.nodeType==G&&n.getAttribute("id")==e)return t=n,!0}),t},createElement:function(e){var t=new S;return t.ownerDocument=this,t.nodeName=e,t.tagName=e,t.childNodes=new o,(t.attributes=new c)._ownerElement=t,t},createDocumentFragment:function(){var e=new N;return e.ownerDocument=this,e.childNodes=new o,e},createTextNode:function(e){var t=new _;return t.ownerDocument=this,t.appendData(e),t},createComment:function(e){var t=new A;return t.ownerDocument=this,t.appendData(e),t},createCDATASection:function(e){var t=new T;return t.ownerDocument=this,t.appendData(e),t},createProcessingInstruction:function(e,t){var n=new I;return n.ownerDocument=this,n.tagName=n.target=e,n.nodeValue=n.data=t,n},createAttribute:function(e){var t=new R;return t.ownerDocument=this,t.name=e,t.nodeName=e,t.localName=e,t.specified=!0,t},createEntityReference:function(e){var t=new D;return t.ownerDocument=this,t.nodeName=e,t},createElementNS:function(e,t){var n=new S,i=t.split(":"),a=n.attributes=new c;return n.childNodes=new o,n.ownerDocument=this,n.nodeName=t,n.tagName=t,n.namespaceURI=e,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,a._ownerElement=n,n},createAttributeNS:function(e,t){var n=new R,i=t.split(":");return n.ownerDocument=this,n.nodeName=t,n.name=t,n.namespaceURI=e,n.specified=!0,2==i.length?(n.prefix=i[0],n.localName=i[1]):n.localName=t,n}},i(g,m),S.prototype={nodeType:G,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):b(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 i=this.ownerDocument.createAttributeNS(e,t);i.value=i.nodeValue=""+n,this.setAttributeNode(i)},getAttributeNodeNS:function(e,t){return this.attributes.getNamedItemNS(e,t)},getElementsByTagName:function(e){return new r(this,function(t){var n=[];return h(t,function(i){i===t||i.nodeType!=G||"*"!==e&&i.tagName!=e||n.push(i)}),n})},getElementsByTagNameNS:function(e,t){return new r(this,function(n){var i=[];return h(n,function(a){a===n||a.nodeType!==G||"*"!==e&&a.namespaceURI!==e||"*"!==t&&a.localName!=t||i.push(a)}),i})}},g.prototype.getElementsByTagName=S.prototype.getElementsByTagName,g.prototype.getElementsByTagNameNS=S.prototype.getElementsByTagNameNS,i(S,m),R.prototype.nodeType=V,i(R,m),w.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(ae[oe])},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}},i(w,m),_.prototype={nodeName:"#text",nodeType:X,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 i=this.ownerDocument.createTextNode(n);return this.parentNode&&this.parentNode.insertBefore(i,this.nextSibling),i}},i(_,w),A.prototype={nodeName:"#comment",nodeType:Y},i(A,w),T.prototype={nodeName:"#cdata-section",nodeType:W},i(T,w),E.prototype.nodeType=ee,i(E,m),B.prototype.nodeType=ne,i(B,m),O.prototype.nodeType=Q,i(O,m),D.prototype.nodeType=$,i(D,m),N.prototype.nodeName="#document-fragment",N.prototype.nodeType=te,i(N,m),I.prototype.nodeType=J,i(I,m),P.prototype.serializeToString=function(e,t,n){return j.call(e,t,n)},m.prototype.toString=j;try{Object.defineProperty&&(Object.defineProperty(r.prototype,"length",{get:function(){return s(this),this.$$length}}),Object.defineProperty(m.prototype,"textContent",{get:function(){return z(this)},set:function(e){switch(this.nodeType){case G: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}}}),L=function(e,t,n){e["$$"+t]=n})}catch(e){}t.DOMImplementation=d,t.XMLSerializer=P},function(e,t){var n=function(e){e=e||{};var t,n=e.Base64,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=function(e){for(var t={},n=0,i=e.length;n>>6)+o(128|63&t):o(224|t>>>12&15)+o(128|t>>>6&63)+o(128|63&t)}var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return o(240|t>>>18&7)+o(128|t>>>12&63)+o(128|t>>>6&63)+o(128|63&t)},s=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,c=function(e){return e.replace(s,r)},l=function(e){var t=[0,2,1][e.length%3],n=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0);return[i.charAt(n>>>18),i.charAt(n>>>12&63),t>=2?"=":i.charAt(n>>>6&63),t>=1?"=":i.charAt(63&n)].join("")},p=e.btoa?function(t){return e.btoa(t)}:function(e){return e.replace(/[\s\S]{1,3}/g,l)},u=t?function(e){return(e.constructor===t.constructor?e:new t(e)).toString("base64")}:function(e){return p(c(e))},d=function(e,t){return t?u(String(e)).replace(/[+\/]/g,function(e){return"+"==e?"-":"_"}).replace(/=/g,""):u(String(e))},m=function(e){return d(e,!0)},f=new RegExp(["[\xc0-\xdf][\x80-\xbf]","[\xe0-\xef][\x80-\xbf]{2}","[\xf0-\xf7][\x80-\xbf]{3}"].join("|"),"g"),h=function(e){switch(e.length){case 4:var t=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),n=t-65536;return o(55296+(n>>>10))+o(56320+(1023&n));case 3:return o((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return o((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},g=function(e){return e.replace(f,h)},v=function(e){var t=e.length,n=t%4,i=(t>0?a[e.charAt(0)]<<18:0)|(t>1?a[e.charAt(1)]<<12:0)|(t>2?a[e.charAt(2)]<<6:0)|(t>3?a[e.charAt(3)]:0),r=[o(i>>>16),o(i>>>8&255),o(255&i)];return r.length-=[0,0,2,1][n],r.join("")},x=e.atob?function(t){return e.atob(t)}:function(e){return e.replace(/[\s\S]{1,4}/g,v)},y=t?function(e){return(e.constructor===t.constructor?e:new t(e,"base64")).toString()}:function(e){return g(x(e))},C=function(e){return y(String(e).replace(/[-_]/g,function(e){return"-"==e?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,""))};return{VERSION:"2.1.9",atob:x,btoa:p,fromBase64:C,toBase64:d,utob:c,encode:d,encodeURI:m,btou:g,decode:C,noConflict:function(){var t=e.Base64;return e.Base64=n,t}}}();e.exports=n},function(e,t){var n=function(e){var t={},n=function(e){return!t[e]&&(t[e]=[]),t[e]};e.on=function(e,t){n(e).push(t)},e.off=function(e,t){for(var i=n(e),a=i.length-1;a>=0;a--)t===i[a]&&i.splice(a,1)},e.emit=function(e,t){for(var i=n(e).map(function(e){return e}),a=0;a=0;n--){var a=i[n][2];(!a||a+2592e3=0;o--){var r=i[o];r[0]===e&&r[1]===t?i.splice(o,1):e!==r[0]&&0===r[0].indexOf(a)&&i.splice(o,1)}i.unshift([e,t,Math.round(Date.now()/1e3)]),i.length>n&&i.splice(n),l()}},removeUploadId:function(e){c(),delete p.using[e];for(var t=i.length-1;t>=0;t--)i[t][1]===e&&i.splice(t,1);l()}};e.exports=p},function(e,t,n){var i=n(7);e.exports=i},function(e,t,n){"use strict";var i=n(0),a=n(4),o=n(16),r=n(17),s=n(23),c={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,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadIdCacheLimit:50},l=function(e){this.options=i.extend(i.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").'),a.init(this),o.init(this)};r.init(l,o),s.init(l,o),l.getAuthorization=i.getAuth,l.version="1.0.5",e.exports=l},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__(10),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){return new Md5(!0).update(t)[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[o]<>6,c[a++]=128|63&i):i<55296||i>=57344?(c[a++]=224|i>>12,c[a++]=128|i>>6&63,c[a++]=128|63&i):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++o)),c[a++]=240|i>>18,c[a++]=128|i>>12&63,c[a++]=128|i>>6&63,c[a++]=128|63&i);else for(a=this.start;o>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[a>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=64?(this.start=a-64,this.hash(),this.hashed=!0):this.start=a}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,i,a,o,r=this.blocks;this.first?(e=r[0]-680876937,e=(e<<7|e>>>25)-271733879<<0,i=(-1732584194^2004318071&e)+r[1]-117830708,i=(i<<12|i>>>20)+e<<0,n=(-271733879^i&(-271733879^e))+r[2]-1126478375,n=(n<<17|n>>>15)+i<<0,t=(e^n&(i^e))+r[3]-1316259209,t=(t<<22|t>>>10)+n<<0):(e=this.h0,t=this.h1,n=this.h2,i=this.h3,e+=(i^t&(n^i))+r[0]-680876936,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[1]-389564586,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[2]+606105819,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[3]-1044525330,t=(t<<22|t>>>10)+n<<0),e+=(i^t&(n^i))+r[4]-176418897,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[5]+1200080426,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[6]-1473231341,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[7]-45705983,t=(t<<22|t>>>10)+n<<0,e+=(i^t&(n^i))+r[8]+1770035416,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[9]-1958414417,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[10]-42063,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[11]-1990404162,t=(t<<22|t>>>10)+n<<0,e+=(i^t&(n^i))+r[12]+1804603682,e=(e<<7|e>>>25)+t<<0,i+=(n^e&(t^n))+r[13]-40341101,i=(i<<12|i>>>20)+e<<0,n+=(t^i&(e^t))+r[14]-1502002290,n=(n<<17|n>>>15)+i<<0,t+=(e^n&(i^e))+r[15]+1236535329,t=(t<<22|t>>>10)+n<<0,e+=(n^i&(t^n))+r[1]-165796510,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[6]-1069501632,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[11]+643717713,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[0]-373897302,t=(t<<20|t>>>12)+n<<0,e+=(n^i&(t^n))+r[5]-701558691,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[10]+38016083,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[15]-660478335,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[4]-405537848,t=(t<<20|t>>>12)+n<<0,e+=(n^i&(t^n))+r[9]+568446438,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[14]-1019803690,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[3]-187363961,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[8]+1163531501,t=(t<<20|t>>>12)+n<<0,e+=(n^i&(t^n))+r[13]-1444681467,e=(e<<5|e>>>27)+t<<0,i+=(t^n&(e^t))+r[2]-51403784,i=(i<<9|i>>>23)+e<<0,n+=(e^t&(i^e))+r[7]+1735328473,n=(n<<14|n>>>18)+i<<0,t+=(i^e&(n^i))+r[12]-1926607734,t=(t<<20|t>>>12)+n<<0,a=t^n,e+=(a^i)+r[5]-378558,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[8]-2022574463,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[11]+1839030562,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[14]-35309556,t=(t<<23|t>>>9)+n<<0,a=t^n,e+=(a^i)+r[1]-1530992060,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[4]+1272893353,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[7]-155497632,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[10]-1094730640,t=(t<<23|t>>>9)+n<<0,a=t^n,e+=(a^i)+r[13]+681279174,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[0]-358537222,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[3]-722521979,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[6]+76029189,t=(t<<23|t>>>9)+n<<0,a=t^n,e+=(a^i)+r[9]-640364487,e=(e<<4|e>>>28)+t<<0,i+=(a^e)+r[12]-421815835,i=(i<<11|i>>>21)+e<<0,o=i^e,n+=(o^t)+r[15]+530742520,n=(n<<16|n>>>16)+i<<0,t+=(o^n)+r[2]-995338651,t=(t<<23|t>>>9)+n<<0,e+=(n^(t|~i))+r[0]-198630844,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[7]+1126891415,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[14]-1416354905,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[5]-57434055,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~i))+r[12]+1700485571,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[3]-1894986606,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[10]-1051523,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[1]-2054922799,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~i))+r[8]+1873313359,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[15]-30611744,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[6]-1560198380,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[13]+1309151649,t=(t<<21|t>>>11)+n<<0,e+=(n^(t|~i))+r[4]-145523070,e=(e<<6|e>>>26)+t<<0,i+=(t^(e|~n))+r[11]-1120210379,i=(i<<10|i>>>22)+e<<0,n+=(e^(i|~t))+r[2]+718787259,n=(n<<15|n>>>17)+i<<0,t+=(i^(n|~e))+r[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=i+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+i<<0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=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[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,n=this.h2,i=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255,255&i,i>>8&255,i>>16&255,i>>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,i="",a=this.array(),o=0;o<15;)e=a[o++],t=a[o++],n=a[o++],i+=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=a[o],i+=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__(9),__webpack_require__(1))},function(e,t){function n(){throw new Error("setTimeout has not been defined")}function i(){throw new Error("clearTimeout has not been defined")}function a(e){if(p===setTimeout)return setTimeout(e,0);if((p===n||!p)&&setTimeout)return p=setTimeout,setTimeout(e,0);try{return p(e,0)}catch(t){try{return p.call(null,e,0)}catch(t){return p.call(this,e,0)}}}function o(e){if(u===clearTimeout)return clearTimeout(e);if((u===i||!u)&&clearTimeout)return u=clearTimeout,clearTimeout(e);try{return u(e)}catch(t){try{return u.call(null,e)}catch(t){return u.call(this,e)}}}function r(){h&&m&&(h=!1,m.length?f=m.concat(f):g=-1,f.length&&s())}function s(){if(!h){var e=a(r);h=!0;for(var t=f.length;t;){for(m=f,f=[];++g1)for(var n=1;n>>2]|=(n[a>>>2]>>>24-a%4*8&255)<<24-(i+a)%4*8;else if(65535>>2]=n[a>>>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=o.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n=[],i=0;i>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i>>3]|=parseInt(e.substr(i,2),16)<<24-i%8*4;return new r.init(n,t/2)}},l=s.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var n=[],i=0;i>>2]>>>24-i%4*8&255));return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i>>2]|=(255&e.charCodeAt(i))<<24-i%4*8;return new r.init(n,t)}},p=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},u=i.BufferedBlockAlgorithm=o.extend({reset:function(){this._data=new r.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,i=n.words,a=n.sigBytes,o=this.blockSize,s=a/(4*o),s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0);if(t=s*o,a=e.min(4*t,a),t){for(var c=0;cl;l++){if(16>l)o[l]=0|e[t+l];else{var p=o[l-3]^o[l-8]^o[l-14]^o[l-16];o[l]=p<<1|p>>>31}p=(i<<5|i>>>27)+c+o[l],p=20>l?p+(1518500249+(a&r|~a&s)):40>l?p+(1859775393+(a^r^s)):60>l?p+((a&r|a&s|r&s)-1894007588):p+((a^r^s)-899497514),c=s,s=r,r=a<<30|a>>>2,a=i,i=p}n[0]=n[0]+i|0,n[1]=n[1]+a|0,n[2]=n[2]+r|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,i=8*e.sigBytes;return t[i>>>5]|=128<<24-i%32,t[14+(i+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(i+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=a._createHelper(t),e.HmacSHA1=a._createHmacHelper(t)}(),function(){var e=n,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 i=e.blockSize,a=4*i;n.sigBytes>a&&(n=e.finalize(n)),n.clamp();for(var o=this._oKey=n.clone(),r=this._iKey=n.clone(),s=o.words,c=r.words,l=0;l>>2]>>>24-o%4*8&255,s=t[o+1>>>2]>>>24-(o+1)%4*8&255,c=t[o+2>>>2]>>>24-(o+2)%4*8&255,l=r<<16|s<<8|c,p=0;p<4&&o+.75*p>>6*(3-p)&63));var u=i.charAt(64);if(u)for(;a.length%4;)a.push(u);return a.join("")},parse:function(e){var t=e.length,n=this._map,a=n.charAt(64);if(a){var o=e.indexOf(a);-1!=o&&(t=o)}for(var r=[],s=0,c=0;c>>6-c%4*2;r[s>>>2]|=(l|p)<<24-s%4*8,s++}return i.create(r,s)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.exports=n},function(e,t,n){var i=n(13).DOMParser,a=function(e){"use strict";function t(e){var t=e.localName;return null==t&&(t=e.baseName),null!=t&&""!=t||(t=e.nodeName),t}function n(e){return e.prefix}function a(e){return"string"==typeof e?e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"):e}function o(e,t,n,i){for(var a=0;a0&&o(e.arrayAccessFormPaths,t,n,i)&&(t[n]=[t[n]])}function s(e){var t=e.split(/[-T:+Z]/g),n=new Date(t[0],t[1]-1,t[2]),i=t[5].split(".");if(n.setHours(t[3],t[4],i[0]),i.length>1&&n.setMilliseconds(i[1]),t[6]&&t[7]){var a=60*t[6]+Number(t[7]);a=0+("-"==(/\d\d-\d\d:\d\d$/.test(e)?"-":"+")?-1*a:a),n.setMinutes(n.getMinutes()-a-n.getTimezoneOffset())}else-1!==e.indexOf("Z",e.length-1)&&(n=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds())));return n}function c(t,n,i){if(e.datetimeAccessFormPaths.length>0){var a=i.split(".#")[0];return o(e.datetimeAccessFormPaths,t,n,a)?s(t):t}return t}function l(t,n,i,a){return!(n==S.ELEMENT_NODE&&e.xmlElementsFilter.length>0)||o(e.xmlElementsFilter,t,i,a)}function p(i,a){if(i.nodeType==S.DOCUMENT_NODE){for(var o=new Object,s=i.childNodes,u=0;u1&&null!=o.__text&&e.skipEmptyTextNodesForObj&&(e.stripWhitespaces&&""==o.__text||""==o.__text.trim())&&delete o.__text:o=o.__cdata,delete o.__cnt,!e.enableToStringFunc||null==o.__text&&null==o.__cdata||(o.toString=function(){return(null!=this.__text?this.__text:"")+(null!=this.__cdata?this.__cdata:"")}),o}if(i.nodeType==S.TEXT_NODE||i.nodeType==S.CDATA_SECTION_NODE)return i.nodeValue}function u(t,n,i,o){var r="<"+(null!=t&&null!=t.__prefix?t.__prefix+":":"")+n;if(null!=i)for(var s=0;s":">"}function d(e,t){return""}function m(e,t){return-1!==e.indexOf(t,e.length-t.length)}function f(t,n){return!!("property"==e.arrayAccessForm&&m(n.toString(),"_asArray")||0==n.toString().indexOf(e.attributePrefix)||0==n.toString().indexOf("__")||t[n]instanceof Function)}function h(e){var t=0;if(e instanceof Object)for(var n in e)f(e,n)||t++;return t}function g(t,n,i){return 0==e.jsonPropertiesFilter.length||""==i||o(e.jsonPropertiesFilter,t,n,i)}function v(t){var n=[];if(t instanceof Object)for(var i in t)-1==i.toString().indexOf("__")&&0==i.toString().indexOf(e.attributePrefix)&&n.push(i);return n}function x(t){var n="";return null!=t.__cdata&&(n+=""),null!=t.__text&&(e.escapeMode?n+=a(t.__text):n+=t.__text),n}function y(t){var n="";return t instanceof Object?n+=x(t):null!=t&&(e.escapeMode?n+=a(t):n+=t),n}function C(e,t){return""===e?t:e+"."+t}function k(e,t,n,i){var a="";if(0==e.length)a+=u(e,t,n,!0);else for(var o=0;o0)for(var i in e)if(!f(e,i)&&(""==t||g(e,i,C(t,i)))){var a=e[i],o=v(a);if(null==a||void 0==a)n+=u(a,i,o,!0);else if(a instanceof Object)if(a instanceof Array)n+=k(a,i,o,t);else if(a instanceof Date)n+=u(a,i,o,!1),n+=a.toISOString(),n+=d(a,i);else{var r=h(a);r>0||null!=a.__text||null!=a.__cdata?(n+=u(a,i,o,!1),n+=b(a,C(t,i)),n+=d(a,i)):n+=u(a,i,o,!0)}else n+=u(a,i,o,!1),n+=y(a),n+=d(a,i)}return n+=y(e)}e=e||{},function(){void 0===e.escapeMode&&(e.escapeMode=!0),e.attributePrefix=e.attributePrefix||"_",e.arrayAccessForm=e.arrayAccessForm||"none",e.emptyNodeForm=e.emptyNodeForm||"text",void 0===e.enableToStringFunc&&(e.enableToStringFunc=!0),e.arrayAccessFormPaths=e.arrayAccessFormPaths||[],void 0===e.skipEmptyTextNodesForObj&&(e.skipEmptyTextNodesForObj=!0),void 0===e.stripWhitespaces&&(e.stripWhitespaces=!0),e.datetimeAccessFormPaths=e.datetimeAccessFormPaths||[],void 0===e.useDoubleQuotes&&(e.useDoubleQuotes=!1),e.xmlElementsFilter=e.xmlElementsFilter||[],e.jsonPropertiesFilter=e.jsonPropertiesFilter||[],void 0===e.keepCData&&(e.keepCData=!1)}();var S={ELEMENT_NODE:1,TEXT_NODE:3,CDATA_SECTION_NODE:4,COMMENT_NODE:8,DOCUMENT_NODE:9};this.parseXmlString=function(e){if(void 0===e)return null;var t;if(i){var n=new i,a=null;try{a=n.parseFromString("INVALID","text/xml").getElementsByTagName("parsererror")[0].namespaceURI}catch(e){a=null}try{t=n.parseFromString(e,"text/xml"),null!=a&&t.getElementsByTagNameNS(a,"parsererror").length>0&&(t=null)}catch(e){t=null}}else 0==e.indexOf("")+2)),t=new ActiveXObject("Microsoft.XMLDOM"),t.async="false",t.loadXML(e);return t},this.asArray=function(e){return void 0===e||null==e?[]:e instanceof Array?e:[e]},this.toXmlDateTime=function(e){return e instanceof Date?e.toISOString():"number"==typeof e?new Date(e).toISOString():null},this.asDateTime=function(e){return"string"==typeof e?s(e):e},this.xml2json=function(e){return p(e)},this.xml_str2json=function(e){var t=this.parseXmlString(e);return null!=t?this.xml2json(t):null},this.json2xml_str=function(e){return b(e,"")},this.json2xml=function(e){var t=this.json2xml_str(e);return this.parseXmlString(t)},this.getVersion=function(){return"1.2.0"}},o=function(e){if(!e)return null;var t=new i,n=t.parseFromString(e,"text/xml"),o=new a,r=o.xml2json(n);return r.html&&r.getElementsByTagName("parsererror").length?null:r};e.exports=o},function(e,t,n){function i(e){this.options=e||{locator:{}}}function a(e,t,n){function i(t){var i=e[t];!i&&r&&(i=2==e.length?function(n){e(t,n)}:e),a[t]=i&&function(e){i("[xmldom "+t+"]\t"+e+s(n))}||function(){}}if(!e){if(t instanceof o)return t;e=t}var a={},r=e instanceof Function;return n=n||{},i("warning"),i("error"),i("fatalError"),a}function o(){this.cdata=!1}function r(e,t){t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber}function s(e){if(e)return"\n@"+(e.systemId||"")+"#[line:"+e.lineNumber+",col:"+e.columnNumber+"]"}function c(e,t,n){return"string"==typeof e?e.substr(t,n):e.length>=t+n||t?new java.lang.String(e,t,n)+"":e}function l(e,t){e.currentElement?e.currentElement.appendChild(t):e.doc.appendChild(t)}i.prototype.parseFromString=function(e,t){var n=this.options,i=new p,r=n.domBuilder||new o,s=n.errorHandler,c=n.locator,l=n.xmlns||{},u={lt:"<",gt:">",amp:"&",quot:'"',apos:"'"};return c&&r.setDocumentLocator(c),i.errorHandler=a(s,r,c),i.domBuilder=n.domBuilder||r,/\/x?html?$/.test(t)&&(u.nbsp="\xa0",u.copy="\xa9",l[""]="http://www.w3.org/1999/xhtml"),l.xml=l.xml||"http://www.w3.org/XML/1998/namespace",e?i.parse(e,l,u):i.errorHandler.error("invalid doc source"),r.doc},o.prototype={startDocument:function(){this.doc=(new u).createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(e,t,n,i){var a=this.doc,o=a.createElementNS(e,n||t),s=i.length;l(this,o),this.currentElement=o,this.locator&&r(this.locator,o);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 f(e){var t=e.slice(1,-1);return t in n?n[t]:"#"===t.charAt(0)?m(parseInt(t.substr(1).replace("x","0x"))):(l.error("entity not found:"+e),e)}function h(t){if(t>S){var n=e.substring(S,t).replace(/&#?\w+;/g,f);C&&g(S),i.characters(n,0,t-S),S=t}}function g(t,n){for(;t>=x&&(n=y.exec(e));)v=n.index,x=v+n[0].length,C.lineNumber++;C.columnNumber=t-v+1}for(var v=0,x=0,y=/.*(?:\r\n?|\n)|.*$/g,C=i.locator,k=[{currentNSMap:t}],b={},S=0;;){try{var R=e.indexOf("<",S);if(R<0){if(!e.substr(S).match(/^\s*$/)){var w=i.doc,_=w.createTextNode(e.substr(S));w.appendChild(_),i.currentElement=_}return}switch(R>S&&h(R),e.charAt(R+1)){case"/":var A=e.indexOf(">",R+3),T=e.substring(R+2,A),E=k.pop();A<0?(T=e.substring(R+2).replace(/[\s<].*/,""),l.error("end tag name: "+T+" is not complete:"+E.tagName),A=R+1+T.length):T.match(/\sS?S=A:h(Math.max(R,S)+1)}}function a(e,t){return t.lineNumber=e.lineNumber,t.columnNumber=e.columnNumber,t}function o(e,t,n,i,a,o){for(var r,s,c=++t,l=x;;){var p=e.charAt(c);switch(p){case"=":if(l===y)r=e.slice(t,c),l=k;else{if(l!==C)throw new Error("attribute equal must after attrName");l=k}break;case"'":case'"':if(l===k||l===y){if(l===y&&(o.warning('attribute value must after "="'),r=e.slice(t,c)),t=c+1,!((c=e.indexOf(p,t))>0))throw new Error("attribute value no end '"+p+"' match");s=e.slice(t,c).replace(/&#?\w+;/g,a),n.add(r,s,t-1),l=S}else{if(l!=b)throw new Error('attribute value must after "="');s=e.slice(t,c).replace(/&#?\w+;/g,a),n.add(r,s,t),o.warning('attribute "'+r+'" missed start quot('+p+")!!"),t=c+1,l=S}break;case"/":switch(l){case x:n.setTagName(e.slice(t,c));case S:case R:case w:l=w,n.closed=!0;case b:case y:case C:break;default:throw new Error("attribute invalid close char('/')")}break;case"":return o.error("unexpected end of input"),l==x&&n.setTagName(e.slice(t,c)),c;case">":switch(l){case x:n.setTagName(e.slice(t,c));case S:case R:case w:break;case b:case y:s=e.slice(t,c),"/"===s.slice(-1)&&(n.closed=!0,s=s.slice(0,-1));case C:l===C&&(s=r),l==b?(o.warning('attribute "'+s+'" missed quot(")!!'),n.add(r,s.replace(/&#?\w+;/g,a),t)):("http://www.w3.org/1999/xhtml"===i[""]&&s.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+s+'" missed value!! "'+s+'" instead!!'),n.add(s,s,t));break;case k:throw new Error("attribute value missed!!")}return c;case"\x80":p=" ";default:if(p<=" ")switch(l){case x:n.setTagName(e.slice(t,c)),l=R;break;case y:r=e.slice(t,c),l=C;break;case b:var s=e.slice(t,c).replace(/&#?\w+;/g,a);o.warning('attribute "'+s+'" missed quot(")!!'),n.add(r,s,t);case S:l=R}else switch(l){case C:n.tagName;"http://www.w3.org/1999/xhtml"===i[""]&&r.match(/^(?:disabled|checked|selected)$/i)||o.warning('attribute "'+r+'" missed value!! "'+r+'" instead2!!'),n.add(r,r,t),t=c,l=y;break;case S:o.warning('attribute space is required"'+r+'"!!');case R:l=y,t=c;break;case k:l=b,t=c;break;case w:throw new Error("elements closed character '/' and '>' must be connected to")}}c++}}function r(e,t,n){for(var i=e.tagName,a=null,o=e.length;o--;){var r=e[o],s=r.qName,c=r.value,p=s.indexOf(":");if(p>0)var u=r.prefix=s.slice(0,p),d=s.slice(p+1),m="xmlns"===u&&d;else d=s,u=null,m="xmlns"===s&&"";r.localName=d,!1!==m&&(null==a&&(a={},l(n,n={})),n[m]=a[m]=c,r.uri="http://www.w3.org/2000/xmlns/",t.startPrefixMapping(m,c))}for(var o=e.length;o--;){r=e[o];var u=r.prefix;u&&("xml"===u&&(r.uri="http://www.w3.org/XML/1998/namespace"),"xmlns"!==u&&(r.uri=n[u||""]))}var p=i.indexOf(":");p>0?(u=e.prefix=i.slice(0,p),d=e.localName=i.slice(p+1)):(u=null,d=e.localName=i);var f=e.uri=n[u||""];if(t.startElement(f,d,i,e),!e.closed)return e.currentNSMap=n,e.localNSMap=a,!0;if(t.endElement(f,d,i),a)for(u in a)t.endPrefixMapping(u)}function s(e,t,n,i,a){if(/^(?:script|textarea)$/i.test(n)){var o=e.indexOf("",t),r=e.substring(t+1,o);if(/[&<]/.test(r))return/^script$/i.test(n)?(a.characters(r,0,r.length),o):(r=r.replace(/&#?\w+;/g,i),a.characters(r,0,r.length),o)}return t+1}function c(e,t,n,i){var a=i[n];return null==a&&(a=e.lastIndexOf(""),at?(n.comment(e,t+4,a-t-4),a+3):(i.error("Unclosed comment"),-1)}return-1;default:if("CDATA["==e.substr(t+3,6)){var a=e.indexOf("]]>",t+9);return n.startCDATA(),n.characters(e,t+9,a-t-9),n.endCDATA(),a+3}var o=f(e,t),r=o.length;if(r>1&&/!doctype/i.test(o[0][0])){var s=o[1][0],c=r>3&&/^public$/i.test(o[2][0])&&o[3][0],l=r>4&&o[4][0],p=o[r-1];return n.startDTD(s,c&&c.replace(/^(['"])(.*?)\1$/,"$2"),l&&l.replace(/^(['"])(.*?)\1$/,"$2")),n.endDTD(),p.index+p[0].length}}return-1}function u(e,t,n){var i=e.indexOf("?>",t);if(i){var a=e.substring(t,i).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);if(a){a[0].length;return n.processingInstruction(a[1],a[2]),i+2}return-1}return-1}function d(e){}function m(e,t){return e.__proto__=t,e}function f(e,t){var n,i=[],a=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(a.lastIndex=t,a.exec(e);n=a.exec(e);)if(i.push(n),n[1])return i}var h=/[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]/,g=new RegExp("[\\-\\.0-9"+h.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),v=new RegExp("^"+h.source+g.source+"*(?::"+h.source+g.source+"*)?$"),x=0,y=1,C=2,k=3,b=4,S=5,R=6,w=7;n.prototype={parse:function(e,t,n){var a=this.domBuilder;a.startDocument(),l(t,t={}),i(e,t,n,a,this.errorHandler),a.endDocument()}},d.prototype={setTagName:function(e){if(!v.test(e))throw new Error("invalid tagName:"+e);this.tagName=e},add:function(e,t,n){if(!v.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}},m({},m.prototype)instanceof m||(m=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(a,"")}var i=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"),a=/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm,o=function(e){var t=[];if(e instanceof Object)for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t},r=function(e,t){var a=function(e,n,a,o,r){var s=void 0!==t.indent?t.indent:"\t",c=t.prettyPrint?"\n"+new Array(o).join(s):"";t.removeIllegalNameCharacters&&(e=e.replace(i,"_"));var l=[c,"<",e,a||""];return n&&n.length>0?(l.push(">"),l.push(n),r&&l.push(c),l.push("")):l.push("/>"),l.join("")};return function e(i,r,s){var c=typeof i;switch((Array.isArray?Array.isArray(i):i instanceof Array)?c="array":i instanceof Date&&(c="date"),c){case"array":var l=[];return i.map(function(t){l.push(e(t,1,s+1))}),t.prettyPrint&&l.push("\n"),l.join("");case"date":return i.toJSON?i.toJSON():i+"";case"object":var p=[];for(var u in i)if(i.hasOwnProperty(u))if(i[u]instanceof Array)for(var d in i[u])i[u].hasOwnProperty(d)&&p.push(a(u,e(i[u][d],0,s+1),null,s+1,o(i[u][d]).length));else p.push(a(u,e(i[u],0,s+1),null,s+1));return t.prettyPrint&&p.length>0&&p.push("\n"),p.join("");case"function":return i();default:return t.escape?n(i):""+i}}(e,0,0)},s=function(e){var t=['"),t.join("")},c=function(e,t){if(t||(t={xmlHeader:{standalone:!0},prettyPrint:!0,indent:" "}),"string"==typeof e)try{e=JSON.parse(e.toString())}catch(e){return!1}var n="",i="";return t&&("object"==typeof t?(t.xmlHeader&&(n=s(!!t.xmlHeader.standalone)),void 0!==t.docType&&(i="")):n=s()),t=t||{},[n,t.prettyPrint&&i?"\n":"",i,r(e,t)].join("").replace(/\n{2,}/g,"\n").replace(/\s+$/g,"")};e.exports=c},function(e,t,n){var i=n(5),a=n(0),o={},r=function(e,t){o[t]=e[t],e[t]=function(e,n){e.SkipTask?o[t].call(this,e,n):this._addTask(t,e,n)}},s=function(e){var t=[],n={},r=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),t},l=function(){var n,i=function(){n=0,e.emit("task-list-update",{list:a.map(t,c)}),e.emit("list-update",{list:a.map(t,c)})};return function(){n||(n=setTimeout(i))}}(),p=function(){if(!(t.length<=e.options.UploadQueueSize)){for(var i=0;ie.options.UploadQueueSize;){var a="waiting"===t[i].state||"checking"===t[i].state||"uploading"===t[i].state;t[i]&&a?i++:(n[t[i].id]&&delete n[t[i].id],t.splice(i,1),s--)}l()}},u=function(){if(!(r>=e.options.FileParallelLimit)){for(;t[s]&&"waiting"!==t[s].state;)s++;if(!(s>=t.length)){var n=t[s];s++,r++,n.state="checking",n.params.onTaskStart&&n.params.onTaskStart(c(n)),!n.params.UploadData&&(n.params.UploadData={});var i=a.formatParams(n.api,n.params);o[n.api].call(e,i,function(t,i){e._isRunningTask(n.id)&&("checking"!==n.state&&"uploading"!==n.state||(n.state=t?"error":"success",t&&(n.error=t),r--,l(),u(),n.callback&&n.callback(t,i),"success"===n.state&&(n.params&&(delete n.params.UploadData,delete n.params.Body,delete n.params),delete n.callback)),p())}),l(),setTimeout(u)}}},d=function(t,a){var o=n[t];if(o){var s=o&&"waiting"===o.state,c=o&&("checking"===o.state||"uploading"===o.state);if("canceled"===a&&"canceled"!==o.state||"paused"===a&&s||"paused"===a&&c){if("paused"===a&&o.params.Body&&"function"==typeof o.params.Body.pipe)return void console.error("stream not support pause");o.state=a,e.emit("inner-kill-task",{TaskId:t,toState:a});try{var d=o&&o.params&&o.params.UploadData.UploadId}catch(e){}"canceled"===a&&d&&i.removeUsing(d),l(),c&&(r--,u()),"canceled"===a&&(o.params&&(delete o.params.UploadData,delete o.params.Body,delete o.params),delete o.callback)}p()}};e._addTasks=function(t){a.each(t,function(t){e._addTask(t.api,t.params,t.callback,!0)}),l()},e._addTask=function(i,o,r,s){"sliceUploadFile"!==i||a.canFileSlice()||(i="postObject"),o=a.formatParams(i,o);var c=a.uuid();o.TaskId=c,o.onTaskReady&&o.onTaskReady(c);var d={params:o,callback:r,api:i,index:t.length,id:c,Bucket:o.Bucket,Region:o.Region,Key:o.Key,FilePath:o.FilePath||"",state:"waiting",loaded:0,size:0,speed:0,percent:0,hashPercent:0,error:null},m=o.onHashProgress;o.onHashProgress=function(t){e._isRunningTask(d.id)&&(d.hashPercent=t.percent,m&&m(t),l())};var f=o.onProgress;return o.onProgress=function(t){e._isRunningTask(d.id)&&("checking"===d.state&&(d.state="uploading"),d.loaded=t.loaded,d.size=t.total,d.speed=t.speed,d.percent=t.percent,f&&f(t),l())},a.getFileSize(i,o,function(e,i){if(e)return void r(e);n[c]=d,t.push(d),d.size=i,!s&&l(),u(),p()}),c},e._isRunningTask=function(e){var t=n[e];return!(!t||"checking"!==t.state&&"uploading"!==t.state)},e.getTaskList=function(){return a.map(t,c)},e.cancelTask=function(e){d(e,"canceled")},e.pauseTask=function(e){d(e,"paused")},e.restartTask=function(e){var t=n[e];!t||"paused"!==t.state&&"error"!==t.state||(t.state="waiting",l(),s=Math.min(s,t.index),u())},e.isUploadRunning=function(){return r||s/gi,"<$1Rule>"),i=i.replace(/<(\/?)Tags>/gi,"<$1Tag>");var a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=_e.binaryBase64(_e.md5(i)),be.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"replication",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 _(e,t){be.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 i={ReplicationConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else e||!n.ReplicationConfiguration&&(n.ReplicationConfiguration={}),n.ReplicationConfiguration.Rule&&(n.ReplicationConfiguration.Rules=n.ReplicationConfiguration.Rule,delete n.ReplicationConfiguration.Rule),t(e,n)})}function A(e,t){be.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 T(e,t){if(!e.WebsiteConfiguration)return void t({error:"missing param WebsiteConfiguration"});var n=_e.clone(e.WebsiteConfiguration||{}),i=n.RoutingRules||n.RoutingRule||[];i=_e.isArray(i)?i:[i],delete n.RoutingRule,delete n.RoutingRules,i.length&&(n.RoutingRules={RoutingRule:i});var a=_e.json2xml({WebsiteConfiguration:n}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=_e.binaryBase64(_e.md5(a)),be.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:a,action:"website",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 E(e,t){be.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 i={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else t(e);else{var a=n.WebsiteConfiguration||{};if(a.RoutingRules){var o=_e.clone(a.RoutingRules.RoutingRule||[]);o=_e.makeArray(o),a.RoutingRules=o}t(null,{WebsiteConfiguration:a,statusCode:n.statusCode,headers:n.headers})}})}function B(e,t){be.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 O(e,t){if(!e.RefererConfiguration)return void t({error:"missing param RefererConfiguration"});var n=_e.clone(e.RefererConfiguration||{}),i=n.DomainList||{},a=i.Domains||i.Domain||[];a=_e.isArray(a)?a:[a],a.length&&(n.DomainList={Domain:a});var o=_e.json2xml({RefererConfiguration:n}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=_e.binaryBase64(_e.md5(o)),be.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"referer",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 D(e,t){be.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 i={WebsiteConfiguration:{},statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else t(e);else{var a=n.RefererConfiguration||{};if(a.DomainList){var o=_e.clone(a.DomainList.Domain||[]);o=_e.makeArray(o),a.DomainList={Domains:o}}t(null,{RefererConfiguration:a,statusCode:n.statusCode,headers:n.headers})}})}function N(e,t){var n=e.DomainConfiguration||{},i=n.DomainRule||e.DomainRule||[];i=_e.clone(i);var a=_e.json2xml({DomainConfiguration:{DomainRule:i}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=_e.binaryBase64(_e.md5(a)),be.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:a,action:"domain",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 I(e,t){be.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 i=[];try{i=n.DomainConfiguration.DomainRule||[]}catch(e){}i=_e.clone(_e.isArray(i)?i:[i]),t(null,{DomainRule:i,statusCode:n.statusCode,headers:n.headers})})}function P(e,t){be.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 j(e,t){var n=e.OriginConfiguration||{},i=n.OriginRule||e.OriginRule||[];i=_e.clone(i);var a=_e.json2xml({OriginConfiguration:{OriginRule:i}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=_e.binaryBase64(_e.md5(a)),be.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:a,action:"origin",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 M(e,t){be.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 i=[];try{i=n.OriginConfiguration.OriginRule||[]}catch(e){}i=_e.clone(_e.isArray(i)?i:[i]),t(null,{OriginRule:i,statusCode:n.statusCode,headers:n.headers})})}function U(e,t){be.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 F(e,t){var n=_e.json2xml({BucketLoggingStatus:e.BucketLoggingStatus||""}),i=e.Headers;i["Content-Type"]="application/xml",i["Content-MD5"]=_e.binaryBase64(_e.md5(n)),be.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"logging",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 H(e,t){be.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);delete n.BucketLoggingStatus._xmlns,t(null,{BucketLoggingStatus:n.BucketLoggingStatus,statusCode:n.statusCode,headers:n.headers})})}function L(e,t){var n=_e.clone(e.InventoryConfiguration);if(n.OptionalFields){var i=n.OptionalFields||[];n.OptionalFields={Field:i}}if(n.Destination&&n.Destination.COSBucketDestination&&n.Destination.COSBucketDestination.Encryption){var a=n.Destination.COSBucketDestination.Encryption;Object.keys(a).indexOf("SSECOS")>-1&&(a["SSE-COS"]=a.SSECOS,delete a.SSECOS)}var o=_e.json2xml({InventoryConfiguration:n}),r=e.Headers;r["Content-Type"]="application/xml",r["Content-MD5"]=_e.binaryBase64(_e.md5(o)),be.call(this,{Action:"name/cos:PutBucketInventory",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"inventory",qs:{id:e.Id},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 z(e,t){be.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 i=n.InventoryConfiguration;if(i&&i.OptionalFields&&i.OptionalFields.Field){var a=i.OptionalFields.Field;_e.isArray(a)||(a=[a]),i.OptionalFields=a}if(i.Destination&&i.Destination.COSBucketDestination&&i.Destination.COSBucketDestination.Encryption){var o=i.Destination.COSBucketDestination.Encryption;Object.keys(o).indexOf("SSE-COS")>-1&&(o.SSECOS=o["SSE-COS"],delete o["SSE-COS"])}t(null,{InventoryConfiguration:i,statusCode:n.statusCode,headers:n.headers})})}function K(e,t){be.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 i=n.ListInventoryConfigurationResult,a=i.InventoryConfiguration||[];a=_e.isArray(a)?a:[a],delete i.InventoryConfiguration,_e.each(a,function(e){if(e&&e.OptionalFields&&e.OptionalFields.Field){var t=e.OptionalFields.Field;_e.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"])}}),i.InventoryConfigurations=a,_e.extend(i,{statusCode:n.statusCode,headers:n.headers}),t(null,i)})}function q(e,t){be.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 G(e,t){if(!e.AccelerateConfiguration)return void t({error:"missing param AccelerateConfiguration"});var n={AccelerateConfiguration:e.AccelerateConfiguration||{}},i=_e.json2xml(n),a={};a["Content-Type"]="application/xml",a["Content-MD5"]=_e.binaryBase64(_e.md5(i)),be.call(this,{Interface:"putBucketAccelerate",Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:i,action:"accelerate",headers:a},function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})})}function V(e,t){be.call(this,{Interface:"getBucketAccelerate",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 X(e,t){be.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,i){if(n){var a=n.statusCode;return e.Headers["If-Modified-Since"]&&a&&304===a?t(null,{NotModified:!0,statusCode:a}):t(n)}i.ETag=_e.attr(i.headers,"etag",""),t(null,i)})}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,be.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 i=n.ListVersionsResult||{},a=i.DeleteMarker||[];a=_e.isArray(a)?a:[a];var o=i.Version||[];o=_e.isArray(o)?o:[o];var r=_e.clone(i);delete r.DeleteMarker,delete r.Version,_e.extend(r,{DeleteMarkers:a,Versions:o,statusCode:n.statusCode,headers:n.headers}),t(null,r)})}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,be.call(this,{Action:"name/cos:GetObject",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,qs:n,rawBody:!0},function(n,i){if(n){var a=n.statusCode;return e.Headers["If-Modified-Since"]&&a&&304===a?t(null,{NotModified:!0}):t(n)}t(null,{Body:i.body,ETag:_e.attr(i.headers,"etag",""),statusCode:i.statusCode,headers:i.headers})})}function Q(e,t){var n=this,i=e.ContentLength,a=_e.throttleOnProgress.call(n,i,e.onProgress),o=e.Headers;o["Cache-Control"]||o["cache-control"]||(o["Cache-Control"]=""),o["Content-Type"]||o["content-type"]||(o["Content-Type"]=Ae.getType(e.Key)||"application/octet-stream"),_e.getBodyMd5(n.options.UploadCheckContentMd5,e.Body,function(r){r&&(o["Content-MD5"]=_e.binaryBase64(r)),void 0!==e.ContentLength&&(o["Content-Length"]=e.ContentLength),a(null,!0),be.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:a},function(o,r){if(o)return a(null,!0),t(o);a({loaded:i,total:i},!0);var s=ye({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),r.Location=s,r.ETag=_e.attr(r.headers,"etag",""),t(null,r)})})}function J(e,t){var n=this,i={},a=e.FilePath;if(!a)return void t({error:"missing param FilePath"});i["Cache-Control"]=e.CacheControl,i["Content-Disposition"]=e.ContentDisposition,i["Content-Encoding"]=e.ContentEncoding,i["Content-MD5"]=e.ContentMD5,i["Content-Length"]=e.ContentLength,i["Content-Type"]=e.ContentType,i.Expect=e.Expect,i.Expires=e.Expires,i["x-cos-acl"]=e.ACL,i["x-cos-grant-read"]=e.GrantRead,i["x-cos-grant-write"]=e.GrantWrite,i["x-cos-grant-full-control"]=e.GrantFullControl,i["x-cos-storage-class"]=e.StorageClass,delete i["Content-Length"],delete i["content-length"];for(var o in e)o.indexOf("x-cos-meta-")>-1&&(i[o]=e[o]);var r=_e.throttleOnProgress.call(n,i["Content-Length"],e.onProgress);be.call(this,{Action:"name/cos:PostObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:i,qs:e.Query,filePath:a,onProgress:r},function(i,a){if(r(null,!0),i)return t(i);if(a&&a.headers){var o=a.headers,s=o.etag||o.Etag||o.ETag||"",c=ye({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key,isLocation:!0});return t(null,{Location:c,statusCode:a.statusCode,headers:o,ETag:s})}t(null,a)})}function Y(e,t){be.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 i=e.statusCode;return i&&204===i?t(null,{statusCode:i}):i&&404===i?t(null,{BucketNotFound:!0,statusCode:i}):t(e)}t(null,{statusCode:n.statusCode,headers:n.headers})})}function Z(e,t){be.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 i=n.AccessControlPolicy||{},a=i.Owner||{},o=i.AccessControlList&&i.AccessControlList.Grant||[];o=_e.isArray(o)?o:[o];var r=ve(i);n.headers&&n.headers["x-cos-acl"]&&(r.ACL=n.headers["x-cos-acl"]),r=_e.extend(r,{Owner:a,Grants:o,statusCode:n.statusCode,headers:n.headers}),t(null,r)})}function ee(e,t){var n=e.Headers,i="";if(e.AccessControlPolicy){var a=_e.clone(e.AccessControlPolicy||{}),o=a.Grants||a.Grant;o=_e.isArray(o)?o:[o],delete a.Grant,delete a.Grants,a.AccessControlList={Grant:o},i=_e.json2xml({AccessControlPolicy:a}),n["Content-Type"]="application/xml",n["Content-MD5"]=_e.binaryBase64(_e.md5(i))}_e.each(n,function(e,t){0===t.indexOf("x-cos-grant-")&&(n[t]=xe(n[t]))}),be.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:n,body:i},function(e,n){if(e)return t(e);t(null,{statusCode:n.statusCode,headers:n.headers})})}function te(e,t){var n=e.Headers;n.Origin=e.Origin,n["Access-Control-Request-Method"]=e.AccessControlRequestMethod,n["Access-Control-Request-Headers"]=e.AccessControlRequestHeaders,be.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 i=n.headers||{};t(null,{AccessControlAllowOrigin:i["access-control-allow-origin"],AccessControlAllowMethods:i["access-control-allow-methods"],AccessControlAllowHeaders:i["access-control-allow-headers"],AccessControlExposeHeaders:i["access-control-expose-headers"],AccessControlMaxAge:i["access-control-max-age"],statusCode:n.statusCode,headers:n.headers})})}function ne(e,t){var n=e.Headers;!n["Cache-Control"]&&n["cache-control"]&&(n["Cache-Control"]="");var i=e.CopySource||"",a=i.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^\/]+\/(.+)$/);if(!a)return void t({error:"CopySource format error"});var o=a[1],r=a[3],s=decodeURIComponent(a[4]);be.call(this,{Scope:[{action:"name/cos:GetObject",bucket:o,region:r,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 i=_e.clone(n.CopyObjectResult||{});_e.extend(i,{statusCode:n.statusCode,headers:n.headers}),t(null,i)})}function ie(e,t){var n=e.CopySource||"",i=n.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^\/]+\/(.+)$/);if(!i)return void t({error:"CopySource format error"});var a=i[1],o=i[3],r=decodeURIComponent(i[4]);be.call(this,{Scope:[{action:"name/cos:GetObject",bucket:a,region:o,prefix:r},{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 i=_e.clone(n.CopyPartResult||{});_e.extend(i,{statusCode:n.statusCode,headers:n.headers}),t(null,i)})}function ae(e,t){var n=e.Objects||[],i=e.Quiet;n=_e.isArray(n)?n:[n];var a=_e.json2xml({Delete:{Object:n,Quiet:i||!1}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=_e.binaryBase64(_e.md5(a));var r=_e.map(n,function(t){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:t.Key}});be.call(this,{Scope:r,method:"POST",Bucket:e.Bucket,Region:e.Region,body:a,action:"delete",headers:o},function(e,n){if(e)return t(e);var i=n.DeleteResult||{},a=i.Deleted||[],o=i.Error||[];a=_e.isArray(a)?a:[a],o=_e.isArray(o)?o:[o];var r=_e.clone(i);_e.extend(r,{Error:o,Deleted:a,statusCode:n.statusCode,headers:n.headers}),t(null,r)})}function oe(e,t){var n=e.Headers;if(!e.RestoreRequest)return void t({error:"missing param RestoreRequest"});var i=e.RestoreRequest||{},a=_e.json2xml({RestoreRequest:i});n["Content-Type"]="application/xml",n["Content-MD5"]=_e.binaryBase64(_e.md5(a)),be.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:a,action:"restore",headers:n},function(e,n){t(e,n)})}function re(e,t){var n=e.Tagging||{},i=n.TagSet||n.Tags||e.Tags||[];i=_e.clone(_e.isArray(i)?i:[i]);var a=_e.json2xml({Tagging:{TagSet:{Tag:i}}}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=_e.binaryBase64(_e.md5(a)),be.call(this,{Interface:"putObjectTagging",Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:a,action:"tagging",headers:o,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 se(e,t){be.call(this,{Interface:"getObjectTagging",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 i={Tags:[],statusCode:e.statusCode};e.headers&&(i.headers=e.headers),t(null,i)}else{var a=[];try{a=n.Tagging.TagSet.Tag||[]}catch(e){}a=_e.clone(_e.isArray(a)?a:[a]),t(null,{Tags:a,statusCode:n.statusCode,headers:n.headers})}})}function ce(e,t){be.call(this,{Interface:"deleteObjectTagging",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 le(e,t){var n=this,i=e.Headers;i["Cache-Control"]||i["cache-control"]||(i["Cache-Control"]=""),i["Content-Type"]||i["content-type"]||(i["Content-Type"]=Ae.getType(e.Key)||"application/octet-stream"),be.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=_e.clone(n||{}))&&n.InitiateMultipartUploadResult?t(null,_e.extend(n.InitiateMultipartUploadResult,{statusCode:n.statusCode,headers:n.headers})):void t(null,n)})}function pe(e,t){var n=this;_e.getFileSize("multipartUpload",e,function(){_e.getBodyMd5(n.options.UploadCheckContentMd5,e.Body,function(i){i&&(e.Headers["Content-MD5"]=_e.binaryBase64(i)),be.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:_e.attr(n.headers,"etag",{}),statusCode:n.statusCode,headers:n.headers})})})})}function ue(e,t){for(var n=this,i=e.UploadId,a=e.Parts,o=0,r=a.length;o-1?n.Authorization:"sign="+encodeURIComponent(n.Authorization)),n.XCosSecurityToken&&(a+="&x-cos-security-token="+n.XCosSecurityToken),n.ClientIP&&(a+="&clientIP="+n.ClientIP),n.ClientUA&&(a+="&clientUA="+n.ClientUA),n.Token&&(a+="&token="+n.Token),setTimeout(function(){t(null,{Url:a})})}});return a?i+"?"+a.Authorization+(a.XCosSecurityToken?"&x-cos-security-token="+a.XCosSecurityToken:""):i}function ve(e){var t={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},n={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},i=e&&e.AccessControlList||{},a=i.Grant;a&&(a=_e.isArray(a)?a:[a]);var o={READ:0,WRITE:0,FULL_CONTROL:0};return a&&a.length&&_e.each(a,function(i){"qcs::cam::anyone:anyone"===i.Grantee.ID||"http://cam.qcloud.com/groups/global/AllUsers"===i.Grantee.URI?o[i.Permission]=1:i.Grantee.ID!==e.Owner.ID&&t[n[i.Permission]].push('id="'+i.Grantee.ID+'"')}),o.FULL_CONTROL||o.WRITE&&o.READ?t.ACL="public-read-write":o.READ?t.ACL="public-read":t.ACL="private",_e.each(n,function(e){t[e]=xe(t[e].join(","))}),t}function xe(e){var t,n,i=e.split(","),a={};for(t=0;t-1?"{Region}.myqcloud.com":"cos.{Region}.myqcloud.com",e.ForcePathStyle||(a="{Bucket}."+a)),a=a.replace(/\{\{AppId\}\}/gi,i).replace(/\{\{Bucket\}\}/gi,n).replace(/\{\{Region\}\}/gi,o).replace(/\{\{.*?\}\}/gi,""),a=a.replace(/\{AppId\}/gi,i).replace(/\{BucketName\}/gi,n).replace(/\{Bucket\}/gi,t).replace(/\{Region\}/gi,o).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(a)||(a="https://"+a),"/"===a.slice(-1)&&(a=a.slice(0,-1));var s=a;return e.ForcePathStyle&&(s+="/"+t),s+="/",r&&(s+=_e.camSafeUrlEncode(r).replace(/%2F/g,"/")),e.isLocation&&(s=s.replace(/^https?:\/\//,"")),s}function Ce(e,t){var n=_e.clone(e.Headers);delete n["Content-Type"],delete n["Cache-Control"],_e.each(n,function(e,t){""===e&&delete n[t]});var i=function(e){var n=!1,i=e.Authorization;if(i)if(i.indexOf(" ")>-1)n=!1;else if(i.indexOf("q-sign-algorithm=")>-1&&i.indexOf("q-ak=")>-1&&i.indexOf("q-sign-time=")>-1&&i.indexOf("q-key-time=")>-1&&i.indexOf("q-url-param-list=")>-1)n=!0;else try{i=we.atob(i),i.indexOf("a=")>-1&&i.indexOf("k=")>-1&&i.indexOf("t=")>-1&&i.indexOf("r=")>-1&&i.indexOf("b=")>-1&&(n=!0)}catch(e){}n?t&&t(null,e):t&&t("authorization error")},a=this,o=e.Bucket||"",r=e.Region||"",s="name/cos:PostObject"!==e.Action&&e.Key?e.Key:"";a.options.ForcePathStyle&&o&&(s=o+"/"+s);var c="/"+s,l={},p=e.Scope;if(!p){var u=e.Action||"",d=e.ResourceKey||e.Key||"";p=e.Scope||[{action:u,bucket:o,region:r,prefix:d}]}var m=_e.md5(JSON.stringify(p));a._StsCache=a._StsCache||[],function(){var e,t;for(e=a._StsCache.length-1;e>=0;e--){t=a._StsCache[e];var n=Math.round(_e.getSkewTime(a.options.SystemClockOffset)/1e3)+30;if(t.StartTime&&n=t.ExpiredTime)a._StsCache.splice(e,1);else if(!t.ScopeLimit||t.ScopeLimit&&t.ScopeKey===m){l=t;break}}}();var f=function(){var t=l.StartTime&&l.ExpiredTime?l.StartTime+";"+l.ExpiredTime:"",o=_e.getAuth({SecretId:l.TmpSecretId,SecretKey:l.TmpSecretKey,Method:e.Method,Pathname:c,Query:e.Query,Headers:n,Expires:e.Expires,SystemClockOffset:a.options.SystemClockOffset,KeyTime:t}),r={Authorization:o,XCosSecurityToken:l.XCosSecurityToken||"",Token:l.Token||"",ClientIP:l.ClientIP||"",ClientUA:l.ClientUA||""};i(r)};if(l.ExpiredTime&&l.ExpiredTime-_e.getSkewTime(a.options.SystemClockOffset)/1e3>60)f();else if(a.options.getAuthorization)a.options.getAuthorization.call(a,{Bucket:o,Region:r,Method:e.Method,Key:s,Pathname:c,Query:e.Query,Headers:n,Scope:p,SystemClockOffset:a.options.SystemClockOffset},function(e){"string"==typeof e&&(e={Authorization:e}),e.TmpSecretId&&e.TmpSecretKey&&e.XCosSecurityToken&&e.ExpiredTime?(l=e||{},l.Scope=p,l.ScopeKey=m,a._StsCache.push(l),f()):i(e)});else{if(!a.options.getSTS)return function(){var t=_e.getAuth({SecretId:e.SecretId||a.options.SecretId,SecretKey:e.SecretKey||a.options.SecretKey,Method:e.Method,Pathname:c,Query:e.Query,Headers:n,Expires:e.Expires,SystemClockOffset:a.options.SystemClockOffset}),o={Authorization:t,XCosSecurityToken:a.options.XCosSecurityToken};return i(o),o}();a.options.getSTS.call(a,{Bucket:o,Region:r},function(e){l=e||{},l.Scope=p,l.ScopeKey=m,l.TmpSecretId=l.SecretId,l.TmpSecretKey=l.SecretKey,a._StsCache.push(l),f()})}return""}function ke(e){var t=!1,n=!1,i=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var a=e.error.Code,o=e.error.Message;("RequestTimeTooSkewed"===a||"AccessDenied"===a&&"Request has expired"===o)&&(n=!0)}catch(e){}if(e)if(n&&i){var r=Date.parse(i);this.options.CorrectClockSkew&&Math.abs(_e.getSkewTime(this.options.SystemClockOffset)-r)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=r-Date.now(),t=!0)}else 5===Math.floor(e.statusCode/100)&&(t=!0);return t}function be(e,t){var n=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=_e.clearKey(e.qs),e.headers&&(e.headers=_e.clearKey(e.headers)),e.qs&&(e.qs=_e.clearKey(e.qs));var i=_e.clone(e.qs);e.action&&(i[e.action]="");var a=function(o){var r=n.options.SystemClockOffset;Ce.call(n,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:i,Headers:e.headers,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope},function(i,s){if(i)return void t(i);e.AuthData=s,Se.call(n,e,function(i,s){i&&o<2&&(r!==n.options.SystemClockOffset||ke.call(n,i))?(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"]),a(o+1)):t(i,s)})})};a(1)}function Se(e,t){var n=this,i=e.TaskId;if(!i||n._isRunningTask(i)){var a=e.Bucket,o=e.Region,r=e.Key,s=e.method||"GET",c=e.url,l=e.body,p=e.json,u=e.rawBody;c=c||ye({ForcePathStyle:n.options.ForcePathStyle,protocol:n.options.Protocol,domain:n.options.Domain,bucket:a,region:o,object:r}),e.action&&(c=c+"?"+e.action);var d={method:s,url:c,headers:e.headers,qs:e.qs,filePath:e.filePath,body:l,json:p};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=_e.clearKey(d.headers)),d=_e.clearKey(d),e.onProgress&&"function"==typeof e.onProgress&&(d.onProgress=function(t){if(!i||n._isRunningTask(i)){var a=t?t.loaded:0;e.onProgress({loaded:a,total:t.total})}}),this.options.Timeout&&(d.timeout=this.options.Timeout),n.options.ForcePathStyle&&(d.pathStyle=n.options.ForcePathStyle),n.emit("before-send",d);var m=Re(d,function(e,a,o){if("abort"!==e){var r,s=function(e,o){if(i&&n.off("inner-kill-task",f),!r){r=!0;var s={};a&&a.statusCode&&(s.statusCode=a.statusCode),a&&a.headers&&(s.headers=a.headers),e?(e=_e.extend(e||{},s),t(e,null)):(o=_e.extend(o||{},s),t(null,o)),m=null}};if(e)return void s({error:e});var c;if(u)c={},c.body=o;else try{c=o&&o.indexOf("<")>-1&&o.indexOf(">")>-1&&_e.xml2json(o)||{}}catch(e){c=o||{}}var l=a.statusCode;return 2===Math.floor(l/100)?c.Error?void s({error:c.Error}):void s(null,c):void s({error:c.Error||c})}}),f=function(e){e.TaskId===i&&(m&&m.abort&&m.abort(),n.off("inner-kill-task",f))};i&&n.on("inner-kill-task",f)}}var Re=n(18),we=n(3),_e=n(0),Ae=n(19),Te={getService:i,putBucket:a,headBucket:o,getBucket:r,deleteBucket:s,putBucketAcl:c,getBucketAcl:l,putBucketCors:p,getBucketCors:u,deleteBucketCors:d,getBucketLocation:m,getBucketPolicy:h,putBucketPolicy:f,deleteBucketPolicy:g,putBucketTagging:v,getBucketTagging:x,deleteBucketTagging:y,putBucketLifecycle:C,getBucketLifecycle:k,deleteBucketLifecycle:b,putBucketVersioning:S,getBucketVersioning:R,putBucketReplication:w,getBucketReplication:_,deleteBucketReplication:A,putBucketWebsite:T,getBucketWebsite:E,deleteBucketWebsite:B,putBucketReferer:O,getBucketReferer:D,putBucketDomain:N,getBucketDomain:I,deleteBucketDomain:P,putBucketOrigin:j,getBucketOrigin:M,deleteBucketOrigin:U,putBucketLogging:F,getBucketLogging:H,putBucketInventory:L,getBucketInventory:z,listBucketInventory:K,deleteBucketInventory:q,putBucketAccelerate:G,getBucketAccelerate:V,getObject:$,headObject:X,listObjectVersions:W,putObject:Q,postObject:J,deleteObject:Y,getObjectAcl:Z,putObjectAcl:ee,optionsObject:te,putObjectCopy:ne,deleteMultipleObject:ae,restoreObject:oe,putObjectTagging:re,getObjectTagging:se,deleteObjectTagging:ce,uploadPartCopy:ie,multipartInit:le,multipartUpload:pe,multipartComplete:ue,multipartList:de,multipartListPart:me,multipartAbort:fe,getObjectUrl:ge,getAuth:he};e.exports.init=function(e,t){t.transferToTaskMethod(Te,"postObject"),t.transferToTaskMethod(Te,"putObject"),_e.each(Te,function(t,n){e.prototype[n]=_e.apiWrapper(n,t)})}},function(e,t){var n=function(e){var t,n,i,a=[],o=Object.keys(e);for(t=0;t-1||m.indexOf(f)>-1)&&(d[f]=e.headers[f]);o["x-cos-acl"]&&(d.acl=o["x-cos-acl"]),!d["Content-Type"]&&(d["Content-Type"]=""),i=wx.uploadFile({url:r,method:s,name:"file",header:o,filePath:a,formData:d,timeout:e.timeout,success:function(e){l(null,e)},fail:function(e){l(e.errMsg,e)}}),i.onProgressUpdate(function(e){c&&c({loaded:e.totalBytesSent,total:e.totalBytesExpectedToSend,progress:e.progress/100})})}else{var h=e.qs&&n(e.qs)||"";h&&(r+=(r.indexOf("?")>-1?"&":"?")+h),o["Content-Length"]&&delete o["Content-Length"],i=wx.request({url:r,method:s,header:o,dataType:"text",data:e.body,timeout:e.timeout,success:function(e){l(null,e)},fail:function(e){l(e.errMsg,e)}})}return i};e.exports=i},function(e,t,n){"use strict";var i=n(20);e.exports=new i(n(21),n(22))},function(e,t,n){"use strict";function i(){this._types=Object.create(null),this._extensions=Object.create(null);for(var e=0;em)return t(null,!1);if(n>1){if(Math.max(e[0].Size,e[1].Size)!==d)return t(null,!1)}var i=function(a){if(a=c.length)return void S.emit("has_and_check_upload_id",t);var o=c[e];return x.isInArray(t,o)?h.using[o]?void p(e+1):void r.call(l,{Bucket:i,Region:a,Key:s,UploadId:o},function(t,i){l._isRunningTask(n)&&(t?(h.removeUploadId(o),p(e+1)):S.emit("upload_id_available",{UploadId:o,PartList:i.PartList}))}):(h.removeUploadId(o),void p(e+1))};p(0)}),S.on("get_remote_upload_id_list",function(){o.call(l,{Bucket:i,Region:a,Key:s},function(t,a){if(l._isRunningTask(n)){if(t)return S.emit("error",t);var o=x.filter(a.UploadList,function(e){return e.Key===s&&(!c||e.StorageClass.toUpperCase()===c.toUpperCase())}).reverse().map(function(e){return e.UploadId||e.UploadID});if(o.length)S.emit("seek_local_avail_upload_id",o);else{var r,p=h.getFileId(e.FileStat,e.ChunkSize,i,s);p&&(r=h.getUploadIdList(p))&&x.each(r,function(e){h.removeUploadId(e)}),S.emit("no_available_upload_id")}}})}),S.emit("get_remote_upload_id_list")}function o(e,t){var n=this,i=[],a={Bucket:e.Bucket,Region:e.Region,Prefix:e.Key},o=function(){n.multipartList(a,function(e,n){if(e)return t(e);i.push.apply(i,n.Upload||[]),"true"===n.IsTruncated?(a.KeyMarker=n.NextKeyMarker,a.UploadIdMarker=n.NextUploadIdMarker,o()):t(null,{UploadList:i})})};o()}function r(e,t){var n=this,i=[],a={Bucket:e.Bucket,Region:e.Region,Key:e.Key,UploadId:e.UploadId},o=function(){n.multipartListPart(a,function(e,n){if(e)return t(e);i.push.apply(i,n.Part||[]),"true"===n.IsTruncated?(a.PartNumberMarker=n.NextPartNumberMarker,o()):t(null,{PartList:i})})};o()}function s(e,t){var n=this,i=e.TaskId,a=e.Bucket,o=e.Region,r=e.Key,s=e.UploadData,l=e.FileSize,p=e.SliceSize,u=Math.min(e.AsyncLimit||n.options.ChunkParallelLimit||1,256),d=e.FilePath,m=Math.ceil(l/p),f=0,h=e.ServerSideEncryption,v=x.filter(s.PartList,function(e){return e.Uploaded&&(f+=e.PartNumber>=m?l%p||p:p),!e.Uploaded}),y=e.onProgress;g.eachLimit(v,u,function(e,t){if(n._isRunningTask(i)){var u=e.PartNumber,m=Math.min(l,e.PartNumber*p)-(e.PartNumber-1)*p,g=0;c.call(n,{TaskId:i,Bucket:a,Region:o,Key:r,SliceSize:p,FileSize:l,PartNumber:u,ServerSideEncryption:h,FilePath:d,UploadData:s,onProgress:function(e){f+=e.loaded-g,g=e.loaded,y({loaded:f,total:l})}},function(a,o){n._isRunningTask(i)&&(a?f-=g:(f+=m-g,e.ETag=o.ETag),y({loaded:f,total:l}),t(a||null,o))})}},function(e){if(n._isRunningTask(i))return e?t(e):void t(null,{UploadId:s.UploadId,SliceList:s.PartList})})}function c(e,t){var n=this,i=e.TaskId,a=e.Bucket,o=e.Region,r=e.Key,s=e.FileSize,c=e.FilePath,l=1*e.PartNumber,p=e.SliceSize,u=e.ServerSideEncryption,d=e.UploadData,m=n.options.ChunkRetryTimes+1,f=p*(l-1),h=p,v=f+p;v>s&&(v=s,h=v-f),x.fileSlice(c,f,v,function(s){var c=x.getFileMd5(s),p=c?x.binaryBase64(c):null,f=d.PartList[l-1];g.retry(m,function(t){n._isRunningTask(i)&&n.multipartUpload({TaskId:i,Bucket:a,Region:o,Key:r,ContentLength:h,PartNumber:l,UploadId:d.UploadId,ServerSideEncryption:u,Body:s,onProgress:e.onProgress,ContentMD5:p},function(e,a){if(n._isRunningTask(i))return e?t(e):(f.Uploaded=!0,t(null,a))})},function(e,a){if(n._isRunningTask(i))return t(e,a)})})}function l(e,t){var n=e.Bucket,i=e.Region,a=e.Key,o=e.UploadId,r=e.SliceList,s=this,c=this.options.ChunkRetryTimes+1,l=r.map(function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}});g.retry(c,function(e){s.multipartComplete({Bucket:n,Region:i,Key:a,UploadId:o,Parts:l},e)},function(e,n){t(e,n)})}function p(e,t){var n=e.Bucket,i=e.Region,a=e.Key,r=e.UploadId,s=e.Level||"task",c=e.AsyncLimit,l=this,p=new v;if(p.on("error",function(e){return t(e)}),p.on("get_abort_array",function(o){u.call(l,{Bucket:n,Region:i,Key:a,Headers:e.Headers,AsyncLimit:c,AbortArray:o},function(e,n){if(e)return t(e);t(null,n)})}),"bucket"===s)o.call(l,{Bucket:n,Region:i},function(e,n){if(e)return t(e);p.emit("get_abort_array",n.UploadList||[])});else if("file"===s){if(!a)return t({error:"abort_upload_task_no_key"});o.call(l,{Bucket:n,Region:i,Key:a},function(e,n){if(e)return t(e);p.emit("get_abort_array",n.UploadList||[])})}else{if("task"!==s)return t({error:"abort_unknown_level"});if(!r)return t({error:"abort_upload_task_no_id"});if(!a)return t({error:"abort_upload_task_no_key"});p.emit("get_abort_array",[{Key:a,UploadId:r}])}}function u(e,t){var n=e.Bucket,i=e.Region,a=e.Key,o=e.AbortArray,r=e.AsyncLimit||1,s=this,c=0,l=new Array(o.length);g.eachLimit(o,r,function(t,o){var r=c;if(a&&a!==t.Key)return l[r]={error:{KeyNotMatch:!0}},void o(null);var p=t.UploadId||t.UploadID;s.multipartAbort({Bucket:n,Region:i,Key:t.Key,Headers:e.Headers,UploadId:p},function(e){var a={Bucket:n,Region:i,Key:t.Key,UploadId:p};l[r]={error:e,task:a},o(null)}),c++},function(e){if(e)return t(e);for(var n=[],i=[],a=0,o=l.length;ai?"sliceUploadFile":"postObject";u.push({api:h,params:e,callback:f})}),n._addTasks(u)}function m(e,t){var n=new v,i=this,a=e.Bucket,o=e.Region,r=e.Key,s=e.CopySource,c=s.match(/^([^.]+-\d+)\.cos(v6)?\.([^.]+)\.[^\/]+\/(.+)$/);if(!c)return void t({error:"CopySource format error"});var l=c[1],p=c[3],u=decodeURIComponent(c[4]),d=void 0===e.CopySliceSize?i.options.CopySliceSize:e.CopySliceSize;d=Math.max(0,d);var m,h,y=e.CopyChunkSize||this.options.CopyChunkSize,C=this.options.CopyChunkParallelLimit,k=0;n.on("copy_slice_complete",function(e){i.multipartComplete({Bucket:a,Region:o,Key:r,UploadId:e.UploadId,Parts:e.PartList},function(e,n){if(e)return h(null,!0),t(e);h({loaded:m,total:m},!0),t(null,n)})}),n.on("get_copy_data_finish",function(e){g.eachLimit(e.PartList,C,function(t,n){var c=t.PartNumber,l=t.CopySourceRange,p=t.end-t.start,u=0;f.call(i,{Bucket:a,Region:o,Key:r,CopySource:s,UploadId:e.UploadId,PartNumber:c,CopySourceRange:l,onProgress:function(e){k+=e.loaded-u,u=e.loaded,h({loaded:k,total:m})}},function(e,i){if(e)return n(e);h({loaded:k,total:m}),k+=p-u,t.ETag=i.ETag,n(e||null,i)})},function(i){if(i)return h(null,!0),t(i);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,a=0;a"x-cos-meta-".length&&(s[t]=e)}),n.emit("get_file_size_finish",s)}})}function f(e,t){var n=e.TaskId,i=e.Bucket,a=e.Region,o=e.Key,r=e.CopySource,s=e.UploadId,c=1*e.PartNumber,l=e.CopySourceRange,p=this.options.ChunkRetryTimes+1,u=this;g.retry(p,function(t){u.uploadPartCopy({TaskId:n,Bucket:i,Region:a,Key:o,CopySource:r,UploadId:s,PartNumber:c,CopySourceRange:l,onProgress:e.onProgress},function(e,n){t(e||null,n)})},function(e,n){return t(e,n)})}var h=n(5),g=n(24),v=n(4).EventProxy,x=n(0),y={sliceUploadFile:i,abortUploadTask:p,uploadFiles:d,sliceCopyFile:m};e.exports.init=function(e,t){t.transferToTaskMethod(y,"sliceUploadFile"),x.each(y,function(t,n){e.prototype[n]=x.apiWrapper(n,t)})}},function(e,t){var n=function(e,t,n,i){if(i=i||function(){},!e.length||t<=0)return i();var a=0,o=0,r=0;!function s(){if(a>=e.length)return i();for(;r=e.length?i():s())})}()},i=function(e,t,n){var i=function(a){t(function(t,o){t&&a