(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5a92dea8"],{"40b3":function(e,t,r){(function(t,r){e.exports=r()})(0,(function(){return function(e){var t={};function r(o){if(t[o])return t[o].exports;var n=t[o]={i:o,l:!1,exports:{}};return e[o].call(n.exports,n,n.exports,r),n.l=!0,n.exports}return r.m=e,r.c=t,r.d=function(e,t,o){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},r.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)r.d(o,n,function(t){return e[t]}.bind(null,n));return o},r.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="/dist/",r(r.s="./index.js")}({"./index.js":
/*!******************!*\
  !*** ./index.js ***!
  \******************/
/*! no static exports found */function(e,t,r){var o=r(/*! ./src/cos */"./src/cos.js");e.exports=o},"./lib/base64.js":
/*!***********************!*\
  !*** ./lib/base64.js ***!
  \***********************/
/*! no static exports found */function(e,t){var r=function(e){e=e||{};var t,r=e.Base64,o="2.1.9",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=function(e){for(var t={},r=0,o=e.length;r<o;r++)t[e.charAt(r)]=r;return t}(n),s=String.fromCharCode,a=function(e){if(e.length<2){var t=e.charCodeAt(0);return t<128?e:t<2048?s(192|t>>>6)+s(128|63&t):s(224|t>>>12&15)+s(128|t>>>6&63)+s(128|63&t)}t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return s(240|t>>>18&7)+s(128|t>>>12&63)+s(128|t>>>6&63)+s(128|63&t)},c=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,u=function(e){return e.replace(c,a)},l=function(e){var t=[0,2,1][e.length%3],r=e.charCodeAt(0)<<16|(e.length>1?e.charCodeAt(1):0)<<8|(e.length>2?e.charCodeAt(2):0),o=[n.charAt(r>>>18),n.charAt(r>>>12&63),t>=2?"=":n.charAt(r>>>6&63),t>=1?"=":n.charAt(63&r)];return o.join("")},d=e.btoa?function(t){return e.btoa(t)}:function(e){return e.replace(/[\s\S]{1,3}/g,l)},p=t?function(e){return(e.constructor===t.constructor?e:new t(e)).toString("base64")}:function(e){return d(u(e))},h=function(e,t){return t?p(String(e)).replace(/[+\/]/g,(function(e){return"+"==e?"-":"_"})).replace(/=/g,""):p(String(e))},f=function(e){return h(e,!0)},g=new RegExp(["[À-ß][-¿]","[à-ï][-¿]{2}","[ð-÷][-¿]{3}"].join("|"),"g"),m=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),r=t-65536;return s(55296+(r>>>10))+s(56320+(1023&r));case 3:return s((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return s((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},y=function(e){return e.replace(g,m)},v=function(e){var t=e.length,r=t%4,o=(t>0?i[e.charAt(0)]<<18:0)|(t>1?i[e.charAt(1)]<<12:0)|(t>2?i[e.charAt(2)]<<6:0)|(t>3?i[e.charAt(3)]:0),n=[s(o>>>16),s(o>>>8&255),s(255&o)];return n.length-=[0,0,2,1][r],n.join("")},C=e.atob?function(t){return e.atob(t)}:function(e){return e.replace(/[\s\S]{1,4}/g,v)},k=t?function(e){return(e.constructor===t.constructor?e:new t(e,"base64")).toString()}:function(e){return y(C(e))},b=function(e){return k(String(e).replace(/[-_]/g,(function(e){return"-"==e?"+":"/"})).replace(/[^A-Za-z0-9\+\/]/g,""))},x=function(){var t=e.Base64;return e.Base64=r,t},S={VERSION:o,atob:C,btoa:d,fromBase64:b,toBase64:h,utob:u,encode:h,encodeURI:f,btou:y,decode:b,noConflict:x};return S}();e.exports=r},"./lib/crypto.js":
/*!***********************!*\
  !*** ./lib/crypto.js ***!
  \***********************/
/*! no static exports found */function(e,t,r){(function(e){var t=r(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js"),o=o||function(e,t){var r={},o=r.lib={},n=function(){},i=o.Base={extend:function(e){n.prototype=this;var t=new n;return e&&t.mixIn(e),t.hasOwnProperty("init")||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},s=o.WordArray=i.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,r=e.words,o=this.sigBytes;if(e=e.sigBytes,this.clamp(),o%4)for(var n=0;n<e;n++)t[o+n>>>2]|=(r[n>>>2]>>>24-n%4*8&255)<<24-(o+n)%4*8;else if(65535<r.length)for(n=0;n<e;n+=4)t[o+n>>>2]=r[n>>>2];else t.push.apply(t,r);return this.sigBytes+=e,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=i.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r=[],o=0;o<t;o+=4)r.push(4294967296*e.random()|0);return new s.init(r,t)}}),a=r.enc={},c=a.Hex={stringify:function(e){var t=e.words;e=e.sigBytes;for(var r=[],o=0;o<e;o++){var n=t[o>>>2]>>>24-o%4*8&255;r.push((n>>>4).toString(16)),r.push((15&n).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,r=[],o=0;o<t;o+=2)r[o>>>3]|=parseInt(e.substr(o,2),16)<<24-o%8*4;return new s.init(r,t/2)}},u=a.Latin1={stringify:function(e){var t=e.words;e=e.sigBytes;for(var r=[],o=0;o<e;o++)r.push(String.fromCharCode(t[o>>>2]>>>24-o%4*8&255));return r.join("")},parse:function(e){for(var t=e.length,r=[],o=0;o<t;o++)r[o>>>2]|=(255&e.charCodeAt(o))<<24-o%4*8;return new s.init(r,t)}},l=a.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(t){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 s.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 r=this._data,o=r.words,n=r.sigBytes,i=this.blockSize,a=n/(4*i);a=t?e.ceil(a):e.max((0|a)-this._minBufferSize,0);if(t=a*i,n=e.min(4*t,n),t){for(var c=0;c<t;c+=i)this._doProcessBlock(o,c);c=o.splice(0,t),r.sigBytes-=n}return new s.init(c,n)},clone:function(){var e=i.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=d.extend({cfg:i.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new p.HMAC.init(e,r).finalize(t)}}});var p=r.algo={};return r}(Math);(function(){var e=o,t=e.lib,r=t.WordArray,n=t.Hasher,i=[];t=e.algo.SHA1=n.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,o=r[0],n=r[1],s=r[2],a=r[3],c=r[4],u=0;80>u;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+(n&s|~n&a)):40>u?l+(1859775393+(n^s^a)):60>u?l+((n&s|n&a|s&a)-1894007588):l+((n^s^a)-899497514),c=a,a=s,s=n<<30|n>>>2,n=o,o=l}r[0]=r[0]+o|0,r[1]=r[1]+n|0,r[2]=r[2]+s|0,r[3]=r[3]+a|0,r[4]=r[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,o=8*e.sigBytes;return t[o>>>5]|=128<<24-o%32,t[14+(o+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(o+64>>>9<<4)]=r,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e}});e.SHA1=n._createHelper(t),e.HmacSHA1=n._createHmacHelper(t)})(),function(){var e=o,t=e.enc.Utf8;e.algo.HMAC=e.lib.Base.extend({init:function(e,r){e=this._hasher=new e.init,"string"==typeof r&&(r=t.parse(r));var o=e.blockSize,n=4*o;r.sigBytes>n&&(r=e.finalize(r)),r.clamp();for(var i=this._oKey=r.clone(),s=this._iKey=r.clone(),a=i.words,c=s.words,u=0;u<o;u++)a[u]^=1549556828,c[u]^=909522486;i.sigBytes=s.sigBytes=n,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher;return e=t.finalize(e),t.reset(),t.finalize(this._oKey.clone().concat(e))}})}(),function(){var e=o,t=e.lib,r=t.WordArray,n=e.enc;n.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,o=this._map;e.clamp();for(var n=[],i=0;i<r;i+=3)for(var s=t[i>>>2]>>>24-i%4*8&255,a=t[i+1>>>2]>>>24-(i+1)%4*8&255,c=t[i+2>>>2]>>>24-(i+2)%4*8&255,u=s<<16|a<<8|c,l=0;l<4&&i+.75*l<r;l++)n.push(o.charAt(u>>>6*(3-l)&63));var d=o.charAt(64);if(d)while(n.length%4)n.push(d);return n.join("")},parse:function(e){var t=e.length,o=this._map,n=o.charAt(64);if(n){var i=e.indexOf(n);-1!=i&&(t=i)}for(var s=[],a=0,c=0;c<t;c++)if(c%4){var u=o.indexOf(e.charAt(c-1))<<c%4*2,l=o.indexOf(e.charAt(c))>>>6-c%4*2;s[a>>>2]|=(u|l)<<24-a%4*8,a++}return r.create(s,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),"object"===t(e)?e.exports=o:window.CryptoJS=o}).call(this,r(/*! ./../node_modules/webpack/buildin/module.js */"./node_modules/webpack/buildin/module.js")(e))},"./lib/md5.js":
/*!********************!*\
  !*** ./lib/md5.js ***!
  \********************/
/*! no static exports found */function(e,t,r){(function(e){var t,o=r(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js");(function(){"use strict";var n="object"===("undefined"===typeof window?"undefined":o(window)),i=n?window:{};i.JS_MD5_NO_WINDOW&&(n=!1);var s=!n&&"object"===("undefined"===typeof self?"undefined":o(self));s&&(i=self);var a,c=!i.JS_MD5_NO_COMMON_JS&&"object"===o(e)&&e.exports,u=r(/*! !webpack amd options */"./node_modules/webpack/buildin/amd-options.js"),l=!i.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,d="0123456789abcdef".split(""),p=[128,32768,8388608,-2147483648],h=[0,8,16,24],f=["hex","array","digest","buffer","arrayBuffer","base64"],g="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),m=[];if(l){var y=new ArrayBuffer(68);a=new Uint8Array(y),m=new Uint32Array(y)}!i.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!l||!i.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===o(e)&&e.buffer&&e.buffer.constructor===ArrayBuffer});var v=function(e){return function(t,r){return new k(!0).update(t,r)[e]()}},C=function(){var e=v("hex");e.getCtx=e.create=function(){return new k},e.update=function(t){return e.create().update(t)};for(var t=0;t<f.length;++t){var r=f[t];e[r]=v(r)}return e};function k(e){if(e)m[0]=m[16]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=0,this.blocks=m,this.buffer8=a;else if(l){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}k.prototype.update=function(e,t){if(!this.finalized){var r,o,n=0,i=e.length,s=this.blocks,a=this.buffer8;while(n<i){if(this.hashed&&(this.hashed=!1,s[0]=s[16],s[16]=s[1]=s[2]=s[3]=s[4]=s[5]=s[6]=s[7]=s[8]=s[9]=s[10]=s[11]=s[12]=s[13]=s[14]=s[15]=0),l)for(o=this.start;n<i&&o<64;++n)r=e.charCodeAt(n),t||r<128?a[o++]=r:r<2048?(a[o++]=192|r>>6,a[o++]=128|63&r):r<55296||r>=57344?(a[o++]=224|r>>12,a[o++]=128|r>>6&63,a[o++]=128|63&r):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++n)),a[o++]=240|r>>18,a[o++]=128|r>>12&63,a[o++]=128|r>>6&63,a[o++]=128|63&r);else for(o=this.start;n<i&&o<64;++n)r=e.charCodeAt(n),t||r<128?s[o>>2]|=r<<h[3&o++]:r<2048?(s[o>>2]|=(192|r>>6)<<h[3&o++],s[o>>2]|=(128|63&r)<<h[3&o++]):r<55296||r>=57344?(s[o>>2]|=(224|r>>12)<<h[3&o++],s[o>>2]|=(128|r>>6&63)<<h[3&o++],s[o>>2]|=(128|63&r)<<h[3&o++]):(r=65536+((1023&r)<<10|1023&e.charCodeAt(++n)),s[o>>2]|=(240|r>>18)<<h[3&o++],s[o>>2]|=(128|r>>12&63)<<h[3&o++],s[o>>2]|=(128|r>>6&63)<<h[3&o++],s[o>>2]|=(128|63&r)<<h[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},k.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=p[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()}},k.prototype.hash=function(){var e,t,r,o,n,i,s=this.blocks;this.first?(e=s[0]-680876937,e=(e<<7|e>>>25)-271733879<<0,o=(-1732584194^2004318071&e)+s[1]-117830708,o=(o<<12|o>>>20)+e<<0,r=(-271733879^o&(-271733879^e))+s[2]-1126478375,r=(r<<17|r>>>15)+o<<0,t=(e^r&(o^e))+s[3]-1316259209,t=(t<<22|t>>>10)+r<<0):(e=this.h0,t=this.h1,r=this.h2,o=this.h3,e+=(o^t&(r^o))+s[0]-680876936,e=(e<<7|e>>>25)+t<<0,o+=(r^e&(t^r))+s[1]-389564586,o=(o<<12|o>>>20)+e<<0,r+=(t^o&(e^t))+s[2]+606105819,r=(r<<17|r>>>15)+o<<0,t+=(e^r&(o^e))+s[3]-1044525330,t=(t<<22|t>>>10)+r<<0),e+=(o^t&(r^o))+s[4]-176418897,e=(e<<7|e>>>25)+t<<0,o+=(r^e&(t^r))+s[5]+1200080426,o=(o<<12|o>>>20)+e<<0,r+=(t^o&(e^t))+s[6]-1473231341,r=(r<<17|r>>>15)+o<<0,t+=(e^r&(o^e))+s[7]-45705983,t=(t<<22|t>>>10)+r<<0,e+=(o^t&(r^o))+s[8]+1770035416,e=(e<<7|e>>>25)+t<<0,o+=(r^e&(t^r))+s[9]-1958414417,o=(o<<12|o>>>20)+e<<0,r+=(t^o&(e^t))+s[10]-42063,r=(r<<17|r>>>15)+o<<0,t+=(e^r&(o^e))+s[11]-1990404162,t=(t<<22|t>>>10)+r<<0,e+=(o^t&(r^o))+s[12]+1804603682,e=(e<<7|e>>>25)+t<<0,o+=(r^e&(t^r))+s[13]-40341101,o=(o<<12|o>>>20)+e<<0,r+=(t^o&(e^t))+s[14]-1502002290,r=(r<<17|r>>>15)+o<<0,t+=(e^r&(o^e))+s[15]+1236535329,t=(t<<22|t>>>10)+r<<0,e+=(r^o&(t^r))+s[1]-165796510,e=(e<<5|e>>>27)+t<<0,o+=(t^r&(e^t))+s[6]-1069501632,o=(o<<9|o>>>23)+e<<0,r+=(e^t&(o^e))+s[11]+643717713,r=(r<<14|r>>>18)+o<<0,t+=(o^e&(r^o))+s[0]-373897302,t=(t<<20|t>>>12)+r<<0,e+=(r^o&(t^r))+s[5]-701558691,e=(e<<5|e>>>27)+t<<0,o+=(t^r&(e^t))+s[10]+38016083,o=(o<<9|o>>>23)+e<<0,r+=(e^t&(o^e))+s[15]-660478335,r=(r<<14|r>>>18)+o<<0,t+=(o^e&(r^o))+s[4]-405537848,t=(t<<20|t>>>12)+r<<0,e+=(r^o&(t^r))+s[9]+568446438,e=(e<<5|e>>>27)+t<<0,o+=(t^r&(e^t))+s[14]-1019803690,o=(o<<9|o>>>23)+e<<0,r+=(e^t&(o^e))+s[3]-187363961,r=(r<<14|r>>>18)+o<<0,t+=(o^e&(r^o))+s[8]+1163531501,t=(t<<20|t>>>12)+r<<0,e+=(r^o&(t^r))+s[13]-1444681467,e=(e<<5|e>>>27)+t<<0,o+=(t^r&(e^t))+s[2]-51403784,o=(o<<9|o>>>23)+e<<0,r+=(e^t&(o^e))+s[7]+1735328473,r=(r<<14|r>>>18)+o<<0,t+=(o^e&(r^o))+s[12]-1926607734,t=(t<<20|t>>>12)+r<<0,n=t^r,e+=(n^o)+s[5]-378558,e=(e<<4|e>>>28)+t<<0,o+=(n^e)+s[8]-2022574463,o=(o<<11|o>>>21)+e<<0,i=o^e,r+=(i^t)+s[11]+1839030562,r=(r<<16|r>>>16)+o<<0,t+=(i^r)+s[14]-35309556,t=(t<<23|t>>>9)+r<<0,n=t^r,e+=(n^o)+s[1]-1530992060,e=(e<<4|e>>>28)+t<<0,o+=(n^e)+s[4]+1272893353,o=(o<<11|o>>>21)+e<<0,i=o^e,r+=(i^t)+s[7]-155497632,r=(r<<16|r>>>16)+o<<0,t+=(i^r)+s[10]-1094730640,t=(t<<23|t>>>9)+r<<0,n=t^r,e+=(n^o)+s[13]+681279174,e=(e<<4|e>>>28)+t<<0,o+=(n^e)+s[0]-358537222,o=(o<<11|o>>>21)+e<<0,i=o^e,r+=(i^t)+s[3]-722521979,r=(r<<16|r>>>16)+o<<0,t+=(i^r)+s[6]+76029189,t=(t<<23|t>>>9)+r<<0,n=t^r,e+=(n^o)+s[9]-640364487,e=(e<<4|e>>>28)+t<<0,o+=(n^e)+s[12]-421815835,o=(o<<11|o>>>21)+e<<0,i=o^e,r+=(i^t)+s[15]+530742520,r=(r<<16|r>>>16)+o<<0,t+=(i^r)+s[2]-995338651,t=(t<<23|t>>>9)+r<<0,e+=(r^(t|~o))+s[0]-198630844,e=(e<<6|e>>>26)+t<<0,o+=(t^(e|~r))+s[7]+1126891415,o=(o<<10|o>>>22)+e<<0,r+=(e^(o|~t))+s[14]-1416354905,r=(r<<15|r>>>17)+o<<0,t+=(o^(r|~e))+s[5]-57434055,t=(t<<21|t>>>11)+r<<0,e+=(r^(t|~o))+s[12]+1700485571,e=(e<<6|e>>>26)+t<<0,o+=(t^(e|~r))+s[3]-1894986606,o=(o<<10|o>>>22)+e<<0,r+=(e^(o|~t))+s[10]-1051523,r=(r<<15|r>>>17)+o<<0,t+=(o^(r|~e))+s[1]-2054922799,t=(t<<21|t>>>11)+r<<0,e+=(r^(t|~o))+s[8]+1873313359,e=(e<<6|e>>>26)+t<<0,o+=(t^(e|~r))+s[15]-30611744,o=(o<<10|o>>>22)+e<<0,r+=(e^(o|~t))+s[6]-1560198380,r=(r<<15|r>>>17)+o<<0,t+=(o^(r|~e))+s[13]+1309151649,t=(t<<21|t>>>11)+r<<0,e+=(r^(t|~o))+s[4]-145523070,e=(e<<6|e>>>26)+t<<0,o+=(t^(e|~r))+s[11]-1120210379,o=(o<<10|o>>>22)+e<<0,r+=(e^(o|~t))+s[2]+718787259,r=(r<<15|r>>>17)+o<<0,t+=(o^(r|~e))+s[9]-343485551,t=(t<<21|t>>>11)+r<<0,this.first?(this.h0=e+1732584193<<0,this.h1=t-271733879<<0,this.h2=r-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+r<<0,this.h3=this.h3+o<<0)},k.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,o=this.h3;return d[e>>4&15]+d[15&e]+d[e>>12&15]+d[e>>8&15]+d[e>>20&15]+d[e>>16&15]+d[e>>28&15]+d[e>>24&15]+d[t>>4&15]+d[15&t]+d[t>>12&15]+d[t>>8&15]+d[t>>20&15]+d[t>>16&15]+d[t>>28&15]+d[t>>24&15]+d[r>>4&15]+d[15&r]+d[r>>12&15]+d[r>>8&15]+d[r>>20&15]+d[r>>16&15]+d[r>>28&15]+d[r>>24&15]+d[o>>4&15]+d[15&o]+d[o>>12&15]+d[o>>8&15]+d[o>>20&15]+d[o>>16&15]+d[o>>28&15]+d[o>>24&15]},k.prototype.toString=k.prototype.hex,k.prototype.digest=function(e){if("hex"===e)return this.hex();this.finalize();var t=this.h0,r=this.h1,o=this.h2,n=this.h3,i=[255&t,t>>8&255,t>>16&255,t>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255,255&o,o>>8&255,o>>16&255,o>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255];return i},k.prototype.array=k.prototype.digest,k.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},k.prototype.buffer=k.prototype.arrayBuffer,k.prototype.base64=function(){for(var e,t,r,o="",n=this.array(),i=0;i<15;)e=n[i++],t=n[i++],r=n[i++],o+=g[e>>>2]+g[63&(e<<4|t>>>4)]+g[63&(t<<2|r>>>6)]+g[63&r];return e=n[i],o+=g[e>>>2]+g[e<<4&63]+"==",o};var b=C();c?e.exports=b:(i.md5=b,u&&(t=function(){return b}.call(b,r,b,e),void 0===t||(e.exports=t)))})()}).call(this,r(/*! ./../node_modules/webpack/buildin/module.js */"./node_modules/webpack/buildin/module.js")(e))},"./lib/request.js":
/*!************************!*\
  !*** ./lib/request.js ***!
  \************************/
/*! no static exports found */function(e,t,r){var o=r(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js"),n=function(e){switch(o(e)){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}},i=function(e,t,r,i){return t=t||"&",r=r||"=",null===e&&(e=void 0),"object"===o(e)?Object.keys(e).map((function(o){var i=encodeURIComponent(n(o))+r;return Array.isArray(e[o])?e[o].map((function(e){return i+encodeURIComponent(n(e))})).join(t):i+encodeURIComponent(n(e[o]))})).filter(Boolean).join(t):i?encodeURIComponent(n(i))+r+encodeURIComponent(n(e)):""},s=function(e,t,r){var o={},n=t.getAllResponseHeaders();return n&&n.length>0&&n.trim().split("\n").forEach((function(e){if(e){var t=e.indexOf(":"),r=e.substr(0,t).trim().toLowerCase(),n=e.substr(t+1).trim();o[r]=n}})),{error:e,statusCode:t.status,statusMessage:t.statusText,headers:o,body:r}},a=function(e,t){return t||"text"!==t?e.response:e.responseText},c=function(e,t){var r=(e.method||"GET").toUpperCase(),o=e.url;if(e.qs){var n=i(e.qs);n&&(o+=(-1===o.indexOf("?")?"?":"&")+n)}var c=new XMLHttpRequest;if(c.open(r,o,!0),c.responseType=e.dataType||"text",e.xhrFields)for(var u in e.xhrFields)c[u]=e.xhrFields[u];var l=e.headers;if(l)for(var d in l)l.hasOwnProperty(d)&&"content-length"!==d.toLowerCase()&&"user-agent"!==d.toLowerCase()&&"origin"!==d.toLowerCase()&&"host"!==d.toLowerCase()&&c.setRequestHeader(d,l[d]);return e.onProgress&&c.upload&&(c.upload.onprogress=e.onProgress),e.onDownloadProgress&&(c.onprogress=e.onDownloadProgress),e.timeout&&(c.timeout=e.timeout),c.ontimeout=function(e){var r=new Error("timeout");t(s(r,c))},c.onload=function(){t(s(null,c,a(c,e.dataType)))},c.onerror=function(r){var o=a(c,e.dataType);if(o)t(s(null,c,o));else{var n=c.statusText;n||0!==c.status||(n=new Error("CORS blocked or network error")),t(s(n,c,o))}},c.send(e.body||""),c};e.exports=c},"./node_modules/@babel/runtime/helpers/classCallCheck.js":
/*!***************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***!
  \***************************************************************/
/*! no static exports found */function(e,t){function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}e.exports=r,e.exports.__esModule=!0,e.exports["default"]=e.exports},"./node_modules/@babel/runtime/helpers/createClass.js":
/*!************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/createClass.js ***!
  \************************************************************/
/*! no static exports found */function(e,t,r){var o=r(/*! ./toPropertyKey.js */"./node_modules/@babel/runtime/helpers/toPropertyKey.js");function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,o(n.key),n)}}function i(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}e.exports=i,e.exports.__esModule=!0,e.exports["default"]=e.exports},"./node_modules/@babel/runtime/helpers/toPrimitive.js":
/*!************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***!
  \************************************************************/
