UNPKG

identifi-lib

Version:

Basic tools for reading and writing Identifi messages and identities.

1 lines 147 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("gun")):"function"==typeof define&&define.amd?define(["gun"],e):t.identifiLib=e(t.Gun)}(this,function(t){"use strict";function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function n(t,e){return t(e={exports:{}},e.exports),e.exports}t=t&&t.hasOwnProperty("default")?t.default:t;var r=n(function(t){var e=t.exports={version:"2.6.4"};"number"==typeof __e&&(__e=e)}),i=(r.version,r.JSON||(r.JSON={stringify:JSON.stringify})),o=function(t){return i.stringify.apply(i,arguments)},s=e(n(function(t){t.exports={default:o,__esModule:!0}})),a=function(t,e){return{value:e,done:!!t}},u={},h={}.toString,f=function(t){return h.call(t).slice(8,-1)},c=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==f(t)?t.split(""):Object(t)},l=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t},p=function(t){return c(l(t))},d=n(function(t){var e=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=e)}),g=function(t){if("function"!=typeof t)throw TypeError(t+" is not a function!");return t},y=function(t,e,n){if(g(t),void 0===e)return t;switch(n){case 1:return function(n){return t.call(e,n)};case 2:return function(n,r){return t.call(e,n,r)};case 3:return function(n,r,i){return t.call(e,n,r,i)}}return function(){return t.apply(e,arguments)}},v=function(t){return"object"==typeof t?null!==t:"function"==typeof t},w=function(t){if(!v(t))throw TypeError(t+" is not an object!");return t},_=function(t){try{return!!t()}catch(t){return!0}},m=!_(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),b=d.document,E=v(b)&&v(b.createElement),x=function(t){return E?b.createElement(t):{}},S=!m&&!_(function(){return 7!=Object.defineProperty(x("div"),"a",{get:function(){return 7}}).a}),k=function(t,e){if(!v(t))return t;var n,r;if(e&&"function"==typeof(n=t.toString)&&!v(r=n.call(t)))return r;if("function"==typeof(n=t.valueOf)&&!v(r=n.call(t)))return r;if(!e&&"function"==typeof(n=t.toString)&&!v(r=n.call(t)))return r;throw TypeError("Can't convert object to primitive value")},A=Object.defineProperty,R={f:m?Object.defineProperty:function(t,e,n){if(w(t),e=k(e,!0),w(n),S)try{return A(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},T=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},I=m?function(t,e,n){return R.f(t,e,T(1,n))}:function(t,e,n){return t[e]=n,t},O={}.hasOwnProperty,M=function(t,e){return O.call(t,e)},P=function(t,e,n){var i,o,s,a=t&P.F,u=t&P.G,h=t&P.S,f=t&P.P,c=t&P.B,l=t&P.W,p=u?r:r[e]||(r[e]={}),g=p.prototype,v=u?d:h?d[e]:(d[e]||{}).prototype;for(i in u&&(n=e),n)(o=!a&&v&&void 0!==v[i])&&M(p,i)||(s=o?v[i]:n[i],p[i]=u&&"function"!=typeof v[i]?n[i]:c&&o?y(s,d):l&&v[i]==s?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(s):f&&"function"==typeof s?y(Function.call,s):s,f&&((p.virtual||(p.virtual={}))[i]=s,t&P.R&&g&&!g[i]&&I(g,i,s)))};P.F=1,P.G=2,P.S=4,P.P=8,P.B=16,P.W=32,P.U=64,P.R=128;var L,D=P,B=I,j=Math.ceil,C=Math.floor,N=function(t){return isNaN(t=+t)?0:(t>0?C:j)(t)},U=Math.min,z=function(t){return t>0?U(N(t),9007199254740991):0},F=Math.max,q=Math.min,K=n(function(t){var e=d["__core-js_shared__"]||(d["__core-js_shared__"]={});(t.exports=function(t,n){return e[t]||(e[t]=void 0!==n?n:{})})("versions",[]).push({version:r.version,mode:"pure",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})}),Y=0,H=Math.random(),W=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++Y+H).toString(36))},G=K("keys"),V=function(t){return G[t]||(G[t]=W(t))},J=(L=!1,function(t,e,n){var r,i=p(t),o=z(i.length),s=function(t,e){return(t=N(t))<0?F(t+e,0):q(t,e)}(n,o);if(L&&e!=e){for(;o>s;)if((r=i[s++])!=r)return!0}else for(;o>s;s++)if((L||s in i)&&i[s]===e)return L||s||0;return!L&&-1}),$=V("IE_PROTO"),Z=function(t,e){var n,r=p(t),i=0,o=[];for(n in r)n!=$&&M(r,n)&&o.push(n);for(;e.length>i;)M(r,n=e[i++])&&(~J(o,n)||o.push(n));return o},X="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),Q=Object.keys||function(t){return Z(t,X)},tt=m?Object.defineProperties:function(t,e){w(t);for(var n,r=Q(e),i=r.length,o=0;i>o;)R.f(t,n=r[o++],e[n]);return t},et=d.document,nt=et&&et.documentElement,rt=V("IE_PROTO"),it=function(){},ot=function(){var t,e=x("iframe"),n=X.length;for(e.style.display="none",nt.appendChild(e),e.src="javascript:",(t=e.contentWindow.document).open(),t.write("<script>document.F=Object<\/script>"),t.close(),ot=t.F;n--;)delete ot.prototype[X[n]];return ot()},st=Object.create||function(t,e){var n;return null!==t?(it.prototype=w(t),n=new it,it.prototype=null,n[rt]=t):n=ot(),void 0===e?n:tt(n,e)},at=n(function(t){var e=K("wks"),n=d.Symbol,r="function"==typeof n;(t.exports=function(t){return e[t]||(e[t]=r&&n[t]||(r?n:W)("Symbol."+t))}).store=e}),ut=R.f,ht=at("toStringTag"),ft=function(t,e,n){t&&!M(t=n?t:t.prototype,ht)&&ut(t,ht,{configurable:!0,value:e})},ct={};I(ct,at("iterator"),function(){return this});var lt=function(t,e,n){t.prototype=st(ct,{next:T(1,n)}),ft(t,e+" Iterator")},pt=function(t){return Object(l(t))},dt=V("IE_PROTO"),gt=Object.prototype,yt=Object.getPrototypeOf||function(t){return t=pt(t),M(t,dt)?t[dt]:"function"==typeof t.constructor&&t instanceof t.constructor?t.constructor.prototype:t instanceof Object?gt:null},vt=at("iterator"),wt=!([].keys&&"next"in[].keys()),_t=function(){return this},mt=function(t,e,n,r,i,o,s){lt(n,e,r);var a,h,f,c=function(t){if(!wt&&t in g)return g[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},l=e+" Iterator",p="values"==i,d=!1,g=t.prototype,y=g[vt]||g["@@iterator"]||i&&g[i],v=y||c(i),w=i?p?c("entries"):v:void 0,_="Array"==e&&g.entries||y;if(_&&(f=yt(_.call(new t)))!==Object.prototype&&f.next&&ft(f,l,!0),p&&y&&"values"!==y.name&&(d=!0,v=function(){return y.call(this)}),s&&(wt||d||!g[vt])&&I(g,vt,v),u[e]=v,u[l]=_t,i)if(a={values:p?v:c("values"),keys:o?v:c("keys"),entries:w},s)for(h in a)h in g||B(g,h,a[h]);else D(D.P+D.F*(wt||d),e,a);return a};mt(Array,"Array",function(t,e){this._t=p(t),this._i=0,this._k=e},function(){var t=this._t,e=this._k,n=this._i++;return!t||n>=t.length?(this._t=void 0,a(1)):a(0,"keys"==e?n:"values"==e?t[n]:[n,t[n]])},"values");u.Arguments=u.Array;for(var bt=at("toStringTag"),Et="CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","),xt=0;xt<Et.length;xt++){var St=Et[xt],kt=d[St],At=kt&&kt.prototype;At&&!At[bt]&&I(At,bt,St),u[St]=u.Array}var Rt,Tt=(Rt=!0,function(t,e){var n,r,i=String(l(t)),o=N(e),s=i.length;return o<0||o>=s?Rt?"":void 0:(n=i.charCodeAt(o))<55296||n>56319||o+1===s||(r=i.charCodeAt(o+1))<56320||r>57343?Rt?i.charAt(o):n:Rt?i.slice(o,o+2):r-56320+(n-55296<<10)+65536});mt(String,"String",function(t){this._t=String(t),this._i=0},function(){var t,e=this._t,n=this._i;return n>=e.length?{value:void 0,done:!0}:(t=Tt(e,n),this._i+=t.length,{value:t,done:!1})});var It=at("toStringTag"),Ot="Arguments"==f(function(){return arguments}()),Mt=function(t){var e,n,r;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(n=function(t,e){try{return t[e]}catch(t){}}(e=Object(t),It))?n:Ot?f(e):"Object"==(r=f(e))&&"function"==typeof e.callee?"Arguments":r},Pt=at("iterator"),Lt=r.getIteratorMethod=function(t){if(null!=t)return t[Pt]||t["@@iterator"]||u[Mt(t)]},Dt=r.getIterator=function(t){var e=Lt(t);if("function"!=typeof e)throw TypeError(t+" is not iterable!");return w(e.call(t))},Bt=e(n(function(t){t.exports={default:Dt,__esModule:!0}})),jt={f:at},Ct=jt.f("iterator"),Nt=n(function(t){t.exports={default:Ct,__esModule:!0}}),Ut=e(Nt),zt=n(function(t){var e=W("meta"),n=R.f,r=0,i=Object.isExtensible||function(){return!0},o=!_(function(){return i(Object.preventExtensions({}))}),s=function(t){n(t,e,{value:{i:"O"+ ++r,w:{}}})},a=t.exports={KEY:e,NEED:!1,fastKey:function(t,n){if(!v(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!M(t,e)){if(!i(t))return"F";if(!n)return"E";s(t)}return t[e].i},getWeak:function(t,n){if(!M(t,e)){if(!i(t))return!0;if(!n)return!1;s(t)}return t[e].w},onFreeze:function(t){return o&&a.NEED&&i(t)&&!M(t,e)&&s(t),t}}}),Ft=(zt.KEY,zt.NEED,zt.fastKey,zt.getWeak,zt.onFreeze,R.f),qt=function(t){var e=r.Symbol||(r.Symbol={});"_"==t.charAt(0)||t in e||Ft(e,t,{value:jt.f(t)})},Kt={f:Object.getOwnPropertySymbols},Yt={f:{}.propertyIsEnumerable},Ht=Array.isArray||function(t){return"Array"==f(t)},Wt=X.concat("length","prototype"),Gt={f:Object.getOwnPropertyNames||function(t){return Z(t,Wt)}},Vt=Gt.f,Jt={}.toString,$t="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],Zt={f:function(t){return $t&&"[object Window]"==Jt.call(t)?function(t){try{return Vt(t)}catch(t){return $t.slice()}}(t):Vt(p(t))}},Xt=Object.getOwnPropertyDescriptor,Qt={f:m?Xt:function(t,e){if(t=p(t),e=k(e,!0),S)try{return Xt(t,e)}catch(t){}if(M(t,e))return T(!Yt.f.call(t,e),t[e])}},te=zt.KEY,ee=Qt.f,ne=R.f,re=Zt.f,ie=d.Symbol,oe=d.JSON,se=oe&&oe.stringify,ae=at("_hidden"),ue=at("toPrimitive"),he={}.propertyIsEnumerable,fe=K("symbol-registry"),ce=K("symbols"),le=K("op-symbols"),pe=Object.prototype,de="function"==typeof ie,ge=d.QObject,ye=!ge||!ge.prototype||!ge.prototype.findChild,ve=m&&_(function(){return 7!=st(ne({},"a",{get:function(){return ne(this,"a",{value:7}).a}})).a})?function(t,e,n){var r=ee(pe,e);r&&delete pe[e],ne(t,e,n),r&&t!==pe&&ne(pe,e,r)}:ne,we=function(t){var e=ce[t]=st(ie.prototype);return e._k=t,e},_e=de&&"symbol"==typeof ie.iterator?function(t){return"symbol"==typeof t}:function(t){return t instanceof ie},me=function(t,e,n){return t===pe&&me(le,e,n),w(t),e=k(e,!0),w(n),M(ce,e)?(n.enumerable?(M(t,ae)&&t[ae][e]&&(t[ae][e]=!1),n=st(n,{enumerable:T(0,!1)})):(M(t,ae)||ne(t,ae,T(1,{})),t[ae][e]=!0),ve(t,e,n)):ne(t,e,n)},be=function(t,e){w(t);for(var n,r=function(t){var e=Q(t),n=Kt.f;if(n)for(var r,i=n(t),o=Yt.f,s=0;i.length>s;)o.call(t,r=i[s++])&&e.push(r);return e}(e=p(e)),i=0,o=r.length;o>i;)me(t,n=r[i++],e[n]);return t},Ee=function(t){var e=he.call(this,t=k(t,!0));return!(this===pe&&M(ce,t)&&!M(le,t))&&(!(e||!M(this,t)||!M(ce,t)||M(this,ae)&&this[ae][t])||e)},xe=function(t,e){if(t=p(t),e=k(e,!0),t!==pe||!M(ce,e)||M(le,e)){var n=ee(t,e);return!n||!M(ce,e)||M(t,ae)&&t[ae][e]||(n.enumerable=!0),n}},Se=function(t){for(var e,n=re(p(t)),r=[],i=0;n.length>i;)M(ce,e=n[i++])||e==ae||e==te||r.push(e);return r},ke=function(t){for(var e,n=t===pe,r=re(n?le:p(t)),i=[],o=0;r.length>o;)!M(ce,e=r[o++])||n&&!M(pe,e)||i.push(ce[e]);return i};de||(B((ie=function(){if(this instanceof ie)throw TypeError("Symbol is not a constructor!");var t=W(arguments.length>0?arguments[0]:void 0),e=function(n){this===pe&&e.call(le,n),M(this,ae)&&M(this[ae],t)&&(this[ae][t]=!1),ve(this,t,T(1,n))};return m&&ye&&ve(pe,t,{configurable:!0,set:e}),we(t)}).prototype,"toString",function(){return this._k}),Qt.f=xe,R.f=me,Gt.f=Zt.f=Se,Yt.f=Ee,Kt.f=ke,jt.f=function(t){return we(at(t))}),D(D.G+D.W+D.F*!de,{Symbol:ie});for(var Ae="hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","),Re=0;Ae.length>Re;)at(Ae[Re++]);for(var Te=Q(at.store),Ie=0;Te.length>Ie;)qt(Te[Ie++]);D(D.S+D.F*!de,"Symbol",{for:function(t){return M(fe,t+="")?fe[t]:fe[t]=ie(t)},keyFor:function(t){if(!_e(t))throw TypeError(t+" is not a symbol!");for(var e in fe)if(fe[e]===t)return e},useSetter:function(){ye=!0},useSimple:function(){ye=!1}}),D(D.S+D.F*!de,"Object",{create:function(t,e){return void 0===e?st(t):be(st(t),e)},defineProperty:me,defineProperties:be,getOwnPropertyDescriptor:xe,getOwnPropertyNames:Se,getOwnPropertySymbols:ke}),oe&&D(D.S+D.F*(!de||_(function(){var t=ie();return"[null]"!=se([t])||"{}"!=se({a:t})||"{}"!=se(Object(t))})),"JSON",{stringify:function(t){for(var e,n,r=[t],i=1;arguments.length>i;)r.push(arguments[i++]);if(n=e=r[1],(v(e)||void 0!==t)&&!_e(t))return Ht(e)||(e=function(t,e){if("function"==typeof n&&(e=n.call(this,t,e)),!_e(e))return e}),r[1]=e,se.apply(oe,r)}}),ie.prototype[ue]||I(ie.prototype,ue,ie.prototype.valueOf),ft(ie,"Symbol"),ft(Math,"Math",!0),ft(d.JSON,"JSON",!0),qt("asyncIterator"),qt("observable");var Oe=r.Symbol,Me=n(function(t){t.exports={default:Oe,__esModule:!0}});e(Me);var Pe=n(function(t,e){e.__esModule=!0;var n=o(Nt),r=o(Me),i="function"==typeof r.default&&"symbol"==typeof n.default?function(t){return typeof t}:function(t){return t&&"function"==typeof r.default&&t.constructor===r.default&&t!==r.default.prototype?"symbol":typeof t};function o(t){return t&&t.__esModule?t:{default:t}}e.default="function"==typeof r.default&&"symbol"===i(n.default)?function(t){return void 0===t?"undefined":i(t)}:function(t){return t&&"function"==typeof r.default&&t.constructor===r.default&&t!==r.default.prototype?"symbol":void 0===t?"undefined":i(t)}}),Le=e(Pe),De=n(function(t){!function(e){var n,r=Object.prototype,i=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag",h=e.regeneratorRuntime;if(h)t.exports=h;else{(h=e.regeneratorRuntime=t.exports).wrap=_;var f="suspendedStart",c="suspendedYield",l="executing",p="completed",d={},g={};g[s]=function(){return this};var y=Object.getPrototypeOf,v=y&&y(y(O([])));v&&v!==r&&i.call(v,s)&&(g=v);var w=x.prototype=b.prototype=Object.create(g);E.prototype=w.constructor=x,x.constructor=E,x[u]=E.displayName="GeneratorFunction",h.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===E||"GeneratorFunction"===(e.displayName||e.name))},h.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,u in t||(t[u]="GeneratorFunction")),t.prototype=Object.create(w),t},h.awrap=function(t){return{__await:t}},S(k.prototype),k.prototype[a]=function(){return this},h.AsyncIterator=k,h.async=function(t,e,n,r){var i=new k(_(t,e,n,r));return h.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},S(w),w[u]="Generator",w[s]=function(){return this},w.toString=function(){return"[object Generator]"},h.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},h.values=O,I.prototype={constructor:I,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(T),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,i){return a.type="throw",a.arg=t,e.next=r,i&&(e.method="next",e.arg=n),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var s=this.tryEntries[o],a=s.completion;if("root"===s.tryLoc)return r("end");if(s.tryLoc<=this.prev){var u=i.call(s,"catchLoc"),h=i.call(s,"finallyLoc");if(u&&h){if(this.prev<s.catchLoc)return r(s.catchLoc,!0);if(this.prev<s.finallyLoc)return r(s.finallyLoc)}else if(u){if(this.prev<s.catchLoc)return r(s.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<s.finallyLoc)return r(s.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=t,s.arg=e,o?(this.method="next",this.next=o.finallyLoc,d):this.complete(s)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),d},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),T(n),d}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;T(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:O(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),d}}}function _(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,o=Object.create(i.prototype),s=new I(r||[]);return o._invoke=function(t,e,n){var r=f;return function(i,o){if(r===l)throw new Error("Generator is already running");if(r===p){if("throw"===i)throw o;return M()}for(n.method=i,n.arg=o;;){var s=n.delegate;if(s){var a=A(s,n);if(a){if(a===d)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=l;var u=m(t,e,n);if("normal"===u.type){if(r=n.done?p:c,u.arg===d)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r=p,n.method="throw",n.arg=u.arg)}}}(t,n,s),o}function m(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function b(){}function E(){}function x(){}function S(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function k(t){var e;this._invoke=function(n,r){function o(){return new Promise(function(e,o){!function e(n,r,o,s){var a=m(t[n],t,r);if("throw"!==a.type){var u=a.arg,h=u.value;return h&&"object"==typeof h&&i.call(h,"__await")?Promise.resolve(h.__await).then(function(t){e("next",t,o,s)},function(t){e("throw",t,o,s)}):Promise.resolve(h).then(function(t){u.value=t,o(u)},s)}s(a.arg)}(n,r,e,o)})}return e=e?e.then(o,o):o()}}function A(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,A(t,e),"throw"===e.method))return d;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var i=m(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,d;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,d):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,d)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function I(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function O(t){if(t){var e=t[s];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(i.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=n,e.done=!0,e};return o.next=o}}return{next:M}}function M(){return{value:n,done:!0}}}(function(){return this}()||Function("return this")())}),Be=function(){return this}()||Function("return this")(),je=Be.regeneratorRuntime&&Object.getOwnPropertyNames(Be).indexOf("regeneratorRuntime")>=0,Ce=je&&Be.regeneratorRuntime;Be.regeneratorRuntime=void 0;var Ne=De;if(je)Be.regeneratorRuntime=Ce;else try{delete Be.regeneratorRuntime}catch(t){Be.regeneratorRuntime=void 0}var Ue,ze,Fe,qe,Ke=Ne;Ue="keys",ze=function(){return function(t){return Q(pt(t))}},Fe=(r.Object||{})[Ue]||Object[Ue],(qe={})[Ue]=ze(Fe),D(D.S+D.F*_(function(){Fe(1)}),"Object",qe);var Ye=r.Object.keys,He=e(n(function(t){t.exports={default:Ye,__esModule:!0}})),We=e(n(function(t,e){e.__esModule=!0,e.default=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}})),Ge=e(n(function(t,e){e.__esModule=!0;var n,r=(n=Pe)&&n.__esModule?n:{default:n};e.default=function(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!==(void 0===e?"undefined":(0,r.default)(e))&&"function"!=typeof e?t:e}})),Ve=function(t,e){if(w(t),!v(e)&&null!==e)throw TypeError(e+": can't set as prototype!")},Je={set:Object.setPrototypeOf||("__proto__"in{}?function(t,e,n){try{(n=y(Function.call,Qt.f(Object.prototype,"__proto__").set,2))(t,[]),e=!(t instanceof Array)}catch(t){e=!0}return function(t,r){return Ve(t,r),e?t.__proto__=r:n(t,r),t}}({},!1):void 0),check:Ve};D(D.S,"Object",{setPrototypeOf:Je.set});var $e=r.Object.setPrototypeOf,Ze=n(function(t){t.exports={default:$e,__esModule:!0}});e(Ze),D(D.S,"Object",{create:st});var Xe=r.Object,Qe=function(t,e){return Xe.create(t,e)},tn=n(function(t){t.exports={default:Qe,__esModule:!0}});e(tn);var en,nn,rn,on=e(n(function(t,e){e.__esModule=!0;var n=o(Ze),r=o(tn),i=o(Pe);function o(t){return t&&t.__esModule?t:{default:t}}e.default=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+(void 0===e?"undefined":(0,i.default)(e)));t.prototype=(0,r.default)(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(n.default?(0,n.default)(t,e):t.__proto__=e)}})),sn="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},an=function(t,e,n,r){try{return r?e(w(n)[0],n[1]):e(n)}catch(e){var i=t.return;throw void 0!==i&&w(i.call(t)),e}},un=at("iterator"),hn=Array.prototype,fn=n(function(t){var e={},n={},r=t.exports=function(t,r,i,o,s){var a,h,f,c,l,p=s?function(){return t}:Lt(t),d=y(i,o,r?2:1),g=0;if("function"!=typeof p)throw TypeError(t+" is not iterable!");if(void 0===(l=p)||u.Array!==l&&hn[un]!==l){for(f=p.call(t);!(h=f.next()).done;)if((c=an(f,d,h.value,r))===e||c===n)return c}else for(a=z(t.length);a>g;g++)if((c=r?d(w(h=t[g])[0],h[1]):d(t[g]))===e||c===n)return c};r.BREAK=e,r.RETURN=n}),cn=at("species"),ln=function(t,e){var n,r=w(t).constructor;return void 0===r||null==(n=w(r)[cn])?e:g(n)},pn=d.process,dn=d.setImmediate,gn=d.clearImmediate,yn=d.MessageChannel,vn=d.Dispatch,wn=0,_n={},mn=function(){var t=+this;if(_n.hasOwnProperty(t)){var e=_n[t];delete _n[t],e()}},bn=function(t){mn.call(t.data)};dn&&gn||(dn=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return _n[++wn]=function(){!function(t,e,n){var r=void 0===n;switch(e.length){case 0:return r?t():t.call(n);case 1:return r?t(e[0]):t.call(n,e[0]);case 2:return r?t(e[0],e[1]):t.call(n,e[0],e[1]);case 3:return r?t(e[0],e[1],e[2]):t.call(n,e[0],e[1],e[2]);case 4:return r?t(e[0],e[1],e[2],e[3]):t.call(n,e[0],e[1],e[2],e[3])}t.apply(n,e)}("function"==typeof t?t:Function(t),e)},en(wn),wn},gn=function(t){delete _n[t]},"process"==f(pn)?en=function(t){pn.nextTick(y(mn,t,1))}:vn&&vn.now?en=function(t){vn.now(y(mn,t,1))}:yn?(rn=(nn=new yn).port2,nn.port1.onmessage=bn,en=y(rn.postMessage,rn,1)):d.addEventListener&&"function"==typeof postMessage&&!d.importScripts?(en=function(t){d.postMessage(t+"","*")},d.addEventListener("message",bn,!1)):en="onreadystatechange"in x("script")?function(t){nt.appendChild(x("script")).onreadystatechange=function(){nt.removeChild(this),mn.call(t)}}:function(t){setTimeout(y(mn,t,1),0)});var En={set:dn,clear:gn},xn=En.set,Sn=d.MutationObserver||d.WebKitMutationObserver,kn=d.process,An=d.Promise,Rn="process"==f(kn);function Tn(t){var e,n;this.promise=new t(function(t,r){if(void 0!==e||void 0!==n)throw TypeError("Bad Promise constructor");e=t,n=r}),this.resolve=g(e),this.reject=g(n)}var In={f:function(t){return new Tn(t)}},On=function(t){try{return{e:!1,v:t()}}catch(t){return{e:!0,v:t}}},Mn=d.navigator,Pn=Mn&&Mn.userAgent||"",Ln=function(t,e){if(w(t),v(e)&&e.constructor===t)return e;var n=In.f(t);return(0,n.resolve)(e),n.promise},Dn=at("species"),Bn=at("iterator"),jn=!1;try{[7][Bn]().return=function(){jn=!0}}catch(t){}var Cn,Nn,Un,zn,Fn=En.set,qn=function(){var t,e,n,r=function(){var r,i;for(Rn&&(r=kn.domain)&&r.exit();t;){i=t.fn,t=t.next;try{i()}catch(r){throw t?n():e=void 0,r}}e=void 0,r&&r.enter()};if(Rn)n=function(){kn.nextTick(r)};else if(!Sn||d.navigator&&d.navigator.standalone)if(An&&An.resolve){var i=An.resolve(void 0);n=function(){i.then(r)}}else n=function(){xn.call(d,r)};else{var o=!0,s=document.createTextNode("");new Sn(r).observe(s,{characterData:!0}),n=function(){s.data=o=!o}}return function(r){var i={fn:r,next:void 0};e&&(e.next=i),t||(t=i,n()),e=i}}(),Kn=d.TypeError,Yn=d.process,Hn=Yn&&Yn.versions,Wn=Hn&&Hn.v8||"",Gn=d.Promise,Vn="process"==Mt(Yn),Jn=function(){},$n=Nn=In.f,Zn=!!function(){try{var t=Gn.resolve(1),e=(t.constructor={})[at("species")]=function(t){t(Jn,Jn)};return(Vn||"function"==typeof PromiseRejectionEvent)&&t.then(Jn)instanceof e&&0!==Wn.indexOf("6.6")&&-1===Pn.indexOf("Chrome/66")}catch(t){}}(),Xn=function(t){var e;return!(!v(t)||"function"!=typeof(e=t.then))&&e},Qn=function(t,e){if(!t._n){t._n=!0;var n=t._c;qn(function(){for(var r=t._v,i=1==t._s,o=0,s=function(e){var n,o,s,a=i?e.ok:e.fail,u=e.resolve,h=e.reject,f=e.domain;try{a?(i||(2==t._h&&nr(t),t._h=1),!0===a?n=r:(f&&f.enter(),n=a(r),f&&(f.exit(),s=!0)),n===e.promise?h(Kn("Promise-chain cycle")):(o=Xn(n))?o.call(n,u,h):u(n)):h(r)}catch(t){f&&!s&&f.exit(),h(t)}};n.length>o;)s(n[o++]);t._c=[],t._n=!1,e&&!t._h&&tr(t)})}},tr=function(t){Fn.call(d,function(){var e,n,r,i=t._v,o=er(t);if(o&&(e=On(function(){Vn?Yn.emit("unhandledRejection",i,t):(n=d.onunhandledrejection)?n({promise:t,reason:i}):(r=d.console)&&r.error&&r.error("Unhandled promise rejection",i)}),t._h=Vn||er(t)?2:1),t._a=void 0,o&&e.e)throw e.v})},er=function(t){return 1!==t._h&&0===(t._a||t._c).length},nr=function(t){Fn.call(d,function(){var e;Vn?Yn.emit("rejectionHandled",t):(e=d.onrejectionhandled)&&e({promise:t,reason:t._v})})},rr=function(t){var e=this;e._d||(e._d=!0,(e=e._w||e)._v=t,e._s=2,e._a||(e._a=e._c.slice()),Qn(e,!0))},ir=function(t){var e,n=this;if(!n._d){n._d=!0,n=n._w||n;try{if(n===t)throw Kn("Promise can't be resolved itself");(e=Xn(t))?qn(function(){var r={_w:n,_d:!1};try{e.call(t,y(ir,r,1),y(rr,r,1))}catch(t){rr.call(r,t)}}):(n._v=t,n._s=1,Qn(n,!1))}catch(t){rr.call({_w:n,_d:!1},t)}}};Zn||(Gn=function(t){!function(t,e,n,r){if(!(t instanceof e)||void 0!==r&&r in t)throw TypeError(n+": incorrect invocation!")}(this,Gn,"Promise","_h"),g(t),Cn.call(this);try{t(y(ir,this,1),y(rr,this,1))}catch(t){rr.call(this,t)}},(Cn=function(t){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=function(t,e,n){for(var r in e)n&&t[r]?t[r]=e[r]:I(t,r,e[r]);return t}(Gn.prototype,{then:function(t,e){var n=$n(ln(this,Gn));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=Vn?Yn.domain:void 0,this._c.push(n),this._a&&this._a.push(n),this._s&&Qn(this,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),Un=function(){var t=new Cn;this.promise=t,this.resolve=y(ir,t,1),this.reject=y(rr,t,1)},In.f=$n=function(t){return t===Gn||t===zn?new Un(t):Nn(t)}),D(D.G+D.W+D.F*!Zn,{Promise:Gn}),ft(Gn,"Promise"),function(t){var e="function"==typeof r[t]?r[t]:d[t];m&&e&&!e[Dn]&&R.f(e,Dn,{configurable:!0,get:function(){return this}})}("Promise"),zn=r.Promise,D(D.S+D.F*!Zn,"Promise",{reject:function(t){var e=$n(this);return(0,e.reject)(t),e.promise}}),D(D.S+!0*D.F,"Promise",{resolve:function(t){return Ln(this===zn?Gn:this,t)}}),D(D.S+D.F*!(Zn&&function(t,e){if(!e&&!jn)return!1;var n=!1;try{var r=[7],i=r[Bn]();i.next=function(){return{done:n=!0}},r[Bn]=function(){return i},t(r)}catch(t){}return n}(function(t){Gn.all(t).catch(Jn)})),"Promise",{all:function(t){var e=this,n=$n(e),r=n.resolve,i=n.reject,o=On(function(){var n=[],o=0,s=1;fn(t,!1,function(t){var a=o++,u=!1;n.push(void 0),s++,e.resolve(t).then(function(t){u||(u=!0,n[a]=t,--s||r(n))},i)}),--s||r(n)});return o.e&&i(o.v),n.promise},race:function(t){var e=this,n=$n(e),r=n.reject,i=On(function(){fn(t,!1,function(t){e.resolve(t).then(n.resolve,r)})});return i.e&&r(i.v),n.promise}}),D(D.P+D.R,"Promise",{finally:function(t){var e=ln(this,r.Promise||d.Promise),n="function"==typeof t;return this.then(n?function(n){return Ln(e,t()).then(function(){return n})}:t,n?function(n){return Ln(e,t()).then(function(){throw n})}:t)}}),D(D.S,"Promise",{try:function(t){var e=In.f(this),n=On(t);return(n.e?e.reject:e.resolve)(n.v),e.promise}});var or=r.Promise,sr=e(n(function(t){t.exports={default:or,__esModule:!0}})),ar=n(function(t){"function"==typeof Object.create?t.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:t.exports=function(t,e){t.super_=e;var n=function(){};n.prototype=e.prototype,t.prototype=new n,t.prototype.constructor=t}}),ur=[],hr=[],fr="undefined"!=typeof Uint8Array?Uint8Array:Array,cr=!1;function lr(){cr=!0;for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e=0,n=t.length;e<n;++e)ur[e]=t[e],hr[t.charCodeAt(e)]=e;hr["-".charCodeAt(0)]=62,hr["_".charCodeAt(0)]=63}function pr(t,e,n){for(var r,i,o=[],s=e;s<n;s+=3)r=(t[s]<<16)+(t[s+1]<<8)+t[s+2],o.push(ur[(i=r)>>18&63]+ur[i>>12&63]+ur[i>>6&63]+ur[63&i]);return o.join("")}function dr(t){var e;cr||lr();for(var n=t.length,r=n%3,i="",o=[],s=0,a=n-r;s<a;s+=16383)o.push(pr(t,s,s+16383>a?a:s+16383));return 1===r?(e=t[n-1],i+=ur[e>>2],i+=ur[e<<4&63],i+="=="):2===r&&(e=(t[n-2]<<8)+t[n-1],i+=ur[e>>10],i+=ur[e>>4&63],i+=ur[e<<2&63],i+="="),o.push(i),o.join("")}function gr(t,e,n,r,i){var o,s,a=8*i-r-1,u=(1<<a)-1,h=u>>1,f=-7,c=n?i-1:0,l=n?-1:1,p=t[e+c];for(c+=l,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+t[e+c],c+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=r;f>0;s=256*s+t[e+c],c+=l,f-=8);if(0===o)o=1-h;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,r),o-=h}return(p?-1:1)*s*Math.pow(2,o-r)}function yr(t,e,n,r,i,o){var s,a,u,h=8*o-i-1,f=(1<<h)-1,c=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:o-1,d=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+c>=1?l/u:l*Math.pow(2,1-c))*u>=2&&(s++,u/=2),s+c>=f?(a=0,s=f):s+c>=1?(a=(e*u-1)*Math.pow(2,i),s+=c):(a=e*Math.pow(2,c-1)*Math.pow(2,i),s=0));i>=8;t[n+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,h+=i;h>0;t[n+p]=255&s,p+=d,s/=256,h-=8);t[n+p-d]|=128*g}var vr={}.toString,wr=Array.isArray||function(t){return"[object Array]"==vr.call(t)};Er.TYPED_ARRAY_SUPPORT=void 0===sn.TYPED_ARRAY_SUPPORT||sn.TYPED_ARRAY_SUPPORT;var _r=mr();function mr(){return Er.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function br(t,e){if(mr()<e)throw new RangeError("Invalid typed array length");return Er.TYPED_ARRAY_SUPPORT?(t=new Uint8Array(e)).__proto__=Er.prototype:(null===t&&(t=new Er(e)),t.length=e),t}function Er(t,e,n){if(!(Er.TYPED_ARRAY_SUPPORT||this instanceof Er))return new Er(t,e,n);if("number"==typeof t){if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return kr(this,t)}return xr(this,t,e,n)}function xr(t,e,n,r){if("number"==typeof e)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&e instanceof ArrayBuffer?function(t,e,n,r){if(e.byteLength,n<0||e.byteLength<n)throw new RangeError("'offset' is out of bounds");if(e.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");e=void 0===n&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,n):new Uint8Array(e,n,r);Er.TYPED_ARRAY_SUPPORT?(t=e).__proto__=Er.prototype:t=Ar(t,e);return t}(t,e,n,r):"string"==typeof e?function(t,e,n){"string"==typeof n&&""!==n||(n="utf8");if(!Er.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|Ir(e,n),i=(t=br(t,r)).write(e,n);i!==r&&(t=t.slice(0,i));return t}(t,e,n):function(t,e){if(Tr(e)){var n=0|Rr(e.length);return 0===(t=br(t,n)).length?t:(e.copy(t,0,0,n),t)}if(e){if("undefined"!=typeof ArrayBuffer&&e.buffer instanceof ArrayBuffer||"length"in e)return"number"!=typeof e.length||(r=e.length)!=r?br(t,0):Ar(t,e);if("Buffer"===e.type&&wr(e.data))return Ar(t,e.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(t,e)}function Sr(t){if("number"!=typeof t)throw new TypeError('"size" argument must be a number');if(t<0)throw new RangeError('"size" argument must not be negative')}function kr(t,e){if(Sr(e),t=br(t,e<0?0:0|Rr(e)),!Er.TYPED_ARRAY_SUPPORT)for(var n=0;n<e;++n)t[n]=0;return t}function Ar(t,e){var n=e.length<0?0:0|Rr(e.length);t=br(t,n);for(var r=0;r<n;r+=1)t[r]=255&e[r];return t}function Rr(t){if(t>=mr())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+mr().toString(16)+" bytes");return 0|t}function Tr(t){return!(null==t||!t._isBuffer)}function Ir(t,e){if(Tr(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var n=t.length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return ei(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return ni(t).length;default:if(r)return ei(t).length;e=(""+e).toLowerCase(),r=!0}}function Or(t,e,n){var r=t[e];t[e]=t[n],t[n]=r}function Mr(t,e,n,r,i){if(0===t.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:t.length-1),n<0&&(n=t.length+n),n>=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=Er.from(e,r)),Tr(e))return 0===e.length?-1:Pr(t,e,n,r,i);if("number"==typeof e)return e&=255,Er.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,n):Uint8Array.prototype.lastIndexOf.call(t,e,n):Pr(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function Pr(t,e,n,r,i){var o,s=1,a=t.length,u=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,n/=2}function h(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var f=-1;for(o=n;o<a;o++)if(h(t,o)===h(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(n+u>a&&(n=a-u),o=n;o>=0;o--){for(var c=!0,l=0;l<u;l++)if(h(t,o+l)!==h(e,l)){c=!1;break}if(c)return o}return-1}function Lr(t,e,n,r){n=Number(n)||0;var i=t.length-n;r?(r=Number(r))>i&&(r=i):r=i;var o=e.length;if(o%2!=0)throw new TypeError("Invalid hex string");r>o/2&&(r=o/2);for(var s=0;s<r;++s){var a=parseInt(e.substr(2*s,2),16);if(isNaN(a))return s;t[n+s]=a}return s}function Dr(t,e,n,r){return ri(ei(e,t.length-n),t,n,r)}function Br(t,e,n,r){return ri(function(t){for(var e=[],n=0;n<t.length;++n)e.push(255&t.charCodeAt(n));return e}(e),t,n,r)}function jr(t,e,n,r){return Br(t,e,n,r)}function Cr(t,e,n,r){return ri(ni(e),t,n,r)}function Nr(t,e,n,r){return ri(function(t,e){for(var n,r,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=t.charCodeAt(s),r=n>>8,i=n%256,o.push(i),o.push(r);return o}(e,t.length-n),t,n,r)}function Ur(t,e,n){return 0===e&&n===t.length?dr(t):dr(t.slice(e,n))}function zr(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i<n;){var o,s,a,u,h=t[i],f=null,c=h>239?4:h>223?3:h>191?2:1;if(i+c<=n)switch(c){case 1:h<128&&(f=h);break;case 2:128==(192&(o=t[i+1]))&&(u=(31&h)<<6|63&o)>127&&(f=u);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(u=(15&h)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=t[i+1],s=t[i+2],a=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&h)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,c=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=c}return function(t){var e=t.length;if(e<=Fr)return String.fromCharCode.apply(String,t);var n="",r=0;for(;r<e;)n+=String.fromCharCode.apply(String,t.slice(r,r+=Fr));return n}(r)}Er.poolSize=8192,Er._augment=function(t){return t.__proto__=Er.prototype,t},Er.from=function(t,e,n){return xr(null,t,e,n)},Er.TYPED_ARRAY_SUPPORT&&(Er.prototype.__proto__=Uint8Array.prototype,Er.__proto__=Uint8Array),Er.alloc=function(t,e,n){return function(t,e,n,r){return Sr(e),e<=0?br(t,e):void 0!==n?"string"==typeof r?br(t,e).fill(n,r):br(t,e).fill(n):br(t,e)}(null,t,e,n)},Er.allocUnsafe=function(t){return kr(null,t)},Er.allocUnsafeSlow=function(t){return kr(null,t)},Er.isBuffer=ii,Er.compare=function(t,e){if(!Tr(t)||!Tr(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var n=t.length,r=e.length,i=0,o=Math.min(n,r);i<o;++i)if(t[i]!==e[i]){n=t[i],r=e[i];break}return n<r?-1:r<n?1:0},Er.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},Er.concat=function(t,e){if(!wr(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return Er.alloc(0);var n;if(void 0===e)for(e=0,n=0;n<t.length;++n)e+=t[n].length;var r=Er.allocUnsafe(e),i=0;for(n=0;n<t.length;++n){var o=t[n];if(!Tr(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(r,i),i+=o.length}return r},Er.byteLength=Ir,Er.prototype._isBuffer=!0,Er.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)Or(this,e,e+1);return this},Er.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)Or(this,e,e+3),Or(this,e+1,e+2);return this},Er.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)Or(this,e,e+7),Or(this,e+1,e+6),Or(this,e+2,e+5),Or(this,e+3,e+4);return this},Er.prototype.toString=function(){var t=0|this.length;return 0===t?"":0===arguments.length?zr(this,0,t):function(t,e,n){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return Yr(this,e,n);case"utf8":case"utf-8":return zr(this,e,n);case"ascii":return qr(this,e,n);case"latin1":case"binary":return Kr(this,e,n);case"base64":return Ur(this,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Hr(this,e,n);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}.apply(this,arguments)},Er.prototype.equals=function(t){if(!Tr(t))throw new TypeError("Argument must be a Buffer");return this===t||0===Er.compare(this,t)},Er.prototype.inspect=function(){var t="";return this.length>0&&(t=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(t+=" ... ")),"<Buffer "+t+">"},Er.prototype.compare=function(t,e,n,r,i){if(!Tr(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),e<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&e>=n)return 0;if(r>=i)return-1;if(e>=n)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),a=Math.min(o,s),u=this.slice(r,i),h=t.slice(e,n),f=0;f<a;++f)if(u[f]!==h[f]){o=u[f],s=h[f];break}return o<s?-1:s<o?1:0},Er.prototype.includes=function(t,e,n){return-1!==this.indexOf(t,e,n)},Er.prototype.indexOf=function(t,e,n){return Mr(this,t,e,n,!0)},Er.prototype.lastIndexOf=function(t,e,n){return Mr(this,t,e,n,!1)},Er.prototype.write=function(t,e,n,r){if(void 0===e)r="utf8",n=this.length,e=0;else if(void 0===n&&"string"==typeof e)r=e,n=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-e;if((void 0===n||n>i)&&(n=i),t.length>0&&(n<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var o=!1;;)switch(r){case"hex":return Lr(this,t,e,n);case"utf8":case"utf-8":return Dr(this,t,e,n);case"ascii":return Br(this,t,e,n);case"latin1":case"binary":return jr(this,t,e,n);case"base64":return Cr(this,t,e,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Nr(this,t,e,n);default:if(o)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),o=!0}},Er.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Fr=4096;function qr(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(127&t[i]);return r}function Kr(t,e,n){var r="";n=Math.min(t.length,n);for(var i=e;i<n;++i)r+=String.fromCharCode(t[i]);return r}function Yr(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||n>r)&&(n=r);for(var i="",o=e;o<n;++o)i+=ti(t[o]);return i}function Hr(t,e,n){for(var r=t.slice(e,n),i="",o=0;o<r.length;o+=2)i+=String.fromCharCode(r[o]+256*r[o+1]);return i}function Wr(t,e,n){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>n)throw new RangeError("Trying to access beyond buffer length")}function Gr(t,e,n,r,i,o){if(!Tr(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(n+r>t.length)throw new RangeError("Index out of range")}function Vr(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i<o;++i)t[n+i]=(e&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function Jr(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i<o;++i)t[n+i]=e>>>8*(r?i:3-i)&255}function $r(t,e,n,r,i,o){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Zr(t,e,n,r,i){return i||$r(t,0,n,4),yr(t,e,n,r,23,4),n+4}function Xr(t,e,n,r,i){return i||$r(t,0,n,8),yr(t,e,n,r,52,8),n+8}Er.prototype.slice=function(t,e){var n,r=this.length;if((t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t),Er.TYPED_ARRAY_SUPPORT)(n=this.subarray(t,e)).__proto__=Er.prototype;else{var i=e-t;n=new Er(i,void 0);for(var o=0;o<i;++o)n[o]=this[o+t]}return n},Er.prototype.readUIntLE=function(t,e,n){t|=0,e|=0,n||Wr(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r},Er.prototype.readUIntBE=function(t,e,n){t|=0,e|=0,n||Wr(t,e,this.length);for(var r=this[t+--e],i=1;e>0&&(i*=256);)r+=this[t+--e]*i;return r},Er.prototype.readUInt8=function(t,e){return e||Wr(t,1,this.length),this[t]},Er.prototype.readUInt16LE=function(t,e){return e||Wr(t,2,this.length),this[t]|this[t+1]<<8},Er.prototype.readUInt16BE=function(t,e){return e||Wr(t,2,this.length),this[t]<<8|this[t+1]},Er.prototype.readUInt32LE=function(t,e){return e||Wr(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},Er.prototype.readUInt32BE=function(t,e){return e||Wr(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},Er.prototype.readIntLE=function(t,e,n){t|=0,e|=0,n||Wr(t,e,this.length);for(var r=this[t],i=1,o=0;++o<e&&(i*=256);)r+=this[t+o]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*e)),r},Er.prototype.readIntBE=function(t,e,n){t|=0,e|=0,n||Wr(t,e,this.length);for(var r=e,i=1,o=this[t+--r];r>0&&(i*=256);)o+=this[t+--r]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},Er.prototype.readInt8=function(t,e){return e||Wr(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},Er.prototype.readInt16LE=function(t,e){e||Wr(t,2,this.length);var n=this[t]|this[t+1]<<8;return 32768&n?4294901760|n:n},Er.prototype.readInt16BE=function(t,e){e||Wr(t,2,this.length);var n=this[t+1]|this[t]<<8;return 32768&n?4294901760|n:n},Er.prototype.readInt32LE=function(t,e){return e||Wr(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},Er.prototype.readInt32BE=function(t,e){return e||Wr(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},Er.prototype.readFloatLE=function(t,e){return e||Wr(t,4,this.length),gr(this,t,!0,23,4)},Er.prototype.readFloatBE=function(t,e){return e||Wr(t,4,this.length),gr(this,t,!1,23,4)},Er.prototype.readDoubleLE=function(t,e){return e||Wr(t,8,this.length),gr(this,t,!0,52,8)},Er.prototype.readDoubleBE=function(t,e){return e||Wr(t,8,this.length),gr(this,t,!1,52,8)},Er.prototype.writeUIntLE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||Gr(this,t,e,n,Math.pow(2,8*n)-1,0);var i=1,o=0;for(this[e]=255&t;++o<n&&(i*=256);)this[e+o]=t/i&255;return e+n},Er.prototype.writeUIntBE=function(t,e,n,r){(t=+t,e|=0,n|=0,r)||Gr(this,t,e,n,Math.pow(2,8*n)-1,0);var i=n-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+n},Er.prototype.writeUInt8=function(t,e,n){return t=+t,e|=0,n||Gr(this,t,e,1,255,0),Er.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},Er.prototype.writeUInt16LE=function(t,e,n){return t=+t,e|=0,n||Gr(this,t,e,2,65535,0),Er.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Vr(this,t,e,!0),e+2},Er.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||Gr(this,t,e,2,65535,0),Er.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Vr(this,t,e,!1),e+2},Er.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||Gr(this,t,e,4,4294967295,0),Er.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):Jr(this,t,e,!0),e+4},Er.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||Gr(this,t,e,4,4294967295,0),Er.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Jr(this,t,e,!1),e+4},Er.prototype.writeIntLE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);Gr(this,t,e,n,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o<n&&(s*=256);)t<0&&0===a&&0!==this[e+o-1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},Er.prototype.writeIntBE=function(t,e,n,r){if(t=+t,e|=0,!r){var i=Math.pow(2,8*n-1);Gr(this,t,e,n,i-1,-i)}var o=n-1,s=1,a=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+n},Er.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||Gr(this,t,e,1,127,-128),Er.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},Er.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||Gr(this,t,e,2,32767,-32768),Er.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):Vr(this,t,e,!0),e+2},Er.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||Gr(this,t,e,2,32767,-32768),Er.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):Vr(this,t,e,!1),e+2},Er.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||Gr(this,t,e,4,2147483647,-2147483648),Er.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):Jr(this,t,e,!0),e+4},Er.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||Gr(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),Er.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):Jr(this,t,e,!1),e+4},Er.prototype.writeFloatLE=function(t,e,n){return Zr(this,t,e,!0,n)},Er.prototype.writeFloatBE=function(t,e,n){return Zr(this,t,e,!1,n)},Er.prototype.writeDoubleLE=function(t,e,n){return Xr(this,t,e,!0,n)},Er.prototype.writeDoubleBE=function(t,e,n){return Xr(this,t,e,!1,n)},Er.prototype.copy=function(t,e,n,r){if(n||(n=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e<r-n&&(r=t.length-e+n);var i,o=r-n;if(this===t&&n<e&&e<r)for(i=o-1;i>=0;--i)t[i+e]=this[i+n];else if(o<1e3||!Er.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)t[i+e]=this[i+n];else Uint8Array.prototype.set.call(t,this.subarray(n,n+o),e);return o},Er.prototype.fill=function(t,e,n,r){if("string"==typeof t){if("string"==typeof e?(r=e,e=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===t.length){var i=t.charCodeAt(0);i<256&&(t=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!Er.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<n)throw new RangeError("Out of range index");if(n<=e)return this;var o;if(e>>>=0,n=void 0===n?this.length:n>>>0,t||(t=0),"number"==typeof t)for(o=e;o<n;++o)this[o]=t;else{var s=Tr(t)?t:ei(new Er(t,r).toString()),a=s.length;for(o=0;o<n-e;++o)this[o+e]=s[o%a]}return this};var Qr=/[^+\/0-9A-Za-z-_]/g;function ti(t){return t<16?"0"+t.toString(16):t.toString(16)}function ei(t,e){var n;e=e||1/0;for(var r=t.length,i=null,o=[],s=0;s<r;++s){if((n=t.charCodeAt(s))>55295&&n<57344){if(!i){if(n>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===r){(e-=3)>-1&&o.push(239,191,189);continue}i=n;continue}if(n<56320){(e-=3)>-1&&o.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,n<128){if((e-=1)<0)break;o.push(n)}else if(n<2048){if((e-=2)<0)break;o.push(n>>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|1