decord/source/modules/phone/native/CountryCallingCodeSelect.tsx

211 lines
7.1 KiB
TypeScript
Raw Normal View History

2026-07-28 08:39:19 +00:00
// Module ID: 9214
// Function ID: 72126
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-28 08:39:19 +00:00
// Dependencies: [57, 31, 27, 3846, 33, 4165, 689, 9169, 3847, 8803, 5080, 5198, 4161, 9215, 9216, 8275, 1212, 9217, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-28 08:39:19 +00:00
// Module 9214 (_createForOfIteratorHelperLoose)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray";
import result from "result";
import { View } from "get ActivityIndicator";
import { getI18NCountryName } from "getCountryCodeByCountryName";
import jsxProd from "jsxProd";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
let closure_7;
let closure_8;
const require = arg1;
function _createForOfIteratorHelperLoose(iterable) {
let closure_0 = iterable;
iterable = "undefined" !== typeof Symbol;
if (iterable) {
2026-07-20 16:05:17 +00:00
const _Symbol = Symbol;
2026-07-23 10:11:24 +00:00
iterable = iterable[Symbol.iterator];
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (!iterable) {
iterable = iterable[Symbol.iterator];
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if (iterable) {
const iter = iterable.call(iterable);
2026-07-20 16:05:17 +00:00
const next = iter.next;
return next.bind(iter);
} else {
const _Array = Array;
2026-07-23 10:11:24 +00:00
let tmp = iterable;
if (!Array.isArray(iterable)) {
2026-07-20 16:05:17 +00:00
let tmp2;
2026-07-23 10:11:24 +00:00
if (iterable) {
if ("string" === typeof iterable) {
tmp2 = _arrayLikeToArray(iterable, undefined);
2026-07-20 16:05:17 +00:00
} else {
const toString = {}.toString;
2026-07-23 10:11:24 +00:00
const substr = toString.call(iterable).slice(8, -1);
2026-07-20 16:05:17 +00:00
let name = substr;
if (tmp3) {
2026-07-23 10:11:24 +00:00
name = iterable.constructor.name;
2026-07-20 16:05:17 +00:00
}
if ("Map" !== name) {
if ("Set" !== name) {
if ("Arguments" === name) {
2026-07-23 10:11:24 +00:00
let arr = _arrayLikeToArray(iterable, undefined);
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
let obj = /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/;
2026-07-20 16:05:17 +00:00
}
}
tmp2 = arr;
}
const _Array2 = Array;
2026-07-23 10:11:24 +00:00
arr = Array.from(iterable);
const callResult = toString.call(iterable);
tmp3 = "Object" === substr && iterable.constructor;
2026-07-20 16:05:17 +00:00
}
}
tmp = tmp2;
if (!tmp2) {
const _TypeError = TypeError;
const typeError = new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
throw typeError;
}
}
if (tmp) {
2026-07-23 10:11:24 +00:00
closure_0 = tmp;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c1 = 0;
2026-07-20 16:05:17 +00:00
return () => {
2026-07-23 10:11:24 +00:00
if (closure_1 >= length.length) {
2026-07-20 16:05:17 +00:00
let obj = { done: true };
} else {
obj = { done: false };
closure_1 = tmp3 + 1;
2026-07-23 10:11:24 +00:00
obj.value = length[+closure_1];
2026-07-20 16:05:17 +00:00
}
return obj;
};
}
}
function _arrayLikeToArray(arg0, arg1) {
let length;
if (tmp) {
length = arg0.length;
}
const ArrayResult = Array(length);
for (let num = 0; num < length; num = num + 1) {
ArrayResult[num] = arg0[num];
}
return ArrayResult;
}
2026-07-23 10:11:24 +00:00
({ jsx: closure_7, jsxs: closure_8 } = jsxProd);
let closure_9 = _createForOfIteratorHelperLoose.createStyles((arg0) => {
2026-07-20 16:05:17 +00:00
let obj = {};
2026-07-23 10:11:24 +00:00
obj = { backgroundColor: importDefault(689).colors.BACKGROUND_BASE_LOW };
const space = importDefault(689).space;
2026-07-20 16:05:17 +00:00
obj.paddingHorizontal = arg0 ? space.PX_24 : space.PX_12;
2026-07-23 10:11:24 +00:00
obj.paddingTop = importDefault(689).space.PX_16;
const space2 = importDefault(689).space;
2026-07-20 16:05:17 +00:00
obj.paddingBottom = arg0 ? space2.PX_24 : space2.PX_16;
obj.flex = 1;
obj.container = obj;
2026-07-23 10:11:24 +00:00
obj = { paddingBottom: importDefault(689).space.PX_16 };
2026-07-20 16:05:17 +00:00
obj.searchFieldContainer = obj;
return obj;
});
2026-07-23 10:11:24 +00:00
const result = require("get ActivityIndicator").fileFinishedImporting("modules/phone/native/CountryCallingCodeSelect.tsx");
2026-07-20 16:05:17 +00:00
export default function CountryCallingCodeSelect(onCountrySelected) {
onCountrySelected = onCountrySelected.onCountrySelected;
const onClose = onCountrySelected.onClose;
2026-07-23 10:11:24 +00:00
let tmp = callback2(onClose(first[7])());
let tmp2 = memo(rows.useState(""), 2);
first = tmp2[0];
memo = rows.useMemo(() => onClose(first[8]).flatMap((alpha2) => {
let closure_1;
2026-07-20 16:05:17 +00:00
let phoneCountryCodes;
alpha2 = alpha2.alpha2;
({ phoneCountryCodes, name: closure_1 } = alpha2);
2026-07-23 10:11:24 +00:00
let closure_2 = arg1;
let _slicedToArray = outer2_6(alpha2);
2026-07-20 16:05:17 +00:00
return phoneCountryCodes.map((code) => {
2026-07-23 10:11:24 +00:00
obj = { translatedName: _slicedToArray, key: "" + closure_2 + "-" + code, country: obj };
2026-07-20 16:05:17 +00:00
obj = { code, alpha2, name: closure_1 };
return obj;
});
}), []);
const items = [memo, first];
2026-07-23 10:11:24 +00:00
const memo1 = rows.useMemo(() => {
2026-07-20 16:05:17 +00:00
let iter2;
const rows = [];
2026-07-23 10:11:24 +00:00
const tmp = outer1_10(memo);
2026-07-20 16:05:17 +00:00
let iter = tmp();
if (!iter.done) {
do {
let value = iter.value;
2026-07-23 10:11:24 +00:00
let tmp2 = first;
let startsWithResult = 0 === first.length;
2026-07-20 16:05:17 +00:00
if (!startsWithResult) {
let str = value.country.code;
let replaced = str.replace(/\+|\s/g, "");
2026-07-23 10:11:24 +00:00
let tmp4 = first;
startsWithResult = replaced.startsWith(first.replace(/\+|\s/g, ""));
2026-07-20 16:05:17 +00:00
}
if (!startsWithResult) {
2026-07-23 10:11:24 +00:00
let tmp5 = onClose;
let tmp6 = first;
let tmp8 = first;
let tmp7 = onClose(first[10]);
2026-07-20 16:05:17 +00:00
let str2 = value.country.name;
2026-07-23 10:11:24 +00:00
let formatted = first.toLowerCase();
2026-07-20 16:05:17 +00:00
startsWithResult = tmp7(formatted, str2.toLowerCase());
}
if (!startsWithResult) {
2026-07-23 10:11:24 +00:00
let tmp10 = onClose;
let tmp11 = first;
let tmp13 = first;
let tmp12 = onClose(first[10]);
2026-07-20 16:05:17 +00:00
let str3 = value.translatedName;
2026-07-23 10:11:24 +00:00
let formatted1 = first.toLowerCase();
2026-07-20 16:05:17 +00:00
startsWithResult = tmp12(formatted1, str3.toLowerCase());
}
if (startsWithResult) {
let arr = rows.push(value);
}
iter2 = tmp();
iter = iter2;
} while (!iter2.done);
}
const sections = [rows.length];
return { rows, sections };
}, items);
2026-07-23 10:11:24 +00:00
rows = memo1.rows;
2026-07-20 16:05:17 +00:00
const items1 = [onClose, onCountrySelected, rows];
let obj = { style: tmp.container };
obj = { style: tmp.searchFieldContainer };
2026-07-23 10:11:24 +00:00
const callback = rows.useCallback((arg0, arg1) => {
2026-07-20 16:05:17 +00:00
const country = tmp.country;
let obj = { start: 0 === arg1, end: arg1 === rows.length - 1, label: tmp.translatedName };
obj = { variant: "text-md/semibold", children: country.code };
2026-07-23 10:11:24 +00:00
obj.trailing = outer1_7(onCountrySelected(first[12]).Text, obj);
2026-07-20 16:05:17 +00:00
obj.onPress = function onPress() {
country(country);
2026-07-23 10:11:24 +00:00
if (null != outer1_1) {
outer1_1();
2026-07-20 16:05:17 +00:00
}
};
2026-07-23 10:11:24 +00:00
return outer1_7(onCountrySelected(first[11]).TableRow, obj);
2026-07-20 16:05:17 +00:00
}, items1);
2026-07-23 10:11:24 +00:00
obj.children = callback(onCountrySelected(first[13]).SearchField, { size: "md", onChange: tmp2[1] });
const items2 = [callback(View, obj), ];
2026-07-20 16:05:17 +00:00
if ("" !== first) {
if (0 === rows.length) {
2026-07-23 10:11:24 +00:00
obj = { source: onClose(first[15]) };
const intl = onCountrySelected(first[16]).intl;
obj.text = intl.string(onCountrySelected(first[16]).t.wEHnxW);
let tmp10 = callback(onClose(first[14]), obj);
const tmp14 = onClose(first[14]);
2026-07-20 16:05:17 +00:00
}
items2[1] = tmp10;
obj.children = items2;
return closure_8(View, obj);
}
2026-07-23 10:11:24 +00:00
tmp10 = callback(onClose(first[17]), { sections: memo1.sections, renderItem: callback, itemSize: onClose(first[9])(), estimatedListSize: "windowSize", keyboardShouldPersistTaps: "always" });
2026-07-20 16:05:17 +00:00
};