This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,48 @@
// Metro module 6243 (f6244).
import IAPStore_android from "../../../stores/native/IAPStore.android";
import { PREMIUM_TIER_0_LIKELIHOOD_TRIAL_ID, PREMIUM_TIER_2_HFU_TWO_WEEK_TRIAL_ID, PREMIUM_TIER_2_LIKELIHOOD_TRIAL_ID, PREMIUM_TIER_2_REACTIVATION_TRIAL_ID, PREMIUM_TIER_2_REFERRAL_TRIAL_ID, PREMIUM_TIER_2_TRIAL_FOR_EVERYONE_TRIAL_ID } from "../PremiumConstants";
import { useTrialOffer } from "../useTrialOffer";
import { TrialIdToProductOfferId } from "../native/ProductIds.android";
import { useStateFromStoresObject } from "../../../_bundle/defaultAreStatesEqual";
function $mk78076($env) {
return (a0) => $env[0].has(a0);
}
export function useAndroidAndLegacyIOSPremiumTrialOfferCandidates() {
let env15605;
const offerIds = useStateFromStoresObject([IAPStore_android], () => ({
isFetchingProducts: IAPStore_android.isFetchingProducts(),
offerIds: IAPStore_android.getOfferIds()
})).offerIds;
const r21 = env15605 = {};
env15605[0] = offerIds;
const trialOffer = useTrialOffer(PREMIUM_TIER_2_TRIAL_FOR_EVERYONE_TRIAL_ID);
const r34 = Object.values(TrialIdToProductOfferId[PREMIUM_TIER_2_TRIAL_FOR_EVERYONE_TRIAL_ID]).every($mk78076(r21)) ? trialOffer : null;
let env15606;
const r35 = env15606 = {};
env15606[0] = offerIds;
const trialOffer2 = useTrialOffer(PREMIUM_TIER_2_LIKELIHOOD_TRIAL_ID);
const r49 = Object.values(TrialIdToProductOfferId[PREMIUM_TIER_2_LIKELIHOOD_TRIAL_ID]).every($mk78076(r35)) ? trialOffer2 : null;
let env15607;
const r50 = env15607 = {};
env15607[0] = offerIds;
const trialOffer3 = useTrialOffer(PREMIUM_TIER_2_REACTIVATION_TRIAL_ID);
const r65 = Object.values(TrialIdToProductOfferId[PREMIUM_TIER_2_REACTIVATION_TRIAL_ID]).every($mk78076(r50)) ? trialOffer3 : null;
let env15608;
const r66 = env15608 = {};
env15608[0] = offerIds;
const trialOffer4 = useTrialOffer(PREMIUM_TIER_0_LIKELIHOOD_TRIAL_ID);
const r81 = Object.values(TrialIdToProductOfferId[PREMIUM_TIER_0_LIKELIHOOD_TRIAL_ID]).every($mk78076(r66)) ? trialOffer4 : null;
let env15609;
const r82 = env15609 = {};
env15609[0] = offerIds;
const trialOffer5 = useTrialOffer(PREMIUM_TIER_2_REFERRAL_TRIAL_ID);
const r97 = Object.values(TrialIdToProductOfferId[PREMIUM_TIER_2_REFERRAL_TRIAL_ID]).every($mk78076(r82)) ? trialOffer5 : null;
let env15610;
const r98 = [r97, r34, r49, r65, , ,];
const r100 = env15610 = {};
env15610[0] = offerIds;
const trialOffer6 = useTrialOffer(PREMIUM_TIER_2_HFU_TWO_WEEK_TRIAL_ID);
r98[4] = Object.values(TrialIdToProductOfferId[PREMIUM_TIER_2_HFU_TWO_WEEK_TRIAL_ID]).every($mk78076(r100)) ? trialOffer6 : null;
r98[5] = r81;
return r98.find((item) => item != null);
}
@@ -0,0 +1,74 @@
// Metro module 6260 (f6261).
import _slicedToArray from "../../../_bundle/_slicedToArray";
import { useState, useEffect } from "react";
import UserStore from "../../../stores/UserStore";
import UserOfferStore from "../../../stores/billing/UserOfferStore";
import { PREMIUM_TIER_2_CHURN_1_MONTH_DISCOUNT_ID, PREMIUM_TIER_2_CHURN_3_MONTH_DISCOUNT_ID } from "../PremiumConstants";
import { useStateFromStores } from "../../../_bundle/Module589";
import { isPremium } from "../../../utils/PremiumUtils";
import { Timeout } from "../../../_bundle/Timeout";
function $mk114919($env) {
return () => {
const r2 = $env.$parent;
if (!r2[2] && r2[1].hasExpired()) {
(0, r2[3])(true);
} else {
const r10 = r2[1];
if (r10 == null ? void 0 : r10.hasAcknowledged()) {
const r5 = r10.expiresAt != null ? r10.expiresAt.getTime() - Date.now() : 0;
const r24 = $env;
const r25 = r24[0];
if (r25 != null) {
r25.start(r5, $mk114919(r24));
}
}
}
};
}
let env3977 = {};
export default function useDiscountOffer(a0, a1) {
let r36;
let env15637 = {
$parent: env3977
};
env15637[0] = a0;
const stateFromStores = useStateFromStores([UserOfferStore], () => UserOfferStore.getUserDiscountOffer(env15637[0]));
env15637[1] = stateFromStores;
let r19 = stateFromStores == null ? void 0 : stateFromStores.hasExpired();
if (r19 == null) {
r19 = false;
}
L10: {
const r22 = _slicedToArray(useState(r19), 2);
const r23 = r22[0];
env15637[2] = r23;
env15637[3] = r22[1];
const stateFromStores2 = useStateFromStores([UserStore], () => isPremium(UserStore.getCurrentUser()));
useEffect(() => {
const r4 = env15637[1];
if (r4 == null ? void 0 : r4.hasAcknowledged()) {
let env25766;
const r13 = env25766 = {
$parent: env15637
};
const timeout = new Timeout();
env25766[0] = timeout;
if (r4 == null ? void 0 : r4.hasAcknowledged()) {
timeout.start(r4.expiresAt != null ? r4.expiresAt.getTime() - Date.now() : 0, $mk114919(r13));
}
return () => env25766[0].stop();
}
}, [r23, stateFromStores]);
r36 = null;
if (!r23) {
if (stateFromStores2 && !a1 && a0 !== PREMIUM_TIER_2_CHURN_1_MONTH_DISCOUNT_ID) {
r36 = null;
if (a0 !== PREMIUM_TIER_2_CHURN_3_MONTH_DISCOUNT_ID) {
break L10;
}
}
r36 = stateFromStores;
}
}
return r36;
};
@@ -0,0 +1,28 @@
// Metro module 6292 (f6293).
import { useEffect } from "react";
import AuthenticationStore from "../../../stores/AuthenticationStore";
import BillingInfoStore from "../../../stores/billing/BillingInfoStore";
import IAPStore_android from "../../../stores/native/IAPStore.android";
import { useStateFromStores } from "../../../_bundle/Module589";
import { ProductIds } from "../native/ProductIds.ios";
import { fetchIpLocation } from "../../billing/actions/BillingActionCreators";
export default function useGeoForUser() {
let stateFromStores;
const stateFromStores2 = useStateFromStores([IAPStore_android], () => IAPStore_android.getProduct(ProductIds.PREMIUM_TIER_2_MONTHLY)?.countryCode);
const stateFromStores3 = useStateFromStores([BillingInfoStore], () => BillingInfoStore.ipLocation);
stateFromStores = useStateFromStores([AuthenticationStore], () => AuthenticationStore.isAuthenticated());
useEffect(() => {
let r3 = stateFromStores;
if (stateFromStores) {
r3 = !BillingInfoStore.ipLocationLoaded;
}
if (r3) {
fetchIpLocation();
}
}, [stateFromStores3, stateFromStores]);
return {
defaultBillingCountryCode: stateFromStores2,
ipCountryCode: stateFromStores3?.countryCode,
ipSubdivisionCode: stateFromStores3?.subdivisionCode
};
};
@@ -0,0 +1,16 @@
// Metro module 12588 (f12589).
import { useMemo } from "react";
import Module3771 from "../../../_bundle/Module3771";
import { dateFormat } from "../../../utils/DateUtils";
let c8684_4 = Module3771.duration(30, "days");
export default function useOutboundPromotionRedemptionEndDate(a0, a1) {
return useMemo(() => {
let r17;
if (a1) {
r17 = a0.outboundRedemptionEndDate != null ? Module3771(a0.outboundRedemptionEndDate) : Module3771(a0.endDate).add(c8684_4);
} else {
r17 = Module3771(a0.endDate);
}
return dateFormat(r17, "LL");
}, [a0, a1]);
};
@@ -0,0 +1,34 @@
// Metro module 6259 (f6260).
import IAPStore_android from "../../../stores/native/IAPStore.android";
import { PREMIUM_TIER_2_LIKELIHOOD_1_MONTH_40_PERCENT_DISCOUNT_ID, PREMIUM_TIER_2_REENGAGEMENT_1_MONTH_40_PERCENT_DISCOUNT_ID } from "../PremiumConstants";
import useDiscountOffer from "./useDiscountOffer";
import { DiscountIdToProductOfferId } from "../native/ProductIds.android";
import { useStateFromStoresObject } from "../../../_bundle/defaultAreStatesEqual";
function $mk78116($env) {
return (a0) => $env[0].has(a0);
}
export function usePremiumDiscountOffer() {
let env15635;
const offerIds = useStateFromStoresObject([IAPStore_android], () => ({
isFetchingProducts: IAPStore_android.isFetchingProducts(),
offerIds: IAPStore_android.getOfferIds()
})).offerIds;
const r9 = env15635 = {};
env15635[0] = offerIds;
const discountOffer = useDiscountOffer(PREMIUM_TIER_2_LIKELIHOOD_1_MONTH_40_PERCENT_DISCOUNT_ID);
const r27 = Object.values(DiscountIdToProductOfferId[PREMIUM_TIER_2_LIKELIHOOD_1_MONTH_40_PERCENT_DISCOUNT_ID]);
let r29 = r27.length !== 0 ? r27.every($mk78116(r9)) ? discountOffer : null : null;
let env15636;
const r35 = env15636 = {};
env15636[0] = offerIds;
const discountOffer2 = useDiscountOffer(PREMIUM_TIER_2_REENGAGEMENT_1_MONTH_40_PERCENT_DISCOUNT_ID);
const r45 = Object.values(DiscountIdToProductOfferId[PREMIUM_TIER_2_REENGAGEMENT_1_MONTH_40_PERCENT_DISCOUNT_ID]);
const r47 = r45.length !== 0 ? r45.every($mk78116(r35)) ? discountOffer2 : null : null;
if (r29 == null) {
r29 = r47;
}
return r29;
}
export function usePremiumGroupDiscountOffer() {
return null;
}
@@ -0,0 +1,5 @@
// Metro module 6258 (f6259).
import * as _usePremiumDiscountOffer_android from "./usePremiumDiscountOffer.android";
for (const key in _usePremiumDiscountOffer_android) {
exports[key] = _usePremiumDiscountOffer_android[key];
}
@@ -0,0 +1,5 @@
// Metro module 6242 (f6243).
import { useAndroidAndLegacyIOSPremiumTrialOfferCandidates } from "./useAndroidAndLegacyIOSPremiumTrialOfferCandidates.native";
export function usePremiumTrialOffer(a0) {
return useAndroidAndLegacyIOSPremiumTrialOfferCandidates(a0);
}
@@ -0,0 +1,66 @@
// Metro module 6563 (f6564).
import { useEffect, useState, useRef } from "react";
import UserOfferStore from "../../../stores/billing/UserOfferStore";
import PromotionsStore from "../promotions/PromotionsStore";
import { maybeFetchActivePromotions } from "../promotions/PromotionsActionCreators";
import { useStateFromStores } from "../../../_bundle/Module589";
import { PromotionTypes } from "../promotions/constants";
export function usePromotionMarketingComponent(c15799_0) {
let stateFromStores, endDate, ref;
useEffect(() => {
maybeFetchActivePromotions();
}, []);
stateFromStores = useStateFromStores([PromotionsStore, UserOfferStore], () => {
const marketingComponentByType = PromotionsStore.getMarketingComponentByType(c15799_0);
if (marketingComponentByType == null) {
return null;
}
const promotionByTypeAndId = PromotionsStore.getPromotionByTypeAndId(PromotionTypes.MARKETING_MOMENT, marketingComponentByType.promotionId);
const trialId = promotionByTypeAndId?.trialId;
L7: {
if (trialId != null) {
const userTrialOffer = UserOfferStore.getUserTrialOffer(promotionByTypeAndId.trialId);
if (userTrialOffer != null) {
if (userTrialOffer.expires_at == null) {
break L7;
}
if (!(Date.parse(userTrialOffer.expires_at) < Date.now())) {
break L7;
}
}
return null;
}
}
return marketingComponentByType;
});
endDate = useStateFromStores([PromotionsStore], () => {
const MARKETING_MOMENT = PromotionTypes.MARKETING_MOMENT;
let r14 = stateFromStores?.promotionId;
if (r14 == null) {
r14 = "";
}
return PromotionsStore.getPromotionByTypeAndId(MARKETING_MOMENT, r14);
})?.endDate;
const [state, setState] = useState(false);
ref = useRef(null);
useEffect(() => {
if (endDate != null) {
const r21 = endDate.getTime() - Date.now();
if (r21 > 0 && r21 < 86400000) {
setState(false);
clearTimeout(ref.current);
ref.current = setTimeout(() => {
setState(true);
}, r21);
} else if (r21 <= 0) {
setState(true);
}
return () => {
clearTimeout(ref.current);
};
}
setState(false);
clearTimeout(ref.current);
}, [endDate]);
return state ? null : stateFromStores;
}
@@ -0,0 +1,15 @@
// Metro module 12500 (f12501).
import { useEffect } from "react";
import { useForceUpdate } from "../../../_bundle/Module6235";
export default function useScheduledForcedUpdate({ delay, disable = false }) {
let c19873_1 = disable;
const forceUpdate = useForceUpdate();
useEffect(() => {
if (!(delay <= 0) && !c19873_1) {
let c27301_0 = setTimeout(() => {
forceUpdate();
}, delay);
return () => clearTimeout(c27301_0);
}
}, [delay, disable, forceUpdate]);
};