62 lines
3.2 KiB
JavaScript
62 lines
3.2 KiB
JavaScript
// Module ID: 13426
|
|
// Function ID: 13427
|
|
// Name: __exportStarResult23
|
|
// Dependencies: [13390, 13392, 13400, 13427, 13395, 13441, 13415, 13442, 13402]
|
|
|
|
// Module 13426 (__exportStarResult23)
|
|
const require = arg1;
|
|
const dependencyMap = arg6;
|
|
arg5.InitializeNumberFormat = function InitializeNumberFormat(arg0, arg1, arg2, arg3) {
|
|
let availableLocales;
|
|
let currencyDigitsData;
|
|
let getDefaultLocale;
|
|
let getInternalSlots;
|
|
let localeData;
|
|
let numberingSystemNames;
|
|
({ localeData, numberingSystemNames, getDefaultLocale } = arg3);
|
|
({ getInternalSlots, availableLocales, currencyDigitsData } = arg3);
|
|
const result = require(13390) /* CanonicalizeLocaleList */.CanonicalizeLocaleList(arg1);
|
|
const result1 = require(13392) /* __exportStarResult2 */.CoerceOptionsToObject(arg2);
|
|
let obj = Object.create(null);
|
|
obj.localeMatcher = require(13400) /* __exportStarResult4 */.GetOption(result1, "localeMatcher", "string", ["lookup", "best fit"], "best fit");
|
|
const GetOptionResult = require(13400) /* __exportStarResult4 */.GetOption(result1, "numberingSystem", "string", undefined, undefined);
|
|
if (undefined !== GetOptionResult) {
|
|
if (numberingSystemNames.indexOf(GetOptionResult) < 0) {
|
|
const _RangeError = RangeError;
|
|
const concat = "Invalid numberingSystems: ".concat;
|
|
throw RangeError("Invalid numberingSystems: ".concat(GetOptionResult));
|
|
}
|
|
}
|
|
obj.nu = GetOptionResult;
|
|
const ResolveLocaleResult = require(13427) /* match */.ResolveLocale(Array.from(availableLocales), result, obj, ["nu"], localeData, getDefaultLocale);
|
|
require(13395) /* getMultiInternalSlots */.invariant(!!localeData[ResolveLocaleResult.dataLocale], "Missing locale data for ".concat(ResolveLocaleResult.dataLocale));
|
|
const internalSlots = getInternalSlots(arg0);
|
|
({ locale: tmp11.locale, dataLocale: tmp11.dataLocale, nu: tmp11.numberingSystem } = ResolveLocaleResult);
|
|
internalSlots.dataLocaleData = localeData[ResolveLocaleResult.dataLocale];
|
|
const result2 = tmp(13441).SetNumberFormatUnitOptions(internalSlots, result1);
|
|
const style = internalSlots.style;
|
|
const GetOptionResult1 = require(13400) /* __exportStarResult4 */.GetOption(result1, "notation", "string", ["standard", "scientific", "engineering", "compact"], "standard");
|
|
internalSlots.notation = GetOptionResult1;
|
|
if ("currency" === style) {
|
|
if ("standard" === GetOptionResult1) {
|
|
obj = { currencyDigitsData: null };
|
|
obj[0] = currencyDigitsData;
|
|
let num2 = tmp(13415).CurrencyDigits(internalSlots.currency, obj);
|
|
let num3 = num2;
|
|
}
|
|
const result3 = tmp(13442).SetNumberFormatDigitOptions(internalSlots, result1, num3, num2, GetOptionResult1);
|
|
let str6 = "auto";
|
|
if ("compact" === GetOptionResult1) {
|
|
internalSlots.compactDisplay = tmp(13400).GetOption(result1, "compactDisplay", "string", ["short", "long"], "short");
|
|
str6 = "min2";
|
|
}
|
|
internalSlots.useGrouping = tmp(13402).GetStringOrBooleanOption(result1, "useGrouping", ["min2", "auto", "always"], "always", false, str6);
|
|
internalSlots.signDisplay = tmp(13400).GetOption(result1, "signDisplay", "string", ["auto", "never", "always", "exceptZero", "negative"], "auto");
|
|
return arg0;
|
|
}
|
|
num2 = 3;
|
|
if ("percent" === style) {
|
|
num2 = 0;
|
|
}
|
|
num3 = 0;
|
|
};
|