decord/source/stores/ConnectedAccountsStore.tsx

158 lines
5.1 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 5226
// Function ID: 5227
2026-07-29 08:29:29 +00:00
// Name: set
2026-08-24 06:08:38 +00:00
// Dependencies: [5227, 676, 5102, 1430, 5228, 589, 709, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 5226 (set)
import initializeDefault from "initialize" /* 589 */;
import dispatcherDefault from "dispatcher" /* 709 */;
import callbackDefault from "callback" /* 5228 */;
import closure_3 from "toString" /* 5227 */;
import set from "set" /* 2 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
const items = [require("ME").PlatformTypes.CONTACTS];
2026-07-23 10:11:24 +00:00
let set = new Set(items);
2026-07-29 08:29:29 +00:00
let c5 = true;
let closure_6 = [];
let closure_7 = [];
let closure_8 = {};
2026-07-20 16:05:17 +00:00
const set1 = new Set();
2026-07-29 08:29:29 +00:00
let closure_10 = {};
let closure_11 = {};
2026-08-24 06:08:38 +00:00
const Store = initializeDefault.Store;
2026-07-29 08:29:29 +00:00
class ConnectedAccountsStore extends Store {
}
const prototype = ConnectedAccountsStore.prototype;
prototype["isJoining"] = function isJoining(id) {
return table[id] || false;
};
prototype["joinErrorMessage"] = function joinErrorMessage(arg0) {
return table3[arg0];
};
prototype["isFetching"] = function isFetching() {
return c5;
};
prototype["getAccounts"] = function getAccounts() {
return closure_6;
};
prototype["getLocalAccounts"] = function getLocalAccounts() {
return closure_7;
};
prototype["getAccount"] = function getAccount(accountId, SPOTIFY) {
2026-08-24 06:08:38 +00:00
closure_0 = accountId;
closure_1 = SPOTIFY;
2026-07-29 08:29:29 +00:00
return closure_6.find((id) => {
let tmp2 = null == closure_0 || id.id === tmp;
if (tmp2) {
tmp2 = id.type === closure_1;
}
return tmp2;
});
};
prototype["getLocalAccount"] = function getLocalAccount(CONTACTS) {
2026-08-24 06:08:38 +00:00
closure_0 = CONTACTS;
2026-07-29 08:29:29 +00:00
return closure_7.find((type) => type.type === closure_0);
};
prototype["isSuggestedAccountType"] = function isSuggestedAccountType(arg0) {
return table2[arg0] || false;
};
prototype["addPendingAuthorizedState"] = function addPendingAuthorizedState(state) {
set1.add(state);
};
prototype["deletePendingAuthorizedState"] = function deletePendingAuthorizedState(arg0) {
set1.delete(arg0);
};
prototype["hasPendingAuthorizedState"] = function hasPendingAuthorizedState(arg0) {
return set1.has(arg0);
};
ConnectedAccountsStore.displayName = "ConnectedAccountsStore";
2026-08-24 06:08:38 +00:00
const connectedAccountsStore = new ConnectedAccountsStore(dispatcherDefault, {
2026-07-20 16:05:17 +00:00
CONNECTION_OPEN: function handleConnectionOpen(connectedAccounts) {
connectedAccounts = connectedAccounts.connectedAccounts;
2026-08-24 06:08:38 +00:00
const mapped = connectedAccounts.map((arg0) => new closure_3(arg0));
closure_6 = mapped.filter((type) => {
2026-07-29 08:29:29 +00:00
const hasItem = set.has(type.type);
let isSupportedResult = !hasItem;
if (!hasItem) {
isSupportedResult = callback(table[2]).isSupported(type.type);
const obj = callback(table[2]);
}
return isSupportedResult;
});
2026-08-24 06:08:38 +00:00
closure_7 = mapped.filter((type) => set.has(type.type));
c5 = false;
2026-07-20 16:05:17 +00:00
},
USER_CONNECTIONS_UPDATE: function handleConnectionsUpdate(local) {
if (local.local) {
if (null != local.accounts) {
const accounts = local.accounts;
2026-07-29 08:29:29 +00:00
const mapped = accounts.map((integrations) => {
2026-07-23 10:11:24 +00:00
let obj = {};
let merged = Object.assign(integrations);
2026-07-20 16:05:17 +00:00
integrations = integrations.integrations;
2026-07-29 08:29:29 +00:00
obj.integrations = integrations.map((guild) => {
2026-07-20 16:05:17 +00:00
let obj = {};
const merged = Object.assign(guild);
obj = {};
const merged1 = Object.assign(guild.guild);
2026-07-29 08:29:29 +00:00
obj.features = [];
obj.guild = callback(table[3]).fromGuildBasic(obj);
2026-07-20 16:05:17 +00:00
return obj;
});
2026-08-24 06:08:38 +00:00
return new closure_3(obj);
2026-07-29 08:29:29 +00:00
});
2026-08-24 06:08:38 +00:00
closure_6 = mapped.filter((type) => {
2026-07-29 08:29:29 +00:00
const hasItem = set.has(type.type);
let isSupportedResult = !hasItem;
if (!hasItem) {
isSupportedResult = callback(table[2]).isSupported(type.type);
const obj = callback(table[2]);
}
return isSupportedResult;
});
2026-08-24 06:08:38 +00:00
closure_7 = mapped.filter((type) => set.has(type.type));
c5 = false;
2026-07-20 16:05:17 +00:00
}
}
2026-08-24 06:08:38 +00:00
const response = callbackDefault.fetch();
2026-07-20 16:05:17 +00:00
},
USER_CONNECTIONS_INTEGRATION_JOINING: function handleJoining(integrationId) {
2026-07-29 08:29:29 +00:00
closure_8[integrationId.integrationId] = integrationId.joining;
2026-07-20 16:05:17 +00:00
},
USER_CONNECTION_UPDATE: function handleUserConnectionUpdate(arg0) {
2026-07-23 10:11:24 +00:00
({ platformType: require, id: importDefault, revoked, accessToken } = arg0);
2026-07-29 08:29:29 +00:00
const found = closure_6.find((id) => {
2026-07-20 16:05:17 +00:00
let tmp = id.id === closure_1;
if (tmp) {
tmp = id.type === closure_0;
}
return tmp;
});
if (null == found) {
return false;
} else {
if (null != revoked) {
found.revoked = revoked;
}
if (null != accessToken) {
found.accessToken = accessToken;
}
}
},
USER_CONNECTIONS_INTEGRATION_JOINING_ERROR: function handleJoiningError(error) {
let str = "";
if (undefined !== error.error) {
str = error.error;
}
2026-07-29 08:29:29 +00:00
closure_11[error.integrationId] = str;
2026-07-20 16:05:17 +00:00
},
USER_CONNECTIONS_CALLBACK: function handleUserConnectionsCallback(arg0) {
({ code, state, openid_params, provider } = arg0);
2026-08-24 06:08:38 +00:00
callbackDefault.callback(provider, { code, state, openid_params });
2026-07-20 16:05:17 +00:00
}
});
2026-07-29 08:29:29 +00:00
const result = set.fileFinishedImporting("stores/ConnectedAccountsStore.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default connectedAccountsStore;