UNPKG

@lgd-utils/request-queue

Version:
14 lines (13 loc) 33 kB
function _toConsumableArray(t){return _arrayWithoutHoles(t)||_iterableToArray(t)||_unsupportedIterableToArray(t)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(t,r){if(t){if("string"==typeof t)return _arrayLikeToArray(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(t):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?_arrayLikeToArray(t,r):void 0}}function _iterableToArray(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}function _arrayWithoutHoles(t){if(Array.isArray(t))return _arrayLikeToArray(t)}function _arrayLikeToArray(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e<r;e++)n[e]=t[e];return n}function _classCallCheck(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function _createClass(t,r,e){return r&&_defineProperties(t.prototype,r),e&&_defineProperties(t,e),t}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var LgdUtilsRequestQueue=function(t){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */function r(t,r,e,n){return new(e||(e=Promise))((function(o,i){function a(t){try{s(n.next(t))}catch(r){i(r)}}function u(t){try{s(n.throw(t))}catch(r){i(r)}}function s(t){var r;t.done?o(t.value):(r=t.value,r instanceof e?r:new e((function(t){t(r)}))).then(a,u)}s((n=n.apply(t,r||[])).next())}))}var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var n=function(t){return t};var o=function(t,r,e){switch(e.length){case 0:return t.call(r);case 1:return t.call(r,e[0]);case 2:return t.call(r,e[0],e[1]);case 3:return t.call(r,e[0],e[1],e[2])}return t.apply(r,e)},i=o,a=Math.max;var u=function(t,r,e){return r=a(void 0===r?t.length-1:r,0),function(){for(var n=arguments,o=-1,u=a(n.length-r,0),s=Array(u);++o<u;)s[o]=n[r+o];o=-1;for(var c=Array(r+1);++o<r;)c[o]=n[o];return c[r]=e(s),i(t,this,c)}};var s=function(t){return function(){return t}},c="object"==_typeof(e)&&e&&e.Object===Object&&e,f=c,l="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,h=f||l||Function("return this")(),v=h.Symbol,p=Object.prototype,y=p.hasOwnProperty,_=p.toString,b=v?v.toStringTag:void 0;var d=Object.prototype.toString;var g=function(t){var r=y.call(t,b),e=t[b];try{t[b]=void 0;var n=!0}catch(i){}var o=_.call(t);return n&&(r?t[b]=e:delete t[b]),o},j=function(t){return d.call(t)},m=v?v.toStringTag:void 0;var w=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":m&&m in Object(t)?g(t):j(t)};var A=function(t){var r=_typeof(t);return null!=t&&("object"==r||"function"==r)},O=w,x=A;var k,S=function(t){if(!x(t))return!1;var r=O(t);return"[object Function]"==r||"[object GeneratorFunction]"==r||"[object AsyncFunction]"==r||"[object Proxy]"==r},q=h["__core-js_shared__"],T=(k=/[^.]+$/.exec(q&&q.keys&&q.keys.IE_PROTO||""))?"Symbol(src)_1."+k:"";var R=Function.prototype.toString;var P=function(t){if(null!=t){try{return R.call(t)}catch(r){}try{return t+""}catch(r){}}return""},C=S,E=function(t){return!!T&&T in t},I=A,z=P,W=/^\[object .+?Constructor\]$/,M=RegExp("^"+Function.prototype.toString.call(Object.prototype.hasOwnProperty).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var U=function(t){return!(!I(t)||E(t))&&(C(t)?M:W).test(z(t))},D=function(t,r){return null==t?void 0:t[r]};var F=function(t,r){var e=D(t,r);return U(e)?e:void 0},$=F,H=function(){try{var t=$(Object,"defineProperty");return t({},"",{}),t}catch(r){}}(),L=s,B=H,N=Date.now;var K=function(t){var r=0,e=0;return function(){var n=N(),o=16-(n-e);if(e=n,o>0){if(++r>=800)return arguments[0]}else r=0;return t.apply(void 0,arguments)}},V=K(B?function(t,r){return B(t,"toString",{configurable:!0,enumerable:!1,value:L(r),writable:!0})}:n),Q=n,G=u,J=V;var X=function(t,r){return J(G(t,r,Q),t+"")},Y=F(h,"WeakMap"),Z=Y&&new Y,tt=Z,rt=tt?function(t,r){return tt.set(t,r),t}:n,et=A,nt=Object.create,ot=function(){function t(){}return function(r){if(!et(r))return{};if(nt)return nt(r);t.prototype=r;var e=new t;return t.prototype=void 0,e}}(),it=ot,at=A;var ut=function(t){return function(){var r=arguments;switch(r.length){case 0:return new t;case 1:return new t(r[0]);case 2:return new t(r[0],r[1]);case 3:return new t(r[0],r[1],r[2]);case 4:return new t(r[0],r[1],r[2],r[3]);case 5:return new t(r[0],r[1],r[2],r[3],r[4]);case 6:return new t(r[0],r[1],r[2],r[3],r[4],r[5]);case 7:return new t(r[0],r[1],r[2],r[3],r[4],r[5],r[6])}var e=it(t.prototype),n=t.apply(e,r);return at(n)?n:e}},st=ut,ct=h;var ft=function(t,r,e){var n=1&r,o=st(t);return function r(){var i=this&&this!==ct&&this instanceof r?o:t;return i.apply(n?e:this,arguments)}},lt=Math.max;var ht=function(t,r,e,n){for(var o=-1,i=t.length,a=e.length,u=-1,s=r.length,c=lt(i-a,0),f=Array(s+c),l=!n;++u<s;)f[u]=r[u];for(;++o<a;)(l||o<i)&&(f[e[o]]=t[o]);for(;c--;)f[u++]=t[o++];return f},vt=Math.max;var pt=function(t,r,e,n){for(var o=-1,i=t.length,a=-1,u=e.length,s=-1,c=r.length,f=vt(i-u,0),l=Array(f+c),h=!n;++o<f;)l[o]=t[o];for(var v=o;++s<c;)l[v+s]=r[s];for(;++a<u;)(h||o<i)&&(l[v+e[a]]=t[o++]);return l};var yt=function(t,r){for(var e=t.length,n=0;e--;)t[e]===r&&++n;return n};var _t=function(){};function bt(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}(bt.prototype=ot(_t.prototype)).constructor=bt;var dt=bt;var gt=Z,jt=gt?function(t){return gt.get(t)}:function(){},mt={},wt=Object.prototype.hasOwnProperty;var At=function(t){for(var r=t.name+"",e=mt[r],n=wt.call(mt,r)?e.length:0;n--;){var o=e[n],i=o.func;if(null==i||i==t)return o.name}return r};function Ot(t,r){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!r,this.__index__=0,this.__values__=void 0}(Ot.prototype=ot(_t.prototype)).constructor=Ot;var xt=Array.isArray;var kt=function(t){return null!=t&&"object"==_typeof(t)};var St=function(t,r){var e=-1,n=t.length;for(r||(r=Array(n));++e<n;)r[e]=t[e];return r},qt=dt,Tt=Ot,Rt=St;var Pt=dt,Ct=Ot,Et=xt,It=kt,zt=function(t){if(t instanceof qt)return t.clone();var r=new Tt(t.__wrapped__,t.__chain__);return r.__actions__=Rt(t.__actions__),r.__index__=t.__index__,r.__values__=t.__values__,r},Wt=Object.prototype.hasOwnProperty;function Mt(t){if(It(t)&&!Et(t)&&!(t instanceof Pt)){if(t instanceof Ct)return t;if(Wt.call(t,"__wrapped__"))return zt(t)}return new Ct(t)}(Mt.prototype=_t.prototype).constructor=Mt;var Ut=dt,Dt=jt,Ft=At,$t=Mt;var Ht=function(t){var r=Ft(t),e=$t[r];if("function"!=typeof e||!(r in Ut.prototype))return!1;if(t===e)return!0;var n=Dt(e);return!!n&&t===n[0]},Lt=K(rt),Bt=/\{\n\/\* \[wrapped with (.+)\] \*/,Nt=/,? & /;var Kt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/;var Vt=function(t,r){for(var e=-1,n=null==t?0:t.length;++e<n&&!1!==r(t[e],e,t););return t};var Qt=function(t,r,e,n){for(var o=t.length,i=e+(n?1:-1);n?i--:++i<o;)if(r(t[i],i,t))return i;return-1},Gt=function(t){return t!=t},Jt=function(t,r,e){for(var n=e-1,o=t.length;++n<o;)if(t[n]===r)return n;return-1};var Xt=function(t,r,e){return r==r?Jt(t,r,e):Qt(t,Gt,e)};var Yt=Vt,Zt=function(t,r){return!!(null==t?0:t.length)&&Xt(t,r,0)>-1},tr=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]];var rr=function(t){var r=t.match(Bt);return r?r[1].split(Nt):[]},er=function(t,r){var e=r.length;if(!e)return t;var n=e-1;return r[n]=(e>1?"& ":"")+r[n],r=r.join(e>2?", ":" "),t.replace(Kt,"{\n/* [wrapped with "+r+"] */\n")},nr=V,or=function(t,r){return Yt(tr,(function(e){var n="_."+e[0];r&e[1]&&!Zt(t,n)&&t.push(n)})),t.sort()};var ir=function(t,r,e){var n=r+"";return nr(t,er(n,or(rr(n),e)))},ar=Ht,ur=Lt,sr=ir;var cr=function(t,r,e,n,o,i,a,u,s,c){var f=8&r;r|=f?32:64,4&(r&=~(f?64:32))||(r&=-4);var l=[t,r,o,f?i:void 0,f?a:void 0,f?void 0:i,f?void 0:a,u,s,c],h=e.apply(void 0,l);return ar(t)&&ur(h,l),h.placeholder=n,sr(h,t,r)};var fr=function(t){return t.placeholder},lr=/^(?:0|[1-9]\d*)$/;var hr=function(t,r){var e=_typeof(t);return!!(r=null==r?9007199254740991:r)&&("number"==e||"symbol"!=e&&lr.test(t))&&t>-1&&t%1==0&&t<r},vr=St,pr=hr,yr=Math.min;var _r="__lodash_placeholder__";var br=function(t,r){for(var e=-1,n=t.length,o=0,i=[];++e<n;){var a=t[e];a!==r&&a!==_r||(t[e]=_r,i[o++]=e)}return i},dr=ht,gr=pt,jr=yt,mr=ut,wr=cr,Ar=fr,Or=function(t,r){for(var e=t.length,n=yr(r.length,e),o=vr(t);n--;){var i=r[n];t[n]=pr(i,e)?o[i]:void 0}return t},xr=br,kr=h;var Sr=function t(r,e,n,o,i,a,u,s,c,f){var l=128&e,h=1&e,v=2&e,p=24&e,y=512&e,_=v?void 0:mr(r);return function b(){for(var d=arguments.length,g=Array(d),j=d;j--;)g[j]=arguments[j];if(p)var m=Ar(b),w=jr(g,m);if(o&&(g=dr(g,o,i,p)),a&&(g=gr(g,a,u,p)),d-=w,p&&d<f){var A=xr(g,m);return wr(r,e,t,b.placeholder,n,g,A,s,c,f-d)}var O=h?n:this,x=v?O[r]:r;return d=g.length,s?g=Or(g,s):y&&d>1&&g.reverse(),l&&c<d&&(g.length=c),this&&this!==kr&&this instanceof b&&(x=_||mr(x)),x.apply(O,g)}},qr=o,Tr=ut,Rr=Sr,Pr=cr,Cr=fr,Er=br,Ir=h;var zr=o,Wr=ut,Mr=h;var Ur=ht,Dr=pt,Fr=br,$r="__lodash_placeholder__",Hr=128,Lr=Math.min;var Br=/\s/;var Nr=function(t){for(var r=t.length;r--&&Br.test(t.charAt(r)););return r},Kr=/^\s+/;var Vr=w,Qr=kt;var Gr=function(t){return"symbol"==_typeof(t)||Qr(t)&&"[object Symbol]"==Vr(t)},Jr=function(t){return t?t.slice(0,Nr(t)+1).replace(Kr,""):t},Xr=A,Yr=Gr,Zr=/^[-+]0x[0-9a-f]+$/i,te=/^0b[01]+$/i,re=/^0o[0-7]+$/i,ee=parseInt;var ne=function(t){if("number"==typeof t)return t;if(Yr(t))return NaN;if(Xr(t)){var r="function"==typeof t.valueOf?t.valueOf():t;t=Xr(r)?r+"":r}if("string"!=typeof t)return 0===t?t:+t;t=Jr(t);var e=te.test(t);return e||re.test(t)?ee(t.slice(2),e?2:8):Zr.test(t)?NaN:+t},oe=1/0;var ie=function(t){return t?(t=ne(t))===oe||t===-1/0?17976931348623157e292*(t<0?-1:1):t==t?t:0:0===t?t:0};var ae=rt,ue=ft,se=function(t,r,e){var n=Tr(t);return function o(){for(var i=arguments.length,a=Array(i),u=i,s=Cr(o);u--;)a[u]=arguments[u];var c=i<3&&a[0]!==s&&a[i-1]!==s?[]:Er(a,s);if((i-=c.length)<e)return Pr(t,r,Rr,o.placeholder,void 0,a,c,void 0,void 0,e-i);var f=this&&this!==Ir&&this instanceof o?n:t;return qr(f,this,a)}},ce=Sr,fe=function(t,r,e,n){var o=1&r,i=Wr(t);return function r(){for(var a=-1,u=arguments.length,s=-1,c=n.length,f=Array(c+u),l=this&&this!==Mr&&this instanceof r?i:t;++s<c;)f[s]=n[s];for(;u--;)f[s++]=arguments[++a];return zr(l,o?e:this,f)}},le=jt,he=function(t,r){var e=t[1],n=r[1],o=e|n;if(!(o<131)&&!(n==Hr&&8==e||n==Hr&&256==e&&t[7].length<=r[8]||384==n&&r[7].length<=r[8]&&8==e))return t;1&n&&(t[2]=r[2],o|=1&e?0:4);var i=r[3];if(i){var a=t[3];t[3]=a?Ur(a,i,r[4]):i,t[4]=a?Fr(t[3],$r):r[4]}return(i=r[5])&&(t[5]=(a=t[5])?Dr(a,i,r[6]):i,t[6]=a?Fr(t[5],$r):r[6]),(i=r[7])&&(t[7]=i),n&Hr&&(t[8]=null==t[8]?r[8]:Lr(t[8],r[8])),null==t[9]&&(t[9]=r[9]),t[0]=r[0],t[1]=o,t},ve=Lt,pe=ir,ye=function(t){var r=ie(t),e=r%1;return r==r?e?r-e:r:0},_e=Math.max;var be=function(t,r,e,n,o,i,a,u){var s=2&r;if(!s&&"function"!=typeof t)throw new TypeError("Expected a function");var c=n?n.length:0;if(c||(r&=-97,n=o=void 0),a=void 0===a?a:_e(ye(a),0),u=void 0===u?u:ye(u),c-=o?o.length:0,64&r){var f=n,l=o;n=o=void 0}var h=s?void 0:le(t),v=[t,r,e,n,o,f,l,i,a,u];if(h&&he(v,h),t=v[0],r=v[1],e=v[2],n=v[3],o=v[4],!(u=v[9]=void 0===v[9]?s?0:t.length:_e(v[9]-c,0))&&24&r&&(r&=-25),r&&1!=r)p=8==r||16==r?se(t,r,u):32!=r&&33!=r||o.length?ce.apply(void 0,v):fe(t,r,e,n);else var p=ue(t,r,e);return pe((h?ae:ve)(p,v),t,r)},de=fr,ge=br,je=X((function(t,r,e){var n=1;if(e.length){var o=ge(e,de(je));n|=32}return be(t,n,r,e,o)}));je.placeholder={};var me=je,we=w,Ae=kt;var Oe=function(t){return!0===t||!1===t||Ae(t)&&"[object Boolean]"==we(t)},xe=w,ke=kt;var Se=function(t){return"number"==typeof t||ke(t)&&"[object Number]"==xe(t)};var qe=function(t,r){return function(e){return t(r(e))}},Te=qe(Object.getPrototypeOf,Object),Re=w,Pe=Te,Ce=kt,Ee=Function.prototype.toString,Ie=Object.prototype.hasOwnProperty,ze=Ee.call(Object);var We=function(t){if(!Ce(t)||"[object Object]"!=Re(t))return!1;var r=Pe(t);if(null===r)return!0;var e=Ie.call(r,"constructor")&&r.constructor;return"function"==typeof e&&e instanceof e&&Ee.call(e)==ze},Me=w,Ue=xt,De=kt;var Fe=function(t){return"string"==typeof t||!Ue(t)&&De(t)&&"[object String]"==Me(t)};var $e=function(t,r){for(var e=-1,n=null==t?0:t.length,o=Array(n);++e<n;)o[e]=r(t[e],e,t);return o};var He=function(t,r){return t===r||t!=t&&r!=r},Le=He;var Be=function(t,r){for(var e=t.length;e--;)if(Le(t[e][0],r))return e;return-1},Ne=Be,Ke=Array.prototype.splice;var Ve=Be;var Qe=Be;var Ge=Be;var Je=function(t){var r=this.__data__,e=Ne(r,t);return!(e<0)&&(e==r.length-1?r.pop():Ke.call(r,e,1),--this.size,!0)},Xe=function(t){var r=this.__data__,e=Ve(r,t);return e<0?void 0:r[e][1]},Ye=function(t){return Qe(this.__data__,t)>-1},Ze=function(t,r){var e=this.__data__,n=Ge(e,t);return n<0?(++this.size,e.push([t,r])):e[n][1]=r,this};function tn(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}tn.prototype.clear=function(){this.__data__=[],this.size=0},tn.prototype.delete=Je,tn.prototype.get=Xe,tn.prototype.has=Ye,tn.prototype.set=Ze;var rn=tn,en=rn;var nn=function(){this.__data__=new en,this.size=0};var on=function(t){var r=this.__data__,e=r.delete(t);return this.size=r.size,e};var an=function(t){return this.__data__.get(t)};var un=function(t){return this.__data__.has(t)},sn=F(h,"Map"),cn=F(Object,"create"),fn=cn;var ln=cn,hn=Object.prototype.hasOwnProperty;var vn=cn,pn=Object.prototype.hasOwnProperty;var yn=cn;var _n=function(t){var r=this.has(t)&&delete this.__data__[t];return this.size-=r?1:0,r},bn=function(t){var r=this.__data__;if(ln){var e=r[t];return"__lodash_hash_undefined__"===e?void 0:e}return hn.call(r,t)?r[t]:void 0},dn=function(t){var r=this.__data__;return vn?void 0!==r[t]:pn.call(r,t)},gn=function(t,r){var e=this.__data__;return this.size+=this.has(t)?0:1,e[t]=yn&&void 0===r?"__lodash_hash_undefined__":r,this};function jn(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}jn.prototype.clear=function(){this.__data__=fn?fn(null):{},this.size=0},jn.prototype.delete=_n,jn.prototype.get=bn,jn.prototype.has=dn,jn.prototype.set=gn;var mn=jn,wn=rn,An=sn;var On=function(t){var r=_typeof(t);return"string"==r||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==t:null===t};var xn=function(t,r){var e=t.__data__;return On(r)?e["string"==typeof r?"string":"hash"]:e.map},kn=xn;var Sn=xn;var qn=xn;var Tn=xn;var Rn=function(t){var r=kn(this,t).delete(t);return this.size-=r?1:0,r},Pn=function(t){return Sn(this,t).get(t)},Cn=function(t){return qn(this,t).has(t)},En=function(t,r){var e=Tn(this,t),n=e.size;return e.set(t,r),this.size+=e.size==n?0:1,this};function In(t){var r=-1,e=null==t?0:t.length;for(this.clear();++r<e;){var n=t[r];this.set(n[0],n[1])}}In.prototype.clear=function(){this.size=0,this.__data__={hash:new mn,map:new(An||wn),string:new mn}},In.prototype.delete=Rn,In.prototype.get=Pn,In.prototype.has=Cn,In.prototype.set=En;var zn=In,Wn=rn,Mn=sn,Un=zn;var Dn=rn,Fn=on,$n=an,Hn=un,Ln=function(t,r){var e=this.__data__;if(e instanceof Wn){var n=e.__data__;if(!Mn||n.length<199)return n.push([t,r]),this.size=++e.size,this;e=this.__data__=new Un(n)}return e.set(t,r),this.size=e.size,this};function Bn(t){var r=this.__data__=new Dn(t);this.size=r.size}Bn.prototype.clear=nn,Bn.prototype.delete=Fn,Bn.prototype.get=$n,Bn.prototype.has=Hn,Bn.prototype.set=Ln;var Nn=Bn,Kn=H;var Vn=function(t,r,e){"__proto__"==r&&Kn?Kn(t,r,{configurable:!0,enumerable:!0,value:e,writable:!0}):t[r]=e},Qn=Vn,Gn=He,Jn=Object.prototype.hasOwnProperty;var Xn=function(t,r,e){var n=t[r];Jn.call(t,r)&&Gn(n,e)&&(void 0!==e||r in t)||Qn(t,r,e)},Yn=Xn,Zn=Vn;var to=function(t,r,e,n){var o=!e;e||(e={});for(var i=-1,a=r.length;++i<a;){var u=r[i],s=n?n(e[u],t[u],u,e,t):void 0;void 0===s&&(s=t[u]),o?Zn(e,u,s):Yn(e,u,s)}return e};var ro=function(t,r){for(var e=-1,n=Array(t);++e<t;)n[e]=r(e);return n},eo=w,no=kt;var oo=function(t){return no(t)&&"[object Arguments]"==eo(t)},io=kt,ao=Object.prototype,uo=ao.hasOwnProperty,so=ao.propertyIsEnumerable,co=oo(function(){return arguments}())?oo:function(t){return io(t)&&uo.call(t,"callee")&&!so.call(t,"callee")},fo={exports:{}};var lo=function(){return!1};!function(t,r){var e=r&&!r.nodeType&&r,n=e&&t&&!t.nodeType&&t,o=n&&n.exports===e?h.Buffer:void 0;t.exports=(o?o.isBuffer:void 0)||lo}(fo,fo.exports);var ho=function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991},vo=w,po=ho,yo=kt,_o={};_o["[object Float32Array]"]=_o["[object Float64Array]"]=_o["[object Int8Array]"]=_o["[object Int16Array]"]=_o["[object Int32Array]"]=_o["[object Uint8Array]"]=_o["[object Uint8ClampedArray]"]=_o["[object Uint16Array]"]=_o["[object Uint32Array]"]=!0,_o["[object Arguments]"]=_o["[object Array]"]=_o["[object ArrayBuffer]"]=_o["[object Boolean]"]=_o["[object DataView]"]=_o["[object Date]"]=_o["[object Error]"]=_o["[object Function]"]=_o["[object Map]"]=_o["[object Number]"]=_o["[object Object]"]=_o["[object RegExp]"]=_o["[object Set]"]=_o["[object String]"]=_o["[object WeakMap]"]=!1;var bo=function(t){return yo(t)&&po(t.length)&&!!_o[vo(t)]};var go=function(t){return function(r){return t(r)}},jo={exports:{}};!function(t,r){var e=r&&!r.nodeType&&r,n=e&&t&&!t.nodeType&&t,o=n&&n.exports===e&&c.process,i=function(){try{var t=n&&n.require&&n.require("util").types;return t||o&&o.binding&&o.binding("util")}catch(r){}}();t.exports=i}(jo,jo.exports);var mo=bo,wo=jo.exports,Ao=wo&&wo.isTypedArray,Oo=Ao?go(Ao):mo,xo=ro,ko=co,So=xt,qo=fo.exports,To=hr,Ro=Oo,Po=Object.prototype.hasOwnProperty;var Co=function(t,r){var e=So(t),n=!e&&ko(t),o=!e&&!n&&qo(t),i=!e&&!n&&!o&&Ro(t),a=e||n||o||i,u=a?xo(t.length,String):[],s=u.length;for(var c in t)!r&&!Po.call(t,c)||a&&("length"==c||o&&("offset"==c||"parent"==c)||i&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||To(c,s))||u.push(c);return u},Eo=Object.prototype;var Io=function(t){var r=t&&t.constructor;return t===("function"==typeof r&&r.prototype||Eo)},zo=qe(Object.keys,Object),Wo=Io,Mo=zo,Uo=Object.prototype.hasOwnProperty;var Do=S,Fo=ho;var $o=function(t){return null!=t&&Fo(t.length)&&!Do(t)},Ho=Co,Lo=function(t){if(!Wo(t))return Mo(t);var r=[];for(var e in Object(t))Uo.call(t,e)&&"constructor"!=e&&r.push(e);return r},Bo=$o;var No=function(t){return Bo(t)?Ho(t):Lo(t)},Ko=to,Vo=No;var Qo=function(t,r){return t&&Ko(r,Vo(r),t)};var Go=A,Jo=Io,Xo=function(t){var r=[];if(null!=t)for(var e in Object(t))r.push(e);return r},Yo=Object.prototype.hasOwnProperty;var Zo=Co,ti=function(t){if(!Go(t))return Xo(t);var r=Jo(t),e=[];for(var n in t)("constructor"!=n||!r&&Yo.call(t,n))&&e.push(n);return e},ri=$o;var ei=function(t){return ri(t)?Zo(t,!0):ti(t)},ni=to,oi=ei;var ii=function(t,r){return t&&ni(r,oi(r),t)},ai={exports:{}};!function(t,r){var e=r&&!r.nodeType&&r,n=e&&t&&!t.nodeType&&t,o=n&&n.exports===e?h.Buffer:void 0,i=o?o.allocUnsafe:void 0;t.exports=function(t,r){if(r)return t.slice();var e=t.length,n=i?i(e):new t.constructor(e);return t.copy(n),n}}(ai,ai.exports);var ui=function(){return[]},si=function(t,r){for(var e=-1,n=null==t?0:t.length,o=0,i=[];++e<n;){var a=t[e];r(a,e,t)&&(i[o++]=a)}return i},ci=Object.prototype.propertyIsEnumerable,fi=Object.getOwnPropertySymbols,li=fi?function(t){return null==t?[]:(t=Object(t),si(fi(t),(function(r){return ci.call(t,r)})))}:ui,hi=to,vi=li;var pi=function(t,r){return hi(t,vi(t),r)};var yi=function(t,r){for(var e=-1,n=r.length,o=t.length;++e<n;)t[o+e]=r[e];return t},_i=yi,bi=Te,di=li,gi=Object.getOwnPropertySymbols?function(t){for(var r=[];t;)_i(r,di(t)),t=bi(t);return r}:ui,ji=to,mi=gi;var wi=function(t,r){return ji(t,mi(t),r)},Ai=yi,Oi=xt;var xi=function(t,r,e){var n=r(t);return Oi(t)?n:Ai(n,e(t))},ki=xi,Si=li,qi=No;var Ti=function(t){return ki(t,qi,Si)},Ri=xi,Pi=gi,Ci=ei;var Ei=function(t){return Ri(t,Ci,Pi)},Ii=F(h,"DataView"),zi=sn,Wi=F(h,"Promise"),Mi=F(h,"Set"),Ui=Y,Di=w,Fi=P,$i="[object Map]",Hi="[object Promise]",Li="[object Set]",Bi="[object WeakMap]",Ni="[object DataView]",Ki=Fi(Ii),Vi=Fi(zi),Qi=Fi(Wi),Gi=Fi(Mi),Ji=Fi(Ui),Xi=Di;(Ii&&Xi(new Ii(new ArrayBuffer(1)))!=Ni||zi&&Xi(new zi)!=$i||Wi&&Xi(Wi.resolve())!=Hi||Mi&&Xi(new Mi)!=Li||Ui&&Xi(new Ui)!=Bi)&&(Xi=function(t){var r=Di(t),e="[object Object]"==r?t.constructor:void 0,n=e?Fi(e):"";if(n)switch(n){case Ki:return Ni;case Vi:return $i;case Qi:return Hi;case Gi:return Li;case Ji:return Bi}return r});var Yi=Xi,Zi=Object.prototype.hasOwnProperty;var ta=function(t){var r=t.length,e=new t.constructor(r);return r&&"string"==typeof t[0]&&Zi.call(t,"index")&&(e.index=t.index,e.input=t.input),e},ra=h.Uint8Array;var ea=function(t){var r=new t.constructor(t.byteLength);return new ra(r).set(new ra(t)),r},na=ea;var oa=/\w*$/;var ia=v?v.prototype:void 0,aa=ia?ia.valueOf:void 0;var ua=ea;var sa=ea,ca=function(t,r){var e=r?na(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.byteLength)},fa=function(t){var r=new t.constructor(t.source,oa.exec(t));return r.lastIndex=t.lastIndex,r},la=function(t){return aa?Object(aa.call(t)):{}},ha=function(t,r){var e=r?ua(t.buffer):t.buffer;return new t.constructor(e,t.byteOffset,t.length)};var va=function(t,r,e){var n=t.constructor;switch(r){case"[object ArrayBuffer]":return sa(t);case"[object Boolean]":case"[object Date]":return new n(+t);case"[object DataView]":return ca(t,e);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return ha(t,e);case"[object Map]":return new n;case"[object Number]":case"[object String]":return new n(t);case"[object RegExp]":return fa(t);case"[object Set]":return new n;case"[object Symbol]":return la(t)}},pa=ot,ya=Te,_a=Io;var ba=function(t){return"function"!=typeof t.constructor||_a(t)?{}:pa(ya(t))},da=Yi,ga=kt;var ja=function(t){return ga(t)&&"[object Map]"==da(t)},ma=jo.exports,wa=ma&&ma.isMap,Aa=wa?go(wa):ja,Oa=Yi,xa=kt;var ka=function(t){return xa(t)&&"[object Set]"==Oa(t)},Sa=jo.exports,qa=Sa&&Sa.isSet,Ta=qa?go(qa):ka,Ra=Nn,Pa=Vt,Ca=Xn,Ea=Qo,Ia=ii,za=ai.exports,Wa=St,Ma=pi,Ua=wi,Da=Ti,Fa=Ei,$a=Yi,Ha=ta,La=va,Ba=ba,Na=xt,Ka=fo.exports,Va=Aa,Qa=A,Ga=Ta,Ja=No,Xa=ei,Ya="[object Arguments]",Za="[object Function]",tu="[object Object]",ru={};ru[Ya]=ru["[object Array]"]=ru["[object ArrayBuffer]"]=ru["[object DataView]"]=ru["[object Boolean]"]=ru["[object Date]"]=ru["[object Float32Array]"]=ru["[object Float64Array]"]=ru["[object Int8Array]"]=ru["[object Int16Array]"]=ru["[object Int32Array]"]=ru["[object Map]"]=ru["[object Number]"]=ru[tu]=ru["[object RegExp]"]=ru["[object Set]"]=ru["[object String]"]=ru["[object Symbol]"]=ru["[object Uint8Array]"]=ru["[object Uint8ClampedArray]"]=ru["[object Uint16Array]"]=ru["[object Uint32Array]"]=!0,ru["[object Error]"]=ru[Za]=ru["[object WeakMap]"]=!1;var eu=function t(r,e,n,o,i,a){var u,s=1&e,c=2&e,f=4&e;if(n&&(u=i?n(r,o,i,a):n(r)),void 0!==u)return u;if(!Qa(r))return r;var l=Na(r);if(l){if(u=Ha(r),!s)return Wa(r,u)}else{var h=$a(r),v=h==Za||"[object GeneratorFunction]"==h;if(Ka(r))return za(r,s);if(h==tu||h==Ya||v&&!i){if(u=c||v?{}:Ba(r),!s)return c?Ua(r,Ia(u,r)):Ma(r,Ea(u,r))}else{if(!ru[h])return i?r:{};u=La(r,h,s)}}a||(a=new Ra);var p=a.get(r);if(p)return p;a.set(r,u),Ga(r)?r.forEach((function(o){u.add(t(o,e,n,o,r,a))})):Va(r)&&r.forEach((function(o,i){u.set(i,t(o,e,n,i,r,a))}));var y=l?void 0:(f?c?Fa:Da:c?Xa:Ja)(r);return Pa(y||r,(function(o,i){y&&(o=r[i=o]),Ca(u,i,t(o,e,n,i,r,a))})),u},nu=xt,ou=Gr,iu=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,au=/^\w*$/;var uu=function(t,r){if(nu(t))return!1;var e=_typeof(t);return!("number"!=e&&"symbol"!=e&&"boolean"!=e&&null!=t&&!ou(t))||(au.test(t)||!iu.test(t)||null!=r&&t in Object(r))},su=zn;function cu(t,r){if("function"!=typeof t||null!=r&&"function"!=typeof r)throw new TypeError("Expected a function");var e=function e(){var n=arguments,o=r?r.apply(this,n):n[0],i=e.cache;if(i.has(o))return i.get(o);var a=t.apply(this,n);return e.cache=i.set(o,a)||i,a};return e.cache=new(cu.Cache||su),e}cu.Cache=su;var fu=cu;var lu=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,hu=/\\(\\)?/g,vu=function(t){var r=fu(t,(function(t){return 500===e.size&&e.clear(),t})),e=r.cache;return r}((function(t){var r=[];return 46===t.charCodeAt(0)&&r.push(""),t.replace(lu,(function(t,e,n,o){r.push(n?o.replace(hu,"$1"):e||t)})),r})),pu=$e,yu=xt,_u=Gr,bu=v?v.prototype:void 0,du=bu?bu.toString:void 0;var gu=function t(r){if("string"==typeof r)return r;if(yu(r))return pu(r,t)+"";if(_u(r))return du?du.call(r):"";var e=r+"";return"0"==e&&1/r==-Infinity?"-0":e};var ju=xt,mu=uu,wu=vu,Au=function(t){return null==t?"":gu(t)};var Ou=function(t,r){return ju(t)?t:mu(t,r)?[t]:wu(Au(t))};var xu=Gr;var ku=function(t){if("string"==typeof t||xu(t))return t;var r=t+"";return"0"==r&&1/t==-Infinity?"-0":r},Su=Ou,qu=ku;var Tu=function(t,r){for(var e=0,n=(r=Su(r,t)).length;null!=t&&e<n;)t=t[qu(r[e++])];return e&&e==n?t:void 0},Ru=function(t,r,e){var n=-1,o=t.length;r<0&&(r=-r>o?0:o+r),(e=e>o?o:e)<0&&(e+=o),o=r>e?0:e-r>>>0,r>>>=0;for(var i=Array(o);++n<o;)i[n]=t[n+r];return i};var Pu=Ou,Cu=function(t){var r=null==t?0:t.length;return r?t[r-1]:void 0},Eu=function(t,r){return r.length<2?t:Tu(t,Ru(r,0,-1))},Iu=ku;var zu=We;var Wu=co,Mu=xt,Uu=v?v.isConcatSpreadable:void 0;var Du=yi,Fu=function(t){return Mu(t)||Wu(t)||!!(Uu&&t&&t[Uu])};var $u=function t(r,e,n,o,i){var a=-1,u=r.length;for(n||(n=Fu),i||(i=[]);++a<u;){var s=r[a];e>0&&n(s)?e>1?t(s,e-1,n,o,i):Du(i,s):o||(i[i.length]=s)}return i};var Hu=function(t){return(null==t?0:t.length)?$u(t,1):[]},Lu=u,Bu=V;var Nu=$e,Ku=eu,Vu=function(t,r){return r=Pu(r,t),null==(t=Eu(t,r))||delete t[Iu(Cu(r))]},Qu=Ou,Gu=to,Ju=function(t){return zu(t)?void 0:t},Xu=Ei,Yu=function(t){return Bu(Lu(t,void 0,Hu),t+"")}((function(t,r){var e={};if(null==t)return e;var n=!1;r=Nu(r,(function(r){return r=Qu(r,t),n||(n=r.length>1),r})),Gu(t,Xu(t),e),n&&(e=Ku(e,7,Ju));for(var o=r.length;o--;)Vu(e,r[o]);return e}));return t.default=function(){function t(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=r.completeHooks,n=r.destroyWhenError,o=r.destroyWhenErrorHooks,i=r.enableAwaitWhenRetry,a=r.enableContinueRetryWhenStop,u=r.limit,s=r.maxConcurrent,c=r.onAlways,f=r.onError,l=r.onSuccess,h=r.requestAdapter,v=r.requestAdapterApiConfig,p=r.requestList,y=r.retry,_=r.retryTimes;_classCallCheck(this,t),this.complete=0,this.destroyed=!1,this.errorKeys=[],this.progress=0,this.requestResult=[],this.requests=0,this.running=!1,this.successKeys=[],this.total=0;var b=function(){};this.completeHooks=Array.isArray(e)?e.filter(S):S(e)?[e]:[],this.destroyWhenError=!!Oe(n)&&n,this.destroyWhenErrorHooks=Array.isArray(o)?o.filter(S):S(o)?[o]:[],this.enableAwaitWhenRetry=!!Oe(i)&&i,this.enableContinueRetryWhenStop=!Oe(a)||a,this.maxConcurrent=Se(s)?s:Se(u)?u:6,this.onAlways=c||b,this.onError=f||b,this.onSuccess=l||b,this.requestAdapter=h||function(t){return Promise.resolve(t)},this.requestAdapterApiConfig=v||{},this.requestList=_toConsumableArray(Array.isArray(p)?p:[]),this.retryTimes=Se(_)?_:Se(y)?y:1,this.total=this.requestList.length,this._resolve=b,this._reject=b}return _createClass(t,[{key:"_assertPromisify",value:function(){return!this.completeHooks.length&&!this.destroyWhenErrorHooks.length}},{key:"_concurrent",value:function(t){var r=this;if(this._assertDisabled())return this;if(0===this.progress&&0===this.complete&&0===this.total&&0===this.requests)return this._assertPromisify()?this._resolve([]):this.completeHooks.forEach((function(t){return t([],r.progress)})),this;for(void 0===t&&(t=this.maxConcurrent);t--;)this._next();return this}},{key:"_assertDisabled",value:function(){return!(!this.destroyed&&this.running)}},{key:"_next",value:function(){var t=this.progress;if(t>=this.total||this._assertDisabled())return this;this.progress++,this._runRequestItem(t)}},{key:"_runRequestItem",value:function(t,e){return r(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,o,i,a,u=this;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!this.destroyed){r.next=2;break}return r.abrupt("return",this);case 2:if(n=e||this._getRequestItem()){r.next=5;break}return r.abrupt("return",this);case 5:return o=n,r.prev=6,r.next=9,Promise.resolve(n.request());case 9:i=r.sent,this.requestResult[t]={key:t,type:"SUCCESS",requestItem:o,data:this.onSuccess&&this.onSuccess(i,t)||i,isRequestQueue:!0},this.successKeys.push(o&&void 0!==o._key?{key:o._key,index:t}:t),this.complete++,this.complete<this.total&&this._next(),r.next=33;break;case 16:if(r.prev=16,r.t0=r.catch(6),!(o.retryTimes>0&&(this.running||!this.running&&this.enableContinueRetryWhenStop))){r.next=28;break}if(o.retryTimes--,!this.enableAwaitWhenRetry){r.next=25;break}return r.next=23,this._runRequestItem(t,n);case 23:r.next=26;break;case 25:this._runRequestItem(t,n);case 26:r.next=33;break;case 28:a=this.onError&&this.onError(r.t0,t)||r.t0,this.requestResult[t]={key:t,type:"ERROR",requestItem:o,data:a,isRequestQueue:!0},this.errorKeys.push(o&&void 0!==o._key?{key:o._key,index:t}:t),this.complete++,this.destroyWhenError?(this._assertPromisify()?this._reject(this.requestResult[t]):this.destroyWhenErrorHooks.forEach((function(r){return r(a,t,"ERROR")})),this.destroy()):this.complete<this.total&&this._next();case 33:return r.prev=33,this.requests++,this.complete>=this.total&&!this.destroyed&&(this._assertPromisify()?this._resolve(_toConsumableArray(this.requestResult)):this.completeHooks.forEach((function(r){return r(_toConsumableArray(u.requestResult),t)})),this.destroy()),r.finish(33);case 37:case"end":return r.stop()}}),r,this,[[6,16,33,37]])})))}},{key:"_getRequestItem",value:function(){if(this._assertDisabled())return null;var t=this.requestList.shift();if(!t)return t;if(S(t))return{request:t,retryTimes:this.retryTimes,originalRetryTimes:this.retryTimes};if(We(t)){var r=S(t._request)?t._request:null,e=We(t._customData)?t._customData:{},n=void 0===e.retry?this.retryTimes:e.retry;return Object.assign({request:r||me((function(){return this.requestAdapter(Object.assign({},We(this.requestAdapterApiConfig)?this.requestAdapterApiConfig:{url:this.requestAdapterApiConfig},Yu(t,["_request","_customData"])))}),this),retryTimes:n,originalRetryTimes:n},e)}return Fe(t)?{request:me((function(){return this.requestAdapter(Fe(this.requestAdapterApiConfig)?t:Object.assign({},this.requestAdapterApiConfig,{url:t}))}),this),retryTimes:this.retryTimes,originalRetryTimes:this.retryTimes}:{request:me((function(){return Promise.resolve(t)}),this),retryTimes:this.retryTimes,originalRetryTimes:this.retryTimes}}},{key:"add",value:function(t){return this.destroyed||void 0===t||(this.requestList.push(t),this.total++),this}},{key:"start",value:function(t,r){var e=this;return this.destroyed||this.running?this:(this.running=!0,S(t)&&this.completeHooks.push(t),S(r)&&this.destroyWhenErrorHooks.push(r),this._assertPromisify()?new Promise((function(t,r){e._resolve=t,e._reject=r,e._concurrent()})):this._concurrent())}},{key:"stop",value:function(){return this._assertDisabled()||(this.running=!1),this}},{key:"restart",value:function(){return this.destroyed||this.running?this:(this.running=!0,this._concurrent())}},{key:"destroy",value:function(){return this.destroyed||(this.running=!1,this.destroyed=!0),this}}]),t}(),Object.defineProperty(t,"__esModule",{value:!0}),t}({});