decord/source/modules/premium/native/hooks/useCheckoutPlanPriceString.tsx

141 lines
4.7 KiB
TypeScript
Raw Normal View History

// Module ID: 13303
// Function ID: 13304
2026-09-03 10:05:34 +00:00
// Name: useCheckoutPlan
// Dependencies: [19, 7424, 1115, 7409, 2]
2026-09-03 10:05:34 +00:00
// Exports: useCheckoutPlan, useCheckoutPlanDiscountPrices, useCheckoutPlanPriceString
2026-07-20 16:05:17 +00:00
// Module 13303 (useCheckoutPlan)
2026-08-24 06:08:38 +00:00
import closure_2 from "noop" /* 19 */;
import { useNativeCheckoutStore } from "context" /* 7424 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/premium/native/hooks/useCheckoutPlanPriceString.tsx");
2026-07-20 16:05:17 +00:00
2026-09-03 10:05:34 +00:00
export const useCheckoutPlan = function useCheckoutPlan(arg0) {
const _require = arg0;
const tmp2 = useNativeCheckoutStore((getCheckoutContextRecord) => getCheckoutContextRecord.getCheckoutContextRecord());
dependencyMap = tmp2;
let obj = _require(1115);
2026-09-03 10:05:34 +00:00
const tmp3 = obj.isIOS() && useNativeCheckoutStore((orderRequired) => orderRequired.orderRequired);
const React = tmp3;
obj = {
plan: React.useMemo(() => {
let availablePlanForItems = null;
if (closure_2) {
availablePlanForItems = null;
if (null != table) {
availablePlanForItems = null;
if (null != productId) {
availablePlanForItems = obj.getAvailablePlanForItems(productId(table[3]).getSubscriptionItemsForProduct(tmp2));
const obj2 = productId(table[3]);
}
}
obj = table;
}
return availablePlanForItems;
}, items),
useOrderPricing: tmp3
};
items = [tmp2, arg0, tmp3];
return obj;
};
export const useCheckoutPlanDiscountPrices = function useCheckoutPlanDiscountPrices(productId, discountedPriceString) {
let memo = productId;
const tmp2 = regularPriceString((getCheckoutContextRecord) => getCheckoutContextRecord.getCheckoutContextRecord());
dependencyMap = tmp2;
const tmp = regularPriceString((orderRequired) => orderRequired.orderRequired);
let tmp3 = memo(1115).isIOS() && tmp;
2026-09-03 10:05:34 +00:00
discountedPriceString = tmp3;
const items = [tmp2, productId, tmp3];
memo = discountedPriceString.useMemo(() => {
let availablePlanForItems = null;
if (closure_2) {
availablePlanForItems = null;
if (null != table) {
availablePlanForItems = null;
if (null != productId) {
availablePlanForItems = obj.getAvailablePlanForItems(productId(table[3]).getSubscriptionItemsForProduct(tmp2));
const obj2 = productId(table[3]);
}
}
obj = table;
}
return availablePlanForItems;
}, items);
dependencyMap = tmp3;
discountedPriceString = discountedPriceString.discountedPriceString;
regularPriceString = discountedPriceString.regularPriceString;
const items1 = [discountedPriceString, memo, regularPriceString, tmp3];
return discountedPriceString.useMemo(() => {
if (closure_1) {
if (null == memo) {
return null;
} else {
discountedPriceString = obj2.getDiscountedPriceString();
let tmp7 = null;
if (null != discountedPriceString) {
let obj = { discountedPrice: null, regularPrice: null };
obj[0] = discountedPriceString;
obj[1] = obj2.getRegularPriceString();
tmp7 = obj;
}
return tmp7;
}
} else {
let tmp3 = null;
if (null != discountedPriceString) {
tmp3 = null;
if (null != regularPriceString) {
obj = { discountedPrice: null, regularPrice: null };
obj[0] = tmp;
obj[1] = tmp4;
tmp3 = obj;
}
}
return tmp3;
}
}, items1);
};
2026-07-21 22:01:30 +00:00
export const useCheckoutPlanPriceString = function useCheckoutPlanPriceString(productId, first) {
2026-07-20 16:05:17 +00:00
let priceString;
2026-07-29 08:29:29 +00:00
if (first != null) {
2026-07-21 22:01:30 +00:00
priceString = first.priceString;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (priceString == null) {
priceString = null;
2026-07-20 16:05:17 +00:00
}
2026-09-03 10:05:34 +00:00
const _require = productId;
2026-07-29 08:29:29 +00:00
const tmp3 = useNativeCheckoutStore((getCheckoutContextRecord) => getCheckoutContextRecord.getCheckoutContextRecord());
2026-08-24 06:08:38 +00:00
dependencyMap = tmp3;
2026-09-03 10:05:34 +00:00
const tmp2 = useNativeCheckoutStore((orderRequired) => orderRequired.orderRequired);
const tmp4 = _require(1115).isIOS() && tmp2;
2026-09-03 10:05:34 +00:00
const React = tmp4;
const items = [tmp3, productId, tmp4];
2026-07-20 16:05:17 +00:00
const memo = React.useMemo(() => {
2026-09-03 10:05:34 +00:00
let availablePlanForItems = null;
if (closure_2) {
availablePlanForItems = null;
if (null != table) {
availablePlanForItems = null;
if (null != productId) {
availablePlanForItems = obj.getAvailablePlanForItems(productId(table[3]).getSubscriptionItemsForProduct(tmp2));
const obj2 = productId(table[3]);
}
2026-07-20 16:05:17 +00:00
}
2026-09-03 10:05:34 +00:00
obj = table;
2026-07-20 16:05:17 +00:00
}
2026-09-03 10:05:34 +00:00
return availablePlanForItems;
2026-07-20 16:05:17 +00:00
}, items);
2026-09-03 10:05:34 +00:00
if (tmp4) {
let priceString1;
if (memo != null) {
priceString1 = memo.getPriceString();
}
if (priceString1 == null) {
priceString1 = null;
2026-07-20 16:05:17 +00:00
}
2026-09-03 10:05:34 +00:00
priceString = priceString1;
2026-07-20 16:05:17 +00:00
}
2026-09-03 10:05:34 +00:00
return priceString;
2026-07-20 16:05:17 +00:00
};