tweb/public/b601bf8645daa9db7023.worker.js

13 lines
351 KiB
JavaScript
Raw Normal View History

!function(e){var t={};function a(n){if(t[n])return t[n].exports;var s=t[n]={i:n,l:!1,exports:{}};return e[n].call(s.exports,s,s.exports,a),s.l=!0,s.exports}a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)a.d(n,s,function(t){return e[t]}.bind(null,s));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t),t},a.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},a.p="",a(a.s=19)}([function(e,t,a){"use strict";
/*!
* Webogram v0.7.0 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE
*/Object.defineProperty(t,"__esModule",{value:!0}),t.getFileNameByLocation=t.nextRandomInt=t.addPadding=t.longFromInts=t.longToBytes=t.bytesToWordss=t.bytesFromWordss=t.bytesFromWords=t.longToInts=t.bufferConcats=t.bufferConcat=t.bytesFromArrayBuffer=t.convertToByteArray=t.convertToUint8Array=t.convertToArrayBuffer=t.bytesToArrayBuffer=t.bytesFromBigInt=t.bytesXor=t.bytesCmp=t.blobSafeMimeType=t.blobConstruct=t.dataUrlToBlob=t.base64ToBlob=t.uint6ToBase64=t.bytesToBase64=t.bytesFromHex=t.bytesToHex=t.bigStringInt=t.bigint=t.isObject=t.dT=void 0;const n=a(5);var s=Date.now();function i(e){return new n.BigInteger(e.toString(16),16)}function r(e){return new n.BigInteger(e,10)}function p(e){return e<26?e+65:e<52?e+71:e<62?e-4:62===e?43:63===e?47:65}function o(e,t){for(var a=atob(e),n=a.length,s=Math.ceil(n/1024),i=new Array(s),r=0;r<s;++r){for(var p=1024*r,o=Math.min(p+1024,n),m=new Array(o-p),y=p,c=0;y<o;++c,++y)m[c]=a[y].charCodeAt(0);i[r]=new Uint8Array(m)}return d(i,t)}function d(e,t=""){let a;const n=m(t);try{a=new Blob(e,{type:n})}catch(t){let s=new BlobBuilder;e.forEach(e=>{s.append(e)}),a=s.getBlob(n)}return a}function m(e){return-1===["image/jpeg","image/png","image/gif","image/webp","image/bmp","video/mp4","video/webm","video/quicktime","audio/ogg","audio/mpeg","audio/mp4","application/json"].indexOf(e)?"application/octet-stream":e}function y(e){return new Uint8Array(e).buffer}function c(e){return void 0!==e.buffer?e:new Uint8Array(e)}function l(e,t){var a=e.byteLength||e.length,n=t.byteLength||t.length,s=new Uint8Array(a+n);return s.set(e instanceof ArrayBuffer?new Uint8Array(e):e,0),s.set(t instanceof ArrayBuffer?new Uint8Array(t):t,a),s.buffer}function u(e){var t=r(e).divideAndRemainder(i(4294967296));return[t[0].intValue(),t[1].intValue()]}function g(e){for(var t=e.words,a=e.sigBytes,n=[],s=0;s<a;s++)n.push(t[s>>>2]>>>24-s%4*8&255);return n}t.dT=function(){return"["+((Date.now()-s)/1e3).toFixed(3)+"]"},t.isObject=function(e){return"object"==typeof e&&null!==e},t.bigint=i,t.bigStringInt=r,t.bytesToHex=function(e){e=e||[];for(var t=[],a=0;a<e.length;a++)t.push((e[a]<16?"0":"")+(e[a]||0).toString(16));return t.join("")},t.bytesFromHex=function(e){var t,a=e.length,n=0,s=[];for(e.length%2&&(s.push(parseInt(e.charAt(0),16)),n++),t=n;t<a;t+=2)s.push(parseInt(e.substr(t,2),16));return s},t.bytesToBase64=function(e){for(var t,a="",n=e.length,s=0,i=0;i<n;i++)t=i%3,s|=e[i]<<(16>>>t&24),2!==t&&n-i!=1||(a+=String.fromCharCode(p(s>>>18&63),p(s>>>12&63),p(s>>>6&63),p(63&s)),s=0);return a.replace(/A(?=A$|$)/g,"=")},t.uint6ToBase64=p,t.base64ToBlob=o,t.dataUrlToBlob=function(e){var t=e.split(",");return o(t[1],t[0].split(":")[1].split(";")[0])},t.blobConstruct=d,t.blobSafeMimeType=m,t.bytesCmp=function(e,t){var a=e.length;if(a!=t.length)return!1;for(var n=0;n<a;n++)if(e[n]!=t[n])return!1;return!0},t.bytesXor=function(e,t){for(var a=e.length,n=[],s=0;s<a;++s)n[s]=e[s]^t[s];return n},t.bytesFromBigInt=function(e,t){var a=e.toByteArray();if(t&&a.length<t){for(var n=[],s=0,i=t-a.length;s<i;s++)n[s]=0;a=a instanceof ArrayBuffer?l(n,a):n.concat(a)}else for(;!a[0]&&(!t||a.length>t);)a=a.slice(1);return a},t.bytesToArrayBuffer=y,t.convertToArrayBuffer=function(e){return e instanceof ArrayBuffer?e:void 0!==e.buffer&&e.buffer.byteLength==e.length*e.BYTES_PER_ELEMENT?e.buffer:y(e)},t.convertToUint8Array=c,t.convertToByteArray=function(e){if(Array.isArray(e))return e;for(var t=[],a=0,n=(e=c(e)).length;a<n;a++)t.push(e[a]);return t},t.bytesFromArrayBuffer=function(e){for(var t=e.byteLength,a=new Uint8Array(e),n=[],s=0;s<t;++s)n[s]=a[s];return n},t.bufferConcat=l,t.bufferConcats=function(...e){let t=0;e.forEach(e=>t+=e.byteLength||e.length);var a=new Uint8Array(t);let n=0;return e.forEach(e=>{a.set(e instanceof ArrayBuffer?new Uint8Array(e):e,n),n+=e.byteLength||e.length}),a},t.longToInts=u,t.bytesFromWords=g,t.bytesFromWordss=function(e){for(var t=[],a=0;a<4*e.length;a++)t.push(e[a>>>2]>>>24-a%4*8&255);return t},t.bytesToWordss=function(e){let t;t=e instanceof ArrayBuffer?new Uint8Array(e):e;var a,n=t.length,s=[];for(a=0;a<n;a++)s[a>>>2]|
/*!
* Webogram v0.7.0 - messaging web application for MTProto
* https://github.com/zhukov/webogram
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE
*/var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.TLSerialization=t.TLDeserialization=void 0;const s=a(0),i=n(a(12)),r=a(13),p=+i.default.API.constructors.find(e=>"boolFalse"==e.predicate).id>>>0,o=+i.default.API.constructors.find(e=>"boolTrue"==e.predicate).id>>>0,d=+i.default.API.constructors.find(e=>"vector"==e.predicate).id>>>0,m=+i.default.MTProto.constructors.find(e=>"gzip_packed"==e.predicate).id>>>0;t.TLSerialization=class{constructor(e={}){this.maxLength=2048,this.offset=0,this.mtproto=!1,this.debug=!1,this.maxLength=e.startMaxLength||2048,this.mtproto=e.mtproto||!1,this.createBuffer()}createBuffer(){this.buffer=new ArrayBuffer(this.maxLength),this.intView=new Int32Array(this.buffer),this.byteView=new Uint8Array(this.buffer)}getArray(){let e=new ArrayBuffer(this.offset),t=new Int32Array(e);return t.set(this.intView.subarray(0,this.offset/4)),t}getBuffer(){return this.getArray().buffer}getBytes(e){if(e){let e=new ArrayBuffer(this.offset),t=new Uint8Array(e);return t.set(this.byteView.subarray(0,this.offset)),t}let t=[];for(var a=0;a<this.offset;a++)t.push(this.byteView[a]);return t}checkLength(e){if(!(this.offset+e<this.maxLength)){this.maxLength=4*Math.ceil(Math.max(2*this.maxLength,this.offset+e+16)/4);var t=this.buffer,a=new Int32Array(t);this.createBuffer(),new Int32Array(this.buffer).set(a)}}writeInt(e,t){this.debug&&console.log(">>>",e.toString(16),e,t),this.checkLength(4),this.intView[this.offset/4]=e,this.offset+=4}storeInt(e,t){this.writeInt(e,(t||"")+":int")}storeBool(e,t){e?this.writeInt(o,(t||"")+":bool"):this.writeInt(p,(t||"")+":bool")}storeLongP(e,t,a){this.writeInt(t,(a||"")+":long[low]"),this.writeInt(e,(a||"")+":long[high]")}storeLong(e,t){if(Array.isArray(e))return 2==e.length?this.storeLongP(e[0],e[1],t):this.storeIntBytes(e,64,t);"string"!=typeof e&&(e=e?e.toString():"0");var a=s.bigStringInt(e).divideAndRemainder(s.bigint(4294967296));this.writeInt(a[1].intValue(),(t||"")+":long[low]"),this.writeInt(a[0].intValue(),(t||"")+":long[high]")}storeDouble(e,t){var a=new ArrayBuffer(8),n=new Int32Array(a);new Float64Array(a)[0]=e,this.writeInt(n[0],(t||"")+":double[low]"),this.writeInt(n[1],(t||"")+":double[high]")}storeString(e,t){this.debug&&console.log(">>>",e,(t||"")+":string"),void 0===e&&(e="");var a=unescape(encodeURIComponent(e));this.checkLength(a.length+8);var n=a.length;n<=253?this.byteView[this.offset++]=n:(this.byteView[this.offset++]=254,this.byteView[this.offset++]=255&n,this.byteView[this.offset++]=(65280&n)>>8,this.byteView[this.offset++]=(16711680&n)>>16);for(var s=0;s<n;s++)this.byteView[this.offset++]=a.charCodeAt(s);for(;this.offset%4;)this.byteView[this.offset++]=0}storeBytes(e,t){e instanceof ArrayBuffer?e=new Uint8Array(e):void 0===e&&(e=[]),this.debug&&console.log(">>>",s.bytesToHex(e),(t||"")+":bytes");var a=e.byteLength||e.length;for(this.checkLength(a+8),a<=253?this.byteView[this.offset++]=a:(this.byteView[this.offset++]=254,this.byteView[this.offset++]=255&a,this.byteView[this.offset++]=(65280&a)>>8,this.byteView[this.offset++]=(16711680&a)>>16),this.byteView.set(e,this.offset),this.offset+=a;this.offset%4;)this.byteView[this.offset++]=0}storeIntBytes(e,t,a){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var n=e.length;if(t%32||8*n!=t)throw new Error("Invalid bits: "+t+", "+e.length);this.debug&&console.log(">>>",s.bytesToHex(e),(a||"")+":int"+t),this.checkLength(n),this.byteView.set(e,this.offset),this.offset+=n}storeRawBytes(e,t){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var a=e.length;this.debug&&console.log(">>>",s.bytesToHex(e),t||""),this.checkLength(a),this.byteView.set(e,this.offset),this.offset+=a}storeMethod(e,t){var a,n,s,r,p,o=this.mtproto?i.default.MTProto:i.default.API,d=!1;for(s=0;s<o.methods.length;s++)if(o.methods[s].method==e){d=o.methods[s];break}if(!d)throw new Error("No method "+e+" found");this.storeInt(d.id,e+"[id]");var m=d.params.length;for(s=0;s<m;s++){if(-1!==(n=(a=d.params[s]).type).indexOf("?")){if(!(t[(p=(r=n.split("?"))[0].split("."))[0]]&1<<p[1