/* Metro module 9961; source: modules/game_profile/hooks/useOpenExternalUrlFromGameProfile.tsx; dependencies: [57, 5, 31, 6871, 9962, 3847, 2] */ import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */ import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */ 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 */ function _fun77987(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10147:6, offset: 0x01e150fd, size: 208 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_7 = RegExp('^\\/app\\/(\\d+)(?:\\/)?', ''); const env0_8 = RegExp('^\\/games\\/store\\/title\\/([^/]+)', ''); (FileImportTrackerModule).fileFinishedImporting('modules/game_profile/hooks/useOpenExternalUrlFromGameProfile.tsx'); exports.default = useOpenExternalUrlFromGameProfile; function _getDeepLinkUrl() { // fn#77988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10147:197, offset: 0x01e151cd, size: 50 bytes, params: 1, frame: 14 return Module00005(_fun77990).apply(this, arguments); function* _fun77990(a0) { // fn#77990, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10147:250, offset: 0x01e1520a, size: 373 bytes, params: 2, frame: 22 var r6; var r8; var binding; var isProtocolRegistered; var value7; var value8; var binding2; var value9; var value10; var value12; let value = undefined; if (false) { return value; } let hostname = a0.hostname; if (hostname !== 'store.steampowered.com') { hostname = a0.hostname; value = environment.__proto__.__proto__; binding = env2_0; value8 = undefined; if (hostname !== binding(env2_2[4]).XBOX_GAME_PASS_STORE_HOSTNAME) { return null; } binding = env2_1; binding2 = env2_2; value9 = binding(binding2[3]); isProtocolRegistered = value9.isProtocolRegistered; binding = env2_0; yield Reflect.apply(isProtocolRegistered, value9, [binding(binding2[4]).XBOX_GAME_PASS_PROTOCOL]); value10 = undefined; if (false) { return value10; } if (value10) { value12 = a0.pathname.match(env2_8); r8 = value12 == null ? value8 : value12[1]; if (r8 != null) { value = env2_0(env2_2[4]); return value.buildXboxGamePassStoreDeepLinkUrl(global.decodeURIComponent(r8)); } return null; } } else { value = environment.__proto__.__proto__; binding = env2_1; var value3 = undefined; var value4 = binding(env2_2[3]); isProtocolRegistered = value4.isProtocolRegistered; yield Reflect.apply(isProtocolRegistered, value4, [env2_6]); var value5 = undefined; if (false) { return value5; } if (value5) { value7 = a0.pathname.match(env2_7); r6 = value7 == null ? value3 : value7[1]; if (r6 != null) { return '' + env2_6 + '://store/' + r6; } hostname = a0.hostname; value = environment.__proto__.__proto__; binding = env2_0; value8 = undefined; if (hostname !== binding(env2_2[4]).XBOX_GAME_PASS_STORE_HOSTNAME) { return null; } binding = env2_1; binding2 = env2_2; value9 = binding(binding2[3]); isProtocolRegistered = value9.isProtocolRegistered; binding = env2_0; yield Reflect.apply(isProtocolRegistered, value9, [binding(binding2[4]).XBOX_GAME_PASS_PROTOCOL]); value10 = undefined; if (false) { return value10; } if (value10) { value12 = a0.pathname.match(env2_8); r8 = value12 == null ? value8 : value12[1]; if (r8 != null) { value = env2_0(env2_2[4]); return value.buildXboxGamePassStoreDeepLinkUrl(global.decodeURIComponent(r8)); } return null; } return null; } hostname = a0.hostname; value = environment.__proto__.__proto__; binding = env2_0; value8 = undefined; if (hostname !== binding(env2_2[4]).XBOX_GAME_PASS_STORE_HOSTNAME) { return null; } binding = env2_1; binding2 = env2_2; value9 = binding(binding2[3]); isProtocolRegistered = value9.isProtocolRegistered; binding = env2_0; yield Reflect.apply(isProtocolRegistered, value9, [binding(binding2[4]).XBOX_GAME_PASS_PROTOCOL]); value10 = undefined; if (false) { return value10; } if (value10) { value12 = a0.pathname.match(env2_8); r8 = value12 == null ? value8 : value12[1]; if (r8 != null) { value = env2_0(env2_2[4]); return value.buildXboxGamePassStoreDeepLinkUrl(global.decodeURIComponent(r8)); } return null; } } return null; } } function useOpenExternalUrlFromGameProfile(a0) { // fn#77991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10147:838, offset: 0x01e1537f, size: 100 bytes, params: 2, frame: 16 const env0_0 = a0; const value = Module00057(ReactModule.useState(false), 2); const property = value[0]; const env0_2 = value[1]; return ReactModule.useCallback(_fun77992(), [a0, property]); function _fun77992() { // fn#77992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10147:949, offset: 0x01e153e3, size: 36 bytes, params: 1, frame: 12 const env0_0 = env1_4(_fun77994); return _fun77999; function* _fun77994(a0) { // fn#77994, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10147:969, offset: 0x01e15412, size: 252 bytes, params: 2, frame: 21 var environment; var URL; var prototype; var value3; var uRL; var value4; var error; if (true) { value = null; if (value != a0) { try { URL = global.URL; prototype = URL.prototype; value3 = Object.create(prototype, {constructor: {value: URL}}); uRL = new URL(a0); value4 = uRL instanceof Object ? uRL : value3; } catch (error) { return undefined; } yield getDeepLinkUrl(value4); var value5 = undefined; if (false) { return value5; } var r6 = value != value5 && importDefault ? value : value5; value4.searchParams.set('utm_source', 'discord'); var value9 = value4.toString(); if (value != require) { require(value9); } else if (value != r6) { openDeepLink(r6, dependencyMap); } else { value = environment.__proto__.__proto__.__proto__; env3_1(env3_2[5])(value9); } } } function getDeepLinkUrl() { // fn#77995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10147:1045, offset: 0x01e1550e, size: 30 bytes, params: 1, frame: 13 return env4_9.apply(this, arguments); } function openDeepLink(a0, a1) { // fn#77996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10147:1220, offset: 0x01e1552c, size: 114 bytes, params: 3, frame: 16 var environment; const env0_0 = a1; const env0_1 = global.setTimeout(function() { return require(true); }, 5000); global.window.addEventListener('blur', _fun77998, {once: true}); const value = environment.__proto__.__proto__.__proto__.__proto__; env4_1(env4_2[5])(a0); function _fun77998() { // fn#77998, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10147:1313, offset: 0x0133d844, size: 24 bytes, params: 1, frame: 11 return global.clearTimeout(env0_1); } } } function _fun77999() { // fn#77999, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10147:1384, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13 return env0_0.apply(this, arguments); } } } } global.__d(_fun77987, 9961, [57, 5, 31, 6871, 9962, 3847, 2]) /* metro module 9961, dependencies: [57, 5, 31, 6871, 9962, 3847, 2] */;