decord/alpha/source/modules/connections/authorizeConnection.native.tsx

158 lines
6 KiB
TypeScript
Raw Normal View History

// Module ID: 8719
// Function ID: 8720
2026-07-20 16:05:17 +00:00
// Name: authorizeConnection
// Dependencies: [5906, 1074, 573, 4809, 8720, 8751, 8762, 5048, 8773, 1981, 5781, 8775, 8002, 4554, 5904, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 8719 (authorizeConnection)
import Constants from "Constants" /* 1074 */;
import LinkingDefault from "Linking" /* 4554 */;
import Constants2 from "Constants" /* 5906 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
let closure_3 = Constants2.GUILD_ROLE_CONNECTION_APPLICATION_CONNECTION_TYPE;
const PlatformTypes = Constants.PlatformTypes;
const result = size.fileFinishedImporting("modules/connections/authorizeConnection.native.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default function authorizeConnection(overrideUrl) {
({ platformType, location: _location, onClose } = overrideUrl);
let handleModalClose5 = onClose;
overrideUrl = overrideUrl.overrideUrl;
const successRedirect = overrideUrl.successRedirect;
2026-07-20 16:05:17 +00:00
if (platformType === PlatformTypes.LEAGUE_OF_LEGENDS) {
2026-07-29 08:29:29 +00:00
platformType = tmp.RIOT_GAMES;
2026-07-20 16:05:17 +00:00
}
if (null == _location) {
_location = "mobile";
}
if (platformType === PlatformTypes.XBOX) {
overrideUrl(4809).hideActionSheet();
const obj15 = overrideUrl(4809);
2026-07-29 08:29:29 +00:00
const tmp23 = overrideUrl;
2026-07-20 16:05:17 +00:00
const items = [_location];
overrideUrl(8720).showModal(items);
2026-07-29 08:29:29 +00:00
if (null != onClose) {
function handleModalClose() {
if (require != null) {
2026-07-29 08:29:29 +00:00
tmp();
}
overrideUrl(573).unsubscribe("MODAL_POP", handleModalClose5);
2026-07-29 08:29:29 +00:00
}
handleModalClose5 = handleModalClose;
const subscription = tmp23(573).subscribe("MODAL_POP", handleModalClose);
const tmp23Result = tmp23(573);
2026-07-29 08:29:29 +00:00
}
const obj16 = overrideUrl(8720);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
if (platformType !== tmp.PLAYSTATION) {
if (platformType !== tmp.PLAYSTATION_STAGING) {
if (platformType === tmp.CRUNCHYROLL) {
overrideUrl(4809).hideActionSheet();
const obj11 = overrideUrl(4809);
2026-07-29 08:29:29 +00:00
const tmp15 = overrideUrl;
2026-07-20 16:05:17 +00:00
const items1 = [_location];
overrideUrl(8762).showModal(items1);
2026-07-29 08:29:29 +00:00
if (null != onClose) {
const handleModalClose4 = function handleModalClose() {
if (require != null) {
2026-07-29 08:29:29 +00:00
tmp();
}
overrideUrl(573).unsubscribe("MODAL_POP", handleModalClose5);
2026-07-29 08:29:29 +00:00
};
handleModalClose5 = handleModalClose4;
const subscription1 = tmp15(573).subscribe("MODAL_POP", handleModalClose4);
const tmp15Result = tmp15(573);
2026-07-29 08:29:29 +00:00
}
const obj12 = overrideUrl(8762);
2026-07-29 08:29:29 +00:00
} else if (platformType === tmp.DOMAIN) {
overrideUrl(4809).hideActionSheet();
const obj8 = overrideUrl(4809);
2026-07-29 08:29:29 +00:00
const tmp10 = overrideUrl;
let obj = { locationStack: null };
2026-07-20 16:05:17 +00:00
const items2 = [_location];
obj.locationStack = items2;
overrideUrl(5048).pushLazy(handleModalClose5(1981)(8773, dependencyMap.paths), obj);
2026-07-29 08:29:29 +00:00
if (null != onClose) {
const handleModalClose3 = function handleModalClose() {
if (require != null) {
2026-07-29 08:29:29 +00:00
tmp();
}
overrideUrl(573).unsubscribe("MODAL_POP", handleModalClose5);
2026-07-29 08:29:29 +00:00
};
handleModalClose5 = handleModalClose3;
const subscription2 = tmp10(573).subscribe("MODAL_POP", handleModalClose3);
const tmp10Result = tmp10(573);
2026-07-29 08:29:29 +00:00
}
const obj9 = overrideUrl(5048);
2026-07-20 16:05:17 +00:00
} else {
value = overrideUrl(5781).get(platformType);
2026-07-20 16:05:17 +00:00
let isFederated;
2026-07-29 08:29:29 +00:00
if (value != null) {
2026-07-20 16:05:17 +00:00
isFederated = value.isFederated;
}
if (true === isFederated) {
tmp28(4809).hideActionSheet();
const tmp28Result = tmp28(4809);
const obj2 = { platformType, location: _location, successRedirect };
tmp28(5048).pushLazy(handleModalClose5(1981)(8775, tmp29.paths), obj2);
2026-07-29 08:29:29 +00:00
if (null != onClose) {
const handleModalClose2 = function handleModalClose() {
if (require != null) {
2026-07-29 08:29:29 +00:00
tmp();
}
overrideUrl(573).unsubscribe("MODAL_POP", handleModalClose5);
2026-07-29 08:29:29 +00:00
};
handleModalClose5 = handleModalClose2;
const subscription3 = tmp28(573).subscribe("MODAL_POP", handleModalClose2);
const tmp28Result5 = tmp28(573);
2026-07-29 08:29:29 +00:00
}
const tmp28Result4 = tmp28(5048);
2026-07-20 16:05:17 +00:00
} else {
if (null != overrideUrl) {
if (platformType === closure_3) {
const obj4 = {
shouldConfirm: true,
href: overrideUrl,
onConfirm() {
LinkingDefault.openURL(overrideUrl);
}
2026-07-20 16:05:17 +00:00
};
handleModalClose5(8002).handleClick(obj4);
const obj3 = handleModalClose5(8002);
2026-07-20 16:05:17 +00:00
}
}
const obj5 = { location: _location, successRedirect };
const tmp28Result6 = tmp28(5904);
tmp28(5904).authorize(platformType, obj5).then((body) => {
2026-07-20 16:05:17 +00:00
const url = body.body.url;
if (null != url) {
overrideUrl(4554).openURL(url);
const obj = overrideUrl(4554);
2026-07-20 16:05:17 +00:00
}
});
const authorizeResult = tmp28(5904).authorize(platformType, obj5);
2026-07-20 16:05:17 +00:00
}
const obj18 = overrideUrl(5781);
2026-07-29 08:29:29 +00:00
tmp29 = dependencyMap;
2026-07-20 16:05:17 +00:00
}
}
}
overrideUrl(4809).hideActionSheet();
const obj13 = overrideUrl(4809);
2026-07-29 08:29:29 +00:00
const tmp19 = overrideUrl;
2026-07-20 16:05:17 +00:00
const items3 = [_location];
overrideUrl(8751).showModal(items3, platformType);
2026-07-29 08:29:29 +00:00
if (null != onClose) {
handleModalClose5 = function handleModalClose() {
if (require != null) {
2026-07-29 08:29:29 +00:00
tmp();
}
overrideUrl(573).unsubscribe("MODAL_POP", handleModalClose5);
2026-07-29 08:29:29 +00:00
};
const subscription4 = tmp19(573).subscribe("MODAL_POP", handleModalClose5);
const tmp19Result = tmp19(573);
2026-07-29 08:29:29 +00:00
}
const obj14 = overrideUrl(8751);
2026-07-20 16:05:17 +00:00
}
};