109 lines
6.3 KiB
TypeScript
109 lines
6.3 KiB
TypeScript
/* Metro module 15397; source: modules/frames/native/FrameView.tsx; dependencies: [57, 31, 8065, 8066, 4237, 33, 566, 6772, 694, 8069, 10704, 15398, 15399, 10716, 2] */
|
|
function _fun117689(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117689, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15594:6, offset: 0x024bde7a, size: 236 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
let value = importAll(31) /* metro dependency 31 */;
|
|
const framesStore = importDefault(8065) /* metro dependency 8065: FramesStore */;
|
|
const env0_6 = (require(8066) /* metro dependency 8066: FramesConstants */).FrameLayoutModes;
|
|
const env0_7 = (require(4237) /* metro dependency 4237: Constants */).ActivityPlatform;
|
|
const env0_8 = (require(33) /* metro dependency 33 */).jsx;
|
|
value = value.memo(FrameViewInner);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/frames/native/FrameView.tsx');
|
|
exports.default = value;
|
|
exports.FrameView = value;
|
|
}
|
|
|
|
function FrameViewInner({layoutMode, portraitSafeAreasConfig, landscapeSafeAreasConfig}) { // fn#117690, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15594:208, offset: 0x024bdf66, size: 703 bytes, params: 2, frame: 31
|
|
var object2;
|
|
let env0_3 = undefined;
|
|
const connectedFrame = (require(566) /* metro dependency 566: flux */).useStateFromStores([FramesStore],
|
|
function() {
|
|
return FramesStore.getConnectedFrame();
|
|
});
|
|
const applicationActionCreatorsModule = require(6772) /* metro dependency 6772: ApplicationActionCreators */;
|
|
const useApplication = applicationActionCreatorsModule.useApplication;
|
|
let applicationId = connectedFrame?.applicationId;
|
|
const data = Reflect.apply(useApplication, applicationActionCreatorsModule, [applicationId]).data;
|
|
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([FramesStore], _fun117692,
|
|
[connectedFrame]);
|
|
const binding = env0_4;
|
|
const [property, property2] = env0_3(binding.useState(true), 2);
|
|
binding.useLayoutEffect(_fun117693, [layoutMode]);
|
|
applicationId = connectedFrame?.applicationId;
|
|
const value6 = env0_4.useCallback(_fun117694, [applicationId]);
|
|
let r6 = connectedFrame == null || property;
|
|
r6 = !r6 ? applicationId == null : r6;
|
|
r6 = !r6 ? data == null : r6;
|
|
const embeddedActivityViewModule = require(10704) /* metro dependency 10704: EmbeddedActivityView */;
|
|
const useBaseActivityView = embeddedActivityViewModule.useBaseActivityView;
|
|
object2 = {orientationLockState: value3, showLoadingIndicator: r6,
|
|
setShowLoadingStateForLockingOrientation: property2, application: data};
|
|
object2.setOrientationLockState = (require(15398) /* metro dependency 15398: getDefaultOrientationLockState */).setOrientationLockState;
|
|
const value10 = Reflect.apply(useBaseActivityView, embeddedActivityViewModule, [object2]);
|
|
const isResetting = value10.isResetting;
|
|
env0_3 = value10.setIsResetting;
|
|
const isLandscape = value10.isLandscape;
|
|
if (connectedFrame == null) {
|
|
return null;
|
|
}
|
|
object2 = {instance_id: 'example-cl-instance'};
|
|
const MOBILE = ActivityPlatform.MOBILE;
|
|
object2.platform = MOBILE;
|
|
if (connectedFrame.proxyTicket != null) {
|
|
object2.discord_proxy_ticket = connectedFrame.proxyTicket;
|
|
}
|
|
const BaseActivityView = embeddedActivityViewModule.BaseActivityView;
|
|
const FrameWebView = importDefault(15399) /* metro dependency 15399: FrameWebView */;
|
|
const defaultImportProps = {onActivityCrash: function() {
|
|
setIsResetting(true);
|
|
global.setTimeout(_fun117696, 0);
|
|
}, applicationId: applicationId, activityUrl: connectedFrame.url, queryParams: object2, onLoadError: value6,
|
|
allowPopups: (require(10716) /* metro dependency 10716: allowPopups */).allowPopups(data),
|
|
referrerPolicy: 'origin'};
|
|
const PIP = FrameLayoutModes.PIP;
|
|
defaultImportProps.isPipOrGridMode = layoutMode === PIP;
|
|
const FRAME_WEB_VIEW_KEY = (require(8069) /* metro dependency 8069: FramesNativeManager */).FRAME_WEB_VIEW_KEY;
|
|
defaultImportProps.webViewKey = FRAME_WEB_VIEW_KEY;
|
|
defaultImportProps.safeAreasConfig = isLandscape ? landscapeSafeAreasConfig : portraitSafeAreasConfig;
|
|
return (
|
|
<BaseActivityView
|
|
wakeLockKey="FrameActivities"
|
|
showLoadingIndicator={r6}
|
|
isResetting={isResetting}
|
|
>
|
|
<FrameWebView {...defaultImportProps} />
|
|
</BaseActivityView>
|
|
);
|
|
}
|
|
|
|
function _fun117692() { // fn#117692, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15594:463, offset: 0x024be225, size: 47 bytes, params: 1, frame: 12
|
|
return connectedFrame != null ? FramesStore.getOrientationLockStateForApp(connectedFrame.applicationId) : undefined;
|
|
}
|
|
|
|
function _fun117693() { // fn#117693, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15594:596, offset: 0x024be254, size: 86 bytes, params: 1, frame: 13
|
|
var value2;
|
|
if (connectedFrame != null) {
|
|
value2 = environment.__proto__;
|
|
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'FRAME_UPDATE_LAYOUT_MODE',
|
|
layoutMode: layoutMode, applicationId: connectedFrame.applicationId});
|
|
}
|
|
}
|
|
|
|
function _fun117694() { // fn#117694, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15594:766, offset: 0x024be2aa, size: 63 bytes, params: 1, frame: 12
|
|
var value2;
|
|
if (applicationId != null) {
|
|
value2 = environment.__proto__;
|
|
(importDefault(8069) /* metro dependency 8069: FramesNativeManager */).leaveFrame({applicationId: applicationId});
|
|
}
|
|
}
|
|
|
|
function FrameViewInnerOnActivityCrash() { // fn#117695, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15594:1384, owner: FrameViewInner.onActivityCrash, offset: 0x024be2e9, size: 43 bytes, params: 1, frame: 13
|
|
setIsResetting(true);
|
|
global.setTimeout(function() {
|
|
return setIsResetting(false);
|
|
}, 0);
|
|
}
|
|
|