920 lines
43 KiB
TypeScript
920 lines
43 KiB
TypeScript
/* Metro module 7227; source: lib/uploader/UploaderBase.tsx; dependencies: [5, 6, 7, 15, 17, 18, 661, 4503, 3, 4658, 22, 4692, 4697, 4659, 639, 2] */
|
|
import Logger from '../../modules/debug/Logger.tsx'; /* Metro dependency 3 */
|
|
import Module00005 from '../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */
|
|
import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */
|
|
import PossibleConstructorReturn from '../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */
|
|
import Module00017 from '../../by-id/module-00017.js'; /* Metro dependency 17 */
|
|
import Inherits from '../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as Module00639Module from '../../by-id/module-00639.js'; /* Metro dependency 639 */
|
|
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as MessageConstantsModule from '../../modules/messages/MessageConstants.tsx'; /* Metro dependency 4503 */
|
|
import * as UploadUtilsModule from './UploadUtils.tsx'; /* Metro dependency 4658 */
|
|
|
|
function _fun57858(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57858, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:6, offset: 0x016b7d68, size: 332 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_57861 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = Logger;
|
|
value = new value('UploaderBase.tsx');
|
|
const EventEmitter = (Module00639Module).EventEmitter;
|
|
value = _fun57865(EventEmitter);
|
|
(FileImportTrackerModule).fileFinishedImporting('lib/uploader/UploaderBase.tsx');
|
|
exports.default = value;
|
|
function _createForOfIteratorHelperLoose_57859(a0, a1) { // fn#57859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:214, offset: 0x016b7eb4, size: 370 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun57860;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_57861(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_57861(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_57861(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun57860;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
function _fun57860() { // fn#57860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:785, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return env0_1 >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
|
|
}
|
|
|
|
}
|
|
|
|
function _isNativeReflectConstruct_57862() { // fn#57862, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:1124, offset: 0x016b8026, size: 94 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_57862_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function _fun57865(a0) { // fn#57865, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:1358, offset: 0x016b8084, size: 344 bytes, params: 2, frame: 17
|
|
const UploaderBase2 = UploaderBase;
|
|
Inherits(UploaderBase2, a0);
|
|
const items2 = [{key: '_fileSize', value: function() {
|
|
return this.files.reduce(_fun57875, 0);
|
|
}}];
|
|
const env0_1 = Module00005(_fun57877);
|
|
items2[1] = {key: 'compressAndCheckFileSize', value: value_57878};
|
|
items2[2] = {key: 'setUploadingTextForUI', value: value_57879};
|
|
items2[3] = {key: '_recomputeProgress', value: function() {
|
|
var value = this._recomputeProgressTotal();
|
|
this._handleProgress(value.loaded, value.total, this._recomputeProgressByFile());
|
|
}};
|
|
items2[4] = {key: '_recomputeProgressTotal', value: function() {
|
|
var value = this._fileSize();
|
|
var object = {};
|
|
object.loaded = this.files.reduce(_fun57884, 0);
|
|
object.total = value;
|
|
return object;
|
|
}};
|
|
items2[5] = {key: '_recomputeProgressByFile', value: function() {
|
|
this.files.forEach(_fun57886);
|
|
return {};
|
|
}};
|
|
items2[6] = {key: '_addAttachmentsToPayload', value: value_57887};
|
|
items2[7] = {key: 'clearProcessingMessageInterval', value: function() {
|
|
if (this.processingMessageChangeInterval != null) {
|
|
global.clearInterval(this.processingMessageChangeInterval);
|
|
this.processingMessageChangeInterval = undefined;
|
|
}
|
|
}};
|
|
items2[8] = {key: 'cancel', value: value_57889};
|
|
const env0_0 = Module00005(_fun57892);
|
|
items2[9] = {key: 'cancelItem', value: value_57894};
|
|
items2[10] = {key: 'upload', value: function(a0) {
|
|
if (this._cancel != null) {
|
|
throw new global.Error('Uploader.upload(...): An upload is already in progress.');
|
|
}
|
|
this._lastUpdate = global.Date.now();
|
|
this._loaded = 0;
|
|
this._file = {'id': null, 'currentSize': 0, 'totalPreCompressionSize': 0, 'compressionProgress': 0,
|
|
'progress': 0,
|
|
'rate': 0, 'hasImage': false, 'hasVideo': false, 'attachmentsCount': 0, id: this.id, items: a0};
|
|
}};
|
|
return CreateClass(UploaderBase2, items2);
|
|
function UploaderBase() { // fn#57866, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:1370, offset: 0x016b81dc, size: 303 bytes, params: 1, frame: 21
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
env1_4(this, UploaderBase);
|
|
const value3 = env1_7(UploaderBase);
|
|
const value6 = env1_6(this, _isNativeReflectConstruct_57862() ? global.Reflect.construct(value3, [],
|
|
env1_7(this).constructor) : value3.apply(this, undefined));
|
|
value6._aborted = false;
|
|
value6._errored = false;
|
|
value6.files = [];
|
|
value6._lastUpdate = 0;
|
|
value6._loaded = 0;
|
|
value6.alreadyStarted = false;
|
|
value6._handleStart = _handleStart;
|
|
value6._handleProgress = _handleProgress;
|
|
value6._handleException = _handleException;
|
|
value6._handleAborted = _handleAborted;
|
|
value6._handleError = _handleError;
|
|
value6._handleComplete = _handleComplete;
|
|
value6.id = (importDefault(22) /* metro dependency 22 */).uniqueId('Uploader');
|
|
value6._file = {'id': null, 'currentSize': 0, 'totalPreCompressionSize': 0, 'compressionProgress': 0, 'progress': 0,
|
|
'rate': 0, 'hasImage': false, 'hasVideo': false, 'attachmentsCount': 0, id: value6.id, items: undefined};
|
|
return value6;
|
|
function _handleStart(a0) { // fn#57867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:1683, owner: UploaderBase._handleStart, offset: 0x016b830b, size: 67 bytes, params: 2, frame: 14
|
|
let binding = env0_0;
|
|
binding._cancel = a0;
|
|
if (!binding.alreadyStarted) {
|
|
binding = env0_0;
|
|
binding.emit('start', binding._file);
|
|
}
|
|
env0_0.alreadyStarted = true;
|
|
}
|
|
|
|
function _handleProgress(a0, a1, a2) { // fn#57868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:1780, owner: UploaderBase._handleProgress, offset: 0x016b834e, size: 252 bytes, params: 4, frame: 22
|
|
var items2;
|
|
const env0_0 = a2;
|
|
const Date = global.Date;
|
|
const value = Date.now();
|
|
const value3 = (UploadUtilsModule).calculateProgress(a0, a1);
|
|
const Math = global.Math;
|
|
const floor = Math.floor;
|
|
let binding = env0_0;
|
|
const value5 = a0 - binding._loaded;
|
|
const value6 = value - binding._lastUpdate;
|
|
const value7 = Reflect.apply(floor, Math, [value5 / (value6 / 1000)]);
|
|
if (a2 != null) {
|
|
items2 = env0_0._file.items;
|
|
if (items2 != null) {
|
|
items2.forEach(function(a0) {
|
|
a0.item.progress = importDefault[a0.id];
|
|
});
|
|
}
|
|
}
|
|
binding = env0_0;
|
|
binding._lastUpdate = value;
|
|
binding._loaded = a0;
|
|
const object = {};
|
|
copyDataProperties(object, binding._file, value6);
|
|
object['currentSize'] = a1;
|
|
object['progress'] = value3;
|
|
object['rate'] = value7;
|
|
binding._file = object;
|
|
binding.emit('progress', binding._file);
|
|
}
|
|
|
|
function _handleException(a0) { // fn#57870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:2101, owner: UploaderBase._handleException, offset: 0x016b846c, size: 65 bytes, params: 2, frame: 14
|
|
const binding = env0_0;
|
|
const _handleError = binding._handleError;
|
|
const object2 = {};
|
|
const ERROR_SOURCE_UNKNOWN = FileUploadErrorTypes.ERROR_SOURCE_UNKNOWN;
|
|
object2.type = ERROR_SOURCE_UNKNOWN;
|
|
object2.msg = a0.toString();
|
|
Reflect.apply(_handleError, binding, [{reason: object2}]);
|
|
}
|
|
|
|
function _handleAborted() { // fn#57871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:2195, owner: UploaderBase._handleAborted, offset: 0x016b84ad, size: 21 bytes, params: 1, frame: 9
|
|
env0_0.clearProcessingMessageInterval();
|
|
}
|
|
|
|
function _handleError({code, reason, body}) { // fn#57872, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:2251, owner: UploaderBase._handleError, offset: 0x016b84c2, size: 184 bytes, params: 2, frame: 24
|
|
var binding2;
|
|
var log;
|
|
var value;
|
|
let binding = env0_0;
|
|
binding.clearProcessingMessageInterval();
|
|
if (!binding._aborted) {
|
|
binding = env0_0;
|
|
binding._errored = true;
|
|
value = environment.__proto__.__proto__;
|
|
binding2 = env2_11;
|
|
log = binding2.log;
|
|
value = global.JSON.stringify(reason);
|
|
Reflect.apply(log, binding2, ['_handleError: ' + code + ' (' + value + ') for ' + binding.id]);
|
|
binding.emit('error', binding._file, code, body, reason);
|
|
binding.removeAllListeners();
|
|
}
|
|
}
|
|
|
|
function _handleComplete(a0) { // fn#57873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:2478, owner: UploaderBase._handleComplete, offset: 0x016b857a, size: 104 bytes, params: 2, frame: 16
|
|
const binding = env0_0;
|
|
binding.clearProcessingMessageInterval();
|
|
const binding2 = env2_11;
|
|
binding2.log('_handleComplete for ' + binding.id);
|
|
binding.emit('complete', binding._file, a0);
|
|
binding.removeAllListeners();
|
|
}
|
|
|
|
}
|
|
|
|
function value_57874() { // fn#57874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:2862, offset: 0x016b85e2, size: 32 bytes, params: 1, frame: 13
|
|
return this.files.reduce(function(a0, {currentSize}) {
|
|
return a0 + (currentSize ?? 0);
|
|
}, 0);
|
|
}
|
|
|
|
function* _fun57877() { // fn#57877, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:3002, offset: 0x016b862b, size: 775 bytes, params: 1, frame: 34
|
|
var r5;
|
|
var r19;
|
|
var r1;
|
|
var object;
|
|
var concat;
|
|
var reactNativeCompressAndExtractData;
|
|
var value12;
|
|
var value13;
|
|
var value14;
|
|
var isCancelled;
|
|
var isCancelled2;
|
|
var currentSize;
|
|
var value15;
|
|
var value16;
|
|
var binding2;
|
|
var value17;
|
|
var getEffectiveKestrelLimit;
|
|
var getMaxFileSize;
|
|
var channelId;
|
|
var value18;
|
|
var value19;
|
|
var value20;
|
|
var value21;
|
|
var _handleError;
|
|
var ENTITY_TOO_LARGE;
|
|
var object2;
|
|
var POSTCOMPRESSION_INDIVIDUAL_FILE_TOO_LARGE;
|
|
var ENTITY_EMPTY;
|
|
var value22;
|
|
var value23;
|
|
var error;
|
|
var _handleException;
|
|
var _fileSize;
|
|
var getMaxTotalAttachmentSize;
|
|
var POSTCOMPRESSION_SUM_TOO_LARGE;
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
value = undefined;
|
|
let binding = env2_0;
|
|
const value4 = binding(env2_2[11]);
|
|
const getUploadTarget = value4.getUploadTarget;
|
|
const files = this.files;
|
|
const value5 = 0;
|
|
let property = files[value5];
|
|
const value6 = Reflect.apply(getUploadTarget, value4,
|
|
[property == null || property.item == null ? value : property.item.target]);
|
|
const length = this.files.length;
|
|
const getMaxAttachmentsCount = value6.getMaxAttachmentsCount;
|
|
if (length > Reflect.apply(getMaxAttachmentsCount, value6, [])) {
|
|
binding = env2_11;
|
|
binding.log('Too many attachments for ' + this.id);
|
|
this._handleError({code: env2_9.TOO_MANY_ATTACHMENTS});
|
|
return false;
|
|
}
|
|
const kestrelConfig = env2_0(env2_2[12]).getKestrelConfig({location: 'UploaderBase.compressAndCheckFileSize'});
|
|
binding = env2_11;
|
|
let log = binding.log;
|
|
let id = this.id;
|
|
let HermesInternal = global.HermesInternal;
|
|
Reflect.apply(log, binding, ['compressing files for ' + id]);
|
|
const value9 = env2_12(this.files);
|
|
const value10 = value9();
|
|
let done = value10.done;
|
|
if (done) {
|
|
value = this._fileSize();
|
|
value = value > value6.getMaxTotalAttachmentSize();
|
|
if (value) {
|
|
this._handleError({code: env2_9.ENTITY_TOO_LARGE, reason: {type: env2_10.POSTCOMPRESSION_SUM_TOO_LARGE}});
|
|
r1 = 1;
|
|
} else {
|
|
r1 = value;
|
|
}
|
|
return !r1;
|
|
}
|
|
let r13 = value10;
|
|
let value11 = r13.value;
|
|
reducibleLoop7: while (true) {
|
|
try {
|
|
reactNativeCompressAndExtractData = value11.reactNativeCompressAndExtractData;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
value12 = Reflect.apply(reactNativeCompressAndExtractData, value11, []);
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
yield value12;
|
|
try {
|
|
value13 = undefined;
|
|
value14 = false;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
if (value14) {
|
|
return value13;
|
|
}
|
|
try {
|
|
isCancelled = value11.isCancelled;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
isCancelled2 = Reflect.apply(isCancelled, value11, []);
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
if (isCancelled2) {
|
|
try {
|
|
binding = env2_11;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
log = binding.log;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
id = value11.id;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
HermesInternal = global.HermesInternal;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
concat = HermesInternal.concat;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
value22 = 'compressAndCheckFileSize() file has been cancelled for compression - ' + id;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
Reflect.apply(log, binding, [value22]);
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
} else {
|
|
try {
|
|
currentSize = value11.currentSize;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
value15 = currentSize != null;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
reducibleJoin23: while (true) {
|
|
if (value15) {
|
|
r5 = currentSize;
|
|
break reducibleJoin23;
|
|
}
|
|
r5 = value5;
|
|
break reducibleJoin23;
|
|
}
|
|
try {
|
|
value16 = value5 === r5;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
if (value16) {
|
|
try {
|
|
_handleError = this._handleError;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
object = {};
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
binding = env2_9;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
ENTITY_EMPTY = binding.ENTITY_EMPTY;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
object.code = ENTITY_EMPTY;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
Reflect.apply(_handleError, this, [object]);
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
return false;
|
|
}
|
|
try {
|
|
binding = env2_0;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
binding2 = env2_2;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
property = binding2[12];
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
value17 = binding(property);
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
getEffectiveKestrelLimit = value17.getEffectiveKestrelLimit;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
getMaxFileSize = value6.getMaxFileSize;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
channelId = value11.channelId;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
value18 = Reflect.apply(getMaxFileSize, value6, [channelId]);
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
value19 = Reflect.apply(getEffectiveKestrelLimit, value17, [kestrelConfig, value18]);
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
currentSize = value11.currentSize;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
value20 = currentSize != null;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
reducibleJoin40: while (true) {
|
|
if (value20) {
|
|
r19 = currentSize;
|
|
break reducibleJoin40;
|
|
}
|
|
r19 = value5;
|
|
break reducibleJoin40;
|
|
}
|
|
try {
|
|
value21 = r19 > value19;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
reducibleJoin69: while (true) {
|
|
if (value21) {
|
|
try {
|
|
_handleError = this._handleError;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
object = {};
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
binding = env2_9;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
ENTITY_TOO_LARGE = binding.ENTITY_TOO_LARGE;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
object.code = ENTITY_TOO_LARGE;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
object2 = {};
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
binding = env2_10;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
POSTCOMPRESSION_INDIVIDUAL_FILE_TOO_LARGE = binding.POSTCOMPRESSION_INDIVIDUAL_FILE_TOO_LARGE;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
object2.type = POSTCOMPRESSION_INDIVIDUAL_FILE_TOO_LARGE;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
object.reason = object2;
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
try {
|
|
Reflect.apply(_handleError, this, [object]);
|
|
} catch (error) {
|
|
_handleException = this._handleException;
|
|
Reflect.apply(_handleException, this, [error]);
|
|
return false;
|
|
}
|
|
return false;
|
|
}
|
|
break reducibleJoin69;
|
|
}
|
|
}
|
|
value23 = value9();
|
|
done = value23.done;
|
|
if (done) {
|
|
_fileSize = this._fileSize;
|
|
value = Reflect.apply(_fileSize, this, []);
|
|
getMaxTotalAttachmentSize = value6.getMaxTotalAttachmentSize;
|
|
value = value > Reflect.apply(getMaxTotalAttachmentSize, value6, []);
|
|
reducibleJoin74: while (true) {
|
|
if (value) {
|
|
_handleError = this._handleError;
|
|
ENTITY_TOO_LARGE = env2_9.ENTITY_TOO_LARGE;
|
|
POSTCOMPRESSION_SUM_TOO_LARGE = env2_10.POSTCOMPRESSION_SUM_TOO_LARGE;
|
|
Reflect.apply(_handleError, this, [{code: ENTITY_TOO_LARGE,
|
|
reason: {type: POSTCOMPRESSION_SUM_TOO_LARGE}}]);
|
|
value = 1;
|
|
r1 = value;
|
|
break reducibleJoin74;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin74;
|
|
}
|
|
return !r1;
|
|
}
|
|
r13 = value23;
|
|
value11 = r13.value;
|
|
continue reducibleLoop7;
|
|
}
|
|
}
|
|
|
|
function value_57878() { // fn#57878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:4153, offset: 0x00c3b2ba, size: 30 bytes, params: 1, frame: 13
|
|
return env0_1.apply(this, arguments);
|
|
}
|
|
|
|
function value_57879() { // fn#57879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:4258, offset: 0x016b8932, size: 229 bytes, params: 1, frame: 24
|
|
const value = this.files.some(function(a0) {
|
|
return a0.isImage;
|
|
});
|
|
const value2 = this.files.some(function(a0) {
|
|
return a0.isVideo;
|
|
});
|
|
const value3 = this._fileSize();
|
|
const binding = env1_11;
|
|
const log = binding.log;
|
|
const length = this.files.length;
|
|
Reflect.apply(log, binding,
|
|
['setUploadingTextForUI - total content: ' + value3 + ' bytes and ' + length + ' attachments for ' + this.id]);
|
|
const object = {};
|
|
copyDataProperties(object, this._file, length);
|
|
object['totalPostCompressionSize'] = value3;
|
|
object['currentSize'] = value3;
|
|
object['hasVideo'] = value2;
|
|
object['hasImage'] = value;
|
|
object['attachmentsCount'] = this.files.length;
|
|
object['items'] = this.files;
|
|
this._file = object;
|
|
}
|
|
|
|
function value_57883() { // fn#57883, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:4817, offset: 0x016b8a65, size: 54 bytes, params: 1, frame: 15
|
|
const value = this._fileSize();
|
|
const object = {};
|
|
object.loaded = this.files.reduce(function(a0, {loaded}) {
|
|
return a0 + (loaded ?? 0);
|
|
}, 0);
|
|
object.total = value;
|
|
return object;
|
|
}
|
|
|
|
function value_57885() { // fn#57885, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:4985, offset: 0x016b8abb, size: 34 bytes, params: 1, frame: 12
|
|
this.files.forEach(_fun57886);
|
|
return {};
|
|
function _fun57886({id, loaded, currentSize}) { // fn#57886, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:5032, offset: 0x016b8add, size: 70 bytes, params: 2, frame: 16
|
|
const binding = env0_0;
|
|
let value = environment.__proto__.__proto__;
|
|
value = require(4658) /* metro dependency 4658: UploadUtils */;
|
|
binding[id] = value.calculateProgress(loaded, currentSize);
|
|
}
|
|
|
|
}
|
|
|
|
function value_57887(a0, a1, a2) { // fn#57887, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:5140, offset: 0x016b8b23, size: 102 bytes, params: 4, frame: 19
|
|
const object = {};
|
|
copyDataProperties(object, a0, undefined);
|
|
let value = environment.__proto__;
|
|
value = importDefault(22) /* metro dependency 22 */;
|
|
const value2 = value.get(object, a1, []);
|
|
const items2 = [];
|
|
arraySpread(items2, a2, arraySpread(items2, value2, 0, value), value);
|
|
return (importDefault(22) /* metro dependency 22 */).set(object, a1, items2);
|
|
}
|
|
|
|
function value_57889() { // fn#57889, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:5450, offset: 0x016b8bb7, size: 126 bytes, params: 1, frame: 14
|
|
var _cancel;
|
|
const binding = env1_11;
|
|
binding.log('cancel() for ' + this.id);
|
|
if (!this._aborted) {
|
|
this._aborted = true;
|
|
_cancel = this._cancel;
|
|
if (_cancel != null) {
|
|
_cancel.call(this);
|
|
}
|
|
this.files.forEach(function(a0) {
|
|
return a0.cancel();
|
|
});
|
|
this._handleComplete();
|
|
}
|
|
}
|
|
|
|
function* _fun57892(a0) { // fn#57892, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:5662, offset: 0x016b8c4d, size: 360 bytes, params: 2, frame: 21
|
|
var environment;
|
|
if (true) {
|
|
var env0_0 = a0;
|
|
value = environment.__proto__.__proto__;
|
|
var binding = env2_11;
|
|
binding.log('Cancel called for ' + this.id + ' for item ' + a0);
|
|
var files = this.files;
|
|
var value3 = files.find(_fun57893);
|
|
if (value3 != null) {
|
|
if (value3.isCancelled()) {
|
|
return undefined;
|
|
}
|
|
files = this.files;
|
|
var value4 = files.indexOf(value3);
|
|
files = this.files;
|
|
var slice = files.slice;
|
|
var value5 = Reflect.apply(slice, files, [0, value4]);
|
|
var object = [];
|
|
var value6 = arraySpread(object, value5, 0, value4);
|
|
files = this.files;
|
|
slice = files.slice;
|
|
arraySpread(object, Reflect.apply(slice, files, [value4 + 1]), value6, value4);
|
|
this.files = object;
|
|
object = {};
|
|
var _file = this._file;
|
|
copyDataProperties(object, _file, value6);
|
|
files = this.files;
|
|
object['items'] = files;
|
|
this._file = object;
|
|
value = env2_0(env2_2[13]);
|
|
yield value.cancelGetAttachmentFile(value3);
|
|
value = undefined;
|
|
if (false) {
|
|
return value;
|
|
}
|
|
value3.cancel();
|
|
var emit = this.emit;
|
|
_file = this._file;
|
|
Reflect.apply(emit, this, ['cancel-upload-item', _file]);
|
|
files = this.files;
|
|
if (files.length === 0) {
|
|
this.cancel();
|
|
}
|
|
}
|
|
}
|
|
function _fun57893({id}) { // fn#57893, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:5750, offset: 0x00db0c48, size: 21 bytes, params: 2, frame: 2
|
|
return id === env0_0;
|
|
}
|
|
|
|
}
|
|
|
|
function value_57894() { // fn#57894, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:6067, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
|
|
return env0_0.apply(this, arguments);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function _fun57875(a0, {currentSize}) { // fn#57875, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:2899, offset: 0x016b8602, size: 32 bytes, params: 3, frame: 3
|
|
return a0 + (currentSize ?? 0);
|
|
}
|
|
|
|
function _fun57884(a0, {loaded}) { // fn#57884, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7405:4884, offset: 0x016b8a9b, size: 32 bytes, params: 3, frame: 3
|
|
return a0 + (loaded ?? 0);
|
|
}
|
|
|
|
global.__d(_fun57858, 7227, [5, 6, 7, 15, 17, 18, 661, 4503, 3, 4658, 22, 4692, 4697, 4659, 639,
|
|
2]) /* metro module 7227, dependencies: [5, 6, 7, 15, 17, 18, 661, 4503, 3, 4658, 22, 4692, 4697, 4659, 639, 2] */;
|