// Module ID: 8685 // Function ID: 8686 // Name: useIsOwnedVibegrationsApplication // Dependencies: [19, 2066, 8686, 559, 504, 5554, 8687, 2] // Exports: default // Module 8685 (useIsOwnedVibegrationsApplication) import BackoffDefault from "Backoff" /* 559 */; import VibegrationsUtils from "VibegrationsUtils" /* 5554 */; import VibegrationsActionCreators from "VibegrationsActionCreators" /* 8687 */; import noop from "module_19" /* 19 */; import GuildStore from "GuildStore" /* 2066 */; import VibegrationsProjectStore from "VibegrationsProjectStore" /* 8686 */; const require = globalThis.__r; require = fn; const isProjectOwner = fn(8686).isProjectOwner; let closure_6 = new BackoffDefault(30000, 300000); const size = fn(2); let result = size.fileFinishedImporting("modules/vibegrations/lib/useIsOwnedVibegrationsApplication.tsx"); export default function useIsOwnedVibegrationsApplication(arg0, arg1) { _require = arg0; dependencyMap = arg1; const items = [stateFromStores1]; const items1 = [arg1, arg0]; const stateFromStores = require("initialize").useStateFromStores(items, () => { let tmp = closure_1; if (closure_1) { tmp = null != closure_0; } if (tmp) { tmp = VibegrationsUtils.eligibleVibegrationsGuilds(GuildStore.getGuildsArray(), "useIsOwnedVibegrationsApplication").length > 0; } return tmp; }, items1); let obj = require("initialize"); const items2 = [VibegrationsProjectStore]; stateFromStores1 = require("initialize").useStateFromStores(items2, () => { projectsFetchState = projectsFetchState.getProjectsFetchState(); let type; if (projectsFetchState != null) { type = projectsFetchState.type; } if (type == null) { type = null; } return type; }); const items3 = [stateFromStores, stateFromStores1]; const effect = stateFromStores.useEffect(() => { if ("success" === stateFromStores1) { closure_6.succeed(); } if (stateFromStores) { if (null != tmp) { let pending = "error" !== tmp; if (!pending) { pending = closure_6.pending; } if (!pending) { closure_6.fail(() => closure_1_0(closure_1_1[6]).listProjects()); } } else { VibegrationsActionCreators.listProjects(); } } }, items3); const obj2 = require("initialize"); const items4 = [VibegrationsProjectStore]; const items5 = [stateFromStores, arg0]; return require("initialize").useStateFromStores(items4, () => { if (stateFromStores) { if (null != closure_0) { const result = VibegrationsProjectStore.findProjectByApplicationId(tmp); let tmp4 = null == result; if (!tmp4) { tmp4 = !isProjectOwner(result); } let tmp6 = !tmp4; if (tmp4) { projectsFetchState = VibegrationsProjectStore.getProjectsFetchState(); let type; if (projectsFetchState != null) { type = projectsFetchState.type; } tmp6 = "success" !== type && null; const tmp9 = "success" !== type && null; } return tmp6; } } return false; }, items5); };