decord/source/modules/media_channel/MediaChannelActionCreators.tsx

180 lines
5.3 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 11094
// Function ID: 11095
2026-07-20 16:05:17 +00:00
// Name: _fetchMediaPostEmbed
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 676, 709, 530, 4277, 2]
2026-07-20 16:05:17 +00:00
// Exports: dismissMediaPostSharePrompt, fetchMediaPostEmbed, unfurlEmbedUrl
2026-08-24 06:08:38 +00:00
// Module 11094 (_fetchMediaPostEmbed)
import dispatcherDefault from "dispatcher" /* 709 */;
import closure_3 from "asyncGeneratorStep" /* 5 */;
import { Endpoints } from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function _fetchMediaPostEmbed() {
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;
c5 = 0;
c6 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0, body) {
2026-08-24 06:08:38 +00:00
dependencyMap = tmp3;
obj1 = { type: "MEDIA_POST_EMBED_FETCH", threadId: null };
2026-08-04 21:03:28 +00:00
obj1[1] = callback;
2026-08-24 06:08:38 +00:00
closure_1_1(closure_1_2[2]).dispatch(obj1);
c4 = 1;
const HTTP = callback(closure_1_2[3]).HTTP;
2026-08-04 21:03:28 +00:00
const obj2 = { url: null, rejectWithError: true };
obj2[0] = c4.MEDIA_POST_RESHARE_GET_PREVIEW(callback);
yield HTTP.get(obj2);
if (1 === tmp7) {
c4 = 0;
const obj3 = body(709);
const obj4 = { type: "MEDIA_POST_EMBED_FETCH_FAILURE", threadId: null };
obj4[1] = callback;
obj3.dispatch(obj4);
2026-08-24 06:08:38 +00:00
c6 = 3;
2026-08-04 21:03:28 +00:00
} else if (arg0 === 1) {
2026-07-29 08:29:29 +00:00
c6 = 3;
2026-08-04 21:03:28 +00:00
throw body;
} else if (arg0 !== 2) {
body = body.body;
const obj = body(709);
const obj5 = { type: "MEDIA_POST_EMBED_FETCH_SUCCESS", threadId: null, mediaPostEmbed: null };
obj5[1] = callback;
obj5[2] = body;
obj.dispatch(obj5);
c4 = 0;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
c4 = 0;
return body;
2026-07-29 08:29:29 +00:00
})();
});
2026-08-24 06:08:38 +00:00
closure_5 = 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 _unfurlEmbedUrl() {
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;
c5 = 0;
c6 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0, body) {
if (c6 === 2) {
c6 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp6 === 3) {
if (arg0 === 1) {
throw body;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = body;
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 {
c6 = 2;
if (0 === c5) {
if (arg0 === 1) {
c6 = 3;
throw body;
} else if (arg0 === 2) {
c6 = 3;
obj = { value: null, done: true };
obj[0] = body;
return obj;
} else {
const table = tmp3;
2026-08-24 06:08:38 +00:00
closure_1 = tmp7;
2026-07-29 08:29:29 +00:00
let constants = 1;
2026-08-24 06:08:38 +00:00
const HTTP = callback(closure_1_2[3]).HTTP;
obj1 = { url: null, body: null, rejectWithError: false };
2026-07-29 08:29:29 +00:00
obj1[0] = constants.UNFURL_EMBED_URLS;
const obj2 = { urls: null };
obj2[0] = callback;
obj1[1] = obj2;
c5 = 2;
c6 = 1;
const obj3 = { value: null, done: false };
obj3[0] = HTTP.post(obj1);
return obj3;
}
} else if (1 === tmp7) {
constants = 0;
2026-08-24 06:08:38 +00:00
callback = closure_3;
2026-07-29 08:29:29 +00:00
const aPIError = new callback(table[4]).APIError(callback);
throw aPIError;
} else if (arg0 === 1) {
c6 = 3;
throw body;
} else if (arg0 === 2) {
constants = 0;
c6 = 3;
const obj4 = { value: null, done: true };
obj4[0] = body;
return obj4;
} else {
constants = 0;
c6 = 3;
obj = { value: null, done: true };
obj[0] = body.body;
return obj;
}
2026-08-24 06:08:38 +00:00
} catch (tmp23) {
closure_3 = tmp23;
2026-07-29 08:29:29 +00:00
if (tmp4 === constants) {
c6 = tmp2;
2026-08-24 06:08:38 +00:00
throw tmp23;
2026-07-29 08:29:29 +00:00
} else {
c5 = 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
}
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/media_channel/MediaChannelActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export const dismissMediaPostSharePrompt = function dismissMediaPostSharePrompt(threadId) {
2026-08-24 06:08:38 +00:00
let obj = dispatcherDefault;
2026-07-20 16:05:17 +00:00
obj = { type: "DISMISS_MEDIA_POST_SHARE_PROMPT", threadId };
obj.dispatch(obj);
};
export const fetchMediaPostEmbed = function fetchMediaPostEmbed(threadId) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _fetchMediaPostEmbed.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 const unfurlEmbedUrl = function unfurlEmbedUrl(items) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _unfurlEmbedUrl.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
};