103 lines
5.9 KiB
TypeScript
103 lines
5.9 KiB
TypeScript
/* Metro module 12633; source: modules/midjourney_onboarding/MidjourneyOnboardingUtils.tsx; dependencies: [1867, 3969, 12634, 566, 2] */
|
|
import GuildStore from '../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import SelectedGuildStore from '../../stores/SelectedGuildStore.tsx'; /* Metro dependency 3969 */
|
|
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as MidjourneyOnboardingConstantsModule from './MidjourneyOnboardingConstants.tsx'; /* Metro dependency 12634 */
|
|
|
|
function _fun96907(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#96907, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12823:6, offset: 0x0216b7f2, size: 207 bytes, params: 8, frame: 20
|
|
let env0_0 = require;
|
|
const isMidjourneyOnboardingFlow2 = isMidjourneyOnboardingFlow;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/midjourney_onboarding/MidjourneyOnboardingUtils.tsx');
|
|
exports.isMidjourneyOnboardingFlow = isMidjourneyOnboardingFlow2;
|
|
exports.useIsMidjourneyOnboardingFlow = function() {
|
|
return require(dependencyMap[3]).useStateFromStores([GuildStore], _fun96910, []);
|
|
};
|
|
exports.isEligibleForMidjourneyRedirect = isEligibleForMidjourneyRedirect;
|
|
exports.hasRedirectedToGuild = function(a0) {
|
|
var env0_0 = a0;
|
|
var Promise = global.Promise;
|
|
var value = Object.create(Promise.prototype, {constructor: {value: Promise}});
|
|
var value2 = new Promise(_fun96913);
|
|
return value2 instanceof Object ? value2 : value;
|
|
};
|
|
function isMidjourneyOnboardingFlow() { // fn#96908, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12823:172, offset: 0x0216b8c1, size: 148 bytes, params: 1, frame: 13
|
|
var r1;
|
|
var value4;
|
|
let value = a0;
|
|
const value2 = undefined;
|
|
const guildStore2 = (value !== value2 ? value : {}).guildStore ?? GuildStore;
|
|
value = guildStore2.getGuild(MIDJOURNEY_GUILD_ID);
|
|
let joinedAt = value == null ? value2 : value.joinedAt;
|
|
const Date = global.Date;
|
|
const value3 = joinedAt instanceof Date;
|
|
if (value3) {
|
|
value4 = global.Date.now();
|
|
joinedAt = value.joinedAt;
|
|
value = value4 - joinedAt.getTime();
|
|
value = value <= 3600000;
|
|
r1 = value;
|
|
} else {
|
|
r1 = value3;
|
|
}
|
|
value = guildStore2.getGuildCount();
|
|
value = value === 1;
|
|
return value && r1;
|
|
}
|
|
|
|
function useIsMidjourneyOnboardingFlow() { // fn#96909, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12823:558, offset: 0x0216b955, size: 64 bytes, params: 1, frame: 15
|
|
return (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
|
|
return isMidjourneyOnboardingFlow({guildStore: GuildStore});
|
|
}, []);
|
|
function _fun96910() { // fn#96910, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12823:638, offset: 0x0216b995, size: 27 bytes, params: 1, frame: 11
|
|
return isMidjourneyOnboardingFlow({guildStore: GuildStore});
|
|
}
|
|
|
|
}
|
|
|
|
function isEligibleForMidjourneyRedirect(a0) { // fn#96911, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12823:725, offset: 0x0216b9b0, size: 83 bytes, params: 2, frame: 11
|
|
return a0.isDM() && a0.rawRecipients.length === 1 && a0.rawRecipients[0].id === MIDJOURNEY_BOT_ID && isMidjourneyOnboardingFlow();
|
|
}
|
|
|
|
function hasRedirectedToGuild(a0) { // fn#96912, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12823:894, offset: 0x0216ba03, size: 46 bytes, params: 2, frame: 11
|
|
const env0_0 = a0;
|
|
const Promise = global.Promise;
|
|
const value = Object.create(Promise.prototype, {constructor: {value: Promise}});
|
|
const promise = new Promise(_fun96913);
|
|
return promise instanceof Object ? promise : value;
|
|
function _fun96913(a0, a1) { // fn#96913, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12823:947, offset: 0x0216ba31, size: 126 bytes, params: 3, frame: 15
|
|
const env0_0 = a0;
|
|
const env0_1 = a1;
|
|
if (SelectedGuildStore.getGuildId() !== env0_0) {
|
|
var env0_2 = global.setTimeout(function() {
|
|
cleanup_96916();
|
|
require();
|
|
}, 3000);
|
|
SelectedGuildStore.addChangeListener(handleSelectedGuildUpdate);
|
|
} else {
|
|
a0();
|
|
}
|
|
function handleSelectedGuildUpdate() { // fn#96915, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12823:1048, offset: 0x0216bac6, size: 53 bytes, params: 1, frame: 10
|
|
const value = environment.__proto__.__proto__;
|
|
if (SelectedGuildStore.getGuildId() === env1_0) {
|
|
cleanup_96916();
|
|
env0_0();
|
|
}
|
|
}
|
|
|
|
function cleanup_96916() { // fn#96916, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12823:1098, offset: 0x0216bafb, size: 46 bytes, params: 1, frame: 12
|
|
const selectedGuildStoreBinding = SelectedGuildStore;
|
|
selectedGuildStoreBinding.removeChangeListener(handleSelectedGuildUpdate);
|
|
global.clearTimeout(env0_2);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun96907, 12633, [1867, 3969, 12634, 566,
|
|
2]) /* metro module 12633, dependencies: [1867, 3969, 12634, 566, 2] */;
|