decord/alpha/source/modules/phone/native/PhoneOrEmailInput.tsx

281 lines
8.7 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 6642
// Function ID: 6643
// Name: PhoneOrEmailInput
2026-10-09 10:00:15 +00:00
// Dependencies: [32, 109, 19, 21, 558, 576, 6643, 6644, 1126, 6646, 2]
2026-07-20 16:05:17 +00:00
2026-10-09 10:00:15 +00:00
// Module 6642 (PhoneOrEmailInput)
2026-10-03 08:58:59 +00:00
import Fragment from "Fragment" /* 21 */;
import intl2 from "intl" /* 1126 */;
2026-10-09 10:00:15 +00:00
import PhoneOrEmailUtils from "PhoneOrEmailUtils" /* 6643 */;
2026-10-03 08:58:59 +00:00
import _slicedToArray_mod from "_slicedToArray" /* 32 */;
2026-10-08 09:57:35 +00:00
import _objectWithoutProperties from "_objectWithoutProperties" /* 109 */;
2026-10-03 08:58:59 +00:00
import react_mod from "react" /* 19 */;
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-03 08:58:59 +00:00
const require = globalThis.__r;
2026-10-08 09:57:35 +00:00
let _require, dependencyMap;
2026-10-08 09:57:35 +00:00
let closure_3 = ["onChange", "alpha2", "countryCode", "onPressCountrySelector", "forceMode", "ref"];
2026-10-03 08:58:59 +00:00
let _slicedToArray = _slicedToArray_mod;
let react = react_mod;
const jsx = Fragment.jsx;
2026-10-08 09:57:35 +00:00
let tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function PhoneOrEmailInput(onChange) {
2026-10-03 08:58:59 +00:00
let alpha2;
let closure_0;
let closure_2;
let countryCode;
let forceMode;
let onPressCountrySelector;
2026-10-08 09:57:35 +00:00
let ref1;
2026-10-03 08:58:59 +00:00
let tmp16;
2026-10-08 09:57:35 +00:00
let tmp17;
let tmp6;
let tmp7;
2026-10-03 08:58:59 +00:00
let tmp9;
let tmp = _require;
let obj = require("react");
2026-10-08 09:57:35 +00:00
const cResult = obj.c(28);
2026-10-03 08:58:59 +00:00
if (cResult[0] !== onChange) {
onChange = onChange.onChange;
dependencyMap = onChange;
({ alpha2, countryCode } = onChange);
_require = countryCode;
({ onPressCountrySelector, forceMode } = onChange);
2026-10-08 09:57:35 +00:00
let closure_1 = forceMode;
2026-10-03 08:58:59 +00:00
cResult[0] = onChange;
cResult[1] = alpha2;
cResult[2] = countryCode;
cResult[3] = forceMode;
cResult[4] = onChange;
cResult[5] = onPressCountrySelector;
2026-10-08 09:57:35 +00:00
cResult[6] = onChange.ref;
const tmp13 = _objectWithoutProperties(onChange, closure_3);
class E {
constructor(arg0) {
tmp = closure_3(onChange);
obj = closure_0(closure_2[6]);
str = "";
if (obj.shouldShowCountryCodeSelector(closure_1, onChange)) {
2026-10-03 08:58:59 +00:00
str = closure_0;
}
if (closure_2 != null) {
2026-10-08 09:57:35 +00:00
tmp2 = closure_2(onChange, str);
2026-10-03 08:58:59 +00:00
}
2026-10-08 09:57:35 +00:00
return;
2026-10-03 08:58:59 +00:00
}
}
2026-10-08 09:57:35 +00:00
cResult[7] = tmp13;
tmp9 = ref;
tmp6 = forceMode;
tmp7 = onChange;
2026-10-03 08:58:59 +00:00
} else {
_require = cResult[2];
2026-10-08 09:57:35 +00:00
closure_1 = cResult[3];
2026-10-03 08:58:59 +00:00
dependencyMap = cResult[4];
tmp9 = cResult[6];
}
2026-10-08 09:57:35 +00:00
closure_3 = ref1(react.useState(""), 2)[1];
ref1(react.useState(""), 2);
ref1 = react.useRef(null);
const obj2 = react;
if (cResult[8] === Symbol.for("react.memo_cache_sentinel")) {
class S {
constructor() {
2026-10-09 10:00:15 +00:00
obj = { blur() { /* body not rendered: F139293 */ }, focus() { /* body not rendered: F139294 */ }, isFocused() { /* body not rendered: F139295 */ }, setText() { /* body not rendered: F139296 */ }, getText() { /* body not rendered: F139297 */ }, measure() { /* body not rendered: F139298 */ }, measureInWindow() { /* body not rendered: F139299 */ }, measureLayout() { /* body not rendered: F139300 */ } };
2026-10-08 09:57:35 +00:00
return obj;
}
}
2026-10-03 08:58:59 +00:00
const items = [];
2026-10-08 09:57:35 +00:00
cResult[8] = S;
cResult[9] = items;
tmp17 = items;
tmp16 = S;
2026-10-03 08:58:59 +00:00
} else {
2026-10-08 09:57:35 +00:00
class S {
constructor() {
2026-10-09 10:00:15 +00:00
obj = { blur() { /* body not rendered: F139293 */ }, focus() { /* body not rendered: F139294 */ }, isFocused() { /* body not rendered: F139295 */ }, setText() { /* body not rendered: F139296 */ }, getText() { /* body not rendered: F139297 */ }, measure() { /* body not rendered: F139298 */ }, measureInWindow() { /* body not rendered: F139299 */ }, measureLayout() { /* body not rendered: F139300 */ } };
2026-10-08 09:57:35 +00:00
return obj;
2026-10-03 08:58:59 +00:00
}
2026-10-08 09:57:35 +00:00
}
tmp17 = cResult[9];
}
const imperativeHandle = obj2.useImperativeHandle(tmp9, tmp16, tmp17);
2026-10-09 10:00:15 +00:00
tmp(6643);
2026-10-08 09:57:35 +00:00
if (cResult[10] === tmp5) {
class S {
constructor() {
2026-10-09 10:00:15 +00:00
obj = { blur() { /* body not rendered: F139293 */ }, focus() { /* body not rendered: F139294 */ }, isFocused() { /* body not rendered: F139295 */ }, setText() { /* body not rendered: F139296 */ }, getText() { /* body not rendered: F139297 */ }, measure() { /* body not rendered: F139298 */ }, measureInWindow() { /* body not rendered: F139299 */ }, measureLayout() { /* body not rendered: F139300 */ } };
2026-10-08 09:57:35 +00:00
return obj;
2026-10-03 08:58:59 +00:00
}
}
}
2026-10-08 09:57:35 +00:00
class E {
constructor(arg0) {
tmp = closure_3(onChange);
obj = closure_0(closure_2[6]);
str = "";
if (obj.shouldShowCountryCodeSelector(closure_1, onChange)) {
2026-10-03 08:58:59 +00:00
str = closure_0;
}
if (closure_2 != null) {
2026-10-08 09:57:35 +00:00
tmp2 = closure_2(onChange, str);
2026-10-03 08:58:59 +00:00
}
2026-10-08 09:57:35 +00:00
return;
2026-10-03 08:58:59 +00:00
}
}
2026-10-08 09:57:35 +00:00
cResult[10] = tmp5;
cResult[11] = tmp6;
cResult[12] = tmp7;
cResult[13] = E;
}) : (function PhoneOrEmailInput(onChange) {
2026-10-03 08:58:59 +00:00
let _undefined;
let alpha2;
let c4;
let closure_6;
let countryCode;
let tmp3;
2026-07-20 16:05:17 +00:00
onChange = onChange.onChange;
({ alpha2, countryCode } = onChange);
const onPressCountrySelector = onChange.onPressCountrySelector;
const forceMode = onChange.forceMode;
2026-10-08 09:57:35 +00:00
const ref = onChange.ref;
const merged = Object.assign(onChange, Object.assign({ onChange: 0, alpha2: 0, countryCode: 0, onPressCountrySelector: 0, forceMode: 0, ref: 0 }));
2026-10-03 08:58:59 +00:00
_slicedToArray = undefined;
react = undefined;
let obj = react;
[tmp3, c4] = _slicedToArray(react.useState(""), 2);
const tmp2 = _slicedToArray(react.useState(""), 2);
2026-10-08 09:57:35 +00:00
const ref1 = react.useRef(null);
2026-10-03 08:58:59 +00:00
const imperativeHandle = react.useImperativeHandle(ref, () => ({
2026-07-20 16:05:17 +00:00
blur() {
2026-10-08 09:57:35 +00:00
const current = ref1.current;
2026-07-20 16:05:17 +00:00
let blurResult;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
blurResult = current.blur();
}
return blurResult;
},
focus() {
2026-10-08 09:57:35 +00:00
const current = ref1.current;
2026-07-20 16:05:17 +00:00
let focusResult;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
focusResult = current.focus();
}
return focusResult;
},
isFocused() {
2026-10-08 09:57:35 +00:00
const current = ref1.current;
2026-07-29 08:29:29 +00:00
let flag;
if (current != null) {
flag = current.isFocused();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (flag == null) {
flag = false;
}
return flag;
2026-07-20 16:05:17 +00:00
},
setText(arg0) {
_undefined(arg0);
2026-10-08 09:57:35 +00:00
const current = ref1.current;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
current.setText(arg0);
}
},
getText() {
2026-10-08 09:57:35 +00:00
const current = ref1.current;
2026-07-29 08:29:29 +00:00
let str;
if (current != null) {
str = current.getText();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (str == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
return str;
},
measure(arg0) {
2026-10-08 09:57:35 +00:00
const current = ref1.current;
2026-07-20 16:05:17 +00:00
let measureResult;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
measureResult = current.measure(arg0);
}
return measureResult;
},
measureInWindow(arg0) {
2026-10-08 09:57:35 +00:00
const current = ref1.current;
2026-07-20 16:05:17 +00:00
let measureInWindowResult;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
measureInWindowResult = current.measureInWindow(arg0);
}
return measureInWindowResult;
},
measureLayout(arg0, arg1, arg2) {
2026-10-08 09:57:35 +00:00
const current = ref1.current;
2026-07-20 16:05:17 +00:00
let measureLayoutResult;
2026-07-29 08:29:29 +00:00
if (current != null) {
2026-07-20 16:05:17 +00:00
measureLayoutResult = current.measureLayout(arg0, arg1, arg2);
}
return measureLayoutResult;
}
}), []);
const items = [countryCode, forceMode, onChange];
2026-10-03 08:58:59 +00:00
const obj2 = onChange(onPressCountrySelector[6]);
const result = obj2.shouldShowCountryCodeSelector(forceMode, tmp3);
const callback = react.useCallback((cResult) => {
_undefined(cResult);
2026-07-20 16:05:17 +00:00
let str = "";
2026-10-03 08:58:59 +00:00
const obj = PhoneOrEmailUtils;
if (obj.shouldShowCountryCodeSelector(forceMode, cResult)) {
2026-07-20 16:05:17 +00:00
str = countryCode;
}
2026-07-29 08:29:29 +00:00
if (onChange != null) {
2026-10-03 08:58:59 +00:00
onChange(cResult, str);
2026-07-20 16:05:17 +00:00
}
}, items);
2026-10-03 08:58:59 +00:00
const tmp10 = countryCode(onPressCountrySelector[7])(callback);
react = tmp10;
2026-07-29 08:29:29 +00:00
const items1 = [countryCode, tmp10];
2026-10-03 08:58:59 +00:00
const effect = react.useEffect(() => {
2026-10-08 09:57:35 +00:00
const current = ref1.current;
2026-07-29 08:29:29 +00:00
let str;
2026-10-03 08:58:59 +00:00
const tmp = closure_6;
2026-07-29 08:29:29 +00:00
if (current != null) {
str = current.getText();
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (str == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
tmp(str);
2026-07-20 16:05:17 +00:00
}, items1);
let combined;
2026-10-03 08:58:59 +00:00
const tmp6 = onChange;
const tmp7 = onPressCountrySelector;
2026-07-20 16:05:17 +00:00
if (result) {
2026-07-29 08:29:29 +00:00
if (alpha2 == null) {
alpha2 = "";
2026-07-20 16:05:17 +00:00
}
const _HermesInternal = HermesInternal;
2026-10-03 08:58:59 +00:00
let str = " ";
2026-07-29 08:29:29 +00:00
combined = "" + alpha2 + " " + countryCode;
2026-07-20 16:05:17 +00:00
}
const items2 = [combined, onPressCountrySelector];
2026-07-29 08:29:29 +00:00
const memo = obj.useMemo(() => {
2026-10-03 08:58:59 +00:00
let intl;
let str;
const obj = { onPress: onPressCountrySelector, accessibilityRole: "button", accessibilityLabel: str, accessibilityHint: intl.string(intl2.t.GwAW3k) };
str = combined;
2026-07-29 08:29:29 +00:00
if (combined == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
intl = intl2.intl;
2026-07-20 16:05:17 +00:00
return obj;
}, items2);
2026-10-08 09:57:35 +00:00
const obj3 = { ref: ref1, onChange: callback, leadingText: combined, leadingPressableProps: memo };
2026-10-03 08:58:59 +00:00
const SplitTextInput = tmp6(tmp7[9]).SplitTextInput;
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(merged);
2026-10-03 08:58:59 +00:00
return combined(SplitTextInput, obj3);
2026-10-08 09:57:35 +00:00
});
2026-10-03 08:58:59 +00:00
let result = size.fileFinishedImporting("modules/phone/native/PhoneOrEmailInput.tsx");
2026-10-08 09:57:35 +00:00
export default tmp2;