/* Metro module 10709; source: modules/activities/native/EmbeddedActivityWebView.tsx; dependencies: [5, 57, 31, 27, 7503, 4237, 661, 33, 4501, 3, 477, 10710, 491, 5269, 1239, 10711, 1582, 10713, 10714, 683, 632, 4647, 1244, 507, 10715, 1471, 8071, 8072, 6266, 7712, 8092, 2] */ import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */ import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */ import AnalyticsUtils from '../../../utils/AnalyticsUtils.tsx'; /* Metro dependency 683 */ import DeveloperActivityShelfStore from '../DeveloperActivityShelfStore.tsx'; /* Metro dependency 7503 */ import EmbeddedActivitiesNativeManager from './EmbeddedActivitiesNativeManager.tsx'; /* Metro dependency 8092 */ import UseStableSafeAreaInsetsNative from '../../safe_area/useStableSafeAreaInsets.native.tsx'; /* Metro dependency 10711 */ import GetIFrameSandboxAttributes from '../utils/getIFrameSandboxAttributes.tsx'; /* Metro dependency 10713 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */ 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 PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */ import * as ComponentDispatchUtilsModule from '../../../utils/ComponentDispatchUtils.tsx'; /* Metro dependency 1239 */ import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */ import * as ClientInfoUtilsModule from '../../../utils/native/ClientInfoUtils.tsx'; /* Metro dependency 1582 */ import * as ConstantsModule from '../Constants.tsx'; /* Metro dependency 4237 */ import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */ import * as WebViewContextModule from './WebViewContext.tsx'; /* Metro dependency 10710 */ function _fun82275(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#82275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:6, offset: 0x01ef180a, size: 458 bytes, params: 8, frame: 23 const env0_0 = require; const _arrayLikeToArray_82278 = function(a0, a1) { var r0; var r1; var r2; var value3; var length; var value5; var value = undefined; var value2 = value == null; reducibleJoin2: while (true) { if (value2) { r0 = value2; break reducibleJoin2; } value3 = value > a0.length; r0 = value3; break reducibleJoin2; } reducibleJoin4: while (true) { if (r0) { length = a0.length; r1 = length; break reducibleJoin4; } r1 = value; break reducibleJoin4; } value = (0, global.Array)(r1); var value4 = 0; if (value4 < r1) { r2 = value4; reducibleLoop5: while (true) { value[r2] = a0[r2]; value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1; if (value5 < r1) { r2 = value5; continue reducibleLoop5; } break reducibleLoop5; } } return value; }; const getSafeArea = function(a0, a1) { var r2; var r1; var r0; var value2; var value = a1; if (a0 == null) { r0 = value; } else { value2 = 0; if (a0.disable) { r1 = value2; } else { if (a0.override != null) { r2 = global.Math.max(value2, a0.override); } else if (a0.offset == null) { r2 = value; } else { value = global.Math.max(value2, value + a0.offset); r2 = value; } r1 = r2; } r0 = r1; } return r0; }; const BaseActivityWebView2 = BaseActivityWebView; const useHasInvalidUrlErrorState2 = useHasInvalidUrlErrorState; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ConstantsModule; const env0_9 = value.ActivityPlatform; const env0_10 = value.DISALLOWED_NAVIGATION_ERROR_CLOSE_ACTIVITY; value = require(661) /* metro dependency 661: Constants */; const env0_11 = value.ComponentActions; const env0_12 = value.AnalyticEvents; const env0_14 = (CreateStylesModule).createStyles({webView: {backgroundColor: 'transparent'}}); value = importDefault(3) /* metro dependency 3: Logger */; value = new value('EmbeddedActivityWebView'); const env0_16 = (PlatformUtilsModule).isIOS(); (FileImportTrackerModule).fileFinishedImporting('modules/activities/native/EmbeddedActivityWebView.tsx'); exports.default = EmbeddedActivityWebView; exports.BaseActivityWebView = BaseActivityWebView2; exports.useHasInvalidUrlErrorState = useHasInvalidUrlErrorState2; function _createForOfIteratorHelperLoose_82276(a0, a1) { // fn#82276, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:305, offset: 0x01ef19d4, size: 372 bytes, params: 3, frame: 20 var r6; var r9; var r5; var value3; var regexp; const env0_0 = a0; const Symbol = global.Symbol; let value = typeof Symbol !== 'undefined'; let r1 = value && a0[global.Symbol.iterator]; r1 = !r1 ? a0['@@iterator'] : r1; if (r1) { value = r1.call(a0); return value.next.bind(value); } const Array = global.Array; if (Array.isArray(a0)) { if (r1) { } return _fun82277; } value = undefined; if (a0) { if (typeof a0 === 'string') { value = _arrayLikeToArray_82278(a0, value); r5 = value; } else { value3 = ({}).toString.call(a0).slice(8, -1); r6 = value3 === 'Object' && a0.constructor; r9 = r6 ? a0.constructor.name : value3; if (r9 === 'Map') { r6 = global.Array.from(a0); } else if (r9 === 'Set') { r6 = global.Array.from(a0); } else if (r9 === 'Arguments') { value = _arrayLikeToArray_82278(a0, value); r6 = value; } else { regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', ''); if (regexp.test(r9)) { value = _arrayLikeToArray_82278(a0, value); r6 = value; } else { r6 = value; } } r5 = r6; } } else { r5 = value; } if (r5) { if (r5) { } return _fun82277; } const TypeError = global.TypeError; throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); function _fun82277() { // fn#82277, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:876, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5 return env0_1 >= env0_0.length ? {done: true} : {done: false, value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]}; } } function BaseActivityWebView({hasFrameId, getOrCreateFrameId, releaseFrameId, hasInvalidUrlError, setHasInvalidUrlError, hadInvalidUrlError, deepLinkQueryParams = {}, activityUrl, applicationId, queryParams, onActivityCrash, onLoadError, allowPopups, referrerPolicy, isPipOrGridMode, webViewKey, ignoreSilentHardwareSwitch, safeAreasConfig, channelId, guildId, activitySessionId}) { // fn#82280, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:1483, offset: 0x01ef1bbb, size: 2206 bytes, params: 2, frame: 50 var r1; var WebView; const hadInvalidUrlError2 = hadInvalidUrlError; let value = undefined; const applicationId2 = applicationId; ignoreSilentHardwareSwitch = ignoreSilentHardwareSwitch === value || ignoreSilentHardwareSwitch; const styles = useStyles(); let binding = applicationId2; const useContext = binding.useContext; const WebViewContext = (WebViewContextModule).WebViewContext; const value4 = Reflect.apply(useContext, binding, [WebViewContext]); var property = hadInvalidUrlError2(applicationId2.useState(function() { return hasFrameId(); }), 1)[0]; const property6 = property; const property2 = hadInvalidUrlError2(applicationId2.useState(_fun82282), 1)[0]; const [property3, env0_19] = hadInvalidUrlError2(applicationId2.useState(null), 2); const value12 = applicationId2.useMemo(_fun82283, [webViewKey]); const [property4, env0_21] = hadInvalidUrlError2(applicationId2.useState(null), 2); applicationId2.useEffect(_fun82284, [property, property2, webViewKey]); applicationId2.useEffect(function() { return _fun82286; }, [webViewKey, property2]); const value15 = (UseStableSafeAreaInsetsNative)(); const constants = (ClientInfoUtilsModule).getConstants(); let object = {}; copyDataProperties(object, queryParams, undefined); copyDataProperties(object, deepLinkQueryParams, undefined); object['frame_id'] = property2; const MOBILE = ActivityPlatform.MOBILE; object['platform'] = MOBILE; const Version = constants.Version; object['mobile_app_version'] = Version; const value17 = (GetIFrameSandboxAttributes)({allowPopups: allowPopups}); const URLSearchParams = global.URLSearchParams; const value18 = Object.create(URLSearchParams.prototype, {constructor: {value: URLSearchParams}}); const uRLSearchParams = new URLSearchParams(object); const value20 = '' + activityUrl + '?' + (uRLSearchParams instanceof Object ? uRLSearchParams : value18); const env0_25 = applicationId2.useRef(safeAreasConfig); applicationId2.useEffect(function() { _fun82288()(); }, [value20, value17, onLoadError, referrerPolicy]); const value21 = applicationId2.useCallback(_fun82292, [applicationId]); const value22 = applicationId2.useCallback(_fun82293, [applicationId]); const value23 = applicationId2.useCallback(_fun82294, [applicationId, channelId, guildId, activitySessionId, property2, releaseFrameId, value12, onActivityCrash]); const useActivityUrlOverride = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([DeveloperActivityShelfStore], function() { return DeveloperActivityShelfStore.getUseActivityUrlOverride(); }); applicationId2.useEffect(_fun82296, [value20, useActivityUrlOverride, setHasInvalidUrlError]); applicationId2.useEffect(_fun82297, [hadInvalidUrlError, hasInvalidUrlError]); let r24 = property3 != null ? property6 ? 'file://' + property4 : '' + property3.origin + '/' + property2 + '/activity.html' : null; binding = property6; var [property, env0_29] = hadInvalidUrlError2(applicationId2.useState(false), 2); const [property5, env0_31] = hadInvalidUrlError2(applicationId2.useState([]), 2); applicationId2.useEffect(_fun82298, [applicationId, binding]); const value30 = applicationId2.useCallback(_fun82306, [r24, property5]); const r32 = r24 != null && property3 != null && property4 != null; const value34 = applicationId2.useRef(null); const value35 = applicationId2.useCallback(_fun82307, []); const value36 = applicationId2.useCallback(_fun82308, [webViewKey, property3 == null ? value : property3.origin, value35]); applicationId2.useEffect(_fun82309, [value15, isPipOrGridMode, r32, value12, value35, safeAreasConfig]); if (r24 == null) { return null; } if (property3 == null) { return null; } if (binding) { if (property === false) { return null; } } object = {left: getSafeArea(safeAreasConfig == null ? value : safeAreasConfig.left, (value15 == null ? value : value15.left) ?? 0), right: getSafeArea(safeAreasConfig == null ? value : safeAreasConfig.right, (value15 == null ? value : value15.right) ?? 0), top: getSafeArea(safeAreasConfig == null ? value : safeAreasConfig.top, (value15 == null ? value : value15.top) ?? 0), bottom: getSafeArea(safeAreasConfig == null ? value : safeAreasConfig.bottom, (value15 == null ? value : value15.bottom) ?? 0)}; if (property4 == null) { r1 = null; } else { WebView = (require(5269) /* metro dependency 5269 */).WebView; var webViewProps = {style: styles.webView, ref: value34, source: {uri: r24}}; r24 = property3.port === '' ? property3.host : '' + property3.hostname + ':' + property3.port; webViewProps.androidAssetLoaderConfig = {domain: r24, httpAllowed: property3.protocol === 'http:', pathHandlers: [{type: 'internal', path: '/' + property2 + '/', directory: property4.substring(0, property4.lastIndexOf('/'))}]}; webViewProps.originWhitelist = ['*']; webViewProps.overScrollMode = 'never'; webViewProps.scrollEnabled = false; webViewProps.cacheEnabled = true; webViewProps.onError = value21; webViewProps.onContentProcessDidTerminate = value23; webViewProps.onRenderProcessGone = value22; webViewProps.webViewKey = webViewKey; webViewProps.temporaryParentNodeTag = value4; webViewProps.messagingWithWebViewKeyEnabled = webViewKey != null; webViewProps.onMessage = value36; webViewProps.allowFileAccess = property6; webViewProps.injectedJavaScript = property6 ? (require(10714) /* metro dependency 10714: createWebviewHtmlFile */).createInjectedJavascriptForIOS(webViewProps) : value; webViewProps.injectedJavaScriptForMainFrameOnly = false; webViewProps.onShouldStartLoadWithRequest = property6 ? value30 : value; webViewProps.mediaPlaybackRequiresUserAction = false; webViewProps.ignoreSilentHardwareSwitch = ignoreSilentHardwareSwitch; webViewProps.allowsInlineMediaPlayback = true; webViewProps.minimumFontSize = 1; webViewProps.bounces = false; webViewProps.allowsProtectedMedia = true; value = ; r1 = value; } return r1; function _fun82282() { // fn#82282, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:1996, offset: 0x01ef2459, size: 62 bytes, params: 1, frame: 12 var r0; var value; if (webViewKey != null) { r0 = getOrCreateFrameId(); } else { value = environment.__proto__; value = require(491) /* metro dependency 491 */; value = value.v4(); r0 = value; } return r0; } function _fun82283() { // fn#82283, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:2096, offset: 0x01ef2497, size: 60 bytes, params: 1, frame: 14 var r0; var value3; var moduleValue; if (webViewKey != null) { value3 = environment.__proto__; moduleValue = require(5269) /* metro dependency 5269 */; r0 = moduleValue.getWebViewProxy(webViewKey); } else { r0 = undefined; } return r0; } function _fun82284() { // fn#82284, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:2210, offset: 0x01ef24d3, size: 89 bytes, params: 1, frame: 14 var value3; var ComponentDispatch; if (!(env0_16 && webViewKey != null)) { value3 = environment.__proto__; ComponentDispatch = (require(1239) /* metro dependency 1239: ComponentDispatchUtils */).ComponentDispatch; ComponentDispatch.dispatch(ComponentActions.IFRAME_MOUNT, {id: env0_17}); } } function _fun82285() { // fn#82285, offset: 0x01ef252c, size: 11 bytes, params: 1, frame: 1 return _fun82286; function _fun82286() { // fn#82286, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:2315, offset: 0x01ef2537, size: 79 bytes, params: 1, frame: 14 var value2; var ComponentDispatch; if (webViewKey == null) { value2 = environment.__proto__.__proto__; ComponentDispatch = (require(1239) /* metro dependency 1239: ComponentDispatchUtils */).ComponentDispatch; ComponentDispatch.dispatch(ComponentActions.IFRAME_UNMOUNT, {id: env1_17}); } } } function _fun82287() { // fn#82287, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:2614, offset: 0x01ef2586, size: 21 bytes, params: 1, frame: 9 _fun82288()(); function _fun82288() { // fn#82288, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:2625, offset: 0x01ef259b, size: 36 bytes, params: 1, frame: 12 const env0_0 = env2_4(_fun82290); return _fun82291; function* _fun82290() { // fn#82290, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:2645, offset: 0x01ef25ca, size: 396 bytes, params: 1, frame: 23 if (false) { return undefined; } value = environment.__proto__.__proto__.__proto__.__proto__; let binding = env4_0; const value3 = undefined; const stableSafeAreaInsets = binding(env4_3[15]).getStableSafeAreaInsets(); const current = env3_25.current; const object = {}; binding = env4_19; const left = current == null ? value3 : current.left; const left2 = stableSafeAreaInsets == null ? value3 : stableSafeAreaInsets.left; const value7 = 0; object.left = binding(left, left2 ?? value7); object.right = env4_19(current == null ? value3 : current.right, (stableSafeAreaInsets == null ? value3 : stableSafeAreaInsets.right) ?? value7); object.top = env4_19(current == null ? value3 : current.top, (stableSafeAreaInsets == null ? value3 : stableSafeAreaInsets.top) ?? value7); object.bottom = env4_19(current == null ? value3 : current.bottom, (stableSafeAreaInsets == null ? value3 : stableSafeAreaInsets.bottom) ?? value7); yield env4_1(env4_3[18])({iFrameUri: env3_24, iFrameSandboxAttributes: env3_23, referrerPolicy: ActivityPlatform, insets: object, messageForDisallowedNavigationError: env4_16 ? value3 : env4_10}); value = undefined; if (false) { return value; } if (value != null) { useHasInvalidUrlErrorState(value); } else { DeveloperActivityShelfStore(); } return value3; } function _fun82291() { // fn#82291, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:3195, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13 return env0_0.apply(this, arguments); } } } function _fun82292({nativeEvent}) { // fn#82292, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:3282, offset: 0x01ef2756, size: 86 bytes, params: 2, frame: 17 const value = environment.__proto__; const binding = env1_15; const warn = binding.warn; const applicationIdBinding = applicationId; const JSON = global.JSON; Reflect.apply(warn, binding, ['activity WebView error for appId ' + applicationIdBinding + '. ' + JSON.stringify(nativeEvent)]); } function _fun82293({nativeEvent}) { // fn#82293, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:3401, offset: 0x01ef27ac, size: 86 bytes, params: 2, frame: 17 const value = environment.__proto__; const binding = env1_15; const warn = binding.warn; const applicationIdBinding = applicationId; const JSON = global.JSON; Reflect.apply(warn, binding, ['activity WebView render process gone for appId ' + applicationIdBinding + '. ' + JSON.stringify(nativeEvent)]); } function _fun82294() { // fn#82294, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:3534, offset: 0x01ef2802, size: 218 bytes, params: 1, frame: 18 const binding = env1_15; const warn = binding.warn; const applicationIdBinding = applicationId; Reflect.apply(warn, binding, ['activity WebView content process terminated for appId ' + applicationIdBinding]); const defaultImport = AnalyticsUtils; const track = defaultImport.track; const ACTIVITY_WEB_VIEW_CONTENT_PROCESS_TERMINATED = AnalyticEvents.ACTIVITY_WEB_VIEW_CONTENT_PROCESS_TERMINATED; Reflect.apply(track, defaultImport, [ACTIVITY_WEB_VIEW_CONTENT_PROCESS_TERMINATED, {application_id: applicationIdBinding, channel_id: channelId, guild_id: guildId, activity_session_id: activitySessionId}]); const ComponentDispatch = (ComponentDispatchUtilsModule).ComponentDispatch; const dispatch = ComponentDispatch.dispatch; const IFRAME_UNMOUNT = ComponentActions.IFRAME_UNMOUNT; Reflect.apply(dispatch, ComponentDispatch, [IFRAME_UNMOUNT, {id: env0_17}]); releaseFrameId(); if (env0_20 != null) { env0_20.releaseWebView(); } onActivityCrash(); } function _fun82296() { // fn#82296, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:3941, offset: 0x01ef28ef, size: 79 bytes, params: 1, frame: 13 var URL; var value; var binding; var prototype; var value2; var uRL; var value3; var error; try { URL = global.URL; value = environment; binding = env0_24; prototype = URL.prototype; value2 = Object.create(prototype, {constructor: {value: URL}}); uRL = new URL(); value3 = uRL instanceof Object ? uRL : value2; binding = env0_19; binding(value3); } catch (error) { value = environment; if (!useActivityUrlOverride) { throw error; } setHasInvalidUrlError(true); } } function _fun82297() { // fn#82297, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:4030, offset: 0x01ef293e, size: 219 bytes, params: 1, frame: 18 var defaultImport; var show; var object; const intl = (IndexNativeModule).intl; const t = (IndexNativeModule).t; if (!hadInvalidUrlError && hasInvalidUrlError) { value = environment.__proto__; defaultImport = importDefault(4647) /* metro dependency 4647: AlertActionCreators */; show = defaultImport.show; object = {}; object.title = intl.string(t.PtobXW); object.body = intl.string(t['55iAUT']); object.confirmText = intl.string(t.BddRzS); Reflect.apply(show, defaultImport, [object]); } } function _fun82298() { // fn#82298, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:4412, offset: 0x01ef2a19, size: 58 bytes, params: 1, frame: 9 if (env0_28) { var env0_0 = ["'self'"]; var parseCsp = function(a0, a1) { var r0; var value = a1.match(a0); if (value === null) { r0 = []; } else if (value.length >= 2) { value = value[1].split(' '); value = value.filter(_fun82300); r0 = value; } else { r0 = []; } return r0; }; _fun82301()(); } function parseCsp(a0, a1) { // fn#82299, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:4450, offset: 0x01ef2a53, size: 85 bytes, params: 3, frame: 12 var r0; let value = a1.match(a0); if (value === null) { r0 = []; } else if (value.length >= 2) { value = value[1].split(' '); value = value.filter(_fun82300); r0 = value; } else { r0 = []; } return r0; function _fun82300(a0) { // fn#82300, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:4528, offset: 0x01ef2aa8, size: 25 bytes, params: 2, frame: 11 const binding = env1_0; return !binding.includes(a0); } } function _fun82301() { // fn#82301, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:4554, offset: 0x01ef2ac1, size: 36 bytes, params: 1, frame: 12 const env0_0 = env2_4(_fun82303); return _fun82305; function* _fun82303() { // fn#82303, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:4574, offset: 0x01ef2af0, size: 289 bytes, params: 1, frame: 20 var environment; if (true) { value = environment.__proto__.__proto__.__proto__; var binding = env3_6; var HermesInternal = global.HermesInternal; var concat = HermesInternal.concat; var value3 = 'https://' + binding + '.' + 'discordsays.com'; var HTTP = env4_0(env4_3[23]).HTTP; var get = HTTP.get; HermesInternal = global.HermesInternal; concat = HermesInternal.concat; yield Reflect.apply(get, HTTP, [{url: '' + value3 + '/.discord/csp', rejectWithError: false}]); var value5 = undefined; if (false) { return value5; } var property = value5.headers['content-security-policy']; items2 = ['about:blank', 'file://*']; items2[2] = value3; arraySpread(items2, getOrCreateFrameId(RegExp('child-src (.*?);', ''), property), arraySpread(items2, getOrCreateFrameId(RegExp('frame-src (.*?);', ''), property), 3, concat), concat); env3_31(items2.map(_fun82304)); env3_29(true); } function _fun82304(a0) { // fn#82304, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:4851, offset: 0x01ef2c11, size: 88 bytes, params: 2, frame: 13 let value = environment.__proto__.__proto__.__proto__.__proto__.__proto__; value = env5_1(env5_3[24]); value = value(a0); value = value.replace(RegExp('\\\\\\*', 'g'), '.*'); return '^' + value; } } function _fun82305() { // fn#82305, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:4914, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13 return env0_0.apply(this, arguments); } } } function _fun82306(a0) { // fn#82306, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:4997, offset: 0x01ef2c69, size: 310 bytes, params: 2, frame: 18 var r3; var r1; var value4; var RegExp; var prototype; var value5; var regExp; var value6; var test; var url; var value7; var value12; var origin; var pathname; const mainDocumentURL = a0.mainDocumentURL; var value; if (env0_27 != null) { reducibleJoin3: while (true) { if (mainDocumentURL == null) { break reducibleJoin3; } if (mainDocumentURL !== env0_27) { value = environment.__proto__; Linking.openURL(a0.url); return false; } break reducibleJoin3; } } value = _createForOfIteratorHelperLoose_82276(env0_30); const value3 = value(); let done = value3.done; if (!done) { r3 = value3; reducibleLoop4: while (true) { value4 = r3.value; RegExp = global.RegExp; prototype = RegExp.prototype; value5 = Object.create(prototype, {constructor: {value: RegExp}}); regExp = new RegExp(); value6 = regExp instanceof Object ? regExp : value5; test = value6.test; url = a0.url; if (Reflect.apply(test, value6, [url])) { return true; } value7 = value(); done = value7.done; if (done) { break reducibleLoop4; } r3 = value7; continue reducibleLoop4; } } value = Reflect.apply((importDefault(1471) /* metro dependency 1471: URLUtils */).toURLSafe, value, [DeveloperActivityShelfStore.getActivityUrlOverride() ?? '']); const defaultImport = importDefault(1471) /* metro dependency 1471: URLUtils */; const value10 = defaultImport.toURLSafe(a0.url); const value11 = value != null; reducibleJoin10: while (true) { if (value11) { value12 = value10 != null; r1 = value12; break reducibleJoin10; } r1 = value11; break reducibleJoin10; } reducibleJoin12: while (true) { if (r1) { origin = value.origin; pathname = value.pathname; value = origin + pathname; origin = value10.origin; pathname = value10.pathname; value = value === origin + pathname; r1 = value; break reducibleJoin12; } break reducibleJoin12; } return r1; } function _fun82307(a0) { // fn#82307, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:5440, offset: 0x01ef2d9f, size: 66 bytes, params: 2, frame: 13 var injectJavaScript; var value; const current = env0_33.current; if (current != null) { injectJavaScript = current.injectJavaScript; value = environment.__proto__; value = importDefault(8071) /* metro dependency 8071: getPostMessageJavaScript */; Reflect.apply(injectJavaScript, current, [value(a0)]); } } function _fun82308(a0) { // fn#82308, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:5528, offset: 0x01ef2de1, size: 160 bytes, params: 2, frame: 17 var JSON; var value2; var value6; var value7; var defaultImport; if (webViewKey == null) { JSON = global.JSON; value2 = JSON.parse(a0.nativeEvent.data); if (typeof value2 === 'object' && env0_18?.origin != null) { value6 = environment.__proto__; value7 = undefined; defaultImport = importDefault(8072) /* metro dependency 8072: WebViewPostMessageTransport */; defaultImport.handleMessage(value2, env0_18 == null ? value7 : env0_18.origin, env0_34); } } } function _fun82309() { // fn#82309, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:5738, offset: 0x01ef2e81, size: 43 bytes, params: 1, frame: 9 if (env0_32) { if (env0_20 != null) { _fun82310()(); } } function _fun82310() { // fn#82310, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:5765, offset: 0x01ef2eac, size: 36 bytes, params: 1, frame: 12 const env0_0 = env2_4(_fun82312); return _fun82313; function* _fun82312() { // fn#82312, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:5785, offset: 0x01ef2edb, size: 434 bytes, params: 1, frame: 25 var left; var left2; var right; var right2; var top; var top2; var bottom; var bottom2; var left3; var right3; var top3; var bottom3; var injectJavaScript; var binding2; var property; var value6; var value7; var value8; var value9; var value10; var error; var current; var binding3; if (false) { return undefined; } value = undefined; const r13 = DISALLOWED_NAVIGATION_ERROR_CLOSE_ACTIVITY ? {'top': 0, 'bottom': 0, 'left': 0, 'right': 0} : env3_22; const object = {type: 'safeAreaUpdateEvent'}; const object3 = {}; let binding = env4_19; reducibleJoin6: while (true) { if (AnalyticEvents == null) { left = value; break reducibleJoin6; } left = AnalyticEvents.left; break reducibleJoin6; } reducibleJoin8: while (true) { if (r13 == null) { left2 = value; break reducibleJoin8; } left3 = r13.left; left2 = left3; break reducibleJoin8; } const value5 = 0; object3.left = binding(left, left2 ?? value5); binding = env4_19; reducibleJoin11: while (true) { if (AnalyticEvents == null) { right = value; break reducibleJoin11; } right = AnalyticEvents.right; break reducibleJoin11; } reducibleJoin13: while (true) { if (r13 == null) { right2 = value; break reducibleJoin13; } right3 = r13.right; right2 = right3; break reducibleJoin13; } object3.right = binding(right, right2 ?? value5); binding = env4_19; reducibleJoin16: while (true) { if (AnalyticEvents == null) { top = value; break reducibleJoin16; } top = AnalyticEvents.top; break reducibleJoin16; } reducibleJoin18: while (true) { if (r13 == null) { top2 = value; break reducibleJoin18; } top3 = r13.top; top2 = top3; break reducibleJoin18; } object3.top = binding(top, top2 ?? value5); binding = env4_19; reducibleJoin21: while (true) { if (AnalyticEvents == null) { bottom = value; break reducibleJoin21; } bottom = AnalyticEvents.bottom; break reducibleJoin21; } reducibleJoin23: while (true) { if (r13 == null) { bottom2 = value; break reducibleJoin23; } bottom3 = r13.bottom; bottom2 = bottom3; break reducibleJoin23; } object3.bottom = binding(bottom, bottom2 ?? value5); object.data = {insets: object3}; reducibleJoin26: while (true) { reduciblePort41: while (true) { exceptionLanding39: while (true) { try { } catch (error) { break exceptionLanding39; } break reducibleJoin26; } current = env3_33.current; reducibleJoin41: while (true) { if (current == null) { break reducibleJoin41; } binding = env3_34; binding3 = env4_1; binding(binding3(env4_3[26])(object)); break reducibleJoin41; } break reduciblePort41; } return value; } try { injectJavaScript = BaseActivityWebView.injectJavaScript; } catch (error) { break exceptionLanding39; } try { binding = env4_1; } catch (error) { break exceptionLanding39; } try { binding2 = env4_3; } catch (error) { break exceptionLanding39; } try { property = binding2[26]; } catch (error) { break exceptionLanding39; } try { value6 = binding(property); } catch (error) { break exceptionLanding39; } try { value7 = value6(object); } catch (error) { break exceptionLanding39; } try { value8 = Reflect.apply(injectJavaScript, BaseActivityWebView, [value7]); } catch (error) { break exceptionLanding39; } yield value8; try { value9 = undefined; value10 = false; } catch (error) { break exceptionLanding39; } return value10 ? value9 : value; } function _fun82313() { // fn#82313, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:6301, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13 return env0_0.apply(this, arguments); } } } } function useHasInvalidUrlErrorState() { // fn#82314, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:7586, offset: 0x01ef308d, size: 91 bytes, params: 1, frame: 15 const value3 = Module00057(ReactModule.useState(false), 2); const property = value3[0]; const object = {hasInvalidUrlError: property, setHasInvalidUrlError: value3[1]}; object.hadInvalidUrlError = (importDefault(6266) /* metro dependency 6266: usePrevious */)(property); return object; } function EmbeddedActivityWebView(a0) { // fn#82315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:7754, offset: 0x01ef30e8, size: 293 bytes, params: 2, frame: 25 const channelId = a0.channelId; const currentEmbeddedActivity = a0.currentEmbeddedActivity; const applicationId = a0.applicationId; const object = {'channelId': 0, 'currentEmbeddedActivity': 0, 'applicationId': 0}; silentSetPrototypeOf(object, null, undefined); const value = copyDataProperties({}, a0, object, undefined); const {hasInvalidUrlError, setHasInvalidUrlError, hadInvalidUrlError} = useHasInvalidUrlErrorState(); const object2 = {}; if (currentEmbeddedActivity != null) { if (currentEmbeddedActivity.customId != null) { object2.custom_id = currentEmbeddedActivity.customId; } if (currentEmbeddedActivity.referrerId != null) { object2.referrer_id = currentEmbeddedActivity.referrerId; } } ReactModule.useEffect(_fun82316, [hasInvalidUrlError, hadInvalidUrlError, channelId, applicationId, currentEmbeddedActivity]); return ( ); function _fun82316() { // fn#82316, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:8084, offset: 0x01ef320d, size: 155 bytes, params: 1, frame: 16 var value3; var defaultImport; var value4; if (!hadInvalidUrlError && hasInvalidUrlError) { if (channelId != null) { value3 = environment.__proto__; defaultImport = importDefault(7712) /* metro dependency 7712: ChannelRTCActionCreators */; defaultImport.selectParticipant(channelId, null); } value4 = environment.__proto__; (importDefault(8092) /* metro dependency 8092: EmbeddedActivitiesNativeManager */).leaveActivity({location: currentEmbeddedActivity?.location, applicationId: applicationId, showFeedback: false}); } } function hasFrameId() { // fn#82317, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:8284, owner: EmbeddedActivityWebView.hasFrameId, offset: 0x01ef32a8, size: 37 bytes, params: 1, frame: 11 const value = environment.__proto__; return (EmbeddedActivitiesNativeManager).hasFrameId(); } function getOrCreateFrameId() { // fn#82318, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:8329, owner: EmbeddedActivityWebView.getOrCreateFrameId, offset: 0x01ef32cd, size: 37 bytes, params: 1, frame: 11 const value = environment.__proto__; return (EmbeddedActivitiesNativeManager).getOrCreateFrameId(); } function releaseFrameId() { // fn#82319, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10895:8378, owner: EmbeddedActivityWebView.releaseFrameId, offset: 0x01ef32f2, size: 37 bytes, params: 1, frame: 11 const value = environment.__proto__; return (EmbeddedActivitiesNativeManager).releaseFrameId(); } } } global.__d(_fun82275, 10709, [5, 57, 31, 27, 7503, 4237, 661, 33, 4501, 3, 477, 10710, 491, 5269, 1239, 10711, 1582, 10713, 10714, 683, 632, 4647, 1244, 507, 10715, 1471, 8071, 8072, 6266, 7712, 8092, 2]) /* metro module 10709, dependencies: [5, 57, 31, 27, 7503, 4237, 661, 33, 4501, 3, 477, 10710, 491, 5269, 1239, 10711, 1582, 10713, 10714, 683, 632, 4647, 1244, 507, 10715, 1471, 8071, 8072, 6266, 7712, 8092, 2] */;