/*! no static exports found */function(e,t,r){var o=r(/*! ./typeof.js */"./node_modules/@babel/runtime/helpers/typeof.js")["default"];function n(e,t){if("object"!==o(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==o(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}e.exports=n,e.exports.__esModule=!0,e.exports["default"]=e.exports},"./node_modules/@babel/runtime/helpers/toPropertyKey.js":
/*!**************************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
  \**************************************************************/
/*! no static exports found */function(e,t,r){var o=r(/*! ./typeof.js */"./node_modules/@babel/runtime/helpers/typeof.js")["default"],n=r(/*! ./toPrimitive.js */"./node_modules/@babel/runtime/helpers/toPrimitive.js");function i(e){var t=n(e,"string");return"symbol"===o(t)?t:String(t)}e.exports=i,e.exports.__esModule=!0,e.exports["default"]=e.exports},"./node_modules/@babel/runtime/helpers/typeof.js":
/*!*******************************************************!*\
  !*** ./node_modules/@babel/runtime/helpers/typeof.js ***!
  \*******************************************************/
/*! no static exports found */function(e,t){function r(t){return e.exports=r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports["default"]=e.exports,r(t)}e.exports=r,e.exports.__esModule=!0,e.exports["default"]=e.exports},"./node_modules/fast-xml-parser/src/fxp.js":
/*!*************************************************!*\
  !*** ./node_modules/fast-xml-parser/src/fxp.js ***!
  \*************************************************/
/*! no static exports found */function(e,t,r){"use strict";const o=r(/*! ./validator */"./node_modules/fast-xml-parser/src/validator.js"),n=r(/*! ./xmlparser/XMLParser */"./node_modules/fast-xml-parser/src/xmlparser/XMLParser.js"),i=r(/*! ./xmlbuilder/json2xml */"./node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js");e.exports={XMLParser:n,XMLValidator:o,XMLBuilder:i}},"./node_modules/fast-xml-parser/src/ignoreAttributes.js":
/*!**************************************************************!*\
  !*** ./node_modules/fast-xml-parser/src/ignoreAttributes.js ***!
  \**************************************************************/
/*! no static exports found */function(e,t){function r(e){return"function"===typeof e?e:Array.isArray(e)?t=>{for(const r of e){if("string"===typeof r&&t===r)return!0;if(r instanceof RegExp&&r.test(t))return!0}}:()=>!1}e.exports=r},"./node_modules/fast-xml-parser/src/util.js":
/*!**************************************************!*\
  !*** ./node_modules/fast-xml-parser/src/util.js ***!
  \**************************************************/
/*! no static exports found */function(e,t,r){"use strict";const o=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",n=o+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",i="["+o+"]["+n+"]*",s=new RegExp("^"+i+"$"),a=function(e,t){const r=[];let o=t.exec(e);while(o){const n=[];n.startIndex=t.lastIndex-o[0].length;const i=o.length;for(let e=0;e<i;e++)n.push(o[e]);r.push(n),o=t.exec(e)}return r},c=function(e){const t=s.exec(e);return!(null===t||"undefined"===typeof t)};t.isExist=function(e){return"undefined"!==typeof e},t.isEmptyObject=function(e){return 0===Object.keys(e).length},t.merge=function(e,t,r){if(t){const o=Object.keys(t),n=o.length;for(let i=0;i<n;i++)e[o[i]]="strict"===r?[t[o[i]]]:t[o[i]]}},t.getValue=function(e){return t.isExist(e)?e:""},t.isName=c,t.getAllMatches=a,t.nameRegexp=i},"./node_modules/fast-xml-parser/src/validator.js":
/*!*******************************************************!*\
  !*** ./node_modules/fast-xml-parser/src/validator.js ***!
  \*******************************************************/
/*! no static exports found */function(e,t,r){"use strict";const o=r(/*! ./util */"./node_modules/fast-xml-parser/src/util.js"),n={allowBooleanAttributes:!1,unpairedTags:[]};function i(e){return" "===e||"\t"===e||"\n"===e||"\r"===e}function s(e,t){const r=t;for(;t<e.length;t++)if("?"!=e[t]&&" "!=e[t]);else{const o=e.substr(r,t-r);if(t>5&&"xml"===o)return g("InvalidXml","XML declaration allowed only at the start of the document.",v(e,t));if("?"==e[t]&&">"==e[t+1]){t++;break}}return t}function a(e,t){if(e.length>t+5&&"-"===e[t+1]&&"-"===e[t+2]){for(t+=3;t<e.length;t++)if("-"===e[t]&&"-"===e[t+1]&&">"===e[t+2]){t+=2;break}}else if(e.length>t+8&&"D"===e[t+1]&&"O"===e[t+2]&&"C"===e[t+3]&&"T"===e[t+4]&&"Y"===e[t+5]&&"P"===e[t+6]&&"E"===e[t+7]){let r=1;for(t+=8;t<e.length;t++)if("<"===e[t])r++;else if(">"===e[t]&&(r--,0===r))break}else if(e.length>t+9&&"["===e[t+1]&&"C"===e[t+2]&&"D"===e[t+3]&&"A"===e[t+4]&&"T"===e[t+5]&&"A"===e[t+6]&&"["===e[t+7])for(t+=8;t<e.length;t++)if("]"===e[t]&&"]"===e[t+1]&&">"===e[t+2]){t+=2;break}return t}t.validate=function(e,t){t=Object.assign({},n,t);const r=[];let o=!1,c=!1;"\ufeff"===e[0]&&(e=e.substr(1));for(let n=0;n<e.length;n++)if("<"===e[n]&&"?"===e[n+1]){if(n+=2,n=s(e,n),n.err)return n}else{if("<"!==e[n]){if(i(e[n]))continue;return g("InvalidChar","char '"+e[n]+"' is not expected.",v(e,n))}{let u=n;if(n++,"!"===e[n]){n=a(e,n);continue}{let d=!1;"/"===e[n]&&(d=!0,n++);let h="";for(;n<e.length&&">"!==e[n]&&" "!==e[n]&&"\t"!==e[n]&&"\n"!==e[n]&&"\r"!==e[n];n++)h+=e[n];if(h=h.trim(),"/"===h[h.length-1]&&(h=h.substring(0,h.length-1),n--),!y(h)){let t;return t=0===h.trim().length?"Invalid space after '<'.":"Tag '"+h+"' is an invalid name.",g("InvalidTag",t,v(e,n))}const m=l(e,n);if(!1===m)return g("InvalidAttr","Attributes for '"+h+"' have open quote.",v(e,n));let C=m.value;if(n=m.index,"/"===C[C.length-1]){const r=n-C.length;C=C.substring(0,C.length-1);const i=p(C,t);if(!0!==i)return g(i.err.code,i.err.msg,v(e,r+i.err.line));o=!0}else if(d){if(!m.tagClosed)return g("InvalidTag","Closing tag '"+h+"' doesn't have proper closing.",v(e,n));if(C.trim().length>0)return g("InvalidTag","Closing tag '"+h+"' can't have attributes or invalid starting.",v(e,u));if(0===r.length)return g("InvalidTag","Closing tag '"+h+"' has not been opened.",v(e,u));{const t=r.pop();if(h!==t.tagName){let r=v(e,t.tagStartPos);return g("InvalidTag","Expected closing tag '"+t.tagName+"' (opened in line "+r.line+", col "+r.col+") instead of closing tag '"+h+"'.",v(e,u))}0==r.length&&(c=!0)}}else{const i=p(C,t);if(!0!==i)return g(i.err.code,i.err.msg,v(e,n-C.length+i.err.line));if(!0===c)return g("InvalidXml","Multiple possible root nodes found.",v(e,n));-1!==t.unpairedTags.indexOf(h)||r.push({tagName:h,tagStartPos:u}),o=!0}for(n++;n<e.length;n++)if("<"===e[n]){if("!"===e[n+1]){n++,n=a(e,n);continue}if("?"!==e[n+1])break;if(n=s(e,++n),n.err)return n}else if("&"===e[n]){const t=f(e,n);if(-1==t)return g("InvalidChar","char '&' is not expected.",v(e,n));n=t}else if(!0===c&&!i(e[n]))return g("InvalidXml","Extra text at the end",v(e,n));"<"===e[n]&&n--}}}return o?1==r.length?g("InvalidTag","Unclosed tag '"+r[0].tagName+"'.",v(e,r[0].tagStartPos)):!(r.length>0)||g("InvalidXml","Invalid '"+JSON.stringify(r.map(e=>e.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1}):g("InvalidXml","Start tag expected.",1)};const c='"',u="'";function l(e,t){let r="",o="",n=!1;for(;t<e.length;t++){if(e[t]===c||e[t]===u)""===o?o=e[t]:o!==e[t]||(o="");else if(">"===e[t]&&""===o){n=!0;break}r+=e[t]}return""===o&&{value:r,index:t,tagClosed:n}}const d=new RegExp("(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['\"])(([\\s\\S])*?)\\5)?","g");function p(e,t){const r=o.getAllMatches(e,d),n={};for(let o=0;o<r.length;o++){if(0===r[o][1].length)return g("InvalidAttr","Attribute '"+r[o][2]+"' has no space in starting.",C(r[o]));if(void 0!==r[o][3]&&void 0===r[o][4])return g("InvalidAttr","Attribute '"+r[o][2]+"' is without value.",C(r[o]));if(void 0===r[o][3]&&!t.allowBooleanAttributes)return g("InvalidAttr","boolean attribute '"+r[o][2]+"' is not allowed.",C(r[o]));const e=r[o][2];if(!m(e))return g("InvalidAttr","Attribute '"+e+"' is an invalid name.",C(r[o]));if(n.hasOwnProperty(e))return g("InvalidAttr","Attribute '"+e+"' is repeated.",C(r[o]));n[e]=1}return!0}function h(e,t){let r=/\d/;for("x"===e[t]&&(t++,r=/[\da-fA-F]/);t<e.length;t++){if(";"===e[t])return t;if(!e[t].match(r))break}return-1}function f(e,t){if(t++,";"===e[t])return-1;if("#"===e[t])return t++,h(e,t);let r=0;for(;t<e.length;t++,r++)if(!(e[t].match(/\w/)&&r<20)){if(";"===e[t])break;return-1}return t}function g(e,t,r){return{err:{code:e,msg:t,line:r.line||r,col:r.col}}}function m(e){return o.isName(e)}function y(e){return o.isName(e)}function v(e,t){const r=e.substring(0,t).split(/\r?\n/);return{line:r.length,col:r[r.length-1].length+1}}function C(e){return e.startIndex+e[1].length}},"./node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js":
/*!*****************************************************************!*\
  !*** ./node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js ***!
  \*****************************************************************/
/*! no static exports found */function(e,t,r){"use strict";const o=r(/*! ./orderedJs2Xml */"./node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js"),n=r(/*! ../ignoreAttributes */"./node_modules/fast-xml-parser/src/ignoreAttributes.js"),i={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:"  ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1};function s(e){this.options=Object.assign({},i,e),!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=n(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=u),this.processTextOrObjNode=a,this.options.format?(this.indentate=c,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function a(e,t,r,o){const n=this.j2x(e,r+1,o.concat(t));return void 0!==e[this.options.textNodeName]&&1===Object.keys(e).length?this.buildTextValNode(e[this.options.textNodeName],t,n.attrStr,r):this.buildObjectNode(n.val,t,n.attrStr,r)}function c(e){return this.options.indentBy.repeat(e)}function u(e){return!(!e.startsWith(this.options.attributeNamePrefix)||e===this.options.textNodeName)&&e.substr(this.attrPrefixLen)}s.prototype.build=function(e){return this.options.preserveOrder?o(e,this.options):(Array.isArray(e)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(e={[this.options.arrayNodeName]:e}),this.j2x(e,0,[]).val)},s.prototype.j2x=function(e,t,r){let o="",n="";const i=r.join(".");for(let s in e)if(Object.prototype.hasOwnProperty.call(e,s))if("undefined"===typeof e[s])this.isAttribute(s)&&(n+="");else if(null===e[s])this.isAttribute(s)?n+="":"?"===s[0]?n+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if(e[s]instanceof Date)n+=this.buildTextValNode(e[s],s,"",t);else if("object"!==typeof e[s]){const r=this.isAttribute(s);if(r&&!this.ignoreAttributesFn(r,i))o+=this.buildAttrPairStr(r,""+e[s]);else if(!r)if(s===this.options.textNodeName){let t=this.options.tagValueProcessor(s,""+e[s]);n+=this.replaceEntitiesValue(t)}else n+=this.buildTextValNode(e[s],s,"",t)}else if(Array.isArray(e[s])){const o=e[s].length;let i="",a="";for(let c=0;c<o;c++){const o=e[s][c];if("undefined"===typeof o);else if(null===o)"?"===s[0]?n+=this.indentate(t)+"<"+s+"?"+this.tagEndChar:n+=this.indentate(t)+"<"+s+"/"+this.tagEndChar;else if("object"===typeof o)if(this.options.oneListGroup){const e=this.j2x(o,t+1,r.concat(s));i+=e.val,this.options.attributesGroupName&&o.hasOwnProperty(this.options.attributesGroupName)&&(a+=e.attrStr)}else i+=this.processTextOrObjNode(o,s,t,r);else if(this.options.oneListGroup){let e=this.options.tagValueProcessor(s,o);e=this.replaceEntitiesValue(e),i+=e}else i+=this.buildTextValNode(o,s,"",t)}this.options.oneListGroup&&(i=this.buildObjectNode(i,s,a,t)),n+=i}else if(this.options.attributesGroupName&&s===this.options.attributesGroupName){const t=Object.keys(e[s]),r=t.length;for(let n=0;n<r;n++)o+=this.buildAttrPairStr(t[n],""+e[s][t[n]])}else n+=this.processTextOrObjNode(e[s],s,t,r);return{attrStr:o,val:n}},s.prototype.buildAttrPairStr=function(e,t){return t=this.options.attributeValueProcessor(e,""+t),t=this.replaceEntitiesValue(t),this.options.suppressBooleanAttributes&&"true"===t?" "+e:" "+e+'="'+t+'"'},s.prototype.buildObjectNode=function(e,t,r,o){if(""===e)return"?"===t[0]?this.indentate(o)+"<"+t+r+"?"+this.tagEndChar:this.indentate(o)+"<"+t+r+this.closeTag(t)+this.tagEndChar;{let n="</"+t+this.tagEndChar,i="";return"?"===t[0]&&(i="?",n=""),!r&&""!==r||-1!==e.indexOf("<")?!1!==this.options.commentPropName&&t===this.options.commentPropName&&0===i.length?this.indentate(o)+`\x3c!--${e}--\x3e`+this.newLine:this.indentate(o)+"<"+t+r+i+this.tagEndChar+e+this.indentate(o)+n:this.indentate(o)+"<"+t+r+i+">"+e+n}},s.prototype.closeTag=function(e){let t="";return-1!==this.options.unpairedTags.indexOf(e)?this.options.suppressUnpairedNode||(t="/"):t=this.options.suppressEmptyNode?"/":"></"+e,t},s.prototype.buildTextValNode=function(e,t,r,o){if(!1!==this.options.cdataPropName&&t===this.options.cdataPropName)return this.indentate(o)+`<![CDATA[${e}]]>`+this.newLine;if(!1!==this.options.commentPropName&&t===this.options.commentPropName)return this.indentate(o)+`\x3c!--${e}--\x3e`+this.newLine;if("?"===t[0])return this.indentate(o)+"<"+t+r+"?"+this.tagEndChar;{let n=this.options.tagValueProcessor(t,e);return n=this.replaceEntitiesValue(n),""===n?this.indentate(o)+"<"+t+r+this.closeTag(t)+this.tagEndChar:this.indentate(o)+"<"+t+r+">"+n+"</"+t+this.tagEndChar}},s.prototype.replaceEntitiesValue=function(e){if(e&&e.length>0&&this.options.processEntities)for(let t=0;t<this.options.entities.length;t++){const r=this.options.entities[t];e=e.replace(r.regex,r.val)}return e},e.exports=s},"./node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js":
/*!**********************************************************************!*\
  !*** ./node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js ***!
  \**********************************************************************/
/*! no static exports found */function(e,t){const r="\n";function o(e,t){let o="";return t.format&&t.indentBy.length>0&&(o=r),n(e,t,"",o)}function n(e,t,r,o){let u="",l=!1;for(let d=0;d<e.length;d++){const p=e[d],h=i(p);if(void 0===h)continue;let f="";if(f=0===r.length?h:`${r}.${h}`,h===t.textNodeName){let e=p[h];a(f,t)||(e=t.tagValueProcessor(h,e),e=c(e,t)),l&&(u+=o),u+=e,l=!1;continue}if(h===t.cdataPropName){l&&(u+=o),u+=`<![CDATA[${p[h][0][t.textNodeName]}]]>`,l=!1;continue}if(h===t.commentPropName){u+=o+`\x3c!--${p[h][0][t.textNodeName]}--\x3e`,l=!0;continue}if("?"===h[0]){const e=s(p[":@"],t),r="?xml"===h?"":o;let n=p[h][0][t.textNodeName];n=0!==n.length?" "+n:"",u+=r+`<${h}${n}${e}?>`,l=!0;continue}let g=o;""!==g&&(g+=t.indentBy);const m=s(p[":@"],t),y=o+`<${h}${m}`,v=n(p[h],t,f,g);-1!==t.unpairedTags.indexOf(h)?t.suppressUnpairedNode?u+=y+">":u+=y+"/>":v&&0!==v.length||!t.suppressEmptyNode?v&&v.endsWith(">")?u+=y+`>${v}${o}</${h}>`:(u+=y+">",v&&""!==o&&(v.includes("/>")||v.includes("</"))?u+=o+t.indentBy+v+o:u+=v,u+=`</${h}>`):u+=y+"/>",l=!0}return u}function i(e){const t=Object.keys(e);for(let r=0;r<t.length;r++){const o=t[r];if(e.hasOwnProperty(o)&&":@"!==o)return o}}function s(e,t){let r="";if(e&&!t.ignoreAttributes)for(let o in e){if(!e.hasOwnProperty(o))continue;let n=t.attributeValueProcessor(o,e[o]);n=c(n,t),!0===n&&t.suppressBooleanAttributes?r+=" "+o.substr(t.attributeNamePrefix.length):r+=` ${o.substr(t.attributeNamePrefix.length)}="${n}"`}return r}function a(e,t){e=e.substr(0,e.length-t.textNodeName.length-1);let r=e.substr(e.lastIndexOf(".")+1);for(let o in t.stopNodes)if(t.stopNodes[o]===e||t.stopNodes[o]==="*."+r)return!0;return!1}function c(e,t){if(e&&e.length>0&&t.processEntities)for(let r=0;r<t.entities.length;r++){const o=t.entities[r];e=e.replace(o.regex,o.val)}return e}e.exports=o},"./node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js":
/*!*********************************************************************!*\
  !*** ./node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js ***!
  \*********************************************************************/
/*! no static exports found */function(e,t,r){const o=r(/*! ../util */"./node_modules/fast-xml-parser/src/util.js");function n(e,t){const r={};if("O"!==e[t+3]||"C"!==e[t+4]||"T"!==e[t+5]||"Y"!==e[t+6]||"P"!==e[t+7]||"E"!==e[t+8])throw new Error("Invalid Tag instead of DOCTYPE");{t+=9;let o=1,n=!1,p=!1,h="";for(;t<e.length;t++)if("<"!==e[t]||p)if(">"===e[t]){if(p?"-"===e[t-1]&&"-"===e[t-2]&&(p=!1,o--):o--,0===o)break}else"["===e[t]?n=!0:h+=e[t];else{if(n&&a(e,t))t+=7,[entityName,val,t]=i(e,t+1),-1===val.indexOf("&")&&(r[d(entityName)]={regx:RegExp(`&${entityName};`,"g"),val:val});else if(n&&c(e,t))t+=8;else if(n&&u(e,t))t+=8;else if(n&&l(e,t))t+=9;else{if(!s)throw new Error("Invalid DOCTYPE");p=!0}o++,h=""}if(0!==o)throw new Error("Unclosed DOCTYPE")}return{entities:r,i:t}}function i(e,t){let r="";for(;t<e.length&&"'"!==e[t]&&'"'!==e[t];t++)r+=e[t];if(r=r.trim(),-1!==r.indexOf(" "))throw new Error("External entites are not supported");const o=e[t++];let n="";for(;t<e.length&&e[t]!==o;t++)n+=e[t];return[r,n,t]}function s(e,t){return"!"===e[t+1]&&"-"===e[t+2]&&"-"===e[t+3]}function a(e,t){return"!"===e[t+1]&&"E"===e[t+2]&&"N"===e[t+3]&&"T"===e[t+4]&&"I"===e[t+5]&&"T"===e[t+6]&&"Y"===e[t+7]}function c(e,t){return"!"===e[t+1]&&"E"===e[t+2]&&"L"===e[t+3]&&"E"===e[t+4]&&"M"===e[t+5]&&"E"===e[t+6]&&"N"===e[t+7]&&"T"===e[t+8]}function u(e,t){return"!"===e[t+1]&&"A"===e[t+2]&&"T"===e[t+3]&&"T"===e[t+4]&&"L"===e[t+5]&&"I"===e[t+6]&&"S"===e[t+7]&&"T"===e[t+8]}function l(e,t){return"!"===e[t+1]&&"N"===e[t+2]&&"O"===e[t+3]&&"T"===e[t+4]&&"A"===e[t+5]&&"T"===e[t+6]&&"I"===e[t+7]&&"O"===e[t+8]&&"N"===e[t+9]}function d(e){if(o.isName(e))return e;throw new Error("Invalid entity name "+e)}e.exports=n},"./node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js":
/*!**********************************************************************!*\
  !*** ./node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js ***!
  \**********************************************************************/
/*! no static exports found */function(e,t){const r={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,r){return e}},o=function(e){return Object.assign({},r,e)};t.buildOptions=o,t.defaultOptions=r},"./node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js":
/*!************************************************************************!*\
  !*** ./node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js ***!
  \************************************************************************/
/*! no static exports found */function(e,t,r){"use strict";const o=r(/*! ../util */"./node_modules/fast-xml-parser/src/util.js"),n=r(/*! ./xmlNode */"./node_modules/fast-xml-parser/src/xmlparser/xmlNode.js"),i=r(/*! ./DocTypeReader */"./node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js"),s=r(/*! strnum */"./node_modules/strnum/strnum.js"),a=r(/*! ../ignoreAttributes */"./node_modules/fast-xml-parser/src/ignoreAttributes.js");class c{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCharCode(Number.parseInt(t,16))}},this.addExternalEntities=u,this.parseXml=f,this.parseTextData=l,this.resolveNameSpace=d,this.buildAttributesMap=h,this.isItStopNode=v,this.replaceEntitiesValue=m,this.readStopNodeData=x,this.saveTextToParentTag=y,this.addChild=g,this.ignoreAttributesFn=a(this.options.ignoreAttributes)}}function u(e){const t=Object.keys(e);for(let r=0;r<t.length;r++){const o=t[r];this.lastEntities[o]={regex:new RegExp("&"+o+";","g"),val:e[o]}}}function l(e,t,r,o,n,i,s){if(void 0!==e&&(this.options.trimValues&&!o&&(e=e.trim()),e.length>0)){s||(e=this.replaceEntitiesValue(e));const o=this.options.tagValueProcessor(t,e,r,n,i);if(null===o||void 0===o)return e;if(typeof o!==typeof e||o!==e)return o;if(this.options.trimValues)return S(e,this.options.parseTagValue,this.options.numberParseOptions);{const t=e.trim();return t===e?S(e,this.options.parseTagValue,this.options.numberParseOptions):e}}}function d(e){if(this.options.removeNSPrefix){const t=e.split(":"),r="/"===e.charAt(0)?"/":"";if("xmlns"===t[0])return"";2===t.length&&(e=r+t[1])}return e}const p=new RegExp("([^\\s=]+)\\s*(=\\s*(['\"])([\\s\\S]*?)\\3)?","gm");function h(e,t,r){if(!0!==this.options.ignoreAttributes&&"string"===typeof e){const r=o.getAllMatches(e,p),n=r.length,i={};for(let e=0;e<n;e++){const o=this.resolveNameSpace(r[e][1]);if(this.ignoreAttributesFn(o,t))continue;let n=r[e][4],s=this.options.attributeNamePrefix+o;if(o.length)if(this.options.transformAttributeName&&(s=this.options.transformAttributeName(s)),"__proto__"===s&&(s="#__proto__"),void 0!==n){this.options.trimValues&&(n=n.trim()),n=this.replaceEntitiesValue(n);const e=this.options.attributeValueProcessor(o,n,t);i[s]=null===e||void 0===e?n:typeof e!==typeof n||e!==n?e:S(n,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(i[s]=!0)}if(!Object.keys(i).length)return;if(this.options.attributesGroupName){const e={};return e[this.options.attributesGroupName]=i,e}return i}}const f=function(e){e=e.replace(/\r\n?/g,"\n");const t=new n("!xml");let r=t,o="",s="";for(let a=0;a<e.length;a++){const c=e[a];if("<"===c)if("/"===e[a+1]){const t=k(e,">",a,"Closing Tag is not closed.");let n=e.substring(a+2,t).trim();if(this.options.removeNSPrefix){const e=n.indexOf(":");-1!==e&&(n=n.substr(e+1))}this.options.transformTagName&&(n=this.options.transformTagName(n)),r&&(o=this.saveTextToParentTag(o,r,s));const i=s.substring(s.lastIndexOf(".")+1);if(n&&-1!==this.options.unpairedTags.indexOf(n))throw new Error(`Unpaired tag can not be used as closing tag: </${n}>`);let c=0;i&&-1!==this.options.unpairedTags.indexOf(i)?(c=s.lastIndexOf(".",s.lastIndexOf(".")-1),this.tagsNodeStack.pop()):c=s.lastIndexOf("."),s=s.substring(0,c),r=this.tagsNodeStack.pop(),o="",a=t}else if("?"===e[a+1]){let t=b(e,a,!1,"?>");if(!t)throw new Error("Pi Tag is not closed.");if(o=this.saveTextToParentTag(o,r,s),this.options.ignoreDeclaration&&"?xml"===t.tagName||this.options.ignorePiTags);else{const e=new n(t.tagName);e.add(this.options.textNodeName,""),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[":@"]=this.buildAttributesMap(t.tagExp,s,t.tagName)),this.addChild(r,e,s)}a=t.closeIndex+1}else if("!--"===e.substr(a+1,3)){const t=k(e,"--\x3e",a+4,"Comment is not closed.");if(this.options.commentPropName){const n=e.substring(a+4,t-2);o=this.saveTextToParentTag(o,r,s),r.add(this.options.commentPropName,[{[this.options.textNodeName]:n}])}a=t}else if("!D"===e.substr(a+1,2)){const t=i(e,a);this.docTypeEntities=t.entities,a=t.i}else if("!["===e.substr(a+1,2)){const t=k(e,"]]>",a,"CDATA is not closed.")-2,n=e.substring(a+9,t);o=this.saveTextToParentTag(o,r,s);let i=this.parseTextData(n,r.tagname,s,!0,!1,!0,!0);void 0==i&&(i=""),this.options.cdataPropName?r.add(this.options.cdataPropName,[{[this.options.textNodeName]:n}]):r.add(this.options.textNodeName,i),a=t+2}else{let i=b(e,a,this.options.removeNSPrefix),c=i.tagName;const u=i.rawTagName;let l=i.tagExp,d=i.attrExpPresent,p=i.closeIndex;this.options.transformTagName&&(c=this.options.transformTagName(c)),r&&o&&"!xml"!==r.tagname&&(o=this.saveTextToParentTag(o,r,s,!1));const h=r;if(h&&-1!==this.options.unpairedTags.indexOf(h.tagname)&&(r=this.tagsNodeStack.pop(),s=s.substring(0,s.lastIndexOf("."))),c!==t.tagname&&(s+=s?"."+c:c),this.isItStopNode(this.options.stopNodes,s,c)){let t="";if(l.length>0&&l.lastIndexOf("/")===l.length-1)"/"===c[c.length-1]?(c=c.substr(0,c.length-1),s=s.substr(0,s.length-1),l=c):l=l.substr(0,l.length-1),a=i.closeIndex;else if(-1!==this.options.unpairedTags.indexOf(c))a=i.closeIndex;else{const r=this.readStopNodeData(e,u,p+1);if(!r)throw new Error("Unexpected end of "+u);a=r.i,t=r.tagContent}const o=new n(c);c!==l&&d&&(o[":@"]=this.buildAttributesMap(l,s,c)),t&&(t=this.parseTextData(t,c,s,!0,d,!0,!0)),s=s.substr(0,s.lastIndexOf(".")),o.add(this.options.textNodeName,t),this.addChild(r,o,s)}else{if(l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===c[c.length-1]?(c=c.substr(0,c.length-1),s=s.substr(0,s.length-1),l=c):l=l.substr(0,l.length-1),this.options.transformTagName&&(c=this.options.transformTagName(c));const e=new n(c);c!==l&&d&&(e[":@"]=this.buildAttributesMap(l,s,c)),this.addChild(r,e,s),s=s.substr(0,s.lastIndexOf("."))}else{const e=new n(c);this.tagsNodeStack.push(r),c!==l&&d&&(e[":@"]=this.buildAttributesMap(l,s,c)),this.addChild(r,e,s),r=e}o="",a=p}}else o+=e[a]}return t.child};function g(e,t,r){const o=this.options.updateTag(t.tagname,r,t[":@"]);!1===o||("string"===typeof o?(t.tagname=o,e.addChild(t)):e.addChild(t))}const m=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){const r=this.docTypeEntities[t];e=e.replace(r.regx,r.val)}for(let t in this.lastEntities){const r=this.lastEntities[t];e=e.replace(r.regex,r.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){const r=this.htmlEntities[t];e=e.replace(r.regex,r.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function y(e,t,r,o){return e&&(void 0===o&&(o=0===Object.keys(t.child).length),e=this.parseTextData(e,t.tagname,r,!1,!!t[":@"]&&0!==Object.keys(t[":@"]).length,o),void 0!==e&&""!==e&&t.add(this.options.textNodeName,e),e=""),e}function v(e,t,r){const o="*."+r;for(const n in e){const r=e[n];if(o===r||t===r)return!0}return!1}function C(e,t,r=">"){let o,n="";for(let i=t;i<e.length;i++){let t=e[i];if(o)t===o&&(o="");else if('"'===t||"'"===t)o=t;else if(t===r[0]){if(!r[1])return{data:n,index:i};if(e[i+1]===r[1])return{data:n,index:i}}else"\t"===t&&(t=" ");n+=t}}function k(e,t,r,o){const n=e.indexOf(t,r);if(-1===n)throw new Error(o);return n+t.length-1}function b(e,t,r,o=">"){const n=C(e,t+1,o);if(!n)return;let i=n.data;const s=n.index,a=i.search(/\s/);let c=i,u=!0;-1!==a&&(c=i.substring(0,a),i=i.substring(a+1).trimStart());const l=c;if(r){const e=c.indexOf(":");-1!==e&&(c=c.substr(e+1),u=c!==n.data.substr(e+1))}return{tagName:c,tagExp:i,closeIndex:s,attrExpPresent:u,rawTagName:l}}function x(e,t,r){const o=r;let n=1;for(;r<e.length;r++)if("<"===e[r])if("/"===e[r+1]){const i=k(e,">",r,t+" is not closed");let s=e.substring(r+2,i).trim();if(s===t&&(n--,0===n))return{tagContent:e.substring(o,r),i:i};r=i}else if("?"===e[r+1]){const t=k(e,"?>",r+1,"StopNode is not closed.");r=t}else if("!--"===e.substr(r+1,3)){const t=k(e,"--\x3e",r+3,"StopNode is not closed.");r=t}else if("!["===e.substr(r+1,2)){const t=k(e,"]]>",r,"StopNode is not closed.")-2;r=t}else{const o=b(e,r,">");if(o){const e=o&&o.tagName;e===t&&"/"!==o.tagExp[o.tagExp.length-1]&&n++,r=o.closeIndex}}}function S(e,t,r){if(t&&"string"===typeof e){const t=e.trim();return"true"===t||"false"!==t&&s(e,r)}return o.isExist(e)?e:""}e.exports=c},"./node_modules/fast-xml-parser/src/xmlparser/XMLParser.js":
/*!*****************************************************************!*\
  !*** ./node_modules/fast-xml-parser/src/xmlparser/XMLParser.js ***!
  \*****************************************************************/
/*! no static exports found */function(e,t,r){const{buildOptions:o}=r(/*! ./OptionsBuilder */"./node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js"),n=r(/*! ./OrderedObjParser */"./node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js"),{prettify:i}=r(/*! ./node2json */"./node_modules/fast-xml-parser/src/xmlparser/node2json.js"),s=r(/*! ../validator */"./node_modules/fast-xml-parser/src/validator.js");class a{constructor(e){this.externalEntities={},this.options=o(e)}parse(e,t){if("string"===typeof e);else{if(!e.toString)throw new Error("XML data is accepted in String or Bytes[] form.");e=e.toString()}if(t){!0===t&&(t={});const r=s.validate(e,t);if(!0!==r)throw Error(`${r.err.msg}:${r.err.line}:${r.err.col}`)}const r=new n(this.options);r.addExternalEntities(this.externalEntities);const o=r.parseXml(e);return this.options.preserveOrder||void 0===o?o:i(o,this.options)}addEntity(e,t){if(-1!==t.indexOf("&"))throw new Error("Entity value can't have '&'");if(-1!==e.indexOf("&")||-1!==e.indexOf(";"))throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '&#xD;'");if("&"===t)throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}}e.exports=a},"./node_modules/fast-xml-parser/src/xmlparser/node2json.js":
/*!*****************************************************************!*\
  !*** ./node_modules/fast-xml-parser/src/xmlparser/node2json.js ***!
  \*****************************************************************/
/*! no static exports found */function(e,t,r){"use strict";function o(e,t){return n(e,t)}function n(e,t,r){let o;const c={};for(let u=0;u<e.length;u++){const l=e[u],d=i(l);let p="";if(p=void 0===r?d:r+"."+d,d===t.textNodeName)void 0===o?o=l[d]:o+=""+l[d];else{if(void 0===d)continue;if(l[d]){let e=n(l[d],t,p);const r=a(e,t);l[":@"]?s(e,l[":@"],p,t):1!==Object.keys(e).length||void 0===e[t.textNodeName]||t.alwaysCreateTextNode?0===Object.keys(e).length&&(t.alwaysCreateTextNode?e[t.textNodeName]="":e=""):e=e[t.textNodeName],void 0!==c[d]&&c.hasOwnProperty(d)?(Array.isArray(c[d])||(c[d]=[c[d]]),c[d].push(e)):t.isArray(d,p,r)?c[d]=[e]:c[d]=e}}}return"string"===typeof o?o.length>0&&(c[t.textNodeName]=o):void 0!==o&&(c[t.textNodeName]=o),c}function i(e){const t=Object.keys(e);for(let r=0;r<t.length;r++){const e=t[r];if(":@"!==e)return e}}function s(e,t,r,o){if(t){const n=Object.keys(t),i=n.length;for(let s=0;s<i;s++){const i=n[s];o.isArray(i,r+"."+i,!0,!0)?e[i]=[t[i]]:e[i]=t[i]}}}function a(e,t){const{textNodeName:r}=t,o=Object.keys(e).length;return 0===o||!(1!==o||!e[r]&&"boolean"!==typeof e[r]&&0!==e[r])}t.prettify=o},"./node_modules/fast-xml-parser/src/xmlparser/xmlNode.js":
/*!***************************************************************!*\
  !*** ./node_modules/fast-xml-parser/src/xmlparser/xmlNode.js ***!
  \***************************************************************/
/*! no static exports found */function(e,t,r){"use strict";class o{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){"__proto__"===e&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){"__proto__"===e.tagname&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,[":@"]:e[":@"]}):this.child.push({[e.tagname]:e.child})}}e.exports=o},"./node_modules/process/browser.js":
/*!*****************************************!*\
  !*** ./node_modules/process/browser.js ***!
  \*****************************************/
/*! no static exports found */function(e,t){var r,o,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(r===setTimeout)return setTimeout(e,0);if((r===i||!r)&&setTimeout)return r=setTimeout,setTimeout(e,0);try{return r(e,0)}catch(t){try{return r.call(null,e,0)}catch(t){return r.call(this,e,0)}}}function c(e){if(o===clearTimeout)return clearTimeout(e);if((o===s||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{return o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(function(){try{r="function"===typeof setTimeout?setTimeout:i}catch(e){r=i}try{o="function"===typeof clearTimeout?clearTimeout:s}catch(e){o=s}})();var u,l=[],d=!1,p=-1;function h(){d&&u&&(d=!1,u.length?l=u.concat(l):p=-1,l.length&&f())}function f(){if(!d){var e=a(h);d=!0;var t=l.length;while(t){u=l,l=[];while(++p<t)u&&u[p].run();p=-1,t=l.length}u=null,d=!1,c(e)}}function g(e,t){this.fun=e,this.array=t}function m(){}n.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new g(e,t)),1!==l.length||d||a(f)},g.prototype.run=function(){this.fun.apply(null,this.array)},n.title="browser",n.browser=!0,n.env={},n.argv=[],n.version="",n.versions={},n.on=m,n.addListener=m,n.once=m,n.off=m,n.removeListener=m,n.removeAllListeners=m,n.emit=m,n.prependListener=m,n.prependOnceListener=m,n.listeners=function(e){return[]},n.binding=function(e){throw new Error("process.binding is not supported")},n.cwd=function(){return"/"},n.chdir=function(e){throw new Error("process.chdir is not supported")},n.umask=function(){return 0}},"./node_modules/strnum/strnum.js":
/*!***************************************!*\
  !*** ./node_modules/strnum/strnum.js ***!
  \***************************************/
/*! no static exports found */function(e,t){const r=/^[-+]?0x[a-fA-F0-9]+$/,o=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt),!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);const n={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function i(e,t={}){if(t=Object.assign({},n,t),!e||"string"!==typeof e)return e;let i=e.trim();if(void 0!==t.skipLike&&t.skipLike.test(i))return e;if(t.hex&&r.test(i))return Number.parseInt(i,16);{const r=o.exec(i);if(r){const o=r[1],n=r[2];let a=s(r[3]);const c=r[4]||r[6];if(!t.leadingZeros&&n.length>0&&o&&"."!==i[2])return e;if(!t.leadingZeros&&n.length>0&&!o&&"."!==i[1])return e;{const r=Number(i),s=""+r;return-1!==s.search(/[eE]/)||c?t.eNotation?r:e:-1!==i.indexOf(".")?"0"===s&&""===a||s===a||o&&s==="-"+a?r:e:n?a===s||o+a===s?r:e:i===s||i===o+s?r:e}}return e}}function s(e){return e&&-1!==e.indexOf(".")?(e=e.replace(/0+$/,""),"."===e?e="0":"."===e[0]?e="0"+e:"."===e[e.length-1]&&(e=e.substr(0,e.length-1)),e):e}e.exports=i},"./node_modules/webpack/buildin/amd-options.js":
/*!****************************************!*\
  !*** (webpack)/buildin/amd-options.js ***!
  \****************************************/
/*! no static exports found */function(e,t){(function(t){e.exports=t}).call(this,{})},"./node_modules/webpack/buildin/module.js":
/*!***********************************!*\
  !*** (webpack)/buildin/module.js ***!
  \***********************************/
/*! no static exports found */function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},"./package.json":
/*!**********************!*\
  !*** ./package.json ***!
  \**********************/
/*! exports provided: name, version, description, main, types, scripts, repository, keywords, author, license, bugs, homepage, dependencies, devDependencies, default */function(e){e.exports=JSON.parse('{"name":"cos-js-sdk-v5","version":"1.8.7","description":"JavaScript SDK for [腾讯云对象存储](https://cloud.tencent.com/product/cos)","main":"dist/cos-js-sdk-v5.js","types":"index.d.ts","scripts":{"prettier":"prettier --write src demo/demo.js demo/CIDemos/*.js test/test.js server/sts.js lib/request.js index.d.ts","server":"node server/sts.js","dev":"cross-env NODE_ENV=development webpack -w --mode=development","build":"cross-env NODE_ENV=production webpack --mode=production","cos-auth.min.js":"uglifyjs ./demo/common/cos-auth.js -o ./demo/common/cos-auth.min.js -c -m","test":"jest --runInBand --coverage"},"repository":{"type":"git","url":"git+https://github.com/tencentyun/cos-js-sdk-v5.git"},"keywords":[],"author":"carsonxu","license":"ISC","bugs":{"url":"https://github.com/tencentyun/cos-js-sdk-v5/issues"},"homepage":"https://github.com/tencentyun/cos-js-sdk-v5#readme","dependencies":{"fast-xml-parser":"4.5.0"},"devDependencies":{"@babel/core":"7.17.9","@babel/plugin-transform-runtime":"7.18.10","@babel/preset-env":"7.16.11","babel-loader":"8.2.5","body-parser":"^1.18.3","cross-env":"^5.2.0","express":"^4.16.4","jest":"^29.3.1","jest-environment-jsdom":"^29.3.1","prettier":"^3.0.1","qcloud-cos-sts":"^3.0.2","request":"^2.87.0","terser-webpack-plugin":"4.2.3","uglifyjs":"^2.4.11","webpack":"4.46.0","webpack-cli":"4.10.0"}}')},"./src/advance.js":
/*!************************!*\
  !*** ./src/advance.js ***!
  \************************/
/*! no static exports found */function(e,t,r){var o=r(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js"),n=r(/*! ./session */"./src/session.js"),i=r(/*! ./async */"./src/async.js"),s=r(/*! ./event */"./src/event.js").EventProxy,a=r(/*! ./util */"./src/util.js"),c=r(/*! ./tracker */"./src/tracker.js");function u(e,t){var r,o,i=this,c=new s,u=e.TaskId,d=e.Bucket,p=e.Region,f=e.Key,m=e.Body,y=e.ChunkSize||e.SliceSize||i.options.ChunkSize,v=e.AsyncLimit,C=e.StorageClass,k=e.ServerSideEncryption,b=e.onHashProgress,x=e.tracker;x&&x.setParams({chunkSize:y}),c.on("error",(function(r){if(i._isRunningTask(u))return e.UploadData.UploadId&&n.removeUsing(e.UploadData.UploadId),r.UploadId=e.UploadData.UploadId||"",t(r)})),c.on("upload_complete",(function(r){var o=a.extend({UploadId:e.UploadData.UploadId||""},r);t(null,o)})),c.on("upload_slice_complete",(function(t){var s={};a.each(e.Headers,(function(e,t){var r=t.toLowerCase();(0===r.indexOf("x-cos-meta-")||["pic-operations","x-cos-callback","x-cos-callback-var","x-cos-return-body"].includes(r))&&(s[t]=e)})),g.call(i,{Bucket:d,Region:p,Key:f,UploadId:t.UploadId,SliceList:t.SliceList,Headers:s,tracker:x},(function(e,s){if(i._isRunningTask(u)){if(n.removeUsing(t.UploadId),e)return o(null,!0),c.emit("error",e);n.removeUploadId.call(i,t.UploadId),o({loaded:r,total:r},!0),c.emit("upload_complete",s)}}))})),c.on("get_upload_data_finish",(function(t){var s=n.getFileId(m,e.ChunkSize,d,f);s&&n.saveUploadId.call(i,s,t.UploadId,i.options.UploadIdCacheLimit),n.setUsing(t.UploadId),o(null,!0),h.call(i,{TaskId:u,Bucket:d,Region:p,Key:f,Body:m,FileSize:r,SliceSize:y,AsyncLimit:v,ServerSideEncryption:k,UploadData:t,Headers:e.Headers,onProgress:o,tracker:x},(function(e,t){if(i._isRunningTask(u))return e?(o(null,!0),c.emit("error",e)):void c.emit("upload_slice_complete",t)}))})),c.on("get_file_size_finish",(function(){if(o=a.throttleOnProgress.call(i,r,e.onProgress),e.UploadData.UploadId)c.emit("get_upload_data_finish",e.UploadData);else{var t=a.extend({TaskId:u,Bucket:d,Region:p,Key:f,Headers:e.Headers,StorageClass:C,Body:m,FileSize:r,SliceSize:y,onHashProgress:b,tracker:x},e);l.call(i,t,(function(t,r){if(i._isRunningTask(u)){if(t)return c.emit("error",t);e.UploadData.UploadId=r.UploadId,e.UploadData.PartList=r.PartList,c.emit("get_upload_data_finish",e.UploadData)}}))}})),r=e.ContentLength,delete e.ContentLength,!e.Headers&&(e.Headers={}),a.each(e.Headers,(function(t,r){"content-length"===r.toLowerCase()&&delete e.Headers[r]})),function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],o=1048576,n=0;n<t.length;n++)if(o=1024*t[n]*1024,r/o<=i.options.MaxPartNumber)break;e.ChunkSize=e.SliceSize=y=Math.max(y,o)}(),0===r?(e.Body="",e.ContentLength=0,e.SkipTask=!0,i.putObject(e,t)):c.emit("get_file_size_finish")}function l(e,t){var r=e.TaskId,o=e.Bucket,c=e.Region,u=e.Key,l=e.StorageClass,h=this,f={},g=e.FileSize,m=e.SliceSize,y=Math.ceil(g/m),v=0,C=a.throttleOnProgress.call(h,g,e.onHashProgress),k=function(t,r){var o=m*(t-1),n=Math.min(o+m,g),i=n-o;f[t]?r(null,{PartNumber:t,ETag:f[t],Size:i}):a.fileSlice(e.Body,o,n,!1,(function(e){a.getFileMd5(e,(function(e,o){if(e)return r(a.error(e));var n='"'+o+'"';f[t]=n,1,v+=i,C({loaded:v,total:g}),r(null,{PartNumber:t,ETag:n,Size:i})}))}))},b=function(e,t){var r=e.length;if(0===r)return t(null,!0);if(r>y)return t(null,!1);if(r>1){var o=Math.max(e[0].Size,e[1].Size);if(o!==m)return t(null,!1)}var n=function o(n){if(n<r){var i=e[n];k(i.PartNumber,(function(e,r){r&&r.ETag===i.ETag&&r.Size===i.Size?o(n+1):t(null,!1)}))}else t(null,!0)};n(0)},x=new s;x.on("error",(function(e){if(h._isRunningTask(r))return t(e)})),x.on("upload_id_available",(function(e){var r={},o=[];a.each(e.PartList,(function(e){r[e.PartNumber]=e}));for(var n=1;n<=y;n++){var i=r[n];i?(i.PartNumber=n,i.Uploaded=!0):i={PartNumber:n,ETag:null,Uploaded:!1},o.push(i)}e.PartList=o,t(null,e)})),x.on("no_available_upload_id",(function(){if(h._isRunningTask(r)){var n=a.extend({Bucket:o,Region:c,Key:u,Query:a.clone(e.Query),StorageClass:l,Body:e.Body,calledBySdk:"sliceUploadFile",tracker:e.tracker},e),i=a.clone(e.Headers);delete i["x-cos-mime-limit"],n.Headers=i,h.multipartInit(n,(function(e,o){if(h._isRunningTask(r)){if(e)return x.emit("error",e);var n=o.UploadId;if(!n)return t(a.error(new Error("no such upload id")));x.emit("upload_id_available",{UploadId:n,PartList:[]})}}))}})),x.on("has_and_check_upload_id",(function(t){t=t.reverse(),i.eachLimit(t,1,(function(t,i){h._isRunningTask(r)&&(n.using[t]?i():p.call(h,{Bucket:o,Region:c,Key:u,UploadId:t,tracker:e.tracker},(function(e,o){if(h._isRunningTask(r)){if(e)return n.removeUsing(t),x.emit("error",e);var s=o.PartList;s.forEach((function(e){e.PartNumber*=1,e.Size*=1,e.ETag=e.ETag||""})),b(s,(function(e,o){if(h._isRunningTask(r))return e?x.emit("error",e):void(o?i({UploadId:t,PartList:s}):i())}))}})))}),(function(e){h._isRunningTask(r)&&(C(null,!0),e&&e.UploadId?x.emit("upload_id_available",e):x.emit("no_available_upload_id"))}))})),x.on("seek_local_avail_upload_id",(function(t){var i=n.getFileId(e.Body,e.ChunkSize,o,u),s=n.getUploadIdList.call(h,i);if(i&&s){var l=function i(l){if(l>=s.length)x.emit("has_and_check_upload_id",t);else{var d=s[l];if(!a.isInArray(t,d))return n.removeUploadId.call(h,d),void i(l+1);n.using[d]?i(l+1):p.call(h,{Bucket:o,Region:c,Key:u,UploadId:d,tracker:e.tracker},(function(e,t){h._isRunningTask(r)&&(e?(n.removeUploadId.call(h,d),i(l+1)):x.emit("upload_id_available",{UploadId:d,PartList:t.PartList}))}))}};l(0)}else x.emit("has_and_check_upload_id",t)})),x.on("get_remote_upload_id_list",(function(){d.call(h,{Bucket:o,Region:c,Key:u,tracker:e.tracker},(function(t,i){if(h._isRunningTask(r)){if(t)return x.emit("error",t);var s=a.filter(i.UploadList,(function(e){return e.Key===u&&(!l||e.StorageClass.toUpperCase()===l.toUpperCase())})).reverse().map((function(e){return e.UploadId||e.UploadID}));if(s.length)x.emit("seek_local_avail_upload_id",s);else{var c,d=n.getFileId(e.Body,e.ChunkSize,o,u);d&&(c=n.getUploadIdList.call(h,d))&&a.each(c,(function(e){n.removeUploadId.call(h,e)})),x.emit("no_available_upload_id")}}}))})),x.emit("get_remote_upload_id_list")}function d(e,t){var r=this,o=[],n={Bucket:e.Bucket,Region:e.Region,Prefix:e.Key,calledBySdk:e.calledBySdk||"sliceUploadFile",tracker:e.tracker},i=function e(){r.multipartList(n,(function(r,i){if(r)return t(r);o.push.apply(o,i.Upload||[]),"true"===i.IsTruncated?(n.KeyMarker=i.NextKeyMarker,n.UploadIdMarker=i.NextUploadIdMarker,e()):t(null,{UploadList:o})}))};i()}function p(e,t){var r=this,o=[],n={Bucket:e.Bucket,Region:e.Region,Key:e.Key,UploadId:e.UploadId,calledBySdk:"sliceUploadFile",tracker:e.tracker},i=function e(){r.multipartListPart(n,(function(r,i){if(r)return t(r);o.push.apply(o,i.Part||[]),"true"===i.IsTruncated?(n.PartNumberMarker=i.NextPartNumberMarker,e()):t(null,{PartList:o})}))};i()}function h(e,t){var r=this,o=e.TaskId,n=e.Bucket,s=e.Region,c=e.Key,u=e.UploadData,l=e.FileSize,d=e.SliceSize,p=Math.min(e.AsyncLimit||r.options.ChunkParallelLimit||1,256),h=e.Body,g=Math.ceil(l/d),m=0,y=e.ServerSideEncryption,v=e.Headers,C=a.filter(u.PartList,(function(e){return e["Uploaded"]&&(m+=e["PartNumber"]>=g&&l%d||d),!e["Uploaded"]})),k=e.onProgress;i.eachLimit(C,p,(function(t,i){if(r._isRunningTask(o)){var a=t["PartNumber"],p=Math.min(l,t["PartNumber"]*d)-(t["PartNumber"]-1)*d,g=0;f.call(r,{TaskId:o,Bucket:n,Region:s,Key:c,SliceSize:d,FileSize:l,PartNumber:a,ServerSideEncryption:y,Body:h,UploadData:u,Headers:v,onProgress:function(e){m+=e.loaded-g,g=e.loaded,k({loaded:m,total:l})},tracker:e.tracker},(function(e,n){r._isRunningTask(o)&&(e||n.ETag||(e='get ETag error, please add "ETag" to CORS ExposeHeader setting.( 获取ETag失败，请在CORS ExposeHeader设置中添加ETag，请参考文档：https://cloud.tencent.com/document/product/436/13318 )'),e?m-=g:(m+=p-g,t.ETag=n.ETag),k({loaded:m,total:l}),i(e||null,n))}))}}),(function(e){if(r._isRunningTask(o))return e?t(e):void t(null,{UploadId:u.UploadId,SliceList:u.PartList})}))}function f(e,t){var r=this,o=e.TaskId,n=e.Bucket,s=e.Region,c=e.Key,u=e.FileSize,l=e.Body,d=1*e.PartNumber,p=e.SliceSize,h=e.ServerSideEncryption,f=e.UploadData,g=e.Headers||{},m=r.options.ChunkRetryTimes+1,y=p*(d-1),v=p,C=y+p;C>u&&(C=u,v=C-y);var k=["x-cos-traffic-limit","x-cos-mime-limit"],b={};a.each(g,(function(e,t){k.indexOf(t)>-1&&(b[t]=e)}));var x=f.PartList[d-1];i.retry(m,(function(t){r._isRunningTask(o)&&a.fileSlice(l,y,C,!0,(function(i){r.multipartUpload({TaskId:o,Bucket:n,Region:s,Key:c,ContentLength:v,PartNumber:d,UploadId:f.UploadId,ServerSideEncryption:h,Body:i,Headers:b,onProgress:e.onProgress,calledBySdk:"sliceUploadFile",tracker:e.tracker},(function(e,n){if(r._isRunningTask(o))return e?t(e):(x.Uploaded=!0,t(null,n))}))}))}),(function(e,n){if(r._isRunningTask(o))return t(e,n)}))}function g(e,t){var r=e.Bucket,o=e.Region,n=e.Key,s=e.UploadId,a=e.SliceList,c=this,u=this.options.ChunkRetryTimes+1,l=e.Headers,d=a.map((function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}}));i.retry(u,(function(t){c.multipartComplete({Bucket:r,Region:o,Key:n,UploadId:s,Parts:d,Headers:l,calledBySdk:"sliceUploadFile",tracker:e.tracker},t)}),(function(e,r){t(e,r)}))}function m(e,t){var r=e.Bucket,o=e.Region,n=e.Key,i=e.UploadId,c=e.Level||"task",u=e.AsyncLimit,l=this,p=new s;if(p.on("error",(function(e){return t(e)})),p.on("get_abort_array",(function(i){y.call(l,{Bucket:r,Region:o,Key:n,Headers:e.Headers,AsyncLimit:u,AbortArray:i},t)})),"bucket"===c)d.call(l,{Bucket:r,Region:o,calledBySdk:"abortUploadTask"},(function(e,r){if(e)return t(e);p.emit("get_abort_array",r.UploadList||[])}));else if("file"===c){if(!n)return t(a.error(new Error("abort_upload_task_no_key")));d.call(l,{Bucket:r,Region:o,Key:n,calledBySdk:"abortUploadTask"},(function(e,r){if(e)return t(e);p.emit("get_abort_array",r.UploadList||[])}))}else{if("task"!==c)return t(a.error(new Error("abort_unknown_level")));if(!i)return t(a.error(new Error("abort_upload_task_no_id")));if(!n)return t(a.error(new Error("abort_upload_task_no_key")));p.emit("get_abort_array",[{Key:n,UploadId:i}])}}function y(e,t){var r=e.Bucket,o=e.Region,n=e.Key,s=e.AbortArray,a=e.AsyncLimit||1,c=this,u=0,l=new Array(s.length);i.eachLimit(s,a,(function(t,i){var s=u;if(n&&n!==t.Key)return l[s]={error:{KeyNotMatch:!0}},void i(null);var a=t.UploadId||t.UploadID;c.multipartAbort({Bucket:r,Region:o,Key:t.Key,Headers:e.Headers,UploadId:a},(function(e){var n={Bucket:r,Region:o,Key:t.Key,UploadId:a};l[s]={error:e,task:n},i(null)})),u++}),(function(e){if(e)return t(e);for(var r=[],o=[],n=0,i=l.length;n<i;n++){var s=l[n];s["task"]&&(s["error"]?o.push(s["task"]):r.push(s["task"]))}return t(null,{successList:r,errorList:o})}))}function v(e,t){var r=this,n=void 0===e.SliceSize?r.options.SliceSize:e.SliceSize,i=[],s=e.Body,u=s.size||s.length||0,l={TaskId:""};if(r.options.EnableReporter){var d=r.options.UseAccelerate||"string"===typeof r.options.Domain&&r.options.Domain.includes("accelerate."),p=u>n?"sliceUploadFile":"putObject";e.tracker=new c({Beacon:r.options.BeaconReporter,clsReporter:r.options.ClsReporter,bucket:e.Bucket,region:e.Region,apiName:"uploadFile",realApi:p,fileKey:e.Key,fileSize:u,accelerate:d,deepTracker:r.options.DeepTracker,customId:r.options.CustomId,delay:r.options.TrackerDelay})}a.each(e,(function(e,t){"object"!==o(e)&&"function"!==typeof e&&(l[t]=e)}));var h=e.onTaskReady,f=function(e){l.TaskId=e,h&&h(e)};e.onTaskReady=f;var g=u>n?"sliceUploadFile":"putObject",m=e.onFileFinish,y=function(r,o){e.tracker&&e.tracker.report(r,o),m&&m(r,o,l),t&&t(r,o)};i.push({api:g,params:e,callback:y}),r._addTasks(i)}function C(e,t){var r=this,n=void 0===e.SliceSize?r.options.SliceSize:e.SliceSize,i=0,s=0,u=a.throttleOnProgress.call(r,s,e.onProgress),l=e.files.length,d=e.onFileFinish,p=Array(l),h=function(e,r,o){u(null,!0),d&&d(e,r,o),p[o.Index]={options:o,error:e,data:r},--l<=0&&t&&t(null,{files:p})},f=[];a.each(e.files,(function(e,t){(function(){var l=e.Body,d=l.size||l.length||0,p={Index:t,TaskId:""};if(!r.options.UseRawKey&&e.Key&&"/"===e.Key.substr(0,1)&&(e.Key=e.Key.substr(1)),i+=d,r.options.EnableReporter){var g=r.options.UseAccelerate||"string"===typeof r.options.Domain&&r.options.Domain.includes("accelerate."),m=d>n?"sliceUploadFile":"putObject";e.tracker=new c({Beacon:r.options.BeaconReporter,clsReporter:r.options.ClsReporter,bucket:e.Bucket,region:e.Region,apiName:"uploadFiles",realApi:m,fileKey:e.Key,fileSize:d,accelerate:g,deepTracker:r.options.DeepTracker,customId:r.options.CustomId,delay:r.options.TrackerDelay})}a.each(e,(function(e,t){"object"!==o(e)&&"function"!==typeof e&&(p[t]=e)}));var y=e.onTaskReady,v=function(e){p.TaskId=e,y&&y(e)};e.onTaskReady=v;var C=0,k=e.onProgress,b=function(e){s=s-C+e.loaded,C=e.loaded,k&&k(e),u({loaded:s,total:i})};e.onProgress=b;var x=d>n?"sliceUploadFile":"putObject",S=e.onFileFinish,w=function(t,r){e.tracker&&e.tracker.report(t,r),S&&S(t,r),h&&h(t,r,p)};f.push({api:x,params:e,callback:w})})()})),r._addTasks(f)}function k(e,t){var r=new s,o=this,c=e.Bucket,u=e.Region,l=e.Key,d=e.CopySource,h=a.getSourceParams.call(this,d);if(h){var f=h.Bucket,g=h.Region,m=decodeURIComponent(h.Key),y=void 0===e.CopySliceSize?o.options.CopySliceSize:e.CopySliceSize;y=Math.max(0,y);var v,C,k=e.CopyChunkSize||this.options.CopyChunkSize,x=this.options.CopyChunkParallelLimit,S=this.options.ChunkRetryTimes+1,w=0,T=0,A={},R={},B={};r.on("copy_slice_complete",(function(r){var s={};a.each(e.Headers,(function(e,t){0===t.toLowerCase().indexOf("x-cos-meta-")&&(s[t]=e)}));var d=a.map(r.PartList,(function(e){return{PartNumber:e.PartNumber,ETag:e.ETag}}));i.retry(S,(function(t){o.multipartComplete({Bucket:c,Region:u,Key:l,UploadId:r.UploadId,Parts:d,tracker:e.tracker,calledBySdk:"sliceCopyFile"},t)}),(function(e,o){if(n.removeUsing(r.UploadId),e)return C(null,!0),t(e);n.removeUploadId(r.UploadId),C({loaded:v,total:v},!0),t(null,o)}))})),r.on("get_copy_data_finish",(function(s){var p=n.getCopyFileId(d,A,k,c,l);p&&n.saveUploadId(p,s.UploadId,o.options.UploadIdCacheLimit),n.setUsing(s.UploadId);var h=a.filter(s.PartList,(function(e){return e["Uploaded"]&&(T+=e["PartNumber"]>=w&&v%k||k),!e["Uploaded"]}));i.eachLimit(h,x,(function(t,r){var n=t.PartNumber,a=t.CopySourceRange,p=t.end-t.start;i.retry(S,(function(t){b.call(o,{Bucket:c,Region:u,Key:l,CopySource:d,UploadId:s.UploadId,PartNumber:n,CopySourceRange:a,tracker:e.tracker,calledBySdk:"sliceCopyFile"},t)}),(function(e,o){if(e)return r(e);T+=p,C({loaded:T,total:v}),t.ETag=o.ETag,r(e||null,o)}))}),(function(e){if(e)return n.removeUsing(s.UploadId),C(null,!0),t(e);r.emit("copy_slice_complete",s)}))})),r.on("get_chunk_size_finish",(function(){var i=function(){o.multipartInit({Bucket:c,Region:u,Key:l,Headers:B,tracker:e.tracker,calledBySdk:"sliceCopyFile"},(function(o,n){if(o)return t(o);e.UploadId=n.UploadId,r.emit("get_copy_data_finish",{UploadId:e.UploadId,PartList:e.PartList})}))},s=n.getCopyFileId(d,A,k,c,l),h=n.getUploadIdList(s);if(!s||!h)return i();var f=function t(s){if(s>=h.length)return i();var d=h[s];if(n.using[d])return t(s+1);p.call(o,{Bucket:c,Region:u,Key:l,UploadId:d,tracker:e.tracker,calledBySdk:"sliceCopyFile"},(function(o,i){if(o)n.removeUploadId(d),t(s+1);else{if(n.using[d])return t(s+1);var c={},u=0;a.each(i.PartList,(function(e){var t=parseInt(e.Size),r=u+t-1;c[e.PartNumber+"|"+u+"|"+r]=e.ETag,u+=t})),a.each(e.PartList,(function(e){var t=c[e.PartNumber+"|"+e.start+"|"+e.end];t&&(e.ETag=t,e.Uploaded=!0)})),r.emit("get_copy_data_finish",{UploadId:d,PartList:e.PartList})}}))};f(0)})),r.on("get_file_size_finish",(function(){if(function(){for(var t=[1,2,4,8,16,32,64,128,256,512,1024,2048,4096,5120],r=1048576,n=0;n<t.length;n++)if(r=1024*t[n]*1024,v/r<=o.options.MaxPartNumber)break;e.ChunkSize=k=Math.max(k,r),w=Math.ceil(v/k);for(var i=[],s=1;s<=w;s++){var a=(s-1)*k,c=s*k<v?s*k-1:v-1,u={PartNumber:s,start:a,end:c,CopySourceRange:"bytes="+a+"-"+c};i.push(u)}e.PartList=i}(),B="Replaced"===e.Headers["x-cos-metadata-directive"]?e.Headers:R,B["x-cos-storage-class"]=e.Headers["x-cos-storage-class"]||R["x-cos-storage-class"],B=a.clearKey(B),"ARCHIVE"===R["x-cos-storage-class"]||"DEEP_ARCHIVE"===R["x-cos-storage-class"]){var n=R["x-cos-restore"];if(!n||'ongoing-request="true"'===n)return void t(a.error(new Error("Unrestored archive object is not allowed to be copied")))}delete B["x-cos-copy-source"],delete B["x-cos-metadata-directive"],delete B["x-cos-copy-source-If-Modified-Since"],delete B["x-cos-copy-source-If-Unmodified-Since"],delete B["x-cos-copy-source-If-Match"],delete B["x-cos-copy-source-If-None-Match"],r.emit("get_chunk_size_finish")})),o.headObject({Bucket:f,Region:g,Key:m,tracker:e.tracker,calledBySdk:"sliceCopyFile"},(function(n,i){if(n)n.statusCode&&404===n.statusCode?t(a.error(n,{ErrorStatus:m+" Not Exist"})):t(n);else if(v=e.FileSize=i.headers["content-length"],void 0!==v&&v)if(e.tracker&&e.tracker.setParams({httpSize:v}),C=a.throttleOnProgress.call(o,v,e.onProgress),v<=y)e.Headers["x-cos-metadata-directive"]||(e.Headers["x-cos-metadata-directive"]="Copy"),o.putObjectCopy(Object.assign(e,{calledBySdk:"sliceCopyFile"}),(function(e,r){if(e)return C(null,!0),t(e);C({loaded:v,total:v},!0),t(e,r)}));else{var s=i.headers;A=s,R={"Cache-Control":s["cache-control"],"Content-Disposition":s["content-disposition"],"Content-Encoding":s["content-encoding"],"Content-Type":s["content-type"],Expires:s["expires"],"x-cos-storage-class":s["x-cos-storage-class"]},a.each(s,(function(e,t){var r="x-cos-meta-";0===t.indexOf(r)&&t.length>r.length&&(R[t]=e)})),r.emit("get_file_size_finish")}else t(a.error(new Error('get Content-Length error, please add "Content-Length" to CORS ExposeHeader setting.（ 获取Content-Length失败，请在CORS ExposeHeader设置中添加Content-Length，请参考文档：https://cloud.tencent.com/document/product/436/13318 ）')))}))}else t(a.error(new Error("CopySource format error")))}function b(e,t){var r=e.TaskId,o=e.Bucket,n=e.Region,s=e.Key,a=e.CopySource,c=e.UploadId,u=1*e.PartNumber,l=e.CopySourceRange,d=this.options.ChunkRetryTimes+1,p=this;i.retry(d,(function(t){p.uploadPartCopy({TaskId:r,Bucket:o,Region:n,Key:s,CopySource:a,UploadId:c,PartNumber:u,CopySourceRange:l,tracker:e.tracker,calledBySdk:e.calledBySdk},(function(e,r){t(e||null,r)}))}),(function(e,r){return t(e,r)}))}var x={sliceUploadFile:u,abortUploadTask:m,uploadFile:v,uploadFiles:C,sliceCopyFile:k};e.exports.init=function(e,t){t.transferToTaskMethod(x,"sliceUploadFile"),a.each(x,(function(t,r){e.prototype[r]=a.apiWrapper(r,t)}))}},"./src/async.js":
/*!**********************!*\
  !*** ./src/async.js ***!
  \**********************/
/*! no static exports found */function(e,t){var r=function(e,t,r,o){if(o=o||function(){},!e.length||t<=0)return o();var n=0,i=0,s=0;(function a(){if(n>=e.length)return o();while(s<t&&i<e.length)i+=1,s+=1,r(e[i-1],(function(t){t?(o(t),o=function(){}):(n+=1,s-=1,n>=e.length?o():a())}))})()},o=function(e,t,r){var o=function o(n){t((function(t,i){t&&n<e?o(n+1):r(t,i)}))};e<1?r():o(1)},n={eachLimit:r,retry:o};e.exports=n},"./src/base.js":
/*!*********************!*\
  !*** ./src/base.js ***!
  \*********************/
/*! no static exports found */function(e,t,r){var o=r(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js"),n=r(/*! ../lib/request */"./lib/request.js"),i=r(/*! ./util */"./src/util.js");function s(e,t){var r=this.options.Protocol||(i.isBrowser&&"object"===("undefined"===typeof location?"undefined":o(location))&&"http:"===location.protocol?"http:":"https:"),n=this.options.ServiceDomain,s=e.AppId||this.options.appId,a=e.Region;n?(n=n.replace(/\{\{AppId\}\}/gi,s||"").replace(/\{\{Region\}\}/gi,a||"").replace(/\{\{.*?\}\}/gi,""),/^[a-zA-Z]+:\/\//.test(n)||(n=r+"//"+n),"/"===n.slice(-1)&&(n=n.slice(0,-1))):n=a?r+"//cos."+a+".myqcloud.com":r+"//service.cos.myqcloud.com";var c="",u=a?"cos."+a+".myqcloud.com":"service.cos.myqcloud.com",l=n.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1");u===l&&(c=u),Ne.call(this,{Action:"name/cos:GetService",url:n,method:"GET",headers:e.Headers,SignHost:c,tracker:e.tracker},(function(e,r){if(e)return t(e);var o=r&&r.ListAllMyBucketsResult&&r.ListAllMyBucketsResult.Buckets&&r.ListAllMyBucketsResult.Buckets.Bucket||[];o=i.isArray(o)?o:[o];var n=r&&r.ListAllMyBucketsResult&&r.ListAllMyBucketsResult.Owner||{};t(null,{Buckets:o,Owner:n,statusCode:r.statusCode,headers:r.headers})}))}function a(e,t){var r=this,o="";if(e["BucketAZConfig"]){var n={BucketAZConfig:e.BucketAZConfig};o=i.json2xml({CreateBucketConfiguration:n})}Ne.call(this,{Action:"name/cos:PutBucket",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,body:o,tracker:e.tracker},(function(o,n){if(o)return t(o);var i=Oe({protocol:r.options.Protocol,domain:r.options.Domain,bucket:e.Bucket,region:e.Region,isLocation:!0});t(null,{Location:i,statusCode:n.statusCode,headers:n.headers})}))}function c(e,t){Ne.call(this,{Action:"name/cos:HeadBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"HEAD",tracker:e.tracker},t)}function u(e,t){var r={};r["prefix"]=e["Prefix"]||"",r["delimiter"]=e["Delimiter"],r["marker"]=e["Marker"],r["max-keys"]=e["MaxKeys"],r["encoding-type"]=e["EncodingType"],Ne.call(this,{Action:"name/cos:GetBucket",ResourceKey:r["prefix"],method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:r,tracker:e.tracker},(function(e,r){if(e)return t(e);var o=r.ListBucketResult||{},n=o.Contents||[],s=o.CommonPrefixes||[];n=i.isArray(n)?n:[n],s=i.isArray(s)?s:[s];var a=i.clone(o);i.extend(a,{Contents:n,CommonPrefixes:s,statusCode:r.statusCode,headers:r.headers}),t(null,a)}))}function l(e,t){Ne.call(this,{Action:"name/cos:DeleteBucket",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,method:"DELETE",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function d(e,t){var r=e.Headers,o="";if(e["AccessControlPolicy"]){var n=i.clone(e["AccessControlPolicy"]||{}),s=n.Grants||n.Grant;s=i.isArray(s)?s:[s],delete n.Grant,delete n.Grants,n.AccessControlList={Grant:s},o=i.json2xml({AccessControlPolicy:n}),r["Content-Type"]="application/xml",r["Content-MD5"]=i.b64(i.md5(o))}i.each(r,(function(e,t){0===t.indexOf("x-cos-grant-")&&(r[t]=Be(r[t]))})),Ne.call(this,{Action:"name/cos:PutBucketACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,headers:r,action:"acl",body:o,tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,{statusCode:r.statusCode,headers:r.headers})}))}function p(e,t){Ne.call(this,{Action:"name/cos:GetBucketACL",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"acl",tracker:e.tracker},(function(e,r){if(e)return t(e);var o=r.AccessControlPolicy||{},n=o.Owner||{},s=o.AccessControlList.Grant||[];s=i.isArray(s)?s:[s];var a=Re(o);r.headers&&r.headers["x-cos-acl"]&&(a.ACL=r.headers["x-cos-acl"]),a=i.extend(a,{Owner:n,Grants:s,statusCode:r.statusCode,headers:r.headers}),t(null,a)}))}function h(e,t){var r=e["CORSConfiguration"]||{},o=r["CORSRules"]||e["CORSRules"]||[];o=i.clone(i.isArray(o)?o:[o]),i.each(o,(function(e){i.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],(function(t){var r=t+"s",o=e[r]||e[t]||[];delete e[r],e[t]=i.isArray(o)?o:[o]}))}));var n={CORSRule:o};e.ResponseVary&&(n.ResponseVary=e.ResponseVary);var s=i.json2xml({CORSConfiguration:n}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=i.b64(i.md5(s)),Ne.call(this,{Action:"name/cos:PutBucketCORS",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:s,action:"cors",headers:a,tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,{statusCode:r.statusCode,headers:r.headers})}))}function f(e,t){Ne.call(this,{Action:"name/cos:GetBucketCORS",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors",tracker:e.tracker},(function(e,r){if(e)if(404===e.statusCode&&e.error&&"NoSuchCORSConfiguration"===e.error.Code){var o={CORSRules:[],statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else t(e);else{var n=r.CORSConfiguration||{},s=n.CORSRules||n.CORSRule||[];s=i.clone(i.isArray(s)?s:[s]);var a=n.ResponseVary;i.each(s,(function(e){i.each(["AllowedOrigin","AllowedHeader","AllowedMethod","ExposeHeader"],(function(t){var r=t+"s",o=e[r]||e[t]||[];delete e[t],e[r]=i.isArray(o)?o:[o]}))})),t(null,{CORSRules:s,ResponseVary:a,statusCode:r.statusCode,headers:r.headers})}}))}function g(e,t){Ne.call(this,{Action:"name/cos:DeleteBucketCORS",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"cors",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode||e.statusCode,headers:r.headers})}))}function m(e,t){Ne.call(this,{Action:"name/cos:GetBucketLocation",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"location",tracker:e.tracker},t)}function y(e,t){var r=e["Policy"];try{"string"===typeof r&&(r=JSON.parse(r))}catch(s){}if(!r||"string"===typeof r)return t(i.error(new Error("Policy format error")));var o=JSON.stringify(r);r.version||(r.version="2.0");var n=e.Headers;n["Content-Type"]="application/json",n["Content-MD5"]=i.b64(i.md5(o)),Ne.call(this,{Action:"name/cos:PutBucketPolicy",method:"PUT",Bucket:e.Bucket,Region:e.Region,action:"policy",body:o,headers:n,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function v(e,t){Ne.call(this,{Action:"name/cos:GetBucketPolicy",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",rawBody:!0,tracker:e.tracker},(function(e,r){if(e)return e.statusCode&&403===e.statusCode?t(i.error(e,{ErrorStatus:"Access Denied"})):e.statusCode&&405===e.statusCode?t(i.error(e,{ErrorStatus:"Method Not Allowed"})):e.statusCode&&404===e.statusCode?t(i.error(e,{ErrorStatus:"Policy Not Found"})):t(e);var o={};try{o=JSON.parse(r.body)}catch(n){}t(null,{Policy:o,statusCode:r.statusCode,headers:r.headers})}))}function C(e,t){Ne.call(this,{Action:"name/cos:DeleteBucketPolicy",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"policy",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode||e.statusCode,headers:r.headers})}))}function k(e,t){var r=e["Tagging"]||{},o=r.TagSet||r.Tags||e["Tags"]||[];o=i.clone(i.isArray(o)?o:[o]);var n=i.json2xml({Tagging:{TagSet:{Tag:o}}}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.b64(i.md5(n)),Ne.call(this,{Action:"name/cos:PutBucketTagging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"tagging",headers:s,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function b(e,t){Ne.call(this,{Action:"name/cos:GetBucketTagging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",tracker:e.tracker},(function(e,r){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 n=[];try{n=r.Tagging.TagSet.Tag||[]}catch(s){}n=i.clone(i.isArray(n)?n:[n]),t(null,{Tags:n,statusCode:r.statusCode,headers:r.headers})}}))}function x(e,t){Ne.call(this,{Action:"name/cos:DeleteBucketTagging",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"tagging",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function S(e,t){var r=e["LifecycleConfiguration"]||{},o=r.Rules||e.Rules||[];o=i.clone(o);var n=i.json2xml({LifecycleConfiguration:{Rule:o}}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.b64(i.md5(n)),Ne.call(this,{Action:"name/cos:PutBucketLifecycle",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"lifecycle",headers:s,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function w(e,t){Ne.call(this,{Action:"name/cos:GetBucketLifecycle",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle",tracker:e.tracker},(function(e,r){if(e)if(404===e.statusCode&&e.error&&"NoSuchLifecycleConfiguration"===e.error.Code){var o={Rules:[],statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else t(e);else{var n=[];try{n=r.LifecycleConfiguration.Rule||[]}catch(s){}n=i.clone(i.isArray(n)?n:[n]),t(null,{Rules:n,statusCode:r.statusCode,headers:r.headers})}}))}function T(e,t){Ne.call(this,{Action:"name/cos:DeleteBucketLifecycle",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"lifecycle",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function A(e,t){if(e["VersioningConfiguration"]){var r=e["VersioningConfiguration"]||{},o=i.json2xml({VersioningConfiguration:r}),n=e.Headers;n["Content-Type"]="application/xml",n["Content-MD5"]=i.b64(i.md5(o)),Ne.call(this,{Action:"name/cos:PutBucketVersioning",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"versioning",headers:n,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}else t(i.error(new Error("missing param VersioningConfiguration")))}function R(e,t){Ne.call(this,{Action:"name/cos:GetBucketVersioning",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"versioning",tracker:e.tracker},(function(e,r){e||!r.VersioningConfiguration&&(r.VersioningConfiguration={}),t(e,r)}))}function B(e,t){var r=i.clone(e.ReplicationConfiguration),o=i.json2xml({ReplicationConfiguration:r});o=o.replace(/<(\/?)Rules>/gi,"<$1Rule>"),o=o.replace(/<(\/?)Tags>/gi,"<$1Tag>");var n=e.Headers;n["Content-Type"]="application/xml",n["Content-MD5"]=i.b64(i.md5(o)),Ne.call(this,{Action:"name/cos:PutBucketReplication",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"replication",headers:n,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function O(e,t){Ne.call(this,{Action:"name/cos:GetBucketReplication",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication",tracker:e.tracker},(function(e,r){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!r.ReplicationConfiguration&&(r.ReplicationConfiguration={}),r.ReplicationConfiguration.Rule&&(r.ReplicationConfiguration.Rules=i.makeArray(r.ReplicationConfiguration.Rule),delete r.ReplicationConfiguration.Rule),t(e,r)}))}function E(e,t){Ne.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"replication",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function P(e,t){if(e["WebsiteConfiguration"]){var r=i.clone(e["WebsiteConfiguration"]||{}),o=r["RoutingRules"]||r["RoutingRule"]||[];o=i.isArray(o)?o:[o],delete r.RoutingRule,delete r.RoutingRules,o.length&&(r.RoutingRules={RoutingRule:o});var n=i.json2xml({WebsiteConfiguration:r}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.b64(i.md5(n)),Ne.call(this,{Action:"name/cos:PutBucketWebsite",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"website",headers:s,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}else t(i.error(new Error("missing param WebsiteConfiguration")))}function I(e,t){Ne.call(this,{Action:"name/cos:GetBucketWebsite",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"website",tracker:e.tracker},(function(e,r){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 n=r.WebsiteConfiguration||{};if(n["RoutingRules"]){var s=i.clone(n["RoutingRules"].RoutingRule||[]);s=i.makeArray(s),n.RoutingRules=s}t(null,{WebsiteConfiguration:n,statusCode:r.statusCode,headers:r.headers})}}))}function j(e,t){Ne.call(this,{Action:"name/cos:DeleteBucketWebsite",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"website",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function N(e,t){if(e["RefererConfiguration"]){var r=i.clone(e["RefererConfiguration"]||{}),o=r["DomainList"]||{},n=o["Domains"]||o["Domain"]||[];n=i.isArray(n)?n:[n],n.length&&(r.DomainList={Domain:n});var s=i.json2xml({RefererConfiguration:r}),a=e.Headers;a["Content-Type"]="application/xml",a["Content-MD5"]=i.b64(i.md5(s)),Ne.call(this,{Action:"name/cos:PutBucketReferer",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:s,action:"referer",headers:a,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}else t(i.error(new Error("missing param RefererConfiguration")))}function _(e,t){Ne.call(this,{Action:"name/cos:GetBucketReferer",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,action:"referer",tracker:e.tracker},(function(e,r){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 n=r.RefererConfiguration||{};if(n["DomainList"]){var s=i.makeArray(n["DomainList"].Domain||[]);n.DomainList={Domains:s}}t(null,{RefererConfiguration:n,statusCode:r.statusCode,headers:r.headers})}}))}function U(e,t){var r=e["DomainConfiguration"]||{},o=r.DomainRule||e.DomainRule||[];o=i.clone(o);var n=i.json2xml({DomainConfiguration:{DomainRule:o}}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.b64(i.md5(n)),Ne.call(this,{Action:"name/cos:PutBucketDomain",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"domain",headers:s,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function M(e,t){Ne.call(this,{Action:"name/cos:GetBucketDomain",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain",tracker:e.tracker},(function(e,r){if(e)return t(e);var o=[];try{o=r.DomainConfiguration.DomainRule||[]}catch(n){}o=i.clone(i.isArray(o)?o:[o]),t(null,{DomainRule:o,statusCode:r.statusCode,headers:r.headers})}))}function L(e,t){Ne.call(this,{Action:"name/cos:DeleteBucketDomain",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"domain",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function H(e,t){var r=e["OriginConfiguration"]||{},o=r.OriginRule||e.OriginRule||[];o=i.clone(o);var n=i.json2xml({OriginConfiguration:{OriginRule:o}}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.b64(i.md5(n)),Ne.call(this,{Action:"name/cos:PutBucketOrigin",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"origin",headers:s,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function D(e,t){Ne.call(this,{Action:"name/cos:GetBucketOrigin",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin",tracker:e.tracker},(function(e,r){if(e)return t(e);var o=[];try{o=r.OriginConfiguration.OriginRule||[]}catch(n){}o=i.clone(i.isArray(o)?o:[o]),t(null,{OriginRule:o,statusCode:r.statusCode,headers:r.headers})}))}function F(e,t){Ne.call(this,{Action:"name/cos:DeleteBucketOrigin",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"origin",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function K(e,t){var r=i.json2xml({BucketLoggingStatus:e["BucketLoggingStatus"]||""}),o=e.Headers;o["Content-Type"]="application/xml",o["Content-MD5"]=i.b64(i.md5(r)),Ne.call(this,{Action:"name/cos:PutBucketLogging",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:r,action:"logging",headers:o,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function z(e,t){Ne.call(this,{Action:"name/cos:GetBucketLogging",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"logging",tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,{BucketLoggingStatus:r.BucketLoggingStatus,statusCode:r.statusCode,headers:r.headers})}))}function W(e,t,r){var o=i.clone(t["InventoryConfiguration"]);if(o.OptionalFields){var n=o.OptionalFields||[];o.OptionalFields={Field:n}}if(o.Destination&&o.Destination.COSBucketDestination&&o.Destination.COSBucketDestination.Encryption){var s=o.Destination.COSBucketDestination.Encryption;Object.keys(s).indexOf("SSECOS")>-1&&(s["SSE-COS"]=s["SSECOS"],delete s["SSECOS"])}var a=i.json2xml({InventoryConfiguration:o}),c=t.Headers;c["Content-Type"]="application/xml",c["Content-MD5"]=i.b64(i.md5(a));var u="PUT"===e?"name/cos:PutBucketInventory":"name/cos:PostBucketInventory";Ne.call(this,{Action:u,method:e,Bucket:t.Bucket,Region:t.Region,body:a,action:"inventory",qs:{id:t["Id"]},headers:c,tracker:t.tracker},(function(e,t){return e&&204===e.statusCode?r(null,{statusCode:e.statusCode}):e?r(e):void r(null,{statusCode:t.statusCode,headers:t.headers})}))}function X(e,t){return W.call(this,"PUT",e,t)}function q(e,t){return W.call(this,"POST",e,t)}function V(e,t){Ne.call(this,{Action:"name/cos:GetBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e["Id"]},tracker:e.tracker},(function(e,r){if(e)return t(e);var o=r["InventoryConfiguration"];if(o&&o.OptionalFields&&o.OptionalFields.Field){var n=o.OptionalFields.Field;i.isArray(n)||(n=[n]),o.OptionalFields=n}if(o.Destination&&o.Destination.COSBucketDestination&&o.Destination.COSBucketDestination.Encryption){var s=o.Destination.COSBucketDestination.Encryption;Object.keys(s).indexOf("SSE-COS")>-1&&(s["SSECOS"]=s["SSE-COS"],delete s["SSE-COS"])}t(null,{InventoryConfiguration:o,statusCode:r.statusCode,headers:r.headers})}))}function Y(e,t){Ne.call(this,{Action:"name/cos:ListBucketInventory",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{"continuation-token":e["ContinuationToken"]},tracker:e.tracker},(function(e,r){if(e)return t(e);var o=r["ListInventoryConfigurationResult"],n=o.InventoryConfiguration||[];n=i.isArray(n)?n:[n],delete o["InventoryConfiguration"],i.each(n,(function(e){if(e&&e.OptionalFields&&e.OptionalFields.Field){var t=e.OptionalFields.Field;i.isArray(t)||(t=[t]),e.OptionalFields=t}if(e.Destination&&e.Destination.COSBucketDestination&&e.Destination.COSBucketDestination.Encryption){var r=e.Destination.COSBucketDestination.Encryption;Object.keys(r).indexOf("SSE-COS")>-1&&(r["SSECOS"]=r["SSE-COS"],delete r["SSE-COS"])}})),o.InventoryConfigurations=n,i.extend(o,{statusCode:r.statusCode,headers:r.headers}),t(null,o)}))}function G(e,t){Ne.call(this,{Action:"name/cos:DeleteBucketInventory",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"inventory",qs:{id:e["Id"]},tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function $(e,t){if(e["AccelerateConfiguration"]){var r={AccelerateConfiguration:e.AccelerateConfiguration||{}},o=i.json2xml(r),n={"Content-Type":"application/xml"};n["Content-MD5"]=i.b64(i.md5(o)),Ne.call(this,{Action:"name/cos:PutBucketAccelerate",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:o,action:"accelerate",headers:n,tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,{statusCode:r.statusCode,headers:r.headers})}))}else t(i.error(new Error("missing param AccelerateConfiguration")))}function Q(e,t){Ne.call(this,{Action:"name/cos:GetBucketAccelerate",method:"GET",Bucket:e.Bucket,Region:e.Region,action:"accelerate",tracker:e.tracker},(function(e,r){e||!r.AccelerateConfiguration&&(r.AccelerateConfiguration={}),t(e,r)}))}function J(e,t){var r=e.ServerSideEncryptionConfiguration||{},o=r.Rule||r.Rules||[],n=i.json2xml({ServerSideEncryptionConfiguration:{Rule:o}}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.b64(i.md5(n)),Ne.call(this,{Action:"name/cos:PutBucketEncryption",method:"PUT",Bucket:e.Bucket,Region:e.Region,body:n,action:"encryption",headers:s,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function Z(e,t){Ne.call(this,{Action:"name/cos:GetBucketEncryption",method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption",tracker:e.tracker},(function(e,r){if(e)if(404===e.statusCode&&"NoSuchEncryptionConfiguration"===e.code){var o={EncryptionConfiguration:{Rules:[]},statusCode:e.statusCode};e.headers&&(o.headers=e.headers),t(null,o)}else t(e);else{var n=i.makeArray(r.EncryptionConfiguration&&r.EncryptionConfiguration.Rule||[]);r.EncryptionConfiguration={Rules:n},t(e,r)}}))}function ee(e,t){Ne.call(this,{Action:"name/cos:DeleteBucketReplication",method:"DELETE",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,action:"encryption",tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function te(e,t){Ne.call(this,{Action:"name/cos:HeadObject",method:"HEAD",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,headers:e.Headers,tracker:e.tracker},(function(r,o){if(r){var n=r.statusCode;return e.Headers["If-Modified-Since"]&&n&&304===n?t(null,{NotModified:!0,statusCode:n}):t(r)}o.ETag=i.attr(o.headers,"etag",""),t(null,o)}))}function re(e,t){var r={};r["prefix"]=e["Prefix"]||"",r["delimiter"]=e["Delimiter"],r["key-marker"]=e["KeyMarker"],r["version-id-marker"]=e["VersionIdMarker"],r["max-keys"]=e["MaxKeys"],r["encoding-type"]=e["EncodingType"],Ne.call(this,{Action:"name/cos:GetBucketObjectVersions",ResourceKey:r["prefix"],method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:r,action:"versions",tracker:e.tracker},(function(e,r){if(e)return t(e);var o=r.ListVersionsResult||{},n=o.DeleteMarker||[];n=i.isArray(n)?n:[n];var s=o.Version||[];s=i.isArray(s)?s:[s];var a=i.clone(o);delete a.DeleteMarker,delete a.Version,i.extend(a,{DeleteMarkers:n,Versions:s,statusCode:r.statusCode,headers:r.headers}),t(null,a)}))}function oe(e,t){if(this.options.ObjectKeySimplifyCheck){var r=i.simplifyPath(e.Key);if("/"===r)return void t(i.error(new Error("The Getobject Key is illegal")))}var o=e.Query||{},n=e.QueryString||"",s=i.throttleOnProgress.call(this,0,e.onProgress),a=e.tracker;a&&a.setParams({signStartTime:(new Date).getTime()}),o["response-content-type"]=e["ResponseContentType"],o["response-content-language"]=e["ResponseContentLanguage"],o["response-expires"]=e["ResponseExpires"],o["response-cache-control"]=e["ResponseCacheControl"],o["response-content-disposition"]=e["ResponseContentDisposition"],o["response-content-encoding"]=e["ResponseContentEncoding"],Ne.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:o,qsStr:n,rawBody:!0,onDownloadProgress:s,tracker:a},(function(r,o){if(s(null,!0),r){var n=r.statusCode;return e.Headers["If-Modified-Since"]&&n&&304===n?t(null,{NotModified:!0}):t(r)}t(null,{Body:o.body,ETag:i.attr(o.headers,"etag",""),statusCode:o.statusCode,headers:o.headers})}))}function ne(e,t){var r=this,o=e.ContentLength,n=i.throttleOnProgress.call(r,o,e.onProgress),s=e.Headers;s["Cache-Control"]||s["cache-control"]||(s["Cache-Control"]=""),s["Content-Type"]||s["content-type"]||(s["Content-Type"]=e.Body&&e.Body.type||"");var a=e.UploadAddMetaMd5||r.options.UploadAddMetaMd5||r.options.UploadCheckContentMd5,c=e.tracker;a&&c&&c.setParams({md5StartTime:(new Date).getTime()}),i.getBodyMd5(a,e.Body,(function(a){a&&(c&&c.setParams({md5EndTime:(new Date).getTime()}),r.options.UploadCheckContentMd5&&(s["Content-MD5"]=i.b64(a)),(e.UploadAddMetaMd5||r.options.UploadAddMetaMd5)&&(s["x-cos-meta-md5"]=a)),void 0!==e.ContentLength&&(s["Content-Length"]=e.ContentLength),n(null,!0),Ne.call(r,{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:n,tracker:c},(function(s,a){if(s)return n(null,!0),t(s);n({loaded:o,total:o},!0);var c=Oe({ForcePathStyle:r.options.ForcePathStyle,protocol:r.options.Protocol,domain:r.options.Domain,bucket:e.Bucket,region:r.options.UseAccelerate?"accelerate":e.Region,object:e.Key});c=c.substr(c.indexOf("://")+3),a.Location=c,a.ETag=i.attr(a.headers,"etag",""),t(null,a)}))}),e.onHashProgress)}function ie(e,t){Ne.call(this,{Action:"name/cos:DeleteObject",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,VersionId:e.VersionId,action:e.Recursive?"recursive":"",tracker:e.tracker},(function(e,r){if(e){var o=e.statusCode;return o&&404===o?t(null,{BucketNotFound:!0,statusCode:o}):t(e)}t(null,{statusCode:r.statusCode,headers:r.headers})}))}function se(e,t){var r={};e.VersionId&&(r.versionId=e.VersionId),Ne.call(this,{Action:"name/cos:GetObjectACL",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:r,action:"acl",tracker:e.tracker},(function(e,r){if(e)return t(e);var o=r.AccessControlPolicy||{},n=o.Owner||{},s=o.AccessControlList&&o.AccessControlList.Grant||[];s=i.isArray(s)?s:[s];var a=Re(o);delete a.GrantWrite,r.headers&&r.headers["x-cos-acl"]&&(a.ACL=r.headers["x-cos-acl"]),a=i.extend(a,{Owner:n,Grants:s,statusCode:r.statusCode,headers:r.headers}),t(null,a)}))}function ae(e,t){var r=e.Headers,o="";if(e["AccessControlPolicy"]){var n=i.clone(e["AccessControlPolicy"]||{}),s=n.Grants||n.Grant;s=i.isArray(s)?s:[s],delete n.Grant,delete n.Grants,n.AccessControlList={Grant:s},o=i.json2xml({AccessControlPolicy:n}),r["Content-Type"]="application/xml",r["Content-MD5"]=i.b64(i.md5(o))}i.each(r,(function(e,t){0===t.indexOf("x-cos-grant-")&&(r[t]=Be(r[t]))})),Ne.call(this,{Action:"name/cos:PutObjectACL",method:"PUT",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"acl",headers:r,body:o,tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,{statusCode:r.statusCode,headers:r.headers})}))}function ce(e,t){var r=e.Headers;r["Origin"]=e["Origin"],r["Access-Control-Request-Method"]=e["AccessControlRequestMethod"],r["Access-Control-Request-Headers"]=e["AccessControlRequestHeaders"],Ne.call(this,{Action:"name/cos:OptionsObject",method:"OPTIONS",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:r,tracker:e.tracker},(function(e,r){if(e)return e.statusCode&&403===e.statusCode?t(null,{OptionsForbidden:!0,statusCode:e.statusCode}):t(e);var o=r.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:r.statusCode,headers:r.headers})}))}function ue(e,t){var r=this,o=e.Headers;o["Cache-Control"]||o["cache-control"]||(o["Cache-Control"]="");var n=e.CopySource||"",s=i.getSourceParams.call(this,n);if(s){var a=s.Bucket,c=s.Region,u=decodeURIComponent(s.Key);Ne.call(this,{Scope:[{action:"name/cos:GetObject",bucket:a,region:c,prefix:u},{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,tracker:e.tracker},(function(o,n){if(o)return t(o);var s=i.clone(n.CopyObjectResult||{}),a=Oe({ForcePathStyle:r.options.ForcePathStyle,protocol:r.options.Protocol,domain:r.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key,isLocation:!0});i.extend(s,{Location:a,statusCode:n.statusCode,headers:n.headers}),t(null,s)}))}else t(i.error(new Error("CopySource format error")))}function le(e,t){var r=e.CopySource||"",o=i.getSourceParams.call(this,r);if(o){var n=o.Bucket,s=o.Region,a=decodeURIComponent(o.Key);Ne.call(this,{Scope:[{action:"name/cos:GetObject",bucket:n,region:s,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,tracker:e.tracker},(function(e,r){if(e)return t(e);var o=i.clone(r.CopyPartResult||{});i.extend(o,{statusCode:r.statusCode,headers:r.headers}),t(null,o)}))}else t(i.error(new Error("CopySource format error")))}function de(e,t){var r=e.Objects||[],o=e.Quiet;r=i.isArray(r)?r:[r];var n=i.json2xml({Delete:{Object:r,Quiet:o||!1}}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.b64(i.md5(n));var a=i.map(r,(function(t){return{action:"name/cos:DeleteObject",bucket:e.Bucket,region:e.Region,prefix:t.Key}}));Ne.call(this,{Scope:a,method:"POST",Bucket:e.Bucket,Region:e.Region,body:n,action:"delete",headers:s,tracker:e.tracker},(function(e,r){if(e)return t(e);var o=r.DeleteResult||{},n=o.Deleted||[],s=o.Error||[];n=i.isArray(n)?n:[n],s=i.isArray(s)?s:[s];var a=i.clone(o);i.extend(a,{Error:s,Deleted:n,statusCode:r.statusCode,headers:r.headers}),t(null,a)}))}function pe(e,t){var r=e.Headers;if(e["RestoreRequest"]){var o=e.RestoreRequest||{},n=i.json2xml({RestoreRequest:o});r["Content-Type"]="application/xml",r["Content-MD5"]=i.b64(i.md5(n)),Ne.call(this,{Action:"name/cos:RestoreObject",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,VersionId:e.VersionId,body:n,action:"restore",headers:r,tracker:e.tracker},t)}else t(i.error(new Error("missing param RestoreRequest")))}function he(e,t){var r=e["Tagging"]||{},o=r.TagSet||r.Tags||e["Tags"]||[];o=i.clone(i.isArray(o)?o:[o]);var n=i.json2xml({Tagging:{TagSet:{Tag:o}}}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.b64(i.md5(n)),Ne.call(this,{Action:"name/cos:PutObjectTagging",method:"PUT",Bucket:e.Bucket,Key:e.Key,Region:e.Region,body:n,action:"tagging",headers:s,VersionId:e.VersionId,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function fe(e,t){Ne.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,tracker:e.tracker},(function(e,r){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 n=[];try{n=r.Tagging.TagSet.Tag||[]}catch(s){}n=i.clone(i.isArray(n)?n:[n]),t(null,{Tags:n,statusCode:r.statusCode,headers:r.headers})}}))}function ge(e,t){Ne.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,tracker:e.tracker},(function(e,r){return e&&204===e.statusCode?t(null,{statusCode:e.statusCode}):e?t(e):void t(null,{statusCode:r.statusCode,headers:r.headers})}))}function me(e,t){var r=e["SelectType"];if(!r)return t(i.error(new Error("missing param SelectType")));var o=e["SelectRequest"]||{},n=i.json2xml({SelectRequest:o}),s=e.Headers;s["Content-Type"]="application/xml",s["Content-MD5"]=i.b64(i.md5(n)),Ne.call(this,{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:n,DataType:"arraybuffer",rawBody:!0,tracker:e.tracker},(function(e,r){if(e&&204===e.statusCode)return t(null,{statusCode:e.statusCode});if(e)return t(e);var o=i.parseSelectPayload(r.body);t(null,{statusCode:r.statusCode,headers:r.headers,Body:o.body,Payload:o.payload})}))}function ye(e,t){var r=this,o=e.Headers,n=e.tracker;o["Cache-Control"]||o["cache-control"]||(o["Cache-Control"]=""),o["Content-Type"]||o["content-type"]||(o["Content-Type"]=e.Body&&e.Body.type||"");var s=e.Body&&(e.UploadAddMetaMd5||r.options.UploadAddMetaMd5);s&&n&&n.setParams({md5StartTime:(new Date).getTime()}),i.getBodyMd5(s,e.Body,(function(o){o&&(e.Headers["x-cos-meta-md5"]=o),s&&n&&n.setParams({md5EndTime:(new Date).getTime()}),Ne.call(r,{Action:"name/cos:InitiateMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:"uploads",headers:e.Headers,qs:e.Query,tracker:n},(function(e,r){return e?(n&&n.parent&&n.parent.setParams({errorNode:"multipartInit"}),t(e)):(r=i.clone(r||{}),r&&r.InitiateMultipartUploadResult?t(null,i.extend(r.InitiateMultipartUploadResult,{statusCode:r.statusCode,headers:r.headers})):void t(null,r))}))}),e.onHashProgress)}function ve(e,t){var r=this;i.getFileSize("multipartUpload",e,(function(){var o=e.tracker,n=r.options.UploadCheckContentMd5;n&&o&&o.setParams({md5StartTime:(new Date).getTime()}),i.getBodyMd5(n,e.Body,(function(s){s&&(e.Headers["Content-MD5"]=i.b64(s)),n&&o&&o.setParams({md5EndTime:(new Date).getTime()}),o&&o.setParams({partNumber:e.PartNumber}),Ne.call(r,{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,tracker:o},(function(e,r){if(e)return o&&o.parent&&o.parent.setParams({errorNode:"multipartUpload"}),t(e);t(null,{ETag:i.attr(r.headers,"etag",""),statusCode:r.statusCode,headers:r.headers})}))}))}))}function Ce(e,t){for(var r=this,o=e.UploadId,n=e["Parts"],s=e.tracker,a=0,c=n.length;a<c;a++)n[a]["ETag"]&&0===n[a]["ETag"].indexOf('"')||(n[a]["ETag"]='"'+n[a]["ETag"]+'"');var u=i.json2xml({CompleteMultipartUpload:{Part:n}});u=u.replace(/\n\s*/g,"");var l=e.Headers;l["Content-Type"]="application/xml",l["Content-MD5"]=i.b64(i.md5(u)),Ne.call(this,{Action:"name/cos:CompleteMultipartUpload",method:"POST",Bucket:e.Bucket,Region:e.Region,Key:e.Key,qs:{uploadId:o},body:u,headers:l,tracker:s},(function(o,n){if(o)return s&&s.parent&&s.parent.setParams({errorNode:"multipartComplete"}),t(o);var a=Oe({ForcePathStyle:r.options.ForcePathStyle,protocol:r.options.Protocol,domain:r.options.Domain,bucket:e.Bucket,region:e.Region,object:e.Key,isLocation:!0}),c=n.CompleteMultipartUploadResult||{};if(c.ProcessResults&&(c.UploadResult={OriginalInfo:{Key:c.Key,Location:a,ETag:c.ETag,ImageInfo:c.ImageInfo},ProcessResults:c.ProcessResults},delete c.ImageInfo,delete c.ProcessResults),c.CallbackResult){var u=c.CallbackResult;if("200"===u.Status&&u.CallbackBody)try{c.CallbackBody=JSON.parse(i.decodeBase64(u.CallbackBody))}catch(p){c.CallbackBody={}}else c.CallbackError=u.Error||{};delete c.CallbackResult}if(c.ReturnBodyResult){var l=c.ReturnBodyResult;if("200"===l.Status&&l.ReturnBody)try{c.ReturnBody=JSON.parse(i.decodeBase64(l.ReturnBody))}catch(p){c.ReturnBody={}}else c.ReturnError={Code:l.Code,Message:l.Message,Status:l.Status};delete c.ReturnBodyResult}var d=i.extend(c,{Location:a,statusCode:n.statusCode,headers:n.headers});t(null,d)}))}function ke(e,t){var r={};r["delimiter"]=e["Delimiter"],r["encoding-type"]=e["EncodingType"],r["prefix"]=e["Prefix"]||"",r["max-uploads"]=e["MaxUploads"],r["key-marker"]=e["KeyMarker"],r["upload-id-marker"]=e["UploadIdMarker"],r=i.clearKey(r);var o=e.tracker;o&&o.setParams({signStartTime:(new Date).getTime()}),Ne.call(this,{Action:"name/cos:ListMultipartUploads",ResourceKey:r["prefix"],method:"GET",Bucket:e.Bucket,Region:e.Region,headers:e.Headers,qs:r,action:"uploads",tracker:o},(function(e,r){if(e)return o&&o.parent&&o.parent.setParams({errorNode:"multipartList"}),t(e);if(r&&r.ListMultipartUploadsResult){var n=r.ListMultipartUploadsResult.Upload||[];n=i.isArray(n)?n:[n],r.ListMultipartUploadsResult.Upload=n}var s=i.clone(r.ListMultipartUploadsResult||{});i.extend(s,{statusCode:r.statusCode,headers:r.headers}),t(null,s)}))}function be(e,t){var r={},o=e.tracker;r["uploadId"]=e["UploadId"],r["encoding-type"]=e["EncodingType"],r["max-parts"]=e["MaxParts"],r["part-number-marker"]=e["PartNumberMarker"],Ne.call(this,{Action:"name/cos:ListParts",method:"GET",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:r,tracker:o},(function(e,r){if(e)return o&&o.parent&&o.parent.setParams({errorNode:"multipartListPart"}),t(e);var n=r.ListPartsResult||{},s=n.Part||[];s=i.isArray(s)?s:[s],n.Part=s;var a=i.clone(n);i.extend(a,{statusCode:r.statusCode,headers:r.headers}),t(null,a)}))}function xe(e,t){var r={};r["uploadId"]=e["UploadId"],Ne.call(this,{Action:"name/cos:AbortMultipartUpload",method:"DELETE",Bucket:e.Bucket,Region:e.Region,Key:e.Key,headers:e.Headers,qs:r,tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,{statusCode:r.statusCode,headers:r.headers})}))}function Se(e,t){Ne.call(this,{method:e.Method,Bucket:e.Bucket,Region:e.Region,Key:e.Key,action:e.Action,headers:e.Headers,qs:e.Query,body:e.Body,Url:e.Url,rawBody:e.RawBody,DataType:e.DataType,tracker:e.tracker},(function(e,r){if(e)return t(e);r&&r.body&&(r.Body=r.body,delete r.body),t(e,r)}))}function we(e,t){var r=e.Headers;r["Cache-Control"]||r["cache-control"]||(r["Cache-Control"]=""),r["Content-Type"]||r["content-type"]||(r["Content-Type"]=e.Body&&e.Body.type||""),Ne.call(this,{Action:"name/cos:AppendObject",method:"POST",Bucket:e.Bucket,Region:e.Region,action:"append",Key:e.Key,body:e.Body,qs:{position:e.Position},headers:e.Headers,tracker:e.tracker},(function(e,r){if(e)return t(e);t(null,r)}))}function Te(e){var t=this;return i.getAuth({SecretId:e.SecretId||this.options.SecretId||"",SecretKey:e.SecretKey||this.options.SecretKey||"",Bucket:e.Bucket,Region:e.Region,Method:e.Method,Key:e.Key,Query:e.Query,Headers:e.Headers,Expires:e.Expires,UseRawKey:t.options.UseRawKey,SystemClockOffset:t.options.SystemClockOffset})}function Ae(e,t){var r=this,o=void 0===e.UseAccelerate?r.options.UseAccelerate:e.UseAccelerate,n=Oe({ForcePathStyle:r.options.ForcePathStyle,protocol:e.Protocol||r.options.Protocol,domain:e.Domain||r.options.Domain,bucket:e.Bucket,region:o?"accelerate":e.Region,object:e.Key}),s="";e.Query&&(s+=i.obj2str(e.Query)),e.QueryString&&(s+=(s?"&":"")+e.QueryString);var a=n;if(void 0!==e.Sign&&!e.Sign)return s&&(a+="?"+s),t(null,{Url:a}),a;var c=Ee.call(this,{Bucket:e.Bucket,Region:e.Region,UseAccelerate:e.UseAccelerate,Url:n}),u=Pe.call(this,{Action:"PUT"===(e.Method||"").toUpperCase()?"name/cos:PutObject":"name/cos:GetObject",Bucket:e.Bucket||"",Region:e.Region||"",Method:e.Method||"get",Key:e.Key,Expires:e.Expires,Headers:e.Headers,Query:e.Query,SignHost:c,ForceSignHost:!1!==e.ForceSignHost&&r.options.ForceSignHost},(function(e,r){if(t)if(e)t(e);else{var o=function(e){var t=e.match(/q-url-param-list.*?(?=&)/g)[0],r="q-url-param-list="+encodeURIComponent(t.replace(/q-url-param-list=/,"")).toLowerCase(),o=new RegExp(t,"g"),n=e.replace(o,r);return n},i=n;i+="?"+(r.Authorization.indexOf("q-signature")>-1?o(r.Authorization):"sign="+encodeURIComponent(r.Authorization)),r.SecurityToken&&(i+="&x-cos-security-token="+r.SecurityToken),r.ClientIP&&(i+="&clientIP="+r.ClientIP),r.ClientUA&&(i+="&clientUA="+r.ClientUA),r.Token&&(i+="&token="+r.Token),s&&(i+="&"+s),setTimeout((function(){t(null,{Url:i})}))}}));return u?(a+="?"+u.Authorization+(u.SecurityToken?"&x-cos-security-token="+u.SecurityToken:""),s&&(a+="&"+s)):s&&(a+="?"+s),a}function Re(e){var t={GrantFullControl:[],GrantWrite:[],GrantRead:[],GrantReadAcp:[],GrantWriteAcp:[],ACL:""},r={FULL_CONTROL:"GrantFullControl",WRITE:"GrantWrite",READ:"GrantRead",READ_ACP:"GrantReadAcp",WRITE_ACP:"GrantWriteAcp"},o=e&&e.AccessControlList||{},n=o.Grant;n&&(n=i.isArray(n)?n:[n]);var s={READ:0,WRITE:0,FULL_CONTROL:0};return n&&n.length&&i.each(n,(function(o){var n=o.Grantee.URI&&o.Grantee.URI.endsWith("/groups/global/AllUsers");"qcs::cam::anyone:anyone"===o.Grantee.ID||n?s[o.Permission]=1:o.Grantee.ID!==e.Owner.ID&&t[r[o.Permission]].push('id="'+o.Grantee.ID+'"')})),s.FULL_CONTROL||s.WRITE&&s.READ?t.ACL="public-read-write":s.READ?t.ACL="public-read":t.ACL="private",i.each(r,(function(e){t[e]=Be(t[e].join(","))})),t}function Be(e){var t,r,o=e.split(","),n={};for(t=0;t<o.length;)r=o[t].trim(),n[r]?o.splice(t,1):(n[r]=!0,o[t]=r,t++);return o.join(",")}function Oe(e){var t=e.region||"",r=e.bucket||"",n=r.substr(0,r.lastIndexOf("-")),s=r.substr(r.lastIndexOf("-")+1),a=e.domain,c=e.object;"function"===typeof a&&(a=a({Bucket:r,Region:t})),["http","https"].includes(e.protocol)&&(e.protocol=e.protocol+":");var u=e.protocol||(i.isBrowser&&"object"===("undefined"===typeof location?"undefined":o(location))&&"http:"===location.protocol?"http:":"https:");a||(a=["cn-south","cn-south-2","cn-north","cn-east","cn-southwest","sg"].indexOf(t)>-1?"{Region}.myqcloud.com":"cos.{Region}.myqcloud.com",e.ForcePathStyle||(a="{Bucket}."+a)),a=a.replace(/\{\{AppId\}\}/gi,s).replace(/\{\{Bucket\}\}/gi,n).replace(/\{\{Region\}\}/gi,t).replace(/\{\{.*?\}\}/gi,""),a=a.replace(/\{AppId\}/gi,s).replace(/\{BucketName\}/gi,n).replace(/\{Bucket\}/gi,r).replace(/\{Region\}/gi,t).replace(/\{.*?\}/gi,""),/^[a-zA-Z]+:\/\//.test(a)||(a=u+"//"+a),"/"===a.slice(-1)&&(a=a.slice(0,-1));var l=a;return e.ForcePathStyle&&(l+="/"+r),l+="/",c&&(l+=i.camSafeUrlEncode(c).replace(/%2F/g,"/")),e.isLocation&&(l=l.replace(/^https?:\/\//,"")),l}var Ee=function(e){if(!e.Bucket||!e.Region)return"";var t=void 0===e.UseAccelerate?this.options.UseAccelerate:e.UseAccelerate,r=e.Url||Oe({ForcePathStyle:this.options.ForcePathStyle,protocol:this.options.Protocol,domain:this.options.Domain,bucket:e.Bucket,region:t?"accelerate":e.Region}),o=r.replace(/^https?:\/\/([^/]+)(\/.*)?$/,"$1");return o};function Pe(e,t){var r=i.clone(e.Headers),o="";i.each(r,(function(e,t){(""===e||["content-type","cache-control","expires"].indexOf(t.toLowerCase())>-1)&&delete r[t],"host"===t.toLowerCase()&&(o=e)}));var n=!1!==e.ForceSignHost;!o&&e.SignHost&&n&&(r.Host=e.SignHost);var s=!1,a=function(e,r){s||(s=!0,r&&r.XCosSecurityToken&&!r.SecurityToken&&(r=i.clone(r),r.SecurityToken=r.XCosSecurityToken,delete r.XCosSecurityToken),t&&t(e,r))},c=this,u=e.Bucket||"",l=e.Region||"",d=e.Key||"";c.options.ForcePathStyle&&u&&(d=u+"/"+d);var p="/"+d,h={},f=e.Scope;if(!f){var g=e.Action||"",m=e.ResourceKey||e.Key||"";f=e.Scope||[{action:g,bucket:u,region:l,prefix:m}]}var y=i.md5(JSON.stringify(f));c._StsCache=c._StsCache||[],function(){var e,t;for(e=c._StsCache.length-1;e>=0;e--){t=c._StsCache[e];var r=Math.round(i.getSkewTime(c.options.SystemClockOffset)/1e3)+30;if(t.StartTime&&r<t.StartTime||r>=t.ExpiredTime)c._StsCache.splice(e,1);else if(!t.ScopeLimit||t.ScopeLimit&&t.ScopeKey===y){h=t;break}}}();var v=function(){var t="";h.StartTime&&e.Expires?t=h.StartTime+";"+(h.StartTime+1*e.Expires):h.StartTime&&h.ExpiredTime&&(t=h.StartTime+";"+h.ExpiredTime);var o=i.getAuth({SecretId:h.TmpSecretId,SecretKey:h.TmpSecretKey,Method:e.Method,Pathname:p,Query:e.Query,Headers:r,Expires:e.Expires,UseRawKey:c.options.UseRawKey,SystemClockOffset:c.options.SystemClockOffset,KeyTime:t,ForceSignHost:n}),s={Authorization:o,SecurityToken:h.SecurityToken||h.XCosSecurityToken||"",Token:h.Token||"",ClientIP:h.ClientIP||"",ClientUA:h.ClientUA||"",SignFrom:"client"};a(null,s)},C=function(e){if(e.Authorization){var t=!1,r=e.Authorization;if(r)if(r.indexOf(" ")>-1)t=!1;else if(r.indexOf("q-sign-algorithm=")>-1&&r.indexOf("q-ak=")>-1&&r.indexOf("q-sign-time=")>-1&&r.indexOf("q-key-time=")>-1&&r.indexOf("q-url-param-list=")>-1)t=!0;else try{r=atob(r),r.indexOf("a=")>-1&&r.indexOf("k=")>-1&&r.indexOf("t=")>-1&&r.indexOf("r=")>-1&&r.indexOf("b=")>-1&&(t=!0)}catch(o){}if(!t)return i.error(new Error("getAuthorization callback params format error"))}else{if(!e.TmpSecretId)return i.error(new Error('getAuthorization callback params missing "TmpSecretId"'));if(!e.TmpSecretKey)return i.error(new Error('getAuthorization callback params missing "TmpSecretKey"'));if(!e.SecurityToken&&!e.XCosSecurityToken)return i.error(new Error('getAuthorization callback params missing "SecurityToken"'));if(!e.ExpiredTime)return i.error(new Error('getAuthorization callback params missing "ExpiredTime"'));if(e.ExpiredTime&&10!==e.ExpiredTime.toString().length)return i.error(new Error('getAuthorization callback params "ExpiredTime" should be 10 digits'));if(e.StartTime&&10!==e.StartTime.toString().length)return i.error(new Error('getAuthorization callback params "StartTime" should be 10 StartTime'))}return!1};if(h.ExpiredTime&&h.ExpiredTime-i.getSkewTime(c.options.SystemClockOffset)/1e3>60)v();else if(c.options.getAuthorization)c.options.getAuthorization.call(c,{Bucket:u,Region:l,Method:e.Method,Key:d,Pathname:p,Query:e.Query,Headers:r,Scope:f,SystemClockOffset:c.options.SystemClockOffset,ForceSignHost:n},(function(e){"string"===typeof e&&(e={Authorization:e});var t=C(e);if(t)return a(t);e.Authorization?a(null,e):(h=e||{},h.Scope=f,h.ScopeKey=y,c._StsCache.push(h),v())}));else{if(!c.options.getSTS)return function(){var t="";if(c.options.StartTime&&e.Expires){if(10!==c.options.StartTime.toString().length)return a(i.error(new Error('params "StartTime" should be 10 digits')));t=c.options.StartTime+";"+(c.options.StartTime+1*e.Expires)}else if(c.options.StartTime&&c.options.ExpiredTime){if(10!==c.options.StartTime.toString().length)return a(i.error(new Error('params "StartTime" should be 10 digits')));if(10!==c.options.ExpiredTime.toString().length)return a(i.error(new Error('params "ExpiredTime" should be 10 digits')));t=c.options.StartTime+";"+1*c.options.ExpiredTime}var o=i.getAuth({SecretId:e.SecretId||c.options.SecretId,SecretKey:e.SecretKey||c.options.SecretKey,Method:e.Method,Pathname:p,Query:e.Query,Headers:r,Expires:e.Expires,KeyTime:t,UseRawKey:c.options.UseRawKey,SystemClockOffset:c.options.SystemClockOffset,ForceSignHost:n}),s={Authorization:o,SecurityToken:c.options.SecurityToken||c.options.XCosSecurityToken,SignFrom:"client"};return a(null,s),s}();c.options.getSTS.call(c,{Bucket:u,Region:l},(function(e){h=e||{},h.Scope=f,h.ScopeKey=y,h.TmpSecretId||(h.TmpSecretId=h.SecretId),h.TmpSecretKey||(h.TmpSecretKey=h.SecretKey);var t=C(h);if(t)return a(t);c._StsCache.push(h),v()}))}return""}function Ie(e){var t=this,r=!1,o=!1,n=!1,s=e.headers&&(e.headers.date||e.headers.Date)||e.error&&e.error.ServerTime;try{var a=e.error.Code,c=e.error.Message;("RequestTimeTooSkewed"===a||"AccessDenied"===a&&"Request has expired"===c)&&(o=!0)}catch(l){}if(e)if(o&&s){var u=Date.parse(s);this.options.CorrectClockSkew&&Math.abs(i.getSkewTime(this.options.SystemClockOffset)-u)>=3e4&&(console.error("error: Local time is too skewed."),this.options.SystemClockOffset=u-Date.now(),r=!0)}else 5===Math.floor(e.statusCode/100)?r=!0:"CORS blocked or network error"===e.message&&(n=!0,r=t.options.AutoSwitchHost);return{canRetry:r,networkError:n}}function je(e){var t=e.requestUrl,r=e.clientCalcSign,o=e.networkError;if(!this.options.AutoSwitchHost)return!1;if(!t)return!1;if(!r)return!1;if(!o)return!1;var n=/^https?:\/\/[^\/]*\.cos\.[^\/]*\.myqcloud\.com(\/.*)?$/,i=/^https?:\/\/[^\/]*\.cos\.accelerate\.myqcloud\.com(\/.*)?$/,s=n.test(t)&&!i.test(t);return s}function Ne(e,t){var r=this;!e.headers&&(e.headers={}),!e.qs&&(e.qs={}),e.VersionId&&(e.qs.versionId=e.VersionId),e.qs=i.clearKey(e.qs),e.headers&&(e.headers=i.clearKey(e.headers)),e.qs&&(e.qs=i.clearKey(e.qs));var o=i.clone(e.qs);e.action&&(o[e.action]="");var n=e.url||e.Url,s=e.SignHost||Ee.call(this,{Bucket:e.Bucket,Region:e.Region,Url:n}),a=e.tracker,c=function n(i){var c=r.options.SystemClockOffset;a&&a.setParams({signStartTime:(new Date).getTime(),httpRetryTimes:i-1}),e.SwitchHost&&(s=s.replace(/myqcloud.com/,"tencentcos.cn")),Pe.call(r,{Bucket:e.Bucket||"",Region:e.Region||"",Method:e.method,Key:e.Key,Query:o,Headers:e.headers,SignHost:s,Action:e.Action,ResourceKey:e.ResourceKey,Scope:e.Scope,ForceSignHost:r.options.ForceSignHost,SwitchHost:e.SwitchHost},(function(o,s){o?t(o):(a&&a.setParams({signEndTime:(new Date).getTime(),httpStartTime:(new Date).getTime()}),e.AuthData=s,_e.call(r,e,(function(o,u){a&&a.setParams({httpEndTime:(new Date).getTime()});var l=!1,d=!1;if(o){var p=Ie.call(r,o);l=p.canRetry||c!==r.options.SystemClockOffset,d=p.networkError}if(o&&i<2&&l){e.headers&&(delete e.headers.Authorization,delete e.headers["token"],delete e.headers["clientIP"],delete e.headers["clientUA"],e.headers["x-cos-security-token"]&&delete e.headers["x-cos-security-token"],e.headers["x-ci-security-token"]&&delete e.headers["x-ci-security-token"]);var h=je.call(r,{requestUrl:(null===o||void 0===o?void 0:o.url)||"",clientCalcSign:"client"===s.SignFrom,networkError:d});e.SwitchHost=h,e.retry=!0,n(i+1)}else t(o,u)})))}))};c(1)}function _e(e,t){var r=this,o=e.TaskId;if(!o||r._isRunningTask(o)){var s=e.Bucket,a=e.Region,c=e.Key,u=e.method||"GET",l=e.Url||e.url,d=e.body,p=e.rawBody;r.options.UseAccelerate&&(a="accelerate"),l=l||Oe({ForcePathStyle:r.options.ForcePathStyle,protocol:r.options.Protocol,domain:r.options.Domain,bucket:s,region:a,object:c}),e.SwitchHost&&(l=l.replace(/myqcloud.com/,"tencentcos.cn"));var h=c?l:"";e.action&&(l=l+"?"+(i.isIOS_QQ?"".concat(e.action,"="):e.action)),e.qsStr&&(l=l.indexOf("?")>-1?l+"&"+e.qsStr:l+"?"+e.qsStr);var f={method:u,url:l,headers:e.headers,qs:e.qs,body:d},g="x-cos-security-token";if(i.isCIHost(l)&&(g="x-ci-security-token"),f.headers.Authorization=e.AuthData.Authorization,e.AuthData.Token&&(f.headers["token"]=e.AuthData.Token),e.AuthData.ClientIP&&(f.headers["clientIP"]=e.AuthData.ClientIP),e.AuthData.ClientUA&&(f.headers["clientUA"]=e.AuthData.ClientUA),e.AuthData.SecurityToken&&(f.headers[g]=e.AuthData.SecurityToken),e.Action&&(f.action=e.Action),f.key=e.Key||e.ResourceKey,f.headers&&(f.headers=i.clearKey(f.headers)),e.retry&&(f.headers["x-cos-sdk-retry"]=!0),f=i.clearKey(f),e.onProgress&&"function"===typeof e.onProgress){var m=d&&(d.size||d.length)||0;f.onProgress=function(t){if(!o||r._isRunningTask(o)){var n=t?t.loaded:0;e.onProgress({loaded:n,total:m})}}}e.onDownloadProgress&&(f.onDownloadProgress=e.onDownloadProgress),e.DataType&&(f.dataType=e.DataType),this.options.Timeout&&(f.timeout=this.options.Timeout),r.options.ForcePathStyle&&(f.pathStyle=r.options.ForcePathStyle),r.emit("before-send",f);var y,v=f.url.includes("accelerate."),C=f.qs?Object.keys(f.qs).map((function(e){return"".concat(e,"=").concat(f.qs[e])})).join("&"):"",k=C?f.url+"?"+C:f.url;if(e.tracker)e.tracker.setParams({url:k,httpMethod:f.method,accelerate:v,httpSize:(null===(y=f.body)||void 0===y?void 0:y.size)||0}),e.tracker.parent&&!e.tracker.parent.params.url&&e.tracker.parent.setParams({url:h,accelerate:v});var b=(r.options.Request||n)(f,(function(n){if(!n||"abort"!==n.error){var s={options:f,error:n&&n.error,statusCode:n&&n.statusCode||0,statusMessage:n&&n.statusMessage||"",headers:n&&n.headers||{},body:n&&n.body};r.emit("after-receive",s);var a,c=s.error,u=s.body,l={statusCode:s.statusCode,statusMessage:s.statusMessage,headers:s.headers},d=function(n,s){if(o&&r.off("inner-kill-task",x),!a){a=!0;var c={};if(l&&l.statusCode&&(c.statusCode=l.statusCode),l&&l.headers&&(c.headers=l.headers),n)f.url&&(c.url=f.url),f.method&&(c.method=f.method),n=i.extend(n||{},c),t(n,null);else{if("name/cos:PutObject"===e.Action){var u={};for(var d in e.headers){var p=d.toLowerCase();u[p]=e.headers[d]}u["x-cos-callback"]?s.Error?(s.CallbackError=i.clone(s.Error),delete s.Error):s.CallbackBody=i.clone(s):u["x-cos-return-body"]&&(s.Error?(s.ReturnError=i.clone(s.Error),delete s.Error):s.ReturnBody=i.clone(s))}s=i.extend(s||{},c),t(null,s)}b=null}};if(c)return d(i.error(c));var h=l.statusCode,g=2===Math.floor(h/100);if(p){if(g)return d(null,{body:u});if(u instanceof Blob)return void i.readAsBinaryString(u,(function(e){var t=i.parseResBody(e),r=t.Error||t;return d(i.error(new Error(r.Message||"response body error"),{code:r.Code,error:r}))}))}var m=i.parseResBody(u),y=m.Error||m;g?d(null,m):y?d(i.error(new Error(y.Message),{code:y.Code,error:y})):h?d(i.error(new Error(l.statusMessage),{code:""+h})):h&&d(i.error(new Error("statusCode error")))}})),x=function e(t){t.TaskId===o&&(b&&b.abort&&b.abort(),r.off("inner-kill-task",e))};o&&r.on("inner-kill-task",x)}}var Ue={getService:s,putBucket:a,headBucket:c,getBucket:u,deleteBucket:l,putBucketAcl:d,getBucketAcl:p,putBucketCors:h,getBucketCors:f,deleteBucketCors:g,getBucketLocation:m,getBucketPolicy:v,putBucketPolicy:y,deleteBucketPolicy:C,putBucketTagging:k,getBucketTagging:b,deleteBucketTagging:x,putBucketLifecycle:S,getBucketLifecycle:w,deleteBucketLifecycle:T,putBucketVersioning:A,getBucketVersioning:R,putBucketReplication:B,getBucketReplication:O,deleteBucketReplication:E,putBucketWebsite:P,getBucketWebsite:I,deleteBucketWebsite:j,putBucketReferer:N,getBucketReferer:_,putBucketDomain:U,getBucketDomain:M,deleteBucketDomain:L,putBucketOrigin:H,getBucketOrigin:D,deleteBucketOrigin:F,putBucketLogging:K,getBucketLogging:z,putBucketInventory:X,postBucketInventory:q,getBucketInventory:V,listBucketInventory:Y,deleteBucketInventory:G,putBucketAccelerate:$,getBucketAccelerate:Q,putBucketEncryption:J,getBucketEncryption:Z,deleteBucketEncryption:ee,getObject:oe,headObject:te,listObjectVersions:re,putObject:ne,deleteObject:ie,getObjectAcl:se,putObjectAcl:ae,optionsObject:ce,putObjectCopy:ue,deleteMultipleObject:de,restoreObject:pe,putObjectTagging:he,getObjectTagging:fe,deleteObjectTagging:ge,selectObjectContent:me,appendObject:we,uploadPartCopy:le,multipartInit:ye,multipartUpload:ve,multipartComplete:Ce,multipartList:ke,multipartListPart:be,multipartAbort:xe,request:Se,getObjectUrl:Ae,getAuth:Te};function Me(e,t,r){i.each(["Cors","Acl"],(function(o){if(e.slice(-o.length)===o){var n=e.slice(0,-o.length)+o.toUpperCase(),s=i.apiWrapper(e,t),a=!1;r[n]=function(){!a&&console.warn("warning: cos."+n+" has been deprecated. Please Use cos."+e+" instead."),a=!0,s.apply(this,arguments)}}}))}e.exports.init=function(e,t){t.transferToTaskMethod(Ue,"putObject"),i.each(Ue,(function(t,r){e.prototype[r]=i.apiWrapper(r,t),Me(r,t,e.prototype)}))}},"./src/cos.js":
/*!********************!*\
  !*** ./src/cos.js ***!
  \********************/
/*! no static exports found */function(e,t,r){"use strict";var o=r(/*! ./util */"./src/util.js"),n=r(/*! ./event */"./src/event.js"),i=r(/*! ./task */"./src/task.js"),s=r(/*! ./base */"./src/base.js"),a=r(/*! ./advance */"./src/advance.js"),c=r(/*! ../package.json */"./package.json"),u={AppId:"",SecretId:"",SecretKey:"",SecurityToken:"",StartTime:0,ExpiredTime:0,ChunkRetryTimes:2,FileParallelLimit:3,ChunkParallelLimit:3,ChunkSize:1048576,SliceSize:1048576,CopyChunkParallelLimit:20,CopyChunkSize:10485760,CopySliceSize:10485760,MaxPartNumber:1e4,ProgressInterval:1e3,Domain:"",ServiceDomain:"",Protocol:"",CompatibilityMode:!1,ForcePathStyle:!1,UseRawKey:!1,Timeout:0,CorrectClockSkew:!0,SystemClockOffset:0,UploadCheckContentMd5:!1,UploadQueueSize:1e4,UploadAddMetaMd5:!1,UploadIdCacheLimit:50,UseAccelerate:!1,ForceSignHost:!0,AutoSwitchHost:!0,CopySourceParser:null,ObjectKeySimplifyCheck:!0,DeepTracker:!1,TrackerDelay:5e3,CustomId:"",BeaconReporter:null,ClsReporter:null},l=function(e){if(this.options=o.extend(o.clone(u),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.EnableReporter=this.options.BeaconReporter||this.options.ClsReporter,this.options.AppId&&console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g: "test-1250000000").'),this.options.SecretId&&this.options.SecretId.indexOf(" ")>-1&&(console.error("error: SecretId格式错误，请检查"),console.error("error: SecretId format is incorrect. Please check")),this.options.SecretKey&&this.options.SecretKey.indexOf(" ")>-1&&(console.error("error: SecretKey格式错误，请检查"),console.error("error: SecretKey format is incorrect. Please check")),o.isNode()&&(console.log("Tip: Next.js、Nuxt.js 等服务端渲染技术可正常使用JavaScript SDK，请忽略下方 nodejs 环境警告"),console.warn("warning: cos-js-sdk-v5 不支持 nodejs 环境使用，请改用 cos-nodejs-sdk-v5，参考文档： https://cloud.tencent.com/document/product/436/8629"),console.warn("warning: cos-js-sdk-v5 does not support nodejs environment. Please use cos-nodejs-sdk-v5 instead. See: https://cloud.tencent.com/document/product/436/8629")),this.options.ForcePathStyle)throw console.warn("cos-js-sdk-v5不再支持使用path-style，仅支持使用virtual-hosted-style，参考文档：https://cloud.tencent.com/document/product/436/96243"),new Error("ForcePathStyle is not supported");n.init(this),i.init(this)};s.init(l,i),a.init(l,i),l.util={md5:o.md5,xml2json:o.xml2json,json2xml:o.json2xml,encodeBase64:o.encodeBase64},l.getAuthorization=o.getAuth,l.version=c.version,e.exports=l},"./src/event.js":
/*!**********************!*\
  !*** ./src/event.js ***!
  \**********************/
/*! no static exports found */function(e,t){var r=function(e){var t={},r=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.'),r(e).push(t)},e.off=function(e,t){for(var o=r(e),n=o.length-1;n>=0;n--)t===o[n]&&o.splice(n,1)},e.emit=function(e,t){for(var o=r(e).map((function(e){return e})),n=0;n<o.length;n++)o[n](t)}},o=function(){r(this)};e.exports.init=r,e.exports.EventProxy=o},"./src/session.js":
/*!************************!*\
  !*** ./src/session.js ***!
  \************************/
/*! no static exports found */function(e,t,r){var o,n,i=r(/*! ./util */"./src/util.js"),s="cos_sdk_upload_cache",a=2592e3,c=function(){try{var e=JSON.parse(localStorage.getItem(s))}catch(t){}e||(e=[]),o=e},u=function(){try{o.length?localStorage.setItem(s,JSON.stringify(o)):localStorage.removeItem(s)}catch(e){}},l=function(){if(!o){c.call(this);for(var e=!1,t=Math.round(Date.now()/1e3),r=o.length-1;r>=0;r--){var n=o[r][2];(!n||n+a<t)&&(o.splice(r,1),e=!0)}e&&u()}},d=function(){n||(n=setTimeout((function(){u(),n=null}),400))},p={using:{},setUsing:function(e){p.using[e]=!0},removeUsing:function(e){delete p.using[e]},getFileId:function(e,t,r,o){return e.name&&e.size&&e.lastModifiedDate&&t?i.md5([e.name,e.size,e.lastModifiedDate,t,r,o].join("::")):null},getCopyFileId:function(e,t,r,o,n){var s=t["content-length"],a=t.etag||"",c=t["last-modified"];return e&&r?i.md5([e,s,a,c,r,o,n].join("::")):null},getUploadIdList:function(e){if(!e)return null;l.call(this);for(var t=[],r=0;r<o.length;r++)o[r][0]===e&&t.push(o[r][1]);return t.length?t:null},saveUploadId:function(e,t,r){if(l.call(this),e){for(var n=o.length-1;n>=0;n--){var i=o[n];i[0]===e&&i[1]===t&&o.splice(n,1)}o.unshift([e,t,Math.round(Date.now()/1e3)]),o.length>r&&o.splice(r),d()}},removeUploadId:function(e){l.call(this),delete p.using[e];for(var t=o.length-1;t>=0;t--)o[t][1]===e&&o.splice(t,1);d()}};e.exports=p},"./src/task.js":
/*!*********************!*\
  !*** ./src/task.js ***!
  \*********************/
/*! no static exports found */function(e,t,r){var o=r(/*! ./session */"./src/session.js"),n=r(/*! ./util */"./src/util.js"),i={},s=function(e,t){i[t]=e[t],e[t]=function(e,r){e.SkipTask?i[t].call(this,e,r):this._addTask(t,e,r)}},a=function(e){var t=[],r={},s=0,a=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 r,o=function(){r=0,e.emit("task-list-update",{list:n.map(t,c)}),e.emit("list-update",{list:n.map(t,c)})};return function(){r||(r=setTimeout(o))}}(),l=function(){if(!(t.length<=e.options.UploadQueueSize)){for(var o=0;o<a&&o<t.length&&t.length>e.options.UploadQueueSize;){var n="waiting"===t[o].state||"checking"===t[o].state||"uploading"===t[o].state;t[o]&&n?o++:(r[t[o].id]&&delete r[t[o].id],t.splice(o,1),a--)}u()}},d=function r(){if(!(s>=e.options.FileParallelLimit)){while(t[a]&&"waiting"!==t[a].state)a++;if(!(a>=t.length)){var o=t[a];a++,s++,o.state="checking",o.params.onTaskStart&&o.params.onTaskStart(c(o)),!o.params.UploadData&&(o.params.UploadData={});var d=n.formatParams(o.api,o.params);i[o.api].call(e,d,(function(t,n){e._isRunningTask(o.id)&&("checking"!==o.state&&"uploading"!==o.state||(o.state=t?"error":"success",t&&(o.error=t),s--,u(),r(),o.callback&&o.callback(t,n),"success"===o.state&&(o.params&&(delete o.params.UploadData,delete o.params.Body,delete o.params),delete o.callback)),l())})),u(),setTimeout(r)}}},p=function(t,n){var i=r[t];if(i){var a=i&&"waiting"===i.state,c=i&&("checking"===i.state||"uploading"===i.state);if("canceled"===n&&"canceled"!==i.state||"paused"===n&&a||"paused"===n&&c){i.state=n,e.emit("inner-kill-task",{TaskId:t,toState:n});try{var p=i&&i.params&&i.params.UploadData.UploadId}catch(h){}"canceled"===n&&p&&o.removeUsing(p),u(),c&&(s--,d()),"canceled"===n&&(i.params&&(delete i.params.UploadData,delete i.params.Body,delete i.params),delete i.callback)}l()}};e._addTasks=function(t){n.each(t,(function(t){e._addTask(t.api,t.params,t.callback,!0)})),u()};var h=!0;e._addTask=function(o,i,s,a){i=n.formatParams(o,i);var c=n.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 p={params:i,callback:s,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},f=i.onHashProgress;i.onHashProgress=function(t){e._isRunningTask(p.id)&&(p.hashPercent=t.percent,f&&f(t),u())};var g=i.onProgress;return i.onProgress=function(t){e._isRunningTask(p.id)&&("checking"===p.state&&(p.state="uploading"),p.loaded=t.loaded,p.speed=t.speed,p.percent=t.percent,g&&g(t),u())},n.getFileSize(o,i,(function(e,o){if(e)return s(n.error(e));r[c]=p,t.push(p),p.size=o,!a&&u(),d(),l()})),c},e._isRunningTask=function(e){var t=r[e];return!(!t||"checking"!==t.state&&"uploading"!==t.state)},e.getTaskList=function(){return n.map(t,c)},e.cancelTask=function(e){p(e,"canceled")},e.pauseTask=function(e){p(e,"paused")},e.restartTask=function(e){var t=r[e];!t||"paused"!==t.state&&"error"!==t.state||(t.state="waiting",u(),a=Math.min(a,t.index),d())},e.isUploadRunning=function(){return s||a<t.length}};e.exports.transferToTaskMethod=s,e.exports.init=a},"./src/tracker.js":
/*!************************!*\
  !*** ./src/tracker.js ***!
  \************************/
/*! no static exports found */function(e,t,r){var o=r(/*! @babel/runtime/helpers/classCallCheck */"./node_modules/@babel/runtime/helpers/classCallCheck.js"),n=r(/*! @babel/runtime/helpers/createClass */"./node_modules/@babel/runtime/helpers/createClass.js"),i=r(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js"),s=r(/*! ../package.json */"./package.json"),a=null,c=function(e,t){if(!a){if("function"!==typeof e)throw new Error("Beacon not found");a=new e({appkey:"0WEB05PY6MHRGK0U",versionCode:s.version,channelID:"js_sdk",openid:"openid",unionid:"unid",strictMode:!1,delay:t,sessionDuration:6e4})}return a},u=function(e){return!e||e<0?0:(e/1e3).toFixed(3)},l={getUid:function(){var e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},getNetType:function(){if("object"===("undefined"===typeof navigator?"undefined":i(navigator))){var e=navigator.connection||navigator.mozConnection||navigator.webkitConnection;return(null===e||void 0===e?void 0:e.type)||(null===e||void 0===e?void 0:e.effectiveType)||"unknown"}return"unknown"},getProtocol:function(){return"object"===("undefined"===typeof location?"undefined":i(location))?location.protocol.replace(/:/,""):"unknown protocol"},getOsType:function(){if("object"!==("undefined"===typeof navigator?"undefined":i(navigator)))return"unknown os";var e=navigator.userAgent.toLowerCase(),t=/macintosh|mac os x/i.test(navigator.userAgent);return e.indexOf("win32")>=0||e.indexOf("wow32")>=0?"win32":e.indexOf("win64")>=0||e.indexOf("wow64")>=0?"win64":t?"mac":"unknown os"},isMobile:function(){var e=/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i;return!("object"!==("undefined"===typeof navigator?"undefined":i(navigator))||!navigator.userAgent.match(e))},isAndroid:function(){var e=/(Android|Adr|Linux)/i;return!("object"!==("undefined"===typeof navigator?"undefined":i(navigator))||!navigator.userAgent.match(e))},isIOS:function(){var e=/(iPhone|iPod|iPad|iOS)/i;return!("object"!==("undefined"===typeof navigator?"undefined":i(navigator))||!navigator.userAgent.match(e))},isOtherMobile:function(){return d&&!isAndroid&&!isIOS},getUA:function(){if("object"!==("undefined"===typeof navigator?"undefined":i(navigator)))return"unknown device";var e=navigator.userAgent;return e}},d=l.isMobile(),p=l.isAndroid()?"android":l.isIOS?"ios":"other_mobile",h=l.getOsType(),f=d?p:h,g=l.getUA(),m=l.getProtocol(),y=function(e){return["putObject","sliceUploadFile","uploadFile","uploadFiles"].includes(e)?"UploadTask":"getObject"===e?"DownloadTask":["putObjectCopy","sliceCopyFile"].includes(e)?"CopyTask":e};function v(e){return e.replace(/([A-Z])/g,"_$1").toLowerCase()}function C(e){var t={},r=["sdkVersionName","sdkVersionCode","osName","networkType","requestName","requestResult","bucket","region","appid","accelerate","url","host","requestPath","userAgent","networkProtocol","httpMethod","httpSize","httpSpeed","httpTookTime","httpMd5","httpSign","httpFullTime","httpDomain","partNumber","httpRetryTimes","customId","traceId","realApi"],o=[].concat(r,["errorNode","errorCode","errorName","errorMessage","errorRequestId","errorHttpCode","errorServiceName","errorType","fullError"]),n="Success"===e.requestResult?r:o;for(var i in e)if(n.includes(i)){var s=v(i);t[s]=e[i]}return t["request_name"]=e.realApi?y(e.realApi):e.requestName,t}var k=function(){"use strict";function e(t){o(this,e);var r=t.parent,n=t.traceId,i=t.bucket,a=t.region,u=t.apiName,d=t.realApi,p=t.httpMethod,h=t.fileKey,y=t.fileSize,v=t.accelerate,C=t.customId,k=t.delay,b=t.deepTracker,x=t.Beacon,S=t.clsReporter,w=i&&i.substr(i.lastIndexOf("-")+1)||"";this.parent=r,this.deepTracker=b,this.delay=k,S&&!this.clsReporter&&(this.clsReporter=S),this.params={sdkVersionName:"cos-js-sdk-v5",sdkVersionCode:s.version,osName:f,networkType:"",requestName:u||"",requestResult:"",realApi:d,bucket:i,region:a,accelerate:v,httpMethod:p,url:"",host:"",httpDomain:"",requestPath:h||"",userAgent:g,networkProtocol:m,errorType:"",errorCode:"",errorName:"",errorMessage:"",errorRequestId:"",errorHttpCode:0,errorServiceName:"",errorNode:"",httpTookTime:0,httpSize:y||0,httpMd5:0,httpSign:0,httpFullTime:0,httpSpeed:0,md5StartTime:0,md5EndTime:0,signStartTime:0,signEndTime:0,httpStartTime:0,httpEndTime:0,startTime:(new Date).getTime(),endTime:0,traceId:n||l.getUid(),appid:w,partNumber:0,httpRetryTimes:0,customId:C||"",partTime:0},x&&(this.beacon=c(x,k))}return n(e,[{key:"formatResult",value:function(e,t){var r,o,n,i,s,a,c=(new Date).getTime(),d=l.getNetType(),p=e?(null===e||void 0===e?void 0:e.code)||(null===e||void 0===e||null===(r=e.error)||void 0===r?void 0:r.code)||(null===e||void 0===e||null===(o=e.error)||void 0===o?void 0:o.Code):"",h=e?(null===e||void 0===e?void 0:e.message)||(null===e||void 0===e||null===(n=e.error)||void 0===n?void 0:n.message)||(null===e||void 0===e||null===(i=e.error)||void 0===i?void 0:i.Message):"",f=h,g=e?(null===e||void 0===e?void 0:e.resource)||(null===e||void 0===e||null===(s=e.error)||void 0===s?void 0:s.resource)||(null===e||void 0===e||null===(a=e.error)||void 0===a?void 0:a.Resource):"",m=e?null===e||void 0===e?void 0:e.statusCode:t.statusCode,y=e?(null===e||void 0===e?void 0:e.headers)&&(null===e||void 0===e?void 0:e.headers["x-cos-request-id"]):(null===t||void 0===t?void 0:t.headers)&&(null===t||void 0===t?void 0:t.headers["x-cos-request-id"]),v=e?y?"Server":"Client":"";"getObject"===this.params.requestName&&(this.params.httpSize=t?t.headers&&t.headers["content-length"]:0);var C="sliceUploadFile"===this.params.realApi,k="sliceCopyFile"===this.params.realApi;if(C||k){var b=this.params.httpSize/1024/this.params.partTime;Object.assign(this.params,{httpSpeed:b<0?0:b.toFixed(3)})}else{var x=c-this.params.startTime,S=this.params.httpEndTime-this.params.httpStartTime,w=this.params.httpSize/1024/(S/1e3),T=this.params.md5EndTime-this.params.md5StartTime,A=this.params.signEndTime-this.params.signStartTime;this.parent&&(this.parent.addParamValue("httpTookTime",u(S)),this.parent.addParamValue("httpFullTime",u(x)),this.parent.addParamValue("httpMd5",u(T)),this.parent.addParamValue("httpSign",u(A)),["multipartUpload","uploadPartCopy","putObjectCopy"].includes(this.params.requestName)&&this.parent.addParamValue("partTime",u(S))),Object.assign(this.params,{httpFullTime:u(x),httpMd5:u(T),httpSign:u(A),httpTookTime:u(S),httpSpeed:w<0?0:w.toFixed(3)})}if(Object.assign(this.params,{networkType:d,requestResult:e?"Failure":"Success",errorType:v,errorCode:p,errorHttpCode:m,errorName:f,errorMessage:h,errorServiceName:g,errorRequestId:y}),!e||p&&h||(this.params.fullError=e?JSON.stringify(e):""),this.params.url){try{var R=/^http(s)?:\/\/(.*?)\//.exec(this.params.url);this.params.host=R[2]}catch(B){this.params.host=this.params.url}this.params.httpDomain=this.params.host}}},{key:"report",value:function(e,t){if(this.beacon||this.clsReporter){this.formatResult(e,t);var r=C(this.params);this.beacon&&this.sendEventsToBeacon(r),this.clsReporter&&this.sendEventsToCLS(r)}}},{key:"setParams",value:function(e){Object.assign(this.params,e)}},{key:"addParamValue",value:function(e,t){this.params[e]=(+this.params[e]+ +t).toFixed(3)}},{key:"sendEventsToBeacon",value:function(e){var t="sliceUploadFile"===this.params.requestName||"sliceUploadFile"===this.params.realApi;if(!t||this.deepTracker){var r="qcloud_track_cos_sdk";0===this.delay?this.beacon&&this.beacon.onDirectUserAction(r,e):this.beacon&&this.beacon.onUserAction(r,e)}}},{key:"sendEventsToCLS",value:function(e){var t=!(0!==this.delay);this.clsReporter.log(e,t)}},{key:"generateSubTracker",value:function(t){return Object.assign(t,{parent:this,deepTracker:this.deepTracker,traceId:this.params.traceId,bucket:this.params.bucket,region:this.params.region,accelerate:this.params.accelerate,fileKey:this.params.requestPath,customId:this.params.customId,delay:this.delay,clsReporter:this.clsReporter}),new e(t)}}]),e}();e.exports=k},"./src/util.js":
/*!*********************!*\
  !*** ./src/util.js ***!
  \*********************/
/*! no static exports found */function(e,t,r){"use strict";(function(t){var o=r(/*! @babel/runtime/helpers/typeof */"./node_modules/@babel/runtime/helpers/typeof.js");function n(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=i(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var o=0,n=function(){};return{s:n,n:function(){return o>=e.length?{done:!0}:{done:!1,value:e[o++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,c=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){c=!0,s=e},f:function(){try{a||null==r.return||r.return()}finally{if(c)throw s}}}}function i(e,t){if(e){if("string"==typeof e)return s(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?s(e,t):void 0}}function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=Array(t);r<t;r++)o[r]=e[r];return o}var a=r(/*! ../lib/md5 */"./lib/md5.js"),c=r(/*! ../lib/crypto */"./lib/crypto.js"),u=r(/*! fast-xml-parser */"./node_modules/fast-xml-parser/src/fxp.js"),l=u.XMLParser,d=u.XMLBuilder,p=new l({ignoreDeclaration:!0,ignoreAttributes:!0,parseTagValue:!1}),h=new d,f=r(/*! ../lib/base64 */"./lib/base64.js"),g=r(/*! ./tracker */"./src/tracker.js"),m=function(e){var t=p.parse(e);return t},y=function(e){var t=h.build(e);return t};function v(e){return encodeURIComponent(e).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function C(e,t){var r=[];for(var o in e)e.hasOwnProperty(o)&&r.push(t?v(o).toLowerCase():o);return r.sort((function(e,t){return e=e.toLowerCase(),t=t.toLowerCase(),e===t?0:e>t?1:-1}))}var k=function(e,t){var r,o,n,i=[],s=C(e);for(r=0;r<s.length;r++)o=s[r],n=void 0===e[o]||null===e[o]?"":""+e[o],o=t?v(o).toLowerCase():v(o),n=v(n)||"",i.push(o+"="+n);return i.join("&")},b=["cache-control","content-disposition","content-encoding","content-length","content-md5","expect","expires","host","if-match","if-modified-since","if-none-match","if-unmodified-since","origin","range","transfer-encoding","pic-operations"],x=function(e){var t={};for(var r in e){var o=r.toLowerCase();(o.indexOf("x-cos-")>-1||b.indexOf(o)>-1)&&(t[r]=e[r])}return t},S=function(e){e=e||{};var t,r=e.SecretId,o=e.SecretKey,n=e.KeyTime,i=(e.method||e.Method||"get").toLowerCase(),s=U(e.Query||e.params||{}),a=x(U(e.Headers||e.headers||{})),u=e.Key||"";e.UseRawKey?t=e.Pathname||e.pathname||"/"+u:(t=e.Pathname||e.pathname||u,0!==t.indexOf("/")&&(t="/"+t));var l=!1!==e.ForceSignHost;if(!a.Host&&!a.host&&e.Bucket&&e.Region&&l&&(a.Host=e.Bucket+".cos."+e.Region+".myqcloud.com"),!r)throw new Error("missing param SecretId");if(!o)throw new Error("missing param SecretKey");var d=Math.round(J(e.SystemClockOffset)/1e3)-1,p=d,h=e.Expires||e.expires;p+=void 0===h?900:1*h||0;var f="sha1",g=r,m=n||d+";"+p,y=n||d+";"+p,v=C(a,!0).join(";").toLowerCase(),k=C(s,!0).join(";").toLowerCase(),b=c.HmacSHA1(y,o).toString(),S=[i,t,ue.obj2str(s,!0),ue.obj2str(a,!0),""].join("\n"),w=["sha1",m,c.SHA1(S).toString(),""].join("\n"),T=c.HmacSHA1(w,b).toString(),A=["q-sign-algorithm="+f,"q-ak="+g,"q-sign-time="+m,"q-key-time="+y,"q-header-list="+v,"q-url-param-list="+k,"q-signature="+T].join("&");return A},w=function(e,t,r){var o=t/8,n=e.slice(r,r+o);return new Uint8Array(n).reverse(),new{8:Uint8Array,16:Uint16Array,32:Uint32Array}[t](n)[0]},T=function(e,t,r,o){var n=e.slice(t,r),i="";return new Uint8Array(n).forEach((function(e){i+=String.fromCharCode(e)})),o&&(i=decodeURIComponent(escape(i))),i},A=function(e){var t={},r=T(e),o={records:[]};while(e.byteLength){var n,i=w(e,32,0),s=w(e,32,4),a=i-s-16,c=0;e=e.slice(12);while(c<s){var u=w(e,8,c),l=T(e,c+1,c+1+u),d=w(e,16,c+u+2),p=T(e,c+u+4,c+u+4+d);t[l]=p,c+=u+4+d}if("Records"===t[":event-type"])n=T(e,c,c+a,!0),o.records.push(n);else if("Stats"===t[":event-type"])n=T(e,c,c+a,!0),o.stats=ue.xml2json(n).Stats;else if("error"===t[":event-type"]){var h=t[":error-code"],f=t[":error-message"],g=new Error(f);g.message=f,g.name=g.code=h,o.error=g}else["Progress","Continuation","End"].includes(t[":event-type"]);e=e.slice(c+a+4)}return{payload:o.records.join(""),body:r}},R=function(e){var t=this.options.CopySourceParser;if(t)return t(e);var r=e.match(/^([^.]+-\d+)\.cos(v6|-cdc|-cdz|-internal)?\.([^.]+)\.((myqcloud\.com)|(tencentcos\.cn))\/(.+)$/);return r?{Bucket:r[1],Region:r[3],Key:r[7]}:null},B=function(){},O=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&void 0!==e[r]&&null!==e[r]&&(t[r]=e[r]);return t},E=function(e,t){var r,o=new FileReader;FileReader.prototype.readAsBinaryString?(r=FileReader.prototype.readAsBinaryString,o.onload=function(){t(this.result)}):FileReader.prototype.readAsArrayBuffer?r=function(e){var r="",o=new FileReader;o.onload=function(e){for(var n=new Uint8Array(o.result),i=n.byteLength,s=0;s<i;s++)r+=String.fromCharCode(n[s]);t(r)},o.readAsArrayBuffer(e)}:console.error("FileReader not support readAsBinaryString"),r.call(o,e)},P=function(){var e=function(e,t){e=e.split("."),t=t.split(".");for(var r=0;r<t.length;r++)if(e[r]!==t[r])return parseInt(e[r])>parseInt(t[r])?1:-1;return 0},t=function(t){if(!t)return!1;var r=(t.match(/Chrome\/([.\d]+)/)||[])[1],o=(t.match(/QBCore\/([.\d]+)/)||[])[1],n=(t.match(/QQBrowser\/([.\d]+)/)||[])[1],i=r&&e(r,"53.0.2785.116")<0&&o&&e(o,"3.53.991.400")<0&&n&&e(n,"9.0.2524.400")<=0||!1;return i};return t("undefined"!==typeof navigator&&navigator.userAgent)}(),I=function(e,t,r,o,n){var i;if(e.slice?i=e.slice(t,r):e.mozSlice?i=e.mozSlice(t,r):e.webkitSlice&&(i=e.webkitSlice(t,r)),o&&P){var s=new FileReader;s.onload=function(e){i=null,n(new Blob([s.result]))},s.readAsArrayBuffer(i)}else n(i)},j=function(e,t,r,o){r=r||B,e?"string"===typeof t?r(ue.md5(t,!0)):Blob&&t instanceof Blob?ue.getFileMd5(t,(function(e,t){r(t)}),o):r():r()},N=1048576,_=function(e,t,r){var o=e.size,n=0,i=a.getCtx(),s=function s(a){if(a>=o){var c=i.digest("hex");t(null,c)}else{var u=Math.min(o,a+N);ue.fileSlice(e,a,u,!1,(function(e){E(e,(function(t){e=null,i=i.update(t,!0),n+=t.length,t=null,r&&r({loaded:n,total:o,percent:Math.round(n/o*1e4)/1e4}),s(a+N)}))}))}};s(0)};function U(e){return z(e,(function(e){return"object"===o(e)&&null!==e?U(e):e}))}function M(e,t,r){return e&&t in e?e[t]:r}function L(e,t){return K(t,(function(r,o){e[o]=t[o]})),e}function H(e){return e instanceof Array}function D(e,t){for(var r=!1,o=0;o<e.length;o++)if(t===e[o]){r=!0;break}return r}function F(e){return H(e)?e:[e]}function K(e,t){for(var r in e)e.hasOwnProperty(r)&&t(e[r],r)}function z(e,t){var r=H(e)?[]:{};for(var o in e)e.hasOwnProperty(o)&&(r[o]=t(e[o],o));return r}function W(e,t){var r=H(e),o=r?[]:{};for(var n in e)e.hasOwnProperty(n)&&t(e[n],n)&&(r?o.push(e[n]):o[n]=e[n]);return o}var X=function(e){var t,r,o,n="";for(t=0,r=e.length/2;t<r;t++)o=parseInt(e[2*t]+e[2*t+1],16),n+=String.fromCharCode(o);return btoa(n)},q=function(){var e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},V=function(e,t){var r=t.Bucket,o=t.Region,n=t.Key,i=this.options.Domain,s=!i||"string"===typeof i&&i.indexOf("{Bucket}")>-1,a=!i||"string"===typeof i&&i.indexOf("{Region}")>-1;if(e.indexOf("Bucket")>-1||"deleteMultipleObject"===e||"multipartList"===e||"listObjectVersions"===e){if(s&&!r)return"Bucket";if(a&&!o)return"Region"}else if(e.indexOf("Object")>-1||e.indexOf("multipart")>-1||"sliceUploadFile"===e||"abortUploadTask"===e||"uploadFile"===e){if(s&&!r)return"Bucket";if(a&&!o)return"Region";if(!n)return"Key"}return!1},Y=function(e,t){if(t=L({},t),"getAuth"!==e&&"getV4Auth"!==e&&"getObjectUrl"!==e){var r=t.Headers||{};if(t&&"object"===o(t)){(function(){for(var e in t)t.hasOwnProperty(e)&&e.indexOf("x-cos-")>-1&&(r[e]=t[e])})();var n={"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-traffic-limit":"TrafficLimit","x-cos-mime-limit":"MimeLimit","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","Pic-Operations":"PicOperations","x-cos-callback":"Callback","x-cos-callback-var":"CallbackVar","x-cos-return-body":"ReturnBody"};ue.each(n,(function(e,o){void 0!==t[e]&&(r[o]=t[e])})),t.Headers=O(r)}}return t},G=function(e,t){return function(r,o){var n,i=this;if("function"===typeof r&&(o=r,r={}),r=Y(e,r),i.options.EnableReporter)if("sliceUploadFile"===r.calledBySdk||"sliceCopyFile"===r.calledBySdk)n=r.tracker&&r.tracker.generateSubTracker({apiName:e});else if(["uploadFile","uploadFiles"].includes(e))n=null;else{var s=0;r.Body&&(s="string"===typeof r.Body?r.Body.length:r.Body.size||r.Body.byteLength||0);var a=i.options.UseAccelerate||"string"===typeof i.options.Domain&&i.options.Domain.includes("accelerate.");n=new g({Beacon:i.options.BeaconReporter,clsReporter:i.options.ClsReporter,bucket:r.Bucket,region:r.Region,apiName:e,realApi:e,accelerate:a,fileKey:r.Key,fileSize:s,deepTracker:i.options.DeepTracker,customId:i.options.CustomId,delay:i.options.TrackerDelay})}r.tracker=n;var c=function(e){return e&&e.headers&&(e.headers["x-cos-request-id"]&&(e.RequestId=e.headers["x-cos-request-id"]),e.headers["x-ci-request-id"]&&(e.RequestId=e.headers["x-ci-request-id"]),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},u=function(e,t){n&&n.report(e,t),o&&o(c(e),c(t))},l=function(){if("getService"!==e&&"abortUploadTask"!==e){var t=V.call(i,e,r);if(t)return"missing param "+t;if(r.Region){if(i.options.CompatibilityMode){if(!/^([a-z\d-.]+)$/.test(r.Region))return"Region format error."}else{if(r.Region.indexOf("cos.")>-1)return'param Region should not be start with "cos."';if(!/^([a-z\d-]+)$/.test(r.Region))return"Region format error."}i.options.CompatibilityMode||-1!==r.Region.indexOf("-")||"yfb"===r.Region||"default"===r.Region||"accelerate"===r.Region||console.warn("warning: param Region format error, find help here: https://cloud.tencent.com/document/product/436/6224")}if(r.Bucket){if(!/^([a-z\d-]+)-(\d+)$/.test(r.Bucket))if(r.AppId)r.Bucket=r.Bucket+"-"+r.AppId;else{if(!i.options.AppId)return'Bucket should format as "test-1250000000".';r.Bucket=r.Bucket+"-"+i.options.AppId}r.AppId&&(console.warn('warning: AppId has been deprecated, Please put it at the end of parameter Bucket(E.g Bucket:"test-1250000000" ).'),delete r.AppId)}!i.options.UseRawKey&&r.Key&&"/"===r.Key.substr(0,1)&&(r.Key=r.Key.substr(1))}},d=l(),p=["getAuth","getObjectUrl"].includes(e);if("function"===typeof Promise&&!p&&!o)return new Promise((function(e,n){if(o=function(t,r){t?n(t):e(r)},d)return u(ue.error(new Error(d)));t.call(i,r,u)}));if(d)return u(ue.error(new Error(d)));var h=t.call(i,r,u);return p?h:void 0}},$=function(e,t){var r,o,n=this,i=0,s=0,a=Date.now();function c(){if(o=0,t&&"function"===typeof t){r=Date.now();var n,c=Math.max(0,Math.round((s-i)/((r-a)/1e3)*100)/100)||0;n=0===s&&0===e?1:Math.floor(s/e*100)/100||0,a=r,i=s;try{t({loaded:s,total:e,speed:c,percent:n})}catch(u){}}}return function(t,r){if(t&&(s=t.loaded,e=t.total),r)clearTimeout(o),c();else{if(o)return;o=setTimeout(c,n.options.ProgressInterval)}}},Q=function(e,t,r){var o;"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())?(o=t.Body.size,t.ContentLength=o,r(null,o)):r(ue.error(new Error("params body format error, Only allow File|Blob|String.")))},J=function(e){return Date.now()+(e||0)},Z=function(e,t){var r=e;return e.message=e.message||null,"string"===typeof t?(e.error=t,e.message=t):"object"===o(t)&&null!==t&&(L(e,t),(t.code||t.name)&&(e.code=t.code||t.name),t.message&&(e.message=t.message),t.stack&&(e.stack=t.stack)),"function"===typeof Object.defineProperty&&(Object.defineProperty(e,"name",{writable:!0,enumerable:!1}),Object.defineProperty(e,"message",{enumerable:!0})),e.name=t&&t.name||e.name||e.code||"Error",e.code||(e.code=e.name),e.error||(e.error=U(r)),e},ee=function(){return"object"===("undefined"===typeof globalThis?"undefined":o(globalThis))&&("DedicatedWorkerGlobalScope"===globalThis.constructor.name||globalThis.FileReaderSync)},te=function(){return"object"!==("undefined"===typeof window?"undefined":o(window))&&"object"===("undefined"===typeof t?"undefined":o(t))&&!ee()},re=function(e){return/^https?:\/\/([^/]+\.)?ci\.[^/]+/.test(e)},oe=function(){if("object"!==("undefined"===typeof navigator?"undefined":o(navigator)))return!1;var e=navigator.userAgent,t=!!e.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);return t}(),ne=function(){return"object"===("undefined"===typeof navigator?"undefined":o(navigator))&&/\sQQ/i.test(navigator.userAgent)}(),ie=function(e,t){var r=f.encode(e);return t&&(r=r.replaceAll("+","-").replaceAll("/","_").replaceAll("=","")),r},se=function(e){return e?f.decode(e):""},ae=function(e){var t,r=e.split("/"),o=[],i=n(r);try{for(i.s();!(t=i.n()).done;){var s=t.value;".."===s?o.length&&o.pop():s.length&&"."!==s&&o.push(s)}}catch(a){i.e(a)}finally{i.f()}return"/"+o.join("/")},ce=function(e){var t;if(e&&"string"===typeof e){var r=e.trim(),o=0===r.indexOf("<"),n=0===r.indexOf("{");if(o)t=ue.xml2json(e)||{};else if(n)try{var i=e.replace(/\n/g," "),s=JSON.parse(i);t="[object Object]"===Object.prototype.toString.call(s)?s:e}catch(a){t=e}else t=e}else t=e||{};return t},ue={noop:B,formatParams:Y,apiWrapper:G,xml2json:m,json2xml:y,md5:a,clearKey:O,fileSlice:I,getBodyMd5:j,getFileMd5:_,b64:X,extend:L,isArray:H,isInArray:D,makeArray:F,each:K,map:z,filter:W,clone:U,attr:M,uuid:q,camSafeUrlEncode:v,throttleOnProgress:$,getFileSize:Q,getSkewTime:J,error:Z,obj2str:k,getAuth:S,parseSelectPayload:A,getSourceParams:R,isBrowser:!0,isNode:te,isCIHost:re,isIOS_QQ:oe&&ne,encodeBase64:ie,decodeBase64:se,simplifyPath:ae,readAsBinaryString:E,parseResBody:ce};e.exports=ue}).call(this,r(/*! ./../node_modules/process/browser.js */"./node_modules/process/browser.js"))}})}))},"7e79":function(e,t,r){!function(t,r){e.exports=r()}(self,()=>(()=>{var e={173:(e,t,r)=>{(e.exports=r(252)(!1)).push([e.id,'\n.vue-cropper[data-v-8ed66ddc] {\n  position: relative;\n  width: 100%;\n  height: 100%;\n  box-sizing: border-box;\n  user-select: none;\n  -webkit-user-select: none;\n  -moz-user-select: none;\n  -ms-user-select: none;\n  direction: ltr;\n  touch-action: none;\n  text-align: left;\n  background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC");\n}\n.cropper-box[data-v-8ed66ddc],\n.cropper-box-canvas[data-v-8ed66ddc],\n.cropper-drag-box[data-v-8ed66ddc],\n.cropper-crop-box[data-v-8ed66ddc],\n.cropper-face[data-v-8ed66ddc] {\n  position: absolute;\n  top: 0;\n  right: 0;\n  bottom: 0;\n  left: 0;\n  user-select: none;\n}\n.cropper-box-canvas img[data-v-8ed66ddc] {\n  position: relative;\n  text-align: left;\n  user-select: none;\n  transform: none;\n  max-width: none;\n  max-height: none;\n}\n.cropper-box[data-v-8ed66ddc] {\n  overflow: hidden;\n}\n.cropper-move[data-v-8ed66ddc] {\n  cursor: move;\n}\n.cropper-crop[data-v-8ed66ddc] {\n  cursor: crosshair;\n}\n.cropper-modal[data-v-8ed66ddc] {\n  background: rgba(0, 0, 0, 0.5);\n}\n.cropper-crop-box[data-v-8ed66ddc] {\n  /*border: 2px solid #39f;*/\n}\n.cropper-view-box[data-v-8ed66ddc] {\n  display: block;\n  overflow: hidden;\n  width: 100%;\n  height: 100%;\n  outline: 1px solid #39f;\n  outline-color: rgba(51, 153, 255, 0.75);\n  user-select: none;\n}\n.cropper-view-box img[data-v-8ed66ddc] {\n  user-select: none;\n  text-align: left;\n  max-width: none;\n  max-height: none;\n}\n.cropper-face[data-v-8ed66ddc] {\n  top: 0;\n  left: 0;\n  background-color: #fff;\n  opacity: 0.1;\n}\n.crop-info[data-v-8ed66ddc] {\n  position: absolute;\n  left: 0px;\n  min-width: 65px;\n  text-align: center;\n  color: white;\n  line-height: 20px;\n  background-color: rgba(0, 0, 0, 0.8);\n  font-size: 12px;\n}\n.crop-line[data-v-8ed66ddc] {\n  position: absolute;\n  display: block;\n  width: 100%;\n  height: 100%;\n  opacity: 0.1;\n}\n.line-w[data-v-8ed66ddc] {\n  top: -3px;\n  left: 0;\n  height: 5px;\n  cursor: n-resize;\n}\n.line-a[data-v-8ed66ddc] {\n  top: 0;\n  left: -3px;\n  width: 5px;\n  cursor: w-resize;\n}\n.line-s[data-v-8ed66ddc] {\n  bottom: -3px;\n  left: 0;\n  height: 5px;\n  cursor: s-resize;\n}\n.line-d[data-v-8ed66ddc] {\n  top: 0;\n  right: -3px;\n  width: 5px;\n  cursor: e-resize;\n}\n.crop-point[data-v-8ed66ddc] {\n  position: absolute;\n  width: 8px;\n  height: 8px;\n  opacity: 0.75;\n  background-color: #39f;\n  border-radius: 100%;\n}\n.point1[data-v-8ed66ddc] {\n  top: -4px;\n  left: -4px;\n  cursor: nw-resize;\n}\n.point2[data-v-8ed66ddc] {\n  top: -5px;\n  left: 50%;\n  margin-left: -3px;\n  cursor: n-resize;\n}\n.point3[data-v-8ed66ddc] {\n  top: -4px;\n  right: -4px;\n  cursor: ne-resize;\n}\n.point4[data-v-8ed66ddc] {\n  top: 50%;\n  left: -4px;\n  margin-top: -3px;\n  cursor: w-resize;\n}\n.point5[data-v-8ed66ddc] {\n  top: 50%;\n  right: -4px;\n  margin-top: -3px;\n  cursor: e-resize;\n}\n.point6[data-v-8ed66ddc] {\n  bottom: -5px;\n  left: -4px;\n  cursor: sw-resize;\n}\n.point7[data-v-8ed66ddc] {\n  bottom: -5px;\n  left: 50%;\n  margin-left: -3px;\n  cursor: s-resize;\n}\n.point8[data-v-8ed66ddc] {\n  bottom: -5px;\n  right: -4px;\n  cursor: se-resize;\n}\n@media screen and (max-width: 500px) {\n.crop-point[data-v-8ed66ddc] {\n    position: absolute;\n    width: 20px;\n    height: 20px;\n    opacity: 0.45;\n    background-color: #39f;\n    border-radius: 100%;\n}\n.point1[data-v-8ed66ddc] {\n    top: -10px;\n    left: -10px;\n}\n.point2[data-v-8ed66ddc],\n  .point4[data-v-8ed66ddc],\n  .point5[data-v-8ed66ddc],\n  .point7[data-v-8ed66ddc] {\n    display: none;\n}\n.point3[data-v-8ed66ddc] {\n    top: -10px;\n    right: -10px;\n}\n.point4[data-v-8ed66ddc] {\n    top: 0;\n    left: 0;\n}\n.point6[data-v-8ed66ddc] {\n    bottom: -10px;\n    left: -10px;\n}\n.point8[data-v-8ed66ddc] {\n    bottom: -10px;\n    right: -10px;\n}\n}\n',""])},252:e=>{e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var r=function(e,t){var r,o=e[1]||"",n=e[3];if(!n)return o;if(t&&"function"==typeof btoa){var i=(r=n,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */"),s=n.sources.map((function(e){return"/*# sourceURL="+n.sourceRoot+e+" */"}));return[o].concat(s).concat([i]).join("\n")}return[o].join("\n")}(t,e);return t[2]?"@media "+t[2]+"{"+r+"}":r})).join("")},t.i=function(e,r){"string"==typeof e&&(e=[[null,e,""]]);for(var o={},n=0;n<this.length;n++){var i=this[n][0];"number"==typeof i&&(o[i]=!0)}for(n=0;n<e.length;n++){var s=e[n];"number"==typeof s[0]&&o[s[0]]||(r&&!s[2]?s[2]=r:r&&(s[2]="("+s[2]+") and ("+r+")"),t.push(s))}},t}},125:(e,t,r)=>{var o=r(173);"string"==typeof o&&(o=[[e.id,o,""]]),r(723)(o,{hmr:!0,transform:void 0,insertInto:void 0}),o.locals&&(e.exports=o.locals)},723:(e,t,r)=>{var o,n,i={},s=(o=function(){return window&&document&&document.all&&!window.atob},function(){return void 0===n&&(n=o.apply(this,arguments)),n}),a=function(e,t){return t?t.querySelector(e):document.querySelector(e)},c=function(e){var t={};return function(e,r){if("function"==typeof e)return e();if(void 0===t[e]){var o=a.call(this,e,r);if(window.HTMLIFrameElement&&o instanceof window.HTMLIFrameElement)try{o=o.contentDocument.head}catch(e){o=null}t[e]=o}return t[e]}}(),u=null,l=0,d=[],p=r(947);function h(e,t){for(var r=0;r<e.length;r++){var o=e[r],n=i[o.id];if(n){n.refs++;for(var s=0;s<n.parts.length;s++)n.parts[s](o.parts[s]);for(;s<o.parts.length;s++)n.parts.push(C(o.parts[s],t))}else{var a=[];for(s=0;s<o.parts.length;s++)a.push(C(o.parts[s],t));i[o.id]={id:o.id,refs:1,parts:a}}}}function f(e,t){for(var r=[],o={},n=0;n<e.length;n++){var i=e[n],s=t.base?i[0]+t.base:i[0],a={css:i[1],media:i[2],sourceMap:i[3]};o[s]?o[s].parts.push(a):r.push(o[s]={id:s,parts:[a]})}return r}function g(e,t){var r=c(e.insertInto);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insertInto' parameter is invalid.");var o=d[d.length-1];if("top"===e.insertAt)o?o.nextSibling?r.insertBefore(t,o.nextSibling):r.appendChild(t):r.insertBefore(t,r.firstChild),d.push(t);else if("bottom"===e.insertAt)r.appendChild(t);else{if("object"!=typeof e.insertAt||!e.insertAt.before)throw new Error("[Style Loader]\n\n Invalid value for parameter 'insertAt' ('options.insertAt') found.\n Must be 'top', 'bottom', or Object.\n (https://github.com/webpack-contrib/style-loader#insertat)\n");var n=c(e.insertAt.before,r);r.insertBefore(t,n)}}function m(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e);var t=d.indexOf(e);t>=0&&d.splice(t,1)}function y(e){var t=document.createElement("style");if(void 0===e.attrs.type&&(e.attrs.type="text/css"),void 0===e.attrs.nonce){var o=r.nc;o&&(e.attrs.nonce=o)}return v(t,e.attrs),g(e,t),t}function v(e,t){Object.keys(t).forEach((function(r){e.setAttribute(r,t[r])}))}function C(e,t){var r,o,n,i;if(t.transform&&e.css){if(!(i="function"==typeof t.transform?t.transform(e.css):t.transform.default(e.css)))return function(){};e.css=i}if(t.singleton){var s=l++;r=u||(u=y(t)),o=x.bind(null,r,s,!1),n=x.bind(null,r,s,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(r=function(e){var t=document.createElement("link");return void 0===e.attrs.type&&(e.attrs.type="text/css"),e.attrs.rel="stylesheet",v(t,e.attrs),g(e,t),t}(t),o=w.bind(null,r,t),n=function(){m(r),r.href&&URL.revokeObjectURL(r.href)}):(r=y(t),o=S.bind(null,r),n=function(){m(r)});return o(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;o(e=t)}else n()}}e.exports=function(e,t){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(t=t||{}).attrs="object"==typeof t.attrs?t.attrs:{},t.singleton||"boolean"==typeof t.singleton||(t.singleton=s()),t.insertInto||(t.insertInto="head"),t.insertAt||(t.insertAt="bottom");var r=f(e,t);return h(r,t),function(e){for(var o=[],n=0;n<r.length;n++){var s=r[n];(a=i[s.id]).refs--,o.push(a)}for(e&&h(f(e,t),t),n=0;n<o.length;n++){var a;if(0===(a=o[n]).refs){for(var c=0;c<a.parts.length;c++)a.parts[c]();delete i[a.id]}}}};var k,b=(k=[],function(e,t){return k[e]=t,k.filter(Boolean).join("\n")});function x(e,t,r,o){var n=r?"":o.css;if(e.styleSheet)e.styleSheet.cssText=b(t,n);else{var i=document.createTextNode(n),s=e.childNodes;s[t]&&e.removeChild(s[t]),s.length?e.insertBefore(i,s[t]):e.appendChild(i)}}function S(e,t){var r=t.css,o=t.media;if(o&&e.setAttribute("media",o),e.styleSheet)e.styleSheet.cssText=r;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(r))}}function w(e,t,r){var o=r.css,n=r.sourceMap,i=void 0===t.convertToAbsoluteUrls&&n;(t.convertToAbsoluteUrls||i)&&(o=p(o)),n&&(o+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(n))))+" */");var s=new Blob([o],{type:"text/css"}),a=e.href;e.href=URL.createObjectURL(s),a&&URL.revokeObjectURL(a)}},947:e=>{e.exports=function(e){var t="undefined"!=typeof window&&window.location;if(!t)throw new Error("fixUrls requires window.location");if(!e||"string"!=typeof e)return e;var r=t.protocol+"//"+t.host,o=r+t.pathname.replace(/\/[^\/]*$/,"/");return e.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(e,t){var n,i=t.trim().replace(/^"(.*)"$/,(function(e,t){return t})).replace(/^'(.*)'$/,(function(e,t){return t}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(i)?e:(n=0===i.indexOf("//")?i:0===i.indexOf("/")?r+i:o+i.replace(/^\.\//,""),"url("+JSON.stringify(n)+")")}))}}},t={};function r(o){var n=t[o];if(void 0!==n)return n.exports;var i=t[o]={id:o,exports:{}};return e[o](i,i.exports,r),i.exports}r.d=(e,t)=>{for(var o in t)r.o(t,o)&&!r.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.nc=void 0;var o={};return(()=>{"use strict";r.r(o),r.d(o,{VueCropper:()=>u,default:()=>d});var e=function(){var e=this,t=e._self._c;return t("div",{ref:"cropper",staticClass:"vue-cropper",on:{mouseover:e.scaleImg,mouseout:e.cancelScale}},[e.imgs?t("div",{staticClass:"cropper-box"},[t("div",{directives:[{name:"show",rawName:"v-show",value:!e.loading,expression:"!loading"}],staticClass:"cropper-box-canvas",style:{width:e.trueWidth+"px",height:e.trueHeight+"px",transform:"scale("+e.scale+","+e.scale+") translate3d("+e.x/e.scale+"px,"+e.y/e.scale+"px,0)rotateZ("+90*e.rotate+"deg)"}},[t("img",{ref:"cropperImg",attrs:{src:e.imgs,alt:"cropper-img"}})])]):e._e(),e._v(" "),t("div",{staticClass:"cropper-drag-box",class:{"cropper-move":e.move&&!e.crop,"cropper-crop":e.crop,"cropper-modal":e.cropping},on:{mousedown:e.startMove,touchstart:e.startMove}}),e._v(" "),t("div",{directives:[{name:"show",rawName:"v-show",value:e.cropping,expression:"cropping"}],staticClass:"cropper-crop-box",style:{width:e.cropW+"px",height:e.cropH+"px",transform:"translate3d("+e.cropOffsertX+"px,"+e.cropOffsertY+"px,0)"}},[t("span",{staticClass:"cropper-view-box"},[t("img",{style:{width:e.trueWidth+"px",height:e.trueHeight+"px",transform:"scale("+e.scale+","+e.scale+") translate3d("+(e.x-e.cropOffsertX)/e.scale+"px,"+(e.y-e.cropOffsertY)/e.scale+"px,0)rotateZ("+90*e.rotate+"deg)"},attrs:{src:e.imgs,alt:"cropper-img"}})]),e._v(" "),t("span",{staticClass:"cropper-face cropper-move",on:{mousedown:e.cropMove,touchstart:e.cropMove}}),e._v(" "),e.info?t("span",{staticClass:"crop-info",style:{top:e.cropInfo.top}},[e._v(e._s(e.cropInfo.width)+" × "+e._s(e.cropInfo.height))]):e._e(),e._v(" "),e.fixedBox?e._e():t("span",[t("span",{staticClass:"crop-line line-w",on:{mousedown:function(t){return e.changeCropSize(t,!1,!0,0,1)},touchstart:function(t){return e.changeCropSize(t,!1,!0,0,1)}}}),e._v(" "),t("span",{staticClass:"crop-line line-a",on:{mousedown:function(t){return e.changeCropSize(t,!0,!1,1,0)},touchstart:function(t){return e.changeCropSize(t,!0,!1,1,0)}}}),e._v(" "),t("span",{staticClass:"crop-line line-s",on:{mousedown:function(t){return e.changeCropSize(t,!1,!0,0,2)},touchstart:function(t){return e.changeCropSize(t,!1,!0,0,2)}}}),e._v(" "),t("span",{staticClass:"crop-line line-d",on:{mousedown:function(t){return e.changeCropSize(t,!0,!1,2,0)},touchstart:function(t){return e.changeCropSize(t,!0,!1,2,0)}}}),e._v(" "),t("span",{staticClass:"crop-point point1",on:{mousedown:function(t){return e.changeCropSize(t,!0,!0,1,1)},touchstart:function(t){return e.changeCropSize(t,!0,!0,1,1)}}}),e._v(" "),t("span",{staticClass:"crop-point point2",on:{mousedown:function(t){return e.changeCropSize(t,!1,!0,0,1)},touchstart:function(t){return e.changeCropSize(t,!1,!0,0,1)}}}),e._v(" "),t("span",{staticClass:"crop-point point3",on:{mousedown:function(t){return e.changeCropSize(t,!0,!0,2,1)},touchstart:function(t){return e.changeCropSize(t,!0,!0,2,1)}}}),e._v(" "),t("span",{staticClass:"crop-point point4",on:{mousedown:function(t){return e.changeCropSize(t,!0,!1,1,0)},touchstart:function(t){return e.changeCropSize(t,!0,!1,1,0)}}}),e._v(" "),t("span",{staticClass:"crop-point point5",on:{mousedown:function(t){return e.changeCropSize(t,!0,!1,2,0)},touchstart:function(t){return e.changeCropSize(t,!0,!1,2,0)}}}),e._v(" "),t("span",{staticClass:"crop-point point6",on:{mousedown:function(t){return e.changeCropSize(t,!0,!0,1,2)},touchstart:function(t){return e.changeCropSize(t,!0,!0,1,2)}}}),e._v(" "),t("span",{staticClass:"crop-point point7",on:{mousedown:function(t){return e.changeCropSize(t,!1,!0,0,2)},touchstart:function(t){return e.changeCropSize(t,!1,!0,0,2)}}}),e._v(" "),t("span",{staticClass:"crop-point point8",on:{mousedown:function(t){return e.changeCropSize(t,!0,!0,2,2)},touchstart:function(t){return e.changeCropSize(t,!0,!0,2,2)}}})])])])};function t(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}function n(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o,n,i,s,a=[],c=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(o=i.call(r)).done)&&(a.push(o.value),a.length!==t);c=!0);}catch(e){u=!0,n=e}finally{try{if(!c&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw n}}return a}}(e,r)||function(e,r){if(e){if("string"==typeof e)return t(e,r);var o=Object.prototype.toString.call(e).slice(8,-1);return"Object"===o&&e.constructor&&(o=e.constructor.name),"Map"===o||"Set"===o?Array.from(e):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?t(e,r):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}e._withStripped=!0;var i={getData:function(e){return new Promise((function(t,r){var o={};(function(e){var t=null;return new Promise((function(r,o){if(e.src)if(/^data\:/i.test(e.src))t=function(e){e=e.replace(/^data\:([^\;]+)\;base64,/gim,"");for(var t=atob(e),r=t.length,o=new ArrayBuffer(r),n=new Uint8Array(o),i=0;i<r;i++)n[i]=t.charCodeAt(i);return o}(e.src),r(t);else if(/^blob\:/i.test(e.src)){var n=new FileReader;n.onload=function(e){t=e.target.result,r(t)},function(e,t){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="blob",r.onload=function(e){var t;200!=this.status&&0!==this.status||(t=this.response,n.readAsArrayBuffer(t))},r.send()}(e.src)}else{var i=new XMLHttpRequest;i.onload=function(){if(200!=this.status&&0!==this.status)throw"Could not load image";t=i.response,r(t),i=null},i.open("GET",e.src,!0),i.responseType="arraybuffer",i.send(null)}else o("img error")}))})(e).then((function(e){o.arrayBuffer=e,o.orientation=function(e){var t,r,o,n,i,s,a,c,u,l=new DataView(e),d=l.byteLength;if(255===l.getUint8(0)&&216===l.getUint8(1))for(c=2;c<d;){if(255===l.getUint8(c)&&225===l.getUint8(c+1)){s=c;break}c++}if(s&&(r=s+10,"Exif"===function(e,t,r){var o,n="";for(o=t,r+=t;o<r;o++)n+=String.fromCharCode(e.getUint8(o));return n}(l,s+4,4)&&((n=18761===(i=l.getUint16(r)))||19789===i)&&42===l.getUint16(r+2,n)&&(o=l.getUint32(r+4,n))>=8&&(a=r+o)),a)for(d=l.getUint16(a,n),u=0;u<d;u++)if(c=a+12*u+2,274===l.getUint16(c,n)){c+=8,t=l.getUint16(c,n);break}return t}(e),t(o)})).catch((function(e){r(e)}))}))}};const s=i,a={data:function(){return{w:0,h:0,scale:1,x:0,y:0,loading:!0,trueWidth:0,trueHeight:0,move:!0,moveX:0,moveY:0,crop:!1,cropping:!1,cropW:0,cropH:0,cropOldW:0,cropOldH:0,canChangeX:!1,canChangeY:!1,changeCropTypeX:1,changeCropTypeY:1,cropX:0,cropY:0,cropChangeX:0,cropChangeY:0,cropOffsertX:0,cropOffsertY:0,support:"",touches:[],touchNow:!1,rotate:0,isIos:!1,orientation:0,imgs:"",coe:.2,scaling:!1,scalingSet:"",coeStatus:"",isCanShow:!0}},props:{img:{type:[String,Blob,null,File],default:""},outputSize:{type:Number,default:1},outputType:{type:String,default:"jpeg"},info:{type:Boolean,default:!0},canScale:{type:Boolean,default:!0},autoCrop:{type:Boolean,default:!1},autoCropWidth:{type:[Number,String],default:0},autoCropHeight:{type:[Number,String],default:0},fixed:{type:Boolean,default:!1},fixedNumber:{type:Array,default:function(){return[1,1]}},fixedBox:{type:Boolean,default:!1},full:{type:Boolean,default:!1},canMove:{type:Boolean,default:!0},canMoveBox:{type:Boolean,default:!0},original:{type:Boolean,default:!1},centerBox:{type:Boolean,default:!1},high:{type:Boolean,default:!0},infoTrue:{type:Boolean,default:!1},maxImgSize:{type:[Number,String],default:2e3},enlarge:{type:[Number,String],default:1},preW:{type:[Number,String],default:0},mode:{type:String,default:"contain"},limitMinSize:{type:[Number,Array,String],default:function(){return 10},validator:function(e){return Array.isArray(e)?Number(e[0])>=0&&Number(e[1])>=0:Number(e)>=0}}},computed:{cropInfo:function(){var e={};if(e.top=this.cropOffsertY>21?"-21px":"0px",e.width=this.cropW>0?this.cropW:0,e.height=this.cropH>0?this.cropH:0,this.infoTrue){var t=1;this.high&&!this.full&&(t=window.devicePixelRatio),1!==this.enlarge&!this.full&&(t=Math.abs(Number(this.enlarge))),e.width=e.width*t,e.height=e.height*t,this.full&&(e.width=e.width/this.scale,e.height=e.height/this.scale)}return e.width=e.width.toFixed(0),e.height=e.height.toFixed(0),e},isIE:function(){return navigator.userAgent,!!window.ActiveXObject||"ActiveXObject"in window},passive:function(){return this.isIE?null:{passive:!1}}},watch:{img:function(){this.checkedImg()},imgs:function(e){""!==e&&this.reload()},cropW:function(){this.showPreview()},cropH:function(){this.showPreview()},cropOffsertX:function(){this.showPreview()},cropOffsertY:function(){this.showPreview()},scale:function(e,t){this.showPreview()},x:function(){this.showPreview()},y:function(){this.showPreview()},autoCrop:function(e){e&&this.goAutoCrop()},autoCropWidth:function(){this.autoCrop&&this.goAutoCrop()},autoCropHeight:function(){this.autoCrop&&this.goAutoCrop()},mode:function(){this.checkedImg()},rotate:function(){this.showPreview(),(this.autoCrop||this.cropW>0||this.cropH>0)&&this.goAutoCrop(this.cropW,this.cropH)}},methods:{getVersion:function(e){for(var t=navigator.userAgent.split(" "),r="",o=new RegExp(e,"i"),n=0;n<t.length;n++)o.test(t[n])&&(r=t[n]);return r?r.split("/")[1].split("."):["0","0","0"]},checkOrientationImage:function(e,t,r,o){var n=this;if(this.getVersion("chrome")[0]>=81)t=-1;else if(this.getVersion("safari")[0]>=605){var i=this.getVersion("version");i[0]>13&&i[1]>1&&(t=-1)}else{var s=navigator.userAgent.toLowerCase().match(/cpu iphone os (.*?) like mac os/);if(s){var a=s[1];((a=a.split("_"))[0]>13||a[0]>=13&&a[1]>=4)&&(t=-1)}}var c=document.createElement("canvas"),u=c.getContext("2d");switch(u.save(),t){case 2:c.width=r,c.height=o,u.translate(r,0),u.scale(-1,1);break;case 3:c.width=r,c.height=o,u.translate(r/2,o/2),u.rotate(180*Math.PI/180),u.translate(-r/2,-o/2);break;case 4:c.width=r,c.height=o,u.translate(0,o),u.scale(1,-1);break;case 5:c.height=r,c.width=o,u.rotate(.5*Math.PI),u.scale(1,-1);break;case 6:c.width=o,c.height=r,u.translate(o/2,r/2),u.rotate(90*Math.PI/180),u.translate(-r/2,-o/2);break;case 7:c.height=r,c.width=o,u.rotate(.5*Math.PI),u.translate(r,-o),u.scale(-1,1);break;case 8:c.height=r,c.width=o,u.translate(o/2,r/2),u.rotate(-90*Math.PI/180),u.translate(-r/2,-o/2);break;default:c.width=r,c.height=o}u.drawImage(e,0,0,r,o),u.restore(),c.toBlob((function(e){var t=URL.createObjectURL(e);URL.revokeObjectURL(n.imgs),n.imgs=t}),"image/"+this.outputType,1)},checkedImg:function(){var e=this;if(null===this.img||""===this.img)return this.imgs="",void this.clearCrop();this.loading=!0,this.scale=1,this.rotate=0,this.clearCrop();var t=new Image;if(t.onload=function(){if(""===e.img)return e.$emit("imgLoad","error"),e.$emit("img-load","error"),!1;var r=t.width,o=t.height;s.getData(t).then((function(n){e.orientation=n.orientation||1;var i=Number(e.maxImgSize);!e.orientation&&r<i&o<i?e.imgs=e.img:(r>i&&(o=o/r*i,r=i),o>i&&(r=r/o*i,o=i),e.checkOrientationImage(t,e.orientation,r,o))}))},t.onerror=function(){e.$emit("imgLoad","error"),e.$emit("img-load","error")},"data"!==this.img.substr(0,4)&&(t.crossOrigin=""),this.isIE){var r=new XMLHttpRequest;r.onload=function(){var e=URL.createObjectURL(this.response);t.src=e},r.open("GET",this.img,!0),r.responseType="blob",r.send()}else t.src=this.img},startMove:function(e){if(e.preventDefault(),this.move&&!this.crop){if(!this.canMove)return!1;this.moveX=("clientX"in e?e.clientX:e.touches[0].clientX)-this.x,this.moveY=("clientY"in e?e.clientY:e.touches[0].clientY)-this.y,e.touches?(window.addEventListener("touchmove",this.moveImg),window.addEventListener("touchend",this.leaveImg),2==e.touches.length&&(this.touches=e.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale))):(window.addEventListener("mousemove",this.moveImg),window.addEventListener("mouseup",this.leaveImg)),this.$emit("imgMoving",{moving:!0,axis:this.getImgAxis()}),this.$emit("img-moving",{moving:!0,axis:this.getImgAxis()})}else this.cropping=!0,window.addEventListener("mousemove",this.createCrop),window.addEventListener("mouseup",this.endCrop),window.addEventListener("touchmove",this.createCrop),window.addEventListener("touchend",this.endCrop),this.cropOffsertX=e.offsetX?e.offsetX:e.touches[0].pageX-this.$refs.cropper.offsetLeft,this.cropOffsertY=e.offsetY?e.offsetY:e.touches[0].pageY-this.$refs.cropper.offsetTop,this.cropX="clientX"in e?e.clientX:e.touches[0].clientX,this.cropY="clientY"in e?e.clientY:e.touches[0].clientY,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.cropW=0,this.cropH=0},touchScale:function(e){var t=this;e.preventDefault();var r=this.scale,o=this.touches[0].clientX,n=this.touches[0].clientY,i=e.touches[0].clientX,s=e.touches[0].clientY,a=this.touches[1].clientX,c=this.touches[1].clientY,u=e.touches[1].clientX,l=e.touches[1].clientY,d=Math.sqrt(Math.pow(o-a,2)+Math.pow(n-c,2)),p=Math.sqrt(Math.pow(i-u,2)+Math.pow(s-l,2))-d,h=1,f=(h=(h=h/this.trueWidth>h/this.trueHeight?h/this.trueHeight:h/this.trueWidth)>.1?.1:h)*p;if(!this.touchNow){if(this.touchNow=!0,p>0?r+=Math.abs(f):p<0&&r>Math.abs(f)&&(r-=Math.abs(f)),this.touches=e.touches,setTimeout((function(){t.touchNow=!1}),8),!this.checkoutImgAxis(this.x,this.y,r))return!1;this.scale=r}},cancelTouchScale:function(e){window.removeEventListener("touchmove",this.touchScale)},moveImg:function(e){var t=this;if(e.preventDefault(),e.touches&&2===e.touches.length)return this.touches=e.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale),window.removeEventListener("touchmove",this.moveImg),!1;var r,o,n="clientX"in e?e.clientX:e.touches[0].clientX,i="clientY"in e?e.clientY:e.touches[0].clientY;r=n-this.moveX,o=i-this.moveY,this.$nextTick((function(){if(t.centerBox){var e,n,i,s,a=t.getImgAxis(r,o,t.scale),c=t.getCropAxis(),u=t.trueHeight*t.scale,l=t.trueWidth*t.scale;switch(t.rotate){case 1:case-1:case 3:case-3:e=t.cropOffsertX-t.trueWidth*(1-t.scale)/2+(u-l)/2,n=t.cropOffsertY-t.trueHeight*(1-t.scale)/2+(l-u)/2,i=e-u+t.cropW,s=n-l+t.cropH;break;default:e=t.cropOffsertX-t.trueWidth*(1-t.scale)/2,n=t.cropOffsertY-t.trueHeight*(1-t.scale)/2,i=e-l+t.cropW,s=n-u+t.cropH}a.x1>=c.x1&&(r=e),a.y1>=c.y1&&(o=n),a.x2<=c.x2&&(r=i),a.y2<=c.y2&&(o=s)}t.x=r,t.y=o,t.$emit("imgMoving",{moving:!0,axis:t.getImgAxis()}),t.$emit("img-moving",{moving:!0,axis:t.getImgAxis()})}))},leaveImg:function(e){window.removeEventListener("mousemove",this.moveImg),window.removeEventListener("touchmove",this.moveImg),window.removeEventListener("mouseup",this.leaveImg),window.removeEventListener("touchend",this.leaveImg),this.$emit("imgMoving",{moving:!1,axis:this.getImgAxis()}),this.$emit("img-moving",{moving:!1,axis:this.getImgAxis()})},scaleImg:function(){this.canScale&&window.addEventListener(this.support,this.changeSize,this.passive)},cancelScale:function(){this.canScale&&window.removeEventListener(this.support,this.changeSize)},changeSize:function(e){var t=this;e.preventDefault();var r=this.scale,o=e.deltaY||e.wheelDelta;o=navigator.userAgent.indexOf("Firefox")>0?30*o:o,this.isIE&&(o=-o);var n=this.coe,i=(n=n/this.trueWidth>n/this.trueHeight?n/this.trueHeight:n/this.trueWidth)*o;i<0?r+=Math.abs(i):r>Math.abs(i)&&(r-=Math.abs(i));var s=i<0?"add":"reduce";if(s!==this.coeStatus&&(this.coeStatus=s,this.coe=.2),this.scaling||(this.scalingSet=setTimeout((function(){t.scaling=!1,t.coe=t.coe+=.01}),50)),this.scaling=!0,!this.checkoutImgAxis(this.x,this.y,r))return!1;this.scale=r},changeScale:function(e){var t=this.scale;e=e||1;var r=20;if((e*=r=r/this.trueWidth>r/this.trueHeight?r/this.trueHeight:r/this.trueWidth)>0?t+=Math.abs(e):t>Math.abs(e)&&(t-=Math.abs(e)),!this.checkoutImgAxis(this.x,this.y,t))return!1;this.scale=t},createCrop:function(e){var t=this;e.preventDefault();var r="clientX"in e?e.clientX:e.touches?e.touches[0].clientX:0,o="clientY"in e?e.clientY:e.touches?e.touches[0].clientY:0;this.$nextTick((function(){var e=r-t.cropX,n=o-t.cropY;if(e>0?(t.cropW=e+t.cropChangeX>t.w?t.w-t.cropChangeX:e,t.cropOffsertX=t.cropChangeX):(t.cropW=t.w-t.cropChangeX+Math.abs(e)>t.w?t.cropChangeX:Math.abs(e),t.cropOffsertX=t.cropChangeX+e>0?t.cropChangeX+e:0),t.fixed){var i=t.cropW/t.fixedNumber[0]*t.fixedNumber[1];i+t.cropOffsertY>t.h?(t.cropH=t.h-t.cropOffsertY,t.cropW=t.cropH/t.fixedNumber[1]*t.fixedNumber[0],t.cropOffsertX=e>0?t.cropChangeX:t.cropChangeX-t.cropW):t.cropH=i,t.cropOffsertY=t.cropOffsertY}else n>0?(t.cropH=n+t.cropChangeY>t.h?t.h-t.cropChangeY:n,t.cropOffsertY=t.cropChangeY):(t.cropH=t.h-t.cropChangeY+Math.abs(n)>t.h?t.cropChangeY:Math.abs(n),t.cropOffsertY=t.cropChangeY+n>0?t.cropChangeY+n:0)}))},changeCropSize:function(e,t,r,o,n){e.preventDefault(),window.addEventListener("mousemove",this.changeCropNow),window.addEventListener("mouseup",this.changeCropEnd),window.addEventListener("touchmove",this.changeCropNow),window.addEventListener("touchend",this.changeCropEnd),this.canChangeX=t,this.canChangeY=r,this.changeCropTypeX=o,this.changeCropTypeY=n,this.cropX="clientX"in e?e.clientX:e.touches[0].clientX,this.cropY="clientY"in e?e.clientY:e.touches[0].clientY,this.cropOldW=this.cropW,this.cropOldH=this.cropH,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.fixed&&this.canChangeX&&this.canChangeY&&(this.canChangeY=0),this.$emit("changeCropSize",{width:this.cropW,height:this.cropH}),this.$emit("change-crop-size",{width:this.cropW,height:this.cropH})},changeCropNow:function(e){var t=this;e.preventDefault();var r="clientX"in e?e.clientX:e.touches?e.touches[0].clientX:0,o="clientY"in e?e.clientY:e.touches?e.touches[0].clientY:0,i=this.w,s=this.h,a=0,c=0;if(this.centerBox){var u=this.getImgAxis(),l=u.x2,d=u.y2;a=u.x1>0?u.x1:0,c=u.y1>0?u.y1:0,i>l&&(i=l),s>d&&(s=d)}var p=n(this.checkCropLimitSize(),2),h=p[0],f=p[1];this.$nextTick((function(){var e=r-t.cropX,n=o-t.cropY;if(t.canChangeX&&(1===t.changeCropTypeX?t.cropOldW-e<h?(t.cropW=h,t.cropOffsertX=t.cropOldW+t.cropChangeX-a-h):t.cropOldW-e>0?(t.cropW=i-t.cropChangeX-e<=i-a?t.cropOldW-e:t.cropOldW+t.cropChangeX-a,t.cropOffsertX=i-t.cropChangeX-e<=i-a?t.cropChangeX+e:a):(t.cropW=Math.abs(e)+t.cropChangeX<=i?Math.abs(e)-t.cropOldW:i-t.cropOldW-t.cropChangeX,t.cropOffsertX=t.cropChangeX+t.cropOldW):2===t.changeCropTypeX&&(t.cropOldW+e<h?t.cropW=h:t.cropOldW+e>0?(t.cropW=t.cropOldW+e+t.cropOffsertX<=i?t.cropOldW+e:i-t.cropOffsertX,t.cropOffsertX=t.cropChangeX):(t.cropW=i-t.cropChangeX+Math.abs(e+t.cropOldW)<=i-a?Math.abs(e+t.cropOldW):t.cropChangeX-a,t.cropOffsertX=i-t.cropChangeX+Math.abs(e+t.cropOldW)<=i-a?t.cropChangeX-Math.abs(e+t.cropOldW):a))),t.canChangeY&&(1===t.changeCropTypeY?t.cropOldH-n<f?(t.cropH=f,t.cropOffsertY=t.cropOldH+t.cropChangeY-c-f):t.cropOldH-n>0?(t.cropH=s-t.cropChangeY-n<=s-c?t.cropOldH-n:t.cropOldH+t.cropChangeY-c,t.cropOffsertY=s-t.cropChangeY-n<=s-c?t.cropChangeY+n:c):(t.cropH=Math.abs(n)+t.cropChangeY<=s?Math.abs(n)-t.cropOldH:s-t.cropOldH-t.cropChangeY,t.cropOffsertY=t.cropChangeY+t.cropOldH):2===t.changeCropTypeY&&(t.cropOldH+n<f?t.cropH=f:t.cropOldH+n>0?(t.cropH=t.cropOldH+n+t.cropOffsertY<=s?t.cropOldH+n:s-t.cropOffsertY,t.cropOffsertY=t.cropChangeY):(t.cropH=s-t.cropChangeY+Math.abs(n+t.cropOldH)<=s-c?Math.abs(n+t.cropOldH):t.cropChangeY-c,t.cropOffsertY=s-t.cropChangeY+Math.abs(n+t.cropOldH)<=s-c?t.cropChangeY-Math.abs(n+t.cropOldH):c))),t.canChangeX&&t.fixed){var u=t.cropW/t.fixedNumber[0]*t.fixedNumber[1];u<f?(t.cropH=f,t.cropW=t.fixedNumber[0]*f/t.fixedNumber[1],1===t.changeCropTypeX&&(t.cropOffsertX=t.cropChangeX+(t.cropOldW-t.cropW))):u+t.cropOffsertY>s?(t.cropH=s-t.cropOffsertY,t.cropW=t.cropH/t.fixedNumber[1]*t.fixedNumber[0],1===t.changeCropTypeX&&(t.cropOffsertX=t.cropChangeX+(t.cropOldW-t.cropW))):t.cropH=u}if(t.canChangeY&&t.fixed){var l=t.cropH/t.fixedNumber[1]*t.fixedNumber[0];l<h?(t.cropW=h,t.cropH=t.fixedNumber[1]*h/t.fixedNumber[0]):l+t.cropOffsertX>i?(t.cropW=i-t.cropOffsertX,t.cropH=t.cropW/t.fixedNumber[0]*t.fixedNumber[1]):t.cropW=l}t.$emit("cropSizing",{cropW:t.cropW,cropH:t.cropH}),t.$emit("crop-sizing",{cropW:t.cropW,cropH:t.cropH})}))},checkCropLimitSize:function(){this.cropW,this.cropH;var e=this.limitMinSize,t=new Array;return t=Array.isArray(e)?e:[e,e],[parseFloat(t[0]),parseFloat(t[1])]},changeCropEnd:function(e){window.removeEventListener("mousemove",this.changeCropNow),window.removeEventListener("mouseup",this.changeCropEnd),window.removeEventListener("touchmove",this.changeCropNow),window.removeEventListener("touchend",this.changeCropEnd)},calculateSize:function(e,t,r,o,n,i){var s=e/t,a=n,c=i;return a<r&&(a=r,c=Math.ceil(a/s)),c<o&&(c=o,(a=Math.ceil(c*s))<r&&(a=r,c=Math.ceil(a/s))),a<n&&(a=n,c=Math.ceil(a/s)),c<i&&(c=i,a=Math.ceil(c*s)),{width:a,height:c}},endCrop:function(){0===this.cropW&&0===this.cropH&&(this.cropping=!1);var e=n(this.checkCropLimitSize(),2),t=e[0],r=e[1],o=this.fixed?this.calculateSize(this.fixedNumber[0],this.fixedNumber[1],t,r,this.cropW,this.cropH):{width:t,height:r},i=o.width,s=o.height;i>this.cropW&&(this.cropW=i,this.cropOffsertX+i>this.w&&(this.cropOffsertX=this.w-i)),s>this.cropH&&(this.cropH=s,this.cropOffsertY+s>this.h&&(this.cropOffsertY=this.h-s)),window.removeEventListener("mousemove",this.createCrop),window.removeEventListener("mouseup",this.endCrop),window.removeEventListener("touchmove",this.createCrop),window.removeEventListener("touchend",this.endCrop)},startCrop:function(){this.crop=!0},stopCrop:function(){this.crop=!1},clearCrop:function(){this.cropping=!1,this.cropW=0,this.cropH=0},cropMove:function(e){if(e.preventDefault(),!this.canMoveBox)return this.crop=!1,this.startMove(e),!1;if(e.touches&&2===e.touches.length)return this.crop=!1,this.startMove(e),this.leaveCrop(),!1;window.addEventListener("mousemove",this.moveCrop),window.addEventListener("mouseup",this.leaveCrop),window.addEventListener("touchmove",this.moveCrop),window.addEventListener("touchend",this.leaveCrop);var t,r,o="clientX"in e?e.clientX:e.touches[0].clientX,n="clientY"in e?e.clientY:e.touches[0].clientY;t=o-this.cropOffsertX,r=n-this.cropOffsertY,this.cropX=t,this.cropY=r,this.$emit("cropMoving",{moving:!0,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})},moveCrop:function(e,t){var r=this,o=0,n=0;e&&(e.preventDefault(),o="clientX"in e?e.clientX:e.touches[0].clientX,n="clientY"in e?e.clientY:e.touches[0].clientY),this.$nextTick((function(){var e,i,s=o-r.cropX,a=n-r.cropY;if(t&&(s=r.cropOffsertX,a=r.cropOffsertY),e=s<=0?0:s+r.cropW>r.w?r.w-r.cropW:s,i=a<=0?0:a+r.cropH>r.h?r.h-r.cropH:a,r.centerBox){var c=r.getImgAxis();e<=c.x1&&(e=c.x1),e+r.cropW>c.x2&&(e=c.x2-r.cropW),i<=c.y1&&(i=c.y1),i+r.cropH>c.y2&&(i=c.y2-r.cropH)}r.cropOffsertX=e,r.cropOffsertY=i,r.$emit("cropMoving",{moving:!0,axis:r.getCropAxis()}),r.$emit("crop-moving",{moving:!0,axis:r.getCropAxis()})}))},getImgAxis:function(e,t,r){e=e||this.x,t=t||this.y,r=r||this.scale;var o={x1:0,x2:0,y1:0,y2:0},n=this.trueWidth*r,i=this.trueHeight*r;switch(this.rotate){case 0:o.x1=e+this.trueWidth*(1-r)/2,o.x2=o.x1+this.trueWidth*r,o.y1=t+this.trueHeight*(1-r)/2,o.y2=o.y1+this.trueHeight*r;break;case 1:case-1:case 3:case-3:o.x1=e+this.trueWidth*(1-r)/2+(n-i)/2,o.x2=o.x1+this.trueHeight*r,o.y1=t+this.trueHeight*(1-r)/2+(i-n)/2,o.y2=o.y1+this.trueWidth*r;break;default:o.x1=e+this.trueWidth*(1-r)/2,o.x2=o.x1+this.trueWidth*r,o.y1=t+this.trueHeight*(1-r)/2,o.y2=o.y1+this.trueHeight*r}return o},getCropAxis:function(){var e={x1:0,x2:0,y1:0,y2:0};return e.x1=this.cropOffsertX,e.x2=e.x1+this.cropW,e.y1=this.cropOffsertY,e.y2=e.y1+this.cropH,e},leaveCrop:function(e){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.$emit("cropMoving",{moving:!1,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!1,axis:this.getCropAxis()})},getCropChecked:function(e){var t=this,r=document.createElement("canvas"),o=new Image,n=this.rotate,i=this.trueWidth,s=this.trueHeight,a=this.cropOffsertX,c=this.cropOffsertY;function u(e,t){r.width=Math.round(e),r.height=Math.round(t)}o.onload=function(){if(0!==t.cropW){var l=r.getContext("2d"),d=1;t.high&!t.full&&(d=window.devicePixelRatio),1!==t.enlarge&!t.full&&(d=Math.abs(Number(t.enlarge)));var p=t.cropW*d,h=t.cropH*d,f=i*t.scale*d,g=s*t.scale*d,m=(t.x-a+t.trueWidth*(1-t.scale)/2)*d,y=(t.y-c+t.trueHeight*(1-t.scale)/2)*d;switch(u(p,h),l.save(),n){case 0:t.full?(u(p/t.scale,h/t.scale),l.drawImage(o,m/t.scale,y/t.scale,f/t.scale,g/t.scale)):l.drawImage(o,m,y,f,g);break;case 1:case-3:t.full?(u(p/t.scale,h/t.scale),m=m/t.scale+(f/t.scale-g/t.scale)/2,y=y/t.scale+(g/t.scale-f/t.scale)/2,l.rotate(90*n*Math.PI/180),l.drawImage(o,y,-m-g/t.scale,f/t.scale,g/t.scale)):(m+=(f-g)/2,y+=(g-f)/2,l.rotate(90*n*Math.PI/180),l.drawImage(o,y,-m-g,f,g));break;case 2:case-2:t.full?(u(p/t.scale,h/t.scale),l.rotate(90*n*Math.PI/180),m/=t.scale,y/=t.scale,l.drawImage(o,-m-f/t.scale,-y-g/t.scale,f/t.scale,g/t.scale)):(l.rotate(90*n*Math.PI/180),l.drawImage(o,-m-f,-y-g,f,g));break;case 3:case-1:t.full?(u(p/t.scale,h/t.scale),m=m/t.scale+(f/t.scale-g/t.scale)/2,y=y/t.scale+(g/t.scale-f/t.scale)/2,l.rotate(90*n*Math.PI/180),l.drawImage(o,-y-f/t.scale,m,f/t.scale,g/t.scale)):(m+=(f-g)/2,y+=(g-f)/2,l.rotate(90*n*Math.PI/180),l.drawImage(o,-y-f,m,f,g));break;default:t.full?(u(p/t.scale,h/t.scale),l.drawImage(o,m/t.scale,y/t.scale,f/t.scale,g/t.scale)):l.drawImage(o,m,y,f,g)}l.restore()}else{var v=i*t.scale,C=s*t.scale,k=r.getContext("2d");switch(k.save(),n){case 0:u(v,C),k.drawImage(o,0,0,v,C);break;case 1:case-3:u(C,v),k.rotate(90*n*Math.PI/180),k.drawImage(o,0,-C,v,C);break;case 2:case-2:u(v,C),k.rotate(90*n*Math.PI/180),k.drawImage(o,-v,-C,v,C);break;case 3:case-1:u(C,v),k.rotate(90*n*Math.PI/180),k.drawImage(o,-v,0,v,C);break;default:u(v,C),k.drawImage(o,0,0,v,C)}k.restore()}e(r)},"data"!==this.img.substr(0,4)&&(o.crossOrigin="Anonymous"),o.src=this.imgs},getCropData:function(e){var t=this;this.getCropChecked((function(r){e(r.toDataURL("image/"+t.outputType,t.outputSize))}))},getCropBlob:function(e){var t=this;this.getCropChecked((function(r){r.toBlob((function(t){return e(t)}),"image/"+t.outputType,t.outputSize)}))},showPreview:function(){var e=this;if(!this.isCanShow)return!1;this.isCanShow=!1,setTimeout((function(){e.isCanShow=!0}),16);var t=this.cropW,r=this.cropH,o=this.scale,n={};n.div={width:"".concat(t,"px"),height:"".concat(r,"px")};var i=(this.x-this.cropOffsertX)/o,s=(this.y-this.cropOffsertY)/o;n.w=t,n.h=r,n.url=this.imgs,n.img={width:"".concat(this.trueWidth,"px"),height:"".concat(this.trueHeight,"px"),transform:"scale(".concat(o,")translate3d(").concat(i,"px, ").concat(s,"px, ").concat(0,"px)rotateZ(").concat(90*this.rotate,"deg)")},n.html='\n      <div class="show-preview" style="width: '.concat(n.w,"px; height: ").concat(n.h,'px; overflow: hidden">\n        <div style="width: ').concat(t,"px; height: ").concat(r,'px">\n          <img src=').concat(n.url,' style="width: ').concat(this.trueWidth,"px; height: ").concat(this.trueHeight,"px; transform:\n          scale(").concat(o,")translate3d(").concat(i,"px, ").concat(s,"px, ").concat(0,"px)rotateZ(").concat(90*this.rotate,'deg)">\n        </div>\n      </div>'),this.$emit("realTime",n),this.$emit("real-time",n)},reload:function(){var e=this,t=new Image;t.onload=function(){e.w=parseFloat(window.getComputedStyle(e.$refs.cropper).width),e.h=parseFloat(window.getComputedStyle(e.$refs.cropper).height),e.trueWidth=t.width,e.trueHeight=t.height,e.original?e.scale=1:e.scale=e.checkedMode(),e.$nextTick((function(){e.x=-(e.trueWidth-e.trueWidth*e.scale)/2+(e.w-e.trueWidth*e.scale)/2,e.y=-(e.trueHeight-e.trueHeight*e.scale)/2+(e.h-e.trueHeight*e.scale)/2,e.loading=!1,e.autoCrop&&e.goAutoCrop(),e.$emit("img-load","success"),e.$emit("imgLoad","success"),setTimeout((function(){e.showPreview()}),20)}))},t.onerror=function(){e.$emit("imgLoad","error"),e.$emit("img-load","error")},t.src=this.imgs},checkedMode:function(){var e=1,t=(this.trueWidth,this.trueHeight),r=this.mode.split(" ");switch(r[0]){case"contain":this.trueWidth>this.w&&(e=this.w/this.trueWidth),this.trueHeight*e>this.h&&(e=this.h/this.trueHeight);break;case"cover":(t*=e=this.w/this.trueWidth)<this.h&&(e=(t=this.h)/this.trueHeight);break;default:try{var o=r[0];if(-1!==o.search("px")){o=o.replace("px","");var n=parseFloat(o)/this.trueWidth,i=1,s=r[1];-1!==s.search("px")&&(s=s.replace("px",""),i=(t=parseFloat(s))/this.trueHeight),e=Math.min(n,i)}if(-1!==o.search("%")&&(o=o.replace("%",""),e=parseFloat(o)/100*this.w/this.trueWidth),2===r.length&&"auto"===o){var a=r[1];-1!==a.search("px")&&(a=a.replace("px",""),e=(t=parseFloat(a))/this.trueHeight),-1!==a.search("%")&&(a=a.replace("%",""),e=(t=parseFloat(a)/100*this.h)/this.trueHeight)}}catch(t){e=1}}return e},goAutoCrop:function(e,t){if(""!==this.imgs&&null!==this.imgs){this.clearCrop(),this.cropping=!0;var r=this.w,o=this.h;if(this.centerBox){var n=Math.abs(this.rotate)%2>0,i=(n?this.trueHeight:this.trueWidth)*this.scale,s=(n?this.trueWidth:this.trueHeight)*this.scale;r=i<r?i:r,o=s<o?s:o}var a=e||parseFloat(this.autoCropWidth),c=t||parseFloat(this.autoCropHeight);0!==a&&0!==c||(a=.8*r,c=.8*o),a=a>r?r:a,c=c>o?o:c,this.fixed&&(c=a/this.fixedNumber[0]*this.fixedNumber[1]),c>this.h&&(a=(c=this.h)/this.fixedNumber[1]*this.fixedNumber[0]),this.changeCrop(a,c)}},changeCrop:function(e,t){var r=this;if(this.centerBox){var o=this.getImgAxis();e>o.x2-o.x1&&(t=(e=o.x2-o.x1)/this.fixedNumber[0]*this.fixedNumber[1]),t>o.y2-o.y1&&(e=(t=o.y2-o.y1)/this.fixedNumber[1]*this.fixedNumber[0])}this.cropW=e,this.cropH=t,this.checkCropLimitSize(),this.$nextTick((function(){r.cropOffsertX=(r.w-r.cropW)/2,r.cropOffsertY=(r.h-r.cropH)/2,r.centerBox&&r.moveCrop(null,!0)}))},refresh:function(){var e=this;this.img,this.imgs="",this.scale=1,this.crop=!1,this.rotate=0,this.w=0,this.h=0,this.trueWidth=0,this.trueHeight=0,this.clearCrop(),this.$nextTick((function(){e.checkedImg()}))},rotateLeft:function(){this.rotate=this.rotate<=-3?0:this.rotate-1},rotateRight:function(){this.rotate=this.rotate>=3?0:this.rotate+1},rotateClear:function(){this.rotate=0},checkoutImgAxis:function(e,t,r){e=e||this.x,t=t||this.y,r=r||this.scale;var o=!0;if(this.centerBox){var n=this.getImgAxis(e,t,r),i=this.getCropAxis();n.x1>=i.x1&&(o=!1),n.x2<=i.x2&&(o=!1),n.y1>=i.y1&&(o=!1),n.y2<=i.y2&&(o=!1)}return o}},mounted:function(){this.support="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":"DOMMouseScroll";var e=this,t=navigator.userAgent;this.isIOS=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(t,r,o){for(var n=atob(this.toDataURL(r,o).split(",")[1]),i=n.length,s=new Uint8Array(i),a=0;a<i;a++)s[a]=n.charCodeAt(a);t(new Blob([s],{type:e.type||"image/png"}))}}),this.showPreview(),this.checkedImg()},destroyed:function(){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.cancelScale()}};r(125);var c=function(e,t,r,o,n,i,s,a){var c,u="function"==typeof e?e.options:e;if(t&&(u.render=t,u.staticRenderFns=[],u._compiled=!0),i&&(u._scopeId="data-v-"+i),c)if(u.functional){u._injectStyles=c;var l=u.render;u.render=function(e,t){return c.call(t),l(e,t)}}else{var d=u.beforeCreate;u.beforeCreate=d?[].concat(d,c):[c]}return{exports:e,options:u}}(a,e,0,0,0,"8ed66ddc");const u=c.exports;var l=function(e){e.component("VueCropper",u)};"undefined"!=typeof window&&window.Vue&&l(window.Vue);const d={version:"0.5.11",install:l,VueCropper:u,vueCropper:u}})(),o})())}}]);