(function(f){if(typeofexports==="object"&&typeofmodule!=="undefined"){module.exports=f()}elseif(typeofdefine==="function"&&define.amd){define([],f)}else{varg;if(typeofwindow!=="undefined"){g=window}elseif(typeofglobal!=="undefined"){g=global}elseif(typeofself!=="undefined"){g=self}else{g=this}g.Syndicate=f()}})(function(){vardefine,module,exports;returnfunctione(t,n,r){functions(o,u){if(!n[o]){if(!t[o]){vara=typeofrequire=="function"&&require;if(!u&&a)returna(o,!0);if(i)returni(o,!0);varf=newError("Cannot find module '"+o+"'");throwf.code="MODULE_NOT_FOUND",f}varl=n[o]={exports:{}};t[o][0].call(l.exports,function(e){varn=t[o][1][e];returns(n?n:e)},l,l.exports,e,t,n,r)}returnn[o].exports}vari=typeofrequire=="function"&&require;for(varo=0;o<r.length;o++)s(r[o]);returns}({1:[function(require,module,exports){},{}],2:[function(require,module,exports){(function(global){"use strict";varbase64=require("base64-js");varieee754=require("ieee754");varisArray=require("isarray");exports.Buffer=Buffer;exports.SlowBuffer=SlowBuffer;exports.INSPECT_MAX_BYTES=50;Buffer.TYPED_ARRAY_SUPPORT=global.TYPED_ARRAY_SUPPORT!==undefined?global.TYPED_ARRAY_SUPPORT:typedArraySupport();exports.kMaxLength=kMaxLength();functiontypedArraySupport(){try{vararr=newUint8Array(1);arr.__proto__={__proto__:Uint8Array.prototype,foo:function(){return42}};returnarr.foo()===42&&typeofarr.subarray==="function"&&arr.subarray(1,1).byteLength===0}catch(e){returnfalse}}functionkMaxLength(){returnBuffer.TYPED_ARRAY_SUPPORT?2147483647:1073741823}functioncreateBuffer(that,length){if(kMaxLength()<length){thrownewRangeError("Invalid typed array length")}if(Buffer.TYPED_ARRAY_SUPPORT){that=newUint8Array(length);that.__proto__=Buffer.prototype}else{if(that===null){that=newBuffer(length)}that.length=length}returnthat}functionBuffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(thisinstanceofBuffer)){returnnewBuffer(arg,encodingOrOffset,length)}if(typeofarg==="number"){if(typeofencodingOrOffset==="string"){thrownewError("If encoding is specified then the first argument must be a string")}returnallocUnsafe(this,arg)}returnfrom(this,arg,encodingOrOffset,length)}Buffer.poolSize=8192;Buffer._augment=function(arr){arr.__proto__=Buffer.prototype;returnarr};functionfrom(that,value,encodingOrOffset,length){if(typeofvalue==="number"){thrownewTypeError('"value" argument must not be a number')}if(typeofArrayBuffer!=="undefined"&&valueinstanceofArrayBuffer){returnfromArrayBuffer(that,value,encodingOrOffset,length)}if(typeofvalue==="string"){returnfromString(that,value,encodingOrOffset)}returnfromObject(that,value)}Buffer.from=function(value,encodingOrOffset,length){returnfrom(null,value,encodingOrOffset,length)};if(Buffer.TYPED_ARRAY_SUPPORT){Buffer.prototype.__proto__=Uint8Array.prototype;Buffer.__proto__=Uint8Array;if(typeofSymbol!=="undefined"&&Symbol.species&&Buffer[Symbol.species]===Buffer){Object.defineProperty(Buffer,Symbol.species,{value:null,configurable:true})}}functionassertSize(size){if(typeofsize!=="number"){thrownewTypeError('"size" argument must be a number')}elseif(size<0){thrownewRangeError('"size" argument must not be negative')}}functionalloc(that,size,fill,encoding){assertSize(size);if(size<=0){returncreateBuffer(that,size)}if(fill!==undefined){returntypeofencoding==="string"?createBuffer(that,size).fill(fill,encoding):createBuffer(that,size).fill(fill)}returncreateBuffer(that,size)}Buffer.alloc=function(size,fill,encoding){returnalloc(null,size,fill,encoding)};functionallocUnsafe(that,size){assertSize(size);that=createBuffer(that,size<0?0:checked(size)|0);if(!Buffer.TYPED_ARRAY_SUPPORT){for(vari=0;i<size;++i){that[i]=0}}returnthat}Buffer.allocUnsafe=function(size){returnallocUnsafe(null,size)};Buffer.allocUnsafeSlow=function(size){returnallocUnsafe(null,size)};functionfromString(that,string,encoding){if(typeofencoding!=="string"||encoding===""){encoding="utf8"}if(!Buffer.isEncoding(encoding)){thrownewTypeError('"encoding" must be a valid string encoding')}var
;bytes.push(codePoint)}elseif(codePoint<2048){if((units-=2)<0)break;bytes.push(codePoint>>6|192,codePoint&63|128)}elseif(codePoint<65536){if((units-=3)<0)break;bytes.push(codePoint>>12|224,codePoint>>6&63|128,codePoint&63|128)}elseif(codePoint<1114112){if((units-=4)<0)break;bytes.push(codePoint>>18|240,codePoint>>12&63|128,codePoint>>6&63|128,codePoint&63|128)}else{thrownewError("Invalid code point")}}returnbytes}functionasciiToBytes(str){varbyteArray=[];for(vari=0;i<str.length;++i){byteArray.push(str.charCodeAt(i)&255)}returnbyteArray}functionutf16leToBytes(str,units){varc,hi,lo;varbyteArray=[];for(vari=0;i<str.length;++i){if((units-=2)<0)break;c=str.charCodeAt(i);hi=c>>8;lo=c%256;byteArray.push(lo);byteArray.push(hi)}returnbyteArray}functionbase64ToBytes(str){returnbase64.toByteArray(base64clean(str))}functionblitBuffer(src,dst,offset,length){for(vari=0;i<length;++i){if(i+offset>=dst.length||i>=src.length)break;dst[i+offset]=src[i]}returni}functionisnan(val){returnval!==val}}).call(this,typeofglobal!=="undefined"?global:typeofself!=="undefined"?self:typeofwindow!=="undefined"?window:{})},{"base64-js":3,ieee754:4,isarray:5}],3:[function(require,module,exports){"use strict";exports.byteLength=byteLength;exports.toByteArray=toByteArray;exports.fromByteArray=fromByteArray;varlookup=[];varrevLookup=[];varArr=typeofUint8Array!=="undefined"?Uint8Array:Array;varcode="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(vari=0,len=code.length;i<len;++i){lookup[i]=code[i];revLookup[code.charCodeAt(i)]=i}revLookup["-".charCodeAt(0)]=62;revLookup["_".charCodeAt(0)]=63;functionplaceHoldersCount(b64){varlen=b64.length;if(len%4>0){thrownewError("Invalid string. Length must be a multiple of 4")}returnb64[len-2]==="="?2:b64[len-1]==="="?1:0}functionbyteLength(b64){returnb64.length*3/4-placeHoldersCount(b64)}functiontoByteArray(b64){vari,j,l,tmp,placeHolders,arr;varlen=b64.length;placeHolders=placeHoldersCount(b64);arr=newArr(len*3/4-placeHolders);l=placeHolders>0?len-4:len;varL=0;for(i=0,j=0;i<l;i+=4,j+=3){tmp=revLookup[b64.charCodeAt(i)]<<18|revLookup[b64.charCodeAt(i+1)]<<12|revLookup[b64.charCodeAt(i+2)]<<6|revLookup[b64.charCodeAt(i+3)];arr[L++]=tmp>>16&255;arr[L++]=tmp>>8&255;arr[L++]=tmp&255}if(placeHolders===2){tmp=revLookup[b64.charCodeAt(i)]<<2|revLookup[b64.charCodeAt(i+1)]>>4;arr[L++]=tmp&255}elseif(placeHolders===1){tmp=revLookup[b64.charCodeAt(i)]<<10|revLookup[b64.charCodeAt(i+1)]<<4|revLookup[b64.charCodeAt(i+2)]>>2;arr[L++]=tmp>>8&255;arr[L++]=tmp&255}returnarr}functiontripletToBase64(num){returnlookup[num>>18&63]+lookup[num>>12&63]+lookup[num>>6&63]+lookup[num&63]}functionencodeChunk(uint8,start,end){vartmp;varoutput=[];for(vari=start;i<end;i+=3){tmp=(uint8[i]<<16)+(uint8[i+1]<<8)+uint8[i+2];output.push(tripletToBase64(tmp))}returnoutput.join("")}functionfromByteArray(uint8){vartmp;varlen=uint8.length;varextraBytes=len%3;varoutput="";varparts=[];varmaxChunkLength=16383;for(vari=0,len2=len-extraBytes;i<len2;i+=maxChunkLength){parts.push(encodeChunk(uint8,i,i+maxChunkLength>len2?len2:i+maxChunkLength))}if(extraBytes===1){tmp=uint8[len-1];output+=lookup[tmp>>2];output+=lookup[tmp<<4&63];output+="=="}elseif(extraBytes===2){tmp=(uint8[len-2]<<8)+uint8[len-1];output+=lookup[tmp>>10];output+=lookup[tmp>>4&63];output+=lookup[tmp<<2&63];output+="="}parts.push(output);returnparts.join("")}},{}],4:[function(require,module,exports){exports.read=function(buffer,offset,isLE,mLen,nBytes){vare,m;vareLen=nBytes*8-mLen-1;vareMax=(1<<eLen)-1;vareBias=eMax>>1;varnBits=-7;vari=isLE?nBytes-1:0;vard=isLE?-1:1;vars=buffer[offset+i];i+=d;e=s&(1<<-nBits)-1;s>>=-nBits;nBits+=eLen;for(;nBits>0;e=e*256+buffer[offset+i],i+=d,nBits-=8){}m=e&(1<<-nBits)-1;e>>=-nBits;nBits+=mLen;for(;nBits>0;m=m*256+buffer[offset+i],i+=d,nBits-=8){}if(e===0){e=1-eBias}elseif(e===eMax){returnm?NaN:(s?-1:1)*Infinity}else{m=m+Math.pow(2,mLen);e=e-eBias}return(s?-1:1)*m*Math.pow(2,e-mLen)};exports.write=function(buffer,value,offset,isLE,mLen,nBytes){vare,m,c;vareLen=nBytes*8-mLen-1
(function(Buffer){varaes=require("./aes");varTransform=require("cipher-base");varinherits=require("inherits");inherits(StreamCipher,Transform);module.exports=StreamCipher;functionStreamCipher(mode,key,iv,decrypt){if(!(thisinstanceofStreamCipher)){returnnewStreamCipher(mode,key,iv)}Transform.call(this);this._cipher=newaes.AES(key);this._prev=newBuffer(iv.length);this._cache=newBuffer("");this._secCache=newBuffer("");this._decrypt=decrypt;iv.copy(this._prev);this._mode=mode}StreamCipher.prototype._update=function(chunk){returnthis._mode.encrypt(this,chunk,this._decrypt)};StreamCipher.prototype._final=function(){this._cipher.scrub()}}).call(this,require("buffer").Buffer)},{"./aes":8,buffer:2,"cipher-base":23,inherits:204}],25:[function(require,module,exports){(function(Buffer){varCipherBase=require("cipher-base");vardes=require("des.js");varinherits=require("inherits");varmodes={"des-ede3-cbc":des.CBC.instantiate(des.EDE),"des-ede3":des.EDE,"des-ede-cbc":des.CBC.instantiate(des.EDE),"des-ede":des.EDE,"des-cbc":des.CBC.instantiate(des.DES),"des-ecb":des.DES};modes.des=modes["des-cbc"];modes.des3=modes["des-ede3-cbc"];module.exports=DES;inherits(DES,CipherBase);functionDES(opts){CipherBase.call(this);varmodeName=opts.mode.toLowerCase();varmode=modes[modeName];vartype;if(opts.decrypt){type="decrypt"}else{type="encrypt"}varkey=opts.key;if(modeName==="des-ede"||modeName==="des-ede-cbc"){key=Buffer.concat([key,key.slice(0,8)])}variv=opts.iv;this._des=mode.create({key:key,iv:iv,type:type})}DES.prototype._update=function(data){returnnewBuffer(this._des.update(data))};DES.prototype._final=function(){returnnewBuffer(this._des.final())}}).call(this,require("buffer").Buffer)},{buffer:2,"cipher-base":27,"des.js":28,inherits:204}],26:[function(require,module,exports){exports["des-ecb"]={key:8,iv:0};exports["des-cbc"]=exports.des={key:8,iv:8};exports["des-ede3-cbc"]=exports.des3={key:24,iv:8};exports["des-ede3"]={key:24,iv:0};exports["des-ede-cbc"]={key:16,iv:8};exports["des-ede"]={key:16,iv:0}},{}],27:[function(require,module,exports){arguments[4][23][0].apply(exports,arguments)},{buffer:2,dup:23,inherits:204,stream:223,string_decoder:224}],28:[function(require,module,exports){"use strict";exports.utils=require("./des/utils");exports.Cipher=require("./des/cipher");exports.DES=require("./des/des");exports.CBC=require("./des/cbc");exports.EDE=require("./des/ede")},{"./des/cbc":29,"./des/cipher":30,"./des/des":31,"./des/ede":32,"./des/utils":33}],29:[function(require,module,exports){"use strict";varassert=require("minimalistic-assert");varinherits=require("inherits");varproto={};functionCBCState(iv){assert.equal(iv.length,8,"Invalid IV length");this.iv=newArray(8);for(vari=0;i<this.iv.length;i++)this.iv[i]=iv[i]}functioninstantiate(Base){functionCBC(options){Base.call(this,options);this._cbcInit()}inherits(CBC,Base);varkeys=Object.keys(proto);for(vari=0;i<keys.length;i++){varkey=keys[i];CBC.prototype[key]=proto[key]}CBC.create=functioncreate(options){returnnewCBC(options)};returnCBC}exports.instantiate=instantiate;proto._cbcInit=function_cbcInit(){varstate=newCBCState(this.options.iv);this._cbcState=state};proto._update=function_update(inp,inOff,out,outOff){varstate=this._cbcState;varsuperProto=this.constructor.super_.prototype;variv=state.iv;if(this.type==="encrypt"){for(vari=0;i<this.blockSize;i++)iv[i]^=inp[inOff+i];superProto._update.call(this,iv,0,out,outOff);for(vari=0;i<this.blockSize;i++)iv[i]=out[outOff+i]}else{superProto._update.call(this,inp,inOff,out,outOff);for(vari=0;i<this.blockSize;i++)out[outOff+i]^=iv[i];for(vari=0;i<this.blockSize;i++)iv[i]=inp[inOff+i]}}},{inherits:204,"minimalistic-assert":34}],30:[function(require,module,exports){"use strict";varassert=require("minimalistic-assert");functionCipher(options){this.options=options;this.type=this.options.type;this.blockSize=8;this._init();this.buffer=newArray(this.blockSize);this.bufferOff=0}module.exports=Cipher;Cipher.prototype._init=function_init(){};Cipher.prototype.update=functionupdate(data){if(data.length===0
;returnthis.red.convertFrom(this)};BN.prototype._forceRed=function_forceRed(ctx){this.red=ctx;returnthis};BN.prototype.forceRed=functionforceRed(ctx){assert(!this.red,"Already a number in reduction context");returnthis._forceRed(ctx)};BN.prototype.redAdd=functionredAdd(num){assert(this.red,"redAdd works only with red numbers");returnthis.red.add(this,num)};BN.prototype.redIAdd=functionredIAdd(num){assert(this.red,"redIAdd works only with red numbers");returnthis.red.iadd(this,num)};BN.prototype.redSub=functionredSub(num){assert(this.red,"redSub works only with red numbers");returnthis.red.sub(this,num)};BN.prototype.redISub=functionredISub(num){assert(this.red,"redISub works only with red numbers");returnthis.red.isub(this,num)};BN.prototype.redShl=functionredShl(num){assert(this.red,"redShl works only with red numbers");returnthis.red.shl(this,num)};BN.prototype.redMul=functionredMul(num){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,num);returnthis.red.mul(this,num)};BN.prototype.redIMul=functionredIMul(num){assert(this.red,"redMul works only with red numbers");this.red._verify2(this,num);returnthis.red.imul(this,num)};BN.prototype.redSqr=functionredSqr(){assert(this.red,"redSqr works only with red numbers");this.red._verify1(this);returnthis.red.sqr(this)};BN.prototype.redISqr=functionredISqr(){assert(this.red,"redISqr works only with red numbers");this.red._verify1(this);returnthis.red.isqr(this)};BN.prototype.redSqrt=functionredSqrt(){assert(this.red,"redSqrt works only with red numbers");this.red._verify1(this);returnthis.red.sqrt(this)};BN.prototype.redInvm=functionredInvm(){assert(this.red,"redInvm works only with red numbers");this.red._verify1(this);returnthis.red.invm(this)};BN.prototype.redNeg=functionredNeg(){assert(this.red,"redNeg works only with red numbers");this.red._verify1(this);returnthis.red.neg(this)};BN.prototype.redPow=functionredPow(num){assert(this.red&&!num.red,"redPow(normalNum)");this.red._verify1(this);returnthis.red.pow(this,num)};varprimes={k256:null,p224:null,p192:null,p25519:null};functionMPrime(name,p){this.name=name;this.p=newBN(p,16);this.n=this.p.bitLength();this.k=newBN(1).iushln(this.n).isub(this.p);this.tmp=this._tmp()}MPrime.prototype._tmp=function_tmp(){vartmp=newBN(null);tmp.words=newArray(Math.ceil(this.n/13));returntmp};MPrime.prototype.ireduce=functionireduce(num){varr=num;varrlen;do{this.split(r,this.tmp);r=this.imulK(r);r=r.iadd(this.tmp);rlen=r.bitLength()}while(rlen>this.n);varcmp=rlen<this.n?-1:r.ucmp(this.p);if(cmp===0){r.words[0]=0;r.length=1}elseif(cmp>0){r.isub(this.p)}else{r.strip()}returnr};MPrime.prototype.split=functionsplit(input,out){input.iushrn(this.n,0,out)};MPrime.prototype.imulK=functionimulK(num){returnnum.imul(this.k)};functionK256(){MPrime.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}inherits(K256,MPrime);K256.prototype.split=functionsplit(input,output){varmask=4194303;varoutLen=Math.min(input.length,9);for(vari=0;i<outLen;i++){output.words[i]=input.words[i]}output.length=outLen;if(input.length<=9){input.words[0]=0;input.length=1;return}varprev=input.words[9];output.words[output.length++]=prev&mask;for(i=10;i<input.length;i++){varnext=input.words[i]|0;input.words[i-10]=(next&mask)<<4|prev>>>22;prev=next}prev>>>=22;input.words[i-10]=prev;if(prev===0&&input.length>10){input.length-=10}else{input.length-=9}};K256.prototype.imulK=functionimulK(num){num.words[num.length]=0;num.words[num.length+1]=0;num.length+=2;varlo=0;for(vari=0;i<num.length;i++){varw=num.words[i]|0;lo+=w*977;num.words[i]=lo&67108863;lo=w*64+(lo/67108864|0)}if(num.words[num.length-1]===0){num.length--;if(num.words[num.length-1]===0){num.length--}}returnnum};functionP224(){MPrime.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}inherits(P224,MPrime);functionP192(){MPrime.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}inherits(P192,MPrime);functionP25519(){MPrime.call(this,"25519","7ffffff
;ShortCurve.prototype._endoWnafMulAdd=function_endoWnafMulAdd(points,coeffs,jacobianResult){varnpoints=this._endoWnafT1;varncoeffs=this._endoWnafT2;for(vari=0;i<points.length;i++){varsplit=this._endoSplit(coeffs[i]);varp=points[i];varbeta=p._getBeta();if(split.k1.negative){split.k1.ineg();p=p.neg(true)}if(split.k2.negative){split.k2.ineg();beta=beta.neg(true)}npoints[i*2]=p;npoints[i*2+1]=beta;ncoeffs[i*2]=split.k1;ncoeffs[i*2+1]=split.k2}varres=this._wnafMulAdd(1,npoints,ncoeffs,i*2,jacobianResult);for(varj=0;j<i*2;j++){npoints[j]=null;ncoeffs[j]=null}returnres};functionPoint(curve,x,y,isRed){Base.BasePoint.call(this,curve,"affine");if(x===null&&y===null){this.x=null;this.y=null;this.inf=true}else{this.x=newBN(x,16);this.y=newBN(y,16);if(isRed){this.x.forceRed(this.curve.red);this.y.forceRed(this.curve.red)}if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);this.inf=false}}inherits(Point,Base.BasePoint);ShortCurve.prototype.point=functionpoint(x,y,isRed){returnnewPoint(this,x,y,isRed)};ShortCurve.prototype.pointFromJSON=functionpointFromJSON(obj,red){returnPoint.fromJSON(this,obj,red)};Point.prototype._getBeta=function_getBeta(){if(!this.curve.endo)return;varpre=this.precomputed;if(pre&&pre.beta)returnpre.beta;varbeta=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(pre){varcurve=this.curve;varendoMul=function(p){returncurve.point(p.x.redMul(curve.endo.beta),p.y)};pre.beta=beta;beta.precomputed={beta:null,naf:pre.naf&&{wnd:pre.naf.wnd,points:pre.naf.points.map(endoMul)},doubles:pre.doubles&&{step:pre.doubles.step,points:pre.doubles.points.map(endoMul)}}}returnbeta};Point.prototype.toJSON=functiontoJSON(){if(!this.precomputed)return[this.x,this.y];return[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)}}]};Point.fromJSON=functionfromJSON(curve,obj,red){if(typeofobj==="string")obj=JSON.parse(obj);varres=curve.point(obj[0],obj[1],red);if(!obj[2])returnres;functionobj2point(obj){returncurve.point(obj[0],obj[1],red)}varpre=obj[2];res.precomputed={beta:null,doubles:pre.doubles&&{step:pre.doubles.step,points:[res].concat(pre.doubles.points.map(obj2point))},naf:pre.naf&&{wnd:pre.naf.wnd,points:[res].concat(pre.naf.points.map(obj2point))}};returnres};Point.prototype.inspect=functioninspect(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Point.prototype.isInfinity=functionisInfinity(){returnthis.inf};Point.prototype.add=functionadd(p){if(this.inf)returnp;if(p.inf)returnthis;if(this.eq(p))returnthis.dbl();if(this.neg().eq(p))returnthis.curve.point(null,null);if(this.x.cmp(p.x)===0)returnthis.curve.point(null,null);varc=this.y.redSub(p.y);if(c.cmpn(0)!==0)c=c.redMul(this.x.redSub(p.x).redInvm());varnx=c.redSqr().redISub(this.x).redISub(p.x);varny=c.redMul(this.x.redSub(nx)).redISub(this.y);returnthis.curve.point(nx,ny)};Point.prototype.dbl=functiondbl(){if(this.inf)returnthis;varys1=this.y.redAdd(this.y);if(ys1.cmpn(0)===0)returnthis.curve.point(null,null);vara=this.curve.a;varx2=this.x.redSqr();vardyinv=ys1.redInvm();varc=x2.redAdd(x2).redIAdd(x2).redIAdd(a).redMul(dyinv);varnx=c.redSqr().redISub(this.x.redAdd(this.x));varny=c.redMul(this.x.redSub(nx)).redISub(this.y);returnthis.curve.point(nx,ny)};Point.prototype.getX=functiongetX(){returnthis.x.fromRed()};Point.prototype.getY=functiongetY(){returnthis.y.fromRed()};Point.prototype.mul=functionmul(k){k=newBN(k,16);if(this._hasDoubles(k))returnthis.curve._fixedNafMul(this,k);elseif(this.curve.endo)returnthis.curve._endoWnafMulAdd([this],[k]);elsereturnthis.curve._wnafMul(this,k)};Point.prototype.mulAdd=functionmulAdd(k1,p2,k2){varpoints=[this,p2];varcoeffs=[k1,k2];if(this.curve.endo)returnthis.curve._endoWnafMulAdd(points,coeffs);elsereturnthi
;if(typeofsig!=="object")sig=parseBytes(sig);if(Array.isArray(sig)){sig={R:sig.slice(0,eddsa.encodingLength),S:sig.slice(eddsa.encodingLength)}}assert(sig.R&&sig.S,"Signature without R or S");if(eddsa.isPoint(sig.R))this._R=sig.R;if(sig.SinstanceofBN)this._S=sig.S;this._Rencoded=Array.isArray(sig.R)?sig.R:sig.Rencoded;this._Sencoded=Array.isArray(sig.S)?sig.S:sig.Sencoded}cachedProperty(Signature,"S",functionS(){returnthis.eddsa.decodeInt(this.Sencoded())});cachedProperty(Signature,"R",functionR(){returnthis.eddsa.decodePoint(this.Rencoded())});cachedProperty(Signature,"Rencoded",functionRencoded(){returnthis.eddsa.encodePoint(this.R())});cachedProperty(Signature,"Sencoded",functionSencoded(){returnthis.eddsa.encodeInt(this.S())});Signature.prototype.toBytes=functiontoBytes(){returnthis.Rencoded().concat(this.Sencoded())};Signature.prototype.toHex=functiontoHex(){returnutils.encode(this.toBytes(),"hex").toUpperCase()};module.exports=Signature},{"../../elliptic":41,"bn.js":39}],54:[function(require,module,exports){module.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb
199:[function(require,module,exports){(function(Buffer){varparseKeys=require("parse-asn1");varrandomBytes=require("randombytes");varcreateHash=require("create-hash");varmgf=require("./mgf");varxor=require("./xor");varbn=require("bn.js");varwithPublic=require("./withPublic");varcrt=require("browserify-rsa");varconstants={RSA_PKCS1_OAEP_PADDING:4,RSA_PKCS1_PADDIN:1,RSA_NO_PADDING:3};module.exports=functionpublicEncrypt(public_key,msg,reverse){varpadding;if(public_key.padding){padding=public_key.padding}elseif(reverse){padding=1}else{padding=4}varkey=parseKeys(public_key);varpaddedMsg;if(padding===4){paddedMsg=oaep(key,msg)}elseif(padding===1){paddedMsg=pkcs1(key,msg,reverse)}elseif(padding===3){paddedMsg=newbn(msg);if(paddedMsg.cmp(key.modulus)>=0){thrownewError("data too long for modulus")}}else{thrownewError("unknown padding")}if(reverse){returncrt(paddedMsg,key)}else{returnwithPublic(paddedMsg,key)}};functionoaep(key,msg){vark=key.modulus.byteLength();varmLen=msg.length;variHash=createHash("sha1").update(newBuffer("")).digest();varhLen=iHash.length;varhLen2=2*hLen;if(mLen>k-hLen2-2){thrownewError("message too long")}varps=newBuffer(k-mLen-hLen2-2);ps.fill(0);vardblen=k-hLen-1;varseed=randomBytes(hLen);varmaskedDb=xor(Buffer.concat([iHash,ps,newBuffer([1]),msg],dblen),mgf(seed,dblen));varmaskedSeed=xor(seed,mgf(maskedDb,hLen));returnnewbn(Buffer.concat([newBuffer([0]),maskedSeed,maskedDb],k))}functionpkcs1(key,msg,reverse){varmLen=msg.length;vark=key.modulus.byteLength();if(mLen>k-11){thrownewError("message too long")}varps;if(reverse){ps=newBuffer(k-mLen-3);ps.fill(255)}else{ps=nonZero(k-mLen-3)}returnnewbn(Buffer.concat([newBuffer([0,reverse?1:2]),ps,newBuffer([0]),msg],k))}functionnonZero(len,crypto){varout=newBuffer(len);vari=0;varcache=randomBytes(len*2);varcur=0;varnum;while(i<len){if(cur===cache.length){cache=randomBytes(len*2);cur=0}num=cache[cur++];if(num){out[i++]=num}}returnout}}).call(this,require("buffer").Buffer)},{"./mgf":158,"./withPublic":200,"./xor":201,"bn.js":159,"browserify-rsa":160,buffer:2,"create-hash":134,"parse-asn1":164,randombytes:202}],200:[function(require,module,exports){(function(Buffer){varbn=require("bn.js");functionwithPublic(paddedMsg,key){returnnewBuffer(paddedMsg.toRed(bn.mont(key.modulus)).redPow(newbn(key.publicExponent)).fromRed().toArray())}module.exports=withPublic}).call(this,require("buffer").Buffer)},{"bn.js":159,buffer:2}],201:[function(require,module,exports){module.exports=functionxor(a,b){varlen=a.length;vari=-1;while(++i<len){a[i]^=b[i]}returna}},{}],202:[function(require,module,exports){(function(process,global,Buffer){"use strict";functionoldBrowser(){thrownewError("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}varcrypto=global.crypto||global.msCrypto;if(crypto&&crypto.getRandomValues){module.exports=randomBytes}else{module.exports=oldBrowser}functionrandomBytes(size,cb){if(size>65536)thrownewError("requested too many random bytes");varrawBytes=newglobal.Uint8Array(size);if(size>0){crypto.getRandomValues(rawBytes)}varbytes=newBuffer(rawBytes.buffer);if(typeofcb==="function"){returnprocess.nextTick(function(){cb(null,bytes)})}returnbytes}}).call(this,require("_process"),typeofglobal!=="undefined"?global:typeofself!=="undefined"?self:typeofwindow!=="undefined"?window:{},require("buffer").Buffer)},{_process:206,buffer:2}],203:[function(require,module,exports){functionEventEmitter(){this._events=this._events||{};this._maxListeners=this._maxListeners||undefined}module.exports=EventEmitter;EventEmitter.EventEmitter=EventEmitter;EventEmitter.prototype._events=undefined;EventEmitter.prototype._maxListeners=undefined;EventEmitter.defaultMaxListeners=10;EventEmitter.prototype.setMaxListeners=function(n){if(!isNumber(n)||n<0||isNaN(n))throwTypeError("n must be a positive number");this._maxListeners=n;returnthis};EventEmitter.prototype.emit=function(type){varer,handler,len,args,i,listeners;if(!this._events)this._events={};if(typ
;util.inherits(Writable,Stream);functionnop(){}functionWriteReq(chunk,encoding,cb){this.chunk=chunk;this.encoding=encoding;this.callback=cb;this.next=null}functionWritableState(options,stream){Duplex=Duplex||require("./_stream_duplex");options=options||{};this.objectMode=!!options.objectMode;if(streaminstanceofDuplex)this.objectMode=this.objectMode||!!options.writableObjectMode;varhwm=options.highWaterMark;vardefaultHwm=this.objectMode?16:16*1024;this.highWaterMark=hwm||hwm===0?hwm:defaultHwm;this.highWaterMark=~~this.highWaterMark;this.needDrain=false;this.ending=false;this.ended=false;this.finished=false;varnoDecode=options.decodeStrings===false;this.decodeStrings=!noDecode;this.defaultEncoding=options.defaultEncoding||"utf8";this.length=0;this.writing=false;this.corked=0;this.sync=true;this.bufferProcessing=false;this.onwrite=function(er){onwrite(stream,er)};this.writecb=null;this.writelen=0;this.bufferedRequest=null;this.lastBufferedRequest=null;this.pendingcb=0;this.prefinished=false;this.errorEmitted=false;this.bufferedRequestCount=0;this.corkedRequestsFree=newCorkedRequest(this)}WritableState.prototype.getBuffer=functiongetBuffer(){varcurrent=this.bufferedRequest;varout=[];while(current){out.push(current);current=current.next}returnout};(function(){try{Object.defineProperty(WritableState.prototype,"buffer",{get:internalUtil.deprecate(function(){returnthis.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer "+"instead.")})}catch(_){}})();varrealHasInstance;if(typeofSymbol==="function"&&Symbol.hasInstance&&typeofFunction.prototype[Symbol.hasInstance]==="function"){realHasInstance=Function.prototype[Symbol.hasInstance];Object.defineProperty(Writable,Symbol.hasInstance,{value:function(object){if(realHasInstance.call(this,object))returntrue;returnobject&&object._writableStateinstanceofWritableState}})}else{realHasInstance=function(object){returnobjectinstanceofthis}}functionWritable(options){Duplex=Duplex||require("./_stream_duplex");if(!realHasInstance.call(Writable,this)&&!(thisinstanceofDuplex)){returnnewWritable(options)}this._writableState=newWritableState(options,this);this.writable=true;if(options){if(typeofoptions.write==="function")this._write=options.write;if(typeofoptions.writev==="function")this._writev=options.writev}Stream.call(this)}Writable.prototype.pipe=function(){this.emit("error",newError("Cannot pipe, not readable"))};functionwriteAfterEnd(stream,cb){varer=newError("write after end");stream.emit("error",er);processNextTick(cb,er)}functionvalidChunk(stream,state,chunk,cb){varvalid=true;varer=false;if(chunk===null){er=newTypeError("May not write null values to stream")}elseif(!Buffer.isBuffer(chunk)&&typeofchunk!=="string"&&chunk!==undefined&&!state.objectMode){er=newTypeError("Invalid non-string/buffer chunk")}if(er){stream.emit("error",er);processNextTick(cb,er);valid=false}returnvalid}Writable.prototype.write=function(chunk,encoding,cb){varstate=this._writableState;varret=false;if(typeofencoding==="function"){cb=encoding;encoding=null}if(Buffer.isBuffer(chunk))encoding="buffer";elseif(!encoding)encoding=state.defaultEncoding;if(typeofcb!=="function")cb=nop;if(state.ended)writeAfterEnd(this,cb);elseif(validChunk(this,state,chunk,cb)){state.pendingcb++;ret=writeOrBuffer(this,state,chunk,encoding,cb)}returnret};Writable.prototype.cork=function(){varstate=this._writableState;state.corked++};Writable.prototype.uncork=function(){varstate=this._writableState;if(state.corked){state.corked--;if(!state.writing&&!state.corked&&!state.finished&&!state.bufferProcessing&&state.bufferedRequest)clearBuffer(this,state)}};Writable.prototype.setDefaultEncoding=functionsetDefaultEncoding(encoding){if(typeofencoding==="string")encoding=encoding.toLowerCase();if(!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((encoding+"").toLowerCase())>-1))thrownewTypeError("Unknown encoding: "+encoding);this._writableState.defaultEncoding=encoding;returnthis};functiondecodeChunk(state,chunk,enc
ObjectSeq.prototype.get=function(key,notSetValue){if(notSetValue!==undefined&&!this.has(key)){returnnotSetValue}returnthis._object[key]};ObjectSeq.prototype.has=function(key){returnthis._object.hasOwnProperty(key)};ObjectSeq.prototype.__iterate=function(fn,reverse){varobject=this._object;varkeys=this._keys;varmaxIndex=keys.length-1;for(varii=0;ii<=maxIndex;ii++){varkey=keys[reverse?maxIndex-ii:ii];if(fn(object[key],key,this)===false){returnii+1}}returnii};ObjectSeq.prototype.__iterator=function(type,reverse){varobject=this._object;varkeys=this._keys;varmaxIndex=keys.length-1;varii=0;returnnewIterator(function(){varkey=keys[reverse?maxIndex-ii:ii];returnii++>maxIndex?iteratorDone():iteratorValue(type,key,object[key])})};ObjectSeq.prototype[IS_ORDERED_SENTINEL]=true;createClass(IterableSeq,IndexedSeq);functionIterableSeq(iterable){this._iterable=iterable;this.size=iterable.length||iterable.size}IterableSeq.prototype.__iterateUncached=function(fn,reverse){if(reverse){returnthis.cacheResult().__iterate(fn,reverse)}variterable=this._iterable;variterator=getIterator(iterable);variterations=0;if(isIterator(iterator)){varstep;while(!(step=iterator.next()).done){if(fn(step.value,iterations++,this)===false){break}}}returniterations};IterableSeq.prototype.__iteratorUncached=function(type,reverse){if(reverse){returnthis.cacheResult().__iterator(type,reverse)}variterable=this._iterable;variterator=getIterator(iterable);if(!isIterator(iterator)){returnnewIterator(iteratorDone)}variterations=0;returnnewIterator(function(){varstep=iterator.next();returnstep.done?step:iteratorValue(type,iterations++,step.value)})};createClass(IteratorSeq,IndexedSeq);functionIteratorSeq(iterator){this._iterator=iterator;this._iteratorCache=[]}IteratorSeq.prototype.__iterateUncached=function(fn,reverse){if(reverse){returnthis.cacheResult().__iterate(fn,reverse)}variterator=this._iterator;varcache=this._iteratorCache;variterations=0;while(iterations<cache.length){if(fn(cache[iterations],iterations++,this)===false){returniterations}}varstep;while(!(step=iterator.next()).done){varval=step.value;cache[iterations]=val;if(fn(val,iterations++,this)===false){break}}returniterations};IteratorSeq.prototype.__iteratorUncached=function(type,reverse){if(reverse){returnthis.cacheResult().__iterator(type,reverse)}variterator=this._iterator;varcache=this._iteratorCache;variterations=0;returnnewIterator(function(){if(iterations>=cache.length){varstep=iterator.next();if(step.done){returnstep}cache[iterations]=step.value}returniteratorValue(type,iterations,cache[iterations++])})};functionisSeq(maybeSeq){return!!(maybeSeq&&maybeSeq[IS_SEQ_SENTINEL])}varEMPTY_SEQ;functionemptySequence(){returnEMPTY_SEQ||(EMPTY_SEQ=newArraySeq([]))}functionkeyedSeqFromValue(value){varseq=Array.isArray(value)?newArraySeq(value).fromEntrySeq():isIterator(value)?newIteratorSeq(value).fromEntrySeq():hasIterator(value)?newIterableSeq(value).fromEntrySeq():typeofvalue==="object"?newObjectSeq(value):undefined;if(!seq){thrownewTypeError("Expected Array or iterable object of [k, v] entries, "+"or keyed object: "+value)}returnseq}functionindexedSeqFromValue(value){varseq=maybeIndexedSeqFromValue(value);if(!seq){thrownewTypeError("Expected Array or iterable object of values: "+value)}returnseq}functionseqFromValue(value){varseq=maybeIndexedSeqFromValue(value)||typeofvalue==="object"&&newObjectSeq(value);if(!seq){thrownewTypeError("Expected Array or iterable object of values, or keyed object: "+value)}returnseq}functionmaybeIndexedSeqFromValue(value){returnisArrayLike(value)?newArraySeq(value):isIterator(value)?newIteratorSeq(value):hasIterator(value)?newIterableSeq(value):undefined}functionseqIterate(seq,fn,reverse,useKeys){varcache=seq._cache;if(cache){varmaxIndex=cache.length-1;for(varii=0;ii<=maxIndex;ii++){varentry=cache[reverse?maxIndex-ii:ii];if(fn(entry[1],useKeys?entry[0]:ii,seq)===false){returnii+1}}returnii}returnseq.__iterateUncached(fn,reverse)}functionseqIterator(seq,type,reverse,useKeys){varcache=
varRecordType=this.constructor;returnRecordType._empty||(RecordType._empty=makeRecord(this,emptyMap()))};Record.prototype.set=function(k,v){if(!this.has(k)){thrownewError('Cannot set unknown key "'+k+'" on '+recordName(this))}if(this._map&&!this._map.has(k)){vardefaultVal=this._defaultValues[k];if(v===defaultVal){returnthis}}varnewMap=this._map&&this._map.set(k,v);if(this.__ownerID||newMap===this._map){returnthis}returnmakeRecord(this,newMap)};Record.prototype.remove=function(k){if(!this.has(k)){returnthis}varnewMap=this._map&&this._map.remove(k);if(this.__ownerID||newMap===this._map){returnthis}returnmakeRecord(this,newMap)};Record.prototype.wasAltered=function(){returnthis._map.wasAltered()};Record.prototype.__iterator=function(type,reverse){varthis$0=this;returnKeyedIterable(this._defaultValues).map(function(_,k){returnthis$0.get(k)}).__iterator(type,reverse)};Record.prototype.__iterate=function(fn,reverse){varthis$0=this;returnKeyedIterable(this._defaultValues).map(function(_,k){returnthis$0.get(k)}).__iterate(fn,reverse)};Record.prototype.__ensureOwner=function(ownerID){if(ownerID===this.__ownerID){returnthis}varnewMap=this._map&&this._map.__ensureOwner(ownerID);if(!ownerID){this.__ownerID=ownerID;this._map=newMap;returnthis}returnmakeRecord(this,newMap,ownerID)};varRecordPrototype=Record.prototype;RecordPrototype[DELETE]=RecordPrototype.remove;RecordPrototype.deleteIn=RecordPrototype.removeIn=MapPrototype.removeIn;RecordPrototype.merge=MapPrototype.merge;RecordPrototype.mergeWith=MapPrototype.mergeWith;RecordPrototype.mergeIn=MapPrototype.mergeIn;RecordPrototype.mergeDeep=MapPrototype.mergeDeep;RecordPrototype.mergeDeepWith=MapPrototype.mergeDeepWith;RecordPrototype.mergeDeepIn=MapPrototype.mergeDeepIn;RecordPrototype.setIn=MapPrototype.setIn;RecordPrototype.update=MapPrototype.update;RecordPrototype.updateIn=MapPrototype.updateIn;RecordPrototype.withMutations=MapPrototype.withMutations;RecordPrototype.asMutable=MapPrototype.asMutable;RecordPrototype.asImmutable=MapPrototype.asImmutable;functionmakeRecord(likeRecord,map,ownerID){varrecord=Object.create(Object.getPrototypeOf(likeRecord));record._map=map;record.__ownerID=ownerID;returnrecord}functionrecordName(record){returnrecord._name||record.constructor.name||"Record"}functionsetProps(prototype,names){try{names.forEach(setProp.bind(undefined,prototype))}catch(error){}}functionsetProp(prototype,name){Object.defineProperty(prototype,name,{get:function(){returnthis.get(name)},set:function(value){invariant(this.__ownerID,"Cannot set on an immutable record.");this.set(name,value)}})}createClass(Set,SetCollection);functionSet(value){returnvalue===null||value===undefined?emptySet():isSet(value)&&!isOrdered(value)?value:emptySet().withMutations(function(set){variter=SetIterable(value);assertNotInfinite(iter.size);iter.forEach(function(v){returnset.add(v)})})}Set.of=function(){returnthis(arguments)};Set.fromKeys=function(value){returnthis(KeyedIterable(value).keySeq())};Set.prototype.toString=function(){returnthis.__toString("Set {","}")};Set.prototype.has=function(value){returnthis._map.has(value)};Set.prototype.add=function(value){returnupdateSet(this,this._map.set(value,true))};Set.prototype.remove=function(value){returnupdateSet(this,this._map.remove(value))};Set.prototype.clear=function(){returnupdateSet(this,this._map.clear())};Set.prototype.union=function(){variters=SLICE$0.call(arguments,0);iters=iters.filter(function(x){returnx.size!==0});if(iters.length===0){returnthis}if(this.size===0&&!this.__ownerID&&iters.length===1){returnthis.constructor(iters[0])}returnthis.withMutations(function(set){for(varii=0;ii<iters.length;ii++){SetIterable(iters[ii]).forEach(function(value){returnset.add(value)})}})};Set.prototype.intersect=function(){variters=SLICE$0.call(arguments,0);if(iters.length===0){returnthis}iters=iters.map(function(iter){returnSetIterable(iter)});varoriginalSet=this;returnthis.withMutations(function(set){originalSet.forEach(function(value){if(!iters.every(function(iter){returniter.includes(value)}))
;varaffectedPids=computeAffectedPids(oldRoutingTable,deltaAggregateNoEcho).add(actingPid).remove("meta");return{eventMap:Immutable.Map().withMutations(function(result){affectedPids.forEach(function(pid){varpatchForPid;if(pid===actingPid){varpart1=newPatch.Patch(echoCancelledTrie(Patch.biasedIntersection(newRoutingTable,delta.added)),echoCancelledTrie(Patch.biasedIntersection(oldRoutingTable,delta.removed)));varpart2=newPatch.Patch(Patch.biasedIntersection(deltaAggregateNoEcho.added,newMux.interestsOf(pid)),Patch.biasedIntersection(deltaAggregateNoEcho.removed,oldMux.interestsOf(pid)));patchForPid=part1.unsafeUnion(part2)}else{patchForPid=deltaAggregateNoEcho.viewFrom(oldMux.interestsOf(pid))}if(patchForPid.isNonEmpty()){result.set(pid,patchForPid)}})}),metaEvents:actingPid==="meta"?Immutable.List():Immutable.List.of(delta.computeAggregate(actingPid,oldRoutingTable,true).drop())}}functioncomputeAffectedPids(routingTable,delta){varcover=Trie._union(delta.added,delta.removed);routingTable=Trie.trieStep(routingTable,Patch.observe.meta.arity,Patch.observe.meta);returnTrie.matchTrie(cover,routingTable,Immutable.Set(),function(v1,v2,acc){returnacc.union(v2)})}Mux.prototype.routeMessage=function(body){if(Trie.matchValue(this.routingTable,body,null,function(a,b){returna||b})===null){returnTrie.matchValue(this.routingTable,Patch.observe(body),Immutable.Set(),function(a,b){returna.union(b)})}else{returnImmutable.Set()}};Mux.prototype.interestsOf=function(pid){returnthis.interestTable.get(pid,Trie.emptyTrie)};module.exports.Mux=Mux;module.exports.computeEvents=computeEvents;module.exports.computeAffectedPids=computeAffectedPids},{"./patch.js":239,"./trie.js":246,immutable:227}],239:[function(require,module,exports){"use strict";varTrie=require("./trie.js");varStruct=require("./struct.js");varImmutable=require("immutable");var__=Trie.__;var_$=Trie._$;functionPatch(added,removed){this.added=added;this.removed=removed}varemptyPatch=newPatch(Trie.emptyTrie,Trie.emptyTrie);varremoveEverythingPatch=newPatch(Trie.emptyTrie,Trie.compilePattern(true,__));vartrueLabel=Trie.trieSuccess(true);varobserve=Struct.makeConstructor("observe",["assertion"]);varatMeta=Struct.makeConstructor("at-meta",["assertion"]);varadvertise=Struct.makeConstructor("advertise",["assertion"]);functionprependAtMeta(p,level){while(level--){p=atMeta(p)}returnp}functionstripAtMeta(p,level){while(level--){if(atMeta.isClassOf(p)){p=p[0]}else{returnnull}}returnp}functionobserveAtMeta(p,level){if(level===0){returnTrie.compilePattern(true,observe(p))}else{returnTrie._union(Trie.compilePattern(true,observe(prependAtMeta(p,level))),Trie.compilePattern(true,atMeta(Trie.embeddedTrie(observeAtMeta(p,level-1)))))}}function_check(p){if(pinstanceofPatch){thrownewError("Cannot construct patch pattern using an embedded patch")}returnp}functionassert(p,metaLevel){returnnewPatch(Trie.compilePattern(true,prependAtMeta(_check(p),metaLevel||0)),Trie.emptyTrie)}functionretract(p,metaLevel){returnnewPatch(Trie.emptyTrie,Trie.compilePattern(true,prependAtMeta(_check(p),metaLevel||0)))}functionsub(p,metaLevel){returnnewPatch(observeAtMeta(_check(p),metaLevel||0),Trie.emptyTrie)}functionunsub(p,metaLevel){returnnewPatch(Trie.emptyTrie,observeAtMeta(_check(p),metaLevel||0))}functionpub(p,metaLevel){returnassert(advertise(_check(p)),metaLevel)}functionunpub(p,metaLevel){returnretract(advertise(_check(p)),metaLevel)}Patch.prototype.equals=function(other){if(!(otherinstanceofPatch))returnfalse;returnImmutable.is(this.added,other.added)&&Immutable.is(this.removed,other.removed)};Patch.prototype.isEmpty=function(){returnthis.added===Trie.emptyTrie&&this.removed===Trie.emptyTrie};Patch.prototype.isNonEmpty=function(){return!this.isEmpty()};Patch.prototype.hasAdded=function(){return!Trie.is_emptyTrie(this.added)};Patch.prototype.hasRemoved=function(){return!Trie.is_emptyTrie(this.removed)};Patch.prototype.lift=function(){returnnewPatch(Trie.compilePattern(true,atMeta(Trie.embeddedTrie(this.added))),Trie.compilePattern(true,atMeta(Trie.emb