decord/source/modules/polls/PollUploadAttachmentActionCreators.native.tsx

289 lines
8.9 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 11430
// Function ID: 11431
2026-07-20 16:05:17 +00:00
// Name: _handlePollGifAttachmentAdd
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 4830, 7614, 11431, 8986, 4843, 4834, 8505, 2]
2026-07-20 16:05:17 +00:00
// Exports: handlePollGifAttachmentAdd, handlePollMediaAttachmentAdd, removeAllPollUploadAttachments, removePollUploadAttachment
2026-08-24 06:08:38 +00:00
// Module 11430 (_handlePollGifAttachmentAdd)
import closure_3 from "asyncGeneratorStep" /* 5 */;
import { DraftType } from "handleChanged" /* 4830 */;
import { POLL_ATTACHMENT_FOLDER } from "POLL_ATTACHMENT_FOLDER" /* 7614 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function _handlePollGifAttachmentAdd() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0, arg1, arg2) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
closure_2 = arg2;
c7 = 0;
c8 = 0;
c6 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0, arg1, arg2) {
if (c8 === 2) {
c8 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp7 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c8 = 2;
if (0 === obj7) {
if (arg0 === 1) {
c8 = 3;
throw arg1;
} else if (arg0 === 2) {
c8 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let Poll = tmp3;
2026-08-24 06:08:38 +00:00
closure_3 = tmp5;
dependencyMap = undefined;
closure_3 = undefined;
2026-07-29 08:29:29 +00:00
Poll = undefined;
2026-08-24 06:08:38 +00:00
closure_5 = undefined;
2026-07-29 08:29:29 +00:00
let styles;
obj7 = undefined;
2026-08-24 06:08:38 +00:00
dependencyMap = callback(11431).getFileNameFromGifUrl(callback2, dependencyMap);
2026-07-29 08:29:29 +00:00
styles = 1;
2026-08-24 06:08:38 +00:00
const obj16 = callback(11431);
2026-07-29 08:29:29 +00:00
obj7 = 2;
c8 = 1;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: false };
obj1[0] = callback(11431).downloadPollGif(dependencyMap);
2026-07-29 08:29:29 +00:00
return obj1;
}
} else if (1 === tmp8) {
styles = 0;
c8 = 3;
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
} else if (2 === tmp8) {
if (arg0 === 1) {
c8 = 3;
throw arg1;
} else if (arg0 === 2) {
styles = 0;
c8 = 3;
const obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
} else {
2026-08-24 06:08:38 +00:00
closure_3 = arg1;
if (null == closure_3) {
2026-07-29 08:29:29 +00:00
styles = 0;
c8 = 3;
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
obj7 = callback(11431);
2026-07-29 08:29:29 +00:00
Poll = obj7.getFilePathForGif(dependencyMap);
2026-08-24 06:08:38 +00:00
let obj8 = callback(8986);
2026-07-29 08:29:29 +00:00
obj7 = 3;
c8 = 1;
const obj3 = { value: null, done: false };
2026-08-24 06:08:38 +00:00
obj3[0] = obj8.writeFile("cache", Poll, closure_3, "base64");
2026-07-29 08:29:29 +00:00
return obj3;
}
}
} else if (3 === tmp8) {
if (arg0 === 1) {
c8 = 3;
throw arg1;
} else if (arg0 === 2) {
styles = 0;
c8 = 3;
let obj4 = { value: null, done: true };
obj4[0] = arg1;
return obj4;
} else {
closure_5 = arg1;
if (null == closure_5) {
styles = 0;
c8 = 3;
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
obj4 = callback(4843);
2026-07-29 08:29:29 +00:00
obj7 = 4;
c8 = 1;
const obj5 = { value: null, done: false };
obj5[0] = obj4.getImageDimensionsIfMissing(closure_5);
return obj5;
}
}
} else if (arg0 === 1) {
c8 = 3;
throw arg1;
} else if (arg0 === 2) {
styles = 0;
c8 = 3;
const obj6 = { value: null, done: true };
obj6[0] = arg1;
return obj6;
} else {
styles = arg1;
obj7 = { id: null, origin: null, uri: null, originalUri: null, filename: null, mimeType: "image/gif", width: null, height: null, platform: null };
obj7[0] = callback2;
2026-08-24 06:08:38 +00:00
obj7[1] = callback(4834).UploadOrigin.IMAGE_PICKER;
2026-07-29 08:29:29 +00:00
obj7[2] = closure_5;
obj7[3] = closure_5;
obj7[4] = dependencyMap;
let width;
if (styles != null) {
width = styles.width;
}
obj7[6] = width;
let height;
if (styles != null) {
height = styles.height;
}
obj7[7] = height;
2026-08-24 06:08:38 +00:00
obj7[8] = callback(4834).UploadPlatform.REACT_NATIVE;
obj = callback2(8505);
2026-07-29 08:29:29 +00:00
obj8 = { file: null, channelId: null, draftType: null };
obj8[0] = obj7;
obj8[1] = callback;
obj8[2] = Poll.Poll;
obj.addFile(obj8);
styles = 0;
c8 = 3;
const obj9 = { value: null, done: true };
obj9[0] = closure_5;
return obj9;
}
} catch (tmp40) {
closure_5 = tmp40;
if (tmp4 === styles) {
c8 = tmp2;
throw tmp40;
} else {
obj7 = tmp;
}
}
}
})();
});
2026-08-24 06:08:38 +00:00
closure_6 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _removePollUploadAttachment() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0, arg1, arg2) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1 = arg1;
closure_2 = arg2;
c4 = 0;
c3 = 0;
c6 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0, arg1, arg2) {
2026-08-24 06:08:38 +00:00
c6 = 1;
callback2(8505).remove(callback, callback2, Poll.Poll);
const obj5 = callback2(8505);
const obj6 = callback(8986);
yield obj6.removeFile("cache", callback(11431).getFilePathForGif(dependencyMap));
2026-08-04 21:03:28 +00:00
if (1 === tmp6) {
c6 = 0;
2026-08-24 06:08:38 +00:00
c3 = 3;
2026-08-04 21:03:28 +00:00
} else if (arg0 === 1) {
2026-07-29 08:29:29 +00:00
c3 = 3;
2026-08-04 21:03:28 +00:00
throw arg1;
} else if (arg0 !== 2) {
c6 = 0;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
c6 = 0;
return arg1;
2026-07-29 08:29:29 +00:00
})();
});
2026-08-24 06:08:38 +00:00
closure_7 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _removeAllPollUploadAttachments() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c2 = 0;
c1 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0) {
2026-08-04 21:03:28 +00:00
let Poll = 1;
2026-08-24 06:08:38 +00:00
obj1 = v0(8505);
2026-08-04 21:03:28 +00:00
obj1.clearAll(callback, Poll.Poll);
2026-08-24 06:08:38 +00:00
yield callback(8986).clearFolder("cache", closure_1_5);
2026-08-04 21:03:28 +00:00
if (1 === tmp6) {
Poll = 0;
2026-07-29 08:29:29 +00:00
v0 = 3;
2026-08-04 21:03:28 +00:00
} else if (arg0 === 1) {
v0 = 3;
throw arg1;
} else if (arg0 !== 2) {
Poll = 0;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
Poll = 0;
return arg1;
2026-07-29 08:29:29 +00:00
})();
});
2026-08-24 06:08:38 +00:00
closure_8 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/polls/PollUploadAttachmentActionCreators.native.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export const handlePollGifAttachmentAdd = function handlePollGifAttachmentAdd(closure_0, localCreationAnswerId, closure_2) {
const self = this;
const apply = _handlePollGifAttachmentAdd.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};
export function handlePollMediaAttachmentAdd(arg0, localCreationAnswerId, arg2) {
}
export const removePollUploadAttachment = function removePollUploadAttachment(arg0, localCreationAnswerId, fileNameFromGifUrl) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _removePollUploadAttachment.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const removeAllPollUploadAttachments = function removeAllPollUploadAttachments(closure_4) {
const self = this;
const apply = _removeAllPollUploadAttachments.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};