(function () {var A=this;var ef={},fo=Object.assign,Ac={NOTHING:0,ERROR:1,WARN:2,INFO:4,DEBUG:5},Kg=function(e,$,r,a,E){return function(v){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};$>r()||E({namespace:a,level:$,label:e,log:fo({timestamp:new Date().toISOString(),logger:"kafkajs",message:v},n)})}},go=function(e){var $="".toUpperCase();return null==Ac[$]?e:Ac[$]},KE=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},$=e.level,r=void 0===$?Ac.INFO:$,a=e.logCreator,E=go(r),v=a(E),n=function(e){var $=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=go($);return t(e,r)},t=function(e){var $=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,r=function(){return null==$?E:$},a={info:Kg("INFO",Ac.INFO,r,e,v),error:Kg("ERROR",Ac.ERROR,r,e,v),warn:Kg("WARN",Ac.WARN,r,e,v),debug:Kg("DEBUG",Ac.DEBUG,r,e,v)};return fo(a,{namespace:n,setLogLevel:function(e){E=e}})};return t()};ef={LEVELS:Ac,createLogger:KE};var LE,ff,de,ho,io,ME,NE=false;function OE(e){console&&console.warn&&console.warn(e)}function F(){F.init.call(this)}function Lg(e){if("function"!=typeof e)throw new TypeError("The \"listener\" argument must be of type Function. Received type "+typeof e)}function jo(e){return void 0===e._maxListeners?F.defaultMaxListeners:e._maxListeners}function ko(e,t,r,n){var i,s,$;if(Lg(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),$=s[t]),void 0===$)$=s[t]=r,++e._eventsCount;else if("function"==typeof $?$=s[t]=n?[r,$]:[$,r]:n?$.unshift(r):$.push(r),(**jo(e))>0&&$.length>i&&!$.warned){$.warned=!0;var o=new Error("Possible EventEmitter memory **** detected. "+$.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");o.name="MaxListenersExceededWarning",o.emitter=e,o.type=t,o.count=$.length,OE(o)}return e}function PE(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function lo(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},**PE.bind(n);return i.listener=r,n.wrapFn=i,i}function mo(e,t,r){var n=e._events;if(void 0===n)return[];var **n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?RE(i):oo(i,i.length)}function no(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function oo(e,t){for(var r=new Array(t),n=0;n0&&(s=t[0]),s instanceof Error)throw s;var $=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw $.context=s,$}var o=i[e];if(void 0===o)return!1;if("function"==typeof o)ho(o,this,t);else{var v=o.length,a=oo(o,v);for(r=0;r=0;s--)if(r[s]===t||r[s].listener===t){$=r[s].listener,**s;break}if(i<0)return this;0===i?r.shift():QE(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,$||t)}return this},F.prototype.off=F.prototype.removeListener,F.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,s=Object.keys(r);for(n=0;n=0;n--)this.removeListener(e,t[n]);return this},F.prototype.listeners=function(e){return mo(this,e,!0)},F.prototype.rawListeners=function(e){return mo(this,e,!1)},F.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):no.call(e,t)},F.prototype.listenerCount=no,F.prototype.eventNames=function(){return this._eventsCount>0?LE(this._events):[]}}var SE={};function TE($,s){if(!($ instanceof s))throw new TypeError("Cannot call a class as a function")}var po=0,UE=function(){return po===Number.MAX_VALUE&&(po=0),po++},VE=function $(s,a){TE(this,$),this.id=UE(),this.type=s,this.timestamp=Date.now(),this.payload=a};SE=VE;var x,Bc,fc,qo,WE,XE,YE,ZE,ro,$E,_E,aF,bF,cF,dF,eF,fF,so,gF,hF,iF=false;function jF(r){return(jF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function ba(r,a){if(!(r instanceof a))throw new TypeError("Cannot call a class as a function")}function ca(r){return function(){var a,t=yj(r);if(uo()){var e=yj(this).constructor;a=Reflect.construct(t,arguments,e)}else a=t.apply(this,arguments);return kF(this,a)}}function kF(r,a){return!a||"object"!==jF(a)&&"function"!=typeof a?to(r):a}function to(r){if(void 0===r)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return r}function da(r,a){if("function"!=typeof a&&null!==a)throw new TypeError("Super expression must either be null or a function");r.prototype=Object.create(a&&a.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),a&&xj(r,a)}function lF(r){var a="function"==typeof Map?new Map:void 0;return(lF=function(r){if(null===r||!nF(r))return r;if("function"!=typeof r)throw new TypeError("Super expression must either be null or a function");if(void 0!==a){if(a.has(r))return a.get(r);a.set(r,t)}function t(){return mF(r,arguments,yj(this).constructor)}return t.prototype=Object.create(r.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),xj(t,r)})(r)}function mF(r,a,t){return(mF=uo()?Reflect.construct:function(r,a,t){var e=[null];e.push.apply(e,a);var $=new(Function.bind.apply(r,e));return t&&xj($,t.prototype),$}).apply(null,arguments)}function uo(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(r){return!1}}function nF(r){return-1!==Function.toString.call(r).indexOf("[native code]")}function xj(r,a){return(xj=Object.setPrototypeOf||function(r,a){return r.__proto__=a,r})(r,a)}function yj(r){return(yj=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)})(r)}function y(){if(iF)return;iF=true;x={};Bc=function(r){da(t,lF(Error));var a=ca(t);function t(r){var e,$=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).retriable,o=void 0===$||$;return ba(this,t),e=a.call(this,r),Error.captureStackTrace(to(e),e.constructor),e.message=r.message||r,e.name="KafkaJSError",e.retriable=o,e.helpUrl=r.helpUrl,e}return t}();fc=function(r){da(t,Bc);var a=ca(t);function t(r){var e;return ba(this,t),(e=a.call(this,r,{retriable:!1})).name="KafkaJSNonRetriableError",e}return t}();qo=function(r){da(t,Bc);var a=ca(t);function t(r){var e;return ba(this,t),(e=a.call(this,r,{retriable:r.retriable})).type=r.type,e.code=r.code,e.name="KafkaJSProtocolError",e}return t}();WE=function(r){da(t,qo);var a=ca(t);function t(r,e){var $,o=e.topic,n=e.partition;return ba(this,t),($=a.call(this,r)).topic=o,$.partition=n,$.name="KafkaJSOffsetOutOfRange",$}return t}();XE=function(r){da(t,fc);var a=ca(t);function t(r,e){var $,o=e.retryCount,n=e.retryTime;return ba(this,t),($=a.call(this,r)).stack="".concat($.name,"\n Caused by: ").concat(r.stack),$.originalError=r,$.retryCount=o,$.retryTime=n,$.name="KafkaJSNumberOfRetriesExceeded",$}return t}();YE=function(r){da(t,Bc);var a=ca(t);function t(r){var e,$=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=$.broker,n=$.code;return ba(this,t),(e=a.call(this,r)).broker=o,e.code=n,e.name="KafkaJSConnectionError",e}return t}();ZE=function(r){da(t,Bc);var a=ca(t);function t(r){var e,$=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=$.broker,n=$.correlationId,s=$.createdAt,i=$.sentAt,c=$.pendingDuration;return ba(this,t),(e=a.call(this,r)).broker=o,e.correlationId=n,e.createdAt=s,e.sentAt=i,e.pendingDuration=c,e.name="KafkaJSRequestTimeoutError",e}return t}();ro=function(r){da(t,Bc);var a=ca(t);function t(){var r;return ba(this,t),(r=a.apply(this,arguments)).name="KafkaJSMetadataNotLoaded",r}return t}();$E=function(r){da(t,ro);var a=ca(t);function t(r){var e,$=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).topic;return ba(this,t),(e=a.call(this,r)).topic=$,e.name="KafkaJSTopicMetadataNotLoaded",e}return t}();_E=function(r){da(t,Bc);var a=ca(t);function t(r){var e,$=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=$.topic,n=$.unknownPartitions;return ba(this,t),(e=a.call(this,r)).topic=o,e.unknownPartitions=n,e.name="KafkaJSStaleTopicMetadataAssignment",e}return t}();aF=function(r){da(t,fc);var a=ca(t);function t(r){var e,$=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=$.apiKey,n=$.apiName;return ba(this,t),(e=a.call(this,r)).apiKey=o,e.apiName=n,e.name="KafkaJSServerDoesNotSupportApiKey",e}return t}();bF=function(r){da(t,Bc);var a=ca(t);function t(){var r;return ba(this,t),(r=a.apply(this,arguments)).name="KafkaJSBrokerNotFound",r}return t}();cF=function(r){da(t,fc);var a=ca(t);function t(){var r;return ba(this,t),(r=a.apply(this,arguments)).name="KafkaJSPartialMessageError",r}return t}();dF=function(r){da(t,fc);var a=ca(t);function t(){var r;return ba(this,t),(r=a.apply(this,arguments)).name="KafkaJSSASLAuthenticationError",r}return t}();eF=function(r){da(t,fc);var a=ca(t);function t(){var r;return ba(this,t),(r=a.apply(this,arguments)).name="KafkaJSGroupCoordinatorNotFound",r}return t}();fF=function(r){da(t,fc);var a=ca(t);function t(){var r;return ba(this,t),(r=a.apply(this,arguments)).name="KafkaJSNotImplemented",r}return t}();so=function(r){da(t,fc);var a=ca(t);function t(){var r;return ba(this,t),(r=a.apply(this,arguments)).name="KafkaJSTimeout",r}return t}();gF=function(r){da(t,so);var a=ca(t);function t(){var r;return ba(this,t),(r=a.apply(this,arguments)).name="KafkaJSLockTimeout",r}return t}();hF=function(r){da(t,fc);var a=ca(t);function t(){var r;return ba(this,t),(r=a.apply(this,arguments)).name="KafkaJSUnsupportedMagicByteInMessageSet",r}return t}();x={KafkaJSError:Bc,KafkaJSNonRetriableError:fc,KafkaJSPartialMessageError:cF,KafkaJSBrokerNotFound:bF,KafkaJSProtocolError:qo,KafkaJSConnectionError:YE,KafkaJSRequestTimeoutError:ZE,KafkaJSSASLAuthenticationError:dF,KafkaJSNumberOfRetriesExceeded:XE,KafkaJSOffsetOutOfRange:WE,KafkaJSGroupCoordinatorNotFound:eF,KafkaJSNotImplemented:fF,KafkaJSMetadataNotLoaded:ro,KafkaJSTopicMetadataNotLoaded:$E,KafkaJSStaleTopicMetadataAssignment:_E,KafkaJSTimeout:so,KafkaJSLockTimeout:gF,KafkaJSServerDoesNotSupportApiKey:aF,KafkaJSUnsupportedMagicByteInMessageSet:hF}}var ee={};function oF(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function vo(e,r){for(var t=0;t0){var t=new SE(e,r);this.emitter.emit(e,t)}}},{key:"addListener",value:function(e,r){var t=this;return this.emitter.addListener(e,r),function(){return t.emitter.removeListener(e,r)}}}]),e}();var tF={},Mg=ef.LEVELS;tF=function(){return function(r){var e=r.namespace,$=r.level,a=r.label,o=r.log,l=e?"[".concat(e,"] "):"",n=JSON.stringify(Object.assign({level:a},o,{message:"".concat(l).concat(o.message)}));switch($){case Mg.INFO:return console.info(n);case Mg.ERROR:return console.error(n);case Mg.WARN:return console.warn(n);case Mg.DEBUG:return console.log(n);}}};var Fa,pb,wo,xo,Ng,yo,uF,fe,zo,Ao,Bo,Za,ed,ge,Co,zj,Do,Eo,Ga,a,vF=false;function J($,r,t){this.low=0|$,this.high=0|r,this.unsigned=!!t}function Ha($){return!0===($&&$.__isLong__)}function fd($,r){var t,o,i;return r?(**0<=($>>>=0)&&$<256)&&(o=xo[$])?o:(t=L($,(0|$)<0?-1:0,!0),i&&(xo[$]=t),t):(i=-128<=($|=0)&&$<128)&&(o=wo[$])?o:(t=L($,$<0?-1:0,!1),i&&(wo[$]=t),t)}function $a($,r){if(isNaN($))return r?ed:Za;if(r){if($<0)return ed;if($>=zo)return Eo}else{if($<=-Ao)return Ga;if($+1>=Ao)return Do}return $<0?$a(-$,r).neg():L($%fe|0,$/fe|0,r)}function L($,r,t){return new J($,r,t)}function Aj($,r,t){if(0===$.length)throw Error("empty string");if("NaN"===$||"Infinity"===$||"+Infinity"===$||"-Infinity"===$)return Za;if("number"==typeof r?(t=r,r=!1):r=!!r,(t=t||10)<2||360)throw Error("interior hyphen");if(0===o)return Aj($.substring(1),r,t).neg();for(var i=$a(Ng(t,8)),n=Za,a=0;a<$.length;a+=8){var e=Math.min(8,$.length-a),s=parseInt($.substring(a,a+e),t);if(e<8){var v=$a(Ng(t,e));n=n.mul(v).add($a(s))}else n=(n=n.mul(i)).add($a(s))}return n.unsigned=r,n}function qb($,r){return"number"==typeof $?$a($,r):"string"==typeof $?Aj($,r):L($.low,$.high,"boolean"==typeof r?r:$.unsigned)}function Ia(){if(vF)return;vF=true;Fa={};Fa=J;pb=null;try{pb=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch(e){}J.prototype.__isLong__,Object.defineProperty(J.prototype,"__isLong__",{value:!0}),J.isLong=Ha;wo={};xo={};J.fromInt=fd,J.fromNumber=$a,J.fromBits=L;Ng=Math.pow;J.fromString=Aj,J.fromValue=qb;yo=65536;uF=1<<24;fe=yo*yo;zo=fe*fe;Ao=zo/2;Bo=fd(uF);Za=fd(0);J.ZERO=Za;ed=fd(0,!0);J.UZERO=ed;ge=fd(1);J.ONE=ge;Co=fd(1,!0);J.UONE=Co;zj=fd(-1);J.NEG_ONE=zj;Do=L(-1,2147483647,!1);J.MAX_VALUE=Do;Eo=L(-1,-1,!0);J.MAX_UNSIGNED_VALUE=Eo;Ga=L(0,-2147483648,!1);J.MIN_VALUE=Ga;a=J.prototype;a.toInt=function(){return this.unsigned?this.low>>>0:this.low},a.toNumber=function(){return this.unsigned?(this.high>>>0)*fe+(this.low>>>0):this.high*fe+(this.low>>>0)},a.toString=function($){if(($=$||10)<2||36<$)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative()){if(this.eq(Ga)){var r=$a($),t=this.div(r),o=t.mul(r).sub(this);return t.toString($)+o.toInt().toString($)}return"-"+this.neg().toString($)}for(var i=$a(Ng($,6),this.unsigned),n=this,a="";;){var e=n.div(i),s=(n.sub(e.mul(i)).toInt()>>>0).toString($);if((n=e).isZero())return s+a;for(;s.length<6;)s="0"+s;a=""+s+a}},a.getHighBits=function(){return this.high},a.getHighBitsUnsigned=function(){return this.high>>>0},a.getLowBits=function(){return this.low},a.getLowBitsUnsigned=function(){return this.low>>>0},a.getNumBitsAbs=function(){if(this.isNegative())return this.eq(Ga)?64:this.neg().getNumBitsAbs();for(var $=0!=this.high?this.high:this.low,r=31;r>0&&0==($&1<=0},a.isOdd=function(){return 1==(1&this.low)},a.isEven=function(){return 0==(1&this.low)},a.equals=function($){return Ha($)||($=qb($)),(this.unsigned===$.unsigned||this.high>>>31!=1||$.high>>>31!=1)&&this.high===$.high&&this.low===$.low},a.eq=a.equals,a.notEquals=function($){return!this.eq($)},a.neq=a.notEquals,a.ne=a.notEquals,a.lessThan=function($){return this.comp($)<0},a.lt=a.lessThan,a.lessThanOrEqual=function($){return this.comp($)<=0},a.lte=a.lessThanOrEqual,a.le=a.lessThanOrEqual,a.greaterThan=function($){return this.comp($)>0},a.gt=a.greaterThan,a.greaterThanOrEqual=function($){return this.comp($)>=0},a.gte=a.greaterThanOrEqual,a.ge=a.greaterThanOrEqual,a.compare=function($){if(Ha($)||($=qb($)),this.eq($))return 0;var r=this.isNegative(),t=$.isNegative();return r&&!t?-1:!r&&t?1:this.unsigned?$.high>>>0>this.high>>>0||$.high===this.high&&$.low>>>0>this.low>>>0?-1:1:this.sub($).isNegative()?-1:1},a.comp=a.compare,a.negate=function(){return!this.unsigned&&this.eq(Ga)?Ga:this.not().add(ge)},a.neg=a.negate,a.add=function($){Ha($)||($=qb($));var r=this.high>>>16,t=65535&this.high,o=this.low>>>16,**65535&this.low,n=$.high>>>16,a=65535&$.high,e=$.low>>>16,s=0,v=0,U=0,**0;return U+=(I+=i+(65535&$.low))>>>16,v+=(U+=o+e)>>>16,s+=(v+=t+a)>>>16,s+=r+n,L((U&=65535)<<16|(I&=65535),(s&=65535)<<16|(v&=65535),this.unsigned)},a.subtract=function($){return Ha($)||($=qb($)),this.add($.neg())},a.sub=a.subtract,a.multiply=function($){if(this.isZero())return Za;if(Ha($)||($=qb($)),pb)return L(pb.mul(this.low,this.high,$.low,$.high),pb.get_high(),this.unsigned);if($.isZero())return Za;if(this.eq(Ga))return $.isOdd()?Ga:Za;if($.eq(Ga))return this.isOdd()?Ga:Za;if(this.isNegative())return $.isNegative()?this.neg().mul($.neg()):this.neg().mul($).neg();if($.isNegative())return this.mul($.neg()).neg();if(this.lt(Bo)&&$.lt(Bo))return $a(this.toNumber()*$.toNumber(),this.unsigned);var r=this.high>>>16,t=65535&this.high,o=this.low>>>16,**65535&this.low,n=$.high>>>16,a=65535&$.high,e=$.low>>>16,s=65535&$.low,v=0,U=0,**0,h=0;return I+=(h+=i*s)>>>16,U+=(I+=o*s)>>>16,I&=65535,U+=(I+=i*e)>>>16,v+=(U+=t*s)>>>16,U&=65535,v+=(U+=o*e)>>>16,U&=65535,v+=(U+=i*a)>>>16,v+=r*s+t*e+o*a+i*n,L((I&=65535)<<16|(h&=65535),(v&=65535)<<16|(U&=65535),this.unsigned)},a.mul=a.multiply,a.divide=function($){if(Ha($)||($=qb($)),$.isZero())throw Error("division by zero");var r,t,o;if(pb)return this.unsigned||-2147483648!==this.high||-1!==$.low||-1!==$.high?L((this.unsigned?pb.div_u:pb.div_s)(this.low,this.high,$.low,$.high),pb.get_high(),this.unsigned):this;if(this.isZero())return this.unsigned?ed:Za;if(this.unsigned){if($.unsigned||($=$.toUnsigned()),$.gt(this))return ed;if($.gt(this.shru(1)))return Co;o=ed}else{if(this.eq(Ga))return $.eq(ge)||$.eq(zj)?Ga:$.eq(Ga)?ge:(r=this.shr(1).div($).shl(1)).eq(Za)?$.isNegative()?ge:zj:(t=this.sub($.mul(r)),o=r.add(t.div($)));if($.eq(Ga))return this.unsigned?ed:Za;if(this.isNegative())return $.isNegative()?this.neg().div($.neg()):this.neg().div($).neg();if($.isNegative())return this.div($.neg()).neg();o=Za}for(t=this;t.gte($);){r=Math.max(1,Math.floor(t.toNumber()/$.toNumber()));for(var **Math.ceil(Math.log(r)/Math.LN2),n=i<=48?1:Ng(2,i-48),a=$a(r),e=a.mul($);e.isNegative()||e.gt(t);)e=(a=$a(r-=n,this.unsigned)).mul($);a.isZero()&&(a=ge),o=o.add(a),t=t.sub(e)}return o},a.div=a.divide,a.modulo=function($){return Ha($)||($=qb($)),pb?L((this.unsigned?pb.rem_u:pb.rem_s)(this.low,this.high,$.low,$.high),pb.get_high(),this.unsigned):this.sub(this.div($).mul($))},a.mod=a.modulo,a.rem=a.modulo,a.not=function(){return L(~this.low,~this.high,this.unsigned)},a.and=function($){return Ha($)||($=qb($)),L(this.low&$.low,this.high&$.high,this.unsigned)},a.or=function($){return Ha($)||($=qb($)),L(this.low|$.low,this.high|$.high,this.unsigned)},a.xor=function($){return Ha($)||($=qb($)),L(this.low^$.low,this.high^$.high,this.unsigned)},a.shiftLeft=function($){return Ha($)&&($=$.toInt()),0==($&=63)?this:$<32?L(this.low<<$,this.high<<$|this.low>>>32-$,this.unsigned):L(0,this.low<<$-32,this.unsigned)},a.shl=a.shiftLeft,a.shiftRight=function($){return Ha($)&&($=$.toInt()),0==($&=63)?this:$<32?L(this.low>>>$|this.high<<32-$,this.high>>$,this.unsigned):L(this.high>>$-32,this.high>=0?0:-1,this.unsigned)},a.shr=a.shiftRight,a.shiftRightUnsigned=function($){if(Ha($)&&($=$.toInt()),0===($&=63))return this;var r=this.high;return $<32?L(this.low>>>$|r<<32-$,r>>>$,this.unsigned):L(32===$?r:r>>>$-32,0,this.unsigned)},a.shru=a.shiftRightUnsigned,a.shr_u=a.shiftRightUnsigned,a.toSigned=function(){return this.unsigned?L(this.low,this.high,!1):this},a.toUnsigned=function(){return this.unsigned?this:L(this.low,this.high,!0)},a.toBytes=function($){return $?this.toBytesLE():this.toBytesBE()},a.toBytesLE=function(){var $=this.high,r=this.low;return[255&r,r>>>8&255,r>>>16&255,r>>>24,255&$,$>>>8&255,$>>>16&255,$>>>24]},a.toBytesBE=function(){var $=this.high,r=this.low;return[$>>>24,$>>>16&255,$>>>8&255,255&$,r>>>24,r>>>16&255,r>>>8&255,255&r]},J.fromBytes=function($,r,t){return t?J.fromBytesLE($,r):J.fromBytesBE($,r)},J.fromBytesLE=function($,r){return new J($[0]|$[1]<<8|$[2]<<16|$[3]<<24,$[4]|$[5]<<8|$[6]<<16|$[7]<<24,r)},J.fromBytesBE=function($,r){return new J($[4]<<24|$[5]<<16|$[6]<<8|$[7],$[0]<<24|$[1]<<16|$[2]<<8|$[3],r)}}var wF,xF=false;function yF(){if(xF)return;xF=true;wF={};wF=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}}var zF,AF=false;function BF(){if(AF)return;AF=true;zF={};zF="function"==typeof Object.create?function(t,o){t.super_=o,t.prototype=Object.create(o.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:function(t,o){t.super_=o;var e=function(){};e.prototype=o.prototype,t.prototype=new e,t.prototype.constructor=t}}var he,ie,_a,X,hf,gd,Bj,Fo,CF=false;function Cj(){throw new Error("setTimeout has not been defined")}function Dj(){throw new Error("clearTimeout has not been defined")}function Go($){if(he===setTimeout)return setTimeout($,0);if((he===Cj||!he)&&setTimeout)return he=setTimeout,setTimeout($,0);try{return he($,0)}catch(e){try{return he.call(null,$,0)}catch(e){return he.call(this,$,0)}}}function DF($){if(ie===clearTimeout)return clearTimeout($);if((ie===Dj||!ie)&&clearTimeout)return ie=clearTimeout,clearTimeout($);try{return ie($)}catch(e){try{return ie.call(null,$)}catch(e){return ie.call(this,$)}}}function EF(){Bj&&hf&&(Bj=!1,hf.length?gd=hf.concat(gd):Fo=-1,gd.length&&Ho())}function Ho(){if(!Bj){var $=Go(EF);Bj=!0;for(var e=gd.length;e;){for(hf=gd,gd=[];++Fo1)for(var r=1;r=3&&($.depth=arguments[2]),arguments.length>=4&&($.colors=arguments[3]),Hj(e)?$.showHidden=e:e&&No($,e),Ec($.showHidden)&&($.showHidden=!1),Ec($.depth)&&($.depth=2),Ec($.colors)&&($.colors=!1),Ec($.customInspect)&&($.customInspect=!0),$.colors&&($.stylize=_F),Pg($,r,$.depth)}function _F(r,e){var $=Dc.styles[e];return $?"\x1B["+Dc.colors[$][0]+"m"+r+"\x1B["+Dc.colors[$][1]+"m":r}function aG(r,e){return r}function bG(r){var e={};return r.forEach(function(r,$){e[r]=!0}),e}function Pg(r,e,$){if(r.customInspect&&e&&Ug(e.inspect)&&e.inspect!==Mo&&(!e.constructor||e.constructor.prototype!==e)){var t=e.inspect($,r);return Rg(t)||(t=Pg(r,t,$)),t}var o=cG(r,e);if(o)return o;var **Object.keys(e),n=bG(i);if(r.showHidden&&(**Object.getOwnPropertyNames(e)),Tg(e)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return Fj(e);if(0===i.length){if(Ug(e)){var a=e.name?": "+e.name:"";return r.stylize("[Function"+a+"]","special")}if(Sg(e))return r.stylize(RegExp.prototype.toString.call(e),"regexp");if(Ij(e))return r.stylize(Date.prototype.toString.call(e),"date");if(Tg(e))return Fj(e)}var s,p="",u=!1,k=["{","}"];(Po(e)&&(u=!0,k=["[","]"]),Ug(e))&&(p=" [Function"+(e.name?": "+e.name:"")+"]");return Sg(e)&&(p=" "+RegExp.prototype.toString.call(e)),Ij(e)&&(p=" "+Date.prototype.toUTCString.call(e)),Tg(e)&&(p=" "+Fj(e)),0!==i.length||u&&0!=e.length?$<0?Sg(e)?r.stylize(RegExp.prototype.toString.call(e),"regexp"):r.stylize("[Object]","special"):(r.seen.push(e),s=u?dG(r,e,$,n,i):i.map(function(t){return Gj(r,e,$,n,t,u)}),r.seen.pop(),eG(s,p,k)):k[0]+p+k[1]}function cG(r,e){if(Ec(e))return r.stylize("undefined","undefined");if(Rg(e)){var $="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,"\"")+"'";return r.stylize($,"string")}return Qo(e)?r.stylize(""+e,"number"):Hj(e)?r.stylize(""+e,"boolean"):Qg(e)?r.stylize("null","null"):void 0}function Fj(r){return"["+Error.prototype.toString.call(r)+"]"}function dG(r,e,$,t,o){for(var i=[],n=0,a=e.length;n-1&&(a=i?a.split("\n").map(function(r){return" "+r}).join("\n").substr(2):"\n"+a.split("\n").map(function(r){return" "+r}).join("\n")):a=r.stylize("[Circular]","special")),Ec(n)){if(i&&o.match(/^\d+$/))return a;(n=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(n=n.substr(1,n.length-2),n=r.stylize(n,"name")):(n=n.replace(/'/g,"\\'").replace(/\\"/g,"\"").replace(/(^"|"$)/g,"'"),n=r.stylize(n,"string"))}return n+": "+a}function eG(r,e,$){return r.reduce(function(r,e){return 0,e.indexOf("\n")>=0&&0,r+e.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?$[0]+(""===e?"":e+"\n ")+" "+r.join(",\n ")+" "+$[1]:$[0]+e+" "+r.join(", ")+" "+$[1]}function Po(r){return Array.isArray(r)}function Hj(r){return"boolean"==typeof r}function Qg(r){return null===r}function fG(r){return null==r}function Qo(r){return"number"==typeof r}function Rg(r){return"string"==typeof r}function gG(r){return"symbol"==typeof r}function Ec(r){return void 0===r}function Sg(r){return je(r)&&"[object RegExp]"===Jj(r)}function je(r){return"object"==typeof r&&null!==r}function Ij(r){return je(r)&&"[object Date]"===Jj(r)}function Tg(r){return je(r)&&("[object Error]"===Jj(r)||r instanceof Error)}function Ug(r){return"function"==typeof r}function hG(r){return null===r||"boolean"==typeof r||"number"==typeof r||"string"==typeof r||"symbol"==typeof r||void 0===r}function Jj(r){return Object.prototype.toString.call(r)}function Kj(r){return r<10?"0"+r.toString(10):r.toString(10)}function iG(){var r=new Date,e=[Kj(r.getHours()),Kj(r.getMinutes()),Kj(r.getSeconds())].join(":");return[r.getDate(),WF[r.getMonth()],e].join(" ")}function Ro(r,e){return Object.prototype.hasOwnProperty.call(r,e)}function jG(r,e){if(!r){var $=new Error("Promise was rejected with a falsy value");$.reason=r,r=$}return e(r)}function kG(r){if("function"!=typeof r)throw new TypeError("The \"original\" argument must be of type Function");function e(){for(var e=[],$=0;$=o)return r;switch(r){case"%s":return String(t[$++]);case"%d":return Number(t[$++]);case"%j":try{return JSON.stringify(t[$++])}catch(e){return"[Circular]"}default:return r;}}),n=t[$];$0&&void 0!==arguments[0]?arguments[0]:{},a=t.timeout,n=void 0===a?1e3:a,$=t.description,o=void 0===$?null:$;mG(this,r),this[ya.LOCKED]=!1,this[ya.TIMEOUT]=n,this[ya.WAITING]=new Set,this[ya.TIMEOUT_ERROR_MESSAGE]=function(){var r=pG(sG,e[ya.WAITING].size);return o?"".concat(r,": \"").concat(o,"\""):r}}return nG(r,[{key:"acquire",value:function(){var r=Mj(regeneratorRuntime.mark(function r(){var e=this;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Promise(function(r,t){if(!e[ya.LOCKED])return e[ya.LOCKED]=!0,r();var a=null,n=function(){var t=Mj(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(e[ya.LOCKED]){t.next=5;break}return e[ya.LOCKED]=!0,clearTimeout(a),e[ya.WAITING].delete(n),t.abrupt("return",r());case 5:case"end":return t.stop();}},t)}));return function(){return t.apply(this,arguments)}}();e[ya.WAITING].add(n),a=setTimeout(function(){return t(new rG(e[ya.TIMEOUT_ERROR_MESSAGE]()))},e[ya.TIMEOUT])}));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()},{key:"release",value:function(){var r=Mj(regeneratorRuntime.mark(function r(){var e;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(this[ya.LOCKED]=!1,!(e=this[ya.WAITING].values().next().value)){r.next=4;break}return r.abrupt("return",e());case 4:case"end":return r.stop();}},r,this)}));return function(){return r.apply(this,arguments)}}()}]),r}();var Vg,tG,uG,vG,wG=false;function Uo($){var r=$.length;if(r%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var o=$.indexOf("=");return-1===o&&(o=r),[o,o===r?0:4-o%4]}function xG($){var r=Uo($),o=r[0],e=r[1];return 3*(o+e)/4-e}function yG($,r,o){return 3*(r+o)/4-o}function zG($){var r,o,e=Uo($),a=e[0],c=e[1],t=new $ERJc$var$Arr(yG($,a,c)),v=0,E=c>0?a-4:a;for(o=0;o>16&255,t[v++]=r>>8&255,t[v++]=255&r;return 2===c&&(r=$ERJc$var$revLookup[$.charCodeAt(o)]<<2|$ERJc$var$revLookup[$.charCodeAt(o+1)]>>4,t[v++]=255&r),1===c&&(r=$ERJc$var$revLookup[$.charCodeAt(o)]<<10|$ERJc$var$revLookup[$.charCodeAt(o+1)]<<4|$ERJc$var$revLookup[$.charCodeAt(o+2)]>>2,t[v++]=r>>8&255,t[v++]=255&r),t}function AG($){return $ERJc$var$lookup[$>>18&63]+$ERJc$var$lookup[$>>12&63]+$ERJc$var$lookup[$>>6&63]+$ERJc$var$lookup[63&$]}function BG($,r,o){for(var e,a=[],c=r;ct?t:c+16383));return 1===e?(r=$[o-1],a.push($ERJc$var$lookup[r>>2]+$ERJc$var$lookup[r<<4&63]+"==")):2===e&&(r=($[o-2]<<8)+$[o-1],a.push($ERJc$var$lookup[r>>10]+$ERJc$var$lookup[r>>4&63]+$ERJc$var$lookup[r<<2&63]+"=")),a.join("")}function DG(){if(wG)return;wG=true;Vg={};tG=xG;Vg.byteLength=tG;uG=zG;Vg.toByteArray=uG;vG=CG;Vg.fromByteArray=vG;for(var $ERJc$var$lookup=[],$ERJc$var$revLookup=[],$ERJc$var$Arr="undefined"!=typeof Uint8Array?Uint8Array:Array,$ERJc$var$code="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$ERJc$var$**0,$ERJc$var$len=$ERJc$var$code.length;$ERJc$var$i<$ERJc$var$len;++$ERJc$var$i)$ERJc$var$lookup[$ERJc$var$i]=$ERJc$var$code[$ERJc$var$i],$ERJc$var$revLookup[$ERJc$var$code.charCodeAt($ERJc$var$i)]=$ERJc$var$i;$ERJc$var$revLookup["-".charCodeAt(0)]=62,$ERJc$var$revLookup["_".charCodeAt(0)]=63}var Nj,EG,FG,GG=false;function HG(){if(GG)return;GG=true;Nj={};EG=function(t,r,o,a,$){var e,f,**8*$-a-1,p=(1<>1,M=-7,w=o?$-1:0,L=o?-1:1,k=t[r+w];for(w+=L,e=k&(1<<-M)-1,k>>=-M,M+=i;M>0;e=256*e+t[r+w],w+=L,M-=8);for(f=e&(1<<-M)-1,e>>=-M,M+=a;M>0;f=256*f+t[r+w],w+=L,M-=8);if(0===e)e=1-h;else{if(e===p)return f?NaN:1/0*(k?-1:1);f+=Math.pow(2,a),e-=h}return(k?-1:1)*f*Math.pow(2,e-a)};Nj.read=EG;FG=function(t,r,o,a,$,e){var f,i,p,h=8*e-$-1,M=(1<>1,L=23===$?Math.pow(2,-24)-Math.pow(2,-77):0,k=a?0:e-1,s=a?1:-1,x=r<0||0===r&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(**isNaN(r)?1:0,f=M):(f=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-f))<1&&(f--,p*=2),(r+=f+w>=1?L/p:L*Math.pow(2,1-w))*p>=2&&(f++,p/=2),f+w>=M?(**0,f=M):f+w>=1?(i=(r*p-1)*Math.pow(2,$),f+=w):(**r*Math.pow(2,w-1)*Math.pow(2,$),f=0));$>=8;t[o+k]=255&i,k+=s,i/=256,$-=8);for(f=f<<$|i,h+=$;h>0;t[o+k]=255&f,k+=s,f/=256,h-=8);t[o+k-s]|=128*x};Nj.write=FG}var Vo,IG,JG=false;function Wo(){if(JG)return;JG=true;Vo={};IG={}.toString;Vo=Array.isArray||function(r){return"[object Array]"==IG.call(r)}}var r,Oj,ke,Xo,KG,LG,Yo,MG,Zo,NG,OG=false;function PG(){try{var r=new Uint8Array(1);return r.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===r.foo()&&"function"==typeof r.subarray&&0===r.subarray(1,1).byteLength}catch(e){return!1}}function Wg(){return b.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function hc(r,e){if(Wg()=Wg())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Wg().toString(16)+" bytes");return 0|r}function UG(r){return+r!=r&&(r=0),b.alloc(+r)}function ap(r,e){if(b.isBuffer(r))return r.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(r)||r instanceof ArrayBuffer))return r.byteLength;"string"!=typeof r&&(r=""+r);var t=r.length;if(0===t)return 0;for(var $=!1;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":case void 0:return Zg(r).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*t;case"hex":return t>>>1;case"base64":return ip(r).length;default:if($)return Zg(r).length;e=(""+e).toLowerCase(),$=!0;}}function VG(r,e,t){var $=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===t||t>this.length)&&(t=this.length),t<=0)return"";if((t>>>=0)<=(e>>>=0))return"";for(r||(r="utf8");;)switch(r){case"hex":return dH(this,e,t);case"utf8":case"utf-8":return ep(this,e,t);case"ascii":return bH(this,e,t);case"latin1":case"binary":return cH(this,e,t);case"base64":return _G(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return eH(this,e,t);default:if($)throw new TypeError("Unknown encoding: "+r);r=(r+"").toLowerCase(),$=!0;}}function id(r,e,t){var $=r[e];r[e]=r[t],r[t]=$}function bp(r,e,t,$,n){if(0===r.length)return-1;if("string"==typeof t?($=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,isNaN(t)&&(t=n?0:r.length-1),t<0&&(t=r.length+t),t>=r.length){if(n)return-1;t=r.length-1}else if(t<0){if(!n)return-1;t=0}if("string"==typeof e&&(e=b.from(e,$)),b.isBuffer(e))return 0===e.length?-1:**(r,e,t,$,n);if("number"==typeof e)return e&=255,b.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(r,e,t):Uint8Array.prototype.lastIndexOf.call(r,e,t):**(r,[e],t,$,n);throw new TypeError("val must be string, number or Buffer")}function **(r,e,t,$,n){var f,h=1,a=r.length,**e.length;if(void 0!==$&&("ucs2"===($=String($).toLowerCase())||"ucs-2"===$||"utf16le"===$||"utf-16le"===$)){if(r.length<2||e.length<2)return-1;h=2,a/=2,i/=2,t/=2}function R(r,e){return 1===h?r[e]:r.readUInt16BE(e*h)}if(n){var o=-1;for(f=t;fa&&(t=a-i),f=t;f>=0;f--){for(var u=!0,s=0;sn&&($=n):$=n;var f=e.length;if(f%2!=0)throw new TypeError("Invalid hex string");$>f/2&&($=f/2);for(var h=0;h<$;++h){var a=parseInt(e.substr(2*h,2),16);if(isNaN(a))return h;r[t+h]=a}return h}function XG(r,e,t,$){return $g(Zg(e,r.length-t),r,t,$)}function dp(r,e,t,$){return $g(iH(e),r,t,$)}function YG(r,e,t,$){return dp(r,e,t,$)}function ZG(r,e,t,$){return $g(ip(e),r,t,$)}function $G(r,e,t,$){return $g(jH(e,r.length-t),r,t,$)}function _G(r,e,t){return 0===e&&t===r.length?Oj.fromByteArray(r):Oj.fromByteArray(r.slice(e,t))}function ep(r,e,t){t=Math.min(r.length,t);for(var $=[],n=e;n239?4:R>223?3:R>191?2:1;if(n+u<=t)switch(u){case 1:R<128&&(o=R);break;case 2:128==(192&(f=r[n+1]))&&(i=(31&R)<<6|63&f)>127&&(o=i);break;case 3:f=r[n+1],h=r[n+2],128==(192&f)&&128==(192&h)&&(i=(15&R)<<12|(63&f)<<6|63&h)>2047&&(i<55296||i>57343)&&(o=i);break;case 4:f=r[n+1],h=r[n+2],a=r[n+3],128==(192&f)&&128==(192&h)&&128==(192&a)&&(i=(15&R)<<18|(63&f)<<12|(63&h)<<6|63&a)>65535&&i<1114112&&(o=i);}null===o?(o=65533,u=1):o>65535&&(o-=65536,$.push(o>>>10&1023|55296),o=56320|1023&o),$.push(o),n+=u}return aH($)}function aH(r){var e=r.length;if(e<=Zo)return String.fromCharCode.apply(String,r);for(var t="",$=0;$$)&&(t=$);for(var n="",f=e;ft)throw new RangeError("Trying to access beyond buffer length")}function Ja(r,e,t,$,n,f){if(!b.isBuffer(r))throw new TypeError("\"buffer\" argument must be a Buffer instance");if(e>n||er.length)throw new RangeError("Index out of range")}function Xg(r,e,t,$){e<0&&(e=65535+e+1);for(var n=0,f=Math.min(r.length-t,2);n>>8*($?n:1-n)}function Yg(r,e,t,$){e<0&&(e=4294967295+e+1);for(var n=0,f=Math.min(r.length-t,4);n>>8*($?n:3-n)&255}function fp(r,e,t,$,n,f){if(t+$>r.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function gp(r,e,t,$,n){return n||fp(r,e,t,4,3.4028234663852886e38,-3.4028234663852886e38),ke.write(r,e,t,$,23,4),t+4}function hp(r,e,t,$,n){return n||fp(r,e,t,8,1.7976931348623157e308,-1.7976931348623157e308),ke.write(r,e,t,$,52,8),t+8}function fH(r){if((r=gH(r).replace(NG,"")).length<2)return"";for(;r.length%4!=0;)r+="=";return r}function gH(r){return r.trim?r.trim():r.replace(/^\s+|\s+$/g,"")}function hH(r){return r<16?"0"+r.toString(16):r.toString(16)}function Zg(r,e){var t;e=e||1/0;for(var $=r.length,n=null,f=[],h=0;h<$;++h){if((t=r.charCodeAt(h))>55295&&t<57344){if(!n){if(t>56319){(e-=3)>-1&&f.push(239,191,189);continue}if(h+1===$){(e-=3)>-1&&f.push(239,191,189);continue}n=t;continue}if(t<56320){(e-=3)>-1&&f.push(239,191,189),n=t;continue}t=65536+(n-55296<<10|t-56320)}else n&&(e-=3)>-1&&f.push(239,191,189);if(n=null,t<128){if((e-=1)<0)break;f.push(t)}else if(t<2048){if((e-=2)<0)break;f.push(t>>6|192,63&t|128)}else if(t<65536){if((e-=3)<0)break;f.push(t>>12|224,t>>6&63|128,63&t|128)}else{if(!(t<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;f.push(t>>18|240,t>>12&63|128,t>>6&63|128,63&t|128)}}return f}function iH(r){for(var e=[],t=0;t>8,n=t%256,f.push(n),f.push($);return f}function ip(r){return Oj.toByteArray(fH(r))}function $g(r,e,t,$){for(var n=0;n<$&&!(n+t>=e.length||n>=r.length);++n)e[n+t]=r[n];return n}function kH(r){return r!=r}function z(){if(OG)return;OG=true;r={};Oj=(DG(),Vg);ke=(HG(),Nj);Xo=(Wo(),Vo);KG=b;r.Buffer=KG;LG=UG;r.SlowBuffer=LG;Yo=50;r.INSPECT_MAX_BYTES=Yo,b.TYPED_ARRAY_SUPPORT=void 0!==A.TYPED_ARRAY_SUPPORT?A.TYPED_ARRAY_SUPPORT:PG();MG=Wg();r.kMaxLength=MG,b.poolSize=8192,b._augment=function(r){return r.__proto__=b.prototype,r},b.from=function(r,e,t){return $o(null,r,e,t)},b.TYPED_ARRAY_SUPPORT&&(b.prototype.__proto__=Uint8Array.prototype,b.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&b[Symbol.species]===b&&Object.defineProperty(b,Symbol.species,{value:null,configurable:!0})),b.alloc=function(r,e,t){return QG(null,r,e,t)},b.allocUnsafe=function(r){return Pj(null,r)},b.allocUnsafeSlow=function(r){return Pj(null,r)},b.isBuffer=function(r){return!(null==r||!r._isBuffer)},b.compare=function(r,e){if(!b.isBuffer(r)||!b.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(r===e)return 0;for(var t=r.length,$=e.length,n=0,f=Math.min(t,$);n0&&(r=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(r+=" ... ")),""},b.prototype.compare=function(r,e,t,$,n){if(!b.isBuffer(r))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===t&&(t=r?r.length:0),void 0===$&&($=0),void 0===n&&(n=this.length),e<0||t>r.length||$<0||n>this.length)throw new RangeError("out of range index");if($>=n&&e>=t)return 0;if($>=n)return-1;if(e>=t)return 1;if(this===r)return 0;for(var f=(n>>>=0)-($>>>=0),h=(t>>>=0)-(e>>>=0),a=Math.min(f,h),**this.slice($,n),R=r.slice(e,t),o=0;on)&&(t=n),r.length>0&&(t<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");$||($="utf8");for(var f=!1;;)switch($){case"hex":return WG(this,r,e,t);case"utf8":case"utf-8":return XG(this,r,e,t);case"ascii":return dp(this,r,e,t);case"latin1":case"binary":return YG(this,r,e,t);case"base64":return ZG(this,r,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $G(this,r,e,t);default:if(f)throw new TypeError("Unknown encoding: "+$);$=(""+$).toLowerCase(),f=!0;}},b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};Zo=4096;b.prototype.slice=function(r,e){var t,$=this.length;if((r=~~r)<0?(r+=$)<0&&(r=0):r>$&&(r=$),(e=void 0===e?$:~~e)<0?(e+=$)<0&&(e=0):e>$&&(e=$),e0&&(n*=256);)$+=this[r+--e]*n;return $},b.prototype.readUInt8=function(r,e){return e||fa(r,1,this.length),this[r]},b.prototype.readUInt16LE=function(r,e){return e||fa(r,2,this.length),this[r]|this[r+1]<<8},b.prototype.readUInt16BE=function(r,e){return e||fa(r,2,this.length),this[r]<<8|this[r+1]},b.prototype.readUInt32LE=function(r,e){return e||fa(r,4,this.length),(this[r]|this[r+1]<<8|this[r+2]<<16)+16777216*this[r+3]},b.prototype.readUInt32BE=function(r,e){return e||fa(r,4,this.length),16777216*this[r]+(this[r+1]<<16|this[r+2]<<8|this[r+3])},b.prototype.readIntLE=function(r,e,t){r|=0,e|=0,t||fa(r,e,this.length);for(var $=this[r],n=1,f=0;++f=(n*=128)&&($-=Math.pow(2,8*e)),$},b.prototype.readIntBE=function(r,e,t){r|=0,e|=0,t||fa(r,e,this.length);for(var $=e,n=1,f=this[r+--$];$>0&&(n*=256);)f+=this[r+--$]*n;return f>=(n*=128)&&(f-=Math.pow(2,8*e)),f},b.prototype.readInt8=function(r,e){return e||fa(r,1,this.length),128&this[r]?-1*(255-this[r]+1):this[r]},b.prototype.readInt16LE=function(r,e){e||fa(r,2,this.length);var t=this[r]|this[r+1]<<8;return 32768&t?4294901760|t:t},b.prototype.readInt16BE=function(r,e){e||fa(r,2,this.length);var t=this[r+1]|this[r]<<8;return 32768&t?4294901760|t:t},b.prototype.readInt32LE=function(r,e){return e||fa(r,4,this.length),this[r]|this[r+1]<<8|this[r+2]<<16|this[r+3]<<24},b.prototype.readInt32BE=function(r,e){return e||fa(r,4,this.length),this[r]<<24|this[r+1]<<16|this[r+2]<<8|this[r+3]},b.prototype.readFloatLE=function(r,e){return e||fa(r,4,this.length),ke.read(this,r,!0,23,4)},b.prototype.readFloatBE=function(r,e){return e||fa(r,4,this.length),ke.read(this,r,!1,23,4)},b.prototype.readDoubleLE=function(r,e){return e||fa(r,8,this.length),ke.read(this,r,!0,52,8)},b.prototype.readDoubleBE=function(r,e){return e||fa(r,8,this.length),ke.read(this,r,!1,52,8)},b.prototype.writeUIntLE=function(r,e,t,$){(r=+r,e|=0,t|=0,$)||Ja(this,r,e,t,Math.pow(2,8*t)-1,0);var n=1,f=0;for(this[e]=255&r;++f=0&&(f*=256);)this[e+n]=r/f&255;return e+t},b.prototype.writeUInt8=function(r,e,t){return r=+r,e|=0,t||Ja(this,r,e,1,255,0),b.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),this[e]=255&r,e+1},b.prototype.writeUInt16LE=function(r,e,t){return r=+r,e|=0,t||Ja(this,r,e,2,65535,0),b.TYPED_ARRAY_SUPPORT?(this[e]=255&r,this[e+1]=r>>>8):Xg(this,r,e,!0),e+2},b.prototype.writeUInt16BE=function(r,e,t){return r=+r,e|=0,t||Ja(this,r,e,2,65535,0),b.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=255&r):Xg(this,r,e,!1),e+2},b.prototype.writeUInt32LE=function(r,e,t){return r=+r,e|=0,t||Ja(this,r,e,4,4294967295,0),b.TYPED_ARRAY_SUPPORT?(this[e+3]=r>>>24,this[e+2]=r>>>16,this[e+1]=r>>>8,this[e]=255&r):Yg(this,r,e,!0),e+4},b.prototype.writeUInt32BE=function(r,e,t){return r=+r,e|=0,t||Ja(this,r,e,4,4294967295,0),b.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=255&r):Yg(this,r,e,!1),e+4},b.prototype.writeIntLE=function(r,e,t,$){if(r=+r,e|=0,!$){var n=Math.pow(2,8*t-1);Ja(this,r,e,t,n-1,-n)}var f=0,h=1,a=0;for(this[e]=255&r;++f>0)-a&255;return e+t},b.prototype.writeIntBE=function(r,e,t,$){if(r=+r,e|=0,!$){var n=Math.pow(2,8*t-1);Ja(this,r,e,t,n-1,-n)}var f=t-1,h=1,a=0;for(this[e+f]=255&r;--f>=0&&(h*=256);)r<0&&0===a&&0!==this[e+f+1]&&(a=1),this[e+f]=(r/h>>0)-a&255;return e+t},b.prototype.writeInt8=function(r,e,t){return r=+r,e|=0,t||Ja(this,r,e,1,127,-128),b.TYPED_ARRAY_SUPPORT||(r=Math.floor(r)),r<0&&(r=255+r+1),this[e]=255&r,e+1},b.prototype.writeInt16LE=function(r,e,t){return r=+r,e|=0,t||Ja(this,r,e,2,32767,-32768),b.TYPED_ARRAY_SUPPORT?(this[e]=255&r,this[e+1]=r>>>8):Xg(this,r,e,!0),e+2},b.prototype.writeInt16BE=function(r,e,t){return r=+r,e|=0,t||Ja(this,r,e,2,32767,-32768),b.TYPED_ARRAY_SUPPORT?(this[e]=r>>>8,this[e+1]=255&r):Xg(this,r,e,!1),e+2},b.prototype.writeInt32LE=function(r,e,t){return r=+r,e|=0,t||Ja(this,r,e,4,2147483647,-2147483648),b.TYPED_ARRAY_SUPPORT?(this[e]=255&r,this[e+1]=r>>>8,this[e+2]=r>>>16,this[e+3]=r>>>24):Yg(this,r,e,!0),e+4},b.prototype.writeInt32BE=function(r,e,t){return r=+r,e|=0,t||Ja(this,r,e,4,2147483647,-2147483648),r<0&&(r=4294967295+r+1),b.TYPED_ARRAY_SUPPORT?(this[e]=r>>>24,this[e+1]=r>>>16,this[e+2]=r>>>8,this[e+3]=255&r):Yg(this,r,e,!1),e+4},b.prototype.writeFloatLE=function(r,e,t){return gp(this,r,e,!0,t)},b.prototype.writeFloatBE=function(r,e,t){return gp(this,r,e,!1,t)},b.prototype.writeDoubleLE=function(r,e,t){return hp(this,r,e,!0,t)},b.prototype.writeDoubleBE=function(r,e,t){return hp(this,r,e,!1,t)},b.prototype.copy=function(r,e,t,$){if(t||(t=0),$||0===$||($=this.length),e>=r.length&&(e=r.length),e||(e=0),$>0&&$=this.length)throw new RangeError("sourceStart out of bounds");if($<0)throw new RangeError("sourceEnd out of bounds");$>this.length&&($=this.length),r.length-e<$-t&&($=r.length-e+t);var n,f=$-t;if(this===r&&t=0;--n)r[n+e]=this[n+t];else if(f<1e3||!b.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,t=void 0===t?this.length:t>>>0,r||(r=0),"number"==typeof r)for(f=e;f0?this.tail.next=e:this.head=e,this.tail=e,++this.length},t.prototype.unshift=function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length},t.prototype.shift=function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}},t.prototype.clear=function(){this.head=this.tail=null,this.length=0},t.prototype.join=function(t){if(0===this.length)return"";for(var e=this.head,a=""+e.data;e=e.next;)a+=t+e.data;return a},t.prototype.concat=function(t){if(0===this.length)return np.alloc(0);if(1===this.length)return this.head.data;for(var e=np.allocUnsafe(t>>>0),a=this.head,**0;a;)ZH(a.data,e,i),i+=a.data.length,a=a.next;return e},t}(),kf&&kf.inspect&&kf.inspect.custom&&(mp.prototype[kf.inspect.custom]=function(){var t=kf.inspect({length:this.length});return this.constructor.name+" "+t})}var op,pp,_H=false;function aI(t,e){var r=this,a=this._readableState&&this._readableState.destroyed,**this._writableState&&this._writableState.destroyed;return a||i?(e?e(t):!t||this._writableState&&this._writableState.errorEmitted||pp.nextTick(qp,this,t),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!e&&t?(pp.nextTick(qp,r,t),r._writableState&&(r._writableState.errorEmitted=!0)):e&&e(t)}),this)}function bI(){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.finished=!1,this._writableState.errorEmitted=!1)}function qp(t,e){t.emit("error",e)}function rp(){if(_H)return;_H=true;op={};pp=(ah(),_g);op={destroy:aI,undestroy:bI}}var cI,dI=false;function eI(r,e){if(Sj("noDeprecation"))return r;var a=!1;return function(){if(!a){if(Sj("throwDeprecation"))throw new Error(e);Sj("traceDeprecation")?console.trace(e):console.warn(e),a=!0}return r.apply(this,arguments)}}function Sj(r){try{if(!A.localStorage)return!1}catch(a){return!1}var e=A.localStorage[r];return null!=e&&"true"===String(e).toLowerCase()}function fI(){if(dI)return;dI=true;cI={};cI=eI}var Tj,e,kd,dh,gI,sp,hI,tp,eh,iI,up,vp,jI=false;function wp(t){var e=this;this.next=null,this.entry=null,this.finish=function(){yI(e,t)}}function kI(t){return eh.from(t)}function lI(t){return eh.isBuffer(t)||t instanceof iI}function mI(){}function lf(t,e){dh=dh||(md(),ld),t=t||{};var r=e instanceof dh;this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode);var **t.highWaterMark,n=t.writableHighWaterMark,a=this.objectMode?16:16384;this.highWaterMark=i||0===i?i:r&&(n||0===n)?n:a,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 $=!1===t.decodeStrings;this.decodeStrings=!$,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){tI(e,t)},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 wp(this)}function Z(t){if(dh=dh||(md(),ld),!(up.call(Z,this)||this instanceof dh))return new Z(t);this._writableState=new lf(t,this),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),tp.call(this)}function nI(t,e){var r=new Error("write after end");t.emit("error",r),kd.nextTick(e,r)}function oI(t,e,r,i){var n=!0,a=!1;return null===r?a=new TypeError("May not write null values to stream"):"string"==typeof r||void 0===r||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a&&(t.emit("error",a),kd.nextTick(i,a),n=!1),n}function pI(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=eh.from(e,r)),e}function qI(t,e,r,i,n,a){if(!r){var $=pI(e,i,n);i!==$&&(r=!0,n="buffer",i=$)}var o=e.objectMode?1:i.length;e.length+=o;var s=e.length-1))throw new TypeError("Unknown encoding: "+t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(Z.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Z.prototype._write=function(t,e,r){r(new Error("_write() is not implemented"))},Z.prototype._writev=null,Z.prototype.end=function(t,e,r){var **this._writableState;"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||i.finished||xI(this,i,r)},Object.defineProperty(Z.prototype,"destroyed",{get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),Z.prototype.destroy=vp.destroy,Z.prototype._undestroy=vp.undestroy,Z.prototype._destroy=function(t,e){this.end(),e(t)}}var ld,Ap,zI,Bp,**,Wj,AI=false;function jc(e){if(!(this instanceof jc))return new jc(e);**.call(this,e),Wj.call(this,e),e&&!1===e.readable&&(this.readable=!1),e&&!1===e.writable&&(this.writable=!1),this.allowHalfOpen=!0,e&&!1===e.allowHalfOpen&&(this.allowHalfOpen=!1),this.once("end",BI)}function BI(){this.allowHalfOpen||this._writableState.ended||Ap.nextTick(CI,this)}function CI(e){e.end()}function md(){if(AI)return;AI=true;ld={};Ap=(ah(),_g);zI=Object.keys||function(e){var $=[];for(var r in e)$.push(r);return $};ld=jc;Bp=Object.create((jf(),Y));Bp.inherits=(p(),o);**=(Sp(),Ep);Wj=(Vj(),Tj);Bp.inherits(jc,**);for(var $F3l5$var$keys=zI(Wj.prototype),$F3l5$var$v=0;$F3l5$var$v<$F3l5$var$keys.length;$F3l5$var$v++){var $F3l5$var$method=$F3l5$var$keys[$F3l5$var$v];jc.prototype[$F3l5$var$method]||(jc.prototype[$F3l5$var$method]=Wj.prototype[$F3l5$var$method])}Object.defineProperty(jc.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(jc.prototype,"destroyed",{get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}}),jc.prototype._destroy=function(e,$){this.push(null),this.end(),Ap.nextTick($,e)}}var fh,Xj,Dp,DI,EI=false;function FI(t){if(!t)return"utf8";for(var e;;)switch(t){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 t;default:if(e)return;t=(""+t).toLowerCase(),e=!0;}}function GI(t){var e=FI(t);if("string"!=typeof e&&(Xj.isEncoding===Dp||!Dp(t)))throw new Error("Unknown encoding: "+t);return e||t}function nf(t){var e;switch(this.encoding=GI(t),this.encoding){case"utf16le":this.text=MI,this.end=NI,e=4;break;case"utf8":this.fillLast=JI,e=4;break;case"base64":this.text=OI,this.end=PI,e=3;break;default:return this.write=QI,void(this.end=RI);}this.lastNeed=0,this.lastTotal=0,this.lastChar=Xj.allocUnsafe(e)}function Yj(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function HI(t,e,s){var r=e.length-1;if(r=0?(a>0&&(t.lastNeed=a-1),a):--r=0?(a>0&&(t.lastNeed=a-2),a):--r=0?(a>0&&(2===a?a=0:t.lastNeed=a-3),a):0}function II(t,e,s){if(128!=(192&e[0]))return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"\uFFFD"}}function JI(t){var e=this.lastTotal-this.lastNeed,s=II(this,t,e);return void 0!==s?s:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function KI(t,e){var s=HI(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=s;var r=t.length-(s-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)}function LI(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function MI(t,e){if((t.length-e)%2==0){var s=t.toString("utf16le",e);if(s){var r=s.charCodeAt(s.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],s.slice(0,-1)}return s}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function NI(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var s=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,s)}return e}function OI(t,e){var s=(t.length-e)%3;return 0===s?t.toString("base64",e):(this.lastNeed=3-s,this.lastTotal=3,1===s?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-s))}function PI(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function QI(t){return t.toString(this.encoding)}function RI(t){return t&&t.length?this.write(t):""}function Zj(){if(EI)return;EI=true;fh={};Xj=(q(),m).Buffer;Dp=Xj.isEncoding||function(t){switch((t=""+t)&&t.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;}};DI=nf;fh.StringDecoder=DI,nf.prototype.write=function(t){if(0===t.length)return"";var e,s;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";s=this.lastNeed,this.lastNeed=0}else s=0;return s0?("string"==typeof r||i.objectMode||Object.getPrototypeOf(r)===of.prototype||(r=WI(r)),t?i.endEmitted?e.emit("error",new Error("stream.unshift() after end event")):bk(e,i,r,!0):i.ended?e.emit("error",new Error("stream.push() after EOF")):(i.reading=!1,i.decoder&&!a?(r=i.decoder.write(r),i.objectMode||0!==r.length?bk(e,i,r,!1):Pp(e,i)):bk(e,i,r,!1))):t||(i.reading=!1));return $I(i)}function bk(e,r,a,t){r.flowing&&0===r.length&&!r.sync?(e.emit("data",a),e.read(0)):(r.length+=r.objectMode?1:a.length,t?r.buffer.unshift(a):r.buffer.push(a),r.needReadable&&hh(e)),Pp(e,r)}function ZI(e,r){var a;return XI(r)||"string"==typeof r||void 0===r||e.objectMode||(a=new TypeError("Invalid non-string/buffer chunk")),a}function $I(e){return!e.ended&&(e.needReadable||e.length=Kp?e=Kp:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function Np(e,r){return e<=0||0===r.length&&r.ended?0:r.objectMode?1:e!=e?r.flowing&&r.length?r.buffer.head.data.length:r.length:(e>r.highWaterMark&&(r.highWaterMark=_I(e)),e<=r.length?e:r.ended?r.length:(r.needReadable=!0,0))}function aJ(e,r){if(!r.ended){if(r.decoder){var a=r.decoder.end();a&&a.length&&(r.buffer.push(a),r.length+=r.objectMode?1:a.length)}r.ended=!0,hh(e)}}function hh(e){var r=e._readableState;r.needReadable=!1,r.emittedReadable||(E("emitReadable",r.flowing),r.emittedReadable=!0,r.sync?me.nextTick(Op,e):Op(e))}function Op(e){E("emit readable"),e.emit("readable"),ck(e)}function Pp(e,r){r.readingMore||(r.readingMore=!0,me.nextTick(bJ,e,r))}function bJ(e,r){for(var a=r.length;!r.reading&&!r.flowing&&!r.ended&&r.length=r.length?(a=r.decoder?r.buffer.join(""):1===r.buffer.length?r.buffer.head.data:r.buffer.concat(r.length),r.buffer.clear()):a=gJ(e,r.buffer,r.decoder),a);var a}function gJ(e,r,a){var t;return e$.length?$.length:e;if(i===$.length?n+=$:n+=$.slice(0,e),0===(e-=i)){i===$.length?(++t,a.next?r.head=a.next:r.head=r.tail=null):(r.head=a,a.data=$.slice(i));break}++t}return r.length-=t,n}function iJ(e,r){var a=of.allocUnsafe(e),t=r.head,n=1;for(t.data.copy(a),e-=t.data.length;t=t.next;){var $=t.data,**e>$.length?$.length:e;if($.copy(a,a.length-e,0,i),0===(e-=i)){i===$.length?(++n,t.next?r.head=t.next:r.head=r.tail=null):(r.head=t,t.data=$.slice(i));break}++n}return r.length-=n,a}function dk(e){var r=e._readableState;if(r.length>0)throw new Error("\"endReadable()\" called on non-empty stream");r.endEmitted||(r.ended=!0,me.nextTick(jJ,r,e))}function jJ(e,r){e.endEmitted||0!==e.length||(e.endEmitted=!0,r.readable=!1,r.emit("end"))}function Rp(e,r){for(var a=0,t=e.length;a=r.highWaterMark||r.ended))return E("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?dk(this):hh(this),null;if(0===(e=Np(e,r))&&r.ended)return 0===r.length&&dk(this),null;var t,n=r.needReadable;return E("need readable",n),(0===r.length||r.length-e0?Qp(e,r):null)?(r.needReadable=!0,e=0):r.length-=e,0===r.length&&(r.ended||(r.needReadable=!0),a!==e&&r.ended&&dk(this)),null!==t&&this.emit("data",t),t},M.prototype._read=function(e){this.emit("error",new Error("_read() is not implemented"))},M.prototype.pipe=function(e,r){var a=this,t=this._readableState;switch(t.pipesCount){case 0:t.pipes=e;break;case 1:t.pipes=[t.pipes,e];break;default:t.pipes.push(e);}t.pipesCount+=1,E("pipe count=%d opts=%j",t.pipesCount,r);var n=(!r||!1!==r.end)&&e!==Fp.stdout&&e!==Fp.stderr?i:h;function $(r,n){E("onunpipe"),r===a&&n&&!1===n.hasUnpiped&&(n.hasUnpiped=!0,E("cleanup"),e.removeListener("close",s),e.removeListener("finish",v),e.removeListener("drain",d),e.removeListener("error",u),e.removeListener("unpipe",$),a.removeListener("end",i),a.removeListener("end",h),a.removeListener("data",l),p=!0,!t.awaitDrain||e._writableState&&!e._writableState.needDrain||d())}function i(){E("onend"),e.end()}t.endEmitted?me.nextTick(n):a.once("end",n),e.on("unpipe",$);var d=cJ(a);e.on("drain",d);var p=!1;var o=!1;function l(r){E("ondata"),o=!1,!1!==e.write(r)||o||((1===t.pipesCount&&t.pipes===e||t.pipesCount>1&&-1!==Rp(t.pipes,e))&&!p&&(E("false write response, pause",a._readableState.awaitDrain),a._readableState.awaitDrain++,o=!0),a.pause())}function u(r){E("onerror",r),h(),e.removeListener("error",u),0===Hp(e,"error")&&e.emit("error",r)}function s(){e.removeListener("finish",v),h()}function v(){E("onfinish"),e.removeListener("close",s),h()}function h(){E("unpipe"),a.unpipe(e)}return a.on("data",l),YI(e,"error",u),e.once("close",s),e.once("finish",v),e.emit("pipe",a),t.flowing||(E("pipe resume"),a.resume()),e},M.prototype.unpipe=function(e){var r=this._readableState,a={hasUnpiped:!1};if(0===r.pipesCount)return this;if(1===r.pipesCount)return e&&e!==r.pipes?this:(e||(e=r.pipes),r.pipes=null,r.pipesCount=0,r.flowing=!1,e&&e.emit("unpipe",this,a),this);if(!e){var t=r.pipes,n=r.pipesCount;r.pipes=null,r.pipesCount=0,r.flowing=!1;for(var $=0;$=3&&(e.depth=arguments[2]),arguments.length>=4&&(e.colors=arguments[3]),jk($)?e.showHidden=$:$&&bq(e,$),lc(e.showHidden)&&(e.showHidden=!1),lc(e.depth)&&(e.depth=2),lc(e.colors)&&(e.colors=!1),lc(e.customInspect)&&(e.customInspect=!0),e.colors&&(e.stylize=rK),nh(e,r,e.depth)}function rK(r,$){var e=Fc.styles[$];return e?"\x1B["+Fc.colors[e][0]+"m"+r+"\x1B["+Fc.colors[e][1]+"m":r}function sK(r,$){return r}function tK(r){var $={};return r.forEach(function(r,e){$[r]=!0}),$}function nh(r,$,e){if(r.customInspect&&$&&sh($.inspect)&&$.inspect!==aq&&(!$.constructor||$.constructor.prototype!==$)){var a=$.inspect(e,r);return ph(a)||(a=nh(r,a,e)),a}var t=uK(r,$);if(t)return t;var n=Object.keys($),**tK(n);if(r.showHidden&&(n=Object.getOwnPropertyNames($)),rh($)&&(n.indexOf("message")>=0||n.indexOf("description")>=0))return hk($);if(0===n.length){if(sh($)){var o=$.name?": "+$.name:"";return r.stylize("[Function"+o+"]","special")}if(qh($))return r.stylize(RegExp.prototype.toString.call($),"regexp");if(kk($))return r.stylize(Date.prototype.toString.call($),"date");if(rh($))return hk($)}var s,b="",p=!1,P=["{","}"];(cq($)&&(p=!0,P=["[","]"]),sh($))&&(b=" [Function"+($.name?": "+$.name:"")+"]");return qh($)&&(b=" "+RegExp.prototype.toString.call($)),kk($)&&(b=" "+Date.prototype.toUTCString.call($)),rh($)&&(b=" "+hk($)),0!==n.length||p&&0!=$.length?e<0?qh($)?r.stylize(RegExp.prototype.toString.call($),"regexp"):r.stylize("[Object]","special"):(r.seen.push($),s=p?vK(r,$,e,i,n):n.map(function(a){return ik(r,$,e,i,a,p)}),r.seen.pop(),wK(s,b,P)):P[0]+b+P[1]}function uK(r,$){if(lc($))return r.stylize("undefined","undefined");if(ph($)){var e="'"+JSON.stringify($).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,"\"")+"'";return r.stylize(e,"string")}return dq($)?r.stylize(""+$,"number"):jk($)?r.stylize(""+$,"boolean"):oh($)?r.stylize("null","null"):void 0}function hk(r){return"["+Error.prototype.toString.call(r)+"]"}function vK(r,$,e,a,t){for(var n=[],**0,o=$.length;i-1&&(o=n?o.split("\n").map(function(r){return" "+r}).join("\n").substr(2):"\n"+o.split("\n").map(function(r){return" "+r}).join("\n")):o=r.stylize("[Circular]","special")),lc(i)){if(n&&t.match(/^\d+$/))return o;(**JSON.stringify(""+t)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(**i.substr(1,i.length-2),**r.stylize(i,"name")):(**i.replace(/'/g,"\\'").replace(/\\"/g,"\"").replace(/(^"|"$)/g,"'"),**r.stylize(i,"string"))}return i+": "+o}function wK(r,$,e){return r.reduce(function(r,$){return 0,$.indexOf("\n")>=0&&0,r+$.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?e[0]+(""===$?"":$+"\n ")+" "+r.join(",\n ")+" "+e[1]:e[0]+$+" "+r.join(", ")+" "+e[1]}function cq(r){return Array.isArray(r)}function jk(r){return"boolean"==typeof r}function oh(r){return null===r}function xK(r){return null==r}function dq(r){return"number"==typeof r}function ph(r){return"string"==typeof r}function yK(r){return"symbol"==typeof r}function lc(r){return void 0===r}function qh(r){return ne(r)&&"[object RegExp]"===lk(r)}function ne(r){return"object"==typeof r&&null!==r}function kk(r){return ne(r)&&"[object Date]"===lk(r)}function rh(r){return ne(r)&&("[object Error]"===lk(r)||r instanceof Error)}function sh(r){return"function"==typeof r}function zK(r){return null===r||"boolean"==typeof r||"number"==typeof r||"string"==typeof r||"symbol"==typeof r||void 0===r}function lk(r){return Object.prototype.toString.call(r)}function mk(r){return r<10?"0"+r.toString(10):r.toString(10)}function AK(){var r=new Date,$=[mk(r.getHours()),mk(r.getMinutes()),mk(r.getSeconds())].join(":");return[r.getDate(),nK[r.getMonth()],$].join(" ")}function eq(r,$){return Object.prototype.hasOwnProperty.call(r,$)}function BK(){if(qK)return;qK=true;N={};lh=(ab(),_a);YJ=/%[sdj%]/g;gk=function(r){if(!ph(r)){for(var $=[],e=0;e=t)return r;switch(r){case"%s":return String(a[e++]);case"%d":return Number(a[e++]);case"%j":try{return JSON.stringify(a[e++])}catch($){return"[Circular]"}default:return r;}}),**a[e];e=0;s--)if(u[s]!==o[s])return!1;for(s=u.length-1;s>=0;s--)if(!oe(t[n=u[s]],r[n],$,e))return!1;return!0}function qq(t,r,$){oe(t,r,!0)&&Ka(t,r,$,"notDeepStrictEqual",qq)}function rq(t,r){if(!t||!r)return!1;if("[object RegExp]"==Object.prototype.toString.call(r))return r.test(t);try{if(t instanceof r)return!0}catch($){}return!Error.isPrototypeOf(r)&&!0===r.call({},t)}function IK(t){var r;try{t()}catch($){r=$}return r}function sq(t,r,$,e){var a;if("function"!=typeof r)throw new TypeError("\"block\" argument must be a function");"string"==typeof $&&(e=$,$=null),a=IK(r),e=($&&$.name?" ("+$.name+").":".")+(e?" "+e:"."),t&&!a&&Ka(a,$,"Missing expected exception"+e);var i="string"==typeof e,n=!t&&a&&!$;if((!t&&sb.isError(a)&&i&&rq(a,$)||n)&&Ka(a,$,"Got unwanted exception"+e),t&&a&&$&&!rq(a,$)||!t&&a)throw a}function tq(t,r){t||Ka(t,!0,r,"==",tq)}function ok(){if(FK)return;FK=true;nk={};CK=(RJ(),LJ);sb=(BK(),N);DK=Object.prototype.hasOwnProperty;fq=Array.prototype.slice;gq="foo"===function(){}.name;B=nk=oq;EK=/\s*function\s+([^\(\s]*)\s*/;B.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=GK(this),this.generatedMessage=!0);var r=t.stackStartFunction||Ka;if(Error.captureStackTrace)Error.captureStackTrace(this,r);else{var $=new Error;if($.stack){var e=$.stack,a=lq(r),**e.indexOf("\n"+a);if(i>=0){var n=e.indexOf("\n",i+1);e=e.substring(n+1)}this.stack=e}}},sb.inherits(B.AssertionError,Error),B.fail=Ka,B.ok=oq,B.equal=function(t,r,$){t!=r&&Ka(t,r,$,"==",B.equal)},B.notEqual=function(t,r,$){t==r&&Ka(t,r,$,"!=",B.notEqual)},B.deepEqual=function(t,r,$){oe(t,r,!1)||Ka(t,r,$,"deepEqual",B.deepEqual)},B.deepStrictEqual=function(t,r,$){oe(t,r,!0)||Ka(t,r,$,"deepStrictEqual",B.deepStrictEqual)},B.notDeepEqual=function(t,r,$){oe(t,r,!1)&&Ka(t,r,$,"notDeepEqual",B.notDeepEqual)},B.notDeepStrictEqual=qq,B.strictEqual=function(t,r,$){t!==r&&Ka(t,r,$,"===",B.strictEqual)},B.notStrictEqual=function(t,r,$){t===r&&Ka(t,r,$,"!==",B.notStrictEqual)},B.throws=function(t,r,$){sq(!0,t,r,$)},B.doesNotThrow=function(t,r,$){sq(!1,t,r,$)},B.ifError=function(t){if(t)throw t},B.strict=CK(tq,B,{equal:B.strictEqual,deepEqual:B.deepStrictEqual,notEqual:B.notStrictEqual,notDeepEqual:B.notDeepStrictEqual}),B.strict.strict=B.strict;hq=Object.keys||function(t){var r=[];for(var $ in t)DK.call(t,$)&&r.push($);return r}}var JK,KK=false;function LK(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}function MK(){if(KK)return;KK=true;JK={};JK=LK}var uq,vq,wq,za,NK,pk,OK,PK,QK,xq,RK=false;function SK(r,$){return Object.prototype.hasOwnProperty.call(r,$)}function th(){if(RK)return;RK=true;za={};NK="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;pk=function(r){for(var $=Array.prototype.slice.call(arguments,1);$.length;){var p=$.shift();if(p){if("object"!=typeof p)throw new TypeError(p+"must be non-object");for(var t in p)SK(p,t)&&(r[t]=p[t])}}return r};za.assign=pk;OK=function(r,$){return r.length===$?r:r.subarray?r.subarray(0,$):(r.length=$,r)};za.shrinkBuf=OK;PK={arraySet:function(r,$,p,t,e){if($.subarray&&r.subarray)r.set($.subarray(p,p+t),e);else for(var N=0;N=0;)$[r]=0}function wk($,r,s,e,_){this.static_tree=$,this.extra_bits=r,this.extra_base=s,this.elems=e,this.max_length=_,this.has_stree=$&&$.length}function xk($,r){this.dyn_tree=$,this.max_code=0,this.stat_desc=r}function Gq($){return $<256?uf[$]:uf[256+($>>>7)]}function wf($,r){$.pending_buf[$.pending++]=255&r,$.pending_buf[$.pending++]=r>>>8&255}function La($,r,s){$.bi_valid>sk-s?($.bi_buf|=r<<$.bi_valid&65535,wf($,$.bi_buf),$.bi_buf=r>>sk-$.bi_valid,$.bi_valid+=s-sk):($.bi_buf|=r<<$.bi_valid&65535,$.bi_valid+=s)}function Kb($,r,s){La($,s[2*r],s[2*r+1])}function Hq($,r){var s=0;do{s|=1&$,$>>>=1,s<<=1}while(--r>0);return s>>>1}function lL($){16===$.bi_valid?(wf($,$.bi_buf),$.bi_buf=0,$.bi_valid=0):$.bi_valid>=8&&($.pending_buf[$.pending++]=255&$.bi_buf,$.bi_buf>>=8,$.bi_valid-=8)}function mL($,r){var s,e,_,a,t,u,D=r.dyn_tree,A=r.max_code,v=r.stat_desc.static_tree,**r.stat_desc.has_stree,n=r.stat_desc.extra_bits,d=r.stat_desc.extra_base,l=r.stat_desc.max_length,o=0;for(a=0;a<=nd;a++)$.bl_count[a]=0;for(D[2*$.heap[$.heap_max]+1]=0,s=$.heap_max+1;sl&&(a=l,o++),D[2*e+1]=a,e>A||($.bl_count[a]++,t=0,e>=d&&(t=n[e-d]),u=D[2*e],$.opt_len+=u*(a+t),i&&($.static_len+=u*(v[2*e+1]+t)));if(0!==o){do{for(a=l-1;0===$.bl_count[a];)a--;$.bl_count[a]--,$.bl_count[a+1]+=2,$.bl_count[l]--,o-=2}while(o>0);for(a=l;0!==a;a--)for(e=$.bl_count[a];0!==e;)(_=$.heap[--s])>A||(D[2*_+1]!==a&&($.opt_len+=(a-D[2*_+1])*D[2*_],D[2*_+1]=a),e--)}}function Iq($,r,s){var e,_,a=new Array(nd+1),t=0;for(e=1;e<=nd;e++)a[e]=t=t+s[e-1]<<1;for(_=0;_<=r;_++){var u=$[2*_+1];0!==u&&($[2*_]=Hq(a[u]++,u))}}function nL(){var $,r,s,e,_,a=new Array(nd+1);for(s=0,e=0;e>=7;e8?wf($,$.bi_buf):$.bi_valid>0&&($.pending_buf[$.pending++]=$.bi_buf),$.bi_buf=0,$.bi_valid=0}function oL($,r,s,e){Kq($),e&&(wf($,s),wf($,~s)),TK.arraySet($.pending_buf,$.window,r,s,$.pending),$.pending+=s}function Lq($,r,s,e){var _=2*r,a=2*s;return $[_]<$[a]||$[_]===$[a]&&e[r]<=e[s]}function yk($,r,s){for(var e=$.heap[s],_=s<<1;_<=$.heap_len&&(_<$.heap_len&&Lq(r,$.heap[_+1],$.heap[_],$.depth)&&_++,!Lq(r,e,$.heap[_],$.depth));)$.heap[s]=$.heap[_],s=_,_<<=1;$.heap[s]=e}function Mq($,r,s){var e,_,a,t,u=0;if(0!==$.last_lit)do{e=$.pending_buf[$.d_buf+2*u]<<8|$.pending_buf[$.d_buf+2*u+1],_=$.pending_buf[$.l_buf+u],u++,0===e?Kb($,_,r):(Kb($,(a=vf[_])+rf+1,r),0!==(t=uk[a])&&La($,_-=vk[a],t),Kb($,a=Gq(--e),s),0!==(t=uh[a])&&La($,e-=vh[a],t))}while(u<$.last_lit);Kb($,tk,r)}function zk($,r){var s,e,_,a=r.dyn_tree,t=r.stat_desc.static_tree,u=r.stat_desc.has_stree,D=r.stat_desc.elems,A=-1;for($.heap_len=0,$.heap_max=Bq,s=0;s>1;s>=1;s--)yk($,a,s);_=D;do{s=$.heap[1],$.heap[1]=$.heap[$.heap_len--],yk($,a,1),e=$.heap[1],$.heap[--$.heap_max]=s,$.heap[--$.heap_max]=e,a[2*_]=a[2*s]+a[2*e],$.depth[_]=($.depth[s]>=$.depth[e]?$.depth[s]:$.depth[e])+1,a[2*s+1]=a[2*e+1]=_,$.heap[1]=_++,yk($,a,1)}while($.heap_len>=2);$.heap[--$.heap_max]=$.heap[1],mL($,r),Iq(a,A,$.bl_count)}function Nq($,r,s){var e,_,a=-1,t=r[1],u=0,D=7,A=4;for(0===t&&(D=138,A=3),r[2*(s+1)+1]=65535,e=0;e<=s;e++)_=t,t=r[2*(e+1)+1],++u=3&&0===$.bl_tree[2*Fq[r]+1];r--);return $.opt_len+=3*(r+1)+5+5+4,r}function qL($,r,s,e){var _;for(La($,r-257,5),La($,s-1,5),La($,e-4,4),_=0;_>>=1)if(1&s&&0!==$.dyn_ltree[2*r])return yq;if(0!==$.dyn_ltree[18]||0!==$.dyn_ltree[20]||0!==$.dyn_ltree[26])return zq;for(r=32;r0?($.strm.data_type===VK&&($.strm.data_type=rL($)),zk($,$.l_desc),zk($,$.d_desc),t=pL($),_=$.opt_len+3+7>>>3,(a=$.static_len+3+7>>>3)<=_&&(_=a)):_=a=s+5,s+4<=_&&-1!==r?Pq($,r,s,e):$.strategy===UK||a===_?(La($,(Aq<<1)+(e?1:0),3),Mq($,mc,tf)):(La($,(XK<<1)+(e?1:0),3),qL($,$.l_desc.max_code+1,$.d_desc.max_code+1,t+1),Mq($,$.dyn_ltree,$.dyn_dtree)),Jq($),e&&Kq($)}function vL($,r,s){return $.pending_buf[$.d_buf+2*$.last_lit]=r>>>8&255,$.pending_buf[$.d_buf+2*$.last_lit+1]=255&r,$.pending_buf[$.l_buf+$.last_lit]=255&s,$.last_lit++,0===r?$.dyn_ltree[2*s]++:($.matches++,r--,$.dyn_ltree[2*(vf[s]+rf+1)]++,$.dyn_dtree[2*Gq(r)]++),$.last_lit===$.lit_bufsize-1}function wL(){if(kL)return;kL=true;pe={};TK=(th(),za);UK=4;yq=0;zq=1;VK=2;WK=0;Aq=1;XK=2;YK=3;ZK=258;qk=29;rf=256;sf=rf+1+qk;qe=30;rk=19;Bq=2*sf+1;nd=15;sk=16;$K=7;tk=256;Cq=16;Dq=17;Eq=18;uk=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0];uh=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];_K=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7];Fq=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];aL=512;mc=new Array(2*(sf+2));re(mc);tf=new Array(2*qe);re(tf);uf=new Array(aL);re(uf);vf=new Array(ZK-YK+1);re(vf);vk=new Array(qk);re(vk);vh=new Array(qe);re(vh);eL=!1;fL=sL;pe._tr_init=fL;gL=Pq;pe._tr_stored_block=gL;hL=uL;pe._tr_flush_block=hL;iL=vL;pe._tr_tally=iL;jL=tL;pe._tr_align=jL}var Qq,xL=false;function yL(r,$,e,t){for(var a=65535&r|0,o=r>>>16&65535|0,k=0;0!==e;){e-=k=e>2e3?2e3:e;do{o=o+(a=a+$[t++]|0)|0}while(--k);a%=65521,o%=65521}return a|o<<16|0}function Rq(){if(xL)return;xL=true;Qq={};Qq=yL}var Sq,zL,AL=false;function BL(){for(var r,$=[],a=0;a<256;a++){r=a;for(var o=0;o<8;o++)r=1&r?3988292384^r>>>1:r>>>1;$[a]=r}return $}function CL(r,$,a,o){var u=zL,v=o+a;r^=-1;for(var c=o;c>>8^u[255&(r^$[c])];return-1^r}function Tq(){if(AL)return;AL=true;Sq={};zL=BL();Sq=CL}var DL,EL=false;function FL(){if(EL)return;EL=true;DL={};DL={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}}var xf,Lb,Aa,bb,Uq,Gc,GL,od,HL,IL,Hc,Vq,Mb,Wq,cb,JL,Ak,KL,LL,wh,ML,NL,OL,PL,xh,QL,RL,SL,TL,UL,Bk,VL,WL,XL,YL,w,Ic,tb,ZL,yh,Ck,zh,Ah,Bh,pd,yf,ga,zf,qd,se,$L,_L,aM,bM,cM,dM,eM,fM,gM,hM,iM=false;function Jc($,a){return $.msg=GL[a],a}function Xq($){return($<<1)-($>4?9:0)}function Kc($){for(var a=$.length;--a>=0;)$[a]=0}function Lc($){var a=$.state,t=a.pending;t>$.avail_out&&(t=$.avail_out),0!==t&&(Aa.arraySet($.output,a.pending_buf,a.pending_out,t,$.next_out),$.next_out+=t,a.pending_out+=t,$.total_out+=t,$.avail_out-=t,a.pending-=t,0===a.pending&&(a.pending_out=0))}function ma($,a){bb._tr_flush_block($,$.block_start>=0?$.block_start:-1,$.strstart-$.block_start,a),$.block_start=$.strstart,Lc($.strm)}function C($,a){$.pending_buf[$.pending++]=a}function Af($,a){$.pending_buf[$.pending++]=a>>>8&255,$.pending_buf[$.pending++]=255&a}function jM($,a,t,r){var e=$.avail_in;return e>r&&(e=r),0===e?0:($.avail_in-=e,Aa.arraySet(a,$.input,$.next_in,e,t),1===$.state.wrap?$.adler=Uq($.adler,a,e,t):2===$.state.wrap&&($.adler=Gc($.adler,a,e,t)),$.next_in+=e,$.total_in+=e,e)}function Yq($,a){var t,r,e=$.max_chain_length,_=$.strstart,s=$.prev_length,O=$.nice_match,D=$.strstart>$.w_size-tb?$.strstart-($.w_size-tb):0,i=$.window,n=$.w_mask,B=$.prev,v=$.strstart+Ic,L=i[_+s-1],l=i[_+s];$.prev_length>=$.good_match&&(e>>=2),O>$.lookahead&&(O=$.lookahead);do{if(i[(t=a)+s]===l&&i[t+s-1]===L&&i[t]===i[_]&&i[++t]===i[_+1]){_+=2,t++;do{}while(i[++_]===i[++t]&&i[++_]===i[++t]&&i[++_]===i[++t]&&i[++_]===i[++t]&&i[++_]===i[++t]&&i[++_]===i[++t]&&i[++_]===i[++t]&&i[++_]===i[++t]&&_s){if($.match_start=a,s=r,r>=O)break;L=i[_+s-1],l=i[_+s]}}}while((a=B[a&n])>D&&0!=--e);return s<=$.lookahead?s:$.lookahead}function rd($){var a,t,r,e,_,s=$.w_size;do{if(e=$.window_size-$.lookahead-$.strstart,$.strstart>=s+(s-tb)){Aa.arraySet($.window,$.window,s,s,0),$.match_start-=s,$.strstart-=s,$.block_start-=s,a=t=$.hash_size;do{r=$.head[--a],$.head[a]=r>=s?r-s:0}while(--t);a=t=s;do{r=$.prev[--a],$.prev[a]=r>=s?r-s:0}while(--t);e+=s}if(0===$.strm.avail_in)break;if(t=jM($.strm,$.window,$.strstart+$.lookahead,e),$.lookahead+=t,$.lookahead+$.insert>=w)for(_=$.strstart-$.insert,$.ins_h=$.window[_],$.ins_h=($.ins_h<<$.hash_shift^$.window[_+1])&$.hash_mask;$.insert&&($.ins_h=($.ins_h<<$.hash_shift^$.window[_+w-1])&$.hash_mask,$.prev[_&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=_,_++,$.insert--,!($.lookahead+$.insert$.pending_buf_size-5&&(t=$.pending_buf_size-5);;){if($.lookahead<=1){if(rd($),0===$.lookahead&&a===od)return ga;if(0===$.lookahead)break}$.strstart+=$.lookahead,$.lookahead=0;var r=$.block_start+t;if((0===$.strstart||$.strstart>=r)&&($.lookahead=$.strstart-r,$.strstart=r,ma($,!1),0===$.strm.avail_out))return ga;if($.strstart-$.block_start>=$.w_size-tb&&(ma($,!1),0===$.strm.avail_out))return ga}return $.insert=0,a===Hc?(ma($,!0),0===$.strm.avail_out?qd:se):($.strstart>$.block_start&&(ma($,!1),$.strm.avail_out),ga)}function Dk($,a){for(var t,r;;){if($.lookahead=w&&($.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+w-1])&$.hash_mask,t=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart),0!==t&&$.strstart-t<=$.w_size-tb&&($.match_length=Yq($,t)),$.match_length>=w){if(r=bb._tr_tally($,$.strstart-$.match_start,$.match_length-w),$.lookahead-=$.match_length,$.match_length<=$.max_lazy_match&&$.lookahead>=w){$.match_length--;do{$.strstart++,$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+w-1])&$.hash_mask,t=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart}while(0!=--$.match_length);$.strstart++}else $.strstart+=$.match_length,$.match_length=0,$.ins_h=$.window[$.strstart],$.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+1])&$.hash_mask;}else r=bb._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++;if(r&&(ma($,!1),0===$.strm.avail_out))return ga}return $.insert=$.strstart=w&&($.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+w-1])&$.hash_mask,t=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart),$.prev_length=$.match_length,$.prev_match=$.match_start,$.match_length=w-1,0!==t&&$.prev_length<$.max_lazy_match&&$.strstart-t<=$.w_size-tb&&($.match_length=Yq($,t),$.match_length<=5&&($.strategy===LL||$.match_length===w&&$.strstart-$.match_start>4096)&&($.match_length=w-1)),$.prev_length>=w&&$.match_length<=$.prev_length){e=$.strstart+$.lookahead-w,r=bb._tr_tally($,$.strstart-1-$.prev_match,$.prev_length-w),$.lookahead-=$.prev_length-1,$.prev_length-=2;do{++$.strstart<=e&&($.ins_h=($.ins_h<<$.hash_shift^$.window[$.strstart+w-1])&$.hash_mask,t=$.prev[$.strstart&$.w_mask]=$.head[$.ins_h],$.head[$.ins_h]=$.strstart)}while(0!=--$.prev_length);if($.match_available=0,$.match_length=w-1,$.strstart++,r&&(ma($,!1),0===$.strm.avail_out))return ga}else if($.match_available){if((r=bb._tr_tally($,0,$.window[$.strstart-1]))&&ma($,!1),$.strstart++,$.lookahead--,0===$.strm.avail_out)return ga}else $.match_available=1,$.strstart++,$.lookahead--}return $.match_available&&(r=bb._tr_tally($,0,$.window[$.strstart-1]),$.match_available=0),$.insert=$.strstart=w&&$.strstart>0&&(r=s[e=$.strstart-1])===s[++e]&&r===s[++e]&&r===s[++e]){_=$.strstart+Ic;do{}while(r===s[++e]&&r===s[++e]&&r===s[++e]&&r===s[++e]&&r===s[++e]&&r===s[++e]&&r===s[++e]&&r===s[++e]&&e<_);$.match_length=Ic-(_-e),$.match_length>$.lookahead&&($.match_length=$.lookahead)}if($.match_length>=w?(t=bb._tr_tally($,1,$.match_length-w),$.lookahead-=$.match_length,$.strstart+=$.match_length,$.match_length=0):(t=bb._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++),t&&(ma($,!1),0===$.strm.avail_out))return ga}return $.insert=0,a===Hc?(ma($,!0),0===$.strm.avail_out?qd:se):$.last_lit&&(ma($,!1),0===$.strm.avail_out)?ga:zf}function mM($,a){for(var t;;){if(0===$.lookahead&&(rd($),0===$.lookahead)){if(a===od)return ga;break}if($.match_length=0,t=bb._tr_tally($,0,$.window[$.strstart]),$.lookahead--,$.strstart++,t&&(ma($,!1),0===$.strm.avail_out))return ga}return $.insert=0,a===Hc?(ma($,!0),0===$.strm.avail_out?qd:se):$.last_lit&&(ma($,!1),0===$.strm.avail_out)?ga:zf}function Nb($,a,t,r,e){this.good_length=$,this.max_lazy=a,this.nice_length=t,this.max_chain=r,this.func=e}function nM($){$.window_size=2*$.w_size,Kc($.head),$.max_lazy_match=xf[$.level].max_lazy,$.good_match=xf[$.level].good_length,$.nice_match=xf[$.level].nice_length,$.max_chain_length=xf[$.level].max_chain,$.strstart=0,$.block_start=0,$.lookahead=0,$.insert=0,$.match_length=$.prev_length=w-1,$.match_available=0,$.ins_h=0}function oM(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=xh,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Aa.Buf16(2*XL),this.dyn_dtree=new Aa.Buf16(2*(2*VL+1)),this.bl_tree=new Aa.Buf16(2*(2*WL+1)),Kc(this.dyn_ltree),Kc(this.dyn_dtree),Kc(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Aa.Buf16(YL+1),this.heap=new Aa.Buf16(2*Bk+1),Kc(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Aa.Buf16(2*Bk+1),Kc(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Zq($){var a;return $&&$.state?($.total_in=$.total_out=0,$.data_type=PL,(a=$.state).pending=0,a.pending_out=0,a.wrap<0&&(a.wrap=-a.wrap),a.status=a.wrap?yh:pd,$.adler=2===a.wrap?0:1,a.last_flush=od,bb._tr_init(a),Mb):Jc($,cb)}function $q($){var a=Zq($);return a===Mb&&nM($.state),a}function pM($,a){return $&&$.state?2!==$.state.wrap?cb:($.state.gzhead=a,Mb):cb}function _q($,a,t,r,e,_){if(!$)return cb;var s=1;if(a===KL&&(a=6),r<0?(s=0,r=-r):r>15&&(s=2,r-=16),e<1||e>QL||t!==xh||r<8||r>15||a<0||a>9||_<0||_>NL)return Jc($,cb);8===r&&(r=9);var O=new oM;return $.state=O,O.strm=$,O.wrap=s,O.gzhead=null,O.w_bits=r,O.w_size=1<Vq||a<0)return $?Jc($,cb):cb;if(r=$.state,!$.output||!$.input&&0!==$.avail_in||r.status===yf&&a!==Hc)return Jc($,0===$.avail_out?Ak:cb);if(r.strm=$,t=r.last_flush,r.last_flush=a,r.status===yh)if(2===r.wrap)$.adler=0,C(r,31),C(r,139),C(r,8),r.gzhead?(C(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),C(r,255&r.gzhead.time),C(r,r.gzhead.time>>8&255),C(r,r.gzhead.time>>16&255),C(r,r.gzhead.time>>24&255),C(r,9===r.level?2:r.strategy>=wh||r.level<2?4:0),C(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(C(r,255&r.gzhead.extra.length),C(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&($.adler=Gc($.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=Ck):(C(r,0),C(r,0),C(r,0),C(r,0),C(r,0),C(r,9===r.level?2:r.strategy>=wh||r.level<2?4:0),C(r,$L),r.status=pd);else{var s=xh+(r.w_bits-8<<4)<<8;s|=(r.strategy>=wh||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(s|=ZL),s+=31-s%31,r.status=pd,Af(r,s),0!==r.strstart&&(Af(r,$.adler>>>16),Af(r,65535&$.adler)),$.adler=1}if(r.status===Ck)if(r.gzhead.extra){for(e=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>e&&($.adler=Gc($.adler,r.pending_buf,r.pending-e,e)),Lc($),e=r.pending,r.pending!==r.pending_buf_size));)C(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>e&&($.adler=Gc($.adler,r.pending_buf,r.pending-e,e)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=zh)}else r.status=zh;if(r.status===zh)if(r.gzhead.name){e=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>e&&($.adler=Gc($.adler,r.pending_buf,r.pending-e,e)),Lc($),e=r.pending,r.pending===r.pending_buf_size)){_=1;break}_=r.gzindexe&&($.adler=Gc($.adler,r.pending_buf,r.pending-e,e)),0===_&&(r.gzindex=0,r.status=Ah)}else r.status=Ah;if(r.status===Ah)if(r.gzhead.comment){e=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>e&&($.adler=Gc($.adler,r.pending_buf,r.pending-e,e)),Lc($),e=r.pending,r.pending===r.pending_buf_size)){_=1;break}_=r.gzindexe&&($.adler=Gc($.adler,r.pending_buf,r.pending-e,e)),0===_&&(r.status=Bh)}else r.status=Bh;if(r.status===Bh&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Lc($),r.pending+2<=r.pending_buf_size&&(C(r,255&$.adler),C(r,$.adler>>8&255),$.adler=0,r.status=pd)):r.status=pd),0!==r.pending){if(Lc($),0===$.avail_out)return r.last_flush=-1,Mb}else if(0===$.avail_in&&Xq(a)<=Xq(t)&&a!==Hc)return Jc($,Ak);if(r.status===yf&&0!==$.avail_in)return Jc($,Ak);if(0!==$.avail_in||0!==r.lookahead||a!==od&&r.status!==yf){var O=r.strategy===wh?mM(r,a):r.strategy===ML?lM(r,a):xf[r.level].func(r,a);if(O!==qd&&O!==se||(r.status=yf),O===ga||O===qd)return 0===$.avail_out&&(r.last_flush=-1),Mb;if(O===zf&&(a===HL?bb._tr_align(r):a!==Vq&&(bb._tr_stored_block(r,0,0,!1),a===IL&&(Kc(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Lc($),0===$.avail_out))return r.last_flush=-1,Mb}return a!==Hc?Mb:r.wrap<=0?Wq:(2===r.wrap?(C(r,255&$.adler),C(r,$.adler>>8&255),C(r,$.adler>>16&255),C(r,$.adler>>24&255),C(r,255&$.total_in),C(r,$.total_in>>8&255),C(r,$.total_in>>16&255),C(r,$.total_in>>24&255)):(Af(r,$.adler>>>16),Af(r,65535&$.adler)),Lc($),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?Mb:Wq)}function sM($){var a;return $&&$.state?(a=$.state.status)!==yh&&a!==Ck&&a!==zh&&a!==Ah&&a!==Bh&&a!==pd&&a!==yf?Jc($,cb):($.state=null,a===pd?Jc($,JL):Mb):cb}function tM($,a){var t,r,e,_,s,O,D,i,n=a.length;if(!$||!$.state)return cb;if(2===(_=(t=$.state).wrap)||1===_&&t.status!==yh||t.lookahead)return cb;for(1===_&&($.adler=Uq($.adler,a,n,0)),t.wrap=0,n>=t.w_size&&(0===_&&(Kc(t.head),t.strstart=0,t.block_start=0,t.insert=0),**new Aa.Buf8(t.w_size),Aa.arraySet(i,a,n-t.w_size,t.w_size,0),a=i,n=t.w_size),s=$.avail_in,O=$.next_in,D=$.input,$.avail_in=n,$.next_in=0,$.input=a,rd(t);t.lookahead>=w;){r=t.strstart,e=t.lookahead-(w-1);do{t.ins_h=(t.ins_h<>>=k=m>>>24,c-=k,0===(k=m>>>16&255))A[f++]=65535&m;else{if(!(16&k)){if(0==(64&k)){m=u[(65535&m)+(b&(1<>>=k,c-=k),c<15&&(b+=g[o++]<>>=k=m>>>24,c-=k,!(16&(k=m>>>16&255))){if(0==(64&k)){m=w[(65535&m)+(b&(1<l){i.msg="invalid distance too far back",a.mode=Ch;break i}if(b>>>=k,c-=k,N>(k=f-d)){if((k=N-k)>r&&a.sane){i.msg="invalid distance too far back",a.mode=Ch;break i}if(_=0,x=v,0===s){if(_+=$-k,k2;)A[f++]=x[_++],A[f++]=x[_++],A[f++]=x[_++],I-=3;I&&(A[f++]=x[_++],I>1&&(A[f++]=x[_++]))}else{_=f-N;do{A[f++]=A[_++],A[f++]=A[_++],A[f++]=A[_++],I-=3}while(I>2);I&&(A[f++]=A[_++],I>1&&(A[f++]=A[_++]))}break}}break}}while(o>3,b&=(1<<(c-=I<<3))-1,i.next_in=o,i.next_out=f,i.avail_in=o=1&&0===_[D];D--);if(O>D&&(O=D),0===D)return L[a++]=20971520,L[a++]=20971520,S.bits=1,0;for(B=1;B0&&($===dr||1!==D))return-1;for(d[1]=0,N=1;Nbr||$===er&&X>cr)return 1;for(;;){l=N-A,v[T]E?(n=***+v[T]],s=H[U+v[T]]):(n=96,s=0),e=1<>A)+(f-=e)]=l<<24|n<<16|s|0}while(0!==f);for(e=1<>=1;if(0!==e?(x&=e-1,x+=e):x=0,T++,0==--_[N]){if(N===D)break;N=G[r+v[T]]}if(N>O&&(x&o)!==i){for(0===A&&(A=O),u+=B,M=1<<(b=N-A);b+Abr||$===er&&X>cr)return 1;L[**x&o]=O<<24|b<<16|u-a|0}}return 0!==x&&(L[u+x]=N-A<<24|64<<16|0),S.bits=O,0}}var ub,Ra,Fk,Ob,GM,Bf,HM,fr,gr,hr,IM,Dh,sd,JM,KM,db,ir,Gk,LM,jr,kr,lr,mr,nr,or,pr,qr,rr,sr,tr,Eh,nc,Hk,ur,Ik,vr,wr,xr,yr,Fh,Gh,zr,Ar,Br,Cr,Dr,Jk,Er,Fr,O,Kk,MM,NM,OM,PM,QM,Gr,Hr,RM,SM,TM,UM,VM,WM,XM,YM,ZM,$M,_M,aN=false;function Ir($){return($>>>24&255)+($>>>8&65280)+((65280&$)<<8)+((255&$)<<24)}function bN(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Ra.Buf16(320),this.work=new Ra.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Jr($){var e;return $&&$.state?(e=$.state,$.total_in=$.total_out=e.total=0,$.msg="",e.wrap&&($.adler=1&e.wrap),e.mode=kr,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new Ra.Buf32(NM),e.distcode=e.distdyn=new Ra.Buf32(OM),e.sane=1,e.back=-1,sd):db}function Kr($){var e;return $&&$.state?((e=$.state).wsize=0,e.whave=0,e.wnext=0,Jr($)):db}function Lr($,e){var a,s;return $&&$.state?(s=$.state,e<0?(a=0,e=-e):(a=1+(e>>4),e<48&&(e&=15)),e&&(e<8||e>15)?db:(null!==s.window&&s.wbits!==e&&(s.window=null),s.wrap=a,s.wbits=e,Kr($))):db}function Mr($,e){var a,s;return $?(s=new bN,$.state=s,s.window=null,(a=Lr($,e))!==sd&&($.state=null),a):db}function cN($){return Mr($,QM)}function dN($){if(RM){var e;for(Gr=new Ra.Buf32(512),Hr=new Ra.Buf32(32),e=0;e<144;)$.lens[e++]=8;for(;e<256;)$.lens[e++]=9;for(;e<280;)$.lens[e++]=7;for(;e<288;)$.lens[e++]=8;for(Bf(fr,$.lens,0,288,Gr,0,$.work,{bits:9}),e=0;e<32;)$.lens[e++]=5;Bf(gr,$.lens,0,32,Hr,0,$.work,{bits:5}),RM=!1}$.lencode=Gr,$.lenbits=9,$.distcode=Hr,$.distbits=5}function Nr($,e,a,s){var r,t=$.state;return null===t.window&&(t.wsize=1<=t.wsize?(Ra.arraySet(t.window,e,a-t.wsize,t.wsize,0),t.wnext=0,t.whave=t.wsize):((r=t.wsize-t.wnext)>s&&(r=s),Ra.arraySet(t.window,e,a-s,r,t.wnext),(s-=r)?(Ra.arraySet(t.window,e,a-s,s,0),t.wnext=s,t.whave=t.wsize):(t.wnext+=r,t.wnext===t.wsize&&(t.wnext=0),t.whave>>8&255,a.check=Ob(a.check,g,2,0),n=0,v=0,a.mode=lr;break}if(a.flags=0,a.head&&(a.head.done=!1),!(1&a.wrap)||(((255&n)<<8)+(n>>8))%31){$.msg="incorrect header check",a.mode=O;break}if((15&n)!==jr){$.msg="unknown compression method",a.mode=O;break}if(v-=4,R=8+(15&(n>>>=4)),0===a.wbits)a.wbits=R;else if(R>a.wbits){$.msg="invalid window size",a.mode=O;break}a.dmax=1<>8&1),512&a.flags&&(g[0]=255&n,g[1]=n>>>8&255,a.check=Ob(a.check,g,2,0)),n=0,v=0,a.mode=mr;case mr:for(;v<32;){if(0===b)break $;b--,n+=s[t++]<>>8&255,g[2]=n>>>16&255,g[3]=n>>>24&255,a.check=Ob(a.check,g,4,0)),n=0,v=0,a.mode=nr;case nr:for(;v<16;){if(0===b)break $;b--,n+=s[t++]<>8),512&a.flags&&(g[0]=255&n,g[1]=n>>>8&255,a.check=Ob(a.check,g,2,0)),n=0,v=0,a.mode=or;case or:if(1024&a.flags){for(;v<16;){if(0===b)break $;b--,n+=s[t++]<>>8&255,a.check=Ob(a.check,g,2,0)),n=0,v=0}else a.head&&(a.head.extra=null);a.mode=pr;case pr:if(1024&a.flags&&((o=a.length)>b&&(o=b),o&&(a.head&&(R=a.head.extra_len-a.length,a.head.extra||(a.head.extra=new Array(a.head.extra_len)),Ra.arraySet(a.head.extra,s,t,o,R)),512&a.flags&&(a.check=Ob(a.check,s,o,t)),b-=o,t+=o,a.length-=o),a.length))break $;a.length=0,a.mode=qr;case qr:if(2048&a.flags){if(0===b)break $;o=0;do{R=s[t+o++],a.head&&R&&a.length<65536&&(a.head.name+=String.fromCharCode(R))}while(R&&o>9&1,a.head.done=!0),$.adler=a.check=0,a.mode=nc;break;case tr:for(;v<32;){if(0===b)break $;b--,n+=s[t++]<>>=7&v,v-=7&v,a.mode=Jk;break}for(;v<3;){if(0===b)break $;b--,n+=s[t++]<>>=1)){case 0:a.mode=ur;break;case 1:if(dN(a),a.mode=Fh,e===Dh){n>>>=2,v-=2;break $}break;case 2:a.mode=wr;break;case 3:$.msg="invalid block type",a.mode=O;}n>>>=2,v-=2;break;case ur:for(n>>>=7&v,v-=7&v;v<32;){if(0===b)break $;b--,n+=s[t++]<>>16^65535)){$.msg="invalid stored block lengths",a.mode=O;break}if(a.length=65535&n,n=0,v=0,a.mode=Ik,e===Dh)break $;case Ik:a.mode=vr;case vr:if(o=a.length){if(o>b&&(o=b),o>i&&(o=i),0===o)break $;Ra.arraySet(r,s,t,o,E),b-=o,t+=o,i-=o,E+=o,a.length-=o;break}a.mode=nc;break;case wr:for(;v<14;){if(0===b)break $;b--,n+=s[t++]<>>=5,v-=5,a.ndist=1+(31&n),n>>>=5,v-=5,a.ncode=4+(15&n),n>>>=4,v-=4,a.nlen>286||a.ndist>30){$.msg="too many length or distance symbols",a.mode=O;break}a.have=0,a.mode=xr;case xr:for(;a.have>>=3,v-=3}for(;a.have<19;)a.lens[S[a.have++]]=0;if(a.lencode=a.lendyn,a.lenbits=7,x={bits:a.lenbits},u=Bf(HM,a.lens,0,19,a.lencode,0,a.work,x),a.lenbits=x.bits,u){$.msg="invalid code lengths set",a.mode=O;break}a.have=0,a.mode=yr;case yr:for(;a.have>>16&255,_=65535&D,!((c=D>>>24)<=v);){if(0===b)break $;b--,n+=s[t++]<>>=c,v-=c,a.lens[a.have++]=_;else{if(16===_){for(T=c+2;v>>=c,v-=c,0===a.have){$.msg="invalid bit length repeat",a.mode=O;break}R=a.lens[a.have-1],o=3+(3&n),n>>>=2,v-=2}else if(17===_){for(T=c+3;v>>=c)),n>>>=3,v-=3}else{for(T=c+7;v>>=c)),n>>>=7,v-=7}if(a.have+o>a.nlen+a.ndist){$.msg="invalid bit length repeat",a.mode=O;break}for(;o--;)a.lens[a.have++]=R}}if(a.mode===O)break;if(0===a.lens[256]){$.msg="invalid code -- missing end-of-block",a.mode=O;break}if(a.lenbits=9,x={bits:a.lenbits},u=Bf(fr,a.lens,0,a.nlen,a.lencode,0,a.work,x),a.lenbits=x.bits,u){$.msg="invalid literal/lengths set",a.mode=O;break}if(a.distbits=6,a.distcode=a.distdyn,x={bits:a.distbits},u=Bf(gr,a.lens,a.nlen,a.ndist,a.distcode,0,a.work,x),a.distbits=x.bits,u){$.msg="invalid distances set",a.mode=O;break}if(a.mode=Fh,e===Dh)break $;case Fh:a.mode=Gh;case Gh:if(b>=6&&i>=258){$.next_out=E,$.avail_out=i,$.next_in=t,$.avail_in=b,a.hold=n,a.bits=v,GM($,l),E=$.next_out,r=$.output,i=$.avail_out,t=$.next_in,s=$.input,b=$.avail_in,n=a.hold,v=a.bits,a.mode===nc&&(a.back=-1);break}for(a.back=0;h=(D=a.lencode[n&(1<>>16&255,_=65535&D,!((c=D>>>24)<=v);){if(0===b)break $;b--,n+=s[t++]<>k)])>>>16&255,_=65535&D,!(k+(c=D>>>24)<=v);){if(0===b)break $;b--,n+=s[t++]<>>=k,v-=k,a.back+=k}if(n>>>=c,v-=c,a.back+=c,a.length=_,0===h){a.mode=Dr;break}if(32&h){a.back=-1,a.mode=nc;break}if(64&h){$.msg="invalid literal/length code",a.mode=O;break}a.extra=15&h,a.mode=zr;case zr:if(a.extra){for(T=a.extra;v>>=a.extra,v-=a.extra,a.back+=a.extra}a.was=a.length,a.mode=Ar;case Ar:for(;h=(D=a.distcode[n&(1<>>16&255,_=65535&D,!((c=D>>>24)<=v);){if(0===b)break $;b--,n+=s[t++]<>k)])>>>16&255,_=65535&D,!(k+(c=D>>>24)<=v);){if(0===b)break $;b--,n+=s[t++]<>>=k,v-=k,a.back+=k}if(n>>>=c,v-=c,a.back+=c,64&h){$.msg="invalid distance code",a.mode=O;break}a.offset=_,a.extra=15&h,a.mode=Br;case Br:if(a.extra){for(T=a.extra;v>>=a.extra,v-=a.extra,a.back+=a.extra}if(a.offset>a.dmax){$.msg="invalid distance too far back",a.mode=O;break}a.mode=Cr;case Cr:if(0===i)break $;if(o=l-i,a.offset>o){if((o=a.offset-o)>a.whave&&a.sane){$.msg="invalid distance too far back",a.mode=O;break}o>a.wnext?(o-=a.wnext,f=a.wsize-o):f=a.wnext-o,o>a.length&&(o=a.length),d=a.window}else d=r,f=E-a.offset,o=a.length;o>i&&(o=i),i-=o,a.length-=o;do{r[E++]=d[f++]}while(--o);0===a.length&&(a.mode=Gh);break;case Dr:if(0===i)break $;r[E++]=a.length,i--,a.mode=Gh;break;case Jk:if(a.wrap){for(;v<32;){if(0===b)break $;b--,n|=s[t++]<xd)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=t,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}function tN(){if(sN)return;sN=true;n={};mN=(ab(),_a);nN=(z(),r).Buffer;Sa=(ok(),nk);oN=(MK(),JK);Cf=(uM(),Lb);td=(iN(),ub);Or=(lN(),jN);for(var $MzTy$var$key in Or)n[$MzTy$var$key]=Or[$MzTy$var$key];Lk=0;n.NONE=Lk;ud=1;n.DEFLATE=ud;vd=2;n.INFLATE=vd;ve=3;n.GZIP=ve;Mc=4;n.GUNZIP=Mc;wd=5;n.DEFLATERAW=wd;we=6;n.INFLATERAW=we;xd=7;n.UNZIP=xd;pN=31;qN=139;qa.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,Sa(this.init_done,"close before init"),Sa(this.mode<=xd),this.mode===ud||this.mode===ve||this.mode===wd?Cf.deflateEnd(this.strm):this.mode!==vd&&this.mode!==Mc&&this.mode!==we&&this.mode!==xd||td.inflateEnd(this.strm),this.mode=Lk,this.dictionary=null)},qa.prototype.write=function(t,r,e,s,i,$,o){return this._write(!0,t,r,e,s,i,$,o)},qa.prototype.writeSync=function(t,r,e,s,i,$,o){return this._write(!1,t,r,e,s,i,$,o)},qa.prototype._write=function(t,r,e,s,i,$,o,a){if(Sa.equal(arguments.length,8),Sa(this.init_done,"write before init"),Sa(this.mode!==Lk,"already finalized"),Sa.equal(!1,this.write_in_progress,"write already in progress"),Sa.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,Sa.equal(!1,void 0===r,"must provide flush value"),this.write_in_progress=!0,r!==n.Z_NO_FLUSH&&r!==n.Z_PARTIAL_FLUSH&&r!==n.Z_SYNC_FLUSH&&r!==n.Z_FULL_FLUSH&&r!==n.Z_FINISH&&r!==n.Z_BLOCK)throw new Error("Invalid flush value");if(null==e&&(e=nN.alloc(0),**0,s=0),this.strm.avail_in=i,this.strm.input=e,this.strm.next_in=s,this.strm.avail_out=a,this.strm.output=$,this.strm.next_out=o,this.flush=r,!t)return this._process(),this._checkError()?this._afterSync():void 0;var y=this;return mN.nextTick(function(){y._process(),y._after()}),this},qa.prototype._afterSync=function(){var t=this.strm.avail_out,r=this.strm.avail_in;return this.write_in_progress=!1,[r,t]},qa.prototype._process=function(){var t=null;switch(this.mode){case ud:case ve:case wd:this.err=Cf.deflate(this.strm,this.flush);break;case xd:switch(this.strm.avail_in>0&&(t=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===t)break;if(this.strm.input[t]!==pN){this.mode=vd;break}if(this.gzip_id_bytes_read=1,t++,1===this.strm.avail_in)break;case 1:if(null===t)break;this.strm.input[t]===qN?(this.gzip_id_bytes_read=2,this.mode=Mc):this.mode=vd;break;default:throw new Error("invalid number of gzip magic number bytes read");}case vd:case Mc:case we:for(this.err=td.inflate(this.strm,this.flush),this.err===n.Z_NEED_DICT&&this.dictionary&&(this.err=td.inflateSetDictionary(this.strm,this.dictionary),this.err===n.Z_OK?this.err=td.inflate(this.strm,this.flush):this.err===n.Z_DATA_ERROR&&(this.err=n.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===Mc&&this.err===n.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=td.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode);}},qa.prototype._checkError=function(){switch(this.err){case n.Z_OK:case n.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===n.Z_FINISH)return this._error("unexpected end of file"),!1;break;case n.Z_STREAM_END:break;case n.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1;}return!0},qa.prototype._after=function(){if(this._checkError()){var t=this.strm.avail_out,r=this.strm.avail_in;this.write_in_progress=!1,this.callback(r,t),this.pending_close&&this.close()}},qa.prototype._error=function(t){this.strm.msg&&(t=this.strm.msg),this.onerror(t,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},qa.prototype.init=function(t,r,e,s,i){Sa(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),Sa(t>=8&&t<=15,"invalid windowBits"),Sa(r>=-1&&r<=9,"invalid compression level"),Sa(e>=1&&e<=9,"invalid memlevel"),Sa(s===n.Z_FILTERED||s===n.Z_HUFFMAN_ONLY||s===n.Z_RLE||s===n.Z_FIXED||s===n.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,t,e,s,i),this._setDictionary()},qa.prototype.params=function(){throw new Error("deflateParams Not supported")},qa.prototype.reset=function(){this._reset(),this._setDictionary()},qa.prototype._init=function(t,r,e,s,i){switch(this.level=t,this.windowBits=r,this.memLevel=e,this.strategy=s,this.flush=n.Z_NO_FLUSH,this.err=n.Z_OK,this.mode!==ve&&this.mode!==Mc||(this.windowBits+=16),this.mode===xd&&(this.windowBits+=32),this.mode!==wd&&this.mode!==we||(this.windowBits=-1*this.windowBits),this.strm=new oN,this.mode){case ud:case ve:case wd:this.err=Cf.deflateInit2(this.strm,this.level,n.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case vd:case Mc:case we:case xd:this.err=td.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode);}this.err!==n.Z_OK&&this._error("Init error"),this.dictionary=i,this.write_in_progress=!1,this.init_done=!0},qa.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=n.Z_OK,this.mode){case ud:case wd:this.err=Cf.deflateSetDictionary(this.strm,this.dictionary);}this.err!==n.Z_OK&&this._error("Failed to set dictionary")}},qa.prototype._reset=function(){switch(this.err=n.Z_OK,this.mode){case ud:case wd:case ve:this.err=Cf.deflateReset(this.strm);break;case vd:case we:case Mc:this.err=td.inflateReset(this.strm);}this.err!==n.Z_OK&&this._error("Failed to reset stream")};rN=qa;n.Zlib=rN}var f,Hh,Pb,Pr,i,Nc,Df,Mk,Qr,uN,vN,wN,xN,yN,zN,AN,BN,CN,DN,EN,FN,GN,HN,IN,JN,KN,LN,MN,NN,ON,PN,QN,RN,SN,TN,UN,VN,WN=false;function yd($,r,e){var l=[],s=0;function n(){for(var r;null!==(r=$.read());)l.push(r),s+=r.length;$.once("readable",n)}function t(){var r,n=null;s>=Mk?n=new RangeError(Qr):r=Pb.concat(l,s),l=[],$.close(),e(n,r)}$.on("error",function(r){$.removeListener("end",t),$.removeListener("readable",n),e(r)}),$.on("end",t),$.end(r),n()}function zd($,r){if("string"==typeof r&&(r=Pb.from(r)),!Pb.isBuffer(r))throw new TypeError("Not a string or buffer");var e=$._finishFlushFlag;return $._processChunk(r,e)}function Ad($){if(!(this instanceof Ad))return new Ad($);S.call(this,$,i.DEFLATE)}function Bd($){if(!(this instanceof Bd))return new Bd($);S.call(this,$,i.INFLATE)}function Cd($){if(!(this instanceof Cd))return new Cd($);S.call(this,$,i.GZIP)}function Dd($){if(!(this instanceof Dd))return new Dd($);S.call(this,$,i.GUNZIP)}function Ed($){if(!(this instanceof Ed))return new Ed($);S.call(this,$,i.DEFLATERAW)}function Fd($){if(!(this instanceof Fd))return new Fd($);S.call(this,$,i.INFLATERAW)}function Gd($){if(!(this instanceof Gd))return new Gd($);S.call(this,$,i.UNZIP)}function Rr($){return $===i.Z_NO_FLUSH||$===i.Z_PARTIAL_FLUSH||$===i.Z_SYNC_FLUSH||$===i.Z_FULL_FLUSH||$===i.Z_FINISH||$===i.Z_BLOCK}function S($,r){var e=this;if(this._opts=$=$||{},this._chunkSize=$.chunkSize||f.Z_DEFAULT_CHUNK,Pr.call(this,$),$.flush&&!Rr($.flush))throw new Error("Invalid flush flag: "+$.flush);if($.finishFlush&&!Rr($.finishFlush))throw new Error("Invalid flush flag: "+$.finishFlush);if(this._flushFlag=$.flush||i.Z_NO_FLUSH,this._finishFlushFlag=void 0!==$.finishFlush?$.finishFlush:i.Z_FINISH,$.chunkSize&&($.chunkSizef.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+$.chunkSize);if($.windowBits&&($.windowBitsf.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+$.windowBits);if($.level&&($.levelf.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+$.level);if($.memLevel&&($.memLevelf.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+$.memLevel);if($.strategy&&$.strategy!=f.Z_FILTERED&&$.strategy!=f.Z_HUFFMAN_ONLY&&$.strategy!=f.Z_RLE&&$.strategy!=f.Z_FIXED&&$.strategy!=f.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+$.strategy);if($.dictionary&&!Pb.isBuffer($.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new i.Zlib(r);var l=this;this._hadError=!1,this._handle.onerror=function($,r){Ih(l),l._hadError=!0;var e=new Error($);e.errno=r,e.code=f.codes[r],l.emit("error",e)};var s=f.Z_DEFAULT_COMPRESSION;"number"==typeof $.level&&(s=$.level);var n=f.Z_DEFAULT_STRATEGY;"number"==typeof $.strategy&&(n=$.strategy),this._handle.init($.windowBits||f.Z_DEFAULT_WINDOWBITS,s,$.memLevel||f.Z_DEFAULT_MEMLEVEL,n,$.dictionary),this._buffer=Pb.allocUnsafe(this._chunkSize),this._offset=0,this._level=s,this._strategy=n,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!e._handle},configurable:!0,enumerable:!0})}function Ih($,r){r&&Hh.nextTick(r),$._handle&&($._handle.close(),$._handle=null)}function XN($){$.emit("close")}function YN(){if(WN)return;WN=true;f={};Hh=(ab(),_a);Pb=(z(),r).Buffer;Pr=(kh(),jh).Transform;i=(tN(),n);Nc=(Lj(),D);Df=(ok(),nk).ok;Mk=(z(),r).kMaxLength;Qr="Cannot create final Buffer. It would be larger than 0x"+Mk.toString(16)+" bytes";i.Z_MIN_WINDOWBITS=8,i.Z_MAX_WINDOWBITS=15,i.Z_DEFAULT_WINDOWBITS=15,i.Z_MIN_CHUNK=64,i.Z_MAX_CHUNK=1/0,i.Z_DEFAULT_CHUNK=16384,i.Z_MIN_MEMLEVEL=1,i.Z_MAX_MEMLEVEL=9,i.Z_DEFAULT_MEMLEVEL=8,i.Z_MIN_LEVEL=-1,i.Z_MAX_LEVEL=9,i.Z_DEFAULT_LEVEL=i.Z_DEFAULT_COMPRESSION;for(var $lFJs$var$bkeys=Object.keys(i),$lFJs$var$bk=0;$lFJs$var$bk<$lFJs$var$bkeys.length;$lFJs$var$bk++){var $lFJs$var$bkey=$lFJs$var$bkeys[$lFJs$var$bk];$lFJs$var$bkey.match(/^Z/)&&Object.defineProperty(f,$lFJs$var$bkey,{enumerable:!0,value:i[$lFJs$var$bkey],writable:!1})}for(var $lFJs$var$codes={Z_OK:i.Z_OK,Z_STREAM_END:i.Z_STREAM_END,Z_NEED_DICT:i.Z_NEED_DICT,Z_ERRNO:i.Z_ERRNO,Z_STREAM_ERROR:i.Z_STREAM_ERROR,Z_DATA_ERROR:i.Z_DATA_ERROR,Z_MEM_ERROR:i.Z_MEM_ERROR,Z_BUF_ERROR:i.Z_BUF_ERROR,Z_VERSION_ERROR:i.Z_VERSION_ERROR},$lFJs$var$ckeys=Object.keys($lFJs$var$codes),$lFJs$var$ck=0;$lFJs$var$ck<$lFJs$var$ckeys.length;$lFJs$var$ck++){var $lFJs$var$ckey=$lFJs$var$ckeys[$lFJs$var$ck];$lFJs$var$codes[$lFJs$var$codes[$lFJs$var$ckey]]=$lFJs$var$ckey}Object.defineProperty(f,"codes",{enumerable:!0,value:Object.freeze($lFJs$var$codes),writable:!1});uN=Ad;f.Deflate=uN;vN=Bd;f.Inflate=vN;wN=Cd;f.Gzip=wN;xN=Dd;f.Gunzip=xN;yN=Ed;f.DeflateRaw=yN;zN=Fd;f.InflateRaw=zN;AN=Gd;f.Unzip=AN;BN=function($){return new Ad($)};f.createDeflate=BN;CN=function($){return new Bd($)};f.createInflate=CN;DN=function($){return new Ed($)};f.createDeflateRaw=DN;EN=function($){return new Fd($)};f.createInflateRaw=EN;FN=function($){return new Cd($)};f.createGzip=FN;GN=function($){return new Dd($)};f.createGunzip=GN;HN=function($){return new Gd($)};f.createUnzip=HN;IN=function($,r,e){return"function"==typeof r&&(e=r,r={}),yd(new Ad(r),$,e)};f.deflate=IN;JN=function($,r){return zd(new Ad(r),$)};f.deflateSync=JN;KN=function($,r,e){return"function"==typeof r&&(e=r,r={}),yd(new Cd(r),$,e)};f.gzip=KN;LN=function($,r){return zd(new Cd(r),$)};f.gzipSync=LN;MN=function($,r,e){return"function"==typeof r&&(e=r,r={}),yd(new Ed(r),$,e)};f.deflateRaw=MN;NN=function($,r){return zd(new Ed(r),$)};f.deflateRawSync=NN;ON=function($,r,e){return"function"==typeof r&&(e=r,r={}),yd(new Gd(r),$,e)};f.unzip=ON;PN=function($,r){return zd(new Gd(r),$)};f.unzipSync=PN;QN=function($,r,e){return"function"==typeof r&&(e=r,r={}),yd(new Bd(r),$,e)};f.inflate=QN;RN=function($,r){return zd(new Bd(r),$)};f.inflateSync=RN;SN=function($,r,e){return"function"==typeof r&&(e=r,r={}),yd(new Dd(r),$,e)};f.gunzip=SN;TN=function($,r){return zd(new Dd(r),$)};f.gunzipSync=TN;UN=function($,r,e){return"function"==typeof r&&(e=r,r={}),yd(new Fd(r),$,e)};f.inflateRaw=UN;VN=function($,r){return zd(new Fd(r),$)};f.inflateRawSync=VN,Nc.inherits(S,Pr),S.prototype.params=function($,r,e){if($f.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+$);if(r!=f.Z_FILTERED&&r!=f.Z_HUFFMAN_ONLY&&r!=f.Z_RLE&&r!=f.Z_FIXED&&r!=f.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+r);if(this._level!==$||this._strategy!==r){var l=this;this.flush(i.Z_SYNC_FLUSH,function(){Df(l._handle,"zlib binding closed"),l._handle.params($,r),l._hadError||(l._level=$,l._strategy=r,e&&e())})}else Hh.nextTick(e)},S.prototype.reset=function(){return Df(this._handle,"zlib binding closed"),this._handle.reset()},S.prototype._flush=function($){this._transform(Pb.alloc(0),"",$)},S.prototype.flush=function($,r){var e=this,l=this._writableState;("function"==typeof $||void 0===$&&!r)&&(r=$,$=i.Z_FULL_FLUSH),l.ended?r&&Hh.nextTick(r):l.ending?r&&this.once("end",r):l.needDrain?r&&this.once("drain",function(){return e.flush($,r)}):(this._flushFlag=$,this.write(Pb.alloc(0),"",r))},S.prototype.close=function($){Ih(this,$),Hh.nextTick(XN,this)},S.prototype._transform=function($,r,e){var l,s=this._writableState,n=(s.ending||s.ended)&&(!$||s.length===$.length);return null===$||Pb.isBuffer($)?this._handle?(n?l=this._finishFlushFlag:(l=this._flushFlag,$.length>=s.length&&(this._flushFlag=this._opts.flush||i.Z_NO_FLUSH)),void this._processChunk($,l,e)):e(new Error("zlib binding closed")):e(new Error("invalid input"))},S.prototype._processChunk=function($,r,e){var l=$&&$.length,s=this._chunkSize-this._offset,n=0,t=this,a="function"==typeof e;if(!a){var i,F=[],o=0;this.on("error",function($){i=$}),Df(this._handle,"zlib binding closed");do{var f=this._handle.writeSync(r,$,n,l,this._buffer,this._offset,s)}while(!this._hadError&&u(f[0],f[1]));if(this._hadError)throw i;if(o>=Mk)throw Ih(this),new RangeError(Qr);var J=Pb.concat(F,o);return Ih(this),J}Df(this._handle,"zlib binding closed");var v=this._handle.write(r,$,n,l,this._buffer,this._offset,s);function u(i,f){if(this&&(this.buffer=null,this.callback=null),!t._hadError){var J=s-f;if(Df(J>=0,"have should not go down"),J>0){var v=t._buffer.slice(t._offset,t._offset+J);t._offset+=J,a?t.push(v):(F.push(v),o+=v.length)}if((0===f||t._offset>=t._chunkSize)&&(s=t._chunkSize,t._offset=0,t._buffer=Pb.allocUnsafe(t._chunkSize)),0===f){if(n+=l-i,l=i,!a)return!0;var p=t._handle.write(r,$,n,l,t._buffer,t._offset,t._chunkSize);return p.callback=u,void(p.buffer=$)}if(!a)return!1;e()}}v.buffer=$,v.callback=u},Nc.inherits(Ad,S),Nc.inherits(Bd,S),Nc.inherits(Cd,S),Nc.inherits(Dd,S),Nc.inherits(Ed,S),Nc.inherits(Fd,S),Nc.inherits(Gd,S)}var ZN,$N,Sr,Tr,_N,aO,bO=false;function Ur(r,e,n,o,t,$,a){try{var **r[$](a),u=i.value}catch(c){return void n(c)}i.done?e(u):Promise.resolve(u).then(o,t)}function Vr(r){return function(){var e=this,n=arguments;return new Promise(function(o,t){var $=r.apply(e,n);function a(r){Ur($,o,t,a,i,"next",r)}function i(r){Ur($,o,t,a,i,"throw",r)}a(void 0)})}}function cO(){if(bO)return;bO=true;ZN={};$N=(Lj(),D);Sr=$N.promisify;Tr=(YN(),f);_N=Sr(Tr.gzip);aO=Sr(Tr.unzip);ZN={compress:function(r){return Vr(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_N(r.buffer);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop();}},e)}))()},decompress:function(r){return Vr(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,aO(r);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop();}},e)}))()}}}var Jh,Qb,dO,Nk,eO,fO,Ef,Ff,gO,hO,iO,jO=false;function Kh($,e,r){return e in $?Object.defineProperty($,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):$[e]=r,$}function Rb(){if(jO)return;jO=true;Qb={};dO=(y(),x);Nk=dO.KafkaJSNotImplemented;eO=3;fO=7;Ef={None:0,GZIP:1,Snappy:2,LZ4:3,ZSTD:4};Ff=(Kh(Jh={},Ef.GZIP,function(){return cO(),ZN}),Kh(Jh,Ef.Snappy,function(){throw new Nk("Snappy compression not implemented")}),Kh(Jh,Ef.LZ4,function(){throw new Nk("LZ4 compression not implemented")}),Kh(Jh,Ef.ZSTD,function(){throw new Nk("ZSTD compression not implemented")}),Jh);gO=function($){return Ff[$]?Ff[$]():null};hO=function($){var e=Ff[$&eO];return e?e():null};iO=function($){var e=Ff[$&fO];return e?e():null};Qb={Types:Ef,Codecs:Ff,lookupCodec:gO,lookupCodecByAttributes:hO,lookupCodecByRecordBatchAttributes:iO}}var j,kO=false;function k(){if(kO)return;kO=true;j={};j={Produce:0,Fetch:1,ListOffsets:2,Metadata:3,LeaderAndIsr:4,StopReplica:5,UpdateMetadata:6,ControlledShutdown:7,OffsetCommit:8,OffsetFetch:9,GroupCoordinator:10,JoinGroup:11,Heartbeat:12,LeaveGroup:13,SyncGroup:14,DescribeGroups:15,ListGroups:16,SaslHandshake:17,ApiVersions:18,CreateTopics:19,DeleteTopics:20,DeleteRecords:21,InitProducerId:22,OffsetForLeaderEpoch:23,AddPartitionsToTxn:24,AddOffsetsToTxn:25,EndTxn:26,WriteTxnMarkers:27,TxnOffsetCommit:28,DescribeAcls:29,CreateAcls:30,DeleteAcls:31,DescribeConfigs:32,AlterConfigs:33,AlterReplicaLogDirs:34,DescribeLogDirs:35,SaslAuthenticate:36,CreatePartitions:37,CreateDelegationToken:38,RenewDelegationToken:39,ExpireDelegationToken:40,DescribeDelegationToken:41,DeleteGroups:42,ElectPreferredLeaders:43}}var g,s,Gf,lO,mO,Wr,nO,Xr,Ok,Yr,Zr,oO=false;function $r(r){return($r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function pO(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function _r(r,e){for(var t=0;t>31}},{key:"encodeZigZag64",value:function(r){var e=Gf.fromValue(r);return e.shiftLeft(1).xor(e.shiftRight(63))}},{key:"sizeOfVarInt",value:function(r){for(var e=this.encodeZigZag(r),t=1;0!=(e&Yr);)t+=1,e>>>=7;return t}},{key:"sizeOfVarLong",value:function(e){for(var t=r.encodeZigZag64(e),f=1;t.and(Zr).notEquals(Gf.fromInt(0));)f+=1,t=t.shiftRightUnsigned(7);return f}},{key:"sizeOfVarIntBytes",value:function(e){var t=null==e?-1:s.byteLength(e);return t<0?r.sizeOfVarInt(-1):r.sizeOfVarInt(t)+t}}]),as(r,[{key:"writeInt8",value:function(r){var e=s.alloc(lO);return e.writeInt8(r),this.buffer=s.concat([this.buffer,e]),this}},{key:"writeInt16",value:function(r){var e=s.alloc(mO);return e.writeInt16BE(r),this.buffer=s.concat([this.buffer,e]),this}},{key:"writeInt32",value:function(r){var e=s.alloc(Wr);return e.writeInt32BE(r),this.buffer=s.concat([this.buffer,e]),this}},{key:"writeUInt32",value:function(r){var e=s.alloc(Wr);return e.writeUInt32BE(r),this.buffer=s.concat([this.buffer,e]),this}},{key:"writeInt64",value:function(r){var e=s.alloc(nO),t=Gf.fromValue(r);return e.writeInt32BE(t.getHighBits(),0),e.writeInt32BE(t.getLowBits(),4),this.buffer=s.concat([this.buffer,e]),this}},{key:"writeBoolean",value:function(r){return r?this.writeInt8(1):this.writeInt8(0),this}},{key:"writeString",value:function(r){if(null==r)return this.writeInt16(-1),this;var e=s.byteLength(r,"utf8");this.writeInt16(e);var t=s.alloc(e);return t.write(r,0,e,"utf8"),this.buffer=s.concat([this.buffer,t]),this}},{key:"writeVarIntString",value:function(r){if(null==r)return this.writeVarInt(-1),this;var e=s.byteLength(r,"utf8");this.writeVarInt(e);var t=s.alloc(e);return t.write(r,0,e,"utf8"),this.buffer=s.concat([this.buffer,t]),this}},{key:"writeBytes",value:function(r){if(null==r)return this.writeInt32(-1),this;if(s.isBuffer(r))this.writeInt32(r.length),this.buffer=s.concat([this.buffer,r]);else{var e=String(r),t=s.byteLength(e,"utf8");this.writeInt32(t);var f=s.alloc(t);f.write(e,0,t,"utf8"),this.buffer=s.concat([this.buffer,f])}return this}},{key:"writeVarIntBytes",value:function(r){if(null==r)return this.writeVarInt(-1),this;if(s.isBuffer(r))this.writeVarInt(r.length),this.buffer=s.concat([this.buffer,r]);else{var e=String(r),t=s.byteLength(e,"utf8");this.writeVarInt(t);var f=s.alloc(t);f.write(e,0,t,"utf8"),this.buffer=s.concat([this.buffer,f])}return this}},{key:"writeEncoder",value:function(e){if(e instanceof r!=!0)throw new Error("value should be an instance of Encoder");return this.buffer=s.concat([this.buffer,e.buffer]),this}},{key:"writeEncoderArray",value:function(e){if(!Array.isArray(e)||e.some(function(e){return!(e instanceof r)}))throw new Error("all values should be an instance of Encoder[]");var t=[this.buffer];return e.forEach(function(r){t.push(r.buffer)}),this.buffer=s.concat(t),this}},{key:"writeBuffer",value:function(r){if(r instanceof s!=!0)throw new Error("value should be an instance of Buffer");return this.buffer=s.concat([this.buffer,r]),this}},{key:"writeNullableArray",value:function(r,e){var t=0!==r.length?r.length:-1;return this.writeArray(r,e,t)}},{key:"writeArray",value:function(r,e,t){var f=this,n=null==t?r.length:t;if(this.writeInt32(n),void 0!==e)switch(e){case"int32":case"number":r.forEach(function(r){return f.writeInt32(r)});break;case"string":r.forEach(function(r){return f.writeString(r)});break;case"object":this.writeEncoderArray(r);}else r.forEach(function(r){switch($r(r)){case"int32":case"number":f.writeInt32(r);break;case"string":f.writeString(r);break;case"object":f.writeEncoder(r);}});return this}},{key:"writeVarIntArray",value:function(r,e){if("object"===e)this.writeVarInt(r.length),this.writeEncoderArray(r);else{var t=r.filter(function(r){return"object"===$r(r)});this.writeVarInt(t.length),this.writeEncoderArray(t)}return this}},{key:"writeVarInt",value:function(e){for(var t=[],f=r.encodeZigZag(e);0!=(f&Yr);)t.push(f&Ok|Xr),f>>>=7;return t.push(f&Ok),this.buffer=s.concat([this.buffer,s.from(t)]),this}},{key:"writeVarLong",value:function(e){for(var t=[],f=r.encodeZigZag64(e);f.and(Zr).notEquals(Gf.fromInt(0));)t.push(f.and(Ok).or(Xr).toInt()),f=f.shiftRightUnsigned(7);return t.push(f.toInt()),this.buffer=s.concat([this.buffer,s.from(t)]),this}},{key:"size",value:function(){return s.byteLength(this.buffer)}},{key:"toJSON",value:function(){return this.buffer.toJSON()}}]),r}()}var bs,qO,rO=false;function cs(){if(rO)return;rO=true;bs={};qO=new Int32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);bs=function(r){for(var $=r.buffer,e=$.length,n=-1,t=0;t>>8;return-1^n}}var sO,ds,tO,uO,vO,wO=false;function xO(){if(wO)return;wO=true;sO={};ds=(h(),g);tO=(cs(),bs);uO=(Rb(),Qb);vO=uO.Types;sO=function(r){var e=r.compression,$=void 0===e?vO.None:e,s=r.key,u=r.value,n=new ds().writeInt8(0).writeInt8(3&$).writeBytes(s).writeBytes(u),o=tO(n);return new ds().writeInt32(o).writeEncoder(n)}}var yO,es,zO,AO,BO,CO=false;function DO(){if(CO)return;CO=true;yO={};es=(h(),g);zO=(cs(),bs);AO=(Rb(),Qb);BO=AO.Types;yO=function(r){var e=r.compression,$=void 0===e?BO.None:e,a=r.timestamp,**void 0===a?Date.now():a,n=r.key,o=r.value,t=new es().writeInt8(1).writeInt8(3&$).writeInt64(i).writeBytes(n).writeBytes(o),l=zO(t);return new es().writeInt32(l).writeEncoder(t)}}var EO,FO,GO=false;function HO(){if(GO)return;GO=true;EO={};FO={0:(xO(),sO),1:(DO(),yO)};EO=function(r){var $=r.version;return FO[void 0===$?0:$]}}var fs,IO,JO,KO,LO,MO=false;function gs(){if(MO)return;MO=true;fs={};IO=(h(),g);JO=(HO(),EO);KO=(Rb(),Qb);LO=KO.Types;fs=function(r){var e=r.messageVersion,$=void 0===e?0:e,o=r.compression,s=r.entries,a=o!==LO.None,g=JO({version:$}),n=new IO;return s.forEach(function(r,e){var $=g(r);n.writeInt64(a?e:-1),n.writeInt32($.size()),n.writeEncoder($)}),n}}var hs,Pk,NO,OO,PO,QO,RO,SO=false;function is(r,e,n,t,a,$,i){try{var o=r[$](i),v=o.value}catch(c){return void n(c)}o.done?e(v):Promise.resolve(v).then(t,a)}function TO(r){return function(){var e=this,n=arguments;return new Promise(function(t,a){var $=r.apply(e,n);function i(r){is($,t,a,i,o,"next",r)}function o(r){is($,t,a,i,o,"throw",r)}i(void 0)})}}function js(){if(SO)return;SO=true;hs={};Pk=(h(),g);NO=(k(),j);OO=NO.Produce;PO=(gs(),fs);hs=function(r){var e=r.acks,n=r.timeout,t=r.topicData;return{apiKey:OO,apiVersion:0,apiName:"Produce",expectResponse:function(){return 0!==e},encode:function(){var r=TO(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Pk().writeInt16(e).writeInt32(n).writeArray(t.map(QO)));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};QO=function(r){var e=r.topic,n=r.partitions;return new Pk().writeString(e).writeArray(n.map(RO))};RO=function(r){var e=r.partition,n=r.messages,t=PO({messageVersion:0,entries:n});return new Pk().writeInt32(e).writeInt32(t.size()).writeEncoder(t)}}var c,ks,Lh,UO,ls,Qk,ms,ns,os,VO=false;function ps(e,a,r,t,n,f,i){try{var s=e[f](i),u=s.value}catch(o){return void r(o)}s.done?a(u):Promise.resolve(u).then(t,n)}function WO(e){return function(){var a=this,r=arguments;return new Promise(function(t,n){var f=e.apply(a,r);function i(e){ps(f,t,n,i,s,"next",e)}function s(e){ps(f,t,n,i,s,"throw",e)}i(void 0)})}}function XO(e,a){if(!(e instanceof a))throw new TypeError("Cannot call a class as a function")}function qs(e,a){for(var r=0;r>>1^-(1&e)}},{key:"decodeZigZag64",value:function(e){return e.shiftRightUnsigned(1).xor(e.and(Lh.fromInt(1)).negate())}}]),rs(e,[{key:"readInt8",value:function(){var e=this.buffer.readInt8(this.offset);return this.offset+=UO,e}},{key:"canReadInt16",value:function(){return this.canReadBytes(ls)}},{key:"readInt16",value:function(){var e=this.buffer.readInt16BE(this.offset);return this.offset+=ls,e}},{key:"canReadInt32",value:function(){return this.canReadBytes(Qk)}},{key:"readInt32",value:function(){var e=this.buffer.readInt32BE(this.offset);return this.offset+=Qk,e}},{key:"canReadInt64",value:function(){return this.canReadBytes(ms)}},{key:"readInt64",value:function(){var e=this.buffer.readInt32BE(this.offset+4),a=this.buffer.readInt32BE(this.offset),r=new Lh(e,a);return this.offset+=ms,r}},{key:"readString",value:function(){var e=this.readInt16();if(-1===e)return null;var a=this.buffer.slice(this.offset,this.offset+e).toString("utf8");return this.offset+=e,a}},{key:"readVarIntString",value:function(){var e=this.readVarInt();if(-1===e)return null;var a=this.buffer.slice(this.offset,this.offset+e).toString("utf8");return this.offset+=e,a}},{key:"canReadBytes",value:function(e){return ks.byteLength(this.buffer)-this.offset>=e}},{key:"readBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.readInt32();if(-1===e)return null;var a=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,a}},{key:"readVarIntBytes",value:function(){var e=this.readVarInt();if(-1===e)return null;var a=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,a}},{key:"readBoolean",value:function(){return 1===this.readInt8()}},{key:"readAll",value:function(){var e=this.buffer.slice(this.offset);return this.offset+=ks.byteLength(this.buffer),e}},{key:"readArray",value:function(e){var a=this.readInt32();if(-1===a)return[];for(var r=[],t=0;t=ns);return e.decodeZigZag(r)}},{key:"readVarLong",value:function(){var a,r=Lh.fromInt(0),t=0;do{a=this.buffer[this.offset++],r=r.add(Lh.fromInt(a&os).shiftLeft(t)),t+=7}while(a>=ns);return e.decodeZigZag64(r)}},{key:"slice",value:function(a){return new e(this.buffer.slice(this.offset,this.offset+a))}},{key:"forward",value:function(e){this.offset+=e}}]),e}()}var ss,YO,ZO=false;function **(){if(ZO)return;ZO=true;ss={};YO="https://kafka.js.org";ss=function($,t){return"".concat(YO,"/").concat($).concat(t?"#"+t:"")}}var t,$O,_O,us,vs,aP,bP,ws,**,xs,dP,eP=false;function u(){if(eP)return;eP=true;t={};$O=(y(),x);_O=$O.KafkaJSProtocolError;us=(**(),ss);vs=[{type:"UNKNOWN",code:-1,retriable:!1,message:"The server experienced an unexpected error when processing the request"},{type:"OFFSET_OUT_OF_RANGE",code:1,retriable:!1,message:"The requested offset is not within the range of offsets maintained by the server"},{type:"CORRUPT_MESSAGE",code:2,retriable:!0,message:"This message has failed its CRC checksum, exceeds the valid size, or is otherwise corrupt"},{type:"UNKNOWN_TOPIC_OR_PARTITION",code:3,retriable:!0,message:"This server does not host this topic-partition"},{type:"INVALID_FETCH_SIZE",code:4,retriable:!1,message:"The requested fetch size is invalid"},{type:"LEADER_NOT_AVAILABLE",code:5,retriable:!0,message:"There is no leader for this topic-partition as we are in the middle of a leadership election"},{type:"NOT_LEADER_FOR_PARTITION",code:6,retriable:!0,message:"This server is not the leader for that topic-partition"},{type:"REQUEST_TIMED_OUT",code:7,retriable:!0,message:"The request timed out"},{type:"BROKER_NOT_AVAILABLE",code:8,retriable:!1,message:"The broker is not available"},{type:"REPLICA_NOT_AVAILABLE",code:9,retriable:!1,message:"The replica is not available for the requested topic-partition"},{type:"MESSAGE_TOO_LARGE",code:10,retriable:!1,message:"The request included a message larger than the max message size the server will accept"},{type:"STALE_CONTROLLER_EPOCH",code:11,retriable:!1,message:"The controller moved to another broker"},{type:"OFFSET_METADATA_TOO_LARGE",code:12,retriable:!1,message:"The metadata field of the offset request was too large"},{type:"NETWORK_EXCEPTION",code:13,retriable:!0,message:"The server disconnected before a response was received"},{type:"GROUP_LOAD_IN_PROGRESS",code:14,retriable:!0,message:"The coordinator is loading and hence can't process requests for this group"},{type:"GROUP_COORDINATOR_NOT_AVAILABLE",code:15,retriable:!0,message:"The group coordinator is not available"},{type:"NOT_COORDINATOR_FOR_GROUP",code:16,retriable:!0,message:"This is not the correct coordinator for this group"},{type:"INVALID_TOPIC_EXCEPTION",code:17,retriable:!1,message:"The request attempted to perform an operation on an invalid topic"},{type:"RECORD_LIST_TOO_LARGE",code:18,retriable:!1,message:"The request included message batch larger than the configured segment size on the server"},{type:"NOT_ENOUGH_REPLICAS",code:19,retriable:!0,message:"Messages are rejected since there are fewer in-sync replicas than required"},{type:"NOT_ENOUGH_REPLICAS_AFTER_APPEND",code:20,retriable:!0,message:"Messages are written to the log, but to fewer in-sync replicas than required"},{type:"INVALID_REQUIRED_ACKS",code:21,retriable:!1,message:"Produce request specified an invalid value for required acks"},{type:"ILLEGAL_GENERATION",code:22,retriable:!1,message:"Specified group generation id is not valid"},{type:"INCONSISTENT_GROUP_PROTOCOL",code:23,retriable:!1,message:"The group member's supported protocols are incompatible with those of existing members"},{type:"INVALID_GROUP_ID",code:24,retriable:!1,message:"The configured groupId is invalid"},{type:"UNKNOWN_MEMBER_ID",code:25,retriable:!1,message:"The coordinator is not aware of this member"},{type:"INVALID_SESSION_TIMEOUT",code:26,retriable:!1,message:"The session timeout is not within the range allowed by the broker (as configured by group.min.session.timeout.ms and group.max.session.timeout.ms)"},{type:"REBALANCE_IN_PROGRESS",code:27,retriable:!1,message:"The group is rebalancing, so a rejoin is needed",helpUrl:us("docs/faq","what-does-it-mean-to-get-rebalance-in-progress-errors")},{type:"INVALID_COMMIT_OFFSET_SIZE",code:28,retriable:!1,message:"The committing offset data size is not valid"},{type:"TOPIC_AUTHORIZATION_FAILED",code:29,retriable:!1,message:"Not authorized to access topics: [Topic authorization failed]"},{type:"GROUP_AUTHORIZATION_FAILED",code:30,retriable:!1,message:"Not authorized to access group: Group authorization failed"},{type:"CLUSTER_AUTHORIZATION_FAILED",code:31,retriable:!1,message:"Cluster authorization failed"},{type:"INVALID_TIMESTAMP",code:32,retriable:!1,message:"The timestamp of the message is out of acceptable range"},{type:"UNSUPPORTED_SASL_MECHANISM",code:33,retriable:!1,message:"The broker does not support the requested SASL mechanism"},{type:"ILLEGAL_SASL_STATE",code:34,retriable:!1,message:"Request is not valid given the current SASL state"},{type:"UNSUPPORTED_VERSION",code:35,retriable:!1,message:"The version of API is not supported"},{type:"TOPIC_ALREADY_EXISTS",code:36,retriable:!1,message:"Topic with this name already exists"},{type:"INVALID_PARTITIONS",code:37,retriable:!1,message:"Number of partitions is invalid"},{type:"INVALID_REPLICATION_FACTOR",code:38,retriable:!1,message:"Replication-factor is invalid"},{type:"INVALID_REPLICA_ASSIGNMENT",code:39,retriable:!1,message:"Replica assignment is invalid"},{type:"INVALID_CONFIG",code:40,retriable:!1,message:"Configuration is invalid"},{type:"NOT_CONTROLLER",code:41,retriable:!0,message:"This is not the correct controller for this cluster"},{type:"INVALID_REQUEST",code:42,retriable:!1,message:"This most likely occurs because of a request being malformed by the client library or the message was sen't to an incompatible broker. See the broker logs for more details"},{type:"UNSUPPORTED_FOR_MESSAGE_FORMAT",code:43,retriable:!1,message:"The message format version on the broker does not support the request"},{type:"POLICY_VIOLATION",code:44,retriable:!1,message:"Request parameters do not satisfy the configured policy"},{type:"OUT_OF_ORDER_SEQUENCE_NUMBER",code:45,retriable:!1,message:"The broker received an out of order sequence number"},{type:"DUPLICATE_SEQUENCE_NUMBER",code:46,retriable:!1,message:"The broker received a duplicate sequence number"},{type:"INVALID_PRODUCER_EPOCH",code:47,retriable:!1,message:"Producer attempted an operation with an old epoch. Either there is a newer producer with the same transactionalId, or the producer's transaction has been expired by the broker"},{type:"INVALID_TXN_STATE",code:48,retriable:!1,message:"The producer attempted a transactional operation in an invalid state"},{type:"INVALID_PRODUCER_ID_MAPPING",code:49,retriable:!1,message:"The producer attempted to use a producer id which is not currently assigned to its transactional id"},{type:"INVALID_TRANSACTION_TIMEOUT",code:50,retriable:!1,message:"The transaction timeout is larger than the maximum value allowed by the broker (as configured by max.transaction.timeout.ms)"},{type:"CONCURRENT_TRANSACTIONS",code:51,retriable:!0,message:"The producer attempted to update a transaction while another concurrent operation on the same transaction was ongoing"},{type:"TRANSACTION_COORDINATOR_FENCED",code:52,retriable:!1,message:"Indicates that the transaction coordinator sending a WriteTxnMarker is no longer the current coordinator for a given producer"},{type:"TRANSACTIONAL_ID_AUTHORIZATION_FAILED",code:53,retriable:!1,message:"Transactional Id authorization failed"},{type:"SECURITY_DISABLED",code:54,retriable:!1,message:"Security features are disabled"},{type:"OPERATION_NOT_ATTEMPTED",code:55,retriable:!1,message:"The broker did not attempt to execute this operation. This may happen for batched RPCs where some operations in the batch failed, causing the broker to respond without trying the rest"},{type:"KAFKA_STORAGE_ERROR",code:56,retriable:!0,message:"Disk error when trying to access log file on the disk"},{type:"LOG_DIR_NOT_FOUND",code:57,retriable:!1,message:"The user-specified log directory is not found in the broker config"},{type:"SASL_AUTHENTICATION_FAILED",code:58,retriable:!1,message:"SASL Authentication failed",helpUrl:us("docs/configuration","sasl")},{type:"UNKNOWN_PRODUCER_ID",code:59,retriable:!1,message:"This exception is raised by the broker if it could not locate the producer metadata associated with the producerId in question. This could happen if, for instance, the producer's records were deleted because their retention time had elapsed. Once the last records of the producerId are removed, the producer's metadata is removed from the broker, and future appends by the producer will return this exception"},{type:"REASSIGNMENT_IN_PROGRESS",code:60,retriable:!1,message:"A partition reassignment is in progress"},{type:"DELEGATION_TOKEN_AUTH_DISABLED",code:61,retriable:!1,message:"Delegation Token feature is not enabled"},{type:"DELEGATION_TOKEN_NOT_FOUND",code:62,retriable:!1,message:"Delegation Token is not found on server"},{type:"DELEGATION_TOKEN_OWNER_MISMATCH",code:63,retriable:!1,message:"Specified Principal is not valid Owner/Renewer"},{type:"DELEGATION_TOKEN_REQUEST_NOT_ALLOWED",code:64,retriable:!1,message:"Delegation Token requests are not allowed on PLAINTEXT/1-way SSL channels and on delegation token authenticated channels"},{type:"DELEGATION_TOKEN_AUTHORIZATION_FAILED",code:65,retriable:!1,message:"Delegation Token authorization failed"},{type:"DELEGATION_TOKEN_EXPIRED",code:66,retriable:!1,message:"Delegation Token is expired"},{type:"INVALID_PRINCIPAL_TYPE",code:67,retriable:!1,message:"Supplied principalType is not supported"},{type:"NON_EMPTY_GROUP",code:68,retriable:!1,message:"The group is not empty"},{type:"GROUP_ID_NOT_FOUND",code:69,retriable:!1,message:"The group id was not found"},{type:"FETCH_SESSION_ID_NOT_FOUND",code:70,retriable:!0,message:"The fetch session ID was not found"},{type:"INVALID_FETCH_SESSION_EPOCH",code:71,retriable:!0,message:"The fetch session epoch is invalid"},{type:"LISTENER_NOT_FOUND",code:72,retriable:!0,message:"There is no listener on the leader broker that matches the listener on which metadata request was processed"},{type:"TOPIC_DELETION_DISABLED",code:73,retriable:!1,message:"Topic deletion is disabled"},{type:"FENCED_LEADER_EPOCH",code:74,retriable:!0,message:"The leader epoch in the request is older than the epoch on the broker"},{type:"UNKNOWN_LEADER_EPOCH",code:75,retriable:!0,message:"The leader epoch in the request is newer than the epoch on the broker"},{type:"UNSUPPORTED_COMPRESSION_TYPE",code:76,retriable:!1,message:"The requesting client does not support the compression type of given partition"},{type:"STALE_BROKER_EPOCH",code:77,retriable:!1,message:"Broker epoch has changed"},{type:"OFFSET_NOT_AVAILABLE",code:78,retriable:!0,message:"The leader high watermark has not caught up from a recent leader election so the offsets cannot be guaranteed to be monotonically increasing"},{type:"MEMBER_ID_REQUIRED",code:79,retriable:!1,message:"The group member needs to have a valid member id before actually entering a consumer group"},{type:"PREFERRED_LEADER_NOT_AVAILABLE",code:80,retriable:!0,message:"The preferred leader was not available"},{type:"GROUP_MAX_SIZE_REACHED",code:81,retriable:!1,message:"The consumer group has reached its max size. It already has the configured maximum number of members"}];aP=function(e){return{type:"KAFKAJS_UNKNOWN_ERROR_CODE",code:-99,retriable:!1,message:"Unknown error code ".concat(e)}};bP=0;ws=35;**=function(e){return e!==bP};xs=function(e){return new _O(vs.find(function(r){return r.code===e})||aP(e))};dP=function(e){if(e===ws)throw xs(ws)};t={failure:**,errorCodes:vs,createErrorFromCode:xs,failIfVersionNotSupported:dP}}var Ba,fP=false;function Ca(){if(fP)return;fP=true;Ba={};Ba=function(r){return[].concat.apply([],r)}}var Rk,gP,ys,hP,iP,jP,kP,lP,mP,nP=false;function zs(r,e,t,n,a,$,o){try{var **r[$](o),u=i.value}catch(c){return void t(c)}i.done?e(u):Promise.resolve(u).then(n,a)}function As(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var $=r.apply(e,t);function o(r){zs($,n,a,o,i,"next",r)}function i(r){zs($,n,a,o,i,"throw",r)}o(void 0)})}}function Sk(){if(nP)return;nP=true;Rk={};gP=(d(),c);ys=(u(),t);hP=ys.failure;iP=ys.createErrorFromCode;jP=(Ca(),Ba);kP=function(r){return{partition:r.readInt32(),errorCode:r.readInt16(),offset:r.readInt64().toString()}};lP=function(){var r=As(regeneratorRuntime.mark(function r(e){var t,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=new gP(e),n=t.readArray(function(r){return{topicName:r.readString(),partitions:r.readArray(kP)}}),r.abrupt("return",{topics:n});case 3:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();mP=function(){var r=As(regeneratorRuntime.mark(function r(e){var t,n,a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(t=e.topics.map(function(r){return r.partitions.filter(function(r){return hP(r.errorCode)})}),!((n=jP(t)).length>0)){r.next=5;break}throw a=n[0].errorCode,iP(a);case 5:return r.abrupt("return",e);case 6:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Rk={decode:lP,parse:mP}}var oP,pP,qP=false;function rP(){if(qP)return;qP=true;oP={};pP=(js(),hs);oP=function(e){var t=e.acks,r=e.timeout,a=e.topicData;return Object.assign(pP({acks:t,timeout:r,topicData:a}),{apiVersion:1})}}var sP,tP,uP,vP,wP,xP,yP=false;function Bs(r,e,t,n,a,$,c){try{var o=r[$](c),**o.value}catch(u){return void t(u)}o.done?e(i):Promise.resolve(i).then(n,a)}function zP(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var $=r.apply(e,t);function c(r){Bs($,n,a,c,o,"next",r)}function o(r){Bs($,n,a,c,o,"throw",r)}c(void 0)})}}function AP(){if(yP)return;yP=true;sP={};tP=(d(),c);uP=(Sk(),Rk);vP=uP.parse;wP=function(r){return{partition:r.readInt32(),errorCode:r.readInt16(),offset:r.readInt64().toString()}};xP=function(){var r=zP(regeneratorRuntime.mark(function r(e){var t,n,a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=new tP(e),n=t.readArray(function(r){return{topicName:r.readString(),partitions:r.readArray(wP)}}),a=t.readInt32(),r.abrupt("return",{topics:n,throttleTime:a});case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();sP={decode:xP,parse:vP}}var BP,Mh,**,DP,Cs,Ds,Es,EP,FP,GP,HP=false;function Fs(r){if("undefined"==typeof Symbol||null==r[Symbol.iterator]){if(Array.isArray(r)||(r=IP(r))){var e=0,a=function(){};return{s:a,n:function(){return e>=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(r){throw r},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var t,n,o=!0,i=!1;return{s:function(){t=r[Symbol.iterator]()},n:function(){var r=t.next();return o=r.done,r},e:function(r){i=!0,n=r},f:function(){try{o||null==t.return||t.return()}finally{if(i)throw n}}}}function IP(r,e){if(r){if("string"==typeof r)return Gs(r,e);var a=Object.prototype.toString.call(r).slice(8,-1);return"Object"===a&&r.constructor&&(a=r.constructor.name),"Map"===a||"Set"===a?Array.from(a):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Gs(r,e):void 0}}function Gs(r,e){(null==e||e>r.length)&&(e=r.length);for(var a=0,t=new Array(e);a=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(r){throw r},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,n,$=!0,o=!1;return{s:function(){a=r[Symbol.iterator]()},n:function(){var r=a.next();return $=r.done,r},e:function(r){o=!0,n=r},f:function(){try{$||null==a.return||a.return()}finally{if(o)throw n}}}}function aQ(r,e){if(r){if("string"==typeof r)return Ks(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Ks(r,e):void 0}}function Ks(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,a=new Array(e);t>>8;return(-1^$)>>>0};cQ=dQ;eQ=new Int32Array([0,4067132163,3778769143,324072436,3348797215,904991772,648144872,3570033899,2329499855,2024987596,1809983544,2575936315,1296289744,3207089363,2893594407,1578318884,274646895,3795141740,4049975192,51262619,3619967088,632279923,922689671,3298075524,2592579488,1760304291,2075979607,2312596564,1562183871,2943781820,3156637768,1313733451,549293790,3537243613,3246849577,871202090,3878099393,357341890,102525238,4101499445,2858735121,1477399826,1264559846,3107202533,1845379342,2677391885,2361733625,2125378298,820201905,3263744690,3520608582,598981189,4151959214,85089709,373468761,3827903834,3124367742,1213305469,1526817161,2842354314,2107672161,2412447074,2627466902,1861252501,1098587580,3004210879,2688576843,1378610760,2262928035,1955203488,1742404180,2511436119,3416409459,969524848,714683780,3639785095,205050476,4266873199,3976438427,526918040,1361435347,2739821008,2954799652,1114974503,2529119692,1691668175,2005155131,2247081528,3690758684,697762079,986182379,3366744552,476452099,3993867776,4250756596,255256311,1640403810,2477592673,2164122517,1922457750,2791048317,1412925310,1197962378,3037525897,3944729517,427051182,170179418,4165941337,746937522,3740196785,3451792453,1070968646,1905808397,2213795598,2426610938,1657317369,3053634322,1147748369,1463399397,2773627110,4215344322,153784257,444234805,3893493558,1021025245,3467647198,3722505002,797665321,2197175160,1889384571,1674398607,2443626636,1164749927,3070701412,2757221520,1446797203,137323447,4198817972,3910406976,461344835,3484808360,1037989803,781091935,3705997148,2460548119,1623424788,1939049696,2180517859,1429367560,2807687179,3020495871,1180866812,410100952,3927582683,4182430767,186734380,3756733383,763408580,1053836080,3434856499,2722870694,1344288421,1131464017,2971354706,1708204729,2545590714,2229949006,1988219213,680717673,3673779818,3383336350,1002577565,4010310262,493091189,238226049,4233660802,2987750089,1082061258,1395524158,2705686845,1972364758,2279892693,2494862625,1725896226,952904198,3399985413,3656866545,731699698,4283874585,222117402,510512622,3959836397,3280807620,837199303,582374963,3504198960,68661723,4135334616,3844915500,390545967,1230274059,3141532936,2825850620,1510247935,2395924756,2091215383,1878366691,2644384480,3553878443,565732008,854102364,3229815391,340358836,3861050807,4117890627,119113024,1493875044,2875275879,3090270611,1247431312,2660249211,1828433272,2141937292,2378227087,3811616794,291187481,34330861,4032846830,615137029,3603020806,3314634738,939183345,1776939221,2609017814,2295496738,2058945313,2926798794,1545135305,1330124605,3173225534,4084100981,17165430,307568514,3762199681,888469610,3332340585,3587147933,665062302,2042050490,2346497209,2559330125,1793573966,3190661285,1279665062,1595330642,2910671697])}var hQ,iQ,jQ,kQ=false;function lQ(){if(kQ)return;kQ=true;hQ={};iQ=(gQ(),cQ);jQ=function(r){return Uint32Array.from([r])[0]};hQ=function(r){return jQ(iQ(r))}}var Ls,Ms,Nh,mQ,Ns,Os,nQ,Ps,oQ,pQ,qQ,rQ,sQ,tQ=false;function Uk(r){return(Uk="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(r){return typeof r}:function(r){return r&&"function"==typeof Symbol&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r})(r)}function Qs(r,e,t,$,n,o,v){try{var a=r[o](v),**a.value}catch(c){return void t(c)}a.done?e(i):Promise.resolve(i).then($,n)}function Rs(r){return function(){var e=this,t=arguments;return new Promise(function($,n){var o=r.apply(e,t);function v(r){Qs(o,$,n,v,a,"next",r)}function a(r){Qs(o,$,n,v,a,"throw",r)}v(void 0)})}}function Ss(){if(tQ)return;tQ=true;Ls={};Ms=(Ia(),Fa);Nh=(h(),g);mQ=(lQ(),hQ);Ns=(Rb(),Qb);Os=Ns.Types;nQ=Ns.lookupCodec;Ps=2;oQ=3;pQ=0;qQ=16;rQ=function(){var r=Rs(regeneratorRuntime.mark(function r(e){var t,$,n,o,v,a,i,c,u,s,N,p,f,F,d,y,m,w,l,I,S,A,_,T,C,E;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(t=e.compression,$=void 0===t?Os.None:t,n=e.firstOffset,o=void 0===n?Ms.fromInt(0):n,v=e.firstTimestamp,a=void 0===v?Date.now():v,**e.maxTimestamp,c=void 0===i?Date.now():i,u=e.partitionLeaderEpoch,s=void 0===u?0:u,N=e.lastOffsetDelta,p=void 0===N?0:N,f=e.transactional,F=void 0!==f&&f,d=e.producerId,y=void 0===d?Ms.fromValue(-1):d,m=e.producerEpoch,w=void 0===m?0:m,l=e.firstSequence,**void 0===l?0:l,S=e.records,A=void 0===S?[]:S,_=$&oQ|pQ|(F?qQ:0),T=new Nh().writeInt16(_).writeInt32(p).writeInt64(a).writeInt64(c).writeInt64(y).writeInt16(w).writeInt32(I),$!==Os.None){r.next=9;break}A.every(function(r){return Uk(r)===Uk(A[0])})?T.writeArray(A,Uk(A[0])):T.writeArray(A),r.next=13;break;case 9:return r.next=11,sQ($,A);case 11:C=r.sent,T.writeInt32(A.length).writeBuffer(C);case 13:return E=new Nh().writeInt32(s).writeInt8(Ps).writeUInt32(mQ(T.buffer)).writeEncoder(T),r.abrupt("return",new Nh().writeInt64(o).writeBytes(E.buffer));case 15:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();sQ=function(){var r=Rs(regeneratorRuntime.mark(function r(e,t){var $,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return $=nQ(e),(n=new Nh).writeEncoderArray(t),r.abrupt("return",$.compress(n));case 4:case"end":return r.stop();}},r)}));return function(e,t){return r.apply(this,arguments)}}();Ls={RecordBatch:rQ,MAGIC_BYTE:Ps}}var Vk,uQ,Wk,vQ,wQ,xQ,yQ,zQ,AQ,BQ,CQ,DQ,EQ=false;function **(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),t.push.apply(t,n)}return t}function Xk(r){for(var e=1;e=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(r){throw r},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a,o=!0,c=!1;return{s:function(){n=r[Symbol.iterator]()},n:function(){var r=n.next();return o=r.done,r},e:function(r){c=!0,a=r},f:function(){try{o||null==n.return||n.return()}finally{if(c)throw a}}}}function GQ(r,e){if(r){if("string"==typeof r)return Vs(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?Vs(r,e):void 0}}function Vs(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t0)){r.next=5;break}throw a=n[0].errorCode,JQ(a);case 5:return r.abrupt("return",e);case 6:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();$k={decode:MQ,parse:NQ}}var PQ,QQ,RQ=false;function SQ(){if(RQ)return;RQ=true;PQ={};QQ=(Zk(),Vk);PQ=function(r){var e=r.acks,o=r.timeout,t=r.transactionalId,a=r.producerId,c=r.producerEpoch,s=r.compression,p=r.topicData;return Object.assign(QQ({acks:e,timeout:o,transactionalId:t,producerId:a,producerEpoch:c,compression:s,topicData:p}),{apiVersion:4})}}var TQ,$s,UQ,VQ,WQ=false;function XQ(){if(WQ)return;WQ=true;TQ={};$s=(_k(),$k);UQ=$s.decode;VQ=$s.parse;TQ={decode:UQ,parse:VQ}}var YQ,ZQ,$Q=false;function _Q(){if($Q)return;$Q=true;YQ={};ZQ=(Zk(),Vk);YQ=function(r){var e=r.acks,o=r.timeout,t=r.transactionalId,a=r.producerId,c=r.producerEpoch,s=r.compression,p=r.topicData;return Object.assign(ZQ({acks:e,timeout:o,transactionalId:t,producerId:a,producerEpoch:c,compression:s,topicData:p}),{apiVersion:5})}}var aR,bR,cR,dR,eR,fR,gR=false;function _s(r,e,t,n,a,o,$){try{var **r[o]($),f=i.value}catch(c){return void t(c)}i.done?e(f):Promise.resolve(f).then(n,a)}function hR(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var o=r.apply(e,t);function $(r){_s(o,n,a,$,i,"next",r)}function i(r){_s(o,n,a,$,i,"throw",r)}$(void 0)})}}function iR(){if(gR)return;gR=true;aR={};bR=(d(),c);cR=(_k(),$k);dR=cR.parse;eR=function(r){return{partition:r.readInt32(),errorCode:r.readInt16(),baseOffset:r.readInt64().toString(),logAppendTime:r.readInt64().toString(),logStartOffset:r.readInt64().toString()}};fR=function(){var r=hR(regeneratorRuntime.mark(function r(e){var t,n,a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=new bR(e),n=t.readArray(function(r){return{topicName:r.readString(),partitions:r.readArray(eR)}}),a=t.readInt32(),r.abrupt("return",{topics:n,throttleTime:a});case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();aR={decode:fR,parse:dR}}var jR={},at={0:function(e){var r=e.acks,o=e.timeout,t=e.topicData,s=(js(),hs),a=(Sk(),Rk);return{request:s({acks:r,timeout:o,topicData:t}),response:a}},1:function(e){var r=e.acks,o=e.timeout,t=e.topicData,s=(rP(),oP),a=(AP(),sP);return{request:s({acks:r,timeout:o,topicData:t}),response:a}},2:function(e){var r=e.acks,o=e.timeout,t=e.topicData,s=e.compression,a=(JP(),BP),c=(SP(),KP);return{request:a({acks:r,timeout:o,compression:s,topicData:t}),response:c}},3:function(e){var r=e.acks,o=e.timeout,t=e.compression,s=e.topicData,a=e.transactionalId,c=e.producerId,p=e.producerEpoch,i=(Zk(),Vk),u=(_k(),$k);return{request:i({acks:r,timeout:o,compression:t,topicData:s,transactionalId:a,producerId:c,producerEpoch:p}),response:u}},4:function(e){var r=e.acks,o=e.timeout,t=e.compression,s=e.topicData,a=e.transactionalId,c=e.producerId,p=e.producerEpoch,i=(SQ(),PQ),u=(XQ(),TQ);return{request:i({acks:r,timeout:o,compression:t,topicData:s,transactionalId:a,producerId:c,producerEpoch:p}),response:u}},5:function(e){var r=e.acks,o=e.timeout,t=e.compression,s=e.topicData,a=e.transactionalId,c=e.producerId,p=e.producerEpoch,i=(_Q(),YQ),u=(iR(),aR);return{request:i({acks:r,timeout:o,compression:t,topicData:s,transactionalId:a,producerId:c,producerEpoch:p}),response:u}}};jR={versions:Object.keys(at),protocol:function(e){var r=e.version;return at[r]}};var Oc,kR=false;function Pc(){if(kR)return;kR=true;Oc={};Oc={READ_UNCOMMITTED:0,READ_COMMITTED:1}}var al,bl,lR,mR,nR,oR,pR=false;function bt(r,e,n,t,a,c,i){try{var $=r[c](i),o=$.value}catch(u){return void n(u)}$.done?e(o):Promise.resolve(o).then(t,a)}function qR(r){return function(){var e=this,n=arguments;return new Promise(function(t,a){var c=r.apply(e,n);function i(r){bt(c,t,a,i,$,"next",r)}function $(r){bt(c,t,a,i,$,"throw",r)}i(void 0)})}}function cl(){if(pR)return;pR=true;al={};bl=(h(),g);lR=(k(),j);mR=lR.Fetch;al=function(r){var e=r.replicaId,n=r.maxWaitTime,t=r.minBytes,a=r.topics;return{apiKey:mR,apiVersion:0,apiName:"Fetch",encode:function(){var r=qR(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new bl().writeInt32(e).writeInt32(n).writeInt32(t).writeArray(a.map(nR)));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};nR=function(r){var e=r.topic,n=r.partitions;return new bl().writeString(e).writeArray(n.map(oR))};oR=function(r){var e=r.partition,n=r.fetchOffset,t=r.maxBytes;return new bl().writeInt32(e).writeInt64(n).writeInt32(t)}}var rR,sR=false;function tR(){if(sR)return;sR=true;rR={};rR=function(e){return{attributes:e.readInt8(),key:e.readBytes(),value:e.readBytes()}}}var uR,vR=false;function wR(){if(vR)return;vR=true;uR={};uR=function(t){return{attributes:t.readInt8(),timestamp:t.readInt64().toString(),key:t.readBytes(),value:t.readBytes()}}}var xR,yR,ct,zR,AR,BR,CR,DR,ER=false;function FR(){if(ER)return;ER=true;xR={};yR=(z(),r).Buffer;ct=(y(),x);zR=ct.KafkaJSPartialMessageError;AR=ct.KafkaJSUnsupportedMagicByteInMessageSet;BR=(tR(),rR);CR=(wR(),uR);DR=function(e,r){switch(r){case 0:return BR(e);case 1:return CR(e);default:throw new AR("Unsupported MessageSet message version, magic byte: ".concat(r));}};xR=function(e,r,a){var s=yR.byteLength(a.slice(r).buffer);if(s=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(r){throw r},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var t,n,o=!0,$=!1;return{s:function(){t=r[Symbol.iterator]()},n:function(){var r=t.next();return o=r.done,r},e:function(r){$=!0,n=r},f:function(){try{o||null==t.return||t.return()}finally{if($)throw n}}}}function OR(r){return RR(r)||QR(r)||ft(r)||PR()}function PR(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function ft(r,e){if(r){if("string"==typeof r)return fl(r,e);var a=Object.prototype.toString.call(r).slice(8,-1);return"Object"===a&&r.constructor&&(a=r.constructor.name),"Map"===a||"Set"===a?Array.from(a):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?fl(r,e):void 0}}function QR(r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r))return Array.from(r)}function RR(r){if(Array.isArray(r))return fl(r)}function fl(r,e){(null==e||e>r.length)&&(e=r.length);for(var a=0,t=new Array(e);a1&&void 0!==u[1]?u[1]:null,t=[],n=a||e.readInt32(),o=e.slice(n);case 4:if(!(o.offset0&&e.offset>=0){var t,n=el.fromValue(e.offset)-el.fromValue(a[a.length-1].offset),o=NR(a);try{for(o.s();!(t=o.n()).done;){var $=t.value;$.offset=el.fromValue($.offset).add(n).toString()}}catch(l){o.e(l)}finally{o.f()}}return a};et=function(r){if(!r.canReadInt64())throw new dt("Tried to decode a partial message: There isn't enough bytes to read the offset");var e=r.readInt64().toString();if(!r.canReadInt32())throw new dt("Tried to decode a partial message: There isn't enough bytes to read the message size");var a=r.readInt32();return HR(e,a,r)}}var ht,TR,UR,VR,hl,WR,it,XR,YR,ZR,$R,_R,aS,bS,cS,dS,eS=false;function jt(r,e,t,n,a,u,$){try{var o=r[u]($),f=o.value}catch(i){return void t(i)}o.done?e(f):Promise.resolve(f).then(n,a)}function Oh(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var u=r.apply(e,t);function $(r){jt(u,n,a,$,o,"next",r)}function o(r){jt(u,n,a,$,o,"throw",r)}$(void 0)})}}function kt(){if(eS)return;eS=true;ht={};TR=(d(),c);UR=(y(),x);VR=UR.KafkaJSOffsetOutOfRange;hl=(u(),t);WR=hl.failure;it=hl.createErrorFromCode;XR=hl.errorCodes;YR=(Ca(),Ba);ZR=(gl(),dl);$R=function(){var r=Oh(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=e.readInt32(),r.t1=e.readInt16(),r.t2=e.readInt64().toString(),r.next=5,ZR(e);case 5:return r.t3=r.sent,r.abrupt("return",{partition:r.t0,errorCode:r.t1,highWatermark:r.t2,messages:r.t3});case 7:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();_R=function(){var r=Oh(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=e.readString(),r.next=3,e.readArrayAsync($R);case 3:return r.t1=r.sent,r.abrupt("return",{topicName:r.t0,partitions:r.t1});case 5:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();aS=function(){var r=Oh(regeneratorRuntime.mark(function r(e){var t,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=new TR(e),r.next=3,t.readArrayAsync(_R);case 3:return n=r.sent,r.abrupt("return",{responses:n});case 5:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();bS=XR.find(function(r){return"OFFSET_OUT_OF_RANGE"===r.type});cS=bS.code;dS=function(){var r=Oh(regeneratorRuntime.mark(function r(e){var t,n,a,u,$,o;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(t=e.responses.map(function(r){var e=r.topicName;return r.partitions.filter(function(r){return WR(r.errorCode)}).map(function(r){return Object.assign({},r,{topic:e})})}),!((n=YR(t)).length>0)){r.next=7;break}if(a=n[0],u=a.errorCode,$=a.topic,o=a.partition,u!==cS){r.next=6;break}throw new VR(it(u),{topic:$,partition:o});case 6:throw it(u);case 7:return r.abrupt("return",e);case 8:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();ht={decode:aS,parse:dS}}var fS,gS,hS=false;function iS(){if(hS)return;hS=true;fS={};gS=(cl(),al);fS=function(e){var n=e.replicaId,r=e.maxWaitTime,**e.minBytes,t=e.topics;return Object.assign(gS({replicaId:n,maxWaitTime:r,minBytes:i,topics:t}),{apiVersion:1})}}var xe,jS,kS,lS,mS,nS,oS,pS,qS=false;function lt(r,e,t,n,a,o,$){try{var s=r[o]($),c=s.value}catch(u){return void t(u)}s.done?e(c):Promise.resolve(c).then(n,a)}function il(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var o=r.apply(e,t);function $(r){lt(o,n,a,$,s,"next",r)}function s(r){lt(o,n,a,$,s,"throw",r)}$(void 0)})}}function ye(){if(qS)return;qS=true;xe={};jS=(d(),c);kS=(kt(),ht);lS=kS.parse;mS=(gl(),dl);nS=function(){var r=il(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=e.readInt32(),r.t1=e.readInt16(),r.t2=e.readInt64().toString(),r.next=5,mS(e);case 5:return r.t3=r.sent,r.abrupt("return",{partition:r.t0,errorCode:r.t1,highWatermark:r.t2,messages:r.t3});case 7:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();oS=function(){var r=il(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=e.readString(),r.next=3,e.readArrayAsync(nS);case 3:return r.t1=r.sent,r.abrupt("return",{topicName:r.t0,partitions:r.t1});case 5:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();pS=function(){var r=il(regeneratorRuntime.mark(function r(e){var t,n,a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=new jS(e),n=t.readInt32(),r.next=4,t.readArrayAsync(oS);case 4:return a=r.sent,r.abrupt("return",{throttleTime:n,responses:a});case 6:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();xe={decode:pS,parse:lS}}var rS,sS,**=false;function uS(){if(**)return;**=true;rS={};sS=(cl(),al);rS=function(e){var r=e.replicaId,**e.maxWaitTime,t=e.minBytes,a=e.topics;return Object.assign(sS({replicaId:r,maxWaitTime:i,minBytes:t,topics:a}),{apiVersion:2})}}var vS,mt,wS,xS,yS=false;function zS(){if(yS)return;yS=true;vS={};mt=(ye(),xe);wS=mt.decode;xS=mt.parse;vS={decode:wS,parse:xS}}var AS,jl,BS,CS,DS,ES,FS=false;function nt(r,e,t,n,a,i,$){try{var o=r[i]($),p=o.value}catch(c){return void t(c)}o.done?e(p):Promise.resolve(p).then(n,a)}function GS(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var **r.apply(e,t);function $(r){nt(i,n,a,$,o,"next",r)}function o(r){nt(i,n,a,$,o,"throw",r)}$(void 0)})}}function HS(){if(FS)return;FS=true;AS={};jl=(h(),g);BS=(k(),j);CS=BS.Fetch;AS=function(r){var e=r.replicaId,t=r.maxWaitTime,n=r.minBytes,a=r.maxBytes,**r.topics;return{apiKey:CS,apiVersion:3,apiName:"Fetch",encode:function(){var r=GS(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new jl().writeInt32(e).writeInt32(t).writeInt32(n).writeInt32(a).writeArray(i.map(DS)));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};DS=function(r){var e=r.topic,t=r.partitions;return new jl().writeString(e).writeArray(t.map(ES))};ES=function(r){var e=r.partition,t=r.fetchOffset,n=r.maxBytes;return new jl().writeInt32(e).writeInt64(t).writeInt32(n)}}var IS,ot,JS,KS,LS=false;function MS(){if(LS)return;LS=true;IS={};ot=(ye(),xe);JS=ot.decode;KS=ot.parse;IS={decode:JS,parse:KS}}var NS,kl,OS,PS,QS,RS,SS,**=false;function pt(r,e,i,t,n,a,$){try{var o=r[a]($),c=o.value}catch(m){return void i(m)}o.done?e(c):Promise.resolve(c).then(t,n)}function US(r){return function(){var e=this,**arguments;return new Promise(function(t,n){var a=r.apply(e,i);function $(r){pt(a,t,n,$,o,"next",r)}function o(r){pt(a,t,n,$,o,"throw",r)}$(void 0)})}}function VS(){if(**)return;**=true;NS={};kl=(h(),g);OS=(k(),j);PS=OS.Fetch;QS=(Pc(),Oc);NS=function(r){var e=r.replicaId,**r.maxWaitTime,t=r.minBytes,n=r.maxBytes,a=r.topics,$=r.isolationLevel,o=void 0===$?QS.READ_COMMITTED:$;return{apiKey:PS,apiVersion:4,apiName:"Fetch",encode:function(){var r=US(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new kl().writeInt32(e).writeInt32(i).writeInt32(t).writeInt32(n).writeInt8(o).writeArray(a.map(RS)));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};RS=function(r){var e=r.topic,**r.partitions;return new kl().writeString(e).writeArray(i.map(SS))};SS=function(r){var e=r.partition,**r.fetchOffset,t=r.maxBytes;return new kl().writeInt32(e).writeInt64(i).writeInt32(t)}}var WS,XS=false;function YS(){if(XS)return;XS=true;WS={};WS=function(r){return{key:r.readVarIntString(),value:r.readVarIntBytes()}}}var ZS,qt,$S,_S=false;function rt(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,o)}return t}function aT(e){for(var r=1;r1&&void 0!==arguments[1]?arguments[1]:{},t=r.firstOffset,o=r.firstTimestamp,a=r.magicByte,n=r.isControlBatch,$=void 0!==n&&n,c=e.readInt8(),**e.readVarLong(),d=qt.fromValue(o).add(i).toString(),f=e.readVarInt();return{magicByte:a,attributes:c,timestamp:d,offset:qt.fromValue(t).add(f).toString(),key:e.readVarIntBytes(),value:e.readVarIntBytes(),headers:e.readVarIntArray($S).reduce(function(e,r){return aT({},e,st({},r.key,r.value))},{}),isControlRecord:$,batchContext:r}}}var cT,dT,tt,eT,fT,gT,hT,iT,jT,kT,lT,ut,mT=false;function vt(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),t.push.apply(t,o)}return t}function wt(r){for(var e=1;e0,G=(f&kT)>0,b=hT(f),l={firstOffset:t,firstTimestamp:u,partitionLeaderEpoch:$,inTransaction:v,isControlBatch:G,lastOffsetDelta:i,producerId:d,producerEpoch:O,firstSequence:p,maxTimestamp:s},r.next=23,lT(b,a,wt({},l,{magicByte:c}));case 23:return y=r.sent,r.abrupt("return",wt({},l,{records:y}));case 25:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();lT=function(){var r=yt(regeneratorRuntime.mark(function r(e,t,o){var a,n,$,c,f,i;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(e){r.next=2;break}return r.abrupt("return",t.readArray(function(r){return ut(r,o)}));case 2:if(!((a=t.readInt32())<=0)){r.next=5;break}return r.abrupt("return",[]);case 5:return n=t.readAll(),r.next=8,e.decompress(n);case 8:for($=r.sent,c=new tt($),f=[],**0;ir.length)&&(e=r.length);for(var a=0,t=new Array(e);a0)){r.next=4;break}throw a=t[0].topicErrorCode,bu(a);case 4:if(n=e.topicMetadata.map(function(r){return r.partitionMetadata.filter(function(r){return au(r.partitionErrorCode)})}),!((o=UV(n)).length>0)){r.next=9;break}throw $=o[0].partitionErrorCode,bu($);case 9:return r.abrupt("return",e);case 10:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Hf={decode:YV,parse:ZV}}var _V,aW,bW=false;function cW(){if(bW)return;bW=true;_V={};aW=(Sh(),Rh);_V=function(r){var e=r.topics;return Object.assign(aW({topics:e}),{apiVersion:1})}}var dW,eW,fW,gW,hW,iW,jW,kW,lW=false;function eu(r,e,a,t,n,o,$){try{var **r[o]($),d=i.value}catch(c){return void a(c)}i.done?e(d):Promise.resolve(d).then(t,n)}function mW(r){return function(){var e=this,a=arguments;return new Promise(function(t,n){var o=r.apply(e,a);function $(r){eu(o,t,n,$,i,"next",r)}function i(r){eu(o,t,n,$,i,"throw",r)}$(void 0)})}}function nW(){if(lW)return;lW=true;dW={};eW=(d(),c);fW=(If(),Hf);gW=fW.parse;hW=function(r){return{nodeId:r.readInt32(),host:r.readString(),port:r.readInt32(),rack:r.readString()}};iW=function(r){return{topicErrorCode:r.readInt16(),topic:r.readString(),isInternal:r.readBoolean(),partitionMetadata:r.readArray(jW)}};jW=function(r){return{partitionErrorCode:r.readInt16(),partitionId:r.readInt32(),leader:r.readInt32(),replicas:r.readArray(function(r){return r.readInt32()}),isr:r.readArray(function(r){return r.readInt32()})}};kW=function(){var r=mW(regeneratorRuntime.mark(function r(e){var a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=new eW(e),r.abrupt("return",{brokers:a.readArray(hW),controllerId:a.readInt32(),topicMetadata:a.readArray(iW)});case 2:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();dW={decode:kW,parse:gW}}var oW,pW,qW=false;function rW(){if(qW)return;qW=true;oW={};pW=(Sh(),Rh);oW=function(r){var e=r.topics;return Object.assign(pW({topics:e}),{apiVersion:2})}}var sW,tW,uW,vW,wW,xW,yW,zW,AW=false;function fu(r,e,a,t,n,o,$){try{var s=r[o]($),**s.value}catch(d){return void a(d)}s.done?e(i):Promise.resolve(i).then(t,n)}function BW(r){return function(){var e=this,a=arguments;return new Promise(function(t,n){var o=r.apply(e,a);function $(r){fu(o,t,n,$,s,"next",r)}function s(r){fu(o,t,n,$,s,"throw",r)}$(void 0)})}}function CW(){if(AW)return;AW=true;sW={};tW=(d(),c);uW=(If(),Hf);vW=uW.parse;wW=function(r){return{nodeId:r.readInt32(),host:r.readString(),port:r.readInt32(),rack:r.readString()}};xW=function(r){return{topicErrorCode:r.readInt16(),topic:r.readString(),isInternal:r.readBoolean(),partitionMetadata:r.readArray(yW)}};yW=function(r){return{partitionErrorCode:r.readInt16(),partitionId:r.readInt32(),leader:r.readInt32(),replicas:r.readArray(function(r){return r.readInt32()}),isr:r.readArray(function(r){return r.readInt32()})}};zW=function(){var r=BW(regeneratorRuntime.mark(function r(e){var a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=new tW(e),r.abrupt("return",{brokers:a.readArray(wW),clusterId:a.readString(),controllerId:a.readInt32(),topicMetadata:a.readArray(xW)});case 2:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();sW={decode:zW,parse:vW}}var DW,EW,FW=false;function GW(){if(FW)return;FW=true;DW={};EW=(Sh(),Rh);DW=function(r){var e=r.topics;return Object.assign(EW({topics:e}),{apiVersion:3})}}var gu,HW,IW,JW,KW,LW,MW,NW,OW=false;function hu(r,e,a,t,n,o,$){try{var **r[o]($),d=i.value}catch(Z){return void a(Z)}i.done?e(d):Promise.resolve(d).then(t,n)}function PW(r){return function(){var e=this,a=arguments;return new Promise(function(t,n){var o=r.apply(e,a);function $(r){hu(o,t,n,$,i,"next",r)}function i(r){hu(o,t,n,$,i,"throw",r)}$(void 0)})}}function iu(){if(OW)return;OW=true;gu={};HW=(d(),c);IW=(If(),Hf);JW=IW.parse;KW=function(r){return{nodeId:r.readInt32(),host:r.readString(),port:r.readInt32(),rack:r.readString()}};LW=function(r){return{topicErrorCode:r.readInt16(),topic:r.readString(),isInternal:r.readBoolean(),partitionMetadata:r.readArray(MW)}};MW=function(r){return{partitionErrorCode:r.readInt16(),partitionId:r.readInt32(),leader:r.readInt32(),replicas:r.readArray(function(r){return r.readInt32()}),isr:r.readArray(function(r){return r.readInt32()})}};NW=function(){var r=PW(regeneratorRuntime.mark(function r(e){var a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=new HW(e),r.abrupt("return",{throttleTime:a.readInt32(),brokers:a.readArray(KW),clusterId:a.readString(),controllerId:a.readInt32(),topicMetadata:a.readArray(LW)});case 2:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();gu={decode:NW,parse:JW}}var ju,QW,RW,SW,TW=false;function ku(r,e,a,n,t,o,$){try{var **r[o]($),u=i.value}catch(c){return void a(c)}i.done?e(u):Promise.resolve(u).then(n,t)}function UW(r){return function(){var e=this,a=arguments;return new Promise(function(n,t){var o=r.apply(e,a);function $(r){ku(o,n,t,$,i,"next",r)}function i(r){ku(o,n,t,$,i,"throw",r)}$(void 0)})}}function lu(){if(TW)return;TW=true;ju={};QW=(h(),g);RW=(k(),j);SW=RW.Metadata;ju=function(r){var e=r.topics,a=r.allowAutoTopicCreation,n=void 0===a||a;return{apiKey:SW,apiVersion:4,apiName:"Metadata",encode:function(){var r=UW(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new QW().writeNullableArray(e).writeBoolean(n));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}}}var VW,mu,WW,XW,YW=false;function ZW(){if(YW)return;YW=true;VW={};mu=(iu(),gu);WW=mu.parse;XW=mu.decode;VW={parse:WW,decode:XW}}var $W,_W,aX=false;function bX(){if(aX)return;aX=true;$W={};_W=(lu(),ju);$W=function(r){var e=r.topics,o=r.allowAutoTopicCreation,t=void 0===o||o;return Object.assign(_W({topics:e,allowAutoTopicCreation:t}),{apiVersion:5})}}var cX,dX,eX,fX,gX,hX,iX,jX,kX=false;function nu(r,e,a,t,n,o,$){try{var p=r[o]($),**p.value}catch(s){return void a(s)}p.done?e(i):Promise.resolve(i).then(t,n)}function lX(r){return function(){var e=this,a=arguments;return new Promise(function(t,n){var o=r.apply(e,a);function $(r){nu(o,t,n,$,p,"next",r)}function p(r){nu(o,t,n,$,p,"throw",r)}$(void 0)})}}function mX(){if(kX)return;kX=true;cX={};dX=(d(),c);eX=(If(),Hf);fX=eX.parse;gX=function(r){return{nodeId:r.readInt32(),host:r.readString(),port:r.readInt32(),rack:r.readString()}};hX=function(r){return{topicErrorCode:r.readInt16(),topic:r.readString(),isInternal:r.readBoolean(),partitionMetadata:r.readArray(iX)}};iX=function(r){return{partitionErrorCode:r.readInt16(),partitionId:r.readInt32(),leader:r.readInt32(),replicas:r.readArray(function(r){return r.readInt32()}),isr:r.readArray(function(r){return r.readInt32()}),offlineReplicas:r.readArray(function(r){return r.readInt32()})}};jX=function(){var r=lX(regeneratorRuntime.mark(function r(e){var a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=new dX(e),r.abrupt("return",{throttleTime:a.readInt32(),brokers:a.readArray(gX),clusterId:a.readString(),controllerId:a.readInt32(),topicMetadata:a.readArray(hX)});case 2:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();cX={decode:jX,parse:fX}}var nX={},ou={0:function(e){var r=e.topics,s=(Sh(),Rh),o=(If(),Hf);return{request:s({topics:r}),response:o}},1:function(e){var r=e.topics,s=(cW(),_V),o=(nW(),dW);return{request:s({topics:r}),response:o}},2:function(e){var r=e.topics,s=(rW(),oW),o=(CW(),sW);return{request:s({topics:r}),response:o}},3:function(e){var r=e.topics,s=(GW(),DW),o=(iu(),gu);return{request:s({topics:r}),response:o}},4:function(e){var r=e.topics,s=e.allowAutoTopicCreation,o=(lu(),ju),t=(ZW(),VW);return{request:o({topics:r,allowAutoTopicCreation:s}),response:t}},5:function(e){var r=e.topics,s=e.allowAutoTopicCreation,o=(bX(),$W),t=(mX(),cX);return{request:o({topics:r,allowAutoTopicCreation:s}),response:t}}};nX={versions:Object.keys(ou),protocol:function(e){var r=e.version;return ou[r]}};var oX,wl,pX,qX,rX,sX,tX=false;function pu(r,o,e,n,t,a,$){try{var **r[a]($),c=i.value}catch(d){return void e(d)}i.done?o(c):Promise.resolve(c).then(n,t)}function uX(r){return function(){var o=this,e=arguments;return new Promise(function(n,t){var a=r.apply(o,e);function $(r){pu(a,n,t,$,i,"next",r)}function i(r){pu(a,n,t,$,i,"throw",r)}$(void 0)})}}function vX(){if(tX)return;tX=true;oX={};wl=(h(),g);pX=(k(),j);qX=pX.OffsetCommit;oX=function(r){var o=r.groupId,e=r.topics;return{apiKey:qX,apiVersion:0,apiName:"OffsetCommit",encode:function(){var r=uX(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new wl().writeString(o).writeArray(e.map(rX)));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};rX=function(r){var o=r.topic,e=r.partitions;return new wl().writeString(o).writeArray(e.map(sX))};sX=function(r){var o=r.partition,e=r.offset,n=r.metadata,t=void 0===n?null:n;return new wl().writeInt32(o).writeInt64(e).writeString(t)}}var Th,wX,qu,xX,yX,zX,AX,BX,CX,DX,EX=false;function ru(r,e,n,t,a,$,o){try{var **r[$](o),u=i.value}catch(c){return void n(c)}i.done?e(u):Promise.resolve(u).then(t,a)}function su(r){return function(){var e=this,n=arguments;return new Promise(function(t,a){var $=r.apply(e,n);function o(r){ru($,t,a,o,i,"next",r)}function i(r){ru($,t,a,o,i,"throw",r)}o(void 0)})}}function Uh(){if(EX)return;EX=true;Th={};wX=(d(),c);qu=(u(),t);xX=qu.failure;yX=qu.createErrorFromCode;zX=(Ca(),Ba);AX=function(){var r=su(regeneratorRuntime.mark(function r(e){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n=new wX(e),r.abrupt("return",{responses:n.readArray(BX)});case 2:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();BX=function(r){return{topic:r.readString(),partitions:r.readArray(CX)}};CX=function(r){return{partition:r.readInt32(),errorCode:r.readInt16()}};DX=function(){var r=su(regeneratorRuntime.mark(function r(e){var n,t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(n=e.responses.map(function(r){return r.partitions.filter(function(r){return xX(r.errorCode)})}),!(t=zX(n)[0])){r.next=4;break}throw yX(t.errorCode);case 4:return r.abrupt("return",e);case 5:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Th={decode:AX,parse:DX}}var FX,xl,GX,HX,IX,JX,KX=false;function tu(r,e,t,n,a,i,o){try{var $=r[i](o),s=$.value}catch(c){return void t(c)}$.done?e(s):Promise.resolve(s).then(n,a)}function LX(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var **r.apply(e,t);function o(r){tu(i,n,a,o,$,"next",r)}function $(r){tu(i,n,a,o,$,"throw",r)}o(void 0)})}}function MX(){if(KX)return;KX=true;FX={};xl=(h(),g);GX=(k(),j);HX=GX.OffsetCommit;FX=function(r){var e=r.groupId,t=r.groupGenerationId,n=r.memberId,a=r.topics;return{apiKey:HX,apiVersion:1,apiName:"OffsetCommit",encode:function(){var r=LX(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new xl().writeString(e).writeInt32(t).writeString(n).writeArray(a.map(IX)));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};IX=function(r){var e=r.topic,t=r.partitions;return new xl().writeString(e).writeArray(t.map(JX))};JX=function(r){var e=r.partition,t=r.offset,n=r.timestamp,a=void 0===n?Date.now():n,**r.metadata,o=void 0===i?null:i;return new xl().writeInt32(e).writeInt64(t).writeInt64(a).writeString(o)}}var NX,uu,OX,PX,QX=false;function RX(){if(QX)return;QX=true;NX={};uu=(Uh(),Th);OX=uu.parse;PX=uu.decode;NX={decode:PX,parse:OX}}var vu,yl,SX,TX,UX,VX,WX=false;function wu(r,e,n,t,a,i,o){try{var $=r[i](o),v=$.value}catch(c){return void n(c)}$.done?e(v):Promise.resolve(v).then(t,a)}function XX(r){return function(){var e=this,n=arguments;return new Promise(function(t,a){var **r.apply(e,n);function o(r){wu(i,t,a,o,$,"next",r)}function $(r){wu(i,t,a,o,$,"throw",r)}o(void 0)})}}function xu(){if(WX)return;WX=true;vu={};yl=(h(),g);SX=(k(),j);TX=SX.OffsetCommit;vu=function(r){var e=r.groupId,n=r.groupGenerationId,t=r.memberId,a=r.retentionTime,**r.topics;return{apiKey:TX,apiVersion:2,apiName:"OffsetCommit",encode:function(){var r=XX(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new yl().writeString(e).writeInt32(n).writeString(t).writeInt64(a).writeArray(i.map(UX)));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};UX=function(r){var e=r.topic,n=r.partitions;return new yl().writeString(e).writeArray(n.map(VX))};VX=function(r){var e=r.partition,n=r.offset,t=r.metadata,a=void 0===t?null:t;return new yl().writeInt32(e).writeInt64(n).writeString(a)}}var YX,yu,ZX,$X,_X=false;function aY(){if(_X)return;_X=true;YX={};yu=(Uh(),Th);ZX=yu.parse;$X=yu.decode;YX={decode:$X,parse:ZX}}var bY,cY,dY=false;function eY(){if(dY)return;dY=true;bY={};cY=(xu(),vu);bY=function(e){var r=e.groupId,o=e.groupGenerationId,t=e.memberId,**e.retentionTime,n=e.topics;return Object.assign(cY({groupId:r,groupGenerationId:o,memberId:t,retentionTime:i,topics:n}),{apiVersion:3})}}var fY,gY,hY,iY,jY,kY,lY,mY=false;function zu(r,e,n,a,t,$,o){try{var d=r[$](o),c=d.value}catch(i){return void n(i)}d.done?e(c):Promise.resolve(c).then(a,t)}function nY(r){return function(){var e=this,n=arguments;return new Promise(function(a,t){var $=r.apply(e,n);function o(r){zu($,a,t,o,d,"next",r)}function d(r){zu($,a,t,o,d,"throw",r)}o(void 0)})}}function oY(){if(mY)return;mY=true;fY={};gY=(d(),c);hY=(Uh(),Th);iY=hY.parse;jY=function(){var r=nY(regeneratorRuntime.mark(function r(e){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n=new gY(e),r.abrupt("return",{throttleTime:n.readInt32(),responses:n.readArray(kY)});case 2:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();kY=function(r){return{topic:r.readString(),partitions:r.readArray(lY)}};lY=function(r){return{partition:r.readInt32(),errorCode:r.readInt16()}};fY={decode:jY,parse:iY}}var pY={},Au=-1,Bu={0:function(e){var r=e.groupId,s=e.topics,i=(vX(),oX),o=(Uh(),Th);return{request:i({groupId:r,topics:s}),response:o}},1:function(e){var r=e.groupId,s=e.groupGenerationId,**e.memberId,o=e.topics,n=(MX(),FX),t=(RX(),NX);return{request:n({groupId:r,groupGenerationId:s,memberId:i,topics:o}),response:t}},2:function(e){var r=e.groupId,s=e.groupGenerationId,**e.memberId,o=e.retentionTime,n=void 0===o?Au:o,t=e.topics,p=(xu(),vu),u=(aY(),YX);return{request:p({groupId:r,groupGenerationId:s,memberId:i,retentionTime:n,topics:t}),response:u}},3:function(e){var r=e.groupId,s=e.groupGenerationId,**e.memberId,o=e.retentionTime,n=void 0===o?Au:o,t=e.topics,p=(eY(),bY),u=(oY(),fY);return{request:p({groupId:r,groupGenerationId:s,memberId:i,retentionTime:n,topics:t}),response:u}}};pY={versions:Object.keys(Bu),protocol:function(e){var r=e.version;return Bu[r]}};var Cu,zl,qY,rY,sY,tY,uY=false;function Du(r,e,n,t,a,$,o){try{var **r[$](o),c=i.value}catch(f){return void n(f)}i.done?e(c):Promise.resolve(c).then(t,a)}function vY(r){return function(){var e=this,n=arguments;return new Promise(function(t,a){var $=r.apply(e,n);function o(r){Du($,t,a,o,i,"next",r)}function i(r){Du($,t,a,o,i,"throw",r)}o(void 0)})}}function Eu(){if(uY)return;uY=true;Cu={};zl=(h(),g);qY=(k(),j);rY=qY.OffsetFetch;Cu=function(r){var e=r.groupId,n=r.topics;return{apiKey:rY,apiVersion:1,apiName:"OffsetFetch",encode:function(){var r=vY(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new zl().writeString(e).writeArray(n.map(sY)));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};sY=function(r){var e=r.topic,n=r.partitions;return new zl().writeString(e).writeArray(n.map(tY))};tY=function(r){var e=r.partition;return new zl().writeInt32(e)}}var wY,xY,Fu,yY,zY,AY,BY,CY,DY,EY,FY=false;function Gu(r,e,t,n,a,$,o){try{var s=r[$](o),d=s.value}catch(f){return void t(f)}s.done?e(d):Promise.resolve(d).then(n,a)}function Hu(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var $=r.apply(e,t);function o(r){Gu($,n,a,o,s,"next",r)}function s(r){Gu($,n,a,o,s,"throw",r)}o(void 0)})}}function GY(){if(FY)return;FY=true;wY={};xY=(d(),c);Fu=(u(),t);yY=Fu.failure;zY=Fu.createErrorFromCode;AY=(Ca(),Ba);BY=function(){var r=Hu(regeneratorRuntime.mark(function r(e){var t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=new xY(e),r.abrupt("return",{responses:t.readArray(CY)});case 2:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();CY=function(r){return{topic:r.readString(),partitions:r.readArray(DY)}};DY=function(r){return{partition:r.readInt32(),offset:r.readInt64().toString(),metadata:r.readString(),errorCode:r.readInt16()}};EY=function(){var r=Hu(regeneratorRuntime.mark(function r(e){var t,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(t=e.responses.map(function(r){return r.partitions.filter(function(r){return yY(r.errorCode)})}),!(n=AY(t)[0])){r.next=4;break}throw zY(n.errorCode);case 4:return r.abrupt("return",e);case 5:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();wY={decode:BY,parse:EY}}var HY,IY,JY=false;function KY(){if(JY)return;JY=true;HY={};IY=(Eu(),Cu);HY=function(r){var s=r.groupId,e=r.topics;return Object.assign(IY({groupId:s,topics:e}),{apiVersion:2})}}var Iu,LY,Ju,Ku,Lu,MY,NY,OY,PY,QY,RY=false;function Mu(r,e,t,a,n,o,$){try{var v=r[o]($),**v.value}catch(u){return void t(u)}v.done?e(i):Promise.resolve(i).then(a,n)}function Nu(r){return function(){var e=this,t=arguments;return new Promise(function(a,n){var o=r.apply(e,t);function $(r){Mu(o,a,n,$,v,"next",r)}function v(r){Mu(o,a,n,$,v,"throw",r)}$(void 0)})}}function Ou(){if(RY)return;RY=true;Iu={};LY=(d(),c);Ju=(u(),t);Ku=Ju.failure;Lu=Ju.createErrorFromCode;MY=(Ca(),Ba);NY=function(){var r=Nu(regeneratorRuntime.mark(function r(e){var t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=new LY(e),r.abrupt("return",{responses:t.readArray(OY),errorCode:t.readInt16()});case 2:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();OY=function(r){return{topic:r.readString(),partitions:r.readArray(PY)}};PY=function(r){return{partition:r.readInt32(),offset:r.readInt64().toString(),metadata:r.readString(),errorCode:r.readInt16()}};QY=function(){var r=Nu(regeneratorRuntime.mark(function r(e){var t,a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!Ku(e.errorCode)){r.next=2;break}throw Lu(e.errorCode);case 2:if(t=e.responses.map(function(r){return r.partitions.filter(function(r){return Ku(r.errorCode)})}),!(a=MY(t)[0])){r.next=6;break}throw Lu(a.errorCode);case 6:return r.abrupt("return",e);case 7:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Iu={decode:NY,parse:QY}}var SY,Al,TY,UY,VY,WY,XY=false;function Pu(r,e,t,n,a,$,o){try{var **r[$](o),c=i.value}catch(u){return void t(u)}i.done?e(c):Promise.resolve(c).then(n,a)}function YY(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var $=r.apply(e,t);function o(r){Pu($,n,a,o,i,"next",r)}function i(r){Pu($,n,a,o,i,"throw",r)}o(void 0)})}}function ZY(){if(XY)return;XY=true;SY={};Al=(h(),g);TY=(k(),j);UY=TY.OffsetFetch;SY=function(r){var e=r.groupId,t=r.topics;return{apiKey:UY,apiVersion:3,apiName:"OffsetFetch",encode:function(){var r=YY(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Al().writeString(e).writeNullableArray(t.map(VY)));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};VY=function(r){var e=r.topic,t=r.partitions;return new Al().writeString(e).writeArray(t.map(WY))};WY=function(r){var e=r.partition;return new Al().writeInt32(e)}}var $Y,_Y,aZ,bZ,cZ,dZ,eZ,fZ=false;function Qu(r,e,n,t,a,$,o){try{var s=r[$](o),**s.value}catch(c){return void n(c)}s.done?e(i):Promise.resolve(i).then(t,a)}function gZ(r){return function(){var e=this,n=arguments;return new Promise(function(t,a){var $=r.apply(e,n);function o(r){Qu($,t,a,o,s,"next",r)}function s(r){Qu($,t,a,o,s,"throw",r)}o(void 0)})}}function hZ(){if(fZ)return;fZ=true;$Y={};_Y=(d(),c);aZ=(Ou(),Iu);bZ=aZ.parse;cZ=function(){var r=gZ(regeneratorRuntime.mark(function r(e){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n=new _Y(e),r.abrupt("return",{throttleTime:n.readInt32(),responses:n.readArray(dZ),errorCode:n.readInt16()});case 2:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();dZ=function(r){return{topic:r.readString(),partitions:r.readArray(eZ)}};eZ=function(r){return{partition:r.readInt32(),offset:r.readInt64().toString(),metadata:r.readString(),errorCode:r.readInt16()}};$Y={decode:cZ,parse:bZ}}var iZ={},Ru={1:function(r){var e=r.groupId,s=r.topics,o=(Eu(),Cu),v=(GY(),wY);return{request:o({groupId:e,topics:s}),response:v}},2:function(r){var e=r.groupId,s=r.topics,o=(KY(),HY),v=(Ou(),Iu);return{request:o({groupId:e,topics:s}),response:v}},3:function(r){var e=r.groupId,s=r.topics,o=(ZY(),SY),v=(hZ(),$Y);return{request:o({groupId:e,topics:s}),response:v}}};iZ={versions:Object.keys(Ru),protocol:function(r){var e=r.version;return Ru[e]}};var Jf={};Jf={GROUP:0,TRANSACTION:1};var jZ,kZ,lZ,mZ,nZ=false;function Su(r,e,n,a,t,o,$){try{var **r[o]($),u=i.value}catch(c){return void n(c)}i.done?e(u):Promise.resolve(u).then(a,t)}function oZ(r){return function(){var e=this,n=arguments;return new Promise(function(a,t){var o=r.apply(e,n);function $(r){Su(o,a,t,$,i,"next",r)}function i(r){Su(o,a,t,$,i,"throw",r)}$(void 0)})}}function pZ(){if(nZ)return;nZ=true;jZ={};kZ=(h(),g);lZ=(k(),j);mZ=lZ.GroupCoordinator;jZ=function(r){var e=r.groupId;return{apiKey:mZ,apiVersion:0,apiName:"GroupCoordinator",encode:function(){var r=oZ(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new kZ().writeString(e));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}}}var qZ,rZ,Bl,sZ,tZ,uZ,vZ,wZ,xZ=false;function Tu(r,e,a,n,t,o,$){try{var c=r[o]($),u=c.value}catch(i){return void a(i)}c.done?e(u):Promise.resolve(u).then(n,t)}function Uu(r){return function(){var e=this,a=arguments;return new Promise(function(n,t){var o=r.apply(e,a);function $(r){Tu(o,n,t,$,c,"next",r)}function c(r){Tu(o,n,t,$,c,"throw",r)}$(void 0)})}}function yZ(){if(xZ)return;xZ=true;qZ={};rZ=(d(),c);Bl=(u(),t);sZ=Bl.failure;tZ=Bl.createErrorFromCode;uZ=Bl.failIfVersionNotSupported;vZ=function(){var r=Uu(regeneratorRuntime.mark(function r(e){var a,n,t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=new rZ(e),n=a.readInt16(),uZ(n),t={nodeId:a.readInt32(),host:a.readString(),port:a.readInt32()},r.abrupt("return",{errorCode:n,coordinator:t});case 5:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();wZ=function(){var r=Uu(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!sZ(e.errorCode)){r.next=2;break}throw tZ(e.errorCode);case 2:return r.abrupt("return",e);case 3:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();qZ={decode:vZ,parse:wZ}}var zZ,AZ,BZ,CZ,DZ=false;function Vu(r,e,n,t,a,o,$){try{var **r[o]($),u=i.value}catch(c){return void n(c)}i.done?e(u):Promise.resolve(u).then(t,a)}function EZ(r){return function(){var e=this,n=arguments;return new Promise(function(t,a){var o=r.apply(e,n);function $(r){Vu(o,t,a,$,i,"next",r)}function i(r){Vu(o,t,a,$,i,"throw",r)}$(void 0)})}}function FZ(){if(DZ)return;DZ=true;zZ={};AZ=(h(),g);BZ=(k(),j);CZ=BZ.GroupCoordinator;zZ=function(r){var e=r.coordinatorKey,n=r.coordinatorType;return{apiKey:CZ,apiVersion:1,apiName:"GroupCoordinator",encode:function(){var r=EZ(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new AZ().writeString(e).writeInt8(n));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}}}var GZ,HZ,Cl,IZ,JZ,KZ,LZ,MZ,NZ=false;function Wu(r,e,a,t,n,o,$){try{var u=r[o]($),**u.value}catch(c){return void a(c)}u.done?e(i):Promise.resolve(i).then(t,n)}function Xu(r){return function(){var e=this,a=arguments;return new Promise(function(t,n){var o=r.apply(e,a);function $(r){Wu(o,t,n,$,u,"next",r)}function u(r){Wu(o,t,n,$,u,"throw",r)}$(void 0)})}}function OZ(){if(NZ)return;NZ=true;GZ={};HZ=(d(),c);Cl=(u(),t);IZ=Cl.failure;JZ=Cl.createErrorFromCode;KZ=Cl.failIfVersionNotSupported;LZ=function(){var r=Xu(regeneratorRuntime.mark(function r(e){var a,t,n,o,$;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=new HZ(e),t=a.readInt32(),n=a.readInt16(),KZ(n),o=a.readString(),$={nodeId:a.readInt32(),host:a.readString(),port:a.readInt32()},r.abrupt("return",{throttleTime:t,errorCode:n,errorMessage:o,coordinator:$});case 7:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();MZ=function(){var r=Xu(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!IZ(e.errorCode)){r.next=2;break}throw JZ(e.errorCode);case 2:return r.abrupt("return",e);case 3:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();GZ={decode:LZ,parse:MZ}}var PZ={},Yu={0:function(r){var e=r.groupId,o=(pZ(),jZ),$=(yZ(),qZ);return{request:o({groupId:e}),response:$}},1:function(r){var e=r.groupId,o=r.coordinatorType,$=void 0===o?Jf.GROUP:o,s=(FZ(),zZ),J=(OZ(),GZ);return{request:s({coordinatorKey:e,coordinatorType:$}),response:J}}};PZ={versions:Object.keys(Yu),protocol:function(r){var e=r.version;return Yu[e]}};var QZ,RZ,Zu,SZ,TZ,UZ,VZ=false;function $u(r,e,n,i,t,a,o){try{var $=r[a](o),s=$.value}catch(u){return void n(u)}$.done?e(s):Promise.resolve(s).then(i,t)}function WZ(r){return function(){var e=this,n=arguments;return new Promise(function(i,t){var a=r.apply(e,n);function o(r){$u(a,i,t,o,$,"next",r)}function $(r){$u(a,i,t,o,$,"throw",r)}o(void 0)})}}function XZ(){if(VZ)return;VZ=true;QZ={};RZ=(z(),r).Buffer;Zu=(h(),g);SZ=(k(),j);TZ=SZ.JoinGroup;QZ=function(r){var e=r.groupId,n=r.sessionTimeout,**r.memberId,t=r.protocolType,a=r.groupProtocols;return{apiKey:TZ,apiVersion:0,apiName:"JoinGroup",encode:function(){var r=WZ(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Zu().writeString(e).writeInt32(n).writeString(i).writeString(t).writeArray(a.map(UZ)));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};UZ=function(r){var e=r.name,n=r.metadata,**void 0===n?RZ.alloc(0):n;return new Zu().writeString(e).writeBytes(i)}}var Dl,YZ,El,ZZ,$Z,_Z,a$,b$,c$=false;function _u(r,e,a,t,n,o,$){try{var N=r[o]($),u=N.value}catch(i){return void a(i)}N.done?e(u):Promise.resolve(u).then(t,n)}function av(r){return function(){var e=this,a=arguments;return new Promise(function(t,n){var o=r.apply(e,a);function $(r){_u(o,t,n,$,N,"next",r)}function N(r){_u(o,t,n,$,N,"throw",r)}$(void 0)})}}function Fl(){if(c$)return;c$=true;Dl={};YZ=(d(),c);El=(u(),t);ZZ=El.failure;$Z=El.createErrorFromCode;_Z=El.failIfVersionNotSupported;a$=function(){var r=av(regeneratorRuntime.mark(function r(e){var a,t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=new YZ(e),t=a.readInt16(),_Z(t),r.abrupt("return",{errorCode:t,generationId:a.readInt32(),groupProtocol:a.readString(),leaderId:a.readString(),memberId:a.readString(),members:a.readArray(function(r){return{memberId:r.readString(),memberMetadata:r.readBytes()}})});case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();b$=function(){var r=av(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!ZZ(e.errorCode)){r.next=2;break}throw $Z(e.errorCode);case 2:return r.abrupt("return",e);case 3:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Dl={decode:a$,parse:b$}}var bv,d$,cv,e$,f$,g$,h$=false;function dv(r,e,n,t,a,o,$){try{var **r[o]($),u=i.value}catch(f){return void n(f)}i.done?e(u):Promise.resolve(u).then(t,a)}function i$(r){return function(){var e=this,n=arguments;return new Promise(function(t,a){var o=r.apply(e,n);function $(r){dv(o,t,a,$,i,"next",r)}function i(r){dv(o,t,a,$,i,"throw",r)}$(void 0)})}}function ev(){if(h$)return;h$=true;bv={};d$=(z(),r).Buffer;cv=(h(),g);e$=(k(),j);f$=e$.JoinGroup;bv=function(r){var e=r.groupId,n=r.sessionTimeout,t=r.rebalanceTimeout,a=r.memberId,o=r.protocolType,$=r.groupProtocols;return{apiKey:f$,apiVersion:1,apiName:"JoinGroup",encode:function(){var r=i$(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new cv().writeString(e).writeInt32(n).writeInt32(t).writeString(a).writeString(o).writeArray($.map(g$)));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};g$=function(r){var e=r.name,n=r.metadata,t=void 0===n?d$.alloc(0):n;return new cv().writeString(e).writeBytes(t)}}var j$,fv,k$,l$,m$=false;function n$(){if(m$)return;m$=true;j$={};fv=(Fl(),Dl);k$=fv.parse;l$=fv.decode;j$={decode:l$,parse:k$}}var o$,p$,q$=false;function r$(){if(q$)return;q$=true;o$={};p$=(ev(),bv);o$=function(e){var r=e.groupId,o=e.sessionTimeout,s=e.rebalanceTimeout,t=e.memberId,u=e.protocolType,p=e.groupProtocols;return Object.assign(p$({groupId:r,sessionTimeout:o,rebalanceTimeout:s,memberId:t,protocolType:u,groupProtocols:p}),{apiVersion:2})}}var s$,t$,u$,v$,w$,x$,y$,z$=false;function gv(r,e,a,t,n,$,o){try{var v=r[$](o),**v.value}catch(u){return void a(u)}v.done?e(i):Promise.resolve(i).then(t,n)}function A$(r){return function(){var e=this,a=arguments;return new Promise(function(t,n){var $=r.apply(e,a);function o(r){gv($,t,n,o,v,"next",r)}function v(r){gv($,t,n,o,v,"throw",r)}o(void 0)})}}function B$(){if(z$)return;z$=true;s$={};t$=(d(),c);u$=(u(),t);v$=u$.failIfVersionNotSupported;w$=(Fl(),Dl);x$=w$.parse;y$=function(){var r=A$(regeneratorRuntime.mark(function r(e){var a,t,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=new t$(e),t=a.readInt32(),n=a.readInt16(),v$(n),r.abrupt("return",{throttleTime:t,errorCode:n,generationId:a.readInt32(),groupProtocol:a.readString(),leaderId:a.readString(),memberId:a.readString(),members:a.readArray(function(r){return{memberId:r.readString(),memberMetadata:r.readBytes()}})});case 5:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();s$={decode:y$,parse:x$}}var C$={},hv=5e3,Gl=function(e){var r=e.rebalanceTimeout,o=e.sessionTimeout,s=r||o;return Number.isSafeInteger(s+hv)?s+hv:s},iv={0:function(e){var r=e.groupId,o=e.sessionTimeout,s=e.memberId,u=e.protocolType,t=e.groupProtocols,i=(XZ(),QZ),n=(Fl(),Dl);return{request:i({groupId:r,sessionTimeout:o,memberId:s,protocolType:u,groupProtocols:t}),response:n,requestTimeout:Gl({rebalanceTimeout:null,sessionTimeout:o})}},1:function(e){var r=e.groupId,o=e.sessionTimeout,s=e.rebalanceTimeout,u=e.memberId,t=e.protocolType,**e.groupProtocols,n=(ev(),bv),$=(n$(),j$);return{request:n({groupId:r,sessionTimeout:o,rebalanceTimeout:s,memberId:u,protocolType:t,groupProtocols:i}),response:$,requestTimeout:Gl({rebalanceTimeout:s,sessionTimeout:o})}},2:function(e){var r=e.groupId,o=e.sessionTimeout,s=e.rebalanceTimeout,u=e.memberId,t=e.protocolType,**e.groupProtocols,n=(r$(),o$),$=(B$(),s$);return{request:n({groupId:r,sessionTimeout:o,rebalanceTimeout:s,memberId:u,protocolType:t,groupProtocols:i}),response:$,requestTimeout:Gl({rebalanceTimeout:s,sessionTimeout:o})}}};C$={versions:Object.keys(iv),protocol:function(e){var r=e.version;return iv[r]}};var jv,D$,E$,F$,G$=false;function kv(r,e,t,n,a,$,o){try{var **r[$](o),u=i.value}catch(c){return void t(c)}i.done?e(u):Promise.resolve(u).then(n,a)}function H$(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var $=r.apply(e,t);function o(r){kv($,n,a,o,i,"next",r)}function i(r){kv($,n,a,o,i,"throw",r)}o(void 0)})}}function lv(){if(G$)return;G$=true;jv={};D$=(h(),g);E$=(k(),j);F$=E$.Heartbeat;jv=function(r){var e=r.groupId,t=r.groupGenerationId,n=r.memberId;return{apiKey:F$,apiVersion:0,apiName:"Heartbeat",encode:function(){var r=H$(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new D$().writeString(e).writeInt32(t).writeString(n));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}}}var mv,I$,Hl,J$,K$,L$,M$,N$,O$=false;function nv(r,e,a,n,t,$,o){try{var u=r[$](o),**u.value}catch(c){return void a(c)}u.done?e(i):Promise.resolve(i).then(n,t)}function ov(r){return function(){var e=this,a=arguments;return new Promise(function(n,t){var $=r.apply(e,a);function o(r){nv($,n,t,o,u,"next",r)}function u(r){nv($,n,t,o,u,"throw",r)}o(void 0)})}}function pv(){if(O$)return;O$=true;mv={};I$=(d(),c);Hl=(u(),t);J$=Hl.failure;K$=Hl.createErrorFromCode;L$=Hl.failIfVersionNotSupported;M$=function(){var r=ov(regeneratorRuntime.mark(function r(e){var a,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=new I$(e),n=a.readInt16(),L$(n),r.abrupt("return",{errorCode:n});case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();N$=function(){var r=ov(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!J$(e.errorCode)){r.next=2;break}throw K$(e.errorCode);case 2:return r.abrupt("return",e);case 3:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();mv={decode:M$,parse:N$}}var P$,Q$,R$=false;function S$(){if(R$)return;R$=true;P$={};Q$=(lv(),jv);P$=function(r){var e=r.groupId,$=r.groupGenerationId,o=r.memberId;return Object.assign(Q$({groupId:e,groupGenerationId:$,memberId:o}),{apiVersion:1})}}var T$,U$,V$,W$,X$,Y$,Z$,$$=false;function qv(r,e,$,a,n,t,o){try{var **r[t](o),u=i.value}catch(c){return void $(c)}i.done?e(u):Promise.resolve(u).then(a,n)}function _$(r){return function(){var e=this,$=arguments;return new Promise(function(a,n){var t=r.apply(e,$);function o(r){qv(t,a,n,o,i,"next",r)}function i(r){qv(t,a,n,o,i,"throw",r)}o(void 0)})}}function a_(){if($$)return;$$=true;T$={};U$=(d(),c);V$=(u(),t);W$=V$.failIfVersionNotSupported;X$=(pv(),mv);Y$=X$.parse;Z$=function(){var r=_$(regeneratorRuntime.mark(function r(e){var $,a,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return $=new U$(e),a=$.readInt32(),n=$.readInt16(),W$(n),r.abrupt("return",{throttleTime:a,errorCode:n});case 5:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();T$={decode:Z$,parse:Y$}}var b_={},rv={0:function(r){var e=r.groupId,o=r.groupGenerationId,n=r.memberId,s=(lv(),jv),u=(pv(),mv);return{request:s({groupId:e,groupGenerationId:o,memberId:n}),response:u}},1:function(r){var e=r.groupId,o=r.groupGenerationId,n=r.memberId,s=(S$(),P$),u=(a_(),T$);return{request:s({groupId:e,groupGenerationId:o,memberId:n}),response:u}}};b_={versions:Object.keys(rv),protocol:function(r){var e=r.version;return rv[e]}};var sv,c_,d_,e_,f_=false;function tv(r,e,n,a,t,$,o){try{var **r[$](o),u=i.value}catch(c){return void n(c)}i.done?e(u):Promise.resolve(u).then(a,t)}function g_(r){return function(){var e=this,n=arguments;return new Promise(function(a,t){var $=r.apply(e,n);function o(r){tv($,a,t,o,i,"next",r)}function i(r){tv($,a,t,o,i,"throw",r)}o(void 0)})}}function uv(){if(f_)return;f_=true;sv={};c_=(h(),g);d_=(k(),j);e_=d_.LeaveGroup;sv=function(r){var e=r.groupId,n=r.memberId;return{apiKey:e_,apiVersion:0,apiName:"LeaveGroup",encode:function(){var r=g_(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new c_().writeString(e).writeString(n));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}}}var vv,h_,Il,i_,j_,k_,l_,m_,n_=false;function wv(r,e,a,n,t,$,o){try{var u=r[$](o),**u.value}catch(c){return void a(c)}u.done?e(i):Promise.resolve(i).then(n,t)}function xv(r){return function(){var e=this,a=arguments;return new Promise(function(n,t){var $=r.apply(e,a);function o(r){wv($,n,t,o,u,"next",r)}function u(r){wv($,n,t,o,u,"throw",r)}o(void 0)})}}function yv(){if(n_)return;n_=true;vv={};h_=(d(),c);Il=(u(),t);i_=Il.failure;j_=Il.createErrorFromCode;k_=Il.failIfVersionNotSupported;l_=function(){var r=xv(regeneratorRuntime.mark(function r(e){var a,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=new h_(e),n=a.readInt16(),k_(n),r.abrupt("return",{errorCode:n});case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();m_=function(){var r=xv(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!i_(e.errorCode)){r.next=2;break}throw j_(e.errorCode);case 2:return r.abrupt("return",e);case 3:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();vv={decode:l_,parse:m_}}var o_,p_,q_=false;function r_(){if(q_)return;q_=true;o_={};p_=(uv(),sv);o_=function(e){var r=e.groupId,$=e.memberId;return Object.assign(p_({groupId:r,memberId:$}),{apiVersion:1})}}var s_,t_,u_,v_,w_,x_,y_,z_=false;function zv(e,r,o,$,a,n,i){try{var t=e[n](i),p=t.value}catch(u){return void o(u)}t.done?r(p):Promise.resolve(p).then($,a)}function A_(e){return function(){var r=this,o=arguments;return new Promise(function($,a){var n=e.apply(r,o);function i(e){zv(n,$,a,i,t,"next",e)}function t(e){zv(n,$,a,i,t,"throw",e)}i(void 0)})}}function B_(){if(z_)return;z_=true;s_={};t_=(d(),c);u_=(u(),t);v_=u_.failIfVersionNotSupported;w_=(yv(),vv);x_=w_.parse;y_=function(){var e=A_(regeneratorRuntime.mark(function e(r){var o,$,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return o=new t_(r),$=o.readInt32(),a=o.readInt16(),v_(a),e.abrupt("return",{throttleTime:$,errorCode:a});case 5:case"end":return e.stop();}},e)}));return function(r){return e.apply(this,arguments)}}();s_={decode:y_,parse:x_}}var C_={},Av={0:function(r){var e=r.groupId,p=r.memberId,s=(uv(),sv),o=(yv(),vv);return{request:s({groupId:e,memberId:p}),response:o}},1:function(r){var e=r.groupId,p=r.memberId,s=(r_(),o_),o=(B_(),s_);return{request:s({groupId:e,memberId:p}),response:o}}};C_={versions:Object.keys(Av),protocol:function(r){var e=r.version;return Av[e]}};var Bv,Cv,D_,E_,F_,G_=false;function Dv(r,e,n,t,a,$,o){try{var **r[$](o),u=i.value}catch(c){return void n(c)}i.done?e(u):Promise.resolve(u).then(t,a)}function H_(r){return function(){var e=this,n=arguments;return new Promise(function(t,a){var $=r.apply(e,n);function o(r){Dv($,t,a,o,i,"next",r)}function i(r){Dv($,t,a,o,i,"throw",r)}o(void 0)})}}function Ev(){if(G_)return;G_=true;Bv={};Cv=(h(),g);D_=(k(),j);E_=D_.SyncGroup;Bv=function(r){var e=r.groupId,n=r.generationId,t=r.memberId,a=r.groupAssignment;return{apiKey:E_,apiVersion:0,apiName:"SyncGroup",encode:function(){var r=H_(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Cv().writeString(e).writeInt32(n).writeString(t).writeArray(a.map(F_)));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};F_=function(r){var e=r.memberId,n=r.memberAssignment;return new Cv().writeString(e).writeBytes(n)}}var Fv,I_,Jl,J_,K_,L_,M_,N_,O_=false;function Gv(r,e,a,n,t,u,$){try{var o=r[u]($),d=o.value}catch(i){return void a(i)}o.done?e(d):Promise.resolve(d).then(n,t)}function Hv(r){return function(){var e=this,a=arguments;return new Promise(function(n,t){var u=r.apply(e,a);function $(r){Gv(u,n,t,$,o,"next",r)}function o(r){Gv(u,n,t,$,o,"throw",r)}$(void 0)})}}function Iv(){if(O_)return;O_=true;Fv={};I_=(d(),c);Jl=(u(),t);J_=Jl.failure;K_=Jl.createErrorFromCode;L_=Jl.failIfVersionNotSupported;M_=function(){var r=Hv(regeneratorRuntime.mark(function r(e){var a,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=new I_(e),n=a.readInt16(),L_(n),r.abrupt("return",{errorCode:n,memberAssignment:a.readBytes()});case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();N_=function(){var r=Hv(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!J_(e.errorCode)){r.next=2;break}throw K_(e.errorCode);case 2:return r.abrupt("return",e);case 3:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Fv={decode:M_,parse:N_}}var P_,Q_,R_=false;function S_(){if(R_)return;R_=true;P_={};Q_=(Ev(),Bv);P_=function(e){var r=e.groupId,n=e.generationId,s=e.memberId,t=e.groupAssignment;return Object.assign(Q_({groupId:r,generationId:n,memberId:s,groupAssignment:t}),{apiVersion:1})}}var T_,U_,V_,W_,X_,Y_,Z_,$_=false;function Jv(e,r,t,$,a,n,o){try{var **e[n](o),u=i.value}catch(m){return void t(m)}i.done?r(u):Promise.resolve(u).then($,a)}function __(e){return function(){var r=this,t=arguments;return new Promise(function($,a){var n=e.apply(r,t);function o(e){Jv(n,$,a,o,i,"next",e)}function i(e){Jv(n,$,a,o,i,"throw",e)}o(void 0)})}}function aaa(){if($_)return;$_=true;T_={};U_=(d(),c);V_=(u(),t);W_=V_.failIfVersionNotSupported;X_=(Iv(),Fv);Y_=X_.parse;Z_=function(){var e=__(regeneratorRuntime.mark(function e(r){var t,$,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=new U_(r),$=t.readInt32(),a=t.readInt16(),W_(a),e.abrupt("return",{throttleTime:$,errorCode:a,memberAssignment:t.readBytes()});case 5:case"end":return e.stop();}},e)}));return function(r){return e.apply(this,arguments)}}();T_={decode:Z_,parse:Y_}}var baa={},Kv={0:function(e){var r=e.groupId,n=e.generationId,s=e.memberId,o=e.groupAssignment,t=(Ev(),Bv),u=(Iv(),Fv);return{request:t({groupId:r,generationId:n,memberId:s,groupAssignment:o}),response:u}},1:function(e){var r=e.groupId,n=e.generationId,s=e.memberId,o=e.groupAssignment,t=(S_(),P_),u=(aaa(),T_);return{request:t({groupId:r,generationId:n,memberId:s,groupAssignment:o}),response:u}}};baa={versions:Object.keys(Kv),protocol:function(e){var r=e.version;return Kv[r]}};var Lv,caa,daa,eaa,faa=false;function Mv(r,e,n,a,t,$,o){try{var **r[$](o),u=i.value}catch(c){return void n(c)}i.done?e(u):Promise.resolve(u).then(a,t)}function gaa(r){return function(){var e=this,n=arguments;return new Promise(function(a,t){var $=r.apply(e,n);function o(r){Mv($,a,t,o,i,"next",r)}function i(r){Mv($,a,t,o,i,"throw",r)}o(void 0)})}}function Nv(){if(faa)return;faa=true;Lv={};caa=(h(),g);daa=(k(),j);eaa=daa.DescribeGroups;Lv=function(r){var e=r.groupIds;return{apiKey:eaa,apiVersion:0,apiName:"DescribeGroups",encode:function(){var r=gaa(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new caa().writeArray(e));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}}}var Ov,haa,Pv,iaa,jaa,kaa,laa,maa,naa,oaa=false;function Qv(r,e,a,t,n,o,i){try{var $=r[o](i),u=$.value}catch(c){return void a(c)}$.done?e(u):Promise.resolve(u).then(t,n)}function Rv(r){return function(){var e=this,a=arguments;return new Promise(function(t,n){var o=r.apply(e,a);function i(r){Qv(o,t,n,i,$,"next",r)}function $(r){Qv(o,t,n,i,$,"throw",r)}i(void 0)})}}function Sv(){if(oaa)return;oaa=true;Ov={};haa=(d(),c);Pv=(u(),t);iaa=Pv.failure;jaa=Pv.createErrorFromCode;kaa=function(r){return{memberId:r.readString(),clientId:r.readString(),clientHost:r.readString(),memberMetadata:r.readBytes(),memberAssignment:r.readBytes()}};laa=function(r){return{errorCode:r.readInt16(),groupId:r.readString(),state:r.readString(),protocolType:r.readString(),protocol:r.readString(),members:r.readArray(kaa)}};maa=function(){var r=Rv(regeneratorRuntime.mark(function r(e){var a,t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=new haa(e),t=a.readArray(laa),r.abrupt("return",{groups:t});case 3:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();naa=function(){var r=Rv(regeneratorRuntime.mark(function r(e){var a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!((a=e.groups.filter(function(r){var e=r.errorCode;return iaa(e)})).length>0)){r.next=3;break}throw jaa(a[0].errorCode);case 3:return r.abrupt("return",e);case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Ov={decode:maa,parse:naa}}var paa,qaa,raa=false;function saa(){if(raa)return;raa=true;paa={};qaa=(Nv(),Lv);paa=function(r){var p=r.groupIds;return Object.assign(qaa({groupIds:p}),{apiVersion:1})}}var taa,uaa,vaa,waa,xaa,yaa,zaa,Aaa=false;function Tv(r,e,t,a,n,$,o){try{var d=r[$](o),c=d.value}catch(i){return void t(i)}d.done?e(c):Promise.resolve(c).then(a,n)}function Baa(r){return function(){var e=this,t=arguments;return new Promise(function(a,n){var $=r.apply(e,t);function o(r){Tv($,a,n,o,d,"next",r)}function d(r){Tv($,a,n,o,d,"throw",r)}o(void 0)})}}function Caa(){if(Aaa)return;Aaa=true;taa={};uaa=(d(),c);vaa=(Sv(),Ov);waa=vaa.parse;xaa=function(r){return{memberId:r.readString(),clientId:r.readString(),clientHost:r.readString(),memberMetadata:r.readBytes(),memberAssignment:r.readBytes()}};yaa=function(r){return{errorCode:r.readInt16(),groupId:r.readString(),state:r.readString(),protocolType:r.readString(),protocol:r.readString(),members:r.readArray(xaa)}};zaa=function(){var r=Baa(regeneratorRuntime.mark(function r(e){var t,a,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=new uaa(e),a=t.readInt32(),n=t.readArray(yaa),r.abrupt("return",{throttleTime:a,groups:n});case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();taa={decode:zaa,parse:waa}}var Daa={},Uv={0:function(r){var e=r.groupIds,p=(Nv(),Lv),s=(Sv(),Ov);return{request:p({groupIds:e}),response:s}},1:function(r){var e=r.groupIds,p=(saa(),paa),s=(Caa(),taa);return{request:p({groupIds:e}),response:s}}};Daa={versions:Object.keys(Uv),protocol:function(r){var e=r.version;return Uv[e]}};var Vv,Eaa,Faa,Gaa,Haa=false;function Wv(r,e,n,a,t,$,o){try{var **r[$](o),c=i.value}catch(u){return void n(u)}i.done?e(c):Promise.resolve(c).then(a,t)}function Iaa(r){return function(){var e=this,n=arguments;return new Promise(function(a,t){var $=r.apply(e,n);function o(r){Wv($,a,t,o,i,"next",r)}function i(r){Wv($,a,t,o,i,"throw",r)}o(void 0)})}}function Xv(){if(Haa)return;Haa=true;Vv={};Eaa=(h(),g);Faa=(k(),j);Gaa=Faa.SaslHandshake;Vv=function(r){var e=r.mechanism;return{apiKey:Gaa,apiVersion:0,apiName:"SaslHandshake",encode:function(){var r=Iaa(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Eaa().writeString(e));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}}}var Yv,Jaa,Kl,Kaa,Laa,Maa,Naa,Oaa,Paa=false;function Zv(r,e,a,n,t,$,o){try{var u=r[$](o),**u.value}catch(c){return void a(c)}u.done?e(i):Promise.resolve(i).then(n,t)}function $v(r){return function(){var e=this,a=arguments;return new Promise(function(n,t){var $=r.apply(e,a);function o(r){Zv($,n,t,o,u,"next",r)}function u(r){Zv($,n,t,o,u,"throw",r)}o(void 0)})}}function _v(){if(Paa)return;Paa=true;Yv={};Jaa=(d(),c);Kl=(u(),t);Kaa=Kl.failure;Laa=Kl.createErrorFromCode;Maa=Kl.failIfVersionNotSupported;Naa=function(){var r=$v(regeneratorRuntime.mark(function r(e){var a,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=new Jaa(e),n=a.readInt16(),Maa(n),r.abrupt("return",{errorCode:n,enabledMechanisms:a.readArray(function(r){return r.readString()})});case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Oaa=function(){var r=$v(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!Kaa(e.errorCode)){r.next=2;break}throw Laa(e.errorCode);case 2:return r.abrupt("return",e);case 3:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Yv={decode:Naa,parse:Oaa}}var Qaa,Raa,Saa=false;function aw(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function Taa(e){for(var r=1;r0)){r.next=3;break}throw $ba(a[0].errorCode);case 3:return r.abrupt("return",e);case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Xba={decode:bca,parse:cca}}var tw,Wh,fca,gca,hca,ica,jca,kca=false;function uw(r,n,e,t,a,i,o){try{var $=r[i](o),u=$.value}catch(c){return void e(c)}$.done?n(u):Promise.resolve(u).then(t,a)}function lca(r){return function(){var n=this,e=arguments;return new Promise(function(t,a){var **r.apply(n,e);function o(r){uw(i,t,a,o,$,"next",r)}function $(r){uw(i,t,a,o,$,"throw",r)}o(void 0)})}}function vw(){if(kca)return;kca=true;tw={};Wh=(h(),g);fca=(k(),j);gca=fca.CreateTopics;tw=function(r){var n=r.topics,e=r.validateOnly,t=void 0!==e&&e,a=r.timeout,**void 0===a?5e3:a;return{apiKey:gca,apiVersion:1,apiName:"CreateTopics",encode:function(){var r=lca(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Wh().writeArray(n.map(hca)).writeInt32(i).writeBoolean(t));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};hca=function(r){var n=r.topic,e=r.numPartitions,t=void 0===e?1:e,a=r.replicationFactor,**void 0===a?1:a,o=r.replicaAssignment,$=void 0===o?[]:o,u=r.configEntries,c=void 0===u?[]:u;return new Wh().writeString(n).writeInt32(t).writeInt16(i).writeArray($.map(ica)).writeArray(c.map(jca))};ica=function(r){var n=r.partition,e=r.replicas;return new Wh().writeInt32(n).writeArray(e)};jca=function(r){var n=r.name,e=r.value;return new Wh().writeString(n).writeString(e)}}var ww,mca,xw,nca,oca,pca,qca,rca,sca,tca=false;function yw(r,e,a,t,o,n,$){try{var c=r[n]($),**c.value}catch(u){return void a(u)}c.done?e(i):Promise.resolve(i).then(t,o)}function zw(r){return function(){var e=this,a=arguments;return new Promise(function(t,o){var n=r.apply(e,a);function $(r){yw(n,t,o,$,c,"next",r)}function c(r){yw(n,t,o,$,c,"throw",r)}$(void 0)})}}function Aw(){if(tca)return;tca=true;ww={};mca=(d(),c);xw=(u(),t);nca=xw.failure;oca=xw.createErrorFromCode;pca=function(r,e){return r.topic.localeCompare(e.topic)};qca=function(r){return{topic:r.readString(),errorCode:r.readInt16(),errorMessage:r.readString()}};rca=function(){var r=zw(regeneratorRuntime.mark(function r(e){var a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=new mca(e),r.abrupt("return",{topicErrors:a.readArray(qca).sort(pca)});case 2:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();sca=function(){var r=zw(regeneratorRuntime.mark(function r(e){var a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!((a=e.topicErrors.filter(function(r){var e=r.errorCode;return nca(e)})).length>0)){r.next=3;break}throw oca(a[0].errorCode);case 3:return r.abrupt("return",e);case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();ww={decode:rca,parse:sca}}var uca,vca,wca=false;function xca(){if(wca)return;wca=true;uca={};vca=(vw(),tw);uca=function(e){var t=e.topics,r=e.validateOnly,v=e.timeout;return Object.assign(vca({topics:t,validateOnly:r,timeout:v}),{apiVersion:2})}}var yca,zca,Aca,Bca,Cca,Dca,Eca,Fca=false;function Bw(r,e,a,t,n,o,$){try{var **r[o]($),s=i.value}catch(c){return void a(c)}i.done?e(s):Promise.resolve(s).then(t,n)}function Gca(r){return function(){var e=this,a=arguments;return new Promise(function(t,n){var o=r.apply(e,a);function $(r){Bw(o,t,n,$,i,"next",r)}function i(r){Bw(o,t,n,$,i,"throw",r)}$(void 0)})}}function Hca(){if(Fca)return;Fca=true;yca={};zca=(d(),c);Aca=(Aw(),ww);Bca=Aca.parse;Cca=function(r,e){return r.topic.localeCompare(e.topic)};Dca=function(r){return{topic:r.readString(),errorCode:r.readInt16(),errorMessage:r.readString()}};Eca=function(){var r=Gca(regeneratorRuntime.mark(function r(e){var a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=new zca(e),r.abrupt("return",{throttleTime:a.readInt32(),topicErrors:a.readArray(Dca).sort(Cca)});case 2:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();yca={decode:Eca,parse:Bca}}var Ica={},Cw={0:function(e){var o=e.topics,r=e.timeout,s=(Wba(),Oba),t=(eca(),Xba);return{request:s({topics:o,timeout:r}),response:t}},1:function(e){var o=e.topics,r=e.validateOnly,s=e.timeout,t=(vw(),tw),i=(Aw(),ww);return{request:t({topics:o,validateOnly:r,timeout:s}),response:i}},2:function(e){var o=e.topics,r=e.validateOnly,s=e.timeout,t=(xca(),uca),i=(Hca(),yca);return{request:t({topics:o,validateOnly:r,timeout:s}),response:i}}};Ica={versions:Object.keys(Cw),protocol:function(e){var o=e.version;return Cw[o]}};var Dw,Jca,Kca,Lca,Mca=false;function Ew(r,e,t,n,a,c,o){try{var $=r[c](o),i=$.value}catch(u){return void t(u)}$.done?e(i):Promise.resolve(i).then(n,a)}function Nca(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var c=r.apply(e,t);function o(r){Ew(c,n,a,o,$,"next",r)}function $(r){Ew(c,n,a,o,$,"throw",r)}o(void 0)})}}function Fw(){if(Mca)return;Mca=true;Dw={};Jca=(h(),g);Kca=(k(),j);Lca=Kca.DeleteTopics;Dw=function(r){var e=r.topics,t=r.timeout,n=void 0===t?5e3:t;return{apiKey:Lca,apiVersion:0,apiName:"DeleteTopics",encode:function(){var r=Nca(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Jca().writeArray(e).writeInt32(n));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}}}var Gw,Oca,Hw,Pca,Qca,Rca,Sca,Tca,Uca,Vca=false;function Iw(r,e,a,t,o,n,$){try{var p=r[n]($),***.value}catch(i){return void a(i)}p.done?e(c):Promise.resolve(c).then(t,o)}function Jw(r){return function(){var e=this,a=arguments;return new Promise(function(t,o){var n=r.apply(e,a);function $(r){Iw(n,t,o,$,p,"next",r)}function p(r){Iw(n,t,o,$,p,"throw",r)}$(void 0)})}}function Kw(){if(Vca)return;Vca=true;Gw={};Oca=(d(),c);Hw=(u(),t);Pca=Hw.failure;Qca=Hw.createErrorFromCode;Rca=function(r,e){return r.topic.localeCompare(e.topic)};Sca=function(r){return{topic:r.readString(),errorCode:r.readInt16()}};Tca=function(){var r=Jw(regeneratorRuntime.mark(function r(e){var a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=new Oca(e),r.abrupt("return",{topicErrors:a.readArray(Sca).sort(Rca)});case 2:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Uca=function(){var r=Jw(regeneratorRuntime.mark(function r(e){var a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!((a=e.topicErrors.filter(function(r){var e=r.errorCode;return Pca(e)})).length>0)){r.next=3;break}throw Qca(a[0].errorCode);case 3:return r.abrupt("return",e);case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Gw={decode:Tca,parse:Uca}}var Wca,Xca,Yca=false;function Zca(){if(Yca)return;Yca=true;Wca={};Xca=(Fw(),Dw);Wca=function(e){var r=e.topics,t=e.timeout;return Object.assign(Xca({topics:r,timeout:t}),{apiVersion:1})}}var $ca,_ca,ada,bda,cda,dda,eda,fda=false;function Lw(r,e,a,t,n,o,$){try{var **r[o]($),c=i.value}catch(p){return void a(p)}i.done?e(c):Promise.resolve(c).then(t,n)}function gda(r){return function(){var e=this,a=arguments;return new Promise(function(t,n){var o=r.apply(e,a);function $(r){Lw(o,t,n,$,i,"next",r)}function i(r){Lw(o,t,n,$,i,"throw",r)}$(void 0)})}}function hda(){if(fda)return;fda=true;$ca={};_ca=(d(),c);ada=(Kw(),Gw);bda=ada.parse;cda=function(r,e){return r.topic.localeCompare(e.topic)};dda=function(r){return{topic:r.readString(),errorCode:r.readInt16()}};eda=function(){var r=gda(regeneratorRuntime.mark(function r(e){var a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=new _ca(e),r.abrupt("return",{throttleTime:a.readInt32(),topicErrors:a.readArray(dda).sort(cda)});case 2:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();$ca={decode:eda,parse:bda}}var ida={},Mw={0:function(r){var e=r.topics,s=r.timeout,t=(Fw(),Dw),o=(Kw(),Gw);return{request:t({topics:e,timeout:s}),response:o}},1:function(r){var e=r.topics,s=r.timeout,t=(Zca(),Wca),o=(hda(),$ca);return{request:t({topics:e,timeout:s}),response:o}}};ida={versions:Object.keys(Mw),protocol:function(r){var e=r.version;return Mw[e]}};var jda,kda,lda,mda,nda=false;function Nw(r,e,n,t,a,o,$){try{var **r[o]($),c=i.value}catch(u){return void n(u)}i.done?e(c):Promise.resolve(c).then(t,a)}function oda(r){return function(){var e=this,n=arguments;return new Promise(function(t,a){var o=r.apply(e,n);function $(r){Nw(o,t,a,$,i,"next",r)}function i(r){Nw(o,t,a,$,i,"throw",r)}$(void 0)})}}function pda(){if(nda)return;nda=true;jda={};kda=(h(),g);lda=(k(),j);mda=lda.InitProducerId;jda=function(r){var e=r.transactionalId,n=r.transactionTimeout;return{apiKey:mda,apiVersion:0,apiName:"InitProducerId",encode:function(){var r=oda(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new kda().writeString(e).writeInt32(n));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}}}var qda,rda,Ol,sda,tda,uda,vda,wda,xda=false;function Ow(r,e,t,a,n,o,u){try{var $=r[o](u),f=$.value}catch(c){return void t(c)}$.done?e(f):Promise.resolve(f).then(a,n)}function Pw(r){return function(){var e=this,t=arguments;return new Promise(function(a,n){var o=r.apply(e,t);function u(r){Ow(o,a,n,u,$,"next",r)}function $(r){Ow(o,a,n,u,$,"throw",r)}u(void 0)})}}function yda(){if(xda)return;xda=true;qda={};rda=(d(),c);Ol=(u(),t);sda=Ol.failure;tda=Ol.createErrorFromCode;uda=Ol.failIfVersionNotSupported;vda=function(){var r=Pw(regeneratorRuntime.mark(function r(e){var t,a,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=new rda(e),a=t.readInt32(),n=t.readInt16(),uda(n),r.abrupt("return",{throttleTime:a,errorCode:n,producerId:t.readInt64().toString(),producerEpoch:t.readInt16()});case 5:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();wda=function(){var r=Pw(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!sda(e.errorCode)){r.next=2;break}throw tda(e.errorCode);case 2:return r.abrupt("return",e);case 3:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();qda={decode:vda,parse:wda}}var zda={},Qw={0:function(r){var e=r.transactionalId,s=r.transactionTimeout,n=void 0===s?5e3:s,o=(pda(),jda),t=(yda(),qda);return{request:o({transactionalId:e,transactionTimeout:n}),response:t}}};zda={versions:Object.keys(Qw),protocol:function(r){var e=r.version;return Qw[e]}};var Ada,Pl,Bda,Cda,Dda,Eda,Fda=false;function Rw(r,t,e,n,a,o,$){try{var **r[o]($),c=i.value}catch(u){return void e(u)}i.done?t(c):Promise.resolve(c).then(n,a)}function Gda(r){return function(){var t=this,e=arguments;return new Promise(function(n,a){var o=r.apply(t,e);function $(r){Rw(o,n,a,$,i,"next",r)}function i(r){Rw(o,n,a,$,i,"throw",r)}$(void 0)})}}function Hda(){if(Fda)return;Fda=true;Ada={};Pl=(h(),g);Bda=(k(),j);Cda=Bda.AddPartitionsToTxn;Ada=function(r){var t=r.transactionalId,e=r.producerId,n=r.producerEpoch,a=r.topics;return{apiKey:Cda,apiVersion:0,apiName:"AddPartitionsToTxn",encode:function(){var r=Gda(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Pl().writeString(t).writeInt64(e).writeInt16(n).writeArray(a.map(Dda)));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};Dda=function(r){var t=r.topic,e=r.partitions;return new Pl().writeString(t).writeArray(e.map(Eda))};Eda=function(r){return new Pl().writeInt32(r)}}var Ida,Jda,Sw,Kda,Lda,Mda,Nda,Oda,Pda,Qda=false;function Tw(r,e,t,n,a,o,i){try{var $=r[o](i),v=$.value}catch(u){return void t(u)}$.done?e(v):Promise.resolve(v).then(n,a)}function Ql(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var o=r.apply(e,t);function i(r){Tw(o,n,a,i,$,"next",r)}function $(r){Tw(o,n,a,i,$,"throw",r)}i(void 0)})}}function Rda(){if(Qda)return;Qda=true;Ida={};Jda=(d(),c);Sw=(u(),t);Kda=Sw.failure;Lda=Sw.createErrorFromCode;Mda=function(){var r=Ql(regeneratorRuntime.mark(function r(e){var t,n,a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=new Jda(e),n=t.readInt32(),r.next=4,t.readArrayAsync(Nda);case 4:return a=r.sent,r.abrupt("return",{throttleTime:n,errors:a});case 6:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Nda=function(){var r=Ql(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=e.readString(),r.next=3,e.readArrayAsync(Oda);case 3:return r.t1=r.sent,r.abrupt("return",{topic:r.t0,partitionErrors:r.t1});case 5:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Oda=function(r){return{partition:r.readInt32(),errorCode:r.readInt16()}};Pda=function(){var r=Ql(regeneratorRuntime.mark(function r(e){var t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!((t=e.errors.map(function(r){return{partitionsWithErrors:r.partitionErrors.filter(function(r){var e=r.errorCode;return Kda(e)})}}).filter(function(r){return r.partitionsWithErrors.length})).length>0)){r.next=3;break}throw Lda(t[0].partitionsWithErrors[0].errorCode);case 3:return r.abrupt("return",e);case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Ida={decode:Mda,parse:Pda}}var Sda={},Uw={0:function(r){var e=r.transactionalId,o=r.producerId,t=r.producerEpoch,s=r.topics,n=(Hda(),Ada),$=(Rda(),Ida);return{request:n({transactionalId:e,producerId:o,producerEpoch:t,topics:s}),response:$}}};Sda={versions:Object.keys(Uw),protocol:function(r){var e=r.version;return Uw[e]}};var Tda,Uda,Vda,Wda,Xda=false;function Vw(r,e,n,t,a,o,$){try{var **r[o]($),c=i.value}catch(u){return void n(u)}i.done?e(c):Promise.resolve(c).then(t,a)}function Yda(r){return function(){var e=this,n=arguments;return new Promise(function(t,a){var o=r.apply(e,n);function $(r){Vw(o,t,a,$,i,"next",r)}function i(r){Vw(o,t,a,$,i,"throw",r)}$(void 0)})}}function Zda(){if(Xda)return;Xda=true;Tda={};Uda=(h(),g);Vda=(k(),j);Wda=Vda.AddOffsetsToTxn;Tda=function(r){var e=r.transactionalId,n=r.producerId,t=r.producerEpoch,a=r.groupId;return{apiKey:Wda,apiVersion:0,apiName:"AddOffsetsToTxn",encode:function(){var r=Yda(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Uda().writeString(e).writeInt64(n).writeInt16(t).writeString(a));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}}}var $da,_da,Rl,aea,bea,cea,dea,eea,fea=false;function Ww(r,e,a,t,n,$,o){try{var c=r[$](o),u=c.value}catch(i){return void a(i)}c.done?e(u):Promise.resolve(u).then(t,n)}function Xw(r){return function(){var e=this,a=arguments;return new Promise(function(t,n){var $=r.apply(e,a);function o(r){Ww($,t,n,o,c,"next",r)}function c(r){Ww($,t,n,o,c,"throw",r)}o(void 0)})}}function gea(){if(fea)return;fea=true;$da={};_da=(d(),c);Rl=(u(),t);aea=Rl.failure;bea=Rl.createErrorFromCode;cea=Rl.failIfVersionNotSupported;dea=function(){var r=Xw(regeneratorRuntime.mark(function r(e){var a,t,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=new _da(e),t=a.readInt32(),n=a.readInt16(),cea(n),r.abrupt("return",{throttleTime:t,errorCode:n});case 5:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();eea=function(){var r=Xw(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!aea(e.errorCode)){r.next=2;break}throw bea(e.errorCode);case 2:return r.abrupt("return",e);case 3:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();$da={decode:dea,parse:eea}}var hea={},Yw={0:function(r){var e=r.transactionalId,o=r.producerId,u=r.producerEpoch,s=r.groupId,n=(Zda(),Tda),$=(gea(),$da);return{request:n({transactionalId:e,producerId:o,producerEpoch:u,groupId:s}),response:$}}};hea={versions:Object.keys(Yw),protocol:function(r){var e=r.version;return Yw[e]}};var iea,jea,kea,lea,mea=false;function Zw(r,e,n,t,a,o,$){try{var **r[o]($),c=i.value}catch(u){return void n(u)}i.done?e(c):Promise.resolve(c).then(t,a)}function nea(r){return function(){var e=this,n=arguments;return new Promise(function(t,a){var o=r.apply(e,n);function $(r){Zw(o,t,a,$,i,"next",r)}function i(r){Zw(o,t,a,$,i,"throw",r)}$(void 0)})}}function oea(){if(mea)return;mea=true;iea={};jea=(h(),g);kea=(k(),j);lea=kea.EndTxn;iea=function(r){var e=r.transactionalId,n=r.producerId,t=r.producerEpoch,a=r.transactionResult;return{apiKey:lea,apiVersion:0,apiName:"EndTxn",encode:function(){var r=nea(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new jea().writeString(e).writeInt64(n).writeInt16(t).writeBoolean(a));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}}}var pea,qea,Sl,rea,sea,tea,uea,vea,wea=false;function $w(r,e,t,a,n,$,o){try{var c=r[$](o),u=c.value}catch(i){return void t(i)}c.done?e(u):Promise.resolve(u).then(a,n)}function _w(r){return function(){var e=this,t=arguments;return new Promise(function(a,n){var $=r.apply(e,t);function o(r){$w($,a,n,o,c,"next",r)}function c(r){$w($,a,n,o,c,"throw",r)}o(void 0)})}}function xea(){if(wea)return;wea=true;pea={};qea=(d(),c);Sl=(u(),t);rea=Sl.failure;sea=Sl.createErrorFromCode;tea=Sl.failIfVersionNotSupported;uea=function(){var r=_w(regeneratorRuntime.mark(function r(e){var t,a,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=new qea(e),a=t.readInt32(),n=t.readInt16(),tea(n),r.abrupt("return",{throttleTime:a,errorCode:n});case 5:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();vea=function(){var r=_w(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!rea(e.errorCode)){r.next=2;break}throw sea(e.errorCode);case 2:return r.abrupt("return",e);case 3:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();pea={decode:uea,parse:vea}}var yea={},ax={0:function(r){var e=r.transactionalId,o=r.producerId,s=r.producerEpoch,n=r.transactionResult,t=(oea(),iea),a=(xea(),pea);return{request:t({transactionalId:e,producerId:o,producerEpoch:s,transactionResult:n}),response:a}}};yea={versions:Object.keys(ax),protocol:function(r){var e=r.version;return ax[e]}};var zea,Tl,Aea,Bea,Cea,Dea,Eea=false;function bx(r,e,n,t,a,i,o){try{var $=r[i](o),c=$.value}catch(f){return void n(f)}$.done?e(c):Promise.resolve(c).then(t,a)}function Fea(r){return function(){var e=this,n=arguments;return new Promise(function(t,a){var **r.apply(e,n);function o(r){bx(i,t,a,o,$,"next",r)}function $(r){bx(i,t,a,o,$,"throw",r)}o(void 0)})}}function Gea(){if(Eea)return;Eea=true;zea={};Tl=(h(),g);Aea=(k(),j);Bea=Aea.TxnOffsetCommit;zea=function(r){var e=r.transactionalId,n=r.groupId,t=r.producerId,a=r.producerEpoch,**r.topics;return{apiKey:Bea,apiVersion:0,apiName:"TxnOffsetCommit",encode:function(){var r=Fea(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Tl().writeString(e).writeString(n).writeInt64(t).writeInt16(a).writeArray(i.map(Cea)));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};Cea=function(r){var e=r.topic,n=r.partitions;return new Tl().writeString(e).writeArray(n.map(Dea))};Dea=function(r){var e=r.partition,n=r.offset,t=r.metadata;return new Tl().writeInt32(e).writeInt64(n).writeString(t)}}var Hea,Iea,cx,Jea,Kea,Lea,Mea,Nea,Oea,Pea=false;function dx(r,e,t,n,a,o,$){try{var **r[o]($),c=i.value}catch(u){return void t(u)}i.done?e(c):Promise.resolve(c).then(n,a)}function Ul(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var o=r.apply(e,t);function $(r){dx(o,n,a,$,i,"next",r)}function i(r){dx(o,n,a,$,i,"throw",r)}$(void 0)})}}function Qea(){if(Pea)return;Pea=true;Hea={};Iea=(d(),c);cx=(u(),t);Jea=cx.failure;Kea=cx.createErrorFromCode;Lea=function(){var r=Ul(regeneratorRuntime.mark(function r(e){var t,n,a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=new Iea(e),n=t.readInt32(),r.next=4,t.readArrayAsync(Mea);case 4:return a=r.sent,r.abrupt("return",{throttleTime:n,topics:a});case 6:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Mea=function(){var r=Ul(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=e.readString(),r.next=3,e.readArrayAsync(Nea);case 3:return r.t1=r.sent,r.abrupt("return",{topic:r.t0,partitions:r.t1});case 5:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Nea=function(r){return{partition:r.readInt32(),errorCode:r.readInt16()}};Oea=function(){var r=Ul(regeneratorRuntime.mark(function r(e){var t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!((t=e.topics.map(function(r){return{partitionsWithErrors:r.partitions.filter(function(r){var e=r.errorCode;return Jea(e)})}}).filter(function(r){return r.partitionsWithErrors.length})).length>0)){r.next=3;break}throw Kea(t[0].partitionsWithErrors[0].errorCode);case 3:return r.abrupt("return",e);case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Hea={decode:Lea,parse:Oea}}var Rea={},ex={0:function(r){var e=r.transactionalId,o=r.groupId,s=r.producerId,d=r.producerEpoch,n=r.topics,p=(Gea(),zea),$=(Qea(),Hea);return{request:p({transactionalId:e,groupId:o,producerId:s,producerEpoch:d,topics:n}),response:$}}};Rea={versions:Object.keys(ex),protocol:function(r){var e=r.version;return ex[e]}};var Sea,fx,Tea,Uea,Vea,Wea=false;function gx(r,e,n,a,t,$,o){try{var s=r[$](o),**s.value}catch(c){return void n(c)}s.done?e(i):Promise.resolve(i).then(a,t)}function Xea(r){return function(){var e=this,n=arguments;return new Promise(function(a,t){var $=r.apply(e,n);function o(r){gx($,a,t,o,s,"next",r)}function s(r){gx($,a,t,o,s,"throw",r)}o(void 0)})}}function Yea(){if(Wea)return;Wea=true;Sea={};fx=(h(),g);Tea=(k(),j);Uea=Tea.DescribeConfigs;Sea=function(r){var e=r.resources;return{apiKey:Uea,apiVersion:0,apiName:"DescribeConfigs",encode:function(){var r=Xea(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new fx().writeArray(e.map(Vea)));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};Vea=function(r){var e=r.type,n=r.name,a=r.configNames,t=void 0===a?[]:a;return new fx().writeInt8(e).writeString(n).writeNullableArray(t)}}var hx,Zea,ix,$ea,_ea,afa,bfa,cfa,dfa,efa=false;function jx(r,e,n,a,t,o,c){try{var $=r[o](c),u=$.value}catch(i){return void n(i)}$.done?e(u):Promise.resolve(u).then(a,t)}function kx(r){return function(){var e=this,n=arguments;return new Promise(function(a,t){var o=r.apply(e,n);function c(r){jx(o,a,t,c,$,"next",r)}function $(r){jx(o,a,t,c,$,"throw",r)}c(void 0)})}}function lx(){if(efa)return;efa=true;hx={};Zea=(d(),c);ix=(u(),t);$ea=ix.failure;_ea=ix.createErrorFromCode;afa=function(r){return{configName:r.readString(),configValue:r.readString(),readOnly:r.readBoolean(),isDefault:r.readBoolean(),isSensitive:r.readBoolean()}};bfa=function(r){return{errorCode:r.readInt16(),errorMessage:r.readString(),resourceType:r.readInt8(),resourceName:r.readString(),configEntries:r.readArray(afa)}};cfa=function(){var r=kx(regeneratorRuntime.mark(function r(e){var n,a,t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n=new Zea(e),a=n.readInt32(),t=n.readArray(bfa),r.abrupt("return",{throttleTime:a,resources:t});case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();dfa=function(){var r=kx(regeneratorRuntime.mark(function r(e){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!((n=e.resources.filter(function(r){var e=r.errorCode;return $ea(e)})).length>0)){r.next=3;break}throw _ea(n[0].errorCode);case 3:return r.abrupt("return",e);case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();hx={decode:cfa,parse:dfa}}var ffa,mx,gfa,hfa,ifa,jfa=false;function nx(r,e,n,o,a,t,$){try{var **r[t]($),c=i.value}catch(u){return void n(u)}i.done?e(c):Promise.resolve(c).then(o,a)}function kfa(r){return function(){var e=this,n=arguments;return new Promise(function(o,a){var t=r.apply(e,n);function $(r){nx(t,o,a,$,i,"next",r)}function i(r){nx(t,o,a,$,i,"throw",r)}$(void 0)})}}function lfa(){if(jfa)return;jfa=true;ffa={};mx=(h(),g);gfa=(k(),j);hfa=gfa.DescribeConfigs;ffa=function(r){var e=r.resources,n=r.includeSynonyms,o=void 0!==n&&n;return{apiKey:hfa,apiVersion:1,apiName:"DescribeConfigs",encode:function(){var r=kfa(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new mx().writeArray(e.map(ifa)).writeBoolean(o));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};ifa=function(r){var e=r.type,n=r.name,o=r.configNames,a=void 0===o?[]:o;return new mx().writeInt8(e).writeString(n).writeNullableArray(a)}}var mfa,nfa,ofa,pfa,qfa,rfa,sfa,tfa,ufa=false;function ox(r,e,n,a,o,t,$){try{var c=r[t]($),**c.value}catch(d){return void n(d)}c.done?e(i):Promise.resolve(i).then(a,o)}function vfa(r){return function(){var e=this,n=arguments;return new Promise(function(a,o){var t=r.apply(e,n);function $(r){ox(t,a,o,$,c,"next",r)}function c(r){ox(t,a,o,$,c,"throw",r)}$(void 0)})}}function wfa(){if(ufa)return;ufa=true;mfa={};nfa=(d(),c);ofa=(lx(),hx);pfa=ofa.parse;qfa=function(r){return{configName:r.readString(),configValue:r.readString(),configSource:r.readInt8()}};rfa=function(r){return{configName:r.readString(),configValue:r.readString(),readOnly:r.readBoolean(),isDefault:r.readBoolean(),isSensitive:r.readBoolean(),configSynonyms:r.readArray(qfa)}};sfa=function(r){return{errorCode:r.readInt16(),errorMessage:r.readString(),resourceType:r.readInt8(),resourceName:r.readString(),configEntries:r.readArray(rfa)}};tfa=function(){var r=vfa(regeneratorRuntime.mark(function r(e){var n,a,o;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n=new nfa(e),a=n.readInt32(),o=n.readArray(sfa),r.abrupt("return",{throttleTime:a,resources:o});case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();mfa={decode:tfa,parse:pfa}}var xfa={},px={0:function(e){var r=e.resources,s=(Yea(),Sea),n=(lx(),hx);return{request:s({resources:r}),response:n}},1:function(e){var r=e.resources,s=e.includeSynonyms,n=(lfa(),ffa),o=(wfa(),mfa);return{request:n({resources:r,includeSynonyms:s}),response:o}}};xfa={versions:Object.keys(px),protocol:function(e){var r=e.version;return px[r]}};var yfa,Vl,zfa,Afa,Bfa,Cfa,Dfa=false;function qx(r,e,n,a,t,$,o){try{var **r[$](o),c=i.value}catch(u){return void n(u)}i.done?e(c):Promise.resolve(c).then(a,t)}function Efa(r){return function(){var e=this,n=arguments;return new Promise(function(a,t){var $=r.apply(e,n);function o(r){qx($,a,t,o,i,"next",r)}function i(r){qx($,a,t,o,i,"throw",r)}o(void 0)})}}function Ffa(){if(Dfa)return;Dfa=true;yfa={};Vl=(h(),g);zfa=(k(),j);Afa=zfa.AlterConfigs;yfa=function(r){var e=r.resources,n=r.validateOnly,a=void 0!==n&&n;return{apiKey:Afa,apiVersion:0,apiName:"AlterConfigs",encode:function(){var r=Efa(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Vl().writeArray(e.map(Bfa)).writeBoolean(a));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};Bfa=function(r){var e=r.type,n=r.name,a=r.configEntries;return new Vl().writeInt8(e).writeString(n).writeArray(a.map(Cfa))};Cfa=function(r){var e=r.name,n=r.value;return new Vl().writeString(e).writeString(n)}}var Gfa,Hfa,rx,Ifa,Jfa,Kfa,Lfa,Mfa,Nfa=false;function sx(r,e,o,a,n,t,$){try{var u=r[t]($),c=u.value}catch(i){return void o(i)}u.done?e(c):Promise.resolve(c).then(a,n)}function tx(r){return function(){var e=this,o=arguments;return new Promise(function(a,n){var t=r.apply(e,o);function $(r){sx(t,a,n,$,u,"next",r)}function u(r){sx(t,a,n,$,u,"throw",r)}$(void 0)})}}function Ofa(){if(Nfa)return;Nfa=true;Gfa={};Hfa=(d(),c);rx=(u(),t);Ifa=rx.failure;Jfa=rx.createErrorFromCode;Kfa=function(r){return{errorCode:r.readInt16(),errorMessage:r.readString(),resourceType:r.readInt8(),resourceName:r.readString()}};Lfa=function(){var r=tx(regeneratorRuntime.mark(function r(e){var o,a,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return o=new Hfa(e),a=o.readInt32(),n=o.readArray(Kfa),r.abrupt("return",{throttleTime:a,resources:n});case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Mfa=function(){var r=tx(regeneratorRuntime.mark(function r(e){var o;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!((o=e.resources.filter(function(r){var e=r.errorCode;return Ifa(e)})).length>0)){r.next=3;break}throw Jfa(o[0].errorCode);case 3:return r.abrupt("return",e);case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();Gfa={decode:Lfa,parse:Mfa}}var Pfa={},ux={0:function(e){var r=e.resources,s=e.validateOnly,$=(Ffa(),yfa),o=(Ofa(),Gfa);return{request:$({resources:r,validateOnly:s}),response:o}}};Pfa={versions:Object.keys(ux),protocol:function(e){var r=e.version;return ux[r]}};var vx,Qfa,Rfa,Sfa,Tfa=false;function wx(e,r,n,t,a,o,i){try{var $=e[o](i),u=$.value}catch(c){return void n(c)}$.done?r(u):Promise.resolve(u).then(t,a)}function Ufa(e){return function(){var r=this,n=arguments;return new Promise(function(t,a){var o=e.apply(r,n);function i(e){wx(o,t,a,i,$,"next",e)}function $(e){wx(o,t,a,i,$,"throw",e)}i(void 0)})}}function xx(){if(Tfa)return;Tfa=true;vx={};Qfa=(h(),g);Rfa=(k(),j);Sfa=Rfa.SaslAuthenticate;vx=function(e){var r=e.authBytes;return{apiKey:Sfa,apiVersion:0,apiName:"SaslAuthenticate",encode:function(){var e=Ufa(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Qfa().writeBuffer(r));case 1:case"end":return e.stop();}},e)}));return function(){return e.apply(this,arguments)}}()}}}var yx,Vfa,Wfa,Xh,Xfa,Yfa,Zfa,$fa,_fa,aga,zx,bga,cga,dga,ega=false;function Ax(r,e){var n=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),n.push.apply(n,o)}return n}function fga(r){for(var e=1;ePga)throw new RangeError("requested too many random bytes");var e=Qga.allocUnsafe(r);if(r>0)if(r>Wl)for(var o=0;o=this._blockSize;){for(var a=this._blockOffset;a0;++s)this._length[s]+=i,(**this._length[s]/4294967296|0)>0&&(this._length[s]-=4294967296*i);return this},Sc.prototype._update=function(){throw new Error("_update is not implemented")},Sc.prototype.digest=function(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==r&&(t=t.toString(r)),this._block.fill(0),this._blockOffset=0;for(var e=0;e<4;++e)this._length[e]=0;return t},Sc.prototype._digest=function(){throw new Error("_digest is not implemented")},Qx=Sc}var Xl,Xga,Tx,Yga,Zga,$ga=false;function _h(){Tx.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}function ai($,f){return $<>>32-f}function ra($,f,e,h,r,a,n){return ai($+(f&e|~f&h)+r+a|0,n)+f|0}function sa($,f,e,h,r,a,n){return ai($+(f&h|e&~h)+r+a|0,n)+f|0}function ta($,f,e,h,r,a,n){return ai($+(f^e^h)+r+a|0,n)+f|0}function ua($,f,e,h,r,a,n){return ai($+(e^(f|~h))+r+a|0,n)+f|0}function Yl(){if($ga)return;$ga=true;Xl={};Xga=(p(),o);Tx=(Sx(),Qx);Yga=(q(),m).Buffer;Zga=new Array(16);Xga(_h,Tx),_h.prototype._update=function(){for(var $=Zga,f=0;f<16;++f)$[f]=this._block.readInt32LE(4*f);var e=this._a,h=this._b,r=this._c,a=this._d;e=ra(e,h,r,a,$[0],3614090360,7),a=ra(a,e,h,r,$[1],3905402710,12),r=ra(r,a,e,h,$[2],606105819,17),h=ra(h,r,a,e,$[3],3250441966,22),e=ra(e,h,r,a,$[4],4118548399,7),a=ra(a,e,h,r,$[5],1200080426,12),r=ra(r,a,e,h,$[6],2821735955,17),h=ra(h,r,a,e,$[7],4249261313,22),e=ra(e,h,r,a,$[8],1770035416,7),a=ra(a,e,h,r,$[9],2336552879,12),r=ra(r,a,e,h,$[10],4294925233,17),h=ra(h,r,a,e,$[11],2304563134,22),e=ra(e,h,r,a,$[12],1804603682,7),a=ra(a,e,h,r,$[13],4254626195,12),r=ra(r,a,e,h,$[14],2792965006,17),e=sa(e,h=ra(h,r,a,e,$[15],1236535329,22),r,a,$[1],4129170786,5),a=sa(a,e,h,r,$[6],3225465664,9),r=sa(r,a,e,h,$[11],643717713,14),h=sa(h,r,a,e,$[0],3921069994,20),e=sa(e,h,r,a,$[5],3593408605,5),a=sa(a,e,h,r,$[10],38016083,9),r=sa(r,a,e,h,$[15],3634488961,14),h=sa(h,r,a,e,$[4],3889429448,20),e=sa(e,h,r,a,$[9],568446438,5),a=sa(a,e,h,r,$[14],3275163606,9),r=sa(r,a,e,h,$[3],4107603335,14),h=sa(h,r,a,e,$[8],1163531501,20),e=sa(e,h,r,a,$[13],2850285829,5),a=sa(a,e,h,r,$[2],4243563512,9),r=sa(r,a,e,h,$[7],1735328473,14),e=ta(e,h=sa(h,r,a,e,$[12],2368359562,20),r,a,$[5],4294588738,4),a=ta(a,e,h,r,$[8],2272392833,11),r=ta(r,a,e,h,$[11],1839030562,16),h=ta(h,r,a,e,$[14],4259657740,23),e=ta(e,h,r,a,$[1],2763975236,4),a=ta(a,e,h,r,$[4],1272893353,11),r=ta(r,a,e,h,$[7],4139469664,16),h=ta(h,r,a,e,$[10],3200236656,23),e=ta(e,h,r,a,$[13],681279174,4),a=ta(a,e,h,r,$[0],3936430074,11),r=ta(r,a,e,h,$[3],3572445317,16),h=ta(h,r,a,e,$[6],76029189,23),e=ta(e,h,r,a,$[9],3654602809,4),a=ta(a,e,h,r,$[12],3873151461,11),r=ta(r,a,e,h,$[15],530742520,16),e=ua(e,h=ta(h,r,a,e,$[2],3299628645,23),r,a,$[0],4096336452,6),a=ua(a,e,h,r,$[7],1126891415,10),r=ua(r,a,e,h,$[14],2878612391,15),h=ua(h,r,a,e,$[5],4237533241,21),e=ua(e,h,r,a,$[12],1700485571,6),a=ua(a,e,h,r,$[3],2399980690,10),r=ua(r,a,e,h,$[10],4293915773,15),h=ua(h,r,a,e,$[1],2240044497,21),e=ua(e,h,r,a,$[8],1873313359,6),a=ua(a,e,h,r,$[15],4264355552,10),r=ua(r,a,e,h,$[6],2734768916,15),h=ua(h,r,a,e,$[13],1309151649,21),e=ua(e,h,r,a,$[4],4149444226,6),a=ua(a,e,h,r,$[11],3174756917,10),r=ua(r,a,e,h,$[2],718787259,15),h=ua(h,r,a,e,$[9],3951481745,21),this._a=this._a+e|0,this._b=this._b+h|0,this._c=this._c+r|0,this._d=this._d+a|0},_h.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 $=Yga.allocUnsafe(16);return $.writeInt32LE(this._a,0),$.writeInt32LE(this._b,4),$.writeInt32LE(this._c,8),$.writeInt32LE(this._d,12),$},Xl=_h}var Zl,$l,_ga,Ux,aha,Lf,Mf,Nf,Of,Pf,Qf,bha=false;function bi(){Ux.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}function Hd($,r){return $<>>32-r}function Vx($,r,l,a,t,x,v,G){return Hd($+(r^l^a)+x+v|0,G)+t|0}function Wx($,r,l,a,t,x,v,G){return Hd($+(r&l|~r&a)+x+v|0,G)+t|0}function Xx($,r,l,a,t,x,v,G){return Hd($+((r|~l)^a)+x+v|0,G)+t|0}function Yx($,r,l,a,t,x,v,G){return Hd($+(r&a|l&~a)+x+v|0,G)+t|0}function Zx($,r,l,a,t,x,v,G){return Hd($+(r^(l|~a))+x+v|0,G)+t|0}function _l(){if(bha)return;bha=true;Zl={};$l=(z(),r).Buffer;_ga=(p(),o);Ux=(Sx(),Qx);aha=new Array(16);Lf=[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];Mf=[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];Nf=[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];Of=[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];Pf=[0,1518500249,1859775393,2400959708,2840853838];Qf=[1352829926,1548603684,1836072691,2053994217,0];_ga(bi,Ux),bi.prototype._update=function(){for(var $=aha,r=0;r<16;++r)$[r]=this._block.readInt32LE(4*r);for(var l=0|this._a,a=0|this._b,t=0|this._c,x=0|this._d,v=0|this._e,G=0|this._a,J=0|this._b,s=0|this._c,**0|this._d,h=0|this._e,e=0;e<80;e+=1){var n,f;e<16?(n=Vx(l,a,t,x,v,$[Lf[e]],Pf[0],Nf[e]),f=Zx(G,J,s,i,h,$[Mf[e]],Qf[0],Of[e])):e<32?(n=Wx(l,a,t,x,v,$[Lf[e]],Pf[1],Nf[e]),f=Yx(G,J,s,i,h,$[Mf[e]],Qf[1],Of[e])):e<48?(n=Xx(l,a,t,x,v,$[Lf[e]],Pf[2],Nf[e]),f=Xx(G,J,s,i,h,$[Mf[e]],Qf[2],Of[e])):e<64?(n=Yx(l,a,t,x,v,$[Lf[e]],Pf[3],Nf[e]),f=Wx(G,J,s,i,h,$[Mf[e]],Qf[3],Of[e])):(n=Zx(l,a,t,x,v,$[Lf[e]],Pf[4],Nf[e]),f=Vx(G,J,s,i,h,$[Mf[e]],Qf[4],Of[e])),l=v,v=x,x=Hd(t,10),t=a,a=n,G=h,h=i,**Hd(s,10),s=J,J=f}var _=this._b+t+i|0;this._b=this._c+x+h|0,this._c=this._d+v+G|0,this._d=this._e+l+J|0,this._e=this._a+a+s|0,this._a=_},bi.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 $=$l.alloc?$l.alloc(20):new $l(20);return $.writeInt32LE(this._a,0),$.writeInt32LE(this._b,4),$.writeInt32LE(this._c,8),$.writeInt32LE(this._d,12),$.writeInt32LE(this._e,16),$},Zl=bi}var Be,$x,cha=false;function ci(t,i){this._block=$x.alloc(t),this._finalSize=i,this._blockSize=t,this._len=0}function Ce(){if(cha)return;cha=true;Be={};$x=(q(),m).Buffer;ci.prototype.update=function(t,i){"string"==typeof t&&(**i||"utf8",t=$x.from(t,i));for(var e=this._block,l=this._blockSize,r=t.length,s=this._len,h=0;h=this._finalSize&&(this._update(this._block),this._block.fill(0));var e=8*this._len;if(e<=4294967295)this._block.writeUInt32BE(e,this._blockSize-4);else{var l=(4294967295&e)>>>0,r=(e-l)/4294967296;this._block.writeUInt32BE(r,this._blockSize-8),this._block.writeUInt32BE(l,this._blockSize-4)}this._update(this._block);var s=this._hash();return t?s.toString(t):s},ci.prototype._update=function(){throw new Error("_update must be implemented by subclass")},Be=ci}var dha,eha,_x,fha,gha,hha,iha=false;function Rf(){this.init(),this._w=hha,_x.call(this,64,56)}function jha($){return $<<5|$>>>27}function kha($){return $<<30|$>>>2}function lha($,r,t,i){return 0===$?r&t|~r&i:2===$?r&t|r&i|t&i:r^t^i}function mha(){if(iha)return;iha=true;dha={};eha=(p(),o);_x=(Ce(),Be);fha=(q(),m).Buffer;gha=[1518500249,1859775393,-1894007588,-899497514];hha=new Array(80);eha(Rf,_x),Rf.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Rf.prototype._update=function($){for(var r=this._w,t=0|this._a,**0|this._b,a=0|this._c,h=0|this._d,s=0|this._e,e=0;e<16;++e)r[e]=$.readInt32BE(4*e);for(;e<80;++e)r[e]=r[e-3]^r[e-8]^r[e-14]^r[e-16];for(var l=0;l<80;++l){var n=~~(l/20),K=jha(t)+lha(n,i,a,h)+s+r[l]+gha[n]|0;s=h,h=a,a=kha(i),**t,t=K}this._a=t+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=h+this._d|0,this._e=s+this._e|0},Rf.prototype._hash=function(){var $=fha.allocUnsafe(20);return $.writeInt32BE(0|this._a,0),$.writeInt32BE(0|this._b,4),$.writeInt32BE(0|this._c,8),$.writeInt32BE(0|this._d,12),$.writeInt32BE(0|this._e,16),$},dha=Rf}var nha,oha,ay,pha,qha,rha,sha=false;function Sf(){this.init(),this._w=rha,ay.call(this,64,56)}function tha($){return $<<1|$>>>31}function uha($){return $<<5|$>>>27}function vha($){return $<<30|$>>>2}function wha($,r,t,s){return 0===$?r&t|~r&s:2===$?r&t|r&s|t&s:r^t^s}function xha(){if(sha)return;sha=true;nha={};oha=(p(),o);ay=(Ce(),Be);pha=(q(),m).Buffer;qha=[1518500249,1859775393,-1894007588,-899497514];rha=new Array(80);oha(Sf,ay),Sf.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},Sf.prototype._update=function($){for(var r=this._w,t=0|this._a,s=0|this._b,a=0|this._c,**0|this._d,h=0|this._e,e=0;e<16;++e)r[e]=$.readInt32BE(4*e);for(;e<80;++e)r[e]=tha(r[e-3]^r[e-8]^r[e-14]^r[e-16]);for(var B=0;B<80;++B){var n=~~(B/20),v=uha(t)+wha(n,s,a,i)+h+r[B]+qha[n]|0;h=i,**a,a=vha(s),s=t,t=v}this._a=t+this._a|0,this._b=s+this._b|0,this._c=a+this._c|0,this._d=i+this._d|0,this._e=h+this._e|0},Sf.prototype._hash=function(){var $=pha.allocUnsafe(20);return $.writeInt32BE(0|this._a,0),$.writeInt32BE(0|this._b,4),$.writeInt32BE(0|this._c,8),$.writeInt32BE(0|this._d,12),$.writeInt32BE(0|this._e,16),$},nha=Sf}var by,yha,cy,zha,Aha,Bha,Cha=false;function Tf(){this.init(),this._w=Bha,cy.call(this,64,56)}function Dha($,t,r){return r^$&(t^r)}function Eha($,t,r){return $&t|r&($|t)}function Fha($){return($>>>2|$<<30)^($>>>13|$<<19)^($>>>22|$<<10)}function Gha($){return($>>>6|$<<26)^($>>>11|$<<21)^($>>>25|$<<7)}function Hha($){return($>>>7|$<<25)^($>>>18|$<<14)^$>>>3}function Iha($){return($>>>17|$<<15)^($>>>19|$<<13)^$>>>10}function dy(){if(Cha)return;Cha=true;by={};yha=(p(),o);cy=(Ce(),Be);zha=(q(),m).Buffer;Aha=[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];Bha=new Array(64);yha(Tf,cy),Tf.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},Tf.prototype._update=function($){for(var t=this._w,r=0|this._a,**0|this._b,a=0|this._c,h=0|this._d,s=0|this._e,e=0|this._f,n=0|this._g,_=0|this._h,y=0;y<16;++y)t[y]=$.readInt32BE(4*y);for(;y<64;++y)t[y]=Iha(t[y-2])+t[y-7]+Hha(t[y-15])+t[y-16]|0;for(var W=0;W<64;++W){var v=_+Gha(s)+Dha(s,e,n)+Aha[W]+t[W]|0,Q=Fha(r)+Eha(r,i,a)|0;_=n,n=e,e=s,s=h+v|0,h=a,a=i,**r,r=v+Q|0}this._a=r+this._a|0,this._b=i+this._b|0,this._c=a+this._c|0,this._d=h+this._d|0,this._e=s+this._e|0,this._f=e+this._f|0,this._g=n+this._g|0,this._h=_+this._h|0},Tf.prototype._hash=function(){var $=zha.allocUnsafe(32);return $.writeInt32BE(this._a,0),$.writeInt32BE(this._b,4),$.writeInt32BE(this._c,8),$.writeInt32BE(this._d,12),$.writeInt32BE(this._e,16),$.writeInt32BE(this._f,20),$.writeInt32BE(this._g,24),$.writeInt32BE(this._h,28),$},by=Tf}var Jha,Kha,Lha,Mha,Nha,Oha,Pha=false;function di(){this.init(),this._w=Oha,Mha.call(this,64,56)}function Qha(){if(Pha)return;Pha=true;Jha={};Kha=(p(),o);Lha=(dy(),by);Mha=(Ce(),Be);Nha=(q(),m).Buffer;Oha=new Array(64);Kha(di,Lha),di.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},di.prototype._hash=function(){var h=Nha.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},Jha=di}var ey,Rha,fy,Sha,gy,Tha,Uha=false;function Uf(){this.init(),this._w=Tha,fy.call(this,128,112)}function hy($,h,t){return t^$&(h^t)}function iy($,h,t){return $&h|t&($|h)}function jy($,h){return($>>>28|h<<4)^(h>>>2|$<<30)^(h>>>7|$<<25)}function ky($,h){return($>>>14|h<<18)^($>>>18|h<<14)^(h>>>9|$<<23)}function Vha($,h){return($>>>1|h<<31)^($>>>8|h<<24)^$>>>7}function Wha($,h){return($>>>1|h<<31)^($>>>8|h<<24)^($>>>7|h<<25)}function Xha($,h){return($>>>19|h<<13)^(h>>>29|$<<3)^$>>>6}function Yha($,h){return($>>>19|h<<13)^(h>>>29|$<<3)^($>>>6|h<<26)}function ha($,h){return $>>>0>>0?1:0}function ly(){if(Uha)return;Uha=true;ey={};Rha=(p(),o);fy=(Ce(),Be);Sha=(q(),m).Buffer;gy=[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];Tha=new Array(160);Rha(Uf,fy),Uf.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},Uf.prototype._update=function($){for(var h=this._w,t=0|this._ah,r=0|this._bh,a=0|this._ch,**0|this._dh,s=0|this._eh,c=0|this._fh,_=0|this._gh,e=0|this._hh,E=0|this._al,v=0|this._bl,F=0|this._cl,L=0|this._dl,l=0|this._el,n=0|this._fl,f=0|this._gl,g=0|this._hl,u=0;u<32;u+=2)h[u]=$.readInt32BE(4*u),h[u+1]=$.readInt32BE(4*u+4);for(;u<160;u+=2){var o=h[u-30],m=h[u-30+1],y=Vha(o,m),C=Wha(m,o),d=Xha(o=h[u-4],m=h[u-4+1]),b=Yha(m,o),p=h[u-14],G=h[u-14+1],B=h[u-32],S=h[u-32+1],w=C+G|0,**y+p+ha(w,C)|0;I=(**I+d+ha(w=w+b|0,b)|0)+B+ha(w=w+S|0,S)|0,h[u]=I,h[u+1]=w}for(var j=0;j<160;j+=2){**h[j],w=h[j+1];var q=iy(t,r,a),H=iy(E,v,F),K=jy(t,E),x=jy(E,t),W=ky(s,l),A=ky(l,s),U=gy[j],k=gy[j+1],z=hy(s,c,_),D=hy(l,n,f),J=g+A|0,M=e+W+ha(J,g)|0;M=(M=(M=M+z+ha(J=J+D|0,D)|0)+U+ha(J=J+k|0,k)|0)+I+ha(J=J+w|0,w)|0;var N=x+H|0,O=K+q+ha(N,x)|0;e=_,g=f,_=c,f=n,c=s,n=l,s=i+M+ha(l=L+J|0,L)|0,**a,L=F,a=r,F=v,r=t,v=E,t=M+O+ha(E=J+N|0,J)|0}this._al=this._al+E|0,this._bl=this._bl+v|0,this._cl=this._cl+F|0,this._dl=this._dl+L|0,this._el=this._el+l|0,this._fl=this._fl+n|0,this._gl=this._gl+f|0,this._hl=this._hl+g|0,this._ah=this._ah+t+ha(this._al,E)|0,this._bh=this._bh+r+ha(this._bl,v)|0,this._ch=this._ch+a+ha(this._cl,F)|0,this._dh=this._dh+i+ha(this._dl,L)|0,this._eh=this._eh+s+ha(this._el,l)|0,this._fh=this._fh+c+ha(this._fl,n)|0,this._gh=this._gh+_+ha(this._gl,f)|0,this._hh=this._hh+e+ha(this._hl,g)|0},Uf.prototype._hash=function(){var $=Sha.allocUnsafe(64);function h(h,t,r){$.writeInt32BE(h,r),$.writeInt32BE(t,r+4)}return h(this._ah,this._al,0),h(this._bh,this._bl,8),h(this._ch,this._cl,16),h(this._dh,this._dl,24),h(this._eh,this._el,32),h(this._fh,this._fl,40),h(this._gh,this._gl,48),h(this._hh,this._hl,56),$},ey=Uf}var Zha,$ha,_ha,aia,bia,cia,dia=false;function ei(){this.init(),this._w=cia,aia.call(this,128,112)}function eia(){if(dia)return;dia=true;Zha={};$ha=(p(),o);_ha=(ly(),ey);aia=(Ce(),Be);bia=(q(),m).Buffer;cia=new Array(160);$ha(ei,_ha),ei.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},ei.prototype._hash=function(){var h=bia.allocUnsafe(48);function $($,t,i){h.writeInt32BE($,i),h.writeInt32BE(t,i+4)}return $(this._ah,this._al,0),$(this._bh,this._bl,8),$(this._ch,this._cl,16),$(this._dh,this._dl,24),$(this._eh,this._el,32),$(this._fh,this._fl,40),h},Zha=ei}var am,Id,fia=false;function bm(){if(fia)return;fia=true;am={};Id=am=function(r){r=r.toLowerCase();var $=Id[r];if(!$)throw new Error(r+" is not supported (we accept pull requests)");return new $};Id.sha=(mha(),dha),Id.sha1=(xha(),nha),Id.sha224=(Qha(),Jha),Id.sha256=(dy(),by),Id.sha384=(eia(),Zha),Id.sha512=(ly(),ey)}var Tc,my,ny,gia,hia,iia=false;function vb(r){ny.call(this),this.hashMode="string"==typeof r,this.hashMode?this[r]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}function Uc(){if(iia)return;iia=true;Tc={};my=(q(),m).Buffer;ny=(kh(),jh).Transform;gia=(Zj(),fh).StringDecoder;hia=(p(),o);hia(vb,ny),vb.prototype.update=function(r,t,e){"string"==typeof r&&(r=my.from(r,t));var **this._update(r);return this.hashMode?this:(e&&(**this._toString(i,e)),i)},vb.prototype.setAutoPadding=function(){},vb.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},vb.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},vb.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},vb.prototype._transform=function(r,t,e){var i;try{this.hashMode?this._update(r):this.push(this._update(r))}catch(a){**a}finally{e(i)}},vb.prototype._flush=function(r){var t;try{this.push(this.__final())}catch(e){t=e}r(t)},vb.prototype._finalOrDigest=function(r){var t=this.__final()||my.alloc(0);return r&&(t=this._toString(t,r,!0)),t},vb.prototype._toString=function(r,t,e){if(this._decoder||(this._decoder=new gia(t),this._encoding=t),this._encoding!==t)throw new Error("can't switch encodings");var **this._decoder.write(r);return e&&(i+=this._decoder.end()),i},Tc=vb}var Vf,jia,kia,lia,mia,oy,nia=false;function fi($){oy.call(this,"digest"),this._hash=$}function Wf(){if(nia)return;nia=true;Vf={};jia=(p(),o);kia=(Yl(),Xl);lia=(_l(),Zl);mia=(bm(),am);oy=(Uc(),Tc);jia(fi,oy),fi.prototype._update=function($){this._hash.update($)},fi.prototype._final=function(){return this._hash.digest()},Vf=function($){return"md5"===($=$.toLowerCase())?new kia:"rmd160"===$||"ripemd160"===$?new lia:new fi(mia($))}}var oia,pia,Jd,py,qia,De,ria=false;function gi($,t){py.call(this,"digest"),"string"==typeof t&&(t=Jd.from(t)),this._alg=$,this._key=t,t.length>De?t=$(t):t.lengthr)?a=("rmd160"===$?new cm:dm($)).update(a).digest():a.lengthFia||f!=f)throw new TypeError("Bad key length")}}var zBa,ABa,Ay,BBa,Hia=false;function By(){if(Hia)return;Hia=true;Ay={};BBa=(ab(),_a);Ay=zBa="utf-8"}var Cy,Iia,Jia,Kia,Lia,Dy,wb,Mia,hi,Nia=false;function Ey($,r,a){var e=Oia($),n="sha512"===$||"sha384"===$?128:64;r.length>n?r=e(r):r.length>>0};Ta.readUInt32BE=$ia;_ia=function(r,$,t){r[0+t]=$>>>24,r[1+t]=$>>>16&255,r[2+t]=$>>>8&255,r[3+t]=255&$};Ta.writeUInt32BE=_ia;aja=function(r,$,t,e){for(var o=0,l=0,p=6;p>=0;p-=2){for(var a=0;a<=24;a+=8)o<<=1,o|=$>>>a+p&1;for(a=0;a<=24;a+=8)o<<=1,o|=r>>>a+p&1}for(p=6;p>=0;p-=2){for(a=1;a<=25;a+=8)l<<=1,l|=$>>>a+p&1;for(a=1;a<=25;a+=8)l<<=1,l|=r>>>a+p&1}t[e+0]=o>>>0,t[e+1]=l>>>0};Ta.ip=aja;bja=function(r,$,t,e){for(var o=0,l=0,p=0;p<4;p++)for(var a=24;a>=0;a-=8)o<<=1,o|=$>>>a+p&1,o<<=1,o|=r>>>a+p&1;for(p=4;p<8;p++)for(a=24;a>=0;a-=8)l<<=1,l|=$>>>a+p&1,l<<=1,l|=r>>>a+p&1;t[e+0]=o>>>0,t[e+1]=l>>>0};Ta.rip=bja;cja=function(r,$,t,e){for(var o=0,l=0,p=7;p>=5;p--){for(var a=0;a<=24;a+=8)o<<=1,o|=$>>a+p&1;for(a=0;a<=24;a+=8)o<<=1,o|=r>>a+p&1}for(a=0;a<=24;a+=8)o<<=1,o|=$>>a+p&1;for(p=1;p<=3;p++){for(a=0;a<=24;a+=8)l<<=1,l|=$>>a+p&1;for(a=0;a<=24;a+=8)l<<=1,l|=r>>a+p&1}for(a=0;a<=24;a+=8)l<<=1,l|=r>>a+p&1;t[e+0]=o>>>0,t[e+1]=l>>>0};Ta.pc1=cja;dja=function(r,$){return r<<$&268435455|r>>>28-$};Ta.r28shl=dja;ji=[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];eja=function(r,$,t,e){for(var o=0,l=0,p=ji.length>>>1,a=0;a>>ji[a]&1;for(a=p;a>>ji[a]&1;t[e+0]=o>>>0,t[e+1]=l>>>0};Ta.pc2=eja;fja=function(r,$,t){var e=0,o=0;e=(1&r)<<5|r>>>27;for(var l=23;l>=15;l-=4)e<<=6,e|=r>>>l&63;for(l=11;l>=3;l-=4)o|=r>>>l&63,o<<=6;o|=(31&r)<<1|r>>>31,$[t+0]=e>>>0,$[t+1]=o>>>0};Ta.expand=fja;Ly=[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];gja=function(r,$){for(var t=0,e=0;e<4;e++){t<<=4,t|=Ly[64*e+(r>>>18-6*e&63)]}for(e=0;e<4;e++){t<<=4,t|=Ly[256+64*e+($>>>18-6*e&63)]}return t>>>0};Ta.substitute=gja;My=[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];hja=function(r){for(var $=0,t=0;t>>My[t]&1;return $>>>0};Ta.permute=hja;ija=function(r,$,t){for(var e=r.toString(2);e.length<$;)e="0"+e;for(var o=[],l=0;l<$;l+=t)o.push(e.slice(l,l+t));return o.join(" ")};Ta.padSplit=ija}var eb,kja=false;function Oy(r,$){if(!r)throw new Error($||"Assertion failed")}function fb(){if(kja)return;kja=true;eb={};eb=Oy,Oy.equal=function(r,$,e){if(r!=$)throw new Error(e||"Assertion failed: "+r+" != "+$)}}var gm,lja,mja=false;function gb(r){this.options=r,this.type=this.options.type,this.blockSize=8,this._init(),this.buffer=new Array(this.blockSize),this.bufferOff=0}function hm(){if(mja)return;mja=true;gm={};lja=(fb(),eb);gm=gb,gb.prototype._init=function(){},gb.prototype.update=function(r){return 0===r.length?[]:"decrypt"===this.type?this._updateDecrypt(r):this._updateEncrypt(r)},gb.prototype._buffer=function(r,t){for(var e=Math.min(this.buffer.length-this.bufferOff,r.length-t),**0;i0;i--)t+=this._buffer(r,t),e+=this._flushBuffer(f,e);return t+=this._buffer(r,t),f},gb.prototype.final=function(r){var t,e;return r&&(t=this.update(r)),e="encrypt"===this.type?this._finalEncrypt():this._finalDecrypt(),t?t.concat(e):e},gb.prototype._pad=function(r,t){if(0===t)return!1;for(;t>>1];t=ea.r28shl(t,i),r=ea.r28shl(r,i),ea.pc2(t,r,e.keys,a)}},Sb.prototype._update=function(e,$,t,r){var a=this._desState,**ea.readUInt32BE(e,$),s=ea.readUInt32BE(e,$+4);ea.ip(i,s,a.tmp,0),**a.tmp[0],s=a.tmp[1],"encrypt"===this.type?this._encrypt(a,i,s,a.tmp,0):this._decrypt(a,i,s,a.tmp,0),**a.tmp[0],s=a.tmp[1],ea.writeUInt32BE(t,i,r),ea.writeUInt32BE(t,s,r+4)},Sb.prototype._pad=function(e,$){for(var t=e.length-$,r=$;r>>0,**A}ea.rip(s,i,r,a)},Sb.prototype._decrypt=function(e,$,t,r,a){for(var **t,s=$,v=e.keys.length-2;v>=0;v-=2){var p=e.keys[v],w=e.keys[v+1];ea.expand(i,e.tmp,0),p^=e.tmp[0],w^=e.tmp[1];var n=ea.substitute(p,w),A=i;i=(s^ea.permute(n))>>>0,s=A}ea.rip(i,s,r,a)}}var Ty,rja,sja,ki,tja,uja=false;function vja(t){rja.equal(t.length,8,"Invalid IV length"),this.iv=new Array(8);for(var **0;i>n%8,r._prev=ika(r._prev,e?f:t);return a}function ika(r,$){var e=r.length,f=-1,t=mi.allocUnsafe(r.length);for(r=mi.concat([r,mi.from([$])]);++f>7;return t}function jka(){if(gka)return;gka=true;$y={};mi=(q(),m).Buffer;fka=function(r,$,e){for(var f=$.length,t=mi.allocUnsafe(f),n=-1;++n>>24]^o[i>>>16&255]^S[u>>>8&255]^B[255&f]^r[s++],v=m[i>>>24]^o[u>>>16&255]^S[f>>>8&255]^B[255&c]^r[s++],g=m[u>>>24]^o[f>>>16&255]^S[c>>>8&255]^B[255&i]^r[s++],n=m[f>>>24]^o[c>>>16&255]^S[i>>>8&255]^B[255&u]^r[s++],c=A,**v,u=g,f=n;return A=(a[c>>>24]<<24|a[i>>>16&255]<<16|a[u>>>8&255]<<8|a[255&f])^r[s++],v=(a[i>>>24]<<24|a[u>>>16&255]<<16|a[f>>>8&255]<<8|a[255&c])^r[s++],g=(a[u>>>24]<<24|a[f>>>16&255]<<16|a[c>>>8&255]<<8|a[255&i])^r[s++],n=(a[f>>>24]<<24|a[c>>>16&255]<<16|a[i>>>8&255]<<8|a[255&u])^r[s++],[A>>>=0,v>>>=0,g>>>=0,n>>>=0]}function hb($){this._key=pm($),this._reset()}function pi(){if(Bka)return;Bka=true;cg={};oi=(q(),m).Buffer;Aka=[0,1,2,4,8,16,32,64,128,27,54];_=function(){for(var $=new Array(256),r=0;r<256;r++)$[r]=r<128?r<<1:r<<1^283;for(var t=[],a=[],e=[[],[],[],[]],A=[[],[],[],[]],v=0,g=0,n=0;n<256;++n){var m=g^g<<1^g<<2^g<<3^g<<4;m=m>>>8^255&m^99,t[v]=m,a[m]=v;var o=$[v],S=$[o],B=$[S],c=257*$[m]^16843008*m;e[0][v]=c<<24|c>>>8,e[1][v]=c<<16|c>>>16,e[2][v]=c<<8|c>>>24,e[3][v]=c,c=16843009*B^65537*S^257*o^16843008*v,A[0][m]=c<<24|c>>>8,A[1][m]=c<<16|c>>>16,A[2][m]=c<<8|c>>>24,A[3][m]=c,0===v?v=g=1:(v=o^$[$[$[B^o]]],g^=$[$[g]])}return{SBOX:t,INV_SBOX:a,SUB_MIX:e,INV_SUB_MIX:A}}();hb.blockSize=16,hb.keySize=32,hb.prototype.blockSize=hb.blockSize,hb.prototype.keySize=hb.keySize,hb.prototype._reset=function(){for(var $=this._key,r=$.length,t=r+6,a=4*(t+1),e=[],A=0;A>>24,v=_.SBOX[v>>>24]<<24|_.SBOX[v>>>16&255]<<16|_.SBOX[v>>>8&255]<<8|_.SBOX[255&v],v^=Aka[A/r|0]<<24):r>6&&A%r==4&&(v=_.SBOX[v>>>24]<<24|_.SBOX[v>>>16&255]<<16|_.SBOX[v>>>8&255]<<8|_.SBOX[255&v]),e[A]=e[A-r]^v}for(var g=[],n=0;n>>24]]^_.INV_SUB_MIX[1][_.SBOX[o>>>16&255]]^_.INV_SUB_MIX[2][_.SBOX[o>>>8&255]]^_.INV_SUB_MIX[3][_.SBOX[255&o]]}this._nRounds=t,this._keySchedule=e,this._invKeySchedule=g},hb.prototype.encryptBlockRaw=function($){return gz($=pm($),this._keySchedule,_.SUB_MIX,_.SBOX,this._nRounds)},hb.prototype.encryptBlock=function($){var r=this.encryptBlockRaw($),t=oi.allocUnsafe(16);return t.writeUInt32BE(r[0],0),t.writeUInt32BE(r[1],4),t.writeUInt32BE(r[2],8),t.writeUInt32BE(r[3],12),t},hb.prototype.decryptBlock=function($){var r=($=pm($))[1];$[1]=$[3],$[3]=r;var t=gz($,this._invKeySchedule,_.INV_SUB_MIX,_.INV_SBOX,this._nRounds),a=oi.allocUnsafe(16);return a.writeUInt32BE(t[0],0),a.writeUInt32BE(t[3],4),a.writeUInt32BE(t[2],8),a.writeUInt32BE(t[1],12),a},hb.prototype.scrub=function(){qm(this._keySchedule),qm(this._invKeySchedule),qm(this._key)},cg.AES=hb}var Cka,Ge,Dka,Eka=false;function Fka(r){return[r.readUInt32BE(0),r.readUInt32BE(4),r.readUInt32BE(8),r.readUInt32BE(12)]}function hz(r){var t=Ge.allocUnsafe(16);return t.writeUInt32BE(r[0]>>>0,0),t.writeUInt32BE(r[1]>>>0,4),t.writeUInt32BE(r[2]>>>0,8),t.writeUInt32BE(r[3]>>>0,12),t}function dg(r){this.h=r,this.state=Ge.alloc(16,0),this.cache=Ge.allocUnsafe(0)}function Gka(){if(Eka)return;Eka=true;Cka={};Ge=(q(),m).Buffer;Dka=Ge.alloc(16,0);dg.prototype.ghash=function(r){for(var t=-1;++t0;r--)$[r]=$[r]>>>1|(1&$[r-1])<<31;$[0]=$[0]>>>1,t&&($[0]=$[0]^225<<24)}this.state=hz(a)},dg.prototype.update=function(r){var t;for(this.cache=Ge.concat([this.cache,r]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},dg.prototype.final=function(r,t){return this.cache.length&&this.ghash(Ge.concat([this.cache,Dka],16)),this.ghash(hz([0,r,0,t])),this.state},Cka=dg}var iz,Hka,Ma,jz,Ika,kz,Jka,Kka,Lka=false;function Mka(r,t){var e=0;r.length!==t.length&&e++;for(var a=Math.min(r.length,t.length),$=0;$0||u>0;){var l=new Rka;l.update(t),l.update(r),e&&l.update(e),t=l.digest();var n=0;if(f>0){var **v.length-f;n=Math.min(f,t.length),t.copy(v,i,0,n),f-=n}if(n0){var o=a.length-u,J=Math.min(u,t.length-n);t.copy(a,o,n,n+J),u-=J}}return t.fill(0),{key:v,iv:a}}function si(){if(Ska)return;Ska=true;ri={};Nd=(q(),m).Buffer;Rka=(Yl(),Xl);ri=Tka}var sm,pz,Uka,qc,Vka,qz,Wka,Xka,Yka,Zka,$ka,_ka,ala=false;function eg(r,e,$){qz.call(this),this._cache=new ti,this._cipher=new Wka.AES(e),this._prev=qc.from($),this._mode=r,this._autopadding=!0}function ti(){this.cache=qc.allocUnsafe(0)}function rz(r,e,$){var t=pz[r.toLowerCase()];if(!t)throw new TypeError("invalid suite type");if("string"==typeof e&&(e=qc.from(e)),e.length!==t.key/8)throw new TypeError("invalid key length "+e.length);if("string"==typeof $&&($=qc.from($)),"GCM"!==t.mode&&$.length!==t.iv)throw new TypeError("invalid iv length "+$.length);return"stream"===t.type?new Vka(t.module,e,$):"auth"===t.type?new Uka(t.module,e,$):new eg(t.module,e,$)}function bla(r,e){var $=pz[r.toLowerCase()];if(!$)throw new TypeError("invalid suite type");var t=Xka(e,!1,$.key,$.iv);return rz(r,t.key,t.iv)}function cla(){if(ala)return;ala=true;sm={};pz=(om(),nm);Uka=(lz(),iz);qc=(q(),m).Buffer;Vka=(oz(),mz);qz=(Uc(),Tc);Wka=(pi(),cg);Xka=(si(),ri);Yka=(p(),o);Yka(eg,qz),eg.prototype._update=function(r){var e,$;this._cache.add(r);for(var t=[];e=this._cache.get();)$=this._mode.encrypt(this,e),t.push($);return qc.concat(t)};Zka=qc.alloc(16,16);eg.prototype._final=function(){var r=this._cache.flush();if(this._autopadding)return r=this._mode.encrypt(this,r),this._cipher.scrub(),r;if(!r.equals(Zka))throw this._cipher.scrub(),new Error("data not multiple of block length")},eg.prototype.setAutoPadding=function(r){return this._autopadding=!!r,this},ti.prototype.add=function(r){this.cache=qc.concat([this.cache,r])},ti.prototype.get=function(){if(this.cache.length>15){var r=this.cache.slice(0,16);return this.cache=this.cache.slice(16),r}return null},ti.prototype.flush=function(){for(var r=16-this.cache.length,e=qc.allocUnsafe(r),$=-1;++$16)throw new Error("unable to decrypt data");for(var t=-1;++t16)return r=this.cache.slice(0,16),this.cache=this.cache.slice(16),r}else if(this.cache.length>=16)return r=this.cache.slice(0,16),this.cache=this.cache.slice(16),r;return null},ui.prototype.flush=function(){if(this.cache.length)return this.cache};ila=mla;tm.createDecipher=ila;jla=uz;tm.createDecipheriv=jla}var ola,pla,qla,rla,sla,Ua,vz,wz,tla,ula,vla,wla,xla,yla,zla=false;function Ala(){return Object.keys(tla)}function um(){if(zla)return;zla=true;Ua={};vz=(cla(),sm);wz=(nla(),tm);tla=(fz(),ez);ula=(ola=vz.createCipher,Ua.Cipher=ola);Ua.createCipher=ula;vla=(pla=vz.createCipheriv,Ua.Cipheriv=pla);Ua.createCipheriv=vla;wla=(qla=wz.createDecipher,Ua.Decipher=qla);Ua.createDecipher=wla;xla=(rla=wz.createDecipheriv,Ua.Decipheriv=rla);Ua.createDecipheriv=xla;yla=(sla=Ala,Ua.getCiphers=sla);Ua.listCiphers=yla}var Bla,Cla,rc,Dla,Ela,Fla,Gla,Hla,Ila,Jla=false;function Kla(){if(Jla)return;Jla=true;rc={};Dla={key:8,iv:0};rc["des-ecb"]=Dla;Ela=(Bla={key:8,iv:8},rc.des=Bla);rc["des-cbc"]=Ela;Fla=(Cla={key:24,iv:8},rc.des3=Cla);rc["des-ede3-cbc"]=Fla;Gla={key:24,iv:0};rc["des-ede3"]=Gla;Hla={key:16,iv:8};rc["des-ede-cbc"]=Hla;Ila={key:16,iv:0};rc["des-ede"]=Ila}var Lla,Mla,Nla,Ola,Pla,xb,xz,vm,Wc,sc,yz,Qla,Rla,Sla,Tla,Ula,Vla=false;function Wla(e,$){var r,L;if(e=e.toLowerCase(),Wc[e])r=Wc[e].key,L=Wc[e].iv;else{if(!sc[e])throw new TypeError("invalid suite type");r=8*sc[e].key,L=sc[e].iv}var **yz($,!1,r,L);return zz(e,i.key,i.iv)}function Xla(e,$){var r,L;if(e=e.toLowerCase(),Wc[e])r=Wc[e].key,L=Wc[e].iv;else{if(!sc[e])throw new TypeError("invalid suite type");r=8*sc[e].key,L=sc[e].iv}var **yz($,!1,r,L);return Az(e,i.key,i.iv)}function zz(e,$,r){if(e=e.toLowerCase(),Wc[e])return vm.createCipheriv(e,$,r);if(sc[e])return new xz({key:$,iv:r,mode:e});throw new TypeError("invalid suite type")}function Az(e,$,r){if(e=e.toLowerCase(),Wc[e])return vm.createDecipheriv(e,$,r);if(sc[e])return new xz({key:$,iv:r,mode:e,decrypt:!0});throw new TypeError("invalid suite type")}function Yla(){return Object.keys(sc).concat(vm.getCiphers())}function Zla(){if(Vla)return;Vla=true;xb={};xz=(Oja(),Lja);vm=(um(),Ua);Wc=(om(),nm);sc=(Kla(),rc);yz=(si(),ri);Qla=(Lla=Wla,xb.Cipher=Lla);xb.createCipher=Qla;Rla=(Mla=zz,xb.Cipheriv=Mla);xb.createCipheriv=Rla;Sla=(Nla=Xla,xb.Decipher=Nla);xb.createDecipher=Sla;Tla=(Ola=Az,xb.Decipheriv=Ola);xb.createDecipheriv=Tla;Ula=(Pla=Yla,xb.getCiphers=Pla);xb.listCiphers=Ula}var $,$la=false;function aa(){if($la)return;$la=true;$=function(){var t={exports:this};(jd(),{}).Buffer;return function(t,i){function r(t,i){if(!t)throw new Error(i||"Assertion failed")}function h(t,i){t.super_=i;var r=function(){};r.prototype=i.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,i,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==i&&"be"!==i||(r=i,**10),this._init(t||0,i||10,r||"be"))}var e;"object"==typeof t?t.exports=n:i.BN=n,n.BN=n,n.wordSize=26;try{e=(jd(),{}).Buffer}catch(k){}function o(t,i,r){for(var h=0,n=Math.min(t.length,r),e=i;e=49&&o<=54?o-49+10:o>=17&&o<=22?o-17+10:15&o}return h}function s(t,i,r,h){for(var n=0,e=Math.min(t.length,r),o=i;o=49?s-49+10:s>=17?s-17+10:s}return n}n.isBN=function(t){return t instanceof n||null!==t&&"object"==typeof t&&t.constructor.wordSize===n.wordSize&&Array.isArray(t.words)},n.max=function(t,i){return t.***(i)>0?t:i},n.min=function(t,i){return t.***(i)<0?t:i},n.prototype._init=function(t,i,h){if("number"==typeof t)return this._initNumber(t,i,h);if("object"==typeof t)return this._initArray(t,i,h);"hex"===i&&(**16),r(i===(0|i)&&i>=2&&i<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&n++,16===i?this._parseHex(t,n):this._parseBase(t,i,n),"-"===t[0]&&(this.negative=1),this.strip(),"le"===h&&this._initArray(this.toArray(),i,h)},n.prototype._initNumber=function(t,i,h){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(r(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===h&&this._initArray(this.toArray(),i,h)},n.prototype._initArray=function(t,i,h){if(r("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var n=0;n=0;n-=3)o=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[e]|=o<>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);else if("le"===h)for(n=0,e=0;n>>26-s&67108863,(s+=24)>=26&&(s-=26,e++);return this.strip()},n.prototype._parseHex=function(t,i){this.length=Math.ceil((t.length-i)/6),this.words=new Array(this.length);for(var r=0;r=i;r-=6)n=o(t,r,r+6),this.words[h]|=n<>>26-e&4194303,(e+=24)>=26&&(e-=26,h++);r+6!==i&&(n=o(t,i,r+6),this.words[h]|=n<>>26-e&4194303),this.strip()},n.prototype._parseBase=function(t,i,r){this.words=[0],this.length=1;for(var h=0,n=1;n<=67108863;n*=i)h++;h--,n=n/i|0;for(var e=t.length-r,o=e%h,u=Math.min(e,e-o)+r,a=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var u=["","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"],a=[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];function m(t,i,r){r.negative=i.negative^t.negative;var h=t.length+i.length|0;r.length=h,h=h-1|0;var n=0|t.words[0],e=0|i.words[0],o=n*e,s=67108863&o,u=o/67108864|0;r.words[0]=s;for(var a=1;a>>26,m=67108863&u,f=Math.min(a,i.length-1),d=Math.max(0,a-t.length+1);d<=f;d++){var p=a-d|0;l+=(o=(n=0|t.words[p])*(e=0|i.words[d])+m)/67108864|0,m=67108863&o}r.words[a]=0|m,u=0|l}return 0!==u?r.words[a]=0|u:r.length--,r.strip()}n.prototype.toString=function(t,i){var h;if(**0|i||1,16===(t=t||10)||"hex"===t){h="";for(var n=0,e=0,o=0;o>>24-n&16777215)||o!==this.length-1?u[6-m.length]+m+h:m+h,(n+=2)>=26&&(n-=26,o--)}for(0!==e&&(h=e.toString(16)+h);h.length%i!=0;)h="0"+h;return 0!==this.negative&&(h="-"+h),h}if(t===(0|t)&&t>=2&&t<=36){var f=a[t],d=l[t];h="";var p=this.clone();for(p.negative=0;!p.isZero();){var M=p.modn(d).toString(t);h=(p=p.idivn(d)).isZero()?M+h:u[f-M.length]+M+h}for(this.isZero()&&(h="0"+h);h.length%i!=0;)h="0"+h;return 0!==this.negative&&(h="-"+h),h}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(t,i){return r(void 0!==e),this.toArrayLike(e,t,i)},n.prototype.toArray=function(t,i){return this.toArrayLike(Array,t,i)},n.prototype.toArrayLike=function(t,i,h){var n=this.byteLength(),e=h||Math.max(1,n);r(n<=e,"byte array longer than desired length"),r(e>0,"Requested array length <= 0"),this.strip();var o,s,u="le"===i,a=new t(e),l=this.clone();if(u){for(s=0;!l.isZero();s++)o=l.andln(255),l.iushrn(8),a[s]=o;for(;s=4096&&(r+=13,i>>>=13),i>=64&&(r+=7,i>>>=7),i>=8&&(r+=4,i>>>=4),i>=2&&(r+=2,i>>>=2),r+i},n.prototype._zeroBits=function(t){if(0===t)return 26;var **t,r=0;return 0==(8191&i)&&(r+=13,i>>>=13),0==(127&i)&&(r+=7,i>>>=7),0==(15&i)&&(r+=4,i>>>=4),0==(3&i)&&(r+=2,i>>>=2),0==(1&i)&&r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],**this._countBits(t);return 26*(this.length-1)+i},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,**0;it.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var i;**this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var i,r;this.length>t.length?(**this,r=t):(**t,r=this);for(var h=0;ht.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var **0|Math.ceil(t/26),h=t%26;this._expand(i),h>0&&i--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-h),this.strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,i){r("number"==typeof t&&t>=0);var h=t/26|0,n=t%26;return this._expand(h+1),this.words[h]=i?this.words[h]|1<t.length?(r=this,h=t):(r=t,h=this);for(var n=0,e=0;e>>26;for(;0!==n&&e>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;et.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var **this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,h,n=this.***(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,h=t):(r=t,h=this);for(var e=0,o=0;o>26,this.words[o]=67108863&i;for(;0!==e&&o>26,this.words[o]=67108863&i;if(0===e&&o>>13,d=0|o[1],p=8191&d,M=d>>>13,v=0|o[2],g=8191&v,c=v>>>13,w=0|o[3],y=8191&w,b=w>>>13,_=0|o[4],k=8191&_,A=_>>>13,x=0|o[5],S=8191&x,q=x>>>13,Z=0|o[6],R=8191&Z,B=Z>>>13,N=0|o[7],L=8191&N,T=N>>>13,**0|o[8],z=8191&I,E=I>>>13,O=0|o[9],j=8191&O,$=O>>>13,K=0|s[0],P=8191&K,F=K>>>13,C=0|s[1],D=8191&C,H=C>>>13,J=0|s[2],U=8191&J,G=J>>>13,Q=0|s[3],V=8191&Q,W=Q>>>13,X=0|s[4],Y=8191&X,tt=X>>>13,it=0|s[5],rt=8191&it,ht=it>>>13,nt=0|s[6],et=8191&nt,ot=nt>>>13,st=0|s[7],ut=8191&st,at=st>>>13,lt=0|s[8],mt=8191<,ft=lt>>>13,dt=0|s[9],pt=8191&dt,Mt=dt>>>13;r.negative=t.negative^i.negative,r.length=19;var vt=(a+(h=Math.imul(m,P))|0)+((8191&(n=(n=Math.imul(m,F))+Math.imul(f,P)|0))<<13)|0;a=((e=Math.imul(f,F))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,h=Math.imul(p,P),n=(n=Math.imul(p,F))+Math.imul(M,P)|0,e=Math.imul(M,F);var gt=(a+(h=h+Math.imul(m,D)|0)|0)+((8191&(n=(n=n+Math.imul(m,H)|0)+Math.imul(f,D)|0))<<13)|0;a=((e=e+Math.imul(f,H)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,h=Math.imul(g,P),n=(n=Math.imul(g,F))+Math.imul(***)|0,e=Math.imul(c,F),h=h+Math.imul(p,D)|0,n=(n=n+Math.imul(p,H)|0)+Math.imul(M,D)|0,e=e+Math.imul(M,H)|0;var ct=(a+(h=h+Math.imul(m,U)|0)|0)+((8191&(n=(n=n+Math.imul(m,G)|0)+Math.imul(f,U)|0))<<13)|0;a=((e=e+Math.imul(f,G)|0)+(n>>>13)|0)+(ct>>>26)|0,ct&=67108863,h=Math.imul(y,P),n=(n=Math.imul(y,F))+Math.imul(b,P)|0,e=Math.imul(b,F),h=h+Math.imul(g,D)|0,n=(n=n+Math.imul(g,H)|0)+Math.imul(c,D)|0,e=e+Math.imul(c,H)|0,h=h+Math.imul(p,U)|0,n=(n=n+Math.imul(p,G)|0)+Math.imul(M,U)|0,e=e+Math.imul(M,G)|0;var wt=(a+(h=h+Math.imul(m,V)|0)|0)+((8191&(n=(n=n+Math.imul(m,W)|0)+Math.imul(f,V)|0))<<13)|0;a=((e=e+Math.imul(f,W)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,h=Math.imul(k,P),n=(n=Math.imul(k,F))+Math.imul(A,P)|0,e=Math.imul(A,F),h=h+Math.imul(y,D)|0,n=(n=n+Math.imul(y,H)|0)+Math.imul(b,D)|0,e=e+Math.imul(b,H)|0,h=h+Math.imul(g,U)|0,n=(n=n+Math.imul(g,G)|0)+Math.imul(c,U)|0,e=e+Math.imul(c,G)|0,h=h+Math.imul(p,V)|0,n=(n=n+Math.imul(p,W)|0)+Math.imul(M,V)|0,e=e+Math.imul(M,W)|0;var yt=(a+(h=h+Math.imul(m,Y)|0)|0)+((8191&(n=(n=n+Math.imul(m,tt)|0)+Math.imul(f,Y)|0))<<13)|0;a=((e=e+Math.imul(f,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,h=Math.imul(S,P),n=(n=Math.imul(S,F))+Math.imul(q,P)|0,e=Math.imul(q,F),h=h+Math.imul(k,D)|0,n=(n=n+Math.imul(k,H)|0)+Math.imul(A,D)|0,e=e+Math.imul(A,H)|0,h=h+Math.imul(y,U)|0,n=(n=n+Math.imul(y,G)|0)+Math.imul(b,U)|0,e=e+Math.imul(b,G)|0,h=h+Math.imul(g,V)|0,n=(n=n+Math.imul(g,W)|0)+Math.imul(c,V)|0,e=e+Math.imul(c,W)|0,h=h+Math.imul(p,Y)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(M,Y)|0,e=e+Math.imul(M,tt)|0;var bt=(a+(h=h+Math.imul(m,rt)|0)|0)+((8191&(n=(n=n+Math.imul(m,ht)|0)+Math.imul(f,rt)|0))<<13)|0;a=((e=e+Math.imul(f,ht)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,h=Math.imul(R,P),n=(n=Math.imul(R,F))+Math.imul(B,P)|0,e=Math.imul(B,F),h=h+Math.imul(S,D)|0,n=(n=n+Math.imul(S,H)|0)+Math.imul(q,D)|0,e=e+Math.imul(q,H)|0,h=h+Math.imul(k,U)|0,n=(n=n+Math.imul(k,G)|0)+Math.imul(A,U)|0,e=e+Math.imul(A,G)|0,h=h+Math.imul(y,V)|0,n=(n=n+Math.imul(y,W)|0)+Math.imul(b,V)|0,e=e+Math.imul(b,W)|0,h=h+Math.imul(g,Y)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(c,Y)|0,e=e+Math.imul(c,tt)|0,h=h+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(M,rt)|0,e=e+Math.imul(M,ht)|0;var _t=(a+(h=h+Math.imul(m,et)|0)|0)+((8191&(n=(n=n+Math.imul(m,ot)|0)+Math.imul(f,et)|0))<<13)|0;a=((e=e+Math.imul(f,ot)|0)+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,h=Math.imul(L,P),n=(n=Math.imul(L,F))+Math.imul(T,P)|0,e=Math.imul(T,F),h=h+Math.imul(R,D)|0,n=(n=n+Math.imul(R,H)|0)+Math.imul(B,D)|0,e=e+Math.imul(B,H)|0,h=h+Math.imul(S,U)|0,n=(n=n+Math.imul(S,G)|0)+Math.imul(q,U)|0,e=e+Math.imul(q,G)|0,h=h+Math.imul(k,V)|0,n=(n=n+Math.imul(k,W)|0)+Math.imul(A,V)|0,e=e+Math.imul(A,W)|0,h=h+Math.imul(y,Y)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(b,Y)|0,e=e+Math.imul(b,tt)|0,h=h+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,ht)|0)+Math.imul(c,rt)|0,e=e+Math.imul(c,ht)|0,h=h+Math.imul(p,et)|0,n=(n=n+Math.imul(p,ot)|0)+Math.imul(M,et)|0,e=e+Math.imul(M,ot)|0;var kt=(a+(h=h+Math.imul(m,ut)|0)|0)+((8191&(n=(n=n+Math.imul(m,at)|0)+Math.imul(f,ut)|0))<<13)|0;a=((e=e+Math.imul(f,at)|0)+(n>>>13)|0)+(kt>>>26)|0,kt&=67108863,h=Math.imul(z,P),n=(n=Math.imul(z,F))+Math.imul(E,P)|0,e=Math.imul(E,F),h=h+Math.imul(L,D)|0,n=(n=n+Math.imul(L,H)|0)+Math.imul(T,D)|0,e=e+Math.imul(T,H)|0,h=h+Math.imul(R,U)|0,n=(n=n+Math.imul(R,G)|0)+Math.imul(B,U)|0,e=e+Math.imul(B,G)|0,h=h+Math.imul(S,V)|0,n=(n=n+Math.imul(S,W)|0)+Math.imul(q,V)|0,e=e+Math.imul(q,W)|0,h=h+Math.imul(k,Y)|0,n=(n=n+Math.imul(k,tt)|0)+Math.imul(A,Y)|0,e=e+Math.imul(A,tt)|0,h=h+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,ht)|0)+Math.imul(b,rt)|0,e=e+Math.imul(b,ht)|0,h=h+Math.imul(g,et)|0,n=(n=n+Math.imul(g,ot)|0)+Math.imul(c,et)|0,e=e+Math.imul(c,ot)|0,h=h+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,at)|0)+Math.imul(M,ut)|0,e=e+Math.imul(M,at)|0;var At=(a+(h=h+Math.imul(m,mt)|0)|0)+((8191&(n=(n=n+Math.imul(m,ft)|0)+Math.imul(f,mt)|0))<<13)|0;a=((e=e+Math.imul(f,ft)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,h=Math.imul(j,P),n=(n=Math.imul(j,F))+Math.imul($,P)|0,e=Math.imul($,F),h=h+Math.imul(z,D)|0,n=(n=n+Math.imul(z,H)|0)+Math.imul(E,D)|0,e=e+Math.imul(E,H)|0,h=h+Math.imul(L,U)|0,n=(n=n+Math.imul(L,G)|0)+Math.imul(T,U)|0,e=e+Math.imul(T,G)|0,h=h+Math.imul(R,V)|0,n=(n=n+Math.imul(R,W)|0)+Math.imul(B,V)|0,e=e+Math.imul(B,W)|0,h=h+Math.imul(S,Y)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(q,Y)|0,e=e+Math.imul(q,tt)|0,h=h+Math.imul(k,rt)|0,n=(n=n+Math.imul(k,ht)|0)+Math.imul(A,rt)|0,e=e+Math.imul(A,ht)|0,h=h+Math.imul(y,et)|0,n=(n=n+Math.imul(y,ot)|0)+Math.imul(b,et)|0,e=e+Math.imul(b,ot)|0,h=h+Math.imul(g,ut)|0,n=(n=n+Math.imul(g,at)|0)+Math.imul(c,ut)|0,e=e+Math.imul(c,at)|0,h=h+Math.imul(p,mt)|0,n=(n=n+Math.imul(p,ft)|0)+Math.imul(M,mt)|0,e=e+Math.imul(M,ft)|0;var xt=(a+(h=h+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,Mt)|0)+Math.imul(f,pt)|0))<<13)|0;a=((e=e+Math.imul(f,Mt)|0)+(n>>>13)|0)+(xt>>>26)|0,xt&=67108863,h=Math.imul(j,D),n=(n=Math.imul(j,H))+Math.imul($,D)|0,e=Math.imul($,H),h=h+Math.imul(z,U)|0,n=(n=n+Math.imul(z,G)|0)+Math.imul(E,U)|0,e=e+Math.imul(E,G)|0,h=h+Math.imul(L,V)|0,n=(n=n+Math.imul(L,W)|0)+Math.imul(T,V)|0,e=e+Math.imul(T,W)|0,h=h+Math.imul(R,Y)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(B,Y)|0,e=e+Math.imul(B,tt)|0,h=h+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,ht)|0)+Math.imul(q,rt)|0,e=e+Math.imul(q,ht)|0,h=h+Math.imul(k,et)|0,n=(n=n+Math.imul(k,ot)|0)+Math.imul(A,et)|0,e=e+Math.imul(A,ot)|0,h=h+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,at)|0)+Math.imul(b,ut)|0,e=e+Math.imul(b,at)|0,h=h+Math.imul(g,mt)|0,n=(n=n+Math.imul(g,ft)|0)+Math.imul(c,mt)|0,e=e+Math.imul(c,ft)|0;var St=(a+(h=h+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,Mt)|0)+Math.imul(M,pt)|0))<<13)|0;a=((e=e+Math.imul(M,Mt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,h=Math.imul(j,U),n=(n=Math.imul(j,G))+Math.imul($,U)|0,e=Math.imul($,G),h=h+Math.imul(z,V)|0,n=(n=n+Math.imul(z,W)|0)+Math.imul(E,V)|0,e=e+Math.imul(E,W)|0,h=h+Math.imul(L,Y)|0,n=(n=n+Math.imul(L,tt)|0)+Math.imul(T,Y)|0,e=e+Math.imul(T,tt)|0,h=h+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,ht)|0)+Math.imul(B,rt)|0,e=e+Math.imul(B,ht)|0,h=h+Math.imul(S,et)|0,n=(n=n+Math.imul(S,ot)|0)+Math.imul(q,et)|0,e=e+Math.imul(q,ot)|0,h=h+Math.imul(k,ut)|0,n=(n=n+Math.imul(k,at)|0)+Math.imul(A,ut)|0,e=e+Math.imul(A,at)|0,h=h+Math.imul(y,mt)|0,n=(n=n+Math.imul(y,ft)|0)+Math.imul(b,mt)|0,e=e+Math.imul(b,ft)|0;var qt=(a+(h=h+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,Mt)|0)+Math.imul(c,pt)|0))<<13)|0;a=((e=e+Math.imul(c,Mt)|0)+(n>>>13)|0)+(qt>>>26)|0,qt&=67108863,h=Math.imul(j,V),n=(n=Math.imul(j,W))+Math.imul($,V)|0,e=Math.imul($,W),h=h+Math.imul(z,Y)|0,n=(n=n+Math.imul(z,tt)|0)+Math.imul(E,Y)|0,e=e+Math.imul(E,tt)|0,h=h+Math.imul(L,rt)|0,n=(n=n+Math.imul(L,ht)|0)+Math.imul(T,rt)|0,e=e+Math.imul(T,ht)|0,h=h+Math.imul(R,et)|0,n=(n=n+Math.imul(R,ot)|0)+Math.imul(B,et)|0,e=e+Math.imul(B,ot)|0,h=h+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,at)|0)+Math.imul(q,ut)|0,e=e+Math.imul(q,at)|0,h=h+Math.imul(k,mt)|0,n=(n=n+Math.imul(k,ft)|0)+Math.imul(A,mt)|0,e=e+Math.imul(A,ft)|0;var Zt=(a+(h=h+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,Mt)|0)+Math.imul(b,pt)|0))<<13)|0;a=((e=e+Math.imul(b,Mt)|0)+(n>>>13)|0)+(Zt>>>26)|0,Zt&=67108863,h=Math.imul(j,Y),n=(n=Math.imul(j,tt))+Math.imul($,Y)|0,e=Math.imul($,tt),h=h+Math.imul(z,rt)|0,n=(n=n+Math.imul(z,ht)|0)+Math.imul(E,rt)|0,e=e+Math.imul(E,ht)|0,h=h+Math.imul(L,et)|0,n=(n=n+Math.imul(L,ot)|0)+Math.imul(T,et)|0,e=e+Math.imul(T,ot)|0,h=h+Math.imul(R,ut)|0,n=(n=n+Math.imul(R,at)|0)+Math.imul(B,ut)|0,e=e+Math.imul(B,at)|0,h=h+Math.imul(S,mt)|0,n=(n=n+Math.imul(S,ft)|0)+Math.imul(q,mt)|0,e=e+Math.imul(q,ft)|0;var Rt=(a+(h=h+Math.imul(k,pt)|0)|0)+((8191&(n=(n=n+Math.imul(k,Mt)|0)+Math.imul(A,pt)|0))<<13)|0;a=((e=e+Math.imul(A,Mt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,h=Math.imul(j,rt),n=(n=Math.imul(j,ht))+Math.imul($,rt)|0,e=Math.imul($,ht),h=h+Math.imul(z,et)|0,n=(n=n+Math.imul(z,ot)|0)+Math.imul(E,et)|0,e=e+Math.imul(E,ot)|0,h=h+Math.imul(L,ut)|0,n=(n=n+Math.imul(L,at)|0)+Math.imul(T,ut)|0,e=e+Math.imul(T,at)|0,h=h+Math.imul(R,mt)|0,n=(n=n+Math.imul(R,ft)|0)+Math.imul(B,mt)|0,e=e+Math.imul(B,ft)|0;var Bt=(a+(h=h+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,Mt)|0)+Math.imul(q,pt)|0))<<13)|0;a=((e=e+Math.imul(q,Mt)|0)+(n>>>13)|0)+(Bt>>>26)|0,Bt&=67108863,h=Math.imul(j,et),n=(n=Math.imul(j,ot))+Math.imul($,et)|0,e=Math.imul($,ot),h=h+Math.imul(z,ut)|0,n=(n=n+Math.imul(z,at)|0)+Math.imul(E,ut)|0,e=e+Math.imul(E,at)|0,h=h+Math.imul(L,mt)|0,n=(n=n+Math.imul(L,ft)|0)+Math.imul(T,mt)|0,e=e+Math.imul(T,ft)|0;var Nt=(a+(h=h+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,Mt)|0)+Math.imul(B,pt)|0))<<13)|0;a=((e=e+Math.imul(B,Mt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,h=Math.imul(j,ut),n=(n=Math.imul(j,at))+Math.imul($,ut)|0,e=Math.imul($,at),h=h+Math.imul(z,mt)|0,n=(n=n+Math.imul(z,ft)|0)+Math.imul(E,mt)|0,e=e+Math.imul(E,ft)|0;var Lt=(a+(h=h+Math.imul(L,pt)|0)|0)+((8191&(n=(n=n+Math.imul(L,Mt)|0)+Math.imul(T,pt)|0))<<13)|0;a=((e=e+Math.imul(T,Mt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,h=Math.imul(j,mt),n=(n=Math.imul(j,ft))+Math.imul($,mt)|0,e=Math.imul($,ft);var Tt=(a+(h=h+Math.imul(z,pt)|0)|0)+((8191&(n=(n=n+Math.imul(z,Mt)|0)+Math.imul(E,pt)|0))<<13)|0;a=((e=e+Math.imul(E,Mt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863;var It=(a+(h=Math.imul(j,pt))|0)+((8191&(n=(n=Math.imul(j,Mt))+Math.imul($,pt)|0))<<13)|0;return a=((e=Math.imul($,Mt))+(n>>>13)|0)+(It>>>26)|0,It&=67108863,u[0]=vt,u[1]=gt,u[2]=ct,u[3]=wt,u[4]=yt,u[5]=bt,u[6]=_t,u[7]=kt,u[8]=At,u[9]=xt,u[10]=St,u[11]=qt,u[12]=Zt,u[13]=Rt,u[14]=Bt,u[15]=Nt,u[16]=Lt,u[17]=Tt,u[18]=It,0!==a&&(u[19]=a,r.length++),r};function d(t,i,r){return new p().mulp(t,i,r)}function p(t,i){this.x=t,this.y=i}Math.imul||(f=m),n.prototype.mulTo=function(t,i){var r=this.length+t.length;return 10===this.length&&10===t.length?f(this,t,i):r<63?m(this,t,i):r<1024?function(t,i,r){r.negative=i.negative^t.negative,r.length=t.length+i.length;for(var h=0,n=0,e=0;e>>26)|0)>>>26,o&=67108863}r.words[e]=s,h=o,o=n}return 0!==h?r.words[e]=h:r.length--,r.strip()}(this,t,i):d(this,t,i)},p.prototype.makeRBT=function(t){for(var **new Array(t),r=n.prototype._countBits(t)-1,h=0;h>=1;return h},p.prototype.permute=function(t,i,r,h,n,e){for(var o=0;o>>=1)n++;return 1<>>=13,h[2*o+1]=8191&e,e>>>=13;for(o=2*i;o>=26,i+=n/67108864|0,i+=e>>>26,this.words[h]=67108863&e}return 0!==i&&(this.words[h]=i,this.length++),this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var **function(t){for(var **new Array(t.bitLength()),r=0;r>>n}return i}(t);if(0===i.length)return new n(1);for(var r=this,h=0;h=0);var i,h=t%26,n=(t-h)/26,e=67108863>>>26-h<<26-h;if(0!==h){var o=0;for(**0;i>>26-h}o&&(this.words[i]=o,this.length++)}if(0!==n){for(**this.length-1;i>=0;i--)this.words[i+n]=this.words[i];for(**0;i=0),n=i?(i-i%26)/26:0;var e=t%26,o=Math.min((t-e)/26,this.length),s=67108863^67108863>>>e<o)for(this.length-=o,a=0;a=0&&(0!==l||a>=n);a--){var m=0|this.words[a];this.words[a]=l<<26-e|m>>>e,l=m&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(t,i,h){return r(0===this.negative),this.iushrn(t,i,h)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){r("number"==typeof t&&t>=0);var **t%26,h=(t-i)/26,n=1<=0);var **t%26,h=(t-i)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=h)return this;if(0!==i&&h++,this.length=Math.min(h,this.length),0!==i){var n=67108863^67108863>>>i<=67108864;i++)this.words[i]-=67108864,i===this.length-1?this.words[i+1]=1:this.words[i+1]++;return this.length=Math.max(this.length,i+1),this},n.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var **0;i>26)-(u/67108864|0),this.words[n+h]=67108863&e}for(;n>26,this.words[n+h]=67108863&e;if(0===s)return this.strip();for(r(-1===s),s=0,n=0;n>26,this.words[n]=67108863&e;return this.negative=1,this.strip()},n.prototype._wordDiv=function(t,i){var r=(this.length,t.length),h=this.clone(),e=t,o=0|e.words[e.length-1];0!==(r=26-this._countBits(o))&&(e=e.ushln(r),h.iushln(r),o=0|e.words[e.length-1]);var s,u=h.length-e.length;if("mod"!==i){(s=new n(null)).length=u+1,s.words=new Array(s.length);for(var a=0;a=0;m--){var f=67108864*(0|h.words[e.length+m])+(0|h.words[e.length+m-1]);for(f=Math.min(f/o|0,67108863),h._ishlnsubmul(e,f,m);0!==h.negative;)f--,h.negative=0,h._ishlnsubmul(e,1,m),h.isZero()||(h.negative^=1);s&&(s.words[m]=f)}return s&&s.strip(),h.strip(),"div"!==i&&0!==r&&h.iushrn(r),{div:s||null,mod:h}},n.prototype.divmod=function(t,i,h){return r(!t.isZero()),this.isZero()?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(s=this.neg().divmod(t,i),"mod"!==i&&(e=s.div.neg()),"div"!==i&&(o=s.mod.neg(),h&&0!==o.negative&&o.iadd(t)),{div:e,mod:o}):0===this.negative&&0!==t.negative?(s=this.divmod(t.neg(),i),"mod"!==i&&(e=s.div.neg()),{div:e,mod:s.mod}):0!=(this.negative&t.negative)?(s=this.neg().divmod(t.neg(),i),"div"!==i&&(o=s.mod.neg(),h&&0!==o.negative&&o.isub(t)),{div:s.div,mod:o}):t.length>this.length||this.***(t)<0?{div:new n(0),mod:this}:1===t.length?"div"===i?{div:this.divn(t.words[0]),mod:null}:"mod"===i?{div:null,mod:new n(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modn(t.words[0]))}:this._wordDiv(t,i);var e,o,s},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var **this.divmod(t);if(i.mod.isZero())return i.div;var r=0!==i.div.negative?i.mod.isub(t):i.mod,h=t.ushrn(1),n=t.andln(1),e=r.***(h);return e<0||1===n&&0===e?i.div:0!==i.div.negative?i.div.isubn(1):i.div.iaddn(1)},n.prototype.modn=function(t){r(t<=67108863);for(var i=(1<<26)%t,h=0,n=this.length-1;n>=0;n--)h=(i*h+(0|this.words[n]))%t;return h},n.prototype.idivn=function(t){r(t<=67108863);for(var **0,h=this.length-1;h>=0;h--){var n=(0|this.words[h])+67108864*i;this.words[h]=n/t|0,**n%t}return this.strip()},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var **this,h=t.clone();**0!==i.negative?i.umod(t):i.clone();for(var e=new n(1),o=new n(0),s=new n(0),u=new n(1),a=0;i.isEven()&&h.isEven();)i.iushrn(1),h.iushrn(1),++a;for(var l=h.clone(),m=i.clone();!i.isZero();){for(var f=0,d=1;0==(i.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(i.iushrn(f);f-->0;)(e.isOdd()||o.isOdd())&&(e.iadd(l),o.isub(m)),e.iushrn(1),o.iushrn(1);for(var p=0,M=1;0==(h.words[0]&M)&&p<26;++p,M<<=1);if(p>0)for(h.iushrn(p);p-->0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(m)),s.iushrn(1),u.iushrn(1);i.***(h)>=0?(i.isub(h),e.isub(s),o.isub(u)):(h.isub(i),s.isub(e),u.isub(o))}return{a:s,b:u,gcd:h.iushln(a)}},n.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var **this,h=t.clone();**0!==i.negative?i.umod(t):i.clone();for(var e,o=new n(1),s=new n(0),u=h.clone();i.cmpn(1)>0&&h.cmpn(1)>0;){for(var a=0,l=1;0==(i.words[0]&l)&&a<26;++a,l<<=1);if(a>0)for(i.iushrn(a);a-->0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var m=0,f=1;0==(h.words[0]&f)&&m<26;++m,f<<=1);if(m>0)for(h.iushrn(m);m-->0;)s.isOdd()&&s.iadd(u),s.iushrn(1);i.***(h)>=0?(i.isub(h),o.isub(s)):(h.isub(i),s.isub(o))}return(e=0===i.cmpn(1)?o:s).cmpn(0)<0&&e.iadd(t),e},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var **this.clone(),r=t.clone();i.negative=0,r.negative=0;for(var h=0;i.isEven()&&r.isEven();h++)i.iushrn(1),r.iushrn(1);for(;;){for(;i.isEven();)i.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=i.***(r);if(n<0){var e=i;**r,r=e}else if(0===n||0===r.cmpn(1))break;i.isub(r)}return r.iushln(h)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return 0==(1&this.words[0])},n.prototype.isOdd=function(){return 1==(1&this.words[0])},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){r("number"==typeof t);var **t%26,h=(t-i)/26,n=1<>>26,s&=67108863,this.words[o]=s}return 0!==e&&(this.words[o]=e,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var i,h=t<0;if(0!==this.negative&&!h)return-1;if(0===this.negative&&h)return 1;if(this.strip(),this.length>1)**1;else{h&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];**n===t?0:nt.length)return 1;if(this.length=0;r--){var h=0|this.words[r],n=0|t.words[r];if(h!==n){hn&&(**1);break}}return i},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.***(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.***(t)>=0},n.prototype.ltn=function(t){return-1===this.cmpn(t)},n.prototype.lt=function(t){return-1===this.***(t)},n.prototype.lten=function(t){return this.cmpn(t)<=0},n.prototype.lte=function(t){return this.***(t)<=0},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.***(t)},n.red=function(t){return new b(t)},n.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var M={k256:null,p224:null,p192:null,p25519:null};function v(t,i){this.name=t,this.p=new n(i,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function c(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function y(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var **n._prime(t);this.m=i.p,this.prime=i}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function _(t){b.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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)}v.prototype._tmp=function(){var t=new n(null);return t.words=new Array(Math.ceil(this.n/13)),t},v.prototype.ireduce=function(t){var i,r=t;do{this.split(r,this.tmp),i=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(i>this.n);var h=i0?r.isub(this.p):r.strip(),r},v.prototype.split=function(t,i){t.iushrn(this.n,0,i)},v.prototype.imulK=function(t){return t.imul(this.k)},h(g,v),g.prototype.split=function(t,i){for(var r=Math.min(t.length,9),h=0;h>>22,n=e}n>>>=22,t.words[h-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},g.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var **0,r=0;r>>=26,t.words[r]=n,**h}return 0!==i&&(t.words[t.length++]=i),t},n._prime=function(t){if(M[t])return M[t];var i;if("k256"===t)**new g;else if("p224"===t)**new c;else if("p192"===t)**new w;else{if("p25519"!==t)throw new Error("Unknown prime "+t);**new y}return M[t]=i,i},b.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,i){r(0==(t.negative|i.negative),"red works only with positives"),r(t.red&&t.red===i.red,"red works only with red numbers")},b.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},b.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},b.prototype.add=function(t,i){this._verify2(t,i);var r=t.add(i);return r.***(this.m)>=0&&r.isub(this.m),r._forceRed(this)},b.prototype.iadd=function(t,i){this._verify2(t,i);var r=t.iadd(i);return r.***(this.m)>=0&&r.isub(this.m),r},b.prototype.sub=function(t,i){this._verify2(t,i);var r=t.sub(i);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},b.prototype.isub=function(t,i){this._verify2(t,i);var r=t.isub(i);return r.cmpn(0)<0&&r.iadd(this.m),r},b.prototype.shl=function(t,i){return this._verify1(t),this.imod(t.ushln(i))},b.prototype.imul=function(t,i){return this._verify2(t,i),this.imod(t.imul(i))},b.prototype.mul=function(t,i){return this._verify2(t,i),this.imod(t.mul(i))},b.prototype.isqr=function(t){return this.imul(t,t.clone())},b.prototype.sqr=function(t){return this.mul(t,t)},b.prototype.sqrt=function(t){if(t.isZero())return t.clone();var **this.m.andln(3);if(r(i%2==1),3===i){var h=this.m.add(new n(1)).iushrn(2);return this.pow(t,h)}for(var e=this.m.subn(1),o=0;!e.isZero()&&0===e.andln(1);)o++,e.iushrn(1);r(!e.isZero());var s=new n(1).toRed(this),u=s.redNeg(),a=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new n(2*l*l).toRed(this);0!==this.pow(l,a).***(u);)l.redIAdd(u);for(var m=this.pow(l,e),f=this.pow(t,e.addn(1).iushrn(1)),d=this.pow(t,e),p=o;0!==d.***(s);){for(var M=d,v=0;0!==M.***(s);v++)M=M.redSqr();r(v=0;h--){for(var a=i.words[h],l=u-1;l>=0;l--){var m=a>>l&1;e!==r[0]&&(e=this.sqr(e)),0!==m||0!==o?(o<<=1,o|=m,(4===++s||0===h&&0===l)&&(e=this.mul(e,r[o]),s=0,o=0)):s=0}u=26}return e},b.prototype.convertTo=function(t){var **t.umod(this.m);return i===t?i.clone():i},b.prototype.convertFrom=function(t){var **t.clone();return i.red=null,i},n.mont=function(t){return new _(t)},h(_,b),_.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},_.prototype.convertFrom=function(t){var **this.imod(t.mul(this.rinv));return i.red=null,i},_.prototype.imul=function(t,i){if(t.isZero()||i.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(i),h=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(h).iushrn(this.shift),e=n;return n.***(this.m)>=0?e=n.isub(this.m):n.cmpn(0)<0&&(e=n.iadd(this.m)),e._forceRed(this)},_.prototype.mul=function(t,i){if(t.isZero()||i.isZero())return new n(0)._forceRed(this);var r=t.mul(i),h=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),e=r.isub(h).iushrn(this.shift),o=e;return e.***(this.m)>=0?o=e.isub(this.m):e.cmpn(0)<0&&(o=e.iadd(this.m)),o._forceRed(this)},_.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(void 0===t||t,this),t.exports}.call({})}var Bz,wm,_la=false;function Xc(r){this.rand=r}function xm(){if(_la)return;_la=true;wm={};if((wm=function(r){return Bz||(Bz=new Xc(null)),Bz.generate(r)}).Rand=Xc,Xc.prototype.generate=function(r){return this._rand(r)},Xc.prototype._rand=function(r){if(this.rand.getBytes)return this.rand.getBytes(r);for(var t=new Uint8Array(r),e=0;e=0);return a},Pd.prototype._randrange=function(r,n){var e=n.sub(r);return r.add(this._randbelow(e))},Pd.prototype.test=function(r,n,e){var a=r.bitLength(),$=Od.mont(r),t=new Od(1).toRed($);n||(n=Math.max(1,a/48|0));for(var **r.subn(1),o=0;!i.testn(o);o++);for(var v=r.shrn(o),M=i.toRed($);n>0;n--){var b=this._randrange(new Od(2),i);e&&e(b);var d=b.toRed($).redPow(v);if(0!==d.***(t)&&0!==d.***(M)){for(var q=1;q0;n--){var M=this._randrange(new Od(2),t),b=r.gcd(M);if(0!==b.cmpn(1))return b;var d=M.toRed(a).redPow(o);if(0!==d.***($)&&0!==d.***(v)){for(var q=1;q$;)r.ishrn(1);if(r.isEven()&&r.iadd(fma),r.testn(1)||r.iadd(ym),a.***(ym)){if(!a.***(gma))for(;r.mod(hma).***(ima);)r.iadd(Gz)}else for(;r.mod(dma).***(jma);)r.iadd(Gz);if(zm(f=r.shrn(1))&&zm(r)&&Am(f)&&Am(r)&&Fz.test(f)&&Fz.test(r))return r}}function Iz(){if(kma)return;kma=true;Ez={};cma=(Ae(),ze);Ez=Bm,Bm.simpleSieve=zm,Bm.fermatTest=Am;va=(aa(),$);dma=new va(24);ema=(Dz(),Cz);Fz=new ema;fma=new va(1);ym=new va(2);gma=new va(5);CBa=new va(16);DBa=new va(8);hma=new va(10);ima=new va(3);EBa=new va(7);jma=new va(11);Gz=new va(4);FBa=new va(12);Hz=null}var mma,nma=false;function oma(){if(nma)return;nma=true;mma={};mma={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"}}}var pma,Tb,ib,qma,Jz,rma,sma,tma,uma,vma,Kz,wma,vi,xma=false;function yma(r,$){return $=$||"utf8",Tb.isBuffer(r)||(r=new Tb(r,$)),this._pub=new ib(r),this}function zma(r,$){return $=$||"utf8",Tb.isBuffer(r)||(r=new Tb(r,$)),this._priv=new ib(r),this}function Ama(r,$){var e=$.toString("hex"),h=[e,r.toString(16)].join("_");if(h in vi)return vi[h];var t,**0;if(r.isEven()||!Kz.simpleSieve||!Kz.fermatTest(r)||!Jz.test(r))return i+=1,i+="02"===e||"05"===e?8:4,vi[h]=i,i;switch(Jz.test(r.shrn(1))||(i+=2),e){case"02":r.mod(rma).***(sma)&&(i+=8);break;case"05":(t=r.mod(tma)).***(uma)&&t.***(vma)&&(i+=8);break;default:i+=4;}return vi[h]=i,i}function tc(r,$,e){this.setGenerator($),this.__prime=new ib(r),this._prime=ib.mont(this.__prime),this._primeLen=r.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,e?(this.setPublicKey=yma,this.setPrivateKey=zma):this._primeCode=8}function wi(r,$){var e=new Tb(r.toArray());return $?e.toString($):e}function Bma(){if(xma)return;xma=true;pma={};Tb=(z(),r).Buffer;ib=(aa(),$);qma=(Dz(),Cz);Jz=new qma;rma=new ib(24);sma=new ib(11);tma=new ib(10);uma=new ib(3);vma=new ib(7);Kz=(Iz(),Ez);wma=(Ae(),ze);pma=tc;vi={};Object.defineProperty(tc.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=Ama(this.__prime,this.__gen)),this._primeCode}}),tc.prototype.generateKeys=function(){return this._priv||(this._priv=new ib(wma(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},tc.prototype.computeSecret=function(r){var $=(r=(r=new ib(r)).toRed(this._prime)).redPow(this._priv).fromRed(),e=new Tb($.toArray()),h=this.getPrime();if(e.length=0||!t.umod(r.prime1)||!t.umod(r.prime2);)t=new Zc(Nz($));return t}function Em(){if(Nma)return;Nma=true;Dm={};Mma=(z(),r).Buffer;Zc=(aa(),$);Nz=(Ae(),ze);Dm=Oz,Oz.getr=Pz}var Pma,Qma=false;function Rma(){if(Qma)return;Qma=true;Pma={};Pma={_from:"elliptic@^6.0.0",_id:"elliptic@6.5.2",_inBundle:!1,_integrity:"sha512-f4x70okzZbIQl/NSRLkI/+tteV/9WqL98zx+SQ69KbXxmVrmjwsNUPn/gYJJ0sHvEak24cZgHIPegRePAtA/xw==",_location:"/parcel/elliptic",_phantomChildren:{},_requested:{type:"range",registry:!0,raw:"elliptic@^6.0.0",name:"elliptic",escapedName:"elliptic",rawSpec:"^6.0.0",saveSpec:null,fetchSpec:"^6.0.0"},_requiredBy:["/parcel/browserify-sign","/parcel/create-ecdh"],_resolved:"https://nexus.hilton.com/repository/hilton-npm/elliptic/-/elliptic-6.5.2.tgz",_shasum:"05c5678d7173c049d8ca433552224a495d0e3762",_spec:"elliptic@^6.0.0",_where:"/usr/local/lib/node_modules/parcel/node_modules/browserify-sign",author:{name:"Fedor Indutny",email:"fedor@indutny.com"},bugs:{url:"https://github.com/indutny/elliptic/issues"},bundleDependencies:!1,dependencies:{"bn.js":"^4.4.0",brorand:"^1.0.1","hash.js":"^1.0.0","hmac-drbg":"^1.0.0",inherits:"^2.0.1","minimalistic-assert":"^1.0.0","minimalistic-crypto-utils":"^1.0.0"},deprecated:!1,description:"EC cryptography",devDependencies:{brfs:"^1.4.3",coveralls:"^3.0.8",grunt:"^1.0.4","grunt-browserify":"^5.0.0","grunt-cli":"^1.2.0","grunt-contrib-connect":"^1.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^1.0.1","grunt-mocha-istanbul":"^3.0.1","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.2",jscs:"^3.0.7",jshint:"^2.10.3",mocha:"^6.2.2"},files:["lib"],homepage:"https://github.com/indutny/elliptic",keywords:["EC","Elliptic","curve","Cryptography"],license:"MIT",main:"lib/elliptic.js",name:"elliptic",repository:{type:"git",url:"git+ssh://git@github.com/indutny/elliptic.git"},scripts:{jscs:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",jshint:"jscs benchmarks/*.js lib/*.js lib/**/*.js lib/**/**/*.js test/index.js",lint:"npm run jscs && npm run jshint",test:"npm run lint && npm run unit",unit:"istanbul test _mocha --reporter=spec test/index.js",version:"grunt dist && git add dist/"},version:"6.5.2"}}var Fm,xi,Sma=false;function Tma(r,t){if(Array.isArray(r))return r.slice();if(!r)return[];var e=[];if("string"!=typeof r){for(var $=0;$>8,o=255&a;n?e.push(n,o):e.push(o)}return e}function Qz(r){return 1===r.length?"0"+r:r}function Rz(r){for(var t="",e=0;e(a>>1)-1?(a>>1)-v:v,e.isubn(s)):s=0,t[i]=s,e.iushrn(1)}return t}function Yma($,r){var n=[[],[]];$=$.clone(),r=r.clone();for(var t=0,a=0;$.cmpn(-t)>0||r.cmpn(-a)>0;){var e,i,s,v=$.andln(3)+t&3,l=r.andln(3)+a&3;if(3===v&&(v=-1),3===l&&(l=-1),0==(1&v))e=0;else e=3!==(s=$.andln(7)+t&7)&&5!==s||2!==l?v:-v;if(n[0].push(e),0==(1&l))**0;else **3!==(s=r.andln(7)+a&7)&&5!==s||2!==v?l:-l;n[1].push(i),2*t===e+1&&(t=1-t),2*a===i+1&&(a=1-a),$.iushrn(1),r.iushrn(1)}return n}function Zma($,r,n){var t="_"+r;$.prototype[r]=function(){return void 0!==this[t]?this[t]:this[t]=n.call(this)}}function $ma($){return"string"==typeof $?yb.toArray($,"hex"):$}function _ma($){return new Uma($,"hex","le")}function jb(){if(Wma)return;Wma=true;Va={};yb=Va;Uma=(aa(),$);Vma=(fb(),eb);yi=(Sz(),Fm);yb.assert=Vma,yb.toArray=yi.toArray,yb.zero2=yi.zero2,yb.toHex=yi.toHex,yb.encode=yi.encode,yb.getNAF=Xma,yb.getJSF=Yma,yb.cachedProperty=Zma,yb.parseBytes=$ma,yb.intFromLE=_ma}var zi,Qd,gg,Ai,ana,Bi,bna=false;function $c(t,e){this.type=t,this.p=new Qd(e.p,16),this.red=e.prime?Qd.red(e.prime):Qd.mont(this.p),this.zero=new Qd(0).toRed(this.red),this.one=new Qd(1).toRed(this.red),this.two=new Qd(2).toRed(this.red),this.n=e.n&&new Qd(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.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 r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function kb(t,e){this.curve=t,this.type=e,this.precomputed=null}function Ci(){if(bna)return;bna=true;zi={};Qd=(aa(),$);gg=(jb(),Va);Ai=gg.getNAF;ana=gg.getJSF;Bi=gg.assert;zi=$c,$c.prototype.point=function(){throw new Error("Not implemented")},$c.prototype.validate=function(){throw new Error("Not implemented")},$c.prototype._fixedNafMul=function(t,e){Bi(t.precomputed);var r=t._getDoubles(),n=Ai(e,1,this._bitLength),i=(1<=a;e--)s=(s<<1)+n[e];o.push(s)}for(var $=this.jpoint(null,null,null),f=this.jpoint(null,null,null),C=i;C>0;C--){for(a=0;a=0;s--){for(e=0;s>=0&&0===o[s];s--)e++;if(s>=0&&e++,a=a.dblp(e),s<0)break;var $=o[s];Bi(0!==$),a="affine"===t.type?$>0?a.mixedAdd(i[$-1>>1]):a.mixedAdd(i[-$-1>>1].neg()):$>0?a.add(i[$-1>>1]):a.add(i[-$-1>>1].neg())}return"affine"===t.type?a.toP():a},$c.prototype._wnafMulAdd=function(t,e,r,n,i){for(var o=this._wnafT1,a=this._wnafT2,s=this._wnafT3,$=0,f=0;f=1;f-=2){var p=f-1,u=f;if(1===o[p]&&1===o[u]){var h=[e[p],null,null,e[u]];0===e[p].y.***(e[u].y)?(h[1]=e[p].add(e[u]),h[2]=e[p].toJ().mixedAdd(e[u].neg())):0===e[p].y.***(e[u].y.redNeg())?(h[1]=e[p].toJ().mixedAdd(e[u]),h[2]=e[p].add(e[u].neg())):(h[1]=e[p].toJ().mixedAdd(e[u]),h[2]=e[p].toJ().mixedAdd(e[u].neg()));var d=[-3,-1,-5,-7,0,7,5,1,3],l=ana(r[p],r[u]);$=Math.max(l[0].length,$),s[p]=new Array($),s[u]=new Array($);for(var v=0;v<$;v++){var c=0|l[0][v],g=0|l[1][v];s[p][v]=d[3*(c+1)+(g+1)],s[u][v]=0,a[p]=h}}else s[p]=Ai(r[p],o[p],this._bitLength),s[u]=Ai(r[u],o[u],this._bitLength),$=Math.max(s[p].length,$),$=Math.max(s[u].length,$)}var W=this.jpoint(null,null,null),m=this._wnafT4;for(f=$;f>=0;f--){for(var y=0;f>=0;){var w=!0;for(v=0;v=0&&y++,W=W.dblp(y),f<0)break;for(v=0;v0?B=a[v][b-1>>1]:b<0&&(B=a[v][-b-1>>1].neg()),W="affine"===B.type?W.mixedAdd(B):W.add(B))}}for(f=0;f=Math.ceil((t.bitLength()+1)/e.step)},kb.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,**0;i=0&&(n=e,u=t),d.negative&&(d=d.neg(),**i.neg()),n.negative&&(n=n.neg(),u=u.neg()),[{a:d,b:i},{a:n,b:u}]},lb.prototype._endoSplit=function(r){var e=this.endo.basis,t=e[0],d=e[1],**d.b.mul(r).divRound(this.n),n=t.b.neg().mul(r).divRound(this.n),u=i.mul(t.a),s=n.mul(d.a),o=i.mul(t.b),h=n.mul(d.b);return{k1:r.sub(u).sub(s),k2:o.add(h).neg()}},lb.prototype.pointFromX=function(r,e){(r=new T(r,16)).red||(r=r.toRed(this.red));var t=r.redSqr().redMul(r).redIAdd(r.redMul(this.a)).redIAdd(this.b),d=t.redSqrt();if(0!==d.redSqr().redSub(t).***(this.zero))throw new Error("invalid point");var **d.fromRed().isOdd();return(e&&!i||!e&&i)&&(d=d.redNeg()),this.point(r,d)},lb.prototype.validate=function(r){if(r.inf)return!0;var e=r.x,t=r.y,d=this.a.redMul(e),**e.redSqr().redMul(e).redIAdd(d).redIAdd(this.b);return 0===t.redSqr().redISub(i).cmpn(0)},lb.prototype._endoWnafMulAdd=function(r,e,t){for(var d=this._endoWnafT1,**this._endoWnafT2,n=0;n":""},ia.prototype.isInfinity=function(){return this.inf},ia.prototype.add=function(r){if(this.inf)return r;if(r.inf)return this;if(this.eq(r))return this.dbl();if(this.neg().eq(r))return this.curve.point(null,null);if(0===this.x.***(r.x))return this.curve.point(null,null);var e=this.y.redSub(r.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(r.x).redInvm()));var t=e.redSqr().redISub(this.x).redISub(r.x),d=e.redMul(this.x.redSub(t)).redISub(this.y);return this.curve.point(t,d)},ia.prototype.dbl=function(){if(this.inf)return this;var r=this.y.redAdd(this.y);if(0===r.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,t=this.x.redSqr(),d=r.redInvm(),**t.redAdd(t).redIAdd(t).redIAdd(e).redMul(d),n=i.redSqr().redISub(this.x.redAdd(this.x)),u=i.redMul(this.x.redSub(n)).redISub(this.y);return this.curve.point(n,u)},ia.prototype.getX=function(){return this.x.fromRed()},ia.prototype.getY=function(){return this.y.fromRed()},ia.prototype.mul=function(r){return r=new T(r,16),this.isInfinity()?this:this._hasDoubles(r)?this.curve._fixedNafMul(this,r):this.curve.endo?this.curve._endoWnafMulAdd([this],[r]):this.curve._wnafMul(this,r)},ia.prototype.mulAdd=function(r,e,t){var d=[this,e],i=[r,t];return this.curve.endo?this.curve._endoWnafMulAdd(d,i):this.curve._wnafMulAdd(1,d,i,2)},ia.prototype.jmulAdd=function(r,e,t){var d=[this,e],i=[r,t];return this.curve.endo?this.curve._endoWnafMulAdd(d,i,!0):this.curve._wnafMulAdd(1,d,i,2,!0)},ia.prototype.eq=function(r){return this===r||this.inf===r.inf&&(this.inf||0===this.x.***(r.x)&&0===this.y.***(r.y))},ia.prototype.neg=function(r){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(r&&this.precomputed){var t=this.precomputed,d=function(r){return r.neg()};e.precomputed={naf:t.naf&&{wnd:t.naf.wnd,points:t.naf.points.map(d)},doubles:t.doubles&&{step:t.doubles.step,points:t.doubles.points.map(d)}}}return e},ia.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},Gm(na,Je.BasePoint),lb.prototype.jpoint=function(r,e,t){return new na(this,r,e,t)},na.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var r=this.z.redInvm(),e=r.redSqr(),t=this.x.redMul(e),d=this.y.redMul(e).redMul(r);return this.curve.point(t,d)},na.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},na.prototype.add=function(r){if(this.isInfinity())return r;if(r.isInfinity())return this;var e=r.z.redSqr(),t=this.z.redSqr(),d=this.x.redMul(e),**r.x.redMul(t),n=this.y.redMul(e.redMul(r.z)),u=r.y.redMul(t.redMul(this.z)),s=d.redSub(i),o=n.redSub(u);if(0===s.cmpn(0))return 0!==o.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=s.redSqr(),$=h.redMul(s),a=d.redMul(h),v=o.redSqr().redIAdd($).redISub(a).redISub(a),p=o.redMul(a.redISub(v)).redISub(n.redMul($)),l=this.z.redMul(r.z).redMul(s);return this.curve.jpoint(v,p,l)},na.prototype.mixedAdd=function(r){if(this.isInfinity())return r.toJ();if(r.isInfinity())return this;var e=this.z.redSqr(),t=this.x,d=r.x.redMul(e),**this.y,n=r.y.redMul(e).redMul(this.z),u=t.redSub(d),s=i.redSub(n);if(0===u.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var o=u.redSqr(),h=o.redMul(u),$=t.redMul(o),a=s.redSqr().redIAdd(h).redISub($).redISub($),v=s.redMul($.redISub(a)).redISub(i.redMul(h)),p=this.z.redMul(u);return this.curve.jpoint(a,v,p)},na.prototype.dblp=function(r){if(0===r)return this;if(this.isInfinity())return this;if(!r)return this.dbl();if(this.curve.zeroA||this.curve.threeA){for(var e=this,t=0;t=0)return!1;if(t.redIAdd(i),0===this.x.***(t))return!0}},na.prototype.inspect=function(){return this.isInfinity()?"":""},na.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}}var hna,Ke,Tz,Di,ina,jna=false;function Le(r){Di.call(this,"mont",r),this.a=new Ke(r.a,16).toRed(this.red),this.b=new Ke(r.b,16).toRed(this.red),this.i4=new Ke(4).toRed(this.red).redInvm(),this.two=new Ke(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function ja(r,t,e){Di.BasePoint.call(this,r,"projective"),null===t&&null===e?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new Ke(t,16),this.z=new Ke(e,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}function kna(){if(jna)return;jna=true;hna={};Ke=(aa(),$);Tz=(p(),o);Di=(Ci(),zi);ina=(jb(),Va);Tz(Le,Di),hna=Le,Le.prototype.validate=function(r){var t=r.normalize().x,e=t.redSqr(),**e.redMul(t).redAdd(e.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().***(i)},Tz(ja,Di.BasePoint),Le.prototype.decodePoint=function(r,t){return this.point(ina.toArray(r,t),1)},Le.prototype.point=function(r,t){return new ja(this,r,t)},Le.prototype.pointFromJSON=function(r){return ja.fromJSON(this,r)},ja.prototype.precompute=function(){},ja.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},ja.fromJSON=function(r,t){return new ja(r,t[0],t[1]||r.one)},ja.prototype.inspect=function(){return this.isInfinity()?"":""},ja.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},ja.prototype.dbl=function(){var r=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),e=r.redSub(t),**r.redMul(t),o=e.redMul(t.redAdd(this.curve.a24.redMul(e)));return this.curve.point(i,o)},ja.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},ja.prototype.diffAdd=function(r,t){var e=this.x.redAdd(this.z),**this.x.redSub(this.z),o=r.x.redAdd(r.z),n=r.x.redSub(r.z).redMul(e),$=o.redMul(i),d=t.z.redMul(n.redAdd($).redSqr()),u=t.x.redMul(n.redISub($).redSqr());return this.curve.point(d,u)},ja.prototype.mul=function(r){for(var t=r.clone(),e=this,**this.curve.point(null,null),o=[];0!==t.cmpn(0);t.iushrn(1))o.push(t.andln(1));for(var n=o.length-1;n>=0;n--)0===o[n]?(e=e.diffAdd(i,this),**i.dbl()):(**e.diffAdd(i,this),e=e.dbl());return i},ja.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},ja.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},ja.prototype.eq=function(r){return 0===this.getX().***(r.getX())},ja.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},ja.prototype.getX=function(){return this.normalize(),this.x.fromRed()}}var lna,mna,uc,Uz,Ei,nna,ona=false;function Ub(r){this.twisted=1!=(0|r.a),this.mOneA=this.twisted&&-1==(0|r.a),this.extended=this.mOneA,Ei.call(this,"edwards",r),this.a=new uc(r.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new uc(r.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new uc(r.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),nna(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|r.c)}function K(r,t,e,i,d){Ei.BasePoint.call(this,r,"projective"),null===t&&null===e&&null===i?(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 uc(t,16),this.y=new uc(e,16),this.z=i?new uc(i,16):this.curve.one,this.t=d&&new uc(d,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()))))}function pna(){if(ona)return;ona=true;lna={};mna=(jb(),Va);uc=(aa(),$);Uz=(p(),o);Ei=(Ci(),zi);nna=mna.assert;Uz(Ub,Ei),lna=Ub,Ub.prototype._mulA=function(r){return this.mOneA?r.redNeg():this.a.redMul(r)},Ub.prototype._mulC=function(r){return this.oneC?r:this.c.redMul(r)},Ub.prototype.jpoint=function(r,t,e,i){return this.point(r,t,e,i)},Ub.prototype.pointFromX=function(r,t){(r=new uc(r,16)).red||(r=r.toRed(this.red));var e=r.redSqr(),**this.c2.redSub(this.a.redMul(e)),d=this.one.redSub(this.c2.redMul(this.d).redMul(e)),s=i.redMul(d.redInvm()),u=s.redSqrt();if(0!==u.redSqr().redSub(s).***(this.zero))throw new Error("invalid point");var n=u.fromRed().isOdd();return(t&&!n||!t&&n)&&(u=u.redNeg()),this.point(r,u)},Ub.prototype.pointFromY=function(r,t){(r=new uc(r,16)).red||(r=r.toRed(this.red));var e=r.redSqr(),**e.redSub(this.c2),d=e.redMul(this.d).redMul(this.c2).redSub(this.a),s=i.redMul(d.redInvm());if(0===s.***(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,r)}var u=s.redSqrt();if(0!==u.redSqr().redSub(s).***(this.zero))throw new Error("invalid point");return u.fromRed().isOdd()!==t&&(u=u.redNeg()),this.point(u,r)},Ub.prototype.validate=function(r){if(r.isInfinity())return!0;r.normalize();var t=r.x.redSqr(),e=r.y.redSqr(),**t.redMul(this.a).redAdd(e),d=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(e)));return 0===i.***(d)},Uz(K,Ei.BasePoint),Ub.prototype.pointFromJSON=function(r){return K.fromJSON(this,r)},Ub.prototype.point=function(r,t,e,i){return new K(this,r,t,e,i)},K.fromJSON=function(r,t){return new K(r,t[0],t[1],t[2])},K.prototype.inspect=function(){return this.isInfinity()?"":""},K.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.***(this.z)||this.zOne&&0===this.y.***(this.curve.c))},K.prototype._extDbl=function(){var r=this.x.redSqr(),t=this.y.redSqr(),e=this.z.redSqr();e=e.redIAdd(e);var **this.curve._mulA(r),d=this.x.redAdd(this.y).redSqr().redISub(r).redISub(t),s=i.redAdd(t),u=s.redSub(e),n=i.redSub(t),h=d.redMul(u),o=s.redMul(n),$=d.redMul(n),v=u.redMul(s);return this.curve.point(h,o,v,$)},K.prototype._projDbl=function(){var r,t,e,**this.x.redAdd(this.y).redSqr(),d=this.x.redSqr(),s=this.y.redSqr();if(this.curve.twisted){var u=(o=this.curve._mulA(d)).redAdd(s);if(this.zOne)r=i.redSub(d).redSub(s).redMul(u.redSub(this.curve.two)),t=u.redMul(o.redSub(s)),e=u.redSqr().redSub(u).redSub(u);else{var n=this.z.redSqr(),h=u.redSub(n).redISub(n);r=i.redSub(d).redISub(s).redMul(h),t=u.redMul(o.redSub(s)),e=u.redMul(h)}}else{var o=d.redAdd(s);n=this.curve._mulC(this.z).redSqr(),h=o.redSub(n).redSub(n);r=this.curve._mulC(i.redISub(o)).redMul(h),t=this.curve._mulC(o).redMul(d.redISub(s)),e=o.redMul(h)}return this.curve.point(r,t,e)},K.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},K.prototype._extAdd=function(r){var t=this.y.redSub(this.x).redMul(r.y.redSub(r.x)),e=this.y.redAdd(this.x).redMul(r.y.redAdd(r.x)),**this.t.redMul(this.curve.dd).redMul(r.t),d=this.z.redMul(r.z.redAdd(r.z)),s=e.redSub(t),u=d.redSub(i),n=d.redAdd(i),h=e.redAdd(t),o=s.redMul(u),$=n.redMul(h),v=s.redMul(h),a=u.redMul(n);return this.curve.point(o,$,a,v)},K.prototype._projAdd=function(r){var t,e,**this.z.redMul(r.z),d=i.redSqr(),s=this.x.redMul(r.x),u=this.y.redMul(r.y),n=this.curve.d.redMul(s).redMul(u),h=d.redSub(n),o=d.redAdd(n),$=this.x.redAdd(this.y).redMul(r.x.redAdd(r.y)).redISub(s).redISub(u),v=i.redMul(h).redMul($);return this.curve.twisted?(t=i.redMul(o).redMul(u.redSub(this.curve._mulA(s))),e=h.redMul(o)):(t=i.redMul(o).redMul(u.redSub(s)),e=this.curve._mulC(h).redMul(o)),this.curve.point(v,t,e)},K.prototype.add=function(r){return this.isInfinity()?r:r.isInfinity()?this:this.curve.extended?this._extAdd(r):this._projAdd(r)},K.prototype.mul=function(r){return this._hasDoubles(r)?this.curve._fixedNafMul(this,r):this.curve._wnafMul(this,r)},K.prototype.mulAdd=function(r,t,e){return this.curve._wnafMulAdd(1,[this,t],[r,e],2,!1)},K.prototype.jmulAdd=function(r,t,e){return this.curve._wnafMulAdd(1,[this,t],[r,e],2,!0)},K.prototype.normalize=function(){if(this.zOne)return this;var r=this.z.redInvm();return this.x=this.x.redMul(r),this.y=this.y.redMul(r),this.t&&(this.t=this.t.redMul(r)),this.z=this.curve.one,this.zOne=!0,this},K.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},K.prototype.getX=function(){return this.normalize(),this.x.fromRed()},K.prototype.getY=function(){return this.normalize(),this.y.fromRed()},K.prototype.eq=function(r){return this===r||0===this.getX().***(r.getX())&&0===this.getY().***(r.getY())},K.prototype.eqXToP=function(r){var t=r.toRed(this.curve.red).redMul(this.z);if(0===this.x.***(t))return!0;for(var e=r.clone(),**this.curve.redN.redMul(this.z);;){if(e.iadd(this.curve.n),e.***(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.***(t))return!0}},K.prototype.toP=K.prototype.normalize,K.prototype.mixedAdd=K.prototype.add}var Hm,Fi,qna=false;function Vz(){if(qna)return;qna=true;Hm={};Fi=Hm;Fi.base=(Ci(),zi),Fi.short=(gna(),cna),Fi.mont=(kna(),hna),Fi.edwards=(pna(),lna)}var v,rna,sna,tna,una,vna,wna,xna,yna,zna,Ana,Bna,Cna,Dna,Ena,Fna,Gna,Hna,Ina,Jna,Kna,Lna,Mna,Nna,Ona,Pna,Qna,Rna,Sna,Tna=false;function Una($,r){return 55296==(64512&$.charCodeAt(r))&&!(r<0||r+1>=$.length)&&56320==(64512&$.charCodeAt(r+1))}function Vna($,r){if(Array.isArray($))return $.slice();if(!$)return[];var n=[];if("string"==typeof $){if(r){if("hex"===r)for(($=$.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&($="0"+$),o=0;o<$.length;o+=2)n.push(parseInt($[o]+$[o+1],16))}else for(var t=0,o=0;o<$.length;o++){var e=$.charCodeAt(o);e<128?n[t++]=e:e<2048?(n[t++]=e>>6|192,n[t++]=63&e|128):Una($,o)?(e=65536+((1023&e)<<10)+(1023&$.charCodeAt(++o)),n[t++]=e>>18|240,n[t++]=e>>12&63|128,n[t++]=e>>6&63|128,n[t++]=63&e|128):(n[t++]=e>>12|224,n[t++]=e>>6&63|128,n[t++]=63&e|128)}}else for(o=0;o<$.length;o++)n[o]=0|$[o];return n}function Wna($){for(var r="",n=0;n<$.length;n++)r+=Xz($[n].toString(16));return r}function Wz($){return($>>>24|$>>>8&65280|$<<8&16711680|(255&$)<<24)>>>0}function Xna($,r){for(var n="",t=0;t<$.length;t++){var o=$[t];"little"===r&&(o=Wz(o)),n+=Yz(o.toString(16))}return n}function Xz($){return 1===$.length?"0"+$:$}function Yz($){return 7===$.length?"0"+$:6===$.length?"00"+$:5===$.length?"000"+$:4===$.length?"0000"+$:3===$.length?"00000"+$:2===$.length?"000000"+$:1===$.length?"0000000"+$:$}function Yna($,r,n,t){var o=n-r;rna(o%4==0);for(var e=new Array(o/4),f=0,b=r;f>>0}return e}function Zna($,r){for(var n=new Array(4*$.length),t=0,o=0;t<$.length;t++,o+=4){var e=$[t];"big"===r?(n[o]=e>>>24,n[o+1]=e>>>16&255,n[o+2]=e>>>8&255,n[o+3]=255&e):(n[o+3]=e>>>24,n[o+2]=e>>>16&255,n[o+1]=e>>>8&255,n[o]=255&e)}return n}function $na($,r){return $>>>r|$<<32-r}function _na($,r){return $<>>32-r}function aoa($,r){return $+r>>>0}function boa($,r,n){return $+r+n>>>0}function coa($,r,n,t){return $+r+n+t>>>0}function doa($,r,n,t,o){return $+r+n+t+o>>>0}function eoa($,r,n,t){var o=$[r],e=t+$[r+1]>>>0,f=(e>>0,$[r+1]=e}function foa($,r,n,t){return(r+t>>>0>>0}function goa($,r,n,t){return r+t>>>0}function hoa($,r,n,t,o,e,f,b){var q=0,a=r;return q+=(a=a+t>>>0)>>0)>>0)>>0}function ioa($,r,n,t,o,e,f,b){return r+t+e+b>>>0}function joa($,r,n,t,o,e,f,b,q,a){var s=0,u=r;return s+=(u=u+t>>>0)>>0)>>0)>>0)>>0}function koa($,r,n,t,o,e,f,b,q,a){return r+t+e+b+a>>>0}function loa($,r,n){return(r<<32-n|$>>>n)>>>0}function moa($,r,n){return($<<32-n|r>>>n)>>>0}function noa($,r,n){return $>>>n}function ooa($,r,n){return($<<32-n|r>>>n)>>>0}function Vb(){if(Tna)return;Tna=true;v={};rna=(fb(),eb);sna=(p(),o);tna=sna;v.inherits=tna;una=Vna;v.toArray=una;vna=Wna;v.toHex=vna;wna=Wz;v.htonl=wna;xna=Xna;v.toHex32=xna;yna=Xz;v.zero2=yna;zna=Yz;v.zero8=zna;Ana=Yna;v.join32=Ana;Bna=Zna;v.split32=Bna;Cna=$na;v.rotr32=Cna;Dna=_na;v.rotl32=Dna;Ena=aoa;v.sum32=Ena;Fna=boa;v.sum32_3=Fna;Gna=coa;v.sum32_4=Gna;Hna=doa;v.sum32_5=Hna;Ina=eoa;v.sum64=Ina;Jna=foa;v.sum64_hi=Jna;Kna=goa;v.sum64_lo=Kna;Lna=hoa;v.sum64_4_hi=Lna;Mna=ioa;v.sum64_4_lo=Mna;Nna=joa;v.sum64_5_hi=Nna;Ona=koa;v.sum64_5_lo=Ona;Pna=loa;v.rotr64_hi=Pna;Qna=moa;v.rotr64_lo=Qna;Rna=noa;v.shr64_hi=Rna;Sna=ooa;v.shr64_lo=Sna}var Me,Zz,poa,qoa,roa=false;function Gi(){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}function hg(){if(roa)return;roa=true;Me={};Zz=(Vb(),v);poa=(fb(),eb);qoa=Gi;Me.BlockHash=qoa,Gi.prototype.update=function(t,i){if(t=Zz.toArray(t,i),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var e=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-e,t.length),0===this.pending.length&&(this.pending=null),t=Zz.join32(t,0,t.length-e,this.endian);for(var n=0;n>>24&255,n[s++]=t>>>16&255,n[s++]=t>>>8&255,n[s++]=255&t}else for(n[s++]=255&t,n[s++]=t>>>8&255,n[s++]=t>>>16&255,n[s++]=t>>>24&255,n[s++]=0,n[s++]=0,n[s++]=0,n[s++]=0,h=8;h>>3}function Goa($){return Xb($,17)^Xb($,19)^$>>>10}function bA(){if(Boa)return;Boa=true;Wb={};soa=(Vb(),v);Xb=soa.rotr32;toa=Coa;Wb.ft_1=toa;uoa=$z;Wb.ch32=uoa;voa=_z;Wb.maj32=voa;woa=aA;Wb.p32=woa;xoa=Doa;Wb.s0_256=xoa;yoa=Eoa;Wb.s1_256=yoa;zoa=Foa;Wb.g0_256=zoa;Aoa=Goa;Wb.g1_256=Aoa}var Hoa,Ne,Ioa,Joa,Im,ig,Koa,Loa,cA,Moa,Noa=false;function Yb(){if(!(this instanceof Yb))return new Yb;cA.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}function Ooa(){if(Noa)return;Noa=true;Hoa={};Ne=(Vb(),v);Ioa=(hg(),Me);Joa=(bA(),Wb);Im=Ne.rotl32;ig=Ne.sum32;Koa=Ne.sum32_5;Loa=Joa.ft_1;cA=Ioa.BlockHash;Moa=[1518500249,1859775393,2400959708,3395469782];Ne.inherits(Yb,cA),Hoa=Yb,Yb.blockSize=512,Yb.outSize=160,Yb.hmacStrength=80,Yb.padLength=64,Yb.prototype._update=function($,h){for(var r=this.W,a=0;a<16;a++)r[a]=$[h+a];for(;athis.blockSize&&(t=new this.Hash().update(t).digest()),Spa(t.length<=this.blockSize);for(var **t.length;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,i,s)}function dqa(){if(cqa)return;cqa=true;aqa={};bqa=(Nm(),Ii);Sd=(Sz(),Fm);uA=(fb(),eb);aqa=cd,cd.prototype._init=function(t,e,i){var s=t.concat(e).concat(i);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var r=0;r=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(i||[])),this._reseed=1},cd.prototype.generate=function(t,e,i,s){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof e&&(s=i,**e,e=null),i&&(**Sd.toArray(i,s||"hex"),this._update(i));for(var r=[];r.length"}}var jqa,Ki,Rm,kqa,lqa=false;function Li(r,$){if(r instanceof Li)return r;this._importDER(r,$)||(kqa(r.r&&r.s,"Signature without r or s"),this.r=new Ki(r.r,16),this.s=new Ki(r.s,16),void 0===r.recoveryParam?this.recoveryParam=null:this.recoveryParam=r.recoveryParam)}function mqa(){this.place=0}function Sm(r,$){var t=r[$.place++];if(!(128&t))return t;for(var a=15&t,e=0,o=0,u=$.place;o>>3);for(r.push(128|t);--t;)r.push($>>>(t<<3)&255);r.push($)}}function nqa(){if(lqa)return;lqa=true;jqa={};Ki=(aa(),$);Rm=(jb(),Va);kqa=Rm.assert;jqa=Li,Li.prototype._importDER=function(r,$){r=Rm.toArray(r,$);var t=new mqa;if(48!==r[t.place++])return!1;if(Sm(r,t)+t.place!==r.length)return!1;if(2!==r[t.place++])return!1;var a=Sm(r,t),e=r.slice(t.place,a+t.place);if(t.place+=a,2!==r[t.place++])return!1;var o=Sm(r,t);if(r.length!==o+t.place)return!1;var u=r.slice(t.place,o+t.place);return 0===e[0]&&128&e[1]&&(e=e.slice(1)),0===u[0]&&128&u[1]&&(u=u.slice(1)),this.r=new Ki(e),this.s=new Ki(u),this.recoveryParam=null,!0},Li.prototype.toDER=function(r){var $=this.r.toArray(),t=this.s.toArray();for(128&$[0]&&($=[0].concat($)),128&t[0]&&(t=[0].concat(t)),$=wA($),t=wA(t);!(t[0]||128&t[1]);)t=t.slice(1);var a=[2];Tm(a,$.length),(a=a.concat($)).push(2),Tm(a,t.length);var e=a.concat(t),o=[48];return Tm(o,e.length),o=o.concat(e),Rm.encode(o,r)}}var oqa,Td,xA,pqa,Um,qqa,yA,Vm,Mi,rqa=false;function mb(r){if(!(this instanceof mb))return new mb(r);"string"==typeof r&&(yA(Um.hasOwnProperty(r),"Unknown curve "+r),r=Um[r]),r instanceof Um.PresetCurve&&(r={curve:r}),this.curve=r.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=r.curve.g,this.g.precompute(r.curve.n.bitLength()+1),this.hash=r.hash||r.curve.hash}function sqa(){if(rqa)return;rqa=true;oqa={};Td=(aa(),$);xA=(dqa(),aqa);pqa=(jb(),Va);Um=(Qm(),Ji);qqa=(xm(),wm);yA=pqa.assert;Vm=(iqa(),eqa);Mi=(nqa(),jqa);oqa=mb,mb.prototype.keyPair=function(r){return new Vm(this,r)},mb.prototype.keyFromPrivate=function(r,e){return Vm.fromPrivate(this,r,e)},mb.prototype.keyFromPublic=function(r,e){return Vm.fromPublic(this,r,e)},mb.prototype.genKeyPair=function(r){r||(r={});for(var e=new xA({hash:this.hash,pers:r.pers,persEnc:r.persEnc||"utf8",entropy:r.entropy||qqa(this.hash.hmacStrength),entropyEnc:r.entropy&&r.entropyEnc||"utf8",nonce:this.n.toArray()}),t=this.n.byteLength(),n=this.n.sub(new Td(2));;){var $=new Td(e.generate(t));if(!($.***(n)>0))return $.iaddn(1),this.keyFromPrivate($)}},mb.prototype._truncateToN=function(r,e){var t=8*r.byteLength()-this.n.bitLength();return t>0&&(r=r.ushrn(t)),!e&&r.***(this.n)>=0?r.sub(this.n):r},mb.prototype.sign=function(r,e,t,n){"object"==typeof t&&(n=t,t=null),n||(n={}),e=this.keyFromPrivate(e,t),r=this._truncateToN(new Td(r,16));for(var $=this.n.byteLength(),**e.getPrivate().toArray("be",$),a=r.toArray("be",$),s=new xA({hash:this.hash,entropy:i,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),m=this.n.sub(new Td(1)),u=0;;u++){var v=n.k?n.k(u):new Td(s.generate(this.n.byteLength()));if(!((v=this._truncateToN(v,!0)).cmpn(1)<=0||v.***(m)>=0)){var o=this.g.mul(v);if(!o.isInfinity()){var c=o.getX(),h=c.umod(this.n);if(0!==h.cmpn(0)){var g=v.invm(this.n).mul(h.mul(e.getPrivate()).iadd(r));if(0!==(g=g.umod(this.n)).cmpn(0)){var p=(o.getY().isOdd()?1:0)|(0!==c.***(h)?2:0);return n.canonical&&g.***(this.nh)>0&&(g=this.n.sub(g),p^=1),new Mi({r:h,s:g,recoveryParam:p})}}}}}},mb.prototype.verify=function(r,e,t,n){r=this._truncateToN(new Td(r,16)),t=this.keyFromPublic(t,n);var $=(e=new Mi(e,"hex")).r,**e.s;if($.cmpn(1)<0||$.***(this.n)>=0)return!1;if(i.cmpn(1)<0||i.***(this.n)>=0)return!1;var a,s=i.invm(this.n),m=s.mul(r).umod(this.n),u=s.mul($).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(m,t.getPublic(),u)).isInfinity()&&a.eqXToP($):!(a=this.g.mulAdd(m,t.getPublic(),u)).isInfinity()&&0===a.getX().umod(this.n).***($)},mb.prototype.recoverPubKey=function(r,e,t,n){yA((3&t)===t,"The recovery param is more than two bits"),e=new Mi(e,n);var $=this.n,**new Td(r),a=e.r,s=e.s,m=1&t,u=t>>1;if(a.***(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");a=u?this.curve.pointFromX(a.add(this.curve.n),m):this.curve.pointFromX(a,m);var v=e.r.invm($),o=$.sub(i).mul(v).umod($),c=s.mul(v).umod($);return this.g.mulAdd(o,a,c)},mb.prototype.getKeyRecoveryParam=function(r,e,t,n){if(null!==(e=new Mi(e,n)).recoveryParam)return e.recoveryParam;for(var $=0;$<4;$++){var i;try{**this.recoverPubKey(r,e,$)}catch(r){continue}if(i.eq(t))return $}throw new Error("Unable to find valid recovery factor")}}var tqa,kg,zA,AA,Se,uqa=false;function ka(r,e){this.eddsa=r,this._secret=AA(e.secret),r.isPoint(e.pub)?this._pub=e.pub:this._pubBytes=AA(e.pub)}function vqa(){if(uqa)return;uqa=true;tqa={};kg=(jb(),Va);zA=kg.assert;AA=kg.parseBytes;Se=kg.cachedProperty;ka.fromPublic=function(r,e){return e instanceof ka?e:new ka(r,{pub:e})},ka.fromSecret=function(r,e){return e instanceof ka?e:new ka(r,{secret:e})},ka.prototype.secret=function(){return this._secret},Se(ka,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),Se(ka,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),Se(ka,"privBytes",function(){var r=this.eddsa,e=this.hash(),a=r.encodingLength-1,t=e.slice(0,r.encodingLength);return t[0]&=248,t[a]&=127,t[a]|=64,t}),Se(ka,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),Se(ka,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),Se(ka,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),ka.prototype.sign=function(r){return zA(this._secret,"KeyPair can only verify"),this.eddsa.sign(r,this)},ka.prototype.verify=function(r,e){return this.eddsa.verify(r,e,this)},ka.prototype.getSecret=function(r){return zA(this._secret,"KeyPair is public only"),kg.encode(this.secret(),r)},ka.prototype.getPublic=function(r){return kg.encode(this.pubBytes(),r)},tqa=ka}var wqa,xqa,Ni,yqa,Oi,zqa,Aqa=false;function Ud(e,r){this.eddsa=e,"object"!=typeof r&&(r=zqa(r)),Array.isArray(r)&&(r={R:r.slice(0,e.encodingLength),S:r.slice(e.encodingLength)}),yqa(r.R&&r.S,"Signature without R or S"),e.isPoint(r.R)&&(this._R=r.R),r.S instanceof xqa&&(this._S=r.S),this._Rencoded=Array.isArray(r.R)?r.R:r.Rencoded,this._Sencoded=Array.isArray(r.S)?r.S:r.Sencoded}function Bqa(){if(Aqa)return;Aqa=true;wqa={};xqa=(aa(),$);Ni=(jb(),Va);yqa=Ni.assert;Oi=Ni.cachedProperty;zqa=Ni.parseBytes;Oi(Ud,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),Oi(Ud,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),Oi(Ud,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),Oi(Ud,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),Ud.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},Ud.prototype.toHex=function(){return Ni.encode(this.toBytes(),"hex").toUpperCase()},wqa=Ud}var Cqa,Dqa,Eqa,Te,Fqa,BA,CA,DA,Gqa=false;function Oa(t){if(Fqa("ed25519"===t,"only tested with ed25519 so far"),!(this instanceof Oa))return new Oa(t);t=Eqa[t].curve;this.curve=t,this.g=t.g,this.g.precompute(t.n.bitLength()+1),this.pointClass=t.point().constructor,this.encodingLength=Math.ceil(t.n.bitLength()/8),this.hash=Dqa.sha512}function Hqa(){if(Gqa)return;Gqa=true;Cqa={};Dqa=(Nm(),Ii);Eqa=(Qm(),Ji);Te=(jb(),Va);Fqa=Te.assert;BA=Te.parseBytes;CA=(vqa(),tqa);DA=(Bqa(),wqa);Cqa=Oa,Oa.prototype.sign=function(t,r){t=BA(t);var e=this.keyFromSecret(r),$=this.hashInt(e.messagePrefix(),t),**this.g.mul($),n=this.encodePoint(i),a=this.hashInt(n,e.pubBytes(),t).mul(e.priv()),s=$.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:s,Rencoded:n})},Oa.prototype.verify=function(t,r,e){t=BA(t),r=this.makeSignature(r);var $=this.keyFromPublic(e),**this.hashInt(r.Rencoded(),$.pubBytes(),t),n=this.g.mul(r.S());return r.R().add($.pub().mul(i)).eq(n)},Oa.prototype.hashInt=function(){for(var t=this.hash(),r=0;r>6],o=0==(32&t);if(31==(31&t)){var n=t;for(t=0;128==(128&n);){if(n=r.readUInt8(e),r.isError(n))return n;t<<=7,t|=127&n}}else t&=31;return{cls:i,primitive:o,tag:t,tagStr:PA.tag[t]}}function RA(r,e,t){var **r.readUInt8(t);if(r.isError(i))return i;if(!e&&128===i)return null;if(0==(128&i))return i;var o=127&i;if(o>4)return r.error("length octect is too long");**0;for(var n=0;n=31?n.error("Multi-octet tag encoding unsupported"):(e||(o|=32),o|=an.tagClassByName[t||"universal"]<<6)}function ZA(){if(wra)return;wra=true;VA={};vra=(p(),o);xc=(z(),r).Buffer;WA=(og(),Xe);XA=WA.base;an=WA.constants.der;VA=YA,YA.prototype.encode=function(r,e){return this.tree._encode(r,e).join()},vra(Bb,XA.Node),Bb.prototype._encodeComposite=function(r,e,t,n){var o,$=xra(r,e,t,this.reporter);if(n.length<128)return(o=new xc(2))[0]=$,o[1]=n.length,this._createEncoderBuffer([o,n]);for(var a=1,**n.length;i>=256;i>>=8)a++;(o=new xc(2+a))[0]=$,o[1]=128|a;**1+a;for(var c=n.length;c>0;i--,c>>=8)o[i]=255&c;return this._createEncoderBuffer([o,n])},Bb.prototype._encodeStr=function(r,e){if("bitstr"===e)return this._createEncoderBuffer([0|r.unused,r.data]);if("bmpstr"===e){for(var t=new xc(2*r.length),n=0;n=40)return this.reporter.error("Second objid identifier OOB");r.splice(0,2,40*r[0]+r[1])}var o=0;for(n=0;n=128;$>>=7)o++}var a=new xc(o),**a.length-1;for(n=r.length-1;n>=0;n--){$=r[n];for(a[i--]=127&$;($>>=7)>0;)a[i--]=128|127&$}return this._createEncoderBuffer(a)},Bb.prototype._encodeTime=function(r,e){var t,n=new Date(r);return"gentime"===e?t=[ob(n.getFullYear()),ob(n.getUTCMonth()+1),ob(n.getUTCDate()),ob(n.getUTCHours()),ob(n.getUTCMinutes()),ob(n.getUTCSeconds()),"Z"].join(""):"utctime"===e?t=[ob(n.getFullYear()%100),ob(n.getUTCMonth()+1),ob(n.getUTCDate()),ob(n.getUTCHours()),ob(n.getUTCMinutes()),ob(n.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+e+" time is not supported yet"),this._encodeStr(t,"octstr")},Bb.prototype._encodeNull=function(){return this._createEncoderBuffer("")},Bb.prototype._encodeInt=function(r,e){if("string"==typeof r){if(!e)return this.reporter.error("String int or enum given, but no values map");if(!e.hasOwnProperty(r))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(r));r=e[r]}if("number"!=typeof r&&!xc.isBuffer(r)){var t=r.toArray();!r.sign&&128&t[0]&&t.unshift(0),r=new xc(t)}if(xc.isBuffer(r)){var n=r.length;0===r.length&&n++;var o=new xc(n);return r.copy(o),0===r.length&&(o[0]=0),this._createEncoderBuffer(o)}if(r<128)return this._createEncoderBuffer(r);if(r<256)return this._createEncoderBuffer([0,r]);n=1;for(var $=r;$>=256;$>>=8)n++;for($=(o=new Array(n)).length-1;$>=0;$--)o[$]=255&r,r>>=8;return 128&o[0]&&o.unshift(0),this._createEncoderBuffer(new xc(o))},Bb.prototype._encodeBool=function(r){return this._createEncoderBuffer(r?255:0)},Bb.prototype._use=function(r,e){return"function"==typeof r&&(r=r(e)),r._getEncoder("der").tree},Bb.prototype._skipDefault=function(r,e,t){var n,o=this._baseState;if(null===o.default)return!1;var $=r.join();if(void 0===o.defaultBuffer&&(o.defaultBuffer=this._encodeValue(o.default,e,t).join()),$.length!==o.defaultBuffer.length)return!1;for(n=0;n<$.length;n++)if($[n]!==o.defaultBuffer[n])return!1;return!0}}var yra,zra,bn,Ara=false;function cn(r){bn.call(this,r),this.enc="pem"}function Bra(){if(Ara)return;Ara=true;yra={};zra=(p(),o);bn=(ZA(),VA);zra(cn,bn),yra=cn,cn.prototype.encode=function(r,$){for(var e=bn.prototype.encode.call(this,r).toString("base64"),n=["-----BEGIN "+$.label+"-----"],o=0;o0&&e.ishrn(w),e}function Jsa(r,$){r=(r=fn(r,$)).mod($);var e=new xa(r.toArray());if(e.length<$.byteLength()){var w=new xa($.byteLength()-e.length);w.fill(0),e=xa.concat([w,e])}return e}function iB(r,$,e){var w,a;do{for(w=new xa(0);8*w.length=e)throw new Error("invalid sig")}function Tsa(){if(Psa)return;Psa=true;Msa={};gn=(z(),r).Buffer;pg=(aa(),$);Nsa=(Wm(),Pi).ec;jB=(Xi(),Wi);Osa=(fB(),eB);Msa=Qsa}var Usa,Zi,lB,$i,mB,Vsa,Wsa,Xd,Xsa=false;function qg(r){$i.Writable.call(this);var $=Xd[r];if(!$)throw new Error("Unknown message digest");this._hashType=$.hash,this._hash=lB($.hash),this._tag=$.id,this._signType=$.sign}function rg(r){$i.Writable.call(this);var $=Xd[r];if(!$)throw new Error("Unknown message digest");this._hash=lB($.hash),this._tag=$.id,this._signType=$.sign}function nB(r){return new qg(r)}function oB(r){return new rg(r)}function Ysa(){if(Xsa)return;Xsa=true;Usa={};Zi=(z(),r).Buffer;lB=(Wf(),Vf);$i=(kh(),jh);mB=(p(),o);Vsa=(Lsa(),gB);Wsa=(Tsa(),Msa);Xd=(wy(),vy);Object.keys(Xd).forEach(function(r){Xd[r].id=new Zi(Xd[r].id,"hex"),Xd[r.toLowerCase()]=Xd[r]}),mB(qg,$i.Writable),qg.prototype._write=function(r,$,e){this._hash.update(r),e()},qg.prototype.update=function(r,$){return"string"==typeof r&&(r=new Zi(r,$)),this._hash.update(r),this},qg.prototype.sign=function(r,$){this.end();var e=this._hash.digest(),a=Vsa(e,r,this._hashType,this._signType,this._tag);return $?a.toString($):a},mB(rg,$i.Writable),rg.prototype._write=function(r,$,e){this._hash.update(r),e()},rg.prototype.update=function(r,$){return"string"==typeof r&&(r=new Zi(r,$)),this._hash.update(r),this},rg.prototype.verify=function(r,$,e){"string"==typeof $&&($=new Zi($,e)),this.end();var a=this._hash.digest();return Wsa($,a,r,this._signType,this._tag)},Usa={Sign:nB,Verify:oB,createSign:nB,createVerify:oB}}var Zsa,yc,$sa,_sa,Xa,ata=false;function Yd(e){this.curveType=Xa[e],this.curveType||(this.curveType={name:e}),this.curve=new $sa.ec(this.curveType.name),this.keys=void 0}function hn(e,r,$){Array.isArray(e)||(e=e.toArray());var t=new yc(e);if($&&t.length<$){var a=new yc($-t.length);a.fill(0),t=yc.concat([a,t])}return r?t.toString(r):t}function bta(){if(ata)return;ata=true;Zsa={};yc=(z(),r).Buffer;$sa=(Wm(),Pi);_sa=(aa(),$);Zsa=function(e){return new Yd(e)};Xa={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}};Xa.p224=Xa.secp224r1,Xa.p256=Xa.secp256r1=Xa.prime256v1,Xa.p192=Xa.secp192r1=Xa.prime192v1,Xa.p384=Xa.secp384r1,Xa.p521=Xa.secp521r1,Yd.prototype.generateKeys=function(e,r){return this.keys=this.curve.genKeyPair(),this.getPublicKey(e,r)},Yd.prototype.computeSecret=function(e,r,$){return r=r||"utf8",yc.isBuffer(e)||(e=new yc(e,r)),hn(this.curve.keyFromPublic(e).getPublic().mul(this.keys.getPrivate()).getX(),$,this.curveType.byteLength)},Yd.prototype.getPublicKey=function(e,r){var $=this.keys.getPublic("compressed"===r,!0);return"hybrid"===r&&($[$.length-1]%2?$[0]=7:$[0]=6),hn($,e)},Yd.prototype.getPrivateKey=function(e){return hn(this.keys.getPrivate(),e)},Yd.prototype.setPublicKey=function(e,r){return r=r||"utf8",yc.isBuffer(e)||(e=new yc(e,r)),this.keys._importPublic(e),this},Yd.prototype.setPrivateKey=function(e,r){r=r||"utf8",yc.isBuffer(e)||(e=new yc(e,r));var $=new _sa(e);return $=$.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate($),this}}var pB,cta,jn,dta=false;function eta(r){var $=jn.allocUnsafe(4);return $.writeUInt32BE(r,0),$}function qB(){if(dta)return;dta=true;pB={};cta=(Wf(),Vf);jn=(q(),m).Buffer;pB=function(r,$){for(var e,a=jn.alloc(0),p=0;a.length<$;)e=eta(p++),a=jn.concat([a,cta("sha1").update(r).update(e).digest()]);return a.slice(0,$)}}var rB,fta=false;function sB(){if(fta)return;fta=true;rB={};rB=function(r,t){for(var e=r.length,n=-1;++no-Y-2)throw new Error("message too long");var n=Fb.alloc(o-a-Y-2),f=o-E-1,v=kn(E),t=xB(Fb.concat([e,n,Fb.alloc(1,1),r],f),wB(v,f)),u=xB(v,wB(t,E));return new ln(Fb.concat([Fb.alloc(1),u,t],o))}function qta($,r,o){var a,e=r.length,E=$.modulus.byteLength();if(e>E-11)throw new Error("message too long");return a=o?Fb.alloc(E-e-3,255):rta(E-e-3),new ln(Fb.concat([Fb.from([0,o?1:2]),a,Fb.alloc(1),r],E))}function rta($){for(var r,o=Fb.allocUnsafe($),a=0,e=kn(2*$),E=0;a<$;)E===e.length&&(e=kn(2*$),E=0),(r=e[E++])&&(o[a++]=r);return o}function sta(){if(ota)return;ota=true;jta={};kta=(Xi(),Wi);kn=(Ae(),ze);lta=(Wf(),Vf);wB=(qB(),pB);xB=(sB(),rB);ln=(aa(),$);mta=(vB(),tB);nta=(Em(),Dm);Fb=(q(),m).Buffer;jta=function($,r,o){var a;a=$.padding?$.padding:o?1:4;var e,E=kta($);if(4===a)e=pta(E,r);else if(1===a)e=qta(E,r,o);else{if(3!==a)throw new Error("unknown padding");if((e=new ln(r)).***(E.modulus)>=0)throw new Error("data too long for modulus")}return o?nta(e,E):mta(e,E)}}var tta,uta,yB,zB,AB,vta,wta,xta,sg,yta=false;function zta(r,$){var e=r.modulus.byteLength(),o=wta("sha1").update(sg.alloc(0)).digest(),a=o.length;if(0!==$[0])throw new Error("decryption error");var t=$.slice(1,a+1),m=$.slice(a+1),n=zB(t,yB(m,a)),**zB(m,yB(n,e-a-1));if(Bta(o,i.slice(0,a)))throw new Error("decryption error");for(var c=a;0===i[c];)c++;if(1!==i[c++])throw new Error("decryption error");return i.slice(c)}function Ata(r,$,e){for(var o=$.slice(0,2),a=2,t=0;0!==$[a++];)if(a>=$.length){t++;break}var m=$.slice(2,a-1);if(("0002"!==o.toString("hex")&&!e||"0001"!==o.toString("hex")&&e)&&t++,m.length<8&&t++,t)throw new Error("decryption error");return $.slice(a)}function Bta(r,$){r=sg.from(r),$=sg.from($);var e=0,o=r.length;r.length!==$.length&&(e++,o=Math.min(r.length,$.length));for(var a=-1;++am||new AB($).***(t.modulus)>=0)throw new Error("decryption error");a=e?xta(new AB($),t):vta($,t);var n=sg.alloc(m-a.length);if(a=sg.concat([n,a],m),4===o)return zta(t,a);if(1===o)return Ata(t,a,e);if(3===o)return a;throw new Error("unknown padding")}}var tg,BB,CB,Dta,Eta,Fta=false;function Gta(){if(Fta)return;Fta=true;tg={};BB=(sta(),jta);tg.publicEncrypt=BB;CB=(Cta(),tta);tg.privateDecrypt=CB;Dta=function(r,p){return BB(r,p,!0)};tg.privateEncrypt=Dta;Eta=function(r,p){return CB(r,p,!0)};tg.publicDecrypt=Eta}var DB,EB,Hta,ug,FB,GBa,GB,HB,mn,IB,Ita=false;function JB(){throw new Error("secure random number generation not supported by this browser\nuse chrome, FireFox or Internet Explorer 11")}function KB(r,$){if("number"!=typeof r||r!=r)throw new TypeError("offset must be a number");if(r>IB||r<0)throw new TypeError("offset must be a uint32");if(r>HB||r>$)throw new RangeError("offset out of range")}function LB(r,$,e){if("number"!=typeof r||r!=r)throw new TypeError("size must be a number");if(r>IB||r<0)throw new TypeError("size must be a uint32");if(r+$>e||r>HB)throw new RangeError("buffer too small")}function Jta(r,$,e,a){if(!(GB.isBuffer(r)||r instanceof A.Uint8Array))throw new TypeError("\"buf\" argument must be a Buffer or Uint8Array");if("function"==typeof $)a=$,$=0,e=r.length;else if("function"==typeof e)a=e,e=r.length-$;else if("function"!=typeof a)throw new TypeError("\"cb\" argument must be a function");return KB($,r.length),LB(e,$,r.length),MB(r,$,e,a)}function MB(r,$,e,a){var o=r.buffer,n=new Uint8Array(o,$,e);return mn.getRandomValues(n),a?void Hta.nextTick(function(){a(null,r)}):r}function Kta(r,$,e){if(void 0===$&&($=0),!(GB.isBuffer(r)||r instanceof A.Uint8Array))throw new TypeError("\"buf\" argument must be a Buffer or Uint8Array");return KB($,r.length),void 0===e&&(e=r.length-$),LB(e,$,r.length),MB(r,$,e)}function Lta(){if(Ita)return;Ita=true;Hta=(ab(),_a);ug={};FB=(q(),m);GBa=(Ae(),ze);GB=FB.Buffer;HB=FB.kMaxLength;mn=A.crypto||A.msCrypto;IB=Math.pow(2,32)-1;mn&&mn.getRandomValues?(DB=Jta,ug.randomFill=DB,EB=Kta,ug.randomFillSync=EB):(DB=JB,ug.randomFill=DB,EB=JB,ug.randomFillSync=EB)}var Mta,Nta,Ota,Pta,Qta,l,Rta,Sta,Tta,Uta,Vta,Wta,Xta,NB,Yta,Zta,cc,$ta,_ta,aua,bua,cua,dua,eua,fua,gua,hua,vg,iua,jua,kua,lua,mua,_i,nua,oua,pua,qua,rua,aj,sua,tua,uua,vua,OB,wua,xua,yua,zua,Aua=false;function PB(){if(Aua)return;Aua=true;l={};Rta=(Ota=(Ae(),ze),Nta=l.prng=Ota,Mta=l.pseudoRandomBytes=Nta,l.rng=Mta);l.randomBytes=Rta;Sta=(Pta=(Wf(),Vf),l.Hash=Pta);l.createHash=Sta;Tta=(Qta=(uy(),sy),l.Hmac=Qta);l.createHmac=Tta;Uta=(Dia(),Bia);Vta=Object.keys(Uta);Wta=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(Vta);Xta=function(){return Wta};l.getHashes=Xta;NB=(Ky(),ii);Yta=NB.pbkdf2;l.pbkdf2=Yta;Zta=NB.pbkdf2Sync;l.pbkdf2Sync=Zta;cc=(Zla(),xb);$ta=cc.Cipher;l.Cipher=$ta;_ta=cc.createCipher;l.createCipher=_ta;aua=cc.Cipheriv;l.Cipheriv=aua;bua=cc.createCipheriv;l.createCipheriv=bua;cua=cc.Decipher;l.Decipher=cua;dua=cc.createDecipher;l.createDecipher=dua;eua=cc.Decipheriv;l.Decipheriv=eua;fua=cc.createDecipheriv;l.createDecipheriv=fua;gua=cc.getCiphers;l.getCiphers=gua;hua=cc.listCiphers;l.listCiphers=hua;vg=(Lma(),Ie);iua=vg.DiffieHellmanGroup;l.DiffieHellmanGroup=iua;jua=vg.createDiffieHellmanGroup;l.createDiffieHellmanGroup=jua;kua=vg.getDiffieHellman;l.getDiffieHellman=kua;lua=vg.createDiffieHellman;l.createDiffieHellman=lua;mua=vg.DiffieHellman;l.DiffieHellman=mua;_i=(Ysa(),Usa);nua=_i.createSign;l.createSign=nua;oua=_i.Sign;l.Sign=oua;pua=_i.createVerify;l.createVerify=pua;qua=_i.Verify;l.Verify=qua;rua=(bta(),Zsa);l.createECDH=rua;aj=(Gta(),tg);sua=aj.publicEncrypt;l.publicEncrypt=sua;tua=aj.privateEncrypt;l.privateEncrypt=tua;uua=aj.publicDecrypt;l.publicDecrypt=uua;vua=aj.privateDecrypt;l.privateDecrypt=vua;OB=(Lta(),ug);wua=OB.randomFill;l.randomFill=wua;xua=OB.randomFillSync;l.randomFillSync=xua;yua=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))};l.createCredentials=yua;zua={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};l.constants=zua}var bj={};var Bua={};function QB(r,e,n,t,a,c,o){try{var f=r[c](o),$=f.value}catch(u){return void n(u)}f.done?e($):Promise.resolve($).then(t,a)}function Cua(r){return function(){var e=this,n=arguments;return new Promise(function(t,a){var c=r.apply(e,n);function o(r){QB(c,t,a,o,f,"next",r)}function f(r){QB(c,t,a,o,f,"throw",r)}o(void 0)})}}var Dua=(h(),g);Bua=function(r){var e=r.clientFirstMessage;return{encode:function(){var r=Cua(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",new Dua().writeBytes(e));case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}};var RB={};function SB(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),t.push.apply(t,n)}return t}function TB(r){for(var e=1;er.length)&&(e=r.length);for(var t=0,n=new Array(e);t=0||Object.prototype.propertyIsEnumerable.call(r,t)&&(o[t]=r[t])}return o}function Qva(r,e){if(null==r)return{};var t,n,o={},a=Object.keys(r);for(n=0;n=0||(o[t]=r[t]);return o}function tC(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),t.push.apply(t,n)}return t}function uC(r){for(var e=1;e=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(r){throw r},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,o,a=!0,i=!1;return{s:function(){n=r[Symbol.iterator]()},n:function(){var r=n.next();return a=r.done,r},e:function(r){i=!0,o=r},f:function(){try{a||null==n.return||n.return()}finally{if(i)throw o}}}}function xC(r,e){if(r){if("string"==typeof r)return yC(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?yC(r,e):void 0}}function yC(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t0&&void 0!==n[0]?n[0]:[],t=this.lookupRequest(V.Metadata,Q.Metadata),r.next=4,this.connection.send(t({topics:e,allowAutoTopicCreation:this.allowAutoTopicCreation}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(){return r.apply(this,arguments)}}()},{key:"produce",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o,a,i,s,u,c,$,p,h;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.topicData,n=e.transactionalId,o=e.producerId,a=e.producerEpoch,**e.acks,s=void 0===i?-1:i,u=e.timeout,c=void 0===u?3e4:u,$=e.compression,p=void 0===$?Uva.None:$,h=this.lookupRequest(V.Produce,Q.Produce),r.next=4,this.connection.send(h({acks:s,timeout:c,compression:p,topicData:t,transactionalId:n,producerId:o,producerEpoch:a}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"fetch",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o,a,i,s,u,c,$,p;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.replicaId,n=e.isolationLevel,o=e.maxWaitTime,a=void 0===o?5e3:o,**e.minBytes,s=void 0===i?1:i,u=e.maxBytes,c=void 0===u?10485760:u,$=e.topics,p=this.lookupRequest(V.Fetch,Q.Fetch),r.next=4,this.connection.send(p({replicaId:t,isolationLevel:n,maxWaitTime:a,minBytes:s,maxBytes:c,topics:$}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"heartbeat",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o,a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.groupId,n=e.groupGenerationId,o=e.memberId,a=this.lookupRequest(V.Heartbeat,Q.Heartbeat),r.next=4,this.connection.send(a({groupId:t,groupGenerationId:n,memberId:o}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"findGroupCoordinator",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.groupId,n=e.coordinatorType,o=this.lookupRequest(V.GroupCoordinator,Q.GroupCoordinator),r.next=4,this.connection.send(o({groupId:t,coordinatorType:n}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"joinGroup",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o,a,i,s,u,c,$;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.groupId,n=e.sessionTimeout,o=e.rebalanceTimeout,a=e.memberId,**void 0===a?"":a,s=e.protocolType,u=void 0===s?"consumer":s,c=e.groupProtocols,$=this.lookupRequest(V.JoinGroup,Q.JoinGroup),r.next=4,this.connection.send($({groupId:t,sessionTimeout:n,rebalanceTimeout:o,memberId:i,protocolType:u,groupProtocols:c}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"leaveGroup",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.groupId,n=e.memberId,o=this.lookupRequest(V.LeaveGroup,Q.LeaveGroup),r.next=4,this.connection.send(o({groupId:t,memberId:n}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"syncGroup",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o,a,i;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.groupId,n=e.generationId,o=e.memberId,a=e.groupAssignment,**this.lookupRequest(V.SyncGroup,Q.SyncGroup),r.next=4,this.connection.send(i({groupId:t,generationId:n,memberId:o,groupAssignment:a}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"listOffsets",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o,a,i,s,u,c;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.replicaId,n=e.isolationLevel,o=e.topics,a=this.lookupRequest(V.ListOffsets,Q.ListOffsets),r.next=4,this.connection.send(a({replicaId:t,isolationLevel:n,topics:o}));case 4:**r.sent,s=wC(i.responses);try{for(s.s();!(u=s.n()).done;)(c=u.value).partitions=c.partitions.map(function(r){var e=r.offsets,t=Pva(r,["offsets"]);return e?uC({},t,{offset:e.pop()}):t})}catch($){s.e($)}finally{s.f()}return r.abrupt("return",i);case 8:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"offsetCommit",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o,a,i,s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.groupId,n=e.groupGenerationId,o=e.memberId,a=e.retentionTime,**e.topics,s=this.lookupRequest(V.OffsetCommit,Q.OffsetCommit),r.next=4,this.connection.send(s({groupId:t,groupGenerationId:n,memberId:o,retentionTime:a,topics:i}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"offsetFetch",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.groupId,n=e.topics,o=this.lookupRequest(V.OffsetFetch,Q.OffsetFetch),r.next=4,this.connection.send(o({groupId:t,topics:n}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"describeGroups",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.groupIds,n=this.lookupRequest(V.DescribeGroups,Q.DescribeGroups),r.next=4,this.connection.send(n({groupIds:t}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"createTopics",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o,a,i,s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.topics,n=e.validateOnly,o=void 0!==n&&n,a=e.timeout,**void 0===a?5e3:a,s=this.lookupRequest(V.CreateTopics,Q.CreateTopics),r.next=4,this.connection.send(s({topics:t,validateOnly:o,timeout:i}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"deleteTopics",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o,a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.topics,n=e.timeout,o=void 0===n?5e3:n,a=this.lookupRequest(V.DeleteTopics,Q.DeleteTopics),r.next=4,this.connection.send(a({topics:t,timeout:o}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"describeConfigs",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o,a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.resources,n=e.includeSynonyms,o=void 0!==n&&n,a=this.lookupRequest(V.DescribeConfigs,Q.DescribeConfigs),r.next=4,this.connection.send(a({resources:t,includeSynonyms:o}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"alterConfigs",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o,a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.resources,n=e.validateOnly,o=void 0!==n&&n,a=this.lookupRequest(V.AlterConfigs,Q.AlterConfigs),r.next=4,this.connection.send(a({resources:t,validateOnly:o}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"initProducerId",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.transactionalId,n=e.transactionTimeout,o=this.lookupRequest(V.InitProducerId,Q.InitProducerId),r.next=4,this.connection.send(o({transactionalId:t,transactionTimeout:n}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"addPartitionsToTxn",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o,a,i;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.transactionalId,n=e.producerId,o=e.producerEpoch,a=e.topics,**this.lookupRequest(V.AddPartitionsToTxn,Q.AddPartitionsToTxn),r.next=4,this.connection.send(i({transactionalId:t,producerId:n,producerEpoch:o,topics:a}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"addOffsetsToTxn",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o,a,i;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.transactionalId,n=e.producerId,o=e.producerEpoch,a=e.groupId,**this.lookupRequest(V.AddOffsetsToTxn,Q.AddOffsetsToTxn),r.next=4,this.connection.send(i({transactionalId:t,producerId:n,producerEpoch:o,groupId:a}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"txnOffsetCommit",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o,a,i,s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.transactionalId,n=e.groupId,o=e.producerId,a=e.producerEpoch,**e.topics,s=this.lookupRequest(V.TxnOffsetCommit,Q.TxnOffsetCommit),r.next=4,this.connection.send(s({transactionalId:t,groupId:n,producerId:o,producerEpoch:a,topics:i}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"endTxn",value:function(){var r=P(regeneratorRuntime.mark(function r(e){var t,n,o,a,i;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.transactionalId,n=e.producerId,o=e.producerEpoch,a=e.transactionResult,**this.lookupRequest(V.EndTxn,Q.EndTxn),r.next=4,this.connection.send(i({transactionalId:t,producerId:n,producerEpoch:o,transactionResult:a}));case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:BC.SHOULD_REAUTHENTICATE,value:function(){if(this.sessionLifetime.equals(wg.ZERO))return!1;if(null==this.authenticatedAt)return!0;var r=Lva(sC.hrtime(this.authenticatedAt),2),e=r[0],t=r[1];return wg.fromValue(e).multiply(1e3).add(wg.fromValue(t).divide(1e6)).add(this.reauthenticationThreshold).greaterThanOrEqual(this.sessionLifetime)}}]),r}();var Yva,Zva=false;function $va(){if(Zva)return;Zva=true;Yva={};Yva={maxRetryTime:1e3,initialRetryTime:50,factor:.02,multiplier:1.5,retries:15}}var CC,_va=false;function DC(){if(_va)return;_va=true;CC={};CC={maxRetryTime:3e4,initialRetryTime:300,factor:.2,multiplier:2,retries:5}}var Ya={},awa=(y(),x),bwa=awa.KafkaJSNumberOfRetriesExceeded,cwa=!1,dwa=cwa?($va(),Yva):(DC(),CC),ewa=function(r,e){return Math.random()*(e-r)+r},EC=function(r,e){var $=r*e;return Math.ceil(ewa(e-$,e+$))},fwa=["RangeError","ReferenceError","SyntaxError","TypeError"],gwa=function(r){return fwa.includes(r.name)},hwa=function(r){return(r.retriable||!1!==r.retriable)&&!gwa(r)},iwa=function(r,e,$,a){var t=!1,n=r.factor,**r.multiplier,o=r.maxRetryTime,u=r.retries,O=function(r){t=!0,$(r||new Error("Aborted"))};return function r(v){var c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!t){var F=function(r){return Math.min(EC(n,r)*i,o)}(v),R=c0&&void 0!==arguments[0]?arguments[0]:{};return function(e){return new Promise(function($,a){var t=Object.assign({},dwa,r);iwa(t,$,a,e)(EC(t.factor,t.initialRetryTime))})}};var on={};function jwa(r){return nwa(r)||mwa(r)||lwa(r)||kwa()}function kwa(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function lwa(r,a){if(r){if("string"==typeof r)return pn(r,a);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?pn(r,a):void 0}}function mwa(r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r))return Array.from(r)}function nwa(r){if(Array.isArray(r))return pn(r)}function pn(r,a){(null==a||a>r.length)&&(a=r.length);for(var t=0,e=new Array(a);t=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(r){throw r},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a,o=!0,i=!1;return{s:function(){n=r[Symbol.iterator]()},n:function(){var r=n.next();return o=r.done,r},e:function(r){i=!0,a=r},f:function(){try{o||null==n.return||n.return()}finally{if(i)throw a}}}}function GC(r){return rwa(r)||qwa(r)||HC(r)||pwa()}function pwa(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function HC(r,e){if(r){if("string"==typeof r)return qn(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?qn(r,e):void 0}}function qwa(r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r))return Array.from(r)}function rwa(r){if(Array.isArray(r))return qn(r)}function qn(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);tthis.metadataExpireAt||!e.every(function(r){return t.metadata.topicMetadata.some(function(e){return e.topic===r})}))){r.next=3;break}return r.abrupt("return",this.refreshMetadata(e));case 3:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"findBroker",value:function(){var r=Gb(regeneratorRuntime.mark(function r(e){var t,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(t=e.nodeId,n=this.brokers[t]){r.next=4;break}throw new LC("Broker ".concat(t," not found in the cached metadata"));case 4:return r.next=6,this.connectBroker(n);case 6:return r.abrupt("return",n);case 7:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"withBroker",value:function(){var r=Gb(regeneratorRuntime.mark(function r(e){var t,n,a,o,i;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(0!==(t=on(sn(this.brokers))).length){r.next=3;break}throw new LC("No brokers in the broker pool");case 3:n=FC(t),r.prev=4,n.s();case 6:if((a=n.n()).done){r.next=21;break}return o=a.value,r.next=10,this.findBroker({nodeId:o});case 10:return **r.sent,r.prev=11,r.next=14,e({nodeId:o,broker:i});case 14:return r.abrupt("return",r.sent);case 17:r.prev=17,r.t0=r.catch(11);case 19:r.next=6;break;case 21:r.next=26;break;case 23:r.prev=23,r.t1=r.catch(4),n.e(r.t1);case 26:return r.prev=26,n.f(),r.finish(26);case 29:return r.abrupt("return",null);case 30:case"end":return r.stop();}},r,this,[[4,23,26,29],[11,17]])}));return function(e){return r.apply(this,arguments)}}()},{key:"findConnectedBroker",value:function(){var r=Gb(regeneratorRuntime.mark(function r(){var e,t,n,a,o,**this;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(e=on(sn(this.brokers)),!(t=e.find(function(r){return i.brokers[r].isConnected()}))){r.next=6;break}return r.next=5,this.findBroker({nodeId:t});case 5:return r.abrupt("return",r.sent);case 6:n=FC(e),r.prev=7,n.s();case 9:if((a=n.n()).done){r.next=21;break}return o=a.value,r.prev=11,r.next=14,this.findBroker({nodeId:o});case 14:return r.abrupt("return",r.sent);case 17:r.prev=17,r.t0=r.catch(11);case 19:r.next=9;break;case 21:r.next=26;break;case 23:r.prev=23,r.t1=r.catch(7),n.e(r.t1);case 26:return r.prev=26,n.f(),r.finish(26);case 29:return r.next=31,this.connect();case 31:return r.abrupt("return",this.seedBroker);case 32:case"end":return r.stop();}},r,this,[[7,23,26,29],[11,17]])}));return function(){return r.apply(this,arguments)}}()},{key:"connectBroker",value:function(){var r=Gb(regeneratorRuntime.mark(function r(e){var t=this;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!e.isConnected()){r.next=2;break}return r.abrupt("return");case 2:return r.abrupt("return",this.retrier(function(){var r=Gb(regeneratorRuntime.mark(function r(n,a,o){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,e.connect();case 3:r.next=18;break;case 5:if(r.prev=5,r.t0=r.catch(0),"KafkaJSConnectionError"!==r.t0.name&&"ILLEGAL_SASL_STATE"!==r.t0.type){r.next=14;break}return r.next=10,e.disconnect();case 10:if("ECONNREFUSED"!==r.t0.code){r.next=12;break}return r.abrupt("return",n(r.t0));case 12:e.connection=t.connectionBuilder.build({host:e.connection.host,port:e.connection.port,rack:e.connection.rack}),t.logger.error("Failed to connect to broker, reconnecting",{retryCount:a,retryTime:o});case 14:if(!r.t0.retriable){r.next=16;break}throw r.t0;case 16:t.logger.error(r.t0,{retryCount:a,retryTime:o,stack:r.t0.stack}),n(r.t0);case 18:case"end":return r.stop();}},r,null,[[0,5]])}));return function(e,t,n){return r.apply(this,arguments)}}()));case 3:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()}]),r}();var xwa={};xwa=function(o){var n=o.socketFactory,t=o.host,r=o.port,e=o.ssl,s=o.onConnect,a=o.onData,c=o.onEnd,p=o.onError,u=o.onTimeout,$=n({host:t,port:r,ssl:e,onConnect:s});return $.on("data",a),$.on("end",c),$.on("error",p),$.on("timeout",u),$};var ywa={};function NC(r,e,n,t,a,o,i){try{var c=r[o](i),$=c.value}catch(u){return void n(u)}c.done?e($):Promise.resolve($).then(t,a)}function zwa(r){return function(){var e=this,n=arguments;return new Promise(function(t,a){var o=r.apply(e,n);function i(r){NC(o,t,a,i,c,"next",r)}function c(r){NC(o,t,a,i,c,"throw",r)}i(void 0)})}}var OC=(h(),g);ywa=function(){var r=zwa(regeneratorRuntime.mark(function r(e){var n,t,a,o,i,c,$,u;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n=e.correlationId,t=e.clientId,a=e.request,o=a.apiKey,**a.apiVersion,c=a.encode,r.next=3,c();case 3:return $=r.sent,u=new OC().writeInt16(o).writeInt16(i).writeInt32(n).writeString(t).writeEncoder($),r.abrupt("return",new OC().writeInt32(u.size()).writeEncoder(u));case 6:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();var xg={},Awa=-2,Bwa=-1,Cwa=Math.pow(2,32);xg={EARLIEST_OFFSET:Awa,LATEST_OFFSET:Bwa,INT_32_MAX_VALUE:Cwa};var Dwa={};Dwa=function(){return{KAFKAJS_DEBUG_PROTOCOL_BUFFERS:void 0,KAFKAJS_DEBUG_EXTENDED_PROTOCOL_BUFFERS:void 0}};var hj={};hj=function(t){return function(n){return"".concat(t,".").concat(n)}};var W={},un=hj("network");W={NETWORK_REQUEST:un("request"),NETWORK_REQUEST_TIMEOUT:un("request_timeout"),NETWORK_REQUEST_QUEUE_SIZE:un("request_queue_size")};var Ewa={};function PC(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var **Object.getOwnPropertySymbols(e);t&&(**i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function Fwa(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,n,o=!0,a=!1;return{s:function(){**e[Symbol.iterator]()},n:function(){var e=i.next();return o=e.done,e},e:function(e){a=!0,n=e},f:function(){try{o||null==i.return||i.return()}finally{if(a)throw n}}}}function SC(e){return Pwa(e)||Owa(e)||TC(e)||Nwa()}function Nwa(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function TC(e,t){if(e){if("string"==typeof e)return vn(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?vn(e,t):void 0}}function Owa(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}function Pwa(e){if(Array.isArray(e))return vn(e)}function vn(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,**new Array(t);r=this.maxInFlightRequests)return this.pending.push(a),this.logger.debug("Request enqueued",{clientId:this.clientId,broker:this.broker,correlationId:r}),void this[ij.EMIT_QUEUE_SIZE_EVENT]();a.send(),a.expectResponse||(this.logger.debug("Request does not expect a response, resolving immediately",{clientId:this.clientId,broker:this.broker,correlationId:r}),this.inflight.delete(r),a.completed({size:0,payload:null}))}},{key:"fulfillRequest",value:function(e){var t=e.correlationId,r=e.payload,**e.size,n=this.inflight.get(t);if(this.pending.length>0){var o=this.pending.pop();o.send(),this.logger.debug("Consumed pending request",{clientId:this.clientId,broker:this.broker,correlationId:o.correlationId,pendingDuration:o.pendingDuration,currentPendingQueueSize:this.pending.length}),this[ij.EMIT_QUEUE_SIZE_EVENT]()}this.inflight.delete(t),n?n.completed({size:i,payload:r}):this.logger.warn("Response without match",{clientId:this.clientId,broker:this.broker,correlationId:t})}},{key:"rejectAll",value:function(e){var t,r=Mwa([].concat(SC(this.inflight.values()),SC(this.pending)));try{for(r.s();!(t=r.n()).done;){var **t.value;i.rejected(e),this.inflight.delete(i.correlationId)}}catch(n){r.e(n)}finally{r.f()}this.pending=[],this.inflight.clear(),this[ij.EMIT_QUEUE_SIZE_EVENT]()}}]),e}();var Swa={},Ze=(z(),r).Buffer;function VC(e,r,t,n,o,a,c){try{var s=e[a](c),**s.value}catch(u){return void t(u)}s.done?r(i):Promise.resolve(i).then(n,o)}function _d(e){return function(){var r=this,t=arguments;return new Promise(function(n,o){var a=e.apply(r,t);function c(e){VC(a,n,o,c,s,"next",e)}function s(e){VC(a,n,o,c,s,"throw",e)}c(void 0)})}}function WC(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function XC(e){for(var r=1;r1&&void 0!==arguments[1]?arguments[1]:{};(0,t.logger[e])(r,XC({broker:t.broker,clientId:v},n))}};this.logDebug=E("debug"),this.logError=E("error");var **Dwa();this.shouldLogBuffers="1"===I.KAFKAJS_DEBUG_PROTOCOL_BUFFERS,this.shouldLogFetchBuffer=this.shouldLogBuffers&&"1"===I.KAFKAJS_DEBUG_EXTENDED_PROTOCOL_BUFFERS}return Vwa(e,[{key:"connect",value:function(){var e=this;return new Promise(function(r,t){if(e.connected)return r(!0);var n,o=function(){var r=_d(regeneratorRuntime.mark(function r(){var t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return clearTimeout(n),t=e.connected,r.next=4,e.disconnect();case 4:e.authHandlers?e.authHandlers.onError():t&&(e.logDebug("Kafka server has closed connection"),e.rejectRequests(new $e("Closed connection",{broker:"".concat(e.host,":").concat(e.port)})));case 5:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}(),a=function(){var r=_d(regeneratorRuntime.mark(function r(o){var a;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return clearTimeout(n),a=new $e("Connection error: ".concat(o.message),{broker:"".concat(e.host,":").concat(e.port),code:o.code}),e.logError(a.message,{stack:o.stack}),r.next=5,e.disconnect();case 5:e.rejectRequests(a),t(a);case 7:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}(),c=function(){var r=_d(regeneratorRuntime.mark(function r(){var n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return n=new $e("Connection timeout",{broker:"".concat(e.host,":").concat(e.port)}),e.logError(n.message),r.next=4,e.disconnect();case 4:e.rejectRequests(n),t(n);case 6:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}();e.logDebug("Connecting",{ssl:!!e.ssl,sasl:!!e.sasl});try{n=setTimeout(c,e.connectionTimeout),e.socket=xwa({socketFactory:e.socketFactory,host:e.host,port:e.port,ssl:e.ssl,onConnect:function(){clearTimeout(n),e.connected=!0,r(!0)},onData:function(r){e.processData(r)},onEnd:o,onError:a,onTimeout:c})}catch(s){clearTimeout(n),t(new $e("Failed to connect: ".concat(s.message),{broker:"".concat(e.host,":").concat(e.port)}))}})}},{key:"disconnect",value:function(){var e=_d(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(this.connected){e.next=2;break}return e.abrupt("return",!0);case 2:return this.logDebug("disconnecting..."),this.connected=!1,this.socket.end(),this.socket.unref(),this.logDebug("disconnected"),e.abrupt("return",!0);case 8:case"end":return e.stop();}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"authenticate",value:function(e){var r=this,t=e.authExpectResponse,n=void 0!==t&&t,o=e.request,a=e.response;return this.authExpectResponse=n,new Promise(function(){var e=_d(regeneratorRuntime.mark(function e(t,n){var c;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r.authHandlers={onSuccess:function(e){r.authHandlers=null,r.authExpectResponse=!1,a.decode(e).then(function(e){return a.parse(e)}).then(t).catch(n)},onError:function(){r.authHandlers=null,r.authExpectResponse=!1,n(new $e("Connection closed by the server",{broker:"".concat(r.host,":").concat(r.port)}))}},e.prev=1,e.next=4,o.encode();case 4:c=e.sent,r.failIfNotConnected(),r.socket.write(c.buffer,"binary"),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(1),n(e.t0);case 12:case"end":return e.stop();}},e,null,[[1,9]])}));return function(r,t){return e.apply(this,arguments)}}())}},{key:"send",value:function(){var e=_d(regeneratorRuntime.mark(function e(r){var t,n,o,a,c,s,i,u,l,$,f,p,v,h,d,C=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.request,n=r.response,o=r.requestTimeout,a=void 0===o?null:o,this.failIfNotConnected(),c=!t.expectResponse||t.expectResponse(),s=function(){var e=_d(regeneratorRuntime.mark(function e(){var r,n,o,s,i,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=C.clientId,n=C.nextCorrelationId(),e.next=4,ywa({request:t,correlationId:n,clientId:r});case 4:return o=e.sent,s=t.apiKey,**t.apiName,u=t.apiVersion,C.logDebug("Request ".concat(kj(t)),{correlationId:n,expectResponse:c,size:Ze.byteLength(o.buffer)}),e.abrupt("return",new Promise(function(e,r){try{C.failIfNotConnected();var t={apiKey:s,apiName:i,apiVersion:u,correlationId:n,resolve:e,reject:r};C.requestQueue.push({entry:t,expectResponse:c,requestTimeout:a,sendRequest:function(){C.socket.write(o.buffer,"binary")}})}catch(l){r(l)}}));case 8:case"end":return e.stop();}},e)}));return function(){return e.apply(this,arguments)}}(),e.next=6,s();case 6:if(**e.sent,u=i.correlationId,l=i.size,$=i.entry,f=i.payload,c){e.next=13;break}return e.abrupt("return");case 13:return e.prev=13,e.next=16,n.decode(f);case 16:return p=e.sent,e.next=19,n.parse(p);case 19:return v=e.sent,h="Fetch"===$.apiName,this.logDebug("Response ".concat(kj($)),{correlationId:u,size:l,data:h&&!this.shouldLogFetchBuffer?"[filtered]":v}),e.abrupt("return",v);case 25:throw e.prev=25,e.t0=e.catch(13),"ApiVersions"!==$.apiName&&this.logError("Response ".concat(kj($)),{error:e.t0.message,correlationId:u,size:l}),d=Ze.isBuffer(f),this.logDebug("Response ".concat(kj($)),{error:e.t0.message,correlationId:u,payload:d&&!this.shouldLogBuffers?{type:"Buffer",data:"[filtered]"}:f}),e.t0;case 31:case"end":return e.stop();}},e,this,[[13,25]])}));return function(r){return e.apply(this,arguments)}}()},{key:"failIfNotConnected",value:function(){if(!this.connected)throw new $e("Not connected",{broker:"".concat(this.host,":").concat(this.port)})}},{key:"nextCorrelationId",value:function(){return this.correlationId>=Xwa&&(this.correlationId=0),this.correlationId++}},{key:"processData",value:function(e){if(this.authHandlers&&!this.authExpectResponse)return this.authHandlers.onSuccess(e);for(this.buffer=Ze.concat([this.buffer,e]);Ze.byteLength(this.buffer)>jj.int32Size();){var r=Ze.from(this.buffer),t=new jj(r),n=t.readInt32();if(!t.canReadBytes(n))return;var o=new jj(t.readBytes(n));if(this.buffer=t.readAll(),this.authHandlers){var a=jj.int32Size()+n,c=r.slice(0,a);return this.authHandlers.onSuccess(c)}var s=o.readInt32(),**o.readAll();this.requestQueue.fulfillRequest({size:n,correlationId:s,payload:i})}}},{key:"rejectRequests",value:function(e){this.requestQueue.rejectAll(e)}}]),e}();var Ywa={};function Zwa(r,e){return bxa(r)||axa(r,e)||_wa(r,e)||$wa()}function $wa(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _wa(r,e){if(r){if("string"==typeof r)return ZC(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?ZC(r,e):void 0}}function ZC(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,a=new Array(e);t0&&void 0!==arguments[0]?arguments[0]:{},t=r.host,k=r.port,F=r.rack;if(!t){var m=Zwa(I[f++%y].split(":"),2),b=m[0],d=m[1];t=b,k=Number(d)}return new Swa({host:t,port:k,rack:F,ssl:a,sasl:o,clientId:n,socketFactory:e,connectionTimeout:$,requestTimeout:u,enforceRequestTimeout:i,maxInFlightRequests:l,instrumentationEmitter:v,retry:s,logger:c})}}};var fxa={};function $C(r){if("undefined"==typeof Symbol||null==r[Symbol.iterator]){if(Array.isArray(r)||(r=bD(r))){var e=0,t=function(){};return{s:t,n:function(){return e>=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(r){throw r},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a,o=!0,i=!1;return{s:function(){n=r[Symbol.iterator]()},n:function(){var r=n.next();return o=r.done,r},e:function(r){i=!0,a=r},f:function(){try{o||null==n.return||n.return()}finally{if(i)throw a}}}}function _C(r,e,t,n,a,o,i){try{var u=r[o](i),c=u.value}catch(s){return void t(s)}u.done?e(c):Promise.resolve(c).then(n,a)}function la(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var o=r.apply(e,t);function i(r){_C(o,n,a,i,u,"next",r)}function u(r){_C(o,n,a,i,u,"throw",r)}i(void 0)})}}function gxa(r,e){if(!(r instanceof e))throw new TypeError("Cannot call a class as a function")}function aD(r,e){for(var t=0;tr.length)&&(e=r.length);for(var t=0,n=new Array(e);t0&&void 0!==o[0]?o[0]:{},t=e.topics,n=void 0===t?[]:t,r.abrupt("return",this.retrier(function(){var r=la(regeneratorRuntime.mark(function r(e,t,o){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,a.brokerPool.refreshMetadataIfNecessary(n);case 3:return r.abrupt("return",a.brokerPool.withBroker(function(){var r=la(regeneratorRuntime.mark(function r(e){var t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.broker,r.abrupt("return",t.metadata(n));case 2:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}()));case 6:if(r.prev=6,r.t0=r.catch(0),"LEADER_NOT_AVAILABLE"!==r.t0.type){r.next=10;break}throw r.t0;case 10:e(r.t0);case 11:case"end":return r.stop();}},r,null,[[0,6]])}));return function(e,t,n){return r.apply(this,arguments)}}()));case 2:case"end":return r.stop();}},r,this)}));return function(){return r.apply(this,arguments)}}()},{key:"addTargetTopic",value:function(){var r=la(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",this.addMultipleTargetTopics([e]));case 1:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"addMultipleTargetTopics",value:function(){var r=la(regeneratorRuntime.mark(function r(e){var t,n,a,o;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:t=this.targetTopics.size,n=$C(e);try{for(n.s();!(a=n.n()).done;)o=a.value,this.targetTopics.add(o)}catch(i){n.e(i)}finally{n.f()}if(!(t!==this.targetTopics.size||!this.brokerPool.metadata)){r.next=7;break}return r.next=7,this.refreshMetadata();case 7:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"findBroker",value:function(){var r=la(regeneratorRuntime.mark(function r(e){var t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.nodeId,r.prev=1,r.next=4,this.brokerPool.findBroker({nodeId:t});case 4:return r.abrupt("return",r.sent);case 7:if(r.prev=7,r.t0=r.catch(1),"KafkaJSBrokerNotFound"!==r.t0.name&&"KafkaJSLockTimeout"!==r.t0.name&&"ECONNREFUSED"!==r.t0.code){r.next=12;break}return r.next=12,this.refreshMetadata();case 12:throw r.t0;case 13:case"end":return r.stop();}},r,this,[[1,7]])}));return function(e){return r.apply(this,arguments)}}()},{key:"findControllerBroker",value:function(){var r=la(regeneratorRuntime.mark(function r(){var e,t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if((e=this.brokerPool.metadata)&&null!=e.controllerId){r.next=3;break}throw new qxa("Topic metadata not loaded");case 3:return r.next=5,this.findBroker({nodeId:e.controllerId});case 5:if(t=r.sent){r.next=8;break}throw new pxa("Controller broker with id ".concat(e.controllerId," not found in the cached metadata"));case 8:return r.abrupt("return",t);case 9:case"end":return r.stop();}},r,this)}));return function(){return r.apply(this,arguments)}}()},{key:"findTopicPartitionMetadata",value:function(r){var e=this.brokerPool.metadata;if(!e||!e.topicMetadata)throw new rxa("Topic metadata not loaded",{topic:r});var t=e.topicMetadata.find(function(e){return e.topic===r});return t?t.partitionMetadata:[]}},{key:"findLeaderForPartitions",value:function(r,e){var t=this.findTopicPartitionMetadata(r);return e.reduce(function(e,n){var a=parseInt(n,10),o=t.find(function(r){return r.partitionId===a});if(!o)return e;if(null===o.leader||void 0===o.leader)throw new oxa("Invalid partition metadata",{topic:r,partitionId:a,metadata:o});var **o.leader,u=e[i]||[];return lj({},e,yn({},i,[].concat(wn(u),[a])))},{})}},{key:"findGroupCoordinator",value:function(){var r=la(regeneratorRuntime.mark(function r(e){var t,n,a,o=this;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.groupId,n=e.coordinatorType,a=void 0===n?Jf.GROUP:n,r.abrupt("return",this.retrier(function(){var r=la(regeneratorRuntime.mark(function r(e,n,i){var u,c;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,o.findGroupCoordinatorMetadata({groupId:t,coordinatorType:a});case 3:return u=r.sent,c=u.coordinator,r.next=7,o.findBroker({nodeId:c.nodeId});case 7:return r.abrupt("return",r.sent);case 10:if(r.prev=10,r.t0=r.catch(0),"KafkaJSBrokerNotFound"!==r.t0.name&&"GROUP_COORDINATOR_NOT_AVAILABLE"!==r.t0.type){r.next=17;break}return o.logger.debug("".concat(r.t0.message,", refreshing metadata and trying again..."),{groupId:t,retryCount:n,retryTime:i}),r.next=16,o.refreshMetadata();case 16:throw r.t0;case 17:if("ECONNREFUSED"!==r.t0.code){r.next=19;break}throw r.t0;case 19:e(r.t0);case 20:case"end":return r.stop();}},r,null,[[0,10]])}));return function(e,t,n){return r.apply(this,arguments)}}()));case 2:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"findGroupCoordinatorMetadata",value:function(){var r=la(regeneratorRuntime.mark(function r(e){var t,n,a,o=this;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return t=e.groupId,n=e.coordinatorType,r.next=3,this.brokerPool.withBroker(function(){var r=la(regeneratorRuntime.mark(function r(e){var a,i;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return a=e.nodeId,**e.broker,r.next=3,o.retrier(function(){var r=la(regeneratorRuntime.mark(function r(e,u,c){var s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,i.findGroupCoordinator({groupId:t,coordinatorType:n});case 3:return s=r.sent,o.logger.debug("Found group coordinator",{broker:s.host,nodeId:s.coordinator.nodeId}),r.abrupt("return",s);case 8:if(r.prev=8,r.t0=r.catch(0),o.logger.debug("Tried to find group coordinator",{nodeId:a,error:r.t0}),"GROUP_COORDINATOR_NOT_AVAILABLE"!==r.t0.type){r.next=14;break}throw o.logger.debug("Group coordinator not available, retrying...",{nodeId:a,retryCount:u,retryTime:c}),r.t0;case 14:e(r.t0);case 15:case"end":return r.stop();}},r,null,[[0,8]])}));return function(e,t,n){return r.apply(this,arguments)}}());case 3:return r.abrupt("return",r.sent);case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}());case 3:if(!(a=r.sent)){r.next=6;break}return r.abrupt("return",a);case 6:throw new sxa("Failed to find group coordinator");case 7:case"end":return r.stop();}},r,this)}));return function(e){return r.apply(this,arguments)}}()},{key:"defaultOffset",value:function(r){return r.fromBeginning?mxa:nxa}},{key:"fetchTopicsOffset",value:function(){var r=la(regeneratorRuntime.mark(function r(e){var t,n,a,o,i,u,c,s,p,d=this;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:t={},n={},a=function(r){return function(e){var t=n[r].fromBeginning;return lj({},e,{timestamp:d.defaultOffset({fromBeginning:t})})}},o=$C(e);try{for(u=function(){var r=i.value,e=r.topic,a=r.partitions,o=r.fromBeginning,u=d.findLeaderForPartitions(e,a.map(function(r){return r.partition}));n[e]={fromBeginning:o},mj(u).map(function(r){t[r]=t[r]||{},t[r][e]=a.filter(function(e){return u[r].includes(e.partition)})})},o.s();!(**o.n()).done;)u()}catch($){o.e($)}finally{o.f()}return c=mj(t).map(function(){var r=la(regeneratorRuntime.mark(function r(e){var n,o,i,u;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,d.findBroker({nodeId:e});case 2:return n=r.sent,o=t[e],r.next=6,n.listOffsets({isolationLevel:d.isolationLevel,topics:mj(o).map(function(r){return{topic:r,partitions:o[r].map(a(r))}})});case 6:return **r.sent,u=i.responses,r.abrupt("return",u);case 9:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}()),r.next=8,Promise.all(c);case 8:return s=r.sent,p=lxa(s).reduce(txa,{}),r.abrupt("return",mj(p).map(function(r){return{topic:r,partitions:p[r].map(function(r){return{partition:r.partition,offset:r.offset}})}}));case 11:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}()},{key:"committedOffsets",value:function(r){var e=r.groupId;return this.committedOffsetsByGroup.has(e)||this.committedOffsetsByGroup.set(e,{}),this.committedOffsetsByGroup.get(e)}},{key:"markOffsetAsCommitted",value:function(r){var e=r.groupId,t=r.topic,n=r.partition,a=r.offset,o=this.committedOffsets({groupId:e});o[t]=o[t]||{},o[t][n]=a}}]),r}();var uxa={},dD=(z(),r).Buffer,vxa=2538058380,zg=1540483477,wxa=24;uxa=function($){for(var r=dD.isBuffer($)?$:dD.from(String($)),o=r.length,a=vxa^o,E=o/4,e=0;e>>wxa,a*=zg,a^=H*=zg}switch(o%4){case 3:a^=(255&r[2+(-4&o)])<<16;case 2:a^=(255&r[1+(-4&o)])<<8;case 1:a^=255&r[-4&o],a*=zg;}return a^=a>>>13,a*=zg,a^=a>>>15};var xxa={},yxa=(z(),r).Buffer,zxa=(y(),x),eD=zxa.KafkaJSNonRetriableError,fD=function(r){return{randomBytes:function($){return r.getRandomValues(yxa.allocUnsafe($))}}},gD=null;A&&A.crypto?gD=void 0===A.crypto.randomBytes?fD(A.crypto):A.crypto:A&&A.msCrypto?gD=fD(A.msCrypto):A&&!A.crypto&&(gD=(PB(),l));var hD=65536;xxa=function(r){if(r>hD)throw new eD("Byte length (".concat(r,") exceeds the max number of bytes of entropy available (").concat(hD,")"));if(!gD)throw new eD("No available crypto implementation");return gD.randomBytes(r)};var iD={},zn=function(t){return 2147483647&t};iD=function(t){return function(){var r=xxa(32).readUInt32BE(0);return function(e){e.topic;var **e.partitionMetadata,n=e.message,o=i.length,a=i.filter(function(t){return t.leader>=0}),$=a.length;return null!==n.partition&&void 0!==n.partition?n.partition:null!==n.key&&void 0!==n.key?zn(t(n.key))%o:$>0?a[zn(++r)%$].partitionId:zn(++r)%o}}};var Axa={};Axa=iD(uxa);var Bxa={},jD=(z(),r).Buffer,nj=(Ia(),Fa),Cxa=nj.fromValue(2538058380),Ag=1540483477,Dxa=24;Bxa=function($){for(var r=jD.isBuffer($)?$:jD.from(String($)),a=r.length,o=nj.fromValue(Cxa.xor(a)),**Math.floor(a/4),q=0;q>>Dxa),A=nj.fromValue(A).multiply(Ag),o=(o=o.multiply(Ag)).xor(A)}switch(a%4){case 3:o=o.xor((255&r[2+(-4&a)])<<16);case 2:o=o.xor((255&r[1+(-4&a)])<<8);case 1:o=(o=o.xor(255&r[-4&a])).multiply(Ag);}return(o=(o=(o=o.xor(o.toInt()>>>13)).multiply(Ag)).xor(o.toInt()>>>15)).toInt()};var Exa={};Exa=iD(Bxa);var kD={};kD={DefaultPartitioner:Axa,JavaCompatiblePartitioner:Exa};var H={};H={UNINITIALIZED:"UNINITIALIZED",READY:"READY",TRANSACTING:"TRANSACTING",COMMITTING:"COMMITTING",ABORTING:"ABORTING"};var Bg,Fxa={};function lD(r,a){var e=Object.keys(r);if(Object.getOwnPropertySymbols){var $=Object.getOwnPropertySymbols(r);a&&($=$.filter(function(a){return Object.getOwnPropertyDescriptor(r,a).enumerable})),e.push.apply(e,$)}return e}function Gxa(r){for(var a=1;a ").concat(r)),!Kxa[$].includes(r))throw new An("Transaction state exception: Invalid transition ".concat($," --> ").concat(r));t.emit("transition",{to:r,from:$}),$=r},state:function(){return $}});return t};var mD={};function nD(r,e,t,n,a,o,s){try{var **r[o](s),c=i.value}catch(v){return void t(v)}i.done?e(c):Promise.resolve(c).then(n,a)}function ae(r){return function(){var e=this,t=arguments;return new Promise(function(n,a){var o=r.apply(e,t);function s(r){nD(o,n,a,s,i,"next",r)}function i(r){nD(o,n,a,s,i,"throw",r)}s(void 0)})}}var Lxa=(y(),x),oD=Lxa.KafkaJSNonRetriableError,pD=(ok(),nk),qD=-1,rD=0,Mxa=Math.pow(2,32),Nxa=["NOT_COORDINATOR_FOR_GROUP","GROUP_COORDINATOR_NOT_AVAILABLE","GROUP_LOAD_IN_PROGRESS","CONCURRENT_TRANSACTIONS"],Oxa=["UNKNOWN_TOPIC_OR_PARTITION","COORDINATOR_LOAD_IN_PROGRESS"],Pxa=["COORDINATOR_NOT_AVAILABLE","NOT_COORDINATOR"];mD=function(r){var e=r.logger,t=r.cluster,n=r.transactionTimeout,a=void 0===n?6e4:n,o=r.transactional,s=r.transactionalId;if(o&&!s)throw new oD("Cannot manage transactions without a transactionalId");var **Ya(t.retry),c=qD,v=0,u={},$={},S=Fxa({logger:e});S.on("transition",function(r){r.to===H.READY&&($={})});var T=function(){return t.findGroupCoordinator({groupId:s,coordinatorType:Jf.TRANSACTION})},R=function(){if(!o)throw new oD("Method unavailable if non-transactional")},d=S.createGuarded({getProducerId:function(){return c},getProducerEpoch:function(){return v},getTransactionalId:function(){return s},initProducerId:function(){return ae(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",i(function(){var r=ae(regeneratorRuntime.mark(function r(n,i,$){var R,d;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,t.refreshMetadataIfNecessary();case 3:return r.next=5,o?T():t.findControllerBroker();case 5:return R=r.sent,r.next=8,R.initProducerId({transactionalId:o?s:void 0,transactionTimeout:a});case 8:d=r.sent,S.transitionTo(H.READY),c=d.producerId,v=d.producerEpoch,u={},e.debug("Initialized producer id & epoch",{producerId:c,producerEpoch:v}),r.next=22;break;case 16:if(r.prev=16,r.t0=r.catch(0),!Nxa.includes(r.t0.type)){r.next=21;break}throw"CONCURRENT_TRANSACTIONS"===r.t0.type&&e.debug("There is an ongoing transaction on this transactionId, retrying",{error:r.t0.message,stack:r.t0.stack,transactionalId:s,retryCount:i,retryTime:$}),r.t0;case 21:n(r.t0);case 22:case"end":return r.stop();}},r,null,[[0,16]])}));return function(e,t,n){return r.apply(this,arguments)}}()));case 1:case"end":return r.stop();}},r)}))()},getSequence:function(r,e){return d.isInitialized()?(u[r]=u[r]||{},u[r][e]=u[r][e]||rD,u[r][e]):rD},updateSequence:function(r,t,n){if(d.isInitialized()){var a=d.getSequence(r,t)+n;a>=Mxa&&(e.debug("Sequence for ".concat(r," ").concat(t," exceeds max value (").concat(a,"). Rotating to 0.")),a=0),u[r][t]=a}},beginTransaction:function(){R(),S.transitionTo(H.TRANSACTING)},addPartitionsToTransaction:function(r){return ae(regeneratorRuntime.mark(function e(){var t,n,a;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(R(),t={},r.forEach(function(r){var e=r.topic,n=r.partitions;$[e]=$[e]||{},n.forEach(function(r){var n=r.partition;$[e][n]||(t[e]=t[e]||[],t[e].push(n))})}),!(n=Object.keys(t).map(function(r){return{topic:r,partitions:t[r]}})).length){e.next=10;break}return e.next=7,T();case 7:return a=e.sent,e.next=10,a.addPartitionsToTxn({transactionalId:s,producerId:c,producerEpoch:v,topics:n});case 10:n.forEach(function(r){var e=r.topic;r.partitions.forEach(function(r){$[e][r]=!0})});case 11:case"end":return e.stop();}},e)}))()},commit:function(){return ae(regeneratorRuntime.mark(function r(){var e;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return R(),S.transitionTo(H.COMMITTING),r.next=4,T();case 4:return e=r.sent,r.next=7,e.endTxn({producerId:c,producerEpoch:v,transactionalId:s,transactionResult:!0});case 7:S.transitionTo(H.READY);case 8:case"end":return r.stop();}},r)}))()},abort:function(){return ae(regeneratorRuntime.mark(function r(){var e;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return R(),S.transitionTo(H.ABORTING),r.next=4,T();case 4:return e=r.sent,r.next=7,e.endTxn({producerId:c,producerEpoch:v,transactionalId:s,transactionResult:!1});case 7:S.transitionTo(H.READY);case 8:case"end":return r.stop();}},r)}))()},isInitialized:function(){return c!==qD},isTransactional:function(){return o},isInTransaction:function(){return S.state()===H.TRANSACTING},sendOffsets:function(r){return ae(regeneratorRuntime.mark(function n(){var a,o,u,$;return regeneratorRuntime.wrap(function(n){for(;;)switch(n.prev=n.next){case 0:return a=r.consumerGroupId,o=r.topics,pD(a,"Missing consumerGroupId"),pD(o,"Missing offset topics"),n.next=5,T();case 5:return u=n.sent,n.next=8,u.addOffsetsToTxn({transactionalId:s,producerId:c,producerEpoch:v,groupId:a});case 8:return n.next=10,t.findGroupCoordinator({groupId:a,coordinatorType:Jf.GROUP});case 10:return $=n.sent,n.abrupt("return",i(function(){var r=ae(regeneratorRuntime.mark(function r(n,i,u){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,$.txnOffsetCommit({transactionalId:s,producerId:c,producerEpoch:v,groupId:a,topics:o});case 3:r.next=17;break;case 5:if(r.prev=5,r.t0=r.catch(0),!Oxa.includes(r.t0.type)){r.next=10;break}throw e.debug("Group coordinator is not ready yet, retrying",{error:r.t0.message,stack:r.t0.stack,transactionalId:s,retryCount:i,retryTime:u}),r.t0;case 10:if(!Pxa.includes(r.t0.type)&&"ECONNREFUSED"!==r.t0.code){r.next=16;break}return e.debug("Invalid group coordinator, finding new group coordinator and retrying",{error:r.t0.message,stack:r.t0.stack,transactionalId:s,retryCount:i,retryTime:u}),r.next=14,t.findGroupCoordinator({groupId:a,coordinatorType:Jf.GROUP});case 14:throw $=r.sent,r.t0;case 16:n(r.t0);case 17:case"end":return r.stop();}},r,null,[[0,5]])}));return function(e,t,n){return r.apply(this,arguments)}}()));case 12:case"end":return n.stop();}},n)}))()}},{initProducerId:{legalStates:[H.UNINITIALIZED,H.READY]},beginTransaction:{legalStates:[H.READY],async:!1},addPartitionsToTransaction:{legalStates:[H.TRANSACTING]},sendOffsets:{legalStates:[H.TRANSACTING]},commit:{legalStates:[H.TRANSACTING]},abort:{legalStates:[H.TRANSACTING]}});return d};var Qxa={};function Rxa(r,e,a){return e in r?Object.defineProperty(r,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):r[e]=a,r}function Sxa(r){return Wxa(r)||Vxa(r)||Uxa(r)||Txa()}function Txa(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Uxa(r,e){if(r){if("string"==typeof r)return Bn(r,e);var a=Object.prototype.toString.call(r).slice(8,-1);return"Object"===a&&r.constructor&&(a=r.constructor.name),"Map"===a||"Set"===a?Array.from(a):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Bn(r,e):void 0}}function Vxa(r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r))return Array.from(r)}function Wxa(r){if(Array.isArray(r))return Bn(r)}function Bn(r,e){(null==e||e>r.length)&&(e=r.length);for(var a=0,t=new Array(e);a=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(r){throw r},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,n,o=!0,i=!1;return{s:function(){a=r[Symbol.iterator]()},n:function(){var r=a.next();return o=r.done,r},e:function(r){i=!0,n=r},f:function(){try{o||null==a.return||a.return()}finally{if(i)throw n}}}}function uD(r,e){if(r){if("string"==typeof r)return vD(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?vD(r,e):void 0}}function vD(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,a=new Array(e);t=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(r){throw r},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,n,o=!0,i=!1;return{s:function(){a=r[Symbol.iterator]()},n:function(){var r=a.next();return o=r.done,r},e:function(r){i=!0,n=r},f:function(){try{o||null==a.return||a.return()}finally{if(i)throw n}}}}function zD(r,e){if(r){if("string"==typeof r)return En(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?En(r,e):void 0}}function En(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,a=new Array(e);t=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(r){throw r},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a,o=!0,c=!1;return{s:function(){n=r[Symbol.iterator]()},n:function(){var r=n.next();return o=r.done,r},e:function(r){c=!0,a=r},f:function(){try{o||null==n.return||n.return()}finally{if(c)throw a}}}}function uya(r,e){if(r){if("string"==typeof r)return FD(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?FD(r,e):void 0}}function FD(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t=r.length?{done:!0}:{done:!1,value:r[t++]}},e:function(r){throw r},f:e}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,i,o=!0,a=!1;return{s:function(){n=r[Symbol.iterator]()},n:function(){var r=n.next();return o=r.done,r},e:function(r){a=!0,**r},f:function(){try{o||null==n.return||n.return()}finally{if(a)throw i}}}}function Oya(r,t){if(r){if("string"==typeof r)return MD(r,t);var e=Object.prototype.toString.call(r).slice(8,-1);return"Object"===e&&r.constructor&&(e=r.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?MD(r,t):void 0}}function MD(r,t){(null==t||t>r.length)&&(t=r.length);for(var e=0,n=new Array(t);e=this.lastCommit+this.autoCommitInterval,n=null!=this.autoCommitThreshold&&this.countResolvedOffsets().gte(dd.fromValue(this.autoCommitThreshold)),!e&&!n){r.next=5;break}return r.abrupt("return",this.commitOffsets());case 5:case"end":return r.stop();}},r,this)}));return function(){return r.apply(this,arguments)}}()},{key:"uncommittedOffsets",value:function(){var r=this,t=function(t){return On(r.resolvedOffsets[t])},e=function(t){return function(e){return{partition:e,offset:r.resolvedOffsets[t][e]}}},n=function(t){return function(e){var n=e.partition,**e.offset;return i!==r.committedOffsets()[t][n]&&dd.fromValue(i).greaterThanOrEqual(0)}};return{topics:this.topics.map(function(r){return{topic:r,partitions:t(r).map(e(r)).filter(n(r))}}).filter(function(r){return r.partitions.length>0})}}},{key:"commitOffsets",value:function(){var r=cf(regeneratorRuntime.mark(function r(){var t,e,n,i,o,a,s,u,f=this,c=arguments;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(t=c.length>0&&void 0!==c[0]?c[0]:{},e=this.groupId,n=this.generationId,**this.memberId,o=t.topics,0!==(a=void 0===o?this.uncommittedOffsets().topics:o).length){r.next=6;break}return this.lastCommit=Date.now(),r.abrupt("return");case 6:return s={groupId:e,memberId:i,groupGenerationId:n,topics:a},r.prev=7,r.next=10,this.getCoordinator();case 10:return u=r.sent,r.next=13,u.offsetCommit(s);case 13:this.instrumentationEmitter.emit(Tya,s),a.forEach(function(r){var t=r.topic,e=r.partitions.reduce(function(r,t){var e=t.partition,n=t.offset;return df(r,sj({},e,n))},{});df(f.committedOffsets()[t],e)}),this.lastCommit=Date.now(),r.next=24;break;case 18:if(r.prev=18,r.t0=r.catch(7),"NOT_COORDINATOR_FOR_GROUP"!==r.t0.type){r.next=23;break}return r.next=23,this.cluster.refreshMetadata();case 23:throw r.t0;case 24:case"end":return r.stop();}},r,this,[[7,18]])}));return function(){return r.apply(this,arguments)}}()},{key:"resolveOffsets",value:function(){var r=cf(regeneratorRuntime.mark(function r(){var t,e,n,i,o,a,s,u,f,***=this;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(t=this.groupId,e=function(r){return function(t){return Ln(p.committedOffsets()[r][t])}},0!==(n=this.topics.map(function(r){return{topic:r,partitions:p.memberAssignment[r].filter(e(r)).map(function(r){return{partition:r}})}}).filter(function(r){return r.partitions.length>0})).length){r.next=5;break}return r.abrupt("return");case 5:return r.next=7,this.getCoordinator();case 7:return **r.sent,r.next=10,i.offsetFetch({groupId:t,topics:n});case 10:if(o=r.sent,a=o.responses,s=a.map(function(r){var t=r.topic,e=r.partitions;return df({topic:t,partitions:e.filter(function(r){var t=r.offset;return Ln(t)}).map(function(r){var t=r.partition;return df({partition:t})})},p.topicConfigurations[t])}),u=function(r,t){var e=t.partition,n=t.offset;return df(r,sj({},e,n))},f=a,!function(){return s.filter(function(r){return r.partitions.length>0}).length>0}()){r.next=21;break}return r.next=19,this.cluster.fetchTopicsOffset(s);case 19:c=r.sent,f=Hya(a,c);case 21:f.forEach(function(r){var t=r.topic,e=r.partitions;p.committedOffsets()[t]=e.reduce(u,Pya({},p.committedOffsets()[t]))});case 22:case"end":return r.stop();}},r,this)}));return function(){return r.apply(this,arguments)}}()},{key:"clearOffsets",value:function(r){var t=r.topic,e=r.partition;delete this.committedOffsets()[t][e],delete this.resolvedOffsets[t][e]}},{key:"clearAllOffsets",value:function(){var r=this.committedOffsets();for(var t in r)delete r[t];var e,n=Nya(this.topics);try{for(n.s();!(e=n.n()).done;){r[e.value]={}}}catch(i){n.e(i)}finally{n.f()}this.resolvedOffsets=Uya(this.topics)}},{key:"committedOffsets",value:function(){return this[Pn.COMMITTED_OFFSETS]||(this[Pn.COMMITTED_OFFSETS]=this.groupId?this.cluster.committedOffsets({groupId:this.groupId}):{}),this[Pn.COMMITTED_OFFSETS]}}]),r}();var Vya={},QD=(z(),r).Buffer;function Wya(r){return $ya(r)||Zya(r)||Yya(r)||Xya()}function Xya(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Yya(r,e){if(r){if("string"==typeof r)return Qn(r,e);var a=Object.prototype.toString.call(r).slice(8,-1);return"Object"===a&&r.constructor&&(a=r.constructor.name),"Map"===a||"Set"===a?Array.from(a):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?Qn(r,e):void 0}}function Zya(r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r))return Array.from(r)}function $ya(r){if(Array.isArray(r))return Qn(r)}function Qn(r,e){(null==e||e>r.length)&&(e=r.length);for(var a=0,t=new Array(e);a0&&this.isEmptyIncludingFiltered()}},{key:"firstOffset",value:function(){return this.isEmptyIncludingFiltered()?null:this.messagesWithinOffset[0].offset}},{key:"lastOffset",value:function(){return this.isEmptyDueToLogCompactedMessages()?this.fetchedOffset:this.isEmptyIncludingFiltered()?be.fromValue(this.highWatermark).add(-1).toString():this.messagesWithinOffset[this.messagesWithinOffset.length-1].offset}},{key:"offsetLag",value:function(){var e=be.fromValue(this.highWatermark).add(-1),t=be.fromValue(this.lastOffset());return e.add(t.multiply(-1)).toString()}},{key:"offsetLagLow",value:function(){if(this.isEmptyIncludingFiltered())return"0";var e=be.fromValue(this.highWatermark).add(-1),t=be.fromValue(this.firstOffset());return e.add(t.multiply(-1)).toString()}}]),e}();var fza={};function gza(t){return(gza="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function Rn(t,r){return kza(t)||jza(t,r)||iza(t,r)||hza()}function hza(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function iza(t,r){if(t){if("string"==typeof t)return SD(t,r);var e=Object.prototype.toString.call(t).slice(8,-1);return"Object"===e&&t.constructor&&(e=t.constructor.name),"Map"===e||"Set"===e?Array.from(e):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?SD(t,r):void 0}}function SD(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=new Array(r);e0&&void 0!==arguments[0]?arguments[0]:[];this.assignedPartitionsByTopic=e.reduce(function(e,t){var r=t.topic,**t.partitions;return xza({},e,WD({},r,{topic:r,partitions:void 0===i?[]:i}))},{})}},{key:"pause",value:function(){var e=this;(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach(function(t){var r=t.topic,**t.partitions,n=e.subscriptionStatesByTopic[r]||YD(r);void 0===i?(n.paused.clear(),n.resumed.clear(),n.pauseAll=!0):Array.isArray(i)&&(i.forEach(function(e){n.paused.add(e),n.resumed.delete(e)}),n.pauseAll=!1),e.subscriptionStatesByTopic[r]=n})}},{key:"resume",value:function(){var e=this;(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).forEach(function(t){var r=t.topic,**t.partitions,n=e.subscriptionStatesByTopic[r]||YD(r);void 0===i?(n.paused.clear(),n.resumed.clear(),n.pauseAll=!1):Array.isArray(i)&&i.forEach(function(e){n.paused.delete(e),n.pauseAll&&n.resumed.add(e)}),e.subscriptionStatesByTopic[r]=n})}},{key:"assigned",value:function(){return Object.values(this.assignedPartitionsByTopic).map(function(e){return{topic:e.topic,partitions:e.partitions.sort()}})}},{key:"active",value:function(){var e=this;return Object.values(this.assignedPartitionsByTopic).map(function(t){var r=t.topic,**t.partitions;return{topic:r,partitions:i.filter(function(t){return!e.isPaused(r,t)}).sort()}})}},{key:"paused",value:function(){var e=this;return Object.values(this.assignedPartitionsByTopic).map(function(t){var r=t.topic,**t.partitions;return{topic:r,partitions:i.filter(function(t){return e.isPaused(r,t)}).sort()}}).filter(function(e){return 0!==e.partitions.length})}},{key:"isPaused",value:function(e,t){var r=this.subscriptionStatesByTopic[e];if(!r)return!1;var **r.resumed.has(t),n=r.paused.has(t);return r.pauseAll&&!i||n}}]),e}();var tj={},ZD=(z(),r).Buffer;function Aza(r,e,n){return e in r?Object.defineProperty(r,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):r[e]=n,r}var Tn=(h(),g),$D=(d(),c),Bza={encode:function(r){var e=r.version,n=r.topics,t=r.userData,a=void 0===t?ZD.alloc(0):t;return new Tn().writeInt16(e).writeArray(n).writeBytes(a).buffer},decode:function(r){var e=new $D(r);return{version:e.readInt16(),topics:e.readArray(function(r){return r.readString()}),userData:e.readBytes()}}},Cza={encode:function(r){var e=r.version,n=r.assignment,t=r.userData,a=void 0===t?ZD.alloc(0):t;return new Tn().writeInt16(e).writeArray(Object.keys(n).map(function(r){return new Tn().writeString(r).writeArray(n[r])})).writeBytes(a).buffer},decode:function(r){var e=new $D(r),n=function(r){return r.readInt32()};return e.canReadInt16()?{version:e.readInt16(),assignment:e.readArray(function(r){return{topic:r.readString(),partitions:r.readArray(n)}}).reduce(function(r,e){var n=e.topic,t=e.partitions;return Object.assign(r,Aza({},n,t))},{}),userData:e.readBytes()}:null}};tj={MemberMetadata:Bza,MemberAssignment:Cza};var Dza={};function Eza(e,t){return Hza(e)||Gza(e,t)||bE(e,t)||Fza()}function Fza(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Gza(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,a=!1,**void 0;try{for(var o,s=e[Symbol.iterator]();!(n=(o=s.next()).done)&&(r.push(o.value),!t||r.length!==t);n=!0);}catch(u){a=!0,**u}finally{try{n||null==s.return||s.return()}finally{if(a)throw i}}return r}}function Hza(e){if(Array.isArray(e))return e}function Iza(e){return(Iza="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _D(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Jza(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a,i=!0,o=!1;return{s:function(){n=e[Symbol.iterator]()},n:function(){var e=n.next();return **e.done,e},e:function(e){o=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(o)throw a}}}}function bE(e,t){if(e){if("string"==typeof e)return cE(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(r):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?cE(e,t):void 0}}function cE(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r0&&this.logger.warn("Consumer group received unsubscribed topics",{groupId:r,generationId:n,memberId:a,assignedTopics:h,topicsSubscribed:u,topicsNotSubscribed:v,helpUrl:Mza("docs/faq","why-am-i-receiving-messages-for-topics-i-m-not-subscribed-to")}),d=gj(h,v),g=d.map(function(e){return{topic:e,partitions:m[e]}}),b=Gg(g),e.prev=27,y=regeneratorRuntime.mark(function e(){var t,i,o,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=O.value,**t.topic,o=t.partitions,s=Z.partitionsPerSubscribedTopic.get(i),o.every(function(e){return s.includes(e)})){e.next=10;break}return Z.logger.warn("Consumer is not aware of all assigned partitions, refreshing metadata",{groupId:r,generationId:n,memberId:a,topic:i,knownPartitions:s,assignedPartitions:o}),e.next=8,Z.cluster.refreshMetadata();case 8:return Z.partitionsPerSubscribedTopic=Z.generatePartitionsPerSubscribedTopic(),e.abrupt("return","break");case 10:case"end":return e.stop();}},e)}),b.s();case 30:if((O=b.n()).done){e.next=37;break}return e.delegateYield(y(),"t0",32);case 32:if("break"!==e.t0){e.next=35;break}return e.abrupt("break",37);case 35:e.next=30;break;case 37:e.next=42;break;case 39:e.prev=39,e.t1=e.catch(27),b.e(e.t1);case 42:return e.prev=42,b.f(),e.finish(42);case 45:this.topics=g.map(function(e){return e.topic}),this.subscriptionState.assign(g),this.offsetManager=new Mya({cluster:this.cluster,topicConfigurations:this.topicConfigurations,instrumentationEmitter:this.instrumentationEmitter,memberAssignment:g.reduce(function(e,t){return Jza({},e,aE({},t.topic,t.partitions))},{}),autoCommitInterval:this.autoCommitInterval,autoCommitThreshold:this.autoCommitThreshold,coordinator:c,groupId:r,generationId:n,memberId:a});case 48:case"end":return e.stop();}},e,this,[[27,39,42,45]])}));return function(){return e.apply(this,arguments)}}()},{key:"resetOffset",value:function(e){var t=e.topic,r=e.partition;this.offsetManager.resetOffset({topic:t,partition:r})}},{key:"resolveOffset",value:function(e){var t=e.topic,r=e.partition,n=e.offset;this.offsetManager.resolveOffset({topic:t,partition:r,offset:n})}},{key:"seek",value:function(e){var t=e.topic,r=e.partition,n=e.offset;this.seekOffset.set(t,r,n)}},{key:"pause",value:function(e){this.logger.info("Pausing fetching from ".concat(e.length," topics"),{topicPartitions:e}),this.subscriptionState.pause(e)}},{key:"resume",value:function(e){this.logger.info("Resuming fetching from ".concat(e.length," topics"),{topicPartitions:e}),this.subscriptionState.resume(e)}},{key:"assigned",value:function(){return this.subscriptionState.assigned()}},{key:"paused",value:function(){return this.subscriptionState.paused()}},{key:"commitOffsetsIfNecessary",value:function(){var e=dc(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.offsetManager.commitOffsetsIfNecessary();case 2:case"end":return e.stop();}},e,this)}));return function(){return e.apply(this,arguments)}}()},{key:"commitOffsets",value:function(){var e=dc(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.offsetManager.commitOffsets(t);case 2:case"end":return e.stop();}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"uncommittedOffsets",value:function(){return this.offsetManager.uncommittedOffsets()}},{key:"heartbeat",value:function(){var e=dc(regeneratorRuntime.mark(function e(t){var r,n,a,i,o,s;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.interval,n=this.groupId,a=this.generationId,**this.memberId,o=Date.now(),!(i&&o>=this.lastRequest+r)){e.next=9;break}return s={groupId:n,memberId:i,groupGenerationId:a},e.next=7,this.coordinator.heartbeat(s);case 7:this.instrumentationEmitter.emit(Nza,s),this.lastRequest=Date.now();case 9:case"end":return e.stop();}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"fetch",value:function(){var e=dc(regeneratorRuntime.mark(function e(){var t,r=this;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.delegateYield(regeneratorRuntime.mark(function e(){var t,n,a,i,o,s,u,c,f,p,$,l,m,h,v,d;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.topics,n=r.maxBytesPerPartition,a=r.maxWaitTime,**r.minBytes,o=r.maxBytes,s={},e.next=4,r.cluster.refreshMetadataIfNecessary();case 4:r.checkForStaleAssignment();case 5:if(!(r.seekOffset.size>0)){e.next=12;break}return u=r.seekOffset.pop(),r.logger.debug("Seek offset",{groupId:r.groupId,memberId:r.memberId,seek:u}),e.next=10,r.offsetManager.seek(u);case 10:e.next=5;break;case 12:if(c=r.subscriptionState.paused(),f=r.subscriptionState.active(),p=Un(f.map(function(e){return e.partitions})),$=f.filter(function(e){return e.partitions.length>0}).map(function(e){return e.topic}),0!==p.length){e.next=21;break}return r.logger.debug("No active topic partitions, sleeping for ".concat(r.maxWaitTime,"ms"),{topics:t,activeTopicPartitions:f,pausedTopicPartitions:c}),e.next=20,Kn(r.maxWaitTime);case 20:return e.abrupt("return",{v:[]});case 21:return e.next=23,r.offsetManager.resolveOffsets();case 23:r.logger.debug("Fetching from ".concat(p.length," partitions for ").concat($.length," out of ").concat(t.length," topics"),{topics:t,activeTopicPartitions:f,pausedTopicPartitions:c}),l=Gg(f);try{for(h=function(){var e,t=m.value,a=r.cluster.findLeaderForPartitions(t.topic,t.partitions),**Wn(a),o=r.offsetManager.committedOffsets(),u=Gg(i);try{for(u.s();!(e=u.n()).done;){var c=e.value,f=a[c].filter(function(e){return null!=o[t.topic][e]}).map(function(e){return{partition:e,fetchOffset:r.offsetManager.nextOffset(t.topic,e).toString(),maxBytes:n}});s[c]=s[c]||[],s[c].push({topic:t.topic,partitions:f})}}catch(p){u.e(p)}finally{u.f()}},l.s();!(m=l.n()).done;)h()}catch(g){l.e(g)}finally{l.f()}if(0!==(v=Wn(s).map(function(){var e=dc(regeneratorRuntime.mark(function e(t){var n,u,c,f;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.cluster.findBroker({nodeId:t});case 2:return n=e.sent,e.next=5,n.fetch({maxWaitTime:a,minBytes:i,maxBytes:o,isolationLevel:r.isolationLevel,topics:s[t]});case 5:return u=e.sent,c=u.responses,f=c.map(function(e){var n=e.topicName,a=e.partitions,**s[t].find(function(e){return e.topic===n});return a.filter(function(e){return!r.seekOffset.has(n,e.partition)&&!r.subscriptionState.isPaused(n,e.partition)}).map(function(e){var t=i.partitions.find(function(t){return t.partition===e.partition}).fetchOffset,a=new cza(n,t,e);return(a.isEmptyControlRecord()||a.isEmptyDueToLogCompactedMessages())&&r.resolveOffset({topic:a.topic,partition:a.partition,offset:a.lastOffset()}),a})}),e.abrupt("return",Un(f));case 9:case"end":return e.stop();}},e)}));return function(t){return e.apply(this,arguments)}}())).length){e.next=31;break}return e.next=30,Kn(r.maxWaitTime);case 30:return e.abrupt("return",{v:[]});case 31:return e.next=33,Promise.all(v);case 33:return d=e.sent,e.abrupt("return",{v:Un(d)});case 35:case"end":return e.stop();}},e)})(),"t0",2);case 2:if("object"!==Iza(t=e.t0)){e.next=5;break}return e.abrupt("return",t.v);case 5:e.next=32;break;case 7:if(e.prev=7,e.t1=e.catch(0),!Sza.includes(e.t1.type)&&"KafkaJSTopicMetadataNotLoaded"!==e.t1.name){e.next=18;break}return this.logger.debug("Stale cluster metadata, refreshing...",{groupId:this.groupId,memberId:this.memberId,error:e.t1.message}),e.next=13,this.cluster.refreshMetadata();case 13:return e.next=15,this.join();case 15:return e.next=17,this.sync();case 17:throw new Pza(e.t1.message);case 18:if("KafkaJSStaleTopicMetadataAssignment"!==e.t1.name){e.next=24;break}return this.logger.warn("".concat(e.t1.message,", resync group"),{groupId:this.groupId,memberId:this.memberId,topic:e.t1.topic,unknownPartitions:e.t1.unknownPartitions}),e.next=22,this.join();case 22:return e.next=24,this.sync();case 24:if("KafkaJSOffsetOutOfRange"!==e.t1.name){e.next=27;break}return e.next=27,this.recoverFromOffsetOutOfRange(e.t1);case 27:if("KafkaJSBrokerNotFound"!==e.t1.name){e.next=31;break}return this.logger.debug("".concat(e.t1.message,", refreshing metadata and retrying...")),e.next=31,this.cluster.refreshMetadata();case 31:throw e.t1;case 32:case"end":return e.stop();}},e,this,[[0,7]])}));return function(){return e.apply(this,arguments)}}()},{key:"recoverFromOffsetOutOfRange",value:function(){var e=dc(regeneratorRuntime.mark(function e(t){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.error("Offset out of range, resetting to default offset",{topic:t.topic,partition:t.partition,groupId:this.groupId,memberId:this.memberId}),e.next=3,this.offsetManager.setDefaultOffset({topic:t.topic,partition:t.partition});case 3:case"end":return e.stop();}},e,this)}));return function(t){return e.apply(this,arguments)}}()},{key:"generatePartitionsPerSubscribedTopic",value:function(){var e,t=new Map,r=Gg(this.topicsSubscribed);try{for(r.s();!(e=r.n()).done;){var n=e.value,a=this.cluster.findTopicPartitionMetadata(n).map(function(e){return e.partitionId}).sort();t.set(n,a)}}catch(i){r.e(i)}finally{r.f()}return t}},{key:"checkForStaleAssignment",value:function(){if(this.partitionsPerSubscribedTopic){var e,t=Gg(this.generatePartitionsPerSubscribedTopic());try{for(t.s();!(e=t.n()).done;){var r=Eza(e.value,2),n=r[0],a=r[1],**gj(a,this.partitionsPerSubscribedTopic.get(n));if(i.length>0)throw new Rza("Topic has been updated",{topic:n,unknownPartitions:i})}}catch(o){t.e(o)}finally{t.f()}}}},{key:"hasSeekOffset",value:function(e){var t=e.topic,r=e.partition;return this.seekOffset.has(t,r)}}]),e}();var Tza={};function Uza(r){if("undefined"==typeof Symbol||null==r[Symbol.iterator]){if(Array.isArray(r)||(r=Vza(r))){var e=0,n=function(){};return{s:n,n:function(){return e>=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(r){throw r},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var t,a,o=!0,i=!1;return{s:function(){t=r[Symbol.iterator]()},n:function(){var r=t.next();return o=r.done,r},e:function(r){i=!0,a=r},f:function(){try{o||null==t.return||t.return()}finally{if(i)throw a}}}}function Vza(r,e){if(r){if("string"==typeof r)return fE(r,e);var n=Object.prototype.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fE(r,e):void 0}}function fE(r,e){(null==e||e>r.length)&&(e=r.length);for(var n=0,t=new Array(e);n0&&void 0!==arguments[0]?arguments[0]:{},e=r.limit,n=r.onChange,t=void 0===n?Yza:n;if("number"!=typeof e||e<1)throw new gE("\"limit\" cannot be less than 1");var a=[],o=0,**function(r,e,n){t(++o),r().then(function(r){e(r),t(--o),a.length>0&&a.shift()()}).catch(function(r){n(r),function(){var r,e=Uza(a);try{for(e.s();!(r=e.n()).done;)(0,r.value)(function(r,e,n){return n(Xza)})}catch(n){e.e(n)}finally{e.f()}a=[],o=0}()})};return function(r){return new Promise(function(n,t){return function(r,n,t){o=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(r){throw r},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a,o=!0,u=!1;return{s:function(){n=r[Symbol.iterator]()},n:function(){var r=n.next();return o=r.done,r},e:function(r){u=!0,a=r},f:function(){try{o||null==n.return||n.return()}finally{if(u)throw a}}}}function aAa(r,e){if(r){if("string"==typeof r)return hE(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?hE(r,e):void 0}}function hE(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);tr.length)&&(e=r.length);for(var t=0,n=new Array(e);t=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(r){throw r},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,n,a=!0,i=!1;return{s:function(){o=r[Symbol.iterator]()},n:function(){var r=o.next();return a=r.done,r},e:function(r){i=!0,n=r},f:function(){try{a||null==o.return||o.return()}finally{if(i)throw n}}}}function tE(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),t.push.apply(t,o)}return t}function uAa(r){for(var e=1;er.length)&&(e=r.length);for(var t=0,o=new Array(e);t=u)throw new U("Consumer heartbeatInterval (".concat(v,") must be lower than sessionTimeout (").concat(u,"). It is recommended to set heartbeatInterval to approximately a third of the sessionTimeout."));var _=function(r){var n=r.autoCommitInterval,a=r.autoCommitThreshold;return new Dza({logger:o,topics:xE(I),topicConfigurations:I,cluster:e,groupId:t,assigners:R,sessionTimeout:u,rebalanceTimeout:s,maxBytesPerPartition:f,minBytes:m,maxBytes:d,maxWaitTimeInMs:Q,instrumentationEmitter:E,autoCommitInterval:n,autoCommitThreshold:a,isolationLevel:w})},O=function(r){var e=r.eachBatchAutoResolve,t=r.eachBatch,n=r.eachMessage,a=r.onCrash,**r.autoCommit,u=r.partitionsConsumedConcurrently;return new $za({autoCommit:i,logger:o,consumerGroup:C,instrumentationEmitter:E,eachBatchAutoResolve:e,eachBatch:t,eachMessage:n,heartbeatInterval:v,retry:h,onCrash:a,partitionsConsumedConcurrently:u})},x=function(){var r=ec(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.connect();case 2:E.emit(KAa);case 3:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}(),N=function(){var r=ec(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,K();case 3:return T.debug("consumer has stopped, disconnecting",{groupId:t}),r.next=6,e.disconnect();case 6:E.emit(LAa),r.next=11;break;case 9:r.prev=9,r.t0=r.catch(0);case 11:case"end":return r.stop();}},r,null,[[0,9]])}));return function(){return r.apply(this,arguments)}}(),K=function(){var r=ec(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,!k){r.next=7;break}return r.next=4,k.stop();case 4:k=null,C=null,E.emit(MAa);case 7:T.info("Stopped",{groupId:t}),r.next=12;break;case 10:r.prev=10,r.t0=r.catch(0);case 12:case"end":return r.stop();}},r,null,[[0,10]])}));return function(){return r.apply(this,arguments)}}(),q=function(){var r=ec(regeneratorRuntime.mark(function r(o){var n,a,i,u,$,s,c,v,p,f,l;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(n=o.topic,a=o.fromBeginning,**void 0!==a&&a,!C){r.next=3;break}throw new U("Cannot subscribe to topic while consumer is running");case 3:if(n){r.next=5;break}throw new U("Invalid topic ".concat(n));case 5:if(u=n instanceof RegExp,"string"==typeof n||u){r.next=8;break}throw new U("Invalid topic ".concat(n," (").concat(zAa(n),"), the topic name has to be a String or a RegExp"));case 8:if($=[],!u){r.next=19;break}return s=n,r.next=13,e.metadata();case 13:c=r.sent,v=c.topicMetadata.map(function(r){return r.topic}).filter(function(r){return s.test(r)}),T.debug("Subscription based on RegExp",{groupId:t,topicRegExp:s.toString(),matchedTopics:v}),$.push.apply($,vAa(v)),r.next=20;break;case 19:$.push(n);case 20:for(p=0,f=$;p0&&void 0!==b[0]?b[0]:{},o=e.autoCommit,n=void 0===o||o,a=e.autoCommitInterval,**void 0===a?null:a,u=e.autoCommitThreshold,$=void 0===u?null:u,s=e.eachBatchAutoResolve,c=void 0===s||s,v=e.partitionsConsumedConcurrently,p=void 0===v?1:v,f=e.eachBatch,l=void 0===f?null:f,m=e.eachMessage,A=void 0===m?null:m,!C){r.next=4;break}return T.warn("consumer#run was called, but the consumer is already running",{groupId:t}),r.abrupt("return");case 4:return C=_({autoCommitInterval:i,autoCommitThreshold:$}),d=function(){var r=ec(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return T.info("Starting",{groupId:t}),k=O({autoCommit:n,eachBatchAutoResolve:c,eachBatch:l,eachMessage:A,onCrash:e,partitionsConsumedConcurrently:p}),r.next=4,k.start();case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}(),y=function(r){C=_({autoCommit:n,autoCommitInterval:i,autoCommitThreshold:$}),d(r)},Q=function(){var r=ec(regeneratorRuntime.mark(function r(e){var o;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return T.error("Crash: ".concat(e.name,": ").concat(e.message),{groupId:t,retryCount:e.retryCount,stack:e.stack}),r.next=3,N();case 3:E.emit(NAa,{error:e,groupId:t}),"KafkaJSNumberOfRetriesExceeded"!==e.name&&!0!==e.retriable||(o=e.retryTime||h.initialRetryTime||BAa,T.error("Restarting the consumer in ".concat(o,"ms"),{retryCount:e.retryCount,retryTime:o,groupId:t}),setTimeout(function(){return y(Q)},o));case 5:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}(),r.next=10,d(Q);case 10:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}();return{connect:x,disconnect:N,subscribe:q,stop:K,run:J,commitOffsets:function(){var r=ec(regeneratorRuntime.mark(function r(){var e,t,o,n=arguments;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(e=n.length>0&&void 0!==n[0]?n[0]:[],t=e.reduce(function(r,e){var t,o=e.topic,n=e.partition,a=e.offset,**e.metadata,u=void 0===i?null:i;if(!o)throw new U("Invalid topic ".concat(o));if(isNaN(n))throw new U("Invalid partition, expected a number received ".concat(n));try{t=vj.fromValue(a)}catch(s){throw new U("Invalid offset, expected a long received ".concat(a))}if(t.lessThan(0))throw new U("Offset must not be a negative number");if(null!==u&&"string"!=typeof u)throw new U("Invalid offset metatadta, expected string or null, received ".concat(u));var $=r[o]||[];return $.push({partition:n,offset:t,metadata:u}),uAa({},r,uE({},o,$))},{}),C){r.next=4;break}throw new U("Consumer group was not initialized, consumer#run must be called first");case 4:return o=Object.keys(t),r.abrupt("return",k.commitOffsets({topics:o.map(function(r){return{topic:r,partitions:t[r]}})}));case 6:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}(),seek:function(r){var e,t=r.topic,o=r.partition,n=r.offset;if(!t)throw new U("Invalid topic ".concat(t));if(isNaN(o))throw new U("Invalid partition, expected a number received ".concat(o));try{e=vj.fromValue(n)}catch(a){throw new U("Invalid offset, expected a long received ".concat(n))}if(e.lessThan(0)&&!QAa.includes(e.toString()))throw new U("Offset must not be a negative number");if(!C)throw new U("Consumer group was not initialized, consumer#run must be called first");C.seek({topic:t,partition:o,offset:e.toString()})},describeGroup:function(){var r=ec(regeneratorRuntime.mark(function r(){var o,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.findGroupCoordinator({groupId:t});case 2:return o=r.sent,n=Ya(h),r.abrupt("return",n(ec(regeneratorRuntime.mark(function r(){var e,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,o.describeGroups({groupIds:[t]});case 2:return e=r.sent,n=e.groups,r.abrupt("return",n.find(function(r){return r.groupId===t}));case 5:case"end":return r.stop();}},r)}))));case 5:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}(),pause:function(){var r,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=sE(e);try{for(t.s();!(r=t.n()).done;){var o=r.value;if(!o||!o.topic)throw new U("Invalid topic ".concat(o&&o.topic||o));if(void 0!==o.partitions&&(!Array.isArray(o.partitions)||o.partitions.some(isNaN)))throw new U("Array of valid partitions required to pause specific partitions instead of ".concat(o.partitions))}}catch(n){t.e(n)}finally{t.f()}if(!C)throw new U("Consumer group was not initialized, consumer#run must be called first");C.pause(e)},paused:function(){return C?C.paused():[]},resume:function(){var r,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=sE(e);try{for(t.s();!(r=t.n()).done;){var o=r.value;if(!o||!o.topic)throw new U("Invalid topic ".concat(o&&o.topic||o));if(void 0!==o.partitions&&(!Array.isArray(o.partitions)||o.partitions.some(isNaN)))throw new U("Array of valid partitions required to resume specific partitions instead of ".concat(o.partitions))}}catch(n){t.e(n)}finally{t.f()}if(!C)throw new U("Consumer group was not initialized, consumer#run must be called first");C.resume(e)},on:function(r,e){if(!OAa.includes(r))throw new U("Event name should be one of ".concat(PAa));return E.addListener(DAa(r),function(t){t.type=CAa(t.type),Promise.resolve(e(t)).catch(function(e){T.error("Failed to execute listener: ".concat(e.message),{eventName:r,stack:e.stack})})})},events:ce,logger:function(){return T}}};var RAa={};function yE(e,r,t,n,a,o,i){try{var u=e[o](i),$=u.value}catch(p){return void t(p)}u.done?r($):Promise.resolve($).then(n,a)}function SAa(e){return function(){var r=this,t=arguments;return new Promise(function(n,a){var o=e.apply(r,t);function i(e){yE(o,n,a,i,u,"next",e)}function u(e){yE(o,n,a,i,u,"throw",e)}i(void 0)})}}var TAa=(y(),x),UAa=TAa.KafkaJSTimeout;RAa=function(e){var r,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.delay,a=void 0===n?50:n,o=t.maxWait,**void 0===o?1e4:o,u=t.timeoutMessage,$=void 0===u?"Timeout":u,p=t.ignoreTimeout,c=void 0!==p&&p,v=0,s=!1,G=function(){var t=SAa(regeneratorRuntime.mark(function t(n,o){var i;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return v+=a,t.next=3,Kn(a);case 3:return t.prev=3,t.next=6,e(v);case 6:if(!(**t.sent)){t.next=11;break}return s=!0,clearTimeout(r),t.abrupt("return",n(i));case 11:G(n,o),t.next=19;break;case 14:t.prev=14,t.t0=t.catch(3),s=!0,clearTimeout(r),o(t.t0);case 19:case"end":return t.stop();}},t,null,[[3,14]])}));return function(e,r){return t.apply(this,arguments)}}();return new Promise(function(e,t){G(e,t),c||(r=setTimeout(function(){if(!s)return t(new UAa($))},i))})};var $n,_n={};function ao($,e,r){return e in $?Object.defineProperty($,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):$[e]=r,$}var Ig=hj("admin"),wj={CONNECT:Ig("connect"),DISCONNECT:Ig("disconnect"),REQUEST:Ig(W.NETWORK_REQUEST),REQUEST_TIMEOUT:Ig(W.NETWORK_REQUEST_TIMEOUT),REQUEST_QUEUE_SIZE:Ig(W.NETWORK_REQUEST_QUEUE_SIZE)},zE=(ao($n={},wj.REQUEST,W.NETWORK_REQUEST),ao($n,wj.REQUEST_TIMEOUT,W.NETWORK_REQUEST_TIMEOUT),ao($n,wj.REQUEST_QUEUE_SIZE,W.NETWORK_REQUEST_QUEUE_SIZE),$n),VAa=Gn(zE),WAa=function($){return zE[$]||$},XAa=function($){return VAa[$]||$};_n={events:wj,wrap:XAa,unwrap:WAa};var bo={};bo={UNKNOWN:0,ANY:1,TOPIC:2,GROUP:3,CLUSTER:4,TRANSACTIONAL_ID:5,DELEGATION_TOKEN:6};var YAa={};function ZAa(r){return aBa(r)||_Aa(r)||CE(r)||$Aa()}function $Aa(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _Aa(r){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(r))return Array.from(r)}function aBa(r){if(Array.isArray(r))return co(r)}function AE(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable})),t.push.apply(t,n)}return t}function bBa(r){for(var e=1;e=r.length?{done:!0}:{done:!1,value:r[e++]}},e:function(r){throw r},f:t}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var n,a,o=!0,i=!1;return{s:function(){n=r[Symbol.iterator]()},n:function(){var r=n.next();return o=r.done,r},e:function(r){i=!0,a=r},f:function(){try{o||null==n.return||n.return()}finally{if(i)throw a}}}}function CE(r,e){if(r){if("string"==typeof r)return co(r,e);var t=Object.prototype.toString.call(r).slice(8,-1);return"Object"===t&&r.constructor&&(t=r.constructor.name),"Map"===t||"Set"===t?Array.from(t):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?co(r,e):void 0}}function co(r,e){(null==e||e>r.length)&&(e=r.length);for(var t=0,n=new Array(e);t1&&void 0!==arguments[1]?arguments[1]:{};return RAa(function(){var e=R(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,r();case 3:return e.abrupt("return",e.sent);case 6:if(e.prev=6,e.t0=e.catch(0),"LEADER_NOT_AVAILABLE"===e.t0.type){e.next=10;break}throw e.t0;case 10:return e.abrupt("return",!1);case 11:case"end":return e.stop();}},e,null,[[0,6]])}));return function(){return e.apply(this,arguments)}}(),e)},oBa=function(r){return["Empty","Dead"].includes(r.state)},EE=function(){var r=R(regeneratorRuntime.mark(function r(e,t){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,e.addTargetTopic(t);case 2:return r.next=4,e.refreshMetadataIfNecessary();case 4:return r.abrupt("return",e.findTopicPartitionMetadata(t).map(function(r){return r.partitionId}).sort());case 5:case"end":return r.stop();}},r)}));return function(e,t){return r.apply(this,arguments)}}();YAa=function(r){var e=r.logger,t=r.instrumentationEmitter,n=r.retry,a=void 0===n?{retries:5}:n,o=r.cluster,**e.namespace("Admin"),c=t||new ee,u=function(){var r=R(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,o.connect();case 2:c.emit(hBa);case 3:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}(),s=function(){var r=R(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,o.disconnect();case 2:c.emit(iBa);case 3:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}(),p=function(){var r=R(regeneratorRuntime.mark(function r(e){var t,n,c,u,s,p,$;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(t=e.topics,n=e.validateOnly,c=e.timeout,u=e.waitForLeaders,s=void 0===u||u,t&&Array.isArray(t)){r.next=3;break}throw new I("Invalid topics array ".concat(t));case 3:if(!(t.filter(function(r){return"string"!=typeof r.topic}).length>0)){r.next=5;break}throw new I("Invalid topics array, the topic names have to be a valid string");case 5:if(!((p=new Set(t.map(function(r){return r.topic}))).size0)){r.next=5;break}throw new I("Invalid topics array, the names must be a valid string");case 5:return c=Ya(a),r.abrupt("return",c(function(){var r=R(regeneratorRuntime.mark(function r(e,a,c){var u,s,p,$;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,o.refreshMetadata();case 3:return r.next=5,o.findControllerBroker();case 5:return u=r.sent,r.next=8,u.deleteTopics({topics:t,timeout:n});case 8:s=BE(t);try{for(s.s();!(p=s.n()).done;)$=p.value,o.targetTopics.delete($)}catch(f){s.e(f)}finally{s.f()}return r.next=12,o.refreshMetadata();case 12:r.next=21;break;case 14:if(r.prev=14,r.t0=r.catch(0),!["NOT_CONTROLLER","UNKNOWN_TOPIC_OR_PARTITION"].includes(r.t0.type)){r.next=19;break}throw i.warn("Could not delete topics",{error:r.t0.message,retryCount:a,retryTime:c}),r.t0;case 19:"REQUEST_TIMED_OUT"===r.t0.type&&i.error("Could not delete topics, check if \"delete.topic.enable\" is set to \"true\" (the default value is \"false\") or increase the timeout",{error:r.t0.message,retryCount:a,retryTime:c}),e(r.t0);case 21:case"end":return r.stop();}},r,null,[[0,14]])}));return function(e,t,n){return r.apply(this,arguments)}}()));case 7:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}(),f=function(){var r=R(regeneratorRuntime.mark(function r(e){var t;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(e&&"string"==typeof e){r.next=2;break}throw new I("Invalid topic ".concat(e));case 2:return t=Ya(a),r.abrupt("return",t(function(){var r=R(regeneratorRuntime.mark(function r(t,n,a){var i,c,u,s,p,$,f;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,o.addTargetTopic(e);case 3:return r.next=5,o.refreshMetadataIfNecessary();case 5:return **o.findTopicPartitionMetadata(e),r.next=8,o.fetchTopicsOffset([{topic:e,fromBeginning:!1,partitions:i.map(function(r){return{partition:r.partitionId}})}]);case 8:return c=r.sent,r.next=11,o.fetchTopicsOffset([{topic:e,fromBeginning:!0,partitions:i.map(function(r){return{partition:r.partitionId}})}]);case 11:return u=r.sent,s=c.pop(),p=s.partitions,$=u.pop(),f=$.partitions,r.abrupt("return",p.map(function(r){var e=r.partition,t=r.offset;return{partition:e,offset:t,high:t,low:f.find(function(r){return r.partition===e}).offset}}));case 17:if(r.prev=17,r.t0=r.catch(0),"UNKNOWN_TOPIC_OR_PARTITION"!==r.t0.type){r.next=23;break}return r.next=22,o.refreshMetadata();case 22:throw r.t0;case 23:t(r.t0);case 24:case"end":return r.stop();}},r,null,[[0,17]])}));return function(e,t,n){return r.apply(this,arguments)}}()));case 4:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}(),v=function(){var r=R(regeneratorRuntime.mark(function r(e){var t,n,a,i,c,u,s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(t=e.groupId,n=e.topic,t){r.next=3;break}throw new I("Invalid groupId ".concat(t));case 3:if(n){r.next=5;break}throw new I("Invalid topic ".concat(n));case 5:return r.next=7,EE(o,n);case 7:return a=r.sent,r.next=10,o.findGroupCoordinator({groupId:t});case 10:return **r.sent,c=a.map(function(r){return{partition:r}}),r.next=14,i.offsetFetch({groupId:t,topics:[{topic:n,partitions:c}]});case 14:return u=r.sent,s=u.responses,r.abrupt("return",s.filter(function(r){return r.topic===n}).map(function(r){return r.partitions.map(function(r){return{partition:r.partition,offset:r.offset,metadata:r.metadata||null}})}).pop());case 17:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}(),h=function(){var r=R(regeneratorRuntime.mark(function r(e){var t,n,a,i,c,u;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(t=e.groupId,n=e.topic,a=e.earliest,**void 0!==a&&a,t){r.next=3;break}throw new I("Invalid groupId ".concat(t));case 3:if(n){r.next=5;break}throw new I("Invalid topic ".concat(n));case 5:return r.next=7,EE(o,n);case 7:return c=r.sent,u=c.map(function(r){return{partition:r,offset:o.defaultOffset({fromBeginning:i})}}),r.abrupt("return",l({groupId:t,topic:n,partitions:u}));case 10:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}(),l=function(){var r=R(regeneratorRuntime.mark(function r(t){var n,a,i,c,u;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(n=t.groupId,a=t.topic,**t.partitions,n){r.next=3;break}throw new I("Invalid groupId ".concat(n));case 3:if(a){r.next=5;break}throw new I("Invalid topic ".concat(a));case 5:if(i&&0!==i.length){r.next=7;break}throw new I("Invalid partitions");case 7:return c=rE({logger:e.namespace("Admin",fBa.NOTHING),cluster:o,groupId:n}),r.next=10,c.subscribe({topic:a,fromBeginning:!0});case 10:return r.next=12,c.describeGroup();case 12:if(u=r.sent,oBa(u)){r.next=15;break}throw new I("The consumer group must have no running instances, current state: ".concat(u.state));case 15:return r.abrupt("return",new Promise(function(r,e){c.on(c.events.FETCH,R(regeneratorRuntime.mark(function t(){return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",c.stop().then(r).catch(e));case 1:case"end":return t.stop();}},t)}))),c.run({eachBatchAutoResolve:!1,eachBatch:function(){var r=R(regeneratorRuntime.mark(function r(){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.abrupt("return",!0);case 1:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}()}).catch(e),c.pause([{topic:a}]);var t,n=BE(i);try{for(n.s();!(t=n.n()).done;){var o=t.value;c.seek(bBa({topic:a},o))}}catch(u){n.e(u)}finally{n.f()}}));case 16:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}(),y=function(){var r=R(regeneratorRuntime.mark(function r(e){var t,n,c,u,s,p,$,f;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(t=e.resources,n=e.includeSynonyms,t&&Array.isArray(t)){r.next=3;break}throw new I("Invalid resources array ".concat(t));case 3:if(0!==t.length){r.next=5;break}throw new I("Resources array cannot be empty");case 5:if(c=Object.values(bo),!(u=t.find(function(r){return!c.includes(r.type)}))){r.next=9;break}throw new I("Invalid resource type ".concat(u.type,": ").concat(JSON.stringify(u)));case 9:if(!(s=t.find(function(r){return!r.name||"string"!=typeof r.name}))){r.next=12;break}throw new I("Invalid resource name ".concat(s.name,": ").concat(JSON.stringify(s)));case 12:if(!(p=t.find(function(r){return!Array.isArray(r.configNames)&&null!=r.configNames}))){r.next=16;break}throw $=p.configNames,new I("Invalid resource configNames ".concat($,": ").concat(JSON.stringify(p)));case 16:return f=Ya(a),r.abrupt("return",f(function(){var r=R(regeneratorRuntime.mark(function r(e,a,c){var u,s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,o.refreshMetadata();case 3:return r.next=5,o.findControllerBroker();case 5:return u=r.sent,r.next=8,u.describeConfigs({resources:t,includeSynonyms:n});case 8:return s=r.sent,r.abrupt("return",s);case 12:if(r.prev=12,r.t0=r.catch(0),"NOT_CONTROLLER"!==r.t0.type){r.next=17;break}throw i.warn("Could not describe configs",{error:r.t0.message,retryCount:a,retryTime:c}),r.t0;case 17:e(r.t0);case 18:case"end":return r.stop();}},r,null,[[0,12]])}));return function(e,t,n){return r.apply(this,arguments)}}()));case 18:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}(),m=function(){var r=R(regeneratorRuntime.mark(function r(e){var t,n,c,u,s,p,$,f,v;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(t=e.resources,n=e.validateOnly,t&&Array.isArray(t)){r.next=3;break}throw new I("Invalid resources array ".concat(t));case 3:if(0!==t.length){r.next=5;break}throw new I("Resources array cannot be empty");case 5:if(c=Object.values(bo),!(u=t.find(function(r){return!c.includes(r.type)}))){r.next=9;break}throw new I("Invalid resource type ".concat(u.type,": ").concat(JSON.stringify(u)));case 9:if(!(s=t.find(function(r){return!r.name||"string"!=typeof r.name}))){r.next=12;break}throw new I("Invalid resource name ".concat(s.name,": ").concat(JSON.stringify(s)));case 12:if(!(p=t.find(function(r){return!Array.isArray(r.configEntries)}))){r.next=16;break}throw $=p.configEntries,new I("Invalid resource configEntries ".concat($,": ").concat(JSON.stringify(p)));case 16:if(!(f=t.find(function(r){return r.configEntries.some(function(r){return"string"!=typeof r.name||"string"!=typeof r.value})}))){r.next=19;break}throw new I("Invalid resource config value: ".concat(JSON.stringify(f)));case 19:return v=Ya(a),r.abrupt("return",v(function(){var r=R(regeneratorRuntime.mark(function r(e,a,c){var u,s;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,r.next=3,o.refreshMetadata();case 3:return r.next=5,o.findControllerBroker();case 5:return u=r.sent,r.next=8,u.alterConfigs({resources:t,validateOnly:!!n});case 8:return s=r.sent,r.abrupt("return",s);case 12:if(r.prev=12,r.t0=r.catch(0),"NOT_CONTROLLER"!==r.t0.type){r.next=17;break}throw i.warn("Could not alter configs",{error:r.t0.message,retryCount:a,retryTime:c}),r.t0;case 17:e(r.t0);case 18:case"end":return r.stop();}},r,null,[[0,12]])}));return function(e,t,n){return r.apply(this,arguments)}}()));case 21:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}();return{connect:u,disconnect:s,createTopics:p,deleteTopics:$,getTopicMetadata:function(){var r=R(regeneratorRuntime.mark(function r(e){var t,n;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(!(t=(e||{}).topics)){r.next=4;break}return r.next=4,Promise.all(t.map(function(){var r=R(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:if(e){r.next=2;break}throw new I("Invalid topic ".concat(e));case 2:return r.prev=2,r.next=5,o.addTargetTopic(e);case 5:r.next=11;break;case 7:throw r.prev=7,r.t0=r.catch(2),r.t0.message="Failed to add target topic ".concat(e,": ").concat(r.t0.message),r.t0;case 11:case"end":return r.stop();}},r,null,[[2,7]])}));return function(e){return r.apply(this,arguments)}}()));case 4:return r.next=6,o.refreshMetadataIfNecessary();case 6:return n=t||ZAa(o.targetTopics),r.next=9,Promise.all(n.map(function(){var r=R(regeneratorRuntime.mark(function r(e){return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.t0=e,r.next=3,o.findTopicPartitionMetadata(e);case 3:return r.t1=r.sent,r.abrupt("return",{name:r.t0,partitions:r.t1});case 5:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}()));case 9:return r.t0=r.sent,r.abrupt("return",{topics:r.t0});case 11:case"end":return r.stop();}},r)}));return function(e){return r.apply(this,arguments)}}(),fetchTopicMetadata:function(){var r=R(regeneratorRuntime.mark(function r(){var e,t,n,a,**arguments;return regeneratorRuntime.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return e=i.length>0&&void 0!==i[0]?i[0]:{},t=e.topics,(n=void 0===t?[]:t)&&n.forEach(function(r){if(!r||"string"!=typeof r)throw new I("Invalid topic ".concat(r))}),r.next=4,o.metadata({topics:n});case 4:return a=r.sent,r.abrupt("return",{topics:a.topicMetadata.map(function(r){return{name:r.topic,partitions:r.partitionMetadata}})});case 6:case"end":return r.stop();}},r)}));return function(){return r.apply(this,arguments)}}(),events:Jg,fetchOffsets:v,fetchTopicOffsets:f,setOffsets:l,resetOffsets:h,describeConfigs:y,alterConfigs:m,on:function(r,e){if(!lBa.includes(r))throw new I("Event name should be one of ".concat(mBa));return c.addListener(eBa(r),function(t){t.type=dBa(t.type),Promise.resolve(e(t)).catch(function(e){i.error("Failed to execute listener: ".concat(e.message),{eventName:r,stack:e.stack})})})},logger:function(){return i}}};var pBa={},qBa=6e4;pBa=function(){var e=(jd(),{}),r=(jd(),{});return function(t){var n=t.host,o=t.port,p=t.ssl,$=t.onConnect,s=p?r.connect(Object.assign({host:n,port:o,servername:n},p),$):e.connect({host:n,port:o},$);return s.setKeepAlive(!0,qBa),s}};var rBa={};function FE(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function eo(e){for(var t=1;t0&&void 0!==arguments[0]?arguments[0]:{},t=e.createPartitioner,r=e.retry,a=e.metadataMaxAge,o=e.allowAutoTopicCreation,**e.idempotent,n=e.transactionalId,$=e.transactionTimeout,s=e.maxInFlightRequests,l=new ee,u=this[pa.CREATE_CLUSTER]({metadataMaxAge:a,allowAutoTopicCreation:o,maxInFlightRequests:s,instrumentationEmitter:l});return tya({retry:eo({},this[pa.CLUSTER_RETRY],{},r),logger:this[pa.LOGGER],cluster:u,createPartitioner:t,idempotent:i,transactionalId:n,transactionTimeout:$,instrumentationEmitter:l})}},{key:"consumer",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.groupId,r=e.partitionAssigners,a=e.metadataMaxAge,o=e.sessionTimeout,**e.rebalanceTimeout,n=e.heartbeatInterval,$=e.maxBytesPerPartition,s=e.minBytes,l=e.maxBytes,u=e.maxWaitTimeInMs,c=e.retry,C=e.allowAutoTopicCreation,v=e.maxInFlightRequests,E=e.readUncommitted,m=void 0!==E&&E?HE.READ_UNCOMMITTED:HE.READ_COMMITTED,T=new ee,H=this[pa.CREATE_CLUSTER]({metadataMaxAge:a,allowAutoTopicCreation:C,maxInFlightRequests:v,isolationLevel:m,instrumentationEmitter:T});return rE({retry:eo({},this[pa.CLUSTER_RETRY],{},c),logger:this[pa.LOGGER],cluster:H,groupId:t,partitionAssigners:r,sessionTimeout:o,rebalanceTimeout:i,heartbeatInterval:n,maxBytesPerPartition:$,minBytes:s,maxBytes:l,maxWaitTimeInMs:u,isolationLevel:m,instrumentationEmitter:T})}},{key:"admin",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).retry,t=new ee,r=this[pa.CREATE_CLUSTER]({allowAutoTopicCreation:!1,instrumentationEmitter:t});return YAa({retry:eo({},this[pa.CLUSTER_RETRY],{},e),logger:this[pa.LOGGER],instrumentationEmitter:t,cluster:r})}},{key:"logger",value:function(){return this[pa.LOGGER]}}]),e}();var IE={},JE=(Rb(),Qb),xBa=ef.LEVELS;IE={Kafka:rBa,PartitionAssigners:qE,AssignerProtocol:tj,Partitioners:kD,logLevel:xBa,CompressionTypes:JE.Types,CompressionCodecs:JE.Codecs,ResourceTypes:bo};if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=IE}else if(typeof define==="function"&&define.amd){define(function(){return IE})}})();