/*! For license information please see 6231.a5c25a26dfcd2ef0ad20.js.LICENSE.txt */ (self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[6231],{251:(t,e)=>{e.read=function(t,e,r,n,o){var i,u,a=8*o-n-1,s=(1<>1,h=-7,l=r?o-1:0,f=r?-1:1,c=t[e+l];for(l+=f,i=c&(1<<-h)-1,c>>=-h,h+=a;h>0;i=256*i+t[e+l],l+=f,h-=8);for(u=i&(1<<-h)-1,i>>=-h,h+=n;h>0;u=256*u+t[e+l],l+=f,h-=8);if(0===i)i=1-p;else{if(i===s)return u?NaN:1/0*(c?-1:1);u+=Math.pow(2,n),i-=p}return(c?-1:1)*u*Math.pow(2,i-n)},e.write=function(t,e,r,n,o,i){var u,a,s,p=8*i-o-1,h=(1<>1,f=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,c=n?0:i-1,y=n?1:-1,v=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,u=h):(u=Math.floor(Math.log(e)/Math.LN2),e*(s=Math.pow(2,-u))<1&&(u--,s*=2),(e+=u+l>=1?f/s:f*Math.pow(2,1-l))*s>=2&&(u++,s/=2),u+l>=h?(a=0,u=h):u+l>=1?(a=(e*s-1)*Math.pow(2,o),u+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),u=0));o>=8;t[r+c]=255&a,c+=y,a/=256,o-=8);for(u=u<0;t[r+c]=255&u,c+=y,u/=256,p-=8);t[r+c-y]|=128*v}},7692:(t,e,r)=>{"use strict";r.d(e,{Ay:()=>d,gj:()=>w});var n=new Uint8Array(256),o=new Uint8Array(256),i=new Uint32Array(256),u=new Uint32Array(256),a=new Uint32Array(256),s=new Uint32Array(256),p=new Uint32Array(256),h=new Uint32Array(256),l=new Uint32Array(256),f=new Uint32Array(256);function c(t,e){return t.charCodeAt(e)<<24^t.charCodeAt(e+1)<<16^t.charCodeAt(e+2)<<8^t.charCodeAt(e+3)}function y(t){if(t instanceof Uint32Array)return t;if("string"==typeof t){if(t.length%4!=0)for(var e=t.length%4;e<=4;e++)t+="\0x00";var r=new Uint32Array(t.length/4);for(e=0;e>7),g[v[m]^m]=m;for(;!n[w];w^=t||1)r=(r=d^d<<1^d<<2^d<<3^d<<4)>>8^255&r^99,n[w]=r,o[r]=w,y=16843009*v[e=v[t=v[w]]]^65537*e^257*t^16843008*w,c=257*v[r]^16843008*r,i[w]=c=c<<24^c>>>8,u[w]=c=c<<24^c>>>8,a[w]=c=c<<24^c>>>8,s[w]=c=c<<24^c>>>8,p[r]=y=y<<24^y>>>8,h[r]=y=y<<24^y>>>8,l[r]=y=y<<24^y>>>8,f[r]=y=y<<24^y>>>8,d=g[d]||1}();var g=function(){function t(t){var e=y(t);if(4!==e.length&&6!==e.length&&8!==e.length)throw new Error("Invalid key size");this.encKey=new Uint32Array(4*e.length+28),this.decKey=new Uint32Array(4*e.length+28),this.encKey.set(e);for(var r,o=1,i=e.length;i<4*e.length+28;i++)r=this.encKey[i-1],(i%e.length===0||8===e.length&&i%e.length===4)&&(r=n[r>>>24]<<24^n[r>>16&255]<<16^n[r>>8&255]<<8^n[255&r],i%e.length===0&&(r=r<<8^r>>>24^o<<24,o=o<<1^283*(o>>7))),this.encKey[i]=this.encKey[i-e.length]^r;for(var u=0;i;u++,i--)r=this.encKey[3&u?i:i-4],this.decKey[u]=i<=4||u<4?r:p[n[r>>>24]]^h[n[r>>16&255]]^l[n[r>>8&255]]^f[n[255&r]]}return t.prototype.encrypt=function(t){for(var e,r,o,p=y(t),h=new Uint32Array(4),l=p[0]^this.encKey[0],f=p[1]^this.encKey[1],c=p[2]^this.encKey[2],v=p[3]^this.encKey[3],g=this.encKey.length/4-2,w=4,d=0;d>>24]^u[f>>16&255]^a[c>>8&255]^s[255&v]^this.encKey[w],r=i[f>>>24]^u[c>>16&255]^a[v>>8&255]^s[255&l]^this.encKey[w+1],o=i[c>>>24]^u[v>>16&255]^a[l>>8&255]^s[255&f]^this.encKey[w+2],v=i[v>>>24]^u[l>>16&255]^a[f>>8&255]^s[255&c]^this.encKey[w+3],l=e,f=r,c=o,w+=4;for(d=0;d<4;d++)h[d]=n[l>>>24]<<24^n[f>>16&255]<<16^n[c>>8&255]<<8^n[255&v]^this.encKey[w++],e=l,l=f,f=c,c=v,v=e;return h},t.prototype.decrypt=function(t){for(var e,r,n,i=y(t),u=new Uint32Array(4),a=i[0]^this.decKey[0],s=i[3]^this.decKey[1],c=i[2]^this.decKey[2],v=i[1]^this.decKey[3],g=this.decKey.length/4-2,w=4,d=0;d>>24]^h[s>>16&255]^l[c>>8&255]^f[255&v]^this.decKey[w],r=p[s>>>24]^h[c>>16&255]^l[v>>8&255]^f[255&a]^this.decKey[w+1],n=p[c>>>24]^h[v>>16&255]^l[a>>8&255]^f[255&s]^this.decKey[w+2],v=p[v>>>24]^h[a>>16&255]^l[s>>8&255]^f[255&c]^this.decKey[w+3],a=e,s=r,c=n,w+=4;for(d=0;d<4;d++)u[3&-d]=o[a>>>24]<<24^o[s>>16&255]<<16^o[c>>8&255]<<8^o[255&v]^this.decKey[w++],e=a,a=s,s=c,c=v,v=e;return u},t}(),w=function(){function t(t,e,r){void 0===r&&(r=16),this.key=y(t),this.iv=y(e),this.cipher=new g(t),this.blockSize=r/4}return t.prototype.encrypt=function(t,e){for(var r=y(t),n=e||new Uint32Array(r.length),o=this.iv.subarray(this.blockSize,this.iv.length),i=this.iv.subarray(0,this.blockSize),u=new Uint32Array(this.blockSize),a=0;a=this.blockSize&&this.incrementCounter(),o&&(i-=o,o=0)}return this.offset=(this.offset+r.length%4)%4,n},t.prototype.decrypt=function(t,e){return this.encrypt(t,e)},t.prototype.incrementCounter=function(){for(var t=this.counter.length-1;t>=0&&!(++this.counter[t]<4294967295);t--);}}();const d=g},46510:(t,e,r)=>{"use strict";function n(t,e,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(t):n?n.value:e.get(t)}function o(t,e,r,n,o){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!o)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?o.call(t,r):o?o.value=r:e.set(t,r),r}r.d(e,{G:()=>o,g:()=>n}),"function"==typeof SuppressedError&&SuppressedError},51072:(t,e)=>{e.endianness=function(){return"LE"},e.hostname=function(){return"undefined"!=typeof location?location.hostname:""},e.loadavg=function(){return[]},e.uptime=function(){return 0},e.freemem=function(){return Number.MAX_VALUE},e.totalmem=function(){return Number.MAX_VALUE},e.cpus=function(){return[]},e.type=function(){return"Browser"},e.release=function(){return"undefined"!=typeof navigator?navigator.appVersion:""},e.networkInterfaces=e.getNetworkInterfaces=function(){return{}},e.arch=function(){return"javascript"},e.platform=function(){return"browser"},e.tmpdir=e.tmpDir=function(){return"/tmp"},e.EOL="\n",e.homedir=function(){return"/"}},55962:(t,e,r)=>{"use strict";r.d(e,{isTauri:()=>n}),r(46510);function n(){return!!(globalThis||window).isTauri}new WeakMap,new WeakMap,new WeakMap,new WeakMap,new WeakMap},80129:(t,e,r)=>{"use strict";r.d(e,{eu:()=>u}),new Error("timeout while waiting for mutex to become available"),new Error("mutex already locked");const n=new Error("request for lock canceled");class o{constructor(t,e=n){this._value=t,this._cancelError=e,this._queue=[],this._weightedWaiters=[]}acquire(t=1,e=0){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return new Promise((r,n)=>{const o={resolve:r,reject:n,weight:t,priority:e},u=i(this._queue,t=>e<=t.priority);-1===u&&t<=this._value?this._dispatchItem(o):this._queue.splice(u+1,0,o)})}runExclusive(t){return e=this,r=arguments,o=function*(t,e=1,r=0){const[n,o]=yield this.acquire(e,r);try{return yield t(n)}finally{o()}},new((n=void 0)||(n=Promise))(function(t,i){function u(t){try{s(o.next(t))}catch(t){i(t)}}function a(t){try{s(o.throw(t))}catch(t){i(t)}}function s(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n(function(t){t(r)})).then(u,a)}s((o=o.apply(e,r||[])).next())});var e,r,n,o}waitForUnlock(t=1,e=0){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);return this._couldLockImmediately(t,e)?Promise.resolve():new Promise(r=>{this._weightedWaiters[t-1]||(this._weightedWaiters[t-1]=[]),function(t,e){const r=i(t,t=>e.priority<=t.priority);t.splice(r+1,0,e)}(this._weightedWaiters[t-1],{resolve:r,priority:e})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(t){this._value=t,this._dispatchQueue()}release(t=1){if(t<=0)throw new Error(`invalid weight ${t}: must be positive`);this._value+=t,this._dispatchQueue()}cancel(){this._queue.forEach(t=>t.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(t){const e=this._value;this._value-=t.weight,t.resolve([e,this._newReleaser(t.weight)])}_newReleaser(t){let e=!1;return()=>{e||(e=!0,this.release(t))}}_drainUnlockWaiters(){if(0===this._queue.length)for(let t=this._value;t>0;t--){const e=this._weightedWaiters[t-1];e&&(e.forEach(t=>t.resolve()),this._weightedWaiters[t-1]=[])}else{const t=this._queue[0].priority;for(let e=this._value;e>0;e--){const r=this._weightedWaiters[e-1];if(!r)continue;const n=r.findIndex(e=>e.priority<=t);(-1===n?r:r.splice(0,n)).forEach(t=>t.resolve())}}}_couldLockImmediately(t,e){return(0===this._queue.length||this._queue[0].priority=0;r--)if(e(t[r]))return r;return-1}class u{constructor(t){this._semaphore=new o(1,t)}acquire(){return t=this,e=arguments,n=function*(t=0){const[,e]=yield this._semaphore.acquire(1,t);return e},new((r=void 0)||(r=Promise))(function(o,i){function u(t){try{s(n.next(t))}catch(t){i(t)}}function a(t){try{s(n.throw(t))}catch(t){i(t)}}function s(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r(function(t){t(e)})).then(u,a)}s((n=n.apply(t,e||[])).next())});var t,e,r,n}runExclusive(t,e=0){return this._semaphore.runExclusive(()=>t(),1,e)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(t=0){return this._semaphore.waitForUnlock(1,t)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}},92096:(t,e,r)=>{var n;t=r.nmd(t);var o=function(t){"use strict";var e=1e7,r=9007199254740992,n=f(r),i="0123456789abcdefghijklmnopqrstuvwxyz",u="function"==typeof BigInt;function a(t,e,r,n){return void 0===t?a[0]:void 0===e||10===+e&&!r?Q(t):R(t,e,r,n)}function s(t,e){this.value=t,this.sign=e,this.isSmall=!1}function p(t){this.value=t,this.sign=t<0,this.isSmall=!0}function h(t){this.value=t}function l(t){return-r0?Math.floor(t):Math.ceil(t)}function w(t,r){var n,o,i=t.length,u=r.length,a=new Array(i),s=0,p=e;for(o=0;o=p?1:0,a[o]=n-s*p;for(;o0&&a.push(s),a}function d(t,e){return t.length>=e.length?w(t,e):w(e,t)}function m(t,r){var n,o,i=t.length,u=new Array(i),a=e;for(o=0;o0;)u[o++]=r%a,r=Math.floor(r/a);return u}function b(t,r){var n,o,i=t.length,u=r.length,a=new Array(i),s=0,p=e;for(n=0;n0;)u[o++]=s%a,s=Math.floor(s/a);return u}function M(t,e){for(var r=[];e-- >0;)r.push(0);return r.concat(t)}function _(t,e){var r=Math.max(t.length,e.length);if(r<=30)return E(t,e);r=Math.ceil(r/2);var n=t.slice(r),o=t.slice(0,r),i=e.slice(r),u=e.slice(0,r),a=_(o,u),s=_(n,i),p=_(d(o,n),d(u,i)),h=d(d(a,M(b(b(p,a),s),r)),M(s,2*r));return y(h),h}function A(t,r,n){return new s(t=0;--n)i=(u=i*p+t[n])-(o=g(u/r))*r,s[n]=0|o;return[s,0|i]}function U(t,r){var n,o=Q(r);if(u)return[new h(t.value/o.value),new h(t.value%o.value)];var i,l=t.value,w=o.value;if(0===w)throw new Error("Cannot divide by zero");if(t.isSmall)return o.isSmall?[new p(g(l/w)),new p(l%w)]:[a[0],t];if(o.isSmall){if(1===w)return[t,a[0]];if(-1==w)return[t.negate(),a[0]];var d=Math.abs(w);if(d=0;o--){for(n=f-1,d[o+l]!==g&&(n=Math.floor((d[o+l]*f+d[o+l-1])/g)),i=0,u=0,s=m.length,a=0;ap&&(i=(i+1)*f),n=Math.ceil(i/u);do{if(I(a=q(r,n),l)<=0)break;n--}while(n);h.push(n),l=b(l,a)}return h.reverse(),[c(h),c(l)]}(l,w),i=n[0];var E=t.sign!==o.sign,M=n[1],_=t.sign;return"number"==typeof i?(E&&(i=-i),i=new p(i)):i=new s(i,E),"number"==typeof M?(_&&(M=-M),M=new p(M)):M=new s(M,_),[i,M]}function I(t,e){if(t.length!==e.length)return t.length>e.length?1:-1;for(var r=t.length-1;r>=0;r--)if(t[r]!==e[r])return t[r]>e[r]?1:-1;return 0}function P(t){var e=t.abs();return!e.isUnit()&&(!!(e.equals(2)||e.equals(3)||e.equals(5))||!(e.isEven()||e.isDivisibleBy(3)||e.isDivisibleBy(5))&&(!!e.lesser(49)||void 0))}function O(t,e){for(var r,n,i,u=t.prev(),a=u,s=0;a.isEven();)a=a.divide(2),s++;t:for(n=0;n=0?n=b(t,e):(n=b(e,t),r=!r),"number"==typeof(n=c(n))?(r&&(n=-n),new p(n)):new s(n,r)}(r,n,this.sign)},s.prototype.minus=s.prototype.subtract,p.prototype.subtract=function(t){var e=Q(t),r=this.value;if(r<0!==e.sign)return this.add(e.negate());var n=e.value;return e.isSmall?new p(r-n):S(n,Math.abs(r),r>=0)},p.prototype.minus=p.prototype.subtract,h.prototype.subtract=function(t){return new h(this.value-Q(t).value)},h.prototype.minus=h.prototype.subtract,s.prototype.negate=function(){return new s(this.value,!this.sign)},p.prototype.negate=function(){var t=this.sign,e=new p(-this.value);return e.sign=!t,e},h.prototype.negate=function(){return new h(-this.value)},s.prototype.abs=function(){return new s(this.value,!1)},p.prototype.abs=function(){return new p(Math.abs(this.value))},h.prototype.abs=function(){return new h(this.value>=0?this.value:-this.value)},s.prototype.multiply=function(t){var r,n,o,i=Q(t),u=this.value,p=i.value,h=this.sign!==i.sign;if(i.isSmall){if(0===p)return a[0];if(1===p)return this;if(-1===p)return this.negate();if((r=Math.abs(p))0?_(u,p):E(u,p),h)},s.prototype.times=s.prototype.multiply,p.prototype._multiplyBySmall=function(t){return l(t.value*this.value)?new p(t.value*this.value):A(Math.abs(t.value),f(Math.abs(this.value)),this.sign!==t.sign)},s.prototype._multiplyBySmall=function(t){return 0===t.value?a[0]:1===t.value?this:-1===t.value?this.negate():A(Math.abs(t.value),this.value,this.sign!==t.sign)},p.prototype.multiply=function(t){return Q(t)._multiplyBySmall(this)},p.prototype.times=p.prototype.multiply,h.prototype.multiply=function(t){return new h(this.value*Q(t).value)},h.prototype.times=h.prototype.multiply,s.prototype.square=function(){return new s(N(this.value),!1)},p.prototype.square=function(){var t=this.value*this.value;return l(t)?new p(t):new s(N(f(Math.abs(this.value))),!1)},h.prototype.square=function(t){return new h(this.value*this.value)},s.prototype.divmod=function(t){var e=U(this,t);return{quotient:e[0],remainder:e[1]}},h.prototype.divmod=p.prototype.divmod=s.prototype.divmod,s.prototype.divide=function(t){return U(this,t)[0]},h.prototype.over=h.prototype.divide=function(t){return new h(this.value/Q(t).value)},p.prototype.over=p.prototype.divide=s.prototype.over=s.prototype.divide,s.prototype.mod=function(t){return U(this,t)[1]},h.prototype.mod=h.prototype.remainder=function(t){return new h(this.value%Q(t).value)},p.prototype.remainder=p.prototype.mod=s.prototype.remainder=s.prototype.mod,s.prototype.pow=function(t){var e,r,n,o=Q(t),i=this.value,u=o.value;if(0===u)return a[1];if(0===i)return a[0];if(1===i)return a[1];if(-1===i)return o.isEven()?a[1]:a[-1];if(o.sign)return a[0];if(!o.isSmall)throw new Error("The exponent "+o.toString()+" is too large.");if(this.isSmall&&l(e=Math.pow(i,u)))return new p(g(e));for(r=this,n=a[1];!0&u&&(n=n.times(r),--u),0!==u;)u/=2,r=r.square();return n},p.prototype.pow=s.prototype.pow,h.prototype.pow=function(t){var e=Q(t),r=this.value,n=e.value,o=BigInt(0),i=BigInt(1),u=BigInt(2);if(n===o)return a[1];if(r===o)return a[0];if(r===i)return a[1];if(r===BigInt(-1))return e.isEven()?a[1]:a[-1];if(e.isNegative())return new h(o);for(var s=this,p=a[1];(n&i)===i&&(p=p.times(s),--n),n!==o;)n/=u,s=s.square();return p},s.prototype.modPow=function(t,e){if(t=Q(t),(e=Q(e)).isZero())throw new Error("Cannot take modPow with modulus 0");var r=a[1],n=this.mod(e);for(t.isNegative()&&(t=t.multiply(a[-1]),n=n.modInv(e));t.isPositive();){if(n.isZero())return a[0];t.isOdd()&&(r=r.multiply(n).mod(e)),t=t.divide(2),n=n.square().mod(e)}return r},h.prototype.modPow=p.prototype.modPow=s.prototype.modPow,s.prototype.compareAbs=function(t){var e=Q(t),r=this.value,n=e.value;return e.isSmall?1:I(r,n)},p.prototype.compareAbs=function(t){var e=Q(t),r=Math.abs(this.value),n=e.value;return e.isSmall?r===(n=Math.abs(n))?0:r>n?1:-1:-1},h.prototype.compareAbs=function(t){var e=this.value,r=Q(t).value;return(e=e>=0?e:-e)===(r=r>=0?r:-r)?0:e>r?1:-1},s.prototype.compare=function(t){if(t===1/0)return-1;if(t===-1/0)return 1;var e=Q(t),r=this.value,n=e.value;return this.sign!==e.sign?e.sign?1:-1:e.isSmall?this.sign?-1:1:I(r,n)*(this.sign?-1:1)},s.prototype.compareTo=s.prototype.compare,p.prototype.compare=function(t){if(t===1/0)return-1;if(t===-1/0)return 1;var e=Q(t),r=this.value,n=e.value;return e.isSmall?r==n?0:r>n?1:-1:r<0!==e.sign?r<0?-1:1:r<0?1:-1},p.prototype.compareTo=p.prototype.compare,h.prototype.compare=function(t){if(t===1/0)return-1;if(t===-1/0)return 1;var e=this.value,r=Q(t).value;return e===r?0:e>r?1:-1},h.prototype.compareTo=h.prototype.compare,s.prototype.equals=function(t){return 0===this.compare(t)},h.prototype.eq=h.prototype.equals=p.prototype.eq=p.prototype.equals=s.prototype.eq=s.prototype.equals,s.prototype.notEquals=function(t){return 0!==this.compare(t)},h.prototype.neq=h.prototype.notEquals=p.prototype.neq=p.prototype.notEquals=s.prototype.neq=s.prototype.notEquals,s.prototype.greater=function(t){return this.compare(t)>0},h.prototype.gt=h.prototype.greater=p.prototype.gt=p.prototype.greater=s.prototype.gt=s.prototype.greater,s.prototype.lesser=function(t){return this.compare(t)<0},h.prototype.lt=h.prototype.lesser=p.prototype.lt=p.prototype.lesser=s.prototype.lt=s.prototype.lesser,s.prototype.greaterOrEquals=function(t){return this.compare(t)>=0},h.prototype.geq=h.prototype.greaterOrEquals=p.prototype.geq=p.prototype.greaterOrEquals=s.prototype.geq=s.prototype.greaterOrEquals,s.prototype.lesserOrEquals=function(t){return this.compare(t)<=0},h.prototype.leq=h.prototype.lesserOrEquals=p.prototype.leq=p.prototype.lesserOrEquals=s.prototype.leq=s.prototype.lesserOrEquals,s.prototype.isEven=function(){return!(1&this.value[0])},p.prototype.isEven=function(){return!(1&this.value)},h.prototype.isEven=function(){return(this.value&BigInt(1))===BigInt(0)},s.prototype.isOdd=function(){return!(1&~this.value[0])},p.prototype.isOdd=function(){return!(1&~this.value)},h.prototype.isOdd=function(){return(this.value&BigInt(1))===BigInt(1)},s.prototype.isPositive=function(){return!this.sign},p.prototype.isPositive=function(){return this.value>0},h.prototype.isPositive=p.prototype.isPositive,s.prototype.isNegative=function(){return this.sign},p.prototype.isNegative=function(){return this.value<0},h.prototype.isNegative=p.prototype.isNegative,s.prototype.isUnit=function(){return!1},p.prototype.isUnit=function(){return 1===Math.abs(this.value)},h.prototype.isUnit=function(){return this.abs().value===BigInt(1)},s.prototype.isZero=function(){return!1},p.prototype.isZero=function(){return 0===this.value},h.prototype.isZero=function(){return this.value===BigInt(0)},s.prototype.isDivisibleBy=function(t){var e=Q(t);return!e.isZero()&&(!!e.isUnit()||(0===e.compareAbs(2)?this.isEven():this.mod(e).isZero()))},h.prototype.isDivisibleBy=p.prototype.isDivisibleBy=s.prototype.isDivisibleBy,s.prototype.isPrime=function(e){var r=P(this);if(r!==t)return r;var n=this.abs(),i=n.bitLength();if(i<=64)return O(n,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var u=Math.log(2)*i.toJSNumber(),a=Math.ceil(!0===e?2*Math.pow(u,2):u),s=[],p=0;p-r?new p(t-1):new s(n,!0)},h.prototype.prev=function(){return new h(this.value-BigInt(1))};for(var x=[1];2*x[x.length-1]<=e;)x.push(2*x[x.length-1]);var B=x.length,K=x[B-1];function L(t){return Math.abs(t)<=e}function z(t,e,r){e=Q(e);for(var n=t.isNegative(),i=e.isNegative(),u=n?t.not():t,a=i?e.not():e,s=0,p=0,h=null,l=null,f=[];!u.isZero()||!a.isZero();)s=(h=U(u,K))[1].toJSNumber(),n&&(s=K-1-s),p=(l=U(a,K))[1].toJSNumber(),i&&(p=K-1-p),u=h[0],a=l[0],f.push(r(s,p));for(var c=0!==r(n?1:0,i?1:0)?o(-1):o(0),y=f.length-1;y>=0;y-=1)c=c.multiply(K).add(o(f[y]));return c}s.prototype.shiftLeft=function(t){var e=Q(t).toJSNumber();if(!L(e))throw new Error(String(e)+" is too large for shifting.");if(e<0)return this.shiftRight(-e);var r=this;if(r.isZero())return r;for(;e>=B;)r=r.multiply(K),e-=B-1;return r.multiply(x[e])},h.prototype.shiftLeft=function(t){return t=Q(t),new h(this.value<=B;){if(n.isZero()||n.isNegative()&&n.isUnit())return n;n=(e=U(n,K))[1].isNegative()?e[0].prev():e[0],r-=B-1}return(e=U(n,x[r]))[1].isNegative()?e[0].prev():e[0]},h.prototype.shiftRight=function(t){return t=Q(t),new h(this.value>>t.value)},p.prototype.shiftRight=s.prototype.shiftRight,s.prototype.not=function(){return this.negate().prev()},h.prototype.not=p.prototype.not=s.prototype.not,s.prototype.and=function(t){return z(this,t,function(t,e){return t&e})},h.prototype.and=p.prototype.and=s.prototype.and,s.prototype.or=function(t){return z(this,t,function(t,e){return t|e})},h.prototype.or=p.prototype.or=s.prototype.or,s.prototype.xor=function(t){return z(this,t,function(t,e){return t^e})},h.prototype.xor=p.prototype.xor=s.prototype.xor;var Z=1<<30;function C(t){var r=t.value,n="number"==typeof r?r|Z:"bigint"==typeof r?r|BigInt(Z):r[0]+r[1]*e|1073758208;return n&-n}function T(t,e){if(e.compareTo(t)<=0){var r=T(t,e.square(e)),n=r.p,i=r.e,u=n.multiply(e);return u.compareTo(t)<=0?{p:u,e:2*i+1}:{p:n,e:2*i}}return{p:o(1),e:0}}function J(t,e){return t=Q(t),e=Q(e),t.greater(e)?t:e}function W(t,e){return t=Q(t),e=Q(e),t.lesser(e)?t:e}function j(t,e){if(t=Q(t).abs(),e=Q(e).abs(),t.equals(e))return t;if(t.isZero())return e;if(e.isZero())return t;for(var r,n,o=a[1];t.isEven()&&e.isEven();)r=W(C(t),C(e)),t=t.divide(r),e=e.divide(r),o=o.multiply(r);for(;t.isEven();)t=t.divide(C(t));do{for(;e.isEven();)e=e.divide(C(e));t.greater(e)&&(n=e,e=t,t=n),e=e.subtract(t)}while(!e.isZero());return o.isUnit()?t:t.multiply(o)}s.prototype.bitLength=function(){var t=this;return t.compareTo(o(0))<0&&(t=t.negate().subtract(o(1))),0===t.compareTo(o(0))?o(0):o(T(t,o(2)).e).add(o(1))},h.prototype.bitLength=p.prototype.bitLength=s.prototype.bitLength;var R=function(t,e,r,n){r=r||i,t=String(t),n||(t=t.toLowerCase(),r=r.toLowerCase());var o,u=t.length,a=Math.abs(e),s={};for(o=0;o=a){if("1"===l&&1===a)continue;throw new Error(l+" is not a valid digit in base "+e+".")}e=Q(e);var p=[],h="-"===t[0];for(o=h?1:0;o"!==t[o]&&o=0;n--)o=o.add(t[n].times(i)),i=i.times(e);return r?o.negate():o}function V(t,e){if((e=o(e)).isZero()){if(t.isZero())return{value:[0],isNegative:!1};throw new Error("Cannot convert nonzero numbers to base 0.")}if(e.equals(-1)){if(t.isZero())return{value:[0],isNegative:!1};if(t.isNegative())return{value:[].concat.apply([],Array.apply(null,Array(-t.toJSNumber())).map(Array.prototype.valueOf,[1,0])),isNegative:!1};var r=Array.apply(null,Array(t.toJSNumber()-1)).map(Array.prototype.valueOf,[0,1]);return r.unshift([1]),{value:[].concat.apply([],r),isNegative:!1}}var n=!1;if(t.isNegative()&&e.isPositive()&&(n=!0,t=t.abs()),e.isUnit())return t.isZero()?{value:[0],isNegative:!1}:{value:Array.apply(null,Array(t.toJSNumber())).map(Number.prototype.valueOf,1),isNegative:n};for(var i,u=[],a=t;a.isNegative()||a.compareAbs(e)>=0;){i=a.divmod(e),a=i.quotient;var s=i.remainder;s.isNegative()&&(s=e.minus(s).abs(),a=a.next()),u.push(s.toJSNumber())}return u.push(a.toJSNumber()),{value:u.reverse(),isNegative:n}}function $(t,e,r){var n=V(t,e);return(n.isNegative?"-":"")+n.value.map(function(t){return function(t,e){return t<(e=e||i).length?e[t]:"<"+t+">"}(t,r)}).join("")}function F(t){if(l(+t)){var e=+t;if(e===g(e))return u?new h(BigInt(e)):new p(e);throw new Error("Invalid integer: "+t)}var r="-"===t[0];r&&(t=t.slice(1));var n=t.split(/e/i);if(n.length>2)throw new Error("Invalid integer: "+n.join("e"));if(2===n.length){var o=n[1];if("+"===o[0]&&(o=o.slice(1)),(o=+o)!==g(o)||!l(o))throw new Error("Invalid integer: "+o+" is not a valid exponent.");var i=n[0],a=i.indexOf(".");if(a>=0&&(o-=i.length-a-1,i=i.slice(0,a)+i.slice(a+1)),o<0)throw new Error("Cannot include negative exponent part for integers");t=i+=new Array(o+1).join("0")}if(!/^([0-9][0-9]*)$/.test(t))throw new Error("Invalid integer: "+t);if(u)return new h(BigInt(r?"-"+t:t));for(var f=[],c=t.length,v=c-7;c>0;)f.push(+t.slice(v,c)),(v-=7)<0&&(v=0),c-=7;return y(f),new s(f,r)}function Q(t){return"number"==typeof t?function(t){if(u)return new h(BigInt(t));if(l(t)){if(t!==g(t))throw new Error(t+" is not an integer.");return new p(t)}return F(t.toString())}(t):"string"==typeof t?F(t):"bigint"==typeof t?new h(t):t}s.prototype.toArray=function(t){return V(this,t)},p.prototype.toArray=function(t){return V(this,t)},h.prototype.toArray=function(t){return V(this,t)},s.prototype.toString=function(e,r){if(e===t&&(e=10),10!==e)return $(this,e,r);for(var n,o=this.value,i=o.length,u=String(o[--i]);--i>=0;)n=String(o[i]),u+="0000000".slice(n.length)+n;return(this.sign?"-":"")+u},p.prototype.toString=function(e,r){return e===t&&(e=10),10!=e?$(this,e,r):String(this.value)},h.prototype.toString=p.prototype.toString,h.prototype.toJSON=s.prototype.toJSON=p.prototype.toJSON=function(){return this.toString()},s.prototype.valueOf=function(){return parseInt(this.toString(),10)},s.prototype.toJSNumber=s.prototype.valueOf,p.prototype.valueOf=function(){return this.value},p.prototype.toJSNumber=p.prototype.valueOf,h.prototype.valueOf=h.prototype.toJSNumber=function(){return parseInt(this.toString(),10)};for(var X=0;X<1e3;X++)a[X]=Q(X),X>0&&(a[-X]=Q(-X));return a.one=a[1],a.zero=a[0],a.minusOne=a[-1],a.max=J,a.min=W,a.gcd=j,a.lcm=function(t,e){return t=Q(t).abs(),e=Q(e).abs(),t.divide(j(t,e)).multiply(e)},a.isInstance=function(t){return t instanceof s||t instanceof p||t instanceof h},a.randBetween=function(t,r,n){t=Q(t),r=Q(r);var o=n||Math.random,i=W(t,r),u=J(t,r).subtract(i).add(1);if(u.isSmall)return i.add(Math.floor(o()*u));for(var s=V(u,e).value,p=[],h=!0,l=0;l