326 lines
19 KiB
TypeScript
326 lines
19 KiB
TypeScript
/* Metro module 9385; source: modules/connections/native/DomainVerifyModal.tsx; dependencies: [57, 31, 27, 661, 33, 4501, 697, 1484, 507, 6618, 4573, 1244, 8967, 9386, 4578, 5080, 5282, 5280, 2] */
|
|
function _fun73200(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#73200, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9571:6, offset: 0x01d622a5, size: 471 bytes, params: 8, frame: 23
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
const env0_5 = (require(27) /* metro dependency 27 */).View;
|
|
let value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_6 = value.Endpoints;
|
|
const env0_7 = value.PlatformTypes;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_8 = value.jsx;
|
|
const env0_9 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
const object2 = {};
|
|
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
|
|
object2.backgroundColor = BACKGROUND_BASE_LOWEST;
|
|
object2.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
|
|
object2.padding = 8;
|
|
object2.marginTop = 16;
|
|
const env0_10 = Reflect.apply(createStyles, value, [{container: {padding: 16}, description: {textAlign: 'center'},
|
|
input: {'paddingHorizontal': 0, 'paddingVertical': 0, 'marginVertical': 16}, dns: object2,
|
|
error: {marginTop: 16}, code: {'fontFamily': 'monospace', 'marginBottom': 4}, button: {marginTop: 16}}]);
|
|
object = {DOMAIN: 'DOMAIN', PROOF_DNS: 'PROOF_DNS', PROOF_HTTP: 'PROOF_HTTP'};
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/connections/native/DomainVerifyModal.tsx');
|
|
exports.default = DomainVerifyModal;
|
|
}
|
|
|
|
function DomainScreen({onClose}) { // fn#73201, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9571:648, offset: 0x01d6247c, size: 596 bytes, params: 2, frame: 31
|
|
const styles = useStyles();
|
|
const env0_1 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const [property, property2] = env0_3Binding(env0_4Binding.useState(''), 2);
|
|
var [property3, env0_3] = env0_3Binding(env0_4Binding.useState(null), 2);
|
|
var [property4, env0_4] = env0_3Binding(env0_4Binding.useState(false), 2);
|
|
const closure = onSubmitEditing_73202;
|
|
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const NxPUqY = (require(1244) /* metro dependency 1244: indexNative */).t.NxPUqY;
|
|
const items2 = [<Text variant="text-md/normal" color="text-default" style={styles.description}>{Reflect.apply(string,
|
|
intl, [NxPUqY])}</Text>];
|
|
const FreeFormInputGroup = importDefault(8967) /* metro dependency 8967: FreeFormInputGroup */;
|
|
const freeFormInputGroupProps = {autoFocus: true, style: styles.input,
|
|
label: intl.string((require(1244) /* metro dependency 1244: indexNative */).t['4jIAa+'])};
|
|
const EXAMPLE_DOMAIN = (require(9386) /* metro dependency 9386: DomainVerifyUtils */).EXAMPLE_DOMAIN;
|
|
freeFormInputGroupProps.placeholder = EXAMPLE_DOMAIN;
|
|
freeFormInputGroupProps.error = property3;
|
|
freeFormInputGroupProps.returnKeyType = 'done';
|
|
freeFormInputGroupProps.onChangeText = property2;
|
|
freeFormInputGroupProps.onSubmitEditing = closure;
|
|
items2[1] = <FreeFormInputGroup {...freeFormInputGroupProps} />;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
string = intl.string;
|
|
const PDTjLN = (require(1244) /* metro dependency 1244: indexNative */).t.PDTjLN;
|
|
items2[2] = <Button loading={property4} disabled={property === ''} text={Reflect.apply(string, intl,
|
|
[PDTjLN])} onPress={closure} />;
|
|
return (
|
|
<SafeAreaPaddingView bottom style={styles.container}>
|
|
{items2}
|
|
</SafeAreaPaddingView>
|
|
);
|
|
}
|
|
|
|
function DNSProofScreen({onClose, domain, proof}) { // fn#73206, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9571:1763, offset: 0x01d62853, size: 1123 bytes, params: 2, frame: 36
|
|
const styles = useStyles();
|
|
const env0_3 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const [property, env0_4] = env0_3(env0_4Binding.useState(null), 2);
|
|
const [property2, env0_5] = env0_3(env0_4Binding.useState(false), 2);
|
|
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const items3 = [<Text variant="text-md/normal">{Reflect.apply(string, intl,
|
|
[(require(1244) /* metro dependency 1244: indexNative */).t.cSURbq])}</Text>];
|
|
string = intl.string;
|
|
const GL3q7k = (require(1244) /* metro dependency 1244: indexNative */).t.GL3q7k;
|
|
const items2 = [<Text variant="text-md/normal">{Reflect.apply(string, intl, [GL3q7k])}</Text>];
|
|
items2[1] = <Text variant="text-md/normal" selectable style={styles.code}>{(require(9386) /* metro dependency 9386: DomainVerifyUtils */).getDnsName(domain)}</Text>;
|
|
string = intl.string;
|
|
const Ccmixu = (require(1244) /* metro dependency 1244: indexNative */).t.Ccmixu;
|
|
items2[2] = <Text variant="text-md/normal">{Reflect.apply(string, intl, [Ccmixu])}</Text>;
|
|
items2[3] = <Text variant="text-md/normal" selectable style={styles.code}>{'TXT'}</Text>;
|
|
string = intl.string;
|
|
const PVLriT = (require(1244) /* metro dependency 1244: indexNative */).t.PVLriT;
|
|
items2[4] = <Text variant="text-md/normal">{Reflect.apply(string, intl, [PVLriT])}</Text>;
|
|
items2[5] = <Text variant="text-md/normal" selectable style={styles.code}>{proof}</Text>;
|
|
items3[1] = <View style={styles.dns}>{items2}</View>;
|
|
items3[2] = property != null && <Text variant="text-md/normal" color="text-feedback-critical" style={styles.error}>{property}</Text>;
|
|
let button = styles.button;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
items3[3] = <View style={button}><Button loading={property2} text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['13ofGu'])} onPress={onPress_73207} /></View>;
|
|
button = styles.button;
|
|
string = intl.string;
|
|
const CkfdNx = (require(1244) /* metro dependency 1244: indexNative */).t.CkfdNx;
|
|
items3[4] = <View style={button}><Button variant="secondary" text={Reflect.apply(string, intl,
|
|
[CkfdNx])} onPress={onPress_73211} /></View>;
|
|
return (
|
|
<SafeAreaPaddingView bottom style={styles.container}>
|
|
{items3}
|
|
</SafeAreaPaddingView>
|
|
);
|
|
}
|
|
|
|
function HTTPProofScreen({onClose, domain, proof}) { // fn#73212, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9571:3409, offset: 0x01d62e2f, size: 982 bytes, params: 2, frame: 36
|
|
const styles = useStyles();
|
|
const env0_2 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const [property, env0_3] = env0_3Binding(env0_4Binding.useState(null), 2);
|
|
var [property2, env0_4] = env0_3Binding(env0_4Binding.useState(false), 2);
|
|
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const items3 = [<Text variant="text-md/normal">{Reflect.apply(string, intl,
|
|
[(require(1244) /* metro dependency 1244: indexNative */).t.p4ql7y])}</Text>];
|
|
string = intl.string;
|
|
const GL3q7k = (require(1244) /* metro dependency 1244: indexNative */).t.GL3q7k;
|
|
const items2 = [<Text variant="text-md/normal">{Reflect.apply(string, intl, [GL3q7k])}</Text>];
|
|
items2[1] = <Text variant="text-md/normal" selectable style={styles.code}>{(require(9386) /* metro dependency 9386: DomainVerifyUtils */).getHttpName(domain)}</Text>;
|
|
string = intl.string;
|
|
const PVLriT = (require(1244) /* metro dependency 1244: indexNative */).t.PVLriT;
|
|
items2[2] = <Text variant="text-md/normal">{Reflect.apply(string, intl, [PVLriT])}</Text>;
|
|
items2[3] = <Text variant="text-md/normal" selectable style={styles.code}>{proof}</Text>;
|
|
items3[1] = <View style={styles.dns}>{items2}</View>;
|
|
items3[2] = property != null && <Text variant="text-md/normal" color="text-feedback-critical" style={styles.error}>{property}</Text>;
|
|
let button = styles.button;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
items3[3] = <View style={button}><Button loading={property2} text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['13ofGu'])} onPress={onPress_73213} /></View>;
|
|
button = styles.button;
|
|
string = intl.string;
|
|
const RhJMVQ = (require(1244) /* metro dependency 1244: indexNative */).t.RhJMVQ;
|
|
items3[4] = <View style={button}><Button variant="secondary" text={Reflect.apply(string, intl,
|
|
[RhJMVQ])} onPress={onPress_73217} /></View>;
|
|
return (
|
|
<SafeAreaPaddingView bottom style={styles.container}>
|
|
{items3}
|
|
</SafeAreaPaddingView>
|
|
);
|
|
}
|
|
|
|
function DomainVerifyModal(a0) { // fn#73218, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9571:4940, offset: 0x01d6334a, size: 473 bytes, params: 2, frame: 24
|
|
if (a0 == null) {
|
|
throwTypeError(a0, "Cannot destructure 'undefined' or 'null'.", undefined);
|
|
throw undefined;
|
|
}
|
|
const closure = DomainVerifyModalOnClose;
|
|
const object5 = {};
|
|
let DOMAIN = env0_11.DOMAIN;
|
|
const object6 = {};
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object6.headerTitle = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['7lo8+e']);
|
|
object6.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderBackButton(closure);
|
|
object6.render = render_73220;
|
|
object5[DOMAIN] = object6;
|
|
const PROOF_DNS = env0_11.PROOF_DNS;
|
|
const object7 = {};
|
|
object7.headerTitle = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['7lo8+e']);
|
|
object7.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderBackButton(closure);
|
|
object7.render = render_73221;
|
|
object5[PROOF_DNS] = object7;
|
|
const PROOF_HTTP = env0_11.PROOF_HTTP;
|
|
const object8 = {};
|
|
object8.headerTitle = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['7lo8+e']);
|
|
object8.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderBackButton(closure);
|
|
object8.render = render_73222;
|
|
object5[PROOF_HTTP] = object8;
|
|
const Navigator = (require(5280) /* metro dependency 5280: NavigatorNative */).Navigator;
|
|
DOMAIN = env0_11.DOMAIN;
|
|
return (
|
|
<Navigator
|
|
screens={object5}
|
|
initialRouteName={DOMAIN}
|
|
headerBackTitle={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['13/7kX'])}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function DomainScreenOnPress() { // fn#73202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9571:848, owner: DomainScreen.onPress, offset: 0x01d626d0, size: 171 bytes, params: 1, frame: 18
|
|
env0_4(true);
|
|
env0_3(null);
|
|
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const post = HTTP.post;
|
|
const CONNECTION = Endpoints.CONNECTION;
|
|
const DOMAIN = PlatformTypes.DOMAIN;
|
|
let value = Reflect.apply(post, HTTP, [{url: Reflect.apply(CONNECTION, Endpoints, [DOMAIN, env0_2]), body: {},
|
|
rejectWithError: false}]);
|
|
value = value.then(function() {
|
|
onClose();
|
|
});
|
|
value = value.catch(_fun73204);
|
|
value.finally(_fun73205);
|
|
}
|
|
|
|
function DNSProofScreenOnPress() { // fn#73207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9571:2907, owner: DNSProofScreen.onPress, offset: 0x01d62cb6, size: 171 bytes, params: 1, frame: 18
|
|
env0_5(true);
|
|
env0_4(null);
|
|
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const post = HTTP.post;
|
|
const CONNECTION = Endpoints.CONNECTION;
|
|
const DOMAIN = PlatformTypes.DOMAIN;
|
|
let value = Reflect.apply(post, HTTP, [{url: Reflect.apply(CONNECTION, Endpoints, [DOMAIN, domain]), body: {},
|
|
rejectWithError: false}]);
|
|
value = value.then(function() {
|
|
onClose();
|
|
});
|
|
value = value.catch(_fun73209);
|
|
value.finally(_fun73210);
|
|
}
|
|
|
|
function DNSProofScreenOnPress_73211() { // fn#73211, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9571:3356, owner: DNSProofScreen.onPress, offset: 0x01d62df8, size: 55 bytes, params: 1, frame: 15
|
|
const binding = env0_3;
|
|
const push = binding.push;
|
|
const PROOF_HTTP = env1_11.PROOF_HTTP;
|
|
Reflect.apply(push, binding, [PROOF_HTTP, {proof: proof, domain: domain}]);
|
|
}
|
|
|
|
function HTTPProofScreenOnPress() { // fn#73213, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9571:4376, owner: HTTPProofScreen.onPress, offset: 0x01d63205, size: 171 bytes, params: 1, frame: 18
|
|
env0_4(true);
|
|
env0_3(null);
|
|
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
|
|
const post = HTTP.post;
|
|
const CONNECTION = Endpoints.CONNECTION;
|
|
const DOMAIN = PlatformTypes.DOMAIN;
|
|
let value = Reflect.apply(post, HTTP, [{url: Reflect.apply(CONNECTION, Endpoints, [DOMAIN, domain]), body: {},
|
|
rejectWithError: false}]);
|
|
value = value.then(function() {
|
|
onClose();
|
|
});
|
|
value = value.catch(_fun73215);
|
|
value.finally(_fun73216);
|
|
}
|
|
|
|
function HTTPProofScreenOnPress_73217() { // fn#73217, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9571:4825, owner: HTTPProofScreen.onPress, offset: 0x01d63335, size: 21 bytes, params: 1, frame: 9
|
|
env0_2.pop();
|
|
}
|
|
|
|
function DomainVerifyModalOnClose() { // fn#73219, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9571:4983, owner: DomainVerifyModal.onClose, offset: 0x01d63523, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (importDefault(5080) /* metro dependency 5080: ModalActionCreators */).pop();
|
|
}
|
|
|
|
function DomainVerifyModalRender() { // fn#73220, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9571:5128, owner: DomainVerifyModal.render, offset: 0x01d63548, size: 35 bytes, params: 1, frame: 13
|
|
return <DomainScreen onClose={DomainVerifyModalOnClose} />;
|
|
}
|
|
|
|
function DomainVerifyModalRender_73221({domain, proof}) { // fn#73221, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9571:5293, owner: DomainVerifyModal.render, offset: 0x01d6356b, size: 60 bytes, params: 2, frame: 14
|
|
return (
|
|
<DNSProofScreen
|
|
domain={domain}
|
|
proof={proof}
|
|
onClose={DomainVerifyModalOnClose}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function DomainVerifyModalRender_73222({domain, proof}) { // fn#73222, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9571:5496, owner: DomainVerifyModal.render, offset: 0x01d635a7, size: 60 bytes, params: 2, frame: 14
|
|
return (
|
|
<HTTPProofScreen
|
|
domain={domain}
|
|
proof={proof}
|
|
onClose={DomainVerifyModalOnClose}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function _fun73204(a0) { // fn#73204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9571:969, offset: 0x01d6277b, size: 216 bytes, params: 2, frame: 16
|
|
var r0;
|
|
var value;
|
|
var binding;
|
|
var push;
|
|
var value2;
|
|
let body = a0.body;
|
|
if (body == null) {
|
|
value = environment.__proto__;
|
|
binding = env1_3;
|
|
body = a0.body;
|
|
value = undefined;
|
|
r0 = (body == null || body.errors == null || (body.errors.domain == null || body.errors.domain._errors == null) || body.errors.domain._errors[0] == null ? value : body.errors.domain._errors[0].message) || (a0.body == null ? value : a0.body.message);
|
|
r0 = !r0 ? a0.message : r0;
|
|
binding(r0);
|
|
} else if (body.proof) {
|
|
value = environment.__proto__;
|
|
binding = env1_1;
|
|
push = binding.push;
|
|
value2 = environment.__proto__.__proto__;
|
|
Reflect.apply(push, binding, [env2_11.PROOF_DNS, {proof: a0.body.proof, domain: env1_2}]);
|
|
} else {
|
|
value = environment.__proto__;
|
|
binding = env1_3;
|
|
body = a0.body;
|
|
value = undefined;
|
|
r0 = (body == null || body.errors == null || (body.errors.domain == null || body.errors.domain._errors == null) || body.errors.domain._errors[0] == null ? value : body.errors.domain._errors[0].message) || (a0.body == null ? value : a0.body.message);
|
|
r0 = !r0 ? a0.message : r0;
|
|
binding(r0);
|
|
}
|
|
}
|
|
|
|
function _fun73209(a0) { // fn#73209, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9571:3028, offset: 0x01d62d61, size: 133 bytes, params: 2, frame: 15
|
|
let value = environment.__proto__;
|
|
const binding = env1_4;
|
|
const body = a0.body;
|
|
value = undefined;
|
|
let r1 = (body == null || body.errors == null || (body.errors.domain == null || body.errors.domain._errors == null) || body.errors.domain._errors[0] == null ? value : body.errors.domain._errors[0].message) || (a0.body == null ? value : a0.body.message);
|
|
r1 = !r1 ? a0.message : r1;
|
|
binding(r1);
|
|
return value;
|
|
}
|
|
|
|
function _fun73210() { // fn#73210, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9571:3216, offset: 0x01d62de6, size: 18 bytes, params: 1, frame: 11
|
|
env1_5(false);
|
|
}
|
|
|
|
function _fun73215(a0) { // fn#73215, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9571:4497, offset: 0x01d632b0, size: 133 bytes, params: 2, frame: 15
|
|
let value = environment.__proto__;
|
|
const binding = env1_3;
|
|
const body = a0.body;
|
|
value = undefined;
|
|
let r1 = (body == null || body.errors == null || (body.errors.domain == null || body.errors.domain._errors == null) || body.errors.domain._errors[0] == null ? value : body.errors.domain._errors[0].message) || (a0.body == null ? value : a0.body.message);
|
|
r1 = !r1 ? a0.message : r1;
|
|
binding(r1);
|
|
return value;
|
|
}
|
|
|