TelegramPWA/dist/7540.a6646fe2a2a8682b6ca3.js
Alexander Zinchuk fb411a3125 [Build]
2025-06-04 20:43:36 +02:00

3 lines
30 KiB
JavaScript

/*! For license information please see 7540.a6646fe2a2a8682b6ca3.js.LICENSE.txt */
(self.webpackChunktelegram_t=self.webpackChunktelegram_t||[]).push([[7540],{251:(t,e)=>{e.read=function(t,e,r,n,o){var i,u,s=8*o-n-1,a=(1<<s)-1,p=a>>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+=s;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===a)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,s,a,p=8*i-o-1,h=(1<<p)-1,l=h>>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?(s=isNaN(e)?1:0,u=h):(u=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-u))<1&&(u--,a*=2),(e+=u+l>=1?f/a:f*Math.pow(2,1-l))*a>=2&&(u++,a/=2),u+l>=h?(s=0,u=h):u+l>=1?(s=(e*a-1)*Math.pow(2,o),u+=l):(s=e*Math.pow(2,l-1)*Math.pow(2,o),u=0));o>=8;t[r+c]=255&s,c+=y,s/=256,o-=8);for(u=u<<o|s,p+=o;p>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:()=>w,gj:()=>g});var n=new Uint8Array(256),o=new Uint8Array(256),i=new Uint32Array(256),u=new Uint32Array(256),s=new Uint32Array(256),a=new Uint32Array(256),p=new Uint32Array(256),h=new Uint32Array(256),l=new Uint32Array(256),f=new Uint32Array(256);function c(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<t.length;e+=4)r[e/4]=(o=e,(n=t).charCodeAt(o)<<24^n.charCodeAt(o+1)<<16^n.charCodeAt(o+2)<<8^n.charCodeAt(o+3));return r}var n,o;if(t instanceof Uint8Array){for(r=new Uint32Array(t.length/4),e=0;e<t.length;e+=4)r[e/4]=t[e]<<24^t[e+1]<<16^t[e+2]<<8^t[e+3];return r}throw new Error("Unable to create 32-bit words")}function y(t,e,r){void 0===r&&(r=t);for(var n=0;n<t.length;n++)r[n]=t[n]^e[n]}!function(){for(var t,e,r,c,y,v=new Uint8Array(256),g=new Uint8Array(256),w=0,d=0,m=0;m<256;m++)v[m]=m<<1^283*(m>>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,s[w]=c=c<<24^c>>>8,a[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 v=function(){function t(t){var e=c(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=c(t),h=new Uint32Array(4),l=p[0]^this.encKey[0],f=p[1]^this.encKey[1],y=p[2]^this.encKey[2],v=p[3]^this.encKey[3],g=this.encKey.length/4-2,w=4,d=0;d<g;d++)e=i[l>>>24]^u[f>>16&255]^s[y>>8&255]^a[255&v]^this.encKey[w],r=i[f>>>24]^u[y>>16&255]^s[v>>8&255]^a[255&l]^this.encKey[w+1],o=i[y>>>24]^u[v>>16&255]^s[l>>8&255]^a[255&f]^this.encKey[w+2],v=i[v>>>24]^u[l>>16&255]^s[f>>8&255]^a[255&y]^this.encKey[w+3],l=e,f=r,y=o,w+=4;for(d=0;d<4;d++)h[d]=n[l>>>24]<<24^n[f>>16&255]<<16^n[y>>8&255]<<8^n[255&v]^this.encKey[w++],e=l,l=f,f=y,y=v,v=e;return h},t.prototype.decrypt=function(t){for(var e,r,n,i=c(t),u=new Uint32Array(4),s=i[0]^this.decKey[0],a=i[3]^this.decKey[1],y=i[2]^this.decKey[2],v=i[1]^this.decKey[3],g=this.decKey.length/4-2,w=4,d=0;d<g;d++)e=p[s>>>24]^h[a>>16&255]^l[y>>8&255]^f[255&v]^this.decKey[w],r=p[a>>>24]^h[y>>16&255]^l[v>>8&255]^f[255&s]^this.decKey[w+1],n=p[y>>>24]^h[v>>16&255]^l[s>>8&255]^f[255&a]^this.decKey[w+2],v=p[v>>>24]^h[s>>16&255]^l[a>>8&255]^f[255&y]^this.decKey[w+3],s=e,a=r,y=n,w+=4;for(d=0;d<4;d++)u[3&-d]=o[s>>>24]<<24^o[a>>16&255]<<16^o[y>>8&255]<<8^o[255&v]^this.decKey[w++],e=s,s=a,a=y,y=v,v=e;return u},t}(),g=function(){function t(t,e,r){void 0===r&&(r=16),this.key=c(t),this.iv=c(e),this.cipher=new v(t),this.blockSize=r/4}return t.prototype.encrypt=function(t,e){for(var r=c(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),s=0;s<r.length;s+=this.blockSize){var a=r.subarray(s,s+this.blockSize);y(a,i,u);var p=this.cipher.encrypt(u);y(p,o),o=a,i=p;for(var h=s,l=0;h<r.length&&l<4;h++,l++)n[h]=p[l]}return n},t.prototype.decrypt=function(t,e){for(var r=c(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),s=0;s<n.length;s+=this.blockSize){var a=r.subarray(s,s+this.blockSize);y(a,o,u);var p=this.cipher.decrypt(u);y(p,i),i=a,o=p;for(var h=s,l=0;h<n.length&&l<4;h++,l++)n[h]=p[l]}return n},t}();!function(){function t(t,e,r){if(void 0===r&&(r=16),this.offset=0,this.key=c(t),this.counter=c(e),this.cipher=new v(t),this.blockSize=r/4,4!==this.counter.length)throw new Error("AES-CTR mode counter must be 16 bytes length")}t.prototype.encrypt=function(t,e){for(var r=c(t),n=e||new Uint32Array(r.length),o=this.offset,i=0;i<r.length;i+=this.blockSize){for(var u=this.cipher.encrypt(this.counter),s=i,a=o;s<r.length&&a<this.blockSize;s++,a++)n[s]=u[a]^r[s];r.length-i>=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 w=v},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"/"}},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{a(o.next(t))}catch(t){i(t)}}function s(t){try{a(o.throw(t))}catch(t){i(t)}}function a(e){var r;e.done?t(e.value):(r=e.value,r instanceof n?r:new n((function(t){t(r)}))).then(u,s)}a((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<e)&&t<=this._value}}function i(t,e){for(let r=t.length-1;r>=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{a(n.next(t))}catch(t){i(t)}}function s(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(u,s)}a((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 s(t,e,r,n){return void 0===t?s[0]:void 0===e||10===+e&&!r?Q(t):R(t,e,r,n)}function a(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-r<t&&t<r}function f(t){return t<1e7?[t]:t<1e14?[t%1e7,Math.floor(t/1e7)]:[t%1e7,Math.floor(t/1e7)%1e7,Math.floor(t/1e14)]}function c(t){y(t);var r=t.length;if(r<4&&I(t,n)<0)switch(r){case 0:return 0;case 1:return t[0];case 2:return t[0]+t[1]*e;default:return t[0]+(t[1]+t[2]*e)*e}return t}function y(t){for(var e=t.length;0===t[--e];);t.length=e+1}function v(t){for(var e=new Array(t),r=-1;++r<t;)e[r]=0;return e}function g(t){return t>0?Math.floor(t):Math.ceil(t)}function w(t,r){var n,o,i=t.length,u=r.length,s=new Array(i),a=0,p=e;for(o=0;o<u;o++)a=(n=t[o]+r[o]+a)>=p?1:0,s[o]=n-a*p;for(;o<i;)a=(n=t[o]+a)===p?1:0,s[o++]=n-a*p;return a>0&&s.push(a),s}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),s=e;for(o=0;o<i;o++)n=t[o]-s+r,r=Math.floor(n/s),u[o]=n-r*s,r+=1;for(;r>0;)u[o++]=r%s,r=Math.floor(r/s);return u}function b(t,r){var n,o,i=t.length,u=r.length,s=new Array(i),a=0,p=e;for(n=0;n<u;n++)(o=t[n]-a-r[n])<0?(o+=p,a=1):a=0,s[n]=o;for(n=u;n<i;n++){if(!((o=t[n]-a)<0)){s[n++]=o;break}o+=p,s[n]=o}for(;n<i;n++)s[n]=t[n];return y(s),s}function S(t,r,n){var o,i,u=t.length,s=new Array(u),h=-r,l=e;for(o=0;o<u;o++)i=t[o]+h,h=Math.floor(i/l),i%=l,s[o]=i<0?i+l:i;return"number"==typeof(s=c(s))?(n&&(s=-s),new p(s)):new a(s,n)}function q(t,r){var n,o,i,u,s=t.length,a=r.length,p=v(s+a),h=e;for(i=0;i<s;++i){u=t[i];for(var l=0;l<a;++l)n=u*r[l]+p[i+l],o=Math.floor(n/h),p[i+l]=n-o*h,p[i+l+1]+=o}return y(p),p}function E(t,r){var n,o,i=t.length,u=new Array(i),s=e,a=0;for(o=0;o<i;o++)n=t[o]*r+a,a=Math.floor(n/s),u[o]=n-a*s;for(;a>0;)u[o++]=a%s,a=Math.floor(a/s);return u}function _(t,e){for(var r=[];e-- >0;)r.push(0);return r.concat(t)}function A(t,e){var r=Math.max(t.length,e.length);if(r<=30)return q(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),s=A(o,u),a=A(n,i),p=A(d(o,n),d(u,i)),h=d(d(s,_(b(b(p,s),a),r)),_(a,2*r));return y(h),h}function M(t,r,n){return new a(t<e?E(r,t):q(r,f(t)),n)}function N(t){var r,n,o,i,u=t.length,s=v(u+u),a=e;for(o=0;o<u;o++){n=0-(i=t[o])*i;for(var p=o;p<u;p++)r=i*t[p]*2+s[o+p]+n,n=Math.floor(r/a),s[o+p]=r-n*a;s[o+u]=n}return y(s),s}function U(t,r){var n,o,i,u,s=t.length,a=v(s),p=e;for(i=0,n=s-1;n>=0;--n)i=(u=i*p+t[n])-(o=g(u/r))*r,a[n]=0|o;return[a,0|i]}function k(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)]:[s[0],t];if(o.isSmall){if(1===w)return[t,s[0]];if(-1==w)return[t.negate(),s[0]];var d=Math.abs(w);if(d<e){i=c((n=U(l,d))[0]);var m=n[1];return t.sign&&(m=-m),"number"==typeof i?(t.sign!==o.sign&&(i=-i),[new p(i),new p(m)]):[new a(i,t.sign!==o.sign),new p(m)]}w=f(d)}var S=I(l,w);if(-1===S)return[s[0],t];if(0===S)return[s[t.sign===o.sign?1:-1],s[0]];n=l.length+w.length<=200?function(t,r){var n,o,i,u,s,a,p,h=t.length,l=r.length,f=e,y=v(r.length),g=r[l-1],w=Math.ceil(f/(2*g)),d=E(t,w),m=E(r,w);for(d.length<=h&&d.push(0),m.push(0),g=m[l-1],o=h-l;o>=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,a=m.length,s=0;s<a;s++)i+=n*m[s],p=Math.floor(i/f),u+=d[o+s]-(i-p*f),i=p,u<0?(d[o+s]=u+f,u=-1):(d[o+s]=u,u=0);for(;0!==u;){for(n-=1,i=0,s=0;s<a;s++)(i+=d[o+s]-f+m[s])<0?(d[o+s]=i+f,i=0):(d[o+s]=i,i=1);u+=i}y[o]=n}return d=U(d,w)[0],[c(y),c(d)]}(l,w):function(t,r){for(var n,o,i,u,s,a=t.length,p=r.length,h=[],l=[],f=e;a;)if(l.unshift(t[--a]),y(l),I(l,r)<0)h.push(0);else{i=l[(o=l.length)-1]*f+l[o-2],u=r[p-1]*f+r[p-2],o>p&&(i=(i+1)*f),n=Math.ceil(i/u);do{if(I(s=E(r,n),l)<=0)break;n--}while(n);h.push(n),l=b(l,s)}return h.reverse(),[c(h),c(l)]}(l,w),i=n[0];var q=t.sign!==o.sign,_=n[1],A=t.sign;return"number"==typeof i?(q&&(i=-i),i=new p(i)):i=new a(i,q),"number"==typeof _?(A&&(_=-_),_=new p(_)):_=new a(_,A),[i,_]}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 O(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 P(t,e){for(var r,n,i,u=t.prev(),s=u,a=0;s.isEven();)s=s.divide(2),a++;t:for(n=0;n<e.length;n++)if(!t.lesser(e[n])&&!(i=o(e[n]).modPow(s,t)).isUnit()&&!i.equals(u)){for(r=a-1;0!=r;r--){if((i=i.square().mod(t)).isUnit())return!1;if(i.equals(u))continue t}return!1}return!0}a.prototype=Object.create(s.prototype),p.prototype=Object.create(s.prototype),h.prototype=Object.create(s.prototype),a.prototype.add=function(t){var e=Q(t);if(this.sign!==e.sign)return this.subtract(e.negate());var r=this.value,n=e.value;return e.isSmall?new a(m(r,Math.abs(n)),this.sign):new a(d(r,n),this.sign)},a.prototype.plus=a.prototype.add,p.prototype.add=function(t){var e=Q(t),r=this.value;if(r<0!==e.sign)return this.subtract(e.negate());var n=e.value;if(e.isSmall){if(l(r+n))return new p(r+n);n=f(Math.abs(n))}return new a(m(n,Math.abs(r)),r<0)},p.prototype.plus=p.prototype.add,h.prototype.add=function(t){return new h(this.value+Q(t).value)},h.prototype.plus=h.prototype.add,a.prototype.subtract=function(t){var e=Q(t);if(this.sign!==e.sign)return this.add(e.negate());var r=this.value,n=e.value;return e.isSmall?S(r,Math.abs(n),this.sign):function(t,e,r){var n;return I(t,e)>=0?n=b(t,e):(n=b(e,t),r=!r),"number"==typeof(n=c(n))?(r&&(n=-n),new p(n)):new a(n,r)}(r,n,this.sign)},a.prototype.minus=a.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,a.prototype.negate=function(){return new a(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)},a.prototype.abs=function(){return new a(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)},a.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 s[0];if(1===p)return this;if(-1===p)return this.negate();if((r=Math.abs(p))<e)return new a(E(u,r),h);p=f(r)}return new a(-.012*(n=u.length)-.012*(o=p.length)+15e-6*n*o>0?A(u,p):q(u,p),h)},a.prototype.times=a.prototype.multiply,p.prototype._multiplyBySmall=function(t){return l(t.value*this.value)?new p(t.value*this.value):M(Math.abs(t.value),f(Math.abs(this.value)),this.sign!==t.sign)},a.prototype._multiplyBySmall=function(t){return 0===t.value?s[0]:1===t.value?this:-1===t.value?this.negate():M(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,a.prototype.square=function(){return new a(N(this.value),!1)},p.prototype.square=function(){var t=this.value*this.value;return l(t)?new p(t):new a(N(f(Math.abs(this.value))),!1)},h.prototype.square=function(t){return new h(this.value*this.value)},a.prototype.divmod=function(t){var e=k(this,t);return{quotient:e[0],remainder:e[1]}},h.prototype.divmod=p.prototype.divmod=a.prototype.divmod,a.prototype.divide=function(t){return k(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=a.prototype.over=a.prototype.divide,a.prototype.mod=function(t){return k(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=a.prototype.remainder=a.prototype.mod,a.prototype.pow=function(t){var e,r,n,o=Q(t),i=this.value,u=o.value;if(0===u)return s[1];if(0===i)return s[0];if(1===i)return s[1];if(-1===i)return o.isEven()?s[1]:s[-1];if(o.sign)return s[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=s[1];!0&u&&(n=n.times(r),--u),0!==u;)u/=2,r=r.square();return n},p.prototype.pow=a.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 s[1];if(r===o)return s[0];if(r===i)return s[1];if(r===BigInt(-1))return e.isEven()?s[1]:s[-1];if(e.isNegative())return new h(o);for(var a=this,p=s[1];(n&i)===i&&(p=p.times(a),--n),n!==o;)n/=u,a=a.square();return p},a.prototype.modPow=function(t,e){if(t=Q(t),(e=Q(e)).isZero())throw new Error("Cannot take modPow with modulus 0");var r=s[1],n=this.mod(e);for(t.isNegative()&&(t=t.multiply(s[-1]),n=n.modInv(e));t.isPositive();){if(n.isZero())return s[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=a.prototype.modPow,a.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},a.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)},a.prototype.compareTo=a.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,a.prototype.equals=function(t){return 0===this.compare(t)},h.prototype.eq=h.prototype.equals=p.prototype.eq=p.prototype.equals=a.prototype.eq=a.prototype.equals,a.prototype.notEquals=function(t){return 0!==this.compare(t)},h.prototype.neq=h.prototype.notEquals=p.prototype.neq=p.prototype.notEquals=a.prototype.neq=a.prototype.notEquals,a.prototype.greater=function(t){return this.compare(t)>0},h.prototype.gt=h.prototype.greater=p.prototype.gt=p.prototype.greater=a.prototype.gt=a.prototype.greater,a.prototype.lesser=function(t){return this.compare(t)<0},h.prototype.lt=h.prototype.lesser=p.prototype.lt=p.prototype.lesser=a.prototype.lt=a.prototype.lesser,a.prototype.greaterOrEquals=function(t){return this.compare(t)>=0},h.prototype.geq=h.prototype.greaterOrEquals=p.prototype.geq=p.prototype.greaterOrEquals=a.prototype.geq=a.prototype.greaterOrEquals,a.prototype.lesserOrEquals=function(t){return this.compare(t)<=0},h.prototype.leq=h.prototype.lesserOrEquals=p.prototype.leq=p.prototype.lesserOrEquals=a.prototype.leq=a.prototype.lesserOrEquals,a.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)},a.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)},a.prototype.isPositive=function(){return!this.sign},p.prototype.isPositive=function(){return this.value>0},h.prototype.isPositive=p.prototype.isPositive,a.prototype.isNegative=function(){return this.sign},p.prototype.isNegative=function(){return this.value<0},h.prototype.isNegative=p.prototype.isNegative,a.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)},a.prototype.isZero=function(){return!1},p.prototype.isZero=function(){return 0===this.value},h.prototype.isZero=function(){return this.value===BigInt(0)},a.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=a.prototype.isDivisibleBy,a.prototype.isPrime=function(e){var r=O(this);if(r!==t)return r;var n=this.abs(),i=n.bitLength();if(i<=64)return P(n,[2,3,5,7,11,13,17,19,23,29,31,37]);for(var u=Math.log(2)*i.toJSNumber(),s=Math.ceil(!0===e?2*Math.pow(u,2):u),a=[],p=0;p<s;p++)a.push(o(p+2));return P(n,a)},h.prototype.isPrime=p.prototype.isPrime=a.prototype.isPrime,a.prototype.isProbablePrime=function(e,r){var n=O(this);if(n!==t)return n;for(var i=this.abs(),u=e===t?5:e,s=[],a=0;a<u;a++)s.push(o.randBetween(2,i.minus(2),r));return P(i,s)},h.prototype.isProbablePrime=p.prototype.isProbablePrime=a.prototype.isProbablePrime,a.prototype.modInv=function(t){for(var e,r,n,i=o.zero,u=o.one,s=Q(t),a=this.abs();!a.isZero();)e=s.divide(a),r=i,n=s,i=u,s=a,u=r.subtract(e.multiply(u)),a=n.subtract(e.multiply(a));if(!s.isUnit())throw new Error(this.toString()+" and "+t.toString()+" are not co-prime");return-1===i.compare(0)&&(i=i.add(t)),this.isNegative()?i.negate():i},h.prototype.modInv=p.prototype.modInv=a.prototype.modInv,a.prototype.next=function(){var t=this.value;return this.sign?S(t,1,this.sign):new a(m(t,1),this.sign)},p.prototype.next=function(){var t=this.value;return t+1<r?new p(t+1):new a(n,!1)},h.prototype.next=function(){return new h(this.value+BigInt(1))},a.prototype.prev=function(){var t=this.value;return this.sign?new a(m(t,1),!0):S(t,1,this.sign)},p.prototype.prev=function(){var t=this.value;return t-1>-r?new p(t-1):new a(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,s=i?e.not():e,a=0,p=0,h=null,l=null,f=[];!u.isZero()||!s.isZero();)a=(h=k(u,K))[1].toJSNumber(),n&&(a=K-1-a),p=(l=k(s,K))[1].toJSNumber(),i&&(p=K-1-p),u=h[0],s=l[0],f.push(r(a,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}a.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<<t.value)},p.prototype.shiftLeft=a.prototype.shiftLeft,a.prototype.shiftRight=function(t){var e,r=Q(t).toJSNumber();if(!L(r))throw new Error(String(r)+" is too large for shifting.");if(r<0)return this.shiftLeft(-r);for(var n=this;r>=B;){if(n.isZero()||n.isNegative()&&n.isUnit())return n;n=(e=k(n,K))[1].isNegative()?e[0].prev():e[0],r-=B-1}return(e=k(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=a.prototype.shiftRight,a.prototype.not=function(){return this.negate().prev()},h.prototype.not=p.prototype.not=a.prototype.not,a.prototype.and=function(t){return z(this,t,(function(t,e){return t&e}))},h.prototype.and=p.prototype.and=a.prototype.and,a.prototype.or=function(t){return z(this,t,(function(t,e){return t|e}))},h.prototype.or=p.prototype.or=a.prototype.or,a.prototype.xor=function(t){return z(this,t,(function(t,e){return t^e}))},h.prototype.xor=p.prototype.xor=a.prototype.xor;var Z=1<<30;function J(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 C(t,e){if(e.compareTo(t)<=0){var r=C(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 T(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=s[1];t.isEven()&&e.isEven();)r=W(J(t),J(e)),t=t.divide(r),e=e.divide(r),o=o.multiply(r);for(;t.isEven();)t=t.divide(J(t));do{for(;e.isEven();)e=e.divide(J(e));t.greater(e)&&(n=e,e=t,t=n),e=e.subtract(t)}while(!e.isZero());return o.isUnit()?t:t.multiply(o)}a.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(C(t,o(2)).e).add(o(1))},h.prototype.bitLength=p.prototype.bitLength=a.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,s=Math.abs(e),a={};for(o=0;o<r.length;o++)a[r[o]]=o;for(o=0;o<u;o++)if("-"!==(l=t[o])&&l in a&&a[l]>=s){if("1"===l&&1===s)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.length;o++){var l;if((l=t[o])in a)p.push(Q(a[l]));else{if("<"!==l)throw new Error(l+" is not a valid character");var f=o;do{o++}while(">"!==t[o]&&o<t.length);p.push(Q(t.slice(f+1,o)))}}return D(p,e,h)};function D(t,e,r){var n,o=s[0],i=s[1];for(n=t.length-1;n>=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=[],s=t;s.isNegative()||s.compareAbs(e)>=0;){i=s.divmod(e),s=i.quotient;var a=i.remainder;a.isNegative()&&(a=e.minus(a).abs(),s=s.next()),u.push(a.toJSNumber())}return u.push(s.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],s=i.indexOf(".");if(s>=0&&(o-=i.length-s-1,i=i.slice(0,s)+i.slice(s+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 a(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}a.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)},a.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=a.prototype.toJSON=p.prototype.toJSON=function(){return this.toString()},a.prototype.valueOf=function(){return parseInt(this.toString(),10)},a.prototype.toJSNumber=a.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++)s[X]=Q(X),X>0&&(s[-X]=Q(-X));return s.one=s[1],s.zero=s[0],s.minusOne=s[-1],s.max=j,s.min=W,s.gcd=T,s.lcm=function(t,e){return t=Q(t).abs(),e=Q(e).abs(),t.divide(T(t,e)).multiply(e)},s.isInstance=function(t){return t instanceof a||t instanceof p||t instanceof h},s.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 a=V(u,e).value,p=[],h=!0,l=0;l<a.length;l++){var f=h?a[l]:e,c=g(o()*f);p.push(c),c<f&&(h=!1)}return i.add(s.fromArray(p,e,!1))},s.fromArray=function(t,e,r){return D(t.map(Q),Q(e||10),r)},s}();t.hasOwnProperty("exports")&&(t.exports=o),void 0===(n=function(){return o}.call(e,r,e,t))||(t.exports=n)}}]);
//# sourceMappingURL=7540.a6646fe2a2a8682b6ca3.js.map