135 lines
9.8 KiB
TypeScript
135 lines
9.8 KiB
TypeScript
/* Metro module 7019; source: modules/guild_boosting/native/GuildBoostingSubscribeButton.tsx; dependencies: [5, 31, 27, 7020, 661, 6524, 1880, 33, 7021, 5080, 6522, 12299, 1484, 6771, 632, 1895, 12300, 4578, 1244, 6705, 2] */
|
|
import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */
|
|
import UseAnalyticsLocations from '../../app_analytics/useAnalyticsLocations.tsx'; /* Metro dependency 6771 */
|
|
import GuildBoostSlotStore from '../../../stores/billing/GuildBoostSlotStore.tsx'; /* Metro dependency 7020 */
|
|
import UseFetchGuildBoostSlots from '../../../components_native/premium/premium_guild_subscribe_modal/useFetchGuildBoostSlots.tsx'; /* Metro dependency 12299 */
|
|
import UseGuildBoostPurchaseHandler from './hooks/useGuildBoostPurchaseHandler.tsx'; /* Metro dependency 12300 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as UseStateFromStoresModule from '../../../external/discord_common/js/packages/flux/useStateFromStores.tsx'; /* Metro dependency 632 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as UseNavigationNativeModule from '../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
|
|
import * as PremiumConstantsModule from '../../premium/PremiumConstants.tsx'; /* Metro dependency 1880 */
|
|
import * as ButtonNativeModule from '../../../design/components/Button/native/Button.native.tsx'; /* Metro dependency 4578 */
|
|
import * as PremiumGuildSubscribeConstantsModule from '../../../components_native/premium/premium_guild_subscribe_modal/PremiumGuildSubscribeConstants.tsx'; /* Metro dependency 6524 */
|
|
|
|
function _fun55610(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#55610, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7197:6, offset: 0x013abe51, size: 302 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_14 = _fun55611();
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/guild_boosting/native/GuildBoostingSubscribeButton.tsx');
|
|
exports.default = _default_55616;
|
|
function _fun55611() { // fn#55611, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7197:318, offset: 0x013abf7f, size: 32 bytes, params: 1, frame: 12
|
|
const env0_0 = Module00005(_fun55613);
|
|
return _fun55615;
|
|
function* _fun55613(a0, a1) { // fn#55613, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7197:338, offset: 0x013abfa8, size: 162 bytes, params: 3, frame: 18
|
|
var environment;
|
|
if (true) {
|
|
value = environment.__proto__.__proto__;
|
|
var value3 = env2_0(env2_2[8]);
|
|
var launchGuildBoostFlowOrAlert = value3.launchGuildBoostFlowOrAlert;
|
|
var PREMIUM_GUILD_USER_MODAL = env2_9.PREMIUM_GUILD_USER_MODAL;
|
|
var BUTTON_CTA = env2_7.BUTTON_CTA;
|
|
var BUY = env2_8.BUY;
|
|
yield Reflect.apply(launchGuildBoostFlowOrAlert, value3, [{page: PREMIUM_GUILD_USER_MODAL, section: a1,
|
|
object: BUTTON_CTA, objectType: BUY}, a0, _fun55614]);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
env2_0(env2_2[10]).closeApplyBoostModal();
|
|
}
|
|
function _fun55614() { // fn#55614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7197:479, offset: 0x013ac04a, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__.__proto__.__proto__;
|
|
return env3_1(env3_2[9]).pop();
|
|
}
|
|
|
|
}
|
|
|
|
function _fun55615() { // fn#55615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7197:541, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13
|
|
return env0_0.apply(this, arguments);
|
|
}
|
|
|
|
}
|
|
|
|
function _default_55616({guild, previousGuildSubscriptionSlot, useShortenedCTA, styles, analyticsSection, fractionalPremiumState, premiumGroupRole, onAvailableSlotPress, intent, onResult}) { // fn#55616, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7197:596, offset: 0x013ac06f, size: 668 bytes, params: 2, frame: 29
|
|
const intent2 = intent;
|
|
const value3 = (UseFetchGuildBoostSlots)();
|
|
const value4 = (UseNavigationNativeModule).useNavigation();
|
|
const analyticsLocations = (UseAnalyticsLocations)().analyticsLocations;
|
|
const value5 = (UseStateFromStoresModule).useStateFromStores([GuildBoostSlotStore],
|
|
_fun55617);
|
|
const value6 = intent2.useCallback(_fun55619, [value4, analyticsSection, onAvailableSlotPress, intent, onResult]);
|
|
const r8 = !value5 && (fractionalPremiumState !== FractionalPremiumStates.NONE || premiumGroupRole === (require(1895) /* metro dependency 1895: user */).PremiumSubscriptionGroupRole.MEMBER);
|
|
const {shouldUseMobileWebRedirectCheckout,
|
|
handleMobileWebRedirectCheckout} = (UseGuildBoostPurchaseHandler)('guild_boost_subscribe_button');
|
|
const env0_13 = intent2.useCallback(_fun55620, [value3, shouldUseMobileWebRedirectCheckout,
|
|
handleMobileWebRedirectCheckout, guild.id, analyticsSection, value5, previousGuildSubscriptionSlot,
|
|
analyticsLocations, value6]);
|
|
const Button = (ButtonNativeModule).Button;
|
|
const object2 = {loading: value3, variant: 'primary', onPress: onPress_55621, disabled: r8};
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const t = (IndexNativeModule).t;
|
|
object2.text = useShortenedCTA ? Reflect.apply(string, intl, [t.Uj0md3]) : Reflect.apply(string, intl, [t.gKmQ1G]);
|
|
object2.icon = (
|
|
r8
|
|
? ((LockIcon) => <LockIcon size="xs" color="white" />)((require(6705) /* metro dependency 6705: LockIcon */).LockIcon)
|
|
: undefined
|
|
);
|
|
return (
|
|
<View style={styles}>
|
|
<Button {...object2} />
|
|
</View>
|
|
);
|
|
function _fun55617() { // fn#55617, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7197:904, offset: 0x013ac30b, size: 51 bytes, params: 1, frame: 11
|
|
var environment;
|
|
const Object = global.Object;
|
|
const keys = Object.keys;
|
|
const value = environment.__proto__;
|
|
return Reflect.apply(keys, Object, [GuildBoostSlotStore.boostSlots]).some(_fun55618);
|
|
function _fun55618(a0) { // fn#55618, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7197:940, offset: 0x013ac33e, size: 50 bytes, params: 2, frame: 10
|
|
const value = environment.__proto__.__proto__;
|
|
const property = GuildBoostSlotStore.boostSlots[a0];
|
|
return property.premiumGuildSubscription == null && !property.isOnCooldown();
|
|
}
|
|
|
|
}
|
|
|
|
function _fun55619(a0, a1) { // fn#55619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7197:1047, offset: 0x013ac370, size: 177 bytes, params: 3, frame: 21
|
|
if (onAvailableSlotPress != null) {
|
|
return onAvailableSlotPress(a0, a1);
|
|
}
|
|
const push = ConstantsModule.AnalyticsObjects.push;
|
|
const CONFIRMATION = PremiumGuildSubscribeModalScenes.CONFIRMATION;
|
|
const value3 = undefined;
|
|
const PREMIUM_GUILD_USER_MODAL = AnalyticsPages.PREMIUM_GUILD_USER_MODAL;
|
|
const BUTTON_CTA = AnalyticsObjects.BUTTON_CTA;
|
|
const BUY = AnalyticsObjectTypes.BUY;
|
|
Reflect.apply(push, ConstantsModule.AnalyticsObjects, [CONFIRMATION, {guildId: a0, guildBoostSlots: a1 != null ? [a1] : value3,
|
|
location: {page: PREMIUM_GUILD_USER_MODAL, section: analyticsSection, object: BUTTON_CTA, objectType: BUY},
|
|
intent: intent, onResult: onResult}]);
|
|
return value3;
|
|
}
|
|
|
|
function _fun55620() { // fn#55620, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7197:1479, offset: 0x013ac421, size: 127 bytes, params: 1, frame: 15
|
|
return env0_6 ? NOOP : ConstantsModule.AnalyticsPages ? (0, ConstantsModule.NOOP)(guild.id,
|
|
previousGuildSubscriptionSlot) : shouldUseMobileWebRedirectCheckout && guild.id != null ? handleMobileWebRedirectCheckout(analyticsLocations,
|
|
guild.id) : env1_14(analyticsLocations, analyticsSection);
|
|
}
|
|
|
|
function _default_55616OnPress() { // fn#55621, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7197:1639, owner: _default_55616.onPress, offset: 0x00e719ed, size: 15 bytes, params: 1, frame: 9
|
|
return env0_13();
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun55610, 7019, [5, 31, 27, 7020, 661, 6524, 1880, 33, 7021, 5080, 6522, 12299, 1484, 6771, 632, 1895,
|
|
12300, 4578, 1244, 6705,
|
|
2]) /* metro module 7019, dependencies: [5, 31, 27, 7020, 661, 6524, 1880, 33, 7021, 5080, 6522, 12299, 1484, 6771, 632, 1895, 12300, 4578, 1244, 6705, 2] */;
|