68 lines
4.2 KiB
TypeScript
68 lines
4.2 KiB
TypeScript
/* Metro module 10109; source: modules/payments/native/NativePaymentContext.tsx; dependencies: [57, 31, 3807, 33, 7045, 7943, 6847, 10110, 566, 2] */
|
|
import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import SubscriptionPlanStore from '../../../stores/billing/SubscriptionPlanStore.tsx'; /* Metro dependency 3807 */
|
|
import NativePaymentHooksAndroid from './hooks/NativePaymentHooks.android.tsx'; /* Metro dependency 7943 */
|
|
import UseSubscriptionSelection from '../hooks/useSubscriptionSelection.tsx'; /* Metro dependency 10110 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
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 FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
|
|
|
|
function _fun78912(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#78912, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10295:6, offset: 0x01e3baff, size: 224 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = Module00057;
|
|
value = value((importDefault(7045) /* metro dependency 7045: ContextUtils */)(), 3);
|
|
const env0_6 = value[0];
|
|
const property = value[1];
|
|
const property2 = value[2];
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/payments/native/NativePaymentContext.tsx');
|
|
exports.NativePaymentContextProvider = NativePaymentContextProvider;
|
|
exports.useNativeIAPPaymentContext = property;
|
|
exports.useForwardedNativePaymentContext = property2;
|
|
function NativePaymentContextProvider({children, skuIDs, activeSubscription}) { // fn#78913, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10295:291, offset: 0x01e3bbdf, size: 261 bytes, params: 2, frame: 24
|
|
const {nativePaymentsConnected,
|
|
storeFront} = (NativePaymentHooksAndroid).useNativeIAPPayments();
|
|
ReactModule.useEffect(_fun78914, [storeFront, skuIDs]);
|
|
const {selectedPlanId,
|
|
setSelectedPlanId} = (UseSubscriptionSelection)();
|
|
const value4 = (FluxModule).useStateFromStores([SubscriptionPlanStore],
|
|
_fun78915, [selectedPlanId]);
|
|
const Provider = env0_6.Provider;
|
|
return (
|
|
<Provider
|
|
value={{
|
|
isReadyToPurchase: nativePaymentsConnected,
|
|
setSelectedPlanId: setSelectedPlanId,
|
|
selectedPlan: value4,
|
|
storeFront: storeFront,
|
|
activeSubscription: activeSubscription,
|
|
}}
|
|
>
|
|
{children}
|
|
</Provider>
|
|
);
|
|
function _fun78914() { // fn#78914, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10295:466, offset: 0x01e3bce4, size: 98 bytes, params: 1, frame: 14
|
|
var value4;
|
|
var moduleValue;
|
|
if (!(storeFront == null || SubscriptionPlanStore.isFetchingForSKUs(skuIDs))) {
|
|
value4 = environment.__proto__;
|
|
moduleValue = require(6847) /* metro dependency 6847: SubscriptionPlanActionCreators */;
|
|
moduleValue.fetchSubscriptionPlansBySKUs(skuIDs, storeFront.country);
|
|
}
|
|
}
|
|
|
|
function _fun78915() { // fn#78915, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10295:654, offset: 0x01e3bd46, size: 39 bytes, params: 1, frame: 12
|
|
const selectedPlanIdBinding = selectedPlanId;
|
|
const value2 = null;
|
|
return value2 != selectedPlanIdBinding ? SubscriptionPlanStore.get(selectedPlanId) : value2;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun78912, 10109, [57, 31, 3807, 33, 7045, 7943, 6847, 10110, 566,
|
|
2]) /* metro module 10109, dependencies: [57, 31, 3807, 33, 7045, 7943, 6847, 10110, 566, 2] */;
|