Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
135 lines
4.9 KiB
TypeScript
135 lines
4.9 KiB
TypeScript
// Module ID: 14174
|
|
// Function ID: 14175
|
|
// Name: ShareUtils
|
|
// Dependencies: [5, 5107, 4751, 4458, 10424, 9419, 8024, 5346, 5345, 7923, 9405, 7703, 2]
|
|
// Exports: sendShareMessage, showInformationToast
|
|
|
|
// Module 14174 (ShareUtils)
|
|
import ToastActionCreatorsDefault from "ToastActionCreators" /* 4458 */;
|
|
import _modDef10424 from "module_10424" /* 10424 */;
|
|
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
|
|
|
|
const require = fn;
|
|
let closure_6 = async function _sendShareMessage(arg0, value) {
|
|
if (c5 === 2) {
|
|
c5 = 3;
|
|
throw new TypeError("Generator functions may not be called on executing generators");
|
|
} else if (tmp3 === 3) {
|
|
if (arg0 === 1) {
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
let obj2 = { value, done: true };
|
|
return obj2;
|
|
} else {
|
|
return { value: "IconComponent", done: null };
|
|
}
|
|
} else {
|
|
try {
|
|
c5 = 2;
|
|
if (0 === c4) {
|
|
if (arg0 === 1) {
|
|
c5 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c5 = 3;
|
|
const obj5 = { value, done: true };
|
|
return obj5;
|
|
} else {
|
|
const channelId = tmp4;
|
|
c2 = 0;
|
|
closure_130_0 = undefined;
|
|
closure_130_1 = undefined;
|
|
closure_130_2 = undefined;
|
|
({ attachments: closure_130_0, channel: closure_130_1, comment: closure_130_2 } = closure_0);
|
|
let id;
|
|
closure_130_4 = undefined;
|
|
closure_130_5 = undefined;
|
|
closure_130_6 = undefined;
|
|
c4 = 1;
|
|
c5 = 1;
|
|
return { value: "Set", done: true };
|
|
}
|
|
} else if (1 === tmp4) {
|
|
if (arg0 === 1) {
|
|
c5 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c5 = 3;
|
|
const obj6 = { value, done: true };
|
|
return obj6;
|
|
} else {
|
|
id = closure_130_1.id;
|
|
closure_130_4 = closure_130_0.map((uri) => {
|
|
const size = { uri: uri.uri, originalUri: uri.uri, mimeType: uri.mimeType, filename: uri.name, platform: closure_0(5346).UploadPlatform.REACT_NATIVE, width: uri.width, height: uri.height, preTranscodeSourceSize: uri.originalSize };
|
|
const cloudUpload = new closure_0(5345).CloudUpload(size, guildId.id);
|
|
return cloudUpload;
|
|
});
|
|
c1 = closure_130_2;
|
|
if (closure_130_2 == null) {
|
|
c1 = "";
|
|
}
|
|
closure_130_5 = closure_131_1(closure_131_2[9]).parse(closure_130_1, c1);
|
|
if (closure_130_4.length > 0) {
|
|
closure_131_1(closure_131_2[5]).clearAll(id, closure_131_4.ChannelMessage);
|
|
let obj3 = closure_131_1(closure_131_2[5]);
|
|
}
|
|
const future = new closure_131_0(closure_131_2[10]).Future();
|
|
closure_130_6 = future;
|
|
let obj4 = closure_131_1(closure_131_2[11]);
|
|
const obj7 = {
|
|
location: closure_131_5.SHARE_MODAL,
|
|
doNotNotifyOnError: true,
|
|
attachmentsToUpload: closure_130_4,
|
|
onAttachmentUploadError(file, code, reason) {
|
|
const obj = { uploadError: { file, guildId: guildId.getGuildId(), code, reason } };
|
|
closure_1_6.reject(obj);
|
|
const obj2 = { file, guildId: guildId.getGuildId(), code, reason };
|
|
guildId(9419).setUploads({ channelId, uploads, draftType: uploads.ChannelMessage, resetState: true });
|
|
const obj3 = guildId(9419);
|
|
const obj4 = { channelId, uploads, draftType: uploads.ChannelMessage, resetState: true };
|
|
guildId(8024).saveDraft(channelId, dependencyMap, uploads.ChannelMessage);
|
|
}
|
|
};
|
|
c4 = 2;
|
|
c5 = 1;
|
|
const obj8 = { value: obj4.sendMessage(closure_130_1.id, closure_130_5, false, obj7), done: false };
|
|
return obj8;
|
|
}
|
|
} else if (arg0 === 1) {
|
|
c5 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c5 = 3;
|
|
const obj9 = { value, done: true };
|
|
return obj9;
|
|
} else {
|
|
closure_130_6.resolve(undefined);
|
|
c5 = 3;
|
|
let obj = { value: closure_130_6.promise, done: true };
|
|
return obj;
|
|
}
|
|
} catch (tmp36) {
|
|
c5 = tmp;
|
|
throw tmp36;
|
|
}
|
|
}
|
|
};
|
|
const DraftType = fn(5107).DraftType;
|
|
const MessageSendLocation = fn(4751).MessageSendLocation;
|
|
let size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/share/native/ShareUtils.tsx");
|
|
|
|
export const showInformationToast = function showInformationToast(intl3) {
|
|
const obj = ToastActionCreatorsDefault;
|
|
obj.open({ key: "INFORMATION_TOAST-" + intl3, content: intl3, icon: _modDef10424 });
|
|
};
|
|
export const sendShareMessage = function sendShareMessage() {
|
|
const self = this;
|
|
const apply = closure_6.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
};
|