decord/source/modules/oauth2/native/WebhookGuildChannelSelector.tsx
github-actions cd74c1f217 chore: update source for alpha 345.5
Skipped 1 file(s) >100MB (GitHub limit): source/__vendor/09xxx/9667_m.js (378 MB)
2026-09-05 10:56:28 +00:00

234 lines
8.5 KiB
TypeScript

// Module ID: 9427
// Function ID: 9428
// Name: styles
// Dependencies: [5, 32, 19, 17, 1961, 4209, 1371, 21, 4560, 576, 4527, 9426, 1896, 1114, 4713, 9244, 4556, 1178, 8593, 2]
// Exports: default
// Module 9427 (styles)
import ThemesDefault from "Themes" /* 576 */;
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "_slicedToArray" /* 32 */;
import closure_5 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
import { createChannelRecord } from "createChannelRecord" /* 1961 */;
import closure_8 from "markAllUserIdListsStale" /* 4209 */;
import closure_9 from "mergeGuildAvatar" /* 1371 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4560 */;
const require = arg1;
({ jsx: c10, jsxs: unpackModuleId } = jsxProd);
createCacheKey = { selectorGroup: { flexDirection: "column", gap: 8 }, select: null, label: null, error: null };
createCacheKey = { backgroundColor: ThemesDefault.colors.BACKGROUND_BASE_LOWER, borderRadius: ThemesDefault.radii.xs };
createCacheKey[1] = createCacheKey;
createCacheKey[2] = { color: ThemesDefault.colors.TEXT_SUBTLE, fontWeight: "500" };
let obj1 = { color: ThemesDefault.colors.TEXT_SUBTLE, fontWeight: "500" };
createCacheKey[3] = { color: ThemesDefault.unsafe_rawColors.RED_400 };
createCacheKey = createCacheKey.createStyles(createCacheKey);
const WebhookGuildChannelSelector = "WebhookGuildChannelSelector";
let obj2 = { color: ThemesDefault.unsafe_rawColors.RED_400 };
const result = require("set").fileFinishedImporting("modules/oauth2/native/WebhookGuildChannelSelector.tsx");
export default function WebhookGuildChannelSelector(selectedGuildId) {
selectedGuildId = selectedGuildId.selectedGuildId;
const selectedChannelId = selectedGuildId.selectedChannelId;
const onChannelChange = selectedGuildId.onChannelChange;
error = selectedGuildId.error;
let first;
let callback;
let React;
let tmp = createCacheKey();
let tmp2 = callback(React.useState(null), 2);
first = tmp2[0];
callback = tmp2[1];
React = React.useRef(false);
const items = [first, onChannelChange, selectedChannelId, selectedGuildId];
const items1 = [onChannelChange, selectedGuildId];
callback = React.useCallback(() => {
let tmp2 = null != first;
if (tmp2) {
tmp2 = tmp.guildId === selectedGuildId;
}
if (tmp2) {
let obj = selectedChannelId(onChannelChange[10]);
obj = { title: null, items: null, onItemSelect: null, selectedItem: null, hasIcons: false };
const intl = selectedGuildId(onChannelChange[13]).intl;
obj[0] = intl.string(selectedGuildId(onChannelChange[13]).t["Re/64R"]);
const channels = tmp.channels;
obj[1] = channels.map((id) => {
const obj = { label: callback(4713).computeChannelName(callback2(id), closure_9, closure_8), value: id.id };
return obj;
});
obj[2] = function onItemSelect(arg0) {
dependencyMap(arg0);
closure_1_1(closure_1_2[10]).hideActionSheet(closure_1_13);
};
obj[3] = selectedChannelId;
obj.openLazy(selectedGuildId(onChannelChange[12])(onChannelChange[11], onChannelChange.paths), closure_1_13, obj);
const tmp7 = selectedGuildId(onChannelChange[12])(onChannelChange[11], onChannelChange.paths);
const tmp8 = closure_1_13;
const tmp9 = selectedChannelId;
}
}, items);
const effect = React.useEffect(() => {
function _updateChannels() {
const self = this;
const tmp = first((arg0) => {
closure_0 = arg0;
c3 = 0;
c4 = 0;
return (function*(arg0) {
if (v0 === 2) {
v0 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
v0 = 2;
if (0 === c3) {
if (arg0 === 1) {
v0 = 3;
throw arg1;
} else if (arg0 === 2) {
v0 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
closure_2 = tmp5;
closure_1 = tmp2;
closure_1 = undefined;
let obj2 = callback(closure_2_2[15]);
c3 = 1;
v0 = 1;
obj1 = { value: null, done: false };
obj1[0] = obj2.fetchChannels(callback);
return obj1;
}
} else if (arg0 === 1) {
v0 = 3;
throw arg1;
} else if (arg0 === 2) {
v0 = 3;
obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
} else {
closure_1 = arg1;
if (callback === callback) {
const sorted = closure_1.sort(() => { ... });
obj = { guildId: null, channels: null };
obj[0] = callback;
obj[1] = closure_1;
v0(obj);
closure_1_5.current = true;
}
v0 = 3;
return { value: "HermesInternal", done: null };
}
} catch (tmp20) {
v0 = tmp;
throw tmp20;
}
}
})();
});
closure_0 = tmp;
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
}
callback(null);
if (null == _updateChannels) {
onChannelChange(null);
} else {
(function updateChannels(arg0) {
const self = this;
const apply = _updateChannels.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
})(tmp2);
}
}, items1);
const items2 = [first, onChannelChange, selectedChannelId, selectedGuildId];
const effect1 = React.useEffect(() => {
if (ref.current) {
if (null == first) {
if (null != selectedChannelId) {
onChannelChange(null);
}
} else {
const channels = tmp.channels;
if (!channels.some((id) => id.id === closure_1)) {
onChannelChange(null);
}
}
}
}, items2);
if (null == selectedGuildId) {
return null;
} else {
let found;
if (first != null) {
let channels = first.channels;
found = channels.find((id) => id.id === selectedChannelId);
}
let obj = { style: null, children: null };
obj[0] = tmp.selectorGroup;
obj = { variant: "eyebrow", color: "text-default", children: null };
let intl = selectedGuildId(onChannelChange[13]).intl;
obj[2] = intl.string(selectedGuildId(onChannelChange[13]).t["8qKd+J"]);
const items3 = [callback2(selectedGuildId(onChannelChange[16]).Text, obj), , , ];
let tmp10Result = null;
if (null != error) {
tmp10Result = null;
if ("" !== error) {
obj = { style: null, children: null };
obj[0] = tmp.error;
obj[1] = error;
tmp10Result = tmp10(tmp11(tmp12[17]).LegacyText, obj);
}
}
items3[1] = tmp10Result;
let name;
if (found != null) {
name = found.name;
}
if (name == null) {
const intl2 = tmp11(tmp12[13]).intl;
name = intl2.string(tmp11(tmp12[13]).t["Re/64R"]);
}
obj1 = { label: null, disabled: null, trailing: null, DEPRECATED_style: null, onPress: null };
obj1[0] = name;
obj1[1] = null == selectedGuildId;
obj1[2] = callback2(selectedGuildId(onChannelChange[18]).FormRow.Arrow, {});
obj1[3] = tmp.select;
obj1[4] = callback;
items3[2] = callback2(selectedGuildId(onChannelChange[18]).FormRow, obj1);
let obj2 = { style: null, children: null };
obj2[0] = tmp.label;
const intl3 = tmp11(tmp12[13]).intl;
obj2[1] = intl3.string(selectedGuildId(onChannelChange[13]).t.kQXMfN);
items3[3] = callback2(selectedGuildId(onChannelChange[17]).LegacyText, obj2);
obj[1] = items3;
return closure_11(View, obj);
}
};
export const useStyles = createCacheKey;