/* Metro module 12642; source: components_native/QRScannerModal.tsx; dependencies: [57, 31, 27, 661, 5117, 33, 477, 12643, 697, 5459, 1585, 1471, 4245, 5080, 12637, 1962, 7007, 12620, 3853, 4496, 1244, 8792, 8196, 1305, 2] */
import Module00057 from '../by-id/module-00057.js'; /* Metro dependency 57 */
import Native from '../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import UseSafeAreaInsetsNative from '../modules/safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import TouchableHitBox from '../design/void/TouchableHitBox/native/TouchableHitBox.tsx'; /* Metro dependency 8792 */
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 ConstantsModule from '../Constants.tsx'; /* Metro dependency 661 */
import * as FamilyCenterConstantsModule from '../modules/parent_tools/FamilyCenterConstants.tsx'; /* Metro dependency 5117 */
import * as RunAfterInteractionsUtilsModule from '../utils/native/RunAfterInteractionsUtils.tsx'; /* Metro dependency 5459 */
function _fun96953(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#96953, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12832:6, offset: 0x0216d7f8, size: 483 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const requireNativeComponent = value.requireNativeComponent;
const env0_5 = value.View;
value = require(33) /* metro dependency 33 */;
const env0_8 = value.jsx;
const env0_9 = value.jsxs;
if (Reflect.apply((require(477) /* metro dependency 477: PlatformUtils */).isAndroid, value, [])) {
value = importDefault(12643) /* metro dependency 12643: QRScannerNativeComponent */;
} else {
value = requireNativeComponent('DCDQRScanner');
}
object = {scanner: {'position': 'absolute', 'height': '100%', 'width': '100%'}};
object.closeButton = {marginLeft: 8};
const BLACK = (Native).unsafe_rawColors.BLACK;
object.emptyView = {backgroundColor: BLACK};
const BRAND_500 = (Native).unsafe_rawColors.BRAND_500;
object.showHelp = {'marginLeft': 16, 'marginRight': 16, 'marginTop': 'auto', 'borderRadius': 16,
'backgroundColor': null, 'paddingTop': 4, 'paddingBottom': 4, 'paddingLeft': 16, 'paddingRight': 16,
backgroundColor: BRAND_500};
const WHITE = (Native).unsafe_rawColors.WHITE;
object.text = {color: WHITE, textAlign: 'center'};
object = {SUCCEEDED: 'SUCCEEDED', FAILED: 'FAILED'};
(FileImportTrackerModule).fileFinishedImporting('components_native/QRScannerModal.tsx');
exports.default = QRScannerModal;
function DCDQRScanner(a0) { // fn#96954, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12832:313, offset: 0x0216d9db, size: 33 bytes, params: 2, frame: 13
return ((Component) => )(env0_10);
}
function QRScannerModal({showHelp, onScanSuccess}) { // fn#96955, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12832:910, offset: 0x0216d9fc, size: 631 bytes, params: 2, frame: 29
const r8 = showHelp !== undefined && showHelp;
const [property, env0_1] = Module00057(ReactModule.useState(true), 2);
ReactModule.useEffect(_fun96956, []);
const {bottom, top} = (UseSafeAreaInsetsNative)();
const items2 = [
property
? (
)
: (
),
];
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
items2[1] = (
);
items2[2] = (
r8
? (
property
? null
: (
{((LegacyText) => {intl.string((require(1244) /* metro dependency 1244: indexNative */).t.dklV0G)})((require(1305) /* metro dependency 1305: native */).LegacyText)}
)
)
: null
);
return (
{items2}
);
function _fun96956() { // fn#96956, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12832:1041, offset: 0x0216dc73, size: 58 bytes, params: 1, frame: 12
var environment;
const value = environment.__proto__;
const env0_0 = (RunAfterInteractionsUtilsModule).runAfterInteractions(_fun96957);
return _fun96958;
function _fun96957() { // fn#96957, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12832:1082, offset: 0x011d76b4, size: 18 bytes, params: 1, frame: 11
env1_1(false);
}
function _fun96958() { // fn#96958, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12832:1102, offset: 0x0216dcad, size: 21 bytes, params: 1, frame: 9
env0_0.cancel();
}
}
function onQRCodeFound(a0) { // fn#96959, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12832:1304, owner: QRScannerModal.onQRCodeFound, offset: 0x0216dcc2, size: 651 bytes, params: 2, frame: 22
var r5;
var object;
var onScanSuccessBinding;
var value3;
var defaultImport2;
var toURLSafe;
var result;
var hostname;
var pathname;
var remoteAuthFingerprint;
var defaultImport3;
var openURL;
var defaultImport6;
var pushLazy;
let nativeEvent = a0.nativeEvent;
const status = nativeEvent.status;
let value = environment.__proto__;
const SUCCEEDED = env1_12.SUCCEEDED;
if (SUCCEEDED === status) {
onScanSuccessBinding = onScanSuccess;
value3 = undefined;
if (value3 !== onScanSuccessBinding) {
onScanSuccess(a0.nativeEvent.result);
return value3;
}
defaultImport2 = importDefault(dependencyMap[11]);
toURLSafe = defaultImport2.toURLSafe;
nativeEvent = a0.nativeEvent;
result = nativeEvent.result;
r5 = Reflect.apply(toURLSafe, defaultImport2, [result]) ?? ({});
hostname = r5.hostname;
pathname = r5.pathname;
remoteAuthFingerprint = require(dependencyMap[12]).findRemoteAuthFingerprint(hostname, pathname);
if (remoteAuthFingerprint != null) {
importDefault(dependencyMap[13]).pop();
defaultImport6 = importDefault(dependencyMap[13]);
pushLazy = defaultImport6.pushLazy;
value = require(dependencyMap[15]);
value = value(dependencyMap[14], dependencyMap.paths);
Reflect.apply(pushLazy, defaultImport6, [value, {remoteAuthFingerprint: remoteAuthFingerprint}]);
return value3;
}
r5 = pathname == null ? value3 : pathname.match(FAMILY_CENTER_LINK_REQUEST_REGEX);
if (r5 == null) {
defaultImport3 = importDefault(dependencyMap[18]);
defaultImport3.openURL(a0.nativeEvent.result, value3, false);
importDefault(dependencyMap[13]).pop();
return undefined;
}
if (pathname != null) {
importDefault(dependencyMap[13]).pop();
require(dependencyMap[16]).openUserSettings({screen: UserSettingsSections.FAMILY_CENTER});
require(dependencyMap[17]).handleFamilyCenterQRCodeScan(pathname, 'UserSettingsQRCodeScan');
return value3;
}
defaultImport3 = importDefault(dependencyMap[18]);
openURL = defaultImport3.openURL;
nativeEvent = a0.nativeEvent;
result = nativeEvent.result;
Reflect.apply(openURL, defaultImport3, [result, value3, false]);
} else {
env1_12.FAILED;
var defaultImport = importDefault(dependencyMap[19]);
var show = defaultImport.show;
object = {};
var intl = require(dependencyMap[20]).intl;
var string = intl.string;
var t = require(dependencyMap[20]).t;
var QOQlWa = t.QOQlWa;
object.body = Reflect.apply(string, intl, [QOQlWa]);
intl = require(dependencyMap[20]).intl;
string = intl.string;
t = require(dependencyMap[20]).t;
object.title = Reflect.apply(string, intl, [t['6S318H']]);
Reflect.apply(show, defaultImport, [object]);
}
importDefault(dependencyMap[13]).pop();
}
}
}
global.__d(_fun96953, 12642, [57, 31, 27, 661, 5117, 33, 477, 12643, 697, 5459, 1585, 1471, 4245, 5080, 12637, 1962,
7007, 12620, 3853, 4496, 1244, 8792, 8196, 1305,
2]) /* metro module 12642, dependencies: [57, 31, 27, 661, 5117, 33, 477, 12643, 697, 5459, 1585, 1471, 4245, 5080, 12637, 1962, 7007, 12620, 3853, 4496, 1244, 8792, 8196, 1305, 2] */;