200 lines
5.8 KiB
JavaScript
200 lines
5.8 KiB
JavaScript
// Metro module 3578 (f3579).
|
|
import * as _getUTCWeekYear from "./getUTCWeekYear";
|
|
import { __esModule } from "./getUTCWeekYear";
|
|
import * as _startOfUTCWeek from "./startOfUTCWeek";
|
|
import { mapValue, parseNDigits, normalizeTwoDigitYear } from "./Module3576";
|
|
import { Parser } from "./Parser";
|
|
let c1937_3, c1937_4;
|
|
let env1937 = {};
|
|
env1937[2] = function _typeof(a0) {
|
|
const r6 = typeof globalThis.Symbol === "function" && typeof Symbol.iterator === "symbol" ? function _typeof(a0) {
|
|
return typeof a0;
|
|
} : function _typeof(a0) {
|
|
return a0 && typeof globalThis.Symbol === "function" && a0.constructor === Symbol ? a0 === Symbol.prototype ? typeof a0 : "symbol" : typeof a0;
|
|
};
|
|
env1937[2] = r6;
|
|
return r6(a0);
|
|
};
|
|
env1937[5] = function _setPrototypeOf(a0, a1) {
|
|
const r3 = Object.setPrototypeOf || function _setPrototypeOf(a0, a1) {
|
|
a0.__proto__ = a1;
|
|
return a0;
|
|
};
|
|
env1937[5] = r3;
|
|
return r3(a0, a1);
|
|
};
|
|
env1937[6] = function _getPrototypeOf(a0) {
|
|
const r5 = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(a0) {
|
|
return a0.__proto__ || Object.getPrototypeOf(a0);
|
|
};
|
|
env1937[6] = r5;
|
|
return r5(a0);
|
|
};
|
|
c1937_3 = _getUTCWeekYear ? __esModule ? _getUTCWeekYear : {
|
|
default: _getUTCWeekYear
|
|
} : {
|
|
default: _getUTCWeekYear
|
|
};
|
|
const r34 = _startOfUTCWeek ? _startOfUTCWeek.__esModule ? _startOfUTCWeek : {
|
|
default: _startOfUTCWeek
|
|
} : {
|
|
default: _startOfUTCWeek
|
|
};
|
|
let _createSuperInternal2;
|
|
c1937_4 = r34;
|
|
_createSuperInternal2 = void 0;
|
|
const LocalWeekYearParser = function LocalWeekYearParser() {
|
|
if (this instanceof LocalWeekYearParser) {
|
|
const length = arguments.length;
|
|
const array = new Array(length);
|
|
let r0 = 0;
|
|
while (r0 < length) {
|
|
array[r0] = arguments[r0];
|
|
r0 = r0 + 1;
|
|
}
|
|
const r34 = _createSuperInternal2.call.apply(_createSuperInternal2, [this].concat(array));
|
|
const r35 = r34 === void 0;
|
|
if (r35) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
if ("priority" in r34) {
|
|
Object.defineProperty(r34, "priority", {
|
|
value: 130,
|
|
enumerable: true,
|
|
configurable: true,
|
|
writable: true
|
|
});
|
|
} else {
|
|
r34.priority = 130;
|
|
}
|
|
if (r35) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
const value = ["y", "R", "u", "Q", "q", "M", "L", "I", "d", "D", "i", "t", "T"];
|
|
if ("incompatibleTokens" in r34) {
|
|
Object.defineProperty(r34, "incompatibleTokens", {
|
|
value,
|
|
enumerable: true,
|
|
configurable: true,
|
|
writable: true
|
|
});
|
|
} else {
|
|
r34.incompatibleTokens = value;
|
|
}
|
|
return r34;
|
|
}
|
|
throw new TypeError("Cannot call a class as a function");
|
|
};
|
|
if (typeof Parser !== "function" && Parser !== null) {
|
|
throw new TypeError("Super expression must either be null or a function");
|
|
}
|
|
LocalWeekYearParser.prototype = Object.create(Parser && Parser.prototype, {
|
|
constructor: {
|
|
value: LocalWeekYearParser,
|
|
writable: true,
|
|
configurable: true
|
|
}
|
|
});
|
|
if (Parser) {
|
|
(0, env1937[5])(LocalWeekYearParser, Parser);
|
|
}
|
|
const LocalWeekYearParser2 = LocalWeekYearParser;
|
|
let r0 = 0;
|
|
let c1939_1 = (function _isNativeReflectConstruct() {
|
|
if (typeof globalThis.Reflect !== "undefined" && Reflect.construct) {
|
|
if (Reflect.construct.sham) {
|
|
return false;
|
|
}
|
|
if (typeof globalThis.Proxy === "function") {
|
|
return true;
|
|
}
|
|
try {
|
|
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
|
|
} catch ($e) {
|
|
return false;
|
|
}
|
|
return true;
|
|
}
|
|
return false;
|
|
})();
|
|
_createSuperInternal2 = function _createSuperInternal() {
|
|
let r27;
|
|
const r9 = (0, env1937[6])(LocalWeekYearParser2);
|
|
const r17 = c1939_1 ? Reflect.construct(r9, arguments, (0, env1937[6])(this).constructor) : r9.apply(this, arguments);
|
|
L8: {
|
|
if (r17) {
|
|
const r25 = (0, env1937[2])(r17);
|
|
r27 = r17;
|
|
if (r25 === "object") {
|
|
break L8;
|
|
}
|
|
r27 = r17;
|
|
if (typeof r27 === "function") {
|
|
break L8;
|
|
}
|
|
}
|
|
r27 = this;
|
|
if (this === void 0) {
|
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
}
|
|
}
|
|
return r27;
|
|
};
|
|
const r53 = [{
|
|
key: "parse",
|
|
value: function parse(a0, a1, a2) {
|
|
const valueCallback = function valueCallback(a0) {
|
|
return {
|
|
year: a0,
|
|
isTwoDigitYear: a1 === "YY"
|
|
};
|
|
};
|
|
if (a1 === "Y") {
|
|
return (0, mapValue)((0, parseNDigits)(4, a0), valueCallback);
|
|
}
|
|
if (a1 === "Yo") {
|
|
return (0, mapValue)(a2.ordinalNumber(a0, {
|
|
unit: "year"
|
|
}), valueCallback);
|
|
}
|
|
return (0, mapValue)((0, parseNDigits)(a1.length, a0), valueCallback);
|
|
}
|
|
}, {
|
|
key: "validate",
|
|
value: function validate(a0, a1) {
|
|
return a1.isTwoDigitYear || a1.year > 0;
|
|
}
|
|
}, {
|
|
key: "set",
|
|
value: function set(a0, a1, a2, a3) {
|
|
const r8 = (0, c1937_3.default)(a0, a3);
|
|
if (a2.isTwoDigitYear) {
|
|
a0.setUTCFullYear((0, normalizeTwoDigitYear)(a2.year, r8), 0, a3.firstWeekContainsDate);
|
|
a0.setUTCHours(0, 0, 0, 0);
|
|
return (0, c1937_4.default)(a0, a3);
|
|
}
|
|
a0.setUTCFullYear("era" in a1 && a1.era !== 1 ? 1 - a2.year : a2.year, 0, a3.firstWeekContainsDate);
|
|
a0.setUTCHours(0, 0, 0, 0);
|
|
return (0, c1937_4.default)(a0, a3);
|
|
}
|
|
}];
|
|
const prototype = LocalWeekYearParser.prototype;
|
|
if (0 < r53.length) {
|
|
do {
|
|
const r61 = r53[r0];
|
|
let enumerable = r61.enumerable;
|
|
const r1 = r0;
|
|
if (!enumerable) {
|
|
enumerable = false;
|
|
}
|
|
r61.enumerable = enumerable;
|
|
r61.configurable = true;
|
|
if ("value" in r61) {
|
|
r61.writable = true;
|
|
}
|
|
Object.defineProperty(prototype, r61.key, r61);
|
|
r0 = r1 + 1;
|
|
} while (r0 < r53.length);
|
|
}
|
|
export { LocalWeekYearParser };
|