u-space 0.0.18 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/plugins/atmosphere/index.cjs +1 -1
- package/dist/plugins/atmosphere/index.js +98 -109
- package/dist/plugins/tiles/ArcgisTilesRenderer.d.ts +11 -0
- package/dist/plugins/tiles/index.cjs +1 -1
- package/dist/plugins/tiles/index.js +62 -52
- package/dist/plugins/u-manager/index.cjs +43 -43
- package/dist/plugins/u-manager/index.js +7986 -7662
- package/dist/plugins/u-manager/semantics/SemanticLoader.d.ts +1 -1
- package/dist/plugins/u-manager/semantics/SemanticParser.d.ts +1 -1
- package/dist/plugins/u-manager/semantics/index.d.ts +5 -2
- package/dist/plugins/u-manager/semantics/{BuildingGroup.d.ts → objects/BuildingGroup.d.ts} +11 -1
- package/dist/plugins/u-manager/semantics/objects/ElevatorMesh.d.ts +8 -0
- package/dist/plugins/u-manager/semantics/{FloorMesh.d.ts → objects/FloorMesh.d.ts} +2 -1
- package/dist/plugins/u-manager/semantics/objects/VentMesh.d.ts +8 -0
- package/dist/plugins/u-manager/semantics/objects/VerticalShaftMesh.d.ts +25 -0
- package/dist/plugins/u-manager/semantics/semantic.types.d.ts +28 -0
- package/dist/plugins/u-manager/semantics/types.d.ts +1 -1
- package/docs/api-plugin-atmosphere.md +20 -8
- package/docs/api-plugin-tiles.md +38 -6
- package/docs/api-plugin-u-manager.md +28 -3
- package/docs/changelog.md +29 -0
- package/docs/examples-guide.md +2 -1
- package/docs/index.md +2 -2
- package/docs/mcp.md +1 -1
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const webgpu=require("three/webgpu"),uSpace=require("u-space"),tsl=require("three/tsl"),index=require("../../index.cjs");class BaseFileLoader extends webgpu.FileLoader{constructor(t){super(),this.manager=t.manager,this.setPath(t.path),this.setResponseType("json"),this.setRequestHeader(t.requestHeader),this.setWithCredentials(t.withCredentials)}async loadAsync(t){return super.loadAsync(t)}}const META_DATA_FILE_PATH="/SceneMetadata.json",dbBase="/db",TOPOLOGY_DATA_FILE_PATH=`${dbBase}/topology_paths.json`,ANIMATIONS_DATA_FILE_PATH=`${dbBase}/animations.json`,VISIONS_DATA_FILE_PATH=`${dbBase}/model_visions.json`,PROPERTIES_DATA_FILE_PATH=`${dbBase}/properties.json`,SEMANTIC_DATA_FILE_PATH=`${dbBase}/semantic_model.json`;var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs$1(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}var buffer$1={},base64Js={};base64Js.byteLength=byteLength;base64Js.toByteArray=toByteArray;base64Js.fromByteArray=fromByteArray;var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;revLookup[45]=62;revLookup[95]=63;function getLens(c){var t=c.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var u=c.indexOf("=");u===-1&&(u=t);var o=u===t?0:4-u%4;return[u,o]}function byteLength(c){var t=getLens(c),u=t[0],o=t[1];return(u+o)*3/4-o}function _byteLength(c,t,u){return(t+u)*3/4-u}function toByteArray(c){var t,u=getLens(c),o=u[0],d=u[1],r=new Arr(_byteLength(c,o,d)),h=0,f=d>0?o-4:o,a;for(a=0;a<f;a+=4)t=revLookup[c.charCodeAt(a)]<<18|revLookup[c.charCodeAt(a+1)]<<12|revLookup[c.charCodeAt(a+2)]<<6|revLookup[c.charCodeAt(a+3)],r[h++]=t>>16&255,r[h++]=t>>8&255,r[h++]=t&255;return d===2&&(t=revLookup[c.charCodeAt(a)]<<2|revLookup[c.charCodeAt(a+1)]>>4,r[h++]=t&255),d===1&&(t=revLookup[c.charCodeAt(a)]<<10|revLookup[c.charCodeAt(a+1)]<<4|revLookup[c.charCodeAt(a+2)]>>2,r[h++]=t>>8&255,r[h++]=t&255),r}function tripletToBase64(c){return lookup[c>>18&63]+lookup[c>>12&63]+lookup[c>>6&63]+lookup[c&63]}function encodeChunk(c,t,u){for(var o,d=[],r=t;r<u;r+=3)o=(c[r]<<16&16711680)+(c[r+1]<<8&65280)+(c[r+2]&255),d.push(tripletToBase64(o));return d.join("")}function fromByteArray(c){for(var t,u=c.length,o=u%3,d=[],r=16383,h=0,f=u-o;h<f;h+=r)d.push(encodeChunk(c,h,h+r>f?f:h+r));return o===1?(t=c[u-1],d.push(lookup[t>>2]+lookup[t<<4&63]+"==")):o===2&&(t=(c[u-2]<<8)+c[u-1],d.push(lookup[t>>10]+lookup[t>>4&63]+lookup[t<<2&63]+"=")),d.join("")}var ieee754={};ieee754.read=function(c,t,u,o,d){var r,h,f=d*8-o-1,a=(1<<f)-1,n=a>>1,e=-7,s=u?d-1:0,l=u?-1:1,v=c[t+s];for(s+=l,r=v&(1<<-e)-1,v>>=-e,e+=f;e>0;r=r*256+c[t+s],s+=l,e-=8);for(h=r&(1<<-e)-1,r>>=-e,e+=o;e>0;h=h*256+c[t+s],s+=l,e-=8);if(r===0)r=1-n;else{if(r===a)return h?NaN:(v?-1:1)*(1/0);h=h+Math.pow(2,o),r=r-n}return(v?-1:1)*h*Math.pow(2,r-o)};ieee754.write=function(c,t,u,o,d,r){var h,f,a,n=r*8-d-1,e=(1<<n)-1,s=e>>1,l=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=o?0:r-1,b=o?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(f=isNaN(t)?1:0,h=e):(h=Math.floor(Math.log(t)/Math.LN2),t*(a=Math.pow(2,-h))<1&&(h--,a*=2),h+s>=1?t+=l/a:t+=l*Math.pow(2,1-s),t*a>=2&&(h++,a/=2),h+s>=e?(f=0,h=e):h+s>=1?(f=(t*a-1)*Math.pow(2,d),h=h+s):(f=t*Math.pow(2,s-1)*Math.pow(2,d),h=0));d>=8;c[u+v]=f&255,v+=b,f/=256,d-=8);for(h=h<<d|f,n+=d;n>0;c[u+v]=h&255,v+=b,h/=256,n-=8);c[u+v-b]|=m*128};(function(c){const t=base64Js,u=ieee754,o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;c.Buffer=e,c.SlowBuffer=j,c.INSPECT_MAX_BYTES=50;const d=2147483647;c.kMaxLength=d;const{Uint8Array:r,ArrayBuffer:h,SharedArrayBuffer:f}=globalThis;e.TYPED_ARRAY_SUPPORT=a(),!e.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function a(){try{const U=new r(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,r.prototype),Object.setPrototypeOf(U,I),U.foo()===42}catch{return!1}}Object.defineProperty(e.prototype,"parent",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.buffer}}),Object.defineProperty(e.prototype,"offset",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.byteOffset}});function n(U){if(U>d)throw new RangeError('The value "'+U+'" is invalid for option "size"');const I=new r(U);return Object.setPrototypeOf(I,e.prototype),I}function e(U,I,C){if(typeof U=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return b(U)}return s(U,I,C)}e.poolSize=8192;function s(U,I,C){if(typeof U=="string")return m(U,I);if(h.isView(U))return E(U);if(U==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U);if(ce(U,h)||U&&ce(U.buffer,h)||typeof f<"u"&&(ce(U,f)||U&&ce(U.buffer,f)))return S(U,I,C);if(typeof U=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const X=U.valueOf&&U.valueOf();if(X!=null&&X!==U)return e.from(X,I,C);const se=O(U);if(se)return se;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof U[Symbol.toPrimitive]=="function")return e.from(U[Symbol.toPrimitive]("string"),I,C);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U)}e.from=function(U,I,C){return s(U,I,C)},Object.setPrototypeOf(e.prototype,r.prototype),Object.setPrototypeOf(e,r);function l(U){if(typeof U!="number")throw new TypeError('"size" argument must be of type number');if(U<0)throw new RangeError('The value "'+U+'" is invalid for option "size"')}function v(U,I,C){return l(U),U<=0?n(U):I!==void 0?typeof C=="string"?n(U).fill(I,C):n(U).fill(I):n(U)}e.alloc=function(U,I,C){return v(U,I,C)};function b(U){return l(U),n(U<0?0:D(U)|0)}e.allocUnsafe=function(U){return b(U)},e.allocUnsafeSlow=function(U){return b(U)};function m(U,I){if((typeof I!="string"||I==="")&&(I="utf8"),!e.isEncoding(I))throw new TypeError("Unknown encoding: "+I);const C=$(U,I)|0;let X=n(C);const se=X.write(U,I);return se!==C&&(X=X.slice(0,se)),X}function q(U){const I=U.length<0?0:D(U.length)|0,C=n(I);for(let X=0;X<I;X+=1)C[X]=U[X]&255;return C}function E(U){if(ce(U,r)){const I=new r(U);return S(I.buffer,I.byteOffset,I.byteLength)}return q(U)}function S(U,I,C){if(I<0||U.byteLength<I)throw new RangeError('"offset" is outside of buffer bounds');if(U.byteLength<I+(C||0))throw new RangeError('"length" is outside of buffer bounds');let X;return I===void 0&&C===void 0?X=new r(U):C===void 0?X=new r(U,I):X=new r(U,I,C),Object.setPrototypeOf(X,e.prototype),X}function O(U){if(e.isBuffer(U)){const I=D(U.length)|0,C=n(I);return C.length===0||U.copy(C,0,0,I),C}if(U.length!==void 0)return typeof U.length!="number"||ge(U.length)?n(0):q(U);if(U.type==="Buffer"&&Array.isArray(U.data))return q(U.data)}function D(U){if(U>=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return U|0}function j(U){return+U!=U&&(U=0),e.alloc(+U)}e.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==e.prototype},e.compare=function(I,C){if(ce(I,r)&&(I=e.from(I,I.offset,I.byteLength)),ce(C,r)&&(C=e.from(C,C.offset,C.byteLength)),!e.isBuffer(I)||!e.isBuffer(C))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===C)return 0;let X=I.length,se=C.length;for(let le=0,ve=Math.min(X,se);le<ve;++le)if(I[le]!==C[le]){X=I[le],se=C[le];break}return X<se?-1:se<X?1:0},e.isEncoding=function(I){switch(String(I).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}},e.concat=function(I,C){if(!Array.isArray(I))throw new TypeError('"list" argument must be an Array of Buffers');if(I.length===0)return e.alloc(0);let X;if(C===void 0)for(C=0,X=0;X<I.length;++X)C+=I[X].length;const se=e.allocUnsafe(C);let le=0;for(X=0;X<I.length;++X){let ve=I[X];if(ce(ve,r))le+ve.length>se.length?(e.isBuffer(ve)||(ve=e.from(ve)),ve.copy(se,le)):r.prototype.set.call(se,ve,le);else if(e.isBuffer(ve))ve.copy(se,le);else throw new TypeError('"list" argument must be an Array of Buffers');le+=ve.length}return se};function $(U,I){if(e.isBuffer(U))return U.length;if(h.isView(U)||ce(U,h))return U.byteLength;if(typeof U!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof U);const C=U.length,X=arguments.length>2&&arguments[2]===!0;if(!X&&C===0)return 0;let se=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return C;case"utf8":case"utf-8":return Fe(U).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C*2;case"hex":return C>>>1;case"base64":return Te(U).length;default:if(se)return X?-1:Fe(U).length;I=(""+I).toLowerCase(),se=!0}}e.byteLength=$;function J(U,I,C){let X=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((C===void 0||C>this.length)&&(C=this.length),C<=0)||(C>>>=0,I>>>=0,C<=I))return"";for(U||(U="utf8");;)switch(U){case"hex":return x(this,I,C);case"utf8":case"utf-8":return B(this,I,C);case"ascii":return w(this,I,C);case"latin1":case"binary":return M(this,I,C);case"base64":return R(this,I,C);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,I,C);default:if(X)throw new TypeError("Unknown encoding: "+U);U=(U+"").toLowerCase(),X=!0}}e.prototype._isBuffer=!0;function ie(U,I,C){const X=U[I];U[I]=U[C],U[C]=X}e.prototype.swap16=function(){const I=this.length;if(I%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let C=0;C<I;C+=2)ie(this,C,C+1);return this},e.prototype.swap32=function(){const I=this.length;if(I%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let C=0;C<I;C+=4)ie(this,C,C+3),ie(this,C+1,C+2);return this},e.prototype.swap64=function(){const I=this.length;if(I%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let C=0;C<I;C+=8)ie(this,C,C+7),ie(this,C+1,C+6),ie(this,C+2,C+5),ie(this,C+3,C+4);return this},e.prototype.toString=function(){const I=this.length;return I===0?"":arguments.length===0?B(this,0,I):J.apply(this,arguments)},e.prototype.toLocaleString=e.prototype.toString,e.prototype.equals=function(I){if(!e.isBuffer(I))throw new TypeError("Argument must be a Buffer");return this===I?!0:e.compare(this,I)===0},e.prototype.inspect=function(){let I="";const C=c.INSPECT_MAX_BYTES;return I=this.toString("hex",0,C).replace(/(.{2})/g,"$1 ").trim(),this.length>C&&(I+=" ... "),"<Buffer "+I+">"},o&&(e.prototype[o]=e.prototype.inspect),e.prototype.compare=function(I,C,X,se,le){if(ce(I,r)&&(I=e.from(I,I.offset,I.byteLength)),!e.isBuffer(I))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(C===void 0&&(C=0),X===void 0&&(X=I?I.length:0),se===void 0&&(se=0),le===void 0&&(le=this.length),C<0||X>I.length||se<0||le>this.length)throw new RangeError("out of range index");if(se>=le&&C>=X)return 0;if(se>=le)return-1;if(C>=X)return 1;if(C>>>=0,X>>>=0,se>>>=0,le>>>=0,this===I)return 0;let ve=le-se,Ce=X-C;const Le=Math.min(ve,Ce),Ie=this.slice(se,le),$e=I.slice(C,X);for(let je=0;je<Le;++je)if(Ie[je]!==$e[je]){ve=Ie[je],Ce=$e[je];break}return ve<Ce?-1:Ce<ve?1:0};function ne(U,I,C,X,se){if(U.length===0)return-1;if(typeof C=="string"?(X=C,C=0):C>2147483647?C=2147483647:C<-2147483648&&(C=-2147483648),C=+C,ge(C)&&(C=se?0:U.length-1),C<0&&(C=U.length+C),C>=U.length){if(se)return-1;C=U.length-1}else if(C<0)if(se)C=0;else return-1;if(typeof I=="string"&&(I=e.from(I,X)),e.isBuffer(I))return I.length===0?-1:de(U,I,C,X,se);if(typeof I=="number")return I=I&255,typeof r.prototype.indexOf=="function"?se?r.prototype.indexOf.call(U,I,C):r.prototype.lastIndexOf.call(U,I,C):de(U,[I],C,X,se);throw new TypeError("val must be string, number or Buffer")}function de(U,I,C,X,se){let le=1,ve=U.length,Ce=I.length;if(X!==void 0&&(X=String(X).toLowerCase(),X==="ucs2"||X==="ucs-2"||X==="utf16le"||X==="utf-16le")){if(U.length<2||I.length<2)return-1;le=2,ve/=2,Ce/=2,C/=2}function Le($e,je){return le===1?$e[je]:$e.readUInt16BE(je*le)}let Ie;if(se){let $e=-1;for(Ie=C;Ie<ve;Ie++)if(Le(U,Ie)===Le(I,$e===-1?0:Ie-$e)){if($e===-1&&($e=Ie),Ie-$e+1===Ce)return $e*le}else $e!==-1&&(Ie-=Ie-$e),$e=-1}else for(C+Ce>ve&&(C=ve-Ce),Ie=C;Ie>=0;Ie--){let $e=!0;for(let je=0;je<Ce;je++)if(Le(U,Ie+je)!==Le(I,je)){$e=!1;break}if($e)return Ie}return-1}e.prototype.includes=function(I,C,X){return this.indexOf(I,C,X)!==-1},e.prototype.indexOf=function(I,C,X){return ne(this,I,C,X,!0)},e.prototype.lastIndexOf=function(I,C,X){return ne(this,I,C,X,!1)};function Z(U,I,C,X){C=Number(C)||0;const se=U.length-C;X?(X=Number(X),X>se&&(X=se)):X=se;const le=I.length;X>le/2&&(X=le/2);let ve;for(ve=0;ve<X;++ve){const Ce=parseInt(I.substr(ve*2,2),16);if(ge(Ce))return ve;U[C+ve]=Ce}return ve}function y(U,I,C,X){return oe(Fe(I,U.length-C),U,C,X)}function g(U,I,C,X){return oe(Be(I),U,C,X)}function p(U,I,C,X){return oe(Te(I),U,C,X)}function _(U,I,C,X){return oe(Me(I,U.length-C),U,C,X)}e.prototype.write=function(I,C,X,se){if(C===void 0)se="utf8",X=this.length,C=0;else if(X===void 0&&typeof C=="string")se=C,X=this.length,C=0;else if(isFinite(C))C=C>>>0,isFinite(X)?(X=X>>>0,se===void 0&&(se="utf8")):(se=X,X=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const le=this.length-C;if((X===void 0||X>le)&&(X=le),I.length>0&&(X<0||C<0)||C>this.length)throw new RangeError("Attempt to write outside buffer bounds");se||(se="utf8");let ve=!1;for(;;)switch(se){case"hex":return Z(this,I,C,X);case"utf8":case"utf-8":return y(this,I,C,X);case"ascii":case"latin1":case"binary":return g(this,I,C,X);case"base64":return p(this,I,C,X);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,I,C,X);default:if(ve)throw new TypeError("Unknown encoding: "+se);se=(""+se).toLowerCase(),ve=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(U,I,C){return I===0&&C===U.length?t.fromByteArray(U):t.fromByteArray(U.slice(I,C))}function B(U,I,C){C=Math.min(U.length,C);const X=[];let se=I;for(;se<C;){const le=U[se];let ve=null,Ce=le>239?4:le>223?3:le>191?2:1;if(se+Ce<=C){let Le,Ie,$e,je;switch(Ce){case 1:le<128&&(ve=le);break;case 2:Le=U[se+1],(Le&192)===128&&(je=(le&31)<<6|Le&63,je>127&&(ve=je));break;case 3:Le=U[se+1],Ie=U[se+2],(Le&192)===128&&(Ie&192)===128&&(je=(le&15)<<12|(Le&63)<<6|Ie&63,je>2047&&(je<55296||je>57343)&&(ve=je));break;case 4:Le=U[se+1],Ie=U[se+2],$e=U[se+3],(Le&192)===128&&(Ie&192)===128&&($e&192)===128&&(je=(le&15)<<18|(Le&63)<<12|(Ie&63)<<6|$e&63,je>65535&&je<1114112&&(ve=je))}}ve===null?(ve=65533,Ce=1):ve>65535&&(ve-=65536,X.push(ve>>>10&1023|55296),ve=56320|ve&1023),X.push(ve),se+=Ce}return A(X)}const P=4096;function A(U){const I=U.length;if(I<=P)return String.fromCharCode.apply(String,U);let C="",X=0;for(;X<I;)C+=String.fromCharCode.apply(String,U.slice(X,X+=P));return C}function w(U,I,C){let X="";C=Math.min(U.length,C);for(let se=I;se<C;++se)X+=String.fromCharCode(U[se]&127);return X}function M(U,I,C){let X="";C=Math.min(U.length,C);for(let se=I;se<C;++se)X+=String.fromCharCode(U[se]);return X}function x(U,I,C){const X=U.length;(!I||I<0)&&(I=0),(!C||C<0||C>X)&&(C=X);let se="";for(let le=I;le<C;++le)se+=we[U[le]];return se}function L(U,I,C){const X=U.slice(I,C);let se="";for(let le=0;le<X.length-1;le+=2)se+=String.fromCharCode(X[le]+X[le+1]*256);return se}e.prototype.slice=function(I,C){const X=this.length;I=~~I,C=C===void 0?X:~~C,I<0?(I+=X,I<0&&(I=0)):I>X&&(I=X),C<0?(C+=X,C<0&&(C=0)):C>X&&(C=X),C<I&&(C=I);const se=this.subarray(I,C);return Object.setPrototypeOf(se,e.prototype),se};function K(U,I,C){if(U%1!==0||U<0)throw new RangeError("offset is not uint");if(U+I>C)throw new RangeError("Trying to access beyond buffer length")}e.prototype.readUintLE=e.prototype.readUIntLE=function(I,C,X){I=I>>>0,C=C>>>0,X||K(I,C,this.length);let se=this[I],le=1,ve=0;for(;++ve<C&&(le*=256);)se+=this[I+ve]*le;return se},e.prototype.readUintBE=e.prototype.readUIntBE=function(I,C,X){I=I>>>0,C=C>>>0,X||K(I,C,this.length);let se=this[I+--C],le=1;for(;C>0&&(le*=256);)se+=this[I+--C]*le;return se},e.prototype.readUint8=e.prototype.readUInt8=function(I,C){return I=I>>>0,C||K(I,1,this.length),this[I]},e.prototype.readUint16LE=e.prototype.readUInt16LE=function(I,C){return I=I>>>0,C||K(I,2,this.length),this[I]|this[I+1]<<8},e.prototype.readUint16BE=e.prototype.readUInt16BE=function(I,C){return I=I>>>0,C||K(I,2,this.length),this[I]<<8|this[I+1]},e.prototype.readUint32LE=e.prototype.readUInt32LE=function(I,C){return I=I>>>0,C||K(I,4,this.length),(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216},e.prototype.readUint32BE=e.prototype.readUInt32BE=function(I,C){return I=I>>>0,C||K(I,4,this.length),this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])},e.prototype.readBigUInt64LE=Se(function(I){I=I>>>0,_e(I,"offset");const C=this[I],X=this[I+7];(C===void 0||X===void 0)&&qe(I,this.length-8);const se=C+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24,le=this[++I]+this[++I]*2**8+this[++I]*2**16+X*2**24;return BigInt(se)+(BigInt(le)<<BigInt(32))}),e.prototype.readBigUInt64BE=Se(function(I){I=I>>>0,_e(I,"offset");const C=this[I],X=this[I+7];(C===void 0||X===void 0)&&qe(I,this.length-8);const se=C*2**24+this[++I]*2**16+this[++I]*2**8+this[++I],le=this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+X;return(BigInt(se)<<BigInt(32))+BigInt(le)}),e.prototype.readIntLE=function(I,C,X){I=I>>>0,C=C>>>0,X||K(I,C,this.length);let se=this[I],le=1,ve=0;for(;++ve<C&&(le*=256);)se+=this[I+ve]*le;return le*=128,se>=le&&(se-=Math.pow(2,8*C)),se},e.prototype.readIntBE=function(I,C,X){I=I>>>0,C=C>>>0,X||K(I,C,this.length);let se=C,le=1,ve=this[I+--se];for(;se>0&&(le*=256);)ve+=this[I+--se]*le;return le*=128,ve>=le&&(ve-=Math.pow(2,8*C)),ve},e.prototype.readInt8=function(I,C){return I=I>>>0,C||K(I,1,this.length),this[I]&128?(255-this[I]+1)*-1:this[I]},e.prototype.readInt16LE=function(I,C){I=I>>>0,C||K(I,2,this.length);const X=this[I]|this[I+1]<<8;return X&32768?X|4294901760:X},e.prototype.readInt16BE=function(I,C){I=I>>>0,C||K(I,2,this.length);const X=this[I+1]|this[I]<<8;return X&32768?X|4294901760:X},e.prototype.readInt32LE=function(I,C){return I=I>>>0,C||K(I,4,this.length),this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24},e.prototype.readInt32BE=function(I,C){return I=I>>>0,C||K(I,4,this.length),this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]},e.prototype.readBigInt64LE=Se(function(I){I=I>>>0,_e(I,"offset");const C=this[I],X=this[I+7];(C===void 0||X===void 0)&&qe(I,this.length-8);const se=this[I+4]+this[I+5]*2**8+this[I+6]*2**16+(X<<24);return(BigInt(se)<<BigInt(32))+BigInt(C+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24)}),e.prototype.readBigInt64BE=Se(function(I){I=I>>>0,_e(I,"offset");const C=this[I],X=this[I+7];(C===void 0||X===void 0)&&qe(I,this.length-8);const se=(C<<24)+this[++I]*2**16+this[++I]*2**8+this[++I];return(BigInt(se)<<BigInt(32))+BigInt(this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+X)}),e.prototype.readFloatLE=function(I,C){return I=I>>>0,C||K(I,4,this.length),u.read(this,I,!0,23,4)},e.prototype.readFloatBE=function(I,C){return I=I>>>0,C||K(I,4,this.length),u.read(this,I,!1,23,4)},e.prototype.readDoubleLE=function(I,C){return I=I>>>0,C||K(I,8,this.length),u.read(this,I,!0,52,8)},e.prototype.readDoubleBE=function(I,C){return I=I>>>0,C||K(I,8,this.length),u.read(this,I,!1,52,8)};function Q(U,I,C,X,se,le){if(!e.isBuffer(U))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>se||I<le)throw new RangeError('"value" argument is out of bounds');if(C+X>U.length)throw new RangeError("Index out of range")}e.prototype.writeUintLE=e.prototype.writeUIntLE=function(I,C,X,se){if(I=+I,C=C>>>0,X=X>>>0,!se){const Ce=Math.pow(2,8*X)-1;Q(this,I,C,X,Ce,0)}let le=1,ve=0;for(this[C]=I&255;++ve<X&&(le*=256);)this[C+ve]=I/le&255;return C+X},e.prototype.writeUintBE=e.prototype.writeUIntBE=function(I,C,X,se){if(I=+I,C=C>>>0,X=X>>>0,!se){const Ce=Math.pow(2,8*X)-1;Q(this,I,C,X,Ce,0)}let le=X-1,ve=1;for(this[C+le]=I&255;--le>=0&&(ve*=256);)this[C+le]=I/ve&255;return C+X},e.prototype.writeUint8=e.prototype.writeUInt8=function(I,C,X){return I=+I,C=C>>>0,X||Q(this,I,C,1,255,0),this[C]=I&255,C+1},e.prototype.writeUint16LE=e.prototype.writeUInt16LE=function(I,C,X){return I=+I,C=C>>>0,X||Q(this,I,C,2,65535,0),this[C]=I&255,this[C+1]=I>>>8,C+2},e.prototype.writeUint16BE=e.prototype.writeUInt16BE=function(I,C,X){return I=+I,C=C>>>0,X||Q(this,I,C,2,65535,0),this[C]=I>>>8,this[C+1]=I&255,C+2},e.prototype.writeUint32LE=e.prototype.writeUInt32LE=function(I,C,X){return I=+I,C=C>>>0,X||Q(this,I,C,4,4294967295,0),this[C+3]=I>>>24,this[C+2]=I>>>16,this[C+1]=I>>>8,this[C]=I&255,C+4},e.prototype.writeUint32BE=e.prototype.writeUInt32BE=function(I,C,X){return I=+I,C=C>>>0,X||Q(this,I,C,4,4294967295,0),this[C]=I>>>24,this[C+1]=I>>>16,this[C+2]=I>>>8,this[C+3]=I&255,C+4};function H(U,I,C,X,se){xe(I,X,se,U,C,7);let le=Number(I&BigInt(4294967295));U[C++]=le,le=le>>8,U[C++]=le,le=le>>8,U[C++]=le,le=le>>8,U[C++]=le;let ve=Number(I>>BigInt(32)&BigInt(4294967295));return U[C++]=ve,ve=ve>>8,U[C++]=ve,ve=ve>>8,U[C++]=ve,ve=ve>>8,U[C++]=ve,C}function N(U,I,C,X,se){xe(I,X,se,U,C,7);let le=Number(I&BigInt(4294967295));U[C+7]=le,le=le>>8,U[C+6]=le,le=le>>8,U[C+5]=le,le=le>>8,U[C+4]=le;let ve=Number(I>>BigInt(32)&BigInt(4294967295));return U[C+3]=ve,ve=ve>>8,U[C+2]=ve,ve=ve>>8,U[C+1]=ve,ve=ve>>8,U[C]=ve,C+8}e.prototype.writeBigUInt64LE=Se(function(I,C=0){return H(this,I,C,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeBigUInt64BE=Se(function(I,C=0){return N(this,I,C,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeIntLE=function(I,C,X,se){if(I=+I,C=C>>>0,!se){const Le=Math.pow(2,8*X-1);Q(this,I,C,X,Le-1,-Le)}let le=0,ve=1,Ce=0;for(this[C]=I&255;++le<X&&(ve*=256);)I<0&&Ce===0&&this[C+le-1]!==0&&(Ce=1),this[C+le]=(I/ve>>0)-Ce&255;return C+X},e.prototype.writeIntBE=function(I,C,X,se){if(I=+I,C=C>>>0,!se){const Le=Math.pow(2,8*X-1);Q(this,I,C,X,Le-1,-Le)}let le=X-1,ve=1,Ce=0;for(this[C+le]=I&255;--le>=0&&(ve*=256);)I<0&&Ce===0&&this[C+le+1]!==0&&(Ce=1),this[C+le]=(I/ve>>0)-Ce&255;return C+X},e.prototype.writeInt8=function(I,C,X){return I=+I,C=C>>>0,X||Q(this,I,C,1,127,-128),I<0&&(I=255+I+1),this[C]=I&255,C+1},e.prototype.writeInt16LE=function(I,C,X){return I=+I,C=C>>>0,X||Q(this,I,C,2,32767,-32768),this[C]=I&255,this[C+1]=I>>>8,C+2},e.prototype.writeInt16BE=function(I,C,X){return I=+I,C=C>>>0,X||Q(this,I,C,2,32767,-32768),this[C]=I>>>8,this[C+1]=I&255,C+2},e.prototype.writeInt32LE=function(I,C,X){return I=+I,C=C>>>0,X||Q(this,I,C,4,2147483647,-2147483648),this[C]=I&255,this[C+1]=I>>>8,this[C+2]=I>>>16,this[C+3]=I>>>24,C+4},e.prototype.writeInt32BE=function(I,C,X){return I=+I,C=C>>>0,X||Q(this,I,C,4,2147483647,-2147483648),I<0&&(I=4294967295+I+1),this[C]=I>>>24,this[C+1]=I>>>16,this[C+2]=I>>>8,this[C+3]=I&255,C+4},e.prototype.writeBigInt64LE=Se(function(I,C=0){return H(this,I,C,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),e.prototype.writeBigInt64BE=Se(function(I,C=0){return N(this,I,C,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function F(U,I,C,X,se,le){if(C+X>U.length)throw new RangeError("Index out of range");if(C<0)throw new RangeError("Index out of range")}function ee(U,I,C,X,se){return I=+I,C=C>>>0,se||F(U,I,C,4),u.write(U,I,C,X,23,4),C+4}e.prototype.writeFloatLE=function(I,C,X){return ee(this,I,C,!0,X)},e.prototype.writeFloatBE=function(I,C,X){return ee(this,I,C,!1,X)};function ae(U,I,C,X,se){return I=+I,C=C>>>0,se||F(U,I,C,8),u.write(U,I,C,X,52,8),C+8}e.prototype.writeDoubleLE=function(I,C,X){return ae(this,I,C,!0,X)},e.prototype.writeDoubleBE=function(I,C,X){return ae(this,I,C,!1,X)},e.prototype.copy=function(I,C,X,se){if(!e.isBuffer(I))throw new TypeError("argument should be a Buffer");if(X||(X=0),!se&&se!==0&&(se=this.length),C>=I.length&&(C=I.length),C||(C=0),se>0&&se<X&&(se=X),se===X||I.length===0||this.length===0)return 0;if(C<0)throw new RangeError("targetStart out of bounds");if(X<0||X>=this.length)throw new RangeError("Index out of range");if(se<0)throw new RangeError("sourceEnd out of bounds");se>this.length&&(se=this.length),I.length-C<se-X&&(se=I.length-C+X);const le=se-X;return this===I&&typeof r.prototype.copyWithin=="function"?this.copyWithin(C,X,se):r.prototype.set.call(I,this.subarray(X,se),C),le},e.prototype.fill=function(I,C,X,se){if(typeof I=="string"){if(typeof C=="string"?(se=C,C=0,X=this.length):typeof X=="string"&&(se=X,X=this.length),se!==void 0&&typeof se!="string")throw new TypeError("encoding must be a string");if(typeof se=="string"&&!e.isEncoding(se))throw new TypeError("Unknown encoding: "+se);if(I.length===1){const ve=I.charCodeAt(0);(se==="utf8"&&ve<128||se==="latin1")&&(I=ve)}}else typeof I=="number"?I=I&255:typeof I=="boolean"&&(I=Number(I));if(C<0||this.length<C||this.length<X)throw new RangeError("Out of range index");if(X<=C)return this;C=C>>>0,X=X===void 0?this.length:X>>>0,I||(I=0);let le;if(typeof I=="number")for(le=C;le<X;++le)this[le]=I;else{const ve=e.isBuffer(I)?I:e.from(I,se),Ce=ve.length;if(Ce===0)throw new TypeError('The value "'+I+'" is invalid for argument "value"');for(le=0;le<X-C;++le)this[le+C]=ve[le%Ce]}return this};const z={};function G(U,I,C){z[U]=class extends C{constructor(){super(),Object.defineProperty(this,"message",{value:I.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${U}]`,this.stack,delete this.name}get code(){return U}set code(se){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:se,writable:!0})}toString(){return`${this.name} [${U}]: ${this.message}`}}}G("ERR_BUFFER_OUT_OF_BOUNDS",function(U){return U?`${U} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),G("ERR_INVALID_ARG_TYPE",function(U,I){return`The "${U}" argument must be of type number. Received type ${typeof I}`},TypeError),G("ERR_OUT_OF_RANGE",function(U,I,C){let X=`The value of "${U}" is out of range.`,se=C;return Number.isInteger(C)&&Math.abs(C)>2**32?se=fe(String(C)):typeof C=="bigint"&&(se=String(C),(C>BigInt(2)**BigInt(32)||C<-(BigInt(2)**BigInt(32)))&&(se=fe(se)),se+="n"),X+=` It must be ${I}. Received ${se}`,X},RangeError);function fe(U){let I="",C=U.length;const X=U[0]==="-"?1:0;for(;C>=X+4;C-=3)I=`_${U.slice(C-3,C)}${I}`;return`${U.slice(0,C)}${I}`}function me(U,I,C){_e(I,"offset"),(U[I]===void 0||U[I+C]===void 0)&&qe(I,U.length-(C+1))}function xe(U,I,C,X,se,le){if(U>C||U<I){const ve=typeof I=="bigint"?"n":"";let Ce;throw I===0||I===BigInt(0)?Ce=`>= 0${ve} and < 2${ve} ** ${(le+1)*8}${ve}`:Ce=`>= -(2${ve} ** ${(le+1)*8-1}${ve}) and < 2 ** ${(le+1)*8-1}${ve}`,new z.ERR_OUT_OF_RANGE("value",Ce,U)}me(X,se,le)}function _e(U,I){if(typeof U!="number")throw new z.ERR_INVALID_ARG_TYPE(I,"number",U)}function qe(U,I,C){throw Math.floor(U)!==U?(_e(U,C),new z.ERR_OUT_OF_RANGE("offset","an integer",U)):I<0?new z.ERR_BUFFER_OUT_OF_BOUNDS:new z.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${I}`,U)}const Re=/[^+/0-9A-Za-z-_]/g;function be(U){if(U=U.split("=")[0],U=U.trim().replace(Re,""),U.length<2)return"";for(;U.length%4!==0;)U=U+"=";return U}function Fe(U,I){I=I||1/0;let C;const X=U.length;let se=null;const le=[];for(let ve=0;ve<X;++ve){if(C=U.charCodeAt(ve),C>55295&&C<57344){if(!se){if(C>56319){(I-=3)>-1&&le.push(239,191,189);continue}else if(ve+1===X){(I-=3)>-1&&le.push(239,191,189);continue}se=C;continue}if(C<56320){(I-=3)>-1&&le.push(239,191,189),se=C;continue}C=(se-55296<<10|C-56320)+65536}else se&&(I-=3)>-1&&le.push(239,191,189);if(se=null,C<128){if((I-=1)<0)break;le.push(C)}else if(C<2048){if((I-=2)<0)break;le.push(C>>6|192,C&63|128)}else if(C<65536){if((I-=3)<0)break;le.push(C>>12|224,C>>6&63|128,C&63|128)}else if(C<1114112){if((I-=4)<0)break;le.push(C>>18|240,C>>12&63|128,C>>6&63|128,C&63|128)}else throw new Error("Invalid code point")}return le}function Be(U){const I=[];for(let C=0;C<U.length;++C)I.push(U.charCodeAt(C)&255);return I}function Me(U,I){let C,X,se;const le=[];for(let ve=0;ve<U.length&&!((I-=2)<0);++ve)C=U.charCodeAt(ve),X=C>>8,se=C%256,le.push(se),le.push(X);return le}function Te(U){return t.toByteArray(be(U))}function oe(U,I,C,X){let se;for(se=0;se<X&&!(se+C>=I.length||se>=U.length);++se)I[se+C]=U[se];return se}function ce(U,I){return U instanceof I||U!=null&&U.constructor!=null&&U.constructor.name!=null&&U.constructor.name===I.name}function ge(U){return U!==U}const we=(function(){const U="0123456789abcdef",I=new Array(256);for(let C=0;C<16;++C){const X=C*16;for(let se=0;se<16;++se)I[X+se]=U[C]+U[se]}return I})();function Se(U){return typeof BigInt>"u"?Oe:U}function Oe(){throw new Error("BigInt not supported")}})(buffer$1);const Buffer=buffer$1.Buffer,RSA_PKCS1_PADDING=1,RSA_NO_PADDING=3,RSA_PKCS1_OAEP_PADDING=4,require$$0$1={RSA_PKCS1_PADDING,RSA_NO_PADDING,RSA_PKCS1_OAEP_PADDING};var rsa={};function getDefaultExportFromCjs(c){return c&&c.__esModule&&Object.prototype.hasOwnProperty.call(c,"default")?c.default:c}var browser$c={exports:{}},process=browser$c.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(c){if(cachedSetTimeout===setTimeout)return setTimeout(c,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(c,0);try{return cachedSetTimeout(c,0)}catch{try{return cachedSetTimeout.call(null,c,0)}catch{return cachedSetTimeout.call(this,c,0)}}}function runClearTimeout(c){if(cachedClearTimeout===clearTimeout)return clearTimeout(c);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(c);try{return cachedClearTimeout(c)}catch{try{return cachedClearTimeout.call(null,c)}catch{return cachedClearTimeout.call(this,c)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var c=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(c)}}process.nextTick=function(c){var t=new Array(arguments.length-1);if(arguments.length>1)for(var u=1;u<arguments.length;u++)t[u-1]=arguments[u];queue.push(new Item(c,t)),queue.length===1&&!draining&&runTimeout(drainQueue)};function Item(c,t){this.fun=c,this.array=t}Item.prototype.run=function(){this.fun.apply(null,this.array)};process.title="browser";process.browser=!0;process.env={};process.argv=[];process.version="";process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.prependListener=noop;process.prependOnceListener=noop;process.listeners=function(c){return[]};process.binding=function(c){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(c){throw new Error("process.chdir is not supported")};process.umask=function(){return 0};var browserExports=browser$c.exports;const process$1=getDefaultExportFromCjs(browserExports);var utils$4={},cryptoBrowserify={},browser$b={exports:{}},safeBuffer$1={exports:{}},dist={},hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,(function(c){Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},u={};u.byteLength=e,u.toByteArray=l,u.fromByteArray=m;for(var o=[],d=[],r=typeof Uint8Array<"u"?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",f=0,a=h.length;f<a;++f)o[f]=h[f],d[h.charCodeAt(f)]=f;d[45]=62,d[95]=63;function n(S){var O=S.length;if(O%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var D=S.indexOf("=");D===-1&&(D=O);var j=D===O?0:4-D%4;return[D,j]}function e(S){var O=n(S),D=O[0],j=O[1];return(D+j)*3/4-j}function s(S,O,D){return(O+D)*3/4-D}function l(S){var O,D=n(S),j=D[0],$=D[1],J=new r(s(S,j,$)),ie=0,ne=$>0?j-4:j,de;for(de=0;de<ne;de+=4)O=d[S.charCodeAt(de)]<<18|d[S.charCodeAt(de+1)]<<12|d[S.charCodeAt(de+2)]<<6|d[S.charCodeAt(de+3)],J[ie++]=O>>16&255,J[ie++]=O>>8&255,J[ie++]=O&255;return $===2&&(O=d[S.charCodeAt(de)]<<2|d[S.charCodeAt(de+1)]>>4,J[ie++]=O&255),$===1&&(O=d[S.charCodeAt(de)]<<10|d[S.charCodeAt(de+1)]<<4|d[S.charCodeAt(de+2)]>>2,J[ie++]=O>>8&255,J[ie++]=O&255),J}function v(S){return o[S>>18&63]+o[S>>12&63]+o[S>>6&63]+o[S&63]}function b(S,O,D){for(var j,$=[],J=O;J<D;J+=3)j=(S[J]<<16&16711680)+(S[J+1]<<8&65280)+(S[J+2]&255),$.push(v(j));return $.join("")}function m(S){for(var O,D=S.length,j=D%3,$=[],J=16383,ie=0,ne=D-j;ie<ne;ie+=J)$.push(b(S,ie,ie+J>ne?ne:ie+J));return j===1?(O=S[D-1],$.push(o[O>>2]+o[O<<4&63]+"==")):j===2&&(O=(S[D-2]<<8)+S[D-1],$.push(o[O>>10]+o[O>>4&63]+o[O<<2&63]+"=")),$.join("")}var q={};q.read=function(S,O,D,j,$){var J,ie,ne=$*8-j-1,de=(1<<ne)-1,Z=de>>1,y=-7,g=D?$-1:0,p=D?-1:1,_=S[O+g];for(g+=p,J=_&(1<<-y)-1,_>>=-y,y+=ne;y>0;J=J*256+S[O+g],g+=p,y-=8);for(ie=J&(1<<-y)-1,J>>=-y,y+=j;y>0;ie=ie*256+S[O+g],g+=p,y-=8);if(J===0)J=1-Z;else{if(J===de)return ie?NaN:(_?-1:1)*(1/0);ie=ie+Math.pow(2,j),J=J-Z}return(_?-1:1)*ie*Math.pow(2,J-j)},q.write=function(S,O,D,j,$,J){var ie,ne,de,Z=J*8-$-1,y=(1<<Z)-1,g=y>>1,p=$===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=j?0:J-1,R=j?1:-1,B=O<0||O===0&&1/O<0?1:0;for(O=Math.abs(O),isNaN(O)||O===1/0?(ne=isNaN(O)?1:0,ie=y):(ie=Math.floor(Math.log(O)/Math.LN2),O*(de=Math.pow(2,-ie))<1&&(ie--,de*=2),ie+g>=1?O+=p/de:O+=p*Math.pow(2,1-g),O*de>=2&&(ie++,de/=2),ie+g>=y?(ne=0,ie=y):ie+g>=1?(ne=(O*de-1)*Math.pow(2,$),ie=ie+g):(ne=O*Math.pow(2,g-1)*Math.pow(2,$),ie=0));$>=8;S[D+_]=ne&255,_+=R,ne/=256,$-=8);for(ie=ie<<$|ne,Z+=$;Z>0;S[D+_]=ie&255,_+=R,ie/=256,Z-=8);S[D+_-R]|=B*128};(function(S){const O=u,D=q,j=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;S.Buffer=y,S.SlowBuffer=L,S.INSPECT_MAX_BYTES=50;const $=2147483647;S.kMaxLength=$;const{Uint8Array:J,ArrayBuffer:ie,SharedArrayBuffer:ne}=globalThis;y.TYPED_ARRAY_SUPPORT=de(),!y.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function de(){try{const W=new J(1),T={foo:function(){return 42}};return Object.setPrototypeOf(T,J.prototype),Object.setPrototypeOf(W,T),W.foo()===42}catch{return!1}}Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.buffer}}),Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.byteOffset}});function Z(W){if(W>$)throw new RangeError('The value "'+W+'" is invalid for option "size"');const T=new J(W);return Object.setPrototypeOf(T,y.prototype),T}function y(W,T,k){if(typeof W=="number"){if(typeof T=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return R(W)}return g(W,T,k)}y.poolSize=8192;function g(W,T,k){if(typeof W=="string")return B(W,T);if(ie.isView(W))return A(W);if(W==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof W);if(Ke(W,ie)||W&&Ke(W.buffer,ie)||typeof ne<"u"&&(Ke(W,ne)||W&&Ke(W.buffer,ne)))return w(W,T,k);if(typeof W=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const re=W.valueOf&&W.valueOf();if(re!=null&&re!==W)return y.from(re,T,k);const ue=M(W);if(ue)return ue;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof W[Symbol.toPrimitive]=="function")return y.from(W[Symbol.toPrimitive]("string"),T,k);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof W)}y.from=function(W,T,k){return g(W,T,k)},Object.setPrototypeOf(y.prototype,J.prototype),Object.setPrototypeOf(y,J);function p(W){if(typeof W!="number")throw new TypeError('"size" argument must be of type number');if(W<0)throw new RangeError('The value "'+W+'" is invalid for option "size"')}function _(W,T,k){return p(W),W<=0?Z(W):T!==void 0?typeof k=="string"?Z(W).fill(T,k):Z(W).fill(T):Z(W)}y.alloc=function(W,T,k){return _(W,T,k)};function R(W){return p(W),Z(W<0?0:x(W)|0)}y.allocUnsafe=function(W){return R(W)},y.allocUnsafeSlow=function(W){return R(W)};function B(W,T){if((typeof T!="string"||T==="")&&(T="utf8"),!y.isEncoding(T))throw new TypeError("Unknown encoding: "+T);const k=K(W,T)|0;let re=Z(k);const ue=re.write(W,T);return ue!==k&&(re=re.slice(0,ue)),re}function P(W){const T=W.length<0?0:x(W.length)|0,k=Z(T);for(let re=0;re<T;re+=1)k[re]=W[re]&255;return k}function A(W){if(Ke(W,J)){const T=new J(W);return w(T.buffer,T.byteOffset,T.byteLength)}return P(W)}function w(W,T,k){if(T<0||W.byteLength<T)throw new RangeError('"offset" is outside of buffer bounds');if(W.byteLength<T+(k||0))throw new RangeError('"length" is outside of buffer bounds');let re;return T===void 0&&k===void 0?re=new J(W):k===void 0?re=new J(W,T):re=new J(W,T,k),Object.setPrototypeOf(re,y.prototype),re}function M(W){if(y.isBuffer(W)){const T=x(W.length)|0,k=Z(T);return k.length===0||W.copy(k,0,0,T),k}if(W.length!==void 0)return typeof W.length!="number"||Ze(W.length)?Z(0):P(W);if(W.type==="Buffer"&&Array.isArray(W.data))return P(W.data)}function x(W){if(W>=$)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+$.toString(16)+" bytes");return W|0}function L(W){return+W!=W&&(W=0),y.alloc(+W)}y.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==y.prototype},y.compare=function(T,k){if(Ke(T,J)&&(T=y.from(T,T.offset,T.byteLength)),Ke(k,J)&&(k=y.from(k,k.offset,k.byteLength)),!y.isBuffer(T)||!y.isBuffer(k))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===k)return 0;let re=T.length,ue=k.length;for(let pe=0,ye=Math.min(re,ue);pe<ye;++pe)if(T[pe]!==k[pe]){re=T[pe],ue=k[pe];break}return re<ue?-1:ue<re?1:0},y.isEncoding=function(T){switch(String(T).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},y.concat=function(T,k){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return y.alloc(0);let re;if(k===void 0)for(k=0,re=0;re<T.length;++re)k+=T[re].length;const ue=y.allocUnsafe(k);let pe=0;for(re=0;re<T.length;++re){let ye=T[re];if(Ke(ye,J))pe+ye.length>ue.length?(y.isBuffer(ye)||(ye=y.from(ye)),ye.copy(ue,pe)):J.prototype.set.call(ue,ye,pe);else if(y.isBuffer(ye))ye.copy(ue,pe);else throw new TypeError('"list" argument must be an Array of Buffers');pe+=ye.length}return ue};function K(W,T){if(y.isBuffer(W))return W.length;if(ie.isView(W)||Ke(W,ie))return W.byteLength;if(typeof W!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof W);const k=W.length,re=arguments.length>2&&arguments[2]===!0;if(!re&&k===0)return 0;let ue=!1;for(;;)switch(T){case"ascii":case"latin1":case"binary":return k;case"utf8":case"utf-8":return Le(W).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k*2;case"hex":return k>>>1;case"base64":return je(W).length;default:if(ue)return re?-1:Le(W).length;T=(""+T).toLowerCase(),ue=!0}}y.byteLength=K;function Q(W,T,k){let re=!1;if((T===void 0||T<0)&&(T=0),T>this.length||((k===void 0||k>this.length)&&(k=this.length),k<=0)||(k>>>=0,T>>>=0,k<=T))return"";for(W||(W="utf8");;)switch(W){case"hex":return Fe(this,T,k);case"utf8":case"utf-8":return xe(this,T,k);case"ascii":return Re(this,T,k);case"latin1":case"binary":return be(this,T,k);case"base64":return me(this,T,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Be(this,T,k);default:if(re)throw new TypeError("Unknown encoding: "+W);W=(W+"").toLowerCase(),re=!0}}y.prototype._isBuffer=!0;function H(W,T,k){const re=W[T];W[T]=W[k],W[k]=re}y.prototype.swap16=function(){const T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let k=0;k<T;k+=2)H(this,k,k+1);return this},y.prototype.swap32=function(){const T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let k=0;k<T;k+=4)H(this,k,k+3),H(this,k+1,k+2);return this},y.prototype.swap64=function(){const T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let k=0;k<T;k+=8)H(this,k,k+7),H(this,k+1,k+6),H(this,k+2,k+5),H(this,k+3,k+4);return this},y.prototype.toString=function(){const T=this.length;return T===0?"":arguments.length===0?xe(this,0,T):Q.apply(this,arguments)},y.prototype.toLocaleString=y.prototype.toString,y.prototype.equals=function(T){if(!y.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:y.compare(this,T)===0},y.prototype.inspect=function(){let T="";const k=S.INSPECT_MAX_BYTES;return T=this.toString("hex",0,k).replace(/(.{2})/g,"$1 ").trim(),this.length>k&&(T+=" ... "),"<Buffer "+T+">"},j&&(y.prototype[j]=y.prototype.inspect),y.prototype.compare=function(T,k,re,ue,pe){if(Ke(T,J)&&(T=y.from(T,T.offset,T.byteLength)),!y.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(k===void 0&&(k=0),re===void 0&&(re=T?T.length:0),ue===void 0&&(ue=0),pe===void 0&&(pe=this.length),k<0||re>T.length||ue<0||pe>this.length)throw new RangeError("out of range index");if(ue>=pe&&k>=re)return 0;if(ue>=pe)return-1;if(k>=re)return 1;if(k>>>=0,re>>>=0,ue>>>=0,pe>>>=0,this===T)return 0;let ye=pe-ue,ke=re-k;const Ve=Math.min(ye,ke),Ne=this.slice(ue,pe),Ge=T.slice(k,re);for(let Ue=0;Ue<Ve;++Ue)if(Ne[Ue]!==Ge[Ue]){ye=Ne[Ue],ke=Ge[Ue];break}return ye<ke?-1:ke<ye?1:0};function N(W,T,k,re,ue){if(W.length===0)return-1;if(typeof k=="string"?(re=k,k=0):k>2147483647?k=2147483647:k<-2147483648&&(k=-2147483648),k=+k,Ze(k)&&(k=ue?0:W.length-1),k<0&&(k=W.length+k),k>=W.length){if(ue)return-1;k=W.length-1}else if(k<0)if(ue)k=0;else return-1;if(typeof T=="string"&&(T=y.from(T,re)),y.isBuffer(T))return T.length===0?-1:F(W,T,k,re,ue);if(typeof T=="number")return T=T&255,typeof J.prototype.indexOf=="function"?ue?J.prototype.indexOf.call(W,T,k):J.prototype.lastIndexOf.call(W,T,k):F(W,[T],k,re,ue);throw new TypeError("val must be string, number or Buffer")}function F(W,T,k,re,ue){let pe=1,ye=W.length,ke=T.length;if(re!==void 0&&(re=String(re).toLowerCase(),re==="ucs2"||re==="ucs-2"||re==="utf16le"||re==="utf-16le")){if(W.length<2||T.length<2)return-1;pe=2,ye/=2,ke/=2,k/=2}function Ve(Ge,Ue){return pe===1?Ge[Ue]:Ge.readUInt16BE(Ue*pe)}let Ne;if(ue){let Ge=-1;for(Ne=k;Ne<ye;Ne++)if(Ve(W,Ne)===Ve(T,Ge===-1?0:Ne-Ge)){if(Ge===-1&&(Ge=Ne),Ne-Ge+1===ke)return Ge*pe}else Ge!==-1&&(Ne-=Ne-Ge),Ge=-1}else for(k+ke>ye&&(k=ye-ke),Ne=k;Ne>=0;Ne--){let Ge=!0;for(let Ue=0;Ue<ke;Ue++)if(Ve(W,Ne+Ue)!==Ve(T,Ue)){Ge=!1;break}if(Ge)return Ne}return-1}y.prototype.includes=function(T,k,re){return this.indexOf(T,k,re)!==-1},y.prototype.indexOf=function(T,k,re){return N(this,T,k,re,!0)},y.prototype.lastIndexOf=function(T,k,re){return N(this,T,k,re,!1)};function ee(W,T,k,re){k=Number(k)||0;const ue=W.length-k;re?(re=Number(re),re>ue&&(re=ue)):re=ue;const pe=T.length;re>pe/2&&(re=pe/2);let ye;for(ye=0;ye<re;++ye){const ke=parseInt(T.substr(ye*2,2),16);if(Ze(ke))return ye;W[k+ye]=ke}return ye}function ae(W,T,k,re){return He(Le(T,W.length-k),W,k,re)}function z(W,T,k,re){return He(Ie(T),W,k,re)}function G(W,T,k,re){return He(je(T),W,k,re)}function fe(W,T,k,re){return He($e(T,W.length-k),W,k,re)}y.prototype.write=function(T,k,re,ue){if(k===void 0)ue="utf8",re=this.length,k=0;else if(re===void 0&&typeof k=="string")ue=k,re=this.length,k=0;else if(isFinite(k))k=k>>>0,isFinite(re)?(re=re>>>0,ue===void 0&&(ue="utf8")):(ue=re,re=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const pe=this.length-k;if((re===void 0||re>pe)&&(re=pe),T.length>0&&(re<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");ue||(ue="utf8");let ye=!1;for(;;)switch(ue){case"hex":return ee(this,T,k,re);case"utf8":case"utf-8":return ae(this,T,k,re);case"ascii":case"latin1":case"binary":return z(this,T,k,re);case"base64":return G(this,T,k,re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fe(this,T,k,re);default:if(ye)throw new TypeError("Unknown encoding: "+ue);ue=(""+ue).toLowerCase(),ye=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function me(W,T,k){return T===0&&k===W.length?O.fromByteArray(W):O.fromByteArray(W.slice(T,k))}function xe(W,T,k){k=Math.min(W.length,k);const re=[];let ue=T;for(;ue<k;){const pe=W[ue];let ye=null,ke=pe>239?4:pe>223?3:pe>191?2:1;if(ue+ke<=k){let Ve,Ne,Ge,Ue;switch(ke){case 1:pe<128&&(ye=pe);break;case 2:Ve=W[ue+1],(Ve&192)===128&&(Ue=(pe&31)<<6|Ve&63,Ue>127&&(ye=Ue));break;case 3:Ve=W[ue+1],Ne=W[ue+2],(Ve&192)===128&&(Ne&192)===128&&(Ue=(pe&15)<<12|(Ve&63)<<6|Ne&63,Ue>2047&&(Ue<55296||Ue>57343)&&(ye=Ue));break;case 4:Ve=W[ue+1],Ne=W[ue+2],Ge=W[ue+3],(Ve&192)===128&&(Ne&192)===128&&(Ge&192)===128&&(Ue=(pe&15)<<18|(Ve&63)<<12|(Ne&63)<<6|Ge&63,Ue>65535&&Ue<1114112&&(ye=Ue))}}ye===null?(ye=65533,ke=1):ye>65535&&(ye-=65536,re.push(ye>>>10&1023|55296),ye=56320|ye&1023),re.push(ye),ue+=ke}return qe(re)}const _e=4096;function qe(W){const T=W.length;if(T<=_e)return String.fromCharCode.apply(String,W);let k="",re=0;for(;re<T;)k+=String.fromCharCode.apply(String,W.slice(re,re+=_e));return k}function Re(W,T,k){let re="";k=Math.min(W.length,k);for(let ue=T;ue<k;++ue)re+=String.fromCharCode(W[ue]&127);return re}function be(W,T,k){let re="";k=Math.min(W.length,k);for(let ue=T;ue<k;++ue)re+=String.fromCharCode(W[ue]);return re}function Fe(W,T,k){const re=W.length;(!T||T<0)&&(T=0),(!k||k<0||k>re)&&(k=re);let ue="";for(let pe=T;pe<k;++pe)ue+=We[W[pe]];return ue}function Be(W,T,k){const re=W.slice(T,k);let ue="";for(let pe=0;pe<re.length-1;pe+=2)ue+=String.fromCharCode(re[pe]+re[pe+1]*256);return ue}y.prototype.slice=function(T,k){const re=this.length;T=~~T,k=k===void 0?re:~~k,T<0?(T+=re,T<0&&(T=0)):T>re&&(T=re),k<0?(k+=re,k<0&&(k=0)):k>re&&(k=re),k<T&&(k=T);const ue=this.subarray(T,k);return Object.setPrototypeOf(ue,y.prototype),ue};function Me(W,T,k){if(W%1!==0||W<0)throw new RangeError("offset is not uint");if(W+T>k)throw new RangeError("Trying to access beyond buffer length")}y.prototype.readUintLE=y.prototype.readUIntLE=function(T,k,re){T=T>>>0,k=k>>>0,re||Me(T,k,this.length);let ue=this[T],pe=1,ye=0;for(;++ye<k&&(pe*=256);)ue+=this[T+ye]*pe;return ue},y.prototype.readUintBE=y.prototype.readUIntBE=function(T,k,re){T=T>>>0,k=k>>>0,re||Me(T,k,this.length);let ue=this[T+--k],pe=1;for(;k>0&&(pe*=256);)ue+=this[T+--k]*pe;return ue},y.prototype.readUint8=y.prototype.readUInt8=function(T,k){return T=T>>>0,k||Me(T,1,this.length),this[T]},y.prototype.readUint16LE=y.prototype.readUInt16LE=function(T,k){return T=T>>>0,k||Me(T,2,this.length),this[T]|this[T+1]<<8},y.prototype.readUint16BE=y.prototype.readUInt16BE=function(T,k){return T=T>>>0,k||Me(T,2,this.length),this[T]<<8|this[T+1]},y.prototype.readUint32LE=y.prototype.readUInt32LE=function(T,k){return T=T>>>0,k||Me(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},y.prototype.readUint32BE=y.prototype.readUInt32BE=function(T,k){return T=T>>>0,k||Me(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},y.prototype.readBigUInt64LE=Ye(function(T){T=T>>>0,se(T,"offset");const k=this[T],re=this[T+7];(k===void 0||re===void 0)&&le(T,this.length-8);const ue=k+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,pe=this[++T]+this[++T]*2**8+this[++T]*2**16+re*2**24;return BigInt(ue)+(BigInt(pe)<<BigInt(32))}),y.prototype.readBigUInt64BE=Ye(function(T){T=T>>>0,se(T,"offset");const k=this[T],re=this[T+7];(k===void 0||re===void 0)&&le(T,this.length-8);const ue=k*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],pe=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+re;return(BigInt(ue)<<BigInt(32))+BigInt(pe)}),y.prototype.readIntLE=function(T,k,re){T=T>>>0,k=k>>>0,re||Me(T,k,this.length);let ue=this[T],pe=1,ye=0;for(;++ye<k&&(pe*=256);)ue+=this[T+ye]*pe;return pe*=128,ue>=pe&&(ue-=Math.pow(2,8*k)),ue},y.prototype.readIntBE=function(T,k,re){T=T>>>0,k=k>>>0,re||Me(T,k,this.length);let ue=k,pe=1,ye=this[T+--ue];for(;ue>0&&(pe*=256);)ye+=this[T+--ue]*pe;return pe*=128,ye>=pe&&(ye-=Math.pow(2,8*k)),ye},y.prototype.readInt8=function(T,k){return T=T>>>0,k||Me(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},y.prototype.readInt16LE=function(T,k){T=T>>>0,k||Me(T,2,this.length);const re=this[T]|this[T+1]<<8;return re&32768?re|4294901760:re},y.prototype.readInt16BE=function(T,k){T=T>>>0,k||Me(T,2,this.length);const re=this[T+1]|this[T]<<8;return re&32768?re|4294901760:re},y.prototype.readInt32LE=function(T,k){return T=T>>>0,k||Me(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},y.prototype.readInt32BE=function(T,k){return T=T>>>0,k||Me(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},y.prototype.readBigInt64LE=Ye(function(T){T=T>>>0,se(T,"offset");const k=this[T],re=this[T+7];(k===void 0||re===void 0)&&le(T,this.length-8);const ue=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(re<<24);return(BigInt(ue)<<BigInt(32))+BigInt(k+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),y.prototype.readBigInt64BE=Ye(function(T){T=T>>>0,se(T,"offset");const k=this[T],re=this[T+7];(k===void 0||re===void 0)&&le(T,this.length-8);const ue=(k<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(ue)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+re)}),y.prototype.readFloatLE=function(T,k){return T=T>>>0,k||Me(T,4,this.length),D.read(this,T,!0,23,4)},y.prototype.readFloatBE=function(T,k){return T=T>>>0,k||Me(T,4,this.length),D.read(this,T,!1,23,4)},y.prototype.readDoubleLE=function(T,k){return T=T>>>0,k||Me(T,8,this.length),D.read(this,T,!0,52,8)},y.prototype.readDoubleBE=function(T,k){return T=T>>>0,k||Me(T,8,this.length),D.read(this,T,!1,52,8)};function Te(W,T,k,re,ue,pe){if(!y.isBuffer(W))throw new TypeError('"buffer" argument must be a Buffer instance');if(T>ue||T<pe)throw new RangeError('"value" argument is out of bounds');if(k+re>W.length)throw new RangeError("Index out of range")}y.prototype.writeUintLE=y.prototype.writeUIntLE=function(T,k,re,ue){if(T=+T,k=k>>>0,re=re>>>0,!ue){const ke=Math.pow(2,8*re)-1;Te(this,T,k,re,ke,0)}let pe=1,ye=0;for(this[k]=T&255;++ye<re&&(pe*=256);)this[k+ye]=T/pe&255;return k+re},y.prototype.writeUintBE=y.prototype.writeUIntBE=function(T,k,re,ue){if(T=+T,k=k>>>0,re=re>>>0,!ue){const ke=Math.pow(2,8*re)-1;Te(this,T,k,re,ke,0)}let pe=re-1,ye=1;for(this[k+pe]=T&255;--pe>=0&&(ye*=256);)this[k+pe]=T/ye&255;return k+re},y.prototype.writeUint8=y.prototype.writeUInt8=function(T,k,re){return T=+T,k=k>>>0,re||Te(this,T,k,1,255,0),this[k]=T&255,k+1},y.prototype.writeUint16LE=y.prototype.writeUInt16LE=function(T,k,re){return T=+T,k=k>>>0,re||Te(this,T,k,2,65535,0),this[k]=T&255,this[k+1]=T>>>8,k+2},y.prototype.writeUint16BE=y.prototype.writeUInt16BE=function(T,k,re){return T=+T,k=k>>>0,re||Te(this,T,k,2,65535,0),this[k]=T>>>8,this[k+1]=T&255,k+2},y.prototype.writeUint32LE=y.prototype.writeUInt32LE=function(T,k,re){return T=+T,k=k>>>0,re||Te(this,T,k,4,4294967295,0),this[k+3]=T>>>24,this[k+2]=T>>>16,this[k+1]=T>>>8,this[k]=T&255,k+4},y.prototype.writeUint32BE=y.prototype.writeUInt32BE=function(T,k,re){return T=+T,k=k>>>0,re||Te(this,T,k,4,4294967295,0),this[k]=T>>>24,this[k+1]=T>>>16,this[k+2]=T>>>8,this[k+3]=T&255,k+4};function oe(W,T,k,re,ue){X(T,re,ue,W,k,7);let pe=Number(T&BigInt(4294967295));W[k++]=pe,pe=pe>>8,W[k++]=pe,pe=pe>>8,W[k++]=pe,pe=pe>>8,W[k++]=pe;let ye=Number(T>>BigInt(32)&BigInt(4294967295));return W[k++]=ye,ye=ye>>8,W[k++]=ye,ye=ye>>8,W[k++]=ye,ye=ye>>8,W[k++]=ye,k}function ce(W,T,k,re,ue){X(T,re,ue,W,k,7);let pe=Number(T&BigInt(4294967295));W[k+7]=pe,pe=pe>>8,W[k+6]=pe,pe=pe>>8,W[k+5]=pe,pe=pe>>8,W[k+4]=pe;let ye=Number(T>>BigInt(32)&BigInt(4294967295));return W[k+3]=ye,ye=ye>>8,W[k+2]=ye,ye=ye>>8,W[k+1]=ye,ye=ye>>8,W[k]=ye,k+8}y.prototype.writeBigUInt64LE=Ye(function(T,k=0){return oe(this,T,k,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeBigUInt64BE=Ye(function(T,k=0){return ce(this,T,k,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeIntLE=function(T,k,re,ue){if(T=+T,k=k>>>0,!ue){const Ve=Math.pow(2,8*re-1);Te(this,T,k,re,Ve-1,-Ve)}let pe=0,ye=1,ke=0;for(this[k]=T&255;++pe<re&&(ye*=256);)T<0&&ke===0&&this[k+pe-1]!==0&&(ke=1),this[k+pe]=(T/ye>>0)-ke&255;return k+re},y.prototype.writeIntBE=function(T,k,re,ue){if(T=+T,k=k>>>0,!ue){const Ve=Math.pow(2,8*re-1);Te(this,T,k,re,Ve-1,-Ve)}let pe=re-1,ye=1,ke=0;for(this[k+pe]=T&255;--pe>=0&&(ye*=256);)T<0&&ke===0&&this[k+pe+1]!==0&&(ke=1),this[k+pe]=(T/ye>>0)-ke&255;return k+re},y.prototype.writeInt8=function(T,k,re){return T=+T,k=k>>>0,re||Te(this,T,k,1,127,-128),T<0&&(T=255+T+1),this[k]=T&255,k+1},y.prototype.writeInt16LE=function(T,k,re){return T=+T,k=k>>>0,re||Te(this,T,k,2,32767,-32768),this[k]=T&255,this[k+1]=T>>>8,k+2},y.prototype.writeInt16BE=function(T,k,re){return T=+T,k=k>>>0,re||Te(this,T,k,2,32767,-32768),this[k]=T>>>8,this[k+1]=T&255,k+2},y.prototype.writeInt32LE=function(T,k,re){return T=+T,k=k>>>0,re||Te(this,T,k,4,2147483647,-2147483648),this[k]=T&255,this[k+1]=T>>>8,this[k+2]=T>>>16,this[k+3]=T>>>24,k+4},y.prototype.writeInt32BE=function(T,k,re){return T=+T,k=k>>>0,re||Te(this,T,k,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[k]=T>>>24,this[k+1]=T>>>16,this[k+2]=T>>>8,this[k+3]=T&255,k+4},y.prototype.writeBigInt64LE=Ye(function(T,k=0){return oe(this,T,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),y.prototype.writeBigInt64BE=Ye(function(T,k=0){return ce(this,T,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ge(W,T,k,re,ue,pe){if(k+re>W.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("Index out of range")}function we(W,T,k,re,ue){return T=+T,k=k>>>0,ue||ge(W,T,k,4),D.write(W,T,k,re,23,4),k+4}y.prototype.writeFloatLE=function(T,k,re){return we(this,T,k,!0,re)},y.prototype.writeFloatBE=function(T,k,re){return we(this,T,k,!1,re)};function Se(W,T,k,re,ue){return T=+T,k=k>>>0,ue||ge(W,T,k,8),D.write(W,T,k,re,52,8),k+8}y.prototype.writeDoubleLE=function(T,k,re){return Se(this,T,k,!0,re)},y.prototype.writeDoubleBE=function(T,k,re){return Se(this,T,k,!1,re)},y.prototype.copy=function(T,k,re,ue){if(!y.isBuffer(T))throw new TypeError("argument should be a Buffer");if(re||(re=0),!ue&&ue!==0&&(ue=this.length),k>=T.length&&(k=T.length),k||(k=0),ue>0&&ue<re&&(ue=re),ue===re||T.length===0||this.length===0)return 0;if(k<0)throw new RangeError("targetStart out of bounds");if(re<0||re>=this.length)throw new RangeError("Index out of range");if(ue<0)throw new RangeError("sourceEnd out of bounds");ue>this.length&&(ue=this.length),T.length-k<ue-re&&(ue=T.length-k+re);const pe=ue-re;return this===T&&typeof J.prototype.copyWithin=="function"?this.copyWithin(k,re,ue):J.prototype.set.call(T,this.subarray(re,ue),k),pe},y.prototype.fill=function(T,k,re,ue){if(typeof T=="string"){if(typeof k=="string"?(ue=k,k=0,re=this.length):typeof re=="string"&&(ue=re,re=this.length),ue!==void 0&&typeof ue!="string")throw new TypeError("encoding must be a string");if(typeof ue=="string"&&!y.isEncoding(ue))throw new TypeError("Unknown encoding: "+ue);if(T.length===1){const ye=T.charCodeAt(0);(ue==="utf8"&&ye<128||ue==="latin1")&&(T=ye)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(k<0||this.length<k||this.length<re)throw new RangeError("Out of range index");if(re<=k)return this;k=k>>>0,re=re===void 0?this.length:re>>>0,T||(T=0);let pe;if(typeof T=="number")for(pe=k;pe<re;++pe)this[pe]=T;else{const ye=y.isBuffer(T)?T:y.from(T,ue),ke=ye.length;if(ke===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(pe=0;pe<re-k;++pe)this[pe+k]=ye[pe%ke]}return this};const Oe={};function U(W,T,k){Oe[W]=class extends k{constructor(){super(),Object.defineProperty(this,"message",{value:T.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${W}]`,this.stack,delete this.name}get code(){return W}set code(ue){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ue,writable:!0})}toString(){return`${this.name} [${W}]: ${this.message}`}}}U("ERR_BUFFER_OUT_OF_BOUNDS",function(W){return W?`${W} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),U("ERR_INVALID_ARG_TYPE",function(W,T){return`The "${W}" argument must be of type number. Received type ${typeof T}`},TypeError),U("ERR_OUT_OF_RANGE",function(W,T,k){let re=`The value of "${W}" is out of range.`,ue=k;return Number.isInteger(k)&&Math.abs(k)>2**32?ue=I(String(k)):typeof k=="bigint"&&(ue=String(k),(k>BigInt(2)**BigInt(32)||k<-(BigInt(2)**BigInt(32)))&&(ue=I(ue)),ue+="n"),re+=` It must be ${T}. Received ${ue}`,re},RangeError);function I(W){let T="",k=W.length;const re=W[0]==="-"?1:0;for(;k>=re+4;k-=3)T=`_${W.slice(k-3,k)}${T}`;return`${W.slice(0,k)}${T}`}function C(W,T,k){se(T,"offset"),(W[T]===void 0||W[T+k]===void 0)&&le(T,W.length-(k+1))}function X(W,T,k,re,ue,pe){if(W>k||W<T){const ye=typeof T=="bigint"?"n":"";let ke;throw T===0||T===BigInt(0)?ke=`>= 0${ye} and < 2${ye} ** ${(pe+1)*8}${ye}`:ke=`>= -(2${ye} ** ${(pe+1)*8-1}${ye}) and < 2 ** ${(pe+1)*8-1}${ye}`,new Oe.ERR_OUT_OF_RANGE("value",ke,W)}C(re,ue,pe)}function se(W,T){if(typeof W!="number")throw new Oe.ERR_INVALID_ARG_TYPE(T,"number",W)}function le(W,T,k){throw Math.floor(W)!==W?(se(W,k),new Oe.ERR_OUT_OF_RANGE("offset","an integer",W)):T<0?new Oe.ERR_BUFFER_OUT_OF_BOUNDS:new Oe.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${T}`,W)}const ve=/[^+/0-9A-Za-z-_]/g;function Ce(W){if(W=W.split("=")[0],W=W.trim().replace(ve,""),W.length<2)return"";for(;W.length%4!==0;)W=W+"=";return W}function Le(W,T){T=T||1/0;let k;const re=W.length;let ue=null;const pe=[];for(let ye=0;ye<re;++ye){if(k=W.charCodeAt(ye),k>55295&&k<57344){if(!ue){if(k>56319){(T-=3)>-1&&pe.push(239,191,189);continue}else if(ye+1===re){(T-=3)>-1&&pe.push(239,191,189);continue}ue=k;continue}if(k<56320){(T-=3)>-1&&pe.push(239,191,189),ue=k;continue}k=(ue-55296<<10|k-56320)+65536}else ue&&(T-=3)>-1&&pe.push(239,191,189);if(ue=null,k<128){if((T-=1)<0)break;pe.push(k)}else if(k<2048){if((T-=2)<0)break;pe.push(k>>6|192,k&63|128)}else if(k<65536){if((T-=3)<0)break;pe.push(k>>12|224,k>>6&63|128,k&63|128)}else if(k<1114112){if((T-=4)<0)break;pe.push(k>>18|240,k>>12&63|128,k>>6&63|128,k&63|128)}else throw new Error("Invalid code point")}return pe}function Ie(W){const T=[];for(let k=0;k<W.length;++k)T.push(W.charCodeAt(k)&255);return T}function $e(W,T){let k,re,ue;const pe=[];for(let ye=0;ye<W.length&&!((T-=2)<0);++ye)k=W.charCodeAt(ye),re=k>>8,ue=k%256,pe.push(ue),pe.push(re);return pe}function je(W){return O.toByteArray(Ce(W))}function He(W,T,k,re){let ue;for(ue=0;ue<re&&!(ue+k>=T.length||ue>=W.length);++ue)T[ue+k]=W[ue];return ue}function Ke(W,T){return W instanceof T||W!=null&&W.constructor!=null&&W.constructor.name!=null&&W.constructor.name===T.name}function Ze(W){return W!==W}const We=(function(){const W="0123456789abcdef",T=new Array(256);for(let k=0;k<16;++k){const re=k*16;for(let ue=0;ue<16;++ue)T[re+ue]=W[k]+W[ue]}return T})();function Ye(W){return typeof BigInt>"u"?Xe:W}function Xe(){throw new Error("BigInt not supported")}})(t);const E=t.Buffer;c.Blob=t.Blob,c.BlobOptions=t.BlobOptions,c.Buffer=t.Buffer,c.File=t.File,c.FileOptions=t.FileOptions,c.INSPECT_MAX_BYTES=t.INSPECT_MAX_BYTES,c.SlowBuffer=t.SlowBuffer,c.TranscodeEncoding=t.TranscodeEncoding,c.atob=t.atob,c.btoa=t.btoa,c.constants=t.constants,c.default=E,c.isAscii=t.isAscii,c.isUtf8=t.isUtf8,c.kMaxLength=t.kMaxLength,c.kStringMaxLength=t.kStringMaxLength,c.resolveObjectURL=t.resolveObjectURL,c.transcode=t.transcode})(dist)),dist}var hasRequiredSafeBuffer$1;function requireSafeBuffer$1(){return hasRequiredSafeBuffer$1||(hasRequiredSafeBuffer$1=1,(function(c,t){var u=requireDist(),o=u.Buffer;function d(h,f){for(var a in h)f[a]=h[a]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?c.exports=u:(d(u,t),t.Buffer=r);function r(h,f,a){return o(h,f,a)}r.prototype=Object.create(o.prototype),d(o,r),r.from=function(h,f,a){if(typeof h=="number")throw new TypeError("Argument must not be a number");return o(h,f,a)},r.alloc=function(h,f,a){if(typeof h!="number")throw new TypeError("Argument must be a number");var n=o(h);return f!==void 0?typeof a=="string"?n.fill(f,a):n.fill(f):n.fill(0),n},r.allocUnsafe=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return o(h)},r.allocUnsafeSlow=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return u.SlowBuffer(h)}})(safeBuffer$1,safeBuffer$1.exports)),safeBuffer$1.exports}var hasRequiredBrowser$b;function requireBrowser$b(){if(hasRequiredBrowser$b)return browser$b.exports;hasRequiredBrowser$b=1;var c=65536,t=4294967295;function u(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
2
|
-
Use Chrome, Firefox or Internet Explorer 11`)}var o=requireSafeBuffer$1().Buffer,d=commonjsGlobal.crypto||commonjsGlobal.msCrypto;d&&d.getRandomValues?browser$b.exports=r:browser$b.exports=u;function r(h,f){if(h>t)throw new RangeError("requested too many random bytes");var a=o.allocUnsafe(h);if(h>0)if(h>c)for(var n=0;n<h;n+=c)d.getRandomValues(a.slice(n,n+c));else d.getRandomValues(a);return typeof f=="function"?process$1.nextTick(function(){f(null,a)}):a}return browser$b.exports}var inherits_browser={exports:{}},hasRequiredInherits_browser;function requireInherits_browser(){return hasRequiredInherits_browser||(hasRequiredInherits_browser=1,typeof Object.create=="function"?inherits_browser.exports=function(t,u){u&&(t.super_=u,t.prototype=Object.create(u.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(t,u){if(u){t.super_=u;var o=function(){};o.prototype=u.prototype,t.prototype=new o,t.prototype.constructor=t}}),inherits_browser.exports}var events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var c=typeof Reflect=="object"?Reflect:null,t=c&&typeof c.apply=="function"?c.apply:function(j,$,J){return Function.prototype.apply.call(j,$,J)},u;c&&typeof c.ownKeys=="function"?u=c.ownKeys:Object.getOwnPropertySymbols?u=function(j){return Object.getOwnPropertyNames(j).concat(Object.getOwnPropertySymbols(j))}:u=function(j){return Object.getOwnPropertyNames(j)};function o(D){console&&console.warn&&console.warn(D)}var d=Number.isNaN||function(j){return j!==j};function r(){r.init.call(this)}events.exports=r,events.exports.once=E,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var h=10;function f(D){if(typeof D!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof D)}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(D){if(typeof D!="number"||D<0||d(D))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+D+".");h=D}}),r.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function(j){if(typeof j!="number"||j<0||d(j))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+j+".");return this._maxListeners=j,this};function a(D){return D._maxListeners===void 0?r.defaultMaxListeners:D._maxListeners}r.prototype.getMaxListeners=function(){return a(this)},r.prototype.emit=function(j){for(var $=[],J=1;J<arguments.length;J++)$.push(arguments[J]);var ie=j==="error",ne=this._events;if(ne!==void 0)ie=ie&&ne.error===void 0;else if(!ie)return!1;if(ie){var de;if($.length>0&&(de=$[0]),de instanceof Error)throw de;var Z=new Error("Unhandled error."+(de?" ("+de.message+")":""));throw Z.context=de,Z}var y=ne[j];if(y===void 0)return!1;if(typeof y=="function")t(y,this,$);else for(var g=y.length,p=b(y,g),J=0;J<g;++J)t(p[J],this,$);return!0};function n(D,j,$,J){var ie,ne,de;if(f($),ne=D._events,ne===void 0?(ne=D._events=Object.create(null),D._eventsCount=0):(ne.newListener!==void 0&&(D.emit("newListener",j,$.listener?$.listener:$),ne=D._events),de=ne[j]),de===void 0)de=ne[j]=$,++D._eventsCount;else if(typeof de=="function"?de=ne[j]=J?[$,de]:[de,$]:J?de.unshift($):de.push($),ie=a(D),ie>0&&de.length>ie&&!de.warned){de.warned=!0;var Z=new Error("Possible EventEmitter memory leak detected. "+de.length+" "+String(j)+" listeners added. Use emitter.setMaxListeners() to increase limit");Z.name="MaxListenersExceededWarning",Z.emitter=D,Z.type=j,Z.count=de.length,o(Z)}return D}r.prototype.addListener=function(j,$){return n(this,j,$,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function(j,$){return n(this,j,$,!0)};function e(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function s(D,j,$){var J={fired:!1,wrapFn:void 0,target:D,type:j,listener:$},ie=e.bind(J);return ie.listener=$,J.wrapFn=ie,ie}r.prototype.once=function(j,$){return f($),this.on(j,s(this,j,$)),this},r.prototype.prependOnceListener=function(j,$){return f($),this.prependListener(j,s(this,j,$)),this},r.prototype.removeListener=function(j,$){var J,ie,ne,de,Z;if(f($),ie=this._events,ie===void 0)return this;if(J=ie[j],J===void 0)return this;if(J===$||J.listener===$)--this._eventsCount===0?this._events=Object.create(null):(delete ie[j],ie.removeListener&&this.emit("removeListener",j,J.listener||$));else if(typeof J!="function"){for(ne=-1,de=J.length-1;de>=0;de--)if(J[de]===$||J[de].listener===$){Z=J[de].listener,ne=de;break}if(ne<0)return this;ne===0?J.shift():m(J,ne),J.length===1&&(ie[j]=J[0]),ie.removeListener!==void 0&&this.emit("removeListener",j,Z||$)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function(j){var $,J,ie;if(J=this._events,J===void 0)return this;if(J.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):J[j]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete J[j]),this;if(arguments.length===0){var ne=Object.keys(J),de;for(ie=0;ie<ne.length;++ie)de=ne[ie],de!=="removeListener"&&this.removeAllListeners(de);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if($=J[j],typeof $=="function")this.removeListener(j,$);else if($!==void 0)for(ie=$.length-1;ie>=0;ie--)this.removeListener(j,$[ie]);return this};function l(D,j,$){var J=D._events;if(J===void 0)return[];var ie=J[j];return ie===void 0?[]:typeof ie=="function"?$?[ie.listener||ie]:[ie]:$?q(ie):b(ie,ie.length)}r.prototype.listeners=function(j){return l(this,j,!0)},r.prototype.rawListeners=function(j){return l(this,j,!1)},r.listenerCount=function(D,j){return typeof D.listenerCount=="function"?D.listenerCount(j):v.call(D,j)},r.prototype.listenerCount=v;function v(D){var j=this._events;if(j!==void 0){var $=j[D];if(typeof $=="function")return 1;if($!==void 0)return $.length}return 0}r.prototype.eventNames=function(){return this._eventsCount>0?u(this._events):[]};function b(D,j){for(var $=new Array(j),J=0;J<j;++J)$[J]=D[J];return $}function m(D,j){for(;j+1<D.length;j++)D[j]=D[j+1];D.pop()}function q(D){for(var j=new Array(D.length),$=0;$<j.length;++$)j[$]=D[$].listener||D[$];return j}function E(D,j){return new Promise(function($,J){function ie(de){D.removeListener(j,ne),J(de)}function ne(){typeof D.removeListener=="function"&&D.removeListener("error",ie),$([].slice.call(arguments))}O(D,j,ne,{once:!0}),j!=="error"&&S(D,ie,{once:!0})})}function S(D,j,$){typeof D.on=="function"&&O(D,"error",j,$)}function O(D,j,$,J){if(typeof D.on=="function")J.once?D.once(j,$):D.on(j,$);else if(typeof D.addEventListener=="function")D.addEventListener(j,function ie(ne){J.once&&D.removeEventListener(j,ie),$(ne)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof D)}return events.exports}var streamBrowser$1,hasRequiredStreamBrowser$1;function requireStreamBrowser$1(){return hasRequiredStreamBrowser$1||(hasRequiredStreamBrowser$1=1,streamBrowser$1=requireEvents().EventEmitter),streamBrowser$1}var util$1={},types$1={},shams$1,hasRequiredShams$1;function requireShams$1(){return hasRequiredShams$1||(hasRequiredShams$1=1,shams$1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},u=Symbol("test"),o=Object(u);if(typeof u=="string"||Object.prototype.toString.call(u)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var d=42;t[u]=d;for(var r in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var h=Object.getOwnPropertySymbols(t);if(h.length!==1||h[0]!==u||!Object.prototype.propertyIsEnumerable.call(t,u))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var f=Object.getOwnPropertyDescriptor(t,u);if(f.value!==d||f.enumerable!==!0)return!1}return!0}),shams$1}var shams,hasRequiredShams;function requireShams(){if(hasRequiredShams)return shams;hasRequiredShams=1;var c=requireShams$1();return shams=function(){return c()&&!!Symbol.toStringTag},shams}var esObjectAtoms,hasRequiredEsObjectAtoms;function requireEsObjectAtoms(){return hasRequiredEsObjectAtoms||(hasRequiredEsObjectAtoms=1,esObjectAtoms=Object),esObjectAtoms}var esErrors,hasRequiredEsErrors;function requireEsErrors(){return hasRequiredEsErrors||(hasRequiredEsErrors=1,esErrors=Error),esErrors}var _eval,hasRequired_eval;function require_eval(){return hasRequired_eval||(hasRequired_eval=1,_eval=EvalError),_eval}var range,hasRequiredRange;function requireRange(){return hasRequiredRange||(hasRequiredRange=1,range=RangeError),range}var ref,hasRequiredRef;function requireRef(){return hasRequiredRef||(hasRequiredRef=1,ref=ReferenceError),ref}var syntax,hasRequiredSyntax;function requireSyntax(){return hasRequiredSyntax||(hasRequiredSyntax=1,syntax=SyntaxError),syntax}var type,hasRequiredType;function requireType(){return hasRequiredType||(hasRequiredType=1,type=TypeError),type}var uri,hasRequiredUri;function requireUri(){return hasRequiredUri||(hasRequiredUri=1,uri=URIError),uri}var abs,hasRequiredAbs;function requireAbs(){return hasRequiredAbs||(hasRequiredAbs=1,abs=Math.abs),abs}var floor,hasRequiredFloor;function requireFloor(){return hasRequiredFloor||(hasRequiredFloor=1,floor=Math.floor),floor}var max,hasRequiredMax;function requireMax(){return hasRequiredMax||(hasRequiredMax=1,max=Math.max),max}var min,hasRequiredMin;function requireMin(){return hasRequiredMin||(hasRequiredMin=1,min=Math.min),min}var pow,hasRequiredPow;function requirePow(){return hasRequiredPow||(hasRequiredPow=1,pow=Math.pow),pow}var round,hasRequiredRound;function requireRound(){return hasRequiredRound||(hasRequiredRound=1,round=Math.round),round}var _isNaN,hasRequired_isNaN;function require_isNaN(){return hasRequired_isNaN||(hasRequired_isNaN=1,_isNaN=Number.isNaN||function(t){return t!==t}),_isNaN}var sign$1,hasRequiredSign$1;function requireSign$1(){if(hasRequiredSign$1)return sign$1;hasRequiredSign$1=1;var c=require_isNaN();return sign$1=function(u){return c(u)||u===0?u:u<0?-1:1},sign$1}var gOPD,hasRequiredGOPD;function requireGOPD(){return hasRequiredGOPD||(hasRequiredGOPD=1,gOPD=Object.getOwnPropertyDescriptor),gOPD}var gopd,hasRequiredGopd;function requireGopd(){if(hasRequiredGopd)return gopd;hasRequiredGopd=1;var c=requireGOPD();if(c)try{c([],"length")}catch{c=null}return gopd=c,gopd}var esDefineProperty,hasRequiredEsDefineProperty;function requireEsDefineProperty(){if(hasRequiredEsDefineProperty)return esDefineProperty;hasRequiredEsDefineProperty=1;var c=Object.defineProperty||!1;if(c)try{c({},"a",{value:1})}catch{c=!1}return esDefineProperty=c,esDefineProperty}var hasSymbols,hasRequiredHasSymbols;function requireHasSymbols(){if(hasRequiredHasSymbols)return hasSymbols;hasRequiredHasSymbols=1;var c=typeof Symbol<"u"&&Symbol,t=requireShams$1();return hasSymbols=function(){return typeof c!="function"||typeof Symbol!="function"||typeof c("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},hasSymbols}var Reflect_getPrototypeOf,hasRequiredReflect_getPrototypeOf;function requireReflect_getPrototypeOf(){return hasRequiredReflect_getPrototypeOf||(hasRequiredReflect_getPrototypeOf=1,Reflect_getPrototypeOf=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Reflect_getPrototypeOf}var Object_getPrototypeOf,hasRequiredObject_getPrototypeOf;function requireObject_getPrototypeOf(){if(hasRequiredObject_getPrototypeOf)return Object_getPrototypeOf;hasRequiredObject_getPrototypeOf=1;var c=requireEsObjectAtoms();return Object_getPrototypeOf=c.getPrototypeOf||null,Object_getPrototypeOf}var implementation$4,hasRequiredImplementation$4;function requireImplementation$4(){if(hasRequiredImplementation$4)return implementation$4;hasRequiredImplementation$4=1;var c="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,u=Math.max,o="[object Function]",d=function(a,n){for(var e=[],s=0;s<a.length;s+=1)e[s]=a[s];for(var l=0;l<n.length;l+=1)e[l+a.length]=n[l];return e},r=function(a,n){for(var e=[],s=n,l=0;s<a.length;s+=1,l+=1)e[l]=a[s];return e},h=function(f,a){for(var n="",e=0;e<f.length;e+=1)n+=f[e],e+1<f.length&&(n+=a);return n};return implementation$4=function(a){var n=this;if(typeof n!="function"||t.apply(n)!==o)throw new TypeError(c+n);for(var e=r(arguments,1),s,l=function(){if(this instanceof s){var E=n.apply(this,d(e,arguments));return Object(E)===E?E:this}return n.apply(a,d(e,arguments))},v=u(0,n.length-e.length),b=[],m=0;m<v;m++)b[m]="$"+m;if(s=Function("binder","return function ("+h(b,",")+"){ return binder.apply(this,arguments); }")(l),n.prototype){var q=function(){};q.prototype=n.prototype,s.prototype=new q,q.prototype=null}return s},implementation$4}var functionBind,hasRequiredFunctionBind;function requireFunctionBind(){if(hasRequiredFunctionBind)return functionBind;hasRequiredFunctionBind=1;var c=requireImplementation$4();return functionBind=Function.prototype.bind||c,functionBind}var functionCall,hasRequiredFunctionCall;function requireFunctionCall(){return hasRequiredFunctionCall||(hasRequiredFunctionCall=1,functionCall=Function.prototype.call),functionCall}var functionApply,hasRequiredFunctionApply;function requireFunctionApply(){return hasRequiredFunctionApply||(hasRequiredFunctionApply=1,functionApply=Function.prototype.apply),functionApply}var reflectApply,hasRequiredReflectApply;function requireReflectApply(){return hasRequiredReflectApply||(hasRequiredReflectApply=1,reflectApply=typeof Reflect<"u"&&Reflect&&Reflect.apply),reflectApply}var actualApply,hasRequiredActualApply;function requireActualApply(){if(hasRequiredActualApply)return actualApply;hasRequiredActualApply=1;var c=requireFunctionBind(),t=requireFunctionApply(),u=requireFunctionCall(),o=requireReflectApply();return actualApply=o||c.call(u,t),actualApply}var callBindApplyHelpers,hasRequiredCallBindApplyHelpers;function requireCallBindApplyHelpers(){if(hasRequiredCallBindApplyHelpers)return callBindApplyHelpers;hasRequiredCallBindApplyHelpers=1;var c=requireFunctionBind(),t=requireType(),u=requireFunctionCall(),o=requireActualApply();return callBindApplyHelpers=function(r){if(r.length<1||typeof r[0]!="function")throw new t("a function is required");return o(c,u,r)},callBindApplyHelpers}var get,hasRequiredGet;function requireGet(){if(hasRequiredGet)return get;hasRequiredGet=1;var c=requireCallBindApplyHelpers(),t=requireGopd(),u;try{u=[].__proto__===Array.prototype}catch(h){if(!h||typeof h!="object"||!("code"in h)||h.code!=="ERR_PROTO_ACCESS")throw h}var o=!!u&&t&&t(Object.prototype,"__proto__"),d=Object,r=d.getPrototypeOf;return get=o&&typeof o.get=="function"?c([o.get]):typeof r=="function"?function(f){return r(f==null?f:d(f))}:!1,get}var getProto,hasRequiredGetProto;function requireGetProto(){if(hasRequiredGetProto)return getProto;hasRequiredGetProto=1;var c=requireReflect_getPrototypeOf(),t=requireObject_getPrototypeOf(),u=requireGet();return getProto=c?function(d){return c(d)}:t?function(d){if(!d||typeof d!="object"&&typeof d!="function")throw new TypeError("getProto: not an object");return t(d)}:u?function(d){return u(d)}:null,getProto}var hasown,hasRequiredHasown;function requireHasown(){if(hasRequiredHasown)return hasown;hasRequiredHasown=1;var c=Function.prototype.call,t=Object.prototype.hasOwnProperty,u=requireFunctionBind();return hasown=u.call(c,t),hasown}var getIntrinsic,hasRequiredGetIntrinsic;function requireGetIntrinsic(){if(hasRequiredGetIntrinsic)return getIntrinsic;hasRequiredGetIntrinsic=1;var c,t=requireEsObjectAtoms(),u=requireEsErrors(),o=require_eval(),d=requireRange(),r=requireRef(),h=requireSyntax(),f=requireType(),a=requireUri(),n=requireAbs(),e=requireFloor(),s=requireMax(),l=requireMin(),v=requirePow(),b=requireRound(),m=requireSign$1(),q=Function,E=function(ee){try{return q('"use strict"; return ('+ee+").constructor;")()}catch{}},S=requireGopd(),O=requireEsDefineProperty(),D=function(){throw new f},j=S?(function(){try{return arguments.callee,D}catch{try{return S(arguments,"callee").get}catch{return D}}})():D,$=requireHasSymbols()(),J=requireGetProto(),ie=requireObject_getPrototypeOf(),ne=requireReflect_getPrototypeOf(),de=requireFunctionApply(),Z=requireFunctionCall(),y={},g=typeof Uint8Array>"u"||!J?c:J(Uint8Array),p={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?c:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?c:ArrayBuffer,"%ArrayIteratorPrototype%":$&&J?J([][Symbol.iterator]()):c,"%AsyncFromSyncIteratorPrototype%":c,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":typeof Atomics>"u"?c:Atomics,"%BigInt%":typeof BigInt>"u"?c:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?c:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?c:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?c:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":u,"%eval%":eval,"%EvalError%":o,"%Float16Array%":typeof Float16Array>"u"?c:Float16Array,"%Float32Array%":typeof Float32Array>"u"?c:Float32Array,"%Float64Array%":typeof Float64Array>"u"?c:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?c:FinalizationRegistry,"%Function%":q,"%GeneratorFunction%":y,"%Int8Array%":typeof Int8Array>"u"?c:Int8Array,"%Int16Array%":typeof Int16Array>"u"?c:Int16Array,"%Int32Array%":typeof Int32Array>"u"?c:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":$&&J?J(J([][Symbol.iterator]())):c,"%JSON%":typeof JSON=="object"?JSON:c,"%Map%":typeof Map>"u"?c:Map,"%MapIteratorPrototype%":typeof Map>"u"||!$||!J?c:J(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":S,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?c:Promise,"%Proxy%":typeof Proxy>"u"?c:Proxy,"%RangeError%":d,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?c:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?c:Set,"%SetIteratorPrototype%":typeof Set>"u"||!$||!J?c:J(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?c:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":$&&J?J(""[Symbol.iterator]()):c,"%Symbol%":$?Symbol:c,"%SyntaxError%":h,"%ThrowTypeError%":j,"%TypedArray%":g,"%TypeError%":f,"%Uint8Array%":typeof Uint8Array>"u"?c:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?c:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?c:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?c:Uint32Array,"%URIError%":a,"%WeakMap%":typeof WeakMap>"u"?c:WeakMap,"%WeakRef%":typeof WeakRef>"u"?c:WeakRef,"%WeakSet%":typeof WeakSet>"u"?c:WeakSet,"%Function.prototype.call%":Z,"%Function.prototype.apply%":de,"%Object.defineProperty%":O,"%Object.getPrototypeOf%":ie,"%Math.abs%":n,"%Math.floor%":e,"%Math.max%":s,"%Math.min%":l,"%Math.pow%":v,"%Math.round%":b,"%Math.sign%":m,"%Reflect.getPrototypeOf%":ne};if(J)try{null.error}catch(ee){var _=J(J(ee));p["%Error.prototype%"]=_}var R=function ee(ae){var z;if(ae==="%AsyncFunction%")z=E("async function () {}");else if(ae==="%GeneratorFunction%")z=E("function* () {}");else if(ae==="%AsyncGeneratorFunction%")z=E("async function* () {}");else if(ae==="%AsyncGenerator%"){var G=ee("%AsyncGeneratorFunction%");G&&(z=G.prototype)}else if(ae==="%AsyncIteratorPrototype%"){var fe=ee("%AsyncGenerator%");fe&&J&&(z=J(fe.prototype))}return p[ae]=z,z},B={__proto__:null,"%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"]},P=requireFunctionBind(),A=requireHasown(),w=P.call(Z,Array.prototype.concat),M=P.call(de,Array.prototype.splice),x=P.call(Z,String.prototype.replace),L=P.call(Z,String.prototype.slice),K=P.call(Z,RegExp.prototype.exec),Q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,H=/\\(\\)?/g,N=function(ae){var z=L(ae,0,1),G=L(ae,-1);if(z==="%"&&G!=="%")throw new h("invalid intrinsic syntax, expected closing `%`");if(G==="%"&&z!=="%")throw new h("invalid intrinsic syntax, expected opening `%`");var fe=[];return x(ae,Q,function(me,xe,_e,qe){fe[fe.length]=_e?x(qe,H,"$1"):xe||me}),fe},F=function(ae,z){var G=ae,fe;if(A(B,G)&&(fe=B[G],G="%"+fe[0]+"%"),A(p,G)){var me=p[G];if(me===y&&(me=R(G)),typeof me>"u"&&!z)throw new f("intrinsic "+ae+" exists, but is not available. Please file an issue!");return{alias:fe,name:G,value:me}}throw new h("intrinsic "+ae+" does not exist!")};return getIntrinsic=function(ae,z){if(typeof ae!="string"||ae.length===0)throw new f("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof z!="boolean")throw new f('"allowMissing" argument must be a boolean');if(K(/^%?[^%]*%?$/,ae)===null)throw new h("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var G=N(ae),fe=G.length>0?G[0]:"",me=F("%"+fe+"%",z),xe=me.name,_e=me.value,qe=!1,Re=me.alias;Re&&(fe=Re[0],M(G,w([0,1],Re)));for(var be=1,Fe=!0;be<G.length;be+=1){var Be=G[be],Me=L(Be,0,1),Te=L(Be,-1);if((Me==='"'||Me==="'"||Me==="`"||Te==='"'||Te==="'"||Te==="`")&&Me!==Te)throw new h("property names with quotes must have matching quotes");if((Be==="constructor"||!Fe)&&(qe=!0),fe+="."+Be,xe="%"+fe+"%",A(p,xe))_e=p[xe];else if(_e!=null){if(!(Be in _e)){if(!z)throw new f("base intrinsic for "+ae+" exists, but the property is not available.");return}if(S&&be+1>=G.length){var oe=S(_e,Be);Fe=!!oe,Fe&&"get"in oe&&!("originalValue"in oe.get)?_e=oe.get:_e=_e[Be]}else Fe=A(_e,Be),_e=_e[Be];Fe&&!qe&&(p[xe]=_e)}}return _e},getIntrinsic}var callBound$1,hasRequiredCallBound$1;function requireCallBound$1(){if(hasRequiredCallBound$1)return callBound$1;hasRequiredCallBound$1=1;var c=requireGetIntrinsic(),t=requireCallBindApplyHelpers(),u=t([c("%String.prototype.indexOf%")]);return callBound$1=function(d,r){var h=c(d,!!r);return typeof h=="function"&&u(d,".prototype.")>-1?t([h]):h},callBound$1}var isArguments$1,hasRequiredIsArguments$1;function requireIsArguments$1(){if(hasRequiredIsArguments$1)return isArguments$1;hasRequiredIsArguments$1=1;var c=requireShams()(),t=requireCallBound$1(),u=t("Object.prototype.toString"),o=function(f){return c&&f&&typeof f=="object"&&Symbol.toStringTag in f?!1:u(f)==="[object Arguments]"},d=function(f){return o(f)?!0:f!==null&&typeof f=="object"&&"length"in f&&typeof f.length=="number"&&f.length>=0&&u(f)!=="[object Array]"&&"callee"in f&&u(f.callee)==="[object Function]"},r=(function(){return o(arguments)})();return o.isLegacyArguments=d,isArguments$1=r?o:d,isArguments$1}var isRegex,hasRequiredIsRegex;function requireIsRegex(){if(hasRequiredIsRegex)return isRegex;hasRequiredIsRegex=1;var c=requireCallBound$1(),t=requireShams()(),u=requireHasown(),o=requireGopd(),d;if(t){var r=c("RegExp.prototype.exec"),h={},f=function(){throw h},a={toString:f,valueOf:f};typeof Symbol.toPrimitive=="symbol"&&(a[Symbol.toPrimitive]=f),d=function(l){if(!l||typeof l!="object")return!1;var v=o(l,"lastIndex"),b=v&&u(v,"value");if(!b)return!1;try{r(l,a)}catch(m){return m===h}}}else{var n=c("Object.prototype.toString"),e="[object RegExp]";d=function(l){return!l||typeof l!="object"&&typeof l!="function"?!1:n(l)===e}}return isRegex=d,isRegex}var safeRegexTest,hasRequiredSafeRegexTest;function requireSafeRegexTest(){if(hasRequiredSafeRegexTest)return safeRegexTest;hasRequiredSafeRegexTest=1;var c=requireCallBound$1(),t=requireIsRegex(),u=c("RegExp.prototype.exec"),o=requireType();return safeRegexTest=function(r){if(!t(r))throw new o("`regex` must be a RegExp");return function(f){return u(r,f)!==null}},safeRegexTest}var generatorFunction,hasRequiredGeneratorFunction;function requireGeneratorFunction(){if(hasRequiredGeneratorFunction)return generatorFunction;hasRequiredGeneratorFunction=1;const c=(function*(){}).constructor;return generatorFunction=()=>c,generatorFunction}var isGeneratorFunction,hasRequiredIsGeneratorFunction;function requireIsGeneratorFunction(){if(hasRequiredIsGeneratorFunction)return isGeneratorFunction;hasRequiredIsGeneratorFunction=1;var c=requireCallBound$1(),t=requireSafeRegexTest(),u=t(/^\s*(?:function)?\*/),o=requireShams()(),d=requireGetProto(),r=c("Object.prototype.toString"),h=c("Function.prototype.toString"),f=requireGeneratorFunction();return isGeneratorFunction=function(n){if(typeof n!="function")return!1;if(u(h(n)))return!0;if(!o){var e=r(n);return e==="[object GeneratorFunction]"}if(!d)return!1;var s=f();return s&&d(n)===s.prototype},isGeneratorFunction}var isCallable,hasRequiredIsCallable;function requireIsCallable(){if(hasRequiredIsCallable)return isCallable;hasRequiredIsCallable=1;var c=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,u,o;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{u=Object.defineProperty({},"length",{get:function(){throw o}}),o={},t(function(){throw 42},null,u)}catch(S){S!==o&&(t=null)}else t=null;var d=/^\s*class\b/,r=function(O){try{var D=c.call(O);return d.test(D)}catch{return!1}},h=function(O){try{return r(O)?!1:(c.call(O),!0)}catch{return!1}},f=Object.prototype.toString,a="[object Object]",n="[object Function]",e="[object GeneratorFunction]",s="[object HTMLAllCollection]",l="[object HTML document.all class]",v="[object HTMLCollection]",b=typeof Symbol=="function"&&!!Symbol.toStringTag,m=!(0 in[,]),q=function(){return!1};if(typeof document=="object"){var E=document.all;f.call(E)===f.call(document.all)&&(q=function(O){if((m||!O)&&(typeof O>"u"||typeof O=="object"))try{var D=f.call(O);return(D===s||D===l||D===v||D===a)&&O("")==null}catch{}return!1})}return isCallable=t?function(O){if(q(O))return!0;if(!O||typeof O!="function"&&typeof O!="object")return!1;try{t(O,null,u)}catch(D){if(D!==o)return!1}return!r(O)&&h(O)}:function(O){if(q(O))return!0;if(!O||typeof O!="function"&&typeof O!="object")return!1;if(b)return h(O);if(r(O))return!1;var D=f.call(O);return D!==n&&D!==e&&!/^\[object HTML/.test(D)?!1:h(O)},isCallable}var forEach,hasRequiredForEach;function requireForEach(){if(hasRequiredForEach)return forEach;hasRequiredForEach=1;var c=requireIsCallable(),t=Object.prototype.toString,u=Object.prototype.hasOwnProperty,o=function(a,n,e){for(var s=0,l=a.length;s<l;s++)u.call(a,s)&&(e==null?n(a[s],s,a):n.call(e,a[s],s,a))},d=function(a,n,e){for(var s=0,l=a.length;s<l;s++)e==null?n(a.charAt(s),s,a):n.call(e,a.charAt(s),s,a)},r=function(a,n,e){for(var s in a)u.call(a,s)&&(e==null?n(a[s],s,a):n.call(e,a[s],s,a))};function h(f){return t.call(f)==="[object Array]"}return forEach=function(a,n,e){if(!c(n))throw new TypeError("iterator must be a function");var s;arguments.length>=3&&(s=e),h(a)?o(a,n,s):typeof a=="string"?d(a,n,s):r(a,n,s)},forEach}var possibleTypedArrayNames,hasRequiredPossibleTypedArrayNames;function requirePossibleTypedArrayNames(){return hasRequiredPossibleTypedArrayNames||(hasRequiredPossibleTypedArrayNames=1,possibleTypedArrayNames=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),possibleTypedArrayNames}var availableTypedArrays,hasRequiredAvailableTypedArrays;function requireAvailableTypedArrays(){if(hasRequiredAvailableTypedArrays)return availableTypedArrays;hasRequiredAvailableTypedArrays=1;var c=requirePossibleTypedArrayNames(),t=typeof globalThis>"u"?commonjsGlobal:globalThis;return availableTypedArrays=function(){for(var o=[],d=0;d<c.length;d++)typeof t[c[d]]=="function"&&(o[o.length]=c[d]);return o},availableTypedArrays}var callBind={exports:{}},defineDataProperty,hasRequiredDefineDataProperty;function requireDefineDataProperty(){if(hasRequiredDefineDataProperty)return defineDataProperty;hasRequiredDefineDataProperty=1;var c=requireEsDefineProperty(),t=requireSyntax(),u=requireType(),o=requireGopd();return defineDataProperty=function(r,h,f){if(!r||typeof r!="object"&&typeof r!="function")throw new u("`obj` must be an object or a function`");if(typeof h!="string"&&typeof h!="symbol")throw new u("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new u("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new u("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new u("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new u("`loose`, if provided, must be a boolean");var a=arguments.length>3?arguments[3]:null,n=arguments.length>4?arguments[4]:null,e=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,l=!!o&&o(r,h);if(c)c(r,h,{configurable:e===null&&l?l.configurable:!e,enumerable:a===null&&l?l.enumerable:!a,value:f,writable:n===null&&l?l.writable:!n});else if(s||!a&&!n&&!e)r[h]=f;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},defineDataProperty}var hasPropertyDescriptors_1,hasRequiredHasPropertyDescriptors;function requireHasPropertyDescriptors(){if(hasRequiredHasPropertyDescriptors)return hasPropertyDescriptors_1;hasRequiredHasPropertyDescriptors=1;var c=requireEsDefineProperty(),t=function(){return!!c};return t.hasArrayLengthDefineBug=function(){if(!c)return null;try{return c([],"length",{value:1}).length!==1}catch{return!0}},hasPropertyDescriptors_1=t,hasPropertyDescriptors_1}var setFunctionLength,hasRequiredSetFunctionLength;function requireSetFunctionLength(){if(hasRequiredSetFunctionLength)return setFunctionLength;hasRequiredSetFunctionLength=1;var c=requireGetIntrinsic(),t=requireDefineDataProperty(),u=requireHasPropertyDescriptors()(),o=requireGopd(),d=requireType(),r=c("%Math.floor%");return setFunctionLength=function(f,a){if(typeof f!="function")throw new d("`fn` is not a function");if(typeof a!="number"||a<0||a>4294967295||r(a)!==a)throw new d("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],e=!0,s=!0;if("length"in f&&o){var l=o(f,"length");l&&!l.configurable&&(e=!1),l&&!l.writable&&(s=!1)}return(e||s||!n)&&(u?t(f,"length",a,!0,!0):t(f,"length",a)),f},setFunctionLength}var applyBind,hasRequiredApplyBind;function requireApplyBind(){if(hasRequiredApplyBind)return applyBind;hasRequiredApplyBind=1;var c=requireFunctionBind(),t=requireFunctionApply(),u=requireActualApply();return applyBind=function(){return u(c,t,arguments)},applyBind}var hasRequiredCallBind;function requireCallBind(){return hasRequiredCallBind||(hasRequiredCallBind=1,(function(c){var t=requireSetFunctionLength(),u=requireEsDefineProperty(),o=requireCallBindApplyHelpers(),d=requireApplyBind();c.exports=function(h){var f=o(arguments),a=h.length-(arguments.length-1);return t(f,1+(a>0?a:0),!0)},u?u(c.exports,"apply",{value:d}):c.exports.apply=d})(callBind)),callBind.exports}var whichTypedArray,hasRequiredWhichTypedArray;function requireWhichTypedArray(){if(hasRequiredWhichTypedArray)return whichTypedArray;hasRequiredWhichTypedArray=1;var c=requireForEach(),t=requireAvailableTypedArrays(),u=requireCallBind(),o=requireCallBound$1(),d=requireGopd(),r=requireGetProto(),h=o("Object.prototype.toString"),f=requireShams()(),a=typeof globalThis>"u"?commonjsGlobal:globalThis,n=t(),e=o("String.prototype.slice"),s=o("Array.prototype.indexOf",!0)||function(q,E){for(var S=0;S<q.length;S+=1)if(q[S]===E)return S;return-1},l={__proto__:null};f&&d&&r?c(n,function(m){var q=new a[m];if(Symbol.toStringTag in q&&r){var E=r(q),S=d(E,Symbol.toStringTag);if(!S&&E){var O=r(E);S=d(O,Symbol.toStringTag)}if(S&&S.get){var D=u(S.get);l["$"+m]=D}}}):c(n,function(m){var q=new a[m],E=q.slice||q.set;if(E){var S=u(E);l["$"+m]=S}});var v=function(q){var E=!1;return c(l,function(S,O){if(!E)try{"$"+S(q)===O&&(E=e(O,1))}catch{}}),E},b=function(q){var E=!1;return c(l,function(S,O){if(!E)try{S(q),E=e(O,1)}catch{}}),E};return whichTypedArray=function(q){if(!q||typeof q!="object")return!1;if(!f){var E=e(h(q),8,-1);return s(n,E)>-1?E:E!=="Object"?!1:b(q)}return d?v(q):null},whichTypedArray}var isTypedArray,hasRequiredIsTypedArray;function requireIsTypedArray(){if(hasRequiredIsTypedArray)return isTypedArray;hasRequiredIsTypedArray=1;var c=requireWhichTypedArray();return isTypedArray=function(u){return!!c(u)},isTypedArray}var hasRequiredTypes$1;function requireTypes$1(){return hasRequiredTypes$1||(hasRequiredTypes$1=1,(function(c){var t=requireIsArguments$1(),u=requireIsGeneratorFunction(),o=requireWhichTypedArray(),d=requireIsTypedArray();function r(be){return be.call.bind(be)}var h=typeof BigInt<"u",f=typeof Symbol<"u",a=r(Object.prototype.toString),n=r(Number.prototype.valueOf),e=r(String.prototype.valueOf),s=r(Boolean.prototype.valueOf);if(h)var l=r(BigInt.prototype.valueOf);if(f)var v=r(Symbol.prototype.valueOf);function b(be,Fe){if(typeof be!="object")return!1;try{return Fe(be),!0}catch{return!1}}c.isArgumentsObject=t,c.isGeneratorFunction=u,c.isTypedArray=d;function m(be){return typeof Promise<"u"&&be instanceof Promise||be!==null&&typeof be=="object"&&typeof be.then=="function"&&typeof be.catch=="function"}c.isPromise=m;function q(be){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(be):d(be)||L(be)}c.isArrayBufferView=q;function E(be){return o(be)==="Uint8Array"}c.isUint8Array=E;function S(be){return o(be)==="Uint8ClampedArray"}c.isUint8ClampedArray=S;function O(be){return o(be)==="Uint16Array"}c.isUint16Array=O;function D(be){return o(be)==="Uint32Array"}c.isUint32Array=D;function j(be){return o(be)==="Int8Array"}c.isInt8Array=j;function $(be){return o(be)==="Int16Array"}c.isInt16Array=$;function J(be){return o(be)==="Int32Array"}c.isInt32Array=J;function ie(be){return o(be)==="Float32Array"}c.isFloat32Array=ie;function ne(be){return o(be)==="Float64Array"}c.isFloat64Array=ne;function de(be){return o(be)==="BigInt64Array"}c.isBigInt64Array=de;function Z(be){return o(be)==="BigUint64Array"}c.isBigUint64Array=Z;function y(be){return a(be)==="[object Map]"}y.working=typeof Map<"u"&&y(new Map);function g(be){return typeof Map>"u"?!1:y.working?y(be):be instanceof Map}c.isMap=g;function p(be){return a(be)==="[object Set]"}p.working=typeof Set<"u"&&p(new Set);function _(be){return typeof Set>"u"?!1:p.working?p(be):be instanceof Set}c.isSet=_;function R(be){return a(be)==="[object WeakMap]"}R.working=typeof WeakMap<"u"&&R(new WeakMap);function B(be){return typeof WeakMap>"u"?!1:R.working?R(be):be instanceof WeakMap}c.isWeakMap=B;function P(be){return a(be)==="[object WeakSet]"}P.working=typeof WeakSet<"u"&&P(new WeakSet);function A(be){return P(be)}c.isWeakSet=A;function w(be){return a(be)==="[object ArrayBuffer]"}w.working=typeof ArrayBuffer<"u"&&w(new ArrayBuffer);function M(be){return typeof ArrayBuffer>"u"?!1:w.working?w(be):be instanceof ArrayBuffer}c.isArrayBuffer=M;function x(be){return a(be)==="[object DataView]"}x.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&x(new DataView(new ArrayBuffer(1),0,1));function L(be){return typeof DataView>"u"?!1:x.working?x(be):be instanceof DataView}c.isDataView=L;var K=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Q(be){return a(be)==="[object SharedArrayBuffer]"}function H(be){return typeof K>"u"?!1:(typeof Q.working>"u"&&(Q.working=Q(new K)),Q.working?Q(be):be instanceof K)}c.isSharedArrayBuffer=H;function N(be){return a(be)==="[object AsyncFunction]"}c.isAsyncFunction=N;function F(be){return a(be)==="[object Map Iterator]"}c.isMapIterator=F;function ee(be){return a(be)==="[object Set Iterator]"}c.isSetIterator=ee;function ae(be){return a(be)==="[object Generator]"}c.isGeneratorObject=ae;function z(be){return a(be)==="[object WebAssembly.Module]"}c.isWebAssemblyCompiledModule=z;function G(be){return b(be,n)}c.isNumberObject=G;function fe(be){return b(be,e)}c.isStringObject=fe;function me(be){return b(be,s)}c.isBooleanObject=me;function xe(be){return h&&b(be,l)}c.isBigIntObject=xe;function _e(be){return f&&b(be,v)}c.isSymbolObject=_e;function qe(be){return G(be)||fe(be)||me(be)||xe(be)||_e(be)}c.isBoxedPrimitive=qe;function Re(be){return typeof Uint8Array<"u"&&(M(be)||H(be))}c.isAnyArrayBuffer=Re,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(be){Object.defineProperty(c,be,{enumerable:!1,value:function(){throw new Error(be+" is not supported in userland")}})})})(types$1)),types$1}var isBufferBrowser,hasRequiredIsBufferBrowser;function requireIsBufferBrowser(){return hasRequiredIsBufferBrowser||(hasRequiredIsBufferBrowser=1,isBufferBrowser=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),isBufferBrowser}var hasRequiredUtil$1;function requireUtil$1(){return hasRequiredUtil$1||(hasRequiredUtil$1=1,(function(c){var t=Object.getOwnPropertyDescriptors||function(L){for(var K=Object.keys(L),Q={},H=0;H<K.length;H++)Q[K[H]]=Object.getOwnPropertyDescriptor(L,K[H]);return Q},u=/%[sdj%]/g;c.format=function(x){if(!j(x)){for(var L=[],K=0;K<arguments.length;K++)L.push(h(arguments[K]));return L.join(" ")}for(var K=1,Q=arguments,H=Q.length,N=String(x).replace(u,function(ee){if(ee==="%%")return"%";if(K>=H)return ee;switch(ee){case"%s":return String(Q[K++]);case"%d":return Number(Q[K++]);case"%j":try{return JSON.stringify(Q[K++])}catch{return"[Circular]"}default:return ee}}),F=Q[K];K<H;F=Q[++K])S(F)||!ne(F)?N+=" "+F:N+=" "+h(F);return N},c.deprecate=function(x,L){if(typeof process$1<"u"&&process$1.noDeprecation===!0)return x;if(typeof process$1>"u")return function(){return c.deprecate(x,L).apply(this,arguments)};var K=!1;function Q(){if(!K){if(process$1.throwDeprecation)throw new Error(L);process$1.traceDeprecation?console.trace(L):console.error(L),K=!0}return x.apply(this,arguments)}return Q};var o={},d=/^$/;if(process$1.env.NODE_DEBUG){var r=process$1.env.NODE_DEBUG;r=r.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),d=new RegExp("^"+r+"$","i")}c.debuglog=function(x){if(x=x.toUpperCase(),!o[x])if(d.test(x)){var L=process$1.pid;o[x]=function(){var K=c.format.apply(c,arguments);console.error("%s %d: %s",x,L,K)}}else o[x]=function(){};return o[x]};function h(x,L){var K={seen:[],stylize:a};return arguments.length>=3&&(K.depth=arguments[2]),arguments.length>=4&&(K.colors=arguments[3]),E(L)?K.showHidden=L:L&&c._extend(K,L),J(K.showHidden)&&(K.showHidden=!1),J(K.depth)&&(K.depth=2),J(K.colors)&&(K.colors=!1),J(K.customInspect)&&(K.customInspect=!0),K.colors&&(K.stylize=f),e(K,x,K.depth)}c.inspect=h,h.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]},h.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function f(x,L){var K=h.styles[L];return K?"\x1B["+h.colors[K][0]+"m"+x+"\x1B["+h.colors[K][1]+"m":x}function a(x,L){return x}function n(x){var L={};return x.forEach(function(K,Q){L[K]=!0}),L}function e(x,L,K){if(x.customInspect&&L&&y(L.inspect)&&L.inspect!==c.inspect&&!(L.constructor&&L.constructor.prototype===L)){var Q=L.inspect(K,x);return j(Q)||(Q=e(x,Q,K)),Q}var H=s(x,L);if(H)return H;var N=Object.keys(L),F=n(N);if(x.showHidden&&(N=Object.getOwnPropertyNames(L)),Z(L)&&(N.indexOf("message")>=0||N.indexOf("description")>=0))return l(L);if(N.length===0){if(y(L)){var ee=L.name?": "+L.name:"";return x.stylize("[Function"+ee+"]","special")}if(ie(L))return x.stylize(RegExp.prototype.toString.call(L),"regexp");if(de(L))return x.stylize(Date.prototype.toString.call(L),"date");if(Z(L))return l(L)}var ae="",z=!1,G=["{","}"];if(q(L)&&(z=!0,G=["[","]"]),y(L)){var fe=L.name?": "+L.name:"";ae=" [Function"+fe+"]"}if(ie(L)&&(ae=" "+RegExp.prototype.toString.call(L)),de(L)&&(ae=" "+Date.prototype.toUTCString.call(L)),Z(L)&&(ae=" "+l(L)),N.length===0&&(!z||L.length==0))return G[0]+ae+G[1];if(K<0)return ie(L)?x.stylize(RegExp.prototype.toString.call(L),"regexp"):x.stylize("[Object]","special");x.seen.push(L);var me;return z?me=v(x,L,K,F,N):me=N.map(function(xe){return b(x,L,K,F,xe,z)}),x.seen.pop(),m(me,ae,G)}function s(x,L){if(J(L))return x.stylize("undefined","undefined");if(j(L)){var K="'"+JSON.stringify(L).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return x.stylize(K,"string")}if(D(L))return x.stylize(""+L,"number");if(E(L))return x.stylize(""+L,"boolean");if(S(L))return x.stylize("null","null")}function l(x){return"["+Error.prototype.toString.call(x)+"]"}function v(x,L,K,Q,H){for(var N=[],F=0,ee=L.length;F<ee;++F)P(L,String(F))?N.push(b(x,L,K,Q,String(F),!0)):N.push("");return H.forEach(function(ae){ae.match(/^\d+$/)||N.push(b(x,L,K,Q,ae,!0))}),N}function b(x,L,K,Q,H,N){var F,ee,ae;if(ae=Object.getOwnPropertyDescriptor(L,H)||{value:L[H]},ae.get?ae.set?ee=x.stylize("[Getter/Setter]","special"):ee=x.stylize("[Getter]","special"):ae.set&&(ee=x.stylize("[Setter]","special")),P(Q,H)||(F="["+H+"]"),ee||(x.seen.indexOf(ae.value)<0?(S(K)?ee=e(x,ae.value,null):ee=e(x,ae.value,K-1),ee.indexOf(`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const webgpu=require("three/webgpu"),uSpace=require("u-space"),tsl=require("three/tsl"),index=require("../../index.cjs");class BaseFileLoader extends webgpu.FileLoader{constructor(t){super(),this.manager=t.manager,this.setPath(t.path),this.setResponseType("json"),this.setRequestHeader(t.requestHeader),this.setWithCredentials(t.withCredentials)}async loadAsync(t){return super.loadAsync(t)}}const META_DATA_FILE_PATH="/SceneMetadata.json",dbBase="/db",TOPOLOGY_DATA_FILE_PATH=`${dbBase}/topology_paths.json`,ANIMATIONS_DATA_FILE_PATH=`${dbBase}/animations.json`,VISIONS_DATA_FILE_PATH=`${dbBase}/model_visions.json`,PROPERTIES_DATA_FILE_PATH=`${dbBase}/properties.json`,SEMANTIC_DATA_FILE_PATH=`${dbBase}/semantic_model.json`;var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function getDefaultExportFromCjs$1(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var buffer$1={},base64Js={};base64Js.byteLength=byteLength;base64Js.toByteArray=toByteArray;base64Js.fromByteArray=fromByteArray;var lookup=[],revLookup=[],Arr=typeof Uint8Array<"u"?Uint8Array:Array,code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var i=0,len=code.length;i<len;++i)lookup[i]=code[i],revLookup[code.charCodeAt(i)]=i;revLookup[45]=62;revLookup[95]=63;function getLens(s){var t=s.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var f=s.indexOf("=");f===-1&&(f=t);var o=f===t?0:4-f%4;return[f,o]}function byteLength(s){var t=getLens(s),f=t[0],o=t[1];return(f+o)*3/4-o}function _byteLength(s,t,f){return(t+f)*3/4-f}function toByteArray(s){var t,f=getLens(s),o=f[0],d=f[1],r=new Arr(_byteLength(s,o,d)),h=0,c=d>0?o-4:o,n;for(n=0;n<c;n+=4)t=revLookup[s.charCodeAt(n)]<<18|revLookup[s.charCodeAt(n+1)]<<12|revLookup[s.charCodeAt(n+2)]<<6|revLookup[s.charCodeAt(n+3)],r[h++]=t>>16&255,r[h++]=t>>8&255,r[h++]=t&255;return d===2&&(t=revLookup[s.charCodeAt(n)]<<2|revLookup[s.charCodeAt(n+1)]>>4,r[h++]=t&255),d===1&&(t=revLookup[s.charCodeAt(n)]<<10|revLookup[s.charCodeAt(n+1)]<<4|revLookup[s.charCodeAt(n+2)]>>2,r[h++]=t>>8&255,r[h++]=t&255),r}function tripletToBase64(s){return lookup[s>>18&63]+lookup[s>>12&63]+lookup[s>>6&63]+lookup[s&63]}function encodeChunk(s,t,f){for(var o,d=[],r=t;r<f;r+=3)o=(s[r]<<16&16711680)+(s[r+1]<<8&65280)+(s[r+2]&255),d.push(tripletToBase64(o));return d.join("")}function fromByteArray(s){for(var t,f=s.length,o=f%3,d=[],r=16383,h=0,c=f-o;h<c;h+=r)d.push(encodeChunk(s,h,h+r>c?c:h+r));return o===1?(t=s[f-1],d.push(lookup[t>>2]+lookup[t<<4&63]+"==")):o===2&&(t=(s[f-2]<<8)+s[f-1],d.push(lookup[t>>10]+lookup[t>>4&63]+lookup[t<<2&63]+"=")),d.join("")}var ieee754={};ieee754.read=function(s,t,f,o,d){var r,h,c=d*8-o-1,n=(1<<c)-1,a=n>>1,e=-7,u=f?d-1:0,l=f?-1:1,v=s[t+u];for(u+=l,r=v&(1<<-e)-1,v>>=-e,e+=c;e>0;r=r*256+s[t+u],u+=l,e-=8);for(h=r&(1<<-e)-1,r>>=-e,e+=o;e>0;h=h*256+s[t+u],u+=l,e-=8);if(r===0)r=1-a;else{if(r===n)return h?NaN:(v?-1:1)*(1/0);h=h+Math.pow(2,o),r=r-a}return(v?-1:1)*h*Math.pow(2,r-o)};ieee754.write=function(s,t,f,o,d,r){var h,c,n,a=r*8-d-1,e=(1<<a)-1,u=e>>1,l=d===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=o?0:r-1,b=o?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,h=e):(h=Math.floor(Math.log(t)/Math.LN2),t*(n=Math.pow(2,-h))<1&&(h--,n*=2),h+u>=1?t+=l/n:t+=l*Math.pow(2,1-u),t*n>=2&&(h++,n/=2),h+u>=e?(c=0,h=e):h+u>=1?(c=(t*n-1)*Math.pow(2,d),h=h+u):(c=t*Math.pow(2,u-1)*Math.pow(2,d),h=0));d>=8;s[f+v]=c&255,v+=b,c/=256,d-=8);for(h=h<<d|c,a+=d;a>0;s[f+v]=h&255,v+=b,h/=256,a-=8);s[f+v-b]|=m*128};(function(s){const t=base64Js,f=ieee754,o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;s.Buffer=e,s.SlowBuffer=$,s.INSPECT_MAX_BYTES=50;const d=2147483647;s.kMaxLength=d;const{Uint8Array:r,ArrayBuffer:h,SharedArrayBuffer:c}=globalThis;e.TYPED_ARRAY_SUPPORT=n(),!e.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function n(){try{const U=new r(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,r.prototype),Object.setPrototypeOf(U,I),U.foo()===42}catch{return!1}}Object.defineProperty(e.prototype,"parent",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.buffer}}),Object.defineProperty(e.prototype,"offset",{enumerable:!0,get:function(){if(e.isBuffer(this))return this.byteOffset}});function a(U){if(U>d)throw new RangeError('The value "'+U+'" is invalid for option "size"');const I=new r(U);return Object.setPrototypeOf(I,e.prototype),I}function e(U,I,C){if(typeof U=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return b(U)}return u(U,I,C)}e.poolSize=8192;function u(U,I,C){if(typeof U=="string")return m(U,I);if(h.isView(U))return E(U);if(U==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U);if(ce(U,h)||U&&ce(U.buffer,h)||typeof c<"u"&&(ce(U,c)||U&&ce(U.buffer,c)))return S(U,I,C);if(typeof U=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const J=U.valueOf&&U.valueOf();if(J!=null&&J!==U)return e.from(J,I,C);const se=O(U);if(se)return se;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof U[Symbol.toPrimitive]=="function")return e.from(U[Symbol.toPrimitive]("string"),I,C);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof U)}e.from=function(U,I,C){return u(U,I,C)},Object.setPrototypeOf(e.prototype,r.prototype),Object.setPrototypeOf(e,r);function l(U){if(typeof U!="number")throw new TypeError('"size" argument must be of type number');if(U<0)throw new RangeError('The value "'+U+'" is invalid for option "size"')}function v(U,I,C){return l(U),U<=0?a(U):I!==void 0?typeof C=="string"?a(U).fill(I,C):a(U).fill(I):a(U)}e.alloc=function(U,I,C){return v(U,I,C)};function b(U){return l(U),a(U<0?0:D(U)|0)}e.allocUnsafe=function(U){return b(U)},e.allocUnsafeSlow=function(U){return b(U)};function m(U,I){if((typeof I!="string"||I==="")&&(I="utf8"),!e.isEncoding(I))throw new TypeError("Unknown encoding: "+I);const C=H(U,I)|0;let J=a(C);const se=J.write(U,I);return se!==C&&(J=J.slice(0,se)),J}function B(U){const I=U.length<0?0:D(U.length)|0,C=a(I);for(let J=0;J<I;J+=1)C[J]=U[J]&255;return C}function E(U){if(ce(U,r)){const I=new r(U);return S(I.buffer,I.byteOffset,I.byteLength)}return B(U)}function S(U,I,C){if(I<0||U.byteLength<I)throw new RangeError('"offset" is outside of buffer bounds');if(U.byteLength<I+(C||0))throw new RangeError('"length" is outside of buffer bounds');let J;return I===void 0&&C===void 0?J=new r(U):C===void 0?J=new r(U,I):J=new r(U,I,C),Object.setPrototypeOf(J,e.prototype),J}function O(U){if(e.isBuffer(U)){const I=D(U.length)|0,C=a(I);return C.length===0||U.copy(C,0,0,I),C}if(U.length!==void 0)return typeof U.length!="number"||ge(U.length)?a(0):B(U);if(U.type==="Buffer"&&Array.isArray(U.data))return B(U.data)}function D(U){if(U>=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return U|0}function $(U){return+U!=U&&(U=0),e.alloc(+U)}e.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==e.prototype},e.compare=function(I,C){if(ce(I,r)&&(I=e.from(I,I.offset,I.byteLength)),ce(C,r)&&(C=e.from(C,C.offset,C.byteLength)),!e.isBuffer(I)||!e.isBuffer(C))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===C)return 0;let J=I.length,se=C.length;for(let le=0,ve=Math.min(J,se);le<ve;++le)if(I[le]!==C[le]){J=I[le],se=C[le];break}return J<se?-1:se<J?1:0},e.isEncoding=function(I){switch(String(I).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}},e.concat=function(I,C){if(!Array.isArray(I))throw new TypeError('"list" argument must be an Array of Buffers');if(I.length===0)return e.alloc(0);let J;if(C===void 0)for(C=0,J=0;J<I.length;++J)C+=I[J].length;const se=e.allocUnsafe(C);let le=0;for(J=0;J<I.length;++J){let ve=I[J];if(ce(ve,r))le+ve.length>se.length?(e.isBuffer(ve)||(ve=e.from(ve)),ve.copy(se,le)):r.prototype.set.call(se,ve,le);else if(e.isBuffer(ve))ve.copy(se,le);else throw new TypeError('"list" argument must be an Array of Buffers');le+=ve.length}return se};function H(U,I){if(e.isBuffer(U))return U.length;if(h.isView(U)||ce(U,h))return U.byteLength;if(typeof U!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof U);const C=U.length,J=arguments.length>2&&arguments[2]===!0;if(!J&&C===0)return 0;let se=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return C;case"utf8":case"utf-8":return Fe(U).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C*2;case"hex":return C>>>1;case"base64":return Pe(U).length;default:if(se)return J?-1:Fe(U).length;I=(""+I).toLowerCase(),se=!0}}e.byteLength=H;function Y(U,I,C){let J=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((C===void 0||C>this.length)&&(C=this.length),C<=0)||(C>>>=0,I>>>=0,C<=I))return"";for(U||(U="utf8");;)switch(U){case"hex":return x(this,I,C);case"utf8":case"utf-8":return q(this,I,C);case"ascii":return w(this,I,C);case"latin1":case"binary":return M(this,I,C);case"base64":return R(this,I,C);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return L(this,I,C);default:if(J)throw new TypeError("Unknown encoding: "+U);U=(U+"").toLowerCase(),J=!0}}e.prototype._isBuffer=!0;function ie(U,I,C){const J=U[I];U[I]=U[C],U[C]=J}e.prototype.swap16=function(){const I=this.length;if(I%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let C=0;C<I;C+=2)ie(this,C,C+1);return this},e.prototype.swap32=function(){const I=this.length;if(I%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let C=0;C<I;C+=4)ie(this,C,C+3),ie(this,C+1,C+2);return this},e.prototype.swap64=function(){const I=this.length;if(I%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let C=0;C<I;C+=8)ie(this,C,C+7),ie(this,C+1,C+6),ie(this,C+2,C+5),ie(this,C+3,C+4);return this},e.prototype.toString=function(){const I=this.length;return I===0?"":arguments.length===0?q(this,0,I):Y.apply(this,arguments)},e.prototype.toLocaleString=e.prototype.toString,e.prototype.equals=function(I){if(!e.isBuffer(I))throw new TypeError("Argument must be a Buffer");return this===I?!0:e.compare(this,I)===0},e.prototype.inspect=function(){let I="";const C=s.INSPECT_MAX_BYTES;return I=this.toString("hex",0,C).replace(/(.{2})/g,"$1 ").trim(),this.length>C&&(I+=" ... "),"<Buffer "+I+">"},o&&(e.prototype[o]=e.prototype.inspect),e.prototype.compare=function(I,C,J,se,le){if(ce(I,r)&&(I=e.from(I,I.offset,I.byteLength)),!e.isBuffer(I))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(C===void 0&&(C=0),J===void 0&&(J=I?I.length:0),se===void 0&&(se=0),le===void 0&&(le=this.length),C<0||J>I.length||se<0||le>this.length)throw new RangeError("out of range index");if(se>=le&&C>=J)return 0;if(se>=le)return-1;if(C>=J)return 1;if(C>>>=0,J>>>=0,se>>>=0,le>>>=0,this===I)return 0;let ve=le-se,Ce=J-C;const Le=Math.min(ve,Ce),Ie=this.slice(se,le),je=I.slice(C,J);for(let $e=0;$e<Le;++$e)if(Ie[$e]!==je[$e]){ve=Ie[$e],Ce=je[$e];break}return ve<Ce?-1:Ce<ve?1:0};function ne(U,I,C,J,se){if(U.length===0)return-1;if(typeof C=="string"?(J=C,C=0):C>2147483647?C=2147483647:C<-2147483648&&(C=-2147483648),C=+C,ge(C)&&(C=se?0:U.length-1),C<0&&(C=U.length+C),C>=U.length){if(se)return-1;C=U.length-1}else if(C<0)if(se)C=0;else return-1;if(typeof I=="string"&&(I=e.from(I,J)),e.isBuffer(I))return I.length===0?-1:de(U,I,C,J,se);if(typeof I=="number")return I=I&255,typeof r.prototype.indexOf=="function"?se?r.prototype.indexOf.call(U,I,C):r.prototype.lastIndexOf.call(U,I,C):de(U,[I],C,J,se);throw new TypeError("val must be string, number or Buffer")}function de(U,I,C,J,se){let le=1,ve=U.length,Ce=I.length;if(J!==void 0&&(J=String(J).toLowerCase(),J==="ucs2"||J==="ucs-2"||J==="utf16le"||J==="utf-16le")){if(U.length<2||I.length<2)return-1;le=2,ve/=2,Ce/=2,C/=2}function Le(je,$e){return le===1?je[$e]:je.readUInt16BE($e*le)}let Ie;if(se){let je=-1;for(Ie=C;Ie<ve;Ie++)if(Le(U,Ie)===Le(I,je===-1?0:Ie-je)){if(je===-1&&(je=Ie),Ie-je+1===Ce)return je*le}else je!==-1&&(Ie-=Ie-je),je=-1}else for(C+Ce>ve&&(C=ve-Ce),Ie=C;Ie>=0;Ie--){let je=!0;for(let $e=0;$e<Ce;$e++)if(Le(U,Ie+$e)!==Le(I,$e)){je=!1;break}if(je)return Ie}return-1}e.prototype.includes=function(I,C,J){return this.indexOf(I,C,J)!==-1},e.prototype.indexOf=function(I,C,J){return ne(this,I,C,J,!0)},e.prototype.lastIndexOf=function(I,C,J){return ne(this,I,C,J,!1)};function X(U,I,C,J){C=Number(C)||0;const se=U.length-C;J?(J=Number(J),J>se&&(J=se)):J=se;const le=I.length;J>le/2&&(J=le/2);let ve;for(ve=0;ve<J;++ve){const Ce=parseInt(I.substr(ve*2,2),16);if(ge(Ce))return ve;U[C+ve]=Ce}return ve}function y(U,I,C,J){return oe(Fe(I,U.length-C),U,C,J)}function g(U,I,C,J){return oe(Be(I),U,C,J)}function p(U,I,C,J){return oe(Pe(I),U,C,J)}function _(U,I,C,J){return oe(Me(I,U.length-C),U,C,J)}e.prototype.write=function(I,C,J,se){if(C===void 0)se="utf8",J=this.length,C=0;else if(J===void 0&&typeof C=="string")se=C,J=this.length,C=0;else if(isFinite(C))C=C>>>0,isFinite(J)?(J=J>>>0,se===void 0&&(se="utf8")):(se=J,J=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const le=this.length-C;if((J===void 0||J>le)&&(J=le),I.length>0&&(J<0||C<0)||C>this.length)throw new RangeError("Attempt to write outside buffer bounds");se||(se="utf8");let ve=!1;for(;;)switch(se){case"hex":return X(this,I,C,J);case"utf8":case"utf-8":return y(this,I,C,J);case"ascii":case"latin1":case"binary":return g(this,I,C,J);case"base64":return p(this,I,C,J);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,I,C,J);default:if(ve)throw new TypeError("Unknown encoding: "+se);se=(""+se).toLowerCase(),ve=!0}},e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function R(U,I,C){return I===0&&C===U.length?t.fromByteArray(U):t.fromByteArray(U.slice(I,C))}function q(U,I,C){C=Math.min(U.length,C);const J=[];let se=I;for(;se<C;){const le=U[se];let ve=null,Ce=le>239?4:le>223?3:le>191?2:1;if(se+Ce<=C){let Le,Ie,je,$e;switch(Ce){case 1:le<128&&(ve=le);break;case 2:Le=U[se+1],(Le&192)===128&&($e=(le&31)<<6|Le&63,$e>127&&(ve=$e));break;case 3:Le=U[se+1],Ie=U[se+2],(Le&192)===128&&(Ie&192)===128&&($e=(le&15)<<12|(Le&63)<<6|Ie&63,$e>2047&&($e<55296||$e>57343)&&(ve=$e));break;case 4:Le=U[se+1],Ie=U[se+2],je=U[se+3],(Le&192)===128&&(Ie&192)===128&&(je&192)===128&&($e=(le&15)<<18|(Le&63)<<12|(Ie&63)<<6|je&63,$e>65535&&$e<1114112&&(ve=$e))}}ve===null?(ve=65533,Ce=1):ve>65535&&(ve-=65536,J.push(ve>>>10&1023|55296),ve=56320|ve&1023),J.push(ve),se+=Ce}return A(J)}const T=4096;function A(U){const I=U.length;if(I<=T)return String.fromCharCode.apply(String,U);let C="",J=0;for(;J<I;)C+=String.fromCharCode.apply(String,U.slice(J,J+=T));return C}function w(U,I,C){let J="";C=Math.min(U.length,C);for(let se=I;se<C;++se)J+=String.fromCharCode(U[se]&127);return J}function M(U,I,C){let J="";C=Math.min(U.length,C);for(let se=I;se<C;++se)J+=String.fromCharCode(U[se]);return J}function x(U,I,C){const J=U.length;(!I||I<0)&&(I=0),(!C||C<0||C>J)&&(C=J);let se="";for(let le=I;le<C;++le)se+=we[U[le]];return se}function L(U,I,C){const J=U.slice(I,C);let se="";for(let le=0;le<J.length-1;le+=2)se+=String.fromCharCode(J[le]+J[le+1]*256);return se}e.prototype.slice=function(I,C){const J=this.length;I=~~I,C=C===void 0?J:~~C,I<0?(I+=J,I<0&&(I=0)):I>J&&(I=J),C<0?(C+=J,C<0&&(C=0)):C>J&&(C=J),C<I&&(C=I);const se=this.subarray(I,C);return Object.setPrototypeOf(se,e.prototype),se};function K(U,I,C){if(U%1!==0||U<0)throw new RangeError("offset is not uint");if(U+I>C)throw new RangeError("Trying to access beyond buffer length")}e.prototype.readUintLE=e.prototype.readUIntLE=function(I,C,J){I=I>>>0,C=C>>>0,J||K(I,C,this.length);let se=this[I],le=1,ve=0;for(;++ve<C&&(le*=256);)se+=this[I+ve]*le;return se},e.prototype.readUintBE=e.prototype.readUIntBE=function(I,C,J){I=I>>>0,C=C>>>0,J||K(I,C,this.length);let se=this[I+--C],le=1;for(;C>0&&(le*=256);)se+=this[I+--C]*le;return se},e.prototype.readUint8=e.prototype.readUInt8=function(I,C){return I=I>>>0,C||K(I,1,this.length),this[I]},e.prototype.readUint16LE=e.prototype.readUInt16LE=function(I,C){return I=I>>>0,C||K(I,2,this.length),this[I]|this[I+1]<<8},e.prototype.readUint16BE=e.prototype.readUInt16BE=function(I,C){return I=I>>>0,C||K(I,2,this.length),this[I]<<8|this[I+1]},e.prototype.readUint32LE=e.prototype.readUInt32LE=function(I,C){return I=I>>>0,C||K(I,4,this.length),(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216},e.prototype.readUint32BE=e.prototype.readUInt32BE=function(I,C){return I=I>>>0,C||K(I,4,this.length),this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])},e.prototype.readBigUInt64LE=Se(function(I){I=I>>>0,_e(I,"offset");const C=this[I],J=this[I+7];(C===void 0||J===void 0)&&qe(I,this.length-8);const se=C+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24,le=this[++I]+this[++I]*2**8+this[++I]*2**16+J*2**24;return BigInt(se)+(BigInt(le)<<BigInt(32))}),e.prototype.readBigUInt64BE=Se(function(I){I=I>>>0,_e(I,"offset");const C=this[I],J=this[I+7];(C===void 0||J===void 0)&&qe(I,this.length-8);const se=C*2**24+this[++I]*2**16+this[++I]*2**8+this[++I],le=this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+J;return(BigInt(se)<<BigInt(32))+BigInt(le)}),e.prototype.readIntLE=function(I,C,J){I=I>>>0,C=C>>>0,J||K(I,C,this.length);let se=this[I],le=1,ve=0;for(;++ve<C&&(le*=256);)se+=this[I+ve]*le;return le*=128,se>=le&&(se-=Math.pow(2,8*C)),se},e.prototype.readIntBE=function(I,C,J){I=I>>>0,C=C>>>0,J||K(I,C,this.length);let se=C,le=1,ve=this[I+--se];for(;se>0&&(le*=256);)ve+=this[I+--se]*le;return le*=128,ve>=le&&(ve-=Math.pow(2,8*C)),ve},e.prototype.readInt8=function(I,C){return I=I>>>0,C||K(I,1,this.length),this[I]&128?(255-this[I]+1)*-1:this[I]},e.prototype.readInt16LE=function(I,C){I=I>>>0,C||K(I,2,this.length);const J=this[I]|this[I+1]<<8;return J&32768?J|4294901760:J},e.prototype.readInt16BE=function(I,C){I=I>>>0,C||K(I,2,this.length);const J=this[I+1]|this[I]<<8;return J&32768?J|4294901760:J},e.prototype.readInt32LE=function(I,C){return I=I>>>0,C||K(I,4,this.length),this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24},e.prototype.readInt32BE=function(I,C){return I=I>>>0,C||K(I,4,this.length),this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]},e.prototype.readBigInt64LE=Se(function(I){I=I>>>0,_e(I,"offset");const C=this[I],J=this[I+7];(C===void 0||J===void 0)&&qe(I,this.length-8);const se=this[I+4]+this[I+5]*2**8+this[I+6]*2**16+(J<<24);return(BigInt(se)<<BigInt(32))+BigInt(C+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24)}),e.prototype.readBigInt64BE=Se(function(I){I=I>>>0,_e(I,"offset");const C=this[I],J=this[I+7];(C===void 0||J===void 0)&&qe(I,this.length-8);const se=(C<<24)+this[++I]*2**16+this[++I]*2**8+this[++I];return(BigInt(se)<<BigInt(32))+BigInt(this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+J)}),e.prototype.readFloatLE=function(I,C){return I=I>>>0,C||K(I,4,this.length),f.read(this,I,!0,23,4)},e.prototype.readFloatBE=function(I,C){return I=I>>>0,C||K(I,4,this.length),f.read(this,I,!1,23,4)},e.prototype.readDoubleLE=function(I,C){return I=I>>>0,C||K(I,8,this.length),f.read(this,I,!0,52,8)},e.prototype.readDoubleBE=function(I,C){return I=I>>>0,C||K(I,8,this.length),f.read(this,I,!1,52,8)};function Q(U,I,C,J,se,le){if(!e.isBuffer(U))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>se||I<le)throw new RangeError('"value" argument is out of bounds');if(C+J>U.length)throw new RangeError("Index out of range")}e.prototype.writeUintLE=e.prototype.writeUIntLE=function(I,C,J,se){if(I=+I,C=C>>>0,J=J>>>0,!se){const Ce=Math.pow(2,8*J)-1;Q(this,I,C,J,Ce,0)}let le=1,ve=0;for(this[C]=I&255;++ve<J&&(le*=256);)this[C+ve]=I/le&255;return C+J},e.prototype.writeUintBE=e.prototype.writeUIntBE=function(I,C,J,se){if(I=+I,C=C>>>0,J=J>>>0,!se){const Ce=Math.pow(2,8*J)-1;Q(this,I,C,J,Ce,0)}let le=J-1,ve=1;for(this[C+le]=I&255;--le>=0&&(ve*=256);)this[C+le]=I/ve&255;return C+J},e.prototype.writeUint8=e.prototype.writeUInt8=function(I,C,J){return I=+I,C=C>>>0,J||Q(this,I,C,1,255,0),this[C]=I&255,C+1},e.prototype.writeUint16LE=e.prototype.writeUInt16LE=function(I,C,J){return I=+I,C=C>>>0,J||Q(this,I,C,2,65535,0),this[C]=I&255,this[C+1]=I>>>8,C+2},e.prototype.writeUint16BE=e.prototype.writeUInt16BE=function(I,C,J){return I=+I,C=C>>>0,J||Q(this,I,C,2,65535,0),this[C]=I>>>8,this[C+1]=I&255,C+2},e.prototype.writeUint32LE=e.prototype.writeUInt32LE=function(I,C,J){return I=+I,C=C>>>0,J||Q(this,I,C,4,4294967295,0),this[C+3]=I>>>24,this[C+2]=I>>>16,this[C+1]=I>>>8,this[C]=I&255,C+4},e.prototype.writeUint32BE=e.prototype.writeUInt32BE=function(I,C,J){return I=+I,C=C>>>0,J||Q(this,I,C,4,4294967295,0),this[C]=I>>>24,this[C+1]=I>>>16,this[C+2]=I>>>8,this[C+3]=I&255,C+4};function j(U,I,C,J,se){xe(I,J,se,U,C,7);let le=Number(I&BigInt(4294967295));U[C++]=le,le=le>>8,U[C++]=le,le=le>>8,U[C++]=le,le=le>>8,U[C++]=le;let ve=Number(I>>BigInt(32)&BigInt(4294967295));return U[C++]=ve,ve=ve>>8,U[C++]=ve,ve=ve>>8,U[C++]=ve,ve=ve>>8,U[C++]=ve,C}function N(U,I,C,J,se){xe(I,J,se,U,C,7);let le=Number(I&BigInt(4294967295));U[C+7]=le,le=le>>8,U[C+6]=le,le=le>>8,U[C+5]=le,le=le>>8,U[C+4]=le;let ve=Number(I>>BigInt(32)&BigInt(4294967295));return U[C+3]=ve,ve=ve>>8,U[C+2]=ve,ve=ve>>8,U[C+1]=ve,ve=ve>>8,U[C]=ve,C+8}e.prototype.writeBigUInt64LE=Se(function(I,C=0){return j(this,I,C,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeBigUInt64BE=Se(function(I,C=0){return N(this,I,C,BigInt(0),BigInt("0xffffffffffffffff"))}),e.prototype.writeIntLE=function(I,C,J,se){if(I=+I,C=C>>>0,!se){const Le=Math.pow(2,8*J-1);Q(this,I,C,J,Le-1,-Le)}let le=0,ve=1,Ce=0;for(this[C]=I&255;++le<J&&(ve*=256);)I<0&&Ce===0&&this[C+le-1]!==0&&(Ce=1),this[C+le]=(I/ve>>0)-Ce&255;return C+J},e.prototype.writeIntBE=function(I,C,J,se){if(I=+I,C=C>>>0,!se){const Le=Math.pow(2,8*J-1);Q(this,I,C,J,Le-1,-Le)}let le=J-1,ve=1,Ce=0;for(this[C+le]=I&255;--le>=0&&(ve*=256);)I<0&&Ce===0&&this[C+le+1]!==0&&(Ce=1),this[C+le]=(I/ve>>0)-Ce&255;return C+J},e.prototype.writeInt8=function(I,C,J){return I=+I,C=C>>>0,J||Q(this,I,C,1,127,-128),I<0&&(I=255+I+1),this[C]=I&255,C+1},e.prototype.writeInt16LE=function(I,C,J){return I=+I,C=C>>>0,J||Q(this,I,C,2,32767,-32768),this[C]=I&255,this[C+1]=I>>>8,C+2},e.prototype.writeInt16BE=function(I,C,J){return I=+I,C=C>>>0,J||Q(this,I,C,2,32767,-32768),this[C]=I>>>8,this[C+1]=I&255,C+2},e.prototype.writeInt32LE=function(I,C,J){return I=+I,C=C>>>0,J||Q(this,I,C,4,2147483647,-2147483648),this[C]=I&255,this[C+1]=I>>>8,this[C+2]=I>>>16,this[C+3]=I>>>24,C+4},e.prototype.writeInt32BE=function(I,C,J){return I=+I,C=C>>>0,J||Q(this,I,C,4,2147483647,-2147483648),I<0&&(I=4294967295+I+1),this[C]=I>>>24,this[C+1]=I>>>16,this[C+2]=I>>>8,this[C+3]=I&255,C+4},e.prototype.writeBigInt64LE=Se(function(I,C=0){return j(this,I,C,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),e.prototype.writeBigInt64BE=Se(function(I,C=0){return N(this,I,C,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function F(U,I,C,J,se,le){if(C+J>U.length)throw new RangeError("Index out of range");if(C<0)throw new RangeError("Index out of range")}function ee(U,I,C,J,se){return I=+I,C=C>>>0,se||F(U,I,C,4),f.write(U,I,C,J,23,4),C+4}e.prototype.writeFloatLE=function(I,C,J){return ee(this,I,C,!0,J)},e.prototype.writeFloatBE=function(I,C,J){return ee(this,I,C,!1,J)};function ae(U,I,C,J,se){return I=+I,C=C>>>0,se||F(U,I,C,8),f.write(U,I,C,J,52,8),C+8}e.prototype.writeDoubleLE=function(I,C,J){return ae(this,I,C,!0,J)},e.prototype.writeDoubleBE=function(I,C,J){return ae(this,I,C,!1,J)},e.prototype.copy=function(I,C,J,se){if(!e.isBuffer(I))throw new TypeError("argument should be a Buffer");if(J||(J=0),!se&&se!==0&&(se=this.length),C>=I.length&&(C=I.length),C||(C=0),se>0&&se<J&&(se=J),se===J||I.length===0||this.length===0)return 0;if(C<0)throw new RangeError("targetStart out of bounds");if(J<0||J>=this.length)throw new RangeError("Index out of range");if(se<0)throw new RangeError("sourceEnd out of bounds");se>this.length&&(se=this.length),I.length-C<se-J&&(se=I.length-C+J);const le=se-J;return this===I&&typeof r.prototype.copyWithin=="function"?this.copyWithin(C,J,se):r.prototype.set.call(I,this.subarray(J,se),C),le},e.prototype.fill=function(I,C,J,se){if(typeof I=="string"){if(typeof C=="string"?(se=C,C=0,J=this.length):typeof J=="string"&&(se=J,J=this.length),se!==void 0&&typeof se!="string")throw new TypeError("encoding must be a string");if(typeof se=="string"&&!e.isEncoding(se))throw new TypeError("Unknown encoding: "+se);if(I.length===1){const ve=I.charCodeAt(0);(se==="utf8"&&ve<128||se==="latin1")&&(I=ve)}}else typeof I=="number"?I=I&255:typeof I=="boolean"&&(I=Number(I));if(C<0||this.length<C||this.length<J)throw new RangeError("Out of range index");if(J<=C)return this;C=C>>>0,J=J===void 0?this.length:J>>>0,I||(I=0);let le;if(typeof I=="number")for(le=C;le<J;++le)this[le]=I;else{const ve=e.isBuffer(I)?I:e.from(I,se),Ce=ve.length;if(Ce===0)throw new TypeError('The value "'+I+'" is invalid for argument "value"');for(le=0;le<J-C;++le)this[le+C]=ve[le%Ce]}return this};const G={};function z(U,I,C){G[U]=class extends C{constructor(){super(),Object.defineProperty(this,"message",{value:I.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${U}]`,this.stack,delete this.name}get code(){return U}set code(se){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:se,writable:!0})}toString(){return`${this.name} [${U}]: ${this.message}`}}}z("ERR_BUFFER_OUT_OF_BOUNDS",function(U){return U?`${U} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),z("ERR_INVALID_ARG_TYPE",function(U,I){return`The "${U}" argument must be of type number. Received type ${typeof I}`},TypeError),z("ERR_OUT_OF_RANGE",function(U,I,C){let J=`The value of "${U}" is out of range.`,se=C;return Number.isInteger(C)&&Math.abs(C)>2**32?se=fe(String(C)):typeof C=="bigint"&&(se=String(C),(C>BigInt(2)**BigInt(32)||C<-(BigInt(2)**BigInt(32)))&&(se=fe(se)),se+="n"),J+=` It must be ${I}. Received ${se}`,J},RangeError);function fe(U){let I="",C=U.length;const J=U[0]==="-"?1:0;for(;C>=J+4;C-=3)I=`_${U.slice(C-3,C)}${I}`;return`${U.slice(0,C)}${I}`}function me(U,I,C){_e(I,"offset"),(U[I]===void 0||U[I+C]===void 0)&&qe(I,U.length-(C+1))}function xe(U,I,C,J,se,le){if(U>C||U<I){const ve=typeof I=="bigint"?"n":"";let Ce;throw I===0||I===BigInt(0)?Ce=`>= 0${ve} and < 2${ve} ** ${(le+1)*8}${ve}`:Ce=`>= -(2${ve} ** ${(le+1)*8-1}${ve}) and < 2 ** ${(le+1)*8-1}${ve}`,new G.ERR_OUT_OF_RANGE("value",Ce,U)}me(J,se,le)}function _e(U,I){if(typeof U!="number")throw new G.ERR_INVALID_ARG_TYPE(I,"number",U)}function qe(U,I,C){throw Math.floor(U)!==U?(_e(U,C),new G.ERR_OUT_OF_RANGE("offset","an integer",U)):I<0?new G.ERR_BUFFER_OUT_OF_BOUNDS:new G.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${I}`,U)}const Re=/[^+/0-9A-Za-z-_]/g;function be(U){if(U=U.split("=")[0],U=U.trim().replace(Re,""),U.length<2)return"";for(;U.length%4!==0;)U=U+"=";return U}function Fe(U,I){I=I||1/0;let C;const J=U.length;let se=null;const le=[];for(let ve=0;ve<J;++ve){if(C=U.charCodeAt(ve),C>55295&&C<57344){if(!se){if(C>56319){(I-=3)>-1&&le.push(239,191,189);continue}else if(ve+1===J){(I-=3)>-1&&le.push(239,191,189);continue}se=C;continue}if(C<56320){(I-=3)>-1&&le.push(239,191,189),se=C;continue}C=(se-55296<<10|C-56320)+65536}else se&&(I-=3)>-1&&le.push(239,191,189);if(se=null,C<128){if((I-=1)<0)break;le.push(C)}else if(C<2048){if((I-=2)<0)break;le.push(C>>6|192,C&63|128)}else if(C<65536){if((I-=3)<0)break;le.push(C>>12|224,C>>6&63|128,C&63|128)}else if(C<1114112){if((I-=4)<0)break;le.push(C>>18|240,C>>12&63|128,C>>6&63|128,C&63|128)}else throw new Error("Invalid code point")}return le}function Be(U){const I=[];for(let C=0;C<U.length;++C)I.push(U.charCodeAt(C)&255);return I}function Me(U,I){let C,J,se;const le=[];for(let ve=0;ve<U.length&&!((I-=2)<0);++ve)C=U.charCodeAt(ve),J=C>>8,se=C%256,le.push(se),le.push(J);return le}function Pe(U){return t.toByteArray(be(U))}function oe(U,I,C,J){let se;for(se=0;se<J&&!(se+C>=I.length||se>=U.length);++se)I[se+C]=U[se];return se}function ce(U,I){return U instanceof I||U!=null&&U.constructor!=null&&U.constructor.name!=null&&U.constructor.name===I.name}function ge(U){return U!==U}const we=(function(){const U="0123456789abcdef",I=new Array(256);for(let C=0;C<16;++C){const J=C*16;for(let se=0;se<16;++se)I[J+se]=U[C]+U[se]}return I})();function Se(U){return typeof BigInt>"u"?Oe:U}function Oe(){throw new Error("BigInt not supported")}})(buffer$1);const Buffer=buffer$1.Buffer,RSA_PKCS1_PADDING=1,RSA_NO_PADDING=3,RSA_PKCS1_OAEP_PADDING=4,require$$0$1={RSA_PKCS1_PADDING,RSA_NO_PADDING,RSA_PKCS1_OAEP_PADDING};var rsa={};function getDefaultExportFromCjs(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var browser$c={exports:{}},process=browser$c.exports={},cachedSetTimeout,cachedClearTimeout;function defaultSetTimout(){throw new Error("setTimeout has not been defined")}function defaultClearTimeout(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cachedSetTimeout=setTimeout:cachedSetTimeout=defaultSetTimout}catch{cachedSetTimeout=defaultSetTimout}try{typeof clearTimeout=="function"?cachedClearTimeout=clearTimeout:cachedClearTimeout=defaultClearTimeout}catch{cachedClearTimeout=defaultClearTimeout}})();function runTimeout(s){if(cachedSetTimeout===setTimeout)return setTimeout(s,0);if((cachedSetTimeout===defaultSetTimout||!cachedSetTimeout)&&setTimeout)return cachedSetTimeout=setTimeout,setTimeout(s,0);try{return cachedSetTimeout(s,0)}catch{try{return cachedSetTimeout.call(null,s,0)}catch{return cachedSetTimeout.call(this,s,0)}}}function runClearTimeout(s){if(cachedClearTimeout===clearTimeout)return clearTimeout(s);if((cachedClearTimeout===defaultClearTimeout||!cachedClearTimeout)&&clearTimeout)return cachedClearTimeout=clearTimeout,clearTimeout(s);try{return cachedClearTimeout(s)}catch{try{return cachedClearTimeout.call(null,s)}catch{return cachedClearTimeout.call(this,s)}}}var queue=[],draining=!1,currentQueue,queueIndex=-1;function cleanUpNextTick(){!draining||!currentQueue||(draining=!1,currentQueue.length?queue=currentQueue.concat(queue):queueIndex=-1,queue.length&&drainQueue())}function drainQueue(){if(!draining){var s=runTimeout(cleanUpNextTick);draining=!0;for(var t=queue.length;t;){for(currentQueue=queue,queue=[];++queueIndex<t;)currentQueue&¤tQueue[queueIndex].run();queueIndex=-1,t=queue.length}currentQueue=null,draining=!1,runClearTimeout(s)}}process.nextTick=function(s){var t=new Array(arguments.length-1);if(arguments.length>1)for(var f=1;f<arguments.length;f++)t[f-1]=arguments[f];queue.push(new Item(s,t)),queue.length===1&&!draining&&runTimeout(drainQueue)};function Item(s,t){this.fun=s,this.array=t}Item.prototype.run=function(){this.fun.apply(null,this.array)};process.title="browser";process.browser=!0;process.env={};process.argv=[];process.version="";process.versions={};function noop(){}process.on=noop;process.addListener=noop;process.once=noop;process.off=noop;process.removeListener=noop;process.removeAllListeners=noop;process.emit=noop;process.prependListener=noop;process.prependOnceListener=noop;process.listeners=function(s){return[]};process.binding=function(s){throw new Error("process.binding is not supported")};process.cwd=function(){return"/"};process.chdir=function(s){throw new Error("process.chdir is not supported")};process.umask=function(){return 0};var browserExports=browser$c.exports;const process$1=getDefaultExportFromCjs(browserExports);var utils$4={},cryptoBrowserify={},browser$b={exports:{}},safeBuffer$1={exports:{}},dist={},hasRequiredDist;function requireDist(){return hasRequiredDist||(hasRequiredDist=1,(function(s){Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});var t={},f={};f.byteLength=e,f.toByteArray=l,f.fromByteArray=m;for(var o=[],d=[],r=typeof Uint8Array<"u"?Uint8Array:Array,h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,n=h.length;c<n;++c)o[c]=h[c],d[h.charCodeAt(c)]=c;d[45]=62,d[95]=63;function a(S){var O=S.length;if(O%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var D=S.indexOf("=");D===-1&&(D=O);var $=D===O?0:4-D%4;return[D,$]}function e(S){var O=a(S),D=O[0],$=O[1];return(D+$)*3/4-$}function u(S,O,D){return(O+D)*3/4-D}function l(S){var O,D=a(S),$=D[0],H=D[1],Y=new r(u(S,$,H)),ie=0,ne=H>0?$-4:$,de;for(de=0;de<ne;de+=4)O=d[S.charCodeAt(de)]<<18|d[S.charCodeAt(de+1)]<<12|d[S.charCodeAt(de+2)]<<6|d[S.charCodeAt(de+3)],Y[ie++]=O>>16&255,Y[ie++]=O>>8&255,Y[ie++]=O&255;return H===2&&(O=d[S.charCodeAt(de)]<<2|d[S.charCodeAt(de+1)]>>4,Y[ie++]=O&255),H===1&&(O=d[S.charCodeAt(de)]<<10|d[S.charCodeAt(de+1)]<<4|d[S.charCodeAt(de+2)]>>2,Y[ie++]=O>>8&255,Y[ie++]=O&255),Y}function v(S){return o[S>>18&63]+o[S>>12&63]+o[S>>6&63]+o[S&63]}function b(S,O,D){for(var $,H=[],Y=O;Y<D;Y+=3)$=(S[Y]<<16&16711680)+(S[Y+1]<<8&65280)+(S[Y+2]&255),H.push(v($));return H.join("")}function m(S){for(var O,D=S.length,$=D%3,H=[],Y=16383,ie=0,ne=D-$;ie<ne;ie+=Y)H.push(b(S,ie,ie+Y>ne?ne:ie+Y));return $===1?(O=S[D-1],H.push(o[O>>2]+o[O<<4&63]+"==")):$===2&&(O=(S[D-2]<<8)+S[D-1],H.push(o[O>>10]+o[O>>4&63]+o[O<<2&63]+"=")),H.join("")}var B={};B.read=function(S,O,D,$,H){var Y,ie,ne=H*8-$-1,de=(1<<ne)-1,X=de>>1,y=-7,g=D?H-1:0,p=D?-1:1,_=S[O+g];for(g+=p,Y=_&(1<<-y)-1,_>>=-y,y+=ne;y>0;Y=Y*256+S[O+g],g+=p,y-=8);for(ie=Y&(1<<-y)-1,Y>>=-y,y+=$;y>0;ie=ie*256+S[O+g],g+=p,y-=8);if(Y===0)Y=1-X;else{if(Y===de)return ie?NaN:(_?-1:1)*(1/0);ie=ie+Math.pow(2,$),Y=Y-X}return(_?-1:1)*ie*Math.pow(2,Y-$)},B.write=function(S,O,D,$,H,Y){var ie,ne,de,X=Y*8-H-1,y=(1<<X)-1,g=y>>1,p=H===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=$?0:Y-1,R=$?1:-1,q=O<0||O===0&&1/O<0?1:0;for(O=Math.abs(O),isNaN(O)||O===1/0?(ne=isNaN(O)?1:0,ie=y):(ie=Math.floor(Math.log(O)/Math.LN2),O*(de=Math.pow(2,-ie))<1&&(ie--,de*=2),ie+g>=1?O+=p/de:O+=p*Math.pow(2,1-g),O*de>=2&&(ie++,de/=2),ie+g>=y?(ne=0,ie=y):ie+g>=1?(ne=(O*de-1)*Math.pow(2,H),ie=ie+g):(ne=O*Math.pow(2,g-1)*Math.pow(2,H),ie=0));H>=8;S[D+_]=ne&255,_+=R,ne/=256,H-=8);for(ie=ie<<H|ne,X+=H;X>0;S[D+_]=ie&255,_+=R,ie/=256,X-=8);S[D+_-R]|=q*128};(function(S){const O=f,D=B,$=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;S.Buffer=y,S.SlowBuffer=L,S.INSPECT_MAX_BYTES=50;const H=2147483647;S.kMaxLength=H;const{Uint8Array:Y,ArrayBuffer:ie,SharedArrayBuffer:ne}=globalThis;y.TYPED_ARRAY_SUPPORT=de(),!y.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&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.");function de(){try{const W=new Y(1),P={foo:function(){return 42}};return Object.setPrototypeOf(P,Y.prototype),Object.setPrototypeOf(W,P),W.foo()===42}catch{return!1}}Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.buffer}}),Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.byteOffset}});function X(W){if(W>H)throw new RangeError('The value "'+W+'" is invalid for option "size"');const P=new Y(W);return Object.setPrototypeOf(P,y.prototype),P}function y(W,P,k){if(typeof W=="number"){if(typeof P=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return R(W)}return g(W,P,k)}y.poolSize=8192;function g(W,P,k){if(typeof W=="string")return q(W,P);if(ie.isView(W))return A(W);if(W==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof W);if(Ke(W,ie)||W&&Ke(W.buffer,ie)||typeof ne<"u"&&(Ke(W,ne)||W&&Ke(W.buffer,ne)))return w(W,P,k);if(typeof W=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const re=W.valueOf&&W.valueOf();if(re!=null&&re!==W)return y.from(re,P,k);const ue=M(W);if(ue)return ue;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof W[Symbol.toPrimitive]=="function")return y.from(W[Symbol.toPrimitive]("string"),P,k);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof W)}y.from=function(W,P,k){return g(W,P,k)},Object.setPrototypeOf(y.prototype,Y.prototype),Object.setPrototypeOf(y,Y);function p(W){if(typeof W!="number")throw new TypeError('"size" argument must be of type number');if(W<0)throw new RangeError('The value "'+W+'" is invalid for option "size"')}function _(W,P,k){return p(W),W<=0?X(W):P!==void 0?typeof k=="string"?X(W).fill(P,k):X(W).fill(P):X(W)}y.alloc=function(W,P,k){return _(W,P,k)};function R(W){return p(W),X(W<0?0:x(W)|0)}y.allocUnsafe=function(W){return R(W)},y.allocUnsafeSlow=function(W){return R(W)};function q(W,P){if((typeof P!="string"||P==="")&&(P="utf8"),!y.isEncoding(P))throw new TypeError("Unknown encoding: "+P);const k=K(W,P)|0;let re=X(k);const ue=re.write(W,P);return ue!==k&&(re=re.slice(0,ue)),re}function T(W){const P=W.length<0?0:x(W.length)|0,k=X(P);for(let re=0;re<P;re+=1)k[re]=W[re]&255;return k}function A(W){if(Ke(W,Y)){const P=new Y(W);return w(P.buffer,P.byteOffset,P.byteLength)}return T(W)}function w(W,P,k){if(P<0||W.byteLength<P)throw new RangeError('"offset" is outside of buffer bounds');if(W.byteLength<P+(k||0))throw new RangeError('"length" is outside of buffer bounds');let re;return P===void 0&&k===void 0?re=new Y(W):k===void 0?re=new Y(W,P):re=new Y(W,P,k),Object.setPrototypeOf(re,y.prototype),re}function M(W){if(y.isBuffer(W)){const P=x(W.length)|0,k=X(P);return k.length===0||W.copy(k,0,0,P),k}if(W.length!==void 0)return typeof W.length!="number"||Xe(W.length)?X(0):T(W);if(W.type==="Buffer"&&Array.isArray(W.data))return T(W.data)}function x(W){if(W>=H)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+H.toString(16)+" bytes");return W|0}function L(W){return+W!=W&&(W=0),y.alloc(+W)}y.isBuffer=function(P){return P!=null&&P._isBuffer===!0&&P!==y.prototype},y.compare=function(P,k){if(Ke(P,Y)&&(P=y.from(P,P.offset,P.byteLength)),Ke(k,Y)&&(k=y.from(k,k.offset,k.byteLength)),!y.isBuffer(P)||!y.isBuffer(k))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(P===k)return 0;let re=P.length,ue=k.length;for(let pe=0,ye=Math.min(re,ue);pe<ye;++pe)if(P[pe]!==k[pe]){re=P[pe],ue=k[pe];break}return re<ue?-1:ue<re?1:0},y.isEncoding=function(P){switch(String(P).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}},y.concat=function(P,k){if(!Array.isArray(P))throw new TypeError('"list" argument must be an Array of Buffers');if(P.length===0)return y.alloc(0);let re;if(k===void 0)for(k=0,re=0;re<P.length;++re)k+=P[re].length;const ue=y.allocUnsafe(k);let pe=0;for(re=0;re<P.length;++re){let ye=P[re];if(Ke(ye,Y))pe+ye.length>ue.length?(y.isBuffer(ye)||(ye=y.from(ye)),ye.copy(ue,pe)):Y.prototype.set.call(ue,ye,pe);else if(y.isBuffer(ye))ye.copy(ue,pe);else throw new TypeError('"list" argument must be an Array of Buffers');pe+=ye.length}return ue};function K(W,P){if(y.isBuffer(W))return W.length;if(ie.isView(W)||Ke(W,ie))return W.byteLength;if(typeof W!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof W);const k=W.length,re=arguments.length>2&&arguments[2]===!0;if(!re&&k===0)return 0;let ue=!1;for(;;)switch(P){case"ascii":case"latin1":case"binary":return k;case"utf8":case"utf-8":return Le(W).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k*2;case"hex":return k>>>1;case"base64":return $e(W).length;default:if(ue)return re?-1:Le(W).length;P=(""+P).toLowerCase(),ue=!0}}y.byteLength=K;function Q(W,P,k){let re=!1;if((P===void 0||P<0)&&(P=0),P>this.length||((k===void 0||k>this.length)&&(k=this.length),k<=0)||(k>>>=0,P>>>=0,k<=P))return"";for(W||(W="utf8");;)switch(W){case"hex":return Fe(this,P,k);case"utf8":case"utf-8":return xe(this,P,k);case"ascii":return Re(this,P,k);case"latin1":case"binary":return be(this,P,k);case"base64":return me(this,P,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Be(this,P,k);default:if(re)throw new TypeError("Unknown encoding: "+W);W=(W+"").toLowerCase(),re=!0}}y.prototype._isBuffer=!0;function j(W,P,k){const re=W[P];W[P]=W[k],W[k]=re}y.prototype.swap16=function(){const P=this.length;if(P%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let k=0;k<P;k+=2)j(this,k,k+1);return this},y.prototype.swap32=function(){const P=this.length;if(P%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let k=0;k<P;k+=4)j(this,k,k+3),j(this,k+1,k+2);return this},y.prototype.swap64=function(){const P=this.length;if(P%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let k=0;k<P;k+=8)j(this,k,k+7),j(this,k+1,k+6),j(this,k+2,k+5),j(this,k+3,k+4);return this},y.prototype.toString=function(){const P=this.length;return P===0?"":arguments.length===0?xe(this,0,P):Q.apply(this,arguments)},y.prototype.toLocaleString=y.prototype.toString,y.prototype.equals=function(P){if(!y.isBuffer(P))throw new TypeError("Argument must be a Buffer");return this===P?!0:y.compare(this,P)===0},y.prototype.inspect=function(){let P="";const k=S.INSPECT_MAX_BYTES;return P=this.toString("hex",0,k).replace(/(.{2})/g,"$1 ").trim(),this.length>k&&(P+=" ... "),"<Buffer "+P+">"},$&&(y.prototype[$]=y.prototype.inspect),y.prototype.compare=function(P,k,re,ue,pe){if(Ke(P,Y)&&(P=y.from(P,P.offset,P.byteLength)),!y.isBuffer(P))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof P);if(k===void 0&&(k=0),re===void 0&&(re=P?P.length:0),ue===void 0&&(ue=0),pe===void 0&&(pe=this.length),k<0||re>P.length||ue<0||pe>this.length)throw new RangeError("out of range index");if(ue>=pe&&k>=re)return 0;if(ue>=pe)return-1;if(k>=re)return 1;if(k>>>=0,re>>>=0,ue>>>=0,pe>>>=0,this===P)return 0;let ye=pe-ue,ke=re-k;const He=Math.min(ye,ke),Ne=this.slice(ue,pe),ze=P.slice(k,re);for(let Ue=0;Ue<He;++Ue)if(Ne[Ue]!==ze[Ue]){ye=Ne[Ue],ke=ze[Ue];break}return ye<ke?-1:ke<ye?1:0};function N(W,P,k,re,ue){if(W.length===0)return-1;if(typeof k=="string"?(re=k,k=0):k>2147483647?k=2147483647:k<-2147483648&&(k=-2147483648),k=+k,Xe(k)&&(k=ue?0:W.length-1),k<0&&(k=W.length+k),k>=W.length){if(ue)return-1;k=W.length-1}else if(k<0)if(ue)k=0;else return-1;if(typeof P=="string"&&(P=y.from(P,re)),y.isBuffer(P))return P.length===0?-1:F(W,P,k,re,ue);if(typeof P=="number")return P=P&255,typeof Y.prototype.indexOf=="function"?ue?Y.prototype.indexOf.call(W,P,k):Y.prototype.lastIndexOf.call(W,P,k):F(W,[P],k,re,ue);throw new TypeError("val must be string, number or Buffer")}function F(W,P,k,re,ue){let pe=1,ye=W.length,ke=P.length;if(re!==void 0&&(re=String(re).toLowerCase(),re==="ucs2"||re==="ucs-2"||re==="utf16le"||re==="utf-16le")){if(W.length<2||P.length<2)return-1;pe=2,ye/=2,ke/=2,k/=2}function He(ze,Ue){return pe===1?ze[Ue]:ze.readUInt16BE(Ue*pe)}let Ne;if(ue){let ze=-1;for(Ne=k;Ne<ye;Ne++)if(He(W,Ne)===He(P,ze===-1?0:Ne-ze)){if(ze===-1&&(ze=Ne),Ne-ze+1===ke)return ze*pe}else ze!==-1&&(Ne-=Ne-ze),ze=-1}else for(k+ke>ye&&(k=ye-ke),Ne=k;Ne>=0;Ne--){let ze=!0;for(let Ue=0;Ue<ke;Ue++)if(He(W,Ne+Ue)!==He(P,Ue)){ze=!1;break}if(ze)return Ne}return-1}y.prototype.includes=function(P,k,re){return this.indexOf(P,k,re)!==-1},y.prototype.indexOf=function(P,k,re){return N(this,P,k,re,!0)},y.prototype.lastIndexOf=function(P,k,re){return N(this,P,k,re,!1)};function ee(W,P,k,re){k=Number(k)||0;const ue=W.length-k;re?(re=Number(re),re>ue&&(re=ue)):re=ue;const pe=P.length;re>pe/2&&(re=pe/2);let ye;for(ye=0;ye<re;++ye){const ke=parseInt(P.substr(ye*2,2),16);if(Xe(ke))return ye;W[k+ye]=ke}return ye}function ae(W,P,k,re){return Ve(Le(P,W.length-k),W,k,re)}function G(W,P,k,re){return Ve(Ie(P),W,k,re)}function z(W,P,k,re){return Ve($e(P),W,k,re)}function fe(W,P,k,re){return Ve(je(P,W.length-k),W,k,re)}y.prototype.write=function(P,k,re,ue){if(k===void 0)ue="utf8",re=this.length,k=0;else if(re===void 0&&typeof k=="string")ue=k,re=this.length,k=0;else if(isFinite(k))k=k>>>0,isFinite(re)?(re=re>>>0,ue===void 0&&(ue="utf8")):(ue=re,re=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const pe=this.length-k;if((re===void 0||re>pe)&&(re=pe),P.length>0&&(re<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");ue||(ue="utf8");let ye=!1;for(;;)switch(ue){case"hex":return ee(this,P,k,re);case"utf8":case"utf-8":return ae(this,P,k,re);case"ascii":case"latin1":case"binary":return G(this,P,k,re);case"base64":return z(this,P,k,re);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fe(this,P,k,re);default:if(ye)throw new TypeError("Unknown encoding: "+ue);ue=(""+ue).toLowerCase(),ye=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function me(W,P,k){return P===0&&k===W.length?O.fromByteArray(W):O.fromByteArray(W.slice(P,k))}function xe(W,P,k){k=Math.min(W.length,k);const re=[];let ue=P;for(;ue<k;){const pe=W[ue];let ye=null,ke=pe>239?4:pe>223?3:pe>191?2:1;if(ue+ke<=k){let He,Ne,ze,Ue;switch(ke){case 1:pe<128&&(ye=pe);break;case 2:He=W[ue+1],(He&192)===128&&(Ue=(pe&31)<<6|He&63,Ue>127&&(ye=Ue));break;case 3:He=W[ue+1],Ne=W[ue+2],(He&192)===128&&(Ne&192)===128&&(Ue=(pe&15)<<12|(He&63)<<6|Ne&63,Ue>2047&&(Ue<55296||Ue>57343)&&(ye=Ue));break;case 4:He=W[ue+1],Ne=W[ue+2],ze=W[ue+3],(He&192)===128&&(Ne&192)===128&&(ze&192)===128&&(Ue=(pe&15)<<18|(He&63)<<12|(Ne&63)<<6|ze&63,Ue>65535&&Ue<1114112&&(ye=Ue))}}ye===null?(ye=65533,ke=1):ye>65535&&(ye-=65536,re.push(ye>>>10&1023|55296),ye=56320|ye&1023),re.push(ye),ue+=ke}return qe(re)}const _e=4096;function qe(W){const P=W.length;if(P<=_e)return String.fromCharCode.apply(String,W);let k="",re=0;for(;re<P;)k+=String.fromCharCode.apply(String,W.slice(re,re+=_e));return k}function Re(W,P,k){let re="";k=Math.min(W.length,k);for(let ue=P;ue<k;++ue)re+=String.fromCharCode(W[ue]&127);return re}function be(W,P,k){let re="";k=Math.min(W.length,k);for(let ue=P;ue<k;++ue)re+=String.fromCharCode(W[ue]);return re}function Fe(W,P,k){const re=W.length;(!P||P<0)&&(P=0),(!k||k<0||k>re)&&(k=re);let ue="";for(let pe=P;pe<k;++pe)ue+=We[W[pe]];return ue}function Be(W,P,k){const re=W.slice(P,k);let ue="";for(let pe=0;pe<re.length-1;pe+=2)ue+=String.fromCharCode(re[pe]+re[pe+1]*256);return ue}y.prototype.slice=function(P,k){const re=this.length;P=~~P,k=k===void 0?re:~~k,P<0?(P+=re,P<0&&(P=0)):P>re&&(P=re),k<0?(k+=re,k<0&&(k=0)):k>re&&(k=re),k<P&&(k=P);const ue=this.subarray(P,k);return Object.setPrototypeOf(ue,y.prototype),ue};function Me(W,P,k){if(W%1!==0||W<0)throw new RangeError("offset is not uint");if(W+P>k)throw new RangeError("Trying to access beyond buffer length")}y.prototype.readUintLE=y.prototype.readUIntLE=function(P,k,re){P=P>>>0,k=k>>>0,re||Me(P,k,this.length);let ue=this[P],pe=1,ye=0;for(;++ye<k&&(pe*=256);)ue+=this[P+ye]*pe;return ue},y.prototype.readUintBE=y.prototype.readUIntBE=function(P,k,re){P=P>>>0,k=k>>>0,re||Me(P,k,this.length);let ue=this[P+--k],pe=1;for(;k>0&&(pe*=256);)ue+=this[P+--k]*pe;return ue},y.prototype.readUint8=y.prototype.readUInt8=function(P,k){return P=P>>>0,k||Me(P,1,this.length),this[P]},y.prototype.readUint16LE=y.prototype.readUInt16LE=function(P,k){return P=P>>>0,k||Me(P,2,this.length),this[P]|this[P+1]<<8},y.prototype.readUint16BE=y.prototype.readUInt16BE=function(P,k){return P=P>>>0,k||Me(P,2,this.length),this[P]<<8|this[P+1]},y.prototype.readUint32LE=y.prototype.readUInt32LE=function(P,k){return P=P>>>0,k||Me(P,4,this.length),(this[P]|this[P+1]<<8|this[P+2]<<16)+this[P+3]*16777216},y.prototype.readUint32BE=y.prototype.readUInt32BE=function(P,k){return P=P>>>0,k||Me(P,4,this.length),this[P]*16777216+(this[P+1]<<16|this[P+2]<<8|this[P+3])},y.prototype.readBigUInt64LE=Ze(function(P){P=P>>>0,se(P,"offset");const k=this[P],re=this[P+7];(k===void 0||re===void 0)&&le(P,this.length-8);const ue=k+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24,pe=this[++P]+this[++P]*2**8+this[++P]*2**16+re*2**24;return BigInt(ue)+(BigInt(pe)<<BigInt(32))}),y.prototype.readBigUInt64BE=Ze(function(P){P=P>>>0,se(P,"offset");const k=this[P],re=this[P+7];(k===void 0||re===void 0)&&le(P,this.length-8);const ue=k*2**24+this[++P]*2**16+this[++P]*2**8+this[++P],pe=this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+re;return(BigInt(ue)<<BigInt(32))+BigInt(pe)}),y.prototype.readIntLE=function(P,k,re){P=P>>>0,k=k>>>0,re||Me(P,k,this.length);let ue=this[P],pe=1,ye=0;for(;++ye<k&&(pe*=256);)ue+=this[P+ye]*pe;return pe*=128,ue>=pe&&(ue-=Math.pow(2,8*k)),ue},y.prototype.readIntBE=function(P,k,re){P=P>>>0,k=k>>>0,re||Me(P,k,this.length);let ue=k,pe=1,ye=this[P+--ue];for(;ue>0&&(pe*=256);)ye+=this[P+--ue]*pe;return pe*=128,ye>=pe&&(ye-=Math.pow(2,8*k)),ye},y.prototype.readInt8=function(P,k){return P=P>>>0,k||Me(P,1,this.length),this[P]&128?(255-this[P]+1)*-1:this[P]},y.prototype.readInt16LE=function(P,k){P=P>>>0,k||Me(P,2,this.length);const re=this[P]|this[P+1]<<8;return re&32768?re|4294901760:re},y.prototype.readInt16BE=function(P,k){P=P>>>0,k||Me(P,2,this.length);const re=this[P+1]|this[P]<<8;return re&32768?re|4294901760:re},y.prototype.readInt32LE=function(P,k){return P=P>>>0,k||Me(P,4,this.length),this[P]|this[P+1]<<8|this[P+2]<<16|this[P+3]<<24},y.prototype.readInt32BE=function(P,k){return P=P>>>0,k||Me(P,4,this.length),this[P]<<24|this[P+1]<<16|this[P+2]<<8|this[P+3]},y.prototype.readBigInt64LE=Ze(function(P){P=P>>>0,se(P,"offset");const k=this[P],re=this[P+7];(k===void 0||re===void 0)&&le(P,this.length-8);const ue=this[P+4]+this[P+5]*2**8+this[P+6]*2**16+(re<<24);return(BigInt(ue)<<BigInt(32))+BigInt(k+this[++P]*2**8+this[++P]*2**16+this[++P]*2**24)}),y.prototype.readBigInt64BE=Ze(function(P){P=P>>>0,se(P,"offset");const k=this[P],re=this[P+7];(k===void 0||re===void 0)&&le(P,this.length-8);const ue=(k<<24)+this[++P]*2**16+this[++P]*2**8+this[++P];return(BigInt(ue)<<BigInt(32))+BigInt(this[++P]*2**24+this[++P]*2**16+this[++P]*2**8+re)}),y.prototype.readFloatLE=function(P,k){return P=P>>>0,k||Me(P,4,this.length),D.read(this,P,!0,23,4)},y.prototype.readFloatBE=function(P,k){return P=P>>>0,k||Me(P,4,this.length),D.read(this,P,!1,23,4)},y.prototype.readDoubleLE=function(P,k){return P=P>>>0,k||Me(P,8,this.length),D.read(this,P,!0,52,8)},y.prototype.readDoubleBE=function(P,k){return P=P>>>0,k||Me(P,8,this.length),D.read(this,P,!1,52,8)};function Pe(W,P,k,re,ue,pe){if(!y.isBuffer(W))throw new TypeError('"buffer" argument must be a Buffer instance');if(P>ue||P<pe)throw new RangeError('"value" argument is out of bounds');if(k+re>W.length)throw new RangeError("Index out of range")}y.prototype.writeUintLE=y.prototype.writeUIntLE=function(P,k,re,ue){if(P=+P,k=k>>>0,re=re>>>0,!ue){const ke=Math.pow(2,8*re)-1;Pe(this,P,k,re,ke,0)}let pe=1,ye=0;for(this[k]=P&255;++ye<re&&(pe*=256);)this[k+ye]=P/pe&255;return k+re},y.prototype.writeUintBE=y.prototype.writeUIntBE=function(P,k,re,ue){if(P=+P,k=k>>>0,re=re>>>0,!ue){const ke=Math.pow(2,8*re)-1;Pe(this,P,k,re,ke,0)}let pe=re-1,ye=1;for(this[k+pe]=P&255;--pe>=0&&(ye*=256);)this[k+pe]=P/ye&255;return k+re},y.prototype.writeUint8=y.prototype.writeUInt8=function(P,k,re){return P=+P,k=k>>>0,re||Pe(this,P,k,1,255,0),this[k]=P&255,k+1},y.prototype.writeUint16LE=y.prototype.writeUInt16LE=function(P,k,re){return P=+P,k=k>>>0,re||Pe(this,P,k,2,65535,0),this[k]=P&255,this[k+1]=P>>>8,k+2},y.prototype.writeUint16BE=y.prototype.writeUInt16BE=function(P,k,re){return P=+P,k=k>>>0,re||Pe(this,P,k,2,65535,0),this[k]=P>>>8,this[k+1]=P&255,k+2},y.prototype.writeUint32LE=y.prototype.writeUInt32LE=function(P,k,re){return P=+P,k=k>>>0,re||Pe(this,P,k,4,4294967295,0),this[k+3]=P>>>24,this[k+2]=P>>>16,this[k+1]=P>>>8,this[k]=P&255,k+4},y.prototype.writeUint32BE=y.prototype.writeUInt32BE=function(P,k,re){return P=+P,k=k>>>0,re||Pe(this,P,k,4,4294967295,0),this[k]=P>>>24,this[k+1]=P>>>16,this[k+2]=P>>>8,this[k+3]=P&255,k+4};function oe(W,P,k,re,ue){J(P,re,ue,W,k,7);let pe=Number(P&BigInt(4294967295));W[k++]=pe,pe=pe>>8,W[k++]=pe,pe=pe>>8,W[k++]=pe,pe=pe>>8,W[k++]=pe;let ye=Number(P>>BigInt(32)&BigInt(4294967295));return W[k++]=ye,ye=ye>>8,W[k++]=ye,ye=ye>>8,W[k++]=ye,ye=ye>>8,W[k++]=ye,k}function ce(W,P,k,re,ue){J(P,re,ue,W,k,7);let pe=Number(P&BigInt(4294967295));W[k+7]=pe,pe=pe>>8,W[k+6]=pe,pe=pe>>8,W[k+5]=pe,pe=pe>>8,W[k+4]=pe;let ye=Number(P>>BigInt(32)&BigInt(4294967295));return W[k+3]=ye,ye=ye>>8,W[k+2]=ye,ye=ye>>8,W[k+1]=ye,ye=ye>>8,W[k]=ye,k+8}y.prototype.writeBigUInt64LE=Ze(function(P,k=0){return oe(this,P,k,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeBigUInt64BE=Ze(function(P,k=0){return ce(this,P,k,BigInt(0),BigInt("0xffffffffffffffff"))}),y.prototype.writeIntLE=function(P,k,re,ue){if(P=+P,k=k>>>0,!ue){const He=Math.pow(2,8*re-1);Pe(this,P,k,re,He-1,-He)}let pe=0,ye=1,ke=0;for(this[k]=P&255;++pe<re&&(ye*=256);)P<0&&ke===0&&this[k+pe-1]!==0&&(ke=1),this[k+pe]=(P/ye>>0)-ke&255;return k+re},y.prototype.writeIntBE=function(P,k,re,ue){if(P=+P,k=k>>>0,!ue){const He=Math.pow(2,8*re-1);Pe(this,P,k,re,He-1,-He)}let pe=re-1,ye=1,ke=0;for(this[k+pe]=P&255;--pe>=0&&(ye*=256);)P<0&&ke===0&&this[k+pe+1]!==0&&(ke=1),this[k+pe]=(P/ye>>0)-ke&255;return k+re},y.prototype.writeInt8=function(P,k,re){return P=+P,k=k>>>0,re||Pe(this,P,k,1,127,-128),P<0&&(P=255+P+1),this[k]=P&255,k+1},y.prototype.writeInt16LE=function(P,k,re){return P=+P,k=k>>>0,re||Pe(this,P,k,2,32767,-32768),this[k]=P&255,this[k+1]=P>>>8,k+2},y.prototype.writeInt16BE=function(P,k,re){return P=+P,k=k>>>0,re||Pe(this,P,k,2,32767,-32768),this[k]=P>>>8,this[k+1]=P&255,k+2},y.prototype.writeInt32LE=function(P,k,re){return P=+P,k=k>>>0,re||Pe(this,P,k,4,2147483647,-2147483648),this[k]=P&255,this[k+1]=P>>>8,this[k+2]=P>>>16,this[k+3]=P>>>24,k+4},y.prototype.writeInt32BE=function(P,k,re){return P=+P,k=k>>>0,re||Pe(this,P,k,4,2147483647,-2147483648),P<0&&(P=4294967295+P+1),this[k]=P>>>24,this[k+1]=P>>>16,this[k+2]=P>>>8,this[k+3]=P&255,k+4},y.prototype.writeBigInt64LE=Ze(function(P,k=0){return oe(this,P,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),y.prototype.writeBigInt64BE=Ze(function(P,k=0){return ce(this,P,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function ge(W,P,k,re,ue,pe){if(k+re>W.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("Index out of range")}function we(W,P,k,re,ue){return P=+P,k=k>>>0,ue||ge(W,P,k,4),D.write(W,P,k,re,23,4),k+4}y.prototype.writeFloatLE=function(P,k,re){return we(this,P,k,!0,re)},y.prototype.writeFloatBE=function(P,k,re){return we(this,P,k,!1,re)};function Se(W,P,k,re,ue){return P=+P,k=k>>>0,ue||ge(W,P,k,8),D.write(W,P,k,re,52,8),k+8}y.prototype.writeDoubleLE=function(P,k,re){return Se(this,P,k,!0,re)},y.prototype.writeDoubleBE=function(P,k,re){return Se(this,P,k,!1,re)},y.prototype.copy=function(P,k,re,ue){if(!y.isBuffer(P))throw new TypeError("argument should be a Buffer");if(re||(re=0),!ue&&ue!==0&&(ue=this.length),k>=P.length&&(k=P.length),k||(k=0),ue>0&&ue<re&&(ue=re),ue===re||P.length===0||this.length===0)return 0;if(k<0)throw new RangeError("targetStart out of bounds");if(re<0||re>=this.length)throw new RangeError("Index out of range");if(ue<0)throw new RangeError("sourceEnd out of bounds");ue>this.length&&(ue=this.length),P.length-k<ue-re&&(ue=P.length-k+re);const pe=ue-re;return this===P&&typeof Y.prototype.copyWithin=="function"?this.copyWithin(k,re,ue):Y.prototype.set.call(P,this.subarray(re,ue),k),pe},y.prototype.fill=function(P,k,re,ue){if(typeof P=="string"){if(typeof k=="string"?(ue=k,k=0,re=this.length):typeof re=="string"&&(ue=re,re=this.length),ue!==void 0&&typeof ue!="string")throw new TypeError("encoding must be a string");if(typeof ue=="string"&&!y.isEncoding(ue))throw new TypeError("Unknown encoding: "+ue);if(P.length===1){const ye=P.charCodeAt(0);(ue==="utf8"&&ye<128||ue==="latin1")&&(P=ye)}}else typeof P=="number"?P=P&255:typeof P=="boolean"&&(P=Number(P));if(k<0||this.length<k||this.length<re)throw new RangeError("Out of range index");if(re<=k)return this;k=k>>>0,re=re===void 0?this.length:re>>>0,P||(P=0);let pe;if(typeof P=="number")for(pe=k;pe<re;++pe)this[pe]=P;else{const ye=y.isBuffer(P)?P:y.from(P,ue),ke=ye.length;if(ke===0)throw new TypeError('The value "'+P+'" is invalid for argument "value"');for(pe=0;pe<re-k;++pe)this[pe+k]=ye[pe%ke]}return this};const Oe={};function U(W,P,k){Oe[W]=class extends k{constructor(){super(),Object.defineProperty(this,"message",{value:P.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${W}]`,this.stack,delete this.name}get code(){return W}set code(ue){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:ue,writable:!0})}toString(){return`${this.name} [${W}]: ${this.message}`}}}U("ERR_BUFFER_OUT_OF_BOUNDS",function(W){return W?`${W} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),U("ERR_INVALID_ARG_TYPE",function(W,P){return`The "${W}" argument must be of type number. Received type ${typeof P}`},TypeError),U("ERR_OUT_OF_RANGE",function(W,P,k){let re=`The value of "${W}" is out of range.`,ue=k;return Number.isInteger(k)&&Math.abs(k)>2**32?ue=I(String(k)):typeof k=="bigint"&&(ue=String(k),(k>BigInt(2)**BigInt(32)||k<-(BigInt(2)**BigInt(32)))&&(ue=I(ue)),ue+="n"),re+=` It must be ${P}. Received ${ue}`,re},RangeError);function I(W){let P="",k=W.length;const re=W[0]==="-"?1:0;for(;k>=re+4;k-=3)P=`_${W.slice(k-3,k)}${P}`;return`${W.slice(0,k)}${P}`}function C(W,P,k){se(P,"offset"),(W[P]===void 0||W[P+k]===void 0)&&le(P,W.length-(k+1))}function J(W,P,k,re,ue,pe){if(W>k||W<P){const ye=typeof P=="bigint"?"n":"";let ke;throw P===0||P===BigInt(0)?ke=`>= 0${ye} and < 2${ye} ** ${(pe+1)*8}${ye}`:ke=`>= -(2${ye} ** ${(pe+1)*8-1}${ye}) and < 2 ** ${(pe+1)*8-1}${ye}`,new Oe.ERR_OUT_OF_RANGE("value",ke,W)}C(re,ue,pe)}function se(W,P){if(typeof W!="number")throw new Oe.ERR_INVALID_ARG_TYPE(P,"number",W)}function le(W,P,k){throw Math.floor(W)!==W?(se(W,k),new Oe.ERR_OUT_OF_RANGE("offset","an integer",W)):P<0?new Oe.ERR_BUFFER_OUT_OF_BOUNDS:new Oe.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${P}`,W)}const ve=/[^+/0-9A-Za-z-_]/g;function Ce(W){if(W=W.split("=")[0],W=W.trim().replace(ve,""),W.length<2)return"";for(;W.length%4!==0;)W=W+"=";return W}function Le(W,P){P=P||1/0;let k;const re=W.length;let ue=null;const pe=[];for(let ye=0;ye<re;++ye){if(k=W.charCodeAt(ye),k>55295&&k<57344){if(!ue){if(k>56319){(P-=3)>-1&&pe.push(239,191,189);continue}else if(ye+1===re){(P-=3)>-1&&pe.push(239,191,189);continue}ue=k;continue}if(k<56320){(P-=3)>-1&&pe.push(239,191,189),ue=k;continue}k=(ue-55296<<10|k-56320)+65536}else ue&&(P-=3)>-1&&pe.push(239,191,189);if(ue=null,k<128){if((P-=1)<0)break;pe.push(k)}else if(k<2048){if((P-=2)<0)break;pe.push(k>>6|192,k&63|128)}else if(k<65536){if((P-=3)<0)break;pe.push(k>>12|224,k>>6&63|128,k&63|128)}else if(k<1114112){if((P-=4)<0)break;pe.push(k>>18|240,k>>12&63|128,k>>6&63|128,k&63|128)}else throw new Error("Invalid code point")}return pe}function Ie(W){const P=[];for(let k=0;k<W.length;++k)P.push(W.charCodeAt(k)&255);return P}function je(W,P){let k,re,ue;const pe=[];for(let ye=0;ye<W.length&&!((P-=2)<0);++ye)k=W.charCodeAt(ye),re=k>>8,ue=k%256,pe.push(ue),pe.push(re);return pe}function $e(W){return O.toByteArray(Ce(W))}function Ve(W,P,k,re){let ue;for(ue=0;ue<re&&!(ue+k>=P.length||ue>=W.length);++ue)P[ue+k]=W[ue];return ue}function Ke(W,P){return W instanceof P||W!=null&&W.constructor!=null&&W.constructor.name!=null&&W.constructor.name===P.name}function Xe(W){return W!==W}const We=(function(){const W="0123456789abcdef",P=new Array(256);for(let k=0;k<16;++k){const re=k*16;for(let ue=0;ue<16;++ue)P[re+ue]=W[k]+W[ue]}return P})();function Ze(W){return typeof BigInt>"u"?Ye:W}function Ye(){throw new Error("BigInt not supported")}})(t);const E=t.Buffer;s.Blob=t.Blob,s.BlobOptions=t.BlobOptions,s.Buffer=t.Buffer,s.File=t.File,s.FileOptions=t.FileOptions,s.INSPECT_MAX_BYTES=t.INSPECT_MAX_BYTES,s.SlowBuffer=t.SlowBuffer,s.TranscodeEncoding=t.TranscodeEncoding,s.atob=t.atob,s.btoa=t.btoa,s.constants=t.constants,s.default=E,s.isAscii=t.isAscii,s.isUtf8=t.isUtf8,s.kMaxLength=t.kMaxLength,s.kStringMaxLength=t.kStringMaxLength,s.resolveObjectURL=t.resolveObjectURL,s.transcode=t.transcode})(dist)),dist}var hasRequiredSafeBuffer$1;function requireSafeBuffer$1(){return hasRequiredSafeBuffer$1||(hasRequiredSafeBuffer$1=1,(function(s,t){var f=requireDist(),o=f.Buffer;function d(h,c){for(var n in h)c[n]=h[n]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?s.exports=f:(d(f,t),t.Buffer=r);function r(h,c,n){return o(h,c,n)}r.prototype=Object.create(o.prototype),d(o,r),r.from=function(h,c,n){if(typeof h=="number")throw new TypeError("Argument must not be a number");return o(h,c,n)},r.alloc=function(h,c,n){if(typeof h!="number")throw new TypeError("Argument must be a number");var a=o(h);return c!==void 0?typeof n=="string"?a.fill(c,n):a.fill(c):a.fill(0),a},r.allocUnsafe=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return o(h)},r.allocUnsafeSlow=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return f.SlowBuffer(h)}})(safeBuffer$1,safeBuffer$1.exports)),safeBuffer$1.exports}var hasRequiredBrowser$b;function requireBrowser$b(){if(hasRequiredBrowser$b)return browser$b.exports;hasRequiredBrowser$b=1;var s=65536,t=4294967295;function f(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
2
|
+
Use Chrome, Firefox or Internet Explorer 11`)}var o=requireSafeBuffer$1().Buffer,d=commonjsGlobal.crypto||commonjsGlobal.msCrypto;d&&d.getRandomValues?browser$b.exports=r:browser$b.exports=f;function r(h,c){if(h>t)throw new RangeError("requested too many random bytes");var n=o.allocUnsafe(h);if(h>0)if(h>s)for(var a=0;a<h;a+=s)d.getRandomValues(n.slice(a,a+s));else d.getRandomValues(n);return typeof c=="function"?process$1.nextTick(function(){c(null,n)}):n}return browser$b.exports}var inherits_browser={exports:{}},hasRequiredInherits_browser;function requireInherits_browser(){return hasRequiredInherits_browser||(hasRequiredInherits_browser=1,typeof Object.create=="function"?inherits_browser.exports=function(t,f){f&&(t.super_=f,t.prototype=Object.create(f.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(t,f){if(f){t.super_=f;var o=function(){};o.prototype=f.prototype,t.prototype=new o,t.prototype.constructor=t}}),inherits_browser.exports}var events={exports:{}},hasRequiredEvents;function requireEvents(){if(hasRequiredEvents)return events.exports;hasRequiredEvents=1;var s=typeof Reflect=="object"?Reflect:null,t=s&&typeof s.apply=="function"?s.apply:function($,H,Y){return Function.prototype.apply.call($,H,Y)},f;s&&typeof s.ownKeys=="function"?f=s.ownKeys:Object.getOwnPropertySymbols?f=function($){return Object.getOwnPropertyNames($).concat(Object.getOwnPropertySymbols($))}:f=function($){return Object.getOwnPropertyNames($)};function o(D){console&&console.warn&&console.warn(D)}var d=Number.isNaN||function($){return $!==$};function r(){r.init.call(this)}events.exports=r,events.exports.once=E,r.EventEmitter=r,r.prototype._events=void 0,r.prototype._eventsCount=0,r.prototype._maxListeners=void 0;var h=10;function c(D){if(typeof D!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof D)}Object.defineProperty(r,"defaultMaxListeners",{enumerable:!0,get:function(){return h},set:function(D){if(typeof D!="number"||D<0||d(D))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+D+".");h=D}}),r.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},r.prototype.setMaxListeners=function($){if(typeof $!="number"||$<0||d($))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+$+".");return this._maxListeners=$,this};function n(D){return D._maxListeners===void 0?r.defaultMaxListeners:D._maxListeners}r.prototype.getMaxListeners=function(){return n(this)},r.prototype.emit=function($){for(var H=[],Y=1;Y<arguments.length;Y++)H.push(arguments[Y]);var ie=$==="error",ne=this._events;if(ne!==void 0)ie=ie&&ne.error===void 0;else if(!ie)return!1;if(ie){var de;if(H.length>0&&(de=H[0]),de instanceof Error)throw de;var X=new Error("Unhandled error."+(de?" ("+de.message+")":""));throw X.context=de,X}var y=ne[$];if(y===void 0)return!1;if(typeof y=="function")t(y,this,H);else for(var g=y.length,p=b(y,g),Y=0;Y<g;++Y)t(p[Y],this,H);return!0};function a(D,$,H,Y){var ie,ne,de;if(c(H),ne=D._events,ne===void 0?(ne=D._events=Object.create(null),D._eventsCount=0):(ne.newListener!==void 0&&(D.emit("newListener",$,H.listener?H.listener:H),ne=D._events),de=ne[$]),de===void 0)de=ne[$]=H,++D._eventsCount;else if(typeof de=="function"?de=ne[$]=Y?[H,de]:[de,H]:Y?de.unshift(H):de.push(H),ie=n(D),ie>0&&de.length>ie&&!de.warned){de.warned=!0;var X=new Error("Possible EventEmitter memory leak detected. "+de.length+" "+String($)+" listeners added. Use emitter.setMaxListeners() to increase limit");X.name="MaxListenersExceededWarning",X.emitter=D,X.type=$,X.count=de.length,o(X)}return D}r.prototype.addListener=function($,H){return a(this,$,H,!1)},r.prototype.on=r.prototype.addListener,r.prototype.prependListener=function($,H){return a(this,$,H,!0)};function e(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function u(D,$,H){var Y={fired:!1,wrapFn:void 0,target:D,type:$,listener:H},ie=e.bind(Y);return ie.listener=H,Y.wrapFn=ie,ie}r.prototype.once=function($,H){return c(H),this.on($,u(this,$,H)),this},r.prototype.prependOnceListener=function($,H){return c(H),this.prependListener($,u(this,$,H)),this},r.prototype.removeListener=function($,H){var Y,ie,ne,de,X;if(c(H),ie=this._events,ie===void 0)return this;if(Y=ie[$],Y===void 0)return this;if(Y===H||Y.listener===H)--this._eventsCount===0?this._events=Object.create(null):(delete ie[$],ie.removeListener&&this.emit("removeListener",$,Y.listener||H));else if(typeof Y!="function"){for(ne=-1,de=Y.length-1;de>=0;de--)if(Y[de]===H||Y[de].listener===H){X=Y[de].listener,ne=de;break}if(ne<0)return this;ne===0?Y.shift():m(Y,ne),Y.length===1&&(ie[$]=Y[0]),ie.removeListener!==void 0&&this.emit("removeListener",$,X||H)}return this},r.prototype.off=r.prototype.removeListener,r.prototype.removeAllListeners=function($){var H,Y,ie;if(Y=this._events,Y===void 0)return this;if(Y.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):Y[$]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete Y[$]),this;if(arguments.length===0){var ne=Object.keys(Y),de;for(ie=0;ie<ne.length;++ie)de=ne[ie],de!=="removeListener"&&this.removeAllListeners(de);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(H=Y[$],typeof H=="function")this.removeListener($,H);else if(H!==void 0)for(ie=H.length-1;ie>=0;ie--)this.removeListener($,H[ie]);return this};function l(D,$,H){var Y=D._events;if(Y===void 0)return[];var ie=Y[$];return ie===void 0?[]:typeof ie=="function"?H?[ie.listener||ie]:[ie]:H?B(ie):b(ie,ie.length)}r.prototype.listeners=function($){return l(this,$,!0)},r.prototype.rawListeners=function($){return l(this,$,!1)},r.listenerCount=function(D,$){return typeof D.listenerCount=="function"?D.listenerCount($):v.call(D,$)},r.prototype.listenerCount=v;function v(D){var $=this._events;if($!==void 0){var H=$[D];if(typeof H=="function")return 1;if(H!==void 0)return H.length}return 0}r.prototype.eventNames=function(){return this._eventsCount>0?f(this._events):[]};function b(D,$){for(var H=new Array($),Y=0;Y<$;++Y)H[Y]=D[Y];return H}function m(D,$){for(;$+1<D.length;$++)D[$]=D[$+1];D.pop()}function B(D){for(var $=new Array(D.length),H=0;H<$.length;++H)$[H]=D[H].listener||D[H];return $}function E(D,$){return new Promise(function(H,Y){function ie(de){D.removeListener($,ne),Y(de)}function ne(){typeof D.removeListener=="function"&&D.removeListener("error",ie),H([].slice.call(arguments))}O(D,$,ne,{once:!0}),$!=="error"&&S(D,ie,{once:!0})})}function S(D,$,H){typeof D.on=="function"&&O(D,"error",$,H)}function O(D,$,H,Y){if(typeof D.on=="function")Y.once?D.once($,H):D.on($,H);else if(typeof D.addEventListener=="function")D.addEventListener($,function ie(ne){Y.once&&D.removeEventListener($,ie),H(ne)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof D)}return events.exports}var streamBrowser$1,hasRequiredStreamBrowser$1;function requireStreamBrowser$1(){return hasRequiredStreamBrowser$1||(hasRequiredStreamBrowser$1=1,streamBrowser$1=requireEvents().EventEmitter),streamBrowser$1}var util$1={},types$1={},shams$1,hasRequiredShams$1;function requireShams$1(){return hasRequiredShams$1||(hasRequiredShams$1=1,shams$1=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},f=Symbol("test"),o=Object(f);if(typeof f=="string"||Object.prototype.toString.call(f)!=="[object Symbol]"||Object.prototype.toString.call(o)!=="[object Symbol]")return!1;var d=42;t[f]=d;for(var r in t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var h=Object.getOwnPropertySymbols(t);if(h.length!==1||h[0]!==f||!Object.prototype.propertyIsEnumerable.call(t,f))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var c=Object.getOwnPropertyDescriptor(t,f);if(c.value!==d||c.enumerable!==!0)return!1}return!0}),shams$1}var shams,hasRequiredShams;function requireShams(){if(hasRequiredShams)return shams;hasRequiredShams=1;var s=requireShams$1();return shams=function(){return s()&&!!Symbol.toStringTag},shams}var esObjectAtoms,hasRequiredEsObjectAtoms;function requireEsObjectAtoms(){return hasRequiredEsObjectAtoms||(hasRequiredEsObjectAtoms=1,esObjectAtoms=Object),esObjectAtoms}var esErrors,hasRequiredEsErrors;function requireEsErrors(){return hasRequiredEsErrors||(hasRequiredEsErrors=1,esErrors=Error),esErrors}var _eval,hasRequired_eval;function require_eval(){return hasRequired_eval||(hasRequired_eval=1,_eval=EvalError),_eval}var range,hasRequiredRange;function requireRange(){return hasRequiredRange||(hasRequiredRange=1,range=RangeError),range}var ref,hasRequiredRef;function requireRef(){return hasRequiredRef||(hasRequiredRef=1,ref=ReferenceError),ref}var syntax,hasRequiredSyntax;function requireSyntax(){return hasRequiredSyntax||(hasRequiredSyntax=1,syntax=SyntaxError),syntax}var type,hasRequiredType;function requireType(){return hasRequiredType||(hasRequiredType=1,type=TypeError),type}var uri,hasRequiredUri;function requireUri(){return hasRequiredUri||(hasRequiredUri=1,uri=URIError),uri}var abs,hasRequiredAbs;function requireAbs(){return hasRequiredAbs||(hasRequiredAbs=1,abs=Math.abs),abs}var floor,hasRequiredFloor;function requireFloor(){return hasRequiredFloor||(hasRequiredFloor=1,floor=Math.floor),floor}var max,hasRequiredMax;function requireMax(){return hasRequiredMax||(hasRequiredMax=1,max=Math.max),max}var min,hasRequiredMin;function requireMin(){return hasRequiredMin||(hasRequiredMin=1,min=Math.min),min}var pow,hasRequiredPow;function requirePow(){return hasRequiredPow||(hasRequiredPow=1,pow=Math.pow),pow}var round,hasRequiredRound;function requireRound(){return hasRequiredRound||(hasRequiredRound=1,round=Math.round),round}var _isNaN,hasRequired_isNaN;function require_isNaN(){return hasRequired_isNaN||(hasRequired_isNaN=1,_isNaN=Number.isNaN||function(t){return t!==t}),_isNaN}var sign$1,hasRequiredSign$1;function requireSign$1(){if(hasRequiredSign$1)return sign$1;hasRequiredSign$1=1;var s=require_isNaN();return sign$1=function(f){return s(f)||f===0?f:f<0?-1:1},sign$1}var gOPD,hasRequiredGOPD;function requireGOPD(){return hasRequiredGOPD||(hasRequiredGOPD=1,gOPD=Object.getOwnPropertyDescriptor),gOPD}var gopd,hasRequiredGopd;function requireGopd(){if(hasRequiredGopd)return gopd;hasRequiredGopd=1;var s=requireGOPD();if(s)try{s([],"length")}catch{s=null}return gopd=s,gopd}var esDefineProperty,hasRequiredEsDefineProperty;function requireEsDefineProperty(){if(hasRequiredEsDefineProperty)return esDefineProperty;hasRequiredEsDefineProperty=1;var s=Object.defineProperty||!1;if(s)try{s({},"a",{value:1})}catch{s=!1}return esDefineProperty=s,esDefineProperty}var hasSymbols,hasRequiredHasSymbols;function requireHasSymbols(){if(hasRequiredHasSymbols)return hasSymbols;hasRequiredHasSymbols=1;var s=typeof Symbol<"u"&&Symbol,t=requireShams$1();return hasSymbols=function(){return typeof s!="function"||typeof Symbol!="function"||typeof s("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:t()},hasSymbols}var Reflect_getPrototypeOf,hasRequiredReflect_getPrototypeOf;function requireReflect_getPrototypeOf(){return hasRequiredReflect_getPrototypeOf||(hasRequiredReflect_getPrototypeOf=1,Reflect_getPrototypeOf=typeof Reflect<"u"&&Reflect.getPrototypeOf||null),Reflect_getPrototypeOf}var Object_getPrototypeOf,hasRequiredObject_getPrototypeOf;function requireObject_getPrototypeOf(){if(hasRequiredObject_getPrototypeOf)return Object_getPrototypeOf;hasRequiredObject_getPrototypeOf=1;var s=requireEsObjectAtoms();return Object_getPrototypeOf=s.getPrototypeOf||null,Object_getPrototypeOf}var implementation$4,hasRequiredImplementation$4;function requireImplementation$4(){if(hasRequiredImplementation$4)return implementation$4;hasRequiredImplementation$4=1;var s="Function.prototype.bind called on incompatible ",t=Object.prototype.toString,f=Math.max,o="[object Function]",d=function(n,a){for(var e=[],u=0;u<n.length;u+=1)e[u]=n[u];for(var l=0;l<a.length;l+=1)e[l+n.length]=a[l];return e},r=function(n,a){for(var e=[],u=a,l=0;u<n.length;u+=1,l+=1)e[l]=n[u];return e},h=function(c,n){for(var a="",e=0;e<c.length;e+=1)a+=c[e],e+1<c.length&&(a+=n);return a};return implementation$4=function(n){var a=this;if(typeof a!="function"||t.apply(a)!==o)throw new TypeError(s+a);for(var e=r(arguments,1),u,l=function(){if(this instanceof u){var E=a.apply(this,d(e,arguments));return Object(E)===E?E:this}return a.apply(n,d(e,arguments))},v=f(0,a.length-e.length),b=[],m=0;m<v;m++)b[m]="$"+m;if(u=Function("binder","return function ("+h(b,",")+"){ return binder.apply(this,arguments); }")(l),a.prototype){var B=function(){};B.prototype=a.prototype,u.prototype=new B,B.prototype=null}return u},implementation$4}var functionBind,hasRequiredFunctionBind;function requireFunctionBind(){if(hasRequiredFunctionBind)return functionBind;hasRequiredFunctionBind=1;var s=requireImplementation$4();return functionBind=Function.prototype.bind||s,functionBind}var functionCall,hasRequiredFunctionCall;function requireFunctionCall(){return hasRequiredFunctionCall||(hasRequiredFunctionCall=1,functionCall=Function.prototype.call),functionCall}var functionApply,hasRequiredFunctionApply;function requireFunctionApply(){return hasRequiredFunctionApply||(hasRequiredFunctionApply=1,functionApply=Function.prototype.apply),functionApply}var reflectApply,hasRequiredReflectApply;function requireReflectApply(){return hasRequiredReflectApply||(hasRequiredReflectApply=1,reflectApply=typeof Reflect<"u"&&Reflect&&Reflect.apply),reflectApply}var actualApply,hasRequiredActualApply;function requireActualApply(){if(hasRequiredActualApply)return actualApply;hasRequiredActualApply=1;var s=requireFunctionBind(),t=requireFunctionApply(),f=requireFunctionCall(),o=requireReflectApply();return actualApply=o||s.call(f,t),actualApply}var callBindApplyHelpers,hasRequiredCallBindApplyHelpers;function requireCallBindApplyHelpers(){if(hasRequiredCallBindApplyHelpers)return callBindApplyHelpers;hasRequiredCallBindApplyHelpers=1;var s=requireFunctionBind(),t=requireType(),f=requireFunctionCall(),o=requireActualApply();return callBindApplyHelpers=function(r){if(r.length<1||typeof r[0]!="function")throw new t("a function is required");return o(s,f,r)},callBindApplyHelpers}var get,hasRequiredGet;function requireGet(){if(hasRequiredGet)return get;hasRequiredGet=1;var s=requireCallBindApplyHelpers(),t=requireGopd(),f;try{f=[].__proto__===Array.prototype}catch(h){if(!h||typeof h!="object"||!("code"in h)||h.code!=="ERR_PROTO_ACCESS")throw h}var o=!!f&&t&&t(Object.prototype,"__proto__"),d=Object,r=d.getPrototypeOf;return get=o&&typeof o.get=="function"?s([o.get]):typeof r=="function"?function(c){return r(c==null?c:d(c))}:!1,get}var getProto,hasRequiredGetProto;function requireGetProto(){if(hasRequiredGetProto)return getProto;hasRequiredGetProto=1;var s=requireReflect_getPrototypeOf(),t=requireObject_getPrototypeOf(),f=requireGet();return getProto=s?function(d){return s(d)}:t?function(d){if(!d||typeof d!="object"&&typeof d!="function")throw new TypeError("getProto: not an object");return t(d)}:f?function(d){return f(d)}:null,getProto}var hasown,hasRequiredHasown;function requireHasown(){if(hasRequiredHasown)return hasown;hasRequiredHasown=1;var s=Function.prototype.call,t=Object.prototype.hasOwnProperty,f=requireFunctionBind();return hasown=f.call(s,t),hasown}var getIntrinsic,hasRequiredGetIntrinsic;function requireGetIntrinsic(){if(hasRequiredGetIntrinsic)return getIntrinsic;hasRequiredGetIntrinsic=1;var s,t=requireEsObjectAtoms(),f=requireEsErrors(),o=require_eval(),d=requireRange(),r=requireRef(),h=requireSyntax(),c=requireType(),n=requireUri(),a=requireAbs(),e=requireFloor(),u=requireMax(),l=requireMin(),v=requirePow(),b=requireRound(),m=requireSign$1(),B=Function,E=function(ee){try{return B('"use strict"; return ('+ee+").constructor;")()}catch{}},S=requireGopd(),O=requireEsDefineProperty(),D=function(){throw new c},$=S?(function(){try{return arguments.callee,D}catch{try{return S(arguments,"callee").get}catch{return D}}})():D,H=requireHasSymbols()(),Y=requireGetProto(),ie=requireObject_getPrototypeOf(),ne=requireReflect_getPrototypeOf(),de=requireFunctionApply(),X=requireFunctionCall(),y={},g=typeof Uint8Array>"u"||!Y?s:Y(Uint8Array),p={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?s:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?s:ArrayBuffer,"%ArrayIteratorPrototype%":H&&Y?Y([][Symbol.iterator]()):s,"%AsyncFromSyncIteratorPrototype%":s,"%AsyncFunction%":y,"%AsyncGenerator%":y,"%AsyncGeneratorFunction%":y,"%AsyncIteratorPrototype%":y,"%Atomics%":typeof Atomics>"u"?s:Atomics,"%BigInt%":typeof BigInt>"u"?s:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?s:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?s:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?s:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":f,"%eval%":eval,"%EvalError%":o,"%Float16Array%":typeof Float16Array>"u"?s:Float16Array,"%Float32Array%":typeof Float32Array>"u"?s:Float32Array,"%Float64Array%":typeof Float64Array>"u"?s:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?s:FinalizationRegistry,"%Function%":B,"%GeneratorFunction%":y,"%Int8Array%":typeof Int8Array>"u"?s:Int8Array,"%Int16Array%":typeof Int16Array>"u"?s:Int16Array,"%Int32Array%":typeof Int32Array>"u"?s:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":H&&Y?Y(Y([][Symbol.iterator]())):s,"%JSON%":typeof JSON=="object"?JSON:s,"%Map%":typeof Map>"u"?s:Map,"%MapIteratorPrototype%":typeof Map>"u"||!H||!Y?s:Y(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":t,"%Object.getOwnPropertyDescriptor%":S,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?s:Promise,"%Proxy%":typeof Proxy>"u"?s:Proxy,"%RangeError%":d,"%ReferenceError%":r,"%Reflect%":typeof Reflect>"u"?s:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?s:Set,"%SetIteratorPrototype%":typeof Set>"u"||!H||!Y?s:Y(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?s:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":H&&Y?Y(""[Symbol.iterator]()):s,"%Symbol%":H?Symbol:s,"%SyntaxError%":h,"%ThrowTypeError%":$,"%TypedArray%":g,"%TypeError%":c,"%Uint8Array%":typeof Uint8Array>"u"?s:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?s:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?s:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?s:Uint32Array,"%URIError%":n,"%WeakMap%":typeof WeakMap>"u"?s:WeakMap,"%WeakRef%":typeof WeakRef>"u"?s:WeakRef,"%WeakSet%":typeof WeakSet>"u"?s:WeakSet,"%Function.prototype.call%":X,"%Function.prototype.apply%":de,"%Object.defineProperty%":O,"%Object.getPrototypeOf%":ie,"%Math.abs%":a,"%Math.floor%":e,"%Math.max%":u,"%Math.min%":l,"%Math.pow%":v,"%Math.round%":b,"%Math.sign%":m,"%Reflect.getPrototypeOf%":ne};if(Y)try{null.error}catch(ee){var _=Y(Y(ee));p["%Error.prototype%"]=_}var R=function ee(ae){var G;if(ae==="%AsyncFunction%")G=E("async function () {}");else if(ae==="%GeneratorFunction%")G=E("function* () {}");else if(ae==="%AsyncGeneratorFunction%")G=E("async function* () {}");else if(ae==="%AsyncGenerator%"){var z=ee("%AsyncGeneratorFunction%");z&&(G=z.prototype)}else if(ae==="%AsyncIteratorPrototype%"){var fe=ee("%AsyncGenerator%");fe&&Y&&(G=Y(fe.prototype))}return p[ae]=G,G},q={__proto__:null,"%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"]},T=requireFunctionBind(),A=requireHasown(),w=T.call(X,Array.prototype.concat),M=T.call(de,Array.prototype.splice),x=T.call(X,String.prototype.replace),L=T.call(X,String.prototype.slice),K=T.call(X,RegExp.prototype.exec),Q=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,j=/\\(\\)?/g,N=function(ae){var G=L(ae,0,1),z=L(ae,-1);if(G==="%"&&z!=="%")throw new h("invalid intrinsic syntax, expected closing `%`");if(z==="%"&&G!=="%")throw new h("invalid intrinsic syntax, expected opening `%`");var fe=[];return x(ae,Q,function(me,xe,_e,qe){fe[fe.length]=_e?x(qe,j,"$1"):xe||me}),fe},F=function(ae,G){var z=ae,fe;if(A(q,z)&&(fe=q[z],z="%"+fe[0]+"%"),A(p,z)){var me=p[z];if(me===y&&(me=R(z)),typeof me>"u"&&!G)throw new c("intrinsic "+ae+" exists, but is not available. Please file an issue!");return{alias:fe,name:z,value:me}}throw new h("intrinsic "+ae+" does not exist!")};return getIntrinsic=function(ae,G){if(typeof ae!="string"||ae.length===0)throw new c("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof G!="boolean")throw new c('"allowMissing" argument must be a boolean');if(K(/^%?[^%]*%?$/,ae)===null)throw new h("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var z=N(ae),fe=z.length>0?z[0]:"",me=F("%"+fe+"%",G),xe=me.name,_e=me.value,qe=!1,Re=me.alias;Re&&(fe=Re[0],M(z,w([0,1],Re)));for(var be=1,Fe=!0;be<z.length;be+=1){var Be=z[be],Me=L(Be,0,1),Pe=L(Be,-1);if((Me==='"'||Me==="'"||Me==="`"||Pe==='"'||Pe==="'"||Pe==="`")&&Me!==Pe)throw new h("property names with quotes must have matching quotes");if((Be==="constructor"||!Fe)&&(qe=!0),fe+="."+Be,xe="%"+fe+"%",A(p,xe))_e=p[xe];else if(_e!=null){if(!(Be in _e)){if(!G)throw new c("base intrinsic for "+ae+" exists, but the property is not available.");return}if(S&&be+1>=z.length){var oe=S(_e,Be);Fe=!!oe,Fe&&"get"in oe&&!("originalValue"in oe.get)?_e=oe.get:_e=_e[Be]}else Fe=A(_e,Be),_e=_e[Be];Fe&&!qe&&(p[xe]=_e)}}return _e},getIntrinsic}var callBound$1,hasRequiredCallBound$1;function requireCallBound$1(){if(hasRequiredCallBound$1)return callBound$1;hasRequiredCallBound$1=1;var s=requireGetIntrinsic(),t=requireCallBindApplyHelpers(),f=t([s("%String.prototype.indexOf%")]);return callBound$1=function(d,r){var h=s(d,!!r);return typeof h=="function"&&f(d,".prototype.")>-1?t([h]):h},callBound$1}var isArguments$1,hasRequiredIsArguments$1;function requireIsArguments$1(){if(hasRequiredIsArguments$1)return isArguments$1;hasRequiredIsArguments$1=1;var s=requireShams()(),t=requireCallBound$1(),f=t("Object.prototype.toString"),o=function(c){return s&&c&&typeof c=="object"&&Symbol.toStringTag in c?!1:f(c)==="[object Arguments]"},d=function(c){return o(c)?!0:c!==null&&typeof c=="object"&&"length"in c&&typeof c.length=="number"&&c.length>=0&&f(c)!=="[object Array]"&&"callee"in c&&f(c.callee)==="[object Function]"},r=(function(){return o(arguments)})();return o.isLegacyArguments=d,isArguments$1=r?o:d,isArguments$1}var isRegex,hasRequiredIsRegex;function requireIsRegex(){if(hasRequiredIsRegex)return isRegex;hasRequiredIsRegex=1;var s=requireCallBound$1(),t=requireShams()(),f=requireHasown(),o=requireGopd(),d;if(t){var r=s("RegExp.prototype.exec"),h={},c=function(){throw h},n={toString:c,valueOf:c};typeof Symbol.toPrimitive=="symbol"&&(n[Symbol.toPrimitive]=c),d=function(l){if(!l||typeof l!="object")return!1;var v=o(l,"lastIndex"),b=v&&f(v,"value");if(!b)return!1;try{r(l,n)}catch(m){return m===h}}}else{var a=s("Object.prototype.toString"),e="[object RegExp]";d=function(l){return!l||typeof l!="object"&&typeof l!="function"?!1:a(l)===e}}return isRegex=d,isRegex}var safeRegexTest,hasRequiredSafeRegexTest;function requireSafeRegexTest(){if(hasRequiredSafeRegexTest)return safeRegexTest;hasRequiredSafeRegexTest=1;var s=requireCallBound$1(),t=requireIsRegex(),f=s("RegExp.prototype.exec"),o=requireType();return safeRegexTest=function(r){if(!t(r))throw new o("`regex` must be a RegExp");return function(c){return f(r,c)!==null}},safeRegexTest}var generatorFunction,hasRequiredGeneratorFunction;function requireGeneratorFunction(){if(hasRequiredGeneratorFunction)return generatorFunction;hasRequiredGeneratorFunction=1;const s=(function*(){}).constructor;return generatorFunction=()=>s,generatorFunction}var isGeneratorFunction,hasRequiredIsGeneratorFunction;function requireIsGeneratorFunction(){if(hasRequiredIsGeneratorFunction)return isGeneratorFunction;hasRequiredIsGeneratorFunction=1;var s=requireCallBound$1(),t=requireSafeRegexTest(),f=t(/^\s*(?:function)?\*/),o=requireShams()(),d=requireGetProto(),r=s("Object.prototype.toString"),h=s("Function.prototype.toString"),c=requireGeneratorFunction();return isGeneratorFunction=function(a){if(typeof a!="function")return!1;if(f(h(a)))return!0;if(!o){var e=r(a);return e==="[object GeneratorFunction]"}if(!d)return!1;var u=c();return u&&d(a)===u.prototype},isGeneratorFunction}var isCallable,hasRequiredIsCallable;function requireIsCallable(){if(hasRequiredIsCallable)return isCallable;hasRequiredIsCallable=1;var s=Function.prototype.toString,t=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,f,o;if(typeof t=="function"&&typeof Object.defineProperty=="function")try{f=Object.defineProperty({},"length",{get:function(){throw o}}),o={},t(function(){throw 42},null,f)}catch(S){S!==o&&(t=null)}else t=null;var d=/^\s*class\b/,r=function(O){try{var D=s.call(O);return d.test(D)}catch{return!1}},h=function(O){try{return r(O)?!1:(s.call(O),!0)}catch{return!1}},c=Object.prototype.toString,n="[object Object]",a="[object Function]",e="[object GeneratorFunction]",u="[object HTMLAllCollection]",l="[object HTML document.all class]",v="[object HTMLCollection]",b=typeof Symbol=="function"&&!!Symbol.toStringTag,m=!(0 in[,]),B=function(){return!1};if(typeof document=="object"){var E=document.all;c.call(E)===c.call(document.all)&&(B=function(O){if((m||!O)&&(typeof O>"u"||typeof O=="object"))try{var D=c.call(O);return(D===u||D===l||D===v||D===n)&&O("")==null}catch{}return!1})}return isCallable=t?function(O){if(B(O))return!0;if(!O||typeof O!="function"&&typeof O!="object")return!1;try{t(O,null,f)}catch(D){if(D!==o)return!1}return!r(O)&&h(O)}:function(O){if(B(O))return!0;if(!O||typeof O!="function"&&typeof O!="object")return!1;if(b)return h(O);if(r(O))return!1;var D=c.call(O);return D!==a&&D!==e&&!/^\[object HTML/.test(D)?!1:h(O)},isCallable}var forEach,hasRequiredForEach;function requireForEach(){if(hasRequiredForEach)return forEach;hasRequiredForEach=1;var s=requireIsCallable(),t=Object.prototype.toString,f=Object.prototype.hasOwnProperty,o=function(n,a,e){for(var u=0,l=n.length;u<l;u++)f.call(n,u)&&(e==null?a(n[u],u,n):a.call(e,n[u],u,n))},d=function(n,a,e){for(var u=0,l=n.length;u<l;u++)e==null?a(n.charAt(u),u,n):a.call(e,n.charAt(u),u,n)},r=function(n,a,e){for(var u in n)f.call(n,u)&&(e==null?a(n[u],u,n):a.call(e,n[u],u,n))};function h(c){return t.call(c)==="[object Array]"}return forEach=function(n,a,e){if(!s(a))throw new TypeError("iterator must be a function");var u;arguments.length>=3&&(u=e),h(n)?o(n,a,u):typeof n=="string"?d(n,a,u):r(n,a,u)},forEach}var possibleTypedArrayNames,hasRequiredPossibleTypedArrayNames;function requirePossibleTypedArrayNames(){return hasRequiredPossibleTypedArrayNames||(hasRequiredPossibleTypedArrayNames=1,possibleTypedArrayNames=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]),possibleTypedArrayNames}var availableTypedArrays,hasRequiredAvailableTypedArrays;function requireAvailableTypedArrays(){if(hasRequiredAvailableTypedArrays)return availableTypedArrays;hasRequiredAvailableTypedArrays=1;var s=requirePossibleTypedArrayNames(),t=typeof globalThis>"u"?commonjsGlobal:globalThis;return availableTypedArrays=function(){for(var o=[],d=0;d<s.length;d++)typeof t[s[d]]=="function"&&(o[o.length]=s[d]);return o},availableTypedArrays}var callBind={exports:{}},defineDataProperty,hasRequiredDefineDataProperty;function requireDefineDataProperty(){if(hasRequiredDefineDataProperty)return defineDataProperty;hasRequiredDefineDataProperty=1;var s=requireEsDefineProperty(),t=requireSyntax(),f=requireType(),o=requireGopd();return defineDataProperty=function(r,h,c){if(!r||typeof r!="object"&&typeof r!="function")throw new f("`obj` must be an object or a function`");if(typeof h!="string"&&typeof h!="symbol")throw new f("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new f("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new f("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new f("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new f("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,a=arguments.length>4?arguments[4]:null,e=arguments.length>5?arguments[5]:null,u=arguments.length>6?arguments[6]:!1,l=!!o&&o(r,h);if(s)s(r,h,{configurable:e===null&&l?l.configurable:!e,enumerable:n===null&&l?l.enumerable:!n,value:c,writable:a===null&&l?l.writable:!a});else if(u||!n&&!a&&!e)r[h]=c;else throw new t("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},defineDataProperty}var hasPropertyDescriptors_1,hasRequiredHasPropertyDescriptors;function requireHasPropertyDescriptors(){if(hasRequiredHasPropertyDescriptors)return hasPropertyDescriptors_1;hasRequiredHasPropertyDescriptors=1;var s=requireEsDefineProperty(),t=function(){return!!s};return t.hasArrayLengthDefineBug=function(){if(!s)return null;try{return s([],"length",{value:1}).length!==1}catch{return!0}},hasPropertyDescriptors_1=t,hasPropertyDescriptors_1}var setFunctionLength,hasRequiredSetFunctionLength;function requireSetFunctionLength(){if(hasRequiredSetFunctionLength)return setFunctionLength;hasRequiredSetFunctionLength=1;var s=requireGetIntrinsic(),t=requireDefineDataProperty(),f=requireHasPropertyDescriptors()(),o=requireGopd(),d=requireType(),r=s("%Math.floor%");return setFunctionLength=function(c,n){if(typeof c!="function")throw new d("`fn` is not a function");if(typeof n!="number"||n<0||n>4294967295||r(n)!==n)throw new d("`length` must be a positive 32-bit integer");var a=arguments.length>2&&!!arguments[2],e=!0,u=!0;if("length"in c&&o){var l=o(c,"length");l&&!l.configurable&&(e=!1),l&&!l.writable&&(u=!1)}return(e||u||!a)&&(f?t(c,"length",n,!0,!0):t(c,"length",n)),c},setFunctionLength}var applyBind,hasRequiredApplyBind;function requireApplyBind(){if(hasRequiredApplyBind)return applyBind;hasRequiredApplyBind=1;var s=requireFunctionBind(),t=requireFunctionApply(),f=requireActualApply();return applyBind=function(){return f(s,t,arguments)},applyBind}var hasRequiredCallBind;function requireCallBind(){return hasRequiredCallBind||(hasRequiredCallBind=1,(function(s){var t=requireSetFunctionLength(),f=requireEsDefineProperty(),o=requireCallBindApplyHelpers(),d=requireApplyBind();s.exports=function(h){var c=o(arguments),n=h.length-(arguments.length-1);return t(c,1+(n>0?n:0),!0)},f?f(s.exports,"apply",{value:d}):s.exports.apply=d})(callBind)),callBind.exports}var whichTypedArray,hasRequiredWhichTypedArray;function requireWhichTypedArray(){if(hasRequiredWhichTypedArray)return whichTypedArray;hasRequiredWhichTypedArray=1;var s=requireForEach(),t=requireAvailableTypedArrays(),f=requireCallBind(),o=requireCallBound$1(),d=requireGopd(),r=requireGetProto(),h=o("Object.prototype.toString"),c=requireShams()(),n=typeof globalThis>"u"?commonjsGlobal:globalThis,a=t(),e=o("String.prototype.slice"),u=o("Array.prototype.indexOf",!0)||function(B,E){for(var S=0;S<B.length;S+=1)if(B[S]===E)return S;return-1},l={__proto__:null};c&&d&&r?s(a,function(m){var B=new n[m];if(Symbol.toStringTag in B&&r){var E=r(B),S=d(E,Symbol.toStringTag);if(!S&&E){var O=r(E);S=d(O,Symbol.toStringTag)}if(S&&S.get){var D=f(S.get);l["$"+m]=D}}}):s(a,function(m){var B=new n[m],E=B.slice||B.set;if(E){var S=f(E);l["$"+m]=S}});var v=function(B){var E=!1;return s(l,function(S,O){if(!E)try{"$"+S(B)===O&&(E=e(O,1))}catch{}}),E},b=function(B){var E=!1;return s(l,function(S,O){if(!E)try{S(B),E=e(O,1)}catch{}}),E};return whichTypedArray=function(B){if(!B||typeof B!="object")return!1;if(!c){var E=e(h(B),8,-1);return u(a,E)>-1?E:E!=="Object"?!1:b(B)}return d?v(B):null},whichTypedArray}var isTypedArray,hasRequiredIsTypedArray;function requireIsTypedArray(){if(hasRequiredIsTypedArray)return isTypedArray;hasRequiredIsTypedArray=1;var s=requireWhichTypedArray();return isTypedArray=function(f){return!!s(f)},isTypedArray}var hasRequiredTypes$1;function requireTypes$1(){return hasRequiredTypes$1||(hasRequiredTypes$1=1,(function(s){var t=requireIsArguments$1(),f=requireIsGeneratorFunction(),o=requireWhichTypedArray(),d=requireIsTypedArray();function r(be){return be.call.bind(be)}var h=typeof BigInt<"u",c=typeof Symbol<"u",n=r(Object.prototype.toString),a=r(Number.prototype.valueOf),e=r(String.prototype.valueOf),u=r(Boolean.prototype.valueOf);if(h)var l=r(BigInt.prototype.valueOf);if(c)var v=r(Symbol.prototype.valueOf);function b(be,Fe){if(typeof be!="object")return!1;try{return Fe(be),!0}catch{return!1}}s.isArgumentsObject=t,s.isGeneratorFunction=f,s.isTypedArray=d;function m(be){return typeof Promise<"u"&&be instanceof Promise||be!==null&&typeof be=="object"&&typeof be.then=="function"&&typeof be.catch=="function"}s.isPromise=m;function B(be){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(be):d(be)||L(be)}s.isArrayBufferView=B;function E(be){return o(be)==="Uint8Array"}s.isUint8Array=E;function S(be){return o(be)==="Uint8ClampedArray"}s.isUint8ClampedArray=S;function O(be){return o(be)==="Uint16Array"}s.isUint16Array=O;function D(be){return o(be)==="Uint32Array"}s.isUint32Array=D;function $(be){return o(be)==="Int8Array"}s.isInt8Array=$;function H(be){return o(be)==="Int16Array"}s.isInt16Array=H;function Y(be){return o(be)==="Int32Array"}s.isInt32Array=Y;function ie(be){return o(be)==="Float32Array"}s.isFloat32Array=ie;function ne(be){return o(be)==="Float64Array"}s.isFloat64Array=ne;function de(be){return o(be)==="BigInt64Array"}s.isBigInt64Array=de;function X(be){return o(be)==="BigUint64Array"}s.isBigUint64Array=X;function y(be){return n(be)==="[object Map]"}y.working=typeof Map<"u"&&y(new Map);function g(be){return typeof Map>"u"?!1:y.working?y(be):be instanceof Map}s.isMap=g;function p(be){return n(be)==="[object Set]"}p.working=typeof Set<"u"&&p(new Set);function _(be){return typeof Set>"u"?!1:p.working?p(be):be instanceof Set}s.isSet=_;function R(be){return n(be)==="[object WeakMap]"}R.working=typeof WeakMap<"u"&&R(new WeakMap);function q(be){return typeof WeakMap>"u"?!1:R.working?R(be):be instanceof WeakMap}s.isWeakMap=q;function T(be){return n(be)==="[object WeakSet]"}T.working=typeof WeakSet<"u"&&T(new WeakSet);function A(be){return T(be)}s.isWeakSet=A;function w(be){return n(be)==="[object ArrayBuffer]"}w.working=typeof ArrayBuffer<"u"&&w(new ArrayBuffer);function M(be){return typeof ArrayBuffer>"u"?!1:w.working?w(be):be instanceof ArrayBuffer}s.isArrayBuffer=M;function x(be){return n(be)==="[object DataView]"}x.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&x(new DataView(new ArrayBuffer(1),0,1));function L(be){return typeof DataView>"u"?!1:x.working?x(be):be instanceof DataView}s.isDataView=L;var K=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Q(be){return n(be)==="[object SharedArrayBuffer]"}function j(be){return typeof K>"u"?!1:(typeof Q.working>"u"&&(Q.working=Q(new K)),Q.working?Q(be):be instanceof K)}s.isSharedArrayBuffer=j;function N(be){return n(be)==="[object AsyncFunction]"}s.isAsyncFunction=N;function F(be){return n(be)==="[object Map Iterator]"}s.isMapIterator=F;function ee(be){return n(be)==="[object Set Iterator]"}s.isSetIterator=ee;function ae(be){return n(be)==="[object Generator]"}s.isGeneratorObject=ae;function G(be){return n(be)==="[object WebAssembly.Module]"}s.isWebAssemblyCompiledModule=G;function z(be){return b(be,a)}s.isNumberObject=z;function fe(be){return b(be,e)}s.isStringObject=fe;function me(be){return b(be,u)}s.isBooleanObject=me;function xe(be){return h&&b(be,l)}s.isBigIntObject=xe;function _e(be){return c&&b(be,v)}s.isSymbolObject=_e;function qe(be){return z(be)||fe(be)||me(be)||xe(be)||_e(be)}s.isBoxedPrimitive=qe;function Re(be){return typeof Uint8Array<"u"&&(M(be)||j(be))}s.isAnyArrayBuffer=Re,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(be){Object.defineProperty(s,be,{enumerable:!1,value:function(){throw new Error(be+" is not supported in userland")}})})})(types$1)),types$1}var isBufferBrowser,hasRequiredIsBufferBrowser;function requireIsBufferBrowser(){return hasRequiredIsBufferBrowser||(hasRequiredIsBufferBrowser=1,isBufferBrowser=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"}),isBufferBrowser}var hasRequiredUtil$1;function requireUtil$1(){return hasRequiredUtil$1||(hasRequiredUtil$1=1,(function(s){var t=Object.getOwnPropertyDescriptors||function(L){for(var K=Object.keys(L),Q={},j=0;j<K.length;j++)Q[K[j]]=Object.getOwnPropertyDescriptor(L,K[j]);return Q},f=/%[sdj%]/g;s.format=function(x){if(!$(x)){for(var L=[],K=0;K<arguments.length;K++)L.push(h(arguments[K]));return L.join(" ")}for(var K=1,Q=arguments,j=Q.length,N=String(x).replace(f,function(ee){if(ee==="%%")return"%";if(K>=j)return ee;switch(ee){case"%s":return String(Q[K++]);case"%d":return Number(Q[K++]);case"%j":try{return JSON.stringify(Q[K++])}catch{return"[Circular]"}default:return ee}}),F=Q[K];K<j;F=Q[++K])S(F)||!ne(F)?N+=" "+F:N+=" "+h(F);return N},s.deprecate=function(x,L){if(typeof process$1<"u"&&process$1.noDeprecation===!0)return x;if(typeof process$1>"u")return function(){return s.deprecate(x,L).apply(this,arguments)};var K=!1;function Q(){if(!K){if(process$1.throwDeprecation)throw new Error(L);process$1.traceDeprecation?console.trace(L):console.error(L),K=!0}return x.apply(this,arguments)}return Q};var o={},d=/^$/;if(process$1.env.NODE_DEBUG){var r=process$1.env.NODE_DEBUG;r=r.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),d=new RegExp("^"+r+"$","i")}s.debuglog=function(x){if(x=x.toUpperCase(),!o[x])if(d.test(x)){var L=process$1.pid;o[x]=function(){var K=s.format.apply(s,arguments);console.error("%s %d: %s",x,L,K)}}else o[x]=function(){};return o[x]};function h(x,L){var K={seen:[],stylize:n};return arguments.length>=3&&(K.depth=arguments[2]),arguments.length>=4&&(K.colors=arguments[3]),E(L)?K.showHidden=L:L&&s._extend(K,L),Y(K.showHidden)&&(K.showHidden=!1),Y(K.depth)&&(K.depth=2),Y(K.colors)&&(K.colors=!1),Y(K.customInspect)&&(K.customInspect=!0),K.colors&&(K.stylize=c),e(K,x,K.depth)}s.inspect=h,h.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]},h.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function c(x,L){var K=h.styles[L];return K?"\x1B["+h.colors[K][0]+"m"+x+"\x1B["+h.colors[K][1]+"m":x}function n(x,L){return x}function a(x){var L={};return x.forEach(function(K,Q){L[K]=!0}),L}function e(x,L,K){if(x.customInspect&&L&&y(L.inspect)&&L.inspect!==s.inspect&&!(L.constructor&&L.constructor.prototype===L)){var Q=L.inspect(K,x);return $(Q)||(Q=e(x,Q,K)),Q}var j=u(x,L);if(j)return j;var N=Object.keys(L),F=a(N);if(x.showHidden&&(N=Object.getOwnPropertyNames(L)),X(L)&&(N.indexOf("message")>=0||N.indexOf("description")>=0))return l(L);if(N.length===0){if(y(L)){var ee=L.name?": "+L.name:"";return x.stylize("[Function"+ee+"]","special")}if(ie(L))return x.stylize(RegExp.prototype.toString.call(L),"regexp");if(de(L))return x.stylize(Date.prototype.toString.call(L),"date");if(X(L))return l(L)}var ae="",G=!1,z=["{","}"];if(B(L)&&(G=!0,z=["[","]"]),y(L)){var fe=L.name?": "+L.name:"";ae=" [Function"+fe+"]"}if(ie(L)&&(ae=" "+RegExp.prototype.toString.call(L)),de(L)&&(ae=" "+Date.prototype.toUTCString.call(L)),X(L)&&(ae=" "+l(L)),N.length===0&&(!G||L.length==0))return z[0]+ae+z[1];if(K<0)return ie(L)?x.stylize(RegExp.prototype.toString.call(L),"regexp"):x.stylize("[Object]","special");x.seen.push(L);var me;return G?me=v(x,L,K,F,N):me=N.map(function(xe){return b(x,L,K,F,xe,G)}),x.seen.pop(),m(me,ae,z)}function u(x,L){if(Y(L))return x.stylize("undefined","undefined");if($(L)){var K="'"+JSON.stringify(L).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return x.stylize(K,"string")}if(D(L))return x.stylize(""+L,"number");if(E(L))return x.stylize(""+L,"boolean");if(S(L))return x.stylize("null","null")}function l(x){return"["+Error.prototype.toString.call(x)+"]"}function v(x,L,K,Q,j){for(var N=[],F=0,ee=L.length;F<ee;++F)T(L,String(F))?N.push(b(x,L,K,Q,String(F),!0)):N.push("");return j.forEach(function(ae){ae.match(/^\d+$/)||N.push(b(x,L,K,Q,ae,!0))}),N}function b(x,L,K,Q,j,N){var F,ee,ae;if(ae=Object.getOwnPropertyDescriptor(L,j)||{value:L[j]},ae.get?ae.set?ee=x.stylize("[Getter/Setter]","special"):ee=x.stylize("[Getter]","special"):ae.set&&(ee=x.stylize("[Setter]","special")),T(Q,j)||(F="["+j+"]"),ee||(x.seen.indexOf(ae.value)<0?(S(K)?ee=e(x,ae.value,null):ee=e(x,ae.value,K-1),ee.indexOf(`
|
|
3
3
|
`)>-1&&(N?ee=ee.split(`
|
|
4
|
-
`).map(function(
|
|
4
|
+
`).map(function(G){return" "+G}).join(`
|
|
5
5
|
`).slice(2):ee=`
|
|
6
6
|
`+ee.split(`
|
|
7
|
-
`).map(function(
|
|
8
|
-
`))):ee=x.stylize("[Circular]","special")),
|
|
9
|
-
`)>=0,
|
|
7
|
+
`).map(function(G){return" "+G}).join(`
|
|
8
|
+
`))):ee=x.stylize("[Circular]","special")),Y(F)){if(N&&j.match(/^\d+$/))return ee;F=JSON.stringify(""+j),F.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(F=F.slice(1,-1),F=x.stylize(F,"name")):(F=F.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),F=x.stylize(F,"string"))}return F+": "+ee}function m(x,L,K){var Q=x.reduce(function(j,N){return N.indexOf(`
|
|
9
|
+
`)>=0,j+N.replace(/\u001b\[\d\d?m/g,"").length+1},0);return Q>60?K[0]+(L===""?"":L+`
|
|
10
10
|
`)+" "+x.join(`,
|
|
11
|
-
`)+" "+K[1]:K[0]+L+" "+x.join(", ")+" "+K[1]}c.types=requireTypes$1();function q(x){return Array.isArray(x)}c.isArray=q;function E(x){return typeof x=="boolean"}c.isBoolean=E;function S(x){return x===null}c.isNull=S;function O(x){return x==null}c.isNullOrUndefined=O;function D(x){return typeof x=="number"}c.isNumber=D;function j(x){return typeof x=="string"}c.isString=j;function $(x){return typeof x=="symbol"}c.isSymbol=$;function J(x){return x===void 0}c.isUndefined=J;function ie(x){return ne(x)&&p(x)==="[object RegExp]"}c.isRegExp=ie,c.types.isRegExp=ie;function ne(x){return typeof x=="object"&&x!==null}c.isObject=ne;function de(x){return ne(x)&&p(x)==="[object Date]"}c.isDate=de,c.types.isDate=de;function Z(x){return ne(x)&&(p(x)==="[object Error]"||x instanceof Error)}c.isError=Z,c.types.isNativeError=Z;function y(x){return typeof x=="function"}c.isFunction=y;function g(x){return x===null||typeof x=="boolean"||typeof x=="number"||typeof x=="string"||typeof x=="symbol"||typeof x>"u"}c.isPrimitive=g,c.isBuffer=requireIsBufferBrowser();function p(x){return Object.prototype.toString.call(x)}function _(x){return x<10?"0"+x.toString(10):x.toString(10)}var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function B(){var x=new Date,L=[_(x.getHours()),_(x.getMinutes()),_(x.getSeconds())].join(":");return[x.getDate(),R[x.getMonth()],L].join(" ")}c.log=function(){console.log("%s - %s",B(),c.format.apply(c,arguments))},c.inherits=requireInherits_browser(),c._extend=function(x,L){if(!L||!ne(L))return x;for(var K=Object.keys(L),Q=K.length;Q--;)x[K[Q]]=L[K[Q]];return x};function P(x,L){return Object.prototype.hasOwnProperty.call(x,L)}var A=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;c.promisify=function(L){if(typeof L!="function")throw new TypeError('The "original" argument must be of type Function');if(A&&L[A]){var K=L[A];if(typeof K!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(K,A,{value:K,enumerable:!1,writable:!1,configurable:!0}),K}function K(){for(var Q,H,N=new Promise(function(ae,z){Q=ae,H=z}),F=[],ee=0;ee<arguments.length;ee++)F.push(arguments[ee]);F.push(function(ae,z){ae?H(ae):Q(z)});try{L.apply(this,F)}catch(ae){H(ae)}return N}return Object.setPrototypeOf(K,Object.getPrototypeOf(L)),A&&Object.defineProperty(K,A,{value:K,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(K,t(L))},c.promisify.custom=A;function w(x,L){if(!x){var K=new Error("Promise was rejected with a falsy value");K.reason=x,x=K}return L(x)}function M(x){if(typeof x!="function")throw new TypeError('The "original" argument must be of type Function');function L(){for(var K=[],Q=0;Q<arguments.length;Q++)K.push(arguments[Q]);var H=K.pop();if(typeof H!="function")throw new TypeError("The last argument must be of type Function");var N=this,F=function(){return H.apply(N,arguments)};x.apply(this,K).then(function(ee){process$1.nextTick(F.bind(null,null,ee))},function(ee){process$1.nextTick(w.bind(null,ee,F))})}return Object.setPrototypeOf(L,Object.getPrototypeOf(x)),Object.defineProperties(L,t(x)),L}c.callbackify=M})(util$1)),util$1}var buffer_list,hasRequiredBuffer_list;function requireBuffer_list(){if(hasRequiredBuffer_list)return buffer_list;hasRequiredBuffer_list=1;function c(b,m){var q=Object.keys(b);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(b);m&&(E=E.filter(function(S){return Object.getOwnPropertyDescriptor(b,S).enumerable})),q.push.apply(q,E)}return q}function t(b){for(var m=1;m<arguments.length;m++){var q=arguments[m]!=null?arguments[m]:{};m%2?c(Object(q),!0).forEach(function(E){u(b,E,q[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(q)):c(Object(q)).forEach(function(E){Object.defineProperty(b,E,Object.getOwnPropertyDescriptor(q,E))})}return b}function u(b,m,q){return m=h(m),m in b?Object.defineProperty(b,m,{value:q,enumerable:!0,configurable:!0,writable:!0}):b[m]=q,b}function o(b,m){if(!(b instanceof m))throw new TypeError("Cannot call a class as a function")}function d(b,m){for(var q=0;q<m.length;q++){var E=m[q];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(b,h(E.key),E)}}function r(b,m,q){return m&&d(b.prototype,m),Object.defineProperty(b,"prototype",{writable:!1}),b}function h(b){var m=f(b,"string");return typeof m=="symbol"?m:String(m)}function f(b,m){if(typeof b!="object"||b===null)return b;var q=b[Symbol.toPrimitive];if(q!==void 0){var E=q.call(b,m);if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(b)}var a=requireDist(),n=a.Buffer,e=requireUtil$1(),s=e.inspect,l=s&&s.custom||"inspect";function v(b,m,q){n.prototype.copy.call(b,m,q)}return buffer_list=(function(){function b(){o(this,b),this.head=null,this.tail=null,this.length=0}return r(b,[{key:"push",value:function(q){var E={data:q,next:null};this.length>0?this.tail.next=E:this.head=E,this.tail=E,++this.length}},{key:"unshift",value:function(q){var E={data:q,next:this.head};this.length===0&&(this.tail=E),this.head=E,++this.length}},{key:"shift",value:function(){if(this.length!==0){var q=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,q}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(q){if(this.length===0)return"";for(var E=this.head,S=""+E.data;E=E.next;)S+=q+E.data;return S}},{key:"concat",value:function(q){if(this.length===0)return n.alloc(0);for(var E=n.allocUnsafe(q>>>0),S=this.head,O=0;S;)v(S.data,E,O),O+=S.data.length,S=S.next;return E}},{key:"consume",value:function(q,E){var S;return q<this.head.data.length?(S=this.head.data.slice(0,q),this.head.data=this.head.data.slice(q)):q===this.head.data.length?S=this.shift():S=E?this._getString(q):this._getBuffer(q),S}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(q){var E=this.head,S=1,O=E.data;for(q-=O.length;E=E.next;){var D=E.data,j=q>D.length?D.length:q;if(j===D.length?O+=D:O+=D.slice(0,q),q-=j,q===0){j===D.length?(++S,E.next?this.head=E.next:this.head=this.tail=null):(this.head=E,E.data=D.slice(j));break}++S}return this.length-=S,O}},{key:"_getBuffer",value:function(q){var E=n.allocUnsafe(q),S=this.head,O=1;for(S.data.copy(E),q-=S.data.length;S=S.next;){var D=S.data,j=q>D.length?D.length:q;if(D.copy(E,E.length-q,0,j),q-=j,q===0){j===D.length?(++O,S.next?this.head=S.next:this.head=this.tail=null):(this.head=S,S.data=D.slice(j));break}++O}return this.length-=O,E}},{key:l,value:function(q,E){return s(this,t(t({},E),{},{depth:0,customInspect:!1}))}}]),b})(),buffer_list}var destroy_1$1,hasRequiredDestroy$1;function requireDestroy$1(){if(hasRequiredDestroy$1)return destroy_1$1;hasRequiredDestroy$1=1;function c(h,f){var a=this,n=this._readableState&&this._readableState.destroyed,e=this._writableState&&this._writableState.destroyed;return n||e?(f?f(h):h&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process$1.nextTick(d,this,h)):process$1.nextTick(d,this,h)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(h||null,function(s){!f&&s?a._writableState?a._writableState.errorEmitted?process$1.nextTick(u,a):(a._writableState.errorEmitted=!0,process$1.nextTick(t,a,s)):process$1.nextTick(t,a,s):f?(process$1.nextTick(u,a),f(s)):process$1.nextTick(u,a)}),this)}function t(h,f){d(h,f),u(h)}function u(h){h._writableState&&!h._writableState.emitClose||h._readableState&&!h._readableState.emitClose||h.emit("close")}function o(){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)}function d(h,f){h.emit("error",f)}function r(h,f){var a=h._readableState,n=h._writableState;a&&a.autoDestroy||n&&n.autoDestroy?h.destroy(f):h.emit("error",f)}return destroy_1$1={destroy:c,undestroy:o,errorOrDestroy:r},destroy_1$1}var errorsBrowser={},hasRequiredErrorsBrowser;function requireErrorsBrowser(){if(hasRequiredErrorsBrowser)return errorsBrowser;hasRequiredErrorsBrowser=1;function c(f,a){f.prototype=Object.create(a.prototype),f.prototype.constructor=f,f.__proto__=a}var t={};function u(f,a,n){n||(n=Error);function e(l,v,b){return typeof a=="string"?a:a(l,v,b)}var s=(function(l){c(v,l);function v(b,m,q){return l.call(this,e(b,m,q))||this}return v})(n);s.prototype.name=n.name,s.prototype.code=f,t[f]=s}function o(f,a){if(Array.isArray(f)){var n=f.length;return f=f.map(function(e){return String(e)}),n>2?"one of ".concat(a," ").concat(f.slice(0,n-1).join(", "),", or ")+f[n-1]:n===2?"one of ".concat(a," ").concat(f[0]," or ").concat(f[1]):"of ".concat(a," ").concat(f[0])}else return"of ".concat(a," ").concat(String(f))}function d(f,a,n){return f.substr(0,a.length)===a}function r(f,a,n){return(n===void 0||n>f.length)&&(n=f.length),f.substring(n-a.length,n)===a}function h(f,a,n){return typeof n!="number"&&(n=0),n+a.length>f.length?!1:f.indexOf(a,n)!==-1}return u("ERR_INVALID_OPT_VALUE",function(f,a){return'The value "'+a+'" is invalid for option "'+f+'"'},TypeError),u("ERR_INVALID_ARG_TYPE",function(f,a,n){var e;typeof a=="string"&&d(a,"not ")?(e="must not be",a=a.replace(/^not /,"")):e="must be";var s;if(r(f," argument"))s="The ".concat(f," ").concat(e," ").concat(o(a,"type"));else{var l=h(f,".")?"property":"argument";s='The "'.concat(f,'" ').concat(l," ").concat(e," ").concat(o(a,"type"))}return s+=". Received type ".concat(typeof n),s},TypeError),u("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),u("ERR_METHOD_NOT_IMPLEMENTED",function(f){return"The "+f+" method is not implemented"}),u("ERR_STREAM_PREMATURE_CLOSE","Premature close"),u("ERR_STREAM_DESTROYED",function(f){return"Cannot call "+f+" after a stream was destroyed"}),u("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),u("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),u("ERR_STREAM_WRITE_AFTER_END","write after end"),u("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),u("ERR_UNKNOWN_ENCODING",function(f){return"Unknown encoding: "+f},TypeError),u("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),errorsBrowser.codes=t,errorsBrowser}var state,hasRequiredState;function requireState(){if(hasRequiredState)return state;hasRequiredState=1;var c=requireErrorsBrowser().codes.ERR_INVALID_OPT_VALUE;function t(o,d,r){return o.highWaterMark!=null?o.highWaterMark:d?o[r]:null}function u(o,d,r,h){var f=t(d,h,r);if(f!=null){if(!(isFinite(f)&&Math.floor(f)===f)||f<0){var a=h?r:"highWaterMark";throw new c(a,f)}return Math.floor(f)}return o.objectMode?16:16*1024}return state={getHighWaterMark:u},state}var browser$a,hasRequiredBrowser$a;function requireBrowser$a(){if(hasRequiredBrowser$a)return browser$a;hasRequiredBrowser$a=1,browser$a=c;function c(u,o){if(t("noDeprecation"))return u;var d=!1;function r(){if(!d){if(t("throwDeprecation"))throw new Error(o);t("traceDeprecation")?console.trace(o):console.warn(o),d=!0}return u.apply(this,arguments)}return r}function t(u){try{if(!commonjsGlobal.localStorage)return!1}catch{return!1}var o=commonjsGlobal.localStorage[u];return o==null?!1:String(o).toLowerCase()==="true"}return browser$a}var _stream_writable$1,hasRequired_stream_writable$1;function require_stream_writable$1(){if(hasRequired_stream_writable$1)return _stream_writable$1;hasRequired_stream_writable$1=1,_stream_writable$1=ie;function c(H){var N=this;this.next=null,this.entry=null,this.finish=function(){Q(N,H)}}var t;ie.WritableState=$;var u={deprecate:requireBrowser$a()},o=requireStreamBrowser$1(),d=requireDist().Buffer,r=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function h(H){return d.from(H)}function f(H){return d.isBuffer(H)||H instanceof r}var a=requireDestroy$1(),n=requireState(),e=n.getHighWaterMark,s=requireErrorsBrowser().codes,l=s.ERR_INVALID_ARG_TYPE,v=s.ERR_METHOD_NOT_IMPLEMENTED,b=s.ERR_MULTIPLE_CALLBACK,m=s.ERR_STREAM_CANNOT_PIPE,q=s.ERR_STREAM_DESTROYED,E=s.ERR_STREAM_NULL_VALUES,S=s.ERR_STREAM_WRITE_AFTER_END,O=s.ERR_UNKNOWN_ENCODING,D=a.errorOrDestroy;requireInherits_browser()(ie,o);function j(){}function $(H,N,F){t=t||require_stream_duplex$1(),H=H||{},typeof F!="boolean"&&(F=N instanceof t),this.objectMode=!!H.objectMode,F&&(this.objectMode=this.objectMode||!!H.writableObjectMode),this.highWaterMark=e(this,H,"writableHighWaterMark",F),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var ee=H.decodeStrings===!1;this.decodeStrings=!ee,this.defaultEncoding=H.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ae){R(N,ae)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=H.emitClose!==!1,this.autoDestroy=!!H.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new c(this)}$.prototype.getBuffer=function(){for(var N=this.bufferedRequest,F=[];N;)F.push(N),N=N.next;return F},(function(){try{Object.defineProperty($.prototype,"buffer",{get:u.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var J;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(J=Function.prototype[Symbol.hasInstance],Object.defineProperty(ie,Symbol.hasInstance,{value:function(N){return J.call(this,N)?!0:this!==ie?!1:N&&N._writableState instanceof $}})):J=function(N){return N instanceof this};function ie(H){t=t||require_stream_duplex$1();var N=this instanceof t;if(!N&&!J.call(ie,this))return new ie(H);this._writableState=new $(H,this,N),this.writable=!0,H&&(typeof H.write=="function"&&(this._write=H.write),typeof H.writev=="function"&&(this._writev=H.writev),typeof H.destroy=="function"&&(this._destroy=H.destroy),typeof H.final=="function"&&(this._final=H.final)),o.call(this)}ie.prototype.pipe=function(){D(this,new m)};function ne(H,N){var F=new S;D(H,F),process$1.nextTick(N,F)}function de(H,N,F,ee){var ae;return F===null?ae=new E:typeof F!="string"&&!N.objectMode&&(ae=new l("chunk",["string","Buffer"],F)),ae?(D(H,ae),process$1.nextTick(ee,ae),!1):!0}ie.prototype.write=function(H,N,F){var ee=this._writableState,ae=!1,z=!ee.objectMode&&f(H);return z&&!d.isBuffer(H)&&(H=h(H)),typeof N=="function"&&(F=N,N=null),z?N="buffer":N||(N=ee.defaultEncoding),typeof F!="function"&&(F=j),ee.ending?ne(this,F):(z||de(this,ee,H,F))&&(ee.pendingcb++,ae=y(this,ee,z,H,N,F)),ae},ie.prototype.cork=function(){this._writableState.corked++},ie.prototype.uncork=function(){var H=this._writableState;H.corked&&(H.corked--,!H.writing&&!H.corked&&!H.bufferProcessing&&H.bufferedRequest&&A(this,H))},ie.prototype.setDefaultEncoding=function(N){if(typeof N=="string"&&(N=N.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((N+"").toLowerCase())>-1))throw new O(N);return this._writableState.defaultEncoding=N,this},Object.defineProperty(ie.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Z(H,N,F){return!H.objectMode&&H.decodeStrings!==!1&&typeof N=="string"&&(N=d.from(N,F)),N}Object.defineProperty(ie.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function y(H,N,F,ee,ae,z){if(!F){var G=Z(N,ee,ae);ee!==G&&(F=!0,ae="buffer",ee=G)}var fe=N.objectMode?1:ee.length;N.length+=fe;var me=N.length<N.highWaterMark;if(me||(N.needDrain=!0),N.writing||N.corked){var xe=N.lastBufferedRequest;N.lastBufferedRequest={chunk:ee,encoding:ae,isBuf:F,callback:z,next:null},xe?xe.next=N.lastBufferedRequest:N.bufferedRequest=N.lastBufferedRequest,N.bufferedRequestCount+=1}else g(H,N,!1,fe,ee,ae,z);return me}function g(H,N,F,ee,ae,z,G){N.writelen=ee,N.writecb=G,N.writing=!0,N.sync=!0,N.destroyed?N.onwrite(new q("write")):F?H._writev(ae,N.onwrite):H._write(ae,z,N.onwrite),N.sync=!1}function p(H,N,F,ee,ae){--N.pendingcb,F?(process$1.nextTick(ae,ee),process$1.nextTick(L,H,N),H._writableState.errorEmitted=!0,D(H,ee)):(ae(ee),H._writableState.errorEmitted=!0,D(H,ee),L(H,N))}function _(H){H.writing=!1,H.writecb=null,H.length-=H.writelen,H.writelen=0}function R(H,N){var F=H._writableState,ee=F.sync,ae=F.writecb;if(typeof ae!="function")throw new b;if(_(F),N)p(H,F,ee,N,ae);else{var z=w(F)||H.destroyed;!z&&!F.corked&&!F.bufferProcessing&&F.bufferedRequest&&A(H,F),ee?process$1.nextTick(B,H,F,z,ae):B(H,F,z,ae)}}function B(H,N,F,ee){F||P(H,N),N.pendingcb--,ee(),L(H,N)}function P(H,N){N.length===0&&N.needDrain&&(N.needDrain=!1,H.emit("drain"))}function A(H,N){N.bufferProcessing=!0;var F=N.bufferedRequest;if(H._writev&&F&&F.next){var ee=N.bufferedRequestCount,ae=new Array(ee),z=N.corkedRequestsFree;z.entry=F;for(var G=0,fe=!0;F;)ae[G]=F,F.isBuf||(fe=!1),F=F.next,G+=1;ae.allBuffers=fe,g(H,N,!0,N.length,ae,"",z.finish),N.pendingcb++,N.lastBufferedRequest=null,z.next?(N.corkedRequestsFree=z.next,z.next=null):N.corkedRequestsFree=new c(N),N.bufferedRequestCount=0}else{for(;F;){var me=F.chunk,xe=F.encoding,_e=F.callback,qe=N.objectMode?1:me.length;if(g(H,N,!1,qe,me,xe,_e),F=F.next,N.bufferedRequestCount--,N.writing)break}F===null&&(N.lastBufferedRequest=null)}N.bufferedRequest=F,N.bufferProcessing=!1}ie.prototype._write=function(H,N,F){F(new v("_write()"))},ie.prototype._writev=null,ie.prototype.end=function(H,N,F){var ee=this._writableState;return typeof H=="function"?(F=H,H=null,N=null):typeof N=="function"&&(F=N,N=null),H!=null&&this.write(H,N),ee.corked&&(ee.corked=1,this.uncork()),ee.ending||K(this,ee,F),this},Object.defineProperty(ie.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function w(H){return H.ending&&H.length===0&&H.bufferedRequest===null&&!H.finished&&!H.writing}function M(H,N){H._final(function(F){N.pendingcb--,F&&D(H,F),N.prefinished=!0,H.emit("prefinish"),L(H,N)})}function x(H,N){!N.prefinished&&!N.finalCalled&&(typeof H._final=="function"&&!N.destroyed?(N.pendingcb++,N.finalCalled=!0,process$1.nextTick(M,H,N)):(N.prefinished=!0,H.emit("prefinish")))}function L(H,N){var F=w(N);if(F&&(x(H,N),N.pendingcb===0&&(N.finished=!0,H.emit("finish"),N.autoDestroy))){var ee=H._readableState;(!ee||ee.autoDestroy&&ee.endEmitted)&&H.destroy()}return F}function K(H,N,F){N.ending=!0,L(H,N),F&&(N.finished?process$1.nextTick(F):H.once("finish",F)),N.ended=!0,H.writable=!1}function Q(H,N,F){var ee=H.entry;for(H.entry=null;ee;){var ae=ee.callback;N.pendingcb--,ae(F),ee=ee.next}N.corkedRequestsFree.next=H}return Object.defineProperty(ie.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(N){this._writableState&&(this._writableState.destroyed=N)}}),ie.prototype.destroy=a.destroy,ie.prototype._undestroy=a.undestroy,ie.prototype._destroy=function(H,N){N(H)},_stream_writable$1}var _stream_duplex$1,hasRequired_stream_duplex$1;function require_stream_duplex$1(){if(hasRequired_stream_duplex$1)return _stream_duplex$1;hasRequired_stream_duplex$1=1;var c=Object.keys||function(n){var e=[];for(var s in n)e.push(s);return e};_stream_duplex$1=h;var t=require_stream_readable$1(),u=require_stream_writable$1();requireInherits_browser()(h,t);for(var o=c(u.prototype),d=0;d<o.length;d++){var r=o[d];h.prototype[r]||(h.prototype[r]=u.prototype[r])}function h(n){if(!(this instanceof h))return new h(n);t.call(this,n),u.call(this,n),this.allowHalfOpen=!0,n&&(n.readable===!1&&(this.readable=!1),n.writable===!1&&(this.writable=!1),n.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",f)))}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(h.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function f(){this._writableState.ended||process$1.nextTick(a,this)}function a(n){n.end()}return Object.defineProperty(h.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),_stream_duplex$1}var string_decoder={},hasRequiredString_decoder;function requireString_decoder(){if(hasRequiredString_decoder)return string_decoder;hasRequiredString_decoder=1;var c=requireSafeBuffer$1().Buffer,t=c.isEncoding||function(E){switch(E=""+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 u(E){if(!E)return"utf8";for(var S;;)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(S)return;E=(""+E).toLowerCase(),S=!0}}function o(E){var S=u(E);if(typeof S!="string"&&(c.isEncoding===t||!t(E)))throw new Error("Unknown encoding: "+E);return S||E}string_decoder.StringDecoder=d;function d(E){this.encoding=o(E);var S;switch(this.encoding){case"utf16le":this.text=s,this.end=l,S=4;break;case"utf8":this.fillLast=a,S=4;break;case"base64":this.text=v,this.end=b,S=3;break;default:this.write=m,this.end=q;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=c.allocUnsafe(S)}d.prototype.write=function(E){if(E.length===0)return"";var S,O;if(this.lastNeed){if(S=this.fillLast(E),S===void 0)return"";O=this.lastNeed,this.lastNeed=0}else O=0;return O<E.length?S?S+this.text(E,O):this.text(E,O):S||""},d.prototype.end=e,d.prototype.text=n,d.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};function r(E){return E<=127?0:E>>5===6?2:E>>4===14?3:E>>3===30?4:E>>6===2?-1:-2}function h(E,S,O){var D=S.length-1;if(D<O)return 0;var j=r(S[D]);return j>=0?(j>0&&(E.lastNeed=j-1),j):--D<O||j===-2?0:(j=r(S[D]),j>=0?(j>0&&(E.lastNeed=j-2),j):--D<O||j===-2?0:(j=r(S[D]),j>=0?(j>0&&(j===2?j=0:E.lastNeed=j-3),j):0))}function f(E,S,O){if((S[0]&192)!==128)return E.lastNeed=0,"�";if(E.lastNeed>1&&S.length>1){if((S[1]&192)!==128)return E.lastNeed=1,"�";if(E.lastNeed>2&&S.length>2&&(S[2]&192)!==128)return E.lastNeed=2,"�"}}function a(E){var S=this.lastTotal-this.lastNeed,O=f(this,E);if(O!==void 0)return O;if(this.lastNeed<=E.length)return E.copy(this.lastChar,S,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);E.copy(this.lastChar,S,0,E.length),this.lastNeed-=E.length}function n(E,S){var O=h(this,E,S);if(!this.lastNeed)return E.toString("utf8",S);this.lastTotal=O;var D=E.length-(O-this.lastNeed);return E.copy(this.lastChar,0,D),E.toString("utf8",S,D)}function e(E){var S=E&&E.length?this.write(E):"";return this.lastNeed?S+"�":S}function s(E,S){if((E.length-S)%2===0){var O=E.toString("utf16le",S);if(O){var D=O.charCodeAt(O.length-1);if(D>=55296&&D<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=E[E.length-2],this.lastChar[1]=E[E.length-1],O.slice(0,-1)}return O}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=E[E.length-1],E.toString("utf16le",S,E.length-1)}function l(E){var S=E&&E.length?this.write(E):"";if(this.lastNeed){var O=this.lastTotal-this.lastNeed;return S+this.lastChar.toString("utf16le",0,O)}return S}function v(E,S){var O=(E.length-S)%3;return O===0?E.toString("base64",S):(this.lastNeed=3-O,this.lastTotal=3,O===1?this.lastChar[0]=E[E.length-1]:(this.lastChar[0]=E[E.length-2],this.lastChar[1]=E[E.length-1]),E.toString("base64",S,E.length-O))}function b(E){var S=E&&E.length?this.write(E):"";return this.lastNeed?S+this.lastChar.toString("base64",0,3-this.lastNeed):S}function m(E){return E.toString(this.encoding)}function q(E){return E&&E.length?this.write(E):""}return string_decoder}var endOfStream,hasRequiredEndOfStream;function requireEndOfStream(){if(hasRequiredEndOfStream)return endOfStream;hasRequiredEndOfStream=1;var c=requireErrorsBrowser().codes.ERR_STREAM_PREMATURE_CLOSE;function t(r){var h=!1;return function(){if(!h){h=!0;for(var f=arguments.length,a=new Array(f),n=0;n<f;n++)a[n]=arguments[n];r.apply(this,a)}}}function u(){}function o(r){return r.setHeader&&typeof r.abort=="function"}function d(r,h,f){if(typeof h=="function")return d(r,null,h);h||(h={}),f=t(f||u);var a=h.readable||h.readable!==!1&&r.readable,n=h.writable||h.writable!==!1&&r.writable,e=function(){r.writable||l()},s=r._writableState&&r._writableState.finished,l=function(){n=!1,s=!0,a||f.call(r)},v=r._readableState&&r._readableState.endEmitted,b=function(){a=!1,v=!0,n||f.call(r)},m=function(O){f.call(r,O)},q=function(){var O;if(a&&!v)return(!r._readableState||!r._readableState.ended)&&(O=new c),f.call(r,O);if(n&&!s)return(!r._writableState||!r._writableState.ended)&&(O=new c),f.call(r,O)},E=function(){r.req.on("finish",l)};return o(r)?(r.on("complete",l),r.on("abort",q),r.req?E():r.on("request",E)):n&&!r._writableState&&(r.on("end",e),r.on("close",e)),r.on("end",b),r.on("finish",l),h.error!==!1&&r.on("error",m),r.on("close",q),function(){r.removeListener("complete",l),r.removeListener("abort",q),r.removeListener("request",E),r.req&&r.req.removeListener("finish",l),r.removeListener("end",e),r.removeListener("close",e),r.removeListener("finish",l),r.removeListener("end",b),r.removeListener("error",m),r.removeListener("close",q)}}return endOfStream=d,endOfStream}var async_iterator,hasRequiredAsync_iterator;function requireAsync_iterator(){if(hasRequiredAsync_iterator)return async_iterator;hasRequiredAsync_iterator=1;var c;function t(O,D,j){return D=u(D),D in O?Object.defineProperty(O,D,{value:j,enumerable:!0,configurable:!0,writable:!0}):O[D]=j,O}function u(O){var D=o(O,"string");return typeof D=="symbol"?D:String(D)}function o(O,D){if(typeof O!="object"||O===null)return O;var j=O[Symbol.toPrimitive];if(j!==void 0){var $=j.call(O,D);if(typeof $!="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return(D==="string"?String:Number)(O)}var d=requireEndOfStream(),r=Symbol("lastResolve"),h=Symbol("lastReject"),f=Symbol("error"),a=Symbol("ended"),n=Symbol("lastPromise"),e=Symbol("handlePromise"),s=Symbol("stream");function l(O,D){return{value:O,done:D}}function v(O){var D=O[r];if(D!==null){var j=O[s].read();j!==null&&(O[n]=null,O[r]=null,O[h]=null,D(l(j,!1)))}}function b(O){process$1.nextTick(v,O)}function m(O,D){return function(j,$){O.then(function(){if(D[a]){j(l(void 0,!0));return}D[e](j,$)},$)}}var q=Object.getPrototypeOf(function(){}),E=Object.setPrototypeOf((c={get stream(){return this[s]},next:function(){var D=this,j=this[f];if(j!==null)return Promise.reject(j);if(this[a])return Promise.resolve(l(void 0,!0));if(this[s].destroyed)return new Promise(function(ne,de){process$1.nextTick(function(){D[f]?de(D[f]):ne(l(void 0,!0))})});var $=this[n],J;if($)J=new Promise(m($,this));else{var ie=this[s].read();if(ie!==null)return Promise.resolve(l(ie,!1));J=new Promise(this[e])}return this[n]=J,J}},t(c,Symbol.asyncIterator,function(){return this}),t(c,"return",function(){var D=this;return new Promise(function(j,$){D[s].destroy(null,function(J){if(J){$(J);return}j(l(void 0,!0))})})}),c),q),S=function(D){var j,$=Object.create(E,(j={},t(j,s,{value:D,writable:!0}),t(j,r,{value:null,writable:!0}),t(j,h,{value:null,writable:!0}),t(j,f,{value:null,writable:!0}),t(j,a,{value:D._readableState.endEmitted,writable:!0}),t(j,e,{value:function(ie,ne){var de=$[s].read();de?($[n]=null,$[r]=null,$[h]=null,ie(l(de,!1))):($[r]=ie,$[h]=ne)},writable:!0}),j));return $[n]=null,d(D,function(J){if(J&&J.code!=="ERR_STREAM_PREMATURE_CLOSE"){var ie=$[h];ie!==null&&($[n]=null,$[r]=null,$[h]=null,ie(J)),$[f]=J;return}var ne=$[r];ne!==null&&($[n]=null,$[r]=null,$[h]=null,ne(l(void 0,!0))),$[a]=!0}),D.on("readable",b.bind(null,$)),$};return async_iterator=S,async_iterator}var fromBrowser,hasRequiredFromBrowser;function requireFromBrowser(){return hasRequiredFromBrowser||(hasRequiredFromBrowser=1,fromBrowser=function(){throw new Error("Readable.from is not available in the browser")}),fromBrowser}var _stream_readable$1,hasRequired_stream_readable$1;function require_stream_readable$1(){if(hasRequired_stream_readable$1)return _stream_readable$1;hasRequired_stream_readable$1=1,_stream_readable$1=ne;var c;ne.ReadableState=ie,requireEvents().EventEmitter;var t=function(G,fe){return G.listeners(fe).length},u=requireStreamBrowser$1(),o=requireDist().Buffer,d=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function r(z){return o.from(z)}function h(z){return o.isBuffer(z)||z instanceof d}var f=requireUtil$1(),a;f&&f.debuglog?a=f.debuglog("stream"):a=function(){};var n=requireBuffer_list(),e=requireDestroy$1(),s=requireState(),l=s.getHighWaterMark,v=requireErrorsBrowser().codes,b=v.ERR_INVALID_ARG_TYPE,m=v.ERR_STREAM_PUSH_AFTER_EOF,q=v.ERR_METHOD_NOT_IMPLEMENTED,E=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,S,O,D;requireInherits_browser()(ne,u);var j=e.errorOrDestroy,$=["error","close","destroy","pause","resume"];function J(z,G,fe){if(typeof z.prependListener=="function")return z.prependListener(G,fe);!z._events||!z._events[G]?z.on(G,fe):Array.isArray(z._events[G])?z._events[G].unshift(fe):z._events[G]=[fe,z._events[G]]}function ie(z,G,fe){c=c||require_stream_duplex$1(),z=z||{},typeof fe!="boolean"&&(fe=G instanceof c),this.objectMode=!!z.objectMode,fe&&(this.objectMode=this.objectMode||!!z.readableObjectMode),this.highWaterMark=l(this,z,"readableHighWaterMark",fe),this.buffer=new n,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=z.emitClose!==!1,this.autoDestroy=!!z.autoDestroy,this.destroyed=!1,this.defaultEncoding=z.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,z.encoding&&(S||(S=requireString_decoder().StringDecoder),this.decoder=new S(z.encoding),this.encoding=z.encoding)}function ne(z){if(c=c||require_stream_duplex$1(),!(this instanceof ne))return new ne(z);var G=this instanceof c;this._readableState=new ie(z,this,G),this.readable=!0,z&&(typeof z.read=="function"&&(this._read=z.read),typeof z.destroy=="function"&&(this._destroy=z.destroy)),u.call(this)}Object.defineProperty(ne.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(G){this._readableState&&(this._readableState.destroyed=G)}}),ne.prototype.destroy=e.destroy,ne.prototype._undestroy=e.undestroy,ne.prototype._destroy=function(z,G){G(z)},ne.prototype.push=function(z,G){var fe=this._readableState,me;return fe.objectMode?me=!0:typeof z=="string"&&(G=G||fe.defaultEncoding,G!==fe.encoding&&(z=o.from(z,G),G=""),me=!0),de(this,z,G,!1,me)},ne.prototype.unshift=function(z){return de(this,z,null,!0,!1)};function de(z,G,fe,me,xe){a("readableAddChunk",G);var _e=z._readableState;if(G===null)_e.reading=!1,R(z,_e);else{var qe;if(xe||(qe=y(_e,G)),qe)j(z,qe);else if(_e.objectMode||G&&G.length>0)if(typeof G!="string"&&!_e.objectMode&&Object.getPrototypeOf(G)!==o.prototype&&(G=r(G)),me)_e.endEmitted?j(z,new E):Z(z,_e,G,!0);else if(_e.ended)j(z,new m);else{if(_e.destroyed)return!1;_e.reading=!1,_e.decoder&&!fe?(G=_e.decoder.write(G),_e.objectMode||G.length!==0?Z(z,_e,G,!1):A(z,_e)):Z(z,_e,G,!1)}else me||(_e.reading=!1,A(z,_e))}return!_e.ended&&(_e.length<_e.highWaterMark||_e.length===0)}function Z(z,G,fe,me){G.flowing&&G.length===0&&!G.sync?(G.awaitDrain=0,z.emit("data",fe)):(G.length+=G.objectMode?1:fe.length,me?G.buffer.unshift(fe):G.buffer.push(fe),G.needReadable&&B(z)),A(z,G)}function y(z,G){var fe;return!h(G)&&typeof G!="string"&&G!==void 0&&!z.objectMode&&(fe=new b("chunk",["string","Buffer","Uint8Array"],G)),fe}ne.prototype.isPaused=function(){return this._readableState.flowing===!1},ne.prototype.setEncoding=function(z){S||(S=requireString_decoder().StringDecoder);var G=new S(z);this._readableState.decoder=G,this._readableState.encoding=this._readableState.decoder.encoding;for(var fe=this._readableState.buffer.head,me="";fe!==null;)me+=G.write(fe.data),fe=fe.next;return this._readableState.buffer.clear(),me!==""&&this._readableState.buffer.push(me),this._readableState.length=me.length,this};var g=1073741824;function p(z){return z>=g?z=g:(z--,z|=z>>>1,z|=z>>>2,z|=z>>>4,z|=z>>>8,z|=z>>>16,z++),z}function _(z,G){return z<=0||G.length===0&&G.ended?0:G.objectMode?1:z!==z?G.flowing&&G.length?G.buffer.head.data.length:G.length:(z>G.highWaterMark&&(G.highWaterMark=p(z)),z<=G.length?z:G.ended?G.length:(G.needReadable=!0,0))}ne.prototype.read=function(z){a("read",z),z=parseInt(z,10);var G=this._readableState,fe=z;if(z!==0&&(G.emittedReadable=!1),z===0&&G.needReadable&&((G.highWaterMark!==0?G.length>=G.highWaterMark:G.length>0)||G.ended))return a("read: emitReadable",G.length,G.ended),G.length===0&&G.ended?F(this):B(this),null;if(z=_(z,G),z===0&&G.ended)return G.length===0&&F(this),null;var me=G.needReadable;a("need readable",me),(G.length===0||G.length-z<G.highWaterMark)&&(me=!0,a("length less than watermark",me)),G.ended||G.reading?(me=!1,a("reading or ended",me)):me&&(a("do read"),G.reading=!0,G.sync=!0,G.length===0&&(G.needReadable=!0),this._read(G.highWaterMark),G.sync=!1,G.reading||(z=_(fe,G)));var xe;return z>0?xe=N(z,G):xe=null,xe===null?(G.needReadable=G.length<=G.highWaterMark,z=0):(G.length-=z,G.awaitDrain=0),G.length===0&&(G.ended||(G.needReadable=!0),fe!==z&&G.ended&&F(this)),xe!==null&&this.emit("data",xe),xe};function R(z,G){if(a("onEofChunk"),!G.ended){if(G.decoder){var fe=G.decoder.end();fe&&fe.length&&(G.buffer.push(fe),G.length+=G.objectMode?1:fe.length)}G.ended=!0,G.sync?B(z):(G.needReadable=!1,G.emittedReadable||(G.emittedReadable=!0,P(z)))}}function B(z){var G=z._readableState;a("emitReadable",G.needReadable,G.emittedReadable),G.needReadable=!1,G.emittedReadable||(a("emitReadable",G.flowing),G.emittedReadable=!0,process$1.nextTick(P,z))}function P(z){var G=z._readableState;a("emitReadable_",G.destroyed,G.length,G.ended),!G.destroyed&&(G.length||G.ended)&&(z.emit("readable"),G.emittedReadable=!1),G.needReadable=!G.flowing&&!G.ended&&G.length<=G.highWaterMark,H(z)}function A(z,G){G.readingMore||(G.readingMore=!0,process$1.nextTick(w,z,G))}function w(z,G){for(;!G.reading&&!G.ended&&(G.length<G.highWaterMark||G.flowing&&G.length===0);){var fe=G.length;if(a("maybeReadMore read 0"),z.read(0),fe===G.length)break}G.readingMore=!1}ne.prototype._read=function(z){j(this,new q("_read()"))},ne.prototype.pipe=function(z,G){var fe=this,me=this._readableState;switch(me.pipesCount){case 0:me.pipes=z;break;case 1:me.pipes=[me.pipes,z];break;default:me.pipes.push(z);break}me.pipesCount+=1,a("pipe count=%d opts=%j",me.pipesCount,G);var xe=(!G||G.end!==!1)&&z!==process$1.stdout&&z!==process$1.stderr,_e=xe?Re:ge;me.endEmitted?process$1.nextTick(_e):fe.once("end",_e),z.on("unpipe",qe);function qe(we,Se){a("onunpipe"),we===fe&&Se&&Se.hasUnpiped===!1&&(Se.hasUnpiped=!0,Be())}function Re(){a("onend"),z.end()}var be=M(fe);z.on("drain",be);var Fe=!1;function Be(){a("cleanup"),z.removeListener("close",oe),z.removeListener("finish",ce),z.removeListener("drain",be),z.removeListener("error",Te),z.removeListener("unpipe",qe),fe.removeListener("end",Re),fe.removeListener("end",ge),fe.removeListener("data",Me),Fe=!0,me.awaitDrain&&(!z._writableState||z._writableState.needDrain)&&be()}fe.on("data",Me);function Me(we){a("ondata");var Se=z.write(we);a("dest.write",Se),Se===!1&&((me.pipesCount===1&&me.pipes===z||me.pipesCount>1&&ae(me.pipes,z)!==-1)&&!Fe&&(a("false write response, pause",me.awaitDrain),me.awaitDrain++),fe.pause())}function Te(we){a("onerror",we),ge(),z.removeListener("error",Te),t(z,"error")===0&&j(z,we)}J(z,"error",Te);function oe(){z.removeListener("finish",ce),ge()}z.once("close",oe);function ce(){a("onfinish"),z.removeListener("close",oe),ge()}z.once("finish",ce);function ge(){a("unpipe"),fe.unpipe(z)}return z.emit("pipe",fe),me.flowing||(a("pipe resume"),fe.resume()),z};function M(z){return function(){var fe=z._readableState;a("pipeOnDrain",fe.awaitDrain),fe.awaitDrain&&fe.awaitDrain--,fe.awaitDrain===0&&t(z,"data")&&(fe.flowing=!0,H(z))}}ne.prototype.unpipe=function(z){var G=this._readableState,fe={hasUnpiped:!1};if(G.pipesCount===0)return this;if(G.pipesCount===1)return z&&z!==G.pipes?this:(z||(z=G.pipes),G.pipes=null,G.pipesCount=0,G.flowing=!1,z&&z.emit("unpipe",this,fe),this);if(!z){var me=G.pipes,xe=G.pipesCount;G.pipes=null,G.pipesCount=0,G.flowing=!1;for(var _e=0;_e<xe;_e++)me[_e].emit("unpipe",this,{hasUnpiped:!1});return this}var qe=ae(G.pipes,z);return qe===-1?this:(G.pipes.splice(qe,1),G.pipesCount-=1,G.pipesCount===1&&(G.pipes=G.pipes[0]),z.emit("unpipe",this,fe),this)},ne.prototype.on=function(z,G){var fe=u.prototype.on.call(this,z,G),me=this._readableState;return z==="data"?(me.readableListening=this.listenerCount("readable")>0,me.flowing!==!1&&this.resume()):z==="readable"&&!me.endEmitted&&!me.readableListening&&(me.readableListening=me.needReadable=!0,me.flowing=!1,me.emittedReadable=!1,a("on readable",me.length,me.reading),me.length?B(this):me.reading||process$1.nextTick(L,this)),fe},ne.prototype.addListener=ne.prototype.on,ne.prototype.removeListener=function(z,G){var fe=u.prototype.removeListener.call(this,z,G);return z==="readable"&&process$1.nextTick(x,this),fe},ne.prototype.removeAllListeners=function(z){var G=u.prototype.removeAllListeners.apply(this,arguments);return(z==="readable"||z===void 0)&&process$1.nextTick(x,this),G};function x(z){var G=z._readableState;G.readableListening=z.listenerCount("readable")>0,G.resumeScheduled&&!G.paused?G.flowing=!0:z.listenerCount("data")>0&&z.resume()}function L(z){a("readable nexttick read 0"),z.read(0)}ne.prototype.resume=function(){var z=this._readableState;return z.flowing||(a("resume"),z.flowing=!z.readableListening,K(this,z)),z.paused=!1,this};function K(z,G){G.resumeScheduled||(G.resumeScheduled=!0,process$1.nextTick(Q,z,G))}function Q(z,G){a("resume",G.reading),G.reading||z.read(0),G.resumeScheduled=!1,z.emit("resume"),H(z),G.flowing&&!G.reading&&z.read(0)}ne.prototype.pause=function(){return a("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(a("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function H(z){var G=z._readableState;for(a("flow",G.flowing);G.flowing&&z.read()!==null;);}ne.prototype.wrap=function(z){var G=this,fe=this._readableState,me=!1;z.on("end",function(){if(a("wrapped end"),fe.decoder&&!fe.ended){var qe=fe.decoder.end();qe&&qe.length&&G.push(qe)}G.push(null)}),z.on("data",function(qe){if(a("wrapped data"),fe.decoder&&(qe=fe.decoder.write(qe)),!(fe.objectMode&&qe==null)&&!(!fe.objectMode&&(!qe||!qe.length))){var Re=G.push(qe);Re||(me=!0,z.pause())}});for(var xe in z)this[xe]===void 0&&typeof z[xe]=="function"&&(this[xe]=(function(Re){return function(){return z[Re].apply(z,arguments)}})(xe));for(var _e=0;_e<$.length;_e++)z.on($[_e],this.emit.bind(this,$[_e]));return this._read=function(qe){a("wrapped _read",qe),me&&(me=!1,z.resume())},this},typeof Symbol=="function"&&(ne.prototype[Symbol.asyncIterator]=function(){return O===void 0&&(O=requireAsync_iterator()),O(this)}),Object.defineProperty(ne.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(ne.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(ne.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(G){this._readableState&&(this._readableState.flowing=G)}}),ne._fromList=N,Object.defineProperty(ne.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function N(z,G){if(G.length===0)return null;var fe;return G.objectMode?fe=G.buffer.shift():!z||z>=G.length?(G.decoder?fe=G.buffer.join(""):G.buffer.length===1?fe=G.buffer.first():fe=G.buffer.concat(G.length),G.buffer.clear()):fe=G.buffer.consume(z,G.decoder),fe}function F(z){var G=z._readableState;a("endReadable",G.endEmitted),G.endEmitted||(G.ended=!0,process$1.nextTick(ee,G,z))}function ee(z,G){if(a("endReadableNT",z.endEmitted,z.length),!z.endEmitted&&z.length===0&&(z.endEmitted=!0,G.readable=!1,G.emit("end"),z.autoDestroy)){var fe=G._writableState;(!fe||fe.autoDestroy&&fe.finished)&&G.destroy()}}typeof Symbol=="function"&&(ne.from=function(z,G){return D===void 0&&(D=requireFromBrowser()),D(ne,z,G)});function ae(z,G){for(var fe=0,me=z.length;fe<me;fe++)if(z[fe]===G)return fe;return-1}return _stream_readable$1}var _stream_transform$1,hasRequired_stream_transform$1;function require_stream_transform$1(){if(hasRequired_stream_transform$1)return _stream_transform$1;hasRequired_stream_transform$1=1,_stream_transform$1=f;var c=requireErrorsBrowser().codes,t=c.ERR_METHOD_NOT_IMPLEMENTED,u=c.ERR_MULTIPLE_CALLBACK,o=c.ERR_TRANSFORM_ALREADY_TRANSFORMING,d=c.ERR_TRANSFORM_WITH_LENGTH_0,r=require_stream_duplex$1();requireInherits_browser()(f,r);function h(e,s){var l=this._transformState;l.transforming=!1;var v=l.writecb;if(v===null)return this.emit("error",new u);l.writechunk=null,l.writecb=null,s!=null&&this.push(s),v(e);var b=this._readableState;b.reading=!1,(b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}function f(e){if(!(this instanceof f))return new f(e);r.call(this,e),this._transformState={afterTransform:h.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",a)}function a(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(s,l){n(e,s,l)}):n(this,null,null)}f.prototype.push=function(e,s){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,s)},f.prototype._transform=function(e,s,l){l(new t("_transform()"))},f.prototype._write=function(e,s,l){var v=this._transformState;if(v.writecb=l,v.writechunk=e,v.writeencoding=s,!v.transforming){var b=this._readableState;(v.needTransform||b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}},f.prototype._read=function(e){var s=this._transformState;s.writechunk!==null&&!s.transforming?(s.transforming=!0,this._transform(s.writechunk,s.writeencoding,s.afterTransform)):s.needTransform=!0},f.prototype._destroy=function(e,s){r.prototype._destroy.call(this,e,function(l){s(l)})};function n(e,s,l){if(s)return e.emit("error",s);if(l!=null&&e.push(l),e._writableState.length)throw new d;if(e._transformState.transforming)throw new o;return e.push(null)}return _stream_transform$1}var _stream_passthrough$1,hasRequired_stream_passthrough$1;function require_stream_passthrough$1(){if(hasRequired_stream_passthrough$1)return _stream_passthrough$1;hasRequired_stream_passthrough$1=1,_stream_passthrough$1=t;var c=require_stream_transform$1();requireInherits_browser()(t,c);function t(u){if(!(this instanceof t))return new t(u);c.call(this,u)}return t.prototype._transform=function(u,o,d){d(null,u)},_stream_passthrough$1}var pipeline_1,hasRequiredPipeline;function requirePipeline(){if(hasRequiredPipeline)return pipeline_1;hasRequiredPipeline=1;var c;function t(l){var v=!1;return function(){v||(v=!0,l.apply(void 0,arguments))}}var u=requireErrorsBrowser().codes,o=u.ERR_MISSING_ARGS,d=u.ERR_STREAM_DESTROYED;function r(l){if(l)throw l}function h(l){return l.setHeader&&typeof l.abort=="function"}function f(l,v,b,m){m=t(m);var q=!1;l.on("close",function(){q=!0}),c===void 0&&(c=requireEndOfStream()),c(l,{readable:v,writable:b},function(S){if(S)return m(S);q=!0,m()});var E=!1;return function(S){if(!q&&!E){if(E=!0,h(l))return l.abort();if(typeof l.destroy=="function")return l.destroy();m(S||new d("pipe"))}}}function a(l){l()}function n(l,v){return l.pipe(v)}function e(l){return!l.length||typeof l[l.length-1]!="function"?r:l.pop()}function s(){for(var l=arguments.length,v=new Array(l),b=0;b<l;b++)v[b]=arguments[b];var m=e(v);if(Array.isArray(v[0])&&(v=v[0]),v.length<2)throw new o("streams");var q,E=v.map(function(S,O){var D=O<v.length-1,j=O>0;return f(S,D,j,function($){q||(q=$),$&&E.forEach(a),!D&&(E.forEach(a),m(q))})});return v.reduce(n)}return pipeline_1=s,pipeline_1}var streamBrowserify,hasRequiredStreamBrowserify;function requireStreamBrowserify(){if(hasRequiredStreamBrowserify)return streamBrowserify;hasRequiredStreamBrowserify=1,streamBrowserify=u;var c=requireEvents().EventEmitter,t=requireInherits_browser();t(u,c),u.Readable=require_stream_readable$1(),u.Writable=require_stream_writable$1(),u.Duplex=require_stream_duplex$1(),u.Transform=require_stream_transform$1(),u.PassThrough=require_stream_passthrough$1(),u.finished=requireEndOfStream(),u.pipeline=requirePipeline(),u.Stream=u;function u(){c.call(this)}return u.prototype.pipe=function(o,d){var r=this;function h(v){o.writable&&o.write(v)===!1&&r.pause&&r.pause()}r.on("data",h);function f(){r.readable&&r.resume&&r.resume()}o.on("drain",f),!o._isStdio&&(!d||d.end!==!1)&&(r.on("end",n),r.on("close",e));var a=!1;function n(){a||(a=!0,o.end())}function e(){a||(a=!0,typeof o.destroy=="function"&&o.destroy())}function s(v){if(l(),c.listenerCount(this,"error")===0)throw v}r.on("error",s),o.on("error",s);function l(){r.removeListener("data",h),o.removeListener("drain",f),r.removeListener("end",n),r.removeListener("close",e),r.removeListener("error",s),o.removeListener("error",s),r.removeListener("end",l),r.removeListener("close",l),o.removeListener("close",l)}return r.on("end",l),r.on("close",l),o.on("close",l),o.emit("pipe",r),o},streamBrowserify}var hashBase$1,hasRequiredHashBase$1;function requireHashBase$1(){if(hasRequiredHashBase$1)return hashBase$1;hasRequiredHashBase$1=1;var c=requireSafeBuffer$1().Buffer,t=requireStreamBrowserify().Transform,u=requireInherits_browser();function o(f){t.call(this),this._block=c.allocUnsafe(f),this._blockSize=f,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}u(o,t),o.prototype._transform=function(f,a,n){var e=null;try{this.update(f,a)}catch(s){e=s}n(e)},o.prototype._flush=function(f){var a=null;try{this.push(this.digest())}catch(n){a=n}f(a)};var d=typeof Uint8Array<"u",r=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(c.prototype instanceof Uint8Array||c.TYPED_ARRAY_SUPPORT);function h(f,a){if(f instanceof c)return f;if(typeof f=="string")return c.from(f,a);if(r&&ArrayBuffer.isView(f)){if(f.byteLength===0)return c.alloc(0);var n=c.from(f.buffer,f.byteOffset,f.byteLength);if(n.byteLength===f.byteLength)return n}if(d&&f instanceof Uint8Array||c.isBuffer(f)&&f.constructor&&typeof f.constructor.isBuffer=="function"&&f.constructor.isBuffer(f))return c.from(f);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}return o.prototype.update=function(f,a){if(this._finalized)throw new Error("Digest already called");f=h(f,a);for(var n=this._block,e=0;this._blockOffset+f.length-e>=this._blockSize;){for(var s=this._blockOffset;s<this._blockSize;)n[s++]=f[e++];this._update(),this._blockOffset=0}for(;e<f.length;)n[this._blockOffset++]=f[e++];for(var l=0,v=f.length*8;v>0;++l)this._length[l]+=v,v=this._length[l]/4294967296|0,v>0&&(this._length[l]-=4294967296*v);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(f){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var a=this._digest();f!==void 0&&(a=a.toString(f)),this._block.fill(0),this._blockOffset=0;for(var n=0;n<4;++n)this._length[n]=0;return a},o.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase$1=o,hashBase$1}var md5_js,hasRequiredMd5_js;function requireMd5_js(){if(hasRequiredMd5_js)return md5_js;hasRequiredMd5_js=1;var c=requireInherits_browser(),t=requireHashBase$1(),u=requireSafeBuffer$1().Buffer,o=new Array(16);function d(){t.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}c(d,t),d.prototype._update=function(){for(var e=o,s=0;s<16;++s)e[s]=this._block.readInt32LE(s*4);var l=this._a,v=this._b,b=this._c,m=this._d;l=h(l,v,b,m,e[0],3614090360,7),m=h(m,l,v,b,e[1],3905402710,12),b=h(b,m,l,v,e[2],606105819,17),v=h(v,b,m,l,e[3],3250441966,22),l=h(l,v,b,m,e[4],4118548399,7),m=h(m,l,v,b,e[5],1200080426,12),b=h(b,m,l,v,e[6],2821735955,17),v=h(v,b,m,l,e[7],4249261313,22),l=h(l,v,b,m,e[8],1770035416,7),m=h(m,l,v,b,e[9],2336552879,12),b=h(b,m,l,v,e[10],4294925233,17),v=h(v,b,m,l,e[11],2304563134,22),l=h(l,v,b,m,e[12],1804603682,7),m=h(m,l,v,b,e[13],4254626195,12),b=h(b,m,l,v,e[14],2792965006,17),v=h(v,b,m,l,e[15],1236535329,22),l=f(l,v,b,m,e[1],4129170786,5),m=f(m,l,v,b,e[6],3225465664,9),b=f(b,m,l,v,e[11],643717713,14),v=f(v,b,m,l,e[0],3921069994,20),l=f(l,v,b,m,e[5],3593408605,5),m=f(m,l,v,b,e[10],38016083,9),b=f(b,m,l,v,e[15],3634488961,14),v=f(v,b,m,l,e[4],3889429448,20),l=f(l,v,b,m,e[9],568446438,5),m=f(m,l,v,b,e[14],3275163606,9),b=f(b,m,l,v,e[3],4107603335,14),v=f(v,b,m,l,e[8],1163531501,20),l=f(l,v,b,m,e[13],2850285829,5),m=f(m,l,v,b,e[2],4243563512,9),b=f(b,m,l,v,e[7],1735328473,14),v=f(v,b,m,l,e[12],2368359562,20),l=a(l,v,b,m,e[5],4294588738,4),m=a(m,l,v,b,e[8],2272392833,11),b=a(b,m,l,v,e[11],1839030562,16),v=a(v,b,m,l,e[14],4259657740,23),l=a(l,v,b,m,e[1],2763975236,4),m=a(m,l,v,b,e[4],1272893353,11),b=a(b,m,l,v,e[7],4139469664,16),v=a(v,b,m,l,e[10],3200236656,23),l=a(l,v,b,m,e[13],681279174,4),m=a(m,l,v,b,e[0],3936430074,11),b=a(b,m,l,v,e[3],3572445317,16),v=a(v,b,m,l,e[6],76029189,23),l=a(l,v,b,m,e[9],3654602809,4),m=a(m,l,v,b,e[12],3873151461,11),b=a(b,m,l,v,e[15],530742520,16),v=a(v,b,m,l,e[2],3299628645,23),l=n(l,v,b,m,e[0],4096336452,6),m=n(m,l,v,b,e[7],1126891415,10),b=n(b,m,l,v,e[14],2878612391,15),v=n(v,b,m,l,e[5],4237533241,21),l=n(l,v,b,m,e[12],1700485571,6),m=n(m,l,v,b,e[3],2399980690,10),b=n(b,m,l,v,e[10],4293915773,15),v=n(v,b,m,l,e[1],2240044497,21),l=n(l,v,b,m,e[8],1873313359,6),m=n(m,l,v,b,e[15],4264355552,10),b=n(b,m,l,v,e[6],2734768916,15),v=n(v,b,m,l,e[13],1309151649,21),l=n(l,v,b,m,e[4],4149444226,6),m=n(m,l,v,b,e[11],3174756917,10),b=n(b,m,l,v,e[2],718787259,15),v=n(v,b,m,l,e[9],3951481745,21),this._a=this._a+l|0,this._b=this._b+v|0,this._c=this._c+b|0,this._d=this._d+m|0},d.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=u.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};function r(e,s){return e<<s|e>>>32-s}function h(e,s,l,v,b,m,q){return r(e+(s&l|~s&v)+b+m|0,q)+s|0}function f(e,s,l,v,b,m,q){return r(e+(s&v|l&~v)+b+m|0,q)+s|0}function a(e,s,l,v,b,m,q){return r(e+(s^l^v)+b+m|0,q)+s|0}function n(e,s,l,v,b,m,q){return r(e+(l^(s|~v))+b+m|0,q)+s|0}return md5_js=d,md5_js}var isarray$1,hasRequiredIsarray$1;function requireIsarray$1(){if(hasRequiredIsarray$1)return isarray$1;hasRequiredIsarray$1=1;var c={}.toString;return isarray$1=Array.isArray||function(t){return c.call(t)=="[object Array]"},isarray$1}var typedArrayBuffer,hasRequiredTypedArrayBuffer;function requireTypedArrayBuffer(){if(hasRequiredTypedArrayBuffer)return typedArrayBuffer;hasRequiredTypedArrayBuffer=1;var c=requireType(),t=requireCallBound$1(),u=t("TypedArray.prototype.buffer",!0),o=requireIsTypedArray();return typedArrayBuffer=u||function(r){if(!o(r))throw new c("Not a Typed Array");return r.buffer},typedArrayBuffer}var toBuffer,hasRequiredToBuffer$2;function requireToBuffer$2(){if(hasRequiredToBuffer$2)return toBuffer;hasRequiredToBuffer$2=1;var c=requireSafeBuffer$1().Buffer,t=requireIsarray$1(),u=requireTypedArrayBuffer(),o=ArrayBuffer.isView||function(a){try{return u(a),!0}catch{return!1}},d=typeof Uint8Array<"u",r=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",h=r&&(c.prototype instanceof Uint8Array||c.TYPED_ARRAY_SUPPORT);return toBuffer=function(a,n){if(c.isBuffer(a))return a.constructor&&!("isBuffer"in a)?c.from(a):a;if(typeof a=="string")return c.from(a,n);if(r&&o(a)){if(a.byteLength===0)return c.alloc(0);if(h){var e=c.from(a.buffer,a.byteOffset,a.byteLength);if(e.byteLength===a.byteLength)return e}var s=a instanceof Uint8Array?a:new Uint8Array(a.buffer,a.byteOffset,a.byteLength),l=c.from(s);if(l.length===a.byteLength)return l}if(d&&a instanceof Uint8Array)return c.from(a);var v=t(a);if(v)for(var b=0;b<a.length;b+=1){var m=a[b];if(typeof m!="number"||m<0||m>255||~~m!==m)throw new RangeError("Array items must be numbers in the range 0-255.")}if(v||c.isBuffer(a)&&a.constructor&&typeof a.constructor.isBuffer=="function"&&a.constructor.isBuffer(a))return c.from(a);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},toBuffer}var toBuffer_1$1,hasRequiredToBuffer$1;function requireToBuffer$1(){if(hasRequiredToBuffer$1)return toBuffer_1$1;hasRequiredToBuffer$1=1;var c=requireSafeBuffer$1().Buffer,t=requireToBuffer$2(),u=typeof Uint8Array<"u",o=u&&typeof ArrayBuffer<"u",d=o&&ArrayBuffer.isView;return toBuffer_1$1=function(r,h){if(typeof r=="string"||c.isBuffer(r)||u&&r instanceof Uint8Array||d&&d(r))return t(r,h);throw new TypeError('The "data" argument must be a string, a Buffer, a Uint8Array, or a DataView')},toBuffer_1$1}var readableBrowser={exports:{}},processNextickArgs={exports:{}},hasRequiredProcessNextickArgs;function requireProcessNextickArgs(){if(hasRequiredProcessNextickArgs)return processNextickArgs.exports;hasRequiredProcessNextickArgs=1,typeof process$1>"u"||!process$1.version||process$1.version.indexOf("v0.")===0||process$1.version.indexOf("v1.")===0&&process$1.version.indexOf("v1.8.")!==0?processNextickArgs.exports={nextTick:c}:processNextickArgs.exports=process$1;function c(t,u,o,d){if(typeof t!="function")throw new TypeError('"callback" argument must be a function');var r=arguments.length,h,f;switch(r){case 0:case 1:return process$1.nextTick(t);case 2:return process$1.nextTick(function(){t.call(null,u)});case 3:return process$1.nextTick(function(){t.call(null,u,o)});case 4:return process$1.nextTick(function(){t.call(null,u,o,d)});default:for(h=new Array(r-1),f=0;f<h.length;)h[f++]=arguments[f];return process$1.nextTick(function(){t.apply(null,h)})}}return processNextickArgs.exports}var isarray,hasRequiredIsarray;function requireIsarray(){if(hasRequiredIsarray)return isarray;hasRequiredIsarray=1;var c={}.toString;return isarray=Array.isArray||function(t){return c.call(t)=="[object Array]"},isarray}var streamBrowser,hasRequiredStreamBrowser;function requireStreamBrowser(){return hasRequiredStreamBrowser||(hasRequiredStreamBrowser=1,streamBrowser=requireEvents().EventEmitter),streamBrowser}var safeBuffer={exports:{}},hasRequiredSafeBuffer;function requireSafeBuffer(){return hasRequiredSafeBuffer||(hasRequiredSafeBuffer=1,(function(c,t){var u=requireDist(),o=u.Buffer;function d(h,f){for(var a in h)f[a]=h[a]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?c.exports=u:(d(u,t),t.Buffer=r);function r(h,f,a){return o(h,f,a)}d(o,r),r.from=function(h,f,a){if(typeof h=="number")throw new TypeError("Argument must not be a number");return o(h,f,a)},r.alloc=function(h,f,a){if(typeof h!="number")throw new TypeError("Argument must be a number");var n=o(h);return f!==void 0?typeof a=="string"?n.fill(f,a):n.fill(f):n.fill(0),n},r.allocUnsafe=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return o(h)},r.allocUnsafeSlow=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return u.SlowBuffer(h)}})(safeBuffer,safeBuffer.exports)),safeBuffer.exports}var util={},hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util;hasRequiredUtil=1;function c(m){return Array.isArray?Array.isArray(m):b(m)==="[object Array]"}util.isArray=c;function t(m){return typeof m=="boolean"}util.isBoolean=t;function u(m){return m===null}util.isNull=u;function o(m){return m==null}util.isNullOrUndefined=o;function d(m){return typeof m=="number"}util.isNumber=d;function r(m){return typeof m=="string"}util.isString=r;function h(m){return typeof m=="symbol"}util.isSymbol=h;function f(m){return m===void 0}util.isUndefined=f;function a(m){return b(m)==="[object RegExp]"}util.isRegExp=a;function n(m){return typeof m=="object"&&m!==null}util.isObject=n;function e(m){return b(m)==="[object Date]"}util.isDate=e;function s(m){return b(m)==="[object Error]"||m instanceof Error}util.isError=s;function l(m){return typeof m=="function"}util.isFunction=l;function v(m){return m===null||typeof m=="boolean"||typeof m=="number"||typeof m=="string"||typeof m=="symbol"||typeof m>"u"}util.isPrimitive=v,util.isBuffer=requireDist().Buffer.isBuffer;function b(m){return Object.prototype.toString.call(m)}return util}var BufferList={exports:{}},hasRequiredBufferList;function requireBufferList(){return hasRequiredBufferList||(hasRequiredBufferList=1,(function(c){function t(r,h){if(!(r instanceof h))throw new TypeError("Cannot call a class as a function")}var u=requireSafeBuffer().Buffer,o=requireUtil$1();function d(r,h,f){r.copy(h,f)}c.exports=(function(){function r(){t(this,r),this.head=null,this.tail=null,this.length=0}return r.prototype.push=function(f){var a={data:f,next:null};this.length>0?this.tail.next=a:this.head=a,this.tail=a,++this.length},r.prototype.unshift=function(f){var a={data:f,next:this.head};this.length===0&&(this.tail=a),this.head=a,++this.length},r.prototype.shift=function(){if(this.length!==0){var f=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,f}},r.prototype.clear=function(){this.head=this.tail=null,this.length=0},r.prototype.join=function(f){if(this.length===0)return"";for(var a=this.head,n=""+a.data;a=a.next;)n+=f+a.data;return n},r.prototype.concat=function(f){if(this.length===0)return u.alloc(0);for(var a=u.allocUnsafe(f>>>0),n=this.head,e=0;n;)d(n.data,a,e),e+=n.data.length,n=n.next;return a},r})(),o&&o.inspect&&o.inspect.custom&&(c.exports.prototype[o.inspect.custom]=function(){var r=o.inspect({length:this.length});return this.constructor.name+" "+r})})(BufferList)),BufferList.exports}var destroy_1,hasRequiredDestroy;function requireDestroy(){if(hasRequiredDestroy)return destroy_1;hasRequiredDestroy=1;var c=requireProcessNextickArgs();function t(d,r){var h=this,f=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return f||a?(r?r(d):d&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,c.nextTick(o,this,d)):c.nextTick(o,this,d)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(d||null,function(n){!r&&n?h._writableState?h._writableState.errorEmitted||(h._writableState.errorEmitted=!0,c.nextTick(o,h,n)):c.nextTick(o,h,n):r&&r(n)}),this)}function u(){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)}function o(d,r){d.emit("error",r)}return destroy_1={destroy:t,undestroy:u},destroy_1}var _stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1;var c=requireProcessNextickArgs();_stream_writable=m;function t(B){var P=this;this.next=null,this.entry=null,this.finish=function(){R(P,B)}}var u=!process$1.browser&&["v0.10","v0.9."].indexOf(process$1.version.slice(0,5))>-1?setImmediate:c.nextTick,o;m.WritableState=v;var d=Object.create(requireUtil());d.inherits=requireInherits_browser();var r={deprecate:requireBrowser$a()},h=requireStreamBrowser(),f=requireSafeBuffer().Buffer,a=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function n(B){return f.from(B)}function e(B){return f.isBuffer(B)||B instanceof a}var s=requireDestroy();d.inherits(m,h);function l(){}function v(B,P){o=o||require_stream_duplex(),B=B||{};var A=P instanceof o;this.objectMode=!!B.objectMode,A&&(this.objectMode=this.objectMode||!!B.writableObjectMode);var w=B.highWaterMark,M=B.writableHighWaterMark,x=this.objectMode?16:16*1024;w||w===0?this.highWaterMark=w:A&&(M||M===0)?this.highWaterMark=M:this.highWaterMark=x,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var L=B.decodeStrings===!1;this.decodeStrings=!L,this.defaultEncoding=B.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(K){J(P,K)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}v.prototype.getBuffer=function(){for(var P=this.bufferedRequest,A=[];P;)A.push(P),P=P.next;return A},(function(){try{Object.defineProperty(v.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var b;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(b=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(B){return b.call(this,B)?!0:this!==m?!1:B&&B._writableState instanceof v}})):b=function(B){return B instanceof this};function m(B){if(o=o||require_stream_duplex(),!b.call(m,this)&&!(this instanceof o))return new m(B);this._writableState=new v(B,this),this.writable=!0,B&&(typeof B.write=="function"&&(this._write=B.write),typeof B.writev=="function"&&(this._writev=B.writev),typeof B.destroy=="function"&&(this._destroy=B.destroy),typeof B.final=="function"&&(this._final=B.final)),h.call(this)}m.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function q(B,P){var A=new Error("write after end");B.emit("error",A),c.nextTick(P,A)}function E(B,P,A,w){var M=!0,x=!1;return A===null?x=new TypeError("May not write null values to stream"):typeof A!="string"&&A!==void 0&&!P.objectMode&&(x=new TypeError("Invalid non-string/buffer chunk")),x&&(B.emit("error",x),c.nextTick(w,x),M=!1),M}m.prototype.write=function(B,P,A){var w=this._writableState,M=!1,x=!w.objectMode&&e(B);return x&&!f.isBuffer(B)&&(B=n(B)),typeof P=="function"&&(A=P,P=null),x?P="buffer":P||(P=w.defaultEncoding),typeof A!="function"&&(A=l),w.ended?q(this,A):(x||E(this,w,B,A))&&(w.pendingcb++,M=O(this,w,x,B,P,A)),M},m.prototype.cork=function(){var B=this._writableState;B.corked++},m.prototype.uncork=function(){var B=this._writableState;B.corked&&(B.corked--,!B.writing&&!B.corked&&!B.bufferProcessing&&B.bufferedRequest&&de(this,B))},m.prototype.setDefaultEncoding=function(P){if(typeof P=="string"&&(P=P.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((P+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+P);return this._writableState.defaultEncoding=P,this};function S(B,P,A){return!B.objectMode&&B.decodeStrings!==!1&&typeof P=="string"&&(P=f.from(P,A)),P}Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function O(B,P,A,w,M,x){if(!A){var L=S(P,w,M);w!==L&&(A=!0,M="buffer",w=L)}var K=P.objectMode?1:w.length;P.length+=K;var Q=P.length<P.highWaterMark;if(Q||(P.needDrain=!0),P.writing||P.corked){var H=P.lastBufferedRequest;P.lastBufferedRequest={chunk:w,encoding:M,isBuf:A,callback:x,next:null},H?H.next=P.lastBufferedRequest:P.bufferedRequest=P.lastBufferedRequest,P.bufferedRequestCount+=1}else D(B,P,!1,K,w,M,x);return Q}function D(B,P,A,w,M,x,L){P.writelen=w,P.writecb=L,P.writing=!0,P.sync=!0,A?B._writev(M,P.onwrite):B._write(M,x,P.onwrite),P.sync=!1}function j(B,P,A,w,M){--P.pendingcb,A?(c.nextTick(M,w),c.nextTick(p,B,P),B._writableState.errorEmitted=!0,B.emit("error",w)):(M(w),B._writableState.errorEmitted=!0,B.emit("error",w),p(B,P))}function $(B){B.writing=!1,B.writecb=null,B.length-=B.writelen,B.writelen=0}function J(B,P){var A=B._writableState,w=A.sync,M=A.writecb;if($(A),P)j(B,A,w,P,M);else{var x=Z(A);!x&&!A.corked&&!A.bufferProcessing&&A.bufferedRequest&&de(B,A),w?u(ie,B,A,x,M):ie(B,A,x,M)}}function ie(B,P,A,w){A||ne(B,P),P.pendingcb--,w(),p(B,P)}function ne(B,P){P.length===0&&P.needDrain&&(P.needDrain=!1,B.emit("drain"))}function de(B,P){P.bufferProcessing=!0;var A=P.bufferedRequest;if(B._writev&&A&&A.next){var w=P.bufferedRequestCount,M=new Array(w),x=P.corkedRequestsFree;x.entry=A;for(var L=0,K=!0;A;)M[L]=A,A.isBuf||(K=!1),A=A.next,L+=1;M.allBuffers=K,D(B,P,!0,P.length,M,"",x.finish),P.pendingcb++,P.lastBufferedRequest=null,x.next?(P.corkedRequestsFree=x.next,x.next=null):P.corkedRequestsFree=new t(P),P.bufferedRequestCount=0}else{for(;A;){var Q=A.chunk,H=A.encoding,N=A.callback,F=P.objectMode?1:Q.length;if(D(B,P,!1,F,Q,H,N),A=A.next,P.bufferedRequestCount--,P.writing)break}A===null&&(P.lastBufferedRequest=null)}P.bufferedRequest=A,P.bufferProcessing=!1}m.prototype._write=function(B,P,A){A(new Error("_write() is not implemented"))},m.prototype._writev=null,m.prototype.end=function(B,P,A){var w=this._writableState;typeof B=="function"?(A=B,B=null,P=null):typeof P=="function"&&(A=P,P=null),B!=null&&this.write(B,P),w.corked&&(w.corked=1,this.uncork()),w.ending||_(this,w,A)};function Z(B){return B.ending&&B.length===0&&B.bufferedRequest===null&&!B.finished&&!B.writing}function y(B,P){B._final(function(A){P.pendingcb--,A&&B.emit("error",A),P.prefinished=!0,B.emit("prefinish"),p(B,P)})}function g(B,P){!P.prefinished&&!P.finalCalled&&(typeof B._final=="function"?(P.pendingcb++,P.finalCalled=!0,c.nextTick(y,B,P)):(P.prefinished=!0,B.emit("prefinish")))}function p(B,P){var A=Z(P);return A&&(g(B,P),P.pendingcb===0&&(P.finished=!0,B.emit("finish"))),A}function _(B,P,A){P.ending=!0,p(B,P),A&&(P.finished?c.nextTick(A):B.once("finish",A)),P.ended=!0,B.writable=!1}function R(B,P,A){var w=B.entry;for(B.entry=null;w;){var M=w.callback;P.pendingcb--,M(A),w=w.next}P.corkedRequestsFree.next=B}return Object.defineProperty(m.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(B){this._writableState&&(this._writableState.destroyed=B)}}),m.prototype.destroy=s.destroy,m.prototype._undestroy=s.undestroy,m.prototype._destroy=function(B,P){this.end(),P(B)},_stream_writable}var _stream_duplex,hasRequired_stream_duplex;function require_stream_duplex(){if(hasRequired_stream_duplex)return _stream_duplex;hasRequired_stream_duplex=1;var c=requireProcessNextickArgs(),t=Object.keys||function(s){var l=[];for(var v in s)l.push(v);return l};_stream_duplex=a;var u=Object.create(requireUtil());u.inherits=requireInherits_browser();var o=require_stream_readable(),d=require_stream_writable();u.inherits(a,o);for(var r=t(d.prototype),h=0;h<r.length;h++){var f=r[h];a.prototype[f]||(a.prototype[f]=d.prototype[f])}function a(s){if(!(this instanceof a))return new a(s);o.call(this,s),d.call(this,s),s&&s.readable===!1&&(this.readable=!1),s&&s.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,s&&s.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",n)}Object.defineProperty(a.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function n(){this.allowHalfOpen||this._writableState.ended||c.nextTick(e,this)}function e(s){s.end()}return Object.defineProperty(a.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(s){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=s,this._writableState.destroyed=s)}}),a.prototype._destroy=function(s,l){this.push(null),this.end(),c.nextTick(l,s)},_stream_duplex}var _stream_readable,hasRequired_stream_readable;function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;hasRequired_stream_readable=1;var c=requireProcessNextickArgs();_stream_readable=S;var t=requireIsarray(),u;S.ReadableState=E,requireEvents().EventEmitter;var o=function(N,F){return N.listeners(F).length},d=requireStreamBrowser(),r=requireSafeBuffer().Buffer,h=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function f(N){return r.from(N)}function a(N){return r.isBuffer(N)||N instanceof h}var n=Object.create(requireUtil());n.inherits=requireInherits_browser();var e=requireUtil$1(),s=void 0;e&&e.debuglog?s=e.debuglog("stream"):s=function(){};var l=requireBufferList(),v=requireDestroy(),b;n.inherits(S,d);var m=["error","close","destroy","pause","resume"];function q(N,F,ee){if(typeof N.prependListener=="function")return N.prependListener(F,ee);!N._events||!N._events[F]?N.on(F,ee):t(N._events[F])?N._events[F].unshift(ee):N._events[F]=[ee,N._events[F]]}function E(N,F){u=u||require_stream_duplex(),N=N||{};var ee=F instanceof u;this.objectMode=!!N.objectMode,ee&&(this.objectMode=this.objectMode||!!N.readableObjectMode);var ae=N.highWaterMark,z=N.readableHighWaterMark,G=this.objectMode?16:16*1024;ae||ae===0?this.highWaterMark=ae:ee&&(z||z===0)?this.highWaterMark=z:this.highWaterMark=G,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new l,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.destroyed=!1,this.defaultEncoding=N.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,N.encoding&&(b||(b=requireString_decoder().StringDecoder),this.decoder=new b(N.encoding),this.encoding=N.encoding)}function S(N){if(u=u||require_stream_duplex(),!(this instanceof S))return new S(N);this._readableState=new E(N,this),this.readable=!0,N&&(typeof N.read=="function"&&(this._read=N.read),typeof N.destroy=="function"&&(this._destroy=N.destroy)),d.call(this)}Object.defineProperty(S.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(N){this._readableState&&(this._readableState.destroyed=N)}}),S.prototype.destroy=v.destroy,S.prototype._undestroy=v.undestroy,S.prototype._destroy=function(N,F){this.push(null),F(N)},S.prototype.push=function(N,F){var ee=this._readableState,ae;return ee.objectMode?ae=!0:typeof N=="string"&&(F=F||ee.defaultEncoding,F!==ee.encoding&&(N=r.from(N,F),F=""),ae=!0),O(this,N,F,!1,ae)},S.prototype.unshift=function(N){return O(this,N,null,!0,!1)};function O(N,F,ee,ae,z){var G=N._readableState;if(F===null)G.reading=!1,de(N,G);else{var fe;z||(fe=j(G,F)),fe?N.emit("error",fe):G.objectMode||F&&F.length>0?(typeof F!="string"&&!G.objectMode&&Object.getPrototypeOf(F)!==r.prototype&&(F=f(F)),ae?G.endEmitted?N.emit("error",new Error("stream.unshift() after end event")):D(N,G,F,!0):G.ended?N.emit("error",new Error("stream.push() after EOF")):(G.reading=!1,G.decoder&&!ee?(F=G.decoder.write(F),G.objectMode||F.length!==0?D(N,G,F,!1):g(N,G)):D(N,G,F,!1))):ae||(G.reading=!1)}return $(G)}function D(N,F,ee,ae){F.flowing&&F.length===0&&!F.sync?(N.emit("data",ee),N.read(0)):(F.length+=F.objectMode?1:ee.length,ae?F.buffer.unshift(ee):F.buffer.push(ee),F.needReadable&&Z(N)),g(N,F)}function j(N,F){var ee;return!a(F)&&typeof F!="string"&&F!==void 0&&!N.objectMode&&(ee=new TypeError("Invalid non-string/buffer chunk")),ee}function $(N){return!N.ended&&(N.needReadable||N.length<N.highWaterMark||N.length===0)}S.prototype.isPaused=function(){return this._readableState.flowing===!1},S.prototype.setEncoding=function(N){return b||(b=requireString_decoder().StringDecoder),this._readableState.decoder=new b(N),this._readableState.encoding=N,this};var J=8388608;function ie(N){return N>=J?N=J:(N--,N|=N>>>1,N|=N>>>2,N|=N>>>4,N|=N>>>8,N|=N>>>16,N++),N}function ne(N,F){return N<=0||F.length===0&&F.ended?0:F.objectMode?1:N!==N?F.flowing&&F.length?F.buffer.head.data.length:F.length:(N>F.highWaterMark&&(F.highWaterMark=ie(N)),N<=F.length?N:F.ended?F.length:(F.needReadable=!0,0))}S.prototype.read=function(N){s("read",N),N=parseInt(N,10);var F=this._readableState,ee=N;if(N!==0&&(F.emittedReadable=!1),N===0&&F.needReadable&&(F.length>=F.highWaterMark||F.ended))return s("read: emitReadable",F.length,F.ended),F.length===0&&F.ended?K(this):Z(this),null;if(N=ne(N,F),N===0&&F.ended)return F.length===0&&K(this),null;var ae=F.needReadable;s("need readable",ae),(F.length===0||F.length-N<F.highWaterMark)&&(ae=!0,s("length less than watermark",ae)),F.ended||F.reading?(ae=!1,s("reading or ended",ae)):ae&&(s("do read"),F.reading=!0,F.sync=!0,F.length===0&&(F.needReadable=!0),this._read(F.highWaterMark),F.sync=!1,F.reading||(N=ne(ee,F)));var z;return N>0?z=w(N,F):z=null,z===null?(F.needReadable=!0,N=0):F.length-=N,F.length===0&&(F.ended||(F.needReadable=!0),ee!==N&&F.ended&&K(this)),z!==null&&this.emit("data",z),z};function de(N,F){if(!F.ended){if(F.decoder){var ee=F.decoder.end();ee&&ee.length&&(F.buffer.push(ee),F.length+=F.objectMode?1:ee.length)}F.ended=!0,Z(N)}}function Z(N){var F=N._readableState;F.needReadable=!1,F.emittedReadable||(s("emitReadable",F.flowing),F.emittedReadable=!0,F.sync?c.nextTick(y,N):y(N))}function y(N){s("emit readable"),N.emit("readable"),A(N)}function g(N,F){F.readingMore||(F.readingMore=!0,c.nextTick(p,N,F))}function p(N,F){for(var ee=F.length;!F.reading&&!F.flowing&&!F.ended&&F.length<F.highWaterMark&&(s("maybeReadMore read 0"),N.read(0),ee!==F.length);)ee=F.length;F.readingMore=!1}S.prototype._read=function(N){this.emit("error",new Error("_read() is not implemented"))},S.prototype.pipe=function(N,F){var ee=this,ae=this._readableState;switch(ae.pipesCount){case 0:ae.pipes=N;break;case 1:ae.pipes=[ae.pipes,N];break;default:ae.pipes.push(N);break}ae.pipesCount+=1,s("pipe count=%d opts=%j",ae.pipesCount,F);var z=(!F||F.end!==!1)&&N!==process$1.stdout&&N!==process$1.stderr,G=z?me:Te;ae.endEmitted?c.nextTick(G):ee.once("end",G),N.on("unpipe",fe);function fe(oe,ce){s("onunpipe"),oe===ee&&ce&&ce.hasUnpiped===!1&&(ce.hasUnpiped=!0,qe())}function me(){s("onend"),N.end()}var xe=_(ee);N.on("drain",xe);var _e=!1;function qe(){s("cleanup"),N.removeListener("close",Be),N.removeListener("finish",Me),N.removeListener("drain",xe),N.removeListener("error",Fe),N.removeListener("unpipe",fe),ee.removeListener("end",me),ee.removeListener("end",Te),ee.removeListener("data",be),_e=!0,ae.awaitDrain&&(!N._writableState||N._writableState.needDrain)&&xe()}var Re=!1;ee.on("data",be);function be(oe){s("ondata"),Re=!1;var ce=N.write(oe);ce===!1&&!Re&&((ae.pipesCount===1&&ae.pipes===N||ae.pipesCount>1&&H(ae.pipes,N)!==-1)&&!_e&&(s("false write response, pause",ae.awaitDrain),ae.awaitDrain++,Re=!0),ee.pause())}function Fe(oe){s("onerror",oe),Te(),N.removeListener("error",Fe),o(N,"error")===0&&N.emit("error",oe)}q(N,"error",Fe);function Be(){N.removeListener("finish",Me),Te()}N.once("close",Be);function Me(){s("onfinish"),N.removeListener("close",Be),Te()}N.once("finish",Me);function Te(){s("unpipe"),ee.unpipe(N)}return N.emit("pipe",ee),ae.flowing||(s("pipe resume"),ee.resume()),N};function _(N){return function(){var F=N._readableState;s("pipeOnDrain",F.awaitDrain),F.awaitDrain&&F.awaitDrain--,F.awaitDrain===0&&o(N,"data")&&(F.flowing=!0,A(N))}}S.prototype.unpipe=function(N){var F=this._readableState,ee={hasUnpiped:!1};if(F.pipesCount===0)return this;if(F.pipesCount===1)return N&&N!==F.pipes?this:(N||(N=F.pipes),F.pipes=null,F.pipesCount=0,F.flowing=!1,N&&N.emit("unpipe",this,ee),this);if(!N){var ae=F.pipes,z=F.pipesCount;F.pipes=null,F.pipesCount=0,F.flowing=!1;for(var G=0;G<z;G++)ae[G].emit("unpipe",this,{hasUnpiped:!1});return this}var fe=H(F.pipes,N);return fe===-1?this:(F.pipes.splice(fe,1),F.pipesCount-=1,F.pipesCount===1&&(F.pipes=F.pipes[0]),N.emit("unpipe",this,ee),this)},S.prototype.on=function(N,F){var ee=d.prototype.on.call(this,N,F);if(N==="data")this._readableState.flowing!==!1&&this.resume();else if(N==="readable"){var ae=this._readableState;!ae.endEmitted&&!ae.readableListening&&(ae.readableListening=ae.needReadable=!0,ae.emittedReadable=!1,ae.reading?ae.length&&Z(this):c.nextTick(R,this))}return ee},S.prototype.addListener=S.prototype.on;function R(N){s("readable nexttick read 0"),N.read(0)}S.prototype.resume=function(){var N=this._readableState;return N.flowing||(s("resume"),N.flowing=!0,B(this,N)),this};function B(N,F){F.resumeScheduled||(F.resumeScheduled=!0,c.nextTick(P,N,F))}function P(N,F){F.reading||(s("resume read 0"),N.read(0)),F.resumeScheduled=!1,F.awaitDrain=0,N.emit("resume"),A(N),F.flowing&&!F.reading&&N.read(0)}S.prototype.pause=function(){return s("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(s("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function A(N){var F=N._readableState;for(s("flow",F.flowing);F.flowing&&N.read()!==null;);}S.prototype.wrap=function(N){var F=this,ee=this._readableState,ae=!1;N.on("end",function(){if(s("wrapped end"),ee.decoder&&!ee.ended){var fe=ee.decoder.end();fe&&fe.length&&F.push(fe)}F.push(null)}),N.on("data",function(fe){if(s("wrapped data"),ee.decoder&&(fe=ee.decoder.write(fe)),!(ee.objectMode&&fe==null)&&!(!ee.objectMode&&(!fe||!fe.length))){var me=F.push(fe);me||(ae=!0,N.pause())}});for(var z in N)this[z]===void 0&&typeof N[z]=="function"&&(this[z]=(function(fe){return function(){return N[fe].apply(N,arguments)}})(z));for(var G=0;G<m.length;G++)N.on(m[G],this.emit.bind(this,m[G]));return this._read=function(fe){s("wrapped _read",fe),ae&&(ae=!1,N.resume())},this},Object.defineProperty(S.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),S._fromList=w;function w(N,F){if(F.length===0)return null;var ee;return F.objectMode?ee=F.buffer.shift():!N||N>=F.length?(F.decoder?ee=F.buffer.join(""):F.buffer.length===1?ee=F.buffer.head.data:ee=F.buffer.concat(F.length),F.buffer.clear()):ee=M(N,F.buffer,F.decoder),ee}function M(N,F,ee){var ae;return N<F.head.data.length?(ae=F.head.data.slice(0,N),F.head.data=F.head.data.slice(N)):N===F.head.data.length?ae=F.shift():ae=ee?x(N,F):L(N,F),ae}function x(N,F){var ee=F.head,ae=1,z=ee.data;for(N-=z.length;ee=ee.next;){var G=ee.data,fe=N>G.length?G.length:N;if(fe===G.length?z+=G:z+=G.slice(0,N),N-=fe,N===0){fe===G.length?(++ae,ee.next?F.head=ee.next:F.head=F.tail=null):(F.head=ee,ee.data=G.slice(fe));break}++ae}return F.length-=ae,z}function L(N,F){var ee=r.allocUnsafe(N),ae=F.head,z=1;for(ae.data.copy(ee),N-=ae.data.length;ae=ae.next;){var G=ae.data,fe=N>G.length?G.length:N;if(G.copy(ee,ee.length-N,0,fe),N-=fe,N===0){fe===G.length?(++z,ae.next?F.head=ae.next:F.head=F.tail=null):(F.head=ae,ae.data=G.slice(fe));break}++z}return F.length-=z,ee}function K(N){var F=N._readableState;if(F.length>0)throw new Error('"endReadable()" called on non-empty stream');F.endEmitted||(F.ended=!0,c.nextTick(Q,F,N))}function Q(N,F){!N.endEmitted&&N.length===0&&(N.endEmitted=!0,F.readable=!1,F.emit("end"))}function H(N,F){for(var ee=0,ae=N.length;ee<ae;ee++)if(N[ee]===F)return ee;return-1}return _stream_readable}var _stream_transform,hasRequired_stream_transform;function require_stream_transform(){if(hasRequired_stream_transform)return _stream_transform;hasRequired_stream_transform=1,_stream_transform=o;var c=require_stream_duplex(),t=Object.create(requireUtil());t.inherits=requireInherits_browser(),t.inherits(o,c);function u(h,f){var a=this._transformState;a.transforming=!1;var n=a.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));a.writechunk=null,a.writecb=null,f!=null&&this.push(f),n(h);var e=this._readableState;e.reading=!1,(e.needReadable||e.length<e.highWaterMark)&&this._read(e.highWaterMark)}function o(h){if(!(this instanceof o))return new o(h);c.call(this,h),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",d)}function d(){var h=this;typeof this._flush=="function"?this._flush(function(f,a){r(h,f,a)}):r(this,null,null)}o.prototype.push=function(h,f){return this._transformState.needTransform=!1,c.prototype.push.call(this,h,f)},o.prototype._transform=function(h,f,a){throw new Error("_transform() is not implemented")},o.prototype._write=function(h,f,a){var n=this._transformState;if(n.writecb=a,n.writechunk=h,n.writeencoding=f,!n.transforming){var e=this._readableState;(n.needTransform||e.needReadable||e.length<e.highWaterMark)&&this._read(e.highWaterMark)}},o.prototype._read=function(h){var f=this._transformState;f.writechunk!==null&&f.writecb&&!f.transforming?(f.transforming=!0,this._transform(f.writechunk,f.writeencoding,f.afterTransform)):f.needTransform=!0},o.prototype._destroy=function(h,f){var a=this;c.prototype._destroy.call(this,h,function(n){f(n),a.emit("close")})};function r(h,f,a){if(f)return h.emit("error",f);if(a!=null&&h.push(a),h._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(h._transformState.transforming)throw new Error("Calling transform done when still transforming");return h.push(null)}return _stream_transform}var _stream_passthrough,hasRequired_stream_passthrough;function require_stream_passthrough(){if(hasRequired_stream_passthrough)return _stream_passthrough;hasRequired_stream_passthrough=1,_stream_passthrough=u;var c=require_stream_transform(),t=Object.create(requireUtil());t.inherits=requireInherits_browser(),t.inherits(u,c);function u(o){if(!(this instanceof u))return new u(o);c.call(this,o)}return u.prototype._transform=function(o,d,r){r(null,o)},_stream_passthrough}var hasRequiredReadableBrowser;function requireReadableBrowser(){return hasRequiredReadableBrowser||(hasRequiredReadableBrowser=1,(function(c,t){t=c.exports=require_stream_readable(),t.Stream=t,t.Readable=t,t.Writable=require_stream_writable(),t.Duplex=require_stream_duplex(),t.Transform=require_stream_transform(),t.PassThrough=require_stream_passthrough()})(readableBrowser,readableBrowser.exports)),readableBrowser.exports}var hashBase,hasRequiredHashBase;function requireHashBase(){if(hasRequiredHashBase)return hashBase;hasRequiredHashBase=1;var c=requireSafeBuffer$1().Buffer,t=requireToBuffer$1(),u=requireReadableBrowser().Transform,o=requireInherits_browser();function d(r){u.call(this),this._block=c.allocUnsafe(r),this._blockSize=r,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return o(d,u),d.prototype._transform=function(r,h,f){var a=null;try{this.update(r,h)}catch(n){a=n}f(a)},d.prototype._flush=function(r){var h=null;try{this.push(this.digest())}catch(f){h=f}r(h)},d.prototype.update=function(r,h){if(this._finalized)throw new Error("Digest already called");for(var f=t(r,h),a=this._block,n=0;this._blockOffset+f.length-n>=this._blockSize;){for(var e=this._blockOffset;e<this._blockSize;)a[e]=f[n],e+=1,n+=1;this._update(),this._blockOffset=0}for(;n<f.length;)a[this._blockOffset]=f[n],this._blockOffset+=1,n+=1;for(var s=0,l=f.length*8;l>0;++s)this._length[s]+=l,l=this._length[s]/4294967296|0,l>0&&(this._length[s]-=4294967296*l);return this},d.prototype._update=function(){throw new Error("_update is not implemented")},d.prototype.digest=function(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var h=this._digest();r!==void 0&&(h=h.toString(r)),this._block.fill(0),this._blockOffset=0;for(var f=0;f<4;++f)this._length[f]=0;return h},d.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase=d,hashBase}var ripemd160,hasRequiredRipemd160;function requireRipemd160(){if(hasRequiredRipemd160)return ripemd160;hasRequiredRipemd160=1;var c=requireDist().Buffer,t=requireInherits_browser(),u=requireHashBase(),o=new Array(16),d=[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],r=[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],h=[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],f=[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],a=[0,1518500249,1859775393,2400959708,2840853838],n=[1352829926,1548603684,1836072691,2053994217,0];function e(E,S){return E<<S|E>>>32-S}function s(E,S,O,D,j,$,J,ie){return e(E+(S^O^D)+$+J|0,ie)+j|0}function l(E,S,O,D,j,$,J,ie){return e(E+(S&O|~S&D)+$+J|0,ie)+j|0}function v(E,S,O,D,j,$,J,ie){return e(E+((S|~O)^D)+$+J|0,ie)+j|0}function b(E,S,O,D,j,$,J,ie){return e(E+(S&D|O&~D)+$+J|0,ie)+j|0}function m(E,S,O,D,j,$,J,ie){return e(E+(S^(O|~D))+$+J|0,ie)+j|0}function q(){u.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}return t(q,u),q.prototype._update=function(){for(var E=o,S=0;S<16;++S)E[S]=this._block.readInt32LE(S*4);for(var O=this._a|0,D=this._b|0,j=this._c|0,$=this._d|0,J=this._e|0,ie=this._a|0,ne=this._b|0,de=this._c|0,Z=this._d|0,y=this._e|0,g=0;g<80;g+=1){var p,_;g<16?(p=s(O,D,j,$,J,E[d[g]],a[0],h[g]),_=m(ie,ne,de,Z,y,E[r[g]],n[0],f[g])):g<32?(p=l(O,D,j,$,J,E[d[g]],a[1],h[g]),_=b(ie,ne,de,Z,y,E[r[g]],n[1],f[g])):g<48?(p=v(O,D,j,$,J,E[d[g]],a[2],h[g]),_=v(ie,ne,de,Z,y,E[r[g]],n[2],f[g])):g<64?(p=b(O,D,j,$,J,E[d[g]],a[3],h[g]),_=l(ie,ne,de,Z,y,E[r[g]],n[3],f[g])):(p=m(O,D,j,$,J,E[d[g]],a[4],h[g]),_=s(ie,ne,de,Z,y,E[r[g]],n[4],f[g])),O=J,J=$,$=e(j,10),j=D,D=p,ie=y,y=Z,Z=e(de,10),de=ne,ne=_}var R=this._b+j+Z|0;this._b=this._c+$+y|0,this._c=this._d+J+ie|0,this._d=this._e+O+ne|0,this._e=this._a+D+de|0,this._a=R},q.prototype._digest=function(){this._block[this._blockOffset]=128,this._blockOffset+=1,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=c.alloc?c.alloc(20):new c(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},ripemd160=q,ripemd160}var sha_js={exports:{}},hash$1,hasRequiredHash$1;function requireHash$1(){if(hasRequiredHash$1)return hash$1;hasRequiredHash$1=1;var c=requireSafeBuffer$1().Buffer,t=requireToBuffer$2();function u(o,d){this._block=c.alloc(o),this._finalSize=d,this._blockSize=o,this._len=0}return u.prototype.update=function(o,d){o=t(o,d||"utf8");for(var r=this._block,h=this._blockSize,f=o.length,a=this._len,n=0;n<f;){for(var e=a%h,s=Math.min(f-n,h-e),l=0;l<s;l++)r[e+l]=o[n+l];a+=s,n+=s,a%h===0&&this._update(r)}return this._len+=f,this},u.prototype.digest=function(o){var d=this._len%this._blockSize;this._block[d]=128,this._block.fill(0,d+1),d>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var h=(r&4294967295)>>>0,f=(r-h)/4294967296;this._block.writeUInt32BE(f,this._blockSize-8),this._block.writeUInt32BE(h,this._blockSize-4)}this._update(this._block);var a=this._hash();return o?a.toString(o):a},u.prototype._update=function(){throw new Error("_update must be implemented by subclass")},hash$1=u,hash$1}var sha$1,hasRequiredSha$1;function requireSha$1(){if(hasRequiredSha$1)return sha$1;hasRequiredSha$1=1;var c=requireInherits_browser(),t=requireHash$1(),u=requireSafeBuffer$1().Buffer,o=[1518500249,1859775393,-1894007588,-899497514],d=new Array(80);function r(){this.init(),this._w=d,t.call(this,64,56)}c(r,t),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function h(n){return n<<5|n>>>27}function f(n){return n<<30|n>>>2}function a(n,e,s,l){return n===0?e&s|~e&l:n===2?e&s|e&l|s&l:e^s^l}return r.prototype._update=function(n){for(var e=this._w,s=this._a|0,l=this._b|0,v=this._c|0,b=this._d|0,m=this._e|0,q=0;q<16;++q)e[q]=n.readInt32BE(q*4);for(;q<80;++q)e[q]=e[q-3]^e[q-8]^e[q-14]^e[q-16];for(var E=0;E<80;++E){var S=~~(E/20),O=h(s)+a(S,l,v,b)+m+e[E]+o[S]|0;m=b,b=v,v=f(l),l=s,s=O}this._a=s+this._a|0,this._b=l+this._b|0,this._c=v+this._c|0,this._d=b+this._d|0,this._e=m+this._e|0},r.prototype._hash=function(){var n=u.allocUnsafe(20);return n.writeInt32BE(this._a|0,0),n.writeInt32BE(this._b|0,4),n.writeInt32BE(this._c|0,8),n.writeInt32BE(this._d|0,12),n.writeInt32BE(this._e|0,16),n},sha$1=r,sha$1}var sha1,hasRequiredSha1;function requireSha1(){if(hasRequiredSha1)return sha1;hasRequiredSha1=1;var c=requireInherits_browser(),t=requireHash$1(),u=requireSafeBuffer$1().Buffer,o=[1518500249,1859775393,-1894007588,-899497514],d=new Array(80);function r(){this.init(),this._w=d,t.call(this,64,56)}c(r,t),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function h(e){return e<<1|e>>>31}function f(e){return e<<5|e>>>27}function a(e){return e<<30|e>>>2}function n(e,s,l,v){return e===0?s&l|~s&v:e===2?s&l|s&v|l&v:s^l^v}return r.prototype._update=function(e){for(var s=this._w,l=this._a|0,v=this._b|0,b=this._c|0,m=this._d|0,q=this._e|0,E=0;E<16;++E)s[E]=e.readInt32BE(E*4);for(;E<80;++E)s[E]=h(s[E-3]^s[E-8]^s[E-14]^s[E-16]);for(var S=0;S<80;++S){var O=~~(S/20),D=f(l)+n(O,v,b,m)+q+s[S]+o[O]|0;q=m,m=b,b=a(v),v=l,l=D}this._a=l+this._a|0,this._b=v+this._b|0,this._c=b+this._c|0,this._d=m+this._d|0,this._e=q+this._e|0},r.prototype._hash=function(){var e=u.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e},sha1=r,sha1}var sha256$1,hasRequiredSha256;function requireSha256(){if(hasRequiredSha256)return sha256$1;hasRequiredSha256=1;var c=requireInherits_browser(),t=requireHash$1(),u=requireSafeBuffer$1().Buffer,o=[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],d=new Array(64);function r(){this.init(),this._w=d,t.call(this,64,56)}c(r,t),r.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};function h(l,v,b){return b^l&(v^b)}function f(l,v,b){return l&v|b&(l|v)}function a(l){return(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10)}function n(l){return(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7)}function e(l){return(l>>>7|l<<25)^(l>>>18|l<<14)^l>>>3}function s(l){return(l>>>17|l<<15)^(l>>>19|l<<13)^l>>>10}return r.prototype._update=function(l){for(var v=this._w,b=this._a|0,m=this._b|0,q=this._c|0,E=this._d|0,S=this._e|0,O=this._f|0,D=this._g|0,j=this._h|0,$=0;$<16;++$)v[$]=l.readInt32BE($*4);for(;$<64;++$)v[$]=s(v[$-2])+v[$-7]+e(v[$-15])+v[$-16]|0;for(var J=0;J<64;++J){var ie=j+n(S)+h(S,O,D)+o[J]+v[J]|0,ne=a(b)+f(b,m,q)|0;j=D,D=O,O=S,S=E+ie|0,E=q,q=m,m=b,b=ie+ne|0}this._a=b+this._a|0,this._b=m+this._b|0,this._c=q+this._c|0,this._d=E+this._d|0,this._e=S+this._e|0,this._f=O+this._f|0,this._g=D+this._g|0,this._h=j+this._h|0},r.prototype._hash=function(){var l=u.allocUnsafe(32);return l.writeInt32BE(this._a,0),l.writeInt32BE(this._b,4),l.writeInt32BE(this._c,8),l.writeInt32BE(this._d,12),l.writeInt32BE(this._e,16),l.writeInt32BE(this._f,20),l.writeInt32BE(this._g,24),l.writeInt32BE(this._h,28),l},sha256$1=r,sha256$1}var sha224$1,hasRequiredSha224;function requireSha224(){if(hasRequiredSha224)return sha224$1;hasRequiredSha224=1;var c=requireInherits_browser(),t=requireSha256(),u=requireHash$1(),o=requireSafeBuffer$1().Buffer,d=new Array(64);function r(){this.init(),this._w=d,u.call(this,64,56)}return c(r,t),r.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},r.prototype._hash=function(){var h=o.allocUnsafe(28);return h.writeInt32BE(this._a,0),h.writeInt32BE(this._b,4),h.writeInt32BE(this._c,8),h.writeInt32BE(this._d,12),h.writeInt32BE(this._e,16),h.writeInt32BE(this._f,20),h.writeInt32BE(this._g,24),h},sha224$1=r,sha224$1}var sha512$1,hasRequiredSha512;function requireSha512(){if(hasRequiredSha512)return sha512$1;hasRequiredSha512=1;var c=requireInherits_browser(),t=requireHash$1(),u=requireSafeBuffer$1().Buffer,o=[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],d=new Array(160);function r(){this.init(),this._w=d,t.call(this,128,112)}c(r,t),r.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};function h(m,q,E){return E^m&(q^E)}function f(m,q,E){return m&q|E&(m|q)}function a(m,q){return(m>>>28|q<<4)^(q>>>2|m<<30)^(q>>>7|m<<25)}function n(m,q){return(m>>>14|q<<18)^(m>>>18|q<<14)^(q>>>9|m<<23)}function e(m,q){return(m>>>1|q<<31)^(m>>>8|q<<24)^m>>>7}function s(m,q){return(m>>>1|q<<31)^(m>>>8|q<<24)^(m>>>7|q<<25)}function l(m,q){return(m>>>19|q<<13)^(q>>>29|m<<3)^m>>>6}function v(m,q){return(m>>>19|q<<13)^(q>>>29|m<<3)^(m>>>6|q<<26)}function b(m,q){return m>>>0<q>>>0?1:0}return r.prototype._update=function(m){for(var q=this._w,E=this._ah|0,S=this._bh|0,O=this._ch|0,D=this._dh|0,j=this._eh|0,$=this._fh|0,J=this._gh|0,ie=this._hh|0,ne=this._al|0,de=this._bl|0,Z=this._cl|0,y=this._dl|0,g=this._el|0,p=this._fl|0,_=this._gl|0,R=this._hl|0,B=0;B<32;B+=2)q[B]=m.readInt32BE(B*4),q[B+1]=m.readInt32BE(B*4+4);for(;B<160;B+=2){var P=q[B-30],A=q[B-30+1],w=e(P,A),M=s(A,P);P=q[B-4],A=q[B-4+1];var x=l(P,A),L=v(A,P),K=q[B-14],Q=q[B-14+1],H=q[B-32],N=q[B-32+1],F=M+Q|0,ee=w+K+b(F,M)|0;F=F+L|0,ee=ee+x+b(F,L)|0,F=F+N|0,ee=ee+H+b(F,N)|0,q[B]=ee,q[B+1]=F}for(var ae=0;ae<160;ae+=2){ee=q[ae],F=q[ae+1];var z=f(E,S,O),G=f(ne,de,Z),fe=a(E,ne),me=a(ne,E),xe=n(j,g),_e=n(g,j),qe=o[ae],Re=o[ae+1],be=h(j,$,J),Fe=h(g,p,_),Be=R+_e|0,Me=ie+xe+b(Be,R)|0;Be=Be+Fe|0,Me=Me+be+b(Be,Fe)|0,Be=Be+Re|0,Me=Me+qe+b(Be,Re)|0,Be=Be+F|0,Me=Me+ee+b(Be,F)|0;var Te=me+G|0,oe=fe+z+b(Te,me)|0;ie=J,R=_,J=$,_=p,$=j,p=g,g=y+Be|0,j=D+Me+b(g,y)|0,D=O,y=Z,O=S,Z=de,S=E,de=ne,ne=Be+Te|0,E=Me+oe+b(ne,Be)|0}this._al=this._al+ne|0,this._bl=this._bl+de|0,this._cl=this._cl+Z|0,this._dl=this._dl+y|0,this._el=this._el+g|0,this._fl=this._fl+p|0,this._gl=this._gl+_|0,this._hl=this._hl+R|0,this._ah=this._ah+E+b(this._al,ne)|0,this._bh=this._bh+S+b(this._bl,de)|0,this._ch=this._ch+O+b(this._cl,Z)|0,this._dh=this._dh+D+b(this._dl,y)|0,this._eh=this._eh+j+b(this._el,g)|0,this._fh=this._fh+$+b(this._fl,p)|0,this._gh=this._gh+J+b(this._gl,_)|0,this._hh=this._hh+ie+b(this._hl,R)|0},r.prototype._hash=function(){var m=u.allocUnsafe(64);function q(E,S,O){m.writeInt32BE(E,O),m.writeInt32BE(S,O+4)}return q(this._ah,this._al,0),q(this._bh,this._bl,8),q(this._ch,this._cl,16),q(this._dh,this._dl,24),q(this._eh,this._el,32),q(this._fh,this._fl,40),q(this._gh,this._gl,48),q(this._hh,this._hl,56),m},sha512$1=r,sha512$1}var sha384$1,hasRequiredSha384;function requireSha384(){if(hasRequiredSha384)return sha384$1;hasRequiredSha384=1;var c=requireInherits_browser(),t=requireSha512(),u=requireHash$1(),o=requireSafeBuffer$1().Buffer,d=new Array(160);function r(){this.init(),this._w=d,u.call(this,128,112)}return c(r,t),r.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},r.prototype._hash=function(){var h=o.allocUnsafe(48);function f(a,n,e){h.writeInt32BE(a,e),h.writeInt32BE(n,e+4)}return f(this._ah,this._al,0),f(this._bh,this._bl,8),f(this._ch,this._cl,16),f(this._dh,this._dl,24),f(this._eh,this._el,32),f(this._fh,this._fl,40),h},sha384$1=r,sha384$1}var hasRequiredSha_js;function requireSha_js(){return hasRequiredSha_js||(hasRequiredSha_js=1,(function(c){c.exports=function(u){var o=u.toLowerCase(),d=c.exports[o];if(!d)throw new Error(o+" is not supported (we accept pull requests)");return new d},c.exports.sha=requireSha$1(),c.exports.sha1=requireSha1(),c.exports.sha224=requireSha224(),c.exports.sha256=requireSha256(),c.exports.sha384=requireSha384(),c.exports.sha512=requireSha512()})(sha_js)),sha_js.exports}var cipherBase,hasRequiredCipherBase;function requireCipherBase(){if(hasRequiredCipherBase)return cipherBase;hasRequiredCipherBase=1;var c=requireSafeBuffer$1().Buffer,t=requireStreamBrowserify().Transform,u=requireString_decoder().StringDecoder,o=requireInherits_browser(),d=requireToBuffer$2();function r(h){t.call(this),this.hashMode=typeof h=="string",this.hashMode?this[h]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}return o(r,t),r.prototype.update=function(h,f,a){var n=d(h,f),e=this._update(n);return this.hashMode?this:(a&&(e=this._toString(e,a)),e)},r.prototype.setAutoPadding=function(){},r.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},r.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},r.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},r.prototype._transform=function(h,f,a){var n;try{this.hashMode?this._update(h):this.push(this._update(h))}catch(e){n=e}finally{a(n)}},r.prototype._flush=function(h){var f;try{this.push(this.__final())}catch(a){f=a}h(f)},r.prototype._finalOrDigest=function(h){var f=this.__final()||c.alloc(0);return h&&(f=this._toString(f,h,!0)),f},r.prototype._toString=function(h,f,a){if(this._decoder||(this._decoder=new u(f),this._encoding=f),this._encoding!==f)throw new Error("can’t switch encodings");var n=this._decoder.write(h);return a&&(n+=this._decoder.end()),n},cipherBase=r,cipherBase}var browser$9,hasRequiredBrowser$9;function requireBrowser$9(){if(hasRequiredBrowser$9)return browser$9;hasRequiredBrowser$9=1;var c=requireInherits_browser(),t=requireMd5_js(),u=requireRipemd160(),o=requireSha_js(),d=requireCipherBase();function r(h){d.call(this,"digest"),this._hash=h}return c(r,d),r.prototype._update=function(h){this._hash.update(h)},r.prototype._final=function(){return this._hash.digest()},browser$9=function(f){return f=f.toLowerCase(),f==="md5"?new t:f==="rmd160"||f==="ripemd160"?new u:new r(o(f))},browser$9}var legacy,hasRequiredLegacy;function requireLegacy(){if(hasRequiredLegacy)return legacy;hasRequiredLegacy=1;var c=requireInherits_browser(),t=requireSafeBuffer$1().Buffer,u=requireCipherBase(),o=t.alloc(128),d=64;function r(h,f){u.call(this,"digest"),typeof f=="string"&&(f=t.from(f)),this._alg=h,this._key=f,f.length>d?f=h(f):f.length<d&&(f=t.concat([f,o],d));for(var a=this._ipad=t.allocUnsafe(d),n=this._opad=t.allocUnsafe(d),e=0;e<d;e++)a[e]=f[e]^54,n[e]=f[e]^92;this._hash=[a]}return c(r,u),r.prototype._update=function(h){this._hash.push(h)},r.prototype._final=function(){var h=this._alg(t.concat(this._hash));return this._alg(t.concat([this._opad,h]))},legacy=r,legacy}var md5,hasRequiredMd5;function requireMd5(){if(hasRequiredMd5)return md5;hasRequiredMd5=1;var c=requireMd5_js();return md5=function(t){return new c().update(t).digest()},md5}var browser$8,hasRequiredBrowser$8;function requireBrowser$8(){if(hasRequiredBrowser$8)return browser$8;hasRequiredBrowser$8=1;var c=requireInherits_browser(),t=requireLegacy(),u=requireCipherBase(),o=requireSafeBuffer$1().Buffer,d=requireMd5(),r=requireRipemd160(),h=requireSha_js(),f=o.alloc(128);function a(n,e){u.call(this,"digest"),typeof e=="string"&&(e=o.from(e));var s=n==="sha512"||n==="sha384"?128:64;if(this._alg=n,this._key=e,e.length>s){var l=n==="rmd160"?new r:h(n);e=l.update(e).digest()}else e.length<s&&(e=o.concat([e,f],s));for(var v=this._ipad=o.allocUnsafe(s),b=this._opad=o.allocUnsafe(s),m=0;m<s;m++)v[m]=e[m]^54,b[m]=e[m]^92;this._hash=n==="rmd160"?new r:h(n),this._hash.update(v)}return c(a,u),a.prototype._update=function(n){this._hash.update(n)},a.prototype._final=function(){var n=this._hash.digest(),e=this._alg==="rmd160"?new r:h(this._alg);return e.update(this._opad).update(n).digest()},browser$8=function(e,s){return e=e.toLowerCase(),e==="rmd160"||e==="ripemd160"?new a("rmd160",s):e==="md5"?new t(d,s):new a(e,s)},browser$8}const sha224WithRSAEncryption={sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption={sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption={sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption={sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},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={sign:"dsa",hash:"sha1",id:""},ripemd160WithRSA={sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption={sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},require$$6={sha224WithRSAEncryption,"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption,"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption,"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption,"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,sha224,sha384,sha512,"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA,"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,"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption,"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}};var algos,hasRequiredAlgos;function requireAlgos(){return hasRequiredAlgos||(hasRequiredAlgos=1,algos=require$$6),algos}var browser$7={},precondition,hasRequiredPrecondition;function requirePrecondition(){if(hasRequiredPrecondition)return precondition;hasRequiredPrecondition=1;var c=isFinite,t=Math.pow(2,30)-1;return precondition=function(u,o){if(typeof u!="number")throw new TypeError("Iterations not a number");if(u<0||!c(u))throw new TypeError("Bad iterations");if(typeof o!="number")throw new TypeError("Key length not a number");if(o<0||o>t||o!==o)throw new TypeError("Bad key length")},precondition}var defaultEncoding_1,hasRequiredDefaultEncoding;function requireDefaultEncoding(){if(hasRequiredDefaultEncoding)return defaultEncoding_1;hasRequiredDefaultEncoding=1;var c;if(commonjsGlobal.process&&commonjsGlobal.process.browser)c="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){var t=parseInt(process$1.version.split(".")[0].slice(1),10);c=t>=6?"utf-8":"binary"}else c="utf-8";return defaultEncoding_1=c,defaultEncoding_1}var toBuffer_1,hasRequiredToBuffer;function requireToBuffer(){if(hasRequiredToBuffer)return toBuffer_1;hasRequiredToBuffer=1;var c=requireSafeBuffer$1().Buffer,t=requireToBuffer$2(),u=typeof Uint8Array<"u",o=u&&typeof ArrayBuffer<"u",d=o&&ArrayBuffer.isView;return toBuffer_1=function(r,h,f){if(typeof r=="string"||c.isBuffer(r)||u&&r instanceof Uint8Array||d&&d(r))return t(r,h);throw new TypeError(f+" must be a string, a Buffer, a Uint8Array, or a DataView")},toBuffer_1}var syncBrowser,hasRequiredSyncBrowser;function requireSyncBrowser(){if(hasRequiredSyncBrowser)return syncBrowser;hasRequiredSyncBrowser=1;var c=requireMd5(),t=requireRipemd160(),u=requireSha_js(),o=requireSafeBuffer$1().Buffer,d=requirePrecondition(),r=requireDefaultEncoding(),h=requireToBuffer(),f=o.alloc(128),a={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,ripemd160:20,rmd160:20},n={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"};function e(b){return new t().update(b).digest()}function s(b){function m(q){return u(b).update(q).digest()}return b==="rmd160"||b==="ripemd160"?e:b==="md5"?c:m}function l(b,m,q){var E=s(b),S=b==="sha512"||b==="sha384"?128:64;m.length>S?m=E(m):m.length<S&&(m=o.concat([m,f],S));for(var O=o.allocUnsafe(S+a[b]),D=o.allocUnsafe(S+a[b]),j=0;j<S;j++)O[j]=m[j]^54,D[j]=m[j]^92;var $=o.allocUnsafe(S+q+4);O.copy($,0,0,S),this.ipad1=$,this.ipad2=O,this.opad=D,this.alg=b,this.blocksize=S,this.hash=E,this.size=a[b]}l.prototype.run=function(b,m){b.copy(m,this.blocksize);var q=this.hash(m);return q.copy(this.opad,this.blocksize),this.hash(this.opad)};function v(b,m,q,E,S){d(q,E),b=h(b,r,"Password"),m=h(m,r,"Salt");var O=(S||"sha1").toLowerCase(),D=n[O]||O,j=a[D];if(typeof j!="number"||!j)throw new TypeError("Digest algorithm not supported: "+S);var $=new l(D,b,m.length),J=o.allocUnsafe(E),ie=o.allocUnsafe(m.length+4);m.copy(ie,0,0,m.length);for(var ne=0,de=j,Z=Math.ceil(E/de),y=1;y<=Z;y++){ie.writeUInt32BE(y,m.length);for(var g=$.run(ie,$.ipad1),p=g,_=1;_<q;_++){p=$.run(p,$.ipad2);for(var R=0;R<de;R++)g[R]^=p[R]}g.copy(J,ne),ne+=de}return J}return syncBrowser=v,syncBrowser}var async,hasRequiredAsync;function requireAsync(){if(hasRequiredAsync)return async;hasRequiredAsync=1;var c=requireSafeBuffer$1().Buffer,t=requirePrecondition(),u=requireDefaultEncoding(),o=requireSyncBrowser(),d=requireToBuffer(),r,h=commonjsGlobal.crypto&&commonjsGlobal.crypto.subtle,f={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"},a=[],n;function e(){return n||(commonjsGlobal.process&&commonjsGlobal.process.nextTick?n=commonjsGlobal.process.nextTick:commonjsGlobal.queueMicrotask?n=commonjsGlobal.queueMicrotask:commonjsGlobal.setImmediate?n=commonjsGlobal.setImmediate:n=commonjsGlobal.setTimeout,n)}function s(b,m,q,E,S){return h.importKey("raw",b,{name:"PBKDF2"},!1,["deriveBits"]).then(function(O){return h.deriveBits({name:"PBKDF2",salt:m,iterations:q,hash:{name:S}},O,E<<3)}).then(function(O){return c.from(O)})}function l(b){if(commonjsGlobal.process&&!commonjsGlobal.process.browser||!h||!h.importKey||!h.deriveBits)return Promise.resolve(!1);if(a[b]!==void 0)return a[b];r=r||c.alloc(8);var m=s(r,r,10,128,b).then(function(){return!0},function(){return!1});return a[b]=m,m}function v(b,m){b.then(function(q){e()(function(){m(null,q)})},function(q){e()(function(){m(q)})})}return async=function(b,m,q,E,S,O){if(typeof S=="function"&&(O=S,S=void 0),t(q,E),b=d(b,u,"Password"),m=d(m,u,"Salt"),typeof O!="function")throw new Error("No callback provided to pbkdf2");S=S||"sha1";var D=f[S.toLowerCase()];if(!D||typeof commonjsGlobal.Promise!="function"){e()(function(){var j;try{j=o(b,m,q,E,S)}catch($){O($);return}O(null,j)});return}v(l(D).then(function(j){return j?s(b,m,q,E,D):o(b,m,q,E,S)}),O)},async}var hasRequiredBrowser$7;function requireBrowser$7(){return hasRequiredBrowser$7||(hasRequiredBrowser$7=1,browser$7.pbkdf2=requireAsync(),browser$7.pbkdf2Sync=requireSyncBrowser()),browser$7}var browser$6={},des$1={},utils$3={},hasRequiredUtils$4;function requireUtils$4(){if(hasRequiredUtils$4)return utils$3;hasRequiredUtils$4=1,utils$3.readUInt32BE=function(d,r){var h=d[0+r]<<24|d[1+r]<<16|d[2+r]<<8|d[3+r];return h>>>0},utils$3.writeUInt32BE=function(d,r,h){d[0+h]=r>>>24,d[1+h]=r>>>16&255,d[2+h]=r>>>8&255,d[3+h]=r&255},utils$3.ip=function(d,r,h,f){for(var a=0,n=0,e=6;e>=0;e-=2){for(var s=0;s<=24;s+=8)a<<=1,a|=r>>>s+e&1;for(var s=0;s<=24;s+=8)a<<=1,a|=d>>>s+e&1}for(var e=6;e>=0;e-=2){for(var s=1;s<=25;s+=8)n<<=1,n|=r>>>s+e&1;for(var s=1;s<=25;s+=8)n<<=1,n|=d>>>s+e&1}h[f+0]=a>>>0,h[f+1]=n>>>0},utils$3.rip=function(d,r,h,f){for(var a=0,n=0,e=0;e<4;e++)for(var s=24;s>=0;s-=8)a<<=1,a|=r>>>s+e&1,a<<=1,a|=d>>>s+e&1;for(var e=4;e<8;e++)for(var s=24;s>=0;s-=8)n<<=1,n|=r>>>s+e&1,n<<=1,n|=d>>>s+e&1;h[f+0]=a>>>0,h[f+1]=n>>>0},utils$3.pc1=function(d,r,h,f){for(var a=0,n=0,e=7;e>=5;e--){for(var s=0;s<=24;s+=8)a<<=1,a|=r>>s+e&1;for(var s=0;s<=24;s+=8)a<<=1,a|=d>>s+e&1}for(var s=0;s<=24;s+=8)a<<=1,a|=r>>s+e&1;for(var e=1;e<=3;e++){for(var s=0;s<=24;s+=8)n<<=1,n|=r>>s+e&1;for(var s=0;s<=24;s+=8)n<<=1,n|=d>>s+e&1}for(var s=0;s<=24;s+=8)n<<=1,n|=d>>s+e&1;h[f+0]=a>>>0,h[f+1]=n>>>0},utils$3.r28shl=function(d,r){return d<<r&268435455|d>>>28-r};var c=[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];utils$3.pc2=function(d,r,h,f){for(var a=0,n=0,e=c.length>>>1,s=0;s<e;s++)a<<=1,a|=d>>>c[s]&1;for(var s=e;s<c.length;s++)n<<=1,n|=r>>>c[s]&1;h[f+0]=a>>>0,h[f+1]=n>>>0},utils$3.expand=function(d,r,h){var f=0,a=0;f=(d&1)<<5|d>>>27;for(var n=23;n>=15;n-=4)f<<=6,f|=d>>>n&63;for(var n=11;n>=3;n-=4)a|=d>>>n&63,a<<=6;a|=(d&31)<<1|d>>>31,r[h+0]=f>>>0,r[h+1]=a>>>0};var t=[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];utils$3.substitute=function(d,r){for(var h=0,f=0;f<4;f++){var a=d>>>18-f*6&63,n=t[f*64+a];h<<=4,h|=n}for(var f=0;f<4;f++){var a=r>>>18-f*6&63,n=t[256+f*64+a];h<<=4,h|=n}return h>>>0};var u=[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];return utils$3.permute=function(d){for(var r=0,h=0;h<u.length;h++)r<<=1,r|=d>>>u[h]&1;return r>>>0},utils$3.padSplit=function(d,r,h){for(var f=d.toString(2);f.length<r;)f="0"+f;for(var a=[],n=0;n<r;n+=h)a.push(f.slice(n,n+h));return a.join(" ")},utils$3}var minimalisticAssert,hasRequiredMinimalisticAssert;function requireMinimalisticAssert(){if(hasRequiredMinimalisticAssert)return minimalisticAssert;hasRequiredMinimalisticAssert=1,minimalisticAssert=c;function c(t,u){if(!t)throw new Error(u||"Assertion failed")}return c.equal=function(u,o,d){if(u!=o)throw new Error(d||"Assertion failed: "+u+" != "+o)},minimalisticAssert}var cipher,hasRequiredCipher;function requireCipher(){if(hasRequiredCipher)return cipher;hasRequiredCipher=1;var c=requireMinimalisticAssert();function t(u){this.options=u,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=u.padding!==!1}return cipher=t,t.prototype._init=function(){},t.prototype.update=function(o){return o.length===0?[]:this.type==="decrypt"?this._updateDecrypt(o):this._updateEncrypt(o)},t.prototype._buffer=function(o,d){for(var r=Math.min(this.buffer.length-this.bufferOff,o.length-d),h=0;h<r;h++)this.buffer[this.bufferOff+h]=o[d+h];return this.bufferOff+=r,r},t.prototype._flushBuffer=function(o,d){return this._update(this.buffer,0,o,d),this.bufferOff=0,this.blockSize},t.prototype._updateEncrypt=function(o){var d=0,r=0,h=(this.bufferOff+o.length)/this.blockSize|0,f=new Array(h*this.blockSize);this.bufferOff!==0&&(d+=this._buffer(o,d),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(f,r)));for(var a=o.length-(o.length-d)%this.blockSize;d<a;d+=this.blockSize)this._update(o,d,f,r),r+=this.blockSize;for(;d<o.length;d++,this.bufferOff++)this.buffer[this.bufferOff]=o[d];return f},t.prototype._updateDecrypt=function(o){for(var d=0,r=0,h=Math.ceil((this.bufferOff+o.length)/this.blockSize)-1,f=new Array(h*this.blockSize);h>0;h--)d+=this._buffer(o,d),r+=this._flushBuffer(f,r);return d+=this._buffer(o,d),f},t.prototype.final=function(o){var d;o&&(d=this.update(o));var r;return this.type==="encrypt"?r=this._finalEncrypt():r=this._finalDecrypt(),d?d.concat(r):r},t.prototype._pad=function(o,d){if(d===0)return!1;for(;d<o.length;)o[d++]=0;return!0},t.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var o=new Array(this.blockSize);return this._update(this.buffer,0,o,0),o},t.prototype._unpad=function(o){return o},t.prototype._finalDecrypt=function(){c.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var o=new Array(this.blockSize);return this._flushBuffer(o,0),this._unpad(o)},cipher}var des,hasRequiredDes$1;function requireDes$1(){if(hasRequiredDes$1)return des;hasRequiredDes$1=1;var c=requireMinimalisticAssert(),t=requireInherits_browser(),u=requireUtils$4(),o=requireCipher();function d(){this.tmp=new Array(2),this.keys=null}function r(f){o.call(this,f);var a=new d;this._desState=a,this.deriveKeys(a,f.key)}t(r,o),des=r,r.create=function(a){return new r(a)};var h=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];return r.prototype.deriveKeys=function(a,n){a.keys=new Array(32),c.equal(n.length,this.blockSize,"Invalid key length");var e=u.readUInt32BE(n,0),s=u.readUInt32BE(n,4);u.pc1(e,s,a.tmp,0),e=a.tmp[0],s=a.tmp[1];for(var l=0;l<a.keys.length;l+=2){var v=h[l>>>1];e=u.r28shl(e,v),s=u.r28shl(s,v),u.pc2(e,s,a.keys,l)}},r.prototype._update=function(a,n,e,s){var l=this._desState,v=u.readUInt32BE(a,n),b=u.readUInt32BE(a,n+4);u.ip(v,b,l.tmp,0),v=l.tmp[0],b=l.tmp[1],this.type==="encrypt"?this._encrypt(l,v,b,l.tmp,0):this._decrypt(l,v,b,l.tmp,0),v=l.tmp[0],b=l.tmp[1],u.writeUInt32BE(e,v,s),u.writeUInt32BE(e,b,s+4)},r.prototype._pad=function(a,n){if(this.padding===!1)return!1;for(var e=a.length-n,s=n;s<a.length;s++)a[s]=e;return!0},r.prototype._unpad=function(a){if(this.padding===!1)return a;for(var n=a[a.length-1],e=a.length-n;e<a.length;e++)c.equal(a[e],n);return a.slice(0,a.length-n)},r.prototype._encrypt=function(a,n,e,s,l){for(var v=n,b=e,m=0;m<a.keys.length;m+=2){var q=a.keys[m],E=a.keys[m+1];u.expand(b,a.tmp,0),q^=a.tmp[0],E^=a.tmp[1];var S=u.substitute(q,E),O=u.permute(S),D=b;b=(v^O)>>>0,v=D}u.rip(b,v,s,l)},r.prototype._decrypt=function(a,n,e,s,l){for(var v=e,b=n,m=a.keys.length-2;m>=0;m-=2){var q=a.keys[m],E=a.keys[m+1];u.expand(v,a.tmp,0),q^=a.tmp[0],E^=a.tmp[1];var S=u.substitute(q,E),O=u.permute(S),D=v;v=(b^O)>>>0,b=D}u.rip(v,b,s,l)},des}var cbc$1={},hasRequiredCbc$1;function requireCbc$1(){if(hasRequiredCbc$1)return cbc$1;hasRequiredCbc$1=1;var c=requireMinimalisticAssert(),t=requireInherits_browser(),u={};function o(r){c.equal(r.length,8,"Invalid IV length"),this.iv=new Array(8);for(var h=0;h<this.iv.length;h++)this.iv[h]=r[h]}function d(r){function h(e){r.call(this,e),this._cbcInit()}t(h,r);for(var f=Object.keys(u),a=0;a<f.length;a++){var n=f[a];h.prototype[n]=u[n]}return h.create=function(s){return new h(s)},h}return cbc$1.instantiate=d,u._cbcInit=function(){var h=new o(this.options.iv);this._cbcState=h},u._update=function(h,f,a,n){var e=this._cbcState,s=this.constructor.super_.prototype,l=e.iv;if(this.type==="encrypt"){for(var v=0;v<this.blockSize;v++)l[v]^=h[f+v];s._update.call(this,l,0,a,n);for(var v=0;v<this.blockSize;v++)l[v]=a[n+v]}else{s._update.call(this,h,f,a,n);for(var v=0;v<this.blockSize;v++)a[n+v]^=l[v];for(var v=0;v<this.blockSize;v++)l[v]=h[f+v]}},cbc$1}var ede,hasRequiredEde;function requireEde(){if(hasRequiredEde)return ede;hasRequiredEde=1;var c=requireMinimalisticAssert(),t=requireInherits_browser(),u=requireCipher(),o=requireDes$1();function d(h,f){c.equal(f.length,24,"Invalid key length");var a=f.slice(0,8),n=f.slice(8,16),e=f.slice(16,24);h==="encrypt"?this.ciphers=[o.create({type:"encrypt",key:a}),o.create({type:"decrypt",key:n}),o.create({type:"encrypt",key:e})]:this.ciphers=[o.create({type:"decrypt",key:e}),o.create({type:"encrypt",key:n}),o.create({type:"decrypt",key:a})]}function r(h){u.call(this,h);var f=new d(this.type,this.options.key);this._edeState=f}return t(r,u),ede=r,r.create=function(f){return new r(f)},r.prototype._update=function(f,a,n,e){var s=this._edeState;s.ciphers[0]._update(f,a,n,e),s.ciphers[1]._update(n,e,n,e),s.ciphers[2]._update(n,e,n,e)},r.prototype._pad=o.prototype._pad,r.prototype._unpad=o.prototype._unpad,ede}var hasRequiredDes;function requireDes(){return hasRequiredDes||(hasRequiredDes=1,des$1.utils=requireUtils$4(),des$1.Cipher=requireCipher(),des$1.DES=requireDes$1(),des$1.CBC=requireCbc$1(),des$1.EDE=requireEde()),des$1}var browserifyDes,hasRequiredBrowserifyDes;function requireBrowserifyDes(){if(hasRequiredBrowserifyDes)return browserifyDes;hasRequiredBrowserifyDes=1;var c=requireCipherBase(),t=requireDes(),u=requireInherits_browser(),o=requireSafeBuffer$1().Buffer,d={"des-ede3-cbc":t.CBC.instantiate(t.EDE),"des-ede3":t.EDE,"des-ede-cbc":t.CBC.instantiate(t.EDE),"des-ede":t.EDE,"des-cbc":t.CBC.instantiate(t.DES),"des-ecb":t.DES};d.des=d["des-cbc"],d.des3=d["des-ede3-cbc"],browserifyDes=r,u(r,c);function r(h){c.call(this);var f=h.mode.toLowerCase(),a=d[f],n;h.decrypt?n="decrypt":n="encrypt";var e=h.key;o.isBuffer(e)||(e=o.from(e)),(f==="des-ede"||f==="des-ede-cbc")&&(e=o.concat([e,e.slice(0,8)]));var s=h.iv;o.isBuffer(s)||(s=o.from(s)),this._des=a.create({key:e,iv:s,type:n})}return r.prototype._update=function(h){return o.from(this._des.update(h))},r.prototype._final=function(){return o.from(this._des.final())},browserifyDes}var browser$5={},encrypter={},ecb={},hasRequiredEcb;function requireEcb(){return hasRequiredEcb||(hasRequiredEcb=1,ecb.encrypt=function(c,t){return c._cipher.encryptBlock(t)},ecb.decrypt=function(c,t){return c._cipher.decryptBlock(t)}),ecb}var cbc={},bufferXor,hasRequiredBufferXor;function requireBufferXor(){return hasRequiredBufferXor||(hasRequiredBufferXor=1,bufferXor=function(t,u){for(var o=Math.min(t.length,u.length),d=new Buffer(o),r=0;r<o;++r)d[r]=t[r]^u[r];return d}),bufferXor}var hasRequiredCbc;function requireCbc(){if(hasRequiredCbc)return cbc;hasRequiredCbc=1;var c=requireBufferXor();return cbc.encrypt=function(t,u){var o=c(u,t._prev);return t._prev=t._cipher.encryptBlock(o),t._prev},cbc.decrypt=function(t,u){var o=t._prev;t._prev=u;var d=t._cipher.decryptBlock(u);return c(d,o)},cbc}var cfb={},hasRequiredCfb;function requireCfb(){if(hasRequiredCfb)return cfb;hasRequiredCfb=1;var c=requireSafeBuffer$1().Buffer,t=requireBufferXor();function u(o,d,r){var h=d.length,f=t(d,o._cache);return o._cache=o._cache.slice(h),o._prev=c.concat([o._prev,r?d:f]),f}return cfb.encrypt=function(o,d,r){for(var h=c.allocUnsafe(0),f;d.length;)if(o._cache.length===0&&(o._cache=o._cipher.encryptBlock(o._prev),o._prev=c.allocUnsafe(0)),o._cache.length<=d.length)f=o._cache.length,h=c.concat([h,u(o,d.slice(0,f),r)]),d=d.slice(f);else{h=c.concat([h,u(o,d,r)]);break}return h},cfb}var cfb8={},hasRequiredCfb8;function requireCfb8(){if(hasRequiredCfb8)return cfb8;hasRequiredCfb8=1;var c=requireSafeBuffer$1().Buffer;function t(u,o,d){var r=u._cipher.encryptBlock(u._prev),h=r[0]^o;return u._prev=c.concat([u._prev.slice(1),c.from([d?o:h])]),h}return cfb8.encrypt=function(u,o,d){for(var r=o.length,h=c.allocUnsafe(r),f=-1;++f<r;)h[f]=t(u,o[f],d);return h},cfb8}var cfb1={},hasRequiredCfb1;function requireCfb1(){if(hasRequiredCfb1)return cfb1;hasRequiredCfb1=1;var c=requireSafeBuffer$1().Buffer;function t(o,d,r){for(var h,f=-1,a=8,n=0,e,s;++f<a;)h=o._cipher.encryptBlock(o._prev),e=d&1<<7-f?128:0,s=h[0]^e,n+=(s&128)>>f%8,o._prev=u(o._prev,r?e:s);return n}function u(o,d){var r=o.length,h=-1,f=c.allocUnsafe(o.length);for(o=c.concat([o,c.from([d])]);++h<r;)f[h]=o[h]<<1|o[h+1]>>7;return f}return cfb1.encrypt=function(o,d,r){for(var h=d.length,f=c.allocUnsafe(h),a=-1;++a<h;)f[a]=t(o,d[a],r);return f},cfb1}var ofb={},hasRequiredOfb;function requireOfb(){if(hasRequiredOfb)return ofb;hasRequiredOfb=1;var c=requireBufferXor();function t(u){return u._prev=u._cipher.encryptBlock(u._prev),u._prev}return ofb.encrypt=function(u,o){for(;u._cache.length<o.length;)u._cache=Buffer.concat([u._cache,t(u)]);var d=u._cache.slice(0,o.length);return u._cache=u._cache.slice(o.length),c(o,d)},ofb}var ctr={},incr32_1,hasRequiredIncr32;function requireIncr32(){if(hasRequiredIncr32)return incr32_1;hasRequiredIncr32=1;function c(t){for(var u=t.length,o;u--;)if(o=t.readUInt8(u),o===255)t.writeUInt8(0,u);else{o++,t.writeUInt8(o,u);break}}return incr32_1=c,incr32_1}var hasRequiredCtr;function requireCtr(){if(hasRequiredCtr)return ctr;hasRequiredCtr=1;var c=requireBufferXor(),t=requireSafeBuffer$1().Buffer,u=requireIncr32();function o(r){var h=r._cipher.encryptBlockRaw(r._prev);return u(r._prev),h}var d=16;return ctr.encrypt=function(r,h){var f=Math.ceil(h.length/d),a=r._cache.length;r._cache=t.concat([r._cache,t.allocUnsafe(f*d)]);for(var n=0;n<f;n++){var e=o(r),s=a+n*d;r._cache.writeUInt32BE(e[0],s+0),r._cache.writeUInt32BE(e[1],s+4),r._cache.writeUInt32BE(e[2],s+8),r._cache.writeUInt32BE(e[3],s+12)}var l=r._cache.slice(0,h.length);return r._cache=r._cache.slice(h.length),c(h,l)},ctr}const 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"},require$$2={"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,aes192,aes256,"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"}};var modes_1,hasRequiredModes$1;function requireModes$1(){if(hasRequiredModes$1)return modes_1;hasRequiredModes$1=1;var c={ECB:requireEcb(),CBC:requireCbc(),CFB:requireCfb(),CFB8:requireCfb8(),CFB1:requireCfb1(),OFB:requireOfb(),CTR:requireCtr(),GCM:requireCtr()},t=require$$2;for(var u in t)t[u].module=c[t[u].mode];return modes_1=t,modes_1}var aes={},hasRequiredAes;function requireAes(){if(hasRequiredAes)return aes;hasRequiredAes=1;var c=requireSafeBuffer$1().Buffer;function t(f){c.isBuffer(f)||(f=c.from(f));for(var a=f.length/4|0,n=new Array(a),e=0;e<a;e++)n[e]=f.readUInt32BE(e*4);return n}function u(f){for(var a=0;a<f.length;f++)f[a]=0}function o(f,a,n,e,s){for(var l=n[0],v=n[1],b=n[2],m=n[3],q=f[0]^a[0],E=f[1]^a[1],S=f[2]^a[2],O=f[3]^a[3],D,j,$,J,ie=4,ne=1;ne<s;ne++)D=l[q>>>24]^v[E>>>16&255]^b[S>>>8&255]^m[O&255]^a[ie++],j=l[E>>>24]^v[S>>>16&255]^b[O>>>8&255]^m[q&255]^a[ie++],$=l[S>>>24]^v[O>>>16&255]^b[q>>>8&255]^m[E&255]^a[ie++],J=l[O>>>24]^v[q>>>16&255]^b[E>>>8&255]^m[S&255]^a[ie++],q=D,E=j,S=$,O=J;return D=(e[q>>>24]<<24|e[E>>>16&255]<<16|e[S>>>8&255]<<8|e[O&255])^a[ie++],j=(e[E>>>24]<<24|e[S>>>16&255]<<16|e[O>>>8&255]<<8|e[q&255])^a[ie++],$=(e[S>>>24]<<24|e[O>>>16&255]<<16|e[q>>>8&255]<<8|e[E&255])^a[ie++],J=(e[O>>>24]<<24|e[q>>>16&255]<<16|e[E>>>8&255]<<8|e[S&255])^a[ie++],D=D>>>0,j=j>>>0,$=$>>>0,J=J>>>0,[D,j,$,J]}var d=[0,1,2,4,8,16,32,64,128,27,54],r=(function(){for(var f=new Array(256),a=0;a<256;a++)a<128?f[a]=a<<1:f[a]=a<<1^283;for(var n=[],e=[],s=[[],[],[],[]],l=[[],[],[],[]],v=0,b=0,m=0;m<256;++m){var q=b^b<<1^b<<2^b<<3^b<<4;q=q>>>8^q&255^99,n[v]=q,e[q]=v;var E=f[v],S=f[E],O=f[S],D=f[q]*257^q*16843008;s[0][v]=D<<24|D>>>8,s[1][v]=D<<16|D>>>16,s[2][v]=D<<8|D>>>24,s[3][v]=D,D=O*16843009^S*65537^E*257^v*16843008,l[0][q]=D<<24|D>>>8,l[1][q]=D<<16|D>>>16,l[2][q]=D<<8|D>>>24,l[3][q]=D,v===0?v=b=1:(v=E^f[f[f[O^E]]],b^=f[f[b]])}return{SBOX:n,INV_SBOX:e,SUB_MIX:s,INV_SUB_MIX:l}})();function h(f){this._key=t(f),this._reset()}return h.blockSize=16,h.keySize=256/8,h.prototype.blockSize=h.blockSize,h.prototype.keySize=h.keySize,h.prototype._reset=function(){for(var f=this._key,a=f.length,n=a+6,e=(n+1)*4,s=[],l=0;l<a;l++)s[l]=f[l];for(l=a;l<e;l++){var v=s[l-1];l%a===0?(v=v<<8|v>>>24,v=r.SBOX[v>>>24]<<24|r.SBOX[v>>>16&255]<<16|r.SBOX[v>>>8&255]<<8|r.SBOX[v&255],v^=d[l/a|0]<<24):a>6&&l%a===4&&(v=r.SBOX[v>>>24]<<24|r.SBOX[v>>>16&255]<<16|r.SBOX[v>>>8&255]<<8|r.SBOX[v&255]),s[l]=s[l-a]^v}for(var b=[],m=0;m<e;m++){var q=e-m,E=s[q-(m%4?0:4)];m<4||q<=4?b[m]=E:b[m]=r.INV_SUB_MIX[0][r.SBOX[E>>>24]]^r.INV_SUB_MIX[1][r.SBOX[E>>>16&255]]^r.INV_SUB_MIX[2][r.SBOX[E>>>8&255]]^r.INV_SUB_MIX[3][r.SBOX[E&255]]}this._nRounds=n,this._keySchedule=s,this._invKeySchedule=b},h.prototype.encryptBlockRaw=function(f){return f=t(f),o(f,this._keySchedule,r.SUB_MIX,r.SBOX,this._nRounds)},h.prototype.encryptBlock=function(f){var a=this.encryptBlockRaw(f),n=c.allocUnsafe(16);return n.writeUInt32BE(a[0],0),n.writeUInt32BE(a[1],4),n.writeUInt32BE(a[2],8),n.writeUInt32BE(a[3],12),n},h.prototype.decryptBlock=function(f){f=t(f);var a=f[1];f[1]=f[3],f[3]=a;var n=o(f,this._invKeySchedule,r.INV_SUB_MIX,r.INV_SBOX,this._nRounds),e=c.allocUnsafe(16);return e.writeUInt32BE(n[0],0),e.writeUInt32BE(n[3],4),e.writeUInt32BE(n[2],8),e.writeUInt32BE(n[1],12),e},h.prototype.scrub=function(){u(this._keySchedule),u(this._invKeySchedule),u(this._key)},aes.AES=h,aes}var ghash,hasRequiredGhash;function requireGhash(){if(hasRequiredGhash)return ghash;hasRequiredGhash=1;var c=requireSafeBuffer$1().Buffer,t=c.alloc(16,0);function u(r){return[r.readUInt32BE(0),r.readUInt32BE(4),r.readUInt32BE(8),r.readUInt32BE(12)]}function o(r){var h=c.allocUnsafe(16);return h.writeUInt32BE(r[0]>>>0,0),h.writeUInt32BE(r[1]>>>0,4),h.writeUInt32BE(r[2]>>>0,8),h.writeUInt32BE(r[3]>>>0,12),h}function d(r){this.h=r,this.state=c.alloc(16,0),this.cache=c.allocUnsafe(0)}return d.prototype.ghash=function(r){for(var h=-1;++h<r.length;)this.state[h]^=r[h];this._multiply()},d.prototype._multiply=function(){for(var r=u(this.h),h=[0,0,0,0],f,a,n,e=-1;++e<128;){for(a=(this.state[~~(e/8)]&1<<7-e%8)!==0,a&&(h[0]^=r[0],h[1]^=r[1],h[2]^=r[2],h[3]^=r[3]),n=(r[3]&1)!==0,f=3;f>0;f--)r[f]=r[f]>>>1|(r[f-1]&1)<<31;r[0]=r[0]>>>1,n&&(r[0]=r[0]^225<<24)}this.state=o(h)},d.prototype.update=function(r){this.cache=c.concat([this.cache,r]);for(var h;this.cache.length>=16;)h=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(h)},d.prototype.final=function(r,h){return this.cache.length&&this.ghash(c.concat([this.cache,t],16)),this.ghash(o([0,r,0,h])),this.state},ghash=d,ghash}var authCipher,hasRequiredAuthCipher;function requireAuthCipher(){if(hasRequiredAuthCipher)return authCipher;hasRequiredAuthCipher=1;var c=requireAes(),t=requireSafeBuffer$1().Buffer,u=requireCipherBase(),o=requireInherits_browser(),d=requireGhash(),r=requireBufferXor(),h=requireIncr32();function f(e,s){var l=0;e.length!==s.length&&l++;for(var v=Math.min(e.length,s.length),b=0;b<v;++b)l+=e[b]^s[b];return l}function a(e,s,l){if(s.length===12)return e._finID=t.concat([s,t.from([0,0,0,1])]),t.concat([s,t.from([0,0,0,2])]);var v=new d(l),b=s.length,m=b%16;v.update(s),m&&(m=16-m,v.update(t.alloc(m,0))),v.update(t.alloc(8,0));var q=b*8,E=t.alloc(8);E.writeUIntBE(q,0,8),v.update(E),e._finID=v.state;var S=t.from(e._finID);return h(S),S}function n(e,s,l,v){u.call(this);var b=t.alloc(4,0);this._cipher=new c.AES(s);var m=this._cipher.encryptBlock(b);this._ghash=new d(m),l=a(this,l,m),this._prev=t.from(l),this._cache=t.allocUnsafe(0),this._secCache=t.allocUnsafe(0),this._decrypt=v,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}return o(n,u),n.prototype._update=function(e){if(!this._called&&this._alen){var s=16-this._alen%16;s<16&&(s=t.alloc(s,0),this._ghash.update(s))}this._called=!0;var l=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(l),this._len+=e.length,l},n.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=r(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&f(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},n.prototype.getAuthTag=function(){if(this._decrypt||!t.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},n.prototype.setAuthTag=function(s){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=s},n.prototype.setAAD=function(s){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(s),this._alen+=s.length},authCipher=n,authCipher}var streamCipher,hasRequiredStreamCipher;function requireStreamCipher(){if(hasRequiredStreamCipher)return streamCipher;hasRequiredStreamCipher=1;var c=requireAes(),t=requireSafeBuffer$1().Buffer,u=requireCipherBase(),o=requireInherits_browser();function d(r,h,f,a){u.call(this),this._cipher=new c.AES(h),this._prev=t.from(f),this._cache=t.allocUnsafe(0),this._secCache=t.allocUnsafe(0),this._decrypt=a,this._mode=r}return o(d,u),d.prototype._update=function(r){return this._mode.encrypt(this,r,this._decrypt)},d.prototype._final=function(){this._cipher.scrub()},streamCipher=d,streamCipher}var evp_bytestokey,hasRequiredEvp_bytestokey;function requireEvp_bytestokey(){if(hasRequiredEvp_bytestokey)return evp_bytestokey;hasRequiredEvp_bytestokey=1;var c=requireSafeBuffer$1().Buffer,t=requireMd5_js();function u(o,d,r,h){if(c.isBuffer(o)||(o=c.from(o,"binary")),d&&(c.isBuffer(d)||(d=c.from(d,"binary")),d.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var f=r/8,a=c.alloc(f),n=c.alloc(h||0),e=c.alloc(0);f>0||h>0;){var s=new t;s.update(e),s.update(o),d&&s.update(d),e=s.digest();var l=0;if(f>0){var v=a.length-f;l=Math.min(f,e.length),e.copy(a,v,0,l),f-=l}if(l<e.length&&h>0){var b=n.length-h,m=Math.min(h,e.length-l);e.copy(n,b,l,l+m),h-=m}}return e.fill(0),{key:a,iv:n}}return evp_bytestokey=u,evp_bytestokey}var hasRequiredEncrypter;function requireEncrypter(){if(hasRequiredEncrypter)return encrypter;hasRequiredEncrypter=1;var c=requireModes$1(),t=requireAuthCipher(),u=requireSafeBuffer$1().Buffer,o=requireStreamCipher(),d=requireCipherBase(),r=requireAes(),h=requireEvp_bytestokey(),f=requireInherits_browser();function a(v,b,m){d.call(this),this._cache=new e,this._cipher=new r.AES(b),this._prev=u.from(m),this._mode=v,this._autopadding=!0}f(a,d),a.prototype._update=function(v){this._cache.add(v);for(var b,m,q=[];b=this._cache.get();)m=this._mode.encrypt(this,b),q.push(m);return u.concat(q)};var n=u.alloc(16,16);a.prototype._final=function(){var v=this._cache.flush();if(this._autopadding)return v=this._mode.encrypt(this,v),this._cipher.scrub(),v;if(!v.equals(n))throw this._cipher.scrub(),new Error("data not multiple of block length")},a.prototype.setAutoPadding=function(v){return this._autopadding=!!v,this};function e(){this.cache=u.allocUnsafe(0)}e.prototype.add=function(v){this.cache=u.concat([this.cache,v])},e.prototype.get=function(){if(this.cache.length>15){var v=this.cache.slice(0,16);return this.cache=this.cache.slice(16),v}return null},e.prototype.flush=function(){for(var v=16-this.cache.length,b=u.allocUnsafe(v),m=-1;++m<v;)b.writeUInt8(v,m);return u.concat([this.cache,b])};function s(v,b,m){var q=c[v.toLowerCase()];if(!q)throw new TypeError("invalid suite type");if(typeof b=="string"&&(b=u.from(b)),b.length!==q.key/8)throw new TypeError("invalid key length "+b.length);if(typeof m=="string"&&(m=u.from(m)),q.mode!=="GCM"&&m.length!==q.iv)throw new TypeError("invalid iv length "+m.length);return q.type==="stream"?new o(q.module,b,m):q.type==="auth"?new t(q.module,b,m):new a(q.module,b,m)}function l(v,b){var m=c[v.toLowerCase()];if(!m)throw new TypeError("invalid suite type");var q=h(b,!1,m.key,m.iv);return s(v,q.key,q.iv)}return encrypter.createCipheriv=s,encrypter.createCipher=l,encrypter}var decrypter={},hasRequiredDecrypter;function requireDecrypter(){if(hasRequiredDecrypter)return decrypter;hasRequiredDecrypter=1;var c=requireAuthCipher(),t=requireSafeBuffer$1().Buffer,u=requireModes$1(),o=requireStreamCipher(),d=requireCipherBase(),r=requireAes(),h=requireEvp_bytestokey(),f=requireInherits_browser();function a(v,b,m){d.call(this),this._cache=new n,this._last=void 0,this._cipher=new r.AES(b),this._prev=t.from(m),this._mode=v,this._autopadding=!0}f(a,d),a.prototype._update=function(v){this._cache.add(v);for(var b,m,q=[];b=this._cache.get(this._autopadding);)m=this._mode.decrypt(this,b),q.push(m);return t.concat(q)},a.prototype._final=function(){var v=this._cache.flush();if(this._autopadding)return e(this._mode.decrypt(this,v));if(v)throw new Error("data not multiple of block length")},a.prototype.setAutoPadding=function(v){return this._autopadding=!!v,this};function n(){this.cache=t.allocUnsafe(0)}n.prototype.add=function(v){this.cache=t.concat([this.cache,v])},n.prototype.get=function(v){var b;if(v){if(this.cache.length>16)return b=this.cache.slice(0,16),this.cache=this.cache.slice(16),b}else if(this.cache.length>=16)return b=this.cache.slice(0,16),this.cache=this.cache.slice(16),b;return null},n.prototype.flush=function(){if(this.cache.length)return this.cache};function e(v){var b=v[15];if(b<1||b>16)throw new Error("unable to decrypt data");for(var m=-1;++m<b;)if(v[m+(16-b)]!==b)throw new Error("unable to decrypt data");if(b!==16)return v.slice(0,16-b)}function s(v,b,m){var q=u[v.toLowerCase()];if(!q)throw new TypeError("invalid suite type");if(typeof m=="string"&&(m=t.from(m)),q.mode!=="GCM"&&m.length!==q.iv)throw new TypeError("invalid iv length "+m.length);if(typeof b=="string"&&(b=t.from(b)),b.length!==q.key/8)throw new TypeError("invalid key length "+b.length);return q.type==="stream"?new o(q.module,b,m,!0):q.type==="auth"?new c(q.module,b,m,!0):new a(q.module,b,m)}function l(v,b){var m=u[v.toLowerCase()];if(!m)throw new TypeError("invalid suite type");var q=h(b,!1,m.key,m.iv);return s(v,q.key,q.iv)}return decrypter.createDecipher=l,decrypter.createDecipheriv=s,decrypter}var hasRequiredBrowser$6;function requireBrowser$6(){if(hasRequiredBrowser$6)return browser$5;hasRequiredBrowser$6=1;var c=requireEncrypter(),t=requireDecrypter(),u=require$$2;function o(){return Object.keys(u)}return browser$5.createCipher=browser$5.Cipher=c.createCipher,browser$5.createCipheriv=browser$5.Cipheriv=c.createCipheriv,browser$5.createDecipher=browser$5.Decipher=t.createDecipher,browser$5.createDecipheriv=browser$5.Decipheriv=t.createDecipheriv,browser$5.listCiphers=browser$5.getCiphers=o,browser$5}var modes={},hasRequiredModes;function requireModes(){return hasRequiredModes||(hasRequiredModes=1,(function(c){c["des-ecb"]={key:8,iv:0},c["des-cbc"]=c.des={key:8,iv:8},c["des-ede3-cbc"]=c.des3={key:24,iv:8},c["des-ede3"]={key:24,iv:0},c["des-ede-cbc"]={key:16,iv:8},c["des-ede"]={key:16,iv:0}})(modes)),modes}var hasRequiredBrowser$5;function requireBrowser$5(){if(hasRequiredBrowser$5)return browser$6;hasRequiredBrowser$5=1;var c=requireBrowserifyDes(),t=requireBrowser$6(),u=requireModes$1(),o=requireModes(),d=requireEvp_bytestokey();function r(e,s){e=e.toLowerCase();var l,v;if(u[e])l=u[e].key,v=u[e].iv;else if(o[e])l=o[e].key*8,v=o[e].iv;else throw new TypeError("invalid suite type");var b=d(s,!1,l,v);return f(e,b.key,b.iv)}function h(e,s){e=e.toLowerCase();var l,v;if(u[e])l=u[e].key,v=u[e].iv;else if(o[e])l=o[e].key*8,v=o[e].iv;else throw new TypeError("invalid suite type");var b=d(s,!1,l,v);return a(e,b.key,b.iv)}function f(e,s,l){if(e=e.toLowerCase(),u[e])return t.createCipheriv(e,s,l);if(o[e])return new c({key:s,iv:l,mode:e});throw new TypeError("invalid suite type")}function a(e,s,l){if(e=e.toLowerCase(),u[e])return t.createDecipheriv(e,s,l);if(o[e])return new c({key:s,iv:l,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}function n(){return Object.keys(o).concat(t.getCiphers())}return browser$6.createCipher=browser$6.Cipher=r,browser$6.createCipheriv=browser$6.Cipheriv=f,browser$6.createDecipher=browser$6.Decipher=h,browser$6.createDecipheriv=browser$6.Decipheriv=a,browser$6.listCiphers=browser$6.getCiphers=n,browser$6}var browser$4={},bn$3={exports:{}},bn$2=bn$3.exports,hasRequiredBn$1;function requireBn$1(){return hasRequiredBn$1||(hasRequiredBn$1=1,(function(c){(function(t,u){function o(Z,y){if(!Z)throw new Error(y||"Assertion failed")}function d(Z,y){Z.super_=y;var g=function(){};g.prototype=y.prototype,Z.prototype=new g,Z.prototype.constructor=Z}function r(Z,y,g){if(r.isBN(Z))return Z;this.negative=0,this.words=null,this.length=0,this.red=null,Z!==null&&((y==="le"||y==="be")&&(g=y,y=10),this._init(Z||0,y||10,g||"be"))}typeof t=="object"?t.exports=r:u.BN=r,r.BN=r,r.wordSize=26;var h;try{typeof window<"u"&&typeof window.Buffer<"u"?h=window.Buffer:h=requireDist().Buffer}catch{}r.isBN=function(y){return y instanceof r?!0:y!==null&&typeof y=="object"&&y.constructor.wordSize===r.wordSize&&Array.isArray(y.words)},r.max=function(y,g){return y.cmp(g)>0?y:g},r.min=function(y,g){return y.cmp(g)<0?y:g},r.prototype._init=function(y,g,p){if(typeof y=="number")return this._initNumber(y,g,p);if(typeof y=="object")return this._initArray(y,g,p);g==="hex"&&(g=16),o(g===(g|0)&&g>=2&&g<=36),y=y.toString().replace(/\s+/g,"");var _=0;y[0]==="-"&&(_++,this.negative=1),_<y.length&&(g===16?this._parseHex(y,_,p):(this._parseBase(y,g,_),p==="le"&&this._initArray(this.toArray(),g,p)))},r.prototype._initNumber=function(y,g,p){y<0&&(this.negative=1,y=-y),y<67108864?(this.words=[y&67108863],this.length=1):y<4503599627370496?(this.words=[y&67108863,y/67108864&67108863],this.length=2):(o(y<9007199254740992),this.words=[y&67108863,y/67108864&67108863,1],this.length=3),p==="le"&&this._initArray(this.toArray(),g,p)},r.prototype._initArray=function(y,g,p){if(o(typeof y.length=="number"),y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(y.length/3),this.words=new Array(this.length);for(var _=0;_<this.length;_++)this.words[_]=0;var R,B,P=0;if(p==="be")for(_=y.length-1,R=0;_>=0;_-=3)B=y[_]|y[_-1]<<8|y[_-2]<<16,this.words[R]|=B<<P&67108863,this.words[R+1]=B>>>26-P&67108863,P+=24,P>=26&&(P-=26,R++);else if(p==="le")for(_=0,R=0;_<y.length;_+=3)B=y[_]|y[_+1]<<8|y[_+2]<<16,this.words[R]|=B<<P&67108863,this.words[R+1]=B>>>26-P&67108863,P+=24,P>=26&&(P-=26,R++);return this.strip()};function f(Z,y){var g=Z.charCodeAt(y);return g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:g-48&15}function a(Z,y,g){var p=f(Z,g);return g-1>=y&&(p|=f(Z,g-1)<<4),p}r.prototype._parseHex=function(y,g,p){this.length=Math.ceil((y.length-g)/6),this.words=new Array(this.length);for(var _=0;_<this.length;_++)this.words[_]=0;var R=0,B=0,P;if(p==="be")for(_=y.length-1;_>=g;_-=2)P=a(y,g,_)<<R,this.words[B]|=P&67108863,R>=18?(R-=18,B+=1,this.words[B]|=P>>>26):R+=8;else{var A=y.length-g;for(_=A%2===0?g+1:g;_<y.length;_+=2)P=a(y,g,_)<<R,this.words[B]|=P&67108863,R>=18?(R-=18,B+=1,this.words[B]|=P>>>26):R+=8}this.strip()};function n(Z,y,g,p){for(var _=0,R=Math.min(Z.length,g),B=y;B<R;B++){var P=Z.charCodeAt(B)-48;_*=p,P>=49?_+=P-49+10:P>=17?_+=P-17+10:_+=P}return _}r.prototype._parseBase=function(y,g,p){this.words=[0],this.length=1;for(var _=0,R=1;R<=67108863;R*=g)_++;_--,R=R/g|0;for(var B=y.length-p,P=B%_,A=Math.min(B,B-P)+p,w=0,M=p;M<A;M+=_)w=n(y,M,M+_,g),this.imuln(R),this.words[0]+w<67108864?this.words[0]+=w:this._iaddn(w);if(P!==0){var x=1;for(w=n(y,M,y.length,g),M=0;M<P;M++)x*=g;this.imuln(x),this.words[0]+w<67108864?this.words[0]+=w:this._iaddn(w)}this.strip()},r.prototype.copy=function(y){y.words=new Array(this.length);for(var g=0;g<this.length;g++)y.words[g]=this.words[g];y.length=this.length,y.negative=this.negative,y.red=this.red},r.prototype.clone=function(){var y=new r(null);return this.copy(y),y},r.prototype._expand=function(y){for(;this.length<y;)this.words[this.length++]=0;return this},r.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},r.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var e=["","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"],s=[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],l=[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];r.prototype.toString=function(y,g){y=y||10,g=g|0||1;var p;if(y===16||y==="hex"){p="";for(var _=0,R=0,B=0;B<this.length;B++){var P=this.words[B],A=((P<<_|R)&16777215).toString(16);R=P>>>24-_&16777215,_+=2,_>=26&&(_-=26,B--),R!==0||B!==this.length-1?p=e[6-A.length]+A+p:p=A+p}for(R!==0&&(p=R.toString(16)+p);p.length%g!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(y===(y|0)&&y>=2&&y<=36){var w=s[y],M=l[y];p="";var x=this.clone();for(x.negative=0;!x.isZero();){var L=x.modn(M).toString(y);x=x.idivn(M),x.isZero()?p=L+p:p=e[w-L.length]+L+p}for(this.isZero()&&(p="0"+p);p.length%g!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}o(!1,"Base should be between 2 and 36")},r.prototype.toNumber=function(){var y=this.words[0];return this.length===2?y+=this.words[1]*67108864:this.length===3&&this.words[2]===1?y+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-y:y},r.prototype.toJSON=function(){return this.toString(16)},r.prototype.toBuffer=function(y,g){return o(typeof h<"u"),this.toArrayLike(h,y,g)},r.prototype.toArray=function(y,g){return this.toArrayLike(Array,y,g)},r.prototype.toArrayLike=function(y,g,p){var _=this.byteLength(),R=p||Math.max(1,_);o(_<=R,"byte array longer than desired length"),o(R>0,"Requested array length <= 0"),this.strip();var B=g==="le",P=new y(R),A,w,M=this.clone();if(B){for(w=0;!M.isZero();w++)A=M.andln(255),M.iushrn(8),P[w]=A;for(;w<R;w++)P[w]=0}else{for(w=0;w<R-_;w++)P[w]=0;for(w=0;!M.isZero();w++)A=M.andln(255),M.iushrn(8),P[R-w-1]=A}return P},Math.clz32?r.prototype._countBits=function(y){return 32-Math.clz32(y)}:r.prototype._countBits=function(y){var g=y,p=0;return g>=4096&&(p+=13,g>>>=13),g>=64&&(p+=7,g>>>=7),g>=8&&(p+=4,g>>>=4),g>=2&&(p+=2,g>>>=2),p+g},r.prototype._zeroBits=function(y){if(y===0)return 26;var g=y,p=0;return(g&8191)===0&&(p+=13,g>>>=13),(g&127)===0&&(p+=7,g>>>=7),(g&15)===0&&(p+=4,g>>>=4),(g&3)===0&&(p+=2,g>>>=2),(g&1)===0&&p++,p},r.prototype.bitLength=function(){var y=this.words[this.length-1],g=this._countBits(y);return(this.length-1)*26+g};function v(Z){for(var y=new Array(Z.bitLength()),g=0;g<y.length;g++){var p=g/26|0,_=g%26;y[g]=(Z.words[p]&1<<_)>>>_}return y}r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var y=0,g=0;g<this.length;g++){var p=this._zeroBits(this.words[g]);if(y+=p,p!==26)break}return y},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(y){return this.negative!==0?this.abs().inotn(y).iaddn(1):this.clone()},r.prototype.fromTwos=function(y){return this.testn(y-1)?this.notn(y).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return this.negative!==0},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(y){for(;this.length<y.length;)this.words[this.length++]=0;for(var g=0;g<y.length;g++)this.words[g]=this.words[g]|y.words[g];return this.strip()},r.prototype.ior=function(y){return o((this.negative|y.negative)===0),this.iuor(y)},r.prototype.or=function(y){return this.length>y.length?this.clone().ior(y):y.clone().ior(this)},r.prototype.uor=function(y){return this.length>y.length?this.clone().iuor(y):y.clone().iuor(this)},r.prototype.iuand=function(y){var g;this.length>y.length?g=y:g=this;for(var p=0;p<g.length;p++)this.words[p]=this.words[p]&y.words[p];return this.length=g.length,this.strip()},r.prototype.iand=function(y){return o((this.negative|y.negative)===0),this.iuand(y)},r.prototype.and=function(y){return this.length>y.length?this.clone().iand(y):y.clone().iand(this)},r.prototype.uand=function(y){return this.length>y.length?this.clone().iuand(y):y.clone().iuand(this)},r.prototype.iuxor=function(y){var g,p;this.length>y.length?(g=this,p=y):(g=y,p=this);for(var _=0;_<p.length;_++)this.words[_]=g.words[_]^p.words[_];if(this!==g)for(;_<g.length;_++)this.words[_]=g.words[_];return this.length=g.length,this.strip()},r.prototype.ixor=function(y){return o((this.negative|y.negative)===0),this.iuxor(y)},r.prototype.xor=function(y){return this.length>y.length?this.clone().ixor(y):y.clone().ixor(this)},r.prototype.uxor=function(y){return this.length>y.length?this.clone().iuxor(y):y.clone().iuxor(this)},r.prototype.inotn=function(y){o(typeof y=="number"&&y>=0);var g=Math.ceil(y/26)|0,p=y%26;this._expand(g),p>0&&g--;for(var _=0;_<g;_++)this.words[_]=~this.words[_]&67108863;return p>0&&(this.words[_]=~this.words[_]&67108863>>26-p),this.strip()},r.prototype.notn=function(y){return this.clone().inotn(y)},r.prototype.setn=function(y,g){o(typeof y=="number"&&y>=0);var p=y/26|0,_=y%26;return this._expand(p+1),g?this.words[p]=this.words[p]|1<<_:this.words[p]=this.words[p]&~(1<<_),this.strip()},r.prototype.iadd=function(y){var g;if(this.negative!==0&&y.negative===0)return this.negative=0,g=this.isub(y),this.negative^=1,this._normSign();if(this.negative===0&&y.negative!==0)return y.negative=0,g=this.isub(y),y.negative=1,g._normSign();var p,_;this.length>y.length?(p=this,_=y):(p=y,_=this);for(var R=0,B=0;B<_.length;B++)g=(p.words[B]|0)+(_.words[B]|0)+R,this.words[B]=g&67108863,R=g>>>26;for(;R!==0&&B<p.length;B++)g=(p.words[B]|0)+R,this.words[B]=g&67108863,R=g>>>26;if(this.length=p.length,R!==0)this.words[this.length]=R,this.length++;else if(p!==this)for(;B<p.length;B++)this.words[B]=p.words[B];return this},r.prototype.add=function(y){var g;return y.negative!==0&&this.negative===0?(y.negative=0,g=this.sub(y),y.negative^=1,g):y.negative===0&&this.negative!==0?(this.negative=0,g=y.sub(this),this.negative=1,g):this.length>y.length?this.clone().iadd(y):y.clone().iadd(this)},r.prototype.isub=function(y){if(y.negative!==0){y.negative=0;var g=this.iadd(y);return y.negative=1,g._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(y),this.negative=1,this._normSign();var p=this.cmp(y);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var _,R;p>0?(_=this,R=y):(_=y,R=this);for(var B=0,P=0;P<R.length;P++)g=(_.words[P]|0)-(R.words[P]|0)+B,B=g>>26,this.words[P]=g&67108863;for(;B!==0&&P<_.length;P++)g=(_.words[P]|0)+B,B=g>>26,this.words[P]=g&67108863;if(B===0&&P<_.length&&_!==this)for(;P<_.length;P++)this.words[P]=_.words[P];return this.length=Math.max(this.length,P),_!==this&&(this.negative=1),this.strip()},r.prototype.sub=function(y){return this.clone().isub(y)};function b(Z,y,g){g.negative=y.negative^Z.negative;var p=Z.length+y.length|0;g.length=p,p=p-1|0;var _=Z.words[0]|0,R=y.words[0]|0,B=_*R,P=B&67108863,A=B/67108864|0;g.words[0]=P;for(var w=1;w<p;w++){for(var M=A>>>26,x=A&67108863,L=Math.min(w,y.length-1),K=Math.max(0,w-Z.length+1);K<=L;K++){var Q=w-K|0;_=Z.words[Q]|0,R=y.words[K]|0,B=_*R+x,M+=B/67108864|0,x=B&67108863}g.words[w]=x|0,A=M|0}return A!==0?g.words[w]=A|0:g.length--,g.strip()}var m=function(y,g,p){var _=y.words,R=g.words,B=p.words,P=0,A,w,M,x=_[0]|0,L=x&8191,K=x>>>13,Q=_[1]|0,H=Q&8191,N=Q>>>13,F=_[2]|0,ee=F&8191,ae=F>>>13,z=_[3]|0,G=z&8191,fe=z>>>13,me=_[4]|0,xe=me&8191,_e=me>>>13,qe=_[5]|0,Re=qe&8191,be=qe>>>13,Fe=_[6]|0,Be=Fe&8191,Me=Fe>>>13,Te=_[7]|0,oe=Te&8191,ce=Te>>>13,ge=_[8]|0,we=ge&8191,Se=ge>>>13,Oe=_[9]|0,U=Oe&8191,I=Oe>>>13,C=R[0]|0,X=C&8191,se=C>>>13,le=R[1]|0,ve=le&8191,Ce=le>>>13,Le=R[2]|0,Ie=Le&8191,$e=Le>>>13,je=R[3]|0,He=je&8191,Ke=je>>>13,Ze=R[4]|0,We=Ze&8191,Ye=Ze>>>13,Xe=R[5]|0,W=Xe&8191,T=Xe>>>13,k=R[6]|0,re=k&8191,ue=k>>>13,pe=R[7]|0,ye=pe&8191,ke=pe>>>13,Ve=R[8]|0,Ne=Ve&8191,Ge=Ve>>>13,Ue=R[9]|0,ze=Ue&8191,Je=Ue>>>13;p.negative=y.negative^g.negative,p.length=19,A=Math.imul(L,X),w=Math.imul(L,se),w=w+Math.imul(K,X)|0,M=Math.imul(K,se);var Qe=(P+A|0)+((w&8191)<<13)|0;P=(M+(w>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,A=Math.imul(H,X),w=Math.imul(H,se),w=w+Math.imul(N,X)|0,M=Math.imul(N,se),A=A+Math.imul(L,ve)|0,w=w+Math.imul(L,Ce)|0,w=w+Math.imul(K,ve)|0,M=M+Math.imul(K,Ce)|0;var er=(P+A|0)+((w&8191)<<13)|0;P=(M+(w>>>13)|0)+(er>>>26)|0,er&=67108863,A=Math.imul(ee,X),w=Math.imul(ee,se),w=w+Math.imul(ae,X)|0,M=Math.imul(ae,se),A=A+Math.imul(H,ve)|0,w=w+Math.imul(H,Ce)|0,w=w+Math.imul(N,ve)|0,M=M+Math.imul(N,Ce)|0,A=A+Math.imul(L,Ie)|0,w=w+Math.imul(L,$e)|0,w=w+Math.imul(K,Ie)|0,M=M+Math.imul(K,$e)|0;var fr=(P+A|0)+((w&8191)<<13)|0;P=(M+(w>>>13)|0)+(fr>>>26)|0,fr&=67108863,A=Math.imul(G,X),w=Math.imul(G,se),w=w+Math.imul(fe,X)|0,M=Math.imul(fe,se),A=A+Math.imul(ee,ve)|0,w=w+Math.imul(ee,Ce)|0,w=w+Math.imul(ae,ve)|0,M=M+Math.imul(ae,Ce)|0,A=A+Math.imul(H,Ie)|0,w=w+Math.imul(H,$e)|0,w=w+Math.imul(N,Ie)|0,M=M+Math.imul(N,$e)|0,A=A+Math.imul(L,He)|0,w=w+Math.imul(L,Ke)|0,w=w+Math.imul(K,He)|0,M=M+Math.imul(K,Ke)|0;var ur=(P+A|0)+((w&8191)<<13)|0;P=(M+(w>>>13)|0)+(ur>>>26)|0,ur&=67108863,A=Math.imul(xe,X),w=Math.imul(xe,se),w=w+Math.imul(_e,X)|0,M=Math.imul(_e,se),A=A+Math.imul(G,ve)|0,w=w+Math.imul(G,Ce)|0,w=w+Math.imul(fe,ve)|0,M=M+Math.imul(fe,Ce)|0,A=A+Math.imul(ee,Ie)|0,w=w+Math.imul(ee,$e)|0,w=w+Math.imul(ae,Ie)|0,M=M+Math.imul(ae,$e)|0,A=A+Math.imul(H,He)|0,w=w+Math.imul(H,Ke)|0,w=w+Math.imul(N,He)|0,M=M+Math.imul(N,Ke)|0,A=A+Math.imul(L,We)|0,w=w+Math.imul(L,Ye)|0,w=w+Math.imul(K,We)|0,M=M+Math.imul(K,Ye)|0;var cr=(P+A|0)+((w&8191)<<13)|0;P=(M+(w>>>13)|0)+(cr>>>26)|0,cr&=67108863,A=Math.imul(Re,X),w=Math.imul(Re,se),w=w+Math.imul(be,X)|0,M=Math.imul(be,se),A=A+Math.imul(xe,ve)|0,w=w+Math.imul(xe,Ce)|0,w=w+Math.imul(_e,ve)|0,M=M+Math.imul(_e,Ce)|0,A=A+Math.imul(G,Ie)|0,w=w+Math.imul(G,$e)|0,w=w+Math.imul(fe,Ie)|0,M=M+Math.imul(fe,$e)|0,A=A+Math.imul(ee,He)|0,w=w+Math.imul(ee,Ke)|0,w=w+Math.imul(ae,He)|0,M=M+Math.imul(ae,Ke)|0,A=A+Math.imul(H,We)|0,w=w+Math.imul(H,Ye)|0,w=w+Math.imul(N,We)|0,M=M+Math.imul(N,Ye)|0,A=A+Math.imul(L,W)|0,w=w+Math.imul(L,T)|0,w=w+Math.imul(K,W)|0,M=M+Math.imul(K,T)|0;var nr=(P+A|0)+((w&8191)<<13)|0;P=(M+(w>>>13)|0)+(nr>>>26)|0,nr&=67108863,A=Math.imul(Be,X),w=Math.imul(Be,se),w=w+Math.imul(Me,X)|0,M=Math.imul(Me,se),A=A+Math.imul(Re,ve)|0,w=w+Math.imul(Re,Ce)|0,w=w+Math.imul(be,ve)|0,M=M+Math.imul(be,Ce)|0,A=A+Math.imul(xe,Ie)|0,w=w+Math.imul(xe,$e)|0,w=w+Math.imul(_e,Ie)|0,M=M+Math.imul(_e,$e)|0,A=A+Math.imul(G,He)|0,w=w+Math.imul(G,Ke)|0,w=w+Math.imul(fe,He)|0,M=M+Math.imul(fe,Ke)|0,A=A+Math.imul(ee,We)|0,w=w+Math.imul(ee,Ye)|0,w=w+Math.imul(ae,We)|0,M=M+Math.imul(ae,Ye)|0,A=A+Math.imul(H,W)|0,w=w+Math.imul(H,T)|0,w=w+Math.imul(N,W)|0,M=M+Math.imul(N,T)|0,A=A+Math.imul(L,re)|0,w=w+Math.imul(L,ue)|0,w=w+Math.imul(K,re)|0,M=M+Math.imul(K,ue)|0;var hr=(P+A|0)+((w&8191)<<13)|0;P=(M+(w>>>13)|0)+(hr>>>26)|0,hr&=67108863,A=Math.imul(oe,X),w=Math.imul(oe,se),w=w+Math.imul(ce,X)|0,M=Math.imul(ce,se),A=A+Math.imul(Be,ve)|0,w=w+Math.imul(Be,Ce)|0,w=w+Math.imul(Me,ve)|0,M=M+Math.imul(Me,Ce)|0,A=A+Math.imul(Re,Ie)|0,w=w+Math.imul(Re,$e)|0,w=w+Math.imul(be,Ie)|0,M=M+Math.imul(be,$e)|0,A=A+Math.imul(xe,He)|0,w=w+Math.imul(xe,Ke)|0,w=w+Math.imul(_e,He)|0,M=M+Math.imul(_e,Ke)|0,A=A+Math.imul(G,We)|0,w=w+Math.imul(G,Ye)|0,w=w+Math.imul(fe,We)|0,M=M+Math.imul(fe,Ye)|0,A=A+Math.imul(ee,W)|0,w=w+Math.imul(ee,T)|0,w=w+Math.imul(ae,W)|0,M=M+Math.imul(ae,T)|0,A=A+Math.imul(H,re)|0,w=w+Math.imul(H,ue)|0,w=w+Math.imul(N,re)|0,M=M+Math.imul(N,ue)|0,A=A+Math.imul(L,ye)|0,w=w+Math.imul(L,ke)|0,w=w+Math.imul(K,ye)|0,M=M+Math.imul(K,ke)|0;var lr=(P+A|0)+((w&8191)<<13)|0;P=(M+(w>>>13)|0)+(lr>>>26)|0,lr&=67108863,A=Math.imul(we,X),w=Math.imul(we,se),w=w+Math.imul(Se,X)|0,M=Math.imul(Se,se),A=A+Math.imul(oe,ve)|0,w=w+Math.imul(oe,Ce)|0,w=w+Math.imul(ce,ve)|0,M=M+Math.imul(ce,Ce)|0,A=A+Math.imul(Be,Ie)|0,w=w+Math.imul(Be,$e)|0,w=w+Math.imul(Me,Ie)|0,M=M+Math.imul(Me,$e)|0,A=A+Math.imul(Re,He)|0,w=w+Math.imul(Re,Ke)|0,w=w+Math.imul(be,He)|0,M=M+Math.imul(be,Ke)|0,A=A+Math.imul(xe,We)|0,w=w+Math.imul(xe,Ye)|0,w=w+Math.imul(_e,We)|0,M=M+Math.imul(_e,Ye)|0,A=A+Math.imul(G,W)|0,w=w+Math.imul(G,T)|0,w=w+Math.imul(fe,W)|0,M=M+Math.imul(fe,T)|0,A=A+Math.imul(ee,re)|0,w=w+Math.imul(ee,ue)|0,w=w+Math.imul(ae,re)|0,M=M+Math.imul(ae,ue)|0,A=A+Math.imul(H,ye)|0,w=w+Math.imul(H,ke)|0,w=w+Math.imul(N,ye)|0,M=M+Math.imul(N,ke)|0,A=A+Math.imul(L,Ne)|0,w=w+Math.imul(L,Ge)|0,w=w+Math.imul(K,Ne)|0,M=M+Math.imul(K,Ge)|0;var dr=(P+A|0)+((w&8191)<<13)|0;P=(M+(w>>>13)|0)+(dr>>>26)|0,dr&=67108863,A=Math.imul(U,X),w=Math.imul(U,se),w=w+Math.imul(I,X)|0,M=Math.imul(I,se),A=A+Math.imul(we,ve)|0,w=w+Math.imul(we,Ce)|0,w=w+Math.imul(Se,ve)|0,M=M+Math.imul(Se,Ce)|0,A=A+Math.imul(oe,Ie)|0,w=w+Math.imul(oe,$e)|0,w=w+Math.imul(ce,Ie)|0,M=M+Math.imul(ce,$e)|0,A=A+Math.imul(Be,He)|0,w=w+Math.imul(Be,Ke)|0,w=w+Math.imul(Me,He)|0,M=M+Math.imul(Me,Ke)|0,A=A+Math.imul(Re,We)|0,w=w+Math.imul(Re,Ye)|0,w=w+Math.imul(be,We)|0,M=M+Math.imul(be,Ye)|0,A=A+Math.imul(xe,W)|0,w=w+Math.imul(xe,T)|0,w=w+Math.imul(_e,W)|0,M=M+Math.imul(_e,T)|0,A=A+Math.imul(G,re)|0,w=w+Math.imul(G,ue)|0,w=w+Math.imul(fe,re)|0,M=M+Math.imul(fe,ue)|0,A=A+Math.imul(ee,ye)|0,w=w+Math.imul(ee,ke)|0,w=w+Math.imul(ae,ye)|0,M=M+Math.imul(ae,ke)|0,A=A+Math.imul(H,Ne)|0,w=w+Math.imul(H,Ge)|0,w=w+Math.imul(N,Ne)|0,M=M+Math.imul(N,Ge)|0,A=A+Math.imul(L,ze)|0,w=w+Math.imul(L,Je)|0,w=w+Math.imul(K,ze)|0,M=M+Math.imul(K,Je)|0;var pr=(P+A|0)+((w&8191)<<13)|0;P=(M+(w>>>13)|0)+(pr>>>26)|0,pr&=67108863,A=Math.imul(U,ve),w=Math.imul(U,Ce),w=w+Math.imul(I,ve)|0,M=Math.imul(I,Ce),A=A+Math.imul(we,Ie)|0,w=w+Math.imul(we,$e)|0,w=w+Math.imul(Se,Ie)|0,M=M+Math.imul(Se,$e)|0,A=A+Math.imul(oe,He)|0,w=w+Math.imul(oe,Ke)|0,w=w+Math.imul(ce,He)|0,M=M+Math.imul(ce,Ke)|0,A=A+Math.imul(Be,We)|0,w=w+Math.imul(Be,Ye)|0,w=w+Math.imul(Me,We)|0,M=M+Math.imul(Me,Ye)|0,A=A+Math.imul(Re,W)|0,w=w+Math.imul(Re,T)|0,w=w+Math.imul(be,W)|0,M=M+Math.imul(be,T)|0,A=A+Math.imul(xe,re)|0,w=w+Math.imul(xe,ue)|0,w=w+Math.imul(_e,re)|0,M=M+Math.imul(_e,ue)|0,A=A+Math.imul(G,ye)|0,w=w+Math.imul(G,ke)|0,w=w+Math.imul(fe,ye)|0,M=M+Math.imul(fe,ke)|0,A=A+Math.imul(ee,Ne)|0,w=w+Math.imul(ee,Ge)|0,w=w+Math.imul(ae,Ne)|0,M=M+Math.imul(ae,Ge)|0,A=A+Math.imul(H,ze)|0,w=w+Math.imul(H,Je)|0,w=w+Math.imul(N,ze)|0,M=M+Math.imul(N,Je)|0;var vr=(P+A|0)+((w&8191)<<13)|0;P=(M+(w>>>13)|0)+(vr>>>26)|0,vr&=67108863,A=Math.imul(U,Ie),w=Math.imul(U,$e),w=w+Math.imul(I,Ie)|0,M=Math.imul(I,$e),A=A+Math.imul(we,He)|0,w=w+Math.imul(we,Ke)|0,w=w+Math.imul(Se,He)|0,M=M+Math.imul(Se,Ke)|0,A=A+Math.imul(oe,We)|0,w=w+Math.imul(oe,Ye)|0,w=w+Math.imul(ce,We)|0,M=M+Math.imul(ce,Ye)|0,A=A+Math.imul(Be,W)|0,w=w+Math.imul(Be,T)|0,w=w+Math.imul(Me,W)|0,M=M+Math.imul(Me,T)|0,A=A+Math.imul(Re,re)|0,w=w+Math.imul(Re,ue)|0,w=w+Math.imul(be,re)|0,M=M+Math.imul(be,ue)|0,A=A+Math.imul(xe,ye)|0,w=w+Math.imul(xe,ke)|0,w=w+Math.imul(_e,ye)|0,M=M+Math.imul(_e,ke)|0,A=A+Math.imul(G,Ne)|0,w=w+Math.imul(G,Ge)|0,w=w+Math.imul(fe,Ne)|0,M=M+Math.imul(fe,Ge)|0,A=A+Math.imul(ee,ze)|0,w=w+Math.imul(ee,Je)|0,w=w+Math.imul(ae,ze)|0,M=M+Math.imul(ae,Je)|0;var br=(P+A|0)+((w&8191)<<13)|0;P=(M+(w>>>13)|0)+(br>>>26)|0,br&=67108863,A=Math.imul(U,He),w=Math.imul(U,Ke),w=w+Math.imul(I,He)|0,M=Math.imul(I,Ke),A=A+Math.imul(we,We)|0,w=w+Math.imul(we,Ye)|0,w=w+Math.imul(Se,We)|0,M=M+Math.imul(Se,Ye)|0,A=A+Math.imul(oe,W)|0,w=w+Math.imul(oe,T)|0,w=w+Math.imul(ce,W)|0,M=M+Math.imul(ce,T)|0,A=A+Math.imul(Be,re)|0,w=w+Math.imul(Be,ue)|0,w=w+Math.imul(Me,re)|0,M=M+Math.imul(Me,ue)|0,A=A+Math.imul(Re,ye)|0,w=w+Math.imul(Re,ke)|0,w=w+Math.imul(be,ye)|0,M=M+Math.imul(be,ke)|0,A=A+Math.imul(xe,Ne)|0,w=w+Math.imul(xe,Ge)|0,w=w+Math.imul(_e,Ne)|0,M=M+Math.imul(_e,Ge)|0,A=A+Math.imul(G,ze)|0,w=w+Math.imul(G,Je)|0,w=w+Math.imul(fe,ze)|0,M=M+Math.imul(fe,Je)|0;var yr=(P+A|0)+((w&8191)<<13)|0;P=(M+(w>>>13)|0)+(yr>>>26)|0,yr&=67108863,A=Math.imul(U,We),w=Math.imul(U,Ye),w=w+Math.imul(I,We)|0,M=Math.imul(I,Ye),A=A+Math.imul(we,W)|0,w=w+Math.imul(we,T)|0,w=w+Math.imul(Se,W)|0,M=M+Math.imul(Se,T)|0,A=A+Math.imul(oe,re)|0,w=w+Math.imul(oe,ue)|0,w=w+Math.imul(ce,re)|0,M=M+Math.imul(ce,ue)|0,A=A+Math.imul(Be,ye)|0,w=w+Math.imul(Be,ke)|0,w=w+Math.imul(Me,ye)|0,M=M+Math.imul(Me,ke)|0,A=A+Math.imul(Re,Ne)|0,w=w+Math.imul(Re,Ge)|0,w=w+Math.imul(be,Ne)|0,M=M+Math.imul(be,Ge)|0,A=A+Math.imul(xe,ze)|0,w=w+Math.imul(xe,Je)|0,w=w+Math.imul(_e,ze)|0,M=M+Math.imul(_e,Je)|0;var gr=(P+A|0)+((w&8191)<<13)|0;P=(M+(w>>>13)|0)+(gr>>>26)|0,gr&=67108863,A=Math.imul(U,W),w=Math.imul(U,T),w=w+Math.imul(I,W)|0,M=Math.imul(I,T),A=A+Math.imul(we,re)|0,w=w+Math.imul(we,ue)|0,w=w+Math.imul(Se,re)|0,M=M+Math.imul(Se,ue)|0,A=A+Math.imul(oe,ye)|0,w=w+Math.imul(oe,ke)|0,w=w+Math.imul(ce,ye)|0,M=M+Math.imul(ce,ke)|0,A=A+Math.imul(Be,Ne)|0,w=w+Math.imul(Be,Ge)|0,w=w+Math.imul(Me,Ne)|0,M=M+Math.imul(Me,Ge)|0,A=A+Math.imul(Re,ze)|0,w=w+Math.imul(Re,Je)|0,w=w+Math.imul(be,ze)|0,M=M+Math.imul(be,Je)|0;var wr=(P+A|0)+((w&8191)<<13)|0;P=(M+(w>>>13)|0)+(wr>>>26)|0,wr&=67108863,A=Math.imul(U,re),w=Math.imul(U,ue),w=w+Math.imul(I,re)|0,M=Math.imul(I,ue),A=A+Math.imul(we,ye)|0,w=w+Math.imul(we,ke)|0,w=w+Math.imul(Se,ye)|0,M=M+Math.imul(Se,ke)|0,A=A+Math.imul(oe,Ne)|0,w=w+Math.imul(oe,Ge)|0,w=w+Math.imul(ce,Ne)|0,M=M+Math.imul(ce,Ge)|0,A=A+Math.imul(Be,ze)|0,w=w+Math.imul(Be,Je)|0,w=w+Math.imul(Me,ze)|0,M=M+Math.imul(Me,Je)|0;var rr=(P+A|0)+((w&8191)<<13)|0;P=(M+(w>>>13)|0)+(rr>>>26)|0,rr&=67108863,A=Math.imul(U,ye),w=Math.imul(U,ke),w=w+Math.imul(I,ye)|0,M=Math.imul(I,ke),A=A+Math.imul(we,Ne)|0,w=w+Math.imul(we,Ge)|0,w=w+Math.imul(Se,Ne)|0,M=M+Math.imul(Se,Ge)|0,A=A+Math.imul(oe,ze)|0,w=w+Math.imul(oe,Je)|0,w=w+Math.imul(ce,ze)|0,M=M+Math.imul(ce,Je)|0;var _r=(P+A|0)+((w&8191)<<13)|0;P=(M+(w>>>13)|0)+(_r>>>26)|0,_r&=67108863,A=Math.imul(U,Ne),w=Math.imul(U,Ge),w=w+Math.imul(I,Ne)|0,M=Math.imul(I,Ge),A=A+Math.imul(we,ze)|0,w=w+Math.imul(we,Je)|0,w=w+Math.imul(Se,ze)|0,M=M+Math.imul(Se,Je)|0;var xr=(P+A|0)+((w&8191)<<13)|0;P=(M+(w>>>13)|0)+(xr>>>26)|0,xr&=67108863,A=Math.imul(U,ze),w=Math.imul(U,Je),w=w+Math.imul(I,ze)|0,M=Math.imul(I,Je);var Sr=(P+A|0)+((w&8191)<<13)|0;return P=(M+(w>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,B[0]=Qe,B[1]=er,B[2]=fr,B[3]=ur,B[4]=cr,B[5]=nr,B[6]=hr,B[7]=lr,B[8]=dr,B[9]=pr,B[10]=vr,B[11]=br,B[12]=yr,B[13]=gr,B[14]=wr,B[15]=rr,B[16]=_r,B[17]=xr,B[18]=Sr,P!==0&&(B[19]=P,p.length++),p};Math.imul||(m=b);function q(Z,y,g){g.negative=y.negative^Z.negative,g.length=Z.length+y.length;for(var p=0,_=0,R=0;R<g.length-1;R++){var B=_;_=0;for(var P=p&67108863,A=Math.min(R,y.length-1),w=Math.max(0,R-Z.length+1);w<=A;w++){var M=R-w,x=Z.words[M]|0,L=y.words[w]|0,K=x*L,Q=K&67108863;B=B+(K/67108864|0)|0,Q=Q+P|0,P=Q&67108863,B=B+(Q>>>26)|0,_+=B>>>26,B&=67108863}g.words[R]=P,p=B,B=_}return p!==0?g.words[R]=p:g.length--,g.strip()}function E(Z,y,g){var p=new S;return p.mulp(Z,y,g)}r.prototype.mulTo=function(y,g){var p,_=this.length+y.length;return this.length===10&&y.length===10?p=m(this,y,g):_<63?p=b(this,y,g):_<1024?p=q(this,y,g):p=E(this,y,g),p};function S(Z,y){this.x=Z,this.y=y}S.prototype.makeRBT=function(y){for(var g=new Array(y),p=r.prototype._countBits(y)-1,_=0;_<y;_++)g[_]=this.revBin(_,p,y);return g},S.prototype.revBin=function(y,g,p){if(y===0||y===p-1)return y;for(var _=0,R=0;R<g;R++)_|=(y&1)<<g-R-1,y>>=1;return _},S.prototype.permute=function(y,g,p,_,R,B){for(var P=0;P<B;P++)_[P]=g[y[P]],R[P]=p[y[P]]},S.prototype.transform=function(y,g,p,_,R,B){this.permute(B,y,g,p,_,R);for(var P=1;P<R;P<<=1)for(var A=P<<1,w=Math.cos(2*Math.PI/A),M=Math.sin(2*Math.PI/A),x=0;x<R;x+=A)for(var L=w,K=M,Q=0;Q<P;Q++){var H=p[x+Q],N=_[x+Q],F=p[x+Q+P],ee=_[x+Q+P],ae=L*F-K*ee;ee=L*ee+K*F,F=ae,p[x+Q]=H+F,_[x+Q]=N+ee,p[x+Q+P]=H-F,_[x+Q+P]=N-ee,Q!==A&&(ae=w*L-M*K,K=w*K+M*L,L=ae)}},S.prototype.guessLen13b=function(y,g){var p=Math.max(g,y)|1,_=p&1,R=0;for(p=p/2|0;p;p=p>>>1)R++;return 1<<R+1+_},S.prototype.conjugate=function(y,g,p){if(!(p<=1))for(var _=0;_<p/2;_++){var R=y[_];y[_]=y[p-_-1],y[p-_-1]=R,R=g[_],g[_]=-g[p-_-1],g[p-_-1]=-R}},S.prototype.normalize13b=function(y,g){for(var p=0,_=0;_<g/2;_++){var R=Math.round(y[2*_+1]/g)*8192+Math.round(y[2*_]/g)+p;y[_]=R&67108863,R<67108864?p=0:p=R/67108864|0}return y},S.prototype.convert13b=function(y,g,p,_){for(var R=0,B=0;B<g;B++)R=R+(y[B]|0),p[2*B]=R&8191,R=R>>>13,p[2*B+1]=R&8191,R=R>>>13;for(B=2*g;B<_;++B)p[B]=0;o(R===0),o((R&-8192)===0)},S.prototype.stub=function(y){for(var g=new Array(y),p=0;p<y;p++)g[p]=0;return g},S.prototype.mulp=function(y,g,p){var _=2*this.guessLen13b(y.length,g.length),R=this.makeRBT(_),B=this.stub(_),P=new Array(_),A=new Array(_),w=new Array(_),M=new Array(_),x=new Array(_),L=new Array(_),K=p.words;K.length=_,this.convert13b(y.words,y.length,P,_),this.convert13b(g.words,g.length,M,_),this.transform(P,B,A,w,_,R),this.transform(M,B,x,L,_,R);for(var Q=0;Q<_;Q++){var H=A[Q]*x[Q]-w[Q]*L[Q];w[Q]=A[Q]*L[Q]+w[Q]*x[Q],A[Q]=H}return this.conjugate(A,w,_),this.transform(A,w,K,B,_,R),this.conjugate(K,B,_),this.normalize13b(K,_),p.negative=y.negative^g.negative,p.length=y.length+g.length,p.strip()},r.prototype.mul=function(y){var g=new r(null);return g.words=new Array(this.length+y.length),this.mulTo(y,g)},r.prototype.mulf=function(y){var g=new r(null);return g.words=new Array(this.length+y.length),E(this,y,g)},r.prototype.imul=function(y){return this.clone().mulTo(y,this)},r.prototype.imuln=function(y){o(typeof y=="number"),o(y<67108864);for(var g=0,p=0;p<this.length;p++){var _=(this.words[p]|0)*y,R=(_&67108863)+(g&67108863);g>>=26,g+=_/67108864|0,g+=R>>>26,this.words[p]=R&67108863}return g!==0&&(this.words[p]=g,this.length++),this.length=y===0?1:this.length,this},r.prototype.muln=function(y){return this.clone().imuln(y)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(y){var g=v(y);if(g.length===0)return new r(1);for(var p=this,_=0;_<g.length&&g[_]===0;_++,p=p.sqr());if(++_<g.length)for(var R=p.sqr();_<g.length;_++,R=R.sqr())g[_]!==0&&(p=p.mul(R));return p},r.prototype.iushln=function(y){o(typeof y=="number"&&y>=0);var g=y%26,p=(y-g)/26,_=67108863>>>26-g<<26-g,R;if(g!==0){var B=0;for(R=0;R<this.length;R++){var P=this.words[R]&_,A=(this.words[R]|0)-P<<g;this.words[R]=A|B,B=P>>>26-g}B&&(this.words[R]=B,this.length++)}if(p!==0){for(R=this.length-1;R>=0;R--)this.words[R+p]=this.words[R];for(R=0;R<p;R++)this.words[R]=0;this.length+=p}return this.strip()},r.prototype.ishln=function(y){return o(this.negative===0),this.iushln(y)},r.prototype.iushrn=function(y,g,p){o(typeof y=="number"&&y>=0);var _;g?_=(g-g%26)/26:_=0;var R=y%26,B=Math.min((y-R)/26,this.length),P=67108863^67108863>>>R<<R,A=p;if(_-=B,_=Math.max(0,_),A){for(var w=0;w<B;w++)A.words[w]=this.words[w];A.length=B}if(B!==0)if(this.length>B)for(this.length-=B,w=0;w<this.length;w++)this.words[w]=this.words[w+B];else this.words[0]=0,this.length=1;var M=0;for(w=this.length-1;w>=0&&(M!==0||w>=_);w--){var x=this.words[w]|0;this.words[w]=M<<26-R|x>>>R,M=x&P}return A&&M!==0&&(A.words[A.length++]=M),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.ishrn=function(y,g,p){return o(this.negative===0),this.iushrn(y,g,p)},r.prototype.shln=function(y){return this.clone().ishln(y)},r.prototype.ushln=function(y){return this.clone().iushln(y)},r.prototype.shrn=function(y){return this.clone().ishrn(y)},r.prototype.ushrn=function(y){return this.clone().iushrn(y)},r.prototype.testn=function(y){o(typeof y=="number"&&y>=0);var g=y%26,p=(y-g)/26,_=1<<g;if(this.length<=p)return!1;var R=this.words[p];return!!(R&_)},r.prototype.imaskn=function(y){o(typeof y=="number"&&y>=0);var g=y%26,p=(y-g)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(g!==0&&p++,this.length=Math.min(p,this.length),g!==0){var _=67108863^67108863>>>g<<g;this.words[this.length-1]&=_}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.maskn=function(y){return this.clone().imaskn(y)},r.prototype.iaddn=function(y){return o(typeof y=="number"),o(y<67108864),y<0?this.isubn(-y):this.negative!==0?this.length===1&&(this.words[0]|0)<y?(this.words[0]=y-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(y),this.negative=1,this):this._iaddn(y)},r.prototype._iaddn=function(y){this.words[0]+=y;for(var g=0;g<this.length&&this.words[g]>=67108864;g++)this.words[g]-=67108864,g===this.length-1?this.words[g+1]=1:this.words[g+1]++;return this.length=Math.max(this.length,g+1),this},r.prototype.isubn=function(y){if(o(typeof y=="number"),o(y<67108864),y<0)return this.iaddn(-y);if(this.negative!==0)return this.negative=0,this.iaddn(y),this.negative=1,this;if(this.words[0]-=y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var g=0;g<this.length&&this.words[g]<0;g++)this.words[g]+=67108864,this.words[g+1]-=1;return this.strip()},r.prototype.addn=function(y){return this.clone().iaddn(y)},r.prototype.subn=function(y){return this.clone().isubn(y)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(y,g,p){var _=y.length+p,R;this._expand(_);var B,P=0;for(R=0;R<y.length;R++){B=(this.words[R+p]|0)+P;var A=(y.words[R]|0)*g;B-=A&67108863,P=(B>>26)-(A/67108864|0),this.words[R+p]=B&67108863}for(;R<this.length-p;R++)B=(this.words[R+p]|0)+P,P=B>>26,this.words[R+p]=B&67108863;if(P===0)return this.strip();for(o(P===-1),P=0,R=0;R<this.length;R++)B=-(this.words[R]|0)+P,P=B>>26,this.words[R]=B&67108863;return this.negative=1,this.strip()},r.prototype._wordDiv=function(y,g){var p=this.length-y.length,_=this.clone(),R=y,B=R.words[R.length-1]|0,P=this._countBits(B);p=26-P,p!==0&&(R=R.ushln(p),_.iushln(p),B=R.words[R.length-1]|0);var A=_.length-R.length,w;if(g!=="mod"){w=new r(null),w.length=A+1,w.words=new Array(w.length);for(var M=0;M<w.length;M++)w.words[M]=0}var x=_.clone()._ishlnsubmul(R,1,A);x.negative===0&&(_=x,w&&(w.words[A]=1));for(var L=A-1;L>=0;L--){var K=(_.words[R.length+L]|0)*67108864+(_.words[R.length+L-1]|0);for(K=Math.min(K/B|0,67108863),_._ishlnsubmul(R,K,L);_.negative!==0;)K--,_.negative=0,_._ishlnsubmul(R,1,L),_.isZero()||(_.negative^=1);w&&(w.words[L]=K)}return w&&w.strip(),_.strip(),g!=="div"&&p!==0&&_.iushrn(p),{div:w||null,mod:_}},r.prototype.divmod=function(y,g,p){if(o(!y.isZero()),this.isZero())return{div:new r(0),mod:new r(0)};var _,R,B;return this.negative!==0&&y.negative===0?(B=this.neg().divmod(y,g),g!=="mod"&&(_=B.div.neg()),g!=="div"&&(R=B.mod.neg(),p&&R.negative!==0&&R.iadd(y)),{div:_,mod:R}):this.negative===0&&y.negative!==0?(B=this.divmod(y.neg(),g),g!=="mod"&&(_=B.div.neg()),{div:_,mod:B.mod}):(this.negative&y.negative)!==0?(B=this.neg().divmod(y.neg(),g),g!=="div"&&(R=B.mod.neg(),p&&R.negative!==0&&R.isub(y)),{div:B.div,mod:R}):y.length>this.length||this.cmp(y)<0?{div:new r(0),mod:this}:y.length===1?g==="div"?{div:this.divn(y.words[0]),mod:null}:g==="mod"?{div:null,mod:new r(this.modn(y.words[0]))}:{div:this.divn(y.words[0]),mod:new r(this.modn(y.words[0]))}:this._wordDiv(y,g)},r.prototype.div=function(y){return this.divmod(y,"div",!1).div},r.prototype.mod=function(y){return this.divmod(y,"mod",!1).mod},r.prototype.umod=function(y){return this.divmod(y,"mod",!0).mod},r.prototype.divRound=function(y){var g=this.divmod(y);if(g.mod.isZero())return g.div;var p=g.div.negative!==0?g.mod.isub(y):g.mod,_=y.ushrn(1),R=y.andln(1),B=p.cmp(_);return B<0||R===1&&B===0?g.div:g.div.negative!==0?g.div.isubn(1):g.div.iaddn(1)},r.prototype.modn=function(y){o(y<=67108863);for(var g=(1<<26)%y,p=0,_=this.length-1;_>=0;_--)p=(g*p+(this.words[_]|0))%y;return p},r.prototype.idivn=function(y){o(y<=67108863);for(var g=0,p=this.length-1;p>=0;p--){var _=(this.words[p]|0)+g*67108864;this.words[p]=_/y|0,g=_%y}return this.strip()},r.prototype.divn=function(y){return this.clone().idivn(y)},r.prototype.egcd=function(y){o(y.negative===0),o(!y.isZero());var g=this,p=y.clone();g.negative!==0?g=g.umod(y):g=g.clone();for(var _=new r(1),R=new r(0),B=new r(0),P=new r(1),A=0;g.isEven()&&p.isEven();)g.iushrn(1),p.iushrn(1),++A;for(var w=p.clone(),M=g.clone();!g.isZero();){for(var x=0,L=1;(g.words[0]&L)===0&&x<26;++x,L<<=1);if(x>0)for(g.iushrn(x);x-- >0;)(_.isOdd()||R.isOdd())&&(_.iadd(w),R.isub(M)),_.iushrn(1),R.iushrn(1);for(var K=0,Q=1;(p.words[0]&Q)===0&&K<26;++K,Q<<=1);if(K>0)for(p.iushrn(K);K-- >0;)(B.isOdd()||P.isOdd())&&(B.iadd(w),P.isub(M)),B.iushrn(1),P.iushrn(1);g.cmp(p)>=0?(g.isub(p),_.isub(B),R.isub(P)):(p.isub(g),B.isub(_),P.isub(R))}return{a:B,b:P,gcd:p.iushln(A)}},r.prototype._invmp=function(y){o(y.negative===0),o(!y.isZero());var g=this,p=y.clone();g.negative!==0?g=g.umod(y):g=g.clone();for(var _=new r(1),R=new r(0),B=p.clone();g.cmpn(1)>0&&p.cmpn(1)>0;){for(var P=0,A=1;(g.words[0]&A)===0&&P<26;++P,A<<=1);if(P>0)for(g.iushrn(P);P-- >0;)_.isOdd()&&_.iadd(B),_.iushrn(1);for(var w=0,M=1;(p.words[0]&M)===0&&w<26;++w,M<<=1);if(w>0)for(p.iushrn(w);w-- >0;)R.isOdd()&&R.iadd(B),R.iushrn(1);g.cmp(p)>=0?(g.isub(p),_.isub(R)):(p.isub(g),R.isub(_))}var x;return g.cmpn(1)===0?x=_:x=R,x.cmpn(0)<0&&x.iadd(y),x},r.prototype.gcd=function(y){if(this.isZero())return y.abs();if(y.isZero())return this.abs();var g=this.clone(),p=y.clone();g.negative=0,p.negative=0;for(var _=0;g.isEven()&&p.isEven();_++)g.iushrn(1),p.iushrn(1);do{for(;g.isEven();)g.iushrn(1);for(;p.isEven();)p.iushrn(1);var R=g.cmp(p);if(R<0){var B=g;g=p,p=B}else if(R===0||p.cmpn(1)===0)break;g.isub(p)}while(!0);return p.iushln(_)},r.prototype.invm=function(y){return this.egcd(y).a.umod(y)},r.prototype.isEven=function(){return(this.words[0]&1)===0},r.prototype.isOdd=function(){return(this.words[0]&1)===1},r.prototype.andln=function(y){return this.words[0]&y},r.prototype.bincn=function(y){o(typeof y=="number");var g=y%26,p=(y-g)/26,_=1<<g;if(this.length<=p)return this._expand(p+1),this.words[p]|=_,this;for(var R=_,B=p;R!==0&&B<this.length;B++){var P=this.words[B]|0;P+=R,R=P>>>26,P&=67108863,this.words[B]=P}return R!==0&&(this.words[B]=R,this.length++),this},r.prototype.isZero=function(){return this.length===1&&this.words[0]===0},r.prototype.cmpn=function(y){var g=y<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;this.strip();var p;if(this.length>1)p=1;else{g&&(y=-y),o(y<=67108863,"Number is too big");var _=this.words[0]|0;p=_===y?0:_<y?-1:1}return this.negative!==0?-p|0:p},r.prototype.cmp=function(y){if(this.negative!==0&&y.negative===0)return-1;if(this.negative===0&&y.negative!==0)return 1;var g=this.ucmp(y);return this.negative!==0?-g|0:g},r.prototype.ucmp=function(y){if(this.length>y.length)return 1;if(this.length<y.length)return-1;for(var g=0,p=this.length-1;p>=0;p--){var _=this.words[p]|0,R=y.words[p]|0;if(_!==R){_<R?g=-1:_>R&&(g=1);break}}return g},r.prototype.gtn=function(y){return this.cmpn(y)===1},r.prototype.gt=function(y){return this.cmp(y)===1},r.prototype.gten=function(y){return this.cmpn(y)>=0},r.prototype.gte=function(y){return this.cmp(y)>=0},r.prototype.ltn=function(y){return this.cmpn(y)===-1},r.prototype.lt=function(y){return this.cmp(y)===-1},r.prototype.lten=function(y){return this.cmpn(y)<=0},r.prototype.lte=function(y){return this.cmp(y)<=0},r.prototype.eqn=function(y){return this.cmpn(y)===0},r.prototype.eq=function(y){return this.cmp(y)===0},r.red=function(y){return new ne(y)},r.prototype.toRed=function(y){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),y.convertTo(this)._forceRed(y)},r.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype._forceRed=function(y){return this.red=y,this},r.prototype.forceRed=function(y){return o(!this.red,"Already a number in reduction context"),this._forceRed(y)},r.prototype.redAdd=function(y){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,y)},r.prototype.redIAdd=function(y){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,y)},r.prototype.redSub=function(y){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,y)},r.prototype.redISub=function(y){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,y)},r.prototype.redShl=function(y){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,y)},r.prototype.redMul=function(y){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.mul(this,y)},r.prototype.redIMul=function(y){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.imul(this,y)},r.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(y){return o(this.red&&!y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,y)};var O={k256:null,p224:null,p192:null,p25519:null};function D(Z,y){this.name=Z,this.p=new r(y,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var y=new r(null);return y.words=new Array(Math.ceil(this.n/13)),y},D.prototype.ireduce=function(y){var g=y,p;do this.split(g,this.tmp),g=this.imulK(g),g=g.iadd(this.tmp),p=g.bitLength();while(p>this.n);var _=p<this.n?-1:g.ucmp(this.p);return _===0?(g.words[0]=0,g.length=1):_>0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},D.prototype.split=function(y,g){y.iushrn(this.n,0,g)},D.prototype.imulK=function(y){return y.imul(this.k)};function j(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}d(j,D),j.prototype.split=function(y,g){for(var p=4194303,_=Math.min(y.length,9),R=0;R<_;R++)g.words[R]=y.words[R];if(g.length=_,y.length<=9){y.words[0]=0,y.length=1;return}var B=y.words[9];for(g.words[g.length++]=B&p,R=10;R<y.length;R++){var P=y.words[R]|0;y.words[R-10]=(P&p)<<4|B>>>22,B=P}B>>>=22,y.words[R-10]=B,B===0&&y.length>10?y.length-=10:y.length-=9},j.prototype.imulK=function(y){y.words[y.length]=0,y.words[y.length+1]=0,y.length+=2;for(var g=0,p=0;p<y.length;p++){var _=y.words[p]|0;g+=_*977,y.words[p]=g&67108863,g=_*64+(g/67108864|0)}return y.words[y.length-1]===0&&(y.length--,y.words[y.length-1]===0&&y.length--),y};function $(){D.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}d($,D);function J(){D.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}d(J,D);function ie(){D.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}d(ie,D),ie.prototype.imulK=function(y){for(var g=0,p=0;p<y.length;p++){var _=(y.words[p]|0)*19+g,R=_&67108863;_>>>=26,y.words[p]=R,g=_}return g!==0&&(y.words[y.length++]=g),y},r._prime=function(y){if(O[y])return O[y];var g;if(y==="k256")g=new j;else if(y==="p224")g=new $;else if(y==="p192")g=new J;else if(y==="p25519")g=new ie;else throw new Error("Unknown prime "+y);return O[y]=g,g};function ne(Z){if(typeof Z=="string"){var y=r._prime(Z);this.m=y.p,this.prime=y}else o(Z.gtn(1),"modulus must be greater than 1"),this.m=Z,this.prime=null}ne.prototype._verify1=function(y){o(y.negative===0,"red works only with positives"),o(y.red,"red works only with red numbers")},ne.prototype._verify2=function(y,g){o((y.negative|g.negative)===0,"red works only with positives"),o(y.red&&y.red===g.red,"red works only with red numbers")},ne.prototype.imod=function(y){return this.prime?this.prime.ireduce(y)._forceRed(this):y.umod(this.m)._forceRed(this)},ne.prototype.neg=function(y){return y.isZero()?y.clone():this.m.sub(y)._forceRed(this)},ne.prototype.add=function(y,g){this._verify2(y,g);var p=y.add(g);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},ne.prototype.iadd=function(y,g){this._verify2(y,g);var p=y.iadd(g);return p.cmp(this.m)>=0&&p.isub(this.m),p},ne.prototype.sub=function(y,g){this._verify2(y,g);var p=y.sub(g);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},ne.prototype.isub=function(y,g){this._verify2(y,g);var p=y.isub(g);return p.cmpn(0)<0&&p.iadd(this.m),p},ne.prototype.shl=function(y,g){return this._verify1(y),this.imod(y.ushln(g))},ne.prototype.imul=function(y,g){return this._verify2(y,g),this.imod(y.imul(g))},ne.prototype.mul=function(y,g){return this._verify2(y,g),this.imod(y.mul(g))},ne.prototype.isqr=function(y){return this.imul(y,y.clone())},ne.prototype.sqr=function(y){return this.mul(y,y)},ne.prototype.sqrt=function(y){if(y.isZero())return y.clone();var g=this.m.andln(3);if(o(g%2===1),g===3){var p=this.m.add(new r(1)).iushrn(2);return this.pow(y,p)}for(var _=this.m.subn(1),R=0;!_.isZero()&&_.andln(1)===0;)R++,_.iushrn(1);o(!_.isZero());var B=new r(1).toRed(this),P=B.redNeg(),A=this.m.subn(1).iushrn(1),w=this.m.bitLength();for(w=new r(2*w*w).toRed(this);this.pow(w,A).cmp(P)!==0;)w.redIAdd(P);for(var M=this.pow(w,_),x=this.pow(y,_.addn(1).iushrn(1)),L=this.pow(y,_),K=R;L.cmp(B)!==0;){for(var Q=L,H=0;Q.cmp(B)!==0;H++)Q=Q.redSqr();o(H<K);var N=this.pow(M,new r(1).iushln(K-H-1));x=x.redMul(N),M=N.redSqr(),L=L.redMul(M),K=H}return x},ne.prototype.invm=function(y){var g=y._invmp(this.m);return g.negative!==0?(g.negative=0,this.imod(g).redNeg()):this.imod(g)},ne.prototype.pow=function(y,g){if(g.isZero())return new r(1).toRed(this);if(g.cmpn(1)===0)return y.clone();var p=4,_=new Array(1<<p);_[0]=new r(1).toRed(this),_[1]=y;for(var R=2;R<_.length;R++)_[R]=this.mul(_[R-1],y);var B=_[0],P=0,A=0,w=g.bitLength()%26;for(w===0&&(w=26),R=g.length-1;R>=0;R--){for(var M=g.words[R],x=w-1;x>=0;x--){var L=M>>x&1;if(B!==_[0]&&(B=this.sqr(B)),L===0&&P===0){A=0;continue}P<<=1,P|=L,A++,!(A!==p&&(R!==0||x!==0))&&(B=this.mul(B,_[P]),A=0,P=0)}w=26}return B},ne.prototype.convertTo=function(y){var g=y.umod(this.m);return g===y?g.clone():g},ne.prototype.convertFrom=function(y){var g=y.clone();return g.red=null,g},r.mont=function(y){return new de(y)};function de(Z){ne.call(this,Z),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new r(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)}d(de,ne),de.prototype.convertTo=function(y){return this.imod(y.ushln(this.shift))},de.prototype.convertFrom=function(y){var g=this.imod(y.mul(this.rinv));return g.red=null,g},de.prototype.imul=function(y,g){if(y.isZero()||g.isZero())return y.words[0]=0,y.length=1,y;var p=y.imul(g),_=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=p.isub(_).iushrn(this.shift),B=R;return R.cmp(this.m)>=0?B=R.isub(this.m):R.cmpn(0)<0&&(B=R.iadd(this.m)),B._forceRed(this)},de.prototype.mul=function(y,g){if(y.isZero()||g.isZero())return new r(0)._forceRed(this);var p=y.mul(g),_=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=p.isub(_).iushrn(this.shift),B=R;return R.cmp(this.m)>=0?B=R.isub(this.m):R.cmpn(0)<0&&(B=R.iadd(this.m)),B._forceRed(this)},de.prototype.invm=function(y){var g=this.imod(y._invmp(this.m).mul(this.r2));return g._forceRed(this)}})(c,bn$2)})(bn$3)),bn$3.exports}var brorand={exports:{}},hasRequiredBrorand;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;hasRequiredBrorand=1;var c;brorand.exports=function(d){return c||(c=new t(null)),c.generate(d)};function t(o){this.rand=o}if(brorand.exports.Rand=t,t.prototype.generate=function(d){return this._rand(d)},t.prototype._rand=function(d){if(this.rand.getBytes)return this.rand.getBytes(d);for(var r=new Uint8Array(d),h=0;h<r.length;h++)r[h]=this.rand.getByte();return r},typeof self=="object")self.crypto&&self.crypto.getRandomValues?t.prototype._rand=function(d){var r=new Uint8Array(d);return self.crypto.getRandomValues(r),r}:self.msCrypto&&self.msCrypto.getRandomValues?t.prototype._rand=function(d){var r=new Uint8Array(d);return self.msCrypto.getRandomValues(r),r}:typeof window=="object"&&(t.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var u=requireCryptoBrowserify();if(typeof u.randomBytes!="function")throw new Error("Not supported");t.prototype._rand=function(d){return u.randomBytes(d)}}catch{}return brorand.exports}var mr,hasRequiredMr;function requireMr(){if(hasRequiredMr)return mr;hasRequiredMr=1;var c=requireBn$1(),t=requireBrorand();function u(o){this.rand=o||new t.Rand}return mr=u,u.create=function(d){return new u(d)},u.prototype._randbelow=function(d){var r=d.bitLength(),h=Math.ceil(r/8);do var f=new c(this.rand.generate(h));while(f.cmp(d)>=0);return f},u.prototype._randrange=function(d,r){var h=r.sub(d);return d.add(this._randbelow(h))},u.prototype.test=function(d,r,h){var f=d.bitLength(),a=c.mont(d),n=new c(1).toRed(a);r||(r=Math.max(1,f/48|0));for(var e=d.subn(1),s=0;!e.testn(s);s++);for(var l=d.shrn(s),v=e.toRed(a),b=!0;r>0;r--){var m=this._randrange(new c(2),e);h&&h(m);var q=m.toRed(a).redPow(l);if(!(q.cmp(n)===0||q.cmp(v)===0)){for(var E=1;E<s;E++){if(q=q.redSqr(),q.cmp(n)===0)return!1;if(q.cmp(v)===0)break}if(E===s)return!1}}return b},u.prototype.getDivisor=function(d,r){var h=d.bitLength(),f=c.mont(d),a=new c(1).toRed(f);r||(r=Math.max(1,h/48|0));for(var n=d.subn(1),e=0;!n.testn(e);e++);for(var s=d.shrn(e),l=n.toRed(f);r>0;r--){var v=this._randrange(new c(2),n),b=d.gcd(v);if(b.cmpn(1)!==0)return b;var m=v.toRed(f).redPow(s);if(!(m.cmp(a)===0||m.cmp(l)===0)){for(var q=1;q<e;q++){if(m=m.redSqr(),m.cmp(a)===0)return m.fromRed().subn(1).gcd(d);if(m.cmp(l)===0)break}if(q===e)return m=m.redSqr(),m.fromRed().subn(1).gcd(d)}}return!1},mr}var generatePrime,hasRequiredGeneratePrime;function requireGeneratePrime(){if(hasRequiredGeneratePrime)return generatePrime;hasRequiredGeneratePrime=1;var c=requireBrowser$b();generatePrime=q,q.simpleSieve=b,q.fermatTest=m;var t=requireBn$1(),u=new t(24),o=requireMr(),d=new o,r=new t(1),h=new t(2),f=new t(5);new t(16),new t(8);var a=new t(10),n=new t(3);new t(7);var e=new t(11),s=new t(4);new t(12);var l=null;function v(){if(l!==null)return l;var E=1048576,S=[];S[0]=2;for(var O=1,D=3;D<E;D+=2){for(var j=Math.ceil(Math.sqrt(D)),$=0;$<O&&S[$]<=j&&D%S[$]!==0;$++);O!==$&&S[$]<=j||(S[O++]=D)}return l=S,S}function b(E){for(var S=v(),O=0;O<S.length;O++)if(E.modn(S[O])===0)return E.cmpn(S[O])===0;return!0}function m(E){var S=t.mont(E);return h.toRed(S).redPow(E.subn(1)).fromRed().cmpn(1)===0}function q(E,S){if(E<16)return S===2||S===5?new t([140,123]):new t([140,39]);S=new t(S);for(var O,D;;){for(O=new t(c(Math.ceil(E/8)));O.bitLength()>E;)O.ishrn(1);if(O.isEven()&&O.iadd(r),O.testn(1)||O.iadd(h),S.cmp(h)){if(!S.cmp(f))for(;O.mod(a).cmp(n);)O.iadd(s)}else for(;O.mod(u).cmp(e);)O.iadd(s);if(D=O.shrn(1),b(D)&&b(O)&&m(D)&&m(O)&&d.test(D)&&d.test(O))return O}}return generatePrime}const 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"},require$$1$1={modp1,modp2,modp5,modp14,modp15,modp16,modp17,modp18};var dh,hasRequiredDh;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var c=requireBn$1(),t=requireMr(),u=new t,o=new c(24),d=new c(11),r=new c(10),h=new c(3),f=new c(7),a=requireGeneratePrime(),n=requireBrowser$b();dh=b;function e(q,E){return E=E||"utf8",Buffer.isBuffer(q)||(q=new Buffer(q,E)),this._pub=new c(q),this}function s(q,E){return E=E||"utf8",Buffer.isBuffer(q)||(q=new Buffer(q,E)),this._priv=new c(q),this}var l={};function v(q,E){var S=E.toString("hex"),O=[S,q.toString(16)].join("_");if(O in l)return l[O];var D=0;if(q.isEven()||!a.simpleSieve||!a.fermatTest(q)||!u.test(q))return D+=1,S==="02"||S==="05"?D+=8:D+=4,l[O]=D,D;u.test(q.shrn(1))||(D+=2);var j;switch(S){case"02":q.mod(o).cmp(d)&&(D+=8);break;case"05":j=q.mod(r),j.cmp(h)&&j.cmp(f)&&(D+=8);break;default:D+=4}return l[O]=D,D}function b(q,E,S){this.setGenerator(E),this.__prime=new c(q),this._prime=c.mont(this.__prime),this._primeLen=q.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,S?(this.setPublicKey=e,this.setPrivateKey=s):this._primeCode=8}Object.defineProperty(b.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=v(this.__prime,this.__gen)),this._primeCode}}),b.prototype.generateKeys=function(){return this._priv||(this._priv=new c(n(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},b.prototype.computeSecret=function(q){q=new c(q),q=q.toRed(this._prime);var E=q.redPow(this._priv).fromRed(),S=new Buffer(E.toArray()),O=this.getPrime();if(S.length<O.length){var D=new Buffer(O.length-S.length);D.fill(0),S=Buffer.concat([D,S])}return S},b.prototype.getPublicKey=function(E){return m(this._pub,E)},b.prototype.getPrivateKey=function(E){return m(this._priv,E)},b.prototype.getPrime=function(q){return m(this.__prime,q)},b.prototype.getGenerator=function(q){return m(this._gen,q)},b.prototype.setGenerator=function(q,E){return E=E||"utf8",Buffer.isBuffer(q)||(q=new Buffer(q,E)),this.__gen=q,this._gen=new c(q),this};function m(q,E){var S=new Buffer(q.toArray());return E?S.toString(E):S}return dh}var hasRequiredBrowser$4;function requireBrowser$4(){if(hasRequiredBrowser$4)return browser$4;hasRequiredBrowser$4=1;var c=requireGeneratePrime(),t=require$$1$1,u=requireDh();function o(h){var f=new Buffer(t[h].prime,"hex"),a=new Buffer(t[h].gen,"hex");return new u(f,a)}var d={binary:!0,hex:!0,base64:!0};function r(h,f,a,n){return Buffer.isBuffer(f)||d[f]===void 0?r(h,"binary",f,a):(f=f||"binary",n=n||"binary",a=a||new Buffer([2]),Buffer.isBuffer(a)||(a=new Buffer(a,n)),typeof h=="number"?new u(c(h,a),a,!0):(Buffer.isBuffer(h)||(h=new Buffer(h,f)),new u(h,a,!0)))}return browser$4.DiffieHellmanGroup=browser$4.createDiffieHellmanGroup=browser$4.getDiffieHellman=o,browser$4.createDiffieHellman=browser$4.DiffieHellman=r,browser$4}var sign={exports:{}},bn$1={exports:{}},bn=bn$1.exports,hasRequiredBn;function requireBn(){return hasRequiredBn||(hasRequiredBn=1,(function(c){(function(t,u){function o(g,p){if(!g)throw new Error(p||"Assertion failed")}function d(g,p){g.super_=p;var _=function(){};_.prototype=p.prototype,g.prototype=new _,g.prototype.constructor=g}function r(g,p,_){if(r.isBN(g))return g;this.negative=0,this.words=null,this.length=0,this.red=null,g!==null&&((p==="le"||p==="be")&&(_=p,p=10),this._init(g||0,p||10,_||"be"))}typeof t=="object"?t.exports=r:u.BN=r,r.BN=r,r.wordSize=26;var h;try{typeof window<"u"&&typeof window.Buffer<"u"?h=window.Buffer:h=requireDist().Buffer}catch{}r.isBN=function(p){return p instanceof r?!0:p!==null&&typeof p=="object"&&p.constructor.wordSize===r.wordSize&&Array.isArray(p.words)},r.max=function(p,_){return p.cmp(_)>0?p:_},r.min=function(p,_){return p.cmp(_)<0?p:_},r.prototype._init=function(p,_,R){if(typeof p=="number")return this._initNumber(p,_,R);if(typeof p=="object")return this._initArray(p,_,R);_==="hex"&&(_=16),o(_===(_|0)&&_>=2&&_<=36),p=p.toString().replace(/\s+/g,"");var B=0;p[0]==="-"&&(B++,this.negative=1),B<p.length&&(_===16?this._parseHex(p,B,R):(this._parseBase(p,_,B),R==="le"&&this._initArray(this.toArray(),_,R)))},r.prototype._initNumber=function(p,_,R){p<0&&(this.negative=1,p=-p),p<67108864?(this.words=[p&67108863],this.length=1):p<4503599627370496?(this.words=[p&67108863,p/67108864&67108863],this.length=2):(o(p<9007199254740992),this.words=[p&67108863,p/67108864&67108863,1],this.length=3),R==="le"&&this._initArray(this.toArray(),_,R)},r.prototype._initArray=function(p,_,R){if(o(typeof p.length=="number"),p.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(p.length/3),this.words=new Array(this.length);for(var B=0;B<this.length;B++)this.words[B]=0;var P,A,w=0;if(R==="be")for(B=p.length-1,P=0;B>=0;B-=3)A=p[B]|p[B-1]<<8|p[B-2]<<16,this.words[P]|=A<<w&67108863,this.words[P+1]=A>>>26-w&67108863,w+=24,w>=26&&(w-=26,P++);else if(R==="le")for(B=0,P=0;B<p.length;B+=3)A=p[B]|p[B+1]<<8|p[B+2]<<16,this.words[P]|=A<<w&67108863,this.words[P+1]=A>>>26-w&67108863,w+=24,w>=26&&(w-=26,P++);return this._strip()};function f(g,p){var _=g.charCodeAt(p);if(_>=48&&_<=57)return _-48;if(_>=65&&_<=70)return _-55;if(_>=97&&_<=102)return _-87;o(!1,"Invalid character in "+g)}function a(g,p,_){var R=f(g,_);return _-1>=p&&(R|=f(g,_-1)<<4),R}r.prototype._parseHex=function(p,_,R){this.length=Math.ceil((p.length-_)/6),this.words=new Array(this.length);for(var B=0;B<this.length;B++)this.words[B]=0;var P=0,A=0,w;if(R==="be")for(B=p.length-1;B>=_;B-=2)w=a(p,_,B)<<P,this.words[A]|=w&67108863,P>=18?(P-=18,A+=1,this.words[A]|=w>>>26):P+=8;else{var M=p.length-_;for(B=M%2===0?_+1:_;B<p.length;B+=2)w=a(p,_,B)<<P,this.words[A]|=w&67108863,P>=18?(P-=18,A+=1,this.words[A]|=w>>>26):P+=8}this._strip()};function n(g,p,_,R){for(var B=0,P=0,A=Math.min(g.length,_),w=p;w<A;w++){var M=g.charCodeAt(w)-48;B*=R,M>=49?P=M-49+10:M>=17?P=M-17+10:P=M,o(M>=0&&P<R,"Invalid character"),B+=P}return B}r.prototype._parseBase=function(p,_,R){this.words=[0],this.length=1;for(var B=0,P=1;P<=67108863;P*=_)B++;B--,P=P/_|0;for(var A=p.length-R,w=A%B,M=Math.min(A,A-w)+R,x=0,L=R;L<M;L+=B)x=n(p,L,L+B,_),this.imuln(P),this.words[0]+x<67108864?this.words[0]+=x:this._iaddn(x);if(w!==0){var K=1;for(x=n(p,L,p.length,_),L=0;L<w;L++)K*=_;this.imuln(K),this.words[0]+x<67108864?this.words[0]+=x:this._iaddn(x)}this._strip()},r.prototype.copy=function(p){p.words=new Array(this.length);for(var _=0;_<this.length;_++)p.words[_]=this.words[_];p.length=this.length,p.negative=this.negative,p.red=this.red};function e(g,p){g.words=p.words,g.length=p.length,g.negative=p.negative,g.red=p.red}if(r.prototype._move=function(p){e(p,this)},r.prototype.clone=function(){var p=new r(null);return this.copy(p),p},r.prototype._expand=function(p){for(;this.length<p;)this.words[this.length++]=0;return this},r.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},r.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{r.prototype[Symbol.for("nodejs.util.inspect.custom")]=s}catch{r.prototype.inspect=s}else r.prototype.inspect=s;function s(){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"],v=[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],b=[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];r.prototype.toString=function(p,_){p=p||10,_=_|0||1;var R;if(p===16||p==="hex"){R="";for(var B=0,P=0,A=0;A<this.length;A++){var w=this.words[A],M=((w<<B|P)&16777215).toString(16);P=w>>>24-B&16777215,B+=2,B>=26&&(B-=26,A--),P!==0||A!==this.length-1?R=l[6-M.length]+M+R:R=M+R}for(P!==0&&(R=P.toString(16)+R);R.length%_!==0;)R="0"+R;return this.negative!==0&&(R="-"+R),R}if(p===(p|0)&&p>=2&&p<=36){var x=v[p],L=b[p];R="";var K=this.clone();for(K.negative=0;!K.isZero();){var Q=K.modrn(L).toString(p);K=K.idivn(L),K.isZero()?R=Q+R:R=l[x-Q.length]+Q+R}for(this.isZero()&&(R="0"+R);R.length%_!==0;)R="0"+R;return this.negative!==0&&(R="-"+R),R}o(!1,"Base should be between 2 and 36")},r.prototype.toNumber=function(){var p=this.words[0];return this.length===2?p+=this.words[1]*67108864:this.length===3&&this.words[2]===1?p+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-p:p},r.prototype.toJSON=function(){return this.toString(16,2)},h&&(r.prototype.toBuffer=function(p,_){return this.toArrayLike(h,p,_)}),r.prototype.toArray=function(p,_){return this.toArrayLike(Array,p,_)};var m=function(p,_){return p.allocUnsafe?p.allocUnsafe(_):new p(_)};r.prototype.toArrayLike=function(p,_,R){this._strip();var B=this.byteLength(),P=R||Math.max(1,B);o(B<=P,"byte array longer than desired length"),o(P>0,"Requested array length <= 0");var A=m(p,P),w=_==="le"?"LE":"BE";return this["_toArrayLike"+w](A,B),A},r.prototype._toArrayLikeLE=function(p,_){for(var R=0,B=0,P=0,A=0;P<this.length;P++){var w=this.words[P]<<A|B;p[R++]=w&255,R<p.length&&(p[R++]=w>>8&255),R<p.length&&(p[R++]=w>>16&255),A===6?(R<p.length&&(p[R++]=w>>24&255),B=0,A=0):(B=w>>>24,A+=2)}if(R<p.length)for(p[R++]=B;R<p.length;)p[R++]=0},r.prototype._toArrayLikeBE=function(p,_){for(var R=p.length-1,B=0,P=0,A=0;P<this.length;P++){var w=this.words[P]<<A|B;p[R--]=w&255,R>=0&&(p[R--]=w>>8&255),R>=0&&(p[R--]=w>>16&255),A===6?(R>=0&&(p[R--]=w>>24&255),B=0,A=0):(B=w>>>24,A+=2)}if(R>=0)for(p[R--]=B;R>=0;)p[R--]=0},Math.clz32?r.prototype._countBits=function(p){return 32-Math.clz32(p)}:r.prototype._countBits=function(p){var _=p,R=0;return _>=4096&&(R+=13,_>>>=13),_>=64&&(R+=7,_>>>=7),_>=8&&(R+=4,_>>>=4),_>=2&&(R+=2,_>>>=2),R+_},r.prototype._zeroBits=function(p){if(p===0)return 26;var _=p,R=0;return(_&8191)===0&&(R+=13,_>>>=13),(_&127)===0&&(R+=7,_>>>=7),(_&15)===0&&(R+=4,_>>>=4),(_&3)===0&&(R+=2,_>>>=2),(_&1)===0&&R++,R},r.prototype.bitLength=function(){var p=this.words[this.length-1],_=this._countBits(p);return(this.length-1)*26+_};function q(g){for(var p=new Array(g.bitLength()),_=0;_<p.length;_++){var R=_/26|0,B=_%26;p[_]=g.words[R]>>>B&1}return p}r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var p=0,_=0;_<this.length;_++){var R=this._zeroBits(this.words[_]);if(p+=R,R!==26)break}return p},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(p){return this.negative!==0?this.abs().inotn(p).iaddn(1):this.clone()},r.prototype.fromTwos=function(p){return this.testn(p-1)?this.notn(p).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return this.negative!==0},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(p){for(;this.length<p.length;)this.words[this.length++]=0;for(var _=0;_<p.length;_++)this.words[_]=this.words[_]|p.words[_];return this._strip()},r.prototype.ior=function(p){return o((this.negative|p.negative)===0),this.iuor(p)},r.prototype.or=function(p){return this.length>p.length?this.clone().ior(p):p.clone().ior(this)},r.prototype.uor=function(p){return this.length>p.length?this.clone().iuor(p):p.clone().iuor(this)},r.prototype.iuand=function(p){var _;this.length>p.length?_=p:_=this;for(var R=0;R<_.length;R++)this.words[R]=this.words[R]&p.words[R];return this.length=_.length,this._strip()},r.prototype.iand=function(p){return o((this.negative|p.negative)===0),this.iuand(p)},r.prototype.and=function(p){return this.length>p.length?this.clone().iand(p):p.clone().iand(this)},r.prototype.uand=function(p){return this.length>p.length?this.clone().iuand(p):p.clone().iuand(this)},r.prototype.iuxor=function(p){var _,R;this.length>p.length?(_=this,R=p):(_=p,R=this);for(var B=0;B<R.length;B++)this.words[B]=_.words[B]^R.words[B];if(this!==_)for(;B<_.length;B++)this.words[B]=_.words[B];return this.length=_.length,this._strip()},r.prototype.ixor=function(p){return o((this.negative|p.negative)===0),this.iuxor(p)},r.prototype.xor=function(p){return this.length>p.length?this.clone().ixor(p):p.clone().ixor(this)},r.prototype.uxor=function(p){return this.length>p.length?this.clone().iuxor(p):p.clone().iuxor(this)},r.prototype.inotn=function(p){o(typeof p=="number"&&p>=0);var _=Math.ceil(p/26)|0,R=p%26;this._expand(_),R>0&&_--;for(var B=0;B<_;B++)this.words[B]=~this.words[B]&67108863;return R>0&&(this.words[B]=~this.words[B]&67108863>>26-R),this._strip()},r.prototype.notn=function(p){return this.clone().inotn(p)},r.prototype.setn=function(p,_){o(typeof p=="number"&&p>=0);var R=p/26|0,B=p%26;return this._expand(R+1),_?this.words[R]=this.words[R]|1<<B:this.words[R]=this.words[R]&~(1<<B),this._strip()},r.prototype.iadd=function(p){var _;if(this.negative!==0&&p.negative===0)return this.negative=0,_=this.isub(p),this.negative^=1,this._normSign();if(this.negative===0&&p.negative!==0)return p.negative=0,_=this.isub(p),p.negative=1,_._normSign();var R,B;this.length>p.length?(R=this,B=p):(R=p,B=this);for(var P=0,A=0;A<B.length;A++)_=(R.words[A]|0)+(B.words[A]|0)+P,this.words[A]=_&67108863,P=_>>>26;for(;P!==0&&A<R.length;A++)_=(R.words[A]|0)+P,this.words[A]=_&67108863,P=_>>>26;if(this.length=R.length,P!==0)this.words[this.length]=P,this.length++;else if(R!==this)for(;A<R.length;A++)this.words[A]=R.words[A];return this},r.prototype.add=function(p){var _;return p.negative!==0&&this.negative===0?(p.negative=0,_=this.sub(p),p.negative^=1,_):p.negative===0&&this.negative!==0?(this.negative=0,_=p.sub(this),this.negative=1,_):this.length>p.length?this.clone().iadd(p):p.clone().iadd(this)},r.prototype.isub=function(p){if(p.negative!==0){p.negative=0;var _=this.iadd(p);return p.negative=1,_._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(p),this.negative=1,this._normSign();var R=this.cmp(p);if(R===0)return this.negative=0,this.length=1,this.words[0]=0,this;var B,P;R>0?(B=this,P=p):(B=p,P=this);for(var A=0,w=0;w<P.length;w++)_=(B.words[w]|0)-(P.words[w]|0)+A,A=_>>26,this.words[w]=_&67108863;for(;A!==0&&w<B.length;w++)_=(B.words[w]|0)+A,A=_>>26,this.words[w]=_&67108863;if(A===0&&w<B.length&&B!==this)for(;w<B.length;w++)this.words[w]=B.words[w];return this.length=Math.max(this.length,w),B!==this&&(this.negative=1),this._strip()},r.prototype.sub=function(p){return this.clone().isub(p)};function E(g,p,_){_.negative=p.negative^g.negative;var R=g.length+p.length|0;_.length=R,R=R-1|0;var B=g.words[0]|0,P=p.words[0]|0,A=B*P,w=A&67108863,M=A/67108864|0;_.words[0]=w;for(var x=1;x<R;x++){for(var L=M>>>26,K=M&67108863,Q=Math.min(x,p.length-1),H=Math.max(0,x-g.length+1);H<=Q;H++){var N=x-H|0;B=g.words[N]|0,P=p.words[H]|0,A=B*P+K,L+=A/67108864|0,K=A&67108863}_.words[x]=K|0,M=L|0}return M!==0?_.words[x]=M|0:_.length--,_._strip()}var S=function(p,_,R){var B=p.words,P=_.words,A=R.words,w=0,M,x,L,K=B[0]|0,Q=K&8191,H=K>>>13,N=B[1]|0,F=N&8191,ee=N>>>13,ae=B[2]|0,z=ae&8191,G=ae>>>13,fe=B[3]|0,me=fe&8191,xe=fe>>>13,_e=B[4]|0,qe=_e&8191,Re=_e>>>13,be=B[5]|0,Fe=be&8191,Be=be>>>13,Me=B[6]|0,Te=Me&8191,oe=Me>>>13,ce=B[7]|0,ge=ce&8191,we=ce>>>13,Se=B[8]|0,Oe=Se&8191,U=Se>>>13,I=B[9]|0,C=I&8191,X=I>>>13,se=P[0]|0,le=se&8191,ve=se>>>13,Ce=P[1]|0,Le=Ce&8191,Ie=Ce>>>13,$e=P[2]|0,je=$e&8191,He=$e>>>13,Ke=P[3]|0,Ze=Ke&8191,We=Ke>>>13,Ye=P[4]|0,Xe=Ye&8191,W=Ye>>>13,T=P[5]|0,k=T&8191,re=T>>>13,ue=P[6]|0,pe=ue&8191,ye=ue>>>13,ke=P[7]|0,Ve=ke&8191,Ne=ke>>>13,Ge=P[8]|0,Ue=Ge&8191,ze=Ge>>>13,Je=P[9]|0,Qe=Je&8191,er=Je>>>13;R.negative=p.negative^_.negative,R.length=19,M=Math.imul(Q,le),x=Math.imul(Q,ve),x=x+Math.imul(H,le)|0,L=Math.imul(H,ve);var fr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(fr>>>26)|0,fr&=67108863,M=Math.imul(F,le),x=Math.imul(F,ve),x=x+Math.imul(ee,le)|0,L=Math.imul(ee,ve),M=M+Math.imul(Q,Le)|0,x=x+Math.imul(Q,Ie)|0,x=x+Math.imul(H,Le)|0,L=L+Math.imul(H,Ie)|0;var ur=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(ur>>>26)|0,ur&=67108863,M=Math.imul(z,le),x=Math.imul(z,ve),x=x+Math.imul(G,le)|0,L=Math.imul(G,ve),M=M+Math.imul(F,Le)|0,x=x+Math.imul(F,Ie)|0,x=x+Math.imul(ee,Le)|0,L=L+Math.imul(ee,Ie)|0,M=M+Math.imul(Q,je)|0,x=x+Math.imul(Q,He)|0,x=x+Math.imul(H,je)|0,L=L+Math.imul(H,He)|0;var cr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(cr>>>26)|0,cr&=67108863,M=Math.imul(me,le),x=Math.imul(me,ve),x=x+Math.imul(xe,le)|0,L=Math.imul(xe,ve),M=M+Math.imul(z,Le)|0,x=x+Math.imul(z,Ie)|0,x=x+Math.imul(G,Le)|0,L=L+Math.imul(G,Ie)|0,M=M+Math.imul(F,je)|0,x=x+Math.imul(F,He)|0,x=x+Math.imul(ee,je)|0,L=L+Math.imul(ee,He)|0,M=M+Math.imul(Q,Ze)|0,x=x+Math.imul(Q,We)|0,x=x+Math.imul(H,Ze)|0,L=L+Math.imul(H,We)|0;var nr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(nr>>>26)|0,nr&=67108863,M=Math.imul(qe,le),x=Math.imul(qe,ve),x=x+Math.imul(Re,le)|0,L=Math.imul(Re,ve),M=M+Math.imul(me,Le)|0,x=x+Math.imul(me,Ie)|0,x=x+Math.imul(xe,Le)|0,L=L+Math.imul(xe,Ie)|0,M=M+Math.imul(z,je)|0,x=x+Math.imul(z,He)|0,x=x+Math.imul(G,je)|0,L=L+Math.imul(G,He)|0,M=M+Math.imul(F,Ze)|0,x=x+Math.imul(F,We)|0,x=x+Math.imul(ee,Ze)|0,L=L+Math.imul(ee,We)|0,M=M+Math.imul(Q,Xe)|0,x=x+Math.imul(Q,W)|0,x=x+Math.imul(H,Xe)|0,L=L+Math.imul(H,W)|0;var hr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(hr>>>26)|0,hr&=67108863,M=Math.imul(Fe,le),x=Math.imul(Fe,ve),x=x+Math.imul(Be,le)|0,L=Math.imul(Be,ve),M=M+Math.imul(qe,Le)|0,x=x+Math.imul(qe,Ie)|0,x=x+Math.imul(Re,Le)|0,L=L+Math.imul(Re,Ie)|0,M=M+Math.imul(me,je)|0,x=x+Math.imul(me,He)|0,x=x+Math.imul(xe,je)|0,L=L+Math.imul(xe,He)|0,M=M+Math.imul(z,Ze)|0,x=x+Math.imul(z,We)|0,x=x+Math.imul(G,Ze)|0,L=L+Math.imul(G,We)|0,M=M+Math.imul(F,Xe)|0,x=x+Math.imul(F,W)|0,x=x+Math.imul(ee,Xe)|0,L=L+Math.imul(ee,W)|0,M=M+Math.imul(Q,k)|0,x=x+Math.imul(Q,re)|0,x=x+Math.imul(H,k)|0,L=L+Math.imul(H,re)|0;var lr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(lr>>>26)|0,lr&=67108863,M=Math.imul(Te,le),x=Math.imul(Te,ve),x=x+Math.imul(oe,le)|0,L=Math.imul(oe,ve),M=M+Math.imul(Fe,Le)|0,x=x+Math.imul(Fe,Ie)|0,x=x+Math.imul(Be,Le)|0,L=L+Math.imul(Be,Ie)|0,M=M+Math.imul(qe,je)|0,x=x+Math.imul(qe,He)|0,x=x+Math.imul(Re,je)|0,L=L+Math.imul(Re,He)|0,M=M+Math.imul(me,Ze)|0,x=x+Math.imul(me,We)|0,x=x+Math.imul(xe,Ze)|0,L=L+Math.imul(xe,We)|0,M=M+Math.imul(z,Xe)|0,x=x+Math.imul(z,W)|0,x=x+Math.imul(G,Xe)|0,L=L+Math.imul(G,W)|0,M=M+Math.imul(F,k)|0,x=x+Math.imul(F,re)|0,x=x+Math.imul(ee,k)|0,L=L+Math.imul(ee,re)|0,M=M+Math.imul(Q,pe)|0,x=x+Math.imul(Q,ye)|0,x=x+Math.imul(H,pe)|0,L=L+Math.imul(H,ye)|0;var dr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(dr>>>26)|0,dr&=67108863,M=Math.imul(ge,le),x=Math.imul(ge,ve),x=x+Math.imul(we,le)|0,L=Math.imul(we,ve),M=M+Math.imul(Te,Le)|0,x=x+Math.imul(Te,Ie)|0,x=x+Math.imul(oe,Le)|0,L=L+Math.imul(oe,Ie)|0,M=M+Math.imul(Fe,je)|0,x=x+Math.imul(Fe,He)|0,x=x+Math.imul(Be,je)|0,L=L+Math.imul(Be,He)|0,M=M+Math.imul(qe,Ze)|0,x=x+Math.imul(qe,We)|0,x=x+Math.imul(Re,Ze)|0,L=L+Math.imul(Re,We)|0,M=M+Math.imul(me,Xe)|0,x=x+Math.imul(me,W)|0,x=x+Math.imul(xe,Xe)|0,L=L+Math.imul(xe,W)|0,M=M+Math.imul(z,k)|0,x=x+Math.imul(z,re)|0,x=x+Math.imul(G,k)|0,L=L+Math.imul(G,re)|0,M=M+Math.imul(F,pe)|0,x=x+Math.imul(F,ye)|0,x=x+Math.imul(ee,pe)|0,L=L+Math.imul(ee,ye)|0,M=M+Math.imul(Q,Ve)|0,x=x+Math.imul(Q,Ne)|0,x=x+Math.imul(H,Ve)|0,L=L+Math.imul(H,Ne)|0;var pr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(pr>>>26)|0,pr&=67108863,M=Math.imul(Oe,le),x=Math.imul(Oe,ve),x=x+Math.imul(U,le)|0,L=Math.imul(U,ve),M=M+Math.imul(ge,Le)|0,x=x+Math.imul(ge,Ie)|0,x=x+Math.imul(we,Le)|0,L=L+Math.imul(we,Ie)|0,M=M+Math.imul(Te,je)|0,x=x+Math.imul(Te,He)|0,x=x+Math.imul(oe,je)|0,L=L+Math.imul(oe,He)|0,M=M+Math.imul(Fe,Ze)|0,x=x+Math.imul(Fe,We)|0,x=x+Math.imul(Be,Ze)|0,L=L+Math.imul(Be,We)|0,M=M+Math.imul(qe,Xe)|0,x=x+Math.imul(qe,W)|0,x=x+Math.imul(Re,Xe)|0,L=L+Math.imul(Re,W)|0,M=M+Math.imul(me,k)|0,x=x+Math.imul(me,re)|0,x=x+Math.imul(xe,k)|0,L=L+Math.imul(xe,re)|0,M=M+Math.imul(z,pe)|0,x=x+Math.imul(z,ye)|0,x=x+Math.imul(G,pe)|0,L=L+Math.imul(G,ye)|0,M=M+Math.imul(F,Ve)|0,x=x+Math.imul(F,Ne)|0,x=x+Math.imul(ee,Ve)|0,L=L+Math.imul(ee,Ne)|0,M=M+Math.imul(Q,Ue)|0,x=x+Math.imul(Q,ze)|0,x=x+Math.imul(H,Ue)|0,L=L+Math.imul(H,ze)|0;var vr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(vr>>>26)|0,vr&=67108863,M=Math.imul(C,le),x=Math.imul(C,ve),x=x+Math.imul(X,le)|0,L=Math.imul(X,ve),M=M+Math.imul(Oe,Le)|0,x=x+Math.imul(Oe,Ie)|0,x=x+Math.imul(U,Le)|0,L=L+Math.imul(U,Ie)|0,M=M+Math.imul(ge,je)|0,x=x+Math.imul(ge,He)|0,x=x+Math.imul(we,je)|0,L=L+Math.imul(we,He)|0,M=M+Math.imul(Te,Ze)|0,x=x+Math.imul(Te,We)|0,x=x+Math.imul(oe,Ze)|0,L=L+Math.imul(oe,We)|0,M=M+Math.imul(Fe,Xe)|0,x=x+Math.imul(Fe,W)|0,x=x+Math.imul(Be,Xe)|0,L=L+Math.imul(Be,W)|0,M=M+Math.imul(qe,k)|0,x=x+Math.imul(qe,re)|0,x=x+Math.imul(Re,k)|0,L=L+Math.imul(Re,re)|0,M=M+Math.imul(me,pe)|0,x=x+Math.imul(me,ye)|0,x=x+Math.imul(xe,pe)|0,L=L+Math.imul(xe,ye)|0,M=M+Math.imul(z,Ve)|0,x=x+Math.imul(z,Ne)|0,x=x+Math.imul(G,Ve)|0,L=L+Math.imul(G,Ne)|0,M=M+Math.imul(F,Ue)|0,x=x+Math.imul(F,ze)|0,x=x+Math.imul(ee,Ue)|0,L=L+Math.imul(ee,ze)|0,M=M+Math.imul(Q,Qe)|0,x=x+Math.imul(Q,er)|0,x=x+Math.imul(H,Qe)|0,L=L+Math.imul(H,er)|0;var br=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(br>>>26)|0,br&=67108863,M=Math.imul(C,Le),x=Math.imul(C,Ie),x=x+Math.imul(X,Le)|0,L=Math.imul(X,Ie),M=M+Math.imul(Oe,je)|0,x=x+Math.imul(Oe,He)|0,x=x+Math.imul(U,je)|0,L=L+Math.imul(U,He)|0,M=M+Math.imul(ge,Ze)|0,x=x+Math.imul(ge,We)|0,x=x+Math.imul(we,Ze)|0,L=L+Math.imul(we,We)|0,M=M+Math.imul(Te,Xe)|0,x=x+Math.imul(Te,W)|0,x=x+Math.imul(oe,Xe)|0,L=L+Math.imul(oe,W)|0,M=M+Math.imul(Fe,k)|0,x=x+Math.imul(Fe,re)|0,x=x+Math.imul(Be,k)|0,L=L+Math.imul(Be,re)|0,M=M+Math.imul(qe,pe)|0,x=x+Math.imul(qe,ye)|0,x=x+Math.imul(Re,pe)|0,L=L+Math.imul(Re,ye)|0,M=M+Math.imul(me,Ve)|0,x=x+Math.imul(me,Ne)|0,x=x+Math.imul(xe,Ve)|0,L=L+Math.imul(xe,Ne)|0,M=M+Math.imul(z,Ue)|0,x=x+Math.imul(z,ze)|0,x=x+Math.imul(G,Ue)|0,L=L+Math.imul(G,ze)|0,M=M+Math.imul(F,Qe)|0,x=x+Math.imul(F,er)|0,x=x+Math.imul(ee,Qe)|0,L=L+Math.imul(ee,er)|0;var yr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(yr>>>26)|0,yr&=67108863,M=Math.imul(C,je),x=Math.imul(C,He),x=x+Math.imul(X,je)|0,L=Math.imul(X,He),M=M+Math.imul(Oe,Ze)|0,x=x+Math.imul(Oe,We)|0,x=x+Math.imul(U,Ze)|0,L=L+Math.imul(U,We)|0,M=M+Math.imul(ge,Xe)|0,x=x+Math.imul(ge,W)|0,x=x+Math.imul(we,Xe)|0,L=L+Math.imul(we,W)|0,M=M+Math.imul(Te,k)|0,x=x+Math.imul(Te,re)|0,x=x+Math.imul(oe,k)|0,L=L+Math.imul(oe,re)|0,M=M+Math.imul(Fe,pe)|0,x=x+Math.imul(Fe,ye)|0,x=x+Math.imul(Be,pe)|0,L=L+Math.imul(Be,ye)|0,M=M+Math.imul(qe,Ve)|0,x=x+Math.imul(qe,Ne)|0,x=x+Math.imul(Re,Ve)|0,L=L+Math.imul(Re,Ne)|0,M=M+Math.imul(me,Ue)|0,x=x+Math.imul(me,ze)|0,x=x+Math.imul(xe,Ue)|0,L=L+Math.imul(xe,ze)|0,M=M+Math.imul(z,Qe)|0,x=x+Math.imul(z,er)|0,x=x+Math.imul(G,Qe)|0,L=L+Math.imul(G,er)|0;var gr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(gr>>>26)|0,gr&=67108863,M=Math.imul(C,Ze),x=Math.imul(C,We),x=x+Math.imul(X,Ze)|0,L=Math.imul(X,We),M=M+Math.imul(Oe,Xe)|0,x=x+Math.imul(Oe,W)|0,x=x+Math.imul(U,Xe)|0,L=L+Math.imul(U,W)|0,M=M+Math.imul(ge,k)|0,x=x+Math.imul(ge,re)|0,x=x+Math.imul(we,k)|0,L=L+Math.imul(we,re)|0,M=M+Math.imul(Te,pe)|0,x=x+Math.imul(Te,ye)|0,x=x+Math.imul(oe,pe)|0,L=L+Math.imul(oe,ye)|0,M=M+Math.imul(Fe,Ve)|0,x=x+Math.imul(Fe,Ne)|0,x=x+Math.imul(Be,Ve)|0,L=L+Math.imul(Be,Ne)|0,M=M+Math.imul(qe,Ue)|0,x=x+Math.imul(qe,ze)|0,x=x+Math.imul(Re,Ue)|0,L=L+Math.imul(Re,ze)|0,M=M+Math.imul(me,Qe)|0,x=x+Math.imul(me,er)|0,x=x+Math.imul(xe,Qe)|0,L=L+Math.imul(xe,er)|0;var wr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(wr>>>26)|0,wr&=67108863,M=Math.imul(C,Xe),x=Math.imul(C,W),x=x+Math.imul(X,Xe)|0,L=Math.imul(X,W),M=M+Math.imul(Oe,k)|0,x=x+Math.imul(Oe,re)|0,x=x+Math.imul(U,k)|0,L=L+Math.imul(U,re)|0,M=M+Math.imul(ge,pe)|0,x=x+Math.imul(ge,ye)|0,x=x+Math.imul(we,pe)|0,L=L+Math.imul(we,ye)|0,M=M+Math.imul(Te,Ve)|0,x=x+Math.imul(Te,Ne)|0,x=x+Math.imul(oe,Ve)|0,L=L+Math.imul(oe,Ne)|0,M=M+Math.imul(Fe,Ue)|0,x=x+Math.imul(Fe,ze)|0,x=x+Math.imul(Be,Ue)|0,L=L+Math.imul(Be,ze)|0,M=M+Math.imul(qe,Qe)|0,x=x+Math.imul(qe,er)|0,x=x+Math.imul(Re,Qe)|0,L=L+Math.imul(Re,er)|0;var rr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(rr>>>26)|0,rr&=67108863,M=Math.imul(C,k),x=Math.imul(C,re),x=x+Math.imul(X,k)|0,L=Math.imul(X,re),M=M+Math.imul(Oe,pe)|0,x=x+Math.imul(Oe,ye)|0,x=x+Math.imul(U,pe)|0,L=L+Math.imul(U,ye)|0,M=M+Math.imul(ge,Ve)|0,x=x+Math.imul(ge,Ne)|0,x=x+Math.imul(we,Ve)|0,L=L+Math.imul(we,Ne)|0,M=M+Math.imul(Te,Ue)|0,x=x+Math.imul(Te,ze)|0,x=x+Math.imul(oe,Ue)|0,L=L+Math.imul(oe,ze)|0,M=M+Math.imul(Fe,Qe)|0,x=x+Math.imul(Fe,er)|0,x=x+Math.imul(Be,Qe)|0,L=L+Math.imul(Be,er)|0;var _r=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(_r>>>26)|0,_r&=67108863,M=Math.imul(C,pe),x=Math.imul(C,ye),x=x+Math.imul(X,pe)|0,L=Math.imul(X,ye),M=M+Math.imul(Oe,Ve)|0,x=x+Math.imul(Oe,Ne)|0,x=x+Math.imul(U,Ve)|0,L=L+Math.imul(U,Ne)|0,M=M+Math.imul(ge,Ue)|0,x=x+Math.imul(ge,ze)|0,x=x+Math.imul(we,Ue)|0,L=L+Math.imul(we,ze)|0,M=M+Math.imul(Te,Qe)|0,x=x+Math.imul(Te,er)|0,x=x+Math.imul(oe,Qe)|0,L=L+Math.imul(oe,er)|0;var xr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(xr>>>26)|0,xr&=67108863,M=Math.imul(C,Ve),x=Math.imul(C,Ne),x=x+Math.imul(X,Ve)|0,L=Math.imul(X,Ne),M=M+Math.imul(Oe,Ue)|0,x=x+Math.imul(Oe,ze)|0,x=x+Math.imul(U,Ue)|0,L=L+Math.imul(U,ze)|0,M=M+Math.imul(ge,Qe)|0,x=x+Math.imul(ge,er)|0,x=x+Math.imul(we,Qe)|0,L=L+Math.imul(we,er)|0;var Sr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,M=Math.imul(C,Ue),x=Math.imul(C,ze),x=x+Math.imul(X,Ue)|0,L=Math.imul(X,ze),M=M+Math.imul(Oe,Qe)|0,x=x+Math.imul(Oe,er)|0,x=x+Math.imul(U,Qe)|0,L=L+Math.imul(U,er)|0;var V=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(V>>>26)|0,V&=67108863,M=Math.imul(C,Qe),x=Math.imul(C,er),x=x+Math.imul(X,Qe)|0,L=Math.imul(X,er);var Y=(w+M|0)+((x&8191)<<13)|0;return w=(L+(x>>>13)|0)+(Y>>>26)|0,Y&=67108863,A[0]=fr,A[1]=ur,A[2]=cr,A[3]=nr,A[4]=hr,A[5]=lr,A[6]=dr,A[7]=pr,A[8]=vr,A[9]=br,A[10]=yr,A[11]=gr,A[12]=wr,A[13]=rr,A[14]=_r,A[15]=xr,A[16]=Sr,A[17]=V,A[18]=Y,w!==0&&(A[19]=w,R.length++),R};Math.imul||(S=E);function O(g,p,_){_.negative=p.negative^g.negative,_.length=g.length+p.length;for(var R=0,B=0,P=0;P<_.length-1;P++){var A=B;B=0;for(var w=R&67108863,M=Math.min(P,p.length-1),x=Math.max(0,P-g.length+1);x<=M;x++){var L=P-x,K=g.words[L]|0,Q=p.words[x]|0,H=K*Q,N=H&67108863;A=A+(H/67108864|0)|0,N=N+w|0,w=N&67108863,A=A+(N>>>26)|0,B+=A>>>26,A&=67108863}_.words[P]=w,R=A,A=B}return R!==0?_.words[P]=R:_.length--,_._strip()}function D(g,p,_){return O(g,p,_)}r.prototype.mulTo=function(p,_){var R,B=this.length+p.length;return this.length===10&&p.length===10?R=S(this,p,_):B<63?R=E(this,p,_):B<1024?R=O(this,p,_):R=D(this,p,_),R},r.prototype.mul=function(p){var _=new r(null);return _.words=new Array(this.length+p.length),this.mulTo(p,_)},r.prototype.mulf=function(p){var _=new r(null);return _.words=new Array(this.length+p.length),D(this,p,_)},r.prototype.imul=function(p){return this.clone().mulTo(p,this)},r.prototype.imuln=function(p){var _=p<0;_&&(p=-p),o(typeof p=="number"),o(p<67108864);for(var R=0,B=0;B<this.length;B++){var P=(this.words[B]|0)*p,A=(P&67108863)+(R&67108863);R>>=26,R+=P/67108864|0,R+=A>>>26,this.words[B]=A&67108863}return R!==0&&(this.words[B]=R,this.length++),this.length=p===0?1:this.length,_?this.ineg():this},r.prototype.muln=function(p){return this.clone().imuln(p)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(p){var _=q(p);if(_.length===0)return new r(1);for(var R=this,B=0;B<_.length&&_[B]===0;B++,R=R.sqr());if(++B<_.length)for(var P=R.sqr();B<_.length;B++,P=P.sqr())_[B]!==0&&(R=R.mul(P));return R},r.prototype.iushln=function(p){o(typeof p=="number"&&p>=0);var _=p%26,R=(p-_)/26,B=67108863>>>26-_<<26-_,P;if(_!==0){var A=0;for(P=0;P<this.length;P++){var w=this.words[P]&B,M=(this.words[P]|0)-w<<_;this.words[P]=M|A,A=w>>>26-_}A&&(this.words[P]=A,this.length++)}if(R!==0){for(P=this.length-1;P>=0;P--)this.words[P+R]=this.words[P];for(P=0;P<R;P++)this.words[P]=0;this.length+=R}return this._strip()},r.prototype.ishln=function(p){return o(this.negative===0),this.iushln(p)},r.prototype.iushrn=function(p,_,R){o(typeof p=="number"&&p>=0);var B;_?B=(_-_%26)/26:B=0;var P=p%26,A=Math.min((p-P)/26,this.length),w=67108863^67108863>>>P<<P,M=R;if(B-=A,B=Math.max(0,B),M){for(var x=0;x<A;x++)M.words[x]=this.words[x];M.length=A}if(A!==0)if(this.length>A)for(this.length-=A,x=0;x<this.length;x++)this.words[x]=this.words[x+A];else this.words[0]=0,this.length=1;var L=0;for(x=this.length-1;x>=0&&(L!==0||x>=B);x--){var K=this.words[x]|0;this.words[x]=L<<26-P|K>>>P,L=K&w}return M&&L!==0&&(M.words[M.length++]=L),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},r.prototype.ishrn=function(p,_,R){return o(this.negative===0),this.iushrn(p,_,R)},r.prototype.shln=function(p){return this.clone().ishln(p)},r.prototype.ushln=function(p){return this.clone().iushln(p)},r.prototype.shrn=function(p){return this.clone().ishrn(p)},r.prototype.ushrn=function(p){return this.clone().iushrn(p)},r.prototype.testn=function(p){o(typeof p=="number"&&p>=0);var _=p%26,R=(p-_)/26,B=1<<_;if(this.length<=R)return!1;var P=this.words[R];return!!(P&B)},r.prototype.imaskn=function(p){o(typeof p=="number"&&p>=0);var _=p%26,R=(p-_)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=R)return this;if(_!==0&&R++,this.length=Math.min(R,this.length),_!==0){var B=67108863^67108863>>>_<<_;this.words[this.length-1]&=B}return this.length===0&&(this.words[0]=0,this.length=1),this._strip()},r.prototype.maskn=function(p){return this.clone().imaskn(p)},r.prototype.iaddn=function(p){return o(typeof p=="number"),o(p<67108864),p<0?this.isubn(-p):this.negative!==0?this.length===1&&(this.words[0]|0)<=p?(this.words[0]=p-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(p),this.negative=1,this):this._iaddn(p)},r.prototype._iaddn=function(p){this.words[0]+=p;for(var _=0;_<this.length&&this.words[_]>=67108864;_++)this.words[_]-=67108864,_===this.length-1?this.words[_+1]=1:this.words[_+1]++;return this.length=Math.max(this.length,_+1),this},r.prototype.isubn=function(p){if(o(typeof p=="number"),o(p<67108864),p<0)return this.iaddn(-p);if(this.negative!==0)return this.negative=0,this.iaddn(p),this.negative=1,this;if(this.words[0]-=p,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var _=0;_<this.length&&this.words[_]<0;_++)this.words[_]+=67108864,this.words[_+1]-=1;return this._strip()},r.prototype.addn=function(p){return this.clone().iaddn(p)},r.prototype.subn=function(p){return this.clone().isubn(p)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(p,_,R){var B=p.length+R,P;this._expand(B);var A,w=0;for(P=0;P<p.length;P++){A=(this.words[P+R]|0)+w;var M=(p.words[P]|0)*_;A-=M&67108863,w=(A>>26)-(M/67108864|0),this.words[P+R]=A&67108863}for(;P<this.length-R;P++)A=(this.words[P+R]|0)+w,w=A>>26,this.words[P+R]=A&67108863;if(w===0)return this._strip();for(o(w===-1),w=0,P=0;P<this.length;P++)A=-(this.words[P]|0)+w,w=A>>26,this.words[P]=A&67108863;return this.negative=1,this._strip()},r.prototype._wordDiv=function(p,_){var R=this.length-p.length,B=this.clone(),P=p,A=P.words[P.length-1]|0,w=this._countBits(A);R=26-w,R!==0&&(P=P.ushln(R),B.iushln(R),A=P.words[P.length-1]|0);var M=B.length-P.length,x;if(_!=="mod"){x=new r(null),x.length=M+1,x.words=new Array(x.length);for(var L=0;L<x.length;L++)x.words[L]=0}var K=B.clone()._ishlnsubmul(P,1,M);K.negative===0&&(B=K,x&&(x.words[M]=1));for(var Q=M-1;Q>=0;Q--){var H=(B.words[P.length+Q]|0)*67108864+(B.words[P.length+Q-1]|0);for(H=Math.min(H/A|0,67108863),B._ishlnsubmul(P,H,Q);B.negative!==0;)H--,B.negative=0,B._ishlnsubmul(P,1,Q),B.isZero()||(B.negative^=1);x&&(x.words[Q]=H)}return x&&x._strip(),B._strip(),_!=="div"&&R!==0&&B.iushrn(R),{div:x||null,mod:B}},r.prototype.divmod=function(p,_,R){if(o(!p.isZero()),this.isZero())return{div:new r(0),mod:new r(0)};var B,P,A;return this.negative!==0&&p.negative===0?(A=this.neg().divmod(p,_),_!=="mod"&&(B=A.div.neg()),_!=="div"&&(P=A.mod.neg(),R&&P.negative!==0&&P.iadd(p)),{div:B,mod:P}):this.negative===0&&p.negative!==0?(A=this.divmod(p.neg(),_),_!=="mod"&&(B=A.div.neg()),{div:B,mod:A.mod}):(this.negative&p.negative)!==0?(A=this.neg().divmod(p.neg(),_),_!=="div"&&(P=A.mod.neg(),R&&P.negative!==0&&P.isub(p)),{div:A.div,mod:P}):p.length>this.length||this.cmp(p)<0?{div:new r(0),mod:this}:p.length===1?_==="div"?{div:this.divn(p.words[0]),mod:null}:_==="mod"?{div:null,mod:new r(this.modrn(p.words[0]))}:{div:this.divn(p.words[0]),mod:new r(this.modrn(p.words[0]))}:this._wordDiv(p,_)},r.prototype.div=function(p){return this.divmod(p,"div",!1).div},r.prototype.mod=function(p){return this.divmod(p,"mod",!1).mod},r.prototype.umod=function(p){return this.divmod(p,"mod",!0).mod},r.prototype.divRound=function(p){var _=this.divmod(p);if(_.mod.isZero())return _.div;var R=_.div.negative!==0?_.mod.isub(p):_.mod,B=p.ushrn(1),P=p.andln(1),A=R.cmp(B);return A<0||P===1&&A===0?_.div:_.div.negative!==0?_.div.isubn(1):_.div.iaddn(1)},r.prototype.modrn=function(p){var _=p<0;_&&(p=-p),o(p<=67108863);for(var R=(1<<26)%p,B=0,P=this.length-1;P>=0;P--)B=(R*B+(this.words[P]|0))%p;return _?-B:B},r.prototype.modn=function(p){return this.modrn(p)},r.prototype.idivn=function(p){var _=p<0;_&&(p=-p),o(p<=67108863);for(var R=0,B=this.length-1;B>=0;B--){var P=(this.words[B]|0)+R*67108864;this.words[B]=P/p|0,R=P%p}return this._strip(),_?this.ineg():this},r.prototype.divn=function(p){return this.clone().idivn(p)},r.prototype.egcd=function(p){o(p.negative===0),o(!p.isZero());var _=this,R=p.clone();_.negative!==0?_=_.umod(p):_=_.clone();for(var B=new r(1),P=new r(0),A=new r(0),w=new r(1),M=0;_.isEven()&&R.isEven();)_.iushrn(1),R.iushrn(1),++M;for(var x=R.clone(),L=_.clone();!_.isZero();){for(var K=0,Q=1;(_.words[0]&Q)===0&&K<26;++K,Q<<=1);if(K>0)for(_.iushrn(K);K-- >0;)(B.isOdd()||P.isOdd())&&(B.iadd(x),P.isub(L)),B.iushrn(1),P.iushrn(1);for(var H=0,N=1;(R.words[0]&N)===0&&H<26;++H,N<<=1);if(H>0)for(R.iushrn(H);H-- >0;)(A.isOdd()||w.isOdd())&&(A.iadd(x),w.isub(L)),A.iushrn(1),w.iushrn(1);_.cmp(R)>=0?(_.isub(R),B.isub(A),P.isub(w)):(R.isub(_),A.isub(B),w.isub(P))}return{a:A,b:w,gcd:R.iushln(M)}},r.prototype._invmp=function(p){o(p.negative===0),o(!p.isZero());var _=this,R=p.clone();_.negative!==0?_=_.umod(p):_=_.clone();for(var B=new r(1),P=new r(0),A=R.clone();_.cmpn(1)>0&&R.cmpn(1)>0;){for(var w=0,M=1;(_.words[0]&M)===0&&w<26;++w,M<<=1);if(w>0)for(_.iushrn(w);w-- >0;)B.isOdd()&&B.iadd(A),B.iushrn(1);for(var x=0,L=1;(R.words[0]&L)===0&&x<26;++x,L<<=1);if(x>0)for(R.iushrn(x);x-- >0;)P.isOdd()&&P.iadd(A),P.iushrn(1);_.cmp(R)>=0?(_.isub(R),B.isub(P)):(R.isub(_),P.isub(B))}var K;return _.cmpn(1)===0?K=B:K=P,K.cmpn(0)<0&&K.iadd(p),K},r.prototype.gcd=function(p){if(this.isZero())return p.abs();if(p.isZero())return this.abs();var _=this.clone(),R=p.clone();_.negative=0,R.negative=0;for(var B=0;_.isEven()&&R.isEven();B++)_.iushrn(1),R.iushrn(1);do{for(;_.isEven();)_.iushrn(1);for(;R.isEven();)R.iushrn(1);var P=_.cmp(R);if(P<0){var A=_;_=R,R=A}else if(P===0||R.cmpn(1)===0)break;_.isub(R)}while(!0);return R.iushln(B)},r.prototype.invm=function(p){return this.egcd(p).a.umod(p)},r.prototype.isEven=function(){return(this.words[0]&1)===0},r.prototype.isOdd=function(){return(this.words[0]&1)===1},r.prototype.andln=function(p){return this.words[0]&p},r.prototype.bincn=function(p){o(typeof p=="number");var _=p%26,R=(p-_)/26,B=1<<_;if(this.length<=R)return this._expand(R+1),this.words[R]|=B,this;for(var P=B,A=R;P!==0&&A<this.length;A++){var w=this.words[A]|0;w+=P,P=w>>>26,w&=67108863,this.words[A]=w}return P!==0&&(this.words[A]=P,this.length++),this},r.prototype.isZero=function(){return this.length===1&&this.words[0]===0},r.prototype.cmpn=function(p){var _=p<0;if(this.negative!==0&&!_)return-1;if(this.negative===0&&_)return 1;this._strip();var R;if(this.length>1)R=1;else{_&&(p=-p),o(p<=67108863,"Number is too big");var B=this.words[0]|0;R=B===p?0:B<p?-1:1}return this.negative!==0?-R|0:R},r.prototype.cmp=function(p){if(this.negative!==0&&p.negative===0)return-1;if(this.negative===0&&p.negative!==0)return 1;var _=this.ucmp(p);return this.negative!==0?-_|0:_},r.prototype.ucmp=function(p){if(this.length>p.length)return 1;if(this.length<p.length)return-1;for(var _=0,R=this.length-1;R>=0;R--){var B=this.words[R]|0,P=p.words[R]|0;if(B!==P){B<P?_=-1:B>P&&(_=1);break}}return _},r.prototype.gtn=function(p){return this.cmpn(p)===1},r.prototype.gt=function(p){return this.cmp(p)===1},r.prototype.gten=function(p){return this.cmpn(p)>=0},r.prototype.gte=function(p){return this.cmp(p)>=0},r.prototype.ltn=function(p){return this.cmpn(p)===-1},r.prototype.lt=function(p){return this.cmp(p)===-1},r.prototype.lten=function(p){return this.cmpn(p)<=0},r.prototype.lte=function(p){return this.cmp(p)<=0},r.prototype.eqn=function(p){return this.cmpn(p)===0},r.prototype.eq=function(p){return this.cmp(p)===0},r.red=function(p){return new Z(p)},r.prototype.toRed=function(p){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),p.convertTo(this)._forceRed(p)},r.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype._forceRed=function(p){return this.red=p,this},r.prototype.forceRed=function(p){return o(!this.red,"Already a number in reduction context"),this._forceRed(p)},r.prototype.redAdd=function(p){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,p)},r.prototype.redIAdd=function(p){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,p)},r.prototype.redSub=function(p){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,p)},r.prototype.redISub=function(p){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,p)},r.prototype.redShl=function(p){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,p)},r.prototype.redMul=function(p){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.mul(this,p)},r.prototype.redIMul=function(p){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.imul(this,p)},r.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(p){return o(this.red&&!p.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,p)};var j={k256:null,p224:null,p192:null,p25519:null};function $(g,p){this.name=g,this.p=new r(p,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}$.prototype._tmp=function(){var p=new r(null);return p.words=new Array(Math.ceil(this.n/13)),p},$.prototype.ireduce=function(p){var _=p,R;do this.split(_,this.tmp),_=this.imulK(_),_=_.iadd(this.tmp),R=_.bitLength();while(R>this.n);var B=R<this.n?-1:_.ucmp(this.p);return B===0?(_.words[0]=0,_.length=1):B>0?_.isub(this.p):_.strip!==void 0?_.strip():_._strip(),_},$.prototype.split=function(p,_){p.iushrn(this.n,0,_)},$.prototype.imulK=function(p){return p.imul(this.k)};function J(){$.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}d(J,$),J.prototype.split=function(p,_){for(var R=4194303,B=Math.min(p.length,9),P=0;P<B;P++)_.words[P]=p.words[P];if(_.length=B,p.length<=9){p.words[0]=0,p.length=1;return}var A=p.words[9];for(_.words[_.length++]=A&R,P=10;P<p.length;P++){var w=p.words[P]|0;p.words[P-10]=(w&R)<<4|A>>>22,A=w}A>>>=22,p.words[P-10]=A,A===0&&p.length>10?p.length-=10:p.length-=9},J.prototype.imulK=function(p){p.words[p.length]=0,p.words[p.length+1]=0,p.length+=2;for(var _=0,R=0;R<p.length;R++){var B=p.words[R]|0;_+=B*977,p.words[R]=_&67108863,_=B*64+(_/67108864|0)}return p.words[p.length-1]===0&&(p.length--,p.words[p.length-1]===0&&p.length--),p};function ie(){$.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}d(ie,$);function ne(){$.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}d(ne,$);function de(){$.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}d(de,$),de.prototype.imulK=function(p){for(var _=0,R=0;R<p.length;R++){var B=(p.words[R]|0)*19+_,P=B&67108863;B>>>=26,p.words[R]=P,_=B}return _!==0&&(p.words[p.length++]=_),p},r._prime=function(p){if(j[p])return j[p];var _;if(p==="k256")_=new J;else if(p==="p224")_=new ie;else if(p==="p192")_=new ne;else if(p==="p25519")_=new de;else throw new Error("Unknown prime "+p);return j[p]=_,_};function Z(g){if(typeof g=="string"){var p=r._prime(g);this.m=p.p,this.prime=p}else o(g.gtn(1),"modulus must be greater than 1"),this.m=g,this.prime=null}Z.prototype._verify1=function(p){o(p.negative===0,"red works only with positives"),o(p.red,"red works only with red numbers")},Z.prototype._verify2=function(p,_){o((p.negative|_.negative)===0,"red works only with positives"),o(p.red&&p.red===_.red,"red works only with red numbers")},Z.prototype.imod=function(p){return this.prime?this.prime.ireduce(p)._forceRed(this):(e(p,p.umod(this.m)._forceRed(this)),p)},Z.prototype.neg=function(p){return p.isZero()?p.clone():this.m.sub(p)._forceRed(this)},Z.prototype.add=function(p,_){this._verify2(p,_);var R=p.add(_);return R.cmp(this.m)>=0&&R.isub(this.m),R._forceRed(this)},Z.prototype.iadd=function(p,_){this._verify2(p,_);var R=p.iadd(_);return R.cmp(this.m)>=0&&R.isub(this.m),R},Z.prototype.sub=function(p,_){this._verify2(p,_);var R=p.sub(_);return R.cmpn(0)<0&&R.iadd(this.m),R._forceRed(this)},Z.prototype.isub=function(p,_){this._verify2(p,_);var R=p.isub(_);return R.cmpn(0)<0&&R.iadd(this.m),R},Z.prototype.shl=function(p,_){return this._verify1(p),this.imod(p.ushln(_))},Z.prototype.imul=function(p,_){return this._verify2(p,_),this.imod(p.imul(_))},Z.prototype.mul=function(p,_){return this._verify2(p,_),this.imod(p.mul(_))},Z.prototype.isqr=function(p){return this.imul(p,p.clone())},Z.prototype.sqr=function(p){return this.mul(p,p)},Z.prototype.sqrt=function(p){if(p.isZero())return p.clone();var _=this.m.andln(3);if(o(_%2===1),_===3){var R=this.m.add(new r(1)).iushrn(2);return this.pow(p,R)}for(var B=this.m.subn(1),P=0;!B.isZero()&&B.andln(1)===0;)P++,B.iushrn(1);o(!B.isZero());var A=new r(1).toRed(this),w=A.redNeg(),M=this.m.subn(1).iushrn(1),x=this.m.bitLength();for(x=new r(2*x*x).toRed(this);this.pow(x,M).cmp(w)!==0;)x.redIAdd(w);for(var L=this.pow(x,B),K=this.pow(p,B.addn(1).iushrn(1)),Q=this.pow(p,B),H=P;Q.cmp(A)!==0;){for(var N=Q,F=0;N.cmp(A)!==0;F++)N=N.redSqr();o(F<H);var ee=this.pow(L,new r(1).iushln(H-F-1));K=K.redMul(ee),L=ee.redSqr(),Q=Q.redMul(L),H=F}return K},Z.prototype.invm=function(p){var _=p._invmp(this.m);return _.negative!==0?(_.negative=0,this.imod(_).redNeg()):this.imod(_)},Z.prototype.pow=function(p,_){if(_.isZero())return new r(1).toRed(this);if(_.cmpn(1)===0)return p.clone();var R=4,B=new Array(1<<R);B[0]=new r(1).toRed(this),B[1]=p;for(var P=2;P<B.length;P++)B[P]=this.mul(B[P-1],p);var A=B[0],w=0,M=0,x=_.bitLength()%26;for(x===0&&(x=26),P=_.length-1;P>=0;P--){for(var L=_.words[P],K=x-1;K>=0;K--){var Q=L>>K&1;if(A!==B[0]&&(A=this.sqr(A)),Q===0&&w===0){M=0;continue}w<<=1,w|=Q,M++,!(M!==R&&(P!==0||K!==0))&&(A=this.mul(A,B[w]),M=0,w=0)}x=26}return A},Z.prototype.convertTo=function(p){var _=p.umod(this.m);return _===p?_.clone():_},Z.prototype.convertFrom=function(p){var _=p.clone();return _.red=null,_},r.mont=function(p){return new y(p)};function y(g){Z.call(this,g),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new r(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)}d(y,Z),y.prototype.convertTo=function(p){return this.imod(p.ushln(this.shift))},y.prototype.convertFrom=function(p){var _=this.imod(p.mul(this.rinv));return _.red=null,_},y.prototype.imul=function(p,_){if(p.isZero()||_.isZero())return p.words[0]=0,p.length=1,p;var R=p.imul(_),B=R.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=R.isub(B).iushrn(this.shift),A=P;return P.cmp(this.m)>=0?A=P.isub(this.m):P.cmpn(0)<0&&(A=P.iadd(this.m)),A._forceRed(this)},y.prototype.mul=function(p,_){if(p.isZero()||_.isZero())return new r(0)._forceRed(this);var R=p.mul(_),B=R.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),P=R.isub(B).iushrn(this.shift),A=P;return P.cmp(this.m)>=0?A=P.isub(this.m):P.cmpn(0)<0&&(A=P.iadd(this.m)),A._forceRed(this)},y.prototype.invm=function(p){var _=this.imod(p._invmp(this.m).mul(this.r2));return _._forceRed(this)}})(c,bn)})(bn$1)),bn$1.exports}var browserifyRsa,hasRequiredBrowserifyRsa;function requireBrowserifyRsa(){if(hasRequiredBrowserifyRsa)return browserifyRsa;hasRequiredBrowserifyRsa=1;var c=requireBn(),t=requireBrowser$b(),u=requireSafeBuffer$1().Buffer;function o(h){var f=h.modulus.byteLength(),a;do a=new c(t(f));while(a.cmp(h.modulus)>=0||!a.umod(h.prime1)||!a.umod(h.prime2));return a}function d(h){var f=o(h),a=f.toRed(c.mont(h.modulus)).redPow(new c(h.publicExponent)).fromRed();return{blinder:a,unblinder:f.invm(h.modulus)}}function r(h,f){var a=d(f),n=f.modulus.byteLength(),e=new c(h).mul(a.blinder).umod(f.modulus),s=e.toRed(c.mont(f.prime1)),l=e.toRed(c.mont(f.prime2)),v=f.coefficient,b=f.prime1,m=f.prime2,q=s.redPow(f.exponent1).fromRed(),E=l.redPow(f.exponent2).fromRed(),S=q.isub(E).imul(v).umod(b).imul(m);return E.iadd(S).imul(a.unblinder).umod(f.modulus).toArrayLike(u,"be",n)}return r.getr=o,browserifyRsa=r,browserifyRsa}var elliptic={};const version="6.6.1",require$$0={version};var utils$2={},utils$1={},hasRequiredUtils$3;function requireUtils$3(){return hasRequiredUtils$3||(hasRequiredUtils$3=1,(function(c){var t=c;function u(r,h){if(Array.isArray(r))return r.slice();if(!r)return[];var f=[];if(typeof r!="string"){for(var a=0;a<r.length;a++)f[a]=r[a]|0;return f}if(h==="hex"){r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r);for(var a=0;a<r.length;a+=2)f.push(parseInt(r[a]+r[a+1],16))}else for(var a=0;a<r.length;a++){var n=r.charCodeAt(a),e=n>>8,s=n&255;e?f.push(e,s):f.push(s)}return f}t.toArray=u;function o(r){return r.length===1?"0"+r:r}t.zero2=o;function d(r){for(var h="",f=0;f<r.length;f++)h+=o(r[f].toString(16));return h}t.toHex=d,t.encode=function(h,f){return f==="hex"?d(h):h}})(utils$1)),utils$1}var hasRequiredUtils$2;function requireUtils$2(){return hasRequiredUtils$2||(hasRequiredUtils$2=1,(function(c){var t=c,u=requireBn$1(),o=requireMinimalisticAssert(),d=requireUtils$3();t.assert=o,t.toArray=d.toArray,t.zero2=d.zero2,t.toHex=d.toHex,t.encode=d.encode;function r(e,s,l){var v=new Array(Math.max(e.bitLength(),l)+1),b;for(b=0;b<v.length;b+=1)v[b]=0;var m=1<<s+1,q=e.clone();for(b=0;b<v.length;b++){var E,S=q.andln(m-1);q.isOdd()?(S>(m>>1)-1?E=(m>>1)-S:E=S,q.isubn(E)):E=0,v[b]=E,q.iushrn(1)}return v}t.getNAF=r;function h(e,s){var l=[[],[]];e=e.clone(),s=s.clone();for(var v=0,b=0,m;e.cmpn(-v)>0||s.cmpn(-b)>0;){var q=e.andln(3)+v&3,E=s.andln(3)+b&3;q===3&&(q=-1),E===3&&(E=-1);var S;(q&1)===0?S=0:(m=e.andln(7)+v&7,(m===3||m===5)&&E===2?S=-q:S=q),l[0].push(S);var O;(E&1)===0?O=0:(m=s.andln(7)+b&7,(m===3||m===5)&&q===2?O=-E:O=E),l[1].push(O),2*v===S+1&&(v=1-v),2*b===O+1&&(b=1-b),e.iushrn(1),s.iushrn(1)}return l}t.getJSF=h;function f(e,s,l){var v="_"+s;e.prototype[s]=function(){return this[v]!==void 0?this[v]:this[v]=l.call(this)}}t.cachedProperty=f;function a(e){return typeof e=="string"?t.toArray(e,"hex"):e}t.parseBytes=a;function n(e){return new u(e,"hex","le")}t.intFromLE=n})(utils$2)),utils$2}var curve={},base$1,hasRequiredBase$1;function requireBase$1(){if(hasRequiredBase$1)return base$1;hasRequiredBase$1=1;var c=requireBn$1(),t=requireUtils$2(),u=t.getNAF,o=t.getJSF,d=t.assert;function r(f,a){this.type=f,this.p=new c(a.p,16),this.red=a.prime?c.red(a.prime):c.mont(this.p),this.zero=new c(0).toRed(this.red),this.one=new c(1).toRed(this.red),this.two=new c(2).toRed(this.red),this.n=a.n&&new c(a.n,16),this.g=a.g&&this.pointFromJSON(a.g,a.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 n=this.n&&this.p.div(this.n);!n||n.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}base$1=r,r.prototype.point=function(){throw new Error("Not implemented")},r.prototype.validate=function(){throw new Error("Not implemented")},r.prototype._fixedNafMul=function(a,n){d(a.precomputed);var e=a._getDoubles(),s=u(n,1,this._bitLength),l=(1<<e.step+1)-(e.step%2===0?2:1);l/=3;var v=[],b,m;for(b=0;b<s.length;b+=e.step){m=0;for(var q=b+e.step-1;q>=b;q--)m=(m<<1)+s[q];v.push(m)}for(var E=this.jpoint(null,null,null),S=this.jpoint(null,null,null),O=l;O>0;O--){for(b=0;b<v.length;b++)m=v[b],m===O?S=S.mixedAdd(e.points[b]):m===-O&&(S=S.mixedAdd(e.points[b].neg()));E=E.add(S)}return E.toP()},r.prototype._wnafMul=function(a,n){var e=4,s=a._getNAFPoints(e);e=s.wnd;for(var l=s.points,v=u(n,e,this._bitLength),b=this.jpoint(null,null,null),m=v.length-1;m>=0;m--){for(var q=0;m>=0&&v[m]===0;m--)q++;if(m>=0&&q++,b=b.dblp(q),m<0)break;var E=v[m];d(E!==0),a.type==="affine"?E>0?b=b.mixedAdd(l[E-1>>1]):b=b.mixedAdd(l[-E-1>>1].neg()):E>0?b=b.add(l[E-1>>1]):b=b.add(l[-E-1>>1].neg())}return a.type==="affine"?b.toP():b},r.prototype._wnafMulAdd=function(a,n,e,s,l){var v=this._wnafT1,b=this._wnafT2,m=this._wnafT3,q=0,E,S,O;for(E=0;E<s;E++){O=n[E];var D=O._getNAFPoints(a);v[E]=D.wnd,b[E]=D.points}for(E=s-1;E>=1;E-=2){var j=E-1,$=E;if(v[j]!==1||v[$]!==1){m[j]=u(e[j],v[j],this._bitLength),m[$]=u(e[$],v[$],this._bitLength),q=Math.max(m[j].length,q),q=Math.max(m[$].length,q);continue}var J=[n[j],null,null,n[$]];n[j].y.cmp(n[$].y)===0?(J[1]=n[j].add(n[$]),J[2]=n[j].toJ().mixedAdd(n[$].neg())):n[j].y.cmp(n[$].y.redNeg())===0?(J[1]=n[j].toJ().mixedAdd(n[$]),J[2]=n[j].add(n[$].neg())):(J[1]=n[j].toJ().mixedAdd(n[$]),J[2]=n[j].toJ().mixedAdd(n[$].neg()));var ie=[-3,-1,-5,-7,0,7,5,1,3],ne=o(e[j],e[$]);for(q=Math.max(ne[0].length,q),m[j]=new Array(q),m[$]=new Array(q),S=0;S<q;S++){var de=ne[0][S]|0,Z=ne[1][S]|0;m[j][S]=ie[(de+1)*3+(Z+1)],m[$][S]=0,b[j]=J}}var y=this.jpoint(null,null,null),g=this._wnafT4;for(E=q;E>=0;E--){for(var p=0;E>=0;){var _=!0;for(S=0;S<s;S++)g[S]=m[S][E]|0,g[S]!==0&&(_=!1);if(!_)break;p++,E--}if(E>=0&&p++,y=y.dblp(p),E<0)break;for(S=0;S<s;S++){var R=g[S];R!==0&&(R>0?O=b[S][R-1>>1]:R<0&&(O=b[S][-R-1>>1].neg()),O.type==="affine"?y=y.mixedAdd(O):y=y.add(O))}}for(E=0;E<s;E++)b[E]=null;return l?y:y.toP()};function h(f,a){this.curve=f,this.type=a,this.precomputed=null}return r.BasePoint=h,h.prototype.eq=function(){throw new Error("Not implemented")},h.prototype.validate=function(){return this.curve.validate(this)},r.prototype.decodePoint=function(a,n){a=t.toArray(a,n);var e=this.p.byteLength();if((a[0]===4||a[0]===6||a[0]===7)&&a.length-1===2*e){a[0]===6?d(a[a.length-1]%2===0):a[0]===7&&d(a[a.length-1]%2===1);var s=this.point(a.slice(1,1+e),a.slice(1+e,1+2*e));return s}else if((a[0]===2||a[0]===3)&&a.length-1===e)return this.pointFromX(a.slice(1,1+e),a[0]===3);throw new Error("Unknown point format")},h.prototype.encodeCompressed=function(a){return this.encode(a,!0)},h.prototype._encode=function(a){var n=this.curve.p.byteLength(),e=this.getX().toArray("be",n);return a?[this.getY().isEven()?2:3].concat(e):[4].concat(e,this.getY().toArray("be",n))},h.prototype.encode=function(a,n){return t.encode(this._encode(n),a)},h.prototype.precompute=function(a){if(this.precomputed)return this;var n={doubles:null,naf:null,beta:null};return n.naf=this._getNAFPoints(8),n.doubles=this._getDoubles(4,a),n.beta=this._getBeta(),this.precomputed=n,this},h.prototype._hasDoubles=function(a){if(!this.precomputed)return!1;var n=this.precomputed.doubles;return n?n.points.length>=Math.ceil((a.bitLength()+1)/n.step):!1},h.prototype._getDoubles=function(a,n){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var e=[this],s=this,l=0;l<n;l+=a){for(var v=0;v<a;v++)s=s.dbl();e.push(s)}return{step:a,points:e}},h.prototype._getNAFPoints=function(a){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var n=[this],e=(1<<a)-1,s=e===1?null:this.dbl(),l=1;l<e;l++)n[l]=n[l-1].add(s);return{wnd:a,points:n}},h.prototype._getBeta=function(){return null},h.prototype.dblp=function(a){for(var n=this,e=0;e<a;e++)n=n.dbl();return n},base$1}var short,hasRequiredShort;function requireShort(){if(hasRequiredShort)return short;hasRequiredShort=1;var c=requireUtils$2(),t=requireBn$1(),u=requireInherits_browser(),o=requireBase$1(),d=c.assert;function r(a){o.call(this,"short",a),this.a=new t(a.a,16).toRed(this.red),this.b=new t(a.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(a),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}u(r,o),short=r,r.prototype._getEndomorphism=function(n){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var e,s;if(n.beta)e=new t(n.beta,16).toRed(this.red);else{var l=this._getEndoRoots(this.p);e=l[0].cmp(l[1])<0?l[0]:l[1],e=e.toRed(this.red)}if(n.lambda)s=new t(n.lambda,16);else{var v=this._getEndoRoots(this.n);this.g.mul(v[0]).x.cmp(this.g.x.redMul(e))===0?s=v[0]:(s=v[1],d(this.g.mul(s).x.cmp(this.g.x.redMul(e))===0))}var b;return n.basis?b=n.basis.map(function(m){return{a:new t(m.a,16),b:new t(m.b,16)}}):b=this._getEndoBasis(s),{beta:e,lambda:s,basis:b}}},r.prototype._getEndoRoots=function(n){var e=n===this.p?this.red:t.mont(n),s=new t(2).toRed(e).redInvm(),l=s.redNeg(),v=new t(3).toRed(e).redNeg().redSqrt().redMul(s),b=l.redAdd(v).fromRed(),m=l.redSub(v).fromRed();return[b,m]},r.prototype._getEndoBasis=function(n){for(var e=this.n.ushrn(Math.floor(this.n.bitLength()/2)),s=n,l=this.n.clone(),v=new t(1),b=new t(0),m=new t(0),q=new t(1),E,S,O,D,j,$,J,ie=0,ne,de;s.cmpn(0)!==0;){var Z=l.div(s);ne=l.sub(Z.mul(s)),de=m.sub(Z.mul(v));var y=q.sub(Z.mul(b));if(!O&&ne.cmp(e)<0)E=J.neg(),S=v,O=ne.neg(),D=de;else if(O&&++ie===2)break;J=ne,l=s,s=ne,m=v,v=de,q=b,b=y}j=ne.neg(),$=de;var g=O.sqr().add(D.sqr()),p=j.sqr().add($.sqr());return p.cmp(g)>=0&&(j=E,$=S),O.negative&&(O=O.neg(),D=D.neg()),j.negative&&(j=j.neg(),$=$.neg()),[{a:O,b:D},{a:j,b:$}]},r.prototype._endoSplit=function(n){var e=this.endo.basis,s=e[0],l=e[1],v=l.b.mul(n).divRound(this.n),b=s.b.neg().mul(n).divRound(this.n),m=v.mul(s.a),q=b.mul(l.a),E=v.mul(s.b),S=b.mul(l.b),O=n.sub(m).sub(q),D=E.add(S).neg();return{k1:O,k2:D}},r.prototype.pointFromX=function(n,e){n=new t(n,16),n.red||(n=n.toRed(this.red));var s=n.redSqr().redMul(n).redIAdd(n.redMul(this.a)).redIAdd(this.b),l=s.redSqrt();if(l.redSqr().redSub(s).cmp(this.zero)!==0)throw new Error("invalid point");var v=l.fromRed().isOdd();return(e&&!v||!e&&v)&&(l=l.redNeg()),this.point(n,l)},r.prototype.validate=function(n){if(n.inf)return!0;var e=n.x,s=n.y,l=this.a.redMul(e),v=e.redSqr().redMul(e).redIAdd(l).redIAdd(this.b);return s.redSqr().redISub(v).cmpn(0)===0},r.prototype._endoWnafMulAdd=function(n,e,s){for(var l=this._endoWnafT1,v=this._endoWnafT2,b=0;b<n.length;b++){var m=this._endoSplit(e[b]),q=n[b],E=q._getBeta();m.k1.negative&&(m.k1.ineg(),q=q.neg(!0)),m.k2.negative&&(m.k2.ineg(),E=E.neg(!0)),l[b*2]=q,l[b*2+1]=E,v[b*2]=m.k1,v[b*2+1]=m.k2}for(var S=this._wnafMulAdd(1,l,v,b*2,s),O=0;O<b*2;O++)l[O]=null,v[O]=null;return S};function h(a,n,e,s){o.BasePoint.call(this,a,"affine"),n===null&&e===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new t(n,16),this.y=new t(e,16),s&&(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)}u(h,o.BasePoint),r.prototype.point=function(n,e,s){return new h(this,n,e,s)},r.prototype.pointFromJSON=function(n,e){return h.fromJSON(this,n,e)},h.prototype._getBeta=function(){if(this.curve.endo){var n=this.precomputed;if(n&&n.beta)return n.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(n){var s=this.curve,l=function(v){return s.point(v.x.redMul(s.endo.beta),v.y)};n.beta=e,e.precomputed={beta:null,naf:n.naf&&{wnd:n.naf.wnd,points:n.naf.points.map(l)},doubles:n.doubles&&{step:n.doubles.step,points:n.doubles.points.map(l)}}}return e}},h.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]},h.fromJSON=function(n,e,s){typeof e=="string"&&(e=JSON.parse(e));var l=n.point(e[0],e[1],s);if(!e[2])return l;function v(m){return n.point(m[0],m[1],s)}var b=e[2];return l.precomputed={beta:null,doubles:b.doubles&&{step:b.doubles.step,points:[l].concat(b.doubles.points.map(v))},naf:b.naf&&{wnd:b.naf.wnd,points:[l].concat(b.naf.points.map(v))}},l},h.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)+">"},h.prototype.isInfinity=function(){return this.inf},h.prototype.add=function(n){if(this.inf)return n;if(n.inf)return this;if(this.eq(n))return this.dbl();if(this.neg().eq(n))return this.curve.point(null,null);if(this.x.cmp(n.x)===0)return this.curve.point(null,null);var e=this.y.redSub(n.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(n.x).redInvm()));var s=e.redSqr().redISub(this.x).redISub(n.x),l=e.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,l)},h.prototype.dbl=function(){if(this.inf)return this;var n=this.y.redAdd(this.y);if(n.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,s=this.x.redSqr(),l=n.redInvm(),v=s.redAdd(s).redIAdd(s).redIAdd(e).redMul(l),b=v.redSqr().redISub(this.x.redAdd(this.x)),m=v.redMul(this.x.redSub(b)).redISub(this.y);return this.curve.point(b,m)},h.prototype.getX=function(){return this.x.fromRed()},h.prototype.getY=function(){return this.y.fromRed()},h.prototype.mul=function(n){return n=new t(n,16),this.isInfinity()?this:this._hasDoubles(n)?this.curve._fixedNafMul(this,n):this.curve.endo?this.curve._endoWnafMulAdd([this],[n]):this.curve._wnafMul(this,n)},h.prototype.mulAdd=function(n,e,s){var l=[this,e],v=[n,s];return this.curve.endo?this.curve._endoWnafMulAdd(l,v):this.curve._wnafMulAdd(1,l,v,2)},h.prototype.jmulAdd=function(n,e,s){var l=[this,e],v=[n,s];return this.curve.endo?this.curve._endoWnafMulAdd(l,v,!0):this.curve._wnafMulAdd(1,l,v,2,!0)},h.prototype.eq=function(n){return this===n||this.inf===n.inf&&(this.inf||this.x.cmp(n.x)===0&&this.y.cmp(n.y)===0)},h.prototype.neg=function(n){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(n&&this.precomputed){var s=this.precomputed,l=function(v){return v.neg()};e.precomputed={naf:s.naf&&{wnd:s.naf.wnd,points:s.naf.points.map(l)},doubles:s.doubles&&{step:s.doubles.step,points:s.doubles.points.map(l)}}}return e},h.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var n=this.curve.jpoint(this.x,this.y,this.curve.one);return n};function f(a,n,e,s){o.BasePoint.call(this,a,"jacobian"),n===null&&e===null&&s===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new t(0)):(this.x=new t(n,16),this.y=new t(e,16),this.z=new t(s,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}return u(f,o.BasePoint),r.prototype.jpoint=function(n,e,s){return new f(this,n,e,s)},f.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var n=this.z.redInvm(),e=n.redSqr(),s=this.x.redMul(e),l=this.y.redMul(e).redMul(n);return this.curve.point(s,l)},f.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},f.prototype.add=function(n){if(this.isInfinity())return n;if(n.isInfinity())return this;var e=n.z.redSqr(),s=this.z.redSqr(),l=this.x.redMul(e),v=n.x.redMul(s),b=this.y.redMul(e.redMul(n.z)),m=n.y.redMul(s.redMul(this.z)),q=l.redSub(v),E=b.redSub(m);if(q.cmpn(0)===0)return E.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var S=q.redSqr(),O=S.redMul(q),D=l.redMul(S),j=E.redSqr().redIAdd(O).redISub(D).redISub(D),$=E.redMul(D.redISub(j)).redISub(b.redMul(O)),J=this.z.redMul(n.z).redMul(q);return this.curve.jpoint(j,$,J)},f.prototype.mixedAdd=function(n){if(this.isInfinity())return n.toJ();if(n.isInfinity())return this;var e=this.z.redSqr(),s=this.x,l=n.x.redMul(e),v=this.y,b=n.y.redMul(e).redMul(this.z),m=s.redSub(l),q=v.redSub(b);if(m.cmpn(0)===0)return q.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var E=m.redSqr(),S=E.redMul(m),O=s.redMul(E),D=q.redSqr().redIAdd(S).redISub(O).redISub(O),j=q.redMul(O.redISub(D)).redISub(v.redMul(S)),$=this.z.redMul(m);return this.curve.jpoint(D,j,$)},f.prototype.dblp=function(n){if(n===0)return this;if(this.isInfinity())return this;if(!n)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var s=this;for(e=0;e<n;e++)s=s.dbl();return s}var l=this.curve.a,v=this.curve.tinv,b=this.x,m=this.y,q=this.z,E=q.redSqr().redSqr(),S=m.redAdd(m);for(e=0;e<n;e++){var O=b.redSqr(),D=S.redSqr(),j=D.redSqr(),$=O.redAdd(O).redIAdd(O).redIAdd(l.redMul(E)),J=b.redMul(D),ie=$.redSqr().redISub(J.redAdd(J)),ne=J.redISub(ie),de=$.redMul(ne);de=de.redIAdd(de).redISub(j);var Z=S.redMul(q);e+1<n&&(E=E.redMul(j)),b=ie,q=Z,S=de}return this.curve.jpoint(b,S.redMul(v),q)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},f.prototype._zeroDbl=function(){var n,e,s;if(this.zOne){var l=this.x.redSqr(),v=this.y.redSqr(),b=v.redSqr(),m=this.x.redAdd(v).redSqr().redISub(l).redISub(b);m=m.redIAdd(m);var q=l.redAdd(l).redIAdd(l),E=q.redSqr().redISub(m).redISub(m),S=b.redIAdd(b);S=S.redIAdd(S),S=S.redIAdd(S),n=E,e=q.redMul(m.redISub(E)).redISub(S),s=this.y.redAdd(this.y)}else{var O=this.x.redSqr(),D=this.y.redSqr(),j=D.redSqr(),$=this.x.redAdd(D).redSqr().redISub(O).redISub(j);$=$.redIAdd($);var J=O.redAdd(O).redIAdd(O),ie=J.redSqr(),ne=j.redIAdd(j);ne=ne.redIAdd(ne),ne=ne.redIAdd(ne),n=ie.redISub($).redISub($),e=J.redMul($.redISub(n)).redISub(ne),s=this.y.redMul(this.z),s=s.redIAdd(s)}return this.curve.jpoint(n,e,s)},f.prototype._threeDbl=function(){var n,e,s;if(this.zOne){var l=this.x.redSqr(),v=this.y.redSqr(),b=v.redSqr(),m=this.x.redAdd(v).redSqr().redISub(l).redISub(b);m=m.redIAdd(m);var q=l.redAdd(l).redIAdd(l).redIAdd(this.curve.a),E=q.redSqr().redISub(m).redISub(m);n=E;var S=b.redIAdd(b);S=S.redIAdd(S),S=S.redIAdd(S),e=q.redMul(m.redISub(E)).redISub(S),s=this.y.redAdd(this.y)}else{var O=this.z.redSqr(),D=this.y.redSqr(),j=this.x.redMul(D),$=this.x.redSub(O).redMul(this.x.redAdd(O));$=$.redAdd($).redIAdd($);var J=j.redIAdd(j);J=J.redIAdd(J);var ie=J.redAdd(J);n=$.redSqr().redISub(ie),s=this.y.redAdd(this.z).redSqr().redISub(D).redISub(O);var ne=D.redSqr();ne=ne.redIAdd(ne),ne=ne.redIAdd(ne),ne=ne.redIAdd(ne),e=$.redMul(J.redISub(n)).redISub(ne)}return this.curve.jpoint(n,e,s)},f.prototype._dbl=function(){var n=this.curve.a,e=this.x,s=this.y,l=this.z,v=l.redSqr().redSqr(),b=e.redSqr(),m=s.redSqr(),q=b.redAdd(b).redIAdd(b).redIAdd(n.redMul(v)),E=e.redAdd(e);E=E.redIAdd(E);var S=E.redMul(m),O=q.redSqr().redISub(S.redAdd(S)),D=S.redISub(O),j=m.redSqr();j=j.redIAdd(j),j=j.redIAdd(j),j=j.redIAdd(j);var $=q.redMul(D).redISub(j),J=s.redAdd(s).redMul(l);return this.curve.jpoint(O,$,J)},f.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var n=this.x.redSqr(),e=this.y.redSqr(),s=this.z.redSqr(),l=e.redSqr(),v=n.redAdd(n).redIAdd(n),b=v.redSqr(),m=this.x.redAdd(e).redSqr().redISub(n).redISub(l);m=m.redIAdd(m),m=m.redAdd(m).redIAdd(m),m=m.redISub(b);var q=m.redSqr(),E=l.redIAdd(l);E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E);var S=v.redIAdd(m).redSqr().redISub(b).redISub(q).redISub(E),O=e.redMul(S);O=O.redIAdd(O),O=O.redIAdd(O);var D=this.x.redMul(q).redISub(O);D=D.redIAdd(D),D=D.redIAdd(D);var j=this.y.redMul(S.redMul(E.redISub(S)).redISub(m.redMul(q)));j=j.redIAdd(j),j=j.redIAdd(j),j=j.redIAdd(j);var $=this.z.redAdd(m).redSqr().redISub(s).redISub(q);return this.curve.jpoint(D,j,$)},f.prototype.mul=function(n,e){return n=new t(n,e),this.curve._wnafMul(this,n)},f.prototype.eq=function(n){if(n.type==="affine")return this.eq(n.toJ());if(this===n)return!0;var e=this.z.redSqr(),s=n.z.redSqr();if(this.x.redMul(s).redISub(n.x.redMul(e)).cmpn(0)!==0)return!1;var l=e.redMul(this.z),v=s.redMul(n.z);return this.y.redMul(v).redISub(n.y.redMul(l)).cmpn(0)===0},f.prototype.eqXToP=function(n){var e=this.z.redSqr(),s=n.toRed(this.curve.red).redMul(e);if(this.x.cmp(s)===0)return!0;for(var l=n.clone(),v=this.curve.redN.redMul(e);;){if(l.iadd(this.curve.n),l.cmp(this.curve.p)>=0)return!1;if(s.redIAdd(v),this.x.cmp(s)===0)return!0}},f.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)+">"},f.prototype.isInfinity=function(){return this.z.cmpn(0)===0},short}var mont,hasRequiredMont;function requireMont(){if(hasRequiredMont)return mont;hasRequiredMont=1;var c=requireBn$1(),t=requireInherits_browser(),u=requireBase$1(),o=requireUtils$2();function d(h){u.call(this,"mont",h),this.a=new c(h.a,16).toRed(this.red),this.b=new c(h.b,16).toRed(this.red),this.i4=new c(4).toRed(this.red).redInvm(),this.two=new c(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}t(d,u),mont=d,d.prototype.validate=function(f){var a=f.normalize().x,n=a.redSqr(),e=n.redMul(a).redAdd(n.redMul(this.a)).redAdd(a),s=e.redSqrt();return s.redSqr().cmp(e)===0};function r(h,f,a){u.BasePoint.call(this,h,"projective"),f===null&&a===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new c(f,16),this.z=new c(a,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return t(r,u.BasePoint),d.prototype.decodePoint=function(f,a){return this.point(o.toArray(f,a),1)},d.prototype.point=function(f,a){return new r(this,f,a)},d.prototype.pointFromJSON=function(f){return r.fromJSON(this,f)},r.prototype.precompute=function(){},r.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},r.fromJSON=function(f,a){return new r(f,a[0],a[1]||f.one)},r.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)+">"},r.prototype.isInfinity=function(){return this.z.cmpn(0)===0},r.prototype.dbl=function(){var f=this.x.redAdd(this.z),a=f.redSqr(),n=this.x.redSub(this.z),e=n.redSqr(),s=a.redSub(e),l=a.redMul(e),v=s.redMul(e.redAdd(this.curve.a24.redMul(s)));return this.curve.point(l,v)},r.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},r.prototype.diffAdd=function(f,a){var n=this.x.redAdd(this.z),e=this.x.redSub(this.z),s=f.x.redAdd(f.z),l=f.x.redSub(f.z),v=l.redMul(n),b=s.redMul(e),m=a.z.redMul(v.redAdd(b).redSqr()),q=a.x.redMul(v.redISub(b).redSqr());return this.curve.point(m,q)},r.prototype.mul=function(f){for(var a=f.clone(),n=this,e=this.curve.point(null,null),s=this,l=[];a.cmpn(0)!==0;a.iushrn(1))l.push(a.andln(1));for(var v=l.length-1;v>=0;v--)l[v]===0?(n=n.diffAdd(e,s),e=e.dbl()):(e=n.diffAdd(e,s),n=n.dbl());return e},r.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},r.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},r.prototype.eq=function(f){return this.getX().cmp(f.getX())===0},r.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},r.prototype.getX=function(){return this.normalize(),this.x.fromRed()},mont}var edwards,hasRequiredEdwards;function requireEdwards(){if(hasRequiredEdwards)return edwards;hasRequiredEdwards=1;var c=requireUtils$2(),t=requireBn$1(),u=requireInherits_browser(),o=requireBase$1(),d=c.assert;function r(f){this.twisted=(f.a|0)!==1,this.mOneA=this.twisted&&(f.a|0)===-1,this.extended=this.mOneA,o.call(this,"edwards",f),this.a=new t(f.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new t(f.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new t(f.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),d(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(f.c|0)===1}u(r,o),edwards=r,r.prototype._mulA=function(a){return this.mOneA?a.redNeg():this.a.redMul(a)},r.prototype._mulC=function(a){return this.oneC?a:this.c.redMul(a)},r.prototype.jpoint=function(a,n,e,s){return this.point(a,n,e,s)},r.prototype.pointFromX=function(a,n){a=new t(a,16),a.red||(a=a.toRed(this.red));var e=a.redSqr(),s=this.c2.redSub(this.a.redMul(e)),l=this.one.redSub(this.c2.redMul(this.d).redMul(e)),v=s.redMul(l.redInvm()),b=v.redSqrt();if(b.redSqr().redSub(v).cmp(this.zero)!==0)throw new Error("invalid point");var m=b.fromRed().isOdd();return(n&&!m||!n&&m)&&(b=b.redNeg()),this.point(a,b)},r.prototype.pointFromY=function(a,n){a=new t(a,16),a.red||(a=a.toRed(this.red));var e=a.redSqr(),s=e.redSub(this.c2),l=e.redMul(this.d).redMul(this.c2).redSub(this.a),v=s.redMul(l.redInvm());if(v.cmp(this.zero)===0){if(n)throw new Error("invalid point");return this.point(this.zero,a)}var b=v.redSqrt();if(b.redSqr().redSub(v).cmp(this.zero)!==0)throw new Error("invalid point");return b.fromRed().isOdd()!==n&&(b=b.redNeg()),this.point(b,a)},r.prototype.validate=function(a){if(a.isInfinity())return!0;a.normalize();var n=a.x.redSqr(),e=a.y.redSqr(),s=n.redMul(this.a).redAdd(e),l=this.c2.redMul(this.one.redAdd(this.d.redMul(n).redMul(e)));return s.cmp(l)===0};function h(f,a,n,e,s){o.BasePoint.call(this,f,"projective"),a===null&&n===null&&e===null?(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 t(a,16),this.y=new t(n,16),this.z=e?new t(e,16):this.curve.one,this.t=s&&new t(s,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()))))}return u(h,o.BasePoint),r.prototype.pointFromJSON=function(a){return h.fromJSON(this,a)},r.prototype.point=function(a,n,e,s){return new h(this,a,n,e,s)},h.fromJSON=function(a,n){return new h(a,n[0],n[1],n[2])},h.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)+">"},h.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},h.prototype._extDbl=function(){var a=this.x.redSqr(),n=this.y.redSqr(),e=this.z.redSqr();e=e.redIAdd(e);var s=this.curve._mulA(a),l=this.x.redAdd(this.y).redSqr().redISub(a).redISub(n),v=s.redAdd(n),b=v.redSub(e),m=s.redSub(n),q=l.redMul(b),E=v.redMul(m),S=l.redMul(m),O=b.redMul(v);return this.curve.point(q,E,O,S)},h.prototype._projDbl=function(){var a=this.x.redAdd(this.y).redSqr(),n=this.x.redSqr(),e=this.y.redSqr(),s,l,v,b,m,q;if(this.curve.twisted){b=this.curve._mulA(n);var E=b.redAdd(e);this.zOne?(s=a.redSub(n).redSub(e).redMul(E.redSub(this.curve.two)),l=E.redMul(b.redSub(e)),v=E.redSqr().redSub(E).redSub(E)):(m=this.z.redSqr(),q=E.redSub(m).redISub(m),s=a.redSub(n).redISub(e).redMul(q),l=E.redMul(b.redSub(e)),v=E.redMul(q))}else b=n.redAdd(e),m=this.curve._mulC(this.z).redSqr(),q=b.redSub(m).redSub(m),s=this.curve._mulC(a.redISub(b)).redMul(q),l=this.curve._mulC(b).redMul(n.redISub(e)),v=b.redMul(q);return this.curve.point(s,l,v)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},h.prototype._extAdd=function(a){var n=this.y.redSub(this.x).redMul(a.y.redSub(a.x)),e=this.y.redAdd(this.x).redMul(a.y.redAdd(a.x)),s=this.t.redMul(this.curve.dd).redMul(a.t),l=this.z.redMul(a.z.redAdd(a.z)),v=e.redSub(n),b=l.redSub(s),m=l.redAdd(s),q=e.redAdd(n),E=v.redMul(b),S=m.redMul(q),O=v.redMul(q),D=b.redMul(m);return this.curve.point(E,S,D,O)},h.prototype._projAdd=function(a){var n=this.z.redMul(a.z),e=n.redSqr(),s=this.x.redMul(a.x),l=this.y.redMul(a.y),v=this.curve.d.redMul(s).redMul(l),b=e.redSub(v),m=e.redAdd(v),q=this.x.redAdd(this.y).redMul(a.x.redAdd(a.y)).redISub(s).redISub(l),E=n.redMul(b).redMul(q),S,O;return this.curve.twisted?(S=n.redMul(m).redMul(l.redSub(this.curve._mulA(s))),O=b.redMul(m)):(S=n.redMul(m).redMul(l.redSub(s)),O=this.curve._mulC(b).redMul(m)),this.curve.point(E,S,O)},h.prototype.add=function(a){return this.isInfinity()?a:a.isInfinity()?this:this.curve.extended?this._extAdd(a):this._projAdd(a)},h.prototype.mul=function(a){return this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve._wnafMul(this,a)},h.prototype.mulAdd=function(a,n,e){return this.curve._wnafMulAdd(1,[this,n],[a,e],2,!1)},h.prototype.jmulAdd=function(a,n,e){return this.curve._wnafMulAdd(1,[this,n],[a,e],2,!0)},h.prototype.normalize=function(){if(this.zOne)return this;var a=this.z.redInvm();return this.x=this.x.redMul(a),this.y=this.y.redMul(a),this.t&&(this.t=this.t.redMul(a)),this.z=this.curve.one,this.zOne=!0,this},h.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()},h.prototype.getY=function(){return this.normalize(),this.y.fromRed()},h.prototype.eq=function(a){return this===a||this.getX().cmp(a.getX())===0&&this.getY().cmp(a.getY())===0},h.prototype.eqXToP=function(a){var n=a.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(n)===0)return!0;for(var e=a.clone(),s=this.curve.redN.redMul(this.z);;){if(e.iadd(this.curve.n),e.cmp(this.curve.p)>=0)return!1;if(n.redIAdd(s),this.x.cmp(n)===0)return!0}},h.prototype.toP=h.prototype.normalize,h.prototype.mixedAdd=h.prototype.add,edwards}var hasRequiredCurve;function requireCurve(){return hasRequiredCurve||(hasRequiredCurve=1,(function(c){var t=c;t.base=requireBase$1(),t.short=requireShort(),t.mont=requireMont(),t.edwards=requireEdwards()})(curve)),curve}var curves={},hash={},utils={},hasRequiredUtils$1;function requireUtils$1(){if(hasRequiredUtils$1)return utils;hasRequiredUtils$1=1;var c=requireMinimalisticAssert(),t=requireInherits_browser();utils.inherits=t;function u(y,g){return(y.charCodeAt(g)&64512)!==55296||g<0||g+1>=y.length?!1:(y.charCodeAt(g+1)&64512)===56320}function o(y,g){if(Array.isArray(y))return y.slice();if(!y)return[];var p=[];if(typeof y=="string")if(g){if(g==="hex")for(y=y.replace(/[^a-z0-9]+/ig,""),y.length%2!==0&&(y="0"+y),R=0;R<y.length;R+=2)p.push(parseInt(y[R]+y[R+1],16))}else for(var _=0,R=0;R<y.length;R++){var B=y.charCodeAt(R);B<128?p[_++]=B:B<2048?(p[_++]=B>>6|192,p[_++]=B&63|128):u(y,R)?(B=65536+((B&1023)<<10)+(y.charCodeAt(++R)&1023),p[_++]=B>>18|240,p[_++]=B>>12&63|128,p[_++]=B>>6&63|128,p[_++]=B&63|128):(p[_++]=B>>12|224,p[_++]=B>>6&63|128,p[_++]=B&63|128)}else for(R=0;R<y.length;R++)p[R]=y[R]|0;return p}utils.toArray=o;function d(y){for(var g="",p=0;p<y.length;p++)g+=f(y[p].toString(16));return g}utils.toHex=d;function r(y){var g=y>>>24|y>>>8&65280|y<<8&16711680|(y&255)<<24;return g>>>0}utils.htonl=r;function h(y,g){for(var p="",_=0;_<y.length;_++){var R=y[_];g==="little"&&(R=r(R)),p+=a(R.toString(16))}return p}utils.toHex32=h;function f(y){return y.length===1?"0"+y:y}utils.zero2=f;function a(y){return y.length===7?"0"+y:y.length===6?"00"+y:y.length===5?"000"+y:y.length===4?"0000"+y:y.length===3?"00000"+y:y.length===2?"000000"+y:y.length===1?"0000000"+y:y}utils.zero8=a;function n(y,g,p,_){var R=p-g;c(R%4===0);for(var B=new Array(R/4),P=0,A=g;P<B.length;P++,A+=4){var w;_==="big"?w=y[A]<<24|y[A+1]<<16|y[A+2]<<8|y[A+3]:w=y[A+3]<<24|y[A+2]<<16|y[A+1]<<8|y[A],B[P]=w>>>0}return B}utils.join32=n;function e(y,g){for(var p=new Array(y.length*4),_=0,R=0;_<y.length;_++,R+=4){var B=y[_];g==="big"?(p[R]=B>>>24,p[R+1]=B>>>16&255,p[R+2]=B>>>8&255,p[R+3]=B&255):(p[R+3]=B>>>24,p[R+2]=B>>>16&255,p[R+1]=B>>>8&255,p[R]=B&255)}return p}utils.split32=e;function s(y,g){return y>>>g|y<<32-g}utils.rotr32=s;function l(y,g){return y<<g|y>>>32-g}utils.rotl32=l;function v(y,g){return y+g>>>0}utils.sum32=v;function b(y,g,p){return y+g+p>>>0}utils.sum32_3=b;function m(y,g,p,_){return y+g+p+_>>>0}utils.sum32_4=m;function q(y,g,p,_,R){return y+g+p+_+R>>>0}utils.sum32_5=q;function E(y,g,p,_){var R=y[g],B=y[g+1],P=_+B>>>0,A=(P<_?1:0)+p+R;y[g]=A>>>0,y[g+1]=P}utils.sum64=E;function S(y,g,p,_){var R=g+_>>>0,B=(R<g?1:0)+y+p;return B>>>0}utils.sum64_hi=S;function O(y,g,p,_){var R=g+_;return R>>>0}utils.sum64_lo=O;function D(y,g,p,_,R,B,P,A){var w=0,M=g;M=M+_>>>0,w+=M<g?1:0,M=M+B>>>0,w+=M<B?1:0,M=M+A>>>0,w+=M<A?1:0;var x=y+p+R+P+w;return x>>>0}utils.sum64_4_hi=D;function j(y,g,p,_,R,B,P,A){var w=g+_+B+A;return w>>>0}utils.sum64_4_lo=j;function $(y,g,p,_,R,B,P,A,w,M){var x=0,L=g;L=L+_>>>0,x+=L<g?1:0,L=L+B>>>0,x+=L<B?1:0,L=L+A>>>0,x+=L<A?1:0,L=L+M>>>0,x+=L<M?1:0;var K=y+p+R+P+w+x;return K>>>0}utils.sum64_5_hi=$;function J(y,g,p,_,R,B,P,A,w,M){var x=g+_+B+A+M;return x>>>0}utils.sum64_5_lo=J;function ie(y,g,p){var _=g<<32-p|y>>>p;return _>>>0}utils.rotr64_hi=ie;function ne(y,g,p){var _=y<<32-p|g>>>p;return _>>>0}utils.rotr64_lo=ne;function de(y,g,p){return y>>>p}utils.shr64_hi=de;function Z(y,g,p){var _=y<<32-p|g>>>p;return _>>>0}return utils.shr64_lo=Z,utils}var common$1={},hasRequiredCommon$1;function requireCommon$1(){if(hasRequiredCommon$1)return common$1;hasRequiredCommon$1=1;var c=requireUtils$1(),t=requireMinimalisticAssert();function u(){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}return common$1.BlockHash=u,u.prototype.update=function(d,r){if(d=c.toArray(d,r),this.pending?this.pending=this.pending.concat(d):this.pending=d,this.pendingTotal+=d.length,this.pending.length>=this._delta8){d=this.pending;var h=d.length%this._delta8;this.pending=d.slice(d.length-h,d.length),this.pending.length===0&&(this.pending=null),d=c.join32(d,0,d.length-h,this.endian);for(var f=0;f<d.length;f+=this._delta32)this._update(d,f,f+this._delta32)}return this},u.prototype.digest=function(d){return this.update(this._pad()),t(this.pending===null),this._digest(d)},u.prototype._pad=function(){var d=this.pendingTotal,r=this._delta8,h=r-(d+this.padLength)%r,f=new Array(h+this.padLength);f[0]=128;for(var a=1;a<h;a++)f[a]=0;if(d<<=3,this.endian==="big"){for(var n=8;n<this.padLength;n++)f[a++]=0;f[a++]=0,f[a++]=0,f[a++]=0,f[a++]=0,f[a++]=d>>>24&255,f[a++]=d>>>16&255,f[a++]=d>>>8&255,f[a++]=d&255}else for(f[a++]=d&255,f[a++]=d>>>8&255,f[a++]=d>>>16&255,f[a++]=d>>>24&255,f[a++]=0,f[a++]=0,f[a++]=0,f[a++]=0,n=8;n<this.padLength;n++)f[a++]=0;return f},common$1}var sha={},common={},hasRequiredCommon;function requireCommon(){if(hasRequiredCommon)return common;hasRequiredCommon=1;var c=requireUtils$1(),t=c.rotr32;function u(e,s,l,v){if(e===0)return o(s,l,v);if(e===1||e===3)return r(s,l,v);if(e===2)return d(s,l,v)}common.ft_1=u;function o(e,s,l){return e&s^~e&l}common.ch32=o;function d(e,s,l){return e&s^e&l^s&l}common.maj32=d;function r(e,s,l){return e^s^l}common.p32=r;function h(e){return t(e,2)^t(e,13)^t(e,22)}common.s0_256=h;function f(e){return t(e,6)^t(e,11)^t(e,25)}common.s1_256=f;function a(e){return t(e,7)^t(e,18)^e>>>3}common.g0_256=a;function n(e){return t(e,17)^t(e,19)^e>>>10}return common.g1_256=n,common}var _1,hasRequired_1;function require_1(){if(hasRequired_1)return _1;hasRequired_1=1;var c=requireUtils$1(),t=requireCommon$1(),u=requireCommon(),o=c.rotl32,d=c.sum32,r=c.sum32_5,h=u.ft_1,f=t.BlockHash,a=[1518500249,1859775393,2400959708,3395469782];function n(){if(!(this instanceof n))return new n;f.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return c.inherits(n,f),_1=n,n.blockSize=512,n.outSize=160,n.hmacStrength=80,n.padLength=64,n.prototype._update=function(s,l){for(var v=this.W,b=0;b<16;b++)v[b]=s[l+b];for(;b<v.length;b++)v[b]=o(v[b-3]^v[b-8]^v[b-14]^v[b-16],1);var m=this.h[0],q=this.h[1],E=this.h[2],S=this.h[3],O=this.h[4];for(b=0;b<v.length;b++){var D=~~(b/20),j=r(o(m,5),h(D,q,E,S),O,v[b],a[D]);O=S,S=E,E=o(q,30),q=m,m=j}this.h[0]=d(this.h[0],m),this.h[1]=d(this.h[1],q),this.h[2]=d(this.h[2],E),this.h[3]=d(this.h[3],S),this.h[4]=d(this.h[4],O)},n.prototype._digest=function(s){return s==="hex"?c.toHex32(this.h,"big"):c.split32(this.h,"big")},_1}var _256,hasRequired_256;function require_256(){if(hasRequired_256)return _256;hasRequired_256=1;var c=requireUtils$1(),t=requireCommon$1(),u=requireCommon(),o=requireMinimalisticAssert(),d=c.sum32,r=c.sum32_4,h=c.sum32_5,f=u.ch32,a=u.maj32,n=u.s0_256,e=u.s1_256,s=u.g0_256,l=u.g1_256,v=t.BlockHash,b=[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 m(){if(!(this instanceof m))return new m;v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b,this.W=new Array(64)}return c.inherits(m,v),_256=m,m.blockSize=512,m.outSize=256,m.hmacStrength=192,m.padLength=64,m.prototype._update=function(E,S){for(var O=this.W,D=0;D<16;D++)O[D]=E[S+D];for(;D<O.length;D++)O[D]=r(l(O[D-2]),O[D-7],s(O[D-15]),O[D-16]);var j=this.h[0],$=this.h[1],J=this.h[2],ie=this.h[3],ne=this.h[4],de=this.h[5],Z=this.h[6],y=this.h[7];for(o(this.k.length===O.length),D=0;D<O.length;D++){var g=h(y,e(ne),f(ne,de,Z),this.k[D],O[D]),p=d(n(j),a(j,$,J));y=Z,Z=de,de=ne,ne=d(ie,g),ie=J,J=$,$=j,j=d(g,p)}this.h[0]=d(this.h[0],j),this.h[1]=d(this.h[1],$),this.h[2]=d(this.h[2],J),this.h[3]=d(this.h[3],ie),this.h[4]=d(this.h[4],ne),this.h[5]=d(this.h[5],de),this.h[6]=d(this.h[6],Z),this.h[7]=d(this.h[7],y)},m.prototype._digest=function(E){return E==="hex"?c.toHex32(this.h,"big"):c.split32(this.h,"big")},_256}var _224,hasRequired_224;function require_224(){if(hasRequired_224)return _224;hasRequired_224=1;var c=requireUtils$1(),t=require_256();function u(){if(!(this instanceof u))return new u;t.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return c.inherits(u,t),_224=u,u.blockSize=512,u.outSize=224,u.hmacStrength=192,u.padLength=64,u.prototype._digest=function(d){return d==="hex"?c.toHex32(this.h.slice(0,7),"big"):c.split32(this.h.slice(0,7),"big")},_224}var _512,hasRequired_512;function require_512(){if(hasRequired_512)return _512;hasRequired_512=1;var c=requireUtils$1(),t=requireCommon$1(),u=requireMinimalisticAssert(),o=c.rotr64_hi,d=c.rotr64_lo,r=c.shr64_hi,h=c.shr64_lo,f=c.sum64,a=c.sum64_hi,n=c.sum64_lo,e=c.sum64_4_hi,s=c.sum64_4_lo,l=c.sum64_5_hi,v=c.sum64_5_lo,b=t.BlockHash,m=[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 q(){if(!(this instanceof q))return new q;b.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=m,this.W=new Array(160)}c.inherits(q,b),_512=q,q.blockSize=1024,q.outSize=512,q.hmacStrength=192,q.padLength=128,q.prototype._prepareBlock=function(p,_){for(var R=this.W,B=0;B<32;B++)R[B]=p[_+B];for(;B<R.length;B+=2){var P=Z(R[B-4],R[B-3]),A=y(R[B-4],R[B-3]),w=R[B-14],M=R[B-13],x=ne(R[B-30],R[B-29]),L=de(R[B-30],R[B-29]),K=R[B-32],Q=R[B-31];R[B]=e(P,A,w,M,x,L,K,Q),R[B+1]=s(P,A,w,M,x,L,K,Q)}},q.prototype._update=function(p,_){this._prepareBlock(p,_);var R=this.W,B=this.h[0],P=this.h[1],A=this.h[2],w=this.h[3],M=this.h[4],x=this.h[5],L=this.h[6],K=this.h[7],Q=this.h[8],H=this.h[9],N=this.h[10],F=this.h[11],ee=this.h[12],ae=this.h[13],z=this.h[14],G=this.h[15];u(this.k.length===R.length);for(var fe=0;fe<R.length;fe+=2){var me=z,xe=G,_e=J(Q,H),qe=ie(Q,H),Re=E(Q,H,N,F,ee),be=S(Q,H,N,F,ee,ae),Fe=this.k[fe],Be=this.k[fe+1],Me=R[fe],Te=R[fe+1],oe=l(me,xe,_e,qe,Re,be,Fe,Be,Me,Te),ce=v(me,xe,_e,qe,Re,be,Fe,Be,Me,Te);me=j(B,P),xe=$(B,P),_e=O(B,P,A,w,M),qe=D(B,P,A,w,M,x);var ge=a(me,xe,_e,qe),we=n(me,xe,_e,qe);z=ee,G=ae,ee=N,ae=F,N=Q,F=H,Q=a(L,K,oe,ce),H=n(K,K,oe,ce),L=M,K=x,M=A,x=w,A=B,w=P,B=a(oe,ce,ge,we),P=n(oe,ce,ge,we)}f(this.h,0,B,P),f(this.h,2,A,w),f(this.h,4,M,x),f(this.h,6,L,K),f(this.h,8,Q,H),f(this.h,10,N,F),f(this.h,12,ee,ae),f(this.h,14,z,G)},q.prototype._digest=function(p){return p==="hex"?c.toHex32(this.h,"big"):c.split32(this.h,"big")};function E(g,p,_,R,B){var P=g&_^~g&B;return P<0&&(P+=4294967296),P}function S(g,p,_,R,B,P){var A=p&R^~p&P;return A<0&&(A+=4294967296),A}function O(g,p,_,R,B){var P=g&_^g&B^_&B;return P<0&&(P+=4294967296),P}function D(g,p,_,R,B,P){var A=p&R^p&P^R&P;return A<0&&(A+=4294967296),A}function j(g,p){var _=o(g,p,28),R=o(p,g,2),B=o(p,g,7),P=_^R^B;return P<0&&(P+=4294967296),P}function $(g,p){var _=d(g,p,28),R=d(p,g,2),B=d(p,g,7),P=_^R^B;return P<0&&(P+=4294967296),P}function J(g,p){var _=o(g,p,14),R=o(g,p,18),B=o(p,g,9),P=_^R^B;return P<0&&(P+=4294967296),P}function ie(g,p){var _=d(g,p,14),R=d(g,p,18),B=d(p,g,9),P=_^R^B;return P<0&&(P+=4294967296),P}function ne(g,p){var _=o(g,p,1),R=o(g,p,8),B=r(g,p,7),P=_^R^B;return P<0&&(P+=4294967296),P}function de(g,p){var _=d(g,p,1),R=d(g,p,8),B=h(g,p,7),P=_^R^B;return P<0&&(P+=4294967296),P}function Z(g,p){var _=o(g,p,19),R=o(p,g,29),B=r(g,p,6),P=_^R^B;return P<0&&(P+=4294967296),P}function y(g,p){var _=d(g,p,19),R=d(p,g,29),B=h(g,p,6),P=_^R^B;return P<0&&(P+=4294967296),P}return _512}var _384,hasRequired_384;function require_384(){if(hasRequired_384)return _384;hasRequired_384=1;var c=requireUtils$1(),t=require_512();function u(){if(!(this instanceof u))return new u;t.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return c.inherits(u,t),_384=u,u.blockSize=1024,u.outSize=384,u.hmacStrength=192,u.padLength=128,u.prototype._digest=function(d){return d==="hex"?c.toHex32(this.h.slice(0,12),"big"):c.split32(this.h.slice(0,12),"big")},_384}var hasRequiredSha;function requireSha(){return hasRequiredSha||(hasRequiredSha=1,sha.sha1=require_1(),sha.sha224=require_224(),sha.sha256=require_256(),sha.sha384=require_384(),sha.sha512=require_512()),sha}var ripemd={},hasRequiredRipemd;function requireRipemd(){if(hasRequiredRipemd)return ripemd;hasRequiredRipemd=1;var c=requireUtils$1(),t=requireCommon$1(),u=c.rotl32,o=c.sum32,d=c.sum32_3,r=c.sum32_4,h=t.BlockHash;function f(){if(!(this instanceof f))return new f;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}c.inherits(f,h),ripemd.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(q,E){for(var S=this.h[0],O=this.h[1],D=this.h[2],j=this.h[3],$=this.h[4],J=S,ie=O,ne=D,de=j,Z=$,y=0;y<80;y++){var g=o(u(r(S,a(y,O,D,j),q[s[y]+E],n(y)),v[y]),$);S=$,$=j,j=u(D,10),D=O,O=g,g=o(u(r(J,a(79-y,ie,ne,de),q[l[y]+E],e(y)),b[y]),Z),J=Z,Z=de,de=u(ne,10),ne=ie,ie=g}g=d(this.h[1],D,de),this.h[1]=d(this.h[2],j,Z),this.h[2]=d(this.h[3],$,J),this.h[3]=d(this.h[4],S,ie),this.h[4]=d(this.h[0],O,ne),this.h[0]=g},f.prototype._digest=function(q){return q==="hex"?c.toHex32(this.h,"little"):c.split32(this.h,"little")};function a(m,q,E,S){return m<=15?q^E^S:m<=31?q&E|~q&S:m<=47?(q|~E)^S:m<=63?q&S|E&~S:q^(E|~S)}function n(m){return m<=15?0:m<=31?1518500249:m<=47?1859775393:m<=63?2400959708:2840853838}function e(m){return m<=15?1352829926:m<=31?1548603684:m<=47?1836072691:m<=63?2053994217:0}var s=[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],l=[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],b=[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];return ripemd}var hmac,hasRequiredHmac;function requireHmac(){if(hasRequiredHmac)return hmac;hasRequiredHmac=1;var c=requireUtils$1(),t=requireMinimalisticAssert();function u(o,d,r){if(!(this instanceof u))return new u(o,d,r);this.Hash=o,this.blockSize=o.blockSize/8,this.outSize=o.outSize/8,this.inner=null,this.outer=null,this._init(c.toArray(d,r))}return hmac=u,u.prototype._init=function(d){d.length>this.blockSize&&(d=new this.Hash().update(d).digest()),t(d.length<=this.blockSize);for(var r=d.length;r<this.blockSize;r++)d.push(0);for(r=0;r<d.length;r++)d[r]^=54;for(this.inner=new this.Hash().update(d),r=0;r<d.length;r++)d[r]^=106;this.outer=new this.Hash().update(d)},u.prototype.update=function(d,r){return this.inner.update(d,r),this},u.prototype.digest=function(d){return this.outer.update(this.inner.digest()),this.outer.digest(d)},hmac}var hasRequiredHash;function requireHash(){return hasRequiredHash||(hasRequiredHash=1,(function(c){var t=c;t.utils=requireUtils$1(),t.common=requireCommon$1(),t.sha=requireSha(),t.ripemd=requireRipemd(),t.hmac=requireHmac(),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160})(hash)),hash}var secp256k1,hasRequiredSecp256k1;function requireSecp256k1(){return hasRequiredSecp256k1||(hasRequiredSecp256k1=1,secp256k1={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"]]}}),secp256k1}var hasRequiredCurves;function requireCurves(){return hasRequiredCurves||(hasRequiredCurves=1,(function(c){var t=c,u=requireHash(),o=requireCurve(),d=requireUtils$2(),r=d.assert;function h(n){n.type==="short"?this.curve=new o.short(n):n.type==="edwards"?this.curve=new o.edwards(n):this.curve=new o.mont(n),this.g=this.curve.g,this.n=this.curve.n,this.hash=n.hash,r(this.g.validate(),"Invalid curve"),r(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}t.PresetCurve=h;function f(n,e){Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:function(){var s=new h(e);return Object.defineProperty(t,n,{configurable:!0,enumerable:!0,value:s}),s}})}f("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:u.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),f("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:u.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),f("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:u.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),f("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:u.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"]}),f("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:u.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"]}),f("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:u.sha256,gRed:!1,g:["9"]}),f("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:u.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var a;try{a=requireSecp256k1()}catch{a=void 0}f("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:u.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",a]})})(curves)),curves}var hmacDrbg,hasRequiredHmacDrbg;function requireHmacDrbg(){if(hasRequiredHmacDrbg)return hmacDrbg;hasRequiredHmacDrbg=1;var c=requireHash(),t=requireUtils$3(),u=requireMinimalisticAssert();function o(d){if(!(this instanceof o))return new o(d);this.hash=d.hash,this.predResist=!!d.predResist,this.outLen=this.hash.outSize,this.minEntropy=d.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var r=t.toArray(d.entropy,d.entropyEnc||"hex"),h=t.toArray(d.nonce,d.nonceEnc||"hex"),f=t.toArray(d.pers,d.persEnc||"hex");u(r.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(r,h,f)}return hmacDrbg=o,o.prototype._init=function(r,h,f){var a=r.concat(h).concat(f);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var n=0;n<this.V.length;n++)this.K[n]=0,this.V[n]=1;this._update(a),this._reseed=1,this.reseedInterval=281474976710656},o.prototype._hmac=function(){return new c.hmac(this.hash,this.K)},o.prototype._update=function(r){var h=this._hmac().update(this.V).update([0]);r&&(h=h.update(r)),this.K=h.digest(),this.V=this._hmac().update(this.V).digest(),r&&(this.K=this._hmac().update(this.V).update([1]).update(r).digest(),this.V=this._hmac().update(this.V).digest())},o.prototype.reseed=function(r,h,f,a){typeof h!="string"&&(a=f,f=h,h=null),r=t.toArray(r,h),f=t.toArray(f,a),u(r.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(r.concat(f||[])),this._reseed=1},o.prototype.generate=function(r,h,f,a){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof h!="string"&&(a=f,f=h,h=null),f&&(f=t.toArray(f,a||"hex"),this._update(f));for(var n=[];n.length<r;)this.V=this._hmac().update(this.V).digest(),n=n.concat(this.V);var e=n.slice(0,r);return this._update(f),this._reseed++,t.encode(e,h)},hmacDrbg}var key$1,hasRequiredKey$1;function requireKey$1(){if(hasRequiredKey$1)return key$1;hasRequiredKey$1=1;var c=requireBn$1(),t=requireUtils$2(),u=t.assert;function o(d,r){this.ec=d,this.priv=null,this.pub=null,r.priv&&this._importPrivate(r.priv,r.privEnc),r.pub&&this._importPublic(r.pub,r.pubEnc)}return key$1=o,o.fromPublic=function(r,h,f){return h instanceof o?h:new o(r,{pub:h,pubEnc:f})},o.fromPrivate=function(r,h,f){return h instanceof o?h:new o(r,{priv:h,privEnc:f})},o.prototype.validate=function(){var r=this.getPublic();return r.isInfinity()?{result:!1,reason:"Invalid public key"}:r.validate()?r.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(r,h){return typeof r=="string"&&(h=r,r=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),h?this.pub.encode(h,r):this.pub},o.prototype.getPrivate=function(r){return r==="hex"?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(r,h){this.priv=new c(r,h||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(r,h){if(r.x||r.y){this.ec.curve.type==="mont"?u(r.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&u(r.x&&r.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(r.x,r.y);return}this.pub=this.ec.curve.decodePoint(r,h)},o.prototype.derive=function(r){return r.validate()||u(r.validate(),"public point not validated"),r.mul(this.priv).getX()},o.prototype.sign=function(r,h,f){return this.ec.sign(r,this,h,f)},o.prototype.verify=function(r,h,f){return this.ec.verify(r,h,this,void 0,f)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},key$1}var signature$1,hasRequiredSignature$1;function requireSignature$1(){if(hasRequiredSignature$1)return signature$1;hasRequiredSignature$1=1;var c=requireBn$1(),t=requireUtils$2(),u=t.assert;function o(a,n){if(a instanceof o)return a;this._importDER(a,n)||(u(a.r&&a.s,"Signature without r or s"),this.r=new c(a.r,16),this.s=new c(a.s,16),a.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=a.recoveryParam)}signature$1=o;function d(){this.place=0}function r(a,n){var e=a[n.place++];if(!(e&128))return e;var s=e&15;if(s===0||s>4||a[n.place]===0)return!1;for(var l=0,v=0,b=n.place;v<s;v++,b++)l<<=8,l|=a[b],l>>>=0;return l<=127?!1:(n.place=b,l)}function h(a){for(var n=0,e=a.length-1;!a[n]&&!(a[n+1]&128)&&n<e;)n++;return n===0?a:a.slice(n)}o.prototype._importDER=function(n,e){n=t.toArray(n,e);var s=new d;if(n[s.place++]!==48)return!1;var l=r(n,s);if(l===!1||l+s.place!==n.length||n[s.place++]!==2)return!1;var v=r(n,s);if(v===!1||(n[s.place]&128)!==0)return!1;var b=n.slice(s.place,v+s.place);if(s.place+=v,n[s.place++]!==2)return!1;var m=r(n,s);if(m===!1||n.length!==m+s.place||(n[s.place]&128)!==0)return!1;var q=n.slice(s.place,m+s.place);if(b[0]===0)if(b[1]&128)b=b.slice(1);else return!1;if(q[0]===0)if(q[1]&128)q=q.slice(1);else return!1;return this.r=new c(b),this.s=new c(q),this.recoveryParam=null,!0};function f(a,n){if(n<128){a.push(n);return}var e=1+(Math.log(n)/Math.LN2>>>3);for(a.push(e|128);--e;)a.push(n>>>(e<<3)&255);a.push(n)}return o.prototype.toDER=function(n){var e=this.r.toArray(),s=this.s.toArray();for(e[0]&128&&(e=[0].concat(e)),s[0]&128&&(s=[0].concat(s)),e=h(e),s=h(s);!s[0]&&!(s[1]&128);)s=s.slice(1);var l=[2];f(l,e.length),l=l.concat(e),l.push(2),f(l,s.length);var v=l.concat(s),b=[48];return f(b,v.length),b=b.concat(v),t.encode(b,n)},signature$1}var ec,hasRequiredEc;function requireEc(){if(hasRequiredEc)return ec;hasRequiredEc=1;var c=requireBn$1(),t=requireHmacDrbg(),u=requireUtils$2(),o=requireCurves(),d=requireBrorand(),r=u.assert,h=requireKey$1(),f=requireSignature$1();function a(n){if(!(this instanceof a))return new a(n);typeof n=="string"&&(r(Object.prototype.hasOwnProperty.call(o,n),"Unknown curve "+n),n=o[n]),n instanceof o.PresetCurve&&(n={curve:n}),this.curve=n.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=n.curve.g,this.g.precompute(n.curve.n.bitLength()+1),this.hash=n.hash||n.curve.hash}return ec=a,a.prototype.keyPair=function(e){return new h(this,e)},a.prototype.keyFromPrivate=function(e,s){return h.fromPrivate(this,e,s)},a.prototype.keyFromPublic=function(e,s){return h.fromPublic(this,e,s)},a.prototype.genKeyPair=function(e){e||(e={});for(var s=new t({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||d(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),l=this.n.byteLength(),v=this.n.sub(new c(2));;){var b=new c(s.generate(l));if(!(b.cmp(v)>0))return b.iaddn(1),this.keyFromPrivate(b)}},a.prototype._truncateToN=function(e,s,l){var v;if(c.isBN(e)||typeof e=="number")e=new c(e,16),v=e.byteLength();else if(typeof e=="object")v=e.length,e=new c(e,16);else{var b=e.toString();v=b.length+1>>>1,e=new c(b,16)}typeof l!="number"&&(l=v*8);var m=l-this.n.bitLength();return m>0&&(e=e.ushrn(m)),!s&&e.cmp(this.n)>=0?e.sub(this.n):e},a.prototype.sign=function(e,s,l,v){if(typeof l=="object"&&(v=l,l=null),v||(v={}),typeof e!="string"&&typeof e!="number"&&!c.isBN(e)){r(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),r(e.length>>>0===e.length);for(var b=0;b<e.length;b++)r((e[b]&255)===e[b])}s=this.keyFromPrivate(s,l),e=this._truncateToN(e,!1,v.msgBitLength),r(!e.isNeg(),"Can not sign a negative message");var m=this.n.byteLength(),q=s.getPrivate().toArray("be",m),E=e.toArray("be",m);r(new c(E).eq(e),"Can not sign message");for(var S=new t({hash:this.hash,entropy:q,nonce:E,pers:v.pers,persEnc:v.persEnc||"utf8"}),O=this.n.sub(new c(1)),D=0;;D++){var j=v.k?v.k(D):new c(S.generate(this.n.byteLength()));if(j=this._truncateToN(j,!0),!(j.cmpn(1)<=0||j.cmp(O)>=0)){var $=this.g.mul(j);if(!$.isInfinity()){var J=$.getX(),ie=J.umod(this.n);if(ie.cmpn(0)!==0){var ne=j.invm(this.n).mul(ie.mul(s.getPrivate()).iadd(e));if(ne=ne.umod(this.n),ne.cmpn(0)!==0){var de=($.getY().isOdd()?1:0)|(J.cmp(ie)!==0?2:0);return v.canonical&&ne.cmp(this.nh)>0&&(ne=this.n.sub(ne),de^=1),new f({r:ie,s:ne,recoveryParam:de})}}}}}},a.prototype.verify=function(e,s,l,v,b){b||(b={}),e=this._truncateToN(e,!1,b.msgBitLength),l=this.keyFromPublic(l,v),s=new f(s,"hex");var m=s.r,q=s.s;if(m.cmpn(1)<0||m.cmp(this.n)>=0||q.cmpn(1)<0||q.cmp(this.n)>=0)return!1;var E=q.invm(this.n),S=E.mul(e).umod(this.n),O=E.mul(m).umod(this.n),D;return this.curve._maxwellTrick?(D=this.g.jmulAdd(S,l.getPublic(),O),D.isInfinity()?!1:D.eqXToP(m)):(D=this.g.mulAdd(S,l.getPublic(),O),D.isInfinity()?!1:D.getX().umod(this.n).cmp(m)===0)},a.prototype.recoverPubKey=function(n,e,s,l){r((3&s)===s,"The recovery param is more than two bits"),e=new f(e,l);var v=this.n,b=new c(n),m=e.r,q=e.s,E=s&1,S=s>>1;if(m.cmp(this.curve.p.umod(this.curve.n))>=0&&S)throw new Error("Unable to find sencond key candinate");S?m=this.curve.pointFromX(m.add(this.curve.n),E):m=this.curve.pointFromX(m,E);var O=e.r.invm(v),D=v.sub(b).mul(O).umod(v),j=q.mul(O).umod(v);return this.g.mulAdd(D,m,j)},a.prototype.getKeyRecoveryParam=function(n,e,s,l){if(e=new f(e,l),e.recoveryParam!==null)return e.recoveryParam;for(var v=0;v<4;v++){var b;try{b=this.recoverPubKey(n,e,v)}catch{continue}if(b.eq(s))return v}throw new Error("Unable to find valid recovery factor")},ec}var key,hasRequiredKey;function requireKey(){if(hasRequiredKey)return key;hasRequiredKey=1;var c=requireUtils$2(),t=c.assert,u=c.parseBytes,o=c.cachedProperty;function d(r,h){this.eddsa=r,this._secret=u(h.secret),r.isPoint(h.pub)?this._pub=h.pub:this._pubBytes=u(h.pub)}return d.fromPublic=function(h,f){return f instanceof d?f:new d(h,{pub:f})},d.fromSecret=function(h,f){return f instanceof d?f:new d(h,{secret:f})},d.prototype.secret=function(){return this._secret},o(d,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),o(d,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),o(d,"privBytes",function(){var h=this.eddsa,f=this.hash(),a=h.encodingLength-1,n=f.slice(0,h.encodingLength);return n[0]&=248,n[a]&=127,n[a]|=64,n}),o(d,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),o(d,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),o(d,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),d.prototype.sign=function(h){return t(this._secret,"KeyPair can only verify"),this.eddsa.sign(h,this)},d.prototype.verify=function(h,f){return this.eddsa.verify(h,f,this)},d.prototype.getSecret=function(h){return t(this._secret,"KeyPair is public only"),c.encode(this.secret(),h)},d.prototype.getPublic=function(h){return c.encode(this.pubBytes(),h)},key=d,key}var signature,hasRequiredSignature;function requireSignature(){if(hasRequiredSignature)return signature;hasRequiredSignature=1;var c=requireBn$1(),t=requireUtils$2(),u=t.assert,o=t.cachedProperty,d=t.parseBytes;function r(h,f){this.eddsa=h,typeof f!="object"&&(f=d(f)),Array.isArray(f)&&(u(f.length===h.encodingLength*2,"Signature has invalid size"),f={R:f.slice(0,h.encodingLength),S:f.slice(h.encodingLength)}),u(f.R&&f.S,"Signature without R or S"),h.isPoint(f.R)&&(this._R=f.R),f.S instanceof c&&(this._S=f.S),this._Rencoded=Array.isArray(f.R)?f.R:f.Rencoded,this._Sencoded=Array.isArray(f.S)?f.S:f.Sencoded}return o(r,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),o(r,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),o(r,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),o(r,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),r.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},r.prototype.toHex=function(){return t.encode(this.toBytes(),"hex").toUpperCase()},signature=r,signature}var eddsa,hasRequiredEddsa;function requireEddsa(){if(hasRequiredEddsa)return eddsa;hasRequiredEddsa=1;var c=requireHash(),t=requireCurves(),u=requireUtils$2(),o=u.assert,d=u.parseBytes,r=requireKey(),h=requireSignature();function f(a){if(o(a==="ed25519","only tested with ed25519 so far"),!(this instanceof f))return new f(a);a=t[a].curve,this.curve=a,this.g=a.g,this.g.precompute(a.n.bitLength()+1),this.pointClass=a.point().constructor,this.encodingLength=Math.ceil(a.n.bitLength()/8),this.hash=c.sha512}return eddsa=f,f.prototype.sign=function(n,e){n=d(n);var s=this.keyFromSecret(e),l=this.hashInt(s.messagePrefix(),n),v=this.g.mul(l),b=this.encodePoint(v),m=this.hashInt(b,s.pubBytes(),n).mul(s.priv()),q=l.add(m).umod(this.curve.n);return this.makeSignature({R:v,S:q,Rencoded:b})},f.prototype.verify=function(n,e,s){if(n=d(n),e=this.makeSignature(e),e.S().gte(e.eddsa.curve.n)||e.S().isNeg())return!1;var l=this.keyFromPublic(s),v=this.hashInt(e.Rencoded(),l.pubBytes(),n),b=this.g.mul(e.S()),m=e.R().add(l.pub().mul(v));return m.eq(b)},f.prototype.hashInt=function(){for(var n=this.hash(),e=0;e<arguments.length;e++)n.update(arguments[e]);return u.intFromLE(n.digest()).umod(this.curve.n)},f.prototype.keyFromPublic=function(n){return r.fromPublic(this,n)},f.prototype.keyFromSecret=function(n){return r.fromSecret(this,n)},f.prototype.makeSignature=function(n){return n instanceof h?n:new h(this,n)},f.prototype.encodePoint=function(n){var e=n.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=n.getX().isOdd()?128:0,e},f.prototype.decodePoint=function(n){n=u.parseBytes(n);var e=n.length-1,s=n.slice(0,e).concat(n[e]&-129),l=(n[e]&128)!==0,v=u.intFromLE(s);return this.curve.pointFromY(v,l)},f.prototype.encodeInt=function(n){return n.toArray("le",this.encodingLength)},f.prototype.decodeInt=function(n){return u.intFromLE(n)},f.prototype.isPoint=function(n){return n instanceof this.pointClass},eddsa}var hasRequiredElliptic;function requireElliptic(){return hasRequiredElliptic||(hasRequiredElliptic=1,(function(c){var t=c;t.version=require$$0.version,t.utils=requireUtils$2(),t.rand=requireBrorand(),t.curve=requireCurve(),t.curves=requireCurves(),t.ec=requireEc(),t.eddsa=requireEddsa()})(elliptic)),elliptic}var asn1$1={},asn1={},api={},vmBrowserify={},hasRequiredVmBrowserify;function requireVmBrowserify(){return hasRequiredVmBrowserify||(hasRequiredVmBrowserify=1,(function(exports$1){var indexOf=function(c,t){if(c.indexOf)return c.indexOf(t);for(var u=0;u<c.length;u++)if(c[u]===t)return u;return-1},Object_keys=function(c){if(Object.keys)return Object.keys(c);var t=[];for(var u in c)t.push(u);return t},forEach=function(c,t){if(c.forEach)return c.forEach(t);for(var u=0;u<c.length;u++)t(c[u],u,c)},defineProp=(function(){try{return Object.defineProperty({},"_",{}),function(c,t,u){Object.defineProperty(c,t,{writable:!0,enumerable:!1,configurable:!0,value:u})}}catch{return function(t,u,o){t[u]=o}}})(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports$1.Script=function(t){if(!(this instanceof Script))return new Script(t);this.code=t};Script.prototype.runInContext=function(c){if(!(c instanceof Context))throw new TypeError("needs a 'context' argument.");var t=document.createElement("iframe");t.style||(t.style={}),t.style.display="none",document.body.appendChild(t);var u=t.contentWindow,o=u.eval,d=u.execScript;!o&&d&&(d.call(u,"null"),o=u.eval),forEach(Object_keys(c),function(f){u[f]=c[f]}),forEach(globals,function(f){c[f]&&(u[f]=c[f])});var r=Object_keys(u),h=o.call(u,this.code);return forEach(Object_keys(u),function(f){(f in c||indexOf(r,f)===-1)&&(c[f]=u[f])}),forEach(globals,function(f){f in c||defineProp(c,f,u[f])}),document.body.removeChild(t),h},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(c){var t=Script.createContext(c),u=this.runInContext(t);return c&&forEach(Object_keys(t),function(o){c[o]=t[o]}),u},forEach(Object_keys(Script.prototype),function(c){exports$1[c]=Script[c]=function(t){var u=Script(t);return u[c].apply(u,[].slice.call(arguments,1))}}),exports$1.isContext=function(c){return c instanceof Context},exports$1.createScript=function(c){return exports$1.Script(c)},exports$1.createContext=Script.createContext=function(c){var t=new Context;return typeof c=="object"&&forEach(Object_keys(c),function(u){t[u]=c[u]}),t}})(vmBrowserify)),vmBrowserify}var hasRequiredApi;function requireApi(){return hasRequiredApi||(hasRequiredApi=1,(function(c){var t=requireAsn1$1(),u=requireInherits_browser(),o=c;o.define=function(h,f){return new d(h,f)};function d(r,h){this.name=r,this.body=h,this.decoders={},this.encoders={}}d.prototype._createNamed=function(h){var f;try{f=requireVmBrowserify().runInThisContext("(function "+this.name+`(entity) {
|
|
11
|
+
`)+" "+K[1]:K[0]+L+" "+x.join(", ")+" "+K[1]}s.types=requireTypes$1();function B(x){return Array.isArray(x)}s.isArray=B;function E(x){return typeof x=="boolean"}s.isBoolean=E;function S(x){return x===null}s.isNull=S;function O(x){return x==null}s.isNullOrUndefined=O;function D(x){return typeof x=="number"}s.isNumber=D;function $(x){return typeof x=="string"}s.isString=$;function H(x){return typeof x=="symbol"}s.isSymbol=H;function Y(x){return x===void 0}s.isUndefined=Y;function ie(x){return ne(x)&&p(x)==="[object RegExp]"}s.isRegExp=ie,s.types.isRegExp=ie;function ne(x){return typeof x=="object"&&x!==null}s.isObject=ne;function de(x){return ne(x)&&p(x)==="[object Date]"}s.isDate=de,s.types.isDate=de;function X(x){return ne(x)&&(p(x)==="[object Error]"||x instanceof Error)}s.isError=X,s.types.isNativeError=X;function y(x){return typeof x=="function"}s.isFunction=y;function g(x){return x===null||typeof x=="boolean"||typeof x=="number"||typeof x=="string"||typeof x=="symbol"||typeof x>"u"}s.isPrimitive=g,s.isBuffer=requireIsBufferBrowser();function p(x){return Object.prototype.toString.call(x)}function _(x){return x<10?"0"+x.toString(10):x.toString(10)}var R=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function q(){var x=new Date,L=[_(x.getHours()),_(x.getMinutes()),_(x.getSeconds())].join(":");return[x.getDate(),R[x.getMonth()],L].join(" ")}s.log=function(){console.log("%s - %s",q(),s.format.apply(s,arguments))},s.inherits=requireInherits_browser(),s._extend=function(x,L){if(!L||!ne(L))return x;for(var K=Object.keys(L),Q=K.length;Q--;)x[K[Q]]=L[K[Q]];return x};function T(x,L){return Object.prototype.hasOwnProperty.call(x,L)}var A=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;s.promisify=function(L){if(typeof L!="function")throw new TypeError('The "original" argument must be of type Function');if(A&&L[A]){var K=L[A];if(typeof K!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(K,A,{value:K,enumerable:!1,writable:!1,configurable:!0}),K}function K(){for(var Q,j,N=new Promise(function(ae,G){Q=ae,j=G}),F=[],ee=0;ee<arguments.length;ee++)F.push(arguments[ee]);F.push(function(ae,G){ae?j(ae):Q(G)});try{L.apply(this,F)}catch(ae){j(ae)}return N}return Object.setPrototypeOf(K,Object.getPrototypeOf(L)),A&&Object.defineProperty(K,A,{value:K,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(K,t(L))},s.promisify.custom=A;function w(x,L){if(!x){var K=new Error("Promise was rejected with a falsy value");K.reason=x,x=K}return L(x)}function M(x){if(typeof x!="function")throw new TypeError('The "original" argument must be of type Function');function L(){for(var K=[],Q=0;Q<arguments.length;Q++)K.push(arguments[Q]);var j=K.pop();if(typeof j!="function")throw new TypeError("The last argument must be of type Function");var N=this,F=function(){return j.apply(N,arguments)};x.apply(this,K).then(function(ee){process$1.nextTick(F.bind(null,null,ee))},function(ee){process$1.nextTick(w.bind(null,ee,F))})}return Object.setPrototypeOf(L,Object.getPrototypeOf(x)),Object.defineProperties(L,t(x)),L}s.callbackify=M})(util$1)),util$1}var buffer_list,hasRequiredBuffer_list;function requireBuffer_list(){if(hasRequiredBuffer_list)return buffer_list;hasRequiredBuffer_list=1;function s(b,m){var B=Object.keys(b);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(b);m&&(E=E.filter(function(S){return Object.getOwnPropertyDescriptor(b,S).enumerable})),B.push.apply(B,E)}return B}function t(b){for(var m=1;m<arguments.length;m++){var B=arguments[m]!=null?arguments[m]:{};m%2?s(Object(B),!0).forEach(function(E){f(b,E,B[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(b,Object.getOwnPropertyDescriptors(B)):s(Object(B)).forEach(function(E){Object.defineProperty(b,E,Object.getOwnPropertyDescriptor(B,E))})}return b}function f(b,m,B){return m=h(m),m in b?Object.defineProperty(b,m,{value:B,enumerable:!0,configurable:!0,writable:!0}):b[m]=B,b}function o(b,m){if(!(b instanceof m))throw new TypeError("Cannot call a class as a function")}function d(b,m){for(var B=0;B<m.length;B++){var E=m[B];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(b,h(E.key),E)}}function r(b,m,B){return m&&d(b.prototype,m),Object.defineProperty(b,"prototype",{writable:!1}),b}function h(b){var m=c(b,"string");return typeof m=="symbol"?m:String(m)}function c(b,m){if(typeof b!="object"||b===null)return b;var B=b[Symbol.toPrimitive];if(B!==void 0){var E=B.call(b,m);if(typeof E!="object")return E;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(b)}var n=requireDist(),a=n.Buffer,e=requireUtil$1(),u=e.inspect,l=u&&u.custom||"inspect";function v(b,m,B){a.prototype.copy.call(b,m,B)}return buffer_list=(function(){function b(){o(this,b),this.head=null,this.tail=null,this.length=0}return r(b,[{key:"push",value:function(B){var E={data:B,next:null};this.length>0?this.tail.next=E:this.head=E,this.tail=E,++this.length}},{key:"unshift",value:function(B){var E={data:B,next:this.head};this.length===0&&(this.tail=E),this.head=E,++this.length}},{key:"shift",value:function(){if(this.length!==0){var B=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,B}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(B){if(this.length===0)return"";for(var E=this.head,S=""+E.data;E=E.next;)S+=B+E.data;return S}},{key:"concat",value:function(B){if(this.length===0)return a.alloc(0);for(var E=a.allocUnsafe(B>>>0),S=this.head,O=0;S;)v(S.data,E,O),O+=S.data.length,S=S.next;return E}},{key:"consume",value:function(B,E){var S;return B<this.head.data.length?(S=this.head.data.slice(0,B),this.head.data=this.head.data.slice(B)):B===this.head.data.length?S=this.shift():S=E?this._getString(B):this._getBuffer(B),S}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(B){var E=this.head,S=1,O=E.data;for(B-=O.length;E=E.next;){var D=E.data,$=B>D.length?D.length:B;if($===D.length?O+=D:O+=D.slice(0,B),B-=$,B===0){$===D.length?(++S,E.next?this.head=E.next:this.head=this.tail=null):(this.head=E,E.data=D.slice($));break}++S}return this.length-=S,O}},{key:"_getBuffer",value:function(B){var E=a.allocUnsafe(B),S=this.head,O=1;for(S.data.copy(E),B-=S.data.length;S=S.next;){var D=S.data,$=B>D.length?D.length:B;if(D.copy(E,E.length-B,0,$),B-=$,B===0){$===D.length?(++O,S.next?this.head=S.next:this.head=this.tail=null):(this.head=S,S.data=D.slice($));break}++O}return this.length-=O,E}},{key:l,value:function(B,E){return u(this,t(t({},E),{},{depth:0,customInspect:!1}))}}]),b})(),buffer_list}var destroy_1$1,hasRequiredDestroy$1;function requireDestroy$1(){if(hasRequiredDestroy$1)return destroy_1$1;hasRequiredDestroy$1=1;function s(h,c){var n=this,a=this._readableState&&this._readableState.destroyed,e=this._writableState&&this._writableState.destroyed;return a||e?(c?c(h):h&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process$1.nextTick(d,this,h)):process$1.nextTick(d,this,h)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(h||null,function(u){!c&&u?n._writableState?n._writableState.errorEmitted?process$1.nextTick(f,n):(n._writableState.errorEmitted=!0,process$1.nextTick(t,n,u)):process$1.nextTick(t,n,u):c?(process$1.nextTick(f,n),c(u)):process$1.nextTick(f,n)}),this)}function t(h,c){d(h,c),f(h)}function f(h){h._writableState&&!h._writableState.emitClose||h._readableState&&!h._readableState.emitClose||h.emit("close")}function o(){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)}function d(h,c){h.emit("error",c)}function r(h,c){var n=h._readableState,a=h._writableState;n&&n.autoDestroy||a&&a.autoDestroy?h.destroy(c):h.emit("error",c)}return destroy_1$1={destroy:s,undestroy:o,errorOrDestroy:r},destroy_1$1}var errorsBrowser={},hasRequiredErrorsBrowser;function requireErrorsBrowser(){if(hasRequiredErrorsBrowser)return errorsBrowser;hasRequiredErrorsBrowser=1;function s(c,n){c.prototype=Object.create(n.prototype),c.prototype.constructor=c,c.__proto__=n}var t={};function f(c,n,a){a||(a=Error);function e(l,v,b){return typeof n=="string"?n:n(l,v,b)}var u=(function(l){s(v,l);function v(b,m,B){return l.call(this,e(b,m,B))||this}return v})(a);u.prototype.name=a.name,u.prototype.code=c,t[c]=u}function o(c,n){if(Array.isArray(c)){var a=c.length;return c=c.map(function(e){return String(e)}),a>2?"one of ".concat(n," ").concat(c.slice(0,a-1).join(", "),", or ")+c[a-1]:a===2?"one of ".concat(n," ").concat(c[0]," or ").concat(c[1]):"of ".concat(n," ").concat(c[0])}else return"of ".concat(n," ").concat(String(c))}function d(c,n,a){return c.substr(0,n.length)===n}function r(c,n,a){return(a===void 0||a>c.length)&&(a=c.length),c.substring(a-n.length,a)===n}function h(c,n,a){return typeof a!="number"&&(a=0),a+n.length>c.length?!1:c.indexOf(n,a)!==-1}return f("ERR_INVALID_OPT_VALUE",function(c,n){return'The value "'+n+'" is invalid for option "'+c+'"'},TypeError),f("ERR_INVALID_ARG_TYPE",function(c,n,a){var e;typeof n=="string"&&d(n,"not ")?(e="must not be",n=n.replace(/^not /,"")):e="must be";var u;if(r(c," argument"))u="The ".concat(c," ").concat(e," ").concat(o(n,"type"));else{var l=h(c,".")?"property":"argument";u='The "'.concat(c,'" ').concat(l," ").concat(e," ").concat(o(n,"type"))}return u+=". Received type ".concat(typeof a),u},TypeError),f("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),f("ERR_METHOD_NOT_IMPLEMENTED",function(c){return"The "+c+" method is not implemented"}),f("ERR_STREAM_PREMATURE_CLOSE","Premature close"),f("ERR_STREAM_DESTROYED",function(c){return"Cannot call "+c+" after a stream was destroyed"}),f("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),f("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),f("ERR_STREAM_WRITE_AFTER_END","write after end"),f("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),f("ERR_UNKNOWN_ENCODING",function(c){return"Unknown encoding: "+c},TypeError),f("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),errorsBrowser.codes=t,errorsBrowser}var state,hasRequiredState;function requireState(){if(hasRequiredState)return state;hasRequiredState=1;var s=requireErrorsBrowser().codes.ERR_INVALID_OPT_VALUE;function t(o,d,r){return o.highWaterMark!=null?o.highWaterMark:d?o[r]:null}function f(o,d,r,h){var c=t(d,h,r);if(c!=null){if(!(isFinite(c)&&Math.floor(c)===c)||c<0){var n=h?r:"highWaterMark";throw new s(n,c)}return Math.floor(c)}return o.objectMode?16:16*1024}return state={getHighWaterMark:f},state}var browser$a,hasRequiredBrowser$a;function requireBrowser$a(){if(hasRequiredBrowser$a)return browser$a;hasRequiredBrowser$a=1,browser$a=s;function s(f,o){if(t("noDeprecation"))return f;var d=!1;function r(){if(!d){if(t("throwDeprecation"))throw new Error(o);t("traceDeprecation")?console.trace(o):console.warn(o),d=!0}return f.apply(this,arguments)}return r}function t(f){try{if(!commonjsGlobal.localStorage)return!1}catch{return!1}var o=commonjsGlobal.localStorage[f];return o==null?!1:String(o).toLowerCase()==="true"}return browser$a}var _stream_writable$1,hasRequired_stream_writable$1;function require_stream_writable$1(){if(hasRequired_stream_writable$1)return _stream_writable$1;hasRequired_stream_writable$1=1,_stream_writable$1=ie;function s(j){var N=this;this.next=null,this.entry=null,this.finish=function(){Q(N,j)}}var t;ie.WritableState=H;var f={deprecate:requireBrowser$a()},o=requireStreamBrowser$1(),d=requireDist().Buffer,r=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function h(j){return d.from(j)}function c(j){return d.isBuffer(j)||j instanceof r}var n=requireDestroy$1(),a=requireState(),e=a.getHighWaterMark,u=requireErrorsBrowser().codes,l=u.ERR_INVALID_ARG_TYPE,v=u.ERR_METHOD_NOT_IMPLEMENTED,b=u.ERR_MULTIPLE_CALLBACK,m=u.ERR_STREAM_CANNOT_PIPE,B=u.ERR_STREAM_DESTROYED,E=u.ERR_STREAM_NULL_VALUES,S=u.ERR_STREAM_WRITE_AFTER_END,O=u.ERR_UNKNOWN_ENCODING,D=n.errorOrDestroy;requireInherits_browser()(ie,o);function $(){}function H(j,N,F){t=t||require_stream_duplex$1(),j=j||{},typeof F!="boolean"&&(F=N instanceof t),this.objectMode=!!j.objectMode,F&&(this.objectMode=this.objectMode||!!j.writableObjectMode),this.highWaterMark=e(this,j,"writableHighWaterMark",F),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var ee=j.decodeStrings===!1;this.decodeStrings=!ee,this.defaultEncoding=j.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(ae){R(N,ae)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=j.emitClose!==!1,this.autoDestroy=!!j.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new s(this)}H.prototype.getBuffer=function(){for(var N=this.bufferedRequest,F=[];N;)F.push(N),N=N.next;return F},(function(){try{Object.defineProperty(H.prototype,"buffer",{get:f.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Y;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Y=Function.prototype[Symbol.hasInstance],Object.defineProperty(ie,Symbol.hasInstance,{value:function(N){return Y.call(this,N)?!0:this!==ie?!1:N&&N._writableState instanceof H}})):Y=function(N){return N instanceof this};function ie(j){t=t||require_stream_duplex$1();var N=this instanceof t;if(!N&&!Y.call(ie,this))return new ie(j);this._writableState=new H(j,this,N),this.writable=!0,j&&(typeof j.write=="function"&&(this._write=j.write),typeof j.writev=="function"&&(this._writev=j.writev),typeof j.destroy=="function"&&(this._destroy=j.destroy),typeof j.final=="function"&&(this._final=j.final)),o.call(this)}ie.prototype.pipe=function(){D(this,new m)};function ne(j,N){var F=new S;D(j,F),process$1.nextTick(N,F)}function de(j,N,F,ee){var ae;return F===null?ae=new E:typeof F!="string"&&!N.objectMode&&(ae=new l("chunk",["string","Buffer"],F)),ae?(D(j,ae),process$1.nextTick(ee,ae),!1):!0}ie.prototype.write=function(j,N,F){var ee=this._writableState,ae=!1,G=!ee.objectMode&&c(j);return G&&!d.isBuffer(j)&&(j=h(j)),typeof N=="function"&&(F=N,N=null),G?N="buffer":N||(N=ee.defaultEncoding),typeof F!="function"&&(F=$),ee.ending?ne(this,F):(G||de(this,ee,j,F))&&(ee.pendingcb++,ae=y(this,ee,G,j,N,F)),ae},ie.prototype.cork=function(){this._writableState.corked++},ie.prototype.uncork=function(){var j=this._writableState;j.corked&&(j.corked--,!j.writing&&!j.corked&&!j.bufferProcessing&&j.bufferedRequest&&A(this,j))},ie.prototype.setDefaultEncoding=function(N){if(typeof N=="string"&&(N=N.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((N+"").toLowerCase())>-1))throw new O(N);return this._writableState.defaultEncoding=N,this},Object.defineProperty(ie.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function X(j,N,F){return!j.objectMode&&j.decodeStrings!==!1&&typeof N=="string"&&(N=d.from(N,F)),N}Object.defineProperty(ie.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function y(j,N,F,ee,ae,G){if(!F){var z=X(N,ee,ae);ee!==z&&(F=!0,ae="buffer",ee=z)}var fe=N.objectMode?1:ee.length;N.length+=fe;var me=N.length<N.highWaterMark;if(me||(N.needDrain=!0),N.writing||N.corked){var xe=N.lastBufferedRequest;N.lastBufferedRequest={chunk:ee,encoding:ae,isBuf:F,callback:G,next:null},xe?xe.next=N.lastBufferedRequest:N.bufferedRequest=N.lastBufferedRequest,N.bufferedRequestCount+=1}else g(j,N,!1,fe,ee,ae,G);return me}function g(j,N,F,ee,ae,G,z){N.writelen=ee,N.writecb=z,N.writing=!0,N.sync=!0,N.destroyed?N.onwrite(new B("write")):F?j._writev(ae,N.onwrite):j._write(ae,G,N.onwrite),N.sync=!1}function p(j,N,F,ee,ae){--N.pendingcb,F?(process$1.nextTick(ae,ee),process$1.nextTick(L,j,N),j._writableState.errorEmitted=!0,D(j,ee)):(ae(ee),j._writableState.errorEmitted=!0,D(j,ee),L(j,N))}function _(j){j.writing=!1,j.writecb=null,j.length-=j.writelen,j.writelen=0}function R(j,N){var F=j._writableState,ee=F.sync,ae=F.writecb;if(typeof ae!="function")throw new b;if(_(F),N)p(j,F,ee,N,ae);else{var G=w(F)||j.destroyed;!G&&!F.corked&&!F.bufferProcessing&&F.bufferedRequest&&A(j,F),ee?process$1.nextTick(q,j,F,G,ae):q(j,F,G,ae)}}function q(j,N,F,ee){F||T(j,N),N.pendingcb--,ee(),L(j,N)}function T(j,N){N.length===0&&N.needDrain&&(N.needDrain=!1,j.emit("drain"))}function A(j,N){N.bufferProcessing=!0;var F=N.bufferedRequest;if(j._writev&&F&&F.next){var ee=N.bufferedRequestCount,ae=new Array(ee),G=N.corkedRequestsFree;G.entry=F;for(var z=0,fe=!0;F;)ae[z]=F,F.isBuf||(fe=!1),F=F.next,z+=1;ae.allBuffers=fe,g(j,N,!0,N.length,ae,"",G.finish),N.pendingcb++,N.lastBufferedRequest=null,G.next?(N.corkedRequestsFree=G.next,G.next=null):N.corkedRequestsFree=new s(N),N.bufferedRequestCount=0}else{for(;F;){var me=F.chunk,xe=F.encoding,_e=F.callback,qe=N.objectMode?1:me.length;if(g(j,N,!1,qe,me,xe,_e),F=F.next,N.bufferedRequestCount--,N.writing)break}F===null&&(N.lastBufferedRequest=null)}N.bufferedRequest=F,N.bufferProcessing=!1}ie.prototype._write=function(j,N,F){F(new v("_write()"))},ie.prototype._writev=null,ie.prototype.end=function(j,N,F){var ee=this._writableState;return typeof j=="function"?(F=j,j=null,N=null):typeof N=="function"&&(F=N,N=null),j!=null&&this.write(j,N),ee.corked&&(ee.corked=1,this.uncork()),ee.ending||K(this,ee,F),this},Object.defineProperty(ie.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function w(j){return j.ending&&j.length===0&&j.bufferedRequest===null&&!j.finished&&!j.writing}function M(j,N){j._final(function(F){N.pendingcb--,F&&D(j,F),N.prefinished=!0,j.emit("prefinish"),L(j,N)})}function x(j,N){!N.prefinished&&!N.finalCalled&&(typeof j._final=="function"&&!N.destroyed?(N.pendingcb++,N.finalCalled=!0,process$1.nextTick(M,j,N)):(N.prefinished=!0,j.emit("prefinish")))}function L(j,N){var F=w(N);if(F&&(x(j,N),N.pendingcb===0&&(N.finished=!0,j.emit("finish"),N.autoDestroy))){var ee=j._readableState;(!ee||ee.autoDestroy&&ee.endEmitted)&&j.destroy()}return F}function K(j,N,F){N.ending=!0,L(j,N),F&&(N.finished?process$1.nextTick(F):j.once("finish",F)),N.ended=!0,j.writable=!1}function Q(j,N,F){var ee=j.entry;for(j.entry=null;ee;){var ae=ee.callback;N.pendingcb--,ae(F),ee=ee.next}N.corkedRequestsFree.next=j}return Object.defineProperty(ie.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(N){this._writableState&&(this._writableState.destroyed=N)}}),ie.prototype.destroy=n.destroy,ie.prototype._undestroy=n.undestroy,ie.prototype._destroy=function(j,N){N(j)},_stream_writable$1}var _stream_duplex$1,hasRequired_stream_duplex$1;function require_stream_duplex$1(){if(hasRequired_stream_duplex$1)return _stream_duplex$1;hasRequired_stream_duplex$1=1;var s=Object.keys||function(a){var e=[];for(var u in a)e.push(u);return e};_stream_duplex$1=h;var t=require_stream_readable$1(),f=require_stream_writable$1();requireInherits_browser()(h,t);for(var o=s(f.prototype),d=0;d<o.length;d++){var r=o[d];h.prototype[r]||(h.prototype[r]=f.prototype[r])}function h(a){if(!(this instanceof h))return new h(a);t.call(this,a),f.call(this,a),this.allowHalfOpen=!0,a&&(a.readable===!1&&(this.readable=!1),a.writable===!1&&(this.writable=!1),a.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",c)))}Object.defineProperty(h.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(h.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(h.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function c(){this._writableState.ended||process$1.nextTick(n,this)}function n(a){a.end()}return Object.defineProperty(h.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),_stream_duplex$1}var string_decoder={},hasRequiredString_decoder;function requireString_decoder(){if(hasRequiredString_decoder)return string_decoder;hasRequiredString_decoder=1;var s=requireSafeBuffer$1().Buffer,t=s.isEncoding||function(E){switch(E=""+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 f(E){if(!E)return"utf8";for(var S;;)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(S)return;E=(""+E).toLowerCase(),S=!0}}function o(E){var S=f(E);if(typeof S!="string"&&(s.isEncoding===t||!t(E)))throw new Error("Unknown encoding: "+E);return S||E}string_decoder.StringDecoder=d;function d(E){this.encoding=o(E);var S;switch(this.encoding){case"utf16le":this.text=u,this.end=l,S=4;break;case"utf8":this.fillLast=n,S=4;break;case"base64":this.text=v,this.end=b,S=3;break;default:this.write=m,this.end=B;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=s.allocUnsafe(S)}d.prototype.write=function(E){if(E.length===0)return"";var S,O;if(this.lastNeed){if(S=this.fillLast(E),S===void 0)return"";O=this.lastNeed,this.lastNeed=0}else O=0;return O<E.length?S?S+this.text(E,O):this.text(E,O):S||""},d.prototype.end=e,d.prototype.text=a,d.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};function r(E){return E<=127?0:E>>5===6?2:E>>4===14?3:E>>3===30?4:E>>6===2?-1:-2}function h(E,S,O){var D=S.length-1;if(D<O)return 0;var $=r(S[D]);return $>=0?($>0&&(E.lastNeed=$-1),$):--D<O||$===-2?0:($=r(S[D]),$>=0?($>0&&(E.lastNeed=$-2),$):--D<O||$===-2?0:($=r(S[D]),$>=0?($>0&&($===2?$=0:E.lastNeed=$-3),$):0))}function c(E,S,O){if((S[0]&192)!==128)return E.lastNeed=0,"�";if(E.lastNeed>1&&S.length>1){if((S[1]&192)!==128)return E.lastNeed=1,"�";if(E.lastNeed>2&&S.length>2&&(S[2]&192)!==128)return E.lastNeed=2,"�"}}function n(E){var S=this.lastTotal-this.lastNeed,O=c(this,E);if(O!==void 0)return O;if(this.lastNeed<=E.length)return E.copy(this.lastChar,S,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);E.copy(this.lastChar,S,0,E.length),this.lastNeed-=E.length}function a(E,S){var O=h(this,E,S);if(!this.lastNeed)return E.toString("utf8",S);this.lastTotal=O;var D=E.length-(O-this.lastNeed);return E.copy(this.lastChar,0,D),E.toString("utf8",S,D)}function e(E){var S=E&&E.length?this.write(E):"";return this.lastNeed?S+"�":S}function u(E,S){if((E.length-S)%2===0){var O=E.toString("utf16le",S);if(O){var D=O.charCodeAt(O.length-1);if(D>=55296&&D<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=E[E.length-2],this.lastChar[1]=E[E.length-1],O.slice(0,-1)}return O}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=E[E.length-1],E.toString("utf16le",S,E.length-1)}function l(E){var S=E&&E.length?this.write(E):"";if(this.lastNeed){var O=this.lastTotal-this.lastNeed;return S+this.lastChar.toString("utf16le",0,O)}return S}function v(E,S){var O=(E.length-S)%3;return O===0?E.toString("base64",S):(this.lastNeed=3-O,this.lastTotal=3,O===1?this.lastChar[0]=E[E.length-1]:(this.lastChar[0]=E[E.length-2],this.lastChar[1]=E[E.length-1]),E.toString("base64",S,E.length-O))}function b(E){var S=E&&E.length?this.write(E):"";return this.lastNeed?S+this.lastChar.toString("base64",0,3-this.lastNeed):S}function m(E){return E.toString(this.encoding)}function B(E){return E&&E.length?this.write(E):""}return string_decoder}var endOfStream,hasRequiredEndOfStream;function requireEndOfStream(){if(hasRequiredEndOfStream)return endOfStream;hasRequiredEndOfStream=1;var s=requireErrorsBrowser().codes.ERR_STREAM_PREMATURE_CLOSE;function t(r){var h=!1;return function(){if(!h){h=!0;for(var c=arguments.length,n=new Array(c),a=0;a<c;a++)n[a]=arguments[a];r.apply(this,n)}}}function f(){}function o(r){return r.setHeader&&typeof r.abort=="function"}function d(r,h,c){if(typeof h=="function")return d(r,null,h);h||(h={}),c=t(c||f);var n=h.readable||h.readable!==!1&&r.readable,a=h.writable||h.writable!==!1&&r.writable,e=function(){r.writable||l()},u=r._writableState&&r._writableState.finished,l=function(){a=!1,u=!0,n||c.call(r)},v=r._readableState&&r._readableState.endEmitted,b=function(){n=!1,v=!0,a||c.call(r)},m=function(O){c.call(r,O)},B=function(){var O;if(n&&!v)return(!r._readableState||!r._readableState.ended)&&(O=new s),c.call(r,O);if(a&&!u)return(!r._writableState||!r._writableState.ended)&&(O=new s),c.call(r,O)},E=function(){r.req.on("finish",l)};return o(r)?(r.on("complete",l),r.on("abort",B),r.req?E():r.on("request",E)):a&&!r._writableState&&(r.on("end",e),r.on("close",e)),r.on("end",b),r.on("finish",l),h.error!==!1&&r.on("error",m),r.on("close",B),function(){r.removeListener("complete",l),r.removeListener("abort",B),r.removeListener("request",E),r.req&&r.req.removeListener("finish",l),r.removeListener("end",e),r.removeListener("close",e),r.removeListener("finish",l),r.removeListener("end",b),r.removeListener("error",m),r.removeListener("close",B)}}return endOfStream=d,endOfStream}var async_iterator,hasRequiredAsync_iterator;function requireAsync_iterator(){if(hasRequiredAsync_iterator)return async_iterator;hasRequiredAsync_iterator=1;var s;function t(O,D,$){return D=f(D),D in O?Object.defineProperty(O,D,{value:$,enumerable:!0,configurable:!0,writable:!0}):O[D]=$,O}function f(O){var D=o(O,"string");return typeof D=="symbol"?D:String(D)}function o(O,D){if(typeof O!="object"||O===null)return O;var $=O[Symbol.toPrimitive];if($!==void 0){var H=$.call(O,D);if(typeof H!="object")return H;throw new TypeError("@@toPrimitive must return a primitive value.")}return(D==="string"?String:Number)(O)}var d=requireEndOfStream(),r=Symbol("lastResolve"),h=Symbol("lastReject"),c=Symbol("error"),n=Symbol("ended"),a=Symbol("lastPromise"),e=Symbol("handlePromise"),u=Symbol("stream");function l(O,D){return{value:O,done:D}}function v(O){var D=O[r];if(D!==null){var $=O[u].read();$!==null&&(O[a]=null,O[r]=null,O[h]=null,D(l($,!1)))}}function b(O){process$1.nextTick(v,O)}function m(O,D){return function($,H){O.then(function(){if(D[n]){$(l(void 0,!0));return}D[e]($,H)},H)}}var B=Object.getPrototypeOf(function(){}),E=Object.setPrototypeOf((s={get stream(){return this[u]},next:function(){var D=this,$=this[c];if($!==null)return Promise.reject($);if(this[n])return Promise.resolve(l(void 0,!0));if(this[u].destroyed)return new Promise(function(ne,de){process$1.nextTick(function(){D[c]?de(D[c]):ne(l(void 0,!0))})});var H=this[a],Y;if(H)Y=new Promise(m(H,this));else{var ie=this[u].read();if(ie!==null)return Promise.resolve(l(ie,!1));Y=new Promise(this[e])}return this[a]=Y,Y}},t(s,Symbol.asyncIterator,function(){return this}),t(s,"return",function(){var D=this;return new Promise(function($,H){D[u].destroy(null,function(Y){if(Y){H(Y);return}$(l(void 0,!0))})})}),s),B),S=function(D){var $,H=Object.create(E,($={},t($,u,{value:D,writable:!0}),t($,r,{value:null,writable:!0}),t($,h,{value:null,writable:!0}),t($,c,{value:null,writable:!0}),t($,n,{value:D._readableState.endEmitted,writable:!0}),t($,e,{value:function(ie,ne){var de=H[u].read();de?(H[a]=null,H[r]=null,H[h]=null,ie(l(de,!1))):(H[r]=ie,H[h]=ne)},writable:!0}),$));return H[a]=null,d(D,function(Y){if(Y&&Y.code!=="ERR_STREAM_PREMATURE_CLOSE"){var ie=H[h];ie!==null&&(H[a]=null,H[r]=null,H[h]=null,ie(Y)),H[c]=Y;return}var ne=H[r];ne!==null&&(H[a]=null,H[r]=null,H[h]=null,ne(l(void 0,!0))),H[n]=!0}),D.on("readable",b.bind(null,H)),H};return async_iterator=S,async_iterator}var fromBrowser,hasRequiredFromBrowser;function requireFromBrowser(){return hasRequiredFromBrowser||(hasRequiredFromBrowser=1,fromBrowser=function(){throw new Error("Readable.from is not available in the browser")}),fromBrowser}var _stream_readable$1,hasRequired_stream_readable$1;function require_stream_readable$1(){if(hasRequired_stream_readable$1)return _stream_readable$1;hasRequired_stream_readable$1=1,_stream_readable$1=ne;var s;ne.ReadableState=ie,requireEvents().EventEmitter;var t=function(z,fe){return z.listeners(fe).length},f=requireStreamBrowser$1(),o=requireDist().Buffer,d=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function r(G){return o.from(G)}function h(G){return o.isBuffer(G)||G instanceof d}var c=requireUtil$1(),n;c&&c.debuglog?n=c.debuglog("stream"):n=function(){};var a=requireBuffer_list(),e=requireDestroy$1(),u=requireState(),l=u.getHighWaterMark,v=requireErrorsBrowser().codes,b=v.ERR_INVALID_ARG_TYPE,m=v.ERR_STREAM_PUSH_AFTER_EOF,B=v.ERR_METHOD_NOT_IMPLEMENTED,E=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,S,O,D;requireInherits_browser()(ne,f);var $=e.errorOrDestroy,H=["error","close","destroy","pause","resume"];function Y(G,z,fe){if(typeof G.prependListener=="function")return G.prependListener(z,fe);!G._events||!G._events[z]?G.on(z,fe):Array.isArray(G._events[z])?G._events[z].unshift(fe):G._events[z]=[fe,G._events[z]]}function ie(G,z,fe){s=s||require_stream_duplex$1(),G=G||{},typeof fe!="boolean"&&(fe=z instanceof s),this.objectMode=!!G.objectMode,fe&&(this.objectMode=this.objectMode||!!G.readableObjectMode),this.highWaterMark=l(this,G,"readableHighWaterMark",fe),this.buffer=new a,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=G.emitClose!==!1,this.autoDestroy=!!G.autoDestroy,this.destroyed=!1,this.defaultEncoding=G.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,G.encoding&&(S||(S=requireString_decoder().StringDecoder),this.decoder=new S(G.encoding),this.encoding=G.encoding)}function ne(G){if(s=s||require_stream_duplex$1(),!(this instanceof ne))return new ne(G);var z=this instanceof s;this._readableState=new ie(G,this,z),this.readable=!0,G&&(typeof G.read=="function"&&(this._read=G.read),typeof G.destroy=="function"&&(this._destroy=G.destroy)),f.call(this)}Object.defineProperty(ne.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(z){this._readableState&&(this._readableState.destroyed=z)}}),ne.prototype.destroy=e.destroy,ne.prototype._undestroy=e.undestroy,ne.prototype._destroy=function(G,z){z(G)},ne.prototype.push=function(G,z){var fe=this._readableState,me;return fe.objectMode?me=!0:typeof G=="string"&&(z=z||fe.defaultEncoding,z!==fe.encoding&&(G=o.from(G,z),z=""),me=!0),de(this,G,z,!1,me)},ne.prototype.unshift=function(G){return de(this,G,null,!0,!1)};function de(G,z,fe,me,xe){n("readableAddChunk",z);var _e=G._readableState;if(z===null)_e.reading=!1,R(G,_e);else{var qe;if(xe||(qe=y(_e,z)),qe)$(G,qe);else if(_e.objectMode||z&&z.length>0)if(typeof z!="string"&&!_e.objectMode&&Object.getPrototypeOf(z)!==o.prototype&&(z=r(z)),me)_e.endEmitted?$(G,new E):X(G,_e,z,!0);else if(_e.ended)$(G,new m);else{if(_e.destroyed)return!1;_e.reading=!1,_e.decoder&&!fe?(z=_e.decoder.write(z),_e.objectMode||z.length!==0?X(G,_e,z,!1):A(G,_e)):X(G,_e,z,!1)}else me||(_e.reading=!1,A(G,_e))}return!_e.ended&&(_e.length<_e.highWaterMark||_e.length===0)}function X(G,z,fe,me){z.flowing&&z.length===0&&!z.sync?(z.awaitDrain=0,G.emit("data",fe)):(z.length+=z.objectMode?1:fe.length,me?z.buffer.unshift(fe):z.buffer.push(fe),z.needReadable&&q(G)),A(G,z)}function y(G,z){var fe;return!h(z)&&typeof z!="string"&&z!==void 0&&!G.objectMode&&(fe=new b("chunk",["string","Buffer","Uint8Array"],z)),fe}ne.prototype.isPaused=function(){return this._readableState.flowing===!1},ne.prototype.setEncoding=function(G){S||(S=requireString_decoder().StringDecoder);var z=new S(G);this._readableState.decoder=z,this._readableState.encoding=this._readableState.decoder.encoding;for(var fe=this._readableState.buffer.head,me="";fe!==null;)me+=z.write(fe.data),fe=fe.next;return this._readableState.buffer.clear(),me!==""&&this._readableState.buffer.push(me),this._readableState.length=me.length,this};var g=1073741824;function p(G){return G>=g?G=g:(G--,G|=G>>>1,G|=G>>>2,G|=G>>>4,G|=G>>>8,G|=G>>>16,G++),G}function _(G,z){return G<=0||z.length===0&&z.ended?0:z.objectMode?1:G!==G?z.flowing&&z.length?z.buffer.head.data.length:z.length:(G>z.highWaterMark&&(z.highWaterMark=p(G)),G<=z.length?G:z.ended?z.length:(z.needReadable=!0,0))}ne.prototype.read=function(G){n("read",G),G=parseInt(G,10);var z=this._readableState,fe=G;if(G!==0&&(z.emittedReadable=!1),G===0&&z.needReadable&&((z.highWaterMark!==0?z.length>=z.highWaterMark:z.length>0)||z.ended))return n("read: emitReadable",z.length,z.ended),z.length===0&&z.ended?F(this):q(this),null;if(G=_(G,z),G===0&&z.ended)return z.length===0&&F(this),null;var me=z.needReadable;n("need readable",me),(z.length===0||z.length-G<z.highWaterMark)&&(me=!0,n("length less than watermark",me)),z.ended||z.reading?(me=!1,n("reading or ended",me)):me&&(n("do read"),z.reading=!0,z.sync=!0,z.length===0&&(z.needReadable=!0),this._read(z.highWaterMark),z.sync=!1,z.reading||(G=_(fe,z)));var xe;return G>0?xe=N(G,z):xe=null,xe===null?(z.needReadable=z.length<=z.highWaterMark,G=0):(z.length-=G,z.awaitDrain=0),z.length===0&&(z.ended||(z.needReadable=!0),fe!==G&&z.ended&&F(this)),xe!==null&&this.emit("data",xe),xe};function R(G,z){if(n("onEofChunk"),!z.ended){if(z.decoder){var fe=z.decoder.end();fe&&fe.length&&(z.buffer.push(fe),z.length+=z.objectMode?1:fe.length)}z.ended=!0,z.sync?q(G):(z.needReadable=!1,z.emittedReadable||(z.emittedReadable=!0,T(G)))}}function q(G){var z=G._readableState;n("emitReadable",z.needReadable,z.emittedReadable),z.needReadable=!1,z.emittedReadable||(n("emitReadable",z.flowing),z.emittedReadable=!0,process$1.nextTick(T,G))}function T(G){var z=G._readableState;n("emitReadable_",z.destroyed,z.length,z.ended),!z.destroyed&&(z.length||z.ended)&&(G.emit("readable"),z.emittedReadable=!1),z.needReadable=!z.flowing&&!z.ended&&z.length<=z.highWaterMark,j(G)}function A(G,z){z.readingMore||(z.readingMore=!0,process$1.nextTick(w,G,z))}function w(G,z){for(;!z.reading&&!z.ended&&(z.length<z.highWaterMark||z.flowing&&z.length===0);){var fe=z.length;if(n("maybeReadMore read 0"),G.read(0),fe===z.length)break}z.readingMore=!1}ne.prototype._read=function(G){$(this,new B("_read()"))},ne.prototype.pipe=function(G,z){var fe=this,me=this._readableState;switch(me.pipesCount){case 0:me.pipes=G;break;case 1:me.pipes=[me.pipes,G];break;default:me.pipes.push(G);break}me.pipesCount+=1,n("pipe count=%d opts=%j",me.pipesCount,z);var xe=(!z||z.end!==!1)&&G!==process$1.stdout&&G!==process$1.stderr,_e=xe?Re:ge;me.endEmitted?process$1.nextTick(_e):fe.once("end",_e),G.on("unpipe",qe);function qe(we,Se){n("onunpipe"),we===fe&&Se&&Se.hasUnpiped===!1&&(Se.hasUnpiped=!0,Be())}function Re(){n("onend"),G.end()}var be=M(fe);G.on("drain",be);var Fe=!1;function Be(){n("cleanup"),G.removeListener("close",oe),G.removeListener("finish",ce),G.removeListener("drain",be),G.removeListener("error",Pe),G.removeListener("unpipe",qe),fe.removeListener("end",Re),fe.removeListener("end",ge),fe.removeListener("data",Me),Fe=!0,me.awaitDrain&&(!G._writableState||G._writableState.needDrain)&&be()}fe.on("data",Me);function Me(we){n("ondata");var Se=G.write(we);n("dest.write",Se),Se===!1&&((me.pipesCount===1&&me.pipes===G||me.pipesCount>1&&ae(me.pipes,G)!==-1)&&!Fe&&(n("false write response, pause",me.awaitDrain),me.awaitDrain++),fe.pause())}function Pe(we){n("onerror",we),ge(),G.removeListener("error",Pe),t(G,"error")===0&&$(G,we)}Y(G,"error",Pe);function oe(){G.removeListener("finish",ce),ge()}G.once("close",oe);function ce(){n("onfinish"),G.removeListener("close",oe),ge()}G.once("finish",ce);function ge(){n("unpipe"),fe.unpipe(G)}return G.emit("pipe",fe),me.flowing||(n("pipe resume"),fe.resume()),G};function M(G){return function(){var fe=G._readableState;n("pipeOnDrain",fe.awaitDrain),fe.awaitDrain&&fe.awaitDrain--,fe.awaitDrain===0&&t(G,"data")&&(fe.flowing=!0,j(G))}}ne.prototype.unpipe=function(G){var z=this._readableState,fe={hasUnpiped:!1};if(z.pipesCount===0)return this;if(z.pipesCount===1)return G&&G!==z.pipes?this:(G||(G=z.pipes),z.pipes=null,z.pipesCount=0,z.flowing=!1,G&&G.emit("unpipe",this,fe),this);if(!G){var me=z.pipes,xe=z.pipesCount;z.pipes=null,z.pipesCount=0,z.flowing=!1;for(var _e=0;_e<xe;_e++)me[_e].emit("unpipe",this,{hasUnpiped:!1});return this}var qe=ae(z.pipes,G);return qe===-1?this:(z.pipes.splice(qe,1),z.pipesCount-=1,z.pipesCount===1&&(z.pipes=z.pipes[0]),G.emit("unpipe",this,fe),this)},ne.prototype.on=function(G,z){var fe=f.prototype.on.call(this,G,z),me=this._readableState;return G==="data"?(me.readableListening=this.listenerCount("readable")>0,me.flowing!==!1&&this.resume()):G==="readable"&&!me.endEmitted&&!me.readableListening&&(me.readableListening=me.needReadable=!0,me.flowing=!1,me.emittedReadable=!1,n("on readable",me.length,me.reading),me.length?q(this):me.reading||process$1.nextTick(L,this)),fe},ne.prototype.addListener=ne.prototype.on,ne.prototype.removeListener=function(G,z){var fe=f.prototype.removeListener.call(this,G,z);return G==="readable"&&process$1.nextTick(x,this),fe},ne.prototype.removeAllListeners=function(G){var z=f.prototype.removeAllListeners.apply(this,arguments);return(G==="readable"||G===void 0)&&process$1.nextTick(x,this),z};function x(G){var z=G._readableState;z.readableListening=G.listenerCount("readable")>0,z.resumeScheduled&&!z.paused?z.flowing=!0:G.listenerCount("data")>0&&G.resume()}function L(G){n("readable nexttick read 0"),G.read(0)}ne.prototype.resume=function(){var G=this._readableState;return G.flowing||(n("resume"),G.flowing=!G.readableListening,K(this,G)),G.paused=!1,this};function K(G,z){z.resumeScheduled||(z.resumeScheduled=!0,process$1.nextTick(Q,G,z))}function Q(G,z){n("resume",z.reading),z.reading||G.read(0),z.resumeScheduled=!1,G.emit("resume"),j(G),z.flowing&&!z.reading&&G.read(0)}ne.prototype.pause=function(){return n("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(n("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function j(G){var z=G._readableState;for(n("flow",z.flowing);z.flowing&&G.read()!==null;);}ne.prototype.wrap=function(G){var z=this,fe=this._readableState,me=!1;G.on("end",function(){if(n("wrapped end"),fe.decoder&&!fe.ended){var qe=fe.decoder.end();qe&&qe.length&&z.push(qe)}z.push(null)}),G.on("data",function(qe){if(n("wrapped data"),fe.decoder&&(qe=fe.decoder.write(qe)),!(fe.objectMode&&qe==null)&&!(!fe.objectMode&&(!qe||!qe.length))){var Re=z.push(qe);Re||(me=!0,G.pause())}});for(var xe in G)this[xe]===void 0&&typeof G[xe]=="function"&&(this[xe]=(function(Re){return function(){return G[Re].apply(G,arguments)}})(xe));for(var _e=0;_e<H.length;_e++)G.on(H[_e],this.emit.bind(this,H[_e]));return this._read=function(qe){n("wrapped _read",qe),me&&(me=!1,G.resume())},this},typeof Symbol=="function"&&(ne.prototype[Symbol.asyncIterator]=function(){return O===void 0&&(O=requireAsync_iterator()),O(this)}),Object.defineProperty(ne.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(ne.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(ne.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(z){this._readableState&&(this._readableState.flowing=z)}}),ne._fromList=N,Object.defineProperty(ne.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function N(G,z){if(z.length===0)return null;var fe;return z.objectMode?fe=z.buffer.shift():!G||G>=z.length?(z.decoder?fe=z.buffer.join(""):z.buffer.length===1?fe=z.buffer.first():fe=z.buffer.concat(z.length),z.buffer.clear()):fe=z.buffer.consume(G,z.decoder),fe}function F(G){var z=G._readableState;n("endReadable",z.endEmitted),z.endEmitted||(z.ended=!0,process$1.nextTick(ee,z,G))}function ee(G,z){if(n("endReadableNT",G.endEmitted,G.length),!G.endEmitted&&G.length===0&&(G.endEmitted=!0,z.readable=!1,z.emit("end"),G.autoDestroy)){var fe=z._writableState;(!fe||fe.autoDestroy&&fe.finished)&&z.destroy()}}typeof Symbol=="function"&&(ne.from=function(G,z){return D===void 0&&(D=requireFromBrowser()),D(ne,G,z)});function ae(G,z){for(var fe=0,me=G.length;fe<me;fe++)if(G[fe]===z)return fe;return-1}return _stream_readable$1}var _stream_transform$1,hasRequired_stream_transform$1;function require_stream_transform$1(){if(hasRequired_stream_transform$1)return _stream_transform$1;hasRequired_stream_transform$1=1,_stream_transform$1=c;var s=requireErrorsBrowser().codes,t=s.ERR_METHOD_NOT_IMPLEMENTED,f=s.ERR_MULTIPLE_CALLBACK,o=s.ERR_TRANSFORM_ALREADY_TRANSFORMING,d=s.ERR_TRANSFORM_WITH_LENGTH_0,r=require_stream_duplex$1();requireInherits_browser()(c,r);function h(e,u){var l=this._transformState;l.transforming=!1;var v=l.writecb;if(v===null)return this.emit("error",new f);l.writechunk=null,l.writecb=null,u!=null&&this.push(u),v(e);var b=this._readableState;b.reading=!1,(b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);r.call(this,e),this._transformState={afterTransform:h.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",n)}function n(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(u,l){a(e,u,l)}):a(this,null,null)}c.prototype.push=function(e,u){return this._transformState.needTransform=!1,r.prototype.push.call(this,e,u)},c.prototype._transform=function(e,u,l){l(new t("_transform()"))},c.prototype._write=function(e,u,l){var v=this._transformState;if(v.writecb=l,v.writechunk=e,v.writeencoding=u,!v.transforming){var b=this._readableState;(v.needTransform||b.needReadable||b.length<b.highWaterMark)&&this._read(b.highWaterMark)}},c.prototype._read=function(e){var u=this._transformState;u.writechunk!==null&&!u.transforming?(u.transforming=!0,this._transform(u.writechunk,u.writeencoding,u.afterTransform)):u.needTransform=!0},c.prototype._destroy=function(e,u){r.prototype._destroy.call(this,e,function(l){u(l)})};function a(e,u,l){if(u)return e.emit("error",u);if(l!=null&&e.push(l),e._writableState.length)throw new d;if(e._transformState.transforming)throw new o;return e.push(null)}return _stream_transform$1}var _stream_passthrough$1,hasRequired_stream_passthrough$1;function require_stream_passthrough$1(){if(hasRequired_stream_passthrough$1)return _stream_passthrough$1;hasRequired_stream_passthrough$1=1,_stream_passthrough$1=t;var s=require_stream_transform$1();requireInherits_browser()(t,s);function t(f){if(!(this instanceof t))return new t(f);s.call(this,f)}return t.prototype._transform=function(f,o,d){d(null,f)},_stream_passthrough$1}var pipeline_1,hasRequiredPipeline;function requirePipeline(){if(hasRequiredPipeline)return pipeline_1;hasRequiredPipeline=1;var s;function t(l){var v=!1;return function(){v||(v=!0,l.apply(void 0,arguments))}}var f=requireErrorsBrowser().codes,o=f.ERR_MISSING_ARGS,d=f.ERR_STREAM_DESTROYED;function r(l){if(l)throw l}function h(l){return l.setHeader&&typeof l.abort=="function"}function c(l,v,b,m){m=t(m);var B=!1;l.on("close",function(){B=!0}),s===void 0&&(s=requireEndOfStream()),s(l,{readable:v,writable:b},function(S){if(S)return m(S);B=!0,m()});var E=!1;return function(S){if(!B&&!E){if(E=!0,h(l))return l.abort();if(typeof l.destroy=="function")return l.destroy();m(S||new d("pipe"))}}}function n(l){l()}function a(l,v){return l.pipe(v)}function e(l){return!l.length||typeof l[l.length-1]!="function"?r:l.pop()}function u(){for(var l=arguments.length,v=new Array(l),b=0;b<l;b++)v[b]=arguments[b];var m=e(v);if(Array.isArray(v[0])&&(v=v[0]),v.length<2)throw new o("streams");var B,E=v.map(function(S,O){var D=O<v.length-1,$=O>0;return c(S,D,$,function(H){B||(B=H),H&&E.forEach(n),!D&&(E.forEach(n),m(B))})});return v.reduce(a)}return pipeline_1=u,pipeline_1}var streamBrowserify,hasRequiredStreamBrowserify;function requireStreamBrowserify(){if(hasRequiredStreamBrowserify)return streamBrowserify;hasRequiredStreamBrowserify=1,streamBrowserify=f;var s=requireEvents().EventEmitter,t=requireInherits_browser();t(f,s),f.Readable=require_stream_readable$1(),f.Writable=require_stream_writable$1(),f.Duplex=require_stream_duplex$1(),f.Transform=require_stream_transform$1(),f.PassThrough=require_stream_passthrough$1(),f.finished=requireEndOfStream(),f.pipeline=requirePipeline(),f.Stream=f;function f(){s.call(this)}return f.prototype.pipe=function(o,d){var r=this;function h(v){o.writable&&o.write(v)===!1&&r.pause&&r.pause()}r.on("data",h);function c(){r.readable&&r.resume&&r.resume()}o.on("drain",c),!o._isStdio&&(!d||d.end!==!1)&&(r.on("end",a),r.on("close",e));var n=!1;function a(){n||(n=!0,o.end())}function e(){n||(n=!0,typeof o.destroy=="function"&&o.destroy())}function u(v){if(l(),s.listenerCount(this,"error")===0)throw v}r.on("error",u),o.on("error",u);function l(){r.removeListener("data",h),o.removeListener("drain",c),r.removeListener("end",a),r.removeListener("close",e),r.removeListener("error",u),o.removeListener("error",u),r.removeListener("end",l),r.removeListener("close",l),o.removeListener("close",l)}return r.on("end",l),r.on("close",l),o.on("close",l),o.emit("pipe",r),o},streamBrowserify}var hashBase$1,hasRequiredHashBase$1;function requireHashBase$1(){if(hasRequiredHashBase$1)return hashBase$1;hasRequiredHashBase$1=1;var s=requireSafeBuffer$1().Buffer,t=requireStreamBrowserify().Transform,f=requireInherits_browser();function o(c){t.call(this),this._block=s.allocUnsafe(c),this._blockSize=c,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}f(o,t),o.prototype._transform=function(c,n,a){var e=null;try{this.update(c,n)}catch(u){e=u}a(e)},o.prototype._flush=function(c){var n=null;try{this.push(this.digest())}catch(a){n=a}c(n)};var d=typeof Uint8Array<"u",r=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(s.prototype instanceof Uint8Array||s.TYPED_ARRAY_SUPPORT);function h(c,n){if(c instanceof s)return c;if(typeof c=="string")return s.from(c,n);if(r&&ArrayBuffer.isView(c)){if(c.byteLength===0)return s.alloc(0);var a=s.from(c.buffer,c.byteOffset,c.byteLength);if(a.byteLength===c.byteLength)return a}if(d&&c instanceof Uint8Array||s.isBuffer(c)&&c.constructor&&typeof c.constructor.isBuffer=="function"&&c.constructor.isBuffer(c))return s.from(c);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}return o.prototype.update=function(c,n){if(this._finalized)throw new Error("Digest already called");c=h(c,n);for(var a=this._block,e=0;this._blockOffset+c.length-e>=this._blockSize;){for(var u=this._blockOffset;u<this._blockSize;)a[u++]=c[e++];this._update(),this._blockOffset=0}for(;e<c.length;)a[this._blockOffset++]=c[e++];for(var l=0,v=c.length*8;v>0;++l)this._length[l]+=v,v=this._length[l]/4294967296|0,v>0&&(this._length[l]-=4294967296*v);return this},o.prototype._update=function(){throw new Error("_update is not implemented")},o.prototype.digest=function(c){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var n=this._digest();c!==void 0&&(n=n.toString(c)),this._block.fill(0),this._blockOffset=0;for(var a=0;a<4;++a)this._length[a]=0;return n},o.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase$1=o,hashBase$1}var md5_js,hasRequiredMd5_js;function requireMd5_js(){if(hasRequiredMd5_js)return md5_js;hasRequiredMd5_js=1;var s=requireInherits_browser(),t=requireHashBase$1(),f=requireSafeBuffer$1().Buffer,o=new Array(16);function d(){t.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}s(d,t),d.prototype._update=function(){for(var e=o,u=0;u<16;++u)e[u]=this._block.readInt32LE(u*4);var l=this._a,v=this._b,b=this._c,m=this._d;l=h(l,v,b,m,e[0],3614090360,7),m=h(m,l,v,b,e[1],3905402710,12),b=h(b,m,l,v,e[2],606105819,17),v=h(v,b,m,l,e[3],3250441966,22),l=h(l,v,b,m,e[4],4118548399,7),m=h(m,l,v,b,e[5],1200080426,12),b=h(b,m,l,v,e[6],2821735955,17),v=h(v,b,m,l,e[7],4249261313,22),l=h(l,v,b,m,e[8],1770035416,7),m=h(m,l,v,b,e[9],2336552879,12),b=h(b,m,l,v,e[10],4294925233,17),v=h(v,b,m,l,e[11],2304563134,22),l=h(l,v,b,m,e[12],1804603682,7),m=h(m,l,v,b,e[13],4254626195,12),b=h(b,m,l,v,e[14],2792965006,17),v=h(v,b,m,l,e[15],1236535329,22),l=c(l,v,b,m,e[1],4129170786,5),m=c(m,l,v,b,e[6],3225465664,9),b=c(b,m,l,v,e[11],643717713,14),v=c(v,b,m,l,e[0],3921069994,20),l=c(l,v,b,m,e[5],3593408605,5),m=c(m,l,v,b,e[10],38016083,9),b=c(b,m,l,v,e[15],3634488961,14),v=c(v,b,m,l,e[4],3889429448,20),l=c(l,v,b,m,e[9],568446438,5),m=c(m,l,v,b,e[14],3275163606,9),b=c(b,m,l,v,e[3],4107603335,14),v=c(v,b,m,l,e[8],1163531501,20),l=c(l,v,b,m,e[13],2850285829,5),m=c(m,l,v,b,e[2],4243563512,9),b=c(b,m,l,v,e[7],1735328473,14),v=c(v,b,m,l,e[12],2368359562,20),l=n(l,v,b,m,e[5],4294588738,4),m=n(m,l,v,b,e[8],2272392833,11),b=n(b,m,l,v,e[11],1839030562,16),v=n(v,b,m,l,e[14],4259657740,23),l=n(l,v,b,m,e[1],2763975236,4),m=n(m,l,v,b,e[4],1272893353,11),b=n(b,m,l,v,e[7],4139469664,16),v=n(v,b,m,l,e[10],3200236656,23),l=n(l,v,b,m,e[13],681279174,4),m=n(m,l,v,b,e[0],3936430074,11),b=n(b,m,l,v,e[3],3572445317,16),v=n(v,b,m,l,e[6],76029189,23),l=n(l,v,b,m,e[9],3654602809,4),m=n(m,l,v,b,e[12],3873151461,11),b=n(b,m,l,v,e[15],530742520,16),v=n(v,b,m,l,e[2],3299628645,23),l=a(l,v,b,m,e[0],4096336452,6),m=a(m,l,v,b,e[7],1126891415,10),b=a(b,m,l,v,e[14],2878612391,15),v=a(v,b,m,l,e[5],4237533241,21),l=a(l,v,b,m,e[12],1700485571,6),m=a(m,l,v,b,e[3],2399980690,10),b=a(b,m,l,v,e[10],4293915773,15),v=a(v,b,m,l,e[1],2240044497,21),l=a(l,v,b,m,e[8],1873313359,6),m=a(m,l,v,b,e[15],4264355552,10),b=a(b,m,l,v,e[6],2734768916,15),v=a(v,b,m,l,e[13],1309151649,21),l=a(l,v,b,m,e[4],4149444226,6),m=a(m,l,v,b,e[11],3174756917,10),b=a(b,m,l,v,e[2],718787259,15),v=a(v,b,m,l,e[9],3951481745,21),this._a=this._a+l|0,this._b=this._b+v|0,this._c=this._c+b|0,this._d=this._d+m|0},d.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=f.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e};function r(e,u){return e<<u|e>>>32-u}function h(e,u,l,v,b,m,B){return r(e+(u&l|~u&v)+b+m|0,B)+u|0}function c(e,u,l,v,b,m,B){return r(e+(u&v|l&~v)+b+m|0,B)+u|0}function n(e,u,l,v,b,m,B){return r(e+(u^l^v)+b+m|0,B)+u|0}function a(e,u,l,v,b,m,B){return r(e+(l^(u|~v))+b+m|0,B)+u|0}return md5_js=d,md5_js}var isarray$1,hasRequiredIsarray$1;function requireIsarray$1(){if(hasRequiredIsarray$1)return isarray$1;hasRequiredIsarray$1=1;var s={}.toString;return isarray$1=Array.isArray||function(t){return s.call(t)=="[object Array]"},isarray$1}var typedArrayBuffer,hasRequiredTypedArrayBuffer;function requireTypedArrayBuffer(){if(hasRequiredTypedArrayBuffer)return typedArrayBuffer;hasRequiredTypedArrayBuffer=1;var s=requireType(),t=requireCallBound$1(),f=t("TypedArray.prototype.buffer",!0),o=requireIsTypedArray();return typedArrayBuffer=f||function(r){if(!o(r))throw new s("Not a Typed Array");return r.buffer},typedArrayBuffer}var toBuffer,hasRequiredToBuffer$2;function requireToBuffer$2(){if(hasRequiredToBuffer$2)return toBuffer;hasRequiredToBuffer$2=1;var s=requireSafeBuffer$1().Buffer,t=requireIsarray$1(),f=requireTypedArrayBuffer(),o=ArrayBuffer.isView||function(n){try{return f(n),!0}catch{return!1}},d=typeof Uint8Array<"u",r=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",h=r&&(s.prototype instanceof Uint8Array||s.TYPED_ARRAY_SUPPORT);return toBuffer=function(n,a){if(s.isBuffer(n))return n.constructor&&!("isBuffer"in n)?s.from(n):n;if(typeof n=="string")return s.from(n,a);if(r&&o(n)){if(n.byteLength===0)return s.alloc(0);if(h){var e=s.from(n.buffer,n.byteOffset,n.byteLength);if(e.byteLength===n.byteLength)return e}var u=n instanceof Uint8Array?n:new Uint8Array(n.buffer,n.byteOffset,n.byteLength),l=s.from(u);if(l.length===n.byteLength)return l}if(d&&n instanceof Uint8Array)return s.from(n);var v=t(n);if(v)for(var b=0;b<n.length;b+=1){var m=n[b];if(typeof m!="number"||m<0||m>255||~~m!==m)throw new RangeError("Array items must be numbers in the range 0-255.")}if(v||s.isBuffer(n)&&n.constructor&&typeof n.constructor.isBuffer=="function"&&n.constructor.isBuffer(n))return s.from(n);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},toBuffer}var toBuffer_1$1,hasRequiredToBuffer$1;function requireToBuffer$1(){if(hasRequiredToBuffer$1)return toBuffer_1$1;hasRequiredToBuffer$1=1;var s=requireSafeBuffer$1().Buffer,t=requireToBuffer$2(),f=typeof Uint8Array<"u",o=f&&typeof ArrayBuffer<"u",d=o&&ArrayBuffer.isView;return toBuffer_1$1=function(r,h){if(typeof r=="string"||s.isBuffer(r)||f&&r instanceof Uint8Array||d&&d(r))return t(r,h);throw new TypeError('The "data" argument must be a string, a Buffer, a Uint8Array, or a DataView')},toBuffer_1$1}var readableBrowser={exports:{}},processNextickArgs={exports:{}},hasRequiredProcessNextickArgs;function requireProcessNextickArgs(){if(hasRequiredProcessNextickArgs)return processNextickArgs.exports;hasRequiredProcessNextickArgs=1,typeof process$1>"u"||!process$1.version||process$1.version.indexOf("v0.")===0||process$1.version.indexOf("v1.")===0&&process$1.version.indexOf("v1.8.")!==0?processNextickArgs.exports={nextTick:s}:processNextickArgs.exports=process$1;function s(t,f,o,d){if(typeof t!="function")throw new TypeError('"callback" argument must be a function');var r=arguments.length,h,c;switch(r){case 0:case 1:return process$1.nextTick(t);case 2:return process$1.nextTick(function(){t.call(null,f)});case 3:return process$1.nextTick(function(){t.call(null,f,o)});case 4:return process$1.nextTick(function(){t.call(null,f,o,d)});default:for(h=new Array(r-1),c=0;c<h.length;)h[c++]=arguments[c];return process$1.nextTick(function(){t.apply(null,h)})}}return processNextickArgs.exports}var isarray,hasRequiredIsarray;function requireIsarray(){if(hasRequiredIsarray)return isarray;hasRequiredIsarray=1;var s={}.toString;return isarray=Array.isArray||function(t){return s.call(t)=="[object Array]"},isarray}var streamBrowser,hasRequiredStreamBrowser;function requireStreamBrowser(){return hasRequiredStreamBrowser||(hasRequiredStreamBrowser=1,streamBrowser=requireEvents().EventEmitter),streamBrowser}var safeBuffer={exports:{}},hasRequiredSafeBuffer;function requireSafeBuffer(){return hasRequiredSafeBuffer||(hasRequiredSafeBuffer=1,(function(s,t){var f=requireDist(),o=f.Buffer;function d(h,c){for(var n in h)c[n]=h[n]}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?s.exports=f:(d(f,t),t.Buffer=r);function r(h,c,n){return o(h,c,n)}d(o,r),r.from=function(h,c,n){if(typeof h=="number")throw new TypeError("Argument must not be a number");return o(h,c,n)},r.alloc=function(h,c,n){if(typeof h!="number")throw new TypeError("Argument must be a number");var a=o(h);return c!==void 0?typeof n=="string"?a.fill(c,n):a.fill(c):a.fill(0),a},r.allocUnsafe=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return o(h)},r.allocUnsafeSlow=function(h){if(typeof h!="number")throw new TypeError("Argument must be a number");return f.SlowBuffer(h)}})(safeBuffer,safeBuffer.exports)),safeBuffer.exports}var util={},hasRequiredUtil;function requireUtil(){if(hasRequiredUtil)return util;hasRequiredUtil=1;function s(m){return Array.isArray?Array.isArray(m):b(m)==="[object Array]"}util.isArray=s;function t(m){return typeof m=="boolean"}util.isBoolean=t;function f(m){return m===null}util.isNull=f;function o(m){return m==null}util.isNullOrUndefined=o;function d(m){return typeof m=="number"}util.isNumber=d;function r(m){return typeof m=="string"}util.isString=r;function h(m){return typeof m=="symbol"}util.isSymbol=h;function c(m){return m===void 0}util.isUndefined=c;function n(m){return b(m)==="[object RegExp]"}util.isRegExp=n;function a(m){return typeof m=="object"&&m!==null}util.isObject=a;function e(m){return b(m)==="[object Date]"}util.isDate=e;function u(m){return b(m)==="[object Error]"||m instanceof Error}util.isError=u;function l(m){return typeof m=="function"}util.isFunction=l;function v(m){return m===null||typeof m=="boolean"||typeof m=="number"||typeof m=="string"||typeof m=="symbol"||typeof m>"u"}util.isPrimitive=v,util.isBuffer=requireDist().Buffer.isBuffer;function b(m){return Object.prototype.toString.call(m)}return util}var BufferList={exports:{}},hasRequiredBufferList;function requireBufferList(){return hasRequiredBufferList||(hasRequiredBufferList=1,(function(s){function t(r,h){if(!(r instanceof h))throw new TypeError("Cannot call a class as a function")}var f=requireSafeBuffer().Buffer,o=requireUtil$1();function d(r,h,c){r.copy(h,c)}s.exports=(function(){function r(){t(this,r),this.head=null,this.tail=null,this.length=0}return r.prototype.push=function(c){var n={data:c,next:null};this.length>0?this.tail.next=n:this.head=n,this.tail=n,++this.length},r.prototype.unshift=function(c){var n={data:c,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length},r.prototype.shift=function(){if(this.length!==0){var c=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,c}},r.prototype.clear=function(){this.head=this.tail=null,this.length=0},r.prototype.join=function(c){if(this.length===0)return"";for(var n=this.head,a=""+n.data;n=n.next;)a+=c+n.data;return a},r.prototype.concat=function(c){if(this.length===0)return f.alloc(0);for(var n=f.allocUnsafe(c>>>0),a=this.head,e=0;a;)d(a.data,n,e),e+=a.data.length,a=a.next;return n},r})(),o&&o.inspect&&o.inspect.custom&&(s.exports.prototype[o.inspect.custom]=function(){var r=o.inspect({length:this.length});return this.constructor.name+" "+r})})(BufferList)),BufferList.exports}var destroy_1,hasRequiredDestroy;function requireDestroy(){if(hasRequiredDestroy)return destroy_1;hasRequiredDestroy=1;var s=requireProcessNextickArgs();function t(d,r){var h=this,c=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return c||n?(r?r(d):d&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,s.nextTick(o,this,d)):s.nextTick(o,this,d)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(d||null,function(a){!r&&a?h._writableState?h._writableState.errorEmitted||(h._writableState.errorEmitted=!0,s.nextTick(o,h,a)):s.nextTick(o,h,a):r&&r(a)}),this)}function f(){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)}function o(d,r){d.emit("error",r)}return destroy_1={destroy:t,undestroy:f},destroy_1}var _stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1;var s=requireProcessNextickArgs();_stream_writable=m;function t(q){var T=this;this.next=null,this.entry=null,this.finish=function(){R(T,q)}}var f=!process$1.browser&&["v0.10","v0.9."].indexOf(process$1.version.slice(0,5))>-1?setImmediate:s.nextTick,o;m.WritableState=v;var d=Object.create(requireUtil());d.inherits=requireInherits_browser();var r={deprecate:requireBrowser$a()},h=requireStreamBrowser(),c=requireSafeBuffer().Buffer,n=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function a(q){return c.from(q)}function e(q){return c.isBuffer(q)||q instanceof n}var u=requireDestroy();d.inherits(m,h);function l(){}function v(q,T){o=o||require_stream_duplex(),q=q||{};var A=T instanceof o;this.objectMode=!!q.objectMode,A&&(this.objectMode=this.objectMode||!!q.writableObjectMode);var w=q.highWaterMark,M=q.writableHighWaterMark,x=this.objectMode?16:16*1024;w||w===0?this.highWaterMark=w:A&&(M||M===0)?this.highWaterMark=M:this.highWaterMark=x,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var L=q.decodeStrings===!1;this.decodeStrings=!L,this.defaultEncoding=q.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(K){Y(T,K)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new t(this)}v.prototype.getBuffer=function(){for(var T=this.bufferedRequest,A=[];T;)A.push(T),T=T.next;return A},(function(){try{Object.defineProperty(v.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var b;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(b=Function.prototype[Symbol.hasInstance],Object.defineProperty(m,Symbol.hasInstance,{value:function(q){return b.call(this,q)?!0:this!==m?!1:q&&q._writableState instanceof v}})):b=function(q){return q instanceof this};function m(q){if(o=o||require_stream_duplex(),!b.call(m,this)&&!(this instanceof o))return new m(q);this._writableState=new v(q,this),this.writable=!0,q&&(typeof q.write=="function"&&(this._write=q.write),typeof q.writev=="function"&&(this._writev=q.writev),typeof q.destroy=="function"&&(this._destroy=q.destroy),typeof q.final=="function"&&(this._final=q.final)),h.call(this)}m.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function B(q,T){var A=new Error("write after end");q.emit("error",A),s.nextTick(T,A)}function E(q,T,A,w){var M=!0,x=!1;return A===null?x=new TypeError("May not write null values to stream"):typeof A!="string"&&A!==void 0&&!T.objectMode&&(x=new TypeError("Invalid non-string/buffer chunk")),x&&(q.emit("error",x),s.nextTick(w,x),M=!1),M}m.prototype.write=function(q,T,A){var w=this._writableState,M=!1,x=!w.objectMode&&e(q);return x&&!c.isBuffer(q)&&(q=a(q)),typeof T=="function"&&(A=T,T=null),x?T="buffer":T||(T=w.defaultEncoding),typeof A!="function"&&(A=l),w.ended?B(this,A):(x||E(this,w,q,A))&&(w.pendingcb++,M=O(this,w,x,q,T,A)),M},m.prototype.cork=function(){var q=this._writableState;q.corked++},m.prototype.uncork=function(){var q=this._writableState;q.corked&&(q.corked--,!q.writing&&!q.corked&&!q.bufferProcessing&&q.bufferedRequest&&de(this,q))},m.prototype.setDefaultEncoding=function(T){if(typeof T=="string"&&(T=T.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((T+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+T);return this._writableState.defaultEncoding=T,this};function S(q,T,A){return!q.objectMode&&q.decodeStrings!==!1&&typeof T=="string"&&(T=c.from(T,A)),T}Object.defineProperty(m.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function O(q,T,A,w,M,x){if(!A){var L=S(T,w,M);w!==L&&(A=!0,M="buffer",w=L)}var K=T.objectMode?1:w.length;T.length+=K;var Q=T.length<T.highWaterMark;if(Q||(T.needDrain=!0),T.writing||T.corked){var j=T.lastBufferedRequest;T.lastBufferedRequest={chunk:w,encoding:M,isBuf:A,callback:x,next:null},j?j.next=T.lastBufferedRequest:T.bufferedRequest=T.lastBufferedRequest,T.bufferedRequestCount+=1}else D(q,T,!1,K,w,M,x);return Q}function D(q,T,A,w,M,x,L){T.writelen=w,T.writecb=L,T.writing=!0,T.sync=!0,A?q._writev(M,T.onwrite):q._write(M,x,T.onwrite),T.sync=!1}function $(q,T,A,w,M){--T.pendingcb,A?(s.nextTick(M,w),s.nextTick(p,q,T),q._writableState.errorEmitted=!0,q.emit("error",w)):(M(w),q._writableState.errorEmitted=!0,q.emit("error",w),p(q,T))}function H(q){q.writing=!1,q.writecb=null,q.length-=q.writelen,q.writelen=0}function Y(q,T){var A=q._writableState,w=A.sync,M=A.writecb;if(H(A),T)$(q,A,w,T,M);else{var x=X(A);!x&&!A.corked&&!A.bufferProcessing&&A.bufferedRequest&&de(q,A),w?f(ie,q,A,x,M):ie(q,A,x,M)}}function ie(q,T,A,w){A||ne(q,T),T.pendingcb--,w(),p(q,T)}function ne(q,T){T.length===0&&T.needDrain&&(T.needDrain=!1,q.emit("drain"))}function de(q,T){T.bufferProcessing=!0;var A=T.bufferedRequest;if(q._writev&&A&&A.next){var w=T.bufferedRequestCount,M=new Array(w),x=T.corkedRequestsFree;x.entry=A;for(var L=0,K=!0;A;)M[L]=A,A.isBuf||(K=!1),A=A.next,L+=1;M.allBuffers=K,D(q,T,!0,T.length,M,"",x.finish),T.pendingcb++,T.lastBufferedRequest=null,x.next?(T.corkedRequestsFree=x.next,x.next=null):T.corkedRequestsFree=new t(T),T.bufferedRequestCount=0}else{for(;A;){var Q=A.chunk,j=A.encoding,N=A.callback,F=T.objectMode?1:Q.length;if(D(q,T,!1,F,Q,j,N),A=A.next,T.bufferedRequestCount--,T.writing)break}A===null&&(T.lastBufferedRequest=null)}T.bufferedRequest=A,T.bufferProcessing=!1}m.prototype._write=function(q,T,A){A(new Error("_write() is not implemented"))},m.prototype._writev=null,m.prototype.end=function(q,T,A){var w=this._writableState;typeof q=="function"?(A=q,q=null,T=null):typeof T=="function"&&(A=T,T=null),q!=null&&this.write(q,T),w.corked&&(w.corked=1,this.uncork()),w.ending||_(this,w,A)};function X(q){return q.ending&&q.length===0&&q.bufferedRequest===null&&!q.finished&&!q.writing}function y(q,T){q._final(function(A){T.pendingcb--,A&&q.emit("error",A),T.prefinished=!0,q.emit("prefinish"),p(q,T)})}function g(q,T){!T.prefinished&&!T.finalCalled&&(typeof q._final=="function"?(T.pendingcb++,T.finalCalled=!0,s.nextTick(y,q,T)):(T.prefinished=!0,q.emit("prefinish")))}function p(q,T){var A=X(T);return A&&(g(q,T),T.pendingcb===0&&(T.finished=!0,q.emit("finish"))),A}function _(q,T,A){T.ending=!0,p(q,T),A&&(T.finished?s.nextTick(A):q.once("finish",A)),T.ended=!0,q.writable=!1}function R(q,T,A){var w=q.entry;for(q.entry=null;w;){var M=w.callback;T.pendingcb--,M(A),w=w.next}T.corkedRequestsFree.next=q}return Object.defineProperty(m.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(q){this._writableState&&(this._writableState.destroyed=q)}}),m.prototype.destroy=u.destroy,m.prototype._undestroy=u.undestroy,m.prototype._destroy=function(q,T){this.end(),T(q)},_stream_writable}var _stream_duplex,hasRequired_stream_duplex;function require_stream_duplex(){if(hasRequired_stream_duplex)return _stream_duplex;hasRequired_stream_duplex=1;var s=requireProcessNextickArgs(),t=Object.keys||function(u){var l=[];for(var v in u)l.push(v);return l};_stream_duplex=n;var f=Object.create(requireUtil());f.inherits=requireInherits_browser();var o=require_stream_readable(),d=require_stream_writable();f.inherits(n,o);for(var r=t(d.prototype),h=0;h<r.length;h++){var c=r[h];n.prototype[c]||(n.prototype[c]=d.prototype[c])}function n(u){if(!(this instanceof n))return new n(u);o.call(this,u),d.call(this,u),u&&u.readable===!1&&(this.readable=!1),u&&u.writable===!1&&(this.writable=!1),this.allowHalfOpen=!0,u&&u.allowHalfOpen===!1&&(this.allowHalfOpen=!1),this.once("end",a)}Object.defineProperty(n.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function a(){this.allowHalfOpen||this._writableState.ended||s.nextTick(e,this)}function e(u){u.end()}return Object.defineProperty(n.prototype,"destroyed",{get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(u){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=u,this._writableState.destroyed=u)}}),n.prototype._destroy=function(u,l){this.push(null),this.end(),s.nextTick(l,u)},_stream_duplex}var _stream_readable,hasRequired_stream_readable;function require_stream_readable(){if(hasRequired_stream_readable)return _stream_readable;hasRequired_stream_readable=1;var s=requireProcessNextickArgs();_stream_readable=S;var t=requireIsarray(),f;S.ReadableState=E,requireEvents().EventEmitter;var o=function(N,F){return N.listeners(F).length},d=requireStreamBrowser(),r=requireSafeBuffer().Buffer,h=(typeof commonjsGlobal<"u"?commonjsGlobal:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function c(N){return r.from(N)}function n(N){return r.isBuffer(N)||N instanceof h}var a=Object.create(requireUtil());a.inherits=requireInherits_browser();var e=requireUtil$1(),u=void 0;e&&e.debuglog?u=e.debuglog("stream"):u=function(){};var l=requireBufferList(),v=requireDestroy(),b;a.inherits(S,d);var m=["error","close","destroy","pause","resume"];function B(N,F,ee){if(typeof N.prependListener=="function")return N.prependListener(F,ee);!N._events||!N._events[F]?N.on(F,ee):t(N._events[F])?N._events[F].unshift(ee):N._events[F]=[ee,N._events[F]]}function E(N,F){f=f||require_stream_duplex(),N=N||{};var ee=F instanceof f;this.objectMode=!!N.objectMode,ee&&(this.objectMode=this.objectMode||!!N.readableObjectMode);var ae=N.highWaterMark,G=N.readableHighWaterMark,z=this.objectMode?16:16*1024;ae||ae===0?this.highWaterMark=ae:ee&&(G||G===0)?this.highWaterMark=G:this.highWaterMark=z,this.highWaterMark=Math.floor(this.highWaterMark),this.buffer=new l,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.destroyed=!1,this.defaultEncoding=N.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,N.encoding&&(b||(b=requireString_decoder().StringDecoder),this.decoder=new b(N.encoding),this.encoding=N.encoding)}function S(N){if(f=f||require_stream_duplex(),!(this instanceof S))return new S(N);this._readableState=new E(N,this),this.readable=!0,N&&(typeof N.read=="function"&&(this._read=N.read),typeof N.destroy=="function"&&(this._destroy=N.destroy)),d.call(this)}Object.defineProperty(S.prototype,"destroyed",{get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(N){this._readableState&&(this._readableState.destroyed=N)}}),S.prototype.destroy=v.destroy,S.prototype._undestroy=v.undestroy,S.prototype._destroy=function(N,F){this.push(null),F(N)},S.prototype.push=function(N,F){var ee=this._readableState,ae;return ee.objectMode?ae=!0:typeof N=="string"&&(F=F||ee.defaultEncoding,F!==ee.encoding&&(N=r.from(N,F),F=""),ae=!0),O(this,N,F,!1,ae)},S.prototype.unshift=function(N){return O(this,N,null,!0,!1)};function O(N,F,ee,ae,G){var z=N._readableState;if(F===null)z.reading=!1,de(N,z);else{var fe;G||(fe=$(z,F)),fe?N.emit("error",fe):z.objectMode||F&&F.length>0?(typeof F!="string"&&!z.objectMode&&Object.getPrototypeOf(F)!==r.prototype&&(F=c(F)),ae?z.endEmitted?N.emit("error",new Error("stream.unshift() after end event")):D(N,z,F,!0):z.ended?N.emit("error",new Error("stream.push() after EOF")):(z.reading=!1,z.decoder&&!ee?(F=z.decoder.write(F),z.objectMode||F.length!==0?D(N,z,F,!1):g(N,z)):D(N,z,F,!1))):ae||(z.reading=!1)}return H(z)}function D(N,F,ee,ae){F.flowing&&F.length===0&&!F.sync?(N.emit("data",ee),N.read(0)):(F.length+=F.objectMode?1:ee.length,ae?F.buffer.unshift(ee):F.buffer.push(ee),F.needReadable&&X(N)),g(N,F)}function $(N,F){var ee;return!n(F)&&typeof F!="string"&&F!==void 0&&!N.objectMode&&(ee=new TypeError("Invalid non-string/buffer chunk")),ee}function H(N){return!N.ended&&(N.needReadable||N.length<N.highWaterMark||N.length===0)}S.prototype.isPaused=function(){return this._readableState.flowing===!1},S.prototype.setEncoding=function(N){return b||(b=requireString_decoder().StringDecoder),this._readableState.decoder=new b(N),this._readableState.encoding=N,this};var Y=8388608;function ie(N){return N>=Y?N=Y:(N--,N|=N>>>1,N|=N>>>2,N|=N>>>4,N|=N>>>8,N|=N>>>16,N++),N}function ne(N,F){return N<=0||F.length===0&&F.ended?0:F.objectMode?1:N!==N?F.flowing&&F.length?F.buffer.head.data.length:F.length:(N>F.highWaterMark&&(F.highWaterMark=ie(N)),N<=F.length?N:F.ended?F.length:(F.needReadable=!0,0))}S.prototype.read=function(N){u("read",N),N=parseInt(N,10);var F=this._readableState,ee=N;if(N!==0&&(F.emittedReadable=!1),N===0&&F.needReadable&&(F.length>=F.highWaterMark||F.ended))return u("read: emitReadable",F.length,F.ended),F.length===0&&F.ended?K(this):X(this),null;if(N=ne(N,F),N===0&&F.ended)return F.length===0&&K(this),null;var ae=F.needReadable;u("need readable",ae),(F.length===0||F.length-N<F.highWaterMark)&&(ae=!0,u("length less than watermark",ae)),F.ended||F.reading?(ae=!1,u("reading or ended",ae)):ae&&(u("do read"),F.reading=!0,F.sync=!0,F.length===0&&(F.needReadable=!0),this._read(F.highWaterMark),F.sync=!1,F.reading||(N=ne(ee,F)));var G;return N>0?G=w(N,F):G=null,G===null?(F.needReadable=!0,N=0):F.length-=N,F.length===0&&(F.ended||(F.needReadable=!0),ee!==N&&F.ended&&K(this)),G!==null&&this.emit("data",G),G};function de(N,F){if(!F.ended){if(F.decoder){var ee=F.decoder.end();ee&&ee.length&&(F.buffer.push(ee),F.length+=F.objectMode?1:ee.length)}F.ended=!0,X(N)}}function X(N){var F=N._readableState;F.needReadable=!1,F.emittedReadable||(u("emitReadable",F.flowing),F.emittedReadable=!0,F.sync?s.nextTick(y,N):y(N))}function y(N){u("emit readable"),N.emit("readable"),A(N)}function g(N,F){F.readingMore||(F.readingMore=!0,s.nextTick(p,N,F))}function p(N,F){for(var ee=F.length;!F.reading&&!F.flowing&&!F.ended&&F.length<F.highWaterMark&&(u("maybeReadMore read 0"),N.read(0),ee!==F.length);)ee=F.length;F.readingMore=!1}S.prototype._read=function(N){this.emit("error",new Error("_read() is not implemented"))},S.prototype.pipe=function(N,F){var ee=this,ae=this._readableState;switch(ae.pipesCount){case 0:ae.pipes=N;break;case 1:ae.pipes=[ae.pipes,N];break;default:ae.pipes.push(N);break}ae.pipesCount+=1,u("pipe count=%d opts=%j",ae.pipesCount,F);var G=(!F||F.end!==!1)&&N!==process$1.stdout&&N!==process$1.stderr,z=G?me:Pe;ae.endEmitted?s.nextTick(z):ee.once("end",z),N.on("unpipe",fe);function fe(oe,ce){u("onunpipe"),oe===ee&&ce&&ce.hasUnpiped===!1&&(ce.hasUnpiped=!0,qe())}function me(){u("onend"),N.end()}var xe=_(ee);N.on("drain",xe);var _e=!1;function qe(){u("cleanup"),N.removeListener("close",Be),N.removeListener("finish",Me),N.removeListener("drain",xe),N.removeListener("error",Fe),N.removeListener("unpipe",fe),ee.removeListener("end",me),ee.removeListener("end",Pe),ee.removeListener("data",be),_e=!0,ae.awaitDrain&&(!N._writableState||N._writableState.needDrain)&&xe()}var Re=!1;ee.on("data",be);function be(oe){u("ondata"),Re=!1;var ce=N.write(oe);ce===!1&&!Re&&((ae.pipesCount===1&&ae.pipes===N||ae.pipesCount>1&&j(ae.pipes,N)!==-1)&&!_e&&(u("false write response, pause",ae.awaitDrain),ae.awaitDrain++,Re=!0),ee.pause())}function Fe(oe){u("onerror",oe),Pe(),N.removeListener("error",Fe),o(N,"error")===0&&N.emit("error",oe)}B(N,"error",Fe);function Be(){N.removeListener("finish",Me),Pe()}N.once("close",Be);function Me(){u("onfinish"),N.removeListener("close",Be),Pe()}N.once("finish",Me);function Pe(){u("unpipe"),ee.unpipe(N)}return N.emit("pipe",ee),ae.flowing||(u("pipe resume"),ee.resume()),N};function _(N){return function(){var F=N._readableState;u("pipeOnDrain",F.awaitDrain),F.awaitDrain&&F.awaitDrain--,F.awaitDrain===0&&o(N,"data")&&(F.flowing=!0,A(N))}}S.prototype.unpipe=function(N){var F=this._readableState,ee={hasUnpiped:!1};if(F.pipesCount===0)return this;if(F.pipesCount===1)return N&&N!==F.pipes?this:(N||(N=F.pipes),F.pipes=null,F.pipesCount=0,F.flowing=!1,N&&N.emit("unpipe",this,ee),this);if(!N){var ae=F.pipes,G=F.pipesCount;F.pipes=null,F.pipesCount=0,F.flowing=!1;for(var z=0;z<G;z++)ae[z].emit("unpipe",this,{hasUnpiped:!1});return this}var fe=j(F.pipes,N);return fe===-1?this:(F.pipes.splice(fe,1),F.pipesCount-=1,F.pipesCount===1&&(F.pipes=F.pipes[0]),N.emit("unpipe",this,ee),this)},S.prototype.on=function(N,F){var ee=d.prototype.on.call(this,N,F);if(N==="data")this._readableState.flowing!==!1&&this.resume();else if(N==="readable"){var ae=this._readableState;!ae.endEmitted&&!ae.readableListening&&(ae.readableListening=ae.needReadable=!0,ae.emittedReadable=!1,ae.reading?ae.length&&X(this):s.nextTick(R,this))}return ee},S.prototype.addListener=S.prototype.on;function R(N){u("readable nexttick read 0"),N.read(0)}S.prototype.resume=function(){var N=this._readableState;return N.flowing||(u("resume"),N.flowing=!0,q(this,N)),this};function q(N,F){F.resumeScheduled||(F.resumeScheduled=!0,s.nextTick(T,N,F))}function T(N,F){F.reading||(u("resume read 0"),N.read(0)),F.resumeScheduled=!1,F.awaitDrain=0,N.emit("resume"),A(N),F.flowing&&!F.reading&&N.read(0)}S.prototype.pause=function(){return u("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(u("pause"),this._readableState.flowing=!1,this.emit("pause")),this};function A(N){var F=N._readableState;for(u("flow",F.flowing);F.flowing&&N.read()!==null;);}S.prototype.wrap=function(N){var F=this,ee=this._readableState,ae=!1;N.on("end",function(){if(u("wrapped end"),ee.decoder&&!ee.ended){var fe=ee.decoder.end();fe&&fe.length&&F.push(fe)}F.push(null)}),N.on("data",function(fe){if(u("wrapped data"),ee.decoder&&(fe=ee.decoder.write(fe)),!(ee.objectMode&&fe==null)&&!(!ee.objectMode&&(!fe||!fe.length))){var me=F.push(fe);me||(ae=!0,N.pause())}});for(var G in N)this[G]===void 0&&typeof N[G]=="function"&&(this[G]=(function(fe){return function(){return N[fe].apply(N,arguments)}})(G));for(var z=0;z<m.length;z++)N.on(m[z],this.emit.bind(this,m[z]));return this._read=function(fe){u("wrapped _read",fe),ae&&(ae=!1,N.resume())},this},Object.defineProperty(S.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),S._fromList=w;function w(N,F){if(F.length===0)return null;var ee;return F.objectMode?ee=F.buffer.shift():!N||N>=F.length?(F.decoder?ee=F.buffer.join(""):F.buffer.length===1?ee=F.buffer.head.data:ee=F.buffer.concat(F.length),F.buffer.clear()):ee=M(N,F.buffer,F.decoder),ee}function M(N,F,ee){var ae;return N<F.head.data.length?(ae=F.head.data.slice(0,N),F.head.data=F.head.data.slice(N)):N===F.head.data.length?ae=F.shift():ae=ee?x(N,F):L(N,F),ae}function x(N,F){var ee=F.head,ae=1,G=ee.data;for(N-=G.length;ee=ee.next;){var z=ee.data,fe=N>z.length?z.length:N;if(fe===z.length?G+=z:G+=z.slice(0,N),N-=fe,N===0){fe===z.length?(++ae,ee.next?F.head=ee.next:F.head=F.tail=null):(F.head=ee,ee.data=z.slice(fe));break}++ae}return F.length-=ae,G}function L(N,F){var ee=r.allocUnsafe(N),ae=F.head,G=1;for(ae.data.copy(ee),N-=ae.data.length;ae=ae.next;){var z=ae.data,fe=N>z.length?z.length:N;if(z.copy(ee,ee.length-N,0,fe),N-=fe,N===0){fe===z.length?(++G,ae.next?F.head=ae.next:F.head=F.tail=null):(F.head=ae,ae.data=z.slice(fe));break}++G}return F.length-=G,ee}function K(N){var F=N._readableState;if(F.length>0)throw new Error('"endReadable()" called on non-empty stream');F.endEmitted||(F.ended=!0,s.nextTick(Q,F,N))}function Q(N,F){!N.endEmitted&&N.length===0&&(N.endEmitted=!0,F.readable=!1,F.emit("end"))}function j(N,F){for(var ee=0,ae=N.length;ee<ae;ee++)if(N[ee]===F)return ee;return-1}return _stream_readable}var _stream_transform,hasRequired_stream_transform;function require_stream_transform(){if(hasRequired_stream_transform)return _stream_transform;hasRequired_stream_transform=1,_stream_transform=o;var s=require_stream_duplex(),t=Object.create(requireUtil());t.inherits=requireInherits_browser(),t.inherits(o,s);function f(h,c){var n=this._transformState;n.transforming=!1;var a=n.writecb;if(!a)return this.emit("error",new Error("write callback called multiple times"));n.writechunk=null,n.writecb=null,c!=null&&this.push(c),a(h);var e=this._readableState;e.reading=!1,(e.needReadable||e.length<e.highWaterMark)&&this._read(e.highWaterMark)}function o(h){if(!(this instanceof o))return new o(h);s.call(this,h),this._transformState={afterTransform:f.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,h&&(typeof h.transform=="function"&&(this._transform=h.transform),typeof h.flush=="function"&&(this._flush=h.flush)),this.on("prefinish",d)}function d(){var h=this;typeof this._flush=="function"?this._flush(function(c,n){r(h,c,n)}):r(this,null,null)}o.prototype.push=function(h,c){return this._transformState.needTransform=!1,s.prototype.push.call(this,h,c)},o.prototype._transform=function(h,c,n){throw new Error("_transform() is not implemented")},o.prototype._write=function(h,c,n){var a=this._transformState;if(a.writecb=n,a.writechunk=h,a.writeencoding=c,!a.transforming){var e=this._readableState;(a.needTransform||e.needReadable||e.length<e.highWaterMark)&&this._read(e.highWaterMark)}},o.prototype._read=function(h){var c=this._transformState;c.writechunk!==null&&c.writecb&&!c.transforming?(c.transforming=!0,this._transform(c.writechunk,c.writeencoding,c.afterTransform)):c.needTransform=!0},o.prototype._destroy=function(h,c){var n=this;s.prototype._destroy.call(this,h,function(a){c(a),n.emit("close")})};function r(h,c,n){if(c)return h.emit("error",c);if(n!=null&&h.push(n),h._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(h._transformState.transforming)throw new Error("Calling transform done when still transforming");return h.push(null)}return _stream_transform}var _stream_passthrough,hasRequired_stream_passthrough;function require_stream_passthrough(){if(hasRequired_stream_passthrough)return _stream_passthrough;hasRequired_stream_passthrough=1,_stream_passthrough=f;var s=require_stream_transform(),t=Object.create(requireUtil());t.inherits=requireInherits_browser(),t.inherits(f,s);function f(o){if(!(this instanceof f))return new f(o);s.call(this,o)}return f.prototype._transform=function(o,d,r){r(null,o)},_stream_passthrough}var hasRequiredReadableBrowser;function requireReadableBrowser(){return hasRequiredReadableBrowser||(hasRequiredReadableBrowser=1,(function(s,t){t=s.exports=require_stream_readable(),t.Stream=t,t.Readable=t,t.Writable=require_stream_writable(),t.Duplex=require_stream_duplex(),t.Transform=require_stream_transform(),t.PassThrough=require_stream_passthrough()})(readableBrowser,readableBrowser.exports)),readableBrowser.exports}var hashBase,hasRequiredHashBase;function requireHashBase(){if(hasRequiredHashBase)return hashBase;hasRequiredHashBase=1;var s=requireSafeBuffer$1().Buffer,t=requireToBuffer$1(),f=requireReadableBrowser().Transform,o=requireInherits_browser();function d(r){f.call(this),this._block=s.allocUnsafe(r),this._blockSize=r,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}return o(d,f),d.prototype._transform=function(r,h,c){var n=null;try{this.update(r,h)}catch(a){n=a}c(n)},d.prototype._flush=function(r){var h=null;try{this.push(this.digest())}catch(c){h=c}r(h)},d.prototype.update=function(r,h){if(this._finalized)throw new Error("Digest already called");for(var c=t(r,h),n=this._block,a=0;this._blockOffset+c.length-a>=this._blockSize;){for(var e=this._blockOffset;e<this._blockSize;)n[e]=c[a],e+=1,a+=1;this._update(),this._blockOffset=0}for(;a<c.length;)n[this._blockOffset]=c[a],this._blockOffset+=1,a+=1;for(var u=0,l=c.length*8;l>0;++u)this._length[u]+=l,l=this._length[u]/4294967296|0,l>0&&(this._length[u]-=4294967296*l);return this},d.prototype._update=function(){throw new Error("_update is not implemented")},d.prototype.digest=function(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var h=this._digest();r!==void 0&&(h=h.toString(r)),this._block.fill(0),this._blockOffset=0;for(var c=0;c<4;++c)this._length[c]=0;return h},d.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase=d,hashBase}var ripemd160,hasRequiredRipemd160;function requireRipemd160(){if(hasRequiredRipemd160)return ripemd160;hasRequiredRipemd160=1;var s=requireDist().Buffer,t=requireInherits_browser(),f=requireHashBase(),o=new Array(16),d=[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],r=[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],h=[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],c=[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],n=[0,1518500249,1859775393,2400959708,2840853838],a=[1352829926,1548603684,1836072691,2053994217,0];function e(E,S){return E<<S|E>>>32-S}function u(E,S,O,D,$,H,Y,ie){return e(E+(S^O^D)+H+Y|0,ie)+$|0}function l(E,S,O,D,$,H,Y,ie){return e(E+(S&O|~S&D)+H+Y|0,ie)+$|0}function v(E,S,O,D,$,H,Y,ie){return e(E+((S|~O)^D)+H+Y|0,ie)+$|0}function b(E,S,O,D,$,H,Y,ie){return e(E+(S&D|O&~D)+H+Y|0,ie)+$|0}function m(E,S,O,D,$,H,Y,ie){return e(E+(S^(O|~D))+H+Y|0,ie)+$|0}function B(){f.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}return t(B,f),B.prototype._update=function(){for(var E=o,S=0;S<16;++S)E[S]=this._block.readInt32LE(S*4);for(var O=this._a|0,D=this._b|0,$=this._c|0,H=this._d|0,Y=this._e|0,ie=this._a|0,ne=this._b|0,de=this._c|0,X=this._d|0,y=this._e|0,g=0;g<80;g+=1){var p,_;g<16?(p=u(O,D,$,H,Y,E[d[g]],n[0],h[g]),_=m(ie,ne,de,X,y,E[r[g]],a[0],c[g])):g<32?(p=l(O,D,$,H,Y,E[d[g]],n[1],h[g]),_=b(ie,ne,de,X,y,E[r[g]],a[1],c[g])):g<48?(p=v(O,D,$,H,Y,E[d[g]],n[2],h[g]),_=v(ie,ne,de,X,y,E[r[g]],a[2],c[g])):g<64?(p=b(O,D,$,H,Y,E[d[g]],n[3],h[g]),_=l(ie,ne,de,X,y,E[r[g]],a[3],c[g])):(p=m(O,D,$,H,Y,E[d[g]],n[4],h[g]),_=u(ie,ne,de,X,y,E[r[g]],a[4],c[g])),O=Y,Y=H,H=e($,10),$=D,D=p,ie=y,y=X,X=e(de,10),de=ne,ne=_}var R=this._b+$+X|0;this._b=this._c+H+y|0,this._c=this._d+Y+ie|0,this._d=this._e+O+ne|0,this._e=this._a+D+de|0,this._a=R},B.prototype._digest=function(){this._block[this._blockOffset]=128,this._blockOffset+=1,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=s.alloc?s.alloc(20):new s(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},ripemd160=B,ripemd160}var sha_js={exports:{}},hash$1,hasRequiredHash$1;function requireHash$1(){if(hasRequiredHash$1)return hash$1;hasRequiredHash$1=1;var s=requireSafeBuffer$1().Buffer,t=requireToBuffer$2();function f(o,d){this._block=s.alloc(o),this._finalSize=d,this._blockSize=o,this._len=0}return f.prototype.update=function(o,d){o=t(o,d||"utf8");for(var r=this._block,h=this._blockSize,c=o.length,n=this._len,a=0;a<c;){for(var e=n%h,u=Math.min(c-a,h-e),l=0;l<u;l++)r[e+l]=o[a+l];n+=u,a+=u,n%h===0&&this._update(r)}return this._len+=c,this},f.prototype.digest=function(o){var d=this._len%this._blockSize;this._block[d]=128,this._block.fill(0,d+1),d>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var h=(r&4294967295)>>>0,c=(r-h)/4294967296;this._block.writeUInt32BE(c,this._blockSize-8),this._block.writeUInt32BE(h,this._blockSize-4)}this._update(this._block);var n=this._hash();return o?n.toString(o):n},f.prototype._update=function(){throw new Error("_update must be implemented by subclass")},hash$1=f,hash$1}var sha$1,hasRequiredSha$1;function requireSha$1(){if(hasRequiredSha$1)return sha$1;hasRequiredSha$1=1;var s=requireInherits_browser(),t=requireHash$1(),f=requireSafeBuffer$1().Buffer,o=[1518500249,1859775393,-1894007588,-899497514],d=new Array(80);function r(){this.init(),this._w=d,t.call(this,64,56)}s(r,t),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function h(a){return a<<5|a>>>27}function c(a){return a<<30|a>>>2}function n(a,e,u,l){return a===0?e&u|~e&l:a===2?e&u|e&l|u&l:e^u^l}return r.prototype._update=function(a){for(var e=this._w,u=this._a|0,l=this._b|0,v=this._c|0,b=this._d|0,m=this._e|0,B=0;B<16;++B)e[B]=a.readInt32BE(B*4);for(;B<80;++B)e[B]=e[B-3]^e[B-8]^e[B-14]^e[B-16];for(var E=0;E<80;++E){var S=~~(E/20),O=h(u)+n(S,l,v,b)+m+e[E]+o[S]|0;m=b,b=v,v=c(l),l=u,u=O}this._a=u+this._a|0,this._b=l+this._b|0,this._c=v+this._c|0,this._d=b+this._d|0,this._e=m+this._e|0},r.prototype._hash=function(){var a=f.allocUnsafe(20);return a.writeInt32BE(this._a|0,0),a.writeInt32BE(this._b|0,4),a.writeInt32BE(this._c|0,8),a.writeInt32BE(this._d|0,12),a.writeInt32BE(this._e|0,16),a},sha$1=r,sha$1}var sha1,hasRequiredSha1;function requireSha1(){if(hasRequiredSha1)return sha1;hasRequiredSha1=1;var s=requireInherits_browser(),t=requireHash$1(),f=requireSafeBuffer$1().Buffer,o=[1518500249,1859775393,-1894007588,-899497514],d=new Array(80);function r(){this.init(),this._w=d,t.call(this,64,56)}s(r,t),r.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function h(e){return e<<1|e>>>31}function c(e){return e<<5|e>>>27}function n(e){return e<<30|e>>>2}function a(e,u,l,v){return e===0?u&l|~u&v:e===2?u&l|u&v|l&v:u^l^v}return r.prototype._update=function(e){for(var u=this._w,l=this._a|0,v=this._b|0,b=this._c|0,m=this._d|0,B=this._e|0,E=0;E<16;++E)u[E]=e.readInt32BE(E*4);for(;E<80;++E)u[E]=h(u[E-3]^u[E-8]^u[E-14]^u[E-16]);for(var S=0;S<80;++S){var O=~~(S/20),D=c(l)+a(O,v,b,m)+B+u[S]+o[O]|0;B=m,m=b,b=n(v),v=l,l=D}this._a=l+this._a|0,this._b=v+this._b|0,this._c=b+this._c|0,this._d=m+this._d|0,this._e=B+this._e|0},r.prototype._hash=function(){var e=f.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e},sha1=r,sha1}var sha256$1,hasRequiredSha256;function requireSha256(){if(hasRequiredSha256)return sha256$1;hasRequiredSha256=1;var s=requireInherits_browser(),t=requireHash$1(),f=requireSafeBuffer$1().Buffer,o=[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],d=new Array(64);function r(){this.init(),this._w=d,t.call(this,64,56)}s(r,t),r.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};function h(l,v,b){return b^l&(v^b)}function c(l,v,b){return l&v|b&(l|v)}function n(l){return(l>>>2|l<<30)^(l>>>13|l<<19)^(l>>>22|l<<10)}function a(l){return(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7)}function e(l){return(l>>>7|l<<25)^(l>>>18|l<<14)^l>>>3}function u(l){return(l>>>17|l<<15)^(l>>>19|l<<13)^l>>>10}return r.prototype._update=function(l){for(var v=this._w,b=this._a|0,m=this._b|0,B=this._c|0,E=this._d|0,S=this._e|0,O=this._f|0,D=this._g|0,$=this._h|0,H=0;H<16;++H)v[H]=l.readInt32BE(H*4);for(;H<64;++H)v[H]=u(v[H-2])+v[H-7]+e(v[H-15])+v[H-16]|0;for(var Y=0;Y<64;++Y){var ie=$+a(S)+h(S,O,D)+o[Y]+v[Y]|0,ne=n(b)+c(b,m,B)|0;$=D,D=O,O=S,S=E+ie|0,E=B,B=m,m=b,b=ie+ne|0}this._a=b+this._a|0,this._b=m+this._b|0,this._c=B+this._c|0,this._d=E+this._d|0,this._e=S+this._e|0,this._f=O+this._f|0,this._g=D+this._g|0,this._h=$+this._h|0},r.prototype._hash=function(){var l=f.allocUnsafe(32);return l.writeInt32BE(this._a,0),l.writeInt32BE(this._b,4),l.writeInt32BE(this._c,8),l.writeInt32BE(this._d,12),l.writeInt32BE(this._e,16),l.writeInt32BE(this._f,20),l.writeInt32BE(this._g,24),l.writeInt32BE(this._h,28),l},sha256$1=r,sha256$1}var sha224$1,hasRequiredSha224;function requireSha224(){if(hasRequiredSha224)return sha224$1;hasRequiredSha224=1;var s=requireInherits_browser(),t=requireSha256(),f=requireHash$1(),o=requireSafeBuffer$1().Buffer,d=new Array(64);function r(){this.init(),this._w=d,f.call(this,64,56)}return s(r,t),r.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},r.prototype._hash=function(){var h=o.allocUnsafe(28);return h.writeInt32BE(this._a,0),h.writeInt32BE(this._b,4),h.writeInt32BE(this._c,8),h.writeInt32BE(this._d,12),h.writeInt32BE(this._e,16),h.writeInt32BE(this._f,20),h.writeInt32BE(this._g,24),h},sha224$1=r,sha224$1}var sha512$1,hasRequiredSha512;function requireSha512(){if(hasRequiredSha512)return sha512$1;hasRequiredSha512=1;var s=requireInherits_browser(),t=requireHash$1(),f=requireSafeBuffer$1().Buffer,o=[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],d=new Array(160);function r(){this.init(),this._w=d,t.call(this,128,112)}s(r,t),r.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};function h(m,B,E){return E^m&(B^E)}function c(m,B,E){return m&B|E&(m|B)}function n(m,B){return(m>>>28|B<<4)^(B>>>2|m<<30)^(B>>>7|m<<25)}function a(m,B){return(m>>>14|B<<18)^(m>>>18|B<<14)^(B>>>9|m<<23)}function e(m,B){return(m>>>1|B<<31)^(m>>>8|B<<24)^m>>>7}function u(m,B){return(m>>>1|B<<31)^(m>>>8|B<<24)^(m>>>7|B<<25)}function l(m,B){return(m>>>19|B<<13)^(B>>>29|m<<3)^m>>>6}function v(m,B){return(m>>>19|B<<13)^(B>>>29|m<<3)^(m>>>6|B<<26)}function b(m,B){return m>>>0<B>>>0?1:0}return r.prototype._update=function(m){for(var B=this._w,E=this._ah|0,S=this._bh|0,O=this._ch|0,D=this._dh|0,$=this._eh|0,H=this._fh|0,Y=this._gh|0,ie=this._hh|0,ne=this._al|0,de=this._bl|0,X=this._cl|0,y=this._dl|0,g=this._el|0,p=this._fl|0,_=this._gl|0,R=this._hl|0,q=0;q<32;q+=2)B[q]=m.readInt32BE(q*4),B[q+1]=m.readInt32BE(q*4+4);for(;q<160;q+=2){var T=B[q-30],A=B[q-30+1],w=e(T,A),M=u(A,T);T=B[q-4],A=B[q-4+1];var x=l(T,A),L=v(A,T),K=B[q-14],Q=B[q-14+1],j=B[q-32],N=B[q-32+1],F=M+Q|0,ee=w+K+b(F,M)|0;F=F+L|0,ee=ee+x+b(F,L)|0,F=F+N|0,ee=ee+j+b(F,N)|0,B[q]=ee,B[q+1]=F}for(var ae=0;ae<160;ae+=2){ee=B[ae],F=B[ae+1];var G=c(E,S,O),z=c(ne,de,X),fe=n(E,ne),me=n(ne,E),xe=a($,g),_e=a(g,$),qe=o[ae],Re=o[ae+1],be=h($,H,Y),Fe=h(g,p,_),Be=R+_e|0,Me=ie+xe+b(Be,R)|0;Be=Be+Fe|0,Me=Me+be+b(Be,Fe)|0,Be=Be+Re|0,Me=Me+qe+b(Be,Re)|0,Be=Be+F|0,Me=Me+ee+b(Be,F)|0;var Pe=me+z|0,oe=fe+G+b(Pe,me)|0;ie=Y,R=_,Y=H,_=p,H=$,p=g,g=y+Be|0,$=D+Me+b(g,y)|0,D=O,y=X,O=S,X=de,S=E,de=ne,ne=Be+Pe|0,E=Me+oe+b(ne,Be)|0}this._al=this._al+ne|0,this._bl=this._bl+de|0,this._cl=this._cl+X|0,this._dl=this._dl+y|0,this._el=this._el+g|0,this._fl=this._fl+p|0,this._gl=this._gl+_|0,this._hl=this._hl+R|0,this._ah=this._ah+E+b(this._al,ne)|0,this._bh=this._bh+S+b(this._bl,de)|0,this._ch=this._ch+O+b(this._cl,X)|0,this._dh=this._dh+D+b(this._dl,y)|0,this._eh=this._eh+$+b(this._el,g)|0,this._fh=this._fh+H+b(this._fl,p)|0,this._gh=this._gh+Y+b(this._gl,_)|0,this._hh=this._hh+ie+b(this._hl,R)|0},r.prototype._hash=function(){var m=f.allocUnsafe(64);function B(E,S,O){m.writeInt32BE(E,O),m.writeInt32BE(S,O+4)}return B(this._ah,this._al,0),B(this._bh,this._bl,8),B(this._ch,this._cl,16),B(this._dh,this._dl,24),B(this._eh,this._el,32),B(this._fh,this._fl,40),B(this._gh,this._gl,48),B(this._hh,this._hl,56),m},sha512$1=r,sha512$1}var sha384$1,hasRequiredSha384;function requireSha384(){if(hasRequiredSha384)return sha384$1;hasRequiredSha384=1;var s=requireInherits_browser(),t=requireSha512(),f=requireHash$1(),o=requireSafeBuffer$1().Buffer,d=new Array(160);function r(){this.init(),this._w=d,f.call(this,128,112)}return s(r,t),r.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},r.prototype._hash=function(){var h=o.allocUnsafe(48);function c(n,a,e){h.writeInt32BE(n,e),h.writeInt32BE(a,e+4)}return c(this._ah,this._al,0),c(this._bh,this._bl,8),c(this._ch,this._cl,16),c(this._dh,this._dl,24),c(this._eh,this._el,32),c(this._fh,this._fl,40),h},sha384$1=r,sha384$1}var hasRequiredSha_js;function requireSha_js(){return hasRequiredSha_js||(hasRequiredSha_js=1,(function(s){s.exports=function(f){var o=f.toLowerCase(),d=s.exports[o];if(!d)throw new Error(o+" is not supported (we accept pull requests)");return new d},s.exports.sha=requireSha$1(),s.exports.sha1=requireSha1(),s.exports.sha224=requireSha224(),s.exports.sha256=requireSha256(),s.exports.sha384=requireSha384(),s.exports.sha512=requireSha512()})(sha_js)),sha_js.exports}var cipherBase,hasRequiredCipherBase;function requireCipherBase(){if(hasRequiredCipherBase)return cipherBase;hasRequiredCipherBase=1;var s=requireSafeBuffer$1().Buffer,t=requireStreamBrowserify().Transform,f=requireString_decoder().StringDecoder,o=requireInherits_browser(),d=requireToBuffer$2();function r(h){t.call(this),this.hashMode=typeof h=="string",this.hashMode?this[h]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}return o(r,t),r.prototype.update=function(h,c,n){var a=d(h,c),e=this._update(a);return this.hashMode?this:(n&&(e=this._toString(e,n)),e)},r.prototype.setAutoPadding=function(){},r.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},r.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},r.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},r.prototype._transform=function(h,c,n){var a;try{this.hashMode?this._update(h):this.push(this._update(h))}catch(e){a=e}finally{n(a)}},r.prototype._flush=function(h){var c;try{this.push(this.__final())}catch(n){c=n}h(c)},r.prototype._finalOrDigest=function(h){var c=this.__final()||s.alloc(0);return h&&(c=this._toString(c,h,!0)),c},r.prototype._toString=function(h,c,n){if(this._decoder||(this._decoder=new f(c),this._encoding=c),this._encoding!==c)throw new Error("can’t switch encodings");var a=this._decoder.write(h);return n&&(a+=this._decoder.end()),a},cipherBase=r,cipherBase}var browser$9,hasRequiredBrowser$9;function requireBrowser$9(){if(hasRequiredBrowser$9)return browser$9;hasRequiredBrowser$9=1;var s=requireInherits_browser(),t=requireMd5_js(),f=requireRipemd160(),o=requireSha_js(),d=requireCipherBase();function r(h){d.call(this,"digest"),this._hash=h}return s(r,d),r.prototype._update=function(h){this._hash.update(h)},r.prototype._final=function(){return this._hash.digest()},browser$9=function(c){return c=c.toLowerCase(),c==="md5"?new t:c==="rmd160"||c==="ripemd160"?new f:new r(o(c))},browser$9}var legacy,hasRequiredLegacy;function requireLegacy(){if(hasRequiredLegacy)return legacy;hasRequiredLegacy=1;var s=requireInherits_browser(),t=requireSafeBuffer$1().Buffer,f=requireCipherBase(),o=t.alloc(128),d=64;function r(h,c){f.call(this,"digest"),typeof c=="string"&&(c=t.from(c)),this._alg=h,this._key=c,c.length>d?c=h(c):c.length<d&&(c=t.concat([c,o],d));for(var n=this._ipad=t.allocUnsafe(d),a=this._opad=t.allocUnsafe(d),e=0;e<d;e++)n[e]=c[e]^54,a[e]=c[e]^92;this._hash=[n]}return s(r,f),r.prototype._update=function(h){this._hash.push(h)},r.prototype._final=function(){var h=this._alg(t.concat(this._hash));return this._alg(t.concat([this._opad,h]))},legacy=r,legacy}var md5,hasRequiredMd5;function requireMd5(){if(hasRequiredMd5)return md5;hasRequiredMd5=1;var s=requireMd5_js();return md5=function(t){return new s().update(t).digest()},md5}var browser$8,hasRequiredBrowser$8;function requireBrowser$8(){if(hasRequiredBrowser$8)return browser$8;hasRequiredBrowser$8=1;var s=requireInherits_browser(),t=requireLegacy(),f=requireCipherBase(),o=requireSafeBuffer$1().Buffer,d=requireMd5(),r=requireRipemd160(),h=requireSha_js(),c=o.alloc(128);function n(a,e){f.call(this,"digest"),typeof e=="string"&&(e=o.from(e));var u=a==="sha512"||a==="sha384"?128:64;if(this._alg=a,this._key=e,e.length>u){var l=a==="rmd160"?new r:h(a);e=l.update(e).digest()}else e.length<u&&(e=o.concat([e,c],u));for(var v=this._ipad=o.allocUnsafe(u),b=this._opad=o.allocUnsafe(u),m=0;m<u;m++)v[m]=e[m]^54,b[m]=e[m]^92;this._hash=a==="rmd160"?new r:h(a),this._hash.update(v)}return s(n,f),n.prototype._update=function(a){this._hash.update(a)},n.prototype._final=function(){var a=this._hash.digest(),e=this._alg==="rmd160"?new r:h(this._alg);return e.update(this._opad).update(a).digest()},browser$8=function(e,u){return e=e.toLowerCase(),e==="rmd160"||e==="ripemd160"?new n("rmd160",u):e==="md5"?new t(d,u):new n(e,u)},browser$8}const sha224WithRSAEncryption={sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption={sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption={sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption={sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},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={sign:"dsa",hash:"sha1",id:""},ripemd160WithRSA={sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption={sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},require$$6={sha224WithRSAEncryption,"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption,"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption,"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption,"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,sha224,sha384,sha512,"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA,"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,"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption,"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}};var algos,hasRequiredAlgos;function requireAlgos(){return hasRequiredAlgos||(hasRequiredAlgos=1,algos=require$$6),algos}var browser$7={},precondition,hasRequiredPrecondition;function requirePrecondition(){if(hasRequiredPrecondition)return precondition;hasRequiredPrecondition=1;var s=isFinite,t=Math.pow(2,30)-1;return precondition=function(f,o){if(typeof f!="number")throw new TypeError("Iterations not a number");if(f<0||!s(f))throw new TypeError("Bad iterations");if(typeof o!="number")throw new TypeError("Key length not a number");if(o<0||o>t||o!==o)throw new TypeError("Bad key length")},precondition}var defaultEncoding_1,hasRequiredDefaultEncoding;function requireDefaultEncoding(){if(hasRequiredDefaultEncoding)return defaultEncoding_1;hasRequiredDefaultEncoding=1;var s;if(commonjsGlobal.process&&commonjsGlobal.process.browser)s="utf-8";else if(commonjsGlobal.process&&commonjsGlobal.process.version){var t=parseInt(process$1.version.split(".")[0].slice(1),10);s=t>=6?"utf-8":"binary"}else s="utf-8";return defaultEncoding_1=s,defaultEncoding_1}var toBuffer_1,hasRequiredToBuffer;function requireToBuffer(){if(hasRequiredToBuffer)return toBuffer_1;hasRequiredToBuffer=1;var s=requireSafeBuffer$1().Buffer,t=requireToBuffer$2(),f=typeof Uint8Array<"u",o=f&&typeof ArrayBuffer<"u",d=o&&ArrayBuffer.isView;return toBuffer_1=function(r,h,c){if(typeof r=="string"||s.isBuffer(r)||f&&r instanceof Uint8Array||d&&d(r))return t(r,h);throw new TypeError(c+" must be a string, a Buffer, a Uint8Array, or a DataView")},toBuffer_1}var syncBrowser,hasRequiredSyncBrowser;function requireSyncBrowser(){if(hasRequiredSyncBrowser)return syncBrowser;hasRequiredSyncBrowser=1;var s=requireMd5(),t=requireRipemd160(),f=requireSha_js(),o=requireSafeBuffer$1().Buffer,d=requirePrecondition(),r=requireDefaultEncoding(),h=requireToBuffer(),c=o.alloc(128),n={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,ripemd160:20,rmd160:20},a={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"};function e(b){return new t().update(b).digest()}function u(b){function m(B){return f(b).update(B).digest()}return b==="rmd160"||b==="ripemd160"?e:b==="md5"?s:m}function l(b,m,B){var E=u(b),S=b==="sha512"||b==="sha384"?128:64;m.length>S?m=E(m):m.length<S&&(m=o.concat([m,c],S));for(var O=o.allocUnsafe(S+n[b]),D=o.allocUnsafe(S+n[b]),$=0;$<S;$++)O[$]=m[$]^54,D[$]=m[$]^92;var H=o.allocUnsafe(S+B+4);O.copy(H,0,0,S),this.ipad1=H,this.ipad2=O,this.opad=D,this.alg=b,this.blocksize=S,this.hash=E,this.size=n[b]}l.prototype.run=function(b,m){b.copy(m,this.blocksize);var B=this.hash(m);return B.copy(this.opad,this.blocksize),this.hash(this.opad)};function v(b,m,B,E,S){d(B,E),b=h(b,r,"Password"),m=h(m,r,"Salt");var O=(S||"sha1").toLowerCase(),D=a[O]||O,$=n[D];if(typeof $!="number"||!$)throw new TypeError("Digest algorithm not supported: "+S);var H=new l(D,b,m.length),Y=o.allocUnsafe(E),ie=o.allocUnsafe(m.length+4);m.copy(ie,0,0,m.length);for(var ne=0,de=$,X=Math.ceil(E/de),y=1;y<=X;y++){ie.writeUInt32BE(y,m.length);for(var g=H.run(ie,H.ipad1),p=g,_=1;_<B;_++){p=H.run(p,H.ipad2);for(var R=0;R<de;R++)g[R]^=p[R]}g.copy(Y,ne),ne+=de}return Y}return syncBrowser=v,syncBrowser}var async,hasRequiredAsync;function requireAsync(){if(hasRequiredAsync)return async;hasRequiredAsync=1;var s=requireSafeBuffer$1().Buffer,t=requirePrecondition(),f=requireDefaultEncoding(),o=requireSyncBrowser(),d=requireToBuffer(),r,h=commonjsGlobal.crypto&&commonjsGlobal.crypto.subtle,c={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"},n=[],a;function e(){return a||(commonjsGlobal.process&&commonjsGlobal.process.nextTick?a=commonjsGlobal.process.nextTick:commonjsGlobal.queueMicrotask?a=commonjsGlobal.queueMicrotask:commonjsGlobal.setImmediate?a=commonjsGlobal.setImmediate:a=commonjsGlobal.setTimeout,a)}function u(b,m,B,E,S){return h.importKey("raw",b,{name:"PBKDF2"},!1,["deriveBits"]).then(function(O){return h.deriveBits({name:"PBKDF2",salt:m,iterations:B,hash:{name:S}},O,E<<3)}).then(function(O){return s.from(O)})}function l(b){if(commonjsGlobal.process&&!commonjsGlobal.process.browser||!h||!h.importKey||!h.deriveBits)return Promise.resolve(!1);if(n[b]!==void 0)return n[b];r=r||s.alloc(8);var m=u(r,r,10,128,b).then(function(){return!0},function(){return!1});return n[b]=m,m}function v(b,m){b.then(function(B){e()(function(){m(null,B)})},function(B){e()(function(){m(B)})})}return async=function(b,m,B,E,S,O){if(typeof S=="function"&&(O=S,S=void 0),t(B,E),b=d(b,f,"Password"),m=d(m,f,"Salt"),typeof O!="function")throw new Error("No callback provided to pbkdf2");S=S||"sha1";var D=c[S.toLowerCase()];if(!D||typeof commonjsGlobal.Promise!="function"){e()(function(){var $;try{$=o(b,m,B,E,S)}catch(H){O(H);return}O(null,$)});return}v(l(D).then(function($){return $?u(b,m,B,E,D):o(b,m,B,E,S)}),O)},async}var hasRequiredBrowser$7;function requireBrowser$7(){return hasRequiredBrowser$7||(hasRequiredBrowser$7=1,browser$7.pbkdf2=requireAsync(),browser$7.pbkdf2Sync=requireSyncBrowser()),browser$7}var browser$6={},des$1={},utils$3={},hasRequiredUtils$4;function requireUtils$4(){if(hasRequiredUtils$4)return utils$3;hasRequiredUtils$4=1,utils$3.readUInt32BE=function(d,r){var h=d[0+r]<<24|d[1+r]<<16|d[2+r]<<8|d[3+r];return h>>>0},utils$3.writeUInt32BE=function(d,r,h){d[0+h]=r>>>24,d[1+h]=r>>>16&255,d[2+h]=r>>>8&255,d[3+h]=r&255},utils$3.ip=function(d,r,h,c){for(var n=0,a=0,e=6;e>=0;e-=2){for(var u=0;u<=24;u+=8)n<<=1,n|=r>>>u+e&1;for(var u=0;u<=24;u+=8)n<<=1,n|=d>>>u+e&1}for(var e=6;e>=0;e-=2){for(var u=1;u<=25;u+=8)a<<=1,a|=r>>>u+e&1;for(var u=1;u<=25;u+=8)a<<=1,a|=d>>>u+e&1}h[c+0]=n>>>0,h[c+1]=a>>>0},utils$3.rip=function(d,r,h,c){for(var n=0,a=0,e=0;e<4;e++)for(var u=24;u>=0;u-=8)n<<=1,n|=r>>>u+e&1,n<<=1,n|=d>>>u+e&1;for(var e=4;e<8;e++)for(var u=24;u>=0;u-=8)a<<=1,a|=r>>>u+e&1,a<<=1,a|=d>>>u+e&1;h[c+0]=n>>>0,h[c+1]=a>>>0},utils$3.pc1=function(d,r,h,c){for(var n=0,a=0,e=7;e>=5;e--){for(var u=0;u<=24;u+=8)n<<=1,n|=r>>u+e&1;for(var u=0;u<=24;u+=8)n<<=1,n|=d>>u+e&1}for(var u=0;u<=24;u+=8)n<<=1,n|=r>>u+e&1;for(var e=1;e<=3;e++){for(var u=0;u<=24;u+=8)a<<=1,a|=r>>u+e&1;for(var u=0;u<=24;u+=8)a<<=1,a|=d>>u+e&1}for(var u=0;u<=24;u+=8)a<<=1,a|=d>>u+e&1;h[c+0]=n>>>0,h[c+1]=a>>>0},utils$3.r28shl=function(d,r){return d<<r&268435455|d>>>28-r};var s=[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];utils$3.pc2=function(d,r,h,c){for(var n=0,a=0,e=s.length>>>1,u=0;u<e;u++)n<<=1,n|=d>>>s[u]&1;for(var u=e;u<s.length;u++)a<<=1,a|=r>>>s[u]&1;h[c+0]=n>>>0,h[c+1]=a>>>0},utils$3.expand=function(d,r,h){var c=0,n=0;c=(d&1)<<5|d>>>27;for(var a=23;a>=15;a-=4)c<<=6,c|=d>>>a&63;for(var a=11;a>=3;a-=4)n|=d>>>a&63,n<<=6;n|=(d&31)<<1|d>>>31,r[h+0]=c>>>0,r[h+1]=n>>>0};var t=[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];utils$3.substitute=function(d,r){for(var h=0,c=0;c<4;c++){var n=d>>>18-c*6&63,a=t[c*64+n];h<<=4,h|=a}for(var c=0;c<4;c++){var n=r>>>18-c*6&63,a=t[256+c*64+n];h<<=4,h|=a}return h>>>0};var f=[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];return utils$3.permute=function(d){for(var r=0,h=0;h<f.length;h++)r<<=1,r|=d>>>f[h]&1;return r>>>0},utils$3.padSplit=function(d,r,h){for(var c=d.toString(2);c.length<r;)c="0"+c;for(var n=[],a=0;a<r;a+=h)n.push(c.slice(a,a+h));return n.join(" ")},utils$3}var minimalisticAssert,hasRequiredMinimalisticAssert;function requireMinimalisticAssert(){if(hasRequiredMinimalisticAssert)return minimalisticAssert;hasRequiredMinimalisticAssert=1,minimalisticAssert=s;function s(t,f){if(!t)throw new Error(f||"Assertion failed")}return s.equal=function(f,o,d){if(f!=o)throw new Error(d||"Assertion failed: "+f+" != "+o)},minimalisticAssert}var cipher,hasRequiredCipher;function requireCipher(){if(hasRequiredCipher)return cipher;hasRequiredCipher=1;var s=requireMinimalisticAssert();function t(f){this.options=f,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0,this.padding=f.padding!==!1}return cipher=t,t.prototype._init=function(){},t.prototype.update=function(o){return o.length===0?[]:this.type==="decrypt"?this._updateDecrypt(o):this._updateEncrypt(o)},t.prototype._buffer=function(o,d){for(var r=Math.min(this.buffer.length-this.bufferOff,o.length-d),h=0;h<r;h++)this.buffer[this.bufferOff+h]=o[d+h];return this.bufferOff+=r,r},t.prototype._flushBuffer=function(o,d){return this._update(this.buffer,0,o,d),this.bufferOff=0,this.blockSize},t.prototype._updateEncrypt=function(o){var d=0,r=0,h=(this.bufferOff+o.length)/this.blockSize|0,c=new Array(h*this.blockSize);this.bufferOff!==0&&(d+=this._buffer(o,d),this.bufferOff===this.buffer.length&&(r+=this._flushBuffer(c,r)));for(var n=o.length-(o.length-d)%this.blockSize;d<n;d+=this.blockSize)this._update(o,d,c,r),r+=this.blockSize;for(;d<o.length;d++,this.bufferOff++)this.buffer[this.bufferOff]=o[d];return c},t.prototype._updateDecrypt=function(o){for(var d=0,r=0,h=Math.ceil((this.bufferOff+o.length)/this.blockSize)-1,c=new Array(h*this.blockSize);h>0;h--)d+=this._buffer(o,d),r+=this._flushBuffer(c,r);return d+=this._buffer(o,d),c},t.prototype.final=function(o){var d;o&&(d=this.update(o));var r;return this.type==="encrypt"?r=this._finalEncrypt():r=this._finalDecrypt(),d?d.concat(r):r},t.prototype._pad=function(o,d){if(d===0)return!1;for(;d<o.length;)o[d++]=0;return!0},t.prototype._finalEncrypt=function(){if(!this._pad(this.buffer,this.bufferOff))return[];var o=new Array(this.blockSize);return this._update(this.buffer,0,o,0),o},t.prototype._unpad=function(o){return o},t.prototype._finalDecrypt=function(){s.equal(this.bufferOff,this.blockSize,"Not enough data to decrypt");var o=new Array(this.blockSize);return this._flushBuffer(o,0),this._unpad(o)},cipher}var des,hasRequiredDes$1;function requireDes$1(){if(hasRequiredDes$1)return des;hasRequiredDes$1=1;var s=requireMinimalisticAssert(),t=requireInherits_browser(),f=requireUtils$4(),o=requireCipher();function d(){this.tmp=new Array(2),this.keys=null}function r(c){o.call(this,c);var n=new d;this._desState=n,this.deriveKeys(n,c.key)}t(r,o),des=r,r.create=function(n){return new r(n)};var h=[1,1,2,2,2,2,2,2,1,2,2,2,2,2,2,1];return r.prototype.deriveKeys=function(n,a){n.keys=new Array(32),s.equal(a.length,this.blockSize,"Invalid key length");var e=f.readUInt32BE(a,0),u=f.readUInt32BE(a,4);f.pc1(e,u,n.tmp,0),e=n.tmp[0],u=n.tmp[1];for(var l=0;l<n.keys.length;l+=2){var v=h[l>>>1];e=f.r28shl(e,v),u=f.r28shl(u,v),f.pc2(e,u,n.keys,l)}},r.prototype._update=function(n,a,e,u){var l=this._desState,v=f.readUInt32BE(n,a),b=f.readUInt32BE(n,a+4);f.ip(v,b,l.tmp,0),v=l.tmp[0],b=l.tmp[1],this.type==="encrypt"?this._encrypt(l,v,b,l.tmp,0):this._decrypt(l,v,b,l.tmp,0),v=l.tmp[0],b=l.tmp[1],f.writeUInt32BE(e,v,u),f.writeUInt32BE(e,b,u+4)},r.prototype._pad=function(n,a){if(this.padding===!1)return!1;for(var e=n.length-a,u=a;u<n.length;u++)n[u]=e;return!0},r.prototype._unpad=function(n){if(this.padding===!1)return n;for(var a=n[n.length-1],e=n.length-a;e<n.length;e++)s.equal(n[e],a);return n.slice(0,n.length-a)},r.prototype._encrypt=function(n,a,e,u,l){for(var v=a,b=e,m=0;m<n.keys.length;m+=2){var B=n.keys[m],E=n.keys[m+1];f.expand(b,n.tmp,0),B^=n.tmp[0],E^=n.tmp[1];var S=f.substitute(B,E),O=f.permute(S),D=b;b=(v^O)>>>0,v=D}f.rip(b,v,u,l)},r.prototype._decrypt=function(n,a,e,u,l){for(var v=e,b=a,m=n.keys.length-2;m>=0;m-=2){var B=n.keys[m],E=n.keys[m+1];f.expand(v,n.tmp,0),B^=n.tmp[0],E^=n.tmp[1];var S=f.substitute(B,E),O=f.permute(S),D=v;v=(b^O)>>>0,b=D}f.rip(v,b,u,l)},des}var cbc$1={},hasRequiredCbc$1;function requireCbc$1(){if(hasRequiredCbc$1)return cbc$1;hasRequiredCbc$1=1;var s=requireMinimalisticAssert(),t=requireInherits_browser(),f={};function o(r){s.equal(r.length,8,"Invalid IV length"),this.iv=new Array(8);for(var h=0;h<this.iv.length;h++)this.iv[h]=r[h]}function d(r){function h(e){r.call(this,e),this._cbcInit()}t(h,r);for(var c=Object.keys(f),n=0;n<c.length;n++){var a=c[n];h.prototype[a]=f[a]}return h.create=function(u){return new h(u)},h}return cbc$1.instantiate=d,f._cbcInit=function(){var h=new o(this.options.iv);this._cbcState=h},f._update=function(h,c,n,a){var e=this._cbcState,u=this.constructor.super_.prototype,l=e.iv;if(this.type==="encrypt"){for(var v=0;v<this.blockSize;v++)l[v]^=h[c+v];u._update.call(this,l,0,n,a);for(var v=0;v<this.blockSize;v++)l[v]=n[a+v]}else{u._update.call(this,h,c,n,a);for(var v=0;v<this.blockSize;v++)n[a+v]^=l[v];for(var v=0;v<this.blockSize;v++)l[v]=h[c+v]}},cbc$1}var ede,hasRequiredEde;function requireEde(){if(hasRequiredEde)return ede;hasRequiredEde=1;var s=requireMinimalisticAssert(),t=requireInherits_browser(),f=requireCipher(),o=requireDes$1();function d(h,c){s.equal(c.length,24,"Invalid key length");var n=c.slice(0,8),a=c.slice(8,16),e=c.slice(16,24);h==="encrypt"?this.ciphers=[o.create({type:"encrypt",key:n}),o.create({type:"decrypt",key:a}),o.create({type:"encrypt",key:e})]:this.ciphers=[o.create({type:"decrypt",key:e}),o.create({type:"encrypt",key:a}),o.create({type:"decrypt",key:n})]}function r(h){f.call(this,h);var c=new d(this.type,this.options.key);this._edeState=c}return t(r,f),ede=r,r.create=function(c){return new r(c)},r.prototype._update=function(c,n,a,e){var u=this._edeState;u.ciphers[0]._update(c,n,a,e),u.ciphers[1]._update(a,e,a,e),u.ciphers[2]._update(a,e,a,e)},r.prototype._pad=o.prototype._pad,r.prototype._unpad=o.prototype._unpad,ede}var hasRequiredDes;function requireDes(){return hasRequiredDes||(hasRequiredDes=1,des$1.utils=requireUtils$4(),des$1.Cipher=requireCipher(),des$1.DES=requireDes$1(),des$1.CBC=requireCbc$1(),des$1.EDE=requireEde()),des$1}var browserifyDes,hasRequiredBrowserifyDes;function requireBrowserifyDes(){if(hasRequiredBrowserifyDes)return browserifyDes;hasRequiredBrowserifyDes=1;var s=requireCipherBase(),t=requireDes(),f=requireInherits_browser(),o=requireSafeBuffer$1().Buffer,d={"des-ede3-cbc":t.CBC.instantiate(t.EDE),"des-ede3":t.EDE,"des-ede-cbc":t.CBC.instantiate(t.EDE),"des-ede":t.EDE,"des-cbc":t.CBC.instantiate(t.DES),"des-ecb":t.DES};d.des=d["des-cbc"],d.des3=d["des-ede3-cbc"],browserifyDes=r,f(r,s);function r(h){s.call(this);var c=h.mode.toLowerCase(),n=d[c],a;h.decrypt?a="decrypt":a="encrypt";var e=h.key;o.isBuffer(e)||(e=o.from(e)),(c==="des-ede"||c==="des-ede-cbc")&&(e=o.concat([e,e.slice(0,8)]));var u=h.iv;o.isBuffer(u)||(u=o.from(u)),this._des=n.create({key:e,iv:u,type:a})}return r.prototype._update=function(h){return o.from(this._des.update(h))},r.prototype._final=function(){return o.from(this._des.final())},browserifyDes}var browser$5={},encrypter={},ecb={},hasRequiredEcb;function requireEcb(){return hasRequiredEcb||(hasRequiredEcb=1,ecb.encrypt=function(s,t){return s._cipher.encryptBlock(t)},ecb.decrypt=function(s,t){return s._cipher.decryptBlock(t)}),ecb}var cbc={},bufferXor,hasRequiredBufferXor;function requireBufferXor(){return hasRequiredBufferXor||(hasRequiredBufferXor=1,bufferXor=function(t,f){for(var o=Math.min(t.length,f.length),d=new Buffer(o),r=0;r<o;++r)d[r]=t[r]^f[r];return d}),bufferXor}var hasRequiredCbc;function requireCbc(){if(hasRequiredCbc)return cbc;hasRequiredCbc=1;var s=requireBufferXor();return cbc.encrypt=function(t,f){var o=s(f,t._prev);return t._prev=t._cipher.encryptBlock(o),t._prev},cbc.decrypt=function(t,f){var o=t._prev;t._prev=f;var d=t._cipher.decryptBlock(f);return s(d,o)},cbc}var cfb={},hasRequiredCfb;function requireCfb(){if(hasRequiredCfb)return cfb;hasRequiredCfb=1;var s=requireSafeBuffer$1().Buffer,t=requireBufferXor();function f(o,d,r){var h=d.length,c=t(d,o._cache);return o._cache=o._cache.slice(h),o._prev=s.concat([o._prev,r?d:c]),c}return cfb.encrypt=function(o,d,r){for(var h=s.allocUnsafe(0),c;d.length;)if(o._cache.length===0&&(o._cache=o._cipher.encryptBlock(o._prev),o._prev=s.allocUnsafe(0)),o._cache.length<=d.length)c=o._cache.length,h=s.concat([h,f(o,d.slice(0,c),r)]),d=d.slice(c);else{h=s.concat([h,f(o,d,r)]);break}return h},cfb}var cfb8={},hasRequiredCfb8;function requireCfb8(){if(hasRequiredCfb8)return cfb8;hasRequiredCfb8=1;var s=requireSafeBuffer$1().Buffer;function t(f,o,d){var r=f._cipher.encryptBlock(f._prev),h=r[0]^o;return f._prev=s.concat([f._prev.slice(1),s.from([d?o:h])]),h}return cfb8.encrypt=function(f,o,d){for(var r=o.length,h=s.allocUnsafe(r),c=-1;++c<r;)h[c]=t(f,o[c],d);return h},cfb8}var cfb1={},hasRequiredCfb1;function requireCfb1(){if(hasRequiredCfb1)return cfb1;hasRequiredCfb1=1;var s=requireSafeBuffer$1().Buffer;function t(o,d,r){for(var h,c=-1,n=8,a=0,e,u;++c<n;)h=o._cipher.encryptBlock(o._prev),e=d&1<<7-c?128:0,u=h[0]^e,a+=(u&128)>>c%8,o._prev=f(o._prev,r?e:u);return a}function f(o,d){var r=o.length,h=-1,c=s.allocUnsafe(o.length);for(o=s.concat([o,s.from([d])]);++h<r;)c[h]=o[h]<<1|o[h+1]>>7;return c}return cfb1.encrypt=function(o,d,r){for(var h=d.length,c=s.allocUnsafe(h),n=-1;++n<h;)c[n]=t(o,d[n],r);return c},cfb1}var ofb={},hasRequiredOfb;function requireOfb(){if(hasRequiredOfb)return ofb;hasRequiredOfb=1;var s=requireBufferXor();function t(f){return f._prev=f._cipher.encryptBlock(f._prev),f._prev}return ofb.encrypt=function(f,o){for(;f._cache.length<o.length;)f._cache=Buffer.concat([f._cache,t(f)]);var d=f._cache.slice(0,o.length);return f._cache=f._cache.slice(o.length),s(o,d)},ofb}var ctr={},incr32_1,hasRequiredIncr32;function requireIncr32(){if(hasRequiredIncr32)return incr32_1;hasRequiredIncr32=1;function s(t){for(var f=t.length,o;f--;)if(o=t.readUInt8(f),o===255)t.writeUInt8(0,f);else{o++,t.writeUInt8(o,f);break}}return incr32_1=s,incr32_1}var hasRequiredCtr;function requireCtr(){if(hasRequiredCtr)return ctr;hasRequiredCtr=1;var s=requireBufferXor(),t=requireSafeBuffer$1().Buffer,f=requireIncr32();function o(r){var h=r._cipher.encryptBlockRaw(r._prev);return f(r._prev),h}var d=16;return ctr.encrypt=function(r,h){var c=Math.ceil(h.length/d),n=r._cache.length;r._cache=t.concat([r._cache,t.allocUnsafe(c*d)]);for(var a=0;a<c;a++){var e=o(r),u=n+a*d;r._cache.writeUInt32BE(e[0],u+0),r._cache.writeUInt32BE(e[1],u+4),r._cache.writeUInt32BE(e[2],u+8),r._cache.writeUInt32BE(e[3],u+12)}var l=r._cache.slice(0,h.length);return r._cache=r._cache.slice(h.length),s(h,l)},ctr}const 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"},require$$2={"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,aes192,aes256,"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"}};var modes_1,hasRequiredModes$1;function requireModes$1(){if(hasRequiredModes$1)return modes_1;hasRequiredModes$1=1;var s={ECB:requireEcb(),CBC:requireCbc(),CFB:requireCfb(),CFB8:requireCfb8(),CFB1:requireCfb1(),OFB:requireOfb(),CTR:requireCtr(),GCM:requireCtr()},t=require$$2;for(var f in t)t[f].module=s[t[f].mode];return modes_1=t,modes_1}var aes={},hasRequiredAes;function requireAes(){if(hasRequiredAes)return aes;hasRequiredAes=1;var s=requireSafeBuffer$1().Buffer;function t(c){s.isBuffer(c)||(c=s.from(c));for(var n=c.length/4|0,a=new Array(n),e=0;e<n;e++)a[e]=c.readUInt32BE(e*4);return a}function f(c){for(var n=0;n<c.length;c++)c[n]=0}function o(c,n,a,e,u){for(var l=a[0],v=a[1],b=a[2],m=a[3],B=c[0]^n[0],E=c[1]^n[1],S=c[2]^n[2],O=c[3]^n[3],D,$,H,Y,ie=4,ne=1;ne<u;ne++)D=l[B>>>24]^v[E>>>16&255]^b[S>>>8&255]^m[O&255]^n[ie++],$=l[E>>>24]^v[S>>>16&255]^b[O>>>8&255]^m[B&255]^n[ie++],H=l[S>>>24]^v[O>>>16&255]^b[B>>>8&255]^m[E&255]^n[ie++],Y=l[O>>>24]^v[B>>>16&255]^b[E>>>8&255]^m[S&255]^n[ie++],B=D,E=$,S=H,O=Y;return D=(e[B>>>24]<<24|e[E>>>16&255]<<16|e[S>>>8&255]<<8|e[O&255])^n[ie++],$=(e[E>>>24]<<24|e[S>>>16&255]<<16|e[O>>>8&255]<<8|e[B&255])^n[ie++],H=(e[S>>>24]<<24|e[O>>>16&255]<<16|e[B>>>8&255]<<8|e[E&255])^n[ie++],Y=(e[O>>>24]<<24|e[B>>>16&255]<<16|e[E>>>8&255]<<8|e[S&255])^n[ie++],D=D>>>0,$=$>>>0,H=H>>>0,Y=Y>>>0,[D,$,H,Y]}var d=[0,1,2,4,8,16,32,64,128,27,54],r=(function(){for(var c=new Array(256),n=0;n<256;n++)n<128?c[n]=n<<1:c[n]=n<<1^283;for(var a=[],e=[],u=[[],[],[],[]],l=[[],[],[],[]],v=0,b=0,m=0;m<256;++m){var B=b^b<<1^b<<2^b<<3^b<<4;B=B>>>8^B&255^99,a[v]=B,e[B]=v;var E=c[v],S=c[E],O=c[S],D=c[B]*257^B*16843008;u[0][v]=D<<24|D>>>8,u[1][v]=D<<16|D>>>16,u[2][v]=D<<8|D>>>24,u[3][v]=D,D=O*16843009^S*65537^E*257^v*16843008,l[0][B]=D<<24|D>>>8,l[1][B]=D<<16|D>>>16,l[2][B]=D<<8|D>>>24,l[3][B]=D,v===0?v=b=1:(v=E^c[c[c[O^E]]],b^=c[c[b]])}return{SBOX:a,INV_SBOX:e,SUB_MIX:u,INV_SUB_MIX:l}})();function h(c){this._key=t(c),this._reset()}return h.blockSize=16,h.keySize=256/8,h.prototype.blockSize=h.blockSize,h.prototype.keySize=h.keySize,h.prototype._reset=function(){for(var c=this._key,n=c.length,a=n+6,e=(a+1)*4,u=[],l=0;l<n;l++)u[l]=c[l];for(l=n;l<e;l++){var v=u[l-1];l%n===0?(v=v<<8|v>>>24,v=r.SBOX[v>>>24]<<24|r.SBOX[v>>>16&255]<<16|r.SBOX[v>>>8&255]<<8|r.SBOX[v&255],v^=d[l/n|0]<<24):n>6&&l%n===4&&(v=r.SBOX[v>>>24]<<24|r.SBOX[v>>>16&255]<<16|r.SBOX[v>>>8&255]<<8|r.SBOX[v&255]),u[l]=u[l-n]^v}for(var b=[],m=0;m<e;m++){var B=e-m,E=u[B-(m%4?0:4)];m<4||B<=4?b[m]=E:b[m]=r.INV_SUB_MIX[0][r.SBOX[E>>>24]]^r.INV_SUB_MIX[1][r.SBOX[E>>>16&255]]^r.INV_SUB_MIX[2][r.SBOX[E>>>8&255]]^r.INV_SUB_MIX[3][r.SBOX[E&255]]}this._nRounds=a,this._keySchedule=u,this._invKeySchedule=b},h.prototype.encryptBlockRaw=function(c){return c=t(c),o(c,this._keySchedule,r.SUB_MIX,r.SBOX,this._nRounds)},h.prototype.encryptBlock=function(c){var n=this.encryptBlockRaw(c),a=s.allocUnsafe(16);return a.writeUInt32BE(n[0],0),a.writeUInt32BE(n[1],4),a.writeUInt32BE(n[2],8),a.writeUInt32BE(n[3],12),a},h.prototype.decryptBlock=function(c){c=t(c);var n=c[1];c[1]=c[3],c[3]=n;var a=o(c,this._invKeySchedule,r.INV_SUB_MIX,r.INV_SBOX,this._nRounds),e=s.allocUnsafe(16);return e.writeUInt32BE(a[0],0),e.writeUInt32BE(a[3],4),e.writeUInt32BE(a[2],8),e.writeUInt32BE(a[1],12),e},h.prototype.scrub=function(){f(this._keySchedule),f(this._invKeySchedule),f(this._key)},aes.AES=h,aes}var ghash,hasRequiredGhash;function requireGhash(){if(hasRequiredGhash)return ghash;hasRequiredGhash=1;var s=requireSafeBuffer$1().Buffer,t=s.alloc(16,0);function f(r){return[r.readUInt32BE(0),r.readUInt32BE(4),r.readUInt32BE(8),r.readUInt32BE(12)]}function o(r){var h=s.allocUnsafe(16);return h.writeUInt32BE(r[0]>>>0,0),h.writeUInt32BE(r[1]>>>0,4),h.writeUInt32BE(r[2]>>>0,8),h.writeUInt32BE(r[3]>>>0,12),h}function d(r){this.h=r,this.state=s.alloc(16,0),this.cache=s.allocUnsafe(0)}return d.prototype.ghash=function(r){for(var h=-1;++h<r.length;)this.state[h]^=r[h];this._multiply()},d.prototype._multiply=function(){for(var r=f(this.h),h=[0,0,0,0],c,n,a,e=-1;++e<128;){for(n=(this.state[~~(e/8)]&1<<7-e%8)!==0,n&&(h[0]^=r[0],h[1]^=r[1],h[2]^=r[2],h[3]^=r[3]),a=(r[3]&1)!==0,c=3;c>0;c--)r[c]=r[c]>>>1|(r[c-1]&1)<<31;r[0]=r[0]>>>1,a&&(r[0]=r[0]^225<<24)}this.state=o(h)},d.prototype.update=function(r){this.cache=s.concat([this.cache,r]);for(var h;this.cache.length>=16;)h=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(h)},d.prototype.final=function(r,h){return this.cache.length&&this.ghash(s.concat([this.cache,t],16)),this.ghash(o([0,r,0,h])),this.state},ghash=d,ghash}var authCipher,hasRequiredAuthCipher;function requireAuthCipher(){if(hasRequiredAuthCipher)return authCipher;hasRequiredAuthCipher=1;var s=requireAes(),t=requireSafeBuffer$1().Buffer,f=requireCipherBase(),o=requireInherits_browser(),d=requireGhash(),r=requireBufferXor(),h=requireIncr32();function c(e,u){var l=0;e.length!==u.length&&l++;for(var v=Math.min(e.length,u.length),b=0;b<v;++b)l+=e[b]^u[b];return l}function n(e,u,l){if(u.length===12)return e._finID=t.concat([u,t.from([0,0,0,1])]),t.concat([u,t.from([0,0,0,2])]);var v=new d(l),b=u.length,m=b%16;v.update(u),m&&(m=16-m,v.update(t.alloc(m,0))),v.update(t.alloc(8,0));var B=b*8,E=t.alloc(8);E.writeUIntBE(B,0,8),v.update(E),e._finID=v.state;var S=t.from(e._finID);return h(S),S}function a(e,u,l,v){f.call(this);var b=t.alloc(4,0);this._cipher=new s.AES(u);var m=this._cipher.encryptBlock(b);this._ghash=new d(m),l=n(this,l,m),this._prev=t.from(l),this._cache=t.allocUnsafe(0),this._secCache=t.allocUnsafe(0),this._decrypt=v,this._alen=0,this._len=0,this._mode=e,this._authTag=null,this._called=!1}return o(a,f),a.prototype._update=function(e){if(!this._called&&this._alen){var u=16-this._alen%16;u<16&&(u=t.alloc(u,0),this._ghash.update(u))}this._called=!0;var l=this._mode.encrypt(this,e);return this._decrypt?this._ghash.update(e):this._ghash.update(l),this._len+=e.length,l},a.prototype._final=function(){if(this._decrypt&&!this._authTag)throw new Error("Unsupported state or unable to authenticate data");var e=r(this._ghash.final(this._alen*8,this._len*8),this._cipher.encryptBlock(this._finID));if(this._decrypt&&c(e,this._authTag))throw new Error("Unsupported state or unable to authenticate data");this._authTag=e,this._cipher.scrub()},a.prototype.getAuthTag=function(){if(this._decrypt||!t.isBuffer(this._authTag))throw new Error("Attempting to get auth tag in unsupported state");return this._authTag},a.prototype.setAuthTag=function(u){if(!this._decrypt)throw new Error("Attempting to set auth tag in unsupported state");this._authTag=u},a.prototype.setAAD=function(u){if(this._called)throw new Error("Attempting to set AAD in unsupported state");this._ghash.update(u),this._alen+=u.length},authCipher=a,authCipher}var streamCipher,hasRequiredStreamCipher;function requireStreamCipher(){if(hasRequiredStreamCipher)return streamCipher;hasRequiredStreamCipher=1;var s=requireAes(),t=requireSafeBuffer$1().Buffer,f=requireCipherBase(),o=requireInherits_browser();function d(r,h,c,n){f.call(this),this._cipher=new s.AES(h),this._prev=t.from(c),this._cache=t.allocUnsafe(0),this._secCache=t.allocUnsafe(0),this._decrypt=n,this._mode=r}return o(d,f),d.prototype._update=function(r){return this._mode.encrypt(this,r,this._decrypt)},d.prototype._final=function(){this._cipher.scrub()},streamCipher=d,streamCipher}var evp_bytestokey,hasRequiredEvp_bytestokey;function requireEvp_bytestokey(){if(hasRequiredEvp_bytestokey)return evp_bytestokey;hasRequiredEvp_bytestokey=1;var s=requireSafeBuffer$1().Buffer,t=requireMd5_js();function f(o,d,r,h){if(s.isBuffer(o)||(o=s.from(o,"binary")),d&&(s.isBuffer(d)||(d=s.from(d,"binary")),d.length!==8))throw new RangeError("salt should be Buffer with 8 byte length");for(var c=r/8,n=s.alloc(c),a=s.alloc(h||0),e=s.alloc(0);c>0||h>0;){var u=new t;u.update(e),u.update(o),d&&u.update(d),e=u.digest();var l=0;if(c>0){var v=n.length-c;l=Math.min(c,e.length),e.copy(n,v,0,l),c-=l}if(l<e.length&&h>0){var b=a.length-h,m=Math.min(h,e.length-l);e.copy(a,b,l,l+m),h-=m}}return e.fill(0),{key:n,iv:a}}return evp_bytestokey=f,evp_bytestokey}var hasRequiredEncrypter;function requireEncrypter(){if(hasRequiredEncrypter)return encrypter;hasRequiredEncrypter=1;var s=requireModes$1(),t=requireAuthCipher(),f=requireSafeBuffer$1().Buffer,o=requireStreamCipher(),d=requireCipherBase(),r=requireAes(),h=requireEvp_bytestokey(),c=requireInherits_browser();function n(v,b,m){d.call(this),this._cache=new e,this._cipher=new r.AES(b),this._prev=f.from(m),this._mode=v,this._autopadding=!0}c(n,d),n.prototype._update=function(v){this._cache.add(v);for(var b,m,B=[];b=this._cache.get();)m=this._mode.encrypt(this,b),B.push(m);return f.concat(B)};var a=f.alloc(16,16);n.prototype._final=function(){var v=this._cache.flush();if(this._autopadding)return v=this._mode.encrypt(this,v),this._cipher.scrub(),v;if(!v.equals(a))throw this._cipher.scrub(),new Error("data not multiple of block length")},n.prototype.setAutoPadding=function(v){return this._autopadding=!!v,this};function e(){this.cache=f.allocUnsafe(0)}e.prototype.add=function(v){this.cache=f.concat([this.cache,v])},e.prototype.get=function(){if(this.cache.length>15){var v=this.cache.slice(0,16);return this.cache=this.cache.slice(16),v}return null},e.prototype.flush=function(){for(var v=16-this.cache.length,b=f.allocUnsafe(v),m=-1;++m<v;)b.writeUInt8(v,m);return f.concat([this.cache,b])};function u(v,b,m){var B=s[v.toLowerCase()];if(!B)throw new TypeError("invalid suite type");if(typeof b=="string"&&(b=f.from(b)),b.length!==B.key/8)throw new TypeError("invalid key length "+b.length);if(typeof m=="string"&&(m=f.from(m)),B.mode!=="GCM"&&m.length!==B.iv)throw new TypeError("invalid iv length "+m.length);return B.type==="stream"?new o(B.module,b,m):B.type==="auth"?new t(B.module,b,m):new n(B.module,b,m)}function l(v,b){var m=s[v.toLowerCase()];if(!m)throw new TypeError("invalid suite type");var B=h(b,!1,m.key,m.iv);return u(v,B.key,B.iv)}return encrypter.createCipheriv=u,encrypter.createCipher=l,encrypter}var decrypter={},hasRequiredDecrypter;function requireDecrypter(){if(hasRequiredDecrypter)return decrypter;hasRequiredDecrypter=1;var s=requireAuthCipher(),t=requireSafeBuffer$1().Buffer,f=requireModes$1(),o=requireStreamCipher(),d=requireCipherBase(),r=requireAes(),h=requireEvp_bytestokey(),c=requireInherits_browser();function n(v,b,m){d.call(this),this._cache=new a,this._last=void 0,this._cipher=new r.AES(b),this._prev=t.from(m),this._mode=v,this._autopadding=!0}c(n,d),n.prototype._update=function(v){this._cache.add(v);for(var b,m,B=[];b=this._cache.get(this._autopadding);)m=this._mode.decrypt(this,b),B.push(m);return t.concat(B)},n.prototype._final=function(){var v=this._cache.flush();if(this._autopadding)return e(this._mode.decrypt(this,v));if(v)throw new Error("data not multiple of block length")},n.prototype.setAutoPadding=function(v){return this._autopadding=!!v,this};function a(){this.cache=t.allocUnsafe(0)}a.prototype.add=function(v){this.cache=t.concat([this.cache,v])},a.prototype.get=function(v){var b;if(v){if(this.cache.length>16)return b=this.cache.slice(0,16),this.cache=this.cache.slice(16),b}else if(this.cache.length>=16)return b=this.cache.slice(0,16),this.cache=this.cache.slice(16),b;return null},a.prototype.flush=function(){if(this.cache.length)return this.cache};function e(v){var b=v[15];if(b<1||b>16)throw new Error("unable to decrypt data");for(var m=-1;++m<b;)if(v[m+(16-b)]!==b)throw new Error("unable to decrypt data");if(b!==16)return v.slice(0,16-b)}function u(v,b,m){var B=f[v.toLowerCase()];if(!B)throw new TypeError("invalid suite type");if(typeof m=="string"&&(m=t.from(m)),B.mode!=="GCM"&&m.length!==B.iv)throw new TypeError("invalid iv length "+m.length);if(typeof b=="string"&&(b=t.from(b)),b.length!==B.key/8)throw new TypeError("invalid key length "+b.length);return B.type==="stream"?new o(B.module,b,m,!0):B.type==="auth"?new s(B.module,b,m,!0):new n(B.module,b,m)}function l(v,b){var m=f[v.toLowerCase()];if(!m)throw new TypeError("invalid suite type");var B=h(b,!1,m.key,m.iv);return u(v,B.key,B.iv)}return decrypter.createDecipher=l,decrypter.createDecipheriv=u,decrypter}var hasRequiredBrowser$6;function requireBrowser$6(){if(hasRequiredBrowser$6)return browser$5;hasRequiredBrowser$6=1;var s=requireEncrypter(),t=requireDecrypter(),f=require$$2;function o(){return Object.keys(f)}return browser$5.createCipher=browser$5.Cipher=s.createCipher,browser$5.createCipheriv=browser$5.Cipheriv=s.createCipheriv,browser$5.createDecipher=browser$5.Decipher=t.createDecipher,browser$5.createDecipheriv=browser$5.Decipheriv=t.createDecipheriv,browser$5.listCiphers=browser$5.getCiphers=o,browser$5}var modes={},hasRequiredModes;function requireModes(){return hasRequiredModes||(hasRequiredModes=1,(function(s){s["des-ecb"]={key:8,iv:0},s["des-cbc"]=s.des={key:8,iv:8},s["des-ede3-cbc"]=s.des3={key:24,iv:8},s["des-ede3"]={key:24,iv:0},s["des-ede-cbc"]={key:16,iv:8},s["des-ede"]={key:16,iv:0}})(modes)),modes}var hasRequiredBrowser$5;function requireBrowser$5(){if(hasRequiredBrowser$5)return browser$6;hasRequiredBrowser$5=1;var s=requireBrowserifyDes(),t=requireBrowser$6(),f=requireModes$1(),o=requireModes(),d=requireEvp_bytestokey();function r(e,u){e=e.toLowerCase();var l,v;if(f[e])l=f[e].key,v=f[e].iv;else if(o[e])l=o[e].key*8,v=o[e].iv;else throw new TypeError("invalid suite type");var b=d(u,!1,l,v);return c(e,b.key,b.iv)}function h(e,u){e=e.toLowerCase();var l,v;if(f[e])l=f[e].key,v=f[e].iv;else if(o[e])l=o[e].key*8,v=o[e].iv;else throw new TypeError("invalid suite type");var b=d(u,!1,l,v);return n(e,b.key,b.iv)}function c(e,u,l){if(e=e.toLowerCase(),f[e])return t.createCipheriv(e,u,l);if(o[e])return new s({key:u,iv:l,mode:e});throw new TypeError("invalid suite type")}function n(e,u,l){if(e=e.toLowerCase(),f[e])return t.createDecipheriv(e,u,l);if(o[e])return new s({key:u,iv:l,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}function a(){return Object.keys(o).concat(t.getCiphers())}return browser$6.createCipher=browser$6.Cipher=r,browser$6.createCipheriv=browser$6.Cipheriv=c,browser$6.createDecipher=browser$6.Decipher=h,browser$6.createDecipheriv=browser$6.Decipheriv=n,browser$6.listCiphers=browser$6.getCiphers=a,browser$6}var browser$4={},bn$3={exports:{}},bn$2=bn$3.exports,hasRequiredBn$1;function requireBn$1(){return hasRequiredBn$1||(hasRequiredBn$1=1,(function(s){(function(t,f){function o(X,y){if(!X)throw new Error(y||"Assertion failed")}function d(X,y){X.super_=y;var g=function(){};g.prototype=y.prototype,X.prototype=new g,X.prototype.constructor=X}function r(X,y,g){if(r.isBN(X))return X;this.negative=0,this.words=null,this.length=0,this.red=null,X!==null&&((y==="le"||y==="be")&&(g=y,y=10),this._init(X||0,y||10,g||"be"))}typeof t=="object"?t.exports=r:f.BN=r,r.BN=r,r.wordSize=26;var h;try{typeof window<"u"&&typeof window.Buffer<"u"?h=window.Buffer:h=requireDist().Buffer}catch{}r.isBN=function(y){return y instanceof r?!0:y!==null&&typeof y=="object"&&y.constructor.wordSize===r.wordSize&&Array.isArray(y.words)},r.max=function(y,g){return y.cmp(g)>0?y:g},r.min=function(y,g){return y.cmp(g)<0?y:g},r.prototype._init=function(y,g,p){if(typeof y=="number")return this._initNumber(y,g,p);if(typeof y=="object")return this._initArray(y,g,p);g==="hex"&&(g=16),o(g===(g|0)&&g>=2&&g<=36),y=y.toString().replace(/\s+/g,"");var _=0;y[0]==="-"&&(_++,this.negative=1),_<y.length&&(g===16?this._parseHex(y,_,p):(this._parseBase(y,g,_),p==="le"&&this._initArray(this.toArray(),g,p)))},r.prototype._initNumber=function(y,g,p){y<0&&(this.negative=1,y=-y),y<67108864?(this.words=[y&67108863],this.length=1):y<4503599627370496?(this.words=[y&67108863,y/67108864&67108863],this.length=2):(o(y<9007199254740992),this.words=[y&67108863,y/67108864&67108863,1],this.length=3),p==="le"&&this._initArray(this.toArray(),g,p)},r.prototype._initArray=function(y,g,p){if(o(typeof y.length=="number"),y.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(y.length/3),this.words=new Array(this.length);for(var _=0;_<this.length;_++)this.words[_]=0;var R,q,T=0;if(p==="be")for(_=y.length-1,R=0;_>=0;_-=3)q=y[_]|y[_-1]<<8|y[_-2]<<16,this.words[R]|=q<<T&67108863,this.words[R+1]=q>>>26-T&67108863,T+=24,T>=26&&(T-=26,R++);else if(p==="le")for(_=0,R=0;_<y.length;_+=3)q=y[_]|y[_+1]<<8|y[_+2]<<16,this.words[R]|=q<<T&67108863,this.words[R+1]=q>>>26-T&67108863,T+=24,T>=26&&(T-=26,R++);return this.strip()};function c(X,y){var g=X.charCodeAt(y);return g>=65&&g<=70?g-55:g>=97&&g<=102?g-87:g-48&15}function n(X,y,g){var p=c(X,g);return g-1>=y&&(p|=c(X,g-1)<<4),p}r.prototype._parseHex=function(y,g,p){this.length=Math.ceil((y.length-g)/6),this.words=new Array(this.length);for(var _=0;_<this.length;_++)this.words[_]=0;var R=0,q=0,T;if(p==="be")for(_=y.length-1;_>=g;_-=2)T=n(y,g,_)<<R,this.words[q]|=T&67108863,R>=18?(R-=18,q+=1,this.words[q]|=T>>>26):R+=8;else{var A=y.length-g;for(_=A%2===0?g+1:g;_<y.length;_+=2)T=n(y,g,_)<<R,this.words[q]|=T&67108863,R>=18?(R-=18,q+=1,this.words[q]|=T>>>26):R+=8}this.strip()};function a(X,y,g,p){for(var _=0,R=Math.min(X.length,g),q=y;q<R;q++){var T=X.charCodeAt(q)-48;_*=p,T>=49?_+=T-49+10:T>=17?_+=T-17+10:_+=T}return _}r.prototype._parseBase=function(y,g,p){this.words=[0],this.length=1;for(var _=0,R=1;R<=67108863;R*=g)_++;_--,R=R/g|0;for(var q=y.length-p,T=q%_,A=Math.min(q,q-T)+p,w=0,M=p;M<A;M+=_)w=a(y,M,M+_,g),this.imuln(R),this.words[0]+w<67108864?this.words[0]+=w:this._iaddn(w);if(T!==0){var x=1;for(w=a(y,M,y.length,g),M=0;M<T;M++)x*=g;this.imuln(x),this.words[0]+w<67108864?this.words[0]+=w:this._iaddn(w)}this.strip()},r.prototype.copy=function(y){y.words=new Array(this.length);for(var g=0;g<this.length;g++)y.words[g]=this.words[g];y.length=this.length,y.negative=this.negative,y.red=this.red},r.prototype.clone=function(){var y=new r(null);return this.copy(y),y},r.prototype._expand=function(y){for(;this.length<y;)this.words[this.length++]=0;return this},r.prototype.strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},r.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},r.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var e=["","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],l=[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];r.prototype.toString=function(y,g){y=y||10,g=g|0||1;var p;if(y===16||y==="hex"){p="";for(var _=0,R=0,q=0;q<this.length;q++){var T=this.words[q],A=((T<<_|R)&16777215).toString(16);R=T>>>24-_&16777215,_+=2,_>=26&&(_-=26,q--),R!==0||q!==this.length-1?p=e[6-A.length]+A+p:p=A+p}for(R!==0&&(p=R.toString(16)+p);p.length%g!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}if(y===(y|0)&&y>=2&&y<=36){var w=u[y],M=l[y];p="";var x=this.clone();for(x.negative=0;!x.isZero();){var L=x.modn(M).toString(y);x=x.idivn(M),x.isZero()?p=L+p:p=e[w-L.length]+L+p}for(this.isZero()&&(p="0"+p);p.length%g!==0;)p="0"+p;return this.negative!==0&&(p="-"+p),p}o(!1,"Base should be between 2 and 36")},r.prototype.toNumber=function(){var y=this.words[0];return this.length===2?y+=this.words[1]*67108864:this.length===3&&this.words[2]===1?y+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-y:y},r.prototype.toJSON=function(){return this.toString(16)},r.prototype.toBuffer=function(y,g){return o(typeof h<"u"),this.toArrayLike(h,y,g)},r.prototype.toArray=function(y,g){return this.toArrayLike(Array,y,g)},r.prototype.toArrayLike=function(y,g,p){var _=this.byteLength(),R=p||Math.max(1,_);o(_<=R,"byte array longer than desired length"),o(R>0,"Requested array length <= 0"),this.strip();var q=g==="le",T=new y(R),A,w,M=this.clone();if(q){for(w=0;!M.isZero();w++)A=M.andln(255),M.iushrn(8),T[w]=A;for(;w<R;w++)T[w]=0}else{for(w=0;w<R-_;w++)T[w]=0;for(w=0;!M.isZero();w++)A=M.andln(255),M.iushrn(8),T[R-w-1]=A}return T},Math.clz32?r.prototype._countBits=function(y){return 32-Math.clz32(y)}:r.prototype._countBits=function(y){var g=y,p=0;return g>=4096&&(p+=13,g>>>=13),g>=64&&(p+=7,g>>>=7),g>=8&&(p+=4,g>>>=4),g>=2&&(p+=2,g>>>=2),p+g},r.prototype._zeroBits=function(y){if(y===0)return 26;var g=y,p=0;return(g&8191)===0&&(p+=13,g>>>=13),(g&127)===0&&(p+=7,g>>>=7),(g&15)===0&&(p+=4,g>>>=4),(g&3)===0&&(p+=2,g>>>=2),(g&1)===0&&p++,p},r.prototype.bitLength=function(){var y=this.words[this.length-1],g=this._countBits(y);return(this.length-1)*26+g};function v(X){for(var y=new Array(X.bitLength()),g=0;g<y.length;g++){var p=g/26|0,_=g%26;y[g]=(X.words[p]&1<<_)>>>_}return y}r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var y=0,g=0;g<this.length;g++){var p=this._zeroBits(this.words[g]);if(y+=p,p!==26)break}return y},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(y){return this.negative!==0?this.abs().inotn(y).iaddn(1):this.clone()},r.prototype.fromTwos=function(y){return this.testn(y-1)?this.notn(y).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return this.negative!==0},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(y){for(;this.length<y.length;)this.words[this.length++]=0;for(var g=0;g<y.length;g++)this.words[g]=this.words[g]|y.words[g];return this.strip()},r.prototype.ior=function(y){return o((this.negative|y.negative)===0),this.iuor(y)},r.prototype.or=function(y){return this.length>y.length?this.clone().ior(y):y.clone().ior(this)},r.prototype.uor=function(y){return this.length>y.length?this.clone().iuor(y):y.clone().iuor(this)},r.prototype.iuand=function(y){var g;this.length>y.length?g=y:g=this;for(var p=0;p<g.length;p++)this.words[p]=this.words[p]&y.words[p];return this.length=g.length,this.strip()},r.prototype.iand=function(y){return o((this.negative|y.negative)===0),this.iuand(y)},r.prototype.and=function(y){return this.length>y.length?this.clone().iand(y):y.clone().iand(this)},r.prototype.uand=function(y){return this.length>y.length?this.clone().iuand(y):y.clone().iuand(this)},r.prototype.iuxor=function(y){var g,p;this.length>y.length?(g=this,p=y):(g=y,p=this);for(var _=0;_<p.length;_++)this.words[_]=g.words[_]^p.words[_];if(this!==g)for(;_<g.length;_++)this.words[_]=g.words[_];return this.length=g.length,this.strip()},r.prototype.ixor=function(y){return o((this.negative|y.negative)===0),this.iuxor(y)},r.prototype.xor=function(y){return this.length>y.length?this.clone().ixor(y):y.clone().ixor(this)},r.prototype.uxor=function(y){return this.length>y.length?this.clone().iuxor(y):y.clone().iuxor(this)},r.prototype.inotn=function(y){o(typeof y=="number"&&y>=0);var g=Math.ceil(y/26)|0,p=y%26;this._expand(g),p>0&&g--;for(var _=0;_<g;_++)this.words[_]=~this.words[_]&67108863;return p>0&&(this.words[_]=~this.words[_]&67108863>>26-p),this.strip()},r.prototype.notn=function(y){return this.clone().inotn(y)},r.prototype.setn=function(y,g){o(typeof y=="number"&&y>=0);var p=y/26|0,_=y%26;return this._expand(p+1),g?this.words[p]=this.words[p]|1<<_:this.words[p]=this.words[p]&~(1<<_),this.strip()},r.prototype.iadd=function(y){var g;if(this.negative!==0&&y.negative===0)return this.negative=0,g=this.isub(y),this.negative^=1,this._normSign();if(this.negative===0&&y.negative!==0)return y.negative=0,g=this.isub(y),y.negative=1,g._normSign();var p,_;this.length>y.length?(p=this,_=y):(p=y,_=this);for(var R=0,q=0;q<_.length;q++)g=(p.words[q]|0)+(_.words[q]|0)+R,this.words[q]=g&67108863,R=g>>>26;for(;R!==0&&q<p.length;q++)g=(p.words[q]|0)+R,this.words[q]=g&67108863,R=g>>>26;if(this.length=p.length,R!==0)this.words[this.length]=R,this.length++;else if(p!==this)for(;q<p.length;q++)this.words[q]=p.words[q];return this},r.prototype.add=function(y){var g;return y.negative!==0&&this.negative===0?(y.negative=0,g=this.sub(y),y.negative^=1,g):y.negative===0&&this.negative!==0?(this.negative=0,g=y.sub(this),this.negative=1,g):this.length>y.length?this.clone().iadd(y):y.clone().iadd(this)},r.prototype.isub=function(y){if(y.negative!==0){y.negative=0;var g=this.iadd(y);return y.negative=1,g._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(y),this.negative=1,this._normSign();var p=this.cmp(y);if(p===0)return this.negative=0,this.length=1,this.words[0]=0,this;var _,R;p>0?(_=this,R=y):(_=y,R=this);for(var q=0,T=0;T<R.length;T++)g=(_.words[T]|0)-(R.words[T]|0)+q,q=g>>26,this.words[T]=g&67108863;for(;q!==0&&T<_.length;T++)g=(_.words[T]|0)+q,q=g>>26,this.words[T]=g&67108863;if(q===0&&T<_.length&&_!==this)for(;T<_.length;T++)this.words[T]=_.words[T];return this.length=Math.max(this.length,T),_!==this&&(this.negative=1),this.strip()},r.prototype.sub=function(y){return this.clone().isub(y)};function b(X,y,g){g.negative=y.negative^X.negative;var p=X.length+y.length|0;g.length=p,p=p-1|0;var _=X.words[0]|0,R=y.words[0]|0,q=_*R,T=q&67108863,A=q/67108864|0;g.words[0]=T;for(var w=1;w<p;w++){for(var M=A>>>26,x=A&67108863,L=Math.min(w,y.length-1),K=Math.max(0,w-X.length+1);K<=L;K++){var Q=w-K|0;_=X.words[Q]|0,R=y.words[K]|0,q=_*R+x,M+=q/67108864|0,x=q&67108863}g.words[w]=x|0,A=M|0}return A!==0?g.words[w]=A|0:g.length--,g.strip()}var m=function(y,g,p){var _=y.words,R=g.words,q=p.words,T=0,A,w,M,x=_[0]|0,L=x&8191,K=x>>>13,Q=_[1]|0,j=Q&8191,N=Q>>>13,F=_[2]|0,ee=F&8191,ae=F>>>13,G=_[3]|0,z=G&8191,fe=G>>>13,me=_[4]|0,xe=me&8191,_e=me>>>13,qe=_[5]|0,Re=qe&8191,be=qe>>>13,Fe=_[6]|0,Be=Fe&8191,Me=Fe>>>13,Pe=_[7]|0,oe=Pe&8191,ce=Pe>>>13,ge=_[8]|0,we=ge&8191,Se=ge>>>13,Oe=_[9]|0,U=Oe&8191,I=Oe>>>13,C=R[0]|0,J=C&8191,se=C>>>13,le=R[1]|0,ve=le&8191,Ce=le>>>13,Le=R[2]|0,Ie=Le&8191,je=Le>>>13,$e=R[3]|0,Ve=$e&8191,Ke=$e>>>13,Xe=R[4]|0,We=Xe&8191,Ze=Xe>>>13,Ye=R[5]|0,W=Ye&8191,P=Ye>>>13,k=R[6]|0,re=k&8191,ue=k>>>13,pe=R[7]|0,ye=pe&8191,ke=pe>>>13,He=R[8]|0,Ne=He&8191,ze=He>>>13,Ue=R[9]|0,Ge=Ue&8191,Je=Ue>>>13;p.negative=y.negative^g.negative,p.length=19,A=Math.imul(L,J),w=Math.imul(L,se),w=w+Math.imul(K,J)|0,M=Math.imul(K,se);var Qe=(T+A|0)+((w&8191)<<13)|0;T=(M+(w>>>13)|0)+(Qe>>>26)|0,Qe&=67108863,A=Math.imul(j,J),w=Math.imul(j,se),w=w+Math.imul(N,J)|0,M=Math.imul(N,se),A=A+Math.imul(L,ve)|0,w=w+Math.imul(L,Ce)|0,w=w+Math.imul(K,ve)|0,M=M+Math.imul(K,Ce)|0;var er=(T+A|0)+((w&8191)<<13)|0;T=(M+(w>>>13)|0)+(er>>>26)|0,er&=67108863,A=Math.imul(ee,J),w=Math.imul(ee,se),w=w+Math.imul(ae,J)|0,M=Math.imul(ae,se),A=A+Math.imul(j,ve)|0,w=w+Math.imul(j,Ce)|0,w=w+Math.imul(N,ve)|0,M=M+Math.imul(N,Ce)|0,A=A+Math.imul(L,Ie)|0,w=w+Math.imul(L,je)|0,w=w+Math.imul(K,Ie)|0,M=M+Math.imul(K,je)|0;var fr=(T+A|0)+((w&8191)<<13)|0;T=(M+(w>>>13)|0)+(fr>>>26)|0,fr&=67108863,A=Math.imul(z,J),w=Math.imul(z,se),w=w+Math.imul(fe,J)|0,M=Math.imul(fe,se),A=A+Math.imul(ee,ve)|0,w=w+Math.imul(ee,Ce)|0,w=w+Math.imul(ae,ve)|0,M=M+Math.imul(ae,Ce)|0,A=A+Math.imul(j,Ie)|0,w=w+Math.imul(j,je)|0,w=w+Math.imul(N,Ie)|0,M=M+Math.imul(N,je)|0,A=A+Math.imul(L,Ve)|0,w=w+Math.imul(L,Ke)|0,w=w+Math.imul(K,Ve)|0,M=M+Math.imul(K,Ke)|0;var ur=(T+A|0)+((w&8191)<<13)|0;T=(M+(w>>>13)|0)+(ur>>>26)|0,ur&=67108863,A=Math.imul(xe,J),w=Math.imul(xe,se),w=w+Math.imul(_e,J)|0,M=Math.imul(_e,se),A=A+Math.imul(z,ve)|0,w=w+Math.imul(z,Ce)|0,w=w+Math.imul(fe,ve)|0,M=M+Math.imul(fe,Ce)|0,A=A+Math.imul(ee,Ie)|0,w=w+Math.imul(ee,je)|0,w=w+Math.imul(ae,Ie)|0,M=M+Math.imul(ae,je)|0,A=A+Math.imul(j,Ve)|0,w=w+Math.imul(j,Ke)|0,w=w+Math.imul(N,Ve)|0,M=M+Math.imul(N,Ke)|0,A=A+Math.imul(L,We)|0,w=w+Math.imul(L,Ze)|0,w=w+Math.imul(K,We)|0,M=M+Math.imul(K,Ze)|0;var cr=(T+A|0)+((w&8191)<<13)|0;T=(M+(w>>>13)|0)+(cr>>>26)|0,cr&=67108863,A=Math.imul(Re,J),w=Math.imul(Re,se),w=w+Math.imul(be,J)|0,M=Math.imul(be,se),A=A+Math.imul(xe,ve)|0,w=w+Math.imul(xe,Ce)|0,w=w+Math.imul(_e,ve)|0,M=M+Math.imul(_e,Ce)|0,A=A+Math.imul(z,Ie)|0,w=w+Math.imul(z,je)|0,w=w+Math.imul(fe,Ie)|0,M=M+Math.imul(fe,je)|0,A=A+Math.imul(ee,Ve)|0,w=w+Math.imul(ee,Ke)|0,w=w+Math.imul(ae,Ve)|0,M=M+Math.imul(ae,Ke)|0,A=A+Math.imul(j,We)|0,w=w+Math.imul(j,Ze)|0,w=w+Math.imul(N,We)|0,M=M+Math.imul(N,Ze)|0,A=A+Math.imul(L,W)|0,w=w+Math.imul(L,P)|0,w=w+Math.imul(K,W)|0,M=M+Math.imul(K,P)|0;var nr=(T+A|0)+((w&8191)<<13)|0;T=(M+(w>>>13)|0)+(nr>>>26)|0,nr&=67108863,A=Math.imul(Be,J),w=Math.imul(Be,se),w=w+Math.imul(Me,J)|0,M=Math.imul(Me,se),A=A+Math.imul(Re,ve)|0,w=w+Math.imul(Re,Ce)|0,w=w+Math.imul(be,ve)|0,M=M+Math.imul(be,Ce)|0,A=A+Math.imul(xe,Ie)|0,w=w+Math.imul(xe,je)|0,w=w+Math.imul(_e,Ie)|0,M=M+Math.imul(_e,je)|0,A=A+Math.imul(z,Ve)|0,w=w+Math.imul(z,Ke)|0,w=w+Math.imul(fe,Ve)|0,M=M+Math.imul(fe,Ke)|0,A=A+Math.imul(ee,We)|0,w=w+Math.imul(ee,Ze)|0,w=w+Math.imul(ae,We)|0,M=M+Math.imul(ae,Ze)|0,A=A+Math.imul(j,W)|0,w=w+Math.imul(j,P)|0,w=w+Math.imul(N,W)|0,M=M+Math.imul(N,P)|0,A=A+Math.imul(L,re)|0,w=w+Math.imul(L,ue)|0,w=w+Math.imul(K,re)|0,M=M+Math.imul(K,ue)|0;var hr=(T+A|0)+((w&8191)<<13)|0;T=(M+(w>>>13)|0)+(hr>>>26)|0,hr&=67108863,A=Math.imul(oe,J),w=Math.imul(oe,se),w=w+Math.imul(ce,J)|0,M=Math.imul(ce,se),A=A+Math.imul(Be,ve)|0,w=w+Math.imul(Be,Ce)|0,w=w+Math.imul(Me,ve)|0,M=M+Math.imul(Me,Ce)|0,A=A+Math.imul(Re,Ie)|0,w=w+Math.imul(Re,je)|0,w=w+Math.imul(be,Ie)|0,M=M+Math.imul(be,je)|0,A=A+Math.imul(xe,Ve)|0,w=w+Math.imul(xe,Ke)|0,w=w+Math.imul(_e,Ve)|0,M=M+Math.imul(_e,Ke)|0,A=A+Math.imul(z,We)|0,w=w+Math.imul(z,Ze)|0,w=w+Math.imul(fe,We)|0,M=M+Math.imul(fe,Ze)|0,A=A+Math.imul(ee,W)|0,w=w+Math.imul(ee,P)|0,w=w+Math.imul(ae,W)|0,M=M+Math.imul(ae,P)|0,A=A+Math.imul(j,re)|0,w=w+Math.imul(j,ue)|0,w=w+Math.imul(N,re)|0,M=M+Math.imul(N,ue)|0,A=A+Math.imul(L,ye)|0,w=w+Math.imul(L,ke)|0,w=w+Math.imul(K,ye)|0,M=M+Math.imul(K,ke)|0;var lr=(T+A|0)+((w&8191)<<13)|0;T=(M+(w>>>13)|0)+(lr>>>26)|0,lr&=67108863,A=Math.imul(we,J),w=Math.imul(we,se),w=w+Math.imul(Se,J)|0,M=Math.imul(Se,se),A=A+Math.imul(oe,ve)|0,w=w+Math.imul(oe,Ce)|0,w=w+Math.imul(ce,ve)|0,M=M+Math.imul(ce,Ce)|0,A=A+Math.imul(Be,Ie)|0,w=w+Math.imul(Be,je)|0,w=w+Math.imul(Me,Ie)|0,M=M+Math.imul(Me,je)|0,A=A+Math.imul(Re,Ve)|0,w=w+Math.imul(Re,Ke)|0,w=w+Math.imul(be,Ve)|0,M=M+Math.imul(be,Ke)|0,A=A+Math.imul(xe,We)|0,w=w+Math.imul(xe,Ze)|0,w=w+Math.imul(_e,We)|0,M=M+Math.imul(_e,Ze)|0,A=A+Math.imul(z,W)|0,w=w+Math.imul(z,P)|0,w=w+Math.imul(fe,W)|0,M=M+Math.imul(fe,P)|0,A=A+Math.imul(ee,re)|0,w=w+Math.imul(ee,ue)|0,w=w+Math.imul(ae,re)|0,M=M+Math.imul(ae,ue)|0,A=A+Math.imul(j,ye)|0,w=w+Math.imul(j,ke)|0,w=w+Math.imul(N,ye)|0,M=M+Math.imul(N,ke)|0,A=A+Math.imul(L,Ne)|0,w=w+Math.imul(L,ze)|0,w=w+Math.imul(K,Ne)|0,M=M+Math.imul(K,ze)|0;var dr=(T+A|0)+((w&8191)<<13)|0;T=(M+(w>>>13)|0)+(dr>>>26)|0,dr&=67108863,A=Math.imul(U,J),w=Math.imul(U,se),w=w+Math.imul(I,J)|0,M=Math.imul(I,se),A=A+Math.imul(we,ve)|0,w=w+Math.imul(we,Ce)|0,w=w+Math.imul(Se,ve)|0,M=M+Math.imul(Se,Ce)|0,A=A+Math.imul(oe,Ie)|0,w=w+Math.imul(oe,je)|0,w=w+Math.imul(ce,Ie)|0,M=M+Math.imul(ce,je)|0,A=A+Math.imul(Be,Ve)|0,w=w+Math.imul(Be,Ke)|0,w=w+Math.imul(Me,Ve)|0,M=M+Math.imul(Me,Ke)|0,A=A+Math.imul(Re,We)|0,w=w+Math.imul(Re,Ze)|0,w=w+Math.imul(be,We)|0,M=M+Math.imul(be,Ze)|0,A=A+Math.imul(xe,W)|0,w=w+Math.imul(xe,P)|0,w=w+Math.imul(_e,W)|0,M=M+Math.imul(_e,P)|0,A=A+Math.imul(z,re)|0,w=w+Math.imul(z,ue)|0,w=w+Math.imul(fe,re)|0,M=M+Math.imul(fe,ue)|0,A=A+Math.imul(ee,ye)|0,w=w+Math.imul(ee,ke)|0,w=w+Math.imul(ae,ye)|0,M=M+Math.imul(ae,ke)|0,A=A+Math.imul(j,Ne)|0,w=w+Math.imul(j,ze)|0,w=w+Math.imul(N,Ne)|0,M=M+Math.imul(N,ze)|0,A=A+Math.imul(L,Ge)|0,w=w+Math.imul(L,Je)|0,w=w+Math.imul(K,Ge)|0,M=M+Math.imul(K,Je)|0;var pr=(T+A|0)+((w&8191)<<13)|0;T=(M+(w>>>13)|0)+(pr>>>26)|0,pr&=67108863,A=Math.imul(U,ve),w=Math.imul(U,Ce),w=w+Math.imul(I,ve)|0,M=Math.imul(I,Ce),A=A+Math.imul(we,Ie)|0,w=w+Math.imul(we,je)|0,w=w+Math.imul(Se,Ie)|0,M=M+Math.imul(Se,je)|0,A=A+Math.imul(oe,Ve)|0,w=w+Math.imul(oe,Ke)|0,w=w+Math.imul(ce,Ve)|0,M=M+Math.imul(ce,Ke)|0,A=A+Math.imul(Be,We)|0,w=w+Math.imul(Be,Ze)|0,w=w+Math.imul(Me,We)|0,M=M+Math.imul(Me,Ze)|0,A=A+Math.imul(Re,W)|0,w=w+Math.imul(Re,P)|0,w=w+Math.imul(be,W)|0,M=M+Math.imul(be,P)|0,A=A+Math.imul(xe,re)|0,w=w+Math.imul(xe,ue)|0,w=w+Math.imul(_e,re)|0,M=M+Math.imul(_e,ue)|0,A=A+Math.imul(z,ye)|0,w=w+Math.imul(z,ke)|0,w=w+Math.imul(fe,ye)|0,M=M+Math.imul(fe,ke)|0,A=A+Math.imul(ee,Ne)|0,w=w+Math.imul(ee,ze)|0,w=w+Math.imul(ae,Ne)|0,M=M+Math.imul(ae,ze)|0,A=A+Math.imul(j,Ge)|0,w=w+Math.imul(j,Je)|0,w=w+Math.imul(N,Ge)|0,M=M+Math.imul(N,Je)|0;var vr=(T+A|0)+((w&8191)<<13)|0;T=(M+(w>>>13)|0)+(vr>>>26)|0,vr&=67108863,A=Math.imul(U,Ie),w=Math.imul(U,je),w=w+Math.imul(I,Ie)|0,M=Math.imul(I,je),A=A+Math.imul(we,Ve)|0,w=w+Math.imul(we,Ke)|0,w=w+Math.imul(Se,Ve)|0,M=M+Math.imul(Se,Ke)|0,A=A+Math.imul(oe,We)|0,w=w+Math.imul(oe,Ze)|0,w=w+Math.imul(ce,We)|0,M=M+Math.imul(ce,Ze)|0,A=A+Math.imul(Be,W)|0,w=w+Math.imul(Be,P)|0,w=w+Math.imul(Me,W)|0,M=M+Math.imul(Me,P)|0,A=A+Math.imul(Re,re)|0,w=w+Math.imul(Re,ue)|0,w=w+Math.imul(be,re)|0,M=M+Math.imul(be,ue)|0,A=A+Math.imul(xe,ye)|0,w=w+Math.imul(xe,ke)|0,w=w+Math.imul(_e,ye)|0,M=M+Math.imul(_e,ke)|0,A=A+Math.imul(z,Ne)|0,w=w+Math.imul(z,ze)|0,w=w+Math.imul(fe,Ne)|0,M=M+Math.imul(fe,ze)|0,A=A+Math.imul(ee,Ge)|0,w=w+Math.imul(ee,Je)|0,w=w+Math.imul(ae,Ge)|0,M=M+Math.imul(ae,Je)|0;var br=(T+A|0)+((w&8191)<<13)|0;T=(M+(w>>>13)|0)+(br>>>26)|0,br&=67108863,A=Math.imul(U,Ve),w=Math.imul(U,Ke),w=w+Math.imul(I,Ve)|0,M=Math.imul(I,Ke),A=A+Math.imul(we,We)|0,w=w+Math.imul(we,Ze)|0,w=w+Math.imul(Se,We)|0,M=M+Math.imul(Se,Ze)|0,A=A+Math.imul(oe,W)|0,w=w+Math.imul(oe,P)|0,w=w+Math.imul(ce,W)|0,M=M+Math.imul(ce,P)|0,A=A+Math.imul(Be,re)|0,w=w+Math.imul(Be,ue)|0,w=w+Math.imul(Me,re)|0,M=M+Math.imul(Me,ue)|0,A=A+Math.imul(Re,ye)|0,w=w+Math.imul(Re,ke)|0,w=w+Math.imul(be,ye)|0,M=M+Math.imul(be,ke)|0,A=A+Math.imul(xe,Ne)|0,w=w+Math.imul(xe,ze)|0,w=w+Math.imul(_e,Ne)|0,M=M+Math.imul(_e,ze)|0,A=A+Math.imul(z,Ge)|0,w=w+Math.imul(z,Je)|0,w=w+Math.imul(fe,Ge)|0,M=M+Math.imul(fe,Je)|0;var yr=(T+A|0)+((w&8191)<<13)|0;T=(M+(w>>>13)|0)+(yr>>>26)|0,yr&=67108863,A=Math.imul(U,We),w=Math.imul(U,Ze),w=w+Math.imul(I,We)|0,M=Math.imul(I,Ze),A=A+Math.imul(we,W)|0,w=w+Math.imul(we,P)|0,w=w+Math.imul(Se,W)|0,M=M+Math.imul(Se,P)|0,A=A+Math.imul(oe,re)|0,w=w+Math.imul(oe,ue)|0,w=w+Math.imul(ce,re)|0,M=M+Math.imul(ce,ue)|0,A=A+Math.imul(Be,ye)|0,w=w+Math.imul(Be,ke)|0,w=w+Math.imul(Me,ye)|0,M=M+Math.imul(Me,ke)|0,A=A+Math.imul(Re,Ne)|0,w=w+Math.imul(Re,ze)|0,w=w+Math.imul(be,Ne)|0,M=M+Math.imul(be,ze)|0,A=A+Math.imul(xe,Ge)|0,w=w+Math.imul(xe,Je)|0,w=w+Math.imul(_e,Ge)|0,M=M+Math.imul(_e,Je)|0;var gr=(T+A|0)+((w&8191)<<13)|0;T=(M+(w>>>13)|0)+(gr>>>26)|0,gr&=67108863,A=Math.imul(U,W),w=Math.imul(U,P),w=w+Math.imul(I,W)|0,M=Math.imul(I,P),A=A+Math.imul(we,re)|0,w=w+Math.imul(we,ue)|0,w=w+Math.imul(Se,re)|0,M=M+Math.imul(Se,ue)|0,A=A+Math.imul(oe,ye)|0,w=w+Math.imul(oe,ke)|0,w=w+Math.imul(ce,ye)|0,M=M+Math.imul(ce,ke)|0,A=A+Math.imul(Be,Ne)|0,w=w+Math.imul(Be,ze)|0,w=w+Math.imul(Me,Ne)|0,M=M+Math.imul(Me,ze)|0,A=A+Math.imul(Re,Ge)|0,w=w+Math.imul(Re,Je)|0,w=w+Math.imul(be,Ge)|0,M=M+Math.imul(be,Je)|0;var wr=(T+A|0)+((w&8191)<<13)|0;T=(M+(w>>>13)|0)+(wr>>>26)|0,wr&=67108863,A=Math.imul(U,re),w=Math.imul(U,ue),w=w+Math.imul(I,re)|0,M=Math.imul(I,ue),A=A+Math.imul(we,ye)|0,w=w+Math.imul(we,ke)|0,w=w+Math.imul(Se,ye)|0,M=M+Math.imul(Se,ke)|0,A=A+Math.imul(oe,Ne)|0,w=w+Math.imul(oe,ze)|0,w=w+Math.imul(ce,Ne)|0,M=M+Math.imul(ce,ze)|0,A=A+Math.imul(Be,Ge)|0,w=w+Math.imul(Be,Je)|0,w=w+Math.imul(Me,Ge)|0,M=M+Math.imul(Me,Je)|0;var rr=(T+A|0)+((w&8191)<<13)|0;T=(M+(w>>>13)|0)+(rr>>>26)|0,rr&=67108863,A=Math.imul(U,ye),w=Math.imul(U,ke),w=w+Math.imul(I,ye)|0,M=Math.imul(I,ke),A=A+Math.imul(we,Ne)|0,w=w+Math.imul(we,ze)|0,w=w+Math.imul(Se,Ne)|0,M=M+Math.imul(Se,ze)|0,A=A+Math.imul(oe,Ge)|0,w=w+Math.imul(oe,Je)|0,w=w+Math.imul(ce,Ge)|0,M=M+Math.imul(ce,Je)|0;var _r=(T+A|0)+((w&8191)<<13)|0;T=(M+(w>>>13)|0)+(_r>>>26)|0,_r&=67108863,A=Math.imul(U,Ne),w=Math.imul(U,ze),w=w+Math.imul(I,Ne)|0,M=Math.imul(I,ze),A=A+Math.imul(we,Ge)|0,w=w+Math.imul(we,Je)|0,w=w+Math.imul(Se,Ge)|0,M=M+Math.imul(Se,Je)|0;var xr=(T+A|0)+((w&8191)<<13)|0;T=(M+(w>>>13)|0)+(xr>>>26)|0,xr&=67108863,A=Math.imul(U,Ge),w=Math.imul(U,Je),w=w+Math.imul(I,Ge)|0,M=Math.imul(I,Je);var Sr=(T+A|0)+((w&8191)<<13)|0;return T=(M+(w>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,q[0]=Qe,q[1]=er,q[2]=fr,q[3]=ur,q[4]=cr,q[5]=nr,q[6]=hr,q[7]=lr,q[8]=dr,q[9]=pr,q[10]=vr,q[11]=br,q[12]=yr,q[13]=gr,q[14]=wr,q[15]=rr,q[16]=_r,q[17]=xr,q[18]=Sr,T!==0&&(q[19]=T,p.length++),p};Math.imul||(m=b);function B(X,y,g){g.negative=y.negative^X.negative,g.length=X.length+y.length;for(var p=0,_=0,R=0;R<g.length-1;R++){var q=_;_=0;for(var T=p&67108863,A=Math.min(R,y.length-1),w=Math.max(0,R-X.length+1);w<=A;w++){var M=R-w,x=X.words[M]|0,L=y.words[w]|0,K=x*L,Q=K&67108863;q=q+(K/67108864|0)|0,Q=Q+T|0,T=Q&67108863,q=q+(Q>>>26)|0,_+=q>>>26,q&=67108863}g.words[R]=T,p=q,q=_}return p!==0?g.words[R]=p:g.length--,g.strip()}function E(X,y,g){var p=new S;return p.mulp(X,y,g)}r.prototype.mulTo=function(y,g){var p,_=this.length+y.length;return this.length===10&&y.length===10?p=m(this,y,g):_<63?p=b(this,y,g):_<1024?p=B(this,y,g):p=E(this,y,g),p};function S(X,y){this.x=X,this.y=y}S.prototype.makeRBT=function(y){for(var g=new Array(y),p=r.prototype._countBits(y)-1,_=0;_<y;_++)g[_]=this.revBin(_,p,y);return g},S.prototype.revBin=function(y,g,p){if(y===0||y===p-1)return y;for(var _=0,R=0;R<g;R++)_|=(y&1)<<g-R-1,y>>=1;return _},S.prototype.permute=function(y,g,p,_,R,q){for(var T=0;T<q;T++)_[T]=g[y[T]],R[T]=p[y[T]]},S.prototype.transform=function(y,g,p,_,R,q){this.permute(q,y,g,p,_,R);for(var T=1;T<R;T<<=1)for(var A=T<<1,w=Math.cos(2*Math.PI/A),M=Math.sin(2*Math.PI/A),x=0;x<R;x+=A)for(var L=w,K=M,Q=0;Q<T;Q++){var j=p[x+Q],N=_[x+Q],F=p[x+Q+T],ee=_[x+Q+T],ae=L*F-K*ee;ee=L*ee+K*F,F=ae,p[x+Q]=j+F,_[x+Q]=N+ee,p[x+Q+T]=j-F,_[x+Q+T]=N-ee,Q!==A&&(ae=w*L-M*K,K=w*K+M*L,L=ae)}},S.prototype.guessLen13b=function(y,g){var p=Math.max(g,y)|1,_=p&1,R=0;for(p=p/2|0;p;p=p>>>1)R++;return 1<<R+1+_},S.prototype.conjugate=function(y,g,p){if(!(p<=1))for(var _=0;_<p/2;_++){var R=y[_];y[_]=y[p-_-1],y[p-_-1]=R,R=g[_],g[_]=-g[p-_-1],g[p-_-1]=-R}},S.prototype.normalize13b=function(y,g){for(var p=0,_=0;_<g/2;_++){var R=Math.round(y[2*_+1]/g)*8192+Math.round(y[2*_]/g)+p;y[_]=R&67108863,R<67108864?p=0:p=R/67108864|0}return y},S.prototype.convert13b=function(y,g,p,_){for(var R=0,q=0;q<g;q++)R=R+(y[q]|0),p[2*q]=R&8191,R=R>>>13,p[2*q+1]=R&8191,R=R>>>13;for(q=2*g;q<_;++q)p[q]=0;o(R===0),o((R&-8192)===0)},S.prototype.stub=function(y){for(var g=new Array(y),p=0;p<y;p++)g[p]=0;return g},S.prototype.mulp=function(y,g,p){var _=2*this.guessLen13b(y.length,g.length),R=this.makeRBT(_),q=this.stub(_),T=new Array(_),A=new Array(_),w=new Array(_),M=new Array(_),x=new Array(_),L=new Array(_),K=p.words;K.length=_,this.convert13b(y.words,y.length,T,_),this.convert13b(g.words,g.length,M,_),this.transform(T,q,A,w,_,R),this.transform(M,q,x,L,_,R);for(var Q=0;Q<_;Q++){var j=A[Q]*x[Q]-w[Q]*L[Q];w[Q]=A[Q]*L[Q]+w[Q]*x[Q],A[Q]=j}return this.conjugate(A,w,_),this.transform(A,w,K,q,_,R),this.conjugate(K,q,_),this.normalize13b(K,_),p.negative=y.negative^g.negative,p.length=y.length+g.length,p.strip()},r.prototype.mul=function(y){var g=new r(null);return g.words=new Array(this.length+y.length),this.mulTo(y,g)},r.prototype.mulf=function(y){var g=new r(null);return g.words=new Array(this.length+y.length),E(this,y,g)},r.prototype.imul=function(y){return this.clone().mulTo(y,this)},r.prototype.imuln=function(y){o(typeof y=="number"),o(y<67108864);for(var g=0,p=0;p<this.length;p++){var _=(this.words[p]|0)*y,R=(_&67108863)+(g&67108863);g>>=26,g+=_/67108864|0,g+=R>>>26,this.words[p]=R&67108863}return g!==0&&(this.words[p]=g,this.length++),this.length=y===0?1:this.length,this},r.prototype.muln=function(y){return this.clone().imuln(y)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(y){var g=v(y);if(g.length===0)return new r(1);for(var p=this,_=0;_<g.length&&g[_]===0;_++,p=p.sqr());if(++_<g.length)for(var R=p.sqr();_<g.length;_++,R=R.sqr())g[_]!==0&&(p=p.mul(R));return p},r.prototype.iushln=function(y){o(typeof y=="number"&&y>=0);var g=y%26,p=(y-g)/26,_=67108863>>>26-g<<26-g,R;if(g!==0){var q=0;for(R=0;R<this.length;R++){var T=this.words[R]&_,A=(this.words[R]|0)-T<<g;this.words[R]=A|q,q=T>>>26-g}q&&(this.words[R]=q,this.length++)}if(p!==0){for(R=this.length-1;R>=0;R--)this.words[R+p]=this.words[R];for(R=0;R<p;R++)this.words[R]=0;this.length+=p}return this.strip()},r.prototype.ishln=function(y){return o(this.negative===0),this.iushln(y)},r.prototype.iushrn=function(y,g,p){o(typeof y=="number"&&y>=0);var _;g?_=(g-g%26)/26:_=0;var R=y%26,q=Math.min((y-R)/26,this.length),T=67108863^67108863>>>R<<R,A=p;if(_-=q,_=Math.max(0,_),A){for(var w=0;w<q;w++)A.words[w]=this.words[w];A.length=q}if(q!==0)if(this.length>q)for(this.length-=q,w=0;w<this.length;w++)this.words[w]=this.words[w+q];else this.words[0]=0,this.length=1;var M=0;for(w=this.length-1;w>=0&&(M!==0||w>=_);w--){var x=this.words[w]|0;this.words[w]=M<<26-R|x>>>R,M=x&T}return A&&M!==0&&(A.words[A.length++]=M),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.ishrn=function(y,g,p){return o(this.negative===0),this.iushrn(y,g,p)},r.prototype.shln=function(y){return this.clone().ishln(y)},r.prototype.ushln=function(y){return this.clone().iushln(y)},r.prototype.shrn=function(y){return this.clone().ishrn(y)},r.prototype.ushrn=function(y){return this.clone().iushrn(y)},r.prototype.testn=function(y){o(typeof y=="number"&&y>=0);var g=y%26,p=(y-g)/26,_=1<<g;if(this.length<=p)return!1;var R=this.words[p];return!!(R&_)},r.prototype.imaskn=function(y){o(typeof y=="number"&&y>=0);var g=y%26,p=(y-g)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=p)return this;if(g!==0&&p++,this.length=Math.min(p,this.length),g!==0){var _=67108863^67108863>>>g<<g;this.words[this.length-1]&=_}return this.length===0&&(this.words[0]=0,this.length=1),this.strip()},r.prototype.maskn=function(y){return this.clone().imaskn(y)},r.prototype.iaddn=function(y){return o(typeof y=="number"),o(y<67108864),y<0?this.isubn(-y):this.negative!==0?this.length===1&&(this.words[0]|0)<y?(this.words[0]=y-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(y),this.negative=1,this):this._iaddn(y)},r.prototype._iaddn=function(y){this.words[0]+=y;for(var g=0;g<this.length&&this.words[g]>=67108864;g++)this.words[g]-=67108864,g===this.length-1?this.words[g+1]=1:this.words[g+1]++;return this.length=Math.max(this.length,g+1),this},r.prototype.isubn=function(y){if(o(typeof y=="number"),o(y<67108864),y<0)return this.iaddn(-y);if(this.negative!==0)return this.negative=0,this.iaddn(y),this.negative=1,this;if(this.words[0]-=y,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var g=0;g<this.length&&this.words[g]<0;g++)this.words[g]+=67108864,this.words[g+1]-=1;return this.strip()},r.prototype.addn=function(y){return this.clone().iaddn(y)},r.prototype.subn=function(y){return this.clone().isubn(y)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(y,g,p){var _=y.length+p,R;this._expand(_);var q,T=0;for(R=0;R<y.length;R++){q=(this.words[R+p]|0)+T;var A=(y.words[R]|0)*g;q-=A&67108863,T=(q>>26)-(A/67108864|0),this.words[R+p]=q&67108863}for(;R<this.length-p;R++)q=(this.words[R+p]|0)+T,T=q>>26,this.words[R+p]=q&67108863;if(T===0)return this.strip();for(o(T===-1),T=0,R=0;R<this.length;R++)q=-(this.words[R]|0)+T,T=q>>26,this.words[R]=q&67108863;return this.negative=1,this.strip()},r.prototype._wordDiv=function(y,g){var p=this.length-y.length,_=this.clone(),R=y,q=R.words[R.length-1]|0,T=this._countBits(q);p=26-T,p!==0&&(R=R.ushln(p),_.iushln(p),q=R.words[R.length-1]|0);var A=_.length-R.length,w;if(g!=="mod"){w=new r(null),w.length=A+1,w.words=new Array(w.length);for(var M=0;M<w.length;M++)w.words[M]=0}var x=_.clone()._ishlnsubmul(R,1,A);x.negative===0&&(_=x,w&&(w.words[A]=1));for(var L=A-1;L>=0;L--){var K=(_.words[R.length+L]|0)*67108864+(_.words[R.length+L-1]|0);for(K=Math.min(K/q|0,67108863),_._ishlnsubmul(R,K,L);_.negative!==0;)K--,_.negative=0,_._ishlnsubmul(R,1,L),_.isZero()||(_.negative^=1);w&&(w.words[L]=K)}return w&&w.strip(),_.strip(),g!=="div"&&p!==0&&_.iushrn(p),{div:w||null,mod:_}},r.prototype.divmod=function(y,g,p){if(o(!y.isZero()),this.isZero())return{div:new r(0),mod:new r(0)};var _,R,q;return this.negative!==0&&y.negative===0?(q=this.neg().divmod(y,g),g!=="mod"&&(_=q.div.neg()),g!=="div"&&(R=q.mod.neg(),p&&R.negative!==0&&R.iadd(y)),{div:_,mod:R}):this.negative===0&&y.negative!==0?(q=this.divmod(y.neg(),g),g!=="mod"&&(_=q.div.neg()),{div:_,mod:q.mod}):(this.negative&y.negative)!==0?(q=this.neg().divmod(y.neg(),g),g!=="div"&&(R=q.mod.neg(),p&&R.negative!==0&&R.isub(y)),{div:q.div,mod:R}):y.length>this.length||this.cmp(y)<0?{div:new r(0),mod:this}:y.length===1?g==="div"?{div:this.divn(y.words[0]),mod:null}:g==="mod"?{div:null,mod:new r(this.modn(y.words[0]))}:{div:this.divn(y.words[0]),mod:new r(this.modn(y.words[0]))}:this._wordDiv(y,g)},r.prototype.div=function(y){return this.divmod(y,"div",!1).div},r.prototype.mod=function(y){return this.divmod(y,"mod",!1).mod},r.prototype.umod=function(y){return this.divmod(y,"mod",!0).mod},r.prototype.divRound=function(y){var g=this.divmod(y);if(g.mod.isZero())return g.div;var p=g.div.negative!==0?g.mod.isub(y):g.mod,_=y.ushrn(1),R=y.andln(1),q=p.cmp(_);return q<0||R===1&&q===0?g.div:g.div.negative!==0?g.div.isubn(1):g.div.iaddn(1)},r.prototype.modn=function(y){o(y<=67108863);for(var g=(1<<26)%y,p=0,_=this.length-1;_>=0;_--)p=(g*p+(this.words[_]|0))%y;return p},r.prototype.idivn=function(y){o(y<=67108863);for(var g=0,p=this.length-1;p>=0;p--){var _=(this.words[p]|0)+g*67108864;this.words[p]=_/y|0,g=_%y}return this.strip()},r.prototype.divn=function(y){return this.clone().idivn(y)},r.prototype.egcd=function(y){o(y.negative===0),o(!y.isZero());var g=this,p=y.clone();g.negative!==0?g=g.umod(y):g=g.clone();for(var _=new r(1),R=new r(0),q=new r(0),T=new r(1),A=0;g.isEven()&&p.isEven();)g.iushrn(1),p.iushrn(1),++A;for(var w=p.clone(),M=g.clone();!g.isZero();){for(var x=0,L=1;(g.words[0]&L)===0&&x<26;++x,L<<=1);if(x>0)for(g.iushrn(x);x-- >0;)(_.isOdd()||R.isOdd())&&(_.iadd(w),R.isub(M)),_.iushrn(1),R.iushrn(1);for(var K=0,Q=1;(p.words[0]&Q)===0&&K<26;++K,Q<<=1);if(K>0)for(p.iushrn(K);K-- >0;)(q.isOdd()||T.isOdd())&&(q.iadd(w),T.isub(M)),q.iushrn(1),T.iushrn(1);g.cmp(p)>=0?(g.isub(p),_.isub(q),R.isub(T)):(p.isub(g),q.isub(_),T.isub(R))}return{a:q,b:T,gcd:p.iushln(A)}},r.prototype._invmp=function(y){o(y.negative===0),o(!y.isZero());var g=this,p=y.clone();g.negative!==0?g=g.umod(y):g=g.clone();for(var _=new r(1),R=new r(0),q=p.clone();g.cmpn(1)>0&&p.cmpn(1)>0;){for(var T=0,A=1;(g.words[0]&A)===0&&T<26;++T,A<<=1);if(T>0)for(g.iushrn(T);T-- >0;)_.isOdd()&&_.iadd(q),_.iushrn(1);for(var w=0,M=1;(p.words[0]&M)===0&&w<26;++w,M<<=1);if(w>0)for(p.iushrn(w);w-- >0;)R.isOdd()&&R.iadd(q),R.iushrn(1);g.cmp(p)>=0?(g.isub(p),_.isub(R)):(p.isub(g),R.isub(_))}var x;return g.cmpn(1)===0?x=_:x=R,x.cmpn(0)<0&&x.iadd(y),x},r.prototype.gcd=function(y){if(this.isZero())return y.abs();if(y.isZero())return this.abs();var g=this.clone(),p=y.clone();g.negative=0,p.negative=0;for(var _=0;g.isEven()&&p.isEven();_++)g.iushrn(1),p.iushrn(1);do{for(;g.isEven();)g.iushrn(1);for(;p.isEven();)p.iushrn(1);var R=g.cmp(p);if(R<0){var q=g;g=p,p=q}else if(R===0||p.cmpn(1)===0)break;g.isub(p)}while(!0);return p.iushln(_)},r.prototype.invm=function(y){return this.egcd(y).a.umod(y)},r.prototype.isEven=function(){return(this.words[0]&1)===0},r.prototype.isOdd=function(){return(this.words[0]&1)===1},r.prototype.andln=function(y){return this.words[0]&y},r.prototype.bincn=function(y){o(typeof y=="number");var g=y%26,p=(y-g)/26,_=1<<g;if(this.length<=p)return this._expand(p+1),this.words[p]|=_,this;for(var R=_,q=p;R!==0&&q<this.length;q++){var T=this.words[q]|0;T+=R,R=T>>>26,T&=67108863,this.words[q]=T}return R!==0&&(this.words[q]=R,this.length++),this},r.prototype.isZero=function(){return this.length===1&&this.words[0]===0},r.prototype.cmpn=function(y){var g=y<0;if(this.negative!==0&&!g)return-1;if(this.negative===0&&g)return 1;this.strip();var p;if(this.length>1)p=1;else{g&&(y=-y),o(y<=67108863,"Number is too big");var _=this.words[0]|0;p=_===y?0:_<y?-1:1}return this.negative!==0?-p|0:p},r.prototype.cmp=function(y){if(this.negative!==0&&y.negative===0)return-1;if(this.negative===0&&y.negative!==0)return 1;var g=this.ucmp(y);return this.negative!==0?-g|0:g},r.prototype.ucmp=function(y){if(this.length>y.length)return 1;if(this.length<y.length)return-1;for(var g=0,p=this.length-1;p>=0;p--){var _=this.words[p]|0,R=y.words[p]|0;if(_!==R){_<R?g=-1:_>R&&(g=1);break}}return g},r.prototype.gtn=function(y){return this.cmpn(y)===1},r.prototype.gt=function(y){return this.cmp(y)===1},r.prototype.gten=function(y){return this.cmpn(y)>=0},r.prototype.gte=function(y){return this.cmp(y)>=0},r.prototype.ltn=function(y){return this.cmpn(y)===-1},r.prototype.lt=function(y){return this.cmp(y)===-1},r.prototype.lten=function(y){return this.cmpn(y)<=0},r.prototype.lte=function(y){return this.cmp(y)<=0},r.prototype.eqn=function(y){return this.cmpn(y)===0},r.prototype.eq=function(y){return this.cmp(y)===0},r.red=function(y){return new ne(y)},r.prototype.toRed=function(y){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),y.convertTo(this)._forceRed(y)},r.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype._forceRed=function(y){return this.red=y,this},r.prototype.forceRed=function(y){return o(!this.red,"Already a number in reduction context"),this._forceRed(y)},r.prototype.redAdd=function(y){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,y)},r.prototype.redIAdd=function(y){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,y)},r.prototype.redSub=function(y){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,y)},r.prototype.redISub=function(y){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,y)},r.prototype.redShl=function(y){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,y)},r.prototype.redMul=function(y){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.mul(this,y)},r.prototype.redIMul=function(y){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,y),this.red.imul(this,y)},r.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(y){return o(this.red&&!y.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,y)};var O={k256:null,p224:null,p192:null,p25519:null};function D(X,y){this.name=X,this.p=new r(y,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}D.prototype._tmp=function(){var y=new r(null);return y.words=new Array(Math.ceil(this.n/13)),y},D.prototype.ireduce=function(y){var g=y,p;do this.split(g,this.tmp),g=this.imulK(g),g=g.iadd(this.tmp),p=g.bitLength();while(p>this.n);var _=p<this.n?-1:g.ucmp(this.p);return _===0?(g.words[0]=0,g.length=1):_>0?g.isub(this.p):g.strip!==void 0?g.strip():g._strip(),g},D.prototype.split=function(y,g){y.iushrn(this.n,0,g)},D.prototype.imulK=function(y){return y.imul(this.k)};function $(){D.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}d($,D),$.prototype.split=function(y,g){for(var p=4194303,_=Math.min(y.length,9),R=0;R<_;R++)g.words[R]=y.words[R];if(g.length=_,y.length<=9){y.words[0]=0,y.length=1;return}var q=y.words[9];for(g.words[g.length++]=q&p,R=10;R<y.length;R++){var T=y.words[R]|0;y.words[R-10]=(T&p)<<4|q>>>22,q=T}q>>>=22,y.words[R-10]=q,q===0&&y.length>10?y.length-=10:y.length-=9},$.prototype.imulK=function(y){y.words[y.length]=0,y.words[y.length+1]=0,y.length+=2;for(var g=0,p=0;p<y.length;p++){var _=y.words[p]|0;g+=_*977,y.words[p]=g&67108863,g=_*64+(g/67108864|0)}return y.words[y.length-1]===0&&(y.length--,y.words[y.length-1]===0&&y.length--),y};function H(){D.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}d(H,D);function Y(){D.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}d(Y,D);function ie(){D.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}d(ie,D),ie.prototype.imulK=function(y){for(var g=0,p=0;p<y.length;p++){var _=(y.words[p]|0)*19+g,R=_&67108863;_>>>=26,y.words[p]=R,g=_}return g!==0&&(y.words[y.length++]=g),y},r._prime=function(y){if(O[y])return O[y];var g;if(y==="k256")g=new $;else if(y==="p224")g=new H;else if(y==="p192")g=new Y;else if(y==="p25519")g=new ie;else throw new Error("Unknown prime "+y);return O[y]=g,g};function ne(X){if(typeof X=="string"){var y=r._prime(X);this.m=y.p,this.prime=y}else o(X.gtn(1),"modulus must be greater than 1"),this.m=X,this.prime=null}ne.prototype._verify1=function(y){o(y.negative===0,"red works only with positives"),o(y.red,"red works only with red numbers")},ne.prototype._verify2=function(y,g){o((y.negative|g.negative)===0,"red works only with positives"),o(y.red&&y.red===g.red,"red works only with red numbers")},ne.prototype.imod=function(y){return this.prime?this.prime.ireduce(y)._forceRed(this):y.umod(this.m)._forceRed(this)},ne.prototype.neg=function(y){return y.isZero()?y.clone():this.m.sub(y)._forceRed(this)},ne.prototype.add=function(y,g){this._verify2(y,g);var p=y.add(g);return p.cmp(this.m)>=0&&p.isub(this.m),p._forceRed(this)},ne.prototype.iadd=function(y,g){this._verify2(y,g);var p=y.iadd(g);return p.cmp(this.m)>=0&&p.isub(this.m),p},ne.prototype.sub=function(y,g){this._verify2(y,g);var p=y.sub(g);return p.cmpn(0)<0&&p.iadd(this.m),p._forceRed(this)},ne.prototype.isub=function(y,g){this._verify2(y,g);var p=y.isub(g);return p.cmpn(0)<0&&p.iadd(this.m),p},ne.prototype.shl=function(y,g){return this._verify1(y),this.imod(y.ushln(g))},ne.prototype.imul=function(y,g){return this._verify2(y,g),this.imod(y.imul(g))},ne.prototype.mul=function(y,g){return this._verify2(y,g),this.imod(y.mul(g))},ne.prototype.isqr=function(y){return this.imul(y,y.clone())},ne.prototype.sqr=function(y){return this.mul(y,y)},ne.prototype.sqrt=function(y){if(y.isZero())return y.clone();var g=this.m.andln(3);if(o(g%2===1),g===3){var p=this.m.add(new r(1)).iushrn(2);return this.pow(y,p)}for(var _=this.m.subn(1),R=0;!_.isZero()&&_.andln(1)===0;)R++,_.iushrn(1);o(!_.isZero());var q=new r(1).toRed(this),T=q.redNeg(),A=this.m.subn(1).iushrn(1),w=this.m.bitLength();for(w=new r(2*w*w).toRed(this);this.pow(w,A).cmp(T)!==0;)w.redIAdd(T);for(var M=this.pow(w,_),x=this.pow(y,_.addn(1).iushrn(1)),L=this.pow(y,_),K=R;L.cmp(q)!==0;){for(var Q=L,j=0;Q.cmp(q)!==0;j++)Q=Q.redSqr();o(j<K);var N=this.pow(M,new r(1).iushln(K-j-1));x=x.redMul(N),M=N.redSqr(),L=L.redMul(M),K=j}return x},ne.prototype.invm=function(y){var g=y._invmp(this.m);return g.negative!==0?(g.negative=0,this.imod(g).redNeg()):this.imod(g)},ne.prototype.pow=function(y,g){if(g.isZero())return new r(1).toRed(this);if(g.cmpn(1)===0)return y.clone();var p=4,_=new Array(1<<p);_[0]=new r(1).toRed(this),_[1]=y;for(var R=2;R<_.length;R++)_[R]=this.mul(_[R-1],y);var q=_[0],T=0,A=0,w=g.bitLength()%26;for(w===0&&(w=26),R=g.length-1;R>=0;R--){for(var M=g.words[R],x=w-1;x>=0;x--){var L=M>>x&1;if(q!==_[0]&&(q=this.sqr(q)),L===0&&T===0){A=0;continue}T<<=1,T|=L,A++,!(A!==p&&(R!==0||x!==0))&&(q=this.mul(q,_[T]),A=0,T=0)}w=26}return q},ne.prototype.convertTo=function(y){var g=y.umod(this.m);return g===y?g.clone():g},ne.prototype.convertFrom=function(y){var g=y.clone();return g.red=null,g},r.mont=function(y){return new de(y)};function de(X){ne.call(this,X),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new r(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)}d(de,ne),de.prototype.convertTo=function(y){return this.imod(y.ushln(this.shift))},de.prototype.convertFrom=function(y){var g=this.imod(y.mul(this.rinv));return g.red=null,g},de.prototype.imul=function(y,g){if(y.isZero()||g.isZero())return y.words[0]=0,y.length=1,y;var p=y.imul(g),_=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=p.isub(_).iushrn(this.shift),q=R;return R.cmp(this.m)>=0?q=R.isub(this.m):R.cmpn(0)<0&&(q=R.iadd(this.m)),q._forceRed(this)},de.prototype.mul=function(y,g){if(y.isZero()||g.isZero())return new r(0)._forceRed(this);var p=y.mul(g),_=p.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),R=p.isub(_).iushrn(this.shift),q=R;return R.cmp(this.m)>=0?q=R.isub(this.m):R.cmpn(0)<0&&(q=R.iadd(this.m)),q._forceRed(this)},de.prototype.invm=function(y){var g=this.imod(y._invmp(this.m).mul(this.r2));return g._forceRed(this)}})(s,bn$2)})(bn$3)),bn$3.exports}var brorand={exports:{}},hasRequiredBrorand;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;hasRequiredBrorand=1;var s;brorand.exports=function(d){return s||(s=new t(null)),s.generate(d)};function t(o){this.rand=o}if(brorand.exports.Rand=t,t.prototype.generate=function(d){return this._rand(d)},t.prototype._rand=function(d){if(this.rand.getBytes)return this.rand.getBytes(d);for(var r=new Uint8Array(d),h=0;h<r.length;h++)r[h]=this.rand.getByte();return r},typeof self=="object")self.crypto&&self.crypto.getRandomValues?t.prototype._rand=function(d){var r=new Uint8Array(d);return self.crypto.getRandomValues(r),r}:self.msCrypto&&self.msCrypto.getRandomValues?t.prototype._rand=function(d){var r=new Uint8Array(d);return self.msCrypto.getRandomValues(r),r}:typeof window=="object"&&(t.prototype._rand=function(){throw new Error("Not implemented yet")});else try{var f=requireCryptoBrowserify();if(typeof f.randomBytes!="function")throw new Error("Not supported");t.prototype._rand=function(d){return f.randomBytes(d)}}catch{}return brorand.exports}var mr,hasRequiredMr;function requireMr(){if(hasRequiredMr)return mr;hasRequiredMr=1;var s=requireBn$1(),t=requireBrorand();function f(o){this.rand=o||new t.Rand}return mr=f,f.create=function(d){return new f(d)},f.prototype._randbelow=function(d){var r=d.bitLength(),h=Math.ceil(r/8);do var c=new s(this.rand.generate(h));while(c.cmp(d)>=0);return c},f.prototype._randrange=function(d,r){var h=r.sub(d);return d.add(this._randbelow(h))},f.prototype.test=function(d,r,h){var c=d.bitLength(),n=s.mont(d),a=new s(1).toRed(n);r||(r=Math.max(1,c/48|0));for(var e=d.subn(1),u=0;!e.testn(u);u++);for(var l=d.shrn(u),v=e.toRed(n),b=!0;r>0;r--){var m=this._randrange(new s(2),e);h&&h(m);var B=m.toRed(n).redPow(l);if(!(B.cmp(a)===0||B.cmp(v)===0)){for(var E=1;E<u;E++){if(B=B.redSqr(),B.cmp(a)===0)return!1;if(B.cmp(v)===0)break}if(E===u)return!1}}return b},f.prototype.getDivisor=function(d,r){var h=d.bitLength(),c=s.mont(d),n=new s(1).toRed(c);r||(r=Math.max(1,h/48|0));for(var a=d.subn(1),e=0;!a.testn(e);e++);for(var u=d.shrn(e),l=a.toRed(c);r>0;r--){var v=this._randrange(new s(2),a),b=d.gcd(v);if(b.cmpn(1)!==0)return b;var m=v.toRed(c).redPow(u);if(!(m.cmp(n)===0||m.cmp(l)===0)){for(var B=1;B<e;B++){if(m=m.redSqr(),m.cmp(n)===0)return m.fromRed().subn(1).gcd(d);if(m.cmp(l)===0)break}if(B===e)return m=m.redSqr(),m.fromRed().subn(1).gcd(d)}}return!1},mr}var generatePrime,hasRequiredGeneratePrime;function requireGeneratePrime(){if(hasRequiredGeneratePrime)return generatePrime;hasRequiredGeneratePrime=1;var s=requireBrowser$b();generatePrime=B,B.simpleSieve=b,B.fermatTest=m;var t=requireBn$1(),f=new t(24),o=requireMr(),d=new o,r=new t(1),h=new t(2),c=new t(5);new t(16),new t(8);var n=new t(10),a=new t(3);new t(7);var e=new t(11),u=new t(4);new t(12);var l=null;function v(){if(l!==null)return l;var E=1048576,S=[];S[0]=2;for(var O=1,D=3;D<E;D+=2){for(var $=Math.ceil(Math.sqrt(D)),H=0;H<O&&S[H]<=$&&D%S[H]!==0;H++);O!==H&&S[H]<=$||(S[O++]=D)}return l=S,S}function b(E){for(var S=v(),O=0;O<S.length;O++)if(E.modn(S[O])===0)return E.cmpn(S[O])===0;return!0}function m(E){var S=t.mont(E);return h.toRed(S).redPow(E.subn(1)).fromRed().cmpn(1)===0}function B(E,S){if(E<16)return S===2||S===5?new t([140,123]):new t([140,39]);S=new t(S);for(var O,D;;){for(O=new t(s(Math.ceil(E/8)));O.bitLength()>E;)O.ishrn(1);if(O.isEven()&&O.iadd(r),O.testn(1)||O.iadd(h),S.cmp(h)){if(!S.cmp(c))for(;O.mod(n).cmp(a);)O.iadd(u)}else for(;O.mod(f).cmp(e);)O.iadd(u);if(D=O.shrn(1),b(D)&&b(O)&&m(D)&&m(O)&&d.test(D)&&d.test(O))return O}}return generatePrime}const 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"},require$$1$1={modp1,modp2,modp5,modp14,modp15,modp16,modp17,modp18};var dh,hasRequiredDh;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var s=requireBn$1(),t=requireMr(),f=new t,o=new s(24),d=new s(11),r=new s(10),h=new s(3),c=new s(7),n=requireGeneratePrime(),a=requireBrowser$b();dh=b;function e(B,E){return E=E||"utf8",Buffer.isBuffer(B)||(B=new Buffer(B,E)),this._pub=new s(B),this}function u(B,E){return E=E||"utf8",Buffer.isBuffer(B)||(B=new Buffer(B,E)),this._priv=new s(B),this}var l={};function v(B,E){var S=E.toString("hex"),O=[S,B.toString(16)].join("_");if(O in l)return l[O];var D=0;if(B.isEven()||!n.simpleSieve||!n.fermatTest(B)||!f.test(B))return D+=1,S==="02"||S==="05"?D+=8:D+=4,l[O]=D,D;f.test(B.shrn(1))||(D+=2);var $;switch(S){case"02":B.mod(o).cmp(d)&&(D+=8);break;case"05":$=B.mod(r),$.cmp(h)&&$.cmp(c)&&(D+=8);break;default:D+=4}return l[O]=D,D}function b(B,E,S){this.setGenerator(E),this.__prime=new s(B),this._prime=s.mont(this.__prime),this._primeLen=B.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,S?(this.setPublicKey=e,this.setPrivateKey=u):this._primeCode=8}Object.defineProperty(b.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=v(this.__prime,this.__gen)),this._primeCode}}),b.prototype.generateKeys=function(){return this._priv||(this._priv=new s(a(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},b.prototype.computeSecret=function(B){B=new s(B),B=B.toRed(this._prime);var E=B.redPow(this._priv).fromRed(),S=new Buffer(E.toArray()),O=this.getPrime();if(S.length<O.length){var D=new Buffer(O.length-S.length);D.fill(0),S=Buffer.concat([D,S])}return S},b.prototype.getPublicKey=function(E){return m(this._pub,E)},b.prototype.getPrivateKey=function(E){return m(this._priv,E)},b.prototype.getPrime=function(B){return m(this.__prime,B)},b.prototype.getGenerator=function(B){return m(this._gen,B)},b.prototype.setGenerator=function(B,E){return E=E||"utf8",Buffer.isBuffer(B)||(B=new Buffer(B,E)),this.__gen=B,this._gen=new s(B),this};function m(B,E){var S=new Buffer(B.toArray());return E?S.toString(E):S}return dh}var hasRequiredBrowser$4;function requireBrowser$4(){if(hasRequiredBrowser$4)return browser$4;hasRequiredBrowser$4=1;var s=requireGeneratePrime(),t=require$$1$1,f=requireDh();function o(h){var c=new Buffer(t[h].prime,"hex"),n=new Buffer(t[h].gen,"hex");return new f(c,n)}var d={binary:!0,hex:!0,base64:!0};function r(h,c,n,a){return Buffer.isBuffer(c)||d[c]===void 0?r(h,"binary",c,n):(c=c||"binary",a=a||"binary",n=n||new Buffer([2]),Buffer.isBuffer(n)||(n=new Buffer(n,a)),typeof h=="number"?new f(s(h,n),n,!0):(Buffer.isBuffer(h)||(h=new Buffer(h,c)),new f(h,n,!0)))}return browser$4.DiffieHellmanGroup=browser$4.createDiffieHellmanGroup=browser$4.getDiffieHellman=o,browser$4.createDiffieHellman=browser$4.DiffieHellman=r,browser$4}var sign={exports:{}},bn$1={exports:{}},bn=bn$1.exports,hasRequiredBn;function requireBn(){return hasRequiredBn||(hasRequiredBn=1,(function(s){(function(t,f){function o(g,p){if(!g)throw new Error(p||"Assertion failed")}function d(g,p){g.super_=p;var _=function(){};_.prototype=p.prototype,g.prototype=new _,g.prototype.constructor=g}function r(g,p,_){if(r.isBN(g))return g;this.negative=0,this.words=null,this.length=0,this.red=null,g!==null&&((p==="le"||p==="be")&&(_=p,p=10),this._init(g||0,p||10,_||"be"))}typeof t=="object"?t.exports=r:f.BN=r,r.BN=r,r.wordSize=26;var h;try{typeof window<"u"&&typeof window.Buffer<"u"?h=window.Buffer:h=requireDist().Buffer}catch{}r.isBN=function(p){return p instanceof r?!0:p!==null&&typeof p=="object"&&p.constructor.wordSize===r.wordSize&&Array.isArray(p.words)},r.max=function(p,_){return p.cmp(_)>0?p:_},r.min=function(p,_){return p.cmp(_)<0?p:_},r.prototype._init=function(p,_,R){if(typeof p=="number")return this._initNumber(p,_,R);if(typeof p=="object")return this._initArray(p,_,R);_==="hex"&&(_=16),o(_===(_|0)&&_>=2&&_<=36),p=p.toString().replace(/\s+/g,"");var q=0;p[0]==="-"&&(q++,this.negative=1),q<p.length&&(_===16?this._parseHex(p,q,R):(this._parseBase(p,_,q),R==="le"&&this._initArray(this.toArray(),_,R)))},r.prototype._initNumber=function(p,_,R){p<0&&(this.negative=1,p=-p),p<67108864?(this.words=[p&67108863],this.length=1):p<4503599627370496?(this.words=[p&67108863,p/67108864&67108863],this.length=2):(o(p<9007199254740992),this.words=[p&67108863,p/67108864&67108863,1],this.length=3),R==="le"&&this._initArray(this.toArray(),_,R)},r.prototype._initArray=function(p,_,R){if(o(typeof p.length=="number"),p.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(p.length/3),this.words=new Array(this.length);for(var q=0;q<this.length;q++)this.words[q]=0;var T,A,w=0;if(R==="be")for(q=p.length-1,T=0;q>=0;q-=3)A=p[q]|p[q-1]<<8|p[q-2]<<16,this.words[T]|=A<<w&67108863,this.words[T+1]=A>>>26-w&67108863,w+=24,w>=26&&(w-=26,T++);else if(R==="le")for(q=0,T=0;q<p.length;q+=3)A=p[q]|p[q+1]<<8|p[q+2]<<16,this.words[T]|=A<<w&67108863,this.words[T+1]=A>>>26-w&67108863,w+=24,w>=26&&(w-=26,T++);return this._strip()};function c(g,p){var _=g.charCodeAt(p);if(_>=48&&_<=57)return _-48;if(_>=65&&_<=70)return _-55;if(_>=97&&_<=102)return _-87;o(!1,"Invalid character in "+g)}function n(g,p,_){var R=c(g,_);return _-1>=p&&(R|=c(g,_-1)<<4),R}r.prototype._parseHex=function(p,_,R){this.length=Math.ceil((p.length-_)/6),this.words=new Array(this.length);for(var q=0;q<this.length;q++)this.words[q]=0;var T=0,A=0,w;if(R==="be")for(q=p.length-1;q>=_;q-=2)w=n(p,_,q)<<T,this.words[A]|=w&67108863,T>=18?(T-=18,A+=1,this.words[A]|=w>>>26):T+=8;else{var M=p.length-_;for(q=M%2===0?_+1:_;q<p.length;q+=2)w=n(p,_,q)<<T,this.words[A]|=w&67108863,T>=18?(T-=18,A+=1,this.words[A]|=w>>>26):T+=8}this._strip()};function a(g,p,_,R){for(var q=0,T=0,A=Math.min(g.length,_),w=p;w<A;w++){var M=g.charCodeAt(w)-48;q*=R,M>=49?T=M-49+10:M>=17?T=M-17+10:T=M,o(M>=0&&T<R,"Invalid character"),q+=T}return q}r.prototype._parseBase=function(p,_,R){this.words=[0],this.length=1;for(var q=0,T=1;T<=67108863;T*=_)q++;q--,T=T/_|0;for(var A=p.length-R,w=A%q,M=Math.min(A,A-w)+R,x=0,L=R;L<M;L+=q)x=a(p,L,L+q,_),this.imuln(T),this.words[0]+x<67108864?this.words[0]+=x:this._iaddn(x);if(w!==0){var K=1;for(x=a(p,L,p.length,_),L=0;L<w;L++)K*=_;this.imuln(K),this.words[0]+x<67108864?this.words[0]+=x:this._iaddn(x)}this._strip()},r.prototype.copy=function(p){p.words=new Array(this.length);for(var _=0;_<this.length;_++)p.words[_]=this.words[_];p.length=this.length,p.negative=this.negative,p.red=this.red};function e(g,p){g.words=p.words,g.length=p.length,g.negative=p.negative,g.red=p.red}if(r.prototype._move=function(p){e(p,this)},r.prototype.clone=function(){var p=new r(null);return this.copy(p),p},r.prototype._expand=function(p){for(;this.length<p;)this.words[this.length++]=0;return this},r.prototype._strip=function(){for(;this.length>1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},r.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{r.prototype[Symbol.for("nodejs.util.inspect.custom")]=u}catch{r.prototype.inspect=u}else r.prototype.inspect=u;function u(){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"],v=[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],b=[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];r.prototype.toString=function(p,_){p=p||10,_=_|0||1;var R;if(p===16||p==="hex"){R="";for(var q=0,T=0,A=0;A<this.length;A++){var w=this.words[A],M=((w<<q|T)&16777215).toString(16);T=w>>>24-q&16777215,q+=2,q>=26&&(q-=26,A--),T!==0||A!==this.length-1?R=l[6-M.length]+M+R:R=M+R}for(T!==0&&(R=T.toString(16)+R);R.length%_!==0;)R="0"+R;return this.negative!==0&&(R="-"+R),R}if(p===(p|0)&&p>=2&&p<=36){var x=v[p],L=b[p];R="";var K=this.clone();for(K.negative=0;!K.isZero();){var Q=K.modrn(L).toString(p);K=K.idivn(L),K.isZero()?R=Q+R:R=l[x-Q.length]+Q+R}for(this.isZero()&&(R="0"+R);R.length%_!==0;)R="0"+R;return this.negative!==0&&(R="-"+R),R}o(!1,"Base should be between 2 and 36")},r.prototype.toNumber=function(){var p=this.words[0];return this.length===2?p+=this.words[1]*67108864:this.length===3&&this.words[2]===1?p+=4503599627370496+this.words[1]*67108864:this.length>2&&o(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-p:p},r.prototype.toJSON=function(){return this.toString(16,2)},h&&(r.prototype.toBuffer=function(p,_){return this.toArrayLike(h,p,_)}),r.prototype.toArray=function(p,_){return this.toArrayLike(Array,p,_)};var m=function(p,_){return p.allocUnsafe?p.allocUnsafe(_):new p(_)};r.prototype.toArrayLike=function(p,_,R){this._strip();var q=this.byteLength(),T=R||Math.max(1,q);o(q<=T,"byte array longer than desired length"),o(T>0,"Requested array length <= 0");var A=m(p,T),w=_==="le"?"LE":"BE";return this["_toArrayLike"+w](A,q),A},r.prototype._toArrayLikeLE=function(p,_){for(var R=0,q=0,T=0,A=0;T<this.length;T++){var w=this.words[T]<<A|q;p[R++]=w&255,R<p.length&&(p[R++]=w>>8&255),R<p.length&&(p[R++]=w>>16&255),A===6?(R<p.length&&(p[R++]=w>>24&255),q=0,A=0):(q=w>>>24,A+=2)}if(R<p.length)for(p[R++]=q;R<p.length;)p[R++]=0},r.prototype._toArrayLikeBE=function(p,_){for(var R=p.length-1,q=0,T=0,A=0;T<this.length;T++){var w=this.words[T]<<A|q;p[R--]=w&255,R>=0&&(p[R--]=w>>8&255),R>=0&&(p[R--]=w>>16&255),A===6?(R>=0&&(p[R--]=w>>24&255),q=0,A=0):(q=w>>>24,A+=2)}if(R>=0)for(p[R--]=q;R>=0;)p[R--]=0},Math.clz32?r.prototype._countBits=function(p){return 32-Math.clz32(p)}:r.prototype._countBits=function(p){var _=p,R=0;return _>=4096&&(R+=13,_>>>=13),_>=64&&(R+=7,_>>>=7),_>=8&&(R+=4,_>>>=4),_>=2&&(R+=2,_>>>=2),R+_},r.prototype._zeroBits=function(p){if(p===0)return 26;var _=p,R=0;return(_&8191)===0&&(R+=13,_>>>=13),(_&127)===0&&(R+=7,_>>>=7),(_&15)===0&&(R+=4,_>>>=4),(_&3)===0&&(R+=2,_>>>=2),(_&1)===0&&R++,R},r.prototype.bitLength=function(){var p=this.words[this.length-1],_=this._countBits(p);return(this.length-1)*26+_};function B(g){for(var p=new Array(g.bitLength()),_=0;_<p.length;_++){var R=_/26|0,q=_%26;p[_]=g.words[R]>>>q&1}return p}r.prototype.zeroBits=function(){if(this.isZero())return 0;for(var p=0,_=0;_<this.length;_++){var R=this._zeroBits(this.words[_]);if(p+=R,R!==26)break}return p},r.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},r.prototype.toTwos=function(p){return this.negative!==0?this.abs().inotn(p).iaddn(1):this.clone()},r.prototype.fromTwos=function(p){return this.testn(p-1)?this.notn(p).iaddn(1).ineg():this.clone()},r.prototype.isNeg=function(){return this.negative!==0},r.prototype.neg=function(){return this.clone().ineg()},r.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},r.prototype.iuor=function(p){for(;this.length<p.length;)this.words[this.length++]=0;for(var _=0;_<p.length;_++)this.words[_]=this.words[_]|p.words[_];return this._strip()},r.prototype.ior=function(p){return o((this.negative|p.negative)===0),this.iuor(p)},r.prototype.or=function(p){return this.length>p.length?this.clone().ior(p):p.clone().ior(this)},r.prototype.uor=function(p){return this.length>p.length?this.clone().iuor(p):p.clone().iuor(this)},r.prototype.iuand=function(p){var _;this.length>p.length?_=p:_=this;for(var R=0;R<_.length;R++)this.words[R]=this.words[R]&p.words[R];return this.length=_.length,this._strip()},r.prototype.iand=function(p){return o((this.negative|p.negative)===0),this.iuand(p)},r.prototype.and=function(p){return this.length>p.length?this.clone().iand(p):p.clone().iand(this)},r.prototype.uand=function(p){return this.length>p.length?this.clone().iuand(p):p.clone().iuand(this)},r.prototype.iuxor=function(p){var _,R;this.length>p.length?(_=this,R=p):(_=p,R=this);for(var q=0;q<R.length;q++)this.words[q]=_.words[q]^R.words[q];if(this!==_)for(;q<_.length;q++)this.words[q]=_.words[q];return this.length=_.length,this._strip()},r.prototype.ixor=function(p){return o((this.negative|p.negative)===0),this.iuxor(p)},r.prototype.xor=function(p){return this.length>p.length?this.clone().ixor(p):p.clone().ixor(this)},r.prototype.uxor=function(p){return this.length>p.length?this.clone().iuxor(p):p.clone().iuxor(this)},r.prototype.inotn=function(p){o(typeof p=="number"&&p>=0);var _=Math.ceil(p/26)|0,R=p%26;this._expand(_),R>0&&_--;for(var q=0;q<_;q++)this.words[q]=~this.words[q]&67108863;return R>0&&(this.words[q]=~this.words[q]&67108863>>26-R),this._strip()},r.prototype.notn=function(p){return this.clone().inotn(p)},r.prototype.setn=function(p,_){o(typeof p=="number"&&p>=0);var R=p/26|0,q=p%26;return this._expand(R+1),_?this.words[R]=this.words[R]|1<<q:this.words[R]=this.words[R]&~(1<<q),this._strip()},r.prototype.iadd=function(p){var _;if(this.negative!==0&&p.negative===0)return this.negative=0,_=this.isub(p),this.negative^=1,this._normSign();if(this.negative===0&&p.negative!==0)return p.negative=0,_=this.isub(p),p.negative=1,_._normSign();var R,q;this.length>p.length?(R=this,q=p):(R=p,q=this);for(var T=0,A=0;A<q.length;A++)_=(R.words[A]|0)+(q.words[A]|0)+T,this.words[A]=_&67108863,T=_>>>26;for(;T!==0&&A<R.length;A++)_=(R.words[A]|0)+T,this.words[A]=_&67108863,T=_>>>26;if(this.length=R.length,T!==0)this.words[this.length]=T,this.length++;else if(R!==this)for(;A<R.length;A++)this.words[A]=R.words[A];return this},r.prototype.add=function(p){var _;return p.negative!==0&&this.negative===0?(p.negative=0,_=this.sub(p),p.negative^=1,_):p.negative===0&&this.negative!==0?(this.negative=0,_=p.sub(this),this.negative=1,_):this.length>p.length?this.clone().iadd(p):p.clone().iadd(this)},r.prototype.isub=function(p){if(p.negative!==0){p.negative=0;var _=this.iadd(p);return p.negative=1,_._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(p),this.negative=1,this._normSign();var R=this.cmp(p);if(R===0)return this.negative=0,this.length=1,this.words[0]=0,this;var q,T;R>0?(q=this,T=p):(q=p,T=this);for(var A=0,w=0;w<T.length;w++)_=(q.words[w]|0)-(T.words[w]|0)+A,A=_>>26,this.words[w]=_&67108863;for(;A!==0&&w<q.length;w++)_=(q.words[w]|0)+A,A=_>>26,this.words[w]=_&67108863;if(A===0&&w<q.length&&q!==this)for(;w<q.length;w++)this.words[w]=q.words[w];return this.length=Math.max(this.length,w),q!==this&&(this.negative=1),this._strip()},r.prototype.sub=function(p){return this.clone().isub(p)};function E(g,p,_){_.negative=p.negative^g.negative;var R=g.length+p.length|0;_.length=R,R=R-1|0;var q=g.words[0]|0,T=p.words[0]|0,A=q*T,w=A&67108863,M=A/67108864|0;_.words[0]=w;for(var x=1;x<R;x++){for(var L=M>>>26,K=M&67108863,Q=Math.min(x,p.length-1),j=Math.max(0,x-g.length+1);j<=Q;j++){var N=x-j|0;q=g.words[N]|0,T=p.words[j]|0,A=q*T+K,L+=A/67108864|0,K=A&67108863}_.words[x]=K|0,M=L|0}return M!==0?_.words[x]=M|0:_.length--,_._strip()}var S=function(p,_,R){var q=p.words,T=_.words,A=R.words,w=0,M,x,L,K=q[0]|0,Q=K&8191,j=K>>>13,N=q[1]|0,F=N&8191,ee=N>>>13,ae=q[2]|0,G=ae&8191,z=ae>>>13,fe=q[3]|0,me=fe&8191,xe=fe>>>13,_e=q[4]|0,qe=_e&8191,Re=_e>>>13,be=q[5]|0,Fe=be&8191,Be=be>>>13,Me=q[6]|0,Pe=Me&8191,oe=Me>>>13,ce=q[7]|0,ge=ce&8191,we=ce>>>13,Se=q[8]|0,Oe=Se&8191,U=Se>>>13,I=q[9]|0,C=I&8191,J=I>>>13,se=T[0]|0,le=se&8191,ve=se>>>13,Ce=T[1]|0,Le=Ce&8191,Ie=Ce>>>13,je=T[2]|0,$e=je&8191,Ve=je>>>13,Ke=T[3]|0,Xe=Ke&8191,We=Ke>>>13,Ze=T[4]|0,Ye=Ze&8191,W=Ze>>>13,P=T[5]|0,k=P&8191,re=P>>>13,ue=T[6]|0,pe=ue&8191,ye=ue>>>13,ke=T[7]|0,He=ke&8191,Ne=ke>>>13,ze=T[8]|0,Ue=ze&8191,Ge=ze>>>13,Je=T[9]|0,Qe=Je&8191,er=Je>>>13;R.negative=p.negative^_.negative,R.length=19,M=Math.imul(Q,le),x=Math.imul(Q,ve),x=x+Math.imul(j,le)|0,L=Math.imul(j,ve);var fr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(fr>>>26)|0,fr&=67108863,M=Math.imul(F,le),x=Math.imul(F,ve),x=x+Math.imul(ee,le)|0,L=Math.imul(ee,ve),M=M+Math.imul(Q,Le)|0,x=x+Math.imul(Q,Ie)|0,x=x+Math.imul(j,Le)|0,L=L+Math.imul(j,Ie)|0;var ur=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(ur>>>26)|0,ur&=67108863,M=Math.imul(G,le),x=Math.imul(G,ve),x=x+Math.imul(z,le)|0,L=Math.imul(z,ve),M=M+Math.imul(F,Le)|0,x=x+Math.imul(F,Ie)|0,x=x+Math.imul(ee,Le)|0,L=L+Math.imul(ee,Ie)|0,M=M+Math.imul(Q,$e)|0,x=x+Math.imul(Q,Ve)|0,x=x+Math.imul(j,$e)|0,L=L+Math.imul(j,Ve)|0;var cr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(cr>>>26)|0,cr&=67108863,M=Math.imul(me,le),x=Math.imul(me,ve),x=x+Math.imul(xe,le)|0,L=Math.imul(xe,ve),M=M+Math.imul(G,Le)|0,x=x+Math.imul(G,Ie)|0,x=x+Math.imul(z,Le)|0,L=L+Math.imul(z,Ie)|0,M=M+Math.imul(F,$e)|0,x=x+Math.imul(F,Ve)|0,x=x+Math.imul(ee,$e)|0,L=L+Math.imul(ee,Ve)|0,M=M+Math.imul(Q,Xe)|0,x=x+Math.imul(Q,We)|0,x=x+Math.imul(j,Xe)|0,L=L+Math.imul(j,We)|0;var nr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(nr>>>26)|0,nr&=67108863,M=Math.imul(qe,le),x=Math.imul(qe,ve),x=x+Math.imul(Re,le)|0,L=Math.imul(Re,ve),M=M+Math.imul(me,Le)|0,x=x+Math.imul(me,Ie)|0,x=x+Math.imul(xe,Le)|0,L=L+Math.imul(xe,Ie)|0,M=M+Math.imul(G,$e)|0,x=x+Math.imul(G,Ve)|0,x=x+Math.imul(z,$e)|0,L=L+Math.imul(z,Ve)|0,M=M+Math.imul(F,Xe)|0,x=x+Math.imul(F,We)|0,x=x+Math.imul(ee,Xe)|0,L=L+Math.imul(ee,We)|0,M=M+Math.imul(Q,Ye)|0,x=x+Math.imul(Q,W)|0,x=x+Math.imul(j,Ye)|0,L=L+Math.imul(j,W)|0;var hr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(hr>>>26)|0,hr&=67108863,M=Math.imul(Fe,le),x=Math.imul(Fe,ve),x=x+Math.imul(Be,le)|0,L=Math.imul(Be,ve),M=M+Math.imul(qe,Le)|0,x=x+Math.imul(qe,Ie)|0,x=x+Math.imul(Re,Le)|0,L=L+Math.imul(Re,Ie)|0,M=M+Math.imul(me,$e)|0,x=x+Math.imul(me,Ve)|0,x=x+Math.imul(xe,$e)|0,L=L+Math.imul(xe,Ve)|0,M=M+Math.imul(G,Xe)|0,x=x+Math.imul(G,We)|0,x=x+Math.imul(z,Xe)|0,L=L+Math.imul(z,We)|0,M=M+Math.imul(F,Ye)|0,x=x+Math.imul(F,W)|0,x=x+Math.imul(ee,Ye)|0,L=L+Math.imul(ee,W)|0,M=M+Math.imul(Q,k)|0,x=x+Math.imul(Q,re)|0,x=x+Math.imul(j,k)|0,L=L+Math.imul(j,re)|0;var lr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(lr>>>26)|0,lr&=67108863,M=Math.imul(Pe,le),x=Math.imul(Pe,ve),x=x+Math.imul(oe,le)|0,L=Math.imul(oe,ve),M=M+Math.imul(Fe,Le)|0,x=x+Math.imul(Fe,Ie)|0,x=x+Math.imul(Be,Le)|0,L=L+Math.imul(Be,Ie)|0,M=M+Math.imul(qe,$e)|0,x=x+Math.imul(qe,Ve)|0,x=x+Math.imul(Re,$e)|0,L=L+Math.imul(Re,Ve)|0,M=M+Math.imul(me,Xe)|0,x=x+Math.imul(me,We)|0,x=x+Math.imul(xe,Xe)|0,L=L+Math.imul(xe,We)|0,M=M+Math.imul(G,Ye)|0,x=x+Math.imul(G,W)|0,x=x+Math.imul(z,Ye)|0,L=L+Math.imul(z,W)|0,M=M+Math.imul(F,k)|0,x=x+Math.imul(F,re)|0,x=x+Math.imul(ee,k)|0,L=L+Math.imul(ee,re)|0,M=M+Math.imul(Q,pe)|0,x=x+Math.imul(Q,ye)|0,x=x+Math.imul(j,pe)|0,L=L+Math.imul(j,ye)|0;var dr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(dr>>>26)|0,dr&=67108863,M=Math.imul(ge,le),x=Math.imul(ge,ve),x=x+Math.imul(we,le)|0,L=Math.imul(we,ve),M=M+Math.imul(Pe,Le)|0,x=x+Math.imul(Pe,Ie)|0,x=x+Math.imul(oe,Le)|0,L=L+Math.imul(oe,Ie)|0,M=M+Math.imul(Fe,$e)|0,x=x+Math.imul(Fe,Ve)|0,x=x+Math.imul(Be,$e)|0,L=L+Math.imul(Be,Ve)|0,M=M+Math.imul(qe,Xe)|0,x=x+Math.imul(qe,We)|0,x=x+Math.imul(Re,Xe)|0,L=L+Math.imul(Re,We)|0,M=M+Math.imul(me,Ye)|0,x=x+Math.imul(me,W)|0,x=x+Math.imul(xe,Ye)|0,L=L+Math.imul(xe,W)|0,M=M+Math.imul(G,k)|0,x=x+Math.imul(G,re)|0,x=x+Math.imul(z,k)|0,L=L+Math.imul(z,re)|0,M=M+Math.imul(F,pe)|0,x=x+Math.imul(F,ye)|0,x=x+Math.imul(ee,pe)|0,L=L+Math.imul(ee,ye)|0,M=M+Math.imul(Q,He)|0,x=x+Math.imul(Q,Ne)|0,x=x+Math.imul(j,He)|0,L=L+Math.imul(j,Ne)|0;var pr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(pr>>>26)|0,pr&=67108863,M=Math.imul(Oe,le),x=Math.imul(Oe,ve),x=x+Math.imul(U,le)|0,L=Math.imul(U,ve),M=M+Math.imul(ge,Le)|0,x=x+Math.imul(ge,Ie)|0,x=x+Math.imul(we,Le)|0,L=L+Math.imul(we,Ie)|0,M=M+Math.imul(Pe,$e)|0,x=x+Math.imul(Pe,Ve)|0,x=x+Math.imul(oe,$e)|0,L=L+Math.imul(oe,Ve)|0,M=M+Math.imul(Fe,Xe)|0,x=x+Math.imul(Fe,We)|0,x=x+Math.imul(Be,Xe)|0,L=L+Math.imul(Be,We)|0,M=M+Math.imul(qe,Ye)|0,x=x+Math.imul(qe,W)|0,x=x+Math.imul(Re,Ye)|0,L=L+Math.imul(Re,W)|0,M=M+Math.imul(me,k)|0,x=x+Math.imul(me,re)|0,x=x+Math.imul(xe,k)|0,L=L+Math.imul(xe,re)|0,M=M+Math.imul(G,pe)|0,x=x+Math.imul(G,ye)|0,x=x+Math.imul(z,pe)|0,L=L+Math.imul(z,ye)|0,M=M+Math.imul(F,He)|0,x=x+Math.imul(F,Ne)|0,x=x+Math.imul(ee,He)|0,L=L+Math.imul(ee,Ne)|0,M=M+Math.imul(Q,Ue)|0,x=x+Math.imul(Q,Ge)|0,x=x+Math.imul(j,Ue)|0,L=L+Math.imul(j,Ge)|0;var vr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(vr>>>26)|0,vr&=67108863,M=Math.imul(C,le),x=Math.imul(C,ve),x=x+Math.imul(J,le)|0,L=Math.imul(J,ve),M=M+Math.imul(Oe,Le)|0,x=x+Math.imul(Oe,Ie)|0,x=x+Math.imul(U,Le)|0,L=L+Math.imul(U,Ie)|0,M=M+Math.imul(ge,$e)|0,x=x+Math.imul(ge,Ve)|0,x=x+Math.imul(we,$e)|0,L=L+Math.imul(we,Ve)|0,M=M+Math.imul(Pe,Xe)|0,x=x+Math.imul(Pe,We)|0,x=x+Math.imul(oe,Xe)|0,L=L+Math.imul(oe,We)|0,M=M+Math.imul(Fe,Ye)|0,x=x+Math.imul(Fe,W)|0,x=x+Math.imul(Be,Ye)|0,L=L+Math.imul(Be,W)|0,M=M+Math.imul(qe,k)|0,x=x+Math.imul(qe,re)|0,x=x+Math.imul(Re,k)|0,L=L+Math.imul(Re,re)|0,M=M+Math.imul(me,pe)|0,x=x+Math.imul(me,ye)|0,x=x+Math.imul(xe,pe)|0,L=L+Math.imul(xe,ye)|0,M=M+Math.imul(G,He)|0,x=x+Math.imul(G,Ne)|0,x=x+Math.imul(z,He)|0,L=L+Math.imul(z,Ne)|0,M=M+Math.imul(F,Ue)|0,x=x+Math.imul(F,Ge)|0,x=x+Math.imul(ee,Ue)|0,L=L+Math.imul(ee,Ge)|0,M=M+Math.imul(Q,Qe)|0,x=x+Math.imul(Q,er)|0,x=x+Math.imul(j,Qe)|0,L=L+Math.imul(j,er)|0;var br=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(br>>>26)|0,br&=67108863,M=Math.imul(C,Le),x=Math.imul(C,Ie),x=x+Math.imul(J,Le)|0,L=Math.imul(J,Ie),M=M+Math.imul(Oe,$e)|0,x=x+Math.imul(Oe,Ve)|0,x=x+Math.imul(U,$e)|0,L=L+Math.imul(U,Ve)|0,M=M+Math.imul(ge,Xe)|0,x=x+Math.imul(ge,We)|0,x=x+Math.imul(we,Xe)|0,L=L+Math.imul(we,We)|0,M=M+Math.imul(Pe,Ye)|0,x=x+Math.imul(Pe,W)|0,x=x+Math.imul(oe,Ye)|0,L=L+Math.imul(oe,W)|0,M=M+Math.imul(Fe,k)|0,x=x+Math.imul(Fe,re)|0,x=x+Math.imul(Be,k)|0,L=L+Math.imul(Be,re)|0,M=M+Math.imul(qe,pe)|0,x=x+Math.imul(qe,ye)|0,x=x+Math.imul(Re,pe)|0,L=L+Math.imul(Re,ye)|0,M=M+Math.imul(me,He)|0,x=x+Math.imul(me,Ne)|0,x=x+Math.imul(xe,He)|0,L=L+Math.imul(xe,Ne)|0,M=M+Math.imul(G,Ue)|0,x=x+Math.imul(G,Ge)|0,x=x+Math.imul(z,Ue)|0,L=L+Math.imul(z,Ge)|0,M=M+Math.imul(F,Qe)|0,x=x+Math.imul(F,er)|0,x=x+Math.imul(ee,Qe)|0,L=L+Math.imul(ee,er)|0;var yr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(yr>>>26)|0,yr&=67108863,M=Math.imul(C,$e),x=Math.imul(C,Ve),x=x+Math.imul(J,$e)|0,L=Math.imul(J,Ve),M=M+Math.imul(Oe,Xe)|0,x=x+Math.imul(Oe,We)|0,x=x+Math.imul(U,Xe)|0,L=L+Math.imul(U,We)|0,M=M+Math.imul(ge,Ye)|0,x=x+Math.imul(ge,W)|0,x=x+Math.imul(we,Ye)|0,L=L+Math.imul(we,W)|0,M=M+Math.imul(Pe,k)|0,x=x+Math.imul(Pe,re)|0,x=x+Math.imul(oe,k)|0,L=L+Math.imul(oe,re)|0,M=M+Math.imul(Fe,pe)|0,x=x+Math.imul(Fe,ye)|0,x=x+Math.imul(Be,pe)|0,L=L+Math.imul(Be,ye)|0,M=M+Math.imul(qe,He)|0,x=x+Math.imul(qe,Ne)|0,x=x+Math.imul(Re,He)|0,L=L+Math.imul(Re,Ne)|0,M=M+Math.imul(me,Ue)|0,x=x+Math.imul(me,Ge)|0,x=x+Math.imul(xe,Ue)|0,L=L+Math.imul(xe,Ge)|0,M=M+Math.imul(G,Qe)|0,x=x+Math.imul(G,er)|0,x=x+Math.imul(z,Qe)|0,L=L+Math.imul(z,er)|0;var gr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(gr>>>26)|0,gr&=67108863,M=Math.imul(C,Xe),x=Math.imul(C,We),x=x+Math.imul(J,Xe)|0,L=Math.imul(J,We),M=M+Math.imul(Oe,Ye)|0,x=x+Math.imul(Oe,W)|0,x=x+Math.imul(U,Ye)|0,L=L+Math.imul(U,W)|0,M=M+Math.imul(ge,k)|0,x=x+Math.imul(ge,re)|0,x=x+Math.imul(we,k)|0,L=L+Math.imul(we,re)|0,M=M+Math.imul(Pe,pe)|0,x=x+Math.imul(Pe,ye)|0,x=x+Math.imul(oe,pe)|0,L=L+Math.imul(oe,ye)|0,M=M+Math.imul(Fe,He)|0,x=x+Math.imul(Fe,Ne)|0,x=x+Math.imul(Be,He)|0,L=L+Math.imul(Be,Ne)|0,M=M+Math.imul(qe,Ue)|0,x=x+Math.imul(qe,Ge)|0,x=x+Math.imul(Re,Ue)|0,L=L+Math.imul(Re,Ge)|0,M=M+Math.imul(me,Qe)|0,x=x+Math.imul(me,er)|0,x=x+Math.imul(xe,Qe)|0,L=L+Math.imul(xe,er)|0;var wr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(wr>>>26)|0,wr&=67108863,M=Math.imul(C,Ye),x=Math.imul(C,W),x=x+Math.imul(J,Ye)|0,L=Math.imul(J,W),M=M+Math.imul(Oe,k)|0,x=x+Math.imul(Oe,re)|0,x=x+Math.imul(U,k)|0,L=L+Math.imul(U,re)|0,M=M+Math.imul(ge,pe)|0,x=x+Math.imul(ge,ye)|0,x=x+Math.imul(we,pe)|0,L=L+Math.imul(we,ye)|0,M=M+Math.imul(Pe,He)|0,x=x+Math.imul(Pe,Ne)|0,x=x+Math.imul(oe,He)|0,L=L+Math.imul(oe,Ne)|0,M=M+Math.imul(Fe,Ue)|0,x=x+Math.imul(Fe,Ge)|0,x=x+Math.imul(Be,Ue)|0,L=L+Math.imul(Be,Ge)|0,M=M+Math.imul(qe,Qe)|0,x=x+Math.imul(qe,er)|0,x=x+Math.imul(Re,Qe)|0,L=L+Math.imul(Re,er)|0;var rr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(rr>>>26)|0,rr&=67108863,M=Math.imul(C,k),x=Math.imul(C,re),x=x+Math.imul(J,k)|0,L=Math.imul(J,re),M=M+Math.imul(Oe,pe)|0,x=x+Math.imul(Oe,ye)|0,x=x+Math.imul(U,pe)|0,L=L+Math.imul(U,ye)|0,M=M+Math.imul(ge,He)|0,x=x+Math.imul(ge,Ne)|0,x=x+Math.imul(we,He)|0,L=L+Math.imul(we,Ne)|0,M=M+Math.imul(Pe,Ue)|0,x=x+Math.imul(Pe,Ge)|0,x=x+Math.imul(oe,Ue)|0,L=L+Math.imul(oe,Ge)|0,M=M+Math.imul(Fe,Qe)|0,x=x+Math.imul(Fe,er)|0,x=x+Math.imul(Be,Qe)|0,L=L+Math.imul(Be,er)|0;var _r=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(_r>>>26)|0,_r&=67108863,M=Math.imul(C,pe),x=Math.imul(C,ye),x=x+Math.imul(J,pe)|0,L=Math.imul(J,ye),M=M+Math.imul(Oe,He)|0,x=x+Math.imul(Oe,Ne)|0,x=x+Math.imul(U,He)|0,L=L+Math.imul(U,Ne)|0,M=M+Math.imul(ge,Ue)|0,x=x+Math.imul(ge,Ge)|0,x=x+Math.imul(we,Ue)|0,L=L+Math.imul(we,Ge)|0,M=M+Math.imul(Pe,Qe)|0,x=x+Math.imul(Pe,er)|0,x=x+Math.imul(oe,Qe)|0,L=L+Math.imul(oe,er)|0;var xr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(xr>>>26)|0,xr&=67108863,M=Math.imul(C,He),x=Math.imul(C,Ne),x=x+Math.imul(J,He)|0,L=Math.imul(J,Ne),M=M+Math.imul(Oe,Ue)|0,x=x+Math.imul(Oe,Ge)|0,x=x+Math.imul(U,Ue)|0,L=L+Math.imul(U,Ge)|0,M=M+Math.imul(ge,Qe)|0,x=x+Math.imul(ge,er)|0,x=x+Math.imul(we,Qe)|0,L=L+Math.imul(we,er)|0;var Sr=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(Sr>>>26)|0,Sr&=67108863,M=Math.imul(C,Ue),x=Math.imul(C,Ge),x=x+Math.imul(J,Ue)|0,L=Math.imul(J,Ge),M=M+Math.imul(Oe,Qe)|0,x=x+Math.imul(Oe,er)|0,x=x+Math.imul(U,Qe)|0,L=L+Math.imul(U,er)|0;var V=(w+M|0)+((x&8191)<<13)|0;w=(L+(x>>>13)|0)+(V>>>26)|0,V&=67108863,M=Math.imul(C,Qe),x=Math.imul(C,er),x=x+Math.imul(J,Qe)|0,L=Math.imul(J,er);var Z=(w+M|0)+((x&8191)<<13)|0;return w=(L+(x>>>13)|0)+(Z>>>26)|0,Z&=67108863,A[0]=fr,A[1]=ur,A[2]=cr,A[3]=nr,A[4]=hr,A[5]=lr,A[6]=dr,A[7]=pr,A[8]=vr,A[9]=br,A[10]=yr,A[11]=gr,A[12]=wr,A[13]=rr,A[14]=_r,A[15]=xr,A[16]=Sr,A[17]=V,A[18]=Z,w!==0&&(A[19]=w,R.length++),R};Math.imul||(S=E);function O(g,p,_){_.negative=p.negative^g.negative,_.length=g.length+p.length;for(var R=0,q=0,T=0;T<_.length-1;T++){var A=q;q=0;for(var w=R&67108863,M=Math.min(T,p.length-1),x=Math.max(0,T-g.length+1);x<=M;x++){var L=T-x,K=g.words[L]|0,Q=p.words[x]|0,j=K*Q,N=j&67108863;A=A+(j/67108864|0)|0,N=N+w|0,w=N&67108863,A=A+(N>>>26)|0,q+=A>>>26,A&=67108863}_.words[T]=w,R=A,A=q}return R!==0?_.words[T]=R:_.length--,_._strip()}function D(g,p,_){return O(g,p,_)}r.prototype.mulTo=function(p,_){var R,q=this.length+p.length;return this.length===10&&p.length===10?R=S(this,p,_):q<63?R=E(this,p,_):q<1024?R=O(this,p,_):R=D(this,p,_),R},r.prototype.mul=function(p){var _=new r(null);return _.words=new Array(this.length+p.length),this.mulTo(p,_)},r.prototype.mulf=function(p){var _=new r(null);return _.words=new Array(this.length+p.length),D(this,p,_)},r.prototype.imul=function(p){return this.clone().mulTo(p,this)},r.prototype.imuln=function(p){var _=p<0;_&&(p=-p),o(typeof p=="number"),o(p<67108864);for(var R=0,q=0;q<this.length;q++){var T=(this.words[q]|0)*p,A=(T&67108863)+(R&67108863);R>>=26,R+=T/67108864|0,R+=A>>>26,this.words[q]=A&67108863}return R!==0&&(this.words[q]=R,this.length++),this.length=p===0?1:this.length,_?this.ineg():this},r.prototype.muln=function(p){return this.clone().imuln(p)},r.prototype.sqr=function(){return this.mul(this)},r.prototype.isqr=function(){return this.imul(this.clone())},r.prototype.pow=function(p){var _=B(p);if(_.length===0)return new r(1);for(var R=this,q=0;q<_.length&&_[q]===0;q++,R=R.sqr());if(++q<_.length)for(var T=R.sqr();q<_.length;q++,T=T.sqr())_[q]!==0&&(R=R.mul(T));return R},r.prototype.iushln=function(p){o(typeof p=="number"&&p>=0);var _=p%26,R=(p-_)/26,q=67108863>>>26-_<<26-_,T;if(_!==0){var A=0;for(T=0;T<this.length;T++){var w=this.words[T]&q,M=(this.words[T]|0)-w<<_;this.words[T]=M|A,A=w>>>26-_}A&&(this.words[T]=A,this.length++)}if(R!==0){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()},r.prototype.ishln=function(p){return o(this.negative===0),this.iushln(p)},r.prototype.iushrn=function(p,_,R){o(typeof p=="number"&&p>=0);var q;_?q=(_-_%26)/26:q=0;var T=p%26,A=Math.min((p-T)/26,this.length),w=67108863^67108863>>>T<<T,M=R;if(q-=A,q=Math.max(0,q),M){for(var x=0;x<A;x++)M.words[x]=this.words[x];M.length=A}if(A!==0)if(this.length>A)for(this.length-=A,x=0;x<this.length;x++)this.words[x]=this.words[x+A];else this.words[0]=0,this.length=1;var L=0;for(x=this.length-1;x>=0&&(L!==0||x>=q);x--){var K=this.words[x]|0;this.words[x]=L<<26-T|K>>>T,L=K&w}return M&&L!==0&&(M.words[M.length++]=L),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},r.prototype.ishrn=function(p,_,R){return o(this.negative===0),this.iushrn(p,_,R)},r.prototype.shln=function(p){return this.clone().ishln(p)},r.prototype.ushln=function(p){return this.clone().iushln(p)},r.prototype.shrn=function(p){return this.clone().ishrn(p)},r.prototype.ushrn=function(p){return this.clone().iushrn(p)},r.prototype.testn=function(p){o(typeof p=="number"&&p>=0);var _=p%26,R=(p-_)/26,q=1<<_;if(this.length<=R)return!1;var T=this.words[R];return!!(T&q)},r.prototype.imaskn=function(p){o(typeof p=="number"&&p>=0);var _=p%26,R=(p-_)/26;if(o(this.negative===0,"imaskn works only with positive numbers"),this.length<=R)return this;if(_!==0&&R++,this.length=Math.min(R,this.length),_!==0){var q=67108863^67108863>>>_<<_;this.words[this.length-1]&=q}return this.length===0&&(this.words[0]=0,this.length=1),this._strip()},r.prototype.maskn=function(p){return this.clone().imaskn(p)},r.prototype.iaddn=function(p){return o(typeof p=="number"),o(p<67108864),p<0?this.isubn(-p):this.negative!==0?this.length===1&&(this.words[0]|0)<=p?(this.words[0]=p-(this.words[0]|0),this.negative=0,this):(this.negative=0,this.isubn(p),this.negative=1,this):this._iaddn(p)},r.prototype._iaddn=function(p){this.words[0]+=p;for(var _=0;_<this.length&&this.words[_]>=67108864;_++)this.words[_]-=67108864,_===this.length-1?this.words[_+1]=1:this.words[_+1]++;return this.length=Math.max(this.length,_+1),this},r.prototype.isubn=function(p){if(o(typeof p=="number"),o(p<67108864),p<0)return this.iaddn(-p);if(this.negative!==0)return this.negative=0,this.iaddn(p),this.negative=1,this;if(this.words[0]-=p,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var _=0;_<this.length&&this.words[_]<0;_++)this.words[_]+=67108864,this.words[_+1]-=1;return this._strip()},r.prototype.addn=function(p){return this.clone().iaddn(p)},r.prototype.subn=function(p){return this.clone().isubn(p)},r.prototype.iabs=function(){return this.negative=0,this},r.prototype.abs=function(){return this.clone().iabs()},r.prototype._ishlnsubmul=function(p,_,R){var q=p.length+R,T;this._expand(q);var A,w=0;for(T=0;T<p.length;T++){A=(this.words[T+R]|0)+w;var M=(p.words[T]|0)*_;A-=M&67108863,w=(A>>26)-(M/67108864|0),this.words[T+R]=A&67108863}for(;T<this.length-R;T++)A=(this.words[T+R]|0)+w,w=A>>26,this.words[T+R]=A&67108863;if(w===0)return this._strip();for(o(w===-1),w=0,T=0;T<this.length;T++)A=-(this.words[T]|0)+w,w=A>>26,this.words[T]=A&67108863;return this.negative=1,this._strip()},r.prototype._wordDiv=function(p,_){var R=this.length-p.length,q=this.clone(),T=p,A=T.words[T.length-1]|0,w=this._countBits(A);R=26-w,R!==0&&(T=T.ushln(R),q.iushln(R),A=T.words[T.length-1]|0);var M=q.length-T.length,x;if(_!=="mod"){x=new r(null),x.length=M+1,x.words=new Array(x.length);for(var L=0;L<x.length;L++)x.words[L]=0}var K=q.clone()._ishlnsubmul(T,1,M);K.negative===0&&(q=K,x&&(x.words[M]=1));for(var Q=M-1;Q>=0;Q--){var j=(q.words[T.length+Q]|0)*67108864+(q.words[T.length+Q-1]|0);for(j=Math.min(j/A|0,67108863),q._ishlnsubmul(T,j,Q);q.negative!==0;)j--,q.negative=0,q._ishlnsubmul(T,1,Q),q.isZero()||(q.negative^=1);x&&(x.words[Q]=j)}return x&&x._strip(),q._strip(),_!=="div"&&R!==0&&q.iushrn(R),{div:x||null,mod:q}},r.prototype.divmod=function(p,_,R){if(o(!p.isZero()),this.isZero())return{div:new r(0),mod:new r(0)};var q,T,A;return this.negative!==0&&p.negative===0?(A=this.neg().divmod(p,_),_!=="mod"&&(q=A.div.neg()),_!=="div"&&(T=A.mod.neg(),R&&T.negative!==0&&T.iadd(p)),{div:q,mod:T}):this.negative===0&&p.negative!==0?(A=this.divmod(p.neg(),_),_!=="mod"&&(q=A.div.neg()),{div:q,mod:A.mod}):(this.negative&p.negative)!==0?(A=this.neg().divmod(p.neg(),_),_!=="div"&&(T=A.mod.neg(),R&&T.negative!==0&&T.isub(p)),{div:A.div,mod:T}):p.length>this.length||this.cmp(p)<0?{div:new r(0),mod:this}:p.length===1?_==="div"?{div:this.divn(p.words[0]),mod:null}:_==="mod"?{div:null,mod:new r(this.modrn(p.words[0]))}:{div:this.divn(p.words[0]),mod:new r(this.modrn(p.words[0]))}:this._wordDiv(p,_)},r.prototype.div=function(p){return this.divmod(p,"div",!1).div},r.prototype.mod=function(p){return this.divmod(p,"mod",!1).mod},r.prototype.umod=function(p){return this.divmod(p,"mod",!0).mod},r.prototype.divRound=function(p){var _=this.divmod(p);if(_.mod.isZero())return _.div;var R=_.div.negative!==0?_.mod.isub(p):_.mod,q=p.ushrn(1),T=p.andln(1),A=R.cmp(q);return A<0||T===1&&A===0?_.div:_.div.negative!==0?_.div.isubn(1):_.div.iaddn(1)},r.prototype.modrn=function(p){var _=p<0;_&&(p=-p),o(p<=67108863);for(var R=(1<<26)%p,q=0,T=this.length-1;T>=0;T--)q=(R*q+(this.words[T]|0))%p;return _?-q:q},r.prototype.modn=function(p){return this.modrn(p)},r.prototype.idivn=function(p){var _=p<0;_&&(p=-p),o(p<=67108863);for(var R=0,q=this.length-1;q>=0;q--){var T=(this.words[q]|0)+R*67108864;this.words[q]=T/p|0,R=T%p}return this._strip(),_?this.ineg():this},r.prototype.divn=function(p){return this.clone().idivn(p)},r.prototype.egcd=function(p){o(p.negative===0),o(!p.isZero());var _=this,R=p.clone();_.negative!==0?_=_.umod(p):_=_.clone();for(var q=new r(1),T=new r(0),A=new r(0),w=new r(1),M=0;_.isEven()&&R.isEven();)_.iushrn(1),R.iushrn(1),++M;for(var x=R.clone(),L=_.clone();!_.isZero();){for(var K=0,Q=1;(_.words[0]&Q)===0&&K<26;++K,Q<<=1);if(K>0)for(_.iushrn(K);K-- >0;)(q.isOdd()||T.isOdd())&&(q.iadd(x),T.isub(L)),q.iushrn(1),T.iushrn(1);for(var j=0,N=1;(R.words[0]&N)===0&&j<26;++j,N<<=1);if(j>0)for(R.iushrn(j);j-- >0;)(A.isOdd()||w.isOdd())&&(A.iadd(x),w.isub(L)),A.iushrn(1),w.iushrn(1);_.cmp(R)>=0?(_.isub(R),q.isub(A),T.isub(w)):(R.isub(_),A.isub(q),w.isub(T))}return{a:A,b:w,gcd:R.iushln(M)}},r.prototype._invmp=function(p){o(p.negative===0),o(!p.isZero());var _=this,R=p.clone();_.negative!==0?_=_.umod(p):_=_.clone();for(var q=new r(1),T=new r(0),A=R.clone();_.cmpn(1)>0&&R.cmpn(1)>0;){for(var w=0,M=1;(_.words[0]&M)===0&&w<26;++w,M<<=1);if(w>0)for(_.iushrn(w);w-- >0;)q.isOdd()&&q.iadd(A),q.iushrn(1);for(var x=0,L=1;(R.words[0]&L)===0&&x<26;++x,L<<=1);if(x>0)for(R.iushrn(x);x-- >0;)T.isOdd()&&T.iadd(A),T.iushrn(1);_.cmp(R)>=0?(_.isub(R),q.isub(T)):(R.isub(_),T.isub(q))}var K;return _.cmpn(1)===0?K=q:K=T,K.cmpn(0)<0&&K.iadd(p),K},r.prototype.gcd=function(p){if(this.isZero())return p.abs();if(p.isZero())return this.abs();var _=this.clone(),R=p.clone();_.negative=0,R.negative=0;for(var q=0;_.isEven()&&R.isEven();q++)_.iushrn(1),R.iushrn(1);do{for(;_.isEven();)_.iushrn(1);for(;R.isEven();)R.iushrn(1);var T=_.cmp(R);if(T<0){var A=_;_=R,R=A}else if(T===0||R.cmpn(1)===0)break;_.isub(R)}while(!0);return R.iushln(q)},r.prototype.invm=function(p){return this.egcd(p).a.umod(p)},r.prototype.isEven=function(){return(this.words[0]&1)===0},r.prototype.isOdd=function(){return(this.words[0]&1)===1},r.prototype.andln=function(p){return this.words[0]&p},r.prototype.bincn=function(p){o(typeof p=="number");var _=p%26,R=(p-_)/26,q=1<<_;if(this.length<=R)return this._expand(R+1),this.words[R]|=q,this;for(var T=q,A=R;T!==0&&A<this.length;A++){var w=this.words[A]|0;w+=T,T=w>>>26,w&=67108863,this.words[A]=w}return T!==0&&(this.words[A]=T,this.length++),this},r.prototype.isZero=function(){return this.length===1&&this.words[0]===0},r.prototype.cmpn=function(p){var _=p<0;if(this.negative!==0&&!_)return-1;if(this.negative===0&&_)return 1;this._strip();var R;if(this.length>1)R=1;else{_&&(p=-p),o(p<=67108863,"Number is too big");var q=this.words[0]|0;R=q===p?0:q<p?-1:1}return this.negative!==0?-R|0:R},r.prototype.cmp=function(p){if(this.negative!==0&&p.negative===0)return-1;if(this.negative===0&&p.negative!==0)return 1;var _=this.ucmp(p);return this.negative!==0?-_|0:_},r.prototype.ucmp=function(p){if(this.length>p.length)return 1;if(this.length<p.length)return-1;for(var _=0,R=this.length-1;R>=0;R--){var q=this.words[R]|0,T=p.words[R]|0;if(q!==T){q<T?_=-1:q>T&&(_=1);break}}return _},r.prototype.gtn=function(p){return this.cmpn(p)===1},r.prototype.gt=function(p){return this.cmp(p)===1},r.prototype.gten=function(p){return this.cmpn(p)>=0},r.prototype.gte=function(p){return this.cmp(p)>=0},r.prototype.ltn=function(p){return this.cmpn(p)===-1},r.prototype.lt=function(p){return this.cmp(p)===-1},r.prototype.lten=function(p){return this.cmpn(p)<=0},r.prototype.lte=function(p){return this.cmp(p)<=0},r.prototype.eqn=function(p){return this.cmpn(p)===0},r.prototype.eq=function(p){return this.cmp(p)===0},r.red=function(p){return new X(p)},r.prototype.toRed=function(p){return o(!this.red,"Already a number in reduction context"),o(this.negative===0,"red works only with positives"),p.convertTo(this)._forceRed(p)},r.prototype.fromRed=function(){return o(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},r.prototype._forceRed=function(p){return this.red=p,this},r.prototype.forceRed=function(p){return o(!this.red,"Already a number in reduction context"),this._forceRed(p)},r.prototype.redAdd=function(p){return o(this.red,"redAdd works only with red numbers"),this.red.add(this,p)},r.prototype.redIAdd=function(p){return o(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,p)},r.prototype.redSub=function(p){return o(this.red,"redSub works only with red numbers"),this.red.sub(this,p)},r.prototype.redISub=function(p){return o(this.red,"redISub works only with red numbers"),this.red.isub(this,p)},r.prototype.redShl=function(p){return o(this.red,"redShl works only with red numbers"),this.red.shl(this,p)},r.prototype.redMul=function(p){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.mul(this,p)},r.prototype.redIMul=function(p){return o(this.red,"redMul works only with red numbers"),this.red._verify2(this,p),this.red.imul(this,p)},r.prototype.redSqr=function(){return o(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},r.prototype.redISqr=function(){return o(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},r.prototype.redSqrt=function(){return o(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},r.prototype.redInvm=function(){return o(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},r.prototype.redNeg=function(){return o(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},r.prototype.redPow=function(p){return o(this.red&&!p.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,p)};var $={k256:null,p224:null,p192:null,p25519:null};function H(g,p){this.name=g,this.p=new r(p,16),this.n=this.p.bitLength(),this.k=new r(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}H.prototype._tmp=function(){var p=new r(null);return p.words=new Array(Math.ceil(this.n/13)),p},H.prototype.ireduce=function(p){var _=p,R;do this.split(_,this.tmp),_=this.imulK(_),_=_.iadd(this.tmp),R=_.bitLength();while(R>this.n);var q=R<this.n?-1:_.ucmp(this.p);return q===0?(_.words[0]=0,_.length=1):q>0?_.isub(this.p):_.strip!==void 0?_.strip():_._strip(),_},H.prototype.split=function(p,_){p.iushrn(this.n,0,_)},H.prototype.imulK=function(p){return p.imul(this.k)};function Y(){H.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}d(Y,H),Y.prototype.split=function(p,_){for(var R=4194303,q=Math.min(p.length,9),T=0;T<q;T++)_.words[T]=p.words[T];if(_.length=q,p.length<=9){p.words[0]=0,p.length=1;return}var A=p.words[9];for(_.words[_.length++]=A&R,T=10;T<p.length;T++){var w=p.words[T]|0;p.words[T-10]=(w&R)<<4|A>>>22,A=w}A>>>=22,p.words[T-10]=A,A===0&&p.length>10?p.length-=10:p.length-=9},Y.prototype.imulK=function(p){p.words[p.length]=0,p.words[p.length+1]=0,p.length+=2;for(var _=0,R=0;R<p.length;R++){var q=p.words[R]|0;_+=q*977,p.words[R]=_&67108863,_=q*64+(_/67108864|0)}return p.words[p.length-1]===0&&(p.length--,p.words[p.length-1]===0&&p.length--),p};function ie(){H.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}d(ie,H);function ne(){H.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}d(ne,H);function de(){H.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}d(de,H),de.prototype.imulK=function(p){for(var _=0,R=0;R<p.length;R++){var q=(p.words[R]|0)*19+_,T=q&67108863;q>>>=26,p.words[R]=T,_=q}return _!==0&&(p.words[p.length++]=_),p},r._prime=function(p){if($[p])return $[p];var _;if(p==="k256")_=new Y;else if(p==="p224")_=new ie;else if(p==="p192")_=new ne;else if(p==="p25519")_=new de;else throw new Error("Unknown prime "+p);return $[p]=_,_};function X(g){if(typeof g=="string"){var p=r._prime(g);this.m=p.p,this.prime=p}else o(g.gtn(1),"modulus must be greater than 1"),this.m=g,this.prime=null}X.prototype._verify1=function(p){o(p.negative===0,"red works only with positives"),o(p.red,"red works only with red numbers")},X.prototype._verify2=function(p,_){o((p.negative|_.negative)===0,"red works only with positives"),o(p.red&&p.red===_.red,"red works only with red numbers")},X.prototype.imod=function(p){return this.prime?this.prime.ireduce(p)._forceRed(this):(e(p,p.umod(this.m)._forceRed(this)),p)},X.prototype.neg=function(p){return p.isZero()?p.clone():this.m.sub(p)._forceRed(this)},X.prototype.add=function(p,_){this._verify2(p,_);var R=p.add(_);return R.cmp(this.m)>=0&&R.isub(this.m),R._forceRed(this)},X.prototype.iadd=function(p,_){this._verify2(p,_);var R=p.iadd(_);return R.cmp(this.m)>=0&&R.isub(this.m),R},X.prototype.sub=function(p,_){this._verify2(p,_);var R=p.sub(_);return R.cmpn(0)<0&&R.iadd(this.m),R._forceRed(this)},X.prototype.isub=function(p,_){this._verify2(p,_);var R=p.isub(_);return R.cmpn(0)<0&&R.iadd(this.m),R},X.prototype.shl=function(p,_){return this._verify1(p),this.imod(p.ushln(_))},X.prototype.imul=function(p,_){return this._verify2(p,_),this.imod(p.imul(_))},X.prototype.mul=function(p,_){return this._verify2(p,_),this.imod(p.mul(_))},X.prototype.isqr=function(p){return this.imul(p,p.clone())},X.prototype.sqr=function(p){return this.mul(p,p)},X.prototype.sqrt=function(p){if(p.isZero())return p.clone();var _=this.m.andln(3);if(o(_%2===1),_===3){var R=this.m.add(new r(1)).iushrn(2);return this.pow(p,R)}for(var q=this.m.subn(1),T=0;!q.isZero()&&q.andln(1)===0;)T++,q.iushrn(1);o(!q.isZero());var A=new r(1).toRed(this),w=A.redNeg(),M=this.m.subn(1).iushrn(1),x=this.m.bitLength();for(x=new r(2*x*x).toRed(this);this.pow(x,M).cmp(w)!==0;)x.redIAdd(w);for(var L=this.pow(x,q),K=this.pow(p,q.addn(1).iushrn(1)),Q=this.pow(p,q),j=T;Q.cmp(A)!==0;){for(var N=Q,F=0;N.cmp(A)!==0;F++)N=N.redSqr();o(F<j);var ee=this.pow(L,new r(1).iushln(j-F-1));K=K.redMul(ee),L=ee.redSqr(),Q=Q.redMul(L),j=F}return K},X.prototype.invm=function(p){var _=p._invmp(this.m);return _.negative!==0?(_.negative=0,this.imod(_).redNeg()):this.imod(_)},X.prototype.pow=function(p,_){if(_.isZero())return new r(1).toRed(this);if(_.cmpn(1)===0)return p.clone();var R=4,q=new Array(1<<R);q[0]=new r(1).toRed(this),q[1]=p;for(var T=2;T<q.length;T++)q[T]=this.mul(q[T-1],p);var A=q[0],w=0,M=0,x=_.bitLength()%26;for(x===0&&(x=26),T=_.length-1;T>=0;T--){for(var L=_.words[T],K=x-1;K>=0;K--){var Q=L>>K&1;if(A!==q[0]&&(A=this.sqr(A)),Q===0&&w===0){M=0;continue}w<<=1,w|=Q,M++,!(M!==R&&(T!==0||K!==0))&&(A=this.mul(A,q[w]),M=0,w=0)}x=26}return A},X.prototype.convertTo=function(p){var _=p.umod(this.m);return _===p?_.clone():_},X.prototype.convertFrom=function(p){var _=p.clone();return _.red=null,_},r.mont=function(p){return new y(p)};function y(g){X.call(this,g),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new r(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)}d(y,X),y.prototype.convertTo=function(p){return this.imod(p.ushln(this.shift))},y.prototype.convertFrom=function(p){var _=this.imod(p.mul(this.rinv));return _.red=null,_},y.prototype.imul=function(p,_){if(p.isZero()||_.isZero())return p.words[0]=0,p.length=1,p;var R=p.imul(_),q=R.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),T=R.isub(q).iushrn(this.shift),A=T;return T.cmp(this.m)>=0?A=T.isub(this.m):T.cmpn(0)<0&&(A=T.iadd(this.m)),A._forceRed(this)},y.prototype.mul=function(p,_){if(p.isZero()||_.isZero())return new r(0)._forceRed(this);var R=p.mul(_),q=R.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),T=R.isub(q).iushrn(this.shift),A=T;return T.cmp(this.m)>=0?A=T.isub(this.m):T.cmpn(0)<0&&(A=T.iadd(this.m)),A._forceRed(this)},y.prototype.invm=function(p){var _=this.imod(p._invmp(this.m).mul(this.r2));return _._forceRed(this)}})(s,bn)})(bn$1)),bn$1.exports}var browserifyRsa,hasRequiredBrowserifyRsa;function requireBrowserifyRsa(){if(hasRequiredBrowserifyRsa)return browserifyRsa;hasRequiredBrowserifyRsa=1;var s=requireBn(),t=requireBrowser$b(),f=requireSafeBuffer$1().Buffer;function o(h){var c=h.modulus.byteLength(),n;do n=new s(t(c));while(n.cmp(h.modulus)>=0||!n.umod(h.prime1)||!n.umod(h.prime2));return n}function d(h){var c=o(h),n=c.toRed(s.mont(h.modulus)).redPow(new s(h.publicExponent)).fromRed();return{blinder:n,unblinder:c.invm(h.modulus)}}function r(h,c){var n=d(c),a=c.modulus.byteLength(),e=new s(h).mul(n.blinder).umod(c.modulus),u=e.toRed(s.mont(c.prime1)),l=e.toRed(s.mont(c.prime2)),v=c.coefficient,b=c.prime1,m=c.prime2,B=u.redPow(c.exponent1).fromRed(),E=l.redPow(c.exponent2).fromRed(),S=B.isub(E).imul(v).umod(b).imul(m);return E.iadd(S).imul(n.unblinder).umod(c.modulus).toArrayLike(f,"be",a)}return r.getr=o,browserifyRsa=r,browserifyRsa}var elliptic={};const version="6.6.1",require$$0={version};var utils$2={},utils$1={},hasRequiredUtils$3;function requireUtils$3(){return hasRequiredUtils$3||(hasRequiredUtils$3=1,(function(s){var t=s;function f(r,h){if(Array.isArray(r))return r.slice();if(!r)return[];var c=[];if(typeof r!="string"){for(var n=0;n<r.length;n++)c[n]=r[n]|0;return c}if(h==="hex"){r=r.replace(/[^a-z0-9]+/ig,""),r.length%2!==0&&(r="0"+r);for(var n=0;n<r.length;n+=2)c.push(parseInt(r[n]+r[n+1],16))}else for(var n=0;n<r.length;n++){var a=r.charCodeAt(n),e=a>>8,u=a&255;e?c.push(e,u):c.push(u)}return c}t.toArray=f;function o(r){return r.length===1?"0"+r:r}t.zero2=o;function d(r){for(var h="",c=0;c<r.length;c++)h+=o(r[c].toString(16));return h}t.toHex=d,t.encode=function(h,c){return c==="hex"?d(h):h}})(utils$1)),utils$1}var hasRequiredUtils$2;function requireUtils$2(){return hasRequiredUtils$2||(hasRequiredUtils$2=1,(function(s){var t=s,f=requireBn$1(),o=requireMinimalisticAssert(),d=requireUtils$3();t.assert=o,t.toArray=d.toArray,t.zero2=d.zero2,t.toHex=d.toHex,t.encode=d.encode;function r(e,u,l){var v=new Array(Math.max(e.bitLength(),l)+1),b;for(b=0;b<v.length;b+=1)v[b]=0;var m=1<<u+1,B=e.clone();for(b=0;b<v.length;b++){var E,S=B.andln(m-1);B.isOdd()?(S>(m>>1)-1?E=(m>>1)-S:E=S,B.isubn(E)):E=0,v[b]=E,B.iushrn(1)}return v}t.getNAF=r;function h(e,u){var l=[[],[]];e=e.clone(),u=u.clone();for(var v=0,b=0,m;e.cmpn(-v)>0||u.cmpn(-b)>0;){var B=e.andln(3)+v&3,E=u.andln(3)+b&3;B===3&&(B=-1),E===3&&(E=-1);var S;(B&1)===0?S=0:(m=e.andln(7)+v&7,(m===3||m===5)&&E===2?S=-B:S=B),l[0].push(S);var O;(E&1)===0?O=0:(m=u.andln(7)+b&7,(m===3||m===5)&&B===2?O=-E:O=E),l[1].push(O),2*v===S+1&&(v=1-v),2*b===O+1&&(b=1-b),e.iushrn(1),u.iushrn(1)}return l}t.getJSF=h;function c(e,u,l){var v="_"+u;e.prototype[u]=function(){return this[v]!==void 0?this[v]:this[v]=l.call(this)}}t.cachedProperty=c;function n(e){return typeof e=="string"?t.toArray(e,"hex"):e}t.parseBytes=n;function a(e){return new f(e,"hex","le")}t.intFromLE=a})(utils$2)),utils$2}var curve={},base$1,hasRequiredBase$1;function requireBase$1(){if(hasRequiredBase$1)return base$1;hasRequiredBase$1=1;var s=requireBn$1(),t=requireUtils$2(),f=t.getNAF,o=t.getJSF,d=t.assert;function r(c,n){this.type=c,this.p=new s(n.p,16),this.red=n.prime?s.red(n.prime):s.mont(this.p),this.zero=new s(0).toRed(this.red),this.one=new s(1).toRed(this.red),this.two=new s(2).toRed(this.red),this.n=n.n&&new s(n.n,16),this.g=n.g&&this.pointFromJSON(n.g,n.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 a=this.n&&this.p.div(this.n);!a||a.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}base$1=r,r.prototype.point=function(){throw new Error("Not implemented")},r.prototype.validate=function(){throw new Error("Not implemented")},r.prototype._fixedNafMul=function(n,a){d(n.precomputed);var e=n._getDoubles(),u=f(a,1,this._bitLength),l=(1<<e.step+1)-(e.step%2===0?2:1);l/=3;var v=[],b,m;for(b=0;b<u.length;b+=e.step){m=0;for(var B=b+e.step-1;B>=b;B--)m=(m<<1)+u[B];v.push(m)}for(var E=this.jpoint(null,null,null),S=this.jpoint(null,null,null),O=l;O>0;O--){for(b=0;b<v.length;b++)m=v[b],m===O?S=S.mixedAdd(e.points[b]):m===-O&&(S=S.mixedAdd(e.points[b].neg()));E=E.add(S)}return E.toP()},r.prototype._wnafMul=function(n,a){var e=4,u=n._getNAFPoints(e);e=u.wnd;for(var l=u.points,v=f(a,e,this._bitLength),b=this.jpoint(null,null,null),m=v.length-1;m>=0;m--){for(var B=0;m>=0&&v[m]===0;m--)B++;if(m>=0&&B++,b=b.dblp(B),m<0)break;var E=v[m];d(E!==0),n.type==="affine"?E>0?b=b.mixedAdd(l[E-1>>1]):b=b.mixedAdd(l[-E-1>>1].neg()):E>0?b=b.add(l[E-1>>1]):b=b.add(l[-E-1>>1].neg())}return n.type==="affine"?b.toP():b},r.prototype._wnafMulAdd=function(n,a,e,u,l){var v=this._wnafT1,b=this._wnafT2,m=this._wnafT3,B=0,E,S,O;for(E=0;E<u;E++){O=a[E];var D=O._getNAFPoints(n);v[E]=D.wnd,b[E]=D.points}for(E=u-1;E>=1;E-=2){var $=E-1,H=E;if(v[$]!==1||v[H]!==1){m[$]=f(e[$],v[$],this._bitLength),m[H]=f(e[H],v[H],this._bitLength),B=Math.max(m[$].length,B),B=Math.max(m[H].length,B);continue}var Y=[a[$],null,null,a[H]];a[$].y.cmp(a[H].y)===0?(Y[1]=a[$].add(a[H]),Y[2]=a[$].toJ().mixedAdd(a[H].neg())):a[$].y.cmp(a[H].y.redNeg())===0?(Y[1]=a[$].toJ().mixedAdd(a[H]),Y[2]=a[$].add(a[H].neg())):(Y[1]=a[$].toJ().mixedAdd(a[H]),Y[2]=a[$].toJ().mixedAdd(a[H].neg()));var ie=[-3,-1,-5,-7,0,7,5,1,3],ne=o(e[$],e[H]);for(B=Math.max(ne[0].length,B),m[$]=new Array(B),m[H]=new Array(B),S=0;S<B;S++){var de=ne[0][S]|0,X=ne[1][S]|0;m[$][S]=ie[(de+1)*3+(X+1)],m[H][S]=0,b[$]=Y}}var y=this.jpoint(null,null,null),g=this._wnafT4;for(E=B;E>=0;E--){for(var p=0;E>=0;){var _=!0;for(S=0;S<u;S++)g[S]=m[S][E]|0,g[S]!==0&&(_=!1);if(!_)break;p++,E--}if(E>=0&&p++,y=y.dblp(p),E<0)break;for(S=0;S<u;S++){var R=g[S];R!==0&&(R>0?O=b[S][R-1>>1]:R<0&&(O=b[S][-R-1>>1].neg()),O.type==="affine"?y=y.mixedAdd(O):y=y.add(O))}}for(E=0;E<u;E++)b[E]=null;return l?y:y.toP()};function h(c,n){this.curve=c,this.type=n,this.precomputed=null}return r.BasePoint=h,h.prototype.eq=function(){throw new Error("Not implemented")},h.prototype.validate=function(){return this.curve.validate(this)},r.prototype.decodePoint=function(n,a){n=t.toArray(n,a);var e=this.p.byteLength();if((n[0]===4||n[0]===6||n[0]===7)&&n.length-1===2*e){n[0]===6?d(n[n.length-1]%2===0):n[0]===7&&d(n[n.length-1]%2===1);var u=this.point(n.slice(1,1+e),n.slice(1+e,1+2*e));return u}else if((n[0]===2||n[0]===3)&&n.length-1===e)return this.pointFromX(n.slice(1,1+e),n[0]===3);throw new Error("Unknown point format")},h.prototype.encodeCompressed=function(n){return this.encode(n,!0)},h.prototype._encode=function(n){var a=this.curve.p.byteLength(),e=this.getX().toArray("be",a);return n?[this.getY().isEven()?2:3].concat(e):[4].concat(e,this.getY().toArray("be",a))},h.prototype.encode=function(n,a){return t.encode(this._encode(a),n)},h.prototype.precompute=function(n){if(this.precomputed)return this;var a={doubles:null,naf:null,beta:null};return a.naf=this._getNAFPoints(8),a.doubles=this._getDoubles(4,n),a.beta=this._getBeta(),this.precomputed=a,this},h.prototype._hasDoubles=function(n){if(!this.precomputed)return!1;var a=this.precomputed.doubles;return a?a.points.length>=Math.ceil((n.bitLength()+1)/a.step):!1},h.prototype._getDoubles=function(n,a){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var e=[this],u=this,l=0;l<a;l+=n){for(var v=0;v<n;v++)u=u.dbl();e.push(u)}return{step:n,points:e}},h.prototype._getNAFPoints=function(n){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var a=[this],e=(1<<n)-1,u=e===1?null:this.dbl(),l=1;l<e;l++)a[l]=a[l-1].add(u);return{wnd:n,points:a}},h.prototype._getBeta=function(){return null},h.prototype.dblp=function(n){for(var a=this,e=0;e<n;e++)a=a.dbl();return a},base$1}var short,hasRequiredShort;function requireShort(){if(hasRequiredShort)return short;hasRequiredShort=1;var s=requireUtils$2(),t=requireBn$1(),f=requireInherits_browser(),o=requireBase$1(),d=s.assert;function r(n){o.call(this,"short",n),this.a=new t(n.a,16).toRed(this.red),this.b=new t(n.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(n),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}f(r,o),short=r,r.prototype._getEndomorphism=function(a){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var e,u;if(a.beta)e=new t(a.beta,16).toRed(this.red);else{var l=this._getEndoRoots(this.p);e=l[0].cmp(l[1])<0?l[0]:l[1],e=e.toRed(this.red)}if(a.lambda)u=new t(a.lambda,16);else{var v=this._getEndoRoots(this.n);this.g.mul(v[0]).x.cmp(this.g.x.redMul(e))===0?u=v[0]:(u=v[1],d(this.g.mul(u).x.cmp(this.g.x.redMul(e))===0))}var b;return a.basis?b=a.basis.map(function(m){return{a:new t(m.a,16),b:new t(m.b,16)}}):b=this._getEndoBasis(u),{beta:e,lambda:u,basis:b}}},r.prototype._getEndoRoots=function(a){var e=a===this.p?this.red:t.mont(a),u=new t(2).toRed(e).redInvm(),l=u.redNeg(),v=new t(3).toRed(e).redNeg().redSqrt().redMul(u),b=l.redAdd(v).fromRed(),m=l.redSub(v).fromRed();return[b,m]},r.prototype._getEndoBasis=function(a){for(var e=this.n.ushrn(Math.floor(this.n.bitLength()/2)),u=a,l=this.n.clone(),v=new t(1),b=new t(0),m=new t(0),B=new t(1),E,S,O,D,$,H,Y,ie=0,ne,de;u.cmpn(0)!==0;){var X=l.div(u);ne=l.sub(X.mul(u)),de=m.sub(X.mul(v));var y=B.sub(X.mul(b));if(!O&&ne.cmp(e)<0)E=Y.neg(),S=v,O=ne.neg(),D=de;else if(O&&++ie===2)break;Y=ne,l=u,u=ne,m=v,v=de,B=b,b=y}$=ne.neg(),H=de;var g=O.sqr().add(D.sqr()),p=$.sqr().add(H.sqr());return p.cmp(g)>=0&&($=E,H=S),O.negative&&(O=O.neg(),D=D.neg()),$.negative&&($=$.neg(),H=H.neg()),[{a:O,b:D},{a:$,b:H}]},r.prototype._endoSplit=function(a){var e=this.endo.basis,u=e[0],l=e[1],v=l.b.mul(a).divRound(this.n),b=u.b.neg().mul(a).divRound(this.n),m=v.mul(u.a),B=b.mul(l.a),E=v.mul(u.b),S=b.mul(l.b),O=a.sub(m).sub(B),D=E.add(S).neg();return{k1:O,k2:D}},r.prototype.pointFromX=function(a,e){a=new t(a,16),a.red||(a=a.toRed(this.red));var u=a.redSqr().redMul(a).redIAdd(a.redMul(this.a)).redIAdd(this.b),l=u.redSqrt();if(l.redSqr().redSub(u).cmp(this.zero)!==0)throw new Error("invalid point");var v=l.fromRed().isOdd();return(e&&!v||!e&&v)&&(l=l.redNeg()),this.point(a,l)},r.prototype.validate=function(a){if(a.inf)return!0;var e=a.x,u=a.y,l=this.a.redMul(e),v=e.redSqr().redMul(e).redIAdd(l).redIAdd(this.b);return u.redSqr().redISub(v).cmpn(0)===0},r.prototype._endoWnafMulAdd=function(a,e,u){for(var l=this._endoWnafT1,v=this._endoWnafT2,b=0;b<a.length;b++){var m=this._endoSplit(e[b]),B=a[b],E=B._getBeta();m.k1.negative&&(m.k1.ineg(),B=B.neg(!0)),m.k2.negative&&(m.k2.ineg(),E=E.neg(!0)),l[b*2]=B,l[b*2+1]=E,v[b*2]=m.k1,v[b*2+1]=m.k2}for(var S=this._wnafMulAdd(1,l,v,b*2,u),O=0;O<b*2;O++)l[O]=null,v[O]=null;return S};function h(n,a,e,u){o.BasePoint.call(this,n,"affine"),a===null&&e===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new t(a,16),this.y=new t(e,16),u&&(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)}f(h,o.BasePoint),r.prototype.point=function(a,e,u){return new h(this,a,e,u)},r.prototype.pointFromJSON=function(a,e){return h.fromJSON(this,a,e)},h.prototype._getBeta=function(){if(this.curve.endo){var a=this.precomputed;if(a&&a.beta)return a.beta;var e=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(a){var u=this.curve,l=function(v){return u.point(v.x.redMul(u.endo.beta),v.y)};a.beta=e,e.precomputed={beta:null,naf:a.naf&&{wnd:a.naf.wnd,points:a.naf.points.map(l)},doubles:a.doubles&&{step:a.doubles.step,points:a.doubles.points.map(l)}}}return e}},h.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]},h.fromJSON=function(a,e,u){typeof e=="string"&&(e=JSON.parse(e));var l=a.point(e[0],e[1],u);if(!e[2])return l;function v(m){return a.point(m[0],m[1],u)}var b=e[2];return l.precomputed={beta:null,doubles:b.doubles&&{step:b.doubles.step,points:[l].concat(b.doubles.points.map(v))},naf:b.naf&&{wnd:b.naf.wnd,points:[l].concat(b.naf.points.map(v))}},l},h.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)+">"},h.prototype.isInfinity=function(){return this.inf},h.prototype.add=function(a){if(this.inf)return a;if(a.inf)return this;if(this.eq(a))return this.dbl();if(this.neg().eq(a))return this.curve.point(null,null);if(this.x.cmp(a.x)===0)return this.curve.point(null,null);var e=this.y.redSub(a.y);e.cmpn(0)!==0&&(e=e.redMul(this.x.redSub(a.x).redInvm()));var u=e.redSqr().redISub(this.x).redISub(a.x),l=e.redMul(this.x.redSub(u)).redISub(this.y);return this.curve.point(u,l)},h.prototype.dbl=function(){if(this.inf)return this;var a=this.y.redAdd(this.y);if(a.cmpn(0)===0)return this.curve.point(null,null);var e=this.curve.a,u=this.x.redSqr(),l=a.redInvm(),v=u.redAdd(u).redIAdd(u).redIAdd(e).redMul(l),b=v.redSqr().redISub(this.x.redAdd(this.x)),m=v.redMul(this.x.redSub(b)).redISub(this.y);return this.curve.point(b,m)},h.prototype.getX=function(){return this.x.fromRed()},h.prototype.getY=function(){return this.y.fromRed()},h.prototype.mul=function(a){return a=new t(a,16),this.isInfinity()?this:this._hasDoubles(a)?this.curve._fixedNafMul(this,a):this.curve.endo?this.curve._endoWnafMulAdd([this],[a]):this.curve._wnafMul(this,a)},h.prototype.mulAdd=function(a,e,u){var l=[this,e],v=[a,u];return this.curve.endo?this.curve._endoWnafMulAdd(l,v):this.curve._wnafMulAdd(1,l,v,2)},h.prototype.jmulAdd=function(a,e,u){var l=[this,e],v=[a,u];return this.curve.endo?this.curve._endoWnafMulAdd(l,v,!0):this.curve._wnafMulAdd(1,l,v,2,!0)},h.prototype.eq=function(a){return this===a||this.inf===a.inf&&(this.inf||this.x.cmp(a.x)===0&&this.y.cmp(a.y)===0)},h.prototype.neg=function(a){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(a&&this.precomputed){var u=this.precomputed,l=function(v){return v.neg()};e.precomputed={naf:u.naf&&{wnd:u.naf.wnd,points:u.naf.points.map(l)},doubles:u.doubles&&{step:u.doubles.step,points:u.doubles.points.map(l)}}}return e},h.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var a=this.curve.jpoint(this.x,this.y,this.curve.one);return a};function c(n,a,e,u){o.BasePoint.call(this,n,"jacobian"),a===null&&e===null&&u===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new t(0)):(this.x=new t(a,16),this.y=new t(e,16),this.z=new t(u,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}return f(c,o.BasePoint),r.prototype.jpoint=function(a,e,u){return new c(this,a,e,u)},c.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var a=this.z.redInvm(),e=a.redSqr(),u=this.x.redMul(e),l=this.y.redMul(e).redMul(a);return this.curve.point(u,l)},c.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},c.prototype.add=function(a){if(this.isInfinity())return a;if(a.isInfinity())return this;var e=a.z.redSqr(),u=this.z.redSqr(),l=this.x.redMul(e),v=a.x.redMul(u),b=this.y.redMul(e.redMul(a.z)),m=a.y.redMul(u.redMul(this.z)),B=l.redSub(v),E=b.redSub(m);if(B.cmpn(0)===0)return E.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var S=B.redSqr(),O=S.redMul(B),D=l.redMul(S),$=E.redSqr().redIAdd(O).redISub(D).redISub(D),H=E.redMul(D.redISub($)).redISub(b.redMul(O)),Y=this.z.redMul(a.z).redMul(B);return this.curve.jpoint($,H,Y)},c.prototype.mixedAdd=function(a){if(this.isInfinity())return a.toJ();if(a.isInfinity())return this;var e=this.z.redSqr(),u=this.x,l=a.x.redMul(e),v=this.y,b=a.y.redMul(e).redMul(this.z),m=u.redSub(l),B=v.redSub(b);if(m.cmpn(0)===0)return B.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var E=m.redSqr(),S=E.redMul(m),O=u.redMul(E),D=B.redSqr().redIAdd(S).redISub(O).redISub(O),$=B.redMul(O.redISub(D)).redISub(v.redMul(S)),H=this.z.redMul(m);return this.curve.jpoint(D,$,H)},c.prototype.dblp=function(a){if(a===0)return this;if(this.isInfinity())return this;if(!a)return this.dbl();var e;if(this.curve.zeroA||this.curve.threeA){var u=this;for(e=0;e<a;e++)u=u.dbl();return u}var l=this.curve.a,v=this.curve.tinv,b=this.x,m=this.y,B=this.z,E=B.redSqr().redSqr(),S=m.redAdd(m);for(e=0;e<a;e++){var O=b.redSqr(),D=S.redSqr(),$=D.redSqr(),H=O.redAdd(O).redIAdd(O).redIAdd(l.redMul(E)),Y=b.redMul(D),ie=H.redSqr().redISub(Y.redAdd(Y)),ne=Y.redISub(ie),de=H.redMul(ne);de=de.redIAdd(de).redISub($);var X=S.redMul(B);e+1<a&&(E=E.redMul($)),b=ie,B=X,S=de}return this.curve.jpoint(b,S.redMul(v),B)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},c.prototype._zeroDbl=function(){var a,e,u;if(this.zOne){var l=this.x.redSqr(),v=this.y.redSqr(),b=v.redSqr(),m=this.x.redAdd(v).redSqr().redISub(l).redISub(b);m=m.redIAdd(m);var B=l.redAdd(l).redIAdd(l),E=B.redSqr().redISub(m).redISub(m),S=b.redIAdd(b);S=S.redIAdd(S),S=S.redIAdd(S),a=E,e=B.redMul(m.redISub(E)).redISub(S),u=this.y.redAdd(this.y)}else{var O=this.x.redSqr(),D=this.y.redSqr(),$=D.redSqr(),H=this.x.redAdd(D).redSqr().redISub(O).redISub($);H=H.redIAdd(H);var Y=O.redAdd(O).redIAdd(O),ie=Y.redSqr(),ne=$.redIAdd($);ne=ne.redIAdd(ne),ne=ne.redIAdd(ne),a=ie.redISub(H).redISub(H),e=Y.redMul(H.redISub(a)).redISub(ne),u=this.y.redMul(this.z),u=u.redIAdd(u)}return this.curve.jpoint(a,e,u)},c.prototype._threeDbl=function(){var a,e,u;if(this.zOne){var l=this.x.redSqr(),v=this.y.redSqr(),b=v.redSqr(),m=this.x.redAdd(v).redSqr().redISub(l).redISub(b);m=m.redIAdd(m);var B=l.redAdd(l).redIAdd(l).redIAdd(this.curve.a),E=B.redSqr().redISub(m).redISub(m);a=E;var S=b.redIAdd(b);S=S.redIAdd(S),S=S.redIAdd(S),e=B.redMul(m.redISub(E)).redISub(S),u=this.y.redAdd(this.y)}else{var O=this.z.redSqr(),D=this.y.redSqr(),$=this.x.redMul(D),H=this.x.redSub(O).redMul(this.x.redAdd(O));H=H.redAdd(H).redIAdd(H);var Y=$.redIAdd($);Y=Y.redIAdd(Y);var ie=Y.redAdd(Y);a=H.redSqr().redISub(ie),u=this.y.redAdd(this.z).redSqr().redISub(D).redISub(O);var ne=D.redSqr();ne=ne.redIAdd(ne),ne=ne.redIAdd(ne),ne=ne.redIAdd(ne),e=H.redMul(Y.redISub(a)).redISub(ne)}return this.curve.jpoint(a,e,u)},c.prototype._dbl=function(){var a=this.curve.a,e=this.x,u=this.y,l=this.z,v=l.redSqr().redSqr(),b=e.redSqr(),m=u.redSqr(),B=b.redAdd(b).redIAdd(b).redIAdd(a.redMul(v)),E=e.redAdd(e);E=E.redIAdd(E);var S=E.redMul(m),O=B.redSqr().redISub(S.redAdd(S)),D=S.redISub(O),$=m.redSqr();$=$.redIAdd($),$=$.redIAdd($),$=$.redIAdd($);var H=B.redMul(D).redISub($),Y=u.redAdd(u).redMul(l);return this.curve.jpoint(O,H,Y)},c.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var a=this.x.redSqr(),e=this.y.redSqr(),u=this.z.redSqr(),l=e.redSqr(),v=a.redAdd(a).redIAdd(a),b=v.redSqr(),m=this.x.redAdd(e).redSqr().redISub(a).redISub(l);m=m.redIAdd(m),m=m.redAdd(m).redIAdd(m),m=m.redISub(b);var B=m.redSqr(),E=l.redIAdd(l);E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E);var S=v.redIAdd(m).redSqr().redISub(b).redISub(B).redISub(E),O=e.redMul(S);O=O.redIAdd(O),O=O.redIAdd(O);var D=this.x.redMul(B).redISub(O);D=D.redIAdd(D),D=D.redIAdd(D);var $=this.y.redMul(S.redMul(E.redISub(S)).redISub(m.redMul(B)));$=$.redIAdd($),$=$.redIAdd($),$=$.redIAdd($);var H=this.z.redAdd(m).redSqr().redISub(u).redISub(B);return this.curve.jpoint(D,$,H)},c.prototype.mul=function(a,e){return a=new t(a,e),this.curve._wnafMul(this,a)},c.prototype.eq=function(a){if(a.type==="affine")return this.eq(a.toJ());if(this===a)return!0;var e=this.z.redSqr(),u=a.z.redSqr();if(this.x.redMul(u).redISub(a.x.redMul(e)).cmpn(0)!==0)return!1;var l=e.redMul(this.z),v=u.redMul(a.z);return this.y.redMul(v).redISub(a.y.redMul(l)).cmpn(0)===0},c.prototype.eqXToP=function(a){var e=this.z.redSqr(),u=a.toRed(this.curve.red).redMul(e);if(this.x.cmp(u)===0)return!0;for(var l=a.clone(),v=this.curve.redN.redMul(e);;){if(l.iadd(this.curve.n),l.cmp(this.curve.p)>=0)return!1;if(u.redIAdd(v),this.x.cmp(u)===0)return!0}},c.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)+">"},c.prototype.isInfinity=function(){return this.z.cmpn(0)===0},short}var mont,hasRequiredMont;function requireMont(){if(hasRequiredMont)return mont;hasRequiredMont=1;var s=requireBn$1(),t=requireInherits_browser(),f=requireBase$1(),o=requireUtils$2();function d(h){f.call(this,"mont",h),this.a=new s(h.a,16).toRed(this.red),this.b=new s(h.b,16).toRed(this.red),this.i4=new s(4).toRed(this.red).redInvm(),this.two=new s(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}t(d,f),mont=d,d.prototype.validate=function(c){var n=c.normalize().x,a=n.redSqr(),e=a.redMul(n).redAdd(a.redMul(this.a)).redAdd(n),u=e.redSqrt();return u.redSqr().cmp(e)===0};function r(h,c,n){f.BasePoint.call(this,h,"projective"),c===null&&n===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new s(c,16),this.z=new s(n,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}return t(r,f.BasePoint),d.prototype.decodePoint=function(c,n){return this.point(o.toArray(c,n),1)},d.prototype.point=function(c,n){return new r(this,c,n)},d.prototype.pointFromJSON=function(c){return r.fromJSON(this,c)},r.prototype.precompute=function(){},r.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},r.fromJSON=function(c,n){return new r(c,n[0],n[1]||c.one)},r.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)+">"},r.prototype.isInfinity=function(){return this.z.cmpn(0)===0},r.prototype.dbl=function(){var c=this.x.redAdd(this.z),n=c.redSqr(),a=this.x.redSub(this.z),e=a.redSqr(),u=n.redSub(e),l=n.redMul(e),v=u.redMul(e.redAdd(this.curve.a24.redMul(u)));return this.curve.point(l,v)},r.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},r.prototype.diffAdd=function(c,n){var a=this.x.redAdd(this.z),e=this.x.redSub(this.z),u=c.x.redAdd(c.z),l=c.x.redSub(c.z),v=l.redMul(a),b=u.redMul(e),m=n.z.redMul(v.redAdd(b).redSqr()),B=n.x.redMul(v.redISub(b).redSqr());return this.curve.point(m,B)},r.prototype.mul=function(c){for(var n=c.clone(),a=this,e=this.curve.point(null,null),u=this,l=[];n.cmpn(0)!==0;n.iushrn(1))l.push(n.andln(1));for(var v=l.length-1;v>=0;v--)l[v]===0?(a=a.diffAdd(e,u),e=e.dbl()):(e=a.diffAdd(e,u),a=a.dbl());return e},r.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},r.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},r.prototype.eq=function(c){return this.getX().cmp(c.getX())===0},r.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},r.prototype.getX=function(){return this.normalize(),this.x.fromRed()},mont}var edwards,hasRequiredEdwards;function requireEdwards(){if(hasRequiredEdwards)return edwards;hasRequiredEdwards=1;var s=requireUtils$2(),t=requireBn$1(),f=requireInherits_browser(),o=requireBase$1(),d=s.assert;function r(c){this.twisted=(c.a|0)!==1,this.mOneA=this.twisted&&(c.a|0)===-1,this.extended=this.mOneA,o.call(this,"edwards",c),this.a=new t(c.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new t(c.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new t(c.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),d(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(c.c|0)===1}f(r,o),edwards=r,r.prototype._mulA=function(n){return this.mOneA?n.redNeg():this.a.redMul(n)},r.prototype._mulC=function(n){return this.oneC?n:this.c.redMul(n)},r.prototype.jpoint=function(n,a,e,u){return this.point(n,a,e,u)},r.prototype.pointFromX=function(n,a){n=new t(n,16),n.red||(n=n.toRed(this.red));var e=n.redSqr(),u=this.c2.redSub(this.a.redMul(e)),l=this.one.redSub(this.c2.redMul(this.d).redMul(e)),v=u.redMul(l.redInvm()),b=v.redSqrt();if(b.redSqr().redSub(v).cmp(this.zero)!==0)throw new Error("invalid point");var m=b.fromRed().isOdd();return(a&&!m||!a&&m)&&(b=b.redNeg()),this.point(n,b)},r.prototype.pointFromY=function(n,a){n=new t(n,16),n.red||(n=n.toRed(this.red));var e=n.redSqr(),u=e.redSub(this.c2),l=e.redMul(this.d).redMul(this.c2).redSub(this.a),v=u.redMul(l.redInvm());if(v.cmp(this.zero)===0){if(a)throw new Error("invalid point");return this.point(this.zero,n)}var b=v.redSqrt();if(b.redSqr().redSub(v).cmp(this.zero)!==0)throw new Error("invalid point");return b.fromRed().isOdd()!==a&&(b=b.redNeg()),this.point(b,n)},r.prototype.validate=function(n){if(n.isInfinity())return!0;n.normalize();var a=n.x.redSqr(),e=n.y.redSqr(),u=a.redMul(this.a).redAdd(e),l=this.c2.redMul(this.one.redAdd(this.d.redMul(a).redMul(e)));return u.cmp(l)===0};function h(c,n,a,e,u){o.BasePoint.call(this,c,"projective"),n===null&&a===null&&e===null?(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 t(n,16),this.y=new t(a,16),this.z=e?new t(e,16):this.curve.one,this.t=u&&new t(u,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()))))}return f(h,o.BasePoint),r.prototype.pointFromJSON=function(n){return h.fromJSON(this,n)},r.prototype.point=function(n,a,e,u){return new h(this,n,a,e,u)},h.fromJSON=function(n,a){return new h(n,a[0],a[1],a[2])},h.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)+">"},h.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},h.prototype._extDbl=function(){var n=this.x.redSqr(),a=this.y.redSqr(),e=this.z.redSqr();e=e.redIAdd(e);var u=this.curve._mulA(n),l=this.x.redAdd(this.y).redSqr().redISub(n).redISub(a),v=u.redAdd(a),b=v.redSub(e),m=u.redSub(a),B=l.redMul(b),E=v.redMul(m),S=l.redMul(m),O=b.redMul(v);return this.curve.point(B,E,O,S)},h.prototype._projDbl=function(){var n=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),e=this.y.redSqr(),u,l,v,b,m,B;if(this.curve.twisted){b=this.curve._mulA(a);var E=b.redAdd(e);this.zOne?(u=n.redSub(a).redSub(e).redMul(E.redSub(this.curve.two)),l=E.redMul(b.redSub(e)),v=E.redSqr().redSub(E).redSub(E)):(m=this.z.redSqr(),B=E.redSub(m).redISub(m),u=n.redSub(a).redISub(e).redMul(B),l=E.redMul(b.redSub(e)),v=E.redMul(B))}else b=a.redAdd(e),m=this.curve._mulC(this.z).redSqr(),B=b.redSub(m).redSub(m),u=this.curve._mulC(n.redISub(b)).redMul(B),l=this.curve._mulC(b).redMul(a.redISub(e)),v=b.redMul(B);return this.curve.point(u,l,v)},h.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},h.prototype._extAdd=function(n){var a=this.y.redSub(this.x).redMul(n.y.redSub(n.x)),e=this.y.redAdd(this.x).redMul(n.y.redAdd(n.x)),u=this.t.redMul(this.curve.dd).redMul(n.t),l=this.z.redMul(n.z.redAdd(n.z)),v=e.redSub(a),b=l.redSub(u),m=l.redAdd(u),B=e.redAdd(a),E=v.redMul(b),S=m.redMul(B),O=v.redMul(B),D=b.redMul(m);return this.curve.point(E,S,D,O)},h.prototype._projAdd=function(n){var a=this.z.redMul(n.z),e=a.redSqr(),u=this.x.redMul(n.x),l=this.y.redMul(n.y),v=this.curve.d.redMul(u).redMul(l),b=e.redSub(v),m=e.redAdd(v),B=this.x.redAdd(this.y).redMul(n.x.redAdd(n.y)).redISub(u).redISub(l),E=a.redMul(b).redMul(B),S,O;return this.curve.twisted?(S=a.redMul(m).redMul(l.redSub(this.curve._mulA(u))),O=b.redMul(m)):(S=a.redMul(m).redMul(l.redSub(u)),O=this.curve._mulC(b).redMul(m)),this.curve.point(E,S,O)},h.prototype.add=function(n){return this.isInfinity()?n:n.isInfinity()?this:this.curve.extended?this._extAdd(n):this._projAdd(n)},h.prototype.mul=function(n){return this._hasDoubles(n)?this.curve._fixedNafMul(this,n):this.curve._wnafMul(this,n)},h.prototype.mulAdd=function(n,a,e){return this.curve._wnafMulAdd(1,[this,a],[n,e],2,!1)},h.prototype.jmulAdd=function(n,a,e){return this.curve._wnafMulAdd(1,[this,a],[n,e],2,!0)},h.prototype.normalize=function(){if(this.zOne)return this;var n=this.z.redInvm();return this.x=this.x.redMul(n),this.y=this.y.redMul(n),this.t&&(this.t=this.t.redMul(n)),this.z=this.curve.one,this.zOne=!0,this},h.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},h.prototype.getX=function(){return this.normalize(),this.x.fromRed()},h.prototype.getY=function(){return this.normalize(),this.y.fromRed()},h.prototype.eq=function(n){return this===n||this.getX().cmp(n.getX())===0&&this.getY().cmp(n.getY())===0},h.prototype.eqXToP=function(n){var a=n.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(a)===0)return!0;for(var e=n.clone(),u=this.curve.redN.redMul(this.z);;){if(e.iadd(this.curve.n),e.cmp(this.curve.p)>=0)return!1;if(a.redIAdd(u),this.x.cmp(a)===0)return!0}},h.prototype.toP=h.prototype.normalize,h.prototype.mixedAdd=h.prototype.add,edwards}var hasRequiredCurve;function requireCurve(){return hasRequiredCurve||(hasRequiredCurve=1,(function(s){var t=s;t.base=requireBase$1(),t.short=requireShort(),t.mont=requireMont(),t.edwards=requireEdwards()})(curve)),curve}var curves={},hash={},utils={},hasRequiredUtils$1;function requireUtils$1(){if(hasRequiredUtils$1)return utils;hasRequiredUtils$1=1;var s=requireMinimalisticAssert(),t=requireInherits_browser();utils.inherits=t;function f(y,g){return(y.charCodeAt(g)&64512)!==55296||g<0||g+1>=y.length?!1:(y.charCodeAt(g+1)&64512)===56320}function o(y,g){if(Array.isArray(y))return y.slice();if(!y)return[];var p=[];if(typeof y=="string")if(g){if(g==="hex")for(y=y.replace(/[^a-z0-9]+/ig,""),y.length%2!==0&&(y="0"+y),R=0;R<y.length;R+=2)p.push(parseInt(y[R]+y[R+1],16))}else for(var _=0,R=0;R<y.length;R++){var q=y.charCodeAt(R);q<128?p[_++]=q:q<2048?(p[_++]=q>>6|192,p[_++]=q&63|128):f(y,R)?(q=65536+((q&1023)<<10)+(y.charCodeAt(++R)&1023),p[_++]=q>>18|240,p[_++]=q>>12&63|128,p[_++]=q>>6&63|128,p[_++]=q&63|128):(p[_++]=q>>12|224,p[_++]=q>>6&63|128,p[_++]=q&63|128)}else for(R=0;R<y.length;R++)p[R]=y[R]|0;return p}utils.toArray=o;function d(y){for(var g="",p=0;p<y.length;p++)g+=c(y[p].toString(16));return g}utils.toHex=d;function r(y){var g=y>>>24|y>>>8&65280|y<<8&16711680|(y&255)<<24;return g>>>0}utils.htonl=r;function h(y,g){for(var p="",_=0;_<y.length;_++){var R=y[_];g==="little"&&(R=r(R)),p+=n(R.toString(16))}return p}utils.toHex32=h;function c(y){return y.length===1?"0"+y:y}utils.zero2=c;function n(y){return y.length===7?"0"+y:y.length===6?"00"+y:y.length===5?"000"+y:y.length===4?"0000"+y:y.length===3?"00000"+y:y.length===2?"000000"+y:y.length===1?"0000000"+y:y}utils.zero8=n;function a(y,g,p,_){var R=p-g;s(R%4===0);for(var q=new Array(R/4),T=0,A=g;T<q.length;T++,A+=4){var w;_==="big"?w=y[A]<<24|y[A+1]<<16|y[A+2]<<8|y[A+3]:w=y[A+3]<<24|y[A+2]<<16|y[A+1]<<8|y[A],q[T]=w>>>0}return q}utils.join32=a;function e(y,g){for(var p=new Array(y.length*4),_=0,R=0;_<y.length;_++,R+=4){var q=y[_];g==="big"?(p[R]=q>>>24,p[R+1]=q>>>16&255,p[R+2]=q>>>8&255,p[R+3]=q&255):(p[R+3]=q>>>24,p[R+2]=q>>>16&255,p[R+1]=q>>>8&255,p[R]=q&255)}return p}utils.split32=e;function u(y,g){return y>>>g|y<<32-g}utils.rotr32=u;function l(y,g){return y<<g|y>>>32-g}utils.rotl32=l;function v(y,g){return y+g>>>0}utils.sum32=v;function b(y,g,p){return y+g+p>>>0}utils.sum32_3=b;function m(y,g,p,_){return y+g+p+_>>>0}utils.sum32_4=m;function B(y,g,p,_,R){return y+g+p+_+R>>>0}utils.sum32_5=B;function E(y,g,p,_){var R=y[g],q=y[g+1],T=_+q>>>0,A=(T<_?1:0)+p+R;y[g]=A>>>0,y[g+1]=T}utils.sum64=E;function S(y,g,p,_){var R=g+_>>>0,q=(R<g?1:0)+y+p;return q>>>0}utils.sum64_hi=S;function O(y,g,p,_){var R=g+_;return R>>>0}utils.sum64_lo=O;function D(y,g,p,_,R,q,T,A){var w=0,M=g;M=M+_>>>0,w+=M<g?1:0,M=M+q>>>0,w+=M<q?1:0,M=M+A>>>0,w+=M<A?1:0;var x=y+p+R+T+w;return x>>>0}utils.sum64_4_hi=D;function $(y,g,p,_,R,q,T,A){var w=g+_+q+A;return w>>>0}utils.sum64_4_lo=$;function H(y,g,p,_,R,q,T,A,w,M){var x=0,L=g;L=L+_>>>0,x+=L<g?1:0,L=L+q>>>0,x+=L<q?1:0,L=L+A>>>0,x+=L<A?1:0,L=L+M>>>0,x+=L<M?1:0;var K=y+p+R+T+w+x;return K>>>0}utils.sum64_5_hi=H;function Y(y,g,p,_,R,q,T,A,w,M){var x=g+_+q+A+M;return x>>>0}utils.sum64_5_lo=Y;function ie(y,g,p){var _=g<<32-p|y>>>p;return _>>>0}utils.rotr64_hi=ie;function ne(y,g,p){var _=y<<32-p|g>>>p;return _>>>0}utils.rotr64_lo=ne;function de(y,g,p){return y>>>p}utils.shr64_hi=de;function X(y,g,p){var _=y<<32-p|g>>>p;return _>>>0}return utils.shr64_lo=X,utils}var common$1={},hasRequiredCommon$1;function requireCommon$1(){if(hasRequiredCommon$1)return common$1;hasRequiredCommon$1=1;var s=requireUtils$1(),t=requireMinimalisticAssert();function f(){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}return common$1.BlockHash=f,f.prototype.update=function(d,r){if(d=s.toArray(d,r),this.pending?this.pending=this.pending.concat(d):this.pending=d,this.pendingTotal+=d.length,this.pending.length>=this._delta8){d=this.pending;var h=d.length%this._delta8;this.pending=d.slice(d.length-h,d.length),this.pending.length===0&&(this.pending=null),d=s.join32(d,0,d.length-h,this.endian);for(var c=0;c<d.length;c+=this._delta32)this._update(d,c,c+this._delta32)}return this},f.prototype.digest=function(d){return this.update(this._pad()),t(this.pending===null),this._digest(d)},f.prototype._pad=function(){var d=this.pendingTotal,r=this._delta8,h=r-(d+this.padLength)%r,c=new Array(h+this.padLength);c[0]=128;for(var n=1;n<h;n++)c[n]=0;if(d<<=3,this.endian==="big"){for(var a=8;a<this.padLength;a++)c[n++]=0;c[n++]=0,c[n++]=0,c[n++]=0,c[n++]=0,c[n++]=d>>>24&255,c[n++]=d>>>16&255,c[n++]=d>>>8&255,c[n++]=d&255}else for(c[n++]=d&255,c[n++]=d>>>8&255,c[n++]=d>>>16&255,c[n++]=d>>>24&255,c[n++]=0,c[n++]=0,c[n++]=0,c[n++]=0,a=8;a<this.padLength;a++)c[n++]=0;return c},common$1}var sha={},common={},hasRequiredCommon;function requireCommon(){if(hasRequiredCommon)return common;hasRequiredCommon=1;var s=requireUtils$1(),t=s.rotr32;function f(e,u,l,v){if(e===0)return o(u,l,v);if(e===1||e===3)return r(u,l,v);if(e===2)return d(u,l,v)}common.ft_1=f;function o(e,u,l){return e&u^~e&l}common.ch32=o;function d(e,u,l){return e&u^e&l^u&l}common.maj32=d;function r(e,u,l){return e^u^l}common.p32=r;function h(e){return t(e,2)^t(e,13)^t(e,22)}common.s0_256=h;function c(e){return t(e,6)^t(e,11)^t(e,25)}common.s1_256=c;function n(e){return t(e,7)^t(e,18)^e>>>3}common.g0_256=n;function a(e){return t(e,17)^t(e,19)^e>>>10}return common.g1_256=a,common}var _1,hasRequired_1;function require_1(){if(hasRequired_1)return _1;hasRequired_1=1;var s=requireUtils$1(),t=requireCommon$1(),f=requireCommon(),o=s.rotl32,d=s.sum32,r=s.sum32_5,h=f.ft_1,c=t.BlockHash,n=[1518500249,1859775393,2400959708,3395469782];function a(){if(!(this instanceof a))return new a;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}return s.inherits(a,c),_1=a,a.blockSize=512,a.outSize=160,a.hmacStrength=80,a.padLength=64,a.prototype._update=function(u,l){for(var v=this.W,b=0;b<16;b++)v[b]=u[l+b];for(;b<v.length;b++)v[b]=o(v[b-3]^v[b-8]^v[b-14]^v[b-16],1);var m=this.h[0],B=this.h[1],E=this.h[2],S=this.h[3],O=this.h[4];for(b=0;b<v.length;b++){var D=~~(b/20),$=r(o(m,5),h(D,B,E,S),O,v[b],n[D]);O=S,S=E,E=o(B,30),B=m,m=$}this.h[0]=d(this.h[0],m),this.h[1]=d(this.h[1],B),this.h[2]=d(this.h[2],E),this.h[3]=d(this.h[3],S),this.h[4]=d(this.h[4],O)},a.prototype._digest=function(u){return u==="hex"?s.toHex32(this.h,"big"):s.split32(this.h,"big")},_1}var _256,hasRequired_256;function require_256(){if(hasRequired_256)return _256;hasRequired_256=1;var s=requireUtils$1(),t=requireCommon$1(),f=requireCommon(),o=requireMinimalisticAssert(),d=s.sum32,r=s.sum32_4,h=s.sum32_5,c=f.ch32,n=f.maj32,a=f.s0_256,e=f.s1_256,u=f.g0_256,l=f.g1_256,v=t.BlockHash,b=[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 m(){if(!(this instanceof m))return new m;v.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=b,this.W=new Array(64)}return s.inherits(m,v),_256=m,m.blockSize=512,m.outSize=256,m.hmacStrength=192,m.padLength=64,m.prototype._update=function(E,S){for(var O=this.W,D=0;D<16;D++)O[D]=E[S+D];for(;D<O.length;D++)O[D]=r(l(O[D-2]),O[D-7],u(O[D-15]),O[D-16]);var $=this.h[0],H=this.h[1],Y=this.h[2],ie=this.h[3],ne=this.h[4],de=this.h[5],X=this.h[6],y=this.h[7];for(o(this.k.length===O.length),D=0;D<O.length;D++){var g=h(y,e(ne),c(ne,de,X),this.k[D],O[D]),p=d(a($),n($,H,Y));y=X,X=de,de=ne,ne=d(ie,g),ie=Y,Y=H,H=$,$=d(g,p)}this.h[0]=d(this.h[0],$),this.h[1]=d(this.h[1],H),this.h[2]=d(this.h[2],Y),this.h[3]=d(this.h[3],ie),this.h[4]=d(this.h[4],ne),this.h[5]=d(this.h[5],de),this.h[6]=d(this.h[6],X),this.h[7]=d(this.h[7],y)},m.prototype._digest=function(E){return E==="hex"?s.toHex32(this.h,"big"):s.split32(this.h,"big")},_256}var _224,hasRequired_224;function require_224(){if(hasRequired_224)return _224;hasRequired_224=1;var s=requireUtils$1(),t=require_256();function f(){if(!(this instanceof f))return new f;t.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}return s.inherits(f,t),_224=f,f.blockSize=512,f.outSize=224,f.hmacStrength=192,f.padLength=64,f.prototype._digest=function(d){return d==="hex"?s.toHex32(this.h.slice(0,7),"big"):s.split32(this.h.slice(0,7),"big")},_224}var _512,hasRequired_512;function require_512(){if(hasRequired_512)return _512;hasRequired_512=1;var s=requireUtils$1(),t=requireCommon$1(),f=requireMinimalisticAssert(),o=s.rotr64_hi,d=s.rotr64_lo,r=s.shr64_hi,h=s.shr64_lo,c=s.sum64,n=s.sum64_hi,a=s.sum64_lo,e=s.sum64_4_hi,u=s.sum64_4_lo,l=s.sum64_5_hi,v=s.sum64_5_lo,b=t.BlockHash,m=[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;b.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=m,this.W=new Array(160)}s.inherits(B,b),_512=B,B.blockSize=1024,B.outSize=512,B.hmacStrength=192,B.padLength=128,B.prototype._prepareBlock=function(p,_){for(var R=this.W,q=0;q<32;q++)R[q]=p[_+q];for(;q<R.length;q+=2){var T=X(R[q-4],R[q-3]),A=y(R[q-4],R[q-3]),w=R[q-14],M=R[q-13],x=ne(R[q-30],R[q-29]),L=de(R[q-30],R[q-29]),K=R[q-32],Q=R[q-31];R[q]=e(T,A,w,M,x,L,K,Q),R[q+1]=u(T,A,w,M,x,L,K,Q)}},B.prototype._update=function(p,_){this._prepareBlock(p,_);var R=this.W,q=this.h[0],T=this.h[1],A=this.h[2],w=this.h[3],M=this.h[4],x=this.h[5],L=this.h[6],K=this.h[7],Q=this.h[8],j=this.h[9],N=this.h[10],F=this.h[11],ee=this.h[12],ae=this.h[13],G=this.h[14],z=this.h[15];f(this.k.length===R.length);for(var fe=0;fe<R.length;fe+=2){var me=G,xe=z,_e=Y(Q,j),qe=ie(Q,j),Re=E(Q,j,N,F,ee),be=S(Q,j,N,F,ee,ae),Fe=this.k[fe],Be=this.k[fe+1],Me=R[fe],Pe=R[fe+1],oe=l(me,xe,_e,qe,Re,be,Fe,Be,Me,Pe),ce=v(me,xe,_e,qe,Re,be,Fe,Be,Me,Pe);me=$(q,T),xe=H(q,T),_e=O(q,T,A,w,M),qe=D(q,T,A,w,M,x);var ge=n(me,xe,_e,qe),we=a(me,xe,_e,qe);G=ee,z=ae,ee=N,ae=F,N=Q,F=j,Q=n(L,K,oe,ce),j=a(K,K,oe,ce),L=M,K=x,M=A,x=w,A=q,w=T,q=n(oe,ce,ge,we),T=a(oe,ce,ge,we)}c(this.h,0,q,T),c(this.h,2,A,w),c(this.h,4,M,x),c(this.h,6,L,K),c(this.h,8,Q,j),c(this.h,10,N,F),c(this.h,12,ee,ae),c(this.h,14,G,z)},B.prototype._digest=function(p){return p==="hex"?s.toHex32(this.h,"big"):s.split32(this.h,"big")};function E(g,p,_,R,q){var T=g&_^~g&q;return T<0&&(T+=4294967296),T}function S(g,p,_,R,q,T){var A=p&R^~p&T;return A<0&&(A+=4294967296),A}function O(g,p,_,R,q){var T=g&_^g&q^_&q;return T<0&&(T+=4294967296),T}function D(g,p,_,R,q,T){var A=p&R^p&T^R&T;return A<0&&(A+=4294967296),A}function $(g,p){var _=o(g,p,28),R=o(p,g,2),q=o(p,g,7),T=_^R^q;return T<0&&(T+=4294967296),T}function H(g,p){var _=d(g,p,28),R=d(p,g,2),q=d(p,g,7),T=_^R^q;return T<0&&(T+=4294967296),T}function Y(g,p){var _=o(g,p,14),R=o(g,p,18),q=o(p,g,9),T=_^R^q;return T<0&&(T+=4294967296),T}function ie(g,p){var _=d(g,p,14),R=d(g,p,18),q=d(p,g,9),T=_^R^q;return T<0&&(T+=4294967296),T}function ne(g,p){var _=o(g,p,1),R=o(g,p,8),q=r(g,p,7),T=_^R^q;return T<0&&(T+=4294967296),T}function de(g,p){var _=d(g,p,1),R=d(g,p,8),q=h(g,p,7),T=_^R^q;return T<0&&(T+=4294967296),T}function X(g,p){var _=o(g,p,19),R=o(p,g,29),q=r(g,p,6),T=_^R^q;return T<0&&(T+=4294967296),T}function y(g,p){var _=d(g,p,19),R=d(p,g,29),q=h(g,p,6),T=_^R^q;return T<0&&(T+=4294967296),T}return _512}var _384,hasRequired_384;function require_384(){if(hasRequired_384)return _384;hasRequired_384=1;var s=requireUtils$1(),t=require_512();function f(){if(!(this instanceof f))return new f;t.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}return s.inherits(f,t),_384=f,f.blockSize=1024,f.outSize=384,f.hmacStrength=192,f.padLength=128,f.prototype._digest=function(d){return d==="hex"?s.toHex32(this.h.slice(0,12),"big"):s.split32(this.h.slice(0,12),"big")},_384}var hasRequiredSha;function requireSha(){return hasRequiredSha||(hasRequiredSha=1,sha.sha1=require_1(),sha.sha224=require_224(),sha.sha256=require_256(),sha.sha384=require_384(),sha.sha512=require_512()),sha}var ripemd={},hasRequiredRipemd;function requireRipemd(){if(hasRequiredRipemd)return ripemd;hasRequiredRipemd=1;var s=requireUtils$1(),t=requireCommon$1(),f=s.rotl32,o=s.sum32,d=s.sum32_3,r=s.sum32_4,h=t.BlockHash;function c(){if(!(this instanceof c))return new c;h.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}s.inherits(c,h),ripemd.ripemd160=c,c.blockSize=512,c.outSize=160,c.hmacStrength=192,c.padLength=64,c.prototype._update=function(B,E){for(var S=this.h[0],O=this.h[1],D=this.h[2],$=this.h[3],H=this.h[4],Y=S,ie=O,ne=D,de=$,X=H,y=0;y<80;y++){var g=o(f(r(S,n(y,O,D,$),B[u[y]+E],a(y)),v[y]),H);S=H,H=$,$=f(D,10),D=O,O=g,g=o(f(r(Y,n(79-y,ie,ne,de),B[l[y]+E],e(y)),b[y]),X),Y=X,X=de,de=f(ne,10),ne=ie,ie=g}g=d(this.h[1],D,de),this.h[1]=d(this.h[2],$,X),this.h[2]=d(this.h[3],H,Y),this.h[3]=d(this.h[4],S,ie),this.h[4]=d(this.h[0],O,ne),this.h[0]=g},c.prototype._digest=function(B){return B==="hex"?s.toHex32(this.h,"little"):s.split32(this.h,"little")};function n(m,B,E,S){return m<=15?B^E^S:m<=31?B&E|~B&S:m<=47?(B|~E)^S:m<=63?B&S|E&~S:B^(E|~S)}function a(m){return m<=15?0:m<=31?1518500249:m<=47?1859775393:m<=63?2400959708:2840853838}function e(m){return m<=15?1352829926:m<=31?1548603684:m<=47?1836072691:m<=63?2053994217:0}var u=[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],l=[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],b=[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];return ripemd}var hmac,hasRequiredHmac;function requireHmac(){if(hasRequiredHmac)return hmac;hasRequiredHmac=1;var s=requireUtils$1(),t=requireMinimalisticAssert();function f(o,d,r){if(!(this instanceof f))return new f(o,d,r);this.Hash=o,this.blockSize=o.blockSize/8,this.outSize=o.outSize/8,this.inner=null,this.outer=null,this._init(s.toArray(d,r))}return hmac=f,f.prototype._init=function(d){d.length>this.blockSize&&(d=new this.Hash().update(d).digest()),t(d.length<=this.blockSize);for(var r=d.length;r<this.blockSize;r++)d.push(0);for(r=0;r<d.length;r++)d[r]^=54;for(this.inner=new this.Hash().update(d),r=0;r<d.length;r++)d[r]^=106;this.outer=new this.Hash().update(d)},f.prototype.update=function(d,r){return this.inner.update(d,r),this},f.prototype.digest=function(d){return this.outer.update(this.inner.digest()),this.outer.digest(d)},hmac}var hasRequiredHash;function requireHash(){return hasRequiredHash||(hasRequiredHash=1,(function(s){var t=s;t.utils=requireUtils$1(),t.common=requireCommon$1(),t.sha=requireSha(),t.ripemd=requireRipemd(),t.hmac=requireHmac(),t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160})(hash)),hash}var secp256k1,hasRequiredSecp256k1;function requireSecp256k1(){return hasRequiredSecp256k1||(hasRequiredSecp256k1=1,secp256k1={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"]]}}),secp256k1}var hasRequiredCurves;function requireCurves(){return hasRequiredCurves||(hasRequiredCurves=1,(function(s){var t=s,f=requireHash(),o=requireCurve(),d=requireUtils$2(),r=d.assert;function h(a){a.type==="short"?this.curve=new o.short(a):a.type==="edwards"?this.curve=new o.edwards(a):this.curve=new o.mont(a),this.g=this.curve.g,this.n=this.curve.n,this.hash=a.hash,r(this.g.validate(),"Invalid curve"),r(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}t.PresetCurve=h;function c(a,e){Object.defineProperty(t,a,{configurable:!0,enumerable:!0,get:function(){var u=new h(e);return Object.defineProperty(t,a,{configurable:!0,enumerable:!0,value:u}),u}})}c("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:f.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),c("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:f.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),c("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:f.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),c("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:f.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"]}),c("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:f.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"]}),c("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:f.sha256,gRed:!1,g:["9"]}),c("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:f.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var n;try{n=requireSecp256k1()}catch{n=void 0}c("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:f.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})})(curves)),curves}var hmacDrbg,hasRequiredHmacDrbg;function requireHmacDrbg(){if(hasRequiredHmacDrbg)return hmacDrbg;hasRequiredHmacDrbg=1;var s=requireHash(),t=requireUtils$3(),f=requireMinimalisticAssert();function o(d){if(!(this instanceof o))return new o(d);this.hash=d.hash,this.predResist=!!d.predResist,this.outLen=this.hash.outSize,this.minEntropy=d.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var r=t.toArray(d.entropy,d.entropyEnc||"hex"),h=t.toArray(d.nonce,d.nonceEnc||"hex"),c=t.toArray(d.pers,d.persEnc||"hex");f(r.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(r,h,c)}return hmacDrbg=o,o.prototype._init=function(r,h,c){var n=r.concat(h).concat(c);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var a=0;a<this.V.length;a++)this.K[a]=0,this.V[a]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},o.prototype._hmac=function(){return new s.hmac(this.hash,this.K)},o.prototype._update=function(r){var h=this._hmac().update(this.V).update([0]);r&&(h=h.update(r)),this.K=h.digest(),this.V=this._hmac().update(this.V).digest(),r&&(this.K=this._hmac().update(this.V).update([1]).update(r).digest(),this.V=this._hmac().update(this.V).digest())},o.prototype.reseed=function(r,h,c,n){typeof h!="string"&&(n=c,c=h,h=null),r=t.toArray(r,h),c=t.toArray(c,n),f(r.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(r.concat(c||[])),this._reseed=1},o.prototype.generate=function(r,h,c,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof h!="string"&&(n=c,c=h,h=null),c&&(c=t.toArray(c,n||"hex"),this._update(c));for(var a=[];a.length<r;)this.V=this._hmac().update(this.V).digest(),a=a.concat(this.V);var e=a.slice(0,r);return this._update(c),this._reseed++,t.encode(e,h)},hmacDrbg}var key$1,hasRequiredKey$1;function requireKey$1(){if(hasRequiredKey$1)return key$1;hasRequiredKey$1=1;var s=requireBn$1(),t=requireUtils$2(),f=t.assert;function o(d,r){this.ec=d,this.priv=null,this.pub=null,r.priv&&this._importPrivate(r.priv,r.privEnc),r.pub&&this._importPublic(r.pub,r.pubEnc)}return key$1=o,o.fromPublic=function(r,h,c){return h instanceof o?h:new o(r,{pub:h,pubEnc:c})},o.fromPrivate=function(r,h,c){return h instanceof o?h:new o(r,{priv:h,privEnc:c})},o.prototype.validate=function(){var r=this.getPublic();return r.isInfinity()?{result:!1,reason:"Invalid public key"}:r.validate()?r.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(r,h){return typeof r=="string"&&(h=r,r=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),h?this.pub.encode(h,r):this.pub},o.prototype.getPrivate=function(r){return r==="hex"?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(r,h){this.priv=new s(r,h||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(r,h){if(r.x||r.y){this.ec.curve.type==="mont"?f(r.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&f(r.x&&r.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(r.x,r.y);return}this.pub=this.ec.curve.decodePoint(r,h)},o.prototype.derive=function(r){return r.validate()||f(r.validate(),"public point not validated"),r.mul(this.priv).getX()},o.prototype.sign=function(r,h,c){return this.ec.sign(r,this,h,c)},o.prototype.verify=function(r,h,c){return this.ec.verify(r,h,this,void 0,c)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"},key$1}var signature$1,hasRequiredSignature$1;function requireSignature$1(){if(hasRequiredSignature$1)return signature$1;hasRequiredSignature$1=1;var s=requireBn$1(),t=requireUtils$2(),f=t.assert;function o(n,a){if(n instanceof o)return n;this._importDER(n,a)||(f(n.r&&n.s,"Signature without r or s"),this.r=new s(n.r,16),this.s=new s(n.s,16),n.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=n.recoveryParam)}signature$1=o;function d(){this.place=0}function r(n,a){var e=n[a.place++];if(!(e&128))return e;var u=e&15;if(u===0||u>4||n[a.place]===0)return!1;for(var l=0,v=0,b=a.place;v<u;v++,b++)l<<=8,l|=n[b],l>>>=0;return l<=127?!1:(a.place=b,l)}function h(n){for(var a=0,e=n.length-1;!n[a]&&!(n[a+1]&128)&&a<e;)a++;return a===0?n:n.slice(a)}o.prototype._importDER=function(a,e){a=t.toArray(a,e);var u=new d;if(a[u.place++]!==48)return!1;var l=r(a,u);if(l===!1||l+u.place!==a.length||a[u.place++]!==2)return!1;var v=r(a,u);if(v===!1||(a[u.place]&128)!==0)return!1;var b=a.slice(u.place,v+u.place);if(u.place+=v,a[u.place++]!==2)return!1;var m=r(a,u);if(m===!1||a.length!==m+u.place||(a[u.place]&128)!==0)return!1;var B=a.slice(u.place,m+u.place);if(b[0]===0)if(b[1]&128)b=b.slice(1);else return!1;if(B[0]===0)if(B[1]&128)B=B.slice(1);else return!1;return this.r=new s(b),this.s=new s(B),this.recoveryParam=null,!0};function c(n,a){if(a<128){n.push(a);return}var e=1+(Math.log(a)/Math.LN2>>>3);for(n.push(e|128);--e;)n.push(a>>>(e<<3)&255);n.push(a)}return o.prototype.toDER=function(a){var e=this.r.toArray(),u=this.s.toArray();for(e[0]&128&&(e=[0].concat(e)),u[0]&128&&(u=[0].concat(u)),e=h(e),u=h(u);!u[0]&&!(u[1]&128);)u=u.slice(1);var l=[2];c(l,e.length),l=l.concat(e),l.push(2),c(l,u.length);var v=l.concat(u),b=[48];return c(b,v.length),b=b.concat(v),t.encode(b,a)},signature$1}var ec,hasRequiredEc;function requireEc(){if(hasRequiredEc)return ec;hasRequiredEc=1;var s=requireBn$1(),t=requireHmacDrbg(),f=requireUtils$2(),o=requireCurves(),d=requireBrorand(),r=f.assert,h=requireKey$1(),c=requireSignature$1();function n(a){if(!(this instanceof n))return new n(a);typeof a=="string"&&(r(Object.prototype.hasOwnProperty.call(o,a),"Unknown curve "+a),a=o[a]),a instanceof o.PresetCurve&&(a={curve:a}),this.curve=a.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=a.curve.g,this.g.precompute(a.curve.n.bitLength()+1),this.hash=a.hash||a.curve.hash}return ec=n,n.prototype.keyPair=function(e){return new h(this,e)},n.prototype.keyFromPrivate=function(e,u){return h.fromPrivate(this,e,u)},n.prototype.keyFromPublic=function(e,u){return h.fromPublic(this,e,u)},n.prototype.genKeyPair=function(e){e||(e={});for(var u=new t({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||d(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),l=this.n.byteLength(),v=this.n.sub(new s(2));;){var b=new s(u.generate(l));if(!(b.cmp(v)>0))return b.iaddn(1),this.keyFromPrivate(b)}},n.prototype._truncateToN=function(e,u,l){var v;if(s.isBN(e)||typeof e=="number")e=new s(e,16),v=e.byteLength();else if(typeof e=="object")v=e.length,e=new s(e,16);else{var b=e.toString();v=b.length+1>>>1,e=new s(b,16)}typeof l!="number"&&(l=v*8);var m=l-this.n.bitLength();return m>0&&(e=e.ushrn(m)),!u&&e.cmp(this.n)>=0?e.sub(this.n):e},n.prototype.sign=function(e,u,l,v){if(typeof l=="object"&&(v=l,l=null),v||(v={}),typeof e!="string"&&typeof e!="number"&&!s.isBN(e)){r(typeof e=="object"&&e&&typeof e.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),r(e.length>>>0===e.length);for(var b=0;b<e.length;b++)r((e[b]&255)===e[b])}u=this.keyFromPrivate(u,l),e=this._truncateToN(e,!1,v.msgBitLength),r(!e.isNeg(),"Can not sign a negative message");var m=this.n.byteLength(),B=u.getPrivate().toArray("be",m),E=e.toArray("be",m);r(new s(E).eq(e),"Can not sign message");for(var S=new t({hash:this.hash,entropy:B,nonce:E,pers:v.pers,persEnc:v.persEnc||"utf8"}),O=this.n.sub(new s(1)),D=0;;D++){var $=v.k?v.k(D):new s(S.generate(this.n.byteLength()));if($=this._truncateToN($,!0),!($.cmpn(1)<=0||$.cmp(O)>=0)){var H=this.g.mul($);if(!H.isInfinity()){var Y=H.getX(),ie=Y.umod(this.n);if(ie.cmpn(0)!==0){var ne=$.invm(this.n).mul(ie.mul(u.getPrivate()).iadd(e));if(ne=ne.umod(this.n),ne.cmpn(0)!==0){var de=(H.getY().isOdd()?1:0)|(Y.cmp(ie)!==0?2:0);return v.canonical&&ne.cmp(this.nh)>0&&(ne=this.n.sub(ne),de^=1),new c({r:ie,s:ne,recoveryParam:de})}}}}}},n.prototype.verify=function(e,u,l,v,b){b||(b={}),e=this._truncateToN(e,!1,b.msgBitLength),l=this.keyFromPublic(l,v),u=new c(u,"hex");var m=u.r,B=u.s;if(m.cmpn(1)<0||m.cmp(this.n)>=0||B.cmpn(1)<0||B.cmp(this.n)>=0)return!1;var E=B.invm(this.n),S=E.mul(e).umod(this.n),O=E.mul(m).umod(this.n),D;return this.curve._maxwellTrick?(D=this.g.jmulAdd(S,l.getPublic(),O),D.isInfinity()?!1:D.eqXToP(m)):(D=this.g.mulAdd(S,l.getPublic(),O),D.isInfinity()?!1:D.getX().umod(this.n).cmp(m)===0)},n.prototype.recoverPubKey=function(a,e,u,l){r((3&u)===u,"The recovery param is more than two bits"),e=new c(e,l);var v=this.n,b=new s(a),m=e.r,B=e.s,E=u&1,S=u>>1;if(m.cmp(this.curve.p.umod(this.curve.n))>=0&&S)throw new Error("Unable to find sencond key candinate");S?m=this.curve.pointFromX(m.add(this.curve.n),E):m=this.curve.pointFromX(m,E);var O=e.r.invm(v),D=v.sub(b).mul(O).umod(v),$=B.mul(O).umod(v);return this.g.mulAdd(D,m,$)},n.prototype.getKeyRecoveryParam=function(a,e,u,l){if(e=new c(e,l),e.recoveryParam!==null)return e.recoveryParam;for(var v=0;v<4;v++){var b;try{b=this.recoverPubKey(a,e,v)}catch{continue}if(b.eq(u))return v}throw new Error("Unable to find valid recovery factor")},ec}var key,hasRequiredKey;function requireKey(){if(hasRequiredKey)return key;hasRequiredKey=1;var s=requireUtils$2(),t=s.assert,f=s.parseBytes,o=s.cachedProperty;function d(r,h){this.eddsa=r,this._secret=f(h.secret),r.isPoint(h.pub)?this._pub=h.pub:this._pubBytes=f(h.pub)}return d.fromPublic=function(h,c){return c instanceof d?c:new d(h,{pub:c})},d.fromSecret=function(h,c){return c instanceof d?c:new d(h,{secret:c})},d.prototype.secret=function(){return this._secret},o(d,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),o(d,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),o(d,"privBytes",function(){var h=this.eddsa,c=this.hash(),n=h.encodingLength-1,a=c.slice(0,h.encodingLength);return a[0]&=248,a[n]&=127,a[n]|=64,a}),o(d,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),o(d,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),o(d,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),d.prototype.sign=function(h){return t(this._secret,"KeyPair can only verify"),this.eddsa.sign(h,this)},d.prototype.verify=function(h,c){return this.eddsa.verify(h,c,this)},d.prototype.getSecret=function(h){return t(this._secret,"KeyPair is public only"),s.encode(this.secret(),h)},d.prototype.getPublic=function(h){return s.encode(this.pubBytes(),h)},key=d,key}var signature,hasRequiredSignature;function requireSignature(){if(hasRequiredSignature)return signature;hasRequiredSignature=1;var s=requireBn$1(),t=requireUtils$2(),f=t.assert,o=t.cachedProperty,d=t.parseBytes;function r(h,c){this.eddsa=h,typeof c!="object"&&(c=d(c)),Array.isArray(c)&&(f(c.length===h.encodingLength*2,"Signature has invalid size"),c={R:c.slice(0,h.encodingLength),S:c.slice(h.encodingLength)}),f(c.R&&c.S,"Signature without R or S"),h.isPoint(c.R)&&(this._R=c.R),c.S instanceof s&&(this._S=c.S),this._Rencoded=Array.isArray(c.R)?c.R:c.Rencoded,this._Sencoded=Array.isArray(c.S)?c.S:c.Sencoded}return o(r,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),o(r,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),o(r,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),o(r,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),r.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},r.prototype.toHex=function(){return t.encode(this.toBytes(),"hex").toUpperCase()},signature=r,signature}var eddsa,hasRequiredEddsa;function requireEddsa(){if(hasRequiredEddsa)return eddsa;hasRequiredEddsa=1;var s=requireHash(),t=requireCurves(),f=requireUtils$2(),o=f.assert,d=f.parseBytes,r=requireKey(),h=requireSignature();function c(n){if(o(n==="ed25519","only tested with ed25519 so far"),!(this instanceof c))return new c(n);n=t[n].curve,this.curve=n,this.g=n.g,this.g.precompute(n.n.bitLength()+1),this.pointClass=n.point().constructor,this.encodingLength=Math.ceil(n.n.bitLength()/8),this.hash=s.sha512}return eddsa=c,c.prototype.sign=function(a,e){a=d(a);var u=this.keyFromSecret(e),l=this.hashInt(u.messagePrefix(),a),v=this.g.mul(l),b=this.encodePoint(v),m=this.hashInt(b,u.pubBytes(),a).mul(u.priv()),B=l.add(m).umod(this.curve.n);return this.makeSignature({R:v,S:B,Rencoded:b})},c.prototype.verify=function(a,e,u){if(a=d(a),e=this.makeSignature(e),e.S().gte(e.eddsa.curve.n)||e.S().isNeg())return!1;var l=this.keyFromPublic(u),v=this.hashInt(e.Rencoded(),l.pubBytes(),a),b=this.g.mul(e.S()),m=e.R().add(l.pub().mul(v));return m.eq(b)},c.prototype.hashInt=function(){for(var a=this.hash(),e=0;e<arguments.length;e++)a.update(arguments[e]);return f.intFromLE(a.digest()).umod(this.curve.n)},c.prototype.keyFromPublic=function(a){return r.fromPublic(this,a)},c.prototype.keyFromSecret=function(a){return r.fromSecret(this,a)},c.prototype.makeSignature=function(a){return a instanceof h?a:new h(this,a)},c.prototype.encodePoint=function(a){var e=a.getY().toArray("le",this.encodingLength);return e[this.encodingLength-1]|=a.getX().isOdd()?128:0,e},c.prototype.decodePoint=function(a){a=f.parseBytes(a);var e=a.length-1,u=a.slice(0,e).concat(a[e]&-129),l=(a[e]&128)!==0,v=f.intFromLE(u);return this.curve.pointFromY(v,l)},c.prototype.encodeInt=function(a){return a.toArray("le",this.encodingLength)},c.prototype.decodeInt=function(a){return f.intFromLE(a)},c.prototype.isPoint=function(a){return a instanceof this.pointClass},eddsa}var hasRequiredElliptic;function requireElliptic(){return hasRequiredElliptic||(hasRequiredElliptic=1,(function(s){var t=s;t.version=require$$0.version,t.utils=requireUtils$2(),t.rand=requireBrorand(),t.curve=requireCurve(),t.curves=requireCurves(),t.ec=requireEc(),t.eddsa=requireEddsa()})(elliptic)),elliptic}var asn1$1={},asn1={},api={},vmBrowserify={},hasRequiredVmBrowserify;function requireVmBrowserify(){return hasRequiredVmBrowserify||(hasRequiredVmBrowserify=1,(function(exports$1){var indexOf=function(s,t){if(s.indexOf)return s.indexOf(t);for(var f=0;f<s.length;f++)if(s[f]===t)return f;return-1},Object_keys=function(s){if(Object.keys)return Object.keys(s);var t=[];for(var f in s)t.push(f);return t},forEach=function(s,t){if(s.forEach)return s.forEach(t);for(var f=0;f<s.length;f++)t(s[f],f,s)},defineProp=(function(){try{return Object.defineProperty({},"_",{}),function(s,t,f){Object.defineProperty(s,t,{writable:!0,enumerable:!1,configurable:!0,value:f})}}catch{return function(t,f,o){t[f]=o}}})(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports$1.Script=function(t){if(!(this instanceof Script))return new Script(t);this.code=t};Script.prototype.runInContext=function(s){if(!(s instanceof Context))throw new TypeError("needs a 'context' argument.");var t=document.createElement("iframe");t.style||(t.style={}),t.style.display="none",document.body.appendChild(t);var f=t.contentWindow,o=f.eval,d=f.execScript;!o&&d&&(d.call(f,"null"),o=f.eval),forEach(Object_keys(s),function(c){f[c]=s[c]}),forEach(globals,function(c){s[c]&&(f[c]=s[c])});var r=Object_keys(f),h=o.call(f,this.code);return forEach(Object_keys(f),function(c){(c in s||indexOf(r,c)===-1)&&(s[c]=f[c])}),forEach(globals,function(c){c in s||defineProp(s,c,f[c])}),document.body.removeChild(t),h},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(s){var t=Script.createContext(s),f=this.runInContext(t);return s&&forEach(Object_keys(t),function(o){s[o]=t[o]}),f},forEach(Object_keys(Script.prototype),function(s){exports$1[s]=Script[s]=function(t){var f=Script(t);return f[s].apply(f,[].slice.call(arguments,1))}}),exports$1.isContext=function(s){return s instanceof Context},exports$1.createScript=function(s){return exports$1.Script(s)},exports$1.createContext=Script.createContext=function(s){var t=new Context;return typeof s=="object"&&forEach(Object_keys(s),function(f){t[f]=s[f]}),t}})(vmBrowserify)),vmBrowserify}var hasRequiredApi;function requireApi(){return hasRequiredApi||(hasRequiredApi=1,(function(s){var t=requireAsn1$1(),f=requireInherits_browser(),o=s;o.define=function(h,c){return new d(h,c)};function d(r,h){this.name=r,this.body=h,this.decoders={},this.encoders={}}d.prototype._createNamed=function(h){var c;try{c=requireVmBrowserify().runInThisContext("(function "+this.name+`(entity) {
|
|
12
12
|
this._initNamed(entity);
|
|
13
|
-
})`)}catch{f=function(n){this._initNamed(n)}}return u(f,h),f.prototype._initNamed=function(n){h.call(this,n)},new f(this)},d.prototype._getDecoder=function(h){return h=h||"der",this.decoders.hasOwnProperty(h)||(this.decoders[h]=this._createNamed(t.decoders[h])),this.decoders[h]},d.prototype.decode=function(h,f,a){return this._getDecoder(f).decode(h,a)},d.prototype._getEncoder=function(h){return h=h||"der",this.encoders.hasOwnProperty(h)||(this.encoders[h]=this._createNamed(t.encoders[h])),this.encoders[h]},d.prototype.encode=function(h,f,a){return this._getEncoder(f).encode(h,a)}})(api)),api}var base={},reporter={},hasRequiredReporter;function requireReporter(){if(hasRequiredReporter)return reporter;hasRequiredReporter=1;var c=requireInherits_browser();function t(o){this._reporterState={obj:null,path:[],options:o||{},errors:[]}}reporter.Reporter=t,t.prototype.isError=function(d){return d instanceof u},t.prototype.save=function(){var d=this._reporterState;return{obj:d.obj,pathLen:d.path.length}},t.prototype.restore=function(d){var r=this._reporterState;r.obj=d.obj,r.path=r.path.slice(0,d.pathLen)},t.prototype.enterKey=function(d){return this._reporterState.path.push(d)},t.prototype.exitKey=function(d){var r=this._reporterState;r.path=r.path.slice(0,d-1)},t.prototype.leaveKey=function(d,r,h){var f=this._reporterState;this.exitKey(d),f.obj!==null&&(f.obj[r]=h)},t.prototype.path=function(){return this._reporterState.path.join("/")},t.prototype.enterObject=function(){var d=this._reporterState,r=d.obj;return d.obj={},r},t.prototype.leaveObject=function(d){var r=this._reporterState,h=r.obj;return r.obj=d,h},t.prototype.error=function(d){var r,h=this._reporterState,f=d instanceof u;if(f?r=d:r=new u(h.path.map(function(a){return"["+JSON.stringify(a)+"]"}).join(""),d.message||d,d.stack),!h.options.partial)throw r;return f||h.errors.push(r),r},t.prototype.wrapResult=function(d){var r=this._reporterState;return r.options.partial?{result:this.isError(d)?null:d,errors:r.errors}:d};function u(o,d){this.path=o,this.rethrow(d)}return c(u,Error),u.prototype.rethrow=function(d){if(this.message=d+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,u),!this.stack)try{throw new Error(this.message)}catch(r){this.stack=r.stack}return this},reporter}var buffer={},hasRequiredBuffer;function requireBuffer(){if(hasRequiredBuffer)return buffer;hasRequiredBuffer=1;var c=requireInherits_browser(),t=requireBase().Reporter,u=requireDist().Buffer;function o(r,h){if(t.call(this,h),!u.isBuffer(r)){this.error("Input not Buffer");return}this.base=r,this.offset=0,this.length=r.length}c(o,t),buffer.DecoderBuffer=o,o.prototype.save=function(){return{offset:this.offset,reporter:t.prototype.save.call(this)}},o.prototype.restore=function(h){var f=new o(this.base);return f.offset=h.offset,f.length=this.offset,this.offset=h.offset,t.prototype.restore.call(this,h.reporter),f},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(h){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(h||"DecoderBuffer overrun")},o.prototype.skip=function(h,f){if(!(this.offset+h<=this.length))return this.error(f||"DecoderBuffer overrun");var a=new o(this.base);return a._reporterState=this._reporterState,a.offset=this.offset,a.length=this.offset+h,this.offset+=h,a},o.prototype.raw=function(h){return this.base.slice(h?h.offset:this.offset,this.length)};function d(r,h){if(Array.isArray(r))this.length=0,this.value=r.map(function(f){return f instanceof d||(f=new d(f,h)),this.length+=f.length,f},this);else if(typeof r=="number"){if(!(0<=r&&r<=255))return h.error("non-byte EncoderBuffer value");this.value=r,this.length=1}else if(typeof r=="string")this.value=r,this.length=u.byteLength(r);else if(u.isBuffer(r))this.value=r,this.length=r.length;else return h.error("Unsupported type: "+typeof r)}return buffer.EncoderBuffer=d,d.prototype.join=function(h,f){return h||(h=new u(this.length)),f||(f=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(a){a.join(h,f),f+=a.length}):(typeof this.value=="number"?h[f]=this.value:typeof this.value=="string"?h.write(this.value,f):u.isBuffer(this.value)&&this.value.copy(h,f),f+=this.length)),h},buffer}var node,hasRequiredNode;function requireNode(){if(hasRequiredNode)return node;hasRequiredNode=1;var c=requireBase().Reporter,t=requireBase().EncoderBuffer,u=requireBase().DecoderBuffer,o=requireMinimalisticAssert(),d=["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"],r=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(d),h=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function f(n,e){var s={};this._baseState=s,s.enc=n,s.parent=e||null,s.children=null,s.tag=null,s.args=null,s.reverseArgs=null,s.choice=null,s.optional=!1,s.any=!1,s.obj=!1,s.use=null,s.useDecoder=null,s.key=null,s.default=null,s.explicit=null,s.implicit=null,s.contains=null,s.parent||(s.children=[],this._wrap())}node=f;var a=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return f.prototype.clone=function(){var e=this._baseState,s={};a.forEach(function(v){s[v]=e[v]});var l=new this.constructor(s.parent);return l._baseState=s,l},f.prototype._wrap=function(){var e=this._baseState;r.forEach(function(s){this[s]=function(){var v=new this.constructor(this);return e.children.push(v),v[s].apply(v,arguments)}},this)},f.prototype._init=function(e){var s=this._baseState;o(s.parent===null),e.call(this),s.children=s.children.filter(function(l){return l._baseState.parent===this},this),o.equal(s.children.length,1,"Root node can have only one child")},f.prototype._useArgs=function(e){var s=this._baseState,l=e.filter(function(v){return v instanceof this.constructor},this);e=e.filter(function(v){return!(v instanceof this.constructor)},this),l.length!==0&&(o(s.children===null),s.children=l,l.forEach(function(v){v._baseState.parent=this},this)),e.length!==0&&(o(s.args===null),s.args=e,s.reverseArgs=e.map(function(v){if(typeof v!="object"||v.constructor!==Object)return v;var b={};return Object.keys(v).forEach(function(m){m==(m|0)&&(m|=0);var q=v[m];b[q]=m}),b}))},h.forEach(function(n){f.prototype[n]=function(){var s=this._baseState;throw new Error(n+" not implemented for encoding: "+s.enc)}}),d.forEach(function(n){f.prototype[n]=function(){var s=this._baseState,l=Array.prototype.slice.call(arguments);return o(s.tag===null),s.tag=n,this._useArgs(l),this}}),f.prototype.use=function(e){o(e);var s=this._baseState;return o(s.use===null),s.use=e,this},f.prototype.optional=function(){var e=this._baseState;return e.optional=!0,this},f.prototype.def=function(e){var s=this._baseState;return o(s.default===null),s.default=e,s.optional=!0,this},f.prototype.explicit=function(e){var s=this._baseState;return o(s.explicit===null&&s.implicit===null),s.explicit=e,this},f.prototype.implicit=function(e){var s=this._baseState;return o(s.explicit===null&&s.implicit===null),s.implicit=e,this},f.prototype.obj=function(){var e=this._baseState,s=Array.prototype.slice.call(arguments);return e.obj=!0,s.length!==0&&this._useArgs(s),this},f.prototype.key=function(e){var s=this._baseState;return o(s.key===null),s.key=e,this},f.prototype.any=function(){var e=this._baseState;return e.any=!0,this},f.prototype.choice=function(e){var s=this._baseState;return o(s.choice===null),s.choice=e,this._useArgs(Object.keys(e).map(function(l){return e[l]})),this},f.prototype.contains=function(e){var s=this._baseState;return o(s.use===null),s.contains=e,this},f.prototype._decode=function(e,s){var l=this._baseState;if(l.parent===null)return e.wrapResult(l.children[0]._decode(e,s));var v=l.default,b=!0,m=null;if(l.key!==null&&(m=e.enterKey(l.key)),l.optional){var q=null;if(l.explicit!==null?q=l.explicit:l.implicit!==null?q=l.implicit:l.tag!==null&&(q=l.tag),q===null&&!l.any){var E=e.save();try{l.choice===null?this._decodeGeneric(l.tag,e,s):this._decodeChoice(e,s),b=!0}catch{b=!1}e.restore(E)}else if(b=this._peekTag(e,q,l.any),e.isError(b))return b}var S;if(l.obj&&b&&(S=e.enterObject()),b){if(l.explicit!==null){var O=this._decodeTag(e,l.explicit);if(e.isError(O))return O;e=O}var D=e.offset;if(l.use===null&&l.choice===null){if(l.any)var E=e.save();var j=this._decodeTag(e,l.implicit!==null?l.implicit:l.tag,l.any);if(e.isError(j))return j;l.any?v=e.raw(E):e=j}if(s&&s.track&&l.tag!==null&&s.track(e.path(),D,e.length,"tagged"),s&&s.track&&l.tag!==null&&s.track(e.path(),e.offset,e.length,"content"),l.any?v=v:l.choice===null?v=this._decodeGeneric(l.tag,e,s):v=this._decodeChoice(e,s),e.isError(v))return v;if(!l.any&&l.choice===null&&l.children!==null&&l.children.forEach(function(ie){ie._decode(e,s)}),l.contains&&(l.tag==="octstr"||l.tag==="bitstr")){var $=new u(v);v=this._getUse(l.contains,e._reporterState.obj)._decode($,s)}}return l.obj&&b&&(v=e.leaveObject(S)),l.key!==null&&(v!==null||b===!0)?e.leaveKey(m,l.key,v):m!==null&&e.exitKey(m),v},f.prototype._decodeGeneric=function(e,s,l){var v=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(s,e,v.args[0],l):/str$/.test(e)?this._decodeStr(s,e,l):e==="objid"&&v.args?this._decodeObjid(s,v.args[0],v.args[1],l):e==="objid"?this._decodeObjid(s,null,null,l):e==="gentime"||e==="utctime"?this._decodeTime(s,e,l):e==="null_"?this._decodeNull(s,l):e==="bool"?this._decodeBool(s,l):e==="objDesc"?this._decodeStr(s,e,l):e==="int"||e==="enum"?this._decodeInt(s,v.args&&v.args[0],l):v.use!==null?this._getUse(v.use,s._reporterState.obj)._decode(s,l):s.error("unknown tag: "+e)},f.prototype._getUse=function(e,s){var l=this._baseState;return l.useDecoder=this._use(e,s),o(l.useDecoder._baseState.parent===null),l.useDecoder=l.useDecoder._baseState.children[0],l.implicit!==l.useDecoder._baseState.implicit&&(l.useDecoder=l.useDecoder.clone(),l.useDecoder._baseState.implicit=l.implicit),l.useDecoder},f.prototype._decodeChoice=function(e,s){var l=this._baseState,v=null,b=!1;return Object.keys(l.choice).some(function(m){var q=e.save(),E=l.choice[m];try{var S=E._decode(e,s);if(e.isError(S))return!1;v={type:m,value:S},b=!0}catch{return e.restore(q),!1}return!0},this),b?v:e.error("Choice not matched")},f.prototype._createEncoderBuffer=function(e){return new t(e,this.reporter)},f.prototype._encode=function(e,s,l){var v=this._baseState;if(!(v.default!==null&&v.default===e)){var b=this._encodeValue(e,s,l);if(b!==void 0&&!this._skipDefault(b,s,l))return b}},f.prototype._encodeValue=function(e,s,l){var v=this._baseState;if(v.parent===null)return v.children[0]._encode(e,s||new c);var E=null;if(this.reporter=s,v.optional&&e===void 0)if(v.default!==null)e=v.default;else return;var b=null,m=!1;if(v.any)E=this._createEncoderBuffer(e);else if(v.choice)E=this._encodeChoice(e,s);else if(v.contains)b=this._getUse(v.contains,l)._encode(e,s),m=!0;else if(v.children)b=v.children.map(function(D){if(D._baseState.tag==="null_")return D._encode(null,s,e);if(D._baseState.key===null)return s.error("Child should have a key");var j=s.enterKey(D._baseState.key);if(typeof e!="object")return s.error("Child expected, but input is not object");var $=D._encode(e[D._baseState.key],s,e);return s.leaveKey(j),$},this).filter(function(D){return D}),b=this._createEncoderBuffer(b);else if(v.tag==="seqof"||v.tag==="setof"){if(!(v.args&&v.args.length===1))return s.error("Too many args for : "+v.tag);if(!Array.isArray(e))return s.error("seqof/setof, but data is not Array");var q=this.clone();q._baseState.implicit=null,b=this._createEncoderBuffer(e.map(function(D){var j=this._baseState;return this._getUse(j.args[0],e)._encode(D,s)},q))}else v.use!==null?E=this._getUse(v.use,l)._encode(e,s):(b=this._encodePrimitive(v.tag,e),m=!0);var E;if(!v.any&&v.choice===null){var S=v.implicit!==null?v.implicit:v.tag,O=v.implicit===null?"universal":"context";S===null?v.use===null&&s.error("Tag could be omitted only for .use()"):v.use===null&&(E=this._encodeComposite(S,m,O,b))}return v.explicit!==null&&(E=this._encodeComposite(v.explicit,!1,"context",E)),E},f.prototype._encodeChoice=function(e,s){var l=this._baseState,v=l.choice[e.type];return v||o(!1,e.type+" not found in "+JSON.stringify(Object.keys(l.choice))),v._encode(e.value,s)},f.prototype._encodePrimitive=function(e,s){var l=this._baseState;if(/str$/.test(e))return this._encodeStr(s,e);if(e==="objid"&&l.args)return this._encodeObjid(s,l.reverseArgs[0],l.args[1]);if(e==="objid")return this._encodeObjid(s,null,null);if(e==="gentime"||e==="utctime")return this._encodeTime(s,e);if(e==="null_")return this._encodeNull();if(e==="int"||e==="enum")return this._encodeInt(s,l.args&&l.reverseArgs[0]);if(e==="bool")return this._encodeBool(s);if(e==="objDesc")return this._encodeStr(s,e);throw new Error("Unsupported tag: "+e)},f.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},f.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)},node}var hasRequiredBase;function requireBase(){return hasRequiredBase||(hasRequiredBase=1,(function(c){var t=c;t.Reporter=requireReporter().Reporter,t.DecoderBuffer=requireBuffer().DecoderBuffer,t.EncoderBuffer=requireBuffer().EncoderBuffer,t.Node=requireNode()})(base)),base}var constants={},der={},hasRequiredDer$2;function requireDer$2(){return hasRequiredDer$2||(hasRequiredDer$2=1,(function(c){var t=requireConstants();c.tagClass={0:"universal",1:"application",2:"context",3:"private"},c.tagClassByName=t._reverse(c.tagClass),c.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"},c.tagByName=t._reverse(c.tag)})(der)),der}var hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,(function(c){var t=c;t._reverse=function(o){var d={};return Object.keys(o).forEach(function(r){(r|0)==r&&(r=r|0);var h=o[r];d[h]=r}),d},t.der=requireDer$2()})(constants)),constants}var decoders={},der_1$1,hasRequiredDer$1;function requireDer$1(){if(hasRequiredDer$1)return der_1$1;hasRequiredDer$1=1;var c=requireInherits_browser(),t=requireAsn1$1(),u=t.base,o=t.bignum,d=t.constants.der;function r(n){this.enc="der",this.name=n.name,this.entity=n,this.tree=new h,this.tree._init(n.body)}der_1$1=r,r.prototype.decode=function(e,s){return e instanceof u.DecoderBuffer||(e=new u.DecoderBuffer(e,s)),this.tree._decode(e,s)};function h(n){u.Node.call(this,"der",n)}c(h,u.Node),h.prototype._peekTag=function(e,s,l){if(e.isEmpty())return!1;var v=e.save(),b=f(e,'Failed to peek tag: "'+s+'"');return e.isError(b)?b:(e.restore(v),b.tag===s||b.tagStr===s||b.tagStr+"of"===s||l)},h.prototype._decodeTag=function(e,s,l){var v=f(e,'Failed to decode tag of "'+s+'"');if(e.isError(v))return v;var b=a(e,v.primitive,'Failed to get length of "'+s+'"');if(e.isError(b))return b;if(!l&&v.tag!==s&&v.tagStr!==s&&v.tagStr+"of"!==s)return e.error('Failed to match tag: "'+s+'"');if(v.primitive||b!==null)return e.skip(b,'Failed to match body of: "'+s+'"');var m=e.save(),q=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(q)?q:(b=e.offset-m.offset,e.restore(m),e.skip(b,'Failed to match body of: "'+s+'"'))},h.prototype._skipUntilEnd=function(e,s){for(;;){var l=f(e,s);if(e.isError(l))return l;var v=a(e,l.primitive,s);if(e.isError(v))return v;var b;if(l.primitive||v!==null?b=e.skip(v):b=this._skipUntilEnd(e,s),e.isError(b))return b;if(l.tagStr==="end")break}},h.prototype._decodeList=function(e,s,l,v){for(var b=[];!e.isEmpty();){var m=this._peekTag(e,"end");if(e.isError(m))return m;var q=l.decode(e,"der",v);if(e.isError(q)&&m)break;b.push(q)}return b},h.prototype._decodeStr=function(e,s){if(s==="bitstr"){var l=e.readUInt8();return e.isError(l)?l:{unused:l,data:e.raw()}}else if(s==="bmpstr"){var v=e.raw();if(v.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");for(var b="",m=0;m<v.length/2;m++)b+=String.fromCharCode(v.readUInt16BE(m*2));return b}else if(s==="numstr"){var q=e.raw().toString("ascii");return this._isNumstr(q)?q:e.error("Decoding of string type: numstr unsupported characters")}else{if(s==="octstr")return e.raw();if(s==="objDesc")return e.raw();if(s==="printstr"){var E=e.raw().toString("ascii");return this._isPrintstr(E)?E:e.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(s)?e.raw().toString():e.error("Decoding of string type: "+s+" unsupported")}},h.prototype._decodeObjid=function(e,s,l){for(var v,b=[],m=0;!e.isEmpty();){var q=e.readUInt8();m<<=7,m|=q&127,(q&128)===0&&(b.push(m),m=0)}q&128&&b.push(m);var E=b[0]/40|0,S=b[0]%40;if(l?v=b:v=[E,S].concat(b.slice(1)),s){var O=s[v.join(" ")];O===void 0&&(O=s[v.join(".")]),O!==void 0&&(v=O)}return v},h.prototype._decodeTime=function(e,s){var l=e.raw().toString();if(s==="gentime")var v=l.slice(0,4)|0,b=l.slice(4,6)|0,m=l.slice(6,8)|0,q=l.slice(8,10)|0,E=l.slice(10,12)|0,S=l.slice(12,14)|0;else if(s==="utctime"){var v=l.slice(0,2)|0,b=l.slice(2,4)|0,m=l.slice(4,6)|0,q=l.slice(6,8)|0,E=l.slice(8,10)|0,S=l.slice(10,12)|0;v<70?v=2e3+v:v=1900+v}else return e.error("Decoding "+s+" time is not supported yet");return Date.UTC(v,b-1,m,q,E,S,0)},h.prototype._decodeNull=function(e){return null},h.prototype._decodeBool=function(e){var s=e.readUInt8();return e.isError(s)?s:s!==0},h.prototype._decodeInt=function(e,s){var l=e.raw(),v=new o(l);return s&&(v=s[v.toString(10)]||v),v},h.prototype._use=function(e,s){return typeof e=="function"&&(e=e(s)),e._getDecoder("der").tree};function f(n,e){var s=n.readUInt8(e);if(n.isError(s))return s;var l=d.tagClass[s>>6],v=(s&32)===0;if((s&31)===31){var b=s;for(s=0;(b&128)===128;){if(b=n.readUInt8(e),n.isError(b))return b;s<<=7,s|=b&127}}else s&=31;var m=d.tag[s];return{cls:l,primitive:v,tag:s,tagStr:m}}function a(n,e,s){var l=n.readUInt8(s);if(n.isError(l))return l;if(!e&&l===128)return null;if((l&128)===0)return l;var v=l&127;if(v>4)return n.error("length octect is too long");l=0;for(var b=0;b<v;b++){l<<=8;var m=n.readUInt8(s);if(n.isError(m))return m;l|=m}return l}return der_1$1}var pem$1,hasRequiredPem$1;function requirePem$1(){if(hasRequiredPem$1)return pem$1;hasRequiredPem$1=1;var c=requireInherits_browser(),t=requireDist().Buffer,u=requireDer$1();function o(d){u.call(this,d),this.enc="pem"}return c(o,u),pem$1=o,o.prototype.decode=function(r,h){for(var f=r.toString().split(/[\r\n]+/g),a=h.label.toUpperCase(),n=/^-----(BEGIN|END) ([^-]+)-----$/,e=-1,s=-1,l=0;l<f.length;l++){var v=f[l].match(n);if(v!==null&&v[2]===a)if(e===-1){if(v[1]!=="BEGIN")break;e=l}else{if(v[1]!=="END")break;s=l;break}}if(e===-1||s===-1)throw new Error("PEM section not found for: "+a);var b=f.slice(e+1,s).join("");b.replace(/[^a-z0-9\+\/=]+/gi,"");var m=new t(b,"base64");return u.prototype.decode.call(this,m,h)},pem$1}var hasRequiredDecoders;function requireDecoders(){return hasRequiredDecoders||(hasRequiredDecoders=1,(function(c){var t=c;t.der=requireDer$1(),t.pem=requirePem$1()})(decoders)),decoders}var encoders={},der_1,hasRequiredDer;function requireDer(){if(hasRequiredDer)return der_1;hasRequiredDer=1;var c=requireInherits_browser(),t=requireDist().Buffer,u=requireAsn1$1(),o=u.base,d=u.constants.der;function r(n){this.enc="der",this.name=n.name,this.entity=n,this.tree=new h,this.tree._init(n.body)}der_1=r,r.prototype.encode=function(e,s){return this.tree._encode(e,s).join()};function h(n){o.Node.call(this,"der",n)}c(h,o.Node),h.prototype._encodeComposite=function(e,s,l,v){var b=a(e,s,l,this.reporter);if(v.length<128){var E=new t(2);return E[0]=b,E[1]=v.length,this._createEncoderBuffer([E,v])}for(var m=1,q=v.length;q>=256;q>>=8)m++;var E=new t(2+m);E[0]=b,E[1]=128|m;for(var q=1+m,S=v.length;S>0;q--,S>>=8)E[q]=S&255;return this._createEncoderBuffer([E,v])},h.prototype._encodeStr=function(e,s){if(s==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(s==="bmpstr"){for(var l=new t(e.length*2),v=0;v<e.length;v++)l.writeUInt16BE(e.charCodeAt(v),v*2);return this._createEncoderBuffer(l)}else return s==="numstr"?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):s==="printstr"?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(s)?this._createEncoderBuffer(e):s==="objDesc"?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+s+" unsupported")},h.prototype._encodeObjid=function(e,s,l){if(typeof e=="string"){if(!s)return this.reporter.error("string objid given, but no values map found");if(!s.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=s[e].split(/[\s\.]+/g);for(var v=0;v<e.length;v++)e[v]|=0}else if(Array.isArray(e)){e=e.slice();for(var v=0;v<e.length;v++)e[v]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!l){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}for(var b=0,v=0;v<e.length;v++){var m=e[v];for(b++;m>=128;m>>=7)b++}for(var q=new t(b),E=q.length-1,v=e.length-1;v>=0;v--){var m=e[v];for(q[E--]=m&127;(m>>=7)>0;)q[E--]=128|m&127}return this._createEncoderBuffer(q)};function f(n){return n<10?"0"+n:n}h.prototype._encodeTime=function(e,s){var l,v=new Date(e);return s==="gentime"?l=[f(v.getFullYear()),f(v.getUTCMonth()+1),f(v.getUTCDate()),f(v.getUTCHours()),f(v.getUTCMinutes()),f(v.getUTCSeconds()),"Z"].join(""):s==="utctime"?l=[f(v.getFullYear()%100),f(v.getUTCMonth()+1),f(v.getUTCDate()),f(v.getUTCHours()),f(v.getUTCMinutes()),f(v.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+s+" time is not supported yet"),this._encodeStr(l,"octstr")},h.prototype._encodeNull=function(){return this._createEncoderBuffer("")},h.prototype._encodeInt=function(e,s){if(typeof e=="string"){if(!s)return this.reporter.error("String int or enum given, but no values map");if(!s.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=s[e]}if(typeof e!="number"&&!t.isBuffer(e)){var l=e.toArray();!e.sign&&l[0]&128&&l.unshift(0),e=new t(l)}if(t.isBuffer(e)){var v=e.length;e.length===0&&v++;var m=new t(v);return e.copy(m),e.length===0&&(m[0]=0),this._createEncoderBuffer(m)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);for(var v=1,b=e;b>=256;b>>=8)v++;for(var m=new Array(v),b=m.length-1;b>=0;b--)m[b]=e&255,e>>=8;return m[0]&128&&m.unshift(0),this._createEncoderBuffer(new t(m))},h.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},h.prototype._use=function(e,s){return typeof e=="function"&&(e=e(s)),e._getEncoder("der").tree},h.prototype._skipDefault=function(e,s,l){var v=this._baseState,b;if(v.default===null)return!1;var m=e.join();if(v.defaultBuffer===void 0&&(v.defaultBuffer=this._encodeValue(v.default,s,l).join()),m.length!==v.defaultBuffer.length)return!1;for(b=0;b<m.length;b++)if(m[b]!==v.defaultBuffer[b])return!1;return!0};function a(n,e,s,l){var v;if(n==="seqof"?n="seq":n==="setof"&&(n="set"),d.tagByName.hasOwnProperty(n))v=d.tagByName[n];else if(typeof n=="number"&&(n|0)===n)v=n;else return l.error("Unknown tag: "+n);return v>=31?l.error("Multi-octet tag encoding unsupported"):(e||(v|=32),v|=d.tagClassByName[s||"universal"]<<6,v)}return der_1}var pem,hasRequiredPem;function requirePem(){if(hasRequiredPem)return pem;hasRequiredPem=1;var c=requireInherits_browser(),t=requireDer();function u(o){t.call(this,o),this.enc="pem"}return c(u,t),pem=u,u.prototype.encode=function(d,r){for(var h=t.prototype.encode.call(this,d),f=h.toString("base64"),a=["-----BEGIN "+r.label+"-----"],n=0;n<f.length;n+=64)a.push(f.slice(n,n+64));return a.push("-----END "+r.label+"-----"),a.join(`
|
|
14
|
-
`)},pem}var hasRequiredEncoders;function requireEncoders(){return hasRequiredEncoders||(hasRequiredEncoders=1,(function(c){var t=c;t.der=requireDer(),t.pem=requirePem()})(encoders)),encoders}var hasRequiredAsn1$1;function requireAsn1$1(){return hasRequiredAsn1$1||(hasRequiredAsn1$1=1,(function(c){var t=c;t.bignum=requireBn$1(),t.define=requireApi().define,t.base=requireBase(),t.constants=requireConstants(),t.decoders=requireDecoders(),t.encoders=requireEncoders()})(asn1)),asn1}var certificate,hasRequiredCertificate;function requireCertificate(){if(hasRequiredCertificate)return certificate;hasRequiredCertificate=1;var c=requireAsn1$1(),t=c.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),u=c.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=c.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),d=c.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),r=c.define("RelativeDistinguishedName",function(){this.setof(u)}),h=c.define("RDNSequence",function(){this.seqof(r)}),f=c.define("Name",function(){this.choice({rdnSequence:this.use(h)})}),a=c.define("Validity",function(){this.seq().obj(this.key("notBefore").use(t),this.key("notAfter").use(t))}),n=c.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),e=c.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(f),this.key("validity").use(a),this.key("subject").use(f),this.key("subjectPublicKeyInfo").use(d),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(n).optional())}),s=c.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(e),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});return certificate=s,certificate}var hasRequiredAsn1;function requireAsn1(){if(hasRequiredAsn1)return asn1$1;hasRequiredAsn1=1;var c=requireAsn1$1();asn1$1.certificate=requireCertificate();var t=c.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())});asn1$1.RSAPrivateKey=t;var u=c.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});asn1$1.RSAPublicKey=u;var o=c.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())}),d=c.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())});asn1$1.PublicKey=d;var r=c.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(o),this.key("subjectPrivateKey").octstr())});asn1$1.PrivateKey=r;var h=c.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())});asn1$1.EncryptedPrivateKey=h;var f=c.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())});asn1$1.DSAPrivateKey=f,asn1$1.DSAparam=c.define("DSAparam",function(){this.int()});var a=c.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),n=c.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(a),this.key("publicKey").optional().explicit(1).bitstr())});return asn1$1.ECPrivateKey=n,asn1$1.signature=c.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())}),asn1$1}const require$$1={"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"};var fixProc,hasRequiredFixProc;function requireFixProc(){if(hasRequiredFixProc)return fixProc;hasRequiredFixProc=1;var c=/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,t=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,u=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,o=requireEvp_bytestokey(),d=requireBrowser$6(),r=requireSafeBuffer$1().Buffer;return fixProc=function(h,f){var a=h.toString(),n=a.match(c),e;if(n){var l="aes"+n[1],v=r.from(n[2],"hex"),b=r.from(n[3].replace(/[\r\n]/g,""),"base64"),m=o(f,v.slice(0,8),parseInt(n[1],10)).key,q=[],E=d.createDecipheriv(l,m,v);q.push(E.update(b)),q.push(E.final()),e=r.concat(q)}else{var s=a.match(u);e=r.from(s[2].replace(/[\r\n]/g,""),"base64")}var S=a.match(t)[1];return{tag:S,data:e}},fixProc}var parseAsn1,hasRequiredParseAsn1;function requireParseAsn1(){if(hasRequiredParseAsn1)return parseAsn1;hasRequiredParseAsn1=1;var c=requireAsn1(),t=require$$1,u=requireFixProc(),o=requireBrowser$6(),d=requireBrowser$7().pbkdf2Sync,r=requireSafeBuffer$1().Buffer;function h(a,n){var e=a.algorithm.decrypt.kde.kdeparams.salt,s=parseInt(a.algorithm.decrypt.kde.kdeparams.iters.toString(),10),l=t[a.algorithm.decrypt.cipher.algo.join(".")],v=a.algorithm.decrypt.cipher.iv,b=a.subjectPrivateKey,m=parseInt(l.split("-")[1],10)/8,q=d(n,e,s,m,"sha1"),E=o.createDecipheriv(l,q,v),S=[];return S.push(E.update(b)),S.push(E.final()),r.concat(S)}function f(a){var n;typeof a=="object"&&!r.isBuffer(a)&&(n=a.passphrase,a=a.key),typeof a=="string"&&(a=r.from(a));var e=u(a,n),s=e.tag,l=e.data,v,b;switch(s){case"CERTIFICATE":b=c.certificate.decode(l,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(b||(b=c.PublicKey.decode(l,"der")),v=b.algorithm.algorithm.join("."),v){case"1.2.840.113549.1.1.1":return c.RSAPublicKey.decode(b.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return b.subjectPrivateKey=b.subjectPublicKey,{type:"ec",data:b};case"1.2.840.10040.4.1":return b.algorithm.params.pub_key=c.DSAparam.decode(b.subjectPublicKey.data,"der"),{type:"dsa",data:b.algorithm.params};default:throw new Error("unknown key id "+v)}case"ENCRYPTED PRIVATE KEY":l=c.EncryptedPrivateKey.decode(l,"der"),l=h(l,n);case"PRIVATE KEY":switch(b=c.PrivateKey.decode(l,"der"),v=b.algorithm.algorithm.join("."),v){case"1.2.840.113549.1.1.1":return c.RSAPrivateKey.decode(b.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:b.algorithm.curve,privateKey:c.ECPrivateKey.decode(b.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return b.algorithm.params.priv_key=c.DSAparam.decode(b.subjectPrivateKey,"der"),{type:"dsa",params:b.algorithm.params};default:throw new Error("unknown key id "+v)}case"RSA PUBLIC KEY":return c.RSAPublicKey.decode(l,"der");case"RSA PRIVATE KEY":return c.RSAPrivateKey.decode(l,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:c.DSAPrivateKey.decode(l,"der")};case"EC PRIVATE KEY":return l=c.ECPrivateKey.decode(l,"der"),{curve:l.parameters.value,privateKey:l.privateKey};default:throw new Error("unknown key type "+s)}}return f.signature=c.signature,parseAsn1=f,parseAsn1}const require$$4={"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"};var hasRequiredSign;function requireSign(){if(hasRequiredSign)return sign.exports;hasRequiredSign=1;var c=requireSafeBuffer$1().Buffer,t=requireBrowser$8(),u=requireBrowserifyRsa(),o=requireElliptic().ec,d=requireBn(),r=requireParseAsn1(),h=require$$4,f=1;function a(E,S,O,D,j){var $=r(S);if($.curve){if(D!=="ecdsa"&&D!=="ecdsa/rsa")throw new Error("wrong private key type");return n(E,$)}else if($.type==="dsa"){if(D!=="dsa")throw new Error("wrong private key type");return e(E,$,O)}if(D!=="rsa"&&D!=="ecdsa/rsa")throw new Error("wrong private key type");if(S.padding!==void 0&&S.padding!==f)throw new Error("illegal or unsupported padding mode");E=c.concat([j,E]);for(var J=$.modulus.byteLength(),ie=[0,1];E.length+ie.length+1<J;)ie.push(255);ie.push(0);for(var ne=-1;++ne<E.length;)ie.push(E[ne]);var de=u(ie,$);return de}function n(E,S){var O=h[S.curve.join(".")];if(!O)throw new Error("unknown curve "+S.curve.join("."));var D=new o(O),j=D.keyFromPrivate(S.privateKey),$=j.sign(E);return c.from($.toDER())}function e(E,S,O){for(var D=S.params.priv_key,j=S.params.p,$=S.params.q,J=S.params.g,ie=new d(0),ne,de=v(E,$).mod($),Z=!1,y=l(D,$,E,O);Z===!1;)ne=m($,y,O),ie=q(J,ne,j,$),Z=ne.invm($).imul(de.add(D.mul(ie))).mod($),Z.cmpn(0)===0&&(Z=!1,ie=new d(0));return s(ie,Z)}function s(E,S){E=E.toArray(),S=S.toArray(),E[0]&128&&(E=[0].concat(E)),S[0]&128&&(S=[0].concat(S));var O=E.length+S.length+4,D=[48,O,2,E.length];return D=D.concat(E,[2,S.length],S),c.from(D)}function l(E,S,O,D){if(E=c.from(E.toArray()),E.length<S.byteLength()){var j=c.alloc(S.byteLength()-E.length);E=c.concat([j,E])}var $=O.length,J=b(O,S),ie=c.alloc($);ie.fill(1);var ne=c.alloc($);return ne=t(D,ne).update(ie).update(c.from([0])).update(E).update(J).digest(),ie=t(D,ne).update(ie).digest(),ne=t(D,ne).update(ie).update(c.from([1])).update(E).update(J).digest(),ie=t(D,ne).update(ie).digest(),{k:ne,v:ie}}function v(E,S){var O=new d(E),D=(E.length<<3)-S.bitLength();return D>0&&O.ishrn(D),O}function b(E,S){E=v(E,S),E=E.mod(S);var O=c.from(E.toArray());if(O.length<S.byteLength()){var D=c.alloc(S.byteLength()-O.length);O=c.concat([D,O])}return O}function m(E,S,O){var D,j;do{for(D=c.alloc(0);D.length*8<E.bitLength();)S.v=t(O,S.k).update(S.v).digest(),D=c.concat([D,S.v]);j=v(D,E),S.k=t(O,S.k).update(S.v).update(c.from([0])).digest(),S.v=t(O,S.k).update(S.v).digest()}while(j.cmp(E)!==-1);return j}function q(E,S,O,D){return E.toRed(d.mont(O)).redPow(S).fromRed().mod(D)}return sign.exports=a,sign.exports.getKey=l,sign.exports.makeKey=m,sign.exports}var verify_1,hasRequiredVerify;function requireVerify(){if(hasRequiredVerify)return verify_1;hasRequiredVerify=1;var c=requireSafeBuffer$1().Buffer,t=requireBn(),u=requireElliptic().ec,o=requireParseAsn1(),d=require$$4;function r(n,e,s,l,v){var b=o(s);if(b.type==="ec"){if(l!=="ecdsa"&&l!=="ecdsa/rsa")throw new Error("wrong public key type");return h(n,e,b)}else if(b.type==="dsa"){if(l!=="dsa")throw new Error("wrong public key type");return f(n,e,b)}if(l!=="rsa"&&l!=="ecdsa/rsa")throw new Error("wrong public key type");e=c.concat([v,e]);for(var m=b.modulus.byteLength(),q=[1],E=0;e.length+q.length+2<m;)q.push(255),E+=1;q.push(0);for(var S=-1;++S<e.length;)q.push(e[S]);q=c.from(q);var O=t.mont(b.modulus);n=new t(n).toRed(O),n=n.redPow(new t(b.publicExponent)),n=c.from(n.fromRed().toArray());var D=E<8?1:0;for(m=Math.min(n.length,q.length),n.length!==q.length&&(D=1),S=-1;++S<m;)D|=n[S]^q[S];return D===0}function h(n,e,s){var l=d[s.data.algorithm.curve.join(".")];if(!l)throw new Error("unknown curve "+s.data.algorithm.curve.join("."));var v=new u(l),b=s.data.subjectPrivateKey.data;return v.verify(e,n,b)}function f(n,e,s){var l=s.data.p,v=s.data.q,b=s.data.g,m=s.data.pub_key,q=o.signature.decode(n,"der"),E=q.s,S=q.r;a(E,v),a(S,v);var O=t.mont(l),D=E.invm(v),j=b.toRed(O).redPow(new t(e).mul(D).mod(v)).fromRed().mul(m.toRed(O).redPow(S.mul(D).mod(v)).fromRed()).mod(l).mod(v);return j.cmp(S)===0}function a(n,e){if(n.cmpn(0)<=0)throw new Error("invalid sig");if(n.cmp(e)>=0)throw new Error("invalid sig")}return verify_1=r,verify_1}var browser$3,hasRequiredBrowser$3;function requireBrowser$3(){if(hasRequiredBrowser$3)return browser$3;hasRequiredBrowser$3=1;var c=requireSafeBuffer$1().Buffer,t=requireBrowser$9(),u=requireReadableBrowser(),o=requireInherits_browser(),d=requireSign(),r=requireVerify(),h=require$$6;Object.keys(h).forEach(function(s){h[s].id=c.from(h[s].id,"hex"),h[s.toLowerCase()]=h[s]});function f(s){u.Writable.call(this);var l=h[s];if(!l)throw new Error("Unknown message digest");this._hashType=l.hash,this._hash=t(l.hash),this._tag=l.id,this._signType=l.sign}o(f,u.Writable),f.prototype._write=function(l,v,b){this._hash.update(l),b()},f.prototype.update=function(l,v){return this._hash.update(typeof l=="string"?c.from(l,v):l),this},f.prototype.sign=function(l,v){this.end();var b=this._hash.digest(),m=d(b,l,this._hashType,this._signType,this._tag);return v?m.toString(v):m};function a(s){u.Writable.call(this);var l=h[s];if(!l)throw new Error("Unknown message digest");this._hash=t(l.hash),this._tag=l.id,this._signType=l.sign}o(a,u.Writable),a.prototype._write=function(l,v,b){this._hash.update(l),b()},a.prototype.update=function(l,v){return this._hash.update(typeof l=="string"?c.from(l,v):l),this},a.prototype.verify=function(l,v,b){var m=typeof v=="string"?c.from(v,b):v;this.end();var q=this._hash.digest();return r(m,q,l,this._signType,this._tag)};function n(s){return new f(s)}function e(s){return new a(s)}return browser$3={Sign:n,Verify:e,createSign:n,createVerify:e},browser$3}var browser$2,hasRequiredBrowser$2;function requireBrowser$2(){if(hasRequiredBrowser$2)return browser$2;hasRequiredBrowser$2=1;var c=requireElliptic(),t=requireBn$1();browser$2=function(h){return new o(h)};var u={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}};u.p224=u.secp224r1,u.p256=u.secp256r1=u.prime256v1,u.p192=u.secp192r1=u.prime192v1,u.p384=u.secp384r1,u.p521=u.secp521r1;function o(r){this.curveType=u[r],this.curveType||(this.curveType={name:r}),this.curve=new c.ec(this.curveType.name),this.keys=void 0}o.prototype.generateKeys=function(r,h){return this.keys=this.curve.genKeyPair(),this.getPublicKey(r,h)},o.prototype.computeSecret=function(r,h,f){h=h||"utf8",Buffer.isBuffer(r)||(r=new Buffer(r,h));var a=this.curve.keyFromPublic(r).getPublic(),n=a.mul(this.keys.getPrivate()).getX();return d(n,f,this.curveType.byteLength)},o.prototype.getPublicKey=function(r,h){var f=this.keys.getPublic(h==="compressed",!0);return h==="hybrid"&&(f[f.length-1]%2?f[0]=7:f[0]=6),d(f,r)},o.prototype.getPrivateKey=function(r){return d(this.keys.getPrivate(),r)},o.prototype.setPublicKey=function(r,h){return h=h||"utf8",Buffer.isBuffer(r)||(r=new Buffer(r,h)),this.keys._importPublic(r),this},o.prototype.setPrivateKey=function(r,h){h=h||"utf8",Buffer.isBuffer(r)||(r=new Buffer(r,h));var f=new t(r);return f=f.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(f),this};function d(r,h,f){Array.isArray(r)||(r=r.toArray());var a=new Buffer(r);if(f&&a.length<f){var n=new Buffer(f-a.length);n.fill(0),a=Buffer.concat([n,a])}return h?a.toString(h):a}return browser$2}var browser$1={},mgf,hasRequiredMgf;function requireMgf(){if(hasRequiredMgf)return mgf;hasRequiredMgf=1;var c=requireBrowser$9(),t=requireSafeBuffer$1().Buffer;mgf=function(o,d){for(var r=t.alloc(0),h=0,f;r.length<d;)f=u(h++),r=t.concat([r,c("sha1").update(o).update(f).digest()]);return r.slice(0,d)};function u(o){var d=t.allocUnsafe(4);return d.writeUInt32BE(o,0),d}return mgf}var xor,hasRequiredXor;function requireXor(){return hasRequiredXor||(hasRequiredXor=1,xor=function(t,u){for(var o=t.length,d=-1;++d<o;)t[d]^=u[d];return t}),xor}var withPublic_1,hasRequiredWithPublic;function requireWithPublic(){if(hasRequiredWithPublic)return withPublic_1;hasRequiredWithPublic=1;var c=requireBn$1(),t=requireSafeBuffer$1().Buffer;function u(o,d){return t.from(o.toRed(c.mont(d.modulus)).redPow(new c(d.publicExponent)).fromRed().toArray())}return withPublic_1=u,withPublic_1}var publicEncrypt,hasRequiredPublicEncrypt;function requirePublicEncrypt(){if(hasRequiredPublicEncrypt)return publicEncrypt;hasRequiredPublicEncrypt=1;var c=requireParseAsn1(),t=requireBrowser$b(),u=requireBrowser$9(),o=requireMgf(),d=requireXor(),r=requireBn$1(),h=requireWithPublic(),f=requireBrowserifyRsa(),a=requireSafeBuffer$1().Buffer;publicEncrypt=function(v,b,m){var q;v.padding?q=v.padding:m?q=1:q=4;var E=c(v),S;if(q===4)S=n(E,b);else if(q===1)S=e(E,b,m);else if(q===3){if(S=new r(b),S.cmp(E.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return m?f(S,E):h(S,E)};function n(l,v){var b=l.modulus.byteLength(),m=v.length,q=u("sha1").update(a.alloc(0)).digest(),E=q.length,S=2*E;if(m>b-S-2)throw new Error("message too long");var O=a.alloc(b-m-S-2),D=b-E-1,j=t(E),$=d(a.concat([q,O,a.alloc(1,1),v],D),o(j,D)),J=d(j,o($,E));return new r(a.concat([a.alloc(1),J,$],b))}function e(l,v,b){var m=v.length,q=l.modulus.byteLength();if(m>q-11)throw new Error("message too long");var E;return b?E=a.alloc(q-m-3,255):E=s(q-m-3),new r(a.concat([a.from([0,b?1:2]),E,a.alloc(1),v],q))}function s(l){for(var v=a.allocUnsafe(l),b=0,m=t(l*2),q=0,E;b<l;)q===m.length&&(m=t(l*2),q=0),E=m[q++],E&&(v[b++]=E);return v}return publicEncrypt}var privateDecrypt,hasRequiredPrivateDecrypt;function requirePrivateDecrypt(){if(hasRequiredPrivateDecrypt)return privateDecrypt;hasRequiredPrivateDecrypt=1;var c=requireParseAsn1(),t=requireMgf(),u=requireXor(),o=requireBn$1(),d=requireBrowserifyRsa(),r=requireBrowser$9(),h=requireWithPublic(),f=requireSafeBuffer$1().Buffer;privateDecrypt=function(l,v,b){var m;l.padding?m=l.padding:b?m=1:m=4;var q=c(l),E=q.modulus.byteLength();if(v.length>E||new o(v).cmp(q.modulus)>=0)throw new Error("decryption error");var S;b?S=h(new o(v),q):S=d(v,q);var O=f.alloc(E-S.length);if(S=f.concat([O,S],E),m===4)return a(q,S);if(m===1)return n(q,S,b);if(m===3)return S;throw new Error("unknown padding")};function a(s,l){var v=s.modulus.byteLength(),b=r("sha1").update(f.alloc(0)).digest(),m=b.length;if(l[0]!==0)throw new Error("decryption error");var q=l.slice(1,m+1),E=l.slice(m+1),S=u(q,t(E,m)),O=u(E,t(S,v-m-1));if(e(b,O.slice(0,m)))throw new Error("decryption error");for(var D=m;O[D]===0;)D++;if(O[D++]!==1)throw new Error("decryption error");return O.slice(D)}function n(s,l,v){for(var b=l.slice(0,2),m=2,q=0;l[m++]!==0;)if(m>=l.length){q++;break}var E=l.slice(2,m-1);if((b.toString("hex")!=="0002"&&!v||b.toString("hex")!=="0001"&&v)&&q++,E.length<8&&q++,q)throw new Error("decryption error");return l.slice(m)}function e(s,l){s=f.from(s),l=f.from(l);var v=0,b=s.length;s.length!==l.length&&(v++,b=Math.min(s.length,l.length));for(var m=-1;++m<b;)v+=s[m]^l[m];return v}return privateDecrypt}var hasRequiredBrowser$1;function requireBrowser$1(){return hasRequiredBrowser$1||(hasRequiredBrowser$1=1,(function(c){c.publicEncrypt=requirePublicEncrypt(),c.privateDecrypt=requirePrivateDecrypt(),c.privateEncrypt=function(u,o){return c.publicEncrypt(u,o,!0)},c.publicDecrypt=function(u,o){return c.privateDecrypt(u,o,!0)}})(browser$1)),browser$1}var browser={},hasRequiredBrowser;function requireBrowser(){if(hasRequiredBrowser)return browser;hasRequiredBrowser=1;function c(){throw new Error(`secure random number generation not supported by this browser
|
|
15
|
-
use chrome, FireFox or Internet Explorer 11`)}var t=requireSafeBuffer$1(),
|
|
13
|
+
})`)}catch{c=function(a){this._initNamed(a)}}return f(c,h),c.prototype._initNamed=function(a){h.call(this,a)},new c(this)},d.prototype._getDecoder=function(h){return h=h||"der",this.decoders.hasOwnProperty(h)||(this.decoders[h]=this._createNamed(t.decoders[h])),this.decoders[h]},d.prototype.decode=function(h,c,n){return this._getDecoder(c).decode(h,n)},d.prototype._getEncoder=function(h){return h=h||"der",this.encoders.hasOwnProperty(h)||(this.encoders[h]=this._createNamed(t.encoders[h])),this.encoders[h]},d.prototype.encode=function(h,c,n){return this._getEncoder(c).encode(h,n)}})(api)),api}var base={},reporter={},hasRequiredReporter;function requireReporter(){if(hasRequiredReporter)return reporter;hasRequiredReporter=1;var s=requireInherits_browser();function t(o){this._reporterState={obj:null,path:[],options:o||{},errors:[]}}reporter.Reporter=t,t.prototype.isError=function(d){return d instanceof f},t.prototype.save=function(){var d=this._reporterState;return{obj:d.obj,pathLen:d.path.length}},t.prototype.restore=function(d){var r=this._reporterState;r.obj=d.obj,r.path=r.path.slice(0,d.pathLen)},t.prototype.enterKey=function(d){return this._reporterState.path.push(d)},t.prototype.exitKey=function(d){var r=this._reporterState;r.path=r.path.slice(0,d-1)},t.prototype.leaveKey=function(d,r,h){var c=this._reporterState;this.exitKey(d),c.obj!==null&&(c.obj[r]=h)},t.prototype.path=function(){return this._reporterState.path.join("/")},t.prototype.enterObject=function(){var d=this._reporterState,r=d.obj;return d.obj={},r},t.prototype.leaveObject=function(d){var r=this._reporterState,h=r.obj;return r.obj=d,h},t.prototype.error=function(d){var r,h=this._reporterState,c=d instanceof f;if(c?r=d:r=new f(h.path.map(function(n){return"["+JSON.stringify(n)+"]"}).join(""),d.message||d,d.stack),!h.options.partial)throw r;return c||h.errors.push(r),r},t.prototype.wrapResult=function(d){var r=this._reporterState;return r.options.partial?{result:this.isError(d)?null:d,errors:r.errors}:d};function f(o,d){this.path=o,this.rethrow(d)}return s(f,Error),f.prototype.rethrow=function(d){if(this.message=d+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,f),!this.stack)try{throw new Error(this.message)}catch(r){this.stack=r.stack}return this},reporter}var buffer={},hasRequiredBuffer;function requireBuffer(){if(hasRequiredBuffer)return buffer;hasRequiredBuffer=1;var s=requireInherits_browser(),t=requireBase().Reporter,f=requireDist().Buffer;function o(r,h){if(t.call(this,h),!f.isBuffer(r)){this.error("Input not Buffer");return}this.base=r,this.offset=0,this.length=r.length}s(o,t),buffer.DecoderBuffer=o,o.prototype.save=function(){return{offset:this.offset,reporter:t.prototype.save.call(this)}},o.prototype.restore=function(h){var c=new o(this.base);return c.offset=h.offset,c.length=this.offset,this.offset=h.offset,t.prototype.restore.call(this,h.reporter),c},o.prototype.isEmpty=function(){return this.offset===this.length},o.prototype.readUInt8=function(h){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(h||"DecoderBuffer overrun")},o.prototype.skip=function(h,c){if(!(this.offset+h<=this.length))return this.error(c||"DecoderBuffer overrun");var n=new o(this.base);return n._reporterState=this._reporterState,n.offset=this.offset,n.length=this.offset+h,this.offset+=h,n},o.prototype.raw=function(h){return this.base.slice(h?h.offset:this.offset,this.length)};function d(r,h){if(Array.isArray(r))this.length=0,this.value=r.map(function(c){return c instanceof d||(c=new d(c,h)),this.length+=c.length,c},this);else if(typeof r=="number"){if(!(0<=r&&r<=255))return h.error("non-byte EncoderBuffer value");this.value=r,this.length=1}else if(typeof r=="string")this.value=r,this.length=f.byteLength(r);else if(f.isBuffer(r))this.value=r,this.length=r.length;else return h.error("Unsupported type: "+typeof r)}return buffer.EncoderBuffer=d,d.prototype.join=function(h,c){return h||(h=new f(this.length)),c||(c=0),this.length===0||(Array.isArray(this.value)?this.value.forEach(function(n){n.join(h,c),c+=n.length}):(typeof this.value=="number"?h[c]=this.value:typeof this.value=="string"?h.write(this.value,c):f.isBuffer(this.value)&&this.value.copy(h,c),c+=this.length)),h},buffer}var node,hasRequiredNode;function requireNode(){if(hasRequiredNode)return node;hasRequiredNode=1;var s=requireBase().Reporter,t=requireBase().EncoderBuffer,f=requireBase().DecoderBuffer,o=requireMinimalisticAssert(),d=["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"],r=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(d),h=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function c(a,e){var u={};this._baseState=u,u.enc=a,u.parent=e||null,u.children=null,u.tag=null,u.args=null,u.reverseArgs=null,u.choice=null,u.optional=!1,u.any=!1,u.obj=!1,u.use=null,u.useDecoder=null,u.key=null,u.default=null,u.explicit=null,u.implicit=null,u.contains=null,u.parent||(u.children=[],this._wrap())}node=c;var n=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];return c.prototype.clone=function(){var e=this._baseState,u={};n.forEach(function(v){u[v]=e[v]});var l=new this.constructor(u.parent);return l._baseState=u,l},c.prototype._wrap=function(){var e=this._baseState;r.forEach(function(u){this[u]=function(){var v=new this.constructor(this);return e.children.push(v),v[u].apply(v,arguments)}},this)},c.prototype._init=function(e){var u=this._baseState;o(u.parent===null),e.call(this),u.children=u.children.filter(function(l){return l._baseState.parent===this},this),o.equal(u.children.length,1,"Root node can have only one child")},c.prototype._useArgs=function(e){var u=this._baseState,l=e.filter(function(v){return v instanceof this.constructor},this);e=e.filter(function(v){return!(v instanceof this.constructor)},this),l.length!==0&&(o(u.children===null),u.children=l,l.forEach(function(v){v._baseState.parent=this},this)),e.length!==0&&(o(u.args===null),u.args=e,u.reverseArgs=e.map(function(v){if(typeof v!="object"||v.constructor!==Object)return v;var b={};return Object.keys(v).forEach(function(m){m==(m|0)&&(m|=0);var B=v[m];b[B]=m}),b}))},h.forEach(function(a){c.prototype[a]=function(){var u=this._baseState;throw new Error(a+" not implemented for encoding: "+u.enc)}}),d.forEach(function(a){c.prototype[a]=function(){var u=this._baseState,l=Array.prototype.slice.call(arguments);return o(u.tag===null),u.tag=a,this._useArgs(l),this}}),c.prototype.use=function(e){o(e);var u=this._baseState;return o(u.use===null),u.use=e,this},c.prototype.optional=function(){var e=this._baseState;return e.optional=!0,this},c.prototype.def=function(e){var u=this._baseState;return o(u.default===null),u.default=e,u.optional=!0,this},c.prototype.explicit=function(e){var u=this._baseState;return o(u.explicit===null&&u.implicit===null),u.explicit=e,this},c.prototype.implicit=function(e){var u=this._baseState;return o(u.explicit===null&&u.implicit===null),u.implicit=e,this},c.prototype.obj=function(){var e=this._baseState,u=Array.prototype.slice.call(arguments);return e.obj=!0,u.length!==0&&this._useArgs(u),this},c.prototype.key=function(e){var u=this._baseState;return o(u.key===null),u.key=e,this},c.prototype.any=function(){var e=this._baseState;return e.any=!0,this},c.prototype.choice=function(e){var u=this._baseState;return o(u.choice===null),u.choice=e,this._useArgs(Object.keys(e).map(function(l){return e[l]})),this},c.prototype.contains=function(e){var u=this._baseState;return o(u.use===null),u.contains=e,this},c.prototype._decode=function(e,u){var l=this._baseState;if(l.parent===null)return e.wrapResult(l.children[0]._decode(e,u));var v=l.default,b=!0,m=null;if(l.key!==null&&(m=e.enterKey(l.key)),l.optional){var B=null;if(l.explicit!==null?B=l.explicit:l.implicit!==null?B=l.implicit:l.tag!==null&&(B=l.tag),B===null&&!l.any){var E=e.save();try{l.choice===null?this._decodeGeneric(l.tag,e,u):this._decodeChoice(e,u),b=!0}catch{b=!1}e.restore(E)}else if(b=this._peekTag(e,B,l.any),e.isError(b))return b}var S;if(l.obj&&b&&(S=e.enterObject()),b){if(l.explicit!==null){var O=this._decodeTag(e,l.explicit);if(e.isError(O))return O;e=O}var D=e.offset;if(l.use===null&&l.choice===null){if(l.any)var E=e.save();var $=this._decodeTag(e,l.implicit!==null?l.implicit:l.tag,l.any);if(e.isError($))return $;l.any?v=e.raw(E):e=$}if(u&&u.track&&l.tag!==null&&u.track(e.path(),D,e.length,"tagged"),u&&u.track&&l.tag!==null&&u.track(e.path(),e.offset,e.length,"content"),l.any?v=v:l.choice===null?v=this._decodeGeneric(l.tag,e,u):v=this._decodeChoice(e,u),e.isError(v))return v;if(!l.any&&l.choice===null&&l.children!==null&&l.children.forEach(function(ie){ie._decode(e,u)}),l.contains&&(l.tag==="octstr"||l.tag==="bitstr")){var H=new f(v);v=this._getUse(l.contains,e._reporterState.obj)._decode(H,u)}}return l.obj&&b&&(v=e.leaveObject(S)),l.key!==null&&(v!==null||b===!0)?e.leaveKey(m,l.key,v):m!==null&&e.exitKey(m),v},c.prototype._decodeGeneric=function(e,u,l){var v=this._baseState;return e==="seq"||e==="set"?null:e==="seqof"||e==="setof"?this._decodeList(u,e,v.args[0],l):/str$/.test(e)?this._decodeStr(u,e,l):e==="objid"&&v.args?this._decodeObjid(u,v.args[0],v.args[1],l):e==="objid"?this._decodeObjid(u,null,null,l):e==="gentime"||e==="utctime"?this._decodeTime(u,e,l):e==="null_"?this._decodeNull(u,l):e==="bool"?this._decodeBool(u,l):e==="objDesc"?this._decodeStr(u,e,l):e==="int"||e==="enum"?this._decodeInt(u,v.args&&v.args[0],l):v.use!==null?this._getUse(v.use,u._reporterState.obj)._decode(u,l):u.error("unknown tag: "+e)},c.prototype._getUse=function(e,u){var l=this._baseState;return l.useDecoder=this._use(e,u),o(l.useDecoder._baseState.parent===null),l.useDecoder=l.useDecoder._baseState.children[0],l.implicit!==l.useDecoder._baseState.implicit&&(l.useDecoder=l.useDecoder.clone(),l.useDecoder._baseState.implicit=l.implicit),l.useDecoder},c.prototype._decodeChoice=function(e,u){var l=this._baseState,v=null,b=!1;return Object.keys(l.choice).some(function(m){var B=e.save(),E=l.choice[m];try{var S=E._decode(e,u);if(e.isError(S))return!1;v={type:m,value:S},b=!0}catch{return e.restore(B),!1}return!0},this),b?v:e.error("Choice not matched")},c.prototype._createEncoderBuffer=function(e){return new t(e,this.reporter)},c.prototype._encode=function(e,u,l){var v=this._baseState;if(!(v.default!==null&&v.default===e)){var b=this._encodeValue(e,u,l);if(b!==void 0&&!this._skipDefault(b,u,l))return b}},c.prototype._encodeValue=function(e,u,l){var v=this._baseState;if(v.parent===null)return v.children[0]._encode(e,u||new s);var E=null;if(this.reporter=u,v.optional&&e===void 0)if(v.default!==null)e=v.default;else return;var b=null,m=!1;if(v.any)E=this._createEncoderBuffer(e);else if(v.choice)E=this._encodeChoice(e,u);else if(v.contains)b=this._getUse(v.contains,l)._encode(e,u),m=!0;else if(v.children)b=v.children.map(function(D){if(D._baseState.tag==="null_")return D._encode(null,u,e);if(D._baseState.key===null)return u.error("Child should have a key");var $=u.enterKey(D._baseState.key);if(typeof e!="object")return u.error("Child expected, but input is not object");var H=D._encode(e[D._baseState.key],u,e);return u.leaveKey($),H},this).filter(function(D){return D}),b=this._createEncoderBuffer(b);else if(v.tag==="seqof"||v.tag==="setof"){if(!(v.args&&v.args.length===1))return u.error("Too many args for : "+v.tag);if(!Array.isArray(e))return u.error("seqof/setof, but data is not Array");var B=this.clone();B._baseState.implicit=null,b=this._createEncoderBuffer(e.map(function(D){var $=this._baseState;return this._getUse($.args[0],e)._encode(D,u)},B))}else v.use!==null?E=this._getUse(v.use,l)._encode(e,u):(b=this._encodePrimitive(v.tag,e),m=!0);var E;if(!v.any&&v.choice===null){var S=v.implicit!==null?v.implicit:v.tag,O=v.implicit===null?"universal":"context";S===null?v.use===null&&u.error("Tag could be omitted only for .use()"):v.use===null&&(E=this._encodeComposite(S,m,O,b))}return v.explicit!==null&&(E=this._encodeComposite(v.explicit,!1,"context",E)),E},c.prototype._encodeChoice=function(e,u){var l=this._baseState,v=l.choice[e.type];return v||o(!1,e.type+" not found in "+JSON.stringify(Object.keys(l.choice))),v._encode(e.value,u)},c.prototype._encodePrimitive=function(e,u){var l=this._baseState;if(/str$/.test(e))return this._encodeStr(u,e);if(e==="objid"&&l.args)return this._encodeObjid(u,l.reverseArgs[0],l.args[1]);if(e==="objid")return this._encodeObjid(u,null,null);if(e==="gentime"||e==="utctime")return this._encodeTime(u,e);if(e==="null_")return this._encodeNull();if(e==="int"||e==="enum")return this._encodeInt(u,l.args&&l.reverseArgs[0]);if(e==="bool")return this._encodeBool(u);if(e==="objDesc")return this._encodeStr(u,e);throw new Error("Unsupported tag: "+e)},c.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},c.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)},node}var hasRequiredBase;function requireBase(){return hasRequiredBase||(hasRequiredBase=1,(function(s){var t=s;t.Reporter=requireReporter().Reporter,t.DecoderBuffer=requireBuffer().DecoderBuffer,t.EncoderBuffer=requireBuffer().EncoderBuffer,t.Node=requireNode()})(base)),base}var constants={},der={},hasRequiredDer$2;function requireDer$2(){return hasRequiredDer$2||(hasRequiredDer$2=1,(function(s){var t=requireConstants();s.tagClass={0:"universal",1:"application",2:"context",3:"private"},s.tagClassByName=t._reverse(s.tagClass),s.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"},s.tagByName=t._reverse(s.tag)})(der)),der}var hasRequiredConstants;function requireConstants(){return hasRequiredConstants||(hasRequiredConstants=1,(function(s){var t=s;t._reverse=function(o){var d={};return Object.keys(o).forEach(function(r){(r|0)==r&&(r=r|0);var h=o[r];d[h]=r}),d},t.der=requireDer$2()})(constants)),constants}var decoders={},der_1$1,hasRequiredDer$1;function requireDer$1(){if(hasRequiredDer$1)return der_1$1;hasRequiredDer$1=1;var s=requireInherits_browser(),t=requireAsn1$1(),f=t.base,o=t.bignum,d=t.constants.der;function r(a){this.enc="der",this.name=a.name,this.entity=a,this.tree=new h,this.tree._init(a.body)}der_1$1=r,r.prototype.decode=function(e,u){return e instanceof f.DecoderBuffer||(e=new f.DecoderBuffer(e,u)),this.tree._decode(e,u)};function h(a){f.Node.call(this,"der",a)}s(h,f.Node),h.prototype._peekTag=function(e,u,l){if(e.isEmpty())return!1;var v=e.save(),b=c(e,'Failed to peek tag: "'+u+'"');return e.isError(b)?b:(e.restore(v),b.tag===u||b.tagStr===u||b.tagStr+"of"===u||l)},h.prototype._decodeTag=function(e,u,l){var v=c(e,'Failed to decode tag of "'+u+'"');if(e.isError(v))return v;var b=n(e,v.primitive,'Failed to get length of "'+u+'"');if(e.isError(b))return b;if(!l&&v.tag!==u&&v.tagStr!==u&&v.tagStr+"of"!==u)return e.error('Failed to match tag: "'+u+'"');if(v.primitive||b!==null)return e.skip(b,'Failed to match body of: "'+u+'"');var m=e.save(),B=this._skipUntilEnd(e,'Failed to skip indefinite length body: "'+this.tag+'"');return e.isError(B)?B:(b=e.offset-m.offset,e.restore(m),e.skip(b,'Failed to match body of: "'+u+'"'))},h.prototype._skipUntilEnd=function(e,u){for(;;){var l=c(e,u);if(e.isError(l))return l;var v=n(e,l.primitive,u);if(e.isError(v))return v;var b;if(l.primitive||v!==null?b=e.skip(v):b=this._skipUntilEnd(e,u),e.isError(b))return b;if(l.tagStr==="end")break}},h.prototype._decodeList=function(e,u,l,v){for(var b=[];!e.isEmpty();){var m=this._peekTag(e,"end");if(e.isError(m))return m;var B=l.decode(e,"der",v);if(e.isError(B)&&m)break;b.push(B)}return b},h.prototype._decodeStr=function(e,u){if(u==="bitstr"){var l=e.readUInt8();return e.isError(l)?l:{unused:l,data:e.raw()}}else if(u==="bmpstr"){var v=e.raw();if(v.length%2===1)return e.error("Decoding of string type: bmpstr length mismatch");for(var b="",m=0;m<v.length/2;m++)b+=String.fromCharCode(v.readUInt16BE(m*2));return b}else if(u==="numstr"){var B=e.raw().toString("ascii");return this._isNumstr(B)?B:e.error("Decoding of string type: numstr unsupported characters")}else{if(u==="octstr")return e.raw();if(u==="objDesc")return e.raw();if(u==="printstr"){var E=e.raw().toString("ascii");return this._isPrintstr(E)?E:e.error("Decoding of string type: printstr unsupported characters")}else return/str$/.test(u)?e.raw().toString():e.error("Decoding of string type: "+u+" unsupported")}},h.prototype._decodeObjid=function(e,u,l){for(var v,b=[],m=0;!e.isEmpty();){var B=e.readUInt8();m<<=7,m|=B&127,(B&128)===0&&(b.push(m),m=0)}B&128&&b.push(m);var E=b[0]/40|0,S=b[0]%40;if(l?v=b:v=[E,S].concat(b.slice(1)),u){var O=u[v.join(" ")];O===void 0&&(O=u[v.join(".")]),O!==void 0&&(v=O)}return v},h.prototype._decodeTime=function(e,u){var l=e.raw().toString();if(u==="gentime")var v=l.slice(0,4)|0,b=l.slice(4,6)|0,m=l.slice(6,8)|0,B=l.slice(8,10)|0,E=l.slice(10,12)|0,S=l.slice(12,14)|0;else if(u==="utctime"){var v=l.slice(0,2)|0,b=l.slice(2,4)|0,m=l.slice(4,6)|0,B=l.slice(6,8)|0,E=l.slice(8,10)|0,S=l.slice(10,12)|0;v<70?v=2e3+v:v=1900+v}else return e.error("Decoding "+u+" time is not supported yet");return Date.UTC(v,b-1,m,B,E,S,0)},h.prototype._decodeNull=function(e){return null},h.prototype._decodeBool=function(e){var u=e.readUInt8();return e.isError(u)?u:u!==0},h.prototype._decodeInt=function(e,u){var l=e.raw(),v=new o(l);return u&&(v=u[v.toString(10)]||v),v},h.prototype._use=function(e,u){return typeof e=="function"&&(e=e(u)),e._getDecoder("der").tree};function c(a,e){var u=a.readUInt8(e);if(a.isError(u))return u;var l=d.tagClass[u>>6],v=(u&32)===0;if((u&31)===31){var b=u;for(u=0;(b&128)===128;){if(b=a.readUInt8(e),a.isError(b))return b;u<<=7,u|=b&127}}else u&=31;var m=d.tag[u];return{cls:l,primitive:v,tag:u,tagStr:m}}function n(a,e,u){var l=a.readUInt8(u);if(a.isError(l))return l;if(!e&&l===128)return null;if((l&128)===0)return l;var v=l&127;if(v>4)return a.error("length octect is too long");l=0;for(var b=0;b<v;b++){l<<=8;var m=a.readUInt8(u);if(a.isError(m))return m;l|=m}return l}return der_1$1}var pem$1,hasRequiredPem$1;function requirePem$1(){if(hasRequiredPem$1)return pem$1;hasRequiredPem$1=1;var s=requireInherits_browser(),t=requireDist().Buffer,f=requireDer$1();function o(d){f.call(this,d),this.enc="pem"}return s(o,f),pem$1=o,o.prototype.decode=function(r,h){for(var c=r.toString().split(/[\r\n]+/g),n=h.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/,e=-1,u=-1,l=0;l<c.length;l++){var v=c[l].match(a);if(v!==null&&v[2]===n)if(e===-1){if(v[1]!=="BEGIN")break;e=l}else{if(v[1]!=="END")break;u=l;break}}if(e===-1||u===-1)throw new Error("PEM section not found for: "+n);var b=c.slice(e+1,u).join("");b.replace(/[^a-z0-9\+\/=]+/gi,"");var m=new t(b,"base64");return f.prototype.decode.call(this,m,h)},pem$1}var hasRequiredDecoders;function requireDecoders(){return hasRequiredDecoders||(hasRequiredDecoders=1,(function(s){var t=s;t.der=requireDer$1(),t.pem=requirePem$1()})(decoders)),decoders}var encoders={},der_1,hasRequiredDer;function requireDer(){if(hasRequiredDer)return der_1;hasRequiredDer=1;var s=requireInherits_browser(),t=requireDist().Buffer,f=requireAsn1$1(),o=f.base,d=f.constants.der;function r(a){this.enc="der",this.name=a.name,this.entity=a,this.tree=new h,this.tree._init(a.body)}der_1=r,r.prototype.encode=function(e,u){return this.tree._encode(e,u).join()};function h(a){o.Node.call(this,"der",a)}s(h,o.Node),h.prototype._encodeComposite=function(e,u,l,v){var b=n(e,u,l,this.reporter);if(v.length<128){var E=new t(2);return E[0]=b,E[1]=v.length,this._createEncoderBuffer([E,v])}for(var m=1,B=v.length;B>=256;B>>=8)m++;var E=new t(2+m);E[0]=b,E[1]=128|m;for(var B=1+m,S=v.length;S>0;B--,S>>=8)E[B]=S&255;return this._createEncoderBuffer([E,v])},h.prototype._encodeStr=function(e,u){if(u==="bitstr")return this._createEncoderBuffer([e.unused|0,e.data]);if(u==="bmpstr"){for(var l=new t(e.length*2),v=0;v<e.length;v++)l.writeUInt16BE(e.charCodeAt(v),v*2);return this._createEncoderBuffer(l)}else return u==="numstr"?this._isNumstr(e)?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: numstr supports only digits and space"):u==="printstr"?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(u)?this._createEncoderBuffer(e):u==="objDesc"?this._createEncoderBuffer(e):this.reporter.error("Encoding of string type: "+u+" unsupported")},h.prototype._encodeObjid=function(e,u,l){if(typeof e=="string"){if(!u)return this.reporter.error("string objid given, but no values map found");if(!u.hasOwnProperty(e))return this.reporter.error("objid not found in values map");e=u[e].split(/[\s\.]+/g);for(var v=0;v<e.length;v++)e[v]|=0}else if(Array.isArray(e)){e=e.slice();for(var v=0;v<e.length;v++)e[v]|=0}if(!Array.isArray(e))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(e));if(!l){if(e[1]>=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,e[0]*40+e[1])}for(var b=0,v=0;v<e.length;v++){var m=e[v];for(b++;m>=128;m>>=7)b++}for(var B=new t(b),E=B.length-1,v=e.length-1;v>=0;v--){var m=e[v];for(B[E--]=m&127;(m>>=7)>0;)B[E--]=128|m&127}return this._createEncoderBuffer(B)};function c(a){return a<10?"0"+a:a}h.prototype._encodeTime=function(e,u){var l,v=new Date(e);return u==="gentime"?l=[c(v.getFullYear()),c(v.getUTCMonth()+1),c(v.getUTCDate()),c(v.getUTCHours()),c(v.getUTCMinutes()),c(v.getUTCSeconds()),"Z"].join(""):u==="utctime"?l=[c(v.getFullYear()%100),c(v.getUTCMonth()+1),c(v.getUTCDate()),c(v.getUTCHours()),c(v.getUTCMinutes()),c(v.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+u+" time is not supported yet"),this._encodeStr(l,"octstr")},h.prototype._encodeNull=function(){return this._createEncoderBuffer("")},h.prototype._encodeInt=function(e,u){if(typeof e=="string"){if(!u)return this.reporter.error("String int or enum given, but no values map");if(!u.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=u[e]}if(typeof e!="number"&&!t.isBuffer(e)){var l=e.toArray();!e.sign&&l[0]&128&&l.unshift(0),e=new t(l)}if(t.isBuffer(e)){var v=e.length;e.length===0&&v++;var m=new t(v);return e.copy(m),e.length===0&&(m[0]=0),this._createEncoderBuffer(m)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);for(var v=1,b=e;b>=256;b>>=8)v++;for(var m=new Array(v),b=m.length-1;b>=0;b--)m[b]=e&255,e>>=8;return m[0]&128&&m.unshift(0),this._createEncoderBuffer(new t(m))},h.prototype._encodeBool=function(e){return this._createEncoderBuffer(e?255:0)},h.prototype._use=function(e,u){return typeof e=="function"&&(e=e(u)),e._getEncoder("der").tree},h.prototype._skipDefault=function(e,u,l){var v=this._baseState,b;if(v.default===null)return!1;var m=e.join();if(v.defaultBuffer===void 0&&(v.defaultBuffer=this._encodeValue(v.default,u,l).join()),m.length!==v.defaultBuffer.length)return!1;for(b=0;b<m.length;b++)if(m[b]!==v.defaultBuffer[b])return!1;return!0};function n(a,e,u,l){var v;if(a==="seqof"?a="seq":a==="setof"&&(a="set"),d.tagByName.hasOwnProperty(a))v=d.tagByName[a];else if(typeof a=="number"&&(a|0)===a)v=a;else return l.error("Unknown tag: "+a);return v>=31?l.error("Multi-octet tag encoding unsupported"):(e||(v|=32),v|=d.tagClassByName[u||"universal"]<<6,v)}return der_1}var pem,hasRequiredPem;function requirePem(){if(hasRequiredPem)return pem;hasRequiredPem=1;var s=requireInherits_browser(),t=requireDer();function f(o){t.call(this,o),this.enc="pem"}return s(f,t),pem=f,f.prototype.encode=function(d,r){for(var h=t.prototype.encode.call(this,d),c=h.toString("base64"),n=["-----BEGIN "+r.label+"-----"],a=0;a<c.length;a+=64)n.push(c.slice(a,a+64));return n.push("-----END "+r.label+"-----"),n.join(`
|
|
14
|
+
`)},pem}var hasRequiredEncoders;function requireEncoders(){return hasRequiredEncoders||(hasRequiredEncoders=1,(function(s){var t=s;t.der=requireDer(),t.pem=requirePem()})(encoders)),encoders}var hasRequiredAsn1$1;function requireAsn1$1(){return hasRequiredAsn1$1||(hasRequiredAsn1$1=1,(function(s){var t=s;t.bignum=requireBn$1(),t.define=requireApi().define,t.base=requireBase(),t.constants=requireConstants(),t.decoders=requireDecoders(),t.encoders=requireEncoders()})(asn1)),asn1}var certificate,hasRequiredCertificate;function requireCertificate(){if(hasRequiredCertificate)return certificate;hasRequiredCertificate=1;var s=requireAsn1$1(),t=s.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),f=s.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),o=s.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),d=s.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())}),r=s.define("RelativeDistinguishedName",function(){this.setof(f)}),h=s.define("RDNSequence",function(){this.seqof(r)}),c=s.define("Name",function(){this.choice({rdnSequence:this.use(h)})}),n=s.define("Validity",function(){this.seq().obj(this.key("notBefore").use(t),this.key("notAfter").use(t))}),a=s.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),e=s.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(o),this.key("issuer").use(c),this.key("validity").use(n),this.key("subject").use(c),this.key("subjectPublicKeyInfo").use(d),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(a).optional())}),u=s.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(e),this.key("signatureAlgorithm").use(o),this.key("signatureValue").bitstr())});return certificate=u,certificate}var hasRequiredAsn1;function requireAsn1(){if(hasRequiredAsn1)return asn1$1;hasRequiredAsn1=1;var s=requireAsn1$1();asn1$1.certificate=requireCertificate();var t=s.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())});asn1$1.RSAPrivateKey=t;var f=s.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});asn1$1.RSAPublicKey=f;var o=s.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())}),d=s.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(o),this.key("subjectPublicKey").bitstr())});asn1$1.PublicKey=d;var r=s.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(o),this.key("subjectPrivateKey").octstr())});asn1$1.PrivateKey=r;var h=s.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())});asn1$1.EncryptedPrivateKey=h;var c=s.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())});asn1$1.DSAPrivateKey=c,asn1$1.DSAparam=s.define("DSAparam",function(){this.int()});var n=s.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),a=s.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(n),this.key("publicKey").optional().explicit(1).bitstr())});return asn1$1.ECPrivateKey=a,asn1$1.signature=s.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())}),asn1$1}const require$$1={"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"};var fixProc,hasRequiredFixProc;function requireFixProc(){if(hasRequiredFixProc)return fixProc;hasRequiredFixProc=1;var s=/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,t=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,f=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,o=requireEvp_bytestokey(),d=requireBrowser$6(),r=requireSafeBuffer$1().Buffer;return fixProc=function(h,c){var n=h.toString(),a=n.match(s),e;if(a){var l="aes"+a[1],v=r.from(a[2],"hex"),b=r.from(a[3].replace(/[\r\n]/g,""),"base64"),m=o(c,v.slice(0,8),parseInt(a[1],10)).key,B=[],E=d.createDecipheriv(l,m,v);B.push(E.update(b)),B.push(E.final()),e=r.concat(B)}else{var u=n.match(f);e=r.from(u[2].replace(/[\r\n]/g,""),"base64")}var S=n.match(t)[1];return{tag:S,data:e}},fixProc}var parseAsn1,hasRequiredParseAsn1;function requireParseAsn1(){if(hasRequiredParseAsn1)return parseAsn1;hasRequiredParseAsn1=1;var s=requireAsn1(),t=require$$1,f=requireFixProc(),o=requireBrowser$6(),d=requireBrowser$7().pbkdf2Sync,r=requireSafeBuffer$1().Buffer;function h(n,a){var e=n.algorithm.decrypt.kde.kdeparams.salt,u=parseInt(n.algorithm.decrypt.kde.kdeparams.iters.toString(),10),l=t[n.algorithm.decrypt.cipher.algo.join(".")],v=n.algorithm.decrypt.cipher.iv,b=n.subjectPrivateKey,m=parseInt(l.split("-")[1],10)/8,B=d(a,e,u,m,"sha1"),E=o.createDecipheriv(l,B,v),S=[];return S.push(E.update(b)),S.push(E.final()),r.concat(S)}function c(n){var a;typeof n=="object"&&!r.isBuffer(n)&&(a=n.passphrase,n=n.key),typeof n=="string"&&(n=r.from(n));var e=f(n,a),u=e.tag,l=e.data,v,b;switch(u){case"CERTIFICATE":b=s.certificate.decode(l,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(b||(b=s.PublicKey.decode(l,"der")),v=b.algorithm.algorithm.join("."),v){case"1.2.840.113549.1.1.1":return s.RSAPublicKey.decode(b.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return b.subjectPrivateKey=b.subjectPublicKey,{type:"ec",data:b};case"1.2.840.10040.4.1":return b.algorithm.params.pub_key=s.DSAparam.decode(b.subjectPublicKey.data,"der"),{type:"dsa",data:b.algorithm.params};default:throw new Error("unknown key id "+v)}case"ENCRYPTED PRIVATE KEY":l=s.EncryptedPrivateKey.decode(l,"der"),l=h(l,a);case"PRIVATE KEY":switch(b=s.PrivateKey.decode(l,"der"),v=b.algorithm.algorithm.join("."),v){case"1.2.840.113549.1.1.1":return s.RSAPrivateKey.decode(b.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:b.algorithm.curve,privateKey:s.ECPrivateKey.decode(b.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return b.algorithm.params.priv_key=s.DSAparam.decode(b.subjectPrivateKey,"der"),{type:"dsa",params:b.algorithm.params};default:throw new Error("unknown key id "+v)}case"RSA PUBLIC KEY":return s.RSAPublicKey.decode(l,"der");case"RSA PRIVATE KEY":return s.RSAPrivateKey.decode(l,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:s.DSAPrivateKey.decode(l,"der")};case"EC PRIVATE KEY":return l=s.ECPrivateKey.decode(l,"der"),{curve:l.parameters.value,privateKey:l.privateKey};default:throw new Error("unknown key type "+u)}}return c.signature=s.signature,parseAsn1=c,parseAsn1}const require$$4={"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"};var hasRequiredSign;function requireSign(){if(hasRequiredSign)return sign.exports;hasRequiredSign=1;var s=requireSafeBuffer$1().Buffer,t=requireBrowser$8(),f=requireBrowserifyRsa(),o=requireElliptic().ec,d=requireBn(),r=requireParseAsn1(),h=require$$4,c=1;function n(E,S,O,D,$){var H=r(S);if(H.curve){if(D!=="ecdsa"&&D!=="ecdsa/rsa")throw new Error("wrong private key type");return a(E,H)}else if(H.type==="dsa"){if(D!=="dsa")throw new Error("wrong private key type");return e(E,H,O)}if(D!=="rsa"&&D!=="ecdsa/rsa")throw new Error("wrong private key type");if(S.padding!==void 0&&S.padding!==c)throw new Error("illegal or unsupported padding mode");E=s.concat([$,E]);for(var Y=H.modulus.byteLength(),ie=[0,1];E.length+ie.length+1<Y;)ie.push(255);ie.push(0);for(var ne=-1;++ne<E.length;)ie.push(E[ne]);var de=f(ie,H);return de}function a(E,S){var O=h[S.curve.join(".")];if(!O)throw new Error("unknown curve "+S.curve.join("."));var D=new o(O),$=D.keyFromPrivate(S.privateKey),H=$.sign(E);return s.from(H.toDER())}function e(E,S,O){for(var D=S.params.priv_key,$=S.params.p,H=S.params.q,Y=S.params.g,ie=new d(0),ne,de=v(E,H).mod(H),X=!1,y=l(D,H,E,O);X===!1;)ne=m(H,y,O),ie=B(Y,ne,$,H),X=ne.invm(H).imul(de.add(D.mul(ie))).mod(H),X.cmpn(0)===0&&(X=!1,ie=new d(0));return u(ie,X)}function u(E,S){E=E.toArray(),S=S.toArray(),E[0]&128&&(E=[0].concat(E)),S[0]&128&&(S=[0].concat(S));var O=E.length+S.length+4,D=[48,O,2,E.length];return D=D.concat(E,[2,S.length],S),s.from(D)}function l(E,S,O,D){if(E=s.from(E.toArray()),E.length<S.byteLength()){var $=s.alloc(S.byteLength()-E.length);E=s.concat([$,E])}var H=O.length,Y=b(O,S),ie=s.alloc(H);ie.fill(1);var ne=s.alloc(H);return ne=t(D,ne).update(ie).update(s.from([0])).update(E).update(Y).digest(),ie=t(D,ne).update(ie).digest(),ne=t(D,ne).update(ie).update(s.from([1])).update(E).update(Y).digest(),ie=t(D,ne).update(ie).digest(),{k:ne,v:ie}}function v(E,S){var O=new d(E),D=(E.length<<3)-S.bitLength();return D>0&&O.ishrn(D),O}function b(E,S){E=v(E,S),E=E.mod(S);var O=s.from(E.toArray());if(O.length<S.byteLength()){var D=s.alloc(S.byteLength()-O.length);O=s.concat([D,O])}return O}function m(E,S,O){var D,$;do{for(D=s.alloc(0);D.length*8<E.bitLength();)S.v=t(O,S.k).update(S.v).digest(),D=s.concat([D,S.v]);$=v(D,E),S.k=t(O,S.k).update(S.v).update(s.from([0])).digest(),S.v=t(O,S.k).update(S.v).digest()}while($.cmp(E)!==-1);return $}function B(E,S,O,D){return E.toRed(d.mont(O)).redPow(S).fromRed().mod(D)}return sign.exports=n,sign.exports.getKey=l,sign.exports.makeKey=m,sign.exports}var verify_1,hasRequiredVerify;function requireVerify(){if(hasRequiredVerify)return verify_1;hasRequiredVerify=1;var s=requireSafeBuffer$1().Buffer,t=requireBn(),f=requireElliptic().ec,o=requireParseAsn1(),d=require$$4;function r(a,e,u,l,v){var b=o(u);if(b.type==="ec"){if(l!=="ecdsa"&&l!=="ecdsa/rsa")throw new Error("wrong public key type");return h(a,e,b)}else if(b.type==="dsa"){if(l!=="dsa")throw new Error("wrong public key type");return c(a,e,b)}if(l!=="rsa"&&l!=="ecdsa/rsa")throw new Error("wrong public key type");e=s.concat([v,e]);for(var m=b.modulus.byteLength(),B=[1],E=0;e.length+B.length+2<m;)B.push(255),E+=1;B.push(0);for(var S=-1;++S<e.length;)B.push(e[S]);B=s.from(B);var O=t.mont(b.modulus);a=new t(a).toRed(O),a=a.redPow(new t(b.publicExponent)),a=s.from(a.fromRed().toArray());var D=E<8?1:0;for(m=Math.min(a.length,B.length),a.length!==B.length&&(D=1),S=-1;++S<m;)D|=a[S]^B[S];return D===0}function h(a,e,u){var l=d[u.data.algorithm.curve.join(".")];if(!l)throw new Error("unknown curve "+u.data.algorithm.curve.join("."));var v=new f(l),b=u.data.subjectPrivateKey.data;return v.verify(e,a,b)}function c(a,e,u){var l=u.data.p,v=u.data.q,b=u.data.g,m=u.data.pub_key,B=o.signature.decode(a,"der"),E=B.s,S=B.r;n(E,v),n(S,v);var O=t.mont(l),D=E.invm(v),$=b.toRed(O).redPow(new t(e).mul(D).mod(v)).fromRed().mul(m.toRed(O).redPow(S.mul(D).mod(v)).fromRed()).mod(l).mod(v);return $.cmp(S)===0}function n(a,e){if(a.cmpn(0)<=0)throw new Error("invalid sig");if(a.cmp(e)>=0)throw new Error("invalid sig")}return verify_1=r,verify_1}var browser$3,hasRequiredBrowser$3;function requireBrowser$3(){if(hasRequiredBrowser$3)return browser$3;hasRequiredBrowser$3=1;var s=requireSafeBuffer$1().Buffer,t=requireBrowser$9(),f=requireReadableBrowser(),o=requireInherits_browser(),d=requireSign(),r=requireVerify(),h=require$$6;Object.keys(h).forEach(function(u){h[u].id=s.from(h[u].id,"hex"),h[u.toLowerCase()]=h[u]});function c(u){f.Writable.call(this);var l=h[u];if(!l)throw new Error("Unknown message digest");this._hashType=l.hash,this._hash=t(l.hash),this._tag=l.id,this._signType=l.sign}o(c,f.Writable),c.prototype._write=function(l,v,b){this._hash.update(l),b()},c.prototype.update=function(l,v){return this._hash.update(typeof l=="string"?s.from(l,v):l),this},c.prototype.sign=function(l,v){this.end();var b=this._hash.digest(),m=d(b,l,this._hashType,this._signType,this._tag);return v?m.toString(v):m};function n(u){f.Writable.call(this);var l=h[u];if(!l)throw new Error("Unknown message digest");this._hash=t(l.hash),this._tag=l.id,this._signType=l.sign}o(n,f.Writable),n.prototype._write=function(l,v,b){this._hash.update(l),b()},n.prototype.update=function(l,v){return this._hash.update(typeof l=="string"?s.from(l,v):l),this},n.prototype.verify=function(l,v,b){var m=typeof v=="string"?s.from(v,b):v;this.end();var B=this._hash.digest();return r(m,B,l,this._signType,this._tag)};function a(u){return new c(u)}function e(u){return new n(u)}return browser$3={Sign:a,Verify:e,createSign:a,createVerify:e},browser$3}var browser$2,hasRequiredBrowser$2;function requireBrowser$2(){if(hasRequiredBrowser$2)return browser$2;hasRequiredBrowser$2=1;var s=requireElliptic(),t=requireBn$1();browser$2=function(h){return new o(h)};var f={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}};f.p224=f.secp224r1,f.p256=f.secp256r1=f.prime256v1,f.p192=f.secp192r1=f.prime192v1,f.p384=f.secp384r1,f.p521=f.secp521r1;function o(r){this.curveType=f[r],this.curveType||(this.curveType={name:r}),this.curve=new s.ec(this.curveType.name),this.keys=void 0}o.prototype.generateKeys=function(r,h){return this.keys=this.curve.genKeyPair(),this.getPublicKey(r,h)},o.prototype.computeSecret=function(r,h,c){h=h||"utf8",Buffer.isBuffer(r)||(r=new Buffer(r,h));var n=this.curve.keyFromPublic(r).getPublic(),a=n.mul(this.keys.getPrivate()).getX();return d(a,c,this.curveType.byteLength)},o.prototype.getPublicKey=function(r,h){var c=this.keys.getPublic(h==="compressed",!0);return h==="hybrid"&&(c[c.length-1]%2?c[0]=7:c[0]=6),d(c,r)},o.prototype.getPrivateKey=function(r){return d(this.keys.getPrivate(),r)},o.prototype.setPublicKey=function(r,h){return h=h||"utf8",Buffer.isBuffer(r)||(r=new Buffer(r,h)),this.keys._importPublic(r),this},o.prototype.setPrivateKey=function(r,h){h=h||"utf8",Buffer.isBuffer(r)||(r=new Buffer(r,h));var c=new t(r);return c=c.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(c),this};function d(r,h,c){Array.isArray(r)||(r=r.toArray());var n=new Buffer(r);if(c&&n.length<c){var a=new Buffer(c-n.length);a.fill(0),n=Buffer.concat([a,n])}return h?n.toString(h):n}return browser$2}var browser$1={},mgf,hasRequiredMgf;function requireMgf(){if(hasRequiredMgf)return mgf;hasRequiredMgf=1;var s=requireBrowser$9(),t=requireSafeBuffer$1().Buffer;mgf=function(o,d){for(var r=t.alloc(0),h=0,c;r.length<d;)c=f(h++),r=t.concat([r,s("sha1").update(o).update(c).digest()]);return r.slice(0,d)};function f(o){var d=t.allocUnsafe(4);return d.writeUInt32BE(o,0),d}return mgf}var xor,hasRequiredXor;function requireXor(){return hasRequiredXor||(hasRequiredXor=1,xor=function(t,f){for(var o=t.length,d=-1;++d<o;)t[d]^=f[d];return t}),xor}var withPublic_1,hasRequiredWithPublic;function requireWithPublic(){if(hasRequiredWithPublic)return withPublic_1;hasRequiredWithPublic=1;var s=requireBn$1(),t=requireSafeBuffer$1().Buffer;function f(o,d){return t.from(o.toRed(s.mont(d.modulus)).redPow(new s(d.publicExponent)).fromRed().toArray())}return withPublic_1=f,withPublic_1}var publicEncrypt,hasRequiredPublicEncrypt;function requirePublicEncrypt(){if(hasRequiredPublicEncrypt)return publicEncrypt;hasRequiredPublicEncrypt=1;var s=requireParseAsn1(),t=requireBrowser$b(),f=requireBrowser$9(),o=requireMgf(),d=requireXor(),r=requireBn$1(),h=requireWithPublic(),c=requireBrowserifyRsa(),n=requireSafeBuffer$1().Buffer;publicEncrypt=function(v,b,m){var B;v.padding?B=v.padding:m?B=1:B=4;var E=s(v),S;if(B===4)S=a(E,b);else if(B===1)S=e(E,b,m);else if(B===3){if(S=new r(b),S.cmp(E.modulus)>=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return m?c(S,E):h(S,E)};function a(l,v){var b=l.modulus.byteLength(),m=v.length,B=f("sha1").update(n.alloc(0)).digest(),E=B.length,S=2*E;if(m>b-S-2)throw new Error("message too long");var O=n.alloc(b-m-S-2),D=b-E-1,$=t(E),H=d(n.concat([B,O,n.alloc(1,1),v],D),o($,D)),Y=d($,o(H,E));return new r(n.concat([n.alloc(1),Y,H],b))}function e(l,v,b){var m=v.length,B=l.modulus.byteLength();if(m>B-11)throw new Error("message too long");var E;return b?E=n.alloc(B-m-3,255):E=u(B-m-3),new r(n.concat([n.from([0,b?1:2]),E,n.alloc(1),v],B))}function u(l){for(var v=n.allocUnsafe(l),b=0,m=t(l*2),B=0,E;b<l;)B===m.length&&(m=t(l*2),B=0),E=m[B++],E&&(v[b++]=E);return v}return publicEncrypt}var privateDecrypt,hasRequiredPrivateDecrypt;function requirePrivateDecrypt(){if(hasRequiredPrivateDecrypt)return privateDecrypt;hasRequiredPrivateDecrypt=1;var s=requireParseAsn1(),t=requireMgf(),f=requireXor(),o=requireBn$1(),d=requireBrowserifyRsa(),r=requireBrowser$9(),h=requireWithPublic(),c=requireSafeBuffer$1().Buffer;privateDecrypt=function(l,v,b){var m;l.padding?m=l.padding:b?m=1:m=4;var B=s(l),E=B.modulus.byteLength();if(v.length>E||new o(v).cmp(B.modulus)>=0)throw new Error("decryption error");var S;b?S=h(new o(v),B):S=d(v,B);var O=c.alloc(E-S.length);if(S=c.concat([O,S],E),m===4)return n(B,S);if(m===1)return a(B,S,b);if(m===3)return S;throw new Error("unknown padding")};function n(u,l){var v=u.modulus.byteLength(),b=r("sha1").update(c.alloc(0)).digest(),m=b.length;if(l[0]!==0)throw new Error("decryption error");var B=l.slice(1,m+1),E=l.slice(m+1),S=f(B,t(E,m)),O=f(E,t(S,v-m-1));if(e(b,O.slice(0,m)))throw new Error("decryption error");for(var D=m;O[D]===0;)D++;if(O[D++]!==1)throw new Error("decryption error");return O.slice(D)}function a(u,l,v){for(var b=l.slice(0,2),m=2,B=0;l[m++]!==0;)if(m>=l.length){B++;break}var E=l.slice(2,m-1);if((b.toString("hex")!=="0002"&&!v||b.toString("hex")!=="0001"&&v)&&B++,E.length<8&&B++,B)throw new Error("decryption error");return l.slice(m)}function e(u,l){u=c.from(u),l=c.from(l);var v=0,b=u.length;u.length!==l.length&&(v++,b=Math.min(u.length,l.length));for(var m=-1;++m<b;)v+=u[m]^l[m];return v}return privateDecrypt}var hasRequiredBrowser$1;function requireBrowser$1(){return hasRequiredBrowser$1||(hasRequiredBrowser$1=1,(function(s){s.publicEncrypt=requirePublicEncrypt(),s.privateDecrypt=requirePrivateDecrypt(),s.privateEncrypt=function(f,o){return s.publicEncrypt(f,o,!0)},s.publicDecrypt=function(f,o){return s.privateDecrypt(f,o,!0)}})(browser$1)),browser$1}var browser={},hasRequiredBrowser;function requireBrowser(){if(hasRequiredBrowser)return browser;hasRequiredBrowser=1;function s(){throw new Error(`secure random number generation not supported by this browser
|
|
15
|
+
use chrome, FireFox or Internet Explorer 11`)}var t=requireSafeBuffer$1(),f=requireBrowser$b(),o=t.Buffer,d=t.kMaxLength,r=commonjsGlobal.crypto||commonjsGlobal.msCrypto,h=Math.pow(2,32)-1;function c(l,v){if(typeof l!="number"||l!==l)throw new TypeError("offset must be a number");if(l>h||l<0)throw new TypeError("offset must be a uint32");if(l>d||l>v)throw new RangeError("offset out of range")}function n(l,v,b){if(typeof l!="number"||l!==l)throw new TypeError("size must be a number");if(l>h||l<0)throw new TypeError("size must be a uint32");if(l+v>b||l>d)throw new RangeError("buffer too small")}r&&r.getRandomValues||!process$1.browser?(browser.randomFill=a,browser.randomFillSync=u):(browser.randomFill=s,browser.randomFillSync=s);function a(l,v,b,m){if(!o.isBuffer(l)&&!(l instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof v=="function")m=v,v=0,b=l.length;else if(typeof b=="function")m=b,b=l.length-v;else if(typeof m!="function")throw new TypeError('"cb" argument must be a function');return c(v,l.length),n(b,v,l.length),e(l,v,b,m)}function e(l,v,b,m){if(process$1.browser){var B=l.buffer,E=new Uint8Array(B,v,b);if(r.getRandomValues(E),m){process$1.nextTick(function(){m(null,l)});return}return l}if(m){f(b,function(O,D){if(O)return m(O);D.copy(l,v),m(null,l)});return}var S=f(b);return S.copy(l,v),l}function u(l,v,b){if(typeof v>"u"&&(v=0),!o.isBuffer(l)&&!(l instanceof commonjsGlobal.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return c(v,l.length),b===void 0&&(b=l.length-v),n(b,v,l.length),e(l,v,b)}return browser}var hasRequiredCryptoBrowserify;function requireCryptoBrowserify(){if(hasRequiredCryptoBrowserify)return cryptoBrowserify;hasRequiredCryptoBrowserify=1,cryptoBrowserify.randomBytes=cryptoBrowserify.rng=cryptoBrowserify.pseudoRandomBytes=cryptoBrowserify.prng=requireBrowser$b(),cryptoBrowserify.createHash=cryptoBrowserify.Hash=requireBrowser$9(),cryptoBrowserify.createHmac=cryptoBrowserify.Hmac=requireBrowser$8();var s=requireAlgos(),t=Object.keys(s),f=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(t);cryptoBrowserify.getHashes=function(){return f};var o=requireBrowser$7();cryptoBrowserify.pbkdf2=o.pbkdf2,cryptoBrowserify.pbkdf2Sync=o.pbkdf2Sync;var d=requireBrowser$5();cryptoBrowserify.Cipher=d.Cipher,cryptoBrowserify.createCipher=d.createCipher,cryptoBrowserify.Cipheriv=d.Cipheriv,cryptoBrowserify.createCipheriv=d.createCipheriv,cryptoBrowserify.Decipher=d.Decipher,cryptoBrowserify.createDecipher=d.createDecipher,cryptoBrowserify.Decipheriv=d.Decipheriv,cryptoBrowserify.createDecipheriv=d.createDecipheriv,cryptoBrowserify.getCiphers=d.getCiphers,cryptoBrowserify.listCiphers=d.listCiphers;var r=requireBrowser$4();cryptoBrowserify.DiffieHellmanGroup=r.DiffieHellmanGroup,cryptoBrowserify.createDiffieHellmanGroup=r.createDiffieHellmanGroup,cryptoBrowserify.getDiffieHellman=r.getDiffieHellman,cryptoBrowserify.createDiffieHellman=r.createDiffieHellman,cryptoBrowserify.DiffieHellman=r.DiffieHellman;var h=requireBrowser$3();cryptoBrowserify.createSign=h.createSign,cryptoBrowserify.Sign=h.Sign,cryptoBrowserify.createVerify=h.createVerify,cryptoBrowserify.Verify=h.Verify,cryptoBrowserify.createECDH=requireBrowser$2();var c=requireBrowser$1();cryptoBrowserify.publicEncrypt=c.publicEncrypt,cryptoBrowserify.privateEncrypt=c.privateEncrypt,cryptoBrowserify.publicDecrypt=c.publicDecrypt,cryptoBrowserify.privateDecrypt=c.privateDecrypt;var n=requireBrowser();return cryptoBrowserify.randomFill=n.randomFill,cryptoBrowserify.randomFillSync=n.randomFillSync,cryptoBrowserify.createCredentials=function(){throw new Error(`sorry, createCredentials is not implemented yet
|
|
16
16
|
we accept pull requests
|
|
17
|
-
https://github.com/browserify/crypto-browserify`)},cryptoBrowserify.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},cryptoBrowserify}var hasRequiredUtils;function requireUtils(){return hasRequiredUtils||(hasRequiredUtils=1,requireCryptoBrowserify(),utils$4.linebrk=function(
|
|
18
|
-
`,o+=t;return u+c.substring(o,c.length)},utils$4.detectEnvironment=function(){return typeof window<"u"&&window&&!(process$1&&process$1.title==="node")?"browser":"node"},utils$4.get32IntFromBuffer=function(c,t){t=t||0;var u=0;if((u=c.length-t)>0){if(u>=4)return c.readUIntBE(t,u);for(var o=0,d=t+u,r=0;d>t;d--,r+=2)o+=c[d-1]*Math.pow(16,r);return o}else return NaN},utils$4._={isObject:function(c){var t=typeof c;return!!c&&(t=="object"||t=="function")},isString:function(c){return typeof c=="string"||c instanceof String},isNumber:function(c){return typeof c=="number"||!isNaN(parseFloat(c))&&isFinite(c)},omit:function(c,t){var u={};for(var o in c)!c.hasOwnProperty(o)||o===t||(u[o]=c[o]);return u}},utils$4.trimSurroundingText=function(c,t,u){var o=0,d=c.length,r=c.indexOf(t);r>=0&&(o=r+t.length);var h=c.indexOf(u,r);return h>=0&&(d=h),c.substring(o,d)}),utils$4}var jsbn,hasRequiredJsbn;function requireJsbn(){if(hasRequiredJsbn)return jsbn;hasRequiredJsbn=1;var c=requireCryptoBrowserify(),t=requireUtils()._,u;function o(V,Y){V!=null&&(typeof V=="number"?this.fromNumber(V,Y):Buffer.isBuffer(V)?this.fromBuffer(V):Y==null&&typeof V!="string"?this.fromByteArray(V):this.fromString(V,Y))}function d(){return new o(null)}function r(V,Y,te,he,Ee,Ae){for(var Pe=Y&16383,De=Y>>14;--Ae>=0;){var tr=this[V]&16383,ir=this[V++]>>14,Er=De*tr+ir*Pe;tr=Pe*tr+((Er&16383)<<14)+te[he]+Ee,Ee=(tr>>28)+(Er>>14)+De*ir,te[he++]=tr&268435455}return Ee}o.prototype.am=r,u=28,o.prototype.DB=u,o.prototype.DM=(1<<u)-1,o.prototype.DV=1<<u;var h=52;o.prototype.FV=Math.pow(2,h),o.prototype.F1=h-u,o.prototype.F2=2*u-h;var f="0123456789abcdefghijklmnopqrstuvwxyz",a=new Array,n,e;for(n=48,e=0;e<=9;++e)a[n++]=e;for(n=97,e=10;e<36;++e)a[n++]=e;for(n=65,e=10;e<36;++e)a[n++]=e;function s(V){return f.charAt(V)}function l(V,Y){var te=a[V.charCodeAt(Y)];return te??-1}function v(V){for(var Y=this.t-1;Y>=0;--Y)V[Y]=this[Y];V.t=this.t,V.s=this.s}function b(V){this.t=1,this.s=V<0?-1:0,V>0?this[0]=V:V<-1?this[0]=V+DV:this.t=0}function m(V){var Y=d();return Y.fromInt(V),Y}function q(V,Y,te){var he;switch(Y){case 2:he=1;break;case 4:he=2;break;case 8:he=3;break;case 16:he=4;break;case 32:he=5;break;case 256:he=8;break;default:this.fromRadix(V,Y);return}this.t=0,this.s=0;for(var Ee=V.length,Ae=!1,Pe=0;--Ee>=0;){var De=he==8?V[Ee]&255:l(V,Ee);if(De<0){V.charAt(Ee)=="-"&&(Ae=!0);continue}Ae=!1,Pe===0?this[this.t++]=De:Pe+he>this.DB?(this[this.t-1]|=(De&(1<<this.DB-Pe)-1)<<Pe,this[this.t++]=De>>this.DB-Pe):this[this.t-1]|=De<<Pe,Pe+=he,Pe>=this.DB&&(Pe-=this.DB)}!te&&he==8&&(V[0]&128)!=0&&(this.s=-1,Pe>0&&(this[this.t-1]|=(1<<this.DB-Pe)-1<<Pe)),this.clamp(),Ae&&o.ZERO.subTo(this,this)}function E(V,Y){this.fromString(V,256,Y)}function S(V){this.fromString(V,256,!0)}function O(){for(var V=this.s&this.DM;this.t>0&&this[this.t-1]==V;)--this.t}function D(V){if(this.s<0)return"-"+this.negate().toString(V);var Y;if(V==16)Y=4;else if(V==8)Y=3;else if(V==2)Y=1;else if(V==32)Y=5;else if(V==4)Y=2;else return this.toRadix(V);var te=(1<<Y)-1,he,Ee=!1,Ae="",Pe=this.t,De=this.DB-Pe*this.DB%Y;if(Pe-- >0)for(De<this.DB&&(he=this[Pe]>>De)>0&&(Ee=!0,Ae=s(he));Pe>=0;)De<Y?(he=(this[Pe]&(1<<De)-1)<<Y-De,he|=this[--Pe]>>(De+=this.DB-Y)):(he=this[Pe]>>(De-=Y)&te,De<=0&&(De+=this.DB,--Pe)),he>0&&(Ee=!0),Ee&&(Ae+=s(he));return Ee?Ae:"0"}function j(){var V=d();return o.ZERO.subTo(this,V),V}function $(){return this.s<0?this.negate():this}function J(V){var Y=this.s-V.s;if(Y!=0)return Y;var te=this.t;if(Y=te-V.t,Y!=0)return this.s<0?-Y:Y;for(;--te>=0;)if((Y=this[te]-V[te])!=0)return Y;return 0}function ie(V){var Y=1,te;return(te=V>>>16)!=0&&(V=te,Y+=16),(te=V>>8)!=0&&(V=te,Y+=8),(te=V>>4)!=0&&(V=te,Y+=4),(te=V>>2)!=0&&(V=te,Y+=2),(te=V>>1)!=0&&(V=te,Y+=1),Y}function ne(){return this.t<=0?0:this.DB*(this.t-1)+ie(this[this.t-1]^this.s&this.DM)}function de(V,Y){var te;for(te=this.t-1;te>=0;--te)Y[te+V]=this[te];for(te=V-1;te>=0;--te)Y[te]=0;Y.t=this.t+V,Y.s=this.s}function Z(V,Y){for(var te=V;te<this.t;++te)Y[te-V]=this[te];Y.t=Math.max(this.t-V,0),Y.s=this.s}function y(V,Y){var te=V%this.DB,he=this.DB-te,Ee=(1<<he)-1,Ae=Math.floor(V/this.DB),Pe=this.s<<te&this.DM,De;for(De=this.t-1;De>=0;--De)Y[De+Ae+1]=this[De]>>he|Pe,Pe=(this[De]&Ee)<<te;for(De=Ae-1;De>=0;--De)Y[De]=0;Y[Ae]=Pe,Y.t=this.t+Ae+1,Y.s=this.s,Y.clamp()}function g(V,Y){Y.s=this.s;var te=Math.floor(V/this.DB);if(te>=this.t){Y.t=0;return}var he=V%this.DB,Ee=this.DB-he,Ae=(1<<he)-1;Y[0]=this[te]>>he;for(var Pe=te+1;Pe<this.t;++Pe)Y[Pe-te-1]|=(this[Pe]&Ae)<<Ee,Y[Pe-te]=this[Pe]>>he;he>0&&(Y[this.t-te-1]|=(this.s&Ae)<<Ee),Y.t=this.t-te,Y.clamp()}function p(V,Y){for(var te=0,he=0,Ee=Math.min(V.t,this.t);te<Ee;)he+=this[te]-V[te],Y[te++]=he&this.DM,he>>=this.DB;if(V.t<this.t){for(he-=V.s;te<this.t;)he+=this[te],Y[te++]=he&this.DM,he>>=this.DB;he+=this.s}else{for(he+=this.s;te<V.t;)he-=V[te],Y[te++]=he&this.DM,he>>=this.DB;he-=V.s}Y.s=he<0?-1:0,he<-1?Y[te++]=this.DV+he:he>0&&(Y[te++]=he),Y.t=te,Y.clamp()}function _(V,Y){var te=this.abs(),he=V.abs(),Ee=te.t;for(Y.t=Ee+he.t;--Ee>=0;)Y[Ee]=0;for(Ee=0;Ee<he.t;++Ee)Y[Ee+te.t]=te.am(0,he[Ee],Y,Ee,0,te.t);Y.s=0,Y.clamp(),this.s!=V.s&&o.ZERO.subTo(Y,Y)}function R(V){for(var Y=this.abs(),te=V.t=2*Y.t;--te>=0;)V[te]=0;for(te=0;te<Y.t-1;++te){var he=Y.am(te,Y[te],V,2*te,0,1);(V[te+Y.t]+=Y.am(te+1,2*Y[te],V,2*te+1,he,Y.t-te-1))>=Y.DV&&(V[te+Y.t]-=Y.DV,V[te+Y.t+1]=1)}V.t>0&&(V[V.t-1]+=Y.am(te,Y[te],V,2*te,0,1)),V.s=0,V.clamp()}function B(V,Y,te){var he=V.abs();if(!(he.t<=0)){var Ee=this.abs();if(Ee.t<he.t){Y?.fromInt(0),te!=null&&this.copyTo(te);return}te==null&&(te=d());var Ae=d(),Pe=this.s,De=V.s,tr=this.DB-ie(he[he.t-1]);tr>0?(he.lShiftTo(tr,Ae),Ee.lShiftTo(tr,te)):(he.copyTo(Ae),Ee.copyTo(te));var ir=Ae.t,Er=Ae[ir-1];if(Er!==0){var ar=Er*(1<<this.F1)+(ir>1?Ae[ir-2]>>this.F2:0),Br=this.FV/ar,Ar=(1<<this.F1)/ar,or=1<<this.F2,sr=te.t,Rr=sr-ir,qr=Y??d();for(Ae.dlShiftTo(Rr,qr),te.compareTo(qr)>=0&&(te[te.t++]=1,te.subTo(qr,te)),o.ONE.dlShiftTo(ir,qr),qr.subTo(Ae,Ae);Ae.t<ir;)Ae[Ae.t++]=0;for(;--Rr>=0;){var Mr=te[--sr]==Er?this.DM:Math.floor(te[sr]*Br+(te[sr-1]+or)*Ar);if((te[sr]+=Ae.am(0,Mr,te,Rr,0,ir))<Mr)for(Ae.dlShiftTo(Rr,qr),te.subTo(qr,te);te[sr]<--Mr;)te.subTo(qr,te)}Y!=null&&(te.drShiftTo(ir,Y),Pe!=De&&o.ZERO.subTo(Y,Y)),te.t=ir,te.clamp(),tr>0&&te.rShiftTo(tr,te),Pe<0&&o.ZERO.subTo(te,te)}}}function P(V){var Y=d();return this.abs().divRemTo(V,null,Y),this.s<0&&Y.compareTo(o.ZERO)>0&&V.subTo(Y,Y),Y}function A(V){this.m=V}function w(V){return V.s<0||V.compareTo(this.m)>=0?V.mod(this.m):V}function M(V){return V}function x(V){V.divRemTo(this.m,null,V)}function L(V,Y,te){V.multiplyTo(Y,te),this.reduce(te)}function K(V,Y){V.squareTo(Y),this.reduce(Y)}A.prototype.convert=w,A.prototype.revert=M,A.prototype.reduce=x,A.prototype.mulTo=L,A.prototype.sqrTo=K;function Q(){if(this.t<1)return 0;var V=this[0];if((V&1)===0)return 0;var Y=V&3;return Y=Y*(2-(V&15)*Y)&15,Y=Y*(2-(V&255)*Y)&255,Y=Y*(2-((V&65535)*Y&65535))&65535,Y=Y*(2-V*Y%this.DV)%this.DV,Y>0?this.DV-Y:-Y}function H(V){this.m=V,this.mp=V.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<V.DB-15)-1,this.mt2=2*V.t}function N(V){var Y=d();return V.abs().dlShiftTo(this.m.t,Y),Y.divRemTo(this.m,null,Y),V.s<0&&Y.compareTo(o.ZERO)>0&&this.m.subTo(Y,Y),Y}function F(V){var Y=d();return V.copyTo(Y),this.reduce(Y),Y}function ee(V){for(;V.t<=this.mt2;)V[V.t++]=0;for(var Y=0;Y<this.m.t;++Y){var te=V[Y]&32767,he=te*this.mpl+((te*this.mph+(V[Y]>>15)*this.mpl&this.um)<<15)&V.DM;for(te=Y+this.m.t,V[te]+=this.m.am(0,he,V,Y,0,this.m.t);V[te]>=V.DV;)V[te]-=V.DV,V[++te]++}V.clamp(),V.drShiftTo(this.m.t,V),V.compareTo(this.m)>=0&&V.subTo(this.m,V)}function ae(V,Y){V.squareTo(Y),this.reduce(Y)}function z(V,Y,te){V.multiplyTo(Y,te),this.reduce(te)}H.prototype.convert=N,H.prototype.revert=F,H.prototype.reduce=ee,H.prototype.mulTo=z,H.prototype.sqrTo=ae;function G(){return(this.t>0?this[0]&1:this.s)===0}function fe(V,Y){if(V>4294967295||V<1)return o.ONE;var te=d(),he=d(),Ee=Y.convert(this),Ae=ie(V)-1;for(Ee.copyTo(te);--Ae>=0;)if(Y.sqrTo(te,he),(V&1<<Ae)>0)Y.mulTo(he,Ee,te);else{var Pe=te;te=he,he=Pe}return Y.revert(te)}function me(V,Y){var te;return V<256||Y.isEven()?te=new A(Y):te=new H(Y),this.exp(V,te)}function xe(){var V=d();return this.copyTo(V),V}function _e(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t===0)return-1}else{if(this.t==1)return this[0];if(this.t===0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function qe(){return this.t==0?this.s:this[0]<<24>>24}function Re(){return this.t==0?this.s:this[0]<<16>>16}function be(V){return Math.floor(Math.LN2*this.DB/Math.log(V))}function Fe(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Be(V){if(V==null&&(V=10),this.signum()===0||V<2||V>36)return"0";var Y=this.chunkSize(V),te=Math.pow(V,Y),he=m(te),Ee=d(),Ae=d(),Pe="";for(this.divRemTo(he,Ee,Ae);Ee.signum()>0;)Pe=(te+Ae.intValue()).toString(V).substr(1)+Pe,Ee.divRemTo(he,Ee,Ae);return Ae.intValue().toString(V)+Pe}function Me(V,Y){this.fromInt(0),Y==null&&(Y=10);for(var te=this.chunkSize(Y),he=Math.pow(Y,te),Ee=!1,Ae=0,Pe=0,De=0;De<V.length;++De){var tr=l(V,De);if(tr<0){V.charAt(De)=="-"&&this.signum()===0&&(Ee=!0);continue}Pe=Y*Pe+tr,++Ae>=te&&(this.dMultiply(he),this.dAddOffset(Pe,0),Ae=0,Pe=0)}Ae>0&&(this.dMultiply(Math.pow(Y,Ae)),this.dAddOffset(Pe,0)),Ee&&o.ZERO.subTo(this,this)}function Te(V,Y){if(typeof Y=="number")if(V<2)this.fromInt(1);else for(this.fromNumber(V),this.testBit(V-1)||this.bitwiseTo(o.ONE.shiftLeft(V-1),C,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(Y);)this.dAddOffset(2,0),this.bitLength()>V&&this.subTo(o.ONE.shiftLeft(V-1),this);else{var te=c.randomBytes((V>>3)+1),he=V&7;he>0?te[0]&=(1<<he)-1:te[0]=0,this.fromByteArray(te)}}function oe(){var V=this.t,Y=new Array;Y[0]=this.s;var te=this.DB-V*this.DB%8,he,Ee=0;if(V-- >0)for(te<this.DB&&(he=this[V]>>te)!=(this.s&this.DM)>>te&&(Y[Ee++]=he|this.s<<this.DB-te);V>=0;)te<8?(he=(this[V]&(1<<te)-1)<<8-te,he|=this[--V]>>(te+=this.DB-8)):(he=this[V]>>(te-=8)&255,te<=0&&(te+=this.DB,--V)),(he&128)!=0&&(he|=-256),Ee===0&&(this.s&128)!=(he&128)&&++Ee,(Ee>0||he!=this.s)&&(Y[Ee++]=he);return Y}function ce(V){var Y=Buffer.from(this.toByteArray());if(V===!0&&Y[0]===0)Y=Y.slice(1);else if(t.isNumber(V)){if(Y.length>V){for(var te=0;te<Y.length-V;te++)if(Y[te]!==0)return null;return Y.slice(Y.length-V)}else if(Y.length<V){var he=Buffer.alloc(V);return he.fill(0,0,V-Y.length),Y.copy(he,V-Y.length),he}}return Y}function ge(V){return this.compareTo(V)==0}function we(V){return this.compareTo(V)<0?this:V}function Se(V){return this.compareTo(V)>0?this:V}function Oe(V,Y,te){var he,Ee,Ae=Math.min(V.t,this.t);for(he=0;he<Ae;++he)te[he]=Y(this[he],V[he]);if(V.t<this.t){for(Ee=V.s&this.DM,he=Ae;he<this.t;++he)te[he]=Y(this[he],Ee);te.t=this.t}else{for(Ee=this.s&this.DM,he=Ae;he<V.t;++he)te[he]=Y(Ee,V[he]);te.t=V.t}te.s=Y(this.s,V.s),te.clamp()}function U(V,Y){return V&Y}function I(V){var Y=d();return this.bitwiseTo(V,U,Y),Y}function C(V,Y){return V|Y}function X(V){var Y=d();return this.bitwiseTo(V,C,Y),Y}function se(V,Y){return V^Y}function le(V){var Y=d();return this.bitwiseTo(V,se,Y),Y}function ve(V,Y){return V&~Y}function Ce(V){var Y=d();return this.bitwiseTo(V,ve,Y),Y}function Le(){for(var V=d(),Y=0;Y<this.t;++Y)V[Y]=this.DM&~this[Y];return V.t=this.t,V.s=~this.s,V}function Ie(V){var Y=d();return V<0?this.rShiftTo(-V,Y):this.lShiftTo(V,Y),Y}function $e(V){var Y=d();return V<0?this.lShiftTo(-V,Y):this.rShiftTo(V,Y),Y}function je(V){if(V===0)return-1;var Y=0;return(V&65535)===0&&(V>>=16,Y+=16),(V&255)===0&&(V>>=8,Y+=8),(V&15)===0&&(V>>=4,Y+=4),(V&3)===0&&(V>>=2,Y+=2),(V&1)===0&&++Y,Y}function He(){for(var V=0;V<this.t;++V)if(this[V]!=0)return V*this.DB+je(this[V]);return this.s<0?this.t*this.DB:-1}function Ke(V){for(var Y=0;V!=0;)V&=V-1,++Y;return Y}function Ze(){for(var V=0,Y=this.s&this.DM,te=0;te<this.t;++te)V+=Ke(this[te]^Y);return V}function We(V){var Y=Math.floor(V/this.DB);return Y>=this.t?this.s!=0:(this[Y]&1<<V%this.DB)!=0}function Ye(V,Y){var te=o.ONE.shiftLeft(V);return this.bitwiseTo(te,Y,te),te}function Xe(V){return this.changeBit(V,C)}function W(V){return this.changeBit(V,ve)}function T(V){return this.changeBit(V,se)}function k(V,Y){for(var te=0,he=0,Ee=Math.min(V.t,this.t);te<Ee;)he+=this[te]+V[te],Y[te++]=he&this.DM,he>>=this.DB;if(V.t<this.t){for(he+=V.s;te<this.t;)he+=this[te],Y[te++]=he&this.DM,he>>=this.DB;he+=this.s}else{for(he+=this.s;te<V.t;)he+=V[te],Y[te++]=he&this.DM,he>>=this.DB;he+=V.s}Y.s=he<0?-1:0,he>0?Y[te++]=he:he<-1&&(Y[te++]=this.DV+he),Y.t=te,Y.clamp()}function re(V){var Y=d();return this.addTo(V,Y),Y}function ue(V){var Y=d();return this.subTo(V,Y),Y}function pe(V){var Y=d();return this.multiplyTo(V,Y),Y}function ye(){var V=d();return this.squareTo(V),V}function ke(V){var Y=d();return this.divRemTo(V,Y,null),Y}function Ve(V){var Y=d();return this.divRemTo(V,null,Y),Y}function Ne(V){var Y=d(),te=d();return this.divRemTo(V,Y,te),new Array(Y,te)}function Ge(V){this[this.t]=this.am(0,V-1,this,0,0,this.t),++this.t,this.clamp()}function Ue(V,Y){if(V!==0){for(;this.t<=Y;)this[this.t++]=0;for(this[Y]+=V;this[Y]>=this.DV;)this[Y]-=this.DV,++Y>=this.t&&(this[this.t++]=0),++this[Y]}}function ze(){}function Je(V){return V}function Qe(V,Y,te){V.multiplyTo(Y,te)}function er(V,Y){V.squareTo(Y)}ze.prototype.convert=Je,ze.prototype.revert=Je,ze.prototype.mulTo=Qe,ze.prototype.sqrTo=er;function fr(V){return this.exp(V,new ze)}function ur(V,Y,te){var he=Math.min(this.t+V.t,Y);for(te.s=0,te.t=he;he>0;)te[--he]=0;var Ee;for(Ee=te.t-this.t;he<Ee;++he)te[he+this.t]=this.am(0,V[he],te,he,0,this.t);for(Ee=Math.min(V.t,Y);he<Ee;++he)this.am(0,V[he],te,he,0,Y-he);te.clamp()}function cr(V,Y,te){--Y;var he=te.t=this.t+V.t-Y;for(te.s=0;--he>=0;)te[he]=0;for(he=Math.max(Y-this.t,0);he<V.t;++he)te[this.t+he-Y]=this.am(Y-he,V[he],te,0,0,this.t+he-Y);te.clamp(),te.drShiftTo(1,te)}function nr(V){this.r2=d(),this.q3=d(),o.ONE.dlShiftTo(2*V.t,this.r2),this.mu=this.r2.divide(V),this.m=V}function hr(V){if(V.s<0||V.t>2*this.m.t)return V.mod(this.m);if(V.compareTo(this.m)<0)return V;var Y=d();return V.copyTo(Y),this.reduce(Y),Y}function lr(V){return V}function dr(V){for(V.drShiftTo(this.m.t-1,this.r2),V.t>this.m.t+1&&(V.t=this.m.t+1,V.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);V.compareTo(this.r2)<0;)V.dAddOffset(1,this.m.t+1);for(V.subTo(this.r2,V);V.compareTo(this.m)>=0;)V.subTo(this.m,V)}function pr(V,Y){V.squareTo(Y),this.reduce(Y)}function vr(V,Y,te){V.multiplyTo(Y,te),this.reduce(te)}nr.prototype.convert=hr,nr.prototype.revert=lr,nr.prototype.reduce=dr,nr.prototype.mulTo=vr,nr.prototype.sqrTo=pr;function br(V,Y){var te=V.bitLength(),he,Ee=m(1),Ae;if(te<=0)return Ee;te<18?he=1:te<48?he=3:te<144?he=4:te<768?he=5:he=6,te<8?Ae=new A(Y):Y.isEven()?Ae=new nr(Y):Ae=new H(Y);var Pe=new Array,De=3,tr=he-1,ir=(1<<he)-1;if(Pe[1]=Ae.convert(this),he>1){var Er=d();for(Ae.sqrTo(Pe[1],Er);De<=ir;)Pe[De]=d(),Ae.mulTo(Er,Pe[De-2],Pe[De]),De+=2}var ar=V.t-1,Br,Ar=!0,or=d(),sr;for(te=ie(V[ar])-1;ar>=0;){for(te>=tr?Br=V[ar]>>te-tr&ir:(Br=(V[ar]&(1<<te+1)-1)<<tr-te,ar>0&&(Br|=V[ar-1]>>this.DB+te-tr)),De=he;(Br&1)===0;)Br>>=1,--De;if((te-=De)<0&&(te+=this.DB,--ar),Ar)Pe[Br].copyTo(Ee),Ar=!1;else{for(;De>1;)Ae.sqrTo(Ee,or),Ae.sqrTo(or,Ee),De-=2;De>0?Ae.sqrTo(Ee,or):(sr=Ee,Ee=or,or=sr),Ae.mulTo(or,Pe[Br],Ee)}for(;ar>=0&&(V[ar]&1<<te)===0;)Ae.sqrTo(Ee,or),sr=Ee,Ee=or,or=sr,--te<0&&(te=this.DB-1,--ar)}return Ae.revert(Ee)}function yr(V){var Y=this.s<0?this.negate():this.clone(),te=V.s<0?V.negate():V.clone();if(Y.compareTo(te)<0){var he=Y;Y=te,te=he}var Ee=Y.getLowestSetBit(),Ae=te.getLowestSetBit();if(Ae<0)return Y;for(Ee<Ae&&(Ae=Ee),Ae>0&&(Y.rShiftTo(Ae,Y),te.rShiftTo(Ae,te));Y.signum()>0;)(Ee=Y.getLowestSetBit())>0&&Y.rShiftTo(Ee,Y),(Ee=te.getLowestSetBit())>0&&te.rShiftTo(Ee,te),Y.compareTo(te)>=0?(Y.subTo(te,Y),Y.rShiftTo(1,Y)):(te.subTo(Y,te),te.rShiftTo(1,te));return Ae>0&&te.lShiftTo(Ae,te),te}function gr(V){if(V<=0)return 0;var Y=this.DV%V,te=this.s<0?V-1:0;if(this.t>0)if(Y===0)te=this[0]%V;else for(var he=this.t-1;he>=0;--he)te=(Y*te+this[he])%V;return te}function wr(V){var Y=V.isEven();if(this.isEven()&&Y||V.signum()===0)return o.ZERO;for(var te=V.clone(),he=this.clone(),Ee=m(1),Ae=m(0),Pe=m(0),De=m(1);te.signum()!=0;){for(;te.isEven();)te.rShiftTo(1,te),Y?((!Ee.isEven()||!Ae.isEven())&&(Ee.addTo(this,Ee),Ae.subTo(V,Ae)),Ee.rShiftTo(1,Ee)):Ae.isEven()||Ae.subTo(V,Ae),Ae.rShiftTo(1,Ae);for(;he.isEven();)he.rShiftTo(1,he),Y?((!Pe.isEven()||!De.isEven())&&(Pe.addTo(this,Pe),De.subTo(V,De)),Pe.rShiftTo(1,Pe)):De.isEven()||De.subTo(V,De),De.rShiftTo(1,De);te.compareTo(he)>=0?(te.subTo(he,te),Y&&Ee.subTo(Pe,Ee),Ae.subTo(De,Ae)):(he.subTo(te,he),Y&&Pe.subTo(Ee,Pe),De.subTo(Ae,De))}if(he.compareTo(o.ONE)!=0)return o.ZERO;if(De.compareTo(V)>=0)return De.subtract(V);if(De.signum()<0)De.addTo(V,De);else return De;return De.signum()<0?De.add(V):De}var rr=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],_r=(1<<26)/rr[rr.length-1];function xr(V){var Y,te=this.abs();if(te.t==1&&te[0]<=rr[rr.length-1]){for(Y=0;Y<rr.length;++Y)if(te[0]==rr[Y])return!0;return!1}if(te.isEven())return!1;for(Y=1;Y<rr.length;){for(var he=rr[Y],Ee=Y+1;Ee<rr.length&&he<_r;)he*=rr[Ee++];for(he=te.modInt(he);Y<Ee;)if(he%rr[Y++]===0)return!1}return te.millerRabin(V)}function Sr(V){var Y=this.subtract(o.ONE),te=Y.getLowestSetBit();if(te<=0)return!1;var he=Y.shiftRight(te);V=V+1>>1,V>rr.length&&(V=rr.length);for(var Ee=d(),Ae=0;Ae<V;++Ae){Ee.fromInt(rr[Math.floor(Math.random()*rr.length)]);var Pe=Ee.modPow(he,this);if(Pe.compareTo(o.ONE)!=0&&Pe.compareTo(Y)!=0){for(var De=1;De++<te&&Pe.compareTo(Y)!=0;)if(Pe=Pe.modPowInt(2,this),Pe.compareTo(o.ONE)===0)return!1;if(Pe.compareTo(Y)!=0)return!1}}return!0}return o.prototype.copyTo=v,o.prototype.fromInt=b,o.prototype.fromString=q,o.prototype.fromByteArray=E,o.prototype.fromBuffer=S,o.prototype.clamp=O,o.prototype.dlShiftTo=de,o.prototype.drShiftTo=Z,o.prototype.lShiftTo=y,o.prototype.rShiftTo=g,o.prototype.subTo=p,o.prototype.multiplyTo=_,o.prototype.squareTo=R,o.prototype.divRemTo=B,o.prototype.invDigit=Q,o.prototype.isEven=G,o.prototype.exp=fe,o.prototype.chunkSize=be,o.prototype.toRadix=Be,o.prototype.fromRadix=Me,o.prototype.fromNumber=Te,o.prototype.bitwiseTo=Oe,o.prototype.changeBit=Ye,o.prototype.addTo=k,o.prototype.dMultiply=Ge,o.prototype.dAddOffset=Ue,o.prototype.multiplyLowerTo=ur,o.prototype.multiplyUpperTo=cr,o.prototype.modInt=gr,o.prototype.millerRabin=Sr,o.prototype.toString=D,o.prototype.negate=j,o.prototype.abs=$,o.prototype.compareTo=J,o.prototype.bitLength=ne,o.prototype.mod=P,o.prototype.modPowInt=me,o.prototype.clone=xe,o.prototype.intValue=_e,o.prototype.byteValue=qe,o.prototype.shortValue=Re,o.prototype.signum=Fe,o.prototype.toByteArray=oe,o.prototype.toBuffer=ce,o.prototype.equals=ge,o.prototype.min=we,o.prototype.max=Se,o.prototype.and=I,o.prototype.or=X,o.prototype.xor=le,o.prototype.andNot=Ce,o.prototype.not=Le,o.prototype.shiftLeft=Ie,o.prototype.shiftRight=$e,o.prototype.getLowestSetBit=He,o.prototype.bitCount=Ze,o.prototype.testBit=We,o.prototype.setBit=Xe,o.prototype.clearBit=W,o.prototype.flipBit=T,o.prototype.add=re,o.prototype.subtract=ue,o.prototype.multiply=pe,o.prototype.divide=ke,o.prototype.remainder=Ve,o.prototype.divideAndRemainder=Ne,o.prototype.modPow=br,o.prototype.modInverse=wr,o.prototype.pow=fr,o.prototype.gcd=yr,o.prototype.isProbablePrime=xr,o.int2char=s,o.ZERO=m(0),o.ONE=m(1),o.prototype.square=ye,jsbn=o,jsbn}var schemes={exports:{}},pkcs1$1={exports:{}},hasRequiredPkcs1$1;function requirePkcs1$1(){if(hasRequiredPkcs1$1)return pkcs1$1.exports;hasRequiredPkcs1$1=1;var c=requireJsbn(),t=requireCryptoBrowserify(),u=require$$0$1,o={md2:Buffer.from("3020300c06082a864886f70d020205000410","hex"),md5:Buffer.from("3020300c06082a864886f70d020505000410","hex"),sha1:Buffer.from("3021300906052b0e03021a05000414","hex"),sha224:Buffer.from("302d300d06096086480165030402040500041c","hex"),sha256:Buffer.from("3031300d060960864801650304020105000420","hex"),sha384:Buffer.from("3041300d060960864801650304020205000430","hex"),sha512:Buffer.from("3051300d060960864801650304020305000440","hex"),ripemd160:Buffer.from("3021300906052b2403020105000414","hex"),rmd160:Buffer.from("3021300906052b2403020105000414","hex")},d={ripemd160:"rmd160"},r="sha256";return pkcs1$1.exports={isEncryption:!0,isSignature:!0},pkcs1$1.exports.makeScheme=function(h,f){function a(n,e){this.key=n,this.options=e}return a.prototype.maxMessageLength=function(){return this.options.encryptionSchemeOptions&&this.options.encryptionSchemeOptions.padding==u.RSA_NO_PADDING?this.key.encryptedDataLength:this.key.encryptedDataLength-11},a.prototype.encPad=function(n,e){e=e||{};var s;if(n.length>this.key.maxMessageLength)throw new Error("Message too long for RSA (n="+this.key.encryptedDataLength+", l="+n.length+")");if(this.options.encryptionSchemeOptions&&this.options.encryptionSchemeOptions.padding==u.RSA_NO_PADDING)return s=Buffer.alloc(this.key.maxMessageLength-n.length),s.fill(0),Buffer.concat([s,n]);if(e.type===1)return s=Buffer.alloc(this.key.encryptedDataLength-n.length-1),s.fill(255,0,s.length-1),s[0]=1,s[s.length-1]=0,Buffer.concat([s,n]);s=Buffer.alloc(this.key.encryptedDataLength-n.length),s[0]=0,s[1]=2;for(var l=t.randomBytes(s.length-3),v=0;v<l.length;v++){for(var b=l[v];b===0;)b=t.randomBytes(1)[0];s[v+2]=b}return s[s.length-1]=0,Buffer.concat([s,n])},a.prototype.encUnPad=function(n,e){e=e||{};var s=0;if(this.options.encryptionSchemeOptions&&this.options.encryptionSchemeOptions.padding==u.RSA_NO_PADDING){var l;return typeof n.lastIndexOf=="function"?l=n.slice(n.lastIndexOf("\0")+1,n.length):l=n.slice(String.prototype.lastIndexOf.call(n,"\0")+1,n.length),l}if(n.length<4)return null;if(e.type===1){if(n[0]!==0||n[1]!==1)return null;for(s=3;n[s]!==0;)if(n[s]!=255||++s>=n.length)return null}else{if(n[0]!==0||n[1]!==2)return null;for(s=3;n[s]!==0;)if(++s>=n.length)return null}return n.slice(s+1,n.length)},a.prototype.sign=function(n){var e=this.options.signingSchemeOptions.hash||r;if(this.options.environment==="browser"){e=d[e]||e;var s=t.createHash(e);s.update(n);var l=this.pkcs1pad(s.digest(),e),v=this.key.$doPrivate(new c(l)).toBuffer(this.key.encryptedDataLength);return v}else{var b=t.createSign("RSA-"+e.toUpperCase());return b.update(n),b.sign(this.options.rsaUtils.exportKey("private"))}},a.prototype.verify=function(n,e,s){if(this.options.encryptionSchemeOptions&&this.options.encryptionSchemeOptions.padding==u.RSA_NO_PADDING)return!1;var l=this.options.signingSchemeOptions.hash||r;if(this.options.environment==="browser"){l=d[l]||l,s&&(e=Buffer.from(e,s));var v=t.createHash(l);v.update(n);var b=this.pkcs1pad(v.digest(),l),m=this.key.$doPublic(new c(e));return m.toBuffer().toString("hex")==b.toString("hex")}else{var q=t.createVerify("RSA-"+l.toUpperCase());return q.update(n),q.verify(this.options.rsaUtils.exportKey("public"),e,s)}},a.prototype.pkcs0pad=function(n){var e=Buffer.alloc(this.key.maxMessageLength-n.length);return e.fill(0),Buffer.concat([e,n])},a.prototype.pkcs0unpad=function(n){var e;return typeof n.lastIndexOf=="function"?e=n.slice(n.lastIndexOf("\0")+1,n.length):e=n.slice(String.prototype.lastIndexOf.call(n,"\0")+1,n.length),e},a.prototype.pkcs1pad=function(n,e){var s=o[e];if(!s)throw Error("Unsupported hash algorithm");var l=Buffer.concat([s,n]);if(l.length+10>this.key.encryptedDataLength)throw Error("Key is too short for signing algorithm ("+e+")");var v=Buffer.alloc(this.key.encryptedDataLength-l.length-1);v.fill(255,0,v.length-1),v[0]=1,v[v.length-1]=0;var b=Buffer.concat([v,l]);return b},new a(h,f)},pkcs1$1.exports}var oaep={exports:{}},hasRequiredOaep;function requireOaep(){return hasRequiredOaep||(hasRequiredOaep=1,(function(c){requireJsbn();var t=requireCryptoBrowserify();c.exports={isEncryption:!0,isSignature:!1},c.exports.digestLength={md4:16,md5:16,ripemd160:20,rmd160:20,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64};var u="sha1";c.exports.eme_oaep_mgf1=function(o,d,r){r=r||u;for(var h=c.exports.digestLength[r],f=Math.ceil(d/h),a=Buffer.alloc(h*f),n=Buffer.alloc(4),e=0;e<f;++e){var s=t.createHash(r);s.update(o),n.writeUInt32BE(e,0),s.update(n),s.digest().copy(a,e*h)}return a.slice(0,d)},c.exports.makeScheme=function(o,d){function r(h,f){this.key=h,this.options=f}return r.prototype.maxMessageLength=function(){return this.key.encryptedDataLength-2*c.exports.digestLength[this.options.encryptionSchemeOptions.hash||u]-2},r.prototype.encPad=function(h){var f=this.options.encryptionSchemeOptions.hash||u,a=this.options.encryptionSchemeOptions.mgf||c.exports.eme_oaep_mgf1,n=this.options.encryptionSchemeOptions.label||Buffer.alloc(0),e=this.key.encryptedDataLength,s=c.exports.digestLength[f];if(h.length>e-2*s-2)throw new Error("Message is too long to encode into an encoded message with a length of "+e+" bytes, increaseemLen to fix this error (minimum value for given parameters and options: "+(e-2*s-2)+")");var l=t.createHash(f);l.update(n),l=l.digest();var v=Buffer.alloc(e-h.length-2*s-1);v.fill(0),v[v.length-1]=1;for(var b=Buffer.concat([l,v,h]),m=t.randomBytes(s),q=a(m,b.length,f),E=0;E<b.length;E++)b[E]^=q[E];for(q=a(b,s,f),E=0;E<m.length;E++)m[E]^=q[E];var S=Buffer.alloc(1+m.length+b.length);return S[0]=0,m.copy(S,1),b.copy(S,1+m.length),S},r.prototype.encUnPad=function(h){var f=this.options.encryptionSchemeOptions.hash||u,a=this.options.encryptionSchemeOptions.mgf||c.exports.eme_oaep_mgf1,n=this.options.encryptionSchemeOptions.label||Buffer.alloc(0),e=c.exports.digestLength[f];if(h.length<2*e+2)throw new Error("Error decoding message, the supplied message is not long enough to be a valid OAEP encoded message");for(var s=h.slice(1,e+1),l=h.slice(1+e),v=a(l,e,f),b=0;b<s.length;b++)s[b]^=v[b];for(v=a(s,l.length,f),b=0;b<l.length;b++)l[b]^=v[b];var m=t.createHash(f);m.update(n),m=m.digest();var q=l.slice(0,e);if(q.toString("hex")!=m.toString("hex"))throw new Error("Error decoding message, the lHash calculated from the label provided and the lHash in the encrypted data do not match.");for(b=e;l[b++]===0&&b<l.length;);if(l[b-1]!=1)throw new Error("Error decoding message, there is no padding message separator byte");return l.slice(b)},new r(o,d)}})(oaep)),oaep.exports}var pss={exports:{}},hasRequiredPss;function requirePss(){if(hasRequiredPss)return pss.exports;hasRequiredPss=1;var c=requireJsbn(),t=requireCryptoBrowserify();pss.exports={isEncryption:!1,isSignature:!0};var u="sha1",o=20;return pss.exports.makeScheme=function(d,r){var h=requireSchemes().pkcs1_oaep;function f(a,n){this.key=a,this.options=n}return f.prototype.sign=function(a){var n=t.createHash(this.options.signingSchemeOptions.hash||u);n.update(a);var e=this.emsa_pss_encode(n.digest(),this.key.keySize-1);return this.key.$doPrivate(new c(e)).toBuffer(this.key.encryptedDataLength)},f.prototype.verify=function(a,n,e){e&&(n=Buffer.from(n,e)),n=new c(n);var s=Math.ceil((this.key.keySize-1)/8),l=this.key.$doPublic(n).toBuffer(s),v=t.createHash(this.options.signingSchemeOptions.hash||u);return v.update(a),this.emsa_pss_verify(v.digest(),l,this.key.keySize-1)},f.prototype.emsa_pss_encode=function(a,n){var e=this.options.signingSchemeOptions.hash||u,s=this.options.signingSchemeOptions.mgf||h.eme_oaep_mgf1,l=this.options.signingSchemeOptions.saltLength||o,v=h.digestLength[e],b=Math.ceil(n/8);if(b<v+l+2)throw new Error("Output length passed to emBits("+n+") is too small for the options specified("+e+", "+l+"). To fix this issue increase the value of emBits. (minimum size: "+(8*v+8*l+9)+")");var m=t.randomBytes(l),q=Buffer.alloc(8+v+l);q.fill(0,0,8),a.copy(q,8),m.copy(q,8+a.length);var E=t.createHash(e);E.update(q),E=E.digest();var S=Buffer.alloc(b-m.length-v-2);S.fill(0);var O=Buffer.alloc(S.length+1+m.length);S.copy(O),O[S.length]=1,m.copy(O,S.length+1);for(var D=s(E,O.length,e),j=Buffer.alloc(O.length),$=0;$<D.length;$++)j[$]=O[$]^D[$];var J=8*b-n,ie=255^255>>8-J<<8-J;j[0]=j[0]&ie;var ne=Buffer.alloc(j.length+E.length+1);return j.copy(ne,0),E.copy(ne,j.length),ne[ne.length-1]=188,ne},f.prototype.emsa_pss_verify=function(a,n,e){var s=this.options.signingSchemeOptions.hash||u,l=this.options.signingSchemeOptions.mgf||h.eme_oaep_mgf1,v=this.options.signingSchemeOptions.saltLength||o,b=h.digestLength[s],m=Math.ceil(e/8);if(m<b+v+2||n[n.length-1]!=188)return!1;var q=Buffer.alloc(m-b-1);n.copy(q,0,0,m-b-1);for(var E=0,S=0,O=8*m-e;S<O;S++)E|=1<<7-S;if((q[0]&E)!==0)return!1;var D=n.slice(m-b-1,m-1),j=l(D,q.length,s);for(S=0;S<q.length;S++)q[S]^=j[S];for(O=8*m-e,E=255^255>>8-O<<8-O,q[0]=q[0]&E,S=0;q[S]===0&&S<q.length;S++);if(q[S]!=1)return!1;var $=q.slice(q.length-v),J=Buffer.alloc(8+b+v);J.fill(0,0,8),a.copy(J,8),$.copy(J,8+a.length);var ie=t.createHash(s);return ie.update(J),ie=ie.digest(),D.toString("hex")===ie.toString("hex")},new f(d,r)},pss.exports}var hasRequiredSchemes;function requireSchemes(){return hasRequiredSchemes||(hasRequiredSchemes=1,(function(c){c.exports={pkcs1:requirePkcs1$1(),pkcs1_oaep:requireOaep(),pss:requirePss(),isEncryption:function(t){return c.exports[t]&&c.exports[t].isEncryption},isSignature:function(t){return c.exports[t]&&c.exports[t].isSignature}}})(schemes)),schemes.exports}var js,hasRequiredJs;function requireJs(){if(hasRequiredJs)return js;hasRequiredJs=1;var c=requireJsbn(),t=requireSchemes();return js=function(u,o){var d=t.pkcs1.makeScheme(u,o);return{encrypt:function(r,h){var f,a;return h?(f=new c(d.encPad(r,{type:1})),a=u.$doPrivate(f)):(f=new c(u.encryptionScheme.encPad(r)),a=u.$doPublic(f)),a.toBuffer(u.encryptedDataLength)},decrypt:function(r,h){var f,a=new c(r);return h?(f=u.$doPublic(a),d.encUnPad(f.toBuffer(u.encryptedDataLength),{type:1})):(f=u.$doPrivate(a),u.encryptionScheme.encUnPad(f.toBuffer(u.encryptedDataLength)))}}},js}var io,hasRequiredIo;function requireIo(){if(hasRequiredIo)return io;hasRequiredIo=1;var c=requireCryptoBrowserify(),t=require$$0$1,u=requireSchemes();return io=function(o,d){var r=u.pkcs1.makeScheme(o,d);return{encrypt:function(h,f){var a;if(f)return a=t.RSA_PKCS1_PADDING,d.encryptionSchemeOptions&&d.encryptionSchemeOptions.padding&&(a=d.encryptionSchemeOptions.padding),c.privateEncrypt({key:d.rsaUtils.exportKey("private"),padding:a},h);a=t.RSA_PKCS1_OAEP_PADDING,d.encryptionScheme==="pkcs1"&&(a=t.RSA_PKCS1_PADDING),d.encryptionSchemeOptions&&d.encryptionSchemeOptions.padding&&(a=d.encryptionSchemeOptions.padding);var n=h;return a===t.RSA_NO_PADDING&&(n=r.pkcs0pad(h)),c.publicEncrypt({key:d.rsaUtils.exportKey("public"),padding:a},n)},decrypt:function(h,f){var a;if(f)return a=t.RSA_PKCS1_PADDING,d.encryptionSchemeOptions&&d.encryptionSchemeOptions.padding&&(a=d.encryptionSchemeOptions.padding),c.publicDecrypt({key:d.rsaUtils.exportKey("public"),padding:a},h);a=t.RSA_PKCS1_OAEP_PADDING,d.encryptionScheme==="pkcs1"&&(a=t.RSA_PKCS1_PADDING),d.encryptionSchemeOptions&&d.encryptionSchemeOptions.padding&&(a=d.encryptionSchemeOptions.padding);var n=c.privateDecrypt({key:d.rsaUtils.exportKey("private"),padding:a},h);return a===t.RSA_NO_PADDING?r.pkcs0unpad(n):n}}},io}var node12,hasRequiredNode12;function requireNode12(){if(hasRequiredNode12)return node12;hasRequiredNode12=1;var c=requireCryptoBrowserify(),t=require$$0$1,u=requireSchemes();return node12=function(o,d){var r=requireJs()(o,d),h=u.pkcs1.makeScheme(o,d);return{encrypt:function(f,a){if(a)return r.encrypt(f,a);var n=t.RSA_PKCS1_OAEP_PADDING;d.encryptionScheme==="pkcs1"&&(n=t.RSA_PKCS1_PADDING),d.encryptionSchemeOptions&&d.encryptionSchemeOptions.padding&&(n=d.encryptionSchemeOptions.padding);var e=f;return n===t.RSA_NO_PADDING&&(e=h.pkcs0pad(f)),c.publicEncrypt({key:d.rsaUtils.exportKey("public"),padding:n},e)},decrypt:function(f,a){if(a)return r.decrypt(f,a);var n=t.RSA_PKCS1_OAEP_PADDING;d.encryptionScheme==="pkcs1"&&(n=t.RSA_PKCS1_PADDING),d.encryptionSchemeOptions&&d.encryptionSchemeOptions.padding&&(n=d.encryptionSchemeOptions.padding);var e=c.privateDecrypt({key:d.rsaUtils.exportKey("private"),padding:n},f);return n===t.RSA_NO_PADDING?h.pkcs0unpad(e):e}}},node12}var encryptEngines,hasRequiredEncryptEngines;function requireEncryptEngines(){if(hasRequiredEncryptEngines)return encryptEngines;hasRequiredEncryptEngines=1;var c=requireCryptoBrowserify();return encryptEngines={getEngine:function(t,u){var o=requireJs();return u.environment==="node"&&typeof c.publicEncrypt=="function"&&typeof c.privateDecrypt=="function"&&(typeof c.privateEncrypt=="function"&&typeof c.publicDecrypt=="function"?o=requireIo():o=requireNode12()),o(t,u)}},encryptEngines}var hasRequiredRsa;function requireRsa(){if(hasRequiredRsa)return rsa;hasRequiredRsa=1;var c=requireUtils()._;requireCryptoBrowserify();var t=requireJsbn(),u=requireUtils(),o=requireSchemes(),d=requireEncryptEngines();return rsa.BigInteger=t,rsa.Key=(function(){function r(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return r.prototype.setOptions=function(h){var f=o[h.signingScheme],a=o[h.encryptionScheme];f===a?this.signingScheme=this.encryptionScheme=a.makeScheme(this,h):(this.encryptionScheme=a.makeScheme(this,h),this.signingScheme=f.makeScheme(this,h)),this.encryptEngine=d.getEngine(this,h)},r.prototype.generate=function(h,f){var a=h>>1;this.e=parseInt(f,16);for(var n=new t(f,16);;){for(;this.p=new t(h-a,1),!(this.p.subtract(t.ONE).gcd(n).compareTo(t.ONE)===0&&this.p.isProbablePrime(10)););for(;this.q=new t(a,1),!(this.q.subtract(t.ONE).gcd(n).compareTo(t.ONE)===0&&this.q.isProbablePrime(10)););if(this.p.compareTo(this.q)<=0){var e=this.p;this.p=this.q,this.q=e}var s=this.p.subtract(t.ONE),l=this.q.subtract(t.ONE),v=s.multiply(l);if(v.gcd(n).compareTo(t.ONE)===0){if(this.n=this.p.multiply(this.q),this.n.bitLength()<h)continue;this.d=n.modInverse(v),this.dmp1=this.d.mod(s),this.dmq1=this.d.mod(l),this.coeff=this.q.modInverse(this.p);break}}this.$$recalculateCache()},r.prototype.setPrivate=function(h,f,a,n,e,s,l,v){if(h&&f&&a&&h.length>0&&(c.isNumber(f)||f.length>0)&&a.length>0)this.n=new t(h),this.e=c.isNumber(f)?f:u.get32IntFromBuffer(f,0),this.d=new t(a),n&&e&&s&&l&&v&&(this.p=new t(n),this.q=new t(e),this.dmp1=new t(s),this.dmq1=new t(l),this.coeff=new t(v)),this.$$recalculateCache();else throw Error("Invalid RSA private key")},r.prototype.setPublic=function(h,f){if(h&&f&&h.length>0&&(c.isNumber(f)||f.length>0))this.n=new t(h),this.e=c.isNumber(f)?f:u.get32IntFromBuffer(f,0),this.$$recalculateCache();else throw Error("Invalid RSA public key")},r.prototype.$doPrivate=function(h){if(this.p||this.q)return h.modPow(this.d,this.n);for(var f=h.mod(this.p).modPow(this.dmp1,this.p),a=h.mod(this.q).modPow(this.dmq1,this.q);f.compareTo(a)<0;)f=f.add(this.p);return f.subtract(a).multiply(this.coeff).mod(this.p).multiply(this.q).add(a)},r.prototype.$doPublic=function(h){return h.modPowInt(this.e,this.n)},r.prototype.encrypt=function(h,f){var a=[],n=[],e=h.length,s=Math.ceil(e/this.maxMessageLength)||1,l=Math.ceil(e/s||1);if(s==1)a.push(h);else for(var v=0;v<s;v++)a.push(h.slice(v*l,(v+1)*l));for(var b=0;b<a.length;b++)n.push(this.encryptEngine.encrypt(a[b],f));return Buffer.concat(n)},r.prototype.decrypt=function(h,f){if(h.length%this.encryptedDataLength>0)throw Error("Incorrect data or key");for(var a=[],n=0,e=0,s=h.length/this.encryptedDataLength,l=0;l<s;l++)n=l*this.encryptedDataLength,e=n+this.encryptedDataLength,a.push(this.encryptEngine.decrypt(h.slice(n,Math.min(e,h.length)),f));return Buffer.concat(a)},r.prototype.sign=function(h){return this.signingScheme.sign.apply(this.signingScheme,arguments)},r.prototype.verify=function(h,f,a){return this.signingScheme.verify.apply(this.signingScheme,arguments)},r.prototype.isPrivate=function(){return this.n&&this.e&&this.d&&!0||!1},r.prototype.isPublic=function(h){return this.n&&this.e&&!(h&&this.d)||!1},Object.defineProperty(r.prototype,"keySize",{get:function(){return this.cache.keyBitLength}}),Object.defineProperty(r.prototype,"encryptedDataLength",{get:function(){return this.cache.keyByteLength}}),Object.defineProperty(r.prototype,"maxMessageLength",{get:function(){return this.encryptionScheme.maxMessageLength()}}),r.prototype.$$recalculateCache=function(){this.cache=this.cache||{},this.cache.keyBitLength=this.n.bitLength(),this.cache.keyByteLength=this.cache.keyBitLength+6>>3},r})(),rsa}var ber={exports:{}},errors$1,hasRequiredErrors$1;function requireErrors$1(){return hasRequiredErrors$1||(hasRequiredErrors$1=1,errors$1={newInvalidAsn1Error:function(c){var t=new Error;return t.name="InvalidAsn1Error",t.message=c||"",t}}),errors$1}var types,hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,types={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}),types}var assert={exports:{}},errors={},hasRequiredErrors;function requireErrors(){if(hasRequiredErrors)return errors;hasRequiredErrors=1;function c(S){"@babel/helpers - typeof";return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},c(S)}function t(S,O,D){return Object.defineProperty(S,"prototype",{writable:!1}),S}function u(S,O){if(!(S instanceof O))throw new TypeError("Cannot call a class as a function")}function o(S,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function");S.prototype=Object.create(O&&O.prototype,{constructor:{value:S,writable:!0,configurable:!0}}),Object.defineProperty(S,"prototype",{writable:!1}),O&&d(S,O)}function d(S,O){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,$){return j.__proto__=$,j},d(S,O)}function r(S){var O=a();return function(){var j=n(S),$;if(O){var J=n(this).constructor;$=Reflect.construct(j,arguments,J)}else $=j.apply(this,arguments);return h(this,$)}}function h(S,O){if(O&&(c(O)==="object"||typeof O=="function"))return O;if(O!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return f(S)}function f(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}function a(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function n(S){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(D){return D.__proto__||Object.getPrototypeOf(D)},n(S)}var e={},s,l;function v(S,O,D){D||(D=Error);function j(J,ie,ne){return typeof O=="string"?O:O(J,ie,ne)}var $=(function(J){o(ne,J);var ie=r(ne);function ne(de,Z,y){var g;return u(this,ne),g=ie.call(this,j(de,Z,y)),g.code=S,g}return t(ne)})(D);e[S]=$}function b(S,O){if(Array.isArray(S)){var D=S.length;return S=S.map(function(j){return String(j)}),D>2?"one of ".concat(O," ").concat(S.slice(0,D-1).join(", "),", or ")+S[D-1]:D===2?"one of ".concat(O," ").concat(S[0]," or ").concat(S[1]):"of ".concat(O," ").concat(S[0])}else return"of ".concat(O," ").concat(String(S))}function m(S,O,D){return S.substr(0,O.length)===O}function q(S,O,D){return(D===void 0||D>S.length)&&(D=S.length),S.substring(D-O.length,D)===O}function E(S,O,D){return typeof D!="number"&&(D=0),D+O.length>S.length?!1:S.indexOf(O,D)!==-1}return v("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),v("ERR_INVALID_ARG_TYPE",function(S,O,D){s===void 0&&(s=requireAssert()),s(typeof S=="string","'name' must be a string");var j;typeof O=="string"&&m(O,"not ")?(j="must not be",O=O.replace(/^not /,"")):j="must be";var $;if(q(S," argument"))$="The ".concat(S," ").concat(j," ").concat(b(O,"type"));else{var J=E(S,".")?"property":"argument";$='The "'.concat(S,'" ').concat(J," ").concat(j," ").concat(b(O,"type"))}return $+=". Received type ".concat(c(D)),$},TypeError),v("ERR_INVALID_ARG_VALUE",function(S,O){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";l===void 0&&(l=requireUtil$1());var j=l.inspect(O);return j.length>128&&(j="".concat(j.slice(0,128),"...")),"The argument '".concat(S,"' ").concat(D,". Received ").concat(j)},TypeError),v("ERR_INVALID_RETURN_VALUE",function(S,O,D){var j;return D&&D.constructor&&D.constructor.name?j="instance of ".concat(D.constructor.name):j="type ".concat(c(D)),"Expected ".concat(S,' to be returned from the "').concat(O,'"')+" function but got ".concat(j,".")},TypeError),v("ERR_MISSING_ARGS",function(){for(var S=arguments.length,O=new Array(S),D=0;D<S;D++)O[D]=arguments[D];s===void 0&&(s=requireAssert()),s(O.length>0,"At least one arg needs to be specified");var j="The ",$=O.length;switch(O=O.map(function(J){return'"'.concat(J,'"')}),$){case 1:j+="".concat(O[0]," argument");break;case 2:j+="".concat(O[0]," and ").concat(O[1]," arguments");break;default:j+=O.slice(0,$-1).join(", "),j+=", and ".concat(O[$-1]," arguments");break}return"".concat(j," must be specified")},TypeError),errors.codes=e,errors}var assertion_error,hasRequiredAssertion_error;function requireAssertion_error(){if(hasRequiredAssertion_error)return assertion_error;hasRequiredAssertion_error=1;function c(A,w){var M=Object.keys(A);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(A);w&&(x=x.filter(function(L){return Object.getOwnPropertyDescriptor(A,L).enumerable})),M.push.apply(M,x)}return M}function t(A){for(var w=1;w<arguments.length;w++){var M=arguments[w]!=null?arguments[w]:{};w%2?c(Object(M),!0).forEach(function(x){u(A,x,M[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(M)):c(Object(M)).forEach(function(x){Object.defineProperty(A,x,Object.getOwnPropertyDescriptor(M,x))})}return A}function u(A,w,M){return w=h(w),w in A?Object.defineProperty(A,w,{value:M,enumerable:!0,configurable:!0,writable:!0}):A[w]=M,A}function o(A,w){if(!(A instanceof w))throw new TypeError("Cannot call a class as a function")}function d(A,w){for(var M=0;M<w.length;M++){var x=w[M];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(A,h(x.key),x)}}function r(A,w,M){return w&&d(A.prototype,w),Object.defineProperty(A,"prototype",{writable:!1}),A}function h(A){var w=f(A,"string");return S(w)==="symbol"?w:String(w)}function f(A,w){if(S(A)!=="object"||A===null)return A;var M=A[Symbol.toPrimitive];if(M!==void 0){var x=M.call(A,w);if(S(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}function a(A,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(w&&w.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),w&&q(A,w)}function n(A){var w=b();return function(){var x=E(A),L;if(w){var K=E(this).constructor;L=Reflect.construct(x,arguments,K)}else L=x.apply(this,arguments);return e(this,L)}}function e(A,w){if(w&&(S(w)==="object"||typeof w=="function"))return w;if(w!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return s(A)}function s(A){if(A===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function l(A){var w=typeof Map=="function"?new Map:void 0;return l=function(x){if(x===null||!m(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof w<"u"){if(w.has(x))return w.get(x);w.set(x,L)}function L(){return v(x,arguments,E(this).constructor)}return L.prototype=Object.create(x.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),q(L,x)},l(A)}function v(A,w,M){return b()?v=Reflect.construct.bind():v=function(L,K,Q){var H=[null];H.push.apply(H,K);var N=Function.bind.apply(L,H),F=new N;return Q&&q(F,Q.prototype),F},v.apply(null,arguments)}function b(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function m(A){return Function.toString.call(A).indexOf("[native code]")!==-1}function q(A,w){return q=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,L){return x.__proto__=L,x},q(A,w)}function E(A){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(M){return M.__proto__||Object.getPrototypeOf(M)},E(A)}function S(A){"@babel/helpers - typeof";return S=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},S(A)}var O=requireUtil$1(),D=O.inspect,j=requireErrors(),$=j.codes.ERR_INVALID_ARG_TYPE;function J(A,w,M){return(M===void 0||M>A.length)&&(M=A.length),A.substring(M-w.length,M)===w}function ie(A,w){if(w=Math.floor(w),A.length==0||w==0)return"";var M=A.length*w;for(w=Math.floor(Math.log(w)/Math.log(2));w;)A+=A,w--;return A+=A.substring(0,M-A.length),A}var ne="",de="",Z="",y="",g={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},p=10;function _(A){var w=Object.keys(A),M=Object.create(Object.getPrototypeOf(A));return w.forEach(function(x){M[x]=A[x]}),Object.defineProperty(M,"message",{value:A.message}),M}function R(A){return D(A,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function B(A,w,M){var x="",L="",K=0,Q="",H=!1,N=R(A),F=N.split(`
|
|
17
|
+
https://github.com/browserify/crypto-browserify`)},cryptoBrowserify.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},cryptoBrowserify}var hasRequiredUtils;function requireUtils(){return hasRequiredUtils||(hasRequiredUtils=1,requireCryptoBrowserify(),utils$4.linebrk=function(s,t){for(var f="",o=0;o+t<s.length;)f+=s.substring(o,o+t)+`
|
|
18
|
+
`,o+=t;return f+s.substring(o,s.length)},utils$4.detectEnvironment=function(){return typeof window<"u"&&window&&!(process$1&&process$1.title==="node")?"browser":"node"},utils$4.get32IntFromBuffer=function(s,t){t=t||0;var f=0;if((f=s.length-t)>0){if(f>=4)return s.readUIntBE(t,f);for(var o=0,d=t+f,r=0;d>t;d--,r+=2)o+=s[d-1]*Math.pow(16,r);return o}else return NaN},utils$4._={isObject:function(s){var t=typeof s;return!!s&&(t=="object"||t=="function")},isString:function(s){return typeof s=="string"||s instanceof String},isNumber:function(s){return typeof s=="number"||!isNaN(parseFloat(s))&&isFinite(s)},omit:function(s,t){var f={};for(var o in s)!s.hasOwnProperty(o)||o===t||(f[o]=s[o]);return f}},utils$4.trimSurroundingText=function(s,t,f){var o=0,d=s.length,r=s.indexOf(t);r>=0&&(o=r+t.length);var h=s.indexOf(f,r);return h>=0&&(d=h),s.substring(o,d)}),utils$4}var jsbn,hasRequiredJsbn;function requireJsbn(){if(hasRequiredJsbn)return jsbn;hasRequiredJsbn=1;var s=requireCryptoBrowserify(),t=requireUtils()._,f;function o(V,Z){V!=null&&(typeof V=="number"?this.fromNumber(V,Z):Buffer.isBuffer(V)?this.fromBuffer(V):Z==null&&typeof V!="string"?this.fromByteArray(V):this.fromString(V,Z))}function d(){return new o(null)}function r(V,Z,te,he,Ee,Ae){for(var Te=Z&16383,De=Z>>14;--Ae>=0;){var tr=this[V]&16383,ir=this[V++]>>14,Er=De*tr+ir*Te;tr=Te*tr+((Er&16383)<<14)+te[he]+Ee,Ee=(tr>>28)+(Er>>14)+De*ir,te[he++]=tr&268435455}return Ee}o.prototype.am=r,f=28,o.prototype.DB=f,o.prototype.DM=(1<<f)-1,o.prototype.DV=1<<f;var h=52;o.prototype.FV=Math.pow(2,h),o.prototype.F1=h-f,o.prototype.F2=2*f-h;var c="0123456789abcdefghijklmnopqrstuvwxyz",n=new Array,a,e;for(a=48,e=0;e<=9;++e)n[a++]=e;for(a=97,e=10;e<36;++e)n[a++]=e;for(a=65,e=10;e<36;++e)n[a++]=e;function u(V){return c.charAt(V)}function l(V,Z){var te=n[V.charCodeAt(Z)];return te??-1}function v(V){for(var Z=this.t-1;Z>=0;--Z)V[Z]=this[Z];V.t=this.t,V.s=this.s}function b(V){this.t=1,this.s=V<0?-1:0,V>0?this[0]=V:V<-1?this[0]=V+DV:this.t=0}function m(V){var Z=d();return Z.fromInt(V),Z}function B(V,Z,te){var he;switch(Z){case 2:he=1;break;case 4:he=2;break;case 8:he=3;break;case 16:he=4;break;case 32:he=5;break;case 256:he=8;break;default:this.fromRadix(V,Z);return}this.t=0,this.s=0;for(var Ee=V.length,Ae=!1,Te=0;--Ee>=0;){var De=he==8?V[Ee]&255:l(V,Ee);if(De<0){V.charAt(Ee)=="-"&&(Ae=!0);continue}Ae=!1,Te===0?this[this.t++]=De:Te+he>this.DB?(this[this.t-1]|=(De&(1<<this.DB-Te)-1)<<Te,this[this.t++]=De>>this.DB-Te):this[this.t-1]|=De<<Te,Te+=he,Te>=this.DB&&(Te-=this.DB)}!te&&he==8&&(V[0]&128)!=0&&(this.s=-1,Te>0&&(this[this.t-1]|=(1<<this.DB-Te)-1<<Te)),this.clamp(),Ae&&o.ZERO.subTo(this,this)}function E(V,Z){this.fromString(V,256,Z)}function S(V){this.fromString(V,256,!0)}function O(){for(var V=this.s&this.DM;this.t>0&&this[this.t-1]==V;)--this.t}function D(V){if(this.s<0)return"-"+this.negate().toString(V);var Z;if(V==16)Z=4;else if(V==8)Z=3;else if(V==2)Z=1;else if(V==32)Z=5;else if(V==4)Z=2;else return this.toRadix(V);var te=(1<<Z)-1,he,Ee=!1,Ae="",Te=this.t,De=this.DB-Te*this.DB%Z;if(Te-- >0)for(De<this.DB&&(he=this[Te]>>De)>0&&(Ee=!0,Ae=u(he));Te>=0;)De<Z?(he=(this[Te]&(1<<De)-1)<<Z-De,he|=this[--Te]>>(De+=this.DB-Z)):(he=this[Te]>>(De-=Z)&te,De<=0&&(De+=this.DB,--Te)),he>0&&(Ee=!0),Ee&&(Ae+=u(he));return Ee?Ae:"0"}function $(){var V=d();return o.ZERO.subTo(this,V),V}function H(){return this.s<0?this.negate():this}function Y(V){var Z=this.s-V.s;if(Z!=0)return Z;var te=this.t;if(Z=te-V.t,Z!=0)return this.s<0?-Z:Z;for(;--te>=0;)if((Z=this[te]-V[te])!=0)return Z;return 0}function ie(V){var Z=1,te;return(te=V>>>16)!=0&&(V=te,Z+=16),(te=V>>8)!=0&&(V=te,Z+=8),(te=V>>4)!=0&&(V=te,Z+=4),(te=V>>2)!=0&&(V=te,Z+=2),(te=V>>1)!=0&&(V=te,Z+=1),Z}function ne(){return this.t<=0?0:this.DB*(this.t-1)+ie(this[this.t-1]^this.s&this.DM)}function de(V,Z){var te;for(te=this.t-1;te>=0;--te)Z[te+V]=this[te];for(te=V-1;te>=0;--te)Z[te]=0;Z.t=this.t+V,Z.s=this.s}function X(V,Z){for(var te=V;te<this.t;++te)Z[te-V]=this[te];Z.t=Math.max(this.t-V,0),Z.s=this.s}function y(V,Z){var te=V%this.DB,he=this.DB-te,Ee=(1<<he)-1,Ae=Math.floor(V/this.DB),Te=this.s<<te&this.DM,De;for(De=this.t-1;De>=0;--De)Z[De+Ae+1]=this[De]>>he|Te,Te=(this[De]&Ee)<<te;for(De=Ae-1;De>=0;--De)Z[De]=0;Z[Ae]=Te,Z.t=this.t+Ae+1,Z.s=this.s,Z.clamp()}function g(V,Z){Z.s=this.s;var te=Math.floor(V/this.DB);if(te>=this.t){Z.t=0;return}var he=V%this.DB,Ee=this.DB-he,Ae=(1<<he)-1;Z[0]=this[te]>>he;for(var Te=te+1;Te<this.t;++Te)Z[Te-te-1]|=(this[Te]&Ae)<<Ee,Z[Te-te]=this[Te]>>he;he>0&&(Z[this.t-te-1]|=(this.s&Ae)<<Ee),Z.t=this.t-te,Z.clamp()}function p(V,Z){for(var te=0,he=0,Ee=Math.min(V.t,this.t);te<Ee;)he+=this[te]-V[te],Z[te++]=he&this.DM,he>>=this.DB;if(V.t<this.t){for(he-=V.s;te<this.t;)he+=this[te],Z[te++]=he&this.DM,he>>=this.DB;he+=this.s}else{for(he+=this.s;te<V.t;)he-=V[te],Z[te++]=he&this.DM,he>>=this.DB;he-=V.s}Z.s=he<0?-1:0,he<-1?Z[te++]=this.DV+he:he>0&&(Z[te++]=he),Z.t=te,Z.clamp()}function _(V,Z){var te=this.abs(),he=V.abs(),Ee=te.t;for(Z.t=Ee+he.t;--Ee>=0;)Z[Ee]=0;for(Ee=0;Ee<he.t;++Ee)Z[Ee+te.t]=te.am(0,he[Ee],Z,Ee,0,te.t);Z.s=0,Z.clamp(),this.s!=V.s&&o.ZERO.subTo(Z,Z)}function R(V){for(var Z=this.abs(),te=V.t=2*Z.t;--te>=0;)V[te]=0;for(te=0;te<Z.t-1;++te){var he=Z.am(te,Z[te],V,2*te,0,1);(V[te+Z.t]+=Z.am(te+1,2*Z[te],V,2*te+1,he,Z.t-te-1))>=Z.DV&&(V[te+Z.t]-=Z.DV,V[te+Z.t+1]=1)}V.t>0&&(V[V.t-1]+=Z.am(te,Z[te],V,2*te,0,1)),V.s=0,V.clamp()}function q(V,Z,te){var he=V.abs();if(!(he.t<=0)){var Ee=this.abs();if(Ee.t<he.t){Z?.fromInt(0),te!=null&&this.copyTo(te);return}te==null&&(te=d());var Ae=d(),Te=this.s,De=V.s,tr=this.DB-ie(he[he.t-1]);tr>0?(he.lShiftTo(tr,Ae),Ee.lShiftTo(tr,te)):(he.copyTo(Ae),Ee.copyTo(te));var ir=Ae.t,Er=Ae[ir-1];if(Er!==0){var ar=Er*(1<<this.F1)+(ir>1?Ae[ir-2]>>this.F2:0),Br=this.FV/ar,Ar=(1<<this.F1)/ar,or=1<<this.F2,sr=te.t,Rr=sr-ir,qr=Z??d();for(Ae.dlShiftTo(Rr,qr),te.compareTo(qr)>=0&&(te[te.t++]=1,te.subTo(qr,te)),o.ONE.dlShiftTo(ir,qr),qr.subTo(Ae,Ae);Ae.t<ir;)Ae[Ae.t++]=0;for(;--Rr>=0;){var Mr=te[--sr]==Er?this.DM:Math.floor(te[sr]*Br+(te[sr-1]+or)*Ar);if((te[sr]+=Ae.am(0,Mr,te,Rr,0,ir))<Mr)for(Ae.dlShiftTo(Rr,qr),te.subTo(qr,te);te[sr]<--Mr;)te.subTo(qr,te)}Z!=null&&(te.drShiftTo(ir,Z),Te!=De&&o.ZERO.subTo(Z,Z)),te.t=ir,te.clamp(),tr>0&&te.rShiftTo(tr,te),Te<0&&o.ZERO.subTo(te,te)}}}function T(V){var Z=d();return this.abs().divRemTo(V,null,Z),this.s<0&&Z.compareTo(o.ZERO)>0&&V.subTo(Z,Z),Z}function A(V){this.m=V}function w(V){return V.s<0||V.compareTo(this.m)>=0?V.mod(this.m):V}function M(V){return V}function x(V){V.divRemTo(this.m,null,V)}function L(V,Z,te){V.multiplyTo(Z,te),this.reduce(te)}function K(V,Z){V.squareTo(Z),this.reduce(Z)}A.prototype.convert=w,A.prototype.revert=M,A.prototype.reduce=x,A.prototype.mulTo=L,A.prototype.sqrTo=K;function Q(){if(this.t<1)return 0;var V=this[0];if((V&1)===0)return 0;var Z=V&3;return Z=Z*(2-(V&15)*Z)&15,Z=Z*(2-(V&255)*Z)&255,Z=Z*(2-((V&65535)*Z&65535))&65535,Z=Z*(2-V*Z%this.DV)%this.DV,Z>0?this.DV-Z:-Z}function j(V){this.m=V,this.mp=V.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<V.DB-15)-1,this.mt2=2*V.t}function N(V){var Z=d();return V.abs().dlShiftTo(this.m.t,Z),Z.divRemTo(this.m,null,Z),V.s<0&&Z.compareTo(o.ZERO)>0&&this.m.subTo(Z,Z),Z}function F(V){var Z=d();return V.copyTo(Z),this.reduce(Z),Z}function ee(V){for(;V.t<=this.mt2;)V[V.t++]=0;for(var Z=0;Z<this.m.t;++Z){var te=V[Z]&32767,he=te*this.mpl+((te*this.mph+(V[Z]>>15)*this.mpl&this.um)<<15)&V.DM;for(te=Z+this.m.t,V[te]+=this.m.am(0,he,V,Z,0,this.m.t);V[te]>=V.DV;)V[te]-=V.DV,V[++te]++}V.clamp(),V.drShiftTo(this.m.t,V),V.compareTo(this.m)>=0&&V.subTo(this.m,V)}function ae(V,Z){V.squareTo(Z),this.reduce(Z)}function G(V,Z,te){V.multiplyTo(Z,te),this.reduce(te)}j.prototype.convert=N,j.prototype.revert=F,j.prototype.reduce=ee,j.prototype.mulTo=G,j.prototype.sqrTo=ae;function z(){return(this.t>0?this[0]&1:this.s)===0}function fe(V,Z){if(V>4294967295||V<1)return o.ONE;var te=d(),he=d(),Ee=Z.convert(this),Ae=ie(V)-1;for(Ee.copyTo(te);--Ae>=0;)if(Z.sqrTo(te,he),(V&1<<Ae)>0)Z.mulTo(he,Ee,te);else{var Te=te;te=he,he=Te}return Z.revert(te)}function me(V,Z){var te;return V<256||Z.isEven()?te=new A(Z):te=new j(Z),this.exp(V,te)}function xe(){var V=d();return this.copyTo(V),V}function _e(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t===0)return-1}else{if(this.t==1)return this[0];if(this.t===0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]}function qe(){return this.t==0?this.s:this[0]<<24>>24}function Re(){return this.t==0?this.s:this[0]<<16>>16}function be(V){return Math.floor(Math.LN2*this.DB/Math.log(V))}function Fe(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1}function Be(V){if(V==null&&(V=10),this.signum()===0||V<2||V>36)return"0";var Z=this.chunkSize(V),te=Math.pow(V,Z),he=m(te),Ee=d(),Ae=d(),Te="";for(this.divRemTo(he,Ee,Ae);Ee.signum()>0;)Te=(te+Ae.intValue()).toString(V).substr(1)+Te,Ee.divRemTo(he,Ee,Ae);return Ae.intValue().toString(V)+Te}function Me(V,Z){this.fromInt(0),Z==null&&(Z=10);for(var te=this.chunkSize(Z),he=Math.pow(Z,te),Ee=!1,Ae=0,Te=0,De=0;De<V.length;++De){var tr=l(V,De);if(tr<0){V.charAt(De)=="-"&&this.signum()===0&&(Ee=!0);continue}Te=Z*Te+tr,++Ae>=te&&(this.dMultiply(he),this.dAddOffset(Te,0),Ae=0,Te=0)}Ae>0&&(this.dMultiply(Math.pow(Z,Ae)),this.dAddOffset(Te,0)),Ee&&o.ZERO.subTo(this,this)}function Pe(V,Z){if(typeof Z=="number")if(V<2)this.fromInt(1);else for(this.fromNumber(V),this.testBit(V-1)||this.bitwiseTo(o.ONE.shiftLeft(V-1),C,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(Z);)this.dAddOffset(2,0),this.bitLength()>V&&this.subTo(o.ONE.shiftLeft(V-1),this);else{var te=s.randomBytes((V>>3)+1),he=V&7;he>0?te[0]&=(1<<he)-1:te[0]=0,this.fromByteArray(te)}}function oe(){var V=this.t,Z=new Array;Z[0]=this.s;var te=this.DB-V*this.DB%8,he,Ee=0;if(V-- >0)for(te<this.DB&&(he=this[V]>>te)!=(this.s&this.DM)>>te&&(Z[Ee++]=he|this.s<<this.DB-te);V>=0;)te<8?(he=(this[V]&(1<<te)-1)<<8-te,he|=this[--V]>>(te+=this.DB-8)):(he=this[V]>>(te-=8)&255,te<=0&&(te+=this.DB,--V)),(he&128)!=0&&(he|=-256),Ee===0&&(this.s&128)!=(he&128)&&++Ee,(Ee>0||he!=this.s)&&(Z[Ee++]=he);return Z}function ce(V){var Z=Buffer.from(this.toByteArray());if(V===!0&&Z[0]===0)Z=Z.slice(1);else if(t.isNumber(V)){if(Z.length>V){for(var te=0;te<Z.length-V;te++)if(Z[te]!==0)return null;return Z.slice(Z.length-V)}else if(Z.length<V){var he=Buffer.alloc(V);return he.fill(0,0,V-Z.length),Z.copy(he,V-Z.length),he}}return Z}function ge(V){return this.compareTo(V)==0}function we(V){return this.compareTo(V)<0?this:V}function Se(V){return this.compareTo(V)>0?this:V}function Oe(V,Z,te){var he,Ee,Ae=Math.min(V.t,this.t);for(he=0;he<Ae;++he)te[he]=Z(this[he],V[he]);if(V.t<this.t){for(Ee=V.s&this.DM,he=Ae;he<this.t;++he)te[he]=Z(this[he],Ee);te.t=this.t}else{for(Ee=this.s&this.DM,he=Ae;he<V.t;++he)te[he]=Z(Ee,V[he]);te.t=V.t}te.s=Z(this.s,V.s),te.clamp()}function U(V,Z){return V&Z}function I(V){var Z=d();return this.bitwiseTo(V,U,Z),Z}function C(V,Z){return V|Z}function J(V){var Z=d();return this.bitwiseTo(V,C,Z),Z}function se(V,Z){return V^Z}function le(V){var Z=d();return this.bitwiseTo(V,se,Z),Z}function ve(V,Z){return V&~Z}function Ce(V){var Z=d();return this.bitwiseTo(V,ve,Z),Z}function Le(){for(var V=d(),Z=0;Z<this.t;++Z)V[Z]=this.DM&~this[Z];return V.t=this.t,V.s=~this.s,V}function Ie(V){var Z=d();return V<0?this.rShiftTo(-V,Z):this.lShiftTo(V,Z),Z}function je(V){var Z=d();return V<0?this.lShiftTo(-V,Z):this.rShiftTo(V,Z),Z}function $e(V){if(V===0)return-1;var Z=0;return(V&65535)===0&&(V>>=16,Z+=16),(V&255)===0&&(V>>=8,Z+=8),(V&15)===0&&(V>>=4,Z+=4),(V&3)===0&&(V>>=2,Z+=2),(V&1)===0&&++Z,Z}function Ve(){for(var V=0;V<this.t;++V)if(this[V]!=0)return V*this.DB+$e(this[V]);return this.s<0?this.t*this.DB:-1}function Ke(V){for(var Z=0;V!=0;)V&=V-1,++Z;return Z}function Xe(){for(var V=0,Z=this.s&this.DM,te=0;te<this.t;++te)V+=Ke(this[te]^Z);return V}function We(V){var Z=Math.floor(V/this.DB);return Z>=this.t?this.s!=0:(this[Z]&1<<V%this.DB)!=0}function Ze(V,Z){var te=o.ONE.shiftLeft(V);return this.bitwiseTo(te,Z,te),te}function Ye(V){return this.changeBit(V,C)}function W(V){return this.changeBit(V,ve)}function P(V){return this.changeBit(V,se)}function k(V,Z){for(var te=0,he=0,Ee=Math.min(V.t,this.t);te<Ee;)he+=this[te]+V[te],Z[te++]=he&this.DM,he>>=this.DB;if(V.t<this.t){for(he+=V.s;te<this.t;)he+=this[te],Z[te++]=he&this.DM,he>>=this.DB;he+=this.s}else{for(he+=this.s;te<V.t;)he+=V[te],Z[te++]=he&this.DM,he>>=this.DB;he+=V.s}Z.s=he<0?-1:0,he>0?Z[te++]=he:he<-1&&(Z[te++]=this.DV+he),Z.t=te,Z.clamp()}function re(V){var Z=d();return this.addTo(V,Z),Z}function ue(V){var Z=d();return this.subTo(V,Z),Z}function pe(V){var Z=d();return this.multiplyTo(V,Z),Z}function ye(){var V=d();return this.squareTo(V),V}function ke(V){var Z=d();return this.divRemTo(V,Z,null),Z}function He(V){var Z=d();return this.divRemTo(V,null,Z),Z}function Ne(V){var Z=d(),te=d();return this.divRemTo(V,Z,te),new Array(Z,te)}function ze(V){this[this.t]=this.am(0,V-1,this,0,0,this.t),++this.t,this.clamp()}function Ue(V,Z){if(V!==0){for(;this.t<=Z;)this[this.t++]=0;for(this[Z]+=V;this[Z]>=this.DV;)this[Z]-=this.DV,++Z>=this.t&&(this[this.t++]=0),++this[Z]}}function Ge(){}function Je(V){return V}function Qe(V,Z,te){V.multiplyTo(Z,te)}function er(V,Z){V.squareTo(Z)}Ge.prototype.convert=Je,Ge.prototype.revert=Je,Ge.prototype.mulTo=Qe,Ge.prototype.sqrTo=er;function fr(V){return this.exp(V,new Ge)}function ur(V,Z,te){var he=Math.min(this.t+V.t,Z);for(te.s=0,te.t=he;he>0;)te[--he]=0;var Ee;for(Ee=te.t-this.t;he<Ee;++he)te[he+this.t]=this.am(0,V[he],te,he,0,this.t);for(Ee=Math.min(V.t,Z);he<Ee;++he)this.am(0,V[he],te,he,0,Z-he);te.clamp()}function cr(V,Z,te){--Z;var he=te.t=this.t+V.t-Z;for(te.s=0;--he>=0;)te[he]=0;for(he=Math.max(Z-this.t,0);he<V.t;++he)te[this.t+he-Z]=this.am(Z-he,V[he],te,0,0,this.t+he-Z);te.clamp(),te.drShiftTo(1,te)}function nr(V){this.r2=d(),this.q3=d(),o.ONE.dlShiftTo(2*V.t,this.r2),this.mu=this.r2.divide(V),this.m=V}function hr(V){if(V.s<0||V.t>2*this.m.t)return V.mod(this.m);if(V.compareTo(this.m)<0)return V;var Z=d();return V.copyTo(Z),this.reduce(Z),Z}function lr(V){return V}function dr(V){for(V.drShiftTo(this.m.t-1,this.r2),V.t>this.m.t+1&&(V.t=this.m.t+1,V.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);V.compareTo(this.r2)<0;)V.dAddOffset(1,this.m.t+1);for(V.subTo(this.r2,V);V.compareTo(this.m)>=0;)V.subTo(this.m,V)}function pr(V,Z){V.squareTo(Z),this.reduce(Z)}function vr(V,Z,te){V.multiplyTo(Z,te),this.reduce(te)}nr.prototype.convert=hr,nr.prototype.revert=lr,nr.prototype.reduce=dr,nr.prototype.mulTo=vr,nr.prototype.sqrTo=pr;function br(V,Z){var te=V.bitLength(),he,Ee=m(1),Ae;if(te<=0)return Ee;te<18?he=1:te<48?he=3:te<144?he=4:te<768?he=5:he=6,te<8?Ae=new A(Z):Z.isEven()?Ae=new nr(Z):Ae=new j(Z);var Te=new Array,De=3,tr=he-1,ir=(1<<he)-1;if(Te[1]=Ae.convert(this),he>1){var Er=d();for(Ae.sqrTo(Te[1],Er);De<=ir;)Te[De]=d(),Ae.mulTo(Er,Te[De-2],Te[De]),De+=2}var ar=V.t-1,Br,Ar=!0,or=d(),sr;for(te=ie(V[ar])-1;ar>=0;){for(te>=tr?Br=V[ar]>>te-tr&ir:(Br=(V[ar]&(1<<te+1)-1)<<tr-te,ar>0&&(Br|=V[ar-1]>>this.DB+te-tr)),De=he;(Br&1)===0;)Br>>=1,--De;if((te-=De)<0&&(te+=this.DB,--ar),Ar)Te[Br].copyTo(Ee),Ar=!1;else{for(;De>1;)Ae.sqrTo(Ee,or),Ae.sqrTo(or,Ee),De-=2;De>0?Ae.sqrTo(Ee,or):(sr=Ee,Ee=or,or=sr),Ae.mulTo(or,Te[Br],Ee)}for(;ar>=0&&(V[ar]&1<<te)===0;)Ae.sqrTo(Ee,or),sr=Ee,Ee=or,or=sr,--te<0&&(te=this.DB-1,--ar)}return Ae.revert(Ee)}function yr(V){var Z=this.s<0?this.negate():this.clone(),te=V.s<0?V.negate():V.clone();if(Z.compareTo(te)<0){var he=Z;Z=te,te=he}var Ee=Z.getLowestSetBit(),Ae=te.getLowestSetBit();if(Ae<0)return Z;for(Ee<Ae&&(Ae=Ee),Ae>0&&(Z.rShiftTo(Ae,Z),te.rShiftTo(Ae,te));Z.signum()>0;)(Ee=Z.getLowestSetBit())>0&&Z.rShiftTo(Ee,Z),(Ee=te.getLowestSetBit())>0&&te.rShiftTo(Ee,te),Z.compareTo(te)>=0?(Z.subTo(te,Z),Z.rShiftTo(1,Z)):(te.subTo(Z,te),te.rShiftTo(1,te));return Ae>0&&te.lShiftTo(Ae,te),te}function gr(V){if(V<=0)return 0;var Z=this.DV%V,te=this.s<0?V-1:0;if(this.t>0)if(Z===0)te=this[0]%V;else for(var he=this.t-1;he>=0;--he)te=(Z*te+this[he])%V;return te}function wr(V){var Z=V.isEven();if(this.isEven()&&Z||V.signum()===0)return o.ZERO;for(var te=V.clone(),he=this.clone(),Ee=m(1),Ae=m(0),Te=m(0),De=m(1);te.signum()!=0;){for(;te.isEven();)te.rShiftTo(1,te),Z?((!Ee.isEven()||!Ae.isEven())&&(Ee.addTo(this,Ee),Ae.subTo(V,Ae)),Ee.rShiftTo(1,Ee)):Ae.isEven()||Ae.subTo(V,Ae),Ae.rShiftTo(1,Ae);for(;he.isEven();)he.rShiftTo(1,he),Z?((!Te.isEven()||!De.isEven())&&(Te.addTo(this,Te),De.subTo(V,De)),Te.rShiftTo(1,Te)):De.isEven()||De.subTo(V,De),De.rShiftTo(1,De);te.compareTo(he)>=0?(te.subTo(he,te),Z&&Ee.subTo(Te,Ee),Ae.subTo(De,Ae)):(he.subTo(te,he),Z&&Te.subTo(Ee,Te),De.subTo(Ae,De))}if(he.compareTo(o.ONE)!=0)return o.ZERO;if(De.compareTo(V)>=0)return De.subtract(V);if(De.signum()<0)De.addTo(V,De);else return De;return De.signum()<0?De.add(V):De}var rr=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],_r=(1<<26)/rr[rr.length-1];function xr(V){var Z,te=this.abs();if(te.t==1&&te[0]<=rr[rr.length-1]){for(Z=0;Z<rr.length;++Z)if(te[0]==rr[Z])return!0;return!1}if(te.isEven())return!1;for(Z=1;Z<rr.length;){for(var he=rr[Z],Ee=Z+1;Ee<rr.length&&he<_r;)he*=rr[Ee++];for(he=te.modInt(he);Z<Ee;)if(he%rr[Z++]===0)return!1}return te.millerRabin(V)}function Sr(V){var Z=this.subtract(o.ONE),te=Z.getLowestSetBit();if(te<=0)return!1;var he=Z.shiftRight(te);V=V+1>>1,V>rr.length&&(V=rr.length);for(var Ee=d(),Ae=0;Ae<V;++Ae){Ee.fromInt(rr[Math.floor(Math.random()*rr.length)]);var Te=Ee.modPow(he,this);if(Te.compareTo(o.ONE)!=0&&Te.compareTo(Z)!=0){for(var De=1;De++<te&&Te.compareTo(Z)!=0;)if(Te=Te.modPowInt(2,this),Te.compareTo(o.ONE)===0)return!1;if(Te.compareTo(Z)!=0)return!1}}return!0}return o.prototype.copyTo=v,o.prototype.fromInt=b,o.prototype.fromString=B,o.prototype.fromByteArray=E,o.prototype.fromBuffer=S,o.prototype.clamp=O,o.prototype.dlShiftTo=de,o.prototype.drShiftTo=X,o.prototype.lShiftTo=y,o.prototype.rShiftTo=g,o.prototype.subTo=p,o.prototype.multiplyTo=_,o.prototype.squareTo=R,o.prototype.divRemTo=q,o.prototype.invDigit=Q,o.prototype.isEven=z,o.prototype.exp=fe,o.prototype.chunkSize=be,o.prototype.toRadix=Be,o.prototype.fromRadix=Me,o.prototype.fromNumber=Pe,o.prototype.bitwiseTo=Oe,o.prototype.changeBit=Ze,o.prototype.addTo=k,o.prototype.dMultiply=ze,o.prototype.dAddOffset=Ue,o.prototype.multiplyLowerTo=ur,o.prototype.multiplyUpperTo=cr,o.prototype.modInt=gr,o.prototype.millerRabin=Sr,o.prototype.toString=D,o.prototype.negate=$,o.prototype.abs=H,o.prototype.compareTo=Y,o.prototype.bitLength=ne,o.prototype.mod=T,o.prototype.modPowInt=me,o.prototype.clone=xe,o.prototype.intValue=_e,o.prototype.byteValue=qe,o.prototype.shortValue=Re,o.prototype.signum=Fe,o.prototype.toByteArray=oe,o.prototype.toBuffer=ce,o.prototype.equals=ge,o.prototype.min=we,o.prototype.max=Se,o.prototype.and=I,o.prototype.or=J,o.prototype.xor=le,o.prototype.andNot=Ce,o.prototype.not=Le,o.prototype.shiftLeft=Ie,o.prototype.shiftRight=je,o.prototype.getLowestSetBit=Ve,o.prototype.bitCount=Xe,o.prototype.testBit=We,o.prototype.setBit=Ye,o.prototype.clearBit=W,o.prototype.flipBit=P,o.prototype.add=re,o.prototype.subtract=ue,o.prototype.multiply=pe,o.prototype.divide=ke,o.prototype.remainder=He,o.prototype.divideAndRemainder=Ne,o.prototype.modPow=br,o.prototype.modInverse=wr,o.prototype.pow=fr,o.prototype.gcd=yr,o.prototype.isProbablePrime=xr,o.int2char=u,o.ZERO=m(0),o.ONE=m(1),o.prototype.square=ye,jsbn=o,jsbn}var schemes={exports:{}},pkcs1$1={exports:{}},hasRequiredPkcs1$1;function requirePkcs1$1(){if(hasRequiredPkcs1$1)return pkcs1$1.exports;hasRequiredPkcs1$1=1;var s=requireJsbn(),t=requireCryptoBrowserify(),f=require$$0$1,o={md2:Buffer.from("3020300c06082a864886f70d020205000410","hex"),md5:Buffer.from("3020300c06082a864886f70d020505000410","hex"),sha1:Buffer.from("3021300906052b0e03021a05000414","hex"),sha224:Buffer.from("302d300d06096086480165030402040500041c","hex"),sha256:Buffer.from("3031300d060960864801650304020105000420","hex"),sha384:Buffer.from("3041300d060960864801650304020205000430","hex"),sha512:Buffer.from("3051300d060960864801650304020305000440","hex"),ripemd160:Buffer.from("3021300906052b2403020105000414","hex"),rmd160:Buffer.from("3021300906052b2403020105000414","hex")},d={ripemd160:"rmd160"},r="sha256";return pkcs1$1.exports={isEncryption:!0,isSignature:!0},pkcs1$1.exports.makeScheme=function(h,c){function n(a,e){this.key=a,this.options=e}return n.prototype.maxMessageLength=function(){return this.options.encryptionSchemeOptions&&this.options.encryptionSchemeOptions.padding==f.RSA_NO_PADDING?this.key.encryptedDataLength:this.key.encryptedDataLength-11},n.prototype.encPad=function(a,e){e=e||{};var u;if(a.length>this.key.maxMessageLength)throw new Error("Message too long for RSA (n="+this.key.encryptedDataLength+", l="+a.length+")");if(this.options.encryptionSchemeOptions&&this.options.encryptionSchemeOptions.padding==f.RSA_NO_PADDING)return u=Buffer.alloc(this.key.maxMessageLength-a.length),u.fill(0),Buffer.concat([u,a]);if(e.type===1)return u=Buffer.alloc(this.key.encryptedDataLength-a.length-1),u.fill(255,0,u.length-1),u[0]=1,u[u.length-1]=0,Buffer.concat([u,a]);u=Buffer.alloc(this.key.encryptedDataLength-a.length),u[0]=0,u[1]=2;for(var l=t.randomBytes(u.length-3),v=0;v<l.length;v++){for(var b=l[v];b===0;)b=t.randomBytes(1)[0];u[v+2]=b}return u[u.length-1]=0,Buffer.concat([u,a])},n.prototype.encUnPad=function(a,e){e=e||{};var u=0;if(this.options.encryptionSchemeOptions&&this.options.encryptionSchemeOptions.padding==f.RSA_NO_PADDING){var l;return typeof a.lastIndexOf=="function"?l=a.slice(a.lastIndexOf("\0")+1,a.length):l=a.slice(String.prototype.lastIndexOf.call(a,"\0")+1,a.length),l}if(a.length<4)return null;if(e.type===1){if(a[0]!==0||a[1]!==1)return null;for(u=3;a[u]!==0;)if(a[u]!=255||++u>=a.length)return null}else{if(a[0]!==0||a[1]!==2)return null;for(u=3;a[u]!==0;)if(++u>=a.length)return null}return a.slice(u+1,a.length)},n.prototype.sign=function(a){var e=this.options.signingSchemeOptions.hash||r;if(this.options.environment==="browser"){e=d[e]||e;var u=t.createHash(e);u.update(a);var l=this.pkcs1pad(u.digest(),e),v=this.key.$doPrivate(new s(l)).toBuffer(this.key.encryptedDataLength);return v}else{var b=t.createSign("RSA-"+e.toUpperCase());return b.update(a),b.sign(this.options.rsaUtils.exportKey("private"))}},n.prototype.verify=function(a,e,u){if(this.options.encryptionSchemeOptions&&this.options.encryptionSchemeOptions.padding==f.RSA_NO_PADDING)return!1;var l=this.options.signingSchemeOptions.hash||r;if(this.options.environment==="browser"){l=d[l]||l,u&&(e=Buffer.from(e,u));var v=t.createHash(l);v.update(a);var b=this.pkcs1pad(v.digest(),l),m=this.key.$doPublic(new s(e));return m.toBuffer().toString("hex")==b.toString("hex")}else{var B=t.createVerify("RSA-"+l.toUpperCase());return B.update(a),B.verify(this.options.rsaUtils.exportKey("public"),e,u)}},n.prototype.pkcs0pad=function(a){var e=Buffer.alloc(this.key.maxMessageLength-a.length);return e.fill(0),Buffer.concat([e,a])},n.prototype.pkcs0unpad=function(a){var e;return typeof a.lastIndexOf=="function"?e=a.slice(a.lastIndexOf("\0")+1,a.length):e=a.slice(String.prototype.lastIndexOf.call(a,"\0")+1,a.length),e},n.prototype.pkcs1pad=function(a,e){var u=o[e];if(!u)throw Error("Unsupported hash algorithm");var l=Buffer.concat([u,a]);if(l.length+10>this.key.encryptedDataLength)throw Error("Key is too short for signing algorithm ("+e+")");var v=Buffer.alloc(this.key.encryptedDataLength-l.length-1);v.fill(255,0,v.length-1),v[0]=1,v[v.length-1]=0;var b=Buffer.concat([v,l]);return b},new n(h,c)},pkcs1$1.exports}var oaep={exports:{}},hasRequiredOaep;function requireOaep(){return hasRequiredOaep||(hasRequiredOaep=1,(function(s){requireJsbn();var t=requireCryptoBrowserify();s.exports={isEncryption:!0,isSignature:!1},s.exports.digestLength={md4:16,md5:16,ripemd160:20,rmd160:20,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64};var f="sha1";s.exports.eme_oaep_mgf1=function(o,d,r){r=r||f;for(var h=s.exports.digestLength[r],c=Math.ceil(d/h),n=Buffer.alloc(h*c),a=Buffer.alloc(4),e=0;e<c;++e){var u=t.createHash(r);u.update(o),a.writeUInt32BE(e,0),u.update(a),u.digest().copy(n,e*h)}return n.slice(0,d)},s.exports.makeScheme=function(o,d){function r(h,c){this.key=h,this.options=c}return r.prototype.maxMessageLength=function(){return this.key.encryptedDataLength-2*s.exports.digestLength[this.options.encryptionSchemeOptions.hash||f]-2},r.prototype.encPad=function(h){var c=this.options.encryptionSchemeOptions.hash||f,n=this.options.encryptionSchemeOptions.mgf||s.exports.eme_oaep_mgf1,a=this.options.encryptionSchemeOptions.label||Buffer.alloc(0),e=this.key.encryptedDataLength,u=s.exports.digestLength[c];if(h.length>e-2*u-2)throw new Error("Message is too long to encode into an encoded message with a length of "+e+" bytes, increaseemLen to fix this error (minimum value for given parameters and options: "+(e-2*u-2)+")");var l=t.createHash(c);l.update(a),l=l.digest();var v=Buffer.alloc(e-h.length-2*u-1);v.fill(0),v[v.length-1]=1;for(var b=Buffer.concat([l,v,h]),m=t.randomBytes(u),B=n(m,b.length,c),E=0;E<b.length;E++)b[E]^=B[E];for(B=n(b,u,c),E=0;E<m.length;E++)m[E]^=B[E];var S=Buffer.alloc(1+m.length+b.length);return S[0]=0,m.copy(S,1),b.copy(S,1+m.length),S},r.prototype.encUnPad=function(h){var c=this.options.encryptionSchemeOptions.hash||f,n=this.options.encryptionSchemeOptions.mgf||s.exports.eme_oaep_mgf1,a=this.options.encryptionSchemeOptions.label||Buffer.alloc(0),e=s.exports.digestLength[c];if(h.length<2*e+2)throw new Error("Error decoding message, the supplied message is not long enough to be a valid OAEP encoded message");for(var u=h.slice(1,e+1),l=h.slice(1+e),v=n(l,e,c),b=0;b<u.length;b++)u[b]^=v[b];for(v=n(u,l.length,c),b=0;b<l.length;b++)l[b]^=v[b];var m=t.createHash(c);m.update(a),m=m.digest();var B=l.slice(0,e);if(B.toString("hex")!=m.toString("hex"))throw new Error("Error decoding message, the lHash calculated from the label provided and the lHash in the encrypted data do not match.");for(b=e;l[b++]===0&&b<l.length;);if(l[b-1]!=1)throw new Error("Error decoding message, there is no padding message separator byte");return l.slice(b)},new r(o,d)}})(oaep)),oaep.exports}var pss={exports:{}},hasRequiredPss;function requirePss(){if(hasRequiredPss)return pss.exports;hasRequiredPss=1;var s=requireJsbn(),t=requireCryptoBrowserify();pss.exports={isEncryption:!1,isSignature:!0};var f="sha1",o=20;return pss.exports.makeScheme=function(d,r){var h=requireSchemes().pkcs1_oaep;function c(n,a){this.key=n,this.options=a}return c.prototype.sign=function(n){var a=t.createHash(this.options.signingSchemeOptions.hash||f);a.update(n);var e=this.emsa_pss_encode(a.digest(),this.key.keySize-1);return this.key.$doPrivate(new s(e)).toBuffer(this.key.encryptedDataLength)},c.prototype.verify=function(n,a,e){e&&(a=Buffer.from(a,e)),a=new s(a);var u=Math.ceil((this.key.keySize-1)/8),l=this.key.$doPublic(a).toBuffer(u),v=t.createHash(this.options.signingSchemeOptions.hash||f);return v.update(n),this.emsa_pss_verify(v.digest(),l,this.key.keySize-1)},c.prototype.emsa_pss_encode=function(n,a){var e=this.options.signingSchemeOptions.hash||f,u=this.options.signingSchemeOptions.mgf||h.eme_oaep_mgf1,l=this.options.signingSchemeOptions.saltLength||o,v=h.digestLength[e],b=Math.ceil(a/8);if(b<v+l+2)throw new Error("Output length passed to emBits("+a+") is too small for the options specified("+e+", "+l+"). To fix this issue increase the value of emBits. (minimum size: "+(8*v+8*l+9)+")");var m=t.randomBytes(l),B=Buffer.alloc(8+v+l);B.fill(0,0,8),n.copy(B,8),m.copy(B,8+n.length);var E=t.createHash(e);E.update(B),E=E.digest();var S=Buffer.alloc(b-m.length-v-2);S.fill(0);var O=Buffer.alloc(S.length+1+m.length);S.copy(O),O[S.length]=1,m.copy(O,S.length+1);for(var D=u(E,O.length,e),$=Buffer.alloc(O.length),H=0;H<D.length;H++)$[H]=O[H]^D[H];var Y=8*b-a,ie=255^255>>8-Y<<8-Y;$[0]=$[0]&ie;var ne=Buffer.alloc($.length+E.length+1);return $.copy(ne,0),E.copy(ne,$.length),ne[ne.length-1]=188,ne},c.prototype.emsa_pss_verify=function(n,a,e){var u=this.options.signingSchemeOptions.hash||f,l=this.options.signingSchemeOptions.mgf||h.eme_oaep_mgf1,v=this.options.signingSchemeOptions.saltLength||o,b=h.digestLength[u],m=Math.ceil(e/8);if(m<b+v+2||a[a.length-1]!=188)return!1;var B=Buffer.alloc(m-b-1);a.copy(B,0,0,m-b-1);for(var E=0,S=0,O=8*m-e;S<O;S++)E|=1<<7-S;if((B[0]&E)!==0)return!1;var D=a.slice(m-b-1,m-1),$=l(D,B.length,u);for(S=0;S<B.length;S++)B[S]^=$[S];for(O=8*m-e,E=255^255>>8-O<<8-O,B[0]=B[0]&E,S=0;B[S]===0&&S<B.length;S++);if(B[S]!=1)return!1;var H=B.slice(B.length-v),Y=Buffer.alloc(8+b+v);Y.fill(0,0,8),n.copy(Y,8),H.copy(Y,8+n.length);var ie=t.createHash(u);return ie.update(Y),ie=ie.digest(),D.toString("hex")===ie.toString("hex")},new c(d,r)},pss.exports}var hasRequiredSchemes;function requireSchemes(){return hasRequiredSchemes||(hasRequiredSchemes=1,(function(s){s.exports={pkcs1:requirePkcs1$1(),pkcs1_oaep:requireOaep(),pss:requirePss(),isEncryption:function(t){return s.exports[t]&&s.exports[t].isEncryption},isSignature:function(t){return s.exports[t]&&s.exports[t].isSignature}}})(schemes)),schemes.exports}var js,hasRequiredJs;function requireJs(){if(hasRequiredJs)return js;hasRequiredJs=1;var s=requireJsbn(),t=requireSchemes();return js=function(f,o){var d=t.pkcs1.makeScheme(f,o);return{encrypt:function(r,h){var c,n;return h?(c=new s(d.encPad(r,{type:1})),n=f.$doPrivate(c)):(c=new s(f.encryptionScheme.encPad(r)),n=f.$doPublic(c)),n.toBuffer(f.encryptedDataLength)},decrypt:function(r,h){var c,n=new s(r);return h?(c=f.$doPublic(n),d.encUnPad(c.toBuffer(f.encryptedDataLength),{type:1})):(c=f.$doPrivate(n),f.encryptionScheme.encUnPad(c.toBuffer(f.encryptedDataLength)))}}},js}var io,hasRequiredIo;function requireIo(){if(hasRequiredIo)return io;hasRequiredIo=1;var s=requireCryptoBrowserify(),t=require$$0$1,f=requireSchemes();return io=function(o,d){var r=f.pkcs1.makeScheme(o,d);return{encrypt:function(h,c){var n;if(c)return n=t.RSA_PKCS1_PADDING,d.encryptionSchemeOptions&&d.encryptionSchemeOptions.padding&&(n=d.encryptionSchemeOptions.padding),s.privateEncrypt({key:d.rsaUtils.exportKey("private"),padding:n},h);n=t.RSA_PKCS1_OAEP_PADDING,d.encryptionScheme==="pkcs1"&&(n=t.RSA_PKCS1_PADDING),d.encryptionSchemeOptions&&d.encryptionSchemeOptions.padding&&(n=d.encryptionSchemeOptions.padding);var a=h;return n===t.RSA_NO_PADDING&&(a=r.pkcs0pad(h)),s.publicEncrypt({key:d.rsaUtils.exportKey("public"),padding:n},a)},decrypt:function(h,c){var n;if(c)return n=t.RSA_PKCS1_PADDING,d.encryptionSchemeOptions&&d.encryptionSchemeOptions.padding&&(n=d.encryptionSchemeOptions.padding),s.publicDecrypt({key:d.rsaUtils.exportKey("public"),padding:n},h);n=t.RSA_PKCS1_OAEP_PADDING,d.encryptionScheme==="pkcs1"&&(n=t.RSA_PKCS1_PADDING),d.encryptionSchemeOptions&&d.encryptionSchemeOptions.padding&&(n=d.encryptionSchemeOptions.padding);var a=s.privateDecrypt({key:d.rsaUtils.exportKey("private"),padding:n},h);return n===t.RSA_NO_PADDING?r.pkcs0unpad(a):a}}},io}var node12,hasRequiredNode12;function requireNode12(){if(hasRequiredNode12)return node12;hasRequiredNode12=1;var s=requireCryptoBrowserify(),t=require$$0$1,f=requireSchemes();return node12=function(o,d){var r=requireJs()(o,d),h=f.pkcs1.makeScheme(o,d);return{encrypt:function(c,n){if(n)return r.encrypt(c,n);var a=t.RSA_PKCS1_OAEP_PADDING;d.encryptionScheme==="pkcs1"&&(a=t.RSA_PKCS1_PADDING),d.encryptionSchemeOptions&&d.encryptionSchemeOptions.padding&&(a=d.encryptionSchemeOptions.padding);var e=c;return a===t.RSA_NO_PADDING&&(e=h.pkcs0pad(c)),s.publicEncrypt({key:d.rsaUtils.exportKey("public"),padding:a},e)},decrypt:function(c,n){if(n)return r.decrypt(c,n);var a=t.RSA_PKCS1_OAEP_PADDING;d.encryptionScheme==="pkcs1"&&(a=t.RSA_PKCS1_PADDING),d.encryptionSchemeOptions&&d.encryptionSchemeOptions.padding&&(a=d.encryptionSchemeOptions.padding);var e=s.privateDecrypt({key:d.rsaUtils.exportKey("private"),padding:a},c);return a===t.RSA_NO_PADDING?h.pkcs0unpad(e):e}}},node12}var encryptEngines,hasRequiredEncryptEngines;function requireEncryptEngines(){if(hasRequiredEncryptEngines)return encryptEngines;hasRequiredEncryptEngines=1;var s=requireCryptoBrowserify();return encryptEngines={getEngine:function(t,f){var o=requireJs();return f.environment==="node"&&typeof s.publicEncrypt=="function"&&typeof s.privateDecrypt=="function"&&(typeof s.privateEncrypt=="function"&&typeof s.publicDecrypt=="function"?o=requireIo():o=requireNode12()),o(t,f)}},encryptEngines}var hasRequiredRsa;function requireRsa(){if(hasRequiredRsa)return rsa;hasRequiredRsa=1;var s=requireUtils()._;requireCryptoBrowserify();var t=requireJsbn(),f=requireUtils(),o=requireSchemes(),d=requireEncryptEngines();return rsa.BigInteger=t,rsa.Key=(function(){function r(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return r.prototype.setOptions=function(h){var c=o[h.signingScheme],n=o[h.encryptionScheme];c===n?this.signingScheme=this.encryptionScheme=n.makeScheme(this,h):(this.encryptionScheme=n.makeScheme(this,h),this.signingScheme=c.makeScheme(this,h)),this.encryptEngine=d.getEngine(this,h)},r.prototype.generate=function(h,c){var n=h>>1;this.e=parseInt(c,16);for(var a=new t(c,16);;){for(;this.p=new t(h-n,1),!(this.p.subtract(t.ONE).gcd(a).compareTo(t.ONE)===0&&this.p.isProbablePrime(10)););for(;this.q=new t(n,1),!(this.q.subtract(t.ONE).gcd(a).compareTo(t.ONE)===0&&this.q.isProbablePrime(10)););if(this.p.compareTo(this.q)<=0){var e=this.p;this.p=this.q,this.q=e}var u=this.p.subtract(t.ONE),l=this.q.subtract(t.ONE),v=u.multiply(l);if(v.gcd(a).compareTo(t.ONE)===0){if(this.n=this.p.multiply(this.q),this.n.bitLength()<h)continue;this.d=a.modInverse(v),this.dmp1=this.d.mod(u),this.dmq1=this.d.mod(l),this.coeff=this.q.modInverse(this.p);break}}this.$$recalculateCache()},r.prototype.setPrivate=function(h,c,n,a,e,u,l,v){if(h&&c&&n&&h.length>0&&(s.isNumber(c)||c.length>0)&&n.length>0)this.n=new t(h),this.e=s.isNumber(c)?c:f.get32IntFromBuffer(c,0),this.d=new t(n),a&&e&&u&&l&&v&&(this.p=new t(a),this.q=new t(e),this.dmp1=new t(u),this.dmq1=new t(l),this.coeff=new t(v)),this.$$recalculateCache();else throw Error("Invalid RSA private key")},r.prototype.setPublic=function(h,c){if(h&&c&&h.length>0&&(s.isNumber(c)||c.length>0))this.n=new t(h),this.e=s.isNumber(c)?c:f.get32IntFromBuffer(c,0),this.$$recalculateCache();else throw Error("Invalid RSA public key")},r.prototype.$doPrivate=function(h){if(this.p||this.q)return h.modPow(this.d,this.n);for(var c=h.mod(this.p).modPow(this.dmp1,this.p),n=h.mod(this.q).modPow(this.dmq1,this.q);c.compareTo(n)<0;)c=c.add(this.p);return c.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)},r.prototype.$doPublic=function(h){return h.modPowInt(this.e,this.n)},r.prototype.encrypt=function(h,c){var n=[],a=[],e=h.length,u=Math.ceil(e/this.maxMessageLength)||1,l=Math.ceil(e/u||1);if(u==1)n.push(h);else for(var v=0;v<u;v++)n.push(h.slice(v*l,(v+1)*l));for(var b=0;b<n.length;b++)a.push(this.encryptEngine.encrypt(n[b],c));return Buffer.concat(a)},r.prototype.decrypt=function(h,c){if(h.length%this.encryptedDataLength>0)throw Error("Incorrect data or key");for(var n=[],a=0,e=0,u=h.length/this.encryptedDataLength,l=0;l<u;l++)a=l*this.encryptedDataLength,e=a+this.encryptedDataLength,n.push(this.encryptEngine.decrypt(h.slice(a,Math.min(e,h.length)),c));return Buffer.concat(n)},r.prototype.sign=function(h){return this.signingScheme.sign.apply(this.signingScheme,arguments)},r.prototype.verify=function(h,c,n){return this.signingScheme.verify.apply(this.signingScheme,arguments)},r.prototype.isPrivate=function(){return this.n&&this.e&&this.d&&!0||!1},r.prototype.isPublic=function(h){return this.n&&this.e&&!(h&&this.d)||!1},Object.defineProperty(r.prototype,"keySize",{get:function(){return this.cache.keyBitLength}}),Object.defineProperty(r.prototype,"encryptedDataLength",{get:function(){return this.cache.keyByteLength}}),Object.defineProperty(r.prototype,"maxMessageLength",{get:function(){return this.encryptionScheme.maxMessageLength()}}),r.prototype.$$recalculateCache=function(){this.cache=this.cache||{},this.cache.keyBitLength=this.n.bitLength(),this.cache.keyByteLength=this.cache.keyBitLength+6>>3},r})(),rsa}var ber={exports:{}},errors$1,hasRequiredErrors$1;function requireErrors$1(){return hasRequiredErrors$1||(hasRequiredErrors$1=1,errors$1={newInvalidAsn1Error:function(s){var t=new Error;return t.name="InvalidAsn1Error",t.message=s||"",t}}),errors$1}var types,hasRequiredTypes;function requireTypes(){return hasRequiredTypes||(hasRequiredTypes=1,types={EOC:0,Boolean:1,Integer:2,BitString:3,OctetString:4,Null:5,OID:6,ObjectDescriptor:7,External:8,Real:9,Enumeration:10,PDV:11,Utf8String:12,RelativeOID:13,Sequence:16,Set:17,NumericString:18,PrintableString:19,T61String:20,VideotexString:21,IA5String:22,UTCTime:23,GeneralizedTime:24,GraphicString:25,VisibleString:26,GeneralString:28,UniversalString:29,CharacterString:30,BMPString:31,Constructor:32,Context:128}),types}var assert={exports:{}},errors={},hasRequiredErrors;function requireErrors(){if(hasRequiredErrors)return errors;hasRequiredErrors=1;function s(S){"@babel/helpers - typeof";return s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(O){return typeof O}:function(O){return O&&typeof Symbol=="function"&&O.constructor===Symbol&&O!==Symbol.prototype?"symbol":typeof O},s(S)}function t(S,O,D){return Object.defineProperty(S,"prototype",{writable:!1}),S}function f(S,O){if(!(S instanceof O))throw new TypeError("Cannot call a class as a function")}function o(S,O){if(typeof O!="function"&&O!==null)throw new TypeError("Super expression must either be null or a function");S.prototype=Object.create(O&&O.prototype,{constructor:{value:S,writable:!0,configurable:!0}}),Object.defineProperty(S,"prototype",{writable:!1}),O&&d(S,O)}function d(S,O){return d=Object.setPrototypeOf?Object.setPrototypeOf.bind():function($,H){return $.__proto__=H,$},d(S,O)}function r(S){var O=n();return function(){var $=a(S),H;if(O){var Y=a(this).constructor;H=Reflect.construct($,arguments,Y)}else H=$.apply(this,arguments);return h(this,H)}}function h(S,O){if(O&&(s(O)==="object"||typeof O=="function"))return O;if(O!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return c(S)}function c(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}function n(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function a(S){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(D){return D.__proto__||Object.getPrototypeOf(D)},a(S)}var e={},u,l;function v(S,O,D){D||(D=Error);function $(Y,ie,ne){return typeof O=="string"?O:O(Y,ie,ne)}var H=(function(Y){o(ne,Y);var ie=r(ne);function ne(de,X,y){var g;return f(this,ne),g=ie.call(this,$(de,X,y)),g.code=S,g}return t(ne)})(D);e[S]=H}function b(S,O){if(Array.isArray(S)){var D=S.length;return S=S.map(function($){return String($)}),D>2?"one of ".concat(O," ").concat(S.slice(0,D-1).join(", "),", or ")+S[D-1]:D===2?"one of ".concat(O," ").concat(S[0]," or ").concat(S[1]):"of ".concat(O," ").concat(S[0])}else return"of ".concat(O," ").concat(String(S))}function m(S,O,D){return S.substr(0,O.length)===O}function B(S,O,D){return(D===void 0||D>S.length)&&(D=S.length),S.substring(D-O.length,D)===O}function E(S,O,D){return typeof D!="number"&&(D=0),D+O.length>S.length?!1:S.indexOf(O,D)!==-1}return v("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),v("ERR_INVALID_ARG_TYPE",function(S,O,D){u===void 0&&(u=requireAssert()),u(typeof S=="string","'name' must be a string");var $;typeof O=="string"&&m(O,"not ")?($="must not be",O=O.replace(/^not /,"")):$="must be";var H;if(B(S," argument"))H="The ".concat(S," ").concat($," ").concat(b(O,"type"));else{var Y=E(S,".")?"property":"argument";H='The "'.concat(S,'" ').concat(Y," ").concat($," ").concat(b(O,"type"))}return H+=". Received type ".concat(s(D)),H},TypeError),v("ERR_INVALID_ARG_VALUE",function(S,O){var D=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";l===void 0&&(l=requireUtil$1());var $=l.inspect(O);return $.length>128&&($="".concat($.slice(0,128),"...")),"The argument '".concat(S,"' ").concat(D,". Received ").concat($)},TypeError),v("ERR_INVALID_RETURN_VALUE",function(S,O,D){var $;return D&&D.constructor&&D.constructor.name?$="instance of ".concat(D.constructor.name):$="type ".concat(s(D)),"Expected ".concat(S,' to be returned from the "').concat(O,'"')+" function but got ".concat($,".")},TypeError),v("ERR_MISSING_ARGS",function(){for(var S=arguments.length,O=new Array(S),D=0;D<S;D++)O[D]=arguments[D];u===void 0&&(u=requireAssert()),u(O.length>0,"At least one arg needs to be specified");var $="The ",H=O.length;switch(O=O.map(function(Y){return'"'.concat(Y,'"')}),H){case 1:$+="".concat(O[0]," argument");break;case 2:$+="".concat(O[0]," and ").concat(O[1]," arguments");break;default:$+=O.slice(0,H-1).join(", "),$+=", and ".concat(O[H-1]," arguments");break}return"".concat($," must be specified")},TypeError),errors.codes=e,errors}var assertion_error,hasRequiredAssertion_error;function requireAssertion_error(){if(hasRequiredAssertion_error)return assertion_error;hasRequiredAssertion_error=1;function s(A,w){var M=Object.keys(A);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(A);w&&(x=x.filter(function(L){return Object.getOwnPropertyDescriptor(A,L).enumerable})),M.push.apply(M,x)}return M}function t(A){for(var w=1;w<arguments.length;w++){var M=arguments[w]!=null?arguments[w]:{};w%2?s(Object(M),!0).forEach(function(x){f(A,x,M[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(A,Object.getOwnPropertyDescriptors(M)):s(Object(M)).forEach(function(x){Object.defineProperty(A,x,Object.getOwnPropertyDescriptor(M,x))})}return A}function f(A,w,M){return w=h(w),w in A?Object.defineProperty(A,w,{value:M,enumerable:!0,configurable:!0,writable:!0}):A[w]=M,A}function o(A,w){if(!(A instanceof w))throw new TypeError("Cannot call a class as a function")}function d(A,w){for(var M=0;M<w.length;M++){var x=w[M];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(A,h(x.key),x)}}function r(A,w,M){return w&&d(A.prototype,w),Object.defineProperty(A,"prototype",{writable:!1}),A}function h(A){var w=c(A,"string");return S(w)==="symbol"?w:String(w)}function c(A,w){if(S(A)!=="object"||A===null)return A;var M=A[Symbol.toPrimitive];if(M!==void 0){var x=M.call(A,w);if(S(x)!=="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(A)}function n(A,w){if(typeof w!="function"&&w!==null)throw new TypeError("Super expression must either be null or a function");A.prototype=Object.create(w&&w.prototype,{constructor:{value:A,writable:!0,configurable:!0}}),Object.defineProperty(A,"prototype",{writable:!1}),w&&B(A,w)}function a(A){var w=b();return function(){var x=E(A),L;if(w){var K=E(this).constructor;L=Reflect.construct(x,arguments,K)}else L=x.apply(this,arguments);return e(this,L)}}function e(A,w){if(w&&(S(w)==="object"||typeof w=="function"))return w;if(w!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return u(A)}function u(A){if(A===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return A}function l(A){var w=typeof Map=="function"?new Map:void 0;return l=function(x){if(x===null||!m(x))return x;if(typeof x!="function")throw new TypeError("Super expression must either be null or a function");if(typeof w<"u"){if(w.has(x))return w.get(x);w.set(x,L)}function L(){return v(x,arguments,E(this).constructor)}return L.prototype=Object.create(x.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),B(L,x)},l(A)}function v(A,w,M){return b()?v=Reflect.construct.bind():v=function(L,K,Q){var j=[null];j.push.apply(j,K);var N=Function.bind.apply(L,j),F=new N;return Q&&B(F,Q.prototype),F},v.apply(null,arguments)}function b(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function m(A){return Function.toString.call(A).indexOf("[native code]")!==-1}function B(A,w){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,L){return x.__proto__=L,x},B(A,w)}function E(A){return E=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(M){return M.__proto__||Object.getPrototypeOf(M)},E(A)}function S(A){"@babel/helpers - typeof";return S=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(w){return typeof w}:function(w){return w&&typeof Symbol=="function"&&w.constructor===Symbol&&w!==Symbol.prototype?"symbol":typeof w},S(A)}var O=requireUtil$1(),D=O.inspect,$=requireErrors(),H=$.codes.ERR_INVALID_ARG_TYPE;function Y(A,w,M){return(M===void 0||M>A.length)&&(M=A.length),A.substring(M-w.length,M)===w}function ie(A,w){if(w=Math.floor(w),A.length==0||w==0)return"";var M=A.length*w;for(w=Math.floor(Math.log(w)/Math.log(2));w;)A+=A,w--;return A+=A.substring(0,M-A.length),A}var ne="",de="",X="",y="",g={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"},p=10;function _(A){var w=Object.keys(A),M=Object.create(Object.getPrototypeOf(A));return w.forEach(function(x){M[x]=A[x]}),Object.defineProperty(M,"message",{value:A.message}),M}function R(A){return D(A,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function q(A,w,M){var x="",L="",K=0,Q="",j=!1,N=R(A),F=N.split(`
|
|
19
19
|
`),ee=R(w).split(`
|
|
20
|
-
`),ae=0,
|
|
20
|
+
`),ae=0,G="";if(M==="strictEqual"&&S(A)==="object"&&S(w)==="object"&&A!==null&&w!==null&&(M="strictEqualObject"),F.length===1&&ee.length===1&&F[0]!==ee[0]){var z=F[0].length+ee[0].length;if(z<=p){if((S(A)!=="object"||A===null)&&(S(w)!=="object"||w===null)&&(A!==0||w!==0))return"".concat(g[M],`
|
|
21
21
|
|
|
22
22
|
`)+"".concat(F[0]," !== ").concat(ee[0],`
|
|
23
|
-
`)}else if(M!=="strictEqualObject"){var fe=process$1.stderr&&process$1.stderr.isTTY?process$1.stderr.columns:80;if(
|
|
23
|
+
`)}else if(M!=="strictEqualObject"){var fe=process$1.stderr&&process$1.stderr.isTTY?process$1.stderr.columns:80;if(z<fe){for(;F[0][ae]===ee[0][ae];)ae++;ae>2&&(G=`
|
|
24
24
|
`.concat(ie(" ",ae),"^"),ae=0)}}}for(var me=F[F.length-1],xe=ee[ee.length-1];me===xe&&(ae++<2?Q=`
|
|
25
25
|
`.concat(me).concat(Q):x=me,F.pop(),ee.pop(),!(F.length===0||ee.length===0));)me=F[F.length-1],xe=ee[ee.length-1];var _e=Math.max(F.length,ee.length);if(_e===0){var qe=N.split(`
|
|
26
26
|
`);if(qe.length>30)for(qe[26]="".concat(ne,"...").concat(y);qe.length>27;)qe.pop();return"".concat(g.notIdentical,`
|
|
@@ -28,59 +28,59 @@ https://github.com/browserify/crypto-browserify`)},cryptoBrowserify.constants={D
|
|
|
28
28
|
`).concat(qe.join(`
|
|
29
29
|
`),`
|
|
30
30
|
`)}ae>3&&(Q=`
|
|
31
|
-
`.concat(ne,"...").concat(y).concat(Q),
|
|
31
|
+
`.concat(ne,"...").concat(y).concat(Q),j=!0),x!==""&&(Q=`
|
|
32
32
|
`.concat(x).concat(Q),x="");var Re=0,be=g[M]+`
|
|
33
|
-
`.concat(de,"+ actual").concat(y," ").concat(
|
|
34
|
-
`.concat(ne,"...").concat(y),
|
|
33
|
+
`.concat(de,"+ actual").concat(y," ").concat(X,"- expected").concat(y),Fe=" ".concat(ne,"...").concat(y," Lines skipped");for(ae=0;ae<_e;ae++){var Be=ae-K;if(F.length<ae+1)Be>1&&ae>2&&(Be>4?(L+=`
|
|
34
|
+
`.concat(ne,"...").concat(y),j=!0):Be>3&&(L+=`
|
|
35
35
|
`.concat(ee[ae-2]),Re++),L+=`
|
|
36
36
|
`.concat(ee[ae-1]),Re++),K=ae,x+=`
|
|
37
|
-
`.concat(
|
|
38
|
-
`.concat(ne,"...").concat(y),
|
|
37
|
+
`.concat(X,"-").concat(y," ").concat(ee[ae]),Re++;else if(ee.length<ae+1)Be>1&&ae>2&&(Be>4?(L+=`
|
|
38
|
+
`.concat(ne,"...").concat(y),j=!0):Be>3&&(L+=`
|
|
39
39
|
`.concat(F[ae-2]),Re++),L+=`
|
|
40
40
|
`.concat(F[ae-1]),Re++),K=ae,L+=`
|
|
41
|
-
`.concat(de,"+").concat(y," ").concat(F[ae]),Re++;else{var Me=ee[ae],
|
|
42
|
-
`.concat(ne,"...").concat(y),
|
|
41
|
+
`.concat(de,"+").concat(y," ").concat(F[ae]),Re++;else{var Me=ee[ae],Pe=F[ae],oe=Pe!==Me&&(!Y(Pe,",")||Pe.slice(0,-1)!==Me);oe&&Y(Me,",")&&Me.slice(0,-1)===Pe&&(oe=!1,Pe+=","),oe?(Be>1&&ae>2&&(Be>4?(L+=`
|
|
42
|
+
`.concat(ne,"...").concat(y),j=!0):Be>3&&(L+=`
|
|
43
43
|
`.concat(F[ae-2]),Re++),L+=`
|
|
44
44
|
`.concat(F[ae-1]),Re++),K=ae,L+=`
|
|
45
|
-
`.concat(de,"+").concat(y," ").concat(
|
|
46
|
-
`.concat(
|
|
47
|
-
`.concat(
|
|
45
|
+
`.concat(de,"+").concat(y," ").concat(Pe),x+=`
|
|
46
|
+
`.concat(X,"-").concat(y," ").concat(Me),Re+=2):(L+=x,x="",(Be===1||ae===0)&&(L+=`
|
|
47
|
+
`.concat(Pe),Re++))}if(Re>20&&ae<_e-2)return"".concat(be).concat(Fe,`
|
|
48
48
|
`).concat(L,`
|
|
49
49
|
`).concat(ne,"...").concat(y).concat(x,`
|
|
50
|
-
`)+"".concat(ne,"...").concat(y)}return"".concat(be).concat(
|
|
51
|
-
`).concat(L).concat(x).concat(Q).concat(
|
|
52
|
-
`);if(
|
|
50
|
+
`)+"".concat(ne,"...").concat(y)}return"".concat(be).concat(j?Fe:"",`
|
|
51
|
+
`).concat(L).concat(x).concat(Q).concat(G)}var T=(function(A,w){n(x,A);var M=a(x);function x(L){var K;if(o(this,x),S(L)!=="object"||L===null)throw new H("options","Object",L);var Q=L.message,j=L.operator,N=L.stackStartFn,F=L.actual,ee=L.expected,ae=Error.stackTraceLimit;if(Error.stackTraceLimit=0,Q!=null)K=M.call(this,String(Q));else if(process$1.stderr&&process$1.stderr.isTTY&&(process$1.stderr&&process$1.stderr.getColorDepth&&process$1.stderr.getColorDepth()!==1?(ne="\x1B[34m",de="\x1B[32m",y="\x1B[39m",X="\x1B[31m"):(ne="",de="",y="",X="")),S(F)==="object"&&F!==null&&S(ee)==="object"&&ee!==null&&"stack"in F&&F instanceof Error&&"stack"in ee&&ee instanceof Error&&(F=_(F),ee=_(ee)),j==="deepStrictEqual"||j==="strictEqual")K=M.call(this,q(F,ee,j));else if(j==="notDeepStrictEqual"||j==="notStrictEqual"){var G=g[j],z=R(F).split(`
|
|
52
|
+
`);if(j==="notStrictEqual"&&S(F)==="object"&&F!==null&&(G=g.notStrictEqualObject),z.length>30)for(z[26]="".concat(ne,"...").concat(y);z.length>27;)z.pop();z.length===1?K=M.call(this,"".concat(G," ").concat(z[0])):K=M.call(this,"".concat(G,`
|
|
53
53
|
|
|
54
|
-
`).concat(
|
|
54
|
+
`).concat(z.join(`
|
|
55
55
|
`),`
|
|
56
|
-
`))}else{var fe=R(F),me="",xe=g[
|
|
56
|
+
`))}else{var fe=R(F),me="",xe=g[j];j==="notDeepEqual"||j==="notEqual"?(fe="".concat(g[j],`
|
|
57
57
|
|
|
58
|
-
`).concat(fe),fe.length>1024&&(fe="".concat(fe.slice(0,1021),"..."))):(me="".concat(R(ee)),fe.length>512&&(fe="".concat(fe.slice(0,509),"...")),me.length>512&&(me="".concat(me.slice(0,509),"...")),
|
|
58
|
+
`).concat(fe),fe.length>1024&&(fe="".concat(fe.slice(0,1021),"..."))):(me="".concat(R(ee)),fe.length>512&&(fe="".concat(fe.slice(0,509),"...")),me.length>512&&(me="".concat(me.slice(0,509),"...")),j==="deepEqual"||j==="equal"?fe="".concat(xe,`
|
|
59
59
|
|
|
60
60
|
`).concat(fe,`
|
|
61
61
|
|
|
62
62
|
should equal
|
|
63
63
|
|
|
64
|
-
`):me=" ".concat(
|
|
65
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u(oe,ce){if(oe){if(typeof oe=="string")return o(oe,ce);var ge=Object.prototype.toString.call(oe).slice(8,-1);if(ge==="Object"&&oe.constructor&&(ge=oe.constructor.name),ge==="Map"||ge==="Set")return Array.from(oe);if(ge==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ge))return o(oe,ce)}}function o(oe,ce){(ce==null||ce>oe.length)&&(ce=oe.length);for(var ge=0,we=new Array(ce);ge<ce;ge++)we[ge]=oe[ge];return we}function d(oe,ce){var ge=oe==null?null:typeof Symbol<"u"&&oe[Symbol.iterator]||oe["@@iterator"];if(ge!=null){var we,Se,Oe,U,I=[],C=!0,X=!1;try{if(Oe=(ge=ge.call(oe)).next,ce!==0)for(;!(C=(we=Oe.call(ge)).done)&&(I.push(we.value),I.length!==ce);C=!0);}catch(se){X=!0,Se=se}finally{try{if(!C&&ge.return!=null&&(U=ge.return(),Object(U)!==U))return}finally{if(X)throw Se}}return I}}function r(oe){if(Array.isArray(oe))return oe}function h(oe){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ce){return typeof ce}:function(ce){return ce&&typeof Symbol=="function"&&ce.constructor===Symbol&&ce!==Symbol.prototype?"symbol":typeof ce},h(oe)}var f=/a/g.flags!==void 0,a=function(ce){var ge=[];return ce.forEach(function(we){return ge.push(we)}),ge},n=function(ce){var ge=[];return ce.forEach(function(we,Se){return ge.push([Se,we])}),ge},e=Object.is?Object.is:requireObjectIs(),s=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},l=Number.isNaN?Number.isNaN:requireIsNan();function v(oe){return oe.call.bind(oe)}var b=v(Object.prototype.hasOwnProperty),m=v(Object.prototype.propertyIsEnumerable),q=v(Object.prototype.toString),E=requireUtil$1().types,S=E.isAnyArrayBuffer,O=E.isArrayBufferView,D=E.isDate,j=E.isMap,$=E.isRegExp,J=E.isSet,ie=E.isNativeError,ne=E.isBoxedPrimitive,de=E.isNumberObject,Z=E.isStringObject,y=E.isBooleanObject,g=E.isBigIntObject,p=E.isSymbolObject,_=E.isFloat32Array,R=E.isFloat64Array;function B(oe){if(oe.length===0||oe.length>10)return!0;for(var ce=0;ce<oe.length;ce++){var ge=oe.charCodeAt(ce);if(ge<48||ge>57)return!0}return oe.length===10&&oe>=Math.pow(2,32)}function P(oe){return Object.keys(oe).filter(B).concat(s(oe).filter(Object.prototype.propertyIsEnumerable.bind(oe)))}function A(oe,ce){if(oe===ce)return 0;for(var ge=oe.length,we=ce.length,Se=0,Oe=Math.min(ge,we);Se<Oe;++Se)if(oe[Se]!==ce[Se]){ge=oe[Se],we=ce[Se];break}return ge<we?-1:we<ge?1:0}var w=!0,M=!1,x=0,L=1,K=2,Q=3;function H(oe,ce){return f?oe.source===ce.source&&oe.flags===ce.flags:RegExp.prototype.toString.call(oe)===RegExp.prototype.toString.call(ce)}function N(oe,ce){if(oe.byteLength!==ce.byteLength)return!1;for(var ge=0;ge<oe.byteLength;ge++)if(oe[ge]!==ce[ge])return!1;return!0}function F(oe,ce){return oe.byteLength!==ce.byteLength?!1:A(new Uint8Array(oe.buffer,oe.byteOffset,oe.byteLength),new Uint8Array(ce.buffer,ce.byteOffset,ce.byteLength))===0}function ee(oe,ce){return oe.byteLength===ce.byteLength&&A(new Uint8Array(oe),new Uint8Array(ce))===0}function ae(oe,ce){return de(oe)?de(ce)&&e(Number.prototype.valueOf.call(oe),Number.prototype.valueOf.call(ce)):Z(oe)?Z(ce)&&String.prototype.valueOf.call(oe)===String.prototype.valueOf.call(ce):y(oe)?y(ce)&&Boolean.prototype.valueOf.call(oe)===Boolean.prototype.valueOf.call(ce):g(oe)?g(ce)&&BigInt.prototype.valueOf.call(oe)===BigInt.prototype.valueOf.call(ce):p(ce)&&Symbol.prototype.valueOf.call(oe)===Symbol.prototype.valueOf.call(ce)}function z(oe,ce,ge,we){if(oe===ce)return oe!==0?!0:ge?e(oe,ce):!0;if(ge){if(h(oe)!=="object")return typeof oe=="number"&&l(oe)&&l(ce);if(h(ce)!=="object"||oe===null||ce===null||Object.getPrototypeOf(oe)!==Object.getPrototypeOf(ce))return!1}else{if(oe===null||h(oe)!=="object")return ce===null||h(ce)!=="object"?oe==ce:!1;if(ce===null||h(ce)!=="object")return!1}var Se=q(oe),Oe=q(ce);if(Se!==Oe)return!1;if(Array.isArray(oe)){if(oe.length!==ce.length)return!1;var U=P(oe),I=P(ce);return U.length!==I.length?!1:fe(oe,ce,ge,we,L,U)}if(Se==="[object Object]"&&(!j(oe)&&j(ce)||!J(oe)&&J(ce)))return!1;if(D(oe)){if(!D(ce)||Date.prototype.getTime.call(oe)!==Date.prototype.getTime.call(ce))return!1}else if($(oe)){if(!$(ce)||!H(oe,ce))return!1}else if(ie(oe)||oe instanceof Error){if(oe.message!==ce.message||oe.name!==ce.name)return!1}else if(O(oe)){if(!ge&&(_(oe)||R(oe))){if(!N(oe,ce))return!1}else if(!F(oe,ce))return!1;var C=P(oe),X=P(ce);return C.length!==X.length?!1:fe(oe,ce,ge,we,x,C)}else{if(J(oe))return!J(ce)||oe.size!==ce.size?!1:fe(oe,ce,ge,we,K);if(j(oe))return!j(ce)||oe.size!==ce.size?!1:fe(oe,ce,ge,we,Q);if(S(oe)){if(!ee(oe,ce))return!1}else if(ne(oe)&&!ae(oe,ce))return!1}return fe(oe,ce,ge,we,x)}function G(oe,ce){return ce.filter(function(ge){return m(oe,ge)})}function fe(oe,ce,ge,we,Se,Oe){if(arguments.length===5){Oe=Object.keys(oe);var U=Object.keys(ce);if(Oe.length!==U.length)return!1}for(var I=0;I<Oe.length;I++)if(!b(ce,Oe[I]))return!1;if(ge&&arguments.length===5){var C=s(oe);if(C.length!==0){var X=0;for(I=0;I<C.length;I++){var se=C[I];if(m(oe,se)){if(!m(ce,se))return!1;Oe.push(se),X++}else if(m(ce,se))return!1}var le=s(ce);if(C.length!==le.length&&G(ce,le).length!==X)return!1}else{var ve=s(ce);if(ve.length!==0&&G(ce,ve).length!==0)return!1}}if(Oe.length===0&&(Se===x||Se===L&&oe.length===0||oe.size===0))return!0;if(we===void 0)we={val1:new Map,val2:new Map,position:0};else{var Ce=we.val1.get(oe);if(Ce!==void 0){var Le=we.val2.get(ce);if(Le!==void 0)return Ce===Le}we.position++}we.val1.set(oe,we.position),we.val2.set(ce,we.position);var Ie=Be(oe,ce,ge,Oe,we,Se);return we.val1.delete(oe),we.val2.delete(ce),Ie}function me(oe,ce,ge,we){for(var Se=a(oe),Oe=0;Oe<Se.length;Oe++){var U=Se[Oe];if(z(ce,U,ge,we))return oe.delete(U),!0}return!1}function xe(oe){switch(h(oe)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":oe=+oe;case"number":if(l(oe))return!1}return!0}function _e(oe,ce,ge){var we=xe(ge);return we??(ce.has(we)&&!oe.has(we))}function qe(oe,ce,ge,we,Se){var Oe=xe(ge);if(Oe!=null)return Oe;var U=ce.get(Oe);return U===void 0&&!ce.has(Oe)||!z(we,U,!1,Se)?!1:!oe.has(Oe)&&z(we,U,!1,Se)}function Re(oe,ce,ge,we){for(var Se=null,Oe=a(oe),U=0;U<Oe.length;U++){var I=Oe[U];if(h(I)==="object"&&I!==null)Se===null&&(Se=new Set),Se.add(I);else if(!ce.has(I)){if(ge||!_e(oe,ce,I))return!1;Se===null&&(Se=new Set),Se.add(I)}}if(Se!==null){for(var C=a(ce),X=0;X<C.length;X++){var se=C[X];if(h(se)==="object"&&se!==null){if(!me(Se,se,ge,we))return!1}else if(!ge&&!oe.has(se)&&!me(Se,se,ge,we))return!1}return Se.size===0}return!0}function be(oe,ce,ge,we,Se,Oe){for(var U=a(oe),I=0;I<U.length;I++){var C=U[I];if(z(ge,C,Se,Oe)&&z(we,ce.get(C),Se,Oe))return oe.delete(C),!0}return!1}function Fe(oe,ce,ge,we){for(var Se=null,Oe=n(oe),U=0;U<Oe.length;U++){var I=c(Oe[U],2),C=I[0],X=I[1];if(h(C)==="object"&&C!==null)Se===null&&(Se=new Set),Se.add(C);else{var se=ce.get(C);if(se===void 0&&!ce.has(C)||!z(X,se,ge,we)){if(ge||!qe(oe,ce,C,X,we))return!1;Se===null&&(Se=new Set),Se.add(C)}}}if(Se!==null){for(var le=n(ce),ve=0;ve<le.length;ve++){var Ce=c(le[ve],2),Le=Ce[0],Ie=Ce[1];if(h(Le)==="object"&&Le!==null){if(!be(Se,oe,Le,Ie,ge,we))return!1}else if(!ge&&(!oe.has(Le)||!z(oe.get(Le),Ie,!1,we))&&!be(Se,oe,Le,Ie,!1,we))return!1}return Se.size===0}return!0}function Be(oe,ce,ge,we,Se,Oe){var U=0;if(Oe===K){if(!Re(oe,ce,ge,Se))return!1}else if(Oe===Q){if(!Fe(oe,ce,ge,Se))return!1}else if(Oe===L)for(;U<oe.length;U++)if(b(oe,U)){if(!b(ce,U)||!z(oe[U],ce[U],ge,Se))return!1}else{if(b(ce,U))return!1;for(var I=Object.keys(oe);U<I.length;U++){var C=I[U];if(!b(ce,C)||!z(oe[C],ce[C],ge,Se))return!1}return I.length===Object.keys(ce).length}for(U=0;U<we.length;U++){var X=we[U];if(!z(oe[X],ce[X],ge,Se))return!1}return!0}function Me(oe,ce){return z(oe,ce,M)}function Te(oe,ce){return z(oe,ce,w)}return comparisons={isDeepEqual:Me,isDeepStrictEqual:Te},comparisons}var hasRequiredAssert;function requireAssert(){if(hasRequiredAssert)return assert.exports;hasRequiredAssert=1;function c(K){"@babel/helpers - typeof";return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Q){return typeof Q}:function(Q){return Q&&typeof Symbol=="function"&&Q.constructor===Symbol&&Q!==Symbol.prototype?"symbol":typeof Q},c(K)}function t(K,Q,H){return Object.defineProperty(K,"prototype",{writable:!1}),K}function u(K,Q){if(!(K instanceof Q))throw new TypeError("Cannot call a class as a function")}var o=requireErrors(),d=o.codes,r=d.ERR_AMBIGUOUS_ARGUMENT,h=d.ERR_INVALID_ARG_TYPE,f=d.ERR_INVALID_ARG_VALUE,a=d.ERR_INVALID_RETURN_VALUE,n=d.ERR_MISSING_ARGS,e=requireAssertion_error(),s=requireUtil$1(),l=s.inspect,v=requireUtil$1().types,b=v.isPromise,m=v.isRegExp,q=requirePolyfill$2()(),E=requirePolyfill$1()(),S=requireCallBound()("RegExp.prototype.test"),O,D;function j(){var K=requireComparisons();O=K.isDeepEqual,D=K.isDeepStrictEqual}var $=!1,J=assert.exports=y,ie={};function ne(K){throw K.message instanceof Error?K.message:new e(K)}function de(K,Q,H,N,F){var ee=arguments.length,ae;if(ee===0)ae="Failed";else if(ee===1)H=K,K=void 0;else{if($===!1){$=!0;var z=process$1.emitWarning?process$1.emitWarning:console.warn.bind(console);z("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}ee===2&&(N="!=")}if(H instanceof Error)throw H;var G={actual:K,expected:Q,operator:N===void 0?"fail":N,stackStartFn:F||de};H!==void 0&&(G.message=H);var fe=new e(G);throw ae&&(fe.message=ae,fe.generatedMessage=!0),fe}J.fail=de,J.AssertionError=e;function Z(K,Q,H,N){if(!H){var F=!1;if(Q===0)F=!0,N="No value argument passed to `assert.ok()`";else if(N instanceof Error)throw N;var ee=new e({actual:H,expected:!0,message:N,operator:"==",stackStartFn:K});throw ee.generatedMessage=F,ee}}function y(){for(var K=arguments.length,Q=new Array(K),H=0;H<K;H++)Q[H]=arguments[H];Z.apply(void 0,[y,Q.length].concat(Q))}J.ok=y,J.equal=function K(Q,H,N){if(arguments.length<2)throw new n("actual","expected");Q!=H&&ne({actual:Q,expected:H,message:N,operator:"==",stackStartFn:K})},J.notEqual=function K(Q,H,N){if(arguments.length<2)throw new n("actual","expected");Q==H&&ne({actual:Q,expected:H,message:N,operator:"!=",stackStartFn:K})},J.deepEqual=function K(Q,H,N){if(arguments.length<2)throw new n("actual","expected");O===void 0&&j(),O(Q,H)||ne({actual:Q,expected:H,message:N,operator:"deepEqual",stackStartFn:K})},J.notDeepEqual=function K(Q,H,N){if(arguments.length<2)throw new n("actual","expected");O===void 0&&j(),O(Q,H)&&ne({actual:Q,expected:H,message:N,operator:"notDeepEqual",stackStartFn:K})},J.deepStrictEqual=function K(Q,H,N){if(arguments.length<2)throw new n("actual","expected");O===void 0&&j(),D(Q,H)||ne({actual:Q,expected:H,message:N,operator:"deepStrictEqual",stackStartFn:K})},J.notDeepStrictEqual=g;function g(K,Q,H){if(arguments.length<2)throw new n("actual","expected");O===void 0&&j(),D(K,Q)&&ne({actual:K,expected:Q,message:H,operator:"notDeepStrictEqual",stackStartFn:g})}J.strictEqual=function K(Q,H,N){if(arguments.length<2)throw new n("actual","expected");E(Q,H)||ne({actual:Q,expected:H,message:N,operator:"strictEqual",stackStartFn:K})},J.notStrictEqual=function K(Q,H,N){if(arguments.length<2)throw new n("actual","expected");E(Q,H)&&ne({actual:Q,expected:H,message:N,operator:"notStrictEqual",stackStartFn:K})};var p=t(function K(Q,H,N){var F=this;u(this,K),H.forEach(function(ee){ee in Q&&(N!==void 0&&typeof N[ee]=="string"&&m(Q[ee])&&S(Q[ee],N[ee])?F[ee]=N[ee]:F[ee]=Q[ee])})});function _(K,Q,H,N,F,ee){if(!(H in K)||!D(K[H],Q[H])){if(!N){var ae=new p(K,F),z=new p(Q,F,K),G=new e({actual:ae,expected:z,operator:"deepStrictEqual",stackStartFn:ee});throw G.actual=K,G.expected=Q,G.operator=ee.name,G}ne({actual:K,expected:Q,message:N,operator:ee.name,stackStartFn:ee})}}function R(K,Q,H,N){if(typeof Q!="function"){if(m(Q))return S(Q,K);if(arguments.length===2)throw new h("expected",["Function","RegExp"],Q);if(c(K)!=="object"||K===null){var F=new e({actual:K,expected:Q,message:H,operator:"deepStrictEqual",stackStartFn:N});throw F.operator=N.name,F}var ee=Object.keys(Q);if(Q instanceof Error)ee.push("name","message");else if(ee.length===0)throw new f("error",Q,"may not be an empty object");return O===void 0&&j(),ee.forEach(function(ae){typeof K[ae]=="string"&&m(Q[ae])&&S(Q[ae],K[ae])||_(K,Q,ae,H,ee,N)}),!0}return Q.prototype!==void 0&&K instanceof Q?!0:Error.isPrototypeOf(Q)?!1:Q.call({},K)===!0}function B(K){if(typeof K!="function")throw new h("fn","Function",K);try{K()}catch(Q){return Q}return ie}function P(K){return b(K)||K!==null&&c(K)==="object"&&typeof K.then=="function"&&typeof K.catch=="function"}function A(K){return Promise.resolve().then(function(){var Q;if(typeof K=="function"){if(Q=K(),!P(Q))throw new a("instance of Promise","promiseFn",Q)}else if(P(K))Q=K;else throw new h("promiseFn",["Function","Promise"],K);return Promise.resolve().then(function(){return Q}).then(function(){return ie}).catch(function(H){return H})})}function w(K,Q,H,N){if(typeof H=="string"){if(arguments.length===4)throw new h("error",["Object","Error","Function","RegExp"],H);if(c(Q)==="object"&&Q!==null){if(Q.message===H)throw new r("error/message",'The error message "'.concat(Q.message,'" is identical to the message.'))}else if(Q===H)throw new r("error/message",'The error "'.concat(Q,'" is identical to the message.'));N=H,H=void 0}else if(H!=null&&c(H)!=="object"&&typeof H!="function")throw new h("error",["Object","Error","Function","RegExp"],H);if(Q===ie){var F="";H&&H.name&&(F+=" (".concat(H.name,")")),F+=N?": ".concat(N):".";var ee=K.name==="rejects"?"rejection":"exception";ne({actual:void 0,expected:H,operator:K.name,message:"Missing expected ".concat(ee).concat(F),stackStartFn:K})}if(H&&!R(Q,H,N,K))throw Q}function M(K,Q,H,N){if(Q!==ie){if(typeof H=="string"&&(N=H,H=void 0),!H||R(Q,H)){var F=N?": ".concat(N):".",ee=K.name==="doesNotReject"?"rejection":"exception";ne({actual:Q,expected:H,operator:K.name,message:"Got unwanted ".concat(ee).concat(F,`
|
|
66
|
-
`)+'Actual message: "'.concat(Q&&Q.message,'"'),stackStartFn:K})}throw Q}}
|
|
64
|
+
`):me=" ".concat(j," ").concat(me)),K=M.call(this,"".concat(fe).concat(me))}return Error.stackTraceLimit=ae,K.generatedMessage=!Q,Object.defineProperty(u(K),"name",{value:"AssertionError [ERR_ASSERTION]",enumerable:!1,writable:!0,configurable:!0}),K.code="ERR_ASSERTION",K.actual=F,K.expected=ee,K.operator=j,Error.captureStackTrace&&Error.captureStackTrace(u(K),N),K.stack,K.name="AssertionError",e(K)}return r(x,[{key:"toString",value:function(){return"".concat(this.name," [").concat(this.code,"]: ").concat(this.message)}},{key:w,value:function(K,Q){return D(this,t(t({},Q),{},{customInspect:!1,depth:0}))}}]),x})(l(Error),D.custom);return assertion_error=T,assertion_error}var isArguments,hasRequiredIsArguments;function requireIsArguments(){if(hasRequiredIsArguments)return isArguments;hasRequiredIsArguments=1;var s=Object.prototype.toString;return isArguments=function(f){var o=s.call(f),d=o==="[object Arguments]";return d||(d=o!=="[object Array]"&&f!==null&&typeof f=="object"&&typeof f.length=="number"&&f.length>=0&&s.call(f.callee)==="[object Function]"),d},isArguments}var implementation$3,hasRequiredImplementation$3;function requireImplementation$3(){if(hasRequiredImplementation$3)return implementation$3;hasRequiredImplementation$3=1;var s;if(!Object.keys){var t=Object.prototype.hasOwnProperty,f=Object.prototype.toString,o=requireIsArguments(),d=Object.prototype.propertyIsEnumerable,r=!d.call({toString:null},"toString"),h=d.call(function(){},"prototype"),c=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],n=function(l){var v=l.constructor;return v&&v.prototype===l},a={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},e=(function(){if(typeof window>"u")return!1;for(var l in window)try{if(!a["$"+l]&&t.call(window,l)&&window[l]!==null&&typeof window[l]=="object")try{n(window[l])}catch{return!0}}catch{return!0}return!1})(),u=function(l){if(typeof window>"u"||!e)return n(l);try{return n(l)}catch{return!1}};s=function(v){var b=v!==null&&typeof v=="object",m=f.call(v)==="[object Function]",B=o(v),E=b&&f.call(v)==="[object String]",S=[];if(!b&&!m&&!B)throw new TypeError("Object.keys called on a non-object");var O=h&&m;if(E&&v.length>0&&!t.call(v,0))for(var D=0;D<v.length;++D)S.push(String(D));if(B&&v.length>0)for(var $=0;$<v.length;++$)S.push(String($));else for(var H in v)!(O&&H==="prototype")&&t.call(v,H)&&S.push(String(H));if(r)for(var Y=u(v),ie=0;ie<c.length;++ie)!(Y&&c[ie]==="constructor")&&t.call(v,c[ie])&&S.push(c[ie]);return S}}return implementation$3=s,implementation$3}var objectKeys,hasRequiredObjectKeys;function requireObjectKeys(){if(hasRequiredObjectKeys)return objectKeys;hasRequiredObjectKeys=1;var s=Array.prototype.slice,t=requireIsArguments(),f=Object.keys,o=f?function(h){return f(h)}:requireImplementation$3(),d=Object.keys;return o.shim=function(){if(Object.keys){var h=(function(){var c=Object.keys(arguments);return c&&c.length===arguments.length})(1,2);h||(Object.keys=function(n){return t(n)?d(s.call(n)):d(n)})}else Object.keys=o;return Object.keys||o},objectKeys=o,objectKeys}var implementation$2,hasRequiredImplementation$2;function requireImplementation$2(){if(hasRequiredImplementation$2)return implementation$2;hasRequiredImplementation$2=1;var s=requireObjectKeys(),t=requireShams$1()(),f=requireCallBound$1(),o=requireEsObjectAtoms(),d=f("Array.prototype.push"),r=f("Object.prototype.propertyIsEnumerable"),h=t?o.getOwnPropertySymbols:null;return implementation$2=function(n,a){if(n==null)throw new TypeError("target must be an object");var e=o(n);if(arguments.length===1)return e;for(var u=1;u<arguments.length;++u){var l=o(arguments[u]),v=s(l),b=t&&(o.getOwnPropertySymbols||h);if(b)for(var m=b(l),B=0;B<m.length;++B){var E=m[B];r(l,E)&&d(v,E)}for(var S=0;S<v.length;++S){var O=v[S];if(r(l,O)){var D=l[O];e[O]=D}}}return e},implementation$2}var polyfill$2,hasRequiredPolyfill$2;function requirePolyfill$2(){if(hasRequiredPolyfill$2)return polyfill$2;hasRequiredPolyfill$2=1;var s=requireImplementation$2(),t=function(){if(!Object.assign)return!1;for(var o="abcdefghijklmnopqrst",d=o.split(""),r={},h=0;h<d.length;++h)r[d[h]]=d[h];var c=Object.assign({},r),n="";for(var a in c)n+=a;return o!==n},f=function(){if(!Object.assign||!Object.preventExtensions)return!1;var o=Object.preventExtensions({1:2});try{Object.assign(o,"xy")}catch{return o[1]==="y"}return!1};return polyfill$2=function(){return!Object.assign||t()||f()?s:Object.assign},polyfill$2}var implementation$1,hasRequiredImplementation$1;function requireImplementation$1(){if(hasRequiredImplementation$1)return implementation$1;hasRequiredImplementation$1=1;var s=function(t){return t!==t};return implementation$1=function(f,o){return f===0&&o===0?1/f===1/o:!!(f===o||s(f)&&s(o))},implementation$1}var polyfill$1,hasRequiredPolyfill$1;function requirePolyfill$1(){if(hasRequiredPolyfill$1)return polyfill$1;hasRequiredPolyfill$1=1;var s=requireImplementation$1();return polyfill$1=function(){return typeof Object.is=="function"?Object.is:s},polyfill$1}var callBound,hasRequiredCallBound;function requireCallBound(){if(hasRequiredCallBound)return callBound;hasRequiredCallBound=1;var s=requireGetIntrinsic(),t=requireCallBind(),f=t(s("String.prototype.indexOf"));return callBound=function(d,r){var h=s(d,!!r);return typeof h=="function"&&f(d,".prototype.")>-1?t(h):h},callBound}var defineProperties_1,hasRequiredDefineProperties;function requireDefineProperties(){if(hasRequiredDefineProperties)return defineProperties_1;hasRequiredDefineProperties=1;var s=requireObjectKeys(),t=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",f=Object.prototype.toString,o=Array.prototype.concat,d=requireDefineDataProperty(),r=function(a){return typeof a=="function"&&f.call(a)==="[object Function]"},h=requireHasPropertyDescriptors()(),c=function(a,e,u,l){if(e in a){if(l===!0){if(a[e]===u)return}else if(!r(l)||!l())return}h?d(a,e,u,!0):d(a,e,u)},n=function(a,e){var u=arguments.length>2?arguments[2]:{},l=s(e);t&&(l=o.call(l,Object.getOwnPropertySymbols(e)));for(var v=0;v<l.length;v+=1)c(a,l[v],e[l[v]],u[l[v]])};return n.supportsDescriptors=!!h,defineProperties_1=n,defineProperties_1}var shim$1,hasRequiredShim$1;function requireShim$1(){if(hasRequiredShim$1)return shim$1;hasRequiredShim$1=1;var s=requirePolyfill$1(),t=requireDefineProperties();return shim$1=function(){var o=s();return t(Object,{is:o},{is:function(){return Object.is!==o}}),o},shim$1}var objectIs,hasRequiredObjectIs;function requireObjectIs(){if(hasRequiredObjectIs)return objectIs;hasRequiredObjectIs=1;var s=requireDefineProperties(),t=requireCallBind(),f=requireImplementation$1(),o=requirePolyfill$1(),d=requireShim$1(),r=t(o(),Object);return s(r,{getPolyfill:o,implementation:f,shim:d}),objectIs=r,objectIs}var implementation,hasRequiredImplementation;function requireImplementation(){return hasRequiredImplementation||(hasRequiredImplementation=1,implementation=function(t){return t!==t}),implementation}var polyfill,hasRequiredPolyfill;function requirePolyfill(){if(hasRequiredPolyfill)return polyfill;hasRequiredPolyfill=1;var s=requireImplementation();return polyfill=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:s},polyfill}var shim,hasRequiredShim;function requireShim(){if(hasRequiredShim)return shim;hasRequiredShim=1;var s=requireDefineProperties(),t=requirePolyfill();return shim=function(){var o=t();return s(Number,{isNaN:o},{isNaN:function(){return Number.isNaN!==o}}),o},shim}var isNan,hasRequiredIsNan;function requireIsNan(){if(hasRequiredIsNan)return isNan;hasRequiredIsNan=1;var s=requireCallBind(),t=requireDefineProperties(),f=requireImplementation(),o=requirePolyfill(),d=requireShim(),r=s(o(),Number);return t(r,{getPolyfill:o,implementation:f,shim:d}),isNan=r,isNan}var comparisons,hasRequiredComparisons;function requireComparisons(){if(hasRequiredComparisons)return comparisons;hasRequiredComparisons=1;function s(oe,ce){return r(oe)||d(oe,ce)||f(oe,ce)||t()}function t(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
65
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f(oe,ce){if(oe){if(typeof oe=="string")return o(oe,ce);var ge=Object.prototype.toString.call(oe).slice(8,-1);if(ge==="Object"&&oe.constructor&&(ge=oe.constructor.name),ge==="Map"||ge==="Set")return Array.from(oe);if(ge==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ge))return o(oe,ce)}}function o(oe,ce){(ce==null||ce>oe.length)&&(ce=oe.length);for(var ge=0,we=new Array(ce);ge<ce;ge++)we[ge]=oe[ge];return we}function d(oe,ce){var ge=oe==null?null:typeof Symbol<"u"&&oe[Symbol.iterator]||oe["@@iterator"];if(ge!=null){var we,Se,Oe,U,I=[],C=!0,J=!1;try{if(Oe=(ge=ge.call(oe)).next,ce!==0)for(;!(C=(we=Oe.call(ge)).done)&&(I.push(we.value),I.length!==ce);C=!0);}catch(se){J=!0,Se=se}finally{try{if(!C&&ge.return!=null&&(U=ge.return(),Object(U)!==U))return}finally{if(J)throw Se}}return I}}function r(oe){if(Array.isArray(oe))return oe}function h(oe){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(ce){return typeof ce}:function(ce){return ce&&typeof Symbol=="function"&&ce.constructor===Symbol&&ce!==Symbol.prototype?"symbol":typeof ce},h(oe)}var c=/a/g.flags!==void 0,n=function(ce){var ge=[];return ce.forEach(function(we){return ge.push(we)}),ge},a=function(ce){var ge=[];return ce.forEach(function(we,Se){return ge.push([Se,we])}),ge},e=Object.is?Object.is:requireObjectIs(),u=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},l=Number.isNaN?Number.isNaN:requireIsNan();function v(oe){return oe.call.bind(oe)}var b=v(Object.prototype.hasOwnProperty),m=v(Object.prototype.propertyIsEnumerable),B=v(Object.prototype.toString),E=requireUtil$1().types,S=E.isAnyArrayBuffer,O=E.isArrayBufferView,D=E.isDate,$=E.isMap,H=E.isRegExp,Y=E.isSet,ie=E.isNativeError,ne=E.isBoxedPrimitive,de=E.isNumberObject,X=E.isStringObject,y=E.isBooleanObject,g=E.isBigIntObject,p=E.isSymbolObject,_=E.isFloat32Array,R=E.isFloat64Array;function q(oe){if(oe.length===0||oe.length>10)return!0;for(var ce=0;ce<oe.length;ce++){var ge=oe.charCodeAt(ce);if(ge<48||ge>57)return!0}return oe.length===10&&oe>=Math.pow(2,32)}function T(oe){return Object.keys(oe).filter(q).concat(u(oe).filter(Object.prototype.propertyIsEnumerable.bind(oe)))}function A(oe,ce){if(oe===ce)return 0;for(var ge=oe.length,we=ce.length,Se=0,Oe=Math.min(ge,we);Se<Oe;++Se)if(oe[Se]!==ce[Se]){ge=oe[Se],we=ce[Se];break}return ge<we?-1:we<ge?1:0}var w=!0,M=!1,x=0,L=1,K=2,Q=3;function j(oe,ce){return c?oe.source===ce.source&&oe.flags===ce.flags:RegExp.prototype.toString.call(oe)===RegExp.prototype.toString.call(ce)}function N(oe,ce){if(oe.byteLength!==ce.byteLength)return!1;for(var ge=0;ge<oe.byteLength;ge++)if(oe[ge]!==ce[ge])return!1;return!0}function F(oe,ce){return oe.byteLength!==ce.byteLength?!1:A(new Uint8Array(oe.buffer,oe.byteOffset,oe.byteLength),new Uint8Array(ce.buffer,ce.byteOffset,ce.byteLength))===0}function ee(oe,ce){return oe.byteLength===ce.byteLength&&A(new Uint8Array(oe),new Uint8Array(ce))===0}function ae(oe,ce){return de(oe)?de(ce)&&e(Number.prototype.valueOf.call(oe),Number.prototype.valueOf.call(ce)):X(oe)?X(ce)&&String.prototype.valueOf.call(oe)===String.prototype.valueOf.call(ce):y(oe)?y(ce)&&Boolean.prototype.valueOf.call(oe)===Boolean.prototype.valueOf.call(ce):g(oe)?g(ce)&&BigInt.prototype.valueOf.call(oe)===BigInt.prototype.valueOf.call(ce):p(ce)&&Symbol.prototype.valueOf.call(oe)===Symbol.prototype.valueOf.call(ce)}function G(oe,ce,ge,we){if(oe===ce)return oe!==0?!0:ge?e(oe,ce):!0;if(ge){if(h(oe)!=="object")return typeof oe=="number"&&l(oe)&&l(ce);if(h(ce)!=="object"||oe===null||ce===null||Object.getPrototypeOf(oe)!==Object.getPrototypeOf(ce))return!1}else{if(oe===null||h(oe)!=="object")return ce===null||h(ce)!=="object"?oe==ce:!1;if(ce===null||h(ce)!=="object")return!1}var Se=B(oe),Oe=B(ce);if(Se!==Oe)return!1;if(Array.isArray(oe)){if(oe.length!==ce.length)return!1;var U=T(oe),I=T(ce);return U.length!==I.length?!1:fe(oe,ce,ge,we,L,U)}if(Se==="[object Object]"&&(!$(oe)&&$(ce)||!Y(oe)&&Y(ce)))return!1;if(D(oe)){if(!D(ce)||Date.prototype.getTime.call(oe)!==Date.prototype.getTime.call(ce))return!1}else if(H(oe)){if(!H(ce)||!j(oe,ce))return!1}else if(ie(oe)||oe instanceof Error){if(oe.message!==ce.message||oe.name!==ce.name)return!1}else if(O(oe)){if(!ge&&(_(oe)||R(oe))){if(!N(oe,ce))return!1}else if(!F(oe,ce))return!1;var C=T(oe),J=T(ce);return C.length!==J.length?!1:fe(oe,ce,ge,we,x,C)}else{if(Y(oe))return!Y(ce)||oe.size!==ce.size?!1:fe(oe,ce,ge,we,K);if($(oe))return!$(ce)||oe.size!==ce.size?!1:fe(oe,ce,ge,we,Q);if(S(oe)){if(!ee(oe,ce))return!1}else if(ne(oe)&&!ae(oe,ce))return!1}return fe(oe,ce,ge,we,x)}function z(oe,ce){return ce.filter(function(ge){return m(oe,ge)})}function fe(oe,ce,ge,we,Se,Oe){if(arguments.length===5){Oe=Object.keys(oe);var U=Object.keys(ce);if(Oe.length!==U.length)return!1}for(var I=0;I<Oe.length;I++)if(!b(ce,Oe[I]))return!1;if(ge&&arguments.length===5){var C=u(oe);if(C.length!==0){var J=0;for(I=0;I<C.length;I++){var se=C[I];if(m(oe,se)){if(!m(ce,se))return!1;Oe.push(se),J++}else if(m(ce,se))return!1}var le=u(ce);if(C.length!==le.length&&z(ce,le).length!==J)return!1}else{var ve=u(ce);if(ve.length!==0&&z(ce,ve).length!==0)return!1}}if(Oe.length===0&&(Se===x||Se===L&&oe.length===0||oe.size===0))return!0;if(we===void 0)we={val1:new Map,val2:new Map,position:0};else{var Ce=we.val1.get(oe);if(Ce!==void 0){var Le=we.val2.get(ce);if(Le!==void 0)return Ce===Le}we.position++}we.val1.set(oe,we.position),we.val2.set(ce,we.position);var Ie=Be(oe,ce,ge,Oe,we,Se);return we.val1.delete(oe),we.val2.delete(ce),Ie}function me(oe,ce,ge,we){for(var Se=n(oe),Oe=0;Oe<Se.length;Oe++){var U=Se[Oe];if(G(ce,U,ge,we))return oe.delete(U),!0}return!1}function xe(oe){switch(h(oe)){case"undefined":return null;case"object":return;case"symbol":return!1;case"string":oe=+oe;case"number":if(l(oe))return!1}return!0}function _e(oe,ce,ge){var we=xe(ge);return we??(ce.has(we)&&!oe.has(we))}function qe(oe,ce,ge,we,Se){var Oe=xe(ge);if(Oe!=null)return Oe;var U=ce.get(Oe);return U===void 0&&!ce.has(Oe)||!G(we,U,!1,Se)?!1:!oe.has(Oe)&&G(we,U,!1,Se)}function Re(oe,ce,ge,we){for(var Se=null,Oe=n(oe),U=0;U<Oe.length;U++){var I=Oe[U];if(h(I)==="object"&&I!==null)Se===null&&(Se=new Set),Se.add(I);else if(!ce.has(I)){if(ge||!_e(oe,ce,I))return!1;Se===null&&(Se=new Set),Se.add(I)}}if(Se!==null){for(var C=n(ce),J=0;J<C.length;J++){var se=C[J];if(h(se)==="object"&&se!==null){if(!me(Se,se,ge,we))return!1}else if(!ge&&!oe.has(se)&&!me(Se,se,ge,we))return!1}return Se.size===0}return!0}function be(oe,ce,ge,we,Se,Oe){for(var U=n(oe),I=0;I<U.length;I++){var C=U[I];if(G(ge,C,Se,Oe)&&G(we,ce.get(C),Se,Oe))return oe.delete(C),!0}return!1}function Fe(oe,ce,ge,we){for(var Se=null,Oe=a(oe),U=0;U<Oe.length;U++){var I=s(Oe[U],2),C=I[0],J=I[1];if(h(C)==="object"&&C!==null)Se===null&&(Se=new Set),Se.add(C);else{var se=ce.get(C);if(se===void 0&&!ce.has(C)||!G(J,se,ge,we)){if(ge||!qe(oe,ce,C,J,we))return!1;Se===null&&(Se=new Set),Se.add(C)}}}if(Se!==null){for(var le=a(ce),ve=0;ve<le.length;ve++){var Ce=s(le[ve],2),Le=Ce[0],Ie=Ce[1];if(h(Le)==="object"&&Le!==null){if(!be(Se,oe,Le,Ie,ge,we))return!1}else if(!ge&&(!oe.has(Le)||!G(oe.get(Le),Ie,!1,we))&&!be(Se,oe,Le,Ie,!1,we))return!1}return Se.size===0}return!0}function Be(oe,ce,ge,we,Se,Oe){var U=0;if(Oe===K){if(!Re(oe,ce,ge,Se))return!1}else if(Oe===Q){if(!Fe(oe,ce,ge,Se))return!1}else if(Oe===L)for(;U<oe.length;U++)if(b(oe,U)){if(!b(ce,U)||!G(oe[U],ce[U],ge,Se))return!1}else{if(b(ce,U))return!1;for(var I=Object.keys(oe);U<I.length;U++){var C=I[U];if(!b(ce,C)||!G(oe[C],ce[C],ge,Se))return!1}return I.length===Object.keys(ce).length}for(U=0;U<we.length;U++){var J=we[U];if(!G(oe[J],ce[J],ge,Se))return!1}return!0}function Me(oe,ce){return G(oe,ce,M)}function Pe(oe,ce){return G(oe,ce,w)}return comparisons={isDeepEqual:Me,isDeepStrictEqual:Pe},comparisons}var hasRequiredAssert;function requireAssert(){if(hasRequiredAssert)return assert.exports;hasRequiredAssert=1;function s(K){"@babel/helpers - typeof";return s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Q){return typeof Q}:function(Q){return Q&&typeof Symbol=="function"&&Q.constructor===Symbol&&Q!==Symbol.prototype?"symbol":typeof Q},s(K)}function t(K,Q,j){return Object.defineProperty(K,"prototype",{writable:!1}),K}function f(K,Q){if(!(K instanceof Q))throw new TypeError("Cannot call a class as a function")}var o=requireErrors(),d=o.codes,r=d.ERR_AMBIGUOUS_ARGUMENT,h=d.ERR_INVALID_ARG_TYPE,c=d.ERR_INVALID_ARG_VALUE,n=d.ERR_INVALID_RETURN_VALUE,a=d.ERR_MISSING_ARGS,e=requireAssertion_error(),u=requireUtil$1(),l=u.inspect,v=requireUtil$1().types,b=v.isPromise,m=v.isRegExp,B=requirePolyfill$2()(),E=requirePolyfill$1()(),S=requireCallBound()("RegExp.prototype.test"),O,D;function $(){var K=requireComparisons();O=K.isDeepEqual,D=K.isDeepStrictEqual}var H=!1,Y=assert.exports=y,ie={};function ne(K){throw K.message instanceof Error?K.message:new e(K)}function de(K,Q,j,N,F){var ee=arguments.length,ae;if(ee===0)ae="Failed";else if(ee===1)j=K,K=void 0;else{if(H===!1){H=!0;var G=process$1.emitWarning?process$1.emitWarning:console.warn.bind(console);G("assert.fail() with more than one argument is deprecated. Please use assert.strictEqual() instead or only pass a message.","DeprecationWarning","DEP0094")}ee===2&&(N="!=")}if(j instanceof Error)throw j;var z={actual:K,expected:Q,operator:N===void 0?"fail":N,stackStartFn:F||de};j!==void 0&&(z.message=j);var fe=new e(z);throw ae&&(fe.message=ae,fe.generatedMessage=!0),fe}Y.fail=de,Y.AssertionError=e;function X(K,Q,j,N){if(!j){var F=!1;if(Q===0)F=!0,N="No value argument passed to `assert.ok()`";else if(N instanceof Error)throw N;var ee=new e({actual:j,expected:!0,message:N,operator:"==",stackStartFn:K});throw ee.generatedMessage=F,ee}}function y(){for(var K=arguments.length,Q=new Array(K),j=0;j<K;j++)Q[j]=arguments[j];X.apply(void 0,[y,Q.length].concat(Q))}Y.ok=y,Y.equal=function K(Q,j,N){if(arguments.length<2)throw new a("actual","expected");Q!=j&&ne({actual:Q,expected:j,message:N,operator:"==",stackStartFn:K})},Y.notEqual=function K(Q,j,N){if(arguments.length<2)throw new a("actual","expected");Q==j&&ne({actual:Q,expected:j,message:N,operator:"!=",stackStartFn:K})},Y.deepEqual=function K(Q,j,N){if(arguments.length<2)throw new a("actual","expected");O===void 0&&$(),O(Q,j)||ne({actual:Q,expected:j,message:N,operator:"deepEqual",stackStartFn:K})},Y.notDeepEqual=function K(Q,j,N){if(arguments.length<2)throw new a("actual","expected");O===void 0&&$(),O(Q,j)&&ne({actual:Q,expected:j,message:N,operator:"notDeepEqual",stackStartFn:K})},Y.deepStrictEqual=function K(Q,j,N){if(arguments.length<2)throw new a("actual","expected");O===void 0&&$(),D(Q,j)||ne({actual:Q,expected:j,message:N,operator:"deepStrictEqual",stackStartFn:K})},Y.notDeepStrictEqual=g;function g(K,Q,j){if(arguments.length<2)throw new a("actual","expected");O===void 0&&$(),D(K,Q)&&ne({actual:K,expected:Q,message:j,operator:"notDeepStrictEqual",stackStartFn:g})}Y.strictEqual=function K(Q,j,N){if(arguments.length<2)throw new a("actual","expected");E(Q,j)||ne({actual:Q,expected:j,message:N,operator:"strictEqual",stackStartFn:K})},Y.notStrictEqual=function K(Q,j,N){if(arguments.length<2)throw new a("actual","expected");E(Q,j)&&ne({actual:Q,expected:j,message:N,operator:"notStrictEqual",stackStartFn:K})};var p=t(function K(Q,j,N){var F=this;f(this,K),j.forEach(function(ee){ee in Q&&(N!==void 0&&typeof N[ee]=="string"&&m(Q[ee])&&S(Q[ee],N[ee])?F[ee]=N[ee]:F[ee]=Q[ee])})});function _(K,Q,j,N,F,ee){if(!(j in K)||!D(K[j],Q[j])){if(!N){var ae=new p(K,F),G=new p(Q,F,K),z=new e({actual:ae,expected:G,operator:"deepStrictEqual",stackStartFn:ee});throw z.actual=K,z.expected=Q,z.operator=ee.name,z}ne({actual:K,expected:Q,message:N,operator:ee.name,stackStartFn:ee})}}function R(K,Q,j,N){if(typeof Q!="function"){if(m(Q))return S(Q,K);if(arguments.length===2)throw new h("expected",["Function","RegExp"],Q);if(s(K)!=="object"||K===null){var F=new e({actual:K,expected:Q,message:j,operator:"deepStrictEqual",stackStartFn:N});throw F.operator=N.name,F}var ee=Object.keys(Q);if(Q instanceof Error)ee.push("name","message");else if(ee.length===0)throw new c("error",Q,"may not be an empty object");return O===void 0&&$(),ee.forEach(function(ae){typeof K[ae]=="string"&&m(Q[ae])&&S(Q[ae],K[ae])||_(K,Q,ae,j,ee,N)}),!0}return Q.prototype!==void 0&&K instanceof Q?!0:Error.isPrototypeOf(Q)?!1:Q.call({},K)===!0}function q(K){if(typeof K!="function")throw new h("fn","Function",K);try{K()}catch(Q){return Q}return ie}function T(K){return b(K)||K!==null&&s(K)==="object"&&typeof K.then=="function"&&typeof K.catch=="function"}function A(K){return Promise.resolve().then(function(){var Q;if(typeof K=="function"){if(Q=K(),!T(Q))throw new n("instance of Promise","promiseFn",Q)}else if(T(K))Q=K;else throw new h("promiseFn",["Function","Promise"],K);return Promise.resolve().then(function(){return Q}).then(function(){return ie}).catch(function(j){return j})})}function w(K,Q,j,N){if(typeof j=="string"){if(arguments.length===4)throw new h("error",["Object","Error","Function","RegExp"],j);if(s(Q)==="object"&&Q!==null){if(Q.message===j)throw new r("error/message",'The error message "'.concat(Q.message,'" is identical to the message.'))}else if(Q===j)throw new r("error/message",'The error "'.concat(Q,'" is identical to the message.'));N=j,j=void 0}else if(j!=null&&s(j)!=="object"&&typeof j!="function")throw new h("error",["Object","Error","Function","RegExp"],j);if(Q===ie){var F="";j&&j.name&&(F+=" (".concat(j.name,")")),F+=N?": ".concat(N):".";var ee=K.name==="rejects"?"rejection":"exception";ne({actual:void 0,expected:j,operator:K.name,message:"Missing expected ".concat(ee).concat(F),stackStartFn:K})}if(j&&!R(Q,j,N,K))throw Q}function M(K,Q,j,N){if(Q!==ie){if(typeof j=="string"&&(N=j,j=void 0),!j||R(Q,j)){var F=N?": ".concat(N):".",ee=K.name==="doesNotReject"?"rejection":"exception";ne({actual:Q,expected:j,operator:K.name,message:"Got unwanted ".concat(ee).concat(F,`
|
|
66
|
+
`)+'Actual message: "'.concat(Q&&Q.message,'"'),stackStartFn:K})}throw Q}}Y.throws=function K(Q){for(var j=arguments.length,N=new Array(j>1?j-1:0),F=1;F<j;F++)N[F-1]=arguments[F];w.apply(void 0,[K,q(Q)].concat(N))},Y.rejects=function K(Q){for(var j=arguments.length,N=new Array(j>1?j-1:0),F=1;F<j;F++)N[F-1]=arguments[F];return A(Q).then(function(ee){return w.apply(void 0,[K,ee].concat(N))})},Y.doesNotThrow=function K(Q){for(var j=arguments.length,N=new Array(j>1?j-1:0),F=1;F<j;F++)N[F-1]=arguments[F];M.apply(void 0,[K,q(Q)].concat(N))},Y.doesNotReject=function K(Q){for(var j=arguments.length,N=new Array(j>1?j-1:0),F=1;F<j;F++)N[F-1]=arguments[F];return A(Q).then(function(ee){return M.apply(void 0,[K,ee].concat(N))})},Y.ifError=function K(Q){if(Q!=null){var j="ifError got unwanted exception: ";s(Q)==="object"&&typeof Q.message=="string"?Q.message.length===0&&Q.constructor?j+=Q.constructor.name:j+=Q.message:j+=l(Q);var N=new e({actual:Q,expected:null,operator:"ifError",message:j,stackStartFn:K}),F=Q.stack;if(typeof F=="string"){var ee=F.split(`
|
|
67
67
|
`);ee.shift();for(var ae=N.stack.split(`
|
|
68
|
-
`),
|
|
68
|
+
`),G=0;G<ee.length;G++){var z=ae.indexOf(ee[G]);if(z!==-1){ae=ae.slice(0,z);break}}N.stack="".concat(ae.join(`
|
|
69
69
|
`),`
|
|
70
70
|
`).concat(ee.join(`
|
|
71
|
-
`))}throw N}};function x(K,Q,
|
|
71
|
+
`))}throw N}};function x(K,Q,j,N,F){if(!m(Q))throw new h("regexp","RegExp",Q);var ee=F==="match";if(typeof K!="string"||S(Q,K)!==ee){if(j instanceof Error)throw j;var ae=!j;j=j||(typeof K!="string"?'The "string" argument must be of type string. Received type '+"".concat(s(K)," (").concat(l(K),")"):(ee?"The input did not match the regular expression ":"The input was expected to not match the regular expression ")+"".concat(l(Q),`. Input:
|
|
72
72
|
|
|
73
73
|
`).concat(l(K),`
|
|
74
|
-
`));var z=new e({actual:K,expected:Q,message:H,operator:F,stackStartFn:N});throw z.generatedMessage=ae,z}}J.match=function K(Q,H,N){x(Q,H,N,K,"match")},J.doesNotMatch=function K(Q,H,N){x(Q,H,N,K,"doesNotMatch")};function L(){for(var K=arguments.length,Q=new Array(K),H=0;H<K;H++)Q[H]=arguments[H];Z.apply(void 0,[L,Q.length].concat(Q))}return J.strict=q(L,J,{equal:J.strictEqual,deepEqual:J.deepStrictEqual,notEqual:J.notStrictEqual,notDeepEqual:J.notDeepStrictEqual}),J.strict.strict=J.strict,assert.exports}var safer_1,hasRequiredSafer;function requireSafer(){if(hasRequiredSafer)return safer_1;hasRequiredSafer=1;var c=requireDist(),t=c.Buffer,u={},o;for(o in c)c.hasOwnProperty(o)&&(o==="SlowBuffer"||o==="Buffer"||(u[o]=c[o]));var d=u.Buffer={};for(o in t)t.hasOwnProperty(o)&&(o==="allocUnsafe"||o==="allocUnsafeSlow"||(d[o]=t[o]));if(u.Buffer.prototype=t.prototype,(!d.from||d.from===Uint8Array.from)&&(d.from=function(r,h,f){if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof r);if(r&&typeof r.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);return t(r,h,f)}),d.alloc||(d.alloc=function(r,h,f){if(typeof r!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof r);if(r<0||r>=2*(1<<30))throw new RangeError('The value "'+r+'" is invalid for option "size"');var a=t(r);return!h||h.length===0?a.fill(0):typeof f=="string"?a.fill(h,f):a.fill(h),a}),!u.kStringMaxLength)try{u.kStringMaxLength=process$1.binding("buffer").kStringMaxLength}catch{}return u.constants||(u.constants={MAX_LENGTH:u.kMaxLength},u.kStringMaxLength&&(u.constants.MAX_STRING_LENGTH=u.kStringMaxLength)),safer_1=u,safer_1}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1;var c=requireAssert(),t=requireSafer().Buffer,u=requireTypes(),o=requireErrors$1(),d=o.newInvalidAsn1Error;function r(h){if(!h||!t.isBuffer(h))throw new TypeError("data must be a node Buffer");this._buf=h,this._size=h.length,this._len=0,this._offset=0}return Object.defineProperty(r.prototype,"length",{enumerable:!0,get:function(){return this._len}}),Object.defineProperty(r.prototype,"offset",{enumerable:!0,get:function(){return this._offset}}),Object.defineProperty(r.prototype,"remain",{get:function(){return this._size-this._offset}}),Object.defineProperty(r.prototype,"buffer",{get:function(){return this._buf.slice(this._offset)}}),r.prototype.readByte=function(h){if(this._size-this._offset<1)return null;var f=this._buf[this._offset]&255;return h||(this._offset+=1),f},r.prototype.peek=function(){return this.readByte(!0)},r.prototype.readLength=function(h){if(h===void 0&&(h=this._offset),h>=this._size)return null;var f=this._buf[h++]&255;if(f===null)return null;if((f&128)===128){if(f&=127,f===0)throw d("Indefinite length not supported");if(f>4)throw d("encoding too long");if(this._size-h<f)return null;this._len=0;for(var a=0;a<f;a++)this._len=(this._len<<8)+(this._buf[h++]&255)}else this._len=f;return h},r.prototype.readSequence=function(h){var f=this.peek();if(f===null)return null;if(h!==void 0&&h!==f)throw d("Expected 0x"+h.toString(16)+": got 0x"+f.toString(16));var a=this.readLength(this._offset+1);return a===null?null:(this._offset=a,f)},r.prototype.readInt=function(){return this._readTag(u.Integer)},r.prototype.readBoolean=function(){return this._readTag(u.Boolean)!==0},r.prototype.readEnumeration=function(){return this._readTag(u.Enumeration)},r.prototype.readString=function(h,f){h||(h=u.OctetString);var a=this.peek();if(a===null)return null;if(a!==h)throw d("Expected 0x"+h.toString(16)+": got 0x"+a.toString(16));var n=this.readLength(this._offset+1);if(n===null||this.length>this._size-n)return null;if(this._offset=n,this.length===0)return f?t.alloc(0):"";var e=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,f?e:e.toString("utf8")},r.prototype.readOID=function(h){h||(h=u.OID);var f=this.readString(h,!0);if(f===null)return null;for(var a=[],n=0,e=0;e<f.length;e++){var s=f[e]&255;n<<=7,n+=s&127,(s&128)===0&&(a.push(n),n=0)}return n=a.shift(),a.unshift(n%40),a.unshift(n/40>>0),a.join(".")},r.prototype._readTag=function(h){c.ok(h!==void 0);var f=this.peek();if(f===null)return null;if(f!==h)throw d("Expected 0x"+h.toString(16)+": got 0x"+f.toString(16));var a=this.readLength(this._offset+1);if(a===null)return null;if(this.length>4)throw d("Integer too long: "+this.length);if(this.length>this._size-a)return null;this._offset=a;for(var n=this._buf[this._offset],e=0,s=0;s<this.length;s++)e<<=8,e|=this._buf[this._offset++]&255;return(n&128)===128&&s!==4&&(e-=1<<s*8),e>>0},reader=r,reader}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1;var c=requireAssert(),t=requireSafer().Buffer,u=requireTypes(),o=requireErrors$1(),d=o.newInvalidAsn1Error,r={size:1024,growthFactor:8};function h(a,n){c.ok(a),c.equal(typeof a,"object"),c.ok(n),c.equal(typeof n,"object");var e=Object.getOwnPropertyNames(a);return e.forEach(function(s){if(!n[s]){var l=Object.getOwnPropertyDescriptor(a,s);Object.defineProperty(n,s,l)}}),n}function f(a){a=h(r,a||{}),this._buf=t.alloc(a.size||1024),this._size=this._buf.length,this._offset=0,this._options=a,this._seq=[]}return Object.defineProperty(f.prototype,"buffer",{get:function(){if(this._seq.length)throw d(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),f.prototype.writeByte=function(a){if(typeof a!="number")throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=a},f.prototype.writeInt=function(a,n){if(typeof a!="number")throw new TypeError("argument must be a Number");typeof n!="number"&&(n=u.Integer);for(var e=4;((a&4286578688)===0||(a&4286578688)===-8388608)&&e>1;)e--,a<<=8;if(e>4)throw d("BER ints cannot be > 0xffffffff");for(this._ensure(2+e),this._buf[this._offset++]=n,this._buf[this._offset++]=e;e-- >0;)this._buf[this._offset++]=(a&4278190080)>>>24,a<<=8},f.prototype.writeNull=function(){this.writeByte(u.Null),this.writeByte(0)},f.prototype.writeEnumeration=function(a,n){if(typeof a!="number")throw new TypeError("argument must be a Number");return typeof n!="number"&&(n=u.Enumeration),this.writeInt(a,n)},f.prototype.writeBoolean=function(a,n){if(typeof a!="boolean")throw new TypeError("argument must be a Boolean");typeof n!="number"&&(n=u.Boolean),this._ensure(3),this._buf[this._offset++]=n,this._buf[this._offset++]=1,this._buf[this._offset++]=a?255:0},f.prototype.writeString=function(a,n){if(typeof a!="string")throw new TypeError("argument must be a string (was: "+typeof a+")");typeof n!="number"&&(n=u.OctetString);var e=t.byteLength(a);this.writeByte(n),this.writeLength(e),e&&(this._ensure(e),this._buf.write(a,this._offset),this._offset+=e)},f.prototype.writeBuffer=function(a,n){if(typeof n!="number")throw new TypeError("tag must be a number");if(!t.isBuffer(a))throw new TypeError("argument must be a buffer");this.writeByte(n),this.writeLength(a.length),this._ensure(a.length),a.copy(this._buf,this._offset,0,a.length),this._offset+=a.length},f.prototype.writeStringArray=function(a){if(!a instanceof Array)throw new TypeError("argument must be an Array[String]");var n=this;a.forEach(function(e){n.writeString(e)})},f.prototype.writeOID=function(a,n){if(typeof a!="string")throw new TypeError("argument must be a string");if(typeof n!="number"&&(n=u.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(a))throw new Error("argument is not a valid OID string");function e(b,m){m<128?b.push(m):m<16384?(b.push(m>>>7|128),b.push(m&127)):m<2097152?(b.push(m>>>14|128),b.push((m>>>7|128)&255),b.push(m&127)):m<268435456?(b.push(m>>>21|128),b.push((m>>>14|128)&255),b.push((m>>>7|128)&255),b.push(m&127)):(b.push((m>>>28|128)&255),b.push((m>>>21|128)&255),b.push((m>>>14|128)&255),b.push((m>>>7|128)&255),b.push(m&127))}var s=a.split("."),l=[];l.push(parseInt(s[0],10)*40+parseInt(s[1],10)),s.slice(2).forEach(function(b){e(l,parseInt(b,10))});var v=this;this._ensure(2+l.length),this.writeByte(n),this.writeLength(l.length),l.forEach(function(b){v.writeByte(b)})},f.prototype.writeLength=function(a){if(typeof a!="number")throw new TypeError("argument must be a Number");if(this._ensure(4),a<=127)this._buf[this._offset++]=a;else if(a<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=a;else if(a<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=a>>8,this._buf[this._offset++]=a;else if(a<=16777215)this._buf[this._offset++]=131,this._buf[this._offset++]=a>>16,this._buf[this._offset++]=a>>8,this._buf[this._offset++]=a;else throw d("Length too long (> 4 bytes)")},f.prototype.startSequence=function(a){typeof a!="number"&&(a=u.Sequence|u.Constructor),this.writeByte(a),this._seq.push(this._offset),this._ensure(3),this._offset+=3},f.prototype.endSequence=function(){var a=this._seq.pop(),n=a+3,e=this._offset-n;if(e<=127)this._shift(n,e,-2),this._buf[a]=e;else if(e<=255)this._shift(n,e,-1),this._buf[a]=129,this._buf[a+1]=e;else if(e<=65535)this._buf[a]=130,this._buf[a+1]=e>>8,this._buf[a+2]=e;else if(e<=16777215)this._shift(n,e,1),this._buf[a]=131,this._buf[a+1]=e>>16,this._buf[a+2]=e>>8,this._buf[a+3]=e;else throw d("Sequence too long")},f.prototype._shift=function(a,n,e){c.ok(a!==void 0),c.ok(n!==void 0),c.ok(e),this._buf.copy(this._buf,a+e,a,a+n),this._offset+=e},f.prototype._ensure=function(a){if(c.ok(a),this._size-this._offset<a){var n=this._size*this._options.growthFactor;n-this._offset<a&&(n+=a);var e=t.alloc(n);this._buf.copy(e,0,0,this._offset),this._buf=e,this._size=n}},writer=f,writer}var hasRequiredBer;function requireBer(){return hasRequiredBer||(hasRequiredBer=1,(function(c){var t=requireErrors$1(),u=requireTypes(),o=requireReader(),d=requireWriter();c.exports={Reader:o,Writer:d};for(var r in u)u.hasOwnProperty(r)&&(c.exports[r]=u[r]);for(var h in t)t.hasOwnProperty(h)&&(c.exports[h]=t[h])})(ber)),ber.exports}var lib,hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var c=requireBer();return lib={Ber:c,BerReader:c.Reader,BerWriter:c.Writer},lib}var formats={exports:{}},pkcs1={exports:{}},hasRequiredPkcs1;function requirePkcs1(){return hasRequiredPkcs1||(hasRequiredPkcs1=1,(function(c){var t=requireLib().Ber,u=requireUtils()._,o=requireUtils();const d="-----BEGIN RSA PRIVATE KEY-----",r="-----END RSA PRIVATE KEY-----",h="-----BEGIN RSA PUBLIC KEY-----",f="-----END RSA PUBLIC KEY-----";c.exports={privateExport:function(a,n){n=n||{};var e=a.n.toBuffer(),s=a.d.toBuffer(),l=a.p.toBuffer(),v=a.q.toBuffer(),b=a.dmp1.toBuffer(),m=a.dmq1.toBuffer(),q=a.coeff.toBuffer(),E=e.length+s.length+l.length+v.length+b.length+m.length+q.length+512,S=new t.Writer({size:E});return S.startSequence(),S.writeInt(0),S.writeBuffer(e,2),S.writeInt(a.e),S.writeBuffer(s,2),S.writeBuffer(l,2),S.writeBuffer(v,2),S.writeBuffer(b,2),S.writeBuffer(m,2),S.writeBuffer(q,2),S.endSequence(),n.type==="der"?S.buffer:d+`
|
|
74
|
+
`));var G=new e({actual:K,expected:Q,message:j,operator:F,stackStartFn:N});throw G.generatedMessage=ae,G}}Y.match=function K(Q,j,N){x(Q,j,N,K,"match")},Y.doesNotMatch=function K(Q,j,N){x(Q,j,N,K,"doesNotMatch")};function L(){for(var K=arguments.length,Q=new Array(K),j=0;j<K;j++)Q[j]=arguments[j];X.apply(void 0,[L,Q.length].concat(Q))}return Y.strict=B(L,Y,{equal:Y.strictEqual,deepEqual:Y.deepStrictEqual,notEqual:Y.notStrictEqual,notDeepEqual:Y.notDeepStrictEqual}),Y.strict.strict=Y.strict,assert.exports}var safer_1,hasRequiredSafer;function requireSafer(){if(hasRequiredSafer)return safer_1;hasRequiredSafer=1;var s=requireDist(),t=s.Buffer,f={},o;for(o in s)s.hasOwnProperty(o)&&(o==="SlowBuffer"||o==="Buffer"||(f[o]=s[o]));var d=f.Buffer={};for(o in t)t.hasOwnProperty(o)&&(o==="allocUnsafe"||o==="allocUnsafeSlow"||(d[o]=t[o]));if(f.Buffer.prototype=t.prototype,(!d.from||d.from===Uint8Array.from)&&(d.from=function(r,h,c){if(typeof r=="number")throw new TypeError('The "value" argument must not be of type number. Received type '+typeof r);if(r&&typeof r.length>"u")throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof r);return t(r,h,c)}),d.alloc||(d.alloc=function(r,h,c){if(typeof r!="number")throw new TypeError('The "size" argument must be of type number. Received type '+typeof r);if(r<0||r>=2*(1<<30))throw new RangeError('The value "'+r+'" is invalid for option "size"');var n=t(r);return!h||h.length===0?n.fill(0):typeof c=="string"?n.fill(h,c):n.fill(h),n}),!f.kStringMaxLength)try{f.kStringMaxLength=process$1.binding("buffer").kStringMaxLength}catch{}return f.constants||(f.constants={MAX_LENGTH:f.kMaxLength},f.kStringMaxLength&&(f.constants.MAX_STRING_LENGTH=f.kStringMaxLength)),safer_1=f,safer_1}var reader,hasRequiredReader;function requireReader(){if(hasRequiredReader)return reader;hasRequiredReader=1;var s=requireAssert(),t=requireSafer().Buffer,f=requireTypes(),o=requireErrors$1(),d=o.newInvalidAsn1Error;function r(h){if(!h||!t.isBuffer(h))throw new TypeError("data must be a node Buffer");this._buf=h,this._size=h.length,this._len=0,this._offset=0}return Object.defineProperty(r.prototype,"length",{enumerable:!0,get:function(){return this._len}}),Object.defineProperty(r.prototype,"offset",{enumerable:!0,get:function(){return this._offset}}),Object.defineProperty(r.prototype,"remain",{get:function(){return this._size-this._offset}}),Object.defineProperty(r.prototype,"buffer",{get:function(){return this._buf.slice(this._offset)}}),r.prototype.readByte=function(h){if(this._size-this._offset<1)return null;var c=this._buf[this._offset]&255;return h||(this._offset+=1),c},r.prototype.peek=function(){return this.readByte(!0)},r.prototype.readLength=function(h){if(h===void 0&&(h=this._offset),h>=this._size)return null;var c=this._buf[h++]&255;if(c===null)return null;if((c&128)===128){if(c&=127,c===0)throw d("Indefinite length not supported");if(c>4)throw d("encoding too long");if(this._size-h<c)return null;this._len=0;for(var n=0;n<c;n++)this._len=(this._len<<8)+(this._buf[h++]&255)}else this._len=c;return h},r.prototype.readSequence=function(h){var c=this.peek();if(c===null)return null;if(h!==void 0&&h!==c)throw d("Expected 0x"+h.toString(16)+": got 0x"+c.toString(16));var n=this.readLength(this._offset+1);return n===null?null:(this._offset=n,c)},r.prototype.readInt=function(){return this._readTag(f.Integer)},r.prototype.readBoolean=function(){return this._readTag(f.Boolean)!==0},r.prototype.readEnumeration=function(){return this._readTag(f.Enumeration)},r.prototype.readString=function(h,c){h||(h=f.OctetString);var n=this.peek();if(n===null)return null;if(n!==h)throw d("Expected 0x"+h.toString(16)+": got 0x"+n.toString(16));var a=this.readLength(this._offset+1);if(a===null||this.length>this._size-a)return null;if(this._offset=a,this.length===0)return c?t.alloc(0):"";var e=this._buf.slice(this._offset,this._offset+this.length);return this._offset+=this.length,c?e:e.toString("utf8")},r.prototype.readOID=function(h){h||(h=f.OID);var c=this.readString(h,!0);if(c===null)return null;for(var n=[],a=0,e=0;e<c.length;e++){var u=c[e]&255;a<<=7,a+=u&127,(u&128)===0&&(n.push(a),a=0)}return a=n.shift(),n.unshift(a%40),n.unshift(a/40>>0),n.join(".")},r.prototype._readTag=function(h){s.ok(h!==void 0);var c=this.peek();if(c===null)return null;if(c!==h)throw d("Expected 0x"+h.toString(16)+": got 0x"+c.toString(16));var n=this.readLength(this._offset+1);if(n===null)return null;if(this.length>4)throw d("Integer too long: "+this.length);if(this.length>this._size-n)return null;this._offset=n;for(var a=this._buf[this._offset],e=0,u=0;u<this.length;u++)e<<=8,e|=this._buf[this._offset++]&255;return(a&128)===128&&u!==4&&(e-=1<<u*8),e>>0},reader=r,reader}var writer,hasRequiredWriter;function requireWriter(){if(hasRequiredWriter)return writer;hasRequiredWriter=1;var s=requireAssert(),t=requireSafer().Buffer,f=requireTypes(),o=requireErrors$1(),d=o.newInvalidAsn1Error,r={size:1024,growthFactor:8};function h(n,a){s.ok(n),s.equal(typeof n,"object"),s.ok(a),s.equal(typeof a,"object");var e=Object.getOwnPropertyNames(n);return e.forEach(function(u){if(!a[u]){var l=Object.getOwnPropertyDescriptor(n,u);Object.defineProperty(a,u,l)}}),a}function c(n){n=h(r,n||{}),this._buf=t.alloc(n.size||1024),this._size=this._buf.length,this._offset=0,this._options=n,this._seq=[]}return Object.defineProperty(c.prototype,"buffer",{get:function(){if(this._seq.length)throw d(this._seq.length+" unended sequence(s)");return this._buf.slice(0,this._offset)}}),c.prototype.writeByte=function(n){if(typeof n!="number")throw new TypeError("argument must be a Number");this._ensure(1),this._buf[this._offset++]=n},c.prototype.writeInt=function(n,a){if(typeof n!="number")throw new TypeError("argument must be a Number");typeof a!="number"&&(a=f.Integer);for(var e=4;((n&4286578688)===0||(n&4286578688)===-8388608)&&e>1;)e--,n<<=8;if(e>4)throw d("BER ints cannot be > 0xffffffff");for(this._ensure(2+e),this._buf[this._offset++]=a,this._buf[this._offset++]=e;e-- >0;)this._buf[this._offset++]=(n&4278190080)>>>24,n<<=8},c.prototype.writeNull=function(){this.writeByte(f.Null),this.writeByte(0)},c.prototype.writeEnumeration=function(n,a){if(typeof n!="number")throw new TypeError("argument must be a Number");return typeof a!="number"&&(a=f.Enumeration),this.writeInt(n,a)},c.prototype.writeBoolean=function(n,a){if(typeof n!="boolean")throw new TypeError("argument must be a Boolean");typeof a!="number"&&(a=f.Boolean),this._ensure(3),this._buf[this._offset++]=a,this._buf[this._offset++]=1,this._buf[this._offset++]=n?255:0},c.prototype.writeString=function(n,a){if(typeof n!="string")throw new TypeError("argument must be a string (was: "+typeof n+")");typeof a!="number"&&(a=f.OctetString);var e=t.byteLength(n);this.writeByte(a),this.writeLength(e),e&&(this._ensure(e),this._buf.write(n,this._offset),this._offset+=e)},c.prototype.writeBuffer=function(n,a){if(typeof a!="number")throw new TypeError("tag must be a number");if(!t.isBuffer(n))throw new TypeError("argument must be a buffer");this.writeByte(a),this.writeLength(n.length),this._ensure(n.length),n.copy(this._buf,this._offset,0,n.length),this._offset+=n.length},c.prototype.writeStringArray=function(n){if(!n instanceof Array)throw new TypeError("argument must be an Array[String]");var a=this;n.forEach(function(e){a.writeString(e)})},c.prototype.writeOID=function(n,a){if(typeof n!="string")throw new TypeError("argument must be a string");if(typeof a!="number"&&(a=f.OID),!/^([0-9]+\.){3,}[0-9]+$/.test(n))throw new Error("argument is not a valid OID string");function e(b,m){m<128?b.push(m):m<16384?(b.push(m>>>7|128),b.push(m&127)):m<2097152?(b.push(m>>>14|128),b.push((m>>>7|128)&255),b.push(m&127)):m<268435456?(b.push(m>>>21|128),b.push((m>>>14|128)&255),b.push((m>>>7|128)&255),b.push(m&127)):(b.push((m>>>28|128)&255),b.push((m>>>21|128)&255),b.push((m>>>14|128)&255),b.push((m>>>7|128)&255),b.push(m&127))}var u=n.split("."),l=[];l.push(parseInt(u[0],10)*40+parseInt(u[1],10)),u.slice(2).forEach(function(b){e(l,parseInt(b,10))});var v=this;this._ensure(2+l.length),this.writeByte(a),this.writeLength(l.length),l.forEach(function(b){v.writeByte(b)})},c.prototype.writeLength=function(n){if(typeof n!="number")throw new TypeError("argument must be a Number");if(this._ensure(4),n<=127)this._buf[this._offset++]=n;else if(n<=255)this._buf[this._offset++]=129,this._buf[this._offset++]=n;else if(n<=65535)this._buf[this._offset++]=130,this._buf[this._offset++]=n>>8,this._buf[this._offset++]=n;else if(n<=16777215)this._buf[this._offset++]=131,this._buf[this._offset++]=n>>16,this._buf[this._offset++]=n>>8,this._buf[this._offset++]=n;else throw d("Length too long (> 4 bytes)")},c.prototype.startSequence=function(n){typeof n!="number"&&(n=f.Sequence|f.Constructor),this.writeByte(n),this._seq.push(this._offset),this._ensure(3),this._offset+=3},c.prototype.endSequence=function(){var n=this._seq.pop(),a=n+3,e=this._offset-a;if(e<=127)this._shift(a,e,-2),this._buf[n]=e;else if(e<=255)this._shift(a,e,-1),this._buf[n]=129,this._buf[n+1]=e;else if(e<=65535)this._buf[n]=130,this._buf[n+1]=e>>8,this._buf[n+2]=e;else if(e<=16777215)this._shift(a,e,1),this._buf[n]=131,this._buf[n+1]=e>>16,this._buf[n+2]=e>>8,this._buf[n+3]=e;else throw d("Sequence too long")},c.prototype._shift=function(n,a,e){s.ok(n!==void 0),s.ok(a!==void 0),s.ok(e),this._buf.copy(this._buf,n+e,n,n+a),this._offset+=e},c.prototype._ensure=function(n){if(s.ok(n),this._size-this._offset<n){var a=this._size*this._options.growthFactor;a-this._offset<n&&(a+=n);var e=t.alloc(a);this._buf.copy(e,0,0,this._offset),this._buf=e,this._size=a}},writer=c,writer}var hasRequiredBer;function requireBer(){return hasRequiredBer||(hasRequiredBer=1,(function(s){var t=requireErrors$1(),f=requireTypes(),o=requireReader(),d=requireWriter();s.exports={Reader:o,Writer:d};for(var r in f)f.hasOwnProperty(r)&&(s.exports[r]=f[r]);for(var h in t)t.hasOwnProperty(h)&&(s.exports[h]=t[h])})(ber)),ber.exports}var lib,hasRequiredLib;function requireLib(){if(hasRequiredLib)return lib;hasRequiredLib=1;var s=requireBer();return lib={Ber:s,BerReader:s.Reader,BerWriter:s.Writer},lib}var formats={exports:{}},pkcs1={exports:{}},hasRequiredPkcs1;function requirePkcs1(){return hasRequiredPkcs1||(hasRequiredPkcs1=1,(function(s){var t=requireLib().Ber,f=requireUtils()._,o=requireUtils();const d="-----BEGIN RSA PRIVATE KEY-----",r="-----END RSA PRIVATE KEY-----",h="-----BEGIN RSA PUBLIC KEY-----",c="-----END RSA PUBLIC KEY-----";s.exports={privateExport:function(n,a){a=a||{};var e=n.n.toBuffer(),u=n.d.toBuffer(),l=n.p.toBuffer(),v=n.q.toBuffer(),b=n.dmp1.toBuffer(),m=n.dmq1.toBuffer(),B=n.coeff.toBuffer(),E=e.length+u.length+l.length+v.length+b.length+m.length+B.length+512,S=new t.Writer({size:E});return S.startSequence(),S.writeInt(0),S.writeBuffer(e,2),S.writeInt(n.e),S.writeBuffer(u,2),S.writeBuffer(l,2),S.writeBuffer(v,2),S.writeBuffer(b,2),S.writeBuffer(m,2),S.writeBuffer(B,2),S.endSequence(),a.type==="der"?S.buffer:d+`
|
|
75
75
|
`+o.linebrk(S.buffer.toString("base64"),64)+`
|
|
76
|
-
`+r},privateImport:function(a,
|
|
76
|
+
`+r},privateImport:function(n,a,e){e=e||{};var u;if(e.type!=="der")if(Buffer.isBuffer(a)&&(a=a.toString("utf8")),f.isString(a)){var l=o.trimSurroundingText(a,d,r).replace(/\s+|\n\r|\n|\r$/gm,"");u=Buffer.from(l,"base64")}else throw Error("Unsupported key format");else if(Buffer.isBuffer(a))u=a;else throw Error("Unsupported key format");var v=new t.Reader(u);v.readSequence(),v.readString(2,!0),n.setPrivate(v.readString(2,!0),v.readString(2,!0),v.readString(2,!0),v.readString(2,!0),v.readString(2,!0),v.readString(2,!0),v.readString(2,!0),v.readString(2,!0))},publicExport:function(n,a){a=a||{};var e=n.n.toBuffer(),u=e.length+512,l=new t.Writer({size:u});return l.startSequence(),l.writeBuffer(e,2),l.writeInt(n.e),l.endSequence(),a.type==="der"?l.buffer:h+`
|
|
77
77
|
`+o.linebrk(l.buffer.toString("base64"),64)+`
|
|
78
|
-
`+
|
|
78
|
+
`+c},publicImport:function(n,a,e){e=e||{};var u;if(e.type!=="der"){if(Buffer.isBuffer(a)&&(a=a.toString("utf8")),f.isString(a)){var l=o.trimSurroundingText(a,h,c).replace(/\s+|\n\r|\n|\r$/gm,"");u=Buffer.from(l,"base64")}}else if(Buffer.isBuffer(a))u=a;else throw Error("Unsupported key format");var v=new t.Reader(u);v.readSequence(),n.setPublic(v.readString(2,!0),v.readString(2,!0))},autoImport:function(n,a){return/^[\S\s]*-----BEGIN RSA PRIVATE KEY-----\s*(?=(([A-Za-z0-9+/=]+\s*)+))\1-----END RSA PRIVATE KEY-----[\S\s]*$/g.test(a)?(s.exports.privateImport(n,a),!0):/^[\S\s]*-----BEGIN RSA PUBLIC KEY-----\s*(?=(([A-Za-z0-9+/=]+\s*)+))\1-----END RSA PUBLIC KEY-----[\S\s]*$/g.test(a)?(s.exports.publicImport(n,a),!0):!1}}})(pkcs1)),pkcs1.exports}var pkcs8={exports:{}},hasRequiredPkcs8;function requirePkcs8(){return hasRequiredPkcs8||(hasRequiredPkcs8=1,(function(s){var t=requireLib().Ber,f=requireUtils()._,o="1.2.840.113549.1.1.1",d=requireUtils();const r="-----BEGIN PRIVATE KEY-----",h="-----END PRIVATE KEY-----",c="-----BEGIN PUBLIC KEY-----",n="-----END PUBLIC KEY-----";s.exports={privateExport:function(a,e){e=e||{};var u=a.n.toBuffer(),l=a.d.toBuffer(),v=a.p.toBuffer(),b=a.q.toBuffer(),m=a.dmp1.toBuffer(),B=a.dmq1.toBuffer(),E=a.coeff.toBuffer(),S=u.length+l.length+v.length+b.length+m.length+B.length+E.length+512,O=new t.Writer({size:S});O.startSequence(),O.writeInt(0),O.writeBuffer(u,2),O.writeInt(a.e),O.writeBuffer(l,2),O.writeBuffer(v,2),O.writeBuffer(b,2),O.writeBuffer(m,2),O.writeBuffer(B,2),O.writeBuffer(E,2),O.endSequence();var D=new t.Writer({size:S});return D.startSequence(),D.writeInt(0),D.startSequence(),D.writeOID(o),D.writeNull(),D.endSequence(),D.writeBuffer(O.buffer,4),D.endSequence(),e.type==="der"?D.buffer:r+`
|
|
79
79
|
`+d.linebrk(D.buffer.toString("base64"),64)+`
|
|
80
|
-
`+h},privateImport:function(
|
|
80
|
+
`+h},privateImport:function(a,e,u){u=u||{};var l;if(u.type!=="der")if(Buffer.isBuffer(e)&&(e=e.toString("utf8")),f.isString(e)){var v=d.trimSurroundingText(e,r,h).replace("-----END PRIVATE KEY-----","").replace(/\s+|\n\r|\n|\r$/gm,"");l=Buffer.from(v,"base64")}else throw Error("Unsupported key format");else if(Buffer.isBuffer(e))l=e;else throw Error("Unsupported key format");var b=new t.Reader(l);b.readSequence(),b.readInt(0);var m=new t.Reader(b.readString(48,!0));if(m.readOID(6,!0)!==o)throw Error("Invalid Public key format");var B=new t.Reader(b.readString(4,!0));B.readSequence(),B.readString(2,!0),a.setPrivate(B.readString(2,!0),B.readString(2,!0),B.readString(2,!0),B.readString(2,!0),B.readString(2,!0),B.readString(2,!0),B.readString(2,!0),B.readString(2,!0))},publicExport:function(a,e){e=e||{};var u=a.n.toBuffer(),l=u.length+512,v=new t.Writer({size:l});v.writeByte(0),v.startSequence(),v.writeBuffer(u,2),v.writeInt(a.e),v.endSequence();var b=new t.Writer({size:l});return b.startSequence(),b.startSequence(),b.writeOID(o),b.writeNull(),b.endSequence(),b.writeBuffer(v.buffer,3),b.endSequence(),e.type==="der"?b.buffer:c+`
|
|
81
81
|
`+d.linebrk(b.buffer.toString("base64"),64)+`
|
|
82
|
-
`+
|
|
83
|
-
`+
|
|
82
|
+
`+n},publicImport:function(a,e,u){u=u||{};var l;if(u.type!=="der"){if(Buffer.isBuffer(e)&&(e=e.toString("utf8")),f.isString(e)){var v=d.trimSurroundingText(e,c,n).replace(/\s+|\n\r|\n|\r$/gm,"");l=Buffer.from(v,"base64")}}else if(Buffer.isBuffer(e))l=e;else throw Error("Unsupported key format");var b=new t.Reader(l);b.readSequence();var m=new t.Reader(b.readString(48,!0));if(m.readOID(6,!0)!==o)throw Error("Invalid Public key format");var B=new t.Reader(b.readString(3,!0));B.readByte(),B.readSequence(),a.setPublic(B.readString(2,!0),B.readString(2,!0))},autoImport:function(a,e){return/^[\S\s]*-----BEGIN PRIVATE KEY-----\s*(?=(([A-Za-z0-9+/=]+\s*)+))\1-----END PRIVATE KEY-----[\S\s]*$/g.test(e)?(s.exports.privateImport(a,e),!0):/^[\S\s]*-----BEGIN PUBLIC KEY-----\s*(?=(([A-Za-z0-9+/=]+\s*)+))\1-----END PUBLIC KEY-----[\S\s]*$/g.test(e)?(s.exports.publicImport(a,e),!0):!1}}})(pkcs8)),pkcs8.exports}var components={exports:{}},hasRequiredComponents;function requireComponents(){return hasRequiredComponents||(hasRequiredComponents=1,(function(s){requireUtils()._,requireUtils(),s.exports={privateExport:function(t,f){return{n:t.n.toBuffer(),e:t.e,d:t.d.toBuffer(),p:t.p.toBuffer(),q:t.q.toBuffer(),dmp1:t.dmp1.toBuffer(),dmq1:t.dmq1.toBuffer(),coeff:t.coeff.toBuffer()}},privateImport:function(t,f,o){if(f.n&&f.e&&f.d&&f.p&&f.q&&f.dmp1&&f.dmq1&&f.coeff)t.setPrivate(f.n,f.e,f.d,f.p,f.q,f.dmp1,f.dmq1,f.coeff);else throw Error("Invalid key data")},publicExport:function(t,f){return{n:t.n.toBuffer(),e:t.e}},publicImport:function(t,f,o){if(f.n&&f.e)t.setPublic(f.n,f.e);else throw Error("Invalid key data")},autoImport:function(t,f){return f.n&&f.e?f.d&&f.p&&f.q&&f.dmp1&&f.dmq1&&f.coeff?(s.exports.privateImport(t,f),!0):(s.exports.publicImport(t,f),!0):!1}}})(components)),components.exports}var openssh={exports:{}},hasRequiredOpenssh;function requireOpenssh(){return hasRequiredOpenssh||(hasRequiredOpenssh=1,(function(s){var t=requireUtils()._,f=requireUtils(),o=requireJsbn();const d="-----BEGIN OPENSSH PRIVATE KEY-----",r="-----END OPENSSH PRIVATE KEY-----";s.exports={privateExport:function(n,a){const e=n.n.toBuffer();let u=Buffer.alloc(4);for(u.writeUInt32BE(n.e,0);u[0]===0;)u=u.slice(1);const l=n.d.toBuffer(),v=n.coeff.toBuffer(),b=n.p.toBuffer(),m=n.q.toBuffer();let B;typeof n.sshcomment<"u"?B=Buffer.from(n.sshcomment):B=Buffer.from([]);const E=15+u.byteLength+4+e.byteLength,S=23+e.byteLength+4+u.byteLength+4+l.byteLength+4+v.byteLength+4+b.byteLength+4+m.byteLength+4+B.byteLength;let O=43+E+4+S;const D=Math.ceil(S/8)*8-S;O+=D;const $=Buffer.alloc(O),H={buf:$,off:0};$.write("openssh-key-v1","utf8"),$.writeUInt8(0,14),H.off+=15,c(H,Buffer.from("none")),c(H,Buffer.from("none")),c(H,Buffer.from("")),H.off=H.buf.writeUInt32BE(1,H.off),H.off=H.buf.writeUInt32BE(E,H.off),c(H,Buffer.from("ssh-rsa")),c(H,u),c(H,e),H.off=H.buf.writeUInt32BE(O-47-E,H.off),H.off+=8,c(H,Buffer.from("ssh-rsa")),c(H,e),c(H,u),c(H,l),c(H,v),c(H,b),c(H,m),c(H,B);let Y=1;for(;H.off<O;)H.off=H.buf.writeUInt8(Y++,H.off);return a.type==="der"?H.buf:d+`
|
|
83
|
+
`+f.linebrk($.toString("base64"),70)+`
|
|
84
84
|
`+r+`
|
|
85
|
-
`},privateImport:function(a,
|
|
86
|
-
`},publicImport:function(a,n,e){e=e||{};var s;if(e.type!=="der")if(Buffer.isBuffer(n)&&(n=n.toString("utf8")),t.isString(n)){if(n.substring(0,8)!=="ssh-rsa ")throw Error("Unsupported key format");let q=n.indexOf(" ",8);q===-1?q=n.length:a.sshcomment=n.substring(q+1).replace(/\s+|\n\r|\n|\r$/gm,"");const E=n.substring(8,q).replace(/\s+|\n\r|\n|\r$/gm,"");s=Buffer.from(E,"base64")}else throw Error("Unsupported key format");else if(Buffer.isBuffer(n))s=n;else throw Error("Unsupported key format");const l={buf:s,off:0},v=h(l).toString("ascii");if(v!=="ssh-rsa")throw Error("Invalid key type: "+v);const b=h(l),m=h(l);a.setPublic(m,b)},autoImport:function(a,n){return/^[\S\s]*-----BEGIN OPENSSH PRIVATE KEY-----\s*(?=(([A-Za-z0-9+/=]+\s*)+))\1-----END OPENSSH PRIVATE KEY-----[\S\s]*$/g.test(n)?(c.exports.privateImport(a,n),!0):/^[\S\s]*ssh-rsa \s*(?=(([A-Za-z0-9+/=]+\s*)+))\1[\S\s]*$/g.test(n)?(c.exports.publicImport(a,n),!0):!1}};function h(a){const n=a.buf.readInt32BE(a.off);a.off+=4;const e=a.buf.slice(a.off,a.off+n);return a.off+=n,e}function f(a,n){a.buf.writeInt32BE(n.byteLength,a.off),a.off+=4,a.off+=n.copy(a.buf,a.off)}})(openssh)),openssh.exports}var hasRequiredFormats;function requireFormats(){return hasRequiredFormats||(hasRequiredFormats=1,(function(c){requireUtils()._;function t(u){u=u.split("-");for(var o="private",d={type:"default"},r=1;r<u.length;r++)if(u[r])switch(u[r]){case"public":o=u[r];break;case"private":o=u[r];break;case"pem":d.type=u[r];break;case"der":d.type=u[r];break}return{scheme:u[0],keyType:o,keyOpt:d}}c.exports={pkcs1:requirePkcs1(),pkcs8:requirePkcs8(),components:requireComponents(),openssh:requireOpenssh(),isPrivateExport:function(u){return c.exports[u]&&typeof c.exports[u].privateExport=="function"},isPrivateImport:function(u){return c.exports[u]&&typeof c.exports[u].privateImport=="function"},isPublicExport:function(u){return c.exports[u]&&typeof c.exports[u].publicExport=="function"},isPublicImport:function(u){return c.exports[u]&&typeof c.exports[u].publicImport=="function"},detectAndImport:function(u,o,d){if(d===void 0){for(var r in c.exports)if(typeof c.exports[r].autoImport=="function"&&c.exports[r].autoImport(u,o))return!0}else if(d){var h=t(d);if(c.exports[h.scheme])h.keyType==="private"?c.exports[h.scheme].privateImport(u,o,h.keyOpt):c.exports[h.scheme].publicImport(u,o,h.keyOpt);else throw Error("Unsupported key format")}return!1},detectAndExport:function(u,o){if(o){var d=t(o);if(c.exports[d.scheme])if(d.keyType==="private"){if(!u.isPrivate())throw Error("This is not private key");return c.exports[d.scheme].privateExport(u,d.keyOpt)}else{if(!u.isPublic())throw Error("This is not public key");return c.exports[d.scheme].publicExport(u,d.keyOpt)}else throw Error("Unsupported key format")}}}})(formats)),formats.exports}var NodeRSA$1,hasRequiredNodeRSA;function requireNodeRSA(){if(hasRequiredNodeRSA)return NodeRSA$1;hasRequiredNodeRSA=1;var c=requireRsa();requireCryptoBrowserify(),requireLib().Ber;var t=requireUtils()._,u=requireUtils(),o=requireSchemes(),d=requireFormats();return NodeRSA$1=(function(){var r={node10:["md4","md5","ripemd160","sha1","sha224","sha256","sha384","sha512"],node:["md4","md5","ripemd160","sha1","sha224","sha256","sha384","sha512"],iojs:["md4","md5","ripemd160","sha1","sha224","sha256","sha384","sha512"],browser:["md5","ripemd160","sha1","sha256","sha512"]},h="pkcs1_oaep",f="pkcs1",a="private",n={private:"pkcs1-private-pem","private-der":"pkcs1-private-der",public:"pkcs8-public-pem","public-der":"pkcs8-public-der"};function e(s,l,v){if(!(this instanceof e))return new e(s,l,v);t.isObject(l)&&(v=l,l=void 0),this.$options={signingScheme:f,signingSchemeOptions:{hash:"sha256",saltLength:null},encryptionScheme:h,encryptionSchemeOptions:{hash:"sha1",label:null},environment:u.detectEnvironment(),rsaUtils:this},this.keyPair=new c.Key,this.$cache={},Buffer.isBuffer(s)||t.isString(s)?this.importKey(s,l):t.isObject(s)&&this.generateKeyPair(s.b,s.e),this.setOptions(v)}return e.prototype.setOptions=function(s){if(s=s||{},s.environment&&(this.$options.environment=s.environment),s.signingScheme){if(t.isString(s.signingScheme)){var l=s.signingScheme.toLowerCase().split("-");l.length==1?r.node.indexOf(l[0])>-1?(this.$options.signingSchemeOptions={hash:l[0]},this.$options.signingScheme=f):(this.$options.signingScheme=l[0],this.$options.signingSchemeOptions={hash:null}):(this.$options.signingSchemeOptions={hash:l[1]},this.$options.signingScheme=l[0])}else t.isObject(s.signingScheme)&&(this.$options.signingScheme=s.signingScheme.scheme||f,this.$options.signingSchemeOptions=t.omit(s.signingScheme,"scheme"));if(!o.isSignature(this.$options.signingScheme))throw Error("Unsupported signing scheme");if(this.$options.signingSchemeOptions.hash&&r[this.$options.environment].indexOf(this.$options.signingSchemeOptions.hash)===-1)throw Error("Unsupported hashing algorithm for "+this.$options.environment+" environment")}if(s.encryptionScheme){if(t.isString(s.encryptionScheme)?(this.$options.encryptionScheme=s.encryptionScheme.toLowerCase(),this.$options.encryptionSchemeOptions={}):t.isObject(s.encryptionScheme)&&(this.$options.encryptionScheme=s.encryptionScheme.scheme||h,this.$options.encryptionSchemeOptions=t.omit(s.encryptionScheme,"scheme")),!o.isEncryption(this.$options.encryptionScheme))throw Error("Unsupported encryption scheme");if(this.$options.encryptionSchemeOptions.hash&&r[this.$options.environment].indexOf(this.$options.encryptionSchemeOptions.hash)===-1)throw Error("Unsupported hashing algorithm for "+this.$options.environment+" environment")}this.keyPair.setOptions(this.$options)},e.prototype.generateKeyPair=function(s,l){if(s=s||2048,l=l||65537,s%8!==0)throw Error("Key size must be a multiple of 8.");return this.keyPair.generate(s,l.toString(16)),this.$cache={},this},e.prototype.importKey=function(s,l){if(!s)throw Error("Empty key given");if(l&&(l=n[l]||l),!d.detectAndImport(this.keyPair,s,l)&&l===void 0)throw Error("Key format must be specified");return this.$cache={},this},e.prototype.exportKey=function(s){return s=s||a,s=n[s]||s,this.$cache[s]||(this.$cache[s]=d.detectAndExport(this.keyPair,s)),this.$cache[s]},e.prototype.isPrivate=function(){return this.keyPair.isPrivate()},e.prototype.isPublic=function(s){return this.keyPair.isPublic(s)},e.prototype.isEmpty=function(s){return!(this.keyPair.n||this.keyPair.e||this.keyPair.d)},e.prototype.encrypt=function(s,l,v){return this.$$encryptKey(!1,s,l,v)},e.prototype.decrypt=function(s,l){return this.$$decryptKey(!1,s,l)},e.prototype.encryptPrivate=function(s,l,v){return this.$$encryptKey(!0,s,l,v)},e.prototype.decryptPublic=function(s,l){return this.$$decryptKey(!0,s,l)},e.prototype.$$encryptKey=function(s,l,v,b){try{var m=this.keyPair.encrypt(this.$getDataForEncrypt(l,b),s);return v=="buffer"||!v?m:m.toString(v)}catch(q){throw Error("Error during encryption. Original error: "+q)}},e.prototype.$$decryptKey=function(s,l,v){try{l=t.isString(l)?Buffer.from(l,"base64"):l;var b=this.keyPair.decrypt(l,s);if(b===null)throw Error("Key decrypt method returns null.");return this.$getDecryptedData(b,v)}catch(m){throw Error("Error during decryption (probably incorrect key). Original error: "+m)}},e.prototype.sign=function(s,l,v){if(!this.isPrivate())throw Error("This is not private key");var b=this.keyPair.sign(this.$getDataForEncrypt(s,v));return l&&l!="buffer"&&(b=b.toString(l)),b},e.prototype.verify=function(s,l,v,b){if(!this.isPublic())throw Error("This is not public key");return b=!b||b=="buffer"?null:b,this.keyPair.verify(this.$getDataForEncrypt(s,v),l,b)},e.prototype.getKeySize=function(){return this.keyPair.keySize},e.prototype.getMaxMessageSize=function(){return this.keyPair.maxMessageLength},e.prototype.$getDataForEncrypt=function(s,l){if(t.isString(s)||t.isNumber(s))return Buffer.from(""+s,l||"utf8");if(Buffer.isBuffer(s))return s;if(t.isObject(s))return Buffer.from(JSON.stringify(s));throw Error("Unexpected data type")},e.prototype.$getDecryptedData=function(s,l){return l=l||"buffer",l=="buffer"?s:l=="json"?JSON.parse(s.toString()):s.toString(l)},e})(),NodeRSA$1}var NodeRSAExports=requireNodeRSA();const NodeRSA=getDefaultExportFromCjs$1(NodeRSAExports),debugKey="NJHgNB1HDTrHTJc4ERFCBRVBB5HOBEDCjRLChRDIdn8K7EUJD,Vm4C6vC8BpZ6n6G,hxOjYZ{,wYhnJize2rlm9m,6bUcRVbP6sjNbKU8juOWUpukkcV6Cw,Bk2io7{YWJcPnG{1o3GUTpnO:z{kCYHL14HjO8noH1sp[J78k3Y3IcbOSSk97evccx0MdW2uR0f5qhZFQV8e2JCRxxJEBRBC";function decryptWithDebugKey(c){return decryptWithKey(c,decodeString(debugKey))}function decryptWithKey(c,t){const{content:u,sign:o}=c,d=new NodeRSA(t,"pkcs8-public",{environment:"browser",signingScheme:"pkcs1-md5",encryptionScheme:"pkcs1"});if(!d.verify(u,o,"utf8","base64"))throw new Error("u-space: license verify failed");const h=decryptInternal(u,d);return JSON.parse(h)}function decryptInternal(c,t){const u=c.charCodeAt(0),o=c.substring(1,u),d=c.substring(u),r=parseHeader(o);let h="";for(const f of r){const a=d.substring(f.start,f.end);let n;f.encrypt?n=t.decryptPublic(a,"utf8"):n=decodeString(a),h+=n}return h}function parseHeader(c){const t=decodeToBytes(c),o=new DataView(t.buffer).getInt16(0);if(o===1)return parseHeaderV1(t.buffer);throw new Error(`u-space: content version error, version=${o}`)}function parseHeaderV1(c){const t=new DataView(c);let u=2;const o=t.getInt16(u);u+=2;const d=[];for(let r=0;r<o;r++){const h=t.getInt16(u);u+=2;const f=t.getInt16(u);u+=2;const a=t.getInt32(u);u+=4;const n=t.getInt32(u);u+=4;const e={index:h,encrypt:f>0,start:a,end:n};d.push(e)}return d.sort((r,h)=>r.index<=h.index?-1:1),d}const _base64KeyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function decodeToBytes(c){const t=[];let u,o,d,r,h,f,a,n=0;for(c=c.replace(/[^A-Za-z0-9+/=]/g,"");n<c.length;)r=_base64KeyStr.indexOf(c.charAt(n++)),h=_base64KeyStr.indexOf(c.charAt(n++)),f=_base64KeyStr.indexOf(c.charAt(n++)),a=_base64KeyStr.indexOf(c.charAt(n++)),u=r<<2|h>>4,o=(h&15)<<4|f>>2,d=(f&3)<<6|a,t.push(u),f!==64&&t.push(o),a!==64&&t.push(d);return new Int8Array(t)}function decodeString(c){let t="";for(let u=0;u<c.length;u++){const d=c.charCodeAt(u)-1;t+=String.fromCharCode(d)}return t}const logo="data:image/webp;base64,UklGRswmAABXRUJQVlA4TMAmAAAvAIVnEA+imJEkqF4DtQTrz3QpKGjbhjHsQhiui4tMGGI1fJLp/2pgpmGafmQX+FcJCpbA5zH0qRRk4CBkwumBoU/XQR7YOg4Ctg2bWk7Mn3Pd/RAiYgLOrwIBqGKLe/j8QQ8k9LxcT5WABkhGMBpgnw8+SRIUpZ93E4h/br9UEHckCdBoBPs8hU9QViMEdtsrD6UAYqu2nufuZiZJxnecsVPL7pbjycwkYzu3E7sk1A+Z23Vsz4d3UTL5kiS2Ezjbz23buR+2Y4/tGW+rtmfNtm3bvsd1r/ZN+///7v5yvC3Lkhxb/ZYgc6gwi0H0gzQR/Z8Ab8+2121s29Zv6N095XZIr6T///9ZaLniGL2qPlHQCxH6IEgfJBAkSET0fwIou7ZVR5I+woqKfkRX5v9/aKcrOPeauB5h+cpXHlhmAEIgUET/J8C3a1t1bdu25W/q1/qEyv//Vu/j4ppTdqrt0Q+gJCHzYIEQFsIR/Z8AWs62120j72FOd7OIpAdPL4juf1uxpf8V2zndcQASP0KIQAUSAol/qIj+T4AkadujNpr2fYgQO8HIGHpadd//ZhJIgi/ZqUS39Tv1US5CJsoZIvo/Ab5d26pr27at8k213fqVXsf/f1a/OuI6hOsbD6AsIfNggRBWEo7o/wT89h99Pq6p+8OXvymldK/1hdHA4/vzu683+Zvq8O53tPR/l7/H/La3ngyG577Ob3jrycAYv/173RQZIrf9eJ9LDJbnd3qLK5lBM67l7W3aGDq37/zeNm0MoZf6xjZtDKS5vqtNG8Nprn7wn/+av1xpq3ktkX/9vX70/adF2RhU8+wB0//Uv91ood7L49/v8fGvQN1HiDdjHvu532T/V+SnPxUZWvdivsF0N3ZGKxeWTUT+CnAFzkA7W5JydfTwJzqGV3cz3kuwtxuTk3hQ5yDfNqG+Cx3YFa1I6r7+aN//2e19braojjZfZZCN1XTdOdxITufBHOguTCEuwMIkJHuIZ+Cfap7tDDNkVwz3zhRz9DszWJBC7UIRShaH0pHMhPYloGmmK4PtWc22BZtdmRhNHOjMBpwhTkRXCpLJGItg1FmKCzdkZ7XLOVxJTmdAfVdKBleiEi+KHkAWQ9MS0G2WxKAbJ5sVppizBzMYMIXagBRizyazAcnF6IsgzlFc2OG2WmwJNrtzMfqgrygjg53YkFdlR3IZYxHoHCuD717sdTnJncXp5J2h7kAdQsloUxTJYmhaBGGGGH4YZ3MVZpjDhRnkrUwF9hAnpTIJSB5GXyYzQ7CbjLUE2126GD2IW0LtGSxEVfKhZCTdGIvAfv4JQuRqq8t5uLQ4mbjOLEALsWd2UgqS09C0AOIMORDxY6rCDHN6MIW2GuqawZXYnKRoAJKH0RfAPQOD8W6oJdjuVmf0IG1nTmAJsWS4KBuSbmhl36g/q+GIu50up7l1Opm0oZQMdmKXLmVH0pDGvtt+vgYk7mYqTnUrD6ZQ1kJtQA0ySYuiSCqycy/ajNeQxFhstAT7Msc7owdhhzIqsBNzpouSgOTZ0Mq8a45LUGK20eU0104n07WFemVwEKfVlYykIY133ebMYYm7iYpTXatOpKszCWghlmyfSkRSkZ11o3ow7gZagt3N+ZnRQFUKtWfwIO43ywOJACQfRtSPa0/MZj6Mu30uZ3OvORtVF7MBW5Dh3WalIZmQ9nF52r/cWTnNj/FjnuIE96oTiapDWTPYid3evSk7koTMwBe8Kocv42qcJdhoAGdGA00t1AakINPbVWUgyYcR9fmYAs3mzTjZ5nI2BM3ZaCpKyeBODHv/FdELyY60pyMNpFSP5oppihMQJCeS9BLqDtRBZAcmJSNZkPnpWANN5tEYLbMEGw3iwWigaFVGBVqQwYGkRCS5GJGejCnQ07wad8Nczo1hcjaCUqg9g4U4zcUDUSgXMj0XaSAjeDaudinOgSE5O0GdScAWZHNiRwqUBTmeiznQ23ybm6yyBFsM5MFoJacOZc7gTAxzsw2hPKDkYUR6Js5Ai3k3RqtcTkaxO42cPdQNSEFmR77ijkxPRB3K5eHYGeVwDhSLs5NTlJLBywhsOpHjiZgD7ebjWE2Sgi0GszBaiWmhNqC+E6fxeRiRmG1ezXn5NGego/q5s1hkcjKOy2nErMrI4BRkY1RHJmUJt32SOpTN/Bw7ixxOwrE4Oy1bqLtQiG9jdEMOZYNG/Rw90NN8Has9UrDDgBZGKymdqcAZZOdURSIhCxT7p9hCPfxdtMfkdCTdSZSkUHsGV+PgVJ6RCckrFOkT1KJk83f8mONwEpLT6ZTszAKkIKP9/LjoXZyGNGWR+ie4Ai3V57lijBTsMKiDGZQMZc1gN9rPHkrxzuSJWJOSOxQbt4WazOdxN8bkdCyd0URHC/UE6iBG/dlJ0urktH38kt00oFWrRTnN73G2xeE0LKfT6ShKyeAUZDduPdgdihPbAx3B92VTpHArluwMMrZQm1CMY9nVARVrCXU338dqicnZDezMaKJiVkYFWpDRll1uUDTqUEr2f9kSh9PQNKcTkUK9MrgabenlAo0K7aFuPwFY7ZDCrWiqU4joTAKWIEddfBsUu7OE2vPPgGyHydkN7szoQUIdSs9gN7otvrxCIzGHMupPAVYzHM6GpzmZhCnUDahhXh5gg6IrU6hT/jmwWyGFG/Akp5BQlDWDu1HMA+QOxWKkoaz5JwFnI0xONMAHowcBZ6hNKMa0nOq1/vOHVFayhFrWj00erTPC4WyIJicTsColgy3Mupx6PN+HP3PFBCncgCg5Bd8S6i4cxrr977ps1ids82dcTTA50SAfjB7wuvJegS0+Yfw03B4tmuBwbky7c6OrofYMdhf0EHucDZDCPTAtTkS3MwkI6uQl9zoDTE4x0IXRAO5dmTN4L4467XgQFqcBDiejupwNWwt1E8biWEMfwS+8FF5TPuXipF4N90C1OBHboZQMNl0c4V9+QTTO674J1anXnGKwC6MB2RZqE4pU+/NjF+lU79XJuC5nQ9aV9wxe6liXTcB83eThpFwN94HrdCKwFOouvFwLkaCvQ1IApZPnq1xzvg34YDTgupgKBHXtjVdDGH81AOYsTVRudjqy7jRYdSg9g1nCAR8nC4tqNdwHstPZYbVQF6AOGYcpyrKq1pxh0AejFVVR1gw2FXIoWZRdtdnp2GangTpDPYUi5oBdklOzGm7D1pwd1KqUDCYVdNgFYVGsQRVbdbRCSqE24RR12AV5KDY7u4GfnQapK6MCQWUdohxXvWq4DV1zXojqUK4MdmlXnBhZrwZVdNVRRHuoCajD6/xX6En5UejulVDF2PSand3gH84D0JvSM7ip1ylKb8q70rdfQicFi1Y13A3f5HQ8LdRNKAKvnFJUrRoU8CXnG8+qrBlsKvDwkOKj1exEI/BgNKHZQm3CvliuXxqQheiUquFuFExOR9OVtyyeiyVvPzj9glCFyEo1KFCwON9gUjzOcf81FsuPbr8g4JQhKjU70UgsjCYs+wNRvcI1cxRuqwzUqYZ703A5Hct4LDb3KdyK4Rp00LA4BUqLh1qFHi4yVJVmpxiRhdEDSXko3aTex2w13EzF5WQgWzzUS+zNZjuhg4rTKUDmh1JM7MGJcNWoO8XIHIweMFI81Cb4stWGk+noToZxPZRRBV8y2ku4iY7TKSjqeCjdVlfdGUboYPQAscVDDZKvGm04nZJX5wZRHsppq6sz3ERJcyKGpA+1ra+6M4zS6miAcEIphqPuqzqM1eyVBz/e6UOZ73T5ZWA4nZT86mwIDoV6A9njK9558CfzADvDbbQ0JyLoWAKQ9Us6JV6HKi3V0eBeVagvk30fkw3nZcQezubehuUSfleLneE2aiYnundDKSb8LhbrUKUmORqca1A26XdabDgvI/dwmnN23W84lFFFwwVAhSI+lHkJd6Nncnb33nELtdvnav/u3sUjQIcMVZkOBXqSo5WAzhwfrDvS3WLDiUbwm9PwpVBPk36bDEWXl3A3ii5nx7czTfo9KCN07VCgaHG0wntThkm/iwynMsOJRnJxGroWapZ+M2XMupzh3jRdzo5uZYL024XodOnQQdPmKLgl1N2E30whr7q8O8WIHk7C1pkk/S5SVFXOcDNV3enQ6lCKCb9KKWdVOnRQdToD2hTqJvzKKYWDqsUpRvZg9IGsMFX47ZQyq7KEm+nqTgd2htrtw1Vv1n4t9KY8efVm20krxUyq/AUlur45A9jKTID2L+nFg98KPSm/F7pbt1e+VVpr+rbsoOl3OR+qvDnD6K6OJlgp1GiA8rSrxdjRyoOi9Ka8K71byTsbLXo3ds/kBBk0uYXbCcuz02FdTIPkrkZ+uKJg2ihnA00v6EFZcwqqOpRhkm9yFHRXpTjDKK+OTqBaqFnyrRslXTW5hdtJy6uTQRUmCL6OshZNLqjRdncKpi3U1cTeFClrhKYFqrQlRydInXlIvfKltFdNbuG+jPjDyYhSqMVkXrk6ijtpckGNurtTEO3MLfKG70Z5T2haoEpdcnQC9M5UeTd9IkXuNLmF+zLyi/PE00LtJulKfVwvG6WeNLmgJ32XE/GszCWbvjT0CU3foEDfzdGAZgk1mmiqtHTS5BZuNAYW54mmM209MmhyQU8OXE4EU0P9rquRDE0LFDiwORqw7Ey31ciqyS3caCwczhNLYcJq5ISmF3TzoDsRykuop61GkioFmnhwOlqRrExbjxRNbuEWY+JwGpAUajEfxUx/tkPTC8pc6M4LSGfu9cigSoEmLpyOVhh1MGE1skPTFG4xLlaowWihdluNDKrcocyGPDs7jMJcq5Edqh5Q4kNztILYQi22GhlUSeEO42OFGoiZaauRDqreoc6IPDs7hhTqd12LuKLLAT04cXcGhovpthb5QNUU7jBOJkcThMFMa5ETut6hzop8OB1BC/U0cFNReschc6oyB9R4cXcGgoNp6Hal+BQ5O3RNAVdeJEeTe1uow9CdUs4VZe7Qbsw8nO5eZ+61yAPKHlDjxuUM52o8yDGtJS5QNgVcuXFz9OHan49Cz5WEK9rcod3Y+eZk18pvNg9oe0BPflzOl2Mtfq/poG0KOPDj5ujh1vp7TYS6dygaQ9+d7FTQVc026HNAT450pzjVPwI/3ulDme90+QnwgLop4MCRF0cnh+r4CBSlN+Vd6f3/f1foe4eisXQ42aFN1zQ7FD6gJ0+68+VQkTkJtFgUSgFPPDkdPZxJKme2+J0FCt+hYjyt0ObMS9CUWjlkboLGB/QPU/LsRFeCChrRLhDbJmicAp648s3R4EgWNNd674hNULlBxbhaoacbdQiaUU8AW6HzDGW25NmJbjQVNIXBCq4VOteAL77cHQ1ORElTGeRorVD6GzSMrwl6unApN16+pNuXLWL4jpWboPUMdcbkw4kudHbktKmHsZmT+bLcRDKktgla14AfnLk7Wt8vKD/c1cgP1/PsjE5ANRPU/gYN42yC2vvdH7K0/WD/woIYDzj9vKD3DHXW5MPZ3698xvbwMSkzSShdCvSuASfeXI5WmbA+B1ndgALpCs2bVHlzg9rbdTi3YIjS5IKQe0D1V2g35r45+9vZdGE97DOxf4IL0Dw1ogCKE1SvATfuXI7WtyPxAEhPQXHWbIJnf0H3JlXu3KAmEvLsVTxBGi7B2R7QfoZ2Y++bs8uExhXDs2tKcmjyAO1rwL/4050hE/LQMp4ojU8LLtsH+jcp8OfF0SQTLi3ACdLiAEseYMAZ+m0MHk6XCQnrhiar2pACE/eABWvATw51Z8iEfFCjwnmXdp8Qub5gwiYFDr04mmRCoyZDo6TtBMdlgBFfoWgshrpMqANqhkZJ63XAIldYsQb85NHsDJmQOzMuQ6PEwikAkSvs2KSJR83RJBM2ZQ+GRomVU0IhV1hyhr6MxxXKn4eLmAOrA/lfLK9Ev+yHHsi2YusTBLnClDXgf5iUZ6d8Hur9T/An5Zed3Op8ue0fftnP3QuD2Kt6n9sHGLNJE5eao8fH4Yl3Lp/E5iH0up/1BXPOUDEuJygLoeVdbI+9rekmWPQdymzK350igrJYi/1V6mPb/oBNXwK++HR3dBJAT5W4WaaeFbsJZu3Qt/E5QVn6zLESd9/H3tTs6wDLDqgzKn93vmTPqMTxqgj9J3frAOOeASdO7Y4GKTLaF07bWnxYFeNsn9Laeyxfro8JFu7Qt3H6Bj2lyG5cWzxuivLMq9V7PCWbT6L/7+DdJaVPrTD0gDqr8pvz+33q3//B7dMn6R73DDjx6i9Hw9vcCrisgrpUebVAz7c5Ealr4XrXw9jMgAfFkT85A3oZs4sT+ZaU4l+eQvW4vzkDbtzqjga27SSd3uK6v+lS5dYJbWw71yED2o3dwzlXfWfAjV/d0brm61Lg1wm1Nd+AojEc2ld8Z8Abx2ZH63qvS4FjDWoSpB7XFm/idvDMu4p5sjgaPB78u19TqnWw0YC6cbxCL2ZNn4nxyvp1fPfDdHwKtP6otT/3eJO7T33Z5gx4YlmeHa1UnY7YZ2JtH8nsqXRtUiOdjFpfPvvr5vKpdunQP8bzb1CjKrvxzSXzISSXYnKoeprpaMf8Zb5ONhlOqUyrUKdqcuPFpt9+hJxj7UiZ6G4XkXT7+jLHS7iTcf27M4gq5kZjU/YlZFa4UD3R5Y7687K+bNGdZmy/O5poSm6MyqbgT8gwWFdk7Gckl4clBtOM7wnqJJ3mxt/GJusehYx2VYmOdxvZXAcr3AL9OozzhzMoGtWNUhlVh09hqCzazux3JC/VBn8huRrr745e9IzJnBiHMcqSV+E8WJPT/R5A/qwW+JPowZh/e2LKYW78MlZZ8yqksuSJGJDnqt85Pux8BuP/NJRSqcnVnBjJmGXNr1DZUCfCQJ6rdnbXbSdbiGlDjXgj6cHm/lNnsP//4pAdxatQWRCIBHlW5YJr7SfG/U7V5t//yNnsp9MgaJycWSvLKIGgau2JYJB5+H8KjdN+zt2fwfh+bPsJ7y4o5l1LT8SD7F6/FnxyUTCbWlGEhO4xLsDUxjCDQl5eowKMLQTCwu0YFeDQWCQw5FLGBFJTA7HhVkcEqBpK6JDXEYGlmZL4MJfRAKpGFoTYTKMBSxMlIeK2jgVQNZBAIj9jAcGsIkzcRwL4YJQDxb2MA5yMFqT4U0YBFpMdoeJPGQPgg0EEi7GMASiDhBZjGQF4MiBcjOX9L+i9A8b4/ke9AjHu73/vWifIuI8KJMz4efeLdwA8RgQy1LZpPICoMb5Gf7iM//Az/sNp/Kcpoz/cx394jP9sZfSHy/gP6/jPWUZ/mH6N+vAx3/94+jnn13+XbINwv//89WL+cynFt3tgf33zIt1xy8TrAa1rj/s5j2faiXTlO/5P8muoKc9/iXCR7f+7d13MP5XhyRejXfJgdm3aJ60aHHaI84iWHSg5aus2rvhvEFbR9v756x5z8SBgah50bdxh2fAdEiHrpyhqG/0EkuLm97UvETjDWLbYX8acYJX7g5e0eWIlrPC0zip4+OooioB17YmAOYyxWk1SbYXUOQ1c3u4nVsAqSWM6efncbsiNAyobTlLNCzM3cOHcdpHVsEHRal3elrScUDugWE0nqcWNaONO2hAQFQ2PBJUoz+vyQfmAytaThbyNwUXaJBRSx5roKVE7WJcLuo4nVvOZ1bmFOydaI2RSxR52StRO1uVBT8dT9gBr9w3kDRRYJ0SSwxI3q2k/W+r45MbhxMEDzMLEdAM/sZKQoNPwTE3u2tVy49N9PLVeYO3AAnezMqNwMidiotPuPr/B03k4ueIFZolKXGU5RuYk7DxcA5TmHn9ueJpHE2+eYBX6yGmRlpiRE7DraHXDxjBBPx1dT0dT4wtWmXMDF2lCNDANu4/WjRltwi4RnOo4mNj7glVEHXeSbspFmYb3ozUhvU7oX+AUj6bWGywhOxdJnXJSOlZ0sPobo4cJvoJTCyDIlnL+YAfROYGKqI6yY/VoZUPGz4QfOjbNACLsUOuty3Lx8If2CswNfOOcGA2Iw8bB6gNxt+lgiNiUAtvf1i4K1fqDBUALlzmOc0EMjwfrJyOO6WOL2PpbkAPQf51Em0fYBQzuxnwR92Rk7KNjdRtxTC9bhCY3Ah1Q7o08fHpEO+XuXMdMkGMk7DlWbhDG9LNFaGrBDsDNidN5hCW5yOkL5QZpIAaWDpUbL+CYnn4iND0BD2WRpvGJdorpBialk74jGpaPVBwGHNPXFqGpBDzgcLJw8AhLcoE7IZfIjTAN13F6f4x4T2/bgtZXyEOJstx9osklzm3kRFXC2O3c6z0QbRkx9Q9nho5MboQ8oBVl9wnrYpmzjVSU1gau3dJeqx2E+LwZcnR9wCc03WEPrSSNVwyxlw3kTSyx5wbCbn/tpZWtOkAr3PSiDqcPuUJTDntoBeHgE/YipY5Lm3hgbQNz976b3QjItr9NH/SApmv3brxTaF17R3UPWkEOrzjEvnBjEzescnm3sDHxQx91i9B62rvpNvk1ivbuJvlVSRcvcnRaJf7XWD34Ita5tgnRX7G0W2UidU9czDk/peScz1j9mPoNmdzYuTvP8iNG1kqbHNdZYU5schY3cOE69uw2mHDilzrS61+X5+68eUFTDHvoxXCW+XNqKBPTwvUNnLiKfXZbRGTRw7u2/3s6K23e0HSGPSQpOBjHbEVSFhtc3UDFFWrOvZt4SGKXtLRzap3VOjTNsIcoxdM8ZifoLnZxjlviR6jv9hDhUGVs33HkTpoXtp7C3lOKZCD7iZPEImcn9nhwQftuLw9Z4DL0XUfuoJmhqY6ghyxEZyG7MUFMN5Cx6MGA3G6Zhi+d015953GCAja5sPcUIptodO8Cl6ghDxtku4uGJuzT9c2Tw8wvbGpBD1GGxkSWvUtcoC4fLCIZO2koorZbBjOmdWyaQe8uA220vMtco5oXF5KwREOkhLWZLB0yEzilkFeEKCay6tvJWYSqFwMZ2F8sFEFrl9HhIK2D6yPgYZHhaaMI2eXUcZ1J8rIhDessREiS3XEzZgInN/bp23B0/nIP0N2jMiQBO1eZn/ywCEyjw0ZCEXPIdGO0Dk5tnw5HD14CNMtw+EQHPnGFiZ5cQMcqC5ExZLwhZkKn5/+VI0BoREg+kYHJ2UkMeRqAHRskLCGHzDdEg6cS7rI/3ZAT0MIdxOWLAQFbJDREEsBImANeX8Eu+ZNjlBtZuUQ0b7Kc0U0cjE6oQjgcQfDkxqcXMStycYHo3iSxjD0kTAFDh2CrA2aEpzvUPb3pgnQkcgYkeRvE7thLggO0tYG8CBc+5U8uDTIRbVyUy/6Y2MAyB0vAWzBPQHNA16eWIaa7sYG7yzmPslTBxMEJeIRz1O3m7UBPn1ka5A4lrooNeZyEptEnCXW71oFYAVQH5MbnlSLoCWWuiE2fgtCBJQ6Wtv8S1Hu75oHip5XUIVVpzk6p5pOdMjt2c/DTdkVY13YzeqAzwCUvKl3QiTnukOpeHTIB6xzE7QYYa9slS5Gj+RllnKJWxXduF0ryepcxOmwcaPMitGu7YGlUTk/BLXvPyF3UNrmDC0LZLyeSsYuDst2AY22z2Q1Z6hj1Edoav0nPLXC27SdnQs4vOyUubHCQdivCO7lsySZHLrDNFPHQKfExiu1exMJlkWmeHxIDWxyE3RIgDVgyZSdHLazdZXjqBLcvROXuIp1q2C5RqCIObPeFqGOnLYsczaDWhoPvhrxzQ2RQ1VEqMI1+OIhY2BC/YM3YqBylkOZkgA88xoxcEflK9Z2yc92BvRwc2AtJBzW7LUud01c4uzMUNKM2zKZANvr8hB3rdixykLCFqWPZmE2O3AhmWYboAc2wgTsEdsrdFKvrAiYOBlWEeWKvNTs5aqFspozZfo9xE7cLOCrdNFBlndEnCYGqoNRRyZxFjp5A1grRWa9PA2curHs1OqpelM01GUskGD1QVeq091Y5KkGsp5A347n0QnO2rlNNVSPW11zYnxxFVNc3z1Ln9BTCshRP253D2I7LqwZVVVUbVdcMrHOQMaHO1ARgkyM3wtdBKYvlXHnRdy6tMrq/GVRZU6iwURRg6XfATo7u4FWcFBvs9j6Nf3BjzYGdbzplc9k0+uLoPHIWOcqha6GU2Ww9D/Nwcm3NTrnb24n1ZQc2SLhTCVegMoRRObrCVqKYyWyK0wctmM0VhUoPtFB12Y4tEtJfGUud01PIulPOw25SzYNXub5sGh0f7VRZFqiiXyA2OaojXPUUtFhO6nnQOrcvu6imjz9RFhcZ/ZD04qrfB2scxWDVO0EibCe9T1jk3LJB1Scndi3J2EtSxpW+E+Y4OgPV3VHQznxSTCj9itkyo/sTDdRYcmHxF8noHM0gdaOohwdID2pwH5d8ws5niWpLKiaSEq76vbAE6ik8lYWyFi9QHKDEpSU75W7PM2VxQaHOH5/w3bDJUR+h6XCUNcIPVBMnc2NJodIC/Updz06j068Taxy5sDQvlPbmC+rfMMq1BdHouGRQ49mBZRo6deFyVERijqMWkOaW8vbeIE1MwCw+u6imSy+qPUvYbzRk6sRltKCMztEMRcdCgRt4hCZl5/qzQNVFr5TFJ4EKG0sF1vldsQRSCkDlaBuK3HlFT5CDq09ejO6LtFDXE6MvHiI1YWWqgbEJ6l8CzvysR2ojxe69Qn0xXjj35MDOZZUKjyI2eFAso0rUicYaR258VP4zwi/kGFowOx9Vyt2WH5Q9umOLiEa9qMb3xhxH7ai4+YZORuU+PipUWnFi+UGliogIVEVVqIRndI6eg6J4hwqic+lBNDqvUEelB4WqTFSqgZpGv3gsgXQdEgv8ow5C5MKDi2q6dqfCm9Pol4lEzYjpwjIgm6CejohDtbTBGGPnKRO0Ye1BoMaqTNmbA4tMZOzCFLCOyBpHbhwPDVSTWp5WWX0QBqZkZsPovkqxrKqJamJiYnWXlrYugmSOo/t4uJnoz+nsIGVC4qaZTWyuG1RS1UCdVGjbSmmPns0eUKNzlI8GV8xkNvI7pw9A5pqZNcrd1l9UUFWjExdjs7ZHdbMXlCWQ5sGQYCizcWOUAcpVM+vULhApOzVimYtrsz72p2jzjMomqKdjodjKLGMqIWAalkRnAW3UoRcmLuJmyvsTtxMsaxzVcSS0sJY9FF2Anbssb9VUslK7ViqQoX2z/rY3SZs/wMxxFI+E2V7WKA1wcNncVkOkU+5WqIuNezPlvYnbvchG5+g8DjoYbHRIB5xcHNq6i7xSNo2+2Zjb9bEvRdsvZJZASE/misVsQlS204JpbjZF1FEVW2ys7XTui9uubNBsHi8JJrN3SAZUzm2lN9mdwovYMLed0p482v4CZ+1oaYrRTkgEdG7zXejwrPLxANyOrA6I6MwdLHcY7TtEgOldFlLPXj4WQHk/orYvgjf6oZJhNaOk7bR51lQ6+BX5sBugshdZwBefpUOlt1uFTMDwbIglr5oImYQ+9qGIuByweaB0sFuEZMDlWReLXp2MWAfIjT1InfDIA2uHSVMCQPbsVUybT4mSTFDbgeFEzD6YO0qeCADql7vJD58yJQuh5t1wIpbNidGPkQ6Wc/sRvNqB7pMosYZQ82w4IYcXlg6RpphO+5G8ysCrR4GUxVDzajghy+aGzSOkh+XSjhw+NSWLPxcp1hi6hz/JiTkcsXZ8JJjuJ8pFOH0ayO7PzcqCyC1fShezyBNzR0eG7RylENR51JHDn8WKNYj65UcWdfgy+rHhiu2WqAlRPZrI6U0RLesdIp2Dt6KoRb5YOjZ62K5hDNn9cTfW+VJ5sYxRLbSnC5u9sXlk3GG7ImplTH92KPkyiBkVI92LVJy4z+aOteOihe3eOiYytHuToexLJMa+g6S2KCsK3JZD5o6KBbYbTtgMuX1pSjc/mpixmyS1RShR6CSPVj8mYrFdquJekMeXgQ0/Hm5WR0lxjm3WU8UOm0tWDommwHIji7wgxZeOXX4kbmzCpH7P8V+tJ4reolP2HBCuh+FWfhe5GtWXiU0/Mjl20/7s2lP+xSj5rvLwlVfWDgfXw2zlcYKfmOhHUb54IXZG9eCvY4xnzi1GJ1+fza/hDoathzkyeOWco5OHFyb7sW+g+nDSY8kb/0t3zNb7oeB62AP4u2EvPy7A9OHiR69XUZ4pm0shyfXwqcYZfhhw+HATpOrTkG96rd0C0tbDqxLHnA83wZwHnSEFj+rmnaqxZzhqeniVe4GbDz8hTl4RRT3482z+9WALwSgW+NUkTR8WovAqR4ofb0I/AFrNVg5ES4FfVSMvD6oxeYMkxeZL6NsRULZ1C0MtNPZtoqzzTsiNiywpNk/Cb9sx0GuqD0J3+FY09s37DnloTTQpNj9C346CqiXE8ON6eFeCPTyDJtpDlOLHi9C349CDpVvwyQXelQ2ecDfFOiwxpdh8CH07EFrNUHGBJ0Ftx9wLj3swDZap0goePH07FMqG0Aad5gn/el+8SFuYCRNX+u3EV/Xdv336MjS7gNMWeFgyfoZVwy7WyZZU0Q0dD1U7SMGmOaC6W9M8LLCTYw6V+NL4ICtRiJq534Kd0gSarsDHpvk4YBfoREXCFAOup2+QTnP6vZnBEWTiE9o7Nc1Px3qBL1IRY+oXqi+Z3EKyp2wHbXhxN+jv0vs38/RE3aQ30uBMuhuiEDdUEYBeOyWGlq7Ay1x6+TpRD8kip4g19QtOS7K6gSKI1Qx6F1TaGSZ06Hwzb7+gFipzbt6kHLA8a8M1MPRgBn1AaWcY0Z1azOcKqoZOmEfMSe8HR8kyzBWBXM0M7qFkn2FGZ3p+M69v0MmyDimdPPXUMJQh01xGoWwHqwsgWzvDkL60ZZ4/oO+wm/GJYk/6LTV7Zcg4dgnnawe9Cx3NrcCUjry3Zd4nkMEnokX9AEg9NVtlyDx1Cmm1gzkGjeWANd1wc7z2kHPTFqFF/QxIGsHOkzeAUOhQerCD0gWLeCuwpw/lSraTEfPQrHJn18+BFK9moby/CyJTBXY1O8CzCRHxNsOkDjxfSzgzZuEa1br8PiaS7tq+V72iUBLtFtxsCUguMCy3GVZ9oYX6xg3rN0o1/MWUdOrPg6SYwne5n/UCKvdJXYBfUyjJBYOcnrDs+kA6zyvdUYh/YtTEsyRX6qHf9yMjqed0tn3q/RTbWakxujCnZgnAffG/ZklPmHd9JZwj/1PYUyYO8zEn0ZxP/e6PtH/27F9XTtcZ/1WPMT9l2A7PtP7KUb/h/U27ZwQo6+J8Lea0PvGLffn7ZIFxriktB5jblNJaK97wAQ==";class Watermarker extends webgpu.Scene{viewer;camera;mesh;overlayPass;#t=!1;#r=null;constructor(t){super(),this.viewer=t,this.camera=new webgpu.OrthographicCamera(-1,1,1,-1,0,1),this.camera.position.z=.5,this.mesh=new webgpu.Mesh(new webgpu.PlaneGeometry(1.8,1.8),new webgpu.MeshBasicNodeMaterial({color:16777215,opacity:.5,transparent:!0})),this.add(this.mesh),this.overlayPass=tsl.pass(this,this.camera)}enable(){this.#t=!0,this.#i().then(t=>{this.#t&&(this.mesh.material.map!==t&&(this.mesh.material.map=t,this.mesh.material.needsUpdate=!0),this.viewer.renderPipeline.addOverlayPass(this.overlayPass))}).catch(t=>{this.#r=null,console.warn("u-space Watermarker: failed to load watermark texture.",t)})}disable(){this.#t=!1,this.viewer.renderPipeline.removeOverlayPass(this.overlayPass)}dispose(){this.disable(),this.overlayPass.dispose(),this.mesh.geometry.dispose(),this.mesh.material.dispose(),this.mesh.material.map?.dispose()}#i(){return this.mesh.material.map?Promise.resolve(this.mesh.material.map):(this.#r??=uSpace.TextureLoaderManager.loadAsyncTexture(logo).then(t=>(t.colorSpace=webgpu.SRGBColorSpace,t)),this.#r)}}const _m4=new webgpu.Matrix4;class SceneParser{viewer;path;manager;constructor(t,u,o){this.viewer=t,this.path=u,this.manager=o}async parseAsync(t,u,o){const d=new webgpu.Group,r=async(h,f=null)=>{const a=await this.parseTreeNode(h);if(a){const{id:n,sid:e}=h;this.viewer.objectManager.add(n,a),this.viewer.objectManager.add(e,a),u.add(n),u.add(e),f?f.add(a):d.add(a)}await Promise.all(h.children.map(n=>r(n,a)))};return await Promise.all(t.map(h=>r(h,d))),d}async parseTreeNode(t){const{name:u,renderType:o,path:d,visible:r,matrix:h,shape:f,extra:a}=t;let n=null;if(o==="3D"&&d){const e=this.path+d,s=new uSpace.Model;this.manager.itemStart(e),await s.loadAsync({url:e}),this.manager.itemEnd(e),n=s}else if(o==="GROUP"||o==="STUB")n=new webgpu.Group;else if(o==="POLYGON"&&f?.points){const e=uSpace.ShapeMesh.createFromPoints(f.points);e.material.color.set("blue"),e.material.transparent=!0,e.material.opacity=.5,n=e}else if(o==="CIRCLE"&&f?.radius){const e=new uSpace.CircleMesh({geometryParameters:{radius:f.radius}});e.material.color.set("blue"),e.material.transparent=!0,e.material.opacity=.5,n=e}else if(o==="AREA"||o==="FLOOR"||o==="ROOM"){const e=uSpace.ExtrudeMesh.createFromPoints(f?.points,{geometryParameters:{options:{depth:f?.depth,bevelEnabled:!1}}});e.material.color.set(a?.color??"blue"),e.material.transparent=!0,e.material.opacity=a?.opacity??.5,n=e}if(n){n.name=u,n.visible=r,_m4.fromArray(h).decompose(n.position,n.quaternion,n.scale);const s={...t};Reflect.deleteProperty(s,"children"),Object.assign(n.userData,s)}return n}}class SceneLoader extends webgpu.Loader{viewer;key="";cachedIds=new Set;_resourceData=null;_treeData=[];#t;constructor(t){super(),this.viewer=t,this.#t=new Watermarker(t),this.manager=new webgpu.LoadingManager}setKey(t){return this.key=t,this}async _preareTreeData(){if(!this.path)throw new Error("u-space SceneLoader: path is not set");const t=new BaseFileLoader(this),u=await t.loadAsync(META_DATA_FILE_PATH);if(u.version<1.5)throw new Error("u-space SceneLoader: Only support version 1.5 and above");if(!this.key&&u.authority==="OFFICIAL")throw new Error("u-space SceneLoader: options.key is required when authority is OFFICIAL");this.key&&u.authority==="TRIAL"&&console.warn("u-space SceneLoader: options.key is not used when authority is TRIAL");const o=await t.loadAsync(u.resource),d=this._resourceData!==o;if(this._resourceData=o,d)if(u.encryptWith==="DEBUG")try{this._treeData=decryptWithDebugKey(o),this.#t.enable()}catch{throw new Error("u-space SceneLoader: decrypt with debug key failed")}else if(u.encryptWith==="SCENE"||u.encryptWith==="COMPANY")try{this._treeData=decryptWithKey(o,this.key)}catch{throw new Error("u-space SceneLoader: decrypt with authorized key failed")}else u.encryptWith||(this._treeData=o)}async loadAsync(t={}){if(!this.path)throw new Error("u-space SceneLoader: path is not set");this.manager.itemStart(this.path);try{return await this._preareTreeData(),await new SceneParser(this.viewer,this.path,this.manager).parseAsync(this._treeData,this.cachedIds,t)}catch(u){throw this.manager.itemError(this.path),u}finally{this.manager.itemEnd(this.path)}}clearCache(){this.cachedIds.forEach(t=>{this.viewer.objectManager.removeById(t)}),this.cachedIds.clear()}dispose(){this.clearCache(),this.#t.dispose()}}class AnimationsLoader extends webgpu.Loader{constructor(){super(),this.manager=new webgpu.LoadingManager}async loadAsync(){return await new BaseFileLoader(this).loadAsync(ANIMATIONS_DATA_FILE_PATH)}}class AnimationsParser extends webgpu.EventDispatcher{viewer;target;tweenSet;_initialTransformSymbol=Symbol("initialTransform");constructor(t,u){super(),this.viewer=t,this.target=u,this.tweenSet=new Set}initTransform(t){const{position:u,rotation:o,scale:d}=this.target,r=t??{x:u.x,y:u.y,z:u.z,rotationX:o.x,rotationY:o.y,rotationZ:o.z,scaleX:d.x,scaleY:d.y,scaleZ:d.z};return Reflect.set(this.target,this._initialTransformSymbol,r),r}getInitialTransform(){return Reflect.get(this.target,this._initialTransformSymbol)}async play(t){let u=this.getInitialTransform();u||(u=this.initTransform());for(let o=0;o<t.length;o++){let d=t[o-1];d||(d=u);const r=t[o],h=r.delay??0,f=r.duration??1e3,a=r.easing,n=r.repeat===-1?1/0:r.repeat??0,e=r.yoyo??!1;await uSpace.tweenAnimation(this.viewer,{...d},{...r},{delay:h,duration:f,mode:a,repeat:n,yoyo:e},(s,l)=>{const{x:v,y:b,z:m,rotationX:q,rotationY:E,rotationZ:S,scaleX:O,scaleY:D,scaleZ:j}=s;this.target.position.set(v,b,m),this.target.rotation.set(q,E,S),this.target.scale.set(O,D,j),this.dispatchEvent({type:"update",source:s,tween:l})},s=>{this.tweenSet.add(s),this.dispatchEvent({type:"start",tween:s})})}}stop(){this.tweenSet.forEach(t=>t.stop()),this.tweenSet.clear()}reset(){const t=this.getInitialTransform();if(t){const{x:u,y:o,z:d,rotationX:r,rotationY:h,rotationZ:f,scaleX:a,scaleY:n,scaleZ:e}=t;this.target.position.set(u,o,d),this.target.rotation.set(r,h,f),this.target.scale.set(a,n,e),this.viewer.render()}}dispose(){this.stop(),this.reset(),Reflect.deleteProperty(this.target,this._initialTransformSymbol)}}class TopologyParser{parse(t){const{name:u,position:o,rotation:d,scale:r,nodes:h,nodeRadius:f=.2,nodeColor:a="#0000ff",linkWidth:n=.1,linkColor:e=["#00ff00"]}=t,s=new uSpace.Topology({nodeRadius:f,nodeColor:a,edgeRadius:n,edgeColor:e[0],pathRadius:n+.05});return s.name=u,s.position.set(o.x,o.y,o.z),s.rotation.set(d.x,d.y,d.z),s.scale.set(r.x,r.y,r.z),h.forEach(l=>{const v=new webgpu.Vector3().copy(l.position);s.addNode(l.id,v)}),h.forEach(l=>{l.graphs.forEach(v=>{s.addEdge(l.id,v.targetNodeId)})}),s.renderGraph(),Object.assign(s.userData,t),s}}class TopologiesLoader extends webgpu.Loader{constructor(){super(),this.manager=new webgpu.LoadingManager}async loadAsync(){if(!this.path)throw new Error("u-manager TopologiesLoader: path is not set");const u=await new BaseFileLoader(this).loadAsync(TOPOLOGY_DATA_FILE_PATH),o=new TopologyParser,d=[];return u.forEach(r=>{const h=o.parse(r);d.push(h)}),d}}class PropertiesLoader extends webgpu.Loader{constructor(){super(),this.manager=new webgpu.LoadingManager}async loadAsync(){return await new BaseFileLoader(this).loadAsync(PROPERTIES_DATA_FILE_PATH)}}class VisionsLoader extends webgpu.Loader{constructor(){super(),this.manager=new webgpu.LoadingManager}async loadAsync(){return await new BaseFileLoader(this).loadAsync(VISIONS_DATA_FILE_PATH)}}class VisionsParser{viewer;constructor(t){this.viewer=t}async flyToPrimary(t,u=!0){const o=t.find(d=>d.primary);return o?(await this.flyTo(o,u),!0):!1}async flyTo(t,u=!0){const{camera:o,position:d,target:r,zoom:h=this.viewer.camera.zoom}=t;o==="P"?this.viewer.setCameraByType("perspective"):o==="O"&&this.viewer.setCameraByType("orthographic");const{x:f,y:a,z:n}=d,{x:e,y:s,z:l}=r;await Promise.all([this.viewer.controls.setLookAt(f,a,n,e,s,l,u),this.viewer.controls.zoomTo(h,u)])}}const PLANISH_SCALE_Y=.01,_box=new webgpu.Box3,_pivot=new webgpu.Vector3,_raycastHits=[],_dummyPosition=new webgpu.Vector3,_dummyQuaternion=new webgpu.Quaternion,_dummyScale=new webgpu.Vector3,_boundsMatrix=new webgpu.Matrix4,_boundsSphere=new webgpu.Sphere;function getStateTextureSize(c,t=1){return Math.max(1,Math.ceil(Math.sqrt(Math.max(1,c*t))))}function getMatrixTextureSize(c){const t=Math.sqrt(Math.max(1,c)*4);return Math.max(4,Math.ceil(t/4)*4)}function createStateTexture(c){const t=new webgpu.DataTexture(new Float32Array(c*c*4),c,c,webgpu.RGBAFormat,webgpu.FloatType);return t.magFilter=webgpu.NearestFilter,t.minFilter=webgpu.NearestFilter,t.generateMipmaps=!1,t.needsUpdate=!0,t}function copyAttributeComponents(c,t,u,o){for(let d=0;d<u;d++)o.push(c?.getComponent(t,d)??0)}function createSemanticMaterial(c,t,u){const o=tsl.attribute("semanticIndex","float").toInt(),d=e=>tsl.int(tsl.textureSize(tsl.textureLoad(e),tsl.int(0)).x).toConst(),r=e=>{const s=d(e),l=o.mod(s).toConst(),v=o.div(s).toConst();return tsl.textureLoad(e,tsl.ivec2(l,v))},h=()=>{const e=d(u),s=o.mul(4).toConst(),l=s.mod(e).toConst(),v=s.div(e).toConst();return tsl.mat4(tsl.textureLoad(u,tsl.ivec2(l,v)),tsl.textureLoad(u,tsl.ivec2(l.add(1),v)),tsl.textureLoad(u,tsl.ivec2(l.add(2),v)),tsl.textureLoad(u,tsl.ivec2(l.add(3),v)))},f=r(c),a=r(t).x,n=new webgpu.MeshStandardNodeMaterial({transparent:!0,depthWrite:!1});return n.colorNode=tsl.vec4(f.rgb,1),n.opacityNode=f.a.mul(a),n.maskNode=a.greaterThan(.5).and(f.a.greaterThan(.001)),n.positionNode=h().mul(tsl.vec4(tsl.positionLocal,1)).xyz,n}function copySemanticColor(c,t){if(c instanceof webgpu.Color){t.x=c.r,t.y=c.g,t.z=c.b;return}t.x=c.x,t.y=c.y,t.z=c.z,c instanceof webgpu.Vector4&&(t.w=c.w)}function buildMergedSemanticGeometry(c){const t=[],u=[],o=[],d=[],r=[],h=[];c.forEach((a,n)=>{const e=a.geometry,s=e.getAttribute("position"),l=e.getAttribute("normal"),v=e.getAttribute("uv"),b=e.getIndex();if(!s)return;e.computeBoundingBox(),_box.copy(e.boundingBox??_box.makeEmpty()),_box.getCenter(_pivot),_pivot.y=_box.min.y;const m=t.length/3,q=[],E=[],S=[],O=[];for(let $=0;$<s.count;$++){const J=s.getX($)-_pivot.x,ie=s.getY($)-_pivot.y,ne=s.getZ($)-_pivot.z;t.push(J,ie,ne),q.push(J,ie,ne),d.push(n),copyAttributeComponents(l,$,3,u),copyAttributeComponents(l,$,3,E),copyAttributeComponents(v,$,2,o),copyAttributeComponents(v,$,2,S)}if(b)for(let $=0;$<b.count;$++){const J=b.getX($);r.push(m+J),O.push(J)}else for(let $=0;$<s.count;$++)r.push(m+$),O.push($);const D=new webgpu.BufferGeometry;D.setAttribute("position",new webgpu.Float32BufferAttribute(q,3)),l&&D.setAttribute("normal",new webgpu.Float32BufferAttribute(E,3)),v&&D.setAttribute("uv",new webgpu.Float32BufferAttribute(S,2)),D.setIndex(O),D.computeBoundingBox(),D.computeBoundingSphere();const j=new webgpu.Matrix4().makeTranslation(_pivot.x,_pivot.y,_pivot.z);h.push({id:a.id,kind:a.kind,name:a.name,index:n,baseMatrix:j,matrix:new webgpu.Matrix4,finalMatrix:j.clone(),geometry:D,color:a.color.clone(),visible:!0})});const f=new webgpu.BufferGeometry;return f.setAttribute("position",new webgpu.Float32BufferAttribute(t,3)),u.length>0&&f.setAttribute("normal",new webgpu.Float32BufferAttribute(u,3)),o.length>0&&f.setAttribute("uv",new webgpu.Float32BufferAttribute(o,2)),f.setAttribute("semanticIndex",new webgpu.Float32BufferAttribute(d,1)),f.setIndex(r),f.computeBoundingBox(),f.computeBoundingSphere(),{geometry:f,states:h}}class FloorMesh extends uSpace.BaseMesh{isFloorMergedSemanticMesh=!0;type="FloorMesh";boundingBox=null;boundingSphere=null;wallsInstances=new Map;columnsInstances=new Map;spacesInstances=new Map;doorsInstances=new Map;windowsInstances=new Map;semanticInstances=new Map;#t;#r;#i;#a;#o;#n;constructor(t){const{geometry:u,states:o}=buildMergedSemanticGeometry(t),d=getStateTextureSize(o.length),r=getMatrixTextureSize(o.length),h=createStateTexture(d),f=createStateTexture(d),a=createStateTexture(r),n=createSemanticMaterial(h,f,a);super(u,n),this.#r=o,this.#t={Walls:this.wallsInstances,Columns:this.columnsInstances,Spaces:this.spacesInstances,Doors:this.doorsInstances,Windows:this.windowsInstances},this.#i=h,this.#a=f,this.#o=a,this.#n=new webgpu.Mesh,this.#n.matrixAutoUpdate=!1,this.frustumCulled=!1,this.#r.forEach(e=>{this.semanticInstances.set(e.id,e.index),this.#t[e.kind].set(e.id,e.index),this.#s(e.index),this.#l(e.index),this.#f(e.index)}),this.userData.semanticEntries=this.#r.map(({id:e,kind:s,name:l,index:v})=>({id:e,kind:s,name:l,index:v}))}planish(t){return this.#c(t,u=>this.setScaleYAt(u,PLANISH_SCALE_Y)),this}unplanish(t){return this.#c(t,u=>this.setScaleYAt(u,1)),this}get semanticCount(){return this.#r.length}get instanceCount(){return this.semanticCount}getSemanticIndexById(t){return this.semanticInstances.get(t)}getSemanticIdAt(t){return this.#e(t).id}getSemanticKindAt(t){return this.#e(t).kind}getSemanticNameAt(t){return this.#e(t).name}setColorAt(t,u){const o=this.#e(t);return copySemanticColor(u,o.color),this.#s(t),this}getColorAt(t,u=new webgpu.Vector4){const o=this.#e(t).color;return u.copy(o),u}setOpacityAt(t,u){const o=this.#e(t);return o.color.w=Math.max(0,Math.min(1,u)),this.#s(t),this}getOpacityAt(t){return this.#e(t).color.w}setVisibleAt(t,u){const o=this.#e(t);return o.visible=u,this.#l(t),this}getVisibleAt(t){return this.#e(t).visible}setMatrixAt(t,u){const o=this.#e(t);return o.matrix.copy(u),o.finalMatrix.multiplyMatrices(o.baseMatrix,o.matrix),this.#u(),this.#f(t),this}setScaleAt(t,u,o,d){return this.#h(t,r=>{u instanceof webgpu.Vector3?r.copy(u):r.set(u,o??u,d??u)})}setScaleYAt(t,u){return this.#h(t,o=>{o.y=u})}getMatrixAt(t,u=new webgpu.Matrix4){return u.copy(this.#e(t).matrix),u}getFinalMatrixAt(t,u=new webgpu.Matrix4){return u.copy(this.#e(t).finalMatrix),u}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new webgpu.Box3),this.boundingBox.makeEmpty();for(const t of this.#r)this.getBoundingBoxAt(t.index,_box,!1)&&this.boundingBox.union(_box)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new webgpu.Sphere),this.boundingSphere.makeEmpty();for(const t of this.#r)this.getBoundingSphereAt(t.index,_boundsSphere,!1)&&this.boundingSphere.union(_boundsSphere)}getBoundingBoxAt(t,u=new webgpu.Box3,o=!0){const d=this.#e(t);return d.geometry.boundingBox||d.geometry.computeBoundingBox(),d.geometry.boundingBox?(u.copy(d.geometry.boundingBox).applyMatrix4(d.finalMatrix),o&&(this.updateWorldMatrix(!0,!1),u.applyMatrix4(this.matrixWorld)),u):null}getBoundingSphereAt(t,u=new webgpu.Sphere,o=!0){const d=this.#e(t);return d.geometry.boundingSphere||d.geometry.computeBoundingSphere(),d.geometry.boundingSphere?(u.copy(d.geometry.boundingSphere),o?(this.updateWorldMatrix(!0,!1),_boundsMatrix.multiplyMatrices(this.matrixWorld,d.finalMatrix),u.applyMatrix4(_boundsMatrix)):u.applyMatrix4(d.finalMatrix),u):null}raycast(t,u){if(this.visible===!1&&this.ignoreInvisibleWhenRaycast===!0)return!1;this.updateWorldMatrix(!0,!1),this.#n.material=this.material;for(const o of this.#r)if(!(!o.visible||o.color.w<=.001)){this.#n.geometry=o.geometry,this.#n.matrixWorld.multiplyMatrices(this.matrixWorld,o.finalMatrix),_raycastHits.length=0,this.#n.raycast(t,_raycastHits);for(const d of _raycastHits){const r=d;r.object=this,r.instanceId=o.index,r.semanticId=o.id,r.semanticKind=o.kind,r.semanticName=o.name,r.semanticIndex=o.index,u.push(r)}}}dispose(){this.geometry.dispose(),Array.isArray(this.material)?this.material.forEach(t=>t.dispose()):this.material.dispose(),this.#i.dispose(),this.#a.dispose(),this.#o.dispose(),this.#r.forEach(t=>t.geometry.dispose())}#e(t){const u=this.#r[t];if(!u)throw new Error(`u-space FloorMesh: invalid semantic index ${t}.`);return u}#u(){this.boundingBox=null,this.boundingSphere=null}#c(t,u){if(t===void 0){this.#r.forEach(o=>u(o.index));return}for(const o of this.#t[t].values())u(o)}#h(t,u){const o=this.#e(t);return o.matrix.decompose(_dummyPosition,_dummyQuaternion,_dummyScale),u(_dummyScale),o.matrix.compose(_dummyPosition,_dummyQuaternion,_dummyScale),o.finalMatrix.multiplyMatrices(o.baseMatrix,o.matrix),this.#u(),this.#f(t),this}#s(t){this.#e(t).color.toArray(this.#i.image.data,t*4),this.#i.needsUpdate=!0}#l(t){const u=this.#e(t),o=this.#a.image.data;o[t*4]=u.visible?1:0,o[t*4+1]=0,o[t*4+2]=0,o[t*4+3]=1,this.#a.needsUpdate=!0}#f(t){this.#e(t).finalMatrix.toArray(this.#o.image.data,t*16),this.#o.needsUpdate=!0}}class BuildingGroup extends uSpace.BaseGroup{isBuildingGroup=!0;type="BuildingGroup";floorMeshes=[];constructor(){super()}addFloor(t){return this.floorMeshes.includes(t)||(this.add(t),this.floorMeshes.push(t)),this}getFloorAt(t){return this.floorMeshes[t]}removeFloor(t){const u=this.floorMeshes.indexOf(t);return u!==-1&&this.floorMeshes.splice(u,1),this.remove(t),this}isolateFloor(t){const u=typeof t=="number"?this.getFloorAt(t):t;if(!u||!this.floorMeshes.includes(u))throw new Error("u-space BuildingGroup: the floor is not in this building group.");return this.floorMeshes.forEach(o=>{o.visible=o===u}),this}showAllFloors(){return this.floorMeshes.forEach(t=>{t.visible=!0}),this}planishFloors(t){return this.floorMeshes.forEach(u=>u.planish(t)),this}unplanishFloors(t){return this.floorMeshes.forEach(u=>u.unplanish(t)),this}}const SEMANTIC_INITIAL_COLORS={Walls:new webgpu.Vector4(.86,.86,.82,1),Columns:new webgpu.Vector4(.62,.65,.68,1),Spaces:new webgpu.Vector4(.36,.7,.5,.45),Doors:new webgpu.Vector4(.9,.52,.2,1),Windows:new webgpu.Vector4(.28,.62,.95,.65)};function getInitialColor(c){return SEMANTIC_INITIAL_COLORS[c].clone()}function getValidPolygonShape(c,t,u){return!Array.isArray(c)||c.length<4||c.length%2!==0?(console.warn(`u-space SemanticLoader: invalid ${t} polygon shape for id ${u}.`),null):c}function convertToPlaneIVector2(c){const t=[];for(let u=0;u<c.length;u+=2)t.push({x:c[u],z:c[u+1]});return t}class SemanticParser{parse(t){const u=[];return t.Buildings?.forEach(o=>{const d=new BuildingGroup;d.name=o.Name||"",d.userData.id=o.ID,o.Stories.forEach(r=>{const h=t.Stories?.[r];if(h&&h.ID){const f=[];if(h.Walls?.forEach(n=>{const e=t.Walls?.[n];if(!e||!e.Polygon)return;const s=getValidPolygonShape(e.Polygon.shape,"Walls",e.ID);if(!s)return;const l=uSpace.ExtrudeMesh.createFromPoints(convertToPlaneIVector2(s),{geometryParameters:{options:{depth:e.Height,bevelEnabled:!1}}}).geometry;l.translate(0,e.Elevation,0),l.userData.id=e.ID,f.push({id:e.ID,kind:"Walls",geometry:l,color:getInitialColor("Walls")})}),h.Columns?.forEach(n=>{const e=t.Columns?.[n];if(!e||!e.Polygon)return;const s=getValidPolygonShape(e.Polygon.shape,"Columns",e.ID);if(!s)return;const l=uSpace.ExtrudeMesh.createFromPoints(convertToPlaneIVector2(s),{geometryParameters:{options:{depth:e.Height,bevelEnabled:!1}}}).geometry;l.translate(0,e.Elevation,0),l.userData.id=e.ID,f.push({id:e.ID,kind:"Columns",geometry:l,color:getInitialColor("Columns")})}),h.Doors?.forEach(n=>{const e=t.Doors?.[n];if(!e||!e.Polygon)return;const s=getValidPolygonShape(e.Polygon.shape,"Doors",e.ID);if(!s)return;const l=uSpace.ExtrudeMesh.createFromPoints(convertToPlaneIVector2(s),{geometryParameters:{options:{depth:e.Height,bevelEnabled:!1}}}).geometry;l.translate(0,e.Elevation,0),l.userData.id=e.ID,f.push({id:e.ID,kind:"Doors",geometry:l,color:getInitialColor("Doors")})}),h.Windows?.forEach(n=>{const e=t.Windows?.[n];if(!e||!e.Polygon)return;const s=getValidPolygonShape(e.Polygon.shape,"Windows",e.ID);if(!s)return;const l=uSpace.ExtrudeMesh.createFromPoints(convertToPlaneIVector2(s),{geometryParameters:{options:{depth:e.Height,bevelEnabled:!1}}}).geometry;l.translate(0,e.Elevation,0),l.userData.id=e.ID,f.push({id:e.ID,kind:"Windows",geometry:l,color:getInitialColor("Windows")})}),h.Spaces?.forEach(n=>{const e=t.Spaces?.[n];if(!e||!e.Polygon)return;const s=getValidPolygonShape(e.Polygon.shape,"Spaces",e.ID);if(!s)return;const l=e.CeilingHeight-e.GroundHeight,v=uSpace.ExtrudeMesh.createFromPoints(convertToPlaneIVector2(s),{geometryParameters:{options:{depth:l,bevelEnabled:!1}}}).geometry;v.translate(0,e.GroundHeight,0),v.userData.id=e.ID,f.push({id:e.ID,kind:"Spaces",name:e.Name,geometry:v,color:getInitialColor("Spaces")})}),f.length===0)return;const a=new FloorMesh(f);a.name=h.Name||"",a.userData.id=h.ID,a.pivot=new webgpu.Vector3(0,h.Elevation||0,0),d.addFloor(a)}}),u.push(d)}),u}}class SemanticLoader extends webgpu.Loader{viewer;constructor(t){super(),this.viewer=t,this.manager=new webgpu.LoadingManager}async loadAsync(){if(!this.path)throw new Error("u-space SemanticLoader: path is not set");this.manager.itemStart(this.path);try{const u=await new BaseFileLoader(this).loadAsync(SEMANTIC_DATA_FILE_PATH);return new SemanticParser().parse(u)}catch(t){throw this.manager.itemError(this.path),t}finally{this.manager.itemEnd(this.path)}}}class Edge{id;source;target;sourceHandle;constructor(t){this.id=t.id,this.source=t.source,this.target=t.target,this.sourceHandle=t.sourceHandle}}function objectHandle(c,t){return Array.isArray(c)?c.map(t):t(c)}function sleep(c){return new Promise(t=>setTimeout(t,c))}function parseNodeByType(c,t){switch(t.type){case"START":return new StartNode(c,t);case"COLOR":return new ColorNode(c,t);case"NUMBER":return new NumberNode(c,t);case"HIGHLIGHT":return new HighlightNode(c,t);case"UN_HIGHLIGHT":return new UnHighlightNode(c,t);case"OPACITY":return new OpacityNode(c,t);case"UN_OPACITY":return new UnOpacityNode(c,t);case"EMISSIVE":return new EmissiveNode(c,t);case"UN_EMISSIVE":return new UnEmissiveNode(c,t);case"MESH":return new MeshNode(c,t);case"MESHES":return new MeshesNode(c,t);case"MODEL":return new ModelNode(c,t);case"MODELS":return new ModelsNode(c,t);case"SPACE":return new SpaceNode(c,t);case"SPACES":return new SpacesNode(c,t);case"POIS":return new POIsNode(c,t);case"POI":return new POINode(c,t);case"PATH":return new PathNode(c,t);case"PATHS":return new PathsNode(c,t);case"DELAY":return new DelayNode(c,t);case"CONDITION_NODE":return new ConditionNode(c,t);case"SHOW":return new ShowNode(c,t);case"HIDE":return new HideNode(c,t);case"CLIP_ANIMATION":return new ClipAnimationNode(c,t);case"UN_CLIP_ANIMATION":return new UnClipAnimationNode(c,t);case"TWEEN_ANIMATION":return new TweenAnimationNode(c,t);case"UN_TWEEN_ANIMATION":return new UnTweenAnimationNode(c,t);case"COMPONENT_TWEEN_ANIMATION":return new ComponentTweenAnimationNode(c,t);case"UN_COMPONENT_TWEEN_ANIMATION":return new UnComponentTweenAnimationNode(c,t);case"TRANSLATE":return new TranslateNode(c,t);case"ROTATE":return new RotateNode(c,t);case"SCALE":return new ScaleNode(c,t);case"FLY_TO":return new FlyToNode(c,t);case"DATA_EXTRACTION":return new DataExtractionNode(c,t);case"DATA_FILTER":return new DataFilterNode(c,t);case"USER_DATA_NODE":return new UserDataNode(c,t);default:return new Node(c,t)}}function parseValue(c){return JSON.parse(c)}async function waitFor(c,t){t?await c():c()}function getObjectByIds(c,t){return t.map(u=>c.objectManager.getById(u)).filter(Boolean)}function getObjectById(c,t,u){const o=c.objectManager.getById(t);if(o)return o;{const d=c.scene;return getMeshByUserDataUuid(u??d,t)}}function getMeshByUserDataUuid(c,t){if(c.userData.key===t||c.uuid===t)return c;for(let u=0,o=c.children.length;u<o;u++){const d=c.children[u],r=getMeshByUserDataUuid(d,t);if(r!==null)return r}return null}let count=0;const preloadNodes=["MESH","MESHES","MODEL","MODELS","POI","POIS","SPACE","SPACES","PATH","PATHS","COLOR","NUMBER","DATA_EXTRACTION","DATA_FILTER","USER_DATA_NODE","CONDITION_NODE","START"];class Node{parser;viewer;id;type;props;prevNodes=[];postNodes=[];execOrder=0;ctx;promise;resolve;reject;cleanSets=new Set;onBefore=null;onAfter=null;rejected;constructor(t,u){this.parser=t,this.viewer=t.viewer,this.id=u.id,this.type=u.type,this.props=u.props,this.rejected=!1,this.init()}init(){this.ctx={},this.promise=new Promise((t,u)=>{this.resolve=t,this.reject=o=>{this.rejected=!0,u(o)}})}readContext(t){return this.ctx[t]}writeContext(t,u){this.ctx[t]=u}findProp(t,u){if(u instanceof Array)for(const o of u){const d=this.findProp(t,o);if(d)return d}else return this.props.find(o=>o.name===t&&o.type===u)}async waitForPrevNodes(){return await Promise.all(this.prevNodes.map(t=>t.promise))}mergeContext(){this.prevNodes.forEach(t=>{Object.assign(this.ctx,t.ctx)}),this._mergeUserDataMap()}async exec(t){}async run(t,u={preload:!1}){const{preload:o}=u;try{if(await this.waitForPrevNodes(),this.rejected)throw new Error;this.mergeContext(),await(this.onBefore??this.parser.onNodeBefore)?.(this);try{(!o||preloadNodes.includes(this.type))&&(this.execOrder=++count,await this.exec(t))}catch(d){throw this.reject(d),d}await(this.onAfter??this.parser.onNodeAfter)?.(this),this.resolve()}catch(d){this.reject(d)}}cleanup(){this.cleanSets.forEach(t=>t()),this.cleanSets.clear()}getValue(t,u){if(t.type==="READ_CTX")return this.readContext(parseValue(t.value));if(t.type==="LOCAL"){const{scene:o}=this.viewer;return t.name==="objects"||t.name==="models"||t.name==="meshs"?parseValue(t.value).map(d=>getObjectById(this.viewer,d,u??o)):t.name==="object"||t.name==="model"||t.name==="mesh"?getObjectById(this.viewer,parseValue(t.value),u??o):parseValue(t.value)}}_mergeUserDataMap(){if(this.prevNodes.some(t=>t.ctx._userDataMap))this.ctx._userDataMap=new Map;else return;this.prevNodes.forEach(t=>{t.ctx._userDataMap&&t.ctx._userDataMap.forEach((u,o)=>{this.ctx._userDataMap.set(o,Object.assign({},u))})})}}class StartNode extends Node{constructor(t,u){super(t,u)}}class ColorNode extends Node{constructor(t,u){super(t,u)}async exec(){const t=this.findProp("color","LOCAL"),u=this.findProp("out","WRITE_CTX");t&&u&&this.writeContext(parseValue(u.value),parseValue(t.value))}}class NumberNode extends Node{constructor(t,u){super(t,u)}async exec(){const t=this.findProp("number","LOCAL"),u=this.findProp("out","WRITE_CTX");t&&u&&this.writeContext(parseValue(u.value),parseValue(t.value))}}class HighlightNode extends Node{constructor(t,u){super(t,u)}async exec(t){const u=this.findProp("objects",["READ_CTX","LOCAL"]),o=this.findProp("color",["READ_CTX","LOCAL"]),d=this.findProp("opacity",["READ_CTX","LOCAL"]),r=await t.getTarget?.(this);if(u&&o&&d){const h=this.getValue(u,r),f=this.getValue(o),a=this.getValue(d);h&&(index.MaterialEffects.highlightColor(h,{color:f,opacity:a}),this.cleanSets.add(()=>{index.MaterialEffects.removeHighlightColor(h)}))}}}class UnHighlightNode extends Node{constructor(t,u){super(t,u)}filterUnHighlightObject(t){const u=[];return objectHandle(t,o=>{u.push(o)}),u}async exec(t){const u=this.findProp("objects",["READ_CTX","LOCAL"]),o=await t.getTarget?.(this);if(u){const d=this.getValue(u,o);d&&uSpace.MaterialEffects.removeHighlightColor(d)}}}class OpacityNode extends Node{constructor(t,u){super(t,u)}async exec(t){const u=this.findProp("objects",["READ_CTX","LOCAL"]),o=this.findProp("color",["READ_CTX","LOCAL"]),d=this.findProp("opacity",["READ_CTX","LOCAL"]),r=await t.getTarget?.(this);if(u&&o&&d){const h=this.getValue(u,r),f=this.getValue(o),a=this.getValue(d);if(h){const n=objectHandle(h,e=>e);index.MaterialEffects.highlightColor(n,{color:f,opacity:a,overwrite:!0}),this.cleanSets.add(()=>{index.MaterialEffects.removeHighlightColor(n)})}}}}class UnOpacityNode extends Node{constructor(t,u){super(t,u)}async exec(t){const u=this.findProp("objects",["READ_CTX","LOCAL"]),o=await t.getTarget?.(this);if(u){const d=this.getValue(u,o);d&&uSpace.MaterialEffects.removeHighlightColor(d)}}}class EmissiveNode extends Node{constructor(t,u){super(t,u)}async exec(t){const u=this.findProp("objects",["READ_CTX","LOCAL"]),o=this.findProp("color",["READ_CTX","LOCAL"]),d=this.findProp("baseColor",["READ_CTX","LOCAL"]),r=this.findProp("minOpacity",["READ_CTX","LOCAL"]),h=this.findProp("maxOpacity",["READ_CTX","LOCAL"]),f=this.findProp("duration",["READ_CTX","LOCAL"]),a=await t.getTarget?.(this);if(u&&o&&d&&r&&h&&f){const n=this.getValue(u,a),e=this.getValue(o),s=this.getValue(h);n&&(uSpace.MaterialEffects.breatheColor(n,{color:e,intensity:s}),this.cleanSets.add(()=>{uSpace.MaterialEffects.removeBreatheColor(n)}))}}}class UnEmissiveNode extends Node{constructor(t,u){super(t,u)}filterUnEmissiveObject(t){const u=[];return objectHandle(t,o=>{u.push(o)}),u}async exec(t){const u=this.findProp("objects",["READ_CTX","LOCAL"]),o=await t.getTarget?.(this);u&&this.getValue(u,o)}}const meshCacheSymbol=Symbol("meshCache");class MeshNode extends Node{constructor(t,u){super(t,u)}async exec(t){const{scene:u}=this.viewer,o=await t.getTarget?.(this)||u;t[meshCacheSymbol]||(t[meshCacheSymbol]={});const d=this.findProp("mesh","LOCAL"),r=this.findProp("out","WRITE_CTX");if(d&&r){let h=null;const f=parseValue(d.value),a=parseValue(r.value),n=t[meshCacheSymbol][f];if(n){h=n;return}const e=getMeshByUserDataUuid(o,f);e&&(h=e,t[meshCacheSymbol][f]=e),this.writeContext(a,h)}}}const meshesCacheSymbol=Symbol("meshesCache");class MeshesNode extends Node{constructor(t,u){super(t,u)}async exec(t){const{scene:u}=this.viewer,o=await t.getTarget?.(this)||u;t[meshesCacheSymbol]||(t[meshesCacheSymbol]={});const d=this.findProp("meshes","LOCAL"),r=this.findProp("out","WRITE_CTX");if(d&&r){const h=[],f=parseValue(d.value),a=parseValue(r.value);f.forEach(n=>{const e=t[meshesCacheSymbol][n];if(e){h.push(e);return}const s=getMeshByUserDataUuid(o,n);s&&(h.push(s),t[meshesCacheSymbol][n]=s)}),this.writeContext(a,h)}}}class ModelNode extends Node{constructor(t,u){super(t,u)}async exec(){const t=this.findProp("model","LOCAL"),u=this.findProp("out","WRITE_CTX");if(t&&u){const o=parseValue(t.value),d=parseValue(u.value);this.writeContext(d,getObjectById(this.viewer,o))}}}class ModelsNode extends Node{constructor(t,u){super(t,u)}async exec(){const t=this.findProp("models","LOCAL"),u=this.findProp("out","WRITE_CTX");if(t&&u){const o=parseValue(t.value),d=parseValue(u.value);this.writeContext(d,getObjectByIds(this.viewer,o))}}}class DelayNode extends Node{constructor(t,u){super(t,u)}async exec(){const t=this.findProp("delay","LOCAL");if(t){const u=parseValue(t.value);await sleep(u)}}}class ConditionNode extends Node{constructor(t,u){super(t,u)}execFn(t){return new Function("sourceData",t)(this.ctx)}async exec(){const t=this.findProp("conditaion_node","LOCAL");if(t){const u=parseValue(t.value),o=this.parser.edges.filter(d=>d.source===this.id);u.forEach(d=>{try{if(this.execFn(d.value)!==!0)throw new Error}catch{const h=o.find(a=>a.sourceHandle==String(d.id));if(!h)return;this.postNodes.find(a=>a.id===h.target)?.reject()}})}}}class ShowNode extends Node{constructor(t,u){super(t,u)}filterShowObject(t){const u=[];return objectHandle(t,o=>{o.visible===!1&&u.push(o)}),u}async exec(t){const u=this.findProp("objects",["READ_CTX","LOCAL"]),o=await t.getTarget?.(this);if(u){const d=this.getValue(u,o);if(d){const r=this.filterShowObject(d),h=f=>{objectHandle(r,a=>{a.visible=f}),this.viewer.render()};h(!0),this.cleanSets.add(()=>h(!1))}}}}class HideNode extends Node{constructor(t,u){super(t,u)}filterHideObject(t){const u=[];return objectHandle(t,o=>{o.visible===!0&&u.push(o)}),u}async exec(t){const u=this.findProp("objects",["READ_CTX","LOCAL"]),o=await t.getTarget?.(this);if(u){const d=this.getValue(u,o);if(d){const r=this.filterHideObject(d),h=f=>{objectHandle(r,a=>{a.visible=f}),this.viewer.render()};h(!1),this.cleanSets.add(()=>h(!0))}}}}class TranslateNode extends Node{constructor(t,u){super(t,u)}async exec(t){const u=this.findProp("objects",["READ_CTX","LOCAL"]),o=this.findProp("axis",["READ_CTX","LOCAL"]),d=this.findProp("translate",["READ_CTX","LOCAL"]),r=await t.getTarget?.(this);if(u&&o&&d){const h=this.getValue(u,r),f=this.getValue(o),a=this.getValue(d);if(h){const n=[];objectHandle(h,v=>{n.push(v.position.clone())});const s=(v,b)=>{switch(f){case"x":v.setX(b.x);break;case"y":v.setY(b.y);break;case"z":v.setZ(b.z);break}};await(async()=>{const v=objectHandle(h,async b=>{const m=b.position.clone();switch(f){case"x":await uSpace.tweenAnimation(this.viewer,m,new webgpu.Vector3().set(m.x+a,m.y,m.z),{duration:800},q=>s(b.position,q));break;case"y":await uSpace.tweenAnimation(this.viewer,m,new webgpu.Vector3().set(m.x,m.y+a,m.z),{duration:800},q=>s(b.position,q));break;case"z":await uSpace.tweenAnimation(this.viewer,m,new webgpu.Vector3().set(m.x,m.y,m.z+a),{duration:800},q=>s(b.position,q));break}});v instanceof Array?await Promise.all(v):await v,this.viewer.render()})(),this.cleanSets.add(()=>{let v=0;objectHandle(h,b=>{b.position.copy(n[v++])})})}}}}class ScaleNode extends Node{constructor(t,u){super(t,u)}async exec(t){const u=this.findProp("objects",["READ_CTX","LOCAL"]),o=this.findProp("axis",["READ_CTX","LOCAL"]),d=this.findProp("scale",["READ_CTX","LOCAL"]),r=await t.getTarget?.(this);if(u&&o&&d){const h=this.getValue(u,r),f=this.getValue(o),a=this.getValue(d);if(h){const n=[];objectHandle(h,v=>{n.push(v.scale.clone())});const s=(v,b)=>{switch(f){case"x":v.setX(b.x);break;case"y":v.setY(b.y);break;case"z":v.setZ(b.z);break}};await(async()=>{const v=objectHandle(h,async b=>{const m=b.scale.clone();switch(f){case"x":await uSpace.tweenAnimation(this.viewer,m,new webgpu.Vector3().set(m.x*a,m.y,m.z),{duration:800},q=>s(b.scale,q));break;case"y":await uSpace.tweenAnimation(this.viewer,m,new webgpu.Vector3().set(m.x,m.y*a,m.z),{duration:800},q=>s(b.scale,q));break;case"z":await uSpace.tweenAnimation(this.viewer,m,new webgpu.Vector3().set(m.x,m.y,m.z*a),{duration:800},q=>s(b.scale,q));break}});v instanceof Array?await Promise.all(v):await v,this.viewer.render()})(),this.cleanSets.add(()=>{let v=0;objectHandle(h,b=>{b.scale.copy(n[v++])})})}}}}class RotateNode extends Node{constructor(t,u){super(t,u)}async exec(t){const u=this.findProp("objects",["READ_CTX","LOCAL"]),o=this.findProp("axis",["READ_CTX","LOCAL"]),d=this.findProp("rotation",["READ_CTX","LOCAL"]),r=await t.getTarget?.(this);if(u&&o&&d){const h=this.getValue(u,r),f=this.getValue(o),a=this.getValue(d);if(h){const n=[];objectHandle(h,v=>{n.push(v.rotation.clone())});const s=(v,b)=>{switch(f){case"x":v.x=b.x;break;case"y":v.y=b.y;break;case"z":v.z=b.z;break}};await(async()=>{const v=a/180*Math.PI,b=objectHandle(h,async m=>{const q=m.rotation.clone();switch(f){case"x":await uSpace.tweenAnimation(this.viewer,q,new webgpu.Euler().set(q.x+v,q.y,q.z),{duration:800},E=>s(m.rotation,E));break;case"y":await uSpace.tweenAnimation(this.viewer,q,new webgpu.Euler().set(q.x,q.y+v,q.z),{duration:800},E=>s(m.rotation,E));break;case"z":await uSpace.tweenAnimation(this.viewer,q,new webgpu.Euler().set(q.x,q.y,q.z+v),{duration:800},E=>s(m.rotation,E));break}});b instanceof Array?await Promise.all(b):await b,this.viewer.render()})(),this.cleanSets.add(()=>{let v=0;objectHandle(h,b=>{b.rotation.copy(n[v++])})})}}}}class FlyToNode extends Node{constructor(t,u){super(t,u)}async exec(){const t=this.findProp("viewpoint",["READ_CTX","LOCAL"]);if(t){const u=parseValue(this.getValue(t));u&&this.viewer.controls.setCameraViewpoint(u,!0)}}}class SpaceNode extends Node{constructor(t,u){super(t,u)}async exec(){const t=this.findProp("space","LOCAL"),u=this.findProp("out","WRITE_CTX");if(t&&u){const o=parseValue(t.value),d=parseValue(u.value);this.writeContext(d,getObjectById(this.viewer,o))}}}class SpacesNode extends Node{constructor(t,u){super(t,u)}async exec(){const t=this.findProp("spaces","LOCAL"),u=this.findProp("out","WRITE_CTX");if(t&&u){const o=parseValue(t.value),d=parseValue(u.value),r=o.map(h=>getObjectById(this.viewer,h));this.writeContext(d,r)}}}class POINode extends Node{constructor(t,u){super(t,u)}async exec(t){const u=this.findProp("poi","LOCAL"),o=this.findProp("out","WRITE_CTX");if(u&&o){const d=parseValue(u.value),r=parseValue(o.value);this.writeContext(r,getObjectById(this.viewer,d))}}}class POIsNode extends Node{constructor(t,u){super(t,u)}async exec(t){const u=this.findProp("pois","LOCAL"),o=this.findProp("out","WRITE_CTX");if(u&&o){const d=parseValue(u.value),r=parseValue(o.value),h=d.map(f=>getObjectById(this.viewer,f));this.writeContext(r,h)}}}class DataExtractionNode extends Node{constructor(t,u){super(t,u)}async exec(){const t=this.findProp("value","LOCAL"),u=this.findProp("object","LOCAL"),o=this.findProp("out","WRITE_CTX"),d=this.findProp("extraction","LOCAL");if(t&&o&&d&&u){const r=parseValue(d.value),h=parseValue(o.value),f=parseValue(u.value),a=this.getValue(u);let n=parseValue(t.value);if(this.ctx._userDataMap){const e=this.ctx._userDataMap.get(f);e&&(n=e[r])}else if(a&&a.userData.properties){const e=a.userData.properties.find(s=>s.key===r);e&&e.value!==void 0&&(n=e.value)}this.writeContext(h,n)}}}class DataFilterNode extends Node{constructor(t,u){super(t,u)}async exec(){const t=this.findProp("model","LOCAL");if(t){const u=parseValue(t.value),o=new Function("sourceData",u);for(const d in this.ctx){const r=o(this.ctx[d]);(r==null||r===!1)&&delete this.ctx[d]}}}}class PathNode extends Node{constructor(t,u){super(t,u)}async exec(){const t=this.findProp("path","LOCAL"),u=this.findProp("out","WRITE_CTX");if(t&&u){const o=parseValue(t.value),d=parseValue(u.value);this.writeContext(d,getObjectById(this.viewer,o))}}}class PathsNode extends Node{constructor(t,u){super(t,u)}async exec(){const t=this.findProp("paths","LOCAL"),u=this.findProp("out","WRITE_CTX");if(t&&u){const o=parseValue(t.value),d=parseValue(u.value),r=o.map(h=>getObjectById(this.viewer,h));this.writeContext(d,r)}}}class UserDataNode extends Node{constructor(t,u){super(t,u)}async exec(){const t=this.findProp("object",["READ_CTX","LOCAL"]),u=this.findProp("data","LOCAL"),o=this.findProp("source","WRITE_CTX");if(t&&u&&o){let d=parseValue(t.value);const r=parseValue(u.value),h=parseValue(o.value);if(h&&(d=h),d&&r){this.ctx._userDataMap||(this.ctx._userDataMap=new Map);const f=this.ctx._userDataMap.get(d);f?Object.assign(f,r):this.ctx._userDataMap.set(d,r)}}}}class ClipAnimationNode extends Node{constructor(t,u){super(t,u)}async exec(t){let u=await t.getTarget?.(this);if(!u){const d=this.findProp("model",["READ_CTX","LOCAL"]);d&&(u=this.getValue(d))}const o=this.findProp("animation",["READ_CTX","LOCAL"]);if(u&&o){let d;if(o.type==="READ_CTX"){const h=this.parser.getVariableNameById(parseValue(o.value));d=this.readContext(h)}else d=parseValue(o.value);u.playAnimation(d);const r=({delta:h})=>{u.updateAnimation(h)};this.viewer.addEventListener("beforeRender",r),this.cleanSets.add(()=>{u.stopAnimation(d),this.viewer.removeEventListener("beforeRender",r)})}}}class UnClipAnimationNode extends Node{constructor(t,u){super(t,u)}async exec(t){let u=await t.getTarget?.(this);if(!u){const d=this.findProp("model",["READ_CTX","LOCAL"]);d&&(u=this.getValue(d))}const o=this.findProp("animation",["READ_CTX","LOCAL"]);if(u&&o){let d;if(o.type==="READ_CTX"){const r=this.parser.getVariableNameById(parseValue(o.value));d=this.readContext(r)}else d=parseValue(o.value);u.stopAnimation(d)}}}const tweenCache$1=new Map;async function playTweenAnimation(c,t,u){const{id:o,keyframes:d}=u,r=new AnimationsParser(c,t);tweenCache$1.has(o)||tweenCache$1.set(o,new Set),tweenCache$1.get(o)?.add(r),await r.play(d)}function stopTweenAnimation(c){tweenCache$1.get(c)?.forEach(t=>t.stop()),tweenCache$1.get(c)?.clear()}class TweenAnimationNode extends Node{constructor(t,u){super(t,u)}async exec(t){const u=this.findProp("model",["READ_CTX","LOCAL"]),o=this.findProp("animation","LOCAL"),d=this.findProp("wait","LOCAL");if(u&&o&&d){const r=this.getValue(u),h=parseValue(o.value),f=parseValue(d.value);if(r){const a=await t.getAnimations?.(this,r,h);if(a){const n=a.find(e=>e.id===h);n&&await waitFor(async()=>{const e=r.matrix.clone();await playTweenAnimation(this.viewer,r,n),this.cleanSets.add(()=>{stopTweenAnimation(n.id),r&&e.decompose(r.position,r.quaternion,r.scale)})},f)}}}}}class UnTweenAnimationNode extends Node{constructor(t,u){super(t,u)}async exec(){const t=this.findProp("animation","LOCAL");if(t){const u=parseValue(t.value);stopTweenAnimation(u)}}}const tweenCache=new Map;async function playComponentTweenAnimation(c,t,u){const{id:o,keyframes:d}=u,r=new AnimationsParser(c,t);tweenCache.has(o)||tweenCache.set(o,new Set),tweenCache.get(o)?.add(r),await r.play(d)}function stopComponentTweenAnimation(c){tweenCache.get(c)?.forEach(t=>t.stop()),tweenCache.get(c)?.clear()}class ComponentTweenAnimationNode extends Node{constructor(t,u){super(t,u)}async exec(t){const u=this.findProp("mesh",["READ_CTX","LOCAL"]),o=this.findProp("animation","LOCAL"),d=this.findProp("wait","LOCAL");if(u&&o&&d){const r=this.getValue(u),h=parseValue(o.value),f=parseValue(d.value);if(r){const a=await t.getComponentAnimations?.(this,r,h);if(a){const n=a.find(e=>e.id===h);if(n){let e=null;u.valueType==="Mesh"?e=r:u.valueType==="Model"&&(e=getMeshByUserDataUuid(r,n.refId)),e&&await waitFor(async()=>{if(e){const s=e.matrix.clone();await playComponentTweenAnimation(this.viewer,e,n),this.cleanSets.add(()=>{stopComponentTweenAnimation(n.id),e&&s.decompose(e.position,e.quaternion,e.scale)})}},f)}}}}}}class UnComponentTweenAnimationNode extends Node{constructor(t,u){super(t,u)}async exec(){const t=this.findProp("animation","LOCAL");if(t){const u=parseValue(t.value);stopComponentTweenAnimation(u)}}}class FlowParser extends webgpu.EventDispatcher{viewer;flow;nodes;nodesMap;edges;edgesMap;onNodeBefore=null;onNodeAfter=null;constructor(t,u){super(),this.viewer=t,this.flow=u,this.nodes=[],this.nodesMap=new Map,this.edges=[],this.edgesMap=new Map}addNode(t){this.nodes.push(t),this.nodesMap.set(t.id,t)}addEdge(t){this.edges.push(t),this.edgesMap.set(t.id,t)}getNodeById(t){return this.nodesMap.get(t)}getEdgeById(t){return this.edgesMap.get(t)}clear(){this.nodes.length=0,this.nodesMap.clear(),this.edges.length=0,this.edgesMap.clear()}parse(){this.clear();const{nodes:t,edges:u}=this.flow;t.forEach(o=>{const d=parseNodeByType(this,o);this.addNode(d)}),u.forEach(o=>{const d=new Edge(o);this.addEdge(d);const r=this.getNodeById(o.source),h=this.getNodeById(o.target);r&&h&&(r.postNodes.push(h),h.prevNodes.push(r))})}async run(t={},u={preload:!1}){const{preload:o}=u,r=this.nodes.filter(h=>h.prevNodes.length||h.postNodes.length).map(h=>h.run(t,{preload:o}));await Promise.allSettled(r)}async debug(t={},u=1500){const o=this.onNodeAfter;this.onNodeAfter=async d=>{await sleep(u),o?.(d)},await this.run(t)}stop(){this.nodes.forEach(t=>t.reject(new Error("Flow stopped")))}cleanup(){this.nodes.sort((t,u)=>u.execOrder-t.execOrder).forEach(t=>t.cleanup())}getVariableNameById(t){const u=this.nodes.find(o=>o.id===t);if(u){const o=u.props.find(d=>d.name==="out");return o?parseValue(o.value):null}return null}dispose(){this.stop(),this.cleanup()}}class ComponentFlowParser extends FlowParser{flow;constructor(t,u){super(t,u),this.flow=u}}exports.AnimationsLoader=AnimationsLoader;exports.AnimationsParser=AnimationsParser;exports.BuildingGroup=BuildingGroup;exports.ComponentFlowParser=ComponentFlowParser;exports.FloorMesh=FloorMesh;exports.FlowParser=FlowParser;exports.Node=Node;exports.PropertiesLoader=PropertiesLoader;exports.SceneLoader=SceneLoader;exports.SemanticLoader=SemanticLoader;exports.SemanticParser=SemanticParser;exports.TopologiesLoader=TopologiesLoader;exports.TopologyParser=TopologyParser;exports.VisionsLoader=VisionsLoader;exports.VisionsParser=VisionsParser;
|
|
85
|
+
`},privateImport:function(n,a,e){e=e||{};var u;if(e.type!=="der")if(Buffer.isBuffer(a)&&(a=a.toString("utf8")),t.isString(a)){var l=f.trimSurroundingText(a,d,r).replace(/\s+|\n\r|\n|\r$/gm,"");u=Buffer.from(l,"base64")}else throw Error("Unsupported key format");else if(Buffer.isBuffer(a))u=a;else throw Error("Unsupported key format");const v={buf:u,off:0};if(u.slice(0,14).toString("ascii")!=="openssh-key-v1")throw"Invalid file format.";if(v.off+=15,h(v).toString("ascii")!=="none"||h(v).toString("ascii")!=="none"||h(v).toString("ascii")!==""||(v.off+=4,v.off+=4,h(v).toString("ascii")!=="ssh-rsa")||(h(v),h(v),v.off+=12,h(v).toString("ascii")!=="ssh-rsa"))throw Error("Unsupported key type");const b=h(v),m=h(v),B=h(v),E=h(v),S=h(v),O=h(v),D=new o(B),$=new o(O),H=new o(S),Y=D.mod(H.subtract(o.ONE)),ie=D.mod($.subtract(o.ONE));n.setPrivate(b,m,B,S,O,Y.toBuffer(),ie.toBuffer(),E),n.sshcomment=h(v).toString("ascii")},publicExport:function(n,a){let e=Buffer.alloc(4);for(e.writeUInt32BE(n.e,0);e[0]===0;)e=e.slice(1);const u=n.n.toBuffer(),l=Buffer.alloc(e.byteLength+4+u.byteLength+4+7+4),v={buf:l,off:0};c(v,Buffer.from("ssh-rsa")),c(v,e),c(v,u);let b=n.sshcomment||"";return a.type==="der"?v.buf:"ssh-rsa "+l.toString("base64")+" "+b+`
|
|
86
|
+
`},publicImport:function(n,a,e){e=e||{};var u;if(e.type!=="der")if(Buffer.isBuffer(a)&&(a=a.toString("utf8")),t.isString(a)){if(a.substring(0,8)!=="ssh-rsa ")throw Error("Unsupported key format");let B=a.indexOf(" ",8);B===-1?B=a.length:n.sshcomment=a.substring(B+1).replace(/\s+|\n\r|\n|\r$/gm,"");const E=a.substring(8,B).replace(/\s+|\n\r|\n|\r$/gm,"");u=Buffer.from(E,"base64")}else throw Error("Unsupported key format");else if(Buffer.isBuffer(a))u=a;else throw Error("Unsupported key format");const l={buf:u,off:0},v=h(l).toString("ascii");if(v!=="ssh-rsa")throw Error("Invalid key type: "+v);const b=h(l),m=h(l);n.setPublic(m,b)},autoImport:function(n,a){return/^[\S\s]*-----BEGIN OPENSSH PRIVATE KEY-----\s*(?=(([A-Za-z0-9+/=]+\s*)+))\1-----END OPENSSH PRIVATE KEY-----[\S\s]*$/g.test(a)?(s.exports.privateImport(n,a),!0):/^[\S\s]*ssh-rsa \s*(?=(([A-Za-z0-9+/=]+\s*)+))\1[\S\s]*$/g.test(a)?(s.exports.publicImport(n,a),!0):!1}};function h(n){const a=n.buf.readInt32BE(n.off);n.off+=4;const e=n.buf.slice(n.off,n.off+a);return n.off+=a,e}function c(n,a){n.buf.writeInt32BE(a.byteLength,n.off),n.off+=4,n.off+=a.copy(n.buf,n.off)}})(openssh)),openssh.exports}var hasRequiredFormats;function requireFormats(){return hasRequiredFormats||(hasRequiredFormats=1,(function(s){requireUtils()._;function t(f){f=f.split("-");for(var o="private",d={type:"default"},r=1;r<f.length;r++)if(f[r])switch(f[r]){case"public":o=f[r];break;case"private":o=f[r];break;case"pem":d.type=f[r];break;case"der":d.type=f[r];break}return{scheme:f[0],keyType:o,keyOpt:d}}s.exports={pkcs1:requirePkcs1(),pkcs8:requirePkcs8(),components:requireComponents(),openssh:requireOpenssh(),isPrivateExport:function(f){return s.exports[f]&&typeof s.exports[f].privateExport=="function"},isPrivateImport:function(f){return s.exports[f]&&typeof s.exports[f].privateImport=="function"},isPublicExport:function(f){return s.exports[f]&&typeof s.exports[f].publicExport=="function"},isPublicImport:function(f){return s.exports[f]&&typeof s.exports[f].publicImport=="function"},detectAndImport:function(f,o,d){if(d===void 0){for(var r in s.exports)if(typeof s.exports[r].autoImport=="function"&&s.exports[r].autoImport(f,o))return!0}else if(d){var h=t(d);if(s.exports[h.scheme])h.keyType==="private"?s.exports[h.scheme].privateImport(f,o,h.keyOpt):s.exports[h.scheme].publicImport(f,o,h.keyOpt);else throw Error("Unsupported key format")}return!1},detectAndExport:function(f,o){if(o){var d=t(o);if(s.exports[d.scheme])if(d.keyType==="private"){if(!f.isPrivate())throw Error("This is not private key");return s.exports[d.scheme].privateExport(f,d.keyOpt)}else{if(!f.isPublic())throw Error("This is not public key");return s.exports[d.scheme].publicExport(f,d.keyOpt)}else throw Error("Unsupported key format")}}}})(formats)),formats.exports}var NodeRSA$1,hasRequiredNodeRSA;function requireNodeRSA(){if(hasRequiredNodeRSA)return NodeRSA$1;hasRequiredNodeRSA=1;var s=requireRsa();requireCryptoBrowserify(),requireLib().Ber;var t=requireUtils()._,f=requireUtils(),o=requireSchemes(),d=requireFormats();return NodeRSA$1=(function(){var r={node10:["md4","md5","ripemd160","sha1","sha224","sha256","sha384","sha512"],node:["md4","md5","ripemd160","sha1","sha224","sha256","sha384","sha512"],iojs:["md4","md5","ripemd160","sha1","sha224","sha256","sha384","sha512"],browser:["md5","ripemd160","sha1","sha256","sha512"]},h="pkcs1_oaep",c="pkcs1",n="private",a={private:"pkcs1-private-pem","private-der":"pkcs1-private-der",public:"pkcs8-public-pem","public-der":"pkcs8-public-der"};function e(u,l,v){if(!(this instanceof e))return new e(u,l,v);t.isObject(l)&&(v=l,l=void 0),this.$options={signingScheme:c,signingSchemeOptions:{hash:"sha256",saltLength:null},encryptionScheme:h,encryptionSchemeOptions:{hash:"sha1",label:null},environment:f.detectEnvironment(),rsaUtils:this},this.keyPair=new s.Key,this.$cache={},Buffer.isBuffer(u)||t.isString(u)?this.importKey(u,l):t.isObject(u)&&this.generateKeyPair(u.b,u.e),this.setOptions(v)}return e.prototype.setOptions=function(u){if(u=u||{},u.environment&&(this.$options.environment=u.environment),u.signingScheme){if(t.isString(u.signingScheme)){var l=u.signingScheme.toLowerCase().split("-");l.length==1?r.node.indexOf(l[0])>-1?(this.$options.signingSchemeOptions={hash:l[0]},this.$options.signingScheme=c):(this.$options.signingScheme=l[0],this.$options.signingSchemeOptions={hash:null}):(this.$options.signingSchemeOptions={hash:l[1]},this.$options.signingScheme=l[0])}else t.isObject(u.signingScheme)&&(this.$options.signingScheme=u.signingScheme.scheme||c,this.$options.signingSchemeOptions=t.omit(u.signingScheme,"scheme"));if(!o.isSignature(this.$options.signingScheme))throw Error("Unsupported signing scheme");if(this.$options.signingSchemeOptions.hash&&r[this.$options.environment].indexOf(this.$options.signingSchemeOptions.hash)===-1)throw Error("Unsupported hashing algorithm for "+this.$options.environment+" environment")}if(u.encryptionScheme){if(t.isString(u.encryptionScheme)?(this.$options.encryptionScheme=u.encryptionScheme.toLowerCase(),this.$options.encryptionSchemeOptions={}):t.isObject(u.encryptionScheme)&&(this.$options.encryptionScheme=u.encryptionScheme.scheme||h,this.$options.encryptionSchemeOptions=t.omit(u.encryptionScheme,"scheme")),!o.isEncryption(this.$options.encryptionScheme))throw Error("Unsupported encryption scheme");if(this.$options.encryptionSchemeOptions.hash&&r[this.$options.environment].indexOf(this.$options.encryptionSchemeOptions.hash)===-1)throw Error("Unsupported hashing algorithm for "+this.$options.environment+" environment")}this.keyPair.setOptions(this.$options)},e.prototype.generateKeyPair=function(u,l){if(u=u||2048,l=l||65537,u%8!==0)throw Error("Key size must be a multiple of 8.");return this.keyPair.generate(u,l.toString(16)),this.$cache={},this},e.prototype.importKey=function(u,l){if(!u)throw Error("Empty key given");if(l&&(l=a[l]||l),!d.detectAndImport(this.keyPair,u,l)&&l===void 0)throw Error("Key format must be specified");return this.$cache={},this},e.prototype.exportKey=function(u){return u=u||n,u=a[u]||u,this.$cache[u]||(this.$cache[u]=d.detectAndExport(this.keyPair,u)),this.$cache[u]},e.prototype.isPrivate=function(){return this.keyPair.isPrivate()},e.prototype.isPublic=function(u){return this.keyPair.isPublic(u)},e.prototype.isEmpty=function(u){return!(this.keyPair.n||this.keyPair.e||this.keyPair.d)},e.prototype.encrypt=function(u,l,v){return this.$$encryptKey(!1,u,l,v)},e.prototype.decrypt=function(u,l){return this.$$decryptKey(!1,u,l)},e.prototype.encryptPrivate=function(u,l,v){return this.$$encryptKey(!0,u,l,v)},e.prototype.decryptPublic=function(u,l){return this.$$decryptKey(!0,u,l)},e.prototype.$$encryptKey=function(u,l,v,b){try{var m=this.keyPair.encrypt(this.$getDataForEncrypt(l,b),u);return v=="buffer"||!v?m:m.toString(v)}catch(B){throw Error("Error during encryption. Original error: "+B)}},e.prototype.$$decryptKey=function(u,l,v){try{l=t.isString(l)?Buffer.from(l,"base64"):l;var b=this.keyPair.decrypt(l,u);if(b===null)throw Error("Key decrypt method returns null.");return this.$getDecryptedData(b,v)}catch(m){throw Error("Error during decryption (probably incorrect key). Original error: "+m)}},e.prototype.sign=function(u,l,v){if(!this.isPrivate())throw Error("This is not private key");var b=this.keyPair.sign(this.$getDataForEncrypt(u,v));return l&&l!="buffer"&&(b=b.toString(l)),b},e.prototype.verify=function(u,l,v,b){if(!this.isPublic())throw Error("This is not public key");return b=!b||b=="buffer"?null:b,this.keyPair.verify(this.$getDataForEncrypt(u,v),l,b)},e.prototype.getKeySize=function(){return this.keyPair.keySize},e.prototype.getMaxMessageSize=function(){return this.keyPair.maxMessageLength},e.prototype.$getDataForEncrypt=function(u,l){if(t.isString(u)||t.isNumber(u))return Buffer.from(""+u,l||"utf8");if(Buffer.isBuffer(u))return u;if(t.isObject(u))return Buffer.from(JSON.stringify(u));throw Error("Unexpected data type")},e.prototype.$getDecryptedData=function(u,l){return l=l||"buffer",l=="buffer"?u:l=="json"?JSON.parse(u.toString()):u.toString(l)},e})(),NodeRSA$1}var NodeRSAExports=requireNodeRSA();const NodeRSA=getDefaultExportFromCjs$1(NodeRSAExports),debugKey="NJHgNB1HDTrHTJc4ERFCBRVBB5HOBEDCjRLChRDIdn8K7EUJD,Vm4C6vC8BpZ6n6G,hxOjYZ{,wYhnJize2rlm9m,6bUcRVbP6sjNbKU8juOWUpukkcV6Cw,Bk2io7{YWJcPnG{1o3GUTpnO:z{kCYHL14HjO8noH1sp[J78k3Y3IcbOSSk97evccx0MdW2uR0f5qhZFQV8e2JCRxxJEBRBC";function decryptWithDebugKey(s){return decryptWithKey(s,decodeString(debugKey))}function decryptWithKey(s,t){const{content:f,sign:o}=s,d=new NodeRSA(t,"pkcs8-public",{environment:"browser",signingScheme:"pkcs1-md5",encryptionScheme:"pkcs1"});if(!d.verify(f,o,"utf8","base64"))throw new Error("u-space: license verify failed");const h=decryptInternal(f,d);return JSON.parse(h)}function decryptInternal(s,t){const f=s.charCodeAt(0),o=s.substring(1,f),d=s.substring(f),r=parseHeader(o);let h="";for(const c of r){const n=d.substring(c.start,c.end);let a;c.encrypt?a=t.decryptPublic(n,"utf8"):a=decodeString(n),h+=a}return h}function parseHeader(s){const t=decodeToBytes(s),o=new DataView(t.buffer).getInt16(0);if(o===1)return parseHeaderV1(t.buffer);throw new Error(`u-space: content version error, version=${o}`)}function parseHeaderV1(s){const t=new DataView(s);let f=2;const o=t.getInt16(f);f+=2;const d=[];for(let r=0;r<o;r++){const h=t.getInt16(f);f+=2;const c=t.getInt16(f);f+=2;const n=t.getInt32(f);f+=4;const a=t.getInt32(f);f+=4;const e={index:h,encrypt:c>0,start:n,end:a};d.push(e)}return d.sort((r,h)=>r.index<=h.index?-1:1),d}const _base64KeyStr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function decodeToBytes(s){const t=[];let f,o,d,r,h,c,n,a=0;for(s=s.replace(/[^A-Za-z0-9+/=]/g,"");a<s.length;)r=_base64KeyStr.indexOf(s.charAt(a++)),h=_base64KeyStr.indexOf(s.charAt(a++)),c=_base64KeyStr.indexOf(s.charAt(a++)),n=_base64KeyStr.indexOf(s.charAt(a++)),f=r<<2|h>>4,o=(h&15)<<4|c>>2,d=(c&3)<<6|n,t.push(f),c!==64&&t.push(o),n!==64&&t.push(d);return new Int8Array(t)}function decodeString(s){let t="";for(let f=0;f<s.length;f++){const d=s.charCodeAt(f)-1;t+=String.fromCharCode(d)}return t}const logo="data:image/webp;base64,UklGRswmAABXRUJQVlA4TMAmAAAvAIVnEA+imJEkqF4DtQTrz3QpKGjbhjHsQhiui4tMGGI1fJLp/2pgpmGafmQX+FcJCpbA5zH0qRRk4CBkwumBoU/XQR7YOg4Ctg2bWk7Mn3Pd/RAiYgLOrwIBqGKLe/j8QQ8k9LxcT5WABkhGMBpgnw8+SRIUpZ93E4h/br9UEHckCdBoBPs8hU9QViMEdtsrD6UAYqu2nufuZiZJxnecsVPL7pbjycwkYzu3E7sk1A+Z23Vsz4d3UTL5kiS2Ezjbz23buR+2Y4/tGW+rtmfNtm3bvsd1r/ZN+///7v5yvC3Lkhxb/ZYgc6gwi0H0gzQR/Z8Ab8+2121s29Zv6N095XZIr6T///9ZaLniGL2qPlHQCxH6IEgfJBAkSET0fwIou7ZVR5I+woqKfkRX5v9/aKcrOPeauB5h+cpXHlhmAEIgUET/J8C3a1t1bdu25W/q1/qEyv//Vu/j4ppTdqrt0Q+gJCHzYIEQFsIR/Z8AWs62120j72FOd7OIpAdPL4juf1uxpf8V2zndcQASP0KIQAUSAol/qIj+T4AkadujNpr2fYgQO8HIGHpadd//ZhJIgi/ZqUS39Tv1US5CJsoZIvo/Ab5d26pr27at8k213fqVXsf/f1a/OuI6hOsbD6AsIfNggRBWEo7o/wT89h99Pq6p+8OXvymldK/1hdHA4/vzu683+Zvq8O53tPR/l7/H/La3ngyG577Ob3jrycAYv/173RQZIrf9eJ9LDJbnd3qLK5lBM67l7W3aGDq37/zeNm0MoZf6xjZtDKS5vqtNG8Nprn7wn/+av1xpq3ktkX/9vX70/adF2RhU8+wB0//Uv91ood7L49/v8fGvQN1HiDdjHvu532T/V+SnPxUZWvdivsF0N3ZGKxeWTUT+CnAFzkA7W5JydfTwJzqGV3cz3kuwtxuTk3hQ5yDfNqG+Cx3YFa1I6r7+aN//2e19braojjZfZZCN1XTdOdxITufBHOguTCEuwMIkJHuIZ+Cfap7tDDNkVwz3zhRz9DszWJBC7UIRShaH0pHMhPYloGmmK4PtWc22BZtdmRhNHOjMBpwhTkRXCpLJGItg1FmKCzdkZ7XLOVxJTmdAfVdKBleiEi+KHkAWQ9MS0G2WxKAbJ5sVppizBzMYMIXagBRizyazAcnF6IsgzlFc2OG2WmwJNrtzMfqgrygjg53YkFdlR3IZYxHoHCuD717sdTnJncXp5J2h7kAdQsloUxTJYmhaBGGGGH4YZ3MVZpjDhRnkrUwF9hAnpTIJSB5GXyYzQ7CbjLUE2126GD2IW0LtGSxEVfKhZCTdGIvAfv4JQuRqq8t5uLQ4mbjOLEALsWd2UgqS09C0AOIMORDxY6rCDHN6MIW2GuqawZXYnKRoAJKH0RfAPQOD8W6oJdjuVmf0IG1nTmAJsWS4KBuSbmhl36g/q+GIu50up7l1Opm0oZQMdmKXLmVH0pDGvtt+vgYk7mYqTnUrD6ZQ1kJtQA0ySYuiSCqycy/ajNeQxFhstAT7Msc7owdhhzIqsBNzpouSgOTZ0Mq8a45LUGK20eU0104n07WFemVwEKfVlYykIY133ebMYYm7iYpTXatOpKszCWghlmyfSkRSkZ11o3ow7gZagt3N+ZnRQFUKtWfwIO43ywOJACQfRtSPa0/MZj6Mu30uZ3OvORtVF7MBW5Dh3WalIZmQ9nF52r/cWTnNj/FjnuIE96oTiapDWTPYid3evSk7koTMwBe8Kocv42qcJdhoAGdGA00t1AakINPbVWUgyYcR9fmYAs3mzTjZ5nI2BM3ZaCpKyeBODHv/FdELyY60pyMNpFSP5oppihMQJCeS9BLqDtRBZAcmJSNZkPnpWANN5tEYLbMEGw3iwWigaFVGBVqQwYGkRCS5GJGejCnQ07wad8Nczo1hcjaCUqg9g4U4zcUDUSgXMj0XaSAjeDaudinOgSE5O0GdScAWZHNiRwqUBTmeiznQ23ybm6yyBFsM5MFoJacOZc7gTAxzsw2hPKDkYUR6Js5Ai3k3RqtcTkaxO42cPdQNSEFmR77ijkxPRB3K5eHYGeVwDhSLs5NTlJLBywhsOpHjiZgD7ebjWE2Sgi0GszBaiWmhNqC+E6fxeRiRmG1ezXn5NGego/q5s1hkcjKOy2nErMrI4BRkY1RHJmUJt32SOpTN/Bw7ixxOwrE4Oy1bqLtQiG9jdEMOZYNG/Rw90NN8Has9UrDDgBZGKymdqcAZZOdURSIhCxT7p9hCPfxdtMfkdCTdSZSkUHsGV+PgVJ6RCckrFOkT1KJk83f8mONwEpLT6ZTszAKkIKP9/LjoXZyGNGWR+ie4Ai3V57lijBTsMKiDGZQMZc1gN9rPHkrxzuSJWJOSOxQbt4WazOdxN8bkdCyd0URHC/UE6iBG/dlJ0urktH38kt00oFWrRTnN73G2xeE0LKfT6ShKyeAUZDduPdgdihPbAx3B92VTpHArluwMMrZQm1CMY9nVARVrCXU338dqicnZDezMaKJiVkYFWpDRll1uUDTqUEr2f9kSh9PQNKcTkUK9MrgabenlAo0K7aFuPwFY7ZDCrWiqU4joTAKWIEddfBsUu7OE2vPPgGyHydkN7szoQUIdSs9gN7otvrxCIzGHMupPAVYzHM6GpzmZhCnUDahhXh5gg6IrU6hT/jmwWyGFG/Akp5BQlDWDu1HMA+QOxWKkoaz5JwFnI0xONMAHowcBZ6hNKMa0nOq1/vOHVFayhFrWj00erTPC4WyIJicTsColgy3Mupx6PN+HP3PFBCncgCg5Bd8S6i4cxrr977ps1ids82dcTTA50SAfjB7wuvJegS0+Yfw03B4tmuBwbky7c6OrofYMdhf0EHucDZDCPTAtTkS3MwkI6uQl9zoDTE4x0IXRAO5dmTN4L4467XgQFqcBDiejupwNWwt1E8biWEMfwS+8FF5TPuXipF4N90C1OBHboZQMNl0c4V9+QTTO674J1anXnGKwC6MB2RZqE4pU+/NjF+lU79XJuC5nQ9aV9wxe6liXTcB83eThpFwN94HrdCKwFOouvFwLkaCvQ1IApZPnq1xzvg34YDTgupgKBHXtjVdDGH81AOYsTVRudjqy7jRYdSg9g1nCAR8nC4tqNdwHstPZYbVQF6AOGYcpyrKq1pxh0AejFVVR1gw2FXIoWZRdtdnp2GangTpDPYUi5oBdklOzGm7D1pwd1KqUDCYVdNgFYVGsQRVbdbRCSqE24RR12AV5KDY7u4GfnQapK6MCQWUdohxXvWq4DV1zXojqUK4MdmlXnBhZrwZVdNVRRHuoCajD6/xX6En5UejulVDF2PSand3gH84D0JvSM7ip1ylKb8q70rdfQicFi1Y13A3f5HQ8LdRNKAKvnFJUrRoU8CXnG8+qrBlsKvDwkOKj1exEI/BgNKHZQm3CvliuXxqQheiUquFuFExOR9OVtyyeiyVvPzj9glCFyEo1KFCwON9gUjzOcf81FsuPbr8g4JQhKjU70UgsjCYs+wNRvcI1cxRuqwzUqYZ703A5Hct4LDb3KdyK4Rp00LA4BUqLh1qFHi4yVJVmpxiRhdEDSXko3aTex2w13EzF5WQgWzzUS+zNZjuhg4rTKUDmh1JM7MGJcNWoO8XIHIweMFI81Cb4stWGk+noToZxPZRRBV8y2ku4iY7TKSjqeCjdVlfdGUboYPQAscVDDZKvGm04nZJX5wZRHsppq6sz3ERJcyKGpA+1ra+6M4zS6miAcEIphqPuqzqM1eyVBz/e6UOZ73T5ZWA4nZT86mwIDoV6A9njK9558CfzADvDbbQ0JyLoWAKQ9Us6JV6HKi3V0eBeVagvk30fkw3nZcQezubehuUSfleLneE2aiYnundDKSb8LhbrUKUmORqca1A26XdabDgvI/dwmnN23W84lFFFwwVAhSI+lHkJd6Nncnb33nELtdvnav/u3sUjQIcMVZkOBXqSo5WAzhwfrDvS3WLDiUbwm9PwpVBPk36bDEWXl3A3ii5nx7czTfo9KCN07VCgaHG0wntThkm/iwynMsOJRnJxGroWapZ+M2XMupzh3jRdzo5uZYL024XodOnQQdPmKLgl1N2E30whr7q8O8WIHk7C1pkk/S5SVFXOcDNV3enQ6lCKCb9KKWdVOnRQdToD2hTqJvzKKYWDqsUpRvZg9IGsMFX47ZQyq7KEm+nqTgd2htrtw1Vv1n4t9KY8efVm20krxUyq/AUlur45A9jKTID2L+nFg98KPSm/F7pbt1e+VVpr+rbsoOl3OR+qvDnD6K6OJlgp1GiA8rSrxdjRyoOi9Ka8K71byTsbLXo3ds/kBBk0uYXbCcuz02FdTIPkrkZ+uKJg2ihnA00v6EFZcwqqOpRhkm9yFHRXpTjDKK+OTqBaqFnyrRslXTW5hdtJy6uTQRUmCL6OshZNLqjRdncKpi3U1cTeFClrhKYFqrQlRydInXlIvfKltFdNbuG+jPjDyYhSqMVkXrk6ijtpckGNurtTEO3MLfKG70Z5T2haoEpdcnQC9M5UeTd9IkXuNLmF+zLyi/PE00LtJulKfVwvG6WeNLmgJ32XE/GszCWbvjT0CU3foEDfzdGAZgk1mmiqtHTS5BZuNAYW54mmM209MmhyQU8OXE4EU0P9rquRDE0LFDiwORqw7Ey31ciqyS3caCwczhNLYcJq5ISmF3TzoDsRykuop61GkioFmnhwOlqRrExbjxRNbuEWY+JwGpAUajEfxUx/tkPTC8pc6M4LSGfu9cigSoEmLpyOVhh1MGE1skPTFG4xLlaowWihdluNDKrcocyGPDs7jMJcq5Edqh5Q4kNztILYQi22GhlUSeEO42OFGoiZaauRDqreoc6IPDs7hhTqd12LuKLLAT04cXcGhovpthb5QNUU7jBOJkcThMFMa5ETut6hzop8OB1BC/U0cFNReschc6oyB9R4cXcGgoNp6Hal+BQ5O3RNAVdeJEeTe1uow9CdUs4VZe7Qbsw8nO5eZ+61yAPKHlDjxuUM52o8yDGtJS5QNgVcuXFz9OHan49Cz5WEK9rcod3Y+eZk18pvNg9oe0BPflzOl2Mtfq/poG0KOPDj5ujh1vp7TYS6dygaQ9+d7FTQVc026HNAT450pzjVPwI/3ulDme90+QnwgLop4MCRF0cnh+r4CBSlN+Vd6f3/f1foe4eisXQ42aFN1zQ7FD6gJ0+68+VQkTkJtFgUSgFPPDkdPZxJKme2+J0FCt+hYjyt0ObMS9CUWjlkboLGB/QPU/LsRFeCChrRLhDbJmicAp648s3R4EgWNNd674hNULlBxbhaoacbdQiaUU8AW6HzDGW25NmJbjQVNIXBCq4VOteAL77cHQ1ORElTGeRorVD6GzSMrwl6unApN16+pNuXLWL4jpWboPUMdcbkw4kudHbktKmHsZmT+bLcRDKktgla14AfnLk7Wt8vKD/c1cgP1/PsjE5ANRPU/gYN42yC2vvdH7K0/WD/woIYDzj9vKD3DHXW5MPZ3698xvbwMSkzSShdCvSuASfeXI5WmbA+B1ndgALpCs2bVHlzg9rbdTi3YIjS5IKQe0D1V2g35r45+9vZdGE97DOxf4IL0Dw1ogCKE1SvATfuXI7WtyPxAEhPQXHWbIJnf0H3JlXu3KAmEvLsVTxBGi7B2R7QfoZ2Y++bs8uExhXDs2tKcmjyAO1rwL/4050hE/LQMp4ojU8LLtsH+jcp8OfF0SQTLi3ACdLiAEseYMAZ+m0MHk6XCQnrhiar2pACE/eABWvATw51Z8iEfFCjwnmXdp8Qub5gwiYFDr04mmRCoyZDo6TtBMdlgBFfoWgshrpMqANqhkZJ63XAIldYsQb85NHsDJmQOzMuQ6PEwikAkSvs2KSJR83RJBM2ZQ+GRomVU0IhV1hyhr6MxxXKn4eLmAOrA/lfLK9Ev+yHHsi2YusTBLnClDXgf5iUZ6d8Hur9T/An5Zed3Op8ue0fftnP3QuD2Kt6n9sHGLNJE5eao8fH4Yl3Lp/E5iH0up/1BXPOUDEuJygLoeVdbI+9rekmWPQdymzK350igrJYi/1V6mPb/oBNXwK++HR3dBJAT5W4WaaeFbsJZu3Qt/E5QVn6zLESd9/H3tTs6wDLDqgzKn93vmTPqMTxqgj9J3frAOOeASdO7Y4GKTLaF07bWnxYFeNsn9Laeyxfro8JFu7Qt3H6Bj2lyG5cWzxuivLMq9V7PCWbT6L/7+DdJaVPrTD0gDqr8pvz+33q3//B7dMn6R73DDjx6i9Hw9vcCrisgrpUebVAz7c5Ealr4XrXw9jMgAfFkT85A3oZs4sT+ZaU4l+eQvW4vzkDbtzqjga27SSd3uK6v+lS5dYJbWw71yED2o3dwzlXfWfAjV/d0brm61Lg1wm1Nd+AojEc2ld8Z8Abx2ZH63qvS4FjDWoSpB7XFm/idvDMu4p5sjgaPB78u19TqnWw0YC6cbxCL2ZNn4nxyvp1fPfDdHwKtP6otT/3eJO7T33Z5gx4YlmeHa1UnY7YZ2JtH8nsqXRtUiOdjFpfPvvr5vKpdunQP8bzb1CjKrvxzSXzISSXYnKoeprpaMf8Zb5ONhlOqUyrUKdqcuPFpt9+hJxj7UiZ6G4XkXT7+jLHS7iTcf27M4gq5kZjU/YlZFa4UD3R5Y7687K+bNGdZmy/O5poSm6MyqbgT8gwWFdk7Gckl4clBtOM7wnqJJ3mxt/GJusehYx2VYmOdxvZXAcr3AL9OozzhzMoGtWNUhlVh09hqCzazux3JC/VBn8huRrr745e9IzJnBiHMcqSV+E8WJPT/R5A/qwW+JPowZh/e2LKYW78MlZZ8yqksuSJGJDnqt85Pux8BuP/NJRSqcnVnBjJmGXNr1DZUCfCQJ6rdnbXbSdbiGlDjXgj6cHm/lNnsP//4pAdxatQWRCIBHlW5YJr7SfG/U7V5t//yNnsp9MgaJycWSvLKIGgau2JYJB5+H8KjdN+zt2fwfh+bPsJ7y4o5l1LT8SD7F6/FnxyUTCbWlGEhO4xLsDUxjCDQl5eowKMLQTCwu0YFeDQWCQw5FLGBFJTA7HhVkcEqBpK6JDXEYGlmZL4MJfRAKpGFoTYTKMBSxMlIeK2jgVQNZBAIj9jAcGsIkzcRwL4YJQDxb2MA5yMFqT4U0YBFpMdoeJPGQPgg0EEi7GMASiDhBZjGQF4MiBcjOX9L+i9A8b4/ke9AjHu73/vWifIuI8KJMz4efeLdwA8RgQy1LZpPICoMb5Gf7iM//Az/sNp/Kcpoz/cx394jP9sZfSHy/gP6/jPWUZ/mH6N+vAx3/94+jnn13+XbINwv//89WL+cynFt3tgf33zIt1xy8TrAa1rj/s5j2faiXTlO/5P8muoKc9/iXCR7f+7d13MP5XhyRejXfJgdm3aJ60aHHaI84iWHSg5aus2rvhvEFbR9v756x5z8SBgah50bdxh2fAdEiHrpyhqG/0EkuLm97UvETjDWLbYX8acYJX7g5e0eWIlrPC0zip4+OooioB17YmAOYyxWk1SbYXUOQ1c3u4nVsAqSWM6efncbsiNAyobTlLNCzM3cOHcdpHVsEHRal3elrScUDugWE0nqcWNaONO2hAQFQ2PBJUoz+vyQfmAytaThbyNwUXaJBRSx5roKVE7WJcLuo4nVvOZ1bmFOydaI2RSxR52StRO1uVBT8dT9gBr9w3kDRRYJ0SSwxI3q2k/W+r45MbhxMEDzMLEdAM/sZKQoNPwTE3u2tVy49N9PLVeYO3AAnezMqNwMidiotPuPr/B03k4ueIFZolKXGU5RuYk7DxcA5TmHn9ueJpHE2+eYBX6yGmRlpiRE7DraHXDxjBBPx1dT0dT4wtWmXMDF2lCNDANu4/WjRltwi4RnOo4mNj7glVEHXeSbspFmYb3ozUhvU7oX+AUj6bWGywhOxdJnXJSOlZ0sPobo4cJvoJTCyDIlnL+YAfROYGKqI6yY/VoZUPGz4QfOjbNACLsUOuty3Lx8If2CswNfOOcGA2Iw8bB6gNxt+lgiNiUAtvf1i4K1fqDBUALlzmOc0EMjwfrJyOO6WOL2PpbkAPQf51Em0fYBQzuxnwR92Rk7KNjdRtxTC9bhCY3Ah1Q7o08fHpEO+XuXMdMkGMk7DlWbhDG9LNFaGrBDsDNidN5hCW5yOkL5QZpIAaWDpUbL+CYnn4iND0BD2WRpvGJdorpBialk74jGpaPVBwGHNPXFqGpBDzgcLJw8AhLcoE7IZfIjTAN13F6f4x4T2/bgtZXyEOJstx9osklzm3kRFXC2O3c6z0QbRkx9Q9nho5MboQ8oBVl9wnrYpmzjVSU1gau3dJeqx2E+LwZcnR9wCc03WEPrSSNVwyxlw3kTSyx5wbCbn/tpZWtOkAr3PSiDqcPuUJTDntoBeHgE/YipY5Lm3hgbQNz976b3QjItr9NH/SApmv3brxTaF17R3UPWkEOrzjEvnBjEzescnm3sDHxQx91i9B62rvpNvk1ivbuJvlVSRcvcnRaJf7XWD34Ita5tgnRX7G0W2UidU9czDk/peScz1j9mPoNmdzYuTvP8iNG1kqbHNdZYU5schY3cOE69uw2mHDilzrS61+X5+68eUFTDHvoxXCW+XNqKBPTwvUNnLiKfXZbRGTRw7u2/3s6K23e0HSGPSQpOBjHbEVSFhtc3UDFFWrOvZt4SGKXtLRzap3VOjTNsIcoxdM8ZifoLnZxjlviR6jv9hDhUGVs33HkTpoXtp7C3lOKZCD7iZPEImcn9nhwQftuLw9Z4DL0XUfuoJmhqY6ghyxEZyG7MUFMN5Cx6MGA3G6Zhi+d015953GCAja5sPcUIptodO8Cl6ghDxtku4uGJuzT9c2Tw8wvbGpBD1GGxkSWvUtcoC4fLCIZO2koorZbBjOmdWyaQe8uA220vMtco5oXF5KwREOkhLWZLB0yEzilkFeEKCay6tvJWYSqFwMZ2F8sFEFrl9HhIK2D6yPgYZHhaaMI2eXUcZ1J8rIhDessREiS3XEzZgInN/bp23B0/nIP0N2jMiQBO1eZn/ywCEyjw0ZCEXPIdGO0Dk5tnw5HD14CNMtw+EQHPnGFiZ5cQMcqC5ExZLwhZkKn5/+VI0BoREg+kYHJ2UkMeRqAHRskLCGHzDdEg6cS7rI/3ZAT0MIdxOWLAQFbJDREEsBImANeX8Eu+ZNjlBtZuUQ0b7Kc0U0cjE6oQjgcQfDkxqcXMStycYHo3iSxjD0kTAFDh2CrA2aEpzvUPb3pgnQkcgYkeRvE7thLggO0tYG8CBc+5U8uDTIRbVyUy/6Y2MAyB0vAWzBPQHNA16eWIaa7sYG7yzmPslTBxMEJeIRz1O3m7UBPn1ka5A4lrooNeZyEptEnCXW71oFYAVQH5MbnlSLoCWWuiE2fgtCBJQ6Wtv8S1Hu75oHip5XUIVVpzk6p5pOdMjt2c/DTdkVY13YzeqAzwCUvKl3QiTnukOpeHTIB6xzE7QYYa9slS5Gj+RllnKJWxXduF0ryepcxOmwcaPMitGu7YGlUTk/BLXvPyF3UNrmDC0LZLyeSsYuDst2AY22z2Q1Z6hj1Edoav0nPLXC27SdnQs4vOyUubHCQdivCO7lsySZHLrDNFPHQKfExiu1exMJlkWmeHxIDWxyE3RIgDVgyZSdHLazdZXjqBLcvROXuIp1q2C5RqCIObPeFqGOnLYsczaDWhoPvhrxzQ2RQ1VEqMI1+OIhY2BC/YM3YqBylkOZkgA88xoxcEflK9Z2yc92BvRwc2AtJBzW7LUud01c4uzMUNKM2zKZANvr8hB3rdixykLCFqWPZmE2O3AhmWYboAc2wgTsEdsrdFKvrAiYOBlWEeWKvNTs5aqFspozZfo9xE7cLOCrdNFBlndEnCYGqoNRRyZxFjp5A1grRWa9PA2curHs1OqpelM01GUskGD1QVeq091Y5KkGsp5A347n0QnO2rlNNVSPW11zYnxxFVNc3z1Ln9BTCshRP253D2I7LqwZVVVUbVdcMrHOQMaHO1ARgkyM3wtdBKYvlXHnRdy6tMrq/GVRZU6iwURRg6XfATo7u4FWcFBvs9j6Nf3BjzYGdbzplc9k0+uLoPHIWOcqha6GU2Ww9D/Nwcm3NTrnb24n1ZQc2SLhTCVegMoRRObrCVqKYyWyK0wctmM0VhUoPtFB12Y4tEtJfGUud01PIulPOw25SzYNXub5sGh0f7VRZFqiiXyA2OaojXPUUtFhO6nnQOrcvu6imjz9RFhcZ/ZD04qrfB2scxWDVO0EibCe9T1jk3LJB1Scndi3J2EtSxpW+E+Y4OgPV3VHQznxSTCj9itkyo/sTDdRYcmHxF8noHM0gdaOohwdID2pwH5d8ws5niWpLKiaSEq76vbAE6ik8lYWyFi9QHKDEpSU75W7PM2VxQaHOH5/w3bDJUR+h6XCUNcIPVBMnc2NJodIC/Updz06j068Taxy5sDQvlPbmC+rfMMq1BdHouGRQ49mBZRo6deFyVERijqMWkOaW8vbeIE1MwCw+u6imSy+qPUvYbzRk6sRltKCMztEMRcdCgRt4hCZl5/qzQNVFr5TFJ4EKG0sF1vldsQRSCkDlaBuK3HlFT5CDq09ejO6LtFDXE6MvHiI1YWWqgbEJ6l8CzvysR2ojxe69Qn0xXjj35MDOZZUKjyI2eFAso0rUicYaR258VP4zwi/kGFowOx9Vyt2WH5Q9umOLiEa9qMb3xhxH7ai4+YZORuU+PipUWnFi+UGliogIVEVVqIRndI6eg6J4hwqic+lBNDqvUEelB4WqTFSqgZpGv3gsgXQdEgv8ow5C5MKDi2q6dqfCm9Pol4lEzYjpwjIgm6CejohDtbTBGGPnKRO0Ye1BoMaqTNmbA4tMZOzCFLCOyBpHbhwPDVSTWp5WWX0QBqZkZsPovkqxrKqJamJiYnWXlrYugmSOo/t4uJnoz+nsIGVC4qaZTWyuG1RS1UCdVGjbSmmPns0eUKNzlI8GV8xkNvI7pw9A5pqZNcrd1l9UUFWjExdjs7ZHdbMXlCWQ5sGQYCizcWOUAcpVM+vULhApOzVimYtrsz72p2jzjMomqKdjodjKLGMqIWAalkRnAW3UoRcmLuJmyvsTtxMsaxzVcSS0sJY9FF2Anbssb9VUslK7ViqQoX2z/rY3SZs/wMxxFI+E2V7WKA1wcNncVkOkU+5WqIuNezPlvYnbvchG5+g8DjoYbHRIB5xcHNq6i7xSNo2+2Zjb9bEvRdsvZJZASE/misVsQlS204JpbjZF1FEVW2ys7XTui9uubNBsHi8JJrN3SAZUzm2lN9mdwovYMLed0p482v4CZ+1oaYrRTkgEdG7zXejwrPLxANyOrA6I6MwdLHcY7TtEgOldFlLPXj4WQHk/orYvgjf6oZJhNaOk7bR51lQ6+BX5sBugshdZwBefpUOlt1uFTMDwbIglr5oImYQ+9qGIuByweaB0sFuEZMDlWReLXp2MWAfIjT1InfDIA2uHSVMCQPbsVUybT4mSTFDbgeFEzD6YO0qeCADql7vJD58yJQuh5t1wIpbNidGPkQ6Wc/sRvNqB7pMosYZQ82w4IYcXlg6RpphO+5G8ysCrR4GUxVDzajghy+aGzSOkh+XSjhw+NSWLPxcp1hi6hz/JiTkcsXZ8JJjuJ8pFOH0ayO7PzcqCyC1fShezyBNzR0eG7RylENR51JHDn8WKNYj65UcWdfgy+rHhiu2WqAlRPZrI6U0RLesdIp2Dt6KoRb5YOjZ62K5hDNn9cTfW+VJ5sYxRLbSnC5u9sXlk3GG7ImplTH92KPkyiBkVI92LVJy4z+aOteOihe3eOiYytHuToexLJMa+g6S2KCsK3JZD5o6KBbYbTtgMuX1pSjc/mpixmyS1RShR6CSPVj8mYrFdquJekMeXgQ0/Hm5WR0lxjm3WU8UOm0tWDommwHIji7wgxZeOXX4kbmzCpH7P8V+tJ4reolP2HBCuh+FWfhe5GtWXiU0/Mjl20/7s2lP+xSj5rvLwlVfWDgfXw2zlcYKfmOhHUb54IXZG9eCvY4xnzi1GJ1+fza/hDoathzkyeOWco5OHFyb7sW+g+nDSY8kb/0t3zNb7oeB62AP4u2EvPy7A9OHiR69XUZ4pm0shyfXwqcYZfhhw+HATpOrTkG96rd0C0tbDqxLHnA83wZwHnSEFj+rmnaqxZzhqeniVe4GbDz8hTl4RRT3482z+9WALwSgW+NUkTR8WovAqR4ofb0I/AFrNVg5ES4FfVSMvD6oxeYMkxeZL6NsRULZ1C0MtNPZtoqzzTsiNiywpNk/Cb9sx0GuqD0J3+FY09s37DnloTTQpNj9C346CqiXE8ON6eFeCPTyDJtpDlOLHi9C349CDpVvwyQXelQ2ecDfFOiwxpdh8CH07EFrNUHGBJ0Ftx9wLj3swDZap0goePH07FMqG0Aad5gn/el+8SFuYCRNX+u3EV/Xdv336MjS7gNMWeFgyfoZVwy7WyZZU0Q0dD1U7SMGmOaC6W9M8LLCTYw6V+NL4ICtRiJq534Kd0gSarsDHpvk4YBfoREXCFAOup2+QTnP6vZnBEWTiE9o7Nc1Px3qBL1IRY+oXqi+Z3EKyp2wHbXhxN+jv0vs38/RE3aQ30uBMuhuiEDdUEYBeOyWGlq7Ay1x6+TpRD8kip4g19QtOS7K6gSKI1Qx6F1TaGSZ06Hwzb7+gFipzbt6kHLA8a8M1MPRgBn1AaWcY0Z1azOcKqoZOmEfMSe8HR8kyzBWBXM0M7qFkn2FGZ3p+M69v0MmyDimdPPXUMJQh01xGoWwHqwsgWzvDkL60ZZ4/oO+wm/GJYk/6LTV7Zcg4dgnnawe9Cx3NrcCUjry3Zd4nkMEnokX9AEg9NVtlyDx1Cmm1gzkGjeWANd1wc7z2kHPTFqFF/QxIGsHOkzeAUOhQerCD0gWLeCuwpw/lSraTEfPQrHJn18+BFK9moby/CyJTBXY1O8CzCRHxNsOkDjxfSzgzZuEa1br8PiaS7tq+V72iUBLtFtxsCUguMCy3GVZ9oYX6xg3rN0o1/MWUdOrPg6SYwne5n/UCKvdJXYBfUyjJBYOcnrDs+kA6zyvdUYh/YtTEsyRX6qHf9yMjqed0tn3q/RTbWakxujCnZgnAffG/ZklPmHd9JZwj/1PYUyYO8zEn0ZxP/e6PtH/27F9XTtcZ/1WPMT9l2A7PtP7KUb/h/U27ZwQo6+J8Lea0PvGLffn7ZIFxriktB5jblNJaK97wAQ==";class Watermarker extends webgpu.Scene{viewer;camera;mesh;overlayPass;#t=!1;#r=null;constructor(t){super(),this.viewer=t,this.camera=new webgpu.OrthographicCamera(-1,1,1,-1,0,1),this.camera.position.z=.5,this.mesh=new webgpu.Mesh(new webgpu.PlaneGeometry(1.8,1.8),new webgpu.MeshBasicNodeMaterial({color:16777215,opacity:.5,transparent:!0})),this.add(this.mesh),this.overlayPass=tsl.pass(this,this.camera)}enable(){this.#t=!0,this.#i().then(t=>{this.#t&&(this.mesh.material.map!==t&&(this.mesh.material.map=t,this.mesh.material.needsUpdate=!0),this.viewer.renderPipeline.addOverlayPass(this.overlayPass))}).catch(t=>{this.#r=null,console.warn("u-space Watermarker: failed to load watermark texture.",t)})}disable(){this.#t=!1,this.viewer.renderPipeline.removeOverlayPass(this.overlayPass)}dispose(){this.disable(),this.overlayPass.dispose(),this.mesh.geometry.dispose(),this.mesh.material.dispose(),this.mesh.material.map?.dispose()}#i(){return this.mesh.material.map?Promise.resolve(this.mesh.material.map):(this.#r??=uSpace.TextureLoaderManager.loadAsyncTexture(logo).then(t=>(t.colorSpace=webgpu.SRGBColorSpace,t)),this.#r)}}const _m4=new webgpu.Matrix4;class SceneParser{viewer;path;manager;constructor(t,f,o){this.viewer=t,this.path=f,this.manager=o}async parseAsync(t,f,o){const d=new webgpu.Group,r=async(h,c=null)=>{const n=await this.parseTreeNode(h);if(n){const{id:a,sid:e}=h;this.viewer.objectManager.add(a,n),this.viewer.objectManager.add(e,n),f.add(a),f.add(e),c?c.add(n):d.add(n)}await Promise.all(h.children.map(a=>r(a,n)))};return await Promise.all(t.map(h=>r(h,d))),d}async parseTreeNode(t){const{name:f,renderType:o,path:d,visible:r,matrix:h,shape:c,extra:n}=t;let a=null;if(o==="3D"&&d){const e=this.path+d,u=new uSpace.Model;this.manager.itemStart(e),await u.loadAsync({url:e}),this.manager.itemEnd(e),a=u}else if(o==="GROUP"||o==="STUB")a=new webgpu.Group;else if(o==="POLYGON"&&c?.points){const e=uSpace.ShapeMesh.createFromPoints(c.points);e.material.color.set("blue"),e.material.transparent=!0,e.material.opacity=.5,a=e}else if(o==="CIRCLE"&&c?.radius){const e=new uSpace.CircleMesh({geometryParameters:{radius:c.radius}});e.material.color.set("blue"),e.material.transparent=!0,e.material.opacity=.5,a=e}else if(o==="AREA"||o==="FLOOR"||o==="ROOM"){const e=uSpace.ExtrudeMesh.createFromPoints(c?.points,{geometryParameters:{options:{depth:c?.depth,bevelEnabled:!1}}});e.material.color.set(n?.color??"blue"),e.material.transparent=!0,e.material.opacity=n?.opacity??.5,a=e}if(a){a.name=f,a.visible=r,_m4.fromArray(h).decompose(a.position,a.quaternion,a.scale);const u={...t};Reflect.deleteProperty(u,"children"),Object.assign(a.userData,u)}return a}}class SceneLoader extends webgpu.Loader{viewer;key="";cachedIds=new Set;_resourceData=null;_treeData=[];#t;constructor(t){super(),this.viewer=t,this.#t=new Watermarker(t),this.manager=new webgpu.LoadingManager}setKey(t){return this.key=t,this}async _preareTreeData(){if(!this.path)throw new Error("u-space SceneLoader: path is not set");const t=new BaseFileLoader(this),f=await t.loadAsync(META_DATA_FILE_PATH);if(f.version<1.5)throw new Error("u-space SceneLoader: Only support version 1.5 and above");if(!this.key&&f.authority==="OFFICIAL")throw new Error("u-space SceneLoader: options.key is required when authority is OFFICIAL");this.key&&f.authority==="TRIAL"&&console.warn("u-space SceneLoader: options.key is not used when authority is TRIAL");const o=await t.loadAsync(f.resource),d=this._resourceData!==o;if(this._resourceData=o,d)if(f.encryptWith==="DEBUG")try{this._treeData=decryptWithDebugKey(o),this.#t.enable()}catch{throw new Error("u-space SceneLoader: decrypt with debug key failed")}else if(f.encryptWith==="SCENE"||f.encryptWith==="COMPANY")try{this._treeData=decryptWithKey(o,this.key)}catch{throw new Error("u-space SceneLoader: decrypt with authorized key failed")}else f.encryptWith||(this._treeData=o)}async loadAsync(t={}){if(!this.path)throw new Error("u-space SceneLoader: path is not set");this.manager.itemStart(this.path);try{return await this._preareTreeData(),await new SceneParser(this.viewer,this.path,this.manager).parseAsync(this._treeData,this.cachedIds,t)}catch(f){throw this.manager.itemError(this.path),f}finally{this.manager.itemEnd(this.path)}}clearCache(){this.cachedIds.forEach(t=>{this.viewer.objectManager.removeById(t)}),this.cachedIds.clear()}dispose(){this.clearCache(),this.#t.dispose()}}class AnimationsLoader extends webgpu.Loader{constructor(){super(),this.manager=new webgpu.LoadingManager}async loadAsync(){return await new BaseFileLoader(this).loadAsync(ANIMATIONS_DATA_FILE_PATH)}}class AnimationsParser extends webgpu.EventDispatcher{viewer;target;tweenSet;_initialTransformSymbol=Symbol("initialTransform");constructor(t,f){super(),this.viewer=t,this.target=f,this.tweenSet=new Set}initTransform(t){const{position:f,rotation:o,scale:d}=this.target,r=t??{x:f.x,y:f.y,z:f.z,rotationX:o.x,rotationY:o.y,rotationZ:o.z,scaleX:d.x,scaleY:d.y,scaleZ:d.z};return Reflect.set(this.target,this._initialTransformSymbol,r),r}getInitialTransform(){return Reflect.get(this.target,this._initialTransformSymbol)}async play(t){let f=this.getInitialTransform();f||(f=this.initTransform());for(let o=0;o<t.length;o++){let d=t[o-1];d||(d=f);const r=t[o],h=r.delay??0,c=r.duration??1e3,n=r.easing,a=r.repeat===-1?1/0:r.repeat??0,e=r.yoyo??!1;await uSpace.tweenAnimation(this.viewer,{...d},{...r},{delay:h,duration:c,mode:n,repeat:a,yoyo:e},(u,l)=>{const{x:v,y:b,z:m,rotationX:B,rotationY:E,rotationZ:S,scaleX:O,scaleY:D,scaleZ:$}=u;this.target.position.set(v,b,m),this.target.rotation.set(B,E,S),this.target.scale.set(O,D,$),this.dispatchEvent({type:"update",source:u,tween:l})},u=>{this.tweenSet.add(u),this.dispatchEvent({type:"start",tween:u})})}}stop(){this.tweenSet.forEach(t=>t.stop()),this.tweenSet.clear()}reset(){const t=this.getInitialTransform();if(t){const{x:f,y:o,z:d,rotationX:r,rotationY:h,rotationZ:c,scaleX:n,scaleY:a,scaleZ:e}=t;this.target.position.set(f,o,d),this.target.rotation.set(r,h,c),this.target.scale.set(n,a,e),this.viewer.render()}}dispose(){this.stop(),this.reset(),Reflect.deleteProperty(this.target,this._initialTransformSymbol)}}class TopologyParser{parse(t){const{name:f,position:o,rotation:d,scale:r,nodes:h,nodeRadius:c=.2,nodeColor:n="#0000ff",linkWidth:a=.1,linkColor:e=["#00ff00"]}=t,u=new uSpace.Topology({nodeRadius:c,nodeColor:n,edgeRadius:a,edgeColor:e[0],pathRadius:a+.05});return u.name=f,u.position.set(o.x,o.y,o.z),u.rotation.set(d.x,d.y,d.z),u.scale.set(r.x,r.y,r.z),h.forEach(l=>{const v=new webgpu.Vector3().copy(l.position);u.addNode(l.id,v)}),h.forEach(l=>{l.graphs.forEach(v=>{u.addEdge(l.id,v.targetNodeId)})}),u.renderGraph(),Object.assign(u.userData,t),u}}class TopologiesLoader extends webgpu.Loader{constructor(){super(),this.manager=new webgpu.LoadingManager}async loadAsync(){if(!this.path)throw new Error("u-manager TopologiesLoader: path is not set");const f=await new BaseFileLoader(this).loadAsync(TOPOLOGY_DATA_FILE_PATH),o=new TopologyParser,d=[];return f.forEach(r=>{const h=o.parse(r);d.push(h)}),d}}class PropertiesLoader extends webgpu.Loader{constructor(){super(),this.manager=new webgpu.LoadingManager}async loadAsync(){return await new BaseFileLoader(this).loadAsync(PROPERTIES_DATA_FILE_PATH)}}class VisionsLoader extends webgpu.Loader{constructor(){super(),this.manager=new webgpu.LoadingManager}async loadAsync(){return await new BaseFileLoader(this).loadAsync(VISIONS_DATA_FILE_PATH)}}class VisionsParser{viewer;constructor(t){this.viewer=t}async flyToPrimary(t,f=!0){const o=t.find(d=>d.primary);return o?(await this.flyTo(o,f),!0):!1}async flyTo(t,f=!0){const{camera:o,position:d,target:r,zoom:h=this.viewer.camera.zoom}=t;o==="P"?this.viewer.setCameraByType("perspective"):o==="O"&&this.viewer.setCameraByType("orthographic");const{x:c,y:n,z:a}=d,{x:e,y:u,z:l}=r;await Promise.all([this.viewer.controls.setLookAt(c,n,a,e,u,l,f),this.viewer.controls.zoomTo(h,f)])}}const PLANISH_SCALE_Y=.01,SEMANTIC_RENDER_OFFSETS={Walls:0,Columns:.006,Spaces:-.006,Doors:.01,Windows:.01,Staircases:.012},SEMANTIC_DRAW_ORDER={Spaces:0,Staircases:1,Walls:2,Columns:3,Doors:4,Windows:5},SPACE_RENDER_OFFSET_JITTER_MIN=.001,SPACE_RENDER_OFFSET_JITTER=.006,_box=new webgpu.Box3,_pivot=new webgpu.Vector3,_raycastHits=[],_dummyPosition=new webgpu.Vector3,_dummyQuaternion=new webgpu.Quaternion,_dummyScale=new webgpu.Vector3,_boundsMatrix=new webgpu.Matrix4,_boundsSphere=new webgpu.Sphere;function getStateTextureSize(s,t=1){return Math.max(1,Math.ceil(Math.sqrt(Math.max(1,s*t))))}function getMatrixTextureSize(s){const t=Math.sqrt(Math.max(1,s)*4);return Math.max(4,Math.ceil(t/4)*4)}function createStateTexture(s){const t=new webgpu.DataTexture(new Float32Array(s*s*4),s,s,webgpu.RGBAFormat,webgpu.FloatType);return t.magFilter=webgpu.NearestFilter,t.minFilter=webgpu.NearestFilter,t.generateMipmaps=!1,t.needsUpdate=!0,t}function getStableRenderOffsetUnit(s){let t=2166136261;for(let f=0;f<s.length;f++)t^=s.charCodeAt(f),t=Math.imul(t,16777619);return(t>>>0)/4294967295}function getSemanticRenderOffset(s){const t=SEMANTIC_RENDER_OFFSETS[s.kind];return s.kind!=="Spaces"?t:t-SPACE_RENDER_OFFSET_JITTER_MIN-getStableRenderOffsetUnit(`${s.id}:${s.index}`)*SPACE_RENDER_OFFSET_JITTER}function copyAttributeComponents(s,t,f,o){for(let d=0;d<f;d++)o.push(s?.getComponent(t,d)??0)}function createSemanticMaterial(s,t,f,o){const d=tsl.attribute("semanticIndex","float").toInt(),r=m=>tsl.int(tsl.textureSize(tsl.textureLoad(m),tsl.int(0)).x).toConst(),h=m=>{const B=r(m),E=d.mod(B).toConst(),S=d.div(B).toConst();return tsl.textureLoad(m,tsl.ivec2(E,S))},c=()=>{const m=r(f),B=d.mul(4).toConst(),E=B.mod(m).toConst(),S=B.div(m).toConst();return tsl.mat4(tsl.textureLoad(f,tsl.ivec2(E,S)),tsl.textureLoad(f,tsl.ivec2(E.add(1),S)),tsl.textureLoad(f,tsl.ivec2(E.add(2),S)),tsl.textureLoad(f,tsl.ivec2(E.add(3),S)))},n=h(s),a=h(t).x,e=h(o).x,u=c(),l=u.mul(tsl.vec4(tsl.positionLocal,1)).xyz,v=tsl.transformNormal(tsl.normalLocal,u).normalize(),b=new webgpu.MeshStandardNodeMaterial({transparent:!0,depthWrite:!0});return b.colorNode=tsl.vec4(n.rgb,1),b.opacityNode=n.a.mul(a),b.maskNode=a.greaterThan(.5).and(n.a.greaterThan(.001)),b.positionNode=l.add(v.mul(e)),b}function copySemanticColor(s,t){if(s instanceof webgpu.Color){t.x=s.r,t.y=s.g,t.z=s.b;return}t.x=s.x,t.y=s.y,t.z=s.z,s instanceof webgpu.Vector4&&(t.w=s.w)}function buildMergedSemanticGeometry(s){const t=[...s].sort((a,e)=>SEMANTIC_DRAW_ORDER[a.kind]-SEMANTIC_DRAW_ORDER[e.kind]),f=[],o=[],d=[],r=[],h=[],c=[];t.forEach((a,e)=>{const u=a.geometry,l=u.getAttribute("position"),v=u.getAttribute("normal"),b=u.getAttribute("uv"),m=u.getIndex();if(!l)return;u.computeBoundingBox(),_box.copy(u.boundingBox??_box.makeEmpty()),_box.getCenter(_pivot),_pivot.y=_box.min.y;const B=f.length/3,E=[],S=[],O=[],D=[];for(let Y=0;Y<l.count;Y++){const ie=l.getX(Y)-_pivot.x,ne=l.getY(Y)-_pivot.y,de=l.getZ(Y)-_pivot.z;f.push(ie,ne,de),E.push(ie,ne,de),r.push(e),copyAttributeComponents(v,Y,3,o),copyAttributeComponents(v,Y,3,S),copyAttributeComponents(b,Y,2,d),copyAttributeComponents(b,Y,2,O)}if(m)for(let Y=0;Y<m.count;Y++){const ie=m.getX(Y);h.push(B+ie),D.push(ie)}else for(let Y=0;Y<l.count;Y++)h.push(B+Y),D.push(Y);const $=new webgpu.BufferGeometry;$.setAttribute("position",new webgpu.Float32BufferAttribute(E,3)),v&&$.setAttribute("normal",new webgpu.Float32BufferAttribute(S,3)),b&&$.setAttribute("uv",new webgpu.Float32BufferAttribute(O,2)),$.setIndex(D),$.computeBoundingBox(),$.computeBoundingSphere();const H=new webgpu.Matrix4().makeTranslation(_pivot.x,_pivot.y,_pivot.z);c.push({id:a.id,kind:a.kind,name:a.name,index:e,baseMatrix:H,matrix:new webgpu.Matrix4,finalMatrix:H.clone(),geometry:$,color:a.color.clone(),visible:!0})});const n=new webgpu.BufferGeometry;return n.setAttribute("position",new webgpu.Float32BufferAttribute(f,3)),o.length>0&&n.setAttribute("normal",new webgpu.Float32BufferAttribute(o,3)),d.length>0&&n.setAttribute("uv",new webgpu.Float32BufferAttribute(d,2)),n.setAttribute("semanticIndex",new webgpu.Float32BufferAttribute(r,1)),n.setIndex(h),n.computeBoundingBox(),n.computeBoundingSphere(),{geometry:n,states:c}}class FloorMesh extends uSpace.BaseMesh{isFloorMergedSemanticMesh=!0;type="FloorMesh";boundingBox=null;boundingSphere=null;wallsInstances=new Map;columnsInstances=new Map;spacesInstances=new Map;doorsInstances=new Map;windowsInstances=new Map;staircasesInstances=new Map;semanticInstances=new Map;#t;#r;#i;#a;#o;#s;#n;constructor(t){const{geometry:f,states:o}=buildMergedSemanticGeometry(t),d=getStateTextureSize(o.length),r=getMatrixTextureSize(o.length),h=createStateTexture(d),c=createStateTexture(d),n=createStateTexture(r),a=createStateTexture(d),e=createSemanticMaterial(h,c,n,a);super(f,e),this.#r=o,this.#t={Walls:this.wallsInstances,Columns:this.columnsInstances,Spaces:this.spacesInstances,Doors:this.doorsInstances,Windows:this.windowsInstances,Staircases:this.staircasesInstances},this.#i=h,this.#a=c,this.#o=n,this.#s=a,this.#n=new webgpu.Mesh,this.#n.matrixAutoUpdate=!1,this.frustumCulled=!1,this.#r.forEach(u=>{this.semanticInstances.set(u.id,u.index),this.#t[u.kind].set(u.id,u.index),this.#f(u.index),this.#d(u.index),this.#u(u.index),this.#p(u.index)}),this.userData.semanticEntries=this.#r.map(({id:u,kind:l,name:v,index:b})=>({id:u,kind:l,name:v,index:b}))}planish(t){return this.#h(t,f=>this.setScaleYAt(f,PLANISH_SCALE_Y)),this}unplanish(t){return this.#h(t,f=>this.setScaleYAt(f,1)),this}get semanticCount(){return this.#r.length}get instanceCount(){return this.semanticCount}getSemanticIndexById(t){return this.semanticInstances.get(t)}getSemanticIdAt(t){return this.#e(t).id}getSemanticKindAt(t){return this.#e(t).kind}getSemanticNameAt(t){return this.#e(t).name}setColorAt(t,f){const o=this.#e(t);return copySemanticColor(f,o.color),this.#f(t),this}getColorAt(t,f=new webgpu.Vector4){const o=this.#e(t).color;return f.copy(o),f}setOpacityAt(t,f){const o=this.#e(t);return o.color.w=Math.max(0,Math.min(1,f)),this.#f(t),this}getOpacityAt(t){return this.#e(t).color.w}setVisibleAt(t,f){const o=this.#e(t);return o.visible=f,this.#d(t),this}getVisibleAt(t){return this.#e(t).visible}setMatrixAt(t,f){const o=this.#e(t);return o.matrix.copy(f),o.finalMatrix.multiplyMatrices(o.baseMatrix,o.matrix),this.#c(),this.#u(t),this}setScaleAt(t,f,o,d){return this.#l(t,r=>{f instanceof webgpu.Vector3?r.copy(f):r.set(f,o??f,d??f)})}setScaleYAt(t,f){return this.#l(t,o=>{o.y=f})}getMatrixAt(t,f=new webgpu.Matrix4){return f.copy(this.#e(t).matrix),f}getFinalMatrixAt(t,f=new webgpu.Matrix4){return f.copy(this.#e(t).finalMatrix),f}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new webgpu.Box3),this.boundingBox.makeEmpty();for(const t of this.#r)this.getBoundingBoxAt(t.index,_box,!1)&&this.boundingBox.union(_box)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new webgpu.Sphere),this.boundingSphere.makeEmpty();for(const t of this.#r)this.getBoundingSphereAt(t.index,_boundsSphere,!1)&&this.boundingSphere.union(_boundsSphere)}getBoundingBoxAt(t,f=new webgpu.Box3,o=!0){const d=this.#e(t);return d.geometry.boundingBox||d.geometry.computeBoundingBox(),d.geometry.boundingBox?(f.copy(d.geometry.boundingBox).applyMatrix4(d.finalMatrix),o&&(this.updateWorldMatrix(!0,!1),f.applyMatrix4(this.matrixWorld)),f):null}getBoundingSphereAt(t,f=new webgpu.Sphere,o=!0){const d=this.#e(t);return d.geometry.boundingSphere||d.geometry.computeBoundingSphere(),d.geometry.boundingSphere?(f.copy(d.geometry.boundingSphere),o?(this.updateWorldMatrix(!0,!1),_boundsMatrix.multiplyMatrices(this.matrixWorld,d.finalMatrix),f.applyMatrix4(_boundsMatrix)):f.applyMatrix4(d.finalMatrix),f):null}raycast(t,f){if(this.visible===!1&&this.ignoreInvisibleWhenRaycast===!0)return!1;this.updateWorldMatrix(!0,!1),this.#n.material=this.material;for(const o of this.#r)if(!(!o.visible||o.color.w<=.001)){this.#n.geometry=o.geometry,this.#n.matrixWorld.multiplyMatrices(this.matrixWorld,o.finalMatrix),_raycastHits.length=0,this.#n.raycast(t,_raycastHits);for(const d of _raycastHits){const r=d;r.object=this,r.instanceId=o.index,r.semanticId=o.id,r.semanticKind=o.kind,r.semanticName=o.name,r.semanticIndex=o.index,f.push(r)}}}dispose(){this.geometry.dispose(),Array.isArray(this.material)?this.material.forEach(t=>t.dispose()):this.material.dispose(),this.#i.dispose(),this.#a.dispose(),this.#o.dispose(),this.#s.dispose(),this.#r.forEach(t=>t.geometry.dispose())}#e(t){const f=this.#r[t];if(!f)throw new Error(`u-space FloorMesh: invalid semantic index ${t}.`);return f}#c(){this.boundingBox=null,this.boundingSphere=null}#h(t,f){if(t===void 0){this.#r.forEach(o=>f(o.index));return}for(const o of this.#t[t].values())f(o)}#l(t,f){const o=this.#e(t);return o.matrix.decompose(_dummyPosition,_dummyQuaternion,_dummyScale),f(_dummyScale),o.matrix.compose(_dummyPosition,_dummyQuaternion,_dummyScale),o.finalMatrix.multiplyMatrices(o.baseMatrix,o.matrix),this.#c(),this.#u(t),this}#f(t){this.#e(t).color.toArray(this.#i.image.data,t*4),this.#i.needsUpdate=!0}#d(t){const f=this.#e(t),o=this.#a.image.data;o[t*4]=f.visible?1:0,o[t*4+1]=0,o[t*4+2]=0,o[t*4+3]=1,this.#a.needsUpdate=!0}#u(t){this.#e(t).finalMatrix.toArray(this.#o.image.data,t*16),this.#o.needsUpdate=!0}#p(t){const f=this.#e(t),o=this.#s.image.data;o[t*4]=getSemanticRenderOffset(f),o[t*4+1]=0,o[t*4+2]=0,o[t*4+3]=1,this.#s.needsUpdate=!0}}class VerticalShaftMeshError extends Error{constructor(t){super(t),this.name="VerticalShaftMeshError"}}const VERTICAL_SHAFT_RENDER_OFFSET=-.006;function getValidPolygonShape$1(s,t,f){if(!Array.isArray(s)||s.length<4||s.length%2!==0)throw new VerticalShaftMeshError(`u-space SemanticLoader: invalid ${t} polygon shape for id ${f}.`);return s}function createShape(s){const t=[];for(let f=0;f<s.length;f+=2)t.push(new webgpu.Vector2(s[f],-s[f+1]));return new webgpu.Shape(t)}function getVerticalShaftRange(s){const t=Number(s.Elevation??0),f=Number(s.TotalHeight);if(!Number.isFinite(t)||!Number.isFinite(f)||f<=0)throw new VerticalShaftMeshError(`u-space SemanticLoader: invalid vertical shaft height range for id ${s.ID}.`);const o=t+f;return{bottom:t,top:o,height:f}}function createVerticalShaftMesh(s){try{return s()}catch(t){if(t instanceof VerticalShaftMeshError)return console.warn(t.message),null;throw t}}class VerticalShaftMesh extends uSpace.ExtrudeMesh{isVerticalShaftMesh=!0;type="VerticalShaftMesh";shaft;semanticId;semanticKind;semanticName;bottom;top;height;constructor({shaft:t,kind:f,material:o}){const d=getValidPolygonShape$1(t.Polygon?.shape,f,t.ID),r=getVerticalShaftRange(t);super({geometryParameters:{shape:createShape(d),options:{depth:r.height,bevelEnabled:!1}},materialParameters:{color:o.color,opacity:o.opacity,transparent:o.opacity<1,depthWrite:!0}}),this.shaft=t,this.semanticId=t.ID,this.semanticKind=f,this.semanticName=t.Name||"",this.bottom=r.bottom,this.top=r.top,this.height=r.height,this.name=this.semanticName,this.position.y=this.bottom,this.material.positionNode=tsl.positionLocal.add(tsl.normalLocal.mul(VERTICAL_SHAFT_RENDER_OFFSET)),this.userData.id=this.semanticId,this.userData.semanticKind=f,this.userData.beginFloorIndex=t.BeginFloorIndex,this.userData.endFloorIndex=t.EndFloorIndex,this.userData.bottom=this.bottom,this.userData.top=this.top}}const ELEVATOR_MATERIAL={color:7305093,opacity:.7};class ElevatorMesh extends VerticalShaftMesh{isElevatorMesh=!0;type="ElevatorMesh";constructor(t){super({shaft:t,kind:"Elevators",material:ELEVATOR_MATERIAL})}static create(t){return createVerticalShaftMesh(()=>new ElevatorMesh(t))}}const VENT_MATERIAL={color:6924429,opacity:.55};class VentMesh extends VerticalShaftMesh{isVentMesh=!0;type="VentMesh";constructor(t){super({shaft:t,kind:"Vents",material:VENT_MATERIAL})}static create(t){return createVerticalShaftMesh(()=>new VentMesh(t))}}class BuildingGroup extends uSpace.BaseGroup{isBuildingGroup=!0;type="BuildingGroup";floorMeshes=[];elevatorMeshes=[];ventMeshes=[];constructor(){super()}addFloor(t){return this.floorMeshes.includes(t)||(this.add(t),this.floorMeshes.push(t)),this}getFloorAt(t){return this.floorMeshes[t]}removeFloor(t){const f=this.floorMeshes.indexOf(t);return f!==-1&&this.floorMeshes.splice(f,1),this.remove(t),this}addElevator(t){return this.elevatorMeshes.includes(t)||(this.add(t),this.elevatorMeshes.push(t)),this}getElevatorAt(t){return this.elevatorMeshes[t]}removeElevator(t){const f=this.elevatorMeshes.indexOf(t);return f!==-1&&this.elevatorMeshes.splice(f,1),this.remove(t),this}addVent(t){return this.ventMeshes.includes(t)||(this.add(t),this.ventMeshes.push(t)),this}getVentAt(t){return this.ventMeshes[t]}removeVent(t){const f=this.ventMeshes.indexOf(t);return f!==-1&&this.ventMeshes.splice(f,1),this.remove(t),this}isolateFloor(t){const f=typeof t=="number"?this.getFloorAt(t):t;if(!f||!this.floorMeshes.includes(f))throw new Error("u-space BuildingGroup: the floor is not in this building group.");return this.floorMeshes.forEach(o=>{o.visible=o===f}),this}showAllFloors(){return this.floorMeshes.forEach(t=>{t.visible=!0}),this}planishFloors(t){return this.floorMeshes.forEach(f=>f.planish(t)),this}unplanishFloors(t){return this.floorMeshes.forEach(f=>f.unplanish(t)),this}}const SEMANTIC_INITIAL_COLORS={Walls:new webgpu.Vector4(.86,.86,.82,1),Columns:new webgpu.Vector4(.62,.65,.68,1),Spaces:new webgpu.Vector4(.36,.7,.5,.45),Doors:new webgpu.Vector4(.9,.52,.2,1),Windows:new webgpu.Vector4(.28,.62,.95,.65),Staircases:new webgpu.Vector4(.58,.55,.5,1)},STAIRCASE_WIDTH=1.2,STAIRCASE_STEP_HEIGHT=.16,STAIRCASE_LANDING_THICKNESS=.04,STAIRCASE_EPSILON=1e-5,STAIRCASE_MITER_LIMIT=3;function getInitialColor(s){return SEMANTIC_INITIAL_COLORS[s].clone()}function getValidPolygonShape(s,t,f){return!Array.isArray(s)||s.length<4||s.length%2!==0?(console.warn(`u-space SemanticLoader: invalid ${t} polygon shape for id ${f}.`),null):s}function convertToPlaneIVector2(s){const t=[];for(let f=0;f<s.length;f+=2)t.push({x:s[f],z:s[f+1]});return t}function parseStaircasePolyline(s){const t=s.Polyline;if(!Array.isArray(t)||t.length<6||t.length%3!==0)return console.warn(`u-space SemanticLoader: invalid Staircases polyline for id ${s.ID}.`),null;const f=[];for(let o=0;o<t.length;o+=3){const d={x:Number(t[o]),y:Number(t[o+1]),z:Number(t[o+2])};if(!Number.isFinite(d.x)||!Number.isFinite(d.y)||!Number.isFinite(d.z))return console.warn(`u-space SemanticLoader: invalid Staircases polyline point for id ${s.ID}.`),null;f.push(d)}return f}function createStaircaseSegments(s){const t=[];for(let f=0;f<s.length-1;f++){const o=s[f],d=s[f+1],r=d.x-o.x,h=d.z-o.z,c=Math.hypot(r,h);if(c<=STAIRCASE_EPSILON)continue;const n=r/c,a=h/c;t.push({start:o,end:d,length:c,dirX:n,dirZ:a,normalX:-a,normalZ:n})}return t}function createCapSection(s,t,f){return{leftX:t.x+s.normalX*f,leftZ:t.z+s.normalZ*f,rightX:t.x-s.normalX*f,rightZ:t.z-s.normalZ*f}}function cross2(s,t,f,o){return s*o-t*f}function getFallbackJoinPoint(s,t,f,o,d){let r=s.normalX+t.normalX,h=s.normalZ+t.normalZ,c=Math.hypot(r,h);c<=STAIRCASE_EPSILON&&(r=t.normalX,h=t.normalZ,c=1);const n=o*d/c;return{x:f.x+r*n,z:f.z+h*n}}function getMiterJoinPoint(s,t,f,o,d){const r=f.x+s.normalX*o*d,h=f.z+s.normalZ*o*d,c=f.x+t.normalX*o*d,n=f.z+t.normalZ*o*d,a=cross2(s.dirX,s.dirZ,t.dirX,t.dirZ);if(Math.abs(a)<=STAIRCASE_EPSILON)return{x:r,z:h};const e=cross2(c-r,n-h,t.dirX,t.dirZ)/a,u=r+s.dirX*e,l=h+s.dirZ*e,v=Math.hypot(u-f.x,l-f.z);return!Number.isFinite(v)||v>d*STAIRCASE_MITER_LIMIT?getFallbackJoinPoint(s,t,f,o,d):{x:u,z:l}}function createJoinSection(s,t,f,o){const d=getMiterJoinPoint(s,t,f,1,o),r=getMiterJoinPoint(s,t,f,-1,o);return{leftX:d.x,leftZ:d.z,rightX:r.x,rightZ:r.z}}function interpolateSection(s,t,f){return{leftX:s.leftX+(t.leftX-s.leftX)*f,leftZ:s.leftZ+(t.leftZ-s.leftZ)*f,rightX:s.rightX+(t.rightX-s.rightX)*f,rightZ:s.rightZ+(t.rightZ-s.rightZ)*f}}function addQuad(s,t,f,o,d){s.push(t,f,o,t,o,d)}function addStaircasePrism(s,t,f,o,d,r,h,c){if(o-f<=STAIRCASE_EPSILON)return;const n=d.length/3;d.push(s.leftX,f,s.leftZ,t.leftX,f,t.leftZ,t.rightX,f,t.rightZ,s.rightX,f,s.rightZ,s.leftX,o,s.leftZ,t.leftX,o,t.leftZ,t.rightX,o,t.rightZ,s.rightX,o,s.rightZ),addQuad(r,n+4,n+5,n+6,n+7),addQuad(r,n+0,n+3,n+2,n+1),addQuad(r,n+0,n+1,n+5,n+4),addQuad(r,n+2,n+3,n+7,n+6),h&&addQuad(r,n+3,n+0,n+4,n+7),c&&addQuad(r,n+1,n+2,n+6,n+5)}function createStaircaseGeometry(s){const t=parseStaircasePolyline(s),f=Number(s.Elevation??0);if(!t||!Number.isFinite(f))return Number.isFinite(f)||console.warn(`u-space SemanticLoader: invalid Staircases elevation for id ${s.ID}.`),null;const o=createStaircaseSegments(t);if(o.length===0)return console.warn(`u-space SemanticLoader: empty Staircases geometry for id ${s.ID}.`),null;const d=STAIRCASE_WIDTH/2,r=[],h=[];if(o.forEach((n,a)=>{const e=o[a-1],u=o[a+1],l=e?createJoinSection(e,n,n.start,d):createCapSection(n,n.start,d),v=u?createJoinSection(n,u,n.end,d):createCapSection(n,n.end,d),b=n.end.y-n.start.y;if(Math.abs(b)<=STAIRCASE_EPSILON){const S=f+n.start.y;addStaircasePrism(l,v,S-STAIRCASE_LANDING_THICKNESS,S,r,h,!e,!u);return}const B=Math.max(1,Math.round(Math.abs(b)/STAIRCASE_STEP_HEIGHT)),E=Math.abs(b)/B;for(let S=0;S<B;S++){const O=b>0,D=O?S/B:1-(S+1)/B,$=O?(S+1)/B:1-S/B,H=interpolateSection(l,v,D),Y=interpolateSection(l,v,$),ie=f+(O?n.start.y:n.end.y)+E*(S+1),ne=ie-E;addStaircasePrism(H,Y,ne,ie,r,h,!0,a===o.length-1&&S===B-1)}}),r.length===0)return console.warn(`u-space SemanticLoader: empty Staircases geometry for id ${s.ID}.`),null;const c=new webgpu.BufferGeometry;return c.setAttribute("position",new webgpu.Float32BufferAttribute(r,3)),c.setIndex(h),c.computeVertexNormals(),c.computeBoundingBox(),c.computeBoundingSphere(),c.userData.id=s.ID,c}class SemanticParser{parse(t){const f=[];return t.Buildings?.forEach(o=>{const d=new BuildingGroup;d.name=o.Name||"",d.userData.id=o.ID,o.Stories.forEach(r=>{const h=t.Stories?.[r];if(h&&h.ID){const c=[];if(h.Walls?.forEach(a=>{const e=t.Walls?.[a];if(!e||!e.Polygon)return;const u=getValidPolygonShape(e.Polygon.shape,"Walls",e.ID);if(!u)return;const l=uSpace.ExtrudeMesh.createFromPoints(convertToPlaneIVector2(u),{geometryParameters:{options:{depth:e.Height,bevelEnabled:!1}}}).geometry;l.translate(0,e.Elevation,0),l.userData.id=e.ID,c.push({id:e.ID,kind:"Walls",geometry:l,color:getInitialColor("Walls")})}),h.Columns?.forEach(a=>{const e=t.Columns?.[a];if(!e||!e.Polygon)return;const u=getValidPolygonShape(e.Polygon.shape,"Columns",e.ID);if(!u)return;const l=uSpace.ExtrudeMesh.createFromPoints(convertToPlaneIVector2(u),{geometryParameters:{options:{depth:e.Height,bevelEnabled:!1}}}).geometry;l.translate(0,e.Elevation,0),l.userData.id=e.ID,c.push({id:e.ID,kind:"Columns",geometry:l,color:getInitialColor("Columns")})}),h.Doors?.forEach(a=>{const e=t.Doors?.[a];if(!e||!e.Polygon)return;const u=getValidPolygonShape(e.Polygon.shape,"Doors",e.ID);if(!u)return;const l=uSpace.ExtrudeMesh.createFromPoints(convertToPlaneIVector2(u),{geometryParameters:{options:{depth:e.Height,bevelEnabled:!1}}}).geometry;l.translate(0,e.Elevation,0),l.userData.id=e.ID,c.push({id:e.ID,kind:"Doors",geometry:l,color:getInitialColor("Doors")})}),h.Windows?.forEach(a=>{const e=t.Windows?.[a];if(!e||!e.Polygon)return;const u=getValidPolygonShape(e.Polygon.shape,"Windows",e.ID);if(!u)return;const l=uSpace.ExtrudeMesh.createFromPoints(convertToPlaneIVector2(u),{geometryParameters:{options:{depth:e.Height,bevelEnabled:!1}}}).geometry;l.translate(0,e.Elevation,0),l.userData.id=e.ID,c.push({id:e.ID,kind:"Windows",geometry:l,color:getInitialColor("Windows")})}),h.Spaces?.forEach(a=>{const e=t.Spaces?.[a];if(!e||!e.Polygon)return;const u=getValidPolygonShape(e.Polygon.shape,"Spaces",e.ID);if(!u)return;const l=e.CeilingHeight-e.GroundHeight,v=uSpace.ExtrudeMesh.createFromPoints(convertToPlaneIVector2(u),{geometryParameters:{options:{depth:l,bevelEnabled:!1}}}).geometry;v.translate(0,e.GroundHeight,0),v.userData.id=e.ID,c.push({id:e.ID,kind:"Spaces",name:e.Name,geometry:v,color:getInitialColor("Spaces")})}),h.Staircases?.forEach(a=>{const e=t.Staircases?.[a];if(!e)return;const u=createStaircaseGeometry(e);u&&(u.userData.storyId=h.ID,u.userData.floorIndex=h.FloorIndex,c.push({id:e.ID,kind:"Staircases",geometry:u,color:getInitialColor("Staircases")}))}),c.length===0)return;const n=new FloorMesh(c);n.name=h.Name||"",n.userData.id=h.ID,n.pivot=new webgpu.Vector3(0,h.Elevation||0,0),d.addFloor(n)}}),o.Elevators?.forEach(r=>{const h=t.Elevators?.[r];if(!h)return;const c=ElevatorMesh.create(h);c&&d.addElevator(c)}),o.Vents?.forEach(r=>{const h=t.Vents?.[r];if(!h)return;const c=VentMesh.create(h);c&&d.addVent(c)}),f.push(d)}),f}}class SemanticLoader extends webgpu.Loader{viewer;constructor(t){super(),this.viewer=t,this.manager=new webgpu.LoadingManager}async loadAsync(){if(!this.path)throw new Error("u-space SemanticLoader: path is not set");this.manager.itemStart(this.path);try{const f=await new BaseFileLoader(this).loadAsync(SEMANTIC_DATA_FILE_PATH);return new SemanticParser().parse(f)}catch(t){throw this.manager.itemError(this.path),t}finally{this.manager.itemEnd(this.path)}}}class Edge{id;source;target;sourceHandle;constructor(t){this.id=t.id,this.source=t.source,this.target=t.target,this.sourceHandle=t.sourceHandle}}function objectHandle(s,t){return Array.isArray(s)?s.map(t):t(s)}function sleep(s){return new Promise(t=>setTimeout(t,s))}function parseNodeByType(s,t){switch(t.type){case"START":return new StartNode(s,t);case"COLOR":return new ColorNode(s,t);case"NUMBER":return new NumberNode(s,t);case"HIGHLIGHT":return new HighlightNode(s,t);case"UN_HIGHLIGHT":return new UnHighlightNode(s,t);case"OPACITY":return new OpacityNode(s,t);case"UN_OPACITY":return new UnOpacityNode(s,t);case"EMISSIVE":return new EmissiveNode(s,t);case"UN_EMISSIVE":return new UnEmissiveNode(s,t);case"MESH":return new MeshNode(s,t);case"MESHES":return new MeshesNode(s,t);case"MODEL":return new ModelNode(s,t);case"MODELS":return new ModelsNode(s,t);case"SPACE":return new SpaceNode(s,t);case"SPACES":return new SpacesNode(s,t);case"POIS":return new POIsNode(s,t);case"POI":return new POINode(s,t);case"PATH":return new PathNode(s,t);case"PATHS":return new PathsNode(s,t);case"DELAY":return new DelayNode(s,t);case"CONDITION_NODE":return new ConditionNode(s,t);case"SHOW":return new ShowNode(s,t);case"HIDE":return new HideNode(s,t);case"CLIP_ANIMATION":return new ClipAnimationNode(s,t);case"UN_CLIP_ANIMATION":return new UnClipAnimationNode(s,t);case"TWEEN_ANIMATION":return new TweenAnimationNode(s,t);case"UN_TWEEN_ANIMATION":return new UnTweenAnimationNode(s,t);case"COMPONENT_TWEEN_ANIMATION":return new ComponentTweenAnimationNode(s,t);case"UN_COMPONENT_TWEEN_ANIMATION":return new UnComponentTweenAnimationNode(s,t);case"TRANSLATE":return new TranslateNode(s,t);case"ROTATE":return new RotateNode(s,t);case"SCALE":return new ScaleNode(s,t);case"FLY_TO":return new FlyToNode(s,t);case"DATA_EXTRACTION":return new DataExtractionNode(s,t);case"DATA_FILTER":return new DataFilterNode(s,t);case"USER_DATA_NODE":return new UserDataNode(s,t);default:return new Node(s,t)}}function parseValue(s){return JSON.parse(s)}async function waitFor(s,t){t?await s():s()}function getObjectByIds(s,t){return t.map(f=>s.objectManager.getById(f)).filter(Boolean)}function getObjectById(s,t,f){const o=s.objectManager.getById(t);if(o)return o;{const d=s.scene;return getMeshByUserDataUuid(f??d,t)}}function getMeshByUserDataUuid(s,t){if(s.userData.key===t||s.uuid===t)return s;for(let f=0,o=s.children.length;f<o;f++){const d=s.children[f],r=getMeshByUserDataUuid(d,t);if(r!==null)return r}return null}let count=0;const preloadNodes=["MESH","MESHES","MODEL","MODELS","POI","POIS","SPACE","SPACES","PATH","PATHS","COLOR","NUMBER","DATA_EXTRACTION","DATA_FILTER","USER_DATA_NODE","CONDITION_NODE","START"];class Node{parser;viewer;id;type;props;prevNodes=[];postNodes=[];execOrder=0;ctx;promise;resolve;reject;cleanSets=new Set;onBefore=null;onAfter=null;rejected;constructor(t,f){this.parser=t,this.viewer=t.viewer,this.id=f.id,this.type=f.type,this.props=f.props,this.rejected=!1,this.init()}init(){this.ctx={},this.promise=new Promise((t,f)=>{this.resolve=t,this.reject=o=>{this.rejected=!0,f(o)}})}readContext(t){return this.ctx[t]}writeContext(t,f){this.ctx[t]=f}findProp(t,f){if(f instanceof Array)for(const o of f){const d=this.findProp(t,o);if(d)return d}else return this.props.find(o=>o.name===t&&o.type===f)}async waitForPrevNodes(){return await Promise.all(this.prevNodes.map(t=>t.promise))}mergeContext(){this.prevNodes.forEach(t=>{Object.assign(this.ctx,t.ctx)}),this._mergeUserDataMap()}async exec(t){}async run(t,f={preload:!1}){const{preload:o}=f;try{if(await this.waitForPrevNodes(),this.rejected)throw new Error;this.mergeContext(),await(this.onBefore??this.parser.onNodeBefore)?.(this);try{(!o||preloadNodes.includes(this.type))&&(this.execOrder=++count,await this.exec(t))}catch(d){throw this.reject(d),d}await(this.onAfter??this.parser.onNodeAfter)?.(this),this.resolve()}catch(d){this.reject(d)}}cleanup(){this.cleanSets.forEach(t=>t()),this.cleanSets.clear()}getValue(t,f){if(t.type==="READ_CTX")return this.readContext(parseValue(t.value));if(t.type==="LOCAL"){const{scene:o}=this.viewer;return t.name==="objects"||t.name==="models"||t.name==="meshs"?parseValue(t.value).map(d=>getObjectById(this.viewer,d,f??o)):t.name==="object"||t.name==="model"||t.name==="mesh"?getObjectById(this.viewer,parseValue(t.value),f??o):parseValue(t.value)}}_mergeUserDataMap(){if(this.prevNodes.some(t=>t.ctx._userDataMap))this.ctx._userDataMap=new Map;else return;this.prevNodes.forEach(t=>{t.ctx._userDataMap&&t.ctx._userDataMap.forEach((f,o)=>{this.ctx._userDataMap.set(o,Object.assign({},f))})})}}class StartNode extends Node{constructor(t,f){super(t,f)}}class ColorNode extends Node{constructor(t,f){super(t,f)}async exec(){const t=this.findProp("color","LOCAL"),f=this.findProp("out","WRITE_CTX");t&&f&&this.writeContext(parseValue(f.value),parseValue(t.value))}}class NumberNode extends Node{constructor(t,f){super(t,f)}async exec(){const t=this.findProp("number","LOCAL"),f=this.findProp("out","WRITE_CTX");t&&f&&this.writeContext(parseValue(f.value),parseValue(t.value))}}class HighlightNode extends Node{constructor(t,f){super(t,f)}async exec(t){const f=this.findProp("objects",["READ_CTX","LOCAL"]),o=this.findProp("color",["READ_CTX","LOCAL"]),d=this.findProp("opacity",["READ_CTX","LOCAL"]),r=await t.getTarget?.(this);if(f&&o&&d){const h=this.getValue(f,r),c=this.getValue(o),n=this.getValue(d);h&&(index.MaterialEffects.highlightColor(h,{color:c,opacity:n}),this.cleanSets.add(()=>{index.MaterialEffects.removeHighlightColor(h)}))}}}class UnHighlightNode extends Node{constructor(t,f){super(t,f)}filterUnHighlightObject(t){const f=[];return objectHandle(t,o=>{f.push(o)}),f}async exec(t){const f=this.findProp("objects",["READ_CTX","LOCAL"]),o=await t.getTarget?.(this);if(f){const d=this.getValue(f,o);d&&uSpace.MaterialEffects.removeHighlightColor(d)}}}class OpacityNode extends Node{constructor(t,f){super(t,f)}async exec(t){const f=this.findProp("objects",["READ_CTX","LOCAL"]),o=this.findProp("color",["READ_CTX","LOCAL"]),d=this.findProp("opacity",["READ_CTX","LOCAL"]),r=await t.getTarget?.(this);if(f&&o&&d){const h=this.getValue(f,r),c=this.getValue(o),n=this.getValue(d);if(h){const a=objectHandle(h,e=>e);index.MaterialEffects.highlightColor(a,{color:c,opacity:n,overwrite:!0}),this.cleanSets.add(()=>{index.MaterialEffects.removeHighlightColor(a)})}}}}class UnOpacityNode extends Node{constructor(t,f){super(t,f)}async exec(t){const f=this.findProp("objects",["READ_CTX","LOCAL"]),o=await t.getTarget?.(this);if(f){const d=this.getValue(f,o);d&&uSpace.MaterialEffects.removeHighlightColor(d)}}}class EmissiveNode extends Node{constructor(t,f){super(t,f)}async exec(t){const f=this.findProp("objects",["READ_CTX","LOCAL"]),o=this.findProp("color",["READ_CTX","LOCAL"]),d=this.findProp("baseColor",["READ_CTX","LOCAL"]),r=this.findProp("minOpacity",["READ_CTX","LOCAL"]),h=this.findProp("maxOpacity",["READ_CTX","LOCAL"]),c=this.findProp("duration",["READ_CTX","LOCAL"]),n=await t.getTarget?.(this);if(f&&o&&d&&r&&h&&c){const a=this.getValue(f,n),e=this.getValue(o),u=this.getValue(h);a&&(uSpace.MaterialEffects.breatheColor(a,{color:e,intensity:u}),this.cleanSets.add(()=>{uSpace.MaterialEffects.removeBreatheColor(a)}))}}}class UnEmissiveNode extends Node{constructor(t,f){super(t,f)}filterUnEmissiveObject(t){const f=[];return objectHandle(t,o=>{f.push(o)}),f}async exec(t){const f=this.findProp("objects",["READ_CTX","LOCAL"]),o=await t.getTarget?.(this);f&&this.getValue(f,o)}}const meshCacheSymbol=Symbol("meshCache");class MeshNode extends Node{constructor(t,f){super(t,f)}async exec(t){const{scene:f}=this.viewer,o=await t.getTarget?.(this)||f;t[meshCacheSymbol]||(t[meshCacheSymbol]={});const d=this.findProp("mesh","LOCAL"),r=this.findProp("out","WRITE_CTX");if(d&&r){let h=null;const c=parseValue(d.value),n=parseValue(r.value),a=t[meshCacheSymbol][c];if(a){h=a;return}const e=getMeshByUserDataUuid(o,c);e&&(h=e,t[meshCacheSymbol][c]=e),this.writeContext(n,h)}}}const meshesCacheSymbol=Symbol("meshesCache");class MeshesNode extends Node{constructor(t,f){super(t,f)}async exec(t){const{scene:f}=this.viewer,o=await t.getTarget?.(this)||f;t[meshesCacheSymbol]||(t[meshesCacheSymbol]={});const d=this.findProp("meshes","LOCAL"),r=this.findProp("out","WRITE_CTX");if(d&&r){const h=[],c=parseValue(d.value),n=parseValue(r.value);c.forEach(a=>{const e=t[meshesCacheSymbol][a];if(e){h.push(e);return}const u=getMeshByUserDataUuid(o,a);u&&(h.push(u),t[meshesCacheSymbol][a]=u)}),this.writeContext(n,h)}}}class ModelNode extends Node{constructor(t,f){super(t,f)}async exec(){const t=this.findProp("model","LOCAL"),f=this.findProp("out","WRITE_CTX");if(t&&f){const o=parseValue(t.value),d=parseValue(f.value);this.writeContext(d,getObjectById(this.viewer,o))}}}class ModelsNode extends Node{constructor(t,f){super(t,f)}async exec(){const t=this.findProp("models","LOCAL"),f=this.findProp("out","WRITE_CTX");if(t&&f){const o=parseValue(t.value),d=parseValue(f.value);this.writeContext(d,getObjectByIds(this.viewer,o))}}}class DelayNode extends Node{constructor(t,f){super(t,f)}async exec(){const t=this.findProp("delay","LOCAL");if(t){const f=parseValue(t.value);await sleep(f)}}}class ConditionNode extends Node{constructor(t,f){super(t,f)}execFn(t){return new Function("sourceData",t)(this.ctx)}async exec(){const t=this.findProp("conditaion_node","LOCAL");if(t){const f=parseValue(t.value),o=this.parser.edges.filter(d=>d.source===this.id);f.forEach(d=>{try{if(this.execFn(d.value)!==!0)throw new Error}catch{const h=o.find(n=>n.sourceHandle==String(d.id));if(!h)return;this.postNodes.find(n=>n.id===h.target)?.reject()}})}}}class ShowNode extends Node{constructor(t,f){super(t,f)}filterShowObject(t){const f=[];return objectHandle(t,o=>{o.visible===!1&&f.push(o)}),f}async exec(t){const f=this.findProp("objects",["READ_CTX","LOCAL"]),o=await t.getTarget?.(this);if(f){const d=this.getValue(f,o);if(d){const r=this.filterShowObject(d),h=c=>{objectHandle(r,n=>{n.visible=c}),this.viewer.render()};h(!0),this.cleanSets.add(()=>h(!1))}}}}class HideNode extends Node{constructor(t,f){super(t,f)}filterHideObject(t){const f=[];return objectHandle(t,o=>{o.visible===!0&&f.push(o)}),f}async exec(t){const f=this.findProp("objects",["READ_CTX","LOCAL"]),o=await t.getTarget?.(this);if(f){const d=this.getValue(f,o);if(d){const r=this.filterHideObject(d),h=c=>{objectHandle(r,n=>{n.visible=c}),this.viewer.render()};h(!1),this.cleanSets.add(()=>h(!0))}}}}class TranslateNode extends Node{constructor(t,f){super(t,f)}async exec(t){const f=this.findProp("objects",["READ_CTX","LOCAL"]),o=this.findProp("axis",["READ_CTX","LOCAL"]),d=this.findProp("translate",["READ_CTX","LOCAL"]),r=await t.getTarget?.(this);if(f&&o&&d){const h=this.getValue(f,r),c=this.getValue(o),n=this.getValue(d);if(h){const a=[];objectHandle(h,v=>{a.push(v.position.clone())});const u=(v,b)=>{switch(c){case"x":v.setX(b.x);break;case"y":v.setY(b.y);break;case"z":v.setZ(b.z);break}};await(async()=>{const v=objectHandle(h,async b=>{const m=b.position.clone();switch(c){case"x":await uSpace.tweenAnimation(this.viewer,m,new webgpu.Vector3().set(m.x+n,m.y,m.z),{duration:800},B=>u(b.position,B));break;case"y":await uSpace.tweenAnimation(this.viewer,m,new webgpu.Vector3().set(m.x,m.y+n,m.z),{duration:800},B=>u(b.position,B));break;case"z":await uSpace.tweenAnimation(this.viewer,m,new webgpu.Vector3().set(m.x,m.y,m.z+n),{duration:800},B=>u(b.position,B));break}});v instanceof Array?await Promise.all(v):await v,this.viewer.render()})(),this.cleanSets.add(()=>{let v=0;objectHandle(h,b=>{b.position.copy(a[v++])})})}}}}class ScaleNode extends Node{constructor(t,f){super(t,f)}async exec(t){const f=this.findProp("objects",["READ_CTX","LOCAL"]),o=this.findProp("axis",["READ_CTX","LOCAL"]),d=this.findProp("scale",["READ_CTX","LOCAL"]),r=await t.getTarget?.(this);if(f&&o&&d){const h=this.getValue(f,r),c=this.getValue(o),n=this.getValue(d);if(h){const a=[];objectHandle(h,v=>{a.push(v.scale.clone())});const u=(v,b)=>{switch(c){case"x":v.setX(b.x);break;case"y":v.setY(b.y);break;case"z":v.setZ(b.z);break}};await(async()=>{const v=objectHandle(h,async b=>{const m=b.scale.clone();switch(c){case"x":await uSpace.tweenAnimation(this.viewer,m,new webgpu.Vector3().set(m.x*n,m.y,m.z),{duration:800},B=>u(b.scale,B));break;case"y":await uSpace.tweenAnimation(this.viewer,m,new webgpu.Vector3().set(m.x,m.y*n,m.z),{duration:800},B=>u(b.scale,B));break;case"z":await uSpace.tweenAnimation(this.viewer,m,new webgpu.Vector3().set(m.x,m.y,m.z*n),{duration:800},B=>u(b.scale,B));break}});v instanceof Array?await Promise.all(v):await v,this.viewer.render()})(),this.cleanSets.add(()=>{let v=0;objectHandle(h,b=>{b.scale.copy(a[v++])})})}}}}class RotateNode extends Node{constructor(t,f){super(t,f)}async exec(t){const f=this.findProp("objects",["READ_CTX","LOCAL"]),o=this.findProp("axis",["READ_CTX","LOCAL"]),d=this.findProp("rotation",["READ_CTX","LOCAL"]),r=await t.getTarget?.(this);if(f&&o&&d){const h=this.getValue(f,r),c=this.getValue(o),n=this.getValue(d);if(h){const a=[];objectHandle(h,v=>{a.push(v.rotation.clone())});const u=(v,b)=>{switch(c){case"x":v.x=b.x;break;case"y":v.y=b.y;break;case"z":v.z=b.z;break}};await(async()=>{const v=n/180*Math.PI,b=objectHandle(h,async m=>{const B=m.rotation.clone();switch(c){case"x":await uSpace.tweenAnimation(this.viewer,B,new webgpu.Euler().set(B.x+v,B.y,B.z),{duration:800},E=>u(m.rotation,E));break;case"y":await uSpace.tweenAnimation(this.viewer,B,new webgpu.Euler().set(B.x,B.y+v,B.z),{duration:800},E=>u(m.rotation,E));break;case"z":await uSpace.tweenAnimation(this.viewer,B,new webgpu.Euler().set(B.x,B.y,B.z+v),{duration:800},E=>u(m.rotation,E));break}});b instanceof Array?await Promise.all(b):await b,this.viewer.render()})(),this.cleanSets.add(()=>{let v=0;objectHandle(h,b=>{b.rotation.copy(a[v++])})})}}}}class FlyToNode extends Node{constructor(t,f){super(t,f)}async exec(){const t=this.findProp("viewpoint",["READ_CTX","LOCAL"]);if(t){const f=parseValue(this.getValue(t));f&&this.viewer.controls.setCameraViewpoint(f,!0)}}}class SpaceNode extends Node{constructor(t,f){super(t,f)}async exec(){const t=this.findProp("space","LOCAL"),f=this.findProp("out","WRITE_CTX");if(t&&f){const o=parseValue(t.value),d=parseValue(f.value);this.writeContext(d,getObjectById(this.viewer,o))}}}class SpacesNode extends Node{constructor(t,f){super(t,f)}async exec(){const t=this.findProp("spaces","LOCAL"),f=this.findProp("out","WRITE_CTX");if(t&&f){const o=parseValue(t.value),d=parseValue(f.value),r=o.map(h=>getObjectById(this.viewer,h));this.writeContext(d,r)}}}class POINode extends Node{constructor(t,f){super(t,f)}async exec(t){const f=this.findProp("poi","LOCAL"),o=this.findProp("out","WRITE_CTX");if(f&&o){const d=parseValue(f.value),r=parseValue(o.value);this.writeContext(r,getObjectById(this.viewer,d))}}}class POIsNode extends Node{constructor(t,f){super(t,f)}async exec(t){const f=this.findProp("pois","LOCAL"),o=this.findProp("out","WRITE_CTX");if(f&&o){const d=parseValue(f.value),r=parseValue(o.value),h=d.map(c=>getObjectById(this.viewer,c));this.writeContext(r,h)}}}class DataExtractionNode extends Node{constructor(t,f){super(t,f)}async exec(){const t=this.findProp("value","LOCAL"),f=this.findProp("object","LOCAL"),o=this.findProp("out","WRITE_CTX"),d=this.findProp("extraction","LOCAL");if(t&&o&&d&&f){const r=parseValue(d.value),h=parseValue(o.value),c=parseValue(f.value),n=this.getValue(f);let a=parseValue(t.value);if(this.ctx._userDataMap){const e=this.ctx._userDataMap.get(c);e&&(a=e[r])}else if(n&&n.userData.properties){const e=n.userData.properties.find(u=>u.key===r);e&&e.value!==void 0&&(a=e.value)}this.writeContext(h,a)}}}class DataFilterNode extends Node{constructor(t,f){super(t,f)}async exec(){const t=this.findProp("model","LOCAL");if(t){const f=parseValue(t.value),o=new Function("sourceData",f);for(const d in this.ctx){const r=o(this.ctx[d]);(r==null||r===!1)&&delete this.ctx[d]}}}}class PathNode extends Node{constructor(t,f){super(t,f)}async exec(){const t=this.findProp("path","LOCAL"),f=this.findProp("out","WRITE_CTX");if(t&&f){const o=parseValue(t.value),d=parseValue(f.value);this.writeContext(d,getObjectById(this.viewer,o))}}}class PathsNode extends Node{constructor(t,f){super(t,f)}async exec(){const t=this.findProp("paths","LOCAL"),f=this.findProp("out","WRITE_CTX");if(t&&f){const o=parseValue(t.value),d=parseValue(f.value),r=o.map(h=>getObjectById(this.viewer,h));this.writeContext(d,r)}}}class UserDataNode extends Node{constructor(t,f){super(t,f)}async exec(){const t=this.findProp("object",["READ_CTX","LOCAL"]),f=this.findProp("data","LOCAL"),o=this.findProp("source","WRITE_CTX");if(t&&f&&o){let d=parseValue(t.value);const r=parseValue(f.value),h=parseValue(o.value);if(h&&(d=h),d&&r){this.ctx._userDataMap||(this.ctx._userDataMap=new Map);const c=this.ctx._userDataMap.get(d);c?Object.assign(c,r):this.ctx._userDataMap.set(d,r)}}}}class ClipAnimationNode extends Node{constructor(t,f){super(t,f)}async exec(t){let f=await t.getTarget?.(this);if(!f){const d=this.findProp("model",["READ_CTX","LOCAL"]);d&&(f=this.getValue(d))}const o=this.findProp("animation",["READ_CTX","LOCAL"]);if(f&&o){let d;if(o.type==="READ_CTX"){const h=this.parser.getVariableNameById(parseValue(o.value));d=this.readContext(h)}else d=parseValue(o.value);f.playAnimation(d);const r=({delta:h})=>{f.updateAnimation(h)};this.viewer.addEventListener("beforeRender",r),this.cleanSets.add(()=>{f.stopAnimation(d),this.viewer.removeEventListener("beforeRender",r)})}}}class UnClipAnimationNode extends Node{constructor(t,f){super(t,f)}async exec(t){let f=await t.getTarget?.(this);if(!f){const d=this.findProp("model",["READ_CTX","LOCAL"]);d&&(f=this.getValue(d))}const o=this.findProp("animation",["READ_CTX","LOCAL"]);if(f&&o){let d;if(o.type==="READ_CTX"){const r=this.parser.getVariableNameById(parseValue(o.value));d=this.readContext(r)}else d=parseValue(o.value);f.stopAnimation(d)}}}const tweenCache$1=new Map;async function playTweenAnimation(s,t,f){const{id:o,keyframes:d}=f,r=new AnimationsParser(s,t);tweenCache$1.has(o)||tweenCache$1.set(o,new Set),tweenCache$1.get(o)?.add(r),await r.play(d)}function stopTweenAnimation(s){tweenCache$1.get(s)?.forEach(t=>t.stop()),tweenCache$1.get(s)?.clear()}class TweenAnimationNode extends Node{constructor(t,f){super(t,f)}async exec(t){const f=this.findProp("model",["READ_CTX","LOCAL"]),o=this.findProp("animation","LOCAL"),d=this.findProp("wait","LOCAL");if(f&&o&&d){const r=this.getValue(f),h=parseValue(o.value),c=parseValue(d.value);if(r){const n=await t.getAnimations?.(this,r,h);if(n){const a=n.find(e=>e.id===h);a&&await waitFor(async()=>{const e=r.matrix.clone();await playTweenAnimation(this.viewer,r,a),this.cleanSets.add(()=>{stopTweenAnimation(a.id),r&&e.decompose(r.position,r.quaternion,r.scale)})},c)}}}}}class UnTweenAnimationNode extends Node{constructor(t,f){super(t,f)}async exec(){const t=this.findProp("animation","LOCAL");if(t){const f=parseValue(t.value);stopTweenAnimation(f)}}}const tweenCache=new Map;async function playComponentTweenAnimation(s,t,f){const{id:o,keyframes:d}=f,r=new AnimationsParser(s,t);tweenCache.has(o)||tweenCache.set(o,new Set),tweenCache.get(o)?.add(r),await r.play(d)}function stopComponentTweenAnimation(s){tweenCache.get(s)?.forEach(t=>t.stop()),tweenCache.get(s)?.clear()}class ComponentTweenAnimationNode extends Node{constructor(t,f){super(t,f)}async exec(t){const f=this.findProp("mesh",["READ_CTX","LOCAL"]),o=this.findProp("animation","LOCAL"),d=this.findProp("wait","LOCAL");if(f&&o&&d){const r=this.getValue(f),h=parseValue(o.value),c=parseValue(d.value);if(r){const n=await t.getComponentAnimations?.(this,r,h);if(n){const a=n.find(e=>e.id===h);if(a){let e=null;f.valueType==="Mesh"?e=r:f.valueType==="Model"&&(e=getMeshByUserDataUuid(r,a.refId)),e&&await waitFor(async()=>{if(e){const u=e.matrix.clone();await playComponentTweenAnimation(this.viewer,e,a),this.cleanSets.add(()=>{stopComponentTweenAnimation(a.id),e&&u.decompose(e.position,e.quaternion,e.scale)})}},c)}}}}}}class UnComponentTweenAnimationNode extends Node{constructor(t,f){super(t,f)}async exec(){const t=this.findProp("animation","LOCAL");if(t){const f=parseValue(t.value);stopComponentTweenAnimation(f)}}}class FlowParser extends webgpu.EventDispatcher{viewer;flow;nodes;nodesMap;edges;edgesMap;onNodeBefore=null;onNodeAfter=null;constructor(t,f){super(),this.viewer=t,this.flow=f,this.nodes=[],this.nodesMap=new Map,this.edges=[],this.edgesMap=new Map}addNode(t){this.nodes.push(t),this.nodesMap.set(t.id,t)}addEdge(t){this.edges.push(t),this.edgesMap.set(t.id,t)}getNodeById(t){return this.nodesMap.get(t)}getEdgeById(t){return this.edgesMap.get(t)}clear(){this.nodes.length=0,this.nodesMap.clear(),this.edges.length=0,this.edgesMap.clear()}parse(){this.clear();const{nodes:t,edges:f}=this.flow;t.forEach(o=>{const d=parseNodeByType(this,o);this.addNode(d)}),f.forEach(o=>{const d=new Edge(o);this.addEdge(d);const r=this.getNodeById(o.source),h=this.getNodeById(o.target);r&&h&&(r.postNodes.push(h),h.prevNodes.push(r))})}async run(t={},f={preload:!1}){const{preload:o}=f,r=this.nodes.filter(h=>h.prevNodes.length||h.postNodes.length).map(h=>h.run(t,{preload:o}));await Promise.allSettled(r)}async debug(t={},f=1500){const o=this.onNodeAfter;this.onNodeAfter=async d=>{await sleep(f),o?.(d)},await this.run(t)}stop(){this.nodes.forEach(t=>t.reject(new Error("Flow stopped")))}cleanup(){this.nodes.sort((t,f)=>f.execOrder-t.execOrder).forEach(t=>t.cleanup())}getVariableNameById(t){const f=this.nodes.find(o=>o.id===t);if(f){const o=f.props.find(d=>d.name==="out");return o?parseValue(o.value):null}return null}dispose(){this.stop(),this.cleanup()}}class ComponentFlowParser extends FlowParser{flow;constructor(t,f){super(t,f),this.flow=f}}exports.AnimationsLoader=AnimationsLoader;exports.AnimationsParser=AnimationsParser;exports.BuildingGroup=BuildingGroup;exports.ComponentFlowParser=ComponentFlowParser;exports.ElevatorMesh=ElevatorMesh;exports.FloorMesh=FloorMesh;exports.FlowParser=FlowParser;exports.Node=Node;exports.PropertiesLoader=PropertiesLoader;exports.SceneLoader=SceneLoader;exports.SemanticLoader=SemanticLoader;exports.SemanticParser=SemanticParser;exports.TopologiesLoader=TopologiesLoader;exports.TopologyParser=TopologyParser;exports.VentMesh=VentMesh;exports.VerticalShaftMesh=VerticalShaftMesh;exports.VisionsLoader=VisionsLoader;exports.VisionsParser=VisionsParser;exports.createVerticalShaftMesh=createVerticalShaftMesh;
|