93 lines
5.0 KiB
TypeScript
93 lines
5.0 KiB
TypeScript
/* Metro module 4691; source: lib/uploader/native/CloudUploaderUtils.tsx; dependencies: [1949, 1226, 691, 4651, 22, 683, 2] */
|
|
import AnalyticsUtils from '../../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */
|
|
import DeveloperOptionsStore from '../../../stores/DeveloperOptionsStore.tsx'; /* Metro dependency 691 */
|
|
import AuthenticationStore from '../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
|
|
import LocaleStore from '../../../modules/user_settings/LocaleStore.tsx'; /* Metro dependency 1949 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
|
|
function _fun40565(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#40565, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4869:6, offset: 0x011050d7, size: 183 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const getUploadPayload2 = getUploadPayload;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
object = {getUploadPayload: getUploadPayload2};
|
|
(FileImportTrackerModule).fileFinishedImporting('lib/uploader/native/CloudUploaderUtils.tsx');
|
|
exports.default = object;
|
|
exports.prepareMessagePayload = prepareMessagePayload;
|
|
exports.getUploadPayload = getUploadPayload2;
|
|
function _prepareMessageRequestBodyCloud(a0, a1, a2) { // fn#40566, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4869:126, offset: 0x0110518e, size: 166 bytes, params: 4, frame: 21
|
|
var r0;
|
|
var object;
|
|
var object2;
|
|
var value;
|
|
var value2;
|
|
var items2;
|
|
const items3 = [];
|
|
a0.forEach(_fun40567);
|
|
if (a2 == null) {
|
|
object = {};
|
|
copyDataProperties(object, a1, undefined);
|
|
object['attachments'] = items3;
|
|
r0 = object;
|
|
} else if (a1 != null) {
|
|
object2 = {};
|
|
copyDataProperties(object2, a1, undefined);
|
|
value = importDefault(22) /* metro dependency 22 */;
|
|
value2 = value.get(object2, a2, []);
|
|
items2 = [];
|
|
arraySpread(items2, items3, arraySpread(items2, value2, 0, value), value);
|
|
value = importDefault(22) /* metro dependency 22 */;
|
|
value = value.set(object2, a2, items2);
|
|
r0 = value;
|
|
} else {
|
|
object = {};
|
|
copyDataProperties(object, a1, undefined);
|
|
object['attachments'] = items3;
|
|
r0 = object;
|
|
}
|
|
return r0;
|
|
function _fun40567(a0, a1) { // fn#40567, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4869:201, offset: 0x01105234, size: 71 bytes, params: 3, frame: 14
|
|
let value = environment.__proto__;
|
|
value = require(4651) /* metro dependency 4651: UploadUtils */;
|
|
const attachmentPayload = value.getAttachmentPayload(a0, a1);
|
|
const binding = env0_0;
|
|
const push = binding.push;
|
|
const object = {};
|
|
copyDataProperties(object, attachmentPayload, value);
|
|
Reflect.apply(push, binding, [object]);
|
|
}
|
|
|
|
}
|
|
|
|
function getUploadPayload({filename, currentSize}) { // fn#40568, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4869:425, offset: 0x0110527b, size: 73 bytes, params: 2, frame: 12
|
|
const object = {};
|
|
object.filename = filename;
|
|
object.file_size = currentSize;
|
|
object.id = (importDefault(22) /* metro dependency 22 */).uniqueId();
|
|
object.original_content_type = undefined;
|
|
return object;
|
|
}
|
|
|
|
function prepareMessagePayload(a0, a1, a2, a3) { // fn#40569, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4869:711, offset: 0x011052c4, size: 152 bytes, params: 5, frame: 18
|
|
const value2 = _prepareMessageRequestBodyCloud(a1, a2, a3);
|
|
const object2 = {Authorization: a0};
|
|
const developerOptionsStoreBinding = DeveloperOptionsStore;
|
|
const getDebugOptionsHeaderValue = developerOptionsStoreBinding.getDebugOptionsHeaderValue;
|
|
object2['X-Debug-Options'] = Reflect.apply(getDebugOptionsHeaderValue, developerOptionsStoreBinding, []);
|
|
object2['Accept-Language'] = LocaleStore.locale;
|
|
const superPropertiesBase64 = (AnalyticsUtils).getSuperPropertiesBase64();
|
|
if (superPropertiesBase64 != null) {
|
|
object2['X-Super-Properties'] = superPropertiesBase64;
|
|
}
|
|
const fingerprint = AuthenticationStore.getFingerprint();
|
|
if (fingerprint != null) {
|
|
object2['X-Fingerprint'] = fingerprint;
|
|
}
|
|
return {headers: object2, body: value2};
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun40565, 4691, [1949, 1226, 691, 4651, 22, 683,
|
|
2]) /* metro module 4691, dependencies: [1949, 1226, 691, 4651, 22, 683, 2] */;
|