decord/beta/source/modules/payments/native/NativePaymentContext.tsx

67 lines
2.8 KiB
TypeScript
Raw Normal View History

// Module ID: 10282
// Function ID: 10283
// Name: NativePaymentContext
// Dependencies: [32, 19, 4493, 1085, 21, 6848, 8667, 6675, 10283, 504, 2]
// Exports: NativePaymentContextProvider
// Module 10282 (NativePaymentContext)
2026-10-01 14:13:23 +00:00
import Fragment from "Fragment" /* 21 */;
import Constants from "Constants" /* 1085 */;
import SubscriptionPlanActionCreators from "SubscriptionPlanActionCreators" /* 6675 */;
import ContextUtilsDefault from "ContextUtils" /* 6848 */;
2026-10-01 14:13:23 +00:00
import _slicedToArray from "_slicedToArray" /* 32 */;
import react from "react" /* 19 */;
import SubscriptionPlanStore from "SubscriptionPlanStore" /* 4493 */;
2026-10-01 14:13:23 +00:00
import size from "module_2" /* 2 */;
2026-10-01 14:13:23 +00:00
let metroImportDefault;
let tmp4;
let tmp5;
const PaymentGateways = Constants.PaymentGateways;
const jsx = Fragment.jsx;
[metroImportDefault, tmp4, tmp5] = ContextUtilsDefault();
_slicedToArray(ContextUtilsDefault(), 3);
const result = size.fileFinishedImporting("modules/payments/native/NativePaymentContext.tsx");
export const NativePaymentContextProvider = function NativePaymentContextProvider(skuIDs) {
2026-10-01 14:13:23 +00:00
let activeSubscription;
let children;
const f91005 = () => {
let value = null;
if (null != selectedPlanId) {
value = SubscriptionPlanStore.get(tmp);
}
return value;
};
skuIDs = skuIDs.skuIDs;
let storeFront;
let selectedPlanId;
({ children, activeSubscription } = skuIDs);
2026-10-01 14:13:23 +00:00
let obj = storeFront(selectedPlanId[6]);
const nativeIAPPayments = obj.useNativeIAPPayments();
storeFront = nativeIAPPayments.storeFront;
const items = [storeFront, skuIDs];
2026-10-01 14:13:23 +00:00
const nativePaymentsConnected = nativeIAPPayments.nativePaymentsConnected;
const effect = react.useEffect(() => {
let isFetchingForSKUsResult = null == storeFront;
2026-10-01 14:13:23 +00:00
const tmp = storeFront;
if (!isFetchingForSKUsResult) {
isFetchingForSKUsResult = SubscriptionPlanStore.isFetchingForSKUs(skuIDs);
}
if (!isFetchingForSKUsResult) {
2026-10-01 14:13:23 +00:00
const obj = SubscriptionPlanActionCreators;
const subscriptionPlansBySKUs = obj.fetchSubscriptionPlansBySKUs(skuIDs, tmp.country, PaymentGateways.APPLE_ADVANCED_COMMERCE);
}
}, items);
const tmp3 = storeFront(selectedPlanId[8])();
selectedPlanId = tmp3.selectedPlanId;
2026-10-01 14:13:23 +00:00
const setSelectedPlanId = tmp3.setSelectedPlanId;
const items1 = [SubscriptionPlanStore];
const items2 = [selectedPlanId];
const obj2 = skuIDs(selectedPlanId[9]);
2026-10-01 14:13:23 +00:00
({ isReadyToPurchase: nativePaymentsConnected, setSelectedPlanId, selectedPlan: obj2.useStateFromStores(items1, f91005, items2), storeFront, activeSubscription });
return <redux.Provider value={{ isReadyToPurchase: nativePaymentsConnected, setSelectedPlanId, selectedPlan: obj2.useStateFromStores(items1, f91005, items2), storeFront, activeSubscription }}>{children}</redux.Provider>;
};
export const useNativeIAPPaymentContext = tmp4;
export const useForwardedNativePaymentContext = tmp5;