Last active
September 30, 2023 12:41
-
-
Save nakasyou/281f9947d8e8b4ce89a1a9449e3bad74 to your computer and use it in GitHub Desktop.
Matrix js sdk v28.2.0
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
!function e(t,i,n){function r(s,a){if(!i[s]){if(!t[s]){var c="function"==typeof require&&require;if(!a&&c)return c(s,!0);if(o)return o(s,!0);var d=new Error("Cannot find module '"+s+"'");throw d.code="MODULE_NOT_FOUND",d}var l=i[s]={exports:{}};t[s][0].call(l.exports,(function(e){return r(t[s][1][e]||e)}),l,l.exports,e,t,i,n)}return i[s].exports}for(var o="function"==typeof require&&require,s=0;s<n.length;s++)r(n[s]);return r}({1:[function(e,t,i){"use strict";for(var n=/[\\\"\x00-\x1F]/g,r={},o=0;o<32;++o)r[String.fromCharCode(o)]="\\U"+("0000"+o.toString(16)).slice(-4).toUpperCase();function s(e){return n.lastIndex=0,e.replace(n,(function(e){return r[e]}))}function a(e){switch(typeof e){case"string":return'"'+s(e)+'"';case"number":return isFinite(e)?e:"null";case"boolean":return e;case"object":return null===e?"null":Array.isArray(e)?function(e){for(var t="[",i="",n=0;n<e.length;++n)i+=t,t=",",i+=a(e[n]);return","!=t?"[]":i+"]"}(e):function(e){var t="{",i="",n=Object.keys(e);n.sort();for(var r=0;r<n.length;++r){var o=n[r];i+=t+'"'+s(o)+'":',t=",",i+=a(e[o])}return","!=t?"{}":i+"}"}(e);default:throw new Error("Cannot stringify: "+typeof e)}}r["\b"]="\\b",r["\t"]="\\t",r["\n"]="\\n",r["\f"]="\\f",r["\r"]="\\r",r['"']='\\"',r["\\"]="\\\\",t.exports={stringify:a}},{}],2:[function(e,t,i){"use strict";const n=i;n.bignum=e("bn.js"),n.define=e("./asn1/api").define,n.base=e("./asn1/base"),n.constants=e("./asn1/constants"),n.decoders=e("./asn1/decoders"),n.encoders=e("./asn1/encoders")},{"./asn1/api":3,"./asn1/base":5,"./asn1/constants":9,"./asn1/decoders":11,"./asn1/encoders":14,"bn.js":18}],3:[function(e,t,i){"use strict";const n=e("./encoders"),r=e("./decoders"),o=e("inherits");function s(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}i.define=function(e,t){return new s(e,t)},s.prototype._createNamed=function(e){const t=this.name;function i(e){this._initNamed(e,t)}return o(i,e),i.prototype._initNamed=function(t,i){e.call(this,t,i)},new i(this)},s.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(r[e])),this.decoders[e]},s.prototype.decode=function(e,t,i){return this._getDecoder(t).decode(e,i)},s.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n[e])),this.encoders[e]},s.prototype.encode=function(e,t,i){return this._getEncoder(t).encode(e,i)}},{"./decoders":11,"./encoders":14,inherits:151}],4:[function(e,t,i){"use strict";const n=e("inherits"),r=e("../base/reporter").Reporter,o=e("safer-buffer").Buffer;function s(e,t){r.call(this,t),o.isBuffer(e)?(this.base=e,this.offset=0,this.length=e.length):this.error("Input not Buffer")}function a(e,t){if(Array.isArray(e))this.length=0,this.value=e.map((function(e){return a.isEncoderBuffer(e)||(e=new a(e,t)),this.length+=e.length,e}),this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=o.byteLength(e);else{if(!o.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}n(s,r),i.DecoderBuffer=s,s.isDecoderBuffer=function(e){if(e instanceof s)return!0;return"object"==typeof e&&o.isBuffer(e.base)&&"DecoderBuffer"===e.constructor.name&&"number"==typeof e.offset&&"number"==typeof e.length&&"function"==typeof e.save&&"function"==typeof e.restore&&"function"==typeof e.isEmpty&&"function"==typeof e.readUInt8&&"function"==typeof e.skip&&"function"==typeof e.raw},s.prototype.save=function(){return{offset:this.offset,reporter:r.prototype.save.call(this)}},s.prototype.restore=function(e){const t=new s(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,r.prototype.restore.call(this,e.reporter),t},s.prototype.isEmpty=function(){return this.offset===this.length},s.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},s.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");const i=new s(this.base);return i._reporterState=this._reporterState,i.offset=this.offset,i.length=this.offset+e,this.offset+=e,i},s.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},i.EncoderBuffer=a,a.isEncoderBuffer=function(e){if(e instanceof a)return!0;return"object"==typeof e&&"EncoderBuffer"===e.constructor.name&&"number"==typeof e.length&&"function"==typeof e.join},a.prototype.join=function(e,t){return e||(e=o.alloc(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach((function(i){i.join(e,t),t+=i.length})):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):o.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}},{"../base/reporter":7,inherits:151,"safer-buffer":261}],5:[function(e,t,i){"use strict";const n=i;n.Reporter=e("./reporter").Reporter,n.DecoderBuffer=e("./buffer").DecoderBuffer,n.EncoderBuffer=e("./buffer").EncoderBuffer,n.Node=e("./node")},{"./buffer":4,"./node":6,"./reporter":7}],6:[function(e,t,i){"use strict";const n=e("../base/reporter").Reporter,r=e("../base/buffer").EncoderBuffer,o=e("../base/buffer").DecoderBuffer,s=e("minimalistic-assert"),a=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],c=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(a);function d(e,t,i){const n={};this._baseState=n,n.name=i,n.enc=e,n.parent=t||null,n.children=null,n.tag=null,n.args=null,n.reverseArgs=null,n.choice=null,n.optional=!1,n.any=!1,n.obj=!1,n.use=null,n.useDecoder=null,n.key=null,n.default=null,n.explicit=null,n.implicit=null,n.contains=null,n.parent||(n.children=[],this._wrap())}t.exports=d;const l=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];d.prototype.clone=function(){const e=this._baseState,t={};l.forEach((function(i){t[i]=e[i]}));const i=new this.constructor(t.parent);return i._baseState=t,i},d.prototype._wrap=function(){const e=this._baseState;c.forEach((function(t){this[t]=function(){const i=new this.constructor(this);return e.children.push(i),i[t].apply(i,arguments)}}),this)},d.prototype._init=function(e){const t=this._baseState;s(null===t.parent),e.call(this),t.children=t.children.filter((function(e){return e._baseState.parent===this}),this),s.equal(t.children.length,1,"Root node can have only one child")},d.prototype._useArgs=function(e){const t=this._baseState,i=e.filter((function(e){return e instanceof this.constructor}),this);e=e.filter((function(e){return!(e instanceof this.constructor)}),this),0!==i.length&&(s(null===t.children),t.children=i,i.forEach((function(e){e._baseState.parent=this}),this)),0!==e.length&&(s(null===t.args),t.args=e,t.reverseArgs=e.map((function(e){if("object"!=typeof e||e.constructor!==Object)return e;const t={};return Object.keys(e).forEach((function(i){i==(0|i)&&(i|=0);const n=e[i];t[n]=i})),t})))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach((function(e){d.prototype[e]=function(){const t=this._baseState;throw new Error(e+" not implemented for encoding: "+t.enc)}})),a.forEach((function(e){d.prototype[e]=function(){const t=this._baseState,i=Array.prototype.slice.call(arguments);return s(null===t.tag),t.tag=e,this._useArgs(i),this}})),d.prototype.use=function(e){s(e);const t=this._baseState;return s(null===t.use),t.use=e,this},d.prototype.optional=function(){return this._baseState.optional=!0,this},d.prototype.def=function(e){const t=this._baseState;return s(null===t.default),t.default=e,t.optional=!0,this},d.prototype.explicit=function(e){const t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.explicit=e,this},d.prototype.implicit=function(e){const t=this._baseState;return s(null===t.explicit&&null===t.implicit),t.implicit=e,this},d.prototype.obj=function(){const e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},d.prototype.key=function(e){const t=this._baseState;return s(null===t.key),t.key=e,this},d.prototype.any=function(){return this._baseState.any=!0,this},d.prototype.choice=function(e){const t=this._baseState;return s(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map((function(t){return e[t]}))),this},d.prototype.contains=function(e){const t=this._baseState;return s(null===t.use),t.contains=e,this},d.prototype._decode=function(e,t){const i=this._baseState;if(null===i.parent)return e.wrapResult(i.children[0]._decode(e,t));let n,r=i.default,s=!0,a=null;if(null!==i.key&&(a=e.enterKey(i.key)),i.optional){let n=null;if(null!==i.explicit?n=i.explicit:null!==i.implicit?n=i.implicit:null!==i.tag&&(n=i.tag),null!==n||i.any){if(s=this._peekTag(e,n,i.any),e.isError(s))return s}else{const n=e.save();try{null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t),s=!0}catch(e){s=!1}e.restore(n)}}if(i.obj&&s&&(n=e.enterObject()),s){if(null!==i.explicit){const t=this._decodeTag(e,i.explicit);if(e.isError(t))return t;e=t}const n=e.offset;if(null===i.use&&null===i.choice){let t;i.any&&(t=e.save());const n=this._decodeTag(e,null!==i.implicit?i.implicit:i.tag,i.any);if(e.isError(n))return n;i.any?r=e.raw(t):e=n}if(t&&t.track&&null!==i.tag&&t.track(e.path(),n,e.length,"tagged"),t&&t.track&&null!==i.tag&&t.track(e.path(),e.offset,e.length,"content"),i.any||(r=null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t)),e.isError(r))return r;if(i.any||null!==i.choice||null===i.children||i.children.forEach((function(i){i._decode(e,t)})),i.contains&&("octstr"===i.tag||"bitstr"===i.tag)){const n=new o(r);r=this._getUse(i.contains,e._reporterState.obj)._decode(n,t)}}return i.obj&&s&&(r=e.leaveObject(n)),null===i.key||null===r&&!0!==s?null!==a&&e.exitKey(a):e.leaveKey(a,i.key,r),r},d.prototype._decodeGeneric=function(e,t,i){const n=this._baseState;return"seq"===e||"set"===e?null:"seqof"===e||"setof"===e?this._decodeList(t,e,n.args[0],i):/str$/.test(e)?this._decodeStr(t,e,i):"objid"===e&&n.args?this._decodeObjid(t,n.args[0],n.args[1],i):"objid"===e?this._decodeObjid(t,null,null,i):"gentime"===e||"utctime"===e?this._decodeTime(t,e,i):"null_"===e?this._decodeNull(t,i):"bool"===e?this._decodeBool(t,i):"objDesc"===e?this._decodeStr(t,e,i):"int"===e||"enum"===e?this._decodeInt(t,n.args&&n.args[0],i):null!==n.use?this._getUse(n.use,t._reporterState.obj)._decode(t,i):t.error("unknown tag: "+e)},d.prototype._getUse=function(e,t){const i=this._baseState;return i.useDecoder=this._use(e,t),s(null===i.useDecoder._baseState.parent),i.useDecoder=i.useDecoder._baseState.children[0],i.implicit!==i.useDecoder._baseState.implicit&&(i.useDecoder=i.useDecoder.clone(),i.useDecoder._baseState.implicit=i.implicit),i.useDecoder},d.prototype._decodeChoice=function(e,t){const i=this._baseState;let n=null,r=!1;return Object.keys(i.choice).some((function(o){const s=e.save(),a=i.choice[o];try{const i=a._decode(e,t);if(e.isError(i))return!1;n={type:o,value:i},r=!0}catch(t){return e.restore(s),!1}return!0}),this),r?n:e.error("Choice not matched")},d.prototype._createEncoderBuffer=function(e){return new r(e,this.reporter)},d.prototype._encode=function(e,t,i){const n=this._baseState;if(null!==n.default&&n.default===e)return;const r=this._encodeValue(e,t,i);return void 0===r||this._skipDefault(r,t,i)?void 0:r},d.prototype._encodeValue=function(e,t,i){const r=this._baseState;if(null===r.parent)return r.children[0]._encode(e,t||new n);let o=null;if(this.reporter=t,r.optional&&void 0===e){if(null===r.default)return;e=r.default}let s=null,a=!1;if(r.any)o=this._createEncoderBuffer(e);else if(r.choice)o=this._encodeChoice(e,t);else if(r.contains)s=this._getUse(r.contains,i)._encode(e,t),a=!0;else if(r.children)s=r.children.map((function(i){if("null_"===i._baseState.tag)return i._encode(null,t,e);if(null===i._baseState.key)return t.error("Child should have a key");const n=t.enterKey(i._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");const r=i._encode(e[i._baseState.key],t,e);return t.leaveKey(n),r}),this).filter((function(e){return e})),s=this._createEncoderBuffer(s);else if("seqof"===r.tag||"setof"===r.tag){if(!r.args||1!==r.args.length)return t.error("Too many args for : "+r.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");const i=this.clone();i._baseState.implicit=null,s=this._createEncoderBuffer(e.map((function(i){const n=this._baseState;return this._getUse(n.args[0],e)._encode(i,t)}),i))}else null!==r.use?o=this._getUse(r.use,i)._encode(e,t):(s=this._encodePrimitive(r.tag,e),a=!0);if(!r.any&&null===r.choice){const e=null!==r.implicit?r.implicit:r.tag,i=null===r.implicit?"universal":"context";null===e?null===r.use&&t.error("Tag could be omitted only for .use()"):null===r.use&&(o=this._encodeComposite(e,a,i,s))}return null!==r.explicit&&(o=this._encodeComposite(r.explicit,!1,"context",o)),o},d.prototype._encodeChoice=function(e,t){const i=this._baseState,n=i.choice[e.type];return n||s(!1,e.type+" not found in "+JSON.stringify(Object.keys(i.choice))),n._encode(e.value,t)},d.prototype._encodePrimitive=function(e,t){const i=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&i.args)return this._encodeObjid(t,i.reverseArgs[0],i.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();if("int"===e||"enum"===e)return this._encodeInt(t,i.args&&i.reverseArgs[0]);if("bool"===e)return this._encodeBool(t);if("objDesc"===e)return this._encodeStr(t,e);throw new Error("Unsupported tag: "+e)},d.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},d.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '()+,-./:=?]*$/.test(e)}},{"../base/buffer":4,"../base/reporter":7,"minimalistic-assert":232}],7:[function(e,t,i){"use strict";const n=e("inherits");function r(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function o(e,t){this.path=e,this.rethrow(t)}i.Reporter=r,r.prototype.isError=function(e){return e instanceof o},r.prototype.save=function(){const e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},r.prototype.restore=function(e){const t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},r.prototype.enterKey=function(e){return this._reporterState.path.push(e)},r.prototype.exitKey=function(e){const t=this._reporterState;t.path=t.path.slice(0,e-1)},r.prototype.leaveKey=function(e,t,i){const n=this._reporterState;this.exitKey(e),null!==n.obj&&(n.obj[t]=i)},r.prototype.path=function(){return this._reporterState.path.join("/")},r.prototype.enterObject=function(){const e=this._reporterState,t=e.obj;return e.obj={},t},r.prototype.leaveObject=function(e){const t=this._reporterState,i=t.obj;return t.obj=e,i},r.prototype.error=function(e){let t;const i=this._reporterState,n=e instanceof o;if(t=n?e:new o(i.path.map((function(e){return"["+JSON.stringify(e)+"]"})).join(""),e.message||e,e.stack),!i.options.partial)throw t;return n||i.errors.push(t),t},r.prototype.wrapResult=function(e){const t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},n(o,Error),o.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,o),!this.stack)try{throw new Error(this.message)}catch(e){this.stack=e.stack}return this}},{inherits:151}],8:[function(e,t,i){"use strict";function n(e){const t={};return Object.keys(e).forEach((function(i){(0|i)==i&&(i|=0);const n=e[i];t[n]=i})),t}i.tagClass={0:"universal",1:"application",2:"context",3:"private"},i.tagClassByName=n(i.tagClass),i.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},i.tagByName=n(i.tag)},{}],9:[function(e,t,i){"use strict";const n=i;n._reverse=function(e){const t={};return Object.keys(e).forEach((function(i){(0|i)==i&&(i|=0);const n=e[i];t[n]=i})),t},n.der=e("./der")},{"./der":8}],10:[function(e,t,i){"use strict";const n=e("inherits"),r=e("bn.js"),o=e("../base/buffer").DecoderBuffer,s=e("../base/node"),a=e("../constants/der");function c(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new d,this.tree._init(e.body)}function d(e){s.call(this,"der",e)}function l(e,t){let i=e.readUInt8(t);if(e.isError(i))return i;const n=a.tagClass[i>>6],r=0==(32&i);if(31==(31&i)){let n=i;for(i=0;128==(128&n);){if(n=e.readUInt8(t),e.isError(n))return n;i<<=7,i|=127&n}}else i&=31;return{cls:n,primitive:r,tag:i,tagStr:a.tag[i]}}function u(e,t,i){let n=e.readUInt8(i);if(e.isError(n))return n;if(!t&&128===n)return null;if(0==(128&n))return n;const r=127&n;if(r>4)return e.error("length octect is too long");n=0;for(let t=0;t<r;t++){n<<=8;const t=e.readUInt8(i);if(e.isError(t))return t;n|=t}return n}t.exports=c,c.prototype.decode=function(e,t){return o.isDecoderBuffer(e)||(e=new o(e,t)),this.tree._decode(e,t)},n(d,s),d.prototype._peekTag=function(e,t,i){if(e.isEmpty())return!1;const n=e.save(),r=l(e,'Failed to peek tag: "'+t+'"');return e.isError(r)?r:(e.restore(n),r.tag===t||r.tagStr===t||r.tagStr+"of"===t||i)},d.prototype._decodeTag=function(e,t,i){const n=l(e,'Failed to decode tag of "'+t+'"');if(e.isError(n))return n;let r=u(e,n.primitive,'Failed to get length of "'+t+'"');if(e.isError(r))return r;if(!i&&n.tag!==t&&n.tagStr!==t&&n.tagStr+"of"!==t)return e.error('Failed to match tag: "'+t+'"');if(n.primitive||null!==r)return e.skip(r,'Failed to match body of: "'+t+'"');const o=e.save(),s=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(s)?s:(r=e.offset-o.offset,e.restore(o),e.skip(r,'Failed to match body of: "'+t+'"'))},d.prototype._skipUntilEnd=function(e,t){for(;;){const i=l(e,t);if(e.isError(i))return i;const n=u(e,i.primitive,t);if(e.isError(n))return n;let r;if(r=i.primitive||null!==n?e.skip(n):this._skipUntilEnd(e,t),e.isError(r))return r;if("end"===i.tagStr)break}},d.prototype._decodeList=function(e,t,i,n){const r=[];for(;!e.isEmpty();){const t=this._peekTag(e,"end");if(e.isError(t))return t;const o=i.decode(e,"der",n);if(e.isError(o)&&t)break;r.push(o)}return r},d.prototype._decodeStr=function(e,t){if("bitstr"===t){const t=e.readUInt8();return e.isError(t)?t:{unused:t,data:e.raw()}}if("bmpstr"===t){const t=e.raw();if(t.length%2==1)return e.error("Decoding of string type: bmpstr length mismatch");let i="";for(let e=0;e<t.length/2;e++)i+=String.fromCharCode(t.readUInt16BE(2*e));return i}if("numstr"===t){const t=e.raw().toString("ascii");return this._isNumstr(t)?t:e.error("Decoding of string type: numstr unsupported characters")}if("octstr"===t)return e.raw();if("objDesc"===t)return e.raw();if("printstr"===t){const t=e.raw().toString("ascii");return this._isPrintstr(t)?t:e.error("Decoding of string type: printstr unsupported characters")}return/str$/.test(t)?e.raw().toString():e.error("Decoding of string type: "+t+" unsupported")},d.prototype._decodeObjid=function(e,t,i){let n;const r=[];let o=0,s=0;for(;!e.isEmpty();)s=e.readUInt8(),o<<=7,o|=127&s,0==(128&s)&&(r.push(o),o=0);128&s&&r.push(o);const a=r[0]/40|0,c=r[0]%40;if(n=i?r:[a,c].concat(r.slice(1)),t){let e=t[n.join(" ")];void 0===e&&(e=t[n.join(".")]),void 0!==e&&(n=e)}return n},d.prototype._decodeTime=function(e,t){const i=e.raw().toString();let n,r,o,s,a,c;if("gentime"===t)n=0|i.slice(0,4),r=0|i.slice(4,6),o=0|i.slice(6,8),s=0|i.slice(8,10),a=0|i.slice(10,12),c=0|i.slice(12,14);else{if("utctime"!==t)return e.error("Decoding "+t+" time is not supported yet");n=0|i.slice(0,2),r=0|i.slice(2,4),o=0|i.slice(4,6),s=0|i.slice(6,8),a=0|i.slice(8,10),c=0|i.slice(10,12),n=n<70?2e3+n:1900+n}return Date.UTC(n,r-1,o,s,a,c,0)},d.prototype._decodeNull=function(){return null},d.prototype._decodeBool=function(e){const t=e.readUInt8();return e.isError(t)?t:0!==t},d.prototype._decodeInt=function(e,t){const i=e.raw();let n=new r(i);return t&&(n=t[n.toString(10)]||n),n},d.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getDecoder("der").tree}},{"../base/buffer":4,"../base/node":6,"../constants/der":8,"bn.js":18,inherits:151}],11:[function(e,t,i){"use strict";const n=i;n.der=e("./der"),n.pem=e("./pem")},{"./der":10,"./pem":12}],12:[function(e,t,i){"use strict";const n=e("inherits"),r=e("safer-buffer").Buffer,o=e("./der");function s(e){o.call(this,e),this.enc="pem"}n(s,o),t.exports=s,s.prototype.decode=function(e,t){const i=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/;let a=-1,c=-1;for(let e=0;e<i.length;e++){const t=i[e].match(s);if(null!==t&&t[2]===n){if(-1!==a){if("END"!==t[1])break;c=e;break}if("BEGIN"!==t[1])break;a=e}}if(-1===a||-1===c)throw new Error("PEM section not found for: "+n);const d=i.slice(a+1,c).join("");d.replace(/[^a-z0-9+/=]+/gi,"");const l=r.from(d,"base64");return o.prototype.decode.call(this,l,t)}},{"./der":10,inherits:151,"safer-buffer":261}],13:[function(e,t,i){"use strict";const n=e("inherits"),r=e("safer-buffer").Buffer,o=e("../base/node"),s=e("../constants/der");function a(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new c,this.tree._init(e.body)}function c(e){o.call(this,"der",e)}function d(e){return e<10?"0"+e:e}t.exports=a,a.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},n(c,o),c.prototype._encodeComposite=function(e,t,i,n){const o=function(e,t,i,n){let r;"seqof"===e?e="seq":"setof"===e&&(e="set");if(s.tagByName.hasOwnProperty(e))r=s.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return n.error("Unknown tag: "+e);r=e}if(r>=31)return n.error("Multi-octet tag encoding unsupported");t||(r|=32);return r|=s.tagClassByName[i||"universal"]<<6,r}(e,t,i,this.reporter);if(n.length<128){const e=r.alloc(2);return e[0]=o,e[1]=n.length,this._createEncoderBuffer([e,n])}let a=1;for(let e=n.length;e>=256;e>>=8)a++;const c=r.alloc(2+a);c[0]=o,c[1]=128|a;for(let e=1+a,t=n.length;t>0;e--,t>>=8)c[e]=255&t;return this._createEncoderBuffer([c,n])},c.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){const t=r.alloc(2*e.length);for(let i=0;i<e.length;i++)t.writeUInt16BE(e.charCodeAt(i),2*i);return this._createEncoderBuffer(t)}return"numstr"===t?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):"printstr"===t?this._isPrintstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(t)||"objDesc"===t?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+t+" unsupported")},c.prototype._encodeObjid=function(e,t,i){if("string"==typeof e){if(!t)return this.reporter.error("string objid given, but no values map found");if(!t.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=t[e].split(/[\s.]+/g);for(let t=0;t<e.length;t++)e[t]|=0}else if(Array.isArray(e)){e=e.slice();for(let t=0;t<e.length;t++)e[t]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!i){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}let n=0;for(let t=0;t<e.length;t++){let i=e[t];for(n++;i>=128;i>>=7)n++}const o=r.alloc(n);let s=o.length-1;for(let t=e.length-1;t>=0;t--){let i=e[t];for(o[s--]=127&i;(i>>=7)>0;)o[s--]=128|127&i}return this._createEncoderBuffer(o)},c.prototype._encodeTime=function(e,t){let i;const n=new Date(e);return"gentime"===t?i=[d(n.getUTCFullYear()),d(n.getUTCMonth()+1),d(n.getUTCDate()),d(n.getUTCHours()),d(n.getUTCMinutes()),d(n.getUTCSeconds()),"Z"].join(""):"utctime"===t?i=[d(n.getUTCFullYear()%100),d(n.getUTCMonth()+1),d(n.getUTCDate()),d(n.getUTCHours()),d(n.getUTCMinutes()),d(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(i,"octstr")},c.prototype._encodeNull=function(){return this._createEncoderBuffer("")},c.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!r.isBuffer(e)){const t=e.toArray();!e.sign&&128&t[0]&&t.unshift(0),e=r.from(t)}if(r.isBuffer(e)){let t=e.length;0===e.length&&t++;const i=r.alloc(t);return e.copy(i),0===e.length&&(i[0]=0),this._createEncoderBuffer(i)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);let i=1;for(let t=e;t>=256;t>>=8)i++;const n=new Array(i);for(let t=n.length-1;t>=0;t--)n[t]=255&e,e>>=8;return 128&n[0]&&n.unshift(0),this._createEncoderBuffer(r.from(n))},c.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},c.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},c.prototype._skipDefault=function(e,t,i){const n=this._baseState;let r;if(null===n.default)return!1;const o=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,i).join()),o.length!==n.defaultBuffer.length)return!1;for(r=0;r<o.length;r++)if(o[r]!==n.defaultBuffer[r])return!1;return!0}},{"../base/node":6,"../constants/der":8,inherits:151,"safer-buffer":261}],14:[function(e,t,i){"use strict";const n=i;n.der=e("./der"),n.pem=e("./pem")},{"./der":13,"./pem":15}],15:[function(e,t,i){"use strict";const n=e("inherits"),r=e("./der");function o(e){r.call(this,e),this.enc="pem"}n(o,r),t.exports=o,o.prototype.encode=function(e,t){const i=r.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+t.label+"-----"];for(let e=0;e<i.length;e+=64)n.push(i.slice(e,e+64));return n.push("-----END "+t.label+"-----"),n.join("\n")}},{"./der":13,inherits:151}],16:[function(e,t,i){(function(e){(function(){"use strict";var i=["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],n="undefined"==typeof globalThis?e:globalThis;t.exports=function(){for(var e=[],t=0;t<i.length;t++)"function"==typeof n[i[t]]&&(e[e.length]=i[t]);return e}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],17:[function(e,t,i){"use strict";i.byteLength=function(e){var t=c(e),i=t[0],n=t[1];return 3*(i+n)/4-n},i.toByteArray=function(e){var t,i,n=c(e),s=n[0],a=n[1],d=new o(function(e,t,i){return 3*(t+i)/4-i}(0,s,a)),l=0,u=a>0?s-4:s;for(i=0;i<u;i+=4)t=r[e.charCodeAt(i)]<<18|r[e.charCodeAt(i+1)]<<12|r[e.charCodeAt(i+2)]<<6|r[e.charCodeAt(i+3)],d[l++]=t>>16&255,d[l++]=t>>8&255,d[l++]=255&t;2===a&&(t=r[e.charCodeAt(i)]<<2|r[e.charCodeAt(i+1)]>>4,d[l++]=255&t);1===a&&(t=r[e.charCodeAt(i)]<<10|r[e.charCodeAt(i+1)]<<4|r[e.charCodeAt(i+2)]>>2,d[l++]=t>>8&255,d[l++]=255&t);return d},i.fromByteArray=function(e){for(var t,i=e.length,r=i%3,o=[],s=16383,a=0,c=i-r;a<c;a+=s)o.push(d(e,a,a+s>c?c:a+s));1===r?(t=e[i-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===r&&(t=(e[i-2]<<8)+e[i-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"="));return o.join("")};for(var n=[],r=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0;a<64;++a)n[a]=s[a],r[s.charCodeAt(a)]=a;function c(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");return-1===i&&(i=t),[i,i===t?0:4-i%4]}function d(e,t,i){for(var r,o,s=[],a=t;a<i;a+=3)r=(e[a]<<16&16711680)+(e[a+1]<<8&65280)+(255&e[a+2]),s.push(n[(o=r)>>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}r["-".charCodeAt(0)]=62,r["_".charCodeAt(0)]=63},{}],18:[function(e,t,i){!function(t,i){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}function o(e,t,i){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(i=t,t=10),this._init(e||0,t||10,i||"be"))}var s;"object"==typeof t?t.exports=o:i.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:e("buffer").Buffer}catch(e){}function a(e,t){var i=e.charCodeAt(t);return i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:i-48&15}function c(e,t,i){var n=a(e,i);return i-1>=t&&(n|=a(e,i-1)<<4),n}function d(e,t,i,n){for(var r=0,o=Math.min(e.length,i),s=t;s<o;s++){var a=e.charCodeAt(s)-48;r*=n,r+=a>=49?a-49+10:a>=17?a-17+10:a}return r}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r<e.length&&(16===t?this._parseHex(e,r,i):(this._parseBase(e,t,r),"le"===i&&this._initArray(this.toArray(),t,i)))},o.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},o.prototype._initArray=function(e,t,i){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var o,s,a=0;if("be"===i)for(r=e.length-1,o=0;r>=0;r-=3)s=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===i)for(r=0,o=0;r<e.length;r+=3)s=e[r]|e[r+1]<<8|e[r+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,i){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var r,o=0,s=0;if("be"===i)for(n=e.length-1;n>=t;n-=2)r=c(e,t,n)<<o,this.words[s]|=67108863&r,o>=18?(o-=18,s+=1,this.words[s]|=r>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)r=c(e,t,n)<<o,this.words[s]|=67108863&r,o>=18?(o-=18,s+=1,this.words[s]|=r>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,i){this.words=[0],this.length=1;for(var n=0,r=1;r<=67108863;r*=t)n++;n--,r=r/t|0;for(var o=e.length-i,s=o%n,a=Math.min(o,o-s)+i,c=0,l=i;l<a;l+=n)c=d(e,l,l+n,t),this.imuln(r),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var u=1;for(c=d(e,l,e.length,t),l=0;l<s;l++)u*=t;this.imuln(u),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],u=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],h=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,i){i.negative=t.negative^e.negative;var n=e.length+t.length|0;i.length=n,n=n-1|0;var r=0|e.words[0],o=0|t.words[0],s=r*o,a=67108863&s,c=s/67108864|0;i.words[0]=a;for(var d=1;d<n;d++){for(var l=c>>>26,u=67108863&c,h=Math.min(d,t.length-1),f=Math.max(0,d-e.length+1);f<=h;f++){var p=d-f|0;l+=(s=(r=0|e.words[p])*(o=0|t.words[f])+u)/67108864|0,u=67108863&s}i.words[d]=0|u,c=0|l}return 0!==c?i.words[d]=0|c:i.length--,i.strip()}o.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var r=0,o=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<r|o)).toString(16);i=0!==(o=a>>>24-r&16777215)||s!==this.length-1?l[6-c.length]+c+i:c+i,(r+=2)>=26&&(r-=26,s--)}for(0!==o&&(i=o.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var d=u[e],f=h[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modn(f).toString(e);i=(p=p.idivn(f)).isZero()?g+i:l[d-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,i){var r=this.byteLength(),o=i||Math.max(1,r);n(r<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,c="le"===t,d=new e(o),l=this.clone();if(c){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),d[a]=s;for(;a<o;a++)d[a]=0}else{for(a=0;a<o-r;a++)d[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),d[o-a-1]=s}return d},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,i=0;return t>=4096&&(i+=13,t>>>=13),t>=64&&(i+=7,t>>>=7),t>=8&&(i+=4,t>>>=4),t>=2&&(i+=2,t>>>=2),i+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,i=0;return 0==(8191&t)&&(i+=13,t>>>=13),0==(127&t)&&(i+=7,t>>>=7),0==(15&t)&&(i+=4,t>>>=4),0==(3&t)&&(i+=2,t>>>=2),0==(1&t)&&i++,i},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var i=this._zeroBits(this.words[t]);if(e+=i,26!==i)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,i;this.length>e.length?(t=this,i=e):(t=e,i=this);for(var n=0;n<i.length;n++)this.words[n]=t.words[n]^i.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var r=0;r<t;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var i=e/26|0,r=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<r:this.words[i]&~(1<<r),this.strip()},o.prototype.iadd=function(e){var t,i,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(i=this,n=e):(i=e,n=this);for(var r=0,o=0;o<n.length;o++)t=(0|i.words[o])+(0|n.words[o])+r,this.words[o]=67108863&t,r=t>>>26;for(;0!==r&&o<i.length;o++)t=(0|i.words[o])+r,this.words[o]=67108863&t,r=t>>>26;if(this.length=i.length,0!==r)this.words[this.length]=r,this.length++;else if(i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,n,r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(i=this,n=e):(i=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|i.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<i.length;s++)o=(t=(0|i.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<i.length&&i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this.length=Math.max(this.length,s),i!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,i){var n,r,o,s=e.words,a=t.words,c=i.words,d=0,l=0|s[0],u=8191&l,h=l>>>13,f=0|s[1],p=8191&f,g=f>>>13,v=0|s[2],m=8191&v,y=v>>>13,b=0|s[3],_=8191&b,S=b>>>13,E=0|s[4],w=8191&E,T=E>>>13,I=0|s[5],R=8191&I,k=I>>>13,M=0|s[6],C=8191&M,O=M>>>13,A=0|s[7],P=8191&A,D=A>>>13,x=0|s[8],L=8191&x,U=x>>>13,N=0|s[9],B=8191&N,j=N>>>13,F=0|a[0],K=8191&F,q=F>>>13,$=0|a[1],V=8191&$,H=$>>>13,W=0|a[2],G=8191&W,z=W>>>13,Y=0|a[3],J=8191&Y,Q=Y>>>13,X=0|a[4],Z=8191&X,ee=X>>>13,te=0|a[5],ie=8191&te,ne=te>>>13,re=0|a[6],oe=8191&re,se=re>>>13,ae=0|a[7],ce=8191&ae,de=ae>>>13,le=0|a[8],ue=8191&le,he=le>>>13,fe=0|a[9],pe=8191&fe,ge=fe>>>13;i.negative=e.negative^t.negative,i.length=19;var ve=(d+(n=Math.imul(u,K))|0)+((8191&(r=(r=Math.imul(u,q))+Math.imul(h,K)|0))<<13)|0;d=((o=Math.imul(h,q))+(r>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,K),r=(r=Math.imul(p,q))+Math.imul(g,K)|0,o=Math.imul(g,q);var me=(d+(n=n+Math.imul(u,V)|0)|0)+((8191&(r=(r=r+Math.imul(u,H)|0)+Math.imul(h,V)|0))<<13)|0;d=((o=o+Math.imul(h,H)|0)+(r>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,K),r=(r=Math.imul(m,q))+Math.imul(y,K)|0,o=Math.imul(y,q),n=n+Math.imul(p,V)|0,r=(r=r+Math.imul(p,H)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,H)|0;var ye=(d+(n=n+Math.imul(u,G)|0)|0)+((8191&(r=(r=r+Math.imul(u,z)|0)+Math.imul(h,G)|0))<<13)|0;d=((o=o+Math.imul(h,z)|0)+(r>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(_,K),r=(r=Math.imul(_,q))+Math.imul(S,K)|0,o=Math.imul(S,q),n=n+Math.imul(m,V)|0,r=(r=r+Math.imul(m,H)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,H)|0,n=n+Math.imul(p,G)|0,r=(r=r+Math.imul(p,z)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,z)|0;var be=(d+(n=n+Math.imul(u,J)|0)|0)+((8191&(r=(r=r+Math.imul(u,Q)|0)+Math.imul(h,J)|0))<<13)|0;d=((o=o+Math.imul(h,Q)|0)+(r>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,K),r=(r=Math.imul(w,q))+Math.imul(T,K)|0,o=Math.imul(T,q),n=n+Math.imul(_,V)|0,r=(r=r+Math.imul(_,H)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,H)|0,n=n+Math.imul(m,G)|0,r=(r=r+Math.imul(m,z)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,z)|0,n=n+Math.imul(p,J)|0,r=(r=r+Math.imul(p,Q)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,Q)|0;var _e=(d+(n=n+Math.imul(u,Z)|0)|0)+((8191&(r=(r=r+Math.imul(u,ee)|0)+Math.imul(h,Z)|0))<<13)|0;d=((o=o+Math.imul(h,ee)|0)+(r>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,K),r=(r=Math.imul(R,q))+Math.imul(k,K)|0,o=Math.imul(k,q),n=n+Math.imul(w,V)|0,r=(r=r+Math.imul(w,H)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,H)|0,n=n+Math.imul(_,G)|0,r=(r=r+Math.imul(_,z)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,z)|0,n=n+Math.imul(m,J)|0,r=(r=r+Math.imul(m,Q)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,Q)|0,n=n+Math.imul(p,Z)|0,r=(r=r+Math.imul(p,ee)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,ee)|0;var Se=(d+(n=n+Math.imul(u,ie)|0)|0)+((8191&(r=(r=r+Math.imul(u,ne)|0)+Math.imul(h,ie)|0))<<13)|0;d=((o=o+Math.imul(h,ne)|0)+(r>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(C,K),r=(r=Math.imul(C,q))+Math.imul(O,K)|0,o=Math.imul(O,q),n=n+Math.imul(R,V)|0,r=(r=r+Math.imul(R,H)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,H)|0,n=n+Math.imul(w,G)|0,r=(r=r+Math.imul(w,z)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,z)|0,n=n+Math.imul(_,J)|0,r=(r=r+Math.imul(_,Q)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,Q)|0,n=n+Math.imul(m,Z)|0,r=(r=r+Math.imul(m,ee)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,ee)|0,n=n+Math.imul(p,ie)|0,r=(r=r+Math.imul(p,ne)|0)+Math.imul(g,ie)|0,o=o+Math.imul(g,ne)|0;var Ee=(d+(n=n+Math.imul(u,oe)|0)|0)+((8191&(r=(r=r+Math.imul(u,se)|0)+Math.imul(h,oe)|0))<<13)|0;d=((o=o+Math.imul(h,se)|0)+(r>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(P,K),r=(r=Math.imul(P,q))+Math.imul(D,K)|0,o=Math.imul(D,q),n=n+Math.imul(C,V)|0,r=(r=r+Math.imul(C,H)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,H)|0,n=n+Math.imul(R,G)|0,r=(r=r+Math.imul(R,z)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,z)|0,n=n+Math.imul(w,J)|0,r=(r=r+Math.imul(w,Q)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,Q)|0,n=n+Math.imul(_,Z)|0,r=(r=r+Math.imul(_,ee)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(m,ie)|0,r=(r=r+Math.imul(m,ne)|0)+Math.imul(y,ie)|0,o=o+Math.imul(y,ne)|0,n=n+Math.imul(p,oe)|0,r=(r=r+Math.imul(p,se)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,se)|0;var we=(d+(n=n+Math.imul(u,ce)|0)|0)+((8191&(r=(r=r+Math.imul(u,de)|0)+Math.imul(h,ce)|0))<<13)|0;d=((o=o+Math.imul(h,de)|0)+(r>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(L,K),r=(r=Math.imul(L,q))+Math.imul(U,K)|0,o=Math.imul(U,q),n=n+Math.imul(P,V)|0,r=(r=r+Math.imul(P,H)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,H)|0,n=n+Math.imul(C,G)|0,r=(r=r+Math.imul(C,z)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,z)|0,n=n+Math.imul(R,J)|0,r=(r=r+Math.imul(R,Q)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,Q)|0,n=n+Math.imul(w,Z)|0,r=(r=r+Math.imul(w,ee)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(_,ie)|0,r=(r=r+Math.imul(_,ne)|0)+Math.imul(S,ie)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(m,oe)|0,r=(r=r+Math.imul(m,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0,n=n+Math.imul(p,ce)|0,r=(r=r+Math.imul(p,de)|0)+Math.imul(g,ce)|0,o=o+Math.imul(g,de)|0;var Te=(d+(n=n+Math.imul(u,ue)|0)|0)+((8191&(r=(r=r+Math.imul(u,he)|0)+Math.imul(h,ue)|0))<<13)|0;d=((o=o+Math.imul(h,he)|0)+(r>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,K),r=(r=Math.imul(B,q))+Math.imul(j,K)|0,o=Math.imul(j,q),n=n+Math.imul(L,V)|0,r=(r=r+Math.imul(L,H)|0)+Math.imul(U,V)|0,o=o+Math.imul(U,H)|0,n=n+Math.imul(P,G)|0,r=(r=r+Math.imul(P,z)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,z)|0,n=n+Math.imul(C,J)|0,r=(r=r+Math.imul(C,Q)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(R,Z)|0,r=(r=r+Math.imul(R,ee)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(w,ie)|0,r=(r=r+Math.imul(w,ne)|0)+Math.imul(T,ie)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(_,oe)|0,r=(r=r+Math.imul(_,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,n=n+Math.imul(m,ce)|0,r=(r=r+Math.imul(m,de)|0)+Math.imul(y,ce)|0,o=o+Math.imul(y,de)|0,n=n+Math.imul(p,ue)|0,r=(r=r+Math.imul(p,he)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,he)|0;var Ie=(d+(n=n+Math.imul(u,pe)|0)|0)+((8191&(r=(r=r+Math.imul(u,ge)|0)+Math.imul(h,pe)|0))<<13)|0;d=((o=o+Math.imul(h,ge)|0)+(r>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,V),r=(r=Math.imul(B,H))+Math.imul(j,V)|0,o=Math.imul(j,H),n=n+Math.imul(L,G)|0,r=(r=r+Math.imul(L,z)|0)+Math.imul(U,G)|0,o=o+Math.imul(U,z)|0,n=n+Math.imul(P,J)|0,r=(r=r+Math.imul(P,Q)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,Q)|0,n=n+Math.imul(C,Z)|0,r=(r=r+Math.imul(C,ee)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(R,ie)|0,r=(r=r+Math.imul(R,ne)|0)+Math.imul(k,ie)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(w,oe)|0,r=(r=r+Math.imul(w,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(_,ce)|0,r=(r=r+Math.imul(_,de)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,de)|0,n=n+Math.imul(m,ue)|0,r=(r=r+Math.imul(m,he)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,he)|0;var Re=(d+(n=n+Math.imul(p,pe)|0)|0)+((8191&(r=(r=r+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;d=((o=o+Math.imul(g,ge)|0)+(r>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(B,G),r=(r=Math.imul(B,z))+Math.imul(j,G)|0,o=Math.imul(j,z),n=n+Math.imul(L,J)|0,r=(r=r+Math.imul(L,Q)|0)+Math.imul(U,J)|0,o=o+Math.imul(U,Q)|0,n=n+Math.imul(P,Z)|0,r=(r=r+Math.imul(P,ee)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(C,ie)|0,r=(r=r+Math.imul(C,ne)|0)+Math.imul(O,ie)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(R,oe)|0,r=(r=r+Math.imul(R,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(w,ce)|0,r=(r=r+Math.imul(w,de)|0)+Math.imul(T,ce)|0,o=o+Math.imul(T,de)|0,n=n+Math.imul(_,ue)|0,r=(r=r+Math.imul(_,he)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,he)|0;var ke=(d+(n=n+Math.imul(m,pe)|0)|0)+((8191&(r=(r=r+Math.imul(m,ge)|0)+Math.imul(y,pe)|0))<<13)|0;d=((o=o+Math.imul(y,ge)|0)+(r>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(B,J),r=(r=Math.imul(B,Q))+Math.imul(j,J)|0,o=Math.imul(j,Q),n=n+Math.imul(L,Z)|0,r=(r=r+Math.imul(L,ee)|0)+Math.imul(U,Z)|0,o=o+Math.imul(U,ee)|0,n=n+Math.imul(P,ie)|0,r=(r=r+Math.imul(P,ne)|0)+Math.imul(D,ie)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(C,oe)|0,r=(r=r+Math.imul(C,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,n=n+Math.imul(R,ce)|0,r=(r=r+Math.imul(R,de)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,de)|0,n=n+Math.imul(w,ue)|0,r=(r=r+Math.imul(w,he)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,he)|0;var Me=(d+(n=n+Math.imul(_,pe)|0)|0)+((8191&(r=(r=r+Math.imul(_,ge)|0)+Math.imul(S,pe)|0))<<13)|0;d=((o=o+Math.imul(S,ge)|0)+(r>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Z),r=(r=Math.imul(B,ee))+Math.imul(j,Z)|0,o=Math.imul(j,ee),n=n+Math.imul(L,ie)|0,r=(r=r+Math.imul(L,ne)|0)+Math.imul(U,ie)|0,o=o+Math.imul(U,ne)|0,n=n+Math.imul(P,oe)|0,r=(r=r+Math.imul(P,se)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,se)|0,n=n+Math.imul(C,ce)|0,r=(r=r+Math.imul(C,de)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,de)|0,n=n+Math.imul(R,ue)|0,r=(r=r+Math.imul(R,he)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,he)|0;var Ce=(d+(n=n+Math.imul(w,pe)|0)|0)+((8191&(r=(r=r+Math.imul(w,ge)|0)+Math.imul(T,pe)|0))<<13)|0;d=((o=o+Math.imul(T,ge)|0)+(r>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,ie),r=(r=Math.imul(B,ne))+Math.imul(j,ie)|0,o=Math.imul(j,ne),n=n+Math.imul(L,oe)|0,r=(r=r+Math.imul(L,se)|0)+Math.imul(U,oe)|0,o=o+Math.imul(U,se)|0,n=n+Math.imul(P,ce)|0,r=(r=r+Math.imul(P,de)|0)+Math.imul(D,ce)|0,o=o+Math.imul(D,de)|0,n=n+Math.imul(C,ue)|0,r=(r=r+Math.imul(C,he)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,he)|0;var Oe=(d+(n=n+Math.imul(R,pe)|0)|0)+((8191&(r=(r=r+Math.imul(R,ge)|0)+Math.imul(k,pe)|0))<<13)|0;d=((o=o+Math.imul(k,ge)|0)+(r>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(B,oe),r=(r=Math.imul(B,se))+Math.imul(j,oe)|0,o=Math.imul(j,se),n=n+Math.imul(L,ce)|0,r=(r=r+Math.imul(L,de)|0)+Math.imul(U,ce)|0,o=o+Math.imul(U,de)|0,n=n+Math.imul(P,ue)|0,r=(r=r+Math.imul(P,he)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,he)|0;var Ae=(d+(n=n+Math.imul(C,pe)|0)|0)+((8191&(r=(r=r+Math.imul(C,ge)|0)+Math.imul(O,pe)|0))<<13)|0;d=((o=o+Math.imul(O,ge)|0)+(r>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(B,ce),r=(r=Math.imul(B,de))+Math.imul(j,ce)|0,o=Math.imul(j,de),n=n+Math.imul(L,ue)|0,r=(r=r+Math.imul(L,he)|0)+Math.imul(U,ue)|0,o=o+Math.imul(U,he)|0;var Pe=(d+(n=n+Math.imul(P,pe)|0)|0)+((8191&(r=(r=r+Math.imul(P,ge)|0)+Math.imul(D,pe)|0))<<13)|0;d=((o=o+Math.imul(D,ge)|0)+(r>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(B,ue),r=(r=Math.imul(B,he))+Math.imul(j,ue)|0,o=Math.imul(j,he);var De=(d+(n=n+Math.imul(L,pe)|0)|0)+((8191&(r=(r=r+Math.imul(L,ge)|0)+Math.imul(U,pe)|0))<<13)|0;d=((o=o+Math.imul(U,ge)|0)+(r>>>13)|0)+(De>>>26)|0,De&=67108863;var xe=(d+(n=Math.imul(B,pe))|0)+((8191&(r=(r=Math.imul(B,ge))+Math.imul(j,pe)|0))<<13)|0;return d=((o=Math.imul(j,ge))+(r>>>13)|0)+(xe>>>26)|0,xe&=67108863,c[0]=ve,c[1]=me,c[2]=ye,c[3]=be,c[4]=_e,c[5]=Se,c[6]=Ee,c[7]=we,c[8]=Te,c[9]=Ie,c[10]=Re,c[11]=ke,c[12]=Me,c[13]=Ce,c[14]=Oe,c[15]=Ae,c[16]=Pe,c[17]=De,c[18]=xe,0!==d&&(c[19]=d,i.length++),i};function g(e,t,i){return(new v).mulp(e,t,i)}function v(e,t){this.x=e,this.y=t}Math.imul||(p=f),o.prototype.mulTo=function(e,t){var i,n=this.length+e.length;return i=10===this.length&&10===e.length?p(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,i){i.negative=t.negative^e.negative,i.length=e.length+t.length;for(var n=0,r=0,o=0;o<i.length-1;o++){var s=r;r=0;for(var a=67108863&n,c=Math.min(o,t.length-1),d=Math.max(0,o-e.length+1);d<=c;d++){var l=o-d,u=(0|e.words[l])*(0|t.words[d]),h=67108863&u;a=67108863&(h=h+a|0),r+=(s=(s=s+(u/67108864|0)|0)+(h>>>26)|0)>>>26,s&=67108863}i.words[o]=a,n=s,s=r}return 0!==n?i.words[o]=n:i.length--,i.strip()}(this,e,t):g(this,e,t),i},v.prototype.makeRBT=function(e){for(var t=new Array(e),i=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,i,e);return t},v.prototype.revBin=function(e,t,i){if(0===e||e===i-1)return e;for(var n=0,r=0;r<t;r++)n|=(1&e)<<t-r-1,e>>=1;return n},v.prototype.permute=function(e,t,i,n,r,o){for(var s=0;s<o;s++)n[s]=t[e[s]],r[s]=i[e[s]]},v.prototype.transform=function(e,t,i,n,r,o){this.permute(o,e,t,i,n,r);for(var s=1;s<r;s<<=1)for(var a=s<<1,c=Math.cos(2*Math.PI/a),d=Math.sin(2*Math.PI/a),l=0;l<r;l+=a)for(var u=c,h=d,f=0;f<s;f++){var p=i[l+f],g=n[l+f],v=i[l+f+s],m=n[l+f+s],y=u*v-h*m;m=u*m+h*v,v=y,i[l+f]=p+v,n[l+f]=g+m,i[l+f+s]=p-v,n[l+f+s]=g-m,f!==a&&(y=c*u-d*h,h=c*h+d*u,u=y)}},v.prototype.guessLen13b=function(e,t){var i=1|Math.max(t,e),n=1&i,r=0;for(i=i/2|0;i;i>>>=1)r++;return 1<<r+1+n},v.prototype.conjugate=function(e,t,i){if(!(i<=1))for(var n=0;n<i/2;n++){var r=e[n];e[n]=e[i-n-1],e[i-n-1]=r,r=t[n],t[n]=-t[i-n-1],t[i-n-1]=-r}},v.prototype.normalize13b=function(e,t){for(var i=0,n=0;n<t/2;n++){var r=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+i;e[n]=67108863&r,i=r<67108864?0:r/67108864|0}return e},v.prototype.convert13b=function(e,t,i,r){for(var o=0,s=0;s<t;s++)o+=0|e[s],i[2*s]=8191&o,o>>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<r;++s)i[s]=0;n(0===o),n(0==(-8192&o))},v.prototype.stub=function(e){for(var t=new Array(e),i=0;i<e;i++)t[i]=0;return t},v.prototype.mulp=function(e,t,i){var n=2*this.guessLen13b(e.length,t.length),r=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),c=new Array(n),d=new Array(n),l=new Array(n),u=new Array(n),h=i.words;h.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,d,n),this.transform(s,o,a,c,n,r),this.transform(d,o,l,u,n,r);for(var f=0;f<n;f++){var p=a[f]*l[f]-c[f]*u[f];c[f]=a[f]*u[f]+c[f]*l[f],a[f]=p}return this.conjugate(a,c,n),this.transform(a,c,h,o,n,r),this.conjugate(h,o,n),this.normalize13b(h,n),i.negative=e.negative^t.negative,i.length=e.length+t.length,i.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),g(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,i=0;i<this.length;i++){var r=(0|this.words[i])*e,o=(67108863&r)+(67108863&t);t>>=26,t+=r/67108864|0,t+=o>>>26,this.words[i]=67108863&o}return 0!==t&&(this.words[i]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),i=0;i<t.length;i++){var n=i/26|0,r=i%26;t[i]=(e.words[n]&1<<r)>>>r}return t}(e);if(0===t.length)return new o(1);for(var i=this,n=0;n<t.length&&0===t[n];n++,i=i.sqr());if(++n<t.length)for(var r=i.sqr();n<t.length;n++,r=r.sqr())0!==t[n]&&(i=i.mul(r));return i},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,i=e%26,r=(e-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,c=(0|this.words[t])-a<<i;this.words[t]=c|s,s=a>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t<r;t++)this.words[t]=0;this.length+=r}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,i){var r;n("number"==typeof e&&e>=0),r=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,c=i;if(r-=s,r=Math.max(0,r),c){for(var d=0;d<s;d++)c.words[d]=this.words[d];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,d=0;d<this.length;d++)this.words[d]=this.words[d+s];else this.words[0]=0,this.length=1;var l=0;for(d=this.length-1;d>=0&&(0!==l||d>=r);d--){var u=0|this.words[d];this.words[d]=l<<26-o|u>>>o,l=u&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,i){return n(0===this.negative),this.iushrn(e,t,i)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,r=1<<t;return!(this.length<=i)&&!!(this.words[i]&r)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var r=67108863^67108863>>>t<<t;this.words[this.length-1]&=r}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,i){var r,o,s=e.length+i;this._expand(s);var a=0;for(r=0;r<e.length;r++){o=(0|this.words[r+i])+a;var c=(0|e.words[r])*t;a=((o-=67108863&c)>>26)-(c/67108864|0),this.words[r+i]=67108863&o}for(;r<this.length-i;r++)a=(o=(0|this.words[r+i])+a)>>26,this.words[r+i]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,r=0;r<this.length;r++)a=(o=-(0|this.words[r])+a)>>26,this.words[r]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var i=(this.length,e.length),n=this.clone(),r=e,s=0|r.words[r.length-1];0!==(i=26-this._countBits(s))&&(r=r.ushln(i),n.iushln(i),s=0|r.words[r.length-1]);var a,c=n.length-r.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var d=0;d<a.length;d++)a.words[d]=0}var l=n.clone()._ishlnsubmul(r,1,c);0===l.negative&&(n=l,a&&(a.words[c]=1));for(var u=c-1;u>=0;u--){var h=67108864*(0|n.words[r.length+u])+(0|n.words[r.length+u-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(r,h,u);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(r,1,u),n.isZero()||(n.negative^=1);a&&(a.words[u]=h)}return a&&a.strip(),n.strip(),"div"!==t&&0!==i&&n.iushrn(i),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,i){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(r=a.div.neg()),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:r,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(r=a.div.neg()),{div:r,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var r,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var i=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),r=e.andln(1),o=i.cmp(n);return o<0||1===r&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,i=0,r=this.length-1;r>=0;r--)i=(t*i+(0|this.words[r]))%e;return i},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,i=this.length-1;i>=0;i--){var r=(0|this.words[i])+67108864*t;this.words[i]=r/e|0,t=r%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new o(1),s=new o(0),a=new o(0),c=new o(1),d=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++d;for(var l=i.clone(),u=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(r.isOdd()||s.isOdd())&&(r.iadd(l),s.isub(u)),r.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(i.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(u)),a.iushrn(1),c.iushrn(1);t.cmp(i)>=0?(t.isub(i),r.isub(a),s.isub(c)):(i.isub(t),a.isub(r),c.isub(s))}return{a:a,b:c,gcd:i.iushln(d)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,s=new o(1),a=new o(0),c=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var u=0,h=1;0==(i.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(i.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a)):(i.isub(t),a.isub(s))}return(r=0===t.cmpn(1)?s:a).cmpn(0)<0&&r.iadd(e),r},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),i=e.clone();t.negative=0,i.negative=0;for(var n=0;t.isEven()&&i.isEven();n++)t.iushrn(1),i.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;i.isEven();)i.iushrn(1);var r=t.cmp(i);if(r<0){var o=t;t=i,i=o}else if(0===r||0===i.cmpn(1))break;t.isub(i)}return i.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,i=(e-t)/26,r=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var o=r,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),n(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:r<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,i=this.length-1;i>=0;i--){var n=0|this.words[i],r=0|e.words[i];if(n!==r){n<r?t=-1:n>r&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new w(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function y(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function b(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function E(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function w(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){w.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}y.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},y.prototype.ireduce=function(e){var t,i=e;do{this.split(i,this.tmp),t=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:i.ucmp(this.p);return 0===n?(i.words[0]=0,i.length=1):n>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},y.prototype.split=function(e,t){e.iushrn(this.n,0,t)},y.prototype.imulK=function(e){return e.imul(this.k)},r(b,y),b.prototype.split=function(e,t){for(var i=4194303,n=Math.min(e.length,9),r=0;r<n;r++)t.words[r]=e.words[r];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&i,r=10;r<e.length;r++){var s=0|e.words[r];e.words[r-10]=(s&i)<<4|o>>>22,o=s}o>>>=22,e.words[r-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},b.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,i=0;i<e.length;i++){var n=0|e.words[i];t+=977*n,e.words[i]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(_,y),r(S,y),r(E,y),E.prototype.imulK=function(e){for(var t=0,i=0;i<e.length;i++){var n=19*(0|e.words[i])+t,r=67108863&n;n>>>=26,e.words[i]=r,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new b;else if("p224"===e)t=new _;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new E}return m[e]=t,t},w.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},w.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},w.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},w.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},w.prototype.add=function(e,t){this._verify2(e,t);var i=e.add(t);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},w.prototype.iadd=function(e,t){this._verify2(e,t);var i=e.iadd(t);return i.cmp(this.m)>=0&&i.isub(this.m),i},w.prototype.sub=function(e,t){this._verify2(e,t);var i=e.sub(t);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},w.prototype.isub=function(e,t){this._verify2(e,t);var i=e.isub(t);return i.cmpn(0)<0&&i.iadd(this.m),i},w.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},w.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},w.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},w.prototype.isqr=function(e){return this.imul(e,e.clone())},w.prototype.sqr=function(e){return this.mul(e,e)},w.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var i=this.m.add(new o(1)).iushrn(2);return this.pow(e,i)}for(var r=this.m.subn(1),s=0;!r.isZero()&&0===r.andln(1);)s++,r.iushrn(1);n(!r.isZero());var a=new o(1).toRed(this),c=a.redNeg(),d=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,d).cmp(c);)l.redIAdd(c);for(var u=this.pow(l,r),h=this.pow(e,r.addn(1).iushrn(1)),f=this.pow(e,r),p=s;0!==f.cmp(a);){for(var g=f,v=0;0!==g.cmp(a);v++)g=g.redSqr();n(v<p);var m=this.pow(u,new o(1).iushln(p-v-1));h=h.redMul(m),u=m.redSqr(),f=f.redMul(u),p=v}return h},w.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},w.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var i=new Array(16);i[0]=new o(1).toRed(this),i[1]=e;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],e);var r=i[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var d=t.words[n],l=c-1;l>=0;l--){var u=d>>l&1;r!==i[0]&&(r=this.sqr(r)),0!==u||0!==s?(s<<=1,s|=u,(4===++a||0===n&&0===l)&&(r=this.mul(r,i[s]),a=0,s=0)):a=0}c=26}return r},w.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},w.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new T(e)},r(T,w),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(t),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(n).iushrn(this.shift),o=r;return r.cmp(this.m)>=0?o=r.isub(this.m):r.cmpn(0)<0&&(o=r.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var i=e.mul(t),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(n).iushrn(this.shift),s=r;return r.cmp(this.m)>=0?s=r.isub(this.m):r.cmpn(0)<0&&(s=r.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:20}],19:[function(e,t,i){var n;function r(e){this.rand=e}if(t.exports=function(e){return n||(n=new r(null)),n.generate(e)},t.exports.Rand=r,r.prototype.generate=function(e){return this._rand(e)},r.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),i=0;i<t.length;i++)t[i]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?r.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?r.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(r.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var o=e("crypto");if("function"!=typeof o.randomBytes)throw new Error("Not supported");r.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},{crypto:20}],20:[function(e,t,i){},{}],21:[function(e,t,i){var n=e("safe-buffer").Buffer;function r(e){n.isBuffer(e)||(e=n.from(e));for(var t=e.length/4|0,i=new Array(t),r=0;r<t;r++)i[r]=e.readUInt32BE(4*r);return i}function o(e){for(;0<e.length;e++)e[0]=0}function s(e,t,i,n,r){for(var o,s,a,c,d=i[0],l=i[1],u=i[2],h=i[3],f=e[0]^t[0],p=e[1]^t[1],g=e[2]^t[2],v=e[3]^t[3],m=4,y=1;y<r;y++)o=d[f>>>24]^l[p>>>16&255]^u[g>>>8&255]^h[255&v]^t[m++],s=d[p>>>24]^l[g>>>16&255]^u[v>>>8&255]^h[255&f]^t[m++],a=d[g>>>24]^l[v>>>16&255]^u[f>>>8&255]^h[255&p]^t[m++],c=d[v>>>24]^l[f>>>16&255]^u[p>>>8&255]^h[255&g]^t[m++],f=o,p=s,g=a,v=c;return o=(n[f>>>24]<<24|n[p>>>16&255]<<16|n[g>>>8&255]<<8|n[255&v])^t[m++],s=(n[p>>>24]<<24|n[g>>>16&255]<<16|n[v>>>8&255]<<8|n[255&f])^t[m++],a=(n[g>>>24]<<24|n[v>>>16&255]<<16|n[f>>>8&255]<<8|n[255&p])^t[m++],c=(n[v>>>24]<<24|n[f>>>16&255]<<16|n[p>>>8&255]<<8|n[255&g])^t[m++],[o>>>=0,s>>>=0,a>>>=0,c>>>=0]}var a=[0,1,2,4,8,16,32,64,128,27,54],c=function(){for(var e=new Array(256),t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;for(var i=[],n=[],r=[[],[],[],[]],o=[[],[],[],[]],s=0,a=0,c=0;c<256;++c){var d=a^a<<1^a<<2^a<<3^a<<4;d=d>>>8^255&d^99,i[s]=d,n[d]=s;var l=e[s],u=e[l],h=e[u],f=257*e[d]^16843008*d;r[0][s]=f<<24|f>>>8,r[1][s]=f<<16|f>>>16,r[2][s]=f<<8|f>>>24,r[3][s]=f,f=16843009*h^65537*u^257*l^16843008*s,o[0][d]=f<<24|f>>>8,o[1][d]=f<<16|f>>>16,o[2][d]=f<<8|f>>>24,o[3][d]=f,0===s?s=a=1:(s=l^e[e[e[h^l]]],a^=e[e[a]])}return{SBOX:i,INV_SBOX:n,SUB_MIX:r,INV_SUB_MIX:o}}();function d(e){this._key=r(e),this._reset()}d.blockSize=16,d.keySize=32,d.prototype.blockSize=d.blockSize,d.prototype.keySize=d.keySize,d.prototype._reset=function(){for(var e=this._key,t=e.length,i=t+6,n=4*(i+1),r=[],o=0;o<t;o++)r[o]=e[o];for(o=t;o<n;o++){var s=r[o-1];o%t==0?(s=s<<8|s>>>24,s=c.SBOX[s>>>24]<<24|c.SBOX[s>>>16&255]<<16|c.SBOX[s>>>8&255]<<8|c.SBOX[255&s],s^=a[o/t|0]<<24):t>6&&o%t==4&&(s=c.SBOX[s>>>24]<<24|c.SBOX[s>>>16&255]<<16|c.SBOX[s>>>8&255]<<8|c.SBOX[255&s]),r[o]=r[o-t]^s}for(var d=[],l=0;l<n;l++){var u=n-l,h=r[u-(l%4?0:4)];d[l]=l<4||u<=4?h:c.INV_SUB_MIX[0][c.SBOX[h>>>24]]^c.INV_SUB_MIX[1][c.SBOX[h>>>16&255]]^c.INV_SUB_MIX[2][c.SBOX[h>>>8&255]]^c.INV_SUB_MIX[3][c.SBOX[255&h]]}this._nRounds=i,this._keySchedule=r,this._invKeySchedule=d},d.prototype.encryptBlockRaw=function(e){return s(e=r(e),this._keySchedule,c.SUB_MIX,c.SBOX,this._nRounds)},d.prototype.encryptBlock=function(e){var t=this.encryptBlockRaw(e),i=n.allocUnsafe(16);return i.writeUInt32BE(t[0],0),i.writeUInt32BE(t[1],4),i.writeUInt32BE(t[2],8),i.writeUInt32BE(t[3],12),i},d.prototype.decryptBlock=function(e){var t=(e=r(e))[1];e[1]=e[3],e[3]=t;var i=s(e,this._invKeySchedule,c.INV_SUB_MIX,c.INV_SBOX,this._nRounds),o=n.allocUnsafe(16);return o.writeUInt32BE(i[0],0),o.writeUInt32BE(i[3],4),o.writeUInt32BE(i[2],8),o.writeUInt32BE(i[1],12),o},d.prototype.scrub=function(){o(this._keySchedule),o(this._invKeySchedule),o(this._key)},t.exports.AES=d},{"safe-buffer":260}],22:[function(e,t,i){var n=e("./aes"),r=e("safe-buffer").Buffer,o=e("cipher-base"),s=e("inherits"),a=e("./ghash"),c=e("buffer-xor"),d=e("./incr32");function l(e,t,i,s){o.call(this);var c=r.alloc(4,0);this._cipher=new n.AES(t);var l=this._cipher.encryptBlock(c);this._ghash=new a(l),i=function(e,t,i){if(12===t.length)return e._finID=r.concat([t,r.from([0,0,0,1])]),r.concat([t,r.from([0,0,0,2])]);var n=new a(i),o=t.length,s=o%16;n.update(t),s&&(s=16-s,n.update(r.alloc(s,0))),n.update(r.alloc(8,0));var c=8*o,l=r.alloc(8);l.writeUIntBE(c,0,8),n.update(l),e._finID=n.state;var u=r.from(e._finID);return d(u),u}(this,i,l),this._prev=r.from(i),this._cache=r.allocUnsafe(0),this._secCache=r.allocUnsafe(0),this._decrypt=s,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}s(l,o),l.prototype._update=function(e){if(!this._called&&this._alen){var t=16-this._alen%16;t<16&&(t=r.alloc(t,0),this._ghash.update(t))}this._called=!0;var i=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(i),this._len+=e.length,i},l.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=c(this._ghash.final(8*this._alen,8*this._len),this._cipher.encryptBlock(this._finID));if(this._decrypt&&function(e,t){var i=0;e.length!==t.length&&i++;for(var n=Math.min(e.length,t.length),r=0;r<n;++r)i+=e[r]^t[r];return i}(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},l.prototype.getAuthTag=function(){if(this._decrypt||!r.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},l.prototype.setAuthTag=function(e){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=e},l.prototype.setAAD=function(e){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(e),this._alen+=e.length},t.exports=l},{"./aes":21,"./ghash":26,"./incr32":27,"buffer-xor":67,"cipher-base":71,inherits:151,"safe-buffer":260}],23:[function(e,t,i){var n=e("./encrypter"),r=e("./decrypter"),o=e("./modes/list.json");i.createCipher=i.Cipher=n.createCipher,i.createCipheriv=i.Cipheriv=n.createCipheriv,i.createDecipher=i.Decipher=r.createDecipher,i.createDecipheriv=i.Decipheriv=r.createDecipheriv,i.listCiphers=i.getCiphers=function(){return Object.keys(o)}},{"./decrypter":24,"./encrypter":25,"./modes/list.json":35}],24:[function(e,t,i){var n=e("./authCipher"),r=e("safe-buffer").Buffer,o=e("./modes"),s=e("./streamCipher"),a=e("cipher-base"),c=e("./aes"),d=e("evp_bytestokey");function l(e,t,i){a.call(this),this._cache=new u,this._last=void 0,this._cipher=new c.AES(t),this._prev=r.from(i),this._mode=e,this._autopadding=!0}function u(){this.cache=r.allocUnsafe(0)}function h(e,t,i){var a=o[e.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof i&&(i=r.from(i)),"GCM"!==a.mode&&i.length!==a.iv)throw new TypeError("invalid iv length "+i.length);if("string"==typeof t&&(t=r.from(t)),t.length!==a.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===a.type?new s(a.module,t,i,!0):"auth"===a.type?new n(a.module,t,i,!0):new l(a.module,t,i)}e("inherits")(l,a),l.prototype._update=function(e){var t,i;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)i=this._mode.decrypt(this,t),n.push(i);return r.concat(n)},l.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var i=-1;for(;++i<t;)if(e[i+(16-t)]!==t)throw new Error("unable to decrypt data");if(16===t)return;return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},l.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},u.prototype.add=function(e){this.cache=r.concat([this.cache,e])},u.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},u.prototype.flush=function(){if(this.cache.length)return this.cache},i.createDecipher=function(e,t){var i=o[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");var n=d(t,!1,i.key,i.iv);return h(e,n.key,n.iv)},i.createDecipheriv=h},{"./aes":21,"./authCipher":22,"./modes":34,"./streamCipher":37,"cipher-base":71,evp_bytestokey:110,inherits:151,"safe-buffer":260}],25:[function(e,t,i){var n=e("./modes"),r=e("./authCipher"),o=e("safe-buffer").Buffer,s=e("./streamCipher"),a=e("cipher-base"),c=e("./aes"),d=e("evp_bytestokey");function l(e,t,i){a.call(this),this._cache=new h,this._cipher=new c.AES(t),this._prev=o.from(i),this._mode=e,this._autopadding=!0}e("inherits")(l,a),l.prototype._update=function(e){var t,i;this._cache.add(e);for(var n=[];t=this._cache.get();)i=this._mode.encrypt(this,t),n.push(i);return o.concat(n)};var u=o.alloc(16,16);function h(){this.cache=o.allocUnsafe(0)}function f(e,t,i){var a=n[e.toLowerCase()];if(!a)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=o.from(t)),t.length!==a.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof i&&(i=o.from(i)),"GCM"!==a.mode&&i.length!==a.iv)throw new TypeError("invalid iv length "+i.length);return"stream"===a.type?new s(a.module,t,i):"auth"===a.type?new r(a.module,t,i):new l(a.module,t,i)}l.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(u))throw this._cipher.scrub(),new Error("data not multiple of block length")},l.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},h.prototype.add=function(e){this.cache=o.concat([this.cache,e])},h.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},h.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),i=-1;++i<e;)t.writeUInt8(e,i);return o.concat([this.cache,t])},i.createCipheriv=f,i.createCipher=function(e,t){var i=n[e.toLowerCase()];if(!i)throw new TypeError("invalid suite type");var r=d(t,!1,i.key,i.iv);return f(e,r.key,r.iv)}},{"./aes":21,"./authCipher":22,"./modes":34,"./streamCipher":37,"cipher-base":71,evp_bytestokey:110,inherits:151,"safe-buffer":260}],26:[function(e,t,i){var n=e("safe-buffer").Buffer,r=n.alloc(16,0);function o(e){var t=n.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function s(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}s.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},s.prototype._multiply=function(){for(var e,t,i,n=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],r=[0,0,0,0],s=-1;++s<128;){for(0!=(this.state[~~(s/8)]&1<<7-s%8)&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),i=0!=(1&n[3]),t=3;t>0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,i&&(n[0]=n[0]^225<<24)}this.state=o(r)},s.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},s.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,r],16)),this.ghash(o([0,e,0,t])),this.state},t.exports=s},{"safe-buffer":260}],27:[function(e,t,i){t.exports=function(e){for(var t,i=e.length;i--;){if(255!==(t=e.readUInt8(i))){t++,e.writeUInt8(t,i);break}e.writeUInt8(0,i)}}},{}],28:[function(e,t,i){var n=e("buffer-xor");i.encrypt=function(e,t){var i=n(t,e._prev);return e._prev=e._cipher.encryptBlock(i),e._prev},i.decrypt=function(e,t){var i=e._prev;e._prev=t;var r=e._cipher.decryptBlock(t);return n(r,i)}},{"buffer-xor":67}],29:[function(e,t,i){var n=e("safe-buffer").Buffer,r=e("buffer-xor");function o(e,t,i){var o=t.length,s=r(t,e._cache);return e._cache=e._cache.slice(o),e._prev=n.concat([e._prev,i?t:s]),s}i.encrypt=function(e,t,i){for(var r,s=n.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=n.allocUnsafe(0)),!(e._cache.length<=t.length)){s=n.concat([s,o(e,t,i)]);break}r=e._cache.length,s=n.concat([s,o(e,t.slice(0,r),i)]),t=t.slice(r)}return s}},{"buffer-xor":67,"safe-buffer":260}],30:[function(e,t,i){var n=e("safe-buffer").Buffer;function r(e,t,i){for(var n,r,s=-1,a=0;++s<8;)n=t&1<<7-s?128:0,a+=(128&(r=e._cipher.encryptBlock(e._prev)[0]^n))>>s%8,e._prev=o(e._prev,i?n:r);return a}function o(e,t){var i=e.length,r=-1,o=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++r<i;)o[r]=e[r]<<1|e[r+1]>>7;return o}i.encrypt=function(e,t,i){for(var o=t.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=r(e,t[a],i);return s}},{"safe-buffer":260}],31:[function(e,t,i){var n=e("safe-buffer").Buffer;function r(e,t,i){var r=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=n.concat([e._prev.slice(1),n.from([i?t:r])]),r}i.encrypt=function(e,t,i){for(var o=t.length,s=n.allocUnsafe(o),a=-1;++a<o;)s[a]=r(e,t[a],i);return s}},{"safe-buffer":260}],32:[function(e,t,i){var n=e("buffer-xor"),r=e("safe-buffer").Buffer,o=e("../incr32");function s(e){var t=e._cipher.encryptBlockRaw(e._prev);return o(e._prev),t}i.encrypt=function(e,t){var i=Math.ceil(t.length/16),o=e._cache.length;e._cache=r.concat([e._cache,r.allocUnsafe(16*i)]);for(var a=0;a<i;a++){var c=s(e),d=o+16*a;e._cache.writeUInt32BE(c[0],d+0),e._cache.writeUInt32BE(c[1],d+4),e._cache.writeUInt32BE(c[2],d+8),e._cache.writeUInt32BE(c[3],d+12)}var l=e._cache.slice(0,t.length);return e._cache=e._cache.slice(t.length),n(t,l)}},{"../incr32":27,"buffer-xor":67,"safe-buffer":260}],33:[function(e,t,i){i.encrypt=function(e,t){return e._cipher.encryptBlock(t)},i.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},{}],34:[function(e,t,i){var n={ECB:e("./ecb"),CBC:e("./cbc"),CFB:e("./cfb"),CFB8:e("./cfb8"),CFB1:e("./cfb1"),OFB:e("./ofb"),CTR:e("./ctr"),GCM:e("./ctr")},r=e("./list.json");for(var o in r)r[o].module=n[r[o].mode];t.exports=r},{"./cbc":28,"./cfb":29,"./cfb1":30,"./cfb8":31,"./ctr":32,"./ecb":33,"./list.json":35,"./ofb":36}],35:[function(e,t,i){t.exports={"aes-128-ecb":{cipher:"AES",key:128,iv:0,mode:"ECB",type:"block"},"aes-192-ecb":{cipher:"AES",key:192,iv:0,mode:"ECB",type:"block"},"aes-256-ecb":{cipher:"AES",key:256,iv:0,mode:"ECB",type:"block"},"aes-128-cbc":{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},"aes-192-cbc":{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},"aes-256-cbc":{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},aes128:{cipher:"AES",key:128,iv:16,mode:"CBC",type:"block"},aes192:{cipher:"AES",key:192,iv:16,mode:"CBC",type:"block"},aes256:{cipher:"AES",key:256,iv:16,mode:"CBC",type:"block"},"aes-128-cfb":{cipher:"AES",key:128,iv:16,mode:"CFB",type:"stream"},"aes-192-cfb":{cipher:"AES",key:192,iv:16,mode:"CFB",type:"stream"},"aes-256-cfb":{cipher:"AES",key:256,iv:16,mode:"CFB",type:"stream"},"aes-128-cfb8":{cipher:"AES",key:128,iv:16,mode:"CFB8",type:"stream"},"aes-192-cfb8":{cipher:"AES",key:192,iv:16,mode:"CFB8",type:"stream"},"aes-256-cfb8":{cipher:"AES",key:256,iv:16,mode:"CFB8",type:"stream"},"aes-128-cfb1":{cipher:"AES",key:128,iv:16,mode:"CFB1",type:"stream"},"aes-192-cfb1":{cipher:"AES",key:192,iv:16,mode:"CFB1",type:"stream"},"aes-256-cfb1":{cipher:"AES",key:256,iv:16,mode:"CFB1",type:"stream"},"aes-128-ofb":{cipher:"AES",key:128,iv:16,mode:"OFB",type:"stream"},"aes-192-ofb":{cipher:"AES",key:192,iv:16,mode:"OFB",type:"stream"},"aes-256-ofb":{cipher:"AES",key:256,iv:16,mode:"OFB",type:"stream"},"aes-128-ctr":{cipher:"AES",key:128,iv:16,mode:"CTR",type:"stream"},"aes-192-ctr":{cipher:"AES",key:192,iv:16,mode:"CTR",type:"stream"},"aes-256-ctr":{cipher:"AES",key:256,iv:16,mode:"CTR",type:"stream"},"aes-128-gcm":{cipher:"AES",key:128,iv:12,mode:"GCM",type:"auth"},"aes-192-gcm":{cipher:"AES",key:192,iv:12,mode:"GCM",type:"auth"},"aes-256-gcm":{cipher:"AES",key:256,iv:12,mode:"GCM",type:"auth"}}},{}],36:[function(e,t,i){(function(t){(function(){var n=e("buffer-xor");function r(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}i.encrypt=function(e,i){for(;e._cache.length<i.length;)e._cache=t.concat([e._cache,r(e)]);var o=e._cache.slice(0,i.length);return e._cache=e._cache.slice(i.length),n(i,o)}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:68,"buffer-xor":67}],37:[function(e,t,i){var n=e("./aes"),r=e("safe-buffer").Buffer,o=e("cipher-base");function s(e,t,i,s){o.call(this),this._cipher=new n.AES(t),this._prev=r.from(i),this._cache=r.allocUnsafe(0),this._secCache=r.allocUnsafe(0),this._decrypt=s,this._mode=e}e("inherits")(s,o),s.prototype._update=function(e){return this._mode.encrypt(this,e,this._decrypt)},s.prototype._final=function(){this._cipher.scrub()},t.exports=s},{"./aes":21,"cipher-base":71,inherits:151,"safe-buffer":260}],38:[function(e,t,i){var n=e("browserify-des"),r=e("browserify-aes/browser"),o=e("browserify-aes/modes"),s=e("browserify-des/modes"),a=e("evp_bytestokey");function c(e,t,i){if(e=e.toLowerCase(),o[e])return r.createCipheriv(e,t,i);if(s[e])return new n({key:t,iv:i,mode:e});throw new TypeError("invalid suite type")}function d(e,t,i){if(e=e.toLowerCase(),o[e])return r.createDecipheriv(e,t,i);if(s[e])return new n({key:t,iv:i,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}i.createCipher=i.Cipher=function(e,t){var i,n;if(e=e.toLowerCase(),o[e])i=o[e].key,n=o[e].iv;else{if(!s[e])throw new TypeError("invalid suite type");i=8*s[e].key,n=s[e].iv}var r=a(t,!1,i,n);return c(e,r.key,r.iv)},i.createCipheriv=i.Cipheriv=c,i.createDecipher=i.Decipher=function(e,t){var i,n;if(e=e.toLowerCase(),o[e])i=o[e].key,n=o[e].iv;else{if(!s[e])throw new TypeError("invalid suite type");i=8*s[e].key,n=s[e].iv}var r=a(t,!1,i,n);return d(e,r.key,r.iv)},i.createDecipheriv=i.Decipheriv=d,i.listCiphers=i.getCiphers=function(){return Object.keys(s).concat(r.getCiphers())}},{"browserify-aes/browser":23,"browserify-aes/modes":34,"browserify-des":39,"browserify-des/modes":40,evp_bytestokey:110}],39:[function(e,t,i){var n=e("cipher-base"),r=e("des.js"),o=e("inherits"),s=e("safe-buffer").Buffer,a={"des-ede3-cbc":r.CBC.instantiate(r.EDE),"des-ede3":r.EDE,"des-ede-cbc":r.CBC.instantiate(r.EDE),"des-ede":r.EDE,"des-cbc":r.CBC.instantiate(r.DES),"des-ecb":r.DES};function c(e){n.call(this);var t,i=e.mode.toLowerCase(),r=a[i];t=e.decrypt?"decrypt":"encrypt";var o=e.key;s.isBuffer(o)||(o=s.from(o)),"des-ede"!==i&&"des-ede-cbc"!==i||(o=s.concat([o,o.slice(0,8)]));var c=e.iv;s.isBuffer(c)||(c=s.from(c)),this._des=r.create({key:o,iv:c,type:t})}a.des=a["des-cbc"],a.des3=a["des-ede3-cbc"],t.exports=c,o(c,n),c.prototype._update=function(e){return s.from(this._des.update(e))},c.prototype._final=function(){return s.from(this._des.final())}},{"cipher-base":71,"des.js":83,inherits:151,"safe-buffer":260}],40:[function(e,t,i){i["des-ecb"]={key:8,iv:0},i["des-cbc"]=i.des={key:8,iv:8},i["des-ede3-cbc"]=i.des3={key:24,iv:8},i["des-ede3"]={key:24,iv:0},i["des-ede-cbc"]={key:16,iv:8},i["des-ede"]={key:16,iv:0}},{}],41:[function(e,t,i){(function(i){(function(){var n=e("bn.js"),r=e("randombytes");function o(e){var t,i=e.modulus.byteLength();do{t=new n(r(i))}while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function s(e,t){var r=function(e){var t=o(e);return{blinder:t.toRed(n.mont(e.modulus)).redPow(new n(e.publicExponent)).fromRed(),unblinder:t.invm(e.modulus)}}(t),s=t.modulus.byteLength(),a=new n(e).mul(r.blinder).umod(t.modulus),c=a.toRed(n.mont(t.prime1)),d=a.toRed(n.mont(t.prime2)),l=t.coefficient,u=t.prime1,h=t.prime2,f=c.redPow(t.exponent1).fromRed(),p=d.redPow(t.exponent2).fromRed(),g=f.isub(p).imul(l).umod(u).imul(h);return p.iadd(g).imul(r.unblinder).umod(t.modulus).toArrayLike(i,"be",s)}s.getr=o,t.exports=s}).call(this)}).call(this,e("buffer").Buffer)},{"bn.js":42,buffer:68,randombytes:254}],42:[function(e,t,i){!function(t,i){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}function o(e,t,i){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(i=t,t=10),this._init(e||0,t||10,i||"be"))}var s;"object"==typeof t?t.exports=o:i.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:e("buffer").Buffer}catch(e){}function a(e,t){var i=e.charCodeAt(t);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void n(!1,"Invalid character in "+e)}function c(e,t,i){var n=a(e,i);return i-1>=t&&(n|=a(e,i-1)<<4),n}function d(e,t,i,r){for(var o=0,s=0,a=Math.min(e.length,i),c=t;c<a;c++){var d=e.charCodeAt(c)-48;o*=r,s=d>=49?d-49+10:d>=17?d-17+10:d,n(d>=0&&s<r,"Invalid character"),o+=s}return o}function l(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var r=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(r++,this.negative=1),r<e.length&&(16===t?this._parseHex(e,r,i):(this._parseBase(e,t,r),"le"===i&&this._initArray(this.toArray(),t,i)))},o.prototype._initNumber=function(e,t,i){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===i&&this._initArray(this.toArray(),t,i)},o.prototype._initArray=function(e,t,i){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var o,s,a=0;if("be"===i)for(r=e.length-1,o=0;r>=0;r-=3)s=e[r]|e[r-1]<<8|e[r-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===i)for(r=0,o=0;r<e.length;r+=3)s=e[r]|e[r+1]<<8|e[r+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,i){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var r,o=0,s=0;if("be"===i)for(n=e.length-1;n>=t;n-=2)r=c(e,t,n)<<o,this.words[s]|=67108863&r,o>=18?(o-=18,s+=1,this.words[s]|=r>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)r=c(e,t,n)<<o,this.words[s]|=67108863&r,o>=18?(o-=18,s+=1,this.words[s]|=r>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,i){this.words=[0],this.length=1;for(var n=0,r=1;r<=67108863;r*=t)n++;n--,r=r/t|0;for(var o=e.length-i,s=o%n,a=Math.min(o,o-s)+i,c=0,l=i;l<a;l+=n)c=d(e,l,l+n,t),this.imuln(r),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var u=1;for(c=d(e,l,e.length,t),l=0;l<s;l++)u*=t;this.imuln(u),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){l(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch(e){o.prototype.inspect=u}else o.prototype.inspect=u;function u(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var i;if(t=0|t||1,16===(e=e||10)||"hex"===e){i="";for(var r=0,o=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<r|o)).toString(16);o=a>>>24-r&16777215,(r+=2)>=26&&(r-=26,s--),i=0!==o||s!==this.length-1?h[6-c.length]+c+i:c+i}for(0!==o&&(i=o.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var d=f[e],l=p[e];i="";var u=this.clone();for(u.negative=0;!u.isZero();){var g=u.modrn(l).toString(e);i=(u=u.idivn(l)).isZero()?g+i:h[d-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},s&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(s,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function g(e,t,i){i.negative=t.negative^e.negative;var n=e.length+t.length|0;i.length=n,n=n-1|0;var r=0|e.words[0],o=0|t.words[0],s=r*o,a=67108863&s,c=s/67108864|0;i.words[0]=a;for(var d=1;d<n;d++){for(var l=c>>>26,u=67108863&c,h=Math.min(d,t.length-1),f=Math.max(0,d-e.length+1);f<=h;f++){var p=d-f|0;l+=(s=(r=0|e.words[p])*(o=0|t.words[f])+u)/67108864|0,u=67108863&s}i.words[d]=0|u,c=0|l}return 0!==c?i.words[d]=0|c:i.length--,i._strip()}o.prototype.toArrayLike=function(e,t,i){this._strip();var r=this.byteLength(),o=i||Math.max(1,r);n(r<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,r),s},o.prototype._toArrayLikeLE=function(e,t){for(var i=0,n=0,r=0,o=0;r<this.length;r++){var s=this.words[r]<<o|n;e[i++]=255&s,i<e.length&&(e[i++]=s>>8&255),i<e.length&&(e[i++]=s>>16&255),6===o?(i<e.length&&(e[i++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(i<e.length)for(e[i++]=n;i<e.length;)e[i++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var i=e.length-1,n=0,r=0,o=0;r<this.length;r++){var s=this.words[r]<<o|n;e[i--]=255&s,i>=0&&(e[i--]=s>>8&255),i>=0&&(e[i--]=s>>16&255),6===o?(i>=0&&(e[i--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(i>=0)for(e[i--]=n;i>=0;)e[i--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,i=0;return t>=4096&&(i+=13,t>>>=13),t>=64&&(i+=7,t>>>=7),t>=8&&(i+=4,t>>>=4),t>=2&&(i+=2,t>>>=2),i+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,i=0;return 0==(8191&t)&&(i+=13,t>>>=13),0==(127&t)&&(i+=7,t>>>=7),0==(15&t)&&(i+=4,t>>>=4),0==(3&t)&&(i+=2,t>>>=2),0==(1&t)&&i++,i},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var i=this._zeroBits(this.words[t]);if(e+=i,26!==i)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var i=0;i<t.length;i++)this.words[i]=this.words[i]&e.words[i];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,i;this.length>e.length?(t=this,i=e):(t=e,i=this);for(var n=0;n<i.length;n++)this.words[n]=t.words[n]^i.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var r=0;r<t;r++)this.words[r]=67108863&~this.words[r];return i>0&&(this.words[r]=~this.words[r]&67108863>>26-i),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var i=e/26|0,r=e%26;return this._expand(i+1),this.words[i]=t?this.words[i]|1<<r:this.words[i]&~(1<<r),this._strip()},o.prototype.iadd=function(e){var t,i,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(i=this,n=e):(i=e,n=this);for(var r=0,o=0;o<n.length;o++)t=(0|i.words[o])+(0|n.words[o])+r,this.words[o]=67108863&t,r=t>>>26;for(;0!==r&&o<i.length;o++)t=(0|i.words[o])+r,this.words[o]=67108863&t,r=t>>>26;if(this.length=i.length,0!==r)this.words[this.length]=r,this.length++;else if(i!==this)for(;o<i.length;o++)this.words[o]=i.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i,n,r=this.cmp(e);if(0===r)return this.negative=0,this.length=1,this.words[0]=0,this;r>0?(i=this,n=e):(i=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|i.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<i.length;s++)o=(t=(0|i.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<i.length&&i!==this)for(;s<i.length;s++)this.words[s]=i.words[s];return this.length=Math.max(this.length,s),i!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var v=function(e,t,i){var n,r,o,s=e.words,a=t.words,c=i.words,d=0,l=0|s[0],u=8191&l,h=l>>>13,f=0|s[1],p=8191&f,g=f>>>13,v=0|s[2],m=8191&v,y=v>>>13,b=0|s[3],_=8191&b,S=b>>>13,E=0|s[4],w=8191&E,T=E>>>13,I=0|s[5],R=8191&I,k=I>>>13,M=0|s[6],C=8191&M,O=M>>>13,A=0|s[7],P=8191&A,D=A>>>13,x=0|s[8],L=8191&x,U=x>>>13,N=0|s[9],B=8191&N,j=N>>>13,F=0|a[0],K=8191&F,q=F>>>13,$=0|a[1],V=8191&$,H=$>>>13,W=0|a[2],G=8191&W,z=W>>>13,Y=0|a[3],J=8191&Y,Q=Y>>>13,X=0|a[4],Z=8191&X,ee=X>>>13,te=0|a[5],ie=8191&te,ne=te>>>13,re=0|a[6],oe=8191&re,se=re>>>13,ae=0|a[7],ce=8191&ae,de=ae>>>13,le=0|a[8],ue=8191&le,he=le>>>13,fe=0|a[9],pe=8191&fe,ge=fe>>>13;i.negative=e.negative^t.negative,i.length=19;var ve=(d+(n=Math.imul(u,K))|0)+((8191&(r=(r=Math.imul(u,q))+Math.imul(h,K)|0))<<13)|0;d=((o=Math.imul(h,q))+(r>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(p,K),r=(r=Math.imul(p,q))+Math.imul(g,K)|0,o=Math.imul(g,q);var me=(d+(n=n+Math.imul(u,V)|0)|0)+((8191&(r=(r=r+Math.imul(u,H)|0)+Math.imul(h,V)|0))<<13)|0;d=((o=o+Math.imul(h,H)|0)+(r>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,K),r=(r=Math.imul(m,q))+Math.imul(y,K)|0,o=Math.imul(y,q),n=n+Math.imul(p,V)|0,r=(r=r+Math.imul(p,H)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,H)|0;var ye=(d+(n=n+Math.imul(u,G)|0)|0)+((8191&(r=(r=r+Math.imul(u,z)|0)+Math.imul(h,G)|0))<<13)|0;d=((o=o+Math.imul(h,z)|0)+(r>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(_,K),r=(r=Math.imul(_,q))+Math.imul(S,K)|0,o=Math.imul(S,q),n=n+Math.imul(m,V)|0,r=(r=r+Math.imul(m,H)|0)+Math.imul(y,V)|0,o=o+Math.imul(y,H)|0,n=n+Math.imul(p,G)|0,r=(r=r+Math.imul(p,z)|0)+Math.imul(g,G)|0,o=o+Math.imul(g,z)|0;var be=(d+(n=n+Math.imul(u,J)|0)|0)+((8191&(r=(r=r+Math.imul(u,Q)|0)+Math.imul(h,J)|0))<<13)|0;d=((o=o+Math.imul(h,Q)|0)+(r>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,K),r=(r=Math.imul(w,q))+Math.imul(T,K)|0,o=Math.imul(T,q),n=n+Math.imul(_,V)|0,r=(r=r+Math.imul(_,H)|0)+Math.imul(S,V)|0,o=o+Math.imul(S,H)|0,n=n+Math.imul(m,G)|0,r=(r=r+Math.imul(m,z)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,z)|0,n=n+Math.imul(p,J)|0,r=(r=r+Math.imul(p,Q)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,Q)|0;var _e=(d+(n=n+Math.imul(u,Z)|0)|0)+((8191&(r=(r=r+Math.imul(u,ee)|0)+Math.imul(h,Z)|0))<<13)|0;d=((o=o+Math.imul(h,ee)|0)+(r>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(R,K),r=(r=Math.imul(R,q))+Math.imul(k,K)|0,o=Math.imul(k,q),n=n+Math.imul(w,V)|0,r=(r=r+Math.imul(w,H)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,H)|0,n=n+Math.imul(_,G)|0,r=(r=r+Math.imul(_,z)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,z)|0,n=n+Math.imul(m,J)|0,r=(r=r+Math.imul(m,Q)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,Q)|0,n=n+Math.imul(p,Z)|0,r=(r=r+Math.imul(p,ee)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,ee)|0;var Se=(d+(n=n+Math.imul(u,ie)|0)|0)+((8191&(r=(r=r+Math.imul(u,ne)|0)+Math.imul(h,ie)|0))<<13)|0;d=((o=o+Math.imul(h,ne)|0)+(r>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(C,K),r=(r=Math.imul(C,q))+Math.imul(O,K)|0,o=Math.imul(O,q),n=n+Math.imul(R,V)|0,r=(r=r+Math.imul(R,H)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,H)|0,n=n+Math.imul(w,G)|0,r=(r=r+Math.imul(w,z)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,z)|0,n=n+Math.imul(_,J)|0,r=(r=r+Math.imul(_,Q)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,Q)|0,n=n+Math.imul(m,Z)|0,r=(r=r+Math.imul(m,ee)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,ee)|0,n=n+Math.imul(p,ie)|0,r=(r=r+Math.imul(p,ne)|0)+Math.imul(g,ie)|0,o=o+Math.imul(g,ne)|0;var Ee=(d+(n=n+Math.imul(u,oe)|0)|0)+((8191&(r=(r=r+Math.imul(u,se)|0)+Math.imul(h,oe)|0))<<13)|0;d=((o=o+Math.imul(h,se)|0)+(r>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(P,K),r=(r=Math.imul(P,q))+Math.imul(D,K)|0,o=Math.imul(D,q),n=n+Math.imul(C,V)|0,r=(r=r+Math.imul(C,H)|0)+Math.imul(O,V)|0,o=o+Math.imul(O,H)|0,n=n+Math.imul(R,G)|0,r=(r=r+Math.imul(R,z)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,z)|0,n=n+Math.imul(w,J)|0,r=(r=r+Math.imul(w,Q)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,Q)|0,n=n+Math.imul(_,Z)|0,r=(r=r+Math.imul(_,ee)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(m,ie)|0,r=(r=r+Math.imul(m,ne)|0)+Math.imul(y,ie)|0,o=o+Math.imul(y,ne)|0,n=n+Math.imul(p,oe)|0,r=(r=r+Math.imul(p,se)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,se)|0;var we=(d+(n=n+Math.imul(u,ce)|0)|0)+((8191&(r=(r=r+Math.imul(u,de)|0)+Math.imul(h,ce)|0))<<13)|0;d=((o=o+Math.imul(h,de)|0)+(r>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(L,K),r=(r=Math.imul(L,q))+Math.imul(U,K)|0,o=Math.imul(U,q),n=n+Math.imul(P,V)|0,r=(r=r+Math.imul(P,H)|0)+Math.imul(D,V)|0,o=o+Math.imul(D,H)|0,n=n+Math.imul(C,G)|0,r=(r=r+Math.imul(C,z)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,z)|0,n=n+Math.imul(R,J)|0,r=(r=r+Math.imul(R,Q)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,Q)|0,n=n+Math.imul(w,Z)|0,r=(r=r+Math.imul(w,ee)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(_,ie)|0,r=(r=r+Math.imul(_,ne)|0)+Math.imul(S,ie)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(m,oe)|0,r=(r=r+Math.imul(m,se)|0)+Math.imul(y,oe)|0,o=o+Math.imul(y,se)|0,n=n+Math.imul(p,ce)|0,r=(r=r+Math.imul(p,de)|0)+Math.imul(g,ce)|0,o=o+Math.imul(g,de)|0;var Te=(d+(n=n+Math.imul(u,ue)|0)|0)+((8191&(r=(r=r+Math.imul(u,he)|0)+Math.imul(h,ue)|0))<<13)|0;d=((o=o+Math.imul(h,he)|0)+(r>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,K),r=(r=Math.imul(B,q))+Math.imul(j,K)|0,o=Math.imul(j,q),n=n+Math.imul(L,V)|0,r=(r=r+Math.imul(L,H)|0)+Math.imul(U,V)|0,o=o+Math.imul(U,H)|0,n=n+Math.imul(P,G)|0,r=(r=r+Math.imul(P,z)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,z)|0,n=n+Math.imul(C,J)|0,r=(r=r+Math.imul(C,Q)|0)+Math.imul(O,J)|0,o=o+Math.imul(O,Q)|0,n=n+Math.imul(R,Z)|0,r=(r=r+Math.imul(R,ee)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(w,ie)|0,r=(r=r+Math.imul(w,ne)|0)+Math.imul(T,ie)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(_,oe)|0,r=(r=r+Math.imul(_,se)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,se)|0,n=n+Math.imul(m,ce)|0,r=(r=r+Math.imul(m,de)|0)+Math.imul(y,ce)|0,o=o+Math.imul(y,de)|0,n=n+Math.imul(p,ue)|0,r=(r=r+Math.imul(p,he)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,he)|0;var Ie=(d+(n=n+Math.imul(u,pe)|0)|0)+((8191&(r=(r=r+Math.imul(u,ge)|0)+Math.imul(h,pe)|0))<<13)|0;d=((o=o+Math.imul(h,ge)|0)+(r>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(B,V),r=(r=Math.imul(B,H))+Math.imul(j,V)|0,o=Math.imul(j,H),n=n+Math.imul(L,G)|0,r=(r=r+Math.imul(L,z)|0)+Math.imul(U,G)|0,o=o+Math.imul(U,z)|0,n=n+Math.imul(P,J)|0,r=(r=r+Math.imul(P,Q)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,Q)|0,n=n+Math.imul(C,Z)|0,r=(r=r+Math.imul(C,ee)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(R,ie)|0,r=(r=r+Math.imul(R,ne)|0)+Math.imul(k,ie)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(w,oe)|0,r=(r=r+Math.imul(w,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(_,ce)|0,r=(r=r+Math.imul(_,de)|0)+Math.imul(S,ce)|0,o=o+Math.imul(S,de)|0,n=n+Math.imul(m,ue)|0,r=(r=r+Math.imul(m,he)|0)+Math.imul(y,ue)|0,o=o+Math.imul(y,he)|0;var Re=(d+(n=n+Math.imul(p,pe)|0)|0)+((8191&(r=(r=r+Math.imul(p,ge)|0)+Math.imul(g,pe)|0))<<13)|0;d=((o=o+Math.imul(g,ge)|0)+(r>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(B,G),r=(r=Math.imul(B,z))+Math.imul(j,G)|0,o=Math.imul(j,z),n=n+Math.imul(L,J)|0,r=(r=r+Math.imul(L,Q)|0)+Math.imul(U,J)|0,o=o+Math.imul(U,Q)|0,n=n+Math.imul(P,Z)|0,r=(r=r+Math.imul(P,ee)|0)+Math.imul(D,Z)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(C,ie)|0,r=(r=r+Math.imul(C,ne)|0)+Math.imul(O,ie)|0,o=o+Math.imul(O,ne)|0,n=n+Math.imul(R,oe)|0,r=(r=r+Math.imul(R,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(w,ce)|0,r=(r=r+Math.imul(w,de)|0)+Math.imul(T,ce)|0,o=o+Math.imul(T,de)|0,n=n+Math.imul(_,ue)|0,r=(r=r+Math.imul(_,he)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,he)|0;var ke=(d+(n=n+Math.imul(m,pe)|0)|0)+((8191&(r=(r=r+Math.imul(m,ge)|0)+Math.imul(y,pe)|0))<<13)|0;d=((o=o+Math.imul(y,ge)|0)+(r>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(B,J),r=(r=Math.imul(B,Q))+Math.imul(j,J)|0,o=Math.imul(j,Q),n=n+Math.imul(L,Z)|0,r=(r=r+Math.imul(L,ee)|0)+Math.imul(U,Z)|0,o=o+Math.imul(U,ee)|0,n=n+Math.imul(P,ie)|0,r=(r=r+Math.imul(P,ne)|0)+Math.imul(D,ie)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(C,oe)|0,r=(r=r+Math.imul(C,se)|0)+Math.imul(O,oe)|0,o=o+Math.imul(O,se)|0,n=n+Math.imul(R,ce)|0,r=(r=r+Math.imul(R,de)|0)+Math.imul(k,ce)|0,o=o+Math.imul(k,de)|0,n=n+Math.imul(w,ue)|0,r=(r=r+Math.imul(w,he)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,he)|0;var Me=(d+(n=n+Math.imul(_,pe)|0)|0)+((8191&(r=(r=r+Math.imul(_,ge)|0)+Math.imul(S,pe)|0))<<13)|0;d=((o=o+Math.imul(S,ge)|0)+(r>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(B,Z),r=(r=Math.imul(B,ee))+Math.imul(j,Z)|0,o=Math.imul(j,ee),n=n+Math.imul(L,ie)|0,r=(r=r+Math.imul(L,ne)|0)+Math.imul(U,ie)|0,o=o+Math.imul(U,ne)|0,n=n+Math.imul(P,oe)|0,r=(r=r+Math.imul(P,se)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,se)|0,n=n+Math.imul(C,ce)|0,r=(r=r+Math.imul(C,de)|0)+Math.imul(O,ce)|0,o=o+Math.imul(O,de)|0,n=n+Math.imul(R,ue)|0,r=(r=r+Math.imul(R,he)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,he)|0;var Ce=(d+(n=n+Math.imul(w,pe)|0)|0)+((8191&(r=(r=r+Math.imul(w,ge)|0)+Math.imul(T,pe)|0))<<13)|0;d=((o=o+Math.imul(T,ge)|0)+(r>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(B,ie),r=(r=Math.imul(B,ne))+Math.imul(j,ie)|0,o=Math.imul(j,ne),n=n+Math.imul(L,oe)|0,r=(r=r+Math.imul(L,se)|0)+Math.imul(U,oe)|0,o=o+Math.imul(U,se)|0,n=n+Math.imul(P,ce)|0,r=(r=r+Math.imul(P,de)|0)+Math.imul(D,ce)|0,o=o+Math.imul(D,de)|0,n=n+Math.imul(C,ue)|0,r=(r=r+Math.imul(C,he)|0)+Math.imul(O,ue)|0,o=o+Math.imul(O,he)|0;var Oe=(d+(n=n+Math.imul(R,pe)|0)|0)+((8191&(r=(r=r+Math.imul(R,ge)|0)+Math.imul(k,pe)|0))<<13)|0;d=((o=o+Math.imul(k,ge)|0)+(r>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(B,oe),r=(r=Math.imul(B,se))+Math.imul(j,oe)|0,o=Math.imul(j,se),n=n+Math.imul(L,ce)|0,r=(r=r+Math.imul(L,de)|0)+Math.imul(U,ce)|0,o=o+Math.imul(U,de)|0,n=n+Math.imul(P,ue)|0,r=(r=r+Math.imul(P,he)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,he)|0;var Ae=(d+(n=n+Math.imul(C,pe)|0)|0)+((8191&(r=(r=r+Math.imul(C,ge)|0)+Math.imul(O,pe)|0))<<13)|0;d=((o=o+Math.imul(O,ge)|0)+(r>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(B,ce),r=(r=Math.imul(B,de))+Math.imul(j,ce)|0,o=Math.imul(j,de),n=n+Math.imul(L,ue)|0,r=(r=r+Math.imul(L,he)|0)+Math.imul(U,ue)|0,o=o+Math.imul(U,he)|0;var Pe=(d+(n=n+Math.imul(P,pe)|0)|0)+((8191&(r=(r=r+Math.imul(P,ge)|0)+Math.imul(D,pe)|0))<<13)|0;d=((o=o+Math.imul(D,ge)|0)+(r>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(B,ue),r=(r=Math.imul(B,he))+Math.imul(j,ue)|0,o=Math.imul(j,he);var De=(d+(n=n+Math.imul(L,pe)|0)|0)+((8191&(r=(r=r+Math.imul(L,ge)|0)+Math.imul(U,pe)|0))<<13)|0;d=((o=o+Math.imul(U,ge)|0)+(r>>>13)|0)+(De>>>26)|0,De&=67108863;var xe=(d+(n=Math.imul(B,pe))|0)+((8191&(r=(r=Math.imul(B,ge))+Math.imul(j,pe)|0))<<13)|0;return d=((o=Math.imul(j,ge))+(r>>>13)|0)+(xe>>>26)|0,xe&=67108863,c[0]=ve,c[1]=me,c[2]=ye,c[3]=be,c[4]=_e,c[5]=Se,c[6]=Ee,c[7]=we,c[8]=Te,c[9]=Ie,c[10]=Re,c[11]=ke,c[12]=Me,c[13]=Ce,c[14]=Oe,c[15]=Ae,c[16]=Pe,c[17]=De,c[18]=xe,0!==d&&(c[19]=d,i.length++),i};function m(e,t,i){i.negative=t.negative^e.negative,i.length=e.length+t.length;for(var n=0,r=0,o=0;o<i.length-1;o++){var s=r;r=0;for(var a=67108863&n,c=Math.min(o,t.length-1),d=Math.max(0,o-e.length+1);d<=c;d++){var l=o-d,u=(0|e.words[l])*(0|t.words[d]),h=67108863&u;a=67108863&(h=h+a|0),r+=(s=(s=s+(u/67108864|0)|0)+(h>>>26)|0)>>>26,s&=67108863}i.words[o]=a,n=s,s=r}return 0!==n?i.words[o]=n:i.length--,i._strip()}function y(e,t,i){return m(e,t,i)}function b(e,t){this.x=e,this.y=t}Math.imul||(v=g),o.prototype.mulTo=function(e,t){var i=this.length+e.length;return 10===this.length&&10===e.length?v(this,e,t):i<63?g(this,e,t):i<1024?m(this,e,t):y(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),i=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,i,e);return t},b.prototype.revBin=function(e,t,i){if(0===e||e===i-1)return e;for(var n=0,r=0;r<t;r++)n|=(1&e)<<t-r-1,e>>=1;return n},b.prototype.permute=function(e,t,i,n,r,o){for(var s=0;s<o;s++)n[s]=t[e[s]],r[s]=i[e[s]]},b.prototype.transform=function(e,t,i,n,r,o){this.permute(o,e,t,i,n,r);for(var s=1;s<r;s<<=1)for(var a=s<<1,c=Math.cos(2*Math.PI/a),d=Math.sin(2*Math.PI/a),l=0;l<r;l+=a)for(var u=c,h=d,f=0;f<s;f++){var p=i[l+f],g=n[l+f],v=i[l+f+s],m=n[l+f+s],y=u*v-h*m;m=u*m+h*v,v=y,i[l+f]=p+v,n[l+f]=g+m,i[l+f+s]=p-v,n[l+f+s]=g-m,f!==a&&(y=c*u-d*h,h=c*h+d*u,u=y)}},b.prototype.guessLen13b=function(e,t){var i=1|Math.max(t,e),n=1&i,r=0;for(i=i/2|0;i;i>>>=1)r++;return 1<<r+1+n},b.prototype.conjugate=function(e,t,i){if(!(i<=1))for(var n=0;n<i/2;n++){var r=e[n];e[n]=e[i-n-1],e[i-n-1]=r,r=t[n],t[n]=-t[i-n-1],t[i-n-1]=-r}},b.prototype.normalize13b=function(e,t){for(var i=0,n=0;n<t/2;n++){var r=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+i;e[n]=67108863&r,i=r<67108864?0:r/67108864|0}return e},b.prototype.convert13b=function(e,t,i,r){for(var o=0,s=0;s<t;s++)o+=0|e[s],i[2*s]=8191&o,o>>>=13,i[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<r;++s)i[s]=0;n(0===o),n(0==(-8192&o))},b.prototype.stub=function(e){for(var t=new Array(e),i=0;i<e;i++)t[i]=0;return t},b.prototype.mulp=function(e,t,i){var n=2*this.guessLen13b(e.length,t.length),r=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),c=new Array(n),d=new Array(n),l=new Array(n),u=new Array(n),h=i.words;h.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,d,n),this.transform(s,o,a,c,n,r),this.transform(d,o,l,u,n,r);for(var f=0;f<n;f++){var p=a[f]*l[f]-c[f]*u[f];c[f]=a[f]*u[f]+c[f]*l[f],a[f]=p}return this.conjugate(a,c,n),this.transform(a,c,h,o,n,r),this.conjugate(h,o,n),this.normalize13b(h,n),i.negative=e.negative^t.negative,i.length=e.length+t.length,i._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),y(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var i=0,r=0;r<this.length;r++){var o=(0|this.words[r])*e,s=(67108863&o)+(67108863&i);i>>=26,i+=o/67108864|0,i+=s>>>26,this.words[r]=67108863&s}return 0!==i&&(this.words[r]=i,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),i=0;i<t.length;i++){var n=i/26|0,r=i%26;t[i]=e.words[n]>>>r&1}return t}(e);if(0===t.length)return new o(1);for(var i=this,n=0;n<t.length&&0===t[n];n++,i=i.sqr());if(++n<t.length)for(var r=i.sqr();n<t.length;n++,r=r.sqr())0!==t[n]&&(i=i.mul(r));return i},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,i=e%26,r=(e-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,c=(0|this.words[t])-a<<i;this.words[t]=c|s,s=a>>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==r){for(t=this.length-1;t>=0;t--)this.words[t+r]=this.words[t];for(t=0;t<r;t++)this.words[t]=0;this.length+=r}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,i){var r;n("number"==typeof e&&e>=0),r=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,c=i;if(r-=s,r=Math.max(0,r),c){for(var d=0;d<s;d++)c.words[d]=this.words[d];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,d=0;d<this.length;d++)this.words[d]=this.words[d+s];else this.words[0]=0,this.length=1;var l=0;for(d=this.length-1;d>=0&&(0!==l||d>=r);d--){var u=0|this.words[d];this.words[d]=l<<26-o|u>>>o,l=u&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,i){return n(0===this.negative),this.iushrn(e,t,i)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26,r=1<<t;return!(this.length<=i)&&!!(this.words[i]&r)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)return this;if(0!==t&&i++,this.length=Math.min(i,this.length),0!==t){var r=67108863^67108863>>>t<<t;this.words[this.length-1]&=r}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,i){var r,o,s=e.length+i;this._expand(s);var a=0;for(r=0;r<e.length;r++){o=(0|this.words[r+i])+a;var c=(0|e.words[r])*t;a=((o-=67108863&c)>>26)-(c/67108864|0),this.words[r+i]=67108863&o}for(;r<this.length-i;r++)a=(o=(0|this.words[r+i])+a)>>26,this.words[r+i]=67108863&o;if(0===a)return this._strip();for(n(-1===a),a=0,r=0;r<this.length;r++)a=(o=-(0|this.words[r])+a)>>26,this.words[r]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var i=(this.length,e.length),n=this.clone(),r=e,s=0|r.words[r.length-1];0!==(i=26-this._countBits(s))&&(r=r.ushln(i),n.iushln(i),s=0|r.words[r.length-1]);var a,c=n.length-r.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var d=0;d<a.length;d++)a.words[d]=0}var l=n.clone()._ishlnsubmul(r,1,c);0===l.negative&&(n=l,a&&(a.words[c]=1));for(var u=c-1;u>=0;u--){var h=67108864*(0|n.words[r.length+u])+(0|n.words[r.length+u-1]);for(h=Math.min(h/s|0,67108863),n._ishlnsubmul(r,h,u);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(r,1,u),n.isZero()||(n.negative^=1);a&&(a.words[u]=h)}return a&&a._strip(),n._strip(),"div"!==t&&0!==i&&n.iushrn(i),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,i){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(r=a.div.neg()),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.iadd(e)),{div:r,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(r=a.div.neg()),{div:r,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),i&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var r,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var i=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),r=e.andln(1),o=i.cmp(n);return o<0||1===r&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var i=(1<<26)%e,r=0,o=this.length-1;o>=0;o--)r=(i*r+(0|this.words[o]))%e;return t?-r:r},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var i=0,r=this.length-1;r>=0;r--){var o=(0|this.words[r])+67108864*i;this.words[r]=o/e|0,i=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r=new o(1),s=new o(0),a=new o(0),c=new o(1),d=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++d;for(var l=i.clone(),u=t.clone();!t.isZero();){for(var h=0,f=1;0==(t.words[0]&f)&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(r.isOdd()||s.isOdd())&&(r.iadd(l),s.isub(u)),r.iushrn(1),s.iushrn(1);for(var p=0,g=1;0==(i.words[0]&g)&&p<26;++p,g<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(u)),a.iushrn(1),c.iushrn(1);t.cmp(i)>=0?(t.isub(i),r.isub(a),s.isub(c)):(i.isub(t),a.isub(r),c.isub(s))}return{a:a,b:c,gcd:i.iushln(d)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var r,s=new o(1),a=new o(0),c=i.clone();t.cmpn(1)>0&&i.cmpn(1)>0;){for(var d=0,l=1;0==(t.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(t.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var u=0,h=1;0==(i.words[0]&h)&&u<26;++u,h<<=1);if(u>0)for(i.iushrn(u);u-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(i)>=0?(t.isub(i),s.isub(a)):(i.isub(t),a.isub(s))}return(r=0===t.cmpn(1)?s:a).cmpn(0)<0&&r.iadd(e),r},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),i=e.clone();t.negative=0,i.negative=0;for(var n=0;t.isEven()&&i.isEven();n++)t.iushrn(1),i.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;i.isEven();)i.iushrn(1);var r=t.cmp(i);if(r<0){var o=t;t=i,i=o}else if(0===r||0===i.cmpn(1))break;t.isub(i)}return i.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,i=(e-t)/26,r=1<<t;if(this.length<=i)return this._expand(i+1),this.words[i]|=r,this;for(var o=r,s=i;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return-1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)t=1;else{i&&(e=-e),n(e<=67108863,"Number is too big");var r=0|this.words[0];t=r===e?0:r<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,i=this.length-1;i>=0;i--){var n=0|this.words[i],r=0|e.words[i];if(n!==r){n<r?t=-1:n>r&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new R(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var _={k256:null,p224:null,p192:null,p25519:null};function S(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function E(){S.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){S.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function T(){S.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function I(){S.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function R(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){R.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}S.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},S.prototype.ireduce=function(e){var t,i=e;do{this.split(i,this.tmp),t=(i=(i=this.imulK(i)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:i.ucmp(this.p);return 0===n?(i.words[0]=0,i.length=1):n>0?i.isub(this.p):void 0!==i.strip?i.strip():i._strip(),i},S.prototype.split=function(e,t){e.iushrn(this.n,0,t)},S.prototype.imulK=function(e){return e.imul(this.k)},r(E,S),E.prototype.split=function(e,t){for(var i=4194303,n=Math.min(e.length,9),r=0;r<n;r++)t.words[r]=e.words[r];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&i,r=10;r<e.length;r++){var s=0|e.words[r];e.words[r-10]=(s&i)<<4|o>>>22,o=s}o>>>=22,e.words[r-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},E.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,i=0;i<e.length;i++){var n=0|e.words[i];t+=977*n,e.words[i]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(w,S),r(T,S),r(I,S),I.prototype.imulK=function(e){for(var t=0,i=0;i<e.length;i++){var n=19*(0|e.words[i])+t,r=67108863&n;n>>>=26,e.words[i]=r,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(_[e])return _[e];var t;if("k256"===e)t=new E;else if("p224"===e)t=new w;else if("p192"===e)t=new T;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new I}return _[e]=t,t},R.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},R.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},R.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(l(e,e.umod(this.m)._forceRed(this)),e)},R.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},R.prototype.add=function(e,t){this._verify2(e,t);var i=e.add(t);return i.cmp(this.m)>=0&&i.isub(this.m),i._forceRed(this)},R.prototype.iadd=function(e,t){this._verify2(e,t);var i=e.iadd(t);return i.cmp(this.m)>=0&&i.isub(this.m),i},R.prototype.sub=function(e,t){this._verify2(e,t);var i=e.sub(t);return i.cmpn(0)<0&&i.iadd(this.m),i._forceRed(this)},R.prototype.isub=function(e,t){this._verify2(e,t);var i=e.isub(t);return i.cmpn(0)<0&&i.iadd(this.m),i},R.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},R.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},R.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},R.prototype.isqr=function(e){return this.imul(e,e.clone())},R.prototype.sqr=function(e){return this.mul(e,e)},R.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var i=this.m.add(new o(1)).iushrn(2);return this.pow(e,i)}for(var r=this.m.subn(1),s=0;!r.isZero()&&0===r.andln(1);)s++,r.iushrn(1);n(!r.isZero());var a=new o(1).toRed(this),c=a.redNeg(),d=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,d).cmp(c);)l.redIAdd(c);for(var u=this.pow(l,r),h=this.pow(e,r.addn(1).iushrn(1)),f=this.pow(e,r),p=s;0!==f.cmp(a);){for(var g=f,v=0;0!==g.cmp(a);v++)g=g.redSqr();n(v<p);var m=this.pow(u,new o(1).iushln(p-v-1));h=h.redMul(m),u=m.redSqr(),f=f.redMul(u),p=v}return h},R.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},R.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var i=new Array(16);i[0]=new o(1).toRed(this),i[1]=e;for(var n=2;n<i.length;n++)i[n]=this.mul(i[n-1],e);var r=i[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var d=t.words[n],l=c-1;l>=0;l--){var u=d>>l&1;r!==i[0]&&(r=this.sqr(r)),0!==u||0!==s?(s<<=1,s|=u,(4===++a||0===n&&0===l)&&(r=this.mul(r,i[s]),a=0,s=0)):a=0}c=26}return r},R.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},R.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new k(e)},r(k,R),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var i=e.imul(t),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(n).iushrn(this.shift),o=r;return r.cmp(this.m)>=0?o=r.isub(this.m):r.cmpn(0)<0&&(o=r.iadd(this.m)),o._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var i=e.mul(t),n=i.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),r=i.isub(n).iushrn(this.shift),s=r;return r.cmp(this.m)>=0?s=r.isub(this.m):r.cmpn(0)<0&&(s=r.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this)},{buffer:20}],43:[function(e,t,i){t.exports=e("./browser/algorithms.json")},{"./browser/algorithms.json":44}],44:[function(e,t,i){t.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}},{}],45:[function(e,t,i){t.exports={"1.3.132.0.10":"secp256k1","1.3.132.0.33":"p224","1.2.840.10045.3.1.1":"p192","1.2.840.10045.3.1.7":"p256","1.3.132.0.34":"p384","1.3.132.0.35":"p521"}},{}],46:[function(e,t,i){var n=e("safe-buffer").Buffer,r=e("create-hash"),o=e("readable-stream"),s=e("inherits"),a=e("./sign"),c=e("./verify"),d=e("./algorithms.json");function l(e){o.Writable.call(this);var t=d[e];if(!t)throw new Error("Unknown message digest");this._hashType=t.hash,this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}function u(e){o.Writable.call(this);var t=d[e];if(!t)throw new Error("Unknown message digest");this._hash=r(t.hash),this._tag=t.id,this._signType=t.sign}function h(e){return new l(e)}function f(e){return new u(e)}Object.keys(d).forEach((function(e){d[e].id=n.from(d[e].id,"hex"),d[e.toLowerCase()]=d[e]})),s(l,o.Writable),l.prototype._write=function(e,t,i){this._hash.update(e),i()},l.prototype.update=function(e,t){return"string"==typeof e&&(e=n.from(e,t)),this._hash.update(e),this},l.prototype.sign=function(e,t){this.end();var i=this._hash.digest(),n=a(i,e,this._hashType,this._signType,this._tag);return t?n.toString(t):n},s(u,o.Writable),u.prototype._write=function(e,t,i){this._hash.update(e),i()},u.prototype.update=function(e,t){return"string"==typeof e&&(e=n.from(e,t)),this._hash.update(e),this},u.prototype.verify=function(e,t,i){"string"==typeof t&&(t=n.from(t,i)),this.end();var r=this._hash.digest();return c(t,r,e,this._signType,this._tag)},t.exports={Sign:h,Verify:f,createSign:h,createVerify:f}},{"./algorithms.json":44,"./sign":47,"./verify":48,"create-hash":74,inherits:151,"readable-stream":64,"safe-buffer":260}],47:[function(e,t,i){var n=e("safe-buffer").Buffer,r=e("create-hmac"),o=e("browserify-rsa"),s=e("elliptic").ec,a=e("bn.js"),c=e("parse-asn1"),d=e("./curves.json");function l(e,t,i,o){if((e=n.from(e.toArray())).length<t.byteLength()){var s=n.alloc(t.byteLength()-e.length);e=n.concat([s,e])}var a=i.length,c=function(e,t){e=u(e,t),e=e.mod(t);var i=n.from(e.toArray());if(i.length<t.byteLength()){var r=n.alloc(t.byteLength()-i.length);i=n.concat([r,i])}return i}(i,t),d=n.alloc(a);d.fill(1);var l=n.alloc(a);return l=r(o,l).update(d).update(n.from([0])).update(e).update(c).digest(),d=r(o,l).update(d).digest(),{k:l=r(o,l).update(d).update(n.from([1])).update(e).update(c).digest(),v:d=r(o,l).update(d).digest()}}function u(e,t){var i=new a(e),n=(e.length<<3)-t.bitLength();return n>0&&i.ishrn(n),i}function h(e,t,i){var o,s;do{for(o=n.alloc(0);8*o.length<e.bitLength();)t.v=r(i,t.k).update(t.v).digest(),o=n.concat([o,t.v]);s=u(o,e),t.k=r(i,t.k).update(t.v).update(n.from([0])).digest(),t.v=r(i,t.k).update(t.v).digest()}while(-1!==s.cmp(e));return s}function f(e,t,i,n){return e.toRed(a.mont(i)).redPow(t).fromRed().mod(n)}t.exports=function(e,t,i,r,p){var g=c(t);if(g.curve){if("ecdsa"!==r&&"ecdsa/rsa"!==r)throw new Error("wrong private key type");return function(e,t){var i=d[t.curve.join(".")];if(!i)throw new Error("unknown curve "+t.curve.join("."));var r=new s(i).keyFromPrivate(t.privateKey),o=r.sign(e);return n.from(o.toDER())}(e,g)}if("dsa"===g.type){if("dsa"!==r)throw new Error("wrong private key type");return function(e,t,i){var r,o=t.params.priv_key,s=t.params.p,c=t.params.q,d=t.params.g,p=new a(0),g=u(e,c).mod(c),v=!1,m=l(o,c,e,i);for(;!1===v;)p=f(d,r=h(c,m,i),s,c),0===(v=r.invm(c).imul(g.add(o.mul(p))).mod(c)).cmpn(0)&&(v=!1,p=new a(0));return function(e,t){e=e.toArray(),t=t.toArray(),128&e[0]&&(e=[0].concat(e));128&t[0]&&(t=[0].concat(t));var i=e.length+t.length+4,r=[48,i,2,e.length];return r=r.concat(e,[2,t.length],t),n.from(r)}(p,v)}(e,g,i)}if("rsa"!==r&&"ecdsa/rsa"!==r)throw new Error("wrong private key type");e=n.concat([p,e]);for(var v=g.modulus.byteLength(),m=[0,1];e.length+m.length+1<v;)m.push(255);m.push(0);for(var y=-1;++y<e.length;)m.push(e[y]);return o(m,g)},t.exports.getKey=l,t.exports.makeKey=h},{"./curves.json":45,"bn.js":49,"browserify-rsa":41,"create-hmac":76,elliptic:93,"parse-asn1":240,"safe-buffer":260}],48:[function(e,t,i){var n=e("safe-buffer").Buffer,r=e("bn.js"),o=e("elliptic").ec,s=e("parse-asn1"),a=e("./curves.json");function c(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}t.exports=function(e,t,i,d,l){var u=s(i);if("ec"===u.type){if("ecdsa"!==d&&"ecdsa/rsa"!==d)throw new Error("wrong public key type");return function(e,t,i){var n=a[i.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+i.data.algorithm.curve.join("."));var r=new o(n),s=i.data.subjectPrivateKey.data;return r.verify(t,e,s)}(e,t,u)}if("dsa"===u.type){if("dsa"!==d)throw new Error("wrong public key type");return function(e,t,i){var n=i.data.p,o=i.data.q,a=i.data.g,d=i.data.pub_key,l=s.signature.decode(e,"der"),u=l.s,h=l.r;c(u,o),c(h,o);var f=r.mont(n),p=u.invm(o),g=a.toRed(f).redPow(new r(t).mul(p).mod(o)).fromRed().mul(d.toRed(f).redPow(h.mul(p).mod(o)).fromRed()).mod(n).mod(o);return 0===g.cmp(h)}(e,t,u)}if("rsa"!==d&&"ecdsa/rsa"!==d)throw new Error("wrong public key type");t=n.concat([l,t]);for(var h=u.modulus.byteLength(),f=[1],p=0;t.length+f.length+2<h;)f.push(255),p++;f.push(0);for(var g=-1;++g<t.length;)f.push(t[g]);f=n.from(f);var v=r.mont(u.modulus);e=(e=new r(e).toRed(v)).redPow(new r(u.publicExponent)),e=n.from(e.fromRed().toArray());var m=p<8?1:0;for(h=Math.min(e.length,f.length),e.length!==f.length&&(m=1),g=-1;++g<h;)m|=e[g]^f[g];return 0===m}},{"./curves.json":45,"bn.js":49,elliptic:93,"parse-asn1":240,"safe-buffer":260}],49:[function(e,t,i){arguments[4][42][0].apply(i,arguments)},{buffer:20,dup:42}],50:[function(e,t,i){"use strict";var n={};function r(e,t,i){i||(i=Error);var r=function(e){var i,n;function r(i,n,r){return e.call(this,function(e,i,n){return"string"==typeof t?t:t(e,i,n)}(i,n,r))||this}return n=e,(i=r).prototype=Object.create(n.prototype),i.prototype.constructor=i,i.__proto__=n,r}(i);r.prototype.name=i.name,r.prototype.code=e,n[e]=r}function o(e,t){if(Array.isArray(e)){var i=e.length;return e=e.map((function(e){return String(e)})),i>2?"one of ".concat(t," ").concat(e.slice(0,i-1).join(", "),", or ")+e[i-1]:2===i?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,i){var n,r,s,a;if("string"==typeof t&&(r="not ",t.substr(!s||s<0?0:+s,r.length)===r)?(n="must not be",t=t.replace(/^not /,"")):n="must be",function(e,t,i){return(void 0===i||i>e.length)&&(i=e.length),e.substring(i-t.length,i)===t}(e," argument"))a="The ".concat(e," ").concat(n," ").concat(o(t,"type"));else{var c=function(e,t,i){return"number"!=typeof i&&(i=0),!(i+t.length>e.length)&&-1!==e.indexOf(t,i)}(e,".")?"property":"argument";a='The "'.concat(e,'" ').concat(c," ").concat(n," ").concat(o(t,"type"))}return a+=". Received type ".concat(typeof i)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),t.exports.codes=n},{}],51:[function(e,t,i){(function(i){(function(){"use strict";var n=Object.keys||function(e){var t=[];for(var i in e)t.push(i);return t};t.exports=d;var r=e("./_stream_readable"),o=e("./_stream_writable");e("inherits")(d,r);for(var s=n(o.prototype),a=0;a<s.length;a++){var c=s[a];d.prototype[c]||(d.prototype[c]=o.prototype[c])}function d(e){if(!(this instanceof d))return new d(e);r.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||i.nextTick(u,this)}function u(e){e.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(d.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(d.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":53,"./_stream_writable":55,_process:247,inherits:151}],52:[function(e,t,i){"use strict";t.exports=r;var n=e("./_stream_transform");function r(e){if(!(this instanceof r))return new r(e);n.call(this,e)}e("inherits")(r,n),r.prototype._transform=function(e,t,i){i(null,e)}},{"./_stream_transform":54,inherits:151}],53:[function(e,t,i){(function(i,n){(function(){"use strict";var r;t.exports=I,I.ReadableState=T;e("events").EventEmitter;var o=function(e,t){return e.listeners(t).length},s=e("./internal/streams/stream"),a=e("buffer").Buffer,c=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var d,l=e("util");d=l&&l.debuglog?l.debuglog("stream"):function(){};var u,h,f,p=e("./internal/streams/buffer_list"),g=e("./internal/streams/destroy"),v=e("./internal/streams/state").getHighWaterMark,m=e("../errors").codes,y=m.ERR_INVALID_ARG_TYPE,b=m.ERR_STREAM_PUSH_AFTER_EOF,_=m.ERR_METHOD_NOT_IMPLEMENTED,S=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;e("inherits")(I,s);var E=g.errorOrDestroy,w=["error","close","destroy","pause","resume"];function T(t,i,n){r=r||e("./_stream_duplex"),t=t||{},"boolean"!=typeof n&&(n=i instanceof r),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=v(this,t,"readableHighWaterMark",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(u||(u=e("string_decoder/").StringDecoder),this.decoder=new u(t.encoding),this.encoding=t.encoding)}function I(t){if(r=r||e("./_stream_duplex"),!(this instanceof I))return new I(t);var i=this instanceof r;this._readableState=new T(t,this,i),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function R(e,t,i,n,r){d("readableAddChunk",t);var o,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(d("onEofChunk"),t.ended)return;if(t.decoder){var i=t.decoder.end();i&&i.length&&(t.buffer.push(i),t.length+=t.objectMode?1:i.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,A(e)))}(e,s);else if(r||(o=function(e,t){var i;n=t,a.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(i=new y("chunk",["string","Buffer","Uint8Array"],t));var n;return i}(s,t)),o)E(e,o);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),n)s.endEmitted?E(e,new S):k(e,s,t,!0);else if(s.ended)E(e,new b);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!i?(t=s.decoder.write(t),s.objectMode||0!==t.length?k(e,s,t,!1):P(e,s)):k(e,s,t,!1)}else n||(s.reading=!1,P(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function k(e,t,i,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",i)):(t.length+=t.objectMode?1:i.length,n?t.buffer.unshift(i):t.buffer.push(i),t.needReadable&&O(e)),P(e,t)}Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),I.prototype.destroy=g.destroy,I.prototype._undestroy=g.undestroy,I.prototype._destroy=function(e,t){t(e)},I.prototype.push=function(e,t){var i,n=this._readableState;return n.objectMode?i=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=a.from(e,t),t=""),i=!0),R(this,e,t,!1,i)},I.prototype.unshift=function(e){return R(this,e,null,!0,!1)},I.prototype.isPaused=function(){return!1===this._readableState.flowing},I.prototype.setEncoding=function(t){u||(u=e("string_decoder/").StringDecoder);var i=new u(t);this._readableState.decoder=i,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r="";null!==n;)r+=i.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this};var M=1073741824;function C(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=M?e=M:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;d("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(A,e))}function A(e){var t=e._readableState;d("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function P(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(D,e,t))}function D(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var i=t.length;if(d("maybeReadMore read 0"),e.read(0),i===t.length)break}t.readingMore=!1}function x(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function L(e){d("readable nexttick read 0"),e.read(0)}function U(e,t){d("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(d("flow",t.flowing);t.flowing&&null!==e.read(););}function B(e,t){return 0===t.length?null:(t.objectMode?i=t.buffer.shift():!e||e>=t.length?(i=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):i=t.buffer.consume(e,t.decoder),i);var i}function j(e){var t=e._readableState;d("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(F,t,e))}function F(e,t){if(d("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var i=t._writableState;(!i||i.autoDestroy&&i.finished)&&t.destroy()}}function K(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1}I.prototype.read=function(e){d("read",e),e=parseInt(e,10);var t=this._readableState,i=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):O(this),null;if(0===(e=C(e,t))&&t.ended)return 0===t.length&&j(this),null;var n,r=t.needReadable;return d("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&d("length less than watermark",r=!0),t.ended||t.reading?d("reading or ended",r=!1):r&&(d("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=C(i,t))),null===(n=e>0?B(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),i!==e&&t.ended&&j(this)),null!==n&&this.emit("data",n),n},I.prototype._read=function(e){E(this,new _("_read()"))},I.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,d("pipe count=%d opts=%j",r.pipesCount,t);var s=(!t||!1!==t.end)&&e!==i.stdout&&e!==i.stderr?c:v;function a(t,i){d("onunpipe"),t===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,d("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),e.removeListener("drain",l),e.removeListener("error",f),e.removeListener("unpipe",a),n.removeListener("end",c),n.removeListener("end",v),n.removeListener("data",h),u=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function c(){d("onend"),e.end()}r.endEmitted?i.nextTick(s):n.once("end",s),e.on("unpipe",a);var l=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,N(e))}}(n);e.on("drain",l);var u=!1;function h(t){d("ondata");var i=e.write(t);d("dest.write",i),!1===i&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==K(r.pipes,e))&&!u&&(d("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function f(t){d("onerror",t),v(),e.removeListener("error",f),0===o(e,"error")&&E(e,t)}function p(){e.removeListener("finish",g),v()}function g(){d("onfinish"),e.removeListener("close",p),v()}function v(){d("unpipe"),n.unpipe(e)}return n.on("data",h),function(e,t,i){if("function"==typeof e.prependListener)return e.prependListener(t,i);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]:e.on(t,i)}(e,"error",f),e.once("close",p),e.once("finish",g),e.emit("pipe",n),r.flowing||(d("pipe resume"),n.resume()),e},I.prototype.unpipe=function(e){var t=this._readableState,i={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,i)),this;if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<r;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=K(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,i)),this},I.prototype.on=function(e,t){var n=s.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,d("on readable",r.length,r.reading),r.length?O(this):r.reading||i.nextTick(L,this))),n},I.prototype.addListener=I.prototype.on,I.prototype.removeListener=function(e,t){var n=s.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(x,this),n},I.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(x,this),t},I.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(U,e,t))}(this,e)),e.paused=!1,this},I.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},I.prototype.wrap=function(e){var t=this,i=this._readableState,n=!1;for(var r in e.on("end",(function(){if(d("wrapped end"),i.decoder&&!i.ended){var e=i.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(r){(d("wrapped data"),i.decoder&&(r=i.decoder.write(r)),i.objectMode&&null==r)||(i.objectMode||r&&r.length)&&(t.push(r)||(n=!0,e.pause()))})),e)void 0===this[r]&&"function"==typeof e[r]&&(this[r]=function(t){return function(){return e[t].apply(e,arguments)}}(r));for(var o=0;o<w.length;o++)e.on(w[o],this.emit.bind(this,w[o]));return this._read=function(t){d("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(I.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=e("./internal/streams/async_iterator")),h(this)}),Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(I.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(I.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),I._fromList=B,Object.defineProperty(I.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(I.from=function(t,i){return void 0===f&&(f=e("./internal/streams/from")),f(I,t,i)})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":50,"./_stream_duplex":51,"./internal/streams/async_iterator":56,"./internal/streams/buffer_list":57,"./internal/streams/destroy":58,"./internal/streams/from":60,"./internal/streams/state":62,"./internal/streams/stream":63,_process:247,buffer:68,events:109,inherits:151,"string_decoder/":289,util:20}],54:[function(e,t,i){"use strict";t.exports=l;var n=e("../errors").codes,r=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,c=e("./_stream_duplex");function d(e,t){var i=this._transformState;i.transforming=!1;var n=i.writecb;if(null===n)return this.emit("error",new o);i.writechunk=null,i.writecb=null,null!=t&&this.push(t),n(e);var r=this._readableState;r.reading=!1,(r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);c.call(this,e),this._transformState={afterTransform:d.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",u)}function u(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush((function(t,i){h(e,t,i)}))}function h(e,t,i){if(t)return e.emit("error",t);if(null!=i&&e.push(i),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}e("inherits")(l,c),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,c.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,i){i(new r("_transform()"))},l.prototype._write=function(e,t,i){var n=this._transformState;if(n.writecb=i,n.writechunk=e,n.writeencoding=t,!n.transforming){var r=this._readableState;(n.needTransform||r.needReadable||r.length<r.highWaterMark)&&this._read(r.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){c.prototype._destroy.call(this,e,(function(e){t(e)}))}},{"../errors":50,"./_stream_duplex":51,inherits:151}],55:[function(e,t,i){(function(i,n){(function(){"use strict";function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,i){var n=e.entry;e.entry=null;for(;n;){var r=n.callback;t.pendingcb--,r(i),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var o;t.exports=I,I.WritableState=T;var s={deprecate:e("util-deprecate")},a=e("./internal/streams/stream"),c=e("buffer").Buffer,d=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var l,u=e("./internal/streams/destroy"),h=e("./internal/streams/state").getHighWaterMark,f=e("../errors").codes,p=f.ERR_INVALID_ARG_TYPE,g=f.ERR_METHOD_NOT_IMPLEMENTED,v=f.ERR_MULTIPLE_CALLBACK,m=f.ERR_STREAM_CANNOT_PIPE,y=f.ERR_STREAM_DESTROYED,b=f.ERR_STREAM_NULL_VALUES,_=f.ERR_STREAM_WRITE_AFTER_END,S=f.ERR_UNKNOWN_ENCODING,E=u.errorOrDestroy;function w(){}function T(t,n,s){o=o||e("./_stream_duplex"),t=t||{},"boolean"!=typeof s&&(s=n instanceof o),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if("function"!=typeof o)throw new v;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(i.nextTick(o,r),i.nextTick(A,e,t),e._writableState.errorEmitted=!0,E(e,r)):(o(r),e._writableState.errorEmitted=!0,E(e,r),A(e,t))}(e,n,r,t,o);else{var s=C(n)||e.destroyed;s||n.corked||n.bufferProcessing||!n.bufferedRequest||M(e,n),r?i.nextTick(k,e,n,s,o):k(e,n,s,o)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function I(t){var i=this instanceof(o=o||e("./_stream_duplex"));if(!i&&!l.call(I,this))return new I(t);this._writableState=new T(t,this,i),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),a.call(this)}function R(e,t,i,n,r,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):i?e._writev(r,t.onwrite):e._write(r,o,t.onwrite),t.sync=!1}function k(e,t,i,n){i||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),A(e,t)}function M(e,t){t.bufferProcessing=!0;var i=t.bufferedRequest;if(e._writev&&i&&i.next){var n=t.bufferedRequestCount,o=new Array(n),s=t.corkedRequestsFree;s.entry=i;for(var a=0,c=!0;i;)o[a]=i,i.isBuf||(c=!1),i=i.next,a+=1;o.allBuffers=c,R(e,t,!0,t.length,o,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;i;){var d=i.chunk,l=i.encoding,u=i.callback;if(R(e,t,!1,t.objectMode?1:d.length,d,l,u),i=i.next,t.bufferedRequestCount--,t.writing)break}null===i&&(t.lastBufferedRequest=null)}t.bufferedRequest=i,t.bufferProcessing=!1}function C(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function O(e,t){e._final((function(i){t.pendingcb--,i&&E(e,i),t.prefinished=!0,e.emit("prefinish"),A(e,t)}))}function A(e,t){var n=C(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(O,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}e("inherits")(I,a),T.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(T.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(I,Symbol.hasInstance,{value:function(e){return!!l.call(this,e)||this===I&&(e&&e._writableState instanceof T)}})):l=function(e){return e instanceof this},I.prototype.pipe=function(){E(this,new m)},I.prototype.write=function(e,t,n){var r,o=this._writableState,s=!1,a=!o.objectMode&&(r=e,c.isBuffer(r)||r instanceof d);return a&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=w),o.ending?function(e,t){var n=new _;E(e,n),i.nextTick(t,n)}(this,n):(a||function(e,t,n,r){var o;return null===n?o=new b:"string"==typeof n||t.objectMode||(o=new p("chunk",["string","Buffer"],n)),!o||(E(e,o),i.nextTick(r,o),!1)}(this,o,e,n))&&(o.pendingcb++,s=function(e,t,i,n,r,o){if(!i){var s=function(e,t,i){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,i));return t}(t,n,r);n!==s&&(i=!0,r="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var d=t.length<t.highWaterMark;d||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:r,isBuf:i,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else R(e,t,!1,a,n,r,o);return d}(this,o,a,e,t,n)),s},I.prototype.cork=function(){this._writableState.corked++},I.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||M(this,e))},I.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new S(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(I.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(I.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),I.prototype._write=function(e,t,i){i(new g("_write()"))},I.prototype._writev=null,I.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,A(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(I.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),I.prototype.destroy=u.destroy,I.prototype._undestroy=u.undestroy,I.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":50,"./_stream_duplex":51,"./internal/streams/destroy":58,"./internal/streams/state":62,"./internal/streams/stream":63,_process:247,buffer:68,inherits:151,"util-deprecate":293}],56:[function(e,t,i){(function(i){(function(){"use strict";var n;function r(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var o=e("./end-of-stream"),s=Symbol("lastResolve"),a=Symbol("lastReject"),c=Symbol("error"),d=Symbol("ended"),l=Symbol("lastPromise"),u=Symbol("handlePromise"),h=Symbol("stream");function f(e,t){return{value:e,done:t}}function p(e){var t=e[s];if(null!==t){var i=e[h].read();null!==i&&(e[l]=null,e[s]=null,e[a]=null,t(f(i,!1)))}}function g(e){i.nextTick(p,e)}var v=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((r(n={get stream(){return this[h]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[d])return Promise.resolve(f(void 0,!0));if(this[h].destroyed)return new Promise((function(t,n){i.nextTick((function(){e[c]?n(e[c]):t(f(void 0,!0))}))}));var n,r=this[l];if(r)n=new Promise(function(e,t){return function(i,n){e.then((function(){t[d]?i(f(void 0,!0)):t[u](i,n)}),n)}}(r,this));else{var o=this[h].read();if(null!==o)return Promise.resolve(f(o,!1));n=new Promise(this[u])}return this[l]=n,n}},Symbol.asyncIterator,(function(){return this})),r(n,"return",(function(){var e=this;return new Promise((function(t,i){e[h].destroy(null,(function(e){e?i(e):t(f(void 0,!0))}))}))})),n),v);t.exports=function(e){var t,i=Object.create(m,(r(t={},h,{value:e,writable:!0}),r(t,s,{value:null,writable:!0}),r(t,a,{value:null,writable:!0}),r(t,c,{value:null,writable:!0}),r(t,d,{value:e._readableState.endEmitted,writable:!0}),r(t,u,{value:function(e,t){var n=i[h].read();n?(i[l]=null,i[s]=null,i[a]=null,e(f(n,!1))):(i[s]=e,i[a]=t)},writable:!0}),t));return i[l]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=i[a];return null!==t&&(i[l]=null,i[s]=null,i[a]=null,t(e)),void(i[c]=e)}var n=i[s];null!==n&&(i[l]=null,i[s]=null,i[a]=null,n(f(void 0,!0))),i[d]=!0})),e.on("readable",g.bind(null,i)),i}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":59,_process:247}],57:[function(e,t,i){"use strict";function n(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function r(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?n(Object(i),!0).forEach((function(t){o(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):n(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function o(e,t,i){return(t=a(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function s(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}var c=e("buffer").Buffer,d=e("util").inspect,l=d&&d.custom||"inspect";t.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,i,n;return t=e,(i=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,i=""+t.data;t=t.next;)i+=e+t.data;return i}},{key:"concat",value:function(e){if(0===this.length)return c.alloc(0);for(var t,i,n,r=c.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,i=r,n=s,c.prototype.copy.call(t,i,n),s+=o.data.length,o=o.next;return r}},{key:"consume",value:function(e,t){var i;return e<this.head.data.length?(i=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):i=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,i=1,n=t.data;for(e-=n.length;t=t.next;){var r=t.data,o=e>r.length?r.length:e;if(o===r.length?n+=r:n+=r.slice(0,e),0==(e-=o)){o===r.length?(++i,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=r.slice(o));break}++i}return this.length-=i,n}},{key:"_getBuffer",value:function(e){var t=c.allocUnsafe(e),i=this.head,n=1;for(i.data.copy(t),e-=i.data.length;i=i.next;){var r=i.data,o=e>r.length?r.length:e;if(r.copy(t,t.length-e,0,o),0==(e-=o)){o===r.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=r.slice(o));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return d(this,r(r({},t),{},{depth:0,customInspect:!1}))}}])&&s(t.prototype,i),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}()},{buffer:68,util:20}],58:[function(e,t,i){(function(e){(function(){"use strict";function i(e,t){r(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}t.exports={destroy:function(t,o){var s=this,a=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return a||c?(o?o(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(r,this,t)):e.nextTick(r,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!o&&t?s._writableState?s._writableState.errorEmitted?e.nextTick(n,s):(s._writableState.errorEmitted=!0,e.nextTick(i,s,t)):e.nextTick(i,s,t):o?(e.nextTick(n,s),o(t)):e.nextTick(n,s)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var i=e._readableState,n=e._writableState;i&&i.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:247}],59:[function(e,t,i){"use strict";var n=e("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function r(){}t.exports=function e(t,i,o){if("function"==typeof i)return e(t,null,i);i||(i={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var i=arguments.length,n=new Array(i),r=0;r<i;r++)n[r]=arguments[r];e.apply(this,n)}}}(o||r);var s=i.readable||!1!==i.readable&&t.readable,a=i.writable||!1!==i.writable&&t.writable,c=function(){t.writable||l()},d=t._writableState&&t._writableState.finished,l=function(){a=!1,d=!0,s||o.call(t)},u=t._readableState&&t._readableState.endEmitted,h=function(){s=!1,u=!0,a||o.call(t)},f=function(e){o.call(t,e)},p=function(){var e;return s&&!u?(t._readableState&&t._readableState.ended||(e=new n),o.call(t,e)):a&&!d?(t._writableState&&t._writableState.ended||(e=new n),o.call(t,e)):void 0},g=function(){t.req.on("finish",l)};return!function(e){return e.setHeader&&"function"==typeof e.abort}(t)?a&&!t._writableState&&(t.on("end",c),t.on("close",c)):(t.on("complete",l),t.on("abort",p),t.req?g():t.on("request",g)),t.on("end",h),t.on("finish",l),!1!==i.error&&t.on("error",f),t.on("close",p),function(){t.removeListener("complete",l),t.removeListener("abort",p),t.removeListener("request",g),t.req&&t.req.removeListener("finish",l),t.removeListener("end",c),t.removeListener("close",c),t.removeListener("finish",l),t.removeListener("end",h),t.removeListener("error",f),t.removeListener("close",p)}}},{"../../../errors":50}],60:[function(e,t,i){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],61:[function(e,t,i){"use strict";var n;var r=e("../../../errors").codes,o=r.ERR_MISSING_ARGS,s=r.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function c(e){e()}function d(e,t){return e.pipe(t)}t.exports=function(){for(var t=arguments.length,i=new Array(t),r=0;r<t;r++)i[r]=arguments[r];var l,u=function(e){return e.length?"function"!=typeof e[e.length-1]?a:e.pop():a}(i);if(Array.isArray(i[0])&&(i=i[0]),i.length<2)throw new o("streams");var h=i.map((function(t,r){var o=r<i.length-1;return function(t,i,r,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var a=!1;t.on("close",(function(){a=!0})),void 0===n&&(n=e("./end-of-stream")),n(t,{readable:i,writable:r},(function(e){if(e)return o(e);a=!0,o()}));var c=!1;return function(e){if(!a&&!c)return c=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void o(e||new s("pipe"))}}(t,o,r>0,(function(e){l||(l=e),e&&h.forEach(c),o||(h.forEach(c),u(l))}))}));return i.reduce(d)}},{"../../../errors":50,"./end-of-stream":59}],62:[function(e,t,i){"use strict";var n=e("../../../errors").codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(e,t,i,r){var o=function(e,t,i){return null!=e.highWaterMark?e.highWaterMark:t?e[i]:null}(t,r,i);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(r?i:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},{"../../../errors":50}],63:[function(e,t,i){t.exports=e("events").EventEmitter},{events:109}],64:[function(e,t,i){(i=t.exports=e("./lib/_stream_readable.js")).Stream=i,i.Readable=i,i.Writable=e("./lib/_stream_writable.js"),i.Duplex=e("./lib/_stream_duplex.js"),i.Transform=e("./lib/_stream_transform.js"),i.PassThrough=e("./lib/_stream_passthrough.js"),i.finished=e("./lib/internal/streams/end-of-stream.js"),i.pipeline=e("./lib/internal/streams/pipeline.js")},{"./lib/_stream_duplex.js":51,"./lib/_stream_passthrough.js":52,"./lib/_stream_readable.js":53,"./lib/_stream_transform.js":54,"./lib/_stream_writable.js":55,"./lib/internal/streams/end-of-stream.js":59,"./lib/internal/streams/pipeline.js":61}],65:[function(e,t,i){const n=e("base-x");t.exports=n("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")},{"base-x":66}],66:[function(e,t,i){"use strict";t.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),i=0;i<t.length;i++)t[i]=255;for(var n=0;n<e.length;n++){var r=e.charAt(n),o=r.charCodeAt(0);if(255!==t[o])throw new TypeError(r+" is ambiguous");t[o]=n}var s=e.length,a=e.charAt(0),c=Math.log(s)/Math.log(256),d=Math.log(256)/Math.log(s);function l(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;for(var i=0,n=0,r=0;e[i]===a;)n++,i++;for(var o=(e.length-i)*c+1>>>0,d=new Uint8Array(o);e[i];){var l=t[e.charCodeAt(i)];if(255===l)return;for(var u=0,h=o-1;(0!==l||u<r)&&-1!==h;h--,u++)l+=s*d[h]>>>0,d[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");r=u,i++}for(var f=o-r;f!==o&&0===d[f];)f++;for(var p=new Uint8Array(n+(o-f)),g=n;f!==o;)p[g++]=d[f++];return p}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var i=0,n=0,r=0,o=t.length;r!==o&&0===t[r];)r++,i++;for(var c=(o-r)*d+1>>>0,l=new Uint8Array(c);r!==o;){for(var u=t[r],h=0,f=c-1;(0!==u||h<n)&&-1!==f;f--,h++)u+=256*l[f]>>>0,l[f]=u%s>>>0,u=u/s>>>0;if(0!==u)throw new Error("Non-zero carry");n=h,r++}for(var p=c-n;p!==c&&0===l[p];)p++;for(var g=a.repeat(i);p<c;++p)g+=e.charAt(l[p]);return g},decodeUnsafe:l,decode:function(e){var t=l(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},{}],67:[function(e,t,i){(function(e){(function(){t.exports=function(t,i){for(var n=Math.min(t.length,i.length),r=new e(n),o=0;o<n;++o)r[o]=t[o]^i[o];return r}}).call(this)}).call(this,e("buffer").Buffer)},{buffer:68}],68:[function(e,t,i){(function(t){(function(){ | |
/*! | |
* The buffer module from node.js, for the browser. | |
* | |
* @author Feross Aboukhadijeh <https://feross.org> | |
* @license MIT | |
*/ | |
"use strict";var t=e("base64-js"),n=e("ieee754");i.Buffer=s,i.SlowBuffer=function(e){+e!=e&&(e=0);return s.alloc(+e)},i.INSPECT_MAX_BYTES=50;var r=2147483647;function o(e){if(e>r)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=s.prototype,t}function s(e,t,i){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return a(e,t,i)}function a(e,t,i){if("string"==typeof e)return function(e,t){"string"==typeof t&&""!==t||(t="utf8");if(!s.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var i=0|h(e,t),n=o(i),r=n.write(e,t);r!==i&&(n=n.slice(0,r));return n}(e,t);if(ArrayBuffer.isView(e))return l(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(F(e,ArrayBuffer)||e&&F(e.buffer,ArrayBuffer))return function(e,t,i){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw new RangeError('"length" is outside of buffer bounds');var n;n=void 0===t&&void 0===i?new Uint8Array(e):void 0===i?new Uint8Array(e,t):new Uint8Array(e,t,i);return n.__proto__=s.prototype,n}(e,t,i);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return s.from(n,t,i);var r=function(e){if(s.isBuffer(e)){var t=0|u(e.length),i=o(t);return 0===i.length||e.copy(i,0,0,t),i}if(void 0!==e.length)return"number"!=typeof e.length||K(e.length)?o(0):l(e);if("Buffer"===e.type&&Array.isArray(e.data))return l(e.data)}(e);if(r)return r;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return s.from(e[Symbol.toPrimitive]("string"),t,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function d(e){return c(e),o(e<0?0:0|u(e))}function l(e){for(var t=e.length<0?0:0|u(e.length),i=o(t),n=0;n<t;n+=1)i[n]=255&e[n];return i}function u(e){if(e>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return 0|e}function h(e,t){if(s.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||F(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var i=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===i)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return N(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return B(e).length;default:if(r)return n?-1:N(e).length;t=(""+t).toLowerCase(),r=!0}}function f(e,t,i){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if((i>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return M(this,t,i);case"utf8":case"utf-8":return T(this,t,i);case"ascii":return R(this,t,i);case"latin1":case"binary":return k(this,t,i);case"base64":return w(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function p(e,t,i){var n=e[t];e[t]=e[i],e[i]=n}function g(e,t,i,n,r){if(0===e.length)return-1;if("string"==typeof i?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),K(i=+i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0){if(!r)return-1;i=0}if("string"==typeof t&&(t=s.from(t,n)),s.isBuffer(t))return 0===t.length?-1:v(e,t,i,n,r);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):v(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}function v(e,t,i,n,r){var o,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,c/=2,i/=2}function d(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(r){var l=-1;for(o=i;o<a;o++)if(d(e,o)===d(t,-1===l?0:o-l)){if(-1===l&&(l=o),o-l+1===c)return l*s}else-1!==l&&(o-=o-l),l=-1}else for(i+c>a&&(i=a-c),o=i;o>=0;o--){for(var u=!0,h=0;h<c;h++)if(d(e,o+h)!==d(t,h)){u=!1;break}if(u)return o}return-1}function m(e,t,i,n){i=Number(i)||0;var r=e.length-i;n?(n=Number(n))>r&&(n=r):n=r;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(K(a))return s;e[i+s]=a}return s}function y(e,t,i,n){return j(N(t,e.length-i),e,i,n)}function b(e,t,i,n){return j(function(e){for(var t=[],i=0;i<e.length;++i)t.push(255&e.charCodeAt(i));return t}(t),e,i,n)}function _(e,t,i,n){return b(e,t,i,n)}function S(e,t,i,n){return j(B(t),e,i,n)}function E(e,t,i,n){return j(function(e,t){for(var i,n,r,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(i=e.charCodeAt(s))>>8,r=i%256,o.push(r),o.push(n);return o}(t,e.length-i),e,i,n)}function w(e,i,n){return 0===i&&n===e.length?t.fromByteArray(e):t.fromByteArray(e.slice(i,n))}function T(e,t,i){i=Math.min(e.length,i);for(var n=[],r=t;r<i;){var o,s,a,c,d=e[r],l=null,u=d>239?4:d>223?3:d>191?2:1;if(r+u<=i)switch(u){case 1:d<128&&(l=d);break;case 2:128==(192&(o=e[r+1]))&&(c=(31&d)<<6|63&o)>127&&(l=c);break;case 3:o=e[r+1],s=e[r+2],128==(192&o)&&128==(192&s)&&(c=(15&d)<<12|(63&o)<<6|63&s)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:o=e[r+1],s=e[r+2],a=e[r+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(c=(15&d)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&c<1114112&&(l=c)}null===l?(l=65533,u=1):l>65535&&(l-=65536,n.push(l>>>10&1023|55296),l=56320|1023&l),n.push(l),r+=u}return function(e){var t=e.length;if(t<=I)return String.fromCharCode.apply(String,e);var i="",n=0;for(;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=I));return i}(n)}i.kMaxLength=r,s.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&s[Symbol.species]===s&&Object.defineProperty(s,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),s.poolSize=8192,s.from=function(e,t,i){return a(e,t,i)},s.prototype.__proto__=Uint8Array.prototype,s.__proto__=Uint8Array,s.alloc=function(e,t,i){return function(e,t,i){return c(e),e<=0?o(e):void 0!==t?"string"==typeof i?o(e).fill(t,i):o(e).fill(t):o(e)}(e,t,i)},s.allocUnsafe=function(e){return d(e)},s.allocUnsafeSlow=function(e){return d(e)},s.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==s.prototype},s.compare=function(e,t){if(F(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),F(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(e)||!s.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var i=e.length,n=t.length,r=0,o=Math.min(i,n);r<o;++r)if(e[r]!==t[r]){i=e[r],n=t[r];break}return i<n?-1:n<i?1:0},s.isEncoding=function(e){switch(String(e).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}},s.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return s.alloc(0);var i;if(void 0===t)for(t=0,i=0;i<e.length;++i)t+=e[i].length;var n=s.allocUnsafe(t),r=0;for(i=0;i<e.length;++i){var o=e[i];if(F(o,Uint8Array)&&(o=s.from(o)),!s.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,r),r+=o.length}return n},s.byteLength=h,s.prototype._isBuffer=!0,s.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)p(this,t,t+1);return this},s.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)p(this,t,t+3),p(this,t+1,t+2);return this},s.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)p(this,t,t+7),p(this,t+1,t+6),p(this,t+2,t+5),p(this,t+3,t+4);return this},s.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?T(this,0,e):f.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(e){if(!s.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===s.compare(this,e)},s.prototype.inspect=function(){var e="",t=i.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},s.prototype.compare=function(e,t,i,n,r){if(F(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===i&&(i=e?e.length:0),void 0===n&&(n=0),void 0===r&&(r=this.length),t<0||i>e.length||n<0||r>this.length)throw new RangeError("out of range index");if(n>=r&&t>=i)return 0;if(n>=r)return-1;if(t>=i)return 1;if(this===e)return 0;for(var o=(r>>>=0)-(n>>>=0),a=(i>>>=0)-(t>>>=0),c=Math.min(o,a),d=this.slice(n,r),l=e.slice(t,i),u=0;u<c;++u)if(d[u]!==l[u]){o=d[u],a=l[u];break}return o<a?-1:a<o?1:0},s.prototype.includes=function(e,t,i){return-1!==this.indexOf(e,t,i)},s.prototype.indexOf=function(e,t,i){return g(this,e,t,i,!0)},s.prototype.lastIndexOf=function(e,t,i){return g(this,e,t,i,!1)},s.prototype.write=function(e,t,i,n){if(void 0===t)n="utf8",i=this.length,t=0;else if(void 0===i&&"string"==typeof t)n=t,i=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(i)?(i>>>=0,void 0===n&&(n="utf8")):(n=i,i=void 0)}var r=this.length-t;if((void 0===i||i>r)&&(i=r),e.length>0&&(i<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,e,t,i);case"utf8":case"utf-8":return y(this,e,t,i);case"ascii":return b(this,e,t,i);case"latin1":case"binary":return _(this,e,t,i);case"base64":return S(this,e,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E(this,e,t,i);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function R(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(127&e[r]);return n}function k(e,t,i){var n="";i=Math.min(e.length,i);for(var r=t;r<i;++r)n+=String.fromCharCode(e[r]);return n}function M(e,t,i){var n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);for(var r="",o=t;o<i;++o)r+=U(e[o]);return r}function C(e,t,i){for(var n=e.slice(t,i),r="",o=0;o<n.length;o+=2)r+=String.fromCharCode(n[o]+256*n[o+1]);return r}function O(e,t,i){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}function A(e,t,i,n,r,o){if(!s.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<o)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}function P(e,t,i,n,r,o){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function D(e,t,i,r,o){return t=+t,i>>>=0,o||P(e,0,i,4),n.write(e,t,i,r,23,4),i+4}function x(e,t,i,r,o){return t=+t,i>>>=0,o||P(e,0,i,8),n.write(e,t,i,r,52,8),i+8}s.prototype.slice=function(e,t){var i=this.length;(e=~~e)<0?(e+=i)<0&&(e=0):e>i&&(e=i),(t=void 0===t?i:~~t)<0?(t+=i)<0&&(t=0):t>i&&(t=i),t<e&&(t=e);var n=this.subarray(e,t);return n.__proto__=s.prototype,n},s.prototype.readUIntLE=function(e,t,i){e>>>=0,t>>>=0,i||O(e,t,this.length);for(var n=this[e],r=1,o=0;++o<t&&(r*=256);)n+=this[e+o]*r;return n},s.prototype.readUIntBE=function(e,t,i){e>>>=0,t>>>=0,i||O(e,t,this.length);for(var n=this[e+--t],r=1;t>0&&(r*=256);)n+=this[e+--t]*r;return n},s.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},s.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},s.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},s.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},s.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},s.prototype.readIntLE=function(e,t,i){e>>>=0,t>>>=0,i||O(e,t,this.length);for(var n=this[e],r=1,o=0;++o<t&&(r*=256);)n+=this[e+o]*r;return n>=(r*=128)&&(n-=Math.pow(2,8*t)),n},s.prototype.readIntBE=function(e,t,i){e>>>=0,t>>>=0,i||O(e,t,this.length);for(var n=t,r=1,o=this[e+--n];n>0&&(r*=256);)o+=this[e+--n]*r;return o>=(r*=128)&&(o-=Math.pow(2,8*t)),o},s.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},s.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);var i=this[e]|this[e+1]<<8;return 32768&i?4294901760|i:i},s.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);var i=this[e+1]|this[e]<<8;return 32768&i?4294901760|i:i},s.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},s.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},s.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),n.read(this,e,!0,23,4)},s.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),n.read(this,e,!1,23,4)},s.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),n.read(this,e,!0,52,8)},s.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),n.read(this,e,!1,52,8)},s.prototype.writeUIntLE=function(e,t,i,n){(e=+e,t>>>=0,i>>>=0,n)||A(this,e,t,i,Math.pow(2,8*i)-1,0);var r=1,o=0;for(this[t]=255&e;++o<i&&(r*=256);)this[t+o]=e/r&255;return t+i},s.prototype.writeUIntBE=function(e,t,i,n){(e=+e,t>>>=0,i>>>=0,n)||A(this,e,t,i,Math.pow(2,8*i)-1,0);var r=i-1,o=1;for(this[t+r]=255&e;--r>=0&&(o*=256);)this[t+r]=e/o&255;return t+i},s.prototype.writeUInt8=function(e,t,i){return e=+e,t>>>=0,i||A(this,e,t,1,255,0),this[t]=255&e,t+1},s.prototype.writeUInt16LE=function(e,t,i){return e=+e,t>>>=0,i||A(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeUInt16BE=function(e,t,i){return e=+e,t>>>=0,i||A(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeUInt32LE=function(e,t,i){return e=+e,t>>>=0,i||A(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},s.prototype.writeUInt32BE=function(e,t,i){return e=+e,t>>>=0,i||A(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeIntLE=function(e,t,i,n){if(e=+e,t>>>=0,!n){var r=Math.pow(2,8*i-1);A(this,e,t,i,r-1,-r)}var o=0,s=1,a=0;for(this[t]=255&e;++o<i&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+i},s.prototype.writeIntBE=function(e,t,i,n){if(e=+e,t>>>=0,!n){var r=Math.pow(2,8*i-1);A(this,e,t,i,r-1,-r)}var o=i-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s>>0)-a&255;return t+i},s.prototype.writeInt8=function(e,t,i){return e=+e,t>>>=0,i||A(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},s.prototype.writeInt16LE=function(e,t,i){return e=+e,t>>>=0,i||A(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},s.prototype.writeInt16BE=function(e,t,i){return e=+e,t>>>=0,i||A(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},s.prototype.writeInt32LE=function(e,t,i){return e=+e,t>>>=0,i||A(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},s.prototype.writeInt32BE=function(e,t,i){return e=+e,t>>>=0,i||A(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},s.prototype.writeFloatLE=function(e,t,i){return D(this,e,t,!0,i)},s.prototype.writeFloatBE=function(e,t,i){return D(this,e,t,!1,i)},s.prototype.writeDoubleLE=function(e,t,i){return x(this,e,t,!0,i)},s.prototype.writeDoubleBE=function(e,t,i){return x(this,e,t,!1,i)},s.prototype.copy=function(e,t,i,n){if(!s.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<i&&(n=i),n===i)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-i&&(n=e.length-t+i);var r=n-i;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,i,n);else if(this===e&&i<t&&t<n)for(var o=r-1;o>=0;--o)e[o+t]=this[o+i];else Uint8Array.prototype.set.call(e,this.subarray(i,n),t);return r},s.prototype.fill=function(e,t,i,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,i=this.length):"string"==typeof i&&(n=i,i=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var r=e.charCodeAt(0);("utf8"===n&&r<128||"latin1"===n)&&(e=r)}}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<i)throw new RangeError("Out of range index");if(i<=t)return this;var o;if(t>>>=0,i=void 0===i?this.length:i>>>0,e||(e=0),"number"==typeof e)for(o=t;o<i;++o)this[o]=e;else{var a=s.isBuffer(e)?e:s.from(e,n),c=a.length;if(0===c)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<i-t;++o)this[o+t]=a[o%c]}return this};var L=/[^+/0-9A-Za-z-_]/g;function U(e){return e<16?"0"+e.toString(16):e.toString(16)}function N(e,t){var i;t=t||1/0;for(var n=e.length,r=null,o=[],s=0;s<n;++s){if((i=e.charCodeAt(s))>55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&o.push(239,191,189),r=i;continue}i=65536+(r-55296<<10|i-56320)}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;o.push(i)}else if(i<2048){if((t-=2)<0)break;o.push(i>>6|192,63&i|128)}else if(i<65536){if((t-=3)<0)break;o.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return o}function B(e){return t.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,i,n){for(var r=0;r<n&&!(r+i>=t.length||r>=e.length);++r)t[r+i]=e[r];return r}function F(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function K(e){return e!=e}}).call(this)}).call(this,e("buffer").Buffer)},{"base64-js":17,buffer:68,ieee754:150}],69:[function(e,t,i){"use strict";var n=e("get-intrinsic"),r=e("./"),o=r(n("String.prototype.indexOf"));t.exports=function(e,t){var i=n(e,!!t);return"function"==typeof i&&o(e,".prototype.")>-1?r(i):i}},{"./":70,"get-intrinsic":114}],70:[function(e,t,i){"use strict";var n=e("function-bind"),r=e("get-intrinsic"),o=r("%Function.prototype.apply%"),s=r("%Function.prototype.call%"),a=r("%Reflect.apply%",!0)||n.call(s,o),c=r("%Object.getOwnPropertyDescriptor%",!0),d=r("%Object.defineProperty%",!0),l=r("%Math.max%");if(d)try{d({},"a",{value:1})}catch(e){d=null}t.exports=function(e){var t=a(n,s,arguments);c&&d&&(c(t,"length").configurable&&d(t,"length",{value:1+l(0,e.length-(arguments.length-1))}));return t};var u=function(){return a(n,o,arguments)};d?d(t.exports,"apply",{value:u}):t.exports.apply=u},{"function-bind":113,"get-intrinsic":114}],71:[function(e,t,i){var n=e("safe-buffer").Buffer,r=e("stream").Transform,o=e("string_decoder").StringDecoder;function s(e){r.call(this),this.hashMode="string"==typeof e,this.hashMode?this[e]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}e("inherits")(s,r),s.prototype.update=function(e,t,i){"string"==typeof e&&(e=n.from(e,t));var r=this._update(e);return this.hashMode?this:(i&&(r=this._toString(r,i)),r)},s.prototype.setAutoPadding=function(){},s.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},s.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},s.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},s.prototype._transform=function(e,t,i){var n;try{this.hashMode?this._update(e):this.push(this._update(e))}catch(e){n=e}finally{i(n)}},s.prototype._flush=function(e){var t;try{this.push(this.__final())}catch(e){t=e}e(t)},s.prototype._finalOrDigest=function(e){var t=this.__final()||n.alloc(0);return e&&(t=this._toString(t,e,!0)),t},s.prototype._toString=function(e,t,i){if(this._decoder||(this._decoder=new o(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var n=this._decoder.write(e);return i&&(n+=this._decoder.end()),n},t.exports=s},{inherits:151,"safe-buffer":260,stream:274,string_decoder:289}],72:[function(e,t,i){ | |
/*! | |
* content-type | |
* Copyright(c) 2015 Douglas Christopher Wilson | |
* MIT Licensed | |
*/ | |
"use strict";var n=/; *([!#$%&'*+.^_`|~0-9A-Za-z-]+) *= *("(?:[\u000b\u0020\u0021\u0023-\u005b\u005d-\u007e\u0080-\u00ff]|\\[\u000b\u0020-\u00ff])*"|[!#$%&'*+.^_`|~0-9A-Za-z-]+) */g,r=/^[\u000b\u0020-\u007e\u0080-\u00ff]+$/,o=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+$/,s=/\\([\u000b\u0020-\u00ff])/g,a=/([\\"])/g,c=/^[!#$%&'*+.^_`|~0-9A-Za-z-]+\/[!#$%&'*+.^_`|~0-9A-Za-z-]+$/;function d(e){var t=String(e);if(o.test(t))return t;if(t.length>0&&!r.test(t))throw new TypeError("invalid parameter value");return'"'+t.replace(a,"\\$1")+'"'}function l(e){this.parameters=Object.create(null),this.type=e}i.format=function(e){if(!e||"object"!=typeof e)throw new TypeError("argument obj is required");var t=e.parameters,i=e.type;if(!i||!c.test(i))throw new TypeError("invalid type");var n=i;if(t&&"object"==typeof t)for(var r,s=Object.keys(t).sort(),a=0;a<s.length;a++){if(r=s[a],!o.test(r))throw new TypeError("invalid parameter name");n+="; "+r+"="+d(t[r])}return n},i.parse=function(e){if(!e)throw new TypeError("argument string is required");var t="object"==typeof e?function(e){var t;"function"==typeof e.getHeader?t=e.getHeader("content-type"):"object"==typeof e.headers&&(t=e.headers&&e.headers["content-type"]);if("string"!=typeof t)throw new TypeError("content-type header is missing from object");return t}(e):e;if("string"!=typeof t)throw new TypeError("argument string is required to be a string");var i=t.indexOf(";"),r=-1!==i?t.slice(0,i).trim():t.trim();if(!c.test(r))throw new TypeError("invalid media type");var o=new l(r.toLowerCase());if(-1!==i){var a,d,u;for(n.lastIndex=i;d=n.exec(t);){if(d.index!==i)throw new TypeError("invalid parameter format");i+=d[0].length,a=d[1].toLowerCase(),34===(u=d[2]).charCodeAt(0)&&-1!==(u=u.slice(1,-1)).indexOf("\\")&&(u=u.replace(s,"$1")),o.parameters[a]=u}if(i!==t.length)throw new TypeError("invalid parameter format")}return o}},{}],73:[function(e,t,i){(function(i){(function(){var n=e("elliptic"),r=e("bn.js");t.exports=function(e){return new s(e)};var o={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};function s(e){this.curveType=o[e],this.curveType||(this.curveType={name:e}),this.curve=new n.ec(this.curveType.name),this.keys=void 0}function a(e,t,n){Array.isArray(e)||(e=e.toArray());var r=new i(e);if(n&&r.length<n){var o=new i(n-r.length);o.fill(0),r=i.concat([o,r])}return t?r.toString(t):r}o.p224=o.secp224r1,o.p256=o.secp256r1=o.prime256v1,o.p192=o.secp192r1=o.prime192v1,o.p384=o.secp384r1,o.p521=o.secp521r1,s.prototype.generateKeys=function(e,t){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,t)},s.prototype.computeSecret=function(e,t,n){return t=t||"utf8",i.isBuffer(e)||(e=new i(e,t)),a(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),n,this.curveType.byteLength)},s.prototype.getPublicKey=function(e,t){var i=this.keys.getPublic("compressed"===t,!0);return"hybrid"===t&&(i[i.length-1]%2?i[0]=7:i[0]=6),a(i,e)},s.prototype.getPrivateKey=function(e){return a(this.keys.getPrivate(),e)},s.prototype.setPublicKey=function(e,t){return t=t||"utf8",i.isBuffer(e)||(e=new i(e,t)),this.keys._importPublic(e),this},s.prototype.setPrivateKey=function(e,t){t=t||"utf8",i.isBuffer(e)||(e=new i(e,t));var n=new r(e);return n=n.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(n),this}}).call(this)}).call(this,e("buffer").Buffer)},{"bn.js":18,buffer:68,elliptic:93}],74:[function(e,t,i){"use strict";var n=e("inherits"),r=e("md5.js"),o=e("ripemd160"),s=e("sha.js"),a=e("cipher-base");function c(e){a.call(this,"digest"),this._hash=e}n(c,a),c.prototype._update=function(e){this._hash.update(e)},c.prototype._final=function(){return this._hash.digest()},t.exports=function(e){return"md5"===(e=e.toLowerCase())?new r:"rmd160"===e||"ripemd160"===e?new o:new c(s(e))}},{"cipher-base":71,inherits:151,"md5.js":230,ripemd160:259,"sha.js":267}],75:[function(e,t,i){var n=e("md5.js");t.exports=function(e){return(new n).update(e).digest()}},{"md5.js":230}],76:[function(e,t,i){"use strict";var n=e("inherits"),r=e("./legacy"),o=e("cipher-base"),s=e("safe-buffer").Buffer,a=e("create-hash/md5"),c=e("ripemd160"),d=e("sha.js"),l=s.alloc(128);function u(e,t){o.call(this,"digest"),"string"==typeof t&&(t=s.from(t));var i="sha512"===e||"sha384"===e?128:64;(this._alg=e,this._key=t,t.length>i)?t=("rmd160"===e?new c:d(e)).update(t).digest():t.length<i&&(t=s.concat([t,l],i));for(var n=this._ipad=s.allocUnsafe(i),r=this._opad=s.allocUnsafe(i),a=0;a<i;a++)n[a]=54^t[a],r[a]=92^t[a];this._hash="rmd160"===e?new c:d(e),this._hash.update(n)}n(u,o),u.prototype._update=function(e){this._hash.update(e)},u.prototype._final=function(){var e=this._hash.digest();return("rmd160"===this._alg?new c:d(this._alg)).update(this._opad).update(e).digest()},t.exports=function(e,t){return"rmd160"===(e=e.toLowerCase())||"ripemd160"===e?new u("rmd160",t):"md5"===e?new r(a,t):new u(e,t)}},{"./legacy":77,"cipher-base":71,"create-hash/md5":75,inherits:151,ripemd160:259,"safe-buffer":260,"sha.js":267}],77:[function(e,t,i){"use strict";var n=e("inherits"),r=e("safe-buffer").Buffer,o=e("cipher-base"),s=r.alloc(128),a=64;function c(e,t){o.call(this,"digest"),"string"==typeof t&&(t=r.from(t)),this._alg=e,this._key=t,t.length>a?t=e(t):t.length<a&&(t=r.concat([t,s],a));for(var i=this._ipad=r.allocUnsafe(a),n=this._opad=r.allocUnsafe(a),c=0;c<a;c++)i[c]=54^t[c],n[c]=92^t[c];this._hash=[i]}n(c,o),c.prototype._update=function(e){this._hash.push(e)},c.prototype._final=function(){var e=this._alg(r.concat(this._hash));return this._alg(r.concat([this._opad,e]))},t.exports=c},{"cipher-base":71,inherits:151,"safe-buffer":260}],78:[function(e,t,i){"use strict";i.randomBytes=i.rng=i.pseudoRandomBytes=i.prng=e("randombytes"),i.createHash=i.Hash=e("create-hash"),i.createHmac=i.Hmac=e("create-hmac");var n=e("browserify-sign/algos"),r=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(r);i.getHashes=function(){return o};var s=e("pbkdf2");i.pbkdf2=s.pbkdf2,i.pbkdf2Sync=s.pbkdf2Sync;var a=e("browserify-cipher");i.Cipher=a.Cipher,i.createCipher=a.createCipher,i.Cipheriv=a.Cipheriv,i.createCipheriv=a.createCipheriv,i.Decipher=a.Decipher,i.createDecipher=a.createDecipher,i.Decipheriv=a.Decipheriv,i.createDecipheriv=a.createDecipheriv,i.getCiphers=a.getCiphers,i.listCiphers=a.listCiphers;var c=e("diffie-hellman");i.DiffieHellmanGroup=c.DiffieHellmanGroup,i.createDiffieHellmanGroup=c.createDiffieHellmanGroup,i.getDiffieHellman=c.getDiffieHellman,i.createDiffieHellman=c.createDiffieHellman,i.DiffieHellman=c.DiffieHellman;var d=e("browserify-sign");i.createSign=d.createSign,i.Sign=d.Sign,i.createVerify=d.createVerify,i.Verify=d.Verify,i.createECDH=e("create-ecdh");var l=e("public-encrypt");i.publicEncrypt=l.publicEncrypt,i.privateEncrypt=l.privateEncrypt,i.publicDecrypt=l.publicDecrypt,i.privateDecrypt=l.privateDecrypt;var u=e("randomfill");i.randomFill=u.randomFill,i.randomFillSync=u.randomFillSync,i.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},i.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},{"browserify-cipher":38,"browserify-sign":46,"browserify-sign/algos":43,"create-ecdh":73,"create-hash":74,"create-hmac":76,"diffie-hellman":89,pbkdf2:241,"public-encrypt":248,randombytes:254,randomfill:255}],79:[function(e,t,i){(function(n){(function(){var r,o;r=this,o=function(){var t=t||function(t,i){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==n&&n.crypto&&(r=n.crypto),!r&&"function"==typeof e)try{r=e("crypto")}catch(e){}var o=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function e(){}return function(t){var i;return e.prototype=t,i=new e,e.prototype=null,i}}(),a={},c=a.lib={},d=c.Base={extend:function(e){var t=s(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.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)}},l=c.WordArray=d.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||h).stringify(this)},concat:function(e){var t=this.words,i=e.words,n=this.sigBytes,r=e.sigBytes;if(this.clamp(),n%4)for(var o=0;o<r;o++){var s=i[o>>>2]>>>24-o%4*8&255;t[n+o>>>2]|=s<<24-(n+o)%4*8}else for(var a=0;a<r;a+=4)t[n+a>>>2]=i[a>>>2];return this.sigBytes+=r,this},clamp:function(){var e=this.words,i=this.sigBytes;e[i>>>2]&=4294967295<<32-i%4*8,e.length=t.ceil(i/4)},clone:function(){var e=d.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],i=0;i<e;i+=4)t.push(o());return new l.init(t,e)}}),u=a.enc={},h=u.Hex={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r++){var o=t[r>>>2]>>>24-r%4*8&255;n.push((o>>>4).toString(16)),n.push((15&o).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n+=2)i[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new l.init(i,t/2)}},f=u.Latin1={stringify:function(e){for(var t=e.words,i=e.sigBytes,n=[],r=0;r<i;r++){var o=t[r>>>2]>>>24-r%4*8&255;n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,i=[],n=0;n<t;n++)i[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new l.init(i,t)}},p=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},g=c.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var i,n=this._data,r=n.words,o=n.sigBytes,s=this.blockSize,a=o/(4*s),c=(a=e?t.ceil(a):t.max((0|a)-this._minBufferSize,0))*s,d=t.min(4*c,o);if(c){for(var u=0;u<c;u+=s)this._doProcessBlock(r,u);i=r.splice(0,c),n.sigBytes-=d}return new l.init(i,d)},clone:function(){var e=d.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),v=(c.Hasher=g.extend({cfg:d.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){g.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,i){return new e.init(i).finalize(t)}},_createHmacHelper:function(e){return function(t,i){return new v.HMAC.init(e,i).finalize(t)}}}),a.algo={});return a}(Math);return t},"object"==typeof i?t.exports=i=o():"function"==typeof define&&define.amd?define([],o):r.CryptoJS=o()}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{crypto:20}],80:[function(e,t,i){var n,r;n=this,r=function(e){var t,i;return i=(t=e).lib.WordArray,t.enc.Base64={stringify:function(e){var t=e.words,i=e.sigBytes,n=this._map;e.clamp();for(var r=[],o=0;o<i;o+=3)for(var s=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,a=0;a<4&&o+.75*a<i;a++)r.push(n.charAt(s>>>6*(3-a)&63));var c=n.charAt(64);if(c)for(;r.length%4;)r.push(c);return r.join("")},parse:function(e){var t=e.length,n=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var o=0;o<n.length;o++)r[n.charCodeAt(o)]=o}var s=n.charAt(64);if(s){var a=e.indexOf(s);-1!==a&&(t=a)}return function(e,t,n){for(var r=[],o=0,s=0;s<t;s++)if(s%4){var a=n[e.charCodeAt(s-1)]<<s%4*2|n[e.charCodeAt(s)]>>>6-s%4*2;r[o>>>2]|=a<<24-o%4*8,o++}return i.create(r,o)}(e,t,r)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},e.enc.Base64},"object"==typeof i?t.exports=i=r(e("./core")):"function"==typeof define&&define.amd?define(["./core"],r):r(n.CryptoJS)},{"./core":79}],81:[function(e,t,i){var n,r;n=this,r=function(e){return e.enc.Utf8},"object"==typeof i?t.exports=i=r(e("./core")):"function"==typeof define&&define.amd?define(["./core"],r):r(n.CryptoJS)},{"./core":79}],82:[function(e,t,i){var n,r;n=this,r=function(e){return function(t){var i=e,n=i.lib,r=n.WordArray,o=n.Hasher,s=i.algo,a=[],c=[];!function(){function e(e){for(var i=t.sqrt(e),n=2;n<=i;n++)if(!(e%n))return!1;return!0}function i(e){return 4294967296*(e-(0|e))|0}for(var n=2,r=0;r<64;)e(n)&&(r<8&&(a[r]=i(t.pow(n,.5))),c[r]=i(t.pow(n,1/3)),r++),n++}();var d=[],l=s.SHA256=o.extend({_doReset:function(){this._hash=new r.init(a.slice(0))},_doProcessBlock:function(e,t){for(var i=this._hash.words,n=i[0],r=i[1],o=i[2],s=i[3],a=i[4],l=i[5],u=i[6],h=i[7],f=0;f<64;f++){if(f<16)d[f]=0|e[t+f];else{var p=d[f-15],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,v=d[f-2],m=(v<<15|v>>>17)^(v<<13|v>>>19)^v>>>10;d[f]=g+d[f-7]+m+d[f-16]}var y=n&r^n&o^r&o,b=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),_=h+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&l^~a&u)+c[f]+d[f];h=u,u=l,l=a,a=s+_|0,s=o,o=r,r=n,n=_+(b+y)|0}i[0]=i[0]+n|0,i[1]=i[1]+r|0,i[2]=i[2]+o|0,i[3]=i[3]+s|0,i[4]=i[4]+a|0,i[5]=i[5]+l|0,i[6]=i[6]+u|0,i[7]=i[7]+h|0},_doFinalize:function(){var e=this._data,i=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return i[r>>>5]|=128<<24-r%32,i[14+(r+64>>>9<<4)]=t.floor(n/4294967296),i[15+(r+64>>>9<<4)]=n,e.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});i.SHA256=o._createHelper(l),i.HmacSHA256=o._createHmacHelper(l)}(Math),e.SHA256},"object"==typeof i?t.exports=i=r(e("./core")):"function"==typeof define&&define.amd?define(["./core"],r):r(n.CryptoJS)},{"./core":79}],83:[function(e,t,i){"use strict";i.utils=e("./des/utils"),i.Cipher=e("./des/cipher"),i.DES=e("./des/des"),i.CBC=e("./des/cbc"),i.EDE=e("./des/ede")},{"./des/cbc":84,"./des/cipher":85,"./des/des":86,"./des/ede":87,"./des/utils":88}],84:[function(e,t,i){"use strict";var n=e("minimalistic-assert"),r=e("inherits"),o={};function s(e){n.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}i.instantiate=function(e){function t(t){e.call(this,t),this._cbcInit()}r(t,e);for(var i=Object.keys(o),n=0;n<i.length;n++){var s=i[n];t.prototype[s]=o[s]}return t.create=function(e){return new t(e)},t},o._cbcInit=function(){var e=new s(this.options.iv);this._cbcState=e},o._update=function(e,t,i,n){var r=this._cbcState,o=this.constructor.super_.prototype,s=r.iv;if("encrypt"===this.type){for(var a=0;a<this.blockSize;a++)s[a]^=e[t+a];o._update.call(this,s,0,i,n);for(a=0;a<this.blockSize;a++)s[a]=i[n+a]}else{o._update.call(this,e,t,i,n);for(a=0;a<this.blockSize;a++)i[n+a]^=s[a];for(a=0;a<this.blockSize;a++)s[a]=e[t+a]}}},{inherits:151,"minimalistic-assert":232}],85:[function(e,t,i){"use strict";var n=e("minimalistic-assert");function r(e){this.options=e,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=!1!==e.padding}t.exports=r,r.prototype._init=function(){},r.prototype.update=function(e){return 0===e.length?[]:"decrypt"===this.type?this._updateDecrypt(e):this._updateEncrypt(e)},r.prototype._buffer=function(e,t){for(var i=Math.min(this.buffer.length-this.bufferOff,e.length-t),n=0;n<i;n++)this.buffer[this.bufferOff+n]=e[t+n];return this.bufferOff+=i,i},r.prototype._flushBuffer=function(e,t){return this._update(this.buffer,0,e,t),this.bufferOff=0,this.blockSize},r.prototype._updateEncrypt=function(e){var t=0,i=0,n=(this.bufferOff+e.length)/this.blockSize|0,r=new Array(n*this.blockSize);0!==this.bufferOff&&(t+=this._buffer(e,t),this.bufferOff===this.buffer.length&&(i+=this._flushBuffer(r,i)));for(var o=e.length-(e.length-t)%this.blockSize;t<o;t+=this.blockSize)this._update(e,t,r,i),i+=this.blockSize;for(;t<e.length;t++,this.bufferOff++)this.buffer[this.bufferOff]=e[t];return r},r.prototype._updateDecrypt=function(e){for(var t=0,i=0,n=Math.ceil((this.bufferOff+e.length)/this.blockSize)-1,r=new Array(n*this.blockSize);n>0;n--)t+=this._buffer(e,t),i+=this._flushBuffer(r,i);return t+=this._buffer(e,t),r},r.prototype.final=function(e){var t,i;return e&&(t=this.update(e)),i="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(i):i},r.prototype._pad=function(e,t){if(0===t)return!1;for(;t<e.length;)e[t++]=0;return!0},r.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var e=new Array(this.blockSize);return this._update(this.buffer,0,e,0),e},r.prototype._unpad=function(e){return e},r.prototype._finalDecrypt=function(){n.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var e=new Array(this.blockSize);return this._flushBuffer(e,0),this._unpad(e)}},{"minimalistic-assert":232}],86:[function(e,t,i){"use strict";var n=e("minimalistic-assert"),r=e("inherits"),o=e("./utils"),s=e("./cipher");function a(){this.tmp=new Array(2),this.keys=null}function c(e){s.call(this,e);var t=new a;this._desState=t,this.deriveKeys(t,e.key)}r(c,s),t.exports=c,c.create=function(e){return new c(e)};var d=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];c.prototype.deriveKeys=function(e,t){e.keys=new Array(32),n.equal(t.length,this.blockSize,"Invalid key length");var i=o.readUInt32BE(t,0),r=o.readUInt32BE(t,4);o.pc1(i,r,e.tmp,0),i=e.tmp[0],r=e.tmp[1];for(var s=0;s<e.keys.length;s+=2){var a=d[s>>>1];i=o.r28shl(i,a),r=o.r28shl(r,a),o.pc2(i,r,e.keys,s)}},c.prototype._update=function(e,t,i,n){var r=this._desState,s=o.readUInt32BE(e,t),a=o.readUInt32BE(e,t+4);o.ip(s,a,r.tmp,0),s=r.tmp[0],a=r.tmp[1],"encrypt"===this.type?this._encrypt(r,s,a,r.tmp,0):this._decrypt(r,s,a,r.tmp,0),s=r.tmp[0],a=r.tmp[1],o.writeUInt32BE(i,s,n),o.writeUInt32BE(i,a,n+4)},c.prototype._pad=function(e,t){if(!1===this.padding)return!1;for(var i=e.length-t,n=t;n<e.length;n++)e[n]=i;return!0},c.prototype._unpad=function(e){if(!1===this.padding)return e;for(var t=e[e.length-1],i=e.length-t;i<e.length;i++)n.equal(e[i],t);return e.slice(0,e.length-t)},c.prototype._encrypt=function(e,t,i,n,r){for(var s=t,a=i,c=0;c<e.keys.length;c+=2){var d=e.keys[c],l=e.keys[c+1];o.expand(a,e.tmp,0),d^=e.tmp[0],l^=e.tmp[1];var u=o.substitute(d,l),h=a;a=(s^o.permute(u))>>>0,s=h}o.rip(a,s,n,r)},c.prototype._decrypt=function(e,t,i,n,r){for(var s=i,a=t,c=e.keys.length-2;c>=0;c-=2){var d=e.keys[c],l=e.keys[c+1];o.expand(s,e.tmp,0),d^=e.tmp[0],l^=e.tmp[1];var u=o.substitute(d,l),h=s;s=(a^o.permute(u))>>>0,a=h}o.rip(s,a,n,r)}},{"./cipher":85,"./utils":88,inherits:151,"minimalistic-assert":232}],87:[function(e,t,i){"use strict";var n=e("minimalistic-assert"),r=e("inherits"),o=e("./cipher"),s=e("./des");function a(e,t){n.equal(t.length,24,"Invalid key length");var i=t.slice(0,8),r=t.slice(8,16),o=t.slice(16,24);this.ciphers="encrypt"===e?[s.create({type:"encrypt",key:i}),s.create({type:"decrypt",key:r}),s.create({type:"encrypt",key:o})]:[s.create({type:"decrypt",key:o}),s.create({type:"encrypt",key:r}),s.create({type:"decrypt",key:i})]}function c(e){o.call(this,e);var t=new a(this.type,this.options.key);this._edeState=t}r(c,o),t.exports=c,c.create=function(e){return new c(e)},c.prototype._update=function(e,t,i,n){var r=this._edeState;r.ciphers[0]._update(e,t,i,n),r.ciphers[1]._update(i,n,i,n),r.ciphers[2]._update(i,n,i,n)},c.prototype._pad=s.prototype._pad,c.prototype._unpad=s.prototype._unpad},{"./cipher":85,"./des":86,inherits:151,"minimalistic-assert":232}],88:[function(e,t,i){"use strict";i.readUInt32BE=function(e,t){return(e[0+t]<<24|e[1+t]<<16|e[2+t]<<8|e[3+t])>>>0},i.writeUInt32BE=function(e,t,i){e[0+i]=t>>>24,e[1+i]=t>>>16&255,e[2+i]=t>>>8&255,e[3+i]=255&t},i.ip=function(e,t,i,n){for(var r=0,o=0,s=6;s>=0;s-=2){for(var a=0;a<=24;a+=8)r<<=1,r|=t>>>a+s&1;for(a=0;a<=24;a+=8)r<<=1,r|=e>>>a+s&1}for(s=6;s>=0;s-=2){for(a=1;a<=25;a+=8)o<<=1,o|=t>>>a+s&1;for(a=1;a<=25;a+=8)o<<=1,o|=e>>>a+s&1}i[n+0]=r>>>0,i[n+1]=o>>>0},i.rip=function(e,t,i,n){for(var r=0,o=0,s=0;s<4;s++)for(var a=24;a>=0;a-=8)r<<=1,r|=t>>>a+s&1,r<<=1,r|=e>>>a+s&1;for(s=4;s<8;s++)for(a=24;a>=0;a-=8)o<<=1,o|=t>>>a+s&1,o<<=1,o|=e>>>a+s&1;i[n+0]=r>>>0,i[n+1]=o>>>0},i.pc1=function(e,t,i,n){for(var r=0,o=0,s=7;s>=5;s--){for(var a=0;a<=24;a+=8)r<<=1,r|=t>>a+s&1;for(a=0;a<=24;a+=8)r<<=1,r|=e>>a+s&1}for(a=0;a<=24;a+=8)r<<=1,r|=t>>a+s&1;for(s=1;s<=3;s++){for(a=0;a<=24;a+=8)o<<=1,o|=t>>a+s&1;for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1}for(a=0;a<=24;a+=8)o<<=1,o|=e>>a+s&1;i[n+0]=r>>>0,i[n+1]=o>>>0},i.r28shl=function(e,t){return e<<t&268435455|e>>>28-t};var n=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];i.pc2=function(e,t,i,r){for(var o=0,s=0,a=n.length>>>1,c=0;c<a;c++)o<<=1,o|=e>>>n[c]&1;for(c=a;c<n.length;c++)s<<=1,s|=t>>>n[c]&1;i[r+0]=o>>>0,i[r+1]=s>>>0},i.expand=function(e,t,i){var n=0,r=0;n=(1&e)<<5|e>>>27;for(var o=23;o>=15;o-=4)n<<=6,n|=e>>>o&63;for(o=11;o>=3;o-=4)r|=e>>>o&63,r<<=6;r|=(31&e)<<1|e>>>31,t[i+0]=n>>>0,t[i+1]=r>>>0};var r=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];i.substitute=function(e,t){for(var i=0,n=0;n<4;n++){i<<=4,i|=r[64*n+(e>>>18-6*n&63)]}for(n=0;n<4;n++){i<<=4,i|=r[256+64*n+(t>>>18-6*n&63)]}return i>>>0};var o=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];i.permute=function(e){for(var t=0,i=0;i<o.length;i++)t<<=1,t|=e>>>o[i]&1;return t>>>0},i.padSplit=function(e,t,i){for(var n=e.toString(2);n.length<t;)n="0"+n;for(var r=[],o=0;o<t;o+=i)r.push(n.slice(o,o+i));return r.join(" ")}},{}],89:[function(e,t,i){(function(t){(function(){var n=e("./lib/generatePrime"),r=e("./lib/primes.json"),o=e("./lib/dh");var s={binary:!0,hex:!0,base64:!0};i.DiffieHellmanGroup=i.createDiffieHellmanGroup=i.getDiffieHellman=function(e){var i=new t(r[e].prime,"hex"),n=new t(r[e].gen,"hex");return new o(i,n)},i.createDiffieHellman=i.DiffieHellman=function e(i,r,a,c){return t.isBuffer(r)||void 0===s[r]?e(i,"binary",r,a):(r=r||"binary",c=c||"binary",a=a||new t([2]),t.isBuffer(a)||(a=new t(a,c)),"number"==typeof i?new o(n(i,a),a,!0):(t.isBuffer(i)||(i=new t(i,r)),new o(i,a,!0)))}}).call(this)}).call(this,e("buffer").Buffer)},{"./lib/dh":90,"./lib/generatePrime":91,"./lib/primes.json":92,buffer:68}],90:[function(e,t,i){(function(i){(function(){var n=e("bn.js"),r=new(e("miller-rabin")),o=new n(24),s=new n(11),a=new n(10),c=new n(3),d=new n(7),l=e("./generatePrime"),u=e("randombytes");function h(e,t){return t=t||"utf8",i.isBuffer(e)||(e=new i(e,t)),this._pub=new n(e),this}function f(e,t){return t=t||"utf8",i.isBuffer(e)||(e=new i(e,t)),this._priv=new n(e),this}t.exports=g;var p={};function g(e,t,i){this.setGenerator(t),this.__prime=new n(e),this._prime=n.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,i?(this.setPublicKey=h,this.setPrivateKey=f):this._primeCode=8}function v(e,t){var n=new i(e.toArray());return t?n.toString(t):n}Object.defineProperty(g.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var i=t.toString("hex"),n=[i,e.toString(16)].join("_");if(n in p)return p[n];var u,h=0;if(e.isEven()||!l.simpleSieve||!l.fermatTest(e)||!r.test(e))return h+=1,h+="02"===i||"05"===i?8:4,p[n]=h,h;switch(r.test(e.shrn(1))||(h+=2),i){case"02":e.mod(o).cmp(s)&&(h+=8);break;case"05":(u=e.mod(a)).cmp(c)&&u.cmp(d)&&(h+=8);break;default:h+=4}return p[n]=h,h}(this.__prime,this.__gen)),this._primeCode}}),g.prototype.generateKeys=function(){return this._priv||(this._priv=new n(u(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},g.prototype.computeSecret=function(e){var t=(e=(e=new n(e)).toRed(this._prime)).redPow(this._priv).fromRed(),r=new i(t.toArray()),o=this.getPrime();if(r.length<o.length){var s=new i(o.length-r.length);s.fill(0),r=i.concat([s,r])}return r},g.prototype.getPublicKey=function(e){return v(this._pub,e)},g.prototype.getPrivateKey=function(e){return v(this._priv,e)},g.prototype.getPrime=function(e){return v(this.__prime,e)},g.prototype.getGenerator=function(e){return v(this._gen,e)},g.prototype.setGenerator=function(e,t){return t=t||"utf8",i.isBuffer(e)||(e=new i(e,t)),this.__gen=e,this._gen=new n(e),this}}).call(this)}).call(this,e("buffer").Buffer)},{"./generatePrime":91,"bn.js":18,buffer:68,"miller-rabin":231,randombytes:254}],91:[function(e,t,i){var n=e("randombytes");t.exports=y,y.simpleSieve=v,y.fermatTest=m;var r=e("bn.js"),o=new r(24),s=new(e("miller-rabin")),a=new r(1),c=new r(2),d=new r(5),l=(new r(16),new r(8),new r(10)),u=new r(3),h=(new r(7),new r(11)),f=new r(4),p=(new r(12),null);function g(){if(null!==p)return p;var e=[];e[0]=2;for(var t=1,i=3;i<1048576;i+=2){for(var n=Math.ceil(Math.sqrt(i)),r=0;r<t&&e[r]<=n&&i%e[r]!=0;r++);t!==r&&e[r]<=n||(e[t++]=i)}return p=e,e}function v(e){for(var t=g(),i=0;i<t.length;i++)if(0===e.modn(t[i]))return 0===e.cmpn(t[i]);return!0}function m(e){var t=r.mont(e);return 0===c.toRed(t).redPow(e.subn(1)).fromRed().cmpn(1)}function y(e,t){if(e<16)return new r(2===t||5===t?[140,123]:[140,39]);var i,p;for(t=new r(t);;){for(i=new r(n(Math.ceil(e/8)));i.bitLength()>e;)i.ishrn(1);if(i.isEven()&&i.iadd(a),i.testn(1)||i.iadd(c),t.cmp(c)){if(!t.cmp(d))for(;i.mod(l).cmp(u);)i.iadd(f)}else for(;i.mod(o).cmp(h);)i.iadd(f);if(v(p=i.shrn(1))&&v(i)&&m(p)&&m(i)&&s.test(p)&&s.test(i))return i}}},{"bn.js":18,"miller-rabin":231,randombytes:254}],92:[function(e,t,i){t.exports={modp1:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18:{gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}},{}],93:[function(e,t,i){"use strict";var n=i;n.version=e("../package.json").version,n.utils=e("./elliptic/utils"),n.rand=e("brorand"),n.curve=e("./elliptic/curve"),n.curves=e("./elliptic/curves"),n.ec=e("./elliptic/ec"),n.eddsa=e("./elliptic/eddsa")},{"../package.json":108,"./elliptic/curve":96,"./elliptic/curves":99,"./elliptic/ec":100,"./elliptic/eddsa":103,"./elliptic/utils":107,brorand:19}],94:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("../utils"),o=r.getNAF,s=r.getJSF,a=r.assert;function c(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function d(e,t){this.curve=e,this.type=t,this.precomputed=null}t.exports=c,c.prototype.point=function(){throw new Error("Not implemented")},c.prototype.validate=function(){throw new Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){a(e.precomputed);var i=e._getDoubles(),n=o(t,1,this._bitLength),r=(1<<i.step+1)-(i.step%2==0?2:1);r/=3;var s,c,d=[];for(s=0;s<n.length;s+=i.step){c=0;for(var l=s+i.step-1;l>=s;l--)c=(c<<1)+n[l];d.push(c)}for(var u=this.jpoint(null,null,null),h=this.jpoint(null,null,null),f=r;f>0;f--){for(s=0;s<d.length;s++)(c=d[s])===f?h=h.mixedAdd(i.points[s]):c===-f&&(h=h.mixedAdd(i.points[s].neg()));u=u.add(h)}return u.toP()},c.prototype._wnafMul=function(e,t){var i=4,n=e._getNAFPoints(i);i=n.wnd;for(var r=n.points,s=o(t,i,this._bitLength),c=this.jpoint(null,null,null),d=s.length-1;d>=0;d--){for(var l=0;d>=0&&0===s[d];d--)l++;if(d>=0&&l++,c=c.dblp(l),d<0)break;var u=s[d];a(0!==u),c="affine"===e.type?u>0?c.mixedAdd(r[u-1>>1]):c.mixedAdd(r[-u-1>>1].neg()):u>0?c.add(r[u-1>>1]):c.add(r[-u-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,i,n,r){var a,c,d,l=this._wnafT1,u=this._wnafT2,h=this._wnafT3,f=0;for(a=0;a<n;a++){var p=(d=t[a])._getNAFPoints(e);l[a]=p.wnd,u[a]=p.points}for(a=n-1;a>=1;a-=2){var g=a-1,v=a;if(1===l[g]&&1===l[v]){var m=[t[g],null,null,t[v]];0===t[g].y.cmp(t[v].y)?(m[1]=t[g].add(t[v]),m[2]=t[g].toJ().mixedAdd(t[v].neg())):0===t[g].y.cmp(t[v].y.redNeg())?(m[1]=t[g].toJ().mixedAdd(t[v]),m[2]=t[g].add(t[v].neg())):(m[1]=t[g].toJ().mixedAdd(t[v]),m[2]=t[g].toJ().mixedAdd(t[v].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],b=s(i[g],i[v]);for(f=Math.max(b[0].length,f),h[g]=new Array(f),h[v]=new Array(f),c=0;c<f;c++){var _=0|b[0][c],S=0|b[1][c];h[g][c]=y[3*(_+1)+(S+1)],h[v][c]=0,u[g]=m}}else h[g]=o(i[g],l[g],this._bitLength),h[v]=o(i[v],l[v],this._bitLength),f=Math.max(h[g].length,f),f=Math.max(h[v].length,f)}var E=this.jpoint(null,null,null),w=this._wnafT4;for(a=f;a>=0;a--){for(var T=0;a>=0;){var I=!0;for(c=0;c<n;c++)w[c]=0|h[c][a],0!==w[c]&&(I=!1);if(!I)break;T++,a--}if(a>=0&&T++,E=E.dblp(T),a<0)break;for(c=0;c<n;c++){var R=w[c];0!==R&&(R>0?d=u[c][R-1>>1]:R<0&&(d=u[c][-R-1>>1].neg()),E="affine"===d.type?E.mixedAdd(d):E.add(d))}}for(a=0;a<n;a++)u[a]=null;return r?E:E.toP()},c.BasePoint=d,d.prototype.eq=function(){throw new Error("Not implemented")},d.prototype.validate=function(){return this.curve.validate(this)},c.prototype.decodePoint=function(e,t){e=r.toArray(e,t);var i=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*i)return 6===e[0]?a(e[e.length-1]%2==0):7===e[0]&&a(e[e.length-1]%2==1),this.point(e.slice(1,1+i),e.slice(1+i,1+2*i));if((2===e[0]||3===e[0])&&e.length-1===i)return this.pointFromX(e.slice(1,1+i),3===e[0]);throw new Error("Unknown point format")},d.prototype.encodeCompressed=function(e){return this.encode(e,!0)},d.prototype._encode=function(e){var t=this.curve.p.byteLength(),i=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(i):[4].concat(i,this.getY().toArray("be",t))},d.prototype.encode=function(e,t){return r.encode(this._encode(t),e)},d.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},d.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},d.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var i=[this],n=this,r=0;r<t;r+=e){for(var o=0;o<e;o++)n=n.dbl();i.push(n)}return{step:e,points:i}},d.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],i=(1<<e)-1,n=1===i?null:this.dbl(),r=1;r<i;r++)t[r]=t[r-1].add(n);return{wnd:e,points:t}},d.prototype._getBeta=function(){return null},d.prototype.dblp=function(e){for(var t=this,i=0;i<e;i++)t=t.dbl();return t}},{"../utils":107,"bn.js":18}],95:[function(e,t,i){"use strict";var n=e("../utils"),r=e("bn.js"),o=e("inherits"),s=e("./base"),a=n.assert;function c(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new r(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new r(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new r(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function d(e,t,i,n,o){s.BasePoint.call(this,e,"projective"),null===t&&null===i&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new r(t,16),this.y=new r(i,16),this.z=n?new r(n,16):this.curve.one,this.t=o&&new r(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(c,s),t.exports=c,c.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},c.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},c.prototype.jpoint=function(e,t,i,n){return this.point(e,t,i,n)},c.prototype.pointFromX=function(e,t){(e=new r(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr(),n=this.c2.redSub(this.a.redMul(i)),o=this.one.redSub(this.c2.redMul(this.d).redMul(i)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");var c=a.fromRed().isOdd();return(t&&!c||!t&&c)&&(a=a.redNeg()),this.point(e,a)},c.prototype.pointFromY=function(e,t){(e=new r(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr(),n=i.redSub(this.c2),o=i.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw new Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},c.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),i=e.y.redSqr(),n=t.redMul(this.a).redAdd(i),r=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(i)));return 0===n.cmp(r)},o(d,s.BasePoint),c.prototype.pointFromJSON=function(e){return d.fromJSON(this,e)},c.prototype.point=function(e,t,i,n){return new d(this,e,t,i,n)},d.fromJSON=function(e,t){return new d(e,t[0],t[1],t[2])},d.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},d.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},d.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr();i=i.redIAdd(i);var n=this.curve._mulA(e),r=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),s=o.redSub(i),a=n.redSub(t),c=r.redMul(s),d=o.redMul(a),l=r.redMul(a),u=s.redMul(o);return this.curve.point(c,d,u,l)},d.prototype._projDbl=function(){var e,t,i,n,r,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var d=(n=this.curve._mulA(a)).redAdd(c);this.zOne?(e=s.redSub(a).redSub(c).redMul(d.redSub(this.curve.two)),t=d.redMul(n.redSub(c)),i=d.redSqr().redSub(d).redSub(d)):(r=this.z.redSqr(),o=d.redSub(r).redISub(r),e=s.redSub(a).redISub(c).redMul(o),t=d.redMul(n.redSub(c)),i=d.redMul(o))}else n=a.redAdd(c),r=this.curve._mulC(this.z).redSqr(),o=n.redSub(r).redSub(r),e=this.curve._mulC(s.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(a.redISub(c)),i=n.redMul(o);return this.curve.point(e,t,i)},d.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},d.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),i=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),r=this.z.redMul(e.z.redAdd(e.z)),o=i.redSub(t),s=r.redSub(n),a=r.redAdd(n),c=i.redAdd(t),d=o.redMul(s),l=a.redMul(c),u=o.redMul(c),h=s.redMul(a);return this.curve.point(d,l,h,u)},d.prototype._projAdd=function(e){var t,i,n=this.z.redMul(e.z),r=n.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),c=r.redSub(a),d=r.redAdd(a),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),u=n.redMul(c).redMul(l);return this.curve.twisted?(t=n.redMul(d).redMul(s.redSub(this.curve._mulA(o))),i=c.redMul(d)):(t=n.redMul(d).redMul(s.redSub(o)),i=this.curve._mulC(c).redMul(d)),this.curve.point(u,t,i)},d.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},d.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},d.prototype.mulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!1)},d.prototype.jmulAdd=function(e,t,i){return this.curve._wnafMulAdd(1,[this,t],[e,i],2,!0)},d.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},d.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},d.prototype.getX=function(){return this.normalize(),this.x.fromRed()},d.prototype.getY=function(){return this.normalize(),this.y.fromRed()},d.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},d.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var i=e.clone(),n=this.curve.redN.redMul(this.z);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},d.prototype.toP=d.prototype.normalize,d.prototype.mixedAdd=d.prototype.add},{"../utils":107,"./base":94,"bn.js":18,inherits:151}],96:[function(e,t,i){"use strict";var n=i;n.base=e("./base"),n.short=e("./short"),n.mont=e("./mont"),n.edwards=e("./edwards")},{"./base":94,"./edwards":95,"./mont":97,"./short":98}],97:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("inherits"),o=e("./base"),s=e("../utils");function a(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,i){o.BasePoint.call(this,e,"projective"),null===t&&null===i?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}r(a,o),t.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,i=t.redSqr(),n=i.redMul(t).redAdd(i.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},r(c,o.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},a.prototype.point=function(e,t){return new c(this,e,t)},a.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),i=e.redSub(t),n=e.redMul(t),r=i.redMul(t.redAdd(this.curve.a24.redMul(i)));return this.curve.point(n,r)},c.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var i=this.x.redAdd(this.z),n=this.x.redSub(this.z),r=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(i),s=r.redMul(n),a=t.z.redMul(o.redAdd(s).redSqr()),c=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,c)},c.prototype.mul=function(e){for(var t=e.clone(),i=this,n=this.curve.point(null,null),r=[];0!==t.cmpn(0);t.iushrn(1))r.push(t.andln(1));for(var o=r.length-1;o>=0;o--)0===r[o]?(i=i.diffAdd(n,this),n=n.dbl()):(n=i.diffAdd(n,this),i=i.dbl());return n},c.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},{"../utils":107,"./base":94,"bn.js":18,inherits:151}],98:[function(e,t,i){"use strict";var n=e("../utils"),r=e("bn.js"),o=e("inherits"),s=e("./base"),a=n.assert;function c(e){s.call(this,"short",e),this.a=new r(e.a,16).toRed(this.red),this.b=new r(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function d(e,t,i,n){s.BasePoint.call(this,e,"affine"),null===t&&null===i?(this.x=null,this.y=null,this.inf=!0):(this.x=new r(t,16),this.y=new r(i,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(e,t,i,n){s.BasePoint.call(this,e,"jacobian"),null===t&&null===i&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new r(0)):(this.x=new r(t,16),this.y=new r(i,16),this.z=new r(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(c,s),t.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,i;if(e.beta)t=new r(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)i=new r(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?i=o[0]:(i=o[1],a(0===this.g.mul(i).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:i,basis:e.basis?e.basis.map((function(e){return{a:new r(e.a,16),b:new r(e.b,16)}})):this._getEndoBasis(i)}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:r.mont(e),i=new r(2).toRed(t).redInvm(),n=i.redNeg(),o=new r(3).toRed(t).redNeg().redSqrt().redMul(i);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,i,n,o,s,a,c,d,l,u=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,f=this.n.clone(),p=new r(1),g=new r(0),v=new r(0),m=new r(1),y=0;0!==h.cmpn(0);){var b=f.div(h);d=f.sub(b.mul(h)),l=v.sub(b.mul(p));var _=m.sub(b.mul(g));if(!n&&d.cmp(u)<0)t=c.neg(),i=p,n=d.neg(),o=l;else if(n&&2==++y)break;c=d,f=h,h=d,v=p,p=l,m=g,g=_}s=d.neg(),a=l;var S=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(S)>=0&&(s=t,a=i),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,i=t[0],n=t[1],r=n.b.mul(e).divRound(this.n),o=i.b.neg().mul(e).divRound(this.n),s=r.mul(i.a),a=o.mul(n.a),c=r.mul(i.b),d=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:c.add(d).neg()}},c.prototype.pointFromX=function(e,t){(e=new r(e,16)).red||(e=e.toRed(this.red));var i=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=i.redSqrt();if(0!==n.redSqr().redSub(i).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,i=e.y,n=this.a.redMul(t),r=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===i.redSqr().redISub(r).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,i){for(var n=this._endoWnafT1,r=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*o]=a,n[2*o+1]=c,r[2*o]=s.k1,r[2*o+1]=s.k2}for(var d=this._wnafMulAdd(1,n,r,2*o,i),l=0;l<2*o;l++)n[l]=null,r[l]=null;return d},o(d,s.BasePoint),c.prototype.point=function(e,t,i){return new d(this,e,t,i)},c.prototype.pointFromJSON=function(e,t){return d.fromJSON(this,e,t)},d.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var i=this.curve,n=function(e){return i.point(e.x.redMul(i.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},d.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},d.fromJSON=function(e,t,i){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],i);if(!t[2])return n;function r(t){return e.point(t[0],t[1],i)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(r))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(r))}},n},d.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},d.prototype.isInfinity=function(){return this.inf},d.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var i=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(i)).redISub(this.y);return this.curve.point(i,n)},d.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,i=this.x.redSqr(),n=e.redInvm(),r=i.redAdd(i).redIAdd(i).redIAdd(t).redMul(n),o=r.redSqr().redISub(this.x.redAdd(this.x)),s=r.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},d.prototype.getX=function(){return this.x.fromRed()},d.prototype.getY=function(){return this.y.fromRed()},d.prototype.mul=function(e){return e=new r(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},d.prototype.mulAdd=function(e,t,i){var n=[this,t],r=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,r):this.curve._wnafMulAdd(1,n,r,2)},d.prototype.jmulAdd=function(e,t,i){var n=[this,t],r=[e,i];return this.curve.endo?this.curve._endoWnafMulAdd(n,r,!0):this.curve._wnafMulAdd(1,n,r,2,!0)},d.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},d.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var i=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:i.naf&&{wnd:i.naf.wnd,points:i.naf.points.map(n)},doubles:i.doubles&&{step:i.doubles.step,points:i.doubles.points.map(n)}}}return t},d.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,s.BasePoint),c.prototype.jpoint=function(e,t,i){return new l(this,e,t,i)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),i=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(i,n)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),i=this.z.redSqr(),n=this.x.redMul(t),r=e.x.redMul(i),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(i.redMul(this.z)),a=n.redSub(r),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var d=a.redSqr(),l=d.redMul(a),u=n.redMul(d),h=c.redSqr().redIAdd(l).redISub(u).redISub(u),f=c.redMul(u.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(h,f,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),i=this.x,n=e.x.redMul(t),r=this.y,o=e.y.redMul(t).redMul(this.z),s=i.redSub(n),a=r.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),d=c.redMul(s),l=i.redMul(c),u=a.redSqr().redIAdd(d).redISub(l).redISub(l),h=a.redMul(l.redISub(u)).redISub(r.redMul(d)),f=this.z.redMul(s);return this.curve.jpoint(u,h,f)},l.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var i=this;for(t=0;t<e;t++)i=i.dbl();return i}var n=this.curve.a,r=this.curve.tinv,o=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),d=s.redAdd(s);for(t=0;t<e;t++){var l=o.redSqr(),u=d.redSqr(),h=u.redSqr(),f=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),p=o.redMul(u),g=f.redSqr().redISub(p.redAdd(p)),v=p.redISub(g),m=f.redMul(v);m=m.redIAdd(m).redISub(h);var y=d.redMul(a);t+1<e&&(c=c.redMul(h)),o=g,a=y,d=m}return this.curve.jpoint(o,d.redMul(r),a)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},l.prototype._zeroDbl=function(){var e,t,i;if(this.zOne){var n=this.x.redSqr(),r=this.y.redSqr(),o=r.redSqr(),s=this.x.redAdd(r).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),c=a.redSqr().redISub(s).redISub(s),d=o.redIAdd(o);d=(d=d.redIAdd(d)).redIAdd(d),e=c,t=a.redMul(s.redISub(c)).redISub(d),i=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),u=this.y.redSqr(),h=u.redSqr(),f=this.x.redAdd(u).redSqr().redISub(l).redISub(h);f=f.redIAdd(f);var p=l.redAdd(l).redIAdd(l),g=p.redSqr(),v=h.redIAdd(h);v=(v=v.redIAdd(v)).redIAdd(v),e=g.redISub(f).redISub(f),t=p.redMul(f.redISub(e)).redISub(v),i=(i=this.y.redMul(this.z)).redIAdd(i)}return this.curve.jpoint(e,t,i)},l.prototype._threeDbl=function(){var e,t,i;if(this.zOne){var n=this.x.redSqr(),r=this.y.redSqr(),o=r.redSqr(),s=this.x.redAdd(r).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);e=c;var d=o.redIAdd(o);d=(d=d.redIAdd(d)).redIAdd(d),t=a.redMul(s.redISub(c)).redISub(d),i=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),u=this.y.redSqr(),h=this.x.redMul(u),f=this.x.redSub(l).redMul(this.x.redAdd(l));f=f.redAdd(f).redIAdd(f);var p=h.redIAdd(h),g=(p=p.redIAdd(p)).redAdd(p);e=f.redSqr().redISub(g),i=this.y.redAdd(this.z).redSqr().redISub(u).redISub(l);var v=u.redSqr();v=(v=(v=v.redIAdd(v)).redIAdd(v)).redIAdd(v),t=f.redMul(p.redISub(e)).redISub(v)}return this.curve.jpoint(e,t,i)},l.prototype._dbl=function(){var e=this.curve.a,t=this.x,i=this.y,n=this.z,r=n.redSqr().redSqr(),o=t.redSqr(),s=i.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(r)),c=t.redAdd(t),d=(c=c.redIAdd(c)).redMul(s),l=a.redSqr().redISub(d.redAdd(d)),u=d.redISub(l),h=s.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=a.redMul(u).redISub(h),p=i.redAdd(i).redMul(n);return this.curve.jpoint(l,f,p)},l.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),i=this.z.redSqr(),n=t.redSqr(),r=e.redAdd(e).redIAdd(e),o=r.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var d=r.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(c),l=t.redMul(d);l=(l=l.redIAdd(l)).redIAdd(l);var u=this.x.redMul(a).redISub(l);u=(u=u.redIAdd(u)).redIAdd(u);var h=this.y.redMul(d.redMul(c.redISub(d)).redISub(s.redMul(a)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var f=this.z.redAdd(s).redSqr().redISub(i).redISub(a);return this.curve.jpoint(u,h,f)},l.prototype.mul=function(e,t){return e=new r(e,t),this.curve._wnafMul(this,e)},l.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),i=e.z.redSqr();if(0!==this.x.redMul(i).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),r=i.redMul(e.z);return 0===this.y.redMul(r).redISub(e.y.redMul(n)).cmpn(0)},l.prototype.eqXToP=function(e){var t=this.z.redSqr(),i=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(i))return!0;for(var n=e.clone(),r=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(i.redIAdd(r),0===this.x.cmp(i))return!0}},l.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},{"../utils":107,"./base":94,"bn.js":18,inherits:151}],99:[function(e,t,i){"use strict";var n,r=i,o=e("hash.js"),s=e("./curve"),a=e("./utils").assert;function c(e){"short"===e.type?this.curve=new s.short(e):"edwards"===e.type?this.curve=new s.edwards(e):this.curve=new s.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function d(e,t){Object.defineProperty(r,e,{configurable:!0,enumerable:!0,get:function(){var i=new c(t);return Object.defineProperty(r,e,{configurable:!0,enumerable:!0,value:i}),i}})}r.PresetCurve=c,d("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),d("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),d("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),d("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),d("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),d("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),d("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=e("./precomputed/secp256k1")}catch(e){n=void 0}d("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},{"./curve":96,"./precomputed/secp256k1":106,"./utils":107,"hash.js":137}],100:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("hmac-drbg"),o=e("../utils"),s=e("../curves"),a=e("brorand"),c=o.assert,d=e("./key"),l=e("./signature");function u(e){if(!(this instanceof u))return new u(e);"string"==typeof e&&(c(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}t.exports=u,u.prototype.keyPair=function(e){return new d(this,e)},u.prototype.keyFromPrivate=function(e,t){return d.fromPrivate(this,e,t)},u.prototype.keyFromPublic=function(e,t){return d.fromPublic(this,e,t)},u.prototype.genKeyPair=function(e){e||(e={});for(var t=new r({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),i=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(t.generate(i));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},u.prototype._truncateToN=function(e,t){var i=8*e.byteLength()-this.n.bitLength();return i>0&&(e=e.ushrn(i)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},u.prototype.sign=function(e,t,i,o){"object"==typeof i&&(o=i,i=null),o||(o={}),t=this.keyFromPrivate(t,i),e=this._truncateToN(new n(e,16));for(var s=this.n.byteLength(),a=t.getPrivate().toArray("be",s),c=e.toArray("be",s),d=new r({hash:this.hash,entropy:a,nonce:c,pers:o.pers,persEnc:o.persEnc||"utf8"}),u=this.n.sub(new n(1)),h=0;;h++){var f=o.k?o.k(h):new n(d.generate(this.n.byteLength()));if(!((f=this._truncateToN(f,!0)).cmpn(1)<=0||f.cmp(u)>=0)){var p=this.g.mul(f);if(!p.isInfinity()){var g=p.getX(),v=g.umod(this.n);if(0!==v.cmpn(0)){var m=f.invm(this.n).mul(v.mul(t.getPrivate()).iadd(e));if(0!==(m=m.umod(this.n)).cmpn(0)){var y=(p.getY().isOdd()?1:0)|(0!==g.cmp(v)?2:0);return o.canonical&&m.cmp(this.nh)>0&&(m=this.n.sub(m),y^=1),new l({r:v,s:m,recoveryParam:y})}}}}}},u.prototype.verify=function(e,t,i,r){e=this._truncateToN(new n(e,16)),i=this.keyFromPublic(i,r);var o=(t=new l(t,"hex")).r,s=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(s.cmpn(1)<0||s.cmp(this.n)>=0)return!1;var a,c=s.invm(this.n),d=c.mul(e).umod(this.n),u=c.mul(o).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(d,i.getPublic(),u)).isInfinity()&&a.eqXToP(o):!(a=this.g.mulAdd(d,i.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).cmp(o)},u.prototype.recoverPubKey=function(e,t,i,r){c((3&i)===i,"The recovery param is more than two bits"),t=new l(t,r);var o=this.n,s=new n(e),a=t.r,d=t.s,u=1&i,h=i>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");a=h?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var f=t.r.invm(o),p=o.sub(s).mul(f).umod(o),g=d.mul(f).umod(o);return this.g.mulAdd(p,a,g)},u.prototype.getKeyRecoveryParam=function(e,t,i,n){if(null!==(t=new l(t,n)).recoveryParam)return t.recoveryParam;for(var r=0;r<4;r++){var o;try{o=this.recoverPubKey(e,t,r)}catch(e){continue}if(o.eq(i))return r}throw new Error("Unable to find valid recovery factor")}},{"../curves":99,"../utils":107,"./key":101,"./signature":102,"bn.js":18,brorand:19,"hmac-drbg":149}],101:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("../utils").assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}t.exports=o,o.fromPublic=function(e,t,i){return t instanceof o?t:new o(e,{pub:t,pubEnc:i})},o.fromPrivate=function(e,t,i){return t instanceof o?t:new o(e,{priv:t,privEnc:i})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?r(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||r(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||r(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,i){return this.ec.sign(e,this,t,i)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},{"../utils":107,"bn.js":18}],102:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("../utils"),o=r.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function c(e,t){var i=e[t.place++];if(!(128&i))return i;var n=15&i;if(0===n||n>4)return!1;for(var r=0,o=0,s=t.place;o<n;o++,s++)r<<=8,r|=e[s],r>>>=0;return!(r<=127)&&(t.place=s,r)}function d(e){for(var t=0,i=e.length-1;!e[t]&&!(128&e[t+1])&&t<i;)t++;return 0===t?e:e.slice(t)}function l(e,t){if(t<128)e.push(t);else{var i=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|i);--i;)e.push(t>>>(i<<3)&255);e.push(t)}}t.exports=s,s.prototype._importDER=function(e,t){e=r.toArray(e,t);var i=new a;if(48!==e[i.place++])return!1;var o=c(e,i);if(!1===o)return!1;if(o+i.place!==e.length)return!1;if(2!==e[i.place++])return!1;var s=c(e,i);if(!1===s)return!1;var d=e.slice(i.place,s+i.place);if(i.place+=s,2!==e[i.place++])return!1;var l=c(e,i);if(!1===l)return!1;if(e.length!==l+i.place)return!1;var u=e.slice(i.place,l+i.place);if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new n(d),this.s=new n(u),this.recoveryParam=null,!0},s.prototype.toDER=function(e){var t=this.r.toArray(),i=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&i[0]&&(i=[0].concat(i)),t=d(t),i=d(i);!(i[0]||128&i[1]);)i=i.slice(1);var n=[2];l(n,t.length),(n=n.concat(t)).push(2),l(n,i.length);var o=n.concat(i),s=[48];return l(s,o.length),s=s.concat(o),r.encode(s,e)}},{"../utils":107,"bn.js":18}],103:[function(e,t,i){"use strict";var n=e("hash.js"),r=e("../curves"),o=e("../utils"),s=o.assert,a=o.parseBytes,c=e("./key"),d=e("./signature");function l(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=r[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}t.exports=l,l.prototype.sign=function(e,t){e=a(e);var i=this.keyFromSecret(t),n=this.hashInt(i.messagePrefix(),e),r=this.g.mul(n),o=this.encodePoint(r),s=this.hashInt(o,i.pubBytes(),e).mul(i.priv()),c=n.add(s).umod(this.curve.n);return this.makeSignature({R:r,S:c,Rencoded:o})},l.prototype.verify=function(e,t,i){e=a(e),t=this.makeSignature(t);var n=this.keyFromPublic(i),r=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(r)).eq(o)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},l.prototype.keyFromPublic=function(e){return c.fromPublic(this,e)},l.prototype.keyFromSecret=function(e){return c.fromSecret(this,e)},l.prototype.makeSignature=function(e){return e instanceof d?e:new d(this,e)},l.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},l.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,i=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),r=o.intFromLE(i);return this.curve.pointFromY(r,n)},l.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},l.prototype.decodeInt=function(e){return o.intFromLE(e)},l.prototype.isPoint=function(e){return e instanceof this.pointClass}},{"../curves":99,"../utils":107,"./key":104,"./signature":105,"hash.js":137}],104:[function(e,t,i){"use strict";var n=e("../utils"),r=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),s(a,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),s(a,"privBytes",(function(){var e=this.eddsa,t=this.hash(),i=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[i]&=127,n[i]|=64,n})),s(a,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),s(a,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),s(a,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),a.prototype.sign=function(e){return r(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return r(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},a.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},t.exports=a},{"../utils":107}],105:[function(e,t,i){"use strict";var n=e("bn.js"),r=e("../utils"),o=r.assert,s=r.cachedProperty,a=r.parseBytes;function c(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(c,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(c,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(c,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(c,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return r.encode(this.toBytes(),"hex").toUpperCase()},t.exports=c},{"../utils":107,"bn.js":18}],106:[function(e,t,i){t.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},{}],107:[function(e,t,i){"use strict";var n=i,r=e("bn.js"),o=e("minimalistic-assert"),s=e("minimalistic-crypto-utils");n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=function(e,t,i){var n=new Array(Math.max(e.bitLength(),i)+1);n.fill(0);for(var r=1<<t+1,o=e.clone(),s=0;s<n.length;s++){var a,c=o.andln(r-1);o.isOdd()?(a=c>(r>>1)-1?(r>>1)-c:c,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},n.getJSF=function(e,t){var i=[[],[]];e=e.clone(),t=t.clone();for(var n,r=0,o=0;e.cmpn(-r)>0||t.cmpn(-o)>0;){var s,a,c=e.andln(3)+r&3,d=t.andln(3)+o&3;3===c&&(c=-1),3===d&&(d=-1),s=0==(1&c)?0:3!==(n=e.andln(7)+r&7)&&5!==n||2!==d?c:-c,i[0].push(s),a=0==(1&d)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?d:-d,i[1].push(a),2*r===s+1&&(r=1-r),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return i},n.cachedProperty=function(e,t,i){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=i.call(this)}},n.parseBytes=function(e){return"string"==typeof e?n.toArray(e,"hex"):e},n.intFromLE=function(e){return new r(e,"hex","le")}},{"bn.js":18,"minimalistic-assert":232,"minimalistic-crypto-utils":233}],108:[function(e,t,i){t.exports={name:"elliptic",version:"6.5.4",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"[email protected]:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <[email protected]>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}},{}],109:[function(e,t,i){"use strict";var n,r="object"==typeof Reflect?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function(e,t,i){return Function.prototype.apply.call(e,t,i)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var s=Number.isNaN||function(e){return e!=e};function a(){a.init.call(this)}t.exports=a,t.exports.once=function(e,t){return new Promise((function(i,n){function r(i){e.removeListener(t,o),n(i)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",r),i([].slice.call(arguments))}m(e,t,o,{once:!0}),"error"!==t&&function(e,t,i){"function"==typeof e.on&&m(e,"error",t,i)}(e,r,{once:!0})}))},a.EventEmitter=a,a.prototype._events=void 0,a.prototype._eventsCount=0,a.prototype._maxListeners=void 0;var c=10;function d(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function l(e){return void 0===e._maxListeners?a.defaultMaxListeners:e._maxListeners}function u(e,t,i,n){var r,o,s,a;if(d(i),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,i.listener?i.listener:i),o=e._events),s=o[t]),void 0===s)s=o[t]=i,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[i,s]:[s,i]:n?s.unshift(i):s.push(i),(r=l(e))>0&&s.length>r&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,a=c,console&&console.warn&&console.warn(a)}return e}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=h.bind(n);return r.listener=i,n.wrapFn=r,r}function p(e,t,i){var n=e._events;if(void 0===n)return[];var r=n[t];return void 0===r?[]:"function"==typeof r?i?[r.listener||r]:[r]:i?function(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}(r):v(r,r.length)}function g(e){var t=this._events;if(void 0!==t){var i=t[e];if("function"==typeof i)return 1;if(void 0!==i)return i.length}return 0}function v(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}function m(e,t,i,n){if("function"==typeof e.on)n.once?e.once(t,i):e.on(t,i);else{if("function"!=typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function r(o){n.once&&e.removeEventListener(t,r),i(o)}))}}Object.defineProperty(a,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),a.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},a.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||s(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},a.prototype.getMaxListeners=function(){return l(this)},a.prototype.emit=function(e){for(var t=[],i=1;i<arguments.length;i++)t.push(arguments[i]);var n="error"===e,r=this._events;if(void 0!==r)n=n&&void 0===r.error;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=r[e];if(void 0===c)return!1;if("function"==typeof c)o(c,this,t);else{var d=c.length,l=v(c,d);for(i=0;i<d;++i)o(l[i],this,t)}return!0},a.prototype.addListener=function(e,t){return u(this,e,t,!1)},a.prototype.on=a.prototype.addListener,a.prototype.prependListener=function(e,t){return u(this,e,t,!0)},a.prototype.once=function(e,t){return d(t),this.on(e,f(this,e,t)),this},a.prototype.prependOnceListener=function(e,t){return d(t),this.prependListener(e,f(this,e,t)),this},a.prototype.removeListener=function(e,t){var i,n,r,o,s;if(d(t),void 0===(n=this._events))return this;if(void 0===(i=n[e]))return this;if(i===t||i.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||t));else if("function"!=typeof i){for(r=-1,o=i.length-1;o>=0;o--)if(i[o]===t||i[o].listener===t){s=i[o].listener,r=o;break}if(r<0)return this;0===r?i.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(i,r),1===i.length&&(n[e]=i[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},a.prototype.off=a.prototype.removeListener,a.prototype.removeAllListeners=function(e){var t,i,n;if(void 0===(i=this._events))return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete i[e]),this;if(0===arguments.length){var r,o=Object.keys(i);for(n=0;n<o.length;++n)"removeListener"!==(r=o[n])&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=i[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},a.prototype.listeners=function(e){return p(this,e,!0)},a.prototype.rawListeners=function(e){return p(this,e,!1)},a.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):g.call(e,t)},a.prototype.listenerCount=g,a.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],110:[function(e,t,i){var n=e("safe-buffer").Buffer,r=e("md5.js");t.exports=function(e,t,i,o){if(n.isBuffer(e)||(e=n.from(e,"binary")),t&&(n.isBuffer(t)||(t=n.from(t,"binary")),8!==t.length))throw new RangeError("salt should be Buffer with 8 byte length");for(var s=i/8,a=n.alloc(s),c=n.alloc(o||0),d=n.alloc(0);s>0||o>0;){var l=new r;l.update(d),l.update(e),t&&l.update(t),d=l.digest();var u=0;if(s>0){var h=a.length-s;u=Math.min(s,d.length),d.copy(a,h,0,u),s-=u}if(u<d.length&&o>0){var f=c.length-o,p=Math.min(o,d.length-u);d.copy(c,f,u,u+p),o-=p}}return d.fill(0),{key:a,iv:c}}},{"md5.js":230,"safe-buffer":260}],111:[function(e,t,i){"use strict";var n=e("is-callable"),r=Object.prototype.toString,o=Object.prototype.hasOwnProperty;t.exports=function(e,t,i){if(!n(t))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=i),"[object Array]"===r.call(e)?function(e,t,i){for(var n=0,r=e.length;n<r;n++)o.call(e,n)&&(null==i?t(e[n],n,e):t.call(i,e[n],n,e))}(e,t,s):"string"==typeof e?function(e,t,i){for(var n=0,r=e.length;n<r;n++)null==i?t(e.charAt(n),n,e):t.call(i,e.charAt(n),n,e)}(e,t,s):function(e,t,i){for(var n in e)o.call(e,n)&&(null==i?t(e[n],n,e):t.call(i,e[n],n,e))}(e,t,s)}},{"is-callable":153}],112:[function(e,t,i){"use strict";var n=Array.prototype.slice,r=Object.prototype.toString;t.exports=function(e){var t=this;if("function"!=typeof t||"[object Function]"!==r.call(t))throw new TypeError("Function.prototype.bind called on incompatible "+t);for(var i,o=n.call(arguments,1),s=Math.max(0,t.length-o.length),a=[],c=0;c<s;c++)a.push("$"+c);if(i=Function("binder","return function ("+a.join(",")+"){ return binder.apply(this,arguments); }")((function(){if(this instanceof i){var r=t.apply(this,o.concat(n.call(arguments)));return Object(r)===r?r:this}return t.apply(e,o.concat(n.call(arguments)))})),t.prototype){var d=function(){};d.prototype=t.prototype,i.prototype=new d,d.prototype=null}return i}},{}],113:[function(e,t,i){"use strict";var n=e("./implementation");t.exports=Function.prototype.bind||n},{"./implementation":112}],114:[function(e,t,i){"use strict";var n,r=SyntaxError,o=Function,s=TypeError,a=function(e){try{return o('"use strict"; return ('+e+").constructor;")()}catch(e){}},c=Object.getOwnPropertyDescriptor;if(c)try{c({},"")}catch(e){c=null}var d=function(){throw new s},l=c?function(){try{return d}catch(e){try{return c(arguments,"callee").get}catch(e){return d}}}():d,u=e("has-symbols")(),h=e("has-proto")(),f=Object.getPrototypeOf||(h?function(e){return e.__proto__}:null),p={},g="undefined"!=typeof Uint8Array&&f?f(Uint8Array):n,v={"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":u&&f?f([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":p,"%AsyncGenerator%":p,"%AsyncGeneratorFunction%":p,"%AsyncIteratorPrototype%":p,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%eval%":eval,"%EvalError%":EvalError,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":o,"%GeneratorFunction%":p,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":u&&f?f(f([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&u&&f?f((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":RangeError,"%ReferenceError%":ReferenceError,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&u&&f?f((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":u&&f?f(""[Symbol.iterator]()):n,"%Symbol%":u?Symbol:n,"%SyntaxError%":r,"%ThrowTypeError%":l,"%TypedArray%":g,"%TypeError%":s,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":URIError,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(f)try{null.error}catch(e){var m=f(f(e));v["%Error.prototype%"]=m}var y=function e(t){var i;if("%AsyncFunction%"===t)i=a("async function () {}");else if("%GeneratorFunction%"===t)i=a("function* () {}");else if("%AsyncGeneratorFunction%"===t)i=a("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(i=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var r=e("%AsyncGenerator%");r&&f&&(i=f(r.prototype))}return v[t]=i,i},b={"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},_=e("function-bind"),S=e("has"),E=_.call(Function.call,Array.prototype.concat),w=_.call(Function.apply,Array.prototype.splice),T=_.call(Function.call,String.prototype.replace),I=_.call(Function.call,String.prototype.slice),R=_.call(Function.call,RegExp.prototype.exec),k=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,M=/\\(\\)?/g,C=function(e,t){var i,n=e;if(S(b,n)&&(n="%"+(i=b[n])[0]+"%"),S(v,n)){var o=v[n];if(o===p&&(o=y(n)),void 0===o&&!t)throw new s("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new r("intrinsic "+e+" does not exist!")};t.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new s("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new s('"allowMissing" argument must be a boolean');if(null===R(/^%?[^%]*%?$/,e))throw new r("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=function(e){var t=I(e,0,1),i=I(e,-1);if("%"===t&&"%"!==i)throw new r("invalid intrinsic syntax, expected closing `%`");if("%"===i&&"%"!==t)throw new r("invalid intrinsic syntax, expected opening `%`");var n=[];return T(e,k,(function(e,t,i,r){n[n.length]=i?T(r,M,"$1"):t||e})),n}(e),n=i.length>0?i[0]:"",o=C("%"+n+"%",t),a=o.name,d=o.value,l=!1,u=o.alias;u&&(n=u[0],w(i,E([0,1],u)));for(var h=1,f=!0;h<i.length;h+=1){var p=i[h],g=I(p,0,1),m=I(p,-1);if(('"'===g||"'"===g||"`"===g||'"'===m||"'"===m||"`"===m)&&g!==m)throw new r("property names with quotes must have matching quotes");if("constructor"!==p&&f||(l=!0),S(v,a="%"+(n+="."+p)+"%"))d=v[a];else if(null!=d){if(!(p in d)){if(!t)throw new s("base intrinsic for "+e+" exists, but the property is not available.");return}if(c&&h+1>=i.length){var y=c(d,p);d=(f=!!y)&&"get"in y&&!("originalValue"in y.get)?y.get:d[p]}else f=S(d,p),d=d[p];f&&!l&&(v[a]=d)}}return d}},{"function-bind":113,has:120,"has-proto":116,"has-symbols":117}],115:[function(e,t,i){"use strict";var n=e("get-intrinsic")("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}t.exports=n},{"get-intrinsic":114}],116:[function(e,t,i){"use strict";var n={foo:{}},r=Object;t.exports=function(){return{__proto__:n}.foo===n.foo&&!({__proto__:null}instanceof r)}},{}],117:[function(e,t,i){"use strict";var n="undefined"!=typeof Symbol&&Symbol,r=e("./shams");t.exports=function(){return"function"==typeof n&&("function"==typeof Symbol&&("symbol"==typeof n("foo")&&("symbol"==typeof Symbol("bar")&&r())))}},{"./shams":118}],118:[function(e,t,i){"use strict";t.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),i=Object(t);if("string"==typeof t)return!1;if("[object Symbol]"!==Object.prototype.toString.call(t))return!1;if("[object Symbol]"!==Object.prototype.toString.call(i))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length)return!1;if("function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t)return!1;if(!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var r=Object.getOwnPropertyDescriptor(e,t);if(42!==r.value||!0!==r.enumerable)return!1}return!0}},{}],119:[function(e,t,i){"use strict";var n=e("has-symbols/shams");t.exports=function(){return n()&&!!Symbol.toStringTag}},{"has-symbols/shams":118}],120:[function(e,t,i){"use strict";var n=e("function-bind");t.exports=n.call(Function.call,Object.prototype.hasOwnProperty)},{"function-bind":113}],121:[function(e,t,i){"use strict";var n=e("safe-buffer").Buffer,r=e("readable-stream").Transform;function o(e){r.call(this),this._block=n.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}e("inherits")(o,r),o.prototype._transform=function(e,t,i){var n=null;try{this.update(e,t)}catch(e){n=e}i(n)},o.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)},o.prototype.update=function(e,t){if(function(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw new TypeError(t+" must be a string or a buffer")}(e,"Data"),this._finalized)throw new Error("Digest already called");n.isBuffer(e)||(e=n.from(e,t));for(var i=this._block,r=0;this._blockOffset+e.length-r>=this._blockSize;){for(var o=this._blockOffset;o<this._blockSize;)i[o++]=e[r++];this._update(),this._blockOffset=0}for(;r<e.length;)i[this._blockOffset++]=e[r++];for(var s=0,a=8*e.length;a>0;++s)this._length[s]+=a,(a=this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*a);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(e){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var i=0;i<4;++i)this._length[i]=0;return t},o.prototype._digest=function(){throw new Error("_digest is not implemented")},t.exports=o},{inherits:151,"readable-stream":136,"safe-buffer":260}],122:[function(e,t,i){arguments[4][50][0].apply(i,arguments)},{dup:50}],123:[function(e,t,i){(function(i){(function(){"use strict";var n=Object.keys||function(e){var t=[];for(var i in e)t.push(i);return t};t.exports=d;var r=e("./_stream_readable"),o=e("./_stream_writable");e("inherits")(d,r);for(var s=n(o.prototype),a=0;a<s.length;a++){var c=s[a];d.prototype[c]||(d.prototype[c]=o.prototype[c])}function d(e){if(!(this instanceof d))return new d(e);r.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||i.nextTick(u,this)}function u(e){e.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(d.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(d.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":125,"./_stream_writable":127,_process:247,inherits:151}],124:[function(e,t,i){arguments[4][52][0].apply(i,arguments)},{"./_stream_transform":126,dup:52,inherits:151}],125:[function(e,t,i){(function(i,n){(function(){"use strict";var r;t.exports=I,I.ReadableState=T;e("events").EventEmitter;var o=function(e,t){return e.listeners(t).length},s=e("./internal/streams/stream"),a=e("buffer").Buffer,c=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var d,l=e("util");d=l&&l.debuglog?l.debuglog("stream"):function(){};var u,h,f,p=e("./internal/streams/buffer_list"),g=e("./internal/streams/destroy"),v=e("./internal/streams/state").getHighWaterMark,m=e("../errors").codes,y=m.ERR_INVALID_ARG_TYPE,b=m.ERR_STREAM_PUSH_AFTER_EOF,_=m.ERR_METHOD_NOT_IMPLEMENTED,S=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;e("inherits")(I,s);var E=g.errorOrDestroy,w=["error","close","destroy","pause","resume"];function T(t,i,n){r=r||e("./_stream_duplex"),t=t||{},"boolean"!=typeof n&&(n=i instanceof r),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=v(this,t,"readableHighWaterMark",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(u||(u=e("string_decoder/").StringDecoder),this.decoder=new u(t.encoding),this.encoding=t.encoding)}function I(t){if(r=r||e("./_stream_duplex"),!(this instanceof I))return new I(t);var i=this instanceof r;this._readableState=new T(t,this,i),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function R(e,t,i,n,r){d("readableAddChunk",t);var o,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(d("onEofChunk"),t.ended)return;if(t.decoder){var i=t.decoder.end();i&&i.length&&(t.buffer.push(i),t.length+=t.objectMode?1:i.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,A(e)))}(e,s);else if(r||(o=function(e,t){var i;n=t,a.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(i=new y("chunk",["string","Buffer","Uint8Array"],t));var n;return i}(s,t)),o)E(e,o);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),n)s.endEmitted?E(e,new S):k(e,s,t,!0);else if(s.ended)E(e,new b);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!i?(t=s.decoder.write(t),s.objectMode||0!==t.length?k(e,s,t,!1):P(e,s)):k(e,s,t,!1)}else n||(s.reading=!1,P(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function k(e,t,i,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",i)):(t.length+=t.objectMode?1:i.length,n?t.buffer.unshift(i):t.buffer.push(i),t.needReadable&&O(e)),P(e,t)}Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),I.prototype.destroy=g.destroy,I.prototype._undestroy=g.undestroy,I.prototype._destroy=function(e,t){t(e)},I.prototype.push=function(e,t){var i,n=this._readableState;return n.objectMode?i=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=a.from(e,t),t=""),i=!0),R(this,e,t,!1,i)},I.prototype.unshift=function(e){return R(this,e,null,!0,!1)},I.prototype.isPaused=function(){return!1===this._readableState.flowing},I.prototype.setEncoding=function(t){u||(u=e("string_decoder/").StringDecoder);var i=new u(t);this._readableState.decoder=i,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r="";null!==n;)r+=i.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this};var M=1073741824;function C(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=M?e=M:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;d("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(A,e))}function A(e){var t=e._readableState;d("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function P(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(D,e,t))}function D(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var i=t.length;if(d("maybeReadMore read 0"),e.read(0),i===t.length)break}t.readingMore=!1}function x(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function L(e){d("readable nexttick read 0"),e.read(0)}function U(e,t){d("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(d("flow",t.flowing);t.flowing&&null!==e.read(););}function B(e,t){return 0===t.length?null:(t.objectMode?i=t.buffer.shift():!e||e>=t.length?(i=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):i=t.buffer.consume(e,t.decoder),i);var i}function j(e){var t=e._readableState;d("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(F,t,e))}function F(e,t){if(d("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var i=t._writableState;(!i||i.autoDestroy&&i.finished)&&t.destroy()}}function K(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1}I.prototype.read=function(e){d("read",e),e=parseInt(e,10);var t=this._readableState,i=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):O(this),null;if(0===(e=C(e,t))&&t.ended)return 0===t.length&&j(this),null;var n,r=t.needReadable;return d("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&d("length less than watermark",r=!0),t.ended||t.reading?d("reading or ended",r=!1):r&&(d("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=C(i,t))),null===(n=e>0?B(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),i!==e&&t.ended&&j(this)),null!==n&&this.emit("data",n),n},I.prototype._read=function(e){E(this,new _("_read()"))},I.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,d("pipe count=%d opts=%j",r.pipesCount,t);var s=(!t||!1!==t.end)&&e!==i.stdout&&e!==i.stderr?c:v;function a(t,i){d("onunpipe"),t===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,d("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),e.removeListener("drain",l),e.removeListener("error",f),e.removeListener("unpipe",a),n.removeListener("end",c),n.removeListener("end",v),n.removeListener("data",h),u=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function c(){d("onend"),e.end()}r.endEmitted?i.nextTick(s):n.once("end",s),e.on("unpipe",a);var l=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,N(e))}}(n);e.on("drain",l);var u=!1;function h(t){d("ondata");var i=e.write(t);d("dest.write",i),!1===i&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==K(r.pipes,e))&&!u&&(d("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function f(t){d("onerror",t),v(),e.removeListener("error",f),0===o(e,"error")&&E(e,t)}function p(){e.removeListener("finish",g),v()}function g(){d("onfinish"),e.removeListener("close",p),v()}function v(){d("unpipe"),n.unpipe(e)}return n.on("data",h),function(e,t,i){if("function"==typeof e.prependListener)return e.prependListener(t,i);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]:e.on(t,i)}(e,"error",f),e.once("close",p),e.once("finish",g),e.emit("pipe",n),r.flowing||(d("pipe resume"),n.resume()),e},I.prototype.unpipe=function(e){var t=this._readableState,i={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,i)),this;if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<r;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=K(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,i)),this},I.prototype.on=function(e,t){var n=s.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,d("on readable",r.length,r.reading),r.length?O(this):r.reading||i.nextTick(L,this))),n},I.prototype.addListener=I.prototype.on,I.prototype.removeListener=function(e,t){var n=s.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(x,this),n},I.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(x,this),t},I.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(U,e,t))}(this,e)),e.paused=!1,this},I.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},I.prototype.wrap=function(e){var t=this,i=this._readableState,n=!1;for(var r in e.on("end",(function(){if(d("wrapped end"),i.decoder&&!i.ended){var e=i.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(r){(d("wrapped data"),i.decoder&&(r=i.decoder.write(r)),i.objectMode&&null==r)||(i.objectMode||r&&r.length)&&(t.push(r)||(n=!0,e.pause()))})),e)void 0===this[r]&&"function"==typeof e[r]&&(this[r]=function(t){return function(){return e[t].apply(e,arguments)}}(r));for(var o=0;o<w.length;o++)e.on(w[o],this.emit.bind(this,w[o]));return this._read=function(t){d("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(I.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=e("./internal/streams/async_iterator")),h(this)}),Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(I.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(I.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),I._fromList=B,Object.defineProperty(I.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(I.from=function(t,i){return void 0===f&&(f=e("./internal/streams/from")),f(I,t,i)})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":122,"./_stream_duplex":123,"./internal/streams/async_iterator":128,"./internal/streams/buffer_list":129,"./internal/streams/destroy":130,"./internal/streams/from":132,"./internal/streams/state":134,"./internal/streams/stream":135,_process:247,buffer:68,events:109,inherits:151,"string_decoder/":289,util:20}],126:[function(e,t,i){arguments[4][54][0].apply(i,arguments)},{"../errors":122,"./_stream_duplex":123,dup:54,inherits:151}],127:[function(e,t,i){(function(i,n){(function(){"use strict";function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,i){var n=e.entry;e.entry=null;for(;n;){var r=n.callback;t.pendingcb--,r(i),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var o;t.exports=I,I.WritableState=T;var s={deprecate:e("util-deprecate")},a=e("./internal/streams/stream"),c=e("buffer").Buffer,d=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var l,u=e("./internal/streams/destroy"),h=e("./internal/streams/state").getHighWaterMark,f=e("../errors").codes,p=f.ERR_INVALID_ARG_TYPE,g=f.ERR_METHOD_NOT_IMPLEMENTED,v=f.ERR_MULTIPLE_CALLBACK,m=f.ERR_STREAM_CANNOT_PIPE,y=f.ERR_STREAM_DESTROYED,b=f.ERR_STREAM_NULL_VALUES,_=f.ERR_STREAM_WRITE_AFTER_END,S=f.ERR_UNKNOWN_ENCODING,E=u.errorOrDestroy;function w(){}function T(t,n,s){o=o||e("./_stream_duplex"),t=t||{},"boolean"!=typeof s&&(s=n instanceof o),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if("function"!=typeof o)throw new v;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(i.nextTick(o,r),i.nextTick(A,e,t),e._writableState.errorEmitted=!0,E(e,r)):(o(r),e._writableState.errorEmitted=!0,E(e,r),A(e,t))}(e,n,r,t,o);else{var s=C(n)||e.destroyed;s||n.corked||n.bufferProcessing||!n.bufferedRequest||M(e,n),r?i.nextTick(k,e,n,s,o):k(e,n,s,o)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function I(t){var i=this instanceof(o=o||e("./_stream_duplex"));if(!i&&!l.call(I,this))return new I(t);this._writableState=new T(t,this,i),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),a.call(this)}function R(e,t,i,n,r,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):i?e._writev(r,t.onwrite):e._write(r,o,t.onwrite),t.sync=!1}function k(e,t,i,n){i||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),A(e,t)}function M(e,t){t.bufferProcessing=!0;var i=t.bufferedRequest;if(e._writev&&i&&i.next){var n=t.bufferedRequestCount,o=new Array(n),s=t.corkedRequestsFree;s.entry=i;for(var a=0,c=!0;i;)o[a]=i,i.isBuf||(c=!1),i=i.next,a+=1;o.allBuffers=c,R(e,t,!0,t.length,o,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;i;){var d=i.chunk,l=i.encoding,u=i.callback;if(R(e,t,!1,t.objectMode?1:d.length,d,l,u),i=i.next,t.bufferedRequestCount--,t.writing)break}null===i&&(t.lastBufferedRequest=null)}t.bufferedRequest=i,t.bufferProcessing=!1}function C(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function O(e,t){e._final((function(i){t.pendingcb--,i&&E(e,i),t.prefinished=!0,e.emit("prefinish"),A(e,t)}))}function A(e,t){var n=C(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(O,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}e("inherits")(I,a),T.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(T.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(I,Symbol.hasInstance,{value:function(e){return!!l.call(this,e)||this===I&&(e&&e._writableState instanceof T)}})):l=function(e){return e instanceof this},I.prototype.pipe=function(){E(this,new m)},I.prototype.write=function(e,t,n){var r,o=this._writableState,s=!1,a=!o.objectMode&&(r=e,c.isBuffer(r)||r instanceof d);return a&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=w),o.ending?function(e,t){var n=new _;E(e,n),i.nextTick(t,n)}(this,n):(a||function(e,t,n,r){var o;return null===n?o=new b:"string"==typeof n||t.objectMode||(o=new p("chunk",["string","Buffer"],n)),!o||(E(e,o),i.nextTick(r,o),!1)}(this,o,e,n))&&(o.pendingcb++,s=function(e,t,i,n,r,o){if(!i){var s=function(e,t,i){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,i));return t}(t,n,r);n!==s&&(i=!0,r="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var d=t.length<t.highWaterMark;d||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:r,isBuf:i,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else R(e,t,!1,a,n,r,o);return d}(this,o,a,e,t,n)),s},I.prototype.cork=function(){this._writableState.corked++},I.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||M(this,e))},I.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new S(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(I.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(I.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),I.prototype._write=function(e,t,i){i(new g("_write()"))},I.prototype._writev=null,I.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,A(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(I.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),I.prototype.destroy=u.destroy,I.prototype._undestroy=u.undestroy,I.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":122,"./_stream_duplex":123,"./internal/streams/destroy":130,"./internal/streams/state":134,"./internal/streams/stream":135,_process:247,buffer:68,inherits:151,"util-deprecate":293}],128:[function(e,t,i){(function(i){(function(){"use strict";var n;function r(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var o=e("./end-of-stream"),s=Symbol("lastResolve"),a=Symbol("lastReject"),c=Symbol("error"),d=Symbol("ended"),l=Symbol("lastPromise"),u=Symbol("handlePromise"),h=Symbol("stream");function f(e,t){return{value:e,done:t}}function p(e){var t=e[s];if(null!==t){var i=e[h].read();null!==i&&(e[l]=null,e[s]=null,e[a]=null,t(f(i,!1)))}}function g(e){i.nextTick(p,e)}var v=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((r(n={get stream(){return this[h]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[d])return Promise.resolve(f(void 0,!0));if(this[h].destroyed)return new Promise((function(t,n){i.nextTick((function(){e[c]?n(e[c]):t(f(void 0,!0))}))}));var n,r=this[l];if(r)n=new Promise(function(e,t){return function(i,n){e.then((function(){t[d]?i(f(void 0,!0)):t[u](i,n)}),n)}}(r,this));else{var o=this[h].read();if(null!==o)return Promise.resolve(f(o,!1));n=new Promise(this[u])}return this[l]=n,n}},Symbol.asyncIterator,(function(){return this})),r(n,"return",(function(){var e=this;return new Promise((function(t,i){e[h].destroy(null,(function(e){e?i(e):t(f(void 0,!0))}))}))})),n),v);t.exports=function(e){var t,i=Object.create(m,(r(t={},h,{value:e,writable:!0}),r(t,s,{value:null,writable:!0}),r(t,a,{value:null,writable:!0}),r(t,c,{value:null,writable:!0}),r(t,d,{value:e._readableState.endEmitted,writable:!0}),r(t,u,{value:function(e,t){var n=i[h].read();n?(i[l]=null,i[s]=null,i[a]=null,e(f(n,!1))):(i[s]=e,i[a]=t)},writable:!0}),t));return i[l]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=i[a];return null!==t&&(i[l]=null,i[s]=null,i[a]=null,t(e)),void(i[c]=e)}var n=i[s];null!==n&&(i[l]=null,i[s]=null,i[a]=null,n(f(void 0,!0))),i[d]=!0})),e.on("readable",g.bind(null,i)),i}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":131,_process:247}],129:[function(e,t,i){arguments[4][57][0].apply(i,arguments)},{buffer:68,dup:57,util:20}],130:[function(e,t,i){(function(e){(function(){"use strict";function i(e,t){r(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}t.exports={destroy:function(t,o){var s=this,a=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return a||c?(o?o(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(r,this,t)):e.nextTick(r,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!o&&t?s._writableState?s._writableState.errorEmitted?e.nextTick(n,s):(s._writableState.errorEmitted=!0,e.nextTick(i,s,t)):e.nextTick(i,s,t):o?(e.nextTick(n,s),o(t)):e.nextTick(n,s)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var i=e._readableState,n=e._writableState;i&&i.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:247}],131:[function(e,t,i){arguments[4][59][0].apply(i,arguments)},{"../../../errors":122,dup:59}],132:[function(e,t,i){arguments[4][60][0].apply(i,arguments)},{dup:60}],133:[function(e,t,i){arguments[4][61][0].apply(i,arguments)},{"../../../errors":122,"./end-of-stream":131,dup:61}],134:[function(e,t,i){arguments[4][62][0].apply(i,arguments)},{"../../../errors":122,dup:62}],135:[function(e,t,i){arguments[4][63][0].apply(i,arguments)},{dup:63,events:109}],136:[function(e,t,i){arguments[4][64][0].apply(i,arguments)},{"./lib/_stream_duplex.js":123,"./lib/_stream_passthrough.js":124,"./lib/_stream_readable.js":125,"./lib/_stream_transform.js":126,"./lib/_stream_writable.js":127,"./lib/internal/streams/end-of-stream.js":131,"./lib/internal/streams/pipeline.js":133,dup:64}],137:[function(e,t,i){var n=i;n.utils=e("./hash/utils"),n.common=e("./hash/common"),n.sha=e("./hash/sha"),n.ripemd=e("./hash/ripemd"),n.hmac=e("./hash/hmac"),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},{"./hash/common":138,"./hash/hmac":139,"./hash/ripemd":140,"./hash/sha":141,"./hash/utils":148}],138:[function(e,t,i){"use strict";var n=e("./utils"),r=e("minimalistic-assert");function o(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}i.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var i=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-i,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-i,this.endian);for(var r=0;r<e.length;r+=this._delta32)this._update(e,r,r+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),r(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,i=t-(e+this.padLength)%t,n=new Array(i+this.padLength);n[0]=128;for(var r=1;r<i;r++)n[r]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[r++]=0;n[r++]=0,n[r++]=0,n[r++]=0,n[r++]=0,n[r++]=e>>>24&255,n[r++]=e>>>16&255,n[r++]=e>>>8&255,n[r++]=255&e}else for(n[r++]=255&e,n[r++]=e>>>8&255,n[r++]=e>>>16&255,n[r++]=e>>>24&255,n[r++]=0,n[r++]=0,n[r++]=0,n[r++]=0,o=8;o<this.padLength;o++)n[r++]=0;return n}},{"./utils":148,"minimalistic-assert":232}],139:[function(e,t,i){"use strict";var n=e("./utils"),r=e("minimalistic-assert");function o(e,t,i){if(!(this instanceof o))return new o(e,t,i);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,i))}t.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),r(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},{"./utils":148,"minimalistic-assert":232}],140:[function(e,t,i){"use strict";var n=e("./utils"),r=e("./common"),o=n.rotl32,s=n.sum32,a=n.sum32_3,c=n.sum32_4,d=r.BlockHash;function l(){if(!(this instanceof l))return new l;d.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function u(e,t,i,n){return e<=15?t^i^n:e<=31?t&i|~t&n:e<=47?(t|~i)^n:e<=63?t&n|i&~n:t^(i|~n)}function h(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function f(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(l,d),i.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(e,t){for(var i=this.h[0],n=this.h[1],r=this.h[2],d=this.h[3],l=this.h[4],y=i,b=n,_=r,S=d,E=l,w=0;w<80;w++){var T=s(o(c(i,u(w,n,r,d),e[p[w]+t],h(w)),v[w]),l);i=l,l=d,d=o(r,10),r=n,n=T,T=s(o(c(y,u(79-w,b,_,S),e[g[w]+t],f(w)),m[w]),E),y=E,E=S,S=o(_,10),_=b,b=T}T=a(this.h[1],r,S),this.h[1]=a(this.h[2],d,E),this.h[2]=a(this.h[3],l,y),this.h[3]=a(this.h[4],i,b),this.h[4]=a(this.h[0],n,_),this.h[0]=T},l.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],g=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],v=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],m=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},{"./common":138,"./utils":148}],141:[function(e,t,i){"use strict";i.sha1=e("./sha/1"),i.sha224=e("./sha/224"),i.sha256=e("./sha/256"),i.sha384=e("./sha/384"),i.sha512=e("./sha/512")},{"./sha/1":142,"./sha/224":143,"./sha/256":144,"./sha/384":145,"./sha/512":146}],142:[function(e,t,i){"use strict";var n=e("../utils"),r=e("../common"),o=e("./common"),s=n.rotl32,a=n.sum32,c=n.sum32_5,d=o.ft_1,l=r.BlockHash,u=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,l),t.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(e,t){for(var i=this.W,n=0;n<16;n++)i[n]=e[t+n];for(;n<i.length;n++)i[n]=s(i[n-3]^i[n-8]^i[n-14]^i[n-16],1);var r=this.h[0],o=this.h[1],l=this.h[2],h=this.h[3],f=this.h[4];for(n=0;n<i.length;n++){var p=~~(n/20),g=c(s(r,5),d(p,o,l,h),f,i[n],u[p]);f=h,h=l,l=s(o,30),o=r,r=g}this.h[0]=a(this.h[0],r),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],l),this.h[3]=a(this.h[3],h),this.h[4]=a(this.h[4],f)},h.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":138,"../utils":148,"./common":147}],143:[function(e,t,i){"use strict";var n=e("../utils"),r=e("./256");function o(){if(!(this instanceof o))return new o;r.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,r),t.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},{"../utils":148,"./256":144}],144:[function(e,t,i){"use strict";var n=e("../utils"),r=e("../common"),o=e("./common"),s=e("minimalistic-assert"),a=n.sum32,c=n.sum32_4,d=n.sum32_5,l=o.ch32,u=o.maj32,h=o.s0_256,f=o.s1_256,p=o.g0_256,g=o.g1_256,v=r.BlockHash,m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function y(){if(!(this instanceof y))return new y;v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=m,this.W=new Array(64)}n.inherits(y,v),t.exports=y,y.blockSize=512,y.outSize=256,y.hmacStrength=192,y.padLength=64,y.prototype._update=function(e,t){for(var i=this.W,n=0;n<16;n++)i[n]=e[t+n];for(;n<i.length;n++)i[n]=c(g(i[n-2]),i[n-7],p(i[n-15]),i[n-16]);var r=this.h[0],o=this.h[1],v=this.h[2],m=this.h[3],y=this.h[4],b=this.h[5],_=this.h[6],S=this.h[7];for(s(this.k.length===i.length),n=0;n<i.length;n++){var E=d(S,f(y),l(y,b,_),this.k[n],i[n]),w=a(h(r),u(r,o,v));S=_,_=b,b=y,y=a(m,E),m=v,v=o,o=r,r=a(E,w)}this.h[0]=a(this.h[0],r),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],v),this.h[3]=a(this.h[3],m),this.h[4]=a(this.h[4],y),this.h[5]=a(this.h[5],b),this.h[6]=a(this.h[6],_),this.h[7]=a(this.h[7],S)},y.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":138,"../utils":148,"./common":147,"minimalistic-assert":232}],145:[function(e,t,i){"use strict";var n=e("../utils"),r=e("./512");function o(){if(!(this instanceof o))return new o;r.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,r),t.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},{"../utils":148,"./512":146}],146:[function(e,t,i){"use strict";var n=e("../utils"),r=e("../common"),o=e("minimalistic-assert"),s=n.rotr64_hi,a=n.rotr64_lo,c=n.shr64_hi,d=n.shr64_lo,l=n.sum64,u=n.sum64_hi,h=n.sum64_lo,f=n.sum64_4_hi,p=n.sum64_4_lo,g=n.sum64_5_hi,v=n.sum64_5_lo,m=r.BlockHash,y=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function b(){if(!(this instanceof b))return new b;m.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=y,this.W=new Array(160)}function _(e,t,i,n,r){var o=e&i^~e&r;return o<0&&(o+=4294967296),o}function S(e,t,i,n,r,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function E(e,t,i,n,r){var o=e&i^e&r^i&r;return o<0&&(o+=4294967296),o}function w(e,t,i,n,r,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function T(e,t){var i=s(e,t,28)^s(t,e,2)^s(t,e,7);return i<0&&(i+=4294967296),i}function I(e,t){var i=a(e,t,28)^a(t,e,2)^a(t,e,7);return i<0&&(i+=4294967296),i}function R(e,t){var i=s(e,t,14)^s(e,t,18)^s(t,e,9);return i<0&&(i+=4294967296),i}function k(e,t){var i=a(e,t,14)^a(e,t,18)^a(t,e,9);return i<0&&(i+=4294967296),i}function M(e,t){var i=s(e,t,1)^s(e,t,8)^c(e,t,7);return i<0&&(i+=4294967296),i}function C(e,t){var i=a(e,t,1)^a(e,t,8)^d(e,t,7);return i<0&&(i+=4294967296),i}function O(e,t){var i=s(e,t,19)^s(t,e,29)^c(e,t,6);return i<0&&(i+=4294967296),i}function A(e,t){var i=a(e,t,19)^a(t,e,29)^d(e,t,6);return i<0&&(i+=4294967296),i}n.inherits(b,m),t.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(e,t){for(var i=this.W,n=0;n<32;n++)i[n]=e[t+n];for(;n<i.length;n+=2){var r=O(i[n-4],i[n-3]),o=A(i[n-4],i[n-3]),s=i[n-14],a=i[n-13],c=M(i[n-30],i[n-29]),d=C(i[n-30],i[n-29]),l=i[n-32],u=i[n-31];i[n]=f(r,o,s,a,c,d,l,u),i[n+1]=p(r,o,s,a,c,d,l,u)}},b.prototype._update=function(e,t){this._prepareBlock(e,t);var i=this.W,n=this.h[0],r=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4],d=this.h[5],f=this.h[6],p=this.h[7],m=this.h[8],y=this.h[9],b=this.h[10],M=this.h[11],C=this.h[12],O=this.h[13],A=this.h[14],P=this.h[15];o(this.k.length===i.length);for(var D=0;D<i.length;D+=2){var x=A,L=P,U=R(m,y),N=k(m,y),B=_(m,y,b,M,C),j=S(m,y,b,M,C,O),F=this.k[D],K=this.k[D+1],q=i[D],$=i[D+1],V=g(x,L,U,N,B,j,F,K,q,$),H=v(x,L,U,N,B,j,F,K,q,$);x=T(n,r),L=I(n,r),U=E(n,r,s,a,c),N=w(n,r,s,a,c,d);var W=u(x,L,U,N),G=h(x,L,U,N);A=C,P=O,C=b,O=M,b=m,M=y,m=u(f,p,V,H),y=h(p,p,V,H),f=c,p=d,c=s,d=a,s=n,a=r,n=u(V,H,W,G),r=h(V,H,W,G)}l(this.h,0,n,r),l(this.h,2,s,a),l(this.h,4,c,d),l(this.h,6,f,p),l(this.h,8,m,y),l(this.h,10,b,M),l(this.h,12,C,O),l(this.h,14,A,P)},b.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},{"../common":138,"../utils":148,"minimalistic-assert":232}],147:[function(e,t,i){"use strict";var n=e("../utils").rotr32;function r(e,t,i){return e&t^~e&i}function o(e,t,i){return e&t^e&i^t&i}function s(e,t,i){return e^t^i}i.ft_1=function(e,t,i,n){return 0===e?r(t,i,n):1===e||3===e?s(t,i,n):2===e?o(t,i,n):void 0},i.ch32=r,i.maj32=o,i.p32=s,i.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},i.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},i.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},i.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},{"../utils":148}],148:[function(e,t,i){"use strict";var n=e("minimalistic-assert"),r=e("inherits");function o(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function a(e){return 1===e.length?"0"+e:e}function c(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}i.inherits=r,i.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var i=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),r=0;r<e.length;r+=2)i.push(parseInt(e[r]+e[r+1],16))}else for(var n=0,r=0;r<e.length;r++){var s=e.charCodeAt(r);s<128?i[n++]=s:s<2048?(i[n++]=s>>6|192,i[n++]=63&s|128):o(e,r)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++r)),i[n++]=s>>18|240,i[n++]=s>>12&63|128,i[n++]=s>>6&63|128,i[n++]=63&s|128):(i[n++]=s>>12|224,i[n++]=s>>6&63|128,i[n++]=63&s|128)}else for(r=0;r<e.length;r++)i[r]=0|e[r];return i},i.toHex=function(e){for(var t="",i=0;i<e.length;i++)t+=a(e[i].toString(16));return t},i.htonl=s,i.toHex32=function(e,t){for(var i="",n=0;n<e.length;n++){var r=e[n];"little"===t&&(r=s(r)),i+=c(r.toString(16))}return i},i.zero2=a,i.zero8=c,i.join32=function(e,t,i,r){var o=i-t;n(o%4==0);for(var s=new Array(o/4),a=0,c=t;a<s.length;a++,c+=4){var d;d="big"===r?e[c]<<24|e[c+1]<<16|e[c+2]<<8|e[c+3]:e[c+3]<<24|e[c+2]<<16|e[c+1]<<8|e[c],s[a]=d>>>0}return s},i.split32=function(e,t){for(var i=new Array(4*e.length),n=0,r=0;n<e.length;n++,r+=4){var o=e[n];"big"===t?(i[r]=o>>>24,i[r+1]=o>>>16&255,i[r+2]=o>>>8&255,i[r+3]=255&o):(i[r+3]=o>>>24,i[r+2]=o>>>16&255,i[r+1]=o>>>8&255,i[r]=255&o)}return i},i.rotr32=function(e,t){return e>>>t|e<<32-t},i.rotl32=function(e,t){return e<<t|e>>>32-t},i.sum32=function(e,t){return e+t>>>0},i.sum32_3=function(e,t,i){return e+t+i>>>0},i.sum32_4=function(e,t,i,n){return e+t+i+n>>>0},i.sum32_5=function(e,t,i,n,r){return e+t+i+n+r>>>0},i.sum64=function(e,t,i,n){var r=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+i+r;e[t]=s>>>0,e[t+1]=o},i.sum64_hi=function(e,t,i,n){return(t+n>>>0<t?1:0)+e+i>>>0},i.sum64_lo=function(e,t,i,n){return t+n>>>0},i.sum64_4_hi=function(e,t,i,n,r,o,s,a){var c=0,d=t;return c+=(d=d+n>>>0)<t?1:0,c+=(d=d+o>>>0)<o?1:0,e+i+r+s+(c+=(d=d+a>>>0)<a?1:0)>>>0},i.sum64_4_lo=function(e,t,i,n,r,o,s,a){return t+n+o+a>>>0},i.sum64_5_hi=function(e,t,i,n,r,o,s,a,c,d){var l=0,u=t;return l+=(u=u+n>>>0)<t?1:0,l+=(u=u+o>>>0)<o?1:0,l+=(u=u+a>>>0)<a?1:0,e+i+r+s+c+(l+=(u=u+d>>>0)<d?1:0)>>>0},i.sum64_5_lo=function(e,t,i,n,r,o,s,a,c,d){return t+n+o+a+d>>>0},i.rotr64_hi=function(e,t,i){return(t<<32-i|e>>>i)>>>0},i.rotr64_lo=function(e,t,i){return(e<<32-i|t>>>i)>>>0},i.shr64_hi=function(e,t,i){return e>>>i},i.shr64_lo=function(e,t,i){return(e<<32-i|t>>>i)>>>0}},{inherits:151,"minimalistic-assert":232}],149:[function(e,t,i){"use strict";var n=e("hash.js"),r=e("minimalistic-crypto-utils"),o=e("minimalistic-assert");function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=r.toArray(e.entropy,e.entropyEnc||"hex"),i=r.toArray(e.nonce,e.nonceEnc||"hex"),n=r.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,i,n)}t.exports=s,s.prototype._init=function(e,t,i){var n=e.concat(t).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var r=0;r<this.V.length;r++)this.K[r]=0,this.V[r]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},s.prototype.reseed=function(e,t,i,n){"string"!=typeof t&&(n=i,i=t,t=null),e=r.toArray(e,t),i=r.toArray(i,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(i||[])),this._reseed=1},s.prototype.generate=function(e,t,i,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=i,i=t,t=null),i&&(i=r.toArray(i,n||"hex"),this._update(i));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(i),this._reseed++,r.encode(s,t)}},{"hash.js":137,"minimalistic-assert":232,"minimalistic-crypto-utils":233}],150:[function(e,t,i){ | |
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */ | |
i.read=function(e,t,i,n,r){var o,s,a=8*r-n-1,c=(1<<a)-1,d=c>>1,l=-7,u=i?r-1:0,h=i?-1:1,f=e[t+u];for(u+=h,o=f&(1<<-l)-1,f>>=-l,l+=a;l>0;o=256*o+e[t+u],u+=h,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+u],u+=h,l-=8);if(0===o)o=1-d;else{if(o===c)return s?NaN:1/0*(f?-1:1);s+=Math.pow(2,n),o-=d}return(f?-1:1)*s*Math.pow(2,o-n)},i.write=function(e,t,i,n,r,o){var s,a,c,d=8*o-r-1,l=(1<<d)-1,u=l>>1,h=23===r?Math.pow(2,-24)-Math.pow(2,-77):0,f=n?0:o-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+u>=1?h/c:h*Math.pow(2,1-u))*c>=2&&(s++,c/=2),s+u>=l?(a=0,s=l):s+u>=1?(a=(t*c-1)*Math.pow(2,r),s+=u):(a=t*Math.pow(2,u-1)*Math.pow(2,r),s=0));r>=8;e[i+f]=255&a,f+=p,a/=256,r-=8);for(s=s<<r|a,d+=r;d>0;e[i+f]=255&s,f+=p,s/=256,d-=8);e[i+f-p]|=128*g}},{}],151:[function(e,t,i){"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var i=function(){};i.prototype=t.prototype,e.prototype=new i,e.prototype.constructor=e}}},{}],152:[function(e,t,i){"use strict";var n=e("has-tostringtag/shams")(),r=e("call-bind/callBound")("Object.prototype.toString"),o=function(e){return!(n&&e&&"object"==typeof e&&Symbol.toStringTag in e)&&"[object Arguments]"===r(e)},s=function(e){return!!o(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==r(e)&&"[object Function]"===r(e.callee)},a=function(){return o(arguments)}();o.isLegacyArguments=s,t.exports=a?o:s},{"call-bind/callBound":69,"has-tostringtag/shams":119}],153:[function(e,t,i){"use strict";var n,r,o=Function.prototype.toString,s="object"==typeof Reflect&&null!==Reflect&&Reflect.apply;if("function"==typeof s&&"function"==typeof Object.defineProperty)try{n=Object.defineProperty({},"length",{get:function(){throw r}}),r={},s((function(){throw 42}),null,n)}catch(e){e!==r&&(s=null)}else s=null;var a=/^\s*class\b/,c=function(e){try{var t=o.call(e);return a.test(t)}catch(e){return!1}},d=function(e){try{return!c(e)&&(o.call(e),!0)}catch(e){return!1}},l=Object.prototype.toString,u="function"==typeof Symbol&&!!Symbol.toStringTag,h=!(0 in[,]),f=function(){return!1};if("object"==typeof document){var p=document.all;l.call(p)===l.call(document.all)&&(f=function(e){if((h||!e)&&(void 0===e||"object"==typeof e))try{var t=l.call(e);return("[object HTMLAllCollection]"===t||"[object HTML document.all class]"===t||"[object HTMLCollection]"===t||"[object Object]"===t)&&null==e("")}catch(e){}return!1})}t.exports=s?function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;try{s(e,null,n)}catch(e){if(e!==r)return!1}return!c(e)&&d(e)}:function(e){if(f(e))return!0;if(!e)return!1;if("function"!=typeof e&&"object"!=typeof e)return!1;if(u)return d(e);if(c(e))return!1;var t=l.call(e);return!("[object Function]"!==t&&"[object GeneratorFunction]"!==t&&!/^\[object HTML/.test(t))&&d(e)}},{}],154:[function(e,t,i){"use strict";var n,r=Object.prototype.toString,o=Function.prototype.toString,s=/^\s*(?:function)?\*/,a=e("has-tostringtag/shams")(),c=Object.getPrototypeOf;t.exports=function(e){if("function"!=typeof e)return!1;if(s.test(o.call(e)))return!0;if(!a)return"[object GeneratorFunction]"===r.call(e);if(!c)return!1;if(void 0===n){var t=function(){if(!a)return!1;try{return Function("return function*() {}")()}catch(e){}}();n=!!t&&c(t)}return c(e)===n}},{"has-tostringtag/shams":119}],155:[function(e,t,i){"use strict";var n=e("which-typed-array");t.exports=function(e){return!!n(e)}},{"which-typed-array":313}],156:[function(e,t,i){"use strict";function n(e){this.message=e}n.prototype=new Error,n.prototype.name="InvalidCharacterError";var r="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new n("'atob' failed: The string to be decoded is not correctly encoded.");for(var i,r,o=0,s=0,a="";r=t.charAt(s++);~r&&(i=o%4?64*i+r:r,o++%4)?a+=String.fromCharCode(255&i>>(-2*o&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return a};function o(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(r(e).replace(/(.)/g,(function(e,t){var i=t.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i})))}(t)}catch(e){return r(t)}}function s(e){this.message=e}function a(e,t){if("string"!=typeof e)throw new s("Invalid token specified");var i=!0===(t=t||{}).header?0:1;try{return JSON.parse(o(e.split(".")[i]))}catch(e){throw new s("Invalid token specified: "+e.message)}}s.prototype=new Error,s.prototype.name="InvalidTokenError";const c=a;c.default=a,c.InvalidTokenError=s,t.exports=c},{}],157:[function(e,t,i){!function(e,i){"use strict";"function"==typeof define&&define.amd?define(i):"object"==typeof t&&t.exports?t.exports=i():e.log=i()}(this,(function(){"use strict";var e=function(){},t="undefined",i=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"];function r(e,t){var i=e[t];if("function"==typeof i.bind)return i.bind(e);try{return Function.prototype.bind.call(i,e)}catch(t){return function(){return Function.prototype.apply.apply(i,[e,arguments])}}}function o(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function s(t,i){for(var r=0;r<n.length;r++){var o=n[r];this[o]=r<t?e:this.methodFactory(o,t,i)}this.log=this.debug}function a(e,i,n){return function(){typeof console!==t&&(s.call(this,i,n),this[e].apply(this,arguments))}}function c(n,s,c){return function(n){return"debug"===n&&(n="log"),typeof console!==t&&("trace"===n&&i?o:void 0!==console[n]?r(console,n):void 0!==console.log?r(console,"log"):e)}(n)||a.apply(this,arguments)}function d(e,i,r){var o,a=this;i=null==i?"WARN":i;var d="loglevel";function l(){var e;if(typeof window!==t&&d){try{e=window.localStorage[d]}catch(e){}if(typeof e===t)try{var i=window.document.cookie,n=i.indexOf(encodeURIComponent(d)+"=");-1!==n&&(e=/^([^;]+)/.exec(i.slice(n))[1])}catch(e){}return void 0===a.levels[e]&&(e=void 0),e}}"string"==typeof e?d+=":"+e:"symbol"==typeof e&&(d=void 0),a.name=e,a.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},a.methodFactory=r||c,a.getLevel=function(){return o},a.setLevel=function(i,r){if("string"==typeof i&&void 0!==a.levels[i.toUpperCase()]&&(i=a.levels[i.toUpperCase()]),!("number"==typeof i&&i>=0&&i<=a.levels.SILENT))throw"log.setLevel() called with invalid level: "+i;if(o=i,!1!==r&&function(e){var i=(n[e]||"silent").toUpperCase();if(typeof window!==t&&d){try{return void(window.localStorage[d]=i)}catch(e){}try{window.document.cookie=encodeURIComponent(d)+"="+i+";"}catch(e){}}}(i),s.call(a,i,e),typeof console===t&&i<a.levels.SILENT)return"No console available for logging"},a.setDefaultLevel=function(e){i=e,l()||a.setLevel(e,!1)},a.resetLevel=function(){a.setLevel(i,!1),function(){if(typeof window!==t&&d){try{return void window.localStorage.removeItem(d)}catch(e){}try{window.document.cookie=encodeURIComponent(d)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}()},a.enableAll=function(e){a.setLevel(a.levels.TRACE,e)},a.disableAll=function(e){a.setLevel(a.levels.SILENT,e)};var u=l();null==u&&(u=i),a.setLevel(u,!1)}var l=new d,u={};l.getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=u[e];return t||(t=u[e]=new d(e,l.getLevel(),l.methodFactory)),t};var h=typeof window!==t?window.log:void 0;return l.noConflict=function(){return typeof window!==t&&window.log===l&&(window.log=h),l},l.getLoggers=function(){return u},l.default=l,l}))},{}],158:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ExtensibleEvents=void 0;var n=e("./NamespacedMap"),r=e("./InvalidEventError"),o=e("./interpreters/legacy/MRoomMessage"),s=e("./interpreters/modern/MMessage"),a=e("./events/message_types"),c=e("./events/poll_types"),d=e("./interpreters/modern/MPoll");function l(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return u(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return u(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}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 o,s=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function h(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var p=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),f(this,"interpreters",new n.NamespacedMap([[o.LEGACY_M_ROOM_MESSAGE,o.parseMRoomMessage],[a.M_MESSAGE,s.parseMMessage],[a.M_EMOTE,s.parseMMessage],[a.M_NOTICE,s.parseMMessage],[c.M_POLL_START,d.parseMPoll],[c.M_POLL_RESPONSE,d.parseMPoll],[c.M_POLL_END,d.parseMPoll]])),f(this,"_unknownInterpretOrder",[a.M_MESSAGE])}var t,i,u;return t=e,u=[{key:"defaultInstance",get:function(){return e._defaultInstance}},{key:"unknownInterpretOrder",get:function(){return e.defaultInstance.unknownInterpretOrder},set:function(t){e.defaultInstance.unknownInterpretOrder=t}},{key:"registerInterpreter",value:function(t,i){e.defaultInstance.registerInterpreter(t,i)}},{key:"parse",value:function(t){return e.defaultInstance.parse(t)}}],(i=[{key:"unknownInterpretOrder",get:function(){var e;return null!==(e=this._unknownInterpretOrder)&&void 0!==e?e:[]},set:function(e){this._unknownInterpretOrder=e}},{key:"registerInterpreter",value:function(e,t){this.interpreters.set(e,t)}},{key:"parse",value:function(e){try{if(this.interpreters.hasNamespaced(e.type))return this.interpreters.getNamespaced(e.type)(e);var t,i=l(this.unknownInterpretOrder);try{for(i.s();!(t=i.n()).done;){var n=t.value;if(this.interpreters.has(n)){var o=this.interpreters.get(n)(e);if(o)return o}}}catch(e){i.e(e)}finally{i.f()}return null}catch(e){if(e instanceof r.InvalidEventError)return null;throw e}}}])&&h(t.prototype,i),u&&h(t,u),Object.defineProperty(t,"prototype",{writable:!1}),e}();i.ExtensibleEvents=p,f(p,"_defaultInstance",new p)},{"./InvalidEventError":160,"./NamespacedMap":161,"./events/message_types":170,"./events/poll_types":171,"./interpreters/legacy/MRoomMessage":174,"./interpreters/modern/MMessage":175,"./interpreters/modern/MPoll":176}],159:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],160:[function(e,t,i){"use strict";function n(e){return n="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},n(e)}function r(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function o(e){var t=c();return function(){var i,r=l(e);if(t){var o=l(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,i)}}function s(e){var t="function"==typeof Map?new Map:void 0;return s=function(e){if(null===e||(i=e,-1===Function.toString.call(i).indexOf("[native code]")))return e;var i;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return a(e,arguments,l(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),d(n,e)},s(e)}function a(e,t,i){return a=c()?Reflect.construct:function(e,t,i){var n=[null];n.push.apply(n,t);var r=new(Function.bind.apply(e,n));return i&&d(r,i.prototype),r},a.apply(null,arguments)}function c(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}Object.defineProperty(i,"__esModule",{value:!0}),i.InvalidEventError=void 0;var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(a,e);var t,i,n,s=o(a);function a(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),s.call(this,e)}return t=a,i&&r(t.prototype,i),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}(s(Error));i.InvalidEventError=u},{}],161:[function(e,t,i){"use strict";function n(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return r(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return r(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}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(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){c=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(c)throw s}}}}function r(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function o(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(i,"__esModule",{value:!0}),i.NamespacedMap=void 0;var s=function(){function e(t){var i,r,o;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i=this,r="internalMap",o=new Map,r in i?Object.defineProperty(i,r,{value:o,enumerable:!0,configurable:!0,writable:!0}):i[r]=o,t){var s,a=n(t);try{for(a.s();!(s=a.n()).done;){var c=s.value;this.set(c[0],c[1])}}catch(e){a.e(e)}finally{a.f()}}}var t,i,r;return t=e,(i=[{key:"get",value:function(e){return e.name&&this.internalMap.has(e.name)?this.internalMap.get(e.name):e.altName&&this.internalMap.has(e.altName)?this.internalMap.get(e.altName):null}},{key:"set",value:function(e,t){e.name&&this.internalMap.set(e.name,t),e.altName&&this.internalMap.set(e.altName,t)}},{key:"has",value:function(e){return!!this.get(e)}},{key:"delete",value:function(e){e.name&&this.internalMap.delete(e.name),e.altName&&this.internalMap.delete(e.altName)}},{key:"hasNamespaced",value:function(e){return this.internalMap.has(e)}},{key:"getNamespaced",value:function(e){return this.internalMap.get(e)}}])&&o(t.prototype,i),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();i.NamespacedMap=s},{}],162:[function(e,t,i){"use strict";function n(e){return n="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},n(e)}function r(e,t){return r=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},r(e,t)}function o(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,r=s(e);if(t){var o=s(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,i)}}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function d(e,t,i){return t&&c(e.prototype,t),i&&c(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}Object.defineProperty(i,"__esModule",{value:!0}),i.UnstableValue=i.NamespacedValue=void 0;var l=function(){function e(t,i){if(a(this,e),this.stable=t,this.unstable=i,!this.unstable&&!this.stable)throw new Error("One of stable or unstable values must be supplied")}return d(e,[{key:"name",get:function(){return this.stable?this.stable:this.unstable}},{key:"altName",get:function(){return this.stable?this.unstable:null}},{key:"matches",value:function(e){return!!this.name&&this.name===e||!!this.altName&&this.altName===e}},{key:"findIn",value:function(e){var t;return this.name&&(t=null==e?void 0:e[this.name]),!t&&this.altName&&(t=null==e?void 0:e[this.altName]),t}},{key:"includedIn",value:function(e){var t=!1;return this.name&&(t=e.includes(this.name)),!t&&this.altName&&(t=e.includes(this.altName)),t}}]),e}();i.NamespacedValue=l;var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&r(e,t)}(i,e);var t=o(i);function i(e,n){var r;if(a(this,i),!(r=t.call(this,e,n)).unstable)throw new Error("Unstable value must be supplied");return r}return d(i,[{key:"name",get:function(){return this.unstable}},{key:"altName",get:function(){return this.stable}}]),i}(l);i.UnstableValue=u},{}],163:[function(e,t,i){"use strict";function n(e){return n="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},n(e)}Object.defineProperty(i,"__esModule",{value:!0}),i.EmoteEvent=void 0;var r=e("./MessageEvent"),o=e("./message_types"),s=e("../utility/events");function a(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function c(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function d(){return d="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=h(e)););return e}(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}},d.apply(this,arguments)}function l(e,t){return l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},l(e,t)}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,r=h(e);if(t){var o=h(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,i)}}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(f,e);var t,i,n,r=u(f);function f(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),r.call(this,e)}return t=f,n=[{key:"from",value:function(e,t){var i;return new f({type:o.M_EMOTE.name,content:(i={},a(i,o.M_TEXT.name,e),a(i,o.M_HTML.name,t),i)})}}],(i=[{key:"isEmote",get:function(){return!0}},{key:"isEquivalentTo",value:function(e){return(0,s.isEventTypeSame)(e,o.M_EMOTE)||d(h(f.prototype),"isEquivalentTo",this).call(this,e)}},{key:"serialize",value:function(){var e=d(h(f.prototype),"serialize",this).call(this);return e.content.msgtype="m.emote",e}}])&&c(t.prototype,i),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),f}(r.MessageEvent);i.EmoteEvent=f},{"../utility/events":179,"./MessageEvent":165,"./message_types":170}],164:[function(e,t,i){"use strict";function n(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}Object.defineProperty(i,"__esModule",{value:!0}),i.ExtensibleEvent=void 0;var r=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.wireFormat=t}var t,i,r;return t=e,(i=[{key:"wireContent",get:function(){return this.wireFormat.content}}])&&n(t.prototype,i),r&&n(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();i.ExtensibleEvent=r},{}],165:[function(e,t,i){"use strict";function n(e){return n="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},n(e)}Object.defineProperty(i,"__esModule",{value:!0}),i.MessageEvent=void 0;var r=e("./ExtensibleEvent"),o=e("../types"),s=e("../InvalidEventError"),a=e("./message_types"),c=e("../utility/events");function d(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function l(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?d(Object(i),!0).forEach((function(t){v(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):d(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function u(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,r=g(e);if(t){var o=g(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return p(e)}(this,i)}}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function g(e){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},g(e)}function v(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&h(e,t)}(d,e);var t,i,n,r=f(d);function d(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,d),v(p(t=r.call(this,e)),"text",void 0),v(p(t),"html",void 0),v(p(t),"renderings",void 0);var i=a.M_MESSAGE.findIn(t.wireContent),n=a.M_TEXT.findIn(t.wireContent),c=a.M_HTML.findIn(t.wireContent);if((0,o.isProvided)(i)){if(!Array.isArray(i))throw new s.InvalidEventError("m.message contents must be an array");var l=i.find((function(e){return!(0,o.isProvided)(e.mimetype)||"text/plain"===e.mimetype})),u=i.find((function(e){return"text/html"===e.mimetype}));if(!l)throw new s.InvalidEventError("m.message is missing a plain text representation");t.text=l.body,t.html=null==u?void 0:u.body,t.renderings=i}else{if(!(0,o.isOptionalAString)(n))throw new s.InvalidEventError("Missing textual representation for event");t.text=n,t.html=c,t.renderings=[{body:n,mimetype:"text/plain"}],t.html&&t.renderings.push({body:t.html,mimetype:"text/html"})}return t}return t=d,n=[{key:"from",value:function(e,t){var i;return new d({type:a.M_MESSAGE.name,content:(i={},v(i,a.M_TEXT.name,e),v(i,a.M_HTML.name,t),i)})}}],(i=[{key:"isEmote",get:function(){return a.M_EMOTE.matches(this.wireFormat.type)||(0,o.isProvided)(a.M_EMOTE.findIn(this.wireFormat.content))}},{key:"isNotice",get:function(){return a.M_NOTICE.matches(this.wireFormat.type)||(0,o.isProvided)(a.M_NOTICE.findIn(this.wireFormat.content))}},{key:"isEquivalentTo",value:function(e){return(0,c.isEventTypeSame)(e,a.M_MESSAGE)}},{key:"serializeMMessageOnly",value:function(){var e=v({},a.M_MESSAGE.name,this.renderings);if(1===this.renderings.length){var t=this.renderings[0].mimetype;void 0!==t&&"text/plain"!==t||(e=v({},a.M_TEXT.name,this.renderings[0].body))}return e}},{key:"serialize",value:function(){var e;return{type:"m.room.message",content:l(l({},this.serializeMMessageOnly()),{},{body:this.text,msgtype:"m.text",format:this.html?"org.matrix.custom.html":void 0,formatted_body:null!==(e=this.html)&&void 0!==e?e:void 0})}}}])&&u(t.prototype,i),n&&u(t,n),Object.defineProperty(t,"prototype",{writable:!1}),d}(r.ExtensibleEvent);i.MessageEvent=m},{"../InvalidEventError":160,"../types":177,"../utility/events":179,"./ExtensibleEvent":164,"./message_types":170}],166:[function(e,t,i){"use strict";function n(e){return n="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},n(e)}Object.defineProperty(i,"__esModule",{value:!0}),i.NoticeEvent=void 0;var r=e("./MessageEvent"),o=e("./message_types"),s=e("../utility/events");function a(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function c(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function d(){return d="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,i){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=h(e)););return e}(e,t);if(n){var r=Object.getOwnPropertyDescriptor(n,t);return r.get?r.get.call(arguments.length<3?e:i):r.value}},d.apply(this,arguments)}function l(e,t){return l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},l(e,t)}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,r=h(e);if(t){var o=h(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(this,i)}}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}var f=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(f,e);var t,i,n,r=u(f);function f(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),r.call(this,e)}return t=f,n=[{key:"from",value:function(e,t){var i;return new f({type:o.M_NOTICE.name,content:(i={},a(i,o.M_TEXT.name,e),a(i,o.M_HTML.name,t),i)})}}],(i=[{key:"isNotice",get:function(){return!0}},{key:"isEquivalentTo",value:function(e){return(0,s.isEventTypeSame)(e,o.M_NOTICE)||d(h(f.prototype),"isEquivalentTo",this).call(this,e)}},{key:"serialize",value:function(){var e=d(h(f.prototype),"serialize",this).call(this);return e.content.msgtype="m.notice",e}}])&&c(t.prototype,i),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),f}(r.MessageEvent);i.NoticeEvent=f},{"../utility/events":179,"./MessageEvent":165,"./message_types":170}],167:[function(e,t,i){"use strict";function n(e){return n="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},n(e)}Object.defineProperty(i,"__esModule",{value:!0}),i.PollEndEvent=void 0;var r=e("./poll_types"),o=e("../InvalidEventError"),s=e("./relationship_types"),a=e("./MessageEvent"),c=e("./message_types"),d=e("../utility/events");function l(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function u(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?l(Object(i),!0).forEach((function(t){m(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):l(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function h(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f(e,t){return f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},f(e,t)}function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,r=v(e);if(t){var o=v(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return g(e)}(this,i)}}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function m(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}(v,e);var t,i,n,l=p(v);function v(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,v),m(g(t=l.call(this,e)),"pollEventId",void 0),m(g(t),"closingMessage",void 0);var i=t.wireContent["m.relates_to"];if(!s.REFERENCE_RELATION.matches(null==i?void 0:i.rel_type)||"string"!=typeof(null==i?void 0:i.event_id))throw new o.InvalidEventError("Relationship must be a reference to an event");return t.pollEventId=i.event_id,t.closingMessage=new a.MessageEvent(t.wireFormat),t}return t=v,n=[{key:"from",value:function(e,t){var i;return new v({type:r.M_POLL_END.name,content:(i={"m.relates_to":{rel_type:s.REFERENCE_RELATION.name,event_id:e}},m(i,r.M_POLL_END.name,{}),m(i,c.M_TEXT.name,t),i)})}}],(i=[{key:"isEquivalentTo",value:function(e){return(0,d.isEventTypeSame)(e,r.M_POLL_END)}},{key:"serialize",value:function(){return{type:r.M_POLL_END.name,content:u(m({"m.relates_to":{rel_type:s.REFERENCE_RELATION.name,event_id:this.pollEventId}},r.M_POLL_END.name,{}),this.closingMessage.serialize().content)}}}])&&h(t.prototype,i),n&&h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),v}(e("./ExtensibleEvent").ExtensibleEvent);i.PollEndEvent=y},{"../InvalidEventError":160,"../utility/events":179,"./ExtensibleEvent":164,"./MessageEvent":165,"./message_types":170,"./poll_types":171,"./relationship_types":172}],168:[function(e,t,i){"use strict";function n(e){return n="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},n(e)}Object.defineProperty(i,"__esModule",{value:!0}),i.PollResponseEvent=void 0;var r=e("./ExtensibleEvent"),o=e("./poll_types"),s=e("../InvalidEventError"),a=e("./relationship_types"),c=e("../utility/events");function d(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function l(e,t){return l=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},l(e,t)}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,r=f(e);if(t){var o=f(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return h(e)}(this,i)}}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function f(e){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},f(e)}function p(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(f,e);var t,i,n,r=u(f);function f(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,f),p(h(t=r.call(this,e)),"internalAnswerIds",void 0),p(h(t),"internalSpoiled",void 0),p(h(t),"pollEventId",void 0);var i=t.wireContent["m.relates_to"];if(!a.REFERENCE_RELATION.matches(null==i?void 0:i.rel_type)||"string"!=typeof(null==i?void 0:i.event_id))throw new s.InvalidEventError("Relationship must be a reference to an event");return t.pollEventId=i.event_id,t.validateAgainst(null),t}return t=f,n=[{key:"from",value:function(e,t){return new f({type:o.M_POLL_RESPONSE.name,content:p({"m.relates_to":{rel_type:a.REFERENCE_RELATION.name,event_id:t}},o.M_POLL_RESPONSE.name,{answers:e})})}}],(i=[{key:"answerIds",get:function(){return this.internalAnswerIds}},{key:"spoiled",get:function(){return this.internalSpoiled}},{key:"validateAgainst",value:function(e){var t=o.M_POLL_RESPONSE.findIn(this.wireContent);if(!Array.isArray(null==t?void 0:t.answers))return this.internalSpoiled=!0,void(this.internalAnswerIds=[]);var i=t.answers;if(i.some((function(e){return"string"!=typeof e}))||0===i.length)return this.internalSpoiled=!0,void(this.internalAnswerIds=[]);if(e){if(i.some((function(t){return!e.answers.some((function(e){return e.id===t}))})))return this.internalSpoiled=!0,void(this.internalAnswerIds=[]);i=i.slice(0,e.maxSelections)}this.internalAnswerIds=i,this.internalSpoiled=!1}},{key:"isEquivalentTo",value:function(e){return(0,c.isEventTypeSame)(e,o.M_POLL_RESPONSE)}},{key:"serialize",value:function(){return{type:o.M_POLL_RESPONSE.name,content:p({"m.relates_to":{rel_type:a.REFERENCE_RELATION.name,event_id:this.pollEventId}},o.M_POLL_RESPONSE.name,{answers:this.spoiled?void 0:this.answerIds})}}}])&&d(t.prototype,i),n&&d(t,n),Object.defineProperty(t,"prototype",{writable:!1}),f}(r.ExtensibleEvent);i.PollResponseEvent=g},{"../InvalidEventError":160,"../utility/events":179,"./ExtensibleEvent":164,"./poll_types":171,"./relationship_types":172}],169:[function(e,t,i){"use strict";function n(e){return n="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},n(e)}Object.defineProperty(i,"__esModule",{value:!0}),i.PollStartEvent=i.PollAnswerSubevent=void 0;var r=e("./poll_types"),o=e("./MessageEvent"),s=e("./message_types"),a=e("../InvalidEventError"),c=e("../NamespacedValue"),d=e("../utility/events"),l=e("./ExtensibleEvent");function u(e){return function(e){if(Array.isArray(e))return h(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return h(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return h(e,t)}(e)||function(){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 h(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function f(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function p(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?f(Object(i),!0).forEach((function(t){w(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):f(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function m(e,t,i){return t&&v(e.prototype,t),i&&v(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function y(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&b(e,t)}function b(e,t){return b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},b(e,t)}function _(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,r=E(e);if(t){var o=E(this).constructor;i=Reflect.construct(r,arguments,o)}else i=r.apply(this,arguments);return function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return S(e)}(this,i)}}function S(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function E(e){return E=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},E(e)}function w(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var T=function(e){y(i,e);var t=_(i);function i(e){var n;g(this,i),w(S(n=t.call(this,e)),"id",void 0);var r=e.content.id;if(!r||"string"!=typeof r)throw new a.InvalidEventError("Answer ID must be a non-empty string");return n.id=r,n}return m(i,[{key:"serialize",value:function(){return{type:"org.matrix.sdk.poll.answer",content:p({id:this.id},this.serializeMMessageOnly())}}}],[{key:"from",value:function(e,t){return new i({type:"org.matrix.sdk.poll.answer",content:w({id:e},s.M_TEXT.name,t)})}}]),i}(o.MessageEvent);i.PollAnswerSubevent=T;var I=function(e){y(i,e);var t=_(i);function i(e){var n;g(this,i),w(S(n=t.call(this,e)),"question",void 0),w(S(n),"kind",void 0),w(S(n),"rawKind",void 0),w(S(n),"maxSelections",void 0),w(S(n),"answers",void 0);var s=r.M_POLL_START.findIn(n.wireContent);if(!s.question)throw new a.InvalidEventError("A question is required");if(n.question=new o.MessageEvent({type:"org.matrix.sdk.poll.question",content:s.question}),n.rawKind=s.kind,r.M_POLL_KIND_DISCLOSED.matches(n.rawKind)?n.kind=r.M_POLL_KIND_DISCLOSED:n.kind=r.M_POLL_KIND_UNDISCLOSED,n.maxSelections=Number.isFinite(s.max_selections)&&s.max_selections>0?s.max_selections:1,!Array.isArray(s.answers))throw new a.InvalidEventError("Poll answers must be an array");var c=s.answers.slice(0,20).map((function(e){return new T({type:"org.matrix.sdk.poll.answer",content:e})}));if(c.length<=0)throw new a.InvalidEventError("No answers available");return n.answers=c,n}return m(i,[{key:"isEquivalentTo",value:function(e){return(0,d.isEventTypeSame)(e,r.M_POLL_START)}},{key:"serialize",value:function(){var e;return{type:r.M_POLL_START.name,content:(e={},w(e,r.M_POLL_START.name,{question:this.question.serialize().content,kind:this.rawKind,max_selections:this.maxSelections,answers:this.answers.map((function(e){return e.serialize().content}))}),w(e,s.M_TEXT.name,"".concat(this.question.text,"\n").concat(this.answers.map((function(e,t){return"".concat(t+1,". ").concat(e.text)})).join("\n"))),e)}}}],[{key:"from",value:function(e,t,n){var o,a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;return new i({type:r.M_POLL_START.name,content:(o={},w(o,s.M_TEXT.name,e),w(o,r.M_POLL_START.name,{question:w({},s.M_TEXT.name,e),kind:n instanceof c.NamespacedValue?n.name:n,max_selections:a,answers:t.map((function(e){return w({id:u(Array(16)).map((function(){return R.charAt(Math.floor(Math.random()*R.length))})).join("")},s.M_TEXT.name,e)}))}),o)})}}]),i}(l.ExtensibleEvent);i.PollStartEvent=I;var R="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"},{"../InvalidEventError":160,"../NamespacedValue":162,"../utility/events":179,"./ExtensibleEvent":164,"./MessageEvent":165,"./message_types":170,"./poll_types":171}],170:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.M_TEXT=i.M_NOTICE=i.M_MESSAGE=i.M_HTML=i.M_EMOTE=void 0;var n=e("../NamespacedValue"),r=new n.UnstableValue("m.message","org.matrix.msc1767.message");i.M_MESSAGE=r;var o=new n.UnstableValue("m.text","org.matrix.msc1767.text");i.M_TEXT=o;var s=new n.UnstableValue("m.html","org.matrix.msc1767.html");i.M_HTML=s;var a=new n.UnstableValue("m.emote","org.matrix.msc1767.emote");i.M_EMOTE=a;var c=new n.UnstableValue("m.notice","org.matrix.msc1767.notice");i.M_NOTICE=c},{"../NamespacedValue":162}],171:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.M_POLL_START=i.M_POLL_RESPONSE=i.M_POLL_KIND_UNDISCLOSED=i.M_POLL_KIND_DISCLOSED=i.M_POLL_END=void 0;var n=e("../NamespacedValue"),r=new n.UnstableValue("m.poll.disclosed","org.matrix.msc3381.poll.disclosed");i.M_POLL_KIND_DISCLOSED=r;var o=new n.UnstableValue("m.poll.undisclosed","org.matrix.msc3381.poll.undisclosed");i.M_POLL_KIND_UNDISCLOSED=o;var s=new n.UnstableValue("m.poll.start","org.matrix.msc3381.poll.start");i.M_POLL_START=s;var a=new n.UnstableValue("m.poll.response","org.matrix.msc3381.poll.response");i.M_POLL_RESPONSE=a;var c=new n.UnstableValue("m.poll.end","org.matrix.msc3381.poll.end");i.M_POLL_END=c},{"../NamespacedValue":162}],172:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.REFERENCE_RELATION=void 0;var n=new(e("../NamespacedValue").NamespacedValue)("m.reference");i.REFERENCE_RELATION=n},{"../NamespacedValue":162}],173:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n=e("./ExtensibleEvents");Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===n[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return n[e]}}))}));var r=e("./IPartialEvent");Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===r[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return r[e]}}))}));var o=e("./InvalidEventError");Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===o[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return o[e]}}))}));var s=e("./NamespacedValue");Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===s[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return s[e]}}))}));var a=e("./NamespacedMap");Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===a[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return a[e]}}))}));var c=e("./types");Object.keys(c).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===c[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return c[e]}}))}));var d=e("./utility/MessageMatchers");Object.keys(d).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===d[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return d[e]}}))}));var l=e("./utility/events");Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===l[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return l[e]}}))}));var u=e("./interpreters/legacy/MRoomMessage");Object.keys(u).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===u[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return u[e]}}))}));var h=e("./interpreters/modern/MMessage");Object.keys(h).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===h[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return h[e]}}))}));var f=e("./interpreters/modern/MPoll");Object.keys(f).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===f[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return f[e]}}))}));var p=e("./events/relationship_types");Object.keys(p).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===p[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return p[e]}}))}));var g=e("./events/ExtensibleEvent");Object.keys(g).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===g[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return g[e]}}))}));var v=e("./events/message_types");Object.keys(v).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===v[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return v[e]}}))}));var m=e("./events/MessageEvent");Object.keys(m).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===m[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return m[e]}}))}));var y=e("./events/EmoteEvent");Object.keys(y).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===y[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return y[e]}}))}));var b=e("./events/NoticeEvent");Object.keys(b).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===b[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return b[e]}}))}));var _=e("./events/poll_types");Object.keys(_).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===_[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return _[e]}}))}));var S=e("./events/PollStartEvent");Object.keys(S).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===S[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return S[e]}}))}));var E=e("./events/PollResponseEvent");Object.keys(E).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===E[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return E[e]}}))}));var w=e("./events/PollEndEvent");Object.keys(w).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===w[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return w[e]}}))}))},{"./ExtensibleEvents":158,"./IPartialEvent":159,"./InvalidEventError":160,"./NamespacedMap":161,"./NamespacedValue":162,"./events/EmoteEvent":163,"./events/ExtensibleEvent":164,"./events/MessageEvent":165,"./events/NoticeEvent":166,"./events/PollEndEvent":167,"./events/PollResponseEvent":168,"./events/PollStartEvent":169,"./events/message_types":170,"./events/poll_types":171,"./events/relationship_types":172,"./interpreters/legacy/MRoomMessage":174,"./interpreters/modern/MMessage":175,"./interpreters/modern/MPoll":176,"./types":177,"./utility/MessageMatchers":178,"./utility/events":179}],174:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.LEGACY_M_ROOM_MESSAGE=void 0,i.parseMRoomMessage=function(e){var t,i,s;if(a.M_MESSAGE.findIn(e.content)||a.M_TEXT.findIn(e.content))return new n.MessageEvent(e);var c,u=null===(t=e.content)||void 0===t?void 0:t.msgtype,h=null===(i=e.content)||void 0===i?void 0:i.body,f="org.matrix.custom.html"===(null===(s=e.content)||void 0===s?void 0:s.format)?e.content.formatted_body:null;return"m.text"===u?new n.MessageEvent(d(d({},e),{},{content:d(d({},e.content),{},(c={},l(c,a.M_TEXT.name,h),l(c,a.M_HTML.name,f),c))})):"m.notice"===u?new r.NoticeEvent(d(d({},e),{},{content:d(d({},e.content),{},(p={},l(p,a.M_TEXT.name,h),l(p,a.M_HTML.name,f),p))})):"m.emote"===u?new o.EmoteEvent(d(d({},e),{},{content:d(d({},e.content),{},(g={},l(g,a.M_TEXT.name,h),l(g,a.M_HTML.name,f),g))})):null;var p,g};var n=e("../../events/MessageEvent"),r=e("../../events/NoticeEvent"),o=e("../../events/EmoteEvent"),s=e("../../NamespacedValue"),a=e("../../events/message_types");function c(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function d(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?c(Object(i),!0).forEach((function(t){l(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):c(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function l(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var u=new s.NamespacedValue("m.room.message");i.LEGACY_M_ROOM_MESSAGE=u},{"../../NamespacedValue":162,"../../events/EmoteEvent":163,"../../events/MessageEvent":165,"../../events/NoticeEvent":166,"../../events/message_types":170}],175:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.parseMMessage=function(e){if(r.M_EMOTE.matches(e.type))return new o.EmoteEvent(e);if(r.M_NOTICE.matches(e.type))return new s.NoticeEvent(e);return new n.MessageEvent(e)};var n=e("../../events/MessageEvent"),r=e("../../events/message_types"),o=e("../../events/EmoteEvent"),s=e("../../events/NoticeEvent")},{"../../events/EmoteEvent":163,"../../events/MessageEvent":165,"../../events/NoticeEvent":166,"../../events/message_types":170}],176:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.parseMPoll=function(e){if(n.M_POLL_START.matches(e.type))return new r.PollStartEvent(e);if(n.M_POLL_RESPONSE.matches(e.type))return new o.PollResponseEvent(e);if(n.M_POLL_END.matches(e.type))return new s.PollEndEvent(e);return null};var n=e("../../events/poll_types"),r=e("../../events/PollStartEvent"),o=e("../../events/PollResponseEvent"),s=e("../../events/PollEndEvent")},{"../../events/PollEndEvent":167,"../../events/PollResponseEvent":168,"../../events/PollStartEvent":169,"../../events/poll_types":171}],177:[function(e,t,i){"use strict";function n(e){return null!=e}Object.defineProperty(i,"__esModule",{value:!0}),i.isOptionalAString=function(e){return n(e)&&"string"==typeof e},i.isProvided=n},{}],178:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.LegacyMsgType=void 0,i.isEventLike=function(e,t){var i=e.content;if(t===n.Text)return r.M_MESSAGE.matches(e.type)||"m.room.message"===e.type&&"m.text"===(null==i?void 0:i.msgtype);if(t===n.Emote)return r.M_EMOTE.matches(e.type)||"m.room.message"===e.type&&"m.emote"===(null==i?void 0:i.msgtype);if(t===n.Notice)return r.M_NOTICE.matches(e.type)||"m.room.message"===e.type&&"m.notice"===(null==i?void 0:i.msgtype);return!1};var n,r=e("../events/message_types");i.LegacyMsgType=n,function(e){e.Text="m.text",e.Notice="m.notice",e.Emote="m.emote"}(n||(i.LegacyMsgType=n={}))},{"../events/message_types":170}],179:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.isEventTypeSame=function(e,t){if("string"==typeof e)return"string"==typeof t?t===e:t.matches(e);if("string"==typeof t)return e.matches(t);var i=t,n=e;return i.matches(n.name)||i.matches(n.altName)}},{}],180:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ClientWidgetApi=void 0;var n=e("events"),r=e("./transport/PostmessageTransport"),o=e("./interfaces/WidgetApiDirection"),s=e("./interfaces/WidgetApiAction"),a=e("./interfaces/Capabilities"),c=e("./interfaces/ApiVersion"),d=e("./models/WidgetEventCapability"),l=e("./interfaces/GetOpenIDAction"),u=e("./util/SimpleObservable"),h=e("./Symbols");function f(e){return f="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},f(e)}function p(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */p=function(){return e};var e={},t=Object.prototype,i=t.hasOwnProperty,n=Object.defineProperty||function(e,t,i){e[t]=i.value},r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,i){return e[t]=i}}function d(e,t,i,r){var o=t&&t.prototype instanceof h?t:h,s=Object.create(o.prototype),a=new k(r||[]);return n(s,"_invoke",{value:w(e,i,a)}),s}function l(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var u={};function h(){}function g(){}function v(){}var m={};c(m,o,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(M([])));b&&b!==t&&i.call(b,o)&&(m=b);var _=v.prototype=h.prototype=Object.create(m);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(n,o,s,a){var c=l(e[n],e,o);if("throw"!==c.type){var d=c.arg,u=d.value;return u&&"object"==f(u)&&i.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,s,a)}),(function(e){r("throw",e,s,a)})):t.resolve(u).then((function(e){d.value=e,s(d)}),(function(e){return r("throw",e,s,a)}))}a(c.arg)}var o;n(this,"_invoke",{value:function(e,i){function n(){return new t((function(t,n){r(e,i,t,n)}))}return o=o?o.then(n,n):n()}})}function w(e,t,i){var n="suspendedStart";return function(r,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw o;return C()}for(i.method=r,i.arg=o;;){var s=i.delegate;if(s){var a=T(s,i);if(a){if(a===u)continue;return a}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var c=l(e,t,i);if("normal"===c.type){if(n=i.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:i.done}}"throw"===c.type&&(n="completed",i.method="throw",i.arg=c.arg)}}}function T(e,t){var i=t.method,n=e.iterator[i];if(void 0===n)return t.delegate=null,"throw"===i&&e.iterator.return&&(t.method="return",t.arg=void 0,T(e,t),"throw"===t.method)||"return"!==i&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+i+"' method")),u;var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function M(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(i.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:C}}function C(){return{value:void 0,done:!0}}return g.prototype=v,n(_,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:g,configurable:!0}),g.displayName=c(v,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,c(e,a,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},S(E.prototype),c(E.prototype,s,(function(){return this})),e.AsyncIterator=E,e.async=function(t,i,n,r,o){void 0===o&&(o=Promise);var s=new E(d(t,i,n,r),o);return e.isGeneratorFunction(i)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},S(_),c(_,a,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),i=[];for(var n in t)i.push(n);return i.reverse(),function e(){for(;i.length;){var n=i.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=M,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(R),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(i,n){return s.type="throw",s.arg=e,t.next=i,n&&(t.method="next",t.arg=void 0),!!n}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var a=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,u):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),R(i),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;R(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:M(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),u}},e}function g(e,t,i,n,r,o,s){try{var a=e[o](s),c=a.value}catch(e){return void i(e)}a.done?t(c):Promise.resolve(c).then(n,r)}function v(e){return function(){var t=this,i=arguments;return new Promise((function(n,r){var o=e.apply(t,i);function s(e){g(o,n,r,s,a,"next",e)}function a(e){g(o,n,r,s,a,"throw",e)}s(void 0)}))}}function m(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return y(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return y(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}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 o,s=!0,a=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==i.return||i.return()}finally{if(a)throw o}}}}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function b(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?b(Object(i),!0).forEach((function(t){R(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):b(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function S(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,k(n.key),n)}}function E(e,t){return E=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},E(e,t)}function w(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=I(e);if(t){var r=I(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return function(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return T(e)}(this,i)}}function T(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function I(e){return I=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},I(e)}function R(e,t,i){return(t=k(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function k(e){var t=function(e,t){if("object"!==f(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===f(t)?t:String(t)}function M(e){var t,i,n,r=2;for("undefined"!=typeof Symbol&&(i=Symbol.asyncIterator,n=Symbol.iterator);r--;){if(i&&null!=(t=e[i]))return t.call(e);if(n&&null!=(t=e[n]))return new C(t.call(e));i="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function C(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return C=function(e){this.s=e,this.n=e.next},C.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var i=this.s.return;return void 0===i?Promise.resolve({value:e,done:!0}):t(i.apply(this.s,arguments))},throw:function(e){var i=this.s.return;return void 0===i?Promise.reject(e):t(i.apply(this.s,arguments))}},new C(e)}var O=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&E(e,t)}(x,e);var t,i,n,f,g,y,b,I,k,C,O,A,P,D=w(x);function x(e,t,i){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,x),(n=D.call(this)).widget=e,n.iframe=t,n.driver=i,R(T(n),"transport",void 0),R(T(n),"contentLoadedActionSent",!1),R(T(n),"allowedCapabilities",new Set),R(T(n),"allowedEvents",[]),R(T(n),"isStopped",!1),R(T(n),"turnServers",null),R(T(n),"contentLoadedWaitTimer",void 0),null==t||!t.contentWindow)throw new Error("No iframe supplied");if(!e)throw new Error("Invalid widget");if(!i)throw new Error("Invalid driver");return n.transport=new r.PostmessageTransport(o.WidgetApiDirection.ToWidget,e.id,t.contentWindow,window),n.transport.targetOrigin=e.origin,n.transport.on("message",n.handleMessage.bind(T(n))),t.addEventListener("load",n.onIframeLoad.bind(T(n))),n.transport.start(),n}return t=x,i=[{key:"hasCapability",value:function(e){return this.allowedCapabilities.has(e)}},{key:"canUseRoomTimeline",value:function(e){return this.hasCapability("org.matrix.msc2762.timeline:".concat(h.Symbols.AnyRoom))||this.hasCapability("org.matrix.msc2762.timeline:".concat(e))}},{key:"canSendRoomEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.allowedEvents.some((function(i){return i.matchesAsRoomEvent(d.EventDirection.Send,e,t)}))}},{key:"canSendStateEvent",value:function(e,t){return this.allowedEvents.some((function(i){return i.matchesAsStateEvent(d.EventDirection.Send,e,t)}))}},{key:"canSendToDeviceEvent",value:function(e){return this.allowedEvents.some((function(t){return t.matchesAsToDeviceEvent(d.EventDirection.Send,e)}))}},{key:"canReceiveRoomEvent",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;return this.allowedEvents.some((function(i){return i.matchesAsRoomEvent(d.EventDirection.Receive,e,t)}))}},{key:"canReceiveStateEvent",value:function(e,t){return this.allowedEvents.some((function(i){return i.matchesAsStateEvent(d.EventDirection.Receive,e,t)}))}},{key:"canReceiveToDeviceEvent",value:function(e){return this.allowedEvents.some((function(t){return t.matchesAsToDeviceEvent(d.EventDirection.Receive,e)}))}},{key:"canReceiveRoomAccountData",value:function(e){return this.allowedEvents.some((function(t){return t.matchesAsRoomAccountData(d.EventDirection.Receive,e)}))}},{key:"stop",value:function(){this.isStopped=!0,this.transport.stop()}},{key:"beginCapabilities",value:function(){var e,t=this;this.emit("preparing"),this.transport.send(s.WidgetApiToWidgetAction.Capabilities,{}).then((function(i){return e=i.capabilities,t.driver.validateCapabilities(new Set(i.capabilities))})).then((function(i){console.log("Widget ".concat(t.widget.id," is allowed capabilities:"),Array.from(i)),t.allowedCapabilities=i,t.allowedEvents=d.WidgetEventCapability.findEventCapabilities(i),t.notifyCapabilities(e),t.emit("ready")})).catch((function(e){t.emit("error:preparing",e)}))}},{key:"notifyCapabilities",value:function(e){var t=this;this.transport.send(s.WidgetApiToWidgetAction.NotifyCapabilities,{requested:e,approved:Array.from(this.allowedCapabilities)}).catch((function(e){console.warn("non-fatal error notifying widget of approved capabilities:",e)})).then((function(){t.emit("capabilitiesNotified")}))}},{key:"onIframeLoad",value:function(e){this.widget.waitForIframeLoad?this.beginCapabilities():(console.log("waitForIframeLoad is false: waiting for widget to send contentLoaded"),this.contentLoadedWaitTimer=setTimeout((function(){console.error("Widget specified waitForIframeLoad=false but timed out waiting for contentLoaded event!")}),1e4),this.contentLoadedActionSent=!1)}},{key:"handleContentLoadedAction",value:function(e){if(void 0!==this.contentLoadedWaitTimer&&(clearTimeout(this.contentLoadedWaitTimer),this.contentLoadedWaitTimer=void 0),this.contentLoadedActionSent)throw new Error("Improper sequence: ContentLoaded Action can only be sent once after the widget loaded and should only be used if waitForIframeLoad is false (default=true)");this.widget.waitForIframeLoad?this.transport.reply(e,{error:{message:"Improper sequence: not expecting ContentLoaded event if waitForIframeLoad is true (default=true)"}}):(this.transport.reply(e,{}),this.beginCapabilities()),this.contentLoadedActionSent=!0}},{key:"replyVersions",value:function(e){this.transport.reply(e,{supported_versions:c.CurrentApiVersions})}},{key:"handleCapabilitiesRenegotiate",value:function(e){var t,i=this;this.transport.reply(e,{});var n=(null===(t=e.data)||void 0===t?void 0:t.capabilities)||[],r=new Set(n.filter((function(e){return!i.hasCapability(e)})));if(0===r.size)return this.notifyCapabilities([]);this.driver.validateCapabilities(r).then((function(e){return e.forEach((function(e){return i.allowedCapabilities.add(e)})),d.WidgetEventCapability.findEventCapabilities(e).forEach((function(e){return i.allowedEvents.push(e)})),i.notifyCapabilities(Array.from(r))}))}},{key:"handleNavigate",value:function(e){var t,i,n=this;if(!this.hasCapability(a.MatrixCapabilities.MSC2931Navigate))return this.transport.reply(e,{error:{message:"Missing capability"}});if(null===(t=e.data)||void 0===t||!t.uri||null===(i=e.data)||void 0===i||!i.uri.toString().startsWith("https://matrix.to/#"))return this.transport.reply(e,{error:{message:"Invalid matrix.to URI"}});var r=function(t){return console.error("[ClientWidgetApi] Failed to handle navigation: ",t),n.transport.reply(e,{error:{message:"Error handling navigation"}})};try{this.driver.navigate(e.data.uri.toString()).catch((function(e){return r(e)})).then((function(){return n.transport.reply(e,{})}))}catch(e){return r(e)}}},{key:"handleOIDC",value:function(e){var t=this,i=1,n=function(n,r){return r=r||{},i>1?t.transport.send(s.WidgetApiToWidgetAction.OpenIDCredentials,_({state:n,original_request_id:e.requestId},r)):t.transport.reply(e,_({state:n},r))},r=function(r){return console.error("[ClientWidgetApi] Failed to handle OIDC: ",r),i>1?n(l.OpenIDRequestState.Blocked):t.transport.reply(e,{error:{message:r}})},o=new u.SimpleObservable((function(e){return e.state===l.OpenIDRequestState.PendingUserConfirmation&&i>1?(o.close(),r("client provided out-of-phase response to OIDC flow")):e.state===l.OpenIDRequestState.PendingUserConfirmation?(n(e.state),void i++):e.state!==l.OpenIDRequestState.Allowed||e.token?(e.state===l.OpenIDRequestState.Blocked&&(e.token=void 0),o.close(),n(e.state,e.token)):r("client provided invalid OIDC token for an allowed request")}));this.driver.askOpenID(o)}},{key:"handleReadRoomAccountData",value:function(e){var t=this,i=Promise.resolve([]);return i=this.driver.readRoomAccountData(e.data.type),this.canReceiveRoomAccountData(e.data.type)?i.then((function(i){t.transport.reply(e,{events:i})})):this.transport.reply(e,{error:{message:"Cannot read room account data of this type"}})}},{key:"handleReadEvents",value:function(e){var t=this;if(!e.data.type)return this.transport.reply(e,{error:{message:"Invalid request - missing event type"}});if(void 0!==e.data.limit&&(!e.data.limit||e.data.limit<0))return this.transport.reply(e,{error:{message:"Invalid request - limit out of range"}});var i=null;if(e.data.room_ids){i=e.data.room_ids,Array.isArray(i)||(i=[i]);var n,r=m(i);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(!this.canUseRoomTimeline(o))return this.transport.reply(e,{error:{message:"Unable to access room timeline: ".concat(o)}})}}catch(e){r.e(e)}finally{r.f()}}var s=e.data.limit||0,a=e.data.since,c=Promise.resolve([]);if(void 0!==e.data.state_key){var d=!0===e.data.state_key?void 0:e.data.state_key.toString();if(!this.canReceiveStateEvent(e.data.type,null!=d?d:null))return this.transport.reply(e,{error:{message:"Cannot read state events of this type"}});c=this.driver.readStateEvents(e.data.type,d,s,i)}else{if(!this.canReceiveRoomEvent(e.data.type,e.data.msgtype))return this.transport.reply(e,{error:{message:"Cannot read room events of this type"}});c=this.driver.readRoomEvents(e.data.type,e.data.msgtype,s,i,a)}return c.then((function(i){return t.transport.reply(e,{events:i})}))}},{key:"handleSendEvent",value:function(e){var t,i=this;if(!e.data.type)return this.transport.reply(e,{error:{message:"Invalid request - missing event type"}});if(e.data.room_id&&!this.canUseRoomTimeline(e.data.room_id))return this.transport.reply(e,{error:{message:"Unable to access room timeline: ".concat(e.data.room_id)}});if(null!==e.data.state_key&&void 0!==e.data.state_key){if(!this.canSendStateEvent(e.data.type,e.data.state_key))return this.transport.reply(e,{error:{message:"Cannot send state events of this type"}});t=this.driver.sendEvent(e.data.type,e.data.content||{},e.data.state_key,e.data.room_id)}else{var n=e.data.content||{},r=n.msgtype;if(!this.canSendRoomEvent(e.data.type,r))return this.transport.reply(e,{error:{message:"Cannot send room events of this type"}});t=this.driver.sendEvent(e.data.type,n,null,e.data.room_id)}t.then((function(t){return i.transport.reply(e,{room_id:t.roomId,event_id:t.eventId})})).catch((function(t){return console.error("error sending event: ",t),i.transport.reply(e,{error:{message:"Error sending event"}})}))}},{key:"handleSendToDevice",value:(P=v(p().mark((function e(t){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.data.type){e.next=5;break}return e.next=3,this.transport.reply(t,{error:{message:"Invalid request - missing event type"}});case 3:case 8:case 13:case 18:case 25:e.next=32;break;case 5:if(t.data.messages){e.next=10;break}return e.next=8,this.transport.reply(t,{error:{message:"Invalid request - missing event contents"}});case 10:if("boolean"==typeof t.data.encrypted){e.next=15;break}return e.next=13,this.transport.reply(t,{error:{message:"Invalid request - missing encryption flag"}});case 15:if(this.canSendToDeviceEvent(t.data.type)){e.next=20;break}return e.next=18,this.transport.reply(t,{error:{message:"Cannot send to-device events of this type"}});case 20:return e.prev=20,e.next=23,this.driver.sendToDevice(t.data.type,t.data.encrypted,t.data.messages);case 23:return e.next=25,this.transport.reply(t,{});case 27:return e.prev=27,e.t0=e.catch(20),console.error("error sending to-device event",e.t0),e.next=32,this.transport.reply(t,{error:{message:"Error sending event"}});case 32:case"end":return e.stop()}}),e,this,[[20,27]])}))),function(e){return P.apply(this,arguments)})},{key:"pollTurnServers",value:(A=v(p().mark((function e(t,i){var n,r,o,a,c,d;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.transport.send(s.WidgetApiToWidgetAction.UpdateTurnServers,i);case 3:n=!1,r=!1,e.prev=5,a=M(t);case 7:return e.next=9,a.next();case 9:if(!(n=!(c=e.sent).done)){e.next=16;break}return d=c.value,e.next=13,this.transport.send(s.WidgetApiToWidgetAction.UpdateTurnServers,d);case 13:n=!1,e.next=7;break;case 16:e.next=22;break;case 18:e.prev=18,e.t0=e.catch(5),r=!0,o=e.t0;case 22:if(e.prev=22,e.prev=23,!n||null==a.return){e.next=27;break}return e.next=27,a.return();case 27:if(e.prev=27,!r){e.next=30;break}throw o;case 30:return e.finish(27);case 31:return e.finish(22);case 32:e.next=37;break;case 34:e.prev=34,e.t1=e.catch(0),console.error("error polling for TURN servers",e.t1);case 37:case"end":return e.stop()}}),e,this,[[0,34],[5,18,22,32],[23,,27,31]])}))),function(e,t){return A.apply(this,arguments)})},{key:"handleWatchTurnServers",value:(O=v(p().mark((function e(t){var i,n,r,o;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.hasCapability(a.MatrixCapabilities.MSC3846TurnServers)){e.next=5;break}return e.next=3,this.transport.reply(t,{error:{message:"Missing capability"}});case 3:case 8:e.next=30;break;case 5:if(!this.turnServers){e.next=10;break}return e.next=8,this.transport.reply(t,{});case 10:return e.prev=10,i=this.driver.getTurnServers(),e.next=14,i.next();case 14:if(n=e.sent,r=n.done,o=n.value,!r){e.next=19;break}throw new Error("Client refuses to provide any TURN servers");case 19:return e.next=21,this.transport.reply(t,{});case 21:this.pollTurnServers(i,o),this.turnServers=i,e.next=30;break;case 25:return e.prev=25,e.t0=e.catch(10),console.error("error getting first TURN server results",e.t0),e.next=30,this.transport.reply(t,{error:{message:"TURN servers not available"}});case 30:case"end":return e.stop()}}),e,this,[[10,25]])}))),function(e){return O.apply(this,arguments)})},{key:"handleUnwatchTurnServers",value:(C=v(p().mark((function e(t){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.hasCapability(a.MatrixCapabilities.MSC3846TurnServers)){e.next=5;break}return e.next=3,this.transport.reply(t,{error:{message:"Missing capability"}});case 3:case 8:e.next=15;break;case 5:if(this.turnServers){e.next=10;break}return e.next=8,this.transport.reply(t,{});case 10:return e.next=12,this.turnServers.return(void 0);case 12:return this.turnServers=null,e.next=15,this.transport.reply(t,{});case 15:case"end":return e.stop()}}),e,this)}))),function(e){return C.apply(this,arguments)})},{key:"handleReadRelations",value:(k=v(p().mark((function e(t){var i,n,r=this;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.data.event_id){e.next=2;break}return e.abrupt("return",this.transport.reply(t,{error:{message:"Invalid request - missing event ID"}}));case 2:if(!(void 0!==t.data.limit&&t.data.limit<0)){e.next=4;break}return e.abrupt("return",this.transport.reply(t,{error:{message:"Invalid request - limit out of range"}}));case 4:if(void 0===t.data.room_id||this.canUseRoomTimeline(t.data.room_id)){e.next=6;break}return e.abrupt("return",this.transport.reply(t,{error:{message:"Unable to access room timeline: ".concat(t.data.room_id)}}));case 6:return e.prev=6,e.next=9,this.driver.readEventRelations(t.data.event_id,t.data.room_id,t.data.rel_type,t.data.event_type,t.data.from,t.data.to,t.data.limit,t.data.direction);case 9:return i=e.sent,n=i.chunk.filter((function(e){return void 0!==e.state_key?r.canReceiveStateEvent(e.type,e.state_key):r.canReceiveRoomEvent(e.type,e.content.msgtype)})),e.abrupt("return",this.transport.reply(t,{chunk:n,prev_batch:i.prevBatch,next_batch:i.nextBatch}));case 14:return e.prev=14,e.t0=e.catch(6),console.error("error getting the relations",e.t0),e.next=19,this.transport.reply(t,{error:{message:"Unexpected error while reading relations"}});case 19:case"end":return e.stop()}}),e,this,[[6,14]])}))),function(e){return k.apply(this,arguments)})},{key:"handleUserDirectorySearch",value:(I=v(p().mark((function e(t){var i;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.hasCapability(a.MatrixCapabilities.MSC3973UserDirectorySearch)){e.next=2;break}return e.abrupt("return",this.transport.reply(t,{error:{message:"Missing capability"}}));case 2:if("string"==typeof t.data.search_term){e.next=4;break}return e.abrupt("return",this.transport.reply(t,{error:{message:"Invalid request - missing search term"}}));case 4:if(!(void 0!==t.data.limit&&t.data.limit<0)){e.next=6;break}return e.abrupt("return",this.transport.reply(t,{error:{message:"Invalid request - limit out of range"}}));case 6:return e.prev=6,e.next=9,this.driver.searchUserDirectory(t.data.search_term,t.data.limit);case 9:return i=e.sent,e.abrupt("return",this.transport.reply(t,{limited:i.limited,results:i.results.map((function(e){return{user_id:e.userId,display_name:e.displayName,avatar_url:e.avatarUrl}}))}));case 13:return e.prev=13,e.t0=e.catch(6),console.error("error searching in the user directory",e.t0),e.next=18,this.transport.reply(t,{error:{message:"Unexpected error while searching in the user directory"}});case 18:case"end":return e.stop()}}),e,this,[[6,13]])}))),function(e){return I.apply(this,arguments)})},{key:"handleGetMediaConfig",value:(b=v(p().mark((function e(t){var i;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.hasCapability(a.MatrixCapabilities.MSC4039UploadFile)){e.next=2;break}return e.abrupt("return",this.transport.reply(t,{error:{message:"Missing capability"}}));case 2:return e.prev=2,e.next=5,this.driver.getMediaConfig();case 5:return i=e.sent,e.abrupt("return",this.transport.reply(t,i));case 9:return e.prev=9,e.t0=e.catch(2),console.error("error while getting the media configuration",e.t0),e.next=14,this.transport.reply(t,{error:{message:"Unexpected error while getting the media configuration"}});case 14:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e){return b.apply(this,arguments)})},{key:"handleUploadFile",value:(y=v(p().mark((function e(t){var i;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.hasCapability(a.MatrixCapabilities.MSC4039UploadFile)){e.next=2;break}return e.abrupt("return",this.transport.reply(t,{error:{message:"Missing capability"}}));case 2:return e.prev=2,e.next=5,this.driver.uploadFile(t.data.file);case 5:return i=e.sent,e.abrupt("return",this.transport.reply(t,{content_uri:i.contentUri}));case 9:return e.prev=9,e.t0=e.catch(2),console.error("error while uploading a file",e.t0),e.next=14,this.transport.reply(t,{error:{message:"Unexpected error while uploading a file"}});case 14:case"end":return e.stop()}}),e,this,[[2,9]])}))),function(e){return y.apply(this,arguments)})},{key:"handleMessage",value:function(e){if(!this.isStopped){var t=new CustomEvent("action:".concat(e.detail.action),{detail:e.detail,cancelable:!0});if(this.emit("action:".concat(e.detail.action),t),!t.defaultPrevented)switch(e.detail.action){case s.WidgetApiFromWidgetAction.ContentLoaded:return this.handleContentLoadedAction(e.detail);case s.WidgetApiFromWidgetAction.SupportedApiVersions:return this.replyVersions(e.detail);case s.WidgetApiFromWidgetAction.SendEvent:return this.handleSendEvent(e.detail);case s.WidgetApiFromWidgetAction.SendToDevice:return this.handleSendToDevice(e.detail);case s.WidgetApiFromWidgetAction.GetOpenIDCredentials:return this.handleOIDC(e.detail);case s.WidgetApiFromWidgetAction.MSC2931Navigate:return this.handleNavigate(e.detail);case s.WidgetApiFromWidgetAction.MSC2974RenegotiateCapabilities:return this.handleCapabilitiesRenegotiate(e.detail);case s.WidgetApiFromWidgetAction.MSC2876ReadEvents:return this.handleReadEvents(e.detail);case s.WidgetApiFromWidgetAction.WatchTurnServers:return this.handleWatchTurnServers(e.detail);case s.WidgetApiFromWidgetAction.UnwatchTurnServers:return this.handleUnwatchTurnServers(e.detail);case s.WidgetApiFromWidgetAction.MSC3869ReadRelations:return this.handleReadRelations(e.detail);case s.WidgetApiFromWidgetAction.MSC3973UserDirectorySearch:return this.handleUserDirectorySearch(e.detail);case s.WidgetApiFromWidgetAction.BeeperReadRoomAccountData:return this.handleReadRoomAccountData(e.detail);case s.WidgetApiFromWidgetAction.MSC4039GetMediaConfigAction:return this.handleGetMediaConfig(e.detail);case s.WidgetApiFromWidgetAction.MSC4039UploadFileAction:return this.handleUploadFile(e.detail);default:return this.transport.reply(e.detail,{error:{message:"Unknown or unsupported action: "+e.detail.action}})}}}},{key:"takeScreenshot",value:function(){return this.transport.send(s.WidgetApiToWidgetAction.TakeScreenshot,{})}},{key:"updateVisibility",value:function(e){return this.transport.send(s.WidgetApiToWidgetAction.UpdateVisibility,{visible:e})}},{key:"sendWidgetConfig",value:function(e){return this.transport.send(s.WidgetApiToWidgetAction.WidgetConfig,e).then()}},{key:"notifyModalWidgetButtonClicked",value:function(e){return this.transport.send(s.WidgetApiToWidgetAction.ButtonClicked,{id:e}).then()}},{key:"notifyModalWidgetClose",value:function(e){return this.transport.send(s.WidgetApiToWidgetAction.CloseModalWidget,e).then()}},{key:"feedEvent",value:(g=v(p().mark((function e(t,i){var n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.room_id===i||this.canUseRoomTimeline(t.room_id)){e.next=2;break}return e.abrupt("return");case 2:if(void 0===t.state_key||null===t.state_key){e.next=7;break}if(this.canReceiveStateEvent(t.type,t.state_key)){e.next=5;break}return e.abrupt("return");case 5:e.next=9;break;case 7:if(this.canReceiveRoomEvent(t.type,null===(n=t.content)||void 0===n?void 0:n.msgtype)){e.next=9;break}return e.abrupt("return");case 9:return e.next=11,this.transport.send(s.WidgetApiToWidgetAction.SendEvent,t);case 11:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"feedToDevice",value:(f=v(p().mark((function e(t,i){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.canReceiveToDeviceEvent(t.type)){e.next=3;break}return e.next=3,this.transport.send(s.WidgetApiToWidgetAction.SendToDevice,_(_({},t),{},{encrypted:i}));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})}],i&&S(t.prototype,i),n&&S(t,n),Object.defineProperty(t,"prototype",{writable:!1}),x}(n.EventEmitter);i.ClientWidgetApi=O},{"./Symbols":181,"./interfaces/ApiVersion":185,"./interfaces/Capabilities":186,"./interfaces/GetOpenIDAction":190,"./interfaces/WidgetApiAction":216,"./interfaces/WidgetApiDirection":217,"./models/WidgetEventCapability":222,"./transport/PostmessageTransport":228,"./util/SimpleObservable":229,events:109}],181:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.Symbols=void 0;var n=function(e){return e.AnyRoom="*",e}({});i.Symbols=n},{}],182:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.WidgetApi=void 0;var n=e("events"),r=e("./interfaces/WidgetApiDirection"),o=e("./interfaces/ApiVersion"),s=e("./transport/PostmessageTransport"),a=e("./interfaces/WidgetApiAction"),c=e("./interfaces/GetOpenIDAction"),d=e("./interfaces/WidgetType"),l=e("./interfaces/ModalWidgetActions"),u=e("./models/WidgetEventCapability"),h=e("./Symbols");function f(e){return f="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},f(e)}function p(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */p=function(){return e};var e={},t=Object.prototype,i=t.hasOwnProperty,n=Object.defineProperty||function(e,t,i){e[t]=i.value},r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(e,t,i){return Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,i){return e[t]=i}}function d(e,t,i,r){var o=t&&t.prototype instanceof h?t:h,s=Object.create(o.prototype),a=new k(r||[]);return n(s,"_invoke",{value:w(e,i,a)}),s}function l(e,t,i){try{return{type:"normal",arg:e.call(t,i)}}catch(e){return{type:"throw",arg:e}}}e.wrap=d;var u={};function h(){}function g(){}function v(){}var m={};c(m,o,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(M([])));b&&b!==t&&i.call(b,o)&&(m=b);var _=v.prototype=h.prototype=Object.create(m);function S(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(n,o,s,a){var c=l(e[n],e,o);if("throw"!==c.type){var d=c.arg,u=d.value;return u&&"object"==f(u)&&i.call(u,"__await")?t.resolve(u.__await).then((function(e){r("next",e,s,a)}),(function(e){r("throw",e,s,a)})):t.resolve(u).then((function(e){d.value=e,s(d)}),(function(e){return r("throw",e,s,a)}))}a(c.arg)}var o;n(this,"_invoke",{value:function(e,i){function n(){return new t((function(t,n){r(e,i,t,n)}))}return o=o?o.then(n,n):n()}})}function w(e,t,i){var n="suspendedStart";return function(r,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===r)throw o;return C()}for(i.method=r,i.arg=o;;){var s=i.delegate;if(s){var a=T(s,i);if(a){if(a===u)continue;return a}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===n)throw n="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n="executing";var c=l(e,t,i);if("normal"===c.type){if(n=i.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:i.done}}"throw"===c.type&&(n="completed",i.method="throw",i.arg=c.arg)}}}function T(e,t){var i=t.method,n=e.iterator[i];if(void 0===n)return t.delegate=null,"throw"===i&&e.iterator.return&&(t.method="return",t.arg=void 0,T(e,t),"throw"===t.method)||"return"!==i&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+i+"' method")),u;var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function I(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(I,this),this.reset(!0)}function M(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,r=function t(){for(;++n<e.length;)if(i.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return r.next=r}}return{next:C}}function C(){return{value:void 0,done:!0}}return g.prototype=v,n(_,"constructor",{value:v,configurable:!0}),n(v,"constructor",{value:g,configurable:!0}),g.displayName=c(v,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,c(e,a,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},S(E.prototype),c(E.prototype,s,(function(){return this})),e.AsyncIterator=E,e.async=function(t,i,n,r,o){void 0===o&&(o=Promise);var s=new E(d(t,i,n,r),o);return e.isGeneratorFunction(i)?s:s.next().then((function(e){return e.done?e.value:s.next()}))},S(_),c(_,a,"Generator"),c(_,o,(function(){return this})),c(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),i=[];for(var n in t)i.push(n);return i.reverse(),function e(){for(;i.length;){var n=i.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=M,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(R),!e)for(var t in this)"t"===t.charAt(0)&&i.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(i,n){return s.type="throw",s.arg=e,t.next=i,n&&(t.method="next",t.arg=void 0),!!n}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],s=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var a=i.call(o,"catchLoc"),c=i.call(o,"finallyLoc");if(a&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(a){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){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"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var s=o?o.completion:{};return s.type=e,s.arg=t,o?(this.method="next",this.next=o.finallyLoc,u):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),u},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.finallyLoc===e)return this.complete(i.completion,i.afterLoc),R(i),u}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var i=this.tryEntries[t];if(i.tryLoc===e){var n=i.completion;if("throw"===n.type){var r=n.arg;R(i)}return r}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,i){return this.delegate={iterator:M(e),resultName:t,nextLoc:i},"next"===this.method&&(this.arg=void 0),u}},e}function g(e,t,i,n,r,o,s){try{var a=e[o](s),c=a.value}catch(e){return void i(e)}a.done?t(c):Promise.resolve(c).then(n,r)}function v(e){return function(){var t=this,i=arguments;return new Promise((function(n,r){var o=e.apply(t,i);function s(e){g(o,n,r,s,a,"next",e)}function a(e){g(o,n,r,s,a,"throw",e)}s(void 0)}))}}function m(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,w(n.key),n)}}function y(e,t){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},y(e,t)}function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=S(e);if(t){var r=S(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return function(e,t){if(t&&("object"===f(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _(e)}(this,i)}}function _(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function S(e){return S=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},S(e)}function E(e,t,i){return(t=w(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function w(e){var t=function(e,t){if("object"!==f(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==f(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===f(t)?t:String(t)}function T(e){return new R(e,0)}function I(e){var t,i;function n(t,i){try{var o=e[t](i),s=o.value,a=s instanceof R;Promise.resolve(a?s.v:s).then((function(i){if(a){var c="return"===t?"return":"next";if(!s.k||i.done)return n(c,i);i=e[c](i).value}r(o.done?"return":"normal",i)}),(function(e){n("throw",e)}))}catch(e){r("throw",e)}}function r(e,r){switch(e){case"return":t.resolve({value:r,done:!0});break;case"throw":t.reject(r);break;default:t.resolve({value:r,done:!1})}(t=t.next)?n(t.key,t.arg):i=null}this._invoke=function(e,r){return new Promise((function(o,s){var a={key:e,arg:r,resolve:o,reject:s,next:null};i?i=i.next=a:(t=i=a,n(e,r))}))},"function"!=typeof e.return&&(this.return=void 0)}function R(e,t){this.v=e,this.k=t}I.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},I.prototype.next=function(e){return this._invoke("next",e)},I.prototype.throw=function(e){return this._invoke("throw",e)},I.prototype.return=function(e){return this._invoke("return",e)};var k=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&y(e,t)}(k,e);var t,i,n,f,g,S,w,R=b(k);function k(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,k),(e=R.call(this)).clientOrigin=i,E(_(e),"transport",void 0),E(_(e),"capabilitiesFinished",!1),E(_(e),"supportsMSC2974Renegotiate",!1),E(_(e),"requestedCapabilities",[]),E(_(e),"approvedCapabilities",void 0),E(_(e),"cachedClientVersions",void 0),E(_(e),"turnServerWatchers",0),!window.parent)throw new Error("No parent window. This widget doesn't appear to be embedded properly.");return e.transport=new s.PostmessageTransport(r.WidgetApiDirection.FromWidget,t,window.parent,window),e.transport.targetOrigin=i,e.transport.on("message",e.handleMessage.bind(_(e))),e}return t=k,i=[{key:"hasCapability",value:function(e){return Array.isArray(this.approvedCapabilities)?this.approvedCapabilities.includes(e):this.requestedCapabilities.includes(e)}},{key:"requestCapability",value:function(e){if(this.capabilitiesFinished&&!this.supportsMSC2974Renegotiate)throw new Error("Capabilities have already been negotiated");this.requestedCapabilities.push(e)}},{key:"requestCapabilities",value:function(e){var t=this;e.forEach((function(e){return t.requestCapability(e)}))}},{key:"requestCapabilityForRoomTimeline",value:function(e){this.requestCapability("org.matrix.msc2762.timeline:".concat(e))}},{key:"requestCapabilityToSendState",value:function(e,t){this.requestCapability(u.WidgetEventCapability.forStateEvent(u.EventDirection.Send,e,t).raw)}},{key:"requestCapabilityToReceiveState",value:function(e,t){this.requestCapability(u.WidgetEventCapability.forStateEvent(u.EventDirection.Receive,e,t).raw)}},{key:"requestCapabilityToSendToDevice",value:function(e){this.requestCapability(u.WidgetEventCapability.forToDeviceEvent(u.EventDirection.Send,e).raw)}},{key:"requestCapabilityToReceiveToDevice",value:function(e){this.requestCapability(u.WidgetEventCapability.forToDeviceEvent(u.EventDirection.Receive,e).raw)}},{key:"requestCapabilityToSendEvent",value:function(e){this.requestCapability(u.WidgetEventCapability.forRoomEvent(u.EventDirection.Send,e).raw)}},{key:"requestCapabilityToReceiveEvent",value:function(e){this.requestCapability(u.WidgetEventCapability.forRoomEvent(u.EventDirection.Receive,e).raw)}},{key:"requestCapabilityToSendMessage",value:function(e){this.requestCapability(u.WidgetEventCapability.forRoomMessageEvent(u.EventDirection.Send,e).raw)}},{key:"requestCapabilityToReceiveMessage",value:function(e){this.requestCapability(u.WidgetEventCapability.forRoomMessageEvent(u.EventDirection.Receive,e).raw)}},{key:"requestCapabilityToReceiveRoomAccountData",value:function(e){this.requestCapability(u.WidgetEventCapability.forRoomAccountData(u.EventDirection.Receive,e).raw)}},{key:"requestOpenIDConnectToken",value:function(){var e=this;return new Promise((function(t,i){e.transport.sendComplete(a.WidgetApiFromWidgetAction.GetOpenIDCredentials,{}).then((function(n){var r=n.response;r.state===c.OpenIDRequestState.Allowed?t(r):r.state===c.OpenIDRequestState.Blocked?i(new Error("User declined to verify their identity")):r.state===c.OpenIDRequestState.PendingUserConfirmation?e.on("action:".concat(a.WidgetApiToWidgetAction.OpenIDCredentials),(function o(s){s.preventDefault();var d=s.detail;d.data.original_request_id===n.requestId&&(d.data.state===c.OpenIDRequestState.Allowed?(t(d.data),e.transport.reply(d,{})):d.data.state===c.OpenIDRequestState.Blocked?(i(new Error("User declined to verify their identity")),e.transport.reply(d,{})):(i(new Error("Invalid state on reply: "+r.state)),e.transport.reply(d,{error:{message:"Invalid state"}})),e.off("action:".concat(a.WidgetApiToWidgetAction.OpenIDCredentials),o))})):i(new Error("Invalid state: "+r.state))})).catch(i)}))}},{key:"updateRequestedCapabilities",value:function(){return this.transport.send(a.WidgetApiFromWidgetAction.MSC2974RenegotiateCapabilities,{capabilities:this.requestedCapabilities}).then()}},{key:"sendContentLoaded",value:function(){return this.transport.send(a.WidgetApiFromWidgetAction.ContentLoaded,{}).then()}},{key:"sendSticker",value:function(e){return this.transport.send(a.WidgetApiFromWidgetAction.SendSticker,e).then()}},{key:"setAlwaysOnScreen",value:function(e){return this.transport.send(a.WidgetApiFromWidgetAction.UpdateAlwaysOnScreen,{value:e}).then((function(e){return e.success}))}},{key:"openModalWidget",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:d.MatrixWidgetType.Custom;return this.transport.send(a.WidgetApiFromWidgetAction.OpenModalWidget,{type:r,url:e,name:t,buttons:i,data:n}).then()}},{key:"closeModalWidget",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.transport.send(a.WidgetApiFromWidgetAction.CloseModalWidget,e).then()}},{key:"sendRoomEvent",value:function(e,t,i){return this.transport.send(a.WidgetApiFromWidgetAction.SendEvent,{type:e,content:t,room_id:i})}},{key:"sendStateEvent",value:function(e,t,i,n){return this.transport.send(a.WidgetApiFromWidgetAction.SendEvent,{type:e,content:i,state_key:t,room_id:n})}},{key:"sendToDevice",value:function(e,t,i){return this.transport.send(a.WidgetApiFromWidgetAction.SendToDevice,{type:e,encrypted:t,messages:i})}},{key:"readRoomAccountData",value:function(e,t){var i={type:e};return t&&(t.includes(h.Symbols.AnyRoom)?i.room_ids=h.Symbols.AnyRoom:i.room_ids=t),this.transport.send(a.WidgetApiFromWidgetAction.BeeperReadRoomAccountData,i).then((function(e){return e.events}))}},{key:"readRoomEvents",value:function(e,t,i,n,r){var o={type:e,msgtype:i};return void 0!==t&&(o.limit=t),n&&(n.includes(h.Symbols.AnyRoom)?o.room_ids=h.Symbols.AnyRoom:o.room_ids=n),r&&(o.since=r),this.transport.send(a.WidgetApiFromWidgetAction.MSC2876ReadEvents,o).then((function(e){return e.events}))}},{key:"readEventRelations",value:(w=v(p().mark((function e(t,i,n,r,s,c,d,l){var u;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getClientVersions();case 2:if(e.sent.includes(o.UnstableApiVersion.MSC3869)){e.next=5;break}throw new Error("The read_relations action is not supported by the client.");case 5:return u={event_id:t,rel_type:n,event_type:r,room_id:i,to:d,from:c,limit:s,direction:l},e.abrupt("return",this.transport.send(a.WidgetApiFromWidgetAction.MSC3869ReadRelations,u));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,i,n,r,o,s,a){return w.apply(this,arguments)})},{key:"readStateEvents",value:function(e,t,i,n){var r={type:e,state_key:void 0===i||i};return void 0!==t&&(r.limit=t),n&&(n.includes(h.Symbols.AnyRoom)?r.room_ids=h.Symbols.AnyRoom:r.room_ids=n),this.transport.send(a.WidgetApiFromWidgetAction.MSC2876ReadEvents,r).then((function(e){return e.events}))}},{key:"setModalButtonEnabled",value:function(e,t){if(e===l.BuiltInModalButtonID.Close)throw new Error("The close button cannot be disabled");return this.transport.send(a.WidgetApiFromWidgetAction.SetModalButtonEnabled,{button:e,enabled:t}).then()}},{key:"navigateTo",value:function(e){if(!e||!e.startsWith("https://matrix.to/#"))throw new Error("Invalid matrix.to URI");return this.transport.send(a.WidgetApiFromWidgetAction.MSC2931Navigate,{uri:e}).then()}},{key:"getTurnServers",value:function(){var e,t=this;return(e=p().mark((function e(){var i,n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=function(){var e=v(p().mark((function e(n){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n.preventDefault(),i(n.detail.data),e.next=4,t.transport.reply(n.detail,{});case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),t.on("action:".concat(a.WidgetApiToWidgetAction.UpdateTurnServers),n),0!==t.turnServerWatchers){e.next=12;break}return e.prev=3,e.next=6,T(t.transport.send(a.WidgetApiFromWidgetAction.WatchTurnServers,{}));case 6:e.next=12;break;case 8:throw e.prev=8,e.t0=e.catch(3),t.off("action:".concat(a.WidgetApiToWidgetAction.UpdateTurnServers),n),e.t0;case 12:t.turnServerWatchers++,e.prev=13;case 14:return e.next=17,T(new Promise((function(e){return i=e})));case 17:return e.next=19,e.sent;case 19:e.next=14;break;case 21:if(e.prev=21,t.off("action:".concat(a.WidgetApiToWidgetAction.UpdateTurnServers),n),t.turnServerWatchers--,0!==t.turnServerWatchers){e.next=27;break}return e.next=27,T(t.transport.send(a.WidgetApiFromWidgetAction.UnwatchTurnServers,{}));case 27:return e.finish(21);case 28:case"end":return e.stop()}}),e,null,[[3,8],[13,,21,28]])})),function(){return new I(e.apply(this,arguments))})()}},{key:"searchUserDirectory",value:(S=v(p().mark((function e(t,i){var n;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getClientVersions();case 2:if(e.sent.includes(o.UnstableApiVersion.MSC3973)){e.next=5;break}throw new Error("The user_directory_search action is not supported by the client.");case 5:return n={search_term:t,limit:i},e.abrupt("return",this.transport.send(a.WidgetApiFromWidgetAction.MSC3973UserDirectorySearch,n));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"getMediaConfig",value:(g=v(p().mark((function e(){var t;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getClientVersions();case 2:if(e.sent.includes(o.UnstableApiVersion.MSC4039)){e.next=5;break}throw new Error("The get_media_config action is not supported by the client.");case 5:return t={},e.abrupt("return",this.transport.send(a.WidgetApiFromWidgetAction.MSC4039GetMediaConfigAction,t));case 7:case"end":return e.stop()}}),e,this)}))),function(){return g.apply(this,arguments)})},{key:"uploadFile",value:(f=v(p().mark((function e(t){var i;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getClientVersions();case 2:if(e.sent.includes(o.UnstableApiVersion.MSC4039)){e.next=5;break}throw new Error("The upload_file action is not supported by the client.");case 5:return i={file:t},e.abrupt("return",this.transport.send(a.WidgetApiFromWidgetAction.MSC4039UploadFileAction,i));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return f.apply(this,arguments)})},{key:"start",value:function(){var e=this;this.transport.start(),this.getClientVersions().then((function(t){t.includes(o.UnstableApiVersion.MSC2974)&&(e.supportsMSC2974Renegotiate=!0)}))}},{key:"handleMessage",value:function(e){var t=new CustomEvent("action:".concat(e.detail.action),{detail:e.detail,cancelable:!0});if(this.emit("action:".concat(e.detail.action),t),!t.defaultPrevented)switch(e.detail.action){case a.WidgetApiToWidgetAction.SupportedApiVersions:return this.replyVersions(e.detail);case a.WidgetApiToWidgetAction.Capabilities:return this.handleCapabilities(e.detail);case a.WidgetApiToWidgetAction.UpdateVisibility:case a.WidgetApiToWidgetAction.NotifyCapabilities:return this.transport.reply(e.detail,{});default:return this.transport.reply(e.detail,{error:{message:"Unknown or unsupported action: "+e.detail.action}})}}},{key:"replyVersions",value:function(e){this.transport.reply(e,{supported_versions:o.CurrentApiVersions})}},{key:"getClientVersions",value:function(){var e=this;return Array.isArray(this.cachedClientVersions)?Promise.resolve(this.cachedClientVersions):this.transport.send(a.WidgetApiFromWidgetAction.SupportedApiVersions,{}).then((function(t){return e.cachedClientVersions=t.supported_versions,t.supported_versions})).catch((function(e){return console.warn("non-fatal error getting supported client versions: ",e),[]}))}},{key:"handleCapabilities",value:function(e){var t=this;return this.capabilitiesFinished?this.transport.reply(e,{error:{message:"Capability negotiation already completed"}}):this.getClientVersions().then((function(i){return i.includes(o.UnstableApiVersion.MSC2871)?t.once("action:".concat(a.WidgetApiToWidgetAction.NotifyCapabilities),(function(e){t.approvedCapabilities=e.detail.data.approved,t.emit("ready")})):t.emit("ready"),t.capabilitiesFinished=!0,t.transport.reply(e,{capabilities:t.requestedCapabilities})}))}}],i&&m(t.prototype,i),n&&m(t,n),Object.defineProperty(t,"prototype",{writable:!1}),k}(n.EventEmitter);i.WidgetApi=k},{"./Symbols":181,"./interfaces/ApiVersion":185,"./interfaces/GetOpenIDAction":190,"./interfaces/ModalWidgetActions":201,"./interfaces/WidgetApiAction":216,"./interfaces/WidgetApiDirection":217,"./interfaces/WidgetType":220,"./models/WidgetEventCapability":222,"./transport/PostmessageTransport":228,events:109}],183:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.WidgetDriver=void 0;var n=e("..");function r(e){return 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},r(e)}function o(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(o=n.key,s=void 0,s=function(e,t){if("object"!==r(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!==r(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(o,"string"),"symbol"===r(s)?s:String(s)),n)}var o,s}var s=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,i,r;return t=e,(i=[{key:"validateCapabilities",value:function(e){return Promise.resolve(new Set)}},{key:"sendEvent",value:function(e,t){return Promise.reject(new Error("Failed to override function"))}},{key:"sendToDevice",value:function(e,t,i){return Promise.reject(new Error("Failed to override function"))}},{key:"readRoomAccountData",value:function(e){return Promise.resolve([])}},{key:"readRoomEvents",value:function(e,t,i){return Promise.resolve([])}},{key:"readStateEvents",value:function(e,t,i){return Promise.resolve([])}},{key:"readEventRelations",value:function(e,t,i,n,r,o,s,a){return Promise.resolve({chunk:[]})}},{key:"askOpenID",value:function(e){e.update({state:n.OpenIDRequestState.Blocked})}},{key:"navigate",value:function(e){throw new Error("Navigation is not implemented")}},{key:"getTurnServers",value:function(){throw new Error("TURN server support is not implemented")}},{key:"searchUserDirectory",value:function(e,t){return Promise.resolve({limited:!1,results:[]})}},{key:"getMediaConfig",value:function(){throw new Error("Get media config is not implemented")}},{key:"uploadFile",value:function(e){throw new Error("Upload file is not implemented")}}])&&o(t.prototype,i),r&&o(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();i.WidgetDriver=s},{"..":184}],184:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var n=e("./WidgetApi");Object.keys(n).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===n[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return n[e]}}))}));var r=e("./ClientWidgetApi");Object.keys(r).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===r[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return r[e]}}))}));var o=e("./Symbols");Object.keys(o).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===o[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return o[e]}}))}));var s=e("./transport/ITransport");Object.keys(s).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===s[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return s[e]}}))}));var a=e("./transport/PostmessageTransport");Object.keys(a).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===a[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return a[e]}}))}));var c=e("./interfaces/ICustomWidgetData");Object.keys(c).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===c[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return c[e]}}))}));var d=e("./interfaces/IJitsiWidgetData");Object.keys(d).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===d[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return d[e]}}))}));var l=e("./interfaces/IStickerpickerWidgetData");Object.keys(l).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===l[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return l[e]}}))}));var u=e("./interfaces/IWidget");Object.keys(u).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===u[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return u[e]}}))}));var h=e("./interfaces/WidgetType");Object.keys(h).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===h[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return h[e]}}))}));var f=e("./interfaces/IWidgetApiErrorResponse");Object.keys(f).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===f[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return f[e]}}))}));var p=e("./interfaces/IWidgetApiRequest");Object.keys(p).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===p[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return p[e]}}))}));var g=e("./interfaces/IWidgetApiResponse");Object.keys(g).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===g[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return g[e]}}))}));var v=e("./interfaces/WidgetApiAction");Object.keys(v).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===v[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return v[e]}}))}));var m=e("./interfaces/WidgetApiDirection");Object.keys(m).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===m[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return m[e]}}))}));var y=e("./interfaces/ApiVersion");Object.keys(y).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===y[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return y[e]}}))}));var b=e("./interfaces/Capabilities");Object.keys(b).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===b[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return b[e]}}))}));var _=e("./interfaces/CapabilitiesAction");Object.keys(_).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===_[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return _[e]}}))}));var S=e("./interfaces/ContentLoadedAction");Object.keys(S).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===S[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return S[e]}}))}));var E=e("./interfaces/ScreenshotAction");Object.keys(E).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===E[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return E[e]}}))}));var w=e("./interfaces/StickerAction");Object.keys(w).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===w[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return w[e]}}))}));var T=e("./interfaces/StickyAction");Object.keys(T).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===T[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return T[e]}}))}));var I=e("./interfaces/SupportedVersionsAction");Object.keys(I).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===I[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return I[e]}}))}));var R=e("./interfaces/VisibilityAction");Object.keys(R).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===R[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return R[e]}}))}));var k=e("./interfaces/GetOpenIDAction");Object.keys(k).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===k[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return k[e]}}))}));var M=e("./interfaces/OpenIDCredentialsAction");Object.keys(M).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===M[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return M[e]}}))}));var C=e("./interfaces/WidgetKind");Object.keys(C).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===C[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return C[e]}}))}));var O=e("./interfaces/ModalButtonKind");Object.keys(O).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===O[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return O[e]}}))}));var A=e("./interfaces/ModalWidgetActions");Object.keys(A).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===A[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return A[e]}}))}));var P=e("./interfaces/SetModalButtonEnabledAction");Object.keys(P).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===P[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return P[e]}}))}));var D=e("./interfaces/WidgetConfigAction");Object.keys(D).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===D[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return D[e]}}))}));var x=e("./interfaces/SendEventAction");Object.keys(x).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===x[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return x[e]}}))}));var L=e("./interfaces/SendToDeviceAction");Object.keys(L).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===L[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return L[e]}}))}));var U=e("./interfaces/ReadEventAction");Object.keys(U).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===U[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return U[e]}}))}));var N=e("./interfaces/IRoomEvent");Object.keys(N).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===N[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return N[e]}}))}));var B=e("./interfaces/IRoomAccountData");Object.keys(B).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===B[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return B[e]}}))}));var j=e("./interfaces/NavigateAction");Object.keys(j).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===j[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return j[e]}}))}));var F=e("./interfaces/TurnServerActions");Object.keys(F).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===F[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return F[e]}}))}));var K=e("./interfaces/ReadRelationsAction");Object.keys(K).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===K[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return K[e]}}))}));var q=e("./interfaces/GetMediaConfigAction");Object.keys(q).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===q[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return q[e]}}))}));var $=e("./interfaces/UploadFileAction");Object.keys($).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===$[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return $[e]}}))}));var V=e("./models/WidgetEventCapability");Object.keys(V).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===V[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return V[e]}}))}));var H=e("./models/validation/url");Object.keys(H).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===H[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return H[e]}}))}));var W=e("./models/validation/utils");Object.keys(W).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===W[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return W[e]}}))}));var G=e("./models/Widget");Object.keys(G).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===G[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return G[e]}}))}));var z=e("./models/WidgetParser");Object.keys(z).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===z[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return z[e]}}))}));var Y=e("./templating/url-template");Object.keys(Y).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===Y[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return Y[e]}}))}));var J=e("./util/SimpleObservable");Object.keys(J).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===J[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return J[e]}}))}));var Q=e("./driver/WidgetDriver");Object.keys(Q).forEach((function(e){"default"!==e&&"__esModule"!==e&&(e in i&&i[e]===Q[e]||Object.defineProperty(i,e,{enumerable:!0,get:function(){return Q[e]}}))}))},{"./ClientWidgetApi":180,"./Symbols":181,"./WidgetApi":182,"./driver/WidgetDriver":183,"./interfaces/ApiVersion":185,"./interfaces/Capabilities":186,"./interfaces/CapabilitiesAction":187,"./interfaces/ContentLoadedAction":188,"./interfaces/GetMediaConfigAction":189,"./interfaces/GetOpenIDAction":190,"./interfaces/ICustomWidgetData":191,"./interfaces/IJitsiWidgetData":192,"./interfaces/IRoomAccountData":193,"./interfaces/IRoomEvent":194,"./interfaces/IStickerpickerWidgetData":195,"./interfaces/IWidget":196,"./interfaces/IWidgetApiErrorResponse":197,"./interfaces/IWidgetApiRequest":198,"./interfaces/IWidgetApiResponse":199,"./interfaces/ModalButtonKind":200,"./interfaces/ModalWidgetActions":201,"./interfaces/NavigateAction":202,"./interfaces/OpenIDCredentialsAction":203,"./interfaces/ReadEventAction":204,"./interfaces/ReadRelationsAction":205,"./interfaces/ScreenshotAction":206,"./interfaces/SendEventAction":207,"./interfaces/SendToDeviceAction":208,"./interfaces/SetModalButtonEnabledAction":209,"./interfaces/StickerAction":210,"./interfaces/StickyAction":211,"./interfaces/SupportedVersionsAction":212,"./interfaces/TurnServerActions":213,"./interfaces/UploadFileAction":214,"./interfaces/VisibilityAction":215,"./interfaces/WidgetApiAction":216,"./interfaces/WidgetApiDirection":217,"./interfaces/WidgetConfigAction":218,"./interfaces/WidgetKind":219,"./interfaces/WidgetType":220,"./models/Widget":221,"./models/WidgetEventCapability":222,"./models/WidgetParser":223,"./models/validation/url":224,"./models/validation/utils":225,"./templating/url-template":226,"./transport/ITransport":227,"./transport/PostmessageTransport":228,"./util/SimpleObservable":229}],185:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UnstableApiVersion=i.MatrixApiVersion=i.CurrentApiVersions=void 0;var n=function(e){return e.Prerelease1="0.0.1",e.Prerelease2="0.0.2",e}({});i.MatrixApiVersion=n;var r=function(e){return e.MSC2762="org.matrix.msc2762",e.MSC2871="org.matrix.msc2871",e.MSC2931="org.matrix.msc2931",e.MSC2974="org.matrix.msc2974",e.MSC2876="org.matrix.msc2876",e.MSC3819="org.matrix.msc3819",e.MSC3846="town.robin.msc3846",e.MSC3869="org.matrix.msc3869",e.MSC3973="org.matrix.msc3973",e.MSC4039="org.matrix.msc4039",e}({});i.UnstableApiVersion=r;var o=[n.Prerelease1,n.Prerelease2,r.MSC2762,r.MSC2871,r.MSC2931,r.MSC2974,r.MSC2876,r.MSC3819,r.MSC3846,r.MSC3869,r.MSC3973,r.MSC4039];i.CurrentApiVersions=o},{}],186:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.VideoConferenceCapabilities=i.StickerpickerCapabilities=i.MatrixCapabilities=void 0,i.getTimelineRoomIDFromCapability=function(e){return e.substring(e.indexOf(":")+1)},i.isTimelineCapability=function(e){return null==e?void 0:e.startsWith("org.matrix.msc2762.timeline:")},i.isTimelineCapabilityFor=function(e,t){return e==="org.matrix.msc2762.timeline:".concat(t)};var n=function(e){return e.Screenshots="m.capability.screenshot",e.StickerSending="m.sticker",e.AlwaysOnScreen="m.always_on_screen",e.RequiresClient="io.element.requires_client",e.MSC2931Navigate="org.matrix.msc2931.navigate",e.MSC3846TurnServers="town.robin.msc3846.turn_servers",e.MSC3973UserDirectorySearch="org.matrix.msc3973.user_directory_search",e.MSC4039UploadFile="org.matrix.msc4039.upload_file",e}({});i.MatrixCapabilities=n;var r=[n.StickerSending];i.StickerpickerCapabilities=r;var o=[n.AlwaysOnScreen];i.VideoConferenceCapabilities=o},{}],187:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],188:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],189:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],190:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.OpenIDRequestState=void 0;var n=function(e){return e.Allowed="allowed",e.Blocked="blocked",e.PendingUserConfirmation="request",e}({});i.OpenIDRequestState=n},{}],191:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],192:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],193:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],194:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],195:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],196:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],197:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.isErrorResponse=function(e){if("error"in e){return!!e.error.message}return!1}},{}],198:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],199:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],200:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.ModalButtonKind=void 0;var n=function(e){return e.Primary="m.primary",e.Secondary="m.secondary",e.Warning="m.warning",e.Danger="m.danger",e.Link="m.link",e}({});i.ModalButtonKind=n},{}],201:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.BuiltInModalButtonID=void 0;var n=function(e){return e.Close="m.close",e}({});i.BuiltInModalButtonID=n},{}],202:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],203:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],204:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],205:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],206:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],207:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],208:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],209:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],210:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],211:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],212:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],213:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],214:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],215:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],216:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.WidgetApiToWidgetAction=i.WidgetApiFromWidgetAction=void 0;var n=function(e){return e.SupportedApiVersions="supported_api_versions",e.Capabilities="capabilities",e.NotifyCapabilities="notify_capabilities",e.TakeScreenshot="screenshot",e.UpdateVisibility="visibility",e.OpenIDCredentials="openid_credentials",e.WidgetConfig="widget_config",e.CloseModalWidget="close_modal",e.ButtonClicked="button_clicked",e.SendEvent="send_event",e.SendToDevice="send_to_device",e.UpdateTurnServers="update_turn_servers",e}({});i.WidgetApiToWidgetAction=n;var r=function(e){return e.SupportedApiVersions="supported_api_versions",e.ContentLoaded="content_loaded",e.SendSticker="m.sticker",e.UpdateAlwaysOnScreen="set_always_on_screen",e.GetOpenIDCredentials="get_openid",e.CloseModalWidget="close_modal",e.OpenModalWidget="open_modal",e.SetModalButtonEnabled="set_button_enabled",e.SendEvent="send_event",e.SendToDevice="send_to_device",e.WatchTurnServers="watch_turn_servers",e.UnwatchTurnServers="unwatch_turn_servers",e.BeeperReadRoomAccountData="com.beeper.read_room_account_data",e.MSC2876ReadEvents="org.matrix.msc2876.read_events",e.MSC2931Navigate="org.matrix.msc2931.navigate",e.MSC2974RenegotiateCapabilities="org.matrix.msc2974.request_capabilities",e.MSC3869ReadRelations="org.matrix.msc3869.read_relations",e.MSC3973UserDirectorySearch="org.matrix.msc3973.user_directory_search",e.MSC4039GetMediaConfigAction="org.matrix.msc4039.get_media_config",e.MSC4039UploadFileAction="org.matrix.msc4039.upload_file",e}({});i.WidgetApiFromWidgetAction=r},{}],217:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.WidgetApiDirection=void 0,i.invertedDirection=function(e){if(e===n.ToWidget)return n.FromWidget;if(e===n.FromWidget)return n.ToWidget;throw new Error("Invalid direction")};var n=function(e){return e.ToWidget="toWidget",e.FromWidget="fromWidget",e}({});i.WidgetApiDirection=n},{}],218:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],219:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.WidgetKind=void 0;var n=function(e){return e.Room="room",e.Account="account",e.Modal="modal",e}({});i.WidgetKind=n},{}],220:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.MatrixWidgetType=void 0;var n=function(e){return e.Custom="m.custom",e.JitsiMeet="m.jitsi",e.Stickerpicker="m.stickerpicker",e}({});i.MatrixWidgetType=n},{}],221:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.Widget=void 0;var n=e("./validation/utils"),r=e("..");function o(e){return o="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},o(e)}function s(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(r=n.key,s=void 0,s=function(e,t){if("object"!==o(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.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)}(r,"string"),"symbol"===o(s)?s:String(s)),n)}var r,s}var a=function(){function e(t){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.definition=t,!this.definition)throw new Error("Definition is required");(0,n.assertPresent)(t,"id"),(0,n.assertPresent)(t,"creatorUserId"),(0,n.assertPresent)(t,"type"),(0,n.assertPresent)(t,"url")}var t,i,o;return t=e,(i=[{key:"creatorUserId",get:function(){return this.definition.creatorUserId}},{key:"type",get:function(){return this.definition.type}},{key:"id",get:function(){return this.definition.id}},{key:"name",get:function(){return this.definition.name||null}},{key:"title",get:function(){return this.rawData.title||null}},{key:"templateUrl",get:function(){return this.definition.url}},{key:"origin",get:function(){return new URL(this.templateUrl).origin}},{key:"waitForIframeLoad",get:function(){return!1!==this.definition.waitForIframeLoad&&(this.definition.waitForIframeLoad,!0)}},{key:"rawData",get:function(){return this.definition.data||{}}},{key:"getCompleteUrl",value:function(e){return(0,r.runTemplate)(this.templateUrl,this.definition,e)}}])&&s(t.prototype,i),o&&s(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();i.Widget=a},{"..":184,"./validation/utils":225}],222:[function(e,t,i){"use strict";function n(e){return n="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},n(e)}function r(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}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(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){c=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(c)throw s}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function s(e,t){for(var i=0;i<t.length;i++){var r=t[i];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(o=r.key,s=void 0,s=function(e,t){if("object"!==n(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!==n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(o,"string"),"symbol"===n(s)?s:String(s)),r)}var o,s}Object.defineProperty(i,"__esModule",{value:!0}),i.WidgetEventCapability=i.EventKind=i.EventDirection=void 0;var a=function(e){return e.Event="event",e.State="state_event",e.ToDevice="to_device",e.RoomAccount="room_account",e}({});i.EventKind=a;var c=function(e){return e.Send="send",e.Receive="receive",e}({});i.EventDirection=c;var d=function(){function e(t,i,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.direction=t,this.eventType=i,this.kind=n,this.keyStr=r,this.raw=o}var t,i,n;return t=e,i=[{key:"matchesAsStateEvent",value:function(e,t,i){return this.kind===a.State&&this.direction===e&&this.eventType===t&&(null===this.keyStr||this.keyStr===i)}},{key:"matchesAsToDeviceEvent",value:function(e,t){return this.kind===a.ToDevice&&this.direction===e&&this.eventType===t}},{key:"matchesAsRoomEvent",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return this.kind===a.Event&&this.direction===e&&this.eventType===t&&("m.room.message"!==this.eventType||null===this.keyStr||this.keyStr===i)}},{key:"matchesAsRoomAccountData",value:function(e,t){return this.kind===a.RoomAccount&&this.direction===e&&this.eventType===t}}],n=[{key:"forStateEvent",value:function(t,i,n){i=i.replace(/#/g,"\\#"),n=null!=n?"#".concat(n):"";var r="org.matrix.msc2762.".concat(t,".state_event:").concat(i).concat(n);return e.findEventCapabilities([r])[0]}},{key:"forToDeviceEvent",value:function(t,i){var n="org.matrix.msc3819.".concat(t,".to_device:").concat(i);return e.findEventCapabilities([n])[0]}},{key:"forRoomEvent",value:function(t,i){var n="org.matrix.msc2762.".concat(t,".event:").concat(i);return e.findEventCapabilities([n])[0]}},{key:"forRoomMessageEvent",value:function(t,i){i=null==i?"":i;var n="org.matrix.msc2762.".concat(t,".event:m.room.message#").concat(i);return e.findEventCapabilities([n])[0]}},{key:"forRoomAccountData",value:function(t,i){var n="com.beeper.capabilities.".concat(t,".room_account_data:").concat(i);return e.findEventCapabilities([n])[0]}},{key:"findEventCapabilities",value:function(t){var i,n=[],o=r(t);try{for(o.s();!(i=o.n()).done;){var s=i.value,d=null,l=void 0,u=null;if(s.startsWith("org.matrix.msc2762.send.event:")?(d=c.Send,u=a.Event,l=s.substring(30)):s.startsWith("org.matrix.msc2762.send.state_event:")?(d=c.Send,u=a.State,l=s.substring(36)):s.startsWith("org.matrix.msc3819.send.to_device:")?(d=c.Send,u=a.ToDevice,l=s.substring(34)):s.startsWith("org.matrix.msc2762.receive.event:")?(d=c.Receive,u=a.Event,l=s.substring(33)):s.startsWith("org.matrix.msc2762.receive.state_event:")?(d=c.Receive,u=a.State,l=s.substring(39)):s.startsWith("org.matrix.msc3819.receive.to_device:")?(d=c.Receive,u=a.ToDevice,l=s.substring(37)):s.startsWith("com.beeper.capabilities.receive.room_account_data:")&&(d=c.Receive,u=a.RoomAccount,l=s.substring(50)),null!==d&&null!==u&&void 0!==l){var h=l.startsWith("m.room.message#")||u===a.State,f=null;if(l.includes("#")&&h){var p=l.split("#"),g=p.findIndex((function(e){return!e.endsWith("\\")}));l=p.slice(0,g+1).map((function(e){return e.endsWith("\\")?e.substring(0,e.length-1):e})).join("#"),f=p.slice(g+1).join("#")}n.push(new e(d,l,u,f,s))}}}catch(e){o.e(e)}finally{o.f()}return n}}],i&&s(t.prototype,i),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();i.WidgetEventCapability=d},{}],223:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.WidgetParser=void 0;var n=e("./Widget"),r=e("./validation/url");function o(e){return o="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},o(e)}function s(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return a(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}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 o,s=!0,c=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return s=e.done,e},e:function(e){c=!0,o=e},f:function(){try{s||null==i.return||i.return()}finally{if(c)throw o}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function c(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(r=n.key,s=void 0,s=function(e,t){if("object"!==o(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.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)}(r,"string"),"symbol"===o(s)?s:String(s)),n)}var r,s}var d=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var t,i,o;return t=e,o=[{key:"parseAccountData",value:function(t){if(!t)return[];for(var i=[],n=0,r=Object.keys(t);n<r.length;n++){var o=r[n],s=t[o];if(s&&("m.widget"===s.type||"im.vector.modular.widgets"===s.type)&&s.sender&&(s.state_key||s.id)===o){var a={content:s.content,sender:s.sender,type:"m.widget",state_key:o,event_id:"$example",room_id:"!example",origin_server_ts:1},c=e.parseRoomWidget(a);c&&i.push(c)}}return i}},{key:"parseWidgetsFromRoomState",value:function(t){if(!t)return[];var i,n=[],r=s(t);try{for(r.s();!(i=r.n()).done;){var o=i.value,a=e.parseRoomWidget(o);a&&n.push(a)}}catch(e){r.e(e)}finally{r.f()}return n}},{key:"parseRoomWidget",value:function(t){if(!t)return null;if("m.widget"!==t.type&&"im.vector.modular.widgets"!==t.type)return null;var i=t.content||{},n={id:t.state_key,creatorUserId:i.creatorUserId||t.sender,name:i.name,type:i.type,url:i.url,waitForIframeLoad:i.waitForIframeLoad,data:i.data};return e.processEstimatedWidget(n)}},{key:"processEstimatedWidget",value:function(e){return e.id&&e.creatorUserId&&e.type&&(0,r.isValidUrl)(e.url)?new n.Widget(e):null}}],(i=null)&&c(t.prototype,i),o&&c(t,o),Object.defineProperty(t,"prototype",{writable:!1}),e}();i.WidgetParser=d},{"./Widget":221,"./validation/url":224}],224:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.isValidUrl=function(e){if(!e)return!1;try{var t=new URL(e);return"http"===t.protocol||"https"===t.protocol}catch(e){if(e instanceof TypeError)return!1;throw e}}},{}],225:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.assertPresent=function(e,t){if(!e[t])throw new Error("".concat(String(t)," is required"))}},{}],226:[function(e,t,i){"use strict";function n(e){return null==e?"".concat(e):String(e)}Object.defineProperty(i,"__esModule",{value:!0}),i.runTemplate=function(e,t,i){for(var r=Object.assign({},t.data,{matrix_room_id:i.widgetRoomId||"",matrix_user_id:i.currentUserId,matrix_display_name:i.userDisplayName||i.currentUserId,matrix_avatar_url:i.userHttpAvatarUrl||"",matrix_widget_id:t.id,"org.matrix.msc2873.client_id":i.clientId||"","org.matrix.msc2873.client_theme":i.clientTheme||"","org.matrix.msc2873.client_language":i.clientLanguage||"","org.matrix.msc3819.matrix_device_id":i.deviceId||"","org.matrix.msc4039.matrix_base_url":i.baseUrl||""}),o=e,s=0,a=Object.keys(r);s<a.length;s++){var c=a[s],d="$".concat(c).replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),l=new RegExp(d,"g");o=o.replace(l,encodeURIComponent(n(r[c])))}return o},i.toString=n},{}],227:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],228:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.PostmessageTransport=void 0;var n=e("events"),r=e("..");function o(e){return o="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},o(e)}function s(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function a(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?s(Object(i),!0).forEach((function(t){f(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):s(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function c(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,p(n.key),n)}}function d(e,t){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},d(e,t)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var i,n=h(e);if(t){var r=h(this).constructor;i=Reflect.construct(n,arguments,r)}else i=n.apply(this,arguments);return function(e,t){if(t&&("object"===o(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return u(e)}(this,i)}}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function f(e,t,i){return(t=p(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function p(e){var t=function(e,t){if("object"!==o(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.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,"string");return"symbol"===o(t)?t:String(t)}var g=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&d(e,t)}(s,e);var t,i,n,o=l(s);function s(e,t,i,n){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(r=o.call(this)).sendDirection=e,r.initialWidgetId=t,r.transportWindow=i,r.inboundWindow=n,f(u(r),"strictOriginCheck",!1),f(u(r),"targetOrigin","*"),f(u(r),"timeoutSeconds",10),f(u(r),"_ready",!1),f(u(r),"_widgetId",null),f(u(r),"outboundRequests",new Map),f(u(r),"stopController",new AbortController),r._widgetId=t,r}return t=s,(i=[{key:"ready",get:function(){return this._ready}},{key:"widgetId",get:function(){return this._widgetId||null}},{key:"nextRequestId",get:function(){for(var e="widgetapi-".concat(Date.now()),t=0,i=e;this.outboundRequests.has(i);)i="".concat(e,"-").concat(t++);return this.outboundRequests.set(i,null),i}},{key:"sendInternal",value:function(e){console.log("[PostmessageTransport] Sending object to ".concat(this.targetOrigin,": "),e),this.transportWindow.postMessage(e,this.targetOrigin)}},{key:"reply",value:function(e,t){return this.sendInternal(a(a({},e),{},{response:t}))}},{key:"send",value:function(e,t){return this.sendComplete(e,t).then((function(e){return e.response}))}},{key:"sendComplete",value:function(e,t){var i=this;if(!this.ready||!this.widgetId)return Promise.reject(new Error("Not ready or unknown widget ID"));var n={api:this.sendDirection,widgetId:this.widgetId,requestId:this.nextRequestId,action:e,data:t};return e===r.WidgetApiToWidgetAction.UpdateVisibility&&(n.visible=t.visible),new Promise((function(e,t){var r=function(e){a(),t(e)},o=setTimeout((function(){return r(new Error("Request timed out"))}),1e3*(i.timeoutSeconds||1)),s=function(){return r(new Error("Transport stopped"))};i.stopController.signal.addEventListener("abort",s);var a=function(){i.outboundRequests.delete(n.requestId),clearTimeout(o),i.stopController.signal.removeEventListener("abort",s)};i.outboundRequests.set(n.requestId,{request:n,resolve:function(t){a(),e(t)},reject:r}),i.sendInternal(n)}))}},{key:"start",value:function(){var e=this;this.inboundWindow.addEventListener("message",(function(t){e.handleMessage(t)})),this._ready=!0}},{key:"stop",value:function(){this._ready=!1,this.stopController.abort()}},{key:"handleMessage",value:function(e){if(!this.stopController.signal.aborted&&e.data&&(!this.strictOriginCheck||e.origin===window.origin)){var t=e.data;if(t.action&&t.requestId&&t.widgetId)if(t.response){if(t.api!==this.sendDirection)return;this.handleResponse(t)}else{var i=t;if(i.api!==(0,r.invertedDirection)(this.sendDirection))return;this.handleRequest(i)}}}},{key:"handleRequest",value:function(e){if(this.widgetId){if(this.widgetId!==e.widgetId)return}else this._widgetId=e.widgetId;this.emit("message",new CustomEvent("message",{detail:e}))}},{key:"handleResponse",value:function(e){if(e.widgetId===this.widgetId){var t=this.outboundRequests.get(e.requestId);if(t)if((0,r.isErrorResponse)(e.response)){var i=e.response;t.reject(new Error(i.error.message))}else t.resolve(e)}}}])&&c(t.prototype,i),n&&c(t,n),Object.defineProperty(t,"prototype",{writable:!1}),s}(n.EventEmitter);i.PostmessageTransport=g},{"..":184,events:109}],229:[function(e,t,i){"use strict";function n(e){return n="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},n(e)}function r(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return o(e,t)}(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}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(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){c=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(c)throw s}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function s(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,a(n.key),n)}}function a(e){var t=function(e,t){if("object"!==n(e)||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var r=i.call(e,t||"default");if("object"!==n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"===n(t)?t:String(t)}Object.defineProperty(i,"__esModule",{value:!0}),i.SimpleObservable=void 0;var c=function(){function e(t){var i,n,r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),i=this,r=[],(n=a(n="listeners"))in i?Object.defineProperty(i,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):i[n]=r,t&&this.listeners.push(t)}var t,i,n;return t=e,(i=[{key:"onUpdate",value:function(e){this.listeners.push(e)}},{key:"update",value:function(e){var t,i=r(this.listeners);try{for(i.s();!(t=i.n()).done;)(0,t.value)(e)}catch(e){i.e(e)}finally{i.f()}}},{key:"close",value:function(){this.listeners=[]}}])&&s(t.prototype,i),n&&s(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();i.SimpleObservable=c},{}],230:[function(e,t,i){"use strict";var n=e("inherits"),r=e("hash-base"),o=e("safe-buffer").Buffer,s=new Array(16);function a(){r.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function c(e,t){return e<<t|e>>>32-t}function d(e,t,i,n,r,o,s){return c(e+(t&i|~t&n)+r+o|0,s)+t|0}function l(e,t,i,n,r,o,s){return c(e+(t&n|i&~n)+r+o|0,s)+t|0}function u(e,t,i,n,r,o,s){return c(e+(t^i^n)+r+o|0,s)+t|0}function h(e,t,i,n,r,o,s){return c(e+(i^(t|~n))+r+o|0,s)+t|0}n(a,r),a.prototype._update=function(){for(var e=s,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);var i=this._a,n=this._b,r=this._c,o=this._d;i=d(i,n,r,o,e[0],3614090360,7),o=d(o,i,n,r,e[1],3905402710,12),r=d(r,o,i,n,e[2],606105819,17),n=d(n,r,o,i,e[3],3250441966,22),i=d(i,n,r,o,e[4],4118548399,7),o=d(o,i,n,r,e[5],1200080426,12),r=d(r,o,i,n,e[6],2821735955,17),n=d(n,r,o,i,e[7],4249261313,22),i=d(i,n,r,o,e[8],1770035416,7),o=d(o,i,n,r,e[9],2336552879,12),r=d(r,o,i,n,e[10],4294925233,17),n=d(n,r,o,i,e[11],2304563134,22),i=d(i,n,r,o,e[12],1804603682,7),o=d(o,i,n,r,e[13],4254626195,12),r=d(r,o,i,n,e[14],2792965006,17),i=l(i,n=d(n,r,o,i,e[15],1236535329,22),r,o,e[1],4129170786,5),o=l(o,i,n,r,e[6],3225465664,9),r=l(r,o,i,n,e[11],643717713,14),n=l(n,r,o,i,e[0],3921069994,20),i=l(i,n,r,o,e[5],3593408605,5),o=l(o,i,n,r,e[10],38016083,9),r=l(r,o,i,n,e[15],3634488961,14),n=l(n,r,o,i,e[4],3889429448,20),i=l(i,n,r,o,e[9],568446438,5),o=l(o,i,n,r,e[14],3275163606,9),r=l(r,o,i,n,e[3],4107603335,14),n=l(n,r,o,i,e[8],1163531501,20),i=l(i,n,r,o,e[13],2850285829,5),o=l(o,i,n,r,e[2],4243563512,9),r=l(r,o,i,n,e[7],1735328473,14),i=u(i,n=l(n,r,o,i,e[12],2368359562,20),r,o,e[5],4294588738,4),o=u(o,i,n,r,e[8],2272392833,11),r=u(r,o,i,n,e[11],1839030562,16),n=u(n,r,o,i,e[14],4259657740,23),i=u(i,n,r,o,e[1],2763975236,4),o=u(o,i,n,r,e[4],1272893353,11),r=u(r,o,i,n,e[7],4139469664,16),n=u(n,r,o,i,e[10],3200236656,23),i=u(i,n,r,o,e[13],681279174,4),o=u(o,i,n,r,e[0],3936430074,11),r=u(r,o,i,n,e[3],3572445317,16),n=u(n,r,o,i,e[6],76029189,23),i=u(i,n,r,o,e[9],3654602809,4),o=u(o,i,n,r,e[12],3873151461,11),r=u(r,o,i,n,e[15],530742520,16),i=h(i,n=u(n,r,o,i,e[2],3299628645,23),r,o,e[0],4096336452,6),o=h(o,i,n,r,e[7],1126891415,10),r=h(r,o,i,n,e[14],2878612391,15),n=h(n,r,o,i,e[5],4237533241,21),i=h(i,n,r,o,e[12],1700485571,6),o=h(o,i,n,r,e[3],2399980690,10),r=h(r,o,i,n,e[10],4293915773,15),n=h(n,r,o,i,e[1],2240044497,21),i=h(i,n,r,o,e[8],1873313359,6),o=h(o,i,n,r,e[15],4264355552,10),r=h(r,o,i,n,e[6],2734768916,15),n=h(n,r,o,i,e[13],1309151649,21),i=h(i,n,r,o,e[4],4149444226,6),o=h(o,i,n,r,e[11],3174756917,10),r=h(r,o,i,n,e[2],718787259,15),n=h(n,r,o,i,e[9],3951481745,21),this._a=this._a+i|0,this._b=this._b+n|0,this._c=this._c+r|0,this._d=this._d+o|0},a.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=o.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},t.exports=a},{"hash-base":121,inherits:151,"safe-buffer":260}],231:[function(e,t,i){var n=e("bn.js"),r=e("brorand");function o(e){this.rand=e||new r.Rand}t.exports=o,o.create=function(e){return new o(e)},o.prototype._randbelow=function(e){var t=e.bitLength(),i=Math.ceil(t/8);do{var r=new n(this.rand.generate(i))}while(r.cmp(e)>=0);return r},o.prototype._randrange=function(e,t){var i=t.sub(e);return e.add(this._randbelow(i))},o.prototype.test=function(e,t,i){var r=e.bitLength(),o=n.mont(e),s=new n(1).toRed(o);t||(t=Math.max(1,r/48|0));for(var a=e.subn(1),c=0;!a.testn(c);c++);for(var d=e.shrn(c),l=a.toRed(o);t>0;t--){var u=this._randrange(new n(2),a);i&&i(u);var h=u.toRed(o).redPow(d);if(0!==h.cmp(s)&&0!==h.cmp(l)){for(var f=1;f<c;f++){if(0===(h=h.redSqr()).cmp(s))return!1;if(0===h.cmp(l))break}if(f===c)return!1}}return!0},o.prototype.getDivisor=function(e,t){var i=e.bitLength(),r=n.mont(e),o=new n(1).toRed(r);t||(t=Math.max(1,i/48|0));for(var s=e.subn(1),a=0;!s.testn(a);a++);for(var c=e.shrn(a),d=s.toRed(r);t>0;t--){var l=this._randrange(new n(2),s),u=e.gcd(l);if(0!==u.cmpn(1))return u;var h=l.toRed(r).redPow(c);if(0!==h.cmp(o)&&0!==h.cmp(d)){for(var f=1;f<a;f++){if(0===(h=h.redSqr()).cmp(o))return h.fromRed().subn(1).gcd(e);if(0===h.cmp(d))break}if(f===a)return(h=h.redSqr()).fromRed().subn(1).gcd(e)}}return!1}},{"bn.js":18,brorand:19}],232:[function(e,t,i){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}t.exports=n,n.equal=function(e,t,i){if(e!=t)throw new Error(i||"Assertion failed: "+e+" != "+t)}},{}],233:[function(e,t,i){"use strict";var n=i;function r(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",i=0;i<e.length;i++)t+=r(e[i].toString(16));return t}n.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var i=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)i[n]=0|e[n];return i}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)i.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var r=e.charCodeAt(n),o=r>>8,s=255&r;o?i.push(o,s):i.push(s)}return i},n.zero2=r,n.toHex=o,n.encode=function(e,t){return"hex"===t?o(e):e}},{}],234:[function(e,t,i){"use strict";var n,r=Object.create,o=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,c=Object.getPrototypeOf,d=Object.prototype.hasOwnProperty,l=(e,t,i,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let r of a(t))d.call(e,r)||r===i||o(e,r,{get:()=>t[r],enumerable:!(n=s(t,r))||n.enumerable});return e},u=(e,t,i)=>(i=null!=e?r(c(e)):{},l(!t&&e&&e.__esModule?i:o(i,"default",{value:e,enumerable:!0}),e)),h={};((e,t)=>{for(var i in t)o(e,i,{get:t[i],enumerable:!0})})(h,{AccessTokenEvents:()=>P,CheckSessionIFrame:()=>D,ErrorResponse:()=>O,ErrorTimeout:()=>A,InMemoryWebStorage:()=>x,Log:()=>S,Logger:()=>E,MetadataService:()=>U,OidcClient:()=>Q,OidcClientSettingsStore:()=>B,SessionMonitor:()=>X,SigninResponse:()=>H,SigninState:()=>$,SignoutResponse:()=>G,State:()=>q,User:()=>Z,UserManager:()=>ve,UserManagerSettingsStore:()=>ae,Version:()=>me,WebStorageStateStore:()=>N}),t.exports=(n=h,l(o({},"__esModule",{value:!0}),n));var f,p,g,v=u(e("crypto-js/core.js")),m=u(e("crypto-js/sha256.js")),y=u(e("crypto-js/enc-base64.js")),b=u(e("crypto-js/enc-utf8.js")),_={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},S=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(S||{});(g=S||(S={})).reset=function(){f=3,p=_},g.setLevel=function(e){if(!(0<=e&&e<=4))throw new Error("Invalid log level");f=e},g.setLogger=function(e){p=e};var E=class{constructor(e){this._name=e}debug(...e){f>=4&&p.debug(E._format(this._name,this._method),...e)}info(...e){f>=3&&p.info(E._format(this._name,this._method),...e)}warn(...e){f>=2&&p.warn(E._format(this._name,this._method),...e)}error(...e){f>=1&&p.error(E._format(this._name,this._method),...e)}throw(e){throw this.error(e),e}create(e){const t=Object.create(this);return t._method=e,t.debug("begin"),t}static createStatic(e,t){const i=new E(`${e}.${t}`);return i.debug("begin"),i}static _format(e,t){const i=`[${e}]`;return t?`${i} ${t}:`:i}static debug(e,...t){f>=4&&p.debug(E._format(e),...t)}static info(e,...t){f>=3&&p.info(E._format(e),...t)}static warn(e,...t){f>=2&&p.warn(E._format(e),...t)}static error(e,...t){f>=1&&p.error(E._format(e),...t)}};S.reset();var w=class{static _randomWord(){return v.default.lib.WordArray.random(1).words[0]}static generateUUIDv4(){return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(+e^w._randomWord()&15>>+e/4).toString(16))).replace(/-/g,"")}static generateCodeVerifier(){return w.generateUUIDv4()+w.generateUUIDv4()+w.generateUUIDv4()}static generateCodeChallenge(e){try{const t=(0,m.default)(e);return y.default.stringify(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(e){throw E.error("CryptoUtils.generateCodeChallenge",e),e}}static generateBasicAuth(e,t){const i=b.default.parse([e,t].join(":"));return y.default.stringify(i)}},T=class{constructor(e){this._name=e,this._logger=new E(`Event('${this._name}')`),this._callbacks=[]}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const t=this._callbacks.lastIndexOf(e);t>=0&&this._callbacks.splice(t,1)}raise(...e){this._logger.debug("raise:",...e);for(const t of this._callbacks)t(...e)}},I=u(e("jwt-decode")),R=class{static decode(e){try{return(0,I.default)(e)}catch(e){throw E.error("JwtUtils.decode",e),e}}},k=class{static center({...e}){var t;return null==e.width&&(e.width=null!=(t=[800,720,600,480].find((e=>e<=window.outerWidth/1.618)))?t:360),null!=e.left||(e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2))),null!=e.height&&(null!=e.top||(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2)))),e}static serialize(e){return Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>`${e}=${"boolean"!=typeof t?t:t?"yes":"no"}`)).join(",")}},M=class extends T{constructor(){super(...arguments),this._logger=new E(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-M.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=M.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const t=this._logger.create("init");e=Math.max(Math.floor(e),1);const i=M.getEpochTime()+e;if(this.expiration===i&&this._timerHandle)return void t.debug("skipping since already initialized for expiration at",this.expiration);this.cancel(),t.debug("using duration",e),this._expiration=i;const n=Math.min(e,5);this._timerHandle=setInterval(this._callback,1e3*n)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},C=class{static readParams(e,t="query"){if(!e)throw new TypeError("Invalid URL");const i=new URL(e,"http://127.0.0.1")["fragment"===t?"hash":"search"];return new URLSearchParams(i.slice(1))}},O=class extends Error{constructor(e,t){var i,n,r;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw E.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=null!=(i=e.error_description)?i:null,this.error_uri=null!=(n=e.error_uri)?n:null,this.state=e.userState,this.session_state=null!=(r=e.session_state)?r:null}},A=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},P=class{constructor(e){this._logger=new E("AccessTokenEvents"),this._expiringTimer=new M("Access token expiring"),this._expiredTimer=new M("Access token expired"),this._expiringNotificationTimeInSeconds=e.expiringNotificationTimeInSeconds}load(e){const t=this._logger.create("load");if(e.access_token&&void 0!==e.expires_in){const i=e.expires_in;if(t.debug("access token present, remaining duration:",i),i>0){let e=i-this._expiringNotificationTimeInSeconds;e<=0&&(e=1),t.debug("registering expiring timer, raising in",e,"seconds"),this._expiringTimer.init(e)}else t.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const n=i+1;t.debug("registering expired timer, raising in",n,"seconds"),this._expiredTimer.init(n)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(e){return this._expiringTimer.addHandler(e)}removeAccessTokenExpiring(e){this._expiringTimer.removeHandler(e)}addAccessTokenExpired(e){return this._expiredTimer.addHandler(e)}removeAccessTokenExpired(e){this._expiredTimer.removeHandler(e)}},D=class{constructor(e,t,i,n,r){this._callback=e,this._client_id=t,this._intervalInSeconds=n,this._stopOnError=r,this._logger=new E("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=e=>{e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&("error"===e.data?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===e.data?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(e.data+" message from check session op iframe"))};const o=new URL(i);this._frame_origin=o.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=o.href}load(){return new Promise((e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)}))}start(e){if(this._session_state===e)return;this._logger.create("start"),this.stop(),this._session_state=e;const t=()=>{this._frame.contentWindow&&this._session_state&&this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,1e3*this._intervalInSeconds)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}},x=class{constructor(){this._logger=new E("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(e){return this._logger.create(`getItem('${e}')`),this._data[e]}setItem(e,t){this._logger.create(`setItem('${e}')`),this._data[e]=t}removeItem(e){this._logger.create(`removeItem('${e}')`),delete this._data[e]}get length(){return Object.getOwnPropertyNames(this._data).length}key(e){return Object.getOwnPropertyNames(this._data)[e]}},L=class{constructor(e=[],t=null,i={}){this._jwtHandler=t,this._extraHeaders=i,this._logger=new E("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){const{timeoutInSeconds:i,...n}=t;if(!i)return await fetch(e,n);const r=new AbortController,o=setTimeout((()=>r.abort()),1e3*i);try{return await fetch(e,{...t,signal:r.signal})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)throw new A("Network timed out");throw e}finally{clearTimeout(o)}}async getJson(e,{token:t,credentials:i}={}){const n=this._logger.create("getJson"),r={Accept:this._contentTypes.join(", ")};let o;t&&(n.debug("token passed, setting Authorization header"),r.Authorization="Bearer "+t),this.appendExtraHeaders(r);try{n.debug("url:",e),o=await this.fetchWithTimeout(e,{method:"GET",headers:r,credentials:i})}catch(e){throw n.error("Network Error"),e}n.debug("HTTP response received, status",o.status);const s=o.headers.get("Content-Type");if(s&&!this._contentTypes.find((e=>s.startsWith(e)))&&n.throw(new Error(`Invalid response Content-Type: ${null!=s?s:"undefined"}, from URL: ${e}`)),o.ok&&this._jwtHandler&&(null==s?void 0:s.startsWith("application/jwt")))return await this._jwtHandler(await o.text());let a;try{a=await o.json()}catch(e){if(n.error("Error parsing JSON response",e),o.ok)throw e;throw new Error(`${o.statusText} (${o.status})`)}if(!o.ok){if(n.error("Error from server:",a),a.error)throw new O(a);throw new Error(`${o.statusText} (${o.status}): ${JSON.stringify(a)}`)}return a}async postForm(e,{body:t,basicAuth:i,timeoutInSeconds:n,initCredentials:r}){const o=this._logger.create("postForm"),s={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};let a;void 0!==i&&(s.Authorization="Basic "+i),this.appendExtraHeaders(s);try{o.debug("url:",e),a=await this.fetchWithTimeout(e,{method:"POST",headers:s,body:t,timeoutInSeconds:n,credentials:r})}catch(e){throw o.error("Network error"),e}o.debug("HTTP response received, status",a.status);const c=a.headers.get("Content-Type");if(c&&!this._contentTypes.find((e=>c.startsWith(e))))throw new Error(`Invalid response Content-Type: ${null!=c?c:"undefined"}, from URL: ${e}`);const d=await a.text();let l={};if(d)try{l=JSON.parse(d)}catch(e){if(o.error("Error parsing JSON response",e),a.ok)throw e;throw new Error(`${a.statusText} (${a.status})`)}if(!a.ok){if(o.error("Error from server:",l),l.error)throw new O(l,t);throw new Error(`${a.statusText} (${a.status}): ${JSON.stringify(l)}`)}return l}appendExtraHeaders(e){const t=this._logger.create("appendExtraHeaders"),i=Object.keys(this._extraHeaders),n=["authorization","accept","content-type"];0!==i.length&&i.forEach((i=>{if(n.includes(i.toLocaleLowerCase()))return void t.warn("Protected header could not be overridden",i,n);const r="function"==typeof this._extraHeaders[i]?this._extraHeaders[i]():this._extraHeaders[i];r&&""!==r&&(e[i]=r)}))}},U=class{constructor(e){this._settings=e,this._logger=new E("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new L(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const e=this._logger.create("getMetadata");if(this._metadata)return e.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw e.throw(new Error("No authority or metadataUrl configured on settings")),null;e.debug("getting metadata from",this._metadataUrl);const t=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return e.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,t),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(e=!0){return this._getMetadataProperty("token_endpoint",e)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(e=!0){return this._getMetadataProperty("revocation_endpoint",e)}getKeysEndpoint(e=!0){return this._getMetadataProperty("jwks_uri",e)}async _getMetadataProperty(e,t=!1){const i=this._logger.create(`_getMetadataProperty('${e}')`),n=await this.getMetadata();if(i.debug("resolved"),void 0===n[e]){if(!0===t)return void i.warn("Metadata does not contain optional property");i.throw(new Error("Metadata does not contain property "+e))}return n[e]}async getSigningKeys(){const e=this._logger.create("getSigningKeys");if(this._signingKeys)return e.debug("returning signingKeys from cache"),this._signingKeys;const t=await this.getKeysEndpoint(!1);e.debug("got jwks_uri",t);const i=await this._jsonService.getJson(t);if(e.debug("got key set",i),!Array.isArray(i.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=i.keys,this._signingKeys}},N=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new E("WebStorageStateStore"),this._store=t,this._prefix=e}async set(e,t){this._logger.create(`set('${e}')`),e=this._prefix+e,await this._store.setItem(e,t)}async get(e){this._logger.create(`get('${e}')`),e=this._prefix+e;return await this._store.getItem(e)}async remove(e){this._logger.create(`remove('${e}')`),e=this._prefix+e;const t=await this._store.getItem(e);return await this._store.removeItem(e),t}async getAllKeys(){this._logger.create("getAllKeys");const e=await this._store.length,t=[];for(let i=0;i<e;i++){const e=await this._store.key(i);e&&0===e.indexOf(this._prefix)&&t.push(e.substr(this._prefix.length))}return t}},B=class{constructor({authority:e,metadataUrl:t,metadata:i,signingKeys:n,metadataSeed:r,client_id:o,client_secret:s,response_type:a="code",scope:c="openid",redirect_uri:d,post_logout_redirect_uri:l,client_authentication:u="client_secret_post",prompt:h,display:f,max_age:p,ui_locales:g,acr_values:v,resource:m,response_mode:y="query",filterProtocolClaims:b=!0,loadUserInfo:_=!1,staleStateAgeInSeconds:S=900,clockSkewInSeconds:E=300,userInfoJwtIssuer:w="OP",mergeClaims:T=!1,disablePKCE:I=!1,stateStore:R,refreshTokenCredentials:k,revokeTokenAdditionalContentTypes:M,fetchRequestCredentials:C,refreshTokenAllowedScope:O,extraQueryParams:A={},extraTokenParams:P={},extraHeaders:D={}}){if(this.authority=e,t?this.metadataUrl=t:(this.metadataUrl=e,e&&(this.metadataUrl.endsWith("/")||(this.metadataUrl+="/"),this.metadataUrl+=".well-known/openid-configuration")),this.metadata=i,this.metadataSeed=r,this.signingKeys=n,this.client_id=o,this.client_secret=s,this.response_type=a,this.scope=c,this.redirect_uri=d,this.post_logout_redirect_uri=l,this.client_authentication=u,this.prompt=h,this.display=f,this.max_age=p,this.ui_locales=g,this.acr_values=v,this.resource=m,this.response_mode=y,this.filterProtocolClaims=null==b||b,this.loadUserInfo=!!_,this.staleStateAgeInSeconds=S,this.clockSkewInSeconds=E,this.userInfoJwtIssuer=w,this.mergeClaims=!!T,this.disablePKCE=!!I,this.revokeTokenAdditionalContentTypes=M,C&&k&&console.warn("Both fetchRequestCredentials and refreshTokenCredentials is set. Only fetchRequestCredentials will be used."),this.fetchRequestCredentials=C||(k||"same-origin"),R)this.stateStore=R;else{const e="undefined"!=typeof window?window.localStorage:new x;this.stateStore=new N({store:e})}this.refreshTokenAllowedScope=O,this.extraQueryParams=A,this.extraTokenParams=P,this.extraHeaders=D}},j=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new E("UserInfoService"),this._getClaimsFromJwt=async e=>{const t=this._logger.create("_getClaimsFromJwt");try{const i=R.decode(e);return t.debug("JWT decoding successful"),i}catch(e){throw t.error("Error parsing JWT response"),e}},this._jsonService=new L(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(e){const t=this._logger.create("getClaims");e||this._logger.throw(new Error("No token passed"));const i=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",i);const n=await this._jsonService.getJson(i,{token:e,credentials:this._settings.fetchRequestCredentials});return t.debug("got claims",n),n}},F=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new E("TokenClient"),this._jsonService=new L(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:i=this._settings.client_id,client_secret:n=this._settings.client_secret,...r}){const o=this._logger.create("exchangeCode");i||o.throw(new Error("A client_id is required")),t||o.throw(new Error("A redirect_uri is required")),r.code||o.throw(new Error("A code is required"));const s=new URLSearchParams({grant_type:e,redirect_uri:t});for(const[e,t]of Object.entries(r))null!=t&&s.set(e,t);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw o.throw(new Error("A client_secret is required")),null;a=w.generateBasicAuth(i,n);break;case"client_secret_post":s.append("client_id",i),n&&s.append("client_secret",n)}const c=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const d=await this._jsonService.postForm(c,{body:s,basicAuth:a,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),d}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:i=this._settings.client_secret,scope:n=this._settings.scope,...r}){const o=this._logger.create("exchangeCredentials");t||o.throw(new Error("A client_id is required"));const s=new URLSearchParams({grant_type:e,scope:n});for(const[e,t]of Object.entries(r))null!=t&&s.set(e,t);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!i)throw o.throw(new Error("A client_secret is required")),null;a=w.generateBasicAuth(t,i);break;case"client_secret_post":s.append("client_id",t),i&&s.append("client_secret",i)}const c=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const d=await this._jsonService.postForm(c,{body:s,basicAuth:a,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),d}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:i=this._settings.client_secret,timeoutInSeconds:n,...r}){const o=this._logger.create("exchangeRefreshToken");t||o.throw(new Error("A client_id is required")),r.refresh_token||o.throw(new Error("A refresh_token is required"));const s=new URLSearchParams({grant_type:e});for(const[e,t]of Object.entries(r))Array.isArray(t)?t.forEach((t=>s.append(e,t))):null!=t&&s.set(e,t);let a;switch(this._settings.client_authentication){case"client_secret_basic":if(!i)throw o.throw(new Error("A client_secret is required")),null;a=w.generateBasicAuth(t,i);break;case"client_secret_post":s.append("client_id",t),i&&s.append("client_secret",i)}const c=await this._metadataService.getTokenEndpoint(!1);o.debug("got token endpoint");const d=await this._jsonService.postForm(c,{body:s,basicAuth:a,timeoutInSeconds:n,initCredentials:this._settings.fetchRequestCredentials});return o.debug("got response"),d}async revoke(e){var t;const i=this._logger.create("revoke");e.token||i.throw(new Error("A token is required"));const n=await this._metadataService.getRevocationEndpoint(!1);i.debug(`got revocation endpoint, revoking ${null!=(t=e.token_type_hint)?t:"default token type"}`);const r=new URLSearchParams;for(const[t,i]of Object.entries(e))null!=i&&r.set(t,i);r.set("client_id",this._settings.client_id),this._settings.client_secret&&r.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(n,{body:r}),i.debug("got response")}},K=class{constructor(e,t,i){this._settings=e,this._metadataService=t,this._claimsService=i,this._logger=new E("ResponseValidator"),this._userInfoService=new j(this._settings,this._metadataService),this._tokenClient=new F(this._settings,this._metadataService)}async validateSigninResponse(e,t){const i=this._logger.create("validateSigninResponse");this._processSigninState(e,t),i.debug("state processed"),await this._processCode(e,t),i.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e),i.debug("tokens validated"),await this._processClaims(e,null==t?void 0:t.skipUserInfo,e.isOpenId),i.debug("claims processed")}async validateCredentialsResponse(e,t){const i=this._logger.create("validateCredentialsResponse");e.isOpenId&&this._validateIdTokenAttributes(e),i.debug("tokens validated"),await this._processClaims(e,t,e.isOpenId),i.debug("claims processed")}async validateRefreshResponse(e,t){const i=this._logger.create("validateRefreshResponse");e.userState=t.data,null!=e.session_state||(e.session_state=t.session_state),null!=e.scope||(e.scope=t.scope),e.isOpenId&&e.id_token&&(this._validateIdTokenAttributes(e,t.id_token),i.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const n=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,n),i.debug("claims processed")}validateSignoutResponse(e,t){const i=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&i.throw(new Error("State does not match")),i.debug("state validated"),e.userState=t.data,e.error)throw i.warn("Response was error",e.error),new O(e)}_processSigninState(e,t){const i=this._logger.create("_processSigninState");if(t.id!==e.state&&i.throw(new Error("State does not match")),t.client_id||i.throw(new Error("No client_id on state")),t.authority||i.throw(new Error("No authority on state")),this._settings.authority!==t.authority&&i.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&i.throw(new Error("client_id mismatch on settings vs. signin state")),i.debug("state validated"),e.userState=t.data,null!=e.scope||(e.scope=t.scope),e.error)throw i.warn("Response was error",e.error),new O(e);t.code_verifier&&!e.code&&i.throw(new Error("Expected code in response"))}async _processClaims(e,t=!1,i=!0){const n=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token)return void n.debug("not loading user info");n.debug("loading user info");const r=await this._userInfoService.getClaims(e.access_token);n.debug("user info claims received from user info endpoint"),i&&r.sub!==e.profile.sub&&n.throw(new Error("subject from UserInfo response does not match subject in ID Token")),e.profile=this._claimsService.mergeClaims(e.profile,this._claimsService.filterProtocolClaims(r)),n.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,t){const i=this._logger.create("_processCode");if(e.code){i.debug("Validating code");const n=await this._tokenClient.exchangeCode({client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier,...t.extraTokenParams});Object.assign(e,n)}else i.debug("No code to process")}_validateIdTokenAttributes(e,t){var i;const n=this._logger.create("_validateIdTokenAttributes");n.debug("decoding ID Token JWT");const r=R.decode(null!=(i=e.id_token)?i:"");if(r.sub||n.throw(new Error("ID Token is missing a subject claim")),t){const e=R.decode(t);r.sub!==e.sub&&n.throw(new Error("sub in id_token does not match current sub")),r.auth_time&&r.auth_time!==e.auth_time&&n.throw(new Error("auth_time in id_token does not match original auth_time")),r.azp&&r.azp!==e.azp&&n.throw(new Error("azp in id_token does not match original azp")),!r.azp&&e.azp&&n.throw(new Error("azp not in id_token, but present in original id_token"))}e.profile=r}},q=class{constructor(e){this.id=e.id||w.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=M.getEpochTime(),this.request_type=e.request_type}toStorageString(){return new E("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})}static fromStorageString(e){return E.createStatic("State","fromStorageString"),new q(JSON.parse(e))}static async clearStaleState(e,t){const i=E.createStatic("State","clearStaleState"),n=M.getEpochTime()-t,r=await e.getAllKeys();i.debug("got keys",r);for(let t=0;t<r.length;t++){const o=r[t],s=await e.get(o);let a=!1;if(s)try{const e=q.fromStorageString(s);i.debug("got item from key:",o,e.created),e.created<=n&&(a=!0)}catch(e){i.error("Error parsing state for key:",o,e),a=!0}else i.debug("no item in storage for key:",o),a=!0;a&&(i.debug("removed item for key:",o),e.remove(o))}}},$=class extends q{constructor(e){super(e),!0===e.code_verifier?this.code_verifier=w.generateCodeVerifier():e.code_verifier&&(this.code_verifier=e.code_verifier),this.code_verifier&&(this.code_challenge=w.generateCodeChallenge(this.code_verifier)),this.authority=e.authority,this.client_id=e.client_id,this.redirect_uri=e.redirect_uri,this.scope=e.scope,this.client_secret=e.client_secret,this.extraTokenParams=e.extraTokenParams,this.response_mode=e.response_mode,this.skipUserInfo=e.skipUserInfo}toStorageString(){return new E("SigninState").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,code_verifier:this.code_verifier,authority:this.authority,client_id:this.client_id,redirect_uri:this.redirect_uri,scope:this.scope,client_secret:this.client_secret,extraTokenParams:this.extraTokenParams,response_mode:this.response_mode,skipUserInfo:this.skipUserInfo})}static fromStorageString(e){E.createStatic("SigninState","fromStorageString");const t=JSON.parse(e);return new $(t)}},V=class{constructor({url:e,authority:t,client_id:i,redirect_uri:n,response_type:r,scope:o,state_data:s,response_mode:a,request_type:c,client_secret:d,nonce:l,resource:u,skipUserInfo:h,extraQueryParams:f,extraTokenParams:p,disablePKCE:g,...v}){if(this._logger=new E("SigninRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");if(!i)throw this._logger.error("ctor: No client_id passed"),new Error("client_id");if(!n)throw this._logger.error("ctor: No redirect_uri passed"),new Error("redirect_uri");if(!r)throw this._logger.error("ctor: No response_type passed"),new Error("response_type");if(!o)throw this._logger.error("ctor: No scope passed"),new Error("scope");if(!t)throw this._logger.error("ctor: No authority passed"),new Error("authority");this.state=new $({data:s,request_type:c,code_verifier:!g,client_id:i,authority:t,redirect_uri:n,response_mode:a,client_secret:d,scope:o,extraTokenParams:p,skipUserInfo:h});const m=new URL(e);if(m.searchParams.append("client_id",i),m.searchParams.append("redirect_uri",n),m.searchParams.append("response_type",r),m.searchParams.append("scope",o),l&&m.searchParams.append("nonce",l),m.searchParams.append("state",this.state.id),this.state.code_challenge&&(m.searchParams.append("code_challenge",this.state.code_challenge),m.searchParams.append("code_challenge_method","S256")),u){(Array.isArray(u)?u:[u]).forEach((e=>m.searchParams.append("resource",e)))}for(const[e,t]of Object.entries({response_mode:a,...v,...f}))null!=t&&m.searchParams.append(e,t.toString());this.url=m.href}},H=class{constructor(e){this.access_token="",this.token_type="",this.profile={},this.state=e.get("state"),this.session_state=e.get("session_state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri"),this.code=e.get("code")}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-M.getEpochTime()}set expires_in(e){"string"==typeof e&&(e=Number(e)),void 0!==e&&e>=0&&(this.expires_at=Math.floor(e)+M.getEpochTime())}get isOpenId(){var e;return(null==(e=this.scope)?void 0:e.split(" ").includes("openid"))||!!this.id_token}},W=class{constructor({url:e,state_data:t,id_token_hint:i,post_logout_redirect_uri:n,extraQueryParams:r,request_type:o,client_id:s}){if(this._logger=new E("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const a=new URL(e);i&&a.searchParams.append("id_token_hint",i),s&&a.searchParams.append("client_id",s),n&&(a.searchParams.append("post_logout_redirect_uri",n),t&&(this.state=new q({data:t,request_type:o}),a.searchParams.append("state",this.state.id)));for(const[e,t]of Object.entries({...r}))null!=t&&a.searchParams.append(e,t.toString());this.url=a.href}},G=class{constructor(e){this.state=e.get("state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri")}},z=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],Y=["sub","iss","aud","exp","iat"],J=class{constructor(e){this._settings=e,this._logger=new E("ClaimsService")}filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let e;e=Array.isArray(this._settings.filterProtocolClaims)?this._settings.filterProtocolClaims:z;for(const i of e)Y.includes(i)||delete t[i]}return t}mergeClaims(e,t){const i={...e};for(const[e,n]of Object.entries(t))for(const t of Array.isArray(n)?n:[n]){const n=i[e];n?Array.isArray(n)?n.includes(t)||n.push(t):i[e]!==t&&("object"==typeof t&&this._settings.mergeClaims?i[e]=this.mergeClaims(n,t):i[e]=[n,t]):i[e]=t}return i}},Q=class{constructor(e,t){this._logger=new E("OidcClient"),this.settings=e instanceof B?e:new B(e),this.metadataService=null!=t?t:new U(this.settings),this._claimsService=new J(this.settings),this._validator=new K(this.settings,this.metadataService,this._claimsService),this._tokenClient=new F(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:i,request_type:n,id_token_hint:r,login_hint:o,skipUserInfo:s,nonce:a,response_type:c=this.settings.response_type,scope:d=this.settings.scope,redirect_uri:l=this.settings.redirect_uri,prompt:u=this.settings.prompt,display:h=this.settings.display,max_age:f=this.settings.max_age,ui_locales:p=this.settings.ui_locales,acr_values:g=this.settings.acr_values,resource:v=this.settings.resource,response_mode:m=this.settings.response_mode,extraQueryParams:y=this.settings.extraQueryParams,extraTokenParams:b=this.settings.extraTokenParams}){const _=this._logger.create("createSigninRequest");if("code"!==c)throw new Error("Only the Authorization Code flow (with PKCE) is supported");const S=await this.metadataService.getAuthorizationEndpoint();_.debug("Received authorization endpoint",S);const E=new V({url:S,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:l,response_type:c,scope:d,state_data:e,prompt:u,display:h,max_age:f,ui_locales:p,id_token_hint:r,login_hint:o,acr_values:g,resource:v,request:t,request_uri:i,extraQueryParams:y,extraTokenParams:b,request_type:n,response_mode:m,client_secret:this.settings.client_secret,skipUserInfo:s,nonce:a,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const w=E.state;return await this.settings.stateStore.set(w.id,w.toStorageString()),E}async readSigninResponseState(e,t=!1){const i=this._logger.create("readSigninResponseState"),n=new H(C.readParams(e,this.settings.response_mode));if(!n.state)throw i.throw(new Error("No state in response")),null;const r=await this.settings.stateStore[t?"remove":"get"](n.state);if(!r)throw i.throw(new Error("No matching state found in storage")),null;return{state:$.fromStorageString(r),response:n}}async processSigninResponse(e){const t=this._logger.create("processSigninResponse"),{state:i,response:n}=await this.readSigninResponseState(e,!0);return t.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(n,i),n}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:i=!1,extraTokenParams:n={}}){const r=await this._tokenClient.exchangeCredentials({username:e,password:t,...n}),o=new H(new URLSearchParams);return Object.assign(o,r),await this._validator.validateCredentialsResponse(o,i),o}async useRefreshToken({state:e,timeoutInSeconds:t}){var i;const n=this._logger.create("useRefreshToken");let r;if(void 0===this.settings.refreshTokenAllowedScope)r=e.scope;else{const t=this.settings.refreshTokenAllowedScope.split(" ");r=((null==(i=e.scope)?void 0:i.split(" "))||[]).filter((e=>t.includes(e))).join(" ")}const o=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,resource:e.resource,scope:r,timeoutInSeconds:t}),s=new H(new URLSearchParams);return Object.assign(s,o),n.debug("validating response",s),await this._validator.validateRefreshResponse(s,{...e,scope:r}),s}async createSignoutRequest({state:e,id_token_hint:t,client_id:i,request_type:n,post_logout_redirect_uri:r=this.settings.post_logout_redirect_uri,extraQueryParams:o=this.settings.extraQueryParams}={}){const s=this._logger.create("createSignoutRequest"),a=await this.metadataService.getEndSessionEndpoint();if(!a)throw s.throw(new Error("No end session endpoint")),null;s.debug("Received end session endpoint",a),i||!r||t||(i=this.settings.client_id);const c=new W({url:a,id_token_hint:t,client_id:i,post_logout_redirect_uri:r,state_data:e,extraQueryParams:o,request_type:n});await this.clearStaleState();const d=c.state;return d&&(s.debug("Signout request has state to persist"),await this.settings.stateStore.set(d.id,d.toStorageString())),c}async readSignoutResponseState(e,t=!1){const i=this._logger.create("readSignoutResponseState"),n=new G(C.readParams(e,this.settings.response_mode));if(!n.state){if(i.debug("No state in response"),n.error)throw i.warn("Response was error:",n.error),new O(n);return{state:void 0,response:n}}const r=await this.settings.stateStore[t?"remove":"get"](n.state);if(!r)throw i.throw(new Error("No matching state found in storage")),null;return{state:q.fromStorageString(r),response:n}}async processSignoutResponse(e){const t=this._logger.create("processSignoutResponse"),{state:i,response:n}=await this.readSignoutResponseState(e,!0);return i?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(n,i)):t.debug("No state from storage; skipping response validation"),n}clearStaleState(){return this._logger.create("clearStaleState"),q.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(e,t){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:e,token_type_hint:t})}},X=class{constructor(e){this._userManager=e,this._logger=new E("SessionMonitor"),this._start=async e=>{const t=e.session_state;if(!t)return;const i=this._logger.create("_start");if(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,i.debug("session_state",t,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,i.debug("session_state",t,", anonymous user")),this._checkSessionIFrame)this._checkSessionIFrame.start(t);else try{const e=await this._userManager.metadataService.getCheckSessionIframe();if(e){i.debug("initializing check session iframe");const n=this._userManager.settings.client_id,r=this._userManager.settings.checkSessionIntervalInSeconds,o=this._userManager.settings.stopCheckSessionOnError,s=new D(this._callback,n,e,r,o);await s.load(),this._checkSessionIFrame=s,s.start(t)}else i.warn("no check session iframe found in the metadata")}catch(e){i.error("Error from getCheckSessionIframe:",e instanceof Error?e.message:e)}},this._stop=()=>{const e=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const t=setInterval((async()=>{clearInterval(t);try{const e=await this._userManager.querySessionStatus();if(e){const t={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(t)}}catch(t){e.error("error from querySessionStatus",t instanceof Error?t.message:t)}}),1e3)}},this._callback=async()=>{const e=this._logger.create("_callback");try{const t=await this._userManager.querySessionStatus();let i=!0;t&&this._checkSessionIFrame?t.sub===this._sub?(i=!1,this._checkSessionIFrame.start(t.session_state),t.sid===this._sid?e.debug("same sub still logged in at OP, restarting check session iframe; session_state",t.session_state):(e.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",t.session_state),this._userManager.events._raiseUserSessionChanged())):e.debug("different subject signed into OP",t.sub):e.debug("subject no longer signed into OP"),i?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():e.debug("no change in session detected, no event to raise")}catch(t){this._sub&&(e.debug("Error calling queryCurrentSigninSession; raising signed out event",t),this._userManager.events._raiseUserSignedOut())}},e||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch((e=>{this._logger.error(e)}))}async _init(){this._logger.create("_init");const e=await this._userManager.getUser();if(e)this._start(e);else if(this._userManager.settings.monitorAnonymousSession){const e=await this._userManager.querySessionStatus();if(e){const t={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(t)}}}},Z=class{constructor(e){var t;this.id_token=e.id_token,this.session_state=null!=(t=e.session_state)?t:null,this.access_token=e.access_token,this.refresh_token=e.refresh_token,this.token_type=e.token_type,this.scope=e.scope,this.profile=e.profile,this.expires_at=e.expires_at,this.state=e.userState}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-M.getEpochTime()}set expires_in(e){void 0!==e&&(this.expires_at=Math.floor(e)+M.getEpochTime())}get expired(){const e=this.expires_in;if(void 0!==e)return e<=0}get scopes(){var e,t;return null!=(t=null==(e=this.scope)?void 0:e.split(" "))?t:[]}toStorageString(){return new E("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(e){return E.createStatic("User","fromStorageString"),new Z(JSON.parse(e))}},ee="oidc-client",te=class{constructor(){this._abort=new T("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(e){const t=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");t.debug("setting URL in window"),this._window.location.replace(e.url);const{url:i,keepOpen:n}=await new Promise(((i,n)=>{const r=r=>{var o;const s=r.data,a=null!=(o=e.scriptOrigin)?o:window.location.origin;if(r.origin===a&&(null==s?void 0:s.source)===ee){try{const i=C.readParams(s.url,e.response_mode).get("state");if(i||t.warn("no state found in response url"),r.source!==this._window&&i!==e.state)return}catch(e){this._dispose(),n(new Error("Invalid response from window"))}i(s)}};window.addEventListener("message",r,!1),this._disposeHandlers.add((()=>window.removeEventListener("message",r,!1))),this._disposeHandlers.add(this._abort.addHandler((e=>{this._dispose(),n(e)})))}));return t.debug("got response from window"),this._dispose(),n||this.close(),{url:i}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,t,i=!1,n=window.location.origin){e.postMessage({source:ee,url:t,keepOpen:i},n)}},ie={location:!1,toolbar:!1,height:640},ne="_blank",re=60,oe=2,se=10,ae=class extends B{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:i=e.post_logout_redirect_uri,popupWindowFeatures:n=ie,popupWindowTarget:r=ne,redirectMethod:o="assign",redirectTarget:s="self",iframeNotifyParentOrigin:a=e.iframeNotifyParentOrigin,iframeScriptOrigin:c=e.iframeScriptOrigin,silent_redirect_uri:d=e.redirect_uri,silentRequestTimeoutInSeconds:l=se,automaticSilentRenew:u=!0,validateSubOnSilentRenew:h=!0,includeIdTokenInSilentRenew:f=!1,monitorSession:p=!1,monitorAnonymousSession:g=!1,checkSessionIntervalInSeconds:v=oe,query_status_response_type:m="code",stopCheckSessionOnError:y=!0,revokeTokenTypes:b=["access_token","refresh_token"],revokeTokensOnSignout:_=!1,includeIdTokenInSilentSignout:S=!1,accessTokenExpiringNotificationTimeInSeconds:E=re,userStore:w}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=i,this.popupWindowFeatures=n,this.popupWindowTarget=r,this.redirectMethod=o,this.redirectTarget=s,this.iframeNotifyParentOrigin=a,this.iframeScriptOrigin=c,this.silent_redirect_uri=d,this.silentRequestTimeoutInSeconds=l,this.automaticSilentRenew=u,this.validateSubOnSilentRenew=h,this.includeIdTokenInSilentRenew=f,this.monitorSession=p,this.monitorAnonymousSession=g,this.checkSessionIntervalInSeconds=v,this.stopCheckSessionOnError=y,this.query_status_response_type=m,this.revokeTokenTypes=b,this.revokeTokensOnSignout=_,this.includeIdTokenInSilentSignout=S,this.accessTokenExpiringNotificationTimeInSeconds=E,w)this.userStore=w;else{const e="undefined"!=typeof window?window.sessionStorage:new x;this.userStore=new N({store:e})}}},ce=class extends te{constructor({silentRequestTimeoutInSeconds:e=se}){super(),this._logger=new E("IFrameWindow"),this._timeoutInSeconds=e,this._frame=ce.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const e=window.document.createElement("iframe");return e.style.visibility="hidden",e.style.position="fixed",e.style.left="-1000px",e.style.top="0",e.width="0",e.height="0",window.document.body.appendChild(e),e}async navigate(e){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const t=setTimeout((()=>this._abort.raise(new A("IFrame timed out without a response"))),1e3*this._timeoutInSeconds);return this._disposeHandlers.add((()=>clearTimeout(t))),await super.navigate(e)}close(){var e;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",(e=>{var t;const i=e.target;null==(t=i.parentNode)||t.removeChild(i),this._abort.raise(new Error("IFrame removed from DOM"))}),!0),null==(e=this._frame.contentWindow)||e.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(e,t){return super._notifyParent(window.parent,e,!1,t)}},de=class{constructor(e){this._settings=e,this._logger=new E("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new ce({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),ce.notifyParent(e,this._settings.iframeNotifyParentOrigin)}},le=class extends te{constructor({popupWindowTarget:e=ne,popupWindowFeatures:t={}}){super(),this._logger=new E("PopupWindow");const i=k.center({...ie,...t});this._window=window.open(void 0,e,k.serialize(i))}async navigate(e){var t;null==(t=this._window)||t.focus();const i=setInterval((()=>{this._window&&!this._window.closed||this._abort.raise(new Error("Popup closed by user"))}),500);return this._disposeHandlers.add((()=>clearInterval(i))),await super.navigate(e)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(e,t){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,e,t)}},ue=class{constructor(e){this._settings=e,this._logger=new E("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget}){return new le({popupWindowFeatures:e,popupWindowTarget:t})}async callback(e,t=!1){this._logger.create("callback"),le.notifyOpener(e,t)}},he=class{constructor(e){this._settings=e,this._logger=new E("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var i;this._logger.create("prepare");let n=window.self;"top"===t&&(n=null!=(i=window.top)?i:window.self);const r=n.location[e].bind(n.location);let o;return{navigate:async e=>{this._logger.create("navigate");const t=new Promise(((e,t)=>{o=t}));return r(e.url),await t},close:()=>{this._logger.create("close"),null==o||o(new Error("Redirect aborted")),n.stop()}}}},fe=class extends P{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new E("UserManagerEvents"),this._userLoaded=new T("User loaded"),this._userUnloaded=new T("User unloaded"),this._silentRenewError=new T("Silent renew error"),this._userSignedIn=new T("User signed in"),this._userSignedOut=new T("User signed out"),this._userSessionChanged=new T("User session changed")}load(e,t=!0){super.load(e),t&&this._userLoaded.raise(e)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(e){return this._userLoaded.addHandler(e)}removeUserLoaded(e){return this._userLoaded.removeHandler(e)}addUserUnloaded(e){return this._userUnloaded.addHandler(e)}removeUserUnloaded(e){return this._userUnloaded.removeHandler(e)}addSilentRenewError(e){return this._silentRenewError.addHandler(e)}removeSilentRenewError(e){return this._silentRenewError.removeHandler(e)}_raiseSilentRenewError(e){this._silentRenewError.raise(e)}addUserSignedIn(e){return this._userSignedIn.addHandler(e)}removeUserSignedIn(e){this._userSignedIn.removeHandler(e)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(e){return this._userSignedOut.addHandler(e)}removeUserSignedOut(e){this._userSignedOut.removeHandler(e)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(e){return this._userSessionChanged.addHandler(e)}removeUserSessionChanged(e){this._userSessionChanged.removeHandler(e)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},pe=class{constructor(e){this._userManager=e,this._logger=new E("SilentRenewService"),this._isStarted=!1,this._retryTimer=new M("Retry Silent Renew"),this._tokenExpiring=async()=>{const e=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),e.debug("silent token renewal successful")}catch(t){if(t instanceof A)return e.warn("ErrorTimeout from signinSilent:",t,"retry in 5s"),void this._retryTimer.init(5);e.error("Error from signinSilent:",t),this._userManager.events._raiseSilentRenewError(t)}}}async start(){const e=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(t){e.error("getUser error",t)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}},ge=class{constructor(e,t){this.refresh_token=e.refresh_token,this.id_token=e.id_token,this.session_state=e.session_state,this.scope=e.scope,this.profile=e.profile,this.resource=t,this.data=e.state}},ve=class{constructor(e){this._logger=new E("UserManager"),this.settings=new ae(e),this._client=new Q(e),this._redirectNavigator=new he(this.settings),this._popupNavigator=new ue(this.settings),this._iframeNavigator=new de(this.settings),this._events=new fe(this.settings),this._silentRenewService=new pe(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new X(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const e=this._logger.create("getUser"),t=await this._loadUser();return t?(e.info("user loaded"),this._events.load(t,!1),t):(e.info("user not found in storage"),null)}async removeUser(){const e=this._logger.create("removeUser");await this.storeUser(null),e.info("user removed from storage"),this._events.unload()}async signinRedirect(e={}){this._logger.create("signinRedirect");const{redirectMethod:t,...i}=e,n=await this._redirectNavigator.prepare({redirectMethod:t});await this._signinStart({request_type:"si:r",...i},n)}async signinRedirectCallback(e=window.location.href){const t=this._logger.create("signinRedirectCallback"),i=await this._signinEnd(e);return i.profile&&i.profile.sub?t.info("success, signed in subject",i.profile.sub):t.info("no subject"),i}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:i=!1}){const n=this._logger.create("signinResourceOwnerCredential"),r=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:i,extraTokenParams:this.settings.extraTokenParams});n.debug("got signin response");const o=await this._buildUser(r);return o.profile&&o.profile.sub?n.info("success, signed in subject",o.profile.sub):n.info("no subject"),o}async signinPopup(e={}){const t=this._logger.create("signinPopup"),{popupWindowFeatures:i,popupWindowTarget:n,...r}=e,o=this.settings.popup_redirect_uri;o||t.throw(new Error("No popup_redirect_uri configured"));const s=await this._popupNavigator.prepare({popupWindowFeatures:i,popupWindowTarget:n}),a=await this._signin({request_type:"si:p",redirect_uri:o,display:"popup",...r},s);return a&&(a.profile&&a.profile.sub?t.info("success, signed in subject",a.profile.sub):t.info("no subject")),a}async signinPopupCallback(e=window.location.href,t=!1){const i=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,t),i.info("success")}async signinSilent(e={}){var t;const i=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:n,resource:r,...o}=e;let s=await this._loadUser();if(null==s?void 0:s.refresh_token){i.debug("using refresh token");const e=new ge(s,r);return await this._useRefreshToken(e)}const a=this.settings.silent_redirect_uri;let c;a||i.throw(new Error("No silent_redirect_uri configured")),s&&this.settings.validateSubOnSilentRenew&&(i.debug("subject prior to silent renew:",s.profile.sub),c=s.profile.sub);const d=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n});return s=await this._signin({request_type:"si:s",redirect_uri:a,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==s?void 0:s.id_token:void 0,...o},d,c),s&&((null==(t=s.profile)?void 0:t.sub)?i.info("success, signed in subject",s.profile.sub):i.info("no subject")),s}async _useRefreshToken(e){const t=await this._client.useRefreshToken({state:e,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),i=new Z({...e,...t});return await this.storeUser(i),this._events.load(i),i}async signinSilentCallback(e=window.location.href){const t=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async signinCallback(e=window.location.href){const{state:t}=await this._client.readSigninResponseState(e);switch(t.request_type){case"si:r":return await this.signinRedirectCallback(e);case"si:p":return await this.signinPopupCallback(e);case"si:s":return await this.signinSilentCallback(e);default:throw new Error("invalid response_type in state")}}async signoutCallback(e=window.location.href,t=!1){const{state:i}=await this._client.readSignoutResponseState(e);if(i)switch(i.request_type){case"so:r":await this.signoutRedirectCallback(e);break;case"so:p":await this.signoutPopupCallback(e,t);break;case"so:s":await this.signoutSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(e={}){const t=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:i,...n}=e,r=this.settings.silent_redirect_uri;r||t.throw(new Error("No silent_redirect_uri configured"));const o=await this._loadUser(),s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:i}),a=await this._signinStart({request_type:"si:s",redirect_uri:r,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==o?void 0:o.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...n},s);try{const e=await this._client.processSigninResponse(a.url);return t.debug("got signin response"),e.session_state&&e.profile.sub?(t.info("success for subject",e.profile.sub),{session_state:e.session_state,sub:e.profile.sub,sid:e.profile.sid}):(t.info("success, user not authenticated"),null)}catch(e){if(this.settings.monitorAnonymousSession&&e instanceof O)switch(e.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return t.info("success for anonymous user"),{session_state:e.session_state}}throw e}}async _signin(e,t,i){const n=await this._signinStart(e,t);return await this._signinEnd(n.url,i)}async _signinStart(e,t){const i=this._logger.create("_signinStart");try{const n=await this._client.createSigninRequest(e);return i.debug("got signin request"),await t.navigate({url:n.url,state:n.state.id,response_mode:n.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(e){throw i.debug("error after preparing navigator, closing navigator window"),t.close(),e}}async _signinEnd(e,t){const i=this._logger.create("_signinEnd"),n=await this._client.processSigninResponse(e);i.debug("got signin response");return await this._buildUser(n,t)}async _buildUser(e,t){const i=this._logger.create("_buildUser"),n=new Z(e);if(t){if(t!==n.profile.sub)throw i.debug("current user does not match user returned from signin. sub from signin:",n.profile.sub),new O({...e,error:"login_required"});i.debug("current user matches user returned from signin")}return await this.storeUser(n),i.debug("user stored"),this._events.load(n),n}async signoutRedirect(e={}){const t=this._logger.create("signoutRedirect"),{redirectMethod:i,...n}=e,r=await this._redirectNavigator.prepare({redirectMethod:i});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...n},r),t.info("success")}async signoutRedirectCallback(e=window.location.href){const t=this._logger.create("signoutRedirectCallback"),i=await this._signoutEnd(e);return t.info("success"),i}async signoutPopup(e={}){const t=this._logger.create("signoutPopup"),{popupWindowFeatures:i,popupWindowTarget:n,...r}=e,o=this.settings.popup_post_logout_redirect_uri,s=await this._popupNavigator.prepare({popupWindowFeatures:i,popupWindowTarget:n});await this._signout({request_type:"so:p",post_logout_redirect_uri:o,state:null==o?void 0:{},...r},s),t.info("success")}async signoutPopupCallback(e=window.location.href,t=!1){const i=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,t),i.info("success")}async _signout(e,t){const i=await this._signoutStart(e,t);return await this._signoutEnd(i.url)}async _signoutStart(e={},t){var i;const n=this._logger.create("_signoutStart");try{const r=await this._loadUser();n.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(r);const o=e.id_token_hint||r&&r.id_token;o&&(n.debug("setting id_token_hint in signout request"),e.id_token_hint=o),await this.removeUser(),n.debug("user removed, creating signout request");const s=await this._client.createSignoutRequest(e);return n.debug("got signout request"),await t.navigate({url:s.url,state:null==(i=s.state)?void 0:i.id})}catch(e){throw n.debug("error after preparing navigator, closing navigator window"),t.close(),e}}async _signoutEnd(e){const t=this._logger.create("_signoutEnd"),i=await this._client.processSignoutResponse(e);return t.debug("got signout response"),i}async signoutSilent(e={}){var t;const i=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:n,...r}=e,o=this.settings.includeIdTokenInSilentSignout?null==(t=await this._loadUser())?void 0:t.id_token:void 0,s=this.settings.popup_post_logout_redirect_uri,a=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n});await this._signout({request_type:"so:s",post_logout_redirect_uri:s,id_token_hint:o,...r},a),i.info("success")}async signoutSilentCallback(e=window.location.href){const t=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async revokeTokens(e){const t=await this._loadUser();await this._revokeInternal(t,e)}async _revokeInternal(e,t=this.settings.revokeTokenTypes){const i=this._logger.create("_revokeInternal");if(!e)return;const n=t.filter((t=>"string"==typeof e[t]));if(n.length){for(const t of n)await this._client.revokeToken(e[t],t),i.info(`${t} revoked successfully`),"access_token"!==t&&(e[t]=null);await this.storeUser(e),i.debug("user stored"),this._events.load(e)}else i.debug("no need to revoke due to no token(s)")}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const e=this._logger.create("_loadUser"),t=await this.settings.userStore.get(this._userStoreKey);return t?(e.debug("user storageString loaded"),Z.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){const t=this._logger.create("storeUser");if(e){t.debug("storing user");const i=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,i)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}},me="2.2.5"},{"crypto-js/core.js":79,"crypto-js/enc-base64.js":80,"crypto-js/enc-utf8.js":81,"crypto-js/sha256.js":82,"jwt-decode":156}],235:[function(e,t,i){"use strict";const n=e("retry"),r=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class o extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,({message:e}=e)):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}}const s=(e,t)=>new Promise(((i,s)=>{t={onFailedAttempt:()=>{},retries:10,...t};const a=n.operation(t);a.attempt((async n=>{try{i(await e(n))}catch(e){if(!(e instanceof Error))return void s(new TypeError(`Non-error was thrown: "${e}". You should only throw errors.`));if(e instanceof o)a.stop(),s(e.originalError);else if(e instanceof TypeError&&(c=e.message,!r.includes(c)))a.stop(),s(e);else{((e,t,i)=>{const n=i.retries-(t-1);e.attemptNumber=t,e.retriesLeft=n})(e,n,t);try{await t.onFailedAttempt(e)}catch(e){return void s(e)}a.retry(e)||s(a.mainError())}}var c}))}));t.exports=s,t.exports.default=s,t.exports.AbortError=o},{retry:256}],236:[function(e,t,i){t.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}},{}],237:[function(e,t,i){"use strict";var n=e("asn1.js");i.certificate=e("./certificate");var r=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));i.RSAPrivateKey=r;var o=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));i.RSAPublicKey=o;var s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}));i.PublicKey=s;var a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),c=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(a),this.key("subjectPrivateKey").octstr())}));i.PrivateKey=c;var d=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));i.EncryptedPrivateKey=d;var l=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));i.DSAPrivateKey=l,i.DSAparam=n.define("DSAparam",(function(){this.int()}));var u=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())}));i.ECPrivateKey=u;var h=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));i.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},{"./certificate":238,"asn1.js":2}],238:[function(e,t,i){"use strict";var n=e("asn1.js"),r=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),s=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())})),c=n.define("RelativeDistinguishedName",(function(){this.setof(o)})),d=n.define("RDNSequence",(function(){this.seqof(c)})),l=n.define("Name",(function(){this.choice({rdnSequence:this.use(d)})})),u=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(r),this.key("notAfter").use(r))})),h=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),f=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(s),this.key("issuer").use(l),this.key("validity").use(u),this.key("subject").use(l),this.key("subjectPublicKeyInfo").use(a),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())})),p=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(f),this.key("signatureAlgorithm").use(s),this.key("signatureValue").bitstr())}));t.exports=p},{"asn1.js":2}],239:[function(e,t,i){var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,r=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,s=e("evp_bytestokey"),a=e("browserify-aes"),c=e("safe-buffer").Buffer;t.exports=function(e,t){var i,d=e.toString(),l=d.match(n);if(l){var u="aes"+l[1],h=c.from(l[2],"hex"),f=c.from(l[3].replace(/[\r\n]/g,""),"base64"),p=s(t,h.slice(0,8),parseInt(l[1],10)).key,g=[],v=a.createDecipheriv(u,p,h);g.push(v.update(f)),g.push(v.final()),i=c.concat(g)}else{var m=d.match(o);i=c.from(m[2].replace(/[\r\n]/g,""),"base64")}return{tag:d.match(r)[1],data:i}}},{"browserify-aes":23,evp_bytestokey:110,"safe-buffer":260}],240:[function(e,t,i){var n=e("./asn1"),r=e("./aesid.json"),o=e("./fixProc"),s=e("browserify-aes"),a=e("pbkdf2"),c=e("safe-buffer").Buffer;function d(e){var t;"object"!=typeof e||c.isBuffer(e)||(t=e.passphrase,e=e.key),"string"==typeof e&&(e=c.from(e));var i,d,l=o(e,t),u=l.tag,h=l.data;switch(u){case"CERTIFICATE":d=n.certificate.decode(h,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(d||(d=n.PublicKey.decode(h,"der")),i=d.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPublicKey.decode(d.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return d.subjectPrivateKey=d.subjectPublicKey,{type:"ec",data:d};case"1.2.840.10040.4.1":return d.algorithm.params.pub_key=n.DSAparam.decode(d.subjectPublicKey.data,"der"),{type:"dsa",data:d.algorithm.params};default:throw new Error("unknown key id "+i)}case"ENCRYPTED PRIVATE KEY":h=function(e,t){var i=e.algorithm.decrypt.kde.kdeparams.salt,n=parseInt(e.algorithm.decrypt.kde.kdeparams.iters.toString(),10),o=r[e.algorithm.decrypt.cipher.algo.join(".")],d=e.algorithm.decrypt.cipher.iv,l=e.subjectPrivateKey,u=parseInt(o.split("-")[1],10)/8,h=a.pbkdf2Sync(t,i,n,u,"sha1"),f=s.createDecipheriv(o,h,d),p=[];return p.push(f.update(l)),p.push(f.final()),c.concat(p)}(h=n.EncryptedPrivateKey.decode(h,"der"),t);case"PRIVATE KEY":switch(i=(d=n.PrivateKey.decode(h,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return n.RSAPrivateKey.decode(d.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:d.algorithm.curve,privateKey:n.ECPrivateKey.decode(d.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return d.algorithm.params.priv_key=n.DSAparam.decode(d.subjectPrivateKey,"der"),{type:"dsa",params:d.algorithm.params};default:throw new Error("unknown key id "+i)}case"RSA PUBLIC KEY":return n.RSAPublicKey.decode(h,"der");case"RSA PRIVATE KEY":return n.RSAPrivateKey.decode(h,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:n.DSAPrivateKey.decode(h,"der")};case"EC PRIVATE KEY":return{curve:(h=n.ECPrivateKey.decode(h,"der")).parameters.value,privateKey:h.privateKey};default:throw new Error("unknown key type "+u)}}t.exports=d,d.signature=n.signature},{"./aesid.json":236,"./asn1":237,"./fixProc":239,"browserify-aes":23,pbkdf2:241,"safe-buffer":260}],241:[function(e,t,i){i.pbkdf2=e("./lib/async"),i.pbkdf2Sync=e("./lib/sync")},{"./lib/async":242,"./lib/sync":245}],242:[function(e,t,i){(function(i){(function(){var n,r,o=e("safe-buffer").Buffer,s=e("./precondition"),a=e("./default-encoding"),c=e("./sync"),d=e("./to-buffer"),l=i.crypto&&i.crypto.subtle,u={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function f(){return r||(r=i.process&&i.process.nextTick?i.process.nextTick:i.queueMicrotask?i.queueMicrotask:i.setImmediate?i.setImmediate:i.setTimeout)}function p(e,t,i,n,r){return l.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return l.deriveBits({name:"PBKDF2",salt:t,iterations:i,hash:{name:r}},e,n<<3)})).then((function(e){return o.from(e)}))}t.exports=function(e,t,r,g,v,m){"function"==typeof v&&(m=v,v=void 0);var y=u[(v=v||"sha1").toLowerCase()];if(y&&"function"==typeof i.Promise){if(s(r,g),e=d(e,a,"Password"),t=d(t,a,"Salt"),"function"!=typeof m)throw new Error("No callback provided to pbkdf2");!function(e,t){e.then((function(e){f()((function(){t(null,e)}))}),(function(e){f()((function(){t(e)}))}))}(function(e){if(i.process&&!i.process.browser)return Promise.resolve(!1);if(!l||!l.importKey||!l.deriveBits)return Promise.resolve(!1);if(void 0!==h[e])return h[e];var t=p(n=n||o.alloc(8),n,10,128,e).then((function(){return!0})).catch((function(){return!1}));return h[e]=t,t}(y).then((function(i){return i?p(e,t,r,g,y):c(e,t,r,g,v)})),m)}else f()((function(){var i;try{i=c(e,t,r,g,v)}catch(e){return m(e)}m(null,i)}))}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./default-encoding":243,"./precondition":244,"./sync":245,"./to-buffer":246,"safe-buffer":260}],243:[function(e,t,i){(function(e,i){(function(){var n;if(i.process&&i.process.browser)n="utf-8";else if(i.process&&i.process.version){n=parseInt(e.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary"}else n="utf-8";t.exports=n}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:247}],244:[function(e,t,i){var n=Math.pow(2,30)-1;t.exports=function(e,t){if("number"!=typeof e)throw new TypeError("Iterations not a number");if(e<0)throw new TypeError("Bad iterations");if("number"!=typeof t)throw new TypeError("Key length not a number");if(t<0||t>n||t!=t)throw new TypeError("Bad key length")}},{}],245:[function(e,t,i){var n=e("create-hash/md5"),r=e("ripemd160"),o=e("sha.js"),s=e("safe-buffer").Buffer,a=e("./precondition"),c=e("./default-encoding"),d=e("./to-buffer"),l=s.alloc(128),u={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20};function h(e,t,i){var a=function(e){function t(t){return o(e).update(t).digest()}function i(e){return(new r).update(e).digest()}return"rmd160"===e||"ripemd160"===e?i:"md5"===e?n:t}(e),c="sha512"===e||"sha384"===e?128:64;t.length>c?t=a(t):t.length<c&&(t=s.concat([t,l],c));for(var d=s.allocUnsafe(c+u[e]),h=s.allocUnsafe(c+u[e]),f=0;f<c;f++)d[f]=54^t[f],h[f]=92^t[f];var p=s.allocUnsafe(c+i+4);d.copy(p,0,0,c),this.ipad1=p,this.ipad2=d,this.opad=h,this.alg=e,this.blocksize=c,this.hash=a,this.size=u[e]}h.prototype.run=function(e,t){return e.copy(t,this.blocksize),this.hash(t).copy(this.opad,this.blocksize),this.hash(this.opad)},t.exports=function(e,t,i,n,r){a(i,n);var o=new h(r=r||"sha1",e=d(e,c,"Password"),(t=d(t,c,"Salt")).length),l=s.allocUnsafe(n),f=s.allocUnsafe(t.length+4);t.copy(f,0,0,t.length);for(var p=0,g=u[r],v=Math.ceil(n/g),m=1;m<=v;m++){f.writeUInt32BE(m,t.length);for(var y=o.run(f,o.ipad1),b=y,_=1;_<i;_++){b=o.run(b,o.ipad2);for(var S=0;S<g;S++)y[S]^=b[S]}y.copy(l,p),p+=g}return l}},{"./default-encoding":243,"./precondition":244,"./to-buffer":246,"create-hash/md5":75,ripemd160:259,"safe-buffer":260,"sha.js":267}],246:[function(e,t,i){var n=e("safe-buffer").Buffer;t.exports=function(e,t,i){if(n.isBuffer(e))return e;if("string"==typeof e)return n.from(e,t);if(ArrayBuffer.isView(e))return n.from(e.buffer);throw new TypeError(i+" must be a string, a Buffer, a typed array or a DataView")}},{"safe-buffer":260}],247:[function(e,t,i){var n,r,o=t.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(e){n=s}try{r="function"==typeof clearTimeout?clearTimeout:a}catch(e){r=a}}();var d,l=[],u=!1,h=-1;function f(){u&&d&&(u=!1,d.length?l=d.concat(l):h=-1,l.length&&p())}function p(){if(!u){var e=c(f);u=!0;for(var t=l.length;t;){for(d=l,l=[];++h<t;)d&&d[h].run();h=-1,t=l.length}d=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===a||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{return r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function g(e,t){this.fun=e,this.array=t}function v(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];l.push(new g(e,t)),1!==l.length||u||c(p)},g.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=v,o.addListener=v,o.once=v,o.off=v,o.removeListener=v,o.removeAllListeners=v,o.emit=v,o.prependListener=v,o.prependOnceListener=v,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},{}],248:[function(e,t,i){i.publicEncrypt=e("./publicEncrypt"),i.privateDecrypt=e("./privateDecrypt"),i.privateEncrypt=function(e,t){return i.publicEncrypt(e,t,!0)},i.publicDecrypt=function(e,t){return i.privateDecrypt(e,t,!0)}},{"./privateDecrypt":250,"./publicEncrypt":251}],249:[function(e,t,i){var n=e("create-hash"),r=e("safe-buffer").Buffer;function o(e){var t=r.allocUnsafe(4);return t.writeUInt32BE(e,0),t}t.exports=function(e,t){for(var i,s=r.alloc(0),a=0;s.length<t;)i=o(a++),s=r.concat([s,n("sha1").update(e).update(i).digest()]);return s.slice(0,t)}},{"create-hash":74,"safe-buffer":260}],250:[function(e,t,i){var n=e("parse-asn1"),r=e("./mgf"),o=e("./xor"),s=e("bn.js"),a=e("browserify-rsa"),c=e("create-hash"),d=e("./withPublic"),l=e("safe-buffer").Buffer;t.exports=function(e,t,i){var u;u=e.padding?e.padding:i?1:4;var h,f=n(e),p=f.modulus.byteLength();if(t.length>p||new s(t).cmp(f.modulus)>=0)throw new Error("decryption error");h=i?d(new s(t),f):a(t,f);var g=l.alloc(p-h.length);if(h=l.concat([g,h],p),4===u)return function(e,t){var i=e.modulus.byteLength(),n=c("sha1").update(l.alloc(0)).digest(),s=n.length;if(0!==t[0])throw new Error("decryption error");var a=t.slice(1,s+1),d=t.slice(s+1),u=o(a,r(d,s)),h=o(d,r(u,i-s-1));if(function(e,t){e=l.from(e),t=l.from(t);var i=0,n=e.length;e.length!==t.length&&(i++,n=Math.min(e.length,t.length));var r=-1;for(;++r<n;)i+=e[r]^t[r];return i}(n,h.slice(0,s)))throw new Error("decryption error");var f=s;for(;0===h[f];)f++;if(1!==h[f++])throw new Error("decryption error");return h.slice(f)}(f,h);if(1===u)return function(e,t,i){var n=t.slice(0,2),r=2,o=0;for(;0!==t[r++];)if(r>=t.length){o++;break}var s=t.slice(2,r-1);("0002"!==n.toString("hex")&&!i||"0001"!==n.toString("hex")&&i)&&o++;s.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(r)}(0,h,i);if(3===u)return h;throw new Error("unknown padding")}},{"./mgf":249,"./withPublic":252,"./xor":253,"bn.js":18,"browserify-rsa":41,"create-hash":74,"parse-asn1":240,"safe-buffer":260}],251:[function(e,t,i){var n=e("parse-asn1"),r=e("randombytes"),o=e("create-hash"),s=e("./mgf"),a=e("./xor"),c=e("bn.js"),d=e("./withPublic"),l=e("browserify-rsa"),u=e("safe-buffer").Buffer;t.exports=function(e,t,i){var h;h=e.padding?e.padding:i?1:4;var f,p=n(e);if(4===h)f=function(e,t){var i=e.modulus.byteLength(),n=t.length,d=o("sha1").update(u.alloc(0)).digest(),l=d.length,h=2*l;if(n>i-h-2)throw new Error("message too long");var f=u.alloc(i-n-h-2),p=i-l-1,g=r(l),v=a(u.concat([d,f,u.alloc(1,1),t],p),s(g,p)),m=a(g,s(v,l));return new c(u.concat([u.alloc(1),m,v],i))}(p,t);else if(1===h)f=function(e,t,i){var n,o=t.length,s=e.modulus.byteLength();if(o>s-11)throw new Error("message too long");n=i?u.alloc(s-o-3,255):function(e){var t,i=u.allocUnsafe(e),n=0,o=r(2*e),s=0;for(;n<e;)s===o.length&&(o=r(2*e),s=0),(t=o[s++])&&(i[n++]=t);return i}(s-o-3);return new c(u.concat([u.from([0,i?1:2]),n,u.alloc(1),t],s))}(p,t,i);else{if(3!==h)throw new Error("unknown padding");if((f=new c(t)).cmp(p.modulus)>=0)throw new Error("data too long for modulus")}return i?l(f,p):d(f,p)}},{"./mgf":249,"./withPublic":252,"./xor":253,"bn.js":18,"browserify-rsa":41,"create-hash":74,"parse-asn1":240,randombytes:254,"safe-buffer":260}],252:[function(e,t,i){var n=e("bn.js"),r=e("safe-buffer").Buffer;t.exports=function(e,t){return r.from(e.toRed(n.mont(t.modulus)).redPow(new n(t.publicExponent)).fromRed().toArray())}},{"bn.js":18,"safe-buffer":260}],253:[function(e,t,i){t.exports=function(e,t){for(var i=e.length,n=-1;++n<i;)e[n]^=t[n];return e}},{}],254:[function(e,t,i){(function(i,n){(function(){"use strict";var r=65536,o=4294967295;var s=e("safe-buffer").Buffer,a=n.crypto||n.msCrypto;a&&a.getRandomValues?t.exports=function(e,t){if(e>o)throw new RangeError("requested too many random bytes");var n=s.allocUnsafe(e);if(e>0)if(e>r)for(var c=0;c<e;c+=r)a.getRandomValues(n.slice(c,c+r));else a.getRandomValues(n);if("function"==typeof t)return i.nextTick((function(){t(null,n)}));return n}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:247,"safe-buffer":260}],255:[function(e,t,i){(function(t,n){(function(){"use strict";function r(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}var o=e("safe-buffer"),s=e("randombytes"),a=o.Buffer,c=o.kMaxLength,d=n.crypto||n.msCrypto,l=Math.pow(2,32)-1;function u(e,t){if("number"!=typeof e||e!=e)throw new TypeError("offset must be a number");if(e>l||e<0)throw new TypeError("offset must be a uint32");if(e>c||e>t)throw new RangeError("offset out of range")}function h(e,t,i){if("number"!=typeof e||e!=e)throw new TypeError("size must be a number");if(e>l||e<0)throw new TypeError("size must be a uint32");if(e+t>i||e>c)throw new RangeError("buffer too small")}function f(e,i,n,r){if(t.browser){var o=e.buffer,a=new Uint8Array(o,i,n);return d.getRandomValues(a),r?void t.nextTick((function(){r(null,e)})):e}if(!r)return s(n).copy(e,i),e;s(n,(function(t,n){if(t)return r(t);n.copy(e,i),r(null,e)}))}d&&d.getRandomValues||!t.browser?(i.randomFill=function(e,t,i,r){if(!(a.isBuffer(e)||e instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)r=t,t=0,i=e.length;else if("function"==typeof i)r=i,i=e.length-t;else if("function"!=typeof r)throw new TypeError('"cb" argument must be a function');return u(t,e.length),h(i,t,e.length),f(e,t,i,r)},i.randomFillSync=function(e,t,i){void 0===t&&(t=0);if(!(a.isBuffer(e)||e instanceof n.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');u(t,e.length),void 0===i&&(i=e.length-t);return h(i,t,e.length),f(e,t,i)}):(i.randomFill=r,i.randomFillSync=r)}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{_process:247,randombytes:254,"safe-buffer":260}],256:[function(e,t,i){t.exports=e("./lib/retry")},{"./lib/retry":257}],257:[function(e,t,i){var n=e("./retry_operation");i.operation=function(e){var t=i.timeouts(e);return new n(t,{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})},i.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var i in e)t[i]=e[i];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],r=0;r<t.retries;r++)n.push(this.createTimeout(r,t));return e&&e.forever&&!n.length&&n.push(this.createTimeout(r,t)),n.sort((function(e,t){return e-t})),n},i.createTimeout=function(e,t){var i=t.randomize?Math.random()+1:1,n=Math.round(i*Math.max(t.minTimeout,1)*Math.pow(t.factor,e));return n=Math.min(n,t.maxTimeout)},i.wrap=function(e,t,n){if(t instanceof Array&&(n=t,t=null),!n)for(var r in n=[],e)"function"==typeof e[r]&&n.push(r);for(var o=0;o<n.length;o++){var s=n[o],a=e[s];e[s]=function(n){var r=i.operation(t),o=Array.prototype.slice.call(arguments,1),s=o.pop();o.push((function(e){r.retry(e)||(e&&(arguments[0]=r.mainError()),s.apply(this,arguments))})),r.attempt((function(){n.apply(e,o)}))}.bind(e,a),e[s].options=t}}},{"./retry_operation":258}],258:[function(e,t,i){function n(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},n.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var i=this._timeouts.shift();if(void 0===i){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),i=this._cachedTimeouts.slice(-1)}var n=this;return this._timer=setTimeout((function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout((function(){n._operationTimeoutCb(n._attempts)}),n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)}),i),this._options.unref&&this._timer.unref(),!0},n.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var i=this;this._operationTimeoutCb&&(this._timeout=setTimeout((function(){i._operationTimeoutCb()}),i._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},n.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},n.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,i=0,n=0;n<this._errors.length;n++){var r=this._errors[n],o=r.message,s=(e[o]||0)+1;e[o]=s,s>=i&&(t=r,i=s)}return t}},{}],259:[function(e,t,i){"use strict";var n=e("buffer").Buffer,r=e("inherits"),o=e("hash-base"),s=new Array(16),a=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],c=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],d=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],l=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],u=[0,1518500249,1859775393,2400959708,2840853838],h=[1352829926,1548603684,1836072691,2053994217,0];function f(){o.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function p(e,t){return e<<t|e>>>32-t}function g(e,t,i,n,r,o,s,a){return p(e+(t^i^n)+o+s|0,a)+r|0}function v(e,t,i,n,r,o,s,a){return p(e+(t&i|~t&n)+o+s|0,a)+r|0}function m(e,t,i,n,r,o,s,a){return p(e+((t|~i)^n)+o+s|0,a)+r|0}function y(e,t,i,n,r,o,s,a){return p(e+(t&n|i&~n)+o+s|0,a)+r|0}function b(e,t,i,n,r,o,s,a){return p(e+(t^(i|~n))+o+s|0,a)+r|0}r(f,o),f.prototype._update=function(){for(var e=s,t=0;t<16;++t)e[t]=this._block.readInt32LE(4*t);for(var i=0|this._a,n=0|this._b,r=0|this._c,o=0|this._d,f=0|this._e,_=0|this._a,S=0|this._b,E=0|this._c,w=0|this._d,T=0|this._e,I=0;I<80;I+=1){var R,k;I<16?(R=g(i,n,r,o,f,e[a[I]],u[0],d[I]),k=b(_,S,E,w,T,e[c[I]],h[0],l[I])):I<32?(R=v(i,n,r,o,f,e[a[I]],u[1],d[I]),k=y(_,S,E,w,T,e[c[I]],h[1],l[I])):I<48?(R=m(i,n,r,o,f,e[a[I]],u[2],d[I]),k=m(_,S,E,w,T,e[c[I]],h[2],l[I])):I<64?(R=y(i,n,r,o,f,e[a[I]],u[3],d[I]),k=v(_,S,E,w,T,e[c[I]],h[3],l[I])):(R=b(i,n,r,o,f,e[a[I]],u[4],d[I]),k=g(_,S,E,w,T,e[c[I]],h[4],l[I])),i=f,f=o,o=p(r,10),r=n,n=R,_=T,T=w,w=p(E,10),E=S,S=k}var M=this._b+r+w|0;this._b=this._c+o+T|0,this._c=this._d+f+_|0,this._d=this._e+i+S|0,this._e=this._a+n+E|0,this._a=M},f.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var e=n.alloc?n.alloc(20):new n(20);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e.writeInt32LE(this._e,16),e},t.exports=f},{buffer:68,"hash-base":121,inherits:151}],260:[function(e,t,i){ | |
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */ | |
var n=e("buffer"),r=n.Buffer;function o(e,t){for(var i in e)t[i]=e[i]}function s(e,t,i){return r(e,t,i)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?t.exports=n:(o(n,i),i.Buffer=s),s.prototype=Object.create(r.prototype),o(r,s),s.from=function(e,t,i){if("number"==typeof e)throw new TypeError("Argument must not be a number");return r(e,t,i)},s.alloc=function(e,t,i){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=r(e);return void 0!==t?"string"==typeof i?n.fill(t,i):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return r(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},{buffer:68}],261:[function(e,t,i){(function(i){(function(){"use strict";var n,r=e("buffer"),o=r.Buffer,s={};for(n in r)r.hasOwnProperty(n)&&"SlowBuffer"!==n&&"Buffer"!==n&&(s[n]=r[n]);var a=s.Buffer={};for(n in o)o.hasOwnProperty(n)&&"allocUnsafe"!==n&&"allocUnsafeSlow"!==n&&(a[n]=o[n]);if(s.Buffer.prototype=o.prototype,a.from&&a.from!==Uint8Array.from||(a.from=function(e,t,i){if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type '+typeof e);if(e&&void 0===e.length)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);return o(e,t,i)}),a.alloc||(a.alloc=function(e,t,i){if("number"!=typeof e)throw new TypeError('The "size" argument must be of type number. Received type '+typeof e);if(e<0||e>=2*(1<<30))throw new RangeError('The value "'+e+'" is invalid for option "size"');var n=o(e);return t&&0!==t.length?"string"==typeof i?n.fill(t,i):n.fill(t):n.fill(0),n}),!s.kStringMaxLength)try{s.kStringMaxLength=i.binding("buffer").kStringMaxLength}catch(e){}s.constants||(s.constants={MAX_LENGTH:s.kMaxLength},s.kStringMaxLength&&(s.constants.MAX_STRING_LENGTH=s.kStringMaxLength)),t.exports=s}).call(this)}).call(this,e("_process"))},{_process:247,buffer:68}],262:[function(e,t,i){var n=t.exports={v:[{name:"version",reg:/^(\d*)$/}],o:[{name:"origin",reg:/^(\S*) (\d*) (\d*) (\S*) IP(\d) (\S*)/,names:["username","sessionId","sessionVersion","netType","ipVer","address"],format:"%s %s %d %s IP%d %s"}],s:[{name:"name"}],i:[{name:"description"}],u:[{name:"uri"}],e:[{name:"email"}],p:[{name:"phone"}],z:[{name:"timezones"}],r:[{name:"repeats"}],t:[{name:"timing",reg:/^(\d*) (\d*)/,names:["start","stop"],format:"%d %d"}],c:[{name:"connection",reg:/^IN IP(\d) (\S*)/,names:["version","ip"],format:"IN IP%d %s"}],b:[{push:"bandwidth",reg:/^(TIAS|AS|CT|RR|RS):(\d*)/,names:["type","limit"],format:"%s:%s"}],m:[{reg:/^(\w*) (\d*) ([\w/]*)(?: (.*))?/,names:["type","port","protocol","payloads"],format:"%s %d %s %s"}],a:[{push:"rtp",reg:/^rtpmap:(\d*) ([\w\-.]*)(?:\s*\/(\d*)(?:\s*\/(\S*))?)?/,names:["payload","codec","rate","encoding"],format:function(e){return e.encoding?"rtpmap:%d %s/%s/%s":e.rate?"rtpmap:%d %s/%s":"rtpmap:%d %s"}},{push:"fmtp",reg:/^fmtp:(\d*) ([\S| ]*)/,names:["payload","config"],format:"fmtp:%d %s"},{name:"control",reg:/^control:(.*)/,format:"control:%s"},{name:"rtcp",reg:/^rtcp:(\d*)(?: (\S*) IP(\d) (\S*))?/,names:["port","netType","ipVer","address"],format:function(e){return null!=e.address?"rtcp:%d %s IP%d %s":"rtcp:%d"}},{push:"rtcpFbTrrInt",reg:/^rtcp-fb:(\*|\d*) trr-int (\d*)/,names:["payload","value"],format:"rtcp-fb:%s trr-int %d"},{push:"rtcpFb",reg:/^rtcp-fb:(\*|\d*) ([\w-_]*)(?: ([\w-_]*))?/,names:["payload","type","subtype"],format:function(e){return null!=e.subtype?"rtcp-fb:%s %s %s":"rtcp-fb:%s %s"}},{push:"ext",reg:/^extmap:(\d+)(?:\/(\w+))?(?: (urn:ietf:params:rtp-hdrext:encrypt))? (\S*)(?: (\S*))?/,names:["value","direction","encrypt-uri","uri","config"],format:function(e){return"extmap:%d"+(e.direction?"/%s":"%v")+(e["encrypt-uri"]?" %s":"%v")+" %s"+(e.config?" %s":"")}},{name:"extmapAllowMixed",reg:/^(extmap-allow-mixed)/},{push:"crypto",reg:/^crypto:(\d*) ([\w_]*) (\S*)(?: (\S*))?/,names:["id","suite","config","sessionConfig"],format:function(e){return null!=e.sessionConfig?"crypto:%d %s %s %s":"crypto:%d %s %s"}},{name:"setup",reg:/^setup:(\w*)/,format:"setup:%s"},{name:"connectionType",reg:/^connection:(new|existing)/,format:"connection:%s"},{name:"mid",reg:/^mid:([^\s]*)/,format:"mid:%s"},{name:"msid",reg:/^msid:(.*)/,format:"msid:%s"},{name:"ptime",reg:/^ptime:(\d*(?:\.\d*)*)/,format:"ptime:%d"},{name:"maxptime",reg:/^maxptime:(\d*(?:\.\d*)*)/,format:"maxptime:%d"},{name:"direction",reg:/^(sendrecv|recvonly|sendonly|inactive)/},{name:"icelite",reg:/^(ice-lite)/},{name:"iceUfrag",reg:/^ice-ufrag:(\S*)/,format:"ice-ufrag:%s"},{name:"icePwd",reg:/^ice-pwd:(\S*)/,format:"ice-pwd:%s"},{name:"fingerprint",reg:/^fingerprint:(\S*) (\S*)/,names:["type","hash"],format:"fingerprint:%s %s"},{push:"candidates",reg:/^candidate:(\S*) (\d*) (\S*) (\d*) (\S*) (\d*) typ (\S*)(?: raddr (\S*) rport (\d*))?(?: tcptype (\S*))?(?: generation (\d*))?(?: network-id (\d*))?(?: network-cost (\d*))?/,names:["foundation","component","transport","priority","ip","port","type","raddr","rport","tcptype","generation","network-id","network-cost"],format:function(e){var t="candidate:%s %d %s %d %s %d typ %s";return t+=null!=e.raddr?" raddr %s rport %d":"%v%v",t+=null!=e.tcptype?" tcptype %s":"%v",null!=e.generation&&(t+=" generation %d"),t+=null!=e["network-id"]?" network-id %d":"%v",t+=null!=e["network-cost"]?" network-cost %d":"%v"}},{name:"endOfCandidates",reg:/^(end-of-candidates)/},{name:"remoteCandidates",reg:/^remote-candidates:(.*)/,format:"remote-candidates:%s"},{name:"iceOptions",reg:/^ice-options:(\S*)/,format:"ice-options:%s"},{push:"ssrcs",reg:/^ssrc:(\d*) ([\w_-]*)(?::(.*))?/,names:["id","attribute","value"],format:function(e){var t="ssrc:%d";return null!=e.attribute&&(t+=" %s",null!=e.value&&(t+=":%s")),t}},{push:"ssrcGroups",reg:/^ssrc-group:([\x21\x23\x24\x25\x26\x27\x2A\x2B\x2D\x2E\w]*) (.*)/,names:["semantics","ssrcs"],format:"ssrc-group:%s %s"},{name:"msidSemantic",reg:/^msid-semantic:\s?(\w*) (\S*)/,names:["semantic","token"],format:"msid-semantic: %s %s"},{push:"groups",reg:/^group:(\w*) (.*)/,names:["type","mids"],format:"group:%s %s"},{name:"rtcpMux",reg:/^(rtcp-mux)/},{name:"rtcpRsize",reg:/^(rtcp-rsize)/},{name:"sctpmap",reg:/^sctpmap:([\w_/]*) (\S*)(?: (\S*))?/,names:["sctpmapNumber","app","maxMessageSize"],format:function(e){return null!=e.maxMessageSize?"sctpmap:%s %s %s":"sctpmap:%s %s"}},{name:"xGoogleFlag",reg:/^x-google-flag:([^\s]*)/,format:"x-google-flag:%s"},{push:"rids",reg:/^rid:([\d\w]+) (\w+)(?: ([\S| ]*))?/,names:["id","direction","params"],format:function(e){return e.params?"rid:%s %s %s":"rid:%s %s"}},{push:"imageattrs",reg:new RegExp("^imageattr:(\\d+|\\*)[\\s\\t]+(send|recv)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*)(?:[\\s\\t]+(recv|send)[\\s\\t]+(\\*|\\[\\S+\\](?:[\\s\\t]+\\[\\S+\\])*))?"),names:["pt","dir1","attrs1","dir2","attrs2"],format:function(e){return"imageattr:%s %s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast",reg:new RegExp("^simulcast:(send|recv) ([a-zA-Z0-9\\-_~;,]+)(?:\\s?(send|recv) ([a-zA-Z0-9\\-_~;,]+))?$"),names:["dir1","list1","dir2","list2"],format:function(e){return"simulcast:%s %s"+(e.dir2?" %s %s":"")}},{name:"simulcast_03",reg:/^simulcast:[\s\t]+([\S+\s\t]+)$/,names:["value"],format:"simulcast: %s"},{name:"framerate",reg:/^framerate:(\d+(?:$|\.\d+))/,format:"framerate:%s"},{name:"sourceFilter",reg:/^source-filter: *(excl|incl) (\S*) (IP4|IP6|\*) (\S*) (.*)/,names:["filterMode","netType","addressTypes","destAddress","srcList"],format:"source-filter: %s %s %s %s %s"},{name:"bundleOnly",reg:/^(bundle-only)/},{name:"label",reg:/^label:(.+)/,format:"label:%s"},{name:"sctpPort",reg:/^sctp-port:(\d+)$/,format:"sctp-port:%s"},{name:"maxMessageSize",reg:/^max-message-size:(\d+)$/,format:"max-message-size:%s"},{push:"tsRefClocks",reg:/^ts-refclk:([^\s=]*)(?:=(\S*))?/,names:["clksrc","clksrcExt"],format:function(e){return"ts-refclk:%s"+(null!=e.clksrcExt?"=%s":"")}},{name:"mediaClk",reg:/^mediaclk:(?:id=(\S*))? *([^\s=]*)(?:=(\S*))?(?: *rate=(\d+)\/(\d+))?/,names:["id","mediaClockName","mediaClockValue","rateNumerator","rateDenominator"],format:function(e){var t="mediaclk:";return t+=null!=e.id?"id=%s %s":"%v%s",t+=null!=e.mediaClockValue?"=%s":"",t+=null!=e.rateNumerator?" rate=%s":"",t+=null!=e.rateDenominator?"/%s":""}},{name:"keywords",reg:/^keywds:(.+)$/,format:"keywds:%s"},{name:"content",reg:/^content:(.+)/,format:"content:%s"},{name:"bfcpFloorCtrl",reg:/^floorctrl:(c-only|s-only|c-s)/,format:"floorctrl:%s"},{name:"bfcpConfId",reg:/^confid:(\d+)/,format:"confid:%s"},{name:"bfcpUserId",reg:/^userid:(\d+)/,format:"userid:%s"},{name:"bfcpFloorId",reg:/^floorid:(.+) (?:m-stream|mstrm):(.+)/,names:["id","mStream"],format:"floorid:%s mstrm:%s"},{push:"invalid",names:["value"]}]};Object.keys(n).forEach((function(e){n[e].forEach((function(e){e.reg||(e.reg=/(.*)/),e.format||(e.format="%s")}))}))},{}],263:[function(e,t,i){var n=e("./parser"),r=e("./writer");i.write=r,i.parse=n.parse,i.parseParams=n.parseParams,i.parseFmtpConfig=n.parseFmtpConfig,i.parsePayloads=n.parsePayloads,i.parseRemoteCandidates=n.parseRemoteCandidates,i.parseImageAttributes=n.parseImageAttributes,i.parseSimulcastStreamList=n.parseSimulcastStreamList},{"./parser":264,"./writer":265}],264:[function(e,t,i){var n=function(e){return String(Number(e))===e?Number(e):e},r=function(e,t,i){var r=e.name&&e.names;e.push&&!t[e.push]?t[e.push]=[]:r&&!t[e.name]&&(t[e.name]={});var o=e.push?{}:r?t[e.name]:t;!function(e,t,i,r){if(r&&!i)t[r]=n(e[1]);else for(var o=0;o<i.length;o+=1)null!=e[o+1]&&(t[i[o]]=n(e[o+1]))}(i.match(e.reg),o,e.names,e.name),e.push&&t[e.push].push(o)},o=e("./grammar"),s=RegExp.prototype.test.bind(/^([a-z])=(.*)/);i.parse=function(e){var t={},i=[],n=t;return e.split(/(\r\n|\r|\n)/).filter(s).forEach((function(e){var t=e[0],s=e.slice(2);"m"===t&&(i.push({rtp:[],fmtp:[]}),n=i[i.length-1]);for(var a=0;a<(o[t]||[]).length;a+=1){var c=o[t][a];if(c.reg.test(s))return r(c,n,s)}})),t.media=i,t};var a=function(e,t){var i=t.split(/=(.+)/,2);return 2===i.length?e[i[0]]=n(i[1]):1===i.length&&t.length>1&&(e[i[0]]=void 0),e};i.parseParams=function(e){return e.split(/;\s?/).reduce(a,{})},i.parseFmtpConfig=i.parseParams,i.parsePayloads=function(e){return e.toString().split(" ").map(Number)},i.parseRemoteCandidates=function(e){for(var t=[],i=e.split(" ").map(n),r=0;r<i.length;r+=3)t.push({component:i[r],ip:i[r+1],port:i[r+2]});return t},i.parseImageAttributes=function(e){return e.split(" ").map((function(e){return e.substring(1,e.length-1).split(",").reduce(a,{})}))},i.parseSimulcastStreamList=function(e){return e.split(";").map((function(e){return e.split(",").map((function(e){var t,i=!1;return"~"!==e[0]?t=n(e):(t=n(e.substring(1,e.length)),i=!0),{scid:t,paused:i}}))}))}},{"./grammar":262}],265:[function(e,t,i){var n=e("./grammar"),r=/%[sdv%]/g,o=function(e){var t=1,i=arguments,n=i.length;return e.replace(r,(function(e){if(t>=n)return e;var r=i[t];switch(t+=1,e){case"%%":return"%";case"%s":return String(r);case"%d":return Number(r);case"%v":return""}}))},s=function(e,t,i){var n=[e+"="+(t.format instanceof Function?t.format(t.push?i:i[t.name]):t.format)];if(t.names)for(var r=0;r<t.names.length;r+=1){var s=t.names[r];t.name?n.push(i[t.name][s]):n.push(i[t.names[r]])}else n.push(i[t.name]);return o.apply(null,n)},a=["v","o","s","i","u","e","p","c","b","t","r","z","a"],c=["i","c","b","a"];t.exports=function(e,t){t=t||{},null==e.version&&(e.version=0),null==e.name&&(e.name=" "),e.media.forEach((function(e){null==e.payloads&&(e.payloads="")}));var i=t.outerOrder||a,r=t.innerOrder||c,o=[];return i.forEach((function(t){n[t].forEach((function(i){i.name in e&&null!=e[i.name]?o.push(s(t,i,e)):i.push in e&&null!=e[i.push]&&e[i.push].forEach((function(e){o.push(s(t,i,e))}))}))})),e.media.forEach((function(e){o.push(s("m",n.m[0],e)),r.forEach((function(t){n[t].forEach((function(i){i.name in e&&null!=e[i.name]?o.push(s(t,i,e)):i.push in e&&null!=e[i.push]&&e[i.push].forEach((function(e){o.push(s(t,i,e))}))}))}))})),o.join("\r\n")+"\r\n"}},{"./grammar":262}],266:[function(e,t,i){var n=e("safe-buffer").Buffer;function r(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}r.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var i=this._block,r=this._blockSize,o=e.length,s=this._len,a=0;a<o;){for(var c=s%r,d=Math.min(o-a,r-c),l=0;l<d;l++)i[c+l]=e[a+l];a+=d,(s+=d)%r==0&&this._update(i)}return this._len+=o,this},r.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var i=8*this._len;if(i<=4294967295)this._block.writeUInt32BE(i,this._blockSize-4);else{var n=(4294967295&i)>>>0,r=(i-n)/4294967296;this._block.writeUInt32BE(r,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var o=this._hash();return e?o.toString(e):o},r.prototype._update=function(){throw new Error("_update must be implemented by subclass")},t.exports=r},{"safe-buffer":260}],267:[function(e,t,i){(i=t.exports=function(e){e=e.toLowerCase();var t=i[e];if(!t)throw new Error(e+" is not supported (we accept pull requests)");return new t}).sha=e("./sha"),i.sha1=e("./sha1"),i.sha224=e("./sha224"),i.sha256=e("./sha256"),i.sha384=e("./sha384"),i.sha512=e("./sha512")},{"./sha":268,"./sha1":269,"./sha224":270,"./sha256":271,"./sha384":272,"./sha512":273}],268:[function(e,t,i){var n=e("inherits"),r=e("./hash"),o=e("safe-buffer").Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,r.call(this,64,56)}function d(e){return e<<30|e>>>2}function l(e,t,i,n){return 0===e?t&i|~t&n:2===e?t&i|t&n|i&n:t^i^n}n(c,r),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,i=this._w,n=0|this._a,r=0|this._b,o=0|this._c,a=0|this._d,c=0|this._e,u=0;u<16;++u)i[u]=e.readInt32BE(4*u);for(;u<80;++u)i[u]=i[u-3]^i[u-8]^i[u-14]^i[u-16];for(var h=0;h<80;++h){var f=~~(h/20),p=0|((t=n)<<5|t>>>27)+l(f,r,o,a)+c+i[h]+s[f];c=a,a=o,o=d(r),r=n,n=p}this._a=n+this._a|0,this._b=r+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=c},{"./hash":266,inherits:151,"safe-buffer":260}],269:[function(e,t,i){var n=e("inherits"),r=e("./hash"),o=e("safe-buffer").Buffer,s=[1518500249,1859775393,-1894007588,-899497514],a=new Array(80);function c(){this.init(),this._w=a,r.call(this,64,56)}function d(e){return e<<5|e>>>27}function l(e){return e<<30|e>>>2}function u(e,t,i,n){return 0===e?t&i|~t&n:2===e?t&i|t&n|i&n:t^i^n}n(c,r),c.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},c.prototype._update=function(e){for(var t,i=this._w,n=0|this._a,r=0|this._b,o=0|this._c,a=0|this._d,c=0|this._e,h=0;h<16;++h)i[h]=e.readInt32BE(4*h);for(;h<80;++h)i[h]=(t=i[h-3]^i[h-8]^i[h-14]^i[h-16])<<1|t>>>31;for(var f=0;f<80;++f){var p=~~(f/20),g=d(n)+u(p,r,o,a)+c+i[f]+s[p]|0;c=a,a=o,o=l(r),r=n,n=g}this._a=n+this._a|0,this._b=r+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0},c.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},t.exports=c},{"./hash":266,inherits:151,"safe-buffer":260}],270:[function(e,t,i){var n=e("inherits"),r=e("./sha256"),o=e("./hash"),s=e("safe-buffer").Buffer,a=new Array(64);function c(){this.init(),this._w=a,o.call(this,64,56)}n(c,r),c.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},c.prototype._hash=function(){var e=s.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},t.exports=c},{"./hash":266,"./sha256":271,inherits:151,"safe-buffer":260}],271:[function(e,t,i){var n=e("inherits"),r=e("./hash"),o=e("safe-buffer").Buffer,s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=new Array(64);function c(){this.init(),this._w=a,r.call(this,64,56)}function d(e,t,i){return i^e&(t^i)}function l(e,t,i){return e&t|i&(e|t)}function u(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function h(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function f(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}n(c,r),c.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},c.prototype._update=function(e){for(var t,i=this._w,n=0|this._a,r=0|this._b,o=0|this._c,a=0|this._d,c=0|this._e,p=0|this._f,g=0|this._g,v=0|this._h,m=0;m<16;++m)i[m]=e.readInt32BE(4*m);for(;m<64;++m)i[m]=0|(((t=i[m-2])>>>17|t<<15)^(t>>>19|t<<13)^t>>>10)+i[m-7]+f(i[m-15])+i[m-16];for(var y=0;y<64;++y){var b=v+h(c)+d(c,p,g)+s[y]+i[y]|0,_=u(n)+l(n,r,o)|0;v=g,g=p,p=c,c=a+b|0,a=o,o=r,r=n,n=b+_|0}this._a=n+this._a|0,this._b=r+this._b|0,this._c=o+this._c|0,this._d=a+this._d|0,this._e=c+this._e|0,this._f=p+this._f|0,this._g=g+this._g|0,this._h=v+this._h|0},c.prototype._hash=function(){var e=o.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},t.exports=c},{"./hash":266,inherits:151,"safe-buffer":260}],272:[function(e,t,i){var n=e("inherits"),r=e("./sha512"),o=e("./hash"),s=e("safe-buffer").Buffer,a=new Array(160);function c(){this.init(),this._w=a,o.call(this,128,112)}n(c,r),c.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},c.prototype._hash=function(){var e=s.allocUnsafe(48);function t(t,i,n){e.writeInt32BE(t,n),e.writeInt32BE(i,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},t.exports=c},{"./hash":266,"./sha512":273,inherits:151,"safe-buffer":260}],273:[function(e,t,i){var n=e("inherits"),r=e("./hash"),o=e("safe-buffer").Buffer,s=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=new Array(160);function c(){this.init(),this._w=a,r.call(this,128,112)}function d(e,t,i){return i^e&(t^i)}function l(e,t,i){return e&t|i&(e|t)}function u(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function h(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function f(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function p(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function g(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function v(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function m(e,t){return e>>>0<t>>>0?1:0}n(c,r),c.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},c.prototype._update=function(e){for(var t=this._w,i=0|this._ah,n=0|this._bh,r=0|this._ch,o=0|this._dh,a=0|this._eh,c=0|this._fh,y=0|this._gh,b=0|this._hh,_=0|this._al,S=0|this._bl,E=0|this._cl,w=0|this._dl,T=0|this._el,I=0|this._fl,R=0|this._gl,k=0|this._hl,M=0;M<32;M+=2)t[M]=e.readInt32BE(4*M),t[M+1]=e.readInt32BE(4*M+4);for(;M<160;M+=2){var C=t[M-30],O=t[M-30+1],A=f(C,O),P=p(O,C),D=g(C=t[M-4],O=t[M-4+1]),x=v(O,C),L=t[M-14],U=t[M-14+1],N=t[M-32],B=t[M-32+1],j=P+U|0,F=A+L+m(j,P)|0;F=(F=F+D+m(j=j+x|0,x)|0)+N+m(j=j+B|0,B)|0,t[M]=F,t[M+1]=j}for(var K=0;K<160;K+=2){F=t[K],j=t[K+1];var q=l(i,n,r),$=l(_,S,E),V=u(i,_),H=u(_,i),W=h(a,T),G=h(T,a),z=s[K],Y=s[K+1],J=d(a,c,y),Q=d(T,I,R),X=k+G|0,Z=b+W+m(X,k)|0;Z=(Z=(Z=Z+J+m(X=X+Q|0,Q)|0)+z+m(X=X+Y|0,Y)|0)+F+m(X=X+j|0,j)|0;var ee=H+$|0,te=V+q+m(ee,H)|0;b=y,k=R,y=c,R=I,c=a,I=T,a=o+Z+m(T=w+X|0,w)|0,o=r,w=E,r=n,E=S,n=i,S=_,i=Z+te+m(_=X+ee|0,X)|0}this._al=this._al+_|0,this._bl=this._bl+S|0,this._cl=this._cl+E|0,this._dl=this._dl+w|0,this._el=this._el+T|0,this._fl=this._fl+I|0,this._gl=this._gl+R|0,this._hl=this._hl+k|0,this._ah=this._ah+i+m(this._al,_)|0,this._bh=this._bh+n+m(this._bl,S)|0,this._ch=this._ch+r+m(this._cl,E)|0,this._dh=this._dh+o+m(this._dl,w)|0,this._eh=this._eh+a+m(this._el,T)|0,this._fh=this._fh+c+m(this._fl,I)|0,this._gh=this._gh+y+m(this._gl,R)|0,this._hh=this._hh+b+m(this._hl,k)|0},c.prototype._hash=function(){var e=o.allocUnsafe(64);function t(t,i,n){e.writeInt32BE(t,n),e.writeInt32BE(i,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},t.exports=c},{"./hash":266,inherits:151,"safe-buffer":260}],274:[function(e,t,i){t.exports=r;var n=e("events").EventEmitter;function r(){n.call(this)}e("inherits")(r,n),r.Readable=e("readable-stream/lib/_stream_readable.js"),r.Writable=e("readable-stream/lib/_stream_writable.js"),r.Duplex=e("readable-stream/lib/_stream_duplex.js"),r.Transform=e("readable-stream/lib/_stream_transform.js"),r.PassThrough=e("readable-stream/lib/_stream_passthrough.js"),r.finished=e("readable-stream/lib/internal/streams/end-of-stream.js"),r.pipeline=e("readable-stream/lib/internal/streams/pipeline.js"),r.Stream=r,r.prototype.pipe=function(e,t){var i=this;function r(t){e.writable&&!1===e.write(t)&&i.pause&&i.pause()}function o(){i.readable&&i.resume&&i.resume()}i.on("data",r),e.on("drain",o),e._isStdio||t&&!1===t.end||(i.on("end",a),i.on("close",c));var s=!1;function a(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function d(e){if(l(),0===n.listenerCount(this,"error"))throw e}function l(){i.removeListener("data",r),e.removeListener("drain",o),i.removeListener("end",a),i.removeListener("close",c),i.removeListener("error",d),e.removeListener("error",d),i.removeListener("end",l),i.removeListener("close",l),e.removeListener("close",l)}return i.on("error",d),e.on("error",d),i.on("end",l),i.on("close",l),e.on("close",l),e.emit("pipe",i),e}},{events:109,inherits:151,"readable-stream/lib/_stream_duplex.js":276,"readable-stream/lib/_stream_passthrough.js":277,"readable-stream/lib/_stream_readable.js":278,"readable-stream/lib/_stream_transform.js":279,"readable-stream/lib/_stream_writable.js":280,"readable-stream/lib/internal/streams/end-of-stream.js":284,"readable-stream/lib/internal/streams/pipeline.js":286}],275:[function(e,t,i){arguments[4][50][0].apply(i,arguments)},{dup:50}],276:[function(e,t,i){(function(i){(function(){"use strict";var n=Object.keys||function(e){var t=[];for(var i in e)t.push(i);return t};t.exports=d;var r=e("./_stream_readable"),o=e("./_stream_writable");e("inherits")(d,r);for(var s=n(o.prototype),a=0;a<s.length;a++){var c=s[a];d.prototype[c]||(d.prototype[c]=o.prototype[c])}function d(e){if(!(this instanceof d))return new d(e);r.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",l)))}function l(){this._writableState.ended||i.nextTick(u,this)}function u(e){e.end()}Object.defineProperty(d.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(d.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(d.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(d.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})}).call(this)}).call(this,e("_process"))},{"./_stream_readable":278,"./_stream_writable":280,_process:247,inherits:151}],277:[function(e,t,i){arguments[4][52][0].apply(i,arguments)},{"./_stream_transform":279,dup:52,inherits:151}],278:[function(e,t,i){(function(i,n){(function(){"use strict";var r;t.exports=I,I.ReadableState=T;e("events").EventEmitter;var o=function(e,t){return e.listeners(t).length},s=e("./internal/streams/stream"),a=e("buffer").Buffer,c=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var d,l=e("util");d=l&&l.debuglog?l.debuglog("stream"):function(){};var u,h,f,p=e("./internal/streams/buffer_list"),g=e("./internal/streams/destroy"),v=e("./internal/streams/state").getHighWaterMark,m=e("../errors").codes,y=m.ERR_INVALID_ARG_TYPE,b=m.ERR_STREAM_PUSH_AFTER_EOF,_=m.ERR_METHOD_NOT_IMPLEMENTED,S=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;e("inherits")(I,s);var E=g.errorOrDestroy,w=["error","close","destroy","pause","resume"];function T(t,i,n){r=r||e("./_stream_duplex"),t=t||{},"boolean"!=typeof n&&(n=i instanceof r),this.objectMode=!!t.objectMode,n&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=v(this,t,"readableHighWaterMark",n),this.buffer=new p,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(u||(u=e("string_decoder/").StringDecoder),this.decoder=new u(t.encoding),this.encoding=t.encoding)}function I(t){if(r=r||e("./_stream_duplex"),!(this instanceof I))return new I(t);var i=this instanceof r;this._readableState=new T(t,this,i),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),s.call(this)}function R(e,t,i,n,r){d("readableAddChunk",t);var o,s=e._readableState;if(null===t)s.reading=!1,function(e,t){if(d("onEofChunk"),t.ended)return;if(t.decoder){var i=t.decoder.end();i&&i.length&&(t.buffer.push(i),t.length+=t.objectMode?1:i.length)}t.ended=!0,t.sync?O(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,A(e)))}(e,s);else if(r||(o=function(e,t){var i;n=t,a.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(i=new y("chunk",["string","Buffer","Uint8Array"],t));var n;return i}(s,t)),o)E(e,o);else if(s.objectMode||t&&t.length>0)if("string"==typeof t||s.objectMode||Object.getPrototypeOf(t)===a.prototype||(t=function(e){return a.from(e)}(t)),n)s.endEmitted?E(e,new S):k(e,s,t,!0);else if(s.ended)E(e,new b);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!i?(t=s.decoder.write(t),s.objectMode||0!==t.length?k(e,s,t,!1):P(e,s)):k(e,s,t,!1)}else n||(s.reading=!1,P(e,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function k(e,t,i,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",i)):(t.length+=t.objectMode?1:i.length,n?t.buffer.unshift(i):t.buffer.push(i),t.needReadable&&O(e)),P(e,t)}Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),I.prototype.destroy=g.destroy,I.prototype._undestroy=g.undestroy,I.prototype._destroy=function(e,t){t(e)},I.prototype.push=function(e,t){var i,n=this._readableState;return n.objectMode?i=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=a.from(e,t),t=""),i=!0),R(this,e,t,!1,i)},I.prototype.unshift=function(e){return R(this,e,null,!0,!1)},I.prototype.isPaused=function(){return!1===this._readableState.flowing},I.prototype.setEncoding=function(t){u||(u=e("string_decoder/").StringDecoder);var i=new u(t);this._readableState.decoder=i,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,r="";null!==n;)r+=i.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==r&&this._readableState.buffer.push(r),this._readableState.length=r.length,this};var M=1073741824;function C(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=function(e){return e>=M?e=M:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function O(e){var t=e._readableState;d("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(d("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(A,e))}function A(e){var t=e._readableState;d("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,N(e)}function P(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(D,e,t))}function D(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var i=t.length;if(d("maybeReadMore read 0"),e.read(0),i===t.length)break}t.readingMore=!1}function x(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function L(e){d("readable nexttick read 0"),e.read(0)}function U(e,t){d("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),N(e),t.flowing&&!t.reading&&e.read(0)}function N(e){var t=e._readableState;for(d("flow",t.flowing);t.flowing&&null!==e.read(););}function B(e,t){return 0===t.length?null:(t.objectMode?i=t.buffer.shift():!e||e>=t.length?(i=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):i=t.buffer.consume(e,t.decoder),i);var i}function j(e){var t=e._readableState;d("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(F,t,e))}function F(e,t){if(d("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var i=t._writableState;(!i||i.autoDestroy&&i.finished)&&t.destroy()}}function K(e,t){for(var i=0,n=e.length;i<n;i++)if(e[i]===t)return i;return-1}I.prototype.read=function(e){d("read",e),e=parseInt(e,10);var t=this._readableState,i=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return d("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?j(this):O(this),null;if(0===(e=C(e,t))&&t.ended)return 0===t.length&&j(this),null;var n,r=t.needReadable;return d("need readable",r),(0===t.length||t.length-e<t.highWaterMark)&&d("length less than watermark",r=!0),t.ended||t.reading?d("reading or ended",r=!1):r&&(d("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=C(i,t))),null===(n=e>0?B(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),i!==e&&t.ended&&j(this)),null!==n&&this.emit("data",n),n},I.prototype._read=function(e){E(this,new _("_read()"))},I.prototype.pipe=function(e,t){var n=this,r=this._readableState;switch(r.pipesCount){case 0:r.pipes=e;break;case 1:r.pipes=[r.pipes,e];break;default:r.pipes.push(e)}r.pipesCount+=1,d("pipe count=%d opts=%j",r.pipesCount,t);var s=(!t||!1!==t.end)&&e!==i.stdout&&e!==i.stderr?c:v;function a(t,i){d("onunpipe"),t===n&&i&&!1===i.hasUnpiped&&(i.hasUnpiped=!0,d("cleanup"),e.removeListener("close",p),e.removeListener("finish",g),e.removeListener("drain",l),e.removeListener("error",f),e.removeListener("unpipe",a),n.removeListener("end",c),n.removeListener("end",v),n.removeListener("data",h),u=!0,!r.awaitDrain||e._writableState&&!e._writableState.needDrain||l())}function c(){d("onend"),e.end()}r.endEmitted?i.nextTick(s):n.once("end",s),e.on("unpipe",a);var l=function(e){return function(){var t=e._readableState;d("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&o(e,"data")&&(t.flowing=!0,N(e))}}(n);e.on("drain",l);var u=!1;function h(t){d("ondata");var i=e.write(t);d("dest.write",i),!1===i&&((1===r.pipesCount&&r.pipes===e||r.pipesCount>1&&-1!==K(r.pipes,e))&&!u&&(d("false write response, pause",r.awaitDrain),r.awaitDrain++),n.pause())}function f(t){d("onerror",t),v(),e.removeListener("error",f),0===o(e,"error")&&E(e,t)}function p(){e.removeListener("finish",g),v()}function g(){d("onfinish"),e.removeListener("close",p),v()}function v(){d("unpipe"),n.unpipe(e)}return n.on("data",h),function(e,t,i){if("function"==typeof e.prependListener)return e.prependListener(t,i);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]:e.on(t,i)}(e,"error",f),e.once("close",p),e.once("finish",g),e.emit("pipe",n),r.flowing||(d("pipe resume"),n.resume()),e},I.prototype.unpipe=function(e){var t=this._readableState,i={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,i)),this;if(!e){var n=t.pipes,r=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<r;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=K(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,i)),this},I.prototype.on=function(e,t){var n=s.prototype.on.call(this,e,t),r=this._readableState;return"data"===e?(r.readableListening=this.listenerCount("readable")>0,!1!==r.flowing&&this.resume()):"readable"===e&&(r.endEmitted||r.readableListening||(r.readableListening=r.needReadable=!0,r.flowing=!1,r.emittedReadable=!1,d("on readable",r.length,r.reading),r.length?O(this):r.reading||i.nextTick(L,this))),n},I.prototype.addListener=I.prototype.on,I.prototype.removeListener=function(e,t){var n=s.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(x,this),n},I.prototype.removeAllListeners=function(e){var t=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(x,this),t},I.prototype.resume=function(){var e=this._readableState;return e.flowing||(d("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(U,e,t))}(this,e)),e.paused=!1,this},I.prototype.pause=function(){return d("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(d("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},I.prototype.wrap=function(e){var t=this,i=this._readableState,n=!1;for(var r in e.on("end",(function(){if(d("wrapped end"),i.decoder&&!i.ended){var e=i.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(r){(d("wrapped data"),i.decoder&&(r=i.decoder.write(r)),i.objectMode&&null==r)||(i.objectMode||r&&r.length)&&(t.push(r)||(n=!0,e.pause()))})),e)void 0===this[r]&&"function"==typeof e[r]&&(this[r]=function(t){return function(){return e[t].apply(e,arguments)}}(r));for(var o=0;o<w.length;o++)e.on(w[o],this.emit.bind(this,w[o]));return this._read=function(t){d("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(I.prototype[Symbol.asyncIterator]=function(){return void 0===h&&(h=e("./internal/streams/async_iterator")),h(this)}),Object.defineProperty(I.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(I.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(I.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),I._fromList=B,Object.defineProperty(I.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(I.from=function(t,i){return void 0===f&&(f=e("./internal/streams/from")),f(I,t,i)})}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":275,"./_stream_duplex":276,"./internal/streams/async_iterator":281,"./internal/streams/buffer_list":282,"./internal/streams/destroy":283,"./internal/streams/from":285,"./internal/streams/state":287,"./internal/streams/stream":288,_process:247,buffer:68,events:109,inherits:151,"string_decoder/":289,util:20}],279:[function(e,t,i){arguments[4][54][0].apply(i,arguments)},{"../errors":275,"./_stream_duplex":276,dup:54,inherits:151}],280:[function(e,t,i){(function(i,n){(function(){"use strict";function r(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,i){var n=e.entry;e.entry=null;for(;n;){var r=n.callback;t.pendingcb--,r(i),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}var o;t.exports=I,I.WritableState=T;var s={deprecate:e("util-deprecate")},a=e("./internal/streams/stream"),c=e("buffer").Buffer,d=(void 0!==n?n:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{}).Uint8Array||function(){};var l,u=e("./internal/streams/destroy"),h=e("./internal/streams/state").getHighWaterMark,f=e("../errors").codes,p=f.ERR_INVALID_ARG_TYPE,g=f.ERR_METHOD_NOT_IMPLEMENTED,v=f.ERR_MULTIPLE_CALLBACK,m=f.ERR_STREAM_CANNOT_PIPE,y=f.ERR_STREAM_DESTROYED,b=f.ERR_STREAM_NULL_VALUES,_=f.ERR_STREAM_WRITE_AFTER_END,S=f.ERR_UNKNOWN_ENCODING,E=u.errorOrDestroy;function w(){}function T(t,n,s){o=o||e("./_stream_duplex"),t=t||{},"boolean"!=typeof s&&(s=n instanceof o),this.objectMode=!!t.objectMode,s&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=h(this,t,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===t.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var n=e._writableState,r=n.sync,o=n.writecb;if("function"!=typeof o)throw new v;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(n),t)!function(e,t,n,r,o){--t.pendingcb,n?(i.nextTick(o,r),i.nextTick(A,e,t),e._writableState.errorEmitted=!0,E(e,r)):(o(r),e._writableState.errorEmitted=!0,E(e,r),A(e,t))}(e,n,r,t,o);else{var s=C(n)||e.destroyed;s||n.corked||n.bufferProcessing||!n.bufferedRequest||M(e,n),r?i.nextTick(k,e,n,s,o):k(e,n,s,o)}}(n,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new r(this)}function I(t){var i=this instanceof(o=o||e("./_stream_duplex"));if(!i&&!l.call(I,this))return new I(t);this._writableState=new T(t,this,i),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),a.call(this)}function R(e,t,i,n,r,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new y("write")):i?e._writev(r,t.onwrite):e._write(r,o,t.onwrite),t.sync=!1}function k(e,t,i,n){i||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),A(e,t)}function M(e,t){t.bufferProcessing=!0;var i=t.bufferedRequest;if(e._writev&&i&&i.next){var n=t.bufferedRequestCount,o=new Array(n),s=t.corkedRequestsFree;s.entry=i;for(var a=0,c=!0;i;)o[a]=i,i.isBuf||(c=!1),i=i.next,a+=1;o.allBuffers=c,R(e,t,!0,t.length,o,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new r(t),t.bufferedRequestCount=0}else{for(;i;){var d=i.chunk,l=i.encoding,u=i.callback;if(R(e,t,!1,t.objectMode?1:d.length,d,l,u),i=i.next,t.bufferedRequestCount--,t.writing)break}null===i&&(t.lastBufferedRequest=null)}t.bufferedRequest=i,t.bufferProcessing=!1}function C(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function O(e,t){e._final((function(i){t.pendingcb--,i&&E(e,i),t.prefinished=!0,e.emit("prefinish"),A(e,t)}))}function A(e,t){var n=C(t);if(n&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(O,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var r=e._readableState;(!r||r.autoDestroy&&r.endEmitted)&&e.destroy()}return n}e("inherits")(I,a),T.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(T.prototype,"buffer",{get:s.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(l=Function.prototype[Symbol.hasInstance],Object.defineProperty(I,Symbol.hasInstance,{value:function(e){return!!l.call(this,e)||this===I&&(e&&e._writableState instanceof T)}})):l=function(e){return e instanceof this},I.prototype.pipe=function(){E(this,new m)},I.prototype.write=function(e,t,n){var r,o=this._writableState,s=!1,a=!o.objectMode&&(r=e,c.isBuffer(r)||r instanceof d);return a&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(n=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof n&&(n=w),o.ending?function(e,t){var n=new _;E(e,n),i.nextTick(t,n)}(this,n):(a||function(e,t,n,r){var o;return null===n?o=new b:"string"==typeof n||t.objectMode||(o=new p("chunk",["string","Buffer"],n)),!o||(E(e,o),i.nextTick(r,o),!1)}(this,o,e,n))&&(o.pendingcb++,s=function(e,t,i,n,r,o){if(!i){var s=function(e,t,i){e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,i));return t}(t,n,r);n!==s&&(i=!0,r="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var d=t.length<t.highWaterMark;d||(t.needDrain=!0);if(t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:r,isBuf:i,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else R(e,t,!1,a,n,r,o);return d}(this,o,a,e,t,n)),s},I.prototype.cork=function(){this._writableState.corked++},I.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||M(this,e))},I.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new S(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(I.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(I.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),I.prototype._write=function(e,t,i){i(new g("_write()"))},I.prototype._writev=null,I.prototype.end=function(e,t,n){var r=this._writableState;return"function"==typeof e?(n=e,e=null,t=null):"function"==typeof t&&(n=t,t=null),null!=e&&this.write(e,t),r.corked&&(r.corked=1,this.uncork()),r.ending||function(e,t,n){t.ending=!0,A(e,t),n&&(t.finished?i.nextTick(n):e.once("finish",n));t.ended=!0,e.writable=!1}(this,r,n),this},Object.defineProperty(I.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),I.prototype.destroy=u.destroy,I.prototype._undestroy=u.undestroy,I.prototype._destroy=function(e,t){t(e)}}).call(this)}).call(this,e("_process"),"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":275,"./_stream_duplex":276,"./internal/streams/destroy":283,"./internal/streams/state":287,"./internal/streams/stream":288,_process:247,buffer:68,inherits:151,"util-deprecate":293}],281:[function(e,t,i){(function(i){(function(){"use strict";var n;function r(e,t,i){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var o=e("./end-of-stream"),s=Symbol("lastResolve"),a=Symbol("lastReject"),c=Symbol("error"),d=Symbol("ended"),l=Symbol("lastPromise"),u=Symbol("handlePromise"),h=Symbol("stream");function f(e,t){return{value:e,done:t}}function p(e){var t=e[s];if(null!==t){var i=e[h].read();null!==i&&(e[l]=null,e[s]=null,e[a]=null,t(f(i,!1)))}}function g(e){i.nextTick(p,e)}var v=Object.getPrototypeOf((function(){})),m=Object.setPrototypeOf((r(n={get stream(){return this[h]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[d])return Promise.resolve(f(void 0,!0));if(this[h].destroyed)return new Promise((function(t,n){i.nextTick((function(){e[c]?n(e[c]):t(f(void 0,!0))}))}));var n,r=this[l];if(r)n=new Promise(function(e,t){return function(i,n){e.then((function(){t[d]?i(f(void 0,!0)):t[u](i,n)}),n)}}(r,this));else{var o=this[h].read();if(null!==o)return Promise.resolve(f(o,!1));n=new Promise(this[u])}return this[l]=n,n}},Symbol.asyncIterator,(function(){return this})),r(n,"return",(function(){var e=this;return new Promise((function(t,i){e[h].destroy(null,(function(e){e?i(e):t(f(void 0,!0))}))}))})),n),v);t.exports=function(e){var t,i=Object.create(m,(r(t={},h,{value:e,writable:!0}),r(t,s,{value:null,writable:!0}),r(t,a,{value:null,writable:!0}),r(t,c,{value:null,writable:!0}),r(t,d,{value:e._readableState.endEmitted,writable:!0}),r(t,u,{value:function(e,t){var n=i[h].read();n?(i[l]=null,i[s]=null,i[a]=null,e(f(n,!1))):(i[s]=e,i[a]=t)},writable:!0}),t));return i[l]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=i[a];return null!==t&&(i[l]=null,i[s]=null,i[a]=null,t(e)),void(i[c]=e)}var n=i[s];null!==n&&(i[l]=null,i[s]=null,i[a]=null,n(f(void 0,!0))),i[d]=!0})),e.on("readable",g.bind(null,i)),i}}).call(this)}).call(this,e("_process"))},{"./end-of-stream":284,_process:247}],282:[function(e,t,i){arguments[4][57][0].apply(i,arguments)},{buffer:68,dup:57,util:20}],283:[function(e,t,i){(function(e){(function(){"use strict";function i(e,t){r(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function r(e,t){e.emit("error",t)}t.exports={destroy:function(t,o){var s=this,a=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return a||c?(o?o(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(r,this,t)):e.nextTick(r,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,(function(t){!o&&t?s._writableState?s._writableState.errorEmitted?e.nextTick(n,s):(s._writableState.errorEmitted=!0,e.nextTick(i,s,t)):e.nextTick(i,s,t):o?(e.nextTick(n,s),o(t)):e.nextTick(n,s)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var i=e._readableState,n=e._writableState;i&&i.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}}).call(this)}).call(this,e("_process"))},{_process:247}],284:[function(e,t,i){arguments[4][59][0].apply(i,arguments)},{"../../../errors":275,dup:59}],285:[function(e,t,i){arguments[4][60][0].apply(i,arguments)},{dup:60}],286:[function(e,t,i){arguments[4][61][0].apply(i,arguments)},{"../../../errors":275,"./end-of-stream":284,dup:61}],287:[function(e,t,i){arguments[4][62][0].apply(i,arguments)},{"../../../errors":275,dup:62}],288:[function(e,t,i){arguments[4][63][0].apply(i,arguments)},{dup:63,events:109}],289:[function(e,t,i){"use strict";var n=e("safe-buffer").Buffer,r=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===r||!r(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=c,this.end=d,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=l,this.end=u,t=3;break;default:return this.write=h,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,i=function(e,t,i){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==i?i:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function c(e,t){if((e.length-t)%2==0){var i=e.toString("utf16le",t);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function d(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,i)}return t}function l(e,t){var i=(e.length-t)%3;return 0===i?e.toString("base64",t):(this.lastNeed=3-i,this.lastTotal=3,1===i?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-i))}function u(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}i.StringDecoder=o,o.prototype.write=function(e){if(0===e.length)return"";var t,i;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<e.length?t?t+this.text(e,i):this.text(e,i):t||""},o.prototype.end=function(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t},o.prototype.text=function(e,t){var i=function(e,t,i){var n=t.length-1;if(n<i)return 0;var r=s(t[n]);if(r>=0)return r>0&&(e.lastNeed=r-1),r;if(--n<i||-2===r)return 0;if(r=s(t[n]),r>=0)return r>0&&(e.lastNeed=r-2),r;if(--n<i||-2===r)return 0;if(r=s(t[n]),r>=0)return r>0&&(2===r?r=0:e.lastNeed=r-3),r;return 0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=i;var n=e.length-(i-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},{"safe-buffer":260}],290:[function(e,t,i){(function(t,n){(function(){var r=e("process/browser.js").nextTick,o=Function.prototype.apply,s=Array.prototype.slice,a={},c=0;function d(e,t){this._id=e,this._clearFn=t}i.setTimeout=function(){return new d(o.call(setTimeout,window,arguments),clearTimeout)},i.setInterval=function(){return new d(o.call(setInterval,window,arguments),clearInterval)},i.clearTimeout=i.clearInterval=function(e){e.close()},d.prototype.unref=d.prototype.ref=function(){},d.prototype.close=function(){this._clearFn.call(window,this._id)},i.enroll=function(e,t){clearTimeout(e._idleTimeoutId),e._idleTimeout=t},i.unenroll=function(e){clearTimeout(e._idleTimeoutId),e._idleTimeout=-1},i._unrefActive=i.active=function(e){clearTimeout(e._idleTimeoutId);var t=e._idleTimeout;t>=0&&(e._idleTimeoutId=setTimeout((function(){e._onTimeout&&e._onTimeout()}),t))},i.setImmediate="function"==typeof t?t:function(e){var t=c++,n=!(arguments.length<2)&&s.call(arguments,1);return a[t]=!0,r((function(){a[t]&&(n?e.apply(null,n):e.call(null),i.clearImmediate(t))})),t},i.clearImmediate="function"==typeof n?n:function(e){delete a[e]}}).call(this)}).call(this,e("timers").setImmediate,e("timers").clearImmediate)},{"process/browser.js":247,timers:290}],291:[function(e,t,i){t.exports={0:"O",1:"l","֭":"֖","֮":"֘","֨":"֙","֤":"֚","᪴":"ۛ","⃛":"ۛ","ؙ":"̓","ࣳ":"̓","̓":"̓","̕":"̓","ُ":"̓","ٝ":"̔","֜":"́","֝":"́","ؘ":"́","݇":"́","́":"́","॔":"́","َ":"́","̀":"̀","॓":"̀","̌":"̆","꙼":"̆","٘":"̆","ٚ":"̆","ͮ":"̆","ۨ":"̆̇","̐":"̆̇","ँ":"̆̇","ঁ":"̆̇","ઁ":"̆̇","ଁ":"̆̇","ఀ":"̆̇","ಁ":"̆̇","ഁ":"̆̇","𑒿":"̆̇","᳐":"̂","̑":"̂","ٛ":"̂","߮":"̂","꛰":"̂","֯":"̊","۟":"̊","៓":"̊","゚":"̊","ْ":"̊","ஂ":"̊","ံ":"̊","ំ":"̊","𑌀":"̊","ํ":"̊","ໍ":"̊","ͦ":"̊","ⷪ":"̊","࣫":"̈","߳":"̈","ً":"̋","ࣰ":"̋","͂":"̃","ٓ":"̃","ׄ":"̇","۬":"̇","݀":"̇","࣪":"̇","݁":"̇","͘":"̇","ֹ":"̇","ֺ":"̇","ׂ":"̇","ׁ":"̇","߭":"̇","ं":"̇","ਂ":"̇","ં":"̇","்":"̇","̷":"̸","᪷":"̨","̢":"̨","ͅ":"̨","᳒":"̄","̅":"̄","ٙ":"̄","߫":"̄","꛱":"̄","᳚":"̎","ٗ":"̒","͗":"͐","ࣿ":"͐","ࣸ":"͐","ऀ":"͒","᳭":"̖","᳜":"̩","ٖ":"̩","᳕":"̫","͇":"̳","ࣹ":"͔","ࣺ":"͕","゛":"゙","゜":"゚","̶":"̵","〬":"̉","ׅ":"̣","࣭":"̣","᳝":"̣","ִ":"̣","ٜ":"̣","़":"̣","়":"̣","਼":"̣","઼":"̣","଼":"̣","𑇊":"̣","𑓃":"̣","𐨺":"̣","࣮":"̤","᳞":"̤","༷":"̥","〭":"̥","̧":"̦","̡":"̦","̹":"̦","᳙":"̭","᳘":"̮","॒":"̱","̠":"̱","ࣱ":"ٌ","ࣨ":"ٌ","ࣥ":"ٌ","ﱞ":"ﹲّ","ࣲ":"ٍ","ﱟ":"ﹴّ","ﳲ":"ﹷّ","ﱠ":"ﹶّ","ﳳ":"ﹹّ","ﱡ":"ﹸّ","ؚ":"ِ","̗":"ِ","ﳴ":"ﹻّ","ﱢ":"ﹺّ","ﱣ":"ﹼٰ","ٟ":"ٕ","̍":"ٰ","݂":"ܼ","ਃ":"ঃ","ః":"ঃ","ಃ":"ঃ","ഃ":"ঃ","ඃ":"ঃ","း":"ঃ","𑓁":"ঃ","់":"่","່":"่","້":"้","໊":"๊","໋":"๋","꙯":"⃩","\u2028":" ","\u2029":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" "," ":" ","ߺ":"_","﹍":"_","﹎":"_","﹏":"_","‐":"-","‑":"-","‒":"-","–":"-","﹘":"-","۔":"-","⁃":"-","˗":"-","−":"-","➖":"-","Ⲻ":"-","⨩":"-̓","⸚":"-̈","﬩":"-̇","∸":"-̇","⨪":"-̣","꓾":"-.","~":"〜","؍":",","٫":",","‚":",","¸":",","ꓹ":",","⸲":"،","٬":"،",";":";","⸵":"؛","ः":":","ઃ":":",":":":","։":":","܃":":","܄":":","᛬":":","︰":":","᠃":":","᠉":":","⁚":":","׃":":","˸":":","꞉":":","∶":":","ː":":","ꓽ":":","⩴":"::=","⧴":":→","!":"!","ǃ":"!","ⵑ":"!","‼":"!!","⁉":"!?","ʔ":"?","Ɂ":"?","ॽ":"?","Ꭾ":"?","ꛫ":"?","⁈":"?!","⁇":"??","⸮":"؟","𝅭":".","․":".","܁":".","܂":".","꘎":".","𐩐":".","٠":".","۰":".","ꓸ":".","ꓻ":".,","‥":"..","ꓺ":"..","…":"...","꛴":"꛳꛳","・":"·","・":"·","᛫":"·","·":"·","⸱":"·","𐄁":"·","•":"·","‧":"·","∙":"·","⋅":"·","ꞏ":"·","ᐧ":"·","⋯":"···","ⵈ":"···","ᑄ":"·<","⋗":"·>","ᐷ":"·>","ᑀ":"·>","ᔯ":"·4","ᑾ":"·b","ᒀ":"·ḃ","ᑺ":"·d","ᒘ":"·J","ᒶ":"·L","ᑶ":"·P","ᑗ":"·U","ᐺ":"·V","ᐼ":"·Ʌ","ᒮ":"·Γ","ᐎ":"·Δ","ᑙ":"·Ո","ᐌ":"·ᐁ","ᐐ":"·ᐄ","ᐒ":"·ᐅ","ᐔ":"·ᐆ","ᐗ":"·ᐊ","ᐙ":"·ᐋ","ᐾ":"·ᐲ","ᑂ":"·ᐴ","ᑆ":"·ᐹ","ᑛ":"·ᑏ","ᑔ":"·ᑐ","ᑝ":"·ᑐ","ᑟ":"·ᑑ","ᑡ":"·ᑕ","ᑣ":"·ᑖ","ᑴ":"·ᑫ","ᑸ":"·ᑮ","ᑼ":"·ᑰ","ᒒ":"·ᒉ","ᒔ":"·ᒋ","ᒖ":"·ᒌ","ᒚ":"·ᒎ","ᒜ":"·ᒐ","ᒞ":"·ᒑ","ᒬ":"·ᒣ","ᒰ":"·ᒦ","ᒲ":"·ᒧ","ᒴ":"·ᒨ","ᒸ":"·ᒫ","ᓉ":"·ᓀ","ᣆ":"·ᓂ","ᣈ":"·ᓃ","ᣊ":"·ᓄ","ᣌ":"·ᓅ","ᓋ":"·ᓇ","ᓍ":"·ᓈ","ᓜ":"·ᓓ","ᓞ":"·ᓕ","ᓠ":"·ᓖ","ᓢ":"·ᓗ","ᓤ":"·ᓘ","ᓦ":"·ᓚ","ᓨ":"·ᓛ","ᓶ":"·ᓭ","ᓸ":"·ᓯ","ᓺ":"·ᓰ","ᓼ":"·ᓱ","ᓾ":"·ᓲ","ᔀ":"·ᓴ","ᔂ":"·ᓵ","ᔗ":"·ᔐ","ᔙ":"·ᔑ","ᔛ":"·ᔒ","ᔝ":"·ᔓ","ᔟ":"·ᔔ","ᔡ":"·ᔕ","ᔣ":"·ᔖ","ᔱ":"·ᔨ","ᔳ":"·ᔩ","ᔵ":"·ᔪ","ᔷ":"·ᔫ","ᔹ":"·ᔭ","ᔻ":"·ᔮ","ᣎ":"·ᕃ","ᣏ":"·ᕆ","ᣐ":"·ᕇ","ᣑ":"·ᕈ","ᣒ":"·ᕉ","ᣓ":"·ᕋ","ᕎ":"·ᕌ","ᕛ":"·ᕚ","ᕨ":"·ᕧ","ᢳ":"·ᢱ","ᢶ":"·ᢴ","ᢹ":"·ᢸ","ᣂ":"·ᣀ","꠰":"।","॥":"।।","᰼":"᰻᰻","။":"၊၊","᪩":"᪨᪨","᪫":"᪪᪨","᭟":"᭞᭞","𐩗":"𐩖𐩖","𑑌":"𑑋𑑋","𑙂":"𑙁𑙁","𑱂":"𑱁𑱁","᱿":"᱾᱾","՝":"'","'":"'","‘":"'","’":"'","‛":"'","′":"'","‵":"'","՚":"'","׳":"'","`":"'","`":"'","`":"'","´":"'","΄":"'","´":"'","᾽":"'","᾿":"'","῾":"'","ʹ":"'","ʹ":"'","ˈ":"'","ˊ":"'","ˋ":"'","˴":"'","ʻ":"'","ʽ":"'","ʼ":"'","ʾ":"'","ꞌ":"'","י":"'","ߴ":"'","ߵ":"'","ᑊ":"'","ᛌ":"'","𖽑":"'","𖽒":"'","᳓":"''",'"':"''",""":"''","“":"''","”":"''","‟":"''","″":"''","‶":"''","〃":"''","״":"''","˝":"''","ʺ":"''","˶":"''","ˮ":"''","ײ":"''","‴":"'''","‷":"'''","⁗":"''''","Ɓ":"'B","Ɗ":"'D","ʼn":"'n","Ƥ":"'P","Ƭ":"'T","Ƴ":"'Y","[":"(","❨":"(","❲":"(","〔":"(","﴾":"(","⸨":"((","㈠":"(ー)","⑵":"(2)","⒇":"(2O)","⑶":"(3)","⑷":"(4)","⑸":"(5)","⑹":"(6)","⑺":"(7)","⑻":"(8)","⑼":"(9)","⒜":"(a)","🄐":"(A)","⒝":"(b)","🄑":"(B)","⒞":"(c)","🄒":"(C)","⒟":"(d)","🄓":"(D)","⒠":"(e)","🄔":"(E)","⒡":"(f)","🄕":"(F)","⒢":"(g)","🄖":"(G)","⒣":"(h)","🄗":"(H)","⒤":"(i)","⒥":"(j)","🄙":"(J)","⒦":"(k)","🄚":"(K)","⑴":"(l)","🄘":"(l)","⒧":"(l)","🄛":"(L)","⑿":"(l2)","⒀":"(l3)","⒁":"(l4)","⒂":"(l5)","⒃":"(l6)","⒄":"(l7)","⒅":"(l8)","⒆":"(l9)","⑾":"(ll)","⑽":"(lO)","🄜":"(M)","⒩":"(n)","🄝":"(N)","⒪":"(o)","🄞":"(O)","⒫":"(p)","🄟":"(P)","⒬":"(q)","🄠":"(Q)","⒭":"(r)","🄡":"(R)","⒨":"(rn)","⒮":"(s)","🄢":"(S)","🄪":"(S)","⒯":"(t)","🄣":"(T)","⒰":"(u)","🄤":"(U)","⒱":"(v)","🄥":"(V)","⒲":"(w)","🄦":"(W)","⒳":"(x)","🄧":"(X)","⒴":"(y)","🄨":"(Y)","⒵":"(z)","🄩":"(Z)","㈀":"(ᄀ)","㈎":"(가)","㈁":"(ᄂ)","㈏":"(나)","㈂":"(ᄃ)","㈐":"(다)","㈃":"(ᄅ)","㈑":"(라)","㈄":"(ᄆ)","㈒":"(마)","㈅":"(ᄇ)","㈓":"(바)","㈆":"(ᄉ)","㈔":"(사)","㈇":"(ᄋ)","㈕":"(아)","㈝":"(오전)","㈞":"(오후)","㈈":"(ᄌ)","㈖":"(자)","㈜":"(주)","㈉":"(ᄎ)","㈗":"(차)","㈊":"(ᄏ)","㈘":"(카)","㈋":"(ᄐ)","㈙":"(타)","㈌":"(ᄑ)","㈚":"(파)","㈍":"(ᄒ)","㈛":"(하)","㈦":"(七)","㈢":"(三)","🉁":"(三)","㈨":"(九)","㈡":"(二)","🉂":"(二)","㈤":"(五)","㈹":"(代)","㈽":"(企)","㉁":"(休)","㈧":"(八)","㈥":"(六)","㈸":"(労)","🉇":"(勝)","㈩":"(十)","㈿":"(協)","㈴":"(名)","㈺":"(呼)","㈣":"(四)","㈯":"(土)","㈻":"(学)","🉃":"(安)","🉅":"(打)","🉈":"(敗)","㈰":"(日)","㈪":"(月)","㈲":"(有)","㈭":"(木)","🉀":"(本)","㈱":"(株)","㈬":"(水)","㈫":"(火)","🉄":"(点)","㈵":"(特)","🉆":"(盗)","㈼":"(監)","㈳":"(社)","㈷":"(祝)","㉀":"(祭)","㉂":"(自)","㉃":"(至)","㈶":"(財)","㈾":"(資)","㈮":"(金)","]":")","❩":")","❳":")","〕":")","﴿":")","⸩":"))","❴":"{","𝄔":"{","❵":"}","〚":"⟦","〛":"⟧","⟨":"❬","〈":"❬","〈":"❬","㇛":"❬","く":"❬","𡿨":"❬","⟩":"❭","〉":"❭","〉":"❭","^":"︿","⸿":"¶","⁎":"*","٭":"*","∗":"*","𐌟":"*","᜵":"/","⁁":"/","∕":"/","⁄":"/","╱":"/","⟋":"/","⧸":"/","𝈺":"/","㇓":"/","〳":"/","Ⳇ":"/","ノ":"/","丿":"/","⼃":"/","⧶":"/̄","⫽":"//","⫻":"///","\":"\\","﹨":"\\","∖":"\\","⟍":"\\","⧵":"\\","⧹":"\\","𝈏":"\\","𝈻":"\\","㇔":"\\","丶":"\\","⼂":"\\","⳹":"\\\\","⑊":"\\\\","⟈":"\\ᑕ","ꝸ":"&","૰":"॰","𑂻":"॰","𑇇":"॰","⚬":"॰","𑇛":"꣼","៙":"๏","៕":"๚","៚":"๛","༌":"་","༎":"།།","˄":"^","ˆ":"^","꙾":"ˇ","˘":"ˇ","‾":"ˉ","﹉":"ˉ","﹊":"ˉ","﹋":"ˉ","﹌":"ˉ","¯":"ˉ"," ̄":"ˉ","▔":"ˉ","ъ":"ˉb","ꙑ":"ˉbi","͵":"ˏ","˻":"˪","꜖":"˪","꜔":"˫","。":"˳","⸰":"°","˚":"°","∘":"°","○":"°","◦":"°","⍜":"°̲","⍤":"°̈","℃":"°C","℉":"°F","௵":"௳","༛":"༚༚","༟":"༚༝","࿎":"༝༚","༞":"༝༝","Ⓒ":"©","Ⓡ":"®","Ⓟ":"℗","𝈛":"⅄","⯬":"↞","⯭":"↟","⯮":"↠","⯯":"↡","↵":"↲","⥥":"⇃⇂","⥯":"⇃ᛚ","𝛛":"∂","𝜕":"∂","𝝏":"∂","𝞉":"∂","𝟃":"∂","𞣌":"∂","𞣍":"∂̵","ð":"∂̵","⌀":"∅","𝛁":"∇","𝛻":"∇","𝜵":"∇","𝝯":"∇","𝞩":"∇","𑢨":"∇","⍢":"∇̈","⍫":"∇̴","█":"∎","■":"∎","⨿":"∐","᛭":"+","➕":"+","𐊛":"+","⨣":"+̂","⨢":"+̊","⨤":"+̃","∔":"+̇","⨥":"+̣","⨦":"+̰","⨧":"+₂","➗":"÷","‹":"<","❮":"<","˂":"<","𝈶":"<","ᐸ":"<","ᚲ":"<","⋖":"<·","Ⲵ":"<·","ᑅ":"<·","≪":"<<","⋘":"<<<","᐀":"=","⹀":"=","゠":"=","꓿":"=","≚":"=̆","≙":"=̂","≗":"=̊","≐":"=̇","≑":"=̣̇","⩮":"=⃰","⩵":"==","⩶":"===","≞":"=ͫ","›":">","❯":">","˃":">","𝈷":">","ᐳ":">","𖼿":">","ᑁ":">·","⪥":"><","≫":">>","⨠":">>","⋙":">>>","⁓":"~","˜":"~","῀":"~","∼":"~","⍨":"~̈","⸞":"~̇","⩪":"~̇","⸟":"~̣","𞣈":"∠","⋀":"∧","∯":"∮∮","∰":"∮∮∮","⸫":"∴","⸪":"∵","⸬":"∷","𑇞":"≈","♎":"≏","🝞":"≏","≣":"≡","⨃":"⊍","⨄":"⊎","𝈸":"⊏","𝈹":"⊐","⨅":"⊓","⨆":"⊔","⨂":"⊗","⍟":"⊛","🝱":"⊠","🝕":"⊡","◁":"⊲","▷":"⊳","⍣":"⋆̈","︴":"⌇","◠":"⌒","⨽":"⌙","⌥":"⌤","⧇":"⌻","◎":"⌾","⦾":"⌾","⧅":"⍂","⦰":"⍉","⏃":"⍋","⏂":"⍎","⏁":"⍕","⏆":"⍭","☸":"⎈","︵":"⏜","︶":"⏝","︷":"⏞","︸":"⏟","︹":"⏠","︺":"⏡","▱":"⏥","⏼":"⏻","︱":"│","|":"│","┃":"│","┏":"┌","┣":"├","▐":"▌","▗":"▖","▝":"▘","☐":"□","■":"▪","▸":"▶","►":"▶","⳩":"☧","🜊":"☩","🌒":"☽","🌙":"☽","⏾":"☾","🌘":"☾","⧙":"⦚","🜺":"⧟","⨾":"⨟","𐆠":"⳨","♩":"𝅘𝅥","♪":"𝅘𝅥𝅮","⓪":"🄍","↺":"🄎","˙":"ॱ","ൎ":"ॱ","-":"ー","—":"ー","―":"ー","─":"ー","━":"ー","㇐":"ー","ꟷ":"ー","ᅳ":"ー","ㅡ":"ー","一":"ー","⼀":"ー","ᆖ":"ーー","ힹ":"ーᅡ","ힺ":"ーᅥ","ힻ":"ーᅥ丨","ힼ":"ーᅩ","ᆕ":"ーᅮ","ᅴ":"ー丨","ㅢ":"ー丨","ᆗ":"ー丨ᅮ","🄏":"$⃠","₤":"£","〒":"₸","〶":"₸","᭜":"᭐","꧆":"꧐","𑓑":"১","೧":"౧","ၥ":"၁","①":"➀","⑩":"➉","⏨":"₁₀","𝟐":"2","𝟚":"2","𝟤":"2","𝟮":"2","𝟸":"2","🯲":"2","Ꝛ":"2","Ƨ":"2","Ϩ":"2","Ꙅ":"2","ᒿ":"2","ꛯ":"2","ꧏ":"٢","۲":"٢","૨":"२","𑓒":"২","೨":"౨","②":"➁","ƻ":"2̵","🄃":"2,","⒉":"2.","㏵":"22日","㍮":"22点","㏶":"23日","㍯":"23点","㏷":"24日","㍰":"24点","㏸":"25日","㏹":"26日","㏺":"27日","㏻":"28日","㏼":"29日","㏴":"2l日","㍭":"2l点","⒛":"2O.","㏳":"2O日","㍬":"2O点","෩":"෨ා","෯":"෨ී","㏡":"2日","㋁":"2月","㍚":"2点","𝈆":"3","𝟑":"3","𝟛":"3","𝟥":"3","𝟯":"3","𝟹":"3","🯳":"3","Ɜ":"3","Ȝ":"3","Ʒ":"3","Ꝫ":"3","Ⳍ":"3","З":"3","Ӡ":"3","𖼻":"3","𑣊":"3","۳":"٣","𞣉":"٣","૩":"३","③":"➂","Ҙ":"3̦","🄄":"3,","⒊":"3.","㏾":"3l日","㏽":"3O日","㏢":"3日","㋂":"3月","㍛":"3点","𝟒":"4","𝟜":"4","𝟦":"4","𝟰":"4","𝟺":"4","🯴":"4","Ꮞ":"4","𑢯":"4","۴":"٤","૪":"४","④":"➃","🄅":"4,","⒋":"4.","ᔰ":"4·","㏣":"4日","㋃":"4月","㍜":"4点","𝟓":"5","𝟝":"5","𝟧":"5","𝟱":"5","𝟻":"5","🯵":"5","Ƽ":"5","𑢻":"5","⑤":"➄","🄆":"5,","⒌":"5.","㏤":"5日","㋄":"5月","㍝":"5点","𝟔":"6","𝟞":"6","𝟨":"6","𝟲":"6","𝟼":"6","🯶":"6","Ⳓ":"6","б":"6","Ꮾ":"6","𑣕":"6","۶":"٦","𑓖":"৬","⑥":"➅","🄇":"6,","⒍":"6.","㏥":"6日","㋅":"6月","㍞":"6点","𝈒":"7","𝟕":"7","𝟟":"7","𝟩":"7","𝟳":"7","𝟽":"7","🯷":"7","𐓒":"7","𑣆":"7","⑦":"➆","🄈":"7,","⒎":"7.","㏦":"7日","㋆":"7月","㍟":"7点","ଃ":"8","৪":"8","੪":"8","𞣋":"8","𝟖":"8","𝟠":"8","𝟪":"8","𝟴":"8","𝟾":"8","🯸":"8","ȣ":"8","Ȣ":"8","𐌚":"8","૮":"८","⑧":"➇","🄉":"8,","⒏":"8.","㏧":"8日","㋇":"8月","㍠":"8点","੧":"9","୨":"9","৭":"9","൭":"9","𝟗":"9","𝟡":"9","𝟫":"9","𝟵":"9","𝟿":"9","🯹":"9","Ꝯ":"9","Ⳋ":"9","𑣌":"9","𑢬":"9","𑣖":"9","१":"٩","𑣤":"٩","۹":"٩","೯":"౯","⑨":"➈","🄊":"9,","⒐":"9.","㏨":"9日","㋈":"9月","㍡":"9点","⍺":"a","a":"a","𝐚":"a","𝑎":"a","𝒂":"a","𝒶":"a","𝓪":"a","𝔞":"a","𝕒":"a","𝖆":"a","𝖺":"a","𝗮":"a","𝘢":"a","𝙖":"a","𝚊":"a","ɑ":"a","α":"a","𝛂":"a","𝛼":"a","𝜶":"a","𝝰":"a","𝞪":"a","а":"a","ⷶ":"ͣ","A":"A","𝐀":"A","𝐴":"A","𝑨":"A","𝒜":"A","𝓐":"A","𝔄":"A","𝔸":"A","𝕬":"A","𝖠":"A","𝗔":"A","𝘈":"A","𝘼":"A","𝙰":"A","Α":"A","𝚨":"A","𝛢":"A","𝜜":"A","𝝖":"A","𝞐":"A","А":"A","Ꭺ":"A","ᗅ":"A","ꓮ":"A","𖽀":"A","𐊠":"A","⍶":"a̲","ǎ":"ă","Ǎ":"Ă","ȧ":"å","Ȧ":"Å","ẚ":"ả","℀":"a/c","℁":"a/s","ꜳ":"aa","Ꜳ":"AA","æ":"ae","ӕ":"ae","Æ":"AE","Ӕ":"AE","ꜵ":"ao","Ꜵ":"AO","🜇":"AR","ꜷ":"au","Ꜷ":"AU","ꜹ":"av","ꜻ":"av","Ꜹ":"AV","Ꜻ":"AV","ꜽ":"ay","Ꜽ":"AY","ꭺ":"ᴀ","∀":"Ɐ","𝈗":"Ɐ","ᗄ":"Ɐ","ꓯ":"Ɐ","𐐟":"Ɒ","𝐛":"b","𝑏":"b","𝒃":"b","𝒷":"b","𝓫":"b","𝔟":"b","𝕓":"b","𝖇":"b","𝖻":"b","𝗯":"b","𝘣":"b","𝙗":"b","𝚋":"b","Ƅ":"b","Ь":"b","Ꮟ":"b","ᑲ":"b","ᖯ":"b","B":"B","ℬ":"B","𝐁":"B","𝐵":"B","𝑩":"B","𝓑":"B","𝔅":"B","𝔹":"B","𝕭":"B","𝖡":"B","𝗕":"B","𝘉":"B","𝘽":"B","𝙱":"B","Ꞵ":"B","Β":"B","𝚩":"B","𝛣":"B","𝜝":"B","𝝗":"B","𝞑":"B","В":"B","Ᏼ":"B","ᗷ":"B","ꓐ":"B","𐊂":"B","𐊡":"B","𐌁":"B","ɓ":"b̔","ᑳ":"ḃ","ƃ":"b̄","Ƃ":"b̄","Б":"b̄","ƀ":"b̵","ҍ":"b̵","Ҍ":"b̵","ѣ":"b̵","Ѣ":"b̵","ᑿ":"b·","ᒁ":"ḃ·","ᒈ":"b'","Ы":"bl","в":"ʙ","ᏼ":"ʙ","c":"c","ⅽ":"c","𝐜":"c","𝑐":"c","𝒄":"c","𝒸":"c","𝓬":"c","𝔠":"c","𝕔":"c","𝖈":"c","𝖼":"c","𝗰":"c","𝘤":"c","𝙘":"c","𝚌":"c","ᴄ":"c","ϲ":"c","ⲥ":"c","с":"c","ꮯ":"c","𐐽":"c","ⷭ":"ͨ","🝌":"C","𑣲":"C","𑣩":"C","C":"C","Ⅽ":"C","ℂ":"C","ℭ":"C","𝐂":"C","𝐶":"C","𝑪":"C","𝒞":"C","𝓒":"C","𝕮":"C","𝖢":"C","𝗖":"C","𝘊":"C","𝘾":"C","𝙲":"C","Ϲ":"C","Ⲥ":"C","С":"C","Ꮯ":"C","ꓚ":"C","𐊢":"C","𐌂":"C","𐐕":"C","𐔜":"C","¢":"c̸","ȼ":"c̸","₡":"C⃫","🅮":"C⃠","ç":"c̦","ҫ":"c̦","Ç":"C̦","Ҫ":"C̦","Ƈ":"C'","℅":"c/o","℆":"c/u","🅭":"㏄\t⃝","⋴":"ꞓ","ɛ":"ꞓ","ε":"ꞓ","ϵ":"ꞓ","𝛆":"ꞓ","𝛜":"ꞓ","𝜀":"ꞓ","𝜖":"ꞓ","𝜺":"ꞓ","𝝐":"ꞓ","𝝴":"ꞓ","𝞊":"ꞓ","𝞮":"ꞓ","𝟄":"ꞓ","ⲉ":"ꞓ","є":"ꞓ","ԑ":"ꞓ","ꮛ":"ꞓ","𑣎":"ꞓ","𐐩":"ꞓ","€":"Ꞓ","Ⲉ":"Ꞓ","Є":"Ꞓ","⍷":"ꞓ̲","ͽ":"ꜿ","Ͽ":"Ꜿ","ⅾ":"d","ⅆ":"d","𝐝":"d","𝑑":"d","𝒅":"d","𝒹":"d","𝓭":"d","𝔡":"d","𝕕":"d","𝖉":"d","𝖽":"d","𝗱":"d","𝘥":"d","𝙙":"d","𝚍":"d","ԁ":"d","Ꮷ":"d","ᑯ":"d","ꓒ":"d","Ⅾ":"D","ⅅ":"D","𝐃":"D","𝐷":"D","𝑫":"D","𝒟":"D","𝓓":"D","𝔇":"D","𝔻":"D","𝕯":"D","𝖣":"D","𝗗":"D","𝘋":"D","𝘿":"D","𝙳":"D","Ꭰ":"D","ᗞ":"D","ᗪ":"D","ꓓ":"D","ɗ":"d̔","ɖ":"d̨","ƌ":"d̄","đ":"d̵","Đ":"D̵","Ð":"D̵","Ɖ":"D̵","₫":"ḏ̵","ꝺ":"Ꝺ","ᑻ":"d·","ᒇ":"d'","ʤ":"dȝ","dz":"dz","ʣ":"dz","Dz":"Dz","DZ":"DZ","dž":"dž","Dž":"Dž","DŽ":"DŽ","ʥ":"dʑ","ꭰ":"ᴅ","⸹":"ẟ","δ":"ẟ","𝛅":"ẟ","𝛿":"ẟ","𝜹":"ẟ","𝝳":"ẟ","𝞭":"ẟ","ծ":"ẟ","ᕷ":"ẟ","℮":"e","e":"e","ℯ":"e","ⅇ":"e","𝐞":"e","𝑒":"e","𝒆":"e","𝓮":"e","𝔢":"e","𝕖":"e","𝖊":"e","𝖾":"e","𝗲":"e","𝘦":"e","𝙚":"e","𝚎":"e","ꬲ":"e","е":"e","ҽ":"e","ⷷ":"ͤ","⋿":"E","E":"E","ℰ":"E","𝐄":"E","𝐸":"E","𝑬":"E","𝓔":"E","𝔈":"E","𝔼":"E","𝕰":"E","𝖤":"E","𝗘":"E","𝘌":"E","𝙀":"E","𝙴":"E","Ε":"E","𝚬":"E","𝛦":"E","𝜠":"E","𝝚":"E","𝞔":"E","Е":"E","ⴹ":"E","Ꭼ":"E","ꓰ":"E","𑢦":"E","𑢮":"E","𐊆":"E","ě":"ĕ","Ě":"Ĕ","ɇ":"e̸","Ɇ":"E̸","ҿ":"ę","ꭼ":"ᴇ","ə":"ǝ","ә":"ǝ","∃":"Ǝ","ⴺ":"Ǝ","ꓱ":"Ǝ","ɚ":"ǝ˞","ᴔ":"ǝo","ꭁ":"ǝo̸","ꭂ":"ǝo̵","Ә":"Ə","𝈡":"Ɛ","ℇ":"Ɛ","Ԑ":"Ɛ","Ꮛ":"Ɛ","𖼭":"Ɛ","𐐁":"Ɛ","ᶟ":"ᵋ","ᴈ":"ɜ","з":"ɜ","ҙ":"ɜ̦","𐑂":"ɞ","ꞝ":"ʚ","𐐪":"ʚ","𝐟":"f","𝑓":"f","𝒇":"f","𝒻":"f","𝓯":"f","𝔣":"f","𝕗":"f","𝖋":"f","𝖿":"f","𝗳":"f","𝘧":"f","𝙛":"f","𝚏":"f","ꬵ":"f","ꞙ":"f","ſ":"f","ẝ":"f","ք":"f","𝈓":"F","ℱ":"F","𝐅":"F","𝐹":"F","𝑭":"F","𝓕":"F","𝔉":"F","𝔽":"F","𝕱":"F","𝖥":"F","𝗙":"F","𝘍":"F","𝙁":"F","𝙵":"F","Ꞙ":"F","Ϝ":"F","𝟊":"F","ᖴ":"F","ꓝ":"F","𑣂":"F","𑢢":"F","𐊇":"F","𐊥":"F","𐔥":"F","ƒ":"f̦","Ƒ":"F̦","ᵮ":"f̴","℻":"FAX","ff":"ff","ffi":"ffi","ffl":"ffl","fi":"fi","fl":"fl","ʩ":"fŋ","ᖵ":"Ⅎ","ꓞ":"Ⅎ","𝈰":"ꟻ","ᖷ":"ꟻ","g":"g","ℊ":"g","𝐠":"g","𝑔":"g","𝒈":"g","𝓰":"g","𝔤":"g","𝕘":"g","𝖌":"g","𝗀":"g","𝗴":"g","𝘨":"g","𝙜":"g","𝚐":"g","ɡ":"g","ᶃ":"g","ƍ":"g","ց":"g","𝐆":"G","𝐺":"G","𝑮":"G","𝒢":"G","𝓖":"G","𝔊":"G","𝔾":"G","𝕲":"G","𝖦":"G","𝗚":"G","𝘎":"G","𝙂":"G","𝙶":"G","Ԍ":"G","Ꮐ":"G","Ᏻ":"G","ꓖ":"G","ᶢ":"ᵍ","ɠ":"g̔","ǧ":"ğ","Ǧ":"Ğ","ǵ":"ģ","ǥ":"g̵","Ǥ":"G̵","Ɠ":"G'","ԍ":"ɢ","ꮐ":"ɢ","ᏻ":"ɢ","h":"h","ℎ":"h","𝐡":"h","𝒉":"h","𝒽":"h","𝓱":"h","𝔥":"h","𝕙":"h","𝖍":"h","𝗁":"h","𝗵":"h","𝘩":"h","𝙝":"h","𝚑":"h","һ":"h","հ":"h","Ꮒ":"h","H":"H","ℋ":"H","ℌ":"H","ℍ":"H","𝐇":"H","𝐻":"H","𝑯":"H","𝓗":"H","𝕳":"H","𝖧":"H","𝗛":"H","𝘏":"H","𝙃":"H","𝙷":"H","Η":"H","𝚮":"H","𝛨":"H","𝜢":"H","𝝜":"H","𝞖":"H","Ⲏ":"H","Н":"H","Ꮋ":"H","ᕼ":"H","ꓧ":"H","𐋏":"H","ᵸ":"ᴴ","ɦ":"h̔","ꚕ":"h̔","Ᏺ":"h̔","Ⱨ":"H̩","Ң":"H̩","ħ":"h̵","ℏ":"h̵","ћ":"h̵","Ħ":"H̵","Ӊ":"H̦","Ӈ":"H̦","н":"ʜ","ꮋ":"ʜ","ң":"ʜ̩","ӊ":"ʜ̦","ӈ":"ʜ̦","Ԋ":"Ƕ","ꮀ":"ⱶ","Ͱ":"Ⱶ","Ꭸ":"Ⱶ","Ꮀ":"Ⱶ","ꚱ":"Ⱶ","ꞕ":"ꜧ","˛":"i","⍳":"i","i":"i","ⅰ":"i","ℹ":"i","ⅈ":"i","𝐢":"i","𝑖":"i","𝒊":"i","𝒾":"i","𝓲":"i","𝔦":"i","𝕚":"i","𝖎":"i","𝗂":"i","𝗶":"i","𝘪":"i","𝙞":"i","𝚒":"i","ı":"i","𝚤":"i","ɪ":"i","ɩ":"i","ι":"i","ι":"i","ͺ":"i","𝛊":"i","𝜄":"i","𝜾":"i","𝝸":"i","𝞲":"i","і":"i","ꙇ":"i","ӏ":"i","ꭵ":"i","Ꭵ":"i","𑣃":"i","ⓛ":"Ⓘ","⍸":"i̲","ǐ":"ĭ","Ǐ":"Ĭ","ɨ":"i̵","ᵻ":"i̵","ᵼ":"i̵","ⅱ":"ii","ⅲ":"iii","ij":"ij","ⅳ":"iv","ⅸ":"ix","j":"j","ⅉ":"j","𝐣":"j","𝑗":"j","𝒋":"j","𝒿":"j","𝓳":"j","𝔧":"j","𝕛":"j","𝖏":"j","𝗃":"j","𝗷":"j","𝘫":"j","𝙟":"j","𝚓":"j","ϳ":"j","ј":"j","J":"J","𝐉":"J","𝐽":"J","𝑱":"J","𝒥":"J","𝓙":"J","𝔍":"J","𝕁":"J","𝕵":"J","𝖩":"J","𝗝":"J","𝘑":"J","𝙅":"J","𝙹":"J","Ʝ":"J","Ϳ":"J","Ј":"J","Ꭻ":"J","ᒍ":"J","ꓙ":"J","ɉ":"j̵","Ɉ":"J̵","ᒙ":"J·","𝚥":"ȷ","յ":"ȷ","ꭻ":"ᴊ","𝐤":"k","𝑘":"k","𝒌":"k","𝓀":"k","𝓴":"k","𝔨":"k","𝕜":"k","𝖐":"k","𝗄":"k","𝗸":"k","𝘬":"k","𝙠":"k","𝚔":"k","K":"K","K":"K","𝐊":"K","𝐾":"K","𝑲":"K","𝒦":"K","𝓚":"K","𝔎":"K","𝕂":"K","𝕶":"K","𝖪":"K","𝗞":"K","𝘒":"K","𝙆":"K","𝙺":"K","Κ":"K","𝚱":"K","𝛫":"K","𝜥":"K","𝝟":"K","𝞙":"K","Ⲕ":"K","К":"K","Ꮶ":"K","ᛕ":"K","ꓗ":"K","𐔘":"K","ƙ":"k̔","Ⱪ":"K̩","Қ":"K̩","₭":"K̵","Ꝁ":"K̵","Ҟ":"K̵","Ƙ":"K'","׀":"l","|":"l","∣":"l","⏽":"l","│":"l","١":"l","۱":"l","𐌠":"l","𞣇":"l","𝟏":"l","𝟙":"l","𝟣":"l","𝟭":"l","𝟷":"l","🯱":"l",I:"l","I":"l","Ⅰ":"l","ℐ":"l","ℑ":"l","𝐈":"l","𝐼":"l","𝑰":"l","𝓘":"l","𝕀":"l","𝕴":"l","𝖨":"l","𝗜":"l","𝘐":"l","𝙄":"l","𝙸":"l","Ɩ":"l","l":"l","ⅼ":"l","ℓ":"l","𝐥":"l","𝑙":"l","𝒍":"l","𝓁":"l","𝓵":"l","𝔩":"l","𝕝":"l","𝖑":"l","𝗅":"l","𝗹":"l","𝘭":"l","𝙡":"l","𝚕":"l","ǀ":"l","Ι":"l","𝚰":"l","𝛪":"l","𝜤":"l","𝝞":"l","𝞘":"l","Ⲓ":"l","І":"l","Ӏ":"l","ו":"l","ן":"l","ا":"l","𞸀":"l","𞺀":"l","ﺎ":"l","ﺍ":"l","ߊ":"l","ⵏ":"l","ᛁ":"l","ꓲ":"l","𖼨":"l","𐊊":"l","𐌉":"l","𝈪":"L","Ⅼ":"L","ℒ":"L","𝐋":"L","𝐿":"L","𝑳":"L","𝓛":"L","𝔏":"L","𝕃":"L","𝕷":"L","𝖫":"L","𝗟":"L","𝘓":"L","𝙇":"L","𝙻":"L","Ⳑ":"L","Ꮮ":"L","ᒪ":"L","ꓡ":"L","𖼖":"L","𑢣":"L","𑢲":"L","𐐛":"L","𐔦":"L","ﴼ":"l̋","ﴽ":"l̋","ł":"l̸","Ł":"L̸","ɭ":"l̨","Ɨ":"l̵","ƚ":"l̵","ɫ":"l̴","إ":"lٕ","ﺈ":"lٕ","ﺇ":"lٕ","ٳ":"lٕ","ŀ":"l·","Ŀ":"l·","ᒷ":"l·","🄂":"l,","⒈":"l.","ױ":"l'","⒓":"l2.","㏫":"l2日","㋋":"l2月","㍤":"l2点","⒔":"l3.","㏬":"l3日","㍥":"l3点","⒕":"l4.","㏭":"l4日","㍦":"l4点","⒖":"l5.","㏮":"l5日","㍧":"l5点","⒗":"l6.","㏯":"l6日","㍨":"l6点","⒘":"l7.","㏰":"l7日","㍩":"l7点","⒙":"l8.","㏱":"l8日","㍪":"l8点","⒚":"l9.","㏲":"l9日","㍫":"l9点","lj":"lj","IJ":"lJ","Lj":"Lj","LJ":"LJ","‖":"ll","∥":"ll","Ⅱ":"ll","ǁ":"ll","װ":"ll","𐆙":"l̵l̵","⒒":"ll.","Ⅲ":"lll","𐆘":"l̵l̵S̵","㏪":"ll日","㋊":"ll月","㍣":"ll点","Ю":"lO","⒑":"lO.","㏩":"lO日","㋉":"lO月","㍢":"lO点","ʪ":"ls","₶":"lt","Ⅳ":"lV","Ⅸ":"lX","ɮ":"lȝ","ʫ":"lz","أ":"lٴ","ﺄ":"lٴ","ﺃ":"lٴ","ٲ":"lٴ","ٵ":"lٴ","ﷳ":"lكبر","ﷲ":"lللّٰo","㏠":"l日","㋀":"l月","㍙":"l点","ⳑ":"ʟ","ꮮ":"ʟ","𐑃":"ʟ","M":"M","Ⅿ":"M","ℳ":"M","𝐌":"M","𝑀":"M","𝑴":"M","𝓜":"M","𝔐":"M","𝕄":"M","𝕸":"M","𝖬":"M","𝗠":"M","𝘔":"M","𝙈":"M","𝙼":"M","Μ":"M","𝚳":"M","𝛭":"M","𝜧":"M","𝝡":"M","𝞛":"M","Ϻ":"M","Ⲙ":"M","М":"M","Ꮇ":"M","ᗰ":"M","ᛖ":"M","ꓟ":"M","𐊰":"M","𐌑":"M","Ӎ":"M̦","🝫":"MB","ⷨ":"ᷟ","𝐧":"n","𝑛":"n","𝒏":"n","𝓃":"n","𝓷":"n","𝔫":"n","𝕟":"n","𝖓":"n","𝗇":"n","𝗻":"n","𝘯":"n","𝙣":"n","𝚗":"n","ո":"n","ռ":"n","N":"N","ℕ":"N","𝐍":"N","𝑁":"N","𝑵":"N","𝒩":"N","𝓝":"N","𝔑":"N","𝕹":"N","𝖭":"N","𝗡":"N","𝘕":"N","𝙉":"N","𝙽":"N","Ν":"N","𝚴":"N","𝛮":"N","𝜨":"N","𝝢":"N","𝞜":"N","Ⲛ":"N","ꓠ":"N","𐔓":"N","𐆎":"N̊","ɳ":"n̨","ƞ":"n̩","η":"n̩","𝛈":"n̩","𝜂":"n̩","𝜼":"n̩","𝝶":"n̩","𝞰":"n̩","Ɲ":"N̦","ᵰ":"n̴","nj":"nj","Nj":"Nj","NJ":"NJ","№":"No","ͷ":"ᴎ","и":"ᴎ","𐑍":"ᴎ","ņ":"ɲ","ం":"o","ಂ":"o","ം":"o","ං":"o","०":"o","੦":"o","૦":"o","௦":"o","౦":"o","೦":"o","൦":"o","๐":"o","໐":"o","၀":"o","٥":"o","۵":"o","o":"o","ℴ":"o","𝐨":"o","𝑜":"o","𝒐":"o","𝓸":"o","𝔬":"o","𝕠":"o","𝖔":"o","𝗈":"o","𝗼":"o","𝘰":"o","𝙤":"o","𝚘":"o","ᴏ":"o","ᴑ":"o","ꬽ":"o","ο":"o","𝛐":"o","𝜊":"o","𝝄":"o","𝝾":"o","𝞸":"o","σ":"o","𝛔":"o","𝜎":"o","𝝈":"o","𝞂":"o","𝞼":"o","ⲟ":"o","о":"o","ჿ":"o","օ":"o","ס":"o","ه":"o","𞸤":"o","𞹤":"o","𞺄":"o","ﻫ":"o","ﻬ":"o","ﻪ":"o","ﻩ":"o","ھ":"o","ﮬ":"o","ﮭ":"o","ﮫ":"o","ﮪ":"o","ہ":"o","ﮨ":"o","ﮩ":"o","ﮧ":"o","ﮦ":"o","ە":"o","ഠ":"o","ဝ":"o","𐓪":"o","𑣈":"o","𑣗":"o","𐐬":"o","߀":"O","০":"O","୦":"O","〇":"O","𑓐":"O","𑣠":"O","𝟎":"O","𝟘":"O","𝟢":"O","𝟬":"O","𝟶":"O","🯰":"O","O":"O","𝐎":"O","𝑂":"O","𝑶":"O","𝒪":"O","𝓞":"O","𝔒":"O","𝕆":"O","𝕺":"O","𝖮":"O","𝗢":"O","𝘖":"O","𝙊":"O","𝙾":"O","Ο":"O","𝚶":"O","𝛰":"O","𝜪":"O","𝝤":"O","𝞞":"O","Ⲟ":"O","О":"O","Օ":"O","ⵔ":"O","ዐ":"O","ଠ":"O","𐓂":"O","ꓳ":"O","𑢵":"O","𐊒":"O","𐊫":"O","𐐄":"O","𐔖":"O","⁰":"º","ᵒ":"º","ǒ":"ŏ","Ǒ":"Ŏ","ۿ":"ô","Ő":"Ö","ø":"o̸","ꬾ":"o̸","Ø":"O̸","ⵁ":"O̸","Ǿ":"Ó̸","ɵ":"o̵","ꝋ":"o̵","ө":"o̵","ѳ":"o̵","ꮎ":"o̵","ꮻ":"o̵","⊖":"O̵","⊝":"O̵","⍬":"O̵","𝈚":"O̵","🜔":"O̵","Ɵ":"O̵","Ꝋ":"O̵","θ":"O̵","ϑ":"O̵","𝛉":"O̵","𝛝":"O̵","𝜃":"O̵","𝜗":"O̵","𝜽":"O̵","𝝑":"O̵","𝝷":"O̵","𝞋":"O̵","𝞱":"O̵","𝟅":"O̵","Θ":"O̵","ϴ":"O̵","𝚯":"O̵","𝚹":"O̵","𝛩":"O̵","𝛳":"O̵","𝜣":"O̵","𝜭":"O̵","𝝝":"O̵","𝝧":"O̵","𝞗":"O̵","𝞡":"O̵","Ө":"O̵","Ѳ":"O̵","ⴱ":"O̵","Ꮎ":"O̵","Ꮻ":"O̵","ꭴ":"ơ","ﳙ":"oٰ","🄁":"O,","🄀":"O.","ơ":"o'","Ơ":"O'","Ꭴ":"O'","%":"º/₀","٪":"º/₀","⁒":"º/₀","‰":"º/₀₀","؉":"º/₀₀","‱":"º/₀₀₀","؊":"º/₀₀₀","œ":"oe","Œ":"OE","ɶ":"oᴇ","∞":"oo","ꝏ":"oo","ꚙ":"oo","Ꝏ":"OO","Ꚙ":"OO","ﳗ":"oج","ﱑ":"oج","ﳘ":"oم","ﱒ":"oم","ﶓ":"oمج","ﶔ":"oمم","ﱓ":"oى","ﱔ":"oى","ൟ":"oരo","တ":"oာ","㍘":"O点","ↄ":"ɔ","ᴐ":"ɔ","ͻ":"ɔ","𐑋":"ɔ","Ↄ":"Ɔ","Ͻ":"Ɔ","ꓛ":"Ɔ","𐐣":"Ɔ","ꬿ":"ɔ̸","ꭢ":"ɔe","𐐿":"ɷ","⍴":"p","p":"p","𝐩":"p","𝑝":"p","𝒑":"p","𝓅":"p","𝓹":"p","𝔭":"p","𝕡":"p","𝖕":"p","𝗉":"p","𝗽":"p","𝘱":"p","𝙥":"p","𝚙":"p","ρ":"p","ϱ":"p","𝛒":"p","𝛠":"p","𝜌":"p","𝜚":"p","𝝆":"p","𝝔":"p","𝞀":"p","𝞎":"p","𝞺":"p","𝟈":"p","ⲣ":"p","р":"p","P":"P","ℙ":"P","𝐏":"P","𝑃":"P","𝑷":"P","𝒫":"P","𝓟":"P","𝔓":"P","𝕻":"P","𝖯":"P","𝗣":"P","𝘗":"P","𝙋":"P","𝙿":"P","Ρ":"P","𝚸":"P","𝛲":"P","𝜬":"P","𝝦":"P","𝞠":"P","Ⲣ":"P","Р":"P","Ꮲ":"P","ᑭ":"P","ꓑ":"P","𐊕":"P","ƥ":"p̔","ᵽ":"p̵","ᑷ":"p·","ᒆ":"P'","ᴩ":"ᴘ","ꮲ":"ᴘ","φ":"ɸ","ϕ":"ɸ","𝛗":"ɸ","𝛟":"ɸ","𝜑":"ɸ","𝜙":"ɸ","𝝋":"ɸ","𝝓":"ɸ","𝞅":"ɸ","𝞍":"ɸ","𝞿":"ɸ","𝟇":"ɸ","ⲫ":"ɸ","ф":"ɸ","𝐪":"q","𝑞":"q","𝒒":"q","𝓆":"q","𝓺":"q","𝔮":"q","𝕢":"q","𝖖":"q","𝗊":"q","𝗾":"q","𝘲":"q","𝙦":"q","𝚚":"q","ԛ":"q","գ":"q","զ":"q","ℚ":"Q","𝐐":"Q","𝑄":"Q","𝑸":"Q","𝒬":"Q","𝓠":"Q","𝔔":"Q","𝕼":"Q","𝖰":"Q","𝗤":"Q","𝘘":"Q","𝙌":"Q","𝚀":"Q","ⵕ":"Q","ʠ":"q̔","🜀":"QE","ᶐ":"ɋ","ᴋ":"ĸ","κ":"ĸ","ϰ":"ĸ","𝛋":"ĸ","𝛞":"ĸ","𝜅":"ĸ","𝜘":"ĸ","𝜿":"ĸ","𝝒":"ĸ","𝝹":"ĸ","𝞌":"ĸ","𝞳":"ĸ","𝟆":"ĸ","ⲕ":"ĸ","к":"ĸ","ꮶ":"ĸ","қ":"ĸ̩","ҟ":"ĸ̵","𝐫":"r","𝑟":"r","𝒓":"r","𝓇":"r","𝓻":"r","𝔯":"r","𝕣":"r","𝖗":"r","𝗋":"r","𝗿":"r","𝘳":"r","𝙧":"r","𝚛":"r","ꭇ":"r","ꭈ":"r","ᴦ":"r","ⲅ":"r","г":"r","ꮁ":"r","𝈖":"R","ℛ":"R","ℜ":"R","ℝ":"R","𝐑":"R","𝑅":"R","𝑹":"R","𝓡":"R","𝕽":"R","𝖱":"R","𝗥":"R","𝘙":"R","𝙍":"R","𝚁":"R","Ʀ":"R","Ꭱ":"R","Ꮢ":"R","𐒴":"R","ᖇ":"R","ꓣ":"R","𖼵":"R","ɽ":"r̨","ɼ":"r̩","ɍ":"r̵","ғ":"r̵","ᵲ":"r̴","ґ":"r'","𑣣":"rn",m:"rn","ⅿ":"rn","𝐦":"rn","𝑚":"rn","𝒎":"rn","𝓂":"rn","𝓶":"rn","𝔪":"rn","𝕞":"rn","𝖒":"rn","𝗆":"rn","𝗺":"rn","𝘮":"rn","𝙢":"rn","𝚖":"rn","𑜀":"rn","₥":"rn̸","ɱ":"rn̦","ᵯ":"rn̴","₨":"Rs","ꭱ":"ʀ","ꮢ":"ʀ","я":"ᴙ","ᵳ":"ɾ̴","℩":"ɿ","s":"s","𝐬":"s","𝑠":"s","𝒔":"s","𝓈":"s","𝓼":"s","𝔰":"s","𝕤":"s","𝖘":"s","𝗌":"s","𝘀":"s","𝘴":"s","𝙨":"s","𝚜":"s","ꜱ":"s","ƽ":"s","ѕ":"s","ꮪ":"s","𑣁":"s","𐑈":"s","S":"S","𝐒":"S","𝑆":"S","𝑺":"S","𝒮":"S","𝓢":"S","𝔖":"S","𝕊":"S","𝕾":"S","𝖲":"S","𝗦":"S","𝘚":"S","𝙎":"S","𝚂":"S","Ѕ":"S","Տ":"S","Ꮥ":"S","Ꮪ":"S","ꓢ":"S","𖼺":"S","𐊖":"S","𐐠":"S","ʂ":"s̨","ᵴ":"s̴","ꞵ":"ß","β":"ß","ϐ":"ß","𝛃":"ß","𝛽":"ß","𝜷":"ß","𝝱":"ß","𝞫":"ß","Ᏸ":"ß","🝜":"sss","st":"st","∫":"ʃ","ꭍ":"ʃ","∑":"Ʃ","⅀":"Ʃ","Σ":"Ʃ","𝚺":"Ʃ","𝛴":"Ʃ","𝜮":"Ʃ","𝝨":"Ʃ","𝞢":"Ʃ","ⵉ":"Ʃ","∬":"ʃʃ","∭":"ʃʃʃ","⨌":"ʃʃʃʃ","𝐭":"t","𝑡":"t","𝒕":"t","𝓉":"t","𝓽":"t","𝔱":"t","𝕥":"t","𝖙":"t","𝗍":"t","𝘁":"t","𝘵":"t","𝙩":"t","𝚝":"t","⊤":"T","⟙":"T","🝨":"T","T":"T","𝐓":"T","𝑇":"T","𝑻":"T","𝒯":"T","𝓣":"T","𝔗":"T","𝕋":"T","𝕿":"T","𝖳":"T","𝗧":"T","𝘛":"T","𝙏":"T","𝚃":"T","Τ":"T","𝚻":"T","𝛵":"T","𝜯":"T","𝝩":"T","𝞣":"T","Ⲧ":"T","Т":"T","Ꭲ":"T","ꓔ":"T","𖼊":"T","𑢼":"T","𐊗":"T","𐊱":"T","𐌕":"T","ƭ":"t̔","⍡":"T̈","Ⱦ":"T̸","Ț":"Ţ","Ʈ":"T̨","Ҭ":"T̩","₮":"T⃫","ŧ":"t̵","Ŧ":"T̵","ᵵ":"t̴","Ⴀ":"Ꞇ","Ꜩ":"T3","ʨ":"tɕ","℡":"TEL","ꝷ":"tf","ʦ":"ts","ʧ":"tʃ","ꜩ":"tȝ","τ":"ᴛ","𝛕":"ᴛ","𝜏":"ᴛ","𝝉":"ᴛ","𝞃":"ᴛ","𝞽":"ᴛ","т":"ᴛ","ꭲ":"ᴛ","ҭ":"ᴛ̩","ţ":"ƫ","ț":"ƫ","Ꮏ":"ƫ","𝐮":"u","𝑢":"u","𝒖":"u","𝓊":"u","𝓾":"u","𝔲":"u","𝕦":"u","𝖚":"u","𝗎":"u","𝘂":"u","𝘶":"u","𝙪":"u","𝚞":"u","ꞟ":"u","ᴜ":"u","ꭎ":"u","ꭒ":"u","ʋ":"u","υ":"u","𝛖":"u","𝜐":"u","𝝊":"u","𝞄":"u","𝞾":"u","ս":"u","𐓶":"u","𑣘":"u","∪":"U","⋃":"U","𝐔":"U","𝑈":"U","𝑼":"U","𝒰":"U","𝓤":"U","𝔘":"U","𝕌":"U","𝖀":"U","𝖴":"U","𝗨":"U","𝘜":"U","𝙐":"U","𝚄":"U","Ս":"U","ሀ":"U","𐓎":"U","ᑌ":"U","ꓴ":"U","𖽂":"U","𑢸":"U","ǔ":"ŭ","Ǔ":"Ŭ","ᵾ":"u̵","ꮜ":"u̵","Ʉ":"U̵","Ꮜ":"U̵","ᑘ":"U·","ᑧ":"U'","ᵫ":"ue","ꭣ":"uo","ṃ":"ꭑ","պ":"ɰ","ሣ":"ɰ","℧":"Ʊ","ᘮ":"Ʊ","ᘴ":"Ʊ","ᵿ":"ʊ̵","∨":"v","⋁":"v","v":"v","ⅴ":"v","𝐯":"v","𝑣":"v","𝒗":"v","𝓋":"v","𝓿":"v","𝔳":"v","𝕧":"v","𝖛":"v","𝗏":"v","𝘃":"v","𝘷":"v","𝙫":"v","𝚟":"v","ᴠ":"v","ν":"v","𝛎":"v","𝜈":"v","𝝂":"v","𝝼":"v","𝞶":"v","ѵ":"v","ט":"v","𑜆":"v","ꮩ":"v","𑣀":"v","𝈍":"V","٧":"V","۷":"V","Ⅴ":"V","𝐕":"V","𝑉":"V","𝑽":"V","𝒱":"V","𝓥":"V","𝔙":"V","𝕍":"V","𝖁":"V","𝖵":"V","𝗩":"V","𝘝":"V","𝙑":"V","𝚅":"V","Ѵ":"V","ⴸ":"V","Ꮩ":"V","ᐯ":"V","ꛟ":"V","ꓦ":"V","𖼈":"V","𑢠":"V","𐔝":"V","𐆗":"V̵","ᐻ":"V·","🝬":"VB","ⅵ":"vi","ⅶ":"vii","ⅷ":"viii","Ⅵ":"Vl","Ⅶ":"Vll","Ⅷ":"Vlll","🜈":"Vᷤ","ᴧ":"ʌ","𐓘":"ʌ","٨":"Ʌ","۸":"Ʌ","Λ":"Ʌ","𝚲":"Ʌ","𝛬":"Ʌ","𝜦":"Ʌ","𝝠":"Ʌ","𝞚":"Ʌ","Л":"Ʌ","ⴷ":"Ʌ","𐒰":"Ʌ","ᐱ":"Ʌ","ꛎ":"Ʌ","ꓥ":"Ʌ","𖼽":"Ʌ","𐊍":"Ʌ","Ӆ":"Ʌ̦","ᐽ":"Ʌ·","ɯ":"w","𝐰":"w","𝑤":"w","𝒘":"w","𝓌":"w","𝔀":"w","𝔴":"w","𝕨":"w","𝖜":"w","𝗐":"w","𝘄":"w","𝘸":"w","𝙬":"w","𝚠":"w","ᴡ":"w","ѡ":"w","ԝ":"w","ա":"w","𑜊":"w","𑜎":"w","𑜏":"w","ꮃ":"w","𑣯":"W","𑣦":"W","𝐖":"W","𝑊":"W","𝑾":"W","𝒲":"W","𝓦":"W","𝔚":"W","𝕎":"W","𝖂":"W","𝖶":"W","𝗪":"W","𝘞":"W","𝙒":"W","𝚆":"W","Ԝ":"W","Ꮃ":"W","Ꮤ":"W","ꓪ":"W","ѽ":"w҆҇","𑓅":"ẇ","₩":"W̵","ꝡ":"w̦","ᴍ":"ʍ","м":"ʍ","ꮇ":"ʍ","ӎ":"ʍ̦","᙮":"x","×":"x","⤫":"x","⤬":"x","⨯":"x","x":"x","ⅹ":"x","𝐱":"x","𝑥":"x","𝒙":"x","𝓍":"x","𝔁":"x","𝔵":"x","𝕩":"x","𝖝":"x","𝗑":"x","𝘅":"x","𝘹":"x","𝙭":"x","𝚡":"x","х":"x","ᕁ":"x","ᕽ":"x","ⷯ":"ͯ","᙭":"X","╳":"X","𐌢":"X","𑣬":"X","X":"X","Ⅹ":"X","𝐗":"X","𝑋":"X","𝑿":"X","𝒳":"X","𝓧":"X","𝔛":"X","𝕏":"X","𝖃":"X","𝖷":"X","𝗫":"X","𝘟":"X","𝙓":"X","𝚇":"X","Ꭓ":"X","Χ":"X","𝚾":"X","𝛸":"X","𝜲":"X","𝝬":"X","𝞦":"X","Ⲭ":"X","Х":"X","ⵝ":"X","ᚷ":"X","ꓫ":"X","𐊐":"X","𐊴":"X","𐌗":"X","𐔧":"X","⨰":"ẋ","Ҳ":"X̩","𐆖":"X̵","ⅺ":"xi","ⅻ":"xii","Ⅺ":"Xl","Ⅻ":"Xll","ɣ":"y","ᶌ":"y","y":"y","𝐲":"y","𝑦":"y","𝒚":"y","𝓎":"y","𝔂":"y","𝔶":"y","𝕪":"y","𝖞":"y","𝗒":"y","𝘆":"y","𝘺":"y","𝙮":"y","𝚢":"y","ʏ":"y","ỿ":"y","ꭚ":"y","γ":"y","ℽ":"y","𝛄":"y","𝛾":"y","𝜸":"y","𝝲":"y","𝞬":"y","у":"y","ү":"y","ყ":"y","𑣜":"y","Y":"Y","𝐘":"Y","𝑌":"Y","𝒀":"Y","𝒴":"Y","𝓨":"Y","𝔜":"Y","𝕐":"Y","𝖄":"Y","𝖸":"Y","𝗬":"Y","𝘠":"Y","𝙔":"Y","𝚈":"Y","Υ":"Y","ϒ":"Y","𝚼":"Y","𝛶":"Y","𝜰":"Y","𝝪":"Y","𝞤":"Y","Ⲩ":"Y","У":"Y","Ү":"Y","Ꭹ":"Y","Ꮍ":"Y","ꓬ":"Y","𖽃":"Y","𑢤":"Y","𐊲":"Y","ƴ":"y̔","ɏ":"y̵","ұ":"y̵","¥":"Y̵","Ɏ":"Y̵","Ұ":"Y̵","ʒ":"ȝ","ꝫ":"ȝ","ⳍ":"ȝ","ӡ":"ȝ","ჳ":"ȝ","𝐳":"z","𝑧":"z","𝒛":"z","𝓏":"z","𝔃":"z","𝔷":"z","𝕫":"z","𝖟":"z","𝗓":"z","𝘇":"z","𝘻":"z","𝙯":"z","𝚣":"z","ᴢ":"z","ꮓ":"z","𑣄":"z","𐋵":"Z","𑣥":"Z","Z":"Z","ℤ":"Z","ℨ":"Z","𝐙":"Z","𝑍":"Z","𝒁":"Z","𝒵":"Z","𝓩":"Z","𝖅":"Z","𝖹":"Z","𝗭":"Z","𝘡":"Z","𝙕":"Z","𝚉":"Z","Ζ":"Z","𝚭":"Z","𝛧":"Z","𝜡":"Z","𝝛":"Z","𝞕":"Z","Ꮓ":"Z","ꓜ":"Z","𑢩":"Z","ʐ":"z̨","ƶ":"z̵","Ƶ":"Z̵","ȥ":"z̦","Ȥ":"Z̦","ᵶ":"z̴","ƿ":"þ","ϸ":"þ","Ϸ":"Þ","𐓄":"Þ","⁹":"ꝰ","ᴤ":"ƨ","ϩ":"ƨ","ꙅ":"ƨ","ь":"ƅ","ꮟ":"ƅ","ы":"ƅi","ꭾ":"ɂ","ˤ":"ˁ","ꛍ":"ʡ","⊙":"ʘ","☉":"ʘ","⨀":"ʘ","Ꙩ":"ʘ","ⵙ":"ʘ","𐓃":"ʘ","ℾ":"Γ","𝚪":"Γ","𝛤":"Γ","𝜞":"Γ","𝝘":"Γ","𝞒":"Γ","Ⲅ":"Γ","Г":"Γ","Ꮁ":"Γ","ᒥ":"Γ","𖼇":"Γ","Ғ":"Γ̵","ᒯ":"Γ·","Ґ":"Γ'","∆":"Δ","△":"Δ","🜂":"Δ","𝚫":"Δ","𝛥":"Δ","𝜟":"Δ","𝝙":"Δ","𝞓":"Δ","Ⲇ":"Δ","ⵠ":"Δ","ᐃ":"Δ","𖼚":"Δ","𐊅":"Δ","𐊣":"Δ","⍙":"Δ̲","ᐏ":"Δ·","ᐬ":"Δᐠ","𝟋":"ϝ","𝛇":"ζ","𝜁":"ζ","𝜻":"ζ","𝝵":"ζ","𝞯":"ζ","ⳤ":"ϗ","𝛌":"λ","𝜆":"λ","𝝀":"λ","𝝺":"λ","𝞴":"λ","Ⲗ":"λ","𐓛":"λ","µ":"μ","𝛍":"μ","𝜇":"μ","𝝁":"μ","𝝻":"μ","𝞵":"μ","𝛏":"ξ","𝜉":"ξ","𝝃":"ξ","𝝽":"ξ","𝞷":"ξ","𝚵":"Ξ","𝛯":"Ξ","𝜩":"Ξ","𝝣":"Ξ","𝞝":"Ξ","ϖ":"π","ℼ":"π","𝛑":"π","𝛡":"π","𝜋":"π","𝜛":"π","𝝅":"π","𝝕":"π","𝝿":"π","𝞏":"π","𝞹":"π","𝟉":"π","ᴨ":"π","п":"π","∏":"Π","ℿ":"Π","𝚷":"Π","𝛱":"Π","𝜫":"Π","𝝥":"Π","𝞟":"Π","Ⲡ":"Π","П":"Π","ꛛ":"Π","𐊭":"Ϙ","𐌒":"Ϙ","ϛ":"ς","𝛓":"ς","𝜍":"ς","𝝇":"ς","𝞁":"ς","𝞻":"ς","𝚽":"Φ","𝛷":"Φ","𝜱":"Φ","𝝫":"Φ","𝞥":"Φ","Ⲫ":"Φ","Ф":"Φ","Փ":"Φ","ቀ":"Φ","ᛰ":"Φ","𐊳":"Φ","ꭓ":"χ","ꭕ":"χ","𝛘":"χ","𝜒":"χ","𝝌":"χ","𝞆":"χ","𝟀":"χ","ⲭ":"χ","𝛙":"ψ","𝜓":"ψ","𝝍":"ψ","𝞇":"ψ","𝟁":"ψ","ѱ":"ψ","𐓹":"ψ","𝚿":"Ψ","𝛹":"Ψ","𝜳":"Ψ","𝝭":"Ψ","𝞧":"Ψ","Ⲯ":"Ψ","Ѱ":"Ψ","𐓑":"Ψ","ᛘ":"Ψ","𐊵":"Ψ","⍵":"ω","ꞷ":"ω","𝛚":"ω","𝜔":"ω","𝝎":"ω","𝞈":"ω","𝟂":"ω","ⲱ":"ω","ꙍ":"ω","Ω":"Ω","𝛀":"Ω","𝛺":"Ω","𝜴":"Ω","𝝮":"Ω","𝞨":"Ω","ᘯ":"Ω","ᘵ":"Ω","𐊶":"Ω","⍹":"ω̲","ώ":"ῴ","☰":"Ⲷ","Ⳝ":"Ϭ","җ":"ж̩","Җ":"Ж̩","𝈋":"И","Ͷ":"И","ꚡ":"И","𐐥":"И","Й":"Ѝ","Ҋ":"Ѝ̦","ѝ":"й","ҋ":"й̦","𐒼":"Ӄ","ᴫ":"л","ӆ":"л̦","ꭠ":"љ","𐓫":"ꙩ","ᷮ":"ⷬ","𐓍":"Ћ","𝈂":"Ӿ","𝈢":"Ѡ","Ꮗ":"Ѡ","ᗯ":"Ѡ","Ѽ":"Ѡ҆҇","ᣭ":"Ѡ·","Ꞷ":"Ꙍ","ӌ":"ҷ","Ӌ":"Ҷ","Ҿ":"Ҽ̨","ⲽ":"ш","Ⲽ":"Ш","Ꙑ":"Ъl","℈":"Э","🜁":"Ꙙ","𖼜":"Ꙙ","ꦒ":"ⰿ","և":"եւ","ኔ":"ձ","ﬔ":"մե","ﬕ":"մի","ﬗ":"մխ","ﬓ":"մն","∩":"Ո","⋂":"Ո","𝉅":"Ո","በ":"Ո","ᑎ":"Ո","ꓵ":"Ո","ᑚ":"Ո·","ᑨ":"Ո'","ﬖ":"վն","₽":"Ք","˓":"ՙ","ʿ":"ՙ","ℵ":"א","ﬡ":"א","אָ":"אַ","אּ":"אַ","ﭏ":"אל","ℶ":"ב","ℷ":"ג","ℸ":"ד","ﬢ":"ד","ﬣ":"ה","יּ":"יִ","ﬤ":"כ","ﬥ":"ל","ﬦ":"ם","ﬠ":"ע","ﬧ":"ר","שׂ":"שׁ","שּ":"שׁ","שּׂ":"שּׁ","ﬨ":"ת","ﺀ":"ء","۽":"ء͈","ﺂ":"آ","ﺁ":"آ","ﭑ":"ٱ","ﭐ":"ٱ","𞸁":"ب","𞸡":"ب","𞹡":"ب","𞺁":"ب","𞺡":"ب","ﺑ":"ب","ﺒ":"ب","ﺐ":"ب","ﺏ":"ب","ݑ":"بۛ","ࢶ":"بۢ","ࢡ":"بٔ","ﲠ":"بo","ﳢ":"بo","ﲜ":"بج","ﰅ":"بج","ﲝ":"بح","ﰆ":"بح","ﷂ":"بحى","ﲞ":"بخ","ﰇ":"بخ","ﳒ":"بخ","ﱋ":"بخ","ﶞ":"بخى","ﱪ":"بر","ﱫ":"بز","ﲟ":"بم","ﳡ":"بم","ﱬ":"بم","ﰈ":"بم","ﱭ":"بن","ﱮ":"بى","ﰉ":"بى","ﱯ":"بى","ﰊ":"بى","ﭔ":"ٻ","ﭕ":"ٻ","ﭓ":"ٻ","ﭒ":"ٻ","ې":"ٻ","ﯦ":"ٻ","ﯧ":"ٻ","ﯥ":"ٻ","ﯤ":"ٻ","ﭜ":"ڀ","ﭝ":"ڀ","ﭛ":"ڀ","ﭚ":"ڀ","ࢩ":"ݔ","ݧ":"ݔ","⍥":"ة","ö":"ة","ﺔ":"ة","ﺓ":"ة","ۃ":"ة","𞸕":"ت","𞸵":"ت","𞹵":"ت","𞺕":"ت","𞺵":"ت","ﺗ":"ت","ﺘ":"ت","ﺖ":"ت","ﺕ":"ت","ﲥ":"تo","ﳤ":"تo","ﲡ":"تج","ﰋ":"تج","ﵐ":"تجم","ﶠ":"تجى","ﶟ":"تجى","ﲢ":"تح","ﰌ":"تح","ﵒ":"تحج","ﵑ":"تحج","ﵓ":"تحم","ﲣ":"تخ","ﰍ":"تخ","ﵔ":"تخم","ﶢ":"تخى","ﶡ":"تخى","ﱰ":"تر","ﱱ":"تز","ﲤ":"تم","ﳣ":"تم","ﱲ":"تم","ﰎ":"تم","ﵕ":"تمج","ﵖ":"تمح","ﵗ":"تمخ","ﶤ":"تمى","ﶣ":"تمى","ﱳ":"تن","ﱴ":"تى","ﰏ":"تى","ﱵ":"تى","ﰐ":"تى","ﭠ":"ٺ","ﭡ":"ٺ","ﭟ":"ٺ","ﭞ":"ٺ","ﭤ":"ٿ","ﭥ":"ٿ","ﭣ":"ٿ","ﭢ":"ٿ","𞸂":"ج","𞸢":"ج","𞹂":"ج","𞹢":"ج","𞺂":"ج","𞺢":"ج","ﺟ":"ج","ﺠ":"ج","ﺞ":"ج","ﺝ":"ج","ﲧ":"جح","ﰕ":"جح","ﶦ":"جحى","ﶾ":"جحى","ﷻ":"جل جلlلo","ﲨ":"جم","ﰖ":"جم","ﵙ":"جمح","ﵘ":"جمح","ﶧ":"جمى","ﶥ":"جمى","ﴝ":"جى","ﴁ":"جى","ﴞ":"جى","ﴂ":"جى","ﭸ":"ڃ","ﭹ":"ڃ","ﭷ":"ڃ","ﭶ":"ڃ","ﭴ":"ڄ","ﭵ":"ڄ","ﭳ":"ڄ","ﭲ":"ڄ","ﭼ":"چ","ﭽ":"چ","ﭻ":"چ","ﭺ":"چ","ﮀ":"ڇ","ﮁ":"ڇ","ﭿ":"ڇ","ﭾ":"ڇ","𞸇":"ح","𞸧":"ح","𞹇":"ح","𞹧":"ح","𞺇":"ح","𞺧":"ح","ﺣ":"ح","ﺤ":"ح","ﺢ":"ح","ﺡ":"ح","څ":"حۛ","ځ":"حٔ","ݲ":"حٔ","ﲩ":"حج","ﰗ":"حج","ﶿ":"حجى","ﲪ":"حم","ﰘ":"حم","ﵛ":"حمى","ﵚ":"حمى","ﴛ":"حى","ﳿ":"حى","ﴜ":"حى","ﴀ":"حى","𞸗":"خ","𞸷":"خ","𞹗":"خ","𞹷":"خ","𞺗":"خ","𞺷":"خ","ﺧ":"خ","ﺨ":"خ","ﺦ":"خ","ﺥ":"خ","ﲫ":"خج","ﰙ":"خج","ﰚ":"خح","ﲬ":"خم","ﰛ":"خم","ﴟ":"خى","ﴃ":"خى","ﴠ":"خى","ﴄ":"خى","𐋡":"د","𞸃":"د","𞺃":"د","𞺣":"د","ﺪ":"د","ﺩ":"د","ڈ":"دؕ","ﮉ":"دؕ","ﮈ":"دؕ","ڎ":"دۛ","ﮇ":"دۛ","ﮆ":"دۛ","ۮ":"د̂","ࢮ":"د̤̣","𞸘":"ذ","𞺘":"ذ","𞺸":"ذ","ﺬ":"ذ","ﺫ":"ذ","ﱛ":"ذٰ","ڋ":"ڊؕ","ﮅ":"ڌ","ﮄ":"ڌ","ﮃ":"ڍ","ﮂ":"ڍ","𞸓":"ر","𞺓":"ر","𞺳":"ر","ﺮ":"ر","ﺭ":"ر","ڑ":"رؕ","ﮍ":"رؕ","ﮌ":"رؕ","ژ":"رۛ","ﮋ":"رۛ","ﮊ":"رۛ","ڒ":"ر̆","ࢹ":"ر̆̇","ۯ":"ر̂","ݬ":"رٔ","ﱜ":"رٰ","ﷶ":"رسول","﷼":"رىlل","𞸆":"ز","𞺆":"ز","𞺦":"ز","ﺰ":"ز","ﺯ":"ز","ࢲ":"ز̂","ݱ":"ڗؕ","𞸎":"س","𞸮":"س","𞹎":"س","𞹮":"س","𞺎":"س","𞺮":"س","ﺳ":"س","ﺴ":"س","ﺲ":"س","ﺱ":"س","ش":"سۛ","𞸔":"سۛ","𞸴":"سۛ","𞹔":"سۛ","𞹴":"سۛ","𞺔":"سۛ","𞺴":"سۛ","ﺷ":"سۛ","ﺸ":"سۛ","ﺶ":"سۛ","ﺵ":"سۛ","ݾ":"س̂","ﴱ":"سo","ﳨ":"سo","ﴲ":"سۛo","ﳪ":"سۛo","ﲭ":"سج","ﴴ":"سج","ﰜ":"سج","ﴭ":"سۛج","ﴷ":"سۛج","ﴥ":"سۛج","ﴉ":"سۛج","ﵝ":"سجح","ﵞ":"سجى","ﵩ":"سۛجى","ﲮ":"سح","ﴵ":"سح","ﰝ":"سح","ﴮ":"سۛح","ﴸ":"سۛح","ﴦ":"سۛح","ﴊ":"سۛح","ﵜ":"سحج","ﵨ":"سۛحم","ﵧ":"سۛحم","ﶪ":"سۛحى","ﲯ":"سخ","ﴶ":"سخ","ﰞ":"سخ","ﴯ":"سۛخ","ﴹ":"سۛخ","ﴧ":"سۛخ","ﴋ":"سۛخ","ﶨ":"سخى","ﷆ":"سخى","ﴪ":"سر","ﴎ":"سر","ﴩ":"سۛر","ﴍ":"سۛر","ﲰ":"سم","ﳧ":"سم","ﰟ":"سم","ﴰ":"سۛم","ﳩ":"سۛم","ﴨ":"سۛم","ﴌ":"سۛم","ﵡ":"سمج","ﵠ":"سمح","ﵟ":"سمح","ﵫ":"سۛمخ","ﵪ":"سۛمخ","ﵣ":"سمم","ﵢ":"سمم","ﵭ":"سۛمم","ﵬ":"سۛمم","ﴗ":"سى","ﳻ":"سى","ﴘ":"سى","ﳼ":"سى","ﴙ":"سۛى","ﳽ":"سۛى","ﴚ":"سۛى","ﳾ":"سۛى","𐋲":"ص","𞸑":"ص","𞸱":"ص","𞹑":"ص","𞹱":"ص","𞺑":"ص","𞺱":"ص","ﺻ":"ص","ﺼ":"ص","ﺺ":"ص","ﺹ":"ص","ڞ":"صۛ","ࢯ":"ص̤̣","ﲱ":"صح","ﰠ":"صح","ﵥ":"صحح","ﵤ":"صحح","ﶩ":"صحى","ﲲ":"صخ","ﴫ":"صر","ﴏ":"صر","ﷵ":"صلعم","ﷹ":"صلى","ﷰ":"صلى","ﷺ":"صلى lللo علىo وسلم","ﲳ":"صم","ﰡ":"صم","ﷅ":"صمم","ﵦ":"صمم","ﴡ":"صى","ﴅ":"صى","ﴢ":"صى","ﴆ":"صى","𞸙":"ض","𞸹":"ض","𞹙":"ض","𞹹":"ض","𞺙":"ض","𞺹":"ض","ﺿ":"ض","ﻀ":"ض","ﺾ":"ض","ﺽ":"ض","ﲴ":"ضج","ﰢ":"ضج","ﲵ":"ضح","ﰣ":"ضح","ﵮ":"ضحى","ﶫ":"ضحى","ﲶ":"ضخ","ﰤ":"ضخ","ﵰ":"ضخم","ﵯ":"ضخم","ﴬ":"ضر","ﴐ":"ضر","ﲷ":"ضم","ﰥ":"ضم","ﴣ":"ضى","ﴇ":"ضى","ﴤ":"ضى","ﴈ":"ضى","𐋨":"ط","𞸈":"ط","𞹨":"ط","𞺈":"ط","𞺨":"ط","ﻃ":"ط","ﻄ":"ط","ﻂ":"ط","ﻁ":"ط","ڟ":"طۛ","ﲸ":"طح","ﰦ":"طح","ﴳ":"طم","ﴺ":"طم","ﰧ":"طم","ﵲ":"طمح","ﵱ":"طمح","ﵳ":"طمم","ﵴ":"طمى","ﴑ":"طى","ﳵ":"طى","ﴒ":"طى","ﳶ":"طى","𞸚":"ظ","𞹺":"ظ","𞺚":"ظ","𞺺":"ظ","ﻇ":"ظ","ﻈ":"ظ","ﻆ":"ظ","ﻅ":"ظ","ﲹ":"ظم","ﴻ":"ظم","ﰨ":"ظم","؏":"ع","𞸏":"ع","𞸯":"ع","𞹏":"ع","𞹯":"ع","𞺏":"ع","𞺯":"ع","ﻋ":"ع","ﻌ":"ع","ﻊ":"ع","ﻉ":"ع","ﲺ":"عج","ﰩ":"عج","ﷄ":"عجم","ﵵ":"عجم","ﷷ":"علىo","ﲻ":"عم","ﰪ":"عم","ﵷ":"عمم","ﵶ":"عمم","ﵸ":"عمى","ﶶ":"عمى","ﴓ":"عى","ﳷ":"عى","ﴔ":"عى","ﳸ":"عى","𞸛":"غ","𞸻":"غ","𞹛":"غ","𞹻":"غ","𞺛":"غ","𞺻":"غ","ﻏ":"غ","ﻐ":"غ","ﻎ":"غ","ﻍ":"غ","ﲼ":"غج","ﰫ":"غج","ﲽ":"غم","ﰬ":"غم","ﵹ":"غمم","ﵻ":"غمى","ﵺ":"غمى","ﴕ":"غى","ﳹ":"غى","ﴖ":"غى","ﳺ":"غى","𞸐":"ف","𞸰":"ف","𞹰":"ف","𞺐":"ف","𞺰":"ف","ﻓ":"ف","ﻔ":"ف","ﻒ":"ف","ﻑ":"ف","ڧ":"ف","ﲾ":"فج","ﰭ":"فج","ﲿ":"فح","ﰮ":"فح","ﳀ":"فخ","ﰯ":"فخ","ﵽ":"فخم","ﵼ":"فخم","ﳁ":"فم","ﰰ":"فم","ﷁ":"فمى","ﱼ":"فى","ﰱ":"فى","ﱽ":"فى","ﰲ":"فى","𞸞":"ڡ","𞹾":"ڡ","ࢻ":"ڡ","ٯ":"ڡ","𞸟":"ڡ","𞹟":"ڡ","ࢼ":"ڡ","ڤ":"ڡۛ","ﭬ":"ڡۛ","ﭭ":"ڡۛ","ﭫ":"ڡۛ","ﭪ":"ڡۛ","ڨ":"ڡۛ","ࢤ":"ڢۛ","ﭰ":"ڦ","ﭱ":"ڦ","ﭯ":"ڦ","ﭮ":"ڦ","𞸒":"ق","𞸲":"ق","𞹒":"ق","𞹲":"ق","𞺒":"ق","𞺲":"ق","ﻗ":"ق","ﻘ":"ق","ﻖ":"ق","ﻕ":"ق","ﳂ":"قح","ﰳ":"قح","ﷱ":"قلى","ﳃ":"قم","ﰴ":"قم","ﶴ":"قمح","ﵾ":"قمح","ﵿ":"قمم","ﶲ":"قمى","ﱾ":"قى","ﰵ":"قى","ﱿ":"قى","ﰶ":"قى","𞸊":"ك","𞸪":"ك","𞹪":"ك","ﻛ":"ك","ﻜ":"ك","ﻚ":"ك","ﻙ":"ك","ک":"ك","ﮐ":"ك","ﮑ":"ك","ﮏ":"ك","ﮎ":"ك","ڪ":"ك","ڭ":"كۛ","ﯕ":"كۛ","ﯖ":"كۛ","ﯔ":"كۛ","ﯓ":"كۛ","ݣ":"كۛ","ﲀ":"كl","ﰷ":"كl","ﳄ":"كج","ﰸ":"كج","ﳅ":"كح","ﰹ":"كح","ﳆ":"كخ","ﰺ":"كخ","ﳇ":"كل","ﳫ":"كل","ﲁ":"كل","ﰻ":"كل","ﳈ":"كم","ﳬ":"كم","ﲂ":"كم","ﰼ":"كم","ﷃ":"كمم","ﶻ":"كمم","ﶷ":"كمى","ﲃ":"كى","ﰽ":"كى","ﲄ":"كى","ﰾ":"كى","ݢ":"ڬ","ﮔ":"گ","ﮕ":"گ","ﮓ":"گ","ﮒ":"گ","ࢰ":"گ","ڴ":"گۛ","ﮜ":"ڱ","ﮝ":"ڱ","ﮛ":"ڱ","ﮚ":"ڱ","ﮘ":"ڳ","ﮙ":"ڳ","ﮗ":"ڳ","ﮖ":"ڳ","𞸋":"ل","𞸫":"ل","𞹋":"ل","𞺋":"ل","𞺫":"ل","ﻟ":"ل","ﻠ":"ل","ﻞ":"ل","ﻝ":"ل","ڷ":"لۛ","ڵ":"ل̆","ﻼ":"لl","ﻻ":"لl","ﻺ":"لlٕ","ﻹ":"لlٕ","ﻸ":"لlٴ","ﻷ":"لlٴ","ﳍ":"لo","ﻶ":"لآ","ﻵ":"لآ","ﳉ":"لج","ﰿ":"لج","ﶃ":"لجج","ﶄ":"لجج","ﶺ":"لجم","ﶼ":"لجم","ﶬ":"لجى","ﳊ":"لح","ﱀ":"لح","ﶵ":"لحم","ﶀ":"لحم","ﶂ":"لحى","ﶁ":"لحى","ﳋ":"لخ","ﱁ":"لخ","ﶆ":"لخم","ﶅ":"لخم","ﳌ":"لم","ﳭ":"لم","ﲅ":"لم","ﱂ":"لم","ﶈ":"لمح","ﶇ":"لمح","ﶭ":"لمى","ﲆ":"لى","ﱃ":"لى","ﲇ":"لى","ﱄ":"لى","𞸌":"م","𞸬":"م","𞹬":"م","𞺌":"م","𞺬":"م","ﻣ":"م","ﻤ":"م","ﻢ":"م","ﻡ":"م","ࢧ":"مۛ","۾":"م͈","ﲈ":"مl","ﳎ":"مج","ﱅ":"مج","ﶌ":"مجح","ﶒ":"مجخ","ﶍ":"مجم","ﷀ":"مجى","ﳏ":"مح","ﱆ":"مح","ﶉ":"محج","ﶊ":"محم","ﷴ":"محمد","ﶋ":"محى","ﳐ":"مخ","ﱇ":"مخ","ﶎ":"مخج","ﶏ":"مخم","ﶹ":"مخى","ﳑ":"مم","ﲉ":"مم","ﱈ":"مم","ﶱ":"ممى","ﱉ":"مى","ﱊ":"مى","𞸍":"ن","𞸭":"ن","𞹍":"ن","𞹭":"ن","𞺍":"ن","𞺭":"ن","ﻧ":"ن","ﻨ":"ن","ﻦ":"ن","ﻥ":"ن","ݨ":"نؕ","ݩ":"ن̆","ﳖ":"نo","ﳯ":"نo","ﶸ":"نجح","ﶽ":"نجح","ﶘ":"نجم","ﶗ":"نجم","ﶙ":"نجى","ﷇ":"نجى","ﳓ":"نح","ﱌ":"نح","ﶕ":"نحم","ﶖ":"نحى","ﶳ":"نحى","ﳔ":"نخ","ﱍ":"نخ","ﲊ":"نر","ﲋ":"نز","ﳕ":"نم","ﳮ":"نم","ﲌ":"نم","ﱎ":"نم","ﶛ":"نمى","ﶚ":"نمى","ﲍ":"نن","ﲎ":"نى","ﱏ":"نى","ﲏ":"نى","ﱐ":"نى","ۂ":"ۀ","ﮥ":"ۀ","ﮤ":"ۀ","𐋤":"و","𞸅":"و","𞺅":"و","𞺥":"و","ﻮ":"و","ﻭ":"و","ࢱ":"و","ۋ":"وۛ","ﯟ":"وۛ","ﯞ":"وۛ","ۇ":"و̓","ﯘ":"و̓","ﯗ":"و̓","ۆ":"و̆","ﯚ":"و̆","ﯙ":"و̆","ۉ":"و̂","ﯣ":"و̂","ﯢ":"و̂","ۈ":"وٰ","ﯜ":"وٰ","ﯛ":"وٰ","ؤ":"وٴ","ﺆ":"وٴ","ﺅ":"وٴ","ٶ":"وٴ","ٷ":"و̓ٴ","ﯝ":"و̓ٴ","ﷸ":"وسلم","ﯡ":"ۅ","ﯠ":"ۅ","ٮ":"ى","𞸜":"ى","𞹼":"ى","ں":"ى","𞸝":"ى","𞹝":"ى","ﮟ":"ى","ﮞ":"ى","ࢽ":"ى","ﯨ":"ى","ﯩ":"ى","ﻰ":"ى","ﻯ":"ى","ي":"ى","𞸉":"ى","𞸩":"ى","𞹉":"ى","𞹩":"ى","𞺉":"ى","𞺩":"ى","ﻳ":"ى","ﻴ":"ى","ﻲ":"ى","ﻱ":"ى","ی":"ى","ﯾ":"ى","ﯿ":"ى","ﯽ":"ى","ﯼ":"ى","ے":"ى","ﮯ":"ى","ﮮ":"ى","ٹ":"ىؕ","ﭨ":"ىؕ","ﭩ":"ىؕ","ﭧ":"ىؕ","ﭦ":"ىؕ","ڻ":"ىؕ","ﮢ":"ىؕ","ﮣ":"ىؕ","ﮡ":"ىؕ","ﮠ":"ىؕ","پ":"ىۛ","ﭘ":"ىۛ","ﭙ":"ىۛ","ﭗ":"ىۛ","ﭖ":"ىۛ","ث":"ىۛ","𞸖":"ىۛ","𞸶":"ىۛ","𞹶":"ىۛ","𞺖":"ىۛ","𞺶":"ىۛ","ﺛ":"ىۛ","ﺜ":"ىۛ","ﺚ":"ىۛ","ﺙ":"ىۛ","ڽ":"ىۛ","ۑ":"ىۛ","ؿ":"ىۛ","ࢷ":"ىۛۢ","ݖ":"ى̆","ێ":"ى̆","ࢺ":"ى̆̇","ؽ":"ى̂","ࢨ":"ىٔ","ﲐ":"ىٰ","ﱝ":"ىٰ","ﳞ":"ىo","ﳱ":"ىo","ﳦ":"ىۛo","ئ":"ىٴ","ﺋ":"ىٴ","ﺌ":"ىٴ","ﺊ":"ىٴ","ﺉ":"ىٴ","ٸ":"ىٴ","ﯫ":"ىٴl","ﯪ":"ىٴl","ﲛ":"ىٴo","ﳠ":"ىٴo","ﯭ":"ىٴo","ﯬ":"ىٴo","ﯸ":"ىٴٻ","ﯷ":"ىٴٻ","ﯶ":"ىٴٻ","ﲗ":"ىٴج","ﰀ":"ىٴج","ﲘ":"ىٴح","ﰁ":"ىٴح","ﲙ":"ىٴخ","ﱤ":"ىٴر","ﱥ":"ىٴز","ﲚ":"ىٴم","ﳟ":"ىٴم","ﱦ":"ىٴم","ﰂ":"ىٴم","ﱧ":"ىٴن","ﯯ":"ىٴو","ﯮ":"ىٴو","ﯱ":"ىٴو̓","ﯰ":"ىٴو̓","ﯳ":"ىٴو̆","ﯲ":"ىٴو̆","ﯵ":"ىٴوٰ","ﯴ":"ىٴوٰ","ﯻ":"ىٴى","ﯺ":"ىٴى","ﱨ":"ىٴى","ﯹ":"ىٴى","ﰃ":"ىٴى","ﱩ":"ىٴى","ﰄ":"ىٴى","ﳚ":"ىج","ﱕ":"ىج","ﰑ":"ىۛج","ﶯ":"ىجى","ﳛ":"ىح","ﱖ":"ىح","ﶮ":"ىحى","ﳜ":"ىخ","ﱗ":"ىخ","ﲑ":"ىر","ﱶ":"ىۛر","ﲒ":"ىز","ﱷ":"ىۛز","ﳝ":"ىم","ﳰ":"ىم","ﲓ":"ىم","ﱘ":"ىم","ﲦ":"ىۛم","ﳥ":"ىۛم","ﱸ":"ىۛم","ﰒ":"ىۛم","ﶝ":"ىمم","ﶜ":"ىمم","ﶰ":"ىمى","ﲔ":"ىن","ﱹ":"ىۛن","ﲕ":"ىى","ﱙ":"ىى","ﲖ":"ىى","ﱚ":"ىى","ﱺ":"ىۛى","ﰓ":"ىۛى","ﱻ":"ىۛى","ﰔ":"ىۛى","ﮱ":"ۓ","ﮰ":"ۓ","𐊸":"ⵀ","⁞":"ⵂ","⸽":"ⵂ","⦙":"ⵂ","︙":"ⵗ","⁝":"ⵗ","⋮":"ⵗ","Մ":"ሆ","Ռ":"ቡ","Ի":"ኮ","Պ":"ጣ","आ":"अा","ऒ":"अाॆ","ओ":"अाे","औ":"अाै","ऄ":"अॆ","ऑ":"अॉ","ऍ":"एॅ","ऎ":"एॆ","ऐ":"एे","ई":"र्इ","ઽ":"ऽ","𑇜":"ꣻ","𑇋":"ऺ","ુ":"ु","ૂ":"ू","ੋ":"ॆ","੍":"्","્":"्","আ":"অা","ৠ":"ঋৃ","ৡ":"ঋৃ","𑒒":"ঘ","𑒔":"চ","𑒖":"জ","𑒘":"ঞ","𑒙":"ট","𑒛":"ড","𑒪":"ণ","𑒞":"ত","𑒟":"থ","𑒠":"দ","𑒡":"ধ","𑒢":"ন","𑒣":"প","𑒩":"ব","𑒧":"ম","𑒨":"য","𑒫":"র","𑒝":"ল","𑒭":"ষ","𑒮":"স","𑓄":"ঽ","𑒰":"া","𑒱":"ি","𑒹":"ে","𑒼":"ো","𑒾":"ৌ","𑓂":"্","𑒽":"ৗ","ਉ":"ੳੁ","ਊ":"ੳੂ","ਆ":"ਅਾ","ਐ":"ਅੈ","ਔ":"ਅੌ","ਇ":"ੲਿ","ਈ":"ੲੀ","ਏ":"ੲੇ","આ":"અા","ઑ":"અાૅ","ઓ":"અાે","ઔ":"અાૈ","ઍ":"અૅ","એ":"અે","ઐ":"અૈ","ଆ":"ଅା","௮":"அ","ர":"ஈ","ா":"ஈ","௫":"ஈு","௨":"உ","ഉ":"உ","ஊ":"உள","ഊ":"உൗ","௭":"எ","௷":"எவ","ஜ":"ஐ","ജ":"ஐ","௧":"க","௪":"ச","௬":"சு","௲":"சூ","ഺ":"டி","ണ":"ண","௺":"நீ","௴":"மீ","௰":"ய","ഴ":"ழ","ௗ":"ள","ை":"ன","ശ":"ஶ","௸":"ஷ","ി":"ி","ീ":"ி","ொ":"ெஈ","ௌ":"ெள","ோ":"ேஈ","ಅ":"అ","ಆ":"ఆ","ಇ":"ఇ","ౠ":"ఋా","ౡ":"ఌా","ಒ":"ఒ","ఔ":"ఒౌ","ಔ":"ఒౌ","ఓ":"ఒౕ","ಓ":"ఒౕ","ಜ":"జ","ಞ":"ఞ","ఢ":"డ̣","ಣ":"ణ","థ":"ధּ","భ":"బ̣","ಯ":"య","ఠ":"రּ","ಱ":"ఱ","ಲ":"ల","ష":"వ̣","హ":"వా","మ":"వు","ూ":"ుా","ౄ":"ృా","ೡ":"ಌಾ","ഈ":"ഇൗ","ഐ":"എെ","ഓ":"ഒാ","ഔ":"ഒൗ","ൡ":"ഞ","൫":"ദ്ര","൹":"നു","ഌ":"നു","ങ":"നു","൯":"ന്","ൻ":"ന്","൬":"ന്ന","൚":"ന്മ","റ":"ര","൪":"ര്","ർ":"ര്","൮":"വ്ര","൶":"ഹ്മ","ൂ":"ു","ൃ":"ു","ൈ":"െെ","෪":"ජ","෫":"ද","𑐓":"𑐴𑑂𑐒","𑐙":"𑐴𑑂𑐘","𑐤":"𑐴𑑂𑐣","𑐪":"𑐴𑑂𑐩","𑐭":"𑐴𑑂𑐬","𑐯":"𑐴𑑂𑐮","𑗘":"𑖂","𑗙":"𑖂","𑗚":"𑖃","𑗛":"𑖄","𑗜":"𑖲","𑗝":"𑖳","ฃ":"ข","ด":"ค","ต":"ค","ม":"ฆ","ຈ":"จ","ซ":"ช","ฏ":"ฎ","ท":"ฑ","ບ":"บ","ປ":"ป","ຝ":"ฝ","ພ":"พ","ຟ":"ฟ","ฦ":"ภ","ຍ":"ย","។":"ฯ","ๅ":"า","ำ":"̊า","ិ":"ิ","ី":"ี","ឹ":"ึ","ឺ":"ื","ຸ":"ุ","ູ":"ู","แ":"เเ","ໜ":"ຫນ","ໝ":"ຫມ","ຳ":"̊າ","༂":"འུྂཿ","༃":"འུྂ༔","ཪ":"ར","ༀ":"ཨོཾ","ཷ":"ྲཱྀ","ཹ":"ླཱྀ","𑲲":"𑲪","ႁ":"ဂှ","က":"ဂာ","ၰ":"ဃှ","ၦ":"ပှ","ဟ":"ပာ","ၯ":"ပာှ","ၾ":"ၽှ","ဩ":"သြ","ဪ":"သြော်","႞":"ႃ̊","ឣ":"អ","᧐":"ᦞ","᧑":"ᦱ","᪀":"ᩅ","᪐":"ᩅ","꩓":"ꨁ","꩖":"ꨣ","᭒":"ᬍ","᭓":"ᬑ","᭘":"ᬨ","ꦣ":"ꦝ","ᢖ":"ᡜ","ᡕ":"ᠵ","ῶ":"Ꮿ","ᐍ":"ᐁ·","ᐫ":"ᐁᐠ","ᐑ":"ᐄ·","ᐓ":"ᐅ·","ᐭ":"ᐅᐠ","ᐕ":"ᐆ·","ᐘ":"ᐊ·","ᐮ":"ᐊᐠ","ᐚ":"ᐋ·","ᣝ":"ᐞᣟ","ᓑ":"ᐡ","ᕀ":"ᐩ","ᐿ":"ᐲ·","ᑃ":"ᐴ·","⍩":"ᐵ","ᑇ":"ᐹ·","ᑜ":"ᑏ·","⸧":"ᑐ","⊃":"ᑐ","ᑞ":"ᑐ·","ᑩ":"ᑐ'","⟉":"ᑐ/","⫗":"ᑐᑕ","ᑠ":"ᑑ·","⸦":"ᑕ","⊂":"ᑕ","ᑢ":"ᑕ·","ᑪ":"ᑕ'","ᑤ":"ᑖ·","ᑵ":"ᑫ·","ᒅ":"ᑫ'","ᑹ":"ᑮ·","ᑽ":"ᑰ·","ᘃ":"ᒉ","ᒓ":"ᒉ·","ᒕ":"ᒋ·","ᒗ":"ᒌ·","ᒛ":"ᒎ·","ᘂ":"ᒐ","ᒝ":"ᒐ·","ᒟ":"ᒑ·","ᒭ":"ᒣ·","ᒱ":"ᒦ·","ᒳ":"ᒧ·","ᒵ":"ᒨ·","ᒹ":"ᒫ·","ᓊ":"ᓀ·","ᣇ":"ᓂ·","ᣉ":"ᓃ·","ᣋ":"ᓄ·","ᣍ":"ᓅ·","ᓌ":"ᓇ·","ᓎ":"ᓈ·","ᘄ":"ᓓ","ᓝ":"ᓓ·","ᓟ":"ᓕ·","ᓡ":"ᓖ·","ᓣ":"ᓗ·","ᓥ":"ᓘ·","ᘇ":"ᓚ","ᓧ":"ᓚ·","ᓩ":"ᓛ·","ᓷ":"ᓭ·","ᓹ":"ᓯ·","ᓻ":"ᓰ·","ᓽ":"ᓱ·","ᓿ":"ᓲ·","ᔁ":"ᓴ·","ᔃ":"ᓵ·","ᔌ":"ᔋ<","ᔎ":"ᔋb","ᔍ":"ᔋᑕ","ᔏ":"ᔋᒐ","ᔘ":"ᔐ·","ᔚ":"ᔑ·","ᔜ":"ᔒ·","ᔞ":"ᔓ·","ᔠ":"ᔔ·","ᔢ":"ᔕ·","ᔤ":"ᔖ·","ᔲ":"ᔨ·","ᔴ":"ᔩ·","ᔶ":"ᔪ·","ᔸ":"ᔫ·","ᔺ":"ᔭ·","ᔼ":"ᔮ·","ᘢ":"ᕃ","ᣠ":"ᕃ·","ᘣ":"ᕆ","ᘤ":"ᕊ","ᕏ":"ᕌ·","ᖃ":"ᕐb","ᖄ":"ᕐḃ","ᖁ":"ᕐd","ᕿ":"ᕐP","ᙯ":"ᕐᑫ","ᕾ":"ᕐᑬ","ᖀ":"ᕐᑮ","ᖂ":"ᕐᑰ","ᖅ":"ᕐᒃ","ᕜ":"ᕚ·","ᣣ":"ᕞ·","ᣤ":"ᕦ·","ᕩ":"ᕧ·","ᣥ":"ᕫ·","ᣨ":"ᖆ·","ᖑ":"ᖕJ","ᙰ":"ᖕᒉ","ᖎ":"ᖕᒊ","ᖏ":"ᖕᒋ","ᖐ":"ᖕᒌ","ᖒ":"ᖕᒎ","ᖓ":"ᖕᒐ","ᖔ":"ᖕᒑ","ᙳ":"ᖖJ","ᙱ":"ᖖᒋ","ᙲ":"ᖖᒌ","ᙴ":"ᖖᒎ","ᙵ":"ᖖᒐ","ᙶ":"ᖖᒑ","ᣪ":"ᖗ·","ᙷ":"ᖧ·","ᙸ":"ᖨ·","ᙹ":"ᖩ·","ᙺ":"ᖪ·","ᙻ":"ᖫ·","ᙼ":"ᖬ·","ᙽ":"ᖭ·","⪫":"ᗒ","⪪":"ᗕ","ꓷ":"ᗡ","ᣰ":"ᗴ·","ᣲ":"ᘛ·","ᶻ":"ᙆ","ꓭ":"ᙠ","ᶺ":"ᣔ","ᴾ":"ᣖ","ᣜ":"ᣟᐞ","ˡ":"ᣳ","ʳ":"ᣴ","ˢ":"ᣵ","ᣛ":"ᣵ","ꚰ":"ᚹ","ᛡ":"ᚼ","⍿":"ᚽ","ᛂ":"ᚽ","𝈿":"ᛋ","↑":"ᛏ","↿":"ᛐ","⥮":"ᛐ⇂","⥣":"ᛐᛚ","ⵣ":"ᛯ","↾":"ᛚ","⨡":"ᛚ","⋄":"ᛜ","◇":"ᛜ","◊":"ᛜ","♢":"ᛜ","🝔":"ᛜ","𑢷":"ᛜ","𐊔":"ᛜ","⍚":"ᛜ̲","⋈":"ᛞ","⨝":"ᛞ","𐓐":"ᛦ","↕":"ᛨ","𐳼":"𐲂","𐳺":"𐲥","ㄱ":"ᄀ","ᆨ":"ᄀ","ᄁ":"ᄀᄀ","ㄲ":"ᄀᄀ","ᆩ":"ᄀᄀ","ᇺ":"ᄀᄂ","ᅚ":"ᄀᄃ","ᇃ":"ᄀᄅ","ᇻ":"ᄀᄇ","ᆪ":"ᄀᄉ","ㄳ":"ᄀᄉ","ᇄ":"ᄀᄉᄀ","ᇼ":"ᄀᄎ","ᇽ":"ᄀᄏ","ᇾ":"ᄀᄒ","ㄴ":"ᄂ","ᆫ":"ᄂ","ᄓ":"ᄂᄀ","ᇅ":"ᄂᄀ","ᄔ":"ᄂᄂ","ㅥ":"ᄂᄂ","ᇿ":"ᄂᄂ","ᄕ":"ᄂᄃ","ㅦ":"ᄂᄃ","ᇆ":"ᄂᄃ","ퟋ":"ᄂᄅ","ᄖ":"ᄂᄇ","ᅛ":"ᄂᄉ","ᇇ":"ᄂᄉ","ㅧ":"ᄂᄉ","ᅜ":"ᄂᄌ","ᆬ":"ᄂᄌ","ㄵ":"ᄂᄌ","ퟌ":"ᄂᄎ","ᇉ":"ᄂᄐ","ᅝ":"ᄂᄒ","ᆭ":"ᄂᄒ","ㄶ":"ᄂᄒ","ᇈ":"ᄂᅀ","ㅨ":"ᄂᅀ","ㄷ":"ᄃ","ᆮ":"ᄃ","ᄗ":"ᄃᄀ","ᇊ":"ᄃᄀ","ᄄ":"ᄃᄃ","ㄸ":"ᄃᄃ","ퟍ":"ᄃᄃ","ퟎ":"ᄃᄃᄇ","ᅞ":"ᄃᄅ","ᇋ":"ᄃᄅ","ꥠ":"ᄃᄆ","ꥡ":"ᄃᄇ","ퟏ":"ᄃᄇ","ꥢ":"ᄃᄉ","ퟐ":"ᄃᄉ","ퟑ":"ᄃᄉᄀ","ꥣ":"ᄃᄌ","ퟒ":"ᄃᄌ","ퟓ":"ᄃᄎ","ퟔ":"ᄃᄐ","ㄹ":"ᄅ","ᆯ":"ᄅ","ꥤ":"ᄅᄀ","ᆰ":"ᄅᄀ","ㄺ":"ᄅᄀ","ꥥ":"ᄅᄀᄀ","ퟕ":"ᄅᄀᄀ","ᇌ":"ᄅᄀᄉ","ㅩ":"ᄅᄀᄉ","ퟖ":"ᄅᄀᄒ","ᄘ":"ᄅᄂ","ᇍ":"ᄅᄂ","ꥦ":"ᄅᄃ","ᇎ":"ᄅᄃ","ㅪ":"ᄅᄃ","ꥧ":"ᄅᄃᄃ","ᇏ":"ᄅᄃᄒ","ᄙ":"ᄅᄅ","ᇐ":"ᄅᄅ","ퟗ":"ᄅᄅᄏ","ꥨ":"ᄅᄆ","ᆱ":"ᄅᄆ","ㄻ":"ᄅᄆ","ᇑ":"ᄅᄆᄀ","ᇒ":"ᄅᄆᄉ","ퟘ":"ᄅᄆᄒ","ꥩ":"ᄅᄇ","ᆲ":"ᄅᄇ","ㄼ":"ᄅᄇ","ퟙ":"ᄅᄇᄃ","ꥪ":"ᄅᄇᄇ","ᇓ":"ᄅᄇᄉ","ㅫ":"ᄅᄇᄉ","ꥫ":"ᄅᄇᄋ","ᇕ":"ᄅᄇᄋ","ퟚ":"ᄅᄇᄑ","ᇔ":"ᄅᄇᄒ","ꥬ":"ᄅᄉ","ᆳ":"ᄅᄉ","ㄽ":"ᄅᄉ","ᇖ":"ᄅᄉᄉ","ᄛ":"ᄅᄋ","ퟝ":"ᄅᄋ","ꥭ":"ᄅᄌ","ꥮ":"ᄅᄏ","ᇘ":"ᄅᄏ","ᆴ":"ᄅᄐ","ㄾ":"ᄅᄐ","ᆵ":"ᄅᄑ","ㄿ":"ᄅᄑ","ᄚ":"ᄅᄒ","ㅀ":"ᄅᄒ","ᄻ":"ᄅᄒ","ᆶ":"ᄅᄒ","ퟲ":"ᄅᄒ","ᇗ":"ᄅᅀ","ㅬ":"ᄅᅀ","ퟛ":"ᄅᅌ","ᇙ":"ᄅᅙ","ㅭ":"ᄅᅙ","ퟜ":"ᄅᅙᄒ","ㅁ":"ᄆ","ᆷ":"ᄆ","ꥯ":"ᄆᄀ","ᇚ":"ᄆᄀ","ퟞ":"ᄆᄂ","ퟟ":"ᄆᄂᄂ","ꥰ":"ᄆᄃ","ᇛ":"ᄆᄅ","ퟠ":"ᄆᄆ","ᄜ":"ᄆᄇ","ㅮ":"ᄆᄇ","ᇜ":"ᄆᄇ","ퟡ":"ᄆᄇᄉ","ꥱ":"ᄆᄉ","ᇝ":"ᄆᄉ","ㅯ":"ᄆᄉ","ᇞ":"ᄆᄉᄉ","ᄝ":"ᄆᄋ","ㅱ":"ᄆᄋ","ᇢ":"ᄆᄋ","ퟢ":"ᄆᄌ","ᇠ":"ᄆᄎ","ᇡ":"ᄆᄒ","ᇟ":"ᄆᅀ","ㅰ":"ᄆᅀ","ㅂ":"ᄇ","ᆸ":"ᄇ","ᄞ":"ᄇᄀ","ㅲ":"ᄇᄀ","ᄟ":"ᄇᄂ","ᄠ":"ᄇᄃ","ㅳ":"ᄇᄃ","ퟣ":"ᄇᄃ","ᇣ":"ᄇᄅ","ퟤ":"ᄇᄅᄑ","ퟥ":"ᄇᄆ","ᄈ":"ᄇᄇ","ㅃ":"ᄇᄇ","ퟦ":"ᄇᄇ","ᄬ":"ᄇᄇᄋ","ㅹ":"ᄇᄇᄋ","ᄡ":"ᄇᄉ","ㅄ":"ᄇᄉ","ᆹ":"ᄇᄉ","ᄢ":"ᄇᄉᄀ","ㅴ":"ᄇᄉᄀ","ᄣ":"ᄇᄉᄃ","ㅵ":"ᄇᄉᄃ","ퟧ":"ᄇᄉᄃ","ᄤ":"ᄇᄉᄇ","ᄥ":"ᄇᄉᄉ","ᄦ":"ᄇᄉᄌ","ꥲ":"ᄇᄉᄐ","ᄫ":"ᄇᄋ","ㅸ":"ᄇᄋ","ᇦ":"ᄇᄋ","ᄧ":"ᄇᄌ","ㅶ":"ᄇᄌ","ퟨ":"ᄇᄌ","ᄨ":"ᄇᄎ","ퟩ":"ᄇᄎ","ꥳ":"ᄇᄏ","ᄩ":"ᄇᄐ","ㅷ":"ᄇᄐ","ᄪ":"ᄇᄑ","ᇤ":"ᄇᄑ","ꥴ":"ᄇᄒ","ᇥ":"ᄇᄒ","ㅅ":"ᄉ","ᆺ":"ᄉ","ᄭ":"ᄉᄀ","ㅺ":"ᄉᄀ","ᇧ":"ᄉᄀ","ᄮ":"ᄉᄂ","ㅻ":"ᄉᄂ","ᄯ":"ᄉᄃ","ㅼ":"ᄉᄃ","ᇨ":"ᄉᄃ","ᄰ":"ᄉᄅ","ᇩ":"ᄉᄅ","ᄱ":"ᄉᄆ","ퟪ":"ᄉᄆ","ᄲ":"ᄉᄇ","ㅽ":"ᄉᄇ","ᇪ":"ᄉᄇ","ᄳ":"ᄉᄇᄀ","ퟫ":"ᄉᄇᄋ","ᄊ":"ᄉᄉ","ㅆ":"ᄉᄉ","ᆻ":"ᄉᄉ","ퟬ":"ᄉᄉᄀ","ퟭ":"ᄉᄉᄃ","ꥵ":"ᄉᄉᄇ","ᄴ":"ᄉᄉᄉ","ᄵ":"ᄉᄋ","ᄶ":"ᄉᄌ","ㅾ":"ᄉᄌ","ퟯ":"ᄉᄌ","ᄷ":"ᄉᄎ","ퟰ":"ᄉᄎ","ᄸ":"ᄉᄏ","ᄹ":"ᄉᄐ","ퟱ":"ᄉᄐ","ᄺ":"ᄉᄑ","ퟮ":"ᄉᅀ","ㅇ":"ᄋ","ᆼ":"ᄋ","ᅁ":"ᄋᄀ","ᇬ":"ᄋᄀ","ᇭ":"ᄋᄀᄀ","ᅂ":"ᄋᄃ","ꥶ":"ᄋᄅ","ᅃ":"ᄋᄆ","ᅄ":"ᄋᄇ","ᅅ":"ᄋᄉ","ᇱ":"ᄋᄉ","ㆂ":"ᄋᄉ","ᅇ":"ᄋᄋ","ㆀ":"ᄋᄋ","ᇮ":"ᄋᄋ","ᅈ":"ᄋᄌ","ᅉ":"ᄋᄎ","ᇯ":"ᄋᄏ","ᅊ":"ᄋᄐ","ᅋ":"ᄋᄑ","ꥷ":"ᄋᄒ","ᅆ":"ᄋᅀ","ᇲ":"ᄋᅀ","ㆃ":"ᄋᅀ","ㅈ":"ᄌ","ᆽ":"ᄌ","ퟷ":"ᄌᄇ","ퟸ":"ᄌᄇᄇ","ᅍ":"ᄌᄋ","ᄍ":"ᄌᄌ","ㅉ":"ᄌᄌ","ퟹ":"ᄌᄌ","ꥸ":"ᄌᄌᄒ","ㅊ":"ᄎ","ᆾ":"ᄎ","ᅒ":"ᄎᄏ","ᅓ":"ᄎᄒ","ㅋ":"ᄏ","ᆿ":"ᄏ","ㅌ":"ᄐ","ᇀ":"ᄐ","ꥹ":"ᄐᄐ","ㅍ":"ᄑ","ᇁ":"ᄑ","ᅖ":"ᄑᄇ","ᇳ":"ᄑᄇ","ퟺ":"ᄑᄉ","ᅗ":"ᄑᄋ","ㆄ":"ᄑᄋ","ᇴ":"ᄑᄋ","ퟻ":"ᄑᄐ","ꥺ":"ᄑᄒ","ㅎ":"ᄒ","ᇂ":"ᄒ","ᇵ":"ᄒᄂ","ᇶ":"ᄒᄅ","ᇷ":"ᄒᄆ","ᇸ":"ᄒᄇ","ꥻ":"ᄒᄉ","ᅘ":"ᄒᄒ","ㆅ":"ᄒᄒ","ᄽ":"ᄼᄼ","ᄿ":"ᄾᄾ","ㅿ":"ᅀ","ᇫ":"ᅀ","ퟳ":"ᅀᄇ","ퟴ":"ᅀᄇᄋ","ㆁ":"ᅌ","ᇰ":"ᅌ","ퟵ":"ᅌᄆ","ퟶ":"ᅌᄒ","ᅏ":"ᅎᅎ","ᅑ":"ᅐᅐ","ㆆ":"ᅙ","ᇹ":"ᅙ","ꥼ":"ᅙᅙ","ㅤ":"ᅠ","ㅏ":"ᅡ","ᆣ":"ᅡー","ᅶ":"ᅡᅩ","ᅷ":"ᅡᅮ","ᅢ":"ᅡ丨","ㅐ":"ᅡ丨","ㅑ":"ᅣ","ᅸ":"ᅣᅩ","ᅹ":"ᅣᅭ","ᆤ":"ᅣᅮ","ᅤ":"ᅣ丨","ㅒ":"ᅣ丨","ㅓ":"ᅥ","ᅼ":"ᅥー","ᅺ":"ᅥᅩ","ᅻ":"ᅥᅮ","ᅦ":"ᅥ丨","ㅔ":"ᅥ丨","ㅕ":"ᅧ","ᆥ":"ᅧᅣ","ᅽ":"ᅧᅩ","ᅾ":"ᅧᅮ","ᅨ":"ᅧ丨","ㅖ":"ᅧ丨","ㅗ":"ᅩ","ᅪ":"ᅩᅡ","ㅘ":"ᅩᅡ","ᅫ":"ᅩᅡ丨","ㅙ":"ᅩᅡ丨","ᆦ":"ᅩᅣ","ᆧ":"ᅩᅣ丨","ᅿ":"ᅩᅥ","ᆀ":"ᅩᅥ丨","ힰ":"ᅩᅧ","ᆁ":"ᅩᅧ丨","ᆂ":"ᅩᅩ","ힱ":"ᅩᅩ丨","ᆃ":"ᅩᅮ","ᅬ":"ᅩ丨","ㅚ":"ᅩ丨","ㅛ":"ᅭ","ힲ":"ᅭᅡ","ힳ":"ᅭᅡ丨","ᆄ":"ᅭᅣ","ㆇ":"ᅭᅣ","ᆆ":"ᅭᅣ","ᆅ":"ᅭᅣ丨","ㆈ":"ᅭᅣ丨","ힴ":"ᅭᅥ","ᆇ":"ᅭᅩ","ᆈ":"ᅭ丨","ㆉ":"ᅭ丨","ㅜ":"ᅮ","ᆉ":"ᅮᅡ","ᆊ":"ᅮᅡ丨","ᅯ":"ᅮᅥ","ㅝ":"ᅮᅥ","ᆋ":"ᅮᅥー","ᅰ":"ᅮᅥ丨","ㅞ":"ᅮᅥ丨","ힵ":"ᅮᅧ","ᆌ":"ᅮᅧ丨","ᆍ":"ᅮᅮ","ᅱ":"ᅮ丨","ㅟ":"ᅮ丨","ힶ":"ᅮ丨丨","ㅠ":"ᅲ","ᆎ":"ᅲᅡ","ힷ":"ᅲᅡ丨","ᆏ":"ᅲᅥ","ᆐ":"ᅲᅥ丨","ᆑ":"ᅲᅧ","ㆊ":"ᅲᅧ","ᆒ":"ᅲᅧ丨","ㆋ":"ᅲᅧ丨","ힸ":"ᅲᅩ","ᆓ":"ᅲᅮ","ᆔ":"ᅲ丨","ㆌ":"ᅲ丨","ㆍ":"ᆞ","ퟅ":"ᆞᅡ","ᆟ":"ᆞᅥ","ퟆ":"ᆞᅥ丨","ᆠ":"ᆞᅮ","ᆢ":"ᆞᆞ","ᆡ":"ᆞ丨","ㆎ":"ᆞ丨","ヘ":"へ","⍁":"〼","⧄":"〼","꒞":"ꁊ","꒬":"ꁐ","꒜":"ꃀ","꒨":"ꄲ","꒿":"ꉙ","꒾":"ꊱ","꒔":"ꋍ","꓀":"ꎫ","꓂":"ꎵ","꒺":"ꎿ","꒰":"ꏂ","꒧":"ꑘ","⊥":"ꓕ","⟂":"ꓕ","𝈜":"ꓕ","Ʇ":"ꓕ","Ꞟ":"ꓤ","⅁":"ꓨ","⅂":"ꓶ","𝈕":"ꓶ","𝈫":"ꓶ","𖼦":"ꓶ","𐐑":"ꓶ","⅃":"𖼀","𑫦":"𑫥𑫯","𑫨":"𑫥𑫥","𑫩":"𑫥𑫥𑫯","𑫪":"𑫥𑫥𑫰","𑫧":"𑫥𑫰","𑫴":"𑫳𑫯","𑫶":"𑫳𑫳","𑫷":"𑫳𑫳𑫯","𑫸":"𑫳𑫳𑫰","𑫵":"𑫳𑫰","𑫬":"𑫫𑫯","𑫭":"𑫫𑫫","𑫮":"𑫫𑫫𑫯","⊕":"𐊨","⨁":"𐊨","🜨":"𐊨","Ꚛ":"𐊨","▽":"𐊼","𝈔":"𐊼","🜄":"𐊼","⧖":"𐋀","ꞛ":"𐐺","Ꞛ":"𐐒","𐒠":"𐒆","𐏑":"𐎂","𐏓":"𐎓","𒀸":"𐎚","☥":"𐦞","𓋹":"𐦞","〹":"卄","不":"不","丽":"丽","並":"並","⎜":"丨","⎟":"丨","⎢":"丨","⎥":"丨","⎪":"丨","⎮":"丨","㇑":"丨","ᅵ":"丨","ㅣ":"丨","⼁":"丨","ᆜ":"丨ー","ᆘ":"丨ᅡ","ᆙ":"丨ᅣ","ힽ":"丨ᅣᅩ","ힾ":"丨ᅣ丨","ힿ":"丨ᅧ","ퟀ":"丨ᅧ丨","ᆚ":"丨ᅩ","ퟁ":"丨ᅩ丨","ퟂ":"丨ᅭ","ᆛ":"丨ᅮ","ퟃ":"丨ᅲ","ᆝ":"丨ᆞ","ퟄ":"丨丨","串":"串","丸":"丸","丹":"丹","乁":"乁","㇠":"乙","⼄":"乙","㇟":"乚","⺃":"乚","㇖":"乛","⺂":"乛","⻲":"亀","亂":"亂","㇚":"亅","⼅":"亅","了":"了","ニ":"二","⼆":"二","𠄢":"𠄢","⼇":"亠","亮":"亮","⼈":"人","イ":"亻","⺅":"亻","什":"什","仌":"仌","令":"令","你":"你","倂":"併","倂":"併","侀":"侀","來":"來","例":"例","侮":"侮","侮":"侮","侻":"侻","便":"便","值":"値","倫":"倫","偺":"偺","備":"備","像":"像","僚":"僚","僧":"僧","僧":"僧","㒞":"㒞","⼉":"儿","兀":"兀","⺎":"兀","充":"充","免":"免","免":"免","兔":"兔","兤":"兤","⼊":"入","內":"內","全":"全","兩":"兩","ハ":"八","⼋":"八","六":"六","具":"具","𠔜":"𠔜","𠔥":"𠔥","冀":"冀","㒹":"㒹","⼌":"冂","再":"再","𠕋":"𠕋","冒":"冒","冕":"冕","㒻":"㒻","最":"最","⼍":"冖","冗":"冗","冤":"冤","⼎":"冫","冬":"冬","况":"况","况":"况","冷":"冷","凉":"凉","凌":"凌","凜":"凜","凞":"凞","⼏":"几","𠘺":"𠘺","凵":"凵","⼐":"凵","⼑":"刀","⺉":"刂","刃":"刃","切":"切","切":"切","列":"列","利":"利","㓟":"㓟","刺":"刺","刻":"刻","剆":"剆","割":"割","剷":"剷","劉":"劉","𠠄":"𠠄","カ":"力","力":"力","⼒":"力","劣":"劣","㔕":"㔕","劳":"劳","勇":"勇","勇":"勇","勉":"勉","勉":"勉","勒":"勒","勞":"勞","勤":"勤","勤":"勤","勵":"勵","⼓":"勹","勺":"勺","勺":"勺","包":"包","匆":"匆","𠣞":"𠣞","⼔":"匕","北":"北","北":"北","⼕":"匚","⼖":"匸","匿":"匿","⼗":"十","〸":"十","〺":"卅","卉":"卉","࿖":"卍","࿕":"卐","卑":"卑","卑":"卑","博":"博","ト":"卜","⼘":"卜","⼙":"卩","⺋":"㔾","即":"即","卵":"卵","卽":"卽","卿":"卿","卿":"卿","卿":"卿","⼚":"厂","𠨬":"𠨬","⼛":"厶","參":"參","⼜":"又","及":"及","叟":"叟","𠭣":"𠭣","ロ":"口","⼝":"口","囗":"口","⼞":"口","句":"句","叫":"叫","叱":"叱","吆":"吆","吏":"吏","吝":"吝","吸":"吸","呂":"呂","呈":"呈","周":"周","咞":"咞","咢":"咢","咽":"咽","䎛":"㖈","哶":"哶","唐":"唐","啓":"啓","啟":"啓","啕":"啕","啣":"啣","善":"善","善":"善","喇":"喇","喙":"喙","喙":"喙","喝":"喝","喝":"喝","喫":"喫","喳":"喳","嗀":"嗀","嗂":"嗂","嗢":"嗢","嘆":"嘆","嘆":"嘆","噑":"噑","噴":"噴","器":"器","囹":"囹","圖":"圖","圗":"圗","⼟":"土","士":"土","⼠":"土","型":"型","城":"城","㦳":"㘽","埴":"埴","堍":"堍","報":"報","堲":"堲","塀":"塀","塚":"塚","塚":"塚","塞":"塞","填":"塡","壿":"墫","墬":"墬","墳":"墳","壘":"壘","壟":"壟","𡓤":"𡓤","壮":"壮","売":"売","壷":"壷","⼡":"夂","夆":"夆","⼢":"夊","タ":"夕","⼣":"夕","多":"多","夢":"夢","⼤":"大","奄":"奄","奈":"奈","契":"契","奔":"奔","奢":"奢","女":"女","⼥":"女","𡚨":"𡚨","𡛪":"𡛪","姘":"姘","姬":"姬","娛":"娛","娧":"娧","婢":"婢","婦":"婦","嬀":"媯","㛮":"㛮","㛼":"㛼","媵":"媵","嬈":"嬈","嬨":"嬨","嬾":"嬾","嬾":"嬾","⼦":"子","⼧":"宀","宅":"宅","𡧈":"𡧈","寃":"寃","寘":"寘","寧":"寧","寧":"寧","寧":"寧","寮":"寮","寳":"寳","𡬘":"𡬘","⼨":"寸","寿":"寿","将":"将","⼩":"小","尢":"尢","⺐":"尢","⼪":"尢","⺏":"尣","㞁":"㞁","⼫":"尸","尿":"尿","屠":"屠","屢":"屢","層":"層","履":"履","屮":"屮","屮":"屮","⼬":"屮","𡴋":"𡴋","⼭":"山","峀":"峀","岍":"岍","𡷤":"𡷤","𡷦":"𡷦","崙":"崙","嵃":"嵃","嵐":"嵐","嵫":"嵫","嵮":"嵮","嵼":"嵼","嶲":"嶲","嶺":"嶺","⼮":"巛","巢":"巢","エ":"工","⼯":"工","⼰":"己","⺒":"巳","㠯":"㠯","巽":"巽","⼱":"巾","帲":"帡","帨":"帨","帽":"帽","幩":"幩","㡢":"㡢","𢆃":"𢆃","⼲":"干","年":"年","𢆟":"𢆟","⺓":"幺","⼳":"幺","⼴":"广","度":"度","㡼":"㡼","庰":"庰","庳":"庳","庶":"庶","廊":"廊","廊":"廊","廉":"廉","廒":"廒","廓":"廓","廙":"廙","廬":"廬","⼵":"廴","廾":"廾","⼶":"廾","𢌱":"𢌱","𢌱":"𢌱","弄":"弄","⼷":"弋","⼸":"弓","弢":"弢","弢":"弢","⼹":"彐","⺔":"彑","当":"当","㣇":"㣇","⼺":"彡","形":"形","彩":"彩","彫":"彫","⼻":"彳","律":"律","㣣":"㣣","徚":"徚","復":"復","徭":"徭","⼼":"心","⺖":"忄","⺗":"㣺","忍":"忍","志":"志","念":"念","忹":"忹","怒":"怒","怜":"怜","恵":"恵","㤜":"㤜","㤺":"㤺","悁":"悁","悔":"悔","悔":"悔","惇":"惇","惘":"惘","惡":"惡","𢛔":"𢛔","愈":"愈","慨":"慨","慄":"慄","慈":"慈","慌":"慌","慌":"慌","慎":"慎","慎":"慎","慠":"慠","慺":"慺","憎":"憎","憎":"憎","憎":"憎","憐":"憐","憤":"憤","憯":"憯","憲":"憲","𢡄":"𢡄","𢡊":"𢡊","懞":"懞","懲":"懲","懲":"懲","懲":"懲","懶":"懶","懶":"懶","戀":"戀","⼽":"戈","成":"成","戛":"戛","戮":"戮","戴":"戴","⼾":"戶","戸":"戶","⼿":"手","⺘":"扌","扝":"扝","抱":"抱","拉":"拉","拏":"拏","拓":"拓","拔":"拔","拼":"拼","拾":"拾","𢬌":"𢬌","挽":"挽","捐":"捐","捨":"捨","捻":"捻","掃":"掃","掠":"掠","掩":"掩","揄":"揄","揤":"揤","摒":"摒","𢯱":"𢯱","搜":"搜","搢":"搢","揅":"揅","摩":"摩","摷":"摷","摾":"摾","㨮":"㨮","搉":"㩁","撚":"撚","撝":"撝","擄":"擄","㩬":"㩬","⽀":"支","⽁":"攴","⺙":"攵","敏":"敏","敏":"敏","敖":"敖","敬":"敬","數":"數","𣀊":"𣀊","⽂":"文","⻫":"斉","⽃":"斗","料":"料","⽄":"斤","⽅":"方","旅":"旅","⽆":"无","⺛":"旡","既":"既","旣":"旣","⽇":"日","易":"易","曶":"㫚","㫤":"㫤","晉":"晉","晩":"晚","晴":"晴","晴":"晴","暑":"暑","暑":"暑","暈":"暈","㬈":"㬈","暜":"暜","暴":"暴","曆":"曆","㬙":"㬙","𣊸":"𣊸","⽈":"曰","更":"更","書":"書","⽉":"月","𣍟":"𣍟","肦":"朌","胐":"朏","胊":"朐","脁":"朓","胶":"㬵","朗":"朗","朗":"朗","朗":"朗","脧":"朘","望":"望","望":"望","幐":"㬺","䐠":"㬻","𣎓":"𣎓","膧":"朣","𣎜":"𣎜","⽊":"木","李":"李","杓":"杓","杖":"杖","杞":"杞","𣏃":"𣏃","柿":"杮","杻":"杻","枅":"枅","林":"林","㭉":"㭉","𣏕":"𣏕","柳":"柳","柺":"柺","栗":"栗","栟":"栟","桒":"桒","𣑭":"𣑭","梁":"梁","梅":"梅","梅":"梅","梎":"梎","梨":"梨","椔":"椔","楂":"楂","㮝":"㮝","㮝":"㮝","槩":"㮣","樧":"榝","榣":"榣","槪":"槪","樂":"樂","樂":"樂","樂":"樂","樓":"樓","𣚣":"𣚣","檨":"檨","櫓":"櫓","櫛":"櫛","欄":"欄","㰘":"㰘","⽋":"欠","次":"次","𣢧":"𣢧","歔":"歔","㱎":"㱎","⽌":"止","⻭":"歯","歲":"歲","歷":"歷","歹":"歹","⽍":"歹","⺞":"歺","殟":"殟","殮":"殮","⽎":"殳","殺":"殺","殺":"殺","殺":"殺","殻":"殻","𣪍":"𣪍","⽏":"毋","⺟":"母","𣫺":"𣫺","⽐":"比","⽑":"毛","⽒":"氏","⺠":"民","⽓":"气","⽔":"水","⺡":"氵","⺢":"氺","汎":"汎","汧":"汧","沈":"沈","沿":"沿","泌":"泌","泍":"泍","泥":"泥","𣲼":"𣲼","洛":"洛","洞":"洞","洴":"洴","派":"派","流":"流","流":"流","流":"流","洖":"洖","浩":"浩","浪":"浪","海":"海","海":"海","浸":"浸","涅":"涅","𣴞":"𣴞","淋":"淋","淚":"淚","淪":"淪","淹":"淹","渚":"渚","港":"港","湮":"湮","潙":"溈","滋":"滋","滋":"滋","溜":"溜","溺":"溺","滇":"滇","滑":"滑","滛":"滛","㴳":"㴳","漏":"漏","漢":"漢","漢":"漢","漣":"漣","𣻑":"𣻑","潮":"潮","𣽞":"𣽞","𣾎":"𣾎","濆":"濆","濫":"濫","濾":"濾","瀛":"瀛","瀞":"瀞","瀞":"瀞","瀹":"瀹","灊":"灊","㶖":"㶖","⽕":"火","⺣":"灬","灰":"灰","灷":"灷","災":"災","炙":"炙","炭":"炭","烈":"烈","烙":"烙","煮":"煮","煮":"煮","𤉣":"𤉣","煅":"煅","煉":"煉","𤋮":"𤋮","熜":"熜","燎":"燎","燐":"燐","𤎫":"𤎫","爐":"爐","爛":"爛","爨":"爨","⽖":"爪","爫":"爫","⺤":"爫","爵":"爵","爵":"爵","⽗":"父","⽘":"爻","⺦":"丬","⽙":"爿","⽚":"片","牐":"牐","⽛":"牙","𤘈":"𤘈","⽜":"牛","牢":"牢","犀":"犀","犕":"犕","⽝":"犬","⺨":"犭","犯":"犯","狀":"狀","𤜵":"𤜵","狼":"狼","猪":"猪","猪":"猪","𤠔":"𤠔","獵":"獵","獺":"獺","⽞":"玄","率":"率","率":"率","⽟":"玉","王":"王","㺬":"㺬","玥":"玥","玲":"玲","㺸":"㺸","㺸":"㺸","珞":"珞","琉":"琉","理":"理","琢":"琢","瑇":"瑇","瑜":"瑜","瑩":"瑩","瑱":"瑱","瑱":"瑱","璅":"璅","璉":"璉","璘":"璘","瓊":"瓊","⽠":"瓜","⽡":"瓦","㼛":"㼛","甆":"甆","⽢":"甘","⽣":"生","甤":"甤","⽤":"用","⽥":"田","画":"画","甾":"甾","𤰶":"𤰶","留":"留","略":"略","異":"異","異":"異","𤲒":"𤲒","⽦":"疋","⽧":"疒","痢":"痢","瘐":"瘐","瘟":"瘟","瘝":"瘝","療":"療","癩":"癩","⽨":"癶","⽩":"白","𤾡":"𤾡","𤾸":"𤾸","⽪":"皮","⽫":"皿","𥁄":"𥁄","㿼":"㿼","益":"益","益":"益","盛":"盛","盧":"盧","䀈":"䀈","⽬":"目","直":"直","直":"直","𥃲":"𥃲","𥃳":"𥃳","省":"省","䀘":"䀘","𥄙":"𥄙","眞":"眞","真":"真","真":"真","𥄳":"𥄳","着":"着","睊":"睊","睊":"睊","鿃":"䀹","䀹":"䀹","䀹":"䀹","晣":"䀿","䁆":"䁆","瞋":"瞋","𥉉":"𥉉","瞧":"瞧","⽭":"矛","⽮":"矢","⽯":"石","䂖":"䂖","𥐝":"𥐝","硏":"研","硎":"硎","硫":"硫","碌":"碌","碌":"碌","碑":"碑","磊":"磊","磌":"磌","磌":"磌","磻":"磻","䃣":"䃣","礪":"礪","⽰":"示","⺭":"礻","礼":"礼","社":"社","祈":"祈","祉":"祉","𥘦":"𥘦","祐":"祐","祖":"祖","祖":"祖","祝":"祝","神":"神","祥":"祥","視":"視","視":"視","祿":"祿","𥚚":"𥚚","禍":"禍","禎":"禎","福":"福","福":"福","𥛅":"𥛅","禮":"禮","⽱":"禸","⽲":"禾","秊":"秊","䄯":"䄯","秫":"秫","稜":"稜","穊":"穊","穀":"穀","穀":"穀","穏":"穏","⽳":"穴","突":"突","𥥼":"𥥼","窱":"窱","立":"立","⽴":"立","⻯":"竜","𥪧":"𥪧","𥪧":"𥪧","竮":"竮","⽵":"竹","笠":"笠","節":"節","節":"節","䈂":"䈂","𥮫":"𥮫","篆":"篆","䈧":"䈧","築":"築","𥲀":"𥲀","𥳐":"𥳐","簾":"簾","籠":"籠","⽶":"米","类":"类","粒":"粒","精":"精","糒":"糒","糖":"糖","糨":"糨","䊠":"䊠","糣":"糣","糧":"糧","⽷":"糸","⺯":"糹","𥾆":"𥾆","紀":"紀","紐":"紐","索":"索","累":"累","絶":"絕","絣":"絣","絛":"絛","綠":"綠","綾":"綾","緇":"緇","練":"練","練":"練","練":"練","縂":"縂","䌁":"䌁","縉":"縉","縷":"縷","繁":"繁","繅":"繅","𦇚":"𦇚","䌴":"䌴","⽸":"缶","𦈨":"𦈨","缾":"缾","𦉇":"𦉇","⽹":"网","⺫":"罒","⺲":"罒","⺱":"罓","䍙":"䍙","署":"署","𦋙":"𦋙","罹":"罹","罺":"罺","羅":"羅","𦌾":"𦌾","⽺":"羊","羕":"羕","羚":"羚","羽":"羽","⽻":"羽","翺":"翺","老":"老","⽼":"老","⺹":"耂","者":"者","者":"者","者":"者","⽽":"而","𦓚":"𦓚","⽾":"耒","𦔣":"𦔣","⽿":"耳","聆":"聆","聠":"聠","𦖨":"𦖨","聯":"聯","聰":"聰","聾":"聾","⾀":"聿","⺺":"肀","⾁":"肉","肋":"肋","肭":"肭","育":"育","䏕":"䏕","䏙":"䏙","腁":"胼","脃":"脃","脾":"脾","䐋":"䐋","朡":"朡","𦞧":"𦞧","𦞵":"𦞵","朦":"䑃","臘":"臘","⾂":"臣","臨":"臨","⾃":"自","臭":"臭","⾄":"至","⾅":"臼","舁":"舁","舁":"舁","舄":"舄","⾆":"舌","舘":"舘","⾇":"舛","⾈":"舟","䑫":"䑫","⾉":"艮","良":"良","⾊":"色","⾋":"艸","艹":"艹","艹":"艹","⺾":"艹","⺿":"艹","⻀":"艹","芋":"芋","芑":"芑","芝":"芝","花":"花","芳":"芳","芽":"芽","若":"若","若":"若","苦":"苦","𦬼":"𦬼","茶":"茶","荒":"荒","荣":"荣","茝":"茝","茣":"茣","莽":"莽","荓":"荓","菉":"菉","菊":"菊","菌":"菌","菜":"菜","菧":"菧","華":"華","菱":"菱","著":"著","著":"著","𦰶":"𦰶","莭":"莭","落":"落","葉":"葉","蔿":"蒍","𦳕":"𦳕","𦵫":"𦵫","蓮":"蓮","蓱":"蓱","蓳":"蓳","蓼":"蓼","蔖":"蔖","䔫":"䔫","蕤":"蕤","𦼬":"𦼬","藍":"藍","䕝":"䕝","𦾱":"𦾱","䕡":"䕡","藺":"藺","蘆":"蘆","䕫":"䕫","蘒":"蘒","蘭":"蘭","𧃒":"𧃒","虁":"蘷","蘿":"蘿","⾌":"虍","⻁":"虎","虐":"虐","虜":"虜","虜":"虜","虧":"虧","虩":"虩","⾍":"虫","蚩":"蚩","蚈":"蚈","蛢":"蛢","蜎":"蜎","蜨":"蜨","蝫":"蝫","蟡":"蟡","蝹":"蝹","蝹":"蝹","螆":"螆","䗗":"䗗","𧏊":"𧏊","螺":"螺","蠁":"蠁","䗹":"䗹","蠟":"蠟","⾎":"血","行":"行","⾏":"行","衠":"衠","衣":"衣","⾐":"衣","⻂":"衤","裂":"裂","𧙧":"𧙧","裏":"裏","裗":"裗","裞":"裞","裡":"裡","裸":"裸","裺":"裺","䘵":"䘵","褐":"褐","襁":"襁","襤":"襤","⾑":"襾","⻄":"西","⻃":"覀","覆":"覆","見":"見","⾒":"見","𧢮":"𧢮","⻅":"见","⾓":"角","⾔":"言","𧥦":"𧥦","詽":"訮","訞":"䚶","䚾":"䚾","䛇":"䛇","誠":"誠","說":"說","說":"說","調":"調","請":"請","諒":"諒","論":"論","諭":"諭","諭":"諭","諸":"諸","諸":"諸","諾":"諾","諾":"諾","謁":"謁","謁":"謁","謹":"謹","謹":"謹","識":"識","讀":"讀","讏":"讆","變":"變","變":"變","⻈":"讠","⾕":"谷","⾖":"豆","豈":"豈","豕":"豕","⾗":"豕","豣":"豜","⾘":"豸","𧲨":"𧲨","⾙":"貝","貫":"貫","賁":"賁","賂":"賂","賈":"賈","賓":"賓","贈":"贈","贈":"贈","贛":"贛","⻉":"贝","⾚":"赤","⾛":"走","起":"起","趆":"赿","𧻓":"𧻓","𧼯":"𧼯","⾜":"足","跋":"跋","趼":"趼","跺":"跥","路":"路","跰":"跰","躛":"躗","⾝":"身","車":"車","⾞":"車","軔":"軔","輧":"軿","輦":"輦","輪":"輪","輸":"輸","輸":"輸","輻":"輻","轢":"轢","⻋":"车","⾟":"辛","辞":"辞","辰":"辰","⾠":"辰","⾡":"辵","辶":"辶","⻌":"辶","⻍":"辶","巡":"巡","連":"連","逸":"逸","逸":"逸","遲":"遲","遼":"遼","𨗒":"𨗒","𨗭":"𨗭","邏":"邏","⾢":"邑","邔":"邔","郎":"郎","郞":"郎","郞":"郎","郱":"郱","都":"都","𨜮":"𨜮","鄑":"鄑","鄛":"鄛","⾣":"酉","酪":"酪","醙":"醙","醴":"醴","⾤":"釆","里":"里","⾥":"里","量":"量","金":"金","⾦":"金","鈴":"鈴","鈸":"鈸","鉶":"鉶","鋗":"鋗","鋘":"鋘","鉼":"鉼","錄":"錄","鍊":"鍊","鎮":"鎭","鏹":"鏹","鐕":"鐕","𨯺":"𨯺","⻐":"钅","⻑":"長","⾧":"長","⻒":"镸","⻓":"长","⾨":"門","開":"開","䦕":"䦕","閭":"閭","閷":"閷","𨵷":"𨵷","⻔":"门","⾩":"阜","⻏":"阝","⻖":"阝","阮":"阮","陋":"陋","降":"降","陵":"陵","陸":"陸","陼":"陼","隆":"隆","隣":"隣","䧦":"䧦","⾪":"隶","隷":"隷","隸":"隷","隸":"隷","⾫":"隹","雃":"雃","離":"離","難":"難","難":"難","⾬":"雨","零":"零","雷":"雷","霣":"霣","𩅅":"𩅅","露":"露","靈":"靈","⾭":"靑","⻘":"青","靖":"靖","靖":"靖","𩇟":"𩇟","⾮":"非","⾯":"面","𩈚":"𩈚","⾰":"革","䩮":"䩮","䩶":"䩶","⾱":"韋","韛":"韛","韠":"韠","⻙":"韦","⾲":"韭","𩐊":"𩐊","⾳":"音","響":"響","響":"響","⾴":"頁","䪲":"䪲","頋":"頋","頋":"頋","頋":"頋","領":"領","頩":"頩","𩒖":"𩒖","頻":"頻","頻":"頻","類":"類","⻚":"页","⾵":"風","𩖶":"𩖶","⻛":"风","⾶":"飛","⻜":"飞","⻝":"食","⾷":"食","⻟":"飠","飢":"飢","飯":"飯","飼":"飼","䬳":"䬳","館":"館","餩":"餩","⻠":"饣","⾸":"首","⾹":"香","馧":"馧","⾺":"馬","駂":"駂","駱":"駱","駾":"駾","驪":"驪","⻢":"马","⾻":"骨","䯎":"䯎","⾼":"高","⾽":"髟","𩬰":"𩬰","鬒":"鬒","鬒":"鬒","⾾":"鬥","⾿":"鬯","⿀":"鬲","⿁":"鬼","⻤":"鬼","⿂":"魚","魯":"魯","鱀":"鱀","鱗":"鱗","⻥":"鱼","⿃":"鳥","鳽":"鳽","䳎":"䳎","鵧":"鵧","䳭":"䳭","𪃎":"𪃎","鶴":"鶴","𪄅":"𪄅","䳸":"䳸","鷺":"鷺","𪈎":"𪈎","鸞":"鸞","鹃":"鹂","⿄":"鹵","鹿":"鹿","⿅":"鹿","𪊑":"𪊑","麗":"麗","麟":"麟","⿆":"麥","⻨":"麦","麻":"麻","⿇":"麻","𪎒":"𪎒","⿈":"黃","⻩":"黄","⿉":"黍","黎":"黎","䵖":"䵖","⿊":"黑","黒":"黑","墨":"墨","黹":"黹","⿋":"黹","⿌":"黽","鼅":"鼅","黾":"黾","⿍":"鼎","鼏":"鼏","⿎":"鼓","鼖":"鼖","⿏":"鼠","鼻":"鼻","⿐":"鼻","齃":"齃","⿑":"齊","⻬":"齐","⿒":"齒","𪘀":"𪘀","⻮":"齿","龍":"龍","⿓":"龍","龎":"龎","⻰":"龙","龜":"龜","龜":"龜","龜":"龜","⿔":"龜","⻳":"龟","⿕":"龠"}},{}],292:[function(e,t,i){"use strict";var n=e("./data.json");var r=RegExp(Object.keys(n).map((function(e){return e.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")})).join("|"),"g");function o(e){return n[e]}t.exports=function(e){return e.replace(r,o)}},{"./data.json":291}],293:[function(e,t,i){(function(e){(function(){function i(t){try{if(!e.localStorage)return!1}catch(e){return!1}var i=e.localStorage[t];return null!=i&&"true"===String(i).toLowerCase()}t.exports=function(e,t){if(i("noDeprecation"))return e;var n=!1;return function(){if(!n){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),n=!0}return e.apply(this,arguments)}}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],294:[function(e,t,i){t.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},{}],295:[function(e,t,i){"use strict";var n=e("is-arguments"),r=e("is-generator-function"),o=e("which-typed-array"),s=e("is-typed-array");function a(e){return e.call.bind(e)}var c="undefined"!=typeof BigInt,d="undefined"!=typeof Symbol,l=a(Object.prototype.toString),u=a(Number.prototype.valueOf),h=a(String.prototype.valueOf),f=a(Boolean.prototype.valueOf);if(c)var p=a(BigInt.prototype.valueOf);if(d)var g=a(Symbol.prototype.valueOf);function v(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return"[object Map]"===l(e)}function y(e){return"[object Set]"===l(e)}function b(e){return"[object WeakMap]"===l(e)}function _(e){return"[object WeakSet]"===l(e)}function S(e){return"[object ArrayBuffer]"===l(e)}function E(e){return"undefined"!=typeof ArrayBuffer&&(S.working?S(e):e instanceof ArrayBuffer)}function w(e){return"[object DataView]"===l(e)}function T(e){return"undefined"!=typeof DataView&&(w.working?w(e):e instanceof DataView)}i.isArgumentsObject=n,i.isGeneratorFunction=r,i.isTypedArray=s,i.isPromise=function(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch},i.isArrayBufferView=function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):s(e)||T(e)},i.isUint8Array=function(e){return"Uint8Array"===o(e)},i.isUint8ClampedArray=function(e){return"Uint8ClampedArray"===o(e)},i.isUint16Array=function(e){return"Uint16Array"===o(e)},i.isUint32Array=function(e){return"Uint32Array"===o(e)},i.isInt8Array=function(e){return"Int8Array"===o(e)},i.isInt16Array=function(e){return"Int16Array"===o(e)},i.isInt32Array=function(e){return"Int32Array"===o(e)},i.isFloat32Array=function(e){return"Float32Array"===o(e)},i.isFloat64Array=function(e){return"Float64Array"===o(e)},i.isBigInt64Array=function(e){return"BigInt64Array"===o(e)},i.isBigUint64Array=function(e){return"BigUint64Array"===o(e)},m.working="undefined"!=typeof Map&&m(new Map),i.isMap=function(e){return"undefined"!=typeof Map&&(m.working?m(e):e instanceof Map)},y.working="undefined"!=typeof Set&&y(new Set),i.isSet=function(e){return"undefined"!=typeof Set&&(y.working?y(e):e instanceof Set)},b.working="undefined"!=typeof WeakMap&&b(new WeakMap),i.isWeakMap=function(e){return"undefined"!=typeof WeakMap&&(b.working?b(e):e instanceof WeakMap)},_.working="undefined"!=typeof WeakSet&&_(new WeakSet),i.isWeakSet=function(e){return _(e)},S.working="undefined"!=typeof ArrayBuffer&&S(new ArrayBuffer),i.isArrayBuffer=E,w.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&w(new DataView(new ArrayBuffer(1),0,1)),i.isDataView=T;var I="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function R(e){return"[object SharedArrayBuffer]"===l(e)}function k(e){return void 0!==I&&(void 0===R.working&&(R.working=R(new I)),R.working?R(e):e instanceof I)}function M(e){return v(e,u)}function C(e){return v(e,h)}function O(e){return v(e,f)}function A(e){return c&&v(e,p)}function P(e){return d&&v(e,g)}i.isSharedArrayBuffer=k,i.isAsyncFunction=function(e){return"[object AsyncFunction]"===l(e)},i.isMapIterator=function(e){return"[object Map Iterator]"===l(e)},i.isSetIterator=function(e){return"[object Set Iterator]"===l(e)},i.isGeneratorObject=function(e){return"[object Generator]"===l(e)},i.isWebAssemblyCompiledModule=function(e){return"[object WebAssembly.Module]"===l(e)},i.isNumberObject=M,i.isStringObject=C,i.isBooleanObject=O,i.isBigIntObject=A,i.isSymbolObject=P,i.isBoxedPrimitive=function(e){return M(e)||C(e)||O(e)||A(e)||P(e)},i.isAnyArrayBuffer=function(e){return"undefined"!=typeof Uint8Array&&(E(e)||k(e))},["isProxy","isExternal","isModuleNamespaceObject"].forEach((function(e){Object.defineProperty(i,e,{enumerable:!1,value:function(){throw new Error(e+" is not supported in userland")}})}))},{"is-arguments":152,"is-generator-function":154,"is-typed-array":155,"which-typed-array":313}],296:[function(e,t,i){(function(t){(function(){var n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),i={},n=0;n<t.length;n++)i[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return i},r=/%[sdj%]/g;i.format=function(e){if(!y(e)){for(var t=[],i=0;i<arguments.length;i++)t.push(c(arguments[i]));return t.join(" ")}i=1;for(var n=arguments,o=n.length,s=String(e).replace(r,(function(e){if("%%"===e)return"%";if(i>=o)return e;switch(e){case"%s":return String(n[i++]);case"%d":return Number(n[i++]);case"%j":try{return JSON.stringify(n[i++])}catch(e){return"[Circular]"}default:return e}})),a=n[i];i<o;a=n[++i])v(a)||!S(a)?s+=" "+a:s+=" "+c(a);return s},i.deprecate=function(e,n){if(void 0!==t&&!0===t.noDeprecation)return e;if(void 0===t)return function(){return i.deprecate(e,n).apply(this,arguments)};var r=!1;return function(){if(!r){if(t.throwDeprecation)throw new Error(n);t.traceDeprecation?console.trace(n):console.error(n),r=!0}return e.apply(this,arguments)}};var o={},s=/^$/;if(t.env.NODE_DEBUG){var a=t.env.NODE_DEBUG;a=a.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),s=new RegExp("^"+a+"$","i")}function c(e,t){var n={seen:[],stylize:l};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),g(t)?n.showHidden=t:t&&i._extend(n,t),b(n.showHidden)&&(n.showHidden=!1),b(n.depth)&&(n.depth=2),b(n.colors)&&(n.colors=!1),b(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=d),u(n,e,n.depth)}function d(e,t){var i=c.styles[t];return i?"["+c.colors[i][0]+"m"+e+"["+c.colors[i][1]+"m":e}function l(e,t){return e}function u(e,t,n){if(e.customInspect&&t&&T(t.inspect)&&t.inspect!==i.inspect&&(!t.constructor||t.constructor.prototype!==t)){var r=t.inspect(n,e);return y(r)||(r=u(e,r,n)),r}var o=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(y(t)){var i="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(i,"string")}if(m(t))return e.stylize(""+t,"number");if(g(t))return e.stylize(""+t,"boolean");if(v(t))return e.stylize("null","null")}(e,t);if(o)return o;var s=Object.keys(t),a=function(e){var t={};return e.forEach((function(e,i){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(t)),w(t)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return h(t);if(0===s.length){if(T(t)){var c=t.name?": "+t.name:"";return e.stylize("[Function"+c+"]","special")}if(_(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(E(t))return e.stylize(Date.prototype.toString.call(t),"date");if(w(t))return h(t)}var d,l="",S=!1,I=["{","}"];(p(t)&&(S=!0,I=["[","]"]),T(t))&&(l=" [Function"+(t.name?": "+t.name:"")+"]");return _(t)&&(l=" "+RegExp.prototype.toString.call(t)),E(t)&&(l=" "+Date.prototype.toUTCString.call(t)),w(t)&&(l=" "+h(t)),0!==s.length||S&&0!=t.length?n<0?_(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),d=S?function(e,t,i,n,r){for(var o=[],s=0,a=t.length;s<a;++s)M(t,String(s))?o.push(f(e,t,i,n,String(s),!0)):o.push("");return r.forEach((function(r){r.match(/^\d+$/)||o.push(f(e,t,i,n,r,!0))})),o}(e,t,n,a,s):s.map((function(i){return f(e,t,n,a,i,S)})),e.seen.pop(),function(e,t,i){var n=e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0);if(n>60)return i[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+i[1];return i[0]+t+" "+e.join(", ")+" "+i[1]}(d,l,I)):I[0]+l+I[1]}function h(e){return"["+Error.prototype.toString.call(e)+"]"}function f(e,t,i,n,r,o){var s,a,c;if((c=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]}).get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),M(n,r)||(s="["+r+"]"),a||(e.seen.indexOf(c.value)<0?(a=v(i)?u(e,c.value,null):u(e,c.value,i-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").slice(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),b(s)){if(o&&r.match(/^\d+$/))return a;(s=JSON.stringify(""+r)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function p(e){return Array.isArray(e)}function g(e){return"boolean"==typeof e}function v(e){return null===e}function m(e){return"number"==typeof e}function y(e){return"string"==typeof e}function b(e){return void 0===e}function _(e){return S(e)&&"[object RegExp]"===I(e)}function S(e){return"object"==typeof e&&null!==e}function E(e){return S(e)&&"[object Date]"===I(e)}function w(e){return S(e)&&("[object Error]"===I(e)||e instanceof Error)}function T(e){return"function"==typeof e}function I(e){return Object.prototype.toString.call(e)}function R(e){return e<10?"0"+e.toString(10):e.toString(10)}i.debuglog=function(e){if(e=e.toUpperCase(),!o[e])if(s.test(e)){var n=t.pid;o[e]=function(){var t=i.format.apply(i,arguments);console.error("%s %d: %s",e,n,t)}}else o[e]=function(){};return o[e]},i.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},i.types=e("./support/types"),i.isArray=p,i.isBoolean=g,i.isNull=v,i.isNullOrUndefined=function(e){return null==e},i.isNumber=m,i.isString=y,i.isSymbol=function(e){return"symbol"==typeof e},i.isUndefined=b,i.isRegExp=_,i.types.isRegExp=_,i.isObject=S,i.isDate=E,i.types.isDate=E,i.isError=w,i.types.isNativeError=w,i.isFunction=T,i.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},i.isBuffer=e("./support/isBuffer");var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function M(e,t){return Object.prototype.hasOwnProperty.call(e,t)}i.log=function(){var e,t;console.log("%s - %s",(e=new Date,t=[R(e.getHours()),R(e.getMinutes()),R(e.getSeconds())].join(":"),[e.getDate(),k[e.getMonth()],t].join(" ")),i.format.apply(i,arguments))},i.inherits=e("inherits"),i._extend=function(e,t){if(!t||!S(t))return e;for(var i=Object.keys(t),n=i.length;n--;)e[i[n]]=t[i[n]];return e};var C="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function O(e,t){if(!e){var i=new Error("Promise was rejected with a falsy value");i.reason=e,e=i}return t(e)}i.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(C&&e[C]){var t;if("function"!=typeof(t=e[C]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,C,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,i,n=new Promise((function(e,n){t=e,i=n})),r=[],o=0;o<arguments.length;o++)r.push(arguments[o]);r.push((function(e,n){e?i(e):t(n)}));try{e.apply(this,r)}catch(e){i(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),C&&Object.defineProperty(t,C,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,n(e))},i.promisify.custom=C,i.callbackify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');function i(){for(var i=[],n=0;n<arguments.length;n++)i.push(arguments[n]);var r=i.pop();if("function"!=typeof r)throw new TypeError("The last argument must be of type Function");var o=this,s=function(){return r.apply(o,arguments)};e.apply(this,i).then((function(e){t.nextTick(s.bind(null,null,e))}),(function(e){t.nextTick(O.bind(null,e,s))}))}return Object.setPrototypeOf(i,Object.getPrototypeOf(e)),Object.defineProperties(i,n(e)),i}}).call(this)}).call(this,e("_process"))},{"./support/isBuffer":294,"./support/types":295,_process:247,inherits:151}],297:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),Object.defineProperty(i,"NIL",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(i,"parse",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(i,"stringify",{enumerable:!0,get:function(){return l.default}}),Object.defineProperty(i,"v1",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(i,"v3",{enumerable:!0,get:function(){return r.default}}),Object.defineProperty(i,"v4",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(i,"v5",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(i,"validate",{enumerable:!0,get:function(){return d.default}}),Object.defineProperty(i,"version",{enumerable:!0,get:function(){return c.default}});var n=h(e("./v1.js")),r=h(e("./v3.js")),o=h(e("./v4.js")),s=h(e("./v5.js")),a=h(e("./nil.js")),c=h(e("./version.js")),d=h(e("./validate.js")),l=h(e("./stringify.js")),u=h(e("./parse.js"));function h(e){return e&&e.__esModule?e:{default:e}}},{"./nil.js":300,"./parse.js":301,"./stringify.js":305,"./v1.js":306,"./v3.js":307,"./v4.js":309,"./v5.js":310,"./validate.js":311,"./version.js":312}],298:[function(e,t,i){"use strict";function n(e){return 14+(e+64>>>9<<4)+1}function r(e,t){const i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}function o(e,t,i,n,o,s){return r((a=r(r(t,e),r(n,s)))<<(c=o)|a>>>32-c,i);var a,c}function s(e,t,i,n,r,s,a){return o(t&i|~t&n,e,t,r,s,a)}function a(e,t,i,n,r,s,a){return o(t&n|i&~n,e,t,r,s,a)}function c(e,t,i,n,r,s,a){return o(t^i^n,e,t,r,s,a)}function d(e,t,i,n,r,s,a){return o(i^(t|~n),e,t,r,s,a)}Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var l=function(e){if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=new Uint8Array(t.length);for(let i=0;i<t.length;++i)e[i]=t.charCodeAt(i)}return function(e){const t=[],i=32*e.length,n="0123456789abcdef";for(let r=0;r<i;r+=8){const i=e[r>>5]>>>r%32&255,o=parseInt(n.charAt(i>>>4&15)+n.charAt(15&i),16);t.push(o)}return t}(function(e,t){e[t>>5]|=128<<t%32,e[n(t)-1]=t;let i=1732584193,o=-271733879,l=-1732584194,u=271733878;for(let t=0;t<e.length;t+=16){const n=i,h=o,f=l,p=u;i=s(i,o,l,u,e[t],7,-680876936),u=s(u,i,o,l,e[t+1],12,-389564586),l=s(l,u,i,o,e[t+2],17,606105819),o=s(o,l,u,i,e[t+3],22,-1044525330),i=s(i,o,l,u,e[t+4],7,-176418897),u=s(u,i,o,l,e[t+5],12,1200080426),l=s(l,u,i,o,e[t+6],17,-1473231341),o=s(o,l,u,i,e[t+7],22,-45705983),i=s(i,o,l,u,e[t+8],7,1770035416),u=s(u,i,o,l,e[t+9],12,-1958414417),l=s(l,u,i,o,e[t+10],17,-42063),o=s(o,l,u,i,e[t+11],22,-1990404162),i=s(i,o,l,u,e[t+12],7,1804603682),u=s(u,i,o,l,e[t+13],12,-40341101),l=s(l,u,i,o,e[t+14],17,-1502002290),o=s(o,l,u,i,e[t+15],22,1236535329),i=a(i,o,l,u,e[t+1],5,-165796510),u=a(u,i,o,l,e[t+6],9,-1069501632),l=a(l,u,i,o,e[t+11],14,643717713),o=a(o,l,u,i,e[t],20,-373897302),i=a(i,o,l,u,e[t+5],5,-701558691),u=a(u,i,o,l,e[t+10],9,38016083),l=a(l,u,i,o,e[t+15],14,-660478335),o=a(o,l,u,i,e[t+4],20,-405537848),i=a(i,o,l,u,e[t+9],5,568446438),u=a(u,i,o,l,e[t+14],9,-1019803690),l=a(l,u,i,o,e[t+3],14,-187363961),o=a(o,l,u,i,e[t+8],20,1163531501),i=a(i,o,l,u,e[t+13],5,-1444681467),u=a(u,i,o,l,e[t+2],9,-51403784),l=a(l,u,i,o,e[t+7],14,1735328473),o=a(o,l,u,i,e[t+12],20,-1926607734),i=c(i,o,l,u,e[t+5],4,-378558),u=c(u,i,o,l,e[t+8],11,-2022574463),l=c(l,u,i,o,e[t+11],16,1839030562),o=c(o,l,u,i,e[t+14],23,-35309556),i=c(i,o,l,u,e[t+1],4,-1530992060),u=c(u,i,o,l,e[t+4],11,1272893353),l=c(l,u,i,o,e[t+7],16,-155497632),o=c(o,l,u,i,e[t+10],23,-1094730640),i=c(i,o,l,u,e[t+13],4,681279174),u=c(u,i,o,l,e[t],11,-358537222),l=c(l,u,i,o,e[t+3],16,-722521979),o=c(o,l,u,i,e[t+6],23,76029189),i=c(i,o,l,u,e[t+9],4,-640364487),u=c(u,i,o,l,e[t+12],11,-421815835),l=c(l,u,i,o,e[t+15],16,530742520),o=c(o,l,u,i,e[t+2],23,-995338651),i=d(i,o,l,u,e[t],6,-198630844),u=d(u,i,o,l,e[t+7],10,1126891415),l=d(l,u,i,o,e[t+14],15,-1416354905),o=d(o,l,u,i,e[t+5],21,-57434055),i=d(i,o,l,u,e[t+12],6,1700485571),u=d(u,i,o,l,e[t+3],10,-1894986606),l=d(l,u,i,o,e[t+10],15,-1051523),o=d(o,l,u,i,e[t+1],21,-2054922799),i=d(i,o,l,u,e[t+8],6,1873313359),u=d(u,i,o,l,e[t+15],10,-30611744),l=d(l,u,i,o,e[t+6],15,-1560198380),o=d(o,l,u,i,e[t+13],21,1309151649),i=d(i,o,l,u,e[t+4],6,-145523070),u=d(u,i,o,l,e[t+11],10,-1120210379),l=d(l,u,i,o,e[t+2],15,718787259),o=d(o,l,u,i,e[t+9],21,-343485551),i=r(i,n),o=r(o,h),l=r(l,f),u=r(u,p)}return[i,o,l,u]}(function(e){if(0===e.length)return[];const t=8*e.length,i=new Uint32Array(n(t));for(let n=0;n<t;n+=8)i[n>>5]|=(255&e[n/8])<<n%32;return i}(e),8*e.length))};i.default=l},{}],299:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var n={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};i.default=n},{}],300:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;i.default="00000000-0000-0000-0000-000000000000"},{}],301:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var n,r=(n=e("./validate.js"))&&n.__esModule?n:{default:n};var o=function(e){if(!(0,r.default)(e))throw TypeError("Invalid UUID");let t;const i=new Uint8Array(16);return i[0]=(t=parseInt(e.slice(0,8),16))>>>24,i[1]=t>>>16&255,i[2]=t>>>8&255,i[3]=255&t,i[4]=(t=parseInt(e.slice(9,13),16))>>>8,i[5]=255&t,i[6]=(t=parseInt(e.slice(14,18),16))>>>8,i[7]=255&t,i[8]=(t=parseInt(e.slice(19,23),16))>>>8,i[9]=255&t,i[10]=(t=parseInt(e.slice(24,36),16))/1099511627776&255,i[11]=t/4294967296&255,i[12]=t>>>24&255,i[13]=t>>>16&255,i[14]=t>>>8&255,i[15]=255&t,i};i.default=o},{"./validate.js":311}],302:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;i.default=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i},{}],303:[function(e,t,i){"use strict";let n;Object.defineProperty(i,"__esModule",{value:!0}),i.default=function(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(r)};const r=new Uint8Array(16)},{}],304:[function(e,t,i){"use strict";function n(e,t,i,n){switch(e){case 0:return t&i^~t&n;case 1:case 3:return t^i^n;case 2:return t&i^t&n^i&n}}function r(e,t){return e<<t|e>>>32-t}Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var o=function(e){const t=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof e){const t=unescape(encodeURIComponent(e));e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i))}else Array.isArray(e)||(e=Array.prototype.slice.call(e));e.push(128);const o=e.length/4+2,s=Math.ceil(o/16),a=new Array(s);for(let t=0;t<s;++t){const i=new Uint32Array(16);for(let n=0;n<16;++n)i[n]=e[64*t+4*n]<<24|e[64*t+4*n+1]<<16|e[64*t+4*n+2]<<8|e[64*t+4*n+3];a[t]=i}a[s-1][14]=8*(e.length-1)/Math.pow(2,32),a[s-1][14]=Math.floor(a[s-1][14]),a[s-1][15]=8*(e.length-1)&4294967295;for(let e=0;e<s;++e){const o=new Uint32Array(80);for(let t=0;t<16;++t)o[t]=a[e][t];for(let e=16;e<80;++e)o[e]=r(o[e-3]^o[e-8]^o[e-14]^o[e-16],1);let s=i[0],c=i[1],d=i[2],l=i[3],u=i[4];for(let e=0;e<80;++e){const i=Math.floor(e/20),a=r(s,5)+n(i,c,d,l)+u+t[i]+o[e]>>>0;u=l,l=d,d=r(c,30)>>>0,c=s,s=a}i[0]=i[0]+s>>>0,i[1]=i[1]+c>>>0,i[2]=i[2]+d>>>0,i[3]=i[3]+l>>>0,i[4]=i[4]+u>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]};i.default=o},{}],305:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0,i.unsafeStringify=s;var n,r=(n=e("./validate.js"))&&n.__esModule?n:{default:n};const o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));function s(e,t=0){return(o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]).toLowerCase()}var a=function(e,t=0){const i=s(e,t);if(!(0,r.default)(i))throw TypeError("Stringified UUID is invalid");return i};i.default=a},{"./validate.js":311}],306:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var n,r=(n=e("./rng.js"))&&n.__esModule?n:{default:n},o=e("./stringify.js");let s,a,c=0,d=0;var l=function(e,t,i){let n=t&&i||0;const l=t||new Array(16);let u=(e=e||{}).node||s,h=void 0!==e.clockseq?e.clockseq:a;if(null==u||null==h){const t=e.random||(e.rng||r.default)();null==u&&(u=s=[1|t[0],t[1],t[2],t[3],t[4],t[5]]),null==h&&(h=a=16383&(t[6]<<8|t[7]))}let f=void 0!==e.msecs?e.msecs:Date.now(),p=void 0!==e.nsecs?e.nsecs:d+1;const g=f-c+(p-d)/1e4;if(g<0&&void 0===e.clockseq&&(h=h+1&16383),(g<0||f>c)&&void 0===e.nsecs&&(p=0),p>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");c=f,d=p,a=h,f+=122192928e5;const v=(1e4*(268435455&f)+p)%4294967296;l[n++]=v>>>24&255,l[n++]=v>>>16&255,l[n++]=v>>>8&255,l[n++]=255&v;const m=f/4294967296*1e4&268435455;l[n++]=m>>>8&255,l[n++]=255&m,l[n++]=m>>>24&15|16,l[n++]=m>>>16&255,l[n++]=h>>>8|128,l[n++]=255&h;for(let e=0;e<6;++e)l[n+e]=u[e];return t||(0,o.unsafeStringify)(l)};i.default=l},{"./rng.js":303,"./stringify.js":305}],307:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var n=o(e("./v35.js")),r=o(e("./md5.js"));function o(e){return e&&e.__esModule?e:{default:e}}var s=(0,n.default)("v3",48,r.default);i.default=s},{"./md5.js":298,"./v35.js":308}],308:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.URL=i.DNS=void 0,i.default=function(e,t,i){function n(e,n,s,a){var c;if("string"==typeof e&&(e=function(e){e=unescape(encodeURIComponent(e));const t=[];for(let i=0;i<e.length;++i)t.push(e.charCodeAt(i));return t}(e)),"string"==typeof n&&(n=(0,o.default)(n)),16!==(null===(c=n)||void 0===c?void 0:c.length))throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let d=new Uint8Array(16+e.length);if(d.set(n),d.set(e,n.length),d=i(d),d[6]=15&d[6]|t,d[8]=63&d[8]|128,s){a=a||0;for(let e=0;e<16;++e)s[a+e]=d[e];return s}return(0,r.unsafeStringify)(d)}try{n.name=e}catch(e){}return n.DNS=s,n.URL=a,n};var n,r=e("./stringify.js"),o=(n=e("./parse.js"))&&n.__esModule?n:{default:n};const s="6ba7b810-9dad-11d1-80b4-00c04fd430c8";i.DNS=s;const a="6ba7b811-9dad-11d1-80b4-00c04fd430c8";i.URL=a},{"./parse.js":301,"./stringify.js":305}],309:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var n=s(e("./native.js")),r=s(e("./rng.js")),o=e("./stringify.js");function s(e){return e&&e.__esModule?e:{default:e}}var a=function(e,t,i){if(n.default.randomUUID&&!t&&!e)return n.default.randomUUID();const s=(e=e||{}).random||(e.rng||r.default)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t){i=i||0;for(let e=0;e<16;++e)t[i+e]=s[e];return t}return(0,o.unsafeStringify)(s)};i.default=a},{"./native.js":299,"./rng.js":303,"./stringify.js":305}],310:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var n=o(e("./v35.js")),r=o(e("./sha1.js"));function o(e){return e&&e.__esModule?e:{default:e}}var s=(0,n.default)("v5",80,r.default);i.default=s},{"./sha1.js":304,"./v35.js":308}],311:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var n,r=(n=e("./regex.js"))&&n.__esModule?n:{default:n};var o=function(e){return"string"==typeof e&&r.default.test(e)};i.default=o},{"./regex.js":302}],312:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.default=void 0;var n,r=(n=e("./validate.js"))&&n.__esModule?n:{default:n};var o=function(e){if(!(0,r.default)(e))throw TypeError("Invalid UUID");return parseInt(e.slice(14,15),16)};i.default=o},{"./validate.js":311}],313:[function(e,t,i){(function(i){(function(){"use strict";var n=e("for-each"),r=e("available-typed-arrays"),o=e("call-bind"),s=e("call-bind/callBound"),a=e("gopd"),c=s("Object.prototype.toString"),d=e("has-tostringtag/shams")(),l="undefined"==typeof globalThis?i:globalThis,u=r(),h=s("String.prototype.slice"),f=Object.getPrototypeOf,p=s("Array.prototype.indexOf",!0)||function(e,t){for(var i=0;i<e.length;i+=1)if(e[i]===t)return i;return-1},g={__proto__:null};n(u,d&&a&&f?function(e){var t=new l[e];if(Symbol.toStringTag in t){var i=f(t),n=a(i,Symbol.toStringTag);if(!n){var r=f(i);n=a(r,Symbol.toStringTag)}g["$"+e]=o(n.get)}}:function(e){var t=new l[e];g["$"+e]=o(t.slice)});t.exports=function(e){if(!e||"object"!=typeof e)return!1;if(!d){var t=h(c(e),8,-1);return p(u,t)>-1?t:"Object"===t&&function(e){var t=!1;return n(g,(function(i,n){if(!t)try{i(e),t=h(n,1)}catch(e){}})),t}(e)}return a?function(e){var t=!1;return n(g,(function(i,n){if(!t)try{"$"+i(e)===n&&(t=h(n,1))}catch(e){}})),t}(e):null}}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"available-typed-arrays":16,"call-bind":70,"call-bind/callBound":69,"for-each":111,gopd:115,"has-tostringtag/shams":119}],314:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],315:[function(e,t,i){"use strict";var n,r,o,s,a,c;Object.defineProperty(i,"__esModule",{value:!0}),i.RuleId=i.PushRuleKind=i.ConditionKind=i.isDmMemberCountCondition=i.DMMemberCountCondition=i.ConditionOperator=i.TweakName=i.PushRuleActionName=void 0,function(e){e.DontNotify="dont_notify",e.Notify="notify",e.Coalesce="coalesce"}(n||(i.PushRuleActionName=n={})),function(e){e.Highlight="highlight",e.Sound="sound"}(r||(i.TweakName=r={})),function(e){e.ExactEquals="==",e.LessThan="<",e.GreaterThan=">",e.GreaterThanOrEqual=">=",e.LessThanOrEqual="<="}(o||(i.ConditionOperator=o={})),i.DMMemberCountCondition="2",i.isDmMemberCountCondition=function(e){return"==2"===e||"2"===e},function(e){e.EventMatch="event_match",e.EventPropertyIs="event_property_is",e.EventPropertyContains="event_property_contains",e.ContainsDisplayName="contains_display_name",e.RoomMemberCount="room_member_count",e.SenderNotificationPermission="sender_notification_permission",e.CallStarted="call_started",e.CallStartedPrefix="org.matrix.msc3914.call_started"}(s||(i.ConditionKind=s={})),function(e){e.Override="override",e.ContentSpecific="content",e.RoomSpecific="room",e.SenderSpecific="sender",e.Underride="underride"}(a||(i.PushRuleKind=a={})),function(e){e.Master=".m.rule.master",e.IsUserMention=".m.rule.is_user_mention",e.IsRoomMention=".m.rule.is_room_mention",e.ContainsDisplayName=".m.rule.contains_display_name",e.ContainsUserName=".m.rule.contains_user_name",e.AtRoomNotification=".m.rule.roomnotif",e.DM=".m.rule.room_one_to_one",e.EncryptedDM=".m.rule.encrypted_room_one_to_one",e.Message=".m.rule.message",e.EncryptedMessage=".m.rule.encrypted",e.InviteToSelf=".m.rule.invite_for_me",e.MemberEvent=".m.rule.member_event",e.IncomingCall=".m.rule.call",e.SuppressNotices=".m.rule.suppress_notices",e.Tombstone=".m.rule.tombstone",e.PollStart=".m.rule.poll_start",e.PollStartUnstable=".org.matrix.msc3930.rule.poll_start",e.PollEnd=".m.rule.poll_end",e.PollEndUnstable=".org.matrix.msc3930.rule.poll_end",e.PollStartOneToOne=".m.rule.poll_start_one_to_one",e.PollStartOneToOneUnstable=".org.matrix.msc3930.rule.poll_start_one_to_one",e.PollEndOneToOne=".m.rule.poll_end_one_to_one",e.PollEndOneToOneUnstable=".org.matrix.msc3930.rule.poll_end_one_to_one"}(c||(i.RuleId=c={}))},{}],316:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.SSOAction=i.IdentityProviderBrand=i.DELEGATED_OIDC_COMPATIBILITY=void 0;const n=e("../NamespacedValue");var r,o;i.DELEGATED_OIDC_COMPATIBILITY=new n.UnstableValue("delegated_oidc_compatibility","org.matrix.msc3824.delegated_oidc_compatibility"),function(e){e.Gitlab="gitlab",e.Github="github",e.Apple="apple",e.Google="google",e.Facebook="facebook",e.Twitter="twitter"}(r||(i.IdentityProviderBrand=r={})),function(e){e.LOGIN="login",e.REGISTER="register"}(o||(i.SSOAction=o={}))},{"../NamespacedValue":333}],317:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.M_BEACON=i.M_BEACON_INFO=void 0;const n=e("../NamespacedValue");i.M_BEACON_INFO=new n.UnstableValue("m.beacon_info","org.matrix.msc3672.beacon_info"),i.M_BEACON=new n.UnstableValue("m.beacon","org.matrix.msc3672.beacon")},{"../NamespacedValue":333}],318:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],319:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UNSIGNED_THREAD_ID_FIELD=i.LOCAL_NOTIFICATION_SETTINGS_PREFIX=i.PUSHER_DEVICE_ID=i.PUSHER_ENABLED=i.EVENT_VISIBILITY_CHANGE_TYPE=i.UNSTABLE_ELEMENT_FUNCTIONAL_USERS=i.MSC3912_RELATION_BASED_REDACTIONS_PROP=i.UNSTABLE_MSC2716_MARKER=i.UNSTABLE_MSC3089_BRANCH=i.UNSTABLE_MSC3089_LEAF=i.UNSTABLE_MSC3089_TREE_SUBTYPE=i.UNSTABLE_MSC3088_ENABLED=i.UNSTABLE_MSC3088_PURPOSE=i.ToDeviceMessageId=i.RoomType=i.RoomCreateTypeField=i.MsgType=i.RelationType=i.EventType=void 0;const n=e("../NamespacedValue");var r,o,s,a;!function(e){e.RoomCanonicalAlias="m.room.canonical_alias",e.RoomCreate="m.room.create",e.RoomJoinRules="m.room.join_rules",e.RoomMember="m.room.member",e.RoomThirdPartyInvite="m.room.third_party_invite",e.RoomPowerLevels="m.room.power_levels",e.RoomName="m.room.name",e.RoomTopic="m.room.topic",e.RoomAvatar="m.room.avatar",e.RoomPinnedEvents="m.room.pinned_events",e.RoomEncryption="m.room.encryption",e.RoomHistoryVisibility="m.room.history_visibility",e.RoomGuestAccess="m.room.guest_access",e.RoomServerAcl="m.room.server_acl",e.RoomTombstone="m.room.tombstone",e.RoomPredecessor="org.matrix.msc3946.room_predecessor",e.SpaceChild="m.space.child",e.SpaceParent="m.space.parent",e.RoomRedaction="m.room.redaction",e.RoomMessage="m.room.message",e.RoomMessageEncrypted="m.room.encrypted",e.Sticker="m.sticker",e.CallInvite="m.call.invite",e.CallCandidates="m.call.candidates",e.CallAnswer="m.call.answer",e.CallHangup="m.call.hangup",e.CallReject="m.call.reject",e.CallSelectAnswer="m.call.select_answer",e.CallNegotiate="m.call.negotiate",e.CallSDPStreamMetadataChanged="m.call.sdp_stream_metadata_changed",e.CallSDPStreamMetadataChangedPrefix="org.matrix.call.sdp_stream_metadata_changed",e.CallReplaces="m.call.replaces",e.CallAssertedIdentity="m.call.asserted_identity",e.CallAssertedIdentityPrefix="org.matrix.call.asserted_identity",e.KeyVerificationRequest="m.key.verification.request",e.KeyVerificationStart="m.key.verification.start",e.KeyVerificationCancel="m.key.verification.cancel",e.KeyVerificationMac="m.key.verification.mac",e.KeyVerificationDone="m.key.verification.done",e.KeyVerificationKey="m.key.verification.key",e.KeyVerificationAccept="m.key.verification.accept",e.KeyVerificationReady="m.key.verification.ready",e.RoomMessageFeedback="m.room.message.feedback",e.Reaction="m.reaction",e.PollStart="org.matrix.msc3381.poll.start",e.Typing="m.typing",e.Receipt="m.receipt",e.Presence="m.presence",e.FullyRead="m.fully_read",e.Tag="m.tag",e.SpaceOrder="org.matrix.msc3230.space_order",e.PushRules="m.push_rules",e.Direct="m.direct",e.IgnoredUserList="m.ignored_user_list",e.RoomKey="m.room_key",e.RoomKeyRequest="m.room_key_request",e.ForwardedRoomKey="m.forwarded_room_key",e.Dummy="m.dummy",e.GroupCallPrefix="org.matrix.msc3401.call",e.GroupCallMemberPrefix="org.matrix.msc3401.call.member"}(r||(i.EventType=r={})),function(e){e.Annotation="m.annotation",e.Replace="m.replace",e.Reference="m.reference",e.Thread="m.thread"}(o||(i.RelationType=o={})),function(e){e.Text="m.text",e.Emote="m.emote",e.Notice="m.notice",e.Image="m.image",e.File="m.file",e.Audio="m.audio",e.Location="m.location",e.Video="m.video",e.KeyVerificationRequest="m.key.verification.request"}(s||(i.MsgType=s={})),i.RoomCreateTypeField="type",function(e){e.Space="m.space",e.UnstableCall="org.matrix.msc3417.call",e.ElementVideo="io.element.video"}(a||(i.RoomType=a={})),i.ToDeviceMessageId="org.matrix.msgid",i.UNSTABLE_MSC3088_PURPOSE=new n.UnstableValue("m.room.purpose","org.matrix.msc3088.purpose"),i.UNSTABLE_MSC3088_ENABLED=new n.UnstableValue("m.enabled","org.matrix.msc3088.enabled"),i.UNSTABLE_MSC3089_TREE_SUBTYPE=new n.UnstableValue("m.data_tree","org.matrix.msc3089.data_tree"),i.UNSTABLE_MSC3089_LEAF=new n.UnstableValue("m.leaf","org.matrix.msc3089.leaf"),i.UNSTABLE_MSC3089_BRANCH=new n.UnstableValue("m.branch","org.matrix.msc3089.branch"),i.UNSTABLE_MSC2716_MARKER=new n.UnstableValue("m.room.marker","org.matrix.msc2716.marker"),i.MSC3912_RELATION_BASED_REDACTIONS_PROP=new n.UnstableValue("with_rel_types","org.matrix.msc3912.with_relations"),i.UNSTABLE_ELEMENT_FUNCTIONAL_USERS=new n.UnstableValue("io.element.functional_members","io.element.functional_members"),i.EVENT_VISIBILITY_CHANGE_TYPE=new n.UnstableValue("m.visibility","org.matrix.msc3531.visibility"),i.PUSHER_ENABLED=new n.UnstableValue("enabled","org.matrix.msc3881.enabled"),i.PUSHER_DEVICE_ID=new n.UnstableValue("device_id","org.matrix.msc3881.device_id"),i.LOCAL_NOTIFICATION_SETTINGS_PREFIX=new n.UnstableValue("m.local_notification_settings","org.matrix.msc3890.local_notification_settings"),i.UNSIGNED_THREAD_ID_FIELD=new n.UnstableValue("thread_id","org.matrix.msc4023.thread_id")},{"../NamespacedValue":333}],320:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.isEventTypeSame=i.REFERENCE_RELATION=i.M_HTML=i.M_TEXT=i.M_MESSAGE=void 0;const n=e("matrix-events-sdk"),r=e("../extensible_events_v1/utilities");i.M_MESSAGE=new n.UnstableValue("m.message","org.matrix.msc1767.message"),i.M_TEXT=new n.UnstableValue("m.text","org.matrix.msc1767.text"),i.M_HTML=new n.UnstableValue("m.html","org.matrix.msc1767.html"),i.REFERENCE_RELATION=new n.NamespacedValue("m.reference"),i.isEventTypeSame=function(e,t){if("string"==typeof e)return"string"==typeof t?t===e:t.matches(e);if("string"==typeof t)return e.matches(t);{const i=t,n=e;return i.matches(n.name)||(0,r.isProvided)(n.altName)&&i.matches(n.altName)}}},{"../extensible_events_v1/utilities":383,"matrix-events-sdk":173}],321:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],322:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.M_LOCATION=i.M_TIMESTAMP=i.M_ASSET=i.LocationAssetType=void 0;const n=e("../NamespacedValue");e("./extensible_events");var r;!function(e){e.Self="m.self",e.Pin="m.pin"}(r||(i.LocationAssetType=r={})),i.M_ASSET=new n.UnstableValue("m.asset","org.matrix.msc3488.asset"),i.M_TIMESTAMP=new n.UnstableValue("m.ts","org.matrix.msc3488.ts"),i.M_LOCATION=new n.UnstableValue("m.location","org.matrix.msc3488.location")},{"../NamespacedValue":333,"./extensible_events":320}],323:[function(e,t,i){"use strict";var n,r,o,s,a,c;Object.defineProperty(i,"__esModule",{value:!0}),i.HistoryVisibility=i.GuestAccess=i.RestrictedAllowType=i.JoinRule=i.Preset=i.Visibility=void 0,function(e){e.Public="public",e.Private="private"}(n||(i.Visibility=n={})),function(e){e.PrivateChat="private_chat",e.TrustedPrivateChat="trusted_private_chat",e.PublicChat="public_chat"}(r||(i.Preset=r={})),function(e){e.Public="public",e.Invite="invite",e.Private="private",e.Knock="knock",e.Restricted="restricted"}(o||(i.JoinRule=o={})),function(e){e.RoomMembership="m.room_membership"}(s||(i.RestrictedAllowType=s={})),function(e){e.CanJoin="can_join",e.Forbidden="forbidden"}(a||(i.GuestAccess=a={})),function(e){e.Invited="invited",e.Joined="joined",e.Shared="shared",e.WorldReadable="world_readable"}(c||(i.HistoryVisibility=c={}))},{}],324:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.M_POLL_END=i.M_POLL_RESPONSE=i.M_POLL_START=i.M_POLL_KIND_UNDISCLOSED=i.M_POLL_KIND_DISCLOSED=void 0;const n=e("matrix-events-sdk");i.M_POLL_KIND_DISCLOSED=new n.UnstableValue("m.poll.disclosed","org.matrix.msc3381.poll.disclosed"),i.M_POLL_KIND_UNDISCLOSED=new n.UnstableValue("m.poll.undisclosed","org.matrix.msc3381.poll.undisclosed"),i.M_POLL_START=new n.UnstableValue("m.poll.start","org.matrix.msc3381.poll.start"),i.M_POLL_RESPONSE=new n.UnstableValue("m.poll.response","org.matrix.msc3381.poll.response"),i.M_POLL_END=new n.UnstableValue("m.poll.end","org.matrix.msc3381.poll.end")},{"matrix-events-sdk":173}],325:[function(e,t,i){"use strict";var n;Object.defineProperty(i,"__esModule",{value:!0}),i.MAIN_ROOM_TIMELINE=i.ReceiptType=void 0,function(e){e.Read="m.read",e.FullyRead="m.fully_read",e.ReadPrivate="m.read.private"}(n||(i.ReceiptType=n={})),i.MAIN_ROOM_TIMELINE="main"},{}],326:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],327:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],328:[function(e,t,i){"use strict";var n,r;Object.defineProperty(i,"__esModule",{value:!0}),i.SearchOrderBy=void 0,function(e){e.RoomId="room_id",e.Sender="sender"}(n||(n={})),function(e){e.Recent="recent",e.Rank="rank"}(r||(i.SearchOrderBy=r={}))},{}],329:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UNREAD_THREAD_NOTIFICATIONS=void 0;const n=e("../NamespacedValue");i.UNREAD_THREAD_NOTIFICATIONS=new n.ServerControlledNamespacedValue("unread_thread_notifications","org.matrix.msc3773.unread_thread_notifications")},{"../NamespacedValue":333}],330:[function(e,t,i){"use strict";var n;Object.defineProperty(i,"__esModule",{value:!0}),i.ThreepidMedium=void 0,function(e){e.Email="email",e.Phone="msisdn"}(n||(i.ThreepidMedium=n={}))},{}],331:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.M_TOPIC=void 0;const n=e("../NamespacedValue");i.M_TOPIC=new n.UnstableValue("m.topic","org.matrix.msc3765.topic")},{"../NamespacedValue":333}],332:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],333:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.UnstableValue=i.ServerControlledNamespacedValue=i.NamespacedValue=void 0;class n{constructor(e,t){if(this.stable=e,this.unstable=t,!this.unstable&&!this.stable)throw new Error("One of stable or unstable values must be supplied")}get name(){return this.stable?this.stable:this.unstable}get altName(){return this.stable?this.unstable:null}get names(){const e=[this.name],t=this.altName;return t&&e.push(t),e}matches(e){return this.name===e||this.altName===e}findIn(e){let t;return this.name&&(t=null==e?void 0:e[this.name]),!t&&this.altName&&(t=null==e?void 0:e[this.altName]),t}includedIn(e){let t=!1;return this.name&&(t=e.includes(this.name)),!t&&this.altName&&(t=e.includes(this.altName)),t}}i.NamespacedValue=n;i.ServerControlledNamespacedValue=class extends n{constructor(){super(...arguments),this.preferUnstable=!1}setPreferUnstable(e){this.preferUnstable=e}get name(){return this.stable&&!this.preferUnstable?this.stable:this.unstable}};i.UnstableValue=class extends n{constructor(e,t){if(super(e,t),!this.unstable)throw new Error("Unstable value must be supplied")}get name(){return this.unstable}get altName(){return this.stable}}},{}],334:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.TypedReEmitter=i.ReEmitter=void 0;class n{constructor(e){this.target=e,this.reEmitters=new WeakMap}reEmit(e,t){let i=this.reEmitters.get(e);i||(i=new Map,this.reEmitters.set(e,i));for(const n of t){if(i.has(n))continue;const t=(...t)=>{"error"===n&&0===this.target.listenerCount("error")||this.target.emit(n,...t,e)};e.on(n,t),i.set(n,t)}}stopReEmitting(e,t){const i=this.reEmitters.get(e);if(i){for(const n of t)e.off(n,i.get(n)),i.delete(n);0===i.size&&this.reEmitters.delete(e)}}}i.ReEmitter=n;i.TypedReEmitter=class extends n{constructor(e){super(e)}reEmit(e,t){super.reEmit(e,t)}stopReEmitting(e,t){super.stopReEmitting(e,t)}}},{}],335:[function(e,t,i){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(i,"__esModule",{value:!0}),i.ToDeviceMessageQueue=void 0;const r=e("./@types/event"),o=e("./logger"),s=e("./client"),a=e("./scheduler"),c=e("./sync"),d=e("./utils");i.ToDeviceMessageQueue=class{constructor(e){this.client=e,this.sending=!1,this.running=!0,this.retryTimeout=null,this.retryAttempts=0,this.sendQueue=()=>n(this,void 0,void 0,(function*(){if(null!==this.retryTimeout&&clearTimeout(this.retryTimeout),this.retryTimeout=null,this.sending||!this.running)return;let e;o.logger.debug("Attempting to send queued to-device messages"),this.sending=!0;try{for(;this.running&&(e=yield this.client.store.getOldestToDeviceBatch(),null!==e);)yield this.sendBatch(e),yield this.client.store.removeToDeviceBatch(e.id),this.retryAttempts=0;if(!this.running)return;o.logger.debug("All queued to-device messages sent")}catch(t){++this.retryAttempts;const i=a.MatrixScheduler.RETRY_BACKOFF_RATELIMIT(null,this.retryAttempts,t);if(-1===i)return void(4===Math.floor(t.httpStatus/100)?(o.logger.error("Fatal error when sending to-device message - dropping to-device batch!",t),yield this.client.store.removeToDeviceBatch(e.id)):o.logger.info("Automatic retry limit reached for to-device messages."));o.logger.info(`Failed to send batch of to-device messages. Will retry in ${i}ms`,t),this.retryTimeout=setTimeout(this.sendQueue,i)}finally{this.sending=!1}})),this.onResumedSync=(e,t)=>{e===c.SyncState.Syncing&&t!==c.SyncState.Syncing&&(o.logger.info("Resuming queue after resumed sync"),this.sendQueue())}}start(){this.running=!0,this.sendQueue(),this.client.on(s.ClientEvent.Sync,this.onResumedSync)}stop(){this.running=!1,null!==this.retryTimeout&&clearTimeout(this.retryTimeout),this.retryTimeout=null,this.client.removeListener(s.ClientEvent.Sync,this.onResumedSync)}queueBatch(e){return n(this,void 0,void 0,(function*(){const t=[];for(let i=0;i<e.batch.length;i+=20){const n={eventType:e.eventType,batch:e.batch.slice(i,i+20),txnId:this.client.makeTxnId()};t.push(n);const s=n.batch.map((e=>`${e.userId}/${e.deviceId} (msgid ${e.payload[r.ToDeviceMessageId]})`));o.logger.info(`Enqueuing batch of to-device messages. type=${e.eventType} txnid=${n.txnId}`,s)}yield this.client.store.saveToDeviceBatches(t),this.sendQueue()}))}sendBatch(e){return n(this,void 0,void 0,(function*(){const t=new d.MapWithDefault((()=>new Map));for(const i of e.batch)t.getOrCreate(i.userId).set(i.deviceId,i.payload);o.logger.info(`Sending batch of ${e.batch.length} to-device messages with ID ${e.id} and txnId ${e.txnId}`),yield this.client.sendToDevice(e.eventType,t,e.txnId)}))}}},{"./@types/event":319,"./client":338,"./logger":396,"./scheduler":433,"./sync":445,"./utils":447}],336:[function(e,t,i){(function(t){(function(){"use strict";var n=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(i,"__esModule",{value:!0}),i.AutoDiscovery=i.AutoDiscoveryAction=void 0;const r=e("./client"),o=e("./logger"),s=e("./http-api"),a=e("./oidc/discovery"),c=e("./oidc/validate"),d=e("./oidc/error"),l=e("./version-support");var u,h;!function(e){e.SUCCESS="SUCCESS",e.IGNORE="IGNORE",e.PROMPT="PROMPT",e.FAIL_PROMPT="FAIL_PROMPT",e.FAIL_ERROR="FAIL_ERROR"}(u||(i.AutoDiscoveryAction=u={})),function(e){e.Invalid="Invalid homeserver discovery response",e.GenericFailure="Failed to get autodiscovery configuration from server",e.InvalidHsBaseUrl="Invalid base_url for m.homeserver",e.InvalidHomeserver="Homeserver URL does not appear to be a valid Matrix homeserver",e.InvalidIsBaseUrl="Invalid base_url for m.identity_server",e.InvalidIdentityServer="Identity server URL does not appear to be a valid identity server",e.InvalidIs="Invalid identity server discovery response",e.MissingWellknown="No .well-known JSON file found",e.InvalidJson="Invalid JSON",e.HomeserverTooOld="The homeserver does not meet the minimum version requirements"}(h||(h={}));class f{static fromDiscoveryConfig(e){var t;return n(this,void 0,void 0,(function*(){const i={"m.homeserver":{state:f.FAIL_ERROR,error:f.ERROR_INVALID,base_url:null},"m.identity_server":{state:f.PROMPT,error:null,base_url:null}};if(!(null==e?void 0:e["m.homeserver"]))return o.logger.error("No m.homeserver key in config"),i["m.homeserver"].state=f.FAIL_PROMPT,i["m.homeserver"].error=f.ERROR_INVALID,Promise.resolve(i);if(!e["m.homeserver"].base_url)return o.logger.error("No m.homeserver base_url in config"),i["m.homeserver"].state=f.FAIL_PROMPT,i["m.homeserver"].error=f.ERROR_INVALID_HS_BASE_URL,Promise.resolve(i);const n=this.sanitizeWellKnownUrl(e["m.homeserver"].base_url);if(!n)return o.logger.error("Invalid base_url for m.homeserver"),i["m.homeserver"].error=f.ERROR_INVALID_HS_BASE_URL,Promise.resolve(i);const s=yield this.fetchWellKnownObject(`${n}/_matrix/client/versions`);if(!s||!Array.isArray(null===(t=s.raw)||void 0===t?void 0:t.versions))return o.logger.error("Invalid /versions response"),i["m.homeserver"].error=f.ERROR_INVALID_HOMESERVER,i["m.homeserver"].base_url=n,Promise.resolve(i);if(!s.raw.versions.includes(l.MINIMUM_MATRIX_VERSION))return o.logger.error("Homeserver does not meet minimum version requirements"),i["m.homeserver"].error=f.ERROR_HOMESERVER_TOO_OLD,i["m.homeserver"].base_url=n,Promise.resolve(i);i["m.homeserver"]={state:f.SUCCESS,error:null,base_url:n};let a="";if(e["m.identity_server"]){const t={"m.homeserver":i["m.homeserver"],"m.identity_server":{state:f.FAIL_PROMPT,error:f.ERROR_INVALID_IS,base_url:null}};if(a=this.sanitizeWellKnownUrl(e["m.identity_server"].base_url),!a)return o.logger.error("Invalid base_url for m.identity_server"),t["m.identity_server"].error=f.ERROR_INVALID_IS_BASE_URL,Promise.resolve(t);const n=yield this.fetchWellKnownObject(`${a}/_matrix/identity/v2`);if(!(null==n?void 0:n.raw)||n.action!==u.SUCCESS)return o.logger.error("Invalid /v2 response"),t["m.identity_server"].error=f.ERROR_INVALID_IDENTITY_SERVER,t["m.identity_server"].base_url=a,Promise.resolve(t)}a&&a.toString().length>0&&(i["m.identity_server"]={state:f.SUCCESS,error:null,base_url:a}),Object.keys(e).forEach((t=>{if("m.homeserver"===t||"m.identity_server"===t){const n=["error","state","base_url"];for(const r of Object.keys(e[t]))n.includes(r)||(i[t][r]=e[t][r])}else i[t]=e[t]}));const c=yield this.discoverAndValidateAuthenticationConfig(e);return i[r.M_AUTHENTICATION.stable]=c,Promise.resolve(i)}))}static validateDiscoveryAuthenticationConfig(e){return n(this,void 0,void 0,(function*(){try{const t=r.M_AUTHENTICATION.findIn(e)||void 0,i=(0,c.validateWellKnownAuthentication)(t),n=`${this.sanitizeWellKnownUrl(i.issuer)}/.well-known/openid-configuration`,s=yield this.fetchWellKnownObject(n);if(s.action!==u.SUCCESS)throw o.logger.error("Failed to fetch issuer openid configuration"),new Error(d.OidcError.General);const a=(0,c.validateOIDCIssuerWellKnown)(s.raw);return Object.assign(Object.assign({state:u.SUCCESS,error:null},i),a)}catch(e){const t=e.message,i=Object.values(d.OidcError).includes(t)?t:d.OidcError.General;return{state:i===d.OidcError.NotSupported?u.IGNORE:u.FAIL_ERROR,error:i}}}))}static discoverAndValidateAuthenticationConfig(e){return n(this,void 0,void 0,(function*(){try{const t=r.M_AUTHENTICATION.findIn(e)||void 0,i=yield(0,a.discoverAndValidateAuthenticationConfig)(t),n=(0,c.validateOIDCIssuerWellKnown)(i.metadata);return Object.assign(Object.assign({state:u.SUCCESS,error:null},n),i)}catch(e){const t=e.message,i=Object.values(d.OidcError).includes(t)?t:d.OidcError.General;return{state:i===d.OidcError.NotSupported?u.IGNORE:u.FAIL_ERROR,error:i}}}))}static findClientConfig(e){return n(this,void 0,void 0,(function*(){if(!e||"string"!=typeof e||0===e.length)throw new Error("'domain' must be a string of non-zero length");const t={"m.homeserver":{state:f.FAIL_ERROR,error:f.ERROR_INVALID,base_url:null},"m.identity_server":{state:f.PROMPT,error:null,base_url:null}},i=e.includes("://")?e:`https://${e}`,n=yield this.fetchWellKnownObject(`${i}/.well-known/matrix/client`);return n&&n.action===u.SUCCESS?f.fromDiscoveryConfig(n.raw):(o.logger.error("No response or error when parsing .well-known"),n.reason&&o.logger.error(n.reason),n.action===u.IGNORE?t["m.homeserver"]={state:f.PROMPT,error:null,base_url:null}:(t["m.homeserver"].state=f.FAIL_PROMPT,t["m.homeserver"].error=f.ERROR_INVALID),Promise.resolve(t))}))}static getRawClientConfig(e){var t;return n(this,void 0,void 0,(function*(){if(!e||"string"!=typeof e||0===e.length)throw new Error("'domain' must be a string of non-zero length");const i=yield this.fetchWellKnownObject(`https://${e}/.well-known/matrix/client`);return i&&null!==(t=i.raw)&&void 0!==t?t:{}}))}static sanitizeWellKnownUrl(e){if(!e)return!1;try{let t;try{t=new URL(e)}catch(e){o.logger.error("Could not parse url",e)}if(!(null==t?void 0:t.hostname))return!1;if("http:"!==t.protocol&&"https:"!==t.protocol)return!1;const i=t.port?`:${t.port}`:"",n=t.pathname?t.pathname:"";let r=`${t.protocol}//${t.hostname}${i}${n}`;return r.endsWith("/")&&(r=r.substring(0,r.length-1)),r}catch(e){return o.logger.error(e),!1}}static fetch(e,i){return this.fetchFn?this.fetchFn(e,i):t.fetch(e,i)}static setFetchFn(e){f.fetchFn=e}static fetchWellKnownObject(e){return n(this,void 0,void 0,(function*(){let t;try{if(t=yield f.fetch(e,{method:s.Method.Get,signal:(0,s.timeoutSignal)(5e3)}),404===t.status)return{raw:{},action:u.IGNORE,reason:f.ERROR_MISSING_WELLKNOWN};if(!t.ok)return{raw:{},action:u.FAIL_PROMPT,reason:"General failure"}}catch(e){const t=e;let i="";return"object"==typeof t&&(i=null==t?void 0:t.message),{error:t,raw:{},action:u.FAIL_PROMPT,reason:i||"General failure"}}try{return{raw:yield t.json(),action:u.SUCCESS}}catch(e){const t=e;return{error:t,raw:{},action:u.FAIL_PROMPT,reason:"SyntaxError"===(null==t?void 0:t.name)?f.ERROR_INVALID_JSON:f.ERROR_INVALID}}}))}}i.AutoDiscovery=f,f.ERROR_INVALID=h.Invalid,f.ERROR_GENERIC_FAILURE=h.GenericFailure,f.ERROR_INVALID_HS_BASE_URL=h.InvalidHsBaseUrl,f.ERROR_INVALID_HOMESERVER=h.InvalidHomeserver,f.ERROR_INVALID_IS_BASE_URL=h.InvalidIsBaseUrl,f.ERROR_INVALID_IDENTITY_SERVER=h.InvalidIdentityServer,f.ERROR_INVALID_IS=h.InvalidIs,f.ERROR_MISSING_WELLKNOWN=h.MissingWellknown,f.ERROR_INVALID_JSON=h.InvalidJson,f.ERROR_HOMESERVER_TOO_OLD=h.HomeserverTooOld,f.ALL_ERRORS=Object.keys(h),f.FAIL_ERROR=u.FAIL_ERROR,f.FAIL_PROMPT=u.FAIL_PROMPT,f.PROMPT=u.PROMPT,f.SUCCESS=u.SUCCESS}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./client":338,"./http-api":389,"./logger":396,"./oidc/discovery":423,"./oidc/error":424,"./oidc/validate":425,"./version-support":448}],337:[function(e,t,i){(function(t){(function(){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return r(t,e),t},s=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||n(t,e,i)};Object.defineProperty(i,"__esModule",{value:!0});const a=o(e("./matrix"));if(t.__js_sdk_entrypoint)throw new Error("Multiple matrix-js-sdk entrypoints detected!");let c;t.__js_sdk_entrypoint=!0;try{c=t.indexedDB}catch(e){}c&&a.setCryptoStoreFactory((()=>new a.IndexedDBCryptoStore(c,"matrix-js-sdk:crypto"))),s(e("./matrix"),i),i.default=a,t.matrixcs=a}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./matrix":397}],338:[function(e,t,i){(function(t){(function(){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),r=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&n(t,e,i);return r(t,e),t},s=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))},a=this&&this.__rest||function(e,t){var i={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(i[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(n=Object.getOwnPropertySymbols(e);r<n.length;r++)t.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(e,n[r])&&(i[n[r]]=e[n[r]])}return i};Object.defineProperty(i,"__esModule",{value:!0}),i.fixNotificationCountOnDecryption=i.MatrixClient=i.ClientEvent=i.M_AUTHENTICATION=i.UNSTABLE_MSC2666_QUERY_MUTUAL_ROOMS=i.UNSTABLE_MSC2666_MUTUAL_ROOMS=i.UNSTABLE_MSC2666_SHARED_ROOMS=i.UNSTABLE_MSC3882_CAPABILITY=i.RoomVersionStability=i.PendingEventOrdering=i.UNSTABLE_MSC3852_LAST_SEEN_UA=i.CRYPTO_ENABLED=void 0;const c=e("./sync"),d=e("./models/event"),l=e("./store/stub"),u=e("./webrtc/call"),h=e("./filter"),f=e("./webrtc/callEventHandler"),p=e("./webrtc/groupCallEventHandler"),g=o(e("./utils")),v=e("./utils"),m=e("./models/event-timeline"),y=e("./pushprocessor"),b=e("./autodiscovery"),_=o(e("./crypto/olmlib")),S=e("./crypto/olmlib"),E=e("./ReEmitter"),w=e("./crypto/RoomList"),T=e("./logger"),I=e("./service-types"),R=e("./http-api"),k=e("./crypto"),M=e("./crypto/recoverykey"),C=e("./crypto/key_passphrase"),O=e("./models/user"),A=e("./content-repo"),P=e("./models/search-result"),D=e("./crypto/dehydration"),x=e("./crypto/api"),L=o(e("./content-helpers")),U=e("./models/room"),N=e("./models/room-member"),B=e("./@types/event"),j=e("./@types/partials"),F=e("./event-mapper"),K=e("./randomstring"),q=e("./crypto/backup"),$=e("./models/MSC3089TreeSpace"),V=e("./@types/search"),H=e("./@types/PushRules"),W=e("./webrtc/groupCall"),G=e("./webrtc/mediaHandler"),z=e("./models/typed-event-emitter"),Y=e("./@types/read_receipts"),J=e("./sliding-sync-sdk"),Q=e("./models/thread"),X=e("./@types/beacon"),Z=e("./NamespacedValue"),ee=e("./ToDeviceMessageQueue"),te=e("./models/invites-ignorer"),ie=e("./feature"),ne=e("./rust-crypto/constants"),re=e("./secret-storage"),oe=e("./matrixrtc/MatrixRTCSessionManager");i.CRYPTO_ENABLED=(0,k.isCryptoAvailable)();const se=6e5;var ae,ce,de;i.UNSTABLE_MSC3852_LAST_SEEN_UA=new Z.UnstableValue("last_seen_user_agent","org.matrix.msc3852.last_seen_user_agent"),function(e){e.Chronological="chronological",e.Detached="detached"}(ae||(i.PendingEventOrdering=ae={})),function(e){e.Stable="stable",e.Unstable="unstable"}(ce||(i.RoomVersionStability=ce={})),i.UNSTABLE_MSC3882_CAPABILITY=new Z.UnstableValue("m.get_login_token","org.matrix.msc3882.get_login_token"),i.UNSTABLE_MSC2666_SHARED_ROOMS="uk.half-shot.msc2666",i.UNSTABLE_MSC2666_MUTUAL_ROOMS="uk.half-shot.msc2666.mutual_rooms",i.UNSTABLE_MSC2666_QUERY_MUTUAL_ROOMS="uk.half-shot.msc2666.query_mutual_rooms",function(e){e.MasterKey="master_key",e.SelfSigningKey="self_signing_key",e.UserSigningKey="user_signing_key"}(de||(de={})),i.M_AUTHENTICATION=new Z.UnstableValue("m.authentication","org.matrix.msc2965.authentication");const le="$";var ue;!function(e){e.Sync="sync",e.Event="event",e.ToDeviceEvent="toDeviceEvent",e.AccountData="accountData",e.Room="Room",e.DeleteRoom="deleteRoom",e.SyncUnexpectedError="sync.unexpectedError",e.ClientWellKnown="WellKnown.client",e.ReceivedVoipEvent="received_voip_event",e.UndecryptableToDeviceEvent="toDeviceEvent.undecryptable",e.TurnServers="turnServers",e.TurnServersError="turnServers.error"}(ue||(i.ClientEvent=ue={}));const he=new Z.UnstableValue("action","org.matrix.msc3824.action");class fe extends z.TypedEventEmitter{constructor(e){var t,i;super(),this.reEmitter=new E.TypedReEmitter(this),this.olmVersion=null,this.usingExternalCrypto=!1,this.clientRunning=!1,this.timelineSupport=!1,this.urlPreviewCache={},this.supportsCallTransfer=!1,this.forceTURN=!1,this.iceCandidatePoolSize=0,this.canSupportVoip=!1,this.peekSync=null,this.isGuestAccount=!1,this.ongoingScrollbacks={},this.notifTimelineSet=null,this.fallbackICEServerAllowed=!1,this.syncedLeftRooms=!1,this.canSupport=new Map,this.pushProcessor=new y.PushProcessor(this),this.turnServers=[],this.turnServersExpiry=0,this.txnCtr=0,this.mediaHandler=new G.MediaHandler(this),this.pendingEventEncryption=new Map,this.useE2eForGroupCall=!0,this.startCallEventHandler=()=>{this.isInitialSyncComplete()&&((0,u.supportsMatrixCall)()&&(this.callEventHandler.start(),this.groupCallEventHandler.start()),this.off(ue.Sync,this.startCallEventHandler))},this.startMatrixRTC=()=>{this.isInitialSyncComplete()&&(this.matrixRTC.start(),this.off(ue.Sync,this.startMatrixRTC))},this.fixupRoomNotifications=()=>{var e;if(this.isInitialSyncComplete()){const t=(null!==(e=this.getRooms())&&void 0!==e?e:[]).filter((e=>e.getUnreadNotificationCount(U.NotificationCountType.Total)>0));for(const e of t){const t=this.getSafeUserId();e.fixupNotifications(t)}this.off(ue.Sync,this.fixupRoomNotifications)}},e.baseUrl=g.ensureNoTrailingSlash(e.baseUrl),e.idBaseUrl=g.ensureNoTrailingSlash(e.idBaseUrl),this.baseUrl=e.baseUrl,this.idBaseUrl=e.idBaseUrl,this.identityServer=e.identityServer,this.usingExternalCrypto=null!==(t=e.usingExternalCrypto)&&void 0!==t&&t,this.store=e.store||new l.StubStore,this.deviceId=e.deviceId||null,this.sessionId=(0,K.randomString)(10);const n=e.userId||null;this.credentials={userId:n},this.http=new R.MatrixHttpApi(this,{fetchFn:e.fetchFn,baseUrl:e.baseUrl,idBaseUrl:e.idBaseUrl,accessToken:e.accessToken,prefix:R.ClientPrefix.V3,onlyData:!0,extraParams:e.queryParams,localTimeoutMs:e.localTimeoutMs,useAuthorizationHeader:e.useAuthorizationHeader}),e.deviceToImport?this.deviceId?T.logger.warn("not importing device because device ID is provided to constructor independently of exported data"):this.credentials.userId?T.logger.warn("not importing device because user ID is provided to constructor independently of exported data"):e.deviceToImport.deviceId?(this.deviceId=e.deviceToImport.deviceId,this.credentials.userId=e.deviceToImport.userId,this.exportedOlmDeviceToImport=e.deviceToImport.olmDevice):T.logger.warn("not importing device because no device ID in exported data"):e.pickleKey&&(this.pickleKey=e.pickleKey),this.useLivekitForGroupCalls=Boolean(e.useLivekitForGroupCalls),this.scheduler=e.scheduler,this.scheduler&&this.scheduler.setProcessFunction((e=>s(this,void 0,void 0,(function*(){const t=this.getRoom(e.getRoomId());e.status!==d.EventStatus.SENDING&&this.updatePendingEventStatus(t,e,d.EventStatus.SENDING);const i=yield this.sendEventHttpRequest(e);return t&&t.updatePendingEvent(e,d.EventStatus.SENT,i.event_id),i})))),(0,u.supportsMatrixCall)()&&(this.callEventHandler=new f.CallEventHandler(this),this.groupCallEventHandler=new p.GroupCallEventHandler(this),this.canSupportVoip=!0,this.on(ue.Sync,this.startCallEventHandler)),this.matrixRTC=new oe.MatrixRTCSessionManager(this),this.on(ue.Sync,this.fixupRoomNotifications),this.timelineSupport=Boolean(e.timelineSupport),this.cryptoStore=e.cryptoStore,this.verificationMethods=e.verificationMethods,this.cryptoCallbacks=e.cryptoCallbacks||{},this.forceTURN=e.forceTURN||!1,this.iceCandidatePoolSize=void 0===e.iceCandidatePoolSize?0:e.iceCandidatePoolSize,this.supportsCallTransfer=e.supportsCallTransfer||!1,this.fallbackICEServerAllowed=e.fallbackICEServerAllowed||!1,this.isVoipWithNoMediaAllowed=e.isVoipWithNoMediaAllowed||!1,void 0!==e.useE2eForGroupCall&&(this.useE2eForGroupCall=e.useE2eForGroupCall),this.livekitServiceURL=e.livekitServiceURL,this.roomList=new w.RoomList(this.cryptoStore),this.roomNameGenerator=e.roomNameGenerator,this.toDeviceMessageQueue=new ee.ToDeviceMessageQueue(this),this.on(d.MatrixEventEvent.Decrypted,(e=>{pe(this,e)})),this.on(U.RoomEvent.Receipt,((e,t)=>{var i;if(t&&this.isRoomEncrypted(t.roomId)){const n=e.getContent();if(!(Object.keys(n).filter((e=>{for(const[t,i]of Object.entries(n[e]))if(g.isSupportedReceiptType(t)&&i&&Object.keys(i).includes(this.getUserId()))return!0;return!1})).length>0))return;const r=20,o=t.getLiveTimeline().getEvents();let s=0;for(let e=o.length-1;e>=0;e--){if(e===o.length-r)return;const n=o[e];if(t.hasUserReadEvent(this.getUserId(),n.getId()))break;const a=this.getPushActionsForEvent(n);s+=(null===(i=null==a?void 0:a.tweaks)||void 0===i?void 0:i.highlight)?1:0}t.setUnreadNotificationCount(U.NotificationCountType.Highlight,s)}})),this.ignoredInvites=new te.IgnoredInvites(this),this._secretStorage=new re.ServerSideSecretStorageImpl(this,null!==(i=e.cryptoCallbacks)&&void 0!==i?i:{})}startClient(e){return s(this,void 0,void 0,(function*(){if(this.clientRunning)return;this.clientRunning=!0,this.on(ue.Sync,this.startMatrixRTC),"number"==typeof e&&(e={initialSyncLimit:e});const t=this.getUserId();t&&this.store.storeUser(new O.User(t)),this.canSupportVoip&&(this.checkTurnServersIntervalID=setInterval((()=>{this.checkTurnServers()}),se),this.checkTurnServers()),this.syncApi&&(T.logger.error("Still have sync object whilst not running: stopping old one"),this.syncApi.stop());try{yield this.getVersions();const{threads:e,list:t,fwdPagination:i}=yield this.doesServerSupportThread();Q.Thread.setServerSideSupport(e),Q.Thread.setServerSideListSupport(t),Q.Thread.setServerSideFwdPaginationSupport(i)}catch(e){T.logger.error("Can't fetch server versions, continuing to initialise sync, this will be retried later",e)}this.clientOpts=null!=e?e:{},this.clientOpts.slidingSync?this.syncApi=new J.SlidingSyncSdk(this.clientOpts.slidingSync,this,this.clientOpts,this.buildSyncApiOptions()):this.syncApi=new c.SyncApi(this,this.clientOpts,this.buildSyncApiOptions()),this.clientOpts.hasOwnProperty("experimentalThreadSupport")&&T.logger.warn("`experimentalThreadSupport` has been deprecated, use `threadSupport` instead"),!this.clientOpts.hasOwnProperty("threadSupport")&&this.clientOpts.hasOwnProperty("experimentalThreadSupport")&&(this.clientOpts.threadSupport=this.clientOpts.experimentalThreadSupport),this.syncApi.sync(),void 0!==this.clientOpts.clientWellKnownPollPeriod&&(this.clientWellKnownIntervalID=setInterval((()=>{this.fetchClientWellKnown()}),1e3*this.clientOpts.clientWellKnownPollPeriod),this.fetchClientWellKnown()),this.toDeviceMessageQueue.start()}))}buildSyncApiOptions(){return{crypto:this.crypto,cryptoCallbacks:this.cryptoBackend,canResetEntireTimeline:e=>!!this.canResetTimelineCallback&&this.canResetTimelineCallback(e)}}stopClient(){var e,i,n,r,o;null===(e=this.cryptoBackend)||void 0===e||e.stop(),this.off(ue.Sync,this.startMatrixRTC),this.clientRunning&&(T.logger.log("stopping MatrixClient"),this.clientRunning=!1,null===(i=this.syncApi)||void 0===i||i.stop(),this.syncApi=void 0,null===(n=this.peekSync)||void 0===n||n.stopPeeking(),null===(r=this.callEventHandler)||void 0===r||r.stop(),null===(o=this.groupCallEventHandler)||void 0===o||o.stop(),this.callEventHandler=void 0,this.groupCallEventHandler=void 0,t.clearInterval(this.checkTurnServersIntervalID),this.checkTurnServersIntervalID=void 0,void 0!==this.clientWellKnownIntervalID&&t.clearInterval(this.clientWellKnownIntervalID),this.toDeviceMessageQueue.stop(),this.matrixRTC.stop())}rehydrateDevice(){return s(this,void 0,void 0,(function*(){if(this.crypto)throw new Error("Cannot rehydrate device after crypto is initialized");if(!this.cryptoCallbacks.getDehydrationKey)return;const e=yield this.getDehydratedDevice();if(!e)return;if(!e.device_data||!e.device_id)return void T.logger.info("no dehydrated device found");const i=new t.Olm.Account;try{const t=e.device_data;if(t.algorithm!==D.DEHYDRATION_ALGORITHM)return void T.logger.warn("Wrong algorithm for dehydrated device");T.logger.log("unpickling dehydrated device");const n=yield this.cryptoCallbacks.getDehydrationKey(t,(e=>{i.unpickle(new Uint8Array(e),t.account)}));i.unpickle(n,t.account),T.logger.log("unpickled device");if((yield this.http.authedRequest(R.Method.Post,"/dehydrated_device/claim",void 0,{device_id:e.device_id},{prefix:"/_matrix/client/unstable/org.matrix.msc2697.v2"})).success){this.deviceId=e.device_id,T.logger.info("using dehydrated device");const t=this.pickleKey||"DEFAULT_KEY";return this.exportedOlmDeviceToImport={pickledAccount:i.pickle(t),sessions:[],pickleKey:t},i.free(),this.deviceId}return i.free(),void T.logger.info("not using dehydrated device")}catch(e){i.free(),T.logger.warn("could not unpickle",e)}}))}getDehydratedDevice(){return s(this,void 0,void 0,(function*(){try{return yield this.http.authedRequest(R.Method.Get,"/dehydrated_device",void 0,void 0,{prefix:"/_matrix/client/unstable/org.matrix.msc2697.v2"})}catch(e){return void T.logger.info("could not get dehydrated device",e)}}))}setDehydrationKey(e,t,i){return s(this,void 0,void 0,(function*(){if(this.crypto)return this.crypto.dehydrationManager.setKeyAndQueueDehydration(e,t,i);T.logger.warn("not dehydrating device if crypto is not enabled")}))}createDehydratedDevice(e,t,i){return s(this,void 0,void 0,(function*(){if(this.crypto)return yield this.crypto.dehydrationManager.setKey(e,t,i),this.crypto.dehydrationManager.dehydrateDevice();T.logger.warn("not dehydrating device if crypto is not enabled")}))}exportDevice(){return s(this,void 0,void 0,(function*(){if(this.crypto)return{userId:this.credentials.userId,deviceId:this.deviceId,olmDevice:yield this.crypto.olmDevice.export()};T.logger.warn("not exporting device if crypto is not enabled")}))}clearStores(){if(this.clientRunning)throw new Error("Cannot clear stores while client is running");const e=[];e.push(this.store.deleteAllData()),this.cryptoStore&&e.push(this.cryptoStore.deleteAllData());return e.push((()=>s(this,void 0,void 0,(function*(){let e;try{if(e=t.indexedDB,!e)return}catch(e){return}for(const t of[`${ne.RUST_SDK_STORE_PREFIX}::matrix-sdk-crypto`,`${ne.RUST_SDK_STORE_PREFIX}::matrix-sdk-crypto-meta`]){const i=new Promise(((i,n)=>{T.logger.info(`Removing IndexedDB instance ${t}`);const r=e.deleteDatabase(t);r.onsuccess=e=>{T.logger.info(`Removed IndexedDB instance ${t}`),i(0)},r.onerror=e=>{T.logger.warn(`Failed to remove IndexedDB instance ${t}:`,e),i(0)},r.onblocked=e=>{T.logger.info(`cannot yet remove IndexedDB instance ${t}`)}}));yield i}})))()),Promise.all(e).then()}getUserId(){return this.credentials&&this.credentials.userId?this.credentials.userId:null}getSafeUserId(){const e=this.getUserId();if(!e)throw new Error("Expected logged in user but found none.");return e}getDomain(){return this.credentials&&this.credentials.userId?this.credentials.userId.replace(/^.*?:/,""):null}getUserIdLocalpart(){return this.credentials&&this.credentials.userId?this.credentials.userId.split(":")[0].substring(1):null}getDeviceId(){return this.deviceId}getSessionId(){return this.sessionId}supportsVoip(){return this.canSupportVoip}getMediaHandler(){return this.mediaHandler}setForceTURN(e){this.forceTURN=e}setSupportsCallTransfer(e){this.supportsCallTransfer=e}getUseE2eForGroupCall(){return this.useE2eForGroupCall}createCall(e){return(0,u.createNewMatrixCall)(this,e)}createGroupCall(e,t,i,n,r,o){return s(this,void 0,void 0,(function*(){if(this.getGroupCallForRoom(e))throw new Error(`${e} already has an existing group call`);const s=this.getRoom(e);if(!s)throw new Error(`Cannot find room ${e}`);return new W.GroupCall(this,s,t,i,n,void 0,r||this.isVoipWithNoMediaAllowed,o,this.isVoipWithNoMediaAllowed,this.useLivekitForGroupCalls,this.livekitServiceURL).create()}))}getLivekitServiceURL(){return this.livekitServiceURL}setLivekitServiceURL(e){this.livekitServiceURL=e}waitUntilRoomReadyForGroupCalls(e){return this.groupCallEventHandler.waitUntilRoomReadyForGroupCalls(e)}getGroupCallForRoom(e){return this.groupCallEventHandler.groupCalls.get(e)||null}getSyncState(){var e,t;return null!==(t=null===(e=this.syncApi)||void 0===e?void 0:e.getSyncState())&&void 0!==t?t:null}getSyncStateData(){return this.syncApi?this.syncApi.getSyncStateData():null}isInitialSyncComplete(){const e=this.getSyncState();return!!e&&(e===c.SyncState.Prepared||e===c.SyncState.Syncing)}isGuest(){return this.isGuestAccount}setGuest(e){this.isGuestAccount=e}getScheduler(){return this.scheduler}retryImmediately(){var e,t;return this.toDeviceMessageQueue.sendQueue(),null!==(t=null===(e=this.syncApi)||void 0===e?void 0:e.retryImmediately())&&void 0!==t&&t}getNotifTimelineSet(){return this.notifTimelineSet}setNotifTimelineSet(e){this.notifTimelineSet=e}getCapabilities(e=!1){const t=(new Date).getTime();return this.cachedCapabilities&&!e&&t<this.cachedCapabilities.expiration?(T.logger.log("Returning cached capabilities"),Promise.resolve(this.cachedCapabilities.capabilities)):this.http.authedRequest(R.Method.Get,"/capabilities").catch((e=>(T.logger.error(e),{}))).then(((e={})=>{const i=e.capabilities||{},n=Object.keys(i).length?216e5:6e4+5e3*Math.random();return this.cachedCapabilities={capabilities:i,expiration:t+n},T.logger.log("Caching capabilities: ",i),i}))}initCrypto(){return s(this,void 0,void 0,(function*(){if(!(0,k.isCryptoAvailable)())throw new Error("End-to-end encryption not supported in this js-sdk build: did you remember to load the olm library?");if(this.cryptoBackend)return void T.logger.warn("Attempt to re-initialise e2e encryption on MatrixClient");if(!this.cryptoStore)throw new Error("Cannot enable encryption: no cryptoStore provided");T.logger.log("Crypto: Starting up crypto store..."),yield this.cryptoStore.startup(),T.logger.log("Crypto: initialising roomlist..."),yield this.roomList.init();const e=this.getUserId();if(null===e)throw new Error("Cannot enable encryption on MatrixClient with unknown userId: ensure userId is passed in createClient().");if(null===this.deviceId)throw new Error("Cannot enable encryption on MatrixClient with unknown deviceId: ensure deviceId is passed in createClient().");const t=new k.Crypto(this,e,this.deviceId,this.store,this.cryptoStore,this.roomList,this.verificationMethods);this.reEmitter.reEmit(t,[k.CryptoEvent.KeyBackupFailed,k.CryptoEvent.KeyBackupSessionsRemaining,k.CryptoEvent.RoomKeyRequest,k.CryptoEvent.RoomKeyRequestCancellation,k.CryptoEvent.Warning,k.CryptoEvent.DevicesUpdated,k.CryptoEvent.WillUpdateDevices,k.CryptoEvent.DeviceVerificationChanged,k.CryptoEvent.UserTrustStatusChanged,k.CryptoEvent.KeysChanged]),T.logger.log("Crypto: initialising crypto object..."),yield t.init({exportedOlmDevice:this.exportedOlmDeviceToImport,pickleKey:this.pickleKey}),delete this.exportedOlmDeviceToImport,this.olmVersion=k.Crypto.getOlmVersion(),t.registerEventHandlers(this),this.cryptoBackend=this.crypto=t,this.crypto.uploadDeviceKeys().catch((e=>{T.logger.error("Error uploading device keys",e)}))}))}initRustCrypto({useIndexedDB:t=!0}={}){return s(this,void 0,void 0,(function*(){if(this.cryptoBackend)return void T.logger.warn("Attempt to re-initialise e2e encryption on MatrixClient");const i=this.getUserId();if(null===i)throw new Error("Cannot enable encryption on MatrixClient with unknown userId: ensure userId is passed in createClient().");const n=this.getDeviceId();if(null===n)throw new Error("Cannot enable encryption on MatrixClient with unknown deviceId: ensure deviceId is passed in createClient().");const r=yield Promise.resolve().then((()=>o(e("./rust-crypto")))),s=yield r.initRustCrypto(this.http,i,n,this.secretStorage,this.cryptoCallbacks,t?ne.RUST_SDK_STORE_PREFIX:null);s.setSupportedVerificationMethods(this.verificationMethods),this.cryptoBackend=s,this.on(N.RoomMemberEvent.Membership,s.onRoomMembership.bind(s)),this.on(ue.Event,(e=>{s.onLiveEventFromSync(e)})),this.reEmitter.reEmit(s,[k.CryptoEvent.VerificationRequestReceived,k.CryptoEvent.UserTrustStatusChanged,k.CryptoEvent.KeyBackupStatus,k.CryptoEvent.KeyBackupSessionsRemaining,k.CryptoEvent.KeyBackupFailed])}))}get secretStorage(){return this._secretStorage}getCrypto(){return this.cryptoBackend}isCryptoEnabled(){return!!this.cryptoBackend}getDeviceEd25519Key(){var e,t;return null!==(t=null===(e=this.crypto)||void 0===e?void 0:e.getDeviceEd25519Key())&&void 0!==t?t:null}getDeviceCurve25519Key(){var e,t;return null!==(t=null===(e=this.crypto)||void 0===e?void 0:e.getDeviceCurve25519Key())&&void 0!==t?t:null}uploadKeys(){return s(this,void 0,void 0,(function*(){T.logger.warn("MatrixClient.uploadKeys is deprecated")}))}downloadKeys(e,t){return this.crypto?this.crypto.downloadKeys(e,t):Promise.reject(new Error("End-to-end encryption disabled"))}getStoredDevicesForUser(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getStoredDevicesForUser(e)||[]}getStoredDevice(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getStoredDevice(e,t)||null}setDeviceVerified(e,t,i=!0){const n=this.setDeviceVerification(e,t,i,null,null);return e==this.credentials.userId&&this.checkKeyBackup(),n}setDeviceBlocked(e,t,i=!0){return this.setDeviceVerification(e,t,null,i,null)}setDeviceKnown(e,t,i=!0){return this.setDeviceVerification(e,t,null,null,i)}setDeviceVerification(e,t,i,n,r){return s(this,void 0,void 0,(function*(){if(!this.crypto)throw new Error("End-to-end encryption disabled");yield this.crypto.setDeviceVerification(e,t,i,n,r)}))}requestVerificationDM(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.requestVerificationDM(e,t)}findVerificationRequestDMInProgress(e){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");if(this.crypto)return this.crypto.findVerificationRequestDMInProgress(e)}getVerificationRequestsToDeviceInProgress(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getVerificationRequestsToDeviceInProgress(e)}requestVerification(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.requestVerification(e,t)}beginKeyVerification(e,t,i){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.beginKeyVerification(e,t,i)}checkSecretStorageKey(e,t){return this.secretStorage.checkKey(e,t)}setGlobalBlacklistUnverifiedDevices(e){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");return this.cryptoBackend.globalBlacklistUnverifiedDevices=e,e}getGlobalBlacklistUnverifiedDevices(){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");return this.cryptoBackend.globalBlacklistUnverifiedDevices}setGlobalErrorOnUnknownDevices(e){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");this.cryptoBackend.globalErrorOnUnknownDevices=e}getGlobalErrorOnUnknownDevices(){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");return this.cryptoBackend.globalErrorOnUnknownDevices}getCrossSigningId(e=x.CrossSigningKey.Master){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.getCrossSigningId(e)}getStoredCrossSigningForUser(e){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");return this.cryptoBackend.getStoredCrossSigningForUser(e)}checkUserTrust(e){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");return this.cryptoBackend.checkUserTrust(e)}checkDeviceTrust(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.checkDeviceTrust(e,t)}checkIfOwnDeviceCrossSigned(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.checkIfOwnDeviceCrossSigned(e)}checkOwnCrossSigningTrust(e){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");return this.cryptoBackend.checkOwnCrossSigningTrust(e)}checkCrossSigningPrivateKey(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.checkCrossSigningPrivateKey(e,t)}legacyDeviceVerification(e,t,i){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.legacyDeviceVerification(e,t,i)}prepareToEncrypt(e){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");this.cryptoBackend.prepareToEncrypt(e)}userHasCrossSigningKeys(){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");return this.cryptoBackend.userHasCrossSigningKeys()}isCrossSigningReady(){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");return this.cryptoBackend.isCrossSigningReady()}bootstrapCrossSigning(e){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");return this.cryptoBackend.bootstrapCrossSigning(e)}getCryptoTrustCrossSignedDevices(){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");return this.cryptoBackend.getTrustCrossSignedDevices()}setCryptoTrustCrossSignedDevices(e){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");this.cryptoBackend.setTrustCrossSignedDevices(e)}countSessionsNeedingBackup(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.countSessionsNeedingBackup()}getEventEncryptionInfo(e){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");return this.cryptoBackend.getEventEncryptionInfo(e)}createRecoveryKeyFromPassphrase(e){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");return this.cryptoBackend.createRecoveryKeyFromPassphrase(e)}isSecretStorageReady(){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");return this.cryptoBackend.isSecretStorageReady()}bootstrapSecretStorage(e){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");return this.cryptoBackend.bootstrapSecretStorage(e)}addSecretStorageKey(e,t,i){return this.secretStorage.addKey(e,t,i)}hasSecretStorageKey(e){return this.secretStorage.hasKey(e)}storeSecret(e,t,i){return this.secretStorage.store(e,t,i)}getSecret(e){return this.secretStorage.get(e)}isSecretStored(e){return this.secretStorage.isStored(e)}requestSecret(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.requestSecret(e,t)}getDefaultSecretStorageKeyId(){return this.secretStorage.getDefaultKeyId()}setDefaultSecretStorageKeyId(e){return this.secretStorage.setDefaultKeyId(e)}checkSecretStoragePrivateKey(e,t){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.checkSecretStoragePrivateKey(e,t)}getEventSenderDeviceInfo(e){return s(this,void 0,void 0,(function*(){return this.crypto?this.crypto.getEventSenderDeviceInfo(e):null}))}isEventSenderVerified(e){return s(this,void 0,void 0,(function*(){const t=yield this.getEventSenderDeviceInfo(e);return!!t&&t.isVerified()}))}getOutgoingRoomKeyRequest(e){if(!this.crypto)throw new Error("End-to-End encryption disabled");const t=e.getWireContent(),i={session_id:t.session_id,sender_key:t.sender_key,algorithm:t.algorithm,room_id:e.getRoomId()};return i.session_id&&i.sender_key&&i.algorithm&&i.room_id?this.crypto.cryptoStore.getOutgoingRoomKeyRequest(i):Promise.resolve(null)}cancelAndResendEventRoomKeyRequest(e){if(!this.crypto)throw new Error("End-to-End encryption disabled");return e.cancelAndResendKeyRequest(this.crypto,this.getUserId())}setRoomEncryption(e,t){if(!this.crypto)throw new Error("End-to-End encryption disabled");return this.crypto.setRoomEncryption(e,t)}isRoomEncrypted(e){const t=this.getRoom(e);if(!t)return!1;return!!t.currentState.getStateEvents(B.EventType.RoomEncryption,"")||this.roomList.isRoomEncrypted(e)}encryptAndSendToDevices(e,t){if(!this.crypto)throw new Error("End-to-End encryption disabled");return this.crypto.encryptAndSendToDevices(e,t)}forceDiscardSession(e){if(!this.cryptoBackend)throw new Error("End-to-End encryption disabled");this.cryptoBackend.forceDiscardSession(e)}exportRoomKeys(){return this.cryptoBackend?this.cryptoBackend.exportRoomKeys():Promise.reject(new Error("End-to-end encryption disabled"))}importRoomKeys(e,t){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");return this.cryptoBackend.importRoomKeys(e,t)}checkKeyBackup(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.backupManager.checkKeyBackup()}getKeyBackupVersion(){return s(this,void 0,void 0,(function*(){let e;try{e=yield this.http.authedRequest(R.Method.Get,"/room_keys/version",void 0,void 0,{prefix:R.ClientPrefix.V3})}catch(e){if("M_NOT_FOUND"===e.errcode)return null;throw e}return q.BackupManager.checkBackupVersion(e),e}))}isKeyBackupTrusted(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.backupManager.isKeyBackupTrusted(e)}getKeyBackupEnabled(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.backupManager.getKeyBackupEnabled()}enableKeyBackup(e){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.backupManager.enableKeyBackup(e)}disableKeyBackup(){if(!this.crypto)throw new Error("End-to-end encryption disabled");this.crypto.backupManager.disableKeyBackup()}prepareKeyBackupVersion(e,t={secureSecretStorage:!1}){return s(this,void 0,void 0,(function*(){if(!this.crypto)throw new Error("End-to-end encryption disabled");const{algorithm:i,auth_data:n,recovery_key:r,privateKey:o}=yield this.crypto.backupManager.prepareKeyBackupVersion(e);return t.secureSecretStorage&&(yield this.secretStorage.store("m.megolm_backup.v1",(0,S.encodeBase64)(o)),T.logger.info("Key backup private key stored in secret storage")),{algorithm:i,auth_data:n,recovery_key:r}}))}isKeyBackupKeyStored(){return Promise.resolve(this.secretStorage.isStored("m.megolm_backup.v1"))}createKeyBackupVersion(e){return s(this,void 0,void 0,(function*(){if(!this.crypto)throw new Error("End-to-end encryption disabled");yield this.crypto.backupManager.createKeyBackupVersion(e);const t={algorithm:e.algorithm,auth_data:e.auth_data};yield this.crypto.signObject(t.auth_data),this.cryptoCallbacks.getCrossSigningKey&&this.crypto.crossSigningInfo.getId()&&(yield this.crypto.crossSigningInfo.signObject(t.auth_data,"master"));const i=yield this.http.authedRequest(R.Method.Post,"/room_keys/version",void 0,t);return yield this.checkKeyBackup(),this.getKeyBackupEnabled()||T.logger.error("Key backup not usable even though we just created it"),i}))}deleteKeyBackupVersion(e){return s(this,void 0,void 0,(function*(){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");yield this.cryptoBackend.deleteKeyBackupVersion(e)}))}makeKeyBackupPath(e,t,i){let n;n=void 0!==t?g.encodeUri("/room_keys/keys/$roomId/$sessionId",{$roomId:e,$sessionId:t}):void 0!==e?g.encodeUri("/room_keys/keys/$roomId",{$roomId:e}):"/room_keys/keys";return{path:n,queryData:void 0===i?void 0:{version:i}}}sendKeyBackup(e,t,i,n){return s(this,void 0,void 0,(function*(){if(!this.crypto)throw new Error("End-to-end encryption disabled");const r=this.makeKeyBackupPath(e,t,i);yield this.http.authedRequest(R.Method.Put,r.path,r.queryData,n,{prefix:R.ClientPrefix.V3})}))}scheduleAllGroupSessionsForBackup(){return s(this,void 0,void 0,(function*(){if(!this.crypto)throw new Error("End-to-end encryption disabled");yield this.crypto.backupManager.scheduleAllGroupSessionsForBackup()}))}flagAllGroupSessionsForBackup(){if(!this.crypto)throw new Error("End-to-end encryption disabled");return this.crypto.backupManager.flagAllGroupSessionsForBackup()}isValidRecoveryKey(e){try{return(0,M.decodeRecoveryKey)(e),!0}catch(e){return!1}}keyBackupKeyFromPassword(e,t){return(0,C.keyFromAuthData)(t.auth_data,e)}keyBackupKeyFromRecoveryKey(e){return(0,M.decodeRecoveryKey)(e)}restoreKeyBackupWithPassword(e,t,i,n,r){return s(this,void 0,void 0,(function*(){const o=yield(0,C.keyFromAuthData)(n.auth_data,e);return this.restoreKeyBackup(o,t,i,n,r)}))}restoreKeyBackupWithSecretStorage(e,t,i,n){return s(this,void 0,void 0,(function*(){if(!this.crypto)throw new Error("End-to-end encryption disabled");const r=yield this.secretStorage.get("m.megolm_backup.v1"),o=(0,k.fixBackupKey)(r);if(o){const e=yield this.secretStorage.getKey();yield this.secretStorage.store("m.megolm_backup.v1",o,[e[0]])}const s=(0,S.decodeBase64)(o||r);return this.restoreKeyBackup(s,t,i,e,n)}))}restoreKeyBackupWithRecoveryKey(e,t,i,n,r){const o=(0,M.decodeRecoveryKey)(e);return this.restoreKeyBackup(o,t,i,n,r)}restoreKeyBackupWithCache(e,t,i,n){return s(this,void 0,void 0,(function*(){if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");const r=yield this.cryptoBackend.getSessionBackupPrivateKey();if(!r)throw new Error("Couldn't get key");return this.restoreKeyBackup(r,e,t,i,n)}))}restoreKeyBackup(e,t,i,n,r){return s(this,void 0,void 0,(function*(){const o=null==r?void 0:r.cacheCompleteCallback,s=null==r?void 0:r.progressCallback;if(!this.cryptoBackend)throw new Error("End-to-end encryption disabled");let a=0,c=[];const d=this.makeKeyBackupPath(t,i,n.version),l=yield this.cryptoBackend.getBackupDecryptor(n,e),u=!l.sourceTrusted;try{if(!(e instanceof Uint8Array))throw new Error(`restoreKeyBackup expects Uint8Array, got ${e}`);this.cryptoBackend.storeSessionBackupPrivateKey(e).catch((e=>{T.logger.warn("Error caching session backup key:",e)})).then(o),s&&s({stage:"fetch"});const n=yield this.http.authedRequest(R.Method.Get,d.path,d.queryData,void 0,{prefix:R.ClientPrefix.V3});if(n.rooms){const e=n.rooms;for(const[t,i]of Object.entries(e)){if(!i.sessions)continue;a+=Object.keys(i.sessions).length;const e=yield l.decryptSessions(i.sessions);for(const i of e)i.room_id=t,c.push(i)}}else if(n.sessions){const e=n.sessions;a=Object.keys(e).length,c=yield l.decryptSessions(e);for(const e of c)e.room_id=t}else{a=1;try{const[e]=yield l.decryptSessions({[i]:n});e.room_id=t,e.session_id=i,c.push(e)}catch(e){T.logger.log("Failed to decrypt megolm session from backup",e)}}}finally{l.free()}return yield this.cryptoBackend.importRoomKeys(c,{progressCallback:s,untrusted:u,source:"backup"}),yield this.cryptoBackend.checkKeyBackupAndEnable(),{total:a,imported:c.length}}))}deleteKeysFromBackup(e,t,i){return s(this,void 0,void 0,(function*(){if(!this.crypto)throw new Error("End-to-end encryption disabled");const n=this.makeKeyBackupPath(e,t,i);yield this.http.authedRequest(R.Method.Delete,n.path,n.queryData,void 0,{prefix:R.ClientPrefix.V3})}))}sendSharedHistoryKeys(e,t){return s(this,void 0,void 0,(function*(){if(!this.crypto)throw new Error("End-to-end encryption disabled");const i=this.roomList.getRoomEncryption(e);if(!i)return void T.logger.error("Unknown room. Not sharing decryption keys");const n=yield this.crypto.downloadKeys(t),r=new Map;for(const[e,t]of n)r.set(e,Array.from(t.values()));const o=this.crypto.getRoomDecryptor(e,i.algorithm);o.sendSharedHistoryInboundSessions?yield o.sendSharedHistoryInboundSessions(r):T.logger.warn("Algorithm does not support sharing previous keys",i.algorithm)}))}getMediaConfig(){return this.http.authedRequest(R.Method.Get,"/config",void 0,void 0,{prefix:R.MediaPrefix.V3})}getRoom(e){return e?this.store.getRoom(e):null}getRooms(){return this.store.getRooms()}getVisibleRooms(e=!1){var t;const i=this.store.getRooms(),n=new Set;for(const r of i){const i=null===(t=r.findPredecessor(e))||void 0===t?void 0:t.roomId;i&&n.add(i)}return i.filter((e=>!e.currentState.getStateEvents(B.EventType.RoomTombstone,"")||!n.has(e.roomId)))}getUser(e){return this.store.getUser(e)}getUsers(){return this.store.getUsers()}setAccountData(e,t){const i=g.encodeUri("/user/$userId/account_data/$type",{$userId:this.credentials.userId,$type:e});return(0,R.retryNetworkOperation)(5,(()=>this.http.authedRequest(R.Method.Put,i,void 0,t)))}getAccountData(e){return this.store.getAccountData(e)}getAccountDataFromServer(e){var t;return s(this,void 0,void 0,(function*(){if(this.isInitialSyncComplete()){const t=this.store.getAccountData(e);return t?t.getContent():null}const i=g.encodeUri("/user/$userId/account_data/$type",{$userId:this.credentials.userId,$type:e});try{return yield this.http.authedRequest(R.Method.Get,i)}catch(e){if("M_NOT_FOUND"===(null===(t=e.data)||void 0===t?void 0:t.errcode))return null;throw e}}))}deleteAccountData(e){return s(this,void 0,void 0,(function*(){const t=this.canSupport.get(ie.Feature.AccountDataDeletion);if(t===ie.ServerSupport.Unsupported)return void(yield this.setAccountData(e,{}));const i=g.encodeUri("/user/$userId/account_data/$type",{$userId:this.getSafeUserId(),$type:e}),n=t===ie.ServerSupport.Unstable?{prefix:"/_matrix/client/unstable/org.matrix.msc3391"}:void 0;return yield this.http.authedRequest(R.Method.Delete,i,void 0,void 0,n)}))}getIgnoredUsers(){const e=this.getAccountData("m.ignored_user_list");return e&&e.getContent()&&e.getContent().ignored_users?Object.keys(e.getContent().ignored_users):[]}setIgnoredUsers(e){const t={ignored_users:{}};return e.forEach((e=>{t.ignored_users[e]={}})),this.setAccountData("m.ignored_user_list",t)}isUserIgnored(e){return this.getIgnoredUsers().includes(e)}joinRoom(e,t={}){return s(this,void 0,void 0,(function*(){void 0===t.syncRoom&&(t.syncRoom=!0);const i=this.getRoom(e);if(null==i?void 0:i.hasMembershipState(this.credentials.userId,"join"))return Promise.resolve(i);let n=Promise.resolve();if(t.inviteSignUrl){const e=new URL(t.inviteSignUrl);e.searchParams.set("mxid",this.credentials.userId),n=this.http.requestOtherUrl(R.Method.Post,e)}const r={};t.viaServers&&(r.server_name=t.viaServers);const o={},s=yield n;s&&(o.third_party_signed=s);const a=g.encodeUri("/join/$roomid",{$roomid:e}),d=(yield this.http.authedRequest(R.Method.Post,a,r,o)).room_id,l=new c.SyncApi(this,this.clientOpts,this.buildSyncApiOptions()).createRoom(d);return t.syncRoom,l}))}knockRoom(e,t={}){const i=this.getRoom(e);if(null==i?void 0:i.hasMembershipState(this.credentials.userId,"knock"))return Promise.resolve({room_id:i.roomId});const n=g.encodeUri("/knock/$roomIdOrAlias",{$roomIdOrAlias:e}),r={};t.viaServers&&(r.server_name=t.viaServers);const o={};return t.reason&&(o.reason=t.reason),this.http.authedRequest(R.Method.Post,n,r,o)}resendEvent(e,t){return this.toDeviceMessageQueue.sendQueue(),this.updatePendingEventStatus(t,e,d.EventStatus.SENDING),this.encryptAndSendEvent(t,e)}cancelPendingEvent(e){if(![d.EventStatus.QUEUED,d.EventStatus.NOT_SENT,d.EventStatus.ENCRYPTING].includes(e.status))throw new Error("cannot cancel an event with status "+e.status);e.status===d.EventStatus.ENCRYPTING?this.pendingEventEncryption.delete(e.getId()):this.scheduler&&e.status===d.EventStatus.QUEUED&&this.scheduler.removeEventFromQueue(e);const t=this.getRoom(e.getRoomId());this.updatePendingEventStatus(t,e,d.EventStatus.CANCELLED)}setRoomName(e,t){return this.sendStateEvent(e,B.EventType.RoomName,{name:t})}setRoomTopic(e,t,i){const n=L.makeTopicContent(t,i);return this.sendStateEvent(e,B.EventType.RoomTopic,n)}getRoomTags(e){const t=g.encodeUri("/user/$userId/rooms/$roomId/tags",{$userId:this.credentials.userId,$roomId:e});return this.http.authedRequest(R.Method.Get,t)}setRoomTag(e,t,i={}){const n=g.encodeUri("/user/$userId/rooms/$roomId/tags/$tag",{$userId:this.credentials.userId,$roomId:e,$tag:t});return this.http.authedRequest(R.Method.Put,n,void 0,i)}deleteRoomTag(e,t){const i=g.encodeUri("/user/$userId/rooms/$roomId/tags/$tag",{$userId:this.credentials.userId,$roomId:e,$tag:t});return this.http.authedRequest(R.Method.Delete,i)}setRoomAccountData(e,t,i){const n=g.encodeUri("/user/$userId/rooms/$roomId/account_data/$type",{$userId:this.credentials.userId,$roomId:e,$type:t});return this.http.authedRequest(R.Method.Put,n,void 0,i)}setPowerLevel(e,t,i,n){var r,o,a;return s(this,void 0,void 0,(function*(){let n;if(this.clientRunning&&this.isInitialSyncComplete()&&(n=null===(a=null===(o=null===(r=this.getRoom(e))||void 0===r?void 0:r.currentState)||void 0===o?void 0:o.getStateEvents(B.EventType.RoomPowerLevels,""))||void 0===a?void 0:a.getContent()),!n)try{n=yield this.getStateEvent(e,B.EventType.RoomPowerLevels,"")}catch(e){if(!(e instanceof R.MatrixError&&"M_NOT_FOUND"===e.errcode))throw e;n={}}n=g.deepCopy(n),(null==n?void 0:n.users)||(n.users={});const s=Array.isArray(t)?t:[t];for(const e of s)null==i?delete n.users[e]:n.users[e]=i;return this.sendStateEvent(e,B.EventType.RoomPowerLevels,n,"")}))}unstable_createLiveBeacon(e,t){return s(this,void 0,void 0,(function*(){return this.unstable_setLiveBeacon(e,t)}))}unstable_setLiveBeacon(e,t){return s(this,void 0,void 0,(function*(){return this.sendStateEvent(e,X.M_BEACON_INFO.name,t,this.getUserId())}))}sendEvent(e,t,i,n,r){var o,s,a,c,d;let l,u,h,f;if((null==t?void 0:t.startsWith(le))||null===t?(f=r,h=n,u=i,l=t):(f=n,h=i,u=t,l=null),l&&!(null===(o=h["m.relates_to"])||void 0===o?void 0:o.rel_type)){const t=!!(null===(s=h["m.relates_to"])||void 0===s?void 0:s["m.in_reply_to"]);h["m.relates_to"]=Object.assign(Object.assign({},h["m.relates_to"]),{rel_type:Q.THREAD_RELATION_TYPE.name,event_id:l,is_falling_back:!t});const i=null===(a=this.getRoom(e))||void 0===a?void 0:a.getThread(l);i&&!t&&(h["m.relates_to"]["m.in_reply_to"]={event_id:null!==(d=null===(c=i.lastReply((e=>e.isRelation(Q.THREAD_RELATION_TYPE.name)&&!e.status)))||void 0===c?void 0:c.getId())&&void 0!==d?d:l})}return this.sendCompleteEvent(e,l,{type:u,content:h},f)}sendCompleteEvent(e,t,i,n){n||(n=this.makeTxnId());const r=new d.MatrixEvent(Object.assign(i,{event_id:"~"+e+":"+n,user_id:this.credentials.userId,sender:this.credentials.userId,room_id:e,origin_server_ts:(new Date).getTime()})),o=this.getRoom(e),s=t?null==o?void 0:o.getThread(t):void 0;s&&r.setThread(s),this.reEmitter.reEmit(r,[d.MatrixEventEvent.Replaced,d.MatrixEventEvent.VisibilityChange]),null==o||o.reEmitter.reEmit(r,[d.MatrixEventEvent.BeforeRedaction]);const a=r.getAssociatedId();if(null==a?void 0:a.startsWith("~")){const e=null==o?void 0:o.getPendingEvents().find((e=>e.getId()===a));null==e||e.once(d.MatrixEventEvent.LocalEventIdReplaced,(()=>{r.updateAssociatedId(e.getId())}))}const c=r.getType();return T.logger.log(`sendEvent of type ${c} in ${e} with txnId ${n}`),r.setTxnId(n),r.setStatus(d.EventStatus.SENDING),null==o||o.addPendingEvent(r,n),r.status===d.EventStatus.NOT_SENT?Promise.reject(new Error("Event blocked by other events not yet sent")):this.encryptAndSendEvent(o,r)}encryptAndSendEvent(e,t){let i=!1;return Promise.resolve().then((()=>{const n=this.encryptEventIfNeeded(t,null!=e?e:void 0);return n?(this.pendingEventEncryption.set(t.getId(),n),this.updatePendingEventStatus(e,t,d.EventStatus.ENCRYPTING),n.then((()=>{this.pendingEventEncryption.has(t.getId())?this.updatePendingEventStatus(e,t,d.EventStatus.SENDING):i=!0}))):null})).then((()=>{if(i)return{};let n=null;return this.scheduler&&(n=this.scheduler.queueEvent(t),n&&this.scheduler.getQueueForEvent(t).length>1&&this.updatePendingEventStatus(e,t,d.EventStatus.QUEUED)),n||(n=this.sendEventHttpRequest(t),e&&(n=n.then((i=>(e.updatePendingEvent(t,d.EventStatus.SENT,i.event_id),i))))),n})).catch((i=>{T.logger.error("Error sending event",i.stack||i);try{t.error=i,this.updatePendingEventStatus(e,t,d.EventStatus.NOT_SENT)}catch(e){T.logger.error("Exception in error handler!",e.stack||i)}throw i instanceof R.MatrixError&&(i.event=t),i}))}encryptEventIfNeeded(e,t){if(e.isEncrypted())return null;if(e.isRedaction())return null;if(!t||!this.isRoomEncrypted(e.getRoomId()))return null;if(!this.cryptoBackend&&this.usingExternalCrypto)return null;if(e.getType()===B.EventType.Reaction)return null;if(!this.cryptoBackend)throw new Error("This room is configured to use encryption, but your client does not support encryption.");return this.cryptoBackend.encryptEvent(e,t)}getEncryptedIfNeededEventType(e,t){return t===B.EventType.Reaction?t:this.isRoomEncrypted(e)?B.EventType.RoomMessageEncrypted:t}updatePendingEventStatus(e,t,i){e?e.updatePendingEvent(t,i):t.setStatus(i)}sendEventHttpRequest(e){let t=e.getTxnId();t||(t=this.makeTxnId(),e.setTxnId(t));const i={$roomId:e.getRoomId(),$eventType:e.getWireType(),$stateKey:e.getStateKey(),$txnId:t};let n;if(e.isState()){let t="/rooms/$roomId/state/$eventType";e.getStateKey()&&e.getStateKey().length>0&&(t="/rooms/$roomId/state/$eventType/$stateKey"),n=g.encodeUri(t,i)}else if(e.isRedaction()){const t="/rooms/$roomId/redact/$redactsEventId/$txnId";n=g.encodeUri(t,Object.assign({$redactsEventId:e.event.redacts},i))}else n=g.encodeUri("/rooms/$roomId/send/$eventType/$txnId",i);return this.http.authedRequest(R.Method.Put,n,void 0,e.getWireContent()).then((t=>(T.logger.log(`Event sent to ${e.getRoomId()} with event id ${t.event_id}`),t)))}redactEvent(e,t,i,n,r){(null==i?void 0:i.startsWith(le))||(r=n,n=i,i=t,t=null);const o={reason:null==r?void 0:r.reason};if(void 0!==(null==r?void 0:r.with_rel_types)){if(this.canSupport.get(ie.Feature.RelationBasedRedactions)===ie.ServerSupport.Unsupported)throw new Error(`Server does not support relation based redactions roomId ${e} eventId ${i} txnId: ${n} threadId ${t}`);o[this.canSupport.get(ie.Feature.RelationBasedRedactions)===ie.ServerSupport.Stable?B.MSC3912_RELATION_BASED_REDACTIONS_PROP.stable:B.MSC3912_RELATION_BASED_REDACTIONS_PROP.unstable]=r.with_rel_types}return this.sendCompleteEvent(e,t,{type:B.EventType.RoomRedaction,content:o,redacts:i},n)}sendMessage(e,t,i,n){"string"!=typeof t&&null!==t&&(n=i,i=t,t=null);const r=B.EventType.RoomMessage,o=i;return this.sendEvent(e,t,r,o,n)}sendTextMessage(e,t,i,n){(null==t?void 0:t.startsWith(le))||null===t||(n=i,i=t,t=null);const r=L.makeTextMessage(i);return this.sendMessage(e,t,r,n)}sendNotice(e,t,i,n){(null==t?void 0:t.startsWith(le))||null===t||(n=i,i=t,t=null);const r=L.makeNotice(i);return this.sendMessage(e,t,r,n)}sendEmoteMessage(e,t,i,n){(null==t?void 0:t.startsWith(le))||null===t||(n=i,i=t,t=null);const r=L.makeEmoteMessage(i);return this.sendMessage(e,t,r,n)}sendImageMessage(e,t,i,n,r="Image"){(null==t?void 0:t.startsWith(le))||null===t||(r=n||"Image",n=i,i=t,t=null);const o={msgtype:B.MsgType.Image,url:i,info:n,body:r};return this.sendMessage(e,t,o)}sendStickerMessage(e,t,i,n,r="Sticker"){(null==t?void 0:t.startsWith(le))||null===t||(r=n||"Sticker",n=i,i=t,t=null);const o={url:i,info:n,body:r};return this.sendEvent(e,t,B.EventType.Sticker,o)}sendHtmlMessage(e,t,i,n){(null==t?void 0:t.startsWith(le))||null===t||(n=i,i=t,t=null);const r=L.makeHtmlMessage(i,n);return this.sendMessage(e,t,r)}sendHtmlNotice(e,t,i,n){(null==t?void 0:t.startsWith(le))||null===t||(n=i,i=t,t=null);const r=L.makeHtmlNotice(i,n);return this.sendMessage(e,t,r)}sendHtmlEmote(e,t,i,n){(null==t?void 0:t.startsWith(le))||null===t||(n=i,i=t,t=null);const r=L.makeHtmlEmote(i,n);return this.sendMessage(e,t,r)}sendReceipt(e,t,i,n=!1){return s(this,void 0,void 0,(function*(){if(this.isGuest())return Promise.resolve({});const r=g.encodeUri("/rooms/$roomId/receipt/$receiptType/$eventId",{$roomId:e.getRoomId(),$receiptType:t,$eventId:e.getId()});if(!n&&this.supportsThreads()){const t=!!e.threadRootId&&!e.isThreadRoot&&e.isRelation()&&(e.isRelation(Q.THREAD_RELATION_TYPE.name)||e.relationEventId!==e.threadRootId);i=Object.assign(Object.assign({},i),{thread_id:t?e.threadRootId:Y.MAIN_ROOM_TIMELINE})}const o=this.http.authedRequest(R.Method.Post,r,void 0,i||{}),s=this.getRoom(e.getRoomId());return s&&this.credentials.userId&&s.addLocalEchoReceipt(this.credentials.userId,e,t),o}))}sendReadReceipt(e,t=Y.ReceiptType.Read,i=!1){return s(this,void 0,void 0,(function*(){if(!e)return;const n=e.getId(),r=this.getRoom(e.getRoomId());if(null==r?void 0:r.hasPendingEvent(n))throw new Error(`Cannot set read receipt to a pending event (${n})`);return this.sendReceipt(e,t,{},i)}))}setRoomReadMarkers(e,t,i,n){return s(this,void 0,void 0,(function*(){const r=this.getRoom(e);if(null==r?void 0:r.hasPendingEvent(t))throw new Error(`Cannot set read marker to a pending event (${t})`);let o,s;if(i){if(o=i.getId(),null==r?void 0:r.hasPendingEvent(o))throw new Error(`Cannot set read receipt to a pending event (${o})`);null==r||r.addLocalEchoReceipt(this.credentials.userId,i,Y.ReceiptType.Read)}if(n){if(s=n.getId(),null==r?void 0:r.hasPendingEvent(s))throw new Error(`Cannot set read receipt to a pending event (${s})`);null==r||r.addLocalEchoReceipt(this.credentials.userId,n,Y.ReceiptType.ReadPrivate)}return yield this.setRoomReadMarkersHttpRequest(e,t,o,s)}))}getUrlPreview(e,t){t=6e4*Math.floor(t/6e4);const i=new URL(e);i.hash="";const n=t+"_"+(e=i.toString());if(n in this.urlPreviewCache)return this.urlPreviewCache[n];const r=this.http.authedRequest(R.Method.Get,"/preview_url",{url:e,ts:t.toString()},void 0,{prefix:R.MediaPrefix.V3,priority:"low"});return this.urlPreviewCache[n]=r,r}sendTyping(e,t,i){if(this.isGuest())return Promise.resolve({});const n=g.encodeUri("/rooms/$roomId/typing/$userId",{$roomId:e,$userId:this.getUserId()}),r={typing:t};return t&&(r.timeout=i||2e4),this.http.authedRequest(R.Method.Put,n,void 0,r)}getRoomUpgradeHistory(e,t=!1,i=!1){const n=this.getRoom(e);if(!n)return[];return[...this.findPredecessorRooms(n,t,i),n,...this.findSuccessorRooms(n,t,i)]}findPredecessorRooms(e,t,i){var n,r;const o=[];let s=null===(n=e.findPredecessor(i))||void 0===n?void 0:n.roomId;for(;null!==s;){const n=this.getRoom(s);if(null===n)break;if(t){const t=n.currentState.getStateEvents(B.EventType.RoomTombstone,"");if(!t||t.getContent().replacement_room!==e.roomId)break}o.splice(0,0,n),s=null===(r=(e=n).findPredecessor(i))||void 0===r?void 0:r.roomId}return o}findSuccessorRooms(e,t,i){var n;const r=[];let o=e.currentState.getStateEvents(B.EventType.RoomTombstone,"");for(;o;){const s=this.getRoom(o.getContent().replacement_room);if(!s)break;if(s.roomId===e.roomId)break;if(t){const t=null===(n=s.findPredecessor(i))||void 0===n?void 0:n.roomId;if(!t||t!==e.roomId)break}r.push(s);if(new Set(r.map((e=>e.roomId))).size<r.length)return r.slice(0,r.length-1);o=(e=s).currentState.getStateEvents(B.EventType.RoomTombstone,"")}return r}invite(e,t,i){return this.membershipChange(e,t,"invite",i)}inviteByEmail(e,t){return this.inviteByThreePid(e,"email",t)}inviteByThreePid(e,t,i){var n;return s(this,void 0,void 0,(function*(){const r=g.encodeUri("/rooms/$roomId/invite",{$roomId:e}),o=this.getIdentityServerUrl(!0);if(!o)return Promise.reject(new R.MatrixError({error:"No supplied identity server URL",errcode:"ORG.MATRIX.JSSDK_MISSING_PARAM"}));const s={id_server:o,medium:t,address:i};if(null===(n=this.identityServer)||void 0===n?void 0:n.getAccessToken){const e=yield this.identityServer.getAccessToken();e&&(s.id_access_token=e)}return this.http.authedRequest(R.Method.Post,r,void 0,s)}))}leave(e){return this.membershipChange(e,void 0,"leave")}leaveRoomChain(e,t=!0){const i=this.getRoomUpgradeHistory(e);let n=i;if(!t){n=[];for(const t of i)if(n.push(t),t.roomId===e)break}const r={},o=[],s=e=>this.leave(e).then((()=>{delete r[e]})).catch((t=>{r[e]=t}));for(const e of n)o.push(s(e.roomId));return Promise.all(o).then((()=>r))}ban(e,t,i){return this.membershipChange(e,t,"ban",i)}forget(e,t=!0){const i=this.membershipChange(e,void 0,"forget");return t?i.then((t=>(this.store.removeRoom(e),this.emit(ue.DeleteRoom,e),t))):i}unban(e,t){const i=g.encodeUri("/rooms/$roomId/unban",{$roomId:e}),n={user_id:t};return this.http.authedRequest(R.Method.Post,i,void 0,n)}kick(e,t,i){const n=g.encodeUri("/rooms/$roomId/kick",{$roomId:e}),r={user_id:t,reason:i};return this.http.authedRequest(R.Method.Post,n,void 0,r)}membershipChange(e,t,i,n){const r=g.encodeUri("/rooms/$room_id/$membership",{$room_id:e,$membership:i});return this.http.authedRequest(R.Method.Post,r,void 0,{user_id:t,reason:n})}getPushActionsForEvent(e,t=!1){if(!e.getPushActions()||t){const{actions:t,rule:i}=this.pushProcessor.actionsAndRuleForEvent(e);e.setPushDetails(t,i)}return e.getPushActions()}getPushDetailsForEvent(e,t=!1){if(!e.getPushDetails()||t){const{actions:t,rule:i}=this.pushProcessor.actionsAndRuleForEvent(e);e.setPushDetails(t,i)}return e.getPushDetails()}setProfileInfo(e,t){const i=g.encodeUri("/profile/$userId/$info",{$userId:this.credentials.userId,$info:e});return this.http.authedRequest(R.Method.Put,i,void 0,t)}setDisplayName(e){return s(this,void 0,void 0,(function*(){const t=yield this.setProfileInfo("displayname",{displayname:e}),i=this.getUser(this.getUserId());return i&&(i.displayName=e,i.emit(O.UserEvent.DisplayName,i.events.presence,i)),t}))}setAvatarUrl(e){return s(this,void 0,void 0,(function*(){const t=yield this.setProfileInfo("avatar_url",{avatar_url:e}),i=this.getUser(this.getUserId());return i&&(i.avatarUrl=e,i.emit(O.UserEvent.AvatarUrl,i.events.presence,i)),t}))}mxcUrlToHttp(e,t,i,n,r){return(0,A.getHttpUriForMxc)(this.baseUrl,e,t,i,n,r)}setSyncPresence(e){var t;return s(this,void 0,void 0,(function*(){null===(t=this.syncApi)||void 0===t||t.setPresence(e)}))}setPresence(e){return s(this,void 0,void 0,(function*(){const t=g.encodeUri("/presence/$userId/status",{$userId:this.credentials.userId});if(-1===["offline","online","unavailable"].indexOf(e.presence))throw new Error("Bad presence value: "+e.presence);yield this.http.authedRequest(R.Method.Put,t,void 0,e)}))}getPresence(e){const t=g.encodeUri("/presence/$userId/status",{$userId:e});return this.http.authedRequest(R.Method.Get,t)}scrollback(e,t=30){let i=0,n=this.ongoingScrollbacks[e.roomId]||{};if(n.promise)return n.promise;if(n.errorTs){const e=Date.now()-n.errorTs;i=Math.max(3e3-e,0)}if(null===e.oldState.paginationToken)return Promise.resolve(e);const r=this.store.scrollback(e,t).length;if(r===t)return Promise.resolve(e);t-=r;const o=new Promise(((n,r)=>{(0,v.sleep)(i).then((()=>this.createMessagesRequest(e.roomId,e.oldState.paginationToken,t,m.Direction.Backward))).then((t=>{var i,r;const o=t.chunk.map(this.getEventMapper());if(t.state){const i=t.state.map(this.getEventMapper());e.currentState.setUnknownStateEvents(i)}const[s,a,c]=e.partitionThreadedEvents(o);this.processAggregatedTimelineEvents(e,s),e.addEventsToTimeline(s,!0,e.getLiveTimeline()),this.processThreadEvents(e,a,!0),c.forEach((t=>e.relations.aggregateChildEvent(t))),e.oldState.paginationToken=null!==(i=t.end)&&void 0!==i?i:null,0===t.chunk.length&&(e.oldState.paginationToken=null),this.store.storeEvents(e,o,null!==(r=t.end)&&void 0!==r?r:null,!0),delete this.ongoingScrollbacks[e.roomId],n(e)})).catch((t=>{this.ongoingScrollbacks[e.roomId]={errorTs:Date.now()},r(t)}))}));return n={promise:o},this.ongoingScrollbacks[e.roomId]=n,o}getEventMapper(e){return(0,F.eventMapperFor)(this,e||{})}getEventTimeline(e,t){var i,n,r,o;return s(this,void 0,void 0,(function*(){if(!this.timelineSupport)throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");if(!(null==e?void 0:e.room))throw new Error("getEventTimeline only supports room timelines");if(e.getTimelineForEvent(t))return e.getTimelineForEvent(t);if(e.thread&&this.supportsThreads())return this.getThreadTimeline(e,t);const s=g.encodeUri("/rooms/$roomId/context/$eventId",{$roomId:e.room.roomId,$eventId:t});let a;(null===(i=this.clientOpts)||void 0===i?void 0:i.lazyLoadMembers)&&(a={filter:JSON.stringify(h.Filter.LAZY_LOADING_MESSAGES_FILTER)});const c=yield this.http.authedRequest(R.Method.Get,s,a);if(!c.event)throw new Error("'event' not in '/context' result - homeserver too old?");if(e.getTimelineForEvent(t))return e.getTimelineForEvent(t);const d=this.getEventMapper(),l=d(c.event);if(l.isRelation(Q.THREAD_RELATION_TYPE.name))return void T.logger.warn("Tried loading a regular timeline at the position of a thread event");const u=[...c.events_after.reverse().map(d),l,...c.events_before.map(d)];let f=e.getTimelineForEvent(u[0].getId());f?f.getState(m.EventTimeline.BACKWARDS).setUnknownStateEvents(c.state.map(d)):(f=e.addTimeline(),f.initialiseState(c.state.map(d)),f.getState(m.EventTimeline.FORWARDS).paginationToken=c.end);const[p,v,y]=e.room.partitionThreadedEvents(u);return e.addEventsToTimeline(p,!0,f,c.start),this.processThreadEvents(e.room,v,!0),this.processAggregatedTimelineEvents(e.room,p),y.forEach((t=>e.relations.aggregateChildEvent(t))),null!==(o=null!==(n=e.getTimelineForEvent(t))&&void 0!==n?n:null===(r=e.room.findThreadForEvent(l))||void 0===r?void 0:r.liveTimeline)&&void 0!==o?o:f}))}getThreadTimeline(e,t){var i,n,r,o,a,c,d,l;return s(this,void 0,void 0,(function*(){if(!this.supportsThreads())throw new Error("could not get thread timeline: no client support");if(!e.room)throw new Error("could not get thread timeline: not a room timeline");if(!e.thread)throw new Error("could not get thread timeline: not a thread timeline");const s=g.encodeUri("/rooms/$roomId/context/$eventId",{$roomId:e.room.roomId,$eventId:t}),u={limit:"0"};(null===(i=this.clientOpts)||void 0===i?void 0:i.lazyLoadMembers)&&(u.filter=JSON.stringify(h.Filter.LAZY_LOADING_MESSAGES_FILTER));const f=yield this.http.authedRequest(R.Method.Get,s,u),p=this.getEventMapper(),v=p(f.event);if(!e.canContain(v))return;const y=this.canSupport.get(ie.Feature.RelationsRecursion)!==ie.ServerSupport.Unsupported;if(Q.Thread.hasServerSideSupport){if(Q.Thread.hasServerSideFwdPaginationSupport){if(!e.thread)throw new Error("could not get thread timeline: not a thread timeline");const i=e.thread,s=yield this.fetchRelations(e.room.roomId,i.id,Q.THREAD_RELATION_TYPE.name,null,{dir:m.Direction.Backward,from:f.start,recurse:y||void 0}),c=yield this.fetchRelations(e.room.roomId,i.id,Q.THREAD_RELATION_TYPE.name,null,{dir:m.Direction.Forward,from:f.end,recurse:y||void 0}),d=[...c.chunk.reverse().map(p),v,...s.chunk.map(p)];for(const t of d)yield null===(n=e.thread)||void 0===n?void 0:n.processEvent(t);let l=e.getTimelineForEvent(v.getId());if(l?l.getState(m.EventTimeline.BACKWARDS).setUnknownStateEvents(f.state.map(p)):(l=e.addTimeline(),l.initialiseState(f.state.map(p))),e.addEventsToTimeline(d,!0,l,c.next_batch),!s.next_batch){const t=yield this.fetchRoomEvent(e.room.roomId,i.id);e.addEventsToTimeline([p(t)],!0,l,null)}return l.setPaginationToken(null!==(r=s.next_batch)&&void 0!==r?r:null,m.Direction.Backward),l.setPaginationToken(null!==(o=c.next_batch)&&void 0!==o?o:null,m.Direction.Forward),this.processAggregatedTimelineEvents(e.room,d),null!==(a=e.getTimelineForEvent(t))&&void 0!==a?a:l}{const t=e.thread,i=yield this.fetchRelations(e.room.roomId,t.id,Q.THREAD_RELATION_TYPE.name,null,{dir:m.Direction.Backward,from:f.start,recurse:y||void 0}),n=[];let r=f.end;for(;r;){const i=yield this.fetchRelations(e.room.roomId,t.id,Q.THREAD_RELATION_TYPE.name,null,{dir:m.Direction.Forward,from:r,recurse:y||void 0});r=null!==(c=i.next_batch)&&void 0!==c?c:null,n.push(...i.chunk)}const o=[...n.reverse().map(p),v,...i.chunk.map(p)];for(const t of o)yield null===(d=e.thread)||void 0===d?void 0:d.processEvent(t);const s=e.getLiveTimeline();if(s.getState(m.EventTimeline.BACKWARDS).setUnknownStateEvents(f.state.map(p)),e.addEventsToTimeline(o,!0,s,null),!i.next_batch){const i=yield this.fetchRoomEvent(e.room.roomId,t.id);e.addEventsToTimeline([p(i)],!0,s,null)}return s.setPaginationToken(null!==(l=i.next_batch)&&void 0!==l?l:null,m.Direction.Backward),s.setPaginationToken(null,m.Direction.Forward),this.processAggregatedTimelineEvents(e.room,o),s}}}))}getLatestTimeline(e){var t,i,n,r;return s(this,void 0,void 0,(function*(){if(!this.timelineSupport)throw new Error("timeline support is disabled. Set the 'timelineSupport' parameter to true when creating MatrixClient to enable it.");if(!e.room)throw new Error("getLatestTimeline only supports room timelines");let o;if(null!==e.threadListType){const i=yield this.createThreadListMessagesRequest(e.room.roomId,null,1,m.Direction.Backward,e.threadListType,e.getFilter());o=null===(t=i.chunk)||void 0===t?void 0:t[0]}else if(e.thread&&Q.Thread.hasServerSideSupport){const t=this.canSupport.get(ie.Feature.RelationsRecursion)!==ie.ServerSupport.Unsupported,n=yield this.fetchRelations(e.room.roomId,e.thread.id,Q.THREAD_RELATION_TYPE.name,null,{dir:m.Direction.Backward,limit:1,recurse:t||void 0});o=null===(i=n.chunk)||void 0===i?void 0:i[0]}else{const t=g.encodeUri("/rooms/$roomId/messages",{$roomId:e.room.roomId}),i={dir:"b"};(null===(n=this.clientOpts)||void 0===n?void 0:n.lazyLoadMembers)&&(i.filter=JSON.stringify(h.Filter.LAZY_LOADING_MESSAGES_FILTER));const s=yield this.http.authedRequest(R.Method.Get,t,i);o=null===(r=s.chunk)||void 0===r?void 0:r[0]}if(!o)throw new Error("No message returned when trying to construct getLatestTimeline");return this.getEventTimeline(e,o.event_id)}))}createMessagesRequest(e,t,i=30,n,r){var o,s;const a=g.encodeUri("/rooms/$roomId/messages",{$roomId:e}),c={limit:i.toString(),dir:n};t&&(c.from=t);let d=null;return(null===(o=this.clientOpts)||void 0===o?void 0:o.lazyLoadMembers)&&(d=Object.assign({},h.Filter.LAZY_LOADING_MESSAGES_FILTER)),r&&(d=d||{},Object.assign(d,null===(s=r.getRoomTimelineFilterComponent())||void 0===s?void 0:s.toJSON())),d&&(c.filter=JSON.stringify(d)),this.http.authedRequest(R.Method.Get,a,c)}createThreadListMessagesRequest(e,t,i=30,n=m.Direction.Backward,r=Q.ThreadFilterType.All,o){var s,a;const c=g.encodeUri("/rooms/$roomId/threads",{$roomId:e}),d={limit:i.toString(),dir:n,include:(0,Q.threadFilterTypeToFilter)(r)};t&&(d.from=t);let l={};(null===(s=this.clientOpts)||void 0===s?void 0:s.lazyLoadMembers)&&(l=Object.assign({},h.Filter.LAZY_LOADING_MESSAGES_FILTER)),o&&(l=Object.assign(Object.assign({},l),null===(a=o.getRoomTimelineFilterComponent())||void 0===a?void 0:a.toJSON())),Object.keys(l).length&&(d.filter=JSON.stringify(l));const u={prefix:Q.Thread.hasServerSideListSupport===Q.FeatureSupport.Stable?R.ClientPrefix.V1:"/_matrix/client/unstable/org.matrix.msc3856"};return this.http.authedRequest(R.Method.Get,c,d,void 0,u).then((e=>{var t;return Object.assign(Object.assign({},e),{chunk:null===(t=e.chunk)||void 0===t?void 0:t.reverse(),start:e.prev_batch,end:e.next_batch})}))}paginateEventTimeline(e,t){var i,n,r;const o=e.getTimelineSet()===this.notifTimelineSet,a=this.getRoom(e.getRoomId()),c=e.getTimelineSet().threadListType,d=e.getTimelineSet().thread,l=(t=t||{}).backwards||!1;if(o&&!l)throw new Error("paginateNotifTimeline can only paginate backwards");const u=l?m.EventTimeline.BACKWARDS:m.EventTimeline.FORWARDS,h=e.getPaginationToken(u),f=e.paginationRequests[u];if(f)return f;let p,g,y;if(o)p="/notifications",g={limit:(null!==(i=t.limit)&&void 0!==i?i:30).toString(),only:"highlight"},h&&"end"!==h&&(g.from=h),y=this.http.authedRequest(R.Method.Get,"/notifications",g).then((t=>s(this,void 0,void 0,(function*(){const i=t.next_token,n=[];t.notifications=t.notifications.filter(v.noUnsafeEventProps);for(let e=0;e<t.notifications.length;e++){const i=t.notifications[e],r=this.getEventMapper()(i.event);this.getPushDetailsForEvent(r,!0),r.event.room_id=i.room_id,n[e]=r}const r=e.getTimelineSet();return r.addEventsToTimeline(n,l,e,i),this.processAggregatedTimelineEvents(r.room,n),l&&!t.next_token&&e.setPaginationToken(null,u),Boolean(t.next_token)})))).finally((()=>{e.paginationRequests[u]=null})),e.paginationRequests[u]=y;else if(null!==c){if(!a)throw new Error("Unknown room "+e.getRoomId());if(!Q.Thread.hasServerSideFwdPaginationSupport&&u===m.Direction.Forward)throw new Error("Cannot paginate threads forwards without server-side support for MSC 3715");y=this.createThreadListMessagesRequest(e.getRoomId(),h,t.limit,u,c,e.getFilter()).then((t=>{if(t.state){const i=e.getState(u),n=t.state.filter(v.noUnsafeEventProps).map(this.getEventMapper());i.setUnknownStateEvents(n)}const i=t.end,n=t.chunk.filter(v.noUnsafeEventProps).map(this.getEventMapper());return e.getTimelineSet().addEventsToTimeline(n,l,e,i),this.processAggregatedTimelineEvents(a,n),this.processThreadRoots(a,n,l),l&&t.end==t.start&&e.setPaginationToken(null,u),t.end!==t.start})).finally((()=>{e.paginationRequests[u]=null})),e.paginationRequests[u]=y}else if(d){const i=this.getRoom(null!==(n=e.getRoomId())&&void 0!==n?n:void 0);if(!i)throw new Error("Unknown room "+e.getRoomId());const o=this.canSupport.get(ie.Feature.RelationsRecursion)!==ie.ServerSupport.Unsupported;y=this.fetchRelations(null!==(r=e.getRoomId())&&void 0!==r?r:"",d.id,Q.THREAD_RELATION_TYPE.name,null,{dir:u,limit:t.limit,from:null!=h?h:void 0,recurse:o||void 0}).then((t=>s(this,void 0,void 0,(function*(){var n;const r=this.getEventMapper(),o=t.chunk.filter(v.noUnsafeEventProps).map(r);for(const e of o.slice().reverse()){yield null==d?void 0:d.processEvent(e);const t=e.getSender();l&&null!==(null==d?void 0:d.getEventReadUpTo(t))||i.addLocalEchoReceipt(t,e,Y.ReceiptType.Read)}const s=t.next_batch,a=e.getTimelineSet();if(a.addEventsToTimeline(o,l,e,null!=s?s:null),!s&&l){const t=yield this.fetchRoomEvent(null!==(n=e.getRoomId())&&void 0!==n?n:"",d.id);a.addEventsToTimeline([r(t)],!0,e,null)}return this.processAggregatedTimelineEvents(a.room,o),l&&!s&&e.setPaginationToken(null,u),Boolean(s)})))).finally((()=>{e.paginationRequests[u]=null})),e.paginationRequests[u]=y}else{if(!a)throw new Error("Unknown room "+e.getRoomId());y=this.createMessagesRequest(e.getRoomId(),h,t.limit,u,e.getFilter()).then((t=>{if(t.state){const i=e.getState(u),n=t.state.filter(v.noUnsafeEventProps).map(this.getEventMapper());i.setUnknownStateEvents(n)}const i=t.end,n=t.chunk.filter(v.noUnsafeEventProps).map(this.getEventMapper()),r=e.getTimelineSet(),[o,,s]=a.partitionThreadedEvents(n);r.addEventsToTimeline(o,l,e,i),this.processAggregatedTimelineEvents(a,o),this.processThreadRoots(a,o.filter((e=>e.getServerAggregatedRelation(Q.THREAD_RELATION_TYPE.name))),!1),s.forEach((e=>a.relations.aggregateChildEvent(e)));const c=void 0===t.end||t.end===t.start;return l&&c&&e.setPaginationToken(null,u),!c})).finally((()=>{e.paginationRequests[u]=null})),e.paginationRequests[u]=y}return y}resetNotifTimelineSet(){this.notifTimelineSet&&this.notifTimelineSet.resetLiveTimeline("end")}peekInRoom(e){var t;return null===(t=this.peekSync)||void 0===t||t.stopPeeking(),this.peekSync=new c.SyncApi(this,this.clientOpts,this.buildSyncApiOptions()),this.peekSync.peek(e)}stopPeeking(){this.peekSync&&(this.peekSync.stopPeeking(),this.peekSync=null)}setGuestAccess(e,t){const i=this.sendStateEvent(e,B.EventType.RoomGuestAccess,{guest_access:t.allowJoin?"can_join":"forbidden"},"");let n=Promise.resolve();return t.allowRead&&(n=this.sendStateEvent(e,B.EventType.RoomHistoryVisibility,{history_visibility:"world_readable"},"")),Promise.all([n,i]).then()}requestRegisterEmailToken(e,t,i,n){return this.requestTokenFromEndpoint("/register/email/requestToken",{email:e,client_secret:t,send_attempt:i,next_link:n})}requestRegisterMsisdnToken(e,t,i,n,r){return this.requestTokenFromEndpoint("/register/msisdn/requestToken",{country:e,phone_number:t,client_secret:i,send_attempt:n,next_link:r})}requestAdd3pidEmailToken(e,t,i,n){return this.requestTokenFromEndpoint("/account/3pid/email/requestToken",{email:e,client_secret:t,send_attempt:i,next_link:n})}requestAdd3pidMsisdnToken(e,t,i,n,r){return this.requestTokenFromEndpoint("/account/3pid/msisdn/requestToken",{country:e,phone_number:t,client_secret:i,send_attempt:n,next_link:r})}requestPasswordEmailToken(e,t,i,n){return this.requestTokenFromEndpoint("/account/password/email/requestToken",{email:e,client_secret:t,send_attempt:i,next_link:n})}requestPasswordMsisdnToken(e,t,i,n,r){return this.requestTokenFromEndpoint("/account/password/msisdn/requestToken",{country:e,phone_number:t,client_secret:i,send_attempt:n,next_link:r})}requestTokenFromEndpoint(e,t){return s(this,void 0,void 0,(function*(){const i=Object.assign({},t);return this.http.request(R.Method.Post,e,void 0,i)}))}getRoomPushRule(e,t){var i,n;if(this.pushRules)return null===(n=null===(i=this.pushRules[e])||void 0===i?void 0:i.room)||void 0===n?void 0:n.find((e=>e.rule_id===t));throw new Error("SyncApi.sync() must be done before accessing to push rules.")}setRoomMutePushRule(e,t,i){let n,r=!1;const o=this.getRoomPushRule(e,t);if((null==o?void 0:o.actions.includes(H.PushRuleActionName.DontNotify))&&(r=!0),i)if(o){if(!r){const i=g.defer();this.deletePushRule(e,H.PushRuleKind.RoomSpecific,o.rule_id).then((()=>{this.addPushRule(e,H.PushRuleKind.RoomSpecific,t,{actions:[H.PushRuleActionName.DontNotify]}).then((()=>{i.resolve()})).catch((e=>{i.reject(e)}))})).catch((e=>{i.reject(e)})),n=i.promise}}else n=this.addPushRule(e,H.PushRuleKind.RoomSpecific,t,{actions:[H.PushRuleActionName.DontNotify]});else r&&(n=this.deletePushRule(e,H.PushRuleKind.RoomSpecific,o.rule_id));if(n)return new Promise(((e,t)=>{n.then((()=>{this.getPushRules().then((t=>{this.pushRules=t,e()})).catch((e=>{t(e)}))})).catch((e=>{this.getPushRules().then((i=>{this.pushRules=i,t(e)})).catch((i=>{t(e)}))}))}))}searchMessageText(e){const t={search_term:e.query};return"keys"in e&&(t.keys=e.keys),this.search({body:{search_categories:{room_events:t}}})}searchRoomEvents(e){const t={search_categories:{room_events:{search_term:e.term,filter:e.filter,order_by:V.SearchOrderBy.Recent,event_context:{before_limit:1,after_limit:1,include_profile:!0}}}},i={_query:t,results:[],highlights:[]};return this.search({body:t}).then((e=>this.processRoomEventsSearch(i,e)))}backPaginateRoomEventsSearch(e){if(!e.next_batch)return Promise.reject(new Error("Cannot backpaginate event search any further"));if(e.pendingRequest)return e.pendingRequest;const t={body:e._query,next_batch:e.next_batch},i=this.search(t,e.abortSignal).then((t=>this.processRoomEventsSearch(e,t))).finally((()=>{e.pendingRequest=void 0}));return e.pendingRequest=i,i}processRoomEventsSearch(e,t){var i,n;const r=t.search_categories.room_events;e.count=r.count,e.next_batch=r.next_batch;const o=new Set(r.highlights);e.highlights.forEach((e=>{o.add(e)})),e.highlights=Array.from(o);const s=this.getEventMapper(),a=null!==(n=null===(i=r.results)||void 0===i?void 0:i.length)&&void 0!==n?n:0;for(let t=0;t<a;t++){const i=P.SearchResult.fromJson(r.results[t],s),n=this.getRoom(i.context.getEvent().getRoomId());if(n)for(const e of i.context.getTimeline()){const t=n.getMember(e.getSender());!e.sender&&t&&(e.sender=t)}e.results.push(i)}return e}syncLeftRooms(){if(this.syncedLeftRooms)return Promise.resolve([]);if(this.syncLeftRoomsPromise)return this.syncLeftRoomsPromise;const e=new c.SyncApi(this,this.clientOpts,this.buildSyncApiOptions());return this.syncLeftRoomsPromise=e.syncLeftRooms(),this.syncLeftRoomsPromise.then((()=>{T.logger.log("Marking success of sync left room request"),this.syncedLeftRooms=!0})).finally((()=>{this.syncLeftRoomsPromise=void 0})),this.syncLeftRoomsPromise}createFilter(e){const t=g.encodeUri("/user/$userId/filter",{$userId:this.credentials.userId});return this.http.authedRequest(R.Method.Post,t,void 0,e).then((t=>{const i=h.Filter.fromJson(this.credentials.userId,t.filter_id,e);return this.store.storeFilter(i),i}))}getFilter(e,t,i){if(i){const i=this.store.getFilter(e,t);if(i)return Promise.resolve(i)}const n=g.encodeUri("/user/$userId/filter/$filterId",{$userId:e,$filterId:t});return this.http.authedRequest(R.Method.Get,n).then((i=>{const n=h.Filter.fromJson(e,t,i);return this.store.storeFilter(n),n}))}getOrCreateFilter(e,t){return s(this,void 0,void 0,(function*(){const i=this.store.getFilterIdByName(e);let n;if(i){try{const e=yield this.getFilter(this.credentials.userId,i,!0);if(e){const r=e.getDefinition(),o=t.getDefinition();g.deepCompare(r,o)&&(n=i)}}catch(e){if("M_UNKNOWN"!==e.errcode&&"M_NOT_FOUND"!==e.errcode)throw e}n||this.store.setFilterIdByName(e,void 0)}if(n)return n;const r=yield this.createFilter(t.getDefinition());return this.store.setFilterIdByName(e,r.filterId),r.filterId}))}getOpenIdToken(){const e=g.encodeUri("/user/$userId/openid/request_token",{$userId:this.credentials.userId});return this.http.authedRequest(R.Method.Post,e,void 0,{})}turnServer(){return this.http.authedRequest(R.Method.Get,"/voip/turnServer")}getTurnServers(){return this.turnServers||[]}getTurnServersExpiry(){return this.turnServersExpiry}get pollingTurnServers(){return void 0!==this.checkTurnServersIntervalID}checkTurnServers(){return s(this,void 0,void 0,(function*(){if(!this.canSupportVoip)return;let e=!1;const i=this.turnServersExpiry-Date.now();if(i>se)T.logger.debug("TURN creds are valid for another "+i+" ms: not fetching new ones."),e=!0;else{T.logger.debug("Fetching new TURN credentials");try{const t=yield this.turnServer();if(t.uris){T.logger.log("Got TURN URIs: "+t.uris+" refresh in "+t.ttl+" secs");const i={urls:t.uris,username:t.username,credential:t.password};this.turnServers=[i],this.turnServersExpiry=Date.now()+1e3*t.ttl,e=!0,this.emit(ue.TurnServers,this.turnServers)}}catch(e){T.logger.error("Failed to get TURN URIs",e),403===e.httpStatus?(T.logger.info("TURN access unavailable for this account: stopping credentials checks"),null!==this.checkTurnServersIntervalID&&t.clearInterval(this.checkTurnServersIntervalID),this.checkTurnServersIntervalID=void 0,this.emit(ue.TurnServersError,e,!0)):this.emit(ue.TurnServersError,e,!1)}}return e}))}setFallbackICEServerAllowed(e){this.fallbackICEServerAllowed=e}isFallbackICEServerAllowed(){return this.fallbackICEServerAllowed}isSynapseAdministrator(){const e=g.encodeUri("/_synapse/admin/v1/users/$userId/admin",{$userId:this.getUserId()});return this.http.authedRequest(R.Method.Get,e,void 0,void 0,{prefix:""}).then((e=>e.admin))}whoisSynapseUser(e){const t=g.encodeUri("/_synapse/admin/v1/whois/$userId",{$userId:e});return this.http.authedRequest(R.Method.Get,t,void 0,void 0,{prefix:""})}deactivateSynapseUser(e){const t=g.encodeUri("/_synapse/admin/v1/deactivate/$userId",{$userId:e});return this.http.authedRequest(R.Method.Post,t,void 0,void 0,{prefix:""})}fetchClientWellKnown(){var e;return s(this,void 0,void 0,(function*(){this.clientWellKnownPromise=b.AutoDiscovery.getRawClientConfig(null!==(e=this.getDomain())&&void 0!==e?e:void 0),this.clientWellKnown=yield this.clientWellKnownPromise,this.emit(ue.ClientWellKnown,this.clientWellKnown)}))}getClientWellKnown(){return this.clientWellKnown}waitForClientWellKnown(){if(!this.clientRunning)throw new Error("Client is not running");return this.clientWellKnownPromise}storeClientOptions(){const e=["boolean","string","number"],t=Object.entries(this.clientOpts).filter((([t,i])=>e.includes(typeof i))).reduce(((e,[t,i])=>(e[t]=i,e)),{});return this.store.storeClientOptions(t)}_unstable_getSharedRooms(e){return s(this,void 0,void 0,(function*(){const t=yield this.doesServerSupportUnstableFeature(i.UNSTABLE_MSC2666_SHARED_ROOMS),n=yield this.doesServerSupportUnstableFeature(i.UNSTABLE_MSC2666_MUTUAL_ROOMS),r=yield this.doesServerSupportUnstableFeature(i.UNSTABLE_MSC2666_QUERY_MUTUAL_ROOMS);if(!t&&!n&&!r)throw Error("Server does not support the Mutual Rooms API");let o,s;r?(o="/uk.half-shot.msc2666/user/mutual_rooms",s={user_id:e}):(o=g.encodeUri(`/uk.half-shot.msc2666/user/${n?"mutual_rooms":"shared_rooms"}/$userId`,{$userId:e}),s={});const a=[];let c=null;do{const e={};null!=c&&r&&(e.batch_token=c);const t=yield this.http.authedRequest(R.Method.Get,o,Object.assign(Object.assign({},s),e),void 0,{prefix:R.ClientPrefix.Unstable});a.push(...t.joined),c=void 0!==t.next_batch_token?t.next_batch_token:null}while(null!=c);return a}))}getVersions(){return s(this,void 0,void 0,(function*(){if(this.serverVersionsPromise)return this.serverVersionsPromise;this.serverVersionsPromise=this.http.request(R.Method.Get,"/_matrix/client/versions",void 0,void 0,{prefix:""}).catch((e=>{throw this.serverVersionsPromise=void 0,e}));const e=yield this.serverVersionsPromise;return this.canSupport=yield(0,ie.buildFeatureSupportMap)(e),this.serverVersionsPromise}))}isVersionSupported(e){return s(this,void 0,void 0,(function*(){const{versions:t}=yield this.getVersions();return t&&t.includes(e)}))}doesServerSupportUnstableFeature(e){return s(this,void 0,void 0,(function*(){const t=yield this.getVersions();if(!t)return!1;const i=t.unstable_features;return i&&!!i[e]}))}doesServerForceEncryptionForPreset(e){return s(this,void 0,void 0,(function*(){const t=yield this.getVersions();if(!t)return!1;const i=t.unstable_features,n=e.includes("_chat")?e.substring(0,e.indexOf("_chat")):e;return i&&!!i[`io.element.e2ee_forced.${n}`]}))}doesServerSupportThread(){return s(this,void 0,void 0,(function*(){if(yield this.isVersionSupported("v1.4"))return{threads:Q.FeatureSupport.Stable,list:Q.FeatureSupport.Stable,fwdPagination:Q.FeatureSupport.Stable};try{const[e,t,i,n,r,o]=yield Promise.all([this.doesServerSupportUnstableFeature("org.matrix.msc3440"),this.doesServerSupportUnstableFeature("org.matrix.msc3440.stable"),this.doesServerSupportUnstableFeature("org.matrix.msc3856"),this.doesServerSupportUnstableFeature("org.matrix.msc3856.stable"),this.doesServerSupportUnstableFeature("org.matrix.msc3715"),this.doesServerSupportUnstableFeature("org.matrix.msc3715.stable")]);return{threads:(0,Q.determineFeatureSupport)(t,e),list:(0,Q.determineFeatureSupport)(n,i),fwdPagination:(0,Q.determineFeatureSupport)(o,r)}}catch(e){return{threads:Q.FeatureSupport.None,list:Q.FeatureSupport.None,fwdPagination:Q.FeatureSupport.None}}}))}hasLazyLoadMembersEnabled(){var e;return!!(null===(e=this.clientOpts)||void 0===e?void 0:e.lazyLoadMembers)}setCanResetTimelineCallback(e){this.canResetTimelineCallback=e}getCanResetTimelineCallback(){return this.canResetTimelineCallback}relations(e,t,i,n,r={dir:m.Direction.Backward}){var o,a;return s(this,void 0,void 0,(function*(){const s=n?this.getEncryptedIfNeededEventType(e,n):null,[c,d]=yield Promise.all([this.fetchRoomEvent(e,t),this.fetchRelations(e,t,i,s,r)]),l=this.getEventMapper(),u=c?l(c):void 0;let h=d.chunk.map(l);if(s===B.EventType.RoomMessageEncrypted){const e=u?h.concat(u):h;yield Promise.all(e.map((e=>this.decryptEventIfNeeded(e)))),null!==n&&(h=h.filter((e=>e.getType()===n)))}return u&&i===B.RelationType.Replace&&(h=h.filter((e=>e.getSender()===u.getSender()))),{originalEvent:null!=u?u:null,events:h,nextBatch:null!==(o=d.next_batch)&&void 0!==o?o:null,prevBatch:null!==(a=d.prev_batch)&&void 0!==a?a:null}}))}getCrossSigningCacheCallbacks(){var e;return null===(e=this.crypto)||void 0===e?void 0:e.crossSigningInfo.getCacheCallbacks()}generateClientSecret(){return(0,K.randomString)(32)}decryptEventIfNeeded(e,t){return e.shouldAttemptDecryption()&&this.isCryptoEnabled()&&e.attemptDecryption(this.cryptoBackend,t),e.isBeingDecrypted()?e.getDecryptionPromise():Promise.resolve()}termsUrlForService(e,t){switch(e){case I.SERVICE_TYPES.IS:return this.http.getUrl("/terms",void 0,R.IdentityPrefix.V2,t);case I.SERVICE_TYPES.IM:return this.http.getUrl("/terms",void 0,"/_matrix/integrations/v1",t);default:throw new Error("Unsupported service type")}}getHomeserverUrl(){return this.baseUrl}getIdentityServerUrl(e=!1){var t,i;return e&&((null===(t=this.idBaseUrl)||void 0===t?void 0:t.startsWith("http://"))||(null===(i=this.idBaseUrl)||void 0===i?void 0:i.startsWith("https://")))?this.idBaseUrl.split("://")[1]:this.idBaseUrl}setIdentityServerUrl(e){this.idBaseUrl=g.ensureNoTrailingSlash(e),this.http.setIdBaseUrl(this.idBaseUrl)}getAccessToken(){return this.http.opts.accessToken||null}setAccessToken(e){this.http.opts.accessToken=e}isLoggedIn(){return void 0!==this.http.opts.accessToken}makeTxnId(){return"m"+(new Date).getTime()+"."+this.txnCtr++}isUsernameAvailable(e){return this.http.authedRequest(R.Method.Get,"/register/available",{username:e}).then((e=>e.available)).catch((e=>"M_USER_IN_USE"!==e.errcode&&Promise.reject(e)))}register(e,t,i,n,r,o,s){!0===r?r={email:!0}:null!=r&&!1!==r||(r={}),i&&(n.session=i);const a={auth:n,refresh_token:!0};return null!=e&&(a.username=e),null!=t&&(a.password=t),r.email&&(a.bind_email=!0),r.msisdn&&(a.bind_msisdn=!0),null!=o&&(a.guest_access_token=o),null!=s&&(a.inhibit_login=s),null!=t&&(a.x_show_msisdn=!0),this.registerRequest(a)}registerGuest({body:e}={}){return this.registerRequest(e||{},"guest")}registerRequest(e,t){const i={};return t&&(i.kind=t),this.http.request(R.Method.Post,"/register",i,e)}refreshToken(e){const t=t=>this.http.authedRequest(R.Method.Post,"/refresh",void 0,{refresh_token:e},{prefix:t,inhibitLogoutEmit:!0});return t(R.ClientPrefix.V3).catch((e=>{if("M_UNRECOGNIZED"===e.errcode)return t(R.ClientPrefix.V1);throw e}))}loginFlows(){return this.http.request(R.Method.Get,"/login")}login(e,t){return this.http.authedRequest(R.Method.Post,"/login",void 0,Object.assign(Object.assign({},t),{type:e})).then((e=>(e.access_token&&e.user_id&&(this.http.opts.accessToken=e.access_token,this.credentials={userId:e.user_id}),e)))}loginWithPassword(e,t){return this.login("m.login.password",{user:e,password:t})}getCasLoginUrl(e){return this.getSsoLoginUrl(e,"cas")}getSsoLoginUrl(e,t="sso",i,n){let r="/login/"+t+"/redirect";i&&(r+="/"+i);const o={redirectUrl:e,[he.unstable]:n};return this.http.getUrl(r,o).href}loginWithToken(e){return this.login("m.login.token",{token:e})}logout(e=!1){var t,i;return s(this,void 0,void 0,(function*(){if(null===(i=null===(t=this.crypto)||void 0===t?void 0:t.backupManager)||void 0===i?void 0:i.getKeyBackupEnabled())try{for(;(yield this.crypto.backupManager.backupPendingKeys(200))>0;);}catch(e){T.logger.error("Key backup request failed when logging out. Some keys may be missing from backup",e)}return e&&(this.stopClient(),this.http.abort()),this.http.authedRequest(R.Method.Post,"/logout")}))}deactivateAccount(e,t){const i={};return e&&(i.auth=e),void 0!==t&&(i.erase=t),this.http.authedRequest(R.Method.Post,"/account/deactivate",void 0,i)}requestLoginToken(e){return s(this,void 0,void 0,(function*(){const t=yield this.getCapabilities(),n=i.UNSTABLE_MSC3882_CAPABILITY.findIn(t)?"/org.matrix.msc3882/login/get_token":"/org.matrix.msc3882/login/token",r={auth:e},o=yield this.http.authedRequest(R.Method.Post,n,void 0,r,{prefix:R.ClientPrefix.Unstable});return"login_token"in o&&("number"==typeof o.expires_in_ms?o.expires_in=Math.floor(o.expires_in_ms/1e3):"number"==typeof o.expires_in&&(o.expires_in_ms=1e3*o.expires_in)),o}))}getFallbackAuthUrl(e,t){const i=g.encodeUri("/auth/$loginType/fallback/web",{$loginType:e});return this.http.getUrl(i,{session:t}).href}createRoom(e){var t;return s(this,void 0,void 0,(function*(){const i=(e.invite_3pid||[]).filter((e=>!e.id_access_token));if(i.length>0&&(null===(t=this.identityServer)||void 0===t?void 0:t.getAccessToken)){const e=yield this.identityServer.getAccessToken();if(e)for(const t of i)t.id_access_token=e}return this.http.authedRequest(R.Method.Post,"/createRoom",void 0,e)}))}fetchRelations(e,t,i,n,r={dir:m.Direction.Backward}){let o=r;Q.Thread.hasServerSideFwdPaginationSupport===Q.FeatureSupport.Experimental&&(o=(0,v.replaceParam)("dir","org.matrix.msc3715.dir",o)),this.canSupport.get(ie.Feature.RelationsRecursion)===ie.ServerSupport.Unstable&&(o=(0,v.replaceParam)("recurse","org.matrix.msc3981.recurse",o));const s=g.encodeParams(o);let a="/rooms/$roomId/relations/$eventId";null!==i?(a+="/$relationType",null!==n&&(a+="/$eventType")):null!==n&&(T.logger.warn(`eventType: ${n} ignored when fetching\n relations as relationType is null`),n=null);const c=g.encodeUri(a+"?"+s,{$roomId:e,$eventId:t,$relationType:i,$eventType:n});return this.http.authedRequest(R.Method.Get,c,void 0,void 0,{prefix:R.ClientPrefix.V1})}roomState(e){const t=g.encodeUri("/rooms/$roomId/state",{$roomId:e});return this.http.authedRequest(R.Method.Get,t)}fetchRoomEvent(e,t){const i=g.encodeUri("/rooms/$roomId/event/$eventId",{$roomId:e,$eventId:t});return this.http.authedRequest(R.Method.Get,i)}members(e,t,i,n){const r={};t&&(r.membership=t),i&&(r.not_membership=i),n&&(r.at=n);const o=g.encodeParams(r),s=g.encodeUri("/rooms/$roomId/members?"+o,{$roomId:e});return this.http.authedRequest(R.Method.Get,s)}upgradeRoom(e,t){const i=g.encodeUri("/rooms/$roomId/upgrade",{$roomId:e});return this.http.authedRequest(R.Method.Post,i,void 0,{new_version:t})}getStateEvent(e,t,i){const n={$roomId:e,$eventType:t,$stateKey:i};let r=g.encodeUri("/rooms/$roomId/state/$eventType",n);return void 0!==i&&(r=g.encodeUri(r+"/$stateKey",n)),this.http.authedRequest(R.Method.Get,r)}sendStateEvent(e,t,i,n="",r={}){const o={$roomId:e,$eventType:t,$stateKey:n};let s=g.encodeUri("/rooms/$roomId/state/$eventType",o);return void 0!==n&&(s=g.encodeUri(s+"/$stateKey",o)),this.http.authedRequest(R.Method.Put,s,void 0,i,r)}roomInitialSync(e,t){var i;const n=g.encodeUri("/rooms/$roomId/initialSync",{$roomId:e});return this.http.authedRequest(R.Method.Get,n,{limit:null!==(i=null==t?void 0:t.toString())&&void 0!==i?i:"30"})}setRoomReadMarkersHttpRequest(e,t,i,n){return s(this,void 0,void 0,(function*(){const r=g.encodeUri("/rooms/$roomId/read_markers",{$roomId:e}),o={[Y.ReceiptType.FullyRead]:t,[Y.ReceiptType.Read]:i};return((yield this.doesServerSupportUnstableFeature("org.matrix.msc2285.stable"))||(yield this.isVersionSupported("v1.4")))&&(o[Y.ReceiptType.ReadPrivate]=n),this.http.authedRequest(R.Method.Post,r,void 0,o)}))}getJoinedRooms(){const e=g.encodeUri("/joined_rooms",{});return this.http.authedRequest(R.Method.Get,e)}getJoinedRoomMembers(e){const t=g.encodeUri("/rooms/$roomId/joined_members",{$roomId:e});return this.http.authedRequest(R.Method.Get,t)}publicRooms(e={}){var{server:t,limit:i,since:n}=e,r=a(e,["server","limit","since"]);const o={server:t,limit:i,since:n};return 0===Object.keys(r).length?this.http.authedRequest(R.Method.Get,"/publicRooms",o):this.http.authedRequest(R.Method.Post,"/publicRooms",o,r)}createAlias(e,t){const i=g.encodeUri("/directory/room/$alias",{$alias:e}),n={room_id:t};return this.http.authedRequest(R.Method.Put,i,void 0,n)}deleteAlias(e){const t=g.encodeUri("/directory/room/$alias",{$alias:e});return this.http.authedRequest(R.Method.Delete,t)}getLocalAliases(e){const t=g.encodeUri("/rooms/$roomId/aliases",{$roomId:e}),i=R.ClientPrefix.V3;return this.http.authedRequest(R.Method.Get,t,void 0,void 0,{prefix:i})}getRoomIdForAlias(e){const t=g.encodeUri("/directory/room/$alias",{$alias:e});return this.http.authedRequest(R.Method.Get,t)}resolveRoomAlias(e){const t=g.encodeUri("/directory/room/$alias",{$alias:e});return this.http.request(R.Method.Get,t)}getRoomDirectoryVisibility(e){const t=g.encodeUri("/directory/list/room/$roomId",{$roomId:e});return this.http.authedRequest(R.Method.Get,t)}setRoomDirectoryVisibility(e,t){const i=g.encodeUri("/directory/list/room/$roomId",{$roomId:e});return this.http.authedRequest(R.Method.Put,i,void 0,{visibility:t})}searchUserDirectory({term:e,limit:t}){const i={search_term:e};return void 0!==t&&(i.limit=t),this.http.authedRequest(R.Method.Post,"/user_directory/search",void 0,i)}uploadContent(e,t){return this.http.uploadContent(e,t)}cancelUpload(e){return this.http.cancelUpload(e)}getCurrentUploads(){return this.http.getCurrentUploads()}getProfileInfo(e,t){const i=t?g.encodeUri("/profile/$userId/$info",{$userId:e,$info:t}):g.encodeUri("/profile/$userId",{$userId:e});return this.http.authedRequest(R.Method.Get,i)}getThreePids(){return this.http.authedRequest(R.Method.Get,"/account/3pid")}addThreePidOnly(e){return s(this,void 0,void 0,(function*(){return this.http.authedRequest(R.Method.Post,"/account/3pid/add",void 0,e)}))}bindThreePid(e){return s(this,void 0,void 0,(function*(){return this.http.authedRequest(R.Method.Post,"/account/3pid/bind",void 0,e)}))}unbindThreePid(e,t){return s(this,void 0,void 0,(function*(){const i={medium:e,address:t,id_server:this.getIdentityServerUrl(!0)};return this.http.authedRequest(R.Method.Post,"/account/3pid/unbind",void 0,i)}))}deleteThreePid(e,t){return this.http.authedRequest(R.Method.Post,"/account/3pid/delete",void 0,{medium:e,address:t})}setPassword(e,t,i){const n={auth:e,new_password:t,logout_devices:i};return this.http.authedRequest(R.Method.Post,"/account/password",void 0,n)}getDevices(){return this.http.authedRequest(R.Method.Get,"/devices")}getDevice(e){const t=g.encodeUri("/devices/$device_id",{$device_id:e});return this.http.authedRequest(R.Method.Get,t)}setDeviceDetails(e,t){const i=g.encodeUri("/devices/$device_id",{$device_id:e});return this.http.authedRequest(R.Method.Put,i,void 0,t)}deleteDevice(e,t){const i=g.encodeUri("/devices/$device_id",{$device_id:e}),n={};return t&&(n.auth=t),this.http.authedRequest(R.Method.Delete,i,void 0,n)}deleteMultipleDevices(e,t){const i={devices:e};t&&(i.auth=t);return this.http.authedRequest(R.Method.Post,"/delete_devices",void 0,i)}getPushers(){return s(this,void 0,void 0,(function*(){const e=yield this.http.authedRequest(R.Method.Get,"/pushers");return(yield this.doesServerSupportUnstableFeature("org.matrix.msc3881"))||(e.pushers=e.pushers.map((e=>(e.hasOwnProperty(B.PUSHER_ENABLED.name)||(e[B.PUSHER_ENABLED.name]=!0),e)))),e}))}setPusher(e){return this.http.authedRequest(R.Method.Post,"/pushers/set",void 0,e)}removePusher(e,t){const i={pushkey:e,app_id:t,kind:null};return this.http.authedRequest(R.Method.Post,"/pushers/set",void 0,i)}setLocalNotificationSettings(e,t){const i=`${B.LOCAL_NOTIFICATION_SETTINGS_PREFIX.name}.${e}`;return this.setAccountData(i,t)}getPushRules(){return this.http.authedRequest(R.Method.Get,"/pushrules/").then((e=>(this.setPushRules(e),this.pushRules)))}setPushRules(e){this.pushRules=y.PushProcessor.rewriteDefaultRules(e,this.getUserId()),this.pushProcessor.updateCachedPushRuleKeys(this.pushRules)}addPushRule(e,t,i,n){const r=g.encodeUri("/pushrules/"+e+"/$kind/$ruleId",{$kind:t,$ruleId:i});return this.http.authedRequest(R.Method.Put,r,void 0,n)}deletePushRule(e,t,i){const n=g.encodeUri("/pushrules/"+e+"/$kind/$ruleId",{$kind:t,$ruleId:i});return this.http.authedRequest(R.Method.Delete,n)}setPushRuleEnabled(e,t,i,n){const r=g.encodeUri("/pushrules/"+e+"/$kind/$ruleId/enabled",{$kind:t,$ruleId:i});return this.http.authedRequest(R.Method.Put,r,void 0,{enabled:n})}setPushRuleActions(e,t,i,n){const r=g.encodeUri("/pushrules/"+e+"/$kind/$ruleId/actions",{$kind:t,$ruleId:i});return this.http.authedRequest(R.Method.Put,r,void 0,{actions:n})}search({body:e,next_batch:t},i){const n={};return t&&(n.next_batch=t),this.http.authedRequest(R.Method.Post,"/search",n,e,{abortSignal:i})}uploadKeysRequest(e,t){return this.http.authedRequest(R.Method.Post,"/keys/upload",void 0,e)}uploadKeySignatures(e){return this.http.authedRequest(R.Method.Post,"/keys/signatures/upload",void 0,e)}downloadKeysForUsers(e,{token:t}={}){const i={device_keys:{}};return void 0!==t&&(i.token=t),e.forEach((e=>{i.device_keys[e]=[]})),this.http.authedRequest(R.Method.Post,"/keys/query",void 0,i)}claimOneTimeKeys(e,t="signed_curve25519",i){const n={};void 0===t&&(t="signed_curve25519");for(const[i,r]of e){const e=n[i]||{};(0,v.safeSet)(n,i,e),(0,v.safeSet)(e,r,t)}const r={one_time_keys:n};i&&(r.timeout=i);return this.http.authedRequest(R.Method.Post,"/keys/claim",void 0,r)}getKeyChanges(e,t){const i={from:e,to:t};return this.http.authedRequest(R.Method.Get,"/keys/changes",i)}uploadDeviceSigningKeys(e,t){const i=Object.assign({},t);return e&&Object.assign(i,{auth:e}),this.http.authedRequest(R.Method.Post,"/keys/device_signing/upload",void 0,i,{prefix:R.ClientPrefix.Unstable})}registerWithIdentityServer(e){if(!this.idBaseUrl)throw new Error("No identity server base URL set");const t=this.http.getUrl("/account/register",void 0,R.IdentityPrefix.V2,this.idBaseUrl);return this.http.requestOtherUrl(R.Method.Post,t,e)}requestEmailToken(e,t,i,n,r){const o={client_secret:t,email:e,send_attempt:null==i?void 0:i.toString()};return n&&(o.next_link=n),this.http.idServerRequest(R.Method.Post,"/validate/email/requestToken",o,R.IdentityPrefix.V2,r)}requestMsisdnToken(e,t,i,n,r,o){const s={client_secret:i,country:e,phone_number:t,send_attempt:null==n?void 0:n.toString()};return r&&(s.next_link=r),this.http.idServerRequest(R.Method.Post,"/validate/msisdn/requestToken",s,R.IdentityPrefix.V2,o)}submitMsisdnToken(e,t,i,n){const r={sid:e,client_secret:t,token:i};return this.http.idServerRequest(R.Method.Post,"/validate/msisdn/submitToken",r,R.IdentityPrefix.V2,null!=n?n:void 0)}submitMsisdnTokenOtherUrl(e,t,i,n){const r={sid:t,client_secret:i,token:n};return this.http.requestOtherUrl(R.Method.Post,e,r)}getIdentityHashDetails(e){return this.http.idServerRequest(R.Method.Get,"/hash_details",void 0,R.IdentityPrefix.V2,e)}identityHashedLookup(e,i){return s(this,void 0,void 0,(function*(){const n={},r=yield this.getIdentityHashDetails(i);if(!r||!r.lookup_pepper||!r.algorithms)throw new Error("Unsupported identity server: bad response");n.pepper=r.lookup_pepper;const o={};if(r.algorithms.includes("sha256")){const i=new t.Olm.Utility;n.addresses=e.map((e=>{const t=e[0].toLowerCase(),r=e[1].toLowerCase(),s=i.sha256(`${t} ${r} ${n.pepper}`).replace(/\+/g,"-").replace(/\//g,"_");return o[s]=e[0],s})),n.algorithm="sha256"}else{if(!r.algorithms.includes("none"))throw new Error("Unsupported identity server: unknown hash algorithm");n.addresses=e.map((e=>{const t=`${e[0].toLowerCase()} ${e[1].toLowerCase()}`;return o[t]=e[0],t})),n.algorithm="none"}const s=yield this.http.idServerRequest(R.Method.Post,"/lookup",n,R.IdentityPrefix.V2,i);if(!(null==s?void 0:s.mappings))return[];const a=[];for(const e of Object.keys(s.mappings)){const t=s.mappings[e],i=o[e];if(!i)throw new Error("Identity server returned more results than expected");a.push({address:i,mxid:t})}return a}))}lookupThreePid(e,t,i){return s(this,void 0,void 0,(function*(){const n=(yield this.identityHashedLookup([[t,e]],i)).find((e=>e.address===t));if(!n)return{};return{address:t,medium:e,mxid:n.mxid}}))}bulkLookupThreePids(e,t){return s(this,void 0,void 0,(function*(){const i=yield this.identityHashedLookup(e.map((e=>[e[1],e[0]])),t),n=[];for(const t of i){const i=e.find((e=>e[1]===t.address));if(!i)throw new Error("Identity sever returned unexpected results");n.push([i[0],t.address,t.mxid])}return{threepids:n}}))}getIdentityAccount(e){return this.http.idServerRequest(R.Method.Get,"/account",void 0,R.IdentityPrefix.V2,e)}sendToDevice(e,t,i){const n=g.encodeUri("/sendToDevice/$eventType/$txnId",{$eventType:e,$txnId:i||this.makeTxnId()}),r={messages:g.recursiveMapToObject(t)},o=new Map;for(const[e,i]of t)o.set(e,Array.from(i.keys()));return T.logger.log(`PUT ${n}`,o),this.http.authedRequest(R.Method.Put,n,void 0,r)}queueToDevice(e){return this.toDeviceMessageQueue.queueBatch(e)}getThirdpartyProtocols(){return this.http.authedRequest(R.Method.Get,"/thirdparty/protocols").then((e=>{if(!e||"object"!=typeof e)throw new Error(`/thirdparty/protocols did not return an object: ${e}`);return e}))}getThirdpartyLocation(e,t){const i=g.encodeUri("/thirdparty/location/$protocol",{$protocol:e});return this.http.authedRequest(R.Method.Get,i,t)}getThirdpartyUser(e,t){const i=g.encodeUri("/thirdparty/user/$protocol",{$protocol:e});return this.http.authedRequest(R.Method.Get,i,t)}getTerms(e,t){const i=this.termsUrlForService(e,t);return this.http.requestOtherUrl(R.Method.Get,i)}agreeToTerms(e,t,i,n){const r=this.termsUrlForService(e,t),o={Authorization:"Bearer "+i};return this.http.requestOtherUrl(R.Method.Post,r,{user_accepts:n},{headers:o})}reportEvent(e,t,i,n){const r=g.encodeUri("/rooms/$roomId/report/$eventId",{$roomId:e,$eventId:t});return this.http.authedRequest(R.Method.Post,r,void 0,{score:i,reason:n})}getRoomHierarchy(e,t,i,n=!1,r){const o=g.encodeUri("/rooms/$roomId/hierarchy",{$roomId:e}),s={suggested_only:String(n),max_depth:null==i?void 0:i.toString(),from:r,limit:null==t?void 0:t.toString()};return this.http.authedRequest(R.Method.Get,o,s,void 0,{prefix:R.ClientPrefix.V1}).catch((e=>{if("M_UNRECOGNIZED"===e.errcode)return this.http.authedRequest(R.Method.Get,o,s,void 0,{prefix:"/_matrix/client/unstable/org.matrix.msc2946"});throw e}))}unstableCreateFileTree(e){return s(this,void 0,void 0,(function*(){const{room_id:t}=yield this.createRoom({name:e,preset:j.Preset.PrivateChat,power_level_content_override:Object.assign(Object.assign({},$.DEFAULT_TREE_POWER_LEVELS_TEMPLATE),{users:{[this.getUserId()]:100}}),creation_content:{[B.RoomCreateTypeField]:B.RoomType.Space},initial_state:[{type:B.UNSTABLE_MSC3088_PURPOSE.name,state_key:B.UNSTABLE_MSC3089_TREE_SUBTYPE.name,content:{[B.UNSTABLE_MSC3088_ENABLED.name]:!0}},{type:B.EventType.RoomEncryption,state_key:"",content:{algorithm:_.MEGOLM_ALGORITHM}}]});return new $.MSC3089TreeSpace(this,t)}))}unstableGetFileTreeSpace(e){var t,i;const n=this.getRoom(e);if("join"!==(null==n?void 0:n.getMyMembership()))return null;const r=n.currentState.getStateEvents(B.EventType.RoomCreate,""),o=n.currentState.getStateEvents(B.UNSTABLE_MSC3088_PURPOSE.name,B.UNSTABLE_MSC3089_TREE_SUBTYPE.name);if(!r)throw new Error("Expected single room create event");return(null===(t=null==o?void 0:o.getContent())||void 0===t?void 0:t[B.UNSTABLE_MSC3088_ENABLED.name])?(null===(i=r.getContent())||void 0===i?void 0:i[B.RoomCreateTypeField])!==B.RoomType.Space?null:new $.MSC3089TreeSpace(this,e):null}slidingSync(e,t,i){const n={};e.pos&&(n.pos=e.pos,delete e.pos),e.timeout&&(n.timeout=e.timeout,delete e.timeout);const r=e.clientTimeout;return delete e.clientTimeout,this.http.authedRequest(R.Method.Post,"/sync",n,e,{prefix:"/_matrix/client/unstable/org.matrix.msc3575",baseUrl:t,localTimeoutMs:r,abortSignal:i})}supportsExperimentalThreads(){var e;return T.logger.warn("supportsExperimentalThreads() is deprecated, use supportThreads() instead"),(null===(e=this.clientOpts)||void 0===e?void 0:e.experimentalThreadSupport)||!1}supportsThreads(){var e;return(null===(e=this.clientOpts)||void 0===e?void 0:e.threadSupport)||!1}supportsIntentionalMentions(){return this.canSupport.get(ie.Feature.IntentionalMentions)!==ie.ServerSupport.Unsupported}getRoomSummary(e,t){return s(this,void 0,void 0,(function*(){const i=g.encodeUri("/rooms/$roomid/summary",{$roomid:e});return this.http.authedRequest(R.Method.Get,i,{via:t},void 0,{prefix:"/_matrix/client/unstable/im.nheko.summary"})}))}processThreadEvents(e,t,i){e.processThreadedEvents(t,i)}processThreadRoots(e,t,i){this.supportsThreads()&&e.processThreadRoots(t,i)}processBeaconEvents(e,t){this.processAggregatedTimelineEvents(e,t)}processAggregatedTimelineEvents(e,t){(null==t?void 0:t.length)&&e&&(e.currentState.processBeaconEvents(t,this),e.processPollEvents(t))}whoami(){return s(this,void 0,void 0,(function*(){return this.http.authedRequest(R.Method.Get,"/account/whoami")}))}timestampToEvent(e,t,i){return s(this,void 0,void 0,(function*(){const n=g.encodeUri("/rooms/$roomId/timestamp_to_event",{$roomId:e}),r={ts:t.toString(),dir:i};try{return yield this.http.authedRequest(R.Method.Get,n,r,void 0,{prefix:R.ClientPrefix.V1})}catch(e){if("M_UNRECOGNIZED"===e.errcode&&(400===e.httpStatus||404===e.httpStatus||405===e.httpStatus))return yield this.http.authedRequest(R.Method.Get,n,r,void 0,{prefix:"/_matrix/client/unstable/org.matrix.msc3030"});throw e}}))}}function pe(e,t){var i;const n=e.getUserId(),r=t.getId(),o=e.getRoom(t.getRoomId());if(!o||!n||!r)return;const s=!!t.threadRootId&&!t.isThreadRoot;let a;if(s){const e=o.getThread(t.threadRootId);a=!e||e.hasUserReadEvent(n,r)}else a=o.hasUserReadEvent(n,r);if(a)return;const c=e.getPushActionsForEvent(t,!0);if(!!(null===(i=null==c?void 0:c.tweaks)||void 0===i?void 0:i.highlight)){const e=o.getUnreadCountForEventContext(U.NotificationCountType.Highlight,t)+1;s?o.setThreadUnreadNotificationCount(t.threadRootId,U.NotificationCountType.Highlight,e):o.setUnreadNotificationCount(U.NotificationCountType.Highlight,e)}if(!!(null==c?void 0:c.notify)){const e=o.getUnreadCountForEventContext(U.NotificationCountType.Total,t)+1;s?o.setThreadUnreadNotificationCount(t.threadRootId,U.NotificationCountType.Total,e):o.setUnreadNotificationCount(U.NotificationCountType.Total,e)}}i.MatrixClient=fe,fe.RESTORE_BACKUP_ERROR_BAD_KEY="RESTORE_BACKUP_ERROR_BAD_KEY",i.fixNotificationCountOnDecryption=pe}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"./@types/PushRules":315,"./@types/beacon":317,"./@types/event":319,"./@types/partials":323,"./@types/read_receipts":325,"./@types/search":328,"./NamespacedValue":333,"./ReEmitter":334,"./ToDeviceMessageQueue":335,"./autodiscovery":336,"./content-helpers":339,"./content-repo":340,"./crypto":363,"./crypto/RoomList":349,"./crypto/api":357,"./crypto/backup":358,"./crypto/dehydration":360,"./crypto/key_passphrase":364,"./crypto/olmlib":365,"./crypto/recoverykey":366,"./event-mapper":382,"./feature":384,"./filter":386,"./http-api":389,"./logger":396,"./matrixrtc/MatrixRTCSessionManager":400,"./models/MSC3089TreeSpace":402,"./models/event":409,"./models/event-timeline":408,"./models/invites-ignorer":410,"./models/room":418,"./models/room-member":415,"./models/search-result":419,"./models/thread":420,"./models/typed-event-emitter":421,"./models/user":422,"./pushprocessor":426,"./randomstring":427,"./rust-crypto":432,"./rust-crypto/constants":431,"./secret-storage":434,"./service-types":435,"./sliding-sync-sdk":436,"./store/stub":443,"./sync":445,"./utils":447,"./webrtc/call":450,"./webrtc/callEventHandler":451,"./webrtc/groupCall":454,"./webrtc/groupCallEventHandler":455,"./webrtc/mediaHandler":456}],339:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.parseBeaconContent=i.makeBeaconContent=i.parseBeaconInfoContent=i.makeBeaconInfoContent=i.parseTopicContent=i.makeTopicContent=i.parseLocationEvent=i.makeLocationContent=i.getTextForLocationEvent=i.makeEmoteMessage=i.makeNotice=i.makeTextMessage=i.makeHtmlEmote=i.makeHtmlNotice=i.makeHtmlMessage=void 0;const n=e("./@types/event"),r=e("./@types/extensible_events"),o=e("./extensible_events_v1/utilities"),s=e("./@types/location"),a=e("./@types/topic");i.makeHtmlMessage=function(e,t){return{msgtype:n.MsgType.Text,format:"org.matrix.custom.html",body:e,formatted_body:t}},i.makeHtmlNotice=function(e,t){return{msgtype:n.MsgType.Notice,format:"org.matrix.custom.html",body:e,formatted_body:t}},i.makeHtmlEmote=function(e,t){return{msgtype:n.MsgType.Emote,format:"org.matrix.custom.html",body:e,formatted_body:t}},i.makeTextMessage=function(e){return{msgtype:n.MsgType.Text,body:e}},i.makeNotice=function(e){return{msgtype:n.MsgType.Notice,body:e}},i.makeEmoteMessage=function(e){return{msgtype:n.MsgType.Emote,body:e}};i.getTextForLocationEvent=(e,t,i,n)=>{const r=`at ${new Date(i).toISOString()}`;return[t===s.LocationAssetType.Self?"User":void 0,"Location",n?`"${n}"`:void 0,e,r].filter(Boolean).join(" ")};i.makeLocationContent=(e,t,o,a,c)=>{const d=null!=e?e:(0,i.getTextForLocationEvent)(t,c||s.LocationAssetType.Self,o,a),l=o?{[s.M_TIMESTAMP.name]:o}:{};return Object.assign({msgtype:n.MsgType.Location,body:d,geo_uri:t,[s.M_LOCATION.name]:{description:a,uri:t},[s.M_ASSET.name]:{type:c||s.LocationAssetType.Self},[r.M_TEXT.name]:d},l)};i.parseLocationEvent=e=>{var t,n;const o=s.M_LOCATION.findIn(e),a=s.M_ASSET.findIn(e),c=s.M_TIMESTAMP.findIn(e),d=r.M_TEXT.findIn(e),l=null!==(t=null==o?void 0:o.uri)&&void 0!==t?t:null==e?void 0:e.geo_uri,u=null==o?void 0:o.description,h=null!==(n=null==a?void 0:a.type)&&void 0!==n?n:s.LocationAssetType.Self,f=null!=d?d:e.body;return(0,i.makeLocationContent)(f,l,null!=c?c:void 0,u,h)};i.makeTopicContent=(e,t)=>{const i=[{body:e,mimetype:"text/plain"}];return(0,o.isProvided)(t)&&i.push({body:t,mimetype:"text/html"}),{topic:e,[a.M_TOPIC.name]:i}};i.parseTopicContent=e=>{var t,i,n;const r=a.M_TOPIC.findIn(e);if(!Array.isArray(r))return{text:e.topic};return{text:null!==(i=null===(t=null==r?void 0:r.find((e=>!(0,o.isProvided)(e.mimetype)||"text/plain"===e.mimetype)))||void 0===t?void 0:t.body)&&void 0!==i?i:e.topic,html:null===(n=null==r?void 0:r.find((e=>"text/html"===e.mimetype)))||void 0===n?void 0:n.body}};i.makeBeaconInfoContent=(e,t,i,n,r)=>({description:i,timeout:e,live:t,[s.M_TIMESTAMP.name]:r||Date.now(),[s.M_ASSET.name]:{type:null!=n?n:s.LocationAssetType.Self}});i.parseBeaconInfoContent=e=>{var t;const{description:i,timeout:n,live:r}=e,o=null!==(t=s.M_TIMESTAMP.findIn(e))&&void 0!==t?t:void 0,a=s.M_ASSET.findIn(e);return{description:i,timeout:n,live:r,assetType:null==a?void 0:a.type,timestamp:o}};i.makeBeaconContent=(e,t,i,n)=>({[s.M_LOCATION.name]:{description:n,uri:e},[s.M_TIMESTAMP.name]:t,"m.relates_to":{rel_type:r.REFERENCE_RELATION.name,event_id:i}});i.parseBeaconContent=e=>{var t;const i=s.M_LOCATION.findIn(e),n=null!==(t=s.M_TIMESTAMP.findIn(e))&&void 0!==t?t:void 0;return{description:null==i?void 0:i.description,uri:null==i?void 0:i.uri,timestamp:n}}},{"./@types/event":319,"./@types/extensible_events":320,"./@types/location":322,"./@types/topic":331,"./extensible_events_v1/utilities":383}],340:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.getHttpUriForMxc=void 0;const n=e("./utils");i.getHttpUriForMxc=function(e,t,i,r,o,s=!1){if("string"!=typeof t||!t)return"";if(0!==t.indexOf("mxc://"))return s?t:"";let a=t.slice(6),c="/_matrix/media/v3/download/";const d={};i&&(d.width=Math.round(i).toString()),r&&(d.height=Math.round(r).toString()),o&&(d.method=o),Object.keys(d).length>0&&(c="/_matrix/media/v3/thumbnail/");const l=a.indexOf("#");let u="";return l>=0&&(u=a.slice(l),a=a.slice(0,l)),e+c+a+(0===Object.keys(d).length?"":"?"+(0,n.encodeParams)(d))+u}},{"./utils":447}],341:[function(e,t,i){"use strict";var n,r,o,s=this&&this.__createBinding||(Object.create?function(e,t,i,n){void 0===n&&(n=i);var r=Object.getOwnPropertyDescriptor(t,i);r&&!("get"in r?!t.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return t[i]}}),Object.defineProperty(e,n,r)}:function(e,t,i,n){void 0===n&&(n=i),e[n]=t[i]}),a=this&&this.__exportStar||function(e,t){for(var i in e)"default"===i||Object.prototype.hasOwnProperty.call(t,i)||s(t,e,i)};Object.defineProperty(i,"__esModule",{value:!0}),i.EventShieldReason=i.EventShieldColour=i.CrossSigningKey=i.DeviceVerificationStatus=i.UserVerificationStatus=void 0;i.UserVerificationStatus=class{constructor(e,t,i){this.crossSigningVerified=e,this.crossSigningVerifiedBefore=t,this.tofu=i}isVerified(){return this.isCrossSigningVerified()}isCrossSigningVerified(){return this.crossSigningVerified}wasCrossSigningVerified(){return this.crossSigningVerifiedBefore}isTofu(){return this.tofu}};i.DeviceVerificationStatus=class{constructor(e){var t,i,n,r,o;this.signedByOwner=null!==(t=e.signedByOwner)&&void 0!==t&&t,this.crossSigningVerified=null!==(i=e.crossSigningVerified)&&void 0!==i&&i,this.tofu=null!==(n=e.tofu)&&void 0!==n&&n,this.localVerified=null!==(r=e.localVerified)&&void 0!==r&&r,this.trustCrossSignedDevices=null!==(o=e.trustCrossSignedDevices)&&void 0!==o&&o}isVerified(){return this.localVerified||this.trustCrossSignedDevices&&this.crossSigningVerified}},function(e){e.Master="master",e.SelfSigning="self_signing",e.UserSigning="user_signing"}(n||(i.CrossSigningKey=n={})),function(e){e[e.NONE=0]="NONE",e[e.GREY=1]="GREY",e[e.RED=2]="RED"}(r||(i.EventShieldColour=r={})),function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.UNVERIFIED_IDENTITY=1]="UNVERIFIED_IDENTITY",e[e.UNSIGNED_DEVICE=2]="UNSIGNED_DEVICE",e[e.UNKNOWN_DEVICE=3]="UNKNOWN_DEVICE",e[e.AUTHENTICITY_NOT_GUARANTEED=4]="AUTHENTICITY_NOT_GUARANTEED",e[e.MISMATCHED_SENDER_KEY=5]="MISMATCHED_SENDER_KEY"}(o||(i.EventShieldReason=o={})),a(e("./crypto-api/verification"),i),a(e("./crypto-api/keybackup"),i)},{"./crypto-api/keybackup":342,"./crypto-api/verification":343}],342:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0})},{}],343:[function(e,t,i){"use strict";var n,r,o;Object.defineProperty(i,"__esModule",{value:!0}),i.canAcceptVerificationRequest=i.VerifierEvent=i.VerificationPhase=i.VerificationRequestEvent=void 0,function(e){e.Change="change"}(n||(i.VerificationRequestEvent=n={})),function(e){e[e.Unsent=1]="Unsent",e[e.Requested=2]="Requested",e[e.Ready=3]="Ready",e[e.Started=4]="Started",e[e.Cancelled=5]="Cancelled",e[e.Done=6]="Done"}(r||(i.VerificationPhase=r={})),function(e){e.Cancel="cancel",e.ShowSas="show_sas",e.ShowReciprocateQr="show_reciprocate_qr"}(o||(i.VerifierEvent=o={})),i.canAcceptVerificationRequest=function(e){return e.phase<r.Ready&&!e.accepting&&!e.declining}},{}],344:[function(e,t,i){(function(t,n){(function(){"use strict";var r=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))((function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?r(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};Object.defineProperty(i,"__esModule",{value:!0}),i.requestKeysDuringVerification=i.createCryptoStoreCacheCallbacks=i.DeviceTrustLevel=i.CrossSigningLevel=i.CrossSigningInfo=i.UserTrustLevel=void 0;const o=e("./olmlib"),s=e("../logger"),a=e("../crypto/store/indexeddb-crypto-store"),c=e("./aes"),d=e("../crypto-api");Object.defineProperty(i,"UserTrustLevel",{enumerable:!0,get:function(){return d.UserVerificationStatus}});function l(e){return Object.values(e.keys)[0]}class u{constructor(e,t={},i={}){this.userId=e,this.callbacks=t,this.cacheCallbacks=i,this.keys={},this.firstUse=!0,this.crossSigningVerifiedBefore=!1}static fromStorage(e,t){const i=new u(t);for(const t in e)e.hasOwnProperty(t)&&(i[t]=e[t]);return i}toStorage(){return{keys:this.keys,firstUse:this.firstUse,crossSigningVerifiedBefore:this.crossSigningVerifiedBefore}}getCrossSigningKey(e,i){return r(this,void 0,void 0,(function*(){const n=["master","self_signing","user_signing"].indexOf(e)>=0;if(!this.callbacks.getCrossSigningKey)throw new Error("No getCrossSigningKey callback supplied");function r(e){if(!e)return;const n=new t.Olm.PkSigning,r=n.init_with_seed(e);if(r===i)return[r,n];n.free()}void 0===i&&(i=this.getId(e));let o=null;this.cacheCallbacks.getCrossSigningKeyCache&&n&&(o=yield this.cacheCallbacks.getCrossSigningKeyCache(e,i));const s=r(o);if(s)return s;o=yield this.callbacks.getCrossSigningKey(e,i);const a=r(o);if(a)return this.cacheCallbacks.storeCrossSigningKeyCache&&n&&(yield this.cacheCallbacks.storeCrossSigningKeyCache(e,o)),a;if(!o)throw new Error("getCrossSigningKey callback for "+e+" returned falsey");throw new Error("Key type "+e+" from getCrossSigningKey callback did not match")}))}isStoredInSecretStorage(e){return r(this,void 0,void 0,(function*(){const t=(yield e.isStored("m.cross_signing.master"))||{};function i(e){for(const i of Object.keys(t))e[i]||delete t[i]}for(const t of["self_signing","user_signing"])i((yield e.isStored(`m.cross_signing.${t}`))||{});return Object.keys(t).length?t:nul |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment