620 lines
27 KiB
React
620 lines
27 KiB
React
/* Metro module 1286; source: unknown; dependencies: [15, 17, 18, 162, 7, 6, 1287, 1288] */
|
|
function _fun14143(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#14143, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1413:6, offset: 0x00dfbdba, size: 247 bytes, params: 8, frame: 22
|
|
const env0_0 = require;
|
|
const isRichTextTag = function(a0) {
|
|
return a0[0] === '$';
|
|
};
|
|
const closure = bindFormatValuesWithBuilder;
|
|
const closure2 = bindFormatValues;
|
|
const env0_2 = require(15) /* metro dependency 15 */;
|
|
const env0_3 = require(17) /* metro dependency 17 */;
|
|
const env0_4 = require(18) /* metro dependency 18 */;
|
|
let value = require(162) /* metro dependency 162 */;
|
|
const value2 = require(7) /* metro dependency 7 */;
|
|
const env0_6 = require(6) /* metro dependency 6 */;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
exports.FormatBuilder = undefined;
|
|
exports.bindFormatValuesWithBuilder = closure;
|
|
exports.bindFormatValues = closure2;
|
|
exports.FormatBuilder = value2(FormatBuilder);
|
|
const Error = global.Error;
|
|
value = value(Error);
|
|
const env0_7 = _fun14152(value);
|
|
}
|
|
|
|
function _isNativeReflectConstruct_14144() { // fn#14144, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1413:108, offset: 0x00dfbeb1, size: 94 bytes, params: 1, frame: 18
|
|
var Boolean;
|
|
var prototype;
|
|
var valueOf;
|
|
var call;
|
|
var Reflect;
|
|
var construct;
|
|
var closure;
|
|
var value;
|
|
var error;
|
|
try {
|
|
Boolean = global.Boolean;
|
|
prototype = Boolean.prototype;
|
|
valueOf = prototype.valueOf;
|
|
call = valueOf.call;
|
|
Reflect = global.Reflect;
|
|
construct = Reflect.construct;
|
|
Boolean = global.Boolean;
|
|
closure = function() {
|
|
};
|
|
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
|
|
value = Reflect.apply(call, valueOf, [value]);
|
|
var result = !value;
|
|
} catch (error) {
|
|
}
|
|
return (_isNativeReflectConstruct_14144_isNativeReflectConstruct = function() {
|
|
return !!result;
|
|
})();
|
|
}
|
|
|
|
function bindFormatValuesWithBuilder({builder, originalMessage, nodes, locales, values, dataFormatters, formatConfig, currentPluralValue, keyPrefix}) { // fn#14148, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1413:1076, offset: 0x00dfbf22, size: 189 bytes, params: 2, frame: 14
|
|
var r2;
|
|
var pushLiteralText;
|
|
var closure;
|
|
var value;
|
|
let length = nodes.length;
|
|
reducibleJoin5: while (true) {
|
|
reducibleJoin3: while (true) {
|
|
if (length !== 1) {
|
|
break reducibleJoin3;
|
|
}
|
|
if (typeof nodes[0] !== 'string') {
|
|
break reducibleJoin3;
|
|
}
|
|
pushLiteralText = builder.pushLiteralText;
|
|
Reflect.apply(pushLiteralText, builder, [nodes[0]]);
|
|
break reducibleJoin5;
|
|
}
|
|
closure = bindFormatValuesWithBuilder_loop;
|
|
value = 0;
|
|
var env0_10 = value;
|
|
length = nodes.length;
|
|
if (!(value < length)) {
|
|
break reducibleJoin5;
|
|
}
|
|
r2 = value;
|
|
reducibleLoop4: while (true) {
|
|
closure();
|
|
value = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
env0_10 = value;
|
|
length = nodes.length;
|
|
if (value < length) {
|
|
r2 = value;
|
|
continue reducibleLoop4;
|
|
}
|
|
break reducibleJoin5;
|
|
}
|
|
break reducibleJoin5;
|
|
}
|
|
}
|
|
|
|
function bindFormatValues({Builder, originalMessage, nodes, locales, dataFormatters, formatConfig, values, currentPluralValue, keyPrefix}) { // fn#14150, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1413:3860, offset: 0x00dfc7b7, size: 192 bytes, params: 2, frame: 20
|
|
var r0;
|
|
let builder = new Builder({keyPrefix: keyPrefix});
|
|
if (typeof nodes === 'string') {
|
|
builder.pushLiteralText(nodes);
|
|
builder = builder.finish();
|
|
r0 = builder;
|
|
} else {
|
|
bindFormatValuesWithBuilder({builder: builder, originalMessage: originalMessage, nodes: nodes, locales: locales,
|
|
dataFormatters: dataFormatters, formatConfig: formatConfig, values: values,
|
|
currentPluralValue: currentPluralValue, keyPrefix: keyPrefix});
|
|
builder = builder.finish();
|
|
r0 = builder;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function FormatBuilder(a0) { // fn#14151, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1413:549, offset: 0x00dfc877, size: 33 bytes, params: 2, frame: 13
|
|
env0_6(this, FormatBuilder);
|
|
this.context = a0;
|
|
}
|
|
|
|
function _fun14152(a0) { // fn#14152, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1413:640, offset: 0x00dfc898, size: 40 bytes, params: 2, frame: 14
|
|
const closure = MissingValueError;
|
|
env0_4(closure, a0);
|
|
return env0_5(closure);
|
|
}
|
|
|
|
function bindFormatValuesWithBuilder_loop() { // fn#14149, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1413:1309, owner: bindFormatValuesWithBuilder._loop, offset: 0x00dfbfdf, size: 2008 bytes, params: 1, frame: 33
|
|
var r12;
|
|
var r16;
|
|
var r9;
|
|
var r11;
|
|
var scale;
|
|
var r5;
|
|
var r10;
|
|
var binding;
|
|
var property4;
|
|
var Argument;
|
|
var Date;
|
|
var Time;
|
|
var Number;
|
|
var Tag;
|
|
var Select;
|
|
var Plural;
|
|
var property5;
|
|
var property6;
|
|
var HermesInternal;
|
|
var concat;
|
|
var value7;
|
|
var dataFormattersBinding;
|
|
var getPluralRules;
|
|
var value8;
|
|
var select;
|
|
var other;
|
|
var bindFormatValuesWithBuilderBinding;
|
|
var builderBinding;
|
|
var keyPrefixBinding;
|
|
var Object;
|
|
var property7;
|
|
var property8;
|
|
var bindFormatValuesBinding;
|
|
var constructor;
|
|
var value9;
|
|
var value10;
|
|
var value11;
|
|
var value12;
|
|
var Array;
|
|
var isArray;
|
|
var iterator;
|
|
var iterator2;
|
|
var item;
|
|
var item2;
|
|
var value13;
|
|
var pushObject;
|
|
var pushLiteralText;
|
|
var error;
|
|
var pushRichTextTag;
|
|
var number;
|
|
var parseNumberSkeleton;
|
|
var parseNumberSkeletonFromString;
|
|
var numberSkeleton;
|
|
var value14;
|
|
var formatNumber;
|
|
var time;
|
|
const parseDateTimeSkeleton = (require(1288) /* metro dependency 1288 */).parseDateTimeSkeleton;
|
|
var dateTimeSkeleton;
|
|
var formatTime;
|
|
var date;
|
|
var dateTimeSkeleton2;
|
|
var formatDate;
|
|
var value15;
|
|
var String;
|
|
let value = undefined;
|
|
let property = nodes[env0_10];
|
|
if (typeof property === 'string') {
|
|
builder.pushLiteralText(property);
|
|
return 0;
|
|
}
|
|
const value3 = 0;
|
|
const property2 = property[value3];
|
|
const FormatJsNodeType = (require(1287) /* metro dependency 1287 */).FormatJsNodeType;
|
|
const Pound = FormatJsNodeType.Pound;
|
|
if (property2 === Pound) {
|
|
reducibleJoin84: while (true) {
|
|
if (typeof currentPluralValue !== 'number') {
|
|
break reducibleJoin84;
|
|
}
|
|
dataFormattersBinding = dataFormatters;
|
|
formatNumber = dataFormattersBinding.formatNumber;
|
|
value = Reflect.apply(formatNumber, dataFormattersBinding, [currentPluralValue]);
|
|
builderBinding = builder;
|
|
pushLiteralText = builderBinding.pushLiteralText;
|
|
Reflect.apply(pushLiteralText, builderBinding, [value]);
|
|
break reducibleJoin84;
|
|
}
|
|
return value3;
|
|
}
|
|
const value5 = 1;
|
|
const property3 = property[value5];
|
|
reducibleJoin38: while (true) {
|
|
reducibleJoin5: while (true) {
|
|
if (property3 in values) {
|
|
break reducibleJoin5;
|
|
}
|
|
if (!isRichTextTag(property3)) {
|
|
throw new env1_7(property3, originalMessage, property2);
|
|
}
|
|
break reducibleJoin5;
|
|
}
|
|
property4 = values[property3];
|
|
Argument = FormatJsNodeType.Argument;
|
|
if (Argument === property2) {
|
|
value15 = typeof property4;
|
|
reducibleJoin81: while (true) {
|
|
reducibleJoin80: while (true) {
|
|
if (value15 === 'object') {
|
|
break reducibleJoin80;
|
|
}
|
|
if (value15 === 'function') {
|
|
break reducibleJoin80;
|
|
}
|
|
builderBinding = builder;
|
|
pushLiteralText = builderBinding.pushLiteralText;
|
|
String = global.String;
|
|
Reflect.apply(pushLiteralText, builderBinding, [String(property4)]);
|
|
break reducibleJoin81;
|
|
}
|
|
builderBinding = builder;
|
|
pushObject = builderBinding.pushObject;
|
|
Reflect.apply(pushObject, builderBinding, [property4]);
|
|
break reducibleJoin81;
|
|
}
|
|
} else {
|
|
Date = FormatJsNodeType.Date;
|
|
if (Date === property2) {
|
|
property = property[2];
|
|
date = formatConfig.date;
|
|
if (property in date) {
|
|
date = formatConfig.date;
|
|
property = date[property];
|
|
r9 = property;
|
|
} else {
|
|
reducibleJoin74: while (true) {
|
|
if (property != null) {
|
|
dateTimeSkeleton2 = parseDateTimeSkeleton(property);
|
|
r9 = dateTimeSkeleton2;
|
|
break reducibleJoin74;
|
|
}
|
|
r9 = value;
|
|
break reducibleJoin74;
|
|
}
|
|
}
|
|
builderBinding = builder;
|
|
pushLiteralText = builderBinding.pushLiteralText;
|
|
dataFormattersBinding = dataFormatters;
|
|
formatDate = dataFormattersBinding.formatDate;
|
|
Reflect.apply(pushLiteralText, builderBinding, [Reflect.apply(formatDate, dataFormattersBinding,
|
|
[property4,
|
|
r9])]);
|
|
} else {
|
|
Time = FormatJsNodeType.Time;
|
|
if (Time === property2) {
|
|
property = property[2];
|
|
time = formatConfig.time;
|
|
if (property in time) {
|
|
time = formatConfig.time;
|
|
property = time[property];
|
|
r10 = property;
|
|
} else {
|
|
reducibleJoin68: while (true) {
|
|
if (property != null) {
|
|
dateTimeSkeleton = parseDateTimeSkeleton(property);
|
|
r10 = dateTimeSkeleton;
|
|
break reducibleJoin68;
|
|
}
|
|
r10 = value;
|
|
break reducibleJoin68;
|
|
}
|
|
}
|
|
builderBinding = builder;
|
|
pushLiteralText = builderBinding.pushLiteralText;
|
|
dataFormattersBinding = dataFormatters;
|
|
formatTime = dataFormattersBinding.formatTime;
|
|
Reflect.apply(pushLiteralText, builderBinding, [Reflect.apply(formatTime, dataFormattersBinding,
|
|
[property4,
|
|
r10])]);
|
|
} else {
|
|
Number = FormatJsNodeType.Number;
|
|
if (Number === property2) {
|
|
property = property[2];
|
|
number = formatConfig.number;
|
|
if (property in number) {
|
|
number = formatConfig.number;
|
|
property = number[property];
|
|
r11 = property;
|
|
} else {
|
|
reducibleJoin55: while (true) {
|
|
if (property != null) {
|
|
parseNumberSkeleton = (require(1288) /* metro dependency 1288 */).parseNumberSkeleton;
|
|
parseNumberSkeletonFromString = (require(1288) /* metro dependency 1288 */).parseNumberSkeletonFromString;
|
|
numberSkeleton = parseNumberSkeleton(parseNumberSkeletonFromString(property));
|
|
r11 = numberSkeleton;
|
|
break reducibleJoin55;
|
|
}
|
|
r11 = value;
|
|
break reducibleJoin55;
|
|
}
|
|
}
|
|
reducibleJoin64: while (true) {
|
|
if (typeof property4 !== 'number') {
|
|
r10 = property4;
|
|
break reducibleJoin64;
|
|
}
|
|
reducibleJoin60: while (true) {
|
|
if (r11 == null) {
|
|
scale = value;
|
|
break reducibleJoin60;
|
|
}
|
|
scale = r11.scale;
|
|
break reducibleJoin60;
|
|
}
|
|
env0_0 = scale;
|
|
reducibleJoin63: while (true) {
|
|
if (scale === null) {
|
|
r5 = value5;
|
|
break reducibleJoin63;
|
|
}
|
|
if (value === env0_0) {
|
|
r5 = value5;
|
|
break reducibleJoin63;
|
|
}
|
|
binding = env0_0;
|
|
r5 = binding;
|
|
break reducibleJoin63;
|
|
}
|
|
value14 = property4 * r5;
|
|
r10 = value14;
|
|
break reducibleJoin64;
|
|
}
|
|
builderBinding = builder;
|
|
pushLiteralText = builderBinding.pushLiteralText;
|
|
dataFormattersBinding = dataFormatters;
|
|
formatNumber = dataFormattersBinding.formatNumber;
|
|
Reflect.apply(pushLiteralText, builderBinding, [Reflect.apply(formatNumber,
|
|
dataFormattersBinding,
|
|
[r10,
|
|
r11])]);
|
|
} else {
|
|
Tag = FormatJsNodeType.Tag;
|
|
if (Tag === property2) {
|
|
property8 = property[2];
|
|
property = property[3];
|
|
bindFormatValuesBinding = bindFormatValues;
|
|
constructor = builder.constructor;
|
|
keyPrefixBinding = keyPrefix;
|
|
binding = env0_10;
|
|
HermesInternal = global.HermesInternal;
|
|
concat = HermesInternal.concat;
|
|
value9 = bindFormatValuesBinding({Builder: constructor, nodes: property8, locales: locales,
|
|
dataFormatters: dataFormatters, formatConfig: formatConfig, values: values,
|
|
currentPluralValue: currentPluralValue,
|
|
keyPrefix: '' + keyPrefixBinding + '.' + binding});
|
|
if (property != null) {
|
|
bindFormatValuesBinding = bindFormatValues;
|
|
constructor = builder.constructor;
|
|
keyPrefixBinding = keyPrefix;
|
|
binding = env0_10;
|
|
HermesInternal = global.HermesInternal;
|
|
concat = HermesInternal.concat;
|
|
value10 = bindFormatValuesBinding({Builder: constructor, nodes: property,
|
|
locales: locales,
|
|
dataFormatters: dataFormatters, formatConfig: formatConfig, values: values,
|
|
currentPluralValue: currentPluralValue,
|
|
keyPrefix: '' + keyPrefixBinding + '.' + binding + '-control'});
|
|
r9 = value10;
|
|
} else {
|
|
r9 = [];
|
|
}
|
|
if (isRichTextTag(property3)) {
|
|
builderBinding = builder;
|
|
pushRichTextTag = builderBinding.pushRichTextTag;
|
|
Reflect.apply(pushRichTextTag, builderBinding, [property3, value9, r9]);
|
|
} else {
|
|
value11 = typeof property4;
|
|
if (value11 !== 'function') {
|
|
concat = global.HermesInternal.concat;
|
|
throw 'expected a function type for a Tag formatting value, ' + property3 + '. got ' + value11 + ': ' + property4;
|
|
}
|
|
keyPrefixBinding = keyPrefix;
|
|
binding = env0_10;
|
|
HermesInternal = global.HermesInternal;
|
|
concat = HermesInternal.concat;
|
|
value12 = property4(value9, '' + keyPrefixBinding + '.' + binding);
|
|
Array = global.Array;
|
|
isArray = Array.isArray;
|
|
reducibleJoin36: while (true) {
|
|
if (Reflect.apply(isArray, Array, [value12])) {
|
|
r16 = value12;
|
|
break reducibleJoin36;
|
|
}
|
|
r16 = [value12];
|
|
break reducibleJoin36;
|
|
}
|
|
iterator = r16[Symbol.iterator]();
|
|
iterator2 = iterator.next;
|
|
r12 = iterator;
|
|
item2 = Reflect.apply(iterator2, r12, []);
|
|
item = item2.value;
|
|
item2 = item2.done ? undefined : r12;
|
|
reducibleJoin81: while (true) {
|
|
if (item2 === value) {
|
|
break reducibleJoin81;
|
|
}
|
|
break reducibleJoin38;
|
|
}
|
|
}
|
|
} else {
|
|
Select = FormatJsNodeType.Select;
|
|
if (Select === property2) {
|
|
property = property[2];
|
|
if (property4 in property) {
|
|
property7 = property[property4];
|
|
r9 = property7;
|
|
} else {
|
|
other = property.other;
|
|
r9 = other;
|
|
}
|
|
if (r9 == null) {
|
|
Object = global.Object;
|
|
value = Object.keys(property);
|
|
value = value.join(', ');
|
|
concat = global.HermesInternal.concat;
|
|
throw '' + property4 + ' is not a known option for select value ' + property3 + '. Valid options are ' + value;
|
|
}
|
|
bindFormatValuesWithBuilderBinding = bindFormatValuesWithBuilder;
|
|
keyPrefixBinding = keyPrefix;
|
|
binding = env0_10;
|
|
HermesInternal = global.HermesInternal;
|
|
concat = HermesInternal.concat;
|
|
bindFormatValuesWithBuilderBinding({builder: builder, nodes: r9, locales: locales,
|
|
dataFormatters: dataFormatters,
|
|
formatConfig: formatConfig, values: values,
|
|
keyPrefix: '' + keyPrefixBinding + '.' + binding});
|
|
} else {
|
|
Plural = FormatJsNodeType.Plural;
|
|
reducibleJoin81: while (true) {
|
|
if (Plural !== property2) {
|
|
break reducibleJoin81;
|
|
}
|
|
property5 = property[2];
|
|
property6 = property[3];
|
|
property = property[4];
|
|
HermesInternal = global.HermesInternal;
|
|
concat = HermesInternal.concat;
|
|
value7 = '=' + property4;
|
|
if (value7 in property5) {
|
|
property = property5[value7];
|
|
r16 = property;
|
|
} else {
|
|
dataFormattersBinding = dataFormatters;
|
|
getPluralRules = dataFormattersBinding.getPluralRules;
|
|
value8 = Reflect.apply(getPluralRules, dataFormattersBinding,
|
|
[{type: property}]);
|
|
select = value8.select;
|
|
property = property5[Reflect.apply(select, value8,
|
|
[property4 - (property6 ?? value3)])];
|
|
reducibleJoin17: while (true) {
|
|
reducibleJoin16: while (true) {
|
|
if (property === null) {
|
|
break reducibleJoin16;
|
|
}
|
|
if (value !== property) {
|
|
r16 = property;
|
|
break reducibleJoin17;
|
|
}
|
|
break reducibleJoin16;
|
|
}
|
|
other = property5.other;
|
|
r16 = other;
|
|
break reducibleJoin17;
|
|
}
|
|
}
|
|
if (r16 == null) {
|
|
Object = global.Object;
|
|
value = Object.keys(property5);
|
|
value = value.join(', ');
|
|
concat = global.HermesInternal.concat;
|
|
throw '' + property4 + ' is not a known option for plural value ' + property3 + '. Valid options are ' + value;
|
|
}
|
|
bindFormatValuesWithBuilderBinding = bindFormatValuesWithBuilder;
|
|
r12 = property6 ?? value3;
|
|
keyPrefixBinding = keyPrefix;
|
|
binding = env0_10;
|
|
HermesInternal = global.HermesInternal;
|
|
concat = HermesInternal.concat;
|
|
bindFormatValuesWithBuilderBinding({builder: builder, nodes: r16, locales: locales,
|
|
dataFormatters: dataFormatters,
|
|
formatConfig: formatConfig, values: values, currentPluralValue: property4 - r12,
|
|
keyPrefix: '' + keyPrefixBinding + '.' + binding});
|
|
break reducibleJoin81;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
return value;
|
|
}
|
|
reducibleLoop38: while (true) {
|
|
try {
|
|
value13 = typeof item === 'string';
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
if (value13) {
|
|
try {
|
|
builderBinding = builder;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
pushLiteralText = builderBinding.pushLiteralText;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
Reflect.apply(pushLiteralText, builderBinding, [item]);
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
r12 = item2;
|
|
} else {
|
|
try {
|
|
builderBinding = builder;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
pushObject = builderBinding.pushObject;
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
try {
|
|
Reflect.apply(pushObject, builderBinding, [item]);
|
|
} catch (error) {
|
|
try {
|
|
item2.return();
|
|
} catch {
|
|
}
|
|
throw error;
|
|
}
|
|
r12 = item2;
|
|
}
|
|
item2 = Reflect.apply(iterator2, r12, []);
|
|
item = item2.value;
|
|
item2 = item2.done ? undefined : r12;
|
|
if (item2 === value) {
|
|
break reducibleLoop38;
|
|
}
|
|
continue reducibleLoop38;
|
|
}
|
|
return value;
|
|
}
|
|
|
|
function MissingValueError(a0, a1, a2) { // fn#14153, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1413:652, offset: 0x00dfc8c0, size: 176 bytes, params: 4, frame: 22
|
|
let value = environment.__proto__;
|
|
env1_6(this, MissingValueError);
|
|
const items2 = ["No value for variable '" + a0 + "' was provided for the localized message '" + a1 + "'"];
|
|
const value4 = env1_3(MissingValueError);
|
|
value = env1_2(this, _isNativeReflectConstruct_14144() ? global.Reflect.construct(value4, items2,
|
|
env1_3(this).constructor) : value4.apply(this, items2));
|
|
value.variableName = a0;
|
|
value.originalMessage = a1;
|
|
value.nodeType = a2;
|
|
return value;
|
|
}
|
|
|