decord/alpha/source/modules/applications/useGuildApplication.tsx

131 lines
3.8 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 18371
// Function ID: 18372
2026-07-20 16:05:17 +00:00
// Name: useGuildApplication
2026-10-09 10:00:15 +00:00
// Dependencies: [5, 32, 19, 5437, 504, 6849, 5632, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-10-09 10:00:15 +00:00
// Module 18371 (useGuildApplication)
2026-10-03 08:58:59 +00:00
import _asyncToGenerator from "_asyncToGenerator" /* 5 */;
import _slicedToArray from "_slicedToArray" /* 32 */;
import react from "react" /* 19 */;
2026-10-09 10:00:15 +00:00
import ApplicationStore from "ApplicationStore" /* 5437 */;
2026-10-03 08:58:59 +00:00
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
const require = globalThis.__r;
2026-10-03 08:58:59 +00:00
let _require, c4, c5, closure_0;
const result = size.fileFinishedImporting("modules/applications/useGuildApplication.tsx");
2026-07-20 16:05:17 +00:00
export default function useGuildApplication(arg0, arg1) {
2026-10-03 08:58:59 +00:00
let application;
let closure_4;
let closure_6;
let error;
let first1;
let tmp3;
_require = arg0;
2026-10-03 08:58:59 +00:00
let closure_1 = arg1;
let obj = require("get initialized");
2026-08-24 06:08:38 +00:00
const items = [closure_6];
2026-10-03 08:58:59 +00:00
application = obj.useStateFromStores(items, () => ApplicationStore.getGuildApplication(closure_0, closure_1));
[tmp3, _asyncToGenerator] = _slicedToArray(first1.useState(null == application), 2);
const tmp2 = _slicedToArray(first1.useState(null == application), 2);
[error, _slicedToArray] = first1.useState();
[first1, closure_6] = first1.useState(false);
2026-07-20 16:05:17 +00:00
const items1 = [application, arg1, arg0];
2026-10-03 08:58:59 +00:00
const callback = first1.useCallback(_asyncToGenerator(async function(arg0, value) {
let closure_2;
let obj2;
2026-07-29 08:29:29 +00:00
if (c5 === 2) {
c5 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
2026-10-03 08:58:59 +00:00
} else if (tmp3 === 3) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
const obj3 = { value, done: true };
return obj3;
2026-07-29 08:29:29 +00:00
} else {
2026-10-05 08:00:40 +00:00
return { value: "IconComponent", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
2026-10-03 08:58:59 +00:00
let c3;
2026-07-29 08:29:29 +00:00
try {
c5 = 2;
if (0 === c4) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
c5 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
c5 = 3;
const obj4 = { value, done: true };
return obj4;
2026-07-29 08:29:29 +00:00
} else {
2026-10-03 08:58:59 +00:00
const type = tmp;
closure_0 = tmp4;
if (null == application) {
if (null != closure_0) {
closure_6(true);
2026-10-03 08:58:59 +00:00
_asyncToGenerator(true);
c3 = 2;
const obj5 = { type, includeTeam: true };
c4 = 3;
2026-07-29 08:29:29 +00:00
c5 = 1;
2026-10-03 08:58:59 +00:00
const obj6 = { value: obj2.getApplicationsForGuild(tmp27, obj5), done: false };
obj2 = type(application[5]);
return obj6;
2026-07-29 08:29:29 +00:00
}
}
}
2026-10-03 08:58:59 +00:00
} else if (1 === c4) {
c3 = 0;
closure_129_3(false);
throw application;
} else {
if (2 === c4) {
c3 = 1;
2026-10-03 08:58:59 +00:00
closure_0 = application;
const self = this;
const self2 = this;
const aPIError = new closure_0(application[6]).APIError(closure_0);
closure_129_4(aPIError);
2026-07-29 08:29:29 +00:00
} else if (arg0 === 1) {
c5 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
c3 = 0;
closure_129_3(false);
2026-07-29 08:29:29 +00:00
c5 = 3;
const obj = { value, done: true };
2026-07-29 08:29:29 +00:00
return obj;
} else {
c3 = 1;
2026-07-29 08:29:29 +00:00
}
c3 = 0;
closure_129_3(false);
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
c5 = 3;
2026-10-05 08:00:40 +00:00
return { value: "IconComponent", done: null };
2026-10-03 08:58:59 +00:00
} catch (tmp35) {
application = tmp35;
if (0 === c3) {
c5 = 3;
throw tmp35;
} else if (1 === tmp37) {
c4 = 1;
2026-07-29 08:29:29 +00:00
} else {
2026-10-03 08:58:59 +00:00
c4 = 2;
2026-07-29 08:29:29 +00:00
}
}
}
}), items1);
2026-10-03 08:58:59 +00:00
const items2 = [first1, callback];
const effect = first1.useEffect(() => {
const tmp = first1;
if (!tmp) {
2026-07-20 16:05:17 +00:00
callback();
}
}, items2);
2026-10-03 08:58:59 +00:00
return { application, error, loading };
2026-07-20 16:05:17 +00:00
